noxium 1.0.10 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1067 +1,4 @@
1
- // @bun
2
- var WQ=Object.create;var{getPrototypeOf:HQ,defineProperty:VS,getOwnPropertyNames:KQ}=Object;var zS=Object.prototype.hasOwnProperty;function GQ(e){return this[e]}var YQ,JQ,QQ=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var s=t?YQ??=new WeakMap:JQ??=new WeakMap,i=s.get(e);if(i)return i}r=e!=null?WQ(HQ(e)):{};let o=t||!e||!e.__esModule||!zS.call(e,"default")?VS(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let u of KQ(e))if(!zS.call(o,u))VS(o,u,{get:GQ.bind(e,u),enumerable:!0})}if(n)s.set(e,o);return o};var g=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var G=import.meta.require;var Fg=g(function(oZ){var XQ=(()=>{let e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype),Symbol.toStringTag).get;return(t)=>e.call(t)})();function _c(e){return XQ(e)==="Uint8Array"}function Cg(e){return typeof e==="object"&&e!=null&&Symbol.toStringTag in e&&(e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer")}function ad(e){return e instanceof RegExp||Object.prototype.toString.call(e)==="[object RegExp]"}function hd(e){return typeof e==="object"&&e!=null&&Symbol.toStringTag in e&&e[Symbol.toStringTag]==="Map"}function cd(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function Ps(e,t){return JSON.stringify(e,(r,n)=>{if(typeof n==="bigint")return{$numberLong:`${n}`};else if(hd(n))return Object.fromEntries(n);return n})}function ZQ(e){if(e!=null&&typeof e==="object"&&"stylize"in e&&typeof e.stylize==="function")return e.stylize}var uh=7,fd=Symbol.for("@@mdb.bson.version"),ah=2147483647,ch=-2147483648,cw=Math.pow(2,63)-1,lw=-Math.pow(2,63),hw=Math.pow(2,53),fw=-Math.pow(2,53),bg=1,dw=2,nh=3,rh=4,Dg=5,eX=6,pw=7,mw=8,yw=9,Tg=10,ld=11,tX=12,Mg=13,gw=14,ud=15,ih=16,_w=17,xg=18,Ew=19,Aw=255,Ow=127,rX=0,Pg=4,Sw=Object.freeze({double:1,string:2,object:3,array:4,binData:5,undefined:6,objectId:7,bool:8,date:9,null:10,regex:11,dbPointer:12,javascript:13,symbol:14,javascriptWithScope:15,int:16,timestamp:17,long:18,decimal:19,minKey:-1,maxKey:127});class I extends Error{get bsonError(){return!0}get name(){return"BSONError"}constructor(e,t){super(e,t)}static isBSONError(e){return e!=null&&typeof e==="object"&&"bsonError"in e&&e.bsonError===!0&&"name"in e&&"message"in e&&"stack"in e}}class Ec extends I{get name(){return"BSONVersionError"}constructor(){super(`Unsupported BSON version, bson types must be from bson ${uh}.x.x`)}}class oh extends I{get name(){return"BSONRuntimeError"}constructor(e){super(e)}}class Ri extends I{get name(){return"BSONOffsetError"}offset;constructor(e,t,r){super(`${e}. offset: ${t}`,r);this.offset=t}}var WS,HS;function ww(e,t,r,n){if(n){WS??=new TextDecoder("utf8",{fatal:!0});try{return WS.decode(e.subarray(t,r))}catch(s){throw new I("Invalid UTF-8 string in BSON document",{cause:s})}}return HS??=new TextDecoder("utf8",{fatal:!1}),HS.decode(e.subarray(t,r))}function Cw(e,t,r){if(e.length===0)return"";let n=r-t;if(n===0)return"";if(n>20)return null;if(n===1&&e[t]<128)return String.fromCharCode(e[t]);if(n===2&&e[t]<128&&e[t+1]<128)return String.fromCharCode(e[t])+String.fromCharCode(e[t+1]);if(n===3&&e[t]<128&&e[t+1]<128&&e[t+2]<128)return String.fromCharCode(e[t])+String.fromCharCode(e[t+1])+String.fromCharCode(e[t+2]);let s=[];for(let i=t;i<r;i++){let o=e[i];if(o>127)return null;s.push(o)}return String.fromCharCode(...s)}function nX(e,t,r){if(t.length===0)return 0;if(t.length>25)return null;if(e.length-r<t.length)return null;for(let n=0,s=r;n<t.length;n++,s++){let i=t.charCodeAt(n);if(i>127)return null;e[s]=i}return t.length}function sX(e){return Vs.fromNumberArray(Array.from({length:e},()=>Math.floor(Math.random()*256)))}function iX(e){return crypto.getRandomValues(Vs.allocate(e))}var oX=(()=>{let{crypto:e}=globalThis;if(e!=null&&typeof e.getRandomValues==="function")return iX;else return sX})(),Vs={isUint8Array:_c,toLocalBufferType(e){if(Buffer.isBuffer(e))return e;if(ArrayBuffer.isView(e))return Buffer.from(e.buffer,e.byteOffset,e.byteLength);let t=e?.[Symbol.toStringTag]??Object.prototype.toString.call(e);if(t==="ArrayBuffer"||t==="SharedArrayBuffer"||t==="[object ArrayBuffer]"||t==="[object SharedArrayBuffer]")return Buffer.from(e);throw new I("Cannot create Buffer from the passed potentialBuffer.")},allocate(e){return Buffer.alloc(e)},allocateUnsafe(e){return Buffer.allocUnsafe(e)},compare(e,t){return Vs.toLocalBufferType(e).compare(t)},concat(e){return Buffer.concat(e)},copy(e,t,r,n,s){return Vs.toLocalBufferType(e).copy(t,r??0,n??0,s??e.length)},equals(e,t){return Vs.toLocalBufferType(e).equals(t)},fromNumberArray(e){return Buffer.from(e)},fromBase64(e){return Buffer.from(e,"base64")},fromUTF8(e){return Buffer.from(e,"utf8")},toBase64(e){return Vs.toLocalBufferType(e).toString("base64")},fromISO88591(e){return Buffer.from(e,"binary")},toISO88591(e){return Vs.toLocalBufferType(e).toString("binary")},fromHex(e){return Buffer.from(e,"hex")},toHex(e){return Vs.toLocalBufferType(e).toString("hex")},toUTF8(e,t,r,n){let s=r-t<=20?Cw(e,t,r):null;if(s!=null)return s;let i=Vs.toLocalBufferType(e).toString("utf8",t,r);if(n){for(let o=0;o<i.length;o++)if(i.charCodeAt(o)===65533){ww(e,t,r,!0);break}}return i},utf8ByteLength(e){return Buffer.byteLength(e,"utf8")},encodeUTF8Into(e,t,r){let n=nX(e,t,r);if(n!=null)return n;return Vs.toLocalBufferType(e).write(t,r,void 0,"utf8")},randomBytes:oX,swap32(e){return Vs.toLocalBufferType(e).swap32()}};function uX(){let{navigator:e}=globalThis;return typeof e==="object"&&e.product==="ReactNative"}function aX(e){if(e<0)throw RangeError(`The argument 'byteLength' is invalid. Received ${e}`);return ba.fromNumberArray(Array.from({length:e},()=>Math.floor(Math.random()*256)))}var cX=(()=>{let{crypto:e}=globalThis;if(e!=null&&typeof e.getRandomValues==="function")return(t)=>e.getRandomValues(ba.allocate(t));else{if(uX()){let{console:t}=globalThis;t?.warn?.("BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.")}return aX}})(),KS=/(\d|[a-f])/i,ba={isUint8Array:_c,toLocalBufferType(e){let t=e?.[Symbol.toStringTag]??Object.prototype.toString.call(e);if(t==="Uint8Array")return e;if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength));if(t==="ArrayBuffer"||t==="SharedArrayBuffer"||t==="[object ArrayBuffer]"||t==="[object SharedArrayBuffer]")return new Uint8Array(e);throw new I("Cannot make a Uint8Array from passed potentialBuffer.")},allocate(e){if(typeof e!=="number")throw TypeError(`The "size" argument must be of type number. Received ${String(e)}`);return new Uint8Array(e)},allocateUnsafe(e){return ba.allocate(e)},compare(e,t){if(e===t)return 0;let r=Math.min(e.length,t.length);for(let n=0;n<r;n++){if(e[n]<t[n])return-1;if(e[n]>t[n])return 1}if(e.length<t.length)return-1;if(e.length>t.length)return 1;return 0},concat(e){if(e.length===0)return ba.allocate(0);let t=0;for(let s of e)t+=s.length;let r=ba.allocate(t),n=0;for(let s of e)r.set(s,n),n+=s.length;return r},copy(e,t,r,n,s){if(s!==void 0&&s<0)throw RangeError(`The value of "sourceEnd" is out of range. It must be >= 0. Received ${s}`);if(s=s??e.length,n!==void 0&&(n<0||n>s))throw RangeError(`The value of "sourceStart" is out of range. It must be >= 0 and <= ${s}. Received ${n}`);if(n=n??0,r!==void 0&&r<0)throw RangeError(`The value of "targetStart" is out of range. It must be >= 0. Received ${r}`);r=r??0;let i=e.subarray(n,s),o=Math.min(i.length,t.length-r);if(o<=0)return 0;return t.set(i.subarray(0,o),r),o},equals(e,t){if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},fromNumberArray(e){return Uint8Array.from(e)},fromBase64(e){return Uint8Array.from(atob(e),(t)=>t.charCodeAt(0))},fromUTF8(e){return new TextEncoder().encode(e)},toBase64(e){return btoa(ba.toISO88591(e))},fromISO88591(e){return Uint8Array.from(e,(t)=>t.charCodeAt(0)&255)},toISO88591(e){return Array.from(Uint16Array.from(e),(t)=>String.fromCharCode(t)).join("")},fromHex(e){let t=e.length%2===0?e:e.slice(0,e.length-1),r=[];for(let n=0;n<t.length;n+=2){let s=t[n],i=t[n+1];if(!KS.test(s))break;if(!KS.test(i))break;let o=Number.parseInt(`${s}${i}`,16);r.push(o)}return Uint8Array.from(r)},toHex(e){return Array.from(e,(t)=>t.toString(16).padStart(2,"0")).join("")},toUTF8(e,t,r,n){let s=r-t<=20?Cw(e,t,r):null;if(s!=null)return s;return ww(e,t,r,n)},utf8ByteLength(e){return new TextEncoder().encode(e).byteLength},encodeUTF8Into(e,t,r){let n=new TextEncoder().encode(t);return e.set(n,r),n.byteLength},randomBytes:cX,swap32(e){if(e.length%4!==0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e.length;t+=4){let r=e[t],n=e[t+1],s=e[t+2],i=e[t+3];e[t]=i,e[t+1]=s,e[t+2]=n,e[t+3]=r}return e}},lX=typeof Buffer==="function"&&Buffer.prototype?._isBuffer!==!0,F=lX?Vs:ba,Da=Symbol.for("@@mdb.bson.type");class Hn{get[Da](){return this._bsontype}get[fd](){return uh}[Symbol.for("nodejs.util.inspect.custom")](e,t,r){return this.inspect(e,t,r)}}var yc=new Float64Array(1),lt=new Uint8Array(yc.buffer,0,8);yc[0]=-1;var _g=lt[7]===0,_e={isBigEndian:_g,getNonnegativeInt32LE(e,t){if(e[t+3]>127)throw RangeError(`Size cannot be negative at offset: ${t}`);return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24},getInt32LE(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24},getUint32LE(e,t){return e[t]+e[t+1]*256+e[t+2]*65536+e[t+3]*16777216},getUint32BE(e,t){return e[t+3]+e[t+2]*256+e[t+1]*65536+e[t]*16777216},getBigInt64LE(e,t){let r=BigInt(e[t+4]+e[t+5]*256+e[t+6]*65536+(e[t+7]<<24)),n=BigInt(e[t]+e[t+1]*256+e[t+2]*65536+e[t+3]*16777216);return(r<<32n)+n},getFloat64LE:_g?(e,t)=>(lt[7]=e[t],lt[6]=e[t+1],lt[5]=e[t+2],lt[4]=e[t+3],lt[3]=e[t+4],lt[2]=e[t+5],lt[1]=e[t+6],lt[0]=e[t+7],yc[0]):(e,t)=>(lt[0]=e[t],lt[1]=e[t+1],lt[2]=e[t+2],lt[3]=e[t+3],lt[4]=e[t+4],lt[5]=e[t+5],lt[6]=e[t+6],lt[7]=e[t+7],yc[0]),setInt32BE(e,t,r){return e[t+3]=r,r>>>=8,e[t+2]=r,r>>>=8,e[t+1]=r,r>>>=8,e[t]=r,4},setInt32LE(e,t,r){return e[t]=r,r>>>=8,e[t+1]=r,r>>>=8,e[t+2]=r,r>>>=8,e[t+3]=r,4},setBigInt64LE(e,t,r){let n=0xffffffffn,s=Number(r&n);e[t]=s,s>>=8,e[t+1]=s,s>>=8,e[t+2]=s,s>>=8,e[t+3]=s;let i=Number(r>>32n&n);return e[t+4]=i,i>>=8,e[t+5]=i,i>>=8,e[t+6]=i,i>>=8,e[t+7]=i,8},setFloat64LE:_g?(e,t,r)=>(yc[0]=r,e[t]=lt[7],e[t+1]=lt[6],e[t+2]=lt[5],e[t+3]=lt[4],e[t+4]=lt[3],e[t+5]=lt[2],e[t+6]=lt[1],e[t+7]=lt[0],8):(e,t,r)=>(yc[0]=r,e[t]=lt[0],e[t+1]=lt[1],e[t+2]=lt[2],e[t+3]=lt[3],e[t+4]=lt[4],e[t+5]=lt[5],e[t+6]=lt[6],e[t+7]=lt[7],8)};class ve extends Hn{get _bsontype(){return"Binary"}static BSON_BINARY_SUBTYPE_DEFAULT=0;static BUFFER_SIZE=256;static SUBTYPE_DEFAULT=0;static SUBTYPE_FUNCTION=1;static SUBTYPE_BYTE_ARRAY=2;static SUBTYPE_UUID_OLD=3;static SUBTYPE_UUID=4;static SUBTYPE_MD5=5;static SUBTYPE_ENCRYPTED=6;static SUBTYPE_COLUMN=7;static SUBTYPE_SENSITIVE=8;static SUBTYPE_VECTOR=9;static SUBTYPE_USER_DEFINED=128;static VECTOR_TYPE=Object.freeze({Int8:3,Float32:39,PackedBit:16});buffer;sub_type;position;constructor(e,t){super();if(e!=null&&typeof e==="string"&&!ArrayBuffer.isView(e)&&!Cg(e)&&!Array.isArray(e))throw new I("Binary can only be constructed from Uint8Array or number[]");if(this.sub_type=(t??ve.BSON_BINARY_SUBTYPE_DEFAULT)&255,e==null)this.buffer=F.allocate(ve.BUFFER_SIZE),this.position=0;else this.buffer=Array.isArray(e)?F.fromNumberArray(e):F.toLocalBufferType(e),this.position=this.buffer.byteLength}put(e){if(typeof e==="string"&&e.length!==1)throw new I("only accepts single character String");else if(typeof e!=="number"&&e.length!==1)throw new I("only accepts single character Uint8Array or Array");let t;if(typeof e==="string")t=e.charCodeAt(0);else if(typeof e==="number")t=e;else t=e[0];if(t<0||t>255)throw new I("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.byteLength>this.position)this.buffer[this.position++]=t;else{let r=F.allocate(ve.BUFFER_SIZE+this.buffer.length);r.set(this.buffer,0),this.buffer=r,this.buffer[this.position++]=t}}write(e,t){if(t=typeof t==="number"?t:this.position,this.buffer.byteLength<t+e.length){let r=F.allocate(this.buffer.byteLength+e.length);r.set(this.buffer,0),this.buffer=r}if(ArrayBuffer.isView(e))this.buffer.set(F.toLocalBufferType(e),t),this.position=t+e.byteLength>this.position?t+e.length:this.position;else if(typeof e==="string")throw new I("input cannot be string")}read(e,t){t=t&&t>0?t:this.position;let r=e+t;return this.buffer.subarray(e,r>this.position?this.position:r)}value(){return this.buffer.length===this.position?this.buffer:this.buffer.subarray(0,this.position)}length(){return this.position}toJSON(){return F.toBase64(this.buffer.subarray(0,this.position))}toString(e){if(e==="hex")return F.toHex(this.buffer.subarray(0,this.position));if(e==="base64")return F.toBase64(this.buffer.subarray(0,this.position));if(e==="utf8"||e==="utf-8")return F.toUTF8(this.buffer,0,this.position,!1);return F.toUTF8(this.buffer,0,this.position,!1)}toExtendedJSON(e){if(e=e||{},this.sub_type===ve.SUBTYPE_VECTOR)ko(this);let t=F.toBase64(this.buffer),r=Number(this.sub_type).toString(16);if(e.legacy)return{$binary:t,$type:r.length===1?"0"+r:r};return{$binary:{base64:t,subType:r.length===1?"0"+r:r}}}toUUID(){if(this.sub_type===ve.SUBTYPE_UUID)return new dn(this.buffer.subarray(0,this.position));throw new I(`Binary sub_type "${this.sub_type}" (${typeof this.sub_type}) is not supported for converting to UUID. Only 0x${ve.SUBTYPE_UUID.toString(16).padStart(2,"0")} is currently supported.`)}static createFromHexString(e,t){return new ve(F.fromHex(e),t)}static createFromBase64(e,t){return new ve(F.fromBase64(e),t)}static fromExtendedJSON(e,t){t=t||{};let r,n;if("$binary"in e){if(t.legacy&&typeof e.$binary==="string"&&"$type"in e)n=e.$type?parseInt(e.$type,16):0,r=F.fromBase64(e.$binary);else if(typeof e.$binary!=="string")n=e.$binary.subType?parseInt(e.$binary.subType,16):0,r=F.fromBase64(e.$binary.base64)}else if("$uuid"in e)n=4,r=dn.bytesFromString(e.$uuid);if(!r)throw new I(`Unexpected Binary Extended JSON format ${JSON.stringify(e)}`);return n===Pg?new dn(r):new ve(r,n)}inspect(e,t,r){r??=Ps;let n=F.toBase64(this.buffer.subarray(0,this.position)),s=r(n,t),i=r(this.sub_type,t);return`Binary.createFromBase64(${s}, ${i})`}toInt8Array(){if(this.sub_type!==ve.SUBTYPE_VECTOR)throw new I("Binary sub_type is not Vector");if(this.buffer[0]!==ve.VECTOR_TYPE.Int8)throw new I("Binary datatype field is not Int8");return ko(this),new Int8Array(this.buffer.buffer.slice(this.buffer.byteOffset+2,this.buffer.byteOffset+this.position))}toFloat32Array(){if(this.sub_type!==ve.SUBTYPE_VECTOR)throw new I("Binary sub_type is not Vector");if(this.buffer[0]!==ve.VECTOR_TYPE.Float32)throw new I("Binary datatype field is not Float32");ko(this);let e=new Uint8Array(this.buffer.buffer.slice(this.buffer.byteOffset+2,this.buffer.byteOffset+this.position));if(_e.isBigEndian)F.swap32(e);return new Float32Array(e.buffer)}toPackedBits(){if(this.sub_type!==ve.SUBTYPE_VECTOR)throw new I("Binary sub_type is not Vector");if(this.buffer[0]!==ve.VECTOR_TYPE.PackedBit)throw new I("Binary datatype field is not packed bit");return ko(this),new Uint8Array(this.buffer.buffer.slice(this.buffer.byteOffset+2,this.buffer.byteOffset+this.position))}toBits(){if(this.sub_type!==ve.SUBTYPE_VECTOR)throw new I("Binary sub_type is not Vector");if(this.buffer[0]!==ve.VECTOR_TYPE.PackedBit)throw new I("Binary datatype field is not packed bit");ko(this);let t=(this.length()-2)*8-this.buffer[1],r=new Int8Array(t);for(let n=0;n<r.length;n++){let s=n/8|0,i=this.buffer[s+2],o=7-n%8,u=i>>o&1;r[n]=u}return r}static fromInt8Array(e){let t=F.allocate(e.byteLength+2);t[0]=ve.VECTOR_TYPE.Int8,t[1]=0;let r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);t.set(r,2);let n=new this(t,this.SUBTYPE_VECTOR);return ko(n),n}static fromFloat32Array(e){let t=F.allocate(e.byteLength+2);t[0]=ve.VECTOR_TYPE.Float32,t[1]=0;let r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(t.set(r,2),_e.isBigEndian)F.swap32(new Uint8Array(t.buffer,2));let n=new this(t,this.SUBTYPE_VECTOR);return ko(n),n}static fromPackedBits(e,t=0){let r=F.allocate(e.byteLength+2);r[0]=ve.VECTOR_TYPE.PackedBit,r[1]=t,r.set(e,2);let n=new this(r,this.SUBTYPE_VECTOR);return ko(n),n}static fromBits(e){let t=e.length+7>>>3,r=new Uint8Array(t+2);r[0]=ve.VECTOR_TYPE.PackedBit;let n=e.length%8;r[1]=n===0?0:8-n;for(let s=0;s<e.length;s++){let i=s>>>3,o=e[s];if(o!==0&&o!==1)throw new I(`Invalid bit value at ${s}: must be 0 or 1, found ${e[s]}`);if(o===0)continue;let u=7-s%8;r[i+2]|=o<<u}return new this(r,ve.SUBTYPE_VECTOR)}}function ko(e){if(e.sub_type!==ve.SUBTYPE_VECTOR)return;let t=e.position,r=e.buffer[0],n=e.buffer[1];if((r===ve.VECTOR_TYPE.Float32||r===ve.VECTOR_TYPE.Int8)&&n!==0)throw new I("Invalid Vector: padding must be zero for int8 and float32 vectors");if(r===ve.VECTOR_TYPE.Float32){if(t!==0&&t-2!==0&&(t-2)%4!==0)throw new I("Invalid Vector: Float32 vector must contain a multiple of 4 bytes")}if(r===ve.VECTOR_TYPE.PackedBit&&n!==0&&t===2)throw new I("Invalid Vector: padding must be zero for packed bit vectors that are empty");if(r===ve.VECTOR_TYPE.PackedBit&&n>7)throw new I(`Invalid Vector: padding must be a value between 0 and 7. found: ${n}`)}var Eg=16,hX=/^[0-9A-F]{32}$/i,fX=/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i;class dn extends ve{constructor(e){let t;if(e==null)t=dn.generate();else if(e instanceof dn)t=F.toLocalBufferType(new Uint8Array(e.buffer));else if(ArrayBuffer.isView(e)&&e.byteLength===Eg)t=F.toLocalBufferType(e);else if(typeof e==="string")t=dn.bytesFromString(e);else throw new I("Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).");super(t,Pg)}get id(){return this.buffer}set id(e){this.buffer=e}toHexString(e=!0){if(e)return[F.toHex(this.buffer.subarray(0,4)),F.toHex(this.buffer.subarray(4,6)),F.toHex(this.buffer.subarray(6,8)),F.toHex(this.buffer.subarray(8,10)),F.toHex(this.buffer.subarray(10,16))].join("-");return F.toHex(this.buffer)}toString(e){if(e==="hex")return F.toHex(this.id);if(e==="base64")return F.toBase64(this.id);return this.toHexString()}toJSON(){return this.toHexString()}equals(e){if(!e)return!1;if(e instanceof dn)return F.equals(e.id,this.id);try{return F.equals(new dn(e).id,this.id)}catch{return!1}}toBinary(){return new ve(this.id,ve.SUBTYPE_UUID)}static generate(){let e=F.randomBytes(Eg);return e[6]=e[6]&15|64,e[8]=e[8]&63|128,e}static isValid(e){if(!e)return!1;if(typeof e==="string")return dn.isValidUUIDString(e);if(_c(e))return e.byteLength===Eg;return e._bsontype==="Binary"&&e.sub_type===this.SUBTYPE_UUID&&e.buffer.byteLength===16}static createFromHexString(e){let t=dn.bytesFromString(e);return new dn(t)}static createFromBase64(e){return new dn(F.fromBase64(e))}static bytesFromString(e){if(!dn.isValidUUIDString(e))throw new I("UUID string representation must be 32 hex digits or canonical hyphenated representation");return F.fromHex(e.replace(/-/g,""))}static isValidUUIDString(e){return hX.test(e)||fX.test(e)}inspect(e,t,r){return r??=Ps,`new UUID(${r(this.toHexString(),t)})`}}class jo extends Hn{get _bsontype(){return"Code"}code;scope;constructor(e,t){super();this.code=e.toString(),this.scope=t??null}toJSON(){if(this.scope!=null)return{code:this.code,scope:this.scope};return{code:this.code}}toExtendedJSON(){if(this.scope)return{$code:this.code,$scope:this.scope};return{$code:this.code}}static fromExtendedJSON(e){return new jo(e.$code,e.$scope)}inspect(e,t,r){r??=Ps;let n=r(this.code,t),s=n.includes(`
3
- `);if(this.scope!=null)n+=`,${s?`
4
- `:" "}${r(this.scope,t)}`;let i=s&&this.scope===null;return`new Code(${s?`
5
- `:""}${n}${i?`
6
- `:""})`}}function bw(e){return e!=null&&typeof e==="object"&&"$id"in e&&e.$id!=null&&"$ref"in e&&typeof e.$ref==="string"&&(!("$db"in e)||("$db"in e)&&typeof e.$db==="string")}class Yi extends Hn{get _bsontype(){return"DBRef"}collection;oid;db;fields;constructor(e,t,r,n){super();let s=e.split(".");if(s.length===2)r=s.shift(),e=s.shift();this.collection=e,this.oid=t,this.db=r,this.fields=n||{}}get namespace(){return this.collection}set namespace(e){this.collection=e}toJSON(){let e=Object.assign({$ref:this.collection,$id:this.oid},this.fields);if(this.db!=null)e.$db=this.db;return e}toExtendedJSON(e){e=e||{};let t={$ref:this.collection,$id:this.oid};if(e.legacy)return t;if(this.db)t.$db=this.db;return t=Object.assign(t,this.fields),t}static fromExtendedJSON(e){let t=Object.assign({},e);return delete t.$ref,delete t.$id,delete t.$db,new Yi(e.$ref,e.$id,e.$db,t)}inspect(e,t,r){r??=Ps;let n=[r(this.namespace,t),r(this.oid,t),...this.db?[r(this.db,t)]:[],...Object.keys(this.fields).length>0?[r(this.fields,t)]:[]];return n[1]=r===Ps?`new ObjectId(${n[1]})`:n[1],`new DBRef(${n.join(", ")})`}}function Dw(e){if(e==="")return e;let t=0,r=e[t]==="-",n=e[t]==="+";if(n||r)t+=1;let s=!1;for(;t<e.length&&e[t]==="0";++t)s=!0;if(!s)return n?e.slice(1):e;return`${r?"-":""}${e.length===t?"0":e.slice(t)}`}function dX(e,t){t=t??10;let r="0123456789abcdefghijklmnopqrstuvwxyz".slice(0,t);return new RegExp(`[^-+${r}]`,"i").test(e)?!1:e}var Us=void 0;try{Us=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}var GS=65536,pX=16777216,gc=GS*GS,Tw=gc*gc,YS=Tw/2,JS={},QS={},mX=20,yX=/^(\+?0|(\+|-)?[1-9][0-9]*)$/;class T extends Hn{get _bsontype(){return"Long"}get __isLong__(){return!0}high;low;unsigned;constructor(e=0,t,r){super();let n=typeof t==="boolean"?t:Boolean(r),s=typeof t==="number"?t:0,i=typeof e==="string"?T.fromString(e,n):typeof e==="bigint"?T.fromBigInt(e,n):{low:e|0,high:s|0,unsigned:n};this.low=i.low,this.high=i.high,this.unsigned=i.unsigned}static TWO_PWR_24=T.fromInt(pX);static MAX_UNSIGNED_VALUE=T.fromBits(-1,-1,!0);static ZERO=T.fromInt(0);static UZERO=T.fromInt(0,!0);static ONE=T.fromInt(1);static UONE=T.fromInt(1,!0);static NEG_ONE=T.fromInt(-1);static MAX_VALUE=T.fromBits(-1,2147483647,!1);static MIN_VALUE=T.fromBits(0,-2147483648,!1);static fromBits(e,t,r){return new T(e,t,r)}static fromInt(e,t){let r,n,s;if(t){if(e>>>=0,s=0<=e&&e<256){if(n=QS[e],n)return n}if(r=T.fromBits(e,(e|0)<0?-1:0,!0),s)QS[e]=r;return r}else{if(e|=0,s=-128<=e&&e<128){if(n=JS[e],n)return n}if(r=T.fromBits(e,e<0?-1:0,!1),s)JS[e]=r;return r}}static fromNumber(e,t){if(isNaN(e))return t?T.UZERO:T.ZERO;if(t){if(e<0)return T.UZERO;if(e>=Tw)return T.MAX_UNSIGNED_VALUE}else{if(e<=-YS)return T.MIN_VALUE;if(e+1>=YS)return T.MAX_VALUE}if(e<0)return T.fromNumber(-e,t).neg();return T.fromBits(e%gc|0,e/gc|0,t)}static fromBigInt(e,t){let r=0xffffffffn,n=32n;return new T(Number(e&r),Number(e>>n&r),t)}static _fromString(e,t,r){if(e.length===0)throw new I("empty string");if(r<2||36<r)throw new I("radix");let n;if((n=e.indexOf("-"))>0)throw new I("interior hyphen");else if(n===0)return T._fromString(e.substring(1),t,r).neg();let s=T.fromNumber(Math.pow(r,8)),i=T.ZERO;for(let o=0;o<e.length;o+=8){let u=Math.min(8,e.length-o),a=parseInt(e.substring(o,o+u),r);if(u<8){let c=T.fromNumber(Math.pow(r,u));i=i.mul(c).add(T.fromNumber(a))}else i=i.mul(s),i=i.add(T.fromNumber(a))}return i.unsigned=t,i}static fromStringStrict(e,t,r){let n=!1;if(typeof t==="number")r=t,t=!1;else n=!!t;if(r??=10,e.trim()!==e)throw new I(`Input: '${e}' contains leading and/or trailing whitespace`);if(!dX(e,r))throw new I(`Input: '${e}' contains invalid characters for radix: ${r}`);let s=Dw(e),i=T._fromString(s,n,r);if(i.toString(r).toLowerCase()!==s.toLowerCase())throw new I(`Input: ${e} is not representable as ${i.unsigned?"an unsigned":"a signed"} 64-bit Long ${r!=null?`with radix: ${r}`:""}`);return i}static fromString(e,t,r){let n=!1;if(typeof t==="number")r=t,t=!1;else n=!!t;if(r??=10,e==="NaN"&&r<24)return T.ZERO;else if((e==="Infinity"||e==="+Infinity"||e==="-Infinity")&&r<35)return T.ZERO;return T._fromString(e,n,r)}static fromBytes(e,t,r){return r?T.fromBytesLE(e,t):T.fromBytesBE(e,t)}static fromBytesLE(e,t){return new T(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)}static fromBytesBE(e,t){return new T(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}static isLong(e){return e!=null&&typeof e==="object"&&"__isLong__"in e&&e.__isLong__===!0}static fromValue(e,t){if(typeof e==="number")return T.fromNumber(e,t);if(typeof e==="string")return T.fromString(e,t);return T.fromBits(e.low,e.high,typeof t==="boolean"?t:e.unsigned)}add(e){if(!T.isLong(e))e=T.fromValue(e);let t=this.high>>>16,r=this.high&65535,n=this.low>>>16,s=this.low&65535,i=e.high>>>16,o=e.high&65535,u=e.low>>>16,a=e.low&65535,c=0,l=0,f=0,h=0;return h+=s+a,f+=h>>>16,h&=65535,f+=n+u,l+=f>>>16,f&=65535,l+=r+o,c+=l>>>16,l&=65535,c+=t+i,c&=65535,T.fromBits(f<<16|h,c<<16|l,this.unsigned)}and(e){if(!T.isLong(e))e=T.fromValue(e);return T.fromBits(this.low&e.low,this.high&e.high,this.unsigned)}compare(e){if(!T.isLong(e))e=T.fromValue(e);if(this.eq(e))return 0;let t=this.isNegative(),r=e.isNegative();if(t&&!r)return-1;if(!t&&r)return 1;if(!this.unsigned)return this.sub(e).isNegative()?-1:1;return e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1}comp(e){return this.compare(e)}divide(e){if(!T.isLong(e))e=T.fromValue(e);if(e.isZero())throw new I("division by zero");if(Us){if(!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1)return this;let s=(this.unsigned?Us.div_u:Us.div_s)(this.low,this.high,e.low,e.high);return T.fromBits(s,Us.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?T.UZERO:T.ZERO;let t,r,n;if(!this.unsigned){if(this.eq(T.MIN_VALUE))if(e.eq(T.ONE)||e.eq(T.NEG_ONE))return T.MIN_VALUE;else if(e.eq(T.MIN_VALUE))return T.ONE;else if(t=this.shr(1).div(e).shl(1),t.eq(T.ZERO))return e.isNegative()?T.ONE:T.NEG_ONE;else return r=this.sub(e.mul(t)),n=t.add(r.div(e)),n;else if(e.eq(T.MIN_VALUE))return this.unsigned?T.UZERO:T.ZERO;if(this.isNegative()){if(e.isNegative())return this.neg().div(e.neg());return this.neg().div(e).neg()}else if(e.isNegative())return this.div(e.neg()).neg();n=T.ZERO}else{if(!e.unsigned)e=e.toUnsigned();if(e.gt(this))return T.UZERO;if(e.gt(this.shru(1)))return T.UONE;n=T.UZERO}r=this;while(r.gte(e)){t=Math.max(1,Math.floor(r.toNumber()/e.toNumber()));let s=Math.ceil(Math.log(t)/Math.LN2),i=s<=48?1:Math.pow(2,s-48),o=T.fromNumber(t),u=o.mul(e);while(u.isNegative()||u.gt(r))t-=i,o=T.fromNumber(t,this.unsigned),u=o.mul(e);if(o.isZero())o=T.ONE;n=n.add(o),r=r.sub(u)}return n}div(e){return this.divide(e)}equals(e){if(!T.isLong(e))e=T.fromValue(e);if(this.unsigned!==e.unsigned&&this.high>>>31===1&&e.high>>>31===1)return!1;return this.high===e.high&&this.low===e.low}eq(e){return this.equals(e)}getHighBits(){return this.high}getHighBitsUnsigned(){return this.high>>>0}getLowBits(){return this.low}getLowBitsUnsigned(){return this.low>>>0}getNumBitsAbs(){if(this.isNegative())return this.eq(T.MIN_VALUE)?64:this.neg().getNumBitsAbs();let e=this.high!==0?this.high:this.low,t;for(t=31;t>0;t--)if((e&1<<t)!==0)break;return this.high!==0?t+33:t+1}greaterThan(e){return this.comp(e)>0}gt(e){return this.greaterThan(e)}greaterThanOrEqual(e){return this.comp(e)>=0}gte(e){return this.greaterThanOrEqual(e)}ge(e){return this.greaterThanOrEqual(e)}isEven(){return(this.low&1)===0}isNegative(){return!this.unsigned&&this.high<0}isOdd(){return(this.low&1)===1}isPositive(){return this.unsigned||this.high>=0}isZero(){return this.high===0&&this.low===0}lessThan(e){return this.comp(e)<0}lt(e){return this.lessThan(e)}lessThanOrEqual(e){return this.comp(e)<=0}lte(e){return this.lessThanOrEqual(e)}modulo(e){if(!T.isLong(e))e=T.fromValue(e);if(Us){let t=(this.unsigned?Us.rem_u:Us.rem_s)(this.low,this.high,e.low,e.high);return T.fromBits(t,Us.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))}mod(e){return this.modulo(e)}rem(e){return this.modulo(e)}multiply(e){if(this.isZero())return T.ZERO;if(!T.isLong(e))e=T.fromValue(e);if(Us){let d=Us.mul(this.low,this.high,e.low,e.high);return T.fromBits(d,Us.get_high(),this.unsigned)}if(e.isZero())return T.ZERO;if(this.eq(T.MIN_VALUE))return e.isOdd()?T.MIN_VALUE:T.ZERO;if(e.eq(T.MIN_VALUE))return this.isOdd()?T.MIN_VALUE:T.ZERO;if(this.isNegative())if(e.isNegative())return this.neg().mul(e.neg());else return this.neg().mul(e).neg();else if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(T.TWO_PWR_24)&&e.lt(T.TWO_PWR_24))return T.fromNumber(this.toNumber()*e.toNumber(),this.unsigned);let t=this.high>>>16,r=this.high&65535,n=this.low>>>16,s=this.low&65535,i=e.high>>>16,o=e.high&65535,u=e.low>>>16,a=e.low&65535,c=0,l=0,f=0,h=0;return h+=s*a,f+=h>>>16,h&=65535,f+=n*a,l+=f>>>16,f&=65535,f+=s*u,l+=f>>>16,f&=65535,l+=r*a,c+=l>>>16,l&=65535,l+=n*u,c+=l>>>16,l&=65535,l+=s*o,c+=l>>>16,l&=65535,c+=t*a+r*u+n*o+s*i,c&=65535,T.fromBits(f<<16|h,c<<16|l,this.unsigned)}mul(e){return this.multiply(e)}negate(){if(!this.unsigned&&this.eq(T.MIN_VALUE))return T.MIN_VALUE;return this.not().add(T.ONE)}neg(){return this.negate()}not(){return T.fromBits(~this.low,~this.high,this.unsigned)}notEquals(e){return!this.equals(e)}neq(e){return this.notEquals(e)}ne(e){return this.notEquals(e)}or(e){if(!T.isLong(e))e=T.fromValue(e);return T.fromBits(this.low|e.low,this.high|e.high,this.unsigned)}shiftLeft(e){if(T.isLong(e))e=e.toInt();if((e&=63)===0)return this;else if(e<32)return T.fromBits(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned);else return T.fromBits(0,this.low<<e-32,this.unsigned)}shl(e){return this.shiftLeft(e)}shiftRight(e){if(T.isLong(e))e=e.toInt();if((e&=63)===0)return this;else if(e<32)return T.fromBits(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned);else return T.fromBits(this.high>>e-32,this.high>=0?0:-1,this.unsigned)}shr(e){return this.shiftRight(e)}shiftRightUnsigned(e){if(T.isLong(e))e=e.toInt();if(e&=63,e===0)return this;else{let t=this.high;if(e<32){let r=this.low;return T.fromBits(r>>>e|t<<32-e,t>>>e,this.unsigned)}else if(e===32)return T.fromBits(t,0,this.unsigned);else return T.fromBits(t>>>e-32,0,this.unsigned)}}shr_u(e){return this.shiftRightUnsigned(e)}shru(e){return this.shiftRightUnsigned(e)}subtract(e){if(!T.isLong(e))e=T.fromValue(e);return this.add(e.neg())}sub(e){return this.subtract(e)}toInt(){return this.unsigned?this.low>>>0:this.low}toNumber(){if(this.unsigned)return(this.high>>>0)*gc+(this.low>>>0);return this.high*gc+(this.low>>>0)}toBigInt(){return BigInt(this.toString())}toBytes(e){return e?this.toBytesLE():this.toBytesBE()}toBytesLE(){let e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]}toBytesBE(){let e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,t>>>24,t>>>16&255,t>>>8&255,t&255]}toSigned(){if(!this.unsigned)return this;return T.fromBits(this.low,this.high,!1)}toString(e){if(e=e||10,e<2||36<e)throw new I("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(T.MIN_VALUE)){let s=T.fromNumber(e),i=this.div(s),o=i.mul(s).sub(this);return i.toString(e)+o.toInt().toString(e)}else return"-"+this.neg().toString(e);let t=T.fromNumber(Math.pow(e,6),this.unsigned),r=this,n="";while(!0){let s=r.div(t),o=(r.sub(s.mul(t)).toInt()>>>0).toString(e);if(r=s,r.isZero())return o+n;else{while(o.length<6)o="0"+o;n=""+o+n}}}toUnsigned(){if(this.unsigned)return this;return T.fromBits(this.low,this.high,!0)}xor(e){if(!T.isLong(e))e=T.fromValue(e);return T.fromBits(this.low^e.low,this.high^e.high,this.unsigned)}eqz(){return this.isZero()}le(e){return this.lessThanOrEqual(e)}toExtendedJSON(e){if(e&&e.relaxed)return this.toNumber();return{$numberLong:this.toString()}}static fromExtendedJSON(e,t){let{useBigInt64:r=!1,relaxed:n=!0}={...t};if(e.$numberLong.length>mX)throw new I("$numberLong string is too long");if(!yX.test(e.$numberLong))throw new I(`$numberLong string "${e.$numberLong}" is in an invalid format`);if(r){let i=BigInt(e.$numberLong);return BigInt.asIntN(64,i)}let s=T.fromString(e.$numberLong);if(n)return s.toNumber();return s}inspect(e,t,r){r??=Ps;let n=r(this.toString(),t),s=this.unsigned?`, ${r(this.unsigned,t)}`:"";return`new Long(${n}${s})`}}var gX=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,_X=/^(\+|-)?(Infinity|inf)$/i,EX=/^(\+|-)?NaN$/i,mc=6111,eh=-6176,XS=6176,ZS=34,Ag=F.fromNumberArray([124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse()),ew=F.fromNumberArray([248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse()),tw=F.fromNumberArray([120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse()),AX=/^([-+])?(\d+)?$/,OX=31,rw=16383,SX=30,wX=31;function nw(e){return!isNaN(parseInt(e,10))}function CX(e){let t=T.fromNumber(1e9),r=T.fromNumber(0);if(!e.parts[0]&&!e.parts[1]&&!e.parts[2]&&!e.parts[3])return{quotient:e,rem:r};for(let n=0;n<=3;n++)r=r.shiftLeft(32),r=r.add(new T(e.parts[n],0)),e.parts[n]=r.div(t).low,r=r.modulo(t);return{quotient:e,rem:r}}function bX(e,t){if(!e&&!t)return{high:T.fromNumber(0),low:T.fromNumber(0)};let r=e.shiftRightUnsigned(32),n=new T(e.getLowBits(),0),s=t.shiftRightUnsigned(32),i=new T(t.getLowBits(),0),o=r.multiply(s),u=r.multiply(i),a=n.multiply(s),c=n.multiply(i);return o=o.add(u.shiftRightUnsigned(32)),u=new T(u.getLowBits(),0).add(a).add(c.shiftRightUnsigned(32)),o=o.add(u.shiftRightUnsigned(32)),c=u.shiftLeft(32).add(new T(c.getLowBits(),0)),{high:o,low:c}}function DX(e,t){let r=e.high>>>0,n=t.high>>>0;if(r<n)return!0;else if(r===n){let s=e.low>>>0,i=t.low>>>0;if(s<i)return!0}return!1}function Ii(e,t){throw new I(`"${e}" is not a valid Decimal128 string - ${t}`)}class wn extends Hn{get _bsontype(){return"Decimal128"}bytes;constructor(e){super();if(typeof e==="string")this.bytes=wn.fromString(e).bytes;else if(e instanceof Uint8Array||_c(e)){if(e.byteLength!==16)throw new I("Decimal128 must take a Buffer of 16 bytes");this.bytes=e}else throw new I("Decimal128 must take a Buffer or string")}static fromString(e){return wn._fromString(e,{allowRounding:!1})}static fromStringWithRounding(e){return wn._fromString(e,{allowRounding:!0})}static _fromString(e,t){let r=!1,n=!1,s=!1,i=!1,o=0,u=0,a=0,c=0,l=0,f=[0],h=0,d=0,p=0,m=0,_=new T(0,0),y=new T(0,0),E=0,w=0;if(e.length>=7000)throw new I(""+e+" not a valid Decimal128 string");let b=e.match(gX),A=e.match(_X),M=e.match(EX);if(!b&&!A&&!M||e.length===0)throw new I(""+e+" not a valid Decimal128 string");if(b){let P=b[2],ge=b[4],Me=b[5],oe=b[6];if(ge&&oe===void 0)Ii(e,"missing exponent power");if(ge&&P===void 0)Ii(e,"missing exponent base");if(ge===void 0&&(Me||oe))Ii(e,"missing e before exponent")}if(e[w]==="+"||e[w]==="-")n=!0,r=e[w++]==="-";if(!nw(e[w])&&e[w]!=="."){if(e[w]==="i"||e[w]==="I")return new wn(r?ew:tw);else if(e[w]==="N")return new wn(Ag)}while(nw(e[w])||e[w]==="."){if(e[w]==="."){if(s)Ii(e,"contains multiple periods");s=!0,w=w+1;continue}if(h<ZS){if(e[w]!=="0"||i){if(!i)l=u;i=!0,f[d++]=parseInt(e[w],10),h=h+1}}if(i)a=a+1;if(s)c=c+1;u=u+1,w=w+1}if(s&&!u)throw new I(""+e+" not a valid Decimal128 string");if(e[w]==="e"||e[w]==="E"){let P=e.substr(++w).match(AX);if(!P||!P[2])return new wn(Ag);m=parseInt(P[0],10),w=w+P[0].length}if(e[w])return new wn(Ag);if(!h)f[0]=0,a=1,h=1,o=0;else if(p=h-1,o=a,o!==1)while(e[l+o-1+Number(n)+Number(s)]==="0")o=o-1;if(m<=c&&c>m+16384)m=eh;else m=m-c;while(m>mc){if(p=p+1,p>=ZS){if(o===0){m=mc;break}Ii(e,"overflow")}m=m-1}if(t.allowRounding){while(m<eh||h<a){if(p===0&&o<h){m=eh,o=0;break}if(h<a)a=a-1;else p=p-1;if(m<mc)m=m+1;else{if(f.join("").match(/^0+$/)){m=mc;break}Ii(e,"overflow")}}if(p+1<o){let P=u;if(s)l=l+1,P=P+1;if(n)l=l+1,P=P+1;let ge=parseInt(e[l+p+1],10),Me=0;if(ge>=5){if(Me=1,ge===5){Me=f[p]%2===1?1:0;for(let oe=l+p+2;oe<P;oe++)if(parseInt(e[oe],10)){Me=1;break}}}if(Me){let oe=p;for(;oe>=0;oe--)if(++f[oe]>9){if(f[oe]=0,oe===0)if(m<mc)m=m+1,f[oe]=1;else return new wn(r?ew:tw)}else break}}}else{while(m<eh||h<a){if(p===0){if(o===0){m=eh;break}Ii(e,"exponent underflow")}if(h<a){if(e[a-1+Number(n)+Number(s)]!=="0"&&o!==0)Ii(e,"inexact rounding");a=a-1}else{if(f[p]!==0)Ii(e,"inexact rounding");p=p-1}if(m<mc)m=m+1;else Ii(e,"overflow")}if(p+1<o){if(s)l=l+1;if(n)l=l+1;if(parseInt(e[l+p+1],10)!==0)Ii(e,"inexact rounding")}}if(_=T.fromNumber(0),y=T.fromNumber(0),o===0)_=T.fromNumber(0),y=T.fromNumber(0);else if(p<17){let P=0;y=T.fromNumber(f[P++]),_=new T(0,0);for(;P<=p;P++)y=y.multiply(T.fromNumber(10)),y=y.add(T.fromNumber(f[P]))}else{let P=0;_=T.fromNumber(f[P++]);for(;P<=p-17;P++)_=_.multiply(T.fromNumber(10)),_=_.add(T.fromNumber(f[P]));y=T.fromNumber(f[P++]);for(;P<=p;P++)y=y.multiply(T.fromNumber(10)),y=y.add(T.fromNumber(f[P]))}let O=bX(_,T.fromString("100000000000000000"));if(O.low=O.low.add(y),DX(O.low,y))O.high=O.high.add(T.fromNumber(1));E=m+XS;let x={low:T.fromNumber(0),high:T.fromNumber(0)};if(O.high.shiftRightUnsigned(49).and(T.fromNumber(1)).equals(T.fromNumber(1)))x.high=x.high.or(T.fromNumber(3).shiftLeft(61)),x.high=x.high.or(T.fromNumber(E).and(T.fromNumber(16383).shiftLeft(47))),x.high=x.high.or(O.high.and(T.fromNumber(140737488355327)));else x.high=x.high.or(T.fromNumber(E&16383).shiftLeft(49)),x.high=x.high.or(O.high.and(T.fromNumber(562949953421311)));if(x.low=O.low,r)x.high=x.high.or(T.fromString("9223372036854775808"));let v=F.allocateUnsafe(16);return w=0,v[w++]=x.low.low&255,v[w++]=x.low.low>>8&255,v[w++]=x.low.low>>16&255,v[w++]=x.low.low>>24&255,v[w++]=x.low.high&255,v[w++]=x.low.high>>8&255,v[w++]=x.low.high>>16&255,v[w++]=x.low.high>>24&255,v[w++]=x.high.low&255,v[w++]=x.high.low>>8&255,v[w++]=x.high.low>>16&255,v[w++]=x.high.low>>24&255,v[w++]=x.high.high&255,v[w++]=x.high.high>>8&255,v[w++]=x.high.high>>16&255,v[w++]=x.high.high>>24&255,new wn(v)}toString(){let e,t=0,r=Array(36);for(let w=0;w<r.length;w++)r[w]=0;let n=0,s=!1,i,o={parts:[0,0,0,0]},u,a,c=[];n=0;let l=this.bytes,f=l[n++]|l[n++]<<8|l[n++]<<16|l[n++]<<24,h=l[n++]|l[n++]<<8|l[n++]<<16|l[n++]<<24,d=l[n++]|l[n++]<<8|l[n++]<<16|l[n++]<<24,p=l[n++]|l[n++]<<8|l[n++]<<16|l[n++]<<24;if(n=0,{low:new T(f,h),high:new T(d,p)}.high.lessThan(T.ZERO))c.push("-");let _=p>>26&OX;if(_>>3===3)if(_===SX)return c.join("")+"Infinity";else if(_===wX)return"NaN";else e=p>>15&rw,i=8+(p>>14&1);else i=p>>14&7,e=p>>17&rw;let y=e-XS;if(o.parts[0]=(p&16383)+((i&15)<<14),o.parts[1]=d,o.parts[2]=h,o.parts[3]=f,o.parts[0]===0&&o.parts[1]===0&&o.parts[2]===0&&o.parts[3]===0)s=!0;else for(a=3;a>=0;a--){let w=0,b=CX(o);if(o=b.quotient,w=b.rem.low,!w)continue;for(u=8;u>=0;u--)r[a*9+u]=w%10,w=Math.floor(w/10)}if(s)t=1,r[n]=0;else{t=36;while(!r[n])t=t-1,n=n+1}let E=t-1+y;if(E>=34||E<=-7||y>0){if(t>34){if(c.push("0"),y>0)c.push(`E+${y}`);else if(y<0)c.push(`E${y}`);return c.join("")}if(c.push(`${r[n++]}`),t=t-1,t)c.push(".");for(let w=0;w<t;w++)c.push(`${r[n++]}`);if(c.push("E"),E>0)c.push(`+${E}`);else c.push(`${E}`)}else if(y>=0)for(let w=0;w<t;w++)c.push(`${r[n++]}`);else{let w=t+y;if(w>0)for(let b=0;b<w;b++)c.push(`${r[n++]}`);else c.push("0");c.push(".");while(w++<0)c.push("0");for(let b=0;b<t-Math.max(w-1,0);b++)c.push(`${r[n++]}`)}return c.join("")}toJSON(){return{$numberDecimal:this.toString()}}toExtendedJSON(){return{$numberDecimal:this.toString()}}static fromExtendedJSON(e){return wn.fromString(e.$numberDecimal)}inspect(e,t,r){return r??=Ps,`new Decimal128(${r(this.toString(),t)})`}}class zs extends Hn{get _bsontype(){return"Double"}value;constructor(e){super();if(e instanceof Number)e=e.valueOf();this.value=+e}static fromString(e){let t=Number(e);if(e==="NaN")return new zs(NaN);if(e==="Infinity")return new zs(1/0);if(e==="-Infinity")return new zs(-1/0);if(!Number.isFinite(t))throw new I(`Input: ${e} is not representable as a Double`);if(e.trim()!==e)throw new I(`Input: '${e}' contains whitespace`);if(e==="")throw new I("Input is an empty string");if(/[^-0-9.+eE]/.test(e))throw new I(`Input: '${e}' is not in decimal or exponential notation`);return new zs(t)}valueOf(){return this.value}toJSON(){return this.value}toString(e){return this.value.toString(e)}toExtendedJSON(e){if(e&&(e.legacy||e.relaxed&&isFinite(this.value)))return this.value;if(Object.is(Math.sign(this.value),-0))return{$numberDouble:"-0.0"};return{$numberDouble:Number.isInteger(this.value)?this.value.toFixed(1):this.value.toString()}}static fromExtendedJSON(e,t){let r=parseFloat(e.$numberDouble);return t&&t.relaxed?r:new zs(r)}inspect(e,t,r){return r??=Ps,`new Double(${r(this.value,t)})`}}class Lo extends Hn{get _bsontype(){return"Int32"}value;constructor(e){super();if(e instanceof Number)e=e.valueOf();this.value=+e|0}static fromString(e){let t=Dw(e),r=Number(e);if(ah<r)throw new I(`Input: '${e}' is larger than the maximum value for Int32`);else if(ch>r)throw new I(`Input: '${e}' is smaller than the minimum value for Int32`);else if(!Number.isSafeInteger(r))throw new I(`Input: '${e}' is not a safe integer`);else if(r.toString()!==t)throw new I(`Input: '${e}' is not a valid Int32 string`);return new Lo(r)}valueOf(){return this.value}toString(e){return this.value.toString(e)}toJSON(){return this.value}toExtendedJSON(e){if(e&&(e.relaxed||e.legacy))return this.value;return{$numberInt:this.value.toString()}}static fromExtendedJSON(e,t){return t&&t.relaxed?parseInt(e.$numberInt,10):new Lo(e.$numberInt)}inspect(e,t,r){return r??=Ps,`new Int32(${r(this.value,t)})`}}class Ta extends Hn{get _bsontype(){return"MaxKey"}toExtendedJSON(){return{$maxKey:1}}static fromExtendedJSON(){return new Ta}inspect(){return"new MaxKey()"}}class Ma extends Hn{get _bsontype(){return"MinKey"}toExtendedJSON(){return{$minKey:1}}static fromExtendedJSON(){return new Ma}inspect(){return"new MinKey()"}}var th=new WeakMap,xs=[];for(let e=0;e<256;e++)xs.push(e.toString(16).padStart(2,"0"));var dd=new Int8Array(103);for(let e=48;e<=57;e++)dd[e]=e-48;for(let e=65;e<=70;e++)dd[e]=e-55;for(let e=97;e<=102;e++)dd[e]=e-87;class Rt extends Hn{get _bsontype(){return"ObjectId"}static index=0;static PROCESS_UNIQUE=null;static resetState=()=>{this.index=Math.floor(Math.random()*16777216),this.PROCESS_UNIQUE=null};static{this.resetState();let e,t=!1;try{e=globalThis?.process?.getBuiltinModule?.("v8")??{}}catch{}let r=e?.startupSnapshot;try{t=r?.isBuildingSnapshot?.()}catch{}if(t)r?.addDeserializeCallback?.(this.resetState)}static cacheHexString;i0;i1;i2;i3;setFromBytes(e,t=0){this.i0=e[t]<<16|e[t+1]<<8|e[t+2],this.i1=e[t+3]<<16|e[t+4]<<8|e[t+5],this.i2=e[t+6]<<16|e[t+7]<<8|e[t+8],this.i3=e[t+9]<<16|e[t+10]<<8|e[t+11]}setFromHex(e){let t=dd;this.i0=t[e.charCodeAt(0)]<<20|t[e.charCodeAt(1)]<<16|t[e.charCodeAt(2)]<<12|t[e.charCodeAt(3)]<<8|t[e.charCodeAt(4)]<<4|t[e.charCodeAt(5)],this.i1=t[e.charCodeAt(6)]<<20|t[e.charCodeAt(7)]<<16|t[e.charCodeAt(8)]<<12|t[e.charCodeAt(9)]<<8|t[e.charCodeAt(10)]<<4|t[e.charCodeAt(11)],this.i2=t[e.charCodeAt(12)]<<20|t[e.charCodeAt(13)]<<16|t[e.charCodeAt(14)]<<12|t[e.charCodeAt(15)]<<8|t[e.charCodeAt(16)]<<4|t[e.charCodeAt(17)],this.i3=t[e.charCodeAt(18)]<<20|t[e.charCodeAt(19)]<<16|t[e.charCodeAt(20)]<<12|t[e.charCodeAt(21)]<<8|t[e.charCodeAt(22)]<<4|t[e.charCodeAt(23)]}constructor(e,t){super();if(typeof t==="number"){this.setFromBytes(e,t);return}let r;if(typeof e==="object"&&e&&"id"in e){if(Rt.is(e)&&typeof e.i0==="number"&&typeof e.i1==="number"&&typeof e.i2==="number"&&typeof e.i3==="number"){this.i0=e.i0,this.i1=e.i1,this.i2=e.i2,this.i3=e.i3;return}if(typeof e.id!=="string"&&!ArrayBuffer.isView(e.id))throw new I("Argument passed in must have an id that is of type string or Buffer");if("toHexString"in e&&typeof e.toHexString==="function")r=F.fromHex(e.toHexString());else r=e.id}else r=e;if(r==null){let n=Math.floor(Date.now()/1000),s=Rt.getInc(),i=Rt.PROCESS_UNIQUE??=F.randomBytes(5);this.i0=n>>>8&16777215,this.i1=(n&255)<<16|i[0]<<8|i[1],this.i2=i[2]<<16|i[3]<<8|i[4],this.i3=s&16777215}else if(ArrayBuffer.isView(r)&&r.byteLength===12)this.setFromBytes(r instanceof Uint8Array?r:F.toLocalBufferType(r));else if(typeof r==="string")if(Rt.validateHexString(r)){if(this.setFromHex(r),Rt.cacheHexString)th.set(this,r)}else throw new I("input must be a 24 character hex string, 12 byte Uint8Array, or an integer");else throw new I("Argument passed in does not match the accepted types")}get id(){let e=F.allocateUnsafe(12);return e[0]=this.i0>>>16&255,e[1]=this.i0>>>8&255,e[2]=this.i0&255,e[3]=this.i1>>>16&255,e[4]=this.i1>>>8&255,e[5]=this.i1&255,e[6]=this.i2>>>16&255,e[7]=this.i2>>>8&255,e[8]=this.i2&255,e[9]=this.i3>>>16&255,e[10]=this.i3>>>8&255,e[11]=this.i3&255,e}set id(e){let t=e instanceof Uint8Array?e:F.toLocalBufferType(e);if(this.setFromBytes(t),Rt.cacheHexString)th.set(this,F.toHex(t))}static validateHexString(e){if(e?.length!==24)return!1;for(let t=0;t<24;t++){let r=e.charCodeAt(t);if(r>=48&&r<=57||r>=97&&r<=102||r>=65&&r<=70)continue;return!1}return!0}toHexString(){if(Rt.cacheHexString){let i=th.get(this);if(i)return i}let e=this.i0,t=this.i1,r=this.i2,n=this.i3,s=xs[e>>>16&255]+xs[e>>>8&255]+xs[e&255]+xs[t>>>16&255]+xs[t>>>8&255]+xs[t&255]+xs[r>>>16&255]+xs[r>>>8&255]+xs[r&255]+xs[n>>>16&255]+xs[n>>>8&255]+xs[n&255];if(Rt.cacheHexString)th.set(this,s);return s}static getInc(){return Rt.index=(Rt.index+1)%16777216}static generate(e){if(typeof e!=="number")e=Math.floor(Date.now()/1000);let t=Rt.getInc(),r=F.allocateUnsafe(12);_e.setInt32BE(r,0,e);let n=this.PROCESS_UNIQUE??=F.randomBytes(5);return r[4]=n[0],r[5]=n[1],r[6]=n[2],r[7]=n[3],r[8]=n[4],r[11]=t&255,r[10]=t>>>8&255,r[9]=t>>>16&255,r}toString(e){if(e==="base64")return F.toBase64(this.id);if(e==="hex")return this.toHexString();return this.toHexString()}toJSON(){return this.toHexString()}static is(e){return e!=null&&typeof e==="object"&&"_bsontype"in e&&e._bsontype==="ObjectId"}equals(e){if(e===void 0||e===null)return!1;if(Rt.is(e)&&typeof e.i0==="number"&&typeof e.i1==="number"&&typeof e.i2==="number"&&typeof e.i3==="number")return this.i3===e.i3&&this.i0===e.i0&&this.i1===e.i1&&this.i2===e.i2;if(typeof e==="string")return e.toLowerCase()===this.toHexString();if(typeof e==="object"&&typeof e.toHexString==="function"){let t=e.toHexString(),r=this.toHexString();return typeof t==="string"&&t.toLowerCase()===r}return!1}getTimestamp(){let e=new Date,t=this.i0*256+(this.i1>>>16);return e.setTime(t*1000),e}static createPk(){return new Rt}serializeInto(e,t){return e[t]=this.i0>>>16&255,e[t+1]=this.i0>>>8&255,e[t+2]=this.i0&255,e[t+3]=this.i1>>>16&255,e[t+4]=this.i1>>>8&255,e[t+5]=this.i1&255,e[t+6]=this.i2>>>16&255,e[t+7]=this.i2>>>8&255,e[t+8]=this.i2&255,e[t+9]=this.i3>>>16&255,e[t+10]=this.i3>>>8&255,e[t+11]=this.i3&255,12}static createFromTime(e){let t=F.allocate(12);for(let r=11;r>=4;r--)t[r]=0;return _e.setInt32BE(t,0,e),new Rt(t)}static createFromHexString(e){if(e?.length!==24)throw new I("hex string must be 24 characters");return new Rt(F.fromHex(e))}static createFromBase64(e){if(e?.length!==16)throw new I("base64 string must be 16 characters");return new Rt(F.fromBase64(e))}static isValid(e){if(e==null)return!1;if(typeof e==="string")return Rt.validateHexString(e);try{return new Rt(e),!0}catch{return!1}}toExtendedJSON(){if(this.toHexString)return{$oid:this.toHexString()};return{$oid:this.toString("hex")}}static fromExtendedJSON(e){return new Rt(e.$oid)}isCached(){return Rt.cacheHexString&&th.has(this)}inspect(e,t,r){return r??=Ps,`new ObjectId(${r(this.toHexString(),t)})`}}function TX(e,t,r){let n=[{object:e,ignoreUndefined:r??!1,exit:!1}],s=new Set,i=0;while(n.length>0){let o=n.pop();if(o.exit){s.delete(o.object);continue}let{object:u,ignoreUndefined:a}=o;s.add(u),o.exit=!0,n.push(o),i+=5;let c=Array.isArray(u),l=!c&&(u instanceof Map||hd(u)),f=u;if(!c&&!l&&typeof u?.toBSON==="function")f=u.toBSON();if(c){let h=f;for(let d=0;d<h.length;d++)i+=Og(d.toString(),h[d],t,!0,a,n,s)}else if(l)for(let[h,d]of f)i+=Og(h,d,t,!1,a,n,s);else for(let h of Object.keys(f))i+=Og(h,f[h],t,!1,a,n,s)}return i}function Og(e,t,r=!1,n=!1,s=!1,i,o){if(typeof t?.toBSON==="function")t=t.toBSON();switch(typeof t){case"string":return 1+F.utf8ByteLength(e)+1+4+F.utf8ByteLength(t)+1;case"number":if(Math.floor(t)===t&&t>=fw&&t<=hw)if(!Object.is(t,-0)&&t>=ch&&t<=ah)return F.utf8ByteLength(e)+1+5;else return F.utf8ByteLength(e)+1+9;else return F.utf8ByteLength(e)+1+9;case"undefined":if(n||!s)return F.utf8ByteLength(e)+1+1;return 0;case"boolean":return F.utf8ByteLength(e)+1+2;case"object":if(t!=null&&typeof t._bsontype==="string"&&t[fd]!==uh)throw new Ec;else if(t==null||t._bsontype==="MinKey"||t._bsontype==="MaxKey")return F.utf8ByteLength(e)+1+1;else if(t._bsontype==="ObjectId")return F.utf8ByteLength(e)+1+13;else if(t instanceof Date||cd(t))return F.utf8ByteLength(e)+1+9;else if(ArrayBuffer.isView(t)||t instanceof ArrayBuffer||Cg(t))return F.utf8ByteLength(e)+1+6+t.byteLength;else if(t._bsontype==="Long"||t._bsontype==="Double"||t._bsontype==="Timestamp")return F.utf8ByteLength(e)+1+9;else if(t._bsontype==="Decimal128")return F.utf8ByteLength(e)+1+17;else if(t._bsontype==="Int32")return F.utf8ByteLength(e)+1+5;else if(t._bsontype==="Code")if(t.scope!=null&&typeof t.scope==="object"){if(o.has(t.scope))throw new I("Cannot convert circular structure to BSON");return i.push({object:t.scope,ignoreUndefined:s,exit:!1}),F.utf8ByteLength(e)+1+1+4+4+F.utf8ByteLength(t.code.toString())+1}else return F.utf8ByteLength(e)+1+1+4+F.utf8ByteLength(t.code.toString())+1;else if(t._bsontype==="Binary"){let u=t;if(u.sub_type===ve.SUBTYPE_BYTE_ARRAY)return F.utf8ByteLength(e)+1+(u.position+1+4+1+4);else return F.utf8ByteLength(e)+1+(u.position+1+4+1)}else if(t._bsontype==="BSONSymbol")return F.utf8ByteLength(e)+1+F.utf8ByteLength(t.value)+4+1+1;else if(t._bsontype==="DBRef"){let u=Object.assign({$ref:t.collection,$id:t.oid},t.fields);if(t.db!=null)u.$db=t.db;return i.push({object:u,ignoreUndefined:!0,exit:!1}),F.utf8ByteLength(e)+1+1}else if(t instanceof RegExp||ad(t))return F.utf8ByteLength(e)+1+1+F.utf8ByteLength(t.source)+1+(t.global?1:0)+(t.ignoreCase?1:0)+(t.multiline?1:0)+1;else if(t._bsontype==="BSONRegExp")return F.utf8ByteLength(e)+1+1+F.utf8ByteLength(t.pattern)+1+F.utf8ByteLength(t.options)+1;else{if(o.has(t))throw new I("Cannot convert circular structure to BSON");return i.push({object:t,ignoreUndefined:s,exit:!1}),F.utf8ByteLength(e)+1+1}case"function":if(r)return F.utf8ByteLength(e)+1+1+4+F.utf8ByteLength(t.toString())+1;return 0;case"bigint":return F.utf8ByteLength(e)+1+9;case"symbol":return 0;default:throw new I(`Unrecognized JS type: ${typeof t}`)}}function MX(e){return e.split("").sort().join("")}class Ws extends Hn{get _bsontype(){return"BSONRegExp"}pattern;options;constructor(e,t){super();if(this.pattern=e,this.options=MX(t??""),this.pattern.indexOf("\x00")!==-1)throw new I(`BSON Regex patterns cannot contain null bytes, found: ${JSON.stringify(this.pattern)}`);if(this.options.indexOf("\x00")!==-1)throw new I(`BSON Regex options cannot contain null bytes, found: ${JSON.stringify(this.options)}`);for(let r=0;r<this.options.length;r++)if(!(this.options[r]==="i"||this.options[r]==="m"||this.options[r]==="x"||this.options[r]==="l"||this.options[r]==="s"||this.options[r]==="u"))throw new I(`The regular expression option [${this.options[r]}] is not supported`)}static parseOptions(e){return e?e.split("").sort().join(""):""}toExtendedJSON(e){if(e=e||{},e.legacy)return{$regex:this.pattern,$options:this.options};return{$regularExpression:{pattern:this.pattern,options:this.options}}}static fromExtendedJSON(e){if("$regex"in e)if(typeof e.$regex!=="string"){if(e.$regex._bsontype==="BSONRegExp")return e}else return new Ws(e.$regex,Ws.parseOptions(e.$options));if("$regularExpression"in e)return new Ws(e.$regularExpression.pattern,Ws.parseOptions(e.$regularExpression.options));throw new I(`Unexpected BSONRegExp EJSON object form: ${JSON.stringify(e)}`)}inspect(e,t,r){let n=ZQ(t)??((o)=>o);r??=Ps;let s=n(r(this.pattern),"regexp"),i=n(r(this.options),"regexp");return`new BSONRegExp(${s}, ${i})`}}class xa extends Hn{get _bsontype(){return"BSONSymbol"}value;constructor(e){super();this.value=e}valueOf(){return this.value}toString(){return this.value}toJSON(){return this.value}toExtendedJSON(){return{$symbol:this.value}}static fromExtendedJSON(e){return new xa(e.$symbol)}inspect(e,t,r){return r??=Ps,`new BSONSymbol(${r(this.value,t)})`}}var xX=T;class $i extends xX{get _bsontype(){return"Timestamp"}get[Da](){return"Timestamp"}static MAX_VALUE=T.MAX_UNSIGNED_VALUE;get i(){return this.low>>>0}get t(){return this.high>>>0}constructor(e){if(e==null)super(0,0,!0);else if(typeof e==="bigint")super(e,!0);else if(T.isLong(e))super(e.low,e.high,!0);else if(typeof e==="object"&&"t"in e&&"i"in e){if(typeof e.t!=="number"&&(typeof e.t!=="object"||e.t._bsontype!=="Int32"))throw new I("Timestamp constructed from { t, i } must provide t as a number");if(typeof e.i!=="number"&&(typeof e.i!=="object"||e.i._bsontype!=="Int32"))throw new I("Timestamp constructed from { t, i } must provide i as a number");let t=Number(e.t),r=Number(e.i);if(t<0||Number.isNaN(t))throw new I("Timestamp constructed from { t, i } must provide a positive t");if(r<0||Number.isNaN(r))throw new I("Timestamp constructed from { t, i } must provide a positive i");if(t>4294967295)throw new I("Timestamp constructed from { t, i } must provide t equal or less than uint32 max");if(r>4294967295)throw new I("Timestamp constructed from { t, i } must provide i equal or less than uint32 max");super(r,t,!0)}else throw new I("A Timestamp can only be constructed with: bigint, Long, or { t: number; i: number }")}toJSON(){return{$timestamp:this.toString()}}static fromInt(e){return new $i(T.fromInt(e,!0))}static fromNumber(e){return new $i(T.fromNumber(e,!0))}static fromBits(e,t){return new $i({i:e,t})}static fromString(e,t){return new $i(T.fromString(e,!0,t))}toExtendedJSON(){return{$timestamp:{t:this.t,i:this.i}}}static fromExtendedJSON(e){let t=T.isLong(e.$timestamp.i)?e.$timestamp.i.getLowBitsUnsigned():e.$timestamp.i,r=T.isLong(e.$timestamp.t)?e.$timestamp.t.getLowBitsUnsigned():e.$timestamp.t;return new $i({t:r,i:t})}inspect(e,t,r){r??=Ps;let n=r(this.t,t),s=r(this.i,t);return`new Timestamp({ t: ${n}, i: ${s} })`}}var PX=T.fromNumber(hw),BX=T.fromNumber(fw);function Mw(e,t,r){t=t==null?{}:t;let n=t&&t.index?t.index:0,s=_e.getInt32LE(e,n);if(s<5)throw new I(`bson size must be >= 5, is ${s}`);if(t.allowObjectSmallerThanBufferSize&&e.length<s)throw new I(`buffer length ${e.length} must be >= bson size ${s}`);if(!t.allowObjectSmallerThanBufferSize&&e.length!==s)throw new I(`buffer length ${e.length} must === bson size ${s}`);if(s+n>e.byteLength)throw new I(`(bson size ${s} + options.index ${n} must be <= buffer length ${e.byteLength})`);if(e[n+s-1]!==0)throw new I("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00");return FX(e,n,t,r)}var sw=/^\$ref$|^\$id$|^\$db$/;function iw(e,t,r){if(t==="__proto__")Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0});else e[t]=r}function ow(e){if(bw(e)){let{$ref:t,$id:r,$db:n,...s}=e;return new Yi(t,r,n,s)}return e}function FX(e,t,r,n=!1){r={...r};let s=r.fieldsAsRaw==null?null:r.fieldsAsRaw,i=r.raw==null?!1:r.raw,o=typeof r.bsonRegExp==="boolean"?r.bsonRegExp:!1,u=r.promoteBuffers??!1,a=r.promoteLongs??!0,c=r.promoteValues??!0,l=r.useBigInt64??!1;if(l&&!c)throw new I("Must either request bigint or Long for int64 deserialization");if(l&&!a)throw new I("Must either request bigint or Long for int64 deserialization");let f=r.validation==null?{utf8:!0}:r.validation,h=!0,d,p,m=f.utf8;if(typeof m==="boolean")d=m;else{h=!1;let v=Object.keys(m).map(function(P){return m[P]});if(v.length===0)throw new I("UTF-8 validation setting cannot be empty");if(typeof v[0]!=="boolean")throw new I("Invalid UTF-8 validation option, must specify boolean values");if(d=v[0],!v.every((P)=>P===d))throw new I("Invalid UTF-8 validation option - keys must be all true or all false")}if(!h){p=new Set;for(let v of Object.keys(m))p.add(v)}let _=t;if(e.length<5)throw new I("corrupt bson message < 5 bytes long");let y=_e.getInt32LE(e,t);if(t+=4,y<5||y>e.length)throw new I("corrupt bson message");let E=n?[]:{},w=0,b=n?!1:null,A=null,M=E,O=n;while(!0){let v=e[t++];if(v===0)if(A)if(t===A.lastIndex){let H=A;if(A=H.prev,A===null)M=E,O=n;else M=A.holdingDocument,O=A.isArray;let Se=H.holdingDocument;switch(H.elementType){case nh:if(H.isPossibleDBRef)Se=ow(Se);break;case rh:break;case ud:Se=new jo(H.functionString,H.holdingDocument);break;default:throw new I("Unexpected element type in frame stack")}iw(M,H.propertyName,Se);continue}else{if(A.elementType===rh)throw new I("corrupted array bson");throw new I("Bad BSON Document: object not properly terminated")}else break;let P=t;while(e[P]!==0&&P<e.length)P++;if(P>=e.byteLength)throw new I("Bad BSON Document: illegal CString");let ge=O?A!==null?A.arrayIndex++:w++:F.toUTF8(e,t,P,!1),Me;if(A!==null)Me=A.validationSetting;else if(h||p?.has(ge))Me=d;else Me=!d;if(A!==null){if(A.isPossibleDBRef!==!1&&typeof ge==="string"&&ge[0]==="$")A.isPossibleDBRef=sw.test(ge)}else if(b!==!1&&ge[0]==="$")b=sw.test(ge);let oe,Yt=!1;if(t=P+1,v===dw){let H=_e.getInt32LE(e,t);if(t+=4,H<=0||H>e.length-t||e[t+H-1]!==0)throw new I("bad string length in bson");oe=F.toUTF8(e,t,t+H-1,Me),t=t+H}else if(v===pw)oe=new Rt(e,t),t=t+12;else if(v===ih&&c===!1)oe=new Lo(_e.getInt32LE(e,t)),t+=4;else if(v===ih)oe=_e.getInt32LE(e,t),t+=4;else if(v===bg){if(oe=_e.getFloat64LE(e,t),t+=8,c===!1)oe=new zs(oe)}else if(v===yw){let H=_e.getInt32LE(e,t),Se=_e.getInt32LE(e,t+4);t+=8,oe=new Date(new T(H,Se).toNumber())}else if(v===mw){if(e[t]!==0&&e[t]!==1)throw new I("illegal boolean type value");oe=e[t++]===1}else if(v===nh){let H=_e.getInt32LE(e,t);if(H<5||H>e.length-t)throw new I("bad embedded document length in bson");if(i||(A?.raw??!1))oe=e.subarray(t,t+H),t=t+H;else{Yt=!0;let Se={holdingDocument:{},elementType:nh,propertyName:ge,functionString:null,lastIndex:t+H,isArray:!1,arrayIndex:0,raw:!1,isPossibleDBRef:null,validationSetting:Me,prev:A};A=Se,M=Se.holdingDocument,O=!1,t=t+4}}else if(v===rh){let H=_e.getInt32LE(e,t);if(H<5||H>e.length-t)throw new I("bad embedded array length in bson");let Se=t+H,ct=!!(s&&s[ge])||(A?.raw??!1);Yt=!0;let ss={holdingDocument:[],elementType:rh,propertyName:ge,functionString:null,lastIndex:Se,isArray:!0,arrayIndex:0,raw:ct,isPossibleDBRef:!1,validationSetting:Me,prev:A};A=ss,M=ss.holdingDocument,O=!0,t=t+4}else if(v===eX)oe=void 0;else if(v===Tg)oe=null;else if(v===xg)if(l)oe=_e.getBigInt64LE(e,t),t+=8;else{let H=_e.getInt32LE(e,t),Se=_e.getInt32LE(e,t+4);t+=8;let ct=new T(H,Se);if(a&&c===!0)oe=ct.lessThanOrEqual(PX)&&ct.greaterThanOrEqual(BX)?ct.toNumber():ct;else oe=ct}else if(v===Ew){let H=F.allocateUnsafe(16);for(let Se=0;Se<16;Se++)H[Se]=e[t+Se];t=t+16,oe=new wn(H)}else if(v===Dg){let H=_e.getInt32LE(e,t);t+=4;let Se=H,ct=e[t++];if(H<0)throw new I("Negative binary type element size found");if(H>e.byteLength)throw new I("Binary type size larger than document size");if(ct===ve.SUBTYPE_BYTE_ARRAY){if(H=_e.getInt32LE(e,t),t+=4,H<0)throw new I("Negative binary type element size found for subtype 0x02");if(H>Se-4)throw new I("Binary type with subtype 0x02 contains too long binary size");if(H<Se-4)throw new I("Binary type with subtype 0x02 contains too short binary size")}if(u&&c)oe=F.toLocalBufferType(e.subarray(t,t+H));else if(oe=new ve(e.subarray(t,t+H),ct),ct===Pg&&dn.isValid(oe))oe=oe.toUUID();t=t+H}else if(v===ld&&o===!1){P=t;while(e[P]!==0&&P<e.length)P++;if(P>=e.length)throw new I("Bad BSON Document: illegal CString");let H=F.toUTF8(e,t,P,!1);t=P+1,P=t;while(e[P]!==0&&P<e.length)P++;if(P>=e.length)throw new I("Bad BSON Document: illegal CString");let Se=F.toUTF8(e,t,P,!1);t=P+1;let ct=Array(Se.length);for(P=0;P<Se.length;P++)switch(Se[P]){case"m":ct[P]="m";break;case"s":ct[P]="g";break;case"i":ct[P]="i";break}oe=new RegExp(H,ct.join(""))}else if(v===ld&&o===!0){P=t;while(e[P]!==0&&P<e.length)P++;if(P>=e.length)throw new I("Bad BSON Document: illegal CString");let H=F.toUTF8(e,t,P,!1);t=P+1,P=t;while(e[P]!==0&&P<e.length)P++;if(P>=e.length)throw new I("Bad BSON Document: illegal CString");let Se=F.toUTF8(e,t,P,!1);t=P+1,oe=new Ws(H,Se)}else if(v===gw){let H=_e.getInt32LE(e,t);if(t+=4,H<=0||H>e.length-t||e[t+H-1]!==0)throw new I("bad string length in bson");let Se=F.toUTF8(e,t,t+H-1,Me);oe=c?Se:new xa(Se),t=t+H}else if(v===_w)oe=new $i({i:_e.getUint32LE(e,t),t:_e.getUint32LE(e,t+4)}),t+=8;else if(v===Aw)oe=new Ma;else if(v===Ow)oe=new Ta;else if(v===Mg){let H=_e.getInt32LE(e,t);if(t+=4,H<=0||H>e.length-t||e[t+H-1]!==0)throw new I("bad string length in bson");let Se=F.toUTF8(e,t,t+H-1,Me);oe=new jo(Se),t=t+H}else if(v===ud){let H=_e.getInt32LE(e,t);if(t+=4,H<13)throw new I("code_w_scope total size shorter minimum expected length");let Se=_e.getInt32LE(e,t);if(t+=4,Se<=0||Se>e.length-t||e[t+Se-1]!==0)throw new I("bad string length in bson");let ct=F.toUTF8(e,t,t+Se-1,Me);t=t+Se;let ss=t,ze=_e.getInt32LE(e,t);if(ze<5||ze>e.length-t)throw new I("bad scope document size in code_w_scope");if(H<8+ze+Se)throw new I("code_w_scope total size is too short, truncating scope");if(H>8+ze+Se)throw new I("code_w_scope total size is too long, clips outer document");Yt=!0;let Sn={holdingDocument:{},elementType:ud,propertyName:ge,functionString:ct,lastIndex:ss+ze,isArray:!1,arrayIndex:0,raw:!1,isPossibleDBRef:null,validationSetting:Me,prev:A};A=Sn,M=Sn.holdingDocument,O=!1,t=t+4}else if(v===tX){let H=_e.getInt32LE(e,t);if(t+=4,H<=0||H>e.length-t||e[t+H-1]!==0)throw new I("bad string length in bson");let Se=F.toUTF8(e,t,t+H-1,Me);t=t+H;let ct=F.allocateUnsafe(12);for(let ze=0;ze<12;ze++)ct[ze]=e[t+ze];let ss=new Rt(ct);t=t+12,oe=new Yi(Se,ss)}else throw new I(`Detected unknown BSON type ${v.toString(16)} for fieldname "${ge}"`);if(!Yt)iw(M,ge,oe)}if(A!==null)throw new I("corrupted bson, more objects expected based on the current document size");let x=E;if(y!==t-_){if(n)throw new I("corrupt array bson");throw new I("corrupt object bson")}if(!b)return x;return ow(x)}var Bg=/\x00/,NX=new Set(["$db","$ref","$id","$clusterTime"]);function IX(e,t,r,n){e[n++]=dw;let s=F.encodeUTF8Into(e,t,n);n=n+s+1,e[n-1]=0;let i=F.encodeUTF8Into(e,r,n+4);return _e.setInt32LE(e,n,i+1),n=n+4+i,e[n++]=0,n}function RX(e,t,r,n){let i=!Object.is(r,-0)&&Number.isSafeInteger(r)&&r<=ah&&r>=ch?ih:bg;e[n++]=i;let o=F.encodeUTF8Into(e,t,n);if(n=n+o,e[n++]=0,i===ih)n+=_e.setInt32LE(e,n,r);else n+=_e.setFloat64LE(e,n,r);return n}function $X(e,t,r,n){e[n++]=xg;let s=F.encodeUTF8Into(e,t,n);return n+=s,e[n++]=0,n+=_e.setBigInt64LE(e,n,r),n}function uw(e,t,r,n){e[n++]=Tg;let s=F.encodeUTF8Into(e,t,n);return n=n+s,e[n++]=0,n}function vX(e,t,r,n){e[n++]=mw;let s=F.encodeUTF8Into(e,t,n);return n=n+s,e[n++]=0,e[n++]=r?1:0,n}function kX(e,t,r,n){e[n++]=yw;let s=F.encodeUTF8Into(e,t,n);n=n+s,e[n++]=0;let i=T.fromNumber(r.getTime()),o=i.getLowBits(),u=i.getHighBits();return n+=_e.setInt32LE(e,n,o),n+=_e.setInt32LE(e,n,u),n}function qX(e,t,r,n){e[n++]=ld;let s=F.encodeUTF8Into(e,t,n);if(n=n+s,e[n++]=0,r.source&&r.source.match(Bg)!=null)throw new I("value "+r.source+" must not contain null bytes");if(n=n+F.encodeUTF8Into(e,r.source,n),e[n++]=0,r.ignoreCase)e[n++]=105;if(r.global)e[n++]=115;if(r.multiline)e[n++]=109;return e[n++]=0,n}function jX(e,t,r,n){e[n++]=ld;let s=F.encodeUTF8Into(e,t,n);if(n=n+s,e[n++]=0,r.pattern.match(Bg)!=null)throw new I("pattern "+r.pattern+" must not contain null bytes");n=n+F.encodeUTF8Into(e,r.pattern,n),e[n++]=0;let i=r.options.split("").sort().join("");return n=n+F.encodeUTF8Into(e,i,n),e[n++]=0,n}function LX(e,t,r,n){if(r===null)e[n++]=Tg;else if(r[Da]==="MinKey")e[n++]=Aw;else e[n++]=Ow;let s=F.encodeUTF8Into(e,t,n);return n=n+s,e[n++]=0,n}function UX(e,t,r,n){e[n++]=pw;let s=F.encodeUTF8Into(e,t,n);return n=n+s,e[n++]=0,n+=r.serializeInto(e,n),n}function VX(e,t,r,n){e[n++]=Dg;let s=F.encodeUTF8Into(e,t,n);n=n+s,e[n++]=0;let i=r.length;if(n+=_e.setInt32LE(e,n,i),e[n++]=rX,i<=16)for(let o=0;o<i;o++)e[n+o]=r[o];else e.set(r,n);return n=n+i,n}function zX(e,t,r,n){e[n++]=Ew;let s=F.encodeUTF8Into(e,t,n);n=n+s,e[n++]=0;for(let i=0;i<16;i++)e[n+i]=r.bytes[i];return n+16}function WX(e,t,r,n){e[n++]=r[Da]==="Long"?xg:_w;let s=F.encodeUTF8Into(e,t,n);n=n+s,e[n++]=0;let i=r.getLowBits(),o=r.getHighBits();return n+=_e.setInt32LE(e,n,i),n+=_e.setInt32LE(e,n,o),n}function HX(e,t,r,n){r=r.valueOf(),e[n++]=ih;let s=F.encodeUTF8Into(e,t,n);return n=n+s,e[n++]=0,n+=_e.setInt32LE(e,n,r),n}function KX(e,t,r,n){e[n++]=bg;let s=F.encodeUTF8Into(e,t,n);return n=n+s,e[n++]=0,n+=_e.setFloat64LE(e,n,r.value),n}function GX(e,t,r,n){e[n++]=Mg;let s=F.encodeUTF8Into(e,t,n);n=n+s,e[n++]=0;let i=r.toString(),o=F.encodeUTF8Into(e,i,n+4)+1;return _e.setInt32LE(e,n,o),n=n+4+o-1,e[n++]=0,n}function YX(e,t,r,n){e[n++]=Dg;let s=F.encodeUTF8Into(e,t,n);n=n+s,e[n++]=0;let{buffer:i,position:o}=r;if(r.sub_type===ve.SUBTYPE_BYTE_ARRAY)o=o+4;if(n+=_e.setInt32LE(e,n,o),e[n++]=r.sub_type,r.sub_type===ve.SUBTYPE_BYTE_ARRAY)o=o-4,n+=_e.setInt32LE(e,n,o);if(r.sub_type===ve.SUBTYPE_VECTOR)ko(r);if(o<=16)for(let u=0;u<o;u++)e[n+u]=i[u];else e.set(i,n);return n=n+r.position,n}function JX(e,t,r,n){e[n++]=gw;let s=F.encodeUTF8Into(e,t,n);n=n+s,e[n++]=0;let i=F.encodeUTF8Into(e,r.value,n+4)+1;return _e.setInt32LE(e,n,i),n=n+4+i-1,e[n++]=0,n}function od(e,t,r,n,s,i){if(Array.isArray(e))return{sourceObject:e,isArray:!0,objectSizeIndex:t,codeSizeIndex:r,iterTarget:e,keys:null,keyIndex:0,mapIterator:null,prev:n,checkKeys:s,ignoreUndefined:i};if(e instanceof Map||hd(e))return{sourceObject:e,isArray:!1,objectSizeIndex:t,codeSizeIndex:r,iterTarget:e,keys:null,keyIndex:0,mapIterator:e.entries(),prev:n,checkKeys:s,ignoreUndefined:i};let o=e;if(typeof o?.toBSON==="function"){if(o=o.toBSON(),o!=null&&typeof o!=="object")throw new I("toBSON function did not return an object")}return{sourceObject:e,isArray:!1,objectSizeIndex:t,codeSizeIndex:r,iterTarget:o,keys:Object.keys(o),keyIndex:0,mapIterator:null,prev:n,checkKeys:s,ignoreUndefined:i}}function xw(e,t,r,n,s,i,o){if(o==null){if(t==null)return e[0]=5,e[1]=0,e[2]=0,e[3]=0,e[4]=0,5;if(Array.isArray(t))throw new I("serialize does not support an array as the root input");if(typeof t!=="object")throw new I("serialize does not support non-object as the root input");else if("_bsontype"in t&&typeof t._bsontype==="string")throw new I("BSON types cannot be serialized as a document");else if(cd(t)||ad(t)||_c(t)||Cg(t))throw new I("date, regexp, typedarray, and arraybuffer cannot be BSON documents");o=new Set}o.add(t);let u=od(t,n,null,null,r,i),a=n+4;while(u!==null){let c=u,l,f;if(c.mapIterator!==null){let d=c.mapIterator.next();if(d.done){if(e[a++]=0,_e.setInt32LE(e,c.objectSizeIndex,a-c.objectSizeIndex),c.codeSizeIndex!==null)_e.setInt32LE(e,c.codeSizeIndex,a-c.codeSizeIndex);o.delete(c.sourceObject),u=c.prev;continue}l=d.value[0],f=d.value[1]}else if(c.keys!==null){if(c.keyIndex>=c.keys.length){if(e[a++]=0,_e.setInt32LE(e,c.objectSizeIndex,a-c.objectSizeIndex),c.codeSizeIndex!==null)_e.setInt32LE(e,c.codeSizeIndex,a-c.codeSizeIndex);o.delete(c.sourceObject),u=c.prev;continue}l=c.keys[c.keyIndex++],f=c.iterTarget[l]}else{let d=c.iterTarget;if(c.keyIndex>=d.length){if(e[a++]=0,_e.setInt32LE(e,c.objectSizeIndex,a-c.objectSizeIndex),c.codeSizeIndex!==null)_e.setInt32LE(e,c.codeSizeIndex,a-c.codeSizeIndex);o.delete(c.sourceObject),u=c.prev;continue}let p=c.keyIndex++;l=String(p),f=d[p]}if(typeof f?.toBSON==="function")f=f.toBSON();if(!c.isArray&&typeof l==="string"&&!(l[0]==="$"&&NX.has(l))){if(Bg.test(l))throw new I("key "+l+" must not contain null bytes");if(c.checkKeys){if(l[0]==="$")throw new I("key "+l+" must not start with '$'");else if(l.includes("."))throw new I("key "+l+" must not contain '.'")}}let h=typeof f;if(f===void 0){if(c.isArray||c.ignoreUndefined===!1)a=uw(e,l,f,a)}else if(f===null)a=uw(e,l,f,a);else if(h==="string")a=IX(e,l,f,a);else if(h==="number")a=RX(e,l,f,a);else if(h==="bigint")a=$X(e,l,f,a);else if(h==="boolean")a=vX(e,l,f,a);else if(h==="object"&&f._bsontype==null)if(f instanceof Date||cd(f))a=kX(e,l,f,a);else if(f instanceof Uint8Array||_c(f))a=VX(e,l,f,a);else if(f instanceof RegExp||ad(f))a=qX(e,l,f,a);else{if(o.has(f))throw new I("Cannot convert circular structure to BSON");let d=Array.isArray(f);e[a++]=d?rh:nh,a+=F.encodeUTF8Into(e,l,a),e[a++]=0;let p=a;o.add(f),u=od(f,p,null,c,c.checkKeys,c.ignoreUndefined),a+=4}else if(h==="object"){if(f[fd]!==uh)throw new Ec;let d=f[Da];if(d==="ObjectId")a=UX(e,l,f,a);else if(d==="Decimal128")a=zX(e,l,f,a);else if(d==="Long"||d==="Timestamp")a=WX(e,l,f,a);else if(d==="Double")a=KX(e,l,f,a);else if(d==="Code"){let p=f;if(p.scope&&typeof p.scope==="object"){e[a++]=ud,a+=F.encodeUTF8Into(e,l,a),e[a++]=0;let m=a;a+=4;let _=p.code,y=F.encodeUTF8Into(e,_,a+4)+1;_e.setInt32LE(e,a,y),e[a+4+y-1]=0,a=a+y+4;let E=p.scope;if(o.has(E))throw new I("Cannot convert circular structure to BSON");o.add(E),u=od(E,a,m,c,c.checkKeys,c.ignoreUndefined),a+=4}else{e[a++]=Mg,a+=F.encodeUTF8Into(e,l,a),e[a++]=0;let m=p.code.toString(),_=F.encodeUTF8Into(e,m,a+4)+1;_e.setInt32LE(e,a,_),a=a+4+_-1,e[a++]=0}}else if(d==="Binary")a=YX(e,l,f,a);else if(d==="BSONSymbol")a=JX(e,l,f,a);else if(d==="DBRef"){let p=f,m=Object.assign({$ref:p.collection,$id:p.oid},p.db!=null?{$db:p.db}:null,p.fields);e[a++]=nh,a+=F.encodeUTF8Into(e,l,a),e[a++]=0,o.add(m),u=od(m,a,null,c,!1,!0),a+=4}else if(d==="BSONRegExp")a=jX(e,l,f,a);else if(d==="Int32")a=HX(e,l,f,a);else if(d==="MinKey"||d==="MaxKey")a=LX(e,l,f,a);else if(typeof f._bsontype<"u")throw new I(`Unrecognized or invalid _bsontype: ${String(f._bsontype)}`)}else if(h==="function"&&s)a=GX(e,l,f,a)}return a}function QX(e){return e!=null&&typeof e==="object"&&"_bsontype"in e&&typeof e._bsontype==="string"}var XX={$oid:Rt,$binary:ve,$uuid:ve,$symbol:xa,$numberInt:Lo,$numberDecimal:wn,$numberDouble:zs,$numberLong:T,$minKey:Ma,$maxKey:Ta,$regex:Ws,$regularExpression:Ws,$timestamp:$i};function Pw(e,t={}){if(typeof e==="number"){let n=e<=ah&&e>=ch,s=e<=cw&&e>=lw;if(t.relaxed||t.legacy)return e;if(Number.isInteger(e)&&!Object.is(e,-0)){if(n)return new Lo(e);if(s){if(t.useBigInt64)return BigInt(e);return T.fromNumber(e)}}return new zs(e)}if(e==null||typeof e!=="object")return e;if(e.$undefined)return null;let r=Object.keys(e).filter((n)=>n.startsWith("$")&&e[n]!=null);for(let n=0;n<r.length;n++){let s=XX[r[n]];if(s)return s.fromExtendedJSON(e,t)}if(e.$date!=null){let n=e.$date,s=new Date;if(t.legacy)if(typeof n==="number")s.setTime(n);else if(typeof n==="string")s.setTime(Date.parse(n));else if(typeof n==="bigint")s.setTime(Number(n));else throw new oh(`Unrecognized type for EJSON date: ${typeof n}`);else if(typeof n==="string")s.setTime(Date.parse(n));else if(T.isLong(n))s.setTime(n.toNumber());else if(typeof n==="number"&&t.relaxed)s.setTime(n);else if(typeof n==="bigint")s.setTime(Number(n));else throw new oh(`Unrecognized type for EJSON date: ${typeof n}`);return s}if(e.$code!=null){let n=Object.assign({},e);if(e.$scope)n.$scope=Pw(e.$scope);return jo.fromExtendedJSON(e)}if(bw(e)||e.$dbPointer){let n=e.$ref?e:e.$dbPointer;if(n instanceof Yi)return n;let s=Object.keys(n).filter((o)=>o.startsWith("$")),i=!0;if(s.forEach((o)=>{if(["$ref","$id","$db"].indexOf(o)===-1)i=!1}),i)return Yi.fromExtendedJSON(n)}return e}function ZX(e,t){return e.map((r,n)=>{t.seenObjects.push({propertyName:`index ${n}`,obj:null});try{return qo(r,t)}finally{t.seenObjects.pop()}})}function aw(e){let t=e.toISOString();return e.getUTCMilliseconds()!==0?t:t.slice(0,-5)+"Z"}function qo(e,t){if(e instanceof Map||hd(e)){let r=Object.create(null);for(let[n,s]of e){if(typeof n!=="string")throw new I("Can only serialize maps with string keys");r[n]=s}return qo(r,t)}if((typeof e==="object"||typeof e==="function")&&e!==null){let r=t.seenObjects.findIndex((n)=>n.obj===e);if(r!==-1){let n=t.seenObjects.map((l)=>l.propertyName),s=n.slice(0,r).map((l)=>`${l} -> `).join(""),i=n[r],o=" -> "+n.slice(r+1,n.length-1).map((l)=>`${l} -> `).join(""),u=n[n.length-1],a=" ".repeat(s.length+i.length/2),c="-".repeat(o.length+(i.length+u.length)/2-1);throw new I(`Converting circular structure to EJSON:
7
- ${s}${i}${o}${u}
8
- ${a}\\${c}/`)}t.seenObjects[t.seenObjects.length-1].obj=e}if(Array.isArray(e))return ZX(e,t);if(e===void 0)return t.ignoreUndefined?void 0:null;if(e instanceof Date||cd(e)){let r=e.getTime(),n=r>-1&&r<253402300800000;if(t.legacy)return t.relaxed&&n?{$date:e.getTime()}:{$date:aw(e)};return t.relaxed&&n?{$date:aw(e)}:{$date:{$numberLong:e.getTime().toString()}}}if(typeof e==="number"&&(!t.relaxed||!isFinite(e))){if(Number.isInteger(e)&&!Object.is(e,-0)){if(e>=ch&&e<=ah)return{$numberInt:e.toString()};if(e>=lw&&e<=cw)return{$numberLong:e.toString()}}return{$numberDouble:Object.is(e,-0)?"-0.0":e.toString()}}if(typeof e==="bigint"){if(!t.relaxed)return{$numberLong:BigInt.asIntN(64,e).toString()};return Number(BigInt.asIntN(64,e))}if(e instanceof RegExp||ad(e)){let r=e.flags;if(r===void 0){let s=e.toString().match(/[gimuy]*$/);if(s)r=s[0]}return new Ws(e.source,r).toExtendedJSON(t)}if(e!=null&&typeof e==="object")return tZ(e,t);return e}var eZ={Binary:(e)=>new ve(e.value(),e.sub_type),Code:(e)=>new jo(e.code,e.scope),DBRef:(e)=>new Yi(e.collection||e.namespace,e.oid,e.db,e.fields),Decimal128:(e)=>new wn(e.bytes),Double:(e)=>new zs(e.value),Int32:(e)=>new Lo(e.value),Long:(e)=>T.fromBits(e.low!=null?e.low:e.low_,e.low!=null?e.high:e.high_,e.low!=null?e.unsigned:e.unsigned_),MaxKey:()=>new Ta,MinKey:()=>new Ma,ObjectId:(e)=>new Rt(e),BSONRegExp:(e)=>new Ws(e.pattern,e.options),BSONSymbol:(e)=>new xa(e.value),Timestamp:(e)=>$i.fromBits(e.low,e.high)};function tZ(e,t){if(e==null||typeof e!=="object")throw new I("not an object instance");let r=e._bsontype;if(typeof r>"u"){let n={};for(let s of Object.keys(e)){t.seenObjects.push({propertyName:s,obj:null});try{let i=qo(e[s],t);if(s==="__proto__")Object.defineProperty(n,s,{value:i,writable:!0,enumerable:!0,configurable:!0});else n[s]=i}finally{t.seenObjects.pop()}}return n}else if(e!=null&&typeof e==="object"&&typeof e._bsontype==="string"&&e[fd]!==uh)throw new Ec;else if(QX(e)){let n=e;if(typeof n.toExtendedJSON!=="function"){let s=eZ[e._bsontype];if(!s)throw new I("Unrecognized or invalid _bsontype: "+e._bsontype);n=s(n)}if(r==="Code"&&n.scope)n=new jo(n.code,qo(n.scope,t));else if(r==="DBRef"&&n.oid)n=new Yi(qo(n.collection,t),qo(n.oid,t),qo(n.db,t),qo(n.fields,t));return n.toExtendedJSON(t)}else throw new I("_bsontype must be a string, but was: "+typeof r)}function Bw(e,t){let r={useBigInt64:t?.useBigInt64??!1,relaxed:t?.relaxed??!0,legacy:t?.legacy??!1};return JSON.parse(e,(n,s)=>{if(n.indexOf("\x00")!==-1)throw new I(`BSON Document field names cannot contain null bytes, found: ${JSON.stringify(n)}`);return Pw(s,r)})}function Fw(e,t,r,n){if(r!=null&&typeof r==="object")n=r,r=void 0;if(t!=null&&typeof t==="object"&&!Array.isArray(t))n=t,t=void 0;let s=Object.assign({relaxed:!0,legacy:!1},n,{seenObjects:[{propertyName:"(root)",obj:null}]}),i=qo(e,s);return JSON.stringify(i,t,r)}function rZ(e,t){return t=t||{},JSON.parse(Fw(e,t))}function nZ(e,t){return t=t||{},Bw(JSON.stringify(e),t)}var Pa=Object.create(null);Pa.parse=Bw;Pa.stringify=Fw;Pa.serialize=rZ;Pa.deserialize=nZ;Object.freeze(Pa);var tr={double:1,string:2,object:3,array:4,binData:5,undefined:6,objectId:7,bool:8,date:9,null:10,regex:11,dbPointer:12,javascript:13,symbol:14,javascriptWithScope:15,int:16,timestamp:17,long:18,decimal:19,minKey:255,maxKey:127};function Sg(e,t){try{return _e.getNonnegativeInt32LE(e,t)}catch(r){throw new Ri("BSON size cannot be negative",t,{cause:r})}}function wg(e,t){let r=t;for(;e[r];r++);if(r>=e.length-1)throw new Ri("Null terminator not found",t);return r}function sZ(e,t=0){if(t??=0,e.length<5)throw new Ri(`Input must be at least 5 bytes, got ${e.length} bytes`,t);let r=Sg(e,t);if(r>e.length-t)throw new Ri(`Parsed documentSize (${r} bytes) does not match input length (${e.length} bytes)`,t);if(e[t+r-1]!==0)throw new Ri("BSON documents must end in 0x00",t+r);let n=[],s=t+4;while(s<=r+t){let i=e[s];if(s+=1,i===0){if(s-t!==r)throw new Ri("Invalid 0x00 type byte",s);break}let o=s,u=wg(e,s)-o;s+=u+1;let a;if(i===tr.double||i===tr.long||i===tr.date||i===tr.timestamp)a=8;else if(i===tr.int)a=4;else if(i===tr.objectId)a=12;else if(i===tr.decimal)a=16;else if(i===tr.bool)a=1;else if(i===tr.null||i===tr.undefined||i===tr.maxKey||i===tr.minKey)a=0;else if(i===tr.regex)a=wg(e,wg(e,s)+1)+1-s;else if(i===tr.object||i===tr.array||i===tr.javascriptWithScope)a=Sg(e,s);else if(i===tr.string||i===tr.binData||i===tr.dbPointer||i===tr.javascript||i===tr.symbol){if(a=Sg(e,s)+4,i===tr.binData)a+=1;if(i===tr.dbPointer)a+=12}else throw new Ri(`Invalid 0x${i.toString(16).padStart(2,"0")} type byte`,s);if(s+a>t+r-1)throw new Ri("value reports length larger than document",s);n.push([i,o,u,s,a]),s+=a}return n}var Ac=Object.create(null);Ac.parseToElements=sZ;Ac.ByteUtils=F;Ac.NumberUtils=_e;Object.freeze(Ac);var Nw=17825792,fu=F.allocate(Nw);function Iw(e){if(fu.length<e)fu=F.allocate(e)}function Rw(e,t={}){let r=typeof t.checkKeys==="boolean"?t.checkKeys:!1,n=typeof t.serializeFunctions==="boolean"?t.serializeFunctions:!1,s=typeof t.ignoreUndefined==="boolean"?t.ignoreUndefined:!0,i=typeof t.minInternalBufferSize==="number"?t.minInternalBufferSize:Nw;if(fu.length<i)fu=F.allocate(i);let o=xw(fu,e,r,0,n,s,null),u=F.allocateUnsafe(o);return u.set(fu.subarray(0,o),0),u}function $w(e,t,r={}){let n=typeof r.checkKeys==="boolean"?r.checkKeys:!1,s=typeof r.serializeFunctions==="boolean"?r.serializeFunctions:!1,i=typeof r.ignoreUndefined==="boolean"?r.ignoreUndefined:!0,o=typeof r.index==="number"?r.index:0,u=xw(fu,e,n,0,s,i,null);return t.set(fu.subarray(0,u),o),o+u-1}function vw(e,t={}){return Mw(F.toLocalBufferType(e),t)}function kw(e,t={}){t=t||{};let r=typeof t.serializeFunctions==="boolean"?t.serializeFunctions:!1,n=typeof t.ignoreUndefined==="boolean"?t.ignoreUndefined:!0;return TX(e,r,n)}function qw(e,t,r,n,s,i){let o=Object.assign({allowObjectSmallerThanBufferSize:!0,index:0},i),u=F.toLocalBufferType(e),a=t;for(let c=0;c<r;c++){let l=_e.getInt32LE(u,a);o.index=a,n[s+c]=Mw(u,o),a=a+l}return a}var iZ=Object.freeze({__proto__:null,BSONError:I,BSONOffsetError:Ri,BSONRegExp:Ws,BSONRuntimeError:oh,BSONSymbol:xa,BSONType:Sw,BSONValue:Hn,BSONVersionError:Ec,Binary:ve,ByteUtils:F,Code:jo,DBRef:Yi,Decimal128:wn,Double:zs,EJSON:Pa,Int32:Lo,Long:T,MaxKey:Ta,MinKey:Ma,NumberUtils:_e,ObjectId:Rt,Timestamp:$i,UUID:dn,bsonType:Da,calculateObjectSize:kw,deserialize:vw,deserializeStream:qw,onDemand:Ac,serialize:Rw,serializeWithBufferAndIndex:$w,setInternalBufferSize:Iw});oZ.BSON=iZ;oZ.BSONError=I;oZ.BSONOffsetError=Ri;oZ.BSONRegExp=Ws;oZ.BSONRuntimeError=oh;oZ.BSONSymbol=xa;oZ.BSONType=Sw;oZ.BSONValue=Hn;oZ.BSONVersionError=Ec;oZ.Binary=ve;oZ.ByteUtils=F;oZ.Code=jo;oZ.DBRef=Yi;oZ.Decimal128=wn;oZ.Double=zs;oZ.EJSON=Pa;oZ.Int32=Lo;oZ.Long=T;oZ.MaxKey=Ta;oZ.MinKey=Ma;oZ.NumberUtils=_e;oZ.ObjectId=Rt;oZ.Timestamp=$i;oZ.UUID=dn;oZ.bsonType=Da;oZ.calculateObjectSize=kw;oZ.deserialize=vw;oZ.deserializeStream=qw;oZ.onDemand=Ac;oZ.serialize=Rw;oZ.serializeWithBufferAndIndex=$w;oZ.setInternalBufferSize=Iw});var we=g(function(zt){Object.defineProperty(zt,"__esModule",{value:!0});zt.setUint32LE=zt.readUint8=zt.readInt32LE=zt.UUID=zt.Timestamp=zt.serialize=zt.ObjectId=zt.NumberUtils=zt.MinKey=zt.MaxKey=zt.Long=zt.Int32=zt.EJSON=zt.Double=zt.deserialize=zt.Decimal128=zt.DBRef=zt.Code=zt.calculateObjectSize=zt.ByteUtils=zt.BSONType=zt.BSONSymbol=zt.BSONRegExp=zt.BSONError=zt.BSON=zt.Binary=void 0;zt.parseToElementsToArray=qZ;zt.pluckBSONSerializeOptions=VZ;zt.resolveBSONOptions=zZ;zt.parseUtf8ValidationOption=WZ;var pd=Fg(),rr=Fg();Object.defineProperty(zt,"Binary",{enumerable:!0,get:function(){return rr.Binary}});Object.defineProperty(zt,"BSON",{enumerable:!0,get:function(){return rr.BSON}});Object.defineProperty(zt,"BSONError",{enumerable:!0,get:function(){return rr.BSONError}});Object.defineProperty(zt,"BSONRegExp",{enumerable:!0,get:function(){return rr.BSONRegExp}});Object.defineProperty(zt,"BSONSymbol",{enumerable:!0,get:function(){return rr.BSONSymbol}});Object.defineProperty(zt,"BSONType",{enumerable:!0,get:function(){return rr.BSONType}});Object.defineProperty(zt,"ByteUtils",{enumerable:!0,get:function(){return rr.ByteUtils}});Object.defineProperty(zt,"calculateObjectSize",{enumerable:!0,get:function(){return rr.calculateObjectSize}});Object.defineProperty(zt,"Code",{enumerable:!0,get:function(){return rr.Code}});Object.defineProperty(zt,"DBRef",{enumerable:!0,get:function(){return rr.DBRef}});Object.defineProperty(zt,"Decimal128",{enumerable:!0,get:function(){return rr.Decimal128}});Object.defineProperty(zt,"deserialize",{enumerable:!0,get:function(){return rr.deserialize}});Object.defineProperty(zt,"Double",{enumerable:!0,get:function(){return rr.Double}});Object.defineProperty(zt,"EJSON",{enumerable:!0,get:function(){return rr.EJSON}});Object.defineProperty(zt,"Int32",{enumerable:!0,get:function(){return rr.Int32}});Object.defineProperty(zt,"Long",{enumerable:!0,get:function(){return rr.Long}});Object.defineProperty(zt,"MaxKey",{enumerable:!0,get:function(){return rr.MaxKey}});Object.defineProperty(zt,"MinKey",{enumerable:!0,get:function(){return rr.MinKey}});Object.defineProperty(zt,"NumberUtils",{enumerable:!0,get:function(){return rr.NumberUtils}});Object.defineProperty(zt,"ObjectId",{enumerable:!0,get:function(){return rr.ObjectId}});Object.defineProperty(zt,"serialize",{enumerable:!0,get:function(){return rr.serialize}});Object.defineProperty(zt,"Timestamp",{enumerable:!0,get:function(){return rr.Timestamp}});Object.defineProperty(zt,"UUID",{enumerable:!0,get:function(){return rr.UUID}});function qZ(e,t){let r=pd.BSON.onDemand.parseToElements(e,t);return Array.isArray(r)?r:[...r]}var jw=(e,t,r)=>{if(t<0||t+r>e.length)throw RangeError(`Attempt to access memory outside buffer bounds: buffer length: ${e.length}, offset: ${t}, length: ${r}`)},jZ=(e,t)=>(jw(e,t,4),pd.NumberUtils.getInt32LE(e,t));zt.readInt32LE=jZ;var LZ=(e,t)=>(jw(e,t,1),e[t]);zt.readUint8=LZ;var UZ=(e,t,r)=>(e[t]=r,r>>>=8,e[t+1]=r,r>>>=8,e[t+2]=r,r>>>=8,e[t+3]=r,4);zt.setUint32LE=UZ;function VZ(e){let{fieldsAsRaw:t,useBigInt64:r,promoteValues:n,promoteBuffers:s,promoteLongs:i,serializeFunctions:o,ignoreUndefined:u,bsonRegExp:a,raw:c,enableUtf8Validation:l}=e;return{fieldsAsRaw:t,useBigInt64:r,promoteValues:n,promoteBuffers:s,promoteLongs:i,serializeFunctions:o,ignoreUndefined:u,bsonRegExp:a,raw:c,enableUtf8Validation:l}}function zZ(e,t){let r=t?.bsonOptions;return{raw:e?.raw??r?.raw??!1,useBigInt64:e?.useBigInt64??r?.useBigInt64??!1,promoteLongs:e?.promoteLongs??r?.promoteLongs??!0,promoteValues:e?.promoteValues??r?.promoteValues??!0,promoteBuffers:e?.promoteBuffers??r?.promoteBuffers??!1,ignoreUndefined:e?.ignoreUndefined??r?.ignoreUndefined??!1,bsonRegExp:e?.bsonRegExp??r?.bsonRegExp??!1,serializeFunctions:e?.serializeFunctions??r?.serializeFunctions??!1,fieldsAsRaw:e?.fieldsAsRaw??r?.fieldsAsRaw??{},enableUtf8Validation:e?.enableUtf8Validation??r?.enableUtf8Validation??!0}}function WZ(e){if(e?.enableUtf8Validation===!1)return{utf8:!1};return{utf8:{writeErrors:!1}}}});var Q=g(function(OC){Object.defineProperty(OC,"__esModule",{value:!0});OC.MongoWriteConcernError=OC.MongoServerSelectionError=OC.MongoSystemError=OC.MongoMissingDependencyError=OC.MongoMissingCredentialsError=OC.MongoCompatibilityError=OC.MongoInvalidArgumentError=OC.MongoParseError=OC.MongoNetworkTimeoutError=OC.MongoNetworkError=OC.MongoClientClosedError=OC.MongoTopologyClosedError=OC.MongoCursorExhaustedError=OC.MongoServerClosedError=OC.MongoCursorInUseError=OC.MongoOperationTimeoutError=OC.MongoUnexpectedServerResponseError=OC.MongoGridFSChunkError=OC.MongoGridFSStreamError=OC.MongoTailableCursorError=OC.MongoChangeStreamError=OC.MongoClientBulkWriteExecutionError=OC.MongoClientBulkWriteCursorError=OC.MongoClientBulkWriteError=OC.MongoGCPError=OC.MongoAzureError=OC.MongoOIDCError=OC.MongoAWSError=OC.MongoKerberosError=OC.MongoExpiredSessionError=OC.MongoTransactionError=OC.MongoNotConnectedError=OC.MongoDecompressionError=OC.MongoBatchReExecutionError=OC.MongoStalePrimaryError=OC.MongoRuntimeError=OC.MongoAPIError=OC.MongoDriverError=OC.MongoServerError=OC.MongoError=OC.MongoErrorLabel=OC.GET_MORE_RESUMABLE_CODES=OC.MONGODB_ERROR_CODES=OC.NODE_IS_RECOVERING_ERROR_MESSAGE=OC.LEGACY_NOT_PRIMARY_OR_SECONDARY_ERROR_MESSAGE=OC.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE=void 0;OC.isNamespaceNotFoundError=XZ;OC.needsRetryableWriteLabel=eee;OC.isRetryableWriteError=tee;OC.isRetryableReadError=ree;OC.isNodeShuttingDownError=uee;OC.isStateChangeError=aee;OC.isNetworkTimeoutError=cee;OC.isResumableError=lee;OC.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE=new RegExp("not master","i");OC.LEGACY_NOT_PRIMARY_OR_SECONDARY_ERROR_MESSAGE=new RegExp("not master or secondary","i");OC.NODE_IS_RECOVERING_ERROR_MESSAGE=new RegExp("node is recovering","i");OC.MONGODB_ERROR_CODES=Object.freeze({HostUnreachable:6,HostNotFound:7,AuthenticationFailed:18,NetworkTimeout:89,ShutdownInProgress:91,PrimarySteppedDown:189,ExceededTimeLimit:262,SocketException:9001,NotWritablePrimary:10107,InterruptedAtShutdown:11600,InterruptedDueToReplStateChange:11602,NotPrimaryNoSecondaryOk:13435,NotPrimaryOrSecondary:13436,StaleShardVersion:63,StaleEpoch:150,StaleConfig:13388,RetryChangeStream:234,FailedToSatisfyReadPreference:133,CursorNotFound:43,LegacyNotPrimary:10058,WriteConcernTimeout:64,NamespaceNotFound:26,IllegalOperation:20,MaxTimeMSExpired:50,UnknownReplWriteConcern:79,UnsatisfiableWriteConcern:100,Reauthenticate:391,ReadConcernMajorityNotAvailableYet:134});function XZ(e){return Number(e?.code)===OC.MONGODB_ERROR_CODES.NamespaceNotFound}OC.GET_MORE_RESUMABLE_CODES=new Set([OC.MONGODB_ERROR_CODES.HostUnreachable,OC.MONGODB_ERROR_CODES.HostNotFound,OC.MONGODB_ERROR_CODES.NetworkTimeout,OC.MONGODB_ERROR_CODES.ShutdownInProgress,OC.MONGODB_ERROR_CODES.PrimarySteppedDown,OC.MONGODB_ERROR_CODES.ExceededTimeLimit,OC.MONGODB_ERROR_CODES.SocketException,OC.MONGODB_ERROR_CODES.NotWritablePrimary,OC.MONGODB_ERROR_CODES.InterruptedAtShutdown,OC.MONGODB_ERROR_CODES.InterruptedDueToReplStateChange,OC.MONGODB_ERROR_CODES.NotPrimaryNoSecondaryOk,OC.MONGODB_ERROR_CODES.NotPrimaryOrSecondary,OC.MONGODB_ERROR_CODES.StaleShardVersion,OC.MONGODB_ERROR_CODES.StaleEpoch,OC.MONGODB_ERROR_CODES.StaleConfig,OC.MONGODB_ERROR_CODES.RetryChangeStream,OC.MONGODB_ERROR_CODES.FailedToSatisfyReadPreference,OC.MONGODB_ERROR_CODES.CursorNotFound]);OC.MongoErrorLabel=Object.freeze({RetryableWriteError:"RetryableWriteError",TransientTransactionError:"TransientTransactionError",UnknownTransactionCommitResult:"UnknownTransactionCommitResult",ResumableChangeStreamError:"ResumableChangeStreamError",HandshakeError:"HandshakeError",ResetPool:"ResetPool",PoolRequestedRetry:"PoolRequestedRetry",InterruptInUseConnections:"InterruptInUseConnections",NoWritesPerformed:"NoWritesPerformed",RetryableError:"RetryableError",SystemOverloadedError:"SystemOverloadedError"});function ZZ(e){return e!=null&&typeof e==="object"&&"errors"in e&&Array.isArray(e.errors)}class Ji extends Error{get errorLabels(){return Array.from(this.errorLabelSet)}constructor(e,t){super(e,t);this.errorLabelSet=new Set}static buildErrorMessage(e){if(typeof e==="string")return e;if(ZZ(e)&&e.message.length===0)return e.errors.length===0?"AggregateError has an empty errors array. Please check the `cause` property for more information.":e.errors.map(({message:t})=>t).join(", ");return e!=null&&typeof e==="object"&&"message"in e&&typeof e.message==="string"?e.message:"empty error message"}get name(){return"MongoError"}get errmsg(){return this.message}hasErrorLabel(e){return this.errorLabelSet.has(e)}addErrorLabel(e){this.errorLabelSet.add(e)}}OC.MongoError=Ji;class md extends Ji{constructor(e){super(e.message||e.errmsg||e.$err||"n/a");if(e.errorLabels)for(let t of e.errorLabels)this.addErrorLabel(t);this.errorResponse=e;for(let t in e)if(t!=="errorLabels"&&t!=="errmsg"&&t!=="message"&&t!=="errorResponse")this[t]=e[t]}get name(){return"MongoServerError"}}OC.MongoServerError=md;class Oc extends Ji{constructor(e,t){super(e,t)}get name(){return"MongoDriverError"}}OC.MongoDriverError=Oc;class Cn extends Oc{constructor(e,t){super(e,t)}get name(){return"MongoAPIError"}}OC.MongoAPIError=Cn;class Bs extends Oc{constructor(e,t){super(e,t)}get name(){return"MongoRuntimeError"}}OC.MongoRuntimeError=Bs;class Vw extends Bs{constructor(e,t){super(e,t)}get name(){return"MongoStalePrimaryError"}}OC.MongoStalePrimaryError=Vw;class zw extends Cn{constructor(e="This batch has already been executed, create new batch to execute"){super(e)}get name(){return"MongoBatchReExecutionError"}}OC.MongoBatchReExecutionError=zw;class Ww extends Bs{constructor(e){super(e)}get name(){return"MongoDecompressionError"}}OC.MongoDecompressionError=Ww;class Hw extends Cn{constructor(e){super(e)}get name(){return"MongoNotConnectedError"}}OC.MongoNotConnectedError=Hw;class Kw extends Cn{constructor(e){super(e)}get name(){return"MongoTransactionError"}}OC.MongoTransactionError=Kw;class Gw extends Cn{constructor(e="Cannot use a session that has ended"){super(e)}get name(){return"MongoExpiredSessionError"}}OC.MongoExpiredSessionError=Gw;class Yw extends Bs{constructor(e){super(e)}get name(){return"MongoKerberosError"}}OC.MongoKerberosError=Yw;class Jw extends Bs{constructor(e,t){super(e,t)}get name(){return"MongoAWSError"}}OC.MongoAWSError=Jw;class yd extends Bs{constructor(e){super(e)}get name(){return"MongoOIDCError"}}OC.MongoOIDCError=yd;class Qw extends yd{constructor(e){super(e)}get name(){return"MongoAzureError"}}OC.MongoAzureError=Qw;class Xw extends yd{constructor(e){super(e)}get name(){return"MongoGCPError"}}OC.MongoGCPError=Xw;class Zw extends md{constructor(e){super(e);this.writeConcernErrors=[],this.writeErrors=new Map}get name(){return"MongoClientBulkWriteError"}}OC.MongoClientBulkWriteError=Zw;class eC extends Bs{constructor(e){super(e)}get name(){return"MongoClientBulkWriteCursorError"}}OC.MongoClientBulkWriteCursorError=eC;class tC extends Bs{constructor(e){super(e)}get name(){return"MongoClientBulkWriteExecutionError"}}OC.MongoClientBulkWriteExecutionError=tC;class rC extends Bs{constructor(e){super(e)}get name(){return"MongoChangeStreamError"}}OC.MongoChangeStreamError=rC;class nC extends Cn{constructor(e="Tailable cursor does not support this operation"){super(e)}get name(){return"MongoTailableCursorError"}}OC.MongoTailableCursorError=nC;class sC extends Bs{constructor(e){super(e)}get name(){return"MongoGridFSStreamError"}}OC.MongoGridFSStreamError=sC;class iC extends Bs{constructor(e){super(e)}get name(){return"MongoGridFSChunkError"}}OC.MongoGridFSChunkError=iC;class oC extends Bs{constructor(e,t){super(e,t)}get name(){return"MongoUnexpectedServerResponseError"}}OC.MongoUnexpectedServerResponseError=oC;class uC extends Oc{get name(){return"MongoOperationTimeoutError"}}OC.MongoOperationTimeoutError=uC;class aC extends Cn{constructor(e="Cursor is already initialized"){super(e)}get name(){return"MongoCursorInUseError"}}OC.MongoCursorInUseError=aC;class cC extends Cn{constructor(e="Server is closed"){super(e)}get name(){return"MongoServerClosedError"}}OC.MongoServerClosedError=cC;class lC extends Cn{constructor(e){super(e||"Cursor is exhausted")}get name(){return"MongoCursorExhaustedError"}}OC.MongoCursorExhaustedError=lC;class hC extends Cn{constructor(e="Topology is closed"){super(e)}get name(){return"MongoTopologyClosedError"}}OC.MongoTopologyClosedError=hC;class fC extends Cn{constructor(){super("Operation interrupted because client was closed")}get name(){return"MongoClientClosedError"}}OC.MongoClientClosedError=fC;class Ba extends Ji{constructor(e,t){super(e,{cause:t?.cause});this.beforeHandshake=!!t?.beforeHandshake}get name(){return"MongoNetworkError"}}OC.MongoNetworkError=Ba;class dC extends Ba{constructor(e,t){super(e,t)}get name(){return"MongoNetworkTimeoutError"}}OC.MongoNetworkTimeoutError=dC;class pC extends Oc{constructor(e){super(e)}get name(){return"MongoParseError"}}OC.MongoParseError=pC;class mC extends Cn{constructor(e,t){super(e,t)}get name(){return"MongoInvalidArgumentError"}}OC.MongoInvalidArgumentError=mC;class yC extends Cn{constructor(e){super(e)}get name(){return"MongoCompatibilityError"}}OC.MongoCompatibilityError=yC;class gC extends Cn{constructor(e){super(e)}get name(){return"MongoMissingCredentialsError"}}OC.MongoMissingCredentialsError=gC;class _C extends Cn{constructor(e,t){super(e,t);this.dependencyName=t.dependencyName}get name(){return"MongoMissingDependencyError"}}OC.MongoMissingDependencyError=_C;class Ng extends Ji{constructor(e,t){if(t&&t.error)super(Ji.buildErrorMessage(t.error.message||t.error),{cause:t.error});else super(e);if(t)this.reason=t;this.code=t.error?.code}get name(){return"MongoSystemError"}}OC.MongoSystemError=Ng;class Ig extends Ng{constructor(e,t){super(e,t)}get name(){return"MongoServerSelectionError"}}OC.MongoServerSelectionError=Ig;class Rg extends md{constructor(e){super({...e.writeConcernError,...e});this.errInfo=e.writeConcernError.errInfo,this.result=e}get name(){return"MongoWriteConcernError"}}OC.MongoWriteConcernError=Rg;var EC=new Set([OC.MONGODB_ERROR_CODES.HostUnreachable,OC.MONGODB_ERROR_CODES.HostNotFound,OC.MONGODB_ERROR_CODES.NetworkTimeout,OC.MONGODB_ERROR_CODES.ShutdownInProgress,OC.MONGODB_ERROR_CODES.PrimarySteppedDown,OC.MONGODB_ERROR_CODES.SocketException,OC.MONGODB_ERROR_CODES.NotWritablePrimary,OC.MONGODB_ERROR_CODES.InterruptedAtShutdown,OC.MONGODB_ERROR_CODES.InterruptedDueToReplStateChange,OC.MONGODB_ERROR_CODES.NotPrimaryNoSecondaryOk,OC.MONGODB_ERROR_CODES.NotPrimaryOrSecondary,OC.MONGODB_ERROR_CODES.ExceededTimeLimit,OC.MONGODB_ERROR_CODES.ReadConcernMajorityNotAvailableYet]),Uw=EC;function eee(e){if(e instanceof Ba)return!0;if(e instanceof Ji){if(!e.hasErrorLabel(OC.MongoErrorLabel.HandshakeError))return!1}if(e instanceof Rg){let n=e.result.writeConcernError.code??Number(e.code);return Uw.has(Number.isNaN(n)?0:n)}if(e instanceof Ji)return Uw.has(Number(e.code));if(OC.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE.test(e.message))return!0;if(OC.NODE_IS_RECOVERING_ERROR_MESSAGE.test(e.message))return!0;return!1}function tee(e){return e.hasErrorLabel(OC.MongoErrorLabel.RetryableWriteError)||e.hasErrorLabel(OC.MongoErrorLabel.PoolRequestedRetry)}function ree(e){if(typeof e.code==="number"?EC.has(e.code):!1)return!0;if(e instanceof Ba)return!0;if(OC.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE.test(e.message))return!0;if(OC.NODE_IS_RECOVERING_ERROR_MESSAGE.test(e.message))return!0;return!1}var nee=new Set([OC.MONGODB_ERROR_CODES.ShutdownInProgress,OC.MONGODB_ERROR_CODES.PrimarySteppedDown,OC.MONGODB_ERROR_CODES.InterruptedAtShutdown,OC.MONGODB_ERROR_CODES.InterruptedDueToReplStateChange,OC.MONGODB_ERROR_CODES.NotPrimaryOrSecondary]),see=new Set([OC.MONGODB_ERROR_CODES.NotWritablePrimary,OC.MONGODB_ERROR_CODES.NotPrimaryNoSecondaryOk,OC.MONGODB_ERROR_CODES.LegacyNotPrimary]),iee=new Set([OC.MONGODB_ERROR_CODES.InterruptedAtShutdown,OC.MONGODB_ERROR_CODES.ShutdownInProgress]);function AC(e){if(typeof e.code==="number")return nee.has(e.code);return OC.LEGACY_NOT_PRIMARY_OR_SECONDARY_ERROR_MESSAGE.test(e.message)||OC.NODE_IS_RECOVERING_ERROR_MESSAGE.test(e.message)}function oee(e){if(typeof e.code==="number")return see.has(e.code);if(AC(e))return!1;return OC.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE.test(e.message)}function uee(e){return!!(typeof e.code==="number"&&iee.has(e.code))}function aee(e){return AC(e)||oee(e)}function cee(e){return!!(e instanceof Ba&&e.message.match(/timed out/))}function lee(e,t){if(e==null||!(e instanceof Ji))return!1;if(e instanceof Ba)return!0;if(e instanceof Ig)return!0;if(t!=null&&t>=9){if(e.code===OC.MONGODB_ERROR_CODES.CursorNotFound)return!0;return e.hasErrorLabel(OC.MongoErrorLabel.ResumableChangeStreamError)}if(typeof e.code==="number")return OC.GET_MORE_RESUMABLE_CODES.has(e.code);return!1}});var Or=g(function(bC){Object.defineProperty(bC,"__esModule",{value:!0});bC.END=bC.CHANGE=bC.INIT=bC.MORE=bC.RESPONSE=bC.SERVER_HEARTBEAT_FAILED=bC.SERVER_HEARTBEAT_SUCCEEDED=bC.SERVER_HEARTBEAT_STARTED=bC.COMMAND_FAILED=bC.COMMAND_SUCCEEDED=bC.COMMAND_STARTED=bC.CLUSTER_TIME_RECEIVED=bC.CONNECTION_CHECKED_IN=bC.CONNECTION_CHECKED_OUT=bC.CONNECTION_CHECK_OUT_FAILED=bC.CONNECTION_CHECK_OUT_STARTED=bC.CONNECTION_CLOSED=bC.CONNECTION_READY=bC.CONNECTION_CREATED=bC.CONNECTION_POOL_READY=bC.CONNECTION_POOL_CLEARED=bC.CONNECTION_POOL_CLOSED=bC.CONNECTION_POOL_CREATED=bC.WAITING_FOR_SUITABLE_SERVER=bC.SERVER_SELECTION_SUCCEEDED=bC.SERVER_SELECTION_FAILED=bC.SERVER_SELECTION_STARTED=bC.TOPOLOGY_DESCRIPTION_CHANGED=bC.TOPOLOGY_CLOSED=bC.TOPOLOGY_OPENING=bC.SERVER_DESCRIPTION_CHANGED=bC.SERVER_CLOSED=bC.SERVER_OPENING=bC.DESCRIPTION_RECEIVED=bC.UNPINNED=bC.PINNED=bC.MESSAGE=bC.ENDED=bC.CLOSED=bC.CONNECT=bC.OPEN=bC.CLOSE=bC.TIMEOUT=bC.ERROR=bC.SYSTEM_JS_COLLECTION=bC.SYSTEM_COMMAND_COLLECTION=bC.SYSTEM_USER_COLLECTION=bC.SYSTEM_PROFILE_COLLECTION=bC.SYSTEM_INDEX_COLLECTION=bC.SYSTEM_NAMESPACE_COLLECTION=void 0;bC.kDecoratedKeys=bC.kDecorateResult=bC.LEGACY_HELLO_COMMAND_CAMEL_CASE=bC.LEGACY_HELLO_COMMAND=bC.MONGO_CLIENT_EVENTS=bC.LOCAL_SERVER_EVENTS=bC.SERVER_RELAY_EVENTS=bC.APM_EVENTS=bC.TOPOLOGY_EVENTS=bC.CMAP_EVENTS=bC.HEARTBEAT_EVENTS=bC.RESUME_TOKEN_CHANGED=void 0;bC.SYSTEM_NAMESPACE_COLLECTION="system.namespaces";bC.SYSTEM_INDEX_COLLECTION="system.indexes";bC.SYSTEM_PROFILE_COLLECTION="system.profile";bC.SYSTEM_USER_COLLECTION="system.users";bC.SYSTEM_COMMAND_COLLECTION="$cmd";bC.SYSTEM_JS_COLLECTION="system.js";bC.ERROR="error";bC.TIMEOUT="timeout";bC.CLOSE="close";bC.OPEN="open";bC.CONNECT="connect";bC.CLOSED="closed";bC.ENDED="ended";bC.MESSAGE="message";bC.PINNED="pinned";bC.UNPINNED="unpinned";bC.DESCRIPTION_RECEIVED="descriptionReceived";bC.SERVER_OPENING="serverOpening";bC.SERVER_CLOSED="serverClosed";bC.SERVER_DESCRIPTION_CHANGED="serverDescriptionChanged";bC.TOPOLOGY_OPENING="topologyOpening";bC.TOPOLOGY_CLOSED="topologyClosed";bC.TOPOLOGY_DESCRIPTION_CHANGED="topologyDescriptionChanged";bC.SERVER_SELECTION_STARTED="serverSelectionStarted";bC.SERVER_SELECTION_FAILED="serverSelectionFailed";bC.SERVER_SELECTION_SUCCEEDED="serverSelectionSucceeded";bC.WAITING_FOR_SUITABLE_SERVER="waitingForSuitableServer";bC.CONNECTION_POOL_CREATED="connectionPoolCreated";bC.CONNECTION_POOL_CLOSED="connectionPoolClosed";bC.CONNECTION_POOL_CLEARED="connectionPoolCleared";bC.CONNECTION_POOL_READY="connectionPoolReady";bC.CONNECTION_CREATED="connectionCreated";bC.CONNECTION_READY="connectionReady";bC.CONNECTION_CLOSED="connectionClosed";bC.CONNECTION_CHECK_OUT_STARTED="connectionCheckOutStarted";bC.CONNECTION_CHECK_OUT_FAILED="connectionCheckOutFailed";bC.CONNECTION_CHECKED_OUT="connectionCheckedOut";bC.CONNECTION_CHECKED_IN="connectionCheckedIn";bC.CLUSTER_TIME_RECEIVED="clusterTimeReceived";bC.COMMAND_STARTED="commandStarted";bC.COMMAND_SUCCEEDED="commandSucceeded";bC.COMMAND_FAILED="commandFailed";bC.SERVER_HEARTBEAT_STARTED="serverHeartbeatStarted";bC.SERVER_HEARTBEAT_SUCCEEDED="serverHeartbeatSucceeded";bC.SERVER_HEARTBEAT_FAILED="serverHeartbeatFailed";bC.RESPONSE="response";bC.MORE="more";bC.INIT="init";bC.CHANGE="change";bC.END="end";bC.RESUME_TOKEN_CHANGED="resumeTokenChanged";bC.HEARTBEAT_EVENTS=Object.freeze([bC.SERVER_HEARTBEAT_STARTED,bC.SERVER_HEARTBEAT_SUCCEEDED,bC.SERVER_HEARTBEAT_FAILED]);bC.CMAP_EVENTS=Object.freeze([bC.CONNECTION_POOL_CREATED,bC.CONNECTION_POOL_READY,bC.CONNECTION_POOL_CLEARED,bC.CONNECTION_POOL_CLOSED,bC.CONNECTION_CREATED,bC.CONNECTION_READY,bC.CONNECTION_CLOSED,bC.CONNECTION_CHECK_OUT_STARTED,bC.CONNECTION_CHECK_OUT_FAILED,bC.CONNECTION_CHECKED_OUT,bC.CONNECTION_CHECKED_IN]);bC.TOPOLOGY_EVENTS=Object.freeze([bC.SERVER_OPENING,bC.SERVER_CLOSED,bC.SERVER_DESCRIPTION_CHANGED,bC.TOPOLOGY_OPENING,bC.TOPOLOGY_CLOSED,bC.TOPOLOGY_DESCRIPTION_CHANGED,bC.ERROR,bC.TIMEOUT,bC.CLOSE]);bC.APM_EVENTS=Object.freeze([bC.COMMAND_STARTED,bC.COMMAND_SUCCEEDED,bC.COMMAND_FAILED]);bC.SERVER_RELAY_EVENTS=Object.freeze([bC.SERVER_HEARTBEAT_STARTED,bC.SERVER_HEARTBEAT_SUCCEEDED,bC.SERVER_HEARTBEAT_FAILED,bC.COMMAND_STARTED,bC.COMMAND_SUCCEEDED,bC.COMMAND_FAILED,...bC.CMAP_EVENTS]);bC.LOCAL_SERVER_EVENTS=Object.freeze([bC.CONNECT,bC.DESCRIPTION_RECEIVED,bC.CLOSED,bC.ENDED]);bC.MONGO_CLIENT_EVENTS=Object.freeze([...bC.CMAP_EVENTS,...bC.APM_EVENTS,...bC.TOPOLOGY_EVENTS,...bC.HEARTBEAT_EVENTS]);bC.LEGACY_HELLO_COMMAND="ismaster";bC.LEGACY_HELLO_COMMAND_CAMEL_CASE="isMaster";bC.kDecorateResult=Symbol.for("@@mdb.decorateDecryptionResult");bC.kDecoratedKeys=Symbol.for("@@mdb.decryptedKeys")});var Xi=g(function(t9){Object.defineProperty(t9,"__esModule",{value:!0});t9.getKerberos=Pte;t9.getZstdLibrary=Fte;t9.getAwsCredentialProvider=Nte;t9.getGcpMetadata=Ite;t9.getSnappy=Rte;t9.getSocks=$te;t9.getMongoDBClientEncryption=vte;var Qi=G("zlib"),is=Q();function Ed(e){return new Proxy(e?{kModuleError:e}:{},{get:(r,n)=>{if(n==="kModuleError")return e;throw e},set:()=>{throw e}})}function Pte(){let e;try{e=(()=>{throw new Error("Cannot require module "+"kerberos");})()}catch(t){e=Ed(new is.MongoMissingDependencyError("Optional module `kerberos` not found. Please install it to enable kerberos authentication",{cause:t,dependencyName:"kerberos"}))}return e}function Bte(){if(typeof Qi.zstdCompress!=="function"||typeof Qi.zstdDecompress!=="function")return null;return{compress(e,t){let r=t==null?{}:{params:{[Qi.constants.ZSTD_c_compressionLevel]:t}};return new Promise((n,s)=>{Qi.zstdCompress(e,r,(i,o)=>{if(i)return s(i);n(o)})})},decompress(e){return new Promise((t,r)=>{Qi.zstdDecompress(e,(n,s)=>{if(n)return r(n);t(s)})})}}}function Fte(){let e=Bte();if(e!=null)return e;let t;try{t=(()=>{throw new Error("Cannot require module "+"@mongodb-js/zstd");})()}catch(r){t=Ed(new is.MongoMissingDependencyError("Built-in zstd is unavailable (requires Node.js 22.15.0 or later) and optional module `@mongodb-js/zstd` not found. Please upgrade Node.js or install `@mongodb-js/zstd` to enable zstd compression",{cause:r,dependencyName:"zstd"}))}return t}function Nte(){try{return (()=>{throw new Error("Cannot require module "+"@aws-sdk/credential-providers");})()}catch(e){return Ed(new is.MongoMissingDependencyError("Optional module `@aws-sdk/credential-providers` not found. Please install it to enable getting aws credentials via the official sdk.",{cause:e,dependencyName:"@aws-sdk/credential-providers"}))}}function Ite(){try{return (()=>{throw new Error("Cannot require module "+"gcp-metadata");})()}catch(e){return Ed(new is.MongoMissingDependencyError("Optional module `gcp-metadata` not found. Please install it to enable getting gcp credentials via the official sdk.",{cause:e,dependencyName:"gcp-metadata"}))}}function Rte(){try{return (()=>{throw new Error("Cannot require module "+"snappy");})()}catch(e){return{kModuleError:new is.MongoMissingDependencyError("Optional module `snappy` not found. Please install it to enable snappy compression",{cause:e,dependencyName:"snappy"})}}}function $te(){try{return (()=>{throw new Error("Cannot require module "+"socks");})()}catch(e){return{kModuleError:new is.MongoMissingDependencyError("Optional module `socks` not found. Please install it to connections over a SOCKS5 proxy",{cause:e,dependencyName:"socks"})}}}function vte(){let e=null;try{e=(()=>{throw new Error("Cannot require module "+"mongodb-client-encryption");})()}catch(t){return{kModuleError:new is.MongoMissingDependencyError("Optional module `mongodb-client-encryption` not found. Please install it to use auto encryption or ClientEncryption.",{cause:t,dependencyName:"mongodb-client-encryption"})}}return e}});var Uo=g(function(r9){Object.defineProperty(r9,"__esModule",{value:!0});r9.OP_MSG=r9.OP_COMPRESSED=r9.OP_DELETE=r9.OP_QUERY=r9.OP_INSERT=r9.OP_UPDATE=r9.OP_REPLY=r9.MIN_SUPPORTED_RAW_DATA_SERVER_VERSION=r9.MIN_SUPPORTED_RAW_DATA_WIRE_VERSION=r9.MIN_SUPPORTED_QE_SERVER_VERSION=r9.MIN_SUPPORTED_QE_WIRE_VERSION=r9.MAX_SUPPORTED_WIRE_VERSION=r9.MIN_SUPPORTED_WIRE_VERSION=r9.MIN_SUPPORTED_SNAPSHOT_READS_SERVER_VERSION=r9.MIN_SUPPORTED_SNAPSHOT_READS_WIRE_VERSION=r9.MAX_SUPPORTED_SERVER_VERSION=r9.MIN_SUPPORTED_SERVER_VERSION=void 0;r9.MIN_SUPPORTED_SERVER_VERSION="4.4";r9.MAX_SUPPORTED_SERVER_VERSION="9.0";r9.MIN_SUPPORTED_SNAPSHOT_READS_WIRE_VERSION=13;r9.MIN_SUPPORTED_SNAPSHOT_READS_SERVER_VERSION="5.0";r9.MIN_SUPPORTED_WIRE_VERSION=9;r9.MAX_SUPPORTED_WIRE_VERSION=29;r9.MIN_SUPPORTED_QE_WIRE_VERSION=21;r9.MIN_SUPPORTED_QE_SERVER_VERSION="7.0";r9.MIN_SUPPORTED_RAW_DATA_WIRE_VERSION=27;r9.MIN_SUPPORTED_RAW_DATA_SERVER_VERSION="8.2";r9.OP_REPLY=1;r9.OP_UPDATE=2001;r9.OP_INSERT=2002;r9.OP_QUERY=2004;r9.OP_DELETE=2006;r9.OP_COMPRESSED=2012;r9.OP_MSG=2013});var fh=g(function(u9){Object.defineProperty(u9,"__esModule",{value:!0});u9.uncompressibleCommands=u9.Compressor=void 0;u9.compress=lre;u9.decompress=i9;u9.compressCommand=hre;u9.decompressResponse=fre;var Od=G("zlib"),os=we(),Ad=Or(),Sd=Xi(),wc=Q(),Hs=mu(),Sc=Uo();u9.Compressor=Object.freeze({none:0,snappy:1,zlib:2,zstd:3});u9.uncompressibleCommands=new Set(["hello",Ad.LEGACY_HELLO_COMMAND,Ad.LEGACY_HELLO_COMMAND_CAMEL_CASE,"saslStart","saslContinue","getnonce","authenticate","createUser","updateUser","copydbSaslStart","copydbgetnonce","copydb"]);var ure=3,are=(e)=>new Promise((t,r)=>{Od.inflate(e,(n,s)=>{if(n)return r(n);t(s)})}),cre=(e,t)=>new Promise((r,n)=>{Od.deflate(e,t,(s,i)=>{if(s)return n(s);r(i)})}),pu,Fa=null;function s9(){if(Fa==null){let e=Sd.getSnappy();if("kModuleError"in e)throw e.kModuleError;Fa=e}return Fa}async function lre(e,t){let r={};switch(e.agreedCompressor){case"snappy":return Fa??=s9(),await Fa.compress(t);case"zstd":{if(o9(),"kModuleError"in pu)throw pu.kModuleError;return await pu.compress(t,ure)}case"zlib":{if(e.zlibCompressionLevel)r.level=e.zlibCompressionLevel;return await cre(t,r)}default:throw new wc.MongoInvalidArgumentError(`Unknown compressor ${e.agreedCompressor} failed to compress`)}}async function i9(e,t){if(e!==u9.Compressor.snappy&&e!==u9.Compressor.zstd&&e!==u9.Compressor.zlib&&e!==u9.Compressor.none)throw new wc.MongoDecompressionError(`Server sent message compressed using an unsupported compressor. (Received compressor ID ${e})`);switch(e){case u9.Compressor.snappy:return Fa??=s9(),await Fa.uncompress(t,{asBuffer:!0});case u9.Compressor.zstd:{if(o9(),"kModuleError"in pu)throw pu.kModuleError;return await pu.decompress(t)}case u9.Compressor.zlib:return await are(t);default:return t}}function o9(){if(!pu)pu=Sd.getZstdLibrary()}var hh=16;async function hre(e,t){let n=await(t.agreedCompressor==="none"||!Hs.OpCompressedRequest.canCompress(e)?e:new Hs.OpCompressedRequest(e,{agreedCompressor:t.agreedCompressor??"none",zlibCompressionLevel:t.zlibCompressionLevel??0})).toBin();return os.ByteUtils.concat(n)}async function fre(e){let t={length:os.readInt32LE(e,0),requestId:os.readInt32LE(e,4),responseTo:os.readInt32LE(e,8),opCode:os.readInt32LE(e,12)};if(t.opCode!==Sc.OP_COMPRESSED){let u=t.opCode===Sc.OP_MSG?Hs.OpMsgResponse:Hs.OpReply,a=e.subarray(hh);return new u(e,t,a)}let r={...t,fromCompressed:!0,opCode:os.readInt32LE(e,hh),length:os.readInt32LE(e,hh+4)},n=e[hh+8],s=e.slice(hh+9),i=r.opCode===Sc.OP_MSG?Hs.OpMsgResponse:Hs.OpReply,o=await i9(n,s);if(o.length!==r.length)throw new wc.MongoDecompressionError("Message body and message header must be the same length");return new i(e,r,o)}});var mu=g(function(g9){Object.defineProperty(g9,"__esModule",{value:!0});g9.OpCompressedRequest=g9.OpMsgResponse=g9.OpMsgRequest=g9.DocumentSequence=g9.OpReply=g9.OpQueryRequest=void 0;g9.makeDocumentSequence=Mre;var ne=we(),Zi=Q(),Cc=fh(),Ks=Uo(),bc=0,gre=2,_re=4,Ere=8,Are=16,Ore=32,Sre=64,wre=128,Cre=1,bre=2,Dre=4,Tre=8,l9=ne.ByteUtils.encodeUTF8Into;class zg{constructor(e,t,r){this.moreToCome=!1;let n=`${e}.$cmd`;if(typeof e!=="string")throw new Zi.MongoRuntimeError("Database name must be a string for a query");if(t==null)throw new Zi.MongoRuntimeError("A query document must be specified for query");if(n.indexOf("\x00")!==-1)throw new Zi.MongoRuntimeError("Namespace cannot contain a null character");this.databaseName=e,this.query=t,this.ns=n,this.numberToSkip=r.numberToSkip||0,this.numberToReturn=r.numberToReturn||0,this.returnFieldSelector=r.returnFieldSelector||void 0,this.requestId=r.requestId??zg.getRequestId(),this.pre32Limit=r.pre32Limit,this.serializeFunctions=typeof r.serializeFunctions==="boolean"?r.serializeFunctions:!1,this.ignoreUndefined=typeof r.ignoreUndefined==="boolean"?r.ignoreUndefined:!1,this.maxBsonSize=r.maxBsonSize||16777216,this.checkKeys=typeof r.checkKeys==="boolean"?r.checkKeys:!1,this.batchSize=this.numberToReturn,this.tailable=!1,this.secondaryOk=typeof r.secondaryOk==="boolean"?r.secondaryOk:!1,this.oplogReplay=!1,this.noCursorTimeout=!1,this.awaitData=!1,this.exhaust=!1,this.partial=!1}incRequestId(){this.requestId=bc++}nextRequestId(){return bc+1}static getRequestId(){return++bc}toBin(){let e=[],t=null,r=0;if(this.tailable)r|=gre;if(this.secondaryOk)r|=_re;if(this.oplogReplay)r|=Ere;if(this.noCursorTimeout)r|=Are;if(this.awaitData)r|=Ore;if(this.exhaust)r|=Sre;if(this.partial)r|=wre;if(this.batchSize!==this.numberToReturn)this.numberToReturn=this.batchSize;let n=ne.ByteUtils.allocate(20+ne.ByteUtils.utf8ByteLength(this.ns)+1+4+4);e.push(n);let s=ne.BSON.serialize(this.query,{checkKeys:this.checkKeys,serializeFunctions:this.serializeFunctions,ignoreUndefined:this.ignoreUndefined});if(e.push(s),this.returnFieldSelector&&Object.keys(this.returnFieldSelector).length>0)t=ne.BSON.serialize(this.returnFieldSelector,{checkKeys:this.checkKeys,serializeFunctions:this.serializeFunctions,ignoreUndefined:this.ignoreUndefined}),e.push(t);let i=n.length+s.length+(t?t.length:0),o=4;return n[3]=i>>24&255,n[2]=i>>16&255,n[1]=i>>8&255,n[0]=i&255,n[o+3]=this.requestId>>24&255,n[o+2]=this.requestId>>16&255,n[o+1]=this.requestId>>8&255,n[o]=this.requestId&255,o=o+4,n[o+3]=0,n[o+2]=0,n[o+1]=0,n[o]=0,o=o+4,n[o+3]=Ks.OP_QUERY>>24&255,n[o+2]=Ks.OP_QUERY>>16&255,n[o+1]=Ks.OP_QUERY>>8&255,n[o]=Ks.OP_QUERY&255,o=o+4,n[o+3]=r>>24&255,n[o+2]=r>>16&255,n[o+1]=r>>8&255,n[o]=r&255,o=o+4,o=o+l9(n,this.ns,o)+1,n[o-1]=0,n[o+3]=this.numberToSkip>>24&255,n[o+2]=this.numberToSkip>>16&255,n[o+1]=this.numberToSkip>>8&255,n[o]=this.numberToSkip&255,o=o+4,n[o+3]=this.numberToReturn>>24&255,n[o+2]=this.numberToReturn>>16&255,n[o+1]=this.numberToReturn>>8&255,n[o]=this.numberToReturn&255,o=o+4,e}}g9.OpQueryRequest=zg;class h9{constructor(e,t,r,n){this.index=0,this.sections=[],this.moreToCome=!1,this.parsed=!1,this.raw=e,this.data=r,this.opts=n??{useBigInt64:!1,promoteLongs:!0,promoteValues:!0,promoteBuffers:!1,bsonRegExp:!1},this.length=t.length,this.requestId=t.requestId,this.responseTo=t.responseTo,this.opCode=t.opCode,this.fromCompressed=t.fromCompressed,this.useBigInt64=typeof this.opts.useBigInt64==="boolean"?this.opts.useBigInt64:!1,this.promoteLongs=typeof this.opts.promoteLongs==="boolean"?this.opts.promoteLongs:!0,this.promoteValues=typeof this.opts.promoteValues==="boolean"?this.opts.promoteValues:!0,this.promoteBuffers=typeof this.opts.promoteBuffers==="boolean"?this.opts.promoteBuffers:!1,this.bsonRegExp=typeof this.opts.bsonRegExp==="boolean"?this.opts.bsonRegExp:!1}isParsed(){return this.parsed}parse(){if(this.parsed)return this.sections[0];if(this.index=20,this.responseFlags=ne.readInt32LE(this.data,0),this.cursorId=new ne.BSON.Long(ne.readInt32LE(this.data,4),ne.readInt32LE(this.data,8)),this.startingFrom=ne.readInt32LE(this.data,12),this.numberReturned=ne.readInt32LE(this.data,16),this.numberReturned<0||this.numberReturned>4294967295)throw RangeError(`OP_REPLY numberReturned is an invalid array length ${this.numberReturned}`);this.cursorNotFound=(this.responseFlags&Cre)!==0,this.queryFailure=(this.responseFlags&bre)!==0,this.shardConfigStale=(this.responseFlags&Dre)!==0,this.awaitCapable=(this.responseFlags&Tre)!==0;for(let e=0;e<this.numberReturned;e++){let t=this.data[this.index]|this.data[this.index+1]<<8|this.data[this.index+2]<<16|this.data[this.index+3]<<24,r=this.data.subarray(this.index,this.index+t);this.sections.push(r),this.index=this.index+t}return this.parsed=!0,this.sections[0]}}g9.OpReply=h9;var f9=1,d9=2,p9=65536;class wd{constructor(e,t){this.field=e,this.documents=[],this.chunks=[],this.serializedDocumentsLength=0;let r=ne.ByteUtils.allocateUnsafe(5+this.field.length+1);if(r[0]=1,l9(r,`${this.field}\x00`,5),this.chunks.push(r),this.header=r,t)for(let n of t)this.push(n,ne.BSON.serialize(n))}push(e,t){if(this.serializedDocumentsLength+=t.length,this.documents.push(e),this.chunks.push(t),this.header)ne.NumberUtils.setInt32LE(this.header,1,4+this.field.length+1+this.serializedDocumentsLength);return this.serializedDocumentsLength+this.header.length}toBin(){return ne.ByteUtils.concat(this.chunks)}}g9.DocumentSequence=wd;function Mre(e,t,r){let n=new wd(e);for(let s=0;s<t.length;s++)n.push(t[s],r[s]);return n}class Cd{constructor(e,t,r){if(t==null)throw new Zi.MongoInvalidArgumentError("Query document must be specified for query");this.databaseName=e,this.command=t,this.command.$db=e,this.options=r??{},this.requestId=r.requestId?r.requestId:Cd.getRequestId(),this.serializeFunctions=typeof r.serializeFunctions==="boolean"?r.serializeFunctions:!1,this.ignoreUndefined=typeof r.ignoreUndefined==="boolean"?r.ignoreUndefined:!1,this.checkKeys=typeof r.checkKeys==="boolean"?r.checkKeys:!1,this.maxBsonSize=r.maxBsonSize||16777216,this.checksumPresent=!1,this.moreToCome=r.moreToCome??t.writeConcern?.w===0,this.exhaustAllowed=typeof r.exhaustAllowed==="boolean"?r.exhaustAllowed:!1}toBin(){let e=[],t=0;if(this.checksumPresent)t|=f9;if(this.moreToCome)t|=d9;if(this.exhaustAllowed)t|=p9;let r=ne.ByteUtils.allocate(20);e.push(r);let n=r.length,s=this.command;return n+=this.makeSections(e,s),ne.NumberUtils.setInt32LE(r,0,n),ne.NumberUtils.setInt32LE(r,4,this.requestId),ne.NumberUtils.setInt32LE(r,8,0),ne.NumberUtils.setInt32LE(r,12,Ks.OP_MSG),ne.setUint32LE(r,16,t),e}makeSections(e,t){let r=this.extractDocumentSequences(t),n=ne.ByteUtils.allocateUnsafe(1);n[0]=0;let s=this.serializeBson(t);return e.push(n),e.push(s),e.push(r),n.length+s.length+r.length}extractDocumentSequences(e){let t=[];for(let[r,n]of Object.entries(e))if(n instanceof wd)t.push(n.toBin()),delete e[r];if(t.length>0)return ne.ByteUtils.concat(t);return ne.ByteUtils.allocate(0)}serializeBson(e){return ne.BSON.serialize(e,{checkKeys:this.checkKeys,serializeFunctions:this.serializeFunctions,ignoreUndefined:this.ignoreUndefined})}static getRequestId(){return bc=bc+1&2147483647,bc}}g9.OpMsgRequest=Cd;class m9{constructor(e,t,r,n){this.index=0,this.sections=[],this.parsed=!1,this.raw=e,this.data=r,this.opts=n??{useBigInt64:!1,promoteLongs:!0,promoteValues:!0,promoteBuffers:!1,bsonRegExp:!1},this.length=t.length,this.requestId=t.requestId,this.responseTo=t.responseTo,this.opCode=t.opCode,this.fromCompressed=t.fromCompressed,this.responseFlags=ne.readInt32LE(r,0),this.checksumPresent=(this.responseFlags&f9)!==0,this.moreToCome=(this.responseFlags&d9)!==0,this.exhaustAllowed=(this.responseFlags&p9)!==0,this.useBigInt64=typeof this.opts.useBigInt64==="boolean"?this.opts.useBigInt64:!1,this.promoteLongs=typeof this.opts.promoteLongs==="boolean"?this.opts.promoteLongs:!0,this.promoteValues=typeof this.opts.promoteValues==="boolean"?this.opts.promoteValues:!0,this.promoteBuffers=typeof this.opts.promoteBuffers==="boolean"?this.opts.promoteBuffers:!1,this.bsonRegExp=typeof this.opts.bsonRegExp==="boolean"?this.opts.bsonRegExp:!1}isParsed(){return this.parsed}parse(){if(this.parsed)return this.sections[0];this.index=4;while(this.index<this.data.length){let e=this.data[this.index++];if(e===0){let t=ne.readInt32LE(this.data,this.index),r=this.data.subarray(this.index,this.index+t);this.sections.push(r),this.index+=t}else if(e===1)throw new Zi.MongoRuntimeError("OP_MSG Payload Type 1 detected unsupported protocol")}return this.parsed=!0,this.sections[0]}}g9.OpMsgResponse=m9;var Vg=16,c9=9;class y9{constructor(e,t){this.command=e,this.options={zlibCompressionLevel:t.zlibCompressionLevel,agreedCompressor:t.agreedCompressor}}static canCompress(e){let t=e instanceof Cd?e.command:e.query,r=Object.keys(t)[0];return!Cc.uncompressibleCommands.has(r)}async toBin(){let e=ne.ByteUtils.concat(this.command.toBin()),t=e.slice(Vg),r=ne.readInt32LE(e,12),n=await Cc.compress(this.options,t),s=ne.ByteUtils.allocate(Vg);ne.NumberUtils.setInt32LE(s,0,Vg+c9+n.length),ne.NumberUtils.setInt32LE(s,4,this.command.requestId),ne.NumberUtils.setInt32LE(s,8,0),ne.NumberUtils.setInt32LE(s,12,Ks.OP_COMPRESSED);let i=ne.ByteUtils.allocate(c9);return ne.NumberUtils.setInt32LE(i,0,r),ne.NumberUtils.setInt32LE(i,4,t.length),i[8]=Cc.Compressor[this.options.agreedCompressor],[s,i,n]}}g9.OpCompressedRequest=y9});var vi=g(function(E9){Object.defineProperty(E9,"__esModule",{value:!0});E9.ReadConcern=E9.ReadConcernLevel=void 0;E9.ReadConcernLevel=Object.freeze({local:"local",majority:"majority",linearizable:"linearizable",available:"available",snapshot:"snapshot"});class Tc{constructor(e){this.level=E9.ReadConcernLevel[e]??e}static fromOptions(e){if(e==null)return;if(e.readConcern){let{readConcern:t}=e;if(t instanceof Tc)return t;else if(typeof t==="string")return new Tc(t);else if("level"in t&&t.level)return new Tc(t.level)}if(e.level)return new Tc(e.level);return}static get MAJORITY(){return E9.ReadConcernLevel.majority}static get AVAILABLE(){return E9.ReadConcernLevel.available}static get LINEARIZABLE(){return E9.ReadConcernLevel.linearizable}static get SNAPSHOT(){return E9.ReadConcernLevel.snapshot}toJSON(){return{level:this.level}}}E9.ReadConcern=Tc});var Ur=g(function(O9){Object.defineProperty(O9,"__esModule",{value:!0});O9.ReadPreference=O9.ReadPreferenceMode=void 0;var us=Q();O9.ReadPreferenceMode=Object.freeze({primary:"primary",primaryPreferred:"primaryPreferred",secondary:"secondary",secondaryPreferred:"secondaryPreferred",nearest:"nearest"});class $t{static{this.PRIMARY=O9.ReadPreferenceMode.primary}static{this.PRIMARY_PREFERRED=O9.ReadPreferenceMode.primaryPreferred}static{this.SECONDARY=O9.ReadPreferenceMode.secondary}static{this.SECONDARY_PREFERRED=O9.ReadPreferenceMode.secondaryPreferred}static{this.NEAREST=O9.ReadPreferenceMode.nearest}static{this.primary=new $t(O9.ReadPreferenceMode.primary)}static{this.primaryPreferred=new $t(O9.ReadPreferenceMode.primaryPreferred)}static{this.secondary=new $t(O9.ReadPreferenceMode.secondary)}static{this.secondaryPreferred=new $t(O9.ReadPreferenceMode.secondaryPreferred)}static{this.nearest=new $t(O9.ReadPreferenceMode.nearest)}constructor(e,t,r){if(!$t.isValid(e))throw new us.MongoInvalidArgumentError(`Invalid read preference mode ${JSON.stringify(e)}`);if(r==null&&typeof t==="object"&&!Array.isArray(t))r=t,t=void 0;else if(t&&!Array.isArray(t))throw new us.MongoInvalidArgumentError("ReadPreference tags must be an array");if(this.mode=e,this.tags=t,this.hedge=r?.hedge,this.maxStalenessSeconds=void 0,r=r??{},r.maxStalenessSeconds!=null){if(r.maxStalenessSeconds<=0)throw new us.MongoInvalidArgumentError("maxStalenessSeconds must be a positive integer");this.maxStalenessSeconds=r.maxStalenessSeconds}if(this.mode===$t.PRIMARY){if(this.tags&&Array.isArray(this.tags)&&this.tags.length>0)throw new us.MongoInvalidArgumentError("Primary read preference cannot be combined with tags");if(this.maxStalenessSeconds)throw new us.MongoInvalidArgumentError("Primary read preference cannot be combined with maxStalenessSeconds");if(this.hedge)throw new us.MongoInvalidArgumentError("Primary read preference cannot be combined with hedge")}}get preference(){return this.mode}static fromString(e){return new $t(e)}static fromOptions(e){if(!e)return;let t=e.readPreference??e.session?.transaction.options.readPreference,r=e.readPreferenceTags;if(t==null)return;if(typeof t==="string")return new $t(t,r,{maxStalenessSeconds:e.maxStalenessSeconds,hedge:e.hedge});else if(!(t instanceof $t)&&typeof t==="object"){let n=t.mode||t.preference;if(n&&typeof n==="string")return new $t(n,t.tags??r,{maxStalenessSeconds:t.maxStalenessSeconds,hedge:e.hedge})}if(r)t.tags=r;return t}static translate(e){if(e.readPreference==null)return e;let t=e.readPreference;if(typeof t==="string")e.readPreference=new $t(t);else if(t&&!(t instanceof $t)&&typeof t==="object"){let r=t.mode||t.preference;if(r&&typeof r==="string")e.readPreference=new $t(r,t.tags,{maxStalenessSeconds:t.maxStalenessSeconds})}else if(!(t instanceof $t))throw new us.MongoInvalidArgumentError(`Invalid read preference: ${t}`);return e}static isValid(e){return new Set([$t.PRIMARY,$t.PRIMARY_PREFERRED,$t.SECONDARY,$t.SECONDARY_PREFERRED,$t.NEAREST,null]).has(e)}isValid(e){return $t.isValid(typeof e==="string"?e:this.mode)}secondaryOk(){return new Set([$t.PRIMARY_PREFERRED,$t.SECONDARY,$t.SECONDARY_PREFERRED,$t.NEAREST]).has(this.mode)}equals(e){return e.mode===this.mode}toJSON(){let e={mode:this.mode};if(Array.isArray(this.tags))e.tags=this.tags;if(this.maxStalenessSeconds)e.maxStalenessSeconds=this.maxStalenessSeconds;if(this.hedge)e.hedge=this.hedge;return e}}O9.ReadPreference=$t});var as=g(function(w9){Object.defineProperty(w9,"__esModule",{value:!0});w9.ServerType=w9.TopologyType=w9.STATE_CONNECTED=w9.STATE_CONNECTING=w9.STATE_CLOSED=w9.STATE_CLOSING=void 0;w9._advanceClusterTime=Rre;w9.STATE_CLOSING="closing";w9.STATE_CLOSED="closed";w9.STATE_CONNECTING="connecting";w9.STATE_CONNECTED="connected";w9.TopologyType=Object.freeze({Single:"Single",ReplicaSetNoPrimary:"ReplicaSetNoPrimary",ReplicaSetWithPrimary:"ReplicaSetWithPrimary",Sharded:"Sharded",Unknown:"Unknown",LoadBalanced:"LoadBalanced"});w9.ServerType=Object.freeze({Standalone:"Standalone",Mongos:"Mongos",PossiblePrimary:"PossiblePrimary",RSPrimary:"RSPrimary",RSSecondary:"RSSecondary",RSArbiter:"RSArbiter",RSOther:"RSOther",RSGhost:"RSGhost",Unknown:"Unknown",LoadBalancer:"LoadBalancer"});function Rre(e,t){if(e.clusterTime==null)e.clusterTime=t;else if(t.clusterTime.greaterThan(e.clusterTime.clusterTime))e.clusterTime=t}});var Kn=g(function(D9){Object.defineProperty(D9,"__esModule",{value:!0});D9.WriteConcern=D9.WRITE_CONCERN_KEYS=void 0;D9.throwIfWriteConcernError=Ure;var bd=dt(),b9=Q();D9.WRITE_CONCERN_KEYS=["w","wtimeout","j","journal","fsync"];class dh{constructor(e,t,r,n){if(e!=null)if(!Number.isNaN(Number(e)))this.w=Number(e);else this.w=e;if(t!=null)this.wtimeoutMS=this.wtimeout=t;if(r!=null)this.journal=this.j=r;if(n!=null)this.journal=this.j=n?!0:!1}static apply(e,t){let r={};if(t.w!=null)r.w=t.w;if(t.wtimeoutMS!=null)r.wtimeout=t.wtimeoutMS;if(t.journal!=null)r.j=t.j;return e.writeConcern=r,e}static fromOptions(e,t){if(e==null)return;t=t??{};let r;if(typeof e==="string"||typeof e==="number")r={w:e};else if(e instanceof dh)r=e;else r=e.writeConcern;let s={...t instanceof dh?t:t.writeConcern,...r},{w:i=void 0,wtimeout:o=void 0,j:u=void 0,fsync:a=void 0,journal:c=void 0,wtimeoutMS:l=void 0}=s;if(i!=null||o!=null||l!=null||u!=null||c!=null||a!=null)return new dh(i,o??l,u??c,a);return}}D9.WriteConcern=dh;function Ure(e){if(typeof e==="object"&&e!=null){let t=bd.MongoDBResponse.is(e)&&e.has("writeConcernError")?e.toObject():!bd.MongoDBResponse.is(e)&&("writeConcernError"in e)?e:null;if(t!=null)throw new b9.MongoWriteConcernError(t)}}});var ae=g(function(K9){Object.defineProperty(K9,"__esModule",{value:!0});K9.kDispose=K9.randomBytes=K9.COSMOS_DB_MSG=K9.DOCUMENT_DB_MSG=K9.COSMOS_DB_CHECK=K9.DOCUMENT_DB_CHECK=K9.MONGODB_WARNING_CODE=K9.DEFAULT_PK_FACTORY=K9.HostAddress=K9.BufferPool=K9.List=K9.MongoDBCollectionNamespace=K9.MongoDBNamespace=void 0;K9.isUint8Array=Wre;K9.hostMatchesWildcards=Hre;K9.normalizeHintField=Kre;K9.isObject=Wg;K9.mergeOptions=Yre;K9.filterOptions=Jre;K9.isPromiseLike=Qre;K9.decorateWithCollation=Xre;K9.decorateWithReadConcern=Zre;K9.getTopology=ene;K9.ns=tne;K9.makeCounter=rne;K9.uuidV4=nne;K9.maxWireVersion=sne;K9.arrayStrictEqual=ine;K9.errorStrictEqual=one;K9.makeStateMachine=une;K9.processTimeMS=v9;K9.calculateDurationInMs=ane;K9.hasAtomicOperators=k9;K9.resolveTimeoutOptions=cne;K9.resolveOptions=lne;K9.isSuperset=q9;K9.isHello=hne;K9.setDifference=fne;K9.isRecord=pne;K9.emitWarning=L9;K9.emitWarningOnce=mne;K9.enumToString=yne;K9.supportsRetryableWrites=gne;K9.shuffle=_ne;K9.commandSupportsReadConcern=Ene;K9.commandSupportsAfterClusterTime=Ane;K9.compareObjectId=One;K9.parseInteger=U9;K9.parseUnsignedInteger=Sne;K9.checkParentDomainMatch=V9;K9.dnsNameToASCII=z9;K9.normalizeDnsName=W9;K9.verifySrvHost=Cne;K9.get=bne;K9.isHostMatch=Dne;K9.promiseWithResolvers=Gg;K9.squashError=Tne;K9.once=xne;K9.maybeAddIdToDocuments=Pne;K9.fileIsAccessible=Bne;K9.csotMin=Fne;K9.noop=Nne;K9.decorateDecryptionResult=H9;K9.addAbortListener=Yg;K9.abortable=Ine;var x9=G("fs"),P9=G("http"),B9=G("process"),Mc=G("timers"),F9=G("url"),Pr=we(),Dd=Uo(),yu=Or(),St=Q(),N9=vi(),I9=Ur(),R9=as(),$9=Kn();function Wre(e){return e!=null&&typeof e==="object"&&Symbol.toStringTag in e&&e[Symbol.toStringTag]==="Uint8Array"}function Hre(e,t){for(let r of t){if(e===r)return!0;if(r.startsWith("*.")){let n=r.substring(2);if(e===n||e.endsWith(`.${n}`))return!0}if(r.startsWith("*/")){let n=r.substring(2);if(e===n||e.endsWith(`/${n}`))return!0}}return!1}function Kre(e){let t=void 0;if(typeof e==="string")t=e;else if(Array.isArray(e))t={},e.forEach((r)=>{t[r]=1});else if(e!=null&&typeof e==="object"){t={};for(let r in e)t[r]=e[r]}return t}var Gre=(e)=>Object.prototype.toString.call(e);function Wg(e){return Gre(e)==="[object Object]"}function Yre(e,t){return{...e,...t}}function Jre(e,t){let r={};for(let n in e)if(t.includes(n))r[n]=e[n];return r}function Qre(e){return e!=null&&typeof e==="object"&&"then"in e&&typeof e.then==="function"}function Xre(e,t){if(t.collation&&typeof t.collation==="object")e.collation=t.collation}function Zre(e,t,r){if(r&&r.session&&r.session.inTransaction())return;let n=Object.assign({},e.readConcern||{});if(t.s.readConcern)Object.assign(n,t.s.readConcern);if(Object.keys(n).length>0)Object.assign(e,{readConcern:n})}function ene(e){if("topology"in e&&e.topology)return e.topology;else if("client"in e&&e.client.topology)return e.client.topology;throw new St.MongoNotConnectedError("MongoClient must be connected to perform this operation")}function tne(e){return mh.fromString(e)}class mh{constructor(e,t){this.db=e,this.collection=t===""?void 0:t}toString(){return this.collection?`${this.db}.${this.collection}`:this.db}withCollection(e){return new Hg(this.db,e)}static fromString(e){if(typeof e!=="string"||e==="")throw new St.MongoRuntimeError(`Cannot parse namespace from "${e}"`);let[t,...r]=e.split("."),n=r.join(".");return new mh(t,n===""?void 0:n)}}K9.MongoDBNamespace=mh;class Hg extends mh{constructor(e,t){super(e,t);this.collection=t}static fromString(e){return super.fromString(e)}}K9.MongoDBCollectionNamespace=Hg;function*rne(e=0){let t=e;while(!0){let r=t;t+=1,yield r}}function nne(){let e=crypto.getRandomValues(new Uint8Array(16));return e[6]=e[6]&15|64,e[8]=e[8]&63|128,e}function sne(e){if(e){if(e.hello)return e.hello.maxWireVersion;if(e.serverApi?.version)return Dd.MAX_SUPPORTED_WIRE_VERSION;if(e.loadBalanced)return Dd.MAX_SUPPORTED_WIRE_VERSION;if("lastHello"in e&&typeof e.lastHello==="function"){let t=e.lastHello();if(t)return t.maxWireVersion}if(e.description&&"maxWireVersion"in e.description&&e.description.maxWireVersion!=null)return e.description.maxWireVersion}return 0}function ine(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;return e.length===t.length&&e.every((r,n)=>r===t[n])}function one(e,t){if(e===t)return!0;if(!e||!t)return e===t;if(e==null&&t!=null||e!=null&&t==null)return!1;if(e.constructor.name!==t.constructor.name)return!1;if(e.message!==t.message)return!1;return!0}function une(e){return function(r,n){let s=e[r.s.state];if(s&&s.indexOf(n)<0)throw new St.MongoRuntimeError(`illegal state transition from [${r.s.state}] => [${n}], allowed: [${s}]`);r.emit("stateChanged",r.s.state,n),r.s.state=n}}function v9(){return Math.floor(performance.now())}function ane(e){if(typeof e!=="number")return-1;let t=v9()-e;return t<0?0:t}function k9(e,t){if(Array.isArray(e)){for(let n of e)if(k9(n))return!0;return!1}let r=Object.keys(e);if(t?.ignoreUndefined){let n=!0;for(let s of r)if(e[s]!==void 0){n=!1;break}if(n)throw new St.MongoInvalidArgumentError("Update operations require that all atomic operators have defined values, but none were provided.")}return r.length>0&&r[0][0]==="$"}function cne(e,t){let{socketTimeoutMS:r,serverSelectionTimeoutMS:n,waitQueueTimeoutMS:s}=e.s.options;return{socketTimeoutMS:r,serverSelectionTimeoutMS:n,waitQueueTimeoutMS:s,...t,timeoutMS:void 0}}function lne(e,t){let r=Object.assign({},t,Pr.resolveBSONOptions(t,e));if(!t?.session?.inTransaction()){let i=N9.ReadConcern.fromOptions(t)??e?.readConcern;if(i)r.readConcern=i;let o=$9.WriteConcern.fromOptions(t)??e?.writeConcern;if(o)r.writeConcern=o}r.timeoutMS=void 0;let s=I9.ReadPreference.fromOptions(t)??e?.readPreference;if(s)r.readPreference=s;return r}function q9(e,t){e=Array.isArray(e)?new Set(e):e,t=Array.isArray(t)?new Set(t):t;for(let r of t)if(!e.has(r))return!1;return!0}function hne(e){return e[yu.LEGACY_HELLO_COMMAND]||e.hello?!0:!1}function fne(e,t){let r=new Set(e);for(let n of t)r.delete(n);return r}var dne=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);function pne(e,t=void 0){if(!Wg(e))return!1;let r=e.constructor;if(r&&r.prototype){if(!Wg(r.prototype))return!1;if(!dne(r.prototype,"isPrototypeOf"))return!1}if(t){let n=Object.keys(e);return q9(n,t)}return!0}class Kg{get length(){return this.count}get[Symbol.toStringTag](){return"List"}constructor(){this.count=0,this.head={next:null,prev:null,value:null},this.head.next=this.head,this.head.prev=this.head}toArray(){return Array.from(this)}toString(){return`head <=> ${this.toArray().join(" <=> ")} <=> head`}*[Symbol.iterator](){for(let e of this.nodes())yield e.value}*nodes(){let e=this.head.next;while(e!==this.head){let{next:t}=e;yield e,e=t}}push(e){this.count+=1;let t={next:this.head,prev:this.head.prev,value:e};this.head.prev.next=t,this.head.prev=t}pushMany(e){for(let t of e)this.push(t)}unshift(e){this.count+=1;let t={next:this.head.next,prev:this.head,value:e};this.head.next.prev=t,this.head.next=t}remove(e){if(e===this.head||this.length===0)return null;this.count-=1;let{prev:t,next:r}=e;return t.next=r,r.prev=t,e.value}shift(){return this.remove(this.head.next)}pop(){return this.remove(this.head.prev)}prune(e){for(let t of this.nodes())if(e(t.value))this.remove(t)}clear(){this.count=0,this.head.next=this.head,this.head.prev=this.head}first(){return this.head.next.value}last(){return this.head.prev.value}}K9.List=Kg;class j9{constructor(){this.buffers=new Kg,this.totalByteLength=0}get length(){return this.totalByteLength}append(e){this.buffers.push(e),this.totalByteLength+=e.length}getInt32(){if(this.totalByteLength<4)return null;let e=this.buffers.first();if(e!=null&&e.byteLength>=4)return Pr.NumberUtils.getInt32LE(e,0);let t=this.read(4),r=Pr.NumberUtils.getInt32LE(t,0);return this.totalByteLength+=4,this.buffers.unshift(t),r}read(e){if(typeof e!=="number"||e<0)throw new St.MongoInvalidArgumentError('Argument "size" must be a non-negative number');if(e>this.totalByteLength)return Pr.ByteUtils.allocate(0);let t=Pr.ByteUtils.allocateUnsafe(e);for(let r=0;r<e;){let n=this.buffers.shift();if(n==null)break;let s=e-r,i=Math.min(s,n.byteLength),o=n.subarray(0,i);if(t.set(o,r),r+=i,this.totalByteLength-=i,i<n.byteLength)this.buffers.unshift(n.subarray(i))}return t}}K9.BufferPool=j9;class ph{constructor(e){this.host=void 0,this.port=void 0,this.socketPath=void 0,this.isIPv6=!1;let t=e.split(" ").join("%20");if(t.endsWith(".sock")){this.socketPath=decodeURIComponent(t);return}let r=`iLoveJS://${t}`,n;try{n=new URL(r)}catch(u){delete u.input;let a=new St.MongoRuntimeError("Unable to parse host with URL");throw a.cause=u,a}let s=n.hostname,i=n.port,o=decodeURIComponent(s).toLowerCase();if(o.startsWith("[")&&o.endsWith("]"))this.isIPv6=!0,o=o.substring(1,s.length-1);if(this.host=o.toLowerCase(),typeof i==="number")this.port=i;else if(typeof i==="string"&&i!=="")this.port=Number.parseInt(i,10);else this.port=27017;if(this.port===0)throw new St.MongoParseError("Invalid port (zero) with hostname");Object.freeze(this)}[Symbol.for("nodejs.util.inspect.custom")](){return this.inspect()}inspect(){return`new HostAddress('${this.toString()}')`}toString(){if(typeof this.host==="string"){if(this.isIPv6)return`[${this.host}]:${this.port}`;return`${this.host}:${this.port}`}return`${this.socketPath}`}static fromString(e){return new ph(e)}static fromHostPort(e,t){if(e.includes(":"))e=`[${e}]`;return ph.fromString(`${e}:${t}`)}static fromSrvRecord({name:e,port:t}){return ph.fromHostPort(e,t)}toHostPort(){if(this.socketPath)return{host:this.socketPath,port:0};let e=this.host??"",t=this.port??0;return{host:e,port:t}}}K9.HostAddress=ph;K9.DEFAULT_PK_FACTORY={createPk(){return new Pr.ObjectId}};K9.MONGODB_WARNING_CODE="MONGODB DRIVER";function L9(e){return B9.emitWarning(e,{code:K9.MONGODB_WARNING_CODE})}var M9=new Set;function mne(e){if(!M9.has(e))return M9.add(e),L9(e)}function yne(e){return Object.values(e).join(", ")}function gne(e){if(!e)return!1;if(e.loadBalanced)return!0;if(e.description.logicalSessionTimeoutMinutes!=null){if(e.description.type!==R9.ServerType.Standalone)return!0}return!1}function _ne(e,t=0){let r=Array.from(e);if(t>r.length)throw new St.MongoRuntimeError("Limit must be less than the number of items");let n=r.length,s=t%r.length===0?1:r.length-t;while(n>s){let i=Math.floor(Math.random()*n);n-=1;let o=r[n];r[n]=r[i],r[i]=o}return t%r.length===0?r:r.slice(s)}function Ene(e){if(e.aggregate||e.count||e.distinct||e.find||e.geoNear)return!0;return!1}function Ane(e){if(e.aggregate||e.count||e.distinct||e.find||e.geoNear)return!0;if(e.bulkWrite||e.create||e.createIndexes||e.delete||e.drop||e.dropDatabase||e.dropIndexes||e.findAndModify||e.insert||e.update)return!0;return!1}function One(e,t){if(e==null&&t==null)return 0;if(e==null)return-1;if(t==null)return 1;return Pr.ByteUtils.compare(e.id,t.id)}function U9(e){if(typeof e==="number")return Math.trunc(e);let t=Number.parseInt(String(e),10);return Number.isNaN(t)?null:t}function Sne(e){let t=U9(e);return t!=null&&t>=0?t:null}function V9(e,t){let r=W9(t),n=/^.*?\./,s=r.split(".").length<3,i=`.${e.replace(n,"")}`,o=s?r:`.${r.replace(n,"")}`;if(!o.startsWith("."))o="."+o;if(s&&e.split(".").length<=r.split(".").length)throw new St.MongoAPIError("Server record does not have at least one more domain level than parent URI");if(!i.endsWith(o))throw new St.MongoAPIError("Server record does not share hostname with parent URI")}var wne=/[\u0000-\u0020\u007F#%/:<>?@[\\\]^|]/;function z9(e){if(wne.test(e))return null;let t=/^\p{ASCII}*$/u.test(e)?e.toLowerCase():F9.domainToASCII(e);return t===""?null:t}function W9(e){let t=e.endsWith(".")?e.slice(0,-1):e,r=z9(t);if(r==null)throw new St.MongoAPIError("Invalid DNS host name");return r}function Cne(e,t,r){let{srvAllowedHostsSuffix:n,srvHostValidator:s}=r;if(s!=null){if(!s(e))throw new St.MongoAPIError("Server record was rejected by srvHostValidator");return}if(n!=null){if(!e.endsWith(n))throw new St.MongoAPIError("Server record does not end with srvAllowedHostsSuffix");return}V9(e,t)}function bne(e,t={}){return new Promise((r,n)=>{let s,i=P9.get(e,t,(o)=>{o.setEncoding("utf8");let u="";o.on("data",(a)=>u+=a),o.on("end",()=>{Mc.clearTimeout(s),r({status:o.statusCode,body:u})})}).on("error",(o)=>{Mc.clearTimeout(s),n(o)}).end();s=Mc.setTimeout(()=>{i.destroy(new St.MongoNetworkTimeoutError("request timed out after 10 seconds"))},1e4)})}K9.DOCUMENT_DB_CHECK=/(\.docdb\.amazonaws\.com$)|(\.docdb-elastic\.amazonaws\.com$)/;K9.COSMOS_DB_CHECK=/\.cosmos\.azure\.com$/;K9.DOCUMENT_DB_MSG="You appear to be connected to a DocumentDB cluster. For more information regarding feature compatibility and support please visit https://www.mongodb.com/supportability/documentdb";K9.COSMOS_DB_MSG="You appear to be connected to a CosmosDB cluster. For more information regarding feature compatibility and support please visit https://www.mongodb.com/supportability/cosmosdb";function Dne(e,t){return t&&e.test(t.toLowerCase())?!0:!1}function Gg(){let e,t;return{promise:new Promise(function(s,i){e=s,t=i}),resolve:e,reject:t}}function Tne(e){return}var Mne=(e)=>Promise.resolve(crypto.getRandomValues(new Uint8Array(e)));K9.randomBytes=Mne;async function xne(e,t,r){r?.signal?.throwIfAborted();let{promise:n,resolve:s,reject:i}=Gg(),o=(c)=>s(c),u=(c)=>i(c),a=Yg(r?.signal,function(){i(this.reason)});e.once(t,o).once("error",u);try{return await n}finally{e.off(t,o),e.off("error",u),a?.[K9.kDispose]()}}function Pne(e,t,r){if(r.forceServerObjectId??e.db.options?.forceServerObjectId??!1)return t;if(t._id==null)t._id=e.s.pkFactory.createPk();return t}async function Bne(e,t){try{return await x9.promises.access(e,t),!0}catch{return!1}}function Fne(e,t){if(e===0)return t;if(t===0)return e;return Math.min(e,t)}function Nne(){return}function H9(e,t,r=!0){if(r){if(Pr.ByteUtils.isUint8Array(t))t=Pr.deserialize(t);if(Pr.ByteUtils.isUint8Array(e))throw new St.MongoRuntimeError("Expected result of decryption to be deserialized BSON object")}if(!e||typeof e!=="object")return;for(let n of Object.keys(e)){let s=t[n];if(s&&s._bsontype==="Binary"&&s.sub_type===6){if(!e[yu.kDecoratedKeys])Object.defineProperty(e,yu.kDecoratedKeys,{value:[],configurable:!0,enumerable:!1,writable:!1});e[yu.kDecoratedKeys].push(n);continue}H9(e[n],s,!1)}}K9.kDispose=Symbol.dispose??Symbol("dispose");function Yg(e,t){if(e==null)return;return e.addEventListener("abort",t,{once:!0}),{[K9.kDispose]:()=>e.removeEventListener("abort",t)}}async function Ine(e,{signal:t}){if(t==null)return await e;let{promise:r,reject:n}=Gg(),s=t.aborted?n(t.reason):Yg(t,function(){n(this.reason)});try{return await Promise.race([e,r])}finally{s?.[K9.kDispose]()}}});var Q9=g(function(Y9){Object.defineProperty(Y9,"__esModule",{value:!0});Y9.OnDemandDocument=void 0;var ee=we(),gh={type:0,nameOffset:1,nameLength:2,offset:3,length:4};class Td{constructor(e,t=0,r=!1,n){this.cache=Object.create(null),this.indexFound=Object.create(null),this.bson=e,this.offset=t,this.isArray=r,this.elements=n??ee.parseToElementsToArray(this.bson,t)}isElementName(e,t){let r=t[gh.nameLength],n=t[gh.nameOffset];if(e.length!==r)return!1;let s=n+r;for(let i=n,o=0;o<e.length&&i<s;o++,i++)if(this.bson[i]!==e.charCodeAt(o))return!1;return!0}getElement(e){let t=this.cache[e];if(t===!1)return null;if(t!=null)return t;if(typeof e==="number")if(this.isArray)if(e<this.elements.length){let n={element:this.elements[e],value:void 0};return this.cache[e]=n,this.indexFound[e]=!0,n}else return null;else return null;for(let r=0;r<this.elements.length;r++){let n=this.elements[r];if(!(r in this.indexFound)&&this.isElementName(e,n)){let s={element:n,value:void 0};return this.cache[e]=s,this.indexFound[r]=!0,s}}return this.cache[e]=!1,null}toJSValue(e,t){let r=e[gh.type],n=e[gh.offset],s=e[gh.length];if(t!==r)return null;switch(t){case ee.BSONType.null:case ee.BSONType.undefined:return null;case ee.BSONType.double:return ee.NumberUtils.getFloat64LE(this.bson,n);case ee.BSONType.int:return ee.NumberUtils.getInt32LE(this.bson,n);case ee.BSONType.long:return ee.NumberUtils.getBigInt64LE(this.bson,n);case ee.BSONType.bool:return Boolean(this.bson[n]);case ee.BSONType.objectId:return new ee.ObjectId(this.bson.subarray(n,n+12));case ee.BSONType.timestamp:return new ee.Timestamp(ee.NumberUtils.getBigInt64LE(this.bson,n));case ee.BSONType.string:return ee.ByteUtils.toUTF8(this.bson,n+4,n+s-1,!1);case ee.BSONType.binData:{let i=ee.NumberUtils.getInt32LE(this.bson,n),o=this.bson[n+4];if(o===2){let u=ee.NumberUtils.getInt32LE(this.bson,n+1+4);if(u<0)throw new ee.BSONError("Negative binary type element size found for subtype 0x02");if(u>i-4)throw new ee.BSONError("Binary type with subtype 0x02 contains too long binary size");if(u<i-4)throw new ee.BSONError("Binary type with subtype 0x02 contains too short binary size");return new ee.Binary(this.bson.subarray(n+1+4+4,n+1+4+4+u),2)}return new ee.Binary(this.bson.subarray(n+1+4,n+1+4+i),o)}case ee.BSONType.date:return new Date(Number(ee.NumberUtils.getBigInt64LE(this.bson,n)));case ee.BSONType.object:return new Td(this.bson,n);case ee.BSONType.array:return new Td(this.bson,n,!0);default:throw new ee.BSONError(`Unsupported BSON type: ${t}`)}}size(){return this.elements.length}has(e){let t=this.cache[e];if(t===!1)return!1;if(t!=null)return!0;return this.getElement(e)!=null}get(e,t,r){let n=this.getElement(e);if(n==null)if(r===!0)throw new ee.BSONError(`BSON element "${e}" is missing`);else return null;if(n.value==null){let s=this.toJSValue(n.element,t);if(s==null)if(r===!0)throw new ee.BSONError(`BSON element "${e}" is missing`);else return null;n.value=s}return n.value}getNumber(e,t){let r=this.get(e,ee.BSONType.bool),n=r==null?null:r?1:0,s=this.get(e,ee.BSONType.long),i=s==null?null:Number(s),o=n??i??this.get(e,ee.BSONType.int)??this.get(e,ee.BSONType.double);if(t===!0&&o==null)throw new ee.BSONError(`BSON element "${e}" is missing`);return o}toObject(e){return ee.deserialize(this.bson,{...e,index:this.offset,allowObjectSmallerThanBufferSize:!0})}toBytes(){let e=ee.NumberUtils.getInt32LE(this.bson,this.offset);return this.bson.subarray(this.offset,this.offset+e)}}Y9.OnDemandDocument=Td});var dt=g(function(rb){Object.defineProperty(rb,"__esModule",{value:!0});rb.ClientBulkWriteCursorResponse=rb.ExplainedCursorResponse=rb.CursorResponse=rb.MongoDBResponse=void 0;rb.isErrorResponse=Z9;var se=we(),cs=Q(),xd=ae(),X9=Q9(),Md={type:0,nameOffset:1,nameLength:2,offset:3,length:4};function Z9(e,t){for(let r=0;r<t.length;r++){let n=t[r];if(n[Md.nameLength]===2){let s=n[Md.nameOffset];if(e[s]===111&&e[s+1]===107){let i=n[Md.offset],o=n[Md.length];for(let u=i;u<i+o;u++)if(e[u]!==0)return!1;return!0}}}return!0}class xc extends X9.OnDemandDocument{get(e,t,r){try{return super.get(e,t,r)}catch(n){throw new cs.MongoUnexpectedServerResponseError(n.message,{cause:n})}}static is(e){return e instanceof xc}static make(e){let t=se.parseToElementsToArray(e,0);return Z9(e,t)?new xc(e,0,!1,t):new this(e,0,!1,t)}static{this.empty=new xc(new Uint8Array([13,0,0,0,16,111,107,0,1,0,0,0,0]))}get isMaxTimeExpiredError(){if(this.ok===0&&this.code===cs.MONGODB_ERROR_CODES.MaxTimeMSExpired)return!0;if(this.ok===0)return!1;if(this.get("writeConcernError",se.BSONType.object)?.getNumber("code")===cs.MONGODB_ERROR_CODES.MaxTimeMSExpired)return!0;let r=this.get("writeErrors",se.BSONType.array);if(r?.size()){for(let n=0;n<r.size();n++)if(r.get(n,se.BSONType.object)?.getNumber("code")===cs.MONGODB_ERROR_CODES.MaxTimeMSExpired)return!0}return!1}get recoveryToken(){return this.get("recoveryToken",se.BSONType.object)?.toObject({promoteValues:!1,promoteLongs:!1,promoteBuffers:!1,validation:{utf8:!0}})??null}get atClusterTime(){return this.get("cursor",se.BSONType.object)?.get("atClusterTime",se.BSONType.timestamp)??this.get("atClusterTime",se.BSONType.timestamp)}get operationTime(){return this.get("operationTime",se.BSONType.timestamp)}get ok(){return this.getNumber("ok")?1:0}get $err(){return this.get("$err",se.BSONType.string)}get errmsg(){return this.get("errmsg",se.BSONType.string)}get code(){return this.getNumber("code")}get $clusterTime(){if(!("clusterTime"in this)){let e=this.get("$clusterTime",se.BSONType.object);if(e==null)return this.clusterTime=null,null;let t=e.get("clusterTime",se.BSONType.timestamp,!0),r=e.get("signature",se.BSONType.object)?.toObject();this.clusterTime={clusterTime:t,signature:r}}return this.clusterTime??null}toObject(e){let t={...se.pluckBSONSerializeOptions(e??{}),validation:se.parseUtf8ValidationOption(e)};return super.toObject(t)}}rb.MongoDBResponse=xc;class Na extends xc{constructor(){super(...arguments);this._batch=null,this.iterated=0,this._encryptedBatch=null}static get emptyGetMore(){return new Na(se.serialize({ok:1,cursor:{id:0n,nextBatch:[]}}))}static is(e){return e instanceof Na||e===Na.emptyGetMore}get cursor(){return this.get("cursor",se.BSONType.object,!0)}get id(){try{return se.Long.fromBigInt(this.cursor.get("id",se.BSONType.long,!0))}catch(e){throw new cs.MongoUnexpectedServerResponseError(e.message,{cause:e})}}get ns(){let e=this.cursor.get("ns",se.BSONType.string);if(e!=null)return xd.ns(e);return null}get length(){return Math.max(this.batchSize-this.iterated,0)}get encryptedBatch(){if(this.encryptedResponse==null)return null;if(this._encryptedBatch!=null)return this._encryptedBatch;let e=this.encryptedResponse?.get("cursor",se.BSONType.object);if(e?.has("firstBatch"))this._encryptedBatch=e.get("firstBatch",se.BSONType.array,!0);else if(e?.has("nextBatch"))this._encryptedBatch=e.get("nextBatch",se.BSONType.array,!0);else throw new cs.MongoUnexpectedServerResponseError("Cursor document did not contain a batch");return this._encryptedBatch}get batch(){if(this._batch!=null)return this._batch;let e=this.cursor;if(e.has("firstBatch"))this._batch=e.get("firstBatch",se.BSONType.array,!0);else if(e.has("nextBatch"))this._batch=e.get("nextBatch",se.BSONType.array,!0);else throw new cs.MongoUnexpectedServerResponseError("Cursor document did not contain a batch");return this._batch}get batchSize(){return this.batch?.size()}get postBatchResumeToken(){return this.cursor.get("postBatchResumeToken",se.BSONType.object)?.toObject({promoteValues:!1,promoteLongs:!1,promoteBuffers:!1,validation:{utf8:!0}})??null}shift(e){if(this.iterated>=this.batchSize)return null;let t=this.batch.get(this.iterated,se.BSONType.object,!0)??null,r=this.encryptedBatch?.get(this.iterated,se.BSONType.object,!0)??null;if(this.iterated+=1,e?.raw)return t.toBytes();else{let n=t.toObject(e);if(r)xd.decorateDecryptionResult(n,r.toObject(e),!0);return n}}clear(){this.iterated=this.batchSize}}rb.CursorResponse=Na;class eb extends Na{constructor(){super(...arguments);this.isExplain=!0,this._length=1}get id(){return se.Long.fromBigInt(0n)}get batchSize(){return 0}get ns(){return null}get length(){return this._length}shift(e){if(this._length===0)return null;return this._length-=1,this.toObject(e)}}rb.ExplainedCursorResponse=eb;class tb extends Na{get insertedCount(){return this.get("nInserted",se.BSONType.int,!0)}get upsertedCount(){return this.get("nUpserted",se.BSONType.int,!0)}get matchedCount(){return this.get("nMatched",se.BSONType.int,!0)}get modifiedCount(){return this.get("nModified",se.BSONType.int,!0)}get deletedCount(){return this.get("nDeleted",se.BSONType.int,!0)}get writeConcernError(){return this.get("writeConcernError",se.BSONType.object,!1)}}rb.ClientBulkWriteCursorResponse=tb});var Qg=g(function(sb){Object.defineProperty(sb,"__esModule",{value:!0});sb.Explain=sb.ExplainVerbosity=void 0;sb.decorateWithExplain=Gse;sb.ExplainVerbosity=Object.freeze({queryPlanner:"queryPlanner",queryPlannerExtended:"queryPlannerExtended",executionStats:"executionStats",allPlansExecution:"allPlansExecution"});class Pd{constructor(e,t){if(typeof e==="boolean")this.verbosity=e?sb.ExplainVerbosity.allPlansExecution:sb.ExplainVerbosity.queryPlanner;else this.verbosity=e;this.maxTimeMS=t}static fromOptions({explain:e}={}){if(e==null)return;if(typeof e==="boolean"||typeof e==="string")return new Pd(e);let{verbosity:t,maxTimeMS:r}=e;return new Pd(t,r)}}sb.Explain=Pd;function Gse(e,t){let{verbosity:r,maxTimeMS:n}=t,s={explain:e,verbosity:r};if(typeof n==="number")s.maxTimeMS=n;return s}});var Mt=g(function(ab){Object.defineProperty(ab,"__esModule",{value:!0});ab.AbstractOperation=ab.Aspect=void 0;ab.defineAspects=Jse;var ob=we(),Bc=Ur();ab.Aspect={READ_OPERATION:Symbol("READ_OPERATION"),WRITE_OPERATION:Symbol("WRITE_OPERATION"),RETRYABLE:Symbol("RETRYABLE"),EXPLAINABLE:Symbol("EXPLAINABLE"),SKIP_COLLATION:Symbol("SKIP_COLLATION"),CURSOR_CREATING:Symbol("CURSOR_CREATING"),MUST_SELECT_SAME_SERVER:Symbol("MUST_SELECT_SAME_SERVER"),COMMAND_BATCHING:Symbol("COMMAND_BATCHING"),SUPPORTS_RAW_DATA:Symbol("SUPPORTS_RAW_DATA")};class ub{constructor(e={}){this.readPreference=this.hasAspect(ab.Aspect.WRITE_OPERATION)?Bc.ReadPreference.primary:Bc.ReadPreference.fromOptions(e)??Bc.ReadPreference.primary,this.bsonOptions=ob.resolveBSONOptions(e),this._session=e.session!=null?e.session:void 0,this.options=e,this.bypassPinningCheck=!!e.bypassPinningCheck,this.attemptsMade=0}hasAspect(e){let t=this.constructor;if(t.aspects==null)return!1;return t.aspects.has(e)}get session(){return this._session}set session(e){this._session=e}clearSession(){this._session=void 0}resetBatch(){return!0}get canRetryRead(){return this.hasAspect(ab.Aspect.RETRYABLE)&&this.hasAspect(ab.Aspect.READ_OPERATION)}get canRetryWrite(){return this.hasAspect(ab.Aspect.RETRYABLE)&&this.hasAspect(ab.Aspect.WRITE_OPERATION)}handleOk(e){return e.toObject(this.bsonOptions)}handleError(e){throw e}}ab.AbstractOperation=ub;function Jse(e,t){if(!Array.isArray(t)&&!(t instanceof Set))t=[t];return t=new Set(t),Object.defineProperty(e,"aspects",{value:t,writable:!1}),t}});var nr=g(function(pb){Object.defineProperty(pb,"__esModule",{value:!0});pb.CommandOperation=void 0;var lb=Uo(),hb=Q(),Bd=Qg(),fb=vi(),gu=ae(),Fd=Kn(),ls=Mt();class db extends ls.AbstractOperation{constructor(e,t){super(t);this.options=t??{};let r=t?.dbName||t?.authdb;if(r)this.ns=new gu.MongoDBNamespace(r,"$cmd");else this.ns=e?e.s.namespace.withCollection("$cmd"):new gu.MongoDBNamespace("admin","$cmd");if(this.readConcern=fb.ReadConcern.fromOptions(t),this.writeConcern=Fd.WriteConcern.fromOptions(t),this.hasAspect(ls.Aspect.EXPLAINABLE))this.explain=Bd.Explain.fromOptions(t);else if(t?.explain!=null)throw new hb.MongoInvalidArgumentError('Option "explain" is not supported on this command')}get canRetryWrite(){if(this.hasAspect(ls.Aspect.EXPLAINABLE))return this.explain==null;return super.canRetryWrite}buildOptions(e){return{...this.options,...this.bsonOptions,timeoutContext:e,readPreference:this.readPreference,session:this.session}}buildCommand(e,t){let r=this.buildCommandDocument(e,t),n=this.session&&this.session.inTransaction();if(this.readConcern&&gu.commandSupportsReadConcern(r)&&!n)Object.assign(r,{readConcern:this.readConcern});if(this.writeConcern&&this.hasAspect(ls.Aspect.WRITE_OPERATION)&&!n)Fd.WriteConcern.apply(r,this.writeConcern);if(this.options.collation&&typeof this.options.collation==="object"&&!this.hasAspect(ls.Aspect.SKIP_COLLATION))Object.assign(r,{collation:this.options.collation});if(typeof this.options.maxTimeMS==="number")r.maxTimeMS=this.options.maxTimeMS;if(this.options.rawData!=null&&this.hasAspect(ls.Aspect.SUPPORTS_RAW_DATA)&&gu.maxWireVersion(e)>=lb.MIN_SUPPORTED_RAW_DATA_WIRE_VERSION)r.rawData=this.options.rawData;if(this.hasAspect(ls.Aspect.EXPLAINABLE)&&this.explain)return Bd.decorateWithExplain(r,this.explain);return r}}pb.CommandOperation=db});var t_=g(function(Eb){Object.defineProperty(Eb,"__esModule",{value:!0});Eb.DeleteManyOperation=Eb.DeleteOneOperation=Eb.DeleteOperation=void 0;Eb.makeDeleteStatement=e_;var yb=mu(),gb=dt(),_u=Q(),_b=nr(),wt=Mt();class _h extends _b.CommandOperation{constructor(e,t,r,n){super(void 0,r);this.SERVER_COMMAND_RESPONSE_TYPE=gb.MongoDBResponse,this.options=r,this.ns=e,this.statements=t,this.serializedOperations=n}get commandName(){return"delete"}get canRetryWrite(){if(super.canRetryWrite===!1)return!1;return this.statements.every((e)=>e.limit!=null?e.limit>0:!0)}buildCommandDocument(e,t){let r=this.options,n=typeof r.ordered==="boolean"?r.ordered:!0,s={delete:this.ns.collection,deletes:this.serializedOperations?yb.makeDocumentSequence("deletes",this.statements,this.serializedOperations):this.statements,ordered:n};if(r.let)s.let=r.let;if(r.comment!==void 0)s.comment=r.comment;return s}}Eb.DeleteOperation=_h;class Xg extends _h{constructor(e,t,r){super(e,[e_(t,{...r,limit:1})],r)}handleOk(e){let t=super.handleOk(e);if(this.explain)return t;if(t.code)throw new _u.MongoServerError(t);if(t.writeErrors)throw new _u.MongoServerError(t.writeErrors[0]);return{acknowledged:this.writeConcern?.w!==0,deletedCount:t.n}}}Eb.DeleteOneOperation=Xg;class Zg extends _h{constructor(e,t,r){super(e,[e_(t,r)],r)}handleOk(e){let t=super.handleOk(e);if(this.explain)return t;if(t.code)throw new _u.MongoServerError(t);if(t.writeErrors)throw new _u.MongoServerError(t.writeErrors[0]);return{acknowledged:this.writeConcern?.w!==0,deletedCount:t.n}}}Eb.DeleteManyOperation=Zg;function e_(e,t){let r={q:e,limit:typeof t.limit==="number"?t.limit:0};if(t.collation)r.collation=t.collation;if(t.hint)r.hint=t.hint;return r}wt.defineAspects(_h,[wt.Aspect.RETRYABLE,wt.Aspect.WRITE_OPERATION,wt.Aspect.SUPPORTS_RAW_DATA]);wt.defineAspects(Xg,[wt.Aspect.RETRYABLE,wt.Aspect.WRITE_OPERATION,wt.Aspect.EXPLAINABLE,wt.Aspect.SKIP_COLLATION,wt.Aspect.SUPPORTS_RAW_DATA]);wt.defineAspects(Zg,[wt.Aspect.WRITE_OPERATION,wt.Aspect.EXPLAINABLE,wt.Aspect.SKIP_COLLATION,wt.Aspect.SUPPORTS_RAW_DATA])});var Fc=g(function(bb){Object.defineProperty(bb,"__esModule",{value:!0});bb.DeprioritizedServers=bb.MIN_SECONDARY_WRITE_WIRE_VERSION=void 0;bb.writableServerSelector=rie;bb.sameServerSelector=nie;bb.secondaryWritableServerSelector=sie;bb.readPreferenceServerSelector=s_;var eo=Q(),Rd=Ur(),Hr=as(),tie=1e4,Ob=90;bb.MIN_SECONDARY_WRITE_WIRE_VERSION=13;class Cb{constructor(e){this.deprioritized=new Set;for(let t of e??[])this.add(t)}add({address:e}){this.deprioritized.add(e)}has({address:e}){return this.deprioritized.has(e)}}bb.DeprioritizedServers=Cb;function i_(e,t){let r=e.filter((n)=>!t.has(n));return r.length?r:e}function rie(){return function(t,r,n){let s=i_(r.filter(({isWritable:i})=>i),n);return Vo(t,s)}}function nie(e){return function(r,n,s){if(!e)return[];return n.filter((i)=>i.address===e.address&&i.type!==Hr.ServerType.Unknown)}}function sie(e,t){if(!t||!e||e&&e<bb.MIN_SECONDARY_WRITE_WIRE_VERSION)return s_(Rd.ReadPreference.primary);return s_(t)}function r_(e,t,r){if(e.maxStalenessSeconds==null||e.maxStalenessSeconds<0)return r;let n=e.maxStalenessSeconds,s=(t.heartbeatFrequencyMS+tie)/1000;if(n<s)throw new eo.MongoInvalidArgumentError(`Option "maxStalenessSeconds" must be at least ${s} seconds`);if(n<Ob)throw new eo.MongoInvalidArgumentError(`Option "maxStalenessSeconds" must be at least ${Ob} seconds`);if(t.type===Hr.TopologyType.ReplicaSetWithPrimary){let i=Array.from(t.servers.values()).filter(Id)[0];return r.filter((o)=>{let a=(o.lastUpdateTime-o.lastWriteDate-(i.lastUpdateTime-i.lastWriteDate)+t.heartbeatFrequencyMS)/1000,c=e.maxStalenessSeconds??0;return a<=c})}if(t.type===Hr.TopologyType.ReplicaSetNoPrimary){if(r.length===0)return r;let i=r.reduce((o,u)=>u.lastWriteDate>o.lastWriteDate?u:o);return r.filter((o)=>{let a=(i.lastWriteDate-o.lastWriteDate+t.heartbeatFrequencyMS)/1000,c=e.maxStalenessSeconds??0;return a<=c})}return r}function iie(e,t){return Object.entries(e).every(([r,n])=>t[r]!=null&&t[r]===n)}function n_({tags:e},t){if(e==null||e.length===0)return t;for(let r of e){let n=t.filter((s)=>iie(r,s.tags));if(n.length)return n}return[]}function Vo(e,t){let r=t.reduce((s,i)=>Math.min(i.roundTripTime,s),1/0),n=r+e.localThresholdMS;return t.filter((s)=>s.roundTripTime<=n&&s.roundTripTime>=r)}function Id(e){return e.type===Hr.ServerType.RSPrimary}function Sb(e){return e.type===Hr.ServerType.RSSecondary}function oie(e){return e.type===Hr.ServerType.RSSecondary||e.type===Hr.ServerType.RSPrimary}function wb(e){return e.type!==Hr.ServerType.Unknown}function uie(e){return e.type===Hr.ServerType.LoadBalancer}function Nd(e){return(t)=>!e.has(t)}function aie(e,t,r,n){let s=e.mode;switch(s){case"primary":return r.filter(Id);case"primaryPreferred":{let i=r.filter(Id),o=i.filter(Nd(n));if(o.length)return o;let u=n_(e,r_(e,t,r.filter(Sb))),a=u.filter(Nd(n));if(a.length)return Vo(t,a);return i.length?i:Vo(t,u)}case"nearest":{let i=i_(n_(e,r_(e,t,r.filter(oie))),n);return Vo(t,i)}case"secondary":case"secondaryPreferred":{let i=n_(e,r_(e,t,r.filter(Sb))),o=i.filter(Nd(n));if(o.length)return Vo(t,o);if(s===Rd.ReadPreference.SECONDARY_PREFERRED){let u=r.filter(Id),a=u.filter(Nd(n));if(a.length)return a;return i.length?Vo(t,i):u}return Vo(t,i)}default:{let i=s;throw new eo.MongoRuntimeError(`unexpected readPreference=${s} (should never happen). Please report a bug in the Node driver Jira project.`)}}}function s_(e){if(!e.isValid())throw new eo.MongoInvalidArgumentError("Invalid read preference specified");return function(r,n,s){switch(r.type){case"Single":return Vo(r,n.filter(wb));case"ReplicaSetNoPrimary":case"ReplicaSetWithPrimary":return aie(e,r,n,s);case"Sharded":{let i=i_(n,s);return Vo(r,i.filter(wb))}case"Unknown":return[];case"LoadBalanced":return n.filter(uie);default:{let i=r.type;throw new eo.MongoRuntimeError(`unexpected topology type: ${r.type} (this should never happen). Please file a bug in the Node driver Jira project.`)}}}}});var Gn=g(function(Mb){Object.defineProperty(Mb,"__esModule",{value:!0});Mb.LegacyTimeoutContext=Mb.CSOTTimeoutContext=Mb.TimeoutContext=Mb.Timeout=Mb.TimeoutError=void 0;var $d=G("timers"),hs=Q(),Nc=ae();class vd extends Error{get name(){return"TimeoutError"}constructor(e,t){super(e,t);this.duration=t.duration}static is(e){return e!=null&&typeof e==="object"&&"name"in e&&e.name==="TimeoutError"}}Mb.TimeoutError=vd;class Fs extends Promise{get remainingTime(){if(this.timedOut)return 0;if(this.duration===0)return 1/0;return this.start+this.duration-Math.trunc(performance.now())}get timeElapsed(){return Math.trunc(performance.now())-this.start}constructor(e=()=>null,t){let r=t?.duration??0,n=!!t?.unref,s=t?.rejection;if(r<0)throw new hs.MongoInvalidArgumentError("Cannot create a Timeout with a negative duration");let i;super((o,u)=>{i=u,e(Nc.noop,u)});if(this.ended=null,this.timedOut=!1,this.cleared=!1,this.duration=r,this.start=Math.trunc(performance.now()),s==null&&this.duration>0){if(this.id=$d.setTimeout(()=>{this.ended=Math.trunc(performance.now()),this.timedOut=!0,i(new vd(`Expired after ${r}ms`,{duration:r}))},this.duration),typeof this.id.unref==="function"&&n)this.id.unref()}else if(s!=null)this.ended=Math.trunc(performance.now()),this.timedOut=!0,i(s)}clear(){$d.clearTimeout(this.id),this.id=void 0,this.timedOut=!1,this.cleared=!0}throwIfExpired(){if(this.timedOut)throw this.then(void 0,Nc.squashError),new vd("Timed out",{duration:this.duration})}static expires(e,t){return new Fs(void 0,{duration:e,unref:t})}static reject(e){return new Fs(void 0,{duration:0,unref:!0,rejection:e})}}Mb.Timeout=Fs;function die(e){return e!=null&&typeof e==="object"&&"serverSelectionTimeoutMS"in e&&typeof e.serverSelectionTimeoutMS==="number"&&"waitQueueTimeoutMS"in e&&typeof e.waitQueueTimeoutMS==="number"}class qd{static create(e){if(e.session?.timeoutContext!=null)return e.session?.timeoutContext;if(die(e))return new jd(e);else throw new hs.MongoRuntimeError("Unrecognized options")}}Mb.TimeoutContext=qd;class kd extends qd{constructor(e){super();this.minRoundTripTime=0,this.start=Math.trunc(performance.now()),this.timeoutMS=e.timeoutMS,this.serverSelectionTimeoutMS=e.serverSelectionTimeoutMS,this.socketTimeoutMS=e.socketTimeoutMS,this.clearServerSelectionTimeout=!1}get maxTimeMS(){return this.remainingTimeMS-this.minRoundTripTime}get remainingTimeMS(){let e=Math.trunc(performance.now())-this.start;return this.timeoutMS<=0?1/0:this.timeoutMS-e}csotEnabled(){return!0}get serverSelectionTimeout(){if(typeof this._serverSelectionTimeout!=="object"||this._serverSelectionTimeout?.cleared){let{remainingTimeMS:e,serverSelectionTimeoutMS:t}=this;if(e<=0)return Fs.reject(new hs.MongoOperationTimeoutError(`Timed out in server selection after ${this.timeoutMS}ms`));if(t!==0&&Nc.csotMin(e,t)===t)this._serverSelectionTimeout=Fs.expires(t);else if(e>0&&Number.isFinite(e))this._serverSelectionTimeout=Fs.expires(e);else this._serverSelectionTimeout=null}return this._serverSelectionTimeout}get connectionCheckoutTimeout(){if(typeof this._connectionCheckoutTimeout!=="object"||this._connectionCheckoutTimeout?.cleared)if(typeof this._serverSelectionTimeout==="object")this._connectionCheckoutTimeout=this._serverSelectionTimeout;else throw new hs.MongoRuntimeError("Unreachable. If you are seeing this error, please file a ticket on the NODE driver project on Jira");return this._connectionCheckoutTimeout}get timeoutForSocketWrite(){let{remainingTimeMS:e}=this;if(!Number.isFinite(e))return null;if(e>0)return Fs.expires(e);return Fs.reject(new hs.MongoOperationTimeoutError("Timed out before socket write"))}get timeoutForSocketRead(){let{remainingTimeMS:e}=this;if(!Number.isFinite(e))return null;if(e>0)return Fs.expires(e);return Fs.reject(new hs.MongoOperationTimeoutError("Timed out before socket read"))}refresh(){this.start=Math.trunc(performance.now()),this.minRoundTripTime=0,this._serverSelectionTimeout?.clear(),this._connectionCheckoutTimeout?.clear()}clear(){this._serverSelectionTimeout?.clear(),this._connectionCheckoutTimeout?.clear()}getRemainingTimeMSOrThrow(e){let{remainingTimeMS:t}=this;if(t<=0)throw new hs.MongoOperationTimeoutError(e??`Expired after ${this.timeoutMS}ms`);return t}clone(){let e=new kd({timeoutMS:this.timeoutMS,serverSelectionTimeoutMS:this.serverSelectionTimeoutMS});return e.start=this.start,e}refreshed(){return new kd(this)}addMaxTimeMSToCommand(e,t){if(t.omitMaxTimeMS)return;let r=this.remainingTimeMS-this.minRoundTripTime;if(r>0&&Number.isFinite(r))e.maxTimeMS=r}getSocketTimeoutMS(){return 0}}Mb.CSOTTimeoutContext=kd;class jd extends qd{constructor(e){super();this.options=e,this.clearServerSelectionTimeout=!0}csotEnabled(){return!1}get serverSelectionTimeout(){if(this.options.serverSelectionTimeoutMS!=null&&this.options.serverSelectionTimeoutMS>0)return Fs.expires(this.options.serverSelectionTimeoutMS);return null}get connectionCheckoutTimeout(){if(this.options.waitQueueTimeoutMS!=null&&this.options.waitQueueTimeoutMS>0)return Fs.expires(this.options.waitQueueTimeoutMS);return null}get timeoutForSocketWrite(){return null}get timeoutForSocketRead(){return null}refresh(){return}clear(){return}get maxTimeMS(){return null}refreshed(){return new jd(this.options)}addMaxTimeMSToCommand(e,t){}getSocketTimeoutMS(){return this.options.socketTimeoutMS}}Mb.LegacyTimeoutContext=jd});var Eh=g(function(Nb){Object.defineProperty(Nb,"__esModule",{value:!0});Nb.AggregateOperation=Nb.DB_AGGREGATE_COLLECTION=void 0;var Ic=dt(),Pb=Q(),Bb=Kn(),Fb=nr(),Gs=Mt();Nb.DB_AGGREGATE_COLLECTION=1;class o_ extends Fb.CommandOperation{constructor(e,t,r){super(void 0,{...r,dbName:e.db});if(this.SERVER_COMMAND_RESPONSE_TYPE=Ic.CursorResponse,this.options={...r},this.target=e.collection||Nb.DB_AGGREGATE_COLLECTION,this.pipeline=t,this.hasWriteStage=!1,typeof r?.out==="string")this.pipeline=this.pipeline.concat({$out:r.out}),this.hasWriteStage=!0;else if(t.length>0){let n=t[t.length-1];if(n.$out||n.$merge)this.hasWriteStage=!0}if(!this.hasWriteStage)delete this.options.writeConcern;if(r?.cursor!=null&&typeof r.cursor!=="object")throw new Pb.MongoInvalidArgumentError("Cursor options must be an object");this.SERVER_COMMAND_RESPONSE_TYPE=this.explain?Ic.ExplainedCursorResponse:Ic.CursorResponse}get commandName(){return"aggregate"}get canRetryRead(){return!this.hasWriteStage}addToPipeline(e){this.pipeline.push(e)}buildCommandDocument(){let e=this.options,t={aggregate:this.target,pipeline:this.pipeline};if(this.hasWriteStage&&this.writeConcern)Bb.WriteConcern.apply(t,this.writeConcern);if(e.bypassDocumentValidation===!0)t.bypassDocumentValidation=e.bypassDocumentValidation;if(typeof e.allowDiskUse==="boolean")t.allowDiskUse=e.allowDiskUse;if(e.hint)t.hint=e.hint;if(e.let)t.let=e.let;if(e.comment!==void 0)t.comment=e.comment;if(t.cursor=e.cursor||{},e.batchSize&&!this.hasWriteStage)t.cursor.batchSize=e.batchSize;return t}handleOk(e){return e}}Nb.AggregateOperation=o_;Gs.defineAspects(o_,[Gs.Aspect.READ_OPERATION,Gs.Aspect.RETRYABLE,Gs.Aspect.EXPLAINABLE,Gs.Aspect.CURSOR_CREATING,Gs.Aspect.SUPPORTS_RAW_DATA])});var Rc=g(function(kb){Object.defineProperty(kb,"__esModule",{value:!0});kb.RunCursorCommandOperation=kb.RunCommandOperation=void 0;var Ld=dt(),$b=Mt();class u_ extends $b.AbstractOperation{constructor(e,t,r){super(r);this.SERVER_COMMAND_RESPONSE_TYPE=Ld.MongoDBResponse,this.command=t,this.options=r,this.ns=e.withCollection("$cmd")}get commandName(){return"runCommand"}buildCommand(e,t){return this.command}buildOptions(e){return{...this.options,session:this.session,timeoutContext:e,signal:this.options.signal,readPreference:this.options.readPreference}}}kb.RunCommandOperation=u_;class vb extends u_{constructor(){super(...arguments);this.SERVER_COMMAND_RESPONSE_TYPE=Ld.CursorResponse}handleOk(e){return e}}kb.RunCursorCommandOperation=vb});var Kr=g(function(Kb){Object.defineProperty(Kb,"__esModule",{value:!0});Kb.BASE_BACKOFF_MS=void 0;Kb.executeOperation=Aie;Kb.autoConnect=Wb;Kb.calculateBaseBackoffMS=Hb;var Lb=G("timers/promises"),Ub=Uo(),xe=Q(),Ud=Ur(),Vb=as(),Eu=Fc(),zb=Gn(),Au=ae(),Vd=Eh(),Br=Mt(),zd=Rc(),Eie=xe.MONGODB_ERROR_CODES.IllegalOperation,jb="This MongoDB deployment does not support retryable writes. Please add retryWrites=false to your connection string.";async function Aie(e,t,r){if(!(t instanceof Br.AbstractOperation))throw new xe.MongoRuntimeError("This method requires a valid operation instance");let n=e.topology==null?await Au.abortable(Wb(e),t.options):e.topology,s=t.session,i;if(s==null)i=Symbol(),s=e.startSession({owner:i,explicit:!1});else if(s.hasEnded)throw new xe.MongoExpiredSessionError("Use of expired sessions is not permitted");else if(s.snapshotEnabled&&Au.maxWireVersion(n)<Ub.MIN_SUPPORTED_SNAPSHOT_READS_WIRE_VERSION)throw new xe.MongoCompatibilityError("Snapshot reads require MongoDB 5.0 or later");else if(s.client!==e)throw new xe.MongoInvalidArgumentError("ClientSession must be from the same MongoClient");t.session??=s;let o=t.readPreference??Ud.ReadPreference.primary,u=!!s?.inTransaction(),a=t.hasAspect(Br.Aspect.READ_OPERATION);if(u&&!o.equals(Ud.ReadPreference.primary)&&(a||t.commandName==="runCommand"))throw new xe.MongoTransactionError(`Read preference in a transaction must be primary, not: ${o.mode}`);if(s?.isPinned&&s.transaction.isCommitted&&!t.bypassPinningCheck)s.unpin();r??=zb.TimeoutContext.create({session:s,serverSelectionTimeoutMS:e.s.options.serverSelectionTimeoutMS,waitQueueTimeoutMS:e.s.options.waitQueueTimeoutMS,timeoutMS:t.options.timeoutMS});try{return await Sie(t,{topology:n,timeoutContext:r,session:s,readPreference:o})}finally{if(s?.owner!=null&&s.owner===i)await s.endSession()}}async function Wb(e){if(e.topology==null){if(e.s.hasBeenClosed)throw new xe.MongoNotConnectedError("Client must be connected before running operations");e.s.options.__skipPingOnConnect=!0;try{if(await e.connect(),e.topology==null)throw new xe.MongoRuntimeError("client.connect did not create a topology but also did not throw");return e.topology}finally{delete e.s.options.__skipPingOnConnect}}return e.topology}Kb.BASE_BACKOFF_MS=100;var Oie=1e4;function Hb(e){if(!(e instanceof xe.MongoServerError))return Kb.BASE_BACKOFF_MS;let t=e.errorResponse.baseBackoffMS,n=typeof t==="number"||typeof t==="bigint"||typeof t==="object"?Number(t):NaN;return Number.isFinite(n)&&n>0?n:Kb.BASE_BACKOFF_MS}async function Sie(e,{topology:t,timeoutContext:r,session:n,readPreference:s}){let i;if(e.hasAspect(Br.Aspect.MUST_SELECT_SAME_SERVER))i=Eu.sameServerSelector(e.server?.description);else if(e instanceof Vd.AggregateOperation&&e.hasWriteStage)i=Eu.secondaryWritableServerSelector(t.commonWireVersion,s);else i=s;let o=await t.selectServer(i,{session:n,operationName:e.commandName,timeoutContext:r,signal:e.options.signal,deprioritizedServers:new Eu.DeprioritizedServers}),u=e.hasAspect(Br.Aspect.READ_OPERATION),a=e.hasAspect(Br.Aspect.WRITE_OPERATION),c=n?.inTransaction()??!1,l=t.s.options.retryReads&&!c&&e.canRetryRead,f=t.s.options.retryWrites&&!c&&Au.supportsRetryableWrites(o)&&e.canRetryWrite,h=e.hasAspect(Br.Aspect.RETRYABLE)&&n!=null&&(u&&l||a&&f);if(a&&f&&n!=null)e.options.willRetryWrite=!0,n.incrementTransactionNumber();let d=new Eu.DeprioritizedServers,p=typeof e.maxAttempts==="number"?e.maxAttempts:h?r.csotEnabled()?1/0:2:1,m=null;for(let y=0;y<p;y++){e.attemptsMade=y+1,e.server=o;try{try{let E=await o.command(e,r);return e.handleOk(E)}catch(E){return e.handleError(E)}}catch(E){if(!(E instanceof xe.MongoError))throw E;if(m==null)m=E;else if(!E.hasErrorLabel(xe.MongoErrorLabel.NoWritesPerformed))m=E;if(r.clear(),a&&E.code===Eie)throw new xe.MongoServerError({message:jb,errmsg:jb,originalError:E});if(!_(e,E))throw m;if(E.hasErrorLabel(xe.MongoErrorLabel.SystemOverloadedError)){let w=t.s.options.maxAdaptiveRetries+1;p=Math.min(w,e.maxAttempts??w)}if(y+1>=p)throw m;if(E instanceof xe.MongoNetworkError&&e.hasAspect(Br.Aspect.CURSOR_CREATING)&&n!=null&&n.isPinned&&!n.inTransaction())n.unpin({force:!0,forceClear:!0});if(E.hasErrorLabel(xe.MongoErrorLabel.SystemOverloadedError)&&e.hasAspect(Br.Aspect.CURSOR_CREATING)&&n!=null&&n.isPinned&&!n.inTransaction())n.unpin({force:!0});if(E.hasErrorLabel(xe.MongoErrorLabel.SystemOverloadedError)){let w=Hb(E),b=Math.random()*Math.min(Oie,w*2**(y+1));if(r.csotEnabled()&&b>r.remainingTimeMS)throw m;await Lb.setTimeout(b)}if(t.description.type===Vb.TopologyType.Sharded||E.hasErrorLabel(xe.MongoErrorLabel.SystemOverloadedError)&&t.s.options.enableOverloadRetargeting)d.add(o.description);if(o=await t.selectServer(i,{session:n,operationName:e.commandName,deprioritizedServers:d,signal:e.options.signal}),a&&!Au.supportsRetryableWrites(o)&&!E.hasErrorLabel(xe.MongoErrorLabel.SystemOverloadedError))throw new xe.MongoUnexpectedServerResponseError("Selected server does not support retryable writes");if(e.hasAspect(Br.Aspect.COMMAND_BATCHING))e.resetBatch()}}throw m??new xe.MongoRuntimeError("Should never happen: operation execution loop terminated but no error was recorded.");function _(y,E){if(E.hasErrorLabel(xe.MongoErrorLabel.SystemOverloadedError)&&E.hasErrorLabel(xe.MongoErrorLabel.RetryableError)){if(y instanceof zd.RunCommandOperation)return t.s.options.retryReads&&t.s.options.retryWrites;if(y instanceof Vd.AggregateOperation&&y.hasWriteStage)return t.s.options.retryWrites;let w=u&&t.s.options.retryReads,b=a&&t.s.options.retryWrites;return w||b}if(y instanceof zd.RunCommandOperation)return!1;if(y.hasAspect(Br.Aspect.COMMAND_BATCHING))return y.canRetryWrite&&xe.isRetryableWriteError(E);return a&&f&&xe.isRetryableWriteError(E)||u&&l&&xe.isRetryableReadError(E)}}});var c_=g(function(Xb){Object.defineProperty(Xb,"__esModule",{value:!0});Xb.InsertOneOperation=Xb.InsertOperation=void 0;var Gb=mu(),Yb=dt(),Hd=Q(),Jb=ae(),Qb=nr(),bn=Mt();class Kd extends Qb.CommandOperation{constructor(e,t,r,n){super(void 0,r);this.SERVER_COMMAND_RESPONSE_TYPE=Yb.MongoDBResponse,this.options={...r,checkKeys:r.checkKeys??!1},this.ns=e,this.documents=t,this.serializedOperations=n}get commandName(){return"insert"}buildCommandDocument(e,t){let r=this.options??{},n=typeof r.ordered==="boolean"?r.ordered:!0,s={insert:this.ns.collection,documents:this.serializedOperations?Gb.makeDocumentSequence("documents",this.documents,this.serializedOperations):this.documents,ordered:n};if(typeof r.bypassDocumentValidation==="boolean")s.bypassDocumentValidation=r.bypassDocumentValidation;if(r.comment!==void 0)s.comment=r.comment;return s}}Xb.InsertOperation=Kd;class a_ extends Kd{constructor(e,t,r){super(e.s.namespace,[Jb.maybeAddIdToDocuments(e,t,r)],r)}handleOk(e){let t=super.handleOk(e);if(t.code)throw new Hd.MongoServerError(t);if(t.writeErrors)throw new Hd.MongoServerError(t.writeErrors[0]);return{acknowledged:this.writeConcern?.w!==0,insertedId:this.documents[0]._id}}}Xb.InsertOneOperation=a_;bn.defineAspects(Kd,[bn.Aspect.RETRYABLE,bn.Aspect.WRITE_OPERATION,bn.Aspect.SUPPORTS_RAW_DATA]);bn.defineAspects(a_,[bn.Aspect.RETRYABLE,bn.Aspect.WRITE_OPERATION,bn.Aspect.SUPPORTS_RAW_DATA])});var vc=g(function(e7){Object.defineProperty(e7,"__esModule",{value:!0});e7.formatSort=vie;var Gd=Q();function $c(e=1){let t=`${e}`.toLowerCase();if(Tie(e))return e;switch(t){case"ascending":case"asc":case"1":return 1;case"descending":case"desc":case"-1":return-1;default:throw new Gd.MongoInvalidArgumentError(`Invalid sort direction: ${JSON.stringify(e)}`)}}function Tie(e){return typeof e==="object"&&e!=null&&"$meta"in e&&typeof e.$meta==="string"}function Mie(e){if(Array.isArray(e)&&e.length===2)try{return $c(e[1]),!0}catch{return!1}return!1}function xie(e){return Array.isArray(e)&&Array.isArray(e[0])}function Pie(e){return e instanceof Map&&e.size>0}function Bie(e){return Array.isArray(e)}function Fie(e){return new Map([[`${e[0]}`,$c(e[1])]])}function Nie(e){let t=e.map(([r,n])=>[`${r}`,$c(n)]);return new Map(t)}function Iie(e){let t=e.map((r)=>[`${r}`,1]);return new Map(t)}function Rie(e){let t=Object.entries(e).map(([r,n])=>[`${r}`,$c(n)]);return new Map(t)}function $ie(e){let t=Array.from(e).map(([r,n])=>[`${r}`,$c(n)]);return new Map(t)}function vie(e,t){if(e==null)return;if(typeof e==="string")return new Map([[e,$c(t)]]);if(typeof e!=="object")throw new Gd.MongoInvalidArgumentError(`Invalid sort format: ${JSON.stringify(e)} Sort must be a valid object`);if(!Bie(e)){if(Pie(e))return $ie(e);if(Object.keys(e).length)return Rie(e);return}if(!e.length)return;if(xie(e))return Nie(e);if(Mie(e))return Fie(e);return Iie(e)}});var d_=g(function(i7){Object.defineProperty(i7,"__esModule",{value:!0});i7.ReplaceOneOperation=i7.UpdateManyOperation=i7.UpdateOneOperation=i7.UpdateOperation=void 0;i7.makeUpdateStatement=Yd;var t7=mu(),r7=dt(),ar=Q(),n7=vc(),kc=ae(),s7=nr(),qe=Mt();class qc extends s7.CommandOperation{constructor(e,t,r,n){super(void 0,r);this.SERVER_COMMAND_RESPONSE_TYPE=r7.MongoDBResponse,this.options=r,this.ns=e,this.statements=t,this.serializedOperations=n}get commandName(){return"update"}get canRetryWrite(){if(super.canRetryWrite===!1)return!1;return this.statements.every((e)=>e.multi==null||e.multi===!1)}buildCommandDocument(e,t){let r=this.options,n={update:this.ns.collection,updates:this.serializedOperations?t7.makeDocumentSequence("updates",this.statements,this.serializedOperations):this.statements,ordered:r.ordered??!0};if(typeof r.bypassDocumentValidation==="boolean")n.bypassDocumentValidation=r.bypassDocumentValidation;if(r.let)n.let=r.let;if(r.comment!==void 0)n.comment=r.comment;return n}}i7.UpdateOperation=qc;class l_ extends qc{constructor(e,t,r,n){super(e,[Yd(t,r,{...n,multi:!1})],n);if(!kc.hasAtomicOperators(r,n))throw new ar.MongoInvalidArgumentError("Update document requires atomic operators")}handleOk(e){let t=super.handleOk(e);if(this.explain!=null)return t;if(t.code)throw new ar.MongoServerError(t);if(t.writeErrors)throw new ar.MongoServerError(t.writeErrors[0]);return{acknowledged:this.writeConcern?.w!==0,modifiedCount:t.nModified??t.n,upsertedId:Array.isArray(t.upserted)&&t.upserted.length>0?t.upserted[0]._id:null,upsertedCount:Array.isArray(t.upserted)&&t.upserted.length?t.upserted.length:0,matchedCount:Array.isArray(t.upserted)&&t.upserted.length>0?0:t.n}}}i7.UpdateOneOperation=l_;class h_ extends qc{constructor(e,t,r,n){super(e,[Yd(t,r,{...n,multi:!0})],n);if(!kc.hasAtomicOperators(r,n))throw new ar.MongoInvalidArgumentError("Update document requires atomic operators")}handleOk(e){let t=super.handleOk(e);if(this.explain!=null)return t;if(t.code)throw new ar.MongoServerError(t);if(t.writeErrors)throw new ar.MongoServerError(t.writeErrors[0]);return{acknowledged:this.writeConcern?.w!==0,modifiedCount:t.nModified??t.n,upsertedId:Array.isArray(t.upserted)&&t.upserted.length>0?t.upserted[0]._id:null,upsertedCount:Array.isArray(t.upserted)&&t.upserted.length?t.upserted.length:0,matchedCount:Array.isArray(t.upserted)&&t.upserted.length>0?0:t.n}}}i7.UpdateManyOperation=h_;class f_ extends qc{constructor(e,t,r,n){super(e,[Yd(t,r,{...n,multi:!1})],n);if(kc.hasAtomicOperators(r))throw new ar.MongoInvalidArgumentError("Replacement document must not contain atomic operators")}handleOk(e){let t=super.handleOk(e);if(this.explain!=null)return t;if(t.code)throw new ar.MongoServerError(t);if(t.writeErrors)throw new ar.MongoServerError(t.writeErrors[0]);return{acknowledged:this.writeConcern?.w!==0,modifiedCount:t.nModified??t.n,upsertedId:Array.isArray(t.upserted)&&t.upserted.length>0?t.upserted[0]._id:null,upsertedCount:Array.isArray(t.upserted)&&t.upserted.length?t.upserted.length:0,matchedCount:Array.isArray(t.upserted)&&t.upserted.length>0?0:t.n}}}i7.ReplaceOneOperation=f_;function Yd(e,t,r){if(e==null||typeof e!=="object")throw new ar.MongoInvalidArgumentError("Selector must be a valid JavaScript object");if(t==null||typeof t!=="object")throw new ar.MongoInvalidArgumentError("Document must be a valid JavaScript object");let n={q:e,u:t};if(typeof r.upsert==="boolean")n.upsert=r.upsert;if(r.multi)n.multi=r.multi;if(r.hint)n.hint=r.hint;if(r.arrayFilters)n.arrayFilters=r.arrayFilters;if(r.collation)n.collation=r.collation;if(!r.multi&&r.sort!=null)n.sort=n7.formatSort(r.sort);return n}qe.defineAspects(qc,[qe.Aspect.RETRYABLE,qe.Aspect.WRITE_OPERATION,qe.Aspect.SKIP_COLLATION,qe.Aspect.SUPPORTS_RAW_DATA]);qe.defineAspects(l_,[qe.Aspect.RETRYABLE,qe.Aspect.WRITE_OPERATION,qe.Aspect.EXPLAINABLE,qe.Aspect.SKIP_COLLATION,qe.Aspect.SUPPORTS_RAW_DATA]);qe.defineAspects(h_,[qe.Aspect.WRITE_OPERATION,qe.Aspect.EXPLAINABLE,qe.Aspect.SKIP_COLLATION,qe.Aspect.SUPPORTS_RAW_DATA]);qe.defineAspects(f_,[qe.Aspect.RETRYABLE,qe.Aspect.WRITE_OPERATION,qe.Aspect.SKIP_COLLATION,qe.Aspect.SUPPORTS_RAW_DATA])});var Lc=g(function(p7){Object.defineProperty(p7,"__esModule",{value:!0});p7.BulkOperationBase=p7.FindOperators=p7.MongoBulkWriteError=p7.WriteError=p7.WriteConcernError=p7.BulkWriteResult=p7.Batch=p7.BatchType=void 0;p7.mergeBatchResults=p_;var Xd=we(),We=Q(),to=t_(),a7=Kr(),c7=c_(),fs=d_(),l7=Gn(),Fr=ae(),Jd=Kn();p7.BatchType=Object.freeze({INSERT:1,UPDATE:2,DELETE:3});class h7{constructor(e,t){this.originalZeroIndex=t,this.currentIndex=0,this.originalIndexes=[],this.batchType=e,this.operations=[],this.serializedOperations=[],this.size=0,this.sizeBytes=0}}p7.Batch=h7;class zo{static generateIdMap(e){let t={};for(let r of e)t[r.index]=r._id;return t}constructor(e,t){this.result=e,this.insertedCount=this.result.nInserted??0,this.matchedCount=this.result.nMatched??0,this.modifiedCount=this.result.nModified??0,this.deletedCount=this.result.nRemoved??0,this.upsertedCount=this.result.upserted.length??0,this.upsertedIds=zo.generateIdMap(this.result.upserted),this.insertedIds=zo.generateIdMap(this.getSuccessfullyInsertedIds(e,t)),Object.defineProperty(this,"result",{value:this.result,enumerable:!1})}get ok(){return this.result.ok}getSuccessfullyInsertedIds(e,t){if(e.writeErrors.length===0)return e.insertedIds;if(t)return e.insertedIds.slice(0,e.writeErrors[0].index);return e.insertedIds.filter(({index:r})=>!e.writeErrors.some((n)=>r===n.index))}getUpsertedIdAt(e){return this.result.upserted[e]}getRawResponse(){return this.result}hasWriteErrors(){return this.result.writeErrors.length>0}getWriteErrorCount(){return this.result.writeErrors.length}getWriteErrorAt(e){return e<this.result.writeErrors.length?this.result.writeErrors[e]:void 0}getWriteErrors(){return this.result.writeErrors}getWriteConcernError(){if(this.result.writeConcernErrors.length===0)return;else if(this.result.writeConcernErrors.length===1)return this.result.writeConcernErrors[0];else{let e="";for(let t=0;t<this.result.writeConcernErrors.length;t++){let r=this.result.writeConcernErrors[t];if(e=e+r.errmsg,t===0)e=e+" and "}return new Oh({errmsg:e,code:We.MONGODB_ERROR_CODES.WriteConcernTimeout})}}toString(){return`BulkWriteResult(${Xd.EJSON.stringify(this.result)})`}isOk(){return this.result.ok===1}}p7.BulkWriteResult=zo;class Oh{constructor(e){this.serverError=e}get code(){return this.serverError.code}get errmsg(){return this.serverError.errmsg}get errInfo(){return this.serverError.errInfo}toJSON(){return this.serverError}toString(){return`WriteConcernError(${this.errmsg})`}}p7.WriteConcernError=Oh;class Qd{constructor(e){this.err=e}get code(){return this.err.code}get index(){return this.err.index}get errmsg(){return this.err.errmsg}get errInfo(){return this.err.errInfo}getOperation(){return this.err.op}toJSON(){return{code:this.err.code,index:this.err.index,errmsg:this.err.errmsg,op:this.err.op}}toString(){return`WriteError(${JSON.stringify(this.toJSON())})`}}p7.WriteError=Qd;function p_(e,t,r,n){if(r)n=r;else if(n&&n.result)n=n.result;if(n==null)return;if(n.ok===0&&t.ok===1){t.ok=0;let i={index:0,code:n.code||0,errmsg:n.message,errInfo:n.errInfo,op:e.operations[0]};t.writeErrors.push(new Qd(i));return}else if(n.ok===0&&t.ok===0)return;if(d7(e)&&n.n)t.nInserted=t.nInserted+n.n;if(y_(e)&&n.n)t.nRemoved=t.nRemoved+n.n;let s=0;if(Array.isArray(n.upserted)){s=n.upserted.length;for(let i=0;i<n.upserted.length;i++)t.upserted.push({index:n.upserted[i].index+e.originalZeroIndex,_id:n.upserted[i]._id})}else if(n.upserted)s=1,t.upserted.push({index:e.originalZeroIndex,_id:n.upserted});if(m_(e)&&n.n){let i=n.nModified;if(t.nUpserted=t.nUpserted+s,t.nMatched=t.nMatched+(n.n-s),typeof i==="number")t.nModified=t.nModified+i;else t.nModified=0}if(Array.isArray(n.writeErrors))for(let i=0;i<n.writeErrors.length;i++){let o={index:e.originalIndexes[n.writeErrors[i].index],code:n.writeErrors[i].code,errmsg:n.writeErrors[i].errmsg,errInfo:n.writeErrors[i].errInfo,op:e.operations[n.writeErrors[i].index]};t.writeErrors.push(new Qd(o))}if(n.writeConcernError)t.writeConcernErrors.push(new Oh(n.writeConcernError))}async function u7(e,t){if(e.s.batches.length===0)return new zo(e.s.bulkResult,e.isOrdered);for(let n of e.s.batches){let s=Fr.resolveOptions(e,{...t,ordered:e.isOrdered});if(s.bypassDocumentValidation!==!0)delete s.bypassDocumentValidation;if(e.s.bypassDocumentValidation===!0)s.bypassDocumentValidation=!0;if(e.s.checkKeys===!1)s.checkKeys=!1;if(e.retryWrites){if(m_(n))e.retryWrites=e.retryWrites&&!n.operations.some((h)=>h.multi);if(y_(n))e.retryWrites=e.retryWrites&&!n.operations.some((h)=>h.limit===0)}let i=e.s.bsonOptions,u=!e.s.usingAutoEncryption&&s.ignoreUndefined===i.ignoreUndefined&&s.serializeFunctions===i.serializeFunctions&&(s.checkKeys??!1)===e.s.checkKeys?n.serializedOperations:void 0,a=d7(n)?new c7.InsertOperation(e.s.namespace,n.operations,s,u):m_(n)?new fs.UpdateOperation(e.s.namespace,n.operations,s,u):y_(n)?new to.DeleteOperation(e.s.namespace,n.operations,s,u):null;if(a==null)throw new We.MongoRuntimeError(`Unknown batchType: ${n.batchType}`);let c=null,l;try{l=await a7.executeOperation(e.s.collection.client,a,s.timeoutContext)}catch(h){c=h}if(n.serializedOperations=[],c!=null)if(c instanceof We.MongoWriteConcernError){p_(n,e.s.bulkResult,c,l);let h=new zo(e.s.bulkResult,e.isOrdered);throw new jc({message:c.result.writeConcernError.errmsg,code:c.result.writeConcernError.code},h)}else throw new jc(c,new zo(e.s.bulkResult,e.isOrdered));p_(n,e.s.bulkResult,c,l);let f=new zo(e.s.bulkResult,e.isOrdered);e.handleWriteError(f)}e.s.batches.length=0;let r=new zo(e.s.bulkResult,e.isOrdered);return e.handleWriteError(r),r}class jc extends We.MongoServerError{constructor(e,t){super(e);if(this.writeErrors=[],e instanceof Oh)this.err=e;else if(!(e instanceof Error))this.message=e.message,this.code=e.code,this.writeErrors=e.writeErrors??[];this.result=t,Object.assign(this,e)}get name(){return"MongoBulkWriteError"}get insertedCount(){return this.result.insertedCount}get matchedCount(){return this.result.matchedCount}get modifiedCount(){return this.result.modifiedCount}get deletedCount(){return this.result.deletedCount}get upsertedCount(){return this.result.upsertedCount}get insertedIds(){return this.result.insertedIds}get upsertedIds(){return this.result.upsertedIds}}p7.MongoBulkWriteError=jc;class g_{constructor(e){this.bulkOperation=e}update(e){let t=Ah(this.bulkOperation);return this.bulkOperation.addToOperationsList(p7.BatchType.UPDATE,fs.makeUpdateStatement(t.selector,e,{...t,multi:!0}))}updateOne(e){if(!Fr.hasAtomicOperators(e,this.bulkOperation.bsonOptions))throw new We.MongoInvalidArgumentError("Update document requires atomic operators");let t=Ah(this.bulkOperation);return this.bulkOperation.addToOperationsList(p7.BatchType.UPDATE,fs.makeUpdateStatement(t.selector,e,{...t,multi:!1}))}replaceOne(e){if(Fr.hasAtomicOperators(e))throw new We.MongoInvalidArgumentError("Replacement document must not use atomic operators");let t=Ah(this.bulkOperation);return this.bulkOperation.addToOperationsList(p7.BatchType.UPDATE,fs.makeUpdateStatement(t.selector,e,{...t,multi:!1}))}deleteOne(){let e=Ah(this.bulkOperation);return this.bulkOperation.addToOperationsList(p7.BatchType.DELETE,to.makeDeleteStatement(e.selector,{...e,limit:1}))}delete(){let e=Ah(this.bulkOperation);return this.bulkOperation.addToOperationsList(p7.BatchType.DELETE,to.makeDeleteStatement(e.selector,{...e,limit:0}))}upsert(){if(!this.bulkOperation.s.currentOp)this.bulkOperation.s.currentOp={};return this.bulkOperation.s.currentOp.upsert=!0,this}collation(e){if(!this.bulkOperation.s.currentOp)this.bulkOperation.s.currentOp={};return this.bulkOperation.s.currentOp.collation=e,this}arrayFilters(e){if(!this.bulkOperation.s.currentOp)this.bulkOperation.s.currentOp={};return this.bulkOperation.s.currentOp.arrayFilters=e,this}hint(e){if(!this.bulkOperation.s.currentOp)this.bulkOperation.s.currentOp={};return this.bulkOperation.s.currentOp.hint=e,this}}p7.FindOperators=g_;class f7{constructor(e,t,r){this.collection=e,this.retryWrites=e.db.options?.retryWrites,this.isOrdered=r;let n=Fr.getTopology(e);t=t==null?{}:t;let s=e.s.namespace,i=!1,o=void 0,u=n.lastHello(),a=!!(n.s.options&&n.s.options.autoEncrypter),c=u&&u.maxBsonObjectSize?u.maxBsonObjectSize:16777216,l=a?2097152:c,f=u&&u.maxWriteBatchSize?u.maxWriteBatchSize:1000,h=(f-1).toString(10).length+2,d={ok:1,writeErrors:[],writeConcernErrors:[],insertedIds:[],nInserted:0,nUpserted:0,nMatched:0,nModified:0,nRemoved:0,upserted:[]};if(this.s={bulkResult:d,currentBatch:void 0,currentIndex:0,currentBatchSize:0,currentBatchSizeBytes:0,currentInsertBatch:void 0,currentUpdateBatch:void 0,currentRemoveBatch:void 0,batches:[],writeConcern:Jd.WriteConcern.fromOptions(t),maxBsonObjectSize:c,maxBatchSizeBytes:l,maxWriteBatchSize:f,maxKeySize:h,namespace:s,topology:n,options:t,bsonOptions:Xd.resolveBSONOptions(t),currentOp:o,executed:i,collection:e,err:void 0,checkKeys:typeof t.checkKeys==="boolean"?t.checkKeys:!1,usingAutoEncryption:a},t.bypassDocumentValidation===!0)this.s.bypassDocumentValidation=!0}insert(e){return Fr.maybeAddIdToDocuments(this.collection,e,{forceServerObjectId:this.shouldForceServerObjectId()}),this.addToOperationsList(p7.BatchType.INSERT,e)}find(e){if(!e)throw new We.MongoInvalidArgumentError("Bulk find operation must specify a selector");return this.s.currentOp={selector:e},new g_(this)}raw(e){if(e==null||typeof e!=="object")throw new We.MongoInvalidArgumentError("Operation must be an object with an operation key");if("insertOne"in e){let t=this.shouldForceServerObjectId(),r=e.insertOne&&e.insertOne.document==null?e.insertOne:e.insertOne.document;return Fr.maybeAddIdToDocuments(this.collection,r,{forceServerObjectId:t}),this.addToOperationsList(p7.BatchType.INSERT,r)}if("replaceOne"in e||"updateOne"in e||"updateMany"in e){if("replaceOne"in e){if("q"in e.replaceOne)throw new We.MongoInvalidArgumentError("Raw operations are not allowed");let t=fs.makeUpdateStatement(e.replaceOne.filter,e.replaceOne.replacement,{...e.replaceOne,multi:!1});if(Fr.hasAtomicOperators(t.u))throw new We.MongoInvalidArgumentError("Replacement document must not use atomic operators");return this.addToOperationsList(p7.BatchType.UPDATE,t)}if("updateOne"in e){if("q"in e.updateOne)throw new We.MongoInvalidArgumentError("Raw operations are not allowed");let t=fs.makeUpdateStatement(e.updateOne.filter,e.updateOne.update,{...e.updateOne,multi:!1});if(!Fr.hasAtomicOperators(t.u,this.bsonOptions))throw new We.MongoInvalidArgumentError("Update document requires atomic operators");return this.addToOperationsList(p7.BatchType.UPDATE,t)}if("updateMany"in e){if("q"in e.updateMany)throw new We.MongoInvalidArgumentError("Raw operations are not allowed");let t=fs.makeUpdateStatement(e.updateMany.filter,e.updateMany.update,{...e.updateMany,multi:!0});if(!Fr.hasAtomicOperators(t.u,this.bsonOptions))throw new We.MongoInvalidArgumentError("Update document requires atomic operators");return this.addToOperationsList(p7.BatchType.UPDATE,t)}}if("deleteOne"in e){if("q"in e.deleteOne)throw new We.MongoInvalidArgumentError("Raw operations are not allowed");return this.addToOperationsList(p7.BatchType.DELETE,to.makeDeleteStatement(e.deleteOne.filter,{...e.deleteOne,limit:1}))}if("deleteMany"in e){if("q"in e.deleteMany)throw new We.MongoInvalidArgumentError("Raw operations are not allowed");return this.addToOperationsList(p7.BatchType.DELETE,to.makeDeleteStatement(e.deleteMany.filter,{...e.deleteMany,limit:0}))}throw new We.MongoInvalidArgumentError("bulkWrite only supports insertOne, updateOne, updateMany, deleteOne, deleteMany")}get length(){return this.s.currentIndex}get bsonOptions(){return this.s.bsonOptions}get writeConcern(){return this.s.writeConcern}get batches(){let e=[...this.s.batches];if(this.isOrdered){if(this.s.currentBatch)e.push(this.s.currentBatch)}else{if(this.s.currentInsertBatch)e.push(this.s.currentInsertBatch);if(this.s.currentUpdateBatch)e.push(this.s.currentUpdateBatch);if(this.s.currentRemoveBatch)e.push(this.s.currentRemoveBatch)}return e}async execute(e={}){if(this.s.executed)throw new We.MongoBatchReExecutionError;let t=Jd.WriteConcern.fromOptions(e);if(t)this.s.writeConcern=t;if(this.isOrdered){if(this.s.currentBatch)this.s.batches.push(this.s.currentBatch)}else{if(this.s.currentInsertBatch)this.s.batches.push(this.s.currentInsertBatch);if(this.s.currentUpdateBatch)this.s.batches.push(this.s.currentUpdateBatch);if(this.s.currentRemoveBatch)this.s.batches.push(this.s.currentRemoveBatch)}if(this.s.batches.length===0)throw new We.MongoInvalidArgumentError("Invalid BulkOperation, Batch cannot be empty");this.s.executed=!0;let r=Fr.resolveOptions(this.collection,{...this.s.options,...e});if(r.timeoutContext??=l7.TimeoutContext.create({session:r.session,timeoutMS:r.timeoutMS,serverSelectionTimeoutMS:this.collection.client.s.options.serverSelectionTimeoutMS,waitQueueTimeoutMS:this.collection.client.s.options.waitQueueTimeoutMS}),r.session==null)return await this.collection.client.withSession({explicit:!1},async(n)=>await u7(this,{...r,session:n}));return await u7(this,{...r})}handleWriteError(e){if(this.s.bulkResult.writeErrors.length>0){let r=this.s.bulkResult.writeErrors[0].errmsg?this.s.bulkResult.writeErrors[0].errmsg:"write operation failed";throw new jc({message:r,code:this.s.bulkResult.writeErrors[0].code,writeErrors:this.s.bulkResult.writeErrors},e)}let t=e.getWriteConcernError();if(t)throw new jc(t,e)}shouldForceServerObjectId(){return this.s.options.forceServerObjectId===!0||this.s.collection.db.options?.forceServerObjectId===!0}}p7.BulkOperationBase=f7;function d7(e){return e.batchType===p7.BatchType.INSERT}function m_(e){return e.batchType===p7.BatchType.UPDATE}function y_(e){return e.batchType===p7.BatchType.DELETE}function Ah(e){let{currentOp:t}=e.s;if(e.s.currentOp=void 0,!t)t={};return t}});var g7=g(function(r9e,y7){var Jie=Lc().BulkWriteResult;y7.exports=Jie});var Ou=g(function(n9e,_7){/*!
9
- * Centralize this so we can more easily work around issues with people
10
- * stubbing out `process.nextTick()` in tests using sinon:
11
- * https://github.com/sinonjs/lolex#automatically-incrementing-mocked-time
12
- * See gh-6074
13
- */var Qie=typeof process<"u"&&typeof process.nextTick==="function"?process.nextTick.bind(process):(e)=>setTimeout(e,0);_7.exports=function(t){return Qie(t)}});var __=g(function(s9e,A7){/*!
14
- * Module dependencies.
15
- */var Xie=G("events").EventEmitter,E7=Ou();function Tt(e,t,r){if(r===void 0)r={};if(this.opts=r,this.name=e,this.collectionName=e,this.conn=t,this.queue=[],this.buffer=!t?._hasOpened,this.emitter=new Xie,t?._hasOpened)this.onOpen()}Tt.prototype.name;Tt.prototype.collectionName;Tt.prototype.conn;Tt.prototype.onOpen=function(){this.buffer=!1,E7(()=>this.doQueue())};Tt.prototype.onClose=function(){};Tt.prototype.addQueue=function(e,t){return this.queue.push([e,t]),this};Tt.prototype.removeQueue=function(e,t){let r=this.queue.findIndex((n)=>n[0]===e&&n[1]===t);if(r===-1)return!1;return this.queue.splice(r,1),!0};Tt.prototype.doQueue=function(){for(let t of this.queue)if(typeof t[0]==="function")t[0].apply(this,t[1]);else this[t[0]].apply(this,t[1]);this.queue=[];let e=this;return E7(function(){e.emitter.emit("queue")}),this};Tt.prototype.ensureIndex=function(){throw Error("Collection#ensureIndex unimplemented by driver")};Tt.prototype.createIndex=function(){throw Error("Collection#createIndex unimplemented by driver")};Tt.prototype.findAndModify=function(){throw Error("Collection#findAndModify unimplemented by driver")};Tt.prototype.findOneAndUpdate=function(){throw Error("Collection#findOneAndUpdate unimplemented by driver")};Tt.prototype.findOneAndDelete=function(){throw Error("Collection#findOneAndDelete unimplemented by driver")};Tt.prototype.findOneAndReplace=function(){throw Error("Collection#findOneAndReplace unimplemented by driver")};Tt.prototype.findOne=function(){throw Error("Collection#findOne unimplemented by driver")};Tt.prototype.find=function(){throw Error("Collection#find unimplemented by driver")};Tt.prototype.insert=function(){throw Error("Collection#insert unimplemented by driver")};Tt.prototype.insertOne=function(){throw Error("Collection#insertOne unimplemented by driver")};Tt.prototype.insertMany=function(){throw Error("Collection#insertMany unimplemented by driver")};Tt.prototype.save=function(){throw Error("Collection#save unimplemented by driver")};Tt.prototype.updateOne=function(){throw Error("Collection#updateOne unimplemented by driver")};Tt.prototype.updateMany=function(){throw Error("Collection#updateMany unimplemented by driver")};Tt.prototype.deleteOne=function(){throw Error("Collection#deleteOne unimplemented by driver")};Tt.prototype.deleteMany=function(){throw Error("Collection#deleteMany unimplemented by driver")};Tt.prototype.getIndexes=function(){throw Error("Collection#getIndexes unimplemented by driver")};Tt.prototype.watch=function(){throw Error("Collection#watch unimplemented by driver")};/*!
16
- * ignore
17
- */Tt.prototype._shouldBufferCommands=function(){let t=this.opts;if(t.bufferCommands!=null)return t.bufferCommands;if(t?.schemaUserProvidedOptions?.bufferCommands!=null)return t.schemaUserProvidedOptions.bufferCommands;return this.conn._shouldBufferCommands()};/*!
18
- * ignore
19
- */Tt.prototype._getBufferTimeoutMS=function(){let t=this.conn,r=this.opts;if(r.bufferTimeoutMS!=null)return r.bufferTimeoutMS;if(r?.schemaUserProvidedOptions?.bufferTimeoutMS!=null)return r.schemaUserProvidedOptions.bufferTimeoutMS;return t._getBufferTimeoutMS()};/*!
20
- * Module exports.
21
- */A7.exports=Tt});var Le=g(function(i9e,O7){/*!
22
- * ignore
23
- */class E_ extends Error{}Object.defineProperty(E_.prototype,"name",{value:"MongooseError"});O7.exports=E_});var T7=g(function(b7){Object.defineProperty(b7,"__esModule",{value:!0});b7.ListDatabasesOperation=void 0;var S7=dt(),w7=ae(),C7=nr(),Uc=Mt();class A_ extends C7.CommandOperation{constructor(e,t){super(e,t);this.SERVER_COMMAND_RESPONSE_TYPE=S7.MongoDBResponse,this.options=t??{},this.ns=new w7.MongoDBNamespace("admin","$cmd")}get commandName(){return"listDatabases"}buildCommandDocument(e,t){let r={listDatabases:1};if(typeof this.options.nameOnly==="boolean")r.nameOnly=this.options.nameOnly;if(this.options.filter)r.filter=this.options.filter;if(typeof this.options.authorizedDatabases==="boolean")r.authorizedDatabases=this.options.authorizedDatabases;if(this.options.comment!==void 0)r.comment=this.options.comment;return r}}b7.ListDatabasesOperation=A_;Uc.defineAspects(A_,[Uc.Aspect.READ_OPERATION,Uc.Aspect.RETRYABLE])});var S_=g(function(P7){Object.defineProperty(P7,"__esModule",{value:!0});P7.RemoveUserOperation=void 0;var M7=dt(),x7=nr(),Zd=Mt();class O_ extends x7.CommandOperation{constructor(e,t,r){super(e,r);this.SERVER_COMMAND_RESPONSE_TYPE=M7.MongoDBResponse,this.options=r,this.username=t}get commandName(){return"dropUser"}buildCommandDocument(e){return{dropUser:this.username}}handleOk(e){return!0}}P7.RemoveUserOperation=O_;Zd.defineAspects(O_,[Zd.Aspect.WRITE_OPERATION])});var v7=g(function(R7){Object.defineProperty(R7,"__esModule",{value:!0});R7.ValidateCollectionOperation=void 0;var F7=dt(),Vc=Q(),N7=nr();class I7 extends N7.CommandOperation{constructor(e,t,r){super(e.s.db,r);this.SERVER_COMMAND_RESPONSE_TYPE=F7.MongoDBResponse,this.options=r,this.collectionName=t}get commandName(){return"validate"}buildCommandDocument(e,t){return{validate:this.collectionName,...Object.fromEntries(Object.entries(this.options).filter((r)=>r[0]!=="session"))}}handleOk(e){let t=super.handleOk(e);if(t.result!=null&&typeof t.result!=="string")throw new Vc.MongoUnexpectedServerResponseError("Error with validation data");if(t.result!=null&&t.result.match(/exception|corrupt/)!=null)throw new Vc.MongoUnexpectedServerResponseError(`Invalid collection ${this.collectionName}`);if(t.valid!=null&&!t.valid)throw new Vc.MongoUnexpectedServerResponseError(`Invalid collection ${this.collectionName}`);return e}}R7.ValidateCollectionOperation=I7});var w_=g(function(W7){Object.defineProperty(W7,"__esModule",{value:!0});W7.Admin=void 0;var k7=we(),Su=Kr(),q7=T7(),j7=S_(),L7=Rc(),U7=v7(),V7=ae();class z7{constructor(e){this.s={db:e}}async command(e,t){return await Su.executeOperation(this.s.db.client,new L7.RunCommandOperation(new V7.MongoDBNamespace("admin"),e,{...k7.resolveBSONOptions(t),session:t?.session,readPreference:t?.readPreference,timeoutMS:t?.timeoutMS??this.s.db.timeoutMS}))}async buildInfo(e){return await this.command({buildinfo:1},e)}async serverInfo(e){return await this.command({buildinfo:1},e)}async serverStatus(e){return await this.command({serverStatus:1},e)}async ping(e){return await this.command({ping:1},e)}async removeUser(e,t){return await Su.executeOperation(this.s.db.client,new j7.RemoveUserOperation(this.s.db,e,{dbName:"admin",...t}))}async validateCollection(e,t={}){return await Su.executeOperation(this.s.db.client,new U7.ValidateCollectionOperation(this,e,t))}async listDatabases(e){return await Su.executeOperation(this.s.db.client,new q7.ListDatabasesOperation(this.s.db,{timeoutMS:this.s.db.timeoutMS,...e}))}async replSetGetStatus(e){return await this.command({replSetGetStatus:1},e)}}W7.Admin=z7});var C_=g(function(G7){Object.defineProperty(G7,"__esModule",{value:!0});G7.OrderedBulkOperation=void 0;var ep=we(),tp=Q(),wu=Lc();class K7 extends wu.BulkOperationBase{constructor(e,t){super(e,t,!0)}addToOperationsList(e,t){let r,n;if(this.s.usingAutoEncryption)n=ep.calculateObjectSize(t,{checkKeys:!1,ignoreUndefined:!1});else{let i=this.s.bsonOptions;r=ep.serialize(t,{checkKeys:this.s.checkKeys,ignoreUndefined:i.ignoreUndefined,serializeFunctions:i.serializeFunctions}),n=r.length}if(n>=this.s.maxBsonObjectSize)throw new tp.MongoInvalidArgumentError(`Document is larger than the maximum size ${this.s.maxBsonObjectSize}`);if(this.s.currentBatch==null)this.s.currentBatch=new wu.Batch(e,this.s.currentIndex);let s=this.s.maxKeySize;if(this.s.currentBatchSize+1>=this.s.maxWriteBatchSize||this.s.currentBatchSize>0&&this.s.currentBatchSizeBytes+s+n>=this.s.maxBatchSizeBytes||this.s.currentBatch.batchType!==e)this.s.batches.push(this.s.currentBatch),this.s.currentBatch=new wu.Batch(e,this.s.currentIndex),this.s.currentBatchSize=0,this.s.currentBatchSizeBytes=0;if(e===wu.BatchType.INSERT)this.s.bulkResult.insertedIds.push({index:this.s.currentIndex,_id:t._id});if(Array.isArray(t))throw new tp.MongoInvalidArgumentError("Operation passed in cannot be an Array");if(this.s.currentBatch.originalIndexes.push(this.s.currentIndex),this.s.currentBatch.operations.push(t),r!=null)this.s.currentBatch.serializedOperations.push(r);return this.s.currentBatchSize+=1,this.s.currentBatchSizeBytes+=s+n,this.s.currentIndex+=1,this}}G7.OrderedBulkOperation=K7});var b_=g(function(Q7){Object.defineProperty(Q7,"__esModule",{value:!0});Q7.UnorderedBulkOperation=void 0;var rp=we(),np=Q(),Gr=Lc();class J7 extends Gr.BulkOperationBase{constructor(e,t){super(e,t,!1)}handleWriteError(e){if(this.s.batches.length)return;return super.handleWriteError(e)}addToOperationsList(e,t){let r,n;if(this.s.usingAutoEncryption)n=rp.calculateObjectSize(t,{checkKeys:!1,ignoreUndefined:!1});else{let i=this.s.bsonOptions;r=rp.serialize(t,{checkKeys:this.s.checkKeys,ignoreUndefined:i.ignoreUndefined,serializeFunctions:i.serializeFunctions}),n=r.length}if(n>=this.s.maxBsonObjectSize)throw new np.MongoInvalidArgumentError(`Document is larger than the maximum size ${this.s.maxBsonObjectSize}`);if(this.s.currentBatch=void 0,e===Gr.BatchType.INSERT)this.s.currentBatch=this.s.currentInsertBatch;else if(e===Gr.BatchType.UPDATE)this.s.currentBatch=this.s.currentUpdateBatch;else if(e===Gr.BatchType.DELETE)this.s.currentBatch=this.s.currentRemoveBatch;let s=this.s.maxKeySize;if(this.s.currentBatch==null)this.s.currentBatch=new Gr.Batch(e,this.s.currentIndex);if(this.s.currentBatch.size+1>=this.s.maxWriteBatchSize||this.s.currentBatch.size>0&&this.s.currentBatch.sizeBytes+s+n>=this.s.maxBatchSizeBytes||this.s.currentBatch.batchType!==e)this.s.batches.push(this.s.currentBatch),this.s.currentBatch=new Gr.Batch(e,this.s.currentIndex);if(Array.isArray(t))throw new np.MongoInvalidArgumentError("Operation passed in cannot be an Array");if(this.s.currentBatch.operations.push(t),r!=null)this.s.currentBatch.serializedOperations.push(r);if(this.s.currentBatch.originalIndexes.push(this.s.currentIndex),this.s.currentIndex=this.s.currentIndex+1,e===Gr.BatchType.INSERT)this.s.currentInsertBatch=this.s.currentBatch,this.s.bulkResult.insertedIds.push({index:this.s.currentIndex-1,_id:t._id});else if(e===Gr.BatchType.UPDATE)this.s.currentUpdateBatch=this.s.currentBatch;else if(e===Gr.BatchType.DELETE)this.s.currentRemoveBatch=this.s.currentBatch;return this.s.currentBatch.size+=1,this.s.currentBatch.sizeBytes+=s+n,this}}Q7.UnorderedBulkOperation=J7});var Du=g(function(n8){Object.defineProperty(n8,"__esModule",{value:!0});n8.MongoLogger=n8.MongoLoggableComponent=n8.SEVERITY_LEVEL_MAP=n8.DEFAULT_MAX_DOCUMENT_LENGTH=n8.SeverityLevel=void 0;n8.parseSeverityFromString=M_;n8.createStdioLogger=Ia;n8.stringifyWithMaxLen=bu;n8.defaultLogTransform=t8;var Ys=G("process"),Z7=G("util"),op=we(),Ce=Or(),ds=ae();n8.SeverityLevel=Object.freeze({EMERGENCY:"emergency",ALERT:"alert",CRITICAL:"critical",ERROR:"error",WARNING:"warn",NOTICE:"notice",INFORMATIONAL:"info",DEBUG:"debug",TRACE:"trace",OFF:"off"});n8.DEFAULT_MAX_DOCUMENT_LENGTH=1000;class e8 extends Map{constructor(e){let t=[];for(let[r,n]of e)t.push([n,r]);t.push(...e);super(t)}getNumericSeverityLevel(e){return this.get(e)}getSeverityLevelName(e){return this.get(e)}}n8.SEVERITY_LEVEL_MAP=new e8([[n8.SeverityLevel.OFF,-1/0],[n8.SeverityLevel.EMERGENCY,0],[n8.SeverityLevel.ALERT,1],[n8.SeverityLevel.CRITICAL,2],[n8.SeverityLevel.ERROR,3],[n8.SeverityLevel.WARNING,4],[n8.SeverityLevel.NOTICE,5],[n8.SeverityLevel.INFORMATIONAL,6],[n8.SeverityLevel.DEBUG,7],[n8.SeverityLevel.TRACE,8]]);n8.MongoLoggableComponent=Object.freeze({COMMAND:"command",TOPOLOGY:"topology",SERVER_SELECTION:"serverSelection",CONNECTION:"connection",CLIENT:"client"});function M_(e){let t=Object.values(n8.SeverityLevel),r=e?.toLowerCase();if(r!=null&&t.includes(r))return r;return null}function Ia(e){return{write:(t)=>new Promise((r,n)=>{let s=Z7.inspect(t,{compact:!0,breakLength:1/0});e.write(`${s}
24
- `,"utf-8",(i)=>{if(i)return n(i);r(!0)})})}}function Zie({MONGODB_LOG_PATH:e},{mongodbLogPath:t}){if(typeof t==="string"&&/^stderr$/i.test(t))return{mongodbLogPath:Ia(Ys.stderr),mongodbLogPathIsStdErr:!0};if(typeof t==="string"&&/^stdout$/i.test(t))return{mongodbLogPath:Ia(Ys.stdout),mongodbLogPathIsStdErr:!1};if(typeof t==="object"&&typeof t?.write==="function")return{mongodbLogPath:t,mongodbLogPathIsStdErr:!1};if(e&&/^stderr$/i.test(e))return{mongodbLogPath:Ia(Ys.stderr),mongodbLogPathIsStdErr:!0};if(e&&/^stdout$/i.test(e))return{mongodbLogPath:Ia(Ys.stdout),mongodbLogPathIsStdErr:!1};return{mongodbLogPath:Ia(Ys.stderr),mongodbLogPathIsStdErr:!0}}function zc(e,t,r){return M_(e)??M_(t)??r}function eoe(e,t){let r=n8.SEVERITY_LEVEL_MAP.getNumericSeverityLevel(e),n=n8.SEVERITY_LEVEL_MAP.getNumericSeverityLevel(t);return r<n?-1:r>n?1:0}function bu(e,t,r={}){let n="",s=0,i=function(u,a){if(s>=t)return;if(u==="")return s+=1,a;if(s+=u.length+4,a==null)return a;switch(typeof a){case"string":s+=a.length+2;break;case"number":case"bigint":s+=String(a).length;break;case"boolean":s+=a?4:5;break;case"object":if(ds.isUint8Array(a))s+=22+a.byteLength+a.byteLength*0.33+18|0;else if("_bsontype"in a){let c=a;switch(c._bsontype){case"Int32":s+=String(c.value).length;break;case"Double":s+=(c.value|0)===c.value?String(c.value).length+2:String(c.value).length;break;case"Long":s+=c.toString().length;break;case"ObjectId":s+=35;break;case"MaxKey":case"MinKey":s+=13;break;case"Binary":s+=22+a.position+a.position*0.33+18|0;break;case"Timestamp":s+=19+String(c.t).length+5+String(c.i).length+2;break;case"Code":if(c.scope==null)s+=c.code.length+10+2;else s+=c.code.length+10+11;break;case"BSONRegExp":s+=34+c.pattern.length+13+c.options.length+3;break}}}return a};if(typeof e==="string")n=e;else if(typeof e==="function")n=e.name;else try{if(t!==0)n=op.EJSON.stringify(e,i,0,r);else n=op.EJSON.stringify(e,r)}catch(o){n=`Extended JSON serialization failed with: ${o.message}`}if(t!==0&&n.length>t&&n.charCodeAt(t-1)!==n.codePointAt(t-1)){if(t--,t===0)return""}return t!==0&&n.length>t?`${n.slice(0,t)}...`:n}function toe(e){let t=e;return t.toLog!==void 0&&typeof t.toLog==="function"}function sp(e,t,r=n8.DEFAULT_MAX_DOCUMENT_LENGTH){let{selector:n,operation:s,topologyDescription:i,message:o}=t;return e.selector=bu(n,r),e.operation=s,e.topologyDescription=bu(i,r),e.message=o,e}function D_(e,t){e.commandName=t.commandName,e.requestId=t.requestId,e.driverConnectionId=t.connectionId;let{host:r,port:n}=ds.HostAddress.fromString(t.address).toHostPort();if(e.serverHost=r,e.serverPort=n,t?.serviceId)e.serviceId=t.serviceId.toHexString();return e.databaseName=t.databaseName,e.serverConnectionId=t.serverConnectionId,e}function Ns(e,t){let{host:r,port:n}=ds.HostAddress.fromString(t.address).toHostPort();return e.serverHost=r,e.serverPort=n,e}function Cu(e,t){return e.topologyId=t.topologyId,e}function T_(e,t){let{awaited:r,connectionId:n}=t;e.awaited=r,e.driverConnectionId=t.connectionId;let{host:s,port:i}=ds.HostAddress.fromString(n).toHostPort();return e.serverHost=s,e.serverPort=i,e}function t8(e,t=n8.DEFAULT_MAX_DOCUMENT_LENGTH){let r=Object.create(null);switch(e.name){case Ce.SERVER_SELECTION_STARTED:return r=sp(r,e,t),r;case Ce.SERVER_SELECTION_FAILED:return r=sp(r,e,t),r.failure=e.failure?.message,r;case Ce.SERVER_SELECTION_SUCCEEDED:return r=sp(r,e,t),r.serverHost=e.serverHost,r.serverPort=e.serverPort,r;case Ce.WAITING_FOR_SUITABLE_SERVER:return r=sp(r,e,t),r.remainingTimeMS=e.remainingTimeMS,r;case Ce.COMMAND_STARTED:return r=D_(r,e),r.message="Command started",r.command=bu(e.command,t,{relaxed:!0}),r.databaseName=e.databaseName,r;case Ce.COMMAND_SUCCEEDED:return r=D_(r,e),r.message="Command succeeded",r.durationMS=e.duration,r.reply=bu(e.reply,t,{relaxed:!0}),r;case Ce.COMMAND_FAILED:return r=D_(r,e),r.message="Command failed",r.durationMS=e.duration,r.failure=e.failure?.message??"(redacted)",r;case Ce.CONNECTION_POOL_CREATED:if(r=Ns(r,e),r.message="Connection pool created",e.options){let{maxIdleTimeMS:n,minPoolSize:s,maxPoolSize:i,maxConnecting:o,waitQueueTimeoutMS:u}=e.options;r={...r,maxIdleTimeMS:n,minPoolSize:s,maxPoolSize:i,maxConnecting:o,waitQueueTimeoutMS:u}}return r;case Ce.CONNECTION_POOL_READY:return r=Ns(r,e),r.message="Connection pool ready",r;case Ce.CONNECTION_POOL_CLEARED:if(r=Ns(r,e),r.message="Connection pool cleared",e.serviceId?._bsontype==="ObjectId")r.serviceId=e.serviceId?.toHexString();return r;case Ce.CONNECTION_POOL_CLOSED:return r=Ns(r,e),r.message="Connection pool closed",r;case Ce.CONNECTION_CREATED:return r=Ns(r,e),r.message="Connection created",r.driverConnectionId=e.connectionId,r;case Ce.CONNECTION_READY:return r=Ns(r,e),r.message="Connection ready",r.driverConnectionId=e.connectionId,r.durationMS=e.durationMS,r;case Ce.CONNECTION_CLOSED:switch(r=Ns(r,e),r.message="Connection closed",r.driverConnectionId=e.connectionId,e.reason){case"stale":r.reason="Connection became stale because the pool was cleared";break;case"idle":r.reason="Connection has been available but unused for longer than the configured max idle time";break;case"error":if(r.reason="An error occurred while using the connection",e.error)r.error=e.error;break;case"poolClosed":r.reason="Connection pool was closed";break;default:r.reason=`Unknown close reason: ${e.reason}`}return r;case Ce.CONNECTION_CHECK_OUT_STARTED:return r=Ns(r,e),r.message="Connection checkout started",r;case Ce.CONNECTION_CHECK_OUT_FAILED:switch(r=Ns(r,e),r.message="Connection checkout failed",e.reason){case"poolClosed":r.reason="Connection pool was closed";break;case"timeout":r.reason="Wait queue timeout elapsed without a connection becoming available";break;case"connectionError":if(r.reason="An error occurred while trying to establish a new connection",e.error)r.error=e.error;break;default:r.reason=`Unknown close reason: ${e.reason}`}return r.durationMS=e.durationMS,r;case Ce.CONNECTION_CHECKED_OUT:return r=Ns(r,e),r.message="Connection checked out",r.driverConnectionId=e.connectionId,r.durationMS=e.durationMS,r;case Ce.CONNECTION_CHECKED_IN:return r=Ns(r,e),r.message="Connection checked in",r.driverConnectionId=e.connectionId,r;case Ce.SERVER_OPENING:return r=Cu(r,e),r=Ns(r,e),r.message="Starting server monitoring",r;case Ce.SERVER_CLOSED:return r=Cu(r,e),r=Ns(r,e),r.message="Stopped server monitoring",r;case Ce.SERVER_HEARTBEAT_STARTED:return r=Cu(r,e),r=T_(r,e),r.message="Server heartbeat started",r;case Ce.SERVER_HEARTBEAT_SUCCEEDED:return r=Cu(r,e),r=T_(r,e),r.message="Server heartbeat succeeded",r.durationMS=e.duration,r.serverConnectionId=e.serverConnectionId,r.reply=bu(e.reply,t,{relaxed:!0}),r;case Ce.SERVER_HEARTBEAT_FAILED:return r=Cu(r,e),r=T_(r,e),r.message="Server heartbeat failed",r.durationMS=e.duration,r.failure=e.failure?.message,r;case Ce.TOPOLOGY_OPENING:return r=Cu(r,e),r.message="Starting topology monitoring",r;case Ce.TOPOLOGY_CLOSED:return r=Cu(r,e),r.message="Stopped topology monitoring",r;case Ce.TOPOLOGY_DESCRIPTION_CHANGED:return r=Cu(r,e),r.message="Topology description changed",r.previousDescription=r.reply=bu(e.previousDescription,t),r.newDescription=r.reply=bu(e.newDescription,t),r;default:for(let[n,s]of Object.entries(e))if(s!=null)r[n]=s}return r}class r8{constructor(e){this.pendingLog=null,this.error=this.log.bind(this,"error"),this.warn=this.log.bind(this,"warn"),this.info=this.log.bind(this,"info"),this.debug=this.log.bind(this,"debug"),this.trace=this.log.bind(this,"trace"),this.componentSeverities=e.componentSeverities,this.maxDocumentLength=e.maxDocumentLength,this.logDestination=e.logDestination,this.logDestinationIsStdErr=e.logDestinationIsStdErr,this.severities=this.createLoggingSeverities()}createLoggingSeverities(){let e=Object();for(let t of Object.values(n8.MongoLoggableComponent)){e[t]={};for(let r of Object.values(n8.SeverityLevel))e[t][r]=eoe(r,this.componentSeverities[t])<=0}return e}turnOffSeverities(){for(let e of Object.values(n8.MongoLoggableComponent)){this.componentSeverities[e]=n8.SeverityLevel.OFF;for(let t of Object.values(n8.SeverityLevel))this.severities[e][t]=!1}}logWriteFailureHandler(e){if(this.logDestinationIsStdErr){this.turnOffSeverities(),this.clearPendingLog();return}this.logDestination=Ia(Ys.stderr),this.logDestinationIsStdErr=!0,this.clearPendingLog(),this.error(n8.MongoLoggableComponent.CLIENT,{toLog:function(){return{message:"User input for mongodbLogPath is now invalid. Logging is halted.",error:e.message}}}),this.turnOffSeverities(),this.clearPendingLog()}clearPendingLog(){this.pendingLog=null}willLog(e,t){if(t===n8.SeverityLevel.OFF)return!1;return this.severities[e][t]}log(e,t,r){if(!this.willLog(t,e))return;let n={t:new Date,c:t,s:e};if(typeof r==="string")n.message=r;else if(typeof r==="object")if(toe(r))n={...n,...r.toLog()};else n={...n,...t8(r,this.maxDocumentLength)};if(ds.isPromiseLike(this.pendingLog)){this.pendingLog=this.pendingLog.then(()=>this.logDestination.write(n)).then(this.clearPendingLog.bind(this),this.logWriteFailureHandler.bind(this));return}try{let s=this.logDestination.write(n);if(ds.isPromiseLike(s))this.pendingLog=s.then(this.clearPendingLog.bind(this),this.logWriteFailureHandler.bind(this))}catch(s){this.logWriteFailureHandler(s)}}static resolveOptions(e,t){let r=Zie(e,t),n={...e,...t,mongodbLogPath:r.mongodbLogPath,mongodbLogPathIsStdErr:r.mongodbLogPathIsStdErr},s=zc(n.mongodbLogComponentSeverities?.default,n.MONGODB_LOG_ALL,n8.SeverityLevel.OFF);return{componentSeverities:{command:zc(n.mongodbLogComponentSeverities?.command,n.MONGODB_LOG_COMMAND,s),topology:zc(n.mongodbLogComponentSeverities?.topology,n.MONGODB_LOG_TOPOLOGY,s),serverSelection:zc(n.mongodbLogComponentSeverities?.serverSelection,n.MONGODB_LOG_SERVER_SELECTION,s),connection:zc(n.mongodbLogComponentSeverities?.connection,n.MONGODB_LOG_CONNECTION,s),client:zc(n.mongodbLogComponentSeverities?.client,n.MONGODB_LOG_CLIENT,s),default:s},maxDocumentLength:n.mongodbLogMaxDocumentLength??ds.parseUnsignedInteger(n.MONGODB_LOG_MAX_DOCUMENT_LENGTH)??1000,logDestination:n.mongodbLogPath,logDestinationIsStdErr:n.mongodbLogPathIsStdErr}}}n8.MongoLogger=r8});var Is=g(function(c8){Object.defineProperty(c8,"__esModule",{value:!0});c8.CancellationToken=c8.TypedEventEmitter=void 0;var i8=G("events"),o8=Du(),u8=ae();class B_ extends i8.EventEmitter{emitAndLog(e,...t){if(this.emit(e,...t),this.component)this.mongoLogger?.debug(this.component,t[0])}emitAndLogHeartbeat(e,t,r,...n){if(this.emit(e,...n),this.component){let s={topologyId:t,serverConnectionId:r??null,...n[0]};this.mongoLogger?.debug(this.component,s)}}emitAndLogCommand(e,t,r,n,...s){if(e)this.emit(t,...s);if(n){let i={databaseName:r,...s[0]};this.mongoLogger?.debug(o8.MongoLoggableComponent.COMMAND,i)}}}c8.TypedEventEmitter=B_;class a8 extends B_{constructor(...e){super(...e);this.on("error",u8.noop)}}c8.CancellationToken=a8});var N_=g(function(f8){Object.defineProperty(f8,"__esModule",{value:!0});f8.GetMoreOperation=void 0;var h8=dt(),up=Q(),Tu=Mt();class F_ extends Tu.AbstractOperation{constructor(e,t,r,n){super(n);this.SERVER_COMMAND_RESPONSE_TYPE=h8.CursorResponse,this.options=n,this.ns=e,this.cursorId=t,this.server=r}get commandName(){return"getMore"}buildCommand(e){if(this.cursorId==null||this.cursorId.isZero())throw new up.MongoRuntimeError("Unable to iterate cursor with no id");let t=this.ns.collection;if(t==null)throw new up.MongoRuntimeError("A collection name must be determined before getMore");let r={getMore:this.cursorId,collection:t};if(typeof this.options.batchSize==="number")r.batchSize=Math.abs(this.options.batchSize);if(typeof this.options.maxAwaitTimeMS==="number")r.maxTimeMS=this.options.maxAwaitTimeMS;if(this.options.comment!==void 0)r.comment=this.options.comment;return r}buildOptions(e){return{returnFieldSelector:null,documentsReturnedIn:"nextBatch",timeoutContext:e,...this.options}}handleOk(e){return e}}f8.GetMoreOperation=F_;Tu.defineAspects(F_,[Tu.Aspect.READ_OPERATION,Tu.Aspect.MUST_SELECT_SAME_SERVER])});var _8=g(function(y8){Object.defineProperty(y8,"__esModule",{value:!0});y8.KillCursorsOperation=void 0;var p8=dt(),m8=Q(),Wc=Mt();class I_ extends Wc.AbstractOperation{constructor(e,t,r,n){super(n);this.SERVER_COMMAND_RESPONSE_TYPE=p8.MongoDBResponse,this.ns=t,this.cursorId=e,this.server=r}get commandName(){return"killCursors"}buildCommand(e,t){let r=this.ns.collection;if(r==null)throw new m8.MongoRuntimeError("A collection name must be determined before killCursors");return{killCursors:r,cursors:[this.cursorId]}}buildOptions(e){return{session:this.session,timeoutContext:e}}handleError(e){}}y8.KillCursorsOperation=I_;Wc.defineAspects(I_,[Wc.Aspect.MUST_SELECT_SAME_SERVER])});var R_=g(function(E8){Object.defineProperty(E8,"__esModule",{value:!0});E8.ConnectionPoolMetrics=void 0;class Hc{constructor(){this.txnConnections=0,this.cursorConnections=0,this.otherConnections=0}static{this.TXN="txn"}static{this.CURSOR="cursor"}static{this.OTHER="other"}markPinned(e){if(e===Hc.TXN)this.txnConnections+=1;else if(e===Hc.CURSOR)this.cursorConnections+=1;else this.otherConnections+=1}markUnpinned(e){if(e===Hc.TXN)this.txnConnections-=1;else if(e===Hc.CURSOR)this.cursorConnections-=1;else this.otherConnections-=1}info(e){return`Timed out while checking out a connection from connection pool: maxPoolSize: ${e}, connections in use by cursors: ${this.cursorConnections}, connections in use by transactions: ${this.txnConnections}, connections in use by other operations: ${this.otherConnections}`}reset(){this.txnConnections=0,this.cursorConnections=0,this.otherConnections=0}}E8.ConnectionPoolMetrics=Hc});var $_=g(function(b8){Object.defineProperty(b8,"__esModule",{value:!0});b8.Transaction=b8.TxnState=void 0;b8.isTransactionCommand=loe;var ap=Q(),O8=vi(),S8=Ur(),w8=Kn();b8.TxnState=Object.freeze({NO_TRANSACTION:"NO_TRANSACTION",STARTING_TRANSACTION:"STARTING_TRANSACTION",TRANSACTION_IN_PROGRESS:"TRANSACTION_IN_PROGRESS",TRANSACTION_COMMITTED:"TRANSACTION_COMMITTED",TRANSACTION_COMMITTED_EMPTY:"TRANSACTION_COMMITTED_EMPTY",TRANSACTION_ABORTED:"TRANSACTION_ABORTED"});var uoe={[b8.TxnState.NO_TRANSACTION]:[b8.TxnState.NO_TRANSACTION,b8.TxnState.STARTING_TRANSACTION],[b8.TxnState.STARTING_TRANSACTION]:[b8.TxnState.TRANSACTION_IN_PROGRESS,b8.TxnState.TRANSACTION_COMMITTED,b8.TxnState.TRANSACTION_COMMITTED_EMPTY,b8.TxnState.TRANSACTION_ABORTED],[b8.TxnState.TRANSACTION_IN_PROGRESS]:[b8.TxnState.TRANSACTION_IN_PROGRESS,b8.TxnState.TRANSACTION_COMMITTED,b8.TxnState.TRANSACTION_ABORTED],[b8.TxnState.TRANSACTION_COMMITTED]:[b8.TxnState.TRANSACTION_COMMITTED,b8.TxnState.TRANSACTION_COMMITTED_EMPTY,b8.TxnState.STARTING_TRANSACTION,b8.TxnState.NO_TRANSACTION],[b8.TxnState.TRANSACTION_ABORTED]:[b8.TxnState.STARTING_TRANSACTION,b8.TxnState.NO_TRANSACTION],[b8.TxnState.TRANSACTION_COMMITTED_EMPTY]:[b8.TxnState.TRANSACTION_COMMITTED_EMPTY,b8.TxnState.NO_TRANSACTION]},aoe=new Set([b8.TxnState.STARTING_TRANSACTION,b8.TxnState.TRANSACTION_IN_PROGRESS]),coe=new Set([b8.TxnState.TRANSACTION_COMMITTED,b8.TxnState.TRANSACTION_COMMITTED_EMPTY,b8.TxnState.TRANSACTION_ABORTED]);class C8{constructor(e){e=e??{},this.state=b8.TxnState.NO_TRANSACTION,this.options={};let t=w8.WriteConcern.fromOptions(e);if(t){if(t.w===0)throw new ap.MongoTransactionError("Transactions do not support unacknowledged write concern");this.options.writeConcern=t}if(e.readConcern)this.options.readConcern=O8.ReadConcern.fromOptions(e);if(e.readPreference)this.options.readPreference=S8.ReadPreference.fromOptions(e);if(e.maxCommitTimeMS)this.options.maxTimeMS=e.maxCommitTimeMS;this._pinnedServer=void 0,this._recoveryToken=void 0}get server(){return this._pinnedServer}get recoveryToken(){return this._recoveryToken}get isPinned(){return!!this.server}get isStarting(){return this.state===b8.TxnState.STARTING_TRANSACTION}get isActive(){return aoe.has(this.state)}get isCommitted(){return coe.has(this.state)}transition(e){let t=uoe[this.state];if(t&&t.includes(e)){if(this.state=e,this.state===b8.TxnState.NO_TRANSACTION||this.state===b8.TxnState.STARTING_TRANSACTION||this.state===b8.TxnState.TRANSACTION_ABORTED)this.unpinServer();return}throw new ap.MongoRuntimeError(`Attempted illegal state transition from [${this.state}] to [${e}]`)}pinServer(e){if(this.isActive)this._pinnedServer=e}unpinServer(){this._pinnedServer=void 0}}b8.Transaction=C8;function loe(e){return!!(e.commitTransaction||e.abortTransaction)}});var Sh=g(function(N8){Object.defineProperty(N8,"__esModule",{value:!0});N8.ServerSessionPool=N8.ServerSession=N8.ClientSession=void 0;N8.maybeClearPinnedConnection=cp;N8.applySession=doe;N8.updateSessionFromResponse=poe;var x8=G("timers/promises"),Qs=we(),xu=R_(),lp=Or(),L=Q(),P8=Is(),Mu=Kr(),Kc=Rc(),B8=vi(),Gc=Ur(),Yc=as(),he=$_(),pt=ae(),Js=Kn();class k_ extends P8.TypedEventEmitter{constructor(e,t,r,n){super();if(this.timeoutContext=null,this.on("error",pt.noop),e==null)throw new L.MongoRuntimeError("ClientSession requires a MongoClient");if(t==null||!(t instanceof q_))throw new L.MongoRuntimeError("ClientSession requires a ServerSessionPool");if(r=r??{},this.snapshotEnabled=r.snapshot===!0,r.causalConsistency===!0&&this.snapshotEnabled)throw new L.MongoInvalidArgumentError('Properties "causalConsistency" and "snapshot" are mutually exclusive');this.client=e,this.sessionPool=t,this.hasEnded=!1,this.clientOptions=n,this.explicit=!!r.explicit,this._serverSession=this.explicit?this.sessionPool.acquire():null,this.txnNumberIncrement=0;let s=this.explicit&&r.snapshot!==!0;this.supports={causalConsistency:r.causalConsistency??s},this.clusterTime=r.initialClusterTime,this.operationTime=void 0,this.owner=r.owner,this.defaultTransactionOptions={...r.defaultTransactionOptions},this.transaction=new he.Transaction}get id(){return this.serverSession?.id}get serverSession(){let e=this._serverSession;if(e==null){if(this.explicit)throw new L.MongoRuntimeError("Unexpected null serverSession for an explicit session");if(this.hasEnded)throw new L.MongoRuntimeError("Unexpected null serverSession for an ended implicit session");e=this.sessionPool.acquire(),this._serverSession=e}return e}get loadBalanced(){return this.client.topology?.description.type===Yc.TopologyType.LoadBalanced}pin(e){if(this.pinnedConnection)throw TypeError("Cannot pin multiple connections to the same session");this.pinnedConnection=e,e.emit(lp.PINNED,this.inTransaction()?xu.ConnectionPoolMetrics.TXN:xu.ConnectionPoolMetrics.CURSOR)}unpin(e){if(this.loadBalanced)return cp(this,e);this.transaction.unpinServer()}get isPinned(){return this.loadBalanced?!!this.pinnedConnection:this.transaction.isPinned}async endSession(e){try{if(this.inTransaction())await this.abortTransaction({...e,throwTimeout:!0})}catch(t){if(t.name==="MongoOperationTimeoutError")throw t;pt.squashError(t)}finally{if(!this.hasEnded){let t=this.serverSession;if(t!=null)this.sessionPool.release(t),this._serverSession=new fp(t);this.hasEnded=!0,this.emit("ended",this)}cp(this,{force:!0,...e})}}async[Symbol.asyncDispose](){await this.endSession({force:!0})}advanceOperationTime(e){if(this.operationTime==null){this.operationTime=e;return}if(e.greaterThan(this.operationTime))this.operationTime=e}advanceClusterTime(e){if(!e||typeof e!=="object")throw new L.MongoInvalidArgumentError("input cluster time must be an object");if(!e.clusterTime||e.clusterTime._bsontype!=="Timestamp")throw new L.MongoInvalidArgumentError('input cluster time "clusterTime" property must be a valid BSON Timestamp');if(!e.signature||e.signature.hash?._bsontype!=="Binary"||typeof e.signature.keyId!=="bigint"&&typeof e.signature.keyId!=="number"&&e.signature.keyId?._bsontype!=="Long")throw new L.MongoInvalidArgumentError('input cluster time must have a valid "signature" property with BSON Binary hash and BSON Long keyId');Yc._advanceClusterTime(this,e)}equals(e){if(!(e instanceof k_))return!1;if(this.id==null||e.id==null)return!1;return Qs.ByteUtils.equals(this.id.id.buffer,e.id.id.buffer)}incrementTransactionNumber(){this.txnNumberIncrement+=1}inTransaction(){return this.transaction.isActive}startTransaction(e){if(this.snapshotEnabled)throw new L.MongoCompatibilityError("Transactions are not supported in snapshot sessions");if(this.inTransaction())throw new L.MongoTransactionError("Transaction already in progress");if(this.isPinned&&this.transaction.isCommitted)this.unpin();this.commitAttempted=!1,this.incrementTransactionNumber(),this.transaction=new he.Transaction({readConcern:e?.readConcern??this.defaultTransactionOptions.readConcern??this.clientOptions?.readConcern,writeConcern:e?.writeConcern??this.defaultTransactionOptions.writeConcern??this.clientOptions?.writeConcern,readPreference:e?.readPreference??this.defaultTransactionOptions.readPreference??this.clientOptions?.readPreference,maxCommitTimeMS:e?.maxCommitTimeMS??this.defaultTransactionOptions.maxCommitTimeMS}),this.transaction.transition(he.TxnState.STARTING_TRANSACTION)}async commitTransaction(e){if(this.transaction.state===he.TxnState.NO_TRANSACTION)throw new L.MongoTransactionError("No transaction started");if(this.transaction.state===he.TxnState.STARTING_TRANSACTION||this.transaction.state===he.TxnState.TRANSACTION_COMMITTED_EMPTY){this.transaction.transition(he.TxnState.TRANSACTION_COMMITTED_EMPTY);return}if(this.transaction.state===he.TxnState.TRANSACTION_ABORTED)throw new L.MongoTransactionError("Cannot call commitTransaction after calling abortTransaction");let t={commitTransaction:1},r=this.transaction.options.writeConcern??this.clientOptions?.writeConcern;if(r!=null)if(this.timeoutContext==null)Js.WriteConcern.apply(t,{wtimeoutMS:1e4,w:"majority",...r});else{let s=Object.keys(r);if(s.length>2||!s.includes("wtimeoutMS")&&!s.includes("wTimeoutMS"))Js.WriteConcern.apply(t,{...r,wtimeoutMS:void 0})}if(this.transaction.state===he.TxnState.TRANSACTION_COMMITTED||this.commitAttempted)if(this.timeoutContext==null)Js.WriteConcern.apply(t,{wtimeoutMS:1e4,...r,w:"majority"});else Js.WriteConcern.apply(t,{w:"majority",...r,wtimeoutMS:void 0});if(typeof this.transaction.options.maxTimeMS==="number")t.maxTimeMS=this.transaction.options.maxTimeMS;if(this.transaction.recoveryToken)t.recoveryToken=this.transaction.recoveryToken;let n=new Kc.RunCommandOperation(new pt.MongoDBNamespace("admin"),t,{session:this,readPreference:Gc.ReadPreference.primary,bypassPinningCheck:!0});n.maxAttempts=this.clientOptions.maxAdaptiveRetries+1;try{await Mu.executeOperation(this.client,n),this.commitAttempted=void 0;return}catch(s){this.commitAttempted=!0;let i=this.clientOptions.maxAdaptiveRetries+1-n.attemptsMade;if(i<=0)throw s;if(s instanceof L.MongoError&&L.isRetryableWriteError(s)){Js.WriteConcern.apply(t,{wtimeoutMS:1e4,...r,w:"majority"}),this.unpin({force:!0});try{let o=new Kc.RunCommandOperation(new pt.MongoDBNamespace("admin"),t,{session:this,readPreference:Gc.ReadPreference.primary,bypassPinningCheck:!0});o.maxAttempts=i,await Mu.executeOperation(this.client,o);return}catch(o){if(M8(o))o.addErrorLabel(L.MongoErrorLabel.UnknownTransactionCommitResult);if(T8(o))this.unpin({error:o});throw o}}if(M8(s))s.addErrorLabel(L.MongoErrorLabel.UnknownTransactionCommitResult);if(T8(s))this.unpin({error:s});throw s}finally{this.transaction.transition(he.TxnState.TRANSACTION_COMMITTED)}}async abortTransaction(e){if(this.transaction.state===he.TxnState.NO_TRANSACTION)throw new L.MongoTransactionError("No transaction started");if(this.transaction.state===he.TxnState.STARTING_TRANSACTION){this.transaction.transition(he.TxnState.TRANSACTION_ABORTED);return}if(this.transaction.state===he.TxnState.TRANSACTION_ABORTED)throw new L.MongoTransactionError("Cannot call abortTransaction twice");if(this.transaction.state===he.TxnState.TRANSACTION_COMMITTED||this.transaction.state===he.TxnState.TRANSACTION_COMMITTED_EMPTY)throw new L.MongoTransactionError("Cannot call abortTransaction after calling commitTransaction");let t={abortTransaction:1},r=this.transaction.options.writeConcern??this.clientOptions?.writeConcern;if(r!=null)Js.WriteConcern.apply(t,{wtimeoutMS:1e4,w:"majority",...r});if(this.transaction.recoveryToken)t.recoveryToken=this.transaction.recoveryToken;let n=new Kc.RunCommandOperation(new pt.MongoDBNamespace("admin"),t,{session:this,readPreference:Gc.ReadPreference.primary,bypassPinningCheck:!0});try{await Mu.executeOperation(this.client,n),this.unpin();return}catch(s){if(this.unpin(),s.name==="MongoRuntimeError")throw s;if(e?.throwTimeout&&s.name==="MongoOperationTimeoutError")throw s;if(s instanceof L.MongoError&&L.isRetryableWriteError(s))try{await Mu.executeOperation(this.client,n);return}catch(i){if(i.name==="MongoRuntimeError")throw i;if(e?.throwTimeout&&i.name==="MongoOperationTimeoutError")throw i}}finally{if(this.transaction.transition(he.TxnState.TRANSACTION_ABORTED),this.loadBalanced)cp(this,{force:!1})}}toBSON(){throw new L.MongoRuntimeError("ClientSession cannot be serialized to BSON.")}async withTransaction(e,t){let n=!!this.timeoutContext?.csotEnabled(),s=this.timeoutContext?.csotEnabled()?this.timeoutContext.remainingTimeMS:120000,i=pt.processTimeMS()+s,o=!1,u,a=null;try{e:for(let c=0,l=!1;!o;++c,l=c>0){if(l){let m=Math.random()*Math.min(5*1.5**c,500);if(pt.processTimeMS()+m>=i)throw v_(a??new L.MongoRuntimeError("Transaction retry did not record an error: should never occur. Please file a bug."),n);await x8.setTimeout(m)}this.startTransaction(t);try{let f=e(this);if(!pt.isPromiseLike(f))throw new L.MongoInvalidArgumentError("Function provided to `withTransaction` must return a Promise");if(u=await f,this.transaction.state===he.TxnState.NO_TRANSACTION||this.transaction.state===he.TxnState.TRANSACTION_COMMITTED||this.transaction.state===he.TxnState.TRANSACTION_ABORTED)return u}catch(f){if(!(f instanceof L.MongoError)||f instanceof L.MongoInvalidArgumentError)throw await this.abortTransaction(),f;if(a=f,this.transaction.state===he.TxnState.STARTING_TRANSACTION||this.transaction.state===he.TxnState.TRANSACTION_IN_PROGRESS)await this.abortTransaction();if(f.hasErrorLabel(L.MongoErrorLabel.TransientTransactionError)){if(pt.processTimeMS()>=i)throw v_(a,n);continue e}throw f}t:while(!o)try{await this.commitTransaction(),o=!0}catch(f){if(a=f,f.hasErrorLabel(L.MongoErrorLabel.UnknownTransactionCommitResult)&&!hp(f)){if(pt.processTimeMS()>=i)throw v_(f,n);continue t}if(f.hasErrorLabel(L.MongoErrorLabel.TransientTransactionError))continue e;throw f}}return u}finally{this.timeoutContext=null}}}N8.ClientSession=k_;function v_(e,t){if(e instanceof L.MongoOperationTimeoutError)return e;if(t){let r=new L.MongoOperationTimeoutError("Timed out during withTransaction",{cause:e});if(e instanceof L.MongoError)for(let n of e.errorLabels)r.addErrorLabel(n);return r}return e}var foe=new Set(["CannotSatisfyWriteConcern","UnknownReplWriteConcern","UnsatisfiableWriteConcern"]);function T8(e){if(e instanceof L.MongoError){if(L.isRetryableWriteError(e)||e instanceof L.MongoWriteConcernError||hp(e)){if(F8(e))return!0}else if(e.hasErrorLabel(L.MongoErrorLabel.TransientTransactionError))return!0}return!1}function M8(e){let t=L.isRetryableWriteError(e);return t||=e instanceof L.MongoWriteConcernError,t||=hp(e),t&&=F8(e),t}function F8(e){let t=e instanceof L.MongoServerError&&e.codeName&&foe.has(e.codeName);return hp(e)||!t&&e.code!==L.MONGODB_ERROR_CODES.UnsatisfiableWriteConcern&&e.code!==L.MONGODB_ERROR_CODES.UnknownReplWriteConcern}function cp(e,t){let r=e.pinnedConnection,n=t?.error;if(e.inTransaction()&&n&&n instanceof L.MongoError&&n.hasErrorLabel(L.MongoErrorLabel.TransientTransactionError))return;let s=e.client.topology;if(r&&s!=null){let o=Array.from(s.s.servers.values())[0];if(t?.error==null||t?.force){if(o.pool.checkIn(r),e.pinnedConnection=void 0,r.emit(lp.UNPINNED,e.transaction.state!==he.TxnState.NO_TRANSACTION?xu.ConnectionPoolMetrics.TXN:xu.ConnectionPoolMetrics.CURSOR),t?.forceClear)o.pool.clear({serviceId:r.serviceId})}}}function hp(e){if(e==null||!(e instanceof L.MongoServerError))return!1;return e.code===L.MONGODB_ERROR_CODES.MaxTimeMSExpired||e.writeConcernError?.code===L.MONGODB_ERROR_CODES.MaxTimeMSExpired}class fp{constructor(e){if(e!=null){let t=Qs.ByteUtils.allocateUnsafe(16);t.set(e.id.id.buffer),this.id={id:new Qs.Binary(t,e.id.id.sub_type)},this.lastUse=e.lastUse,this.txnNumber=e.txnNumber,this.isDirty=e.isDirty;return}this.id={id:new Qs.Binary(pt.uuidV4(),Qs.Binary.SUBTYPE_UUID)},this.lastUse=pt.processTimeMS(),this.txnNumber=0,this.isDirty=!1}hasTimedOut(e){return Math.round(pt.calculateDurationInMs(this.lastUse)%86400000%3600000/60000)>e-1}}N8.ServerSession=fp;class q_{constructor(e){if(e==null)throw new L.MongoRuntimeError("ServerSessionPool requires a MongoClient");this.client=e,this.sessions=new pt.List}acquire(){let e=this.client.topology?.logicalSessionTimeoutMinutes??10,t=null;while(this.sessions.length>0){let r=this.sessions.shift();if(r!=null&&(!!this.client.topology?.loadBalanced||!r.hasTimedOut(e))){t=r;break}}if(t==null)t=new fp;return t}release(e){let t=this.client.topology?.logicalSessionTimeoutMinutes??10;if(this.client.topology?.loadBalanced&&!t)this.sessions.unshift(e);if(!t)return;if(this.sessions.prune((r)=>r.hasTimedOut(t)),!e.hasTimedOut(t)){if(e.isDirty)return;this.sessions.unshift(e)}}}N8.ServerSessionPool=q_;function doe(e,t,r){if(e.hasEnded)return new L.MongoExpiredSessionError;let n=e.serverSession;if(n==null)return new L.MongoRuntimeError("Unable to acquire server session");if(r.writeConcern?.w===0){if(e&&e.explicit)return new L.MongoAPIError("Cannot have explicit session with unacknowledged writes");return}n.lastUse=pt.processTimeMS(),t.lsid=n.id;let s=e.inTransaction()||he.isTransactionCommand(t);if(!!r.willRetryWrite||s)n.txnNumber+=e.txnNumberIncrement,e.txnNumberIncrement=0,t.txnNumber=Qs.Long.fromNumber(n.txnNumber);if(!s){if(e.transaction.state!==he.TxnState.NO_TRANSACTION)e.transaction.transition(he.TxnState.NO_TRANSACTION);if(e.supports.causalConsistency&&e.operationTime&&pt.commandSupportsAfterClusterTime(t))t.readConcern=t.readConcern||{},Object.assign(t.readConcern,{afterClusterTime:e.operationTime});else if(e.snapshotEnabled){if(t.readConcern=t.readConcern||{level:B8.ReadConcernLevel.snapshot},e.snapshotTime!=null)Object.assign(t.readConcern,{atClusterTime:e.snapshotTime})}return}if(t.autocommit=!1,e.transaction.state===he.TxnState.STARTING_TRANSACTION){t.startTransaction=!0;let o=e.transaction.options.readConcern||e?.clientOptions?.readConcern;if(o)t.readConcern=o;if(e.supports.causalConsistency&&e.operationTime)t.readConcern=t.readConcern||{},Object.assign(t.readConcern,{afterClusterTime:e.operationTime})}return}function poe(e,t){if(t.$clusterTime)Yc._advanceClusterTime(e,t.$clusterTime);if(t.operationTime&&e&&e.supports.causalConsistency)e.advanceOperationTime(t.operationTime);if(t.recoveryToken&&e&&e.inTransaction())e.transaction._recoveryToken=t.recoveryToken;if(e?.snapshotEnabled&&e.snapshotTime==null){let r=t.atClusterTime;if(r)e.snapshotTime=r}if(e.transaction.state===he.TxnState.STARTING_TRANSACTION){if(t.ok===1)e.transaction.transition(he.TxnState.TRANSACTION_IN_PROGRESS);else if(!new L.MongoServerError(t.toObject()).hasErrorLabel(L.MongoErrorLabel.RetryableError))e.transaction.transition(he.TxnState.TRANSACTION_IN_PROGRESS)}}});var ps=g(function(V8){Object.defineProperty(V8,"__esModule",{value:!0});V8.CursorTimeoutContext=V8.AbstractCursor=V8.CursorTimeoutMode=V8.CURSOR_FLAGS=void 0;var $8=G("stream"),Xs=we(),mt=Q(),v8=Is(),dp=Kr(),k8=N_(),q8=_8(),pp=vi(),Pu=Ur(),j8=Sh(),Jc=Gn(),vt=ae();V8.CURSOR_FLAGS=["tailable","oplogReplay","noCursorTimeout","awaitData","exhaust","partial"];function R8(){this.client.s.activeCursors.delete(this)}V8.CursorTimeoutMode=Object.freeze({ITERATION:"iteration",LIFETIME:"cursorLifetime"});class L8 extends v8.TypedEventEmitter{static{this.CLOSE="close"}constructor(e,t,r={}){super();if(this.documents=null,this.hasEmittedClose=!1,this.on("error",vt.noop),r.timeoutMS=void 0,r.timeoutMode=void 0,!e.s.isMongoClient)throw new mt.MongoRuntimeError("Cursor must be constructed with MongoClient");this.cursorClient=e,this.cursorNamespace=t,this.cursorId=null,this.initialized=!1,this.isClosed=!1,this.isKilled=!1,this.cursorOptions={readPreference:r.readPreference&&r.readPreference instanceof Pu.ReadPreference?r.readPreference:Pu.ReadPreference.primary,...Xs.pluckBSONSerializeOptions(r),tailable:r.tailable,awaitData:r.awaitData};let n=pp.ReadConcern.fromOptions(r);if(n)this.cursorOptions.readConcern=n;if(typeof r.batchSize==="number")this.cursorOptions.batchSize=r.batchSize;if(r.comment!==void 0)this.cursorOptions.comment=r.comment;if(typeof r.maxTimeMS==="number")this.cursorOptions.maxTimeMS=r.maxTimeMS;if(typeof r.maxAwaitTimeMS==="number")this.cursorOptions.maxAwaitTimeMS=r.maxAwaitTimeMS;this.cursorSession=r.session??null,this.deserializationOptions={...this.cursorOptions,validation:{utf8:r?.enableUtf8Validation===!1?!1:!0}},this.timeoutContext=r.timeoutContext,this.signal=r.signal,this.abortListener=vt.addAbortListener(this.signal,()=>void this.close().then(void 0,vt.squashError)),this.trackCursor()}get id(){return this.cursorId??void 0}get isDead(){return(this.cursorId?.isZero()??!1)||this.isClosed||this.isKilled}get client(){return this.cursorClient}get server(){return this.selectedServer}get namespace(){return this.cursorNamespace}get readPreference(){return this.cursorOptions.readPreference}get readConcern(){return this.cursorOptions.readConcern}get session(){return this.cursorSession}set session(e){this.cursorSession=e}get closed(){return this.isClosed&&(this.documents?.length??0)===0}get killed(){return this.isKilled}get loadBalanced(){return!!this.cursorClient.topology?.loadBalanced}async[Symbol.asyncDispose](){await this.close()}trackCursor(){if(this.cursorClient.s.activeCursors.add(this),!this.listeners("close").includes(R8))this.once("close",R8)}bufferedCount(){return this.documents?.length??0}readBufferedDocuments(e){let t=[],r=Math.min(e??this.documents?.length??0,this.documents?.length??0);for(let n=0;n<r;n++){let s=this.documents?.shift(this.deserializationOptions);if(s!=null)t.push(s)}return t}async*[Symbol.asyncIterator](){if(this.signal?.throwIfAborted(),this.closed)return;try{while(!0){if(this.isKilled)return;if(this.closed)return;if(this.cursorId!=null&&this.isDead&&(this.documents?.length??0)===0)return;let e=await this.next();if(e===null)return;yield e,this.signal?.throwIfAborted()}}finally{if(!this.isClosed)try{await this.close()}catch(e){vt.squashError(e)}}}stream(){let e=new U8(this),t=vt.addAbortListener(this.signal,function(){e.destroy(this.reason)});return e.once("end",()=>{t?.[vt.kDispose]()}),e}async hasNext(){if(this.signal?.throwIfAborted(),this.cursorId===Xs.Long.ZERO)return!1;if(this.cursorOptions.timeoutMode===V8.CursorTimeoutMode.ITERATION&&this.cursorId!=null)this.timeoutContext?.refresh();try{do{if((this.documents?.length??0)!==0)return!0;await this.fetchBatch()}while(!this.isDead||(this.documents?.length??0)!==0)}finally{if(this.cursorOptions.timeoutMode===V8.CursorTimeoutMode.ITERATION)this.timeoutContext?.clear()}return!1}async next(){if(this.signal?.throwIfAborted(),this.cursorId===Xs.Long.ZERO)throw new mt.MongoCursorExhaustedError;if(this.cursorOptions.timeoutMode===V8.CursorTimeoutMode.ITERATION&&this.cursorId!=null)this.timeoutContext?.refresh();try{do{let e=this.documents?.shift(this.deserializationOptions);if(e!=null){if(this.transform!=null)return await this.transformDocument(e);return e}await this.fetchBatch()}while(!this.isDead||(this.documents?.length??0)!==0)}finally{if(this.cursorOptions.timeoutMode===V8.CursorTimeoutMode.ITERATION)this.timeoutContext?.clear()}return null}async tryNext(){if(this.signal?.throwIfAborted(),this.cursorId===Xs.Long.ZERO)throw new mt.MongoCursorExhaustedError;if(this.cursorOptions.timeoutMode===V8.CursorTimeoutMode.ITERATION&&this.cursorId!=null)this.timeoutContext?.refresh();try{let e=this.documents?.shift(this.deserializationOptions);if(e!=null){if(this.transform!=null)return await this.transformDocument(e);return e}if(await this.fetchBatch(),e=this.documents?.shift(this.deserializationOptions),e!=null){if(this.transform!=null)return await this.transformDocument(e);return e}}finally{if(this.cursorOptions.timeoutMode===V8.CursorTimeoutMode.ITERATION)this.timeoutContext?.clear()}return null}async forEach(e){if(this.signal?.throwIfAborted(),typeof e!=="function")throw new mt.MongoInvalidArgumentError('Argument "iterator" must be a function');for await(let t of this)if(e(t)===!1)break}async close(e){await this.cleanup()}async toArray(){this.signal?.throwIfAborted();let e=[];for await(let t of this){e.push(t);let r=this.readBufferedDocuments();if(this.transform!=null)for(let n of r)e.push(await this.transformDocument(n));else for(let n of r)e.push(n)}return e}addCursorFlag(e,t){if(this.throwIfInitialized(),!V8.CURSOR_FLAGS.includes(e))throw new mt.MongoInvalidArgumentError(`Flag ${e} is not one of ${V8.CURSOR_FLAGS}`);if(typeof t!=="boolean")throw new mt.MongoInvalidArgumentError(`Flag ${e} must be a boolean value`);return this.cursorOptions[e]=t,this}map(e){this.throwIfInitialized();let t=this.transform;if(t)this.transform=(r)=>e(t(r));else this.transform=e;return this}withReadPreference(e){if(this.throwIfInitialized(),e instanceof Pu.ReadPreference)this.cursorOptions.readPreference=e;else if(typeof e==="string")this.cursorOptions.readPreference=Pu.ReadPreference.fromString(e);else throw new mt.MongoInvalidArgumentError(`Invalid read preference: ${e}`);return this}withReadConcern(e){this.throwIfInitialized();let t=pp.ReadConcern.fromOptions({readConcern:e});if(t)this.cursorOptions.readConcern=t;return this}maxTimeMS(e){if(this.throwIfInitialized(),typeof e!=="number")throw new mt.MongoInvalidArgumentError("Argument for maxTimeMS must be a number");return this.cursorOptions.maxTimeMS=e,this}batchSize(e){if(this.throwIfInitialized(),this.cursorOptions.tailable)throw new mt.MongoTailableCursorError("Tailable cursor does not support batchSize");if(typeof e!=="number")throw new mt.MongoInvalidArgumentError('Operation "batchSize" requires an integer');return this.cursorOptions.batchSize=e,this}rewind(){if(this.timeoutContext&&this.timeoutContext.owner!==this)throw new mt.MongoAPIError("Cannot rewind cursor that does not own its timeout context.");if(!this.initialized)return;if(this.cursorId=null,this.documents?.clear(),this.timeoutContext?.clear(),this.timeoutContext=void 0,this.isClosed=!1,this.isKilled=!1,this.initialized=!1,this.hasEmittedClose=!1,this.trackCursor(),this.cursorSession?.explicit===!1){if(!this.cursorSession.hasEnded)this.cursorSession.endSession().then(void 0,vt.squashError);this.cursorSession=null}}async getMore(){if(this.cursorId==null)throw new mt.MongoRuntimeError("Unexpected null cursor id. A cursor creating command should have set this");if(this.selectedServer==null)throw new mt.MongoRuntimeError("Unexpected null selectedServer. A cursor creating command should have set this");if(this.cursorSession==null)throw new mt.MongoRuntimeError("Unexpected null session. A cursor creating command should have set this");let e={...this.cursorOptions,session:this.cursorSession,batchSize:this.cursorOptions.batchSize},t=new k8.GetMoreOperation(this.cursorNamespace,this.cursorId,this.selectedServer,e);return await dp.executeOperation(this.cursorClient,t,this.timeoutContext)}async cursorInit(){if(this.cursorOptions.timeoutMS!=null)this.timeoutContext??=new wh(Jc.TimeoutContext.create({serverSelectionTimeoutMS:this.client.s.options.serverSelectionTimeoutMS,timeoutMS:this.cursorOptions.timeoutMS}),this);try{this.cursorSession??=this.cursorClient.startSession({owner:this,explicit:!1});let e=await this._initialize(this.cursorSession);this.cursorOptions.omitMaxTimeMS=this.cursorOptions.timeoutMS!=null;let t=e.response;this.selectedServer=e.server,this.cursorId=t.id,this.cursorNamespace=t.ns??this.namespace,this.documents=t,this.initialized=!0}catch(e){throw this.initialized=!0,await this.cleanup(void 0,e),e}if(this.isDead)await this.cleanup();return}async fetchBatch(){if(this.isClosed)return;if(this.isDead){await this.cleanup();return}if(this.cursorId==null){if(await this.cursorInit(),(this.documents?.length??0)!==0||this.isDead)return}try{let e=await this.getMore();this.cursorId=e.id,this.documents=e}catch(e){try{await this.cleanup(void 0,e)}catch(t){vt.squashError(t)}throw e}if(this.isDead)await this.cleanup()}async cleanup(e,t){this.abortListener?.[vt.kDispose](),this.isClosed=!0;let r=()=>{if(e!=null)return this.timeoutContext?.clear(),new wh(Jc.TimeoutContext.create({serverSelectionTimeoutMS:this.client.s.options.serverSelectionTimeoutMS,timeoutMS:e}),this);else return this.timeoutContext?.refreshed()};await(async(i)=>{try{await i()}finally{this.emitClose()}})(async()=>{let i=this.cursorSession;if(!i)return;try{if(!this.isKilled&&this.cursorId&&!this.cursorId.isZero()&&this.cursorNamespace&&this.selectedServer&&!i.hasEnded){this.isKilled=!0;let o=this.cursorId;this.cursorId=Xs.Long.ZERO,await dp.executeOperation(this.cursorClient,new q8.KillCursorsOperation(o,this.cursorNamespace,this.selectedServer,{session:i}),r())}}catch(o){vt.squashError(o)}finally{if(i.owner===this)await i.endSession({error:t});if(!i.inTransaction())j8.maybeClearPinnedConnection(i,{error:t})}})}emitClose(){try{if(!this.hasEmittedClose&&((this.documents?.length??0)===0||this.isClosed))this.emit("close")}finally{this.hasEmittedClose=!0}}async transformDocument(e){if(this.transform==null)return e;try{let t=this.transform(e);if(t===null)throw new mt.MongoAPIError("Cursor returned a `null` document, but the cursor is not exhausted. Mapping documents to `null` is not supported in the cursor transform.");return t}catch(t){try{await this.close()}catch(r){vt.squashError(r)}throw t}}throwIfInitialized(){if(this.initialized)throw new mt.MongoCursorInUseError}}V8.AbstractCursor=L8;class U8 extends $8.Readable{constructor(e){super({objectMode:!0,autoDestroy:!1,highWaterMark:1});this._readInProgress=!1,this._cursor=e}_read(e){if(!this._readInProgress)this._readInProgress=!0,this._readNext()}_destroy(e,t){this._cursor.close().then(()=>t(e),(r)=>t(r))}_readNext(){if(this._cursor.id===Xs.Long.ZERO){this.push(null);return}this._cursor.next().then((e)=>{if(e==null)this.push(null);else if(this.destroyed)this._cursor.close().then(void 0,vt.squashError);else{if(this.push(e))return this._readNext();this._readInProgress=!1}},(e)=>{if(e.message.match(/server is closed/))return this._cursor.close().then(void 0,vt.squashError),this.push(null);if(e.message.match(/operation was interrupted/))return this.push(null);return this.destroy(e)}).catch((e)=>{this._readInProgress=!1,this.destroy(e)})}}class wh extends Jc.TimeoutContext{constructor(e,t){super();this.timeoutContext=e,this.owner=t}get serverSelectionTimeout(){return this.timeoutContext.serverSelectionTimeout}get connectionCheckoutTimeout(){return this.timeoutContext.connectionCheckoutTimeout}get clearServerSelectionTimeout(){return this.timeoutContext.clearServerSelectionTimeout}get timeoutForSocketWrite(){return this.timeoutContext.timeoutForSocketWrite}get timeoutForSocketRead(){return this.timeoutContext.timeoutForSocketRead}csotEnabled(){return this.timeoutContext.csotEnabled()}refresh(){if(typeof this.owner!=="symbol")return this.timeoutContext.refresh()}clear(){if(typeof this.owner!=="symbol")return this.timeoutContext.clear()}get maxTimeMS(){return this.timeoutContext.maxTimeMS}get timeoutMS(){return this.timeoutContext.csotEnabled()?this.timeoutContext.timeoutMS:null}refreshed(){return new wh(this.timeoutContext.refreshed(),this.owner)}addMaxTimeMSToCommand(e,t){this.timeoutContext.addMaxTimeMSToCommand(e,t)}getSocketTimeoutMS(){return this.timeoutContext.getSocketTimeoutMS()}}V8.CursorTimeoutContext=wh});var mp=g(function(K8){Object.defineProperty(K8,"__esModule",{value:!0});K8.ExplainableCursor=void 0;var W8=ps();class H8 extends W8.AbstractCursor{resolveExplainTimeoutOptions(e,t){let r,n;if(e==null&&t==null)r=void 0,n=void 0;else if(e!=null&&t==null)r=typeof e!=="object"?e:("verbosity"in e)?e:void 0,n=typeof e==="object"&&"timeoutMS"in e?e:void 0;else r=e,n=t;return{timeout:n,explain:r}}}K8.ExplainableCursor=H8});var Ch=g(function(Q8){Object.defineProperty(Q8,"__esModule",{value:!0});Q8.AggregationCursor=void 0;var yp=Q(),gp=Eh(),_p=Kr(),Y8=ae(),Ep=ps(),J8=mp();class L_ extends J8.ExplainableCursor{constructor(e,t,r=[],n={}){super(e,t,n);this.pipeline=r,this.aggregateOptions=n;let s=this.pipeline[this.pipeline.length-1];if(this.cursorOptions.timeoutMS!=null&&this.cursorOptions.timeoutMode===Ep.CursorTimeoutMode.ITERATION&&(s?.$merge!=null||s?.$out!=null))throw new yp.MongoAPIError("Cannot use $out or $merge stage with ITERATION timeoutMode")}clone(){let e=Y8.mergeOptions({},this.aggregateOptions);return delete e.session,new L_(this.client,this.namespace,this.pipeline,{...e})}map(e){return super.map(e)}async _initialize(e){let t={...this.aggregateOptions,...this.cursorOptions,session:e,signal:this.signal},r=new gp.AggregateOperation(this.namespace,this.pipeline,t),n=await _p.executeOperation(this.client,r,this.timeoutContext);return{server:r.server,session:e,response:n}}async explain(e,t){let{explain:r,timeout:n}=this.resolveExplainTimeoutOptions(e,t);return(await _p.executeOperation(this.client,new gp.AggregateOperation(this.namespace,this.pipeline,{...this.aggregateOptions,...this.cursorOptions,...n,explain:r??!0}))).shift(this.deserializationOptions)}addStage(e){if(this.throwIfInitialized(),this.cursorOptions.timeoutMS!=null&&this.cursorOptions.timeoutMode===Ep.CursorTimeoutMode.ITERATION&&(e.$out!=null||e.$merge!=null))throw new yp.MongoAPIError("Cannot use $out or $merge stage with ITERATION timeoutMode");return this.pipeline.push(e),this}group(e){return this.addStage({$group:e})}limit(e){return this.addStage({$limit:e})}match(e){return this.addStage({$match:e})}out(e){return this.addStage({$out:e})}project(e){return this.addStage({$project:e})}lookup(e){return this.addStage({$lookup:e})}redact(e){return this.addStage({$redact:e})}skip(e){return this.addStage({$skip:e})}sort(e){return this.addStage({$sort:e})}unwind(e){return this.addStage({$unwind:e})}geoNear(e){return this.addStage({$geoNear:e})}}Q8.AggregationCursor=L_});var V_=g(function(t5){Object.defineProperty(t5,"__esModule",{value:!0});t5.CountOperation=void 0;var Z8=dt(),e5=nr(),Bu=Mt();class U_ extends e5.CommandOperation{constructor(e,t,r){super({s:{namespace:e}},r);this.SERVER_COMMAND_RESPONSE_TYPE=Z8.MongoDBResponse,this.options=r,this.collectionName=e.collection,this.query=t}get commandName(){return"count"}buildCommandDocument(e,t){let r=this.options,n={count:this.collectionName,query:this.query};if(typeof r.limit==="number")n.limit=r.limit;if(typeof r.skip==="number")n.skip=r.skip;if(r.hint!=null)n.hint=r.hint;if(typeof r.maxTimeMS==="number")n.maxTimeMS=r.maxTimeMS;return n}handleOk(e){return e.getNumber("n")??0}}t5.CountOperation=U_;Bu.defineAspects(U_,[Bu.Aspect.READ_OPERATION,Bu.Aspect.RETRYABLE,Bu.Aspect.SUPPORTS_RAW_DATA])});var c5=g(function(u5){Object.defineProperty(u5,"__esModule",{value:!0});u5.FindOperation=void 0;var Qc=dt(),n5=Q(),s5=vc(),i5=ae(),o5=nr(),Zs=Mt();class z_ extends o5.CommandOperation{constructor(e,t={},r={}){super(void 0,r);if(this.SERVER_COMMAND_RESPONSE_TYPE=Qc.CursorResponse,this.options={...r},delete this.options.writeConcern,this.ns=e,typeof t!=="object"||Array.isArray(t))throw new n5.MongoInvalidArgumentError("Query filter must be a plain object or ObjectId");this.filter=t!=null&&t._bsontype==="ObjectId"?{_id:t}:t,this.SERVER_COMMAND_RESPONSE_TYPE=this.explain?Qc.ExplainedCursorResponse:Qc.CursorResponse}get commandName(){return"find"}buildOptions(e){return{...this.options,...this.bsonOptions,documentsReturnedIn:"firstBatch",session:this.session,timeoutContext:e}}handleOk(e){return e}buildCommandDocument(){return Ooe(this.ns,this.filter,this.options)}}u5.FindOperation=z_;function Ooe(e,t,r){let n={find:e.collection,filter:t};if(r.sort)n.sort=s5.formatSort(r.sort);if(r.projection){let s=r.projection;if(s&&Array.isArray(s))s=s.length?s.reduce((i,o)=>(i[o]=1,i),{}):{_id:1};n.projection=s}if(r.hint)n.hint=i5.normalizeHintField(r.hint);if(typeof r.skip==="number")n.skip=r.skip;if(typeof r.limit==="number")if(r.limit<0)n.limit=-r.limit,n.singleBatch=!0;else n.limit=r.limit;if(typeof r.batchSize==="number")if(r.batchSize<0)n.limit=-r.batchSize;else if(r.batchSize===r.limit)n.batchSize=r.batchSize+1;else n.batchSize=r.batchSize;if(typeof r.singleBatch==="boolean")n.singleBatch=r.singleBatch;if(r.comment!==void 0)n.comment=r.comment;if(r.max)n.max=r.max;if(r.min)n.min=r.min;if(typeof r.returnKey==="boolean")n.returnKey=r.returnKey;if(typeof r.showRecordId==="boolean")n.showRecordId=r.showRecordId;if(typeof r.tailable==="boolean")n.tailable=r.tailable;if(typeof r.oplogReplay==="boolean")n.oplogReplay=r.oplogReplay;if(typeof r.timeout==="boolean")n.noCursorTimeout=!r.timeout;else if(typeof r.noCursorTimeout==="boolean")n.noCursorTimeout=r.noCursorTimeout;if(typeof r.awaitData==="boolean")n.awaitData=r.awaitData;if(typeof r.allowPartialResults==="boolean")n.allowPartialResults=r.allowPartialResults;if(typeof r.allowDiskUse==="boolean")n.allowDiskUse=r.allowDiskUse;if(r.let)n.let=r.let;return n}Zs.defineAspects(z_,[Zs.Aspect.READ_OPERATION,Zs.Aspect.RETRYABLE,Zs.Aspect.EXPLAINABLE,Zs.Aspect.CURSOR_CREATING,Zs.Aspect.SUPPORTS_RAW_DATA])});var H_=g(function(d5){Object.defineProperty(d5,"__esModule",{value:!0});d5.FindCursor=d5.FLAGS=void 0;var l5=dt(),cr=Q(),h5=V_(),Xc=Kr(),Ap=c5(),Zc=vc(),Fu=ae(),f5=mp();d5.FLAGS=["tailable","oplogReplay","noCursorTimeout","awaitData","exhaust","partial"];class W_ extends f5.ExplainableCursor{constructor(e,t,r={},n={}){super(e,t,n);if(this.numReturned=0,this.cursorFilter=r,this.findOptions=n,n.sort!=null)this.findOptions.sort=Zc.formatSort(n.sort)}clone(){let e=Fu.mergeOptions({},this.findOptions);return delete e.session,new W_(this.client,this.namespace,this.cursorFilter,{...e})}map(e){return super.map(e)}async _initialize(e){let t={...this.findOptions,...this.cursorOptions,session:e,signal:this.signal},r=new Ap.FindOperation(this.namespace,this.cursorFilter,t),n=await Xc.executeOperation(this.client,r,this.timeoutContext);return this.numReturned=n.batchSize,{server:r.server,session:e,response:n}}async getMore(){let e=this.numReturned,t=this.findOptions.limit??1/0,r=t-e;if(e===t&&!this.id?.isZero()){try{await this.close()}catch(i){Fu.squashError(i)}return l5.CursorResponse.emptyGetMore}let n=Fu.noop,{batchSize:s}=this.cursorOptions;if(s!=null&&s>r)this.cursorOptions.batchSize=r,n=()=>{this.cursorOptions.batchSize=s};try{let i=await super.getMore();return this.numReturned=this.numReturned+i.batchSize,i}finally{n?.()}}async count(e){if(Fu.emitWarningOnce("cursor.count is deprecated and will be removed in the next major version, please use `collection.estimatedDocumentCount` or `collection.countDocuments` instead "),typeof e==="boolean")throw new cr.MongoInvalidArgumentError("Invalid first parameter to count");return await Xc.executeOperation(this.client,new h5.CountOperation(this.namespace,this.cursorFilter,{...this.findOptions,...this.cursorOptions,...e}))}async explain(e,t){let{explain:r,timeout:n}=this.resolveExplainTimeoutOptions(e,t);return(await Xc.executeOperation(this.client,new Ap.FindOperation(this.namespace,this.cursorFilter,{...this.findOptions,...this.cursorOptions,...n,explain:r??!0}))).shift(this.deserializationOptions)}filter(e){return this.throwIfInitialized(),this.cursorFilter=e,this}hint(e){return this.throwIfInitialized(),this.findOptions.hint=e,this}min(e){return this.throwIfInitialized(),this.findOptions.min=e,this}max(e){return this.throwIfInitialized(),this.findOptions.max=e,this}returnKey(e){return this.throwIfInitialized(),this.findOptions.returnKey=e,this}showRecordId(e){return this.throwIfInitialized(),this.findOptions.showRecordId=e,this}addQueryModifier(e,t){if(this.throwIfInitialized(),e[0]!=="$")throw new cr.MongoInvalidArgumentError(`${e} is not a valid query modifier`);switch(e.substr(1)){case"comment":this.findOptions.comment=t;break;case"explain":this.findOptions.explain=t;break;case"hint":this.findOptions.hint=t;break;case"max":this.findOptions.max=t;break;case"maxTimeMS":this.findOptions.maxTimeMS=t;break;case"min":this.findOptions.min=t;break;case"orderby":this.findOptions.sort=Zc.formatSort(t);break;case"query":this.cursorFilter=t;break;case"returnKey":this.findOptions.returnKey=t;break;case"showDiskLoc":this.findOptions.showRecordId=t;break;default:throw new cr.MongoInvalidArgumentError(`Invalid query modifier: ${e}`)}return this}comment(e){return this.throwIfInitialized(),this.findOptions.comment=e,this}maxAwaitTimeMS(e){if(this.throwIfInitialized(),typeof e!=="number")throw new cr.MongoInvalidArgumentError("Argument for maxAwaitTimeMS must be a number");return this.findOptions.maxAwaitTimeMS=e,this}maxTimeMS(e){if(this.throwIfInitialized(),typeof e!=="number")throw new cr.MongoInvalidArgumentError("Argument for maxTimeMS must be a number");return this.findOptions.maxTimeMS=e,this}project(e){return this.throwIfInitialized(),this.findOptions.projection=e,this}sort(e,t){if(this.throwIfInitialized(),this.findOptions.tailable)throw new cr.MongoTailableCursorError("Tailable cursor does not support sorting");return this.findOptions.sort=Zc.formatSort(e,t),this}allowDiskUse(e=!0){if(this.throwIfInitialized(),!this.findOptions.sort)throw new cr.MongoInvalidArgumentError('Option "allowDiskUse" requires a sort specification');if(!e)return this.findOptions.allowDiskUse=!1,this;return this.findOptions.allowDiskUse=!0,this}collation(e){return this.throwIfInitialized(),this.findOptions.collation=e,this}limit(e){if(this.throwIfInitialized(),this.findOptions.tailable)throw new cr.MongoTailableCursorError("Tailable cursor does not support limit");if(typeof e!=="number")throw new cr.MongoInvalidArgumentError('Operation "limit" requires an integer');return this.findOptions.limit=e,this}skip(e){if(this.throwIfInitialized(),this.findOptions.tailable)throw new cr.MongoTailableCursorError("Tailable cursor does not support skip");if(typeof e!=="number")throw new cr.MongoInvalidArgumentError('Operation "skip" requires an integer');return this.findOptions.skip=e,this}}d5.FindCursor=W_});var Dh=g(function(y5){Object.defineProperty(y5,"__esModule",{value:!0});y5.ListIndexesOperation=y5.DropIndexOperation=y5.CreateIndexesOperation=void 0;var el=dt(),m5=ae(),tl=nr(),lr=Mt(),woe=new Set(["background","unique","name","partialFilterExpression","sparse","hidden","expireAfterSeconds","storageEngine","collation","version","weights","default_language","language_override","textIndexVersion","2dsphereIndexVersion","bits","min","max","bucketSize","wildcardProjection"]);function Coe(e){return typeof e==="number"||e==="2d"||e==="2dsphere"||e==="text"||e==="geoHaystack"}function boe(e){return Array.isArray(e)&&e.length===2&&Coe(e[1])}function Doe(e){let t=new Map,r=!Array.isArray(e)||boe(e)?[e]:e;for(let n of r)if(typeof n==="string")t.set(n,1);else if(Array.isArray(n))t.set(n[0],n[1]??1);else if(n instanceof Map)for(let[s,i]of n)t.set(s,i);else if(m5.isObject(n))for(let[s,i]of Object.entries(n))t.set(s,i);return t}var Toe=new Map([["version","v"],["defaultLanguage","default_language"],["languageOverride","language_override"]]);function Moe(e,t){let r=Object.entries(e).filter(([n])=>n!=="key"&&(t||woe.has(n)));return Object.fromEntries(r.map(([n,s])=>[Toe.get(n)??n,s]))}class bh extends tl.CommandOperation{constructor(e,t,r,n,s){super(e,s);this.SERVER_COMMAND_RESPONSE_TYPE=el.MongoDBResponse,this.options={...s},this.options.collation=void 0,this.collectionName=t,this.indexes=r.map((i)=>{let o=i.key instanceof Map?i.key:new Map(Object.entries(i.key)),u=i.name??Array.from(o).flat().join("_");return{...Moe(i,n),name:u,key:o}}),this.ns=e.s.namespace}static fromIndexDescriptionArray(e,t,r,n,s){return new bh(e,t,r,n,s)}static fromIndexSpecification(e,t,r,n,s,i){let o=Doe(r),u={...s,key:o};return new bh(e,t,[u],n,i??s)}get commandName(){return"createIndexes"}buildCommandDocument(e){let t=this.options,r=this.indexes,n={createIndexes:this.collectionName,indexes:r};if(t.commitQuorum!=null)n.commitQuorum=t.commitQuorum;return n}handleOk(e){return this.indexes.map((r)=>r.name||"")}}y5.CreateIndexesOperation=bh;class K_ extends tl.CommandOperation{constructor(e,t,r){super(e,r);this.SERVER_COMMAND_RESPONSE_TYPE=el.MongoDBResponse,this.options=r??{},this.collection=e,this.indexName=t,this.ns=e.fullNamespace}get commandName(){return"dropIndexes"}buildCommandDocument(e){return{dropIndexes:this.collection.collectionName,index:this.indexName}}}y5.DropIndexOperation=K_;class G_ extends tl.CommandOperation{constructor(e,t){super(e,t);this.SERVER_COMMAND_RESPONSE_TYPE=el.CursorResponse,this.options={...t},delete this.options.writeConcern,this.collectionNamespace=e.s.namespace}get commandName(){return"listIndexes"}buildCommandDocument(e){let t=this.options.batchSize?{batchSize:this.options.batchSize}:{},r={listIndexes:this.collectionNamespace.collection,cursor:t};if(this.options.comment!==void 0)r.comment=this.options.comment;return r}handleOk(e){return e}}y5.ListIndexesOperation=G_;lr.defineAspects(G_,[lr.Aspect.READ_OPERATION,lr.Aspect.RETRYABLE,lr.Aspect.CURSOR_CREATING,lr.Aspect.SUPPORTS_RAW_DATA]);lr.defineAspects(bh,[lr.Aspect.WRITE_OPERATION,lr.Aspect.SUPPORTS_RAW_DATA]);lr.defineAspects(K_,[lr.Aspect.WRITE_OPERATION,lr.Aspect.SUPPORTS_RAW_DATA])});var J_=g(function(O5){Object.defineProperty(O5,"__esModule",{value:!0});O5.ListIndexesCursor=void 0;var _5=Kr(),E5=Dh(),A5=ps();class Y_ extends A5.AbstractCursor{constructor(e,t){super(e.client,e.s.namespace,{...t});this.parent=e,this.options=t}clone(){return new Y_(this.parent,{...this.options,...this.cursorOptions})}async _initialize(e){let t=new E5.ListIndexesOperation(this.parent,{...this.cursorOptions,...this.options,session:e}),r=await _5.executeOperation(this.parent.client,t,this.timeoutContext);return{server:t.server,session:e,response:r}}}O5.ListIndexesCursor=Y_});var T5=g(function(b5){Object.defineProperty(b5,"__esModule",{value:!0});b5.ListSearchIndexesCursor=void 0;var w5=Ch();class C5 extends w5.AggregationCursor{constructor({fullNamespace:e,client:t},r,n={}){let s=r==null?[{$listSearchIndexes:{}}]:[{$listSearchIndexes:{name:r}}];super(t,e,s,n)}}b5.ListSearchIndexesCursor=C5});var F5=g(function(P5){Object.defineProperty(P5,"__esModule",{value:!0});P5.DistinctOperation=void 0;var M5=dt(),x5=nr(),ro=Mt();class Q_ extends x5.CommandOperation{constructor(e,t,r,n){super(e,n);this.SERVER_COMMAND_RESPONSE_TYPE=M5.MongoDBResponse,this.options=n??{},this.collection=e,this.key=t,this.query=r}get commandName(){return"distinct"}buildCommandDocument(e){let t={distinct:this.collection.collectionName,key:this.key,query:this.query};if(this.options.comment!==void 0)t.comment=this.options.comment;if(this.options.hint!=null)t.hint=this.options.hint;return t}handleOk(e){if(this.explain)return e.toObject(this.bsonOptions);return e.toObject(this.bsonOptions).values}}P5.DistinctOperation=Q_;ro.defineAspects(Q_,[ro.Aspect.READ_OPERATION,ro.Aspect.RETRYABLE,ro.Aspect.EXPLAINABLE,ro.Aspect.SUPPORTS_RAW_DATA])});var v5=g(function(R5){Object.defineProperty(R5,"__esModule",{value:!0});R5.EstimatedDocumentCountOperation=void 0;var N5=dt(),I5=nr(),no=Mt();class X_ extends I5.CommandOperation{constructor(e,t={}){super(e,t);this.SERVER_COMMAND_RESPONSE_TYPE=N5.MongoDBResponse,this.options=t,this.collectionName=e.collectionName}get commandName(){return"count"}buildCommandDocument(e,t){let r={count:this.collectionName};if(typeof this.options.maxTimeMS==="number")r.maxTimeMS=this.options.maxTimeMS;if(this.options.comment!==void 0)r.comment=this.options.comment;return r}handleOk(e){return e.getNumber("n")??0}}R5.EstimatedDocumentCountOperation=X_;no.defineAspects(X_,[no.Aspect.READ_OPERATION,no.Aspect.RETRYABLE,no.Aspect.CURSOR_CREATING,no.Aspect.SUPPORTS_RAW_DATA])});var Z_=g(function(H5){Object.defineProperty(H5,"__esModule",{value:!0});H5.FindOneAndUpdateOperation=H5.FindOneAndReplaceOperation=H5.FindOneAndDeleteOperation=H5.FindAndModifyOperation=H5.ReturnDocument=void 0;var k5=dt(),ms=Q(),q5=Ur(),j5=vc(),rl=ae(),L5=nr(),so=Mt();H5.ReturnDocument=Object.freeze({BEFORE:"before",AFTER:"after"});function U5(e,t){if(e.new=t.returnDocument===H5.ReturnDocument.AFTER,e.upsert=t.upsert===!0,t.bypassDocumentValidation===!0)e.bypassDocumentValidation=t.bypassDocumentValidation;return e}class nl extends L5.CommandOperation{constructor(e,t,r){super(e,r);this.SERVER_COMMAND_RESPONSE_TYPE=k5.MongoDBResponse,this.options=r,this.readPreference=q5.ReadPreference.primary,this.collection=e,this.query=t}get commandName(){return"findAndModify"}buildCommandDocument(e,t){let r=this.options,n={findAndModify:this.collection.collectionName,query:this.query,remove:!1,new:!1,upsert:!1};r.includeResultMetadata??=!1;let s=j5.formatSort(r.sort);if(s)n.sort=s;if(r.projection)n.fields=r.projection;if(r.maxTimeMS)n.maxTimeMS=r.maxTimeMS;if(r.writeConcern)n.writeConcern=r.writeConcern;if(r.let)n.let=r.let;if(r.comment!==void 0)n.comment=r.comment;if(rl.decorateWithCollation(n,r),r.hint)n.hint=r.hint;return n}handleOk(e){let t=super.handleOk(e);return this.options.includeResultMetadata?t:t.value??null}}H5.FindAndModifyOperation=nl;class V5 extends nl{constructor(e,t,r){if(t==null||typeof t!=="object")throw new ms.MongoInvalidArgumentError('Argument "filter" must be an object');super(e,t,r)}buildCommandDocument(e,t){let r=super.buildCommandDocument(e,t);return r.remove=!0,r}}H5.FindOneAndDeleteOperation=V5;class z5 extends nl{constructor(e,t,r,n){if(t==null||typeof t!=="object")throw new ms.MongoInvalidArgumentError('Argument "filter" must be an object');if(r==null||typeof r!=="object")throw new ms.MongoInvalidArgumentError('Argument "replacement" must be an object');if(rl.hasAtomicOperators(r))throw new ms.MongoInvalidArgumentError("Replacement document must not contain atomic operators");super(e,t,n);this.replacement=r}buildCommandDocument(e,t){let r=super.buildCommandDocument(e,t);return r.update=this.replacement,U5(r,this.options),r}}H5.FindOneAndReplaceOperation=z5;class W5 extends nl{constructor(e,t,r,n){if(t==null||typeof t!=="object")throw new ms.MongoInvalidArgumentError('Argument "filter" must be an object');if(r==null||typeof r!=="object")throw new ms.MongoInvalidArgumentError('Argument "update" must be an object');if(!rl.hasAtomicOperators(r,n))throw new ms.MongoInvalidArgumentError("Update document requires atomic operators");super(e,t,n);this.update=r,this.options=n}buildCommandDocument(e,t){let r=super.buildCommandDocument(e,t);if(r.update=this.update,U5(r,this.options),this.options.arrayFilters)r.arrayFilters=this.options.arrayFilters;return r}}H5.FindOneAndUpdateOperation=W5;so.defineAspects(nl,[so.Aspect.WRITE_OPERATION,so.Aspect.RETRYABLE,so.Aspect.EXPLAINABLE,so.Aspect.SUPPORTS_RAW_DATA])});var tE=g(function(Z5){Object.defineProperty(Z5,"__esModule",{value:!0});Z5.RenameOperation=void 0;var Y5=dt(),J5=sl(),Q5=ae(),X5=nr(),Op=Mt();class eE extends X5.CommandOperation{constructor(e,t,r){super(e,r);this.SERVER_COMMAND_RESPONSE_TYPE=Y5.MongoDBResponse,this.collection=e,this.newName=t,this.options=r,this.ns=new Q5.MongoDBNamespace("admin","$cmd")}get commandName(){return"renameCollection"}buildCommandDocument(e,t){let r=this.collection.namespace,n=this.collection.s.namespace.withCollection(this.newName).toString(),s=typeof this.options.dropTarget==="boolean"?this.options.dropTarget:!1;return{renameCollection:r,to:n,dropTarget:s}}handleOk(e){return new J5.Collection(this.collection.db,this.newName,this.collection.s.options)}}Z5.RenameOperation=eE;Op.defineAspects(eE,[Op.Aspect.WRITE_OPERATION])});var oD=g(function(sD){Object.defineProperty(sD,"__esModule",{value:!0});sD.CreateSearchIndexesOperation=void 0;var tD=dt(),rD=Mt();class nD extends rD.AbstractOperation{constructor(e,t){super();this.SERVER_COMMAND_RESPONSE_TYPE=tD.MongoDBResponse,this.collection=e,this.descriptions=t,this.ns=e.fullNamespace}get commandName(){return"createSearchIndexes"}buildCommand(e,t){return{createSearchIndexes:this.collection.fullNamespace.collection,indexes:this.descriptions}}handleOk(e){return super.handleOk(e).indexesCreated.map((t)=>t.name)}buildOptions(e){return{session:this.session,timeoutContext:e}}}sD.CreateSearchIndexesOperation=nD});var fD=g(function(lD){Object.defineProperty(lD,"__esModule",{value:!0});lD.DropSearchIndexOperation=void 0;var uD=dt(),Sp=Q(),aD=Mt();class cD extends aD.AbstractOperation{constructor(e,t){super();this.SERVER_COMMAND_RESPONSE_TYPE=uD.MongoDBResponse,this.collection=e,this.name=t,this.ns=e.fullNamespace}get commandName(){return"dropSearchIndex"}buildCommand(e,t){let n={dropSearchIndex:this.collection.fullNamespace.collection};if(typeof this.name==="string")n.name=this.name;return n}handleOk(e){}buildOptions(e){return{session:this.session,timeoutContext:e}}handleError(e){if(!(e instanceof Sp.MongoServerError&&Sp.isNamespaceNotFoundError(e)))throw e}}lD.DropSearchIndexOperation=cD});var _D=g(function(yD){Object.defineProperty(yD,"__esModule",{value:!0});yD.UpdateSearchIndexOperation=void 0;var dD=dt(),pD=Mt();class mD extends pD.AbstractOperation{constructor(e,t,r){super();this.SERVER_COMMAND_RESPONSE_TYPE=dD.MongoDBResponse,this.collection=e,this.name=t,this.definition=r,this.ns=e.fullNamespace}get commandName(){return"updateSearchIndex"}buildCommand(e,t){return{updateSearchIndex:this.collection.fullNamespace.collection,name:this.name,definition:this.definition}}handleOk(e){}buildOptions(e){return{session:this.session,timeoutContext:e}}}yD.UpdateSearchIndexOperation=mD});var sl=g(function(vD){Object.defineProperty(vD,"__esModule",{value:!0});vD.Collection=void 0;var ED=we(),AD=C_(),OD=b_(),SD=al(),wD=Ch(),CD=H_(),bD=J_(),DD=T5(),ys=Q(),TD=V_(),wp=t_(),MD=F5(),xD=v5(),je=Kr(),il=Z_(),io=Dh(),PD=c_(),BD=tE(),FD=oD(),ND=fD(),ID=_D(),ol=d_(),RD=vi(),ul=Ur(),fe=ae(),Cp=Kn();class $D{constructor(e,t,r){this.db=e,this.s={db:e,options:r,namespace:new fe.MongoDBCollectionNamespace(e.databaseName,t),pkFactory:e.options?.pkFactory??fe.DEFAULT_PK_FACTORY,readPreference:ul.ReadPreference.fromOptions(r),bsonOptions:ED.resolveBSONOptions(r,e),readConcern:RD.ReadConcern.fromOptions(r),writeConcern:Cp.WriteConcern.fromOptions(r)},this.client=e.client}get dbName(){return this.s.namespace.db}get collectionName(){return this.s.namespace.collection}get namespace(){return this.fullNamespace.toString()}get fullNamespace(){return this.s.namespace}get readConcern(){if(this.s.readConcern==null)return this.db.readConcern;return this.s.readConcern}get readPreference(){if(this.s.readPreference==null)return this.db.readPreference;return this.s.readPreference}get bsonOptions(){return this.s.bsonOptions}get writeConcern(){if(this.s.writeConcern==null)return this.db.writeConcern;return this.s.writeConcern}get hint(){return this.s.collectionHint}set hint(e){this.s.collectionHint=fe.normalizeHintField(e)}get timeoutMS(){return}async insertOne(e,t){return await je.executeOperation(this.client,new PD.InsertOneOperation(this,e,fe.resolveOptions(this,t)))}async insertMany(e,t){if(!Array.isArray(e))throw new ys.MongoInvalidArgumentError('Argument "docs" must be an array of documents');t=fe.resolveOptions(this,t??{});let r=Cp.WriteConcern.fromOptions(t)?.w!==0;try{let n=await this.bulkWrite(e.map((s)=>({insertOne:{document:s}})),t);return{acknowledged:r,insertedCount:n.insertedCount,insertedIds:n.insertedIds}}catch(n){if(n&&n.message==="Operation must be an object with an operation key")throw new ys.MongoInvalidArgumentError("Collection.insertMany() cannot be called with an array that has null/undefined values");throw n}}async bulkWrite(e,t){if(!Array.isArray(e))throw new ys.MongoInvalidArgumentError('Argument "operations" must be an array of documents');if(t=fe.resolveOptions(this,t??{}),this.client.topology==null)await je.autoConnect(this.client);let n=t.ordered===!1?this.initializeUnorderedBulkOp(t):this.initializeOrderedBulkOp(t);for(let s of e)n.raw(s);return await n.execute({...t})}async updateOne(e,t,r){return await je.executeOperation(this.client,new ol.UpdateOneOperation(this.s.namespace,e,t,fe.resolveOptions(this,r)))}async replaceOne(e,t,r){return await je.executeOperation(this.client,new ol.ReplaceOneOperation(this.s.namespace,e,t,fe.resolveOptions(this,r)))}async updateMany(e,t,r){return await je.executeOperation(this.client,new ol.UpdateManyOperation(this.s.namespace,e,t,fe.resolveOptions(this,r)))}async deleteOne(e={},t={}){return await je.executeOperation(this.client,new wp.DeleteOneOperation(this.s.namespace,e,fe.resolveOptions(this,t)))}async deleteMany(e={},t={}){return await je.executeOperation(this.client,new wp.DeleteManyOperation(this.s.namespace,e,fe.resolveOptions(this,t)))}async rename(e,t){return await je.executeOperation(this.client,new BD.RenameOperation(this,e,fe.resolveOptions(void 0,{...t,readPreference:ul.ReadPreference.PRIMARY})))}async drop(e){return await this.db.dropCollection(this.collectionName,e)}async findOne(e={},t={}){let{...r}=t;r.singleBatch=!0;let n=this.find(e,r).limit(1),s=await n.next();return await n.close(),s}find(e={},t={}){return new CD.FindCursor(this.client,this.s.namespace,e,fe.resolveOptions(this,t))}async options(e){e=fe.resolveOptions(this,e);let[t]=await this.db.listCollections({name:this.collectionName},{...e,nameOnly:!1}).toArray();if(t==null||t.options==null)throw new ys.MongoAPIError(`collection ${this.namespace} not found`);return t.options}async isCapped(e){let{capped:t}=await this.options(e);return Boolean(t)}async createIndex(e,t,r){let n=r==null?io.CreateIndexesOperation.fromIndexSpecification(this,this.collectionName,e,!1,fe.resolveOptions(this,t),void 0):io.CreateIndexesOperation.fromIndexSpecification(this,this.collectionName,e,!0,t,fe.resolveOptions(this,r));return(await je.executeOperation(this.client,n))[0]}async createIndexes(e,t,r=!1){return await je.executeOperation(this.client,io.CreateIndexesOperation.fromIndexDescriptionArray(this,this.collectionName,e,r,fe.resolveOptions(this,{...t,maxTimeMS:void 0})))}async dropIndex(e,t){return await je.executeOperation(this.client,new io.DropIndexOperation(this,e,{...fe.resolveOptions(this,t),readPreference:ul.ReadPreference.primary}))}async dropIndexes(e){try{return await je.executeOperation(this.client,new io.DropIndexOperation(this,"*",fe.resolveOptions(this,e))),!0}catch(t){if(t instanceof ys.MongoServerError&&ys.isNamespaceNotFoundError(t))return!1;throw t}}listIndexes(e){return new bD.ListIndexesCursor(this,fe.resolveOptions(this,e))}async indexExists(e,t){let r=Array.isArray(e)?e:[e],n=new Set(await this.listIndexes(t).map(({name:s})=>s).toArray());return r.every((s)=>n.has(s))}async indexInformation(e){return await this.indexes({...e,full:e?.full??!1})}async estimatedDocumentCount(e){return await je.executeOperation(this.client,new xD.EstimatedDocumentCountOperation(this,fe.resolveOptions(this,e)))}async countDocuments(e={},t={}){let r=[];if(r.push({$match:e}),typeof t.skip==="number")r.push({$skip:t.skip});if(typeof t.limit==="number")r.push({$limit:t.limit});r.push({$group:{_id:1,n:{$sum:1}}});let n=this.aggregate(r,t),s=await n.next();return await n.close(),s?.n??0}async distinct(e,t={},r={}){return await je.executeOperation(this.client,new MD.DistinctOperation(this,e,t,fe.resolveOptions(this,r)))}async indexes(e){let t=await this.listIndexes(e).toArray();if(e?.full??!0)return t;return Object.fromEntries(t.map(({name:s,key:i})=>[s,Object.entries(i)]))}async findOneAndDelete(e,t){return await je.executeOperation(this.client,new il.FindOneAndDeleteOperation(this,e,fe.resolveOptions(this,t)))}async findOneAndReplace(e,t,r){return await je.executeOperation(this.client,new il.FindOneAndReplaceOperation(this,e,t,fe.resolveOptions(this,r)))}async findOneAndUpdate(e,t,r){return await je.executeOperation(this.client,new il.FindOneAndUpdateOperation(this,e,t,fe.resolveOptions(this,r)))}aggregate(e=[],t){if(!Array.isArray(e))throw new ys.MongoInvalidArgumentError('Argument "pipeline" must be an array of aggregation stages');return new wD.AggregationCursor(this.client,this.s.namespace,e,fe.resolveOptions(this,t))}watch(e=[],t={}){if(!Array.isArray(e))t=e,e=[];return new SD.ChangeStream(this,e,fe.resolveOptions(this,t))}initializeUnorderedBulkOp(e){return new OD.UnorderedBulkOperation(this,fe.resolveOptions(this,e))}initializeOrderedBulkOp(e){return new AD.OrderedBulkOperation(this,fe.resolveOptions(this,e))}async count(e={},t={}){return await je.executeOperation(this.client,new TD.CountOperation(this.fullNamespace,e,fe.resolveOptions(this,t)))}listSearchIndexes(e,t){t=typeof e==="object"?e:t==null?{}:t;let r=e==null?null:typeof e==="object"?null:e;return new DD.ListSearchIndexesCursor(this,r,{...t})}async createSearchIndex(e){let[t]=await this.createSearchIndexes([e]);return t}async createSearchIndexes(e){return await je.executeOperation(this.client,new FD.CreateSearchIndexesOperation(this,e))}async dropSearchIndex(e){return await je.executeOperation(this.client,new ND.DropSearchIndexOperation(this,e))}async updateSearchIndex(e,t){return await je.executeOperation(this.client,new ID.UpdateSearchIndexOperation(this,e,t))}}vD.Collection=$D});var nE=g(function(UD){Object.defineProperty(UD,"__esModule",{value:!0});UD.ChangeStreamCursor=void 0;var cl=al(),bp=Or(),qD=Eh(),jD=Kr(),Dp=ae(),LD=ps();class rE extends LD.AbstractCursor{constructor(e,t,r=[],n={}){super(e,t,{...n,tailable:!0,awaitData:!0});if(this.pipeline=r,this.changeStreamCursorOptions=n,this._resumeToken=null,this.startAtOperationTime=n.startAtOperationTime??null,n.startAfter)this.resumeToken=n.startAfter;else if(n.resumeAfter)this.resumeToken=n.resumeAfter}set resumeToken(e){this._resumeToken=e,this.emit(cl.ChangeStream.RESUME_TOKEN_CHANGED,e)}get resumeToken(){return this._resumeToken}get resumeOptions(){let e={...this.changeStreamCursorOptions};for(let t of["resumeAfter","startAfter","startAtOperationTime"])delete e[t];if(this.resumeToken!=null)if(this.changeStreamCursorOptions.startAfter&&!this.hasReceived)e.startAfter=this.resumeToken;else e.resumeAfter=this.resumeToken;else if(this.startAtOperationTime!=null)e.startAtOperationTime=this.startAtOperationTime;return e}cacheResumeToken(e){if(this.bufferedCount()===0&&this.postBatchResumeToken)this.resumeToken=this.postBatchResumeToken;else this.resumeToken=e;this.hasReceived=!0}_processBatch(e){let{postBatchResumeToken:t}=e;if(t){if(this.postBatchResumeToken=t,e.batchSize===0)this.resumeToken=t}}clone(){return new rE(this.client,this.namespace,this.pipeline,{...this.cursorOptions})}async _initialize(e){let t=new qD.AggregateOperation(this.namespace,this.pipeline,{...this.cursorOptions,...this.changeStreamCursorOptions,session:e}),r=await jD.executeOperation(e.client,t,this.timeoutContext),n=t.server;if(this.maxWireVersion=Dp.maxWireVersion(n),this.startAtOperationTime==null&&this.changeStreamCursorOptions.resumeAfter==null&&this.changeStreamCursorOptions.startAfter==null)this.startAtOperationTime=r.operationTime;return this._processBatch(r),this.emit(bp.INIT,r),this.emit(bp.RESPONSE),{server:n,session:e,response:r}}async getMore(){let e=await super.getMore();return this.maxWireVersion=Dp.maxWireVersion(this.server),this._processBatch(e),this.emit(cl.ChangeStream.MORE,e),this.emit(cl.ChangeStream.RESPONSE),e}}UD.ChangeStreamCursor=rE});var KD=g(function(WD){Object.defineProperty(WD,"__esModule",{value:!0});WD.ListCollectionsOperation=void 0;var ll=dt(),zD=nr(),oo=Mt();class sE extends zD.CommandOperation{constructor(e,t,r){super(e,r);if(this.SERVER_COMMAND_RESPONSE_TYPE=ll.CursorResponse,this.options={...r},delete this.options.writeConcern,this.db=e,this.filter=t,this.nameOnly=!!this.options.nameOnly,this.authorizedCollections=!!this.options.authorizedCollections,typeof this.options.batchSize==="number")this.batchSize=this.options.batchSize;this.SERVER_COMMAND_RESPONSE_TYPE=this.explain?ll.ExplainedCursorResponse:ll.CursorResponse}get commandName(){return"listCollections"}buildCommandDocument(e){let t={listCollections:1,filter:this.filter,cursor:this.batchSize?{batchSize:this.batchSize}:{},nameOnly:this.nameOnly,authorizedCollections:this.authorizedCollections};if(this.options.comment!==void 0)t.comment=this.options.comment;return t}handleOk(e){return e}}WD.ListCollectionsOperation=sE;oo.defineAspects(sE,[oo.Aspect.READ_OPERATION,oo.Aspect.RETRYABLE,oo.Aspect.CURSOR_CREATING,oo.Aspect.SUPPORTS_RAW_DATA])});var oE=g(function(QD){Object.defineProperty(QD,"__esModule",{value:!0});QD.ListCollectionsCursor=void 0;var GD=Kr(),YD=KD(),JD=ps();class iE extends JD.AbstractCursor{constructor(e,t,r){super(e.client,e.s.namespace,{...r});this.parent=e,this.filter=t,this.options=r}clone(){return new iE(this.parent,this.filter,{...this.options,...this.cursorOptions})}async _initialize(e){let t=new YD.ListCollectionsOperation(this.parent,this.filter,{...this.cursorOptions,...this.options,session:e,signal:this.signal}),r=await GD.executeOperation(this.parent.client,t,this.timeoutContext);return{server:t.server,session:e,response:r}}}QD.ListCollectionsCursor=iE});var oT=g(function(sT){Object.defineProperty(sT,"__esModule",{value:!0});sT.RunCommandCursor=void 0;var ei=Q(),Tp=Kr(),ZD=N_(),eT=Rc(),tT=ae(),rT=ps();class nT extends rT.AbstractCursor{setComment(e){return this.getMoreOptions.comment=e,this}setMaxTimeMS(e){return this.getMoreOptions.maxAwaitTimeMS=e,this}setBatchSize(e){return this.getMoreOptions.batchSize=e,this}clone(){throw new ei.MongoAPIError("Clone not supported, create a new cursor with db.runCursorCommand")}withReadConcern(e){throw new ei.MongoAPIError("RunCommandCursor does not support readConcern it must be attached to the command being run")}addCursorFlag(e,t){throw new ei.MongoAPIError("RunCommandCursor does not support cursor flags, they must be attached to the command being run")}maxTimeMS(e){throw new ei.MongoAPIError("maxTimeMS must be configured on the command document directly, to configure getMore.maxTimeMS use cursor.setMaxTimeMS()")}batchSize(e){throw new ei.MongoAPIError("batchSize must be configured on the command document directly, to configure getMore.batchSize use cursor.setBatchSize()")}constructor(e,t,r={}){super(e.client,tT.ns(e.namespace),r);this.getMoreOptions={},this.db=e,this.command=Object.freeze({...t})}async _initialize(e){let t=new eT.RunCursorCommandOperation(this.db.s.namespace,this.command,{...this.cursorOptions,session:e,readPreference:this.cursorOptions.readPreference}),r=await Tp.executeOperation(this.client,t,this.timeoutContext);return{server:t.server,session:e,response:r}}async getMore(){if(!this.session)throw new ei.MongoRuntimeError("Unexpected null session. A cursor creating command should have set this");let e=new ZD.GetMoreOperation(this.namespace,this.id,this.server,{...this.cursorOptions,session:this.session,...this.getMoreOptions});return await Tp.executeOperation(this.client,e,this.timeoutContext)}}sT.RunCommandCursor=nT});var yT=g(function(pT){Object.defineProperty(pT,"__esModule",{value:!0});pT.CreateCollectionOperation=void 0;pT.createCollections=$oe;var Mp=Uo(),uT=dt(),aT=sl(),cT=Q(),lT=Gn(),hT=ae(),fT=nr(),hl=Kr(),dT=Dh(),xp=Mt(),Ioe=new Set(["w","wtimeout","timeoutMS","j","fsync","pkFactory","raw","readPreference","session","readConcern","writeConcern","raw","fieldsAsRaw","useBigInt64","promoteLongs","promoteValues","promoteBuffers","bsonRegExp","serializeFunctions","ignoreUndefined","enableUtf8Validation"]),Roe="Driver support of Queryable Encryption is incompatible with server. Upgrade server to use Queryable Encryption.";class Th extends fT.CommandOperation{constructor(e,t,r={}){super(e,r);this.SERVER_COMMAND_RESPONSE_TYPE=uT.MongoDBResponse,this.options=r,this.db=e,this.name=t}get commandName(){return"create"}buildCommandDocument(e,t){let r=([n,s])=>s!=null&&typeof s!=="function"&&!Ioe.has(n);return{create:this.name,...Object.fromEntries(Object.entries(this.options).filter(r))}}handleOk(e){return new aT.Collection(this.db,this.name,this.options)}}pT.CreateCollectionOperation=Th;async function $oe(e,t,r){let n=lT.TimeoutContext.create({session:r.session,serverSelectionTimeoutMS:e.client.s.options.serverSelectionTimeoutMS,waitQueueTimeoutMS:e.client.s.options.waitQueueTimeoutMS,timeoutMS:r.timeoutMS}),s=r.encryptedFields??e.client.s.options.autoEncryption?.encryptedFieldsMap?.[`${e.databaseName}.${t}`];if(s){class o extends Th{buildCommandDocument(c,l){if(!c.description.loadBalanced&&hT.maxWireVersion(c)<Mp.MIN_SUPPORTED_QE_WIRE_VERSION)throw new cT.MongoCompatibilityError(`${Roe} The minimum server version required is ${Mp.MIN_SUPPORTED_QE_SERVER_VERSION}`);return super.buildCommandDocument(c,l)}}let u=s.escCollection??`enxcol_.${t}.esc`,a=s.ecocCollection??`enxcol_.${t}.ecoc`;for(let c of[u,a]){let l=new o(e,c,{clusteredIndex:{key:{_id:1},unique:!0},session:r.session});await hl.executeOperation(e.client,l,n)}if(!r.encryptedFields)r={...r,encryptedFields:s}}let i=await hl.executeOperation(e.client,new Th(e,t,r),n);if(s){let o=dT.CreateIndexesOperation.fromIndexSpecification(e,t,{__safeContent__:1},!1,{session:r.session},void 0);await hl.executeOperation(e.client,o,n)}return i}xp.defineAspects(Th,[xp.Aspect.WRITE_OPERATION])});var wT=g(function(OT){Object.defineProperty(OT,"__esModule",{value:!0});OT.DropDatabaseOperation=OT.DropCollectionOperation=void 0;OT.dropCollections=koe;var gT=Iu(),Bp=dt(),_T=ps(),ET=Q(),AT=Gn(),Fp=nr(),Pp=Kr(),Nu=Mt();class Mh extends Fp.CommandOperation{constructor(e,t,r={}){super(e,r);this.SERVER_COMMAND_RESPONSE_TYPE=Bp.MongoDBResponse,this.options=r,this.name=t}get commandName(){return"drop"}buildCommandDocument(e,t){return{drop:this.name}}handleOk(e){return!0}handleError(e){if(!(e instanceof gT.MongoServerError&&ET.isNamespaceNotFoundError(e)))throw e;return!1}}OT.DropCollectionOperation=Mh;async function koe(e,t,r){let n=AT.TimeoutContext.create({session:r.session,serverSelectionTimeoutMS:e.client.s.options.serverSelectionTimeoutMS,waitQueueTimeoutMS:e.client.s.options.waitQueueTimeoutMS,timeoutMS:r.timeoutMS}),s=e.client.s.options.autoEncryption?.encryptedFieldsMap,i=r.encryptedFields??s?.[`${e.databaseName}.${t}`];if(!i&&s)i=(await e.listCollections({name:t},{nameOnly:!1,session:r.session,timeoutContext:new _T.CursorTimeoutContext(n,Symbol())}).toArray())?.[0]?.options?.encryptedFields;if(i){let o=i.escCollection||`enxcol_.${t}.esc`,u=i.ecocCollection||`enxcol_.${t}.ecoc`;for(let a of[o,u]){let c=new Mh(e,a,r);await Pp.executeOperation(e.client,c,n)}}return await Pp.executeOperation(e.client,new Mh(e,t,r),n)}class uE extends Fp.CommandOperation{constructor(e,t){super(e,t);this.SERVER_COMMAND_RESPONSE_TYPE=Bp.MongoDBResponse,this.options=t}get commandName(){return"dropDatabase"}buildCommandDocument(e,t){return{dropDatabase:1}}handleOk(e){return!0}}OT.DropDatabaseOperation=uE;Nu.defineAspects(Mh,[Nu.Aspect.WRITE_OPERATION]);Nu.defineAspects(uE,[Nu.Aspect.WRITE_OPERATION])});var BT=g(function(xT){Object.defineProperty(xT,"__esModule",{value:!0});xT.ProfilingLevelOperation=void 0;var CT=we(),bT=dt(),Np=Q(),DT=nr();class TT extends bT.MongoDBResponse{get was(){return this.get("was",CT.BSONType.int,!0)}}class MT extends DT.CommandOperation{constructor(e,t){super(e,t);this.SERVER_COMMAND_RESPONSE_TYPE=TT,this.options=t}get commandName(){return"profile"}buildCommandDocument(e){return{profile:-1}}handleOk(e){if(e.ok===1){let t=e.was;if(t===0)return"off";if(t===1)return"slow_only";if(t===2)return"all";throw new Np.MongoUnexpectedServerResponseError(`Illegal profiling level value ${t}`)}else throw new Np.MongoUnexpectedServerResponseError("Error with profile command")}}xT.ProfilingLevelOperation=MT});var aE=g(function(vT){Object.defineProperty(vT,"__esModule",{value:!0});vT.SetProfilingLevelOperation=vT.ProfilingLevel=void 0;var FT=dt(),NT=Q(),IT=ae(),RT=nr(),Loe=new Set(["off","slow_only","all"]);vT.ProfilingLevel=Object.freeze({off:"off",slowOnly:"slow_only",all:"all"});class $T extends RT.CommandOperation{constructor(e,t,r){super(e,r);switch(this.SERVER_COMMAND_RESPONSE_TYPE=FT.MongoDBResponse,this.options=r,t){case vT.ProfilingLevel.off:this.profile=0;break;case vT.ProfilingLevel.slowOnly:this.profile=1;break;case vT.ProfilingLevel.all:this.profile=2;break;default:this.profile=0;break}this.level=t}get commandName(){return"profile"}buildCommandDocument(e){let t=this.level;if(!Loe.has(t))throw new NT.MongoInvalidArgumentError(`Profiling level must be one of "${IT.enumToString(vT.ProfilingLevel)}"`);return{profile:this.profile}}handleOk(e){return this.level}}vT.SetProfilingLevelOperation=$T});var VT=g(function(LT){Object.defineProperty(LT,"__esModule",{value:!0});LT.DbStatsOperation=void 0;var qT=dt(),jT=nr(),Ip=Mt();class cE extends jT.CommandOperation{constructor(e,t){super(e,t);this.SERVER_COMMAND_RESPONSE_TYPE=qT.MongoDBResponse,this.options=t}get commandName(){return"dbStats"}buildCommandDocument(e){let t={dbStats:!0};if(this.options.scale!=null)t.scale=this.options.scale;return t}}LT.DbStatsOperation=cE;Ip.defineAspects(cE,[Ip.Aspect.READ_OPERATION])});var jp=g(function(oM){Object.defineProperty(oM,"__esModule",{value:!0});oM.Db=void 0;var zT=w_(),Rp=we(),WT=al(),$p=sl(),ti=Or(),HT=Ch(),KT=oE(),GT=oT(),vp=Q(),YT=yT(),kp=wT(),Tn=Kr(),JT=Dh(),QT=BT(),XT=S_(),ZT=tE(),eM=Rc(),tM=aE(),rM=VT(),nM=vi(),qp=Ur(),Ye=ae(),sM=Kn(),Uoe=["writeConcern","readPreference","readPreferenceTags","native_parser","forceServerObjectId","pkFactory","serializeFunctions","raw","authSource","ignoreUndefined","readConcern","retryMiliSeconds","numberOfRetries","useBigInt64","promoteBuffers","promoteLongs","bsonRegExp","enableUtf8Validation","promoteValues","compression","retryWrites"];class iM{static{this.SYSTEM_NAMESPACE_COLLECTION=ti.SYSTEM_NAMESPACE_COLLECTION}static{this.SYSTEM_INDEX_COLLECTION=ti.SYSTEM_INDEX_COLLECTION}static{this.SYSTEM_PROFILE_COLLECTION=ti.SYSTEM_PROFILE_COLLECTION}static{this.SYSTEM_USER_COLLECTION=ti.SYSTEM_USER_COLLECTION}static{this.SYSTEM_COMMAND_COLLECTION=ti.SYSTEM_COMMAND_COLLECTION}static{this.SYSTEM_JS_COLLECTION=ti.SYSTEM_JS_COLLECTION}constructor(e,t,r){if(r=r??{},r=Ye.filterOptions(r,Uoe),typeof t==="string"&&t.includes("."))throw new vp.MongoInvalidArgumentError("Database names cannot contain the character '.'");this.s={options:r,readPreference:qp.ReadPreference.fromOptions(r),bsonOptions:Rp.resolveBSONOptions(r,e),pkFactory:r?.pkFactory??Ye.DEFAULT_PK_FACTORY,readConcern:nM.ReadConcern.fromOptions(r),writeConcern:sM.WriteConcern.fromOptions(r),namespace:new Ye.MongoDBNamespace(t)},this.client=e}get databaseName(){return this.s.namespace.db}get options(){return this.s.options}get secondaryOk(){return this.s.readPreference?.preference!=="primary"||!1}get readConcern(){return this.s.readConcern}get readPreference(){if(this.s.readPreference==null)return this.client.readPreference;return this.s.readPreference}get bsonOptions(){return this.s.bsonOptions}get writeConcern(){return this.s.writeConcern}get namespace(){return this.s.namespace.toString()}get timeoutMS(){return}async createCollection(e,t){return t=Ye.resolveOptions(this,t),await YT.createCollections(this,e,t)}async command(e,t){return await Tn.executeOperation(this.client,new eM.RunCommandOperation(this.s.namespace,e,Ye.resolveOptions(void 0,{...Rp.resolveBSONOptions(t),timeoutMS:t?.timeoutMS??this.timeoutMS,session:t?.session,readPreference:t?.readPreference,signal:t?.signal})))}aggregate(e=[],t){return new HT.AggregationCursor(this.client,this.s.namespace,e,Ye.resolveOptions(this,t))}admin(){return new zT.Admin(this)}collection(e,t={}){if(typeof t==="function")throw new vp.MongoInvalidArgumentError("The callback form of this helper has been removed.");return new $p.Collection(this,e,Ye.resolveOptions(this,t))}async stats(e){return await Tn.executeOperation(this.client,new rM.DbStatsOperation(this,Ye.resolveOptions(this,e)))}listCollections(e={},t={}){return new KT.ListCollectionsCursor(this,e,Ye.resolveOptions(this,t))}async renameCollection(e,t,r){return await Tn.executeOperation(this.client,new ZT.RenameOperation(this.collection(e),t,Ye.resolveOptions(void 0,{...r,readPreference:qp.ReadPreference.primary})))}async dropCollection(e,t){return t=Ye.resolveOptions(this,t),await kp.dropCollections(this,e,t)}async dropDatabase(e){return await Tn.executeOperation(this.client,new kp.DropDatabaseOperation(this,Ye.resolveOptions(this,e)))}async collections(e){return e=Ye.resolveOptions(this,e),(await this.listCollections({},{...e,nameOnly:!0}).toArray()).filter(({name:r})=>!r.includes("$")).map(({name:r})=>new $p.Collection(this,r,this.s.options))}async createIndex(e,t,r){return(await Tn.executeOperation(this.client,JT.CreateIndexesOperation.fromIndexSpecification(this,e,t,!1,r??{},void 0)))[0]}async removeUser(e,t){return await Tn.executeOperation(this.client,new XT.RemoveUserOperation(this,e,Ye.resolveOptions(this,t)))}async setProfilingLevel(e,t){return await Tn.executeOperation(this.client,new tM.SetProfilingLevelOperation(this,e,Ye.resolveOptions(this,t)))}async profilingLevel(e){return await Tn.executeOperation(this.client,new QT.ProfilingLevelOperation(this,Ye.resolveOptions(this,e)))}async indexInformation(e,t){return await this.collection(e).indexInformation(Ye.resolveOptions(this,t))}watch(e=[],t={}){if(!Array.isArray(e))t=e,e=[];return new WT.ChangeStream(this,e,Ye.resolveOptions(this,t))}runCursorCommand(e,t){return new GT.RunCommandCursor(this,e,{...t})}}oM.Db=iM});var Ru=g(function(hM){Object.defineProperty(hM,"__esModule",{value:!0});hM.AuthProvider=hM.AuthContext=void 0;var aM=Q();class cM{constructor(e,t,r){this.reauthenticating=!1,this.connection=e,this.credentials=t,this.options=r}}hM.AuthContext=cM;class lM{async prepare(e,t){return e}async reauth(e){if(e.reauthenticating)throw new aM.MongoRuntimeError("Reauthentication already in progress.");try{e.reauthenticating=!0,await this.auth(e)}finally{e.reauthenticating=!1}}}hM.AuthProvider=lM});var Vp=g(function(EM){Object.defineProperty(EM,"__esModule",{value:!0});EM.GSSAPI=EM.GSSAPICanonicalizationValue=void 0;EM.performGSSAPICanonicalizeHostName=_M;EM.resolveCname=hE;var fl=G("dns"),dM=Xi(),Up=Q(),pM=ae(),mM=Ru();EM.GSSAPICanonicalizationValue=Object.freeze({on:!0,off:!1,none:"none",forward:"forward",forwardAndReverse:"forwardAndReverse"});async function lE(e,t){return await e.command(pM.ns("$external.$cmd"),t)}var Ph;class yM extends mM.AuthProvider{async auth(e){let{connection:t,credentials:r}=e;if(r==null)throw new Up.MongoMissingCredentialsError("Credentials required for GSSAPI authentication");let{username:n}=r,s=await zoe(e),i=await s.step(""),o=await lE(t,Woe(i)),u=await gM(s,10,o.payload),a=await lE(t,Hoe(u,o.conversationId)),c=await Koe(s,n,a.payload);await lE(t,{saslContinue:1,conversationId:a.conversationId,payload:c})}}EM.GSSAPI=yM;async function zoe({options:{hostAddress:e,runtime:t},credentials:r}){if(!e||typeof e.host!=="string"||!r)throw new Up.MongoInvalidArgumentError("Connection must have host and port and credentials defined.");let{os:n}=await t;if(Goe(),"kModuleError"in Ph)throw Ph.kModuleError;let{initializeClient:s}=Ph,{username:i,password:o}=r,u=r.mechanismProperties,a=u.SERVICE_NAME??"mongodb",c=await _M(e.host,u),l={};if(o!=null)Object.assign(l,{user:i,password:o});let f=u.SERVICE_HOST??c,h=`${a}${n.platform()==="win32"?"/":"@"}${f}`;if("SERVICE_REALM"in u)h=`${h}@${u.SERVICE_REALM}`;return await s(h,l)}function Woe(e){return{saslStart:1,mechanism:"GSSAPI",payload:e,autoAuthorize:1}}function Hoe(e,t){return{saslContinue:1,conversationId:t,payload:e}}async function gM(e,t,r){try{return await e.step(r)||""}catch(n){if(t===0)throw n;return await gM(e,t-1,r)}}async function Koe(e,t,r){let n=await e.unwrap(r);return await e.wrap(n||"",{user:t})}async function _M(e,t){let r=t.CANONICALIZE_HOST_NAME;if(!r||r===EM.GSSAPICanonicalizationValue.none)return e;if(r===EM.GSSAPICanonicalizationValue.on||r===EM.GSSAPICanonicalizationValue.forwardAndReverse){let{address:n}=await fl.promises.lookup(e);try{let s=await fl.promises.resolve(n,"PTR");return s.length>0?s[0]:e}catch{return await hE(e)}}else return await hE(e)}async function hE(e){try{let t=await fl.promises.resolve(e,"CNAME");return t.length>0?t[0]:e}catch{return e}}function Goe(){if(!Ph)Ph=dM.getKerberos()}});var uo=g(function(OM){Object.defineProperty(OM,"__esModule",{value:!0});OM.AUTH_MECHS_AUTH_SRC_EXTERNAL=OM.AuthMechanism=void 0;OM.AuthMechanism=Object.freeze({MONGODB_AWS:"MONGODB-AWS",MONGODB_DEFAULT:"DEFAULT",MONGODB_GSSAPI:"GSSAPI",MONGODB_PLAIN:"PLAIN",MONGODB_SCRAM_SHA1:"SCRAM-SHA-1",MONGODB_SCRAM_SHA256:"SCRAM-SHA-256",MONGODB_X509:"MONGODB-X509",MONGODB_OIDC:"MONGODB-OIDC"});OM.AUTH_MECHS_AUTH_SRC_EXTERNAL=new Set([OM.AuthMechanism.MONGODB_GSSAPI,OM.AuthMechanism.MONGODB_AWS,OM.AuthMechanism.MONGODB_OIDC,OM.AuthMechanism.MONGODB_X509])});var Wp=g(function(DM){Object.defineProperty(DM,"__esModule",{value:!0});DM.MongoCredentials=DM.DEFAULT_ALLOWED_HOSTS=void 0;var xt=Q(),bM=Vp(),yt=uo();function Qoe(e){if(e){if(Array.isArray(e.saslSupportedMechs))return e.saslSupportedMechs.includes(yt.AuthMechanism.MONGODB_SCRAM_SHA256)?yt.AuthMechanism.MONGODB_SCRAM_SHA256:yt.AuthMechanism.MONGODB_SCRAM_SHA1}return yt.AuthMechanism.MONGODB_SCRAM_SHA256}var wM=["test","azure","gcp","k8s"],CM="Auth mechanism property ALLOWED_HOSTS must be an array of strings.";DM.DEFAULT_ALLOWED_HOSTS=["*.mongodb.net","*.mongodb-qa.net","*.mongodb-dev.net","*.mongodbgov.net","localhost","127.0.0.1","::1","*.mongo.com"];var Xoe="TOKEN_RESOURCE must be set in the auth mechanism properties when ENVIRONMENT is azure or gcp.";class zp{constructor(e){if(this.username=e.username??"",this.password=e.password,this.source=e.source,!this.source&&e.db)this.source=e.db;if(this.mechanism=e.mechanism||yt.AuthMechanism.MONGODB_DEFAULT,this.mechanismProperties=e.mechanismProperties||{},this.mechanism===yt.AuthMechanism.MONGODB_OIDC&&!this.mechanismProperties.ALLOWED_HOSTS)this.mechanismProperties={...this.mechanismProperties,ALLOWED_HOSTS:DM.DEFAULT_ALLOWED_HOSTS};Object.freeze(this.mechanismProperties),Object.freeze(this)}equals(e){return this.mechanism===e.mechanism&&this.username===e.username&&this.password===e.password&&this.source===e.source}resolveAuthMechanism(e){if(this.mechanism.match(/DEFAULT/i))return new zp({username:this.username,password:this.password,source:this.source,mechanism:Qoe(e),mechanismProperties:this.mechanismProperties});return this}validate(){if((this.mechanism===yt.AuthMechanism.MONGODB_GSSAPI||this.mechanism===yt.AuthMechanism.MONGODB_PLAIN||this.mechanism===yt.AuthMechanism.MONGODB_SCRAM_SHA1||this.mechanism===yt.AuthMechanism.MONGODB_SCRAM_SHA256)&&!this.username)throw new xt.MongoMissingCredentialsError(`Username required for mechanism '${this.mechanism}'`);if(this.mechanism===yt.AuthMechanism.MONGODB_PLAIN&&(this.username.includes("\x00")||this.password.includes("\x00")))throw new xt.MongoInvalidArgumentError(`Username and password cannot contain NUL characters for mechanism '${this.mechanism}'`);if(this.mechanism===yt.AuthMechanism.MONGODB_OIDC){if(this.username&&this.mechanismProperties.ENVIRONMENT&&this.mechanismProperties.ENVIRONMENT!=="azure")throw new xt.MongoInvalidArgumentError(`username and a non-azure ENVIRONMENT may not be used together for mechanism '${this.mechanism}'.`);if(this.username&&this.password)throw new xt.MongoInvalidArgumentError(`No password is allowed with a username for '${this.mechanism}'.`);if((this.mechanismProperties.ENVIRONMENT==="azure"||this.mechanismProperties.ENVIRONMENT==="gcp")&&!this.mechanismProperties.TOKEN_RESOURCE)throw new xt.MongoInvalidArgumentError(Xoe);if(this.mechanismProperties.ENVIRONMENT&&!wM.includes(this.mechanismProperties.ENVIRONMENT))throw new xt.MongoInvalidArgumentError(`Currently only a ENVIRONMENT in ${wM.join(",")} is supported for mechanism '${this.mechanism}'.`);if(!this.mechanismProperties.ENVIRONMENT&&!this.mechanismProperties.OIDC_CALLBACK&&!this.mechanismProperties.OIDC_HUMAN_CALLBACK)throw new xt.MongoInvalidArgumentError(`Either a ENVIRONMENT, OIDC_CALLBACK, or OIDC_HUMAN_CALLBACK must be specified for mechanism '${this.mechanism}'.`);if(this.mechanismProperties.ENVIRONMENT&&(this.mechanismProperties.OIDC_CALLBACK||this.mechanismProperties.OIDC_HUMAN_CALLBACK))throw new xt.MongoInvalidArgumentError(`ENVIRONMENT may not be used together with OIDC_CALLBACK or OIDC_HUMAN_CALLBACK for mechanism '${this.mechanism}'.`);if(this.mechanismProperties.ALLOWED_HOSTS){let t=this.mechanismProperties.ALLOWED_HOSTS;if(!Array.isArray(t))throw new xt.MongoInvalidArgumentError(CM);for(let r of t)if(typeof r!=="string")throw new xt.MongoInvalidArgumentError(CM)}}if(yt.AUTH_MECHS_AUTH_SRC_EXTERNAL.has(this.mechanism)){if(this.source!=null&&this.source!=="$external")throw new xt.MongoAPIError(`Invalid source for mechanism '${this.mechanism}' specified, it must be '$external'.`)}if(this.mechanism===yt.AuthMechanism.MONGODB_PLAIN&&this.source==null)throw new xt.MongoAPIError("PLAIN Authentication Mechanism needs an auth source");if(this.mechanism===yt.AuthMechanism.MONGODB_X509&&this.password!=null){if(this.password===""){Reflect.set(this,"password",void 0);return}throw new xt.MongoAPIError("Password not allowed for mechanism MONGODB-X509")}let e=this.mechanismProperties.CANONICALIZE_HOST_NAME??!1;if(!Object.values(bM.GSSAPICanonicalizationValue).includes(e))throw new xt.MongoAPIError("Invalid CANONICALIZE_HOST_NAME value")}[Symbol.for("nodejs.util.inspect.custom")](e,t,r){return r(this.toJSON(),t)}toJSON(){let e={...this,username:"<redacted>",password:"<redacted>"};if(this.mechanismProperties.AWS_SESSION_TOKEN!=null)e.mechanismProperties={...this.mechanismProperties,AWS_SESSION_TOKEN:"<redacted>"};return e}static merge(e,t){return new zp({username:t.username??e?.username??"",password:t.password??e?.password??"",mechanism:t.mechanism??e?.mechanism??yt.AuthMechanism.MONGODB_DEFAULT,mechanismProperties:t.mechanismProperties??e?.mechanismProperties??{},source:t.source??t.db??e?.source??"admin"})}}DM.MongoCredentials=zp});var xM=g(function(J9e,Zoe){Zoe.exports={name:"mongodb",version:"7.9.1",description:"The official MongoDB driver for Node.js",main:"lib/index.js",files:["lib","src","etc/prepare.js","mongodb.d.ts","tsconfig.json"],types:"mongodb.d.ts",repository:{type:"git",url:"git@github.com:mongodb/node-mongodb-native.git"},keywords:["mongodb","driver","official"],author:{name:"The MongoDB NodeJS Team",email:"dbx-node@mongodb.com"},dependencies:{"@mongodb-js/saslprep":"^1.5.0",bson:"^7.3.2","mongodb-connection-string-url":"^7.0.2"},peerDependencies:{"@aws-sdk/credential-providers":"^3.806.0","@mongodb-js/zstd":"^7.0.0","gcp-metadata":"^7.0.1",kerberos:"^7.0.0","mongodb-client-encryption":"^7.2.0",snappy:"^7.3.2",socks:"^2.8.6"},peerDependenciesMeta:{"@aws-sdk/credential-providers":{optional:!0},"@mongodb-js/zstd":{optional:!0},kerberos:{optional:!0},snappy:{optional:!0},"mongodb-client-encryption":{optional:!0},"gcp-metadata":{optional:!0},socks:{optional:!0}},devDependencies:{"@aws-sdk/credential-providers":"^3.1117.0","@iarna/toml":"^2.2.5","@istanbuljs/nyc-config-typescript":"^1.0.2","@microsoft/api-extractor":"^7.59.0","@microsoft/tsdoc-config":"^0.18.1","@mongodb-js/zstd":"^7.0.0","@types/chai-subset":"^1.3.6","@types/express":"^5.0.6","@types/kerberos":"^1.1.5","@types/mocha":"^10.0.10","@types/node":"^22.20.1","@types/saslprep":"^1.0.3","@types/semver":"^7.8.0","@types/sinon":"^17.0.4","@types/whatwg-url":"^13.0.0","@typescript-eslint/eslint-plugin":"^8.68.0","@typescript-eslint/parser":"^8.68.0",aws4:"^1.13.2",chai:"^5.3.3","chai-subset":"^1.6.0",chalk:"^4.1.2",esbuild:"^0.28.2",eslint:"^9.39.5","eslint-config-prettier":"^10.1.8","eslint-plugin-mocha":"^10.5.0","eslint-plugin-prettier":"^5.5.6","eslint-plugin-simple-import-sort":"^12.1.1","eslint-plugin-tsdoc":"^0.5.2","eslint-plugin-unused-imports":"^4.4.1",express:"^5.2.1","gcp-metadata":"^7.0.1","js-yaml":"^4.3.1",mocha:"^11.8.0","mocha-sinon":"^2.1.2","mongodb-client-encryption":"^7.2.1",nyc:"^17.1.0",prettier:"3.6.2",semver:"^7.8.5",sinon:"^18.0.1","sinon-chai":"^4.0.1",snappy:"^7.4.3",socks:"^2.8.9","source-map-support":"^0.5.21","ts-node":"^10.9.2",tsd:"^0.33.0",typescript:"5.8.3","typescript-cached-transpile":"^0.0.6","v8-heapsnapshot":"^1.3.1",yargs:"^18.1.0"},license:"Apache-2.0",engines:{node:">=20.19.0"},bugs:{url:"https://jira.mongodb.org/projects/NODE/issues/"},homepage:"https://github.com/mongodb/node-mongodb-native",scripts:{"build:evergreen":"node .evergreen/generate_evergreen_tasks.js","build:ts":"node ./node_modules/typescript/bin/tsc","build:dts":"npm run build:ts && api-extractor run && node etc/clean_definition_files.cjs && ESLINT_USE_FLAT_CONFIG=false eslint --no-ignore --fix mongodb.d.ts","build:docs":"./etc/docs/build.ts","build:typedoc":"typedoc","build:nightly":"node ./.github/scripts/nightly.mjs","check:bench":"npm --prefix test/benchmarks/driver_bench start","check:coverage":"nyc npm run test:all","check:integration-coverage":"nyc npm run check:test","check:lambda":"npm run build:bundle && nyc mocha --config test/mocha_lambda.js test/integration/node-specific/examples/handler.test.js","check:lambda:aws":"npm run build:bundle && nyc mocha --config test/mocha_lambda.js test/integration/node-specific/examples/aws_handler.test.js","check:lint":"npm run build:dts && npm run check:dts && npm run check:eslint && npm run check:tsd","check:eslint":"npm run build:dts && ESLINT_USE_FLAT_CONFIG=false eslint -v && ESLINT_USE_FLAT_CONFIG=false eslint --max-warnings=0 --ext '.js,.ts' src test","check:tsd":"tsd --version && tsd","check:dependencies":"npm run build:bundle && mocha test/action/dependency.test.ts","check:dts":"npm run build:bundle && node ./node_modules/typescript/bin/tsc --target es2023 --module commonjs --noEmit mongodb.d.ts && tsd","check:search-indexes":"npm run build:bundle && nyc mocha --config test/mocha_mongodb.js test/manual/search-index-management.prose.test.ts","check:test":"npm run build:bundle && nyc mocha --config test/mocha_mongodb.js test/integration","check:test:debug":"npm run mocha:debug -- --config test/mocha_mongodb.js test/integration","check:test-bundled":"MONGODB_BUNDLED=true npm run check:test","check:unit":"npm run build:bundle && nyc mocha test/unit","check:unit:debug":"npm run mocha:debug -- test/unit","check:unit-bundled":"MONGODB_BUNDLED=true npm run check:unit","check:ts":"node ./node_modules/typescript/bin/tsc -v && node ./node_modules/typescript/bin/tsc --noEmit","check:atlas":"npm run build:bundle && nyc mocha --config test/manual/mocharc.js test/manual/atlas_connectivity.test.ts","check:drivers-atlas-testing":"npm run build:bundle && nyc mocha --config test/mocha_mongodb.js test/atlas/drivers_atlas_testing.test.ts","check:aws":"npm run build:bundle && nyc mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_aws.test.ts test/integration/auth/mongodb_aws.prose.test.ts","check:oidc-auth":"npm run build:bundle && nyc mocha --config test/mocha_mongodb.js test/integration/auth/auth.spec.test.ts","check:oidc-test":"npm run build:bundle && nyc mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_oidc.prose.test.ts","check:kerberos":"npm run build:bundle && nyc mocha --config test/manual/mocharc.js test/manual/kerberos.test.ts","check:tls":"npm run build:bundle && nyc mocha --config test/manual/mocharc.js test/manual/tls_support.test.ts","check:ldap":"npm run build:bundle && nyc mocha --config test/manual/mocharc.js test/manual/ldap.test.ts","check:socks5":"npm run build:bundle && nyc mocha --config test/manual/mocharc.js test/manual/socks5.test.ts","check:csfle":"npm run build:bundle && nyc mocha --config test/mocha_mongodb.js test/integration/client-side-encryption","check:snappy":"npm run build:bundle && nyc mocha test/unit/assorted/snappy.test.js","check:x509":"npm run build:bundle && nyc mocha test/manual/x509_auth.test.ts","check:sfp":"npm run build:bundle && nyc mocha test/manual/sfp.test.ts","mocha:debug":"npm run build:bundle && node --inspect --enable-source-maps --no-experimental-strip-types ./node_modules/mocha/bin/mocha.js","build:bundle":"npm run bundle:driver && npm run bundle:types && npm run build:runtime-barrel","build:runtime-barrel":"node etc/build-runtime-barrel.mjs","bundle:driver":"node etc/bundle-driver.mjs","bundle:types":"npx tsc --project ./tsconfig.json --declaration --emitDeclarationOnly --declarationDir test/tools/runner/bundle/types","fix:eslint":"npm run check:eslint -- --fix",prepare:"node etc/prepare.js","preview:docs":"ts-node etc/docs/preview.ts","switch:to-bundled":"MONGODB_BUNDLED=true npm run build:runtime-barrel","switch:to-unbundled":"MONGODB_BUNDLED=false npm run build:runtime-barrel",test:"npm run check:lint && npm run test:all","test:all":"npm run check:unit && npm run check:test","update:docs":"npm run build:docs -- --yes"},tsd:{directory:"test/types",compilerOptions:{strict:!0,target:"esnext",module:"commonjs",moduleResolution:"node"}}}});var fE=g(function(NM){Object.defineProperty(NM,"__esModule",{value:!0});NM.LimitedSizeDocument=void 0;NM.isDriverInfoEqual=tue;NM.makeClientMetadata=rue;NM.getFAASEnv=FM;var dl=G("process"),Nr=we(),Hp=Q(),BM=ae(),eue=xM().version;function tue(e,t){let r=(n,s)=>(n||=void 0,s||=void 0,n===s);return r(e.name,t.name)&&r(e.platform,t.platform)&&r(e.version,t.version)}class Kp{constructor(e){this.document=new Map,this.documentSize=5,this.maxSize=e}ifItFitsItSits(e,t){let r=Nr.BSON.serialize(new Map().set(e,t)).byteLength-5;if(r+this.documentSize>this.maxSize)return!1;return this.documentSize+=r,this.document.set(e,t),!0}toObject(){return Nr.BSON.deserialize(Nr.BSON.serialize(this.document),{promoteLongs:!1,promoteBuffers:!1,promoteValues:!1,useBigInt64:!1})}}NM.LimitedSizeDocument=Kp;async function rue(e,{appName:t="",runtime:r}){let{os:n}=await r,s=new Kp(512);if(t.length>0){let c=Nr.ByteUtils.utf8ByteLength(t)<=128?t:Nr.ByteUtils.toUTF8(Nr.ByteUtils.fromUTF8(t),0,128,!1);s.ifItFitsItSits("application",{name:c})}let i={name:"nodejs",version:eue};for(let{name:c="",version:l=""}of e){if(c.length>0)i.name=`${i.name}|${c}`;if(l.length>0)i.version=`${i.version}|${l}`}if(!s.ifItFitsItSits("driver",i))throw new Hp.MongoInvalidArgumentError("Unable to include driverInfo name and version, metadata cannot exceed 512 bytes");let o=iue();for(let{platform:c=""}of e)if(c.length>0)o=`${o}|${c}`;if(!s.ifItFitsItSits("platform",o))throw new Hp.MongoInvalidArgumentError("Unable to include driverInfo platform, metadata cannot exceed 512 bytes");let u=new Map().set("name",n.platform()).set("architecture",n.arch()).set("version",n.release()).set("type",n.type());if(!s.ifItFitsItSits("os",u))for(let c of u.keys()){if(u.delete(c),u.size===0)break;if(s.ifItFitsItSits("os",u))break}let a=FM();if(a!=null){if(!s.ifItFitsItSits("env",a))for(let c of a.keys()){if(a.delete(c),a.size===0)break;if(s.ifItFitsItSits("env",a))break}}return await sue(s.toObject())}var PM;async function nue(){PM??=BM.fileIsAccessible("/.dockerenv");let e=await PM,{KUBERNETES_SERVICE_HOST:t=""}=dl.env,r=t.length>0?!0:!1,n={};if(e)n.runtime="docker";if(r)n.orchestrator="kubernetes";return n}async function sue(e){let t=await nue();if(Object.keys(t).length===0)return e;let r=new Kp(512),n={...e?.env,container:t};for(let[s,i]of Object.entries(e))if(s!=="env")r.ifItFitsItSits(s,i);else if(!r.ifItFitsItSits("env",n))r.ifItFitsItSits("env",i);if(!("env"in e))r.ifItFitsItSits("env",n);return r.toObject()}function FM(){let{AWS_EXECUTION_ENV:e="",AWS_LAMBDA_RUNTIME_API:t="",FUNCTIONS_WORKER_RUNTIME:r="",K_SERVICE:n="",FUNCTION_NAME:s="",VERCEL:i="",AWS_LAMBDA_FUNCTION_MEMORY_SIZE:o="",AWS_REGION:u="",FUNCTION_MEMORY_MB:a="",FUNCTION_REGION:c="",FUNCTION_TIMEOUT_SEC:l="",VERCEL_REGION:f=""}=dl.env,h=e.startsWith("AWS_Lambda_")||t.length>0,d=r.length>0,p=n.length>0||s.length>0,m=i.length>0,_=new Map;if(m&&!(d||p)){if(f.length>0)_.set("region",f);return _.set("name","vercel"),_}if(h&&!(d||p||m)){if(u.length>0)_.set("region",u);if(o.length>0&&Number.isInteger(+o))_.set("memory_mb",new Nr.Int32(o));return _.set("name","aws.lambda"),_}if(d&&!(p||h||m))return _.set("name","azure.func"),_;if(p&&!(d||h||m)){if(c.length>0)_.set("region",c);if(a.length>0&&Number.isInteger(+a))_.set("memory_mb",new Nr.Int32(a));if(l.length>0&&Number.isInteger(+l))_.set("timeout_sec",new Nr.Int32(l));return _.set("name","gcp.func"),_}return null}function iue(){let e=Nr.NumberUtils.isBigEndian?"BE":"LE";if("Deno"in globalThis)return`Deno v${typeof Deno?.version?.deno==="string"?Deno?.version?.deno:"0.0.0-unknown"}, ${e}`;if("Bun"in globalThis)return`Bun v${typeof Bun?.version==="string"?Bun?.version:"0.0.0-unknown"}, ${e}`;return`Node.js ${dl.version}, ${e}`}});var Yp=g(function(Wo){function Wt(e,t,r){if(r.globals)e=r.globals[e.name];return new e(`${r.context?r.context:"Value"} ${t}.`)}function pl(e,t){if(typeof e==="bigint")throw Wt(TypeError,"is a BigInt which cannot be converted to a number",t);if(!t.globals)return Number(e);return t.globals.Number(e)}function $M(e){if(e>0&&e%1===0.5&&(e&1)===0||e<0&&e%1===-0.5&&(e&1)===1)return Fh(Math.floor(e));return Fh(Math.round(e))}function Gp(e){return Fh(Math.trunc(e))}function RM(e){return e<0?-1:1}function cue(e,t){let r=e%t;if(RM(t)!==RM(r))return r+t;return r}function Fh(e){return e===0?0:e}function ml(e,{unsigned:t}){let r,n;if(t)r=0,n=2**e-1;else r=-(2**(e-1)),n=2**(e-1)-1;let s=2**e,i=2**(e-1);return(o,u={})=>{let a=pl(o,u);if(a=Fh(a),u.enforceRange){if(!Number.isFinite(a))throw Wt(TypeError,"is not a finite number",u);if(a=Gp(a),a<r||a>n)throw Wt(TypeError,`is outside the accepted range of ${r} to ${n}, inclusive`,u);return a}if(!Number.isNaN(a)&&u.clamp)return a=Math.min(Math.max(a,r),n),a=$M(a),a;if(!Number.isFinite(a)||a===0)return 0;if(a=Gp(a),a>=r&&a<=n)return a;if(a=cue(a,s),!t&&a>=i)return a-s;return a}}function vM(e,{unsigned:t}){let r=Number.MAX_SAFE_INTEGER,n=t?0:Number.MIN_SAFE_INTEGER,s=t?BigInt.asUintN:BigInt.asIntN;return(i,o={})=>{let u=pl(i,o);if(u=Fh(u),o.enforceRange){if(!Number.isFinite(u))throw Wt(TypeError,"is not a finite number",o);if(u=Gp(u),u<n||u>r)throw Wt(TypeError,`is outside the accepted range of ${n} to ${r}, inclusive`,o);return u}if(!Number.isNaN(u)&&o.clamp)return u=Math.min(Math.max(u,n),r),u=$M(u),u;if(!Number.isFinite(u)||u===0)return 0;let a=BigInt(Gp(u));return a=s(e,a),Number(a)}}Wo.any=(e)=>e;Wo.undefined=()=>{return};Wo.boolean=(e)=>Boolean(e);Wo.byte=ml(8,{unsigned:!1});Wo.octet=ml(8,{unsigned:!0});Wo.short=ml(16,{unsigned:!1});Wo["unsigned short"]=ml(16,{unsigned:!0});Wo.long=ml(32,{unsigned:!1});Wo["unsigned long"]=ml(32,{unsigned:!0});Wo["long long"]=vM(64,{unsigned:!1});Wo["unsigned long long"]=vM(64,{unsigned:!0});Wo.double=(e,t={})=>{let r=pl(e,t);if(!Number.isFinite(r))throw Wt(TypeError,"is not a finite floating-point value",t);return r};Wo["unrestricted double"]=(e,t={})=>pl(e,t);Wo.float=(e,t={})=>{let r=pl(e,t);if(!Number.isFinite(r))throw Wt(TypeError,"is not a finite floating-point value",t);if(Object.is(r,-0))return r;let n=Math.fround(r);if(!Number.isFinite(n))throw Wt(TypeError,"is outside the range of a single-precision floating-point value",t);return n};Wo["unrestricted float"]=(e,t={})=>{let r=pl(e,t);if(isNaN(r))return r;if(Object.is(r,-0))return r;return Math.fround(r)};Wo.DOMString=(e,t={})=>{if(t.treatNullAsEmptyString&&e===null)return"";if(typeof e==="symbol")throw Wt(TypeError,"is a symbol, which cannot be converted to a string",t);return(t.globals?t.globals.String:String)(e)};Wo.ByteString=(e,t={})=>{let r=Wo.DOMString(e,t);if(/[^\x00-\xFF]/.test(r))throw Wt(TypeError,"is not a valid ByteString",t);return r};Wo.USVString=(e,t={})=>Wo.DOMString(e,t).toWellFormed();Wo.object=(e,t={})=>{if(e===null||typeof e!=="object"&&typeof e!=="function")throw Wt(TypeError,"is not an object",t);return e};var lue=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get,hue=Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype,"byteLength").get;function kM(e){try{return lue.call(e),!0}catch{return!1}}function dE(e){try{return hue.call(e),!0}catch{return!1}}var fue=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"resizable").get,due=Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype,"growable").get;function qM(e){try{return fue.call(e)}catch{return!1}}function jM(e){try{return due.call(e)}catch{return!1}}function LM(e){try{return new Uint8Array(e),!1}catch{return!0}}Wo.ArrayBuffer=(e,t={})=>{if(!kM(e))throw Wt(TypeError,"is not an ArrayBuffer",t);if(!t.allowResizable&&qM(e))throw Wt(TypeError,"is a resizable ArrayBuffer",t);if(LM(e))throw Wt(TypeError,"is a detached ArrayBuffer",t);return e};Wo.SharedArrayBuffer=(e,t={})=>{if(!dE(e))throw Wt(TypeError,"is not a SharedArrayBuffer",t);if(!t.allowResizable&&jM(e))throw Wt(TypeError,"is a growable SharedArrayBuffer",t);return e};var pue=Object.getOwnPropertyDescriptor(DataView.prototype,"byteLength").get;Wo.DataView=(e,t={})=>{try{pue.call(e)}catch{throw Wt(TypeError,"is not a DataView",t)}return Wo.ArrayBufferView(e,t)};var mue=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array).prototype,Symbol.toStringTag).get;[Int8Array,Int16Array,Int32Array,Uint8Array,Uint16Array,Uint32Array,Uint8ClampedArray,Float32Array,Float64Array].forEach((e)=>{let{name:t}=e,r=/^[AEIOU]/u.test(t)?"an":"a";Wo[t]=(n,s={})=>{if(!ArrayBuffer.isView(n)||mue.call(n)!==t)throw Wt(TypeError,`is not ${r} ${t} object`,s);return Wo.ArrayBufferView(n,s)}});Wo.ArrayBufferView=(e,t={})=>{if(!ArrayBuffer.isView(e))throw Wt(TypeError,"is not a view on an ArrayBuffer or SharedArrayBuffer",t);if(!t.allowShared&&dE(e.buffer))throw Wt(TypeError,"is a view on a SharedArrayBuffer, which is not allowed",t);if(!t.allowResizable){if(qM(e.buffer))throw Wt(TypeError,"is a view on a resizable ArrayBuffer, which is not allowed",t);else if(jM(e.buffer))throw Wt(TypeError,"is a view on a growable SharedArrayBuffer, which is not allowed",t)}if(LM(e.buffer))throw Wt(TypeError,"is a view on a detached ArrayBuffer",t);return e};Wo.BufferSource=(e,t={})=>{if(ArrayBuffer.isView(e))return Wo.ArrayBufferView(e,t);if(kM(e))return Wo.ArrayBuffer(e,t);else if(t.allowShared&&dE(e))return Wo.SharedArrayBuffer(e,t);if(t.allowShared)throw Wt(TypeError,"is not an ArrayBuffer, SharedArrayBuffer, or a view on one",t);else throw Wt(TypeError,"is not an ArrayBuffer or a view on one",t)};Wo.DOMTimeStamp=Wo["unsigned long long"]});var Qp=g(function(QM,XM){function WM(e){return typeof e==="object"&&e!==null||typeof e==="function"}var $ue=Function.call.bind(Function.call);function vue(e,t){for(let r of Reflect.ownKeys(t)){let n=Reflect.getOwnPropertyDescriptor(t,r);if(n&&!Reflect.defineProperty(e,r,n))throw TypeError(`Cannot redefine property: ${String(r)}`)}}function kue(e,t){let r=GM(e);return Object.defineProperties(Object.create(r["%Object.prototype%"]),Object.getOwnPropertyDescriptors(t))}var HM=Symbol("wrapper"),KM=Symbol("impl"),yl=Symbol("SameObject caches"),Jp=Symbol.for("[webidl2js] constructor registry"),que=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);function GM(e){if(Object.hasOwn(e,Jp))return e[Jp];let t=Object.create(null);t["%Object.prototype%"]=e.Object.prototype,t["%IteratorPrototype%"]=Object.getPrototypeOf(Object.getPrototypeOf(new e.Array()[Symbol.iterator]()));try{t["%AsyncIteratorPrototype%"]=Object.getPrototypeOf(Object.getPrototypeOf(e.eval("(async function* () {})").prototype))}catch{t["%AsyncIteratorPrototype%"]=que}return e[Jp]=t,t}function jue(e,t,r){if(!e[yl])e[yl]=Object.create(null);if(t in e[yl])return e[yl][t];return e[yl][t]=r(),e[yl][t]}function YM(e){return e?e[HM]:null}function JM(e){return e?e[KM]:null}function Lue(e){let t=YM(e);return t?t:e}function Uue(e){let t=JM(e);return t?t:e}var Vue=Symbol("internal");function zue(e){if(typeof e!=="string")return!1;let t=e>>>0;if(t===4294967295)return!1;let r=`${t}`;if(e!==r)return!1;return!0}var Wue=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get;function Hue(e){try{return Wue.call(e),!0}catch{return!1}}function Kue([e,t],r){let n;switch(r){case"key":n=e;break;case"value":n=t;break;case"key+value":n=[e,t];break}return{value:n,done:!1}}function Gue(e,t,r,n,s){if(s===void 0){let o=Reflect.getPrototypeOf(e);if(o!==null)return Reflect.set(o,t,r,n);s={writable:!0,enumerable:!0,configurable:!0,value:void 0}}if(Yue(s)){if(!s.writable)return!1;if(!WM(n))return!1;let o=Reflect.getOwnPropertyDescriptor(n,t);if(o!==void 0){if(Jue(o))return!1;if(o.writable===!1)return!1;return Reflect.defineProperty(n,t,{value:r})}return Reflect.defineProperty(n,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}let i=s.set;if(i===void 0)return!1;return $ue(i,n,r),!0}function Yue(e){return Object.hasOwn(e,"value")||Object.hasOwn(e,"writable")}function Jue(e){return Object.hasOwn(e,"get")||Object.hasOwn(e,"set")}var Que=Symbol("supports property index"),Xue=Symbol("supported property indices"),Zue=Symbol("supports property name"),eae=Symbol("supported property names"),tae=Symbol("indexed property get"),rae=Symbol("indexed property set new"),nae=Symbol("indexed property set existing"),sae=Symbol("named property get"),iae=Symbol("named property set new"),oae=Symbol("named property set existing"),uae=Symbol("named property delete"),aae=Symbol("async iterator get the next iteration result"),cae=Symbol("async iterator return steps"),lae=Symbol("async iterator initialization steps"),hae=Symbol("async iterator end of iteration");XM.exports=QM={isObject:WM,define:vue,newObjectInRealm:kue,wrapperSymbol:HM,implSymbol:KM,getSameObject:jue,ctorRegistrySymbol:Jp,initCtorRegistry:GM,wrapperForImpl:YM,implForWrapper:JM,tryWrapperForImpl:Lue,tryImplForWrapper:Uue,iterInternalSymbol:Vue,isArrayBuffer:Hue,isArrayIndexPropName:zue,supportsPropertyIndex:Que,supportedPropertyIndices:Xue,supportsPropertyName:Zue,supportedPropertyNames:eae,indexedGet:tae,indexedSetNew:rae,indexedSetExisting:nae,namedGet:sae,namedSetNew:iae,namedSetExisting:oae,namedDelete:uae,asyncIteratorNext:aae,asyncIteratorReturn:cae,asyncIteratorInit:lae,asyncIteratorEOI:hae,iteratorResult:Kue,ordinarySetWithOwnDescriptor:Gue}});var ox=g(function(Z9e,ix){var fae=/^xn--/,dae=/[^\0-\x7F]/,pae=/[\x2E\u3002\uFF0E\uFF61]/g,mae={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},ao=Math.floor,yE=String.fromCharCode;function $u(e){throw RangeError(mae[e])}function yae(e,t){let r=[],n=e.length;while(n--)r[n]=t(e[n]);return r}function ex(e,t){let r=e.split("@"),n="";if(r.length>1)n=r[0]+"@",e=r[1];e=e.replace(pae,".");let s=e.split("."),i=yae(s,t).join(".");return n+i}function tx(e){let t=[],r=0,n=e.length;while(r<n){let s=e.charCodeAt(r++);if(s>=55296&&s<=56319&&r<n){let i=e.charCodeAt(r++);if((i&64512)==56320)t.push(((s&1023)<<10)+(i&1023)+65536);else t.push(s),r--}else t.push(s)}return t}var gae=(e)=>String.fromCodePoint(...e),_ae=function(e){if(e>=48&&e<58)return 26+(e-48);if(e>=65&&e<91)return e-65;if(e>=97&&e<123)return e-97;return 36},ZM=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},rx=function(e,t,r){let n=0;e=r?ao(e/700):e>>1,e+=ao(e/t);for(;e>455;n+=36)e=ao(e/35);return ao(n+36*e/(e+38))},nx=function(e){let t=[],r=e.length,n=0,s=128,i=72,o=e.lastIndexOf("-");if(o<0)o=0;for(let u=0;u<o;++u){if(e.charCodeAt(u)>=128)$u("not-basic");t.push(e.charCodeAt(u))}for(let u=o>0?o+1:0;u<r;){let a=n;for(let l=1,f=36;;f+=36){if(u>=r)$u("invalid-input");let h=_ae(e.charCodeAt(u++));if(h>=36)$u("invalid-input");if(h>ao((2147483647-n)/l))$u("overflow");n+=h*l;let d=f<=i?1:f>=i+26?26:f-i;if(h<d)break;let p=36-d;if(l>ao(2147483647/p))$u("overflow");l*=p}let c=t.length+1;if(i=rx(n-a,c,a==0),ao(n/c)>2147483647-s)$u("overflow");s+=ao(n/c),n%=c,t.splice(n++,0,s)}return String.fromCodePoint(...t)},sx=function(e){let t=[];e=tx(e);let r=e.length,n=128,s=0,i=72;for(let a of e)if(a<128)t.push(yE(a));let o=t.length,u=o;if(o)t.push("-");while(u<r){let a=2147483647;for(let l of e)if(l>=n&&l<a)a=l;let c=u+1;if(a-n>ao((2147483647-s)/c))$u("overflow");s+=(a-n)*c,n=a;for(let l of e){if(l<n&&++s>2147483647)$u("overflow");if(l===n){let f=s;for(let h=36;;h+=36){let d=h<=i?1:h>=i+26?26:h-i;if(f<d)break;let p=f-d,m=36-d;t.push(yE(ZM(d+p%m,0))),f=ao(p/m)}t.push(yE(ZM(f,0))),i=rx(s,c,u===o),s=0,++u}}++s,++n}return t.join("")},Eae=function(e){return ex(e,function(t){return fae.test(t)?nx(t.slice(4).toLowerCase()):t})},Aae=function(e){return ex(e,function(t){return dae.test(t)?"xn--"+sx(t):t})},Oae={version:"2.3.1",ucs2:{decode:tx,encode:gae},decode:nx,encode:sx,toASCII:Aae,toUnicode:Eae};ix.exports=Oae});var ax=g(function(ebe,ux){var Sae=/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFA}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11000}-\u{11002}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11082}\u{110B0}-\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{11134}\u{11145}\u{11146}\u{11173}\u{11180}-\u{11182}\u{111B3}-\u{111C0}\u{111C9}-\u{111CC}\u{111CE}\u{111CF}\u{1122C}-\u{11237}\u{1123E}\u{11241}\u{112DF}-\u{112EA}\u{11300}-\u{11303}\u{1133B}\u{1133C}\u{1133E}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11357}\u{11362}\u{11363}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113B8}-\u{113C0}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}-\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11435}-\u{11446}\u{1145E}\u{114B0}-\u{114C3}\u{115AF}-\u{115B5}\u{115B8}-\u{115C0}\u{115DC}\u{115DD}\u{11630}-\u{11640}\u{116AB}-\u{116B7}\u{1171D}-\u{1172B}\u{1182C}-\u{1183A}\u{11930}-\u{11935}\u{11937}\u{11938}\u{1193B}-\u{1193E}\u{11940}\u{11942}\u{11943}\u{119D1}-\u{119D7}\u{119DA}-\u{119E0}\u{119E4}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A39}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A5B}\u{11A8A}-\u{11A99}\u{11B60}-\u{11B67}\u{11C2F}-\u{11C36}\u{11C38}-\u{11C3F}\u{11C92}-\u{11CA7}\u{11CA9}-\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D8A}-\u{11D8E}\u{11D90}\u{11D91}\u{11D93}-\u{11D97}\u{11EF3}-\u{11EF6}\u{11F00}\u{11F01}\u{11F03}\u{11F34}-\u{11F3A}\u{11F3E}-\u{11F42}\u{11F5A}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F51}-\u{16F87}\u{16F8F}-\u{16F92}\u{16FE4}\u{16FF0}\u{16FF1}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D165}-\u{1D169}\u{1D16D}-\u{1D172}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E6E3}\u{1E6E6}\u{1E6EE}\u{1E6EF}\u{1E6F5}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]/u,wae=/[\u094D\u09CD\u0A4D\u0ACD\u0B4D\u0BCD\u0C4D\u0CCD\u0D3B\u0D3C\u0D4D\u0DCA\u0E3A\u0EBA\u0F84\u1039\u103A\u1714\u1715\u1734\u17D2\u1A60\u1B44\u1BAA\u1BAB\u1BF2\u1BF3\u2D7F\uA806\uA82C\uA8C4\uA953\uA9C0\uAAF6\uABED\u{10A3F}\u{11046}\u{11070}\u{1107F}\u{110B9}\u{11133}\u{11134}\u{111C0}\u{11235}\u{112EA}\u{1134D}\u{113CE}-\u{113D0}\u{11442}\u{114C2}\u{115BF}\u{1163F}\u{116B6}\u{1172B}\u{11839}\u{1193D}\u{1193E}\u{119E0}\u{11A34}\u{11A47}\u{11A99}\u{11C3F}\u{11D44}\u{11D45}\u{11D97}\u{11F41}\u{11F42}\u{1612F}]/u,Cae=/[\u0620\u0626\u0628\u062A-\u062E\u0633-\u063F\u0641-\u0647\u0649\u064A\u066E\u066F\u0678-\u0687\u069A-\u06BF\u06C1\u06C2\u06CC\u06CE\u06D0\u06D1\u06FA-\u06FC\u06FF\u0712-\u0714\u071A-\u071D\u071F-\u0727\u0729\u072B\u072D\u072E\u074E-\u0758\u075C-\u076A\u076D-\u0770\u0772\u0775-\u0777\u077A-\u077F\u07CA-\u07EA\u0841-\u0845\u0848\u084A-\u0853\u0855\u0860\u0862-\u0865\u0868\u0886\u0889-\u088D\u088F\u08A0-\u08A9\u08AF\u08B0\u08B3-\u08B8\u08BA-\u08C8\u1807\u1820-\u1878\u1887-\u18A8\u18AA\uA840-\uA872\u{10AC0}-\u{10AC4}\u{10ACD}\u{10AD3}-\u{10ADC}\u{10ADE}-\u{10AE0}\u{10AEB}-\u{10AEE}\u{10B80}\u{10B82}\u{10B86}-\u{10B88}\u{10B8A}\u{10B8B}\u{10B8D}\u{10B90}\u{10BAD}\u{10BAE}\u{10D00}-\u{10D21}\u{10D23}\u{10EC3}\u{10EC4}\u{10EC6}\u{10EC7}\u{10F30}-\u{10F32}\u{10F34}-\u{10F44}\u{10F51}-\u{10F53}\u{10F70}-\u{10F73}\u{10F76}-\u{10F81}\u{10FB0}\u{10FB2}\u{10FB3}\u{10FB8}\u{10FBB}\u{10FBC}\u{10FBE}\u{10FBF}\u{10FC1}\u{10FC4}\u{10FCA}\u{10FCB}\u{1E900}-\u{1E943}][\xAD\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u061C\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u070F\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200B\u200E\u200F\u202A-\u202E\u2060-\u2064\u206A-\u206F\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFEFF\uFFF9-\uFFFB\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFA}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11B60}\u{11B62}-\u{11B64}\u{11B66}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C3F}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13430}-\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E6E3}\u{1E6E6}\u{1E6EE}\u{1E6EF}\u{1E6F5}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94B}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*\u200C[\xAD\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u061C\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u070F\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200B\u200E\u200F\u202A-\u202E\u2060-\u2064\u206A-\u206F\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFEFF\uFFF9-\uFFFB\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFA}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11B60}\u{11B62}-\u{11B64}\u{11B66}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C3F}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13430}-\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E6E3}\u{1E6E6}\u{1E6EE}\u{1E6EF}\u{1E6F5}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94B}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*[\u0620\u0622-\u063F\u0641-\u064A\u066E\u066F\u0671-\u0673\u0675-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u077F\u07CA-\u07EA\u0840-\u0858\u0860\u0862-\u0865\u0867-\u086A\u0870-\u0882\u0886\u0889-\u088F\u08A0-\u08AC\u08AE-\u08C8\u1807\u1820-\u1878\u1887-\u18A8\u18AA\uA840-\uA871\u{10AC0}-\u{10AC5}\u{10AC7}\u{10AC9}\u{10ACA}\u{10ACE}-\u{10AD6}\u{10AD8}-\u{10AE1}\u{10AE4}\u{10AEB}-\u{10AEF}\u{10B80}-\u{10B91}\u{10BA9}-\u{10BAE}\u{10D01}-\u{10D23}\u{10EC2}-\u{10EC4}\u{10EC6}\u{10EC7}\u{10F30}-\u{10F44}\u{10F51}-\u{10F54}\u{10F70}-\u{10F81}\u{10FB0}\u{10FB2}-\u{10FB6}\u{10FB8}-\u{10FBF}\u{10FC1}-\u{10FC4}\u{10FC9}\u{10FCA}\u{1E900}-\u{1E943}]/u,bae=/[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0600-\u0605\u0608\u060B\u060D\u061B-\u064A\u0660-\u0669\u066B-\u066F\u0671-\u06D5\u06DD\u06E5\u06E6\u06EE\u06EF\u06FA-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u0891\u08A0-\u08C9\u08E2\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}-\u{10959}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D30}-\u{10D39}\u{10D40}-\u{10D65}\u{10D6F}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC7}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}]/u,Dae=/[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02BB-\u02C1\u02D0\u02D1\u02E0-\u02E4\u02EE\u0370-\u0373\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0482\u048A-\u052F\u0531-\u0556\u0559-\u0589\u0903-\u0939\u093B\u093D-\u0940\u0949-\u094C\u094E-\u0950\u0958-\u0961\u0964-\u0980\u0982\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C0\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09FA\u09FC\u09FD\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A40\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A76\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC0\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0\u0AE1\u0AE6-\u0AF0\u0AF9\u0B02\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0BE6-\u0BF2\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C41-\u0C44\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C77\u0C7F\u0C80\u0C82-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0CDC-\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1-\u0CF3\u0D02-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D4F\u0D54-\u0D61\u0D66-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E4F-\u0E5B\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F17\u0F1A-\u0F34\u0F36\u0F38\u0F3E-\u0F47\u0F49-\u0F6C\u0F7F\u0F85\u0F88-\u0F8C\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u1000-\u102C\u1031\u1038\u103B\u103C\u103F-\u1057\u105A-\u105D\u1061-\u1070\u1075-\u1081\u1083\u1084\u1087-\u108C\u108E-\u109C\u109E-\u10C5\u10C7\u10CD\u10D0-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1360-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u167F\u1681-\u169A\u16A0-\u16F8\u1700-\u1711\u1715\u171F-\u1731\u1734-\u1736\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17B6\u17BE-\u17C5\u17C7\u17C8\u17D4-\u17DA\u17DC\u17E0-\u17E9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A19\u1A1A\u1A1E-\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1A80-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1B04-\u1B33\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B4C\u1B4E-\u1B6A\u1B74-\u1B7F\u1B82-\u1BA1\u1BA6\u1BA7\u1BAA\u1BAE-\u1BE5\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1BFC-\u1C2B\u1C34\u1C35\u1C3B-\u1C49\u1C4D-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200E\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u214F\u2160-\u2188\u2336-\u237A\u2395\u249C-\u24E9\u26AC\u2800-\u28FF\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u302E\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31BF\u31F0-\u321C\u3220-\u324F\u3260-\u327B\u327F-\u32B0\u32C0-\u32CB\u32D0-\u3376\u337B-\u33DD\u33E0-\u33FE\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA60C\uA610-\uA62B\uA640-\uA66E\uA680-\uA69D\uA6A0-\uA6EF\uA6F2-\uA6F7\uA722-\uA787\uA789-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA824\uA827\uA830-\uA837\uA840-\uA873\uA880-\uA8C3\uA8CE-\uA8D9\uA8F2-\uA8FE\uA900-\uA925\uA92E-\uA946\uA952\uA953\uA95F-\uA97C\uA983-\uA9B2\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA2F\uAA30\uAA33\uAA34\uAA40-\uAA42\uAA44-\uAA4B\uAA4D\uAA50-\uAA59\uAA5C-\uAA7B\uAA7D-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAAEB\uAAEE-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB69\uAB70-\uABE4\uABE6\uABE7\uABE9-\uABEC\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1013F}\u{1018D}\u{1018E}\u{101D0}-\u{101FC}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{11000}\u{11002}-\u{11037}\u{11047}-\u{1104D}\u{11066}-\u{1106F}\u{11071}\u{11072}\u{11075}\u{11082}-\u{110B2}\u{110B7}\u{110B8}\u{110BB}-\u{110C1}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11103}-\u{11126}\u{1112C}\u{11136}-\u{11147}\u{11150}-\u{11172}\u{11174}-\u{11176}\u{11182}-\u{111B5}\u{111BF}-\u{111C8}\u{111CD}\u{111CE}\u{111D0}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{1122E}\u{11232}\u{11233}\u{11235}\u{11238}-\u{1123D}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112DE}\u{112E0}-\u{112E2}\u{112F0}-\u{112F9}\u{11302}\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}-\u{1133F}\u{11341}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}-\u{113BA}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}\u{113CD}\u{113CF}\u{113D1}\u{113D3}-\u{113D5}\u{113D7}\u{113D8}\u{11400}-\u{11437}\u{11440}\u{11441}\u{11445}\u{11447}-\u{1145B}\u{1145D}\u{1145F}-\u{11461}\u{11480}-\u{114B2}\u{114B9}\u{114BB}-\u{114BE}\u{114C1}\u{114C4}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B1}\u{115B8}-\u{115BB}\u{115BE}\u{115C1}-\u{115DB}\u{11600}-\u{11632}\u{1163B}\u{1163C}\u{1163E}\u{11641}-\u{11644}\u{11650}-\u{11659}\u{11680}-\u{116AA}\u{116AC}\u{116AE}\u{116AF}\u{116B6}\u{116B8}\u{116B9}\u{116C0}-\u{116C9}\u{116D0}-\u{116E3}\u{11700}-\u{1171A}\u{1171E}\u{11720}\u{11721}\u{11726}\u{11730}-\u{11746}\u{11800}-\u{1182E}\u{11838}\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193D}\u{1193F}-\u{11942}\u{11944}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D3}\u{119DC}-\u{119DF}\u{119E1}-\u{119E4}\u{11A00}\u{11A07}\u{11A08}\u{11A0B}-\u{11A32}\u{11A39}\u{11A3A}\u{11A3F}-\u{11A46}\u{11A50}\u{11A57}\u{11A58}\u{11A5C}-\u{11A89}\u{11A97}\u{11A9A}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11B00}-\u{11B09}\u{11B61}\u{11B65}\u{11B67}\u{11BC0}-\u{11BE1}\u{11BF0}-\u{11BF9}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2F}\u{11C3E}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11CA9}\u{11CB1}\u{11CB4}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D93}\u{11D94}\u{11D96}\u{11D98}\u{11DA0}-\u{11DA9}\u{11DB0}-\u{11DDB}\u{11DE0}-\u{11DE9}\u{11EE0}-\u{11EF2}\u{11EF5}-\u{11EF8}\u{11F02}-\u{11F10}\u{11F12}-\u{11F35}\u{11F3E}\u{11F3F}\u{11F41}\u{11F43}-\u{11F59}\u{11FB0}\u{11FC0}-\u{11FD4}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{1343F}\u{13441}-\u{13446}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{1611D}\u{1612A}-\u{1612C}\u{16130}-\u{16139}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF5}\u{16B00}-\u{16B2F}\u{16B37}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D79}\u{16E40}-\u{16E9A}\u{16EA0}-\u{16EB8}\u{16EBB}-\u{16ED3}\u{16F00}-\u{16F4A}\u{16F50}-\u{16F87}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{16FF0}-\u{16FF6}\u{17000}-\u{18CD5}\u{18CFF}-\u{18D1E}\u{18D80}-\u{18DF2}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}\u{1BC9F}\u{1CCD6}-\u{1CCEF}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D166}\u{1D16A}-\u{1D172}\u{1D183}\u{1D184}\u{1D18C}-\u{1D1A9}\u{1D1AE}-\u{1D1E8}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6C0}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6FA}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D734}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D76E}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D7A8}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1D800}-\u{1D9FF}\u{1DA37}-\u{1DA3A}\u{1DA6D}-\u{1DA74}\u{1DA76}-\u{1DA83}\u{1DA85}-\u{1DA8B}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E030}-\u{1E06D}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E14F}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E2F0}-\u{1E2F9}\u{1E4D0}-\u{1E4EB}\u{1E4F0}-\u{1E4F9}\u{1E5D0}-\u{1E5ED}\u{1E5F0}-\u{1E5FA}\u{1E5FF}\u{1E6C0}-\u{1E6DE}\u{1E6E0}-\u{1E6E2}\u{1E6E4}\u{1E6E5}\u{1E6E7}-\u{1E6ED}\u{1E6F0}-\u{1E6F4}\u{1E6FE}\u{1E6FF}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1F110}-\u{1F12E}\u{1F130}-\u{1F169}\u{1F170}-\u{1F1AC}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B81D}\u{2B820}-\u{2CEAD}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{33479}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}]/u,Tae=/[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u088F\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}-\u{10959}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D4A}-\u{10D65}\u{10D6F}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC7}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}]/u,Mae=/^[\0-\x08\x0E-\x1B!-@\[-`\{-\x84\x86-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02B9\u02BA\u02C2-\u02CF\u02D2-\u02DF\u02E5-\u02ED\u02EF-\u036F\u0374\u0375\u037E\u0384\u0385\u0387\u03F6\u0483-\u0489\u058A\u058D-\u058F\u0591-\u05C7\u05D0-\u05EA\u05EF-\u05F4\u0600-\u070D\u070F-\u074A\u074D-\u07B1\u07C0-\u07FA\u07FD-\u082D\u0830-\u083E\u0840-\u085B\u085E\u0860-\u086A\u0870-\u0891\u0897-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09F2\u09F3\u09FB\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AF1\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0BF3-\u0BFA\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C78-\u0C7E\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E3F\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39-\u0F3D\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1390-\u1399\u1400\u169B\u169C\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DB\u17DD\u17F0-\u17F9\u1800-\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1940\u1944\u1945\u19DE-\u19FF\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u200B-\u200D\u200F-\u2027\u202F-\u205E\u2060-\u2064\u206A-\u2070\u2074-\u207E\u2080-\u208E\u20A0-\u20C1\u20D0-\u20F0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u2150-\u215F\u2189-\u218B\u2190-\u2335\u237B-\u2394\u2396-\u2429\u2440-\u244A\u2460-\u249B\u24EA-\u26AB\u26AD-\u27FF\u2900-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF9-\u2CFF\u2D7F\u2DE0-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3001-\u3004\u3008-\u3020\u302A-\u302D\u3030\u3036\u3037\u303D-\u303F\u3099-\u309C\u30A0\u30FB\u31C0-\u31E5\u31EF\u321D\u321E\u3250-\u325F\u327C-\u327E\u32B1-\u32BF\u32CC-\u32CF\u3377-\u337A\u33DE\u33DF\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA60D-\uA60F\uA66F-\uA67F\uA69E\uA69F\uA6F0\uA6F1\uA700-\uA721\uA788\uA802\uA806\uA80B\uA825\uA826\uA828-\uA82C\uA838\uA839\uA874-\uA877\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uAB6A\uAB6B\uABE5\uABE8\uABED\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFDCF\uFDF0-\uFE19\uFE20-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFE70-\uFE74\uFE76-\uFEFC\uFEFF\uFF01-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD\u{10101}\u{10140}-\u{1018C}\u{10190}-\u{1019C}\u{101A0}\u{101FD}\u{102E0}-\u{102FB}\u{10376}-\u{1037A}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{1091F}-\u{10939}\u{1093F}-\u{10959}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A38}-\u{10A3A}\u{10A3F}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE6}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B39}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D27}\u{10D30}-\u{10D39}\u{10D40}-\u{10D65}\u{10D69}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAB}-\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC7}\u{10ED0}-\u{10ED8}\u{10EFA}-\u{10F27}\u{10F30}-\u{10F59}\u{10F70}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{11001}\u{11038}-\u{11046}\u{11052}-\u{11065}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{11660}-\u{1166C}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11B60}\u{11B62}-\u{11B64}\u{11B66}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{11FD5}-\u{11FF1}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE2}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1CC00}-\u{1CCD5}\u{1CCF0}-\u{1CCFC}\u{1CD00}-\u{1CEB3}\u{1CEBA}-\u{1CED0}\u{1CEE0}-\u{1CEF0}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D1E9}\u{1D1EA}\u{1D200}-\u{1D245}\u{1D300}-\u{1D356}\u{1D6C1}\u{1D6DB}\u{1D6FB}\u{1D715}\u{1D735}\u{1D74F}\u{1D76F}\u{1D789}\u{1D7A9}\u{1D7C3}\u{1D7CE}-\u{1D7FF}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E2FF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E6E3}\u{1E6E6}\u{1E6EE}\u{1E6EF}\u{1E6F5}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8D6}\u{1E900}-\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{1EEF0}\u{1EEF1}\u{1F000}-\u{1F02B}\u{1F030}-\u{1F093}\u{1F0A0}-\u{1F0AE}\u{1F0B1}-\u{1F0BF}\u{1F0C1}-\u{1F0CF}\u{1F0D1}-\u{1F0F5}\u{1F100}-\u{1F10F}\u{1F12F}\u{1F16A}-\u{1F16F}\u{1F1AD}\u{1F260}-\u{1F265}\u{1F300}-\u{1F6D8}\u{1F6DC}-\u{1F6EC}\u{1F6F0}-\u{1F6FC}\u{1F700}-\u{1F7D9}\u{1F7E0}-\u{1F7EB}\u{1F7F0}\u{1F800}-\u{1F80B}\u{1F810}-\u{1F847}\u{1F850}-\u{1F859}\u{1F860}-\u{1F887}\u{1F890}-\u{1F8AD}\u{1F8B0}-\u{1F8BB}\u{1F8C0}\u{1F8C1}\u{1F8D0}-\u{1F8D8}\u{1F900}-\u{1FA57}\u{1FA60}-\u{1FA6D}\u{1FA70}-\u{1FA7C}\u{1FA80}-\u{1FA8A}\u{1FA8E}-\u{1FAC6}\u{1FAC8}\u{1FACD}-\u{1FADC}\u{1FADF}-\u{1FAEA}\u{1FAEF}-\u{1FAF8}\u{1FB00}-\u{1FB92}\u{1FB94}-\u{1FBFA}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*$/u,xae=/[0-9\xB2\xB3\xB9\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0600-\u0605\u0608\u060B\u060D\u061B-\u064A\u0660-\u0669\u066B-\u066F\u0671-\u06D5\u06DD\u06E5\u06E6\u06EE-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u0891\u08A0-\u08C9\u08E2\u200F\u2070\u2074-\u2079\u2080-\u2089\u2488-\u249B\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\u{102E1}-\u{102FB}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}-\u{10959}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D30}-\u{10D39}\u{10D40}-\u{10D65}\u{10D6F}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC7}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1CCF0}-\u{1CCF9}\u{1D7CE}-\u{1D7FF}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{1F100}-\u{1F10A}\u{1FBF0}-\u{1FBF9}][\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFA}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11B60}\u{11B62}-\u{11B64}\u{11B66}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E6E3}\u{1E6E6}\u{1E6EE}\u{1E6EF}\u{1E6F5}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]*$/u,Pae=/[0-9\xB2\xB3\xB9\u06F0-\u06F9\u2070\u2074-\u2079\u2080-\u2089\u2488-\u249B\uFF10-\uFF19\u{102E1}-\u{102FB}\u{1CCF0}-\u{1CCF9}\u{1D7CE}-\u{1D7FF}\u{1F100}-\u{1F10A}\u{1FBF0}-\u{1FBF9}]/u,Bae=/[\u0600-\u0605\u0660-\u0669\u066B\u066C\u06DD\u0890\u0891\u08E2\u{10D30}-\u{10D39}\u{10D40}-\u{10D49}\u{10E60}-\u{10E7E}]/u,Fae=/^[\0-\x08\x0E-\x1B!-\x84\x86-\u0377\u037A-\u037F\u0384-\u038A\u038C\u038E-\u03A1\u03A3-\u052F\u0531-\u0556\u0559-\u058A\u058D-\u058F\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0606\u0607\u0609\u060A\u060C\u060E-\u061A\u064B-\u065F\u066A\u0670\u06D6-\u06DC\u06DE-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07F6-\u07F9\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A76\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AF1\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B77\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BFA\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3C-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C5C\u0C5D\u0C60-\u0C63\u0C66-\u0C6F\u0C77-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDC-\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1-\u0CF3\u0D00-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4F\u0D54-\u0D63\u0D66-\u0D7F\u0D81-\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4\u0E01-\u0E3A\u0E3F-\u0E5B\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECE\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FDA\u1000-\u10C5\u10C7\u10CD\u10D0-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u137C\u1380-\u1399\u13A0-\u13F5\u13F8-\u13FD\u1400-\u167F\u1681-\u169C\u16A0-\u16F8\u1700-\u1715\u171F-\u1736\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17DD\u17E0-\u17E9\u17F0-\u17F9\u1800-\u1819\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1940\u1944-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u19DE-\u1A1B\u1A1E-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1AB0-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B4C\u1B4E-\u1BF3\u1BFC-\u1C37\u1C3B-\u1C49\u1C4D-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD0-\u1CFA\u1D00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u200B-\u200E\u2010-\u2027\u202F-\u205E\u2060-\u2064\u206A-\u2071\u2074-\u208E\u2090-\u209C\u20A0-\u20C1\u20D0-\u20F0\u2100-\u218B\u2190-\u2429\u2440-\u244A\u2460-\u2B73\u2B76-\u2CF3\u2CF9-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3001-\u303F\u3041-\u3096\u3099-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31E5\u31EF-\u321E\u3220-\uA48C\uA490-\uA4C6\uA4D0-\uA62B\uA640-\uA6F7\uA700-\uA7DC\uA7F1-\uA82C\uA830-\uA839\uA840-\uA877\uA880-\uA8C5\uA8CE-\uA8D9\uA8E0-\uA953\uA95F-\uA97C\uA980-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA5C-\uAAC2\uAADB-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB6B\uAB70-\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1E\uFB29\uFBC3-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFD-\uFE19\uFE20-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}-\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1018E}\u{10190}-\u{1019C}\u{101A0}\u{101D0}-\u{101FD}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{102E0}-\u{102FB}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{1037A}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{1091F}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10B39}-\u{10B3F}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6E}\u{10EAB}\u{10EAC}\u{10ED0}-\u{10ED8}\u{10EFA}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11000}-\u{1104D}\u{11052}-\u{11075}\u{1107F}-\u{110C2}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11100}-\u{11134}\u{11136}-\u{11147}\u{11150}-\u{11176}\u{11180}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{11241}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112EA}\u{112F0}-\u{112F9}\u{11300}-\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133B}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}-\u{113C0}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}-\u{113D5}\u{113D7}\u{113D8}\u{113E1}\u{113E2}\u{11400}-\u{1145B}\u{1145D}-\u{11461}\u{11480}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B5}\u{115B8}-\u{115DD}\u{11600}-\u{11644}\u{11650}-\u{11659}\u{11660}-\u{1166C}\u{11680}-\u{116B9}\u{116C0}-\u{116C9}\u{116D0}-\u{116E3}\u{11700}-\u{1171A}\u{1171D}-\u{1172B}\u{11730}-\u{11746}\u{11800}-\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193B}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D7}\u{119DA}-\u{119E4}\u{11A00}-\u{11A47}\u{11A50}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11B00}-\u{11B09}\u{11B60}-\u{11B67}\u{11BC0}-\u{11BE1}\u{11BF0}-\u{11BF9}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C36}\u{11C38}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11C92}-\u{11CA7}\u{11CA9}-\u{11CB6}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D47}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D90}\u{11D91}\u{11D93}-\u{11D98}\u{11DA0}-\u{11DA9}\u{11DB0}-\u{11DDB}\u{11DE0}-\u{11DE9}\u{11EE0}-\u{11EF8}\u{11F00}-\u{11F10}\u{11F12}-\u{11F3A}\u{11F3E}-\u{11F5A}\u{11FB0}\u{11FC0}-\u{11FF1}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{13455}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{16139}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF0}-\u{16AF5}\u{16B00}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D79}\u{16E40}-\u{16E9A}\u{16EA0}-\u{16EB8}\u{16EBB}-\u{16ED3}\u{16F00}-\u{16F4A}\u{16F4F}-\u{16F87}\u{16F8F}-\u{16F9F}\u{16FE0}-\u{16FE4}\u{16FF0}-\u{16FF6}\u{17000}-\u{18CD5}\u{18CFF}-\u{18D1E}\u{18D80}-\u{18DF2}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}-\u{1BCA3}\u{1CC00}-\u{1CCFC}\u{1CD00}-\u{1CEB3}\u{1CEBA}-\u{1CED0}\u{1CEE0}-\u{1CEF0}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D1EA}\u{1D200}-\u{1D245}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D300}-\u{1D356}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D7CB}\u{1D7CE}-\u{1DA8B}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E030}-\u{1E06D}\u{1E08F}\u{1E100}-\u{1E12C}\u{1E130}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E14F}\u{1E290}-\u{1E2AE}\u{1E2C0}-\u{1E2F9}\u{1E2FF}\u{1E4D0}-\u{1E4F9}\u{1E5D0}-\u{1E5FA}\u{1E5FF}\u{1E6C0}-\u{1E6DE}\u{1E6E0}-\u{1E6F5}\u{1E6FE}\u{1E6FF}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{1EEF0}\u{1EEF1}\u{1F000}-\u{1F02B}\u{1F030}-\u{1F093}\u{1F0A0}-\u{1F0AE}\u{1F0B1}-\u{1F0BF}\u{1F0C1}-\u{1F0CF}\u{1F0D1}-\u{1F0F5}\u{1F100}-\u{1F1AD}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{1F260}-\u{1F265}\u{1F300}-\u{1F6D8}\u{1F6DC}-\u{1F6EC}\u{1F6F0}-\u{1F6FC}\u{1F700}-\u{1F7D9}\u{1F7E0}-\u{1F7EB}\u{1F7F0}\u{1F800}-\u{1F80B}\u{1F810}-\u{1F847}\u{1F850}-\u{1F859}\u{1F860}-\u{1F887}\u{1F890}-\u{1F8AD}\u{1F8B0}-\u{1F8BB}\u{1F8C0}\u{1F8C1}\u{1F8D0}-\u{1F8D8}\u{1F900}-\u{1FA57}\u{1FA60}-\u{1FA6D}\u{1FA70}-\u{1FA7C}\u{1FA80}-\u{1FA8A}\u{1FA8E}-\u{1FAC6}\u{1FAC8}\u{1FACD}-\u{1FADC}\u{1FADF}-\u{1FAEA}\u{1FAEF}-\u{1FAF8}\u{1FB00}-\u{1FB92}\u{1FB94}-\u{1FBFA}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B81D}\u{2B820}-\u{2CEAD}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{33479}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}]*$/u,Nae=/[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02BB-\u02C1\u02D0\u02D1\u02E0-\u02E4\u02EE\u0370-\u0373\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0482\u048A-\u052F\u0531-\u0556\u0559-\u0589\u06F0-\u06F9\u0903-\u0939\u093B\u093D-\u0940\u0949-\u094C\u094E-\u0950\u0958-\u0961\u0964-\u0980\u0982\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C0\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09FA\u09FC\u09FD\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A40\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A76\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC0\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0\u0AE1\u0AE6-\u0AF0\u0AF9\u0B02\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0BE6-\u0BF2\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C41-\u0C44\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C77\u0C7F\u0C80\u0C82-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0CDC-\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1-\u0CF3\u0D02-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D4F\u0D54-\u0D61\u0D66-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E4F-\u0E5B\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F17\u0F1A-\u0F34\u0F36\u0F38\u0F3E-\u0F47\u0F49-\u0F6C\u0F7F\u0F85\u0F88-\u0F8C\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u1000-\u102C\u1031\u1038\u103B\u103C\u103F-\u1057\u105A-\u105D\u1061-\u1070\u1075-\u1081\u1083\u1084\u1087-\u108C\u108E-\u109C\u109E-\u10C5\u10C7\u10CD\u10D0-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1360-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u167F\u1681-\u169A\u16A0-\u16F8\u1700-\u1711\u1715\u171F-\u1731\u1734-\u1736\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17B6\u17BE-\u17C5\u17C7\u17C8\u17D4-\u17DA\u17DC\u17E0-\u17E9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A19\u1A1A\u1A1E-\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1A80-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1B04-\u1B33\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B4C\u1B4E-\u1B6A\u1B74-\u1B7F\u1B82-\u1BA1\u1BA6\u1BA7\u1BAA\u1BAE-\u1BE5\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1BFC-\u1C2B\u1C34\u1C35\u1C3B-\u1C49\u1C4D-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200E\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u214F\u2160-\u2188\u2336-\u237A\u2395\u2488-\u24E9\u26AC\u2800-\u28FF\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u302E\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31BF\u31F0-\u321C\u3220-\u324F\u3260-\u327B\u327F-\u32B0\u32C0-\u32CB\u32D0-\u3376\u337B-\u33DD\u33E0-\u33FE\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA60C\uA610-\uA62B\uA640-\uA66E\uA680-\uA69D\uA6A0-\uA6EF\uA6F2-\uA6F7\uA722-\uA787\uA789-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA824\uA827\uA830-\uA837\uA840-\uA873\uA880-\uA8C3\uA8CE-\uA8D9\uA8F2-\uA8FE\uA900-\uA925\uA92E-\uA946\uA952\uA953\uA95F-\uA97C\uA983-\uA9B2\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA2F\uAA30\uAA33\uAA34\uAA40-\uAA42\uAA44-\uAA4B\uAA4D\uAA50-\uAA59\uAA5C-\uAA7B\uAA7D-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAAEB\uAAEE-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB69\uAB70-\uABE4\uABE6\uABE7\uABE9-\uABEC\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1013F}\u{1018D}\u{1018E}\u{101D0}-\u{101FC}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{102E1}-\u{102FB}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{11000}\u{11002}-\u{11037}\u{11047}-\u{1104D}\u{11066}-\u{1106F}\u{11071}\u{11072}\u{11075}\u{11082}-\u{110B2}\u{110B7}\u{110B8}\u{110BB}-\u{110C1}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11103}-\u{11126}\u{1112C}\u{11136}-\u{11147}\u{11150}-\u{11172}\u{11174}-\u{11176}\u{11182}-\u{111B5}\u{111BF}-\u{111C8}\u{111CD}\u{111CE}\u{111D0}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{1122E}\u{11232}\u{11233}\u{11235}\u{11238}-\u{1123D}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112DE}\u{112E0}-\u{112E2}\u{112F0}-\u{112F9}\u{11302}\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}-\u{1133F}\u{11341}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}-\u{113BA}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}\u{113CD}\u{113CF}\u{113D1}\u{113D3}-\u{113D5}\u{113D7}\u{113D8}\u{11400}-\u{11437}\u{11440}\u{11441}\u{11445}\u{11447}-\u{1145B}\u{1145D}\u{1145F}-\u{11461}\u{11480}-\u{114B2}\u{114B9}\u{114BB}-\u{114BE}\u{114C1}\u{114C4}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B1}\u{115B8}-\u{115BB}\u{115BE}\u{115C1}-\u{115DB}\u{11600}-\u{11632}\u{1163B}\u{1163C}\u{1163E}\u{11641}-\u{11644}\u{11650}-\u{11659}\u{11680}-\u{116AA}\u{116AC}\u{116AE}\u{116AF}\u{116B6}\u{116B8}\u{116B9}\u{116C0}-\u{116C9}\u{116D0}-\u{116E3}\u{11700}-\u{1171A}\u{1171E}\u{11720}\u{11721}\u{11726}\u{11730}-\u{11746}\u{11800}-\u{1182E}\u{11838}\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193D}\u{1193F}-\u{11942}\u{11944}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D3}\u{119DC}-\u{119DF}\u{119E1}-\u{119E4}\u{11A00}\u{11A07}\u{11A08}\u{11A0B}-\u{11A32}\u{11A39}\u{11A3A}\u{11A3F}-\u{11A46}\u{11A50}\u{11A57}\u{11A58}\u{11A5C}-\u{11A89}\u{11A97}\u{11A9A}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11B00}-\u{11B09}\u{11B61}\u{11B65}\u{11B67}\u{11BC0}-\u{11BE1}\u{11BF0}-\u{11BF9}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2F}\u{11C3E}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11CA9}\u{11CB1}\u{11CB4}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D93}\u{11D94}\u{11D96}\u{11D98}\u{11DA0}-\u{11DA9}\u{11DB0}-\u{11DDB}\u{11DE0}-\u{11DE9}\u{11EE0}-\u{11EF2}\u{11EF5}-\u{11EF8}\u{11F02}-\u{11F10}\u{11F12}-\u{11F35}\u{11F3E}\u{11F3F}\u{11F41}\u{11F43}-\u{11F59}\u{11FB0}\u{11FC0}-\u{11FD4}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{1343F}\u{13441}-\u{13446}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{1611D}\u{1612A}-\u{1612C}\u{16130}-\u{16139}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF5}\u{16B00}-\u{16B2F}\u{16B37}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D79}\u{16E40}-\u{16E9A}\u{16EA0}-\u{16EB8}\u{16EBB}-\u{16ED3}\u{16F00}-\u{16F4A}\u{16F50}-\u{16F87}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{16FF0}-\u{16FF6}\u{17000}-\u{18CD5}\u{18CFF}-\u{18D1E}\u{18D80}-\u{18DF2}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}\u{1BC9F}\u{1CCD6}-\u{1CCF9}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D166}\u{1D16A}-\u{1D172}\u{1D183}\u{1D184}\u{1D18C}-\u{1D1A9}\u{1D1AE}-\u{1D1E8}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6C0}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6FA}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D734}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D76E}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D7A8}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1D7CE}-\u{1D9FF}\u{1DA37}-\u{1DA3A}\u{1DA6D}-\u{1DA74}\u{1DA76}-\u{1DA83}\u{1DA85}-\u{1DA8B}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E030}-\u{1E06D}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E14F}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E2F0}-\u{1E2F9}\u{1E4D0}-\u{1E4EB}\u{1E4F0}-\u{1E4F9}\u{1E5D0}-\u{1E5ED}\u{1E5F0}-\u{1E5FA}\u{1E5FF}\u{1E6C0}-\u{1E6DE}\u{1E6E0}-\u{1E6E2}\u{1E6E4}\u{1E6E5}\u{1E6E7}-\u{1E6ED}\u{1E6F0}-\u{1E6F4}\u{1E6FE}\u{1E6FF}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1F100}-\u{1F10A}\u{1F110}-\u{1F12E}\u{1F130}-\u{1F169}\u{1F170}-\u{1F1AC}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{1FBF0}-\u{1FBF9}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B81D}\u{2B820}-\u{2CEAD}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{33479}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}][\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFA}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11B60}\u{11B62}-\u{11B64}\u{11B66}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E6E3}\u{1E6E6}\u{1E6EE}\u{1E6EF}\u{1E6F5}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]*$/u;ux.exports={combiningMarks:Sae,combiningClassVirama:wae,validZWNJ:Cae,bidiDomain:bae,bidiS1LTR:Dae,bidiS1RTL:Tae,bidiS2:Mae,bidiS3:xae,bidiS4EN:Pae,bidiS4AN:Bae,bidiS5:Fae,bidiS6:Nae}});var cx=g(function(tbe,Iae){Iae.exports=[[[0,44],2],[[45,46],2],[47,2],[[48,57],2],[[58,64],2],[65,1,"a"],[66,1,"b"],[67,1,"c"],[68,1,"d"],[69,1,"e"],[70,1,"f"],[71,1,"g"],[72,1,"h"],[73,1,"i"],[74,1,"j"],[75,1,"k"],[76,1,"l"],[77,1,"m"],[78,1,"n"],[79,1,"o"],[80,1,"p"],[81,1,"q"],[82,1,"r"],[83,1,"s"],[84,1,"t"],[85,1,"u"],[86,1,"v"],[87,1,"w"],[88,1,"x"],[89,1,"y"],[90,1,"z"],[[91,96],2],[[97,122],2],[[123,127],2],[[128,159],3],[160,1," "],[[161,167],2],[168,1," \u0308"],[169,2],[170,1,"a"],[[171,172],2],[173,7],[174,2],[175,1," \u0304"],[[176,177],2],[178,1,"2"],[179,1,"3"],[180,1," \u0301"],[181,1,"\u03BC"],[182,2],[183,2],[184,1," \u0327"],[185,1,"1"],[186,1,"o"],[187,2],[188,1,"1\u20444"],[189,1,"1\u20442"],[190,1,"3\u20444"],[191,2],[192,1,"\xE0"],[193,1,"\xE1"],[194,1,"\xE2"],[195,1,"\xE3"],[196,1,"\xE4"],[197,1,"\xE5"],[198,1,"\xE6"],[199,1,"\xE7"],[200,1,"\xE8"],[201,1,"\xE9"],[202,1,"\xEA"],[203,1,"\xEB"],[204,1,"\xEC"],[205,1,"\xED"],[206,1,"\xEE"],[207,1,"\xEF"],[208,1,"\xF0"],[209,1,"\xF1"],[210,1,"\xF2"],[211,1,"\xF3"],[212,1,"\xF4"],[213,1,"\xF5"],[214,1,"\xF6"],[215,2],[216,1,"\xF8"],[217,1,"\xF9"],[218,1,"\xFA"],[219,1,"\xFB"],[220,1,"\xFC"],[221,1,"\xFD"],[222,1,"\xFE"],[223,6,"ss"],[[224,246],2],[247,2],[[248,255],2],[256,1,"\u0101"],[257,2],[258,1,"\u0103"],[259,2],[260,1,"\u0105"],[261,2],[262,1,"\u0107"],[263,2],[264,1,"\u0109"],[265,2],[266,1,"\u010B"],[267,2],[268,1,"\u010D"],[269,2],[270,1,"\u010F"],[271,2],[272,1,"\u0111"],[273,2],[274,1,"\u0113"],[275,2],[276,1,"\u0115"],[277,2],[278,1,"\u0117"],[279,2],[280,1,"\u0119"],[281,2],[282,1,"\u011B"],[283,2],[284,1,"\u011D"],[285,2],[286,1,"\u011F"],[287,2],[288,1,"\u0121"],[289,2],[290,1,"\u0123"],[291,2],[292,1,"\u0125"],[293,2],[294,1,"\u0127"],[295,2],[296,1,"\u0129"],[297,2],[298,1,"\u012B"],[299,2],[300,1,"\u012D"],[301,2],[302,1,"\u012F"],[303,2],[304,1,"i\u0307"],[305,2],[[306,307],1,"ij"],[308,1,"\u0135"],[309,2],[310,1,"\u0137"],[[311,312],2],[313,1,"\u013A"],[314,2],[315,1,"\u013C"],[316,2],[317,1,"\u013E"],[318,2],[[319,320],1,"l\xB7"],[321,1,"\u0142"],[322,2],[323,1,"\u0144"],[324,2],[325,1,"\u0146"],[326,2],[327,1,"\u0148"],[328,2],[329,1,"\u02BCn"],[330,1,"\u014B"],[331,2],[332,1,"\u014D"],[333,2],[334,1,"\u014F"],[335,2],[336,1,"\u0151"],[337,2],[338,1,"\u0153"],[339,2],[340,1,"\u0155"],[341,2],[342,1,"\u0157"],[343,2],[344,1,"\u0159"],[345,2],[346,1,"\u015B"],[347,2],[348,1,"\u015D"],[349,2],[350,1,"\u015F"],[351,2],[352,1,"\u0161"],[353,2],[354,1,"\u0163"],[355,2],[356,1,"\u0165"],[357,2],[358,1,"\u0167"],[359,2],[360,1,"\u0169"],[361,2],[362,1,"\u016B"],[363,2],[364,1,"\u016D"],[365,2],[366,1,"\u016F"],[367,2],[368,1,"\u0171"],[369,2],[370,1,"\u0173"],[371,2],[372,1,"\u0175"],[373,2],[374,1,"\u0177"],[375,2],[376,1,"\xFF"],[377,1,"\u017A"],[378,2],[379,1,"\u017C"],[380,2],[381,1,"\u017E"],[382,2],[383,1,"s"],[384,2],[385,1,"\u0253"],[386,1,"\u0183"],[387,2],[388,1,"\u0185"],[389,2],[390,1,"\u0254"],[391,1,"\u0188"],[392,2],[393,1,"\u0256"],[394,1,"\u0257"],[395,1,"\u018C"],[[396,397],2],[398,1,"\u01DD"],[399,1,"\u0259"],[400,1,"\u025B"],[401,1,"\u0192"],[402,2],[403,1,"\u0260"],[404,1,"\u0263"],[405,2],[406,1,"\u0269"],[407,1,"\u0268"],[408,1,"\u0199"],[[409,411],2],[412,1,"\u026F"],[413,1,"\u0272"],[414,2],[415,1,"\u0275"],[416,1,"\u01A1"],[417,2],[418,1,"\u01A3"],[419,2],[420,1,"\u01A5"],[421,2],[422,1,"\u0280"],[423,1,"\u01A8"],[424,2],[425,1,"\u0283"],[[426,427],2],[428,1,"\u01AD"],[429,2],[430,1,"\u0288"],[431,1,"\u01B0"],[432,2],[433,1,"\u028A"],[434,1,"\u028B"],[435,1,"\u01B4"],[436,2],[437,1,"\u01B6"],[438,2],[439,1,"\u0292"],[440,1,"\u01B9"],[[441,443],2],[444,1,"\u01BD"],[[445,451],2],[[452,454],1,"d\u017E"],[[455,457],1,"lj"],[[458,460],1,"nj"],[461,1,"\u01CE"],[462,2],[463,1,"\u01D0"],[464,2],[465,1,"\u01D2"],[466,2],[467,1,"\u01D4"],[468,2],[469,1,"\u01D6"],[470,2],[471,1,"\u01D8"],[472,2],[473,1,"\u01DA"],[474,2],[475,1,"\u01DC"],[[476,477],2],[478,1,"\u01DF"],[479,2],[480,1,"\u01E1"],[481,2],[482,1,"\u01E3"],[483,2],[484,1,"\u01E5"],[485,2],[486,1,"\u01E7"],[487,2],[488,1,"\u01E9"],[489,2],[490,1,"\u01EB"],[491,2],[492,1,"\u01ED"],[493,2],[494,1,"\u01EF"],[[495,496],2],[[497,499],1,"dz"],[500,1,"\u01F5"],[501,2],[502,1,"\u0195"],[503,1,"\u01BF"],[504,1,"\u01F9"],[505,2],[506,1,"\u01FB"],[507,2],[508,1,"\u01FD"],[509,2],[510,1,"\u01FF"],[511,2],[512,1,"\u0201"],[513,2],[514,1,"\u0203"],[515,2],[516,1,"\u0205"],[517,2],[518,1,"\u0207"],[519,2],[520,1,"\u0209"],[521,2],[522,1,"\u020B"],[523,2],[524,1,"\u020D"],[525,2],[526,1,"\u020F"],[527,2],[528,1,"\u0211"],[529,2],[530,1,"\u0213"],[531,2],[532,1,"\u0215"],[533,2],[534,1,"\u0217"],[535,2],[536,1,"\u0219"],[537,2],[538,1,"\u021B"],[539,2],[540,1,"\u021D"],[541,2],[542,1,"\u021F"],[543,2],[544,1,"\u019E"],[545,2],[546,1,"\u0223"],[547,2],[548,1,"\u0225"],[549,2],[550,1,"\u0227"],[551,2],[552,1,"\u0229"],[553,2],[554,1,"\u022B"],[555,2],[556,1,"\u022D"],[557,2],[558,1,"\u022F"],[559,2],[560,1,"\u0231"],[561,2],[562,1,"\u0233"],[563,2],[[564,566],2],[[567,569],2],[570,1,"\u2C65"],[571,1,"\u023C"],[572,2],[573,1,"\u019A"],[574,1,"\u2C66"],[[575,576],2],[577,1,"\u0242"],[578,2],[579,1,"\u0180"],[580,1,"\u0289"],[581,1,"\u028C"],[582,1,"\u0247"],[583,2],[584,1,"\u0249"],[585,2],[586,1,"\u024B"],[587,2],[588,1,"\u024D"],[589,2],[590,1,"\u024F"],[591,2],[[592,680],2],[[681,685],2],[[686,687],2],[688,1,"h"],[689,1,"\u0266"],[690,1,"j"],[691,1,"r"],[692,1,"\u0279"],[693,1,"\u027B"],[694,1,"\u0281"],[695,1,"w"],[696,1,"y"],[[697,705],2],[[706,709],2],[[710,721],2],[[722,727],2],[728,1," \u0306"],[729,1," \u0307"],[730,1," \u030A"],[731,1," \u0328"],[732,1," \u0303"],[733,1," \u030B"],[734,2],[735,2],[736,1,"\u0263"],[737,1,"l"],[738,1,"s"],[739,1,"x"],[740,1,"\u0295"],[[741,745],2],[[746,747],2],[748,2],[749,2],[750,2],[[751,767],2],[[768,831],2],[832,1,"\u0300"],[833,1,"\u0301"],[834,2],[835,1,"\u0313"],[836,1,"\u0308\u0301"],[837,1,"\u03B9"],[[838,846],2],[847,7],[[848,855],2],[[856,860],2],[[861,863],2],[[864,865],2],[866,2],[[867,879],2],[880,1,"\u0371"],[881,2],[882,1,"\u0373"],[883,2],[884,1,"\u02B9"],[885,2],[886,1,"\u0377"],[887,2],[[888,889],3],[890,1," \u03B9"],[[891,893],2],[894,1,";"],[895,1,"\u03F3"],[[896,899],3],[900,1," \u0301"],[901,1," \u0308\u0301"],[902,1,"\u03AC"],[903,1,"\xB7"],[904,1,"\u03AD"],[905,1,"\u03AE"],[906,1,"\u03AF"],[907,3],[908,1,"\u03CC"],[909,3],[910,1,"\u03CD"],[911,1,"\u03CE"],[912,2],[913,1,"\u03B1"],[914,1,"\u03B2"],[915,1,"\u03B3"],[916,1,"\u03B4"],[917,1,"\u03B5"],[918,1,"\u03B6"],[919,1,"\u03B7"],[920,1,"\u03B8"],[921,1,"\u03B9"],[922,1,"\u03BA"],[923,1,"\u03BB"],[924,1,"\u03BC"],[925,1,"\u03BD"],[926,1,"\u03BE"],[927,1,"\u03BF"],[928,1,"\u03C0"],[929,1,"\u03C1"],[930,3],[931,1,"\u03C3"],[932,1,"\u03C4"],[933,1,"\u03C5"],[934,1,"\u03C6"],[935,1,"\u03C7"],[936,1,"\u03C8"],[937,1,"\u03C9"],[938,1,"\u03CA"],[939,1,"\u03CB"],[[940,961],2],[962,6,"\u03C3"],[[963,974],2],[975,1,"\u03D7"],[976,1,"\u03B2"],[977,1,"\u03B8"],[978,1,"\u03C5"],[979,1,"\u03CD"],[980,1,"\u03CB"],[981,1,"\u03C6"],[982,1,"\u03C0"],[983,2],[984,1,"\u03D9"],[985,2],[986,1,"\u03DB"],[987,2],[988,1,"\u03DD"],[989,2],[990,1,"\u03DF"],[991,2],[992,1,"\u03E1"],[993,2],[994,1,"\u03E3"],[995,2],[996,1,"\u03E5"],[997,2],[998,1,"\u03E7"],[999,2],[1000,1,"\u03E9"],[1001,2],[1002,1,"\u03EB"],[1003,2],[1004,1,"\u03ED"],[1005,2],[1006,1,"\u03EF"],[1007,2],[1008,1,"\u03BA"],[1009,1,"\u03C1"],[1010,1,"\u03C3"],[1011,2],[1012,1,"\u03B8"],[1013,1,"\u03B5"],[1014,2],[1015,1,"\u03F8"],[1016,2],[1017,1,"\u03C3"],[1018,1,"\u03FB"],[1019,2],[1020,2],[1021,1,"\u037B"],[1022,1,"\u037C"],[1023,1,"\u037D"],[1024,1,"\u0450"],[1025,1,"\u0451"],[1026,1,"\u0452"],[1027,1,"\u0453"],[1028,1,"\u0454"],[1029,1,"\u0455"],[1030,1,"\u0456"],[1031,1,"\u0457"],[1032,1,"\u0458"],[1033,1,"\u0459"],[1034,1,"\u045A"],[1035,1,"\u045B"],[1036,1,"\u045C"],[1037,1,"\u045D"],[1038,1,"\u045E"],[1039,1,"\u045F"],[1040,1,"\u0430"],[1041,1,"\u0431"],[1042,1,"\u0432"],[1043,1,"\u0433"],[1044,1,"\u0434"],[1045,1,"\u0435"],[1046,1,"\u0436"],[1047,1,"\u0437"],[1048,1,"\u0438"],[1049,1,"\u0439"],[1050,1,"\u043A"],[1051,1,"\u043B"],[1052,1,"\u043C"],[1053,1,"\u043D"],[1054,1,"\u043E"],[1055,1,"\u043F"],[1056,1,"\u0440"],[1057,1,"\u0441"],[1058,1,"\u0442"],[1059,1,"\u0443"],[1060,1,"\u0444"],[1061,1,"\u0445"],[1062,1,"\u0446"],[1063,1,"\u0447"],[1064,1,"\u0448"],[1065,1,"\u0449"],[1066,1,"\u044A"],[1067,1,"\u044B"],[1068,1,"\u044C"],[1069,1,"\u044D"],[1070,1,"\u044E"],[1071,1,"\u044F"],[[1072,1103],2],[1104,2],[[1105,1116],2],[1117,2],[[1118,1119],2],[1120,1,"\u0461"],[1121,2],[1122,1,"\u0463"],[1123,2],[1124,1,"\u0465"],[1125,2],[1126,1,"\u0467"],[1127,2],[1128,1,"\u0469"],[1129,2],[1130,1,"\u046B"],[1131,2],[1132,1,"\u046D"],[1133,2],[1134,1,"\u046F"],[1135,2],[1136,1,"\u0471"],[1137,2],[1138,1,"\u0473"],[1139,2],[1140,1,"\u0475"],[1141,2],[1142,1,"\u0477"],[1143,2],[1144,1,"\u0479"],[1145,2],[1146,1,"\u047B"],[1147,2],[1148,1,"\u047D"],[1149,2],[1150,1,"\u047F"],[1151,2],[1152,1,"\u0481"],[1153,2],[1154,2],[[1155,1158],2],[1159,2],[[1160,1161],2],[1162,1,"\u048B"],[1163,2],[1164,1,"\u048D"],[1165,2],[1166,1,"\u048F"],[1167,2],[1168,1,"\u0491"],[1169,2],[1170,1,"\u0493"],[1171,2],[1172,1,"\u0495"],[1173,2],[1174,1,"\u0497"],[1175,2],[1176,1,"\u0499"],[1177,2],[1178,1,"\u049B"],[1179,2],[1180,1,"\u049D"],[1181,2],[1182,1,"\u049F"],[1183,2],[1184,1,"\u04A1"],[1185,2],[1186,1,"\u04A3"],[1187,2],[1188,1,"\u04A5"],[1189,2],[1190,1,"\u04A7"],[1191,2],[1192,1,"\u04A9"],[1193,2],[1194,1,"\u04AB"],[1195,2],[1196,1,"\u04AD"],[1197,2],[1198,1,"\u04AF"],[1199,2],[1200,1,"\u04B1"],[1201,2],[1202,1,"\u04B3"],[1203,2],[1204,1,"\u04B5"],[1205,2],[1206,1,"\u04B7"],[1207,2],[1208,1,"\u04B9"],[1209,2],[1210,1,"\u04BB"],[1211,2],[1212,1,"\u04BD"],[1213,2],[1214,1,"\u04BF"],[1215,2],[1216,1,"\u04CF"],[1217,1,"\u04C2"],[1218,2],[1219,1,"\u04C4"],[1220,2],[1221,1,"\u04C6"],[1222,2],[1223,1,"\u04C8"],[1224,2],[1225,1,"\u04CA"],[1226,2],[1227,1,"\u04CC"],[1228,2],[1229,1,"\u04CE"],[1230,2],[1231,2],[1232,1,"\u04D1"],[1233,2],[1234,1,"\u04D3"],[1235,2],[1236,1,"\u04D5"],[1237,2],[1238,1,"\u04D7"],[1239,2],[1240,1,"\u04D9"],[1241,2],[1242,1,"\u04DB"],[1243,2],[1244,1,"\u04DD"],[1245,2],[1246,1,"\u04DF"],[1247,2],[1248,1,"\u04E1"],[1249,2],[1250,1,"\u04E3"],[1251,2],[1252,1,"\u04E5"],[1253,2],[1254,1,"\u04E7"],[1255,2],[1256,1,"\u04E9"],[1257,2],[1258,1,"\u04EB"],[1259,2],[1260,1,"\u04ED"],[1261,2],[1262,1,"\u04EF"],[1263,2],[1264,1,"\u04F1"],[1265,2],[1266,1,"\u04F3"],[1267,2],[1268,1,"\u04F5"],[1269,2],[1270,1,"\u04F7"],[1271,2],[1272,1,"\u04F9"],[1273,2],[1274,1,"\u04FB"],[1275,2],[1276,1,"\u04FD"],[1277,2],[1278,1,"\u04FF"],[1279,2],[1280,1,"\u0501"],[1281,2],[1282,1,"\u0503"],[1283,2],[1284,1,"\u0505"],[1285,2],[1286,1,"\u0507"],[1287,2],[1288,1,"\u0509"],[1289,2],[1290,1,"\u050B"],[1291,2],[1292,1,"\u050D"],[1293,2],[1294,1,"\u050F"],[1295,2],[1296,1,"\u0511"],[1297,2],[1298,1,"\u0513"],[1299,2],[1300,1,"\u0515"],[1301,2],[1302,1,"\u0517"],[1303,2],[1304,1,"\u0519"],[1305,2],[1306,1,"\u051B"],[1307,2],[1308,1,"\u051D"],[1309,2],[1310,1,"\u051F"],[1311,2],[1312,1,"\u0521"],[1313,2],[1314,1,"\u0523"],[1315,2],[1316,1,"\u0525"],[1317,2],[1318,1,"\u0527"],[1319,2],[1320,1,"\u0529"],[1321,2],[1322,1,"\u052B"],[1323,2],[1324,1,"\u052D"],[1325,2],[1326,1,"\u052F"],[1327,2],[1328,3],[1329,1,"\u0561"],[1330,1,"\u0562"],[1331,1,"\u0563"],[1332,1,"\u0564"],[1333,1,"\u0565"],[1334,1,"\u0566"],[1335,1,"\u0567"],[1336,1,"\u0568"],[1337,1,"\u0569"],[1338,1,"\u056A"],[1339,1,"\u056B"],[1340,1,"\u056C"],[1341,1,"\u056D"],[1342,1,"\u056E"],[1343,1,"\u056F"],[1344,1,"\u0570"],[1345,1,"\u0571"],[1346,1,"\u0572"],[1347,1,"\u0573"],[1348,1,"\u0574"],[1349,1,"\u0575"],[1350,1,"\u0576"],[1351,1,"\u0577"],[1352,1,"\u0578"],[1353,1,"\u0579"],[1354,1,"\u057A"],[1355,1,"\u057B"],[1356,1,"\u057C"],[1357,1,"\u057D"],[1358,1,"\u057E"],[1359,1,"\u057F"],[1360,1,"\u0580"],[1361,1,"\u0581"],[1362,1,"\u0582"],[1363,1,"\u0583"],[1364,1,"\u0584"],[1365,1,"\u0585"],[1366,1,"\u0586"],[[1367,1368],3],[1369,2],[[1370,1375],2],[1376,2],[[1377,1414],2],[1415,1,"\u0565\u0582"],[1416,2],[1417,2],[1418,2],[[1419,1420],3],[[1421,1422],2],[1423,2],[1424,3],[[1425,1441],2],[1442,2],[[1443,1455],2],[[1456,1465],2],[1466,2],[[1467,1469],2],[1470,2],[1471,2],[1472,2],[[1473,1474],2],[1475,2],[1476,2],[1477,2],[1478,2],[1479,2],[[1480,1487],3],[[1488,1514],2],[[1515,1518],3],[1519,2],[[1520,1524],2],[[1525,1535],3],[[1536,1539],3],[1540,3],[1541,3],[[1542,1546],2],[1547,2],[1548,2],[[1549,1551],2],[[1552,1557],2],[[1558,1562],2],[1563,2],[1564,3],[1565,2],[1566,2],[1567,2],[1568,2],[[1569,1594],2],[[1595,1599],2],[1600,2],[[1601,1618],2],[[1619,1621],2],[[1622,1624],2],[[1625,1630],2],[1631,2],[[1632,1641],2],[[1642,1645],2],[[1646,1647],2],[[1648,1652],2],[1653,1,"\u0627\u0674"],[1654,1,"\u0648\u0674"],[1655,1,"\u06C7\u0674"],[1656,1,"\u064A\u0674"],[[1657,1719],2],[[1720,1721],2],[[1722,1726],2],[1727,2],[[1728,1742],2],[1743,2],[[1744,1747],2],[1748,2],[[1749,1756],2],[1757,3],[1758,2],[[1759,1768],2],[1769,2],[[1770,1773],2],[[1774,1775],2],[[1776,1785],2],[[1786,1790],2],[1791,2],[[1792,1805],2],[1806,3],[1807,3],[[1808,1836],2],[[1837,1839],2],[[1840,1866],2],[[1867,1868],3],[[1869,1871],2],[[1872,1901],2],[[1902,1919],2],[[1920,1968],2],[1969,2],[[1970,1983],3],[[1984,2037],2],[[2038,2042],2],[[2043,2044],3],[2045,2],[[2046,2047],2],[[2048,2093],2],[[2094,2095],3],[[2096,2110],2],[2111,3],[[2112,2139],2],[[2140,2141],3],[2142,2],[2143,3],[[2144,2154],2],[[2155,2159],3],[[2160,2183],2],[2184,2],[[2185,2190],2],[2191,2],[[2192,2193],3],[[2194,2198],3],[2199,2],[[2200,2207],2],[2208,2],[2209,2],[[2210,2220],2],[[2221,2226],2],[[2227,2228],2],[2229,2],[[2230,2237],2],[[2238,2247],2],[[2248,2258],2],[2259,2],[[2260,2273],2],[2274,3],[2275,2],[[2276,2302],2],[2303,2],[2304,2],[[2305,2307],2],[2308,2],[[2309,2361],2],[[2362,2363],2],[[2364,2381],2],[2382,2],[2383,2],[[2384,2388],2],[2389,2],[[2390,2391],2],[2392,1,"\u0915\u093C"],[2393,1,"\u0916\u093C"],[2394,1,"\u0917\u093C"],[2395,1,"\u091C\u093C"],[2396,1,"\u0921\u093C"],[2397,1,"\u0922\u093C"],[2398,1,"\u092B\u093C"],[2399,1,"\u092F\u093C"],[[2400,2403],2],[[2404,2405],2],[[2406,2415],2],[2416,2],[[2417,2418],2],[[2419,2423],2],[2424,2],[[2425,2426],2],[[2427,2428],2],[2429,2],[[2430,2431],2],[2432,2],[[2433,2435],2],[2436,3],[[2437,2444],2],[[2445,2446],3],[[2447,2448],2],[[2449,2450],3],[[2451,2472],2],[2473,3],[[2474,2480],2],[2481,3],[2482,2],[[2483,2485],3],[[2486,2489],2],[[2490,2491],3],[2492,2],[2493,2],[[2494,2500],2],[[2501,2502],3],[[2503,2504],2],[[2505,2506],3],[[2507,2509],2],[2510,2],[[2511,2518],3],[2519,2],[[2520,2523],3],[2524,1,"\u09A1\u09BC"],[2525,1,"\u09A2\u09BC"],[2526,3],[2527,1,"\u09AF\u09BC"],[[2528,2531],2],[[2532,2533],3],[[2534,2545],2],[[2546,2554],2],[2555,2],[2556,2],[2557,2],[2558,2],[[2559,2560],3],[2561,2],[2562,2],[2563,2],[2564,3],[[2565,2570],2],[[2571,2574],3],[[2575,2576],2],[[2577,2578],3],[[2579,2600],2],[2601,3],[[2602,2608],2],[2609,3],[2610,2],[2611,1,"\u0A32\u0A3C"],[2612,3],[2613,2],[2614,1,"\u0A38\u0A3C"],[2615,3],[[2616,2617],2],[[2618,2619],3],[2620,2],[2621,3],[[2622,2626],2],[[2627,2630],3],[[2631,2632],2],[[2633,2634],3],[[2635,2637],2],[[2638,2640],3],[2641,2],[[2642,2648],3],[2649,1,"\u0A16\u0A3C"],[2650,1,"\u0A17\u0A3C"],[2651,1,"\u0A1C\u0A3C"],[2652,2],[2653,3],[2654,1,"\u0A2B\u0A3C"],[[2655,2661],3],[[2662,2676],2],[2677,2],[2678,2],[[2679,2688],3],[[2689,2691],2],[2692,3],[[2693,2699],2],[2700,2],[2701,2],[2702,3],[[2703,2705],2],[2706,3],[[2707,2728],2],[2729,3],[[2730,2736],2],[2737,3],[[2738,2739],2],[2740,3],[[2741,2745],2],[[2746,2747],3],[[2748,2757],2],[2758,3],[[2759,2761],2],[2762,3],[[2763,2765],2],[[2766,2767],3],[2768,2],[[2769,2783],3],[2784,2],[[2785,2787],2],[[2788,2789],3],[[2790,2799],2],[2800,2],[2801,2],[[2802,2808],3],[2809,2],[[2810,2815],2],[2816,3],[[2817,2819],2],[2820,3],[[2821,2828],2],[[2829,2830],3],[[2831,2832],2],[[2833,2834],3],[[2835,2856],2],[2857,3],[[2858,2864],2],[2865,3],[[2866,2867],2],[2868,3],[2869,2],[[2870,2873],2],[[2874,2875],3],[[2876,2883],2],[2884,2],[[2885,2886],3],[[2887,2888],2],[[2889,2890],3],[[2891,2893],2],[[2894,2900],3],[2901,2],[[2902,2903],2],[[2904,2907],3],[2908,1,"\u0B21\u0B3C"],[2909,1,"\u0B22\u0B3C"],[2910,3],[[2911,2913],2],[[2914,2915],2],[[2916,2917],3],[[2918,2927],2],[2928,2],[2929,2],[[2930,2935],2],[[2936,2945],3],[[2946,2947],2],[2948,3],[[2949,2954],2],[[2955,2957],3],[[2958,2960],2],[2961,3],[[2962,2965],2],[[2966,2968],3],[[2969,2970],2],[2971,3],[2972,2],[2973,3],[[2974,2975],2],[[2976,2978],3],[[2979,2980],2],[[2981,2983],3],[[2984,2986],2],[[2987,2989],3],[[2990,2997],2],[2998,2],[[2999,3001],2],[[3002,3005],3],[[3006,3010],2],[[3011,3013],3],[[3014,3016],2],[3017,3],[[3018,3021],2],[[3022,3023],3],[3024,2],[[3025,3030],3],[3031,2],[[3032,3045],3],[3046,2],[[3047,3055],2],[[3056,3058],2],[[3059,3066],2],[[3067,3071],3],[3072,2],[[3073,3075],2],[3076,2],[[3077,3084],2],[3085,3],[[3086,3088],2],[3089,3],[[3090,3112],2],[3113,3],[[3114,3123],2],[3124,2],[[3125,3129],2],[[3130,3131],3],[3132,2],[3133,2],[[3134,3140],2],[3141,3],[[3142,3144],2],[3145,3],[[3146,3149],2],[[3150,3156],3],[[3157,3158],2],[3159,3],[[3160,3161],2],[3162,2],[3163,3],[3164,2],[3165,2],[[3166,3167],3],[[3168,3169],2],[[3170,3171],2],[[3172,3173],3],[[3174,3183],2],[[3184,3190],3],[3191,2],[[3192,3199],2],[3200,2],[3201,2],[[3202,3203],2],[3204,2],[[3205,3212],2],[3213,3],[[3214,3216],2],[3217,3],[[3218,3240],2],[3241,3],[[3242,3251],2],[3252,3],[[3253,3257],2],[[3258,3259],3],[[3260,3261],2],[[3262,3268],2],[3269,3],[[3270,3272],2],[3273,3],[[3274,3277],2],[[3278,3284],3],[[3285,3286],2],[[3287,3291],3],[3292,2],[3293,2],[3294,2],[3295,3],[[3296,3297],2],[[3298,3299],2],[[3300,3301],3],[[3302,3311],2],[3312,3],[[3313,3314],2],[3315,2],[[3316,3327],3],[3328,2],[3329,2],[[3330,3331],2],[3332,2],[[3333,3340],2],[3341,3],[[3342,3344],2],[3345,3],[[3346,3368],2],[3369,2],[[3370,3385],2],[3386,2],[[3387,3388],2],[3389,2],[[3390,3395],2],[3396,2],[3397,3],[[3398,3400],2],[3401,3],[[3402,3405],2],[3406,2],[3407,2],[[3408,3411],3],[[3412,3414],2],[3415,2],[[3416,3422],2],[3423,2],[[3424,3425],2],[[3426,3427],2],[[3428,3429],3],[[3430,3439],2],[[3440,3445],2],[[3446,3448],2],[3449,2],[[3450,3455],2],[3456,3],[3457,2],[[3458,3459],2],[3460,3],[[3461,3478],2],[[3479,3481],3],[[3482,3505],2],[3506,3],[[3507,3515],2],[3516,3],[3517,2],[[3518,3519],3],[[3520,3526],2],[[3527,3529],3],[3530,2],[[3531,3534],3],[[3535,3540],2],[3541,3],[3542,2],[3543,3],[[3544,3551],2],[[3552,3557],3],[[3558,3567],2],[[3568,3569],3],[[3570,3571],2],[3572,2],[[3573,3584],3],[[3585,3634],2],[3635,1,"\u0E4D\u0E32"],[[3636,3642],2],[[3643,3646],3],[3647,2],[[3648,3662],2],[3663,2],[[3664,3673],2],[[3674,3675],2],[[3676,3712],3],[[3713,3714],2],[3715,3],[3716,2],[3717,3],[3718,2],[[3719,3720],2],[3721,2],[3722,2],[3723,3],[3724,2],[3725,2],[[3726,3731],2],[[3732,3735],2],[3736,2],[[3737,3743],2],[3744,2],[[3745,3747],2],[3748,3],[3749,2],[3750,3],[3751,2],[[3752,3753],2],[[3754,3755],2],[3756,2],[[3757,3762],2],[3763,1,"\u0ECD\u0EB2"],[[3764,3769],2],[3770,2],[[3771,3773],2],[[3774,3775],3],[[3776,3780],2],[3781,3],[3782,2],[3783,3],[[3784,3789],2],[3790,2],[3791,3],[[3792,3801],2],[[3802,3803],3],[3804,1,"\u0EAB\u0E99"],[3805,1,"\u0EAB\u0EA1"],[[3806,3807],2],[[3808,3839],3],[3840,2],[[3841,3850],2],[3851,2],[3852,1,"\u0F0B"],[[3853,3863],2],[[3864,3865],2],[[3866,3871],2],[[3872,3881],2],[[3882,3892],2],[3893,2],[3894,2],[3895,2],[3896,2],[3897,2],[[3898,3901],2],[[3902,3906],2],[3907,1,"\u0F42\u0FB7"],[[3908,3911],2],[3912,3],[[3913,3916],2],[3917,1,"\u0F4C\u0FB7"],[[3918,3921],2],[3922,1,"\u0F51\u0FB7"],[[3923,3926],2],[3927,1,"\u0F56\u0FB7"],[[3928,3931],2],[3932,1,"\u0F5B\u0FB7"],[[3933,3944],2],[3945,1,"\u0F40\u0FB5"],[3946,2],[[3947,3948],2],[[3949,3952],3],[[3953,3954],2],[3955,1,"\u0F71\u0F72"],[3956,2],[3957,1,"\u0F71\u0F74"],[3958,1,"\u0FB2\u0F80"],[3959,1,"\u0FB2\u0F71\u0F80"],[3960,1,"\u0FB3\u0F80"],[3961,1,"\u0FB3\u0F71\u0F80"],[[3962,3968],2],[3969,1,"\u0F71\u0F80"],[[3970,3972],2],[3973,2],[[3974,3979],2],[[3980,3983],2],[[3984,3986],2],[3987,1,"\u0F92\u0FB7"],[[3988,3989],2],[3990,2],[3991,2],[3992,3],[[3993,3996],2],[3997,1,"\u0F9C\u0FB7"],[[3998,4001],2],[4002,1,"\u0FA1\u0FB7"],[[4003,4006],2],[4007,1,"\u0FA6\u0FB7"],[[4008,4011],2],[4012,1,"\u0FAB\u0FB7"],[4013,2],[[4014,4016],2],[[4017,4023],2],[4024,2],[4025,1,"\u0F90\u0FB5"],[[4026,4028],2],[4029,3],[[4030,4037],2],[4038,2],[[4039,4044],2],[4045,3],[4046,2],[4047,2],[[4048,4049],2],[[4050,4052],2],[[4053,4056],2],[[4057,4058],2],[[4059,4095],3],[[4096,4129],2],[4130,2],[[4131,4135],2],[4136,2],[[4137,4138],2],[4139,2],[[4140,4146],2],[[4147,4149],2],[[4150,4153],2],[[4154,4159],2],[[4160,4169],2],[[4170,4175],2],[[4176,4185],2],[[4186,4249],2],[[4250,4253],2],[[4254,4255],2],[4256,1,"\u2D00"],[4257,1,"\u2D01"],[4258,1,"\u2D02"],[4259,1,"\u2D03"],[4260,1,"\u2D04"],[4261,1,"\u2D05"],[4262,1,"\u2D06"],[4263,1,"\u2D07"],[4264,1,"\u2D08"],[4265,1,"\u2D09"],[4266,1,"\u2D0A"],[4267,1,"\u2D0B"],[4268,1,"\u2D0C"],[4269,1,"\u2D0D"],[4270,1,"\u2D0E"],[4271,1,"\u2D0F"],[4272,1,"\u2D10"],[4273,1,"\u2D11"],[4274,1,"\u2D12"],[4275,1,"\u2D13"],[4276,1,"\u2D14"],[4277,1,"\u2D15"],[4278,1,"\u2D16"],[4279,1,"\u2D17"],[4280,1,"\u2D18"],[4281,1,"\u2D19"],[4282,1,"\u2D1A"],[4283,1,"\u2D1B"],[4284,1,"\u2D1C"],[4285,1,"\u2D1D"],[4286,1,"\u2D1E"],[4287,1,"\u2D1F"],[4288,1,"\u2D20"],[4289,1,"\u2D21"],[4290,1,"\u2D22"],[4291,1,"\u2D23"],[4292,1,"\u2D24"],[4293,1,"\u2D25"],[4294,3],[4295,1,"\u2D27"],[[4296,4300],3],[4301,1,"\u2D2D"],[[4302,4303],3],[[4304,4342],2],[[4343,4344],2],[[4345,4346],2],[4347,2],[4348,1,"\u10DC"],[[4349,4351],2],[[4352,4441],2],[[4442,4446],2],[[4447,4448],7],[[4449,4514],2],[[4515,4519],2],[[4520,4601],2],[[4602,4607],2],[[4608,4614],2],[4615,2],[[4616,4678],2],[4679,2],[4680,2],[4681,3],[[4682,4685],2],[[4686,4687],3],[[4688,4694],2],[4695,3],[4696,2],[4697,3],[[4698,4701],2],[[4702,4703],3],[[4704,4742],2],[4743,2],[4744,2],[4745,3],[[4746,4749],2],[[4750,4751],3],[[4752,4782],2],[4783,2],[4784,2],[4785,3],[[4786,4789],2],[[4790,4791],3],[[4792,4798],2],[4799,3],[4800,2],[4801,3],[[4802,4805],2],[[4806,4807],3],[[4808,4814],2],[4815,2],[[4816,4822],2],[4823,3],[[4824,4846],2],[4847,2],[[4848,4878],2],[4879,2],[4880,2],[4881,3],[[4882,4885],2],[[4886,4887],3],[[4888,4894],2],[4895,2],[[4896,4934],2],[4935,2],[[4936,4954],2],[[4955,4956],3],[[4957,4958],2],[4959,2],[4960,2],[[4961,4988],2],[[4989,4991],3],[[4992,5007],2],[[5008,5017],2],[[5018,5023],3],[[5024,5108],2],[5109,2],[[5110,5111],3],[5112,1,"\u13F0"],[5113,1,"\u13F1"],[5114,1,"\u13F2"],[5115,1,"\u13F3"],[5116,1,"\u13F4"],[5117,1,"\u13F5"],[[5118,5119],3],[5120,2],[[5121,5740],2],[[5741,5742],2],[[5743,5750],2],[[5751,5759],2],[5760,3],[[5761,5786],2],[[5787,5788],2],[[5789,5791],3],[[5792,5866],2],[[5867,5872],2],[[5873,5880],2],[[5881,5887],3],[[5888,5900],2],[5901,2],[[5902,5908],2],[5909,2],[[5910,5918],3],[5919,2],[[5920,5940],2],[[5941,5942],2],[[5943,5951],3],[[5952,5971],2],[[5972,5983],3],[[5984,5996],2],[5997,3],[[5998,6000],2],[6001,3],[[6002,6003],2],[[6004,6015],3],[[6016,6067],2],[[6068,6069],7],[[6070,6099],2],[[6100,6102],2],[6103,2],[[6104,6107],2],[6108,2],[6109,2],[[6110,6111],3],[[6112,6121],2],[[6122,6127],3],[[6128,6137],2],[[6138,6143],3],[[6144,6154],2],[[6155,6158],7],[6159,7],[[6160,6169],2],[[6170,6175],3],[[6176,6263],2],[6264,2],[[6265,6271],3],[[6272,6313],2],[6314,2],[[6315,6319],3],[[6320,6389],2],[[6390,6399],3],[[6400,6428],2],[[6429,6430],2],[6431,3],[[6432,6443],2],[[6444,6447],3],[[6448,6459],2],[[6460,6463],3],[6464,2],[[6465,6467],3],[[6468,6469],2],[[6470,6509],2],[[6510,6511],3],[[6512,6516],2],[[6517,6527],3],[[6528,6569],2],[[6570,6571],2],[[6572,6575],3],[[6576,6601],2],[[6602,6607],3],[[6608,6617],2],[6618,2],[[6619,6621],3],[[6622,6623],2],[[6624,6655],2],[[6656,6683],2],[[6684,6685],3],[[6686,6687],2],[[6688,6750],2],[6751,3],[[6752,6780],2],[[6781,6782],3],[[6783,6793],2],[[6794,6799],3],[[6800,6809],2],[[6810,6815],3],[[6816,6822],2],[6823,2],[[6824,6829],2],[[6830,6831],3],[[6832,6845],2],[6846,2],[[6847,6848],2],[[6849,6862],2],[[6863,6877],2],[[6878,6879],3],[[6880,6891],2],[[6892,6911],3],[[6912,6987],2],[6988,2],[6989,3],[[6990,6991],2],[[6992,7001],2],[[7002,7018],2],[[7019,7027],2],[[7028,7036],2],[[7037,7038],2],[7039,2],[[7040,7082],2],[[7083,7085],2],[[7086,7097],2],[[7098,7103],2],[[7104,7155],2],[[7156,7163],3],[[7164,7167],2],[[7168,7223],2],[[7224,7226],3],[[7227,7231],2],[[7232,7241],2],[[7242,7244],3],[[7245,7293],2],[[7294,7295],2],[7296,1,"\u0432"],[7297,1,"\u0434"],[7298,1,"\u043E"],[7299,1,"\u0441"],[[7300,7301],1,"\u0442"],[7302,1,"\u044A"],[7303,1,"\u0463"],[7304,1,"\uA64B"],[7305,1,"\u1C8A"],[7306,2],[[7307,7311],3],[7312,1,"\u10D0"],[7313,1,"\u10D1"],[7314,1,"\u10D2"],[7315,1,"\u10D3"],[7316,1,"\u10D4"],[7317,1,"\u10D5"],[7318,1,"\u10D6"],[7319,1,"\u10D7"],[7320,1,"\u10D8"],[7321,1,"\u10D9"],[7322,1,"\u10DA"],[7323,1,"\u10DB"],[7324,1,"\u10DC"],[7325,1,"\u10DD"],[7326,1,"\u10DE"],[7327,1,"\u10DF"],[7328,1,"\u10E0"],[7329,1,"\u10E1"],[7330,1,"\u10E2"],[7331,1,"\u10E3"],[7332,1,"\u10E4"],[7333,1,"\u10E5"],[7334,1,"\u10E6"],[7335,1,"\u10E7"],[7336,1,"\u10E8"],[7337,1,"\u10E9"],[7338,1,"\u10EA"],[7339,1,"\u10EB"],[7340,1,"\u10EC"],[7341,1,"\u10ED"],[7342,1,"\u10EE"],[7343,1,"\u10EF"],[7344,1,"\u10F0"],[7345,1,"\u10F1"],[7346,1,"\u10F2"],[7347,1,"\u10F3"],[7348,1,"\u10F4"],[7349,1,"\u10F5"],[7350,1,"\u10F6"],[7351,1,"\u10F7"],[7352,1,"\u10F8"],[7353,1,"\u10F9"],[7354,1,"\u10FA"],[[7355,7356],3],[7357,1,"\u10FD"],[7358,1,"\u10FE"],[7359,1,"\u10FF"],[[7360,7367],2],[[7368,7375],3],[[7376,7378],2],[7379,2],[[7380,7410],2],[[7411,7414],2],[7415,2],[[7416,7417],2],[7418,2],[[7419,7423],3],[[7424,7467],2],[7468,1,"a"],[7469,1,"\xE6"],[7470,1,"b"],[7471,2],[7472,1,"d"],[7473,1,"e"],[7474,1,"\u01DD"],[7475,1,"g"],[7476,1,"h"],[7477,1,"i"],[7478,1,"j"],[7479,1,"k"],[7480,1,"l"],[7481,1,"m"],[7482,1,"n"],[7483,2],[7484,1,"o"],[7485,1,"\u0223"],[7486,1,"p"],[7487,1,"r"],[7488,1,"t"],[7489,1,"u"],[7490,1,"w"],[7491,1,"a"],[7492,1,"\u0250"],[7493,1,"\u0251"],[7494,1,"\u1D02"],[7495,1,"b"],[7496,1,"d"],[7497,1,"e"],[7498,1,"\u0259"],[7499,1,"\u025B"],[7500,1,"\u025C"],[7501,1,"g"],[7502,2],[7503,1,"k"],[7504,1,"m"],[7505,1,"\u014B"],[7506,1,"o"],[7507,1,"\u0254"],[7508,1,"\u1D16"],[7509,1,"\u1D17"],[7510,1,"p"],[7511,1,"t"],[7512,1,"u"],[7513,1,"\u1D1D"],[7514,1,"\u026F"],[7515,1,"v"],[7516,1,"\u1D25"],[7517,1,"\u03B2"],[7518,1,"\u03B3"],[7519,1,"\u03B4"],[7520,1,"\u03C6"],[7521,1,"\u03C7"],[7522,1,"i"],[7523,1,"r"],[7524,1,"u"],[7525,1,"v"],[7526,1,"\u03B2"],[7527,1,"\u03B3"],[7528,1,"\u03C1"],[7529,1,"\u03C6"],[7530,1,"\u03C7"],[7531,2],[[7532,7543],2],[7544,1,"\u043D"],[[7545,7578],2],[7579,1,"\u0252"],[7580,1,"c"],[7581,1,"\u0255"],[7582,1,"\xF0"],[7583,1,"\u025C"],[7584,1,"f"],[7585,1,"\u025F"],[7586,1,"\u0261"],[7587,1,"\u0265"],[7588,1,"\u0268"],[7589,1,"\u0269"],[7590,1,"\u026A"],[7591,1,"\u1D7B"],[7592,1,"\u029D"],[7593,1,"\u026D"],[7594,1,"\u1D85"],[7595,1,"\u029F"],[7596,1,"\u0271"],[7597,1,"\u0270"],[7598,1,"\u0272"],[7599,1,"\u0273"],[7600,1,"\u0274"],[7601,1,"\u0275"],[7602,1,"\u0278"],[7603,1,"\u0282"],[7604,1,"\u0283"],[7605,1,"\u01AB"],[7606,1,"\u0289"],[7607,1,"\u028A"],[7608,1,"\u1D1C"],[7609,1,"\u028B"],[7610,1,"\u028C"],[7611,1,"z"],[7612,1,"\u0290"],[7613,1,"\u0291"],[7614,1,"\u0292"],[7615,1,"\u03B8"],[[7616,7619],2],[[7620,7626],2],[[7627,7654],2],[[7655,7669],2],[[7670,7673],2],[7674,2],[7675,2],[7676,2],[7677,2],[[7678,7679],2],[7680,1,"\u1E01"],[7681,2],[7682,1,"\u1E03"],[7683,2],[7684,1,"\u1E05"],[7685,2],[7686,1,"\u1E07"],[7687,2],[7688,1,"\u1E09"],[7689,2],[7690,1,"\u1E0B"],[7691,2],[7692,1,"\u1E0D"],[7693,2],[7694,1,"\u1E0F"],[7695,2],[7696,1,"\u1E11"],[7697,2],[7698,1,"\u1E13"],[7699,2],[7700,1,"\u1E15"],[7701,2],[7702,1,"\u1E17"],[7703,2],[7704,1,"\u1E19"],[7705,2],[7706,1,"\u1E1B"],[7707,2],[7708,1,"\u1E1D"],[7709,2],[7710,1,"\u1E1F"],[7711,2],[7712,1,"\u1E21"],[7713,2],[7714,1,"\u1E23"],[7715,2],[7716,1,"\u1E25"],[7717,2],[7718,1,"\u1E27"],[7719,2],[7720,1,"\u1E29"],[7721,2],[7722,1,"\u1E2B"],[7723,2],[7724,1,"\u1E2D"],[7725,2],[7726,1,"\u1E2F"],[7727,2],[7728,1,"\u1E31"],[7729,2],[7730,1,"\u1E33"],[7731,2],[7732,1,"\u1E35"],[7733,2],[7734,1,"\u1E37"],[7735,2],[7736,1,"\u1E39"],[7737,2],[7738,1,"\u1E3B"],[7739,2],[7740,1,"\u1E3D"],[7741,2],[7742,1,"\u1E3F"],[7743,2],[7744,1,"\u1E41"],[7745,2],[7746,1,"\u1E43"],[7747,2],[7748,1,"\u1E45"],[7749,2],[7750,1,"\u1E47"],[7751,2],[7752,1,"\u1E49"],[7753,2],[7754,1,"\u1E4B"],[7755,2],[7756,1,"\u1E4D"],[7757,2],[7758,1,"\u1E4F"],[7759,2],[7760,1,"\u1E51"],[7761,2],[7762,1,"\u1E53"],[7763,2],[7764,1,"\u1E55"],[7765,2],[7766,1,"\u1E57"],[7767,2],[7768,1,"\u1E59"],[7769,2],[7770,1,"\u1E5B"],[7771,2],[7772,1,"\u1E5D"],[7773,2],[7774,1,"\u1E5F"],[7775,2],[7776,1,"\u1E61"],[7777,2],[7778,1,"\u1E63"],[7779,2],[7780,1,"\u1E65"],[7781,2],[7782,1,"\u1E67"],[7783,2],[7784,1,"\u1E69"],[7785,2],[7786,1,"\u1E6B"],[7787,2],[7788,1,"\u1E6D"],[7789,2],[7790,1,"\u1E6F"],[7791,2],[7792,1,"\u1E71"],[7793,2],[7794,1,"\u1E73"],[7795,2],[7796,1,"\u1E75"],[7797,2],[7798,1,"\u1E77"],[7799,2],[7800,1,"\u1E79"],[7801,2],[7802,1,"\u1E7B"],[7803,2],[7804,1,"\u1E7D"],[7805,2],[7806,1,"\u1E7F"],[7807,2],[7808,1,"\u1E81"],[7809,2],[7810,1,"\u1E83"],[7811,2],[7812,1,"\u1E85"],[7813,2],[7814,1,"\u1E87"],[7815,2],[7816,1,"\u1E89"],[7817,2],[7818,1,"\u1E8B"],[7819,2],[7820,1,"\u1E8D"],[7821,2],[7822,1,"\u1E8F"],[7823,2],[7824,1,"\u1E91"],[7825,2],[7826,1,"\u1E93"],[7827,2],[7828,1,"\u1E95"],[[7829,7833],2],[7834,1,"a\u02BE"],[7835,1,"\u1E61"],[[7836,7837],2],[7838,1,"\xDF"],[7839,2],[7840,1,"\u1EA1"],[7841,2],[7842,1,"\u1EA3"],[7843,2],[7844,1,"\u1EA5"],[7845,2],[7846,1,"\u1EA7"],[7847,2],[7848,1,"\u1EA9"],[7849,2],[7850,1,"\u1EAB"],[7851,2],[7852,1,"\u1EAD"],[7853,2],[7854,1,"\u1EAF"],[7855,2],[7856,1,"\u1EB1"],[7857,2],[7858,1,"\u1EB3"],[7859,2],[7860,1,"\u1EB5"],[7861,2],[7862,1,"\u1EB7"],[7863,2],[7864,1,"\u1EB9"],[7865,2],[7866,1,"\u1EBB"],[7867,2],[7868,1,"\u1EBD"],[7869,2],[7870,1,"\u1EBF"],[7871,2],[7872,1,"\u1EC1"],[7873,2],[7874,1,"\u1EC3"],[7875,2],[7876,1,"\u1EC5"],[7877,2],[7878,1,"\u1EC7"],[7879,2],[7880,1,"\u1EC9"],[7881,2],[7882,1,"\u1ECB"],[7883,2],[7884,1,"\u1ECD"],[7885,2],[7886,1,"\u1ECF"],[7887,2],[7888,1,"\u1ED1"],[7889,2],[7890,1,"\u1ED3"],[7891,2],[7892,1,"\u1ED5"],[7893,2],[7894,1,"\u1ED7"],[7895,2],[7896,1,"\u1ED9"],[7897,2],[7898,1,"\u1EDB"],[7899,2],[7900,1,"\u1EDD"],[7901,2],[7902,1,"\u1EDF"],[7903,2],[7904,1,"\u1EE1"],[7905,2],[7906,1,"\u1EE3"],[7907,2],[7908,1,"\u1EE5"],[7909,2],[7910,1,"\u1EE7"],[7911,2],[7912,1,"\u1EE9"],[7913,2],[7914,1,"\u1EEB"],[7915,2],[7916,1,"\u1EED"],[7917,2],[7918,1,"\u1EEF"],[7919,2],[7920,1,"\u1EF1"],[7921,2],[7922,1,"\u1EF3"],[7923,2],[7924,1,"\u1EF5"],[7925,2],[7926,1,"\u1EF7"],[7927,2],[7928,1,"\u1EF9"],[7929,2],[7930,1,"\u1EFB"],[7931,2],[7932,1,"\u1EFD"],[7933,2],[7934,1,"\u1EFF"],[7935,2],[[7936,7943],2],[7944,1,"\u1F00"],[7945,1,"\u1F01"],[7946,1,"\u1F02"],[7947,1,"\u1F03"],[7948,1,"\u1F04"],[7949,1,"\u1F05"],[7950,1,"\u1F06"],[7951,1,"\u1F07"],[[7952,7957],2],[[7958,7959],3],[7960,1,"\u1F10"],[7961,1,"\u1F11"],[7962,1,"\u1F12"],[7963,1,"\u1F13"],[7964,1,"\u1F14"],[7965,1,"\u1F15"],[[7966,7967],3],[[7968,7975],2],[7976,1,"\u1F20"],[7977,1,"\u1F21"],[7978,1,"\u1F22"],[7979,1,"\u1F23"],[7980,1,"\u1F24"],[7981,1,"\u1F25"],[7982,1,"\u1F26"],[7983,1,"\u1F27"],[[7984,7991],2],[7992,1,"\u1F30"],[7993,1,"\u1F31"],[7994,1,"\u1F32"],[7995,1,"\u1F33"],[7996,1,"\u1F34"],[7997,1,"\u1F35"],[7998,1,"\u1F36"],[7999,1,"\u1F37"],[[8000,8005],2],[[8006,8007],3],[8008,1,"\u1F40"],[8009,1,"\u1F41"],[8010,1,"\u1F42"],[8011,1,"\u1F43"],[8012,1,"\u1F44"],[8013,1,"\u1F45"],[[8014,8015],3],[[8016,8023],2],[8024,3],[8025,1,"\u1F51"],[8026,3],[8027,1,"\u1F53"],[8028,3],[8029,1,"\u1F55"],[8030,3],[8031,1,"\u1F57"],[[8032,8039],2],[8040,1,"\u1F60"],[8041,1,"\u1F61"],[8042,1,"\u1F62"],[8043,1,"\u1F63"],[8044,1,"\u1F64"],[8045,1,"\u1F65"],[8046,1,"\u1F66"],[8047,1,"\u1F67"],[8048,2],[8049,1,"\u03AC"],[8050,2],[8051,1,"\u03AD"],[8052,2],[8053,1,"\u03AE"],[8054,2],[8055,1,"\u03AF"],[8056,2],[8057,1,"\u03CC"],[8058,2],[8059,1,"\u03CD"],[8060,2],[8061,1,"\u03CE"],[[8062,8063],3],[8064,1,"\u1F00\u03B9"],[8065,1,"\u1F01\u03B9"],[8066,1,"\u1F02\u03B9"],[8067,1,"\u1F03\u03B9"],[8068,1,"\u1F04\u03B9"],[8069,1,"\u1F05\u03B9"],[8070,1,"\u1F06\u03B9"],[8071,1,"\u1F07\u03B9"],[8072,1,"\u1F00\u03B9"],[8073,1,"\u1F01\u03B9"],[8074,1,"\u1F02\u03B9"],[8075,1,"\u1F03\u03B9"],[8076,1,"\u1F04\u03B9"],[8077,1,"\u1F05\u03B9"],[8078,1,"\u1F06\u03B9"],[8079,1,"\u1F07\u03B9"],[8080,1,"\u1F20\u03B9"],[8081,1,"\u1F21\u03B9"],[8082,1,"\u1F22\u03B9"],[8083,1,"\u1F23\u03B9"],[8084,1,"\u1F24\u03B9"],[8085,1,"\u1F25\u03B9"],[8086,1,"\u1F26\u03B9"],[8087,1,"\u1F27\u03B9"],[8088,1,"\u1F20\u03B9"],[8089,1,"\u1F21\u03B9"],[8090,1,"\u1F22\u03B9"],[8091,1,"\u1F23\u03B9"],[8092,1,"\u1F24\u03B9"],[8093,1,"\u1F25\u03B9"],[8094,1,"\u1F26\u03B9"],[8095,1,"\u1F27\u03B9"],[8096,1,"\u1F60\u03B9"],[8097,1,"\u1F61\u03B9"],[8098,1,"\u1F62\u03B9"],[8099,1,"\u1F63\u03B9"],[8100,1,"\u1F64\u03B9"],[8101,1,"\u1F65\u03B9"],[8102,1,"\u1F66\u03B9"],[8103,1,"\u1F67\u03B9"],[8104,1,"\u1F60\u03B9"],[8105,1,"\u1F61\u03B9"],[8106,1,"\u1F62\u03B9"],[8107,1,"\u1F63\u03B9"],[8108,1,"\u1F64\u03B9"],[8109,1,"\u1F65\u03B9"],[8110,1,"\u1F66\u03B9"],[8111,1,"\u1F67\u03B9"],[[8112,8113],2],[8114,1,"\u1F70\u03B9"],[8115,1,"\u03B1\u03B9"],[8116,1,"\u03AC\u03B9"],[8117,3],[8118,2],[8119,1,"\u1FB6\u03B9"],[8120,1,"\u1FB0"],[8121,1,"\u1FB1"],[8122,1,"\u1F70"],[8123,1,"\u03AC"],[8124,1,"\u03B1\u03B9"],[8125,1," \u0313"],[8126,1,"\u03B9"],[8127,1," \u0313"],[8128,1," \u0342"],[8129,1," \u0308\u0342"],[8130,1,"\u1F74\u03B9"],[8131,1,"\u03B7\u03B9"],[8132,1,"\u03AE\u03B9"],[8133,3],[8134,2],[8135,1,"\u1FC6\u03B9"],[8136,1,"\u1F72"],[8137,1,"\u03AD"],[8138,1,"\u1F74"],[8139,1,"\u03AE"],[8140,1,"\u03B7\u03B9"],[8141,1," \u0313\u0300"],[8142,1," \u0313\u0301"],[8143,1," \u0313\u0342"],[[8144,8146],2],[8147,1,"\u0390"],[[8148,8149],3],[[8150,8151],2],[8152,1,"\u1FD0"],[8153,1,"\u1FD1"],[8154,1,"\u1F76"],[8155,1,"\u03AF"],[8156,3],[8157,1," \u0314\u0300"],[8158,1," \u0314\u0301"],[8159,1," \u0314\u0342"],[[8160,8162],2],[8163,1,"\u03B0"],[[8164,8167],2],[8168,1,"\u1FE0"],[8169,1,"\u1FE1"],[8170,1,"\u1F7A"],[8171,1,"\u03CD"],[8172,1,"\u1FE5"],[8173,1," \u0308\u0300"],[8174,1," \u0308\u0301"],[8175,1,"`"],[[8176,8177],3],[8178,1,"\u1F7C\u03B9"],[8179,1,"\u03C9\u03B9"],[8180,1,"\u03CE\u03B9"],[8181,3],[8182,2],[8183,1,"\u1FF6\u03B9"],[8184,1,"\u1F78"],[8185,1,"\u03CC"],[8186,1,"\u1F7C"],[8187,1,"\u03CE"],[8188,1,"\u03C9\u03B9"],[8189,1," \u0301"],[8190,1," \u0314"],[8191,3],[[8192,8202],1," "],[8203,7],[[8204,8205],6,""],[[8206,8207],3],[8208,2],[8209,1,"\u2010"],[[8210,8214],2],[8215,1," \u0333"],[[8216,8227],2],[[8228,8230],3],[8231,2],[[8232,8238],3],[8239,1," "],[[8240,8242],2],[8243,1,"\u2032\u2032"],[8244,1,"\u2032\u2032\u2032"],[8245,2],[8246,1,"\u2035\u2035"],[8247,1,"\u2035\u2035\u2035"],[[8248,8251],2],[8252,1,"!!"],[8253,2],[8254,1," \u0305"],[[8255,8262],2],[8263,1,"??"],[8264,1,"?!"],[8265,1,"!?"],[[8266,8269],2],[[8270,8274],2],[[8275,8276],2],[[8277,8278],2],[8279,1,"\u2032\u2032\u2032\u2032"],[[8280,8286],2],[8287,1," "],[[8288,8291],7],[8292,7],[8293,3],[[8294,8297],3],[[8298,8303],7],[8304,1,"0"],[8305,1,"i"],[[8306,8307],3],[8308,1,"4"],[8309,1,"5"],[8310,1,"6"],[8311,1,"7"],[8312,1,"8"],[8313,1,"9"],[8314,1,"+"],[8315,1,"\u2212"],[8316,1,"="],[8317,1,"("],[8318,1,")"],[8319,1,"n"],[8320,1,"0"],[8321,1,"1"],[8322,1,"2"],[8323,1,"3"],[8324,1,"4"],[8325,1,"5"],[8326,1,"6"],[8327,1,"7"],[8328,1,"8"],[8329,1,"9"],[8330,1,"+"],[8331,1,"\u2212"],[8332,1,"="],[8333,1,"("],[8334,1,")"],[8335,3],[8336,1,"a"],[8337,1,"e"],[8338,1,"o"],[8339,1,"x"],[8340,1,"\u0259"],[8341,1,"h"],[8342,1,"k"],[8343,1,"l"],[8344,1,"m"],[8345,1,"n"],[8346,1,"p"],[8347,1,"s"],[8348,1,"t"],[[8349,8351],3],[[8352,8359],2],[8360,1,"rs"],[[8361,8362],2],[8363,2],[8364,2],[[8365,8367],2],[[8368,8369],2],[[8370,8373],2],[[8374,8376],2],[8377,2],[8378,2],[[8379,8381],2],[8382,2],[8383,2],[8384,2],[8385,2],[[8386,8399],3],[[8400,8417],2],[[8418,8419],2],[[8420,8426],2],[8427,2],[[8428,8431],2],[8432,2],[[8433,8447],3],[8448,1,"a/c"],[8449,1,"a/s"],[8450,1,"c"],[8451,1,"\xB0c"],[8452,2],[8453,1,"c/o"],[8454,1,"c/u"],[8455,1,"\u025B"],[8456,2],[8457,1,"\xB0f"],[8458,1,"g"],[[8459,8462],1,"h"],[8463,1,"\u0127"],[[8464,8465],1,"i"],[[8466,8467],1,"l"],[8468,2],[8469,1,"n"],[8470,1,"no"],[[8471,8472],2],[8473,1,"p"],[8474,1,"q"],[[8475,8477],1,"r"],[[8478,8479],2],[8480,1,"sm"],[8481,1,"tel"],[8482,1,"tm"],[8483,2],[8484,1,"z"],[8485,2],[8486,1,"\u03C9"],[8487,2],[8488,1,"z"],[8489,2],[8490,1,"k"],[8491,1,"\xE5"],[8492,1,"b"],[8493,1,"c"],[8494,2],[[8495,8496],1,"e"],[8497,1,"f"],[8498,1,"\u214E"],[8499,1,"m"],[8500,1,"o"],[8501,1,"\u05D0"],[8502,1,"\u05D1"],[8503,1,"\u05D2"],[8504,1,"\u05D3"],[8505,1,"i"],[8506,2],[8507,1,"fax"],[8508,1,"\u03C0"],[[8509,8510],1,"\u03B3"],[8511,1,"\u03C0"],[8512,1,"\u2211"],[[8513,8516],2],[[8517,8518],1,"d"],[8519,1,"e"],[8520,1,"i"],[8521,1,"j"],[[8522,8523],2],[8524,2],[8525,2],[8526,2],[8527,2],[8528,1,"1\u20447"],[8529,1,"1\u20449"],[8530,1,"1\u204410"],[8531,1,"1\u20443"],[8532,1,"2\u20443"],[8533,1,"1\u20445"],[8534,1,"2\u20445"],[8535,1,"3\u20445"],[8536,1,"4\u20445"],[8537,1,"1\u20446"],[8538,1,"5\u20446"],[8539,1,"1\u20448"],[8540,1,"3\u20448"],[8541,1,"5\u20448"],[8542,1,"7\u20448"],[8543,1,"1\u2044"],[8544,1,"i"],[8545,1,"ii"],[8546,1,"iii"],[8547,1,"iv"],[8548,1,"v"],[8549,1,"vi"],[8550,1,"vii"],[8551,1,"viii"],[8552,1,"ix"],[8553,1,"x"],[8554,1,"xi"],[8555,1,"xii"],[8556,1,"l"],[8557,1,"c"],[8558,1,"d"],[8559,1,"m"],[8560,1,"i"],[8561,1,"ii"],[8562,1,"iii"],[8563,1,"iv"],[8564,1,"v"],[8565,1,"vi"],[8566,1,"vii"],[8567,1,"viii"],[8568,1,"ix"],[8569,1,"x"],[8570,1,"xi"],[8571,1,"xii"],[8572,1,"l"],[8573,1,"c"],[8574,1,"d"],[8575,1,"m"],[[8576,8578],2],[8579,1,"\u2184"],[8580,2],[[8581,8584],2],[8585,1,"0\u20443"],[[8586,8587],2],[[8588,8591],3],[[8592,8682],2],[[8683,8691],2],[[8692,8703],2],[[8704,8747],2],[8748,1,"\u222B\u222B"],[8749,1,"\u222B\u222B\u222B"],[8750,2],[8751,1,"\u222E\u222E"],[8752,1,"\u222E\u222E\u222E"],[[8753,8945],2],[[8946,8959],2],[8960,2],[8961,2],[[8962,9000],2],[9001,1,"\u3008"],[9002,1,"\u3009"],[[9003,9082],2],[9083,2],[9084,2],[[9085,9114],2],[[9115,9166],2],[[9167,9168],2],[[9169,9179],2],[[9180,9191],2],[9192,2],[[9193,9203],2],[[9204,9210],2],[[9211,9214],2],[9215,2],[[9216,9252],2],[[9253,9254],2],[[9255,9257],2],[[9258,9279],3],[[9280,9290],2],[[9291,9311],3],[9312,1,"1"],[9313,1,"2"],[9314,1,"3"],[9315,1,"4"],[9316,1,"5"],[9317,1,"6"],[9318,1,"7"],[9319,1,"8"],[9320,1,"9"],[9321,1,"10"],[9322,1,"11"],[9323,1,"12"],[9324,1,"13"],[9325,1,"14"],[9326,1,"15"],[9327,1,"16"],[9328,1,"17"],[9329,1,"18"],[9330,1,"19"],[9331,1,"20"],[9332,1,"(1)"],[9333,1,"(2)"],[9334,1,"(3)"],[9335,1,"(4)"],[9336,1,"(5)"],[9337,1,"(6)"],[9338,1,"(7)"],[9339,1,"(8)"],[9340,1,"(9)"],[9341,1,"(10)"],[9342,1,"(11)"],[9343,1,"(12)"],[9344,1,"(13)"],[9345,1,"(14)"],[9346,1,"(15)"],[9347,1,"(16)"],[9348,1,"(17)"],[9349,1,"(18)"],[9350,1,"(19)"],[9351,1,"(20)"],[[9352,9371],3],[9372,1,"(a)"],[9373,1,"(b)"],[9374,1,"(c)"],[9375,1,"(d)"],[9376,1,"(e)"],[9377,1,"(f)"],[9378,1,"(g)"],[9379,1,"(h)"],[9380,1,"(i)"],[9381,1,"(j)"],[9382,1,"(k)"],[9383,1,"(l)"],[9384,1,"(m)"],[9385,1,"(n)"],[9386,1,"(o)"],[9387,1,"(p)"],[9388,1,"(q)"],[9389,1,"(r)"],[9390,1,"(s)"],[9391,1,"(t)"],[9392,1,"(u)"],[9393,1,"(v)"],[9394,1,"(w)"],[9395,1,"(x)"],[9396,1,"(y)"],[9397,1,"(z)"],[9398,1,"a"],[9399,1,"b"],[9400,1,"c"],[9401,1,"d"],[9402,1,"e"],[9403,1,"f"],[9404,1,"g"],[9405,1,"h"],[9406,1,"i"],[9407,1,"j"],[9408,1,"k"],[9409,1,"l"],[9410,1,"m"],[9411,1,"n"],[9412,1,"o"],[9413,1,"p"],[9414,1,"q"],[9415,1,"r"],[9416,1,"s"],[9417,1,"t"],[9418,1,"u"],[9419,1,"v"],[9420,1,"w"],[9421,1,"x"],[9422,1,"y"],[9423,1,"z"],[9424,1,"a"],[9425,1,"b"],[9426,1,"c"],[9427,1,"d"],[9428,1,"e"],[9429,1,"f"],[9430,1,"g"],[9431,1,"h"],[9432,1,"i"],[9433,1,"j"],[9434,1,"k"],[9435,1,"l"],[9436,1,"m"],[9437,1,"n"],[9438,1,"o"],[9439,1,"p"],[9440,1,"q"],[9441,1,"r"],[9442,1,"s"],[9443,1,"t"],[9444,1,"u"],[9445,1,"v"],[9446,1,"w"],[9447,1,"x"],[9448,1,"y"],[9449,1,"z"],[9450,1,"0"],[[9451,9470],2],[9471,2],[[9472,9621],2],[[9622,9631],2],[[9632,9711],2],[[9712,9719],2],[[9720,9727],2],[[9728,9747],2],[[9748,9749],2],[[9750,9751],2],[9752,2],[9753,2],[[9754,9839],2],[[9840,9841],2],[[9842,9853],2],[[9854,9855],2],[[9856,9865],2],[[9866,9873],2],[[9874,9884],2],[9885,2],[[9886,9887],2],[[9888,9889],2],[[9890,9905],2],[9906,2],[[9907,9916],2],[[9917,9919],2],[[9920,9923],2],[[9924,9933],2],[9934,2],[[9935,9953],2],[9954,2],[9955,2],[[9956,9959],2],[[9960,9983],2],[9984,2],[[9985,9988],2],[9989,2],[[9990,9993],2],[[9994,9995],2],[[9996,10023],2],[10024,2],[[10025,10059],2],[10060,2],[10061,2],[10062,2],[[10063,10066],2],[[10067,10069],2],[10070,2],[10071,2],[[10072,10078],2],[[10079,10080],2],[[10081,10087],2],[[10088,10101],2],[[10102,10132],2],[[10133,10135],2],[[10136,10159],2],[10160,2],[[10161,10174],2],[10175,2],[[10176,10182],2],[[10183,10186],2],[10187,2],[10188,2],[10189,2],[[10190,10191],2],[[10192,10219],2],[[10220,10223],2],[[10224,10239],2],[[10240,10495],2],[[10496,10763],2],[10764,1,"\u222B\u222B\u222B\u222B"],[[10765,10867],2],[10868,1,"::="],[10869,1,"=="],[10870,1,"==="],[[10871,10971],2],[10972,1,"\u2ADD\u0338"],[[10973,11007],2],[[11008,11021],2],[[11022,11027],2],[[11028,11034],2],[[11035,11039],2],[[11040,11043],2],[[11044,11084],2],[[11085,11087],2],[[11088,11092],2],[[11093,11097],2],[[11098,11123],2],[[11124,11125],3],[[11126,11157],2],[11158,2],[11159,2],[[11160,11193],2],[[11194,11196],2],[[11197,11208],2],[11209,2],[[11210,11217],2],[11218,2],[[11219,11243],2],[[11244,11247],2],[[11248,11262],2],[11263,2],[11264,1,"\u2C30"],[11265,1,"\u2C31"],[11266,1,"\u2C32"],[11267,1,"\u2C33"],[11268,1,"\u2C34"],[11269,1,"\u2C35"],[11270,1,"\u2C36"],[11271,1,"\u2C37"],[11272,1,"\u2C38"],[11273,1,"\u2C39"],[11274,1,"\u2C3A"],[11275,1,"\u2C3B"],[11276,1,"\u2C3C"],[11277,1,"\u2C3D"],[11278,1,"\u2C3E"],[11279,1,"\u2C3F"],[11280,1,"\u2C40"],[11281,1,"\u2C41"],[11282,1,"\u2C42"],[11283,1,"\u2C43"],[11284,1,"\u2C44"],[11285,1,"\u2C45"],[11286,1,"\u2C46"],[11287,1,"\u2C47"],[11288,1,"\u2C48"],[11289,1,"\u2C49"],[11290,1,"\u2C4A"],[11291,1,"\u2C4B"],[11292,1,"\u2C4C"],[11293,1,"\u2C4D"],[11294,1,"\u2C4E"],[11295,1,"\u2C4F"],[11296,1,"\u2C50"],[11297,1,"\u2C51"],[11298,1,"\u2C52"],[11299,1,"\u2C53"],[11300,1,"\u2C54"],[11301,1,"\u2C55"],[11302,1,"\u2C56"],[11303,1,"\u2C57"],[11304,1,"\u2C58"],[11305,1,"\u2C59"],[11306,1,"\u2C5A"],[11307,1,"\u2C5B"],[11308,1,"\u2C5C"],[11309,1,"\u2C5D"],[11310,1,"\u2C5E"],[11311,1,"\u2C5F"],[[11312,11358],2],[11359,2],[11360,1,"\u2C61"],[11361,2],[11362,1,"\u026B"],[11363,1,"\u1D7D"],[11364,1,"\u027D"],[[11365,11366],2],[11367,1,"\u2C68"],[11368,2],[11369,1,"\u2C6A"],[11370,2],[11371,1,"\u2C6C"],[11372,2],[11373,1,"\u0251"],[11374,1,"\u0271"],[11375,1,"\u0250"],[11376,1,"\u0252"],[11377,2],[11378,1,"\u2C73"],[11379,2],[11380,2],[11381,1,"\u2C76"],[[11382,11383],2],[[11384,11387],2],[11388,1,"j"],[11389,1,"v"],[11390,1,"\u023F"],[11391,1,"\u0240"],[11392,1,"\u2C81"],[11393,2],[11394,1,"\u2C83"],[11395,2],[11396,1,"\u2C85"],[11397,2],[11398,1,"\u2C87"],[11399,2],[11400,1,"\u2C89"],[11401,2],[11402,1,"\u2C8B"],[11403,2],[11404,1,"\u2C8D"],[11405,2],[11406,1,"\u2C8F"],[11407,2],[11408,1,"\u2C91"],[11409,2],[11410,1,"\u2C93"],[11411,2],[11412,1,"\u2C95"],[11413,2],[11414,1,"\u2C97"],[11415,2],[11416,1,"\u2C99"],[11417,2],[11418,1,"\u2C9B"],[11419,2],[11420,1,"\u2C9D"],[11421,2],[11422,1,"\u2C9F"],[11423,2],[11424,1,"\u2CA1"],[11425,2],[11426,1,"\u2CA3"],[11427,2],[11428,1,"\u2CA5"],[11429,2],[11430,1,"\u2CA7"],[11431,2],[11432,1,"\u2CA9"],[11433,2],[11434,1,"\u2CAB"],[11435,2],[11436,1,"\u2CAD"],[11437,2],[11438,1,"\u2CAF"],[11439,2],[11440,1,"\u2CB1"],[11441,2],[11442,1,"\u2CB3"],[11443,2],[11444,1,"\u2CB5"],[11445,2],[11446,1,"\u2CB7"],[11447,2],[11448,1,"\u2CB9"],[11449,2],[11450,1,"\u2CBB"],[11451,2],[11452,1,"\u2CBD"],[11453,2],[11454,1,"\u2CBF"],[11455,2],[11456,1,"\u2CC1"],[11457,2],[11458,1,"\u2CC3"],[11459,2],[11460,1,"\u2CC5"],[11461,2],[11462,1,"\u2CC7"],[11463,2],[11464,1,"\u2CC9"],[11465,2],[11466,1,"\u2CCB"],[11467,2],[11468,1,"\u2CCD"],[11469,2],[11470,1,"\u2CCF"],[11471,2],[11472,1,"\u2CD1"],[11473,2],[11474,1,"\u2CD3"],[11475,2],[11476,1,"\u2CD5"],[11477,2],[11478,1,"\u2CD7"],[11479,2],[11480,1,"\u2CD9"],[11481,2],[11482,1,"\u2CDB"],[11483,2],[11484,1,"\u2CDD"],[11485,2],[11486,1,"\u2CDF"],[11487,2],[11488,1,"\u2CE1"],[11489,2],[11490,1,"\u2CE3"],[[11491,11492],2],[[11493,11498],2],[11499,1,"\u2CEC"],[11500,2],[11501,1,"\u2CEE"],[[11502,11505],2],[11506,1,"\u2CF3"],[11507,2],[[11508,11512],3],[[11513,11519],2],[[11520,11557],2],[11558,3],[11559,2],[[11560,11564],3],[11565,2],[[11566,11567],3],[[11568,11621],2],[[11622,11623],2],[[11624,11630],3],[11631,1,"\u2D61"],[11632,2],[[11633,11646],3],[11647,2],[[11648,11670],2],[[11671,11679],3],[[11680,11686],2],[11687,3],[[11688,11694],2],[11695,3],[[11696,11702],2],[11703,3],[[11704,11710],2],[11711,3],[[11712,11718],2],[11719,3],[[11720,11726],2],[11727,3],[[11728,11734],2],[11735,3],[[11736,11742],2],[11743,3],[[11744,11775],2],[[11776,11799],2],[[11800,11803],2],[[11804,11805],2],[[11806,11822],2],[11823,2],[11824,2],[11825,2],[[11826,11835],2],[[11836,11842],2],[[11843,11844],2],[[11845,11849],2],[[11850,11854],2],[11855,2],[[11856,11858],2],[[11859,11869],2],[[11870,11903],3],[[11904,11929],2],[11930,3],[[11931,11934],2],[11935,1,"\u6BCD"],[[11936,12018],2],[12019,1,"\u9F9F"],[[12020,12031],3],[12032,1,"\u4E00"],[12033,1,"\u4E28"],[12034,1,"\u4E36"],[12035,1,"\u4E3F"],[12036,1,"\u4E59"],[12037,1,"\u4E85"],[12038,1,"\u4E8C"],[12039,1,"\u4EA0"],[12040,1,"\u4EBA"],[12041,1,"\u513F"],[12042,1,"\u5165"],[12043,1,"\u516B"],[12044,1,"\u5182"],[12045,1,"\u5196"],[12046,1,"\u51AB"],[12047,1,"\u51E0"],[12048,1,"\u51F5"],[12049,1,"\u5200"],[12050,1,"\u529B"],[12051,1,"\u52F9"],[12052,1,"\u5315"],[12053,1,"\u531A"],[12054,1,"\u5338"],[12055,1,"\u5341"],[12056,1,"\u535C"],[12057,1,"\u5369"],[12058,1,"\u5382"],[12059,1,"\u53B6"],[12060,1,"\u53C8"],[12061,1,"\u53E3"],[12062,1,"\u56D7"],[12063,1,"\u571F"],[12064,1,"\u58EB"],[12065,1,"\u5902"],[12066,1,"\u590A"],[12067,1,"\u5915"],[12068,1,"\u5927"],[12069,1,"\u5973"],[12070,1,"\u5B50"],[12071,1,"\u5B80"],[12072,1,"\u5BF8"],[12073,1,"\u5C0F"],[12074,1,"\u5C22"],[12075,1,"\u5C38"],[12076,1,"\u5C6E"],[12077,1,"\u5C71"],[12078,1,"\u5DDB"],[12079,1,"\u5DE5"],[12080,1,"\u5DF1"],[12081,1,"\u5DFE"],[12082,1,"\u5E72"],[12083,1,"\u5E7A"],[12084,1,"\u5E7F"],[12085,1,"\u5EF4"],[12086,1,"\u5EFE"],[12087,1,"\u5F0B"],[12088,1,"\u5F13"],[12089,1,"\u5F50"],[12090,1,"\u5F61"],[12091,1,"\u5F73"],[12092,1,"\u5FC3"],[12093,1,"\u6208"],[12094,1,"\u6236"],[12095,1,"\u624B"],[12096,1,"\u652F"],[12097,1,"\u6534"],[12098,1,"\u6587"],[12099,1,"\u6597"],[12100,1,"\u65A4"],[12101,1,"\u65B9"],[12102,1,"\u65E0"],[12103,1,"\u65E5"],[12104,1,"\u66F0"],[12105,1,"\u6708"],[12106,1,"\u6728"],[12107,1,"\u6B20"],[12108,1,"\u6B62"],[12109,1,"\u6B79"],[12110,1,"\u6BB3"],[12111,1,"\u6BCB"],[12112,1,"\u6BD4"],[12113,1,"\u6BDB"],[12114,1,"\u6C0F"],[12115,1,"\u6C14"],[12116,1,"\u6C34"],[12117,1,"\u706B"],[12118,1,"\u722A"],[12119,1,"\u7236"],[12120,1,"\u723B"],[12121,1,"\u723F"],[12122,1,"\u7247"],[12123,1,"\u7259"],[12124,1,"\u725B"],[12125,1,"\u72AC"],[12126,1,"\u7384"],[12127,1,"\u7389"],[12128,1,"\u74DC"],[12129,1,"\u74E6"],[12130,1,"\u7518"],[12131,1,"\u751F"],[12132,1,"\u7528"],[12133,1,"\u7530"],[12134,1,"\u758B"],[12135,1,"\u7592"],[12136,1,"\u7676"],[12137,1,"\u767D"],[12138,1,"\u76AE"],[12139,1,"\u76BF"],[12140,1,"\u76EE"],[12141,1,"\u77DB"],[12142,1,"\u77E2"],[12143,1,"\u77F3"],[12144,1,"\u793A"],[12145,1,"\u79B8"],[12146,1,"\u79BE"],[12147,1,"\u7A74"],[12148,1,"\u7ACB"],[12149,1,"\u7AF9"],[12150,1,"\u7C73"],[12151,1,"\u7CF8"],[12152,1,"\u7F36"],[12153,1,"\u7F51"],[12154,1,"\u7F8A"],[12155,1,"\u7FBD"],[12156,1,"\u8001"],[12157,1,"\u800C"],[12158,1,"\u8012"],[12159,1,"\u8033"],[12160,1,"\u807F"],[12161,1,"\u8089"],[12162,1,"\u81E3"],[12163,1,"\u81EA"],[12164,1,"\u81F3"],[12165,1,"\u81FC"],[12166,1,"\u820C"],[12167,1,"\u821B"],[12168,1,"\u821F"],[12169,1,"\u826E"],[12170,1,"\u8272"],[12171,1,"\u8278"],[12172,1,"\u864D"],[12173,1,"\u866B"],[12174,1,"\u8840"],[12175,1,"\u884C"],[12176,1,"\u8863"],[12177,1,"\u897E"],[12178,1,"\u898B"],[12179,1,"\u89D2"],[12180,1,"\u8A00"],[12181,1,"\u8C37"],[12182,1,"\u8C46"],[12183,1,"\u8C55"],[12184,1,"\u8C78"],[12185,1,"\u8C9D"],[12186,1,"\u8D64"],[12187,1,"\u8D70"],[12188,1,"\u8DB3"],[12189,1,"\u8EAB"],[12190,1,"\u8ECA"],[12191,1,"\u8F9B"],[12192,1,"\u8FB0"],[12193,1,"\u8FB5"],[12194,1,"\u9091"],[12195,1,"\u9149"],[12196,1,"\u91C6"],[12197,1,"\u91CC"],[12198,1,"\u91D1"],[12199,1,"\u9577"],[12200,1,"\u9580"],[12201,1,"\u961C"],[12202,1,"\u96B6"],[12203,1,"\u96B9"],[12204,1,"\u96E8"],[12205,1,"\u9751"],[12206,1,"\u975E"],[12207,1,"\u9762"],[12208,1,"\u9769"],[12209,1,"\u97CB"],[12210,1,"\u97ED"],[12211,1,"\u97F3"],[12212,1,"\u9801"],[12213,1,"\u98A8"],[12214,1,"\u98DB"],[12215,1,"\u98DF"],[12216,1,"\u9996"],[12217,1,"\u9999"],[12218,1,"\u99AC"],[12219,1,"\u9AA8"],[12220,1,"\u9AD8"],[12221,1,"\u9ADF"],[12222,1,"\u9B25"],[12223,1,"\u9B2F"],[12224,1,"\u9B32"],[12225,1,"\u9B3C"],[12226,1,"\u9B5A"],[12227,1,"\u9CE5"],[12228,1,"\u9E75"],[12229,1,"\u9E7F"],[12230,1,"\u9EA5"],[12231,1,"\u9EBB"],[12232,1,"\u9EC3"],[12233,1,"\u9ECD"],[12234,1,"\u9ED1"],[12235,1,"\u9EF9"],[12236,1,"\u9EFD"],[12237,1,"\u9F0E"],[12238,1,"\u9F13"],[12239,1,"\u9F20"],[12240,1,"\u9F3B"],[12241,1,"\u9F4A"],[12242,1,"\u9F52"],[12243,1,"\u9F8D"],[12244,1,"\u9F9C"],[12245,1,"\u9FA0"],[[12246,12271],3],[[12272,12283],3],[[12284,12287],3],[12288,1," "],[12289,2],[12290,1,"."],[[12291,12292],2],[[12293,12295],2],[[12296,12329],2],[[12330,12333],2],[[12334,12341],2],[12342,1,"\u3012"],[12343,2],[12344,1,"\u5341"],[12345,1,"\u5344"],[12346,1,"\u5345"],[12347,2],[12348,2],[12349,2],[12350,2],[12351,2],[12352,3],[[12353,12436],2],[[12437,12438],2],[[12439,12440],3],[[12441,12442],2],[12443,1," \u3099"],[12444,1," \u309A"],[[12445,12446],2],[12447,1,"\u3088\u308A"],[12448,2],[[12449,12542],2],[12543,1,"\u30B3\u30C8"],[[12544,12548],3],[[12549,12588],2],[12589,2],[12590,2],[12591,2],[12592,3],[12593,1,"\u1100"],[12594,1,"\u1101"],[12595,1,"\u11AA"],[12596,1,"\u1102"],[12597,1,"\u11AC"],[12598,1,"\u11AD"],[12599,1,"\u1103"],[12600,1,"\u1104"],[12601,1,"\u1105"],[12602,1,"\u11B0"],[12603,1,"\u11B1"],[12604,1,"\u11B2"],[12605,1,"\u11B3"],[12606,1,"\u11B4"],[12607,1,"\u11B5"],[12608,1,"\u111A"],[12609,1,"\u1106"],[12610,1,"\u1107"],[12611,1,"\u1108"],[12612,1,"\u1121"],[12613,1,"\u1109"],[12614,1,"\u110A"],[12615,1,"\u110B"],[12616,1,"\u110C"],[12617,1,"\u110D"],[12618,1,"\u110E"],[12619,1,"\u110F"],[12620,1,"\u1110"],[12621,1,"\u1111"],[12622,1,"\u1112"],[12623,1,"\u1161"],[12624,1,"\u1162"],[12625,1,"\u1163"],[12626,1,"\u1164"],[12627,1,"\u1165"],[12628,1,"\u1166"],[12629,1,"\u1167"],[12630,1,"\u1168"],[12631,1,"\u1169"],[12632,1,"\u116A"],[12633,1,"\u116B"],[12634,1,"\u116C"],[12635,1,"\u116D"],[12636,1,"\u116E"],[12637,1,"\u116F"],[12638,1,"\u1170"],[12639,1,"\u1171"],[12640,1,"\u1172"],[12641,1,"\u1173"],[12642,1,"\u1174"],[12643,1,"\u1175"],[12644,7],[12645,1,"\u1114"],[12646,1,"\u1115"],[12647,1,"\u11C7"],[12648,1,"\u11C8"],[12649,1,"\u11CC"],[12650,1,"\u11CE"],[12651,1,"\u11D3"],[12652,1,"\u11D7"],[12653,1,"\u11D9"],[12654,1,"\u111C"],[12655,1,"\u11DD"],[12656,1,"\u11DF"],[12657,1,"\u111D"],[12658,1,"\u111E"],[12659,1,"\u1120"],[12660,1,"\u1122"],[12661,1,"\u1123"],[12662,1,"\u1127"],[12663,1,"\u1129"],[12664,1,"\u112B"],[12665,1,"\u112C"],[12666,1,"\u112D"],[12667,1,"\u112E"],[12668,1,"\u112F"],[12669,1,"\u1132"],[12670,1,"\u1136"],[12671,1,"\u1140"],[12672,1,"\u1147"],[12673,1,"\u114C"],[12674,1,"\u11F1"],[12675,1,"\u11F2"],[12676,1,"\u1157"],[12677,1,"\u1158"],[12678,1,"\u1159"],[12679,1,"\u1184"],[12680,1,"\u1185"],[12681,1,"\u1188"],[12682,1,"\u1191"],[12683,1,"\u1192"],[12684,1,"\u1194"],[12685,1,"\u119E"],[12686,1,"\u11A1"],[12687,3],[[12688,12689],2],[12690,1,"\u4E00"],[12691,1,"\u4E8C"],[12692,1,"\u4E09"],[12693,1,"\u56DB"],[12694,1,"\u4E0A"],[12695,1,"\u4E2D"],[12696,1,"\u4E0B"],[12697,1,"\u7532"],[12698,1,"\u4E59"],[12699,1,"\u4E19"],[12700,1,"\u4E01"],[12701,1,"\u5929"],[12702,1,"\u5730"],[12703,1,"\u4EBA"],[[12704,12727],2],[[12728,12730],2],[[12731,12735],2],[[12736,12751],2],[[12752,12771],2],[[12772,12773],2],[[12774,12782],3],[12783,3],[[12784,12799],2],[12800,1,"(\u1100)"],[12801,1,"(\u1102)"],[12802,1,"(\u1103)"],[12803,1,"(\u1105)"],[12804,1,"(\u1106)"],[12805,1,"(\u1107)"],[12806,1,"(\u1109)"],[12807,1,"(\u110B)"],[12808,1,"(\u110C)"],[12809,1,"(\u110E)"],[12810,1,"(\u110F)"],[12811,1,"(\u1110)"],[12812,1,"(\u1111)"],[12813,1,"(\u1112)"],[12814,1,"(\uAC00)"],[12815,1,"(\uB098)"],[12816,1,"(\uB2E4)"],[12817,1,"(\uB77C)"],[12818,1,"(\uB9C8)"],[12819,1,"(\uBC14)"],[12820,1,"(\uC0AC)"],[12821,1,"(\uC544)"],[12822,1,"(\uC790)"],[12823,1,"(\uCC28)"],[12824,1,"(\uCE74)"],[12825,1,"(\uD0C0)"],[12826,1,"(\uD30C)"],[12827,1,"(\uD558)"],[12828,1,"(\uC8FC)"],[12829,1,"(\uC624\uC804)"],[12830,1,"(\uC624\uD6C4)"],[12831,3],[12832,1,"(\u4E00)"],[12833,1,"(\u4E8C)"],[12834,1,"(\u4E09)"],[12835,1,"(\u56DB)"],[12836,1,"(\u4E94)"],[12837,1,"(\u516D)"],[12838,1,"(\u4E03)"],[12839,1,"(\u516B)"],[12840,1,"(\u4E5D)"],[12841,1,"(\u5341)"],[12842,1,"(\u6708)"],[12843,1,"(\u706B)"],[12844,1,"(\u6C34)"],[12845,1,"(\u6728)"],[12846,1,"(\u91D1)"],[12847,1,"(\u571F)"],[12848,1,"(\u65E5)"],[12849,1,"(\u682A)"],[12850,1,"(\u6709)"],[12851,1,"(\u793E)"],[12852,1,"(\u540D)"],[12853,1,"(\u7279)"],[12854,1,"(\u8CA1)"],[12855,1,"(\u795D)"],[12856,1,"(\u52B4)"],[12857,1,"(\u4EE3)"],[12858,1,"(\u547C)"],[12859,1,"(\u5B66)"],[12860,1,"(\u76E3)"],[12861,1,"(\u4F01)"],[12862,1,"(\u8CC7)"],[12863,1,"(\u5354)"],[12864,1,"(\u796D)"],[12865,1,"(\u4F11)"],[12866,1,"(\u81EA)"],[12867,1,"(\u81F3)"],[12868,1,"\u554F"],[12869,1,"\u5E7C"],[12870,1,"\u6587"],[12871,1,"\u7B8F"],[[12872,12879],2],[12880,1,"pte"],[12881,1,"21"],[12882,1,"22"],[12883,1,"23"],[12884,1,"24"],[12885,1,"25"],[12886,1,"26"],[12887,1,"27"],[12888,1,"28"],[12889,1,"29"],[12890,1,"30"],[12891,1,"31"],[12892,1,"32"],[12893,1,"33"],[12894,1,"34"],[12895,1,"35"],[12896,1,"\u1100"],[12897,1,"\u1102"],[12898,1,"\u1103"],[12899,1,"\u1105"],[12900,1,"\u1106"],[12901,1,"\u1107"],[12902,1,"\u1109"],[12903,1,"\u110B"],[12904,1,"\u110C"],[12905,1,"\u110E"],[12906,1,"\u110F"],[12907,1,"\u1110"],[12908,1,"\u1111"],[12909,1,"\u1112"],[12910,1,"\uAC00"],[12911,1,"\uB098"],[12912,1,"\uB2E4"],[12913,1,"\uB77C"],[12914,1,"\uB9C8"],[12915,1,"\uBC14"],[12916,1,"\uC0AC"],[12917,1,"\uC544"],[12918,1,"\uC790"],[12919,1,"\uCC28"],[12920,1,"\uCE74"],[12921,1,"\uD0C0"],[12922,1,"\uD30C"],[12923,1,"\uD558"],[12924,1,"\uCC38\uACE0"],[12925,1,"\uC8FC\uC758"],[12926,1,"\uC6B0"],[12927,2],[12928,1,"\u4E00"],[12929,1,"\u4E8C"],[12930,1,"\u4E09"],[12931,1,"\u56DB"],[12932,1,"\u4E94"],[12933,1,"\u516D"],[12934,1,"\u4E03"],[12935,1,"\u516B"],[12936,1,"\u4E5D"],[12937,1,"\u5341"],[12938,1,"\u6708"],[12939,1,"\u706B"],[12940,1,"\u6C34"],[12941,1,"\u6728"],[12942,1,"\u91D1"],[12943,1,"\u571F"],[12944,1,"\u65E5"],[12945,1,"\u682A"],[12946,1,"\u6709"],[12947,1,"\u793E"],[12948,1,"\u540D"],[12949,1,"\u7279"],[12950,1,"\u8CA1"],[12951,1,"\u795D"],[12952,1,"\u52B4"],[12953,1,"\u79D8"],[12954,1,"\u7537"],[12955,1,"\u5973"],[12956,1,"\u9069"],[12957,1,"\u512A"],[12958,1,"\u5370"],[12959,1,"\u6CE8"],[12960,1,"\u9805"],[12961,1,"\u4F11"],[12962,1,"\u5199"],[12963,1,"\u6B63"],[12964,1,"\u4E0A"],[12965,1,"\u4E2D"],[12966,1,"\u4E0B"],[12967,1,"\u5DE6"],[12968,1,"\u53F3"],[12969,1,"\u533B"],[12970,1,"\u5B97"],[12971,1,"\u5B66"],[12972,1,"\u76E3"],[12973,1,"\u4F01"],[12974,1,"\u8CC7"],[12975,1,"\u5354"],[12976,1,"\u591C"],[12977,1,"36"],[12978,1,"37"],[12979,1,"38"],[12980,1,"39"],[12981,1,"40"],[12982,1,"41"],[12983,1,"42"],[12984,1,"43"],[12985,1,"44"],[12986,1,"45"],[12987,1,"46"],[12988,1,"47"],[12989,1,"48"],[12990,1,"49"],[12991,1,"50"],[12992,1,"1\u6708"],[12993,1,"2\u6708"],[12994,1,"3\u6708"],[12995,1,"4\u6708"],[12996,1,"5\u6708"],[12997,1,"6\u6708"],[12998,1,"7\u6708"],[12999,1,"8\u6708"],[13000,1,"9\u6708"],[13001,1,"10\u6708"],[13002,1,"11\u6708"],[13003,1,"12\u6708"],[13004,1,"hg"],[13005,1,"erg"],[13006,1,"ev"],[13007,1,"ltd"],[13008,1,"\u30A2"],[13009,1,"\u30A4"],[13010,1,"\u30A6"],[13011,1,"\u30A8"],[13012,1,"\u30AA"],[13013,1,"\u30AB"],[13014,1,"\u30AD"],[13015,1,"\u30AF"],[13016,1,"\u30B1"],[13017,1,"\u30B3"],[13018,1,"\u30B5"],[13019,1,"\u30B7"],[13020,1,"\u30B9"],[13021,1,"\u30BB"],[13022,1,"\u30BD"],[13023,1,"\u30BF"],[13024,1,"\u30C1"],[13025,1,"\u30C4"],[13026,1,"\u30C6"],[13027,1,"\u30C8"],[13028,1,"\u30CA"],[13029,1,"\u30CB"],[13030,1,"\u30CC"],[13031,1,"\u30CD"],[13032,1,"\u30CE"],[13033,1,"\u30CF"],[13034,1,"\u30D2"],[13035,1,"\u30D5"],[13036,1,"\u30D8"],[13037,1,"\u30DB"],[13038,1,"\u30DE"],[13039,1,"\u30DF"],[13040,1,"\u30E0"],[13041,1,"\u30E1"],[13042,1,"\u30E2"],[13043,1,"\u30E4"],[13044,1,"\u30E6"],[13045,1,"\u30E8"],[13046,1,"\u30E9"],[13047,1,"\u30EA"],[13048,1,"\u30EB"],[13049,1,"\u30EC"],[13050,1,"\u30ED"],[13051,1,"\u30EF"],[13052,1,"\u30F0"],[13053,1,"\u30F1"],[13054,1,"\u30F2"],[13055,1,"\u4EE4\u548C"],[13056,1,"\u30A2\u30D1\u30FC\u30C8"],[13057,1,"\u30A2\u30EB\u30D5\u30A1"],[13058,1,"\u30A2\u30F3\u30DA\u30A2"],[13059,1,"\u30A2\u30FC\u30EB"],[13060,1,"\u30A4\u30CB\u30F3\u30B0"],[13061,1,"\u30A4\u30F3\u30C1"],[13062,1,"\u30A6\u30A9\u30F3"],[13063,1,"\u30A8\u30B9\u30AF\u30FC\u30C9"],[13064,1,"\u30A8\u30FC\u30AB\u30FC"],[13065,1,"\u30AA\u30F3\u30B9"],[13066,1,"\u30AA\u30FC\u30E0"],[13067,1,"\u30AB\u30A4\u30EA"],[13068,1,"\u30AB\u30E9\u30C3\u30C8"],[13069,1,"\u30AB\u30ED\u30EA\u30FC"],[13070,1,"\u30AC\u30ED\u30F3"],[13071,1,"\u30AC\u30F3\u30DE"],[13072,1,"\u30AE\u30AC"],[13073,1,"\u30AE\u30CB\u30FC"],[13074,1,"\u30AD\u30E5\u30EA\u30FC"],[13075,1,"\u30AE\u30EB\u30C0\u30FC"],[13076,1,"\u30AD\u30ED"],[13077,1,"\u30AD\u30ED\u30B0\u30E9\u30E0"],[13078,1,"\u30AD\u30ED\u30E1\u30FC\u30C8\u30EB"],[13079,1,"\u30AD\u30ED\u30EF\u30C3\u30C8"],[13080,1,"\u30B0\u30E9\u30E0"],[13081,1,"\u30B0\u30E9\u30E0\u30C8\u30F3"],[13082,1,"\u30AF\u30EB\u30BC\u30A4\u30ED"],[13083,1,"\u30AF\u30ED\u30FC\u30CD"],[13084,1,"\u30B1\u30FC\u30B9"],[13085,1,"\u30B3\u30EB\u30CA"],[13086,1,"\u30B3\u30FC\u30DD"],[13087,1,"\u30B5\u30A4\u30AF\u30EB"],[13088,1,"\u30B5\u30F3\u30C1\u30FC\u30E0"],[13089,1,"\u30B7\u30EA\u30F3\u30B0"],[13090,1,"\u30BB\u30F3\u30C1"],[13091,1,"\u30BB\u30F3\u30C8"],[13092,1,"\u30C0\u30FC\u30B9"],[13093,1,"\u30C7\u30B7"],[13094,1,"\u30C9\u30EB"],[13095,1,"\u30C8\u30F3"],[13096,1,"\u30CA\u30CE"],[13097,1,"\u30CE\u30C3\u30C8"],[13098,1,"\u30CF\u30A4\u30C4"],[13099,1,"\u30D1\u30FC\u30BB\u30F3\u30C8"],[13100,1,"\u30D1\u30FC\u30C4"],[13101,1,"\u30D0\u30FC\u30EC\u30EB"],[13102,1,"\u30D4\u30A2\u30B9\u30C8\u30EB"],[13103,1,"\u30D4\u30AF\u30EB"],[13104,1,"\u30D4\u30B3"],[13105,1,"\u30D3\u30EB"],[13106,1,"\u30D5\u30A1\u30E9\u30C3\u30C9"],[13107,1,"\u30D5\u30A3\u30FC\u30C8"],[13108,1,"\u30D6\u30C3\u30B7\u30A7\u30EB"],[13109,1,"\u30D5\u30E9\u30F3"],[13110,1,"\u30D8\u30AF\u30BF\u30FC\u30EB"],[13111,1,"\u30DA\u30BD"],[13112,1,"\u30DA\u30CB\u30D2"],[13113,1,"\u30D8\u30EB\u30C4"],[13114,1,"\u30DA\u30F3\u30B9"],[13115,1,"\u30DA\u30FC\u30B8"],[13116,1,"\u30D9\u30FC\u30BF"],[13117,1,"\u30DD\u30A4\u30F3\u30C8"],[13118,1,"\u30DC\u30EB\u30C8"],[13119,1,"\u30DB\u30F3"],[13120,1,"\u30DD\u30F3\u30C9"],[13121,1,"\u30DB\u30FC\u30EB"],[13122,1,"\u30DB\u30FC\u30F3"],[13123,1,"\u30DE\u30A4\u30AF\u30ED"],[13124,1,"\u30DE\u30A4\u30EB"],[13125,1,"\u30DE\u30C3\u30CF"],[13126,1,"\u30DE\u30EB\u30AF"],[13127,1,"\u30DE\u30F3\u30B7\u30E7\u30F3"],[13128,1,"\u30DF\u30AF\u30ED\u30F3"],[13129,1,"\u30DF\u30EA"],[13130,1,"\u30DF\u30EA\u30D0\u30FC\u30EB"],[13131,1,"\u30E1\u30AC"],[13132,1,"\u30E1\u30AC\u30C8\u30F3"],[13133,1,"\u30E1\u30FC\u30C8\u30EB"],[13134,1,"\u30E4\u30FC\u30C9"],[13135,1,"\u30E4\u30FC\u30EB"],[13136,1,"\u30E6\u30A2\u30F3"],[13137,1,"\u30EA\u30C3\u30C8\u30EB"],[13138,1,"\u30EA\u30E9"],[13139,1,"\u30EB\u30D4\u30FC"],[13140,1,"\u30EB\u30FC\u30D6\u30EB"],[13141,1,"\u30EC\u30E0"],[13142,1,"\u30EC\u30F3\u30C8\u30B2\u30F3"],[13143,1,"\u30EF\u30C3\u30C8"],[13144,1,"0\u70B9"],[13145,1,"1\u70B9"],[13146,1,"2\u70B9"],[13147,1,"3\u70B9"],[13148,1,"4\u70B9"],[13149,1,"5\u70B9"],[13150,1,"6\u70B9"],[13151,1,"7\u70B9"],[13152,1,"8\u70B9"],[13153,1,"9\u70B9"],[13154,1,"10\u70B9"],[13155,1,"11\u70B9"],[13156,1,"12\u70B9"],[13157,1,"13\u70B9"],[13158,1,"14\u70B9"],[13159,1,"15\u70B9"],[13160,1,"16\u70B9"],[13161,1,"17\u70B9"],[13162,1,"18\u70B9"],[13163,1,"19\u70B9"],[13164,1,"20\u70B9"],[13165,1,"21\u70B9"],[13166,1,"22\u70B9"],[13167,1,"23\u70B9"],[13168,1,"24\u70B9"],[13169,1,"hpa"],[13170,1,"da"],[13171,1,"au"],[13172,1,"bar"],[13173,1,"ov"],[13174,1,"pc"],[13175,1,"dm"],[13176,1,"dm2"],[13177,1,"dm3"],[13178,1,"iu"],[13179,1,"\u5E73\u6210"],[13180,1,"\u662D\u548C"],[13181,1,"\u5927\u6B63"],[13182,1,"\u660E\u6CBB"],[13183,1,"\u682A\u5F0F\u4F1A\u793E"],[13184,1,"pa"],[13185,1,"na"],[13186,1,"\u03BCa"],[13187,1,"ma"],[13188,1,"ka"],[13189,1,"kb"],[13190,1,"mb"],[13191,1,"gb"],[13192,1,"cal"],[13193,1,"kcal"],[13194,1,"pf"],[13195,1,"nf"],[13196,1,"\u03BCf"],[13197,1,"\u03BCg"],[13198,1,"mg"],[13199,1,"kg"],[13200,1,"hz"],[13201,1,"khz"],[13202,1,"mhz"],[13203,1,"ghz"],[13204,1,"thz"],[13205,1,"\u03BCl"],[13206,1,"ml"],[13207,1,"dl"],[13208,1,"kl"],[13209,1,"fm"],[13210,1,"nm"],[13211,1,"\u03BCm"],[13212,1,"mm"],[13213,1,"cm"],[13214,1,"km"],[13215,1,"mm2"],[13216,1,"cm2"],[13217,1,"m2"],[13218,1,"km2"],[13219,1,"mm3"],[13220,1,"cm3"],[13221,1,"m3"],[13222,1,"km3"],[13223,1,"m\u2215s"],[13224,1,"m\u2215s2"],[13225,1,"pa"],[13226,1,"kpa"],[13227,1,"mpa"],[13228,1,"gpa"],[13229,1,"rad"],[13230,1,"rad\u2215s"],[13231,1,"rad\u2215s2"],[13232,1,"ps"],[13233,1,"ns"],[13234,1,"\u03BCs"],[13235,1,"ms"],[13236,1,"pv"],[13237,1,"nv"],[13238,1,"\u03BCv"],[13239,1,"mv"],[13240,1,"kv"],[13241,1,"mv"],[13242,1,"pw"],[13243,1,"nw"],[13244,1,"\u03BCw"],[13245,1,"mw"],[13246,1,"kw"],[13247,1,"mw"],[13248,1,"k\u03C9"],[13249,1,"m\u03C9"],[13250,3],[13251,1,"bq"],[13252,1,"cc"],[13253,1,"cd"],[13254,1,"c\u2215kg"],[13255,3],[13256,1,"db"],[13257,1,"gy"],[13258,1,"ha"],[13259,1,"hp"],[13260,1,"in"],[13261,1,"kk"],[13262,1,"km"],[13263,1,"kt"],[13264,1,"lm"],[13265,1,"ln"],[13266,1,"log"],[13267,1,"lx"],[13268,1,"mb"],[13269,1,"mil"],[13270,1,"mol"],[13271,1,"ph"],[13272,3],[13273,1,"ppm"],[13274,1,"pr"],[13275,1,"sr"],[13276,1,"sv"],[13277,1,"wb"],[13278,1,"v\u2215m"],[13279,1,"a\u2215m"],[13280,1,"1\u65E5"],[13281,1,"2\u65E5"],[13282,1,"3\u65E5"],[13283,1,"4\u65E5"],[13284,1,"5\u65E5"],[13285,1,"6\u65E5"],[13286,1,"7\u65E5"],[13287,1,"8\u65E5"],[13288,1,"9\u65E5"],[13289,1,"10\u65E5"],[13290,1,"11\u65E5"],[13291,1,"12\u65E5"],[13292,1,"13\u65E5"],[13293,1,"14\u65E5"],[13294,1,"15\u65E5"],[13295,1,"16\u65E5"],[13296,1,"17\u65E5"],[13297,1,"18\u65E5"],[13298,1,"19\u65E5"],[13299,1,"20\u65E5"],[13300,1,"21\u65E5"],[13301,1,"22\u65E5"],[13302,1,"23\u65E5"],[13303,1,"24\u65E5"],[13304,1,"25\u65E5"],[13305,1,"26\u65E5"],[13306,1,"27\u65E5"],[13307,1,"28\u65E5"],[13308,1,"29\u65E5"],[13309,1,"30\u65E5"],[13310,1,"31\u65E5"],[13311,1,"gal"],[[13312,19893],2],[[19894,19903],2],[[19904,19967],2],[[19968,40869],2],[[40870,40891],2],[[40892,40899],2],[[40900,40907],2],[40908,2],[[40909,40917],2],[[40918,40938],2],[[40939,40943],2],[[40944,40956],2],[[40957,40959],2],[[40960,42124],2],[[42125,42127],3],[[42128,42145],2],[[42146,42147],2],[[42148,42163],2],[42164,2],[[42165,42176],2],[42177,2],[[42178,42180],2],[42181,2],[42182,2],[[42183,42191],3],[[42192,42237],2],[[42238,42239],2],[[42240,42508],2],[[42509,42511],2],[[42512,42539],2],[[42540,42559],3],[42560,1,"\uA641"],[42561,2],[42562,1,"\uA643"],[42563,2],[42564,1,"\uA645"],[42565,2],[42566,1,"\uA647"],[42567,2],[42568,1,"\uA649"],[42569,2],[42570,1,"\uA64B"],[42571,2],[42572,1,"\uA64D"],[42573,2],[42574,1,"\uA64F"],[42575,2],[42576,1,"\uA651"],[42577,2],[42578,1,"\uA653"],[42579,2],[42580,1,"\uA655"],[42581,2],[42582,1,"\uA657"],[42583,2],[42584,1,"\uA659"],[42585,2],[42586,1,"\uA65B"],[42587,2],[42588,1,"\uA65D"],[42589,2],[42590,1,"\uA65F"],[42591,2],[42592,1,"\uA661"],[42593,2],[42594,1,"\uA663"],[42595,2],[42596,1,"\uA665"],[42597,2],[42598,1,"\uA667"],[42599,2],[42600,1,"\uA669"],[42601,2],[42602,1,"\uA66B"],[42603,2],[42604,1,"\uA66D"],[[42605,42607],2],[[42608,42611],2],[[42612,42619],2],[[42620,42621],2],[42622,2],[42623,2],[42624,1,"\uA681"],[42625,2],[42626,1,"\uA683"],[42627,2],[42628,1,"\uA685"],[42629,2],[42630,1,"\uA687"],[42631,2],[42632,1,"\uA689"],[42633,2],[42634,1,"\uA68B"],[42635,2],[42636,1,"\uA68D"],[42637,2],[42638,1,"\uA68F"],[42639,2],[42640,1,"\uA691"],[42641,2],[42642,1,"\uA693"],[42643,2],[42644,1,"\uA695"],[42645,2],[42646,1,"\uA697"],[42647,2],[42648,1,"\uA699"],[42649,2],[42650,1,"\uA69B"],[42651,2],[42652,1,"\u044A"],[42653,1,"\u044C"],[42654,2],[42655,2],[[42656,42725],2],[[42726,42735],2],[[42736,42737],2],[[42738,42743],2],[[42744,42751],3],[[42752,42774],2],[[42775,42778],2],[[42779,42783],2],[[42784,42785],2],[42786,1,"\uA723"],[42787,2],[42788,1,"\uA725"],[42789,2],[42790,1,"\uA727"],[42791,2],[42792,1,"\uA729"],[42793,2],[42794,1,"\uA72B"],[42795,2],[42796,1,"\uA72D"],[42797,2],[42798,1,"\uA72F"],[[42799,42801],2],[42802,1,"\uA733"],[42803,2],[42804,1,"\uA735"],[42805,2],[42806,1,"\uA737"],[42807,2],[42808,1,"\uA739"],[42809,2],[42810,1,"\uA73B"],[42811,2],[42812,1,"\uA73D"],[42813,2],[42814,1,"\uA73F"],[42815,2],[42816,1,"\uA741"],[42817,2],[42818,1,"\uA743"],[42819,2],[42820,1,"\uA745"],[42821,2],[42822,1,"\uA747"],[42823,2],[42824,1,"\uA749"],[42825,2],[42826,1,"\uA74B"],[42827,2],[42828,1,"\uA74D"],[42829,2],[42830,1,"\uA74F"],[42831,2],[42832,1,"\uA751"],[42833,2],[42834,1,"\uA753"],[42835,2],[42836,1,"\uA755"],[42837,2],[42838,1,"\uA757"],[42839,2],[42840,1,"\uA759"],[42841,2],[42842,1,"\uA75B"],[42843,2],[42844,1,"\uA75D"],[42845,2],[42846,1,"\uA75F"],[42847,2],[42848,1,"\uA761"],[42849,2],[42850,1,"\uA763"],[42851,2],[42852,1,"\uA765"],[42853,2],[42854,1,"\uA767"],[42855,2],[42856,1,"\uA769"],[42857,2],[42858,1,"\uA76B"],[42859,2],[42860,1,"\uA76D"],[42861,2],[42862,1,"\uA76F"],[42863,2],[42864,1,"\uA76F"],[[42865,42872],2],[42873,1,"\uA77A"],[42874,2],[42875,1,"\uA77C"],[42876,2],[42877,1,"\u1D79"],[42878,1,"\uA77F"],[42879,2],[42880,1,"\uA781"],[42881,2],[42882,1,"\uA783"],[42883,2],[42884,1,"\uA785"],[42885,2],[42886,1,"\uA787"],[[42887,42888],2],[[42889,42890],2],[42891,1,"\uA78C"],[42892,2],[42893,1,"\u0265"],[42894,2],[42895,2],[42896,1,"\uA791"],[42897,2],[42898,1,"\uA793"],[42899,2],[[42900,42901],2],[42902,1,"\uA797"],[42903,2],[42904,1,"\uA799"],[42905,2],[42906,1,"\uA79B"],[42907,2],[42908,1,"\uA79D"],[42909,2],[42910,1,"\uA79F"],[42911,2],[42912,1,"\uA7A1"],[42913,2],[42914,1,"\uA7A3"],[42915,2],[42916,1,"\uA7A5"],[42917,2],[42918,1,"\uA7A7"],[42919,2],[42920,1,"\uA7A9"],[42921,2],[42922,1,"\u0266"],[42923,1,"\u025C"],[42924,1,"\u0261"],[42925,1,"\u026C"],[42926,1,"\u026A"],[42927,2],[42928,1,"\u029E"],[42929,1,"\u0287"],[42930,1,"\u029D"],[42931,1,"\uAB53"],[42932,1,"\uA7B5"],[42933,2],[42934,1,"\uA7B7"],[42935,2],[42936,1,"\uA7B9"],[42937,2],[42938,1,"\uA7BB"],[42939,2],[42940,1,"\uA7BD"],[42941,2],[42942,1,"\uA7BF"],[42943,2],[42944,1,"\uA7C1"],[42945,2],[42946,1,"\uA7C3"],[42947,2],[42948,1,"\uA794"],[42949,1,"\u0282"],[42950,1,"\u1D8E"],[42951,1,"\uA7C8"],[42952,2],[42953,1,"\uA7CA"],[42954,2],[42955,1,"\u0264"],[42956,1,"\uA7CD"],[42957,2],[42958,1,"\uA7CF"],[42959,2],[42960,1,"\uA7D1"],[42961,2],[42962,1,"\uA7D3"],[42963,2],[42964,1,"\uA7D5"],[42965,2],[42966,1,"\uA7D7"],[42967,2],[42968,1,"\uA7D9"],[42969,2],[42970,1,"\uA7DB"],[42971,2],[42972,1,"\u019B"],[[42973,42992],3],[42993,1,"s"],[42994,1,"c"],[42995,1,"f"],[42996,1,"q"],[42997,1,"\uA7F6"],[42998,2],[42999,2],[43000,1,"\u0127"],[43001,1,"\u0153"],[43002,2],[[43003,43007],2],[[43008,43047],2],[[43048,43051],2],[43052,2],[[43053,43055],3],[[43056,43065],2],[[43066,43071],3],[[43072,43123],2],[[43124,43127],2],[[43128,43135],3],[[43136,43204],2],[43205,2],[[43206,43213],3],[[43214,43215],2],[[43216,43225],2],[[43226,43231],3],[[43232,43255],2],[[43256,43258],2],[43259,2],[43260,2],[43261,2],[[43262,43263],2],[[43264,43309],2],[[43310,43311],2],[[43312,43347],2],[[43348,43358],3],[43359,2],[[43360,43388],2],[[43389,43391],3],[[43392,43456],2],[[43457,43469],2],[43470,3],[[43471,43481],2],[[43482,43485],3],[[43486,43487],2],[[43488,43518],2],[43519,3],[[43520,43574],2],[[43575,43583],3],[[43584,43597],2],[[43598,43599],3],[[43600,43609],2],[[43610,43611],3],[[43612,43615],2],[[43616,43638],2],[[43639,43641],2],[[43642,43643],2],[[43644,43647],2],[[43648,43714],2],[[43715,43738],3],[[43739,43741],2],[[43742,43743],2],[[43744,43759],2],[[43760,43761],2],[[43762,43766],2],[[43767,43776],3],[[43777,43782],2],[[43783,43784],3],[[43785,43790],2],[[43791,43792],3],[[43793,43798],2],[[43799,43807],3],[[43808,43814],2],[43815,3],[[43816,43822],2],[43823,3],[[43824,43866],2],[43867,2],[43868,1,"\uA727"],[43869,1,"\uAB37"],[43870,1,"\u026B"],[43871,1,"\uAB52"],[[43872,43875],2],[[43876,43877],2],[[43878,43879],2],[43880,2],[43881,1,"\u028D"],[[43882,43883],2],[[43884,43887],3],[43888,1,"\u13A0"],[43889,1,"\u13A1"],[43890,1,"\u13A2"],[43891,1,"\u13A3"],[43892,1,"\u13A4"],[43893,1,"\u13A5"],[43894,1,"\u13A6"],[43895,1,"\u13A7"],[43896,1,"\u13A8"],[43897,1,"\u13A9"],[43898,1,"\u13AA"],[43899,1,"\u13AB"],[43900,1,"\u13AC"],[43901,1,"\u13AD"],[43902,1,"\u13AE"],[43903,1,"\u13AF"],[43904,1,"\u13B0"],[43905,1,"\u13B1"],[43906,1,"\u13B2"],[43907,1,"\u13B3"],[43908,1,"\u13B4"],[43909,1,"\u13B5"],[43910,1,"\u13B6"],[43911,1,"\u13B7"],[43912,1,"\u13B8"],[43913,1,"\u13B9"],[43914,1,"\u13BA"],[43915,1,"\u13BB"],[43916,1,"\u13BC"],[43917,1,"\u13BD"],[43918,1,"\u13BE"],[43919,1,"\u13BF"],[43920,1,"\u13C0"],[43921,1,"\u13C1"],[43922,1,"\u13C2"],[43923,1,"\u13C3"],[43924,1,"\u13C4"],[43925,1,"\u13C5"],[43926,1,"\u13C6"],[43927,1,"\u13C7"],[43928,1,"\u13C8"],[43929,1,"\u13C9"],[43930,1,"\u13CA"],[43931,1,"\u13CB"],[43932,1,"\u13CC"],[43933,1,"\u13CD"],[43934,1,"\u13CE"],[43935,1,"\u13CF"],[43936,1,"\u13D0"],[43937,1,"\u13D1"],[43938,1,"\u13D2"],[43939,1,"\u13D3"],[43940,1,"\u13D4"],[43941,1,"\u13D5"],[43942,1,"\u13D6"],[43943,1,"\u13D7"],[43944,1,"\u13D8"],[43945,1,"\u13D9"],[43946,1,"\u13DA"],[43947,1,"\u13DB"],[43948,1,"\u13DC"],[43949,1,"\u13DD"],[43950,1,"\u13DE"],[43951,1,"\u13DF"],[43952,1,"\u13E0"],[43953,1,"\u13E1"],[43954,1,"\u13E2"],[43955,1,"\u13E3"],[43956,1,"\u13E4"],[43957,1,"\u13E5"],[43958,1,"\u13E6"],[43959,1,"\u13E7"],[43960,1,"\u13E8"],[43961,1,"\u13E9"],[43962,1,"\u13EA"],[43963,1,"\u13EB"],[43964,1,"\u13EC"],[43965,1,"\u13ED"],[43966,1,"\u13EE"],[43967,1,"\u13EF"],[[43968,44010],2],[44011,2],[[44012,44013],2],[[44014,44015],3],[[44016,44025],2],[[44026,44031],3],[[44032,55203],2],[[55204,55215],3],[[55216,55238],2],[[55239,55242],3],[[55243,55291],2],[[55292,55295],3],[[55296,57343],3],[[57344,63743],3],[63744,1,"\u8C48"],[63745,1,"\u66F4"],[63746,1,"\u8ECA"],[63747,1,"\u8CC8"],[63748,1,"\u6ED1"],[63749,1,"\u4E32"],[63750,1,"\u53E5"],[[63751,63752],1,"\u9F9C"],[63753,1,"\u5951"],[63754,1,"\u91D1"],[63755,1,"\u5587"],[63756,1,"\u5948"],[63757,1,"\u61F6"],[63758,1,"\u7669"],[63759,1,"\u7F85"],[63760,1,"\u863F"],[63761,1,"\u87BA"],[63762,1,"\u88F8"],[63763,1,"\u908F"],[63764,1,"\u6A02"],[63765,1,"\u6D1B"],[63766,1,"\u70D9"],[63767,1,"\u73DE"],[63768,1,"\u843D"],[63769,1,"\u916A"],[63770,1,"\u99F1"],[63771,1,"\u4E82"],[63772,1,"\u5375"],[63773,1,"\u6B04"],[63774,1,"\u721B"],[63775,1,"\u862D"],[63776,1,"\u9E1E"],[63777,1,"\u5D50"],[63778,1,"\u6FEB"],[63779,1,"\u85CD"],[63780,1,"\u8964"],[63781,1,"\u62C9"],[63782,1,"\u81D8"],[63783,1,"\u881F"],[63784,1,"\u5ECA"],[63785,1,"\u6717"],[63786,1,"\u6D6A"],[63787,1,"\u72FC"],[63788,1,"\u90CE"],[63789,1,"\u4F86"],[63790,1,"\u51B7"],[63791,1,"\u52DE"],[63792,1,"\u64C4"],[63793,1,"\u6AD3"],[63794,1,"\u7210"],[63795,1,"\u76E7"],[63796,1,"\u8001"],[63797,1,"\u8606"],[63798,1,"\u865C"],[63799,1,"\u8DEF"],[63800,1,"\u9732"],[63801,1,"\u9B6F"],[63802,1,"\u9DFA"],[63803,1,"\u788C"],[63804,1,"\u797F"],[63805,1,"\u7DA0"],[63806,1,"\u83C9"],[63807,1,"\u9304"],[63808,1,"\u9E7F"],[63809,1,"\u8AD6"],[63810,1,"\u58DF"],[63811,1,"\u5F04"],[63812,1,"\u7C60"],[63813,1,"\u807E"],[63814,1,"\u7262"],[63815,1,"\u78CA"],[63816,1,"\u8CC2"],[63817,1,"\u96F7"],[63818,1,"\u58D8"],[63819,1,"\u5C62"],[63820,1,"\u6A13"],[63821,1,"\u6DDA"],[63822,1,"\u6F0F"],[63823,1,"\u7D2F"],[63824,1,"\u7E37"],[63825,1,"\u964B"],[63826,1,"\u52D2"],[63827,1,"\u808B"],[63828,1,"\u51DC"],[63829,1,"\u51CC"],[63830,1,"\u7A1C"],[63831,1,"\u7DBE"],[63832,1,"\u83F1"],[63833,1,"\u9675"],[63834,1,"\u8B80"],[63835,1,"\u62CF"],[63836,1,"\u6A02"],[63837,1,"\u8AFE"],[63838,1,"\u4E39"],[63839,1,"\u5BE7"],[63840,1,"\u6012"],[63841,1,"\u7387"],[63842,1,"\u7570"],[63843,1,"\u5317"],[63844,1,"\u78FB"],[63845,1,"\u4FBF"],[63846,1,"\u5FA9"],[63847,1,"\u4E0D"],[63848,1,"\u6CCC"],[63849,1,"\u6578"],[63850,1,"\u7D22"],[63851,1,"\u53C3"],[63852,1,"\u585E"],[63853,1,"\u7701"],[63854,1,"\u8449"],[63855,1,"\u8AAA"],[63856,1,"\u6BBA"],[63857,1,"\u8FB0"],[63858,1,"\u6C88"],[63859,1,"\u62FE"],[63860,1,"\u82E5"],[63861,1,"\u63A0"],[63862,1,"\u7565"],[63863,1,"\u4EAE"],[63864,1,"\u5169"],[63865,1,"\u51C9"],[63866,1,"\u6881"],[63867,1,"\u7CE7"],[63868,1,"\u826F"],[63869,1,"\u8AD2"],[63870,1,"\u91CF"],[63871,1,"\u52F5"],[63872,1,"\u5442"],[63873,1,"\u5973"],[63874,1,"\u5EEC"],[63875,1,"\u65C5"],[63876,1,"\u6FFE"],[63877,1,"\u792A"],[63878,1,"\u95AD"],[63879,1,"\u9A6A"],[63880,1,"\u9E97"],[63881,1,"\u9ECE"],[63882,1,"\u529B"],[63883,1,"\u66C6"],[63884,1,"\u6B77"],[63885,1,"\u8F62"],[63886,1,"\u5E74"],[63887,1,"\u6190"],[63888,1,"\u6200"],[63889,1,"\u649A"],[63890,1,"\u6F23"],[63891,1,"\u7149"],[63892,1,"\u7489"],[63893,1,"\u79CA"],[63894,1,"\u7DF4"],[63895,1,"\u806F"],[63896,1,"\u8F26"],[63897,1,"\u84EE"],[63898,1,"\u9023"],[63899,1,"\u934A"],[63900,1,"\u5217"],[63901,1,"\u52A3"],[63902,1,"\u54BD"],[63903,1,"\u70C8"],[63904,1,"\u88C2"],[63905,1,"\u8AAA"],[63906,1,"\u5EC9"],[63907,1,"\u5FF5"],[63908,1,"\u637B"],[63909,1,"\u6BAE"],[63910,1,"\u7C3E"],[63911,1,"\u7375"],[63912,1,"\u4EE4"],[63913,1,"\u56F9"],[63914,1,"\u5BE7"],[63915,1,"\u5DBA"],[63916,1,"\u601C"],[63917,1,"\u73B2"],[63918,1,"\u7469"],[63919,1,"\u7F9A"],[63920,1,"\u8046"],[63921,1,"\u9234"],[63922,1,"\u96F6"],[63923,1,"\u9748"],[63924,1,"\u9818"],[63925,1,"\u4F8B"],[63926,1,"\u79AE"],[63927,1,"\u91B4"],[63928,1,"\u96B8"],[63929,1,"\u60E1"],[63930,1,"\u4E86"],[63931,1,"\u50DA"],[63932,1,"\u5BEE"],[63933,1,"\u5C3F"],[63934,1,"\u6599"],[63935,1,"\u6A02"],[63936,1,"\u71CE"],[63937,1,"\u7642"],[63938,1,"\u84FC"],[63939,1,"\u907C"],[63940,1,"\u9F8D"],[63941,1,"\u6688"],[63942,1,"\u962E"],[63943,1,"\u5289"],[63944,1,"\u677B"],[63945,1,"\u67F3"],[63946,1,"\u6D41"],[63947,1,"\u6E9C"],[63948,1,"\u7409"],[63949,1,"\u7559"],[63950,1,"\u786B"],[63951,1,"\u7D10"],[63952,1,"\u985E"],[63953,1,"\u516D"],[63954,1,"\u622E"],[63955,1,"\u9678"],[63956,1,"\u502B"],[63957,1,"\u5D19"],[63958,1,"\u6DEA"],[63959,1,"\u8F2A"],[63960,1,"\u5F8B"],[63961,1,"\u6144"],[63962,1,"\u6817"],[63963,1,"\u7387"],[63964,1,"\u9686"],[63965,1,"\u5229"],[63966,1,"\u540F"],[63967,1,"\u5C65"],[63968,1,"\u6613"],[63969,1,"\u674E"],[63970,1,"\u68A8"],[63971,1,"\u6CE5"],[63972,1,"\u7406"],[63973,1,"\u75E2"],[63974,1,"\u7F79"],[63975,1,"\u88CF"],[63976,1,"\u88E1"],[63977,1,"\u91CC"],[63978,1,"\u96E2"],[63979,1,"\u533F"],[63980,1,"\u6EBA"],[63981,1,"\u541D"],[63982,1,"\u71D0"],[63983,1,"\u7498"],[63984,1,"\u85FA"],[63985,1,"\u96A3"],[63986,1,"\u9C57"],[63987,1,"\u9E9F"],[63988,1,"\u6797"],[63989,1,"\u6DCB"],[63990,1,"\u81E8"],[63991,1,"\u7ACB"],[63992,1,"\u7B20"],[63993,1,"\u7C92"],[63994,1,"\u72C0"],[63995,1,"\u7099"],[63996,1,"\u8B58"],[63997,1,"\u4EC0"],[63998,1,"\u8336"],[63999,1,"\u523A"],[64000,1,"\u5207"],[64001,1,"\u5EA6"],[64002,1,"\u62D3"],[64003,1,"\u7CD6"],[64004,1,"\u5B85"],[64005,1,"\u6D1E"],[64006,1,"\u66B4"],[64007,1,"\u8F3B"],[64008,1,"\u884C"],[64009,1,"\u964D"],[64010,1,"\u898B"],[64011,1,"\u5ED3"],[64012,1,"\u5140"],[64013,1,"\u55C0"],[[64014,64015],2],[64016,1,"\u585A"],[64017,2],[64018,1,"\u6674"],[[64019,64020],2],[64021,1,"\u51DE"],[64022,1,"\u732A"],[64023,1,"\u76CA"],[64024,1,"\u793C"],[64025,1,"\u795E"],[64026,1,"\u7965"],[64027,1,"\u798F"],[64028,1,"\u9756"],[64029,1,"\u7CBE"],[64030,1,"\u7FBD"],[64031,2],[64032,1,"\u8612"],[64033,2],[64034,1,"\u8AF8"],[[64035,64036],2],[64037,1,"\u9038"],[64038,1,"\u90FD"],[[64039,64041],2],[64042,1,"\u98EF"],[64043,1,"\u98FC"],[64044,1,"\u9928"],[64045,1,"\u9DB4"],[64046,1,"\u90DE"],[64047,1,"\u96B7"],[64048,1,"\u4FAE"],[64049,1,"\u50E7"],[64050,1,"\u514D"],[64051,1,"\u52C9"],[64052,1,"\u52E4"],[64053,1,"\u5351"],[64054,1,"\u559D"],[64055,1,"\u5606"],[64056,1,"\u5668"],[64057,1,"\u5840"],[64058,1,"\u58A8"],[64059,1,"\u5C64"],[64060,1,"\u5C6E"],[64061,1,"\u6094"],[64062,1,"\u6168"],[64063,1,"\u618E"],[64064,1,"\u61F2"],[64065,1,"\u654F"],[64066,1,"\u65E2"],[64067,1,"\u6691"],[64068,1,"\u6885"],[64069,1,"\u6D77"],[64070,1,"\u6E1A"],[64071,1,"\u6F22"],[64072,1,"\u716E"],[64073,1,"\u722B"],[64074,1,"\u7422"],[64075,1,"\u7891"],[64076,1,"\u793E"],[64077,1,"\u7949"],[64078,1,"\u7948"],[64079,1,"\u7950"],[64080,1,"\u7956"],[64081,1,"\u795D"],[64082,1,"\u798D"],[64083,1,"\u798E"],[64084,1,"\u7A40"],[64085,1,"\u7A81"],[64086,1,"\u7BC0"],[64087,1,"\u7DF4"],[64088,1,"\u7E09"],[64089,1,"\u7E41"],[64090,1,"\u7F72"],[64091,1,"\u8005"],[64092,1,"\u81ED"],[[64093,64094],1,"\u8279"],[64095,1,"\u8457"],[64096,1,"\u8910"],[64097,1,"\u8996"],[64098,1,"\u8B01"],[64099,1,"\u8B39"],[64100,1,"\u8CD3"],[64101,1,"\u8D08"],[64102,1,"\u8FB6"],[64103,1,"\u9038"],[64104,1,"\u96E3"],[64105,1,"\u97FF"],[64106,1,"\u983B"],[64107,1,"\u6075"],[64108,1,"\uD850\uDEEE"],[64109,1,"\u8218"],[[64110,64111],3],[64112,1,"\u4E26"],[64113,1,"\u51B5"],[64114,1,"\u5168"],[64115,1,"\u4F80"],[64116,1,"\u5145"],[64117,1,"\u5180"],[64118,1,"\u52C7"],[64119,1,"\u52FA"],[64120,1,"\u559D"],[64121,1,"\u5555"],[64122,1,"\u5599"],[64123,1,"\u55E2"],[64124,1,"\u585A"],[64125,1,"\u58B3"],[64126,1,"\u5944"],[64127,1,"\u5954"],[64128,1,"\u5A62"],[64129,1,"\u5B28"],[64130,1,"\u5ED2"],[64131,1,"\u5ED9"],[64132,1,"\u5F69"],[64133,1,"\u5FAD"],[64134,1,"\u60D8"],[64135,1,"\u614E"],[64136,1,"\u6108"],[64137,1,"\u618E"],[64138,1,"\u6160"],[64139,1,"\u61F2"],[64140,1,"\u6234"],[64141,1,"\u63C4"],[64142,1,"\u641C"],[64143,1,"\u6452"],[64144,1,"\u6556"],[64145,1,"\u6674"],[64146,1,"\u6717"],[64147,1,"\u671B"],[64148,1,"\u6756"],[64149,1,"\u6B79"],[64150,1,"\u6BBA"],[64151,1,"\u6D41"],[64152,1,"\u6EDB"],[64153,1,"\u6ECB"],[64154,1,"\u6F22"],[64155,1,"\u701E"],[64156,1,"\u716E"],[64157,1,"\u77A7"],[64158,1,"\u7235"],[64159,1,"\u72AF"],[64160,1,"\u732A"],[64161,1,"\u7471"],[64162,1,"\u7506"],[64163,1,"\u753B"],[64164,1,"\u761D"],[64165,1,"\u761F"],[64166,1,"\u76CA"],[64167,1,"\u76DB"],[64168,1,"\u76F4"],[64169,1,"\u774A"],[64170,1,"\u7740"],[64171,1,"\u78CC"],[64172,1,"\u7AB1"],[64173,1,"\u7BC0"],[64174,1,"\u7C7B"],[64175,1,"\u7D5B"],[64176,1,"\u7DF4"],[64177,1,"\u7F3E"],[64178,1,"\u8005"],[64179,1,"\u8352"],[64180,1,"\u83EF"],[64181,1,"\u8779"],[64182,1,"\u8941"],[64183,1,"\u8986"],[64184,1,"\u8996"],[64185,1,"\u8ABF"],[64186,1,"\u8AF8"],[64187,1,"\u8ACB"],[64188,1,"\u8B01"],[64189,1,"\u8AFE"],[64190,1,"\u8AED"],[64191,1,"\u8B39"],[64192,1,"\u8B8A"],[64193,1,"\u8D08"],[64194,1,"\u8F38"],[64195,1,"\u9072"],[64196,1,"\u9199"],[64197,1,"\u9276"],[64198,1,"\u967C"],[64199,1,"\u96E3"],[64200,1,"\u9756"],[64201,1,"\u97DB"],[64202,1,"\u97FF"],[64203,1,"\u980B"],[64204,1,"\u983B"],[64205,1,"\u9B12"],[64206,1,"\u9F9C"],[64207,1,"\uD84A\uDC4A"],[64208,1,"\uD84A\uDC44"],[64209,1,"\uD84C\uDFD5"],[64210,1,"\u3B9D"],[64211,1,"\u4018"],[64212,1,"\u4039"],[64213,1,"\uD854\uDE49"],[64214,1,"\uD857\uDCD0"],[64215,1,"\uD85F\uDED3"],[64216,1,"\u9F43"],[64217,1,"\u9F8E"],[[64218,64255],3],[64256,1,"ff"],[64257,1,"fi"],[64258,1,"fl"],[64259,1,"ffi"],[64260,1,"ffl"],[[64261,64262],1,"st"],[[64263,64274],3],[64275,1,"\u0574\u0576"],[64276,1,"\u0574\u0565"],[64277,1,"\u0574\u056B"],[64278,1,"\u057E\u0576"],[64279,1,"\u0574\u056D"],[[64280,64284],3],[64285,1,"\u05D9\u05B4"],[64286,2],[64287,1,"\u05F2\u05B7"],[64288,1,"\u05E2"],[64289,1,"\u05D0"],[64290,1,"\u05D3"],[64291,1,"\u05D4"],[64292,1,"\u05DB"],[64293,1,"\u05DC"],[64294,1,"\u05DD"],[64295,1,"\u05E8"],[64296,1,"\u05EA"],[64297,1,"+"],[64298,1,"\u05E9\u05C1"],[64299,1,"\u05E9\u05C2"],[64300,1,"\u05E9\u05BC\u05C1"],[64301,1,"\u05E9\u05BC\u05C2"],[64302,1,"\u05D0\u05B7"],[64303,1,"\u05D0\u05B8"],[64304,1,"\u05D0\u05BC"],[64305,1,"\u05D1\u05BC"],[64306,1,"\u05D2\u05BC"],[64307,1,"\u05D3\u05BC"],[64308,1,"\u05D4\u05BC"],[64309,1,"\u05D5\u05BC"],[64310,1,"\u05D6\u05BC"],[64311,3],[64312,1,"\u05D8\u05BC"],[64313,1,"\u05D9\u05BC"],[64314,1,"\u05DA\u05BC"],[64315,1,"\u05DB\u05BC"],[64316,1,"\u05DC\u05BC"],[64317,3],[64318,1,"\u05DE\u05BC"],[64319,3],[64320,1,"\u05E0\u05BC"],[64321,1,"\u05E1\u05BC"],[64322,3],[64323,1,"\u05E3\u05BC"],[64324,1,"\u05E4\u05BC"],[64325,3],[64326,1,"\u05E6\u05BC"],[64327,1,"\u05E7\u05BC"],[64328,1,"\u05E8\u05BC"],[64329,1,"\u05E9\u05BC"],[64330,1,"\u05EA\u05BC"],[64331,1,"\u05D5\u05B9"],[64332,1,"\u05D1\u05BF"],[64333,1,"\u05DB\u05BF"],[64334,1,"\u05E4\u05BF"],[64335,1,"\u05D0\u05DC"],[[64336,64337],1,"\u0671"],[[64338,64341],1,"\u067B"],[[64342,64345],1,"\u067E"],[[64346,64349],1,"\u0680"],[[64350,64353],1,"\u067A"],[[64354,64357],1,"\u067F"],[[64358,64361],1,"\u0679"],[[64362,64365],1,"\u06A4"],[[64366,64369],1,"\u06A6"],[[64370,64373],1,"\u0684"],[[64374,64377],1,"\u0683"],[[64378,64381],1,"\u0686"],[[64382,64385],1,"\u0687"],[[64386,64387],1,"\u068D"],[[64388,64389],1,"\u068C"],[[64390,64391],1,"\u068E"],[[64392,64393],1,"\u0688"],[[64394,64395],1,"\u0698"],[[64396,64397],1,"\u0691"],[[64398,64401],1,"\u06A9"],[[64402,64405],1,"\u06AF"],[[64406,64409],1,"\u06B3"],[[64410,64413],1,"\u06B1"],[[64414,64415],1,"\u06BA"],[[64416,64419],1,"\u06BB"],[[64420,64421],1,"\u06C0"],[[64422,64425],1,"\u06C1"],[[64426,64429],1,"\u06BE"],[[64430,64431],1,"\u06D2"],[[64432,64433],1,"\u06D3"],[[64434,64449],2],[64450,2],[[64451,64466],2],[[64467,64470],1,"\u06AD"],[[64471,64472],1,"\u06C7"],[[64473,64474],1,"\u06C6"],[[64475,64476],1,"\u06C8"],[64477,1,"\u06C7\u0674"],[[64478,64479],1,"\u06CB"],[[64480,64481],1,"\u06C5"],[[64482,64483],1,"\u06C9"],[[64484,64487],1,"\u06D0"],[[64488,64489],1,"\u0649"],[[64490,64491],1,"\u0626\u0627"],[[64492,64493],1,"\u0626\u06D5"],[[64494,64495],1,"\u0626\u0648"],[[64496,64497],1,"\u0626\u06C7"],[[64498,64499],1,"\u0626\u06C6"],[[64500,64501],1,"\u0626\u06C8"],[[64502,64504],1,"\u0626\u06D0"],[[64505,64507],1,"\u0626\u0649"],[[64508,64511],1,"\u06CC"],[64512,1,"\u0626\u062C"],[64513,1,"\u0626\u062D"],[64514,1,"\u0626\u0645"],[64515,1,"\u0626\u0649"],[64516,1,"\u0626\u064A"],[64517,1,"\u0628\u062C"],[64518,1,"\u0628\u062D"],[64519,1,"\u0628\u062E"],[64520,1,"\u0628\u0645"],[64521,1,"\u0628\u0649"],[64522,1,"\u0628\u064A"],[64523,1,"\u062A\u062C"],[64524,1,"\u062A\u062D"],[64525,1,"\u062A\u062E"],[64526,1,"\u062A\u0645"],[64527,1,"\u062A\u0649"],[64528,1,"\u062A\u064A"],[64529,1,"\u062B\u062C"],[64530,1,"\u062B\u0645"],[64531,1,"\u062B\u0649"],[64532,1,"\u062B\u064A"],[64533,1,"\u062C\u062D"],[64534,1,"\u062C\u0645"],[64535,1,"\u062D\u062C"],[64536,1,"\u062D\u0645"],[64537,1,"\u062E\u062C"],[64538,1,"\u062E\u062D"],[64539,1,"\u062E\u0645"],[64540,1,"\u0633\u062C"],[64541,1,"\u0633\u062D"],[64542,1,"\u0633\u062E"],[64543,1,"\u0633\u0645"],[64544,1,"\u0635\u062D"],[64545,1,"\u0635\u0645"],[64546,1,"\u0636\u062C"],[64547,1,"\u0636\u062D"],[64548,1,"\u0636\u062E"],[64549,1,"\u0636\u0645"],[64550,1,"\u0637\u062D"],[64551,1,"\u0637\u0645"],[64552,1,"\u0638\u0645"],[64553,1,"\u0639\u062C"],[64554,1,"\u0639\u0645"],[64555,1,"\u063A\u062C"],[64556,1,"\u063A\u0645"],[64557,1,"\u0641\u062C"],[64558,1,"\u0641\u062D"],[64559,1,"\u0641\u062E"],[64560,1,"\u0641\u0645"],[64561,1,"\u0641\u0649"],[64562,1,"\u0641\u064A"],[64563,1,"\u0642\u062D"],[64564,1,"\u0642\u0645"],[64565,1,"\u0642\u0649"],[64566,1,"\u0642\u064A"],[64567,1,"\u0643\u0627"],[64568,1,"\u0643\u062C"],[64569,1,"\u0643\u062D"],[64570,1,"\u0643\u062E"],[64571,1,"\u0643\u0644"],[64572,1,"\u0643\u0645"],[64573,1,"\u0643\u0649"],[64574,1,"\u0643\u064A"],[64575,1,"\u0644\u062C"],[64576,1,"\u0644\u062D"],[64577,1,"\u0644\u062E"],[64578,1,"\u0644\u0645"],[64579,1,"\u0644\u0649"],[64580,1,"\u0644\u064A"],[64581,1,"\u0645\u062C"],[64582,1,"\u0645\u062D"],[64583,1,"\u0645\u062E"],[64584,1,"\u0645\u0645"],[64585,1,"\u0645\u0649"],[64586,1,"\u0645\u064A"],[64587,1,"\u0646\u062C"],[64588,1,"\u0646\u062D"],[64589,1,"\u0646\u062E"],[64590,1,"\u0646\u0645"],[64591,1,"\u0646\u0649"],[64592,1,"\u0646\u064A"],[64593,1,"\u0647\u062C"],[64594,1,"\u0647\u0645"],[64595,1,"\u0647\u0649"],[64596,1,"\u0647\u064A"],[64597,1,"\u064A\u062C"],[64598,1,"\u064A\u062D"],[64599,1,"\u064A\u062E"],[64600,1,"\u064A\u0645"],[64601,1,"\u064A\u0649"],[64602,1,"\u064A\u064A"],[64603,1,"\u0630\u0670"],[64604,1,"\u0631\u0670"],[64605,1,"\u0649\u0670"],[64606,1," \u064C\u0651"],[64607,1," \u064D\u0651"],[64608,1," \u064E\u0651"],[64609,1," \u064F\u0651"],[64610,1," \u0650\u0651"],[64611,1," \u0651\u0670"],[64612,1,"\u0626\u0631"],[64613,1,"\u0626\u0632"],[64614,1,"\u0626\u0645"],[64615,1,"\u0626\u0646"],[64616,1,"\u0626\u0649"],[64617,1,"\u0626\u064A"],[64618,1,"\u0628\u0631"],[64619,1,"\u0628\u0632"],[64620,1,"\u0628\u0645"],[64621,1,"\u0628\u0646"],[64622,1,"\u0628\u0649"],[64623,1,"\u0628\u064A"],[64624,1,"\u062A\u0631"],[64625,1,"\u062A\u0632"],[64626,1,"\u062A\u0645"],[64627,1,"\u062A\u0646"],[64628,1,"\u062A\u0649"],[64629,1,"\u062A\u064A"],[64630,1,"\u062B\u0631"],[64631,1,"\u062B\u0632"],[64632,1,"\u062B\u0645"],[64633,1,"\u062B\u0646"],[64634,1,"\u062B\u0649"],[64635,1,"\u062B\u064A"],[64636,1,"\u0641\u0649"],[64637,1,"\u0641\u064A"],[64638,1,"\u0642\u0649"],[64639,1,"\u0642\u064A"],[64640,1,"\u0643\u0627"],[64641,1,"\u0643\u0644"],[64642,1,"\u0643\u0645"],[64643,1,"\u0643\u0649"],[64644,1,"\u0643\u064A"],[64645,1,"\u0644\u0645"],[64646,1,"\u0644\u0649"],[64647,1,"\u0644\u064A"],[64648,1,"\u0645\u0627"],[64649,1,"\u0645\u0645"],[64650,1,"\u0646\u0631"],[64651,1,"\u0646\u0632"],[64652,1,"\u0646\u0645"],[64653,1,"\u0646\u0646"],[64654,1,"\u0646\u0649"],[64655,1,"\u0646\u064A"],[64656,1,"\u0649\u0670"],[64657,1,"\u064A\u0631"],[64658,1,"\u064A\u0632"],[64659,1,"\u064A\u0645"],[64660,1,"\u064A\u0646"],[64661,1,"\u064A\u0649"],[64662,1,"\u064A\u064A"],[64663,1,"\u0626\u062C"],[64664,1,"\u0626\u062D"],[64665,1,"\u0626\u062E"],[64666,1,"\u0626\u0645"],[64667,1,"\u0626\u0647"],[64668,1,"\u0628\u062C"],[64669,1,"\u0628\u062D"],[64670,1,"\u0628\u062E"],[64671,1,"\u0628\u0645"],[64672,1,"\u0628\u0647"],[64673,1,"\u062A\u062C"],[64674,1,"\u062A\u062D"],[64675,1,"\u062A\u062E"],[64676,1,"\u062A\u0645"],[64677,1,"\u062A\u0647"],[64678,1,"\u062B\u0645"],[64679,1,"\u062C\u062D"],[64680,1,"\u062C\u0645"],[64681,1,"\u062D\u062C"],[64682,1,"\u062D\u0645"],[64683,1,"\u062E\u062C"],[64684,1,"\u062E\u0645"],[64685,1,"\u0633\u062C"],[64686,1,"\u0633\u062D"],[64687,1,"\u0633\u062E"],[64688,1,"\u0633\u0645"],[64689,1,"\u0635\u062D"],[64690,1,"\u0635\u062E"],[64691,1,"\u0635\u0645"],[64692,1,"\u0636\u062C"],[64693,1,"\u0636\u062D"],[64694,1,"\u0636\u062E"],[64695,1,"\u0636\u0645"],[64696,1,"\u0637\u062D"],[64697,1,"\u0638\u0645"],[64698,1,"\u0639\u062C"],[64699,1,"\u0639\u0645"],[64700,1,"\u063A\u062C"],[64701,1,"\u063A\u0645"],[64702,1,"\u0641\u062C"],[64703,1,"\u0641\u062D"],[64704,1,"\u0641\u062E"],[64705,1,"\u0641\u0645"],[64706,1,"\u0642\u062D"],[64707,1,"\u0642\u0645"],[64708,1,"\u0643\u062C"],[64709,1,"\u0643\u062D"],[64710,1,"\u0643\u062E"],[64711,1,"\u0643\u0644"],[64712,1,"\u0643\u0645"],[64713,1,"\u0644\u062C"],[64714,1,"\u0644\u062D"],[64715,1,"\u0644\u062E"],[64716,1,"\u0644\u0645"],[64717,1,"\u0644\u0647"],[64718,1,"\u0645\u062C"],[64719,1,"\u0645\u062D"],[64720,1,"\u0645\u062E"],[64721,1,"\u0645\u0645"],[64722,1,"\u0646\u062C"],[64723,1,"\u0646\u062D"],[64724,1,"\u0646\u062E"],[64725,1,"\u0646\u0645"],[64726,1,"\u0646\u0647"],[64727,1,"\u0647\u062C"],[64728,1,"\u0647\u0645"],[64729,1,"\u0647\u0670"],[64730,1,"\u064A\u062C"],[64731,1,"\u064A\u062D"],[64732,1,"\u064A\u062E"],[64733,1,"\u064A\u0645"],[64734,1,"\u064A\u0647"],[64735,1,"\u0626\u0645"],[64736,1,"\u0626\u0647"],[64737,1,"\u0628\u0645"],[64738,1,"\u0628\u0647"],[64739,1,"\u062A\u0645"],[64740,1,"\u062A\u0647"],[64741,1,"\u062B\u0645"],[64742,1,"\u062B\u0647"],[64743,1,"\u0633\u0645"],[64744,1,"\u0633\u0647"],[64745,1,"\u0634\u0645"],[64746,1,"\u0634\u0647"],[64747,1,"\u0643\u0644"],[64748,1,"\u0643\u0645"],[64749,1,"\u0644\u0645"],[64750,1,"\u0646\u0645"],[64751,1,"\u0646\u0647"],[64752,1,"\u064A\u0645"],[64753,1,"\u064A\u0647"],[64754,1,"\u0640\u064E\u0651"],[64755,1,"\u0640\u064F\u0651"],[64756,1,"\u0640\u0650\u0651"],[64757,1,"\u0637\u0649"],[64758,1,"\u0637\u064A"],[64759,1,"\u0639\u0649"],[64760,1,"\u0639\u064A"],[64761,1,"\u063A\u0649"],[64762,1,"\u063A\u064A"],[64763,1,"\u0633\u0649"],[64764,1,"\u0633\u064A"],[64765,1,"\u0634\u0649"],[64766,1,"\u0634\u064A"],[64767,1,"\u062D\u0649"],[64768,1,"\u062D\u064A"],[64769,1,"\u062C\u0649"],[64770,1,"\u062C\u064A"],[64771,1,"\u062E\u0649"],[64772,1,"\u062E\u064A"],[64773,1,"\u0635\u0649"],[64774,1,"\u0635\u064A"],[64775,1,"\u0636\u0649"],[64776,1,"\u0636\u064A"],[64777,1,"\u0634\u062C"],[64778,1,"\u0634\u062D"],[64779,1,"\u0634\u062E"],[64780,1,"\u0634\u0645"],[64781,1,"\u0634\u0631"],[64782,1,"\u0633\u0631"],[64783,1,"\u0635\u0631"],[64784,1,"\u0636\u0631"],[64785,1,"\u0637\u0649"],[64786,1,"\u0637\u064A"],[64787,1,"\u0639\u0649"],[64788,1,"\u0639\u064A"],[64789,1,"\u063A\u0649"],[64790,1,"\u063A\u064A"],[64791,1,"\u0633\u0649"],[64792,1,"\u0633\u064A"],[64793,1,"\u0634\u0649"],[64794,1,"\u0634\u064A"],[64795,1,"\u062D\u0649"],[64796,1,"\u062D\u064A"],[64797,1,"\u062C\u0649"],[64798,1,"\u062C\u064A"],[64799,1,"\u062E\u0649"],[64800,1,"\u062E\u064A"],[64801,1,"\u0635\u0649"],[64802,1,"\u0635\u064A"],[64803,1,"\u0636\u0649"],[64804,1,"\u0636\u064A"],[64805,1,"\u0634\u062C"],[64806,1,"\u0634\u062D"],[64807,1,"\u0634\u062E"],[64808,1,"\u0634\u0645"],[64809,1,"\u0634\u0631"],[64810,1,"\u0633\u0631"],[64811,1,"\u0635\u0631"],[64812,1,"\u0636\u0631"],[64813,1,"\u0634\u062C"],[64814,1,"\u0634\u062D"],[64815,1,"\u0634\u062E"],[64816,1,"\u0634\u0645"],[64817,1,"\u0633\u0647"],[64818,1,"\u0634\u0647"],[64819,1,"\u0637\u0645"],[64820,1,"\u0633\u062C"],[64821,1,"\u0633\u062D"],[64822,1,"\u0633\u062E"],[64823,1,"\u0634\u062C"],[64824,1,"\u0634\u062D"],[64825,1,"\u0634\u062E"],[64826,1,"\u0637\u0645"],[64827,1,"\u0638\u0645"],[[64828,64829],1,"\u0627\u064B"],[[64830,64831],2],[[64832,64847],2],[64848,1,"\u062A\u062C\u0645"],[[64849,64850],1,"\u062A\u062D\u062C"],[64851,1,"\u062A\u062D\u0645"],[64852,1,"\u062A\u062E\u0645"],[64853,1,"\u062A\u0645\u062C"],[64854,1,"\u062A\u0645\u062D"],[64855,1,"\u062A\u0645\u062E"],[[64856,64857],1,"\u062C\u0645\u062D"],[64858,1,"\u062D\u0645\u064A"],[64859,1,"\u062D\u0645\u0649"],[64860,1,"\u0633\u062D\u062C"],[64861,1,"\u0633\u062C\u062D"],[64862,1,"\u0633\u062C\u0649"],[[64863,64864],1,"\u0633\u0645\u062D"],[64865,1,"\u0633\u0645\u062C"],[[64866,64867],1,"\u0633\u0645\u0645"],[[64868,64869],1,"\u0635\u062D\u062D"],[64870,1,"\u0635\u0645\u0645"],[[64871,64872],1,"\u0634\u062D\u0645"],[64873,1,"\u0634\u062C\u064A"],[[64874,64875],1,"\u0634\u0645\u062E"],[[64876,64877],1,"\u0634\u0645\u0645"],[64878,1,"\u0636\u062D\u0649"],[[64879,64880],1,"\u0636\u062E\u0645"],[[64881,64882],1,"\u0637\u0645\u062D"],[64883,1,"\u0637\u0645\u0645"],[64884,1,"\u0637\u0645\u064A"],[64885,1,"\u0639\u062C\u0645"],[[64886,64887],1,"\u0639\u0645\u0645"],[64888,1,"\u0639\u0645\u0649"],[64889,1,"\u063A\u0645\u0645"],[64890,1,"\u063A\u0645\u064A"],[64891,1,"\u063A\u0645\u0649"],[[64892,64893],1,"\u0641\u062E\u0645"],[64894,1,"\u0642\u0645\u062D"],[64895,1,"\u0642\u0645\u0645"],[64896,1,"\u0644\u062D\u0645"],[64897,1,"\u0644\u062D\u064A"],[64898,1,"\u0644\u062D\u0649"],[[64899,64900],1,"\u0644\u062C\u062C"],[[64901,64902],1,"\u0644\u062E\u0645"],[[64903,64904],1,"\u0644\u0645\u062D"],[64905,1,"\u0645\u062D\u062C"],[64906,1,"\u0645\u062D\u0645"],[64907,1,"\u0645\u062D\u064A"],[64908,1,"\u0645\u062C\u062D"],[64909,1,"\u0645\u062C\u0645"],[64910,1,"\u0645\u062E\u062C"],[64911,1,"\u0645\u062E\u0645"],[[64912,64913],2],[64914,1,"\u0645\u062C\u062E"],[64915,1,"\u0647\u0645\u062C"],[64916,1,"\u0647\u0645\u0645"],[64917,1,"\u0646\u062D\u0645"],[64918,1,"\u0646\u062D\u0649"],[[64919,64920],1,"\u0646\u062C\u0645"],[64921,1,"\u0646\u062C\u0649"],[64922,1,"\u0646\u0645\u064A"],[64923,1,"\u0646\u0645\u0649"],[[64924,64925],1,"\u064A\u0645\u0645"],[64926,1,"\u0628\u062E\u064A"],[64927,1,"\u062A\u062C\u064A"],[64928,1,"\u062A\u062C\u0649"],[64929,1,"\u062A\u062E\u064A"],[64930,1,"\u062A\u062E\u0649"],[64931,1,"\u062A\u0645\u064A"],[64932,1,"\u062A\u0645\u0649"],[64933,1,"\u062C\u0645\u064A"],[64934,1,"\u062C\u062D\u0649"],[64935,1,"\u062C\u0645\u0649"],[64936,1,"\u0633\u062E\u0649"],[64937,1,"\u0635\u062D\u064A"],[64938,1,"\u0634\u062D\u064A"],[64939,1,"\u0636\u062D\u064A"],[64940,1,"\u0644\u062C\u064A"],[64941,1,"\u0644\u0645\u064A"],[64942,1,"\u064A\u062D\u064A"],[64943,1,"\u064A\u062C\u064A"],[64944,1,"\u064A\u0645\u064A"],[64945,1,"\u0645\u0645\u064A"],[64946,1,"\u0642\u0645\u064A"],[64947,1,"\u0646\u062D\u064A"],[64948,1,"\u0642\u0645\u062D"],[64949,1,"\u0644\u062D\u0645"],[64950,1,"\u0639\u0645\u064A"],[64951,1,"\u0643\u0645\u064A"],[64952,1,"\u0646\u062C\u062D"],[64953,1,"\u0645\u062E\u064A"],[64954,1,"\u0644\u062C\u0645"],[64955,1,"\u0643\u0645\u0645"],[64956,1,"\u0644\u062C\u0645"],[64957,1,"\u0646\u062C\u062D"],[64958,1,"\u062C\u062D\u064A"],[64959,1,"\u062D\u062C\u064A"],[64960,1,"\u0645\u062C\u064A"],[64961,1,"\u0641\u0645\u064A"],[64962,1,"\u0628\u062D\u064A"],[64963,1,"\u0643\u0645\u0645"],[64964,1,"\u0639\u062C\u0645"],[64965,1,"\u0635\u0645\u0645"],[64966,1,"\u0633\u062E\u064A"],[64967,1,"\u0646\u062C\u064A"],[[64968,64974],2],[64975,2],[[64976,65007],3],[65008,1,"\u0635\u0644\u06D2"],[65009,1,"\u0642\u0644\u06D2"],[65010,1,"\u0627\u0644\u0644\u0647"],[65011,1,"\u0627\u0643\u0628\u0631"],[65012,1,"\u0645\u062D\u0645\u062F"],[65013,1,"\u0635\u0644\u0639\u0645"],[65014,1,"\u0631\u0633\u0648\u0644"],[65015,1,"\u0639\u0644\u064A\u0647"],[65016,1,"\u0648\u0633\u0644\u0645"],[65017,1,"\u0635\u0644\u0649"],[65018,1,"\u0635\u0644\u0649 \u0627\u0644\u0644\u0647 \u0639\u0644\u064A\u0647 \u0648\u0633\u0644\u0645"],[65019,1,"\u062C\u0644 \u062C\u0644\u0627\u0644\u0647"],[65020,1,"\u0631\u06CC\u0627\u0644"],[65021,2],[[65022,65023],2],[[65024,65039],7],[65040,1,","],[65041,1,"\u3001"],[65042,3],[65043,1,":"],[65044,1,";"],[65045,1,"!"],[65046,1,"?"],[65047,1,"\u3016"],[65048,1,"\u3017"],[65049,3],[[65050,65055],3],[[65056,65059],2],[[65060,65062],2],[[65063,65069],2],[[65070,65071],2],[65072,3],[65073,1,"\u2014"],[65074,1,"\u2013"],[[65075,65076],1,"_"],[65077,1,"("],[65078,1,")"],[65079,1,"{"],[65080,1,"}"],[65081,1,"\u3014"],[65082,1,"\u3015"],[65083,1,"\u3010"],[65084,1,"\u3011"],[65085,1,"\u300A"],[65086,1,"\u300B"],[65087,1,"\u3008"],[65088,1,"\u3009"],[65089,1,"\u300C"],[65090,1,"\u300D"],[65091,1,"\u300E"],[65092,1,"\u300F"],[[65093,65094],2],[65095,1,"["],[65096,1,"]"],[[65097,65100],1," \u0305"],[[65101,65103],1,"_"],[65104,1,","],[65105,1,"\u3001"],[65106,3],[65107,3],[65108,1,";"],[65109,1,":"],[65110,1,"?"],[65111,1,"!"],[65112,1,"\u2014"],[65113,1,"("],[65114,1,")"],[65115,1,"{"],[65116,1,"}"],[65117,1,"\u3014"],[65118,1,"\u3015"],[65119,1,"#"],[65120,1,"&"],[65121,1,"*"],[65122,1,"+"],[65123,1,"-"],[65124,1,"<"],[65125,1,">"],[65126,1,"="],[65127,3],[65128,1,"\\"],[65129,1,"$"],[65130,1,"%"],[65131,1,"@"],[[65132,65135],3],[65136,1," \u064B"],[65137,1,"\u0640\u064B"],[65138,1," \u064C"],[65139,2],[65140,1," \u064D"],[65141,3],[65142,1," \u064E"],[65143,1,"\u0640\u064E"],[65144,1," \u064F"],[65145,1,"\u0640\u064F"],[65146,1," \u0650"],[65147,1,"\u0640\u0650"],[65148,1," \u0651"],[65149,1,"\u0640\u0651"],[65150,1," \u0652"],[65151,1,"\u0640\u0652"],[65152,1,"\u0621"],[[65153,65154],1,"\u0622"],[[65155,65156],1,"\u0623"],[[65157,65158],1,"\u0624"],[[65159,65160],1,"\u0625"],[[65161,65164],1,"\u0626"],[[65165,65166],1,"\u0627"],[[65167,65170],1,"\u0628"],[[65171,65172],1,"\u0629"],[[65173,65176],1,"\u062A"],[[65177,65180],1,"\u062B"],[[65181,65184],1,"\u062C"],[[65185,65188],1,"\u062D"],[[65189,65192],1,"\u062E"],[[65193,65194],1,"\u062F"],[[65195,65196],1,"\u0630"],[[65197,65198],1,"\u0631"],[[65199,65200],1,"\u0632"],[[65201,65204],1,"\u0633"],[[65205,65208],1,"\u0634"],[[65209,65212],1,"\u0635"],[[65213,65216],1,"\u0636"],[[65217,65220],1,"\u0637"],[[65221,65224],1,"\u0638"],[[65225,65228],1,"\u0639"],[[65229,65232],1,"\u063A"],[[65233,65236],1,"\u0641"],[[65237,65240],1,"\u0642"],[[65241,65244],1,"\u0643"],[[65245,65248],1,"\u0644"],[[65249,65252],1,"\u0645"],[[65253,65256],1,"\u0646"],[[65257,65260],1,"\u0647"],[[65261,65262],1,"\u0648"],[[65263,65264],1,"\u0649"],[[65265,65268],1,"\u064A"],[[65269,65270],1,"\u0644\u0622"],[[65271,65272],1,"\u0644\u0623"],[[65273,65274],1,"\u0644\u0625"],[[65275,65276],1,"\u0644\u0627"],[[65277,65278],3],[65279,7],[65280,3],[65281,1,"!"],[65282,1,'"'],[65283,1,"#"],[65284,1,"$"],[65285,1,"%"],[65286,1,"&"],[65287,1,"'"],[65288,1,"("],[65289,1,")"],[65290,1,"*"],[65291,1,"+"],[65292,1,","],[65293,1,"-"],[65294,1,"."],[65295,1,"/"],[65296,1,"0"],[65297,1,"1"],[65298,1,"2"],[65299,1,"3"],[65300,1,"4"],[65301,1,"5"],[65302,1,"6"],[65303,1,"7"],[65304,1,"8"],[65305,1,"9"],[65306,1,":"],[65307,1,";"],[65308,1,"<"],[65309,1,"="],[65310,1,">"],[65311,1,"?"],[65312,1,"@"],[65313,1,"a"],[65314,1,"b"],[65315,1,"c"],[65316,1,"d"],[65317,1,"e"],[65318,1,"f"],[65319,1,"g"],[65320,1,"h"],[65321,1,"i"],[65322,1,"j"],[65323,1,"k"],[65324,1,"l"],[65325,1,"m"],[65326,1,"n"],[65327,1,"o"],[65328,1,"p"],[65329,1,"q"],[65330,1,"r"],[65331,1,"s"],[65332,1,"t"],[65333,1,"u"],[65334,1,"v"],[65335,1,"w"],[65336,1,"x"],[65337,1,"y"],[65338,1,"z"],[65339,1,"["],[65340,1,"\\"],[65341,1,"]"],[65342,1,"^"],[65343,1,"_"],[65344,1,"`"],[65345,1,"a"],[65346,1,"b"],[65347,1,"c"],[65348,1,"d"],[65349,1,"e"],[65350,1,"f"],[65351,1,"g"],[65352,1,"h"],[65353,1,"i"],[65354,1,"j"],[65355,1,"k"],[65356,1,"l"],[65357,1,"m"],[65358,1,"n"],[65359,1,"o"],[65360,1,"p"],[65361,1,"q"],[65362,1,"r"],[65363,1,"s"],[65364,1,"t"],[65365,1,"u"],[65366,1,"v"],[65367,1,"w"],[65368,1,"x"],[65369,1,"y"],[65370,1,"z"],[65371,1,"{"],[65372,1,"|"],[65373,1,"}"],[65374,1,"~"],[65375,1,"\u2985"],[65376,1,"\u2986"],[65377,1,"."],[65378,1,"\u300C"],[65379,1,"\u300D"],[65380,1,"\u3001"],[65381,1,"\u30FB"],[65382,1,"\u30F2"],[65383,1,"\u30A1"],[65384,1,"\u30A3"],[65385,1,"\u30A5"],[65386,1,"\u30A7"],[65387,1,"\u30A9"],[65388,1,"\u30E3"],[65389,1,"\u30E5"],[65390,1,"\u30E7"],[65391,1,"\u30C3"],[65392,1,"\u30FC"],[65393,1,"\u30A2"],[65394,1,"\u30A4"],[65395,1,"\u30A6"],[65396,1,"\u30A8"],[65397,1,"\u30AA"],[65398,1,"\u30AB"],[65399,1,"\u30AD"],[65400,1,"\u30AF"],[65401,1,"\u30B1"],[65402,1,"\u30B3"],[65403,1,"\u30B5"],[65404,1,"\u30B7"],[65405,1,"\u30B9"],[65406,1,"\u30BB"],[65407,1,"\u30BD"],[65408,1,"\u30BF"],[65409,1,"\u30C1"],[65410,1,"\u30C4"],[65411,1,"\u30C6"],[65412,1,"\u30C8"],[65413,1,"\u30CA"],[65414,1,"\u30CB"],[65415,1,"\u30CC"],[65416,1,"\u30CD"],[65417,1,"\u30CE"],[65418,1,"\u30CF"],[65419,1,"\u30D2"],[65420,1,"\u30D5"],[65421,1,"\u30D8"],[65422,1,"\u30DB"],[65423,1,"\u30DE"],[65424,1,"\u30DF"],[65425,1,"\u30E0"],[65426,1,"\u30E1"],[65427,1,"\u30E2"],[65428,1,"\u30E4"],[65429,1,"\u30E6"],[65430,1,"\u30E8"],[65431,1,"\u30E9"],[65432,1,"\u30EA"],[65433,1,"\u30EB"],[65434,1,"\u30EC"],[65435,1,"\u30ED"],[65436,1,"\u30EF"],[65437,1,"\u30F3"],[65438,1,"\u3099"],[65439,1,"\u309A"],[65440,7],[65441,1,"\u1100"],[65442,1,"\u1101"],[65443,1,"\u11AA"],[65444,1,"\u1102"],[65445,1,"\u11AC"],[65446,1,"\u11AD"],[65447,1,"\u1103"],[65448,1,"\u1104"],[65449,1,"\u1105"],[65450,1,"\u11B0"],[65451,1,"\u11B1"],[65452,1,"\u11B2"],[65453,1,"\u11B3"],[65454,1,"\u11B4"],[65455,1,"\u11B5"],[65456,1,"\u111A"],[65457,1,"\u1106"],[65458,1,"\u1107"],[65459,1,"\u1108"],[65460,1,"\u1121"],[65461,1,"\u1109"],[65462,1,"\u110A"],[65463,1,"\u110B"],[65464,1,"\u110C"],[65465,1,"\u110D"],[65466,1,"\u110E"],[65467,1,"\u110F"],[65468,1,"\u1110"],[65469,1,"\u1111"],[65470,1,"\u1112"],[[65471,65473],3],[65474,1,"\u1161"],[65475,1,"\u1162"],[65476,1,"\u1163"],[65477,1,"\u1164"],[65478,1,"\u1165"],[65479,1,"\u1166"],[[65480,65481],3],[65482,1,"\u1167"],[65483,1,"\u1168"],[65484,1,"\u1169"],[65485,1,"\u116A"],[65486,1,"\u116B"],[65487,1,"\u116C"],[[65488,65489],3],[65490,1,"\u116D"],[65491,1,"\u116E"],[65492,1,"\u116F"],[65493,1,"\u1170"],[65494,1,"\u1171"],[65495,1,"\u1172"],[[65496,65497],3],[65498,1,"\u1173"],[65499,1,"\u1174"],[65500,1,"\u1175"],[[65501,65503],3],[65504,1,"\xA2"],[65505,1,"\xA3"],[65506,1,"\xAC"],[65507,1," \u0304"],[65508,1,"\xA6"],[65509,1,"\xA5"],[65510,1,"\u20A9"],[65511,3],[65512,1,"\u2502"],[65513,1,"\u2190"],[65514,1,"\u2191"],[65515,1,"\u2192"],[65516,1,"\u2193"],[65517,1,"\u25A0"],[65518,1,"\u25CB"],[[65519,65528],3],[[65529,65531],3],[65532,3],[65533,3],[[65534,65535],3],[[65536,65547],2],[65548,3],[[65549,65574],2],[65575,3],[[65576,65594],2],[65595,3],[[65596,65597],2],[65598,3],[[65599,65613],2],[[65614,65615],3],[[65616,65629],2],[[65630,65663],3],[[65664,65786],2],[[65787,65791],3],[[65792,65794],2],[[65795,65798],3],[[65799,65843],2],[[65844,65846],3],[[65847,65855],2],[[65856,65930],2],[[65931,65932],2],[[65933,65934],2],[65935,3],[[65936,65947],2],[65948,2],[[65949,65951],3],[65952,2],[[65953,65999],3],[[66000,66044],2],[66045,2],[[66046,66175],3],[[66176,66204],2],[[66205,66207],3],[[66208,66256],2],[[66257,66271],3],[66272,2],[[66273,66299],2],[[66300,66303],3],[[66304,66334],2],[66335,2],[[66336,66339],2],[[66340,66348],3],[[66349,66351],2],[[66352,66368],2],[66369,2],[[66370,66377],2],[66378,2],[[66379,66383],3],[[66384,66426],2],[[66427,66431],3],[[66432,66461],2],[66462,3],[66463,2],[[66464,66499],2],[[66500,66503],3],[[66504,66511],2],[[66512,66517],2],[[66518,66559],3],[66560,1,"\uD801\uDC28"],[66561,1,"\uD801\uDC29"],[66562,1,"\uD801\uDC2A"],[66563,1,"\uD801\uDC2B"],[66564,1,"\uD801\uDC2C"],[66565,1,"\uD801\uDC2D"],[66566,1,"\uD801\uDC2E"],[66567,1,"\uD801\uDC2F"],[66568,1,"\uD801\uDC30"],[66569,1,"\uD801\uDC31"],[66570,1,"\uD801\uDC32"],[66571,1,"\uD801\uDC33"],[66572,1,"\uD801\uDC34"],[66573,1,"\uD801\uDC35"],[66574,1,"\uD801\uDC36"],[66575,1,"\uD801\uDC37"],[66576,1,"\uD801\uDC38"],[66577,1,"\uD801\uDC39"],[66578,1,"\uD801\uDC3A"],[66579,1,"\uD801\uDC3B"],[66580,1,"\uD801\uDC3C"],[66581,1,"\uD801\uDC3D"],[66582,1,"\uD801\uDC3E"],[66583,1,"\uD801\uDC3F"],[66584,1,"\uD801\uDC40"],[66585,1,"\uD801\uDC41"],[66586,1,"\uD801\uDC42"],[66587,1,"\uD801\uDC43"],[66588,1,"\uD801\uDC44"],[66589,1,"\uD801\uDC45"],[66590,1,"\uD801\uDC46"],[66591,1,"\uD801\uDC47"],[66592,1,"\uD801\uDC48"],[66593,1,"\uD801\uDC49"],[66594,1,"\uD801\uDC4A"],[66595,1,"\uD801\uDC4B"],[66596,1,"\uD801\uDC4C"],[66597,1,"\uD801\uDC4D"],[66598,1,"\uD801\uDC4E"],[66599,1,"\uD801\uDC4F"],[[66600,66637],2],[[66638,66717],2],[[66718,66719],3],[[66720,66729],2],[[66730,66735],3],[66736,1,"\uD801\uDCD8"],[66737,1,"\uD801\uDCD9"],[66738,1,"\uD801\uDCDA"],[66739,1,"\uD801\uDCDB"],[66740,1,"\uD801\uDCDC"],[66741,1,"\uD801\uDCDD"],[66742,1,"\uD801\uDCDE"],[66743,1,"\uD801\uDCDF"],[66744,1,"\uD801\uDCE0"],[66745,1,"\uD801\uDCE1"],[66746,1,"\uD801\uDCE2"],[66747,1,"\uD801\uDCE3"],[66748,1,"\uD801\uDCE4"],[66749,1,"\uD801\uDCE5"],[66750,1,"\uD801\uDCE6"],[66751,1,"\uD801\uDCE7"],[66752,1,"\uD801\uDCE8"],[66753,1,"\uD801\uDCE9"],[66754,1,"\uD801\uDCEA"],[66755,1,"\uD801\uDCEB"],[66756,1,"\uD801\uDCEC"],[66757,1,"\uD801\uDCED"],[66758,1,"\uD801\uDCEE"],[66759,1,"\uD801\uDCEF"],[66760,1,"\uD801\uDCF0"],[66761,1,"\uD801\uDCF1"],[66762,1,"\uD801\uDCF2"],[66763,1,"\uD801\uDCF3"],[66764,1,"\uD801\uDCF4"],[66765,1,"\uD801\uDCF5"],[66766,1,"\uD801\uDCF6"],[66767,1,"\uD801\uDCF7"],[66768,1,"\uD801\uDCF8"],[66769,1,"\uD801\uDCF9"],[66770,1,"\uD801\uDCFA"],[66771,1,"\uD801\uDCFB"],[[66772,66775],3],[[66776,66811],2],[[66812,66815],3],[[66816,66855],2],[[66856,66863],3],[[66864,66915],2],[[66916,66926],3],[66927,2],[66928,1,"\uD801\uDD97"],[66929,1,"\uD801\uDD98"],[66930,1,"\uD801\uDD99"],[66931,1,"\uD801\uDD9A"],[66932,1,"\uD801\uDD9B"],[66933,1,"\uD801\uDD9C"],[66934,1,"\uD801\uDD9D"],[66935,1,"\uD801\uDD9E"],[66936,1,"\uD801\uDD9F"],[66937,1,"\uD801\uDDA0"],[66938,1,"\uD801\uDDA1"],[66939,3],[66940,1,"\uD801\uDDA3"],[66941,1,"\uD801\uDDA4"],[66942,1,"\uD801\uDDA5"],[66943,1,"\uD801\uDDA6"],[66944,1,"\uD801\uDDA7"],[66945,1,"\uD801\uDDA8"],[66946,1,"\uD801\uDDA9"],[66947,1,"\uD801\uDDAA"],[66948,1,"\uD801\uDDAB"],[66949,1,"\uD801\uDDAC"],[66950,1,"\uD801\uDDAD"],[66951,1,"\uD801\uDDAE"],[66952,1,"\uD801\uDDAF"],[66953,1,"\uD801\uDDB0"],[66954,1,"\uD801\uDDB1"],[66955,3],[66956,1,"\uD801\uDDB3"],[66957,1,"\uD801\uDDB4"],[66958,1,"\uD801\uDDB5"],[66959,1,"\uD801\uDDB6"],[66960,1,"\uD801\uDDB7"],[66961,1,"\uD801\uDDB8"],[66962,1,"\uD801\uDDB9"],[66963,3],[66964,1,"\uD801\uDDBB"],[66965,1,"\uD801\uDDBC"],[66966,3],[[66967,66977],2],[66978,3],[[66979,66993],2],[66994,3],[[66995,67001],2],[67002,3],[[67003,67004],2],[[67005,67007],3],[[67008,67059],2],[[67060,67071],3],[[67072,67382],2],[[67383,67391],3],[[67392,67413],2],[[67414,67423],3],[[67424,67431],2],[[67432,67455],3],[67456,2],[67457,1,"\u02D0"],[67458,1,"\u02D1"],[67459,1,"\xE6"],[67460,1,"\u0299"],[67461,1,"\u0253"],[67462,3],[67463,1,"\u02A3"],[67464,1,"\uAB66"],[67465,1,"\u02A5"],[67466,1,"\u02A4"],[67467,1,"\u0256"],[67468,1,"\u0257"],[67469,1,"\u1D91"],[67470,1,"\u0258"],[67471,1,"\u025E"],[67472,1,"\u02A9"],[67473,1,"\u0264"],[67474,1,"\u0262"],[67475,1,"\u0260"],[67476,1,"\u029B"],[67477,1,"\u0127"],[67478,1,"\u029C"],[67479,1,"\u0267"],[67480,1,"\u0284"],[67481,1,"\u02AA"],[67482,1,"\u02AB"],[67483,1,"\u026C"],[67484,1,"\uD837\uDF04"],[67485,1,"\uA78E"],[67486,1,"\u026E"],[67487,1,"\uD837\uDF05"],[67488,1,"\u028E"],[67489,1,"\uD837\uDF06"],[67490,1,"\xF8"],[67491,1,"\u0276"],[67492,1,"\u0277"],[67493,1,"q"],[67494,1,"\u027A"],[67495,1,"\uD837\uDF08"],[67496,1,"\u027D"],[67497,1,"\u027E"],[67498,1,"\u0280"],[67499,1,"\u02A8"],[67500,1,"\u02A6"],[67501,1,"\uAB67"],[67502,1,"\u02A7"],[67503,1,"\u0288"],[67504,1,"\u2C71"],[67505,3],[67506,1,"\u028F"],[67507,1,"\u02A1"],[67508,1,"\u02A2"],[67509,1,"\u0298"],[67510,1,"\u01C0"],[67511,1,"\u01C1"],[67512,1,"\u01C2"],[67513,1,"\uD837\uDF0A"],[67514,1,"\uD837\uDF1E"],[[67515,67583],3],[[67584,67589],2],[[67590,67591],3],[67592,2],[67593,3],[[67594,67637],2],[67638,3],[[67639,67640],2],[[67641,67643],3],[67644,2],[[67645,67646],3],[67647,2],[[67648,67669],2],[67670,3],[[67671,67679],2],[[67680,67702],2],[[67703,67711],2],[[67712,67742],2],[[67743,67750],3],[[67751,67759],2],[[67760,67807],3],[[67808,67826],2],[67827,3],[[67828,67829],2],[[67830,67834],3],[[67835,67839],2],[[67840,67861],2],[[67862,67865],2],[[67866,67867],2],[[67868,67870],3],[67871,2],[[67872,67897],2],[[67898,67902],3],[67903,2],[[67904,67929],2],[[67930,67967],3],[[67968,68023],2],[[68024,68027],3],[[68028,68029],2],[[68030,68031],2],[[68032,68047],2],[[68048,68049],3],[[68050,68095],2],[[68096,68099],2],[68100,3],[[68101,68102],2],[[68103,68107],3],[[68108,68115],2],[68116,3],[[68117,68119],2],[68120,3],[[68121,68147],2],[[68148,68149],2],[[68150,68151],3],[[68152,68154],2],[[68155,68158],3],[68159,2],[[68160,68167],2],[68168,2],[[68169,68175],3],[[68176,68184],2],[[68185,68191],3],[[68192,68220],2],[[68221,68223],2],[[68224,68252],2],[[68253,68255],2],[[68256,68287],3],[[68288,68295],2],[68296,2],[[68297,68326],2],[[68327,68330],3],[[68331,68342],2],[[68343,68351],3],[[68352,68405],2],[[68406,68408],3],[[68409,68415],2],[[68416,68437],2],[[68438,68439],3],[[68440,68447],2],[[68448,68466],2],[[68467,68471],3],[[68472,68479],2],[[68480,68497],2],[[68498,68504],3],[[68505,68508],2],[[68509,68520],3],[[68521,68527],2],[[68528,68607],3],[[68608,68680],2],[[68681,68735],3],[68736,1,"\uD803\uDCC0"],[68737,1,"\uD803\uDCC1"],[68738,1,"\uD803\uDCC2"],[68739,1,"\uD803\uDCC3"],[68740,1,"\uD803\uDCC4"],[68741,1,"\uD803\uDCC5"],[68742,1,"\uD803\uDCC6"],[68743,1,"\uD803\uDCC7"],[68744,1,"\uD803\uDCC8"],[68745,1,"\uD803\uDCC9"],[68746,1,"\uD803\uDCCA"],[68747,1,"\uD803\uDCCB"],[68748,1,"\uD803\uDCCC"],[68749,1,"\uD803\uDCCD"],[68750,1,"\uD803\uDCCE"],[68751,1,"\uD803\uDCCF"],[68752,1,"\uD803\uDCD0"],[68753,1,"\uD803\uDCD1"],[68754,1,"\uD803\uDCD2"],[68755,1,"\uD803\uDCD3"],[68756,1,"\uD803\uDCD4"],[68757,1,"\uD803\uDCD5"],[68758,1,"\uD803\uDCD6"],[68759,1,"\uD803\uDCD7"],[68760,1,"\uD803\uDCD8"],[68761,1,"\uD803\uDCD9"],[68762,1,"\uD803\uDCDA"],[68763,1,"\uD803\uDCDB"],[68764,1,"\uD803\uDCDC"],[68765,1,"\uD803\uDCDD"],[68766,1,"\uD803\uDCDE"],[68767,1,"\uD803\uDCDF"],[68768,1,"\uD803\uDCE0"],[68769,1,"\uD803\uDCE1"],[68770,1,"\uD803\uDCE2"],[68771,1,"\uD803\uDCE3"],[68772,1,"\uD803\uDCE4"],[68773,1,"\uD803\uDCE5"],[68774,1,"\uD803\uDCE6"],[68775,1,"\uD803\uDCE7"],[68776,1,"\uD803\uDCE8"],[68777,1,"\uD803\uDCE9"],[68778,1,"\uD803\uDCEA"],[68779,1,"\uD803\uDCEB"],[68780,1,"\uD803\uDCEC"],[68781,1,"\uD803\uDCED"],[68782,1,"\uD803\uDCEE"],[68783,1,"\uD803\uDCEF"],[68784,1,"\uD803\uDCF0"],[68785,1,"\uD803\uDCF1"],[68786,1,"\uD803\uDCF2"],[[68787,68799],3],[[68800,68850],2],[[68851,68857],3],[[68858,68863],2],[[68864,68903],2],[[68904,68911],3],[[68912,68921],2],[[68922,68927],3],[[68928,68943],2],[68944,1,"\uD803\uDD70"],[68945,1,"\uD803\uDD71"],[68946,1,"\uD803\uDD72"],[68947,1,"\uD803\uDD73"],[68948,1,"\uD803\uDD74"],[68949,1,"\uD803\uDD75"],[68950,1,"\uD803\uDD76"],[68951,1,"\uD803\uDD77"],[68952,1,"\uD803\uDD78"],[68953,1,"\uD803\uDD79"],[68954,1,"\uD803\uDD7A"],[68955,1,"\uD803\uDD7B"],[68956,1,"\uD803\uDD7C"],[68957,1,"\uD803\uDD7D"],[68958,1,"\uD803\uDD7E"],[68959,1,"\uD803\uDD7F"],[68960,1,"\uD803\uDD80"],[68961,1,"\uD803\uDD81"],[68962,1,"\uD803\uDD82"],[68963,1,"\uD803\uDD83"],[68964,1,"\uD803\uDD84"],[68965,1,"\uD803\uDD85"],[[68966,68968],3],[[68969,68973],2],[68974,2],[[68975,68997],2],[[68998,69005],3],[[69006,69007],2],[[69008,69215],3],[[69216,69246],2],[69247,3],[[69248,69289],2],[69290,3],[[69291,69292],2],[69293,2],[[69294,69295],3],[[69296,69297],2],[[69298,69313],3],[[69314,69316],2],[[69317,69319],2],[[69320,69327],3],[[69328,69336],2],[[69337,69369],3],[[69370,69371],2],[69372,2],[[69373,69375],2],[[69376,69404],2],[[69405,69414],2],[69415,2],[[69416,69423],3],[[69424,69456],2],[[69457,69465],2],[[69466,69487],3],[[69488,69509],2],[[69510,69513],2],[[69514,69551],3],[[69552,69572],2],[[69573,69579],2],[[69580,69599],3],[[69600,69622],2],[[69623,69631],3],[[69632,69702],2],[[69703,69709],2],[[69710,69713],3],[[69714,69733],2],[[69734,69743],2],[[69744,69749],2],[[69750,69758],3],[69759,2],[[69760,69818],2],[[69819,69820],2],[69821,3],[[69822,69825],2],[69826,2],[[69827,69836],3],[69837,3],[[69838,69839],3],[[69840,69864],2],[[69865,69871],3],[[69872,69881],2],[[69882,69887],3],[[69888,69940],2],[69941,3],[[69942,69951],2],[[69952,69955],2],[[69956,69958],2],[69959,2],[[69960,69967],3],[[69968,70003],2],[[70004,70005],2],[70006,2],[[70007,70015],3],[[70016,70084],2],[[70085,70088],2],[[70089,70092],2],[70093,2],[[70094,70095],2],[[70096,70105],2],[70106,2],[70107,2],[70108,2],[[70109,70111],2],[70112,3],[[70113,70132],2],[[70133,70143],3],[[70144,70161],2],[70162,3],[[70163,70199],2],[[70200,70205],2],[70206,2],[[70207,70209],2],[[70210,70271],3],[[70272,70278],2],[70279,3],[70280,2],[70281,3],[[70282,70285],2],[70286,3],[[70287,70301],2],[70302,3],[[70303,70312],2],[70313,2],[[70314,70319],3],[[70320,70378],2],[[70379,70383],3],[[70384,70393],2],[[70394,70399],3],[70400,2],[[70401,70403],2],[70404,3],[[70405,70412],2],[[70413,70414],3],[[70415,70416],2],[[70417,70418],3],[[70419,70440],2],[70441,3],[[70442,70448],2],[70449,3],[[70450,70451],2],[70452,3],[[70453,70457],2],[70458,3],[70459,2],[[70460,70468],2],[[70469,70470],3],[[70471,70472],2],[[70473,70474],3],[[70475,70477],2],[[70478,70479],3],[70480,2],[[70481,70486],3],[70487,2],[[70488,70492],3],[[70493,70499],2],[[70500,70501],3],[[70502,70508],2],[[70509,70511],3],[[70512,70516],2],[[70517,70527],3],[[70528,70537],2],[70538,3],[70539,2],[[70540,70541],3],[70542,2],[70543,3],[[70544,70581],2],[70582,3],[[70583,70592],2],[70593,3],[70594,2],[[70595,70596],3],[70597,2],[70598,3],[[70599,70602],2],[70603,3],[[70604,70611],2],[[70612,70613],2],[70614,3],[[70615,70616],2],[[70617,70624],3],[[70625,70626],2],[[70627,70655],3],[[70656,70730],2],[[70731,70735],2],[[70736,70745],2],[70746,2],[70747,2],[70748,3],[70749,2],[70750,2],[70751,2],[[70752,70753],2],[[70754,70783],3],[[70784,70853],2],[70854,2],[70855,2],[[70856,70863],3],[[70864,70873],2],[[70874,71039],3],[[71040,71093],2],[[71094,71095],3],[[71096,71104],2],[[71105,71113],2],[[71114,71127],2],[[71128,71133],2],[[71134,71167],3],[[71168,71232],2],[[71233,71235],2],[71236,2],[[71237,71247],3],[[71248,71257],2],[[71258,71263],3],[[71264,71276],2],[[71277,71295],3],[[71296,71351],2],[71352,2],[71353,2],[[71354,71359],3],[[71360,71369],2],[[71370,71375],3],[[71376,71395],2],[[71396,71423],3],[[71424,71449],2],[71450,2],[[71451,71452],3],[[71453,71467],2],[[71468,71471],3],[[71472,71481],2],[[71482,71487],2],[[71488,71494],2],[[71495,71679],3],[[71680,71738],2],[71739,2],[[71740,71839],3],[71840,1,"\uD806\uDCC0"],[71841,1,"\uD806\uDCC1"],[71842,1,"\uD806\uDCC2"],[71843,1,"\uD806\uDCC3"],[71844,1,"\uD806\uDCC4"],[71845,1,"\uD806\uDCC5"],[71846,1,"\uD806\uDCC6"],[71847,1,"\uD806\uDCC7"],[71848,1,"\uD806\uDCC8"],[71849,1,"\uD806\uDCC9"],[71850,1,"\uD806\uDCCA"],[71851,1,"\uD806\uDCCB"],[71852,1,"\uD806\uDCCC"],[71853,1,"\uD806\uDCCD"],[71854,1,"\uD806\uDCCE"],[71855,1,"\uD806\uDCCF"],[71856,1,"\uD806\uDCD0"],[71857,1,"\uD806\uDCD1"],[71858,1,"\uD806\uDCD2"],[71859,1,"\uD806\uDCD3"],[71860,1,"\uD806\uDCD4"],[71861,1,"\uD806\uDCD5"],[71862,1,"\uD806\uDCD6"],[71863,1,"\uD806\uDCD7"],[71864,1,"\uD806\uDCD8"],[71865,1,"\uD806\uDCD9"],[71866,1,"\uD806\uDCDA"],[71867,1,"\uD806\uDCDB"],[71868,1,"\uD806\uDCDC"],[71869,1,"\uD806\uDCDD"],[71870,1,"\uD806\uDCDE"],[71871,1,"\uD806\uDCDF"],[[71872,71913],2],[[71914,71922],2],[[71923,71934],3],[71935,2],[[71936,71942],2],[[71943,71944],3],[71945,2],[[71946,71947],3],[[71948,71955],2],[71956,3],[[71957,71958],2],[71959,3],[[71960,71989],2],[71990,3],[[71991,71992],2],[[71993,71994],3],[[71995,72003],2],[[72004,72006],2],[[72007,72015],3],[[72016,72025],2],[[72026,72095],3],[[72096,72103],2],[[72104,72105],3],[[72106,72151],2],[[72152,72153],3],[[72154,72161],2],[72162,2],[[72163,72164],2],[[72165,72191],3],[[72192,72254],2],[[72255,72262],2],[72263,2],[[72264,72271],3],[[72272,72323],2],[[72324,72325],2],[[72326,72345],2],[[72346,72348],2],[72349,2],[[72350,72354],2],[[72355,72367],3],[[72368,72383],2],[[72384,72440],2],[[72441,72447],3],[[72448,72457],2],[[72458,72543],3],[[72544,72551],2],[[72552,72639],3],[[72640,72672],2],[72673,2],[[72674,72687],3],[[72688,72697],2],[[72698,72703],3],[[72704,72712],2],[72713,3],[[72714,72758],2],[72759,3],[[72760,72768],2],[[72769,72773],2],[[72774,72783],3],[[72784,72793],2],[[72794,72812],2],[[72813,72815],3],[[72816,72817],2],[[72818,72847],2],[[72848,72849],3],[[72850,72871],2],[72872,3],[[72873,72886],2],[[72887,72959],3],[[72960,72966],2],[72967,3],[[72968,72969],2],[72970,3],[[72971,73014],2],[[73015,73017],3],[73018,2],[73019,3],[[73020,73021],2],[73022,3],[[73023,73031],2],[[73032,73039],3],[[73040,73049],2],[[73050,73055],3],[[73056,73061],2],[73062,3],[[73063,73064],2],[73065,3],[[73066,73102],2],[73103,3],[[73104,73105],2],[73106,3],[[73107,73112],2],[[73113,73119],3],[[73120,73129],2],[[73130,73135],3],[[73136,73179],2],[[73180,73183],3],[[73184,73193],2],[[73194,73439],3],[[73440,73462],2],[[73463,73464],2],[[73465,73471],3],[[73472,73488],2],[73489,3],[[73490,73530],2],[[73531,73533],3],[[73534,73538],2],[[73539,73551],2],[[73552,73561],2],[73562,2],[[73563,73647],3],[73648,2],[[73649,73663],3],[[73664,73713],2],[[73714,73726],3],[73727,2],[[73728,74606],2],[[74607,74648],2],[74649,2],[[74650,74751],3],[[74752,74850],2],[[74851,74862],2],[74863,3],[[74864,74867],2],[74868,2],[[74869,74879],3],[[74880,75075],2],[[75076,77711],3],[[77712,77808],2],[[77809,77810],2],[[77811,77823],3],[[77824,78894],2],[78895,2],[[78896,78904],3],[[78905,78911],3],[[78912,78933],2],[[78934,78943],3],[[78944,82938],2],[[82939,82943],3],[[82944,83526],2],[[83527,90367],3],[[90368,90425],2],[[90426,92159],3],[[92160,92728],2],[[92729,92735],3],[[92736,92766],2],[92767,3],[[92768,92777],2],[[92778,92781],3],[[92782,92783],2],[[92784,92862],2],[92863,3],[[92864,92873],2],[[92874,92879],3],[[92880,92909],2],[[92910,92911],3],[[92912,92916],2],[92917,2],[[92918,92927],3],[[92928,92982],2],[[92983,92991],2],[[92992,92995],2],[[92996,92997],2],[[92998,93007],3],[[93008,93017],2],[93018,3],[[93019,93025],2],[93026,3],[[93027,93047],2],[[93048,93052],3],[[93053,93071],2],[[93072,93503],3],[[93504,93548],2],[[93549,93551],2],[[93552,93561],2],[[93562,93759],3],[93760,1,"\uD81B\uDE60"],[93761,1,"\uD81B\uDE61"],[93762,1,"\uD81B\uDE62"],[93763,1,"\uD81B\uDE63"],[93764,1,"\uD81B\uDE64"],[93765,1,"\uD81B\uDE65"],[93766,1,"\uD81B\uDE66"],[93767,1,"\uD81B\uDE67"],[93768,1,"\uD81B\uDE68"],[93769,1,"\uD81B\uDE69"],[93770,1,"\uD81B\uDE6A"],[93771,1,"\uD81B\uDE6B"],[93772,1,"\uD81B\uDE6C"],[93773,1,"\uD81B\uDE6D"],[93774,1,"\uD81B\uDE6E"],[93775,1,"\uD81B\uDE6F"],[93776,1,"\uD81B\uDE70"],[93777,1,"\uD81B\uDE71"],[93778,1,"\uD81B\uDE72"],[93779,1,"\uD81B\uDE73"],[93780,1,"\uD81B\uDE74"],[93781,1,"\uD81B\uDE75"],[93782,1,"\uD81B\uDE76"],[93783,1,"\uD81B\uDE77"],[93784,1,"\uD81B\uDE78"],[93785,1,"\uD81B\uDE79"],[93786,1,"\uD81B\uDE7A"],[93787,1,"\uD81B\uDE7B"],[93788,1,"\uD81B\uDE7C"],[93789,1,"\uD81B\uDE7D"],[93790,1,"\uD81B\uDE7E"],[93791,1,"\uD81B\uDE7F"],[[93792,93823],2],[[93824,93850],2],[[93851,93855],3],[93856,1,"\uD81B\uDEBB"],[93857,1,"\uD81B\uDEBC"],[93858,1,"\uD81B\uDEBD"],[93859,1,"\uD81B\uDEBE"],[93860,1,"\uD81B\uDEBF"],[93861,1,"\uD81B\uDEC0"],[93862,1,"\uD81B\uDEC1"],[93863,1,"\uD81B\uDEC2"],[93864,1,"\uD81B\uDEC3"],[93865,1,"\uD81B\uDEC4"],[93866,1,"\uD81B\uDEC5"],[93867,1,"\uD81B\uDEC6"],[93868,1,"\uD81B\uDEC7"],[93869,1,"\uD81B\uDEC8"],[93870,1,"\uD81B\uDEC9"],[93871,1,"\uD81B\uDECA"],[93872,1,"\uD81B\uDECB"],[93873,1,"\uD81B\uDECC"],[93874,1,"\uD81B\uDECD"],[93875,1,"\uD81B\uDECE"],[93876,1,"\uD81B\uDECF"],[93877,1,"\uD81B\uDED0"],[93878,1,"\uD81B\uDED1"],[93879,1,"\uD81B\uDED2"],[93880,1,"\uD81B\uDED3"],[[93881,93882],3],[[93883,93907],2],[[93908,93951],3],[[93952,94020],2],[[94021,94026],2],[[94027,94030],3],[94031,2],[[94032,94078],2],[[94079,94087],2],[[94088,94094],3],[[94095,94111],2],[[94112,94175],3],[94176,2],[94177,2],[94178,2],[94179,2],[94180,2],[[94181,94191],3],[[94192,94193],2],[[94194,94195],2],[[94196,94198],2],[[94199,94207],3],[[94208,100332],2],[[100333,100337],2],[[100338,100343],2],[[100344,100351],2],[[100352,101106],2],[[101107,101589],2],[[101590,101630],3],[101631,2],[[101632,101640],2],[[101641,101662],2],[[101663,101759],3],[[101760,101874],2],[[101875,110575],3],[[110576,110579],2],[110580,3],[[110581,110587],2],[110588,3],[[110589,110590],2],[110591,3],[[110592,110593],2],[[110594,110878],2],[[110879,110882],2],[[110883,110897],3],[110898,2],[[110899,110927],3],[[110928,110930],2],[[110931,110932],3],[110933,2],[[110934,110947],3],[[110948,110951],2],[[110952,110959],3],[[110960,111355],2],[[111356,113663],3],[[113664,113770],2],[[113771,113775],3],[[113776,113788],2],[[113789,113791],3],[[113792,113800],2],[[113801,113807],3],[[113808,113817],2],[[113818,113819],3],[113820,2],[[113821,113822],2],[113823,2],[[113824,113827],7],[[113828,117759],3],[[117760,117973],2],[117974,1,"a"],[117975,1,"b"],[117976,1,"c"],[117977,1,"d"],[117978,1,"e"],[117979,1,"f"],[117980,1,"g"],[117981,1,"h"],[117982,1,"i"],[117983,1,"j"],[117984,1,"k"],[117985,1,"l"],[117986,1,"m"],[117987,1,"n"],[117988,1,"o"],[117989,1,"p"],[117990,1,"q"],[117991,1,"r"],[117992,1,"s"],[117993,1,"t"],[117994,1,"u"],[117995,1,"v"],[117996,1,"w"],[117997,1,"x"],[117998,1,"y"],[117999,1,"z"],[118000,1,"0"],[118001,1,"1"],[118002,1,"2"],[118003,1,"3"],[118004,1,"4"],[118005,1,"5"],[118006,1,"6"],[118007,1,"7"],[118008,1,"8"],[118009,1,"9"],[[118010,118012],2],[[118013,118015],3],[[118016,118451],2],[[118452,118457],3],[[118458,118480],2],[[118481,118495],3],[[118496,118512],2],[[118513,118527],3],[[118528,118573],2],[[118574,118575],3],[[118576,118598],2],[[118599,118607],3],[[118608,118723],2],[[118724,118783],3],[[118784,119029],2],[[119030,119039],3],[[119040,119078],2],[[119079,119080],3],[119081,2],[[119082,119133],2],[119134,1,"\uD834\uDD57\uD834\uDD65"],[119135,1,"\uD834\uDD58\uD834\uDD65"],[119136,1,"\uD834\uDD58\uD834\uDD65\uD834\uDD6E"],[119137,1,"\uD834\uDD58\uD834\uDD65\uD834\uDD6F"],[119138,1,"\uD834\uDD58\uD834\uDD65\uD834\uDD70"],[119139,1,"\uD834\uDD58\uD834\uDD65\uD834\uDD71"],[119140,1,"\uD834\uDD58\uD834\uDD65\uD834\uDD72"],[[119141,119154],2],[[119155,119162],7],[[119163,119226],2],[119227,1,"\uD834\uDDB9\uD834\uDD65"],[119228,1,"\uD834\uDDBA\uD834\uDD65"],[119229,1,"\uD834\uDDB9\uD834\uDD65\uD834\uDD6E"],[119230,1,"\uD834\uDDBA\uD834\uDD65\uD834\uDD6E"],[119231,1,"\uD834\uDDB9\uD834\uDD65\uD834\uDD6F"],[119232,1,"\uD834\uDDBA\uD834\uDD65\uD834\uDD6F"],[[119233,119261],2],[[119262,119272],2],[[119273,119274],2],[[119275,119295],3],[[119296,119365],2],[[119366,119487],3],[[119488,119507],2],[[119508,119519],3],[[119520,119539],2],[[119540,119551],3],[[119552,119638],2],[[119639,119647],3],[[119648,119665],2],[[119666,119672],2],[[119673,119807],3],[119808,1,"a"],[119809,1,"b"],[119810,1,"c"],[119811,1,"d"],[119812,1,"e"],[119813,1,"f"],[119814,1,"g"],[119815,1,"h"],[119816,1,"i"],[119817,1,"j"],[119818,1,"k"],[119819,1,"l"],[119820,1,"m"],[119821,1,"n"],[119822,1,"o"],[119823,1,"p"],[119824,1,"q"],[119825,1,"r"],[119826,1,"s"],[119827,1,"t"],[119828,1,"u"],[119829,1,"v"],[119830,1,"w"],[119831,1,"x"],[119832,1,"y"],[119833,1,"z"],[119834,1,"a"],[119835,1,"b"],[119836,1,"c"],[119837,1,"d"],[119838,1,"e"],[119839,1,"f"],[119840,1,"g"],[119841,1,"h"],[119842,1,"i"],[119843,1,"j"],[119844,1,"k"],[119845,1,"l"],[119846,1,"m"],[119847,1,"n"],[119848,1,"o"],[119849,1,"p"],[119850,1,"q"],[119851,1,"r"],[119852,1,"s"],[119853,1,"t"],[119854,1,"u"],[119855,1,"v"],[119856,1,"w"],[119857,1,"x"],[119858,1,"y"],[119859,1,"z"],[119860,1,"a"],[119861,1,"b"],[119862,1,"c"],[119863,1,"d"],[119864,1,"e"],[119865,1,"f"],[119866,1,"g"],[119867,1,"h"],[119868,1,"i"],[119869,1,"j"],[119870,1,"k"],[119871,1,"l"],[119872,1,"m"],[119873,1,"n"],[119874,1,"o"],[119875,1,"p"],[119876,1,"q"],[119877,1,"r"],[119878,1,"s"],[119879,1,"t"],[119880,1,"u"],[119881,1,"v"],[119882,1,"w"],[119883,1,"x"],[119884,1,"y"],[119885,1,"z"],[119886,1,"a"],[119887,1,"b"],[119888,1,"c"],[119889,1,"d"],[119890,1,"e"],[119891,1,"f"],[119892,1,"g"],[119893,3],[119894,1,"i"],[119895,1,"j"],[119896,1,"k"],[119897,1,"l"],[119898,1,"m"],[119899,1,"n"],[119900,1,"o"],[119901,1,"p"],[119902,1,"q"],[119903,1,"r"],[119904,1,"s"],[119905,1,"t"],[119906,1,"u"],[119907,1,"v"],[119908,1,"w"],[119909,1,"x"],[119910,1,"y"],[119911,1,"z"],[119912,1,"a"],[119913,1,"b"],[119914,1,"c"],[119915,1,"d"],[119916,1,"e"],[119917,1,"f"],[119918,1,"g"],[119919,1,"h"],[119920,1,"i"],[119921,1,"j"],[119922,1,"k"],[119923,1,"l"],[119924,1,"m"],[119925,1,"n"],[119926,1,"o"],[119927,1,"p"],[119928,1,"q"],[119929,1,"r"],[119930,1,"s"],[119931,1,"t"],[119932,1,"u"],[119933,1,"v"],[119934,1,"w"],[119935,1,"x"],[119936,1,"y"],[119937,1,"z"],[119938,1,"a"],[119939,1,"b"],[119940,1,"c"],[119941,1,"d"],[119942,1,"e"],[119943,1,"f"],[119944,1,"g"],[119945,1,"h"],[119946,1,"i"],[119947,1,"j"],[119948,1,"k"],[119949,1,"l"],[119950,1,"m"],[119951,1,"n"],[119952,1,"o"],[119953,1,"p"],[119954,1,"q"],[119955,1,"r"],[119956,1,"s"],[119957,1,"t"],[119958,1,"u"],[119959,1,"v"],[119960,1,"w"],[119961,1,"x"],[119962,1,"y"],[119963,1,"z"],[119964,1,"a"],[119965,3],[119966,1,"c"],[119967,1,"d"],[[119968,119969],3],[119970,1,"g"],[[119971,119972],3],[119973,1,"j"],[119974,1,"k"],[[119975,119976],3],[119977,1,"n"],[119978,1,"o"],[119979,1,"p"],[119980,1,"q"],[119981,3],[119982,1,"s"],[119983,1,"t"],[119984,1,"u"],[119985,1,"v"],[119986,1,"w"],[119987,1,"x"],[119988,1,"y"],[119989,1,"z"],[119990,1,"a"],[119991,1,"b"],[119992,1,"c"],[119993,1,"d"],[119994,3],[119995,1,"f"],[119996,3],[119997,1,"h"],[119998,1,"i"],[119999,1,"j"],[120000,1,"k"],[120001,1,"l"],[120002,1,"m"],[120003,1,"n"],[120004,3],[120005,1,"p"],[120006,1,"q"],[120007,1,"r"],[120008,1,"s"],[120009,1,"t"],[120010,1,"u"],[120011,1,"v"],[120012,1,"w"],[120013,1,"x"],[120014,1,"y"],[120015,1,"z"],[120016,1,"a"],[120017,1,"b"],[120018,1,"c"],[120019,1,"d"],[120020,1,"e"],[120021,1,"f"],[120022,1,"g"],[120023,1,"h"],[120024,1,"i"],[120025,1,"j"],[120026,1,"k"],[120027,1,"l"],[120028,1,"m"],[120029,1,"n"],[120030,1,"o"],[120031,1,"p"],[120032,1,"q"],[120033,1,"r"],[120034,1,"s"],[120035,1,"t"],[120036,1,"u"],[120037,1,"v"],[120038,1,"w"],[120039,1,"x"],[120040,1,"y"],[120041,1,"z"],[120042,1,"a"],[120043,1,"b"],[120044,1,"c"],[120045,1,"d"],[120046,1,"e"],[120047,1,"f"],[120048,1,"g"],[120049,1,"h"],[120050,1,"i"],[120051,1,"j"],[120052,1,"k"],[120053,1,"l"],[120054,1,"m"],[120055,1,"n"],[120056,1,"o"],[120057,1,"p"],[120058,1,"q"],[120059,1,"r"],[120060,1,"s"],[120061,1,"t"],[120062,1,"u"],[120063,1,"v"],[120064,1,"w"],[120065,1,"x"],[120066,1,"y"],[120067,1,"z"],[120068,1,"a"],[120069,1,"b"],[120070,3],[120071,1,"d"],[120072,1,"e"],[120073,1,"f"],[120074,1,"g"],[[120075,120076],3],[120077,1,"j"],[120078,1,"k"],[120079,1,"l"],[120080,1,"m"],[120081,1,"n"],[120082,1,"o"],[120083,1,"p"],[120084,1,"q"],[120085,3],[120086,1,"s"],[120087,1,"t"],[120088,1,"u"],[120089,1,"v"],[120090,1,"w"],[120091,1,"x"],[120092,1,"y"],[120093,3],[120094,1,"a"],[120095,1,"b"],[120096,1,"c"],[120097,1,"d"],[120098,1,"e"],[120099,1,"f"],[120100,1,"g"],[120101,1,"h"],[120102,1,"i"],[120103,1,"j"],[120104,1,"k"],[120105,1,"l"],[120106,1,"m"],[120107,1,"n"],[120108,1,"o"],[120109,1,"p"],[120110,1,"q"],[120111,1,"r"],[120112,1,"s"],[120113,1,"t"],[120114,1,"u"],[120115,1,"v"],[120116,1,"w"],[120117,1,"x"],[120118,1,"y"],[120119,1,"z"],[120120,1,"a"],[120121,1,"b"],[120122,3],[120123,1,"d"],[120124,1,"e"],[120125,1,"f"],[120126,1,"g"],[120127,3],[120128,1,"i"],[120129,1,"j"],[120130,1,"k"],[120131,1,"l"],[120132,1,"m"],[120133,3],[120134,1,"o"],[[120135,120137],3],[120138,1,"s"],[120139,1,"t"],[120140,1,"u"],[120141,1,"v"],[120142,1,"w"],[120143,1,"x"],[120144,1,"y"],[120145,3],[120146,1,"a"],[120147,1,"b"],[120148,1,"c"],[120149,1,"d"],[120150,1,"e"],[120151,1,"f"],[120152,1,"g"],[120153,1,"h"],[120154,1,"i"],[120155,1,"j"],[120156,1,"k"],[120157,1,"l"],[120158,1,"m"],[120159,1,"n"],[120160,1,"o"],[120161,1,"p"],[120162,1,"q"],[120163,1,"r"],[120164,1,"s"],[120165,1,"t"],[120166,1,"u"],[120167,1,"v"],[120168,1,"w"],[120169,1,"x"],[120170,1,"y"],[120171,1,"z"],[120172,1,"a"],[120173,1,"b"],[120174,1,"c"],[120175,1,"d"],[120176,1,"e"],[120177,1,"f"],[120178,1,"g"],[120179,1,"h"],[120180,1,"i"],[120181,1,"j"],[120182,1,"k"],[120183,1,"l"],[120184,1,"m"],[120185,1,"n"],[120186,1,"o"],[120187,1,"p"],[120188,1,"q"],[120189,1,"r"],[120190,1,"s"],[120191,1,"t"],[120192,1,"u"],[120193,1,"v"],[120194,1,"w"],[120195,1,"x"],[120196,1,"y"],[120197,1,"z"],[120198,1,"a"],[120199,1,"b"],[120200,1,"c"],[120201,1,"d"],[120202,1,"e"],[120203,1,"f"],[120204,1,"g"],[120205,1,"h"],[120206,1,"i"],[120207,1,"j"],[120208,1,"k"],[120209,1,"l"],[120210,1,"m"],[120211,1,"n"],[120212,1,"o"],[120213,1,"p"],[120214,1,"q"],[120215,1,"r"],[120216,1,"s"],[120217,1,"t"],[120218,1,"u"],[120219,1,"v"],[120220,1,"w"],[120221,1,"x"],[120222,1,"y"],[120223,1,"z"],[120224,1,"a"],[120225,1,"b"],[120226,1,"c"],[120227,1,"d"],[120228,1,"e"],[120229,1,"f"],[120230,1,"g"],[120231,1,"h"],[120232,1,"i"],[120233,1,"j"],[120234,1,"k"],[120235,1,"l"],[120236,1,"m"],[120237,1,"n"],[120238,1,"o"],[120239,1,"p"],[120240,1,"q"],[120241,1,"r"],[120242,1,"s"],[120243,1,"t"],[120244,1,"u"],[120245,1,"v"],[120246,1,"w"],[120247,1,"x"],[120248,1,"y"],[120249,1,"z"],[120250,1,"a"],[120251,1,"b"],[120252,1,"c"],[120253,1,"d"],[120254,1,"e"],[120255,1,"f"],[120256,1,"g"],[120257,1,"h"],[120258,1,"i"],[120259,1,"j"],[120260,1,"k"],[120261,1,"l"],[120262,1,"m"],[120263,1,"n"],[120264,1,"o"],[120265,1,"p"],[120266,1,"q"],[120267,1,"r"],[120268,1,"s"],[120269,1,"t"],[120270,1,"u"],[120271,1,"v"],[120272,1,"w"],[120273,1,"x"],[120274,1,"y"],[120275,1,"z"],[120276,1,"a"],[120277,1,"b"],[120278,1,"c"],[120279,1,"d"],[120280,1,"e"],[120281,1,"f"],[120282,1,"g"],[120283,1,"h"],[120284,1,"i"],[120285,1,"j"],[120286,1,"k"],[120287,1,"l"],[120288,1,"m"],[120289,1,"n"],[120290,1,"o"],[120291,1,"p"],[120292,1,"q"],[120293,1,"r"],[120294,1,"s"],[120295,1,"t"],[120296,1,"u"],[120297,1,"v"],[120298,1,"w"],[120299,1,"x"],[120300,1,"y"],[120301,1,"z"],[120302,1,"a"],[120303,1,"b"],[120304,1,"c"],[120305,1,"d"],[120306,1,"e"],[120307,1,"f"],[120308,1,"g"],[120309,1,"h"],[120310,1,"i"],[120311,1,"j"],[120312,1,"k"],[120313,1,"l"],[120314,1,"m"],[120315,1,"n"],[120316,1,"o"],[120317,1,"p"],[120318,1,"q"],[120319,1,"r"],[120320,1,"s"],[120321,1,"t"],[120322,1,"u"],[120323,1,"v"],[120324,1,"w"],[120325,1,"x"],[120326,1,"y"],[120327,1,"z"],[120328,1,"a"],[120329,1,"b"],[120330,1,"c"],[120331,1,"d"],[120332,1,"e"],[120333,1,"f"],[120334,1,"g"],[120335,1,"h"],[120336,1,"i"],[120337,1,"j"],[120338,1,"k"],[120339,1,"l"],[120340,1,"m"],[120341,1,"n"],[120342,1,"o"],[120343,1,"p"],[120344,1,"q"],[120345,1,"r"],[120346,1,"s"],[120347,1,"t"],[120348,1,"u"],[120349,1,"v"],[120350,1,"w"],[120351,1,"x"],[120352,1,"y"],[120353,1,"z"],[120354,1,"a"],[120355,1,"b"],[120356,1,"c"],[120357,1,"d"],[120358,1,"e"],[120359,1,"f"],[120360,1,"g"],[120361,1,"h"],[120362,1,"i"],[120363,1,"j"],[120364,1,"k"],[120365,1,"l"],[120366,1,"m"],[120367,1,"n"],[120368,1,"o"],[120369,1,"p"],[120370,1,"q"],[120371,1,"r"],[120372,1,"s"],[120373,1,"t"],[120374,1,"u"],[120375,1,"v"],[120376,1,"w"],[120377,1,"x"],[120378,1,"y"],[120379,1,"z"],[120380,1,"a"],[120381,1,"b"],[120382,1,"c"],[120383,1,"d"],[120384,1,"e"],[120385,1,"f"],[120386,1,"g"],[120387,1,"h"],[120388,1,"i"],[120389,1,"j"],[120390,1,"k"],[120391,1,"l"],[120392,1,"m"],[120393,1,"n"],[120394,1,"o"],[120395,1,"p"],[120396,1,"q"],[120397,1,"r"],[120398,1,"s"],[120399,1,"t"],[120400,1,"u"],[120401,1,"v"],[120402,1,"w"],[120403,1,"x"],[120404,1,"y"],[120405,1,"z"],[120406,1,"a"],[120407,1,"b"],[120408,1,"c"],[120409,1,"d"],[120410,1,"e"],[120411,1,"f"],[120412,1,"g"],[120413,1,"h"],[120414,1,"i"],[120415,1,"j"],[120416,1,"k"],[120417,1,"l"],[120418,1,"m"],[120419,1,"n"],[120420,1,"o"],[120421,1,"p"],[120422,1,"q"],[120423,1,"r"],[120424,1,"s"],[120425,1,"t"],[120426,1,"u"],[120427,1,"v"],[120428,1,"w"],[120429,1,"x"],[120430,1,"y"],[120431,1,"z"],[120432,1,"a"],[120433,1,"b"],[120434,1,"c"],[120435,1,"d"],[120436,1,"e"],[120437,1,"f"],[120438,1,"g"],[120439,1,"h"],[120440,1,"i"],[120441,1,"j"],[120442,1,"k"],[120443,1,"l"],[120444,1,"m"],[120445,1,"n"],[120446,1,"o"],[120447,1,"p"],[120448,1,"q"],[120449,1,"r"],[120450,1,"s"],[120451,1,"t"],[120452,1,"u"],[120453,1,"v"],[120454,1,"w"],[120455,1,"x"],[120456,1,"y"],[120457,1,"z"],[120458,1,"a"],[120459,1,"b"],[120460,1,"c"],[120461,1,"d"],[120462,1,"e"],[120463,1,"f"],[120464,1,"g"],[120465,1,"h"],[120466,1,"i"],[120467,1,"j"],[120468,1,"k"],[120469,1,"l"],[120470,1,"m"],[120471,1,"n"],[120472,1,"o"],[120473,1,"p"],[120474,1,"q"],[120475,1,"r"],[120476,1,"s"],[120477,1,"t"],[120478,1,"u"],[120479,1,"v"],[120480,1,"w"],[120481,1,"x"],[120482,1,"y"],[120483,1,"z"],[120484,1,"\u0131"],[120485,1,"\u0237"],[[120486,120487],3],[120488,1,"\u03B1"],[120489,1,"\u03B2"],[120490,1,"\u03B3"],[120491,1,"\u03B4"],[120492,1,"\u03B5"],[120493,1,"\u03B6"],[120494,1,"\u03B7"],[120495,1,"\u03B8"],[120496,1,"\u03B9"],[120497,1,"\u03BA"],[120498,1,"\u03BB"],[120499,1,"\u03BC"],[120500,1,"\u03BD"],[120501,1,"\u03BE"],[120502,1,"\u03BF"],[120503,1,"\u03C0"],[120504,1,"\u03C1"],[120505,1,"\u03B8"],[120506,1,"\u03C3"],[120507,1,"\u03C4"],[120508,1,"\u03C5"],[120509,1,"\u03C6"],[120510,1,"\u03C7"],[120511,1,"\u03C8"],[120512,1,"\u03C9"],[120513,1,"\u2207"],[120514,1,"\u03B1"],[120515,1,"\u03B2"],[120516,1,"\u03B3"],[120517,1,"\u03B4"],[120518,1,"\u03B5"],[120519,1,"\u03B6"],[120520,1,"\u03B7"],[120521,1,"\u03B8"],[120522,1,"\u03B9"],[120523,1,"\u03BA"],[120524,1,"\u03BB"],[120525,1,"\u03BC"],[120526,1,"\u03BD"],[120527,1,"\u03BE"],[120528,1,"\u03BF"],[120529,1,"\u03C0"],[120530,1,"\u03C1"],[[120531,120532],1,"\u03C3"],[120533,1,"\u03C4"],[120534,1,"\u03C5"],[120535,1,"\u03C6"],[120536,1,"\u03C7"],[120537,1,"\u03C8"],[120538,1,"\u03C9"],[120539,1,"\u2202"],[120540,1,"\u03B5"],[120541,1,"\u03B8"],[120542,1,"\u03BA"],[120543,1,"\u03C6"],[120544,1,"\u03C1"],[120545,1,"\u03C0"],[120546,1,"\u03B1"],[120547,1,"\u03B2"],[120548,1,"\u03B3"],[120549,1,"\u03B4"],[120550,1,"\u03B5"],[120551,1,"\u03B6"],[120552,1,"\u03B7"],[120553,1,"\u03B8"],[120554,1,"\u03B9"],[120555,1,"\u03BA"],[120556,1,"\u03BB"],[120557,1,"\u03BC"],[120558,1,"\u03BD"],[120559,1,"\u03BE"],[120560,1,"\u03BF"],[120561,1,"\u03C0"],[120562,1,"\u03C1"],[120563,1,"\u03B8"],[120564,1,"\u03C3"],[120565,1,"\u03C4"],[120566,1,"\u03C5"],[120567,1,"\u03C6"],[120568,1,"\u03C7"],[120569,1,"\u03C8"],[120570,1,"\u03C9"],[120571,1,"\u2207"],[120572,1,"\u03B1"],[120573,1,"\u03B2"],[120574,1,"\u03B3"],[120575,1,"\u03B4"],[120576,1,"\u03B5"],[120577,1,"\u03B6"],[120578,1,"\u03B7"],[120579,1,"\u03B8"],[120580,1,"\u03B9"],[120581,1,"\u03BA"],[120582,1,"\u03BB"],[120583,1,"\u03BC"],[120584,1,"\u03BD"],[120585,1,"\u03BE"],[120586,1,"\u03BF"],[120587,1,"\u03C0"],[120588,1,"\u03C1"],[[120589,120590],1,"\u03C3"],[120591,1,"\u03C4"],[120592,1,"\u03C5"],[120593,1,"\u03C6"],[120594,1,"\u03C7"],[120595,1,"\u03C8"],[120596,1,"\u03C9"],[120597,1,"\u2202"],[120598,1,"\u03B5"],[120599,1,"\u03B8"],[120600,1,"\u03BA"],[120601,1,"\u03C6"],[120602,1,"\u03C1"],[120603,1,"\u03C0"],[120604,1,"\u03B1"],[120605,1,"\u03B2"],[120606,1,"\u03B3"],[120607,1,"\u03B4"],[120608,1,"\u03B5"],[120609,1,"\u03B6"],[120610,1,"\u03B7"],[120611,1,"\u03B8"],[120612,1,"\u03B9"],[120613,1,"\u03BA"],[120614,1,"\u03BB"],[120615,1,"\u03BC"],[120616,1,"\u03BD"],[120617,1,"\u03BE"],[120618,1,"\u03BF"],[120619,1,"\u03C0"],[120620,1,"\u03C1"],[120621,1,"\u03B8"],[120622,1,"\u03C3"],[120623,1,"\u03C4"],[120624,1,"\u03C5"],[120625,1,"\u03C6"],[120626,1,"\u03C7"],[120627,1,"\u03C8"],[120628,1,"\u03C9"],[120629,1,"\u2207"],[120630,1,"\u03B1"],[120631,1,"\u03B2"],[120632,1,"\u03B3"],[120633,1,"\u03B4"],[120634,1,"\u03B5"],[120635,1,"\u03B6"],[120636,1,"\u03B7"],[120637,1,"\u03B8"],[120638,1,"\u03B9"],[120639,1,"\u03BA"],[120640,1,"\u03BB"],[120641,1,"\u03BC"],[120642,1,"\u03BD"],[120643,1,"\u03BE"],[120644,1,"\u03BF"],[120645,1,"\u03C0"],[120646,1,"\u03C1"],[[120647,120648],1,"\u03C3"],[120649,1,"\u03C4"],[120650,1,"\u03C5"],[120651,1,"\u03C6"],[120652,1,"\u03C7"],[120653,1,"\u03C8"],[120654,1,"\u03C9"],[120655,1,"\u2202"],[120656,1,"\u03B5"],[120657,1,"\u03B8"],[120658,1,"\u03BA"],[120659,1,"\u03C6"],[120660,1,"\u03C1"],[120661,1,"\u03C0"],[120662,1,"\u03B1"],[120663,1,"\u03B2"],[120664,1,"\u03B3"],[120665,1,"\u03B4"],[120666,1,"\u03B5"],[120667,1,"\u03B6"],[120668,1,"\u03B7"],[120669,1,"\u03B8"],[120670,1,"\u03B9"],[120671,1,"\u03BA"],[120672,1,"\u03BB"],[120673,1,"\u03BC"],[120674,1,"\u03BD"],[120675,1,"\u03BE"],[120676,1,"\u03BF"],[120677,1,"\u03C0"],[120678,1,"\u03C1"],[120679,1,"\u03B8"],[120680,1,"\u03C3"],[120681,1,"\u03C4"],[120682,1,"\u03C5"],[120683,1,"\u03C6"],[120684,1,"\u03C7"],[120685,1,"\u03C8"],[120686,1,"\u03C9"],[120687,1,"\u2207"],[120688,1,"\u03B1"],[120689,1,"\u03B2"],[120690,1,"\u03B3"],[120691,1,"\u03B4"],[120692,1,"\u03B5"],[120693,1,"\u03B6"],[120694,1,"\u03B7"],[120695,1,"\u03B8"],[120696,1,"\u03B9"],[120697,1,"\u03BA"],[120698,1,"\u03BB"],[120699,1,"\u03BC"],[120700,1,"\u03BD"],[120701,1,"\u03BE"],[120702,1,"\u03BF"],[120703,1,"\u03C0"],[120704,1,"\u03C1"],[[120705,120706],1,"\u03C3"],[120707,1,"\u03C4"],[120708,1,"\u03C5"],[120709,1,"\u03C6"],[120710,1,"\u03C7"],[120711,1,"\u03C8"],[120712,1,"\u03C9"],[120713,1,"\u2202"],[120714,1,"\u03B5"],[120715,1,"\u03B8"],[120716,1,"\u03BA"],[120717,1,"\u03C6"],[120718,1,"\u03C1"],[120719,1,"\u03C0"],[120720,1,"\u03B1"],[120721,1,"\u03B2"],[120722,1,"\u03B3"],[120723,1,"\u03B4"],[120724,1,"\u03B5"],[120725,1,"\u03B6"],[120726,1,"\u03B7"],[120727,1,"\u03B8"],[120728,1,"\u03B9"],[120729,1,"\u03BA"],[120730,1,"\u03BB"],[120731,1,"\u03BC"],[120732,1,"\u03BD"],[120733,1,"\u03BE"],[120734,1,"\u03BF"],[120735,1,"\u03C0"],[120736,1,"\u03C1"],[120737,1,"\u03B8"],[120738,1,"\u03C3"],[120739,1,"\u03C4"],[120740,1,"\u03C5"],[120741,1,"\u03C6"],[120742,1,"\u03C7"],[120743,1,"\u03C8"],[120744,1,"\u03C9"],[120745,1,"\u2207"],[120746,1,"\u03B1"],[120747,1,"\u03B2"],[120748,1,"\u03B3"],[120749,1,"\u03B4"],[120750,1,"\u03B5"],[120751,1,"\u03B6"],[120752,1,"\u03B7"],[120753,1,"\u03B8"],[120754,1,"\u03B9"],[120755,1,"\u03BA"],[120756,1,"\u03BB"],[120757,1,"\u03BC"],[120758,1,"\u03BD"],[120759,1,"\u03BE"],[120760,1,"\u03BF"],[120761,1,"\u03C0"],[120762,1,"\u03C1"],[[120763,120764],1,"\u03C3"],[120765,1,"\u03C4"],[120766,1,"\u03C5"],[120767,1,"\u03C6"],[120768,1,"\u03C7"],[120769,1,"\u03C8"],[120770,1,"\u03C9"],[120771,1,"\u2202"],[120772,1,"\u03B5"],[120773,1,"\u03B8"],[120774,1,"\u03BA"],[120775,1,"\u03C6"],[120776,1,"\u03C1"],[120777,1,"\u03C0"],[[120778,120779],1,"\u03DD"],[[120780,120781],3],[120782,1,"0"],[120783,1,"1"],[120784,1,"2"],[120785,1,"3"],[120786,1,"4"],[120787,1,"5"],[120788,1,"6"],[120789,1,"7"],[120790,1,"8"],[120791,1,"9"],[120792,1,"0"],[120793,1,"1"],[120794,1,"2"],[120795,1,"3"],[120796,1,"4"],[120797,1,"5"],[120798,1,"6"],[120799,1,"7"],[120800,1,"8"],[120801,1,"9"],[120802,1,"0"],[120803,1,"1"],[120804,1,"2"],[120805,1,"3"],[120806,1,"4"],[120807,1,"5"],[120808,1,"6"],[120809,1,"7"],[120810,1,"8"],[120811,1,"9"],[120812,1,"0"],[120813,1,"1"],[120814,1,"2"],[120815,1,"3"],[120816,1,"4"],[120817,1,"5"],[120818,1,"6"],[120819,1,"7"],[120820,1,"8"],[120821,1,"9"],[120822,1,"0"],[120823,1,"1"],[120824,1,"2"],[120825,1,"3"],[120826,1,"4"],[120827,1,"5"],[120828,1,"6"],[120829,1,"7"],[120830,1,"8"],[120831,1,"9"],[[120832,121343],2],[[121344,121398],2],[[121399,121402],2],[[121403,121452],2],[[121453,121460],2],[121461,2],[[121462,121475],2],[121476,2],[[121477,121483],2],[[121484,121498],3],[[121499,121503],2],[121504,3],[[121505,121519],2],[[121520,122623],3],[[122624,122654],2],[[122655,122660],3],[[122661,122666],2],[[122667,122879],3],[[122880,122886],2],[122887,3],[[122888,122904],2],[[122905,122906],3],[[122907,122913],2],[122914,3],[[122915,122916],2],[122917,3],[[122918,122922],2],[[122923,122927],3],[122928,1,"\u0430"],[122929,1,"\u0431"],[122930,1,"\u0432"],[122931,1,"\u0433"],[122932,1,"\u0434"],[122933,1,"\u0435"],[122934,1,"\u0436"],[122935,1,"\u0437"],[122936,1,"\u0438"],[122937,1,"\u043A"],[122938,1,"\u043B"],[122939,1,"\u043C"],[122940,1,"\u043E"],[122941,1,"\u043F"],[122942,1,"\u0440"],[122943,1,"\u0441"],[122944,1,"\u0442"],[122945,1,"\u0443"],[122946,1,"\u0444"],[122947,1,"\u0445"],[122948,1,"\u0446"],[122949,1,"\u0447"],[122950,1,"\u0448"],[122951,1,"\u044B"],[122952,1,"\u044D"],[122953,1,"\u044E"],[122954,1,"\uA689"],[122955,1,"\u04D9"],[122956,1,"\u0456"],[122957,1,"\u0458"],[122958,1,"\u04E9"],[122959,1,"\u04AF"],[122960,1,"\u04CF"],[122961,1,"\u0430"],[122962,1,"\u0431"],[122963,1,"\u0432"],[122964,1,"\u0433"],[122965,1,"\u0434"],[122966,1,"\u0435"],[122967,1,"\u0436"],[122968,1,"\u0437"],[122969,1,"\u0438"],[122970,1,"\u043A"],[122971,1,"\u043B"],[122972,1,"\u043E"],[122973,1,"\u043F"],[122974,1,"\u0441"],[122975,1,"\u0443"],[122976,1,"\u0444"],[122977,1,"\u0445"],[122978,1,"\u0446"],[122979,1,"\u0447"],[122980,1,"\u0448"],[122981,1,"\u044A"],[122982,1,"\u044B"],[122983,1,"\u0491"],[122984,1,"\u0456"],[122985,1,"\u0455"],[122986,1,"\u045F"],[122987,1,"\u04AB"],[122988,1,"\uA651"],[122989,1,"\u04B1"],[[122990,123022],3],[123023,2],[[123024,123135],3],[[123136,123180],2],[[123181,123183],3],[[123184,123197],2],[[123198,123199],3],[[123200,123209],2],[[123210,123213],3],[123214,2],[123215,2],[[123216,123535],3],[[123536,123566],2],[[123567,123583],3],[[123584,123641],2],[[123642,123646],3],[123647,2],[[123648,124111],3],[[124112,124153],2],[[124154,124367],3],[[124368,124410],2],[[124411,124414],3],[124415,2],[[124416,124607],3],[[124608,124638],2],[124639,3],[[124640,124661],2],[[124662,124669],3],[[124670,124671],2],[[124672,124895],3],[[124896,124902],2],[124903,3],[[124904,124907],2],[124908,3],[[124909,124910],2],[124911,3],[[124912,124926],2],[124927,3],[[124928,125124],2],[[125125,125126],3],[[125127,125135],2],[[125136,125142],2],[[125143,125183],3],[125184,1,"\uD83A\uDD22"],[125185,1,"\uD83A\uDD23"],[125186,1,"\uD83A\uDD24"],[125187,1,"\uD83A\uDD25"],[125188,1,"\uD83A\uDD26"],[125189,1,"\uD83A\uDD27"],[125190,1,"\uD83A\uDD28"],[125191,1,"\uD83A\uDD29"],[125192,1,"\uD83A\uDD2A"],[125193,1,"\uD83A\uDD2B"],[125194,1,"\uD83A\uDD2C"],[125195,1,"\uD83A\uDD2D"],[125196,1,"\uD83A\uDD2E"],[125197,1,"\uD83A\uDD2F"],[125198,1,"\uD83A\uDD30"],[125199,1,"\uD83A\uDD31"],[125200,1,"\uD83A\uDD32"],[125201,1,"\uD83A\uDD33"],[125202,1,"\uD83A\uDD34"],[125203,1,"\uD83A\uDD35"],[125204,1,"\uD83A\uDD36"],[125205,1,"\uD83A\uDD37"],[125206,1,"\uD83A\uDD38"],[125207,1,"\uD83A\uDD39"],[125208,1,"\uD83A\uDD3A"],[125209,1,"\uD83A\uDD3B"],[125210,1,"\uD83A\uDD3C"],[125211,1,"\uD83A\uDD3D"],[125212,1,"\uD83A\uDD3E"],[125213,1,"\uD83A\uDD3F"],[125214,1,"\uD83A\uDD40"],[125215,1,"\uD83A\uDD41"],[125216,1,"\uD83A\uDD42"],[125217,1,"\uD83A\uDD43"],[[125218,125258],2],[125259,2],[[125260,125263],3],[[125264,125273],2],[[125274,125277],3],[[125278,125279],2],[[125280,126064],3],[[126065,126132],2],[[126133,126208],3],[[126209,126269],2],[[126270,126463],3],[126464,1,"\u0627"],[126465,1,"\u0628"],[126466,1,"\u062C"],[126467,1,"\u062F"],[126468,3],[126469,1,"\u0648"],[126470,1,"\u0632"],[126471,1,"\u062D"],[126472,1,"\u0637"],[126473,1,"\u064A"],[126474,1,"\u0643"],[126475,1,"\u0644"],[126476,1,"\u0645"],[126477,1,"\u0646"],[126478,1,"\u0633"],[126479,1,"\u0639"],[126480,1,"\u0641"],[126481,1,"\u0635"],[126482,1,"\u0642"],[126483,1,"\u0631"],[126484,1,"\u0634"],[126485,1,"\u062A"],[126486,1,"\u062B"],[126487,1,"\u062E"],[126488,1,"\u0630"],[126489,1,"\u0636"],[126490,1,"\u0638"],[126491,1,"\u063A"],[126492,1,"\u066E"],[126493,1,"\u06BA"],[126494,1,"\u06A1"],[126495,1,"\u066F"],[126496,3],[126497,1,"\u0628"],[126498,1,"\u062C"],[126499,3],[126500,1,"\u0647"],[[126501,126502],3],[126503,1,"\u062D"],[126504,3],[126505,1,"\u064A"],[126506,1,"\u0643"],[126507,1,"\u0644"],[126508,1,"\u0645"],[126509,1,"\u0646"],[126510,1,"\u0633"],[126511,1,"\u0639"],[126512,1,"\u0641"],[126513,1,"\u0635"],[126514,1,"\u0642"],[126515,3],[126516,1,"\u0634"],[126517,1,"\u062A"],[126518,1,"\u062B"],[126519,1,"\u062E"],[126520,3],[126521,1,"\u0636"],[126522,3],[126523,1,"\u063A"],[[126524,126529],3],[126530,1,"\u062C"],[[126531,126534],3],[126535,1,"\u062D"],[126536,3],[126537,1,"\u064A"],[126538,3],[126539,1,"\u0644"],[126540,3],[126541,1,"\u0646"],[126542,1,"\u0633"],[126543,1,"\u0639"],[126544,3],[126545,1,"\u0635"],[126546,1,"\u0642"],[126547,3],[126548,1,"\u0634"],[[126549,126550],3],[126551,1,"\u062E"],[126552,3],[126553,1,"\u0636"],[126554,3],[126555,1,"\u063A"],[126556,3],[126557,1,"\u06BA"],[126558,3],[126559,1,"\u066F"],[126560,3],[126561,1,"\u0628"],[126562,1,"\u062C"],[126563,3],[126564,1,"\u0647"],[[126565,126566],3],[126567,1,"\u062D"],[126568,1,"\u0637"],[126569,1,"\u064A"],[126570,1,"\u0643"],[126571,3],[126572,1,"\u0645"],[126573,1,"\u0646"],[126574,1,"\u0633"],[126575,1,"\u0639"],[126576,1,"\u0641"],[126577,1,"\u0635"],[126578,1,"\u0642"],[126579,3],[126580,1,"\u0634"],[126581,1,"\u062A"],[126582,1,"\u062B"],[126583,1,"\u062E"],[126584,3],[126585,1,"\u0636"],[126586,1,"\u0638"],[126587,1,"\u063A"],[126588,1,"\u066E"],[126589,3],[126590,1,"\u06A1"],[126591,3],[126592,1,"\u0627"],[126593,1,"\u0628"],[126594,1,"\u062C"],[126595,1,"\u062F"],[126596,1,"\u0647"],[126597,1,"\u0648"],[126598,1,"\u0632"],[126599,1,"\u062D"],[126600,1,"\u0637"],[126601,1,"\u064A"],[126602,3],[126603,1,"\u0644"],[126604,1,"\u0645"],[126605,1,"\u0646"],[126606,1,"\u0633"],[126607,1,"\u0639"],[126608,1,"\u0641"],[126609,1,"\u0635"],[126610,1,"\u0642"],[126611,1,"\u0631"],[126612,1,"\u0634"],[126613,1,"\u062A"],[126614,1,"\u062B"],[126615,1,"\u062E"],[126616,1,"\u0630"],[126617,1,"\u0636"],[126618,1,"\u0638"],[126619,1,"\u063A"],[[126620,126624],3],[126625,1,"\u0628"],[126626,1,"\u062C"],[126627,1,"\u062F"],[126628,3],[126629,1,"\u0648"],[126630,1,"\u0632"],[126631,1,"\u062D"],[126632,1,"\u0637"],[126633,1,"\u064A"],[126634,3],[126635,1,"\u0644"],[126636,1,"\u0645"],[126637,1,"\u0646"],[126638,1,"\u0633"],[126639,1,"\u0639"],[126640,1,"\u0641"],[126641,1,"\u0635"],[126642,1,"\u0642"],[126643,1,"\u0631"],[126644,1,"\u0634"],[126645,1,"\u062A"],[126646,1,"\u062B"],[126647,1,"\u062E"],[126648,1,"\u0630"],[126649,1,"\u0636"],[126650,1,"\u0638"],[126651,1,"\u063A"],[[126652,126703],3],[[126704,126705],2],[[126706,126975],3],[[126976,127019],2],[[127020,127023],3],[[127024,127123],2],[[127124,127135],3],[[127136,127150],2],[[127151,127152],3],[[127153,127166],2],[127167,2],[127168,3],[[127169,127183],2],[127184,3],[[127185,127199],2],[[127200,127221],2],[[127222,127231],3],[127232,3],[127233,1,"0,"],[127234,1,"1,"],[127235,1,"2,"],[127236,1,"3,"],[127237,1,"4,"],[127238,1,"5,"],[127239,1,"6,"],[127240,1,"7,"],[127241,1,"8,"],[127242,1,"9,"],[[127243,127244],2],[[127245,127247],2],[127248,1,"(a)"],[127249,1,"(b)"],[127250,1,"(c)"],[127251,1,"(d)"],[127252,1,"(e)"],[127253,1,"(f)"],[127254,1,"(g)"],[127255,1,"(h)"],[127256,1,"(i)"],[127257,1,"(j)"],[127258,1,"(k)"],[127259,1,"(l)"],[127260,1,"(m)"],[127261,1,"(n)"],[127262,1,"(o)"],[127263,1,"(p)"],[127264,1,"(q)"],[127265,1,"(r)"],[127266,1,"(s)"],[127267,1,"(t)"],[127268,1,"(u)"],[127269,1,"(v)"],[127270,1,"(w)"],[127271,1,"(x)"],[127272,1,"(y)"],[127273,1,"(z)"],[127274,1,"\u3014s\u3015"],[127275,1,"c"],[127276,1,"r"],[127277,1,"cd"],[127278,1,"wz"],[127279,2],[127280,1,"a"],[127281,1,"b"],[127282,1,"c"],[127283,1,"d"],[127284,1,"e"],[127285,1,"f"],[127286,1,"g"],[127287,1,"h"],[127288,1,"i"],[127289,1,"j"],[127290,1,"k"],[127291,1,"l"],[127292,1,"m"],[127293,1,"n"],[127294,1,"o"],[127295,1,"p"],[127296,1,"q"],[127297,1,"r"],[127298,1,"s"],[127299,1,"t"],[127300,1,"u"],[127301,1,"v"],[127302,1,"w"],[127303,1,"x"],[127304,1,"y"],[127305,1,"z"],[127306,1,"hv"],[127307,1,"mv"],[127308,1,"sd"],[127309,1,"ss"],[127310,1,"ppv"],[127311,1,"wc"],[[127312,127318],2],[127319,2],[[127320,127326],2],[127327,2],[[127328,127337],2],[127338,1,"mc"],[127339,1,"md"],[127340,1,"mr"],[[127341,127343],2],[[127344,127352],2],[127353,2],[127354,2],[[127355,127356],2],[[127357,127358],2],[127359,2],[[127360,127369],2],[[127370,127373],2],[[127374,127375],2],[127376,1,"dj"],[[127377,127386],2],[[127387,127404],2],[127405,2],[[127406,127461],3],[[127462,127487],2],[127488,1,"\u307B\u304B"],[127489,1,"\u30B3\u30B3"],[127490,1,"\u30B5"],[[127491,127503],3],[127504,1,"\u624B"],[127505,1,"\u5B57"],[127506,1,"\u53CC"],[127507,1,"\u30C7"],[127508,1,"\u4E8C"],[127509,1,"\u591A"],[127510,1,"\u89E3"],[127511,1,"\u5929"],[127512,1,"\u4EA4"],[127513,1,"\u6620"],[127514,1,"\u7121"],[127515,1,"\u6599"],[127516,1,"\u524D"],[127517,1,"\u5F8C"],[127518,1,"\u518D"],[127519,1,"\u65B0"],[127520,1,"\u521D"],[127521,1,"\u7D42"],[127522,1,"\u751F"],[127523,1,"\u8CA9"],[127524,1,"\u58F0"],[127525,1,"\u5439"],[127526,1,"\u6F14"],[127527,1,"\u6295"],[127528,1,"\u6355"],[127529,1,"\u4E00"],[127530,1,"\u4E09"],[127531,1,"\u904A"],[127532,1,"\u5DE6"],[127533,1,"\u4E2D"],[127534,1,"\u53F3"],[127535,1,"\u6307"],[127536,1,"\u8D70"],[127537,1,"\u6253"],[127538,1,"\u7981"],[127539,1,"\u7A7A"],[127540,1,"\u5408"],[127541,1,"\u6E80"],[127542,1,"\u6709"],[127543,1,"\u6708"],[127544,1,"\u7533"],[127545,1,"\u5272"],[127546,1,"\u55B6"],[127547,1,"\u914D"],[[127548,127551],3],[127552,1,"\u3014\u672C\u3015"],[127553,1,"\u3014\u4E09\u3015"],[127554,1,"\u3014\u4E8C\u3015"],[127555,1,"\u3014\u5B89\u3015"],[127556,1,"\u3014\u70B9\u3015"],[127557,1,"\u3014\u6253\u3015"],[127558,1,"\u3014\u76D7\u3015"],[127559,1,"\u3014\u52DD\u3015"],[127560,1,"\u3014\u6557\u3015"],[[127561,127567],3],[127568,1,"\u5F97"],[127569,1,"\u53EF"],[[127570,127583],3],[[127584,127589],2],[[127590,127743],3],[[127744,127776],2],[[127777,127788],2],[[127789,127791],2],[[127792,127797],2],[127798,2],[[127799,127868],2],[127869,2],[[127870,127871],2],[[127872,127891],2],[[127892,127903],2],[[127904,127940],2],[127941,2],[[127942,127946],2],[[127947,127950],2],[[127951,127955],2],[[127956,127967],2],[[127968,127984],2],[[127985,127991],2],[[127992,127999],2],[[128000,128062],2],[128063,2],[128064,2],[128065,2],[[128066,128247],2],[128248,2],[[128249,128252],2],[[128253,128254],2],[128255,2],[[128256,128317],2],[[128318,128319],2],[[128320,128323],2],[[128324,128330],2],[[128331,128335],2],[[128336,128359],2],[[128360,128377],2],[128378,2],[[128379,128419],2],[128420,2],[[128421,128506],2],[[128507,128511],2],[128512,2],[[128513,128528],2],[128529,2],[[128530,128532],2],[128533,2],[128534,2],[128535,2],[128536,2],[128537,2],[128538,2],[128539,2],[[128540,128542],2],[128543,2],[[128544,128549],2],[[128550,128551],2],[[128552,128555],2],[128556,2],[128557,2],[[128558,128559],2],[[128560,128563],2],[128564,2],[[128565,128576],2],[[128577,128578],2],[[128579,128580],2],[[128581,128591],2],[[128592,128639],2],[[128640,128709],2],[[128710,128719],2],[128720,2],[[128721,128722],2],[[128723,128724],2],[128725,2],[[128726,128727],2],[128728,2],[[128729,128731],3],[128732,2],[[128733,128735],2],[[128736,128748],2],[[128749,128751],3],[[128752,128755],2],[[128756,128758],2],[[128759,128760],2],[128761,2],[128762,2],[[128763,128764],2],[[128765,128767],3],[[128768,128883],2],[[128884,128886],2],[[128887,128890],2],[[128891,128895],2],[[128896,128980],2],[[128981,128984],2],[128985,2],[[128986,128991],3],[[128992,129003],2],[[129004,129007],3],[129008,2],[[129009,129023],3],[[129024,129035],2],[[129036,129039],3],[[129040,129095],2],[[129096,129103],3],[[129104,129113],2],[[129114,129119],3],[[129120,129159],2],[[129160,129167],3],[[129168,129197],2],[[129198,129199],3],[[129200,129201],2],[[129202,129211],2],[[129212,129215],3],[[129216,129217],2],[[129218,129231],3],[[129232,129240],2],[[129241,129279],3],[[129280,129291],2],[129292,2],[[129293,129295],2],[[129296,129304],2],[[129305,129310],2],[129311,2],[[129312,129319],2],[[129320,129327],2],[129328,2],[[129329,129330],2],[[129331,129342],2],[129343,2],[[129344,129355],2],[129356,2],[[129357,129359],2],[[129360,129374],2],[[129375,129387],2],[[129388,129392],2],[129393,2],[129394,2],[[129395,129398],2],[[129399,129400],2],[129401,2],[129402,2],[129403,2],[[129404,129407],2],[[129408,129412],2],[[129413,129425],2],[[129426,129431],2],[[129432,129442],2],[[129443,129444],2],[[129445,129450],2],[[129451,129453],2],[[129454,129455],2],[[129456,129465],2],[[129466,129471],2],[129472,2],[[129473,129474],2],[[129475,129482],2],[129483,2],[129484,2],[[129485,129487],2],[[129488,129510],2],[[129511,129535],2],[[129536,129619],2],[[129620,129623],2],[[129624,129631],3],[[129632,129645],2],[[129646,129647],3],[[129648,129651],2],[129652,2],[[129653,129655],2],[[129656,129658],2],[[129659,129660],2],[[129661,129663],3],[[129664,129666],2],[[129667,129670],2],[[129671,129672],2],[129673,2],[129674,2],[[129675,129677],3],[129678,2],[129679,2],[[129680,129685],2],[[129686,129704],2],[[129705,129708],2],[[129709,129711],2],[[129712,129718],2],[[129719,129722],2],[[129723,129725],2],[129726,2],[129727,2],[[129728,129730],2],[[129731,129733],2],[129734,2],[129735,3],[129736,2],[[129737,129740],3],[129741,2],[[129742,129743],2],[[129744,129750],2],[[129751,129753],2],[[129754,129755],2],[129756,2],[[129757,129758],3],[129759,2],[[129760,129767],2],[129768,2],[129769,2],[129770,2],[[129771,129774],3],[129775,2],[[129776,129782],2],[[129783,129784],2],[[129785,129791],3],[[129792,129938],2],[129939,3],[[129940,129994],2],[[129995,130031],2],[130032,1,"0"],[130033,1,"1"],[130034,1,"2"],[130035,1,"3"],[130036,1,"4"],[130037,1,"5"],[130038,1,"6"],[130039,1,"7"],[130040,1,"8"],[130041,1,"9"],[130042,2],[[130043,131069],3],[[131070,131071],3],[[131072,173782],2],[[173783,173789],2],[[173790,173791],2],[[173792,173823],3],[[173824,177972],2],[[177973,177976],2],[177977,2],[[177978,177983],2],[[177984,178205],2],[[178206,178207],3],[[178208,183969],2],[[183970,183981],2],[[183982,183983],3],[[183984,191456],2],[[191457,191471],3],[[191472,192093],2],[[192094,194559],3],[194560,1,"\u4E3D"],[194561,1,"\u4E38"],[194562,1,"\u4E41"],[194563,1,"\uD840\uDD22"],[194564,1,"\u4F60"],[194565,1,"\u4FAE"],[194566,1,"\u4FBB"],[194567,1,"\u5002"],[194568,1,"\u507A"],[194569,1,"\u5099"],[194570,1,"\u50E7"],[194571,1,"\u50CF"],[194572,1,"\u349E"],[194573,1,"\uD841\uDE3A"],[194574,1,"\u514D"],[194575,1,"\u5154"],[194576,1,"\u5164"],[194577,1,"\u5177"],[194578,1,"\uD841\uDD1C"],[194579,1,"\u34B9"],[194580,1,"\u5167"],[194581,1,"\u518D"],[194582,1,"\uD841\uDD4B"],[194583,1,"\u5197"],[194584,1,"\u51A4"],[194585,1,"\u4ECC"],[194586,1,"\u51AC"],[194587,1,"\u51B5"],[194588,1,"\uD864\uDDDF"],[194589,1,"\u51F5"],[194590,1,"\u5203"],[194591,1,"\u34DF"],[194592,1,"\u523B"],[194593,1,"\u5246"],[194594,1,"\u5272"],[194595,1,"\u5277"],[194596,1,"\u3515"],[194597,1,"\u52C7"],[194598,1,"\u52C9"],[194599,1,"\u52E4"],[194600,1,"\u52FA"],[194601,1,"\u5305"],[194602,1,"\u5306"],[194603,1,"\u5317"],[194604,1,"\u5349"],[194605,1,"\u5351"],[194606,1,"\u535A"],[194607,1,"\u5373"],[194608,1,"\u537D"],[[194609,194611],1,"\u537F"],[194612,1,"\uD842\uDE2C"],[194613,1,"\u7070"],[194614,1,"\u53CA"],[194615,1,"\u53DF"],[194616,1,"\uD842\uDF63"],[194617,1,"\u53EB"],[194618,1,"\u53F1"],[194619,1,"\u5406"],[194620,1,"\u549E"],[194621,1,"\u5438"],[194622,1,"\u5448"],[194623,1,"\u5468"],[194624,1,"\u54A2"],[194625,1,"\u54F6"],[194626,1,"\u5510"],[194627,1,"\u5553"],[194628,1,"\u5563"],[[194629,194630],1,"\u5584"],[194631,1,"\u5599"],[194632,1,"\u55AB"],[194633,1,"\u55B3"],[194634,1,"\u55C2"],[194635,1,"\u5716"],[194636,1,"\u5606"],[194637,1,"\u5717"],[194638,1,"\u5651"],[194639,1,"\u5674"],[194640,1,"\u5207"],[194641,1,"\u58EE"],[194642,1,"\u57CE"],[194643,1,"\u57F4"],[194644,1,"\u580D"],[194645,1,"\u578B"],[194646,1,"\u5832"],[194647,1,"\u5831"],[194648,1,"\u58AC"],[194649,1,"\uD845\uDCE4"],[194650,1,"\u58F2"],[194651,1,"\u58F7"],[194652,1,"\u5906"],[194653,1,"\u591A"],[194654,1,"\u5922"],[194655,1,"\u5962"],[194656,1,"\uD845\uDEA8"],[194657,1,"\uD845\uDEEA"],[194658,1,"\u59EC"],[194659,1,"\u5A1B"],[194660,1,"\u5A27"],[194661,1,"\u59D8"],[194662,1,"\u5A66"],[194663,1,"\u36EE"],[194664,1,"\u36FC"],[194665,1,"\u5B08"],[[194666,194667],1,"\u5B3E"],[194668,1,"\uD846\uDDC8"],[194669,1,"\u5BC3"],[194670,1,"\u5BD8"],[194671,1,"\u5BE7"],[194672,1,"\u5BF3"],[194673,1,"\uD846\uDF18"],[194674,1,"\u5BFF"],[194675,1,"\u5C06"],[194676,1,"\u5F53"],[194677,1,"\u5C22"],[194678,1,"\u3781"],[194679,1,"\u5C60"],[194680,1,"\u5C6E"],[194681,1,"\u5CC0"],[194682,1,"\u5C8D"],[194683,1,"\uD847\uDDE4"],[194684,1,"\u5D43"],[194685,1,"\uD847\uDDE6"],[194686,1,"\u5D6E"],[194687,1,"\u5D6B"],[194688,1,"\u5D7C"],[194689,1,"\u5DE1"],[194690,1,"\u5DE2"],[194691,1,"\u382F"],[194692,1,"\u5DFD"],[194693,1,"\u5E28"],[194694,1,"\u5E3D"],[194695,1,"\u5E69"],[194696,1,"\u3862"],[194697,1,"\uD848\uDD83"],[194698,1,"\u387C"],[194699,1,"\u5EB0"],[194700,1,"\u5EB3"],[194701,1,"\u5EB6"],[194702,1,"\u5ECA"],[194703,1,"\uD868\uDF92"],[194704,1,"\u5EFE"],[[194705,194706],1,"\uD848\uDF31"],[194707,1,"\u8201"],[[194708,194709],1,"\u5F22"],[194710,1,"\u38C7"],[194711,1,"\uD84C\uDEB8"],[194712,1,"\uD858\uDDDA"],[194713,1,"\u5F62"],[194714,1,"\u5F6B"],[194715,1,"\u38E3"],[194716,1,"\u5F9A"],[194717,1,"\u5FCD"],[194718,1,"\u5FD7"],[194719,1,"\u5FF9"],[194720,1,"\u6081"],[194721,1,"\u393A"],[194722,1,"\u391C"],[194723,1,"\u6094"],[194724,1,"\uD849\uDED4"],[194725,1,"\u60C7"],[194726,1,"\u6148"],[194727,1,"\u614C"],[194728,1,"\u614E"],[194729,1,"\u614C"],[194730,1,"\u617A"],[194731,1,"\u618E"],[194732,1,"\u61B2"],[194733,1,"\u61A4"],[194734,1,"\u61AF"],[194735,1,"\u61DE"],[194736,1,"\u61F2"],[194737,1,"\u61F6"],[194738,1,"\u6210"],[194739,1,"\u621B"],[194740,1,"\u625D"],[194741,1,"\u62B1"],[194742,1,"\u62D4"],[194743,1,"\u6350"],[194744,1,"\uD84A\uDF0C"],[194745,1,"\u633D"],[194746,1,"\u62FC"],[194747,1,"\u6368"],[194748,1,"\u6383"],[194749,1,"\u63E4"],[194750,1,"\uD84A\uDFF1"],[194751,1,"\u6422"],[194752,1,"\u63C5"],[194753,1,"\u63A9"],[194754,1,"\u3A2E"],[194755,1,"\u6469"],[194756,1,"\u647E"],[194757,1,"\u649D"],[194758,1,"\u6477"],[194759,1,"\u3A6C"],[194760,1,"\u654F"],[194761,1,"\u656C"],[194762,1,"\uD84C\uDC0A"],[194763,1,"\u65E3"],[194764,1,"\u66F8"],[194765,1,"\u6649"],[194766,1,"\u3B19"],[194767,1,"\u6691"],[194768,1,"\u3B08"],[194769,1,"\u3AE4"],[194770,1,"\u5192"],[194771,1,"\u5195"],[194772,1,"\u6700"],[194773,1,"\u669C"],[194774,1,"\u80AD"],[194775,1,"\u43D9"],[194776,1,"\u6717"],[194777,1,"\u671B"],[194778,1,"\u6721"],[194779,1,"\u675E"],[194780,1,"\u6753"],[194781,1,"\uD84C\uDFC3"],[194782,1,"\u3B49"],[194783,1,"\u67FA"],[194784,1,"\u6785"],[194785,1,"\u6852"],[194786,1,"\u6885"],[194787,1,"\uD84D\uDC6D"],[194788,1,"\u688E"],[194789,1,"\u681F"],[194790,1,"\u6914"],[194791,1,"\u3B9D"],[194792,1,"\u6942"],[194793,1,"\u69A3"],[194794,1,"\u69EA"],[194795,1,"\u6AA8"],[194796,1,"\uD84D\uDEA3"],[194797,1,"\u6ADB"],[194798,1,"\u3C18"],[194799,1,"\u6B21"],[194800,1,"\uD84E\uDCA7"],[194801,1,"\u6B54"],[194802,1,"\u3C4E"],[194803,1,"\u6B72"],[194804,1,"\u6B9F"],[194805,1,"\u6BBA"],[194806,1,"\u6BBB"],[194807,1,"\uD84E\uDE8D"],[194808,1,"\uD847\uDD0B"],[194809,1,"\uD84E\uDEFA"],[194810,1,"\u6C4E"],[194811,1,"\uD84F\uDCBC"],[194812,1,"\u6CBF"],[194813,1,"\u6CCD"],[194814,1,"\u6C67"],[194815,1,"\u6D16"],[194816,1,"\u6D3E"],[194817,1,"\u6D77"],[194818,1,"\u6D41"],[194819,1,"\u6D69"],[194820,1,"\u6D78"],[194821,1,"\u6D85"],[194822,1,"\uD84F\uDD1E"],[194823,1,"\u6D34"],[194824,1,"\u6E2F"],[194825,1,"\u6E6E"],[194826,1,"\u3D33"],[194827,1,"\u6ECB"],[194828,1,"\u6EC7"],[194829,1,"\uD84F\uDED1"],[194830,1,"\u6DF9"],[194831,1,"\u6F6E"],[194832,1,"\uD84F\uDF5E"],[194833,1,"\uD84F\uDF8E"],[194834,1,"\u6FC6"],[194835,1,"\u7039"],[194836,1,"\u701E"],[194837,1,"\u701B"],[194838,1,"\u3D96"],[194839,1,"\u704A"],[194840,1,"\u707D"],[194841,1,"\u7077"],[194842,1,"\u70AD"],[194843,1,"\uD841\uDD25"],[194844,1,"\u7145"],[194845,1,"\uD850\uDE63"],[194846,1,"\u719C"],[194847,1,"\uD850\uDFAB"],[194848,1,"\u7228"],[194849,1,"\u7235"],[194850,1,"\u7250"],[194851,1,"\uD851\uDE08"],[194852,1,"\u7280"],[194853,1,"\u7295"],[194854,1,"\uD851\uDF35"],[194855,1,"\uD852\uDC14"],[194856,1,"\u737A"],[194857,1,"\u738B"],[194858,1,"\u3EAC"],[194859,1,"\u73A5"],[[194860,194861],1,"\u3EB8"],[194862,1,"\u7447"],[194863,1,"\u745C"],[194864,1,"\u7471"],[194865,1,"\u7485"],[194866,1,"\u74CA"],[194867,1,"\u3F1B"],[194868,1,"\u7524"],[194869,1,"\uD853\uDC36"],[194870,1,"\u753E"],[194871,1,"\uD853\uDC92"],[194872,1,"\u7570"],[194873,1,"\uD848\uDD9F"],[194874,1,"\u7610"],[194875,1,"\uD853\uDFA1"],[194876,1,"\uD853\uDFB8"],[194877,1,"\uD854\uDC44"],[194878,1,"\u3FFC"],[194879,1,"\u4008"],[194880,1,"\u76F4"],[194881,1,"\uD854\uDCF3"],[194882,1,"\uD854\uDCF2"],[194883,1,"\uD854\uDD19"],[194884,1,"\uD854\uDD33"],[194885,1,"\u771E"],[[194886,194887],1,"\u771F"],[194888,1,"\u774A"],[194889,1,"\u4039"],[194890,1,"\u778B"],[194891,1,"\u4046"],[194892,1,"\u4096"],[194893,1,"\uD855\uDC1D"],[194894,1,"\u784E"],[194895,1,"\u788C"],[194896,1,"\u78CC"],[194897,1,"\u40E3"],[194898,1,"\uD855\uDE26"],[194899,1,"\u7956"],[194900,1,"\uD855\uDE9A"],[194901,1,"\uD855\uDEC5"],[194902,1,"\u798F"],[194903,1,"\u79EB"],[194904,1,"\u412F"],[194905,1,"\u7A40"],[194906,1,"\u7A4A"],[194907,1,"\u7A4F"],[194908,1,"\uD856\uDD7C"],[[194909,194910],1,"\uD856\uDEA7"],[194911,1,"\u7AEE"],[194912,1,"\u4202"],[194913,1,"\uD856\uDFAB"],[194914,1,"\u7BC6"],[194915,1,"\u7BC9"],[194916,1,"\u4227"],[194917,1,"\uD857\uDC80"],[194918,1,"\u7CD2"],[194919,1,"\u42A0"],[194920,1,"\u7CE8"],[194921,1,"\u7CE3"],[194922,1,"\u7D00"],[194923,1,"\uD857\uDF86"],[194924,1,"\u7D63"],[194925,1,"\u4301"],[194926,1,"\u7DC7"],[194927,1,"\u7E02"],[194928,1,"\u7E45"],[194929,1,"\u4334"],[194930,1,"\uD858\uDE28"],[194931,1,"\uD858\uDE47"],[194932,1,"\u4359"],[194933,1,"\uD858\uDED9"],[194934,1,"\u7F7A"],[194935,1,"\uD858\uDF3E"],[194936,1,"\u7F95"],[194937,1,"\u7FFA"],[194938,1,"\u8005"],[194939,1,"\uD859\uDCDA"],[194940,1,"\uD859\uDD23"],[194941,1,"\u8060"],[194942,1,"\uD859\uDDA8"],[194943,1,"\u8070"],[194944,1,"\uD84C\uDF5F"],[194945,1,"\u43D5"],[194946,1,"\u80B2"],[194947,1,"\u8103"],[194948,1,"\u440B"],[194949,1,"\u813E"],[194950,1,"\u5AB5"],[194951,1,"\uD859\uDFA7"],[194952,1,"\uD859\uDFB5"],[194953,1,"\uD84C\uDF93"],[194954,1,"\uD84C\uDF9C"],[194955,1,"\u8201"],[194956,1,"\u8204"],[194957,1,"\u8F9E"],[194958,1,"\u446B"],[194959,1,"\u8291"],[194960,1,"\u828B"],[194961,1,"\u829D"],[194962,1,"\u52B3"],[194963,1,"\u82B1"],[194964,1,"\u82B3"],[194965,1,"\u82BD"],[194966,1,"\u82E6"],[194967,1,"\uD85A\uDF3C"],[194968,1,"\u82E5"],[194969,1,"\u831D"],[194970,1,"\u8363"],[194971,1,"\u83AD"],[194972,1,"\u8323"],[194973,1,"\u83BD"],[194974,1,"\u83E7"],[194975,1,"\u8457"],[194976,1,"\u8353"],[194977,1,"\u83CA"],[194978,1,"\u83CC"],[194979,1,"\u83DC"],[194980,1,"\uD85B\uDC36"],[194981,1,"\uD85B\uDD6B"],[194982,1,"\uD85B\uDCD5"],[194983,1,"\u452B"],[194984,1,"\u84F1"],[194985,1,"\u84F3"],[194986,1,"\u8516"],[194987,1,"\uD85C\uDFCA"],[194988,1,"\u8564"],[194989,1,"\uD85B\uDF2C"],[194990,1,"\u455D"],[194991,1,"\u4561"],[194992,1,"\uD85B\uDFB1"],[194993,1,"\uD85C\uDCD2"],[194994,1,"\u456B"],[194995,1,"\u8650"],[194996,1,"\u865C"],[194997,1,"\u8667"],[194998,1,"\u8669"],[194999,1,"\u86A9"],[195000,1,"\u8688"],[195001,1,"\u870E"],[195002,1,"\u86E2"],[195003,1,"\u8779"],[195004,1,"\u8728"],[195005,1,"\u876B"],[195006,1,"\u8786"],[195007,1,"\u45D7"],[195008,1,"\u87E1"],[195009,1,"\u8801"],[195010,1,"\u45F9"],[195011,1,"\u8860"],[195012,1,"\u8863"],[195013,1,"\uD85D\uDE67"],[195014,1,"\u88D7"],[195015,1,"\u88DE"],[195016,1,"\u4635"],[195017,1,"\u88FA"],[195018,1,"\u34BB"],[195019,1,"\uD85E\uDCAE"],[195020,1,"\uD85E\uDD66"],[195021,1,"\u46BE"],[195022,1,"\u46C7"],[195023,1,"\u8AA0"],[195024,1,"\u8AED"],[195025,1,"\u8B8A"],[195026,1,"\u8C55"],[195027,1,"\uD85F\uDCA8"],[195028,1,"\u8CAB"],[195029,1,"\u8CC1"],[195030,1,"\u8D1B"],[195031,1,"\u8D77"],[195032,1,"\uD85F\uDF2F"],[195033,1,"\uD842\uDC04"],[195034,1,"\u8DCB"],[195035,1,"\u8DBC"],[195036,1,"\u8DF0"],[195037,1,"\uD842\uDCDE"],[195038,1,"\u8ED4"],[195039,1,"\u8F38"],[195040,1,"\uD861\uDDD2"],[195041,1,"\uD861\uDDED"],[195042,1,"\u9094"],[195043,1,"\u90F1"],[195044,1,"\u9111"],[195045,1,"\uD861\uDF2E"],[195046,1,"\u911B"],[195047,1,"\u9238"],[195048,1,"\u92D7"],[195049,1,"\u92D8"],[195050,1,"\u927C"],[195051,1,"\u93F9"],[195052,1,"\u9415"],[195053,1,"\uD862\uDFFA"],[195054,1,"\u958B"],[195055,1,"\u4995"],[195056,1,"\u95B7"],[195057,1,"\uD863\uDD77"],[195058,1,"\u49E6"],[195059,1,"\u96C3"],[195060,1,"\u5DB2"],[195061,1,"\u9723"],[195062,1,"\uD864\uDD45"],[195063,1,"\uD864\uDE1A"],[195064,1,"\u4A6E"],[195065,1,"\u4A76"],[195066,1,"\u97E0"],[195067,1,"\uD865\uDC0A"],[195068,1,"\u4AB2"],[195069,1,"\uD865\uDC96"],[[195070,195071],1,"\u980B"],[195072,1,"\u9829"],[195073,1,"\uD865\uDDB6"],[195074,1,"\u98E2"],[195075,1,"\u4B33"],[195076,1,"\u9929"],[195077,1,"\u99A7"],[195078,1,"\u99C2"],[195079,1,"\u99FE"],[195080,1,"\u4BCE"],[195081,1,"\uD866\uDF30"],[195082,1,"\u9B12"],[195083,1,"\u9C40"],[195084,1,"\u9CFD"],[195085,1,"\u4CCE"],[195086,1,"\u4CED"],[195087,1,"\u9D67"],[195088,1,"\uD868\uDCCE"],[195089,1,"\u4CF8"],[195090,1,"\uD868\uDD05"],[195091,1,"\uD868\uDE0E"],[195092,1,"\uD868\uDE91"],[195093,1,"\u9EBB"],[195094,1,"\u4D56"],[195095,1,"\u9EF9"],[195096,1,"\u9EFE"],[195097,1,"\u9F05"],[195098,1,"\u9F0F"],[195099,1,"\u9F16"],[195100,1,"\u9F3B"],[195101,1,"\uD869\uDE00"],[[195102,196605],3],[[196606,196607],3],[[196608,201546],2],[[201547,201551],3],[[201552,205743],2],[[205744,210041],2],[[210042,262141],3],[[262142,262143],3],[[262144,327677],3],[[327678,327679],3],[[327680,393213],3],[[393214,393215],3],[[393216,458749],3],[[458750,458751],3],[[458752,524285],3],[[524286,524287],3],[[524288,589821],3],[[589822,589823],3],[[589824,655357],3],[[655358,655359],3],[[655360,720893],3],[[720894,720895],3],[[720896,786429],3],[[786430,786431],3],[[786432,851965],3],[[851966,851967],3],[[851968,917501],3],[[917502,917503],3],[917504,3],[917505,3],[[917506,917535],3],[[917536,917631],3],[[917632,917759],3],[[917760,917999],7],[[918000,983037],3],[[983038,983039],3],[[983040,1048573],3],[[1048574,1048575],3],[[1048576,1114109],3],[[1114110,1114111],3]]});var hx=g(function(Rae,lx){Rae.STATUS_MAPPING={mapped:1,valid:2,disallowed:3,deviation:6,ignored:7}});var mx=g(function(rbe,px){var gl=ox(),Jt=ax(),gE=cx(),{STATUS_MAPPING:vu}=hx();function _E(e){return/[^\x00-\x7F]/u.test(e)}function fx(e){let t=0,r=gE.length-1;while(t<=r){let n=Math.floor((t+r)/2),s=gE[n],i=Array.isArray(s[0])?s[0][0]:s[0],o=Array.isArray(s[0])?s[0][1]:s[0];if(i<=e&&o>=e)return s.slice(1);else if(i>e)r=n-1;else t=n+1}return null}function vae(e,{transitionalProcessing:t}){let r="";for(let n of e){let[s,i]=fx(n.codePointAt(0));switch(s){case vu.disallowed:r+=n;break;case vu.ignored:break;case vu.mapped:if(t&&n==="\u1E9E")r+="ss";else r+=i;break;case vu.deviation:if(t)r+=i;else r+=n;break;case vu.valid:r+=n;break}}return r}function kae(e,{checkHyphens:t,checkBidi:r,checkJoiners:n,transitionalProcessing:s,useSTD3ASCIIRules:i,isBidi:o}){if(e.length===0)return!0;if(e.normalize("NFC")!==e)return!1;let u=Array.from(e);if(t){if(u[2]==="-"&&u[3]==="-"||(e.startsWith("-")||e.endsWith("-")))return!1}if(!t){if(e.startsWith("xn--"))return!1}if(e.includes("."))return!1;if(Jt.combiningMarks.test(u[0]))return!1;for(let a of u){let c=a.codePointAt(0),[l]=fx(c);if(s){if(l!==vu.valid)return!1}else if(l!==vu.valid&&l!==vu.deviation)return!1;if(i&&c<=127){if(!/^(?:[a-z]|[0-9]|-)$/u.test(a))return!1}}if(n){let a=0;for(let[c,l]of u.entries())if(l==="\u200C"||l==="\u200D"){if(c>0){if(Jt.combiningClassVirama.test(u[c-1]))continue;if(l==="\u200C"){let f=u.indexOf("\u200C",c+1),h=f<0?u.slice(a):u.slice(a,f);if(Jt.validZWNJ.test(h.join(""))){a=c+1;continue}}}return!1}}if(r&&o){let a;if(Jt.bidiS1LTR.test(u[0]))a=!1;else if(Jt.bidiS1RTL.test(u[0]))a=!0;else return!1;if(a){if(!Jt.bidiS2.test(e)||!Jt.bidiS3.test(e)||Jt.bidiS4EN.test(e)&&Jt.bidiS4AN.test(e))return!1}else if(!Jt.bidiS5.test(e)||!Jt.bidiS6.test(e))return!1}return!0}function qae(e){let t=e.map((r)=>{if(r.startsWith("xn--"))try{return gl.decode(r.substring(4))}catch{return""}return r}).join(".");return Jt.bidiDomain.test(t)}function dx(e,t){let r=vae(e,t);r=r.normalize("NFC");let n=r.split("."),s=qae(n),i=!1;for(let[o,u]of n.entries()){let a=u,c=t.transitionalProcessing;if(a.startsWith("xn--")){if(_E(a)){i=!0;continue}try{a=gl.decode(a.substring(4))}catch{if(!t.ignoreInvalidPunycode){i=!0;continue}}if(n[o]=a,a===""||!_E(a))i=!0;c=!1}if(i)continue;if(!kae(a,{...t,transitionalProcessing:c,isBidi:s}))i=!0}return{string:n.join("."),error:i}}function jae(e,{checkHyphens:t=!1,checkBidi:r=!1,checkJoiners:n=!1,useSTD3ASCIIRules:s=!1,verifyDNSLength:i=!1,transitionalProcessing:o=!1,ignoreInvalidPunycode:u=!1}={}){let a=dx(e,{checkHyphens:t,checkBidi:r,checkJoiners:n,useSTD3ASCIIRules:s,transitionalProcessing:o,ignoreInvalidPunycode:u}),c=a.string.split(".");if(c=c.map((l)=>{if(_E(l))try{return`xn--${gl.encode(l)}`}catch{a.error=!0}return l}),i){let l=c.join(".").length;if(l>253||l===0)a.error=!0;for(let f=0;f<c.length;++f)if(c[f].length>63||c[f].length===0){a.error=!0;break}}if(a.error)return null;return c.join(".")}function Lae(e,{checkHyphens:t=!1,checkBidi:r=!1,checkJoiners:n=!1,useSTD3ASCIIRules:s=!1,transitionalProcessing:i=!1,ignoreInvalidPunycode:o=!1}={}){let u=dx(e,{checkHyphens:t,checkBidi:r,checkJoiners:n,useSTD3ASCIIRules:s,transitionalProcessing:i,ignoreInvalidPunycode:o});return{domain:u.string,error:u.error}}px.exports={toASCII:jae,toUnicode:Lae}});var AE=g(function(nbe,gx){function EE(e){return e>=48&&e<=57}function yx(e){return e>=65&&e<=90||e>=97&&e<=122}function Uae(e){return yx(e)||EE(e)}function Vae(e){return EE(e)||e>=65&&e<=70||e>=97&&e<=102}gx.exports={isASCIIDigit:EE,isASCIIAlpha:yx,isASCIIAlphanumeric:Uae,isASCIIHex:Vae}});var Xp=g(function(sbe,_x){var zae=new TextEncoder,Wae=new TextDecoder("utf-8",{ignoreBOM:!0});function Hae(e){return zae.encode(e)}function Kae(e){return Wae.decode(e)}_x.exports={utf8Encode:Hae,utf8DecodeWithoutBOM:Kae}});var Zp=g(function(ibe,bx){var{isASCIIHex:Ex}=AE(),{utf8Encode:Ax}=Xp();function et(e){return e.codePointAt(0)}function Gae(e){let t=e.toString(16).toUpperCase();if(t.length===1)t=`0${t}`;return`%${t}`}function Ox(e){let t=new Uint8Array(e.byteLength),r=0;for(let n=0;n<e.byteLength;++n){let s=e[n];if(s!==37)t[r++]=s;else if(s===37&&(!Ex(e[n+1])||!Ex(e[n+2])))t[r++]=s;else{let i=parseInt(String.fromCodePoint(e[n+1],e[n+2]),16);t[r++]=i,n+=2}}return t.slice(0,r)}function Yae(e){let t=Ax(e);return Ox(t)}function OE(e){return e<=31||e>126}var Jae=new Set([et(" "),et('"'),et("<"),et(">"),et("`")]);function Qae(e){return OE(e)||Jae.has(e)}var Xae=new Set([et(" "),et('"'),et("#"),et("<"),et(">")]);function SE(e){return OE(e)||Xae.has(e)}function Zae(e){return SE(e)||e===et("'")}var ece=new Set([et("?"),et("`"),et("{"),et("}"),et("^")]);function Sx(e){return SE(e)||ece.has(e)}var tce=new Set([et("/"),et(":"),et(";"),et("="),et("@"),et("["),et("\\"),et("]"),et("|")]);function wx(e){return Sx(e)||tce.has(e)}var rce=new Set([et("$"),et("%"),et("&"),et("+"),et(",")]);function nce(e){return wx(e)||rce.has(e)}var sce=new Set([et("!"),et("'"),et("("),et(")"),et("~")]);function ice(e){return nce(e)||sce.has(e)}function Cx(e,t){let r=Ax(e),n="";for(let s of r)if(!t(s))n+=String.fromCharCode(s);else n+=Gae(s);return n}function oce(e,t){return Cx(String.fromCodePoint(e),t)}function uce(e,t,r=!1){let n="";for(let s of e)if(r&&s===" ")n+="+";else n+=Cx(s,t);return n}bx.exports={isC0ControlPercentEncode:OE,isFragmentPercentEncode:Qae,isQueryPercentEncode:SE,isSpecialQueryPercentEncode:Zae,isPathPercentEncode:Sx,isUserinfoPercentEncode:wx,isURLEncodedPercentEncode:ice,percentDecodeString:Yae,percentDecodeBytes:Ox,utf8PercentEncodeString:uce,utf8PercentEncodeCodePoint:oce}});var ME=g(function(t0,Yn){var Px=mx(),st=AE(),{utf8DecodeWithoutBOM:ace}=Xp(),{percentDecodeString:cce,utf8PercentEncodeCodePoint:r0,utf8PercentEncodeString:n0,isC0ControlPercentEncode:Bx,isFragmentPercentEncode:lce,isQueryPercentEncode:hce,isSpecialQueryPercentEncode:fce,isPathPercentEncode:dce,isUserinfoPercentEncode:bE}=Zp();function W(e){return e.codePointAt(0)}var Fx={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Re=Symbol("failure");function Dx(e){return[...e].length}function Tx(e,t){let r=e[t];return isNaN(r)?void 0:String.fromCodePoint(r)}function Mx(e){return e==="."||e.toLowerCase()==="%2e"}function pce(e){return e=e.toLowerCase(),e===".."||e==="%2e."||e===".%2e"||e==="%2e%2e"}function mce(e,t){return st.isASCIIAlpha(e)&&(t===W(":")||t===W("|"))}function Nx(e){return e.length===2&&st.isASCIIAlpha(e.codePointAt(0))&&(e[1]===":"||e[1]==="|")}function yce(e){return e.length===2&&st.isASCIIAlpha(e.codePointAt(0))&&e[1]===":"}function Ix(e){return e.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|<|>|\?|@|\[|\\|\]|\^|\|/u)!==-1}function gce(e){return Ix(e)||e.search(/[\u0000-\u001F]|%|\u007F/u)!==-1}function e0(e){return Fx[e]!==void 0}function mn(e){return e0(e.scheme)}function wE(e){return!e0(e.scheme)}function Rx(e){return Fx[e]}function $x(e){if(e==="")return Re;let t=10;if(e.length>=2&&e.charAt(0)==="0"&&e.charAt(1).toLowerCase()==="x")e=e.substring(2),t=16;else if(e.length>=2&&e.charAt(0)==="0")e=e.substring(1),t=8;if(e==="")return 0;let r=/[^0-7]/u;if(t===10)r=/[^0-9]/u;if(t===16)r=/[^0-9A-Fa-f]/u;if(r.test(e))return Re;return parseInt(e,t)}function _ce(e){let t=e.split(".");if(t[t.length-1]===""){if(t.length>1)t.pop()}if(t.length>4)return Re;let r=[];for(let i of t){let o=$x(i);if(o===Re)return Re;r.push(o)}for(let i=0;i<r.length-1;++i)if(r[i]>255)return Re;if(r[r.length-1]>=256**(5-r.length))return Re;let n=r.pop(),s=0;for(let i of r)n+=i*256**(3-s),++s;return n}function Ece(e){let t="",r=e;for(let n=1;n<=4;++n){if(t=String(r%256)+t,n!==4)t=`.${t}`;r=Math.floor(r/256)}return t}function Ace(e){let t=[0,0,0,0,0,0,0,0],r=0,n=null,s=0;if(e=Array.from(e,(i)=>i.codePointAt(0)),e[s]===W(":")){if(e[s+1]!==W(":"))return Re;s+=2,++r,n=r}while(s<e.length){if(r===8)return Re;if(e[s]===W(":")){if(n!==null)return Re;++s,++r,n=r;continue}let i=0,o=0;while(o<4&&st.isASCIIHex(e[s]))i=i*16+parseInt(Tx(e,s),16),++s,++o;if(e[s]===W(".")){if(o===0)return Re;if(s-=o,r>6)return Re;let u=0;while(e[s]!==void 0){let a=null;if(u>0)if(e[s]===W(".")&&u<4)++s;else return Re;if(!st.isASCIIDigit(e[s]))return Re;while(st.isASCIIDigit(e[s])){let c=parseInt(Tx(e,s));if(a===null)a=c;else if(a===0)return Re;else a=a*10+c;if(a>255)return Re;++s}if(t[r]=t[r]*256+a,++u,u===2||u===4)++r}if(u!==4)return Re;break}else if(e[s]===W(":")){if(++s,e[s]===void 0)return Re}else if(e[s]!==void 0)return Re;t[r]=i,++r}if(n!==null){let i=r-n;r=7;while(r!==0&&i>0){let o=t[n+i-1];t[n+i-1]=t[r],t[r]=o,--r,--i}}else if(n===null&&r!==8)return Re;return t}function Oce(e){let t="",r=Cce(e),n=!1;for(let s=0;s<=7;++s){if(n&&e[s]===0)continue;else if(n)n=!1;if(r===s){t+=s===0?"::":":",n=!0;continue}if(t+=e[s].toString(16),s!==7)t+=":"}return t}function CE(e,t=!1){if(e[0]==="["){if(e[e.length-1]!=="]")return Re;return Ace(e.substring(1,e.length-1))}if(t)return wce(e);let r=ace(cce(e)),n=bce(r);if(n===Re)return Re;if(Sce(n))return _ce(n);return n}function Sce(e){let t=e.split(".");if(t[t.length-1]===""){if(t.length===1)return!1;t.pop()}let r=t[t.length-1];if($x(r)!==Re)return!0;if(/^[0-9]+$/u.test(r))return!0;return!1}function wce(e){if(Ix(e))return Re;return n0(e,Bx)}function Cce(e){let t=null,r=1,n=null,s=0;for(let i=0;i<e.length;++i)if(e[i]!==0){if(s>r)t=n,r=s;n=null,s=0}else{if(n===null)n=i;++s}if(s>r)return n;return t}function DE(e){if(typeof e==="number")return Ece(e);if(e instanceof Array)return`[${Oce(e)}]`;return e}function bce(e,t=!1){let r=Px.toASCII(e,{checkHyphens:t,checkBidi:!0,checkJoiners:!0,useSTD3ASCIIRules:t,transitionalProcessing:!1,verifyDNSLength:t,ignoreInvalidPunycode:!1});if(r===null)return Re;if(!t){if(r==="")return Re;if(gce(r))return Re}return r}function Dce(e){let t=0,r=e.length;for(;t<r;++t)if(e.charCodeAt(t)>32)break;for(;r>t;--r)if(e.charCodeAt(r-1)>32)break;return e.substring(t,r)}function Tce(e){return e.replace(/\u0009|\u000A|\u000D/ug,"")}function vx(e){let{path:t}=e;if(t.length===0)return;if(e.scheme==="file"&&t.length===1&&xce(t[0]))return;t.pop()}function kx(e){return e.username!==""||e.password!==""}function Mce(e){return e.host===null||e.host===""||e.scheme==="file"}function Nh(e){return typeof e.path==="string"}function xce(e){return/^[A-Za-z]:$/u.test(e)}function hr(e,t,r,n,s){if(this.pointer=0,this.input=e,this.base=t||null,this.encodingOverride=r||"utf-8",this.stateOverride=s,this.url=n,this.failure=!1,this.parseError=!1,!this.url){this.url={scheme:"",username:"",password:"",host:null,port:null,path:[],query:null,fragment:null};let o=Dce(this.input);if(o!==this.input)this.parseError=!0;this.input=o}let i=Tce(this.input);if(i!==this.input)this.parseError=!0;this.input=i,this.state=s||"scheme start",this.buffer="",this.atSignSeen=!1,this.insideBrackets=!1,this.passwordTokenSeen=!1,this.input=Array.from(this.input,(o)=>o.codePointAt(0));for(;this.pointer<=this.input.length;++this.pointer){let o=this.input[this.pointer],u=isNaN(o)?void 0:String.fromCodePoint(o),a=this[`parse ${this.state}`](o,u);if(!a)break;else if(a===Re){this.failure=!0;break}}}hr.prototype["parse scheme start"]=function(t,r){if(st.isASCIIAlpha(t))this.buffer+=r.toLowerCase(),this.state="scheme";else if(!this.stateOverride)this.state="no scheme",--this.pointer;else return this.parseError=!0,Re;return!0};hr.prototype["parse scheme"]=function(t,r){if(st.isASCIIAlphanumeric(t)||t===W("+")||t===W("-")||t===W("."))this.buffer+=r.toLowerCase();else if(t===W(":")){if(this.stateOverride){if(mn(this.url)&&!e0(this.buffer))return!1;if(!mn(this.url)&&e0(this.buffer))return!1;if((kx(this.url)||this.url.port!==null)&&this.buffer==="file")return!1;if(this.url.scheme==="file"&&this.url.host==="")return!1}if(this.url.scheme=this.buffer,this.stateOverride){if(this.url.port===Rx(this.url.scheme))this.url.port=null;return!1}if(this.buffer="",this.url.scheme==="file"){if(this.input[this.pointer+1]!==W("/")||this.input[this.pointer+2]!==W("/"))this.parseError=!0;this.state="file"}else if(mn(this.url)&&this.base!==null&&this.base.scheme===this.url.scheme)this.state="special relative or authority";else if(mn(this.url))this.state="special authority slashes";else if(this.input[this.pointer+1]===W("/"))this.state="path or authority",++this.pointer;else this.url.path="",this.state="opaque path"}else if(!this.stateOverride)this.buffer="",this.state="no scheme",this.pointer=-1;else return this.parseError=!0,Re;return!0};hr.prototype["parse no scheme"]=function(t){if(this.base===null||Nh(this.base)&&t!==W("#"))return Re;else if(Nh(this.base)&&t===W("#"))this.url.scheme=this.base.scheme,this.url.path=this.base.path,this.url.query=this.base.query,this.url.fragment="",this.state="fragment";else if(this.base.scheme==="file")this.state="file",--this.pointer;else this.state="relative",--this.pointer;return!0};hr.prototype["parse special relative or authority"]=function(t){if(t===W("/")&&this.input[this.pointer+1]===W("/"))this.state="special authority ignore slashes",++this.pointer;else this.parseError=!0,this.state="relative",--this.pointer;return!0};hr.prototype["parse path or authority"]=function(t){if(t===W("/"))this.state="authority";else this.state="path",--this.pointer;return!0};hr.prototype["parse relative"]=function(t){if(this.url.scheme=this.base.scheme,t===W("/"))this.state="relative slash";else if(mn(this.url)&&t===W("\\"))this.parseError=!0,this.state="relative slash";else if(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(),this.url.query=this.base.query,t===W("?"))this.url.query="",this.state="query";else if(t===W("#"))this.url.fragment="",this.state="fragment";else if(!isNaN(t))this.url.query=null,this.url.path.pop(),this.state="path",--this.pointer;return!0};hr.prototype["parse relative slash"]=function(t){if(mn(this.url)&&(t===W("/")||t===W("\\"))){if(t===W("\\"))this.parseError=!0;this.state="special authority ignore slashes"}else if(t===W("/"))this.state="authority";else this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.state="path",--this.pointer;return!0};hr.prototype["parse special authority slashes"]=function(t){if(t===W("/")&&this.input[this.pointer+1]===W("/"))this.state="special authority ignore slashes",++this.pointer;else this.parseError=!0,this.state="special authority ignore slashes",--this.pointer;return!0};hr.prototype["parse special authority ignore slashes"]=function(t){if(t!==W("/")&&t!==W("\\"))this.state="authority",--this.pointer;else this.parseError=!0;return!0};hr.prototype["parse authority"]=function(t,r){if(t===W("@")){if(this.parseError=!0,this.atSignSeen)this.buffer=`%40${this.buffer}`;this.atSignSeen=!0;let n=Dx(this.buffer);for(let s=0;s<n;++s){let i=this.buffer.codePointAt(s);if(i===W(":")&&!this.passwordTokenSeen){this.passwordTokenSeen=!0;continue}let o=r0(i,bE);if(this.passwordTokenSeen)this.url.password+=o;else this.url.username+=o}this.buffer=""}else if(isNaN(t)||t===W("/")||t===W("?")||t===W("#")||mn(this.url)&&t===W("\\")){if(this.atSignSeen&&this.buffer==="")return this.parseError=!0,Re;this.pointer-=Dx(this.buffer)+1,this.buffer="",this.state="host"}else this.buffer+=r;return!0};hr.prototype["parse hostname"]=hr.prototype["parse host"]=function(t,r){if(this.stateOverride&&this.url.scheme==="file")--this.pointer,this.state="file host";else if(t===W(":")&&!this.insideBrackets){if(this.buffer==="")return this.parseError=!0,Re;if(this.stateOverride==="hostname")return Re;let n=CE(this.buffer,wE(this.url));if(n===Re)return Re;this.url.host=n,this.buffer="",this.state="port"}else if(isNaN(t)||t===W("/")||t===W("?")||t===W("#")||mn(this.url)&&t===W("\\")){if(--this.pointer,mn(this.url)&&this.buffer==="")return this.parseError=!0,Re;else if(this.stateOverride&&this.buffer===""&&(kx(this.url)||this.url.port!==null))return this.parseError=!0,Re;let n=CE(this.buffer,wE(this.url));if(n===Re)return Re;if(this.url.host=n,this.buffer="",this.state="path start",this.stateOverride)return!1}else{if(t===W("["))this.insideBrackets=!0;else if(t===W("]"))this.insideBrackets=!1;this.buffer+=r}return!0};hr.prototype["parse port"]=function(t,r){if(st.isASCIIDigit(t))this.buffer+=r;else if(isNaN(t)||t===W("/")||t===W("?")||t===W("#")||mn(this.url)&&t===W("\\")||this.stateOverride){if(this.buffer!==""){let n=parseInt(this.buffer);if(n>65535)return this.parseError=!0,Re;if(this.url.port=n===Rx(this.url.scheme)?null:n,this.buffer="",this.stateOverride)return!1}if(this.stateOverride)return Re;this.state="path start",--this.pointer}else return this.parseError=!0,Re;return!0};var Pce=new Set([W("/"),W("\\"),W("?"),W("#")]);function qx(e,t){let r=e.length-t;return r>=2&&mce(e[t],e[t+1])&&(r===2||Pce.has(e[t+2]))}hr.prototype["parse file"]=function(t){if(this.url.scheme="file",this.url.host="",t===W("/")||t===W("\\")){if(t===W("\\"))this.parseError=!0;this.state="file slash"}else if(this.base!==null&&this.base.scheme==="file"){if(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query=this.base.query,t===W("?"))this.url.query="",this.state="query";else if(t===W("#"))this.url.fragment="",this.state="fragment";else if(!isNaN(t)){if(this.url.query=null,!qx(this.input,this.pointer))vx(this.url);else this.parseError=!0,this.url.path=[];this.state="path",--this.pointer}}else this.state="path",--this.pointer;return!0};hr.prototype["parse file slash"]=function(t){if(t===W("/")||t===W("\\")){if(t===W("\\"))this.parseError=!0;this.state="file host"}else{if(this.base!==null&&this.base.scheme==="file"){if(!qx(this.input,this.pointer)&&yce(this.base.path[0]))this.url.path.push(this.base.path[0]);this.url.host=this.base.host}this.state="path",--this.pointer}return!0};hr.prototype["parse file host"]=function(t,r){if(isNaN(t)||t===W("/")||t===W("\\")||t===W("?")||t===W("#"))if(--this.pointer,!this.stateOverride&&Nx(this.buffer))this.parseError=!0,this.state="path";else if(this.buffer===""){if(this.url.host="",this.stateOverride)return!1;this.state="path start"}else{let n=CE(this.buffer,wE(this.url));if(n===Re)return Re;if(n==="localhost")n="";if(this.url.host=n,this.stateOverride)return!1;this.buffer="",this.state="path start"}else this.buffer+=r;return!0};hr.prototype["parse path start"]=function(t){if(mn(this.url)){if(t===W("\\"))this.parseError=!0;if(this.state="path",t!==W("/")&&t!==W("\\"))--this.pointer}else if(!this.stateOverride&&t===W("?"))this.url.query="",this.state="query";else if(!this.stateOverride&&t===W("#"))this.url.fragment="",this.state="fragment";else if(t!==void 0){if(this.state="path",t!==W("/"))--this.pointer}else if(this.stateOverride&&this.url.host===null)this.url.path.push("");return!0};hr.prototype["parse path"]=function(t){if(isNaN(t)||t===W("/")||mn(this.url)&&t===W("\\")||!this.stateOverride&&(t===W("?")||t===W("#"))){if(mn(this.url)&&t===W("\\"))this.parseError=!0;if(pce(this.buffer)){if(vx(this.url),t!==W("/")&&!(mn(this.url)&&t===W("\\")))this.url.path.push("")}else if(Mx(this.buffer)&&t!==W("/")&&!(mn(this.url)&&t===W("\\")))this.url.path.push("");else if(!Mx(this.buffer)){if(this.url.scheme==="file"&&this.url.path.length===0&&Nx(this.buffer))this.buffer=`${this.buffer[0]}:`;this.url.path.push(this.buffer)}if(this.buffer="",t===W("?"))this.url.query="",this.state="query";if(t===W("#"))this.url.fragment="",this.state="fragment"}else{if(t===W("%")&&(!st.isASCIIHex(this.input[this.pointer+1])||!st.isASCIIHex(this.input[this.pointer+2])))this.parseError=!0;this.buffer+=r0(t,dce)}return!0};hr.prototype["parse opaque path"]=function(t){if(t===W("?"))this.url.query="",this.state="query";else if(t===W("#"))this.url.fragment="",this.state="fragment";else if(t===W(" ")){let r=this.input[this.pointer+1];if(r===W("?")||r===W("#"))this.url.path+="%20";else this.url.path+=" "}else{if(!isNaN(t)&&t!==W("%"))this.parseError=!0;if(t===W("%")&&(!st.isASCIIHex(this.input[this.pointer+1])||!st.isASCIIHex(this.input[this.pointer+2])))this.parseError=!0;if(!isNaN(t))this.url.path+=r0(t,Bx)}return!0};hr.prototype["parse query"]=function(t,r){if(!mn(this.url)||this.url.scheme==="ws"||this.url.scheme==="wss")this.encodingOverride="utf-8";if(!this.stateOverride&&t===W("#")||isNaN(t)){let n=mn(this.url)?fce:hce;if(this.url.query+=n0(this.buffer,n),this.buffer="",t===W("#"))this.url.fragment="",this.state="fragment"}else if(!isNaN(t)){if(t===W("%")&&(!st.isASCIIHex(this.input[this.pointer+1])||!st.isASCIIHex(this.input[this.pointer+2])))this.parseError=!0;this.buffer+=r}return!0};hr.prototype["parse fragment"]=function(t){if(!isNaN(t)){if(t===W("%")&&(!st.isASCIIHex(this.input[this.pointer+1])||!st.isASCIIHex(this.input[this.pointer+2])))this.parseError=!0;this.url.fragment+=r0(t,lce)}return!0};function Bce(e,t){let r=`${e.scheme}:`;if(e.host!==null){if(r+="//",e.username!==""||e.password!==""){if(r+=e.username,e.password!=="")r+=`:${e.password}`;r+="@"}if(r+=DE(e.host),e.port!==null)r+=`:${e.port}`}if(e.host===null&&!Nh(e)&&e.path.length>1&&e.path[0]==="")r+="/.";if(r+=TE(e),e.query!==null)r+=`?${e.query}`;if(!t&&e.fragment!==null)r+=`#${e.fragment}`;return r}function Fce(e){let t=`${e.scheme}://`;if(t+=DE(e.host),e.port!==null)t+=`:${e.port}`;return t}function TE(e){if(Nh(e))return e.path;let t="";for(let r of e.path)t+=`/${r}`;return t}t0.serializeURL=Bce;t0.serializePath=TE;t0.serializeURLOrigin=function(e){switch(e.scheme){case"blob":{let t=t0.parseURL(TE(e));if(t===null)return"null";if(t.scheme!=="http"&&t.scheme!=="https")return"null";return t0.serializeURLOrigin(t)}case"ftp":case"http":case"https":case"ws":case"wss":return Fce({scheme:e.scheme,host:e.host,port:e.port});case"file":return"null";default:return"null"}};t0.basicURLParse=function(e,t){if(t===void 0)t={};let r=new hr(e,t.baseURL,t.encodingOverride,t.url,t.stateOverride);if(r.failure)return null;return r.url};t0.setTheUsername=function(e,t){e.username=n0(t,bE)};t0.setThePassword=function(e,t){e.password=n0(t,bE)};t0.serializeHost=DE;t0.cannotHaveAUsernamePasswordPort=Mce;t0.hasAnOpaquePath=Nh;t0.serializeInteger=function(e){return String(e)};t0.parseURL=function(e,t){if(t===void 0)t={};return t0.basicURLParse(e,{baseURL:t.baseURL,encodingOverride:t.encodingOverride})}});var xE=g(function(obe,Kx){var{utf8Encode:Uce,utf8DecodeWithoutBOM:Lx}=Xp(),{percentDecodeBytes:Ux,utf8PercentEncodeString:Vx,isURLEncodedPercentEncode:zx}=Zp();function Wx(e){return e.codePointAt(0)}function Vce(e){let t=Hce(e,Wx("&")),r=[];for(let n of t){if(n.length===0)continue;let s,i,o=n.indexOf(Wx("="));if(o>=0)s=n.slice(0,o),i=n.slice(o+1);else s=n,i=new Uint8Array(0);s=Hx(s,43,32),i=Hx(i,43,32);let u=Lx(Ux(s)),a=Lx(Ux(i));r.push([u,a])}return r}function zce(e){return Vce(Uce(e))}function Wce(e){let t="";for(let[r,n]of e.entries()){let s=Vx(n[0],zx,!0),i=Vx(n[1],zx,!0);if(r!==0)t+="&";t+=`${s}=${i}`}return t}function Hce(e,t){let r=[],n=0,s=e.indexOf(t);while(s>=0)r.push(e.slice(n,s)),n=s+1,s=e.indexOf(t,n);if(n!==e.length)r.push(e.slice(n));return r}function Hx(e,t,r){let n=e.indexOf(t);while(n>=0)e[n]=r,n=e.indexOf(t,n+1);return e}Kx.exports={parseUrlencodedString:zce,serializeUrlencoded:Wce}});var Gx=g(function(Kce){var s0=Yp(),ku=Qp();Kce.convert=(e,t,{context:r="The provided value"}={})=>{if(typeof t!=="function")throw new e.TypeError(r+" is not a function");function n(...s){let i=ku.tryWrapperForImpl(this),o;for(let u=0;u<s.length;u++)s[u]=ku.tryWrapperForImpl(s[u]);return o=Reflect.apply(t,i,s),o=s0.any(o,{context:r,globals:e}),o}return n.construct=(...s)=>{for(let o=0;o<s.length;o++)s[o]=ku.tryWrapperForImpl(s[o]);let i=Reflect.construct(t,s);return i=s0.any(i,{context:r,globals:e}),i},n[ku.wrapperSymbol]=t,n.objectReference=t,n}});var Yx=g(function(Yce){var _l=xE();Yce.implementation=class{constructor(t,r,{doNotStripQMark:n=!1}){let s=r[0];if(this._list=[],this._url=null,!n&&typeof s==="string"&&s[0]==="?")s=s.slice(1);if(Array.isArray(s))for(let i of s){if(i.length!==2)throw TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence's element does not contain exactly two elements.");this._list.push([i[0],i[1]])}else if(typeof s==="object"&&Object.getPrototypeOf(s)===null)for(let i of Object.keys(s)){let o=s[i];this._list.push([i,o])}else this._list=_l.parseUrlencodedString(s)}_updateSteps(){if(this._url!==null){let t=_l.serializeUrlencoded(this._list);if(t==="")t=null;this._url._url.query=t}}get size(){return this._list.length}append(t,r){this._list.push([t,r]),this._updateSteps()}delete(t,r){let n=0;while(n<this._list.length)if(this._list[n][0]===t&&(r===void 0||this._list[n][1]===r))this._list.splice(n,1);else n++;this._updateSteps()}get(t){for(let r of this._list)if(r[0]===t)return r[1];return null}getAll(t){let r=[];for(let n of this._list)if(n[0]===t)r.push(n[1]);return r}has(t,r){for(let n of this._list)if(n[0]===t&&(r===void 0||n[1]===r))return!0;return!1}set(t,r){let n=!1,s=0;while(s<this._list.length)if(this._list[s][0]===t)if(n)this._list.splice(s,1);else n=!0,this._list[s][1]=r,s++;else s++;if(!n)this._list.push([t,r]);this._updateSteps()}sort(){this._list.sort((t,r)=>{if(t[0]<r[0])return-1;if(t[0]>r[0])return 1;return 0}),this._updateSteps()}[Symbol.iterator](){return this._list[Symbol.iterator]()}toString(){return _l.serializeUrlencoded(this._list)}}});var BE=g(function(sr){var Pt=Yp(),be=Qp(),Qx=Gx(),Jx=be.newObjectInRealm,Sr=be.implSymbol,Xx=be.ctorRegistrySymbol;sr.is=(e)=>be.isObject(e)&&Object.hasOwn(e,Sr)&&e[Sr]instanceof qu.implementation;sr.isImpl=(e)=>be.isObject(e)&&e instanceof qu.implementation;sr.convert=(e,t,{context:r="The provided value"}={})=>{if(sr.is(t))return be.implForWrapper(t);throw new e.TypeError(`${r} is not of type 'URLSearchParams'.`)};sr.createDefaultIterator=(e,t,r)=>{let s=e[Xx]["URLSearchParams Iterator"],i=Object.create(s);return Object.defineProperty(i,be.iterInternalSymbol,{value:{target:t,kind:r,index:0},configurable:!0}),i};function Zx(e,t){let r;if(t!==void 0)r=t.prototype;if(!be.isObject(r))r=e[Xx].URLSearchParams.prototype;return Object.create(r)}sr.create=(e,t,r)=>{let n=Zx(e);return sr.setup(n,e,t,r)};sr.createImpl=(e,t,r)=>{let n=sr.create(e,t,r);return be.implForWrapper(n)};sr._internalSetup=(e,t)=>{};sr.setup=(e,t,r=[],n={})=>{if(n.wrapper=e,sr._internalSetup(e,t),Object.defineProperty(e,Sr,{value:new qu.implementation(t,r,n),configurable:!0}),e[Sr][be.wrapperSymbol]=e,qu.init)qu.init(e[Sr]);return e};sr.new=(e,t)=>{let r=Zx(e,t);if(sr._internalSetup(r,e),Object.defineProperty(r,Sr,{value:Object.create(qu.implementation.prototype),configurable:!0}),r[Sr][be.wrapperSymbol]=r,qu.init)qu.init(r[Sr]);return r[Sr]};var Qce=new Set(["Window","Worker"]);sr.install=(e,t)=>{if(!t.some((s)=>Qce.has(s)))return;let r=be.initCtorRegistry(e);class n{constructor(){let s=[];{let i=arguments[0];if(i!==void 0)if(be.isObject(i))if(i[Symbol.iterator]!==void 0)if(!be.isObject(i))throw new e.TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence is not an iterable object.");else{let o=[],u=i;for(let a of u){if(!be.isObject(a))throw new e.TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence's element is not an iterable object.");else{let c=[],l=a;for(let f of l)f=Pt.USVString(f,{context:"Failed to construct 'URLSearchParams': parameter 1 sequence's element's element",globals:e}),c.push(f);a=c}o.push(a)}i=o}else if(!be.isObject(i))throw new e.TypeError("Failed to construct 'URLSearchParams': parameter 1 record is not an object.");else{let o=Object.create(null);for(let u of Reflect.ownKeys(i)){let a=Object.getOwnPropertyDescriptor(i,u);if(a&&a.enumerable){let c=u;c=Pt.USVString(c,{context:"Failed to construct 'URLSearchParams': parameter 1 record's key",globals:e});let l=i[u];l=Pt.USVString(l,{context:"Failed to construct 'URLSearchParams': parameter 1 record's value",globals:e}),o[c]=l}}i=o}else i=Pt.USVString(i,{context:"Failed to construct 'URLSearchParams': parameter 1",globals:e});else i="";s.push(i)}return sr.setup(Object.create(new.target.prototype),e,s)}append(s,i){let o=this!==null&&this!==void 0?this:e;if(!sr.is(o))throw new e.TypeError("'append' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<2)throw new e.TypeError(`Failed to execute 'append' on 'URLSearchParams': 2 arguments required, but only ${arguments.length} present.`);let u=[];{let a=arguments[0];a=Pt.USVString(a,{context:"Failed to execute 'append' on 'URLSearchParams': parameter 1",globals:e}),u.push(a)}{let a=arguments[1];a=Pt.USVString(a,{context:"Failed to execute 'append' on 'URLSearchParams': parameter 2",globals:e}),u.push(a)}return be.tryWrapperForImpl(o[Sr].append(...u))}delete(s){let i=this!==null&&this!==void 0?this:e;if(!sr.is(i))throw new e.TypeError("'delete' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new e.TypeError(`Failed to execute 'delete' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.`);let o=[];{let u=arguments[0];u=Pt.USVString(u,{context:"Failed to execute 'delete' on 'URLSearchParams': parameter 1",globals:e}),o.push(u)}{let u=arguments[1];if(u!==void 0)u=Pt.USVString(u,{context:"Failed to execute 'delete' on 'URLSearchParams': parameter 2",globals:e});o.push(u)}return be.tryWrapperForImpl(i[Sr].delete(...o))}get(s){let i=this!==null&&this!==void 0?this:e;if(!sr.is(i))throw new e.TypeError("'get' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new e.TypeError(`Failed to execute 'get' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.`);let o=[];{let u=arguments[0];u=Pt.USVString(u,{context:"Failed to execute 'get' on 'URLSearchParams': parameter 1",globals:e}),o.push(u)}return i[Sr].get(...o)}getAll(s){let i=this!==null&&this!==void 0?this:e;if(!sr.is(i))throw new e.TypeError("'getAll' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new e.TypeError(`Failed to execute 'getAll' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.`);let o=[];{let u=arguments[0];u=Pt.USVString(u,{context:"Failed to execute 'getAll' on 'URLSearchParams': parameter 1",globals:e}),o.push(u)}return be.tryWrapperForImpl(i[Sr].getAll(...o))}has(s){let i=this!==null&&this!==void 0?this:e;if(!sr.is(i))throw new e.TypeError("'has' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new e.TypeError(`Failed to execute 'has' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.`);let o=[];{let u=arguments[0];u=Pt.USVString(u,{context:"Failed to execute 'has' on 'URLSearchParams': parameter 1",globals:e}),o.push(u)}{let u=arguments[1];if(u!==void 0)u=Pt.USVString(u,{context:"Failed to execute 'has' on 'URLSearchParams': parameter 2",globals:e});o.push(u)}return i[Sr].has(...o)}set(s,i){let o=this!==null&&this!==void 0?this:e;if(!sr.is(o))throw new e.TypeError("'set' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<2)throw new e.TypeError(`Failed to execute 'set' on 'URLSearchParams': 2 arguments required, but only ${arguments.length} present.`);let u=[];{let a=arguments[0];a=Pt.USVString(a,{context:"Failed to execute 'set' on 'URLSearchParams': parameter 1",globals:e}),u.push(a)}{let a=arguments[1];a=Pt.USVString(a,{context:"Failed to execute 'set' on 'URLSearchParams': parameter 2",globals:e}),u.push(a)}return be.tryWrapperForImpl(o[Sr].set(...u))}sort(){let s=this!==null&&this!==void 0?this:e;if(!sr.is(s))throw new e.TypeError("'sort' called on an object that is not a valid instance of URLSearchParams.");return be.tryWrapperForImpl(s[Sr].sort())}toString(){let s=this!==null&&this!==void 0?this:e;if(!sr.is(s))throw new e.TypeError("'toString' called on an object that is not a valid instance of URLSearchParams.");return s[Sr].toString()}keys(){if(!sr.is(this))throw new e.TypeError("'keys' called on an object that is not a valid instance of URLSearchParams.");return sr.createDefaultIterator(e,this,"key")}values(){if(!sr.is(this))throw new e.TypeError("'values' called on an object that is not a valid instance of URLSearchParams.");return sr.createDefaultIterator(e,this,"value")}entries(){if(!sr.is(this))throw new e.TypeError("'entries' called on an object that is not a valid instance of URLSearchParams.");return sr.createDefaultIterator(e,this,"key+value")}forEach(s){if(!sr.is(this))throw new e.TypeError("'forEach' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new e.TypeError("Failed to execute 'forEach' on 'iterable': 1 argument required, but only 0 present.");s=Qx.convert(e,s,{context:"Failed to execute 'forEach' on 'iterable': The callback provided as parameter 1"});let i=arguments[1],o=Array.from(this[Sr]),u=0;while(u<o.length){let[a,c]=o[u].map(be.tryWrapperForImpl);s.call(i,c,a,this),o=Array.from(this[Sr]),u++}}get size(){let s=this!==null&&this!==void 0?this:e;if(!sr.is(s))throw new e.TypeError("'get size' called on an object that is not a valid instance of URLSearchParams.");return s[Sr].size}}Object.defineProperties(n.prototype,{append:{enumerable:!0},delete:{enumerable:!0},get:{enumerable:!0},getAll:{enumerable:!0},has:{enumerable:!0},set:{enumerable:!0},sort:{enumerable:!0},toString:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0},forEach:{enumerable:!0},size:{enumerable:!0},[Symbol.toStringTag]:{value:"URLSearchParams",configurable:!0},[Symbol.iterator]:{value:n.prototype.entries,configurable:!0,writable:!0}}),r.URLSearchParams=n,r["URLSearchParams Iterator"]=Object.create(r["%IteratorPrototype%"],{[Symbol.toStringTag]:{configurable:!0,value:"URLSearchParams Iterator"}}),be.define(r["URLSearchParams Iterator"],{next(){let s=this&&this[be.iterInternalSymbol];if(!s)throw new e.TypeError("next() called on a value that is not a URLSearchParams iterator object");let{target:i,kind:o,index:u}=s,a=Array.from(i[Sr]),c=a.length;if(u>=c)return Jx(e,{value:void 0,done:!0});let l=a[u];return s.index=u+1,Jx(e,be.iteratorResult(l.map(be.tryWrapperForImpl),o))}}),Object.defineProperty(e,"URLSearchParams",{configurable:!0,writable:!0,value:n})};var qu=Yx()});var nP=g(function(nle){var me=ME(),o0=xE(),rP=BE();nle.implementation=class e{constructor(t,[r,n]){let s=null;if(n!==void 0){if(s=me.basicURLParse(n),s===null)throw TypeError(`Invalid base URL: ${n}`)}let i=me.basicURLParse(r,{baseURL:s});if(i===null)throw TypeError(`Invalid URL: ${r}`);let o=i.query!==null?i.query:"";this._url=i,this._query=rP.createImpl(t,[o],{doNotStripQMark:!0}),this._query._url=this}static parse(t,r,n){try{return new e(t,[r,n])}catch{return null}}static canParse(t,r){let n=null;if(r!==void 0){if(n=me.basicURLParse(r),n===null)return!1}if(me.basicURLParse(t,{baseURL:n})===null)return!1;return!0}get href(){return me.serializeURL(this._url)}set href(t){let r=me.basicURLParse(t);if(r===null)throw TypeError(`Invalid URL: ${t}`);this._url=r,this._query._list.splice(0);let{query:n}=r;if(n!==null)this._query._list=o0.parseUrlencodedString(n)}get origin(){return me.serializeURLOrigin(this._url)}get protocol(){return`${this._url.scheme}:`}set protocol(t){me.basicURLParse(`${t}:`,{url:this._url,stateOverride:"scheme start"})}get username(){return this._url.username}set username(t){if(me.cannotHaveAUsernamePasswordPort(this._url))return;me.setTheUsername(this._url,t)}get password(){return this._url.password}set password(t){if(me.cannotHaveAUsernamePasswordPort(this._url))return;me.setThePassword(this._url,t)}get host(){let t=this._url;if(t.host===null)return"";if(t.port===null)return me.serializeHost(t.host);return`${me.serializeHost(t.host)}:${me.serializeInteger(t.port)}`}set host(t){if(me.hasAnOpaquePath(this._url))return;me.basicURLParse(t,{url:this._url,stateOverride:"host"})}get hostname(){if(this._url.host===null)return"";return me.serializeHost(this._url.host)}set hostname(t){if(me.hasAnOpaquePath(this._url))return;me.basicURLParse(t,{url:this._url,stateOverride:"hostname"})}get port(){if(this._url.port===null)return"";return me.serializeInteger(this._url.port)}set port(t){if(me.cannotHaveAUsernamePasswordPort(this._url))return;if(t==="")this._url.port=null;else me.basicURLParse(t,{url:this._url,stateOverride:"port"})}get pathname(){return me.serializePath(this._url)}set pathname(t){if(me.hasAnOpaquePath(this._url))return;this._url.path=[],me.basicURLParse(t,{url:this._url,stateOverride:"path start"})}get search(){if(this._url.query===null||this._url.query==="")return"";return`?${this._url.query}`}set search(t){let r=this._url;if(t===""){r.query=null,this._query._list=[];return}let n=t[0]==="?"?t.substring(1):t;r.query="",me.basicURLParse(n,{url:r,stateOverride:"query"}),this._query._list=o0.parseUrlencodedString(n)}get searchParams(){return this._query}get hash(){if(this._url.fragment===null||this._url.fragment==="")return"";return`#${this._url.fragment}`}set hash(t){if(t===""){this._url.fragment=null;return}let r=t[0]==="#"?t.substring(1):t;this._url.fragment="",me.basicURLParse(r,{url:this._url,stateOverride:"fragment"})}toJSON(){return this.href}}});var uP=g(function(At){var gt=Yp(),qt=Qp(),ht=qt.implSymbol,ile=qt.ctorRegistrySymbol;At.is=(e)=>qt.isObject(e)&&Object.hasOwn(e,ht)&&e[ht]instanceof co.implementation;At.isImpl=(e)=>qt.isObject(e)&&e instanceof co.implementation;At.convert=(e,t,{context:r="The provided value"}={})=>{if(At.is(t))return qt.implForWrapper(t);throw new e.TypeError(`${r} is not of type 'URL'.`)};function sP(e,t){let r;if(t!==void 0)r=t.prototype;if(!qt.isObject(r))r=e[ile].URL.prototype;return Object.create(r)}At.create=(e,t,r)=>{let n=sP(e);return At.setup(n,e,t,r)};At.createImpl=(e,t,r)=>{let n=At.create(e,t,r);return qt.implForWrapper(n)};At._internalSetup=(e,t)=>{};At.setup=(e,t,r=[],n={})=>{if(n.wrapper=e,At._internalSetup(e,t),Object.defineProperty(e,ht,{value:new co.implementation(t,r,n),configurable:!0}),e[ht][qt.wrapperSymbol]=e,co.init)co.init(e[ht]);return e};At.new=(e,t)=>{let r=sP(e,t);if(At._internalSetup(r,e),Object.defineProperty(r,ht,{value:Object.create(co.implementation.prototype),configurable:!0}),r[ht][qt.wrapperSymbol]=r,co.init)co.init(r[ht]);return r[ht]};var ole=new Set(["Window","Worker"]);At.install=(e,t)=>{if(!t.some((s)=>ole.has(s)))return;let r=qt.initCtorRegistry(e);class n{constructor(s){if(arguments.length<1)throw new e.TypeError(`Failed to construct 'URL': 1 argument required, but only ${arguments.length} present.`);let i=[];{let o=arguments[0];o=gt.USVString(o,{context:"Failed to construct 'URL': parameter 1",globals:e}),i.push(o)}{let o=arguments[1];if(o!==void 0)o=gt.USVString(o,{context:"Failed to construct 'URL': parameter 2",globals:e});i.push(o)}return At.setup(Object.create(new.target.prototype),e,i)}toJSON(){let s=this!==null&&this!==void 0?this:e;if(!At.is(s))throw new e.TypeError("'toJSON' called on an object that is not a valid instance of URL.");return s[ht].toJSON()}get href(){let s=this!==null&&this!==void 0?this:e;if(!At.is(s))throw new e.TypeError("'get href' called on an object that is not a valid instance of URL.");return s[ht].href}set href(s){let i=this!==null&&this!==void 0?this:e;if(!At.is(i))throw new e.TypeError("'set href' called on an object that is not a valid instance of URL.");s=gt.USVString(s,{context:"Failed to set the 'href' property on 'URL': The provided value",globals:e}),i[ht].href=s}toString(){let s=this;if(!At.is(s))throw new e.TypeError("'toString' called on an object that is not a valid instance of URL.");return s[ht].href}get origin(){let s=this!==null&&this!==void 0?this:e;if(!At.is(s))throw new e.TypeError("'get origin' called on an object that is not a valid instance of URL.");return s[ht].origin}get protocol(){let s=this!==null&&this!==void 0?this:e;if(!At.is(s))throw new e.TypeError("'get protocol' called on an object that is not a valid instance of URL.");return s[ht].protocol}set protocol(s){let i=this!==null&&this!==void 0?this:e;if(!At.is(i))throw new e.TypeError("'set protocol' called on an object that is not a valid instance of URL.");s=gt.USVString(s,{context:"Failed to set the 'protocol' property on 'URL': The provided value",globals:e}),i[ht].protocol=s}get username(){let s=this!==null&&this!==void 0?this:e;if(!At.is(s))throw new e.TypeError("'get username' called on an object that is not a valid instance of URL.");return s[ht].username}set username(s){let i=this!==null&&this!==void 0?this:e;if(!At.is(i))throw new e.TypeError("'set username' called on an object that is not a valid instance of URL.");s=gt.USVString(s,{context:"Failed to set the 'username' property on 'URL': The provided value",globals:e}),i[ht].username=s}get password(){let s=this!==null&&this!==void 0?this:e;if(!At.is(s))throw new e.TypeError("'get password' called on an object that is not a valid instance of URL.");return s[ht].password}set password(s){let i=this!==null&&this!==void 0?this:e;if(!At.is(i))throw new e.TypeError("'set password' called on an object that is not a valid instance of URL.");s=gt.USVString(s,{context:"Failed to set the 'password' property on 'URL': The provided value",globals:e}),i[ht].password=s}get host(){let s=this!==null&&this!==void 0?this:e;if(!At.is(s))throw new e.TypeError("'get host' called on an object that is not a valid instance of URL.");return s[ht].host}set host(s){let i=this!==null&&this!==void 0?this:e;if(!At.is(i))throw new e.TypeError("'set host' called on an object that is not a valid instance of URL.");s=gt.USVString(s,{context:"Failed to set the 'host' property on 'URL': The provided value",globals:e}),i[ht].host=s}get hostname(){let s=this!==null&&this!==void 0?this:e;if(!At.is(s))throw new e.TypeError("'get hostname' called on an object that is not a valid instance of URL.");return s[ht].hostname}set hostname(s){let i=this!==null&&this!==void 0?this:e;if(!At.is(i))throw new e.TypeError("'set hostname' called on an object that is not a valid instance of URL.");s=gt.USVString(s,{context:"Failed to set the 'hostname' property on 'URL': The provided value",globals:e}),i[ht].hostname=s}get port(){let s=this!==null&&this!==void 0?this:e;if(!At.is(s))throw new e.TypeError("'get port' called on an object that is not a valid instance of URL.");return s[ht].port}set port(s){let i=this!==null&&this!==void 0?this:e;if(!At.is(i))throw new e.TypeError("'set port' called on an object that is not a valid instance of URL.");s=gt.USVString(s,{context:"Failed to set the 'port' property on 'URL': The provided value",globals:e}),i[ht].port=s}get pathname(){let s=this!==null&&this!==void 0?this:e;if(!At.is(s))throw new e.TypeError("'get pathname' called on an object that is not a valid instance of URL.");return s[ht].pathname}set pathname(s){let i=this!==null&&this!==void 0?this:e;if(!At.is(i))throw new e.TypeError("'set pathname' called on an object that is not a valid instance of URL.");s=gt.USVString(s,{context:"Failed to set the 'pathname' property on 'URL': The provided value",globals:e}),i[ht].pathname=s}get search(){let s=this!==null&&this!==void 0?this:e;if(!At.is(s))throw new e.TypeError("'get search' called on an object that is not a valid instance of URL.");return s[ht].search}set search(s){let i=this!==null&&this!==void 0?this:e;if(!At.is(i))throw new e.TypeError("'set search' called on an object that is not a valid instance of URL.");s=gt.USVString(s,{context:"Failed to set the 'search' property on 'URL': The provided value",globals:e}),i[ht].search=s}get searchParams(){let s=this!==null&&this!==void 0?this:e;if(!At.is(s))throw new e.TypeError("'get searchParams' called on an object that is not a valid instance of URL.");return qt.getSameObject(this,"searchParams",()=>qt.tryWrapperForImpl(s[ht].searchParams))}get hash(){let s=this!==null&&this!==void 0?this:e;if(!At.is(s))throw new e.TypeError("'get hash' called on an object that is not a valid instance of URL.");return s[ht].hash}set hash(s){let i=this!==null&&this!==void 0?this:e;if(!At.is(i))throw new e.TypeError("'set hash' called on an object that is not a valid instance of URL.");s=gt.USVString(s,{context:"Failed to set the 'hash' property on 'URL': The provided value",globals:e}),i[ht].hash=s}static parse(s){if(arguments.length<1)throw new e.TypeError(`Failed to execute 'parse' on 'URL': 1 argument required, but only ${arguments.length} present.`);let i=[];{let o=arguments[0];o=gt.USVString(o,{context:"Failed to execute 'parse' on 'URL': parameter 1",globals:e}),i.push(o)}{let o=arguments[1];if(o!==void 0)o=gt.USVString(o,{context:"Failed to execute 'parse' on 'URL': parameter 2",globals:e});i.push(o)}return qt.tryWrapperForImpl(co.implementation.parse(e,...i))}static canParse(s){if(arguments.length<1)throw new e.TypeError(`Failed to execute 'canParse' on 'URL': 1 argument required, but only ${arguments.length} present.`);let i=[];{let o=arguments[0];o=gt.USVString(o,{context:"Failed to execute 'canParse' on 'URL': parameter 1",globals:e}),i.push(o)}{let o=arguments[1];if(o!==void 0)o=gt.USVString(o,{context:"Failed to execute 'canParse' on 'URL': parameter 2",globals:e});i.push(o)}return co.implementation.canParse(...i)}}if(Object.defineProperties(n.prototype,{toJSON:{enumerable:!0},href:{enumerable:!0},toString:{enumerable:!0},origin:{enumerable:!0},protocol:{enumerable:!0},username:{enumerable:!0},password:{enumerable:!0},host:{enumerable:!0},hostname:{enumerable:!0},port:{enumerable:!0},pathname:{enumerable:!0},search:{enumerable:!0},searchParams:{enumerable:!0},hash:{enumerable:!0},[Symbol.toStringTag]:{value:"URL",configurable:!0}}),Object.defineProperties(n,{parse:{enumerable:!0},canParse:{enumerable:!0}}),r.URL=n,Object.defineProperty(e,"URL",{configurable:!0,writable:!0,value:n}),t.includes("Window"))Object.defineProperty(e,"webkitURL",{configurable:!0,writable:!0,value:n})};var co=nP()});var aP=g(function(ple){var fle=uP(),dle=BE();ple.URL=fle;ple.URLSearchParams=dle});var cP=g(function(Ele){var{URL:gle,URLSearchParams:_le}=aP(),fr=ME(),u0=Zp(),a0={Array,Object,Promise,String,TypeError};gle.install(a0,["Window"]);_le.install(a0,["Window"]);Ele.URL=a0.URL;Ele.URLSearchParams=a0.URLSearchParams;Ele.parseURL=fr.parseURL;Ele.basicURLParse=fr.basicURLParse;Ele.serializeURL=fr.serializeURL;Ele.serializePath=fr.serializePath;Ele.serializeHost=fr.serializeHost;Ele.serializeInteger=fr.serializeInteger;Ele.serializeURLOrigin=fr.serializeURLOrigin;Ele.setTheUsername=fr.setTheUsername;Ele.setThePassword=fr.setThePassword;Ele.cannotHaveAUsernamePasswordPort=fr.cannotHaveAUsernamePasswordPort;Ele.hasAnOpaquePath=fr.hasAnOpaquePath;Ele.percentDecodeString=u0.percentDecodeString;Ele.percentDecodeBytes=u0.percentDecodeBytes});var hP=g(function(lo){var Rle=lo&&lo.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var s=Object.getOwnPropertyDescriptor(t,r);if(!s||("get"in s?!t.__esModule:s.writable||s.configurable))s={enumerable:!0,get:function(){return t[r]}};Object.defineProperty(e,n,s)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]}),$le=lo&&lo.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),vle=lo&&lo.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var s in r)if(Object.prototype.hasOwnProperty.call(r,s))n[n.length]=s;return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null){for(var n=e(t),s=0;s<n.length;s++)if(n[s]!=="default")Rle(r,t,n[s])}return $le(r,t),r}}();Object.defineProperty(lo,"__esModule",{value:!0});lo.redactValidConnectionString=kle;lo.redactConnectionString=qle;var lP=vle(NE());function kle(e,t){let r=e.clone(),n=t?.replacementString??"_credentials_",s=t?.redactUsernames??!0;if((r.username||r.password)&&s)r.username=n,r.password="";else if(r.password)r.password=n;if(r.searchParams.has("authMechanismProperties")){let i=new lP.CommaAndColonSeparatedRecord(r.searchParams.get("authMechanismProperties"));if(i.get("AWS_SESSION_TOKEN"))i.set("AWS_SESSION_TOKEN",n),r.searchParams.set("authMechanismProperties",i.toString())}if(r.searchParams.has("tlsCertificateKeyFilePassword"))r.searchParams.set("tlsCertificateKeyFilePassword",n);if(r.searchParams.has("proxyUsername")&&s)r.searchParams.set("proxyUsername",n);if(r.searchParams.has("proxyPassword"))r.searchParams.set("proxyPassword",n);return r}function qle(e,t){let r=t?.replacementString??"<credentials>",n=t?.redactUsernames??!0,s;try{s=new lP.default(e)}catch{}if(s)return t={...t,replacementString:"___credentials___"},s.redact(t).toString().replace(/___credentials___/g,r);let i=r,o=[(u)=>u.replace(n?/(\/\/)(.*)(@)/g:/(\/\/[^@]*:)(.*)(@)/g,`$1${i}$3`),(u)=>u.replace(/(AWS_SESSION_TOKEN(:|%3A))([^,&]+)/gi,`$1${i}`),(u)=>u.replace(/(tlsCertificateKeyFilePassword=)([^&]+)/gi,`$1${i}`),(u)=>n?u.replace(/(proxyUsername=)([^&]+)/gi,`$1${i}`):u,(u)=>u.replace(/(proxyPassword=)([^&]+)/gi,`$1${i}`)];for(let u of o)e=u(e);return e}});var NE=g(function(RE){Object.defineProperty(RE,"__esModule",{value:!0});RE.CommaAndColonSeparatedRecord=RE.ConnectionString=RE.redactConnectionString=void 0;var fP=cP(),c0=hP();Object.defineProperty(RE,"redactConnectionString",{enumerable:!0,get:function(){return c0.redactConnectionString}});var Ih="__this_is_a_placeholder__";function jle(e){return e.startsWith("mongodb://")||e.startsWith("mongodb+srv://")}var Lle=/^(?<protocol>[^/]+):\/\/(?:(?<username>[^:@]*)(?::(?<password>[^@]*))?@)?(?<hosts>(?!:)[^/?@]*)(?<rest>.*)/;class IE extends Map{delete(e){return super.delete(this._normalizeKey(e))}get(e){return super.get(this._normalizeKey(e))}has(e){return super.has(this._normalizeKey(e))}set(e,t){return super.set(this._normalizeKey(e),t)}_normalizeKey(e){e=`${e}`;for(let t of this.keys())if(t.toLowerCase()===e.toLowerCase()){e=t;break}return e}}function Ule(e){return class extends e{append(r,n){return super.append(this._normalizeKey(r),n)}delete(r){return super.delete(this._normalizeKey(r))}get(r){return super.get(this._normalizeKey(r))}getAll(r){return super.getAll(this._normalizeKey(r))}has(r){return super.has(this._normalizeKey(r))}set(r,n){return super.set(this._normalizeKey(r),n)}keys(){return super.keys()}values(){return super.values()}entries(){return super.entries()}[Symbol.iterator](){return super[Symbol.iterator]()}_normalizeKey(r){return IE.prototype._normalizeKey.call(this,r)}}}class dP extends fP.URL{}class qi extends Error{get name(){return"MongoParseError"}}class Rh extends dP{_hosts;constructor(e,t={}){let{looseValidation:r}=t;if(!r&&!jle(e))throw new qi('Invalid scheme, expected connection string to start with "mongodb://" or "mongodb+srv://"');let n=e.match(Lle);if(!n)throw new qi("Invalid connection string");let{protocol:s,username:i,password:o,hosts:u,rest:a}=n.groups??{};if(!r){if(!s||!u)throw new qi("Protocol and host list are required in the uri");try{decodeURIComponent(i??""),decodeURIComponent(o??"")}catch(f){throw new qi(f.message)}let l=/[:/?#[\]@]/gi;if(i?.match(l))throw new qi(`Username contains unescaped characters ${i}`);if(!i||!o){let f=e.replace(`${s}://`,"");if(f.startsWith("@")||f.startsWith(":"))throw new qi("URI contained empty userinfo section")}if(o?.match(l))throw new qi("Password contains unescaped characters");if(a?.match(/^[^/?]*@/))throw new qi("Invalid connection string")}let c="";if(typeof i==="string")c+=i;if(typeof o==="string")c+=`:${o}`;if(c)c+="@";try{super(`${s.toLowerCase()}://${c}${Ih}${a}`)}catch(l){if(r)new Rh(e,{...t,looseValidation:!1});if(typeof l.message==="string")l.message=l.message.replace(Ih,()=>u);throw l}if(this._hosts=u.split(","),!r){if(this.isSRV&&this.hosts.length!==1)throw new qi("mongodb+srv URI cannot have multiple service names");if(this.isSRV&&this.hosts.some((l)=>l.includes(":")))throw new qi("mongodb+srv URI cannot have port number")}if(!this.pathname)this.pathname="/";Object.setPrototypeOf(this.searchParams,Ule(this.searchParams.constructor).prototype)}get host(){return Ih}set host(e){throw Error("No single host for connection string")}get hostname(){return Ih}set hostname(e){throw Error("No single host for connection string")}get port(){return""}set port(e){throw Error("No single host for connection string")}get href(){return this.toString()}set href(e){throw Error("Cannot set href for connection strings")}get isSRV(){return this.protocol.includes("srv")}get hosts(){return this._hosts}set hosts(e){this._hosts=e}toString(){return super.toString().replace(Ih,()=>this.hosts.join(","))}clone(){return new Rh(this.toString(),{looseValidation:!0})}redact(e){return c0.redactValidConnectionString(this,e)}typedSearchParams(){return this.searchParams}[Symbol.for("nodejs.util.inspect.custom")](){let{href:e,origin:t,protocol:r,username:n,password:s,hosts:i,pathname:o,search:u,searchParams:a,hash:c}=this;return{href:e,origin:t,protocol:r,username:n,password:s,hosts:i,pathname:o,search:u,searchParams:a,hash:c}}}RE.ConnectionString=Rh;class pP extends IE{constructor(e){super();for(let t of(e??"").split(",")){if(!t)continue;let r=t.indexOf(":");if(r===-1)this.set(t,"");else this.set(t.slice(0,r),t.slice(r+1))}}toString(){return[...this].map((e)=>e.join(":")).join(",")}}RE.CommaAndColonSeparatedRecord=pP;RE.default=Rh});var El=g(function(SP){Object.defineProperty(SP,"__esModule",{value:!0});SP.MongoCryptKMSRequestNetworkTimeoutError=SP.MongoCryptAzureKMSRequestError=SP.MongoCryptCreateEncryptedCollectionError=SP.MongoCryptCreateDataKeyError=SP.MongoCryptInvalidArgumentError=SP.defaultErrorWrapper=SP.MongoCryptError=void 0;var yP=Q();class ju extends yP.MongoError{constructor(e,t={}){super(e,t)}get name(){return"MongoCryptError"}}SP.MongoCryptError=ju;var Wle=(e)=>new ju(e.message,{cause:e});SP.defaultErrorWrapper=Wle;class gP extends ju{constructor(e){super(e)}get name(){return"MongoCryptInvalidArgumentError"}}SP.MongoCryptInvalidArgumentError=gP;class _P extends ju{constructor(e,{cause:t}){super(`Unable to complete creating data keys: ${t.message}`,{cause:t});this.encryptedFields=e}get name(){return"MongoCryptCreateDataKeyError"}}SP.MongoCryptCreateDataKeyError=_P;class EP extends ju{constructor(e,{cause:t}){super(`Unable to create collection: ${t.message}`,{cause:t});this.encryptedFields=e}get name(){return"MongoCryptCreateEncryptedCollectionError"}}SP.MongoCryptCreateEncryptedCollectionError=EP;class AP extends ju{constructor(e,t){super(e);this.body=t}get name(){return"MongoCryptAzureKMSRequestError"}}SP.MongoCryptAzureKMSRequestError=AP;class OP extends ju{get name(){return"MongoCryptKMSRequestNetworkTimeoutError"}}SP.MongoCryptKMSRequestNetworkTimeoutError=OP});var $E=g(function(TP){Object.defineProperty(TP,"__esModule",{value:!0});TP.AWSSDKCredentialProvider=void 0;var CP=G("process"),bP=Xi(),DP=Q();class Lu{constructor(e){if(e)this._provider=e}static get awsSDK(){return Lu._awsSDK??=bP.getAwsCredentialProvider(),Lu._awsSDK}get provider(){if("kModuleError"in Lu.awsSDK)throw Lu.awsSDK.kModuleError;if(this._provider)return this._provider;let{AWS_STS_REGIONAL_ENDPOINTS:e="",AWS_REGION:t=""}=CP.env;e=e.toLowerCase(),t=t.toLowerCase();let r=t.length!==0&&e.length!==0,s=e==="regional"||e==="legacy"&&!new Set(["ap-northeast-1","ap-south-1","ap-southeast-1","ap-southeast-2","aws-global","ca-central-1","eu-central-1","eu-north-1","eu-west-1","eu-west-2","eu-west-3","sa-east-1","us-east-1","us-east-2","us-west-1","us-west-2"]).has(t);return this._provider=r&&s?Lu.awsSDK.fromNodeProviderChain({clientConfig:{region:t}}):Lu.awsSDK.fromNodeProviderChain(),this._provider}async getCredentials(){try{let e=await this.provider();return{AccessKeyId:e.accessKeyId,SecretAccessKey:e.secretAccessKey,Token:e.sessionToken,Expiration:e.expiration}}catch(e){throw new DP.MongoAWSError(e.message,{cause:e})}}}TP.AWSSDKCredentialProvider=Lu});var BP=g(function(PP){Object.defineProperty(PP,"__esModule",{value:!0});PP.loadAWSCredentials=Xle;var xP=$E();async function Xle(e,t){let r=new xP.AWSSDKCredentialProvider(t),{SecretAccessKey:n="",AccessKeyId:s="",Token:i}=await r.getCredentials(),o={secretAccessKey:n,accessKeyId:s};return i!=null&&(o.sessionToken=i),{...e,aws:o}}});var qE=g(function(vP){Object.defineProperty(vP,"__esModule",{value:!0});vP.tokenCache=vP.AzureCredentialCache=vP.AZURE_BASE_URL=void 0;vP.addAzureParams=IP;vP.prepareRequest=RP;vP.fetchAzureKMSToken=$P;vP.loadAzureCredentials=r1e;var FP=Q(),NP=ae(),ri=El(),e1e=6000;vP.AZURE_BASE_URL="http://169.254.169.254/metadata/identity/oauth2/token?";class vE{constructor(){this.cachedToken=null}async getToken(){if(this.cachedToken==null||this.needsRefresh(this.cachedToken))this.cachedToken=await this._getToken();return{accessToken:this.cachedToken.accessToken}}needsRefresh(e){return e.expiresOnTimestamp-Date.now()<=e1e}resetCache(){this.cachedToken=null}_getToken(){return $P()}}vP.AzureCredentialCache=vE;vP.tokenCache=new vE;async function t1e(e){let{status:t,body:r}=e,n=(()=>{try{return JSON.parse(r)}catch{throw new ri.MongoCryptAzureKMSRequestError("Malformed JSON body in GET request.")}})();if(t!==200)throw new ri.MongoCryptAzureKMSRequestError("Unable to complete request.",n);if(!n.access_token)throw new ri.MongoCryptAzureKMSRequestError("Malformed response body - missing field `access_token`.");if(!n.expires_in)throw new ri.MongoCryptAzureKMSRequestError("Malformed response body - missing field `expires_in`.");let s=Number(n.expires_in)*1000;if(Number.isNaN(s))throw new ri.MongoCryptAzureKMSRequestError("Malformed response body - unable to parse int from `expires_in` field.");return{accessToken:n.access_token,expiresOnTimestamp:Date.now()+s}}function IP(e,t,r){if(e.searchParams.append("api-version","2018-02-01"),e.searchParams.append("resource",t),r)e.searchParams.append("client_id",r);return e}function RP(e){let t=new URL(e.url?.toString()??vP.AZURE_BASE_URL);return IP(t,"https://vault.azure.net"),{headers:{...e.headers,"Content-Type":"application/json",Metadata:!0},url:t}}async function $P(e={}){let{headers:t,url:r}=RP(e);try{let n=await NP.get(r,{headers:t});return await t1e(n)}catch(n){if(n instanceof FP.MongoNetworkTimeoutError)throw new ri.MongoCryptAzureKMSRequestError(`[Azure KMS] ${n.message}`);throw n}}async function r1e(e){let t=await vP.tokenCache.getToken();return{...e,azure:t}}});var LP=g(function(jP){Object.defineProperty(jP,"__esModule",{value:!0});jP.loadGCPCredentials=a1e;var qP=Xi();async function a1e(e){let t=qP.getGcpMetadata();if("kModuleError"in t)return e;let{access_token:r}=await t.instance({property:"service-accounts/default/token"});return{...e,gcp:{accessToken:r}}}});var jE=g(function(WP){Object.defineProperty(WP,"__esModule",{value:!0});WP.isEmptyCredentials=l0;WP.refreshKMSCredentials=l1e;var UP=BP(),VP=qE(),zP=LP();function l0(e,t){let r=t[e];if(r==null)return!1;return typeof r==="object"&&Object.keys(r).length===0}async function l1e(e,t){let r=e;if(l0("aws",e))r=await UP.loadAWSCredentials(r,t?.aws);if(l0("gcp",e))r=await zP.loadGCPCredentials(r);if(l0("azure",e))r=await VP.loadAzureCredentials(r);return r}});var LE=g(function(oB){Object.defineProperty(oB,"__esModule",{value:!0});oB.StateMachine=void 0;var h0=G("fs/promises"),KP=G("net"),GP=G("process"),YP=G("tls"),Yr=we(),f0=ps(),JP=Xi(),d0=Q(),Uu=Gn(),Ir=ae(),QP=p0(),Mn=El(),$h=null;function d1e(){if($h==null){let e=JP.getSocks();if("kModuleError"in e)throw e.kModuleError;$h=e}return $h}var $a=0,XP=1,ZP=2,eB=3,tB=7,rB=4,nB=5,sB=6,p1e=443,m1e=new Map([[$a,"MONGOCRYPT_CTX_ERROR"],[XP,"MONGOCRYPT_CTX_NEED_MONGO_COLLINFO"],[ZP,"MONGOCRYPT_CTX_NEED_MONGO_MARKINGS"],[eB,"MONGOCRYPT_CTX_NEED_MONGO_KEYS"],[tB,"MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS"],[rB,"MONGOCRYPT_CTX_NEED_KMS"],[nB,"MONGOCRYPT_CTX_READY"],[sB,"MONGOCRYPT_CTX_DONE"]]),y1e=["tlsInsecure","tlsAllowInvalidCertificates","tlsAllowInvalidHostnames"];function HP(e){if(GP.env.MONGODB_CRYPT_DEBUG)console.error(e)}var g1e;class iB{constructor(e,t=Yr.pluckBSONSerializeOptions(e)){this.options=e,this.bsonOptions=t}async execute(e,t,r){let{_keyVaultNamespace:n,_keyVaultClient:s,_metaDataClient:i,_mongocryptdClient:o,_mongocryptdManager:u}=e,a=null,c=()=>t.status,l=()=>t.state;while(l()!==sB&&l()!==$a)switch(r.signal?.throwIfAborted(),HP(`[context#${t.id}] ${m1e.get(l())||l()}`),l()){case XP:{let f=Yr.deserialize(t.nextMongoOperation());if(!i)throw new Mn.MongoCryptError("unreachable state machine state: entered MONGOCRYPT_CTX_NEED_MONGO_COLLINFO but metadata client is undefined");let h=this.fetchCollectionInfo(i,t.ns,f,r);for await(let d of h)if(t.addMongoOperationResponse(Yr.serialize(d)),l()===$a)break;if(l()===$a)break;t.finishMongoOperation();break}case ZP:{let f=t.nextMongoOperation();if(l()===$a)break;if(!o)throw new Mn.MongoCryptError("unreachable state machine state: entered MONGOCRYPT_CTX_NEED_MONGO_MARKINGS but mongocryptdClient is undefined");let h=u?await u.withRespawn(this.markCommand.bind(this,o,t.ns,f,r)):await this.markCommand(o,t.ns,f,r);t.addMongoOperationResponse(h),t.finishMongoOperation();break}case eB:{let f=t.nextMongoOperation(),h=await this.fetchKeys(s,n,f,r);if(h.length===0)a=g1e??=Yr.serialize({v:[]});for(let d of h)t.addMongoOperationResponse(Yr.serialize(d));t.finishMongoOperation();break}case tB:{let f=await e.askForKMSCredentials();t.provideKMSProviders(Yr.serialize(f));break}case rB:{await Promise.all(this.requests(t,r)),t.finishKMSRequests();break}case nB:{let f=t.finalize();if(l()===$a){let h=c().message||"Finalization error";throw new Mn.MongoCryptError(h)}a=f;break}default:throw new Mn.MongoCryptError(`Unknown state: ${l()}`)}if(l()===$a||a==null){let f=c().message;if(!f)HP("unidentifiable error in MongoCrypt - received an error status from `libmongocrypt` but received no error message.");throw new Mn.MongoCryptError(f??"unidentifiable error in MongoCrypt - received an error status from `libmongocrypt` but received no error message.")}return a}async kmsRequest(e,t){let r=e.endpoint.split(":"),n=r[1]!=null?Number.parseInt(r[1],10):p1e,s={host:r[0],servername:r[0],port:n,...QP.autoSelectSocketOptions(this.options.socketOptions||{})},i=e.message,o=new Ir.BufferPool,u,a;function c(){for(let m of[a,u])if(m)m.destroy()}function l(m){return new Mn.MongoCryptError("KMS request failed",{cause:m})}function f(){return new Mn.MongoCryptError("KMS request closed")}let h=this.options.tlsOptions;if(h){let m=e.kmsProvider,_=h[m];if(_){let y=this.validateTlsOptions(m,_);if(y)throw y;try{await this.setTlsOptions(_,s)}catch(E){throw l(E)}}}let d,p;try{if(t?.signal?.throwIfAborted(),this.options.kmsConnectCallback){let b=t?.timeoutContext?.csotEnabled()?t.timeoutContext.getRemainingTimeMSOrThrow(`KMS request timed out after ${t.timeoutContext.timeoutMS}ms`):void 0,A=Number.isFinite(b)?b:void 0,M=new AbortController,O=Ir.addAbortListener(t?.signal,function(){M.abort(this.reason)}),x=this.options.kmsConnectCallback({host:s.host,port:s.port,timeoutMS:A,signal:M.signal});x.then((P)=>{if(M.signal.aborted)P.destroy()},()=>null);let v=A?Uu.Timeout.expires(A):void 0;try{s.socket=v?await Promise.race([x,v]):await x}catch(P){if(Uu.TimeoutError.is(P)){let ge=new d0.MongoOperationTimeoutError("KMS request timed out");throw M.abort(ge),ge}throw l(P)}finally{v?.clear(),O?.[Ir.kDispose]()}}else if(this.options.proxyOptions&&this.options.proxyOptions.proxyHost){u=new KP.Socket;let{promise:b,reject:A,resolve:M}=Ir.promiseWithResolvers();u.once("error",(x)=>A(l(x))).once("close",()=>A(f())).once("connect",()=>M());let O={...s,host:this.options.proxyOptions.proxyHost,port:this.options.proxyOptions.proxyPort||1080};u.connect(O),await b;try{$h??=d1e(),s.socket=(await $h.SocksClient.createConnection({existing_socket:u,command:"connect",destination:{host:s.host,port:s.port},proxy:{host:"iLoveJavaScript",port:0,type:5,userId:this.options.proxyOptions.proxyUsername,password:this.options.proxyOptions.proxyPassword}})).socket}catch(x){throw l(x)}}a=YP.connect(s,()=>{a.write(i)});let{promise:m,reject:_,resolve:y}=Ir.promiseWithResolvers();d=Ir.addAbortListener(t?.signal,function(){c(),_(this.reason)}),a.once("error",(b)=>_(l(b))).once("close",()=>_(f())).on("data",(b)=>{o.append(b);while(e.bytesNeeded>0&&o.length){let A=Math.min(e.bytesNeeded,o.length);e.addResponse(o.read(A))}if(e.bytesNeeded<=0)y()});let E=t?.timeoutContext?.csotEnabled()?t.timeoutContext.getRemainingTimeMSOrThrow(`KMS request timed out after ${t.timeoutContext.timeoutMS}ms`):void 0,w=Number.isFinite(E)?E:void 0;p=w?Uu.Timeout.expires(w):void 0,await(p?Promise.race([m,p]):m)}catch(m){if(Uu.TimeoutError.is(m))throw new d0.MongoOperationTimeoutError("KMS request timed out");throw m}finally{c(),d?.[Ir.kDispose](),p?.clear()}}*requests(e,t){for(let r=e.nextKMSRequest();r!=null;r=e.nextKMSRequest())yield this.kmsRequest(r,t)}validateTlsOptions(e,t){let r=Object.keys(t);for(let n of y1e)if(r.includes(n))return new Mn.MongoCryptError(`Insecure TLS options prohibited for ${e}: ${n}`)}async setTlsOptions(e,t){if(e.secureContext)t.secureContext=e.secureContext;if(e.tlsCertificateKeyFile){let r=await h0.readFile(e.tlsCertificateKeyFile);t.cert=t.key=r}if(e.tlsCAFile)t.ca=await h0.readFile(e.tlsCAFile);if(e.tlsCertificateKeyFilePassword)t.passphrase=e.tlsCertificateKeyFilePassword}fetchCollectionInfo(e,t,r,n){let{db:s}=Ir.MongoDBCollectionNamespace.fromString(t);return e.db(s).listCollections(r,{promoteLongs:!1,promoteValues:!1,timeoutContext:n?.timeoutContext&&new f0.CursorTimeoutContext(n?.timeoutContext,Symbol()),signal:n?.signal,nameOnly:!1})}async markCommand(e,t,r,n){let{db:s}=Ir.MongoDBCollectionNamespace.fromString(t),i={promoteLongs:!1,promoteValues:!1},o=Yr.deserialize(r,i),u={timeoutMS:void 0,signal:void 0};if(n?.timeoutContext?.csotEnabled())u.timeoutMS=n.timeoutContext.remainingTimeMS;if(n?.signal)u.signal=n.signal;let a=await e.db(s).command(o,{...i,...u});return Yr.serialize(a,this.bsonOptions)}fetchKeys(e,t,r,n){let{db:s,collection:i}=Ir.MongoDBCollectionNamespace.fromString(t),o={timeoutContext:void 0,signal:void 0};if(n?.timeoutContext!=null)o.timeoutContext=new f0.CursorTimeoutContext(n.timeoutContext,Symbol());if(n?.signal!=null)o.signal=n.signal;return e.db(s).collection(i,{readConcern:{level:"majority"}}).find(Yr.deserialize(r),o).toArray()}}oB.StateMachine=iB});var p0=g(function(cB){Object.defineProperty(cB,"__esModule",{value:!0});cB.ClientEncryption=void 0;cB.autoSelectSocketOptions=vh;var Ct=we(),aB=Xi(),ho=Gn(),Bt=ae(),Rr=El(),m0=jE(),Vu=LE();class y0{static getMongoCrypt(){let e=aB.getMongoDBClientEncryption();if("kModuleError"in e)throw e.kModuleError;return e.MongoCrypt}constructor(e,t){if(this._client=e,this._proxyOptions=t.proxyOptions??{},this._proxyOptions.proxyHost&&t.kmsConnectCallback)throw new Rr.MongoCryptInvalidArgumentError("Cannot set both proxyOptions and kmsConnectCallback");this._tlsOptions=t.tlsOptions??{},this._kmsConnectCallback=t.kmsConnectCallback,this._kmsProviders=t.kmsProviders||{};let{timeoutMS:r}=Bt.resolveTimeoutOptions(e,t);if(this._timeoutMS=r,this._credentialProviders=t.credentialProviders,t.credentialProviders?.aws&&!m0.isEmptyCredentials("aws",this._kmsProviders))throw new Rr.MongoCryptInvalidArgumentError("Can only provide a custom AWS credential provider when the state machine is configured for automatic AWS credential fetching");if(t.keyVaultNamespace==null)throw new Rr.MongoCryptInvalidArgumentError("Missing required option `keyVaultNamespace`");let n={...t,kmsProviders:Ct.serialize(this._kmsProviders),errorWrapper:Rr.defaultErrorWrapper};this._keyVaultNamespace=t.keyVaultNamespace,this._keyVaultClient=t.keyVaultClient||e;let s=y0.getMongoCrypt();this._mongoCrypt=new s(n)}async createDataKey(e,t={}){if(t.keyAltNames&&!Array.isArray(t.keyAltNames))throw new Rr.MongoCryptInvalidArgumentError(`Option "keyAltNames" must be an array of strings, but was of type ${typeof t.keyAltNames}.`);let r=void 0;if(t.keyAltNames&&t.keyAltNames.length>0)r=t.keyAltNames.map((h,d)=>{if(typeof h!=="string")throw new Rr.MongoCryptInvalidArgumentError(`Option "keyAltNames" must be an array of strings, but item at index ${d} was of type ${typeof h}`);return Ct.serialize({keyAltName:h})});let n=void 0;if(t.keyMaterial)n=Ct.serialize({keyMaterial:t.keyMaterial});let s=Ct.serialize({provider:e,...t.masterKey}),i=this._mongoCrypt.makeDataKeyContext(s,{keyAltNames:r,keyMaterial:n}),o=new Vu.StateMachine({proxyOptions:this._proxyOptions,tlsOptions:this._tlsOptions,socketOptions:vh(this._client.s.options),kmsConnectCallback:this._kmsConnectCallback}),u=t?.timeoutContext??ho.TimeoutContext.create(Bt.resolveTimeoutOptions(this._client,{timeoutMS:this._timeoutMS})),a=Ct.deserialize(await o.execute(this,i,{timeoutContext:u})),{db:c,collection:l}=Bt.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace),{insertedId:f}=await this._keyVaultClient.db(c).collection(l).insertOne(a,{writeConcern:{w:"majority"},timeoutMS:u?.csotEnabled()?u?.getRemainingTimeMSOrThrow():void 0});return f}async rewrapManyDataKey(e,t){let r=void 0;if(t){let h=Object.assign({provider:t.provider},t.masterKey);r=Ct.serialize(h)}let n=Ct.serialize(e),s=this._mongoCrypt.makeRewrapManyDataKeyContext(n,r),i=new Vu.StateMachine({proxyOptions:this._proxyOptions,tlsOptions:this._tlsOptions,socketOptions:vh(this._client.s.options),kmsConnectCallback:this._kmsConnectCallback}),o=ho.TimeoutContext.create(Bt.resolveTimeoutOptions(this._client,{timeoutMS:this._timeoutMS})),{v:u}=Ct.deserialize(await i.execute(this,s,{timeoutContext:o}));if(u.length===0)return{};let{db:a,collection:c}=Bt.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace),l=u.map((h)=>({updateOne:{filter:{_id:h._id},update:{$set:{masterKey:h.masterKey,keyMaterial:h.keyMaterial},$currentDate:{updateDate:!0}}}}));return{bulkWriteResult:await this._keyVaultClient.db(a).collection(c).bulkWrite(l,{writeConcern:{w:"majority"},timeoutMS:o.csotEnabled()?o?.remainingTimeMS:void 0})}}async deleteKey(e){let{db:t,collection:r}=Bt.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);return await this._keyVaultClient.db(t).collection(r).deleteOne({_id:e},{writeConcern:{w:"majority"},timeoutMS:this._timeoutMS})}getKeys(){let{db:e,collection:t}=Bt.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);return this._keyVaultClient.db(e).collection(t).find({},{readConcern:{level:"majority"},timeoutMS:this._timeoutMS})}async getKey(e){let{db:t,collection:r}=Bt.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);return await this._keyVaultClient.db(t).collection(r).findOne({_id:e},{readConcern:{level:"majority"},timeoutMS:this._timeoutMS})}async getKeyByAltName(e){let{db:t,collection:r}=Bt.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);return await this._keyVaultClient.db(t).collection(r).findOne({keyAltNames:e},{readConcern:{level:"majority"},timeoutMS:this._timeoutMS})}async addKeyAltName(e,t){let{db:r,collection:n}=Bt.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);return await this._keyVaultClient.db(r).collection(n).findOneAndUpdate({_id:e},{$addToSet:{keyAltNames:t}},{writeConcern:{w:"majority"},returnDocument:"before",timeoutMS:this._timeoutMS})}async removeKeyAltName(e,t){let{db:r,collection:n}=Bt.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace),s=[{$set:{keyAltNames:{$cond:[{$eq:["$keyAltNames",[t]]},"$$REMOVE",{$filter:{input:"$keyAltNames",cond:{$ne:["$$this",t]}}}]}}}];return await this._keyVaultClient.db(r).collection(n).findOneAndUpdate({_id:e},s,{writeConcern:{w:"majority"},returnDocument:"before",timeoutMS:this._timeoutMS})}async createEncryptedCollection(e,t,r){let{provider:n,masterKey:s,createCollectionOptions:{encryptedFields:{...i},...o}}=r,u=this._timeoutMS!=null?ho.TimeoutContext.create(Bt.resolveTimeoutOptions(this._client,{timeoutMS:this._timeoutMS})):void 0;if(Array.isArray(i.fields)){let a=i.fields.map(async(f)=>f==null||typeof f!=="object"||f.keyId!=null?f:{...f,keyId:await this.createDataKey(n,{masterKey:s,timeoutContext:u?.csotEnabled()?u?.clone():void 0})}),c=await Promise.allSettled(a);i.fields=c.map((f,h)=>f.status==="fulfilled"?f.value:i.fields[h]);let l=c.find((f)=>f.status==="rejected");if(l!=null)throw new Rr.MongoCryptCreateDataKeyError(i,{cause:l.reason})}try{return{collection:await e.createCollection(t,{...o,encryptedFields:i,timeoutMS:u?.csotEnabled()?u?.getRemainingTimeMSOrThrow():void 0}),encryptedFields:i}}catch(a){throw new Rr.MongoCryptCreateEncryptedCollectionError(i,{cause:a})}}async encrypt(e,t){return await this._encrypt(e,!1,t)}async encryptExpression(e,t){return await this._encrypt(e,!0,t)}async decrypt(e){let t=Ct.serialize({v:e}),r=this._mongoCrypt.makeExplicitDecryptionContext(t),n=new Vu.StateMachine({proxyOptions:this._proxyOptions,tlsOptions:this._tlsOptions,socketOptions:vh(this._client.s.options),kmsConnectCallback:this._kmsConnectCallback}),s=this._timeoutMS!=null?ho.TimeoutContext.create(Bt.resolveTimeoutOptions(this._client,{timeoutMS:this._timeoutMS})):void 0,{v:i}=Ct.deserialize(await n.execute(this,r,{timeoutContext:s}));return i}async askForKMSCredentials(){return await m0.refreshKMSCredentials(this._kmsProviders,this._credentialProviders)}static get libmongocryptVersion(){return y0.getMongoCrypt().libmongocryptVersion}async _encrypt(e,t,r){let{algorithm:n,keyId:s,keyAltName:i,contentionFactor:o,queryType:u,rangeOptions:a,stringOptions:c,textOptions:l}=r,f={expressionMode:t,algorithm:n};if(s)f.keyId=s.buffer;if(i){if(s)throw new Rr.MongoCryptInvalidArgumentError('"options" cannot contain both "keyId" and "keyAltName"');if(typeof i!=="string")throw new Rr.MongoCryptInvalidArgumentError(`"options.keyAltName" must be of type string, but was of type ${typeof i}`);f.keyAltName=Ct.serialize({keyAltName:i})}if(typeof o==="number"||typeof o==="bigint")f.contentionFactor=o;if(typeof u==="string")f.queryType=u;if(typeof a==="object")f.rangeOptions=Ct.serialize(a);let h=c??l;if(typeof h==="object")f.textOptions=Ct.serialize(h);let d=Ct.serialize({v:e}),p=new Vu.StateMachine({proxyOptions:this._proxyOptions,tlsOptions:this._tlsOptions,socketOptions:vh(this._client.s.options),kmsConnectCallback:this._kmsConnectCallback}),m=this._mongoCrypt.makeExplicitEncryptionContext(d,f),_=this._timeoutMS!=null?ho.TimeoutContext.create(Bt.resolveTimeoutOptions(this._client,{timeoutMS:this._timeoutMS})):void 0,{v:y}=Ct.deserialize(await p.execute(this,m,{timeoutContext:_}));return y}}cB.ClientEncryption=y0;function vh(e){let t={};if("autoSelectFamily"in e)t.autoSelectFamily=e.autoSelectFamily;if("autoSelectFamilyAttemptTimeout"in e)t.autoSelectFamilyAttemptTimeout=e.autoSelectFamilyAttemptTimeout;return t}});var pB=g(function(fB){Object.defineProperty(fB,"__esModule",{value:!0});fB.MongocryptdManager=void 0;var hB=Q();class UE{static{this.DEFAULT_MONGOCRYPTD_URI="mongodb://localhost:27020"}constructor(e={}){if(this.spawnPath="",this.spawnArgs=[],this.uri=typeof e.mongocryptdURI==="string"&&e.mongocryptdURI.length>0?e.mongocryptdURI:UE.DEFAULT_MONGOCRYPTD_URI,this.bypassSpawn=!!e.mongocryptdBypassSpawn,Object.hasOwn(e,"mongocryptdSpawnPath")&&e.mongocryptdSpawnPath)this.spawnPath=e.mongocryptdSpawnPath;if(Object.hasOwn(e,"mongocryptdSpawnArgs")&&Array.isArray(e.mongocryptdSpawnArgs))this.spawnArgs=this.spawnArgs.concat(e.mongocryptdSpawnArgs);if(this.spawnArgs.filter((t)=>typeof t==="string").every((t)=>t.indexOf("--idleShutdownTimeoutSecs")<0))this.spawnArgs.push("--idleShutdownTimeoutSecs","60")}async spawn(){let e=this.spawnPath||"mongocryptd",{spawn:t}=G("child_process");this._child=t(e,this.spawnArgs,{stdio:"ignore",detached:!0}),this._child.on("error",()=>{}),this._child.unref()}async withRespawn(e){try{return await e()}catch(r){if(!(r instanceof hB.MongoNetworkTimeoutError&&!this.bypassSpawn))throw r}return await this.spawn(),await e()}}fB.MongocryptdManager=UE});var VE=g(function(OB){var mB;Object.defineProperty(OB,"__esModule",{value:!0});OB.AutoEncrypter=OB.AutoEncryptionLoggerLevel=void 0;var g0=G("net"),xn=we(),yB=Or(),gB=Xi(),Al=Q(),_B=va(),EB=ae(),Ol=p0(),zu=El(),AB=pB(),_0=jE(),E0=LE();OB.AutoEncryptionLoggerLevel=Object.freeze({FatalError:0,Error:1,Warning:2,Info:3,Trace:4});class A0{static{mB=yB.kDecorateResult}static getMongoCrypt(){let e=gB.getMongoDBClientEncryption();if("kModuleError"in e)throw e.kModuleError;return e.MongoCrypt}constructor(e,t){if(this[mB]=!1,this._client=e,this._bypassEncryption=t.bypassAutoEncryption===!0,this._keyVaultNamespace=t.keyVaultNamespace||"admin.datakeys",this._keyVaultClient=t.keyVaultClient||e,this._metaDataClient=t.metadataClient||e,this._proxyOptions=t.proxyOptions||{},this._proxyOptions.proxyHost&&t.kmsConnectCallback)throw new zu.MongoCryptInvalidArgumentError("Cannot set both proxyOptions and kmsConnectCallback");if(this._tlsOptions=t.tlsOptions||{},this._kmsConnectCallback=t.kmsConnectCallback,this._kmsProviders=t.kmsProviders||{},this._credentialProviders=t.credentialProviders,t.credentialProviders?.aws&&!_0.isEmptyCredentials("aws",this._kmsProviders))throw new zu.MongoCryptInvalidArgumentError("Can only provide a custom AWS credential provider when the state machine is configured for automatic AWS credential fetching");let r={errorWrapper:zu.defaultErrorWrapper};if(t.schemaMap)if(xn.ByteUtils.isUint8Array(t.schemaMap))r.schemaMap=t.schemaMap;else r.schemaMap=xn.serialize(t.schemaMap);if(t.encryptedFieldsMap)if(xn.ByteUtils.isUint8Array(t.encryptedFieldsMap))r.encryptedFieldsMap=t.encryptedFieldsMap;else r.encryptedFieldsMap=xn.serialize(t.encryptedFieldsMap);if(xn.ByteUtils.isUint8Array(this._kmsProviders))r.kmsProviders=this._kmsProviders;else r.kmsProviders=xn.serialize(this._kmsProviders);if(t.options?.logger)r.logger=t.options.logger;if(t.extraOptions&&t.extraOptions.cryptSharedLibPath)r.cryptSharedLibPath=t.extraOptions.cryptSharedLibPath;if(t.bypassQueryAnalysis)r.bypassQueryAnalysis=t.bypassQueryAnalysis;if(t.keyExpirationMS!=null)r.keyExpirationMS=t.keyExpirationMS;if(this._bypassMongocryptdAndCryptShared=this._bypassEncryption||!!t.bypassQueryAnalysis,t.extraOptions&&t.extraOptions.cryptSharedLibSearchPaths)r.cryptSharedLibSearchPaths=t.extraOptions.cryptSharedLibSearchPaths;else if(!this._bypassMongocryptdAndCryptShared)r.cryptSharedLibSearchPaths=["$SYSTEM"];let n=A0.getMongoCrypt();if(this._mongocrypt=new n(r),this._contextCounter=0,t.extraOptions&&t.extraOptions.cryptSharedLibRequired&&!this.cryptSharedLibVersionInfo)throw new zu.MongoCryptInvalidArgumentError("`cryptSharedLibRequired` set but no crypt_shared library loaded");if(!this._bypassMongocryptdAndCryptShared&&!this.cryptSharedLibVersionInfo){this._mongocryptdManager=new AB.MongocryptdManager(t.extraOptions);let s={serverSelectionTimeoutMS:1e4};if((t.extraOptions==null||typeof t.extraOptions.mongocryptdURI!=="string")&&!g0.getDefaultAutoSelectFamily)s.family=4;if(g0.getDefaultAutoSelectFamily)Object.assign(s,Ol.autoSelectSocketOptions(this._client.s?.options??{}));this._mongocryptdClient=new _B.MongoClient(this._mongocryptdManager.uri,s)}}async init(){if(this._bypassMongocryptdAndCryptShared||this.cryptSharedLibVersionInfo)return;if(!this._mongocryptdManager)throw new Al.MongoRuntimeError("Reached impossible state: mongocryptdManager is undefined when neither bypassSpawn nor the shared lib are specified.");if(!this._mongocryptdClient)throw new Al.MongoRuntimeError("Reached impossible state: mongocryptdClient is undefined when neither bypassSpawn nor the shared lib are specified.");if(!this._mongocryptdManager.bypassSpawn)await this._mongocryptdManager.spawn();try{return await this._mongocryptdClient.connect()}catch(e){throw new Al.MongoRuntimeError("Unable to connect to `mongocryptd`, please make sure it is running or in your PATH for auto-spawn",{cause:e})}}async close(){await this._mongocryptdClient?.close()}async encrypt(e,t,r={}){if(r.signal?.throwIfAborted(),this._bypassEncryption)return t;let n=xn.serialize(t,r),s=this._mongocrypt.makeEncryptionContext(EB.MongoDBCollectionNamespace.fromString(e).db,n);s.id=this._contextCounter++,s.ns=e,s.document=t;let i=new E0.StateMachine({promoteValues:!1,promoteLongs:!1,proxyOptions:this._proxyOptions,tlsOptions:this._tlsOptions,socketOptions:Ol.autoSelectSocketOptions(this._client.s.options),kmsConnectCallback:this._kmsConnectCallback});return xn.deserialize(await i.execute(this,s,r),{promoteValues:!1,promoteLongs:!1})}async decrypt(e,t={}){t.signal?.throwIfAborted();let r=this._mongocrypt.makeDecryptionContext(e);return r.id=this._contextCounter++,await new E0.StateMachine({...t,proxyOptions:this._proxyOptions,tlsOptions:this._tlsOptions,socketOptions:Ol.autoSelectSocketOptions(this._client.s.options),kmsConnectCallback:this._kmsConnectCallback}).execute(this,r,t)}async askForKMSCredentials(){return await _0.refreshKMSCredentials(this._kmsProviders,this._credentialProviders)}get cryptSharedLibVersionInfo(){return this._mongocrypt.cryptSharedLibVersionInfo}static get libmongocryptVersion(){return A0.getMongoCrypt().libmongocryptVersion}}OB.AutoEncrypter=A0});var PB=g(function(MB){Object.defineProperty(MB,"__esModule",{value:!0});MB.Encrypter=void 0;var wB=VE(),CB=Or(),bB=Xi(),O0=Q(),DB=va();class TB{constructor(e,t,r){if(typeof r.autoEncryption!=="object")throw new O0.MongoInvalidArgumentError('Option "autoEncryption" must be specified');if(this.internalClient=null,this.bypassAutoEncryption=!!r.autoEncryption.bypassAutoEncryption,this.needsConnecting=!1,r.maxPoolSize===0&&r.autoEncryption.keyVaultClient==null)r.autoEncryption.keyVaultClient=e;else if(r.autoEncryption.keyVaultClient==null)r.autoEncryption.keyVaultClient=this.getInternalClient(e,t,r);if(this.bypassAutoEncryption)r.autoEncryption.metadataClient=void 0;else if(r.maxPoolSize===0)r.autoEncryption.metadataClient=e;else r.autoEncryption.metadataClient=this.getInternalClient(e,t,r);if(r.proxyHost)r.autoEncryption.proxyOptions={proxyHost:r.proxyHost,proxyPort:r.proxyPort,proxyUsername:r.proxyUsername,proxyPassword:r.proxyPassword};this.autoEncrypter=new wB.AutoEncrypter(e,r.autoEncryption)}getInternalClient(e,t,r){let n=this.internalClient;if(n==null){let s={};for(let i of[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)]){if(["autoEncryption","minPoolSize","servers","caseTranslate","dbName"].includes(i))continue;Reflect.set(s,i,Reflect.get(r,i))}s.minPoolSize=0,n=new DB.MongoClient(t,s),this.internalClient=n;for(let i of CB.MONGO_CLIENT_EVENTS)for(let o of e.listeners(i))n.on(i,o);e.on("newListener",(i,o)=>{n?.on(i,o)}),this.needsConnecting=!0}return n}async connectInternalClient(){let e=this.internalClient;if(this.needsConnecting&&e!=null)this.needsConnecting=!1,await e.connect()}async close(e){let t;try{await this.autoEncrypter.close()}catch(n){t=n}let r=this.internalClient;if(r!=null&&e!==r)return await r.close();if(t!=null)throw t}static checkForMongoCrypt(){let e=bB.getMongoDBClientEncryption();if("kModuleError"in e)throw new O0.MongoMissingDependencyError("Auto-encryption requested, but the module is not installed. Please add `mongodb-client-encryption` as a dependency of your project",{cause:e.kModuleError,dependencyName:"mongodb-client-encryption"})}}MB.Encrypter=TB});var NB=g(function(BB){Object.defineProperty(BB,"__esModule",{value:!0});BB.ALLOWED_DRIVER_REQUIRE_PROPERTY_NAME=void 0;BB.resolveRuntimeAdapters=A1e;BB.ALLOWED_DRIVER_REQUIRE_PROPERTY_NAME="allowedDriverRequire";async function A1e(e){return{os:e.runtimeAdapters?.os??await import("os")}}});var GE=g(function(qB){Object.defineProperty(qB,"__esModule",{value:!0});qB.SENSITIVE_COMMANDS=qB.CommandFailedEvent=qB.CommandSucceededEvent=qB.CommandStartedEvent=void 0;var fo=Or(),w0=ae(),S0=mu();class $B{constructor(e,t,r){this.name=fo.COMMAND_STARTED;let n=HE(t),s=zE(n),{address:i,connectionId:o,serviceId:u}=KE(e);if(qB.SENSITIVE_COMMANDS.has(s))this.commandObj={},this.commandObj[s]=!0;this.address=i,this.connectionId=o,this.serviceId=u,this.requestId=t.requestId,this.databaseName=t.databaseName,this.commandName=s,this.command=WE(s,n,n),this.serverConnectionId=r}get hasServiceId(){return!!this.serviceId}}qB.CommandStartedEvent=$B;class vB{constructor(e,t,r,n,s){this.name=fo.COMMAND_SUCCEEDED;let i=HE(t),o=zE(i),{address:u,connectionId:a,serviceId:c}=KE(e);this.address=u,this.connectionId=a,this.serviceId=c,this.requestId=t.requestId,this.commandName=o,this.duration=w0.calculateDurationInMs(n),this.reply=WE(o,i,C1e(r)),this.serverConnectionId=s,this.databaseName=t.databaseName}get hasServiceId(){return!!this.serviceId}}qB.CommandSucceededEvent=vB;class kB{constructor(e,t,r,n,s){this.name=fo.COMMAND_FAILED;let i=HE(t),o=zE(i),{address:u,connectionId:a,serviceId:c}=KE(e);this.address=u,this.connectionId=a,this.serviceId=c,this.requestId=t.requestId,this.commandName=o,this.duration=w0.calculateDurationInMs(n),this.failure=WE(o,i,r),this.serverConnectionId=s,this.databaseName=t.databaseName}get hasServiceId(){return!!this.serviceId}}qB.CommandFailedEvent=kB;qB.SENSITIVE_COMMANDS=new Set(["authenticate","saslStart","saslContinue","getnonce","createUser","updateUser","copydbgetnonce","copydbsaslstart","copydb"]);var S1e=new Set(["hello",fo.LEGACY_HELLO_COMMAND,fo.LEGACY_HELLO_COMMAND_CAMEL_CASE]),zE=(e)=>Object.keys(e)[0],w1e=(e)=>e.ns.split(".")[1],WE=(e,t,r)=>qB.SENSITIVE_COMMANDS.has(e)||S1e.has(e)&&t.speculativeAuthenticate?{}:r,IB={$query:"filter",$orderby:"sort",$hint:"hint",$comment:"comment",$maxScan:"maxScan",$max:"max",$min:"min",$returnKey:"returnKey",$showDiskLoc:"showRecordId",$maxTimeMS:"maxTimeMS",$snapshot:"snapshot"},RB={numberToSkip:"skip",numberToReturn:"batchSize",returnFieldSelector:"projection"};function HE(e){if(e instanceof S0.OpMsgRequest){let n={...e.command};for(let s of Object.keys(n))if(n[s]instanceof S0.DocumentSequence)n[s]=n[s].documents;return n}if(e.query?.$query){let n;if(e.ns==="admin.$cmd")n=Object.assign({},e.query.$query);else n={find:w1e(e)},Object.keys(IB).forEach((s)=>{if(e.query[s]!=null)n[IB[s]]={...e.query[s]}});return Object.keys(RB).forEach((s)=>{let i=s;if(e[i]!=null)n[RB[i]]=e[i]}),n}let t={},r={...e};if(e.query)t={...e.query},r.query=t;return e.query?t:r}function C1e(e){if(!e)return e;return e.result?e.result:e}function KE(e){let t;if("id"in e)t=e.id;return{address:e.address,serviceId:e.serviceId,connectionId:t}}});var kh=g(function(zB){Object.defineProperty(zB,"__esModule",{value:!0});zB.ServerDescription=void 0;zB.parseServerType=UB;zB.compareTopologyVersion=VB;var ni=we(),jB=Q(),si=ae(),Ue=as(),M1e=new Set([Ue.ServerType.RSPrimary,Ue.ServerType.Standalone,Ue.ServerType.Mongos,Ue.ServerType.LoadBalancer]),x1e=new Set([Ue.ServerType.RSPrimary,Ue.ServerType.RSSecondary,Ue.ServerType.Mongos,Ue.ServerType.Standalone,Ue.ServerType.LoadBalancer]);class LB{constructor(e,t,r={}){if(e==null||e==="")throw new jB.MongoRuntimeError("ServerDescription must be provided with a non-empty address");this.address=typeof e==="string"?si.HostAddress.fromString(e).toString():e.toString(),this.type=UB(t,r),this.hosts=t?.hosts?.map((n)=>n.toLowerCase())??[],this.passives=t?.passives?.map((n)=>n.toLowerCase())??[],this.arbiters=t?.arbiters?.map((n)=>n.toLowerCase())??[],this.tags=t?.tags??{},this.minWireVersion=t?.minWireVersion??0,this.maxWireVersion=t?.maxWireVersion??0,this.roundTripTime=r?.roundTripTime??-1,this.minRoundTripTime=r?.minRoundTripTime??0,this.lastUpdateTime=si.processTimeMS(),this.lastWriteDate=t?.lastWrite?.lastWriteDate??0,this.error=r.error??null,this.error?.stack,this.topologyVersion=this.error?.topologyVersion??t?.topologyVersion??null,this.setName=t?.setName??null,this.setVersion=t?.setVersion??null,this.electionId=t?.electionId??null,this.logicalSessionTimeoutMinutes=t?.logicalSessionTimeoutMinutes??null,this.maxMessageSizeBytes=t?.maxMessageSizeBytes??null,this.maxWriteBatchSize=t?.maxWriteBatchSize??null,this.maxBsonObjectSize=t?.maxBsonObjectSize??null,this.primary=t?.primary??null,this.me=t?.me?.toLowerCase()??null,this.$clusterTime=t?.$clusterTime??null,this.iscryptd=Boolean(t?.iscryptd)}get hostAddress(){return si.HostAddress.fromString(this.address)}get allHosts(){return this.hosts.concat(this.arbiters).concat(this.passives)}get isReadable(){return this.type===Ue.ServerType.RSSecondary||this.isWritable}get isDataBearing(){return x1e.has(this.type)}get isWritable(){return M1e.has(this.type)}get host(){let e=`:${this.port}`.length;return this.address.slice(0,-e)}get port(){let e=this.address.split(":").pop();return e?Number.parseInt(e,10):27017}equals(e){let t=this.topologyVersion===e?.topologyVersion||VB(this.topologyVersion,e?.topologyVersion)===0,r=this.electionId!=null&&e?.electionId!=null?si.compareObjectId(this.electionId,e.electionId)===0:this.electionId===e?.electionId;return e!=null&&e.iscryptd===this.iscryptd&&si.errorStrictEqual(this.error,e.error)&&this.type===e.type&&this.minWireVersion===e.minWireVersion&&si.arrayStrictEqual(this.hosts,e.hosts)&&P1e(this.tags,e.tags)&&this.setName===e.setName&&this.setVersion===e.setVersion&&r&&this.primary===e.primary&&this.logicalSessionTimeoutMinutes===e.logicalSessionTimeoutMinutes&&t}}zB.ServerDescription=LB;function UB(e,t){if(t?.loadBalanced)return Ue.ServerType.LoadBalancer;if(!e||!e.ok)return Ue.ServerType.Unknown;if(e.isreplicaset)return Ue.ServerType.RSGhost;if(e.msg&&e.msg==="isdbgrid")return Ue.ServerType.Mongos;if(e.setName)if(e.hidden)return Ue.ServerType.RSOther;else if(e.isWritablePrimary)return Ue.ServerType.RSPrimary;else if(e.secondary)return Ue.ServerType.RSSecondary;else if(e.arbiterOnly)return Ue.ServerType.RSArbiter;else return Ue.ServerType.RSOther;return Ue.ServerType.Standalone}function P1e(e,t){let r=Object.keys(e),n=Object.keys(t);return r.length===n.length&&r.every((s)=>t[s]===e[s])}function VB(e,t){if(e==null||t==null)return-1;if(!e.processId.equals(t.processId))return-1;let r=typeof e.counter==="bigint"?ni.Long.fromBigInt(e.counter):ni.Long.isLong(e.counter)?e.counter:ni.Long.fromNumber(e.counter),n=typeof t.counter==="bigint"?ni.Long.fromBigInt(t.counter):ni.Long.isLong(t.counter)?t.counter:ni.Long.fromNumber(t.counter);return r.compare(n)}});var XB=g(function(JB){Object.defineProperty(JB,"__esModule",{value:!0});JB.StreamDescription=void 0;var HB=we(),KB=as(),GB=kh(),N1e=["minWireVersion","maxWireVersion","maxBsonObjectSize","maxMessageSizeBytes","maxWriteBatchSize","logicalSessionTimeoutMinutes"];class YB{constructor(e,t){this.hello=null,this.address=e,this.type=KB.ServerType.Unknown,this.minWireVersion=void 0,this.maxWireVersion=void 0,this.maxBsonObjectSize=16777216,this.maxMessageSizeBytes=48000000,this.maxWriteBatchSize=1e5,this.logicalSessionTimeoutMinutes=t?.logicalSessionTimeoutMinutes,this.loadBalanced=!!t?.loadBalanced,this.compressors=t&&t.compressors&&Array.isArray(t.compressors)?t.compressors:[],this.serverConnectionId=null}receiveResponse(e){if(e==null)return;if(this.hello=e,this.type=GB.parseServerType(e),"connectionId"in e)this.serverConnectionId=this.parseServerConnectionID(e.connectionId);else this.serverConnectionId=null;for(let t of N1e){if(e[t]!=null)this[t]=e[t];if("__nodejs_mock_server__"in e)this.__nodejs_mock_server__=e.__nodejs_mock_server__}if(e.compression)this.compressor=this.compressors.filter((t)=>e.compression?.includes(t))[0]}parseServerConnectionID(e){return HB.Long.isLong(e)?e.toBigInt():BigInt(e)}}JB.StreamDescription=YB});var eF=g(function(ZB){Object.defineProperty(ZB,"__esModule",{value:!0});ZB.onData=I1e;var po=ae();function I1e(e,{timeoutContext:t,signal:r}){r?.throwIfAborted();let n=new po.List,s=new po.List,i=null,o=!1,u={next(){let d=n.shift();if(d!=null)return Promise.resolve({value:d,done:!1});if(i!=null){let y=Promise.reject(i);return i=null,y}if(o)return h();let{promise:p,resolve:m,reject:_}=po.promiseWithResolvers();return s.push({resolve:m,reject:_}),p},return(){return h()},throw(d){return f(d),Promise.resolve({value:void 0,done:!0})},[Symbol.asyncIterator](){return this},async[Symbol.asyncDispose](){await h()}};e.on("data",l),e.on("error",f);let a=po.addAbortListener(r,function(){f(this.reason)}),c=t?.timeoutForSocketRead;return c?.throwIfExpired(),c?.then(void 0,f),u;function l(d){let p=s.shift();if(p!=null)p.resolve({value:d,done:!1});else n.push(d)}function f(d){let p=s.shift();if(p!=null)p.reject(d);else i=d;h()}function h(){e.off("data",l),e.off("error",f),a?.[po.kDispose](),o=!0,c?.clear();let d={value:void 0,done:o};for(let p of s)p.resolve(d);return Promise.resolve(d)}}});var YE=g(function(uF){Object.defineProperty(uF,"__esModule",{value:!0});uF.TopologyDescription=void 0;var oF=we(),Hu=Uo(),Wu=Q(),Sl=ae(),ie=as(),Pn=kh(),$1e=Hu.MIN_SUPPORTED_SERVER_VERSION,v1e=Hu.MAX_SUPPORTED_SERVER_VERSION,tF=Hu.MIN_SUPPORTED_WIRE_VERSION,rF=Hu.MAX_SUPPORTED_WIRE_VERSION,k1e=new Set([ie.ServerType.Mongos,ie.ServerType.Unknown]),nF=new Set([ie.ServerType.Mongos,ie.ServerType.Standalone]),sF=new Set([ie.ServerType.RSSecondary,ie.ServerType.RSArbiter,ie.ServerType.RSOther]);class qh{constructor(e,t=null,r=null,n=null,s=null,i=null,o=null){o=o??{},this.type=e??ie.TopologyType.Unknown,this.servers=t??new Map,this.stale=!1,this.compatible=!0,this.heartbeatFrequencyMS=o.heartbeatFrequencyMS??0,this.localThresholdMS=o.localThresholdMS??15,this.setName=r??null,this.maxElectionId=s??null,this.maxSetVersion=n??null,this.commonWireVersion=i??0;for(let u of this.servers.values()){if(u.type===ie.ServerType.Unknown||u.type===ie.ServerType.LoadBalancer)continue;if(u.minWireVersion>rF)this.compatible=!1,this.compatibilityError=`Server at ${u.address} requires wire version ${u.minWireVersion}, but this version of the driver only supports up to ${rF} (MongoDB ${v1e})`;if(u.maxWireVersion<tF){this.compatible=!1,this.compatibilityError=`Server at ${u.address} reports wire version ${u.maxWireVersion}, but this version of the driver requires at least ${tF} (MongoDB ${$1e}).`;break}}this.logicalSessionTimeoutMinutes=null;for(let[,u]of this.servers)if(u.isReadable){if(u.logicalSessionTimeoutMinutes==null){this.logicalSessionTimeoutMinutes=null;break}if(this.logicalSessionTimeoutMinutes==null){this.logicalSessionTimeoutMinutes=u.logicalSessionTimeoutMinutes;continue}this.logicalSessionTimeoutMinutes=Math.min(this.logicalSessionTimeoutMinutes,u.logicalSessionTimeoutMinutes)}}updateFromSrvPollingEvent(e,t=0){let r=e.hostnames(),n=new Set(this.servers.keys()),s=new Set(r),i=new Set;for(let u of n)if(s.delete(u),!r.has(u))i.add(u);if(s.size===0&&i.size===0)return this;let o=new Map(this.servers);for(let u of i)o.delete(u);if(s.size>0){if(t===0)for(let u of s)o.set(u,new Pn.ServerDescription(u));else if(o.size<t){let u=Sl.shuffle(s,t-o.size);for(let a of u)o.set(a,new Pn.ServerDescription(a))}}return new qh(this.type,o,this.setName,this.maxSetVersion,this.maxElectionId,this.commonWireVersion,{heartbeatFrequencyMS:this.heartbeatFrequencyMS,localThresholdMS:this.localThresholdMS})}update(e){let t=e.address,{type:r,setName:n,maxSetVersion:s,maxElectionId:i,commonWireVersion:o}=this,u=e.type,a=new Map(this.servers);if(e.maxWireVersion!==0)if(o===0)o=e.maxWireVersion;else o=Math.min(o,e.maxWireVersion);if(typeof e.setName==="string"&&typeof n==="string"&&e.setName!==n)if(r===ie.TopologyType.Single)e=new Pn.ServerDescription(t);else a.delete(t);if(a.set(t,e),r===ie.TopologyType.Single)return new qh(ie.TopologyType.Single,a,n,s,i,o,{heartbeatFrequencyMS:this.heartbeatFrequencyMS,localThresholdMS:this.localThresholdMS});if(r===ie.TopologyType.Unknown)if(u===ie.ServerType.Standalone&&this.servers.size!==1)a.delete(t);else r=q1e(u);if(r===ie.TopologyType.Sharded){if(!k1e.has(u))a.delete(t)}if(r===ie.TopologyType.ReplicaSetNoPrimary){if(nF.has(u))a.delete(t);if(u===ie.ServerType.RSPrimary){let c=iF(a,e,n,s,i);r=c[0],n=c[1],s=c[2],i=c[3]}else if(sF.has(u)){let c=L1e(a,e,n);r=c[0],n=c[1]}}if(r===ie.TopologyType.ReplicaSetWithPrimary)if(nF.has(u))a.delete(t),r=ka(a);else if(u===ie.ServerType.RSPrimary){let c=iF(a,e,n,s,i);r=c[0],n=c[1],s=c[2],i=c[3]}else if(sF.has(u))r=j1e(a,e,n);else r=ka(a);return new qh(r,a,n,s,i,o,{heartbeatFrequencyMS:this.heartbeatFrequencyMS,localThresholdMS:this.localThresholdMS})}get error(){let e=Array.from(this.servers.values()).filter((t)=>t.error);if(e.length>0)return e[0].error;return null}get hasKnownServers(){return Array.from(this.servers.values()).some((e)=>e.type!==ie.ServerType.Unknown)}get hasDataBearingServers(){return Array.from(this.servers.values()).some((e)=>e.isDataBearing)}hasServer(e){return this.servers.has(e)}toJSON(){return oF.EJSON.serialize(this)}}uF.TopologyDescription=qh;function q1e(e){switch(e){case ie.ServerType.Standalone:return ie.TopologyType.Single;case ie.ServerType.Mongos:return ie.TopologyType.Sharded;case ie.ServerType.RSPrimary:return ie.TopologyType.ReplicaSetWithPrimary;case ie.ServerType.RSOther:case ie.ServerType.RSSecondary:return ie.TopologyType.ReplicaSetNoPrimary;default:return ie.TopologyType.Unknown}}function iF(e,t,r=null,n=null,s=null){let i=(a,c,l)=>`primary marked stale due to electionId/setVersion mismatch: server setVersion: ${a.setVersion}, server electionId: ${a.electionId}, topology setVersion: ${c}, topology electionId: ${l}`;if(r=r||t.setName,r!==t.setName)return e.delete(t.address),[ka(e),r,n,s];if(t.maxWireVersion>=17){let a=Sl.compareObjectId(s,t.electionId),c=a===0,l=a===-1,f=(n??-1)<=(t.setVersion??-1);if(l||c&&f)s=t.electionId,n=t.setVersion;else return e.set(t.address,new Pn.ServerDescription(t.address,void 0,{error:new Wu.MongoStalePrimaryError(i(t,n,s))})),[ka(e),r,n,s]}else{let a=t.electionId?t.electionId:null;if(t.setVersion&&a){if(n&&s){if(n>t.setVersion||Sl.compareObjectId(s,a)>0)return e.set(t.address,new Pn.ServerDescription(t.address,void 0,{error:new Wu.MongoStalePrimaryError(i(t,n,s))})),[ka(e),r,n,s]}s=t.electionId}if(t.setVersion!=null&&(n==null||t.setVersion>n))n=t.setVersion}for(let[a,c]of e)if(c.type===ie.ServerType.RSPrimary&&c.address!==t.address){e.set(a,new Pn.ServerDescription(c.address,void 0,{error:new Wu.MongoStalePrimaryError("primary marked stale due to discovery of newer primary")}));break}t.allHosts.forEach((a)=>{if(!e.has(a))e.set(a,new Pn.ServerDescription(a))});let o=Array.from(e.keys()),u=t.allHosts;return o.filter((a)=>u.indexOf(a)===-1).forEach((a)=>{e.delete(a)}),[ka(e),r,n,s]}function j1e(e,t,r=null){if(r==null)throw new Wu.MongoRuntimeError('Argument "setName" is required if connected to a replica set');if(r!==t.setName||t.me&&t.address!==t.me)e.delete(t.address);return ka(e)}function L1e(e,t,r=null){let n=ie.TopologyType.ReplicaSetNoPrimary;if(r=r??t.setName,r!==t.setName)return e.delete(t.address),[n,r];if(t.allHosts.forEach((s)=>{if(!e.has(s))e.set(s,new Pn.ServerDescription(s))}),t.me&&t.address!==t.me)e.delete(t.address);return[n,r]}function ka(e){for(let t of e.values())if(t.type===ie.ServerType.RSPrimary)return ie.TopologyType.ReplicaSetWithPrimary;return ie.TopologyType.ReplicaSetNoPrimary}});var fF=g(function(hF){Object.defineProperty(hF,"__esModule",{value:!0});hF.getReadPreference=U1e;hF.isSharded=V1e;var cF=Q(),wl=Ur(),b0=as(),lF=YE();function U1e(e){let t=e?.readPreference??wl.ReadPreference.primary;if(typeof t==="string")t=wl.ReadPreference.fromString(t);if(!(t instanceof wl.ReadPreference))throw new cF.MongoInvalidArgumentError('Option "readPreference" must be a ReadPreference instance');return t}function V1e(e){if(e==null)return!1;if(e.description&&e.description.type===b0.ServerType.Mongos)return!0;if(e.description&&e.description instanceof lF.TopologyDescription)return Array.from(e.description.servers.values()).some((r)=>r.type===b0.ServerType.Mongos);return!1}});var x0=g(function(OF){Object.defineProperty(OF,"__esModule",{value:!0});OF.CryptoConnection=OF.SizedMessageTransform=OF.Connection=void 0;OF.hasSessionSupport=H1e;var dF=G("stream"),M0=G("timers"),Tl=we(),Bn=Or(),Pe=Q(),D0=Du(),pF=Is(),mF=Ur(),yF=as(),Cl=Sh(),T0=Gn(),jt=ae(),bl=GE(),Ku=mu(),gF=XB(),_F=fh(),EF=eF(),ii=dt(),Dl=fF();function H1e(e){return e.description.logicalSessionTimeoutMinutes!=null}function K1e(e,t){if(t.proxyHost)return t.hostAddress.toString();let{remoteAddress:r,remotePort:n}=e;if(typeof r==="string"&&typeof n==="number")return jt.HostAddress.fromHostPort(r,n).toString();return Tl.ByteUtils.toHex(jt.uuidV4())}class mo extends pF.TypedEventEmitter{static{this.COMMAND_STARTED=Bn.COMMAND_STARTED}static{this.COMMAND_SUCCEEDED=Bn.COMMAND_SUCCEEDED}static{this.COMMAND_FAILED=Bn.COMMAND_FAILED}static{this.CLUSTER_TIME_RECEIVED=Bn.CLUSTER_TIME_RECEIVED}static{this.CLOSE=Bn.CLOSE}static{this.PINNED=Bn.PINNED}static{this.UNPINNED=Bn.UNPINNED}constructor(e,t){super();this.lastHelloMS=-1,this.helloOk=!1,this.delayedTimeoutId=null,this.closed=!1,this.clusterTime=null,this.error=null,this.dataEvents=null,this.on("error",jt.noop),this.socket=e,this.id=t.id,this.address=K1e(e,t),this.socketTimeoutMS=t.socketTimeoutMS??0,this.monitorCommands=t.monitorCommands,this.serverApi=t.serverApi,this.mongoLogger=t.mongoLogger,this.established=!1,this.description=new gF.StreamDescription(this.address,t),this.generation=t.generation,this.lastUseTime=jt.processTimeMS(),this.messageStream=this.socket.on("error",this.onSocketError.bind(this)).pipe(new JE({connection:this})).on("error",this.onTransformError.bind(this)),this.socket.on("close",this.onClose.bind(this)),this.socket.on("timeout",this.onTimeout.bind(this)),this.messageStream.pause()}get hello(){return this.description.hello}set hello(e){this.description.receiveResponse(e),Object.freeze(this.description)}get serviceId(){return this.hello?.serviceId}get loadBalanced(){return this.description.loadBalanced}get idleTime(){return jt.calculateDurationInMs(this.lastUseTime)}get hasSessionSupport(){return this.description.logicalSessionTimeoutMinutes!=null}get supportsOpMsg(){return this.description!=null&&jt.maxWireVersion(this)>=6&&!this.description.__nodejs_mock_server__}get shouldEmitAndLogCommand(){return(this.monitorCommands||this.established&&!this.authContext?.reauthenticating&&this.mongoLogger?.willLog(D0.MongoLoggableComponent.COMMAND,D0.SeverityLevel.DEBUG))??!1}markAvailable(){this.lastUseTime=jt.processTimeMS()}onSocketError(e){this.onError(new Pe.MongoNetworkError(e.message,{cause:e}))}onTransformError(e){this.onError(e)}onError(e){this.cleanup(e)}onClose(){let e=`connection ${this.id} to ${this.address} closed`;this.cleanup(new Pe.MongoNetworkError(e))}onTimeout(){this.delayedTimeoutId=M0.setTimeout(()=>{let e=`connection ${this.id} to ${this.address} timed out`,t=this.hello==null;this.cleanup(new Pe.MongoNetworkTimeoutError(e,{beforeHandshake:t}))},1).unref()}destroy(){if(this.closed)return;this.removeAllListeners(mo.PINNED),this.removeAllListeners(mo.UNPINNED);let e=`connection ${this.id} to ${this.address} closed`;this.cleanup(new Pe.MongoNetworkError(e))}cleanup(e){if(this.closed)return;this.socket.destroy(),this.error=e,this.dataEvents?.throw(e).then(void 0,jt.squashError),this.closed=!0,this.emit(mo.CLOSE)}prepareCommand(e,t,r){let n={...t},s=Dl.getReadPreference(r),i=r?.session,o=this.clusterTime;if(this.serverApi){let{version:c,strict:l,deprecationErrors:f}=this.serverApi;if(n.apiVersion=c,l!=null)n.apiStrict=l;if(f!=null)n.apiDeprecationErrors=f}if(this.hasSessionSupport&&i){if(i.clusterTime&&o&&i.clusterTime.clusterTime.greaterThan(o.clusterTime))o=i.clusterTime;let c=Cl.applySession(i,n,r);if(c)throw c}else if(i?.explicit)throw new Pe.MongoCompatibilityError("Current topology does not support sessions");if(o)n.$clusterTime=o;if(this.description.type!==yF.ServerType.Standalone){if(!Dl.isSharded(this)&&!this.description.loadBalanced&&this.supportsOpMsg&&r.directConnection===!0&&s?.mode==="primary")n.$readPreference=mF.ReadPreference.primaryPreferred.toJSON();else if(Dl.isSharded(this)&&!this.supportsOpMsg&&s?.mode!=="primary")n={$query:n,$readPreference:s.toJSON()};else if(s?.mode!=="primary")n.$readPreference=s.toJSON()}let u={numberToSkip:0,numberToReturn:-1,checkKeys:!1,secondaryOk:s.secondaryOk(),...r};return r.timeoutContext?.addMaxTimeMSToCommand(n,r),this.supportsOpMsg?new Ku.OpMsgRequest(e,n,u):new Ku.OpQueryRequest(e,n,u)}async*sendWire(e,t,r){this.throwIfAborted();let n=t.socketTimeoutMS??t?.timeoutContext?.getSocketTimeoutMS()??this.socketTimeoutMS;this.socket.setTimeout(n);try{if(await this.writeCommand(e,{agreedCompressor:this.description.compressor??"none",zlibCompressionLevel:this.description.zlibCompressionLevel,timeoutContext:t.timeoutContext,signal:t.signal}),e.moreToCome){yield ii.MongoDBResponse.empty;return}if(this.throwIfAborted(),t.timeoutContext?.csotEnabled()&&t.timeoutContext.minRoundTripTime!=null&&t.timeoutContext.remainingTimeMS<t.timeoutContext.minRoundTripTime)throw new Pe.MongoOperationTimeoutError("Server roundtrip time is greater than the time remaining");for await(let s of this.readMany(t)){this.socket.setTimeout(0);let i=s.parse();yield(r??ii.MongoDBResponse).make(i),this.throwIfAborted(),this.socket.setTimeout(n)}}finally{this.socket.setTimeout(0)}}async*sendCommand(e,t,r,n){r?.signal?.throwIfAborted();let s=this.prepareCommand(e.db,t,r),i=0;if(this.shouldEmitAndLogCommand)i=jt.processTimeMS(),this.emitAndLogCommand(this.monitorCommands,mo.COMMAND_STARTED,s.databaseName,this.established,new bl.CommandStartedEvent(this,s,this.description.serverConnectionId));let o=r.documentsReturnedIn==null||!r.raw?r:{...r,raw:!1,fieldsAsRaw:{[r.documentsReturnedIn]:!0}},u=void 0,a=void 0;try{this.throwIfAborted();for await(u of this.sendWire(s,r,n)){if(a=void 0,r.session!=null)Cl.updateSessionFromResponse(r.session,u);if(u.$clusterTime)this.clusterTime=u.$clusterTime,this.emit(mo.CLUSTER_TIME_RECEIVED,u.$clusterTime);if(u.ok===0){if(r.timeoutContext?.csotEnabled()&&u.isMaxTimeExpiredError)throw new Pe.MongoOperationTimeoutError("Server reported a timeout error",{cause:new Pe.MongoServerError(a??=u.toObject(o))});throw new Pe.MongoServerError(a??=u.toObject(o))}if(this.shouldEmitAndLogCommand)this.emitAndLogCommand(this.monitorCommands,mo.COMMAND_SUCCEEDED,s.databaseName,this.established,new bl.CommandSucceededEvent(this,s,s.moreToCome?{ok:1}:a??=u.toObject(o),i,this.description.serverConnectionId));if(n==null)yield a??=u.toObject(o);else yield u;this.throwIfAborted()}}catch(c){if(r.session!=null&&!(c instanceof Pe.MongoServerError))Cl.updateSessionFromResponse(r.session,ii.MongoDBResponse.empty);if(this.shouldEmitAndLogCommand)this.emitAndLogCommand(this.monitorCommands,mo.COMMAND_FAILED,s.databaseName,this.established,new bl.CommandFailedEvent(this,s,c,i,this.description.serverConnectionId));throw c}}async command(e,t,r={},n){this.throwIfAborted(),r.signal?.throwIfAborted();for await(let s of this.sendCommand(e,t,r,n)){if(r.timeoutContext?.csotEnabled()){if(ii.MongoDBResponse.is(s)){if(s.isMaxTimeExpiredError)throw new Pe.MongoOperationTimeoutError("Server reported a timeout error",{cause:new Pe.MongoServerError(s.toObject())})}else if(Array.isArray(s?.writeErrors)&&s.writeErrors.some((i)=>i?.code===Pe.MONGODB_ERROR_CODES.MaxTimeMSExpired)||s?.writeConcernError?.code===Pe.MONGODB_ERROR_CODES.MaxTimeMSExpired)throw new Pe.MongoOperationTimeoutError("Server reported a timeout error",{cause:new Pe.MongoServerError(s)})}return s}throw new Pe.MongoUnexpectedServerResponseError("Unable to get response from server")}exhaustCommand(e,t,r,n){(async()=>{this.throwIfAborted();for await(let i of this.sendCommand(e,t,r))n(void 0,i),this.throwIfAborted();throw new Pe.MongoUnexpectedServerResponseError("Server ended moreToCome unexpectedly")})().then(void 0,n)}throwIfAborted(){if(this.error)throw this.error}async writeCommand(e,t){let r=t.agreedCompressor==="none"||!Ku.OpCompressedRequest.canCompress(e)?e:new Ku.OpCompressedRequest(e,{agreedCompressor:t.agreedCompressor??"none",zlibCompressionLevel:t.zlibCompressionLevel??0}),n=Tl.ByteUtils.concat(await r.toBin());if(t.timeoutContext?.csotEnabled()){if(t.timeoutContext.minRoundTripTime!=null&&t.timeoutContext.remainingTimeMS<t.timeoutContext.minRoundTripTime)throw new Pe.MongoOperationTimeoutError("Server roundtrip time is greater than the time remaining")}try{if(this.socket.write(n))return}catch(u){let a=new Pe.MongoNetworkError("unexpected error writing to socket",{cause:u});throw this.onError(a),a}let s=jt.once(this.socket,"drain",t),i=t?.timeoutContext?.timeoutForSocketWrite,o=i?Promise.race([s,i]):s;try{return await o}catch(u){if(T0.TimeoutError.is(u)){let a=new Pe.MongoOperationTimeoutError("Timed out at socket write");throw this.onError(a),a}else if(u===t.signal?.reason)this.onError(u);throw u}finally{i?.clear()}}async*readMany(e){try{this.dataEvents=EF.onData(this.messageStream,e),this.messageStream.resume();for await(let t of this.dataEvents){let r=await _F.decompressResponse(t);if(yield r,!r.moreToCome)return}}catch(t){if(T0.TimeoutError.is(t)){let r=new Pe.MongoOperationTimeoutError(`Timed out during socket read (${t.duration}ms)`);throw this.dataEvents=null,this.onError(r),r}else if(t===e.signal?.reason)this.onError(t);throw t}finally{this.dataEvents=null,this.messageStream.pause()}}}OF.Connection=mo;class JE extends dF.Transform{constructor({connection:e}){super({writableObjectMode:!1,readableObjectMode:!0});this.bufferPool=new jt.BufferPool,this.connection=e}_transform(e,t,r){if(this.connection.delayedTimeoutId!=null)M0.clearTimeout(this.connection.delayedTimeoutId),this.connection.delayedTimeoutId=null;this.bufferPool.append(e);while(this.bufferPool.length){let n=this.bufferPool.getInt32();if(n==null)break;if(n<0)return r(new Pe.MongoParseError(`Message size cannot be negative: ${n}`));if(n>this.bufferPool.length)break;let s=this.bufferPool.read(n);if(!this.push(s))return r(new Pe.MongoRuntimeError("SizedMessageTransform does not support backpressure"))}r()}}OF.SizedMessageTransform=JE;class AF extends mo{constructor(e,t){super(e,t);this.autoEncrypter=t.autoEncrypter}async command(e,t,r,n){let{autoEncrypter:s}=this;if(!s)throw new Pe.MongoRuntimeError("No AutoEncrypter available for encryption");if(jt.maxWireVersion(this)===0)return await super.command(e,t,r,n);let o=t.find||t.findAndModify?t.sort:null,u=t.createIndexes?t.indexes.map((h)=>h.key):null,a=await s.encrypt(e.toString(),t,r);if(o!=null&&(t.find||t.findAndModify))a.sort=o;if(u!=null&&t.createIndexes)for(let[h,d]of u.entries())a.indexes[h].key=d;let c=await super.command(e,a,r,n??ii.MongoDBResponse),l=await s.decrypt(c.toBytes(),r),f=n?.make(l)??Tl.deserialize(l,r);if(s[Bn.kDecorateResult]){if(n==null)jt.decorateDecryptionResult(f,c.toObject(),!0);else if(f instanceof ii.CursorResponse)f.encryptedResponse=c}return f}}OF.CryptoConnection=AF});var e6=g(function(PF){Object.defineProperty(PF,"__esModule",{value:!0});PF.LEGAL_TCP_SOCKET_OPTIONS=PF.LEGAL_TLS_SOCKET_OPTIONS=PF.DEFAULT_KEEP_ALIVE_INITIAL_DELAY_MS=void 0;PF.connect=Q1e;PF.makeConnection=TF;PF.performInitialHandshake=MF;PF.prepareHandshakeDocument=xF;PF.makeSocket=B0;var F0=G("net"),wF=G("tls"),N0=Or(),CF=Xi(),De=Q(),Ml=ae(),bF=Ru(),Gu=uo(),P0=x0(),oi=Uo();function DF(e){e.addErrorLabel(De.MongoErrorLabel.SystemOverloadedError),e.addErrorLabel(De.MongoErrorLabel.RetryableError)}async function Q1e(e){let t=null;try{let r=await B0(e);return t=TF(e,r),await MF(t,e),t}catch(r){throw t?.destroy(),r}}function TF(e,t){let r=e.connectionType??P0.Connection;if(e.autoEncrypter)r=P0.CryptoConnection;return new r(t,e)}function X1e(e,t){let r=Number(e.maxWireVersion),n=Number(e.minWireVersion),s=!Number.isNaN(r)&&r>=oi.MIN_SUPPORTED_WIRE_VERSION,i=!Number.isNaN(n)&&n<=oi.MAX_SUPPORTED_WIRE_VERSION;if(s){if(i)return null;let u=`Server at ${t.hostAddress} reports minimum wire version ${JSON.stringify(e.minWireVersion)}, but this version of the Node.js Driver requires at most ${oi.MAX_SUPPORTED_WIRE_VERSION} (MongoDB ${oi.MAX_SUPPORTED_SERVER_VERSION})`;return new De.MongoCompatibilityError(u)}let o=`Server at ${t.hostAddress} reports maximum wire version ${JSON.stringify(e.maxWireVersion)??0}, but this version of the Node.js Driver requires at least ${oi.MIN_SUPPORTED_WIRE_VERSION} (MongoDB ${oi.MIN_SUPPORTED_SERVER_VERSION})`;return new De.MongoCompatibilityError(o)}async function MF(e,t){let r=t.credentials;if(r){if(r.mechanism!==Gu.AuthMechanism.MONGODB_DEFAULT&&!t.authProviders.getOrCreateProvider(r.mechanism,r.mechanismProperties))throw new De.MongoInvalidArgumentError(`AuthMechanism '${r.mechanism}' not supported`)}let n=new bF.AuthContext(e,r,t);e.authContext=n;let s=await xF(n),i={...t,raw:!1};if(typeof t.connectTimeoutMS==="number")i.socketTimeoutMS=t.connectTimeoutMS;let o=new Date().getTime(),u=await c(s,i);if(!("isWritablePrimary"in u))u.isWritablePrimary=u[N0.LEGACY_HELLO_COMMAND];if(u.helloOk)e.helloOk=!0;let a=X1e(u,t);if(a)throw a;if(t.loadBalanced){if(!u.serviceId)throw new De.MongoCompatibilityError("Driver attempted to initialize in load balancing mode, but the server does not support this mode.")}if(e.hello=u,e.lastHelloMS=new Date().getTime()-o,!u.arbiterOnly&&r){n.response=u;let l=r.resolveAuthMechanism(u),f=t.authProviders.getOrCreateProvider(l.mechanism,l.mechanismProperties);if(!f)throw new De.MongoInvalidArgumentError(`No AuthProvider for ${l.mechanism} defined.`);try{await f.auth(n)}catch(h){if(h instanceof De.MongoError){if(h.addErrorLabel(De.MongoErrorLabel.HandshakeError),De.needsRetryableWriteLabel(h))h.addErrorLabel(De.MongoErrorLabel.RetryableWriteError)}throw h}}e.established=!0;async function c(l,f){try{return await e.command(Ml.ns("admin.$cmd"),l,f)}catch(h){if(h instanceof De.MongoError)h.addErrorLabel(De.MongoErrorLabel.HandshakeError);if(h instanceof De.MongoNetworkError)DF(h);throw h}}}async function xF(e){let t=e.options,r=t.compressors?t.compressors:[],{serverApi:n}=e.connection,s=await t.metadata,i={[n?.version||t.loadBalanced===!0?"hello":N0.LEGACY_HELLO_COMMAND]:1,backpressure:"2",helloOk:!0,client:s,compression:r};if(t.loadBalanced===!0)i.loadBalanced=!0;let o=e.credentials;if(o){if(o.mechanism===Gu.AuthMechanism.MONGODB_DEFAULT&&o.username){i.saslSupportedMechs=`${o.source}.${o.username}`;let a=e.options.authProviders.getOrCreateProvider(Gu.AuthMechanism.MONGODB_SCRAM_SHA256,o.mechanismProperties);if(!a)throw new De.MongoInvalidArgumentError(`No AuthProvider for ${Gu.AuthMechanism.MONGODB_SCRAM_SHA256} defined.`);return await a.prepare(i,e)}let u=e.options.authProviders.getOrCreateProvider(o.mechanism,o.mechanismProperties);if(!u)throw new De.MongoInvalidArgumentError(`No AuthProvider for ${o.mechanism} defined.`);return await u.prepare(i,e)}return i}PF.DEFAULT_KEEP_ALIVE_INITIAL_DELAY_MS=120000;PF.LEGAL_TLS_SOCKET_OPTIONS=["allowPartialTrustChain","ALPNProtocols","ca","cert","checkServerIdentity","ciphers","crl","ecdhCurve","key","minDHSize","passphrase","pfx","rejectUnauthorized","secureContext","secureProtocol","servername","session"];PF.LEGAL_TCP_SOCKET_OPTIONS=["autoSelectFamily","autoSelectFamilyAttemptTimeout","keepAliveInitialDelay","family","hints","localAddress","localPort","lookup"];function QE(e){let t=e.hostAddress;if(!t)throw new De.MongoInvalidArgumentError('Option "hostAddress" is required');let r={};for(let n of PF.LEGAL_TCP_SOCKET_OPTIONS)if(e[n]!=null)r[n]=e[n];if(r.keepAliveInitialDelay??=PF.DEFAULT_KEEP_ALIVE_INITIAL_DELAY_MS,r.keepAlive=!0,r.noDelay=e.noDelay??!0,typeof t.socketPath==="string")return r.path=t.socketPath,r;else if(typeof t.host==="string")return r.host=t.host,r.port=t.port,r;else throw new De.MongoRuntimeError(`Unexpected HostAddress ${JSON.stringify(t)}`)}function Z1e(e){let t=QE(e);for(let r of PF.LEGAL_TLS_SOCKET_OPTIONS)if(e[r]!=null)t[r]=e[r];if(e.existingSocket)t.socket=e.existingSocket;if(t.servername==null&&t.host&&!F0.isIP(t.host))t.servername=t.host;return t}async function B0(e){let t=e.tls??!1,r=e.connectTimeoutMS??30000,n=e.existingSocket,s=e.keepAliveInitialDelay??PF.DEFAULT_KEEP_ALIVE_INITIAL_DELAY_MS,i=e.noDelay??!0,o;if(e.proxyHost!=null)return await the({...e,connectTimeoutMS:r});if(t){let f=wF.connect(Z1e(e));if(typeof f.disableRenegotiation==="function")f.disableRenegotiation();o=f}else if(n)o=n;else o=F0.createConnection(QE(e));o.setKeepAlive(!0,s),o.setNoDelay(i),o.setTimeout(r);let u=null,{promise:a,resolve:c,reject:l}=Ml.promiseWithResolvers();if(n)c(o);else{let f=performance.now(),h=t?"secureConnect":"connect";if(o.once(h,()=>c(o)).once("error",(d)=>l(new De.MongoNetworkError(De.MongoError.buildErrorMessage(d),{cause:d}))).once("timeout",()=>{l(new De.MongoNetworkTimeoutError(`Socket '${h}' timed out after ${performance.now()-f|0}ms (connectTimeoutMS: ${r})`))}).once("close",()=>l(new De.MongoNetworkError(`Socket closed after ${performance.now()-f|0} during connection establishment`))),e.cancellationToken!=null)u=()=>l(new De.MongoNetworkError(`Socket connection establishment was cancelled after ${performance.now()-f|0}`)),e.cancellationToken.once("cancel",u)}try{return o=await a,o}catch(f){throw DF(f),o.destroy(),f}finally{if(o.setTimeout(0),u!=null)e.cancellationToken?.removeListener("cancel",u)}}var jh=null;function ehe(){if(jh==null){let e=CF.getSocks();if("kModuleError"in e)throw e.kModuleError;jh=e}return jh}async function the(e){let t=Ml.HostAddress.fromHostPort(e.proxyHost??"",e.proxyPort??1080),r=await B0({...e,hostAddress:t,tls:!1,proxyHost:void 0}),n=QE(e);if(typeof n.host!=="string"||typeof n.port!=="number")throw new De.MongoInvalidArgumentError("Can only make Socks5 connections to TCP hosts");jh??=ehe();let s;try{s=(await jh.SocksClient.createConnection({existing_socket:r,timeout:e.connectTimeoutMS,command:"connect",destination:{host:n.host,port:n.port},proxy:{host:"iLoveJavaScript",port:0,type:5,userId:e.proxyUsername||void 0,password:e.proxyPassword||void 0}})).socket}catch(i){throw new De.MongoNetworkError(De.MongoError.buildErrorMessage(i),{cause:i})}return await B0({...e,existingSocket:s,proxyHost:void 0})}});var I0=g(function(LF){Object.defineProperty(LF,"__esModule",{value:!0});LF.ServerHeartbeatFailedEvent=LF.ServerHeartbeatSucceededEvent=LF.ServerHeartbeatStartedEvent=LF.TopologyClosedEvent=LF.TopologyOpeningEvent=LF.TopologyDescriptionChangedEvent=LF.ServerClosedEvent=LF.ServerOpeningEvent=LF.ServerDescriptionChangedEvent=void 0;var Jr=Or();class FF{constructor(e,t,r,n){this.name=Jr.SERVER_DESCRIPTION_CHANGED,this.topologyId=e,this.address=t,this.previousDescription=r,this.newDescription=n}}LF.ServerDescriptionChangedEvent=FF;class NF{constructor(e,t){this.name=Jr.SERVER_OPENING,this.topologyId=e,this.address=t}}LF.ServerOpeningEvent=NF;class IF{constructor(e,t){this.name=Jr.SERVER_CLOSED,this.topologyId=e,this.address=t}}LF.ServerClosedEvent=IF;class RF{constructor(e,t,r){this.name=Jr.TOPOLOGY_DESCRIPTION_CHANGED,this.topologyId=e,this.previousDescription=t,this.newDescription=r}}LF.TopologyDescriptionChangedEvent=RF;class $F{constructor(e){this.name=Jr.TOPOLOGY_OPENING,this.topologyId=e}}LF.TopologyOpeningEvent=$F;class vF{constructor(e){this.name=Jr.TOPOLOGY_CLOSED,this.topologyId=e}}LF.TopologyClosedEvent=vF;class kF{constructor(e,t){this.name=Jr.SERVER_HEARTBEAT_STARTED,this.connectionId=e,this.awaited=t}}LF.ServerHeartbeatStartedEvent=kF;class qF{constructor(e,t,r,n){this.name=Jr.SERVER_HEARTBEAT_SUCCEEDED,this.connectionId=e,this.duration=t,this.reply=r??{},this.awaited=n}}LF.ServerHeartbeatSucceededEvent=qF;class jF{constructor(e,t,r,n){this.name=Jr.SERVER_HEARTBEAT_FAILED,this.connectionId=e,this.duration=t,this.failure=r,this.awaited=n}}LF.ServerHeartbeatFailedEvent=jF});var t6=g(function(eN){Object.defineProperty(eN,"__esModule",{value:!0});eN.ConnectionPoolClearedEvent=eN.ConnectionCheckedInEvent=eN.ConnectionCheckedOutEvent=eN.ConnectionCheckOutFailedEvent=eN.ConnectionCheckOutStartedEvent=eN.ConnectionClosedEvent=eN.ConnectionReadyEvent=eN.ConnectionCreatedEvent=eN.ConnectionPoolClosedEvent=eN.ConnectionPoolReadyEvent=eN.ConnectionPoolCreatedEvent=eN.ConnectionPoolMonitoringEvent=void 0;var dr=Or(),xl=ae();class Rs{constructor(e){this.time=new Date,this.address=e.address}}eN.ConnectionPoolMonitoringEvent=Rs;class VF extends Rs{constructor(e){super(e);this.name=dr.CONNECTION_POOL_CREATED;let{maxConnecting:t,maxPoolSize:r,minPoolSize:n,maxIdleTimeMS:s,waitQueueTimeoutMS:i}=e.options;this.options={maxConnecting:t,maxPoolSize:r,minPoolSize:n,maxIdleTimeMS:s,waitQueueTimeoutMS:i}}}eN.ConnectionPoolCreatedEvent=VF;class zF extends Rs{constructor(e){super(e);this.name=dr.CONNECTION_POOL_READY}}eN.ConnectionPoolReadyEvent=zF;class WF extends Rs{constructor(e){super(e);this.name=dr.CONNECTION_POOL_CLOSED}}eN.ConnectionPoolClosedEvent=WF;class HF extends Rs{constructor(e,t){super(e);this.name=dr.CONNECTION_CREATED,this.connectionId=t.id}}eN.ConnectionCreatedEvent=HF;class KF extends Rs{constructor(e,t,r){super(e);this.name=dr.CONNECTION_READY,this.durationMS=xl.processTimeMS()-r,this.connectionId=t.id}}eN.ConnectionReadyEvent=KF;class GF extends Rs{constructor(e,t,r,n){super(e);this.name=dr.CONNECTION_CLOSED,this.connectionId=t.id,this.reason=r,this.serviceId=t.serviceId,this.error=n??null}}eN.ConnectionClosedEvent=GF;class YF extends Rs{constructor(e){super(e);this.name=dr.CONNECTION_CHECK_OUT_STARTED}}eN.ConnectionCheckOutStartedEvent=YF;class JF extends Rs{constructor(e,t,r,n){super(e);this.name=dr.CONNECTION_CHECK_OUT_FAILED,this.durationMS=xl.processTimeMS()-r,this.reason=t,this.error=n}}eN.ConnectionCheckOutFailedEvent=JF;class QF extends Rs{constructor(e,t,r){super(e);this.name=dr.CONNECTION_CHECKED_OUT,this.durationMS=xl.processTimeMS()-r,this.connectionId=t.id}}eN.ConnectionCheckedOutEvent=QF;class XF extends Rs{constructor(e,t){super(e);this.name=dr.CONNECTION_CHECKED_IN,this.connectionId=t.id}}eN.ConnectionCheckedInEvent=XF;class ZF extends Rs{constructor(e,t={}){super(e);this.name=dr.CONNECTION_POOL_CLEARED,this.serviceId=t.serviceId,this.interruptInUseConnections=t.interruptInUseConnections}}eN.ConnectionPoolClearedEvent=ZF});var n6=g(function(iN){Object.defineProperty(iN,"__esModule",{value:!0});iN.WaitQueueTimeoutError=iN.PoolClearedOnNetworkError=iN.PoolClearedError=iN.PoolClosedError=void 0;var Yu=Q();class rN extends Yu.MongoDriverError{constructor(e){super("Attempted to check out a connection from closed connection pool");this.address=e.address}get name(){return"MongoPoolClosedError"}}iN.PoolClosedError=rN;class r6 extends Yu.MongoNetworkError{constructor(e,t){let r=t?t:`Connection pool for ${e.address} was cleared because another operation failed with: "${e.serverError?.message}"`;super(r,e.serverError?{cause:e.serverError}:void 0);this.address=e.address,this.addErrorLabel(Yu.MongoErrorLabel.PoolRequestedRetry)}get name(){return"MongoPoolClearedError"}}iN.PoolClearedError=r6;class nN extends r6{constructor(e){super(e,`Connection to ${e.address} interrupted due to server monitor timeout`)}get name(){return"PoolClearedOnNetworkError"}}iN.PoolClearedOnNetworkError=nN;class sN extends Yu.MongoDriverError{constructor(e,t){super(e);this.address=t}get name(){return"MongoWaitQueueTimeoutError"}}iN.WaitQueueTimeoutError=sN});var fN=g(function(lN){Object.defineProperty(lN,"__esModule",{value:!0});lN.ConnectionPool=lN.PoolState=void 0;var ai=G("timers"),Qt=Or(),pr=Q(),R0=Is(),uN=Gn(),Qr=ae(),aN=e6(),Ju=x0(),it=t6(),ci=n6(),cN=R_();lN.PoolState=Object.freeze({paused:"paused",ready:"ready",closed:"closed"});class Vr extends R0.TypedEventEmitter{static{this.CONNECTION_POOL_CREATED=Qt.CONNECTION_POOL_CREATED}static{this.CONNECTION_POOL_CLOSED=Qt.CONNECTION_POOL_CLOSED}static{this.CONNECTION_POOL_CLEARED=Qt.CONNECTION_POOL_CLEARED}static{this.CONNECTION_POOL_READY=Qt.CONNECTION_POOL_READY}static{this.CONNECTION_CREATED=Qt.CONNECTION_CREATED}static{this.CONNECTION_READY=Qt.CONNECTION_READY}static{this.CONNECTION_CLOSED=Qt.CONNECTION_CLOSED}static{this.CONNECTION_CHECK_OUT_STARTED=Qt.CONNECTION_CHECK_OUT_STARTED}static{this.CONNECTION_CHECK_OUT_FAILED=Qt.CONNECTION_CHECK_OUT_FAILED}static{this.CONNECTION_CHECKED_OUT=Qt.CONNECTION_CHECKED_OUT}static{this.CONNECTION_CHECKED_IN=Qt.CONNECTION_CHECKED_IN}constructor(e,t){super();if(this.on("error",Qr.noop),this.options=Object.freeze({connectionType:Ju.Connection,...t,maxPoolSize:t.maxPoolSize??100,minPoolSize:t.minPoolSize??0,maxConnecting:t.maxConnecting??2,maxIdleTimeMS:t.maxIdleTimeMS??0,waitQueueTimeoutMS:t.waitQueueTimeoutMS??0,minPoolSizeCheckFrequencyMS:t.minPoolSizeCheckFrequencyMS??100,autoEncrypter:t.autoEncrypter}),this.options.minPoolSize>this.options.maxPoolSize)throw new pr.MongoInvalidArgumentError("Connection pool minimum size must not be greater than maximum pool size");this.poolState=lN.PoolState.paused,this.server=e,this.connections=new Qr.List,this.pending=0,this.checkedOut=new Set,this.minPoolSizeTimer=void 0,this.generation=0,this.serviceGenerations=new Map,this.connectionCounter=Qr.makeCounter(1),this.cancellationToken=new R0.CancellationToken,this.cancellationToken.setMaxListeners(1/0),this.waitQueue=new Qr.List,this.metrics=new cN.ConnectionPoolMetrics,this.processingWaitQueue=!1,this.mongoLogger=this.server.topology.client?.mongoLogger,this.component="connection",queueMicrotask(()=>{this.emitAndLog(Vr.CONNECTION_POOL_CREATED,new it.ConnectionPoolCreatedEvent(this))})}get address(){return this.options.hostAddress.toString()}get closed(){return this.poolState===lN.PoolState.closed}get totalConnectionCount(){return this.availableConnectionCount+this.pendingConnectionCount+this.currentCheckedOutCount}get availableConnectionCount(){return this.connections.length}get pendingConnectionCount(){return this.pending}get currentCheckedOutCount(){return this.checkedOut.size}get waitQueueSize(){return this.waitQueue.length}get loadBalanced(){return this.options.loadBalanced}get serverError(){return this.server.description.error}get checkedOutConnections(){return this.checkedOut}waitQueueErrorMetrics(){return this.metrics.info(this.options.maxPoolSize)}ready(){if(this.poolState!==lN.PoolState.paused)return;this.poolState=lN.PoolState.ready,this.emitAndLog(Vr.CONNECTION_POOL_READY,new it.ConnectionPoolReadyEvent(this)),ai.clearTimeout(this.minPoolSizeTimer),this.ensureMinPoolSize()}async checkOut(e){let t=Qr.processTimeMS();this.emitAndLog(Vr.CONNECTION_CHECK_OUT_STARTED,new it.ConnectionCheckOutStartedEvent(this));let{promise:r,resolve:n,reject:s}=Qr.promiseWithResolvers(),i=e.timeoutContext.connectionCheckoutTimeout,o={resolve:n,reject:s,cancelled:!1,checkoutTime:t},u=Qr.addAbortListener(e.signal,function(){o.cancelled=!0,s(this.reason)});this.waitQueue.push(o),queueMicrotask(()=>this.processWaitQueue());try{return i?.throwIfExpired(),await(i?Promise.race([r,i]):r)}catch(a){if(uN.TimeoutError.is(a)){i?.clear(),o.cancelled=!0,this.emitAndLog(Vr.CONNECTION_CHECK_OUT_FAILED,new it.ConnectionCheckOutFailedEvent(this,"timeout",o.checkoutTime));let c=new ci.WaitQueueTimeoutError(this.loadBalanced?this.waitQueueErrorMetrics():"Timed out while checking out a connection from connection pool",this.address);if(e.timeoutContext.csotEnabled())throw new pr.MongoOperationTimeoutError("Timed out during connection checkout",{cause:c});throw c}throw a}finally{u?.[Qr.kDispose](),i?.clear()}}checkIn(e){if(!this.checkedOut.has(e))return;let t=this.closed,r=this.connectionIsStale(e),n=!!(t||r||e.closed);if(!n)e.markAvailable(),this.connections.unshift(e);if(this.checkedOut.delete(e),this.emitAndLog(Vr.CONNECTION_CHECKED_IN,new it.ConnectionCheckedInEvent(this,e)),n){let s=e.closed?"error":t?"poolClosed":"stale";this.destroyConnection(e,s)}queueMicrotask(()=>this.processWaitQueue())}clear(e={}){if(this.closed)return;if(this.loadBalanced){let{serviceId:s}=e;if(!s)throw new pr.MongoRuntimeError("ConnectionPool.clear() called in load balanced mode with no serviceId.");let i=s.toHexString(),o=this.serviceGenerations.get(i);if(o==null)throw new pr.MongoRuntimeError("Service generations are required in load balancer mode.");else this.serviceGenerations.set(i,o+1);this.emitAndLog(Vr.CONNECTION_POOL_CLEARED,new it.ConnectionPoolClearedEvent(this,{serviceId:s}));return}let t=e.interruptInUseConnections??!1,r=this.generation;this.generation+=1;let n=this.poolState===lN.PoolState.paused;if(this.poolState=lN.PoolState.paused,this.clearMinPoolSizeTimer(),!n)this.emitAndLog(Vr.CONNECTION_POOL_CLEARED,new it.ConnectionPoolClearedEvent(this,{interruptInUseConnections:t}));if(t)queueMicrotask(()=>this.interruptInUseConnections(r));this.processWaitQueue()}interruptInUseConnections(e){for(let t of this.checkedOut)if(t.generation<=e)t.onError(new ci.PoolClearedOnNetworkError(this))}closeCheckedOutConnections(){for(let e of this.checkedOut)e.onError(new pr.MongoClientClosedError)}close(){if(this.closed)return;if(this.cancellationToken.emit("cancel"),typeof this.connectionCounter.return==="function")this.connectionCounter.return(void 0);this.poolState=lN.PoolState.closed,this.clearMinPoolSizeTimer(),this.processWaitQueue();for(let e of this.connections)this.emitAndLog(Vr.CONNECTION_CLOSED,new it.ConnectionClosedEvent(this,e,"poolClosed")),e.destroy();this.connections.clear(),this.emitAndLog(Vr.CONNECTION_POOL_CLOSED,new it.ConnectionPoolClosedEvent(this))}async reauthenticate(e){let t=e.authContext;if(!t)throw new pr.MongoRuntimeError("No auth context found on connection.");let r=t.credentials;if(!r)throw new pr.MongoMissingCredentialsError("Connection is missing credentials when asked to reauthenticate");let n=r.resolveAuthMechanism(e.hello),s=this.server.topology.client.s.authProviders.getOrCreateProvider(n.mechanism,n.mechanismProperties);if(!s)throw new pr.MongoMissingCredentialsError(`Reauthenticate failed due to no auth provider for ${r.mechanism}`);await s.reauth(t);return}clearMinPoolSizeTimer(){let e=this.minPoolSizeTimer;if(e)ai.clearTimeout(e)}destroyConnection(e,t){this.emitAndLog(Vr.CONNECTION_CLOSED,new it.ConnectionClosedEvent(this,e,t)),e.destroy()}connectionIsStale(e){let t=e.serviceId;if(this.loadBalanced&&t){let r=t.toHexString(),n=this.serviceGenerations.get(r);return e.generation!==n}return e.generation!==this.generation}connectionIsIdle(e){return!!(this.options.maxIdleTimeMS&&e.idleTime>this.options.maxIdleTimeMS)}destroyConnectionIfPerished(e){let t=this.connectionIsStale(e),r=this.connectionIsIdle(e);if(!t&&!r&&!e.closed)return!1;let n=e.closed?"error":t?"stale":"idle";return this.destroyConnection(e,n),!0}createConnection(e){let t={...this.options,id:this.connectionCounter.next().value,generation:this.generation,cancellationToken:this.cancellationToken,mongoLogger:this.mongoLogger,authProviders:this.server.topology.client.s.authProviders,metadata:this.server.topology.client.options.metadata};this.pending++;let r=Qr.processTimeMS();this.emitAndLog(Vr.CONNECTION_CREATED,new it.ConnectionCreatedEvent(this,{id:t.id})),aN.connect(t).then((n)=>{if(this.poolState!==lN.PoolState.ready){this.pending--,n.destroy(),e(this.closed?new ci.PoolClosedError(this):new ci.PoolClearedError(this));return}for(let s of[...Qt.APM_EVENTS,Ju.Connection.CLUSTER_TIME_RECEIVED])n.on(s,(i)=>this.emit(s,i));if(this.loadBalanced){n.on(Ju.Connection.PINNED,(i)=>this.metrics.markPinned(i)),n.on(Ju.Connection.UNPINNED,(i)=>this.metrics.markUnpinned(i));let s=n.serviceId;if(s){let i,o=s.toHexString();if(i=this.serviceGenerations.get(o))n.generation=i;else this.serviceGenerations.set(o,0),n.generation=0}}n.markAvailable(),this.emitAndLog(Vr.CONNECTION_READY,new it.ConnectionReadyEvent(this,n,r)),this.pending--,e(void 0,n)},(n)=>{if(this.pending--,this.server.handleError(n),this.emitAndLog(Vr.CONNECTION_CLOSED,new it.ConnectionClosedEvent(this,{id:t.id,serviceId:void 0},"error",n)),n instanceof pr.MongoNetworkError||n instanceof pr.MongoServerError)n.connectionGeneration=t.generation;e(n??new pr.MongoRuntimeError("Connection creation failed without error"))})}ensureMinPoolSize(){let e=this.options.minPoolSize;if(this.poolState!==lN.PoolState.ready)return;if(this.connections.prune((t)=>this.destroyConnectionIfPerished(t)),this.totalConnectionCount<e&&this.pendingConnectionCount<this.options.maxConnecting)this.createConnection((t,r)=>{if(!t&&r)this.connections.push(r),queueMicrotask(()=>this.processWaitQueue());if(this.poolState===lN.PoolState.ready)ai.clearTimeout(this.minPoolSizeTimer),this.minPoolSizeTimer=ai.setTimeout(()=>this.ensureMinPoolSize(),this.options.minPoolSizeCheckFrequencyMS)});else ai.clearTimeout(this.minPoolSizeTimer),this.minPoolSizeTimer=ai.setTimeout(()=>this.ensureMinPoolSize(),this.options.minPoolSizeCheckFrequencyMS)}processWaitQueue(){if(this.processingWaitQueue)return;this.processingWaitQueue=!0;while(this.waitQueueSize){let r=this.waitQueue.first();if(!r){this.waitQueue.shift();continue}if(r.cancelled){this.waitQueue.shift();continue}if(this.poolState!==lN.PoolState.ready){let s=this.closed?"poolClosed":"connectionError",i=this.closed?new ci.PoolClosedError(this):new ci.PoolClearedError(this);this.emitAndLog(Vr.CONNECTION_CHECK_OUT_FAILED,new it.ConnectionCheckOutFailedEvent(this,s,r.checkoutTime,i)),this.waitQueue.shift(),r.reject(i);continue}if(!this.availableConnectionCount)break;let n=this.connections.shift();if(!n)break;if(!this.destroyConnectionIfPerished(n))this.checkedOut.add(n),this.emitAndLog(Vr.CONNECTION_CHECKED_OUT,new it.ConnectionCheckedOutEvent(this,n,r.checkoutTime)),this.waitQueue.shift(),r.resolve(n)}let{maxPoolSize:e,maxConnecting:t}=this.options;while(this.waitQueueSize>0&&this.pendingConnectionCount<t&&(e===0||this.totalConnectionCount<e)){let r=this.waitQueue.shift();if(!r||r.cancelled)continue;this.createConnection((n,s)=>{if(r.cancelled){if(!n&&s)this.connections.push(s)}else if(n)this.emitAndLog(Vr.CONNECTION_CHECK_OUT_FAILED,new it.ConnectionCheckOutFailedEvent(this,"connectionError",r.checkoutTime,n)),r.reject(n);else if(s)this.checkedOut.add(s),this.emitAndLog(Vr.CONNECTION_CHECKED_OUT,new it.ConnectionCheckedOutEvent(this,s,r.checkoutTime)),r.resolve(s);queueMicrotask(()=>this.processWaitQueue())})}this.processingWaitQueue=!1}}lN.ConnectionPool=Vr});var o6=g(function(ON){Object.defineProperty(ON,"__esModule",{value:!0});ON.Server=void 0;var pN=x0(),mN=fN(),yN=n6(),$r=Or(),Te=Q(),gN=Is(),_N=Eh(),Pl=$_(),li=ae(),$0=Kn(),Ae=as(),EN=u6(),Bl=kh(),AN=Fc(),Lh=li.makeStateMachine({[Ae.STATE_CLOSED]:[Ae.STATE_CLOSED,Ae.STATE_CONNECTING],[Ae.STATE_CONNECTING]:[Ae.STATE_CONNECTING,Ae.STATE_CLOSING,Ae.STATE_CONNECTED,Ae.STATE_CLOSED],[Ae.STATE_CONNECTED]:[Ae.STATE_CONNECTED,Ae.STATE_CLOSING,Ae.STATE_CLOSED],[Ae.STATE_CLOSING]:[Ae.STATE_CLOSING,Ae.STATE_CLOSED]});class qa extends gN.TypedEventEmitter{static{this.SERVER_HEARTBEAT_STARTED=$r.SERVER_HEARTBEAT_STARTED}static{this.SERVER_HEARTBEAT_SUCCEEDED=$r.SERVER_HEARTBEAT_SUCCEEDED}static{this.SERVER_HEARTBEAT_FAILED=$r.SERVER_HEARTBEAT_FAILED}static{this.CONNECT=$r.CONNECT}static{this.DESCRIPTION_RECEIVED=$r.DESCRIPTION_RECEIVED}static{this.CLOSED=$r.CLOSED}static{this.ENDED=$r.ENDED}constructor(e,t,r){super();this.on("error",li.noop),this.serverApi=r.serverApi;let n={hostAddress:t.hostAddress,...r};this.topology=e,this.pool=new mN.ConnectionPool(this,n),this.s={description:t,options:r,state:Ae.STATE_CLOSED,operationCount:0};for(let s of[...$r.CMAP_EVENTS,...$r.APM_EVENTS])this.pool.on(s,(i)=>this.emit(s,i));if(this.pool.on(pN.Connection.CLUSTER_TIME_RECEIVED,(s)=>{this.clusterTime=s}),this.loadBalanced){this.monitor=null;return}this.monitor=new EN.Monitor(this,this.s.options);for(let s of $r.HEARTBEAT_EVENTS)this.monitor.on(s,(i)=>this.emit(s,i));this.monitor.on("resetServer",(s)=>s6(this,s)),this.monitor.on(qa.SERVER_HEARTBEAT_SUCCEEDED,(s)=>{if(this.emit(qa.DESCRIPTION_RECEIVED,new Bl.ServerDescription(this.description.hostAddress,s.reply,{roundTripTime:this.monitor?.roundTripTime,minRoundTripTime:this.monitor?.minRoundTripTime})),this.s.state===Ae.STATE_CONNECTING)Lh(this,Ae.STATE_CONNECTED),this.emit(qa.CONNECT,this)})}get clusterTime(){return this.topology.clusterTime}set clusterTime(e){this.topology.clusterTime=e}get description(){return this.s.description}get name(){return this.s.description.address}get autoEncrypter(){if(this.s.options&&this.s.options.autoEncrypter)return this.s.options.autoEncrypter;return}get loadBalanced(){return this.topology.description.type===Ae.TopologyType.LoadBalanced}connect(){if(this.s.state!==Ae.STATE_CLOSED)return;if(Lh(this,Ae.STATE_CONNECTING),!this.loadBalanced)this.monitor?.connect();else Lh(this,Ae.STATE_CONNECTED),this.emit(qa.CONNECT,this)}closeCheckedOutConnections(){return this.pool.closeCheckedOutConnections()}close(){if(this.s.state===Ae.STATE_CLOSED)return;if(Lh(this,Ae.STATE_CLOSING),!this.loadBalanced)this.monitor?.close();this.pool.close(),Lh(this,Ae.STATE_CLOSED),this.emit("closed")}requestCheck(){if(!this.loadBalanced)this.monitor?.requestCheck()}async command(e,t){if(this.s.state===Ae.STATE_CLOSING||this.s.state===Ae.STATE_CLOSED)throw new Te.MongoServerClosedError;let r=e.session,n=r?.pinnedConnection;if(this.incrementOperationCount(),n==null)try{n=await this.pool.checkOut({timeoutContext:t,signal:e.options.signal})}catch(l){if(this.decrementOperationCount(),!(l instanceof yN.PoolClearedError))this.handleError(l);throw l}let s=null,i=()=>{if(this.decrementOperationCount(),r?.pinnedConnection!==n)if(s!=null){let l=()=>{this.pool.checkIn(n)};s.then(l,l)}else this.pool.checkIn(n)},o;try{o=e.buildCommand(n,r)}catch(l){throw i(),l}let u=e.buildOptions(t),a=e.ns;if(this.loadBalanced&&xhe(o,r)&&!r?.pinnedConnection)r?.pin(n);if(u.directConnection=this.topology.s.options.directConnection,e instanceof _N.AggregateOperation&&e.hasWriteStage&&li.maxWireVersion(n)<AN.MIN_SECONDARY_WRITE_WIRE_VERSION)delete u.readPreference;if(this.description.iscryptd)u.omitMaxTimeMS=!0;try{try{let l=await n.command(a,o,u,e.SERVER_COMMAND_RESPONSE_TYPE);return $0.throwIfWriteConcernError(l),l}catch(l){throw this.decorateCommandError(n,o,u,l)}}catch(l){if(l instanceof Te.MongoError&&l.code?.valueOf()===Te.MONGODB_ERROR_CODES.Reauthenticate){s=this.pool.reauthenticate(n),s.then(void 0,(f)=>{s=null,li.squashError(f)}),await li.abortable(s,u),s=null;try{let f=await n.command(a,o,u,e.SERVER_COMMAND_RESPONSE_TYPE);return $0.throwIfWriteConcernError(f),f}catch(f){throw this.decorateCommandError(n,o,u,f)}}else throw l}finally{i()}}handleError(e,t){if(!(e instanceof Te.MongoError))return;if(Bhe(this,e))return;let r=e instanceof Te.MongoNetworkError&&!(e instanceof Te.MongoNetworkTimeoutError),n=e instanceof Te.MongoNetworkError&&e.beforeHandshake,s=e.hasErrorLabel(Te.MongoErrorLabel.HandshakeError),i=e.hasErrorLabel(Te.MongoErrorLabel.SystemOverloadedError);if(Te.isStateChangeError(e)||e instanceof Te.MongoParseError){let o=Te.isNodeShuttingDownError(e);if(!this.loadBalanced){if(o)e.addErrorLabel(Te.MongoErrorLabel.ResetPool);s6(this,e),queueMicrotask(()=>this.requestCheck());return}if(t&&o)this.pool.clear({serviceId:t.serviceId})}else if(r||n||s){if(i)return;if(!this.loadBalanced)e.addErrorLabel(Te.MongoErrorLabel.ResetPool),s6(this,e);else if(t)this.pool.clear({serviceId:t.serviceId})}}decorateCommandError(e,t,r,n){if(typeof n!=="object"||n==null||!("name"in n))throw new Te.MongoRuntimeError("An unexpected error type: "+typeof n);if(n.name==="AbortError"&&"cause"in n&&n.cause instanceof Te.MongoError)n=n.cause;if(!(n instanceof Te.MongoError))return n;if(Phe(this.pool,e))return n;let s=r?.session;if(n instanceof Te.MongoNetworkError){if(s&&!s.hasEnded&&s.serverSession)s.serverSession.isDirty=!0;if(i6(s,t)&&!n.hasErrorLabel(Te.MongoErrorLabel.TransientTransactionError))n.addErrorLabel(Te.MongoErrorLabel.TransientTransactionError);if((dN(this.topology)||Pl.isTransactionCommand(t))&&li.supportsRetryableWrites(this)&&!i6(s,t))n.addErrorLabel(Te.MongoErrorLabel.RetryableWriteError)}else if((dN(this.topology)||Pl.isTransactionCommand(t))&&Te.needsRetryableWriteLabel(n)&&!i6(s,t))n.addErrorLabel(Te.MongoErrorLabel.RetryableWriteError);if(s&&s.isPinned&&n.hasErrorLabel(Te.MongoErrorLabel.TransientTransactionError))s.unpin({force:!0});return this.handleError(n,e),n}decrementOperationCount(){return this.s.operationCount-=1}incrementOperationCount(){return this.s.operationCount+=1}}ON.Server=qa;function s6(e,t){if(e.loadBalanced)return;if(t instanceof Te.MongoNetworkError&&!(t instanceof Te.MongoNetworkTimeoutError))e.monitor?.reset();e.emit(qa.DESCRIPTION_RECEIVED,new Bl.ServerDescription(e.description.hostAddress,void 0,{error:t}))}function xhe(e,t){if(t)return t.inTransaction()||t.transaction.isCommitted&&"commitTransaction"in e||"aggregate"in e||"find"in e||"getMore"in e||"listCollections"in e||"listIndexes"in e||"bulkWrite"in e;return!1}function Phe(e,t){if(t.serviceId)return t.generation!==e.serviceGenerations.get(t.serviceId.toHexString());return t.generation!==e.generation}function i6(e,t){return e&&e.inTransaction()&&!Pl.isTransactionCommand(t)}function dN(e){return e.s.options.retryWrites!==!1}function Bhe(e,t){let r=e.pool.generation,n=t.connectionGeneration;if(n&&n<r)return!0;let s=e.description.topologyVersion;return Bl.compareTopologyVersion(s,t.topologyVersion)>=0}});var u6=g(function(MN){Object.defineProperty(MN,"__esModule",{value:!0});MN.RTTSampler=MN.MonitorInterval=MN.RTTPinger=MN.Monitor=MN.ServerMonitoringMode=void 0;var Fn=G("timers"),v0=we(),Qu=e6(),bN=fE(),Il=Or(),hi=Q(),DN=Du(),k0=Is(),ot=ae(),ut=as(),yo=I0(),go=o6(),Fl="idle",ja="monitoring",Nl=ot.makeStateMachine({[ut.STATE_CLOSING]:[ut.STATE_CLOSING,Fl,ut.STATE_CLOSED],[ut.STATE_CLOSED]:[ut.STATE_CLOSED,ja],[Fl]:[Fl,ja,ut.STATE_CLOSING],[ja]:[ja,Fl,ut.STATE_CLOSING]}),Fhe=new Set([ut.STATE_CLOSING,ut.STATE_CLOSED,ja]);function Uh(e){return e.s.state===ut.STATE_CLOSED||e.s.state===ut.STATE_CLOSING}MN.ServerMonitoringMode=Object.freeze({auto:"auto",poll:"poll",stream:"stream"});class TN extends k0.TypedEventEmitter{constructor(e,t){super();this.component=DN.MongoLoggableComponent.TOPOLOGY,this.on("error",ot.noop),this.server=e,this.connection=null,this.cancellationToken=new k0.CancellationToken,this.cancellationToken.setMaxListeners(1/0),this.monitorId=void 0,this.s={state:ut.STATE_CLOSED},this.address=e.description.address,this.options=Object.freeze({connectTimeoutMS:t.connectTimeoutMS??1e4,heartbeatFrequencyMS:t.heartbeatFrequencyMS??1e4,minHeartbeatFrequencyMS:t.minHeartbeatFrequencyMS??500,serverMonitoringMode:t.serverMonitoringMode}),this.isRunningInFaasEnv=bN.getFAASEnv()!=null,this.mongoLogger=this.server.topology.client?.mongoLogger,this.rttSampler=new h6(10);let r=this.cancellationToken,n={id:"<monitor>",generation:e.pool.generation,cancellationToken:r,hostAddress:e.description.hostAddress,...t,raw:!1,useBigInt64:!1,promoteLongs:!0,promoteValues:!0,promoteBuffers:!0};if(delete n.credentials,n.autoEncrypter)delete n.autoEncrypter;this.connectOptions=Object.freeze(n)}connect(){if(this.s.state!==ut.STATE_CLOSED)return;let e=this.options.heartbeatFrequencyMS,t=this.options.minHeartbeatFrequencyMS;this.monitorId=new q0(CN(this),{heartbeatFrequencyMS:e,minHeartbeatFrequencyMS:t,immediate:!0})}requestCheck(){if(Fhe.has(this.s.state))return;this.monitorId?.wake()}reset(){let e=this.server.description.topologyVersion;if(Uh(this)||e==null)return;Nl(this,ut.STATE_CLOSING),wN(this),Nl(this,Fl);let t=this.options.heartbeatFrequencyMS,r=this.options.minHeartbeatFrequencyMS;this.monitorId=new q0(CN(this),{heartbeatFrequencyMS:t,minHeartbeatFrequencyMS:r})}close(){if(Uh(this))return;Nl(this,ut.STATE_CLOSING),wN(this),this.emit("close"),Nl(this,ut.STATE_CLOSED)}get roundTripTime(){return this.rttSampler.average()}get minRoundTripTime(){return this.rttSampler.min()}get latestRtt(){return this.rttSampler.last}addRttSample(e){this.rttSampler.addSample(e)}clearRttSamples(){this.rttSampler.clear()}}MN.Monitor=TN;function wN(e){e.monitorId?.stop(),e.monitorId=void 0,e.rttPinger?.close(),e.rttPinger=void 0,e.cancellationToken.emit("cancel"),e.connection?.destroy(),e.connection=null,e.clearRttSamples()}function a6(e,t){if(t==null)return!1;let r=e.options.serverMonitoringMode;if(r===MN.ServerMonitoringMode.poll)return!1;if(r===MN.ServerMonitoringMode.stream)return!0;if(e.isRunningInFaasEnv)return!1;return!0}function Nhe(e,t){let r,n,s=e.server.description.topologyVersion,i=a6(e,s);e.emitAndLogHeartbeat(go.Server.SERVER_HEARTBEAT_STARTED,e.server.topology.s.id,void 0,new yo.ServerHeartbeatStartedEvent(e.address,i));function o(c){e.connection?.destroy(),e.connection=null,e.emitAndLogHeartbeat(go.Server.SERVER_HEARTBEAT_FAILED,e.server.topology.s.id,void 0,new yo.ServerHeartbeatFailedEvent(e.address,ot.calculateDurationInMs(r),c,n));let l=!(c instanceof hi.MongoError)?new hi.MongoError(hi.MongoError.buildErrorMessage(c),{cause:c}):c;if(l.addErrorLabel(hi.MongoErrorLabel.ResetPool),l instanceof hi.MongoNetworkTimeoutError)l.addErrorLabel(hi.MongoErrorLabel.InterruptInUseConnections);e.emit("resetServer",l),t(c)}function u(c){if(!("isWritablePrimary"in c))c.isWritablePrimary=c[Il.LEGACY_HELLO_COMMAND];let l=i&&e.rttPinger?e.rttPinger.latestRtt??ot.calculateDurationInMs(r):ot.calculateDurationInMs(r);if(e.addRttSample(l),e.emitAndLogHeartbeat(go.Server.SERVER_HEARTBEAT_SUCCEEDED,e.server.topology.s.id,c.connectionId,new yo.ServerHeartbeatSucceededEvent(e.address,l,c,i)),i)e.emitAndLogHeartbeat(go.Server.SERVER_HEARTBEAT_STARTED,e.server.topology.s.id,void 0,new yo.ServerHeartbeatStartedEvent(e.address,!0)),r=ot.processTimeMS();else e.rttPinger?.close(),e.rttPinger=void 0,t(void 0,c)}let{connection:a}=e;if(a&&!a.closed){let{serverApi:c,helloOk:l}=a,f=e.options.connectTimeoutMS,h=e.options.heartbeatFrequencyMS,d={[c?.version||l?"hello":Il.LEGACY_HELLO_COMMAND]:1,...i&&s?{maxAwaitTimeMS:h,topologyVersion:Ihe(s)}:{}},p=i?{socketTimeoutMS:f?f+h:0,exhaustAllowed:!0}:{socketTimeoutMS:f};if(i&&e.rttPinger==null)e.rttPinger=new l6(e);if(r=ot.processTimeMS(),i)return n=!0,a.exhaustCommand(ot.ns("admin.$cmd"),d,p,(m,_)=>{if(m)return o(m);return u(_)});n=!1,a.command(ot.ns("admin.$cmd"),d,p).then(u,o);return}(async()=>{let c=await Qu.makeSocket(e.connectOptions),l=Qu.makeConnection(e.connectOptions,c);r=ot.processTimeMS();try{return await Qu.performInitialHandshake(l,e.connectOptions),l}catch(f){throw l.destroy(),f}})().then((c)=>{if(Uh(e)){c.destroy();return}let l=ot.calculateDurationInMs(r);e.addRttSample(l),e.connection=c,e.emitAndLogHeartbeat(go.Server.SERVER_HEARTBEAT_SUCCEEDED,e.server.topology.s.id,c.hello?.connectionId,new yo.ServerHeartbeatSucceededEvent(e.address,l,c.hello,a6(e,c.hello?.topologyVersion))),t(void 0,c.hello)},(c)=>{e.connection=null,n=!1,o(c)})}function CN(e){return(t)=>{if(e.s.state===ja){queueMicrotask(t);return}Nl(e,ja);function r(){if(!Uh(e))Nl(e,Fl);t()}Nhe(e,(n,s)=>{if(n){if(e.server.description.type===ut.ServerType.Unknown)return r()}if(a6(e,s?.topologyVersion))Fn.setTimeout(()=>{if(!Uh(e))e.monitorId?.wake()},0);r()})}}function Ihe(e){return{processId:e.processId,counter:v0.Long.isLong(e.counter)?e.counter:v0.Long.fromNumber(e.counter)}}class l6{constructor(e){this.connection=void 0,this.cancellationToken=e.cancellationToken,this.closed=!1,this.monitor=e,this.latestRtt=e.latestRtt??void 0;let t=e.options.heartbeatFrequencyMS;this.monitorId=Fn.setTimeout(()=>this.measureRoundTripTime(),t)}get roundTripTime(){return this.monitor.roundTripTime}get minRoundTripTime(){return this.monitor.minRoundTripTime}close(){this.closed=!0,Fn.clearTimeout(this.monitorId),this.connection?.destroy(),this.connection=void 0}measureAndReschedule(e,t){if(this.closed){t?.destroy();return}if(this.connection==null)this.connection=t;this.latestRtt=ot.calculateDurationInMs(e),this.monitorId=Fn.setTimeout(()=>this.measureRoundTripTime(),this.monitor.options.heartbeatFrequencyMS)}measureRoundTripTime(){let e=ot.processTimeMS();if(this.closed)return;let t=this.connection;if(t==null){Qu.connect(this.monitor.connectOptions).then((n)=>{this.measureAndReschedule(e,n)},()=>{this.connection=void 0});return}let r=t.serverApi?.version||t.helloOk?"hello":Il.LEGACY_HELLO_COMMAND;t.command(ot.ns("admin.$cmd"),{[r]:1},void 0).then(()=>this.measureAndReschedule(e),()=>{this.connection?.destroy(),this.connection=void 0;return})}}MN.RTTPinger=l6;class q0{constructor(e,t={}){if(this.isExpeditedCallToFnScheduled=!1,this.stopped=!1,this.isExecutionInProgress=!1,this.hasExecutedOnce=!1,this._executeAndReschedule=()=>{if(this.stopped)return;if(this.timerId)Fn.clearTimeout(this.timerId);this.isExpeditedCallToFnScheduled=!1,this.isExecutionInProgress=!0,this.fn(()=>{this.lastExecutionEnded=ot.processTimeMS(),this.isExecutionInProgress=!1,this._reschedule(this.heartbeatFrequencyMS)})},this.fn=e,this.lastExecutionEnded=-1/0,this.heartbeatFrequencyMS=t.heartbeatFrequencyMS??1000,this.minHeartbeatFrequencyMS=t.minHeartbeatFrequencyMS??500,t.immediate)this._executeAndReschedule();else this._reschedule(void 0)}wake(){let t=ot.processTimeMS()-this.lastExecutionEnded;if(t<0)return this._executeAndReschedule();if(this.isExecutionInProgress)return;if(this.isExpeditedCallToFnScheduled)return;if(t<this.minHeartbeatFrequencyMS){this.isExpeditedCallToFnScheduled=!0,this._reschedule(this.minHeartbeatFrequencyMS-t);return}this._executeAndReschedule()}stop(){if(this.stopped=!0,this.timerId)Fn.clearTimeout(this.timerId),this.timerId=void 0;this.lastExecutionEnded=-1/0,this.isExpeditedCallToFnScheduled=!1}toString(){return JSON.stringify(this)}toJSON(){let e=ot.processTimeMS(),t=e-this.lastExecutionEnded;return{timerId:this.timerId!=null?"set":"cleared",lastCallTime:this.lastExecutionEnded,isExpeditedCheckScheduled:this.isExpeditedCallToFnScheduled,stopped:this.stopped,heartbeatFrequencyMS:this.heartbeatFrequencyMS,minHeartbeatFrequencyMS:this.minHeartbeatFrequencyMS,currentTime:e,timeSinceLastCall:t}}_reschedule(e){if(this.stopped)return;if(this.timerId)Fn.clearTimeout(this.timerId);this.timerId=Fn.setTimeout(this._executeAndReschedule,e||this.heartbeatFrequencyMS)}}MN.MonitorInterval=q0;class h6{constructor(e=10){this.rttSamples=new Float64Array(e),this.length=0,this.writeIndex=0}addSample(e){if(this.rttSamples[this.writeIndex++]=e,this.length<this.rttSamples.length)this.length++;this.writeIndex%=this.rttSamples.length}min(){if(this.length<2)return 0;let e=this.rttSamples[0];for(let t=1;t<this.length;t++)if(this.rttSamples[t]<e)e=this.rttSamples[t];return e}average(){if(this.length===0)return 0;let e=0;for(let t=0;t<this.length;t++)e+=this.rttSamples[t];return e/this.length}get last(){if(this.length===0)return null;return this.rttSamples[this.writeIndex===0?this.length-1:this.writeIndex-1]}clear(){this.length=0,this.writeIndex=0}}MN.RTTSampler=h6});var m6=g(function(qN){Object.defineProperty(qN,"__esModule",{value:!0});qN.DEFAULT_OPTIONS=qN.OPTIONS=void 0;qN.resolveSRVRecord=Whe;qN.parseOptions=Khe;var Rl=G("dns"),khe=NE(),Nn=G("process"),NN=G("url"),fi=Wp(),vr=uo(),j0=fh(),L0=PB(),B=Q(),Xu=va(),kl=Du(),$l=vi(),Zr=Ur(),IN=NB(),RN=u6(),He=ae(),Xr=Kn(),f6=["authSource","replicaSet","loadBalanced"],qhe=["srvMaxHosts","srvServiceName","srvAllowedHostsSuffix","srvHostValidator"],PN=new Set(["test","localhost","invalid","example","local","internal","corp","home","mail"]),jhe="loadBalanced option only supported with a single host in the URI",Lhe="loadBalanced option not supported with a replicaSet option",Uhe="loadBalanced option not supported when directConnection is provided";function $N(e){let t=e==="SRV"?(r)=>Rl.promises.resolve(r,"SRV"):(r)=>Rl.promises.resolve(r,"TXT");return async function(n){try{return await t(n)}catch(s){if(s.code===Rl.TIMEOUT)return await t(n);else throw s}}}var Vhe=$N("SRV"),zhe=$N("TXT");async function Whe(e){if(typeof e.srvHost!=="string")throw new B.MongoAPIError('Option "srvHost" must not be empty');let t=e.srvHost,r=zhe(t);r.then(void 0,He.squashError);let n=`_${e.srvServiceName}._tcp.${t}`,s=await Vhe(n);if(s.length===0)throw new B.MongoAPIError("No addresses found at host");let i=s.map(({name:h,port:d})=>{let p=He.normalizeDnsName(h);return He.verifySrvHost(p,t,e),He.HostAddress.fromString(`${p}:${d??27017}`)});d6(i,e,!0);let o;try{o=await r}catch(h){if(h.code!=="ENODATA"&&h.code!=="ENOTFOUND")throw h;return i}if(o.length>1)throw new B.MongoParseError("Multiple text records not allowed");let u=new NN.URLSearchParams(o[0].join(""));if([...u.keys()].some((h)=>!f6.includes(h)))throw new B.MongoParseError(`Text record may only set any of: ${f6.join(", ")}`);if(f6.some((h)=>u.get(h)===""))throw new B.MongoParseError("Cannot have empty URI params in DNS TXT Record");let c=u.get("authSource")??void 0,l=u.get("replicaSet")??void 0,f=u.get("loadBalanced")??void 0;if(!e.userSpecifiedAuthSource&&c&&e.credentials&&!vr.AUTH_MECHS_AUTH_SRC_EXTERNAL.has(e.credentials.mechanism))e.credentials=fi.MongoCredentials.merge(e.credentials,{source:c});if(!e.userSpecifiedReplicaSet&&l)e.replicaSet=l;if(f==="true")e.loadBalanced=!0;if(e.replicaSet&&e.srvMaxHosts>0)throw new B.MongoParseError("Cannot combine replicaSet option with srvMaxHosts");return d6(i,e,!0),i}function Hhe(e){if(!e)return;let t=(r,n)=>{if(e.has(r)&&e.has(n))throw new B.MongoAPIError(`The '${r}' option cannot be used with the '${n}' option`)};t("tlsInsecure","tlsAllowInvalidCertificates"),t("tlsInsecure","tlsAllowInvalidHostnames")}function Ho(e,t){if(typeof t==="boolean")return t;switch(t){case"true":return!0;case"false":return!1;default:throw new B.MongoParseError(`${e} must be either "true" or "false"`)}}function p6(e,t){let r=He.parseInteger(t);if(r!=null)return r;throw new B.MongoParseError(`Expected ${e} to be stringified int value`)}function Vh(e,t){let r=p6(e,t);if(r<0)throw new B.MongoParseError(`${e} can only be a positive int value, got: ${r}`);return r}function*BN(e){if(e==="")return;let t=e.split(",");for(let r of t){let[n,s]=r.split(/:(.*)/);if(s==null)throw new B.MongoParseError("Cannot have undefined values in key value pairs");yield[n,s]}}class zh extends Map{constructor(e=[]){super(e.map(([t,r])=>[t.toLowerCase(),r]))}has(e){return super.has(e.toLowerCase())}get(e){return super.get(e.toLowerCase())}set(e,t){return super.set(e.toLowerCase(),t)}delete(e){return super.delete(e.toLowerCase())}}function Khe(e,t=void 0,r={}){if(t!=null&&!(t instanceof Xu.MongoClient))r=t,t=void 0;if(r.useBigInt64&&typeof r.promoteLongs==="boolean"&&!r.promoteLongs)throw new B.MongoAPIError("Must request either bigint or Long for int64 deserialization");if(r.useBigInt64&&typeof r.promoteValues==="boolean"&&!r.promoteValues)throw new B.MongoAPIError("Must request either bigint or Long for int64 deserialization");let n;try{n=new khe.default(e)}catch(y){if(y.message?.startsWith("Username contains unescaped characters"))throw new B.MongoParseError("Username contains unescaped characters");throw y}let{hosts:s,isSRV:i}=n,o=Object.create(null);o.hosts=i?[]:s.map(He.HostAddress.fromString);let u=new zh;if(n.pathname!=="/"&&n.pathname!==""){let y=decodeURIComponent(n.pathname[0]==="/"?n.pathname.slice(1):n.pathname);if(y)u.set("dbName",[y])}if(n.username!==""){let y={username:decodeURIComponent(n.username)};if(typeof n.password==="string")y.password=decodeURIComponent(n.password);u.set("auth",[y])}let a=new Set(Object.keys(qN.OPTIONS).map((y)=>y.toLowerCase())),c=Array.from(n.searchParams.keys()).flatMap((y,E)=>a.has(y.toLowerCase())?[]:[E+1]);if(c.length!==0)throw new B.MongoParseError(`connection string contains unsupported options, at position: ${c.join(", ")}`);for(let y of n.searchParams.keys()){let E=n.searchParams.getAll(y),w=Object.keys(qN.OPTIONS).find((A)=>A.toLowerCase()===y.toLowerCase()),b=/readPreferenceTags/i.test(y);if(!b&&E.length>1)throw new B.MongoInvalidArgumentError(`URI option "${w}" cannot appear more than once in the connection string`);if(!b&&E.includes("")&&!Jhe(y))throw new B.MongoAPIError(`URI option "${w}" cannot be specified with no value`);if(!u.has(y))u.set(y,E)}let l=new zh(Object.entries(r).filter(([,y])=>y!=null)),[f]=u.get("readPreference")??[];if(typeof f==="string"&&!Zr.ReadPreference.isValid(f))throw new B.MongoInvalidArgumentError("readPreference is not a valid read preference mode");if(u.has("serverApi"))throw new B.MongoParseError("URI cannot contain `serverApi`, it can only be passed to the client");if(u.has("srvHostValidator"))throw new B.MongoParseError("URI cannot contain `srvHostValidator`, it can only be passed to the client");let h=u.get("authMechanismProperties");if(h){for(let y of h)if(/(^|,)ALLOWED_HOSTS:/.test(y))throw new B.MongoParseError("Auth mechanism property ALLOWED_HOSTS is not allowed in the connection string.")}if(l.has("loadBalanced"))throw new B.MongoParseError("loadBalanced is only a valid option in the URI");let d=new zh,p=new Set([...u.keys(),...l.keys()]);for(let y of p){let E=[],w=l.get(y);if(w!=null)E.push(w);let b=u.get(y)??[];E.push(...b),d.set(y,E)}if(d.has("tls")||d.has("ssl")){let y=(d.get("tls")||[]).concat(d.get("ssl")||[]).map(Ho.bind(null,"tls/ssl"));if(new Set(y).size!==1)throw new B.MongoParseError("All values of tls/ssl must be the same.")}Hhe(d);let m=He.setDifference(p,a);if(m.size!==0){let y=m.size>1?"options":"option",E=m.size>1?"are":"is";throw new B.MongoParseError(`${y} ${Array.from(m).join(", ")} ${E} not supported`)}for(let[y,E]of Object.entries(qN.OPTIONS)){let w=d.get(y);if(!w||w.length===0){if(qN.DEFAULT_OPTIONS.has(y))FN(o,y,E,[qN.DEFAULT_OPTIONS.get(y)])}else{let{deprecated:b,ignored:A}=E;if(b){let M=typeof b==="string"?`: ${b}`:"";He.emitWarning(`${y} is a deprecated option${M}`)}if(A)continue;FN(o,y,E,w)}}if(o.credentials){let y=o.credentials.mechanism===vr.AuthMechanism.MONGODB_GSSAPI,E=o.credentials.mechanism===vr.AuthMechanism.MONGODB_X509,w=o.credentials.mechanism===vr.AuthMechanism.MONGODB_AWS,b=o.credentials.mechanism===vr.AuthMechanism.MONGODB_OIDC;if((y||E)&&d.has("authSource")&&o.credentials.source!=="$external")throw new B.MongoParseError(`authMechanism ${o.credentials.mechanism} requires an authSource of '$external'`);if(!(y||E||w||b)&&o.dbName&&!d.has("authSource"))o.credentials=fi.MongoCredentials.merge(o.credentials,{source:o.dbName});if(w){let{username:A,password:M}=o.credentials;if(A||M)throw new B.MongoAPIError("username and password cannot be provided when using MONGODB-AWS. Credentials must be provided in a manner that can be read by the AWS SDK.");if(o.credentials.mechanismProperties.AWS_SESSION_TOKEN)throw new B.MongoAPIError("AWS_SESSION_TOKEN cannot be provided when using MONGODB-AWS. Credentials must be provided in a manner that can be read by the AWS SDK.")}if(o.credentials.validate(),o.credentials.password===""&&o.credentials.username===""&&o.credentials.mechanism===vr.AuthMechanism.MONGODB_DEFAULT&&Object.keys(o.credentials.mechanismProperties).length===0)delete o.credentials}if(!o.dbName)o.dbName="test";if(d6(s,o,i),t&&o.autoEncryption)L0.Encrypter.checkForMongoCrypt(),o.encrypter=new L0.Encrypter(t,e,r),o.autoEncrypter=o.encrypter.autoEncrypter;if(o.userSpecifiedAuthSource=l.has("authSource")||u.has("authSource"),o.userSpecifiedReplicaSet=l.has("replicaSet")||u.has("replicaSet"),i){if(o.srvHost=s[0],o.directConnection)throw new B.MongoAPIError("SRV URI does not support directConnection");if(o.srvMaxHosts>0&&typeof o.replicaSet==="string")throw new B.MongoParseError("Cannot use srvMaxHosts option with replicaSet");if(o.srvAllowedHostsSuffix!=null&&o.srvHostValidator!=null)throw new B.MongoParseError("Cannot use srvAllowedHostsSuffix together with srvHostValidator");let y=!l.has("tls")&&!u.has("tls"),E=!l.has("ssl")&&!u.has("ssl");if(y&&E)o.tls=!0}else{let y=qhe.filter((E)=>u.has(E)||l.has(E));if(y.length>0)throw new B.MongoParseError(`Cannot use ${y.join(", ")} with a non-srv connection string`)}if(o.directConnection&&o.hosts.length!==1)throw new B.MongoParseError("directConnection option requires exactly one host");if(!o.proxyHost&&(o.proxyPort||o.proxyUsername||o.proxyPassword))throw new B.MongoParseError("Must specify proxyHost if other proxy options are passed");if(o.proxyUsername&&!o.proxyPassword||!o.proxyUsername&&o.proxyPassword)throw new B.MongoParseError("Can only specify both of proxy username/password or neither");if(["proxyHost","proxyPort","proxyUsername","proxyPassword"].map((y)=>u.get(y)??[]).some((y)=>y.length>1))throw new B.MongoParseError("Proxy options cannot be specified multiple times in the connection string");return o.mongoLoggerOptions=kl.MongoLogger.resolveOptions({MONGODB_LOG_COMMAND:Nn.env.MONGODB_LOG_COMMAND,MONGODB_LOG_TOPOLOGY:Nn.env.MONGODB_LOG_TOPOLOGY,MONGODB_LOG_SERVER_SELECTION:Nn.env.MONGODB_LOG_SERVER_SELECTION,MONGODB_LOG_CONNECTION:Nn.env.MONGODB_LOG_CONNECTION,MONGODB_LOG_CLIENT:Nn.env.MONGODB_LOG_CLIENT,MONGODB_LOG_ALL:Nn.env.MONGODB_LOG_ALL,MONGODB_LOG_MAX_DOCUMENT_LENGTH:Nn.env.MONGODB_LOG_MAX_DOCUMENT_LENGTH,MONGODB_LOG_PATH:Nn.env.MONGODB_LOG_PATH},{mongodbLogPath:o.mongodbLogPath,mongodbLogComponentSeverities:o.mongodbLogComponentSeverities,mongodbLogMaxDocumentLength:o.mongodbLogMaxDocumentLength}),o.runtime=IN.resolveRuntimeAdapters(r),o.runtime.then(void 0,He.squashError),o[vN]=Ghe,o.toJSON=kN,o}var vN=Symbol.for("nodejs.util.inspect.custom");function kN(){let e={...this};delete e[vN];for(let t of["proxyUsername","proxyPassword","passphrase"])if(e[t]!=null)e[t]="<redacted>";return e}function Ghe(e,t,r){return r(kN.call(this),t)}function d6(e,t,r){if(t.loadBalanced){if(e.length>1)throw new B.MongoParseError(jhe);if(t.replicaSet)throw new B.MongoParseError(Lhe);if(t.directConnection)throw new B.MongoParseError(Uhe);if(r&&t.srvMaxHosts>0)throw new B.MongoParseError("Cannot limit srv hosts with loadBalanced enabled")}return}function Yhe(e){let t=e.replace(/^\.+|\.+$/g,"");if(t==="")throw new B.MongoParseError("srvAllowedHostsSuffix must contain at least one domain label");let r=He.dnsNameToASCII(t);if(r==null)throw new B.MongoParseError("srvAllowedHostsSuffix is not a valid domain name");if(!r.includes(".")&&!PN.has(r))throw new B.MongoParseError(`srvAllowedHostsSuffix must contain at least two domain labels, or be one of: ${[...PN].join(", ")}`);return`.${r}`}function Jhe(e){return Object.entries(qN.OPTIONS).some(([t,r])=>r.ignored&&t.toLowerCase()===e.toLowerCase())}function FN(e,t,r,n){let{target:s,type:i,transform:o}=r,u=s??t;switch(i){case"boolean":e[u]=Ho(u,n[0]);break;case"int":e[u]=p6(u,n[0]);break;case"uint":e[u]=Vh(u,n[0]);break;case"string":if(n[0]==null)break;e[u]=String(n[0]);break;case"record":if(!He.isRecord(n[0]))throw new B.MongoParseError(`${u} must be an object`);e[u]=n[0];break;case"any":e[u]=n[0];break;default:{if(!o)throw new B.MongoParseError("Descriptors missing a type must define a transform");let a=o({name:u,options:e,values:n});e[u]=a;break}}}qN.OPTIONS={enableOverloadRetargeting:{default:!1,type:"boolean"},appName:{type:"string"},auth:{target:"credentials",transform({name:e,options:t,values:[r]}){if(!He.isRecord(r,["username","password"]))throw new B.MongoParseError(`${e} must be an object with 'username' and 'password' properties`);return fi.MongoCredentials.merge(t.credentials,{username:r.username,password:r.password})}},authMechanism:{target:"credentials",transform({options:e,values:[t]}){let r=Object.values(vr.AuthMechanism),n;try{[n]=r.filter((o)=>o.match(RegExp(String.raw`\b${t}\b`,"i")))}catch{}if(!n)throw new B.MongoParseError(`authMechanism must be one of ${r}`);let s=e.credentials?.source;if(n===vr.AuthMechanism.MONGODB_PLAIN||vr.AUTH_MECHS_AUTH_SRC_EXTERNAL.has(n))s="$external";let i=e.credentials?.password;if(n===vr.AuthMechanism.MONGODB_X509&&i==="")i=void 0;return fi.MongoCredentials.merge(e.credentials,{mechanism:n,source:s,password:i})}},authMechanismProperties:{target:"credentials",transform({options:e,values:t}){let r=Object.create(null);for(let n of t)if(typeof n==="string")for(let[s,i]of BN(n))try{r[s]=Ho(s,i)}catch{r[s]=i}else{if(!He.isRecord(n))throw new B.MongoParseError("AuthMechanismProperties must be an object");r={...n}}return fi.MongoCredentials.merge(e.credentials,{mechanismProperties:r})}},authSource:{target:"credentials",transform({options:e,values:[t]}){let r=String(t);return fi.MongoCredentials.merge(e.credentials,{source:r})}},autoEncryption:{type:"record"},autoSelectFamily:{type:"boolean"},autoSelectFamilyAttemptTimeout:{type:"uint"},bsonRegExp:{type:"boolean"},serverApi:{target:"serverApi",transform({values:[e]}){let t=typeof e==="string"?{version:e}:e,r=t&&t.version;if(!r)throw new B.MongoParseError(`Invalid \`serverApi\` property; must specify a version from the following enum: ["${Object.values(Xu.ServerApiVersion).join('", "')}"]`);if(!Object.values(Xu.ServerApiVersion).some((n)=>n===r))throw new B.MongoParseError(`Invalid server API version=${r}; must be in the following enum: ["${Object.values(Xu.ServerApiVersion).join('", "')}"]`);return t}},checkKeys:{type:"boolean"},compressors:{default:"none",target:"compressors",transform({values:e}){let t=new Set;for(let r of e){let n=typeof r==="string"?r.split(","):r;if(!Array.isArray(n))throw new B.MongoInvalidArgumentError("compressors must be an array or a comma-delimited list of strings");for(let s of n)if(Object.keys(j0.Compressor).includes(String(s)))t.add(String(s));else throw new B.MongoInvalidArgumentError(`compressors contains a value that is not a valid compression mechanism. Must be one of: ${Object.keys(j0.Compressor)}.`)}return[...t]}},connectTimeoutMS:{default:30000,type:"uint"},dbName:{type:"string"},directConnection:{default:!1,type:"boolean"},driverInfo:{default:{},type:"record"},enableUtf8Validation:{type:"boolean",default:!0},family:{transform({name:e,values:[t]}){let r=p6(e,t);if(r===4||r===6)return r;throw new B.MongoParseError(`Option 'family' must be 4 or 6 got ${r}.`)}},fieldsAsRaw:{type:"record"},forceServerObjectId:{default:!1,type:"boolean"},fsync:{deprecated:"Please use journal instead",target:"writeConcern",transform({name:e,options:t,values:[r]}){let n=Xr.WriteConcern.fromOptions({writeConcern:{...t.writeConcern,fsync:Ho(e,r)}});if(!n)throw new B.MongoParseError(`Unable to make a writeConcern from fsync=${r}`);return n}},heartbeatFrequencyMS:{default:1e4,type:"uint"},ignoreUndefined:{type:"boolean"},j:{deprecated:"Please use journal instead",target:"writeConcern",transform({name:e,options:t,values:[r]}){let n=Xr.WriteConcern.fromOptions({writeConcern:{...t.writeConcern,journal:Ho(e,r)}});if(!n)throw new B.MongoParseError(`Unable to make a writeConcern from journal=${r}`);return n}},journal:{target:"writeConcern",transform({name:e,options:t,values:[r]}){let n=Xr.WriteConcern.fromOptions({writeConcern:{...t.writeConcern,journal:Ho(e,r)}});if(!n)throw new B.MongoParseError(`Unable to make a writeConcern from journal=${r}`);return n}},loadBalanced:{default:!1,type:"boolean"},localThresholdMS:{default:15,type:"uint"},maxAdaptiveRetries:{default:2,type:"uint"},maxConnecting:{default:2,transform({name:e,values:[t]}){let r=Vh(e,t);if(r===0)throw new B.MongoInvalidArgumentError("maxConnecting must be > 0 if specified");return r}},maxIdleTimeMS:{default:0,type:"uint"},maxPoolSize:{default:100,type:"uint"},maxStalenessSeconds:{target:"readPreference",transform({name:e,options:t,values:[r]}){let n=Vh(e,r);if(t.readPreference)return Zr.ReadPreference.fromOptions({readPreference:{...t.readPreference,maxStalenessSeconds:n}});else return new Zr.ReadPreference("secondary",void 0,{maxStalenessSeconds:n})}},minInternalBufferSize:{type:"uint"},minPoolSize:{default:0,type:"uint"},minHeartbeatFrequencyMS:{default:500,type:"uint"},monitorCommands:{default:!1,type:"boolean"},name:{target:"driverInfo",transform({values:[e],options:t}){return{...t.driverInfo,name:String(e)}}},noDelay:{default:!0,type:"boolean"},pkFactory:{default:He.DEFAULT_PK_FACTORY,transform({values:[e]}){if(He.isRecord(e,["createPk"])&&typeof e.createPk==="function")return e;throw new B.MongoParseError("Option pkFactory must be an object with a createPk function")}},promoteBuffers:{type:"boolean"},promoteLongs:{type:"boolean"},promoteValues:{type:"boolean"},useBigInt64:{type:"boolean"},proxyHost:{type:"string"},proxyPassword:{type:"string"},proxyPort:{type:"uint"},proxyUsername:{type:"string"},raw:{default:!1,type:"boolean"},readConcern:{transform({values:[e],options:t}){if(e instanceof $l.ReadConcern||He.isRecord(e,["level"]))return $l.ReadConcern.fromOptions({...t.readConcern,...e});throw new B.MongoParseError("ReadConcern must be an object")}},readConcernLevel:{target:"readConcern",transform({values:[e],options:t}){return $l.ReadConcern.fromOptions({...t.readConcern,level:e})}},readPreference:{default:Zr.ReadPreference.primary,transform({values:[e],options:t}){if(e instanceof Zr.ReadPreference)return Zr.ReadPreference.fromOptions({readPreference:{...t.readPreference,...e},...e});if(He.isRecord(e,["mode"])){let r=Zr.ReadPreference.fromOptions({readPreference:{...t.readPreference,...e},...e});if(r)return r;else throw new B.MongoParseError(`Cannot make read preference from ${JSON.stringify(e)}`)}if(typeof e==="string"){let r={hedge:t.readPreference?.hedge,maxStalenessSeconds:t.readPreference?.maxStalenessSeconds};return new Zr.ReadPreference(e,t.readPreference?.tags,r)}throw new B.MongoParseError(`Unknown ReadPreference value: ${e}`)}},readPreferenceTags:{target:"readPreference",transform({values:e,options:t}){let r=Array.isArray(e[0])?e[0]:e,n=[];for(let s of r){let i=Object.create(null);if(typeof s==="string")for(let[o,u]of BN(s))i[o]=u;if(He.isRecord(s))for(let[o,u]of Object.entries(s))i[o]=u;n.push(i)}return Zr.ReadPreference.fromOptions({readPreference:t.readPreference,readPreferenceTags:n})}},replicaSet:{type:"string"},retryReads:{default:!0,type:"boolean"},retryWrites:{default:!0,type:"boolean"},runtimeAdapters:{type:"record"},serializeFunctions:{type:"boolean"},serverMonitoringMode:{default:"auto",transform({values:[e]}){if(!Object.values(RN.ServerMonitoringMode).includes(e))throw new B.MongoParseError("serverMonitoringMode must be one of `auto`, `poll`, or `stream`");return e}},serverSelectionTimeoutMS:{default:30000,type:"uint"},servername:{type:"string"},socketTimeoutMS:{default:0,type:"uint"},srvAllowedHostsSuffix:{transform({values:[e]}){if(typeof e!=="string")throw new B.MongoParseError("srvAllowedHostsSuffix must be a string");return Yhe(e)}},srvHostValidator:{transform({values:[e]}){if(typeof e!=="function")throw new B.MongoParseError("srvHostValidator must be a function");return(t)=>{let r;try{r=e(t)}catch(n){throw new B.MongoAPIError("srvHostValidator threw an error",{cause:n})}if(typeof r!=="boolean")throw new B.MongoAPIError(`srvHostValidator must return a boolean, received ${typeof r}`);return r}}},srvMaxHosts:{type:"uint",default:0},srvServiceName:{type:"string",default:"mongodb"},ssl:{target:"tls",type:"boolean"},timeoutMS:{deprecated:"timeoutMS has no effect and will be removed in a future release",ignored:!0},tls:{type:"boolean"},tlsAllowInvalidCertificates:{target:"rejectUnauthorized",transform({name:e,values:[t]}){return!Ho(e,t)}},tlsAllowInvalidHostnames:{target:"checkServerIdentity",transform({name:e,values:[t]}){return Ho(e,t)?()=>{return}:void 0}},tlsCAFile:{type:"string"},tlsCRLFile:{type:"string"},tlsCertificateKeyFile:{type:"string"},tlsCertificateKeyFilePassword:{target:"passphrase",type:"any"},tlsInsecure:{transform({name:e,options:t,values:[r]}){let n=Ho(e,r);if(n)t.checkServerIdentity=()=>{return},t.rejectUnauthorized=!1;else t.checkServerIdentity=t.tlsAllowInvalidHostnames?()=>{return}:void 0,t.rejectUnauthorized=t.tlsAllowInvalidCertificates?!1:!0;return n}},w:{target:"writeConcern",transform({values:[e],options:t}){return Xr.WriteConcern.fromOptions({writeConcern:{...t.writeConcern,w:e}})}},waitQueueTimeoutMS:{default:0,type:"uint"},writeConcern:{target:"writeConcern",transform({values:[e],options:t}){if(He.isRecord(e)||e instanceof Xr.WriteConcern)return Xr.WriteConcern.fromOptions({writeConcern:{...t.writeConcern,...e}});else if(e==="majority"||typeof e==="number")return Xr.WriteConcern.fromOptions({writeConcern:{...t.writeConcern,w:e}});throw new B.MongoParseError("Invalid WriteConcern cannot parse")}},wtimeout:{deprecated:"Please use wtimeoutMS instead",target:"writeConcern",transform({values:[e],options:t}){let r=Xr.WriteConcern.fromOptions({writeConcern:{...t.writeConcern,wtimeout:Vh("wtimeout",e)}});if(r)return r;throw new B.MongoParseError("Cannot make WriteConcern from wtimeout")}},wtimeoutMS:{target:"writeConcern",transform({values:[e],options:t}){let r=Xr.WriteConcern.fromOptions({writeConcern:{...t.writeConcern,wtimeoutMS:Vh("wtimeoutMS",e)}});if(r)return r;throw new B.MongoParseError("Cannot make WriteConcern from wtimeout")}},zlibCompressionLevel:{default:0,type:"int"},mongodbLogPath:{transform({values:[e]}){if(!(typeof e==="string"&&["stderr","stdout"].includes(e)||e&&typeof e==="object"&&("write"in e)&&typeof e.write==="function"))throw new B.MongoAPIError("Option 'mongodbLogPath' must be of type 'stderr' | 'stdout' | MongoDBLogWritable");return e}},mongodbLogComponentSeverities:{transform({values:[e]}){if(typeof e!=="object"||!e)throw new B.MongoAPIError("Option 'mongodbLogComponentSeverities' must be a non-null object");for(let[t,r]of Object.entries(e)){if(typeof r!=="string"||typeof t!=="string")throw new B.MongoAPIError("User input for option 'mongodbLogComponentSeverities' object cannot include a non-string key or value");if(!Object.values(kl.MongoLoggableComponent).some((n)=>n===t)&&t!=="default")throw new B.MongoAPIError(`User input for option 'mongodbLogComponentSeverities' contains invalid key: ${t}`);if(!Object.values(kl.SeverityLevel).some((n)=>n===r))throw new B.MongoAPIError(`Option 'mongodbLogComponentSeverities' does not support ${r} as a value for ${t}`)}return e}},mongodbLogMaxDocumentLength:{type:"uint"},connectionType:{type:"any"},srvPoller:{type:"any"},allowPartialTrustChain:{type:"any"},minDHSize:{type:"any"},pskCallback:{type:"any"},secureContext:{type:"any"},enableTrace:{type:"any"},requestCert:{type:"any"},rejectUnauthorized:{type:"any"},checkServerIdentity:{type:"any"},keepAliveInitialDelay:{type:"any"},ALPNProtocols:{type:"any"},SNICallback:{type:"any"},session:{type:"any"},requestOCSP:{type:"any"},localAddress:{type:"any"},localPort:{type:"any"},hints:{type:"any"},lookup:{type:"any"},ca:{type:"any"},cert:{type:"any"},ciphers:{type:"any"},crl:{type:"any"},ecdhCurve:{type:"any"},key:{type:"any"},passphrase:{type:"any"},pfx:{type:"any"},secureProtocol:{type:"any"},index:{type:"any"},__skipPingOnConnect:{type:"boolean"}};qN.DEFAULT_OPTIONS=new zh(Object.entries(qN.OPTIONS).filter(([,e])=>e.default!=null).map(([e,t])=>[e,t.default]))});var UN=g(function(LN){Object.defineProperty(LN,"__esModule",{value:!0});LN.aws4Sign=Zhe;var Zu=we(),jN=async(e)=>{let t=y6(e),r=await crypto.subtle.digest("SHA-256",t);return Zu.ByteUtils.toHex(new Uint8Array(r))},Wh=async(e,t)=>{let r;if(typeof e==="string")r=y6(e);else r=e;let n=await crypto.subtle.importKey("raw",r,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),s=y6(t),i=await crypto.subtle.sign("HMAC",n,s);return new Uint8Array(i)},La=(e)=>e.toString().trim().replace(/\s+/g," ");function y6(e){let t=new Uint8Array(Zu.ByteUtils.utf8ByteLength(e));return Zu.ByteUtils.encodeUTF8Into(t,e,0),t}async function Zhe(e,t){let n=e.date.toISOString().replace(/[:-]|\.\d{3}/g,""),s=n.substring(0,8),{method:i,path:o}=e,u="",a=new Headers({"content-length":La(e.headers["Content-Length"]),"content-type":La(e.headers["Content-Type"]),host:La(e.host),"x-amz-date":La(n),"x-mongodb-gs2-cb-flag":La(e.headers["X-MongoDB-GS2-CB-Flag"]),"x-mongodb-server-nonce":La(e.headers["X-MongoDB-Server-Nonce"])});if("sessionToken"in t&&t.sessionToken)a.append("x-amz-security-token",La(t.sessionToken));let c=Array.from(a.entries()).map(([v,P])=>`${v.toLowerCase()}:${P}`).sort().join(`
25
- `),f=Array.from(a.keys()).map((v)=>v.toLowerCase()).sort().join(";"),h=await jN(e.body),d=[i,o,"",c+`
26
- `,f,h].join(`
27
- `),p=await jN(d),m="AWS4-HMAC-SHA256",_=`${s}/${e.region}/${e.service}/aws4_request`,y=[m,n,_,p].join(`
28
- `),E=await Wh("AWS4"+t.secretAccessKey,s),w=await Wh(E,e.region),b=await Wh(w,e.service),A=await Wh(b,"aws4_request"),M=await Wh(A,y),O=Zu.ByteUtils.toHex(M);return{Authorization:["AWS4-HMAC-SHA256 Credential="+t.accessKeyId+"/"+_,"SignedHeaders="+f,"Signature="+O].join(", "),"X-Amz-Date":n}}});var QN=g(function(YN){Object.defineProperty(YN,"__esModule",{value:!0});YN.MongoDBAWS=void 0;var V0=we(),ql=we(),_o=Q(),jl=ae(),VN=Ru(),zN=$E(),WN=UN(),HN=Wp(),KN=uo(),tfe=110,g6={useBigInt64:!1,promoteLongs:!0,promoteValues:!0,promoteBuffers:!1,bsonRegExp:!1};class GN extends VN.AuthProvider{constructor(e){super();this.credentialFetcher=new zN.AWSSDKCredentialProvider(e)}async auth(e){let{connection:t}=e;if(!e.credentials)throw new _o.MongoMissingCredentialsError("AuthContext must provide credentials.");e.credentials=await rfe(e.credentials,this.credentialFetcher);let{credentials:r}=e,{username:n,password:s}=r,i=r.mechanismProperties.AWS_SESSION_TOKEN,o=i?{accessKeyId:n,secretAccessKey:s,sessionToken:i}:{accessKeyId:n,secretAccessKey:s},u=r.source,a=await jl.randomBytes(32),c={saslStart:1,mechanism:"MONGODB-AWS",payload:ql.serialize({r:a,p:tfe},g6)},l=await t.command(jl.ns(`${u}.$cmd`),c,void 0),f=ql.deserialize(l.payload.buffer,g6),h=f.h,d=f.s.buffer;if(d.length!==64)throw new _o.MongoRuntimeError(`Invalid server nonce length ${d.length}, expected 64`);if(!V0.ByteUtils.equals(d.subarray(0,a.byteLength),a))throw new _o.MongoRuntimeError("Server nonce does not begin with client nonce");if(h.length<1||h.length>255||h.indexOf("..")!==-1)throw new _o.MongoRuntimeError(`Server returned an invalid host: "${h}"`);let p="Action=GetCallerIdentity&Version=2011-06-15",m=await WN.aws4Sign({method:"POST",host:h,region:nfe(f.h),service:"sts",headers:{"Content-Type":"application/x-www-form-urlencoded","Content-Length":p.length,"X-MongoDB-Server-Nonce":V0.ByteUtils.toBase64(d),"X-MongoDB-GS2-CB-Flag":"n"},path:"/",body:p,date:new Date},o),_={a:m.Authorization,d:m["X-Amz-Date"]};if(i)_.t=i;let y={saslContinue:1,conversationId:l.conversationId,payload:ql.serialize(_,g6)};await t.command(jl.ns(`${u}.$cmd`),y,void 0)}}YN.MongoDBAWS=GN;async function rfe(e,t){function r(s){if(!s.AccessKeyId||!s.SecretAccessKey)throw new _o.MongoMissingCredentialsError("Could not obtain temporary MONGODB-AWS credentials");return new HN.MongoCredentials({username:s.AccessKeyId,password:s.SecretAccessKey,source:e.source,mechanism:KN.AuthMechanism.MONGODB_AWS,mechanismProperties:{AWS_SESSION_TOKEN:s.Token}})}let n=await t.getCredentials();return r(n)}function nfe(e){let t=e.split(".");if(t.length===1||t[1]==="amazonaws")return"us-east-1";return t[1]}});var ZN=g(function(XN){Object.defineProperty(XN,"__esModule",{value:!0});XN.finishCommandDocument=sfe;XN.startCommandDocument=ife;var di=we(),z0=uo();function sfe(e,t){if(t!=null)return{saslContinue:1,conversationId:t,payload:new di.Binary(di.BSON.serialize({jwt:e}))};return{saslStart:1,mechanism:z0.AuthMechanism.MONGODB_OIDC,payload:new di.Binary(di.BSON.serialize({jwt:e}))}}function ife(e){let t={};if(e.username)t.n=e.username;return{saslStart:1,autoAuthorize:1,mechanism:z0.AuthMechanism.MONGODB_OIDC,payload:new di.Binary(di.BSON.serialize(t))}}});var E6=g(function(nI){Object.defineProperty(nI,"__esModule",{value:!0});nI.CallbackWorkflow=nI.AUTOMATED_TIMEOUT_MS=nI.HUMAN_TIMEOUT_MS=void 0;var eI=G("timers/promises"),tI=Q(),W0=ae(),Ll=ZN();nI.HUMAN_TIMEOUT_MS=300000;nI.AUTOMATED_TIMEOUT_MS=60000;var afe=["accessToken","expiresInSeconds","refreshToken"],cfe="User provided OIDC callbacks must return a valid object with an accessToken.",_6=100;class rI{constructor(e,t){this.cache=e,this.callback=this.withLock(t),this.lastExecutionTime=Date.now()-_6}async speculativeAuth(e,t){if(this.cache.hasAccessToken){let r=this.cache.getAccessToken();e.accessToken=r;let n=Ll.finishCommandDocument(r);return n.db=t.source,{speculativeAuthenticate:n}}return{}}async reauthenticate(e,t){if(this.cache.hasAccessToken)if(e.accessToken===this.cache.getAccessToken())this.cache.removeAccessToken(),delete e.accessToken;else e.accessToken=this.cache.getAccessToken();await this.execute(e,t)}async startAuthentication(e,t,r){let n;if(r?.speculativeAuthenticate)n=r.speculativeAuthenticate;else n=await e.command(W0.ns(t.source),Ll.startCommandDocument(t),void 0);return n}async finishAuthentication(e,t,r,n){await e.command(W0.ns(t.source),Ll.finishCommandDocument(r,n),void 0)}async executeAndValidateCallback(e){let t=await this.callback(e);if(lfe(t))throw new tI.MongoMissingCredentialsError(cfe);return t}withLock(e){let t=Promise.resolve();return async(r)=>{let n=t.then(async()=>{let s=Date.now()-this.lastExecutionTime;if(s<=_6)await eI.setTimeout(_6-s,{signal:r.timeoutContext});return this.lastExecutionTime=Date.now(),await e(r)});return t=n.then(()=>{return},()=>{return}),await n}}}nI.CallbackWorkflow=rI;function lfe(e){if(e==null||typeof e!=="object")return!0;if(!("accessToken"in e))return!0;return!Object.getOwnPropertyNames(e).every((t)=>afe.includes(t))}});var A6=g(function(uI){Object.defineProperty(uI,"__esModule",{value:!0});uI.AutomatedCallbackWorkflow=void 0;var Ul=Q(),H0=Gn(),iI=K0(),Vl=E6();class oI extends Vl.CallbackWorkflow{constructor(e,t){super(e,t)}async execute(e,t){if(this.cache.hasAccessToken){let n=this.cache.getAccessToken();if(!e.accessToken)e.accessToken=n;try{return await this.finishAuthentication(e,t,n)}catch(s){if(s instanceof Ul.MongoError&&s.code===Ul.MONGODB_ERROR_CODES.AuthenticationFailed)return this.cache.removeAccessToken(),await this.execute(e,t);else throw s}}let r=await this.fetchAccessToken(t);this.cache.put(r),e.accessToken=r.accessToken,await this.finishAuthentication(e,t,r.accessToken)}async fetchAccessToken(e){let t=new AbortController,r={timeoutContext:t.signal,version:iI.OIDC_VERSION};if(e.username)r.username=e.username;if(e.mechanismProperties.TOKEN_RESOURCE)r.tokenAudience=e.mechanismProperties.TOKEN_RESOURCE;let n=H0.Timeout.expires(Vl.AUTOMATED_TIMEOUT_MS);try{return await Promise.race([this.executeAndValidateCallback(r),n])}catch(s){if(H0.TimeoutError.is(s))throw t.abort(),new Ul.MongoOIDCError(`OIDC callback timed out after ${Vl.AUTOMATED_TIMEOUT_MS}ms.`);throw s}finally{n.clear()}}}uI.AutomatedCallbackWorkflow=oI});var fI=g(function(lI){Object.defineProperty(lI,"__esModule",{value:!0});lI.azureCallback=void 0;var G0=qE(),zl=Q(),cI=ae(),dfe=Object.freeze({Metadata:"true",Accept:"application/json"}),pfe="Azure endpoint did not return a value with only access_token and expires_in properties",mfe="TOKEN_RESOURCE must be set in the auth mechanism properties when ENVIRONMENT is azure.",yfe=async(e)=>{let{tokenAudience:t,username:r}=e;if(!t)throw new zl.MongoAzureError(mfe);let n=await gfe(t,r);if(!_fe(n))throw new zl.MongoAzureError(pfe);return n};lI.azureCallback=yfe;async function gfe(e,t){let r=new URL(G0.AZURE_BASE_URL);G0.addAzureParams(r,e,t);let n=await cI.get(r,{headers:dfe});if(n.status!==200)throw new zl.MongoAzureError(`Status code ${n.status} returned from the Azure endpoint. Response body: ${n.body}`);let s=JSON.parse(n.body);return{accessToken:s.access_token,expiresInSeconds:Number(s.expires_in)}}function _fe(e){if(e==null||typeof e!=="object")return!1;return"accessToken"in e&&typeof e.accessToken==="string"&&"expiresInSeconds"in e&&typeof e.expiresInSeconds==="number"}});var yI=g(function(pI){Object.defineProperty(pI,"__esModule",{value:!0});pI.gcpCallback=void 0;var Y0=Q(),dI=ae(),Efe="http://metadata/computeMetadata/v1/instance/service-accounts/default/identity",Afe=Object.freeze({"Metadata-Flavor":"Google"}),Ofe="TOKEN_RESOURCE must be set in the auth mechanism properties when ENVIRONMENT is gcp.",Sfe=async(e)=>{let t=e.tokenAudience;if(!t)throw new Y0.MongoGCPError(Ofe);return await wfe(t)};pI.gcpCallback=Sfe;async function wfe(e){let t=new URL(Efe);t.searchParams.append("audience",e);let r=await dI.get(t,{headers:Afe});if(r.status!==200)throw new Y0.MongoGCPError(`Status code ${r.status} returned from the GCP endpoint. Response body: ${r.body}`);return{accessToken:r.body}}});var SI=g(function(AI){Object.defineProperty(AI,"__esModule",{value:!0});AI.k8sCallback=void 0;var EI=G("fs/promises"),ea=G("process"),Cfe="/var/run/secrets/kubernetes.io/serviceaccount/token",gI="AZURE_FEDERATED_TOKEN_FILE",_I="AWS_WEB_IDENTITY_TOKEN_FILE",bfe=async()=>{let e;if(ea.env[gI])e=ea.env[gI];else if(ea.env[_I])e=ea.env[_I];else e=Cfe;return{accessToken:await EI.readFile(e,"utf8")}};AI.k8sCallback=bfe});var O6=g(function(bI){Object.defineProperty(bI,"__esModule",{value:!0});bI.TokenCache=void 0;var wI=Q();class J0 extends wI.MongoDriverError{}class CI{get hasAccessToken(){return!!this.accessToken}get hasRefreshToken(){return!!this.refreshToken}get hasIdpInfo(){return!!this.idpInfo}getAccessToken(){if(!this.accessToken)throw new J0("Attempted to get an access token when none exists.");return this.accessToken}getRefreshToken(){if(!this.refreshToken)throw new J0("Attempted to get a refresh token when none exists.");return this.refreshToken}getIdpInfo(){if(!this.idpInfo)throw new J0("Attempted to get IDP information when none exists.");return this.idpInfo}put(e,t){if(this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expiresInSeconds=e.expiresInSeconds,t)this.idpInfo=t}removeAccessToken(){this.accessToken=void 0}removeRefreshToken(){this.refreshToken=void 0}}bI.TokenCache=CI});var FI=g(function(PI){Object.defineProperty(PI,"__esModule",{value:!0});PI.tokenMachineCallback=void 0;var TI=G("fs"),MI=G("process"),xI=Q(),Dfe="OIDC_TOKEN_FILE must be set in the environment.",Tfe=async()=>{let e=MI.env.OIDC_TOKEN_FILE;if(!e)throw new xI.MongoAWSError(Dfe);return{accessToken:await TI.promises.readFile(e,"utf8")}};PI.tokenMachineCallback=Tfe});var K0=g(function(jI){Object.defineProperty(jI,"__esModule",{value:!0});jI.MongoDBOIDC=jI.OIDC_WORKFLOWS=jI.OIDC_VERSION=void 0;var Q0=Q(),II=Ru(),ta=A6(),RI=fI(),$I=yI(),vI=SI(),ra=O6(),kI=FI(),Mfe="AuthContext must provide credentials.";jI.OIDC_VERSION=1;jI.OIDC_WORKFLOWS=new Map;jI.OIDC_WORKFLOWS.set("test",()=>new ta.AutomatedCallbackWorkflow(new ra.TokenCache,kI.tokenMachineCallback));jI.OIDC_WORKFLOWS.set("azure",()=>new ta.AutomatedCallbackWorkflow(new ra.TokenCache,RI.azureCallback));jI.OIDC_WORKFLOWS.set("gcp",()=>new ta.AutomatedCallbackWorkflow(new ra.TokenCache,$I.gcpCallback));jI.OIDC_WORKFLOWS.set("k8s",()=>new ta.AutomatedCallbackWorkflow(new ra.TokenCache,vI.k8sCallback));class qI extends II.AuthProvider{constructor(e){super();if(!e)throw new Q0.MongoInvalidArgumentError("No workflow provided to the OIDC auth provider.");this.workflow=e}async auth(e){let{connection:t,reauthenticating:r,response:n}=e;if(n?.speculativeAuthenticate?.done&&!r)return;let s=NI(e);if(r)await this.workflow.reauthenticate(t,s);else await this.workflow.execute(t,s,n)}async prepare(e,t){let{connection:r}=t,n=NI(t),s=await this.workflow.speculativeAuth(r,n);return{...e,...s}}}jI.MongoDBOIDC=qI;function NI(e){let{credentials:t}=e;if(!t)throw new Q0.MongoMissingCredentialsError(Mfe);return t}});var KI=g(function(WI){Object.defineProperty(WI,"__esModule",{value:!0});WI.HumanCallbackWorkflow=void 0;var UI=we(),Eo=Q(),X0=Gn(),VI=K0(),Wl=E6();class zI extends Wl.CallbackWorkflow{constructor(e,t){super(e,t)}async execute(e,t){if(this.cache.hasAccessToken){let o=this.cache.getAccessToken();e.accessToken=o;try{return await this.finishAuthentication(e,t,o)}catch(u){if(u instanceof Eo.MongoError&&u.code===Eo.MONGODB_ERROR_CODES.AuthenticationFailed)return this.cache.removeAccessToken(),delete e.accessToken,await this.execute(e,t);else throw u}}if(this.cache.hasRefreshToken){let o=this.cache.getRefreshToken(),u=await this.fetchAccessToken(this.cache.getIdpInfo(),t,o);this.cache.put(u),e.accessToken=u.accessToken;try{return await this.finishAuthentication(e,t,u.accessToken)}catch(a){if(a instanceof Eo.MongoError&&a.code===Eo.MONGODB_ERROR_CODES.AuthenticationFailed)return this.cache.removeRefreshToken(),delete e.accessToken,await this.execute(e,t);else throw a}}let r=await this.startAuthentication(e,t),n=r.conversationId,s=UI.BSON.deserialize(r.payload.buffer),i=await this.fetchAccessToken(s,t);return this.cache.put(i,s),e.accessToken=i.accessToken,await this.finishAuthentication(e,t,i.accessToken,n)}async fetchAccessToken(e,t,r){let n=new AbortController,s={timeoutContext:n.signal,version:VI.OIDC_VERSION,idpInfo:e};if(t.username)s.username=t.username;if(r)s.refreshToken=r;let i=X0.Timeout.expires(Wl.HUMAN_TIMEOUT_MS);try{return await Promise.race([this.executeAndValidateCallback(s),i])}catch(o){if(X0.TimeoutError.is(o))throw n.abort(),new Eo.MongoOIDCError(`OIDC callback timed out after ${Wl.HUMAN_TIMEOUT_MS}ms.`);throw o}finally{i.clear()}}}WI.HumanCallbackWorkflow=zI});var eR=g(function(XI){Object.defineProperty(XI,"__esModule",{value:!0});XI.Plain=void 0;var Z0=we(),GI=Q(),YI=ae(),JI=Ru();class QI extends JI.AuthProvider{async auth(e){let{connection:t,credentials:r}=e;if(!r)throw new GI.MongoMissingCredentialsError("AuthContext must provide credentials.");let{username:n,password:s}=r,o={saslStart:1,mechanism:"PLAIN",payload:new Z0.Binary(Z0.ByteUtils.fromUTF8(`\x00${n}\x00${s}`)),autoAuthorize:1};await t.command(YI.ns("$external.$cmd"),o,void 0)}}XI.Plain=QI});var sR=g(function(n7e,nR){var tR=(e)=>e.codePointAt(0),Pfe=(e)=>e[0],Bfe=(e)=>e[e.length-1];function rR(e){let t=[],r=e.length;for(let n=0;n<r;n+=1){let s=e.charCodeAt(n);if(s>=55296&&s<=56319&&r>n+1){let i=e.charCodeAt(n+1);if(i>=56320&&i<=57343){t.push((s-55296)*1024+i-56320+65536),n+=1;continue}}t.push(s)}return t}function Kh({unassigned_code_points:e,commonly_mapped_to_nothing:t,non_ASCII_space_characters:r,prohibited_characters:n,bidirectional_r_al:s,bidirectional_l:i},o,u={}){let a=r,c=t;if(typeof o!=="string")throw TypeError("Expected string.");if(o.length===0)return"";let l=rR(o).map((E)=>a.get(E)?32:E).filter((E)=>!c.get(E)),f=String.fromCodePoint.apply(null,l).normalize("NFKC"),h=rR(f);if(h.some((E)=>n.get(E)))throw Error("Prohibited character, see https://tools.ietf.org/html/rfc4013#section-2.3");if(u.allowUnassigned!==!0){if(h.some((w)=>e.get(w)))throw Error("Unassigned code point, see https://tools.ietf.org/html/rfc4013#section-2.5")}let p=h.some((E)=>s.get(E)),m=h.some((E)=>i.get(E));if(p&&m)throw Error("String must not contain RandALCat and LCat at the same time, see https://tools.ietf.org/html/rfc3454#section-6");let _=s.get(tR(Pfe(f))),y=s.get(tR(Bfe(f)));if(p&&!(_&&y))throw Error("Bidirectional RandALCat character must be the first and the last character of the string, see https://tools.ietf.org/html/rfc3454#section-6");return f}Kh.saslprep=Kh;Kh.default=Kh;nR.exports=Kh});var uR=g(function(s7e,oR){oR.exports=Ko;function Ko(e,t){if(!(this instanceof Ko))return new Ko(e,t);this.length=0,this.updates=[],this.path=new Uint16Array(4),this.pages=Array(32768),this.maxPages=this.pages.length,this.level=0,this.pageSize=e||1024,this.deduplicate=t?t.deduplicate:null,this.zeros=this.deduplicate?em(this.deduplicate.length):null}Ko.prototype.updated=function(e){while(this.deduplicate&&e.buffer[e.deduplicate]===this.deduplicate[e.deduplicate])if(e.deduplicate++,e.deduplicate===this.deduplicate.length){if(e.deduplicate=0,e.buffer.equals&&e.buffer.equals(this.deduplicate))e.buffer=this.deduplicate;break}if(e.updated||!this.updates)return;e.updated=!0,this.updates.push(e)};Ko.prototype.lastUpdate=function(){if(!this.updates||!this.updates.length)return null;var e=this.updates.pop();return e.updated=!1,e};Ko.prototype._array=function(e,t){if(e>=this.maxPages){if(t)return;Ffe(this,e)}Rfe(e,this.path);var r=this.pages;for(var n=this.level;n>0;n--){var s=this.path[n],i=r[s];if(!i){if(t)return;i=r[s]=Array(32768)}r=i}return r};Ko.prototype.get=function(e,t){var r=this._array(e,t),n=this.path[0],s=r&&r[n];if(!s&&!t){if(s=r[n]=new iR(e,em(this.pageSize)),e>=this.length)this.length=e+1}if(s&&s.buffer===this.deduplicate&&this.deduplicate&&!t)s.buffer=Ife(s.buffer),s.deduplicate=0;return s};Ko.prototype.set=function(e,t){var r=this._array(e,!1),n=this.path[0];if(e>=this.length)this.length=e+1;if(!t||this.zeros&&t.equals&&t.equals(this.zeros)){r[n]=void 0;return}if(this.deduplicate&&t.equals&&t.equals(this.deduplicate))t=this.deduplicate;var s=r[n],i=Nfe(t,this.pageSize);if(s)s.buffer=i;else r[n]=new iR(e,i)};Ko.prototype.toBuffer=function(){var e=Array(this.length),t=em(this.pageSize),r=0;while(r<e.length){var n=this._array(r,!0);for(var s=0;s<32768&&r<e.length;s++)e[r++]=n&&n[s]?n[s].buffer:t}return Buffer.concat(e)};function Ffe(e,t){while(e.maxPages<t){var r=e.pages;e.pages=Array(32768),e.pages[0]=r,e.level++,e.maxPages*=32768}}function Nfe(e,t){if(e.length===t)return e;if(e.length>t)return e.slice(0,t);var r=em(t);return e.copy(r),r}function em(e){if(Buffer.alloc)return Buffer.alloc(e);var t=new Buffer(e);return t.fill(0),t}function Ife(e){var t=Buffer.allocUnsafe?Buffer.allocUnsafe(e.length):new Buffer(e.length);return e.copy(t),t}function iR(e,t){this.offset=e*t.length,this.buffer=t,this.updated=!1,this.deduplicate=0}function Rfe(e,t){e=(e-(t[0]=e&32767))/32768,e=(e-(t[1]=e&32767))/32768,t[3]=(e-(t[2]=e&32767))/32768&32767}});var cR=g(function(i7e,aR){var $fe=uR();aR.exports=na;function na(e){if(!(this instanceof na))return new na(e);if(!e)e={};if(Buffer.isBuffer(e))e={buffer:e};if(this.pageOffset=e.pageOffset||0,this.pageSize=e.pageSize||1024,this.pages=e.pages||$fe(this.pageSize),this.byteLength=this.pages.length*this.pageSize,this.length=8*this.byteLength,!kfe(this.pageSize))throw Error("The page size should be a power of two");if(this._trackUpdates=!!e.trackUpdates,this._pageMask=this.pageSize-1,e.buffer){for(var t=0;t<e.buffer.length;t+=this.pageSize)this.pages.set(t/this.pageSize,e.buffer.slice(t,t+this.pageSize));this.byteLength=e.buffer.length,this.length=8*this.byteLength}}na.prototype.get=function(e){var t=e&7,r=(e-t)/8;return!!(this.getByte(r)&128>>t)};na.prototype.getByte=function(e){var t=e&this._pageMask,r=(e-t)/this.pageSize,n=this.pages.get(r,!0);return n?n.buffer[t+this.pageOffset]:0};na.prototype.set=function(e,t){var r=e&7,n=(e-r)/8,s=this.getByte(n);return this.setByte(n,t?s|128>>r:s&(255^128>>r))};na.prototype.toBuffer=function(){var e=vfe(this.pages.length*this.pageSize);for(var t=0;t<this.pages.length;t++){var r=this.pages.get(t,!0),n=t*this.pageSize;if(r)r.buffer.copy(e,n,this.pageOffset,this.pageOffset+this.pageSize)}return e};na.prototype.setByte=function(e,t){var r=e&this._pageMask,n=(e-r)/this.pageSize,s=this.pages.get(n,!1);if(r+=this.pageOffset,s.buffer[r]===t)return!1;if(s.buffer[r]=t,e>=this.byteLength)this.byteLength=e+1,this.length=this.byteLength*8;if(this._trackUpdates)this.pages.updated(s);return!0};function vfe(e){if(Buffer.alloc)return Buffer.alloc(e);var t=new Buffer(e);return t.fill(0),t}function kfe(e){return!(e&e-1)}});var lR=g(function(Gh){var qfe=Gh&&Gh.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Gh,"__esModule",{value:!0});Gh.createMemoryCodePoints=Lfe;var jfe=qfe(cR());function Lfe(e){let t=0;function r(){let c=e.readUInt32BE(t);t+=4;let l=e.slice(t,t+c);return t+=c,(0,jfe.default)({buffer:l})}let n=r(),s=r(),i=r(),o=r(),u=r(),a=r();return{unassigned_code_points:n,commonly_mapped_to_nothing:s,non_ASCII_space_characters:i,prohibited_characters:o,bidirectional_r_al:u,bidirectional_l:a}}});var dR=g(function(fR){Object.defineProperty(fR,"__esModule",{value:!0});var hR=G("zlib");fR.default=hR.gunzipSync(Buffer.from("H4sIAAAAAAACA+3dTYgcaRkA4LemO9Mhxm0FITnE9Cwr4jHgwgZ22B6YywqCJ0HQg5CL4sGTuOjCtGSF4CkHEW856MlTQHD3EJnWkU0Owh5VxE3LHlYQdNxd2U6mU59UV/d09fw4M2EySSXPAzNdP1/9fX/99bzVNZEN4jisRDulVFnQmLxm1aXF9Id/2/xMxNJ4XZlg576yuYlGt9gupV6xoFf8jhu9YvulVrFlp5XSx+lfvYhORGPXvqIRWSxERKtIm8bKFd10WNfKDS5Fo9jJWrq2+M2IlW+8uHgl/+BsROfPF4v5L7148Ur68Sha6dqZpYiVVy8tvLCWXo80Sf/lS89dGX2wHGvpzoXVn75/YWH5wmqe8uika82ViJXTy83Ve2k5Urozm38wm4/ls6t5uT6yfsTSJ7J3T0VKt8c5ExEXI8aFkH729c3eT+7EC6ca8cVULZUiYacX0R5PNWNxlh9L1y90q5kyzrpyy+9WcvOV6URntqw7La9sNVstXyczWVaWYbaaTYqzOHpr7pyiNT3/YzKuT63Z/FqKZlFTiuXtFM2vVOtIq7jiyKJbWZaOWD0euz0yoV2Z7kY0xq2x0YhfzVpmM5px9nTEH7JZ0ot5u39p0ma75Z472/s/H+2yr2inYyuq7fMvJivH2rM72N/Z3lyL31F2b1ya1P0zn816k2KP6JU9UzseucdQH5YqVeH/lFajSN2udg+TLJ9rksNxlvV2lki19rXKI43TPLejFu4ov7k3nMbhyhfY3Xb37f8BAGCf0eMTOH5szf154KmnNgKcnLb+Fzi2AfXktbN7fJelwTAiO/W5uQ2KINXRYu+znqo/WTAdLadURHmy3qciazd3bra4T3w16/f7t7Ms9U5gfJu10955sx1r3vmhBAAAAAAAgId20J1iZbDowNvIjuH427Gr5l/eiC+8OplZON8sVjx/qr9y+Pj+YRItT+NqAM+kkZs3AAAAAID6yfx1FwCAI97/dCh1/ub6SA0AAAAAAAAAgNoT/wcAAAAAAACA+hP/BwAAAAAAAID6E/8HAAAAAAAAgPoT/wcAAAAAAACA+hP/BwAAAAAAAID6E/8HAAAAAAAAgPoT/wcAAAAAAACA+hP/BwAAAAAAAID6E/8HAAAAAAAAgPoT/wcAAAAAAACA+hutp5SiQpYAAAAAAAAAQO2MIpZiT804flnAE2fhwjOeAZXr76kOAAAAAAAA8FjNf4N/l0NE3U/vuVQskLpSd4/Yh2xu9xTu0tFeeNYsLI2f/VMdNxTzj6Je9E/+6pp6Nn3awW3A54goe4Bss6v+PGsjQGMAAAAAAOBp5XEgwH6e7J7rwEQHRb/XvAMAAAAAAAA8yzoDeQDwVGjIAgAAAAAAAACoPfF/AAAAAAAAAKg/8X8AAAAAAAAAqD/xfwAAAAAAAACoP/F/AAAAAAAAAKg/8X8AAAAAAAAAqD/xfwAAAAAAAACoP/F/AAAAAAAAAKg/8X8AAAAAAAAAqD/xfwAAAAAAAACoP/F/AAAAAAAAAKg/8X8AAAAAAAAAqL/GSkSkClkCAAAAAAAAALXTSAAAAAAAAABA3Y1kAQAAAAAAAADUX8RSXZ9dsHC9+M8Fg2Ex/em1lAZpEBGttcrVjZqLEa+k0XpKw9mG4zWx4ukPUMhkAQAAAAAAABzBqbSe3//rXOS9HxGdo4TqR2XkutCdBu+LaPZw/lBbO7cbHnh2C7N7AIo4evEznllqLqWUp/LnYOtpM2bnOH66wI1+9GO4sOuISwv/TOlumu56FDv3NZhc4mR9v7zYIrafr40j/Cccvj9Xns3t3mu99E7qxUv3bqS0/ouNH/08++RGemfQ+nsx/5uNXsQPGulynPvv3ZTW37zd+1ovrqaYpP/122X6Xpx779Z3zr/3YOPKW1lkaRDf31pPaf3j/msRsVGkL+d/f+/m4sJsPm1cfSsr16e8m9Ldj/KsnyIuR3nXw83Is3EhxLd/2V773ks3m/cj/THKUummdP9qKhIOImuOU0Xjwb3y+oqt735rpTetVbF9n8R4x9crRfO77TKqVOZpDclv5bfK18lMnk+q0K18UpxF/RrGXE0Zxtqx3tWSj+vxbL4XaasfKb0dRbtLW73JsfPGg177H+OmGKlfvS1msllt7JEJm9XOJqXR+Fkfo1H66uy5H1v3Xx5+uJmGLw9jro2u7Loj4PnuR6+f+e3d261+eazNhzrL7X83MohoHpS4PddV8ki1it61//pw1g7z6p1U/26Nm2llST57B5rUvuG0XqSU/rPd7jYrqWcbd+beJQ77BgPMDwn37/8BAGCf0eMTOH4cPlufv9VGgJOzqf8Fjm1APXkd7B7f5dF57GPMaWy/MTvjvNvtXj6h8W2+GXvnzXaseeeHEgAAAAAAAB7aQXeKlcGiadBoEOeLb2dtpGOL2MyOtf391a3P/zD96c3JzIP3t4oV797vrh8+vn+YRL5bBuj/AQAAAABqJvfHXQAAHkX82zfXAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACeAgkAAAAAAAAAqLuRLAAAAAAAAACA2hv9D1iu/VAYaAYA","base64"))});var gR=g(function(S6,yR){var pR=S6&&S6.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Vfe=pR(sR()),mR=lR(),zfe=pR(dR()),Wfe=mR.createMemoryCodePoints(zfe.default);function Yh(e,t){return(0,Vfe.default)(Wfe,e,t)}Yh.saslprep=Yh;Yh.default=Yh;yR.exports=Yh});var xR=g(function(TR){Object.defineProperty(TR,"__esModule",{value:!0});TR.ScramSHA256=TR.ScramSHA1=void 0;var ER=gR(),Fe=we(),Xt=Q(),sa=ae(),AR=Ru(),nm=uo();class C6 extends AR.AuthProvider{constructor(e){super();this.cryptoMethod=e||"sha1"}async prepare(e,t){let r=this.cryptoMethod,n=t.credentials;if(!n)throw new Xt.MongoMissingCredentialsError("AuthContext must provide credentials.");let s=await sa.randomBytes(24);return t.nonce=s,{...e,speculativeAuthenticate:{...wR(r,n,s),db:n.source}}}async auth(e){let{reauthenticating:t,response:r}=e;if(r?.speculativeAuthenticate&&!t)return await CR(this.cryptoMethod,r.speculativeAuthenticate,e);return await Hfe(this.cryptoMethod,e)}}function OR(e){return e.replace("=","=3D").replace(",","=2C")}function SR(e,t){return Fe.ByteUtils.concat([Fe.ByteUtils.fromUTF8("n="),Fe.ByteUtils.fromUTF8(e),Fe.ByteUtils.fromUTF8(",r="),Fe.ByteUtils.fromUTF8(Fe.ByteUtils.toBase64(t))])}function wR(e,t,r){let n=OR(t.username);return{saslStart:1,mechanism:e==="sha1"?nm.AuthMechanism.MONGODB_SCRAM_SHA1:nm.AuthMechanism.MONGODB_SCRAM_SHA256,payload:new Fe.Binary(Fe.ByteUtils.concat([Fe.ByteUtils.fromUTF8("n,,"),SR(n,r)])),autoAuthorize:1,options:{skipEmptyExchange:!0}}}async function Hfe(e,t){let{connection:r,credentials:n}=t;if(!n)throw new Xt.MongoMissingCredentialsError("AuthContext must provide credentials.");if(!t.nonce)throw new Xt.MongoInvalidArgumentError("AuthContext must contain a valid nonce property");let s=t.nonce,i=n.source,o=wR(e,n,s),u=await r.command(sa.ns(`${i}.$cmd`),o,void 0);await CR(e,u,t)}async function CR(e,t,r){let{connection:n,credentials:s}=r;if(!s)throw new Xt.MongoMissingCredentialsError("AuthContext must provide credentials.");if(!r.nonce)throw new Xt.MongoInvalidArgumentError("Unable to continue SCRAM without valid nonce");let i=r.nonce,o=s.source,u=OR(s.username),a=s.password,c=e==="sha256"?ER.saslprep(a):Kfe(u,a),l=Fe.ByteUtils.isUint8Array(t.payload)?new Fe.Binary(t.payload):t.payload,f=_R(l),h=parseInt(f.i,10);if(h&&h<4096)throw new Xt.MongoRuntimeError(`Server returned an invalid iteration count ${h}`);let{s:d,r:p}=f;if(p.startsWith("nonce"))throw new Xt.MongoRuntimeError(`Server returned an invalid nonce: ${p}`);let m=`c=biws,r=${p}`,_=await Xfe(c,Fe.ByteUtils.fromBase64(d),h,e),y=await tm(e,_,"Client Key"),E=await tm(e,_,"Server Key"),w=await Yfe(e,y),b=SR(u,i),A=Fe.ByteUtils.toUTF8(b,0,b.length,!1),M=Fe.ByteUtils.toUTF8(l.buffer,0,l.position,!1),O=[A,M,m].join(","),x=await tm(e,w,O),v=`p=${Gfe(y,x)}`,P=[m,v].join(","),ge=await tm(e,E,O),Me={saslContinue:1,conversationId:t.conversationId,payload:new Fe.Binary(Fe.ByteUtils.fromUTF8(P))},oe=await n.command(sa.ns(`${o}.$cmd`),Me,void 0),Yt=_R(oe.payload);if(!Zfe(Fe.ByteUtils.fromBase64(Yt.v),ge))throw new Xt.MongoRuntimeError("Server returned an invalid signature");if(oe.done!==!1)return;let H={saslContinue:1,conversationId:oe.conversationId,payload:Fe.ByteUtils.allocate(0)};await n.command(sa.ns(`${o}.$cmd`),H,void 0)}function _R(e){let t=Fe.ByteUtils.toUTF8(e.buffer,0,e.position,!1),r={},n=t.split(",");for(let s=0;s<n.length;s++){let i=(n[s].match(/^([^=]*)=(.*)$/)??[]).slice(1);r[i[0]]=i[1]}return r}function Kfe(e,t){if(typeof e!=="string")throw new Xt.MongoInvalidArgumentError("Username must be a string");if(typeof t!=="string")throw new Xt.MongoInvalidArgumentError("Password must be a string");if(t.length===0)throw new Xt.MongoInvalidArgumentError("Password cannot be empty");let r;try{r=G("crypto")}catch(n){throw new Xt.MongoRuntimeError("Node.js crypto module is required for SCRAM-SHA-1 authentication",{cause:n})}try{let n=r.createHash("md5");return n.update(`${e}:mongo:${t}`,"utf8"),n.digest("hex")}catch(n){if(r.getFips())throw Error("Auth mechanism SCRAM-SHA-1 is not supported in FIPS mode");throw n}}function Gfe(e,t){let r=Math.max(e.length,t.length),n=[];for(let s=0;s<r;s+=1)n.push(e[s]^t[s]);return Fe.ByteUtils.toBase64(Fe.ByteUtils.fromNumberArray(n))}async function Yfe(e,t){let r=await crypto.subtle.digest(e==="sha256"?"SHA-256":"SHA-1",t);return new Uint8Array(r)}async function tm(e,t,r){let n=Fe.ByteUtils.toLocalBufferType(t),s=await crypto.subtle.importKey("raw",n,{name:"HMAC",hash:{name:e==="sha256"?"SHA-256":"SHA-1"}},!1,["sign","verify"]),i=typeof r==="string"?new TextEncoder().encode(r):r,o=Fe.ByteUtils.toLocalBufferType(i),u=await crypto.subtle.sign("HMAC",s,o);return new Uint8Array(u)}var rm={},w6=0;function Jfe(){rm={},w6=0}var Qfe={sha256:32,sha1:20};async function Xfe(e,t,r,n){let s=[e,Fe.ByteUtils.toBase64(t),r].join("_");if(rm[s]!=null)return rm[s];let i=await crypto.subtle.importKey("raw",new TextEncoder().encode(e),{name:"PBKDF2"},!1,["deriveBits"]),o={name:"PBKDF2",salt:t,iterations:r,hash:{name:n==="sha256"?"SHA-256":"SHA-1"}},u=await crypto.subtle.deriveBits(o,i,Qfe[n]*8),a=new Uint8Array(u);if(w6>=200)Jfe();return rm[s]=a,w6+=1,a}function Zfe(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return r===0}class bR extends C6{constructor(){super("sha1")}}TR.ScramSHA1=bR;class DR extends C6{constructor(){super("sha256")}}TR.ScramSHA256=DR});var $R=g(function(IR){Object.defineProperty(IR,"__esModule",{value:!0});IR.X509=void 0;var sm=Q(),BR=ae(),FR=Ru();class NR extends FR.AuthProvider{async prepare(e,t){let{credentials:r}=t;if(!r)throw new sm.MongoMissingCredentialsError("AuthContext must provide credentials.");return{...e,speculativeAuthenticate:PR(r)}}async auth(e){let{connection:t,credentials:r}=e;if(!r)throw new sm.MongoMissingCredentialsError("AuthContext must provide credentials.");if(e.response?.speculativeAuthenticate)return;await t.command(BR.ns("$external.$cmd"),PR(r),void 0)}}IR.X509=NR;function PR(e){let t={authenticate:1,mechanism:"MONGODB-X509"};if(e.username)t.user=e.username;return t}});var b6=g(function(zR){Object.defineProperty(zR,"__esModule",{value:!0});zR.MongoClientAuthProviders=void 0;var vR=Vp(),kR=QN(),um=K0(),qR=A6(),jR=KI(),im=O6(),LR=eR(),gs=uo(),om=xR(),UR=$R(),am=Q(),tde=new Map([[gs.AuthMechanism.MONGODB_AWS,({AWS_CREDENTIAL_PROVIDER:e})=>new kR.MongoDBAWS(e)],[gs.AuthMechanism.MONGODB_GSSAPI,()=>new vR.GSSAPI],[gs.AuthMechanism.MONGODB_OIDC,(e)=>new um.MongoDBOIDC(rde(e))],[gs.AuthMechanism.MONGODB_PLAIN,()=>new LR.Plain],[gs.AuthMechanism.MONGODB_SCRAM_SHA1,()=>new om.ScramSHA1],[gs.AuthMechanism.MONGODB_SCRAM_SHA256,()=>new om.ScramSHA256],[gs.AuthMechanism.MONGODB_X509,()=>new UR.X509]]);class VR{constructor(){this.existingProviders=new Map}getOrCreateProvider(e,t){let r=this.existingProviders.get(e);if(r)return r;let n=tde.get(e);if(!n)throw new am.MongoInvalidArgumentError(`authMechanism ${e} not supported`);let s=n(t);return this.existingProviders.set(e,s),s}}zR.MongoClientAuthProviders=VR;function rde(e){if(e.OIDC_HUMAN_CALLBACK)return new jR.HumanCallbackWorkflow(new im.TokenCache,e.OIDC_HUMAN_CALLBACK);else if(e.OIDC_CALLBACK)return new qR.AutomatedCallbackWorkflow(new im.TokenCache,e.OIDC_CALLBACK);else{let t=e.ENVIRONMENT,r=um.OIDC_WORKFLOWS.get(t)?.();if(!r)throw new am.MongoInvalidArgumentError(`Could not load workflow for environment ${e.ENVIRONMENT}`);return r}}});var T6=g(function(YR){Object.defineProperty(YR,"__esModule",{value:!0});YR.ClientBulkWriteOperation=void 0;var HR=dt(),KR=ae(),GR=nr(),_s=Mt();class D6 extends GR.CommandOperation{get commandName(){return"bulkWrite"}constructor(e,t){super(void 0,t);this.SERVER_COMMAND_RESPONSE_TYPE=HR.ClientBulkWriteCursorResponse,this.commandBuilder=e,this.options=t,this.ns=new KR.MongoDBNamespace("admin","$cmd")}resetBatch(){return this.commandBuilder.resetBatch()}get canRetryWrite(){return this.commandBuilder.isBatchRetryable}handleOk(e){return e}buildCommandDocument(e,t){let r=this.commandBuilder.buildBatch(e.description.maxMessageSizeBytes,e.description.maxWriteBatchSize,e.description.maxBsonObjectSize);if(!this.canRetryWrite)this.options.willRetryWrite=!1;return r}}YR.ClientBulkWriteOperation=D6;_s.defineAspects(D6,[_s.Aspect.WRITE_OPERATION,_s.Aspect.SKIP_COLLATION,_s.Aspect.CURSOR_CREATING,_s.Aspect.RETRYABLE,_s.Aspect.COMMAND_BATCHING,_s.Aspect.SUPPORTS_RAW_DATA])});var r$=g(function(e$){Object.defineProperty(e$,"__esModule",{value:!0});e$.ClientBulkWriteCursor=void 0;var QR=T6(),XR=Kr(),cm=ae(),ZR=ps();class M6 extends ZR.AbstractCursor{constructor(e,t,r={}){super(e,new cm.MongoDBNamespace("admin","$cmd"),r);this.commandBuilder=t,this.clientBulkWriteOptions=r}get response(){if(this.cursorResponse)return this.cursorResponse;return null}get operations(){return this.commandBuilder.lastOperations}clone(){let e=cm.mergeOptions({},this.clientBulkWriteOptions);return delete e.session,new M6(this.client,this.commandBuilder,{...e})}async _initialize(e){let t=new QR.ClientBulkWriteOperation(this.commandBuilder,{...this.clientBulkWriteOptions,...this.cursorOptions,session:e}),r=await XR.executeOperation(this.client,t,this.timeoutContext);return this.cursorResponse=r,{server:t.server,session:e,response:r}}}e$.ClientBulkWriteCursor=M6});var d$=g(function(u$){Object.defineProperty(u$,"__esModule",{value:!0});u$.buildReplaceOneOperation=u$.buildUpdateManyOperation=u$.buildUpdateOneOperation=u$.buildDeleteManyOperation=u$.buildDeleteOneOperation=u$.buildInsertOneOperation=u$.ClientBulkWriteCommandBuilder=void 0;u$.buildOperation=P6;var Hl=we(),lm=mu(),Ao=Q(),hm=vc(),Kl=ae(),n$=1000;class s${constructor(e,t,r){this.models=e,this.options=t,this.pkFactory=r??Kl.DEFAULT_PK_FACTORY,this.currentModelIndex=0,this.previousModelIndex=0,this.lastOperations=[],this.isBatchRetryable=!0}get errorsOnly(){if("verboseResults"in this.options)return!this.options.verboseResults;return!0}hasNextBatch(){return this.currentModelIndex<this.models.length}resetBatch(){return this.currentModelIndex=this.previousModelIndex,!0}buildBatch(e,t,r){this.isBatchRetryable=!0;let n=0,s=0,i=this.baseCommand(),o=new Map;this.previousModelIndex=this.currentModelIndex;while(this.currentModelIndex<this.models.length){let u=this.models[this.currentModelIndex],a=u.namespace,c=o.get(a);if(u.name==="deleteMany"||u.name==="updateMany")this.isBatchRetryable=!1;if(c!=null){let l=P6(u,c,this.pkFactory,this.options),f;try{f=Hl.BSON.serialize(l)}catch(h){throw new Ao.MongoInvalidArgumentError("Could not serialize operation to BSON",{cause:h})}if(x6("ops",f,r),n+f.length<e&&i.ops.documents.length<t)n=n$+i.ops.push(l,f),this.currentModelIndex++;else break}else{o.set(a,s);let l={ns:a},f=P6(u,s,this.pkFactory,this.options),h,d;try{h=Hl.BSON.serialize(l),d=Hl.BSON.serialize(f)}catch(p){throw new Ao.MongoInvalidArgumentError("Could not serialize ns info to BSON",{cause:p})}if(x6("nsInfo",h,r),x6("ops",d,r),n+h.length+d.length<e&&i.ops.documents.length<t)n=n$+i.nsInfo.push(l,h)+i.ops.push(f,d),s++,this.currentModelIndex++;else break}}return this.lastOperations=i.ops.documents,i}baseCommand(){let e={bulkWrite:1,errorsOnly:this.errorsOnly,ordered:this.options.ordered??!0,ops:new lm.DocumentSequence("ops"),nsInfo:new lm.DocumentSequence("nsInfo")};if(this.options.bypassDocumentValidation!=null)e.bypassDocumentValidation=this.options.bypassDocumentValidation;if(this.options.let)e.let=this.options.let;if(this.options.comment!==void 0)e.comment=this.options.comment;return e}}u$.ClientBulkWriteCommandBuilder=s$;function x6(e,t,r){if(t.length>r)throw new Ao.MongoInvalidArgumentError(`Client bulk write operation ${e} of length ${t.length} exceeds the max bson object size of ${r}`)}var nde=(e,t,r)=>{let n={insert:t,document:e.document};return n.document._id=e.document._id??r.createPk(),n};u$.buildInsertOneOperation=nde;var sde=(e,t)=>i$(e,t,!1);u$.buildDeleteOneOperation=sde;var ide=(e,t)=>i$(e,t,!0);u$.buildDeleteManyOperation=ide;function i$(e,t,r){let n={delete:t,multi:r,filter:e.filter};if(e.hint)n.hint=e.hint;if(e.collation)n.collation=e.collation;return n}var ode=(e,t,r)=>o$(e,t,!1,r);u$.buildUpdateOneOperation=ode;var ude=(e,t,r)=>o$(e,t,!0,r);u$.buildUpdateManyOperation=ude;function ade(e,t){if(!Kl.hasAtomicOperators(e,t))throw new Ao.MongoAPIError("Client bulk write update models must only contain atomic modifiers (start with $) and must not be empty.")}function o$(e,t,r,n){ade(e.update,n);let s={update:t,multi:r,filter:e.filter,updateMods:e.update};if(e.hint)s.hint=e.hint;if(e.upsert)s.upsert=e.upsert;if(e.arrayFilters)s.arrayFilters=e.arrayFilters;if(e.collation)s.collation=e.collation;if(!r&&"sort"in e&&e.sort!=null)s.sort=hm.formatSort(e.sort);return s}var cde=(e,t)=>{if(Kl.hasAtomicOperators(e.replacement))throw new Ao.MongoAPIError("Client bulk write replace models must not contain atomic modifiers (start with $) and must not be empty.");let r={update:t,multi:!1,filter:e.filter,updateMods:e.replacement};if(e.hint)r.hint=e.hint;if(e.upsert)r.upsert=e.upsert;if(e.collation)r.collation=e.collation;if(e.sort!=null)r.sort=hm.formatSort(e.sort);return r};u$.buildReplaceOneOperation=cde;function P6(e,t,r,n){switch(e.name){case"insertOne":return u$.buildInsertOneOperation(e,t,r);case"deleteOne":return u$.buildDeleteOneOperation(e,t);case"deleteMany":return u$.buildDeleteManyOperation(e,t);case"updateOne":return u$.buildUpdateOneOperation(e,t,n);case"updateMany":return u$.buildUpdateManyOperation(e,t,n);case"replaceOne":return u$.buildReplaceOneOperation(e,t)}}});var E$=g(function(g$){Object.defineProperty(g$,"__esModule",{value:!0});g$.ClientBulkWriteResultsMerger=void 0;var p$=Iu(),m$=Q(),fde={acknowledged:!1,insertedCount:0,upsertedCount:0,matchedCount:0,modifiedCount:0,deletedCount:0,insertResults:void 0,updateResults:void 0,deleteResults:void 0};class y${static unacknowledged(){return fde}constructor(e){if(this.options=e,this.currentBatchOffset=0,this.writeConcernErrors=[],this.writeErrors=new Map,this.result={acknowledged:!0,insertedCount:0,upsertedCount:0,matchedCount:0,modifiedCount:0,deletedCount:0,insertResults:void 0,updateResults:void 0,deleteResults:void 0},e.verboseResults)this.result.insertResults=new Map,this.result.updateResults=new Map,this.result.deleteResults=new Map}get bulkWriteResult(){return{acknowledged:this.result.acknowledged,insertedCount:this.result.insertedCount,upsertedCount:this.result.upsertedCount,matchedCount:this.result.matchedCount,modifiedCount:this.result.modifiedCount,deletedCount:this.result.deletedCount,insertResults:this.result.insertResults,updateResults:this.result.updateResults,deleteResults:this.result.deleteResults}}async merge(e){let t;try{for await(let r of e)if(r.ok===1){if(this.options.verboseResults)this.processDocument(e,r)}else if(this.options.ordered){let n=new m$.MongoClientBulkWriteError({message:"Mongo client ordered bulk write encountered a write error."});throw n.writeErrors.set(r.idx+this.currentBatchOffset,{code:r.code,message:r.errmsg}),n.partialResult=this.result,n}else this.writeErrors.set(r.idx+this.currentBatchOffset,{code:r.code,message:r.errmsg})}catch(r){if(r instanceof p$.MongoWriteConcernError){let n=r.result;if(t={insertedCount:n.nInserted,upsertedCount:n.nUpserted,matchedCount:n.nMatched,modifiedCount:n.nModified,deletedCount:n.nDeleted,writeConcernError:n.writeConcernError},this.options.verboseResults&&n.cursor.firstBatch){for(let s of n.cursor.firstBatch)if(s.ok===1)this.processDocument(e,s)}}else throw r}finally{if(e.response){let r=e.response;this.incrementCounts(r)}this.currentBatchOffset+=e.operations.length}if(t){let r=t.writeConcernError;this.incrementCounts(t),this.writeConcernErrors.push({code:r.code,message:r.errmsg})}return this.result}processDocument(e,t){let r=e.operations[t.idx];if("insert"in r)this.result.insertResults?.set(t.idx+this.currentBatchOffset,{insertedId:r.document._id});if("update"in r){let n={matchedCount:t.n,modifiedCount:t.nModified??0,didUpsert:t.upserted!=null};if(t.upserted)n.upsertedId=t.upserted._id;this.result.updateResults?.set(t.idx+this.currentBatchOffset,n)}if("delete"in r)this.result.deleteResults?.set(t.idx+this.currentBatchOffset,{deletedCount:t.n})}incrementCounts(e){this.result.insertedCount+=e.insertedCount,this.result.upsertedCount+=e.upsertedCount,this.result.matchedCount+=e.matchedCount,this.result.modifiedCount+=e.modifiedCount,this.result.deletedCount+=e.deletedCount}}g$.ClientBulkWriteResultsMerger=y$});var P$=g(function(M$){Object.defineProperty(M$,"__esModule",{value:!0});M$.ClientBulkWriteExecutor=void 0;var fm=ps(),A$=r$(),Es=Q(),O$=Gn(),S$=ae(),w$=Kn(),C$=Kr(),b$=T6(),D$=d$(),dm=E$();class T${constructor(e,t,r){if(t.length===0)throw new Es.MongoClientBulkWriteExecutionError("No client bulk write models were provided.");if(this.client=e,this.operations=t,this.options={ordered:!0,bypassDocumentValidation:!1,verboseResults:!1,...r},!this.options.writeConcern)this.options.writeConcern=w$.WriteConcern.fromOptions(this.client.s.options);if(this.options.writeConcern?.w===0){if(this.options.verboseResults)throw new Es.MongoInvalidArgumentError("Cannot request unacknowledged write concern and verbose results");if(this.options.ordered)throw new Es.MongoInvalidArgumentError("Cannot request unacknowledged write concern and ordered writes")}}async execute(){let e=this.client.s.options.pkFactory,t=new D$.ClientBulkWriteCommandBuilder(this.operations,this.options,e),r=S$.resolveTimeoutOptions(this.client,this.options),n=O$.TimeoutContext.create(r);if(this.options.writeConcern?.w===0){while(t.hasNextBatch()){let s=new b$.ClientBulkWriteOperation(t,this.options);await C$.executeOperation(this.client,s,n)}return dm.ClientBulkWriteResultsMerger.unacknowledged()}else{let s=new dm.ClientBulkWriteResultsMerger(this.options);while(t.hasNextBatch()){let i=new fm.CursorTimeoutContext(n,Symbol()),o={...this.options,timeoutContext:i,...r.timeoutMS!=null&&{timeoutMode:fm.CursorTimeoutMode.LIFETIME}},u=new A$.ClientBulkWriteCursor(this.client,t,o);try{await s.merge(u)}catch(a){if(a instanceof Es.MongoServerError&&!(a instanceof Es.MongoClientBulkWriteError)){let c=new Es.MongoClientBulkWriteError({message:"Mongo client bulk write encountered an error during execution"});throw c.cause=a,c.partialResult=s.bulkWriteResult,c}else throw a}}if(s.writeConcernErrors.length>0||s.writeErrors.size>0){let i=new Es.MongoClientBulkWriteError({message:"Mongo client bulk write encountered errors during execution."});throw i.writeConcernErrors=s.writeConcernErrors,i.writeErrors=s.writeErrors,i.partialResult=s.bulkWriteResult,i}return s.bulkWriteResult}}}M$.ClientBulkWriteExecutor=T$});var v$=g(function(R$){Object.defineProperty(R$,"__esModule",{value:!0});R$.EndSessionsOperation=void 0;var B$=dt(),F$=nr(),N$=Ur(),I$=ae(),pm=Mt();class F6 extends F$.CommandOperation{constructor(e){super();this.writeConcern={w:0},this.ns=I$.MongoDBNamespace.fromString("admin.$cmd"),this.SERVER_COMMAND_RESPONSE_TYPE=B$.MongoDBResponse,this.sessions=e}buildCommandDocument(e,t){return{endSessions:this.sessions}}buildOptions(e){return{timeoutContext:e,readPreference:N$.ReadPreference.primaryPreferred}}get commandName(){return"endSessions"}}R$.EndSessionsOperation=F6;pm.defineAspects(F6,pm.Aspect.WRITE_OPERATION)});var N6=g(function(V$){Object.defineProperty(V$,"__esModule",{value:!0});V$.WaitingForSuitableServerEvent=V$.ServerSelectionSucceededEvent=V$.ServerSelectionFailedEvent=V$.ServerSelectionStartedEvent=V$.ServerSelectionEvent=void 0;var k$=ae(),ia=Or();class Gl{constructor(e,t,r){this.selector=e,this.operation=r,this.topologyDescription=t}}V$.ServerSelectionEvent=Gl;class q$ extends Gl{constructor(e,t,r){super(e,t,r);this.name=ia.SERVER_SELECTION_STARTED,this.message="Server selection started"}}V$.ServerSelectionStartedEvent=q$;class j$ extends Gl{constructor(e,t,r,n){super(e,t,n);this.name=ia.SERVER_SELECTION_FAILED,this.message="Server selection failed",this.failure=r}}V$.ServerSelectionFailedEvent=j$;class L$ extends Gl{constructor(e,t,r,n){super(e,t,n);this.name=ia.SERVER_SELECTION_SUCCEEDED,this.message="Server selection succeeded";let{host:s,port:i}=k$.HostAddress.fromString(r).toHostPort();this.serverHost=s,this.serverPort=i}}V$.ServerSelectionSucceededEvent=L$;class U$ extends Gl{constructor(e,t,r,n){super(e,t,n);this.name=ia.WAITING_FOR_SUITABLE_SERVER,this.message="Waiting for suitable server to become available",this.remainingTimeMS=r}}V$.WaitingForSuitableServerEvent=U$});var $6=g(function(G$){Object.defineProperty(G$,"__esModule",{value:!0});G$.SrvPoller=G$.SrvPollingEvent=void 0;var W$=G("dns"),Yl=G("timers"),H$=Q(),K$=Is(),pi=ae();class I6{constructor(e){this.srvRecords=e}hostnames(){return new Set(this.srvRecords.map((e)=>pi.HostAddress.fromSrvRecord(e).toString()))}}G$.SrvPollingEvent=I6;class R6 extends K$.TypedEventEmitter{static{this.SRV_RECORD_DISCOVERY="srvRecordDiscovery"}constructor(e){super();if(this.on("error",pi.noop),!e||!e.srvHost)throw new H$.MongoRuntimeError("Options for SrvPoller must exist and include srvHost");this.srvHost=e.srvHost,this.srvMaxHosts=e.srvMaxHosts??0,this.srvServiceName=e.srvServiceName??"mongodb",this.srvAllowedHostsSuffix=e.srvAllowedHostsSuffix,this.srvHostValidator=e.srvHostValidator,this.rescanSrvIntervalMS=60000,this.heartbeatFrequencyMS=e.heartbeatFrequencyMS??1e4,this.haMode=!1,this.generation=0,this._timeout=void 0}get srvAddress(){return`_${this.srvServiceName}._tcp.${this.srvHost}`}get intervalMS(){return this.haMode?this.heartbeatFrequencyMS:this.rescanSrvIntervalMS}start(){if(!this._timeout)this.schedule()}stop(){if(this._timeout)Yl.clearTimeout(this._timeout),this.generation+=1,this._timeout=void 0}schedule(){if(this._timeout)Yl.clearTimeout(this._timeout);this._timeout=Yl.setTimeout(()=>{this._poll().then(void 0,pi.squashError)},this.intervalMS)}success(e){this.haMode=!1,this.schedule(),this.emit(R6.SRV_RECORD_DISCOVERY,new I6(e))}failure(){this.haMode=!0,this.schedule()}async _poll(){let e=this.generation,t;try{t=await W$.promises.resolve(this.srvAddress,"SRV")}catch{this.failure();return}if(e!==this.generation)return;let r=[];for(let n of t)try{let s=pi.normalizeDnsName(n.name);pi.verifySrvHost(s,this.srvHost,this),r.push({...n,name:s})}catch(s){pi.squashError(s)}if(!r.length){this.failure();return}this.success(r)}}G$.SrvPoller=R6});var iv=g(function(nv){Object.defineProperty(nv,"__esModule",{value:!0});nv.Topology=void 0;var X$=m6(),Ft=Or(),kr=Q(),Ne=Du(),Z$=Is(),Oo=Ur(),Jl=Gn(),Nt=ae(),Z=as(),In=I0(),mm=o6(),Ql=kh(),oa=Fc(),Rn=N6(),ua=$6(),ym=YE(),_de=0,Jh=Nt.makeStateMachine({[Z.STATE_CLOSED]:[Z.STATE_CLOSED,Z.STATE_CONNECTING],[Z.STATE_CONNECTING]:[Z.STATE_CONNECTING,Z.STATE_CLOSING,Z.STATE_CONNECTED,Z.STATE_CLOSED],[Z.STATE_CONNECTED]:[Z.STATE_CONNECTED,Z.STATE_CLOSING,Z.STATE_CLOSED],[Z.STATE_CLOSING]:[Z.STATE_CLOSING,Z.STATE_CLOSED]});class yn extends Z$.TypedEventEmitter{static{this.SERVER_OPENING=Ft.SERVER_OPENING}static{this.SERVER_CLOSED=Ft.SERVER_CLOSED}static{this.SERVER_DESCRIPTION_CHANGED=Ft.SERVER_DESCRIPTION_CHANGED}static{this.TOPOLOGY_OPENING=Ft.TOPOLOGY_OPENING}static{this.TOPOLOGY_CLOSED=Ft.TOPOLOGY_CLOSED}static{this.TOPOLOGY_DESCRIPTION_CHANGED=Ft.TOPOLOGY_DESCRIPTION_CHANGED}static{this.ERROR=Ft.ERROR}static{this.OPEN=Ft.OPEN}static{this.CONNECT=Ft.CONNECT}static{this.CLOSE=Ft.CLOSE}static{this.TIMEOUT=Ft.TIMEOUT}constructor(e,t,r){super();if(this.on("error",Nt.noop),this.client=e,r=r??{hosts:[Nt.HostAddress.fromString("localhost:27017")],...Object.fromEntries(X$.DEFAULT_OPTIONS.entries())},typeof t==="string")t=[Nt.HostAddress.fromString(t)];else if(!Array.isArray(t))t=[t];let n=[];for(let a of t)if(typeof a==="string")n.push(Nt.HostAddress.fromString(a));else if(a instanceof Nt.HostAddress)n.push(a);else throw new kr.MongoRuntimeError(`Topology cannot be constructed from ${JSON.stringify(a)}`);let s=Ede(r),i=_de++,o=r.srvMaxHosts==null||r.srvMaxHosts===0||r.srvMaxHosts>=n.length?n:Nt.shuffle(n,r.srvMaxHosts),u=new Map;for(let a of o)u.set(a.toString(),new Ql.ServerDescription(a));if(this.waitQueue=new Nt.List,this.s={id:i,options:r,seedlist:n,state:Z.STATE_CLOSED,description:new ym.TopologyDescription(s,u,r.replicaSet,void 0,void 0,void 0,r),serverSelectionTimeoutMS:r.serverSelectionTimeoutMS,heartbeatFrequencyMS:r.heartbeatFrequencyMS,minHeartbeatFrequencyMS:r.minHeartbeatFrequencyMS,servers:new Map,credentials:r?.credentials,clusterTime:void 0,detectShardedTopology:(a)=>this.detectShardedTopology(a),detectSrvRecords:(a)=>this.detectSrvRecords(a)},this.mongoLogger=e.mongoLogger,this.component="topology",r.srvHost&&!r.loadBalanced)this.s.srvPoller=r.srvPoller??new ua.SrvPoller({heartbeatFrequencyMS:this.s.heartbeatFrequencyMS,srvHost:r.srvHost,srvMaxHosts:r.srvMaxHosts,srvServiceName:r.srvServiceName,srvAllowedHostsSuffix:r.srvAllowedHostsSuffix,srvHostValidator:r.srvHostValidator}),this.on(yn.TOPOLOGY_DESCRIPTION_CHANGED,this.s.detectShardedTopology);this.connectionLock=void 0}detectShardedTopology(e){let t=e.previousDescription.type,r=e.newDescription.type,n=t!==Z.TopologyType.Sharded&&r===Z.TopologyType.Sharded,i=!!this.s.srvPoller?.listeners(ua.SrvPoller.SRV_RECORD_DISCOVERY)?.includes(this.s.detectSrvRecords);if(n&&!i)this.s.srvPoller?.on(ua.SrvPoller.SRV_RECORD_DISCOVERY,this.s.detectSrvRecords),this.s.srvPoller?.start()}detectSrvRecords(e){let t=this.s.description;if(this.s.description=this.s.description.updateFromSrvPollingEvent(e,this.s.options.srvMaxHosts),this.s.description===t)return;J$(this),this.emitAndLog(yn.TOPOLOGY_DESCRIPTION_CHANGED,new In.TopologyDescriptionChangedEvent(this.s.id,t,this.s.description))}get description(){return this.s.description}get loadBalanced(){return this.s.options.loadBalanced}get serverApi(){return this.s.options.serverApi}async connect(e){this.connectionLock??=this._connect(e);try{return await this.connectionLock,this}finally{this.connectionLock=void 0}}async _connect(e){if(e=e??{},this.s.state===Z.STATE_CONNECTED)return this;Jh(this,Z.STATE_CONNECTING),this.emitAndLog(yn.TOPOLOGY_OPENING,new In.TopologyOpeningEvent(this.s.id)),this.emitAndLog(yn.TOPOLOGY_DESCRIPTION_CHANGED,new In.TopologyDescriptionChangedEvent(this.s.id,new ym.TopologyDescription(Z.TopologyType.Unknown),this.s.description));let t=Array.from(this.s.description.servers.values());if(this.s.servers=new Map(t.map((o)=>[o.address,tv(this,o)])),this.s.options.loadBalanced)for(let o of t){let u=new Ql.ServerDescription(o.hostAddress,void 0,{loadBalanced:this.s.options.loadBalanced});this.serverUpdateHandler(u)}let r=this.client.s.options.serverSelectionTimeoutMS,n=e.readPreference??Oo.ReadPreference.primary,s=Jl.TimeoutContext.create({timeoutMS:void 0,serverSelectionTimeoutMS:r,waitQueueTimeoutMS:this.client.s.options.waitQueueTimeoutMS}),i={operationName:"handshake",...e,timeoutContext:s,deprioritizedServers:new oa.DeprioritizedServers};try{let o=await this.selectServer(oa.readPreferenceServerSelector(n),i);if(this.s.options.__skipPingOnConnect!==!0){let a=await o.pool.checkOut({timeoutContext:s});return o.pool.checkIn(a),Jh(this,Z.STATE_CONNECTED),this.emit(yn.OPEN,this),this.emit(yn.CONNECT,this),this}return Jh(this,Z.STATE_CONNECTED),this.emit(yn.OPEN,this),this.emit(yn.CONNECT,this),this}catch(o){throw this.close(),o}}closeCheckedOutConnections(){for(let e of this.s.servers.values())e.closeCheckedOutConnections()}close(){if(this.s.state===Z.STATE_CLOSED||this.s.state===Z.STATE_CLOSING)return;for(let e of this.s.servers.values())ev(e,this);if(this.s.servers.clear(),Jh(this,Z.STATE_CLOSING),rv(this.waitQueue,new kr.MongoTopologyClosedError),this.s.srvPoller)this.s.srvPoller.stop(),this.s.srvPoller.removeListener(ua.SrvPoller.SRV_RECORD_DISCOVERY,this.s.detectSrvRecords);this.removeListener(yn.TOPOLOGY_DESCRIPTION_CHANGED,this.s.detectShardedTopology),Jh(this,Z.STATE_CLOSED),this.emitAndLog(yn.TOPOLOGY_CLOSED,new In.TopologyClosedEvent(this.s.id))}async selectServer(e,t){let r;if(typeof e!=="function")if(typeof e==="string")r=oa.readPreferenceServerSelector(Oo.ReadPreference.fromString(e));else{let h;if(e instanceof Oo.ReadPreference)h=e;else Oo.ReadPreference.translate(t),h=t.readPreference||Oo.ReadPreference.primary;r=oa.readPreferenceServerSelector(h)}else r=e;if(t={serverSelectionTimeoutMS:this.s.serverSelectionTimeoutMS,...t},this.client.mongoLogger?.willLog(Ne.MongoLoggableComponent.SERVER_SELECTION,Ne.SeverityLevel.DEBUG))this.client.mongoLogger?.debug(Ne.MongoLoggableComponent.SERVER_SELECTION,new Rn.ServerSelectionStartedEvent(e,this.description,t.operationName));let n;if(t.timeoutContext)n=t.timeoutContext.serverSelectionTimeout;else n=Jl.Timeout.expires(t.serverSelectionTimeoutMS??0);let s=this.description.type===Z.TopologyType.Sharded,i=t.session,o=i&&i.transaction;if(s&&o&&o.server){if(this.client.mongoLogger?.willLog(Ne.MongoLoggableComponent.SERVER_SELECTION,Ne.SeverityLevel.DEBUG))this.client.mongoLogger?.debug(Ne.MongoLoggableComponent.SERVER_SELECTION,new Rn.ServerSelectionSucceededEvent(e,this.description,o.server.pool.address,t.operationName));if(!t.timeoutContext||t.timeoutContext.clearServerSelectionTimeout)n?.clear();return o.server}let{promise:u,resolve:a,reject:c}=Nt.promiseWithResolvers(),l={serverSelector:r,topologyDescription:this.description,mongoLogger:this.client.mongoLogger,transaction:o,resolve:a,reject:c,cancelled:!1,startTime:Nt.processTimeMS(),operationName:t.operationName,waitingLogged:!1,deprioritizedServers:t.deprioritizedServers},f=Nt.addAbortListener(t.signal,function(){l.cancelled=!0,c(this.reason)});this.waitQueue.push(l),Q$(this);try{n?.throwIfExpired();let h=await(n?Promise.race([u,n]):u);if(t.timeoutContext?.csotEnabled()&&h.description.minRoundTripTime!==0)t.timeoutContext.minRoundTripTime=h.description.minRoundTripTime;return h}catch(h){if(Jl.TimeoutError.is(h)){l.cancelled=!0;let d=new kr.MongoServerSelectionError(`Server selection timed out after ${n?.duration} ms`,this.description);if(this.client.mongoLogger?.willLog(Ne.MongoLoggableComponent.SERVER_SELECTION,Ne.SeverityLevel.DEBUG))this.client.mongoLogger?.debug(Ne.MongoLoggableComponent.SERVER_SELECTION,new Rn.ServerSelectionFailedEvent(e,this.description,d,t.operationName));if(t.timeoutContext?.csotEnabled())throw new kr.MongoOperationTimeoutError("Timed out during server selection",{cause:d});throw d}throw h}finally{if(f?.[Nt.kDispose](),!t.timeoutContext||t.timeoutContext.clearServerSelectionTimeout)n?.clear()}}serverUpdateHandler(e){if(!this.s.description.hasServer(e.address))return;if(Ade(this.s.description,e))return;let t=this.s.description,r=this.s.description.servers.get(e.address);if(!r)return;let n=e.$clusterTime;if(n)Z._advanceClusterTime(this,n);let s=r&&r.equals(e);if(this.s.description=this.s.description.update(e),this.s.description.compatibilityError){this.emit(yn.ERROR,new kr.MongoCompatibilityError(this.s.description.compatibilityError));return}if(!s){let i=this.s.description.servers.get(e.address);if(i)this.emit(yn.SERVER_DESCRIPTION_CHANGED,new In.ServerDescriptionChangedEvent(this.s.id,e.address,r,i))}if(J$(this,e),this.waitQueue.length>0)Q$(this);if(!s)this.emitAndLog(yn.TOPOLOGY_DESCRIPTION_CHANGED,new In.TopologyDescriptionChangedEvent(this.s.id,t,this.s.description))}auth(e,t){if(typeof e==="function")t=e,e=void 0;if(typeof t==="function")t(void 0,!0)}isConnected(){return this.s.state===Z.STATE_CONNECTED}isDestroyed(){return this.s.state===Z.STATE_CLOSED}lastHello(){let e=Array.from(this.description.servers.values());if(e.length===0)return{};return e.filter((n)=>n.type!==Z.ServerType.Unknown)[0]||{maxWireVersion:this.description.commonWireVersion}}get commonWireVersion(){return this.description.commonWireVersion}get logicalSessionTimeoutMinutes(){return this.description.logicalSessionTimeoutMinutes}get clusterTime(){return this.s.clusterTime}set clusterTime(e){this.s.clusterTime=e}}nv.Topology=yn;function ev(e,t){for(let r of Ft.LOCAL_SERVER_EVENTS)e.removeAllListeners(r);e.close(),t.emitAndLog(yn.SERVER_CLOSED,new In.ServerClosedEvent(t.s.id,e.description.address));for(let r of Ft.SERVER_RELAY_EVENTS)e.removeAllListeners(r)}function Ede(e){if(e?.directConnection)return Z.TopologyType.Single;if(e?.replicaSet)return Z.TopologyType.ReplicaSetNoPrimary;if(e?.loadBalanced)return Z.TopologyType.LoadBalanced;return Z.TopologyType.Unknown}function tv(e,t){e.emitAndLog(yn.SERVER_OPENING,new In.ServerOpeningEvent(e.s.id,t.address));let r=new mm.Server(e,t,e.s.options);for(let n of Ft.SERVER_RELAY_EVENTS)r.on(n,(s)=>e.emit(n,s));return r.on(mm.Server.DESCRIPTION_RECEIVED,(n)=>e.serverUpdateHandler(n)),r.connect(),r}function J$(e,t){if(t&&e.s.servers.has(t.address)){let r=e.s.servers.get(t.address);if(r){if(r.s.description=t,t.error instanceof kr.MongoError&&t.error.hasErrorLabel(kr.MongoErrorLabel.ResetPool)){let n=t.error.hasErrorLabel(kr.MongoErrorLabel.InterruptInUseConnections);r.pool.clear({interruptInUseConnections:n})}else if(t.error==null){let n=e.s.description.type;if(t.isDataBearing||t.type!==Z.ServerType.Unknown&&n===Z.TopologyType.Single)r.pool.ready()}}}for(let r of e.description.servers.values())if(!e.s.servers.has(r.address)){let n=tv(e,r);e.s.servers.set(r.address,n)}for(let r of e.s.servers){let n=r[0];if(e.description.hasServer(n))continue;if(!e.s.servers.has(n))continue;let s=e.s.servers.get(n);if(e.s.servers.delete(n),s)ev(s,e)}}function rv(e,t){while(e.length){let r=e.shift();if(!r)continue;if(!r.cancelled){if(r.mongoLogger?.willLog(Ne.MongoLoggableComponent.SERVER_SELECTION,Ne.SeverityLevel.DEBUG))r.mongoLogger?.debug(Ne.MongoLoggableComponent.SERVER_SELECTION,new Rn.ServerSelectionFailedEvent(r.serverSelector,r.topologyDescription,t,r.operationName));r.reject(t)}}}function Q$(e){if(e.s.state===Z.STATE_CLOSED){rv(e.waitQueue,new kr.MongoTopologyClosedError);return}let t=e.description.type===Z.TopologyType.Sharded,r=Array.from(e.description.servers.values()),n=e.waitQueue.length;for(let s=0;s<n;++s){let i=e.waitQueue.shift();if(!i)continue;if(i.cancelled)continue;let o;try{let{serverSelector:c,deprioritizedServers:l}=i;o=c?c(e.description,r,l):r}catch(c){if(e.client.mongoLogger?.willLog(Ne.MongoLoggableComponent.SERVER_SELECTION,Ne.SeverityLevel.DEBUG))e.client.mongoLogger?.debug(Ne.MongoLoggableComponent.SERVER_SELECTION,new Rn.ServerSelectionFailedEvent(i.serverSelector,e.description,c,i.operationName));i.reject(c);continue}let u;if(o.length===0){if(!i.waitingLogged){if(e.client.mongoLogger?.willLog(Ne.MongoLoggableComponent.SERVER_SELECTION,Ne.SeverityLevel.INFORMATIONAL))e.client.mongoLogger?.info(Ne.MongoLoggableComponent.SERVER_SELECTION,new Rn.WaitingForSuitableServerEvent(i.serverSelector,e.description,e.s.serverSelectionTimeoutMS!==0?e.s.serverSelectionTimeoutMS-(Nt.processTimeMS()-i.startTime):-1,i.operationName));i.waitingLogged=!0}e.waitQueue.push(i);continue}else if(o.length===1)u=e.s.servers.get(o[0].address);else{let c=Nt.shuffle(o,2),l=e.s.servers.get(c[0].address),f=e.s.servers.get(c[1].address);u=l&&f&&l.s.operationCount<f.s.operationCount?l:f}if(!u){let c=new kr.MongoServerSelectionError("server selection returned a server description but the server was not found in the topology",e.description);if(e.client.mongoLogger?.willLog(Ne.MongoLoggableComponent.SERVER_SELECTION,Ne.SeverityLevel.DEBUG))e.client.mongoLogger?.debug(Ne.MongoLoggableComponent.SERVER_SELECTION,new Rn.ServerSelectionFailedEvent(i.serverSelector,e.description,c,i.operationName));i.reject(c);return}let a=i.transaction;if(t&&a&&a.isActive&&u)a.pinServer(u);if(e.client.mongoLogger?.willLog(Ne.MongoLoggableComponent.SERVER_SELECTION,Ne.SeverityLevel.DEBUG))e.client.mongoLogger?.debug(Ne.MongoLoggableComponent.SERVER_SELECTION,new Rn.ServerSelectionSucceededEvent(i.serverSelector,i.topologyDescription,u.pool.address,i.operationName));i.resolve(u)}if(e.waitQueue.length>0)for(let[,s]of e.s.servers)queueMicrotask(function(){return s.requestCheck()})}function Ade(e,t){let n=e.servers.get(t.address)?.topologyVersion;return Ql.compareTopologyVersion(n,t.topologyVersion)>0}});var va=g(function(Av){Object.defineProperty(Av,"__esModule",{value:!0});Av.MongoClient=Av.ServerApiVersion=void 0;var Xl=G("fs"),ov=Iu(),uv=we(),av=al(),cv=Wp(),lv=uo(),gm=fE(),_m=m6(),hv=Or(),fv=jp(),Zl=Q(),dv=b6(),Em=Du(),pv=Is(),mv=P$(),yv=v$(),gv=Kr(),_v=Ur(),Am=Fc(),Om=iv(),Sm=Sh(),Je=ae();Av.ServerApiVersion=Object.freeze({v1:"1"});class Ev extends pv.TypedEventEmitter{constructor(e,t){super();this.driverInfoList=[],this.on("error",Je.noop),this.options=_m.parseOptions(e,this,t),this.appendMetadata(this.options.driverInfo);let r=Object.values(this.options.mongoLoggerOptions.componentSeverities).some((s)=>s!==Em.SeverityLevel.OFF);this.mongoLogger=r?new Em.MongoLogger(this.options.mongoLoggerOptions):void 0;let n=this;this.s={url:e,bsonOptions:uv.resolveBSONOptions(this.options),namespace:Je.ns("admin"),hasBeenClosed:!1,sessionPool:new Sm.ServerSessionPool(this),activeSessions:new Set,activeCursors:new Set,authProviders:new dv.MongoClientAuthProviders,get options(){return n.options},get readConcern(){return n.options.readConcern},get writeConcern(){return n.options.writeConcern},get readPreference(){return n.options.readPreference},get isMongoClient(){return!0}},Object.defineProperty(this.s,"url",{enumerable:!1}),this.checkForNonGenuineHosts()}async[Symbol.asyncDispose](){await this.close()}appendMetadata(e){if(this.driverInfoList.some((r)=>gm.isDriverInfoEqual(r,e)))return;this.driverInfoList.push(e),this.options.metadata=gm.makeClientMetadata(this.driverInfoList,this.options).then(void 0,Je.squashError).then((r)=>r??{})}checkForNonGenuineHosts(){let e=this.options.hosts.filter((s)=>Je.isHostMatch(Je.DOCUMENT_DB_CHECK,s.host)),t=Je.isHostMatch(Je.DOCUMENT_DB_CHECK,this.options.srvHost),r=this.options.hosts.filter((s)=>Je.isHostMatch(Je.COSMOS_DB_CHECK,s.host)),n=Je.isHostMatch(Je.COSMOS_DB_CHECK,this.options.srvHost);if(e.length!==0||t)this.mongoLogger?.info("client",Je.DOCUMENT_DB_MSG);else if(r.length!==0||n)this.mongoLogger?.info("client",Je.COSMOS_DB_MSG)}get serverApi(){return this.options.serverApi&&Object.freeze({...this.options.serverApi})}get monitorCommands(){return this.options.monitorCommands}set monitorCommands(e){this.options.monitorCommands=e}get autoEncrypter(){return this.options.autoEncrypter}get readConcern(){return this.s.readConcern}get writeConcern(){return this.s.writeConcern}get readPreference(){return this.s.readPreference}get bsonOptions(){return this.s.bsonOptions}get timeoutMS(){return}async bulkWrite(e,t){if(this.autoEncrypter)throw new Zl.MongoInvalidArgumentError("MongoClient bulkWrite does not currently support automatic encryption.");return await new mv.ClientBulkWriteExecutor(this,e,Je.resolveOptions(this,t)).execute()}async connect(){if(this.connectionLock)return await this.connectionLock;try{this.connectionLock=this._connect(),await this.connectionLock}finally{this.connectionLock=void 0}return this}async _connect(){if(this.topology&&this.topology.isConnected())return this;let e=this.options;if(e.tls){if(typeof e.tlsCAFile==="string")e.ca??=await Xl.promises.readFile(e.tlsCAFile);if(typeof e.tlsCRLFile==="string")e.crl??=await Xl.promises.readFile(e.tlsCRLFile);if(typeof e.tlsCertificateKeyFile==="string"){if(!e.key||!e.cert){let r=await Xl.promises.readFile(e.tlsCertificateKeyFile);e.key??=r,e.cert??=r}}}if(typeof e.srvHost==="string"){let r=await _m.resolveSRVRecord(e);for(let[n,s]of r.entries())e.hosts[n]=s}if(e.credentials?.mechanism===lv.AuthMechanism.MONGODB_OIDC){let r=e.credentials?.mechanismProperties?.ALLOWED_HOSTS||cv.DEFAULT_ALLOWED_HOSTS;if(!e.credentials?.mechanismProperties?.ENVIRONMENT){for(let s of e.hosts)if(!Je.hostMatchesWildcards(s.toHostPort().host,r))throw new Zl.MongoInvalidArgumentError(`Host '${s}' is not valid for OIDC authentication with ALLOWED_HOSTS of '${r.join(",")}'`)}}this.topology=new Om.Topology(this,e.hosts,e),this.topology.once(Om.Topology.OPEN,()=>this.emit("open",this));for(let r of hv.MONGO_CLIENT_EVENTS)this.topology.on(r,(...n)=>this.emit(r,...n));let t=async()=>{try{await this.topology?.connect(e)}catch(r){throw this.topology?.close(),r}};if(this.autoEncrypter)await this.autoEncrypter?.init(),await t(),await e.encrypter.connectInternalClient();else await t();return this}async close(e=!1){if(this.closeLock)return await this.closeLock;try{this.closeLock=this._close(),await this.closeLock}finally{this.closeLock=void 0}}async _close(){Object.defineProperty(this.s,"hasBeenClosed",{value:!0,enumerable:!0,configurable:!1,writable:!1}),this.topology?.closeCheckedOutConnections();let e=Array.from(this.s.activeCursors,(o)=>o.close());this.s.activeCursors.clear(),await Promise.all(e);let t=Array.from(this.s.activeSessions,(o)=>o.endSession());if(this.s.activeSessions.clear(),await Promise.all(t),this.topology==null)return;if(this.topology.description.type===ov.TopologyType.LoadBalanced||this.topology.description.logicalSessionTimeoutMinutes!=null)await i(this,this.topology);let n=this.topology;this.topology=void 0,n.close();let{encrypter:s}=this.options;if(s)await s.close(this);async function i(o,{description:u}){let a=Am.readPreferenceServerSelector(_v.ReadPreference.primaryPreferred),c=Array.from(u.servers.values());if(a(u,c,new Am.DeprioritizedServers).length!==0){let f=Array.from(o.s.sessionPool.sessions,({id:h})=>h);if(f.length!==0)try{await gv.executeOperation(o,new yv.EndSessionsOperation(f))}catch(h){Je.squashError(h)}}}}db(e,t){if(t=t??{},!e)e=this.s.options.dbName;let r=Object.assign({},this.options,t);return new fv.Db(this,e,r)}static async connect(e,t){return await new this(e,t).connect()}startSession(e){let t=new Sm.ClientSession(this,this.s.sessionPool,{explicit:!0,...e},this.options);return this.s.activeSessions.add(t),t.once("ended",()=>{this.s.activeSessions.delete(t)}),t}async withSession(e,t){let r={owner:Symbol(),...typeof e==="object"?e:{}},n=typeof e==="function"?e:t;if(n==null)throw new Zl.MongoInvalidArgumentError("Missing required callback parameter");let s=this.startSession(r);try{return await n(s)}finally{try{await s.endSession()}catch(i){Je.squashError(i)}}}watch(e=[],t={}){if(!Array.isArray(e))t=e,e=[];return new av.ChangeStream(this,e,Je.resolveOptions(this,t))}}Av.MongoClient=Ev});var al=g(function(Pv){Object.defineProperty(Pv,"__esModule",{value:!0});Pv.ChangeStream=void 0;Pv.filterOutOptions=xv;var Sv=sl(),mr=Or(),wv=ps(),Cv=nE(),bv=jp(),Qe=Q(),Dv=va(),Tv=Is(),Mv=Fc(),en=ae(),Ua={COLLECTION:Symbol("Collection"),DATABASE:Symbol("Database"),CLUSTER:Symbol("Cluster")},Sde=[mr.RESUME_TOKEN_CHANGED,mr.END,mr.CLOSE],wde="A change stream document has been received that lacks a resume token (_id).",wm="ChangeStream is closed",Cde=bde();function xv(e){return Object.fromEntries(Object.entries(e).filter(([t,r])=>!Cde.has(t)))}class Va extends Tv.TypedEventEmitter{async[Symbol.asyncDispose](){await this.close()}static{this.RESPONSE=mr.RESPONSE}static{this.MORE=mr.MORE}static{this.INIT=mr.INIT}static{this.CLOSE=mr.CLOSE}static{this.CHANGE=mr.CHANGE}static{this.END=mr.END}static{this.ERROR=mr.ERROR}static{this.RESUME_TOKEN_CHANGED=mr.RESUME_TOKEN_CHANGED}constructor(e,t=[],r={}){super();if(this.pipeline=t,this.options={...r},this.options.timeoutMS=void 0,this.options.timeoutMode=void 0,delete this.options.writeConcern,e instanceof Sv.Collection)this.type=Ua.COLLECTION;else if(e instanceof bv.Db)this.type=Ua.DATABASE;else if(e instanceof Dv.MongoClient)this.type=Ua.CLUSTER;else throw new Qe.MongoChangeStreamError("Parent provided to ChangeStream constructor must be an instance of Collection, Db, or MongoClient");if(this.contextOwner=Symbol(),this.parent=e,this.namespace=e.s.namespace,!this.options.readPreference&&e.readPreference)this.options.readPreference=e.readPreference;this.cursor=this._createChangeStreamCursor(r),this.isClosed=!1,this.mode=!1,this.on("newListener",(n)=>{if(n==="change"&&this.cursor&&this.listenerCount("change")===0)this._streamEvents(this.cursor)}),this.on("removeListener",(n)=>{if(n==="change"&&this.listenerCount("change")===0&&this.cursor)this.cursorStream?.removeAllListeners("data")})}get resumeToken(){return this.cursor?.resumeToken}bufferedCount(){return this.cursor?.bufferedCount()??0}async hasNext(){this._setIsIterator(),this.timeoutContext?.refresh();try{while(!0)try{return await this.cursor.hasNext()}catch(e){try{await this._processErrorIteratorMode(e,this.cursor.id!=null)}catch(t){if(t instanceof Qe.MongoOperationTimeoutError&&this.cursor.id==null)throw t;try{await this.close()}catch(r){en.squashError(r)}throw t}}}finally{this.timeoutContext?.clear()}}async next(){this._setIsIterator(),this.timeoutContext?.refresh();try{while(!0)try{let e=await this.cursor.next();return this._processChange(e??null)}catch(e){try{await this._processErrorIteratorMode(e,this.cursor.id!=null)}catch(t){if(t instanceof Qe.MongoOperationTimeoutError&&this.cursor.id==null)throw t;try{await this.close()}catch(r){en.squashError(r)}throw t}}}finally{this.timeoutContext?.clear()}}async tryNext(){this._setIsIterator(),this.timeoutContext?.refresh();try{while(!0)try{let e=await this.cursor.tryNext();if(!e)return null;return this._processChange(e)}catch(e){try{await this._processErrorIteratorMode(e,this.cursor.id!=null)}catch(t){if(t instanceof Qe.MongoOperationTimeoutError&&this.cursor.id==null)throw t;try{await this.close()}catch(r){en.squashError(r)}throw t}}}finally{this.timeoutContext?.clear()}}async*[Symbol.asyncIterator](){if(this.closed)return;try{while(!0)yield await this.next()}finally{try{await this.close()}catch(e){en.squashError(e)}}}get closed(){return this.isClosed||this.cursor.closed}async close(){this.timeoutContext?.clear(),this.timeoutContext=void 0,this.isClosed=!0;let e=this.cursor;try{await e.close()}finally{this._endStream()}}stream(){if(this.closed)throw new Qe.MongoChangeStreamError(wm);return this.cursor.stream()}_setIsEmitter(){if(this.mode==="iterator")throw new Qe.MongoAPIError("ChangeStream cannot be used as an EventEmitter after being used as an iterator");this.mode="emitter"}_setIsIterator(){if(this.mode==="emitter")throw new Qe.MongoAPIError("ChangeStream cannot be used as an iterator after being used as an EventEmitter");this.mode="iterator"}_createChangeStreamCursor(e){let t=xv(e);if(this.type===Ua.CLUSTER)t.allChangesForCluster=!0;let r=[{$changeStream:t},...this.pipeline],n=this.type===Ua.CLUSTER?this.parent:this.type===Ua.DATABASE?this.parent.client:this.type===Ua.COLLECTION?this.parent.client:null;if(n==null)throw new Qe.MongoRuntimeError(`Changestream type should only be one of cluster, database, collection. Found ${this.type.toString()}`);let s=new Cv.ChangeStreamCursor(n,this.namespace,r,{...e,timeoutContext:this.timeoutContext?new wv.CursorTimeoutContext(this.timeoutContext,this.contextOwner):void 0});for(let i of Sde)s.on(i,(o)=>this.emit(i,o));if(this.listenerCount(Va.CHANGE)>0)this._streamEvents(s);return s}_closeEmitterModeWithError(e){this.emit(Va.ERROR,e),this.close().then(void 0,en.squashError)}_streamEvents(e){this._setIsEmitter();let t=this.cursorStream??e.stream();this.cursorStream=t,t.on("data",(r)=>{try{let n=this._processChange(r);this.emit(Va.CHANGE,n)}catch(n){this.emit(Va.ERROR,n)}this.timeoutContext?.refresh()}),t.on("error",(r)=>this._processErrorStreamMode(r,this.cursor.id!=null))}_endStream(){this.cursorStream?.removeAllListeners("data"),this.cursorStream?.removeAllListeners("close"),this.cursorStream?.removeAllListeners("end"),this.cursorStream?.destroy(),this.cursorStream=void 0}_processChange(e){if(this.isClosed)throw new Qe.MongoAPIError(wm);if(e==null)throw new Qe.MongoRuntimeError(wm);if(e&&!e._id)throw new Qe.MongoChangeStreamError(wde);return this.cursor.cacheResumeToken(e._id),this.options.startAtOperationTime=void 0,e}_processErrorStreamMode(e,t){if(this.isClosed)return;if(t&&(Qe.isResumableError(e,this.cursor.maxWireVersion)||e instanceof Qe.MongoOperationTimeoutError))this._endStream(),this.cursor.close().then(()=>this._resume(e),(r)=>(en.squashError(r),this._resume(e))).then(()=>{if(e instanceof Qe.MongoOperationTimeoutError)this.emit(Va.ERROR,e)},()=>this._closeEmitterModeWithError(e));else this._closeEmitterModeWithError(e)}async _processErrorIteratorMode(e,t){if(this.isClosed)throw new Qe.MongoAPIError(wm);if(t&&(Qe.isResumableError(e,this.cursor.maxWireVersion)||e instanceof Qe.MongoOperationTimeoutError)){try{await this.cursor.close()}catch(r){en.squashError(r)}if(await this._resume(e),e instanceof Qe.MongoOperationTimeoutError)throw e}else{try{await this.close()}catch(r){en.squashError(r)}throw e}}async _resume(e){this.timeoutContext?.refresh();let t=en.getTopology(this.parent);try{await t.selectServer(this.cursor.readPreference,{operationName:"reconnect topology in change stream",timeoutContext:this.timeoutContext,deprioritizedServers:new Mv.DeprioritizedServers}),this.cursor=this._createChangeStreamCursor(this.cursor.resumeOptions)}catch{throw await this.close(),e}}}Pv.ChangeStream=Va;function bde(){return new Set(Object.keys({allowDiskUse:"",authdb:"",batchSize:"",bsonRegExp:"",bypassDocumentValidation:"",bypassPinningCheck:"",checkKeys:"",collation:"",comment:"",cursor:"",dbName:"",enableUtf8Validation:"",explain:"",fieldsAsRaw:"",hint:"",ignoreUndefined:"",let:"",maxAwaitTimeMS:"",maxTimeMS:"",omitMaxTimeMS:"",out:"",promoteBuffers:"",promoteLongs:"",promoteValues:"",raw:"",rawData:"",readConcern:"",readPreference:"",serializeFunctions:"",session:"",timeoutContext:"",timeoutMS:"",timeoutMode:"",useBigInt64:"",willRetryWrite:"",writeConcern:""}))}});var k6=g(function(Rv){Object.defineProperty(Rv,"__esModule",{value:!0});Rv.GridFSBucketReadStream=void 0;var Nv=G("stream"),Iv=we(),Lt=Q();class v6 extends Nv.Readable{static{this.FILE="file"}constructor(e,t,r,n,s){super({emitClose:!0});this.s={bytesToTrim:0,bytesToSkip:0,bytesRead:0,chunks:e,expected:0,files:t,filter:n,init:!1,expectedEnd:0,options:{start:0,end:0,...s},readPreference:r}}_read(){if(this.destroyed)return;xde(this,()=>Tde(this))}start(e=0){return Fv(this),this.s.options.start=e,this}end(e=0){return Fv(this),this.s.options.end=e,this}async abort(){this.push(null),this.destroy();let e=this.s.timeoutContext?.getRemainingTimeMSOrThrow();await this.s.cursor?.close({timeoutMS:e})}}Rv.GridFSBucketReadStream=v6;function Fv(e){if(e.s.init)throw new Lt.MongoGridFSStreamError("Options cannot be changed after the stream is initialized")}function Tde(e){if(e.destroyed)return;if(!e.s.cursor)return;if(!e.s.file)return;let t=(r)=>{if(e.destroyed)return;if(!r){e.push(null),e.s.cursor?.close().then(void 0,(f)=>e.destroy(f));return}if(!e.s.file)return;let n=e.s.file.length-e.s.bytesRead,s=e.s.expected++,i=Math.min(e.s.file.chunkSize,n);if(r.n>s)return e.destroy(new Lt.MongoGridFSChunkError(`ChunkIsMissing: Got unexpected n: ${r.n}, expected: ${s}`));if(r.n<s)return e.destroy(new Lt.MongoGridFSChunkError(`ExtraChunk: Got unexpected n: ${r.n}, expected: ${s}`));let o=Iv.ByteUtils.isUint8Array(r.data)?r.data:r.data.buffer;if(o.byteLength!==i){if(n<=0)return e.destroy(new Lt.MongoGridFSChunkError(`ExtraChunk: Got unexpected n: ${r.n}, expected file length ${e.s.file.length} bytes but already read ${e.s.bytesRead} bytes`));return e.destroy(new Lt.MongoGridFSChunkError(`ChunkIsWrongSize: Got unexpected length: ${o.byteLength}, expected: ${i}`))}if(e.s.bytesRead+=o.byteLength,o.byteLength===0)return e.push(null);let u=null,a=null;if(e.s.bytesToSkip!=null)u=e.s.bytesToSkip,e.s.bytesToSkip=0;let c=s===e.s.expectedEnd-1,l=e.s.options.end-e.s.bytesToSkip;if(c&&e.s.bytesToTrim!=null)a=e.s.file.chunkSize-e.s.bytesToTrim;else if(e.s.options.end&&l<r.data.byteLength)a=l;if(u!=null||a!=null)o=o.slice(u||0,a||o.byteLength);e.push(o);return};e.s.cursor.next().then(t,(r)=>{if(e.destroyed)return;e.destroy(r)})}function Mde(e){let t={};if(e.s.readPreference)t.readPreference=e.s.readPreference;if(e.s.options&&e.s.options.sort)t.sort=e.s.options.sort;if(e.s.options&&e.s.options.skip)t.skip=e.s.options.skip;let r=(s)=>{if(e.destroyed)return;if(!s){let a=`FileNotFound: file ${e.s.filter._id!=null?e.s.filter._id.$eq:e.s.filter.filename} was not found`,c=new Lt.MongoRuntimeError(a);return c.code="ENOENT",e.destroy(c)}if(s.length<=0){e.push(null);return}if(e.destroyed){e.destroy();return}try{e.s.bytesToSkip=Pde(e,s,e.s.options)}catch(u){return e.destroy(u)}let i={files_id:{$eq:s._id}};if(e.s.options&&e.s.options.start!=null){let u=Math.floor(e.s.options.start/s.chunkSize);if(u>0)i.n={$gte:u}}let o;try{o=e.s.timeoutContext?.getRemainingTimeMSOrThrow(`Download timed out after ${e.s.timeoutContext?.timeoutMS}ms`)}catch(u){return e.destroy(u)}if(e.s.cursor=e.s.chunks.find(i,{timeoutMS:o}).sort({n:1}),e.s.readPreference)e.s.cursor.withReadPreference(e.s.readPreference);e.s.expectedEnd=Math.ceil(s.length/s.chunkSize),e.s.file=s;try{e.s.bytesToTrim=Bde(e,s,e.s.cursor,e.s.options)}catch(u){return e.destroy(u)}e.emit(v6.FILE,s);return},n;try{n=e.s.timeoutContext?.getRemainingTimeMSOrThrow(`Download timed out after ${e.s.timeoutContext?.timeoutMS}ms`)}catch(s){if(!e.destroyed)e.destroy(s);return}t.timeoutMS=n,e.s.files.findOne(e.s.filter,t).then(r,(s)=>{if(e.destroyed)return;e.destroy(s)})}function xde(e,t){if(e.s.file)return t();if(!e.s.init)Mde(e),e.s.init=!0;e.once("file",()=>{t()})}function Pde(e,t,r){if(r&&r.start!=null){if(r.start>t.length)throw new Lt.MongoInvalidArgumentError(`Stream start (${r.start}) must not be more than the length of the file (${t.length})`);if(r.start<0)throw new Lt.MongoInvalidArgumentError(`Stream start (${r.start}) must not be negative`);if(r.end!=null&&r.end<r.start)throw new Lt.MongoInvalidArgumentError(`Stream start (${r.start}) must not be greater than stream end (${r.end})`);return e.s.bytesRead=Math.floor(r.start/t.chunkSize)*t.chunkSize,e.s.expected=Math.floor(r.start/t.chunkSize),r.start-e.s.bytesRead}throw new Lt.MongoInvalidArgumentError("Start option must be defined")}function Bde(e,t,r,n){if(n&&n.end!=null){if(n.end>t.length)throw new Lt.MongoInvalidArgumentError(`Stream end (${n.end}) must not be more than the length of the file (${t.length})`);if(n.start==null||n.start<0)throw new Lt.MongoInvalidArgumentError(`Stream end (${n.end}) must not be negative`);let s=n.start!=null?Math.floor(n.start/t.chunkSize):0;return r.limit(Math.ceil(n.end/t.chunkSize)-s),e.s.expectedEnd=Math.ceil(n.end/t.chunkSize),Math.ceil(n.end/t.chunkSize)*t.chunkSize-n.end}throw new Lt.MongoInvalidArgumentError("End option must be defined")}});var j6=g(function(zv){Object.defineProperty(zv,"__esModule",{value:!0});zv.GridFSBucketWriteStream=void 0;zv.checkChunksIndex=Uv;zv.checkIndexes=Vv;var vv=G("stream"),tn=we(),yr=Q(),kv=ae(),qv=Kn();class jv extends vv.Writable{constructor(e,t,r){super();this.gridFSFile=null,r=r??{},this.bucket=e,this.chunks=e.s._chunksCollection,this.filename=t,this.files=e.s._filesCollection,this.options=r,this.writeConcern=qv.WriteConcern.fromOptions(r)||e.s.options.writeConcern,this.done=!1,this.id=r.id?r.id:new tn.ObjectId,this.chunkSizeBytes=r.chunkSizeBytes||this.bucket.s.options.chunkSizeBytes,this.bufToStore=tn.ByteUtils.allocate(this.chunkSizeBytes),this.length=0,this.n=0,this.pos=0,this.state={streamEnd:!1,outstandingRequests:0,errored:!1,aborted:!1}}_construct(e){if(!this.bucket.s.calledOpenUploadStream)this.bucket.s.calledOpenUploadStream=!0,Vv(this).then(()=>{this.bucket.s.checkedIndexes=!0,this.bucket.emit("index"),e()},(t)=>{if(t instanceof yr.MongoOperationTimeoutError)return za(this,t,e);kv.squashError(t),e()});else return queueMicrotask(e)}_write(e,t,r){Nde(this,e,t,r)}_final(e){if(this.state.streamEnd)return queueMicrotask(e);this.state.streamEnd=!0,Ide(this,e)}async abort(){if(this.state.streamEnd)throw new yr.MongoAPIError("Cannot abort a stream that has already completed");if(this.state.aborted)throw new yr.MongoAPIError("Cannot call abort() on a stream twice");this.state.aborted=!0;let e=this.timeoutContext?.getRemainingTimeMSOrThrow(`Upload timed out after ${this.timeoutContext?.timeoutMS}ms`);await this.chunks.deleteMany({files_id:{$eq:this.id}},{timeoutMS:e})}}zv.GridFSBucketWriteStream=jv;function za(e,t,r){if(e.state.errored){queueMicrotask(r);return}e.state.errored=!0,queueMicrotask(()=>r(t))}function Lv(e,t,r){return{_id:new tn.ObjectId,files_id:e,n:t,data:r}}async function Uv(e){let t={files_id:1,n:1},r;r=e.timeoutContext?.getRemainingTimeMSOrThrow(`Upload timed out after ${e.timeoutContext?.timeoutMS}ms`);let n;try{n=await e.chunks.listIndexes({timeoutMS:r}).toArray()}catch(i){if(i instanceof yr.MongoError&&yr.isNamespaceNotFoundError(i))n=[];else throw i}if(!n.find((i)=>{if(Object.keys(i.key).length===2&&i.key.files_id===1&&i.key.n===1)return!0;return!1}))r=e.timeoutContext?.getRemainingTimeMSOrThrow(`Upload timed out after ${e.timeoutContext?.timeoutMS}ms`),await e.chunks.createIndex(t,{unique:!0},{timeoutMS:r})}function q6(e,t){if(e.done)return queueMicrotask(t);if(e.state.streamEnd&&e.state.outstandingRequests===0&&!e.state.errored){e.done=!0;let r=Fde(e.id,e.length,e.chunkSizeBytes,e.filename,e.options.metadata);if(Cm(e,t))return;let n=e.timeoutContext?.remainingTimeMS;if(n!=null&&n<=0)return za(e,new yr.MongoOperationTimeoutError(`Upload timed out after ${e.timeoutContext?.timeoutMS}ms`),t);e.files.insertOne(r,{writeConcern:e.writeConcern,timeoutMS:n}).then(()=>{e.gridFSFile=r,t()},(s)=>za(e,s,t));return}queueMicrotask(t)}async function Vv(e){let t=e.timeoutContext?.getRemainingTimeMSOrThrow(`Upload timed out after ${e.timeoutContext?.timeoutMS}ms`);if(await e.files.findOne({},{projection:{_id:1},timeoutMS:t})!=null)return;let n={filename:1,uploadDate:1},s;t=e.timeoutContext?.getRemainingTimeMSOrThrow(`Upload timed out after ${e.timeoutContext?.timeoutMS}ms`);let i={timeoutMS:t};try{s=await e.files.listIndexes(i).toArray()}catch(u){if(u instanceof yr.MongoError&&yr.isNamespaceNotFoundError(u))s=[];else throw u}if(!s.find((u)=>{if(Object.keys(u.key).length===2&&u.key.filename===1&&u.key.uploadDate===1)return!0;return!1}))t=e.timeoutContext?.getRemainingTimeMSOrThrow(`Upload timed out after ${e.timeoutContext?.timeoutMS}ms`),await e.files.createIndex(n,{},{timeoutMS:t});await Uv(e)}function Fde(e,t,r,n,s){let i={_id:e,length:t,chunkSize:r,uploadDate:new Date,filename:n};if(s)i.metadata=s;return i}function Nde(e,t,r,n){if(Cm(e,n))return;let s=typeof t==="string"?tn.ByteUtils.fromUTF8(t):tn.ByteUtils.toLocalBufferType(t);if(e.length+=s.length,e.pos+s.length<e.chunkSizeBytes){tn.ByteUtils.copy(s,e.bufToStore,e.pos),e.pos+=s.length,queueMicrotask(n);return}let i=s.length,o=e.chunkSizeBytes-e.pos,u=Math.min(o,s.length),a=0;while(i>0){let c=s.length-i;tn.ByteUtils.copy(s,e.bufToStore,e.pos,c,c+u),e.pos+=u,o-=u;let l;if(o===0){l=Lv(e.id,e.n,new Uint8Array(e.bufToStore));let f=e.timeoutContext?.remainingTimeMS;if(f!=null&&f<=0)return za(e,new yr.MongoOperationTimeoutError(`Upload timed out after ${e.timeoutContext?.timeoutMS}ms`),n);if(++e.state.outstandingRequests,++a,Cm(e,n))return;e.chunks.insertOne(l,{writeConcern:e.writeConcern,timeoutMS:f}).then(()=>{if(--e.state.outstandingRequests,--a,!a)q6(e,n)},(h)=>za(e,h,n)),o=e.chunkSizeBytes,e.pos=0,++e.n}i-=u,u=Math.min(o,i)}}function Ide(e,t){if(e.pos===0)return q6(e,t);let r=tn.ByteUtils.allocate(e.pos);tn.ByteUtils.copy(e.bufToStore,r,0,0,e.pos);let n=Lv(e.id,e.n,r);if(Cm(e,t))return;let s=e.timeoutContext?.remainingTimeMS;if(s!=null&&s<=0)return za(e,new yr.MongoOperationTimeoutError(`Upload timed out after ${e.timeoutContext?.timeoutMS}ms`),t);++e.state.outstandingRequests,e.chunks.insertOne(n,{writeConcern:e.writeConcern,timeoutMS:s}).then(()=>{--e.state.outstandingRequests,q6(e,t)},(i)=>za(e,i,t))}function Cm(e,t){if(e.state.aborted)return queueMicrotask(()=>t(new yr.MongoAPIError("Stream has been aborted"))),!0;return!1}});var Qv=g(function(Yv){Object.defineProperty(Yv,"__esModule",{value:!0});Yv.GridFSBucket=void 0;var e1=Q(),Hv=Is(),bm=Gn(),aa=ae(),Kv=Kn(),Dm=k6(),Tm=j6(),vde={bucketName:"fs",chunkSizeBytes:261120};class Gv extends Hv.TypedEventEmitter{static{this.INDEX="index"}constructor(e,t){super();this.on("error",aa.noop),this.setMaxListeners(0);let r=aa.resolveOptions(e,{...vde,...t,writeConcern:Kv.WriteConcern.fromOptions(t)});this.s={db:e,options:r,_chunksCollection:e.collection(r.bucketName+".chunks"),_filesCollection:e.collection(r.bucketName+".files"),checkedIndexes:!1,calledOpenUploadStream:!1}}openUploadStream(e,t){return new Tm.GridFSBucketWriteStream(this,e,{timeoutMS:this.s.options.timeoutMS,...t})}openUploadStreamWithId(e,t,r){return new Tm.GridFSBucketWriteStream(this,t,{timeoutMS:this.s.options.timeoutMS,...r,id:e})}openDownloadStream(e,t){return new Dm.GridFSBucketReadStream(this.s._chunksCollection,this.s._filesCollection,this.s.options.readPreference,{_id:{$eq:e}},{timeoutMS:this.s.options.timeoutMS,...t})}async delete(e,t){let{timeoutMS:r}=aa.resolveOptions(this.s.db,t),n=void 0;if(r)n=new bm.CSOTTimeoutContext({timeoutMS:r,serverSelectionTimeoutMS:this.s.db.client.s.options.serverSelectionTimeoutMS});let{deletedCount:s}=await this.s._filesCollection.deleteOne({_id:{$eq:e}},{timeoutMS:n?.remainingTimeMS}),i=n?.remainingTimeMS;if(i!=null&&i<=0)throw new e1.MongoOperationTimeoutError(`Timed out after ${r}ms`);if(await this.s._chunksCollection.deleteMany({files_id:{$eq:e}},{timeoutMS:i}),s===0)throw new e1.MongoRuntimeError(`File not found for id ${e}`)}find(e={},t={}){return this.s._filesCollection.find(e,t)}openDownloadStreamByName(e,t){let r={uploadDate:-1},n=void 0;if(t&&t.revision!=null)if(t.revision>=0)r={uploadDate:1},n=t.revision;else n=-t.revision-1;return new Dm.GridFSBucketReadStream(this.s._chunksCollection,this.s._filesCollection,this.s.options.readPreference,{filename:e},{timeoutMS:this.s.options.timeoutMS,...t,sort:r,skip:n})}async rename(e,t,r){let n={_id:{$eq:e}},s={$set:{filename:t}},{matchedCount:i}=await this.s._filesCollection.updateOne(n,s,r);if(i===0)throw new e1.MongoRuntimeError(`File with id ${e} not found`)}async drop(e){let{timeoutMS:t}=aa.resolveOptions(this.s.db,e),r=void 0;if(t)r=new bm.CSOTTimeoutContext({timeoutMS:t,serverSelectionTimeoutMS:this.s.db.client.s.options.serverSelectionTimeoutMS});if(r){await this.s._filesCollection.drop({timeoutMS:r.remainingTimeMS});let n=r.getRemainingTimeMSOrThrow(`Timed out after ${t}ms`);await this.s._chunksCollection.drop({timeoutMS:n})}else await this.s._filesCollection.drop(),await this.s._chunksCollection.drop()}}Yv.GridFSBucket=Gv});var Iu=g(function(N){Object.defineProperty(N,"__esModule",{value:!0});N.MongoRuntimeError=N.MongoParseError=N.MongoOperationTimeoutError=N.MongoOIDCError=N.MongoNotConnectedError=N.MongoNetworkTimeoutError=N.MongoNetworkError=N.MongoMissingDependencyError=N.MongoMissingCredentialsError=N.MongoKerberosError=N.MongoInvalidArgumentError=N.MongoGridFSStreamError=N.MongoGridFSChunkError=N.MongoGCPError=N.MongoExpiredSessionError=N.MongoError=N.MongoDriverError=N.MongoDecompressionError=N.MongoCursorInUseError=N.MongoCursorExhaustedError=N.MongoCompatibilityError=N.MongoClientClosedError=N.MongoClientBulkWriteExecutionError=N.MongoClientBulkWriteError=N.MongoClientBulkWriteCursorError=N.MongoChangeStreamError=N.MongoBatchReExecutionError=N.MongoAzureError=N.MongoAWSError=N.MongoAPIError=N.ExplainableCursor=N.ChangeStreamCursor=N.ClientEncryption=N.MongoBulkWriteError=N.UUID=N.Timestamp=N.ObjectId=N.MinKey=N.MaxKey=N.Long=N.Int32=N.Double=N.Decimal128=N.DBRef=N.Code=N.BSONType=N.BSONSymbol=N.BSONRegExp=N.Binary=N.BSON=void 0;N.CommandStartedEvent=N.CommandFailedEvent=N.WriteConcern=N.ReadPreference=N.ReadConcern=N.TopologyType=N.ServerType=N.ReadPreferenceMode=N.ReadConcernLevel=N.ProfilingLevel=N.ReturnDocument=N.SeverityLevel=N.MongoLoggableComponent=N.ServerApiVersion=N.ExplainVerbosity=N.MongoErrorLabel=N.CursorTimeoutMode=N.CURSOR_FLAGS=N.Compressor=N.AuthMechanism=N.GSSAPICanonicalizationValue=N.AutoEncryptionLoggerLevel=N.BatchType=N.UnorderedBulkOperation=N.OrderedBulkOperation=N.MongoClient=N.ListIndexesCursor=N.ListCollectionsCursor=N.GridFSBucketWriteStream=N.GridFSBucketReadStream=N.GridFSBucket=N.FindCursor=N.Db=N.Collection=N.ClientSession=N.ChangeStream=N.CancellationToken=N.AggregationCursor=N.Admin=N.AbstractCursor=N.MongoWriteConcernError=N.MongoUnexpectedServerResponseError=N.MongoTransactionError=N.MongoTopologyClosedError=N.MongoTailableCursorError=N.MongoSystemError=N.MongoStalePrimaryError=N.MongoServerSelectionError=N.MongoServerError=N.MongoServerClosedError=void 0;N.MongoClientAuthProviders=N.MongoCryptKMSRequestNetworkTimeoutError=N.MongoCryptInvalidArgumentError=N.MongoCryptError=N.MongoCryptCreateEncryptedCollectionError=N.MongoCryptCreateDataKeyError=N.MongoCryptAzureKMSRequestError=N.SrvPollingEvent=N.WaitingForSuitableServerEvent=N.ServerSelectionSucceededEvent=N.ServerSelectionStartedEvent=N.ServerSelectionFailedEvent=N.ServerSelectionEvent=N.TopologyOpeningEvent=N.TopologyDescriptionChangedEvent=N.TopologyClosedEvent=N.ServerOpeningEvent=N.ServerHeartbeatSucceededEvent=N.ServerHeartbeatStartedEvent=N.ServerHeartbeatFailedEvent=N.ServerDescriptionChangedEvent=N.ServerClosedEvent=N.ConnectionReadyEvent=N.ConnectionPoolReadyEvent=N.ConnectionPoolMonitoringEvent=N.ConnectionPoolCreatedEvent=N.ConnectionPoolClosedEvent=N.ConnectionPoolClearedEvent=N.ConnectionCreatedEvent=N.ConnectionClosedEvent=N.ConnectionCheckOutStartedEvent=N.ConnectionCheckOutFailedEvent=N.ConnectionCheckedOutEvent=N.ConnectionCheckedInEvent=N.CommandSucceededEvent=void 0;var Xv=w_();Object.defineProperty(N,"Admin",{enumerable:!0,get:function(){return Xv.Admin}});var Zv=C_();Object.defineProperty(N,"OrderedBulkOperation",{enumerable:!0,get:function(){return Zv.OrderedBulkOperation}});var ek=b_();Object.defineProperty(N,"UnorderedBulkOperation",{enumerable:!0,get:function(){return ek.UnorderedBulkOperation}});var tk=al();Object.defineProperty(N,"ChangeStream",{enumerable:!0,get:function(){return tk.ChangeStream}});var rk=sl();Object.defineProperty(N,"Collection",{enumerable:!0,get:function(){return rk.Collection}});var nk=ps();Object.defineProperty(N,"AbstractCursor",{enumerable:!0,get:function(){return nk.AbstractCursor}});var sk=Ch();Object.defineProperty(N,"AggregationCursor",{enumerable:!0,get:function(){return sk.AggregationCursor}});var ik=H_();Object.defineProperty(N,"FindCursor",{enumerable:!0,get:function(){return ik.FindCursor}});var ok=oE();Object.defineProperty(N,"ListCollectionsCursor",{enumerable:!0,get:function(){return ok.ListCollectionsCursor}});var uk=J_();Object.defineProperty(N,"ListIndexesCursor",{enumerable:!0,get:function(){return uk.ListIndexesCursor}});var ak=jp();Object.defineProperty(N,"Db",{enumerable:!0,get:function(){return ak.Db}});var ck=Qv();Object.defineProperty(N,"GridFSBucket",{enumerable:!0,get:function(){return ck.GridFSBucket}});var lk=k6();Object.defineProperty(N,"GridFSBucketReadStream",{enumerable:!0,get:function(){return lk.GridFSBucketReadStream}});var hk=j6();Object.defineProperty(N,"GridFSBucketWriteStream",{enumerable:!0,get:function(){return hk.GridFSBucketWriteStream}});var fk=va();Object.defineProperty(N,"MongoClient",{enumerable:!0,get:function(){return fk.MongoClient}});var dk=Is();Object.defineProperty(N,"CancellationToken",{enumerable:!0,get:function(){return dk.CancellationToken}});var pk=Sh();Object.defineProperty(N,"ClientSession",{enumerable:!0,get:function(){return pk.ClientSession}});var kde=we();Object.defineProperty(N,"BSON",{enumerable:!0,get:function(){return kde.BSON}});var Qn=we();Object.defineProperty(N,"Binary",{enumerable:!0,get:function(){return Qn.Binary}});Object.defineProperty(N,"BSONRegExp",{enumerable:!0,get:function(){return Qn.BSONRegExp}});Object.defineProperty(N,"BSONSymbol",{enumerable:!0,get:function(){return Qn.BSONSymbol}});Object.defineProperty(N,"BSONType",{enumerable:!0,get:function(){return Qn.BSONType}});Object.defineProperty(N,"Code",{enumerable:!0,get:function(){return Qn.Code}});Object.defineProperty(N,"DBRef",{enumerable:!0,get:function(){return Qn.DBRef}});Object.defineProperty(N,"Decimal128",{enumerable:!0,get:function(){return Qn.Decimal128}});Object.defineProperty(N,"Double",{enumerable:!0,get:function(){return Qn.Double}});Object.defineProperty(N,"Int32",{enumerable:!0,get:function(){return Qn.Int32}});Object.defineProperty(N,"Long",{enumerable:!0,get:function(){return Qn.Long}});Object.defineProperty(N,"MaxKey",{enumerable:!0,get:function(){return Qn.MaxKey}});Object.defineProperty(N,"MinKey",{enumerable:!0,get:function(){return Qn.MinKey}});Object.defineProperty(N,"ObjectId",{enumerable:!0,get:function(){return Qn.ObjectId}});Object.defineProperty(N,"Timestamp",{enumerable:!0,get:function(){return Qn.Timestamp}});Object.defineProperty(N,"UUID",{enumerable:!0,get:function(){return Qn.UUID}});var qde=Lc();Object.defineProperty(N,"MongoBulkWriteError",{enumerable:!0,get:function(){return qde.MongoBulkWriteError}});var jde=p0();Object.defineProperty(N,"ClientEncryption",{enumerable:!0,get:function(){return jde.ClientEncryption}});var Lde=nE();Object.defineProperty(N,"ChangeStreamCursor",{enumerable:!0,get:function(){return Lde.ChangeStreamCursor}});var Ude=mp();Object.defineProperty(N,"ExplainableCursor",{enumerable:!0,get:function(){return Ude.ExplainableCursor}});var Ve=Q();Object.defineProperty(N,"MongoAPIError",{enumerable:!0,get:function(){return Ve.MongoAPIError}});Object.defineProperty(N,"MongoAWSError",{enumerable:!0,get:function(){return Ve.MongoAWSError}});Object.defineProperty(N,"MongoAzureError",{enumerable:!0,get:function(){return Ve.MongoAzureError}});Object.defineProperty(N,"MongoBatchReExecutionError",{enumerable:!0,get:function(){return Ve.MongoBatchReExecutionError}});Object.defineProperty(N,"MongoChangeStreamError",{enumerable:!0,get:function(){return Ve.MongoChangeStreamError}});Object.defineProperty(N,"MongoClientBulkWriteCursorError",{enumerable:!0,get:function(){return Ve.MongoClientBulkWriteCursorError}});Object.defineProperty(N,"MongoClientBulkWriteError",{enumerable:!0,get:function(){return Ve.MongoClientBulkWriteError}});Object.defineProperty(N,"MongoClientBulkWriteExecutionError",{enumerable:!0,get:function(){return Ve.MongoClientBulkWriteExecutionError}});Object.defineProperty(N,"MongoClientClosedError",{enumerable:!0,get:function(){return Ve.MongoClientClosedError}});Object.defineProperty(N,"MongoCompatibilityError",{enumerable:!0,get:function(){return Ve.MongoCompatibilityError}});Object.defineProperty(N,"MongoCursorExhaustedError",{enumerable:!0,get:function(){return Ve.MongoCursorExhaustedError}});Object.defineProperty(N,"MongoCursorInUseError",{enumerable:!0,get:function(){return Ve.MongoCursorInUseError}});Object.defineProperty(N,"MongoDecompressionError",{enumerable:!0,get:function(){return Ve.MongoDecompressionError}});Object.defineProperty(N,"MongoDriverError",{enumerable:!0,get:function(){return Ve.MongoDriverError}});Object.defineProperty(N,"MongoError",{enumerable:!0,get:function(){return Ve.MongoError}});Object.defineProperty(N,"MongoExpiredSessionError",{enumerable:!0,get:function(){return Ve.MongoExpiredSessionError}});Object.defineProperty(N,"MongoGCPError",{enumerable:!0,get:function(){return Ve.MongoGCPError}});Object.defineProperty(N,"MongoGridFSChunkError",{enumerable:!0,get:function(){return Ve.MongoGridFSChunkError}});Object.defineProperty(N,"MongoGridFSStreamError",{enumerable:!0,get:function(){return Ve.MongoGridFSStreamError}});Object.defineProperty(N,"MongoInvalidArgumentError",{enumerable:!0,get:function(){return Ve.MongoInvalidArgumentError}});Object.defineProperty(N,"MongoKerberosError",{enumerable:!0,get:function(){return Ve.MongoKerberosError}});Object.defineProperty(N,"MongoMissingCredentialsError",{enumerable:!0,get:function(){return Ve.MongoMissingCredentialsError}});Object.defineProperty(N,"MongoMissingDependencyError",{enumerable:!0,get:function(){return Ve.MongoMissingDependencyError}});Object.defineProperty(N,"MongoNetworkError",{enumerable:!0,get:function(){return Ve.MongoNetworkError}});Object.defineProperty(N,"MongoNetworkTimeoutError",{enumerable:!0,get:function(){return Ve.MongoNetworkTimeoutError}});Object.defineProperty(N,"MongoNotConnectedError",{enumerable:!0,get:function(){return Ve.MongoNotConnectedError}});Object.defineProperty(N,"MongoOIDCError",{enumerable:!0,get:function(){return Ve.MongoOIDCError}});Object.defineProperty(N,"MongoOperationTimeoutError",{enumerable:!0,get:function(){return Ve.MongoOperationTimeoutError}});Object.defineProperty(N,"MongoParseError",{enumerable:!0,get:function(){return Ve.MongoParseError}});Object.defineProperty(N,"MongoRuntimeError",{enumerable:!0,get:function(){return Ve.MongoRuntimeError}});Object.defineProperty(N,"MongoServerClosedError",{enumerable:!0,get:function(){return Ve.MongoServerClosedError}});Object.defineProperty(N,"MongoServerError",{enumerable:!0,get:function(){return Ve.MongoServerError}});Object.defineProperty(N,"MongoServerSelectionError",{enumerable:!0,get:function(){return Ve.MongoServerSelectionError}});Object.defineProperty(N,"MongoStalePrimaryError",{enumerable:!0,get:function(){return Ve.MongoStalePrimaryError}});Object.defineProperty(N,"MongoSystemError",{enumerable:!0,get:function(){return Ve.MongoSystemError}});Object.defineProperty(N,"MongoTailableCursorError",{enumerable:!0,get:function(){return Ve.MongoTailableCursorError}});Object.defineProperty(N,"MongoTopologyClosedError",{enumerable:!0,get:function(){return Ve.MongoTopologyClosedError}});Object.defineProperty(N,"MongoTransactionError",{enumerable:!0,get:function(){return Ve.MongoTransactionError}});Object.defineProperty(N,"MongoUnexpectedServerResponseError",{enumerable:!0,get:function(){return Ve.MongoUnexpectedServerResponseError}});Object.defineProperty(N,"MongoWriteConcernError",{enumerable:!0,get:function(){return Ve.MongoWriteConcernError}});var Vde=Lc();Object.defineProperty(N,"BatchType",{enumerable:!0,get:function(){return Vde.BatchType}});var zde=VE();Object.defineProperty(N,"AutoEncryptionLoggerLevel",{enumerable:!0,get:function(){return zde.AutoEncryptionLoggerLevel}});var Wde=Vp();Object.defineProperty(N,"GSSAPICanonicalizationValue",{enumerable:!0,get:function(){return Wde.GSSAPICanonicalizationValue}});var Hde=uo();Object.defineProperty(N,"AuthMechanism",{enumerable:!0,get:function(){return Hde.AuthMechanism}});var Kde=fh();Object.defineProperty(N,"Compressor",{enumerable:!0,get:function(){return Kde.Compressor}});var mk=ps();Object.defineProperty(N,"CURSOR_FLAGS",{enumerable:!0,get:function(){return mk.CURSOR_FLAGS}});Object.defineProperty(N,"CursorTimeoutMode",{enumerable:!0,get:function(){return mk.CursorTimeoutMode}});var Gde=Q();Object.defineProperty(N,"MongoErrorLabel",{enumerable:!0,get:function(){return Gde.MongoErrorLabel}});var Yde=Qg();Object.defineProperty(N,"ExplainVerbosity",{enumerable:!0,get:function(){return Yde.ExplainVerbosity}});var Jde=va();Object.defineProperty(N,"ServerApiVersion",{enumerable:!0,get:function(){return Jde.ServerApiVersion}});var yk=Du();Object.defineProperty(N,"MongoLoggableComponent",{enumerable:!0,get:function(){return yk.MongoLoggableComponent}});Object.defineProperty(N,"SeverityLevel",{enumerable:!0,get:function(){return yk.SeverityLevel}});var Qde=Z_();Object.defineProperty(N,"ReturnDocument",{enumerable:!0,get:function(){return Qde.ReturnDocument}});var Xde=aE();Object.defineProperty(N,"ProfilingLevel",{enumerable:!0,get:function(){return Xde.ProfilingLevel}});var Zde=vi();Object.defineProperty(N,"ReadConcernLevel",{enumerable:!0,get:function(){return Zde.ReadConcernLevel}});var epe=Ur();Object.defineProperty(N,"ReadPreferenceMode",{enumerable:!0,get:function(){return epe.ReadPreferenceMode}});var gk=as();Object.defineProperty(N,"ServerType",{enumerable:!0,get:function(){return gk.ServerType}});Object.defineProperty(N,"TopologyType",{enumerable:!0,get:function(){return gk.TopologyType}});var tpe=vi();Object.defineProperty(N,"ReadConcern",{enumerable:!0,get:function(){return tpe.ReadConcern}});var rpe=Ur();Object.defineProperty(N,"ReadPreference",{enumerable:!0,get:function(){return rpe.ReadPreference}});var npe=Kn();Object.defineProperty(N,"WriteConcern",{enumerable:!0,get:function(){return npe.WriteConcern}});var L6=GE();Object.defineProperty(N,"CommandFailedEvent",{enumerable:!0,get:function(){return L6.CommandFailedEvent}});Object.defineProperty(N,"CommandStartedEvent",{enumerable:!0,get:function(){return L6.CommandStartedEvent}});Object.defineProperty(N,"CommandSucceededEvent",{enumerable:!0,get:function(){return L6.CommandSucceededEvent}});var mi=t6();Object.defineProperty(N,"ConnectionCheckedInEvent",{enumerable:!0,get:function(){return mi.ConnectionCheckedInEvent}});Object.defineProperty(N,"ConnectionCheckedOutEvent",{enumerable:!0,get:function(){return mi.ConnectionCheckedOutEvent}});Object.defineProperty(N,"ConnectionCheckOutFailedEvent",{enumerable:!0,get:function(){return mi.ConnectionCheckOutFailedEvent}});Object.defineProperty(N,"ConnectionCheckOutStartedEvent",{enumerable:!0,get:function(){return mi.ConnectionCheckOutStartedEvent}});Object.defineProperty(N,"ConnectionClosedEvent",{enumerable:!0,get:function(){return mi.ConnectionClosedEvent}});Object.defineProperty(N,"ConnectionCreatedEvent",{enumerable:!0,get:function(){return mi.ConnectionCreatedEvent}});Object.defineProperty(N,"ConnectionPoolClearedEvent",{enumerable:!0,get:function(){return mi.ConnectionPoolClearedEvent}});Object.defineProperty(N,"ConnectionPoolClosedEvent",{enumerable:!0,get:function(){return mi.ConnectionPoolClosedEvent}});Object.defineProperty(N,"ConnectionPoolCreatedEvent",{enumerable:!0,get:function(){return mi.ConnectionPoolCreatedEvent}});Object.defineProperty(N,"ConnectionPoolMonitoringEvent",{enumerable:!0,get:function(){return mi.ConnectionPoolMonitoringEvent}});Object.defineProperty(N,"ConnectionPoolReadyEvent",{enumerable:!0,get:function(){return mi.ConnectionPoolReadyEvent}});Object.defineProperty(N,"ConnectionReadyEvent",{enumerable:!0,get:function(){return mi.ConnectionReadyEvent}});var Go=I0();Object.defineProperty(N,"ServerClosedEvent",{enumerable:!0,get:function(){return Go.ServerClosedEvent}});Object.defineProperty(N,"ServerDescriptionChangedEvent",{enumerable:!0,get:function(){return Go.ServerDescriptionChangedEvent}});Object.defineProperty(N,"ServerHeartbeatFailedEvent",{enumerable:!0,get:function(){return Go.ServerHeartbeatFailedEvent}});Object.defineProperty(N,"ServerHeartbeatStartedEvent",{enumerable:!0,get:function(){return Go.ServerHeartbeatStartedEvent}});Object.defineProperty(N,"ServerHeartbeatSucceededEvent",{enumerable:!0,get:function(){return Go.ServerHeartbeatSucceededEvent}});Object.defineProperty(N,"ServerOpeningEvent",{enumerable:!0,get:function(){return Go.ServerOpeningEvent}});Object.defineProperty(N,"TopologyClosedEvent",{enumerable:!0,get:function(){return Go.TopologyClosedEvent}});Object.defineProperty(N,"TopologyDescriptionChangedEvent",{enumerable:!0,get:function(){return Go.TopologyDescriptionChangedEvent}});Object.defineProperty(N,"TopologyOpeningEvent",{enumerable:!0,get:function(){return Go.TopologyOpeningEvent}});var Qh=N6();Object.defineProperty(N,"ServerSelectionEvent",{enumerable:!0,get:function(){return Qh.ServerSelectionEvent}});Object.defineProperty(N,"ServerSelectionFailedEvent",{enumerable:!0,get:function(){return Qh.ServerSelectionFailedEvent}});Object.defineProperty(N,"ServerSelectionStartedEvent",{enumerable:!0,get:function(){return Qh.ServerSelectionStartedEvent}});Object.defineProperty(N,"ServerSelectionSucceededEvent",{enumerable:!0,get:function(){return Qh.ServerSelectionSucceededEvent}});Object.defineProperty(N,"WaitingForSuitableServerEvent",{enumerable:!0,get:function(){return Qh.WaitingForSuitableServerEvent}});var spe=$6();Object.defineProperty(N,"SrvPollingEvent",{enumerable:!0,get:function(){return spe.SrvPollingEvent}});var t1=El();Object.defineProperty(N,"MongoCryptAzureKMSRequestError",{enumerable:!0,get:function(){return t1.MongoCryptAzureKMSRequestError}});Object.defineProperty(N,"MongoCryptCreateDataKeyError",{enumerable:!0,get:function(){return t1.MongoCryptCreateDataKeyError}});Object.defineProperty(N,"MongoCryptCreateEncryptedCollectionError",{enumerable:!0,get:function(){return t1.MongoCryptCreateEncryptedCollectionError}});Object.defineProperty(N,"MongoCryptError",{enumerable:!0,get:function(){return t1.MongoCryptError}});Object.defineProperty(N,"MongoCryptInvalidArgumentError",{enumerable:!0,get:function(){return t1.MongoCryptInvalidArgumentError}});Object.defineProperty(N,"MongoCryptKMSRequestNetworkTimeoutError",{enumerable:!0,get:function(){return t1.MongoCryptKMSRequestNetworkTimeoutError}});var ipe=b6();Object.defineProperty(N,"MongoClientAuthProviders",{enumerable:!0,get:function(){return ipe.MongoClientAuthProviders}})});var le=g(function(cpe){cpe.arrayAtomicsBackupSymbol=Symbol("mongoose#Array#atomicsBackup");cpe.arrayAtomicsSymbol=Symbol("mongoose#Array#_atomics");cpe.arrayParentSymbol=Symbol("mongoose#Array#_parent");cpe.arrayPathSymbol=Symbol("mongoose#Array#_path");cpe.arraySchemaSymbol=Symbol("mongoose#Array#_schema");cpe.documentArrayParent=Symbol("mongoose#documentArrayParent");cpe.documentIsSelected=Symbol("mongoose#Document#isSelected");cpe.documentIsModified=Symbol("mongoose#Document#isModified");cpe.documentModifiedPaths=Symbol("mongoose#Document#modifiedPaths");cpe.documentSchemaSymbol=Symbol("mongoose#Document#schema");cpe.getSymbol=Symbol("mongoose#Document#get");cpe.modelSymbol=Symbol("mongoose#Model");cpe.objectIdSymbol=Symbol("mongoose#ObjectId");cpe.populateModelSymbol=Symbol("mongoose#PopulateOptions#Model");cpe.schemaTypeSymbol=Symbol("mongoose#schemaType");cpe.sessionNewDocuments=Symbol("mongoose#ClientSession#newDocuments");cpe.scopeSymbol=Symbol("mongoose#Document#scope");cpe.validatorErrorSymbol=Symbol("mongoose#validatorError")});var ca=g(function(Q5e,_k){var Xh=we().ObjectId,Mpe=le().objectIdSymbol;Object.defineProperty(Xh.prototype,"_id",{enumerable:!1,configurable:!0,get:function(){return this}});/*!
29
- * Convenience `valueOf()` to allow comparing ObjectIds using double equals re: gh-7299
30
- */if(!Object.hasOwn(Xh.prototype,"valueOf"))Xh.prototype.valueOf=function(){return this.toString()};Xh.prototype[Mpe]=!0;_k.exports=Xh});var $n=g(function(X5e,Ek){Ek.exports=function(t){if(t==null)return;if(typeof t.constructor!=="function")return;return t.constructor.name}});var ji=g(function(xpe){/*!
31
- * ignore
32
- */xpe.internalToObjectOptions={transform:!1,virtuals:!1,getters:!1,_skipDepopulateTopLevel:!0,depopulate:!0,flattenDecimals:!1,useProjection:!1,versionKey:!0,flattenObjectIds:!1,flattenUUIDs:!1}});var Mm=g(function(eDe,Ak){Ak.exports=we().Decimal128});var la=g(function(tDe,Ok){Ok.exports=new Set(["__proto__","constructor","prototype"])});var r1=g(function(rDe,Sk){Sk.exports=function(t,r){if(t==null)return;let n=Object.getPrototypeOf(t);return n==null?void 0:n[r]}});var xm=g(function(Bpe){Bpe.isMongooseArray=function(e){return Array.isArray(e)&&e.isMongooseArray}});var gn=g(function(sDe,wk){var Npe=r1();wk.exports=function(t){return t!=null&&t.$isMongooseDocumentPrototype===!0&&Npe(t,"$isMongooseDocumentPrototype")===!0}});var Zh=g(function(iDe,Ck){var Ipe=r1(),Rpe=xm().isMongooseArray,$pe=gn();Ck.exports=function(e){return e!=null&&(Rpe(e)||$pe(e)||e.isMongooseBuffer&&Buffer.isBuffer(e)||e.$isMongooseMap&&Ipe(e,"$isMongooseMap"))}});var U6=g(function(oDe,bk){var vpe=/^function\s*([^\s(]+)/;bk.exports=function(e){return e.name||(e.toString().trim().match(vpe)||[])[1]}});var vn=g(function(uDe,Dk){function kpe(e,t){return e!=null&&e._bsontype===t}Dk.exports=kpe});var Wa=g(function(aDe,Tk){Tk.exports=function(e){return Buffer.isBuffer(e)||Object.prototype.toString.call(e)==="[object Object]"}});var n1=g(function(qpe){var Mk=Symbol("mongoose#trustedSymbol");qpe.trustedSymbol=Mk;qpe.trusted=function(t){if(t==null||typeof t!=="object"&&typeof t!=="function")return t;return t[Mk]=!0,t}});var Zt=g(function(lDe,Ik){var Bk=Mm(),Upe=ca(),Fk=la(),Vpe=Zh(),zpe=U6(),xk=r1(),V6=vn(),Wpe=xm().isMongooseArray,Hpe=gn(),Kpe=Wa(),Nk=le(),z6=n1().trustedSymbol,s1=we(),Pk=s1.UUID,W6=s1.Binary;function ef(e,t,r){if(e==null)return e;if(V6(e,"Double"))return new s1.Double(e.value);if(typeof e==="number"||typeof e==="string"||typeof e==="boolean"||typeof e==="bigint")return e;if(Array.isArray(e))return Gpe(e,t);if(Vpe(e)){if(t){if(t.flattenUUIDs){if(e instanceof W6&&e._subtype===W6.SUBTYPE_UUID)return e.toString();if(Buffer.isBuffer(e)&&e.isMongooseBuffer&&e._subtype===W6.SUBTYPE_UUID)return e.toUUID().toString()}if(t.retainDocuments&&Hpe(e)){let i=e.$clone();if(e.__index!=null)i.__index=e.__index;if(e.__parentArray!=null)i.__parentArray=t.parentArray??e.__parentArray;return i.$__setParent(t.parentDoc??e.$__parent),i}if(t.retainDocuments&&xk(e,"$isMongooseMap")){let i=t.parentDoc??e.$__parent,u=new e.constructor({},e.$__path,i,e.$__schemaType);for(let[a,c]of e)u.$__set(a,ef(c,{...t,parentDoc:i}));return u}}let s;if(t?.json&&typeof e.toJSON==="function")s=e.toJSON(t);else s=e.toObject(t);return s}let n=e.constructor;if(n)switch(zpe(n)){case"Object":if(xk(e.$__,"strictMode")!=null&&e._doc!=null)return e._doc;return H6(e,t,r);case"Date":return new n(+e);case"RegExp":return Ype(e);default:break}if(V6(e,"ObjectId")){if(t?.flattenObjectIds)return e.toJSON();return new Upe(e.id)}if(V6(e,"Decimal128")){if(t?.flattenDecimals)return e.toJSON();return Bk.fromString(e.toString())}if(e instanceof Pk){if(t?.flattenUUIDs)return e.toJSON();return new Pk(e.buffer)}if(!n&&Kpe(e))return H6(e,t,r);if(typeof e==="object"&&e[Nk.schemaTypeSymbol])return e.clone();if(t?.bson&&typeof e.toBSON==="function")return e;if(typeof e.valueOf==="function")return e.valueOf();return H6(e,t,r)}Ik.exports=ef;/*!
33
- * ignore
34
- */function H6(e,t,r){let n=t?.minimize,s=t?.omitUndefined,i=t?._seen,o={},u;if(i&&i.has(e))return i.get(e);else if(i)i.set(e,o);if(z6 in e&&t?.copyTrustedSymbol!==!1)o[z6]=e[z6];let a=Object.keys(e),c=a.length;for(let l=0;l<c;++l){let f=a[l];if(Fk.has(f))continue;let h=ef(e[f],t,!1);if((n===!1||s)&&typeof h>"u")delete o[f];else if(n!==!0||typeof h<"u")u||(u=!0),o[f]=h}return n&&!r?u&&o:o}function Gpe(e,t){let r=t?._seen;if(r&&r.has(e))return r.get(e);let n=0,s=e.length,i=null;if(t?.retainDocuments){let o=t.parentDoc??(e.isMongooseArray?e.$parent():void 0);if(e.isMongooseDocumentArray)i=new(e.$schemaType()).schema.base.Types.DocumentArray([],e.$path(),o,e.$schemaType());else if(e.isMongooseArray)i=new(e.$parent()).schema.base.Types.Array([],e.$path(),o,e.$schemaType());else i=Array(s)}else i=Array(s);if(r)r.set(e,i);if(e=Wpe(e)?e.__array:e,i.isMongooseDocumentArray){t={...t,parentArray:i};for(n=0;n<s;++n){let o=ef(e[n],t,!0);if(typeof o?.$setIndex==="function")o.$setIndex(n);i.set(n,o,!0)}}else for(n=0;n<s;++n)i[n]=ef(e[n],t,!0);return i}function Ype(e){let t=new RegExp(e.source,e.flags);if(t.lastIndex!==e.lastIndex)t.lastIndex=e.lastIndex;return t}});var qk=g(function(hDe,kk){/*!
35
- * Module dependencies.
36
- */var ha=__(),K6=Le(),G6=Iu().Collection,Rk=ca(),$k=$n(),Jpe=ji().internalToObjectOptions,vk=G("stream"),o1=G("util"),Qpe=Object.freeze({...Jpe,copyTrustedSymbol:!1});function Li(e,t,r){this.collection=null,this.Promise=r.Promise||Promise,this.modelName=r.modelName,delete r.modelName,this._closed=!1,ha.apply(this,arguments)}/*!
37
- * Inherit from abstract Collection.
38
- */Object.setPrototypeOf(Li.prototype,ha.prototype);Li.prototype.onOpen=function(){return this.collection=this.conn.db.collection(this.name),ha.prototype.onOpen.call(this),this.collection};Li.prototype.onClose=function(e){ha.prototype.onClose.call(this,e)};Li.prototype._getCollection=function(){if(this.collection)return this.collection;if(this.conn.db!=null)return this.collection=this.conn.db.collection(this.name),this.collection;return null};function Xpe(e){Li.prototype[e]=function(){let t=this._getCollection(),r=arguments,n=this,s=n?.conn?.base?.options?.debug,i=n?.conn?.options?.debug,o=i==null?s:i;if(this.conn.$wasForceClosed){let h=new K6("Connection was force closed");if(r.length>0&&typeof r[r.length-1]==="function"){r[r.length-1](h);return}else throw h}let u=null,a=null,c=this.conn.listenerCount("operation-start")>0||this.conn.listenerCount("operation-end")>0;if(c||o)u=new Rk;let l=null,f=null;if(this._shouldBufferCommands()&&this.buffer){if(u==null)u=new Rk;this.conn.emit("buffer",{_id:u,modelName:n.modelName,collectionName:n.name,method:e,args:r});let h=this._getBufferTimeoutMS();return f=new Promise((d,p)=>{this.addQueue(d),l=setTimeout(()=>{if(this.removeQueue(d)){let _="Operation `"+this.name+"."+e+"()` buffering timed out after "+h+"ms",y=new K6(_);this.conn.emit("buffer-end",{_id:u,modelName:n.modelName,collectionName:n.name,method:e,error:y}),p(y)}},h)}),f.then(()=>{if(l)clearTimeout(l);return this[e].apply(this,r)})}if(o)if(typeof o==="function"){if(a==null)a=Array.from(r);let h=null;if(typeof a[a.length-1]=="function")h=a.slice(0,a.length-1);else h=a;o.apply(n,[n.name,e].concat(h))}else if(o instanceof vk.Writable)this.$printToStream(n.name,e,r,o);else{let h=o.color==null?!0:o.color,d=o.shell==null?!1:o.shell,p=o.timestamp==null?!1:o.timestamp;this.$print(n.name,e,r,h,d,p)}if(c){if(a==null)a=Array.from(r);this.conn.emit("operation-start",{_id:u,modelName:n.modelName,collectionName:this.name,method:e,params:a})}try{if(t==null){let d="Cannot call `"+this.name+"."+e+"()` before initial connection is complete if `bufferCommands = false`. Make sure you `await mongoose.connect()` if you have `bufferCommands = false`.";throw new K6(d)}let h=t[e].apply(t,r);if(typeof h?.then==="function")return h.then((d)=>{if(l!=null)clearTimeout(l);if(c)this.conn.emit("operation-end",{_id:u,modelName:n.modelName,collectionName:this.name,method:e,result:d});return d},(d)=>{if(l!=null)clearTimeout(l);if(c)this.conn.emit("operation-end",{_id:u,modelName:n.modelName,collectionName:this.name,method:e,error:d});throw d});if(c)this.conn.emit("operation-end",{_id:u,modelName:n.modelName,collectionName:this.name,method:e,result:h});if(l!=null)clearTimeout(l);return h}catch(h){if(l!=null)clearTimeout(l);if(c)this.conn.emit("operation-end",{_id:u,modelName:n.modelName,collectionName:this.name,method:e,error:h});throw h}}}for(let e of Object.getOwnPropertyNames(G6.prototype)){if(Object.getOwnPropertyDescriptor(G6.prototype,e).get!==void 0)continue;if(typeof G6.prototype[e]!=="function")continue;Xpe(e)}Li.prototype.$print=function(e,t,r,n,s,i){let o="";if(i){let f=new Date().toISOString();o=n?`\x1B[0;90m[${f}]\x1B[0m `:`[${f}] `}let u=n?"\x1B[0;36mMongoose:\x1B[0m ":"Mongoose: ",a=[e,t].join("."),c=[];for(let f=r.length-1;f>=0;--f)if(this.$format(r[f])||c.length)c.unshift(this.$format(r[f],n,s));let l="("+c.join(", ")+")";console.info(o+u+a+l)};Li.prototype.$printToStream=function(e,t,r,n){let s=[e,t].join("."),i=[];for(let u=r.length-1;u>=0;--u)if(this.$format(r[u])||i.length)i.unshift(this.$format(r[u]));let o="("+i.join(", ")+")";n.write(s+o,"utf8")};Li.prototype.$format=function(e,t,r){let n=typeof e;if(n==="function"||n==="undefined")return"";return Y6(e,!1,t,r)};function i1(e){let t={inspect:function(){return e}};if(o1.inspect.custom)t[o1.inspect.custom]=t.inspect;return t}function Zpe(e){return Y6(e,!0)}function e0e(e,t){e[t]=i1('ObjectId("'+e[t].toHexString()+'")')}function t0e(e,t,r){if(r)e[t]=i1('ISODate("'+e[t].toUTCString()+'")');else e[t]=i1('new Date("'+e[t].toUTCString()+'")')}function Y6(e,t,r,n){if(typeof e?.toBSON==="function")e=e.toBSON();if(e==null)return e;let s=Zt(),i=t?e:s(e,Qpe),o=$k(i);if(o==="Binary")i="BinData("+i.sub_type+', "'+i.toString("base64")+'")';else if(o==="ObjectId")i=i1('ObjectId("'+i.toHexString()+'")');else if(o==="Date")i=i1('new Date("'+i.toUTCString()+'")');else if(o==="Object"){let u=Object.keys(i),a=u.length,c;for(let l=0;l<a;++l)if(c=u[l],i[c]){let f;if(typeof i[c].toBSON==="function")try{i[c]=i[c].toBSON()}catch(d){f=d}let h=$k(i[c]);if(h==="Binary")i[c]="BinData("+i[c].sub_type+', "'+i[c].buffer.toString("base64")+'")';else if(h==="Object")i[c]=Y6(i[c],!0);else if(h==="ObjectId")e0e(i,c);else if(h==="Date")t0e(i,c,n);else if(h==="ClientSession")i[c]=i1('ClientSession("'+(i[c]?.id?.id?.buffer||"").toString("hex")+'")');else if(Array.isArray(i[c]))i[c]=i[c].map(Zpe);else if(f!=null)throw f}}if(t)return i;return o1.inspect(i,!1,10,r).replace(/\n/g,"").replace(/\s{2,}/g," ")}Li.prototype.getIndexes=Li.prototype.indexInformation;/*!
39
- * Module exports.
40
- */kk.exports=Li});var J6=g(function(fDe,Uk){/*!
41
- * Module dependencies.
42
- */var r0e=G("events").EventEmitter,tf=Le();/*!
43
- * ignore
44
- */var jk=["close","change","end","error","resumeTokenChanged"];/*!
45
- * ignore
46
- */class Lk extends r0e{constructor(e,t,r){super();if(this.driverChangeStream=null,this.closed=!1,this.bindedEvents=!1,this.pipeline=t,this.options=r,this.errored=!1,r?.hydrate&&!r.model)throw Error("Cannot create change stream with `hydrate: true` unless calling `Model.watch()`");this.$driverChangeStreamPromise=e.then((n)=>(this.driverChangeStream=n,setImmediate(()=>this.emit("ready")),this),(n)=>{throw this.errored=!0,this.emit("error",n),n})}_bindEvents(){if(this.bindedEvents)return;if(this.bindedEvents=!0,this.driverChangeStream==null){this.$driverChangeStreamPromise.then(()=>{this.driverChangeStream.on("close",()=>{this.closed=!0}),jk.forEach((e)=>{this.driverChangeStream.on(e,(t)=>{if(t?.fullDocument!=null&&this.options?.hydrate)t.fullDocument=this.options.model.hydrate(t.fullDocument);this.emit(e,t)})})},()=>{});return}this.driverChangeStream.on("close",()=>{this.closed=!0}),jk.forEach((e)=>{this.driverChangeStream.on(e,(t)=>{if(t?.fullDocument!=null&&this.options?.hydrate)t.fullDocument=this.options.model.hydrate(t.fullDocument);this.emit(e,t)})})}hasNext(e){if(this.errored)throw new tf("Cannot call hasNext() on errored ChangeStream");if(this.driverChangeStream!=null)return this.driverChangeStream.hasNext(e);return this.$driverChangeStreamPromise.then(()=>this.driverChangeStream.hasNext(e),(t)=>{if(e!=null)return e(t);throw t})}next(e){if(this.errored)throw new tf("Cannot call next() on errored ChangeStream");if(this.options?.hydrate){if(e!=null){let r=e;e=(n,s)=>{if(n!=null)return r(n);if(s.fullDocument!=null)s.fullDocument=this.options.model.hydrate(s.fullDocument);return r(null,s)}}let t;if(this.driverChangeStream!=null)t=this.driverChangeStream.next(e);else t=this.$driverChangeStreamPromise.then(()=>this.driverChangeStream.next(e),(r)=>{if(e!=null)return e(r);throw r});if(typeof t?.then==="function")t=t.then((r)=>{if(r.fullDocument!=null)r.fullDocument=this.options.model.hydrate(r.fullDocument);return r});return t}if(this.driverChangeStream!=null)return this.driverChangeStream.next(e);return this.$driverChangeStreamPromise.then(()=>this.driverChangeStream.next(e),(t)=>{if(e!=null)return e(t);throw t})}addListener(e,t){if(this.errored)throw new tf("Cannot call addListener() on errored ChangeStream");return this._bindEvents(),super.addListener(e,t)}on(e,t){if(this.errored)throw new tf("Cannot call on() on errored ChangeStream");return this._bindEvents(),super.on(e,t)}once(e,t){if(this.errored)throw new tf("Cannot call once() on errored ChangeStream");return this._bindEvents(),super.once(e,t)}close(){if(this.closed=!0,this.driverChangeStream)return this.driverChangeStream.close();else return this.$driverChangeStreamPromise.then(()=>this.driverChangeStream.close(),()=>{})}}/*!
47
- * ignore
48
- */Uk.exports=Lk});var Ha=g(function(dDe,zk){function tt(){this._pres=new Map,this._posts=new Map}tt.skipWrappedFunction=function(){if(!(this instanceof tt.skipWrappedFunction))return new tt.skipWrappedFunction(...arguments);this.args=[...arguments]};tt.overwriteResult=function(){if(!(this instanceof tt.overwriteResult))return new tt.overwriteResult(...arguments);this.args=[...arguments]};tt.overwriteArguments=function(){if(!(this instanceof tt.overwriteArguments))return new tt.overwriteArguments(...arguments);this.args=[...arguments]};tt.prototype.execPre=async function(t,r,n,s){let i=this._pres.get(t)||[];if(s?.filter)i=i.filter(s.filter);let o=i.length,u=n,a=null;if(!o)return u;for(let c of i)try{let l=c.fn.apply(r,u);if(Q6(l)){let f=await l;if(f instanceof tt.overwriteArguments)u=f.args}else if(l instanceof tt.overwriteArguments)u=l.args}catch(l){if(l instanceof tt.skipWrappedFunction){a=l;continue}if(l instanceof tt.overwriteArguments){u=l.args;continue}throw l}if(a)throw a;return u};tt.prototype.execPreSync=function(e,t,r,n){let s=this._pres.get(e)||[];if(n?.filter)s=s.filter(n.filter);let i=s.length,o=r||[];for(let u=0;u<i;++u){let a=s[u].fn.apply(t,o);if(a instanceof tt.overwriteArguments)o=a.args}return o};tt.prototype.execPost=async function(t,r,n,s){let i=this._posts.get(t)||[];if(s?.filter)i=i.filter(s.filter);let o=i.length,u=null;if(s&&s.error)u=s.error;if(!o){if(u!=null)throw u;return n}let a=null,c,l,f=function(_){if(_)l(_);else c()},h=n.slice();Pm(h,s?.numCallbackParams);let d=h.length;h.push(f);let p=s?.error?[u,...h]:null;for(let m of i){let _=m.fn;if(a=new Promise((y,E)=>{c=y,l=E}),u)if(Vk(m,d))try{let y=_.apply(r,p);if(Q6(y))await y;else if(_.length===d+2)await a}catch(y){if(y instanceof tt.overwriteResult){n=y.args,h=n.slice(),Pm(h,s?.numCallbackParams),d=h.length,h.push(f);continue}u=y,p=[u,...h]}else continue;else if(Vk(m,d))continue;else{let y=null;try{if(y=_.apply(r,h),Q6(y))y=await y;else if(_.length===d+1)y=await a}catch(E){if(E instanceof tt.overwriteResult){n=E.args,h=n.slice(),Pm(h,s?.numCallbackParams),d=h.length,h.push(f),p=[u,...h];continue}u=E,p=[u,...h];continue}if(y instanceof tt.overwriteResult){n=y.args,h=n.slice(),Pm(h,s?.numCallbackParams),d=h.length,h.push(f);continue}}}if(u!=null)throw u;return n};/*!
49
- * Handle the `numCallbackParams` option for `execPostSync`: fill `newArgs` with `null` until
50
- * length is `numCallbackParams` if `numCallbackParams` is a number.
51
- *
52
- * @param {Array} newArgs The arguments to fill
53
- * @param {number|null|undefined} numCallbackParams The number of callback parameters
54
- */function Pm(e,t){if(typeof t==="number"&&t>e.length)for(let r=e.length;r<t;++r)e.push(null)}tt.prototype.execPostSync=function(e,t,r,n){let s=this._posts.get(e)||[];if(n?.filter)s=s.filter(n.filter);let i=s.length;for(let o=0;o<i;++o){let u=s[o].fn.apply(t,r||[]);if(u instanceof tt.overwriteResult)r=u.args}return r};tt.prototype.createWrapperSync=function(e,t,r,n){let s=this,i=n?.getOptions;return function(...u){let a=r??this,c=typeof i==="function"?i(u):{},l=c.pre??c,f=c.post??c,h=s.execPreSync(e,a,u,l),d=t.apply(a,h);return s.execPostSync(e,a,[d],f)[0]}};tt.prototype.wrap=async function(t,r,n,s,i){let o=i?.getOptions,u=typeof o==="function"?o(s):{},a=u.pre??u,c=u.post??u,l,f=!1,h=s;try{h=await this.execPre(t,n,s,a)}catch(d){if(d instanceof tt.skipWrappedFunction)l=d.args,f=!0;else await this.execPost(t,n,s,{...i,...c,error:d})}if(!f)l=await r.apply(n,h);return l=await this.execPost(t,n,[l],{...i,...c}),l[0]};tt.prototype.filter=function(e){let t=this.clone(),r=Array.from(t._pres.keys());for(let s of r){let i=this._pres.get(s).map((o)=>Object.assign({},o,{name:s})).filter(e);if(i.length===0){t._pres.delete(s);continue}t._pres.set(s,i)}let n=Array.from(t._posts.keys());for(let s of n){let i=this._posts.get(s).map((o)=>Object.assign({},o,{name:s})).filter(e);if(i.length===0){t._posts.delete(s);continue}t._posts.set(s,i)}return t};tt.prototype.hasHooks=function(e){return this._pres.has(e)||this._posts.has(e)};tt.prototype.createWrapper=function(e,t,r,n){let s=this;if(!this.hasHooks(e))return t;return function(...o){let u=r??this;return s.wrap(e,t,u,o,n)}};tt.prototype.pre=function(e,t,r,n,s){if(typeof t==="function")r=t,t={};else if(t==null)t={};let i=this._pres.get(e)||[];if(this._pres.set(e,i),typeof r!=="function")throw Error('pre() requires a function, got "'+typeof r+'"');if(s)i.unshift(Object.assign({},t,{fn:r}));else i.push(Object.assign({},t,{fn:r}));return this};tt.prototype.post=function(e,t,r,n){let s=this._posts.get(e)||[];if(typeof t==="function")n=!!r,r=t,t={};if(typeof r!=="function")throw Error('post() requires a function, got "'+typeof r+'"');if(n)s.unshift(Object.assign({},t,{fn:r}));else s.push(Object.assign({},t,{fn:r}));return this._posts.set(e,s),this};tt.prototype.postError=function(t,r,n,s){if(typeof r==="function")s=!!n,n=r,r={};return this.post(t,{...r,errorHandler:!0},n,s)};tt.prototype.clone=function(){let e=new tt;for(let t of this._pres.keys()){let r=this._pres.get(t).slice();e._pres.set(t,r)}for(let t of this._posts.keys())e._posts.set(t,this._posts.get(t).slice());return e};tt.prototype.merge=function(e,t){t=arguments.length===1?!0:t;let r=t?this.clone():this;for(let n of e._pres.keys()){let s=r._pres.get(n)||[],i=e._pres.get(n).filter((u)=>s.map((a)=>a.fn).indexOf(u.fn)===-1),o=s.concat(i);r._pres.set(n,o)}for(let n of e._posts.keys()){let s=r._posts.get(n)||[],i=e._posts.get(n).filter((o)=>s.indexOf(o)===-1);r._posts.set(n,s.concat(i))}return r};function Q6(e){return typeof e==="object"&&e!==null&&typeof e.then==="function"}function Vk(e,t){if(e.errorHandler)return!0;return e.fn.length===t+2}zk.exports=tt});var Z6=g(function(pDe,Hk){var n0e=/^\d+$/;class X6{constructor(){this.children=new Map,this.terminal=!1,this.hasWildcard=!1}}class Wk{constructor(e){if(this.root=new X6,e!=null)for(let t of e)this.add(t)}add(e){if(e.indexOf(".")===-1){this._addSegment(this.root,e).terminal=!0;return}let t=this.root;for(let r of e.split("."))t=this._addSegment(t,r);t.terminal=!0}_addSegment(e,t){let r=e.children.get(t);if(r==null){if(r=new X6,e.children.set(t,r),t==="$*")e.hasWildcard=!0}return r}matchesPathOrAncestor(e){return this._walk(e)===!0}overlapsPath(e){return this._walk(e)!==!1}_walk(e){if(typeof e==="string"){let r=[],n=this.root.children.get(e);if(n!=null){if(n.terminal)return!0;r.push(n)}if(this.root.hasWildcard){let s=this.root.children.get("$*");if(s.terminal)return!0;r.push(s)}return r.length===0?!1:r}let t=[this.root];for(let r of e){let n=[],s=n0e.test(r);for(let i of t){if(s)n.push(i);let o=i.children.get(r);if(o!=null){if(o.terminal)return!0;n.push(o)}if(i.hasWildcard){let u=i.children.get("$*");if(u.terminal)return!0;n.push(u)}}if(n.length===0)return!1;t=n}return t}}Hk.exports=Wk});var Yk=g(function(mDe,Gk){class Kk{constructor(e){this.paths=[],this.schemaTypes=[],this.defaultsByNestedPath=new Map;for(let t of Object.keys(e.paths)){let r=e.paths[t];if(r.defaultValue===void 0)continue;let n=r.splitPath();if(n[n.length-1]==="$*")continue;this.paths.push(t),this.schemaTypes.push(r);let s="";for(let i=0;i<n.length-1;++i){if(s=i===0?n[0]:s+"."+n[i],e.nested[s]!==!0)continue;let o=this.defaultsByNestedPath.get(s);if(o==null)o={paths:[],schemaTypes:[],depth:i+1},this.defaultsByNestedPath.set(s,o);o.paths.push(t),o.schemaTypes.push(r)}}}}Gk.exports=Kk});var Xk=g(function(Jk,Qk){var _n=Qk.exports=Jk={};_n.DocumentNotFoundError=null;_n.general={};_n.general.default="Validator failed for path `{PATH}` with value `{VALUE}`";_n.general.required="Path `{PATH}` is required.";_n.general.allowNull="Path `{PATH}` does not allow null values.";_n.Number={};_n.Number.min="Path `{PATH}` ({VALUE}) is less than minimum allowed value ({MIN}).";_n.Number.max="Path `{PATH}` ({VALUE}) is more than maximum allowed value ({MAX}).";_n.Number.enum="`{VALUE}` is not a valid enum value for path `{PATH}`.";_n.Date={};_n.Date.min="Path `{PATH}` ({VALUE}) is before minimum allowed value ({MIN}).";_n.Date.max="Path `{PATH}` ({VALUE}) is after maximum allowed value ({MAX}).";_n.String={};_n.String.enum="`{VALUE}` is not a valid enum value for path `{PATH}`.";_n.String.match="Path `{PATH}` is invalid ({VALUE}).";_n.String.minlength="Path `{PATH}` (`{VALUE}`, length {LENGTH}) is shorter than the minimum allowed length ({MINLENGTH}).";_n.String.maxlength="Path `{PATH}` (`{VALUE}`, length {LENGTH}) is longer than the maximum allowed length ({MAXLENGTH})."});var kn=g(function(yDe,rq){/*!
55
- * Module dependencies.
56
- */var s0e=Le(),tq=G("util");class r3 extends s0e{constructor(e,t,r,n,s){if(arguments.length>0){let i=Zk(t),o=eq(s),u=e3(null,e,t,r,o,i,n);super(u);this.init(e,t,r,n,s)}else super(e3())}toJSON(){return{stringValue:this.stringValue,valueType:this.valueType,kind:this.kind,value:this.value,path:this.path,reason:this.reason,name:this.name,message:this.message}}init(e,t,r,n,s){/*!
57
- * ignore
58
- */this.stringValue=t3(t),this.messageFormat=eq(s),this.kind=e,this.value=t,this.path=r,this.reason=n,this.valueType=Zk(t)}copy(e){this.messageFormat=e.messageFormat,this.stringValue=e.stringValue,this.kind=e.kind,this.value=e.value,this.path=e.path,this.reason=e.reason,this.message=e.message,this.valueType=e.valueType}setModel(e){/*!
59
- * ignore
60
- */this.message=e3(e,this.kind,this.value,this.path,this.messageFormat,this.valueType,this.reason)}}Object.defineProperty(r3.prototype,"name",{value:"CastError"});function t3(e){let t=tq.inspect(e);if(t=t.replace(/^'|'$/g,'"'),!t.startsWith('"'))t='"'+t+'"';return t}function Zk(e){if(e==null)return""+e;let t=typeof e;if(t!=="object")return t;if(typeof e.constructor!=="function")return t;return e.constructor.name}function eq(e){let t=e?._castErrorMessage||null;if(typeof t==="string"||typeof t==="function")return t}/*!
61
- * ignore
62
- */function e3(e,t,r,n,s,i,o){if(typeof s==="string"){let u=t3(r),a=s.replace("{KIND}",t).replace("{VALUE}",u).replace("{PATH}",n);if(e!=null)a=a.replace("{MODEL}",e.modelName);return a}else if(typeof s==="function")return s(r,n,e,t);else{let u=t3(r),a=i?" (type "+i+")":"",c="Cast to "+t+" failed for value "+u+a+' at path "'+n+'"';if(e!=null)c+=' for model "'+e.modelName+'"';if(o!=null&&typeof o.constructor==="function"&&o.constructor.name!=="AssertionError"&&o.constructor.name!=="Error"&&o.constructor.name!=="BSONError")c+=' because of "'+o.constructor.name+'"';return c}}/*!
63
- * exports
64
- */rq.exports=r3});var Bm=g(function(gDe,sq){/*!
65
- * Module dependencies.
66
- */var n3=Le(),nq=G("util");class s3 extends n3{constructor(e,t,r,n){let s,i=n3.messages;if(i.DocumentNotFoundError!=null)s=typeof i.DocumentNotFoundError==="function"?i.DocumentNotFoundError(e,t):i.DocumentNotFoundError;else s='No document found for query "'+nq.inspect(e)+'" on model "'+t+'"';super(s);this.result=n,this.numAffected=r,this.filter=e,this.query=e}}Object.defineProperty(s3.prototype,"name",{value:"DocumentNotFoundError"});/*!
67
- * exports
68
- */sq.exports=s3});var i3=g(function(_De,iq){/*!
69
- * ignore
70
- */iq.exports=function(t){let r=Object.keys(t.errors||{}),n=r.length,s=[],i;for(let o=0;o<n;++o){if(i=r[o],t===t.errors[i])continue;s.push(i+": "+t.errors[i].message)}return s.join(", ")}});var Ga=g(function(EDe,uq){/*!
71
- * Module requirements
72
- */var i0e=Le(),o0e=$n(),Fm=G("util"),oq=i3();class Ka extends i0e{constructor(e){let t;if(o0e(e)==="model")t=e.constructor.modelName+" validation failed";else t="Validation failed";super(t);if(this.errors={},this._message=t,e)e.$errors=this.errors}toString(){return this.name+": "+oq(this)}addError(e,t){if(t instanceof Ka){let{errors:r}=t;for(let n of Object.keys(r))this.addError(`${e}.${n}`,r[n]);return}this.errors[e]=t,this.message=this._message+": "+oq(this)}}if(Fm.inspect.custom)Ka.prototype[Fm.inspect.custom]=Ka.prototype.inspect;Object.defineProperty(Ka.prototype,"toJSON",{enumerable:!1,writable:!1,configurable:!0,value:function(){return Object.assign({},this,{name:this.name,message:this.message})}});Object.defineProperty(Ka.prototype,"name",{value:"ValidationError"});/*!
73
- * Module exports
74
- */uq.exports=Ka});var u3=g(function(ADe,lq){/*!
75
- * Module dependencies.
76
- */var o3=Le(),aq=G("util");class rf extends o3{constructor(e,t){let r=e.message;if(!r)r=o3.messages.general.default;let n=cq(r,e,t);super(n);e=Object.assign({},e,{message:n}),this.properties=e,this.kind=e.type,this.path=e.path,this.value=e.value,this.reason=e.reason}toString(){return this.message}toJSON(){return Object.assign({name:this.name,message:this.message},this)}}Object.defineProperty(rf.prototype,"name",{value:"ValidatorError"});Object.defineProperty(rf.prototype,"properties",{enumerable:!1,writable:!0,value:null});rf.prototype.formatMessage=cq;function cq(e,t,r){if(typeof e==="function")return e(t,r);let n=Object.keys(t);for(let s of n){if(s==="message")continue;let i="{"+s.toUpperCase()+"}";if(!e.includes(i))continue;let o;try{o=String(t[s])}catch{o=aq.inspect(t[s])}e=e.replace(i,o)}return e}/*!
77
- * exports
78
- */lq.exports=rf});var c3=g(function(ODe,hq){/*!
79
- * Module dependencies.
80
- */var u0e=Le();class a3 extends u0e{constructor(e,t,r){let n=r.join(", ");super('No matching document found for id "'+e._doc._id+'" version '+t+' modifiedPaths "'+n+'"');this.version=t,this.modifiedPaths=r}}Object.defineProperty(a3.prototype,"name",{value:"VersionError"});/*!
81
- * exports
82
- */hq.exports=a3});var h3=g(function(SDe,fq){/*!
83
- * Module dependencies.
84
- */var a0e=Le();class l3 extends a0e{constructor(e){super("Can't save() the same doc multiple times in parallel. Document: "+e._doc._id)}}Object.defineProperty(l3.prototype,"name",{value:"ParallelSaveError"});/*!
85
- * exports
86
- */fq.exports=l3});var d3=g(function(wDe,dq){/*!
87
- * Module dependencies.
88
- */var c0e=Le();class f3 extends c0e{constructor(e){super("Cannot overwrite `"+e+"` model once compiled.")}}Object.defineProperty(f3.prototype,"name",{value:"OverwriteModelError"});/*!
89
- * exports
90
- */dq.exports=f3});var mq=g(function(CDe,pq){/*!
91
- * Module dependencies.
92
- */var l0e=Le();class p3 extends l0e{constructor(e){let t=`Schema hasn't been registered for model "`+e+`".
93
- Use mongoose.model(name, schema)`;super(t)}}Object.defineProperty(p3.prototype,"name",{value:"MissingSchemaError"});/*!
94
- * exports
95
- */pq.exports=p3});var y3=g(function(bDe,yq){/*!
96
- * Module dependencies.
97
- */var h0e=Le();class m3 extends h0e{constructor(e,t,r){let n=r?.matchedCount??0,s=r?.insertedCount??0,i=t.map((u)=>u._id).join(", ");if(i.length>100)i=i.slice(0,100)+"...";let o=t.length-n-s;super(`${e}.bulkSave() was not able to update ${o} of the given documents due to incorrect version or optimistic concurrency, document ids: ${i}`);this.modelName=e,this.documents=t,this.bulkWriteResult=r,this.numDocumentsNotUpdated=o}}Object.defineProperty(m3.prototype,"name",{value:"MongooseBulkSaveIncompleteError"});/*!
98
- * exports
99
- */yq.exports=m3});var _q=g(function(DDe,gq){var f0e=$n();gq.exports=function(t){if(f0e(t)!=="TopologyDescription")return!1;let r=Array.from(t.servers.values());return r.length>0&&r.every((n)=>n.type==="Unknown")}});var Aq=g(function(TDe,Eq){var d0e=$n();Eq.exports=function(t){if(d0e(t)!=="TopologyDescription")return!1;if(t.servers.size===0)return!1;for(let r of t.servers.values())if(r.host.endsWith(".mongodb.net")===!1||r.port!==27017)return!1;return!0}});var Sq=g(function(MDe,Oq){var p0e=$n(),m0e="Client network socket disconnected before secure TLS connection was established";Oq.exports=function(t){if(p0e(t)!=="TopologyDescription")return!1;let r=Array.from(t.servers.values());return r.length>0&&r.every((n)=>n.error&&n.error.message.indexOf(m0e)!==-1)}});var _3=g(function(xDe,wq){/*!
100
- * Module dependencies.
101
- */var y0e=Le(),g0e=_q(),_0e=Aq(),E0e=Sq();/*!
102
- * ignore
103
- */var A0e="Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you're trying to access the database from an IP that isn't whitelisted. Make sure your current IP address is on your Atlas cluster's IP whitelist: https://www.mongodb.com/docs/atlas/security-whitelist/",O0e="Mongoose is connecting with SSL enabled, but the server is not accepting SSL connections. Please ensure that the MongoDB server you are connecting to is configured to accept SSL connections. Learn more: https://mongoosejs.com/docs/tutorials/ssl.html";class g3 extends y0e{assimilateError(e){let t=e.reason;if(_0e(t)&&g0e(t)&&e.message.indexOf("bad auth")===-1&&e.message.indexOf("Authentication failed")===-1)this.message=A0e;else if(E0e(t))this.message=O0e;else this.message=e.message;for(let n in e)if(n!=="name")this[n]=e[n];return this.cause=t,this}}Object.defineProperty(g3.prototype,"name",{value:"MongooseServerSelectionError"});wq.exports=g3});var A3=g(function(PDe,Cq){/*!
104
- * Module dependencies.
105
- */var S0e=Le();class E3 extends S0e{constructor(e){let t="For your own good, using `document.save()` to update an array which was selected using an $elemMatch or $slice projection OR populated using skip, limit, query conditions, or exclusion of the _id field when the operation results in a $pop or $set of the entire array is not supported. The following path(s) would have been modified unsafely:\n "+e.join(`
106
- `)+`
107
- Use Model.updateOne() to update these arrays instead. See https://mongoosejs.com/docs/faq.html#divergent-array-error for more information.`;super(t)}}Object.defineProperty(E3.prototype,"name",{value:"DivergentArrayError"});/*!
108
- * exports
109
- */Cq.exports=E3});var fa=g(function(BDe,bq){/*!
110
- * Module dependencies.
111
- */var w0e=Le();class O3 extends w0e{constructor(e,t,r){t=t||"Field `"+e+"` is not in schema and strict mode is set to throw.";super(t);this.isImmutableError=!!r,this.path=e}}Object.defineProperty(O3.prototype,"name",{value:"StrictModeError"});bq.exports=O3});var w3=g(function(FDe,Dq){/*!
112
- * Module dependencies.
113
- */var C0e=Le();class S3 extends C0e{constructor(e,t){t=t||"Cannot populate path `"+e+"` because it is not in your schema. Set the `strictPopulate` option to false to override.";super(t);this.path=e}}Object.defineProperty(S3.prototype,"name",{value:"StrictPopulateError"});Dq.exports=S3});var $s=g(function(Tq,Mq){var rn=Le();/*!
114
- * Module exports.
115
- */Mq.exports=Tq=rn;rn.messages=Xk();rn.Messages=rn.messages;rn.CastError=kn();rn.DocumentNotFoundError=Bm();rn.ValidationError=Ga();rn.ValidatorError=u3();rn.VersionError=c3();rn.ParallelSaveError=h3();rn.OverwriteModelError=d3();rn.MissingSchemaError=mq();rn.MongooseBulkSaveIncompleteError=y3();rn.MongooseServerSelectionError=_3();rn.DivergentArrayError=A3();rn.StrictModeError=fa();rn.StrictPopulateError=w3()});var vs=g(function(NDe,xq){xq.exports=Object.freeze({enumerable:!0,configurable:!0,writable:!0,value:void 0})});var As=g(function(IDe,Pq){var b0e=Zt();class En{constructor(e){if(e==null)return this;Object.assign(this,b0e(e))}}var Xn=vs();Object.defineProperty(En.prototype,"type",Xn);Object.defineProperty(En.prototype,"validate",Xn);Object.defineProperty(En.prototype,"cast",Xn);Object.defineProperty(En.prototype,"required",Xn);Object.defineProperty(En.prototype,"allowNull",Xn);Object.defineProperty(En.prototype,"default",Xn);Object.defineProperty(En.prototype,"ref",Xn);Object.defineProperty(En.prototype,"refPath",Xn);Object.defineProperty(En.prototype,"select",Xn);Object.defineProperty(En.prototype,"index",Xn);Object.defineProperty(En.prototype,"unique",Xn);Object.defineProperty(En.prototype,"immutable",Xn);Object.defineProperty(En.prototype,"sparse",Xn);Object.defineProperty(En.prototype,"text",Xn);Object.defineProperty(En.prototype,"transform",Xn);Pq.exports=En});var Nm=g(function(RDe,u1){var D0e=kn();u1.exports=function(t,r){if(u1.exports.convertToTrue.has(t))return!0;if(u1.exports.convertToFalse.has(t))return!1;if(t==null)return t;throw new D0e("boolean",t,r)};u1.exports.convertToTrue=new Set([!0,"true",1,"1","yes"]);u1.exports.convertToFalse=new Set([!1,"false",0,"0","no"])});var Im=g(function($De,Bq){var T0e=Nm();/*!
116
- * ignore
117
- */Bq.exports=function(e){let t=this?.path??null;return T0e(e,t)}});var C3=g(function(vDe,Fq){/*!
118
- * ignore
119
- */Fq.exports=function(e){if(Array.isArray(e)){if(!e.every((t)=>typeof t==="number"||typeof t==="string"))throw Error("$type array values must be strings or numbers");return e}if(typeof e!=="number"&&typeof e!=="string")throw Error("$type parameter must be number, string, or array of numbers and strings");return e}});var yi=g(function(kDe,Nq){Nq.exports=function(t,r){for(let n=t;n!=null&&n!==Object.prototype;n=Object.getPrototypeOf(n))if(Object.hasOwn(n,r))return n[r];return}});var Rq=g(function(qDe,Iq){var M0e=fa();/*!
120
- * ignore
121
- */Iq.exports=function(e){if(e.$immutable)e.$immutableSetter=x0e(e.path,e.options.immutable),e.set(e.$immutableSetter);else if(e.$immutableSetter)e.setters=e.setters.filter((t)=>t!==e.$immutableSetter),delete e.$immutableSetter};function x0e(e,t){return function(n,s,i,o){if(this==null||this.$__==null)return n;if(this.isNew)return n;if(o?.overwriteImmutable)return n;if(!(typeof t==="function"?t.call(this,this):t))return n;let a=this.$__.priorDoc!=null?this.$__.priorDoc.$__getValue(e):this.$__getValue(e);if(this.$__.strictMode==="throw"&&n!==a)throw new M0e(e,"Path `"+e+"` is immutable and strict mode is set to throw.",!0);return a}}});var vq=g(function(jDe,$q){$q.exports=function(t){return typeof t==="function"&&t.constructor&&t.constructor.name==="AsyncFunction"}});var qq=g(function(LDe,kq){kq.exports=function(t){let r=Object.keys(t),n=!0;for(let s=0,i=r.length;s<i;++s)if(typeof t[r[s]]==="object"&&t[r[s]]!==null){n=!1;break}return n}});var Lq=g(function(UDe,jq){var a1=1000,c1=a1*60,l1=c1*60,Ya=l1*24,P0e=Ya*7,B0e=Ya*365.25;jq.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return F0e(e);else if(r==="number"&&isFinite(e))return t.long?I0e(e):N0e(e);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function F0e(e){if(e=String(e),e.length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*B0e;case"weeks":case"week":case"w":return r*P0e;case"days":case"day":case"d":return r*Ya;case"hours":case"hour":case"hrs":case"hr":case"h":return r*l1;case"minutes":case"minute":case"mins":case"min":case"m":return r*c1;case"seconds":case"second":case"secs":case"sec":case"s":return r*a1;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}function N0e(e){var t=Math.abs(e);if(t>=Ya)return Math.round(e/Ya)+"d";if(t>=l1)return Math.round(e/l1)+"h";if(t>=c1)return Math.round(e/c1)+"m";if(t>=a1)return Math.round(e/a1)+"s";return e+"ms"}function I0e(e){var t=Math.abs(e);if(t>=Ya)return Rm(e,t,Ya,"day");if(t>=l1)return Rm(e,t,l1,"hour");if(t>=c1)return Rm(e,t,c1,"minute");if(t>=a1)return Rm(e,t,a1,"second");return e+" ms"}function Rm(e,t,r,n){var s=t>=r*1.5;return Math.round(e/r)+" "+n+(s?"s":"")}});var Vq=g(function(VDe,Uq){Uq.exports=function(t){let r=[],n="",s="DEFAULT";for(let i=0;i<t.length;++i){if(s==="IN_SQUARE_BRACKETS"&&!/\d/.test(t[i])&&t[i]!=="]")s="DEFAULT",n=r[r.length-1]+"["+n,r.splice(r.length-1,1);if(t[i]==="["){if(s!=="IMMEDIATELY_AFTER_SQUARE_BRACKETS")r.push(n),n="";s="IN_SQUARE_BRACKETS"}else if(t[i]==="]")if(s==="IN_SQUARE_BRACKETS")s="IMMEDIATELY_AFTER_SQUARE_BRACKETS",r.push(n),n="";else s="DEFAULT",n+=t[i];else if(t[i]==="."){if(s!=="IMMEDIATELY_AFTER_SQUARE_BRACKETS")r.push(n),n="";s="DEFAULT"}else n+=t[i]}if(s!=="IMMEDIATELY_AFTER_SQUARE_BRACKETS")r.push(n);return r}});var Gq=g(function(R0e){var nf=Vq(),Wq=["__proto__","constructor","prototype"];R0e.get=function(e,t,r,n){var s;if(typeof r=="function")if(r.length<2)n=r,r=void 0;else s=r,r=void 0;n||(n=Kq);var i=typeof e=="string"?nf(e):e;if(!Array.isArray(i))throw TypeError("Invalid `path`. Must be either string or array");var o=t,u;for(var a=0;a<i.length;++a){if(u=i[a],typeof i[a]!=="string"&&typeof i[a]!=="number")throw TypeError("Each segment of path to `get()` must be a string or number, got "+typeof i[a]);if(Array.isArray(o)&&!/^\d+$/.test(u)){var c=i.slice(a);return[].concat(o).map(function(f){return f?R0e.get(c,f,r||s,n):n(void 0)})}if(s)o=s(o,u);else{var l=r&&o[r]?o[r]:o;o=l instanceof Map?l.get(u):l[u]}if(!o)return n(o)}return n(o)};R0e.has=function(e,t){var r=typeof e==="string"?nf(e):e;if(!Array.isArray(r))throw TypeError("Invalid `path`. Must be either string or array");var n=r.length,s=t;for(var i=0;i<n;++i){if(typeof r[i]!=="string"&&typeof r[i]!=="number")throw TypeError("Each segment of path to `has()` must be a string or number, got "+typeof r[i]);if(s==null||typeof s!=="object"||!(r[i]in s))return!1;s=s[r[i]]}return!0};R0e.unset=function(e,t){var r=typeof e==="string"?nf(e):e;if(!Array.isArray(r))throw TypeError("Invalid `path`. Must be either string or array");var n=r.length,s=t;for(var i=0;i<n;++i){if(s==null||typeof s!=="object"||!(r[i]in s))return!1;if(typeof r[i]!=="string"&&typeof r[i]!=="number")throw TypeError("Each segment of path to `unset()` must be a string or number, got "+typeof r[i]);if(Wq.indexOf(r[i])!==-1)return!1;if(i===n-1)return delete s[r[i]],!0;s=s instanceof Map?s.get(r[i]):s[r[i]]}return!0};R0e.set=function(e,t,r,n,s,i){var o;if(typeof n=="function")if(n.length<2)s=n,n=void 0;else o=n,n=void 0;s||(s=Kq);var u=typeof e=="string"?nf(e):e;if(!Array.isArray(u))throw TypeError("Invalid `path`. Must be either string or array");if(r==null)return;for(var a=0;a<u.length;++a){if(typeof u[a]!=="string"&&typeof u[a]!=="number")throw TypeError("Each segment of path to `set()` must be a string or number, got "+typeof u[a]);if(Wq.indexOf(u[a])!==-1)return}var c=i||/\$/.test(e)&&i!==!1,l=r,f;for(var a=0,h=u.length-1;a<h;++a){if(f=u[a],f=="$")if(a==h-1)break;else continue;if(Array.isArray(l)&&!/^\d+$/.test(f)){var d=u.slice(a);if(!c&&Array.isArray(t))for(var p=0;p<l.length&&p<t.length;++p)R0e.set(d,t[p],l[p],n||o,s,c);else for(var p=0;p<l.length;++p)R0e.set(d,t,l[p],n||o,s,c);return}if(o)l=o(l,f);else{var m=n&&l[n]?l[n]:l;l=m instanceof Map?m.get(f):m[f]}if(!l)return}if(f=u[h],n&&l[n])l=l[n];if(Array.isArray(l)&&!/^\d+$/.test(f))if(!c&&Array.isArray(t))Hq(l,t,f,o,n,s);else for(var p=0;p<l.length;++p){var _=l[p];if(_)if(o)o(_,f,s(t));else{if(_[n])_=_[n];_[f]=s(t)}}else if(o)o(l,f,s(t));else if(l instanceof Map)l.set(f,s(t));else l[f]=s(t)};/*!
122
- * Split a string path into components delimited by '.' or
123
- * '[\d+]'
124
- *
125
- * #### Example:
126
- * stringToParts('foo[0].bar.1'); // ['foo', '0', 'bar', '1']
127
- */R0e.stringToParts=nf;/*!
128
- * Recursively set nested arrays
129
- */function Hq(e,t,r,n,s,i){for(var o,u=0;u<e.length&&u<t.length;++u)if(o=e[u],Array.isArray(o)&&Array.isArray(t[u]))Hq(o,t[u],r,n,s,i);else if(o)if(n)n(o,r,i(t[u]));else{if(o[s])o=o[s];o[r]=i(t[u])}}/*!
130
- * Returns the value passed to it.
131
- */function Kq(e){return e}});var ks=g(function(Yq,Jq){Jq.exports=Yq=Gq()});var $m=g(function(WDe,Xq){var q0e=Zt();class Qq{constructor(e){if(this._docs={},this._childDocs=[],e==null)return;if(e=q0e(e),Object.assign(this,e),typeof e.subPopulate==="object")this.populate=e.subPopulate;if(e.perDocumentLimit!=null&&e.limit!=null)throw Error("Can not use `limit` and `perDocumentLimit` at the same time. Path: `"+e.path+"`.")}}Xq.exports=Qq});var Zq=g(function(j0e){j0e.isMongooseDocumentArray=function(e){return Array.isArray(e)&&e.isMongooseDocumentArray}});var So=g(function(KDe,ej){ej.exports=function(t){if(t==null||typeof t!=="object")return!1;let r=Object.getPrototypeOf(t);return!r||r.constructor.name==="Object"}});var vm=g(function(GDe,tj){tj.exports=function(t,r,n){let s=Object.keys(r.tree),i={};for(let o of s){if(n&&(t.paths[o]||t.nested[o]||t.singleNestedPaths[o]))continue;i[o]=r.tree[o]}t.options._isMerging=!0,t.add(i,null),delete t.options._isMerging,t.callQueue=t.callQueue.concat(r.callQueue),t.method(r.methods),t.static(r.statics);for(let[o,u]of Object.entries(r._userProvidedOptions))if(!(o in t._userProvidedOptions))t.set(o,u);for(let o in r.query)t.query[o]=r.query[o];for(let o in r.virtuals)t.virtuals[o]=r.virtuals[o].clone();t._indexes=t._indexes.concat(r._indexes||[]),t.s.hooks.merge(r.s.hooks,!1)}});var sj=g(function(rj,nj){/*!
132
- * Module dependencies.
133
- */var YDe=Oe(),gi=nj.exports=rj=function(){};gi.ctor=function(){let e=[...arguments],t=function(){this.paths={},this.states={}};return t.prototype=new gi,t.prototype.constructor=t,t.prototype.stateNames=e,e.forEach(function(r){t.prototype[r]=function(n){this._changeState(n,r)}}),t};gi.prototype._changeState=function(t,r){let n=this.paths[t];if(n===r)return;if(n!==void 0){let i=this.states[n];if(i)delete i[t]}this.paths[t]=r;let s=this.states[r];if(s==null)s=this.states[r]={};s[t]=!0};/*!
134
- * ignore
135
- */gi.prototype.clearAllExcept=function(t){let r=this.states[t],n=r==null?[]:Object.keys(r);if(n.length===0){this.paths={},this.states={};return}this.paths={};for(let s of n)this.paths[s]=t;this.states={[t]:this.states[t]}};/*!
136
- * ignore
137
- */gi.prototype.clear=function(t){if(this.states[t]==null)return;let r=Object.keys(this.states[t]);if(r.length===0)return;this.states[t]={};let n=r.length;while(n--)delete this.paths[r[n]]};/*!
138
- * ignore
139
- */gi.prototype.clearPath=function(t){let r=this.paths[t];if(!r)return;delete this.paths[t],delete this.states[r][t]};gi.prototype.getStatePaths=function(t){if(this.states[t]!=null)return this.states[t];return{}};gi.prototype.some=function(){let t=this,r=arguments.length?arguments:this.stateNames;return Array.prototype.some.call(r,function(n){if(t.states[n]==null)return!1;return Object.keys(t.states[n]).length})};gi.prototype._iter=function(t){return function(){let r=[...arguments],n=r.pop();if(!r.length)r=this.stateNames;let s=this;return r.reduce(function(o,u){if(s.states[u]==null)return o;return o.concat(Object.keys(s.states[u]))},[])[t](function(o,u,a){return n(o,u,a)})}};gi.prototype.forEach=function(){return this.forEach=this._iter("forEach"),this.forEach.apply(this,arguments)};gi.prototype.map=function(){return this.map=this._iter("map"),this.map.apply(this,arguments)};gi.prototype.clone=function(){let t=new this.constructor;t.paths={...this.paths};for(let r of this.stateNames){if(!(r in this.states))continue;t.states[r]=this.states[r]==null?this.states[r]:{...this.states[r]}}return t}});var aj=g(function(oj,uj){/*!
140
- * Dependencies
141
- */var ij=sj(),U0e=ij.ctor("require","modify","init","default","ignore");uj.exports=oj=ir;function ir(){this.activePaths=new U0e}ir.prototype.strictMode=!0;ir.prototype.fullPath=void 0;ir.prototype.selected=void 0;ir.prototype.selectedIndex=void 0;ir.prototype.shardval=void 0;ir.prototype.saveError=void 0;ir.prototype.validationError=void 0;ir.prototype.adhocPaths=void 0;ir.prototype.removing=void 0;ir.prototype.inserting=void 0;ir.prototype.saving=void 0;ir.prototype.version=void 0;ir.prototype._id=void 0;ir.prototype.ownerDocument=void 0;ir.prototype.populate=void 0;ir.prototype.populated=void 0;ir.prototype.primitiveAtomics=void 0;ir.prototype.wasPopulated=!1;ir.prototype.scope=void 0;ir.prototype.session=null;ir.prototype.pathsToScopes=null;ir.prototype.cachedRequired=null});var qm=g(function(JDe,lj){/*!
142
- * Module dependencies.
143
- */var D3=we().Binary,V0e=we().UUID,km=Oe();function Zn(e,t,r){let n=e;if(e==null)n=0;let s,i,o;if(Array.isArray(t))i=t[0],o=t[1];else s=t;let u;if(typeof n==="number"||n instanceof Number)u=Buffer.alloc(n);else u=Buffer.from(n,s,r);return km.decorate(u,Zn.mixin),u.isMongooseBuffer=!0,u[Zn.pathSymbol]=i,u[cj]=o,u._subtype=0,u}var z0e=Symbol.for("mongoose#Buffer#_path"),cj=Symbol.for("mongoose#Buffer#_parent");Zn.pathSymbol=z0e;/*!
144
- * Inherit from Buffer.
145
- */Zn.mixin={_subtype:void 0,_markModified:function(){let e=this[cj];if(e)e.markModified(this[Zn.pathSymbol]);return this},write:function(){let e=Buffer.prototype.write.apply(this,arguments);if(e>0)this._markModified();return e},copy:function(e){let t=Buffer.prototype.copy.apply(this,arguments);if(e?.isMongooseBuffer)e._markModified();return t}};/*!
146
- * Compile other Buffer methods marking this buffer as modified.
147
- */km.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(e){if(!Buffer.prototype[e])return;Zn.mixin[e]=function(){let t=Buffer.prototype[e].apply(this,arguments);return this._markModified(),t}});Zn.mixin.toObject=function(e){let t=typeof e==="number"?e:this._subtype||0;return new D3(Buffer.from(this),t)};Zn.mixin.$toObject=Zn.mixin.toObject;Zn.mixin.toBSON=function(){return new D3(this,this._subtype||0)};Zn.mixin.toUUID=function(){if(this._subtype!==4)throw Error("Cannot convert a Buffer with subtype "+this._subtype+" to a UUID");return new V0e(this)};Zn.mixin.equals=function(e){if(!Buffer.isBuffer(e))return!1;if(this.length!==e.length)return!1;for(let t=0;t<this.length;++t)if(this[t]!==e[t])return!1;return!0};Zn.mixin.subtype=function(e){if(typeof e!=="number")throw TypeError("Invalid subtype. Expected a number");if(this._subtype!==e)this._markModified();this._subtype=e};/*!
148
- * Module exports.
149
- */Zn.Binary=D3;lj.exports=Zn});var fj=g(function(QDe,hj){hj.exports=class{constructor(t,r,n){this.subdocSnapshot=t,this.activePaths=r,this.version=n}}});var jm=g(function(XDe,dj){/*!
150
- * Module dependencies.
151
- */var W0e=Le();class T3 extends W0e{constructor(e,t){let r=Array.isArray(t)?"array":"primitive value";super("Tried to set nested object field `"+e+`\` to ${r} \``+t+"`");this.path=e}}Object.defineProperty(T3.prototype,"name",{value:"ObjectExpectedError"});dj.exports=T3});var Lm=g(function(ZDe,pj){/*!
152
- * Module dependencies.
153
- */var H0e=Le();class M3 extends H0e{constructor(e,t,r){super('Parameter "'+t+'" to '+r+'() must be an object, got "'+(e==null?e:e.toString())+'" (type '+typeof e+")")}}Object.defineProperty(M3.prototype,"name",{value:"ObjectParameterError"});pj.exports=M3});var yj=g(function(eTe,mj){/*!
154
- * Module dependencies.
155
- */var K0e=Le();class x3 extends K0e{constructor(e){super("Can't validate() the same doc multiple times in parallel. Document: "+e._doc._id)}}Object.defineProperty(x3.prototype,"name",{value:"ParallelValidateError"});/*!
156
- * exports
157
- */mj.exports=x3});var P3=g(function(tTe,gj){gj.exports=function(t){let r={},n=Object.keys(t);for(let s of n){if(s.indexOf(".")===-1){r[s]=1;continue}let i=s.split("."),o=i[0];for(let u=0;u<i.length;++u)if(r[o]=1,u+1<i.length)o=o+"."+i[u+1]}return r}});var Ej=g(function(rTe,_j){_j.exports=function(t){if(t==null||typeof t!=="object")return!1;return t.$slice==null&&t.$elemMatch==null&&t.$meta==null&&t.$==null}});var Vm=g(function(nTe,Oj){var Aj=Ej();Oj.exports=function(t,r,n,s,i,o,u){let{paths:a,schemaTypes:c}=t.$__schema._getDefaultsCache(),l=a.length,f=u?.skipParentChangeTracking,h=t.$__.skipId,d=!1;for(let p=0;p<l;++p){let m=a[p],_,y="";if(m==="_id"&&h)continue;let E=c[p];if(typeof E.defaultValue==="function"&&!E.defaultValue.$runBeforeSetters)d=!0;let w=E.splitPath(),b=w.length,A=!1,M=t._doc;if(b===1){if(n===!0){if(m in r)continue}else if(n===!1&&r){let O=E.$isSingleNested||E.$isMongooseDocumentArray;if(m in r&&!Aj(r[m])||O&&s!=null&&s[m])A=!0;else if(s!=null&&!s[m])continue}if(M[m]!==void 0)continue;if(i!=null){if(typeof E.defaultValue==="function"){if(!E.defaultValue.$runBeforeSetters&&i)continue;if(E.defaultValue.$runBeforeSetters&&!i)continue}else if(!i)continue}if(o&&o[m])continue;if(r&&n!==null&&!(n===!0||A))continue;try{_=E.getDefault(t,!1)}catch(O){t.invalidate(m,O);continue}if(typeof _<"u")M[m]=_,Um(t,m,f);continue}for(let O=0;O<b;++O){if(M==null)break;let x=w[O];if(y=y.length?y+"."+x:x,n===!0){if(y in r)break}else if(n===!1&&r&&!A){let v=E.$isSingleNested||E.$isMongooseDocumentArray;if(y in r&&!Aj(r[y])||O===b-1&&v&&s!=null&&s[y])A=!0;else if(s!=null&&!s[y])break}if(O===b-1){if(M[x]!==void 0)break;if(i!=null){if(typeof E.defaultValue==="function"){if(!E.defaultValue.$runBeforeSetters&&i)break;if(E.defaultValue.$runBeforeSetters&&!i)break}else if(!i)continue}if(o&&o[y])break;if(r&&n!==null){if(n===!0){if(m in r)continue;try{_=E.getDefault(t,!1)}catch(v){t.invalidate(m,v);break}if(typeof _<"u")M[x]=_,Um(t,m,f)}else if(A){try{_=E.getDefault(t,!1)}catch(v){t.invalidate(m,v);break}if(typeof _<"u")M[x]=_,Um(t,m,f)}}else{try{_=E.getDefault(t,!1)}catch(v){t.invalidate(m,v);break}if(typeof _<"u")M[x]=_,Um(t,m,f)}}else M=M[x]}}return d};/*!
158
- * ignore
159
- */function Um(e,t,r){if(e.$__.activePaths.default(t),!r&&e.$isSubdocument&&e.$isSingleNested&&e.$parent()!=null)e.$parent().$__.activePaths.default(e.$__pathRelativeToParent(t))}});var zm=g(function(sTe,wj){/*!
160
- * ignore
161
- */wj.exports=function(t,r,n){n=n||{};let s=n.skipDocArrays,i=0;if(!t)return i;for(let o of Object.keys(t.$__.activePaths.getStatePaths("modify"))){if(s){if(t.$__schema.path(o)?.$isMongooseDocumentArray)continue}if(o.startsWith(r+".")){if(t.$__.activePaths.clearPath(o),++i,t.$isSubdocument)Sj(t,o)}}return i};function Sj(e,t,r=new Set){if(r.has(e))throw Error("Infinite subdocument loop: subdoc with _id "+e._id+" is a parent of itself");let n=e.$parent(),s=e.$__pathRelativeToParent(void 0,!1)+"."+t;if(n.$__.activePaths.clearPath(s),n.$isSubdocument)Sj(n,s,r)}});var B3=g(function(iTe,Cj){Cj.exports=function(t,r,n){if(r.has(t))return!0;for(let s of n)if(t.slice(0,s.length)===s&&t.charAt(s.length)===".")return!0;return!1}});var Km=g(function(rme){var G0e=Zt(),Y0e=le().documentSchemaSymbol,J0e=ji().internalToObjectOptions,Q0e=gn(),Hm=Oe(),h1,X0e=le().getSymbol,Wm=le().scopeSymbol,bj=Hm.isPOJO;/*!
162
- * exports
163
- */rme.compile=Dj;rme.defineKey=Tj;var Z0e=Object.freeze({minimize:!0,virtuals:!1,getters:!1,transform:!1}),eme=Object.freeze({noDottedPath:!0});function Dj(e,t,r,n){h1=h1||wo();let s=n.typeKey;for(let i of Object.keys(e)){let o=e[i],a=bj(o)&&Hm.hasOwnKeys(o)&&(!o[s]||s==="type"&&bj(o.type)&&o.type.type)?o:null;Tj({prop:i,subprops:a,prototype:t,prefix:r,options:n})}}function Tj({prop:e,subprops:t,prototype:r,prefix:n,options:s}){h1=h1||wo();let i=(n?n+".":"")+e;n=n||"";let o=n?Object.freeze({}):eme;if(t)Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:function(){if(!this.$__)return;let u=this;if(!this.$__.getters)this.$__.getters={};if(!this.$__.getters[i]){let a=Object.create(h1.prototype,tme(this));if(!n)a.$__[Wm]=this;a.$__.nestedPath=i,Object.defineProperty(a,"schema",{enumerable:!1,configurable:!0,writable:!1,value:r.schema}),Object.defineProperty(a,"$__schema",{enumerable:!1,configurable:!0,writable:!1,value:r.schema}),Object.defineProperty(a,Y0e,{enumerable:!1,configurable:!0,writable:!1,value:r.schema}),Object.defineProperty(a,"toObject",{enumerable:!1,configurable:!0,writable:!1,value:function(){return G0e(u.get(i,null,{virtuals:this&&this.schema&&this.schema.options&&this.schema.options.toObject&&this.schema.options.toObject.virtuals||null}))}}),Object.defineProperty(a,"$__get",{enumerable:!1,configurable:!0,writable:!1,value:function(){return u.get(i,null,{virtuals:this?.schema?.options?.toObject?.virtuals||null})}}),Object.defineProperty(a,"toJSON",{enumerable:!1,configurable:!0,writable:!1,value:function(){return u.get(i,null,{virtuals:this?.schema?.options?.toJSON?.virtuals||null})}}),Object.defineProperty(a,"$__isNested",{enumerable:!1,configurable:!0,writable:!1,value:!0}),Object.defineProperty(a,"$isEmpty",{enumerable:!1,configurable:!0,writable:!1,value:function(){return Object.keys(this.get(i,null,Z0e)||{}).length===0}}),Object.defineProperty(a,"$__parent",{enumerable:!1,configurable:!0,writable:!1,value:this}),Dj(t,a,i,s),this.$__.getters[i]=a}return this.$__.getters[i]},set:function(u){if(Q0e(u)&&u.$__isNested)u=u.$__get();else if(u instanceof h1&&!u.$__isNested)u=u.$toObject(J0e);(this.$__[Wm]||this).$set(i,u)}});else Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:function(){return this[X0e].call(this.$__[Wm]||this,i,null,o)},set:function(u){this.$set.call(this.$__[Wm]||this,i,u)}})}function tme(e){let t={};return Object.getOwnPropertyNames(e).forEach(function(r){if(["isNew","$__","$errors","errors","_doc","$locals","$op","__parentArray","__index","$isDocumentArrayElement"].indexOf(r)===-1)return;t[r]=Object.getOwnPropertyDescriptor(e,r),t[r].enumerable=!1}),t}});var xj=g(function(uTe,Mj){Mj.exports=function(t){if(t==null)return null;return Object.keys(t)[0]}});var qs=g(function(aTe,Pj){Pj.exports=function(t,r){if(t==null||r==null)return null;return Object.hasOwn(t,r)?t[r]:null}});var gr=g(function(cTe,Bj){Bj.exports=function(t,r,n){let s,i=!1;if(typeof r==="string"){if(r.indexOf(".")===-1){let a=F3(t,r);if(a==null)return n;return a}s=r.split(".")}else if(i=!0,s=r,s.length===1){let a=F3(t,s[0]);if(a==null)return n;return a}let o=r,u=t;for(let a of s){if(u==null)return n;if(!i&&u[o]!=null)return u[o];if(u=F3(u,a),!i)o=o.substring(a.length+1)}return u==null?n:u};function F3(e,t){if(e==null)return e;if(e instanceof Map)return e.get(t);return e[t]}});var N3=g(function(lTe,Nj){var Fj=vn();Nj.exports=function(t,r){if(typeof t==="string"&&typeof r==="string")return t===r;if(typeof t==="number"&&typeof r==="number")return t===r;if(Fj(t,"ObjectId")&&Fj(r,"ObjectId"))return t.toString()===r.toString();return!1}});var Gm=g(function(hTe,Ij){var ime=N3();Ij.exports=function(t,r){if(t?.discriminators==null)return null;for(let n of Object.keys(t.discriminators)){let s=t.discriminators[n];if(s.discriminatorMapping==null)continue;if(ime(s.discriminatorMapping.value,r))return s}return null}});var $j=g(function(fTe,Rj){var ome=qs(),ume=gr(),ame=Gm();Rj.exports=function e(t,r,n){n=n||{};let s=n.typeOnly,i=Array.isArray(r)?r:r.indexOf(".")===-1?[r]:r.split("."),o=null,u="adhocOrUndefined",a=ame(t.schema,t.get(t.schema.options.discriminatorKey))||t.schema;for(let c=0;c<i.length;++c){let l=i.slice(0,c+1).join(".");if(o=a.path(l),o==null){u="adhocOrUndefined";continue}if(o.instance==="Mixed")return s?"real":o;if(u=a.pathType(l),(o.$isSingleNested||o.$isMongooseDocumentArrayElement)&&o.schema.discriminators!=null){let f=o.schema.discriminators,h=t.get(l+"."+ume(o,"schema.options.discriminatorKey"));if(h==null||ome(f,h)==null)continue;let d=i.slice(c+1).join(".");return e(t.get(l),d,n)}}return s?u:o}});var kj=g(function(dTe,vj){var cme=gr();vj.exports=function(t,r,n){let s=Object.keys(r);if(s.length<=1)return s;let i=n!=null?Object.keys(cme(t.tree,n,{})):Object.keys(t.tree),o=new Set(s),u=[];for(let a of i)if(o.delete(a))u.push(a);for(let a of o)u.push(a);return u}});var Co=g(function(pTe,qj){qj.exports=function(t,r){return t!=null&&Object.hasOwn(t,r)?t[r]:void 0}});var Lj=g(function(mTe,jj){jj.exports=function(t,r){if(r.length===1)return;let n=r[0],s=void 0;for(let i=0;i<r.length-1;++i){let o=t.path(n);if(o?.schema)s=o.schema.options.strict,t=o.schema,n=o.$isMongooseDocumentArray&&!isNaN(r[i+1])?"":r[i+1];else n+=n.length?"."+r[i+1]:r[i+1]}return s}});var Ym=g(function(yTe,Vj){var lme=r1(),Uj=Oe(),hme=new Set(["__index","__parentArray","_doc"]);Vj.exports=function(t,r){if(Uj.isPOJO(t)&&lme(t.$__,"strictMode")!=null&&t._doc!=null){if(r){let n={};for(let s of Object.keys(t)){if(typeof s==="symbol")continue;if(s[0]==="$")continue;if(hme.has(s))continue;n[s]=t[s]}return{...t._doc,...n}}return t._doc}return t}});var f1=g(function(gTe,zj){/*!
164
- * ignore
165
- */zj.exports=function(t){if(t==null)return!0;if(typeof t==="object")return!("$meta"in t)&&!("$slice"in t);return!0}});var Ja=g(function(_Te,Wj){var fme=f1(),dme=So();/*!
166
- * ignore
167
- */Wj.exports=function e(t){if(t==null)return null;let r=Object.keys(t),n=null;if(r.length===1&&r[0]==="_id")n=!t._id;else for(let s=0;s<r.length;++s){let i=r[s];if(i!=="_id"&&fme(t[i])){if(n=dme(t[i])?e(t[i])??n:!t[i],n!=null)break}}return n}});var I3=g(function(ETe,Hj){var pme=f1();Hj.exports=function(t,r){if(t==null)return!1;if(r==="_id")return t._id===0;let n=Object.keys(t),s=null;for(let i of n)if(pme(t[i])){s=t[r]===1?"inclusive":"exclusive";break}if(s==="inclusive")return t[r]!==1;if(s==="exclusive")return t[r]===0;return!1}});var R3=g(function(ATe,Gj){var Kj=Oe();Gj.exports=function(t,r){if(t._doc._id==null||r==null||r.length===0)return;let n=String(t._doc._id);for(let s of r){if(s.isVirtual)continue;let o=s.path.split(".");for(let u=0;u<o.length-1;++u){let a=o.slice(0,u+1).join("."),c=o.slice(u+1).join("."),l=t.get(a);if(l==null)continue;if(Kj.isMongooseDocumentArray(l)){for(let f=0;f<l.length;++f)if(l[f])l[f].populated(c,s._docs[n]==null?void 0:s._docs[n][f],s);break}}}}});var $3=g(function(OTe,Jj){var{isPOJO:mme}=Oe();Jj.exports=Yj;function Yj(e){let t=Object.keys(e),r=t.length,n,s,i;while(r--){if(s=t[r],i=e[s],mme(i))e[s]=Yj(i);if(e[s]===void 0){delete e[s];continue}n=!0}return n?e:void 0}});var v3=g(function(STe,Qj){var yme=/\./g;Qj.exports=function(t){if(t.indexOf(".")===-1)return[t];let r=t.split(yme),n=r.length,s=Array(n),i="";for(let o=0;o<n;++o)i+=i.length!==0?"."+r[o]:r[o],s[o]=i;return s}});var Zj=g(function(wTe,Xj){Xj.exports=function(t,r,n,s,i){let o=Object.keys(t).reduce((a,c)=>a||c.startsWith(r+"."),!1),u=r+"."+n.options.discriminatorKey;if(!o&&i.length===1&&i[0]===u)s.splice(s.indexOf(u),1)}});var _i=g(function(CTe,eL){var gme=N3();eL.exports=function(t,r){if(t==null)return null;for(let n of Object.keys(t)){let s=t[n];if(s.schema&&s.schema.discriminatorMapping&&gme(s.schema.discriminatorMapping.value,r))return s}return null}});var Jm=g(function(bTe,tL){/*!
168
- * ignore
169
- */tL.exports=function(t,r){let n=r.split("."),s="";for(let i=0;i<n.length;++i)if(s+=s.length?"."+n[i]:n[i],t[s])return!0;return!1}});var k3=g(function(DTe,rL){/*!
170
- * Store the read preference and read concern that the populate options `pops` inherit from
171
- * `query`'s explicit settings. Schema-level `read` and `readConcern` defaults are not inherited:
172
- * each populate query applies its own model's schema defaults. `_execPopulateQuery()` applies
173
- * these unless the populate options set their own.
174
- *
175
- * Store them separately from `pop.options` because a query's clones share its populate options:
176
- * inherited values written to `pop.options` would look like explicit settings to later executions.
177
- */rL.exports=function(t,r){let n=t.options,s="readPreference"in n?n.readPreference:void 0;for(let i of r)i._inheritedReadPreference=s,i._inheritedReadConcern=n.readConcern}});var sf=g(function(j3){/*!
178
- * Module dependencies
179
- */var _me=qs(),nL=$m(),Eme=Zj(),sL=gr(),Ame=_i(),q3=f1(),Ome=Ja(),Sme=So(),wme=Zt(),Cme=Jm(),bme=k3();j3.preparePopulationOptionsMQ=function(t,r){let n=t._mongooseOptions.populate,s=Object.keys(n).reduce((u,a)=>u.concat([n[a]]),[]);if(r.lean!=null)s.filter((u)=>u?.options?.lean==null).forEach(Dme(r.lean));let i=t?.options?.session||null;if(i!=null)s.forEach((u)=>{if(u.options==null){u.options={session:i};return}if(!("session"in u.options))u.options.session=i});let o=t._fieldsForExec();for(let u=0;u<s.length;++u)if(s[u]instanceof nL)s[u]=new nL({...s[u],_queryProjection:o,_localModel:t.model});else s[u]._queryProjection=o,s[u]._localModel=t.model;return bme(t,s),s};j3.createModel=function(t,r,n,s,i){t.hooks.execPreSync("createModel",r);let o=t.schema?t.schema.discriminatorMapping:null,u=o?.isRoot?o.key:null,a={skipId:!0,isNew:!1,willInit:!0};if(i?.defaults!=null)a.defaults=i.defaults;if(i?.strict!=null)a.strict=i.strict;let c=r[u];if(u&&c&&t.discriminators){let l=_me(t.discriminators,c)||Ame(t.discriminators,c);if(l){let f=wme(s);return j3.applyPaths(f,l.schema),new l(void 0,f,a)}}return new t(void 0,n,a)};/*!
180
- * ignore
181
- */j3.createModelAndInit=function(t,r,n,s,i,o,u){let a={};if(o)a.populated=o;if(i?.middleware!=null)a.middleware=i.middleware;let c=j3.createModel(t,r,n,s,i);try{c.$init(r,a,u)}catch(l){u(l,c)}};/*!
182
- * ignore
183
- */j3.applyPaths=function(t,r,n){let s,i,o=new Set;if(t){if(n){for(let _ of Object.keys(t))if(_[0]==="+"||_.startsWith("-+"))delete t[_]}i=Object.keys(t);let p=[];for(let _=0;_<i.length;++_){let y=i[_];if(i[_][0]!=="-")continue;if(delete t[y],y==="-_id")t._id=0;else p.push(y.slice(1))}i=Object.keys(t);let m=!1;for(let _=0;_<i.length;++_){if(i[_][0]==="+")continue;let y=t[i[_]];if(!q3(y))continue;if(y?.$elemMatch!=null){m=!0;continue}if(i[_]==="_id"&&i.length>1)continue;if(i[_]===r.options.discriminatorKey&&i.length>1&&y!=null&&!y)continue;if(Sme(y)&&!Object.keys(y).some((E)=>E.startsWith("$"))){if(s=Ome(y)??void 0,s===void 0)continue;break}s=!y;break}if(s===void 0&&m)s=!1;for(let _ of p){let y=r.path(_);if(!y?.selected||s!==!1)t[_]=0,s=!0;else if(y?.selected&&s===!1)o.add(_)}}let u=[],a=[],c=[];if(r._hasSelectedPaths!==!1)l(r);if(n&&s===!1){let p=Object.keys(t);if(!p.some((m)=>(m!=="_id"||p.length===1)&&q3(t[m])&&t[m]))s=!0}switch(s){case!0:for(let p of a){if(d(t,p))continue;t[p]=0}break;case!1:if(r?.paths._id?.options?.select===!1)t._id=0;for(let p of u){if(o.has(p))continue;if(Cme(t,p))continue;t[p]=t[p]||1}break;case void 0:if(t==null)break;for(let p of Object.keys(t||{}))if(p.startsWith("+"))delete t[p];for(let p of a){if(t[p]!=null)continue;t[p]=0}break}function l(p,m){if(m||(m=""),c.indexOf(p)!==-1)return[];c.push(p);let _=[];return p.eachPath(function(y,E){if(m)y=m+"."+y;if(E.$isSchemaMap||y.endsWith(".$*")){let b="+"+y,A=t&&b in t;if(E.options?.select===!1&&n)h(y),a.push(y);else if(E.options?.select===!1&&!A)a.push(y);return}let w=f(y,E);if(w==null&&!Array.isArray(E)&&E.$isMongooseArray&&!E.$isMongooseDocumentArray)w=f(y,E.embeddedSchemaType);if(w!=null)_.push(w);if(E.schema){let b=l(E.schema,y);if(s===!1)Eme(t,y,E.schema,u,b)}}),c.pop(),_}function f(p,m){if(t==null)return;if(typeof m.selected!=="boolean")return;if(m.selected===!1&&n)h(p);else if(m.selected===!1&&t[p])return;if(!s&&m.selected&&p===r.options.discriminatorKey&&t[p]!=null&&!t[p]){delete t[p];return}if(s===!1&&m.selected&&t[p]!=null&&!t[p]){delete t[p];return}let _="+"+p;if(t&&_ in t){if(delete t[_],s===!1&&i.length>1&&!~i.indexOf(p))t[p]=1;return}let E=p.split("."),w="";for(let b=0;b<E.length;++b)if(w+=w.length?"."+E[b]:E[b],a.indexOf(w)!==-1)return;if(!s&&(m?.options?.$skipDiscriminatorCheck||!1)){let b="";for(let A=0;A<E.length;++A){b+=(b.length===0?"":".")+E[A];let M=sL(t,b,!1)||sL(t,b+".$",!1);if(M&&typeof M!=="object")return}}return(m.selected?u:a).push(p),p}function h(p){for(let m of Object.keys(t)){if(q3(t[m])&&!t[m])continue;let _=m.endsWith(".$")?m.slice(0,-2):m;if(_===p||_.startsWith(p+".")||p.startsWith(_+"."))delete t[m]}}function d(p,m){let _=-1;while((_=m.indexOf(".",_+1))!==-1){let y=p[m.slice(0,_)];if(y!=null&&!y)return!0}return!1}};function Dme(e){return function(t){if(t.options||(t.options={}),Array.isArray(e?.virtuals))e=Object.assign({},e),e.virtuals=e.virtuals.filter((r)=>typeof r==="string"&&r.startsWith(t.path+".")).map((r)=>r.slice(t.path.length+1));t.options.lean=e}}});var Ui=g(function(Pme){Pme.schemaMixedSymbol=Symbol.for("mongoose:schema_mixed");Pme.builtInMiddleware=Symbol.for("mongoose:built-in-middleware");Pme.skipOnSubdocuments=Symbol("mongoose:skip-on-subdocuments");Pme.requiresShardKey=Symbol.for("mongoose:requires-shard-key")});var Yo=g(function(xTe,uL){var Rme=So(),oL=Ui(),$me=(e)=>e.fn[oL.builtInMiddleware];function L3(e,t){return e?.middleware===!1||e?.middleware?.[t]===!1?$me:null}function vme(e){let t=e[e.length-1],r=Rme(t)?t:null;return{pre:{filter:L3(r,"pre")},post:{filter:L3(r,"post")}}}uL.exports={buildMiddlewareFilter:L3,middlewareFiltersFromLastArg:vme}});var U3=g(function(PTe,aL){function kme(e){return!!e&&(typeof e==="object"||typeof e==="function")&&typeof e.then==="function"}aL.exports=kme});var lL=g(function(BTe,cL){cL.exports=function(t,r,n){let s=r[0],i=n,o=t;for(let u=0;u<r.length-1;++u){let a=i.path(s);if(a?.schema){let c=o.get(s);if(i=a.schema,s=r[u+1],Array.isArray(c)&&!isNaN(s))c=c[s],s="";if(c==null)break;o=c}else s+=s.length?"."+r[u+1]:r[u+1]}return o}});var dL=g(function(FTe,fL){var qme=So();fL.exports=function(t,r){return hL(t,r,!0,new Set)};function hL(e,t,r,n){if(e==null)return e;if(e.$__!=null&&typeof e.toObject==="function")return r||e.$__isNested?e.toObject(t):e;if(!Array.isArray(e)&&!qme(e))return e;if(n.has(e))return e;n.add(e);let s=e;for(let i of Object.keys(e)){let o=hL(e[i],t,!1,n);if(o===e[i])continue;if(s===e)s=Array.isArray(e)?Object.assign([],e):{...e};s[i]=o}return n.delete(e),s}});var Zm=g(function(NTe,pL){var nn=wo(),jme=ji().internalToObjectOptions,Qm=G("util"),Xm=Oe();pL.exports=It;function It(e,t,r,n){if(r!=null){let s={isNew:r.isNew};if("defaults"in r.$__)s.defaults=r.$__.defaults;n=Object.assign(s,n)}if(n?.path!=null)this.$basePath=n.path;if(nn.call(this,e,t,n),this.$__.priorDoc!==void 0)this.$__.priorDoc=void 0}It.prototype=Object.create(nn.prototype);Object.defineProperty(It.prototype,"$isSubdocument",{configurable:!1,writable:!1,value:!0});Object.defineProperty(It.prototype,"$isSingleNested",{configurable:!1,writable:!1,value:!0});/*!
184
- * ignore
185
- */It.prototype.toBSON=function(){return this.toObject(jme)};It.prototype.save=async function(t){if(t=t||{},!t.suppressWarning)Xm.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.");return await this.$__save(t)};It.prototype.$__fullPath=function(e){if(!this.$__.fullPath)this.ownerDocument();return e?this.$__.fullPath+"."+e:this.$__.fullPath};It.prototype.$__pathRelativeToParent=function(e){if(e==null)return this.$basePath;if(!this.$basePath)return e;return[this.$basePath,e].join(".")};It.prototype.$__save=async function(t){try{await this._execDocumentPreHooks("save",t,[t])}catch(r){await this._execDocumentPostHooks("save",t,r);return}await this._execDocumentPostHooks("save",t)};/*!
186
- * ignore
187
- */It.prototype.$isValid=function(e){let t=this.$parent(),r=this.$__pathRelativeToParent(e);if(t!=null&&r!=null)return t.$isValid(r);return nn.prototype.$isValid.call(this,e)};/*!
188
- * ignore
189
- */It.prototype.markModified=function(e){nn.prototype.markModified.call(this,e);let t=this.$parent(),r=this.$__pathRelativeToParent(e);if(t==null||r==null)return;if(this.isNew)return;let n=this.$__pathRelativeToParent().replace(/\.$/,"");if(t.isDirectModified(n))return;this.$__parent.markModified(r,this)};/*!
190
- * ignore
191
- */It.prototype.isModified=function(e,t,r){let n=this.$parent();if(n!=null){if(Array.isArray(e)||typeof e==="string")e=Array.isArray(e)?e:e.split(" "),e=e.map((s)=>this.$__pathRelativeToParent(s)).filter((s)=>s!=null);else if(!e)e=this.$__pathRelativeToParent();return n.$isModified(e,t,r)}return nn.prototype.isModified.call(this,e,t,r)};It.prototype.$markValid=function(e){nn.prototype.$markValid.call(this,e);let t=this.$parent(),r=this.$__pathRelativeToParent(e);if(t!=null&&r!=null)t.$markValid(r)};/*!
192
- * ignore
193
- */It.prototype.invalidate=function(e,t,r){nn.prototype.invalidate.call(this,e,t,r);let n=this.$parent(),s=this.$__pathRelativeToParent(e);if(n!=null&&s!=null)n.invalidate(s,t,r);else if(t.kind==="cast"||t.name==="CastError"||s==null)throw t;return this.ownerDocument().$__.validationError};/*!
194
- * ignore
195
- */It.prototype.$ignore=function(e){nn.prototype.$ignore.call(this,e);let t=this.$parent(),r=this.$__pathRelativeToParent(e);if(t!=null&&r!=null)t.$ignore(r)};It.prototype.ownerDocument=function(){if(this.$__.ownerDocument)return this.$__.ownerDocument;let e=this,t=[],r=new Set([e]);while(!0){if(typeof e.$__pathRelativeToParent!=="function")break;t.unshift(e.$__pathRelativeToParent(void 0,!0));let n=e.$parent();if(n==null)break;if(e=n,r.has(e))throw Error("Infinite subdocument loop: subdoc with _id "+e._id+" is a parent of itself");r.add(e)}return this.$__.fullPath=t.join("."),this.$__.ownerDocument=e,this.$__.ownerDocument};/*!
196
- * ignore
197
- */It.prototype.$__fullPathWithIndexes=function(){let e=this,t=[],r=new Set([e]);while(!0){if(typeof e.$__pathRelativeToParent!=="function")break;t.unshift(e.$__pathRelativeToParent(void 0,!1));let n=e.$parent();if(n==null)break;if(e=n,r.has(e))throw Error("Infinite subdocument loop: subdoc with _id "+e._id+" is a parent of itself");r.add(e)}return t.join(".")};It.prototype.parent=function(){return this.$__parent};It.prototype.$parent=It.prototype.parent;/*!
198
- * Sets this sub-documents parent document.
199
- *
200
- * @api private
201
- */It.prototype.$__setParent=function(t){this.$__parent=t};It.prototype.$__removeFromParent=function(){this.$__parent.set(this.$basePath,null)};It.prototype.deleteOne=function(t){if(Lme(this),!t?.noop){this.$__removeFromParent();let r=this.ownerDocument();r.$__.removedSubdocs=r.$__.removedSubdocs||[],r.$__.removedSubdocs.push(this)}};/*!
202
- * ignore
203
- */It.prototype.populate=function(){throw Error('Mongoose does not support calling populate() on nested docs. Instead of `doc.nested.populate("path")`, use `doc.populate("nested.path")`')};It.prototype.inspect=function(){return this.toObject()};if(Qm.inspect.custom)It.prototype[Qm.inspect.custom]=It.prototype.inspect;It.prototype.$toObject=function(t,r){let n=nn.prototype.$toObject.call(this,t,r);if(Xm.hasOwnKeys(n)===!1&&t?._calledWithOptions!=null){if((t._calledWithOptions?.minimize??this?.$__schemaTypeOptions?.minimize??t.minimize)&&!this.constructor.$__required&&!this.$isDocumentArrayElement)return}return n};function Lme(e){let t=e.ownerDocument();function r(){t.$removeListener("save",r),t.$removeListener("deleteOne",r),e.emit("deleteOne",e),e.constructor.emit("deleteOne",e)}t.$on("save",r),t.$on("deleteOne",r)}});var d1=g(function(ITe,gL){/*!
204
- * Module dependencies.
205
- */var mL=G("events").EventEmitter,ey=Zm(),yL=Oe(),Ume=le().arrayParentSymbol,V3=le().documentArrayParent;function es(e,t,r,n,s){let i;if(yL.isMongooseDocumentArray(t))this.__parentArray=t,i=t[Ume];else this.__parentArray=void 0;this[V3]=i,this.$setIndex(s),this.$__parent=i;let o={isNew:!0};if(i!=null&&"defaults"in i.$__)o.defaults=i.$__.defaults;if(typeof r==="object"&&r!=null)Object.assign(o,r);ey.call(this,e,n,null,o)}/*!
206
- * Inherit from Subdocument
207
- */es.prototype=Object.create(ey.prototype);es.prototype.constructor=es;Object.defineProperty(es.prototype,"$isSingleNested",{configurable:!1,writable:!1,value:!1});Object.defineProperty(es.prototype,"$isDocumentArrayElement",{configurable:!1,writable:!1,value:!0});for(let e in mL.prototype)es[e]=mL.prototype[e];/*!
208
- * ignore
209
- */es.prototype.$setIndex=function(e){if(this.__index=e,this.$__?.validationError!=null){let t=Object.keys(this.$__.validationError.errors);for(let r of t)this.invalidate(r,this.$__.validationError.errors[r])}};/*!
210
- * ignore
211
- */es.prototype.populate=function(){throw Error('Mongoose does not support calling populate() on nested docs. Instead of `doc.arr[0].populate("path")`, use `doc.populate("arr.0.path")`')};/*!
212
- * ignore
213
- */es.prototype.$__removeFromParent=function(){let e=this._doc._id;if(!e)throw Error("For your own good, Mongoose does not know how to remove an ArraySubdocument that has no _id");this.__parentArray.pull({_id:e})};es.prototype.$__fullPath=function(e,t){if(this.__index==null)return null;if(!this.$__.fullPath)this.ownerDocument();if(t)return e?this.$__.fullPath+"."+e:this.$__.fullPath;return e?this.$__.fullPath+"."+this.__index+"."+e:this.$__.fullPath+"."+this.__index};es.prototype.$__pathRelativeToParent=function(e,t){if(this.__index==null||!this.__parentArray?.$path)return null;if(t)return e==null?this.__parentArray.$path():this.__parentArray.$path()+"."+e;if(e==null)return this.__parentArray.$path()+"."+this.__index;return this.__parentArray.$path()+"."+this.__index+"."+e};es.prototype.$parent=function(){return this[V3]};/*!
214
- * Sets this sub-documents parent document.
215
- *
216
- * @api private
217
- */es.prototype.$__setParent=function(t){this[V3]=t,this.$__parent=t};es.prototype.parentArray=function(){return this.__parentArray};/*!
218
- * Module exports.
219
- */gL.exports=es});var sy=g(function(RTe,bL){var W3=wo(),z3=d1(),Vme=Le(),_L=zm(),zme=Zt(),EL=ji().internalToObjectOptions,ny=ks(),Xe=Oe(),Qa=vn(),Wme=we().UUID,Hme=le().arrayAtomicsBackupSymbol,Vi=le().arrayAtomicsSymbol,da=le().arrayParentSymbol,pa=le().arrayPathSymbol,Jo=le().arraySchemaSymbol,wL=le().populateModelSymbol,Kme=Symbol("mongoose#Array#sliced"),AL=Array.prototype.push;/*!
220
- * ignore
221
- */var ry={$__getAtomics(){let e=[],t=Object.keys(this[Vi]||{}),r=t.length,n=Object.assign({},EL,{_isNested:!0});if(r===0)return e[0]=["$set",this.toObject(n)],e;while(r--){let s=t[r],i=this[Vi][s];if(Xe.isMongooseObject(i))i=i.toObject(n);else if(Array.isArray(i))i=this.toObject.call(i,n);else if(Array.isArray(i?.$each))i.$each=this.toObject.call(i.$each,n);else if(typeof i?.valueOf==="function")i=i.valueOf();if(s==="$addToSet")i={$each:i};e.push([s,i])}return e},getAtomics(){return this.$__getAtomics()},clearAtomics(){this[Hme]=this[Vi],this[Vi]={}},$atomics(){/*!
222
- * ignore
223
- */return this[Vi]},$parent(){/*!
224
- * ignore
225
- */return this[da]},$path(){/*!
226
- * ignore
227
- */return this[pa]},$schemaType(){/*!
228
- * ignore
229
- */return this[Jo]},$shift(){this._registerAtomic("$pop",-1),this._markModified();let e=this.__array;if(e._shifted)return;return e._shifted=!0,[].shift.call(e)},$pop(){if(this._registerAtomic("$pop",1),this._markModified(),this._popped)return;return this._popped=!0,[].pop.call(this)},$schema(){/*!
230
- * ignore
231
- */return this[Jo]},_cast(e){let t=!1,r,n=this[da];if(n)t=n.$populated(this[pa],!0);if(t&&e!=null){if(r=t.options[wL],r==null)throw new Vme("No populated model found for path `"+this[pa]+"`. This is likely a bug in Mongoose, please report an issue on github.com/Automattic/mongoose.");if(Buffer.isBuffer(e)||Qa(e,"ObjectId")||!Xe.isObject(e))e={_id:e};if(e.schema?.discriminatorMapping?.key===void 0)e=new r(e);return this[Jo].embeddedSchemaType.applySetters(e,n,!0)}return this[Jo].embeddedSchemaType.applySetters(e,n,!1)},_mapCast(e,t){return this._cast(e,this.length+t)},_markModified(e){let t=this[da],r;if(t){if(r=this[pa],arguments.length)r=r+"."+e;if(r!=null&&r.endsWith(".$"))return this;t.markModified(r,arguments.length!==0?e:t)}return this},_registerAtomic(e,t){if(this[Kme])return;if(e==="$set")return this[Vi]={$set:t},_L(this[da],this[pa]),this._markModified(),this;let r=this[Vi];if(e==="$pop"&&!("$pop"in r)){let s=this;this[da].once("save",function(){s._popped=s._shifted=null})}if(r.$set||Xe.hasOwnKeys(r)&&!(e in r))return this[Vi]={$set:this},this;let n;if(e==="$pullAll"||e==="$addToSet")r[e]||(r[e]=[]),r[e]=r[e].concat(t);else if(e==="$pullDocs"){let s=r.$pull||(r.$pull={});if(t[0]instanceof z3)n=s.$or||(s.$or=[]),Array.prototype.push.apply(n,t.map((i)=>i.toObject({transform:(o,u)=>{if(i==null||i.$__==null)return u;return Object.keys(i.$__.activePaths.getStatePaths("default")).forEach((a)=>{ny.unset(a,u),CL(u,a)}),u},virtuals:!1})));else n=s._id||(s._id={$in:[]}),n.$in=n.$in.concat(t)}else if(e==="$push")if(r.$push=r.$push||{$each:[]},t!=null&&Xe.hasUserDefinedProperty(t,"$each"))r.$push=t;else if(t.length===1)r.$push.$each.push(t[0]);else if(t.length<1e4)r.$push.$each.push(...t);else for(let s of t)r.$push.$each.push(s);else r[e]=t;return this},addToSet(){ty(this,arguments),SL(this,arguments);let e=[].map.call(arguments,this._mapCast,this),t=[],r="";if(e[0]instanceof z3)r="doc";else if(e[0]instanceof Date)r="date";else if(Qa(e[0],"ObjectId"))r="ObjectId";let n=Xe.isMongooseArray(e)?e.__array:e,s=Xe.isMongooseArray(this)?this.__array:this;return n.forEach(function(i){let o;switch(r){case"doc":o=this.some(function(u){return u.equals(i)});break;case"date":{let u=+i;o=this.some(function(a){return+a===u});break}case"ObjectId":o=this.find((u)=>u.toString()===i.toString());break;default:o=~this.indexOf(i);break}if(!o)this._markModified(),s.push(i),this._registerAtomic("$addToSet",i),[].push.call(t,i)},this),t},hasAtomics(){if(!Xe.isPOJO(this[Vi]))return 0;return Object.keys(this[Vi]).length},includes(e,t){return this.indexOf(e,t)!==-1},indexOf(e,t){if(Qa(e,"ObjectId")||e instanceof Wme)e=e.toString();let r=null;if(e instanceof Date)r=Gme;else if(Buffer.isBuffer(e))r=Yme;else if(Qa(e,"Double"))r=Jme;else if(Qa(e,"Decimal128"))r=Qme;t=t==null?0:t;let n=this.length;for(let s=t;s<n;++s)if(r===null?e==this[s]:r(e,this[s]))return s;return-1},inspect(){return JSON.stringify(this)},nonAtomicPush(){let e=[].map.call(arguments,this._mapCast,this);this._markModified();let t=[].push.apply(this,e);return this._registerAtomic("$set",this),t},pop(){this._markModified();let e=[].pop.call(this);return this._registerAtomic("$set",this),e},pull(){let e=[].map.call(arguments,(s,i)=>this._cast(s,i,{defaults:!1}),this),t=this;if(Xe.isMongooseArray(t))t=t.__array;let r=t.length,n;this._markModified();while(r--)if(n=t[r],n instanceof W3){if(e.some(function(i){return n.equals(i)}))t.splice(r,1)}else if(~this.indexOf.call(e,n))t.splice(r,1);if(e[0]instanceof z3)this._registerAtomic("$pullDocs",e.map(function(s){let i=s.$__getValue("_id");if(i===void 0||s.$isDefault("_id"))return s;return i}));else this._registerAtomic("$pullAll",e);if(_L(this[da],this[pa])>0)this._registerAtomic("$set",this);return this},push(){let e=arguments,t=e,r=e[0]!=null&&Xe.hasUserDefinedProperty(e[0],"$each"),n=Xe.isMongooseArray(this)?this.__array:this;if(r)t=e[0],e=e[0].$each;if(this[Jo]==null)return AL.apply(this,e);ty(this,e),SL(this,e),e=[].map.call(e,this._mapCast,this);let s,i=this[Vi];if(this._markModified(),r)if(t.$each=e,Zme(i.$push,t)){if(t.$position!=null)[].splice.apply(n,[t.$position,0].concat(e)),s=n.length;else s=[].push.apply(n,e);this._registerAtomic("$set",this)}else if(t.$position!=null)[].splice.apply(n,[t.$position,0].concat(e)),s=this.length;else s=[].push.apply(n,e);else if(t=e,s=AL.apply(n,e),i.$push?.$position!=null)this._registerAtomic("$set",this);return this._registerAtomic("$push",i.$push?.$each?.length?e:t),s},remove(){return this.pull.apply(this,arguments)},set(e,t,r){let n=this.__array;if(r)return n[e]=t,this;let s=ry._cast.call(this,t,e);return ry._markModified.call(this,e),n[e]=s,this},shift(){let e=Xe.isMongooseArray(this)?this.__array:this;this._markModified();let t=[].shift.call(e);return this._registerAtomic("$set",this),t},sort(){let e=Xe.isMongooseArray(this)?this.__array:this,t=[].sort.apply(e,arguments);return this._registerAtomic("$set",this),t},splice(){let e,t=Xe.isMongooseArray(this)?this.__array:this;if(this._markModified(),ty(this,Array.prototype.slice.call(arguments,2)),arguments.length){let r;if(this[Jo]==null)r=arguments;else{r=[];for(let n=0;n<arguments.length;++n)r[n]=n<2?arguments[n]:this._cast(arguments[n],arguments[0]+(n-2))}e=[].splice.apply(t,r),this._registerAtomic("$set",this)}return e},toBSON(){/*!
232
- * ignore
233
- */return this.toObject(EL)},toObject(e){let t=Xe.isMongooseArray(this)?this.__array:this;if(e?.depopulate)return e=zme(e),e._isNested=!0,[].concat(t).map(function(r){return r instanceof W3?r.toObject(e):r});return[].concat(t)},$toObject(){return this.constructor.prototype.toObject.apply(this,arguments)},unshift(){ty(this,arguments);let e;if(this[Jo]==null)e=arguments;else e=[].map.call(arguments,this._cast,this);let t=Xe.isMongooseArray(this)?this.__array:this;return this._markModified(),[].unshift.apply(t,e),this._registerAtomic("$set",this),this.length}};/*!
234
- * ignore
235
- */function Gme(e,t){return t instanceof Date&&+e===+t}function Yme(e,t){return Buffer.isBuffer(t)&&(e._subtype||0)===(t._subtype||0)&&e.equals(t)}function Jme(e,t){if(!Qa(t,"Double"))return!1;let r=e.valueOf(),n=t.valueOf();return r===n||Number.isNaN(r)&&Number.isNaN(n)}var OL=/^(-?)(\d+)(?:\.(\d*))?(?:E([+-]\d+))?$/;function Qme(e,t){if(!Qa(t,"Decimal128"))return!1;let r=e.toString(),n=t.toString();if(r===n)return!0;let s=OL.exec(r),i=OL.exec(n);if(s===null||i===null)return!1;let o=s[3]||"",u=i[3]||"",a=BigInt(s[1]+s[2]+o),c=BigInt(i[1]+i[2]+u),l=(+s[4]||0)-o.length,f=(+i[4]||0)-u.length;return l>f?a*10n**BigInt(l-f)===c:c*10n**BigInt(f-l)===a}function Xme(e,t){if(!t)return!1;for(let r of e){if(r==null)return!1;let n=r.constructor;if(!(r instanceof W3)||n.modelName!==t&&n.baseModelName!==t)return!1}return!0}/*!
236
- * Minimize _just_ empty objects along the path chain specified
237
- * by `parts`, ignoring all other paths. Useful in cases where
238
- * you want to minimize after unsetting a path.
239
- *
240
- * #### Example:
241
- *
242
- * const obj = { foo: { bar: { baz: {} } }, a: {} };
243
- * _minimizePath(obj, 'foo.bar.baz');
244
- * obj; // { a: {} }
245
- */function CL(e,t,r){if(typeof t==="string"){if(t.indexOf(".")===-1)return;t=ny.stringToParts(t)}if(r=r||0,r>=t.length)return;if(e==null||typeof e!=="object")return;if(CL(e[t[0]],t,r+1),e[t[0]]!=null&&typeof e[t[0]]==="object"&&Xe.hasOwnKeys(e[t[0]])===!1)delete e[t[0]]}/*!
246
- * ignore
247
- */function ty(e,t){let r=e==null?null:e[Jo]?.embeddedSchemaType?.options?.ref||null;if(e.length===0&&t.length!==0){if(Xme(t,r))e[da].$populated(e[pa],[],{[wL]:t[0].constructor})}}/*!
248
- * If `docs` isn't all instances of the right model, depopulate `arr`
249
- */function SL(e,t){let r=e==null?null:e[Jo]?.embeddedSchemaType?.options?.ref||null,n=e[da],s=e[pa];if(!r||!n.populated(s))return;for(let i of t){if(i==null)continue;if(typeof i!=="object"||i instanceof String||i instanceof Number||i instanceof Buffer||Xe.isMongooseType(i)){n.depopulate(s);break}}}/*!
250
- * A `{ $each }` push can only join a pending `$push` when neither has
251
- * `$position`, `$slice` or `$sort` (gh-14244, gh-16618)
252
- */function Zme(e,t){if(!e?.$each?.length)return!1;return[e,t].some((r)=>r.$position!=null||r.$slice!=null||r.$sort!=null)}var eye=["filter","flat","flatMap","map","slice"];for(let e of eye){if(Array.prototype[e]==null)continue;ry[e]=function(){let t=Xe.isMongooseArray(this)?this.__array:this,r=[].concat(t);return r[e].apply(r,arguments)}}bL.exports=ry});var PL=g(function($Te,xL){var qr=sy(),tye=wo(),DL=qs(),TL=_i(),rye=ji().internalToObjectOptions,sn=Oe(),nye=vn(),iy=le().arrayParentSymbol,H3=le().arrayPathSymbol,of=le().arraySchemaSymbol,ML=le().documentArrayParent,sye=Array.prototype.reverse,iye=Array.prototype.toString,K3={toBSON(){/*!
253
- * ignore
254
- */return this.toObject(rye)},toString(){return iye.call(this.__array.map((e)=>{if(e?.$__!=null)return e.toString();return e}))},getArrayParent(){/*!
255
- * ignore
256
- */return this[iy]},$schemaType(){/*!
257
- * ignore
258
- */return this[of]},_cast(e,t,r){if(this[of]==null)return e;let n=this[of].Constructor;if((n.$isMongooseDocumentArray?sn.isMongooseDocumentArray(e):e instanceof n)||e?.constructor?.baseCasterConstructor===n){if(!(e[ML]&&e.__parentArray))e[ML]=this[iy],e.__parentArray=this;return e.$setIndex(t),e}if(e==null)return null;if(Buffer.isBuffer(e)||nye(e,"ObjectId")||!sn.isObject(e))e={_id:e};if(e&&n.discriminators&&n.schema&&n.schema.options&&n.schema.options.discriminatorKey){let o=typeof e[n.schema.options.discriminatorKey]==="string"?DL(n.discriminators,e[n.schema.options.discriminatorKey]):null;if(o)n=o;else{let u=TL(n.discriminators,e[n.schema.options.discriminatorKey]);if(u)n=u}}if(n.$isMongooseDocumentArray)return n.cast(e,this,void 0,void 0,t);let i=new n(e,this,r,void 0,t);return i.isNew=!0,i},id(e){if(e==null)return null;let t=this[of],r=null;if(t?.schema)r=t.schema.path("_id");else if(t?.casterConstructor?.schema)r=t.casterConstructor.schema.path("_id");let n=null;if(r)try{n=r.cast(e)}catch{}let s;for(let i of this){if(!i)continue;if(s=i.get("_id"),s==null)continue;else if(s instanceof tye){if(s=s.get("_id"),n!=null&&sn.deepEqual(n,s))return i;else if(n==null&&(e==s||sn.deepEqual(e,s)))return i}else if(n!=null&&sn.deepEqual(n,s))return i;else if(n==null&&(s==e||sn.deepEqual(e,s)))return i}return null},toObject(e){return[].concat(this.map(function(t){if(t==null)return null;if(typeof t.toObject!=="function")return t;return t.toObject(e)}))},$toObject(){return this.constructor.prototype.toObject.apply(this,arguments)},addToSet(){let e=qr.addToSet.apply(this,arguments);return Qo(this),e},push(){let e=oye(arguments),t=qr.push.apply(this,arguments);if(e)Qo(this);return bo(this),t},pop(){let e=qr.pop.apply(this,arguments);return bo(this),e},$pop(){/*!
259
- * ignore
260
- */let e=qr.$pop.apply(this,arguments);return bo(this),e},pull(){let e=qr.pull.apply(this,arguments);return Qo(this),bo(this),e},shift(){let e=qr.shift.apply(this,arguments);return Qo(this),bo(this),e},$shift(){/*!
261
- * ignore
262
- */let e=qr.$shift.apply(this,arguments);return Qo(this),bo(this),e},splice(){let e=qr.splice.apply(this,arguments);return Qo(this),bo(this),e},reverse(){return sye.call(this.__array),this._registerAtomic("$set",this),Qo(this),bo(this),this},sort(){let e=qr.sort.apply(this,arguments);return Qo(this),bo(this),e},unshift(){let e=qr.unshift.apply(this,arguments);return Qo(this),bo(this),e},inspect(){return this.toObject()},create(e){let t=this[of].Constructor;if(e&&t.discriminators&&t.schema&&t.schema.options&&t.schema.options.discriminatorKey){let r=typeof e[t.schema.options.discriminatorKey]==="string"?DL(t.discriminators,e[t.schema.options.discriminatorKey]):null;if(r)t=r;else{let n=TL(t.discriminators,e[t.schema.options.discriminatorKey]);if(n)t=n}}return new t(e,this)},notify(e){/*!
263
- * ignore
264
- */let t=this;return function r(n,s){s=s||t;let i=s.length;while(i--){if(s[i]==null)continue;switch(e){case"save":n=t[i];break;default:break}if(sn.isMongooseArray(s[i]))r(n,s[i]);else if(s[i])s[i].emit(e,n)}}},set(e,t,r){let n=this.__array;if(r)return n[e]=t,this;let s=K3._cast.call(this,t,e);return K3._markModified.call(this,e),n[e]=s,this},_markModified(e,t){let r=this[iy],n;if(r){if(n=this[H3],arguments.length)if(t!=null){let s=e.__index;n=n+"."+s+"."+t}else n=n+"."+e;if(n!=null&&n.endsWith(".$"))return this;r.markModified(n,arguments.length!==0?e:r)}return this}};xL.exports=K3;/*!
265
- * ignore
266
- */function Qo(e){let t=sn.isMongooseArray(e)?e.__array:e;for(let r=0;r<t.length;++r)if(typeof t[r]?.$setIndex==="function")t[r].$setIndex(r)}function oye(e){return e[0]!=null&&sn.hasUserDefinedProperty(e[0],"$each")&&e[0].$position!=null}function bo(e){let t=e[iy];if(!t||t.$__.populated==null)return;let r=Object.keys(t.$__.populated).filter((n)=>n.startsWith(e[H3]+"."));for(let n of r){let s=n.slice((e[H3]+".").length);if(!Array.isArray(t.$__.populated[n].value))continue;t.$__.populated[n].value=e.map((i)=>i.$populated(s))}}});var Za=g(function(vTe,FL){/*!
267
- * Module dependencies.
268
- */var BL=sy(),oy=PL(),G3=le().arrayAtomicsSymbol,uye=le().arrayAtomicsBackupSymbol,Y3=le().arrayParentSymbol,J3=le().arrayPathSymbol,Xa=le().arraySchemaSymbol,aye=Array.prototype.push,cye=/^\d+$/;function lye(e,t,r,n){let s=[],i={[G3]:{},[uye]:void 0,[J3]:t,[Xa]:void 0,[Y3]:void 0};if(Array.isArray(e)){if(e[J3]===t&&e[Y3]===r)i[G3]=Object.assign({},e[G3]);e.forEach((u)=>{aye.call(s,u)})}if(i[J3]=t,i.__array=s,r?.$__){i[Y3]=r,i[Xa]=r.$__schema.path(t);while(i[Xa]!=null&&i[Xa].$isMongooseArray&&!i[Xa].$isMongooseDocumentArray)i[Xa]=i[Xa].embeddedSchemaType}let o=new Proxy(s,{get:function(u,a){if(a==="isMongooseArray"||a==="isMongooseArrayProxy"||a==="isMongooseDocumentArray"||a==="isMongooseDocumentArrayProxy")return!0;if(Object.hasOwn(i,a))return i[a];if(Object.hasOwn(oy,a))return oy[a];if(n?.virtuals&&Object.hasOwn(n.virtuals,a))return n.virtuals[a].applyGetters(void 0,u);if(Object.hasOwn(BL,a))return BL[a];return s[a]},set:function(u,a,c){if(typeof a==="string"&&cye.test(a))oy.set.call(o,a,c,!1);else if(Object.hasOwn(i,a))i[a]=c;else if(n?.virtuals&&Object.hasOwn(n.virtuals,a))n.virtuals[a].applySetters(c,u);else s[a]=c;return!0}});return o}/*!
269
- * Module exports.
270
- */FL.exports=lye});var wo=g(function(iU,oU){/*!
271
- * Module dependencies.
272
- */var hye=A3(),eA=G("events").EventEmitter,fye=aj(),VL=qm(),wr=$s(),dye=fj(),zL=jm(),nA=Lm(),pye=yj(),NL=Z6(),mye=ec(),p1=fa(),af=Ga(),WL=u3(),HL=P3(),tA=Vm(),Q3=zm(),zi=Zt(),X3=B3(),yye=Km().compile,gye=Km().defineKey,_ye=xj(),Eye=$n(),Z3=$j(),IL=kj(),KL=Co(),Aye=Lj(),Oye=Ym(),Sye=f1(),wye=Ja(),qn=gn(),RL=I3(),ay=G("util").inspect,GL=ji().internalToObjectOptions,Cye=R3(),bye=$3(),YL=ks(),sA=v3(),JL=sf(),{buildMiddlewareFilter:QL}=Yo(),U=Oe(),Dye=U3(),uy=U.deepEqual,Tye=Object.freeze({skipParentChangeTracking:!0}),cf=le().arrayAtomicsBackupSymbol,ts=le().arrayAtomicsSymbol,Mye=le().documentArrayParent,xye=le().documentIsModified,XL=le().documentModifiedPaths,Pye=le().documentSchemaSymbol,Bye=le().getSymbol,$L=le().modelSymbol,vL=le().populateModelSymbol,Fye=le().scopeSymbol,ZL=Ui().schemaMixedSymbol,Nye=lL(),Iye=le().sessionNewDocuments,Rye=dL(),cy,uf,iA=U.specialProperties;/*!
273
- * Document internals that don't start with `$`. `isNew` is a getter/setter
274
- * for `$isNew`.
275
- */var $ye=new Set(["_doc","__parentArray","__index","isNew"]);function k(e,t,r){if(typeof r==="boolean")throw Error("The skipId parameter has been removed. Use { skipId: true } in the options parameter instead.");if(r==null)r={};let n=r.skipId;if(this.$__=new fye,this.$__schema==null){let l=U.isObject(t)&&!t.instanceOfSchema?new mye(t):t;this.$__setSchema(l),r=Object.assign({},r),t=r,n=r.skipId}if(r.isNew!=null&&r.isNew!==!0)this.$isNew=r.isNew;if(r.priorDoc!=null)this.$__.priorDoc=r.priorDoc;if(n)this.$__.skipId=n;if(e!=null&&typeof e!=="object")throw new nA(e,"obj","Document");let s=!0;if(r.defaults!==void 0)this.$__.defaults=r.defaults,s=r.defaults;let i=this.$__schema;if(typeof t==="boolean"||t==="throw"){if(t!==!0)this.$__.strictMode=t;t=void 0}else if(r.strict!==void 0)this.$__.strictMode=r.strict;else if(i.options.strict!==!0)this.$__.strictMode=i.options.strict;let o=i.requiredPaths();for(let l of o)this.$__.activePaths.require(l);let u=null;if(U.isPOJO(t)&&U.hasOwnKeys(t))u=wye(t),this.$__.selected=t,this.$__.exclude=u;let a=u===!1&&t?HL(t):null,c=!0;if(this._doc==null){if(this.$__buildDoc(e,t,n,u,a,!1),s)c=tA(this,t,u,a,!0,null,Tye)}if(e){let l=Object.assign({},r);if(this.$__original_set)this.$__original_set(e,void 0,!0,l);else this.$set(e,void 0,!0,l);if(e.$__!=null&&e instanceof k)this.$isNew=e.$isNew}if(r.willInit&&s){if(r.skipDefaults)this.$__.skipDefaults=r.skipDefaults}else if(s&&c)tA(this,t,u,a,!1,r.skipDefaults);if(!this.$__.strictMode&&e){let l=this;Object.keys(this._doc).forEach(function(h){if(!(h in i.tree)&&!(h in i.methods)&&!(h in i.virtuals)&&rA(h))gye({prop:h,subprops:null,prototype:l})})}Wye(this)}k.prototype.$isMongooseDocumentPrototype=!0;Object.defineProperty(k.prototype,"isNew",{get:function(){return this.$isNew},set:function(e){this.$isNew=e}});Object.defineProperty(k.prototype,"errors",{get:function(){return this.$errors},set:function(e){this.$errors=e}});/*!
276
- * ignore
277
- */k.prototype.$isNew=!0;/*!
278
- * Document exposes the NodeJS event emitter API, so you can use
279
- * `on`, `once`, etc.
280
- */U.each(["on","once","emit","listeners","removeListener","setMaxListeners","removeAllListeners","addListener"],function(e){k.prototype[e]=function(){if(!this.$__.emitter){if(e==="emit")return;this.$__.emitter=new eA,this.$__.emitter.setMaxListeners(0)}return this.$__.emitter[e].apply(this.$__.emitter,arguments)},k.prototype[`$${e}`]=k.prototype[e]});k.prototype.constructor=k;for(let e in eA.prototype)k[e]=eA.prototype[e];k.prototype.$__schema;k.prototype.schema;Object.defineProperty(k.prototype,"$locals",{configurable:!1,enumerable:!1,get:function(){if(this.$__.locals==null)this.$__.locals={};return this.$__.locals},set:function(e){this.$__.locals=e}});k.prototype.isNew;Object.defineProperty(k.prototype,"$where",{configurable:!1,enumerable:!1,writable:!0});k.prototype.id;k.prototype.$errors;Object.defineProperty(k.prototype,"$op",{get:function(){return this.$__.op||null},set:function(e){this.$__.op=e}});/*!
281
- * ignore
282
- */function vye(e,t,r){if(e==null)return;let n=r.$__schema._getDefaultsCache().defaultsByNestedPath.get(t);if(n==null)return;let{paths:s,schemaTypes:i,depth:o}=n,u=s.length;for(let a=0;a<u;++a){let c=s[a],l=i[a],f=l.splitPath(),h=f.length,d=e;for(let p=o;p<h;++p){let m=f[p];if(p===h-1){if(d[m]!==void 0)break;try{let _=l.getDefault(r,!1);if(_!==void 0)d[m]=_,r.$__.activePaths.default(c)}catch(_){r.invalidate(c,_)}break}if(d[m]==null)d[m]={};else if(typeof d[m]!=="object")break;d=d[m]}}}k.prototype.$__buildDoc=function(e,t,r,n,s){if(!U.hasOwnKeys(this.$__schema.nested)){this._doc={};return}let i={},o=Object.keys(this.$__schema.paths),u=o.length,a=0;for(;a<u;++a){let c=o[a];if(c.includes("$*"))continue;let l=this.$__schema.paths[c].splitPath(),f=l.length;if(f===1)continue;let h=f-1,d="",p=i,m=!1;for(let _=0;_<f;++_){let y=l[_];if(!d.length)d=y;else d+="."+y;if(n===!0){if(d in t)break}else if(n===!1&&t&&!m){if(d in t)m=!0;else if(!s[d])break}if(_<h)p=p[y]||(p[y]={})}}this._doc=i};/*!
283
- * Converts to POJO when you use the document for querying
284
- */k.prototype.toBSON=function(){return this.toObject(GL)};k.prototype.init=function(e,t,r){if(typeof t==="function")r=t,t=null;if(e==null)throw new nA(e,"doc","init");if(this.$__init(e,t),r)r(null,this);return this};k.prototype.$init=function(){return this.constructor.prototype.init.apply(this,arguments)};k.prototype.$__init=function(e,t){if(e==null)throw new nA(e,"doc","init");if(this.$isNew=!1,t=t||{},e._id!=null&&t.populated&&t.populated.length){let n=String(e._id);for(let s of t.populated){if(s.isVirtual)this.$populated(s.path,U.getValue(s.path,e),s);else this.$populated(s.path,s._docs[n],s);if(s._childDocs==null)continue;for(let i of s._childDocs){if(i?.$__==null)continue;i.$__.parent=this}s._childDocs=[]}}eU(this,e,this._doc,t),Cye(this,t.populated),this.$emit("init",this),this.constructor.emit("init",this);let r=this.$__.exclude===!1&&this.$__.selected?HL(this.$__.selected):null;return tA(this,this.$__.selected,this.$__.exclude,r,!1,this.$__.skipDefaults),this};function eU(e,t,r,n,s){if(s=s||"",typeof t!=="object"||Array.isArray(t))throw new zL(e.$basePath,t);if(qn(t))t=t._doc;let i=Object.keys(t),o=i.length,u,a,c,l=e.$__.strictMode,f=e.$__schema,h=f.options.strictRead;for(let d=0;d<o;++d){if(c=i[d],iA.has(c))continue;if(a=s?s+c:c,u=f.path(a),f.$isRootDiscriminator&&!e.$__isSelected(a))continue;let p=t[c];if(!u&&h&&f.pathType(a)==="adhocOrUndefined"){if(h==="throw")throw new p1(a,"Field `"+a+"` is not in schema and strictRead is set to throw.");else if(h===!0)continue}if(!u&&U.isPOJO(p)){if(!Object.hasOwn(r,c)&&c in r)continue;if(!r[c]){if(r[c]={},!l&&!s&&!(c in f.tree)&&!(c in f.methods)&&!(c in f.virtuals)&&rA(c))e[c]=r[c];else if(n?.virtuals&&Object.hasOwn(f.virtuals,c))e[c]=r[c]}eU(e,p,r[c],n,a+".")}else if(!u){if(h==="throw")throw new p1(a,"Field `"+a+"` is not in schema and strictRead is set to throw.");else if(h===!0)continue;if(r[c]=p,!l&&!s){if(rA(c))e[c]=p}else if(n?.virtuals&&Object.hasOwn(f.virtuals,c))e[c]=p;else if(n?.strict==="throw")throw new p1(c)}else{if(Object.hasOwn(r,c)&&p!==void 0&&!n.hydratedPopulatedDocs)delete r[c];if(p===null)r[c]=u._castNullish(null);else if(p!==void 0){let _=qn(p)?p.$__.wasPopulated:null;if(u&&!_&&!n.hydratedPopulatedDocs)try{if(n?.setters)r[c]=u.applySetters(p,e,!1,null,n);else r[c]=u.cast(p,e,!0,void 0,n)}catch(y){e.invalidate(y.path,new WL({path:y.path,message:y.message,type:"cast",value:y.value,reason:y}))}else if(u&&n.hydratedPopulatedDocs){if(r[c]=u.cast(p,e,!0,void 0,{hydratedPopulatedDocs:!0}),qn(r[c])&&r[c].$__.wasPopulated)e.$populated(a,r[c].$__.wasPopulated.value,r[c].$__.wasPopulated.options);else if(Array.isArray(r[c])&&r[c].length&&qn(r[c][0])&&r[c][0].$__.wasPopulated)e.$populated(a,r[c].map((y)=>qn(y)?y.$__.wasPopulated?.value:null).filter((y)=>y!=null),r[c][0].$__.wasPopulated.options)}else r[c]=p}let m=e.$__.activePaths;if(m.states.modify==null||!e.$isModified(a))m.init(a)}}}function rA(e){return!e.startsWith("$")&&!$ye.has(e)}k.prototype.updateOne=function(t,r){let n=this.constructor.updateOne(),s=this;return n.pre(async function(){let o=await s._execDocumentPreHooks("updateOne",r,[s,t,r]);if(o[0]!==s||o[1]!==t||o[2]!==r)throw Error("Document updateOne pre hooks cannot overwrite arguments");if(n.updateOne({_id:s._doc._id},t,r),s.$where!=null)this.where(s.$where);if(s.$session()!=null){if(!("session"in n.options))n.options.session=s.$session()}return o}),n.post(function(){return s._execDocumentPostHooks("updateOne",r)}),n};k.prototype.replaceOne=function(){let t=[...arguments];return t.unshift({_id:this._doc._id}),this.constructor.replaceOne.apply(this.constructor,t)};k.prototype.$session=function(t){if(arguments.length===0){if(this.$__.session?.hasEnded)return this.$__.session=null,null;return this.$__.session}if(t?.hasEnded)throw new wr("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(t==null&&this.$__.session==null)return;if(this.$__.session=t,!this.$isSubdocument){let r=this.$getAllSubdocs();for(let n of r)n.$session(t)}return t};k.prototype.$timestamps=function(t){if(arguments.length===0){if(this.$__.timestamps!=null)return this.$__.timestamps;if(this.$__schema)return this.$__schema.options.timestamps;return}let r=this.$timestamps();if(t!==r)this.$__.timestamps=t;return this};k.prototype.overwrite=function(t){let r=new Set(Object.keys(this._doc));for(let s of Object.keys(t))r.add(s);let n=this.$__schema.options;for(let s of r){if(s==="_id")continue;if(n.versionKey&&s===n.versionKey)continue;if(n.discriminatorKey&&s===n.discriminatorKey)continue;this.$set(s,t[s])}return this};k.prototype.$set=function(t,r,n,s){if(U.isPOJO(n))s=n,n=void 0;let i=n===!0;if(n&&!i){let y=this.$__.adhocPaths||(this.$__.adhocPaths={});y[t]=this.$__schema.interpretAsType(t,n,this.$__schema.options)}let o=s!=null&&"strict"in s,u=o?s.strict:this.$__.strictMode;if(t==null)[t,r]=[r,t];if(typeof t!=="string"){let y=t;if(y instanceof k)if(y.$__isNested)y=y.toObject();else y=y.$__schema===this.$__schema?uA(y,{...y._doc}):y._doc;let E=r?r+".":"";for(let A of IL(this.$__schema,y)){let M=E+A,O=y[A],x=this.$__schema.pathType(M);if(i&&!E&&O!=null&&x==="nested"&&this._doc[A]!=null)delete this._doc[A];if(x==="nested"&&U.isNonBuiltinObject(O)){this.$set(M,O,i,s),vye(this.$get(M),M,this);continue}if(u){if(i&&O===void 0&&this.$get(M)!==void 0)continue;if(x==="adhocOrUndefined")x=Z3(this,M,{typeOnly:!0});if(x!=="real"&&x!=="virtual"){if(u==="throw")throw x==="nested"?new zL(A,O):new p1(A);if(x!=="nested"||O!=null)continue}}this.$set(M,O,i,s)}let w=this._doc,b={};for(let A of Object.keys(this.$__schema.tree))if(Object.hasOwn(w,A))b[A]=w[A];for(let A of Object.keys(w))if(!Object.hasOwn(b,A))b[A]=w[A];return this._doc=b,this}let a=t.indexOf(".");if(a!==-1){let y=this.$__schema.aliases[t.slice(0,a)];if(typeof y==="string")t=y+t.slice(a)}let c=a===-1?[t]:t.split("."),l=this.$__schema.pathType(t);if(l==="adhocOrUndefined")l=Z3(this,c,{typeOnly:!0});if(l==="adhocOrUndefined"&&!o){let y=Aye(this.$__schema,c);if(y!==void 0)u=y}r=Oye(r,!0);let f=this.$__.priorDoc!=null?this.$__.priorDoc.$__getValue(t):i?void 0:this.$__getValue(t);if(l==="nested"&&r){if(typeof r==="object")r=Rye(r,GL);if(r==null||typeof r!=="object")return this.invalidate(t,new wr.CastError("Object",r,t)),this;let y=this.$__.savedState,E=y!=null&&Object.hasOwn(y,t);if(y!=null&&!this.$isNew&&!E){let A=this.$__getValue(t);y[t]=A;for(let M of Object.keys(A||{}))y[t+"."+M]=A[M]}if(s?.merge)return this.$set(r,t,i,s);let w=this.$isModified(t);Q3(this,t),this.$__setValue(t,{});let b={...s,_skipMarkModified:!0};for(let A of IL(this.$__schema,r,t))this.$set(t+"."+A,r[A],i,b);if(f!=null&&(!w||E)&&U.deepEqual(E?y[t]:f,r))this.unmarkModified(t);else this.markModified(t);return this}let h;if(l==="adhocOrUndefined"&&u){let y="";for(let E=0;E<c.length-1;++E)if(y=E===0?c[0]:y+"."+c[E],this.$__schema.pathType(y)==="virtual")return YL.set(t,r,this),this;if(h=this.$__schema.path(t)??Z3(this,t),h==null){if(u==="throw")throw new p1(t);return this}}else if(l==="virtual")return this.$__schema.virtualpath(t).applySetters(r,this),this;else h=this.$__path(t);let d=t,p=this._doc,m="";for(let y=0;y<c.length-1;++y)if(p=p instanceof Map?p.get(c[y]):p[c[y]],m+=(m.length!==0?".":"")+c[y],!p){if(this.$set(m,{}),!this.$__isSelected(m))this.unmarkModified(m);if(p=this.$__getValue(m),p===null){d=m;break}}if(!h){if(this.$__set(d,t,s,i,c,h,r,f),l==="nested"&&r==null)Q3(this,t);return this}if(h.$isSingleNested||h.$isMongooseArray)Vye(this,t);if(r!=null&&s?.merge&&h.$isSingleNested){if(r instanceof k)r=r.toObject({virtuals:!1,transform:!1});for(let y of Object.keys(r))this.$set(t+"."+y,r[y],i,s);return this}let _=!0;try{let y=!1;if(r instanceof k&&h.options!=null){let{modelName:A,baseModelName:M}=r.constructor,O=h.options.ref;if(typeof O==="function"&&!O[$L])O=O.call(this,this);if(O=O?.modelName||O,O!=null&&(O===A||O===M))y=!0;else if(h.options.refPath!=null){let x=h.options.refPath;if(typeof x==="function"&&!x[$L]){let P=this.$__fullPathWithIndexes?.();x=x.call(this,this,P?P+"."+t:t)}if(typeof x!=="string")throw new wr("`refPath` must be a string or a function that returns a string, got "+ay(x));let v=this.ownerDocument().get(x);y=v===A||v===M}}let E=!1;if(y&&(!r.$__.wasPopulated||U.deepEqual(r.$__.wasPopulated.value,r._doc._id))){let A=h.$isSingleNested?h.cast(r,this):r._doc._id;this.$populated(t,A,{[vL]:r.constructor}),r.$__.wasPopulated={value:A},E=!0}let w=h.options?.[this.$__schema.options.typeKey],b=Array.isArray(w)?w[0]?.ref:null;if(b&&kye(r,b)){this.$populated(t,r.map((A)=>A._doc._id),{[vL]:r[0].constructor});for(let A of r)A.$__.wasPopulated={value:A._doc._id};E=!0}if(!y||!h.$isSingleNested){let A=this;if(KL(this.$__schema.singleNestedPaths,t)!=null&&c.length>1)A=Nye(this,c,this.schema);let M={path:t};if(s?.overwriteImmutable)M.overwriteImmutable=!0;r=h.applySetters(r,A,!1,f,M)}if(h.$isMongooseDocumentArray&&Array.isArray(r)&&qn(r[0])&&r[0].$__.populated!=null){let A=r[0].$__.populated;for(let M of Object.keys(A))this.$populated(t+"."+M,r.map((O)=>O.$populated(M)),A[M].options);E=!0}if(!E&&this.$__.populated){if(Array.isArray(r)&&this.$__.populated[t]){for(let A=0;A<r.length;++A)if(r[A]instanceof k)r.set(A,r[A]._doc._id,!0)}delete this.$__.populated[t]}if(r!=null&&h.$isSingleNested)zye(r,h,f);this.$markValid(t)}catch(y){if(y instanceof wr.StrictModeError&&y.isImmutableError)this.invalidate(t,y);else if(y instanceof wr.CastError)this.invalidate(y.path,y);else this.invalidate(t,new wr.CastError(h.instance,r,t,y));_=!1}if(_){let y=null,E=null;if(!i){let w=this.$isSubdocument?this.ownerDocument():this;y=w.$__.savedState,E=this.$isSubdocument?this.$__.fullPath+"."+t:t,w.$__saveInitialState(E)}if(this.$__set(d,t,s,i,c,h,r,f),y!=null&&Object.hasOwn(y,E)){let w=this.$__.session,b=w?.[Iye]?.get(this)?.modifiedPaths,A=b!=null&&!b.has(E);if((!w?.transaction||A)&&U.deepEqual(r,y[E]))this.unmarkModified(t)}}if(h.$isSingleNested&&(this.isDirectModified(t)||r==null)||h.$isSchemaMap&&r==null)Q3(this,t);return this};/*!
285
- * ignore
286
- */function kye(e,t){if(!Array.isArray(e))return!1;if(e.length===0)return!1;for(let r of e){if(!(r instanceof k))return!1;if(r.constructor.modelName==null)return!1;if(r.constructor.modelName!=t&&r.constructor.baseModelName!=t)return!1}return!0}k.prototype.set=k.prototype.$set;k.prototype.$__shouldModify=function(e,t,r,n,s,i,o,u){if(r?._skipMarkModified)return!1;if(this.$isNew)return!0;if(t in this.$__.activePaths.getStatePaths("modify"))return!0;if(o===void 0&&!this.$__isSelected(t))return!0;if(o===void 0&&t in this.$__.activePaths.getStatePaths("default"))return!1;if(this.$populated(t)&&o instanceof k&&uy(o._doc._id,u))return!1;if(!uy(o,u!==void 0?u:U.getValue(t,this)))return!0;if(!n&&o!==null&&o!==void 0&&t in this.$__.activePaths.getStatePaths("default")&&uy(o,i.getDefault(this,n)))return!0;return!1};k.prototype.$__set=function(e,t,r,n,s,i,o,u){uf=uf||d1();let a=this.$isNew&&!r?._skipMarkModified?!0:this.$__shouldModify(e,t,r,n,s,i,o,u);if(a){if(this.$__.primitiveAtomics?.[t]){if(delete this.$__.primitiveAtomics[t],U.hasOwnKeys(this.$__.primitiveAtomics)===!1)delete this.$__.primitiveAtomics}if(this.markModified(e),o&&U.isMongooseArray(o)){if(o._registerAtomic("$set",o),U.isMongooseDocumentArray(o))o.forEach(function(d){d&&d.__parentArray&&(d.__parentArray=o)})}}else if(Array.isArray(o)&&Array.isArray(u)&&U.isMongooseArray(o)&&U.isMongooseArray(u)){if(o[ts]=u[ts],o[cf]=u[cf],U.isMongooseDocumentArray(o))o.forEach((d)=>{if(d!=null)d.$isNew=!1})}let c=this._doc,l=0,f=s.length,h="";for(;l<f;l++){let p=l+1===f;if(h+=h?"."+s[l]:s[l],iA.has(s[l]))continue;if(p)if(c instanceof Map)c.set(s[l],o);else if(c.$isSingleNested){if(!(s[l]in c))c[s[l]]=o,c._doc[s[l]]=o;else c._doc[s[l]]=o;if(a)c.markModified(s[l])}else c[s[l]]=o;else{let m=c instanceof Map,_=m?c.get(s[l]):c[s[l]],y=qn(c)&&!c.$__isNested?c._doc:c;if(!m&&!Object.hasOwn(y,s[l])&&s[l]in c)return;if(U.isPOJO(_))c=_;else if(_&&_ instanceof uf)c=_;else if(_&&!Array.isArray(_)&&_.$isSingleNested)c=_;else if(_&&Array.isArray(_))c=_;else if(_==null){if(_={},m)c.set(s[l],_);else c[s[l]]=_;c=_}else c=_}}};k.prototype.$__getValue=function(e){if(typeof e!=="string"&&!Array.isArray(e))throw TypeError(`Invalid \`path\`. Must be either string or array. Got "${e}" (type ${typeof e})`);return U.getValue(e,this._doc)};k.prototype.$inc=function(t,r){if(r==null)r=1;if(Array.isArray(t))return t.forEach((a)=>this.$inc(a,r)),this;let n=this.$__path(t);if(n==null){if(this.$__.strictMode==="throw")throw new p1(t);else if(this.$__.strictMode===!0)return this}else if(n.instance!=="Number")return this.invalidate(t,new wr.CastError(n.instance,r,t)),this;let s=this.$__getValue(t)||0,i=!1,o=null,u=r;try{r=n.cast(r),o=n.applySetters(s+r,this),u=o-s,i=!0}catch(a){this.invalidate(t,new wr.CastError("number",r,t,a))}if(i){if(this.$__.primitiveAtomics=this.$__.primitiveAtomics||{},this.$__.primitiveAtomics[t]==null)this.$__.primitiveAtomics[t]={$inc:u};else this.$__.primitiveAtomics[t].$inc+=u;this.markModified(t),this.$__setValue(t,o)}return this};k.prototype.$__setValue=function(t,r){if(Array.isArray(t)&&t.length===1)return this._doc[t[0]]=r,this;return U.setValue(t,r,this._doc),this};k.prototype.get=function(e,t,r){let n;if(r==null)r={};if(t)n=this.$__schema.interpretAsType(e,t,this.$__schema.options);let s=r.noDottedPath,i=s?Object.hasOwn(this.$__schema.paths,e)?this.$__schema.paths[e]:void 0:this.$__path(e);if(i==null){if(i=this.$__schema.virtualpath(e),i!=null)return i.applyGetters(void 0,this)}if(s){let c=Object.hasOwn(this._doc,e)?this._doc[e]:void 0;if(n)c=n.cast(c);if(i!=null&&r.getters!==!1)return i.applyGetters(c,this);return c}if(i?.instance==="Mixed"){let c=this.$__schema.virtualpath(e);if(c!=null)i=c}let o=e.indexOf(".")!==-1,u=this._doc,a=o?e.split("."):[e];if(typeof this.$__schema.aliases[a[0]]==="string")a[0]=this.$__schema.aliases[a[0]];for(let c=0,l=a.length;c<l;c++){if(iA.has(a[c]))return;if(u&&u._doc)u=u._doc;if(u==null)u=void 0;else if(u instanceof Map)u=u.get(a[c],{getters:!1});else if(c===l-1)u=U.getValue(a[c],u);else u=u[a[c]]}if(n)u=n.cast(u);if(i!=null&&r.getters!==!1)u=i.applyGetters(u,this);else if(Object.hasOwn(this.$__schema.nested,e)&&r.virtuals)return uA(this,zi(u)||{},{path:e});return u};/*!
287
- * ignore
288
- */k.prototype[Bye]=k.prototype.get;k.prototype.$get=k.prototype.get;k.prototype.$__path=function(e){let t=this.$__.adhocPaths,r=t&&Object.hasOwn(t,e)?t[e]:null;if(r)return r;return this.$__schema.path(e)};k.prototype.markModified=function(e,t){if(this.$__saveInitialState(e),this.$__.activePaths.modify(e),t!=null&&!this.$isSubdocument)this.$__.pathsToScopes=this.$__pathsToScopes||{},this.$__.pathsToScopes[e]=t};/*!
289
- * ignore
290
- */k.prototype.$__saveInitialState=function(t){let r=this.$__.savedState,n=t;if(r!=null){let s=n.indexOf("."),i=s===-1?n:n.slice(0,s);if(!Object.hasOwn(r,i))r[i]=zi(this.$__getValue(i))}};k.prototype.unmarkModified=function(e){if(this.$__.activePaths.init(e),this.$__.pathsToScopes!=null)delete this.$__.pathsToScopes[e]};k.prototype.$ignore=function(e){this.$__.activePaths.ignore(e)};k.prototype.directModifiedPaths=function(){return Object.keys(this.$__.activePaths.getStatePaths("modify"))};k.prototype.$isEmpty=function(e){let t={minimize:!0,virtuals:!1,getters:!1,transform:!1};if(arguments.length!==0){let r=this.$get(e);if(r==null)return!0;if(typeof r!=="object")return!1;if(U.isPOJO(r))return tU(r);return Object.keys(r.toObject(t)).length===0}return Object.keys(this.toObject(t)).length===0};/*!
291
- * ignore
292
- */function tU(e){if(e==null)return!0;if(typeof e!=="object"||Array.isArray(e))return!1;for(let t of Object.keys(e))if(!tU(e[t]))return!1;return!0}k.prototype.modifiedPaths=function(e){e=e||{};let t=Object.keys(this.$__.activePaths.getStatePaths("modify")),r=new Set,n=0,s=0,i=t.length;for(n=0;n<i;++n){let o=t[n],u=sA(o),a=u.length;for(s=0;s<a;++s)r.add(u[s]);if(!e.includeChildren)continue;let c=0,l=this.$get(o);if(typeof l==="object"&&l!==null){if(l._doc)l=l._doc;let f=l.length;if(Array.isArray(l))for(c=0;c<f;++c){let h=o+"."+c;if(!r.has(h)){if(r.add(h),qn(l[c])){let d=l[c].modifiedPaths(),p=0,m=d.length;for(p=0;p<m;++p)r.add(h+"."+d[p])}}}else{let h=Object.keys(l),d=0,p=h.length;for(d=0;d<p;++d)r.add(o+"."+h[d])}}}return Array.from(r)};k.prototype[XL]=k.prototype.modifiedPaths;k.prototype.isModified=function(e,t,r){if(e){let n=t?.ignoreAtomics,s=this.$__.activePaths.states.modify;if(s==null)return!1;if(typeof e==="string")e=e.indexOf(" ")===-1?[e]:e.split(" ");for(let a of e)if(s[a]!=null)return!0;let i=r||this[XL](),o=e.some(function(a){return!!~i.indexOf(a)}),u=Object.keys(s);if(n)u=u.filter((a)=>{let c=this.$__getValue(a);if(c?.[ts]!=null&&c[ts].$set===void 0)return!1;return!0});return o||e.some(function(a){return u.some(function(c){return c===a||a.startsWith(c+".")})})}return this.$__.activePaths.some("modify")};k.prototype.$isModified=k.prototype.isModified;k.prototype[xye]=k.prototype.isModified;k.prototype.$isDefault=function(e){if(e==null)return this.$__.activePaths.some("default");if(typeof e==="string"&&e.indexOf(" ")===-1)return Object.hasOwn(this.$__.activePaths.getStatePaths("default"),e);let t=e;if(!Array.isArray(t))t=t.split(" ");return t.some((r)=>Object.hasOwn(this.$__.activePaths.getStatePaths("default"),r))};k.prototype.$isDeleted=function(e){if(arguments.length===0)return!!this.$__.isDeleted;return this.$__.isDeleted=!!e,this};k.prototype.isDirectModified=function(e){if(e==null)return this.$__.activePaths.some("modify");if(typeof e==="string"&&e.indexOf(" ")===-1){let r=Object.hasOwn(this.$__.activePaths.getStatePaths("modify"),e);if(r||e.indexOf(".")===-1)return r;let n=e.split(".");for(let s=0;s<n.length-1;++s){let i=n.slice(0,s+1).join("."),o=this.$get(i);if(qn(o)&&o.isDirectModified(n.slice(s+1).join(".")))return!0}return!1}let t=e;if(typeof t==="string")t=t.split(" ");return t.some((r)=>this.isDirectModified(r))};k.prototype.isInit=function(e){if(e==null)return this.$__.activePaths.some("init");if(typeof e==="string"&&e.indexOf(" ")===-1)return Object.hasOwn(this.$__.activePaths.getStatePaths("init"),e);let t=e;if(!Array.isArray(t))t=t.split(" ");return t.some((r)=>Object.hasOwn(this.$__.activePaths.getStatePaths("init"),r))};k.prototype.isSelected=function(t){if(this.$__.selected==null)return!0;if(!t)return!1;if(t==="_id")return this.$__.selected._id!==0;if(t.indexOf(" ")!==-1)t=t.split(" ");if(Array.isArray(t))return t.some((o)=>this.$__isSelected(o));let r=rU(this),{paths:n,inclusive:s}=r;if(r.onlyId)return this.$__.selected._id===0;if(s===null)return!0;if(t in this.$__.selected)return s;let i=t.indexOf(".")!==-1;if(!r.hasNestedKey){if(i)for(let o=t.indexOf(".");o!==-1;o=t.indexOf(".",o+1)){let u=t.slice(0,o);if(u!=="_id"&&Object.hasOwn(this.$__.selected,u))return s}return!s}for(let o of n){if(o==="_id")continue;if(o.charAt(t.length)==="."&&o.slice(0,t.length)===t)return s||o!==t+".";if(i&&t.charAt(o.length)==="."&&t.slice(0,o.length)===o)return s}return!s};/*!
293
- * Computes and caches the derived properties of `doc.$__.selected` that
294
- * `isSelected()` and `isDirectSelected()` would otherwise recompute on every
295
- * call. `$__.selected` is assigned once in the Document constructor and never
296
- * mutated afterwards, so this can safely be cached for the document's lifetime.
297
- */function rU(e){if(e.$__.selectedIndex!==void 0)return e.$__.selectedIndex;let t=e.$__.selected,r=Object.keys(t),n=null,s=!1;for(let i of r){if(i==="_id")continue;if(i.indexOf(".")!==-1)s=!0;if(n===null&&Sye(t[i]))n=!!t[i]}return e.$__.selectedIndex={paths:r,inclusive:n,hasNestedKey:s,onlyId:r.length===1&&r[0]==="_id"}}k.prototype.$__isSelected=k.prototype.isSelected;k.prototype.isDirectSelected=function(t){if(this.$__.selected==null)return!0;if(t==="_id")return this.$__.selected._id!==0;if(t.indexOf(" ")!==-1)t=t.split(" ");if(Array.isArray(t))return t.some((n)=>this.isDirectSelected(n));let r=rU(this);if(r.onlyId)return this.$__.selected._id===0;if(r.inclusive===null)return!0;if(Object.hasOwn(this.$__.selected,t))return r.inclusive;return!r.inclusive};k.prototype.validate=async function(t,r){if(typeof t==="function"||typeof r==="function"||typeof arguments[2]==="function")throw new wr("Document.prototype.validate() no longer accepts a callback");if(this.$op="validate",arguments.length===1){if(typeof arguments[0]==="object"&&!Array.isArray(arguments[0]))r=arguments[0],t=null}if(r&&typeof r.pathsToSkip==="string"){let i=r.pathsToSkip.indexOf(" ")===-1;r.pathsToSkip=i?[r.pathsToSkip]:r.pathsToSkip.split(" ")}let n=r?._skipParallelValidateCheck;if(this.$isSubdocument!=null);else if(this.$__.validating&&!n)throw new pye(this);else if(!n)this.$__.validating=!0;let s=this.$__middleware.hasHooks("validate");try{try{if(s)[r]=await this._execDocumentPreHooks("validate",r,[r]);else if(!n)await Promise.resolve()}catch(y){if(s)await this._execDocumentPostHooks("validate",r,y);return}if(this.$__.saveOptions&&this.$__.saveOptions.pathsToSave&&!t)t=[...this.$__.saveOptions.pathsToSave];let i=r&&typeof r==="object"&&"validateModifiedOnly"in r,o=r?.pathsToSkip||null,u;if(i)u=!!r.validateModifiedOnly;else u=this.$__schema.options.validateModifiedOnly;this.$__.validateModifiedOnly=u;let a=r?.validateAllPaths;if(a){if(o)throw TypeError("Cannot set both `validateAllPaths` and `pathsToSkip`");if(t)throw TypeError("Cannot set both `validateAllPaths` and `pathsToValidate`");if(i&&u)throw TypeError("Cannot set both `validateAllPaths` and `validateModifiedOnly`")}let c=this,l,f;if(a)[l,f]=nU(this);else{let y=sU(this,t,o);l=u?y[0].filter((E)=>this.$isModified(E)):y[0],f=y[1]}if(typeof t==="string")t=t.split(" ");if(l.length===0){let y=kL(this);if(s)await this._execDocumentPostHooks("validate",r,y);else if(y!=null)throw y;return}let h={},d=Array.isArray(this.$__.saveOptions?.pathsToSave)?new Set(this.$__.saveOptions.pathsToSave):null,p=[];for(let y=0;y<l.length;++y){let E=l[y];if(d!=null&&!d.has(E)){p.push(Promise.resolve(null));continue}if(E==null||h[E]){p.push(Promise.resolve(null));continue}h[E]=!0;let w=c.$__schema.path(E);if(!w){p.push(Promise.resolve(null));continue}if(!c.$isValid(E)){p.push(Promise.resolve(null));continue}if(w[ZL]!=null&&E!==w.path){p.push(Promise.resolve(null));continue}let b=c.$__getValue(E),A;if(A=c.$populated(E))b=A;else if(qn(b)&&b.$__.wasPopulated)b=b._doc._id;let M=c.$__.pathsToScopes!=null&&E in c.$__.pathsToScopes?c.$__.pathsToScopes[E]:c,O={...f[E],path:E,validateAllPaths:a,_nestedValidate:!0};if(u)O.validateModifiedOnly=!0;p.push(w.doValidate(b,M,O).then(()=>null,(x)=>{if((w.$isSingleNested||w.$isArraySubdocument||w.$isMongooseDocumentArray)&&x instanceof af)return null;return x}))}let m=await Promise.all(p);for(let y=0;y<m.length;++y){let E=m[y];if(E==null)continue;if(this.$__.validationError==null)this.$__.validationError=new af(this);c.invalidate(l[y],E,void 0,!0)}let _=kL(this);if(s)await this._execDocumentPostHooks("validate",r,_);else if(_!=null)throw _}finally{this.$__.validateModifiedOnly=void 0,this.$op=null,this.$__.validating=null}};k.prototype.$validate=k.prototype.validate;/*!
298
- * Event emitting and error persisting logic that needs to happen in both the `paths.length === 0`
299
- * and `paths.length > 0` cases in `Document.prototype.validate()`.
300
- *
301
- * @param {Document} doc
302
- * @return {Error}
303
- * @private
304
- */function kL(e){let t=e.$__.validationError;if(e.$__.validationError=null,e.$__.validating=null,e.$__.validateModifiedOnly&&t!=null){let r=Object.keys(t.errors);for(let n of r)if(!e.$isModified(n))delete t.errors[n];if(U.hasOwnKeys(t.errors)===!1)t=void 0}if(e.$__.cachedRequired=null,e.$emit("validate",e),e.constructor.emit("validate",e),t){for(let r in t.errors)if(!e[Mye]&&t.errors[r]instanceof wr.CastError)e.invalidate(r,t.errors[r])}return t}/*!
305
- * Build the list for `validateAllPaths`. The document array path validates
306
- * every subdocument, but skips nullish elements. Add those elements separately
307
- * so their element-level validators still run.
308
- */function nU(e){let t=Object.keys(e.$__schema.paths).filter((n)=>n.charAt(n.length-1)!=="*"||n.charAt(n.length-2)!=="$"||n.charAt(n.length-3)!=="."),r={};for(let n=0;n<t.length;++n){let s=t[n],i=e.$__schema.path(s);if(i==null)continue;let o=e.$__getValue(s);if(!o)continue;if(i.$isSchemaMap)for(let u of o.keys())t.push(s+"."+u);else if(i.$isMongooseDocumentArray){if(i.embeddedSchemaType?.validators.length)for(let u=0;u<o.length;++u){let a=s+"."+u;t.push(a),r[a]={skipSubdocumentValidation:!0,index:u}}}else if(i.$isMongooseArray)oA(o,t,s)}return[t,r]}/*!
309
- * ignore
310
- */var qL=Object.freeze(["init","default","modify"]),jL=42;/*!
311
- * Builds the list of paths to run validation on, plus per-path options for
312
- * `doValidate()`.
313
- *
314
- * `activePaths` tells us which paths changed (`require`, `init`, `default`,
315
- * `modify`), but that is neither a complete nor a minimal list of paths to
316
- * validate, in four separate ways. Each phase below fixes exactly one:
317
- *
318
- * 1. Seed Collect the changed paths, dropping ones that have nothing to
319
- * run and ones a subdocument already validates for us.
320
- * 2. Resolve Some entries are not schema paths at all: a modified nested
321
- * object is stored as one entry (`nest`), but the paths that
322
- * have validators are its children (`nest.name`).
323
- * 3. Cover Replace changed descendants with their actual subdocument or
324
- * document array, which owns validation below that path.
325
- * 4. Augment Primitive arrays, required document array elements, and maps
326
- * need concrete element or key paths listed individually.
327
- *
328
- * Validating a subdocument or document array validates everything underneath
329
- * it, so `arr` makes `arr.0.name` redundant. Phase 3 uses the actual
330
- * subdocuments and their modified paths to remove descendants seeded earlier.
331
- * It runs for nested documents as well, so every document selects containers
332
- * from its own schema without relying on `$parentSchemaDocArray`.
333
- *
334
- * If a document array element is modified, for example `arr.0.name`,
335
- * array-level validators on `arr` still run. This behavior dates back to gh-6818.
336
- *
337
- * `pathsToValidate` / `pathsToSkip` are applied before augment, so that asking
338
- * for `arr` still validates its elements. Duplicates are fine; both callers
339
- * skip paths they have already validated.
340
- */function sU(e,t,r){let n=e.$__schema,{paths:s,singleNestedPaths:i}=n,o=e.$__.activePaths.states,u={},a={},c=new Set,l=o.require;if(l!=null){let p=null;for(let m in l){let _=Object.hasOwn(s,m),y=_?s[m]:n.path(m);if(typeof y?.originalRequiredValue==="function"){let w=e.$__.cachedRequired??(e.$__.cachedRequired={});try{w[m]=y.originalRequiredValue.call(e,e)}catch(b){e.invalidate(m,b)}}if(!e.$__isSelected(m)){if(p??=e.modifiedPaths(),!e.$isModified(m,null,p))continue}if(m.charCodeAt(m.length-1)===jL&&m.endsWith(".$*"))continue;let E=e.$__.cachedRequired;if(E!=null&&m in E&&!E[m])continue;if(!_&&y!=null&&Object.hasOwn(i,m))continue;if(c.add(m),y!=null&&y.schema!=null)a[m]=!0}}for(let p=0;p<qL.length;++p){let m=o[qL[p]];if(m==null)continue;for(let _ in m){if(_.charCodeAt(_.length-1)===jL&&_.endsWith(".$*"))continue;let y=Object.hasOwn(s,_),E=y?s[_]:n.path(_);if(E!=null&&(qye(E)||!y&&Object.hasOwn(i,_)))continue;if(E?.[ZL]!=null&&_!==E.path)continue;if(c.add(_),E!=null&&E.schema!=null)a[_]=!0}}if(c.size===0&&e.$__hasOnlyPrimitiveValues())return[[],u];for(let p of c){if(!KL(n.nested,p))continue;c.delete(p);let m=e.$__getValue(p);if(m==null||Array.isArray(m))continue;for(let _ of Object.keys(m)){let y=p+"."+_;if(c.add(y),Object.hasOwn(s,y)&&s[y].schema!=null)a[y]=!0}}let f=null,h=[],d=[];for(let p of Object.keys(s)){let m=s[p];if(m.$isSingleNested||m.$isMongooseDocumentArray){h.push([p,m]);continue}if(!m.$isSchemaMap||!m.$__schemaType.$isMongooseDocumentArray)continue;f??=e.modifiedPaths();let _=e.$get(p);if(_==null)continue;for(let y of _.keys()){let E=p+"."+y;if(f.includes(E))d.push([E,m.$__schemaType])}}for(let[p,m]of h.concat(d)){f??=e.modifiedPaths();let _;if(m.$isSingleNested){let E=e.$get(p);if(E==null)continue;_=[E]}else if(m.$isMongooseDocumentArray){if(_=e.$get(p),!_?.length)continue;if(f.includes(p)&&(m.validators.length>0||a[p]===!0)){if(a[p]!==!0&&!Object.hasOwn(o.modify,p))u[p]={skipSchemaValidators:!0};c.add(p),a[p]=!0}}else continue;let y=m.$isMongooseDocumentArray&&a[p]===!0;for(let E of _){if(E==null||!E.$basePath)continue;let w=m.$isMongooseDocumentArray?p+"."+E.__index:E.$__pathRelativeToParent(),b=E.$parent();if(b==null)throw Error("Cannot validate subdocument that does not have a parent");if(y){c.delete(w);for(let A of E.modifiedPaths({includeChildren:!0}))c.delete(w+"."+A);if(p!==m.path&&Object.hasOwn(o.modify,w))u[w]={skipSchemaValidators:!1}}if(!e.$isModified(w,null,f)||Object.hasOwn(b.$__.activePaths.getStatePaths("modify"),w)||b.$isDefault(w))continue;if(!y)for(let A of E.modifiedPaths())c.delete(w+"."+A);if(!y&&a[p]!==!0)c.add(w);if(a[w]=!0,e.$__.pathsToScopes??={},e.$__.pathsToScopes[w]=E.$isDocumentArrayElement?E.__parentArray:E.$parent(),u[w]??=E.$isDocumentArrayElement?{}:{skipSchemaValidators:!0},E.$isDocumentArrayElement&&E.__index!=null)u[w].index=E.__index}}if(Array.isArray(t))c=Lye(c,t);else if(Array.isArray(r))c=Uye(c,r);jye(e,c,u);for(let p of c){let m=n.path(p);if(!m||!m.$isSchemaMap)continue;let _=e.$__getValue(p);if(_==null)continue;for(let y of _.keys())c.add(p+"."+y)}return[Array.from(c),u]}/*!
341
- * Optimization: skip paths that cannot produce a validation error, either a
342
- * primitive with no validators or an array of primitives with no validators on
343
- * the array or its elements.
344
- */function qye(e){if(!e.schema&&!e.embeddedSchemaType&&e.validators.length===0&&!e.$isSchemaMap&&!e.$isSchemaUnion)return!0;return!!e.$isMongooseArray&&!e.$isMongooseDocumentArray&&!e.embeddedSchemaType.$isMongooseArray&&e.validators.length===0&&e.embeddedSchemaType.validators.length===0}function jye(e,t,r){for(let n of t){let s=e.$__schema.path(n);if(!s)continue;if(!s.$isMongooseArray||!Array.isArray(s)&&s.$isMongooseDocumentArray&&!s.embeddedSchemaType?.validators.length)continue;if(s.$isMongooseArray&&!s.$isMongooseDocumentArray&&!s.embeddedSchemaType.$isMongooseArray&&s.embeddedSchemaType.validators.length===0)continue;let i=e.$__getValue(n);if(s.$isMongooseDocumentArray){let o=i?.length??0;for(let u=0;u<o;++u){let a=n+"."+u;t.add(a),r[a]={...r[n],...r[a],skipSubdocumentValidation:!0,index:u}}continue}oA(i,t,n)}}function oA(e,t,r){if(e!=null){let n=e.length;for(let s=0;s<n;++s)if(Array.isArray(e[s]))oA(e[s],t,r+"."+s);else if(Array.isArray(t))t.push(r+"."+s);else t.add(r+"."+s)}}/*!
345
- * ignore
346
- */k.prototype._execDocumentPreHooks=function(t,r,n){let s=QL(r,"pre");return this.$__middleware.execPre(t,this,n||[],{filter:s})};/*!
347
- * ignore
348
- */k.prototype._execDocumentPostHooks=function(t,r,n){let s=QL(r,"post");return this.$__middleware.execPost(t,this,[this],{error:n,filter:s})};/*!
349
- * ignore
350
- */function Lye(e,t){let r=new Set(t),n=new Map([]);for(let i of t){if(i.indexOf(".")===-1)continue;let o=i.split("."),u=o[0];for(let a=1;a<o.length;++a)n.set(u,i),u=u+"."+o[a]}let s=new Set;for(let i of e){let o=!1,u=i.length;while((u=i.lastIndexOf(".",u-1))!==-1)if(r.has(i.slice(0,u))){o=!0;break}if(r.has(i)||o)s.add(i);else if(n.has(i))s.add(n.get(i))}return s}/*!
351
- * ignore
352
- */function Uye(e,t){t=new Set(t);for(let r of e)if(t.has(r))e.delete(r);return e}k.prototype.validateSync=function(){return U.warn("Mongoose: `Document.prototype.validateSync()` is deprecated and will be removed in Mongoose 10. Use `Document.prototype.validate()` instead."),this.$__validateSync.apply(this,arguments)};/*!
353
- * ignore
354
- */k.prototype.$__validateSync=function(e,t){let r=this;if(arguments.length===1&&typeof arguments[0]==="object"&&!Array.isArray(arguments[0]))t=arguments[0],e=null;let n=t&&typeof t==="object"&&"validateModifiedOnly"in t,s;if(n)s=!!t.validateModifiedOnly;else s=this.$__schema.options.validateModifiedOnly;let i=t?.pathsToSkip,o=t?.validateAllPaths;if(o){if(i)throw TypeError("Cannot set both `validateAllPaths` and `pathsToSkip`");if(e)throw TypeError("Cannot set both `validateAllPaths` and `pathsToValidate`")}if(typeof e==="string")e=e.indexOf(" ")===-1?[e]:e.split(" ");else if(typeof i==="string"&&i.indexOf(" ")!==-1)i=i.split(" ");let u,a;if(o)[u,a]=nU(this);else{let f=sU(this,e,i);u=s?f[0].filter((h)=>this.$isModified(h)):f[0],a=f[1]}let c={};for(let f=0,h=u.length;f<h;++f){let d=u[f];if(c[d])continue;c[d]=!0;let p=r.$__schema.path(d);if(!p)continue;if(!r.$isValid(d))continue;let m=r.$__getValue(d),_=a[d],y=p.doValidateSync(m,r,{..._!=null&&typeof _==="object"?_:null,skipSchemaValidators:typeof _==="object"?_.skipSchemaValidators:_,path:d,validateModifiedOnly:s,validateAllPaths:o,_nestedValidate:!0});if(y){if((p.$isSingleNested||p.$isArraySubdocument||p.$isMongooseDocumentArray)&&y instanceof af)continue;r.invalidate(d,y,void 0,!0)}}let l=r.$__.validationError;if(r.$__.validationError=void 0,r.$emit("validate",r),r.constructor.emit("validate",r),l){for(let f in l.errors)if(l.errors[f]instanceof wr.CastError)r.invalidate(f,l.errors[f])}return l};k.prototype.invalidate=function(e,t,r,n){if(!this.$__.validationError)this.$__.validationError=new af(this);if(this.$__.validationError.errors[e])return;if(!t||typeof t==="string")t=new WL({path:e,message:t,type:n||"user defined",value:r});if(this.$__.validationError===t)return this.$__.validationError;if(typeof t.setModel==="function"){let s=this.ownerDocument();if(Eye(s)==="model")t.setModel(s.constructor)}return this.$__.validationError.addError(e,t),this.$__.validationError};k.prototype.$markValid=function(e){if(!this.$__.validationError?.errors[e])return;if(delete this.$__.validationError.errors[e],U.hasOwnKeys(this.$__.validationError.errors)===!1)this.$__.validationError=null};/*!
355
- * ignore
356
- */function Vye(e,t){if(!e.$__.validationError)return;let r=Object.keys(e.$__.validationError.errors);for(let n of r)if(n.startsWith(t+"."))delete e.$__.validationError.errors[n];if(U.hasOwnKeys(e.$__.validationError.errors)===!1)e.$__.validationError=null}/*!
357
- * ignore
358
- */function zye(e,t,r){let n=t.schema;if(n==null)return;for(let s of Object.keys(n.paths)){let i=n.paths[s];if(i.$immutableSetter==null)continue;let o=r==null?void 0:r.$__getValue(s);i.$immutableSetter.call(e,o)}}k.prototype.$isValid=function(e){if(this.$__.validationError==null||U.hasOwnKeys(this.$__.validationError.errors)===!1)return!0;if(e==null)return!1;if(e.indexOf(" ")!==-1)e=e.split(" ");if(Array.isArray(e))return e.some((t)=>this.$__.validationError.errors[t]==null);return this.$__.validationError.errors[e]==null};k.prototype.$__reset=function(t,r){r=r??this.$__hasOnlyPrimitiveValues();let n=!this.$isSubdocument&&!r?this.$getAllSubdocs({useCache:!0}):null;if(n?.length>0)for(let s of n)s.$__reset(t);if(!r)this.$__resetAtomics();if(!t)this.$__.backup={},this.$__.backup.activePaths={modify:this.$__.activePaths.getStatePaths("modify"),default:this.$__.activePaths.getStatePaths("default")},this.$__.backup.validationError=this.$__.validationError,this.$__.backup.errors=this.$errors;if(this.$__.activePaths.clearAllExcept("init"),this.$__.validationError)this.$__.validationError=void 0;if(this.$errors)this.$errors=void 0;for(let s of this.$__schema.requiredPaths())this.$__.activePaths.require(s);return this};/*!
359
- * Clear atomics on all dirty (modified + default) paths. This is a lighter
360
- * alternative to calling `$__dirty()` when we only need to clear atomics
361
- * and don't need the full {path, value, schema} objects or parent-path
362
- * deduplication.
363
- */k.prototype.$__resetAtomics=function(){let t=this.$__.activePaths,r=t.getStatePaths("modify"),n=t.getStatePaths("default");LL(this,r),LL(this,n)};function LL(e,t){if(t==null)return;let r=e.$__schema.paths,n=Object.keys(t);for(let s=0;s<n.length;++s){let i=Object.hasOwn(r,n[s])?r[n[s]]:null;if(i!=null&&!i.$isMongooseArray&&!i.$isSchemaMap&&!i.$isSchemaUnion&&i.instance!=="Mixed")continue;let o=e.$__getValue(n[s]);if(o!=null){if(typeof o.clearAtomics==="function")o.clearAtomics();else if(o[ts])o[cf]=o[ts],o[ts]={}}}}/*!
364
- * ignore
365
- */k.prototype.$__undoReset=function(){if(this.$__.backup?.activePaths==null)return;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 t of this.$__dirty()){let r=t.value;if(r?.[ts]&&r[cf])r[ts]=r[cf]}if(!this.$isSubdocument)for(let t of this.$getAllSubdocs())t.$__undoReset()};k.prototype.$__dirty=function(){let e=this,t=this.$__.activePaths.map("modify",function(s){return{path:s,value:e.$__getValue(s),schema:e.$__path(s)}});t=t.concat(this.$__.activePaths.map("default",function(s){if(s==="_id"||e.$__getValue(s)==null)return;return{path:s,value:e.$__getValue(s),schema:e.$__path(s)}}));let r=new Map(t.filter((s)=>s!=null).map((s)=>[s.path,s.value])),n=[];return t.forEach(function(s){if(!s)return;let i=null,o=!1,u=sA(s.path);for(let a=0;a<u.length-1;a++)if(r.has(u[a])){i=r.get(u[a]),o=!0;break}if(!o)n.push(s);else if(i!=null&&i[ts]!=null&&i.hasAtomics())i[ts]={},i[ts].$set=i}),n};k.prototype.$__setSchema=function(e){yye(e.tree,this,void 0,e.options);for(let t of Object.keys(e.virtuals))e.virtuals[t]._applyDefaultGetters();if(e.path("schema")==null)this.schema=e;this.$__schema=e,this.$__middleware=e._getDocumentMiddleware(this.$isSubdocument),this[Pye]=e};k.prototype.$__getArrayPathsToValidate=function(){return cy||(cy=Za()),this.$__.activePaths.map("init","modify",function(e){return this.$__getValue(e)}.bind(this)).filter(function(e){return e&&Array.isArray(e)&&U.isMongooseDocumentArray(e)&&e.length}).reduce(function(e,t){return e.concat(t)},[]).filter(function(e){return e})};k.prototype.$getAllSubdocs=function(e){if(e?.useCache&&this.$__.saveOptions?.__subdocs)return this.$__.saveOptions.__subdocs;cy||(cy=Za()),uf=uf||d1();let t=[];function r(n){let s=[];for(let{model:i}of n.$__schema.childSchemas){let o=n.$__getValue(i.path);if(o==null)continue;if(qn(o))s.push(o);if(Array.isArray(o)){for(let u of o)if(qn(u))s.push(u)}if(o instanceof Map){for(let u of o.values())if(qn(u))s.push(u)}}for(let i of s)r(i);t.push(...s)}if(r(this),this.$__.saveOptions)this.$__.saveOptions.__subdocs=t;return t};/*!
366
- * Runs queued functions
367
- */function Wye(e){let t=e.$__schema&&e.$__schema.callQueue;if(!t.length)return;for(let r of t)if(r[0]!=="pre"&&r[0]!=="post"&&r[0]!=="on")e[r[0]].apply(e,r[1])}/*!
368
- * ignore
369
- */k.prototype.$__handleReject=function(t){if(this.$listeners("error").length)this.$emit("error",t);else if(this.constructor.listeners?.("error").length)this.constructor.emit("error",t)};k.prototype.$toObject=function(e,t){let r=this.$__schema._defaultToObjectOptions(t),n=this.$__hasOnlyPrimitiveValues();e=U.isPOJO(e)?{...e}:{},e._calledWithOptions=e._calledWithOptions||{...e};let s;if(e._calledWithOptions.minimize!=null)s=e.minimize;else if(this.$__schemaTypeOptions?.minimize!=null)s=this.$__schemaTypeOptions.minimize;else if(r?.minimize!=null)s=r.minimize;else s=this.$__schema.options.minimize;if(e.minimize=s,!n)e._seen=e._seen||new Map;if((e._calledWithOptions.depopulate??r?.depopulate??e.depopulate??!1)&&e._isNested&&this.$__.wasPopulated)return zi(this.$__.wasPopulated.value||this._doc._id,e);if(r!=null){for(let d of Object.keys(r))if(e[d]==null)e[d]=r[d]}e._isNested=!0,e.json=t;let o=e._parentOptions;e._parentOptions=this.$isSubdocument?e:null;let u=e._calledWithOptions.schemaFieldsOnly??e.schemaFieldsOnly??r?.schemaFieldsOnly??!1,a;if(n&&!e.flattenObjectIds&&!e.flattenDecimals)a=this.$__toObjectShallow(u);else if(u){a={};for(let d of Object.keys(this.$__schema.paths)){let p=this.$__getValue(d);if(p===void 0)continue;let m=d,_=a;if(d.indexOf(".")!==-1){let y=d.split(".");m=y[y.length-1];for(let E=0;E<y.length-1;++E)_[y[E]]=_[y[E]]??{},_=_[y[E]]}if(p===null){_[m]=null;continue}_[m]=zi(p,e)}}else a=zi(this._doc,e)||{};let c=e._calledWithOptions.getters??e.getters??r?.getters??!1;if(c){if(Hye(this,a),e.minimize)a=bye(a)||{}}let l=e._calledWithOptions.virtuals??r?.virtuals??o?.virtuals??void 0;if(l||c&&l!==!1)uA(this,a,e,e);if(e.versionKey===!1&&this.$__schema.options.versionKey)delete a[this.$__schema.options.versionKey];let f=e._calledWithOptions.transform??!0,h=void 0;if(f===!0)h=r?.transform;else if(typeof f==="function")h=f;if(f)Kye(this,a);if(e.useProjection)Gye(this,a);if(typeof h==="function"){let d=h(this,a,e);if(typeof d<"u")a=d}return a};/*!
370
- * Internal shallow clone alternative to `$toObject()`: much faster, no options processing
371
- */k.prototype.$__toObjectShallow=function(t){let r={};if(this._doc!=null){let n=t?Object.keys(this.$__schema.paths):Object.keys(this._doc);for(let s of n){let i=this._doc[s];if(i instanceof Date)r[s]=new Date(i);else if(i!==void 0)r[s]=i}}return r};k.prototype.toObject=function(e){return this.$toObject(e)};/*!
372
- * Applies virtuals properties to `json`.
373
- */function uA(e,t,r,n){let s=e.$__schema,i=s.virtuals,o=Object.keys(i),u=o.length,a=u,c,l,f=e._doc,h,d=typeof n?.aliases==="boolean"?n.aliases:!0;r=r||{};let p=null;if(Array.isArray(r.virtuals))p=new Set(r.virtuals);else if(r.virtuals?.pathsToSkip){p=new Set(o);for(let m=0;m<r.virtuals.pathsToSkip.length;m++)if(p.has(r.virtuals.pathsToSkip[m]))p.delete(r.virtuals.pathsToSkip[m])}if(!f)return t;for(u=0;u<a;++u){if(c=o[u],p!=null&&!p.has(c))continue;if(!d&&Object.hasOwn(s.aliases,c))continue;if(l=c,r.path!=null){if(!c.startsWith(r.path+"."))continue;l=c.substring(r.path.length+1)}if(l.indexOf(".")===-1&&l===c){if(h=i[c].applyGetters(void 0,e),h===void 0)continue;h=zi(h,r),t[l]=h;continue}let m=l.split(".");if(h=zi(e.get(c),r),h===void 0)continue;let _=m.length;f=t;for(let y=0;y<_-1;++y)f[m[y]]=f[m[y]]||{},f=f[m[y]];f[m[_-1]]=h}return t}function Hye(e,t){let r=e.$__schema,n=Object.keys(r.paths),s=n.length,i,o=e._doc,u;if(!o)return t;while(s--){i=n[s];let a=r.paths[i];if(!a.getters?.length&&!a.embeddedSchemaType?.getters?.length)continue;if(!e.$__isSelected(i))continue;if(i.indexOf(".")===-1){if(t[i]=a.applyGetters(t[i],e),Array.isArray(t[i])&&a.embeddedSchemaType)for(let p=0;p<t[i].length;++p)t[i][p]=a.embeddedSchemaType.applyGetters(t[i][p],e);continue}let c=i.split("."),l=c.length,f=l-1,h=t,d;o=e._doc;for(let p=0;p<l;++p){if(d=c[p],u=o[d],h!=null&&typeof h!=="object")break;else if(p===f){if(h[d]=a.applyGetters(h[d],e),Array.isArray(h[d])&&a.embeddedSchemaType)for(let m=0;m<h[d].length;++m)h[d][m]=a.embeddedSchemaType.applyGetters(h[d][m],e)}else if(u==null){if(d in o)h[d]=u;break}else h=h[d]||(h[d]={});o=u}}return t}function Kye(e,t){let r=e.$__schema,n=r.pathsWithTransforms();if(!e._doc||!n)return t;for(let i of n){let o=r.paths[i],u=o.options.transform??o.constructor?.defaultOptions?.transform,a=o.embeddedSchemaType?.options?.transform??o.embeddedSchemaType?.constructor?.defaultOptions?.transform;if(typeof u==="function"){let c=e.$get(i);if(c===void 0)continue;let l=u.call(e,c);UL(i,l),U.setValue(i,l,t)}else if(typeof a==="function"){let c=e.$get(i);if(c===void 0)continue;let l=[].concat(c);for(let f=0;f<l.length;++f){let h=a.call(e,l[f]);l[f]=h,UL(i,h)}t[i]=l}}return t}function UL(e,t){if(Dye(t))throw Error("`transform` function must be synchronous, but the transform on path `"+e+"` returned a promise.")}/*!
374
- * ignore
375
- */function Gye(e,t){let r=e.$__schema,n=Object.keys(r.paths||{});if(!e._doc)return t;let i=e.$__.selected;if(i===void 0)i={},JL.applyPaths(i,r);if(i==null||U.hasOwnKeys(i)===!1)return t;for(let o of n)if(i[o]!=null&&!i[o])delete t[o];return t}k.prototype.toJSON=function(e){return this.$toObject(e,!0)};/*!
376
- * ignore
377
- */k.prototype.ownerDocument=function(){return this};k.prototype.parent=function(){if(this.$isSubdocument||this.$__.wasPopulated)return this.$__.parent;return this};k.prototype.$parent=k.prototype.parent;k.prototype.$__setParent=function(t){this.$__.parent=t,this.$__parent=t};k.prototype.inspect=function(e){let t=U.isPOJO(e),r;if(t)r=e,r.minimize=!1;let n=arguments.length>0?this.toObject(r):this.toObject();if(n==null)return"MongooseDocument { "+n+" }";return n};if(ay.custom)k.prototype[ay.custom]=k.prototype.inspect;k.prototype.toString=function(){let e=this.inspect();if(typeof e==="string")return e;return ay(e)};k.prototype.equals=function(e){if(!e)return!1;let t=this.$__getValue("_id"),r=qn(e)?e.$__getValue("_id"):e;if(!t&&!r)return uy(this,e);return t&&t.equals?t.equals(r):t===r};k.prototype.populate=async function(){let t={},r=[...arguments];if(typeof r[r.length-1]==="function")throw new wr("Document.prototype.populate() no longer accepts a callback");if(r.length!==0){let i=U.populate.apply(null,r);for(let o of i)t[o.path]=o}let n=U.object.vals(t),s=this.constructor;if(this.$__isNested){s=this.$__[Fye].constructor;let i=this.$__.nestedPath;n.forEach(function(o){o.path=i+"."+o.path})}if(this.$session()!=null){let i=this.$session();n.forEach((o)=>{if(o.options==null){o.options={session:i};return}if(!("session"in o.options))o.options.session=i})}return n.forEach((i)=>{i._localModel=s}),s.populate(this,n)};k.prototype.$getPopulatedDocs=function(){let t=[];if(this.$__.populated!=null)t=t.concat(Object.keys(this.$__.populated));let r=[];for(let n of t){let s=this.$get(n);if(Array.isArray(s))r=r.concat(s);else if(s instanceof k)r.push(s)}return r};k.prototype.populated=function(e,t,r){if(t==null||t===!0){if(!this.$__.populated)return;if(typeof e!=="string")return;let s=e.endsWith(".$*")?e.replace(/\.\$\*$/,""):e,i=this.$__.populated[s];if(i)return t===!0?i:i.value;return}this.$__.populated||(this.$__.populated={}),this.$__.populated[e]={value:t,options:r};let n=e.split(".");for(let s=0;s<n.length-1;++s){let i=n.slice(0,s+1).join("."),o=this.$get(i);if(qn(o)&&this.$populated(i)){let u=n.slice(s+1).join(".");o.$populated(u,t,r);break}}return t};k.prototype.$populated=k.prototype.populated;k.prototype.$assertPopulated=function(t,r){if(Array.isArray(t))return t.forEach((n)=>this.$assertPopulated(n,r)),this;if(arguments.length>1)this.$set(r);if(!this.$populated(t))throw new wr(`Expected path "${t}" to be populated`);return this};k.prototype.depopulate=function(e){if(typeof e==="string")e=e.indexOf(" ")===-1?[e]:e.split(" ");let t,r=this.$$populatedVirtuals?Object.keys(this.$$populatedVirtuals):[],n=this.$__?.populated||{};if(arguments.length===0){for(let i of r)delete this.$$populatedVirtuals[i],delete this._doc[i],delete n[i];let s=Object.keys(n);for(let i of s){if(t=this.$populated(i),!t)continue;if(delete n[i],Array.isArray(t)){let o=U.getValue(i,this._doc);if(o.isMongooseArray){let u=o.__array;for(let a=0;a<u.length;++a){let c=u[a];if(c==null)continue;u[a]=c instanceof k?c._doc._id:c._id}}else U.setValue(i,t,this._doc)}else U.setValue(i,t,this._doc)}return this}for(let s of e)if(t=this.$populated(s),delete n[s],r.indexOf(s)!==-1)delete this.$$populatedVirtuals[s],delete this._doc[s];else if(t)if(Array.isArray(t)){let i=U.getValue(s,this._doc);if(i.isMongooseArray){let o=i.__array;for(let u=0;u<o.length;++u){let a=o[u];if(a==null)continue;o[u]=a instanceof k?a._doc._id:a._id}}else U.setValue(s,t,this._doc)}else U.setValue(s,t,this._doc);return this};k.prototype.$__fullPath=function(e){return e||""};k.prototype.$getChanges=function(){let e=this.$__delta();return e?e[1]:{}};k.prototype.getChanges=function(){return U.warn("`getChanges()` is deprecated, use `$getChanges()` instead."),this.$getChanges()};k.prototype.$__delta=function(t,r){let n=this.$__dirty(),s=n,i=null;if(t!=null){s=[],i=[];for(let h of n)if(X3(h.path,r,t))s.push(h);else i.push(h)}let o=this.$__schema.options.optimisticConcurrency;if(o)if(Array.isArray(o)){if(!this.$__schema.options._optimisticConcurrencyTrie)this.$__schema.options._optimisticConcurrencyTrie=new NL(o);let h=this.$__schema.options._optimisticConcurrencyTrie,d=this.directModifiedPaths();if(t==null?d.find((m)=>h.overlapsPath(m.indexOf(".")===-1?m:m.split("."))):d.find((m)=>h.overlapsPath(m.indexOf(".")===-1?m:m.split("."))&&X3(m,r,t)))this.$__.version=s.length?3:1}else if(Array.isArray(o?.exclude)){if(!this.$__schema.options._optimisticConcurrencyExcludeTrie)this.$__schema.options._optimisticConcurrencyExcludeTrie=new NL(o.exclude);let h=this.$__schema.options._optimisticConcurrencyExcludeTrie,d=this.directModifiedPaths();if(t==null?d.find((m)=>!h.matchesPathOrAncestor(m.indexOf(".")===-1?m:m.split("."))):d.find((m)=>!h.matchesPathOrAncestor(m.indexOf(".")===-1?m:m.split("."))&&X3(m,r,t)))this.$__.version=s.length?3:1}else this.$__.version=s.length?3:1;if(!s.length&&this.$__.version!==3)return;let u={},a={},c=s.length,l=[],f=0;if(u._id=this._doc._id,qn(u?._id))u._id=u._id.toObject({transform:!1,depopulate:!0});for(;f<c;++f){let h=s[f],d=h.value,p=Yye(this,h.path,d);if(p){l.push(p);continue}if(!this.$populated(h.path,!0)&&this.$__.selected){let _=h.path.split("."),y=_[0];if(this.$__.selected[y]&&this.$__.selected[y].$elemMatch)if(_.length>1&&_[1]==0&&typeof u[y]>"u")u[y]=this.$__.selected[y],_[1]="$",h.path=_.join(".");else{l.push(h.path);continue}}if(this.$isDefault(h.path)&&this.$__.selected){if(h.path.indexOf(".")===-1&&RL(this.$__.selected,h.path))continue;if(sA(h.path).find((y)=>RL(this.$__.isSelected,y)))continue}if(l.length)continue;if(d===void 0)Xo(this,u,a,h,1,"$unset");else if(d===null)Xo(this,u,a,h,null);else if(typeof d.getAtomics==="function")Jye(this,u,a,h,d);else if(d[VL.pathSymbol]&&Buffer.isBuffer(d))d=d.toObject(),Xo(this,u,a,h,d);else if(this.$__.primitiveAtomics?.[h.path]!=null){let _=this.$__.primitiveAtomics[h.path],y=_ye(_);Xo(this,u,a,h,_[y],y)}else d=zi(d,{depopulate:!0,transform:!1,virtuals:!1,getters:!1,omitUndefined:!0,_isNested:!0}),Xo(this,u,a,h,d)}if(l.length)throw new hye(l);if(this.$__.version)this.$__version(u,a);if(U.hasOwnKeys(a)===!1)return[u,null,i];return[u,a,i]};function Yye(e,t,r){let n=e.$populated(t,!0);if(!n&&e.$__.selected){let i=t.split(".")[0];if(e.$__.selected[i]&&e.$__.selected[i].$slice!=null&&U.isMongooseArray(r)){if(r[ts].$set)return i}if(e.$__.selected[i+".$"])return i}if(!(n&&U.isMongooseArray(r)))return;if(n.options.match||n.options.options&&Object.hasOwn(n.options.options,"limit")||n.options.options?.skip||n.options.select&&(n.options.select._id===0||/\s?-_id\s?/.test(n.options.select))){let i=r[ts];if(U.hasOwnKeys(i)===!1||i.$set||i.$pop)return t}}function Xo(e,t,r,n,s,i){if(i||(i="$set"),!r[i])r[i]={};if(r[i][n.path]=s,e.$__schema.options.versionKey===!1)return;if(Qye(e,n.path))return;if((3&e.$__.version)===3)return;if(e.$__schema.options.optimisticConcurrency===!0||Array.isArray(e.$__schema.options.optimisticConcurrency)||Array.isArray(e.$__schema.options.optimisticConcurrency?.exclude))return;switch(i){case"$set":case"$unset":case"$pop":case"$pull":case"$pullAll":case"$push":case"$addToSet":case"$inc":break;default:return}if(i==="$push"||i==="$addToSet"||i==="$pullAll"||i==="$pull")if(/\.\d+\.|\.\d+$/.test(n.path))e.$__.version=3;else e.$__.version|=2;else if(/^\$p/.test(i))e.$__.version=3;else if(Array.isArray(s))e.$__.version=3;else if(/\.\d+\.|\.\d+$/.test(n.path))e.$__.version|=1}function Jye(e,t,r,n,s){if(r.$set?.[n.path])return;if(typeof s.getAtomics==="function"){s.getAtomics().forEach(function(f){let h=f[0],d=f[1];Xo(e,t,r,n,d,h)});return}if(typeof s.$__getAtomics==="function"){s.$__getAtomics().forEach(function(f){let h=f[0],d=f[1];Xo(e,t,r,n,d,h)});return}let i=s[ts],o=Object.keys(i),u=o.length,a,c;if(u===0){if(U.isMongooseObject(s))s=s.toObject({depopulate:1,_isNested:!0});else if(s.valueOf)s=s.valueOf();return Xo(e,t,r,n,s)}function l(f){return U.isMongooseObject(f)?f.toObject({depopulate:1,_isNested:!0}):f}while(u--){if(c=o[u],a=i[c],U.isMongooseObject(a))a=a.toObject({depopulate:!0,transform:!1,_isNested:!0});else if(Array.isArray(a))a=a.map(l);else if(a.valueOf)a=a.valueOf();if(c==="$addToSet")a={$each:a};Xo(e,t,r,n,a,c)}}function Qye(e,t){let r=e.$__schema.options.skipVersioning;if(!r)return!1;return t=t.replace(/\.\d+\./,"."),r[t]}k.prototype.$clone=function(){let t=new this.constructor;if(t.$isNew=this.$isNew,this._doc)t._doc=zi(this._doc,{retainDocuments:!0,parentDoc:t});if(this.$__){let n=new this.$__.constructor;for(let s of Object.getOwnPropertyNames(this.$__)){if(s==="activePaths")continue;n[s]=zi(this.$__[s])}Object.assign(n.activePaths,zi({...this.$__.activePaths})),t.$__=n}return t};k.prototype.$createModifiedPathsSnapshot=function(){let t=new WeakMap;if(!this.$isSubdocument){let r=this.$getAllSubdocs();for(let n of r)t.set(n,n.$__.activePaths.clone())}return new dye(t,this.$__.activePaths.clone(),this.$__.version)};k.prototype.$restoreModifiedPathsSnapshot=function(t){if(this.$__.activePaths=t.activePaths.clone(),this.$__.version=t.version,!this.$isSubdocument){let r=this.$getAllSubdocs();for(let n of r)if(t.subdocSnapshot.has(n))n.$__.activePaths=t.subdocSnapshot.get(n)}return this};k.prototype.$clearModifiedPaths=function(){if(this.$__.activePaths.clear("modify"),this.$__.activePaths.clear("init"),this.$__.version=0,!this.$isSubdocument){let t=this.$getAllSubdocs();for(let r of t)r.$clearModifiedPaths()}return this};/*!
378
- * Check if the given document only has primitive values
379
- */k.prototype.$__hasOnlyPrimitiveValues=function(){if(this.$__.populated)return!1;let t=this._doc;for(let r in t){let n=t[r];if(n==null||typeof n!=="object")continue;if(Array.isArray(n))return!1;if(n instanceof Date||n instanceof Boolean||n instanceof Number||n instanceof String)continue;let s=n._bsontype;if(s==="ObjectId"||s==="Decimal128")continue;return!1}return!0};/*!
380
- * Increment this document's version if necessary.
381
- */k.prototype._applyVersionIncrement=function(){if(!this.$__.version)return;let t=(2&this.$__.version)===2;if(this.$__.version=void 0,t){let r=this.$__schema.options.versionKey,n=this.$__getValue(r)||0;this.$__setValue(r,n+1)}};/*!
382
- * Module exports.
383
- */k.VERSION_WHERE=1;k.VERSION_INC=2;k.VERSION_ALL=3;k.ValidationError=af;oU.exports=iU=k});var Oe=g(function(Cr){/*!
384
- * Module dependencies.
385
- */var Xye=we().UUID,Zye=Lq(),dy=ks(),e2e=ca(),fU=$m(),cA=Zt(),t2e=Ou(),r2e=Wa(),py=xm(),my=Zq(),hy=gn(),ma=vn(),n2e=So(),s2e=U6(),lf=Zh(),i2e=vm(),Zo=la(),{trustedSymbol:y1}=n1(),aA;Cr.specialProperties=Zo;Cr.isMongooseArray=py.isMongooseArray;Cr.isMongooseDocumentArray=my.isMongooseDocumentArray;Cr.registerMongooseArray=py.registerMongooseArray;Cr.registerMongooseDocumentArray=my.registerMongooseDocumentArray;var lA=/\s/,hA=/\s+/;Cr.toCollectionName=function(e,t){if(e==="system.profile")return e;if(e==="system.indexes")return e;if(typeof t==="function"){if(typeof e!=="string")throw TypeError("Collection name must be a string");if(e.length===0)throw TypeError("Collection name cannot be empty");return t(e)}return e};Cr.deepEqual=function e(t,r){if(t===r)return!0;if(typeof t!=="object"||typeof r!=="object")return t===r;if(t instanceof Date&&r instanceof Date)return t.getTime()===r.getTime();if(ma(t,"ObjectId")&&ma(r,"ObjectId")||ma(t,"Decimal128")&&ma(r,"Decimal128"))return t.toString()===r.toString();if(t instanceof RegExp&&r instanceof RegExp)return t.source===r.source&&t.ignoreCase===r.ignoreCase&&t.multiline===r.multiline&&t.global===r.global&&t.dotAll===r.dotAll&&t.unicode===r.unicode&&t.sticky===r.sticky&&t.hasIndices===r.hasIndices;if(t==null||r==null)return!1;if(t.prototype!==r.prototype)return!1;if(t instanceof Map||r instanceof Map){if(!(t instanceof Map)||!(r instanceof Map))return!1;return e(Array.from(t.keys()),Array.from(r.keys()))&&e(Array.from(t.values()),Array.from(r.values()))}if(t instanceof Set||r instanceof Set){if(!(t instanceof Set)||!(r instanceof Set))return!1;if(t.size!==r.size)return!1;return e(Array.from(t.values()),Array.from(r.values()))}if(t instanceof Number&&r instanceof Number)return t.valueOf()===r.valueOf();if(Buffer.isBuffer(t))return Cr.buffer.areEqual(t,r);if(Array.isArray(t)||Array.isArray(r)){if(!Array.isArray(t)||!Array.isArray(r))return!1;let o=t.length;if(o!==r.length)return!1;for(let u=0;u<o;++u)if(!e(t[u],r[u]))return!1;return!0}if(hy(t))t=t._doc;else if(lf(t))t=t.toObject();if(hy(r))r=r._doc;else if(lf(r))r=r.toObject();let n=Object.keys(t),s=Object.keys(r),i=n.length;if(i!==s.length)return!1;for(let o=i-1;o>=0;o--)if(n[o]!==s[o])return!1;for(let o of n)if(!e(t[o],r[o]))return!1;return!0};Cr.last=function(e){if(e==null)return;if(e.length>0)return e[e.length-1];return};/*!
386
- * ignore
387
- */Cr.cloneArrays=function(t){if(!Array.isArray(t))return t;return t.map((r)=>Cr.cloneArrays(r))};/*!
388
- * ignore
389
- */Cr.omit=function(t,r){if(r==null)return Object.assign({},t);if(!Array.isArray(r))r=[r];let n=Object.assign({},t);for(let s of r)delete n[s];return n};Cr.clonePOJOsAndArrays=function(t){if(t==null)return t;if(hy(t))return t;if(n2e(t)){t={...t};for(let r of Object.keys(t))t[r]=Cr.clonePOJOsAndArrays(t[r]);return t}if(Array.isArray(t)){t=[...t];for(let r=0;r<t.length;++r)t[r]=Cr.clonePOJOsAndArrays(t[r]);return t}return t};Cr.merge=function e(t,r,n,s){if(n=n||{},r==null)return t;let i=Object.keys(r),o=0,u=i.length,a;if(r[y1])t[y1]=r[y1];s=s||"";let c=n.omitNested||{};while(o<u){if(a=i[o++],n.omit&&n.omit[a])continue;if(c[s])continue;if(Zo.has(a))continue;if(t[a]==null)t[a]=Cr.clonePOJOsAndArrays(r[a]);else if(Cr.isObject(r[a])){if(!Cr.isObject(t[a]))t[a]={};if(r[a]!=null){if(n.isDiscriminatorSchemaMerge&&(r[a].$isSingleNested&&t[a].$isMongooseDocumentArray||r[a].$isMongooseDocumentArray&&t[a].$isSingleNested))continue;else if(r[a].instanceOfSchema){if(t[a].instanceOfSchema)i2e(t[a],r[a].clone(),n.isDiscriminatorSchemaMerge);else t[a]=r[a].clone();continue}else if(ma(r[a],"ObjectId")){t[a]=new e2e(r[a]);continue}}e(t[a],r[a],n,s?s+"."+a:a)}else if(n.overwrite)t[a]=r[a]}return t};Cr.toObject=function e(t){aA||(aA=wo());let r;if(t==null)return t;if(t instanceof aA)return t.toObject();if(Array.isArray(t)){r=[];for(let n of t)r.push(e(n));return r}if(Cr.isPOJO(t)){if(r={},t[y1])r[y1]=t[y1];for(let n of Object.keys(t)){if(Zo.has(n))continue;r[n]=e(t[n])}return r}return t};Cr.isObject=r2e;Cr.isPOJO=So();Cr.isNonBuiltinObject=function(t){return typeof t==="object"&&!Array.isArray(t)&&!(t instanceof Date)&&!(t instanceof Boolean)&&!(t instanceof Number)&&!(t instanceof String)&&!Cr.isMongooseType(t)&&!(t instanceof Xye)&&t!=null};Cr.isEmptyObject=function(t){if(t==null||typeof t!=="object")return!1;return Cr.hasOwnKeys(t)===!1};Cr.hasOwnKeys=function(t){for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r))return!0;return!1};Cr.hasKey=function(t,r){let n=Object.keys(t);for(let s of n){if(s===r)return!0;if(Cr.isPOJO(t[s])&&Cr.hasKey(t[s],r))return!0}return!1};Cr.tick=function(t){if(typeof t!=="function")return;return function(){try{t.apply(this,arguments)}catch(r){t2e(function(){throw r})}}};Cr.isMongooseType=function(e){return ma(e,"ObjectId")||ma(e,"Decimal128")||e instanceof Buffer};Cr.isMongooseObject=lf;Cr.expires=function(t){if(!(t&&t.constructor.name==="Object"))return;if(!("expires"in t))return;t.expireAfterSeconds=typeof t.expires!=="string"?t.expires:Math.round(Zye(t.expires)/1000),delete t.expires};Cr.populate=function(t,r,n,s,i,o,u,a){let c=null;if(arguments.length===1){if(t instanceof fU)return t._docs={},t._childDocs=[],[t];if(Array.isArray(t))return l(t).map((h)=>Cr.populate(h)[0]);if(Cr.isObject(t))c=Object.assign({},t);else c={path:t}}else if(typeof n==="object")c={path:t,select:r,match:n,options:s};else c={path:t,select:r,model:n,match:s,options:i,populate:o,justOne:u,count:a};if(typeof c.path!=="string"&&!(Array.isArray(c.path)&&c.path.every((f)=>typeof f==="string")))throw TypeError("utils.populate: invalid path. Expected string or array of strings. Got typeof `"+typeof t+"`");return o2e(c);function l(f){let h=[];return f.forEach(function(d){if(lA.test(d.path))d.path.split(hA).forEach(function(m){let _=Object.assign({},d);_.path=m,h.push(_)});else h.push(d)}),h}};function o2e(e){if(Array.isArray(e.populate)){let n=[];e.populate.forEach(function(s){if(lA.test(s.path)){let i=Object.assign({},s);i.path.split(hA).forEach(function(u){i.path=u,n.push(Cr.populate(i)[0])})}else n.push(Cr.populate(s)[0])}),e.populate=Cr.populate(n)}else if(e.populate!=null&&typeof e.populate==="object")e.populate=Cr.populate(e.populate);let t=[],r=lA.test(e.path)?e.path.split(hA):Array.isArray(e.path)?e.path:[e.path];if(e.options!=null)e.options=cA(e.options);for(let n of r)t.push(new fU(Object.assign({},e,{path:n})));return t}Cr.getValue=function(e,t,r){return dy.get(e,t,a2e,r)};/*!
390
- * ignore
391
- */var u2e=Object.freeze({getters:!1});function a2e(e,t){if(t==="$*"&&e instanceof Map)return e;let r=e?._doc||e;if(r?.isMongooseArrayProxy)r=r.__array;return r instanceof Map?r.get(t,u2e):r[t]}Cr.setValue=function(e,t,r,n,s){dy.set(e,t,r,"_doc",n,s)};Cr.object={};Cr.object.vals=function(t){if(t==null)return[];let r=Object.keys(t),n=r.length,s=[];while(n--)s.push(t[r[n]]);return s};Cr.isNullOrUndefined=function(e){return e==null};/*!
392
- * ignore
393
- */Cr.array={};Cr.array.flatten=function e(t,r,n){return n||(n=[]),t.forEach(function(s){if(Array.isArray(s))e(s,r,n);else if(!r||r(s))n.push(s)}),n};/*!
394
- * ignore
395
- */Cr.hasUserDefinedProperty=function(e,t){if(e==null)return!1;if(Array.isArray(t)){for(let r of t)if(Cr.hasUserDefinedProperty(e,r))return!0;return!1}if(Object.hasOwn(e,t))return!0;if(typeof e==="object"&&t in e){let r=e[t];return r!==Object.prototype[t]&&r!==Array.prototype[t]}return!1};/*!
396
- * ignore
397
- */var uU=Math.pow(2,32)-1;Cr.isArrayIndex=function(e){if(typeof e==="number")return e>=0&&e<=uU;if(typeof e==="string"){if(!/^\d+$/.test(e))return!1;return e=+e,e>=0&&e<=uU}return!1};Cr.array.unique=function(e){let t=new Set,r=new Set,n=[];for(let s of e)if(typeof s==="number"||typeof s==="string"||s==null){if(t.has(s))continue;n.push(s),t.add(s)}else if(ma(s,"ObjectId")){let i=s.toString();if(r.has(i))continue;n.push(s),r.add(i)}else n.push(s);return n};Cr.buffer={};Cr.buffer.areEqual=function(e,t){if(!Buffer.isBuffer(e))return!1;if(!Buffer.isBuffer(t))return!1;return e.equals(t)};Cr.getFunctionName=s2e;Cr.decorate=function(e,t){for(let r in t){if(Zo.has(r))continue;e[r]=t[r]}};Cr.mergeClone=function(e,t){if(lf(t))t=t.toObject({transform:!1,virtuals:!1,depopulate:!0,getters:!1,flattenDecimals:!1});let r=Object.keys(t),n=r.length,s=0,i;while(s<n){if(i=r[s++],Zo.has(i))continue;if(!Object.hasOwn(hy(e)?e._doc:e,i)&&i in e)continue;if(typeof e[i]>"u")e[i]=cA(t[i],{transform:!1,virtuals:!1,depopulate:!0,getters:!1,flattenDecimals:!1});else{let o=t[i];if(o?.valueOf&&!(o instanceof Date))o=o.valueOf();if(Cr.isObject(o)){let u=o,a=Buffer.isBuffer(o)&&o.isMongooseBuffer;if(lf(o)&&!a)u=u.toObject({transform:!1,virtuals:!1,depopulate:!0,getters:!1,flattenDecimals:!1});if(a)u=Buffer.from(u);Cr.mergeClone(e[i],u)}else e[i]=cA(o,{flattenDecimals:!1})}}};Cr.each=function(e,t){for(let r of e)t(r)};Cr.renameObjKey=function(e,t,r){return Object.keys(e).reduce((s,i)=>{if(i===t)s[r]=e[t];else s[i]=e[i];return s},{})};/*!
398
- * ignore
399
- */Cr.getOption=function(e){let t=Array.prototype.slice.call(arguments,1);for(let r of t){if(r==null)continue;if(r[e]!=null)return r[e]}return null};/*!
400
- * ignore
401
- */Cr.noop=function(){};Cr.errorToPOJO=function(t){if(!(t instanceof Error))throw Error("`error` must be `instanceof Error`.");let n={};for(let s of Object.getOwnPropertyNames(t))n[s]=t[s];return n};/*!
402
- * ignore
403
- */Cr.warn=function(t){return process.emitWarning(t,{code:"MONGOOSE"})};Cr.injectTimestampsOption=function(t,r){if(r==null)return;t.timestamps=r}});var Er=g(function(gy,OU){/*!
404
- * Module dependencies.
405
- */var _r=$s(),AU=As(),j2e=Im(),L2e=C3(),yy=Zt(),U2e=yi(),dA=Rq(),V2e=vq(),z2e=gn(),pA=qq(),W2e=le().schemaTypeSymbol,jn=Oe(),hf=le().validatorErrorSymbol,H2e=le().documentIsModified,yU=le().populateModelSymbol,mA=_r.CastError,g1=_r.ValidatorError,K2e={_skipMarkModified:!0};function Ie(e,t,r,n){this[W2e]=!0,this.path=e,this.instance=r,this.schemaName=this.constructor.schemaName,this.validators=[],this.getters=Object.hasOwn(this.constructor,"getters")?this.constructor.getters.slice():[],this.setters=Object.hasOwn(this.constructor,"setters")?this.constructor.setters.slice():[],this.splitPath(),t=t||{};let s=this.constructor.defaultOptions||{},i=Object.keys(s);for(let a of i)if(a==="validate")this.validate(s.validate);else if(Object.hasOwn(s,a)&&!Object.hasOwn(t,a))t[a]=s[a];if(t.select==null)delete t.select;let o=this.OptionsConstructor||AU;if(this.options=new o(t),this.parentSchema=n,this._index=null,jn.hasUserDefinedProperty(this.options,"immutable"))this.$immutable=this.options.immutable,dA(this);let u=Object.keys(this.options);for(let a of u){if(a==="cast"){if(Array.isArray(this.options[a]))this.castFunction.apply(this,this.options[a]);else this.castFunction(this.options[a]);continue}if(jn.hasUserDefinedProperty(this.options,a)&&typeof this[a]==="function"){if(a==="index"&&this._index){if(t.index===!1){let f=this._index;if(typeof f==="object"&&f!=null){if(f.unique)throw new _r('Path "'+this.path+'" may not have `index` set to false and `unique` set to true');if(f.sparse)throw new _r('Path "'+this.path+'" may not have `index` set to false and `sparse` set to true')}this._index=!1}continue}let c=t[a];if(a==="default"){this.default(c);continue}let l=Array.isArray(c)?c:[c];this[a].apply(this,l)}}Object.defineProperty(this,"$$context",{enumerable:!1,configurable:!1,writable:!0,value:null})}Ie.prototype.OptionsConstructor=AU;Ie.prototype.path;Ie.prototype.toJSON=function(){let{parentSchema:t,...r}=this;return r};Ie.prototype._createJSONSchemaTypeDefinition=function(t,r,n){let s=n?.useBsonType,i=n?._overrideRequired??(this.options.required==null?n?._defaultRequired===!0||this.path==="_id":this.options.required&&typeof this.options.required!=="function"),o=this.options.allowNull!==!1;if(s){if(i||!o)return{bsonType:r};return{bsonType:[r,"null"]}}if(i||!o)return{type:t};return{type:[t,"null"]}};Ie.prototype._addJSONSchemaEnum=function(t){if(!Array.isArray(this.enumValues)||this.enumValues.length===0)return t;let r=Array.isArray(t.type??t.bsonType);return t.enum=r&&!this.enumValues.includes(null)?[...this.enumValues,null]:[...this.enumValues],t};Ie.prototype.validators;Ie.prototype.isRequired;Ie.prototype.splitPath=function(){if(this._presplitPath!=null)return this._presplitPath;if(this.path==null)return;return this._presplitPath=this.path.indexOf(".")===-1?[this.path]:this.path.split("."),this._presplitPath};Ie.cast=function(t){if(arguments.length===0)return this._cast;if(t===!1)t=(r)=>r;return this._cast=t,this._cast};Ie.prototype.castFunction=function(t,r){if(arguments.length===0)return this._castFunction;if(t===!1)t=this.constructor._defaultCaster||((n)=>n);if(typeof t==="string")return this._castErrorMessage=t,this._castFunction;if(t!=null)this._castFunction=t;if(r!=null)this._castErrorMessage=r;return this._castFunction};Ie.prototype.cast=function(){throw new _r("Base SchemaType class does not implement a `cast()` function")};Ie.set=function(t,r){if(!Object.hasOwn(this,"defaultOptions"))this.defaultOptions=Object.assign({},this.defaultOptions);this.defaultOptions[t]=r};Ie.get=function(e){this.getters=Object.hasOwn(this,"getters")?this.getters:[],this.getters.push(e)};Ie.prototype.default=function(e){if(arguments.length===1){if(e===void 0){this.defaultValue=void 0;return}if(e?.instanceOfSchema)throw new _r("Cannot set default value of path `"+this.path+"` to a mongoose Schema instance.");return this.defaultValue=e,this.defaultValue}else if(arguments.length>1)this.defaultValue=[...arguments];return this.defaultValue};Ie.prototype.index=function(e){return this._index=e,jn.expires(this._index),this};Ie.prototype.unique=function(t,r){if(this._index===!1){if(!t)return;throw new _r('Path "'+this.path+'" may not have `index` set to false and `unique` set to true')}if(!Object.hasOwn(this.options,"index")&&t===!1)return this;if(this._index==null||this._index===!0)this._index={};else if(typeof this._index==="string")this._index={type:this._index};if(this._index.unique=!!t,typeof r==="string")this._duplicateKeyErrorMessage=r;return this};Ie.prototype.text=function(e){if(this._index===!1){if(!e)return this;throw new _r('Path "'+this.path+'" may not have `index` set to false and `text` set to true')}if(!Object.hasOwn(this.options,"index")&&e===!1)return this;if(this._index===null||this._index===void 0||typeof this._index==="boolean")this._index={};else if(typeof this._index==="string")this._index={type:this._index};return this._index.text=e,this};Ie.prototype.sparse=function(e){if(this._index===!1){if(!e)return this;throw new _r('Path "'+this.path+'" may not have `index` set to false and `sparse` set to true')}if(!Object.hasOwn(this.options,"index")&&e===!1)return this;if(this._index==null||typeof this._index==="boolean")this._index={};else if(typeof this._index==="string")this._index={type:this._index};return this._index.sparse=e,this};Ie.prototype.immutable=function(e){return this.$immutable=e,dA(this),this};Ie.prototype.transform=function(e){return this.options.transform=e,this};Ie.prototype.set=function(e){if(typeof e!=="function")throw TypeError("A setter must be a function.");return this.setters.push(e),this};Ie.prototype.get=function(e){if(typeof e!=="function")throw TypeError("A getter must be a function.");return this.getters.push(e),this};Ie.prototype.validateAll=function(e){for(let t=0;t<e.length;t++)this.validate(e[t]);return this};Ie.prototype.validate=function(e,t,r){if(typeof e==="function"||e&&jn.getFunctionName(e.constructor)==="RegExp"){let o;if(typeof t==="function")o={validator:e,message:t},o.type=r||"user defined";else if(t instanceof Object&&!r){if(o=pA(t)?Object.assign({},t):yy(t),!o.message)o.message=o.msg;o.validator=e,o.type=o.type||"user defined"}else{if(t==null)t=_r.messages.general.default;if(!r)r="user defined";o={message:t,type:r,validator:e}}return this.validators.push(o),this}let n,s,i;for(n=0,s=arguments.length;n<s;n++){if(i=arguments[n],!jn.isPOJO(i)){let o="Invalid validator. Received ("+typeof i+") "+i+". See https://mongoosejs.com/docs/api/schematype.html#SchemaType.prototype.validate()";throw new _r(o)}this.validate(i.validator,i)}return this};Ie.prototype.required=function(e,t){let r={};if(arguments.length>0&&e==null)return this.validators=this.validators.filter(function(i){return i.validator!==this.requiredValidator},this),this.isRequired=!1,delete this.originalRequiredValue,this;if(typeof e==="object")r=e,t=r.message||t,e=e.isRequired;if(e===!1)return this.validators=this.validators.filter(function(i){return i.validator!==this.requiredValidator},this),this.isRequired=!1,delete this.originalRequiredValue,this;let n=this;if(this.isRequired=!0,this.originalRequiredValue=e,typeof this.originalRequiredValue!=="function"&&(jn.hasUserDefinedProperty(this.options,"allowNull")||this.allowNullValidator!=null))throw new _r('Path "'+this.path+'" may not have `allowNull` specified when `required` is true');if(this.requiredValidator=function(i){let o=this?.$__?.cachedRequired;if(o!=null&&!this.$__isSelected(n.path)&&!this[H2e](n.path))return!0;if(o!=null&&n.path in o){let u=o[n.path]?n.checkRequired(i,this):!0;return delete o[n.path],u}else if(typeof e==="function")return e.apply(this)?n.checkRequired(i,this):!0;return n.checkRequired(i,this)},typeof e==="string")t=e,e=void 0;let s=t||_r.messages.general.required;return this.validators.unshift(Object.assign({},r,{validator:this.requiredValidator,message:s,type:"required"})),this};Ie.prototype.allowNull=function(e){if(arguments.length>0&&this.isRequired&&typeof this.originalRequiredValue!=="function")throw new _r('Path "'+this.path+'" may not have `allowNull` specified when `required` is true');if(this.validators=this.validators.filter(function(t){return t.validator!==this.allowNullValidator},this),e!==!1)return delete this.options.allowNull,delete this.allowNullValidator,this;return this.options.allowNull=!1,this.allowNullValidator=function(t){return t!==null},this.validators.push({validator:this.allowNullValidator,message:_r.messages.general.allowNull,type:"allowNull"}),this};Ie.prototype.ref=function(e){return this.options.ref=e,this};Ie.prototype.getDefault=function(t,r,n,s){let i;if(this.defaultValue==null)return this.defaultValue;if(typeof this.defaultValue==="function"){let o=n?.context??t;if(this.defaultValue===Date.now||this.defaultValue===Array||this.defaultValue.name==="ObjectId"||this.defaultValue.name==="ObjectID")i=this.defaultValue.call(o);else i=this.defaultValue.call(o,o)}else i=this.defaultValue;if(i!=null){if(typeof i==="object"&&i!=null&&i._bsontype!=="ObjectId"&&!this.options?.shared)i=yy(i);if(n?.skipCast)return this._applySetters(i,t);let o=this.applySetters(i,t,r,void 0,s??K2e);if(o&&!Array.isArray(o)&&o.$isSingleNested)o.$__parent=t;return o}return i};Ie.prototype._applySetters=function(e,t,r,n,s){let i=e;if(r)return i;let o=this.setters;for(let u=o.length-1;u>=0;u--)i=o[u].call(t,i,n,this,s);return i};/*!
406
- * ignore
407
- */Ie.prototype._castNullish=function(t){return t};Ie.prototype.applySetters=function(e,t,r,n,s){let i=this._applySetters(e,t,r,n,s);if(i==null)return this._castNullish(i);return i=this.cast(i,t,r,n,s),i};Ie.prototype.applyGetters=function(e,t){let r=e,n=this.getters,s=n.length;if(s===0)return r;for(let i=0;i<s;++i)r=n[i].call(t,r,this);return r};Ie.prototype.select=function(t){return this.selected=!!t,this};Ie.prototype.doValidate=async function(t,r,n){let s=!1,i=this.path,o=this.validators.filter((a)=>typeof a==="object"&&a!==null);if(!o.length)return;let u=[];for(let a=0,c=o.length;a<c;++a){let l=o[a],f=l.validator,h,d=pA(l)?Object.assign({},l):yy(l);if(d.path=n?.path||i,d.fullPath=this.$fullPath,d.value=t,typeof t==="string")d.length=t.length;if(t===void 0&&f!==this.requiredValidator)continue;if(f instanceof RegExp){if(h=f.test(t),h===!1)throw s=new(d.ErrorConstructor||g1)(d,r),s[hf]=!0,s;continue}else if(typeof f!=="function")continue;try{if(d.propsParameter)h=f.call(r,t,d);else h=f.call(r,t)}catch(p){if(h=!1,d.reason=p,p.message)d.message=p.message}if(typeof h?.then==="function")u.push(h.then(function(p){if(p===!1)throw s=new(d.ErrorConstructor||g1)(d,r),s[hf]=!0,s},function(p){throw d.reason=p,d.message=p.message,h=!1,s=new(d.ErrorConstructor||g1)(d,r),s[hf]=!0,s}));else if(h!==void 0&&!h)throw s=new(d.ErrorConstructor||g1)(d,r),s[hf]=!0,s}await Promise.all(u)};function gU(e,t){if(e!==void 0&&!e){let n=new(t.ErrorConstructor||g1)(t);return n[hf]=!0,n}}Ie.prototype.doValidateSync=function(e,t,r){let n=this.path;if(!this.validators.length)return null;let i=this.validators;if(e===void 0)if(this.validators.length!==0&&this.validators[0].type==="required")i=[this.validators[0]];else return null;let o=null,u=0,a=i.length;for(u=0;u<a;++u){let c=i[u];if(c===null||typeof c!=="object")continue;let l=c.validator,f=pA(c)?Object.assign({},c):yy(c);if(f.path=r?.path||n,f.fullPath=this.$fullPath,f.value=e,typeof e==="string")f.length=e.length;let h=!1;if(V2e(l))continue;if(l instanceof RegExp){o=gU(l.test(e),f);continue}if(typeof l!=="function")continue;try{if(f.propsParameter)h=l.call(t,e,f);else h=l.call(t,e)}catch(d){h=!1,f.reason=d}if(typeof h?.then==="function")continue;if(o=gU(h,f),o)break}return o};Ie._isRef=function(e,t,r,n){let s=n&&(e.options?.ref||e.options?.refPath);if(!s&&r?.$__!=null){let i=r.$__fullPath(e.path,!0),o=r.ownerDocument();s=i!=null&&o.$populated(i)||r.$populated(e.path)}if(s){if(t==null)return!0;if(!Buffer.isBuffer(t)&&t._bsontype!=="Binary"&&jn.isObject(t))return!0;return n}return!1};/*!
408
- * ignore
409
- */Ie.prototype._castRef=function(t,r,n,s){if(t==null)return t;if(z2e(t))return t.$__.wasPopulated=t.$__.wasPopulated||{value:t._doc._id},t;if(Buffer.isBuffer(t)||!jn.isObject(t)){if(n)return t;throw new mA(this.instance,t,this.path,null,this)}let i=r.$__fullPath(this.path,!0),o=r.ownerDocument(),u=o.$populated(i,!0),a=t;if(!r.$__.populated||!r.$__.populated[i]||!r.$__.populated[i].options||!r.$__.populated[i].options.options||!r.$__.populated[i].options.options.lean){let c=u?u.options[yU]:o.constructor.db.model(this.options.ref);a=c.hydrate(t,null,s),a.$__.wasPopulated={value:a._doc._id,options:{[yU]:c}}}return a};/*!
410
- * ignore
411
- */function _U(e,t){return this.castForQuery(null,e,t)}/*!
412
- * ignore
413
- */function G2e(e,t){let r=this;if(!Array.isArray(e))return[this.castForQuery(null,e,t)];return e.map(function(n){return r.castForQuery(null,n,t)})}function EU(e,t){let r=this;if(!Array.isArray(e))return[this.castForQuery(null,e,t)];return e.map(function(n){if(Array.isArray(n)&&n.length===0)return n;return r.castForQuery(null,n,t)})}Ie.prototype.$conditionalHandlers={$all:G2e,$eq:_U,$in:EU,$ne:_U,$nin:EU,$exists:j2e,$type:L2e};Ie.prototype.castForQuery=function(e,t,r){let n;if(e!=null){if(n=U2e(this.$conditionalHandlers,e),!n)throw new _r("Can't use "+e);return n.call(this,t,r)}try{return this.applySetters(t,r)}catch(s){if(s instanceof mA&&s.path===this.path&&this.$fullPath!=null)s.path=this.$fullPath;throw s}};Ie.checkRequired=function(e){if(arguments.length!==0)this._checkRequired=e;return this._checkRequired};Ie.prototype.checkRequired=function(e){return e!=null};Ie.prototype.clone=function(){let e=Object.assign({},this.options),t=new this.constructor(this.path,e,this.instance,this.parentSchema);if(t.validators=this.validators.slice(),this.requiredValidator!==void 0)t.requiredValidator=this.requiredValidator;if(this.allowNullValidator!==void 0)t.allowNullValidator=this.allowNullValidator;if(this.enumValidator!==void 0)t.enumValidator=this.enumValidator;if(this.minValidator!==void 0)t.minValidator=this.minValidator;if(this.maxValidator!==void 0)t.maxValidator=this.maxValidator;if(this.minlengthValidator!==void 0)t.minlengthValidator=this.minlengthValidator;if(this.maxlengthValidator!==void 0)t.maxlengthValidator=this.maxlengthValidator;if(this.defaultValue!==void 0)t.defaultValue=this.defaultValue;if(this.$immutable!==void 0&&this.options.immutable===void 0)t.$immutable=this.$immutable,dA(t);if(this._index!==void 0)t._index=this._index;if(this.selected!==void 0)t.selected=this.selected;if(this.isRequired!==void 0)t.isRequired=this.isRequired;if(this.originalRequiredValue!==void 0)t.originalRequiredValue=this.originalRequiredValue;return t.getters=this.getters.slice(),t.setters=this.setters.slice(),t};Ie.prototype.getEmbeddedSchemaType=function(){return this.embeddedSchemaType};/*!
414
- * If _duplicateKeyErrorMessage is a string, replace unique index errors "E11000 duplicate key error" with this string.
415
- *
416
- * @api private
417
- */Ie.prototype._duplicateKeyErrorMessage=null;Ie.prototype.toJSONSchema=function(t){throw new _r(`Converting unsupported SchemaType to JSON Schema: ${this.instance} at path "${this.path}"`)};Ie.prototype.autoEncryptionType=function(){return null};/*!
418
- * Module exports.
419
- */OU.exports=gy=Ie;gy.CastError=mA;gy.ValidatorError=g1});var yA=g(function(qTe,SU){var Wi=vs();class js{constructor(e){if(Object.assign(this,e),e?.options!=null)this.options=Object.assign({},e.options)}}Object.defineProperty(js.prototype,"ref",Wi);Object.defineProperty(js.prototype,"refPath",Wi);Object.defineProperty(js.prototype,"localField",Wi);Object.defineProperty(js.prototype,"foreignField",Wi);Object.defineProperty(js.prototype,"justOne",Wi);Object.defineProperty(js.prototype,"count",Wi);Object.defineProperty(js.prototype,"match",Wi);Object.defineProperty(js.prototype,"options",Wi);Object.defineProperty(js.prototype,"skip",Wi);Object.defineProperty(js.prototype,"limit",Wi);Object.defineProperty(js.prototype,"perDocumentLimit",Wi);SU.exports=js});var _y=g(function(jTe,wU){wU.exports=function(t,r,n){if(t==null)return t;if(t._doc!=null)t=t._doc;if(arguments.length>=3){if(typeof t!=="object")return;if(n===void 0)return;if(t instanceof Map)t.set(r,n);else t[r]=n;return n}if(r==="$*")return t instanceof Map?Array.from(t.values()):Object.keys(t).map((s)=>t[s]);if(t instanceof Map)return t.get(r);return t[r]}});var gA=g(function(LTe,MU){var CU=Le(),Y2e=I3(),bU=_y(),Ey=ks(),Ay=G("util"),TU=Oe(),DU=/(\.\d+$|\.\d+\.)/g;MU.exports=function(t,r,n,s,i){if(t==null)return[];if(typeof t!=="string")throw new CU("`refPath` must be a string or a function that returns a string, got "+Ay.inspect(t));if(i!=null&&Y2e(i,t))throw new CU("refPath `"+t+"` must not be excluded in projection, got "+Ay.inspect(i));if(DU.test(n)){let a=n.split(DU);if(a[a.length-1]==="")throw Error("Can't populate individual element in an array");let c="",l=t;for(let d=0;d<a.length;d+=2){let p=a[d];if(l.length>=p.length+1&&l.charAt(p.length)==="."&&l.slice(0,p.length)===p)c+=l.substring(0,p.length)+a[d+1],l=l.substring(p.length+1);else if(d===a.length-1){c+=l,l="";break}else throw Error("Could not normalize ref path, chunk "+p+" not in populated path")}let f=Ey.get(c,r,bU),h=Array.isArray(f)?f:[f];return h=TU.array.flatten(h),h}let o=Ey.get(t,r,bU),u;if(s!=null&&Object.hasOwn(s.virtuals,t))u=[s.virtuals[t].applyGetters(void 0,r)];else u=Array.isArray(o)?o:[o];return u}});var Oy=g(function(UTe,PU){var J2e=gA(),xU=Oe(),Q2e=le().modelSymbol;function eu(e,t){this.path=t,this.getters=[],this.setters=[],this.options=Object.assign({},e)}eu.prototype._applyDefaultGetters=function(){if(this.getters.length>0||this.setters.length>0)return;let t="$"+this.path;this.getters.push(function(){return this.$locals[t]}),this.setters.push(function(r){this.$locals[t]=r})};/*!
420
- * ignore
421
- */eu.prototype.clone=function(){let e=new eu(this.options,this.path);return e.getters=[].concat(this.getters),e.setters=[].concat(this.setters),e};eu.prototype.get=function(e){return this.getters.push(e),this};eu.prototype.set=function(e){return this.setters.push(e),this};eu.prototype.applyGetters=function(e,t){if(xU.hasUserDefinedProperty(this.options,["ref","refPath"])&&t.$$populatedVirtuals&&Object.hasOwn(t.$$populatedVirtuals,this.path))e=t.$$populatedVirtuals[this.path];let r=e;for(let n of this.getters)r=n.call(t,r,this,t);return r};eu.prototype.applySetters=function(e,t){let r=e;for(let n of this.setters)r=n.call(t,r,this,t);return r};eu.prototype._getModelNamesForPopulate=function(t){if(this.options.refPath)return J2e(this.options.refPath,t,this.path);let r=null;if(typeof this.options.ref==="function"&&!this.options.ref[Q2e])r=this.options.ref.call(t,t);else r=this.options.ref;if(r!=null&&!Array.isArray(r))return[r];return r};/*!
422
- * exports
423
- */PU.exports=eu});var _A=g(function(VTe,BU){BU.exports=function(t){let r={_id:{auto:!0}};r._id[t.options.typeKey]="ObjectId",t.add(r)}});var EA=g(function(zTe,FU){FU.exports=function(t,r){let n=t.discriminatorMapping?.value;if(n&&!("sparse"in r)){let s=t.options.discriminatorKey;r.partialFilterExpression=r.partialFilterExpression||{},r.partialFilterExpression[s]=n}return r}});var IU=g(function(WTe,NU){var AA=gr(),X2e=Wa(),Z2e=EA();NU.exports=function(t){let r=[],n=new WeakMap,s=t.constructor.indexTypes,i=new Map;return o(t),r;function o(a,c,l){if(n.has(a))return;n.set(a,!0),c=c||"";let f=Object.keys(a.paths);for(let h of f){let d=a.paths[h];if(l!=null&&l.paths[h])continue;if(d._duplicateKeyErrorMessage!=null)a._duplicateKeyErrorMessagesByPath=a._duplicateKeyErrorMessagesByPath||{},a._duplicateKeyErrorMessagesByPath[h]=d._duplicateKeyErrorMessage;if(d.$isMongooseDocumentArray||d.$isSingleNested){if(AA(d,"options.excludeIndexes")!==!0&&AA(d,"schemaOptions.excludeIndexes")!==!0&&AA(d,"schema.options.excludeIndexes")!==!0)o(d.schema,c+h+".");if(d.schema.discriminators!=null){let m=d.schema.discriminators,_=Object.keys(m);for(let y of _)o(m[y],c+h+".",d.schema)}if(d.$isMongooseDocumentArray)continue}let p=d._index||d.embeddedSchemaType&&d.embeddedSchemaType._index;if(p!==!1&&p!=null){let m={},_=X2e(p),y=_?{...p}:{},E=typeof p==="string"?p:_?p.type:!1;if(E&&s.indexOf(E)!==-1)m[c+h]=E;else if(y.text)m[c+h]="text",delete y.text;else{let b=!1;if(p==="descending"||p==="desc")b=!0;else if(p==="ascending"||p==="asc")b=!1;else b=Number(p)===-1;m[c+h]=b?-1:1}if(delete y.type,a.options.autoIndex!=null)y._autoIndex=a.options.autoIndex;let w=y?.name;if(typeof w==="string")if(i.has(w))Object.assign(i.get(w),m);else r.push([m,y]),i.set(w,m);else r.push([m,y]),i.set(w,m)}}if(n.delete(a),c)u(a,c);else a._indexes.forEach(function(h){let d=h[1];Z2e(a,d)}),r=r.concat(a._indexes)}function u(a,c){let l=a._indexes,f=l.length;for(let h=0;h<f;++h){let d=l[h][0],p=l[h][1],m=Object.keys(d),_=m.length,y={};for(let w=0;w<_;++w){let b=m[w];y[c+b]=d[b]}let E=Object.assign({},p);if(p?.partialFilterExpression!=null){E.partialFilterExpression={};let w=p.partialFilterExpression;for(let b of Object.keys(w))E.partialFilterExpression[c+b]=w[b]}r.push([y,E])}}}});var OA=g(function(HTe,RU){RU.exports=function(t){switch(t){case"p":t="primary";break;case"pp":t="primaryPreferred";break;case"s":t="secondary";break;case"sp":t="secondaryPreferred";break;case"n":t="nearest";break}return t}});var Sy=g(function(KTe,$U){/*!
424
- * ignore
425
- */$U.exports=function(t){if(!(!t.paths.id&&t.paths._id&&t.options.id))return t;if(t.aliases?.id)return t;return t.virtual("id").get(ege),t};function ege(){if(this._doc)return this._doc._id?.toString()??null;if(this._id!=null)return this._id.toString();return null}});var SA=g(function(GTe,vU){vU.exports=function(t,r){let n=Object.keys(t),s=Object.keys(r);if(n.length!==s.length)return!1;for(let i=0;i<n.length;i++){let o=n[i];if(o!==s[i]||t[o]!==r[o])return!1}return!0}});var qU=g(function(YTe,kU){kU.exports=function(t,r,n,s){if(s.justOne||s.count){if(t[r]=Array.isArray(n)?n[0]:n,typeof t[r]!=="object")t[r]=s.count?n:null}else t[r]=Array.isArray(n)?n:n==null?[]:[n],t[r]=t[r].filter(function(i){return i&&typeof i==="object"});return t[r]}});var ff=g(function(JTe,jU){jU.exports=function(t){if(t.indexOf("$")===-1)return t;return t.replace(/\.\$(\[[^\]]*\])?(?=\.|$)/g,".0")}});var wy=g(function(QTe,LU){LU.exports=tge;/*!
426
- * ignore
427
- */function tge(e,t){if(e==null)return null;if(typeof e==="boolean")return t;if(typeof e[t]==="boolean")return e[t]?t:null;if(!(t in e))return t;return e[t]}});var CA=g(function(XTe,VU){var UU=ff(),tu=wy();VU.exports=tc;/*!
428
- * ignore
429
- */function tc(e,t,r){if(t==null)return;if(Object.keys(t).some((u)=>u[0]==="$")){if(t.$push)o(t.$push);if(t.$addToSet)o(t.$addToSet);if(t.$set!=null){let u=Object.keys(t.$set);for(let a of u)wA(r,a,t.$set,e)}if(t.$setOnInsert!=null){let u=Object.keys(t.$setOnInsert);for(let a of u)wA(r,a,t.$setOnInsert,e)}}let i=Object.keys(t).filter((u)=>u[0]!=="$");for(let u of i)wA(r,u,t,e);function o(u){for(let a of Object.keys(u)){let c=r.path(UU(a));if(u[a]&&c&&c.$isMongooseDocumentArray&&c.schema.options.timestamps){let l=c.schema.options.timestamps,f=tu(l,"createdAt"),h=tu(l,"updatedAt");if(u[a].$each)u[a].$each.forEach(function(d){if(h!=null)d[h]=e;if(f!=null)d[f]=e;tc(e,d,c.schema)});else{if(h!=null)u[a][h]=e;if(f!=null)u[a][f]=e;tc(e,u[a],c.schema)}}}}}function rge(e,t,r){let n=t.schema.options.timestamps,s=e.length;if(!n){for(let u=0;u<s;++u)tc(r,e[u],t.schema);return}let i=tu(n,"createdAt"),o=tu(n,"updatedAt");for(let u=0;u<s;++u){if(o!=null)e[u][o]=r;if(i!=null)e[u][i]=r;tc(r,e[u],t.schema)}}function nge(e,t,r){let n=t.schema.options.timestamps;if(!n){tc(r,e,t.schema);return}let s=tu(n,"createdAt"),i=tu(n,"updatedAt");if(i!=null)e[i]=r;if(s!=null)e[s]=r;tc(r,e,t.schema)}function wA(e,t,r,n){let s=UU(t),i=e.path(s);if(!i)return;let o=[],u=s.split(".");for(let a=u.length-1;a>0;--a){let c=e.path(u.slice(0,a).join("."));if(c!=null&&(c.$isMongooseDocumentArray||c.$isSingleNested))o.push({parentPath:t.split(".").slice(0,a).join("."),parentSchemaType:c})}if(Array.isArray(r[t])&&i.$isMongooseDocumentArray)rge(r[t],i,n);else if(r[t]&&i.$isSingleNested)nge(r[t],i,n);else if(o.length>0)for(let a of o){let{parentPath:c,parentSchemaType:l}=a,f=l.schema.options.timestamps,h=tu(f,"updatedAt");if(!f||h==null)continue;if(l.$isSingleNested)r[c+"."+h]=n;else if(l.$isMongooseDocumentArray){let d=t.substring(c.length+1);if(/^\d+$/.test(d)){r[c+"."+d][h]=n;continue}let p=d.indexOf(".");d=p!==-1?d.substring(0,p):d,r[c+"."+d+"."+h]=n}}else if(i.schema!=null&&i.schema!=e&&r[t]){let a=i.schema.options.timestamps,c=tu(a,"createdAt"),l=tu(a,"updatedAt");if(!a)return;if(l!=null)r[t][l]=n;if(c!=null)r[t][c]=n}}});var DA=g(function(ZTe,WU){/*!
430
- * ignore
431
- */var zU=Oe(),bA=gr();WU.exports=sge;/*!
432
- * ignore
433
- */function sge(e,t,r,n,s,i,o){let u=n,a=u,c=s?.timestamps??!0;if(!c||u==null)return n;let l=c?.createdAt===!1,f=c?.updatedAt===!1;if(o){if(n?.$set)n=n.$set,u.$set={},a=u.$set;if(!f&&r&&!n[r])a[r]=e;if(!l&&t&&!n[t])a[t]=e;return u}if(n=n||{},Array.isArray(u)){if(r==null||f)return u;return u.push({$set:{[r]:e}}),u}if(u.$set=u.$set||{},!f&&r&&!n.$currentDate?.[r]){let h=!1;if(r.indexOf(".")!==-1){let d=r.split(".");for(let p=1;p<d.length;++p){let m=d.slice(-p).join("."),_=d.slice(0,-p).join(".");if(n[_]!=null){n[_][m]=e,h=!0;break}else if(n.$set?.[_]){n.$set[_][m]=e,h=!0;break}}}if(!h)u.$set[r]=e;if(Object.hasOwn(u,r))delete u[r]}if(!l&&t){let h=s?.overwriteImmutable,d=bA(n,t)!=null||bA(n.$set,t)!=null||bA(n.$setOnInsert,t)!=null;if(h&&d){if(n[t]!=null)u.$set[t]=n[t],delete n[t]}else{if(n[t])delete n[t];if(n.$set?.[t])delete n.$set[t];let p=!1;if(t.indexOf(".")!==-1){let m=t.split(".");for(let _=1;_<m.length;++_){let y=m.slice(-_).join("."),E=m.slice(0,-_).join(".");if(n[E]!=null){n[E][y]=e,p=!0;break}else if(n.$set?.[E]){n.$set[E][y]=e,p=!0;break}}}if(!p&&i)u.$setOnInsert=u.$setOnInsert||{},u.$setOnInsert[t]=e}}if(zU.hasOwnKeys(u.$set)===!1)delete u.$set;return u}});var KU=g(function(eMe,HU){HU.exports=function(t,r,n,s,i){let o=r?.updatedAt===!1,u=r?.createdAt===!1,a=n!=null?n():t.ownerDocument().constructor.base.now();if(!u&&(t.isNew||t.$isSubdocument)&&s&&!t.$__getValue(s)&&t.$__isSelected(s))t.$set(s,a,void 0,{overwriteImmutable:!0});if(!o&&i&&(t.isNew||t.$isModified())){let c=a;if(t.isNew&&s!=null)c=t.$__getValue(s);t.$set(i,c)}}});var QU=g(function(tMe,JU){var ige=CA(),oge=DA(),Cy=wy(),uge=KU(),by=Ui(),GU=new Set(["replaceOne","findOneAndReplace"]);JU.exports=function(t,r){let n=t.childSchemas.find(s);function s(l){return!!l.schema.options.timestamps}if(!r&&!n)return;let i=Cy(r,"createdAt"),o=Cy(r,"updatedAt"),u=r!=null&&Object.hasOwn(r,"currentTime")?r.currentTime:null,a={};if(t.$timestamps={createdAt:i,updatedAt:o},i&&!t.paths[i]){let f=t.base?.get("timestamps.createdAt.immutable")??null??!0;a[i]={[t.options.typeKey||"type"]:Date,immutable:f}}if(o&&!t.paths[o])a[o]=Date;t.add(a),t.pre("save",YU),t.methods.initializeTimestamps=function(l){if(l===!1)return this;let f=u!=null?u():this.constructor.base.now(),h=l!=null?Cy(l,"createdAt"):i,d=l!=null?Cy(l,"updatedAt"):o;if(h&&!this.get(h))this.$set(i,f);if(d&&!this.get(d))this.$set(o,f);if(this.$isSubdocument)return this;let p=this.$getAllSubdocs();for(let m of p)if(m.initializeTimestamps)m.initializeTimestamps(l);return this};let c={query:!0,model:!1};t.pre("findOneAndReplace",c,rc),t.pre("findOneAndUpdate",c,rc),t.pre("replaceOne",c,rc),t.pre("update",c,rc),t.pre("updateOne",c,rc),t.pre("updateMany",c,rc)};function YU(){let e=this.$__?.saveOptions?.timestamps;if(e===!1)return;let t=this.$__schema,{createdAt:r,updatedAt:n}=t.$timestamps,s=t.options.timestamps,i=s!=null&&Object.hasOwn(s,"currentTime")?s.currentTime:null;uge(this,e,i,r,n)}function rc(){let e=this.model.schema,{createdAt:t,updatedAt:r}=e.$timestamps,n=e.options.timestamps,s=n!=null&&Object.hasOwn(n,"currentTime")?n.currentTime:null,i=s!=null?s():this.model.base.now();if(GU.has(this.op)&&this.getUpdate()==null)this.setUpdate({});oge(i,t,r,this.getUpdate(),this._mongooseOptions,this.options.upsert,GU.has(this.op)),ige(i,this.getUpdate(),this.model.schema)}YU[by.builtInMiddleware]=!0;rc[by.builtInMiddleware]=!0});var eV=g(function(rMe,ZU){var age=Le(),XU=G("util");ZU.exports=cge;function cge(e,t){if(typeof e==="string")return;if(typeof e==="function")return;throw new age('Invalid ref at path "'+t+'". Got '+XU.inspect(e,{depth:0}))}});var df=g(function(pge){/*!
434
- * ignore
435
- */var tV=Object.freeze(["countDocuments","distinct","estimatedDocumentCount","find","findOne","findOneAndReplace","findOneAndUpdate","replaceOne","updateMany","updateOne","deleteMany","deleteOne","findOneAndDelete"]);pge.queryOperations=tV;/*!
436
- * ignore
437
- */var lge=tV.concat(["validate"]);pge.queryMiddlewareFunctions=lge;/*!
438
- * ignore
439
- */var hge=["aggregate"];pge.aggregateMiddlewareFunctions=hge;/*!
440
- * ignore
441
- */var fge=["bulkWrite","createCollection","insertMany"];pge.modelMiddlewareFunctions=fge;/*!
442
- * ignore
443
- */var dge=["validate","save","remove","updateOne","deleteOne","init"];pge.documentMiddlewareFunctions=dge});var aV=g(function(oV,uV){/*!
444
- * Module dependencies.
445
- */var Ty=sy(),Dy=le().arrayAtomicsSymbol,Age=le().arrayAtomicsBackupSymbol,rV=le().arrayParentSymbol,Oge=le().arrayPathSymbol,nV=le().arraySchemaSymbol,sV=Array.prototype.push,iV=/^\d+$/;function Sge(e,t,r,n){let s;if(Array.isArray(e)){let u=e.length;if(u===0)s=[];else if(u===1)s=[,],s[0]=e[0];else if(u<1e4)s=[],sV.apply(s,e);else{s=[];for(let a=0;a<u;++a)sV.call(s,e[a])}}else s=[];let i={[Dy]:{},[Age]:void 0,[Oge]:t,[nV]:n,[rV]:void 0,isMongooseArray:!0,isMongooseArrayProxy:!0,__array:s};if(e&&e[Dy]!=null)i[Dy]=e[Dy];if(r?.$__)i[rV]=r,i[nV]=n||r.schema.path(t);let o=new Proxy(s,{get:function(u,a){if(Object.hasOwn(i,a))return i[a];if(Object.hasOwn(Ty,a))return Ty[a];if(n?.virtuals&&Object.hasOwn(n.virtuals,a))return n.virtuals[a].applyGetters(void 0,u);if(typeof a==="string"&&iV.test(a)&&n?.embeddedSchemaType!=null)return n.embeddedSchemaType.applyGetters(s[a],r);return s[a]},set:function(u,a,c){if(typeof a==="string"&&iV.test(a))Ty.set.call(o,a,c,!1);else if(Object.hasOwn(i,a))i[a]=c;else if(n?.virtuals&&Object.hasOwn(n.virtuals,a))n.virtuals[a].applySetters(c,u);else s[a]=c;return!0}});return o}/*!
446
- * Module exports.
447
- */uV.exports=oV=Sge});var lV=g(function(sMe,cV){cV.exports=we().Double});var _1=g(function(iMe,fV){/*!
448
- * Module dependencies.
449
- */var ya=Er(),hV=Ui(),wge=Wa(),My=Oe();function Ei(e,t,r,n){if(t?.default){let s=t.default;if(Array.isArray(s)&&s.length===0)t.default=Array;else if(!t.shared&&wge(s)&&My.hasOwnKeys(s)===!1)t.default=function(){return{}}}ya.call(this,e,t,"Mixed",n),this[hV.schemaMixedSymbol]=!0}Ei.schemaName="Mixed";Ei.defaultOptions={};/*!
450
- * Inherits from SchemaType.
451
- */Ei.prototype=Object.create(ya.prototype);Ei.prototype.constructor=Ei;Ei.get=ya.get;Ei.set=ya.set;Ei.setters=[];Ei.prototype.cast=function(e){if(e instanceof Error)return My.errorToPOJO(e);return e};Ei.prototype.castForQuery=function(e,t){return t};Ei.prototype.toJSONSchema=function(t){return{}};/*!
452
- * Module exports.
453
- */fV.exports=Ei});var By=g(function(oMe,_V){var Cge=_1(),bge=Le(),dV=Zt(),Dge=Oe().deepEqual,Tge=Oe().isMongooseArray,Mge=$n(),xge=Ym(),pV=gn(),Py=G("util"),gV=la(),xy=vn(),Pge=zm(),mV=le().populateModelSymbol;/*!
454
- * ignore
455
- */class Do extends Map{constructor(e,t,r,n){if(Mge(e)==="Object")e=Object.keys(e).map((s)=>[s,e[s]]);super(e);this.$__parent=r?.$__!=null?r:null,this.$__path=t,this.$__schemaType=n==null?new Cge(t):n,this.$__runDeferred()}$init(e,t){if(yV(e),super.set(e,t),t?.$isSingleNested)t.$basePath=this.$__path+"."+e}$__set(e,t){super.set(e,t)}get(e,t){if(xy(e,"ObjectId"))e=e.toString();if(t=t||{},t.getters===!1)return super.get(e);return this.$__schemaType.applyGetters(super.get(e),this.$__parent)}has(e){if(xy(e,"ObjectId"))e=e.toString();return super.has(e)}set(e,t){if(xy(e,"ObjectId"))e=e.toString();if(yV(e),t=xge(t),this.$__schemaType==null){this.$__deferred=this.$__deferred||[],this.$__deferred.push({key:e,value:t});return}let r,n=this.$__parent,s=n?.$__?.populated?n.$populated(o.call(this),!0)||n.$populated(this.$__path,!0):null,i=this.get(e);if(s!=null){if(this.$__schemaType.$isSingleNested)throw new bge(`Cannot manually populate single nested subdoc underneath Map at path "${this.$__path}". Try using an array instead of a Map.`);if(Array.isArray(t)&&this.$__schemaType.$isMongooseArray)t=t.map((u)=>{if(!pV(u))u=new s.options[mV](u);return u.$__.wasPopulated={value:u._doc._id},u});else if(t!=null){if(!pV(t))t=new s.options[mV](t);t.$__.wasPopulated={value:t._doc._id}}}else try{let u=this.$__schemaType.$isMongooseDocumentArray||this.$__schemaType.$isSingleNested||this.$__schemaType.$isMongooseArray||this.$__schemaType.$isSchemaMap?{path:o.call(this)}:null;t=this.$__schemaType.applySetters(t,this.$__parent,!1,this.get(e),u)}catch(u){if(this.$__parent?.$__!=null){this.$__parent.invalidate(o.call(this),u);return}throw u}if(super.set(e,t),n?.$__!=null&&!Dge(t,i)){let u=o.call(this);if(n.markModified(u),Tge(t))t._registerAtomic("$set",t);if(this.$__schemaType.$isMongooseDocumentArray||this.$__schemaType.$isSingleNested)Pge(n,u)}function o(){if(r)return r;return r=this.$__path+"."+e,r}}clear(){super.clear();let e=this.$__parent;if(e!=null)e.markModified(this.$__path)}delete(e){if(xy(e,"ObjectId"))e=e.toString();return this.set(e,void 0),super.delete(e)}toBSON(){return new Map(this)}toObject(e){if(e?.flattenMaps){let t={},r=this.keys();for(let n of r)t[n]=dV(this.get(n),e);return t}return new Map(this)}$toObject(){return this.constructor.prototype.toObject.apply(this,arguments)}toJSON(e){if(typeof e?.flattenMaps==="boolean"?e.flattenMaps:!0){let t={},r=this.keys();for(let n of r)t[n]=dV(this.get(n),e);return t}return new Map(this)}inspect(){return new Map(this)}$__runDeferred(){if(!this.$__deferred)return;for(let e of this.$__deferred)this.set(e.key,e.value);this.$__deferred=null}}if(Py.inspect.custom)Object.defineProperty(Do.prototype,Py.inspect.custom,{enumerable:!1,writable:!1,configurable:!1,value:Do.prototype.inspect});Object.defineProperty(Do.prototype,"$__set",{enumerable:!1,writable:!0,configurable:!1});Object.defineProperty(Do.prototype,"$__parent",{enumerable:!1,writable:!0,configurable:!1});Object.defineProperty(Do.prototype,"$__path",{enumerable:!1,writable:!0,configurable:!1});Object.defineProperty(Do.prototype,"$__schemaType",{enumerable:!1,writable:!0,configurable:!1});Object.defineProperty(Do.prototype,"$isMongooseMap",{enumerable:!1,writable:!1,configurable:!1,value:!0});Object.defineProperty(Do.prototype,"$__deferredCalls",{enumerable:!1,writable:!1,configurable:!1,value:!0});function yV(e){let t=typeof e;if(t!=="string")throw TypeError(`Mongoose maps only support string keys, got ${t}`);if(e.startsWith("$"))throw Error(`Mongoose maps do not support keys that start with "$", got "${e}"`);if(e.includes("."))throw Error(`Mongoose maps do not support keys that contain ".", got "${e}"`);if(gV.has(e))throw Error(`Mongoose maps do not support reserved key name "${e}"`)}_V.exports=Do});var AV=g(function(uMe,EV){EV.exports=we().UUID});var E1=g(function(Bge){/*!
456
- * Module exports.
457
- */Bge.Array=aV();Bge.Buffer=qm();Bge.Document=Bge.Embedded=d1();Bge.DocumentArray=Za();Bge.Double=lV();Bge.Decimal128=Mm();Bge.ObjectId=ca();Bge.Map=By();Bge.Subdocument=Zm();Bge.UUID=AV()});var SV=g(function(lMe,OV){var Uge=As();class pf extends Uge{}var TA=vs();Object.defineProperty(pf.prototype,"enum",TA);Object.defineProperty(pf.prototype,"of",TA);Object.defineProperty(pf.prototype,"castNonArrays",TA);/*!
458
- * ignore
459
- */OV.exports=pf});var CV=g(function(hMe,wV){wV.exports=MA;function MA(e){if(!Array.isArray(e))return{min:0,max:0,containsNonArrayItem:!0};if(e.length===0)return{min:1,max:1,containsNonArrayItem:!1};if(e.length===1&&!Array.isArray(e[0]))return{min:1,max:1,containsNonArrayItem:!1};let t=MA(e[0]);for(let r=1;r<e.length;++r){let n=MA(e[r]);if(n.min<t.min)t.min=n.min;if(n.max>t.max)t.max=n.max;t.containsNonArrayItem=t.containsNonArrayItem||n.containsNonArrayItem}return t.min=t.min+1,t.max=t.max+1,t}});var mf=g(function(fMe,bV){bV.exports=function(t){if(t==null)return t;if(t==="")return null;if(typeof t==="string"||typeof t==="boolean")t=Number(t);if(isNaN(t))throw Error("Cast to Number failed: value is not a valid number");if(t instanceof Number)return t.valueOf();if(typeof t==="number")return t;if(!Array.isArray(t)&&typeof t.valueOf==="function")return Number(t.valueOf());if(t.toString&&!Array.isArray(t)&&t.toString()==Number(t))return Number(t);throw Error("Cast to Number failed: value is not a valid number")}});var xA=g(function(dMe,DV){DV.exports=function(t){if(t==null||typeof t!=="object")return t;if(Array.isArray(t)){for(let r=t.length-1;r>=0;--r)if(t[r]===void 0)t.splice(r,1)}for(let r of Object.keys(t))if(t[r]===void 0)delete t[r];return t}});var PV=g(function(pMe,xV){var A1=kn(),MV=fa(),Fy=mf(),Vge=So(),TV=xA(),zge=new Set(["$and","$or"]),Wge=new Set(["$cmp","$eq","$lt","$lte","$gt","$gte"]),Hge=new Set(["$multiply","$divide","$log","$mod","$trunc","$avg","$max","$min","$stdDevPop","$stdDevSamp","$sum"]),Kge=new Set(["$abs","$exp","$ceil","$floor","$ln","$log10","$sqrt","$sin","$cos","$tan","$asin","$acos","$atan","$atan2","$asinh","$acosh","$atanh","$sinh","$cosh","$tanh","$degreesToRadians","$radiansToDegrees"]),Gge=new Set(["$arrayElemAt","$first","$last"]),Yge=new Set(["$year","$month","$week","$dayOfMonth","$dayOfYear","$hour","$minute","$second","$isoDayOfWeek","$isoWeekYear","$isoWeek","$millisecond"]),Jge=new Set(["$not"]);xV.exports=function(t,r,n){if(typeof t==="boolean")return t;if(typeof t!=="object"||t===null)throw Error("`$expr` must be an object or boolean literal");return Os(t,r,n)};function Os(e,t,r){if(yf(e)||e===null)return e;if(e.$cond!=null)if(Array.isArray(e.$cond))e.$cond=e.$cond.map((s)=>Os(s,t,r));else e.$cond.if=Os(e.$cond.if,t,r),e.$cond.then=Os(e.$cond.then,t,r),e.$cond.else=Os(e.$cond.else,t,r);else if(e.$ifNull!=null)e.$ifNull.map((s)=>Os(s,t,r));else if(e.$switch!=null){if(Array.isArray(e.$switch.branches))for(let s of e.$switch.branches){if(s?.case!=null)s.case=Os(s.case,t,r);if(s?.then!=null)s.then=Os(s.then,t,r);TV(s)}if("default"in e.$switch)e.$switch.default=Os(e.$switch.default,t,r)}let n=Object.keys(e);for(let s of n)if(zge.has(s))e[s]=e[s].map((i)=>Os(i,t,r));else if(Wge.has(s))e[s]=Zge(e[s],t,r);else if(Hge.has(s))e[s]=Xge(e[s],t,r);else if(Kge.has(s))e[s]=PA(e[s],t,r);else if(Jge.has(s))e[s]=Os(e[s],t,r);if(e.$in)e.$in=Qge(e.$in,t,r);if(e.$size)e.$size=PA(e.$size,t,r);if(e.$round){let s=e.$round;if(!Array.isArray(s)||s.length<1||s.length>2)throw new A1("Array",s,"$round");e.$round=s.map((i)=>PA(i,t,r))}return TV(e),e}function PA(e){if(!gf(e))return e;try{return Fy(e)}catch{throw new A1("Number",e)}}function Qge(e,t,r){let n=e[1];if(!yf(n))return e;let s=e[0],i=t.path(n.slice(1));if(i===null){if(r===!1)return e;else if(r==="throw")throw new MV("$in");return}if(!i.$isMongooseArray)throw Error("Path must be an array for $in");if(!gf(s)&&(typeof s==="string"||Vge(s)))return[Os(s,t,r),n];if(typeof s==="object"&&s!=null&&s.$literal!=null)return[{$literal:i.embeddedSchemaType.cast(s.$literal)},n];return[i.embeddedSchemaType.cast(s),n]}function Xge(e){if(!Array.isArray(e)){if(!gf(e))return e;try{return Fy(e)}catch{throw new A1("Number",e)}}return e.map((t)=>{if(!gf(t))return t;try{return Fy(t)}catch{throw new A1("Number",t)}})}function Zge(e,t,r){if(!Array.isArray(e)||e.length!==2)throw Error("Comparison operator must be an array of length 2");e[0]=Os(e[0],t,r);let n=e[0];if(gf(e[1])){let s=null,i=null,o=null;if(yf(n))s=n.slice(1),i=t.path(s);else if(typeof n==="object"&&n!=null){for(let a of Object.keys(n))if(Yge.has(a)&&yf(n[a]))s=n[a].slice(1)+"."+a,o=Fy;else if(Gge.has(a)&&yf(n[a])){if(s=n[a].slice(1)+"."+a,i=t.path(n[a].slice(1)),i!=null){if(i.$isMongooseArray)i=i.embeddedSchemaType}}}let u=typeof e[1]==="object"&&e[1]!=null&&e[1].$literal!=null;if(i!=null)if(u)e[1]={$literal:i.cast(e[1].$literal)};else e[1]=i.cast(e[1]);else if(o!=null)if(u)try{e[1]={$literal:o(e[1].$literal)}}catch{throw new A1(o.name.replace(/^cast/,""),e[1],s+".$literal")}else try{e[1]=o(e[1])}catch{throw new A1(o.name.replace(/^cast/,""),e[1],s)}else if(s!=null&&r===!0)return;else if(s!=null&&r==="throw")throw new MV(s)}else e[1]=Os(e[1],t,r);return e}function yf(e){return typeof e==="string"&&e[0]==="$"}function gf(e){if(typeof e==="string"&&e[0]==="$")return!1;if(typeof e==="object"&&e!==null&&Object.keys(e).find((t)=>t[0]==="$"))return e.$literal!=null;return!0}});var Ny=g(function(mMe,BV){var e_e=kn();BV.exports=function(t,r){if(t==null)return t;if(typeof t?._id==="string")return t._id;if(t.toString&&t.toString!==Object.prototype.toString&&!Array.isArray(t))return t.toString();throw new e_e("string",t,r)}});var RV=g(function(yMe,IV){var t_e=kn(),FV=Nm(),NV=Ny();IV.exports=function(t,r){if(t==null||typeof t!=="object")throw new t_e("$text",t,r);if(t.$search!=null)t.$search=NV(t.$search,r+".$search");if(t.$language!=null)t.$language=NV(t.$language,r+".$language");if(t.$caseSensitive!=null)t.$caseSensitive=FV(t.$caseSensitive,r+".$caseSensitive");if(t.$diacriticSensitive!=null)t.$diacriticSensitive=FV(t.$diacriticSensitive,r+".$diacriticSensitive");return t}});var BA=g(function(gMe,$V){var r_e=So();$V.exports=function(t){if(!r_e(t))return t;let r=Object.keys(t);if(r.length!==1)return t;if(r[0]==="$eq")return t.$eq;if(r[0]==="$in"&&Array.isArray(t.$in)&&t.$in.length===1)return t.$in[0];return t}});var O1=g(function(_Me,vV){var n_e=new Set(["$ref","$id","$db"]);vV.exports=function(t){return t[0]==="$"&&!n_e.has(t)}});var _f=g(function(s_e){s_e.logicalOperators=new Set(["$and","$or","$nor"])});var nc=g(function(AMe,VV){/*!
460
- * Module dependencies.
461
- */var o_e=qs(),kV=kn(),FA=fa(),LV=Ef(),u_e=PV(),a_e=Ny(),c_e=RV(),l_e=gr(),qV=BA(),h_e=Co(),jV=Gm(),NA=O1(),{logicalOperators:f_e}=_f(),UV=G("util"),RA=Wa(),IA=Zh(),Iy=Oe(),d_e=["Polygon","MultiPolygon"];VV.exports=function e(t,r,n,s){if(Array.isArray(r))throw Error("Query filter must be an object, got an array "+UV.inspect(r));if(r==null)return r;if(t?.discriminators!=null&&r[t.options.discriminatorKey]!=null){let p=qV(r[t.options.discriminatorKey]);t=jV(t,p)||t}let i=Object.keys(r),o=i.length,u,a,c,l,f,h,d;n=n||{};while(o--)if(f=i[o],d=r[f],f_e.has(f)){if(!Array.isArray(d))throw new kV("Array",d,f);for(let p=d.length-1;p>=0;p--){if(d[p]==null||typeof d[p]!=="object")throw new kV("Object",d[p],f+"."+p);let m=Object.keys(d[p]).length,_=d[p][t.options.discriminatorKey];if(_==null)d[p]=e(t,d[p],n,s);else{let y=jV(s.schema,_);d[p]=e(y?y:t,d[p],n,s)}if(Iy.hasOwnKeys(d[p])===!1&&m!==0)d.splice(p,1)}if(d.length===0)delete r[f]}else if(f==="$where"){if(h=typeof d,h!=="string"&&h!=="function")throw Error("Must have a string or function for $where");if(h==="function")r[f]=d.toString();continue}else if(f==="$expr"){d=u_e(d,t);continue}else if(f==="$elemMatch")d=e(t,d,n,s);else if(f==="$text")d=c_e(d,f);else if(f==="$comment"&&!Object.hasOwn(t.paths,"$comment"))d=a_e(d,f),r[f]=d;else if(NA(f))continue;else{if(!t)continue;if(c=t.path(f),!c){let p=f.split("."),m=p.length;while(m--){let _=p.slice(0,m).join("."),y=p.slice(m).join("."),E=t.path(_),w=E?.schema?.options?.discriminatorKey;if(E?.schema?.discriminators!=null&&w!=null&&y!==w){let b=qV(l_e(r,_+"."+w)),A=E.schema.discriminators,M=typeof b==="string"?o_e(A,b):null;if(M!=null)c=M.path(y)}}}if(!c){let p=f.split("."),m=p.length,_,y,E;while(m--)if(_=p.slice(0,m).join("."),c=t.path(_),c)break;if(c){if(c.schema){E={},y=p.slice(m).join("."),E[y]=d;let A=e(c.schema,E,n,s)[y];if(A===void 0)delete r[f];else r[f]=A}else r[f]=d;continue}if(RA(d)){let A="";if(d.$near)A="$near";else if(d.$nearSphere)A="$nearSphere";else if(d.$within)A="$within";else if(d.$geoIntersects)A="$geoIntersects";else if(d.$geoWithin)A="$geoWithin";if(A){let M=new LV.Number("__QueryCasting__",null,null,t),O=d[A];if(d.$maxDistance!=null)d.$maxDistance=M.castForQuery(null,d.$maxDistance,s);if(d.$minDistance!=null)d.$minDistance=M.castForQuery(null,d.$minDistance,s);if(A==="$within"){let x=O.$center||O.$centerSphere||O.$box||O.$polygon;if(!x)throw Error("Bad $within parameter: "+JSON.stringify(d));O=x}else if(A==="$near"&&typeof O.type==="string"&&Array.isArray(O.coordinates))O=O.coordinates;else if((A==="$near"||A==="$nearSphere"||A==="$geoIntersects")&&O.$geometry&&typeof O.$geometry.type==="string"&&Array.isArray(O.$geometry.coordinates)){if(O.$maxDistance!=null)O.$maxDistance=M.castForQuery(null,O.$maxDistance,s);if(O.$minDistance!=null)O.$minDistance=M.castForQuery(null,O.$minDistance,s);if(IA(O.$geometry))O.$geometry=O.$geometry.toObject({transform:!1,virtuals:!1});O=O.$geometry.coordinates}else if(A==="$geoWithin"){if(O.$geometry){if(IA(O.$geometry))O.$geometry=O.$geometry.toObject({virtuals:!1});let x=O.$geometry.type;if(d_e.indexOf(x)===-1)throw Error('Invalid geoJSON type for $geoWithin "'+x+'", must be "Polygon" or "MultiPolygon"');O=O.$geometry.coordinates}else if(O=O.$box||O.$polygon||O.$center||O.$centerSphere,IA(O))O=O.toObject({virtuals:!1})}$A(O,M,s);continue}}if(h_e(t.nested,f))continue;let w="strict"in n?n.strict:t.options.strict,b=p_e(n,t._userProvidedOptions,t.options,s);if(n.upsert&&w){if(w==="throw")throw new FA(f);throw new FA(f,'Path "'+f+'" is not in schema, strict mode is `true`, and upsert is `true`.')}if(b==="throw")throw new FA(f,'Path "'+f+`" is not in schema and strictQuery is 'throw'.`);else if(b)delete r[f]}else if(d==null)continue;else if(Iy.isPOJO(d))if(a=Object.keys(d).some(NA),!a)r[f]=c.castForQuery(null,d,s);else{let p=Object.keys(d),m,_=p.length;while(_--)if(m=p[_],l=d[m],m==="$elemMatch"){if(l&&c?.schema!=null)e(c.schema,l,n,s);else if(l&&c?.$isMongooseArray)d[m]=c.castForQuery(m,l,s)}else if(m==="$not"){if(l&&c){if(u=Object.keys(l),u.length&&NA(u[0]))for(let y in l)l[y]=c.castForQuery(y,l[y],s);else d[m]=c.castForQuery(m,l,s);continue}}else d[m]=c.castForQuery(m,l,s)}else if(Array.isArray(d)&&["Buffer","Array"].indexOf(c.instance)===-1&&!n.sanitizeFilter){let p=[],m=d;for(let _ of m)p.push(c.castForQuery(null,_,s));r[f]={$in:p}}else r[f]=c.castForQuery(null,d,s)}return r};function $A(e,t,r){if(Array.isArray(e))e.forEach(function(n,s){if(Array.isArray(n)||RA(n))return $A(n,t,r);e[s]=t.castForQuery(null,n,r)});else{let n=Object.keys(e),s=n.length;while(s--){let i=n[s],o=e[i];if(Array.isArray(o)||RA(o))$A(o,t,r),e[i]=o;else e[i]=t.castForQuery(null,o,r)}}}function p_e(e,t,r,n){if("strictQuery"in e)return e.strictQuery;if("strictQuery"in t)return t.strictQuery;let s=n?.mongooseCollection?.conn?.base?.options;if(s){if("strictQuery"in s)return s.strictQuery}return r.strictQuery}});var WV=g(function(OMe,zV){var m_e=As();class S1 extends m_e{}var Ry=vs();Object.defineProperty(S1.prototype,"min",Ry);Object.defineProperty(S1.prototype,"max",Ry);Object.defineProperty(S1.prototype,"enum",Ry);Object.defineProperty(S1.prototype,"populate",Ry);/*!
462
- * ignore
463
- */zV.exports=S1});var Af=g(function(SMe,KV){/*!
464
- * Module requirements.
465
- */var y_e=kn();/*!
466
- * ignore
467
- */function g_e(e){let t=this;if(Array.isArray(e))return e.map(function(r){return HV(t.path,r)});else if(Buffer.isBuffer(e))return e;return HV(t.path,e)}/*!
468
- * ignore
469
- */function HV(e,t){let r=Number(t);if(isNaN(r))throw new y_e("number",t,e);return r}KV.exports=g_e});var vA=g(function(wMe,YV){/*!
470
- * Module requirements.
471
- */var ru=$s(),__e=WV(),on=Er(),E_e=mf(),$y=Af(),w1=Oe(),A_e=yi(),GV=on.CastError;function Ht(e,t,r,n){this.enumValues=[],on.call(this,e,t,"Number",n)}Ht.get=on.get;Ht.set=on.set;Ht.setters=[];/*!
472
- * ignore
473
- */Ht._cast=E_e;Ht.cast=function(t){if(arguments.length===0)return this._cast;if(t===!1)t=this._defaultCaster;return this._cast=t,this._cast};/*!
474
- * ignore
475
- */Ht._defaultCaster=(e)=>{if(typeof e!=="number")throw Error();return e};Ht.schemaName="Number";Ht.defaultOptions={};/*!
476
- * Inherits from SchemaType.
477
- */Ht.prototype=Object.create(on.prototype);Ht.prototype.constructor=Ht;Ht.prototype.OptionsConstructor=__e;/*!
478
- * ignore
479
- */Ht._checkRequired=(e)=>typeof e==="number"||e instanceof Number;Ht.checkRequired=on.checkRequired;Ht.prototype.checkRequired=function(t,r){if(typeof t==="object"&&on._isRef(this,t,r,!0))return t!=null;return(typeof this.constructor.checkRequired==="function"?this.constructor.checkRequired():Ht.checkRequired())(t)};Ht.prototype.min=function(e,t){if(this.minValidator)this.validators=this.validators.filter(function(r){return r.validator!==this.minValidator},this);if(e!=null){let r=t||ru.messages.Number.min;if(typeof r==="string")r=r.replace(/{MIN}/,e);this.validators.push({validator:this.minValidator=function(n){return n==null||n>=e},message:r,type:"min",min:e})}return this};Ht.prototype.max=function(e,t){if(this.maxValidator)this.validators=this.validators.filter(function(r){return r.validator!==this.maxValidator},this);if(e!=null){let r=t||ru.messages.Number.max;if(typeof r==="string")r=r.replace(/{MAX}/,e);this.validators.push({validator:this.maxValidator=function(n){return n==null||n<=e},message:r,type:"max",max:e})}return this};Ht.prototype.enum=function(e,t){if(this.enumValidator)this.validators=this.validators.filter(function(n){return n.validator!==this.enumValidator},this),this.enumValidator=!1;if(e==null||e===!1)return this.enumValues=[],delete this.options.enum,this;if(!Array.isArray(e)){if(w1.isPOJO(e)&&e.values!=null)t=e.message,e=e.values;else if(typeof e==="number")e=Array.prototype.slice.call(arguments),t=null;if(w1.isPOJO(e)){let s=Object.keys(e).sort(),i=Object.values(e).sort();if(s.length===i.length&&s.every((o,u)=>o===String(i[u]))&&i.filter((o)=>typeof o==="number").length===Math.floor(i.length/2))e=i.filter((o)=>typeof o==="number");else e=Object.values(e)}t=t||ru.messages.Number.enum}t=t==null?ru.messages.Number.enum:t;for(let n of e)if(n!==void 0)this.enumValues.push(this.cast(n));let r=this.enumValues;return this.enumValidator=(n)=>n==null||r.indexOf(n)!==-1,this.validators.push({validator:this.enumValidator,message:t,type:"enum",enumValues:r}),this};Ht.prototype.cast=function(e,t,r,n,s){if(typeof e!=="number"&&on._isRef(this,e,t,r)){if(e==null||w1.isNonBuiltinObject(e))return this._castRef(e,t,r,s)}let i=e?._id!==void 0?e._id:e,o;if(typeof this._castFunction==="function")o=this._castFunction;else if(typeof this.constructor.cast==="function")o=this.constructor.cast();else o=Ht.cast();try{return o(i)}catch(u){throw new GV("Number",i,this.path,u,this)}};/*!
480
- * ignore
481
- */function vy(e){return this.cast(e)}function O_e(e){let t=this;if(!Array.isArray(e))return[this.cast(e)];return e.map(function(r){return t.cast(r)})}var S_e={...on.prototype.$conditionalHandlers,$bitsAllClear:$y,$bitsAnyClear:$y,$bitsAllSet:$y,$bitsAnySet:$y,$gt:vy,$gte:vy,$lt:vy,$lte:vy,$mod:O_e};Object.defineProperty(Ht.prototype,"$conditionalHandlers",{enumerable:!1,value:S_e});Ht.prototype.castForQuery=function(e,t,r){let n;if(e!=null){if(n=A_e(this.$conditionalHandlers,e),!n)throw new ru("Can't use "+e+" with Number.");return n.call(this,t,r)}try{t=this.applySetters(t,r)}catch(s){if(s instanceof GV&&s.path===this.path&&this.$fullPath!=null)s.path=this.$fullPath;throw s}return t};Ht.prototype.toJSONSchema=function(t){return this._addJSONSchemaEnum(this._createJSONSchemaTypeDefinition("number","number",t))};/*!
482
- * Module exports.
483
- */YV.exports=Ht});var Of=g(function(w_e){/*!
484
- * Module requirements.
485
- */var JV=vA();/*!
486
- * ignore
487
- */w_e.castToNumber=QV;w_e.castArraysOfNumbers=XV;/*!
488
- * ignore
489
- */function QV(e){return JV.cast()(e)}function XV(e,t){e.forEach(function(r,n){if(Array.isArray(r))XV(r,t);else e[n]=QV.call(t,r)})}});var jA=g(function(x_e){/*!
490
- * Module requirements.
491
- */var ZV=Of().castArraysOfNumbers,Sf=Of().castToNumber;/*!
492
- * ignore
493
- */x_e.cast$geoIntersects=M_e;x_e.cast$near=D_e;x_e.cast$within=T_e;function D_e(e){let t=ky();if(Array.isArray(e))return ZV(e,this),e;if(qA(this,e),e?.$geometry)return kA(e,this);if(!Array.isArray(e))throw TypeError("$near must be either an array or an object with a $geometry property");return t.prototype.castForQuery.call(this,null,e)}function kA(e,t){switch(e.$geometry.type){case"Polygon":case"LineString":case"Point":ZV(e.$geometry.coordinates,t);break;default:break}return qA(t,e),e}function T_e(e){if(qA(this,e),e.$box||e.$polygon){let t=e.$box?"$box":"$polygon";e[t].forEach((r)=>{if(!Array.isArray(r)){let n="Invalid $within $box argument. Expected an array, received "+r;throw TypeError(n)}r.forEach((n,s)=>{r[s]=Sf.call(this,n)})})}else if(e.$center||e.$centerSphere){let t=e.$center?"$center":"$centerSphere";e[t].forEach((r,n)=>{if(Array.isArray(r))r.forEach((s,i)=>{r[i]=Sf.call(this,s)});else e[t][n]=Sf.call(this,r)})}else if(e.$geometry)kA(e,this);return e}function M_e(e){if(!e.$geometry)return;return kA(e,this),e}function qA(e,t){if(t.$maxDistance)t.$maxDistance=Sf.call(e,t.$maxDistance);if(t.$minDistance)t.$minDistance=Sf.call(e,t.$minDistance)}});var ky=g(function(DMe,nz){/*!
494
- * Module dependencies.
495
- */var N_e=Im(),I_e=C3(),rz=Le(),R_e=SV(),Kt=Er(),qy=Kt.CastError,jy=_1(),$_e=yA(),ez=Oy(),v_e=CV(),UA=nc(),k_e=Zt(),q_e=$n(),tz=O1(),ga=G("util"),un=Oe(),j_e=Of().castToNumber,C1=jA(),L_e=qs(),U_e=_i(),V_e=yi(),wf,LA,z_e=Object.freeze({});function rt(e,t,r,n,s){LA||(LA=E1().Embedded);let i="type";if(n?.typeKey)i=n.typeKey;if(this.schemaOptions=n,t){let a={};if(un.isPOJO(t))if(t[i])a=k_e(t),delete a[i],t=t[i];else t=jy;if(r?.ref!=null&&a.ref==null)a.ref=r.ref;if(t===Object)t=jy;let c=typeof t==="string"?t:un.getFunctionName(t),l=Ef(),f=Object.hasOwn(l,c)?l[c]:t;if(typeof f==="function")if(f===rt)this.embeddedSchemaType=new f(e,a,n,null,s);else this.embeddedSchemaType=new f(e,a,n,s);else if(f instanceof Kt){if(this.embeddedSchemaType=f,!(this.embeddedSchemaType instanceof LA))this.embeddedSchemaType.path=e}}this.$isMongooseArray=!0,Kt.call(this,e,r,"Array",s);let o,u;if(this.defaultValue!=null)o=this.defaultValue,u=typeof o==="function";if(!("defaultValue"in this)||this.defaultValue!=null){let a=function(){return u?o.call(this):o!=null?[].concat(o):[]};a.$runBeforeSetters=!u,this.default(a)}}rt.schemaName="Array";rt.options={castNonArrays:!0};/*!
496
- * ignore
497
- */rt.defaultOptions={};rt.set=Kt.set;rt.setters=[];rt.get=Kt.get;/*!
498
- * Inherits from SchemaType.
499
- */rt.prototype=Object.create(Kt.prototype);rt.prototype.constructor=rt;rt.prototype.OptionsConstructor=R_e;/*!
500
- * ignore
501
- */rt._checkRequired=Kt.prototype.checkRequired;rt.checkRequired=Kt.checkRequired;/*!
502
- * Virtuals defined on this array itself.
503
- */rt.prototype.virtuals=null;rt.prototype.checkRequired=function(t,r){if(typeof t==="object"&&Kt._isRef(this,t,r,!0))return!!t;return(typeof this.constructor.checkRequired==="function"?this.constructor.checkRequired():rt.checkRequired())(t)};rt.prototype.enum=function(){let e=this;while(!0){let r=e?.embeddedSchemaType?.instance;if(r==="Array"){e=e.embeddedSchemaType;continue}if(r!=="String"&&r!=="Number")throw Error("`enum` can only be set on an array of strings or numbers , not "+r);break}let t=arguments;if(!Array.isArray(arguments)&&un.isObject(arguments))t=un.object.vals(t);return e.embeddedSchemaType.enum.apply(e.embeddedSchemaType,t),this};rt.prototype.applyGetters=function(e,t){if(t?.$__!=null&&t.$populated(this.path))return e;return Kt.prototype.applyGetters.call(this,e,t)};rt.prototype._applySetters=function(e,t,r,n){if(this.embeddedSchemaType.$isMongooseArray&&e!=null&&e.length!==0){let s=[],i=this;while(i!=null&&i.$isMongooseArray&&!i.$isMongooseDocumentArray)s.push(i),i=i.embeddedSchemaType;let o=v_e(e);if(o.min===o.max&&o.max<s.length&&o.containsNonArrayItem&&s.slice(o.max).every((u)=>u.options.castNonArrays??rt.options.castNonArrays))for(let u=o.max;u<s.length;++u)e=[e]}return Kt.prototype._applySetters.call(this,e,t,r,n)};rt.prototype.cast=function(e,t,r,n,s){wf||(wf=E1().Array);let i,o;if(Array.isArray(e)){if(!e.length&&t){let d=t.schema.indexedPaths(),p=this.path;for(i=0,o=d.length;i<o;++i){let _=d[i][0][p];if(_==="2dsphere"||_==="2d")return}let m=this.path.endsWith(".coordinates")?this.path.substring(0,this.path.lastIndexOf(".")):null;if(m!=null){for(i=0,o=d.length;i<o;++i)if(d[i][0][m]==="2dsphere")return}}s=s||z_e;let c=un.isMongooseArray(e)?e.__array:e,l=s.path||this.path;if(s.arrayPathIndex!=null)l+="."+s.arrayPathIndex;if(e=wf(c,l,t,this),c=e.__array,r&&t?.$__!=null&&t.$populated(this.path))return e;let f=this.embeddedSchemaType,h=f.$isMongooseArray;if(f&&this.embeddedSchemaType.constructor!==jy)try{let d=c.length;for(i=0;i<d;i++){let p={};if(h){if(s.arrayPath!=null)p.arrayPathIndex=i;else if(f._arrayParentPath!=null)p.arrayPathIndex=i}if(s.hydratedPopulatedDocs)p.hydratedPopulatedDocs=s.hydratedPopulatedDocs;if(s.virtuals)p.virtuals=s.virtuals;if(c[i]===void 0&&f.defaultValue!==void 0)c[i]=f.getDefault(t,r,null,p);else c[i]=f.applySetters(c[i],t,r,void 0,p)}}catch(d){throw new qy("["+d.kind+"]",ga.inspect(e),this.path+"."+i,d,this)}return e}let u=this.options.castNonArrays??rt.options.castNonArrays;if(r||u){if(t&&r)t.markModified(this.path);return this.cast([e],t,r)}throw new qy("Array",ga.inspect(e),this.path,null,this)};/*!
504
- * ignore
505
- */rt.prototype._castForPopulate=function(t,r){if(wf||(wf=E1().Array),Array.isArray(t)){let n,s=t.__array?t.__array:t,i=s.length;if(this.embeddedSchemaType&&this.embeddedSchemaType.constructor!==jy)try{for(n=0;n<i;n++){let o={};if(this.embeddedSchemaType.$isMongooseArray&&this.embeddedSchemaType._arrayParentPath!=null)o.arrayPathIndex=n;s[n]=this.embeddedSchemaType.cast(s[n],r,!1,void 0,o)}}catch(o){throw new qy("["+o.kind+"]",ga.inspect(t),this.path+"."+n,o,this)}return t}throw new qy("Array",ga.inspect(t),this.path,null,this)};rt.prototype.$toObject=rt.prototype.toObject;/*!
506
- * ignore
507
- */rt.prototype.discriminator=function(...e){let t=this;while(t.$isMongooseArray&&!t.$isMongooseDocumentArray)t=t.embeddedSchemaType;if(!t.$isMongooseDocumentArray)throw new rz("You can only add an embedded discriminator on a document array, "+this.path+" is a plain array");return t.discriminator(...e)};/*!
508
- * ignore
509
- */rt.prototype.clone=function(){let e=Object.assign({},this.options),t=new this.constructor(this.path,this.embeddedSchemaType,e,this.schemaOptions,this.parentSchema);if(t.validators=this.validators.slice(),this.requiredValidator!==void 0)t.requiredValidator=this.requiredValidator;return t};rt.prototype._castForQuery=function(e,t){let r=this.embeddedSchemaType,n=r?.schema?.options?.discriminatorKey,s=r?.discriminators;if(e&&s&&typeof n==="string"){let i=L_e(s,e[n]);if(i)r=i;else{let o=U_e(s,e[n]);if(o)r=o}}if(Array.isArray(e)){for(let i=this.setters.length-1;i>=0;i--)e=this.setters[i].call(this,e,this);e=e.map(function(i){if(un.isObject(i)&&i.$elemMatch)return i;return r.castForQuery(null,i,t)})}else e=r.castForQuery(null,e,t);return e};rt.prototype.castForQuery=function(e,t,r){let n;if(e!=null){if(n=V_e(this.$conditionalHandlers,e),!n)throw Error("Can't use "+e+" with Array.");return n.call(this,t,r)}else return this._castForQuery(t,r)};rt.prototype.virtual=function(t,r){if(t instanceof ez||q_e(t)==="VirtualType")return this.virtual(t.path,t.options);if(r=new $_e(r),un.hasUserDefinedProperty(r,["ref","refPath"]))throw new rz("Cannot set populate virtual as a property of an array");let n=new ez(r,t);if(this.virtuals===null)this.virtuals={};return this.virtuals[t]=n,n};function W_e(e,t){if(!Array.isArray(e))e=[e];return e=e.map((r)=>{if(!un.isObject(r))return r;if(r.$elemMatch!=null)return{$elemMatch:UA(this.embeddedSchemaType.schema,r.$elemMatch,null,this?.$$context)};let n={};return n[this.path]=r,UA(this.embeddedSchemaType.schema,n,null,this?.$$context)[this.path]},this),this.castForQuery(null,e,t)}function H_e(e,t){let r=Object.keys(e),n=r.length;for(let s=0;s<n;++s){let i=r[s],o=e[i];if(i==="$not"){if(un.isPOJO(o)){for(let u of Object.keys(o))if(tz(u)&&o[u]!=null)o[u]=this.castForQuery(u,o[u],t)}continue}if(tz(i)&&o!=null)e[i]=this.castForQuery(i,o,t)}return e}var Ut=rt.prototype.$conditionalHandlers={};Ut.$all=W_e;Ut.$options=String;Ut.$elemMatch=H_e;Ut.$geoIntersects=C1.cast$geoIntersects;Ut.$or=VA("$or");Ut.$and=VA("$and");Ut.$nor=VA("$nor");function VA(e){return function(r,n){if(!Array.isArray(r))throw TypeError("conditional "+e+" requires an array");let s=[];for(let i of r)s.push(UA(this.embeddedSchemaType.schema??n.schema,i,null,this?.$$context));return s}}Ut.$near=Ut.$nearSphere=C1.cast$near;Ut.$within=Ut.$geoWithin=C1.cast$within;Ut.$size=Ut.$minDistance=Ut.$maxDistance=j_e;Ut.$exists=N_e;Ut.$type=I_e;Ut.$eq=Ut.$gt=Ut.$gte=Ut.$lt=Ut.$lte=Ut.$not=Ut.$regex=Ut.$ne=rt.prototype._castForQuery;Ut.$nin=Kt.prototype.$conditionalHandlers.$nin;Ut.$in=Kt.prototype.$conditionalHandlers.$in;rt.prototype.toJSONSchema=function(t){let r=this.getEmbeddedSchemaType();return{...this._createJSONSchemaTypeDefinition("array","array",t),items:r.toJSONSchema(t)}};rt.prototype.autoEncryptionType=function(){return"array"};/*!
510
- * Module exports.
511
- */nz.exports=rt});var oz=g(function(TMe,iz){var{Long:K_e}=we(),zA=9223372036854775807n,WA=-9223372036854775808n,sz=`Mongoose only supports BigInts between ${WA} and ${zA} because MongoDB does not support arbitrary precision integers`;iz.exports=function(t){if(t==null)return t;if(t==="")return null;if(typeof t==="bigint"){if(t>zA||t<WA)throw Error(sz);return t}if(t instanceof K_e)return t.toBigInt();if(typeof t==="string"||typeof t==="number"){if(t=BigInt(t),t>zA||t<WA)throw Error(sz);return t}throw Error(`Cannot convert value to BigInt: "${t}"`)}});var cz=g(function(MMe,az){/*!
512
- * Module dependencies.
513
- */var uz=kn(),Ai=Er(),G_e=oz(),Y_e=yi();function Ar(e,t,r,n){Ai.call(this,e,t,"BigInt",n)}Ar.schemaName="BigInt";Ar.defaultOptions={};/*!
514
- * Inherits from SchemaType.
515
- */Ar.prototype=Object.create(Ai.prototype);Ar.prototype.constructor=Ar;/*!
516
- * ignore
517
- */Ar._cast=G_e;Ar.set=Ai.set;Ar.setters=[];Ar.get=Ai.get;Ar.cast=function(t){if(arguments.length===0)return this._cast;if(t===!1)t=this._defaultCaster;return this._cast=t,this._cast};/*!
518
- * ignore
519
- */Ar._checkRequired=(e)=>e!=null;Ar.checkRequired=Ai.checkRequired;Ar.prototype.checkRequired=function(e){return this.constructor._checkRequired(e)};Ar.prototype.cast=function(e){let t;if(typeof this._castFunction==="function")t=this._castFunction;else if(typeof this.constructor.cast==="function")t=this.constructor.cast();else t=Ar.cast();try{return t(e)}catch(r){throw new uz("BigInt",e,this.path,r,this)}};/*!
520
- * ignore
521
- */var J_e={...Ai.prototype.$conditionalHandlers,$gt:Ly,$gte:Ly,$lt:Ly,$lte:Ly};Object.defineProperty(Ar.prototype,"$conditionalHandlers",{enumerable:!1,value:J_e});/*!
522
- * ignore
523
- */function Ly(e,t){return this.castForQuery(null,e,t)}Ar.prototype.castForQuery=function(e,t,r){let n;if(e!=null){if(n=Y_e(this.$conditionalHandlers,e),n)return n.call(this,t);return this.applySetters(t,r)}try{return this.applySetters(t,r)}catch(s){if(s instanceof uz&&s.path===this.path&&this.$fullPath!=null)s.path=this.$fullPath;throw s}};Ar.prototype._castNullish=function(t){if(typeof t>"u")return t;if((typeof this.constructor.cast==="function"?this.constructor.cast():Ar.cast())==null)return t;return t};Ar.prototype.toJSONSchema=function(t){return this._createJSONSchemaTypeDefinition("string","long",t)};Ar.prototype.autoEncryptionType=function(){return"long"};/*!
524
- * Module exports.
525
- */az.exports=Ar});var fz=g(function(xMe,hz){/*!
526
- * Module dependencies.
527
- */var lz=kn(),Oi=Er(),sc=Nm(),Q_e=yi();function Gt(e,t,r,n){Oi.call(this,e,t,"Boolean",n)}Gt.schemaName="Boolean";Gt.defaultOptions={};/*!
528
- * Inherits from SchemaType.
529
- */Gt.prototype=Object.create(Oi.prototype);Gt.prototype.constructor=Gt;/*!
530
- * ignore
531
- */Gt._cast=sc;Gt.set=Oi.set;Gt.setters=[];Gt.get=Oi.get;Gt.cast=function(t){if(arguments.length===0)return this._cast;if(t===!1)t=this._defaultCaster;return this._cast=t,this._cast};/*!
532
- * ignore
533
- */Gt._defaultCaster=(e)=>{if(e!=null&&typeof e!=="boolean")throw Error();return e};/*!
534
- * ignore
535
- */Gt._checkRequired=(e)=>e===!0||e===!1;Gt.checkRequired=Oi.checkRequired;Gt.prototype.checkRequired=function(e){return this.constructor._checkRequired(e)};Object.defineProperty(Gt,"convertToTrue",{get:()=>sc.convertToTrue,set:(e)=>{sc.convertToTrue=e}});Object.defineProperty(Gt,"convertToFalse",{get:()=>sc.convertToFalse,set:(e)=>{sc.convertToFalse=e}});Gt.prototype.cast=function(e){let t;if(typeof this._castFunction==="function")t=this._castFunction;else if(typeof this.constructor.cast==="function")t=this.constructor.cast();else t=Gt.cast();try{return t(e)}catch(r){throw new lz("Boolean",e,this.path,r,this)}};var X_e={...Oi.prototype.$conditionalHandlers};Object.defineProperty(Gt.prototype,"$conditionalHandlers",{enumerable:!1,value:X_e});Gt.prototype.castForQuery=function(e,t,r){let n;if(e!=null){if(n=Q_e(this.$conditionalHandlers,e),n)return n.call(this,t);return this.applySetters(t,r)}try{return this.applySetters(t,r)}catch(s){if(s instanceof lz&&s.path===this.path&&this.$fullPath!=null)s.path=this.$fullPath;throw s}};Gt.prototype._castNullish=function(t){if(typeof t>"u")return t;let r=typeof this.constructor.cast==="function"?this.constructor.cast():Gt.cast();if(r==null)return t;if(r.convertToFalse instanceof Set&&r.convertToFalse.has(t))return!1;if(r.convertToTrue instanceof Set&&r.convertToTrue.has(t))return!0;return t};Gt.prototype.toJSONSchema=function(t){return this._createJSONSchemaTypeDefinition("boolean","bool",t)};Gt.prototype.autoEncryptionType=function(){return"bool"};/*!
536
- * Module exports.
537
- */hz.exports=Gt});var pz=g(function(PMe,dz){var Z_e=As();class HA extends Z_e{}var eEe=vs();Object.defineProperty(HA.prototype,"subtype",eEe);/*!
538
- * ignore
539
- */dz.exports=HA});var yz=g(function(BMe,mz){/*!
540
- * Module dependencies.
541
- */var ic=qm(),tEe=pz(),an=Er(),Uy=Af(),Wy=Oe(),rEe=yi(),KA=ic.Binary,zy=an.CastError;function zr(e,t,r,n){an.call(this,e,t,"Buffer",n)}zr.schemaName="Buffer";zr.defaultOptions={};/*!
542
- * Inherits from SchemaType.
543
- */zr.prototype=Object.create(an.prototype);zr.prototype.constructor=zr;zr.prototype.OptionsConstructor=tEe;/*!
544
- * ignore
545
- */zr._checkRequired=(e)=>!!e?.length;zr.set=an.set;zr.setters=[];zr.get=an.get;zr.checkRequired=an.checkRequired;zr.prototype.checkRequired=function(e,t){if(an._isRef(this,e,t,!0))return!!e;return this.constructor._checkRequired(e)};zr.prototype.cast=function(e,t,r,n,s){let i;if(an._isRef(this,e,t,r)){if(Buffer.isBuffer(e)&&e.isMongooseBuffer)return e;if(Buffer.isBuffer(e)){if(e=new ic(e,[this.path,t]),this.options.subtype!=null)e._subtype=this.options.subtype;return e}if(e instanceof KA){if(i=new ic(e.value(!0),[this.path,t]),typeof e.sub_type!=="number")throw new zy("Buffer",e,this.path,null,this);return i._subtype=e.sub_type,i}if(e==null||Wy.isNonBuiltinObject(e))return this._castRef(e,t,r,s)}if(e?._id)e=e._id;if(Buffer.isBuffer(e)&&e.isMongooseBuffer)return e;if(Buffer.isBuffer(e)){if(e=new ic(e,[this.path,t]),this.options.subtype!=null)e._subtype=this.options.subtype;return e}if(e instanceof KA){if(i=new ic(e.value(!0),[this.path,t]),typeof e.sub_type!=="number")throw new zy("Buffer",e,this.path,null,this);return i._subtype=e.sub_type,i}if(e===null)return e;let o=typeof e;if(o==="string"||o==="number"||Array.isArray(e)||o==="object"&&e.type==="Buffer"&&Array.isArray(e.data)){if(o==="number")e=[e];if(i=new ic(e,[this.path,t]),this.options.subtype!=null)i._subtype=this.options.subtype;return i}if(Wy.isPOJO(e)&&(e.$binary instanceof KA||typeof e.$binary==="string")){let u=this.cast(Buffer.from(e.$binary,"base64"));if(e.$type!=null)return u._subtype=e.$type,u}throw new zy("Buffer",e,this.path,null,this)};zr.prototype.subtype=function(e){return this.options.subtype=e,this};/*!
546
- * ignore
547
- */function Vy(e,t){return this.castForQuery(null,e,t)}var nEe={...an.prototype.$conditionalHandlers,$bitsAllClear:Uy,$bitsAnyClear:Uy,$bitsAllSet:Uy,$bitsAnySet:Uy,$gt:Vy,$gte:Vy,$lt:Vy,$lte:Vy};Object.defineProperty(zr.prototype,"$conditionalHandlers",{enumerable:!1,value:nEe});zr.prototype.castForQuery=function(e,t,r){let n;if(e!=null){if(n=rEe(this.$conditionalHandlers,e),!n)throw Error("Can't use "+e+" with Buffer.");return n.call(this,t)}let s;try{s=this.applySetters(t,r)}catch(i){if(i instanceof zy&&i.path===this.path&&this.$fullPath!=null)i.path=this.$fullPath;throw i}return s?s.toObject({transform:!1,virtuals:!1}):s};zr.prototype.toJSONSchema=function(t){return this._createJSONSchemaTypeDefinition("string","binData",t)};zr.prototype.autoEncryptionType=function(){return"binData"};/*!
548
- * Module exports.
549
- */mz.exports=zr});var _z=g(function(FMe,gz){var sEe=As();class Cf extends sEe{}var GA=vs();Object.defineProperty(Cf.prototype,"min",GA);Object.defineProperty(Cf.prototype,"max",GA);Object.defineProperty(Cf.prototype,"expires",GA);/*!
550
- * ignore
551
- */gz.exports=Cf});var Az=g(function(NMe,Ez){var b1=G("assert");Ez.exports=function(t){if(t==null||t==="")return null;if(t instanceof Date)return b1.ok(!isNaN(t.valueOf())),t;let r;if(b1.ok(typeof t!=="boolean"),t instanceof Number||typeof t==="number")r=new Date(t);else if(typeof t==="string"&&!isNaN(Number(t))&&(Number(t)>=275761||Number(t)<-271820))r=new Date(Number(t));else if(typeof t.valueOf==="function")r=new Date(t.valueOf());else r=new Date(t);if(!isNaN(r.valueOf()))return r;b1.ok(!1)}});var Cz=g(function(IMe,wz){/*!
552
- * Module requirements.
553
- */var Ky=$s(),iEe=_z(),Ln=Er(),oEe=Az(),uEe=$n(),Oz=Oe(),aEe=yi(),Sz=Ln.CastError;function Vt(e,t,r,n){Ln.call(this,e,t,"Date",n)}Vt.schemaName="Date";Vt.defaultOptions={};/*!
554
- * Inherits from SchemaType.
555
- */Vt.prototype=Object.create(Ln.prototype);Vt.prototype.constructor=Vt;Vt.prototype.OptionsConstructor=iEe;/*!
556
- * ignore
557
- */Vt._cast=oEe;Vt.set=Ln.set;Vt.setters=[];Vt.get=Ln.get;Vt.cast=function(t){if(arguments.length===0)return this._cast;if(t===!1)t=this._defaultCaster;return this._cast=t,this._cast};/*!
558
- * ignore
559
- */Vt._defaultCaster=(e)=>{if(e!=null&&!(e instanceof Date))throw Error();return e};Vt.prototype.expires=function(e){if(uEe(this._index)!=="Object")this._index={};return this._index.expires=e,Oz.expires(this._index),this};/*!
560
- * ignore
561
- */Vt._checkRequired=(e)=>e instanceof Date;Vt.checkRequired=Ln.checkRequired;Vt.prototype.checkRequired=function(e,t){if(typeof e==="object"&&Ln._isRef(this,e,t,!0))return e!=null;return(typeof this.constructor.checkRequired==="function"?this.constructor.checkRequired():Vt.checkRequired())(e)};Vt.prototype.min=function(e,t){if(this.minValidator)this.validators=this.validators.filter(function(r){return r.validator!==this.minValidator},this);if(e){let r=t||Ky.messages.Date.min;if(typeof r==="string")r=r.replace(/{MIN}/,e===Date.now?"Date.now()":e.toString());let n=this;this.validators.push({validator:this.minValidator=function(s){let i=e;if(typeof e==="function"&&e!==Date.now)i=i.call(this);let o=i===Date.now?i():n.cast(i);return s===null||s.valueOf()>=o.valueOf()},message:r,type:"min",min:e})}return this};Vt.prototype.max=function(e,t){if(this.maxValidator)this.validators=this.validators.filter(function(r){return r.validator!==this.maxValidator},this);if(e){let r=t||Ky.messages.Date.max;if(typeof r==="string")r=r.replace(/{MAX}/,e===Date.now?"Date.now()":e.toString());let n=this;this.validators.push({validator:this.maxValidator=function(s){let i=e;if(typeof i==="function"&&i!==Date.now)i=i.call(this);let o=i===Date.now?i():n.cast(i);return s===null||s.valueOf()<=o.valueOf()},message:r,type:"max",max:e})}return this};Vt.prototype.cast=function(e){let t;if(typeof this._castFunction==="function")t=this._castFunction;else if(typeof this.constructor.cast==="function")t=this.constructor.cast();else t=Vt.cast();try{return t(e)}catch(r){throw new Sz("date",e,this.path,r,this)}};function Hy(e){return this.cast(e)}var cEe={...Ln.prototype.$conditionalHandlers,$gt:Hy,$gte:Hy,$lt:Hy,$lte:Hy};Object.defineProperty(Vt.prototype,"$conditionalHandlers",{enumerable:!1,value:cEe});Vt.prototype.castForQuery=function(e,t,r){if(e==null)try{return this.applySetters(t,r)}catch(s){if(s instanceof Sz&&s.path===this.path&&this.$fullPath!=null)s.path=this.$fullPath;throw s}let n=aEe(this.$conditionalHandlers,e);if(!n)throw Error("Can't use "+e+" with Date.");return n.call(this,t)};Vt.prototype.toJSONSchema=function(t){return this._createJSONSchemaTypeDefinition("string","date",t)};Vt.prototype.autoEncryptionType=function(){return"date"};/*!
562
- * Module exports.
563
- */wz.exports=Vt});var Tz=g(function(RMe,Dz){var Hi=Mm(),bz=G("assert");Dz.exports=function(t){if(t==null)return t;if(typeof t==="object"&&typeof t.$numberDecimal==="string")return Hi.fromString(t.$numberDecimal);if(t instanceof Hi)return t;if(typeof t==="string")return Hi.fromString(t);if(typeof Buffer==="function"&&Buffer.isBuffer(t))return new Hi(t);if(typeof Uint8Array==="function"&&t instanceof Uint8Array)return new Hi(t);if(typeof t==="number")return Hi.fromString(String(t));if(typeof t.valueOf==="function"&&typeof t.valueOf()==="string")return Hi.fromString(t.valueOf());bz.ok(!1)}});var xz=g(function($Me,Mz){/*!
564
- * Module dependencies.
565
- */var cn=Er(),lEe=cn.CastError,hEe=Tz(),YA=vn();function br(e,t,r,n){cn.call(this,e,t,"Decimal128",n)}br.schemaName="Decimal128";br.defaultOptions={};/*!
566
- * Inherits from SchemaType.
567
- */br.prototype=Object.create(cn.prototype);br.prototype.constructor=br;/*!
568
- * ignore
569
- */br._cast=hEe;br.set=cn.set;br.setters=[];br.get=cn.get;br.cast=function(t){if(arguments.length===0)return this._cast;if(t===!1)t=this._defaultCaster;return this._cast=t,this._cast};/*!
570
- * ignore
571
- */br._defaultCaster=(e)=>{if(e!=null&&!YA(e,"Decimal128"))throw Error();return e};/*!
572
- * ignore
573
- */br._checkRequired=(e)=>YA(e,"Decimal128");br.checkRequired=cn.checkRequired;br.prototype.checkRequired=function(t,r){if(cn._isRef(this,t,r,!0))return!!t;return(typeof this.constructor.checkRequired==="function"?this.constructor.checkRequired():br.checkRequired())(t)};br.prototype.cast=function(e,t,r,n,s){if(cn._isRef(this,e,t,r)){if(YA(e,"Decimal128"))return e;return this._castRef(e,t,r,s)}let i;if(typeof this._castFunction==="function")i=this._castFunction;else if(typeof this.constructor.cast==="function")i=this.constructor.cast();else i=br.cast();try{return i(e)}catch(o){throw new lEe("Decimal128",e,this.path,o,this)}};/*!
574
- * ignore
575
- */function Gy(e){return this.cast(e)}var fEe={...cn.prototype.$conditionalHandlers,$gt:Gy,$gte:Gy,$lt:Gy,$lte:Gy};Object.defineProperty(br.prototype,"$conditionalHandlers",{enumerable:!1,value:fEe});br.prototype.toJSONSchema=function(t){return this._createJSONSchemaTypeDefinition("string","decimal",t)};br.prototype.autoEncryptionType=function(){return"decimal"};/*!
576
- * Module exports.
577
- */Mz.exports=br});var Bz=g(function(vMe,Pz){var dEe=As();class bf extends dEe{}var JA=vs();Object.defineProperty(bf.prototype,"_id",JA);Object.defineProperty(bf.prototype,"minimize",JA);Object.defineProperty(bf.prototype,"discriminators",JA);Pz.exports=bf});var Nz=g(function(kMe,Fz){var Un=Ui();/*!
578
- * ignore
579
- */Fz.exports=function(t){t.s.hooks.pre("save",!1,QA,null,!0),t.s.hooks.post("save",XA,null,!0),t.s.hooks.pre("save",ZA),t.s.hooks.post("save",e4)};function QA(){if(this.$isSubdocument)return;let e=this.$getAllSubdocs({useCache:!0});if(!e.length)return;let t=this.$__.saveOptions;return Promise.all(e.map((r)=>r._execDocumentPreHooks("save",t,[t]))).then(()=>{if(this.$__.saveOptions)this.$__.saveOptions.__subdocs=null})}function XA(){if(this.$isSubdocument)return;let e=this.$getAllSubdocs({useCache:!0});if(!e.length)return;let t=this.$__.saveOptions,r=[];for(let n of e)r.push(n._execDocumentPostHooks("save",t));return Promise.all(r)}function ZA(){let e=this.$__.removedSubdocs;if(!e?.length)return;let t=this.$__.saveOptions,r=[];for(let n of e)r.push(n._execDocumentPreHooks("deleteOne",t));return Promise.all(r)}function e4(){let e=this.$__.removedSubdocs;if(!e?.length)return;let t=this.$__.saveOptions,r=[];for(let n of e)r.push(n._execDocumentPostHooks("deleteOne",t));return this.$__.removedSubdocs=null,Promise.all(r)}QA[Un.builtInMiddleware]=!0;QA[Un.skipOnSubdocuments]=!0;XA[Un.builtInMiddleware]=!0;XA[Un.skipOnSubdocuments]=!0;ZA[Un.builtInMiddleware]=!0;ZA[Un.skipOnSubdocuments]=!0;e4[Un.builtInMiddleware]=!0;e4[Un.skipOnSubdocuments]=!0});var Iz=g(function(qMe,n4){var pEe=le().objectIdSymbol,bt=Ui(),Yy=Oe();/*!
580
- * ignore
581
- */n4.exports=function(t){t.post("init",Jy),t.pre("save",Qy),t.post("save",Xy),t.pre("deleteOne",{document:!0,query:!1},Zy),t.pre("updateOne",{document:!0,query:!1},e2)};function Jy(){return r4.call(this),this}function Qy(){t4.call(this)}function Xy(){r4.call(this)}function Zy(){t4.call(this)}function e2(){t4.call(this)}/*!
582
- * ignore
583
- */function t4(){let e,t;if(this.$__.shardval){e=Object.keys(this.$__.shardval),t=e.length,this.$where=this.$where||{};for(let r=0;r<t;++r)this.$where[e[r]]=this.$__.shardval[e[r]]}}/*!
584
- * ignore
585
- */n4.exports.storeShard=r4;/*!
586
- * ignore
587
- */function r4(){let e=this.$__schema.options.shardKey||this.$__schema.options.shardkey;if(!Yy.isPOJO(e))return;let t=this.$__.shardval={},r=Object.keys(e),n=r.length,s;for(let i=0;i<n;++i)if(s=this.$__getValue(r[i]),s==null)t[r[i]]=s;else if(Yy.isMongooseObject(s))t[r[i]]=s.toObject({depopulate:!0,_isNested:!0});else if(s instanceof Date||s[pEe])t[r[i]]=s;else if(typeof s.valueOf==="function")t[r[i]]=s.valueOf();else t[r[i]]=s}Jy[bt.builtInMiddleware]=!0;Jy[bt.skipOnSubdocuments]=!0;Jy[bt.requiresShardKey]=!0;Qy[bt.builtInMiddleware]=!0;Qy[bt.skipOnSubdocuments]=!0;Qy[bt.requiresShardKey]=!0;Xy[bt.builtInMiddleware]=!0;Xy[bt.skipOnSubdocuments]=!0;Xy[bt.requiresShardKey]=!0;Zy[bt.builtInMiddleware]=!0;Zy[bt.skipOnSubdocuments]=!0;Zy[bt.requiresShardKey]=!0;e2[bt.builtInMiddleware]=!0;e2[bt.skipOnSubdocuments]=!0;e2[bt.requiresShardKey]=!0});var jz=g(function(jMe,qz){var D1=le().arrayAtomicsSymbol,t2=le().sessionNewDocuments,r2=Ui(),T1=Oe();qz.exports=function(t){t.pre("save",$z),t.pre("deleteOne",{document:!0,query:!1},vz)};function $z(){kz(this)}function vz(){let e=kz(this);if(e!=null&&!Object.hasOwn(e,"isDeleted"))e.isDeleted=this.$isDeleted()}function kz(e){let t=e.$session();if(t==null)return null;if(t.transaction==null||t[t2]==null)return null;if(!t[t2].has(e)){let r={};if(e.isNew)r.isNew=!0;if(e.$__schema.options.versionKey)r.versionKey=e.get(e.$__schema.options.versionKey);r.modifiedPaths=new Set(Object.keys(e.$__.activePaths.getStatePaths("modify"))),r.atomics=mEe(e),t[t2].set(e,r)}return t[t2].get(e)}function mEe(e,t){let r=new Map;t=t||new Map;let n=Object.keys(e.$__.activePaths.init).concat(Object.keys(e.$__.activePaths.modify));for(let i of n){let o=e.$__getValue(i);if(Array.isArray(o)&&T1.isMongooseDocumentArray(o)&&o.length&&o[D1]!=null&&T1.hasOwnKeys(o[D1])){let u=t.get(i)||{};r.set(i,Rz(u,o[D1]))}}let s=e.$__dirty();for(let i of s){let{path:o,value:u}=i;if(u?.[D1]!=null&&T1.hasOwnKeys(u[D1])){let a=t.get(o)||{};r.set(o,Rz(a,u[D1]))}}return r}function Rz(e,t){if(e=e||{},t.$pullAll!=null)e.$pullAll=(e.$pullAll||[]).concat(t.$pullAll);if(t.$push!=null)e.$push=e.$push||{},e.$push.$each=(e.$push.$each||[]).concat(t.$push.$each);if(t.$addToSet!=null)e.$addToSet=(e.$addToSet||[]).concat(t.$addToSet);if(t.$set!=null)e.$set=Array.isArray(t.$set)?[...t.$set]:Object.assign({},t.$set);return e}$z[r2.builtInMiddleware]=!0;vz[r2.builtInMiddleware]=!0});var s4=g(function(yEe){yEe.saveSubdocs=Nz();yEe.sharding=Iz();yEe.trackTransaction=jz()});var Vz=g(function(UMe,Uz){var Lz=s4();Uz.exports=function(t){for(let r of Object.values(Lz))r(t,{deduplicate:!0});t.plugins=Object.values(Lz).map((r)=>({fn:r,opts:{deduplicate:!0}})).concat(t.plugins)}});var Kz=g(function(VMe,Hz){var AEe=vm(),Wz=la(),OEe=vn(),SEe=ca(),wEe=Er(),zz=Wa();Hz.exports=function e(t,r,n,s){let i=Object.keys(r),o=0,u=i.length,a;if(n=n||"",s=s||new WeakSet,s.has(r))return;s.add(r);while(o<u){if(a=i[o++],!n){if(a==="discriminators"||a==="base"||a==="_applyDiscriminators"||a==="_userProvidedOptions"||a==="options"||a==="tree")continue}if(n==="tree"&&r?.instanceOfSchema)continue;if(Wz.has(a))continue;if(a==="parentSchema")continue;if(t[a]==null)t[a]=r[a];else if(zz(r[a])){if(!zz(t[a]))t[a]={};if(r[a]!=null){if(r[a].$isSingleNested&&t[a].$isMongooseDocumentArray||r[a].$isMongooseDocumentArray&&t[a].$isSingleNested||r[a].$isMongooseDocumentArrayElement&&t[a].$isMongooseDocumentArrayElement)continue;else if(r[a].instanceOfSchema){if(t[a].instanceOfSchema)AEe(t[a],r[a].clone(),!0);else t[a]=r[a].clone();continue}else if(OEe(r[a],"ObjectId")){t[a]=new SEe(r[a]);continue}else if(r[a]instanceof wEe){if(t[a]==null)t[a]=r[a].clone();if(!r[a].$isMongooseDocumentArray&&!r[a].$isSingleNested)continue}}e(t[a],r[a],n?n+"."+a:a,s)}}if(r?.instanceOfSchema)t.tree=Object.assign({},r.tree,t.tree)}});var n2=g(function(zMe,Jz){var Gz=_1(),CEe=Vz(),bEe=Zt(),DEe=Km().defineKey,TEe=gr(),MEe=Co(),M1=Oe(),xEe=Kz(),Yz={toJSON:!0,toObject:!0,_id:!0,id:!0,virtuals:!0,methods:!0,statics:!0,defaultSort:!0};function PEe(e,t){if(e.encryptionType()==null&&t.encryptionType()==null)return;let r=s(n(e),n(t));for(let i of r){if(e._hasEncryptedField(i)&&t._hasEncryptedField(i))throw Error(`encrypted fields cannot be declared on both the base schema and the child schema in a discriminator. path=${i}`);if(e._hasEncryptedField(i)||t._hasEncryptedField(i))throw Error(`encrypted fields cannot have the same path as a non-encrypted field for discriminators. path=${i}`)}function n(i){return[...Object.keys(i.paths),...Object.keys(i.singleNestedPaths)]}function*s(i,o){let u=new Set(i);for(let a of o)if(u.has(a))yield a}}/*!
588
- * ignore
589
- */Jz.exports=function(t,r,n,s,i,o,u){if(!n?.instanceOfSchema)throw Error("You must pass a valid discriminator Schema");if(r==="__proto__")throw Error('Discriminator name "__proto__" is not allowed');if(o=o==null?!0:o,t.schema.discriminatorMapping&&!t.schema.discriminatorMapping.isRoot)throw Error('Discriminator "'+r+'" can only be a discriminator of the root model');if(i){let h=TEe(t.base,"options.applyPluginsToDiscriminators",!1)||!o;t.base._applyPlugins(n,{skipTopLevel:!h})}else if(!o)CEe(n);let a=t.schema.options.discriminatorKey,c=t.schema.path(a);if(c!=null){if(!M1.hasUserDefinedProperty(c.options,"select"))c.options.select=!0;c.options.$skipDiscriminatorCheck=!0}else{let h={};h[a]={default:void 0,select:!0,$skipDiscriminatorCheck:!0},h[a][t.schema.options.typeKey]=String,t.schema.add(h),DEe({prop:a,prototype:t.prototype,options:t.schema.options})}if(n.path(a)&&n.path(a).options.$skipDiscriminatorCheck!==!0)throw Error('Discriminator "'+r+'" cannot have field with name "'+a+'"');let l=r;if(typeof s==="string"&&s.length||s!=null)l=s;PEe(t.schema,n);function f(h,d){if(h._baseSchema=d,d.paths._id&&d.paths._id.options&&!d.paths._id.options.auto)h.remove("_id");let p=Object.keys(d.paths),m=[];for(let O of p){if(h.nested[O]){m.push(O);continue}if(O.indexOf(".")===-1)continue;let x=O.split(".").slice(0,-1),v="";for(let P of x)if(v+=(v.length?".":"")+P,h.paths[v]instanceof Gz||h.singleNestedPaths[v]instanceof Gz)m.push(O)}h.obj={...h.obj},xEe(h,d),h._gatherChildSchemas();for(let O of m)delete h.paths[O];h._defaultsCache=null,h._pathsWithTransforms=void 0,h._hasSelectedPaths=void 0,h.childSchemas.forEach((O)=>{O.model.prototype.$__setSchema(O.schema)});let _={};if(_[a]={default:l,select:!0,set:function(O){if(O===l||Array.isArray(l)&&M1.deepEqual(O,l))return l;throw Error(`Can't set discriminator key "`+a+'"')},$skipDiscriminatorCheck:!0},_[a][h.options.typeKey]=c?c.options[h.options.typeKey]:String,h.add(_),h.discriminatorMapping={key:a,value:l,isRoot:!1},d.options.collection)h.options.collection=d.options.collection;let y=h.options.toJSON,E=h.options.toObject,w=h.options._id,b=h.options.id,A=Object.keys(h.options);h.options.discriminatorKey=d.options.discriminatorKey;let M=h._userProvidedOptions;for(let O of A)if(!Yz[O]){if(O in M&&!M1.deepEqual(h.options[O],d.options[O]))throw Error("Can't customize discriminator option "+O+" (can only modify "+Object.keys(Yz).join(", ")+")")}h.options=bEe(d.options);for(let O of Object.keys(M))h.options[O]=M[O];if(y)h.options.toJSON=y;if(E)h.options.toObject=E;if(typeof w<"u")h.options._id=w;if(h.options.id=b,o)h.s.hooks=t.schema.s.hooks.merge(h.s.hooks);if(i)h.plugins=Array.prototype.slice.call(d.plugins);h.callQueue=d.callQueue.concat(h.callQueue),delete h._requiredpaths}if(f(n,t.schema),!t.discriminators)t.discriminators={};if(!t.schema.discriminatorMapping)t.schema.discriminatorMapping={key:a,value:null,isRoot:!0};if(!t.schema.discriminators)t.schema.discriminators={};if(t.schema.discriminators[r]=n,MEe(t.discriminators,r)&&!n.options.overwriteModels&&!u)throw Error('Discriminator with name "'+r+'" already exists');return n}});var s2=g(function(WMe,Qz){var BEe=qs(),FEe=_i();Qz.exports=function(t,r,n){let s=t.schema.options.discriminatorKey,i=r?.[s];if(i==null)i=n;if(t.discriminators&&i!=null){let o=BEe(t.discriminators,i);if(o)t=o;else{let u=FEe(t.discriminators,i);if(u)t=u}}return t}});var i4=g(function(HMe,Xz){var NEe=_A();Xz.exports=function(t,r){if(r?._id==null)return t;if(t=t.clone(),!r._id)t.remove("_id"),t.options._id=!1;else if(!t.paths._id)NEe(t),t.options._id=!0;return t}});var u4=g(function(KMe,Zz){/*!
590
- * Module dependencies.
591
- */var IEe=Le();class o4 extends IEe{constructor(e,t){let r=`Cannot create use schema for property "${e}" because the schema has the ${t} option enabled.`;super(r)}}Object.defineProperty(o4.prototype,"name",{value:"InvalidSchemaOptionError"});/*!
592
- * exports
593
- */Zz.exports=o4});var l4=g(function(GMe,nW){/*!
594
- * Module dependencies.
595
- */var eW=kn(),a4=G("events").EventEmitter,REe=jm(),$Ee=Bz(),Ss=Er(),vEe=Vm(),kEe=Im(),tW=Of().castToNumber,qEe=n2(),x1=jA(),c4=s2(),jEe=Sy(),LEe=i4(),UEe=ji().internalToObjectOptions,VEe=Ja(),o2=Oe(),zEe=u4(),WEe=yi(),i2;nW.exports=Wr;function Wr(e,t,r,n){if(e.options.timeseries)throw new zEe(t,"timeseries");let s=Wr.defaultOptions?._id;if(s!=null)r=r||{},r._id=s;e=LEe(e,r),this.Constructor=rW(e,null,r),this.Constructor.path=t,this.Constructor.prototype.$basePath=t,this.schema=e,this.$isSingleNested=!0,this.base=e.base,Ss.call(this,t,r,"Embedded",n)}/*!
596
- * ignore
597
- */Wr.prototype=Object.create(Ss.prototype);Wr.prototype.constructor=Wr;Wr.prototype.OptionsConstructor=$Ee;/*!
598
- * ignore
599
- */function rW(e,t,r){i2||(i2=Zm());let n=function(o,u,a){if(this.$__parent=a,i2.apply(this,arguments),a==null)return;this.$session(a.$session())};e.plugin(jEe,{deduplicate:!0});let s=t?.prototype??i2.prototype;n.prototype=Object.create(s),n.prototype.$__setSchema(e),n.prototype.constructor=n,n.prototype.$__schemaTypeOptions=r,n.$__required=r?.required,n.base=e.base,n.schema=e,n.$isSingleNested=!0,n.events=new a4,n.prototype.toBSON=function(){return this.toObject(UEe)};for(let i in e.methods)n.prototype[i]=e.methods[i];for(let i in e.statics)n[i]=e.statics[i];for(let i in a4.prototype)n[i]=a4.prototype[i];return n}/*!
600
- * ignore
601
- */var To={...Ss.prototype.$conditionalHandlers};To.$geoWithin=function(t,r){return{$geometry:this.castForQuery(null,t.$geometry,r)}};/*!
602
- * ignore
603
- */To.$near=To.$nearSphere=x1.cast$near;To.$within=To.$geoWithin=x1.cast$within;To.$geoIntersects=x1.cast$geoIntersects;To.$minDistance=tW;To.$maxDistance=tW;To.$exists=kEe;Object.defineProperty(Wr.prototype,"$conditionalHandlers",{enumerable:!1,value:To});Wr.prototype.cast=function(e,t,r,n,s){if(e?.$isSingleNested&&e.parent===t)return e;if(!r&&e!=null&&(typeof e!=="object"||Array.isArray(e)))throw new REe(this.path,e);let i=this.schema.path(this.schema.options.discriminatorKey),o=i==null?null:i.getDefault(t),u=c4(this.Constructor,e,o),a,c=t?.$__?.selected,l=this.path,f=c==null?null:Object.keys(c).reduce((h,d)=>{if(d.startsWith(l+"."))h=h||{},h[d.substring(l.length+1)]=c[d];return h},null);if(r){if(a=new u(void 0,f,t,{defaults:!1}),delete a.$__.defaults,s.path!=null){let{path:d,...p}=s;s=p}a.$init(e,s);let h=VEe(f);vEe(a,f,h)}else{if(s=Object.assign({},s,{priorDoc:n}),o2.hasOwnKeys(e)===!1)return new u({},f,t,s);return new u(e,f,t,s)}return a};Wr.prototype.castForQuery=function(e,t,r,n){let s;if(e!=null){if(s=WEe(this.$conditionalHandlers,e),!s)throw Error("Can't use "+e);return s.call(this,t)}if(t==null)return t;let i=c4(this.Constructor,t);if(t instanceof i)return t;if(this.options.runSetters)t=this._applySetters(t,r);let o=n?.strict??void 0;try{t=new i(t,o)}catch(u){if(!(u instanceof eW))throw new eW("Embedded",t,this.path,u,this);throw u}return t};Wr.prototype.doValidate=async function(t,r,n){let s=c4(this.Constructor,t);if(t&&!(t instanceof s))t=new s(t,null,r?.$__!=null?r:null);if(n?.skipSchemaValidators){if(!t)return;return t.validate()}if(await Ss.prototype.doValidate.call(this,t,r,n),t!=null)await t.validate()};Wr.prototype.doValidateSync=function(e,t,r){if(!r?.skipSchemaValidators){let n=Ss.prototype.doValidateSync.call(this,e,t);if(n)return n}if(!e)return;return e.$__validateSync()};Wr.prototype.discriminator=function(e,t,r){r=r||{};let n=o2.isPOJO(r)?r.value:r,s=typeof r.clone==="boolean"?r.clone:!0;if(t.instanceOfSchema&&s)t=t.clone();if(t=qEe(this.Constructor,e,t,n,null,null,r.overwriteExisting),this.parentSchema!=null)this.parentSchema._hasSelectedPaths=!0;return this.Constructor.discriminators[e]=rW(t,this.Constructor),this.Constructor.discriminators[e]};/*!
604
- * ignore
605
- */Wr.defaultOptions={};Wr.set=Ss.set;Wr.setters=[];Wr.get=Ss.get;/*!
606
- * ignore
607
- */Wr.prototype.toJSON=function(){return{path:this.path,options:this.options}};/*!
608
- * ignore
609
- */Wr.prototype.clone=function(){let e=new this.constructor(this.schema,this.path,{...this.options,_skipApplyDiscriminators:!0},this.parentSchema);if(e.validators=this.validators.slice(),this.requiredValidator!==void 0)e.requiredValidator=this.requiredValidator;return e.Constructor.discriminators=Object.assign({},this.Constructor.discriminators),e._appliedDiscriminators=this._appliedDiscriminators,e};Wr.prototype.toJSONSchema=function(t){return{...this.schema.toJSONSchema(t),...this._createJSONSchemaTypeDefinition("object","object",t)}}});var h4=g(function(YMe,iW){/*!
610
- * Module dependencies.
611
- */var HEe=Le(),wi=Er(),u2=l4(),sW=s2();function Si(e,t,r,n){if(this.$parentSchemaType=r?.$parentSchemaType,!this.$parentSchemaType)throw new HEe("Cannot create DocumentArrayElement schematype without a parent");delete r.$parentSchemaType,wi.call(this,e,r,"DocumentArrayElement",n),this.$isMongooseDocumentArrayElement=!0,this.Constructor=r?.Constructor,this.schema=t}Si.schemaName="DocumentArrayElement";Si.defaultOptions={};Si.set=wi.set;Si.get=wi.get;/*!
612
- * Inherits from SchemaType.
613
- */Si.prototype=Object.create(wi.prototype);Si.prototype.constructor=Si;Si.prototype.cast=function(...e){return this.$parentSchemaType.cast(...e)[0]};Si.prototype.doValidate=async function(t,r,n){let s=sW(this.Constructor,t);if(t&&!(t instanceof s))t=new s(t,r,null,null,n?.index??null);if(n?.skipSubdocumentValidation){if(n.skipSchemaValidators)return;return wi.prototype.doValidate.call(this,t,r,n)}return u2.prototype.doValidate.call(this,t,r,n)};Si.prototype.doValidateSync=function(t,r,n){let s=sW(this.Constructor,t);if(t&&!(t instanceof s))t=new s(t,r,null,null,n?.index??null);if(n?.skipSubdocumentValidation){if(n.skipSchemaValidators)return;return wi.prototype.doValidateSync.call(this,t,r,n)}return u2.prototype.doValidateSync.call(this,t,r,n)};Si.prototype.clone=function(){let e=Object.assign({},this.options,{$parentSchemaType:this.$parentSchemaType,Constructor:this.Constructor}),t=new this.constructor(this.path,this.schema,e,this.parentSchema);if(t.validators=this.validators.slice(),this.requiredValidator!==void 0)t.requiredValidator=this.requiredValidator;return t};/*!
614
- * Module exports.
615
- */iW.exports=Si});var uW=g(function(JMe,oW){var KEe=As();class Df extends KEe{}var f4=vs();Object.defineProperty(Df.prototype,"excludeIndexes",f4);Object.defineProperty(Df.prototype,"_id",f4);Object.defineProperty(Df.prototype,"discriminators",f4);/*!
616
- * ignore
617
- */oW.exports=Df});var yW=g(function(QMe,mW){/*!
618
- * Module dependencies.
619
- */var GEe=qs(),aW=kn(),YEe=h4(),d4=G("events").EventEmitter,P1=ky(),JEe=uW(),Mo=Er(),cW=nc(),QEe=n2(),lW=i4(),XEe=Ym(),ZEe=O1(),Vn=Oe(),a2=s2(),e6e=Sy(),t6e=u4(),hW=le().arrayAtomicsSymbol,p4=le().arrayPathSymbol,dW=le().documentArrayParent,nu,oc;function or(e,t,r,n,s){if(t.options?.timeseries)throw new t6e(e,"timeseries");let i=or.defaultOptions?._id;if(i!=null)n=n||{},n._id=i;if(n?._id!=null)t=lW(t,n);else if(r?._id!=null)t=lW(t,r);let o=pW(t,r);o.prototype.$basePath=e,o.path=e;let u=this,a=new YEe(e+".$",t,{...n||{},$parentSchemaType:u,Constructor:o});P1.call(this,e,a,r,null,s),this.schema=t,this.schemaOptions=n||{},this.$isMongooseDocumentArray=!0,this.Constructor=o,o.base=t.base;let c=this.defaultValue;if(!("defaultValue"in this)||c!=null)this.default(function(){let l=c.call(this);if(l!=null&&!Array.isArray(l))l=[l];return l})}or.schemaName="DocumentArray";or.options={castNonArrays:!0};/*!
620
- * Inherits from SchemaArray.
621
- */or.prototype=Object.create(P1.prototype);or.prototype.constructor=or;or.prototype.OptionsConstructor=JEe;Object.defineProperty(or.prototype,"$conditionalHandlers",{enumerable:!1,value:{...P1.prototype.$conditionalHandlers}});/*!
622
- * ignore
623
- */function pW(e,t,r){oc||(oc=d1());function n(){oc.apply(this,arguments);let i=this[dW];if(i==null)return;this.$session(i.$session())}e.plugin(e6e,{deduplicate:!0});let s=r?.prototype??oc.prototype;n.prototype=Object.create(s),n.prototype.$__setSchema(e),n.schema=e,n.prototype.constructor=n,n.$isArraySubdocument=!0,n.events=new d4,n.base=e.base;for(let i in e.methods)n.prototype[i]=e.methods[i];for(let i in e.statics)n[i]=e.statics[i];for(let i in d4.prototype)n[i]=d4.prototype[i];return n.options=t,n}or.prototype.discriminator=function(e,t,r){if(typeof e==="function")e=Vn.getFunctionName(e);r=r||{};let n=Vn.isPOJO(r)?r.value:r,s=typeof r.clone==="boolean"?r.clone:!0;if(t.instanceOfSchema&&s)t=t.clone();if(t=QEe(this.Constructor,e,t,n,null,null,r?.overwriteExisting),this.parentSchema!=null)this.parentSchema._hasSelectedPaths=!0;let i=pW(t,null,this.Constructor);return i.baseCasterConstructor=this.Constructor,Object.defineProperty(i,"name",{value:e}),this.Constructor.discriminators[e]=i,this.Constructor.discriminators[e]};or.prototype.doValidate=async function(t,r,n){nu||(nu=Za());let s;try{await Mo.prototype.doValidate.call(this,t,r)}catch(u){s=u}if(n?.updateValidator){if(s!=null)throw s;return}if(!Vn.isMongooseDocumentArray(t))t=new nu(t,this.path,r);let i=[];for(let u=0;u<t.length;++u){let a=t[u];if(a==null)continue;if(!(a instanceof oc)){let l=a2(this.Constructor,t[u]);a=t[u]=new l(a,t,void 0,void 0,u)}if(n?.validateModifiedOnly&&!a.$isNew&&!a.$isModified())continue;let c=a.$isNew&&n?.validateModifiedOnly?{...n,validateModifiedOnly:!1}:n;i.push(a.validate(null,c))}let o;try{await Promise.all(i)}catch(u){o=u}if(s!=null)throw s;if(o!=null)throw o};or.prototype.doValidateSync=function(e,t,r){let n=Mo.prototype.doValidateSync.call(this,e,t),s=e?.length,i=n;if(!s)return i;for(let o=0,u=s;o<u;++o){let a=e[o];if(!a)continue;if(!(a instanceof oc)){let f=a2(this.Constructor,e[o]);a=e[o]=new f(a,e,void 0,void 0,o)}if(r?.validateModifiedOnly&&!a.$isNew&&!a.$isModified())continue;let c=a.$isNew&&r?.validateModifiedOnly?{...r,validateModifiedOnly:!1}:r,l=a.$__validateSync(c);if(l&&i==null)i=l}return i};/*!
624
- * ignore
625
- */or.prototype.getDefault=function(e,t,r){let n=typeof this.defaultValue==="function"?this.defaultValue.call(e):this.defaultValue;if(n==null)return n;if(r?.skipCast)return n;if(nu||(nu=Za()),!Array.isArray(n))n=[n];n=new nu(n,this.path,e);for(let s=0;s<n.length;++s){let o=new(a2(this.Constructor,n[s]))({},n,void 0,void 0,s);o.$init(n[s]),o.isNew=!0,Object.assign(o.$__.activePaths.default,o.$__.activePaths.init),o.$__.activePaths.init={},n[s]=o}return n};var r6e=Object.freeze({transform:!1,virtuals:!1}),fW=Object.freeze({skipId:!1,willInit:!0});or.prototype.cast=function(e,t,r,n,s){if(nu||(nu=Za()),e?.[p4]!=null&&e===n)return e;let i,o;s=s||{};let u=s.path||this.path;if(!Array.isArray(e)){let l=this.options.castNonArrays??or.options.castNonArrays;if(!r&&!l)throw new aW("DocumentArray",e,this.path,null,this);if(!!t&&r)t.markModified(u);return this.cast([e],t,r,n,s)}if(!s.skipDocumentArrayCast||Vn.isMongooseDocumentArray(e))e=new nu(e,u,t,this);if(n!=null)e[hW]=n[hW]||{};if(s.arrayPathIndex!=null)e[p4]=u+"."+s.arrayPathIndex;let a=Vn.isMongooseDocumentArray(e)?e.__array:e,c=a.length;for(let l=0;l<c;++l){if(!a[l])continue;let f=a2(this.Constructor,a[l]),h=XEe(a[l],!0);if(a[l]!==h)a[l]=h;if(a[l]instanceof oc){if(a[l][dW]!==t||a[l].__index!=null&&a[l].__index!==l)if(r){let d=new f(null,e,fW,i,l);a[l]=d.$init(a[l])}else{let d=new f(a[l],e,void 0,void 0,l);a[l]=d}if(a[l].__index==null)a[l].$setIndex(l)}else if(a[l]!=null)if(r){if(t)i||(i=n6e(this,t.$__.selected,r));else i=!0;if(o=new f(null,e,fW,i,l),s.path!=null||s.arrayPathIndex!=null){let{path:d,arrayPathIndex:p,...m}=s;s=m}a[l]=o.$init(a[l],s)}else if(o=n?.[l],o?._doc!=null&&a[l]._id!=null&&Vn.deepEqual(a[l]._id,o._doc._id)&&Vn.deepEqual(o.toObject(r6e),a[l]))a[l]=o;else try{o=new f(a[l],e,void 0,void 0,l),a[l]=o}catch(d){throw new aW("embedded",a[l],e[p4],d,this)}}if(Vn.isMongooseDocumentArray(n)){for(let l=0;l<c;++l)if(a[l]!=null&&a[l]===n[l])a[l].__parentArray=e}return e};/*!
626
- * ignore
627
- */or.prototype.clone=function(){let e=Object.assign({},this.options),t=new this.constructor(this.path,this.schema,e,this.schemaOptions,this.parentSchema);if(t.validators=this.validators.slice(),this.requiredValidator!==void 0)t.requiredValidator=this.requiredValidator;return t.Constructor.discriminators=Object.assign({},this.Constructor.discriminators),t._appliedDiscriminators=this._appliedDiscriminators,t};/*!
628
- * ignore
629
- */or.prototype.applyGetters=function(e,t){return Mo.prototype.applyGetters.call(this,e,t)};function n6e(e,t,r){if(!(r&&t))return;let n=e.path+".",s=Object.keys(t),i=s.length,o={},u,a,c;while(i--)if(a=s[i],a.startsWith(n)){if(c=a.substring(n.length),c==="$")continue;if(c.startsWith("$."))c=c.substring(2);u||(u=!0),o[c]=t[a]}return u&&o||void 0}/*!
630
- * ignore
631
- */or.defaultOptions={};or.set=Mo.set;or.setters=[];or.get=Mo.get;/*!
632
- * Handle casting $elemMatch operators
633
- */or.prototype.$conditionalHandlers.$elemMatch=s6e;function s6e(e,t){let r=Object.keys(e),n=r.length;for(let a=0;a<n;++a){let c=r[a],l=e[c];if(ZEe(c)&&l!=null)e[c]=this.castForQuery(c,l,t)}let s=this?.Constructor?.schema?.options?.discriminatorKey,i=this?.Constructor?.schema?.discriminators||{},o=s!=null&&e[s]!=null?GEe(i,e[s]):null;if(o!=null)return cW(o,e,null,this?.$$context);let u=this.Constructor.schema??t.schema;return cW(u,e,null,this?.$$context)}or.prototype.toJSONSchema=function(t){let r=this._createJSONSchemaTypeDefinition("object","object",{...t,_overrideRequired:!1});return{...this._createJSONSchemaTypeDefinition("array","array",t),items:{...r,...this.schema.toJSONSchema(t)}}};/*!
634
- * Module exports.
635
- */mW.exports=or});var _W=g(function(XMe,gW){var B1=G("assert"),F1=we(),i6e=vn();gW.exports=function(t){if(t==null||t==="")return null;let r;if(i6e(t,"Long"))r=t.toNumber();else if(typeof t==="string")try{return r=F1.Double.fromString(t),r}catch{B1.ok(!1)}else if(typeof t==="object"){if(Array.isArray(t))B1.ok(!1);let n=t.valueOf()??t.toString();if(typeof n==="string")try{return r=F1.Double.fromString(n),r}catch{B1.ok(!1)}else r=Number(n)}else r=Number(t);return new F1.Double(r)}});var AW=g(function(ZMe,EW){/*!
636
- * Module dependencies.
637
- */var o6e=kn(),Ci=Er(),u6e=_W();function jr(e,t,r,n){Ci.call(this,e,t,"Double",n)}jr.schemaName="Double";jr.defaultOptions={};/*!
638
- * Inherits from SchemaType.
639
- */jr.prototype=Object.create(Ci.prototype);jr.prototype.constructor=jr;/*!
640
- * ignore
641
- */jr._cast=u6e;jr.set=Ci.set;jr.setters=[];jr.get=Ci.get;/*!
642
- * ignore
643
- */jr._defaultCaster=(e)=>{if(e!=null){if(e._bsontype!=="Double")throw Error()}return e};jr.cast=function(t){if(arguments.length===0)return this._cast;if(t===!1)t=this._defaultCaster;return this._cast=t,this._cast};/*!
644
- * ignore
645
- */jr._checkRequired=(e)=>e!=null;jr.checkRequired=Ci.checkRequired;jr.prototype.checkRequired=function(e){return this.constructor._checkRequired(e)};jr.prototype.cast=function(e){let t;if(typeof this._castFunction==="function")t=this._castFunction;else if(typeof this.constructor.cast==="function")t=this.constructor.cast();else t=jr.cast();try{return t(e)}catch(r){throw new o6e("Double",e,this.path,r,this)}};/*!
646
- * ignore
647
- */function c2(e){return this.cast(e)}var a6e={...Ci.prototype.$conditionalHandlers,$gt:c2,$gte:c2,$lt:c2,$lte:c2};Object.defineProperty(jr.prototype,"$conditionalHandlers",{enumerable:!1,value:a6e});jr.prototype.toJSONSchema=function(t){return this._createJSONSchemaTypeDefinition("number","double",t)};jr.prototype.autoEncryptionType=function(){return"double"};/*!
648
- * Module exports.
649
- */EW.exports=jr});var SW=g(function(exe,OW){var c6e=vn(),l2=G("assert");OW.exports=function(t){if(t==null)return t;if(t==="")return null;if(Array.isArray(t))l2.ok(!1);let r=c6e(t,"Long")?t.toNumber():Number(t),n=2147483647,s=-2147483648;if(r===(r|0)&&r>=s&&r<=n)return r;l2.ok(!1)}});var bW=g(function(txe,CW){/*!
650
- * Module dependencies.
651
- */var wW=kn(),bi=Er(),l6e=SW(),h2=Af(),h6e=yi();function Dr(e,t,r,n){bi.call(this,e,t,"Int32",n)}Dr.schemaName="Int32";Dr.defaultOptions={};/*!
652
- * Inherits from SchemaType.
653
- */Dr.prototype=Object.create(bi.prototype);Dr.prototype.constructor=Dr;/*!
654
- * ignore
655
- */Dr._cast=l6e;Dr.set=bi.set;Dr.setters=[];Dr.get=bi.get;/*!
656
- * ignore
657
- */Dr._defaultCaster=(e)=>{if(e!=null){if(typeof e!=="number"||e!==(e|0)||e<-2147483648||e>2147483647)throw Error()}return e};Dr.cast=function(t){if(arguments.length===0)return this._cast;if(t===!1)t=this._defaultCaster;return this._cast=t,this._cast};/*!
658
- * ignore
659
- */Dr._checkRequired=(e)=>e!=null;Dr.checkRequired=bi.checkRequired;Dr.prototype.checkRequired=function(e){return this.constructor._checkRequired(e)};Dr.prototype.cast=function(e){let t;if(typeof this._castFunction==="function")t=this._castFunction;else if(typeof this.constructor.cast==="function")t=this.constructor.cast();else t=Dr.cast();try{return t(e)}catch(r){throw new wW("Int32",e,this.path,r,this)}};/*!
660
- * ignore
661
- */var f6e={...bi.prototype.$conditionalHandlers,$gt:f2,$gte:f2,$lt:f2,$lte:f2,$bitsAllClear:h2,$bitsAnyClear:h2,$bitsAllSet:h2,$bitsAnySet:h2};Object.defineProperty(Dr.prototype,"$conditionalHandlers",{enumerable:!1,value:f6e});/*!
662
- * ignore
663
- */function f2(e,t){return this.castForQuery(null,e,t)}Dr.prototype.castForQuery=function(e,t,r){let n;if(e!=null){if(n=h6e(this.$conditionalHandlers,e),n)return n.call(this,t);return this.applySetters(t,r)}try{return this.applySetters(t,r)}catch(s){if(s instanceof wW&&s.path===this.path&&this.$fullPath!=null)s.path=this.$fullPath;throw s}};Dr.prototype.toJSONSchema=function(t){return this._createJSONSchemaTypeDefinition("number","int",t)};Dr.prototype.autoEncryptionType=function(){return"int"};/*!
664
- * Module exports.
665
- */CW.exports=Dr});var TW=g(function(rxe,DW){var d6e=As();class m4 extends d6e{}var p6e=vs();Object.defineProperty(m4.prototype,"of",p6e);DW.exports=m4});var xW=g(function(nxe,MW){/*!
666
- * ignore
667
- */var y4=By(),m6e=TW(),g4=Er(),y6e=Le(),g6e=ec(),Di=Oe();class uc extends g4{constructor(e,t,r,n){super(e,t,"Map",n);this.$isSchemaMap=!0,this._createNestedSchemaType(n,e,t,r)}cast(e,t,r,n,s){if(e instanceof y4)return e;let i=s?.path??this.path;if(r){let o=new y4({},i,t,this.$__schemaType);if(e instanceof global.Map)for(let u of e.keys()){let a=e.get(u);if(a==null)a=o.$__schemaType._castNullish(a);else a=o.$__schemaType.cast(a,t,!0,null,{...s,path:i+"."+u});o.$init(u,a)}else for(let u of Object.keys(e)){let a=e[u];if(a==null)a=o.$__schemaType._castNullish(a);else a=o.$__schemaType.cast(a,t,!0,null,{...s,path:i+"."+u});o.$init(u,a)}return o}return new y4(e,i,t,this.$__schemaType)}clone(){let e=super.clone();if(this.$__schemaType!=null)e.$__schemaType=this.$__schemaType.clone();return e}getEmbeddedSchemaType(){return this.$__schemaType}toJSONSchema(e){let t=this.getEmbeddedSchemaType(),r=this._createJSONSchemaTypeDefinition("object","object",e);return r.additionalProperties=t.toJSONSchema(e),r}autoEncryptionType(){return"object"}}uc.set=g4.set;uc.schemaName="Map";uc.prototype.OptionsConstructor=m6e;uc.defaultOptions={};/*!
668
- * ignore
669
- */uc.prototype._createNestedSchemaType=function(t,r,n,s){let i=r+".$*",o={type:{}};if(Di.hasUserDefinedProperty(n,"of")){if(Di.isPOJO(n.of)&&Di.hasOwnKeys(n.of)&&!Di.hasUserDefinedProperty(n.of,t.options.typeKey))o={[t.options.typeKey]:new g6e(n.of)};else if(Di.isPOJO(n.of))o=Object.assign({},n.of);else o={[t.options.typeKey]:n.of};if(o[t.options.typeKey]&&o[t.options.typeKey].instanceOfSchema)o[t.options.typeKey].eachPath((c,l)=>{if(l.options.select===!0||l.options.select===!1)throw new y6e('Cannot use schema-level projections (`select: true` or `select: false`) within maps at path "'+r+"."+c+'"')});if(Di.hasUserDefinedProperty(n,"ref"))o.ref=n.ref}this.$__schemaType=t.interpretAsType(i,o,s)};MW.exports=uc});var FW=g(function(sxe,BW){var _6e=As();class d2 extends _6e{}var PW=vs();Object.defineProperty(d2.prototype,"auto",PW);Object.defineProperty(d2.prototype,"populate",PW);/*!
670
- * ignore
671
- */BW.exports=d2});var RW=g(function(ixe,IW){var NW=vn(),_4=ca();IW.exports=function(t){if(t==null)return t;if(NW(t,"ObjectId"))return t;if(t._id){if(NW(t._id,"ObjectId"))return t._id;if(t._id.toString instanceof Function)return new _4(t._id.toString())}if(t.toString instanceof Function)return new _4(t.toString());return new _4(t)}});var kW=g(function(oxe,vW){/*!
672
- * Module dependencies.
673
- */var E6e=FW(),ln=Er(),A6e=RW(),O6e=$n(),A4=ca(),O4=vn(),m2=Oe(),S6e=ln.CastError,E4;function ur(e,t,r,n){let s=typeof e==="string"&&e.length===24&&/^[a-f0-9]+$/i.test(e),i=t?.suppressWarning;if((s||typeof e>"u")&&!i)m2.warn("mongoose: To create a new ObjectId please try `Mongoose.Types.ObjectId` instead of using `Mongoose.Schema.Types.ObjectId`. Set the `suppressWarning` option if you're trying to create a hex char path in your schema.");ln.call(this,e,t,"ObjectId",n)}ur.schemaName="ObjectId";ur.defaultOptions={};/*!
674
- * Inherits from SchemaType.
675
- */ur.prototype=Object.create(ln.prototype);ur.prototype.constructor=ur;ur.prototype.OptionsConstructor=E6e;ur.get=ln.get;ur.set=ln.set;ur.setters=[];ur.prototype.auto=function(e){if(e)this.default($W),this.set(C6e);return this};/*!
676
- * ignore
677
- */ur._checkRequired=(e)=>O4(e,"ObjectId");/*!
678
- * ignore
679
- */ur._cast=A6e;ur.cast=function(t){if(arguments.length===0)return this._cast;if(t===!1)t=this._defaultCaster;return this._cast=t,this._cast};/*!
680
- * ignore
681
- */ur._defaultCaster=(e)=>{if(!O4(e,"ObjectId"))throw Error(e+" is not an instance of ObjectId");return e};ur.checkRequired=ln.checkRequired;ur.prototype.checkRequired=function(t,r){if(ln._isRef(this,t,r,!0))return!!t;return(typeof this.constructor.checkRequired==="function"?this.constructor.checkRequired():ur.checkRequired())(t)};ur.prototype.cast=function(e,t,r,n,s){if(!O4(e,"ObjectId")&&ln._isRef(this,e,t,r)){if((O6e(e)||"").toLowerCase()==="objectid")return new A4(e.toHexString());if(e==null||m2.isNonBuiltinObject(e))return this._castRef(e,t,r,s)}let i;if(typeof this._castFunction==="function")i=this._castFunction;else if(typeof this.constructor.cast==="function")i=this.constructor.cast();else i=ur.cast();try{return i(e)}catch(o){throw new S6e("ObjectId",e,this.path,o,this)}};/*!
682
- * ignore
683
- */function p2(e){return this.cast(e)}var w6e={...ln.prototype.$conditionalHandlers,$gt:p2,$gte:p2,$lt:p2,$lte:p2};Object.defineProperty(ur.prototype,"$conditionalHandlers",{enumerable:!1,value:w6e});/*!
684
- * ignore
685
- */function $W(){return new A4}$W.$runBeforeSetters=!0;function C6e(e){if(E4||(E4=wo()),this instanceof E4){if(e===void 0)return new A4}return e}ur.prototype.toJSONSchema=function(t){let r=this._createJSONSchemaTypeDefinition("string","objectId",t);if(!t?.useBsonType)r.pattern="^[A-Fa-f0-9]{24}$";return r};ur.prototype.autoEncryptionType=function(){return"objectId"};/*!
686
- * Module exports.
687
- */vW.exports=ur});var jW=g(function(uxe,qW){var b6e=As();class Ti extends b6e{}var xo=vs();Object.defineProperty(Ti.prototype,"enum",xo);Object.defineProperty(Ti.prototype,"match",xo);Object.defineProperty(Ti.prototype,"lowercase",xo);Object.defineProperty(Ti.prototype,"trim",xo);Object.defineProperty(Ti.prototype,"uppercase",xo);Object.defineProperty(Ti.prototype,"minLength",xo);Object.defineProperty(Ti.prototype,"minlength",xo);Object.defineProperty(Ti.prototype,"maxLength",xo);Object.defineProperty(Ti.prototype,"maxlength",xo);Object.defineProperty(Ti.prototype,"populate",xo);/*!
688
- * ignore
689
- */qW.exports=Ti});var S4=g(function(axe,VW){/*!
690
- * Module dependencies.
691
- */var hn=Er(),ws=$s(),D6e=jW(),T6e=Ny(),y2=Oe(),M6e=vn(),x6e=yi(),UW=hn.CastError;function at(e,t,r,n){this.enumValues=[],this.regExp=null,hn.call(this,e,t,"String",n)}at.schemaName="String";at.defaultOptions={};/*!
692
- * Inherits from SchemaType.
693
- */at.prototype=Object.create(hn.prototype);at.prototype.constructor=at;Object.defineProperty(at.prototype,"OptionsConstructor",{configurable:!1,enumerable:!1,writable:!1,value:D6e});/*!
694
- * ignore
695
- */at._cast=T6e;at.cast=function(t){if(arguments.length===0)return this._cast;if(t===!1)t=this._defaultCaster;return this._cast=t,this._cast};/*!
696
- * ignore
697
- */at._defaultCaster=(e)=>{if(e!=null&&typeof e!=="string")throw Error();return e};at.get=hn.get;at.set=hn.set;at.setters=[];/*!
698
- * ignore
699
- */at._checkRequired=(e)=>(e instanceof String||typeof e==="string")&&e.length;at.checkRequired=hn.checkRequired;at.prototype.enum=function(){if(this.enumValidator)this.validators=this.validators.filter(function(n){return n.validator!==this.enumValidator},this),this.enumValidator=!1;if(arguments[0]==null||arguments[0]===!1)return this.enumValues=[],delete this.options.enum,this;let e,t;if(y2.isObject(arguments[0]))if(Array.isArray(arguments[0].values))e=arguments[0].values,t=arguments[0].message;else e=y2.object.vals(arguments[0]),t=ws.messages.String.enum;else e=arguments,t=ws.messages.String.enum;for(let n of e)if(n!==void 0)this.enumValues.push(this.cast(n));let r=this.enumValues;return this.enumValidator=function(n){return n==null||~r.indexOf(n)},this.validators.push({validator:this.enumValidator,message:t,type:"enum",enumValues:r}),this};at.prototype.lowercase=function(e){if(arguments.length>0&&!e)return this;return this.set((t)=>{if(typeof t!=="string")t=this.cast(t);if(t)return t.toLowerCase();return t})};at.prototype.uppercase=function(e){if(arguments.length>0&&!e)return this;return this.set((t)=>{if(typeof t!=="string")t=this.cast(t);if(t)return t.toUpperCase();return t})};at.prototype.trim=function(e){if(arguments.length>0&&!e)return this;return this.set((t)=>{if(typeof t!=="string")t=this.cast(t);if(t)return t.trim();return t})};at.prototype.minlength=function(e,t){if(this.minlengthValidator)this.validators=this.validators.filter(function(r){return r.validator!==this.minlengthValidator},this);if(e!=null){let r=t||ws.messages.String.minlength;if(typeof r==="string")r=r.replace(/{MINLENGTH}/,e);this.validators.push({validator:this.minlengthValidator=function(n){return n===null||n.length>=e},message:r,type:"minlength",minlength:e})}return this};at.prototype.minLength=at.prototype.minlength;at.prototype.maxlength=function(e,t){if(this.maxlengthValidator)this.validators=this.validators.filter(function(r){return r.validator!==this.maxlengthValidator},this);if(e!=null){let r=t||ws.messages.String.maxlength;if(typeof r!=="function")r=r.replace(/{MAXLENGTH}/,e);this.validators.push({validator:this.maxlengthValidator=function(n){return n===null||n.length<=e},message:F6e(r),type:"maxlength",maxlength:e})}return this};at.prototype.maxLength=at.prototype.maxlength;at.prototype.match=function(t,r){let n=r||ws.messages.String.match,s=function(i){if(!t)return!1;return t.lastIndex=0,i!=null&&i!==""?t.test(i):!0};return this.validators.push({validator:s,message:n,type:"regexp",regexp:t}),this};at.prototype.checkRequired=function(t,r){if(typeof t==="object"&&hn._isRef(this,t,r,!0))return t!=null;return(typeof this.constructor.checkRequired==="function"?this.constructor.checkRequired():at.checkRequired())(t)};at.prototype.cast=function(e,t,r,n,s){if(typeof e!=="string"&&hn._isRef(this,e,t,r))return this._castRef(e,t,r,s);let i;if(typeof this._castFunction==="function")i=this._castFunction;else if(typeof this.constructor.cast==="function")i=this.constructor.cast();else i=at.cast();try{return i(e)}catch{throw new UW("string",e,this.path,null,this)}};/*!
700
- * ignore
701
- */function Tf(e,t){return this.castForQuery(null,e,t)}/*!
702
- * ignore
703
- */function P6e(e,t){let r=this;if(!Array.isArray(e))return[this.castForQuery(null,e,t)];return e.map(function(n){return r.castForQuery(null,n,t)})}/*!
704
- * ignore
705
- */function LW(e){if(e==null)return this._castNullish(e);return this.cast(e,this)}var B6e={...hn.prototype.$conditionalHandlers,$all:P6e,$gt:Tf,$gte:Tf,$lt:Tf,$lte:Tf,$options:LW,$regex:function(t){if(Object.prototype.toString.call(t)==="[object RegExp]")return t;return LW.call(this,t)},$not:Tf};Object.defineProperty(at.prototype,"$conditionalHandlers",{enumerable:!1,value:B6e});at.prototype.castForQuery=function(e,t,r){let n;if(e!=null){if(n=x6e(this.$conditionalHandlers,e),!n)throw Error("Can't use "+e+" with String.");return n.call(this,t,r)}if(Object.prototype.toString.call(t)==="[object RegExp]"||M6e(t,"BSONRegExp"))return t;try{return this.applySetters(t,r)}catch(s){if(s instanceof UW&&s.path===this.path&&this.$fullPath!=null)s.path=this.$fullPath;throw s}};at.prototype.toJSONSchema=function(t){return this._addJSONSchemaEnum(this._createJSONSchemaTypeDefinition("string","string",t))};at.prototype.autoEncryptionType=function(){return"string"};/*!
706
- * Module exports.
707
- */VW.exports=at;function F6e(e){return function(t,r){if(typeof e==="function")return ws.ValidatorError.prototype.formatMessage(e,t,r);if(typeof e==="string"&&typeof t.value==="string"&&t.value.length>30)t=Object.assign({},t,{value:t.value.slice(0,30)+"..."});return ws.ValidatorError.prototype.formatMessage(e,t,r)}}});var zW=g(function(cxe,b4){var w4=we().UUID,C4=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i;b4.exports=function(t){if(t==null)return t;if(t instanceof w4)return t;if(typeof t==="string")if(C4.test(t))return new w4(t);else throw Error(`"${t}" is not a valid UUID string`);if(t.toString&&t.toString!==Object.prototype.toString){if(C4.test(t.toString()))return new w4(t.toString())}throw Error(`"${t}" cannot be casted to a UUID`)};b4.exports.UUID_FORMAT=C4});var GW=g(function(lxe,KW){/*!
708
- * Module dependencies.
709
- */var zn=Er(),WW=zn.CastError,T4=zW(),HW=Oe(),g2=Af(),N6e=yi(),I6e=T4.UUID_FORMAT;function R6e(e){let t;if(typeof e!=="string"&&e!=null)return t=e.toString("hex"),t.substring(0,8)+"-"+t.substring(8,12)+"-"+t.substring(12,16)+"-"+t.substring(16,20)+"-"+t.substring(20,32);return e}function Tr(e,t,r,n){zn.call(this,e,t,"UUID",n)}Tr.schemaName="UUID";Tr.defaultOptions={};/*!
710
- * Inherits from SchemaType.
711
- */Tr.prototype=Object.create(zn.prototype);Tr.prototype.constructor=Tr;/*!
712
- * ignore
713
- */Tr._cast=T4;Tr.get=zn.get;Tr.set=zn.set;Tr.setters=[];Tr.cast=function(t){if(arguments.length===0)return this._cast;if(t===!1)t=this._defaultCaster;return this._cast=t,this._cast};/*!
714
- * ignore
715
- */Tr._checkRequired=(e)=>e!=null;Tr.checkRequired=zn.checkRequired;Tr.prototype.checkRequired=function(t){if(Buffer.isBuffer(t))t=R6e(t);return t!=null&&I6e.test(t)};Tr.prototype.cast=function(e,t,r,n,s){if(HW.isNonBuiltinObject(e)&&zn._isRef(this,e,t,r))return this._castRef(e,t,r,s);let i;if(typeof this._castFunction==="function")i=this._castFunction;else if(typeof this.constructor.cast==="function")i=this.constructor.cast();else i=Tr.cast();try{return i(e)}catch(o){throw new WW(Tr.schemaName,e,this.path,o,this)}};/*!
716
- * ignore
717
- */function $6e(e){return this.cast(e)}/*!
718
- * ignore
719
- */function D4(e){return e.map((t)=>this.cast(t))}var v6e={...zn.prototype.$conditionalHandlers,$bitsAllClear:g2,$bitsAnyClear:g2,$bitsAllSet:g2,$bitsAnySet:g2,$all:D4,$in:D4,$ne:$6e,$nin:D4};Object.defineProperty(Tr.prototype,"$conditionalHandlers",{enumerable:!1,value:v6e});Tr.prototype.castForQuery=function(e,t,r){let n;if(e!=null){if(n=N6e(this.$conditionalHandlers,e),!n)throw Error("Can't use "+e+" with UUID.");return n.call(this,t,r)}try{return this.applySetters(t,r)}catch(s){if(s instanceof WW&&s.path===this.path&&this.$fullPath!=null)s.path=this.$fullPath;throw s}};Tr.prototype.toJSONSchema=function(t){return this._createJSONSchemaTypeDefinition("string","binData",t)};Tr.prototype.autoEncryptionType=function(){return"binData"};/*!
720
- * Module exports.
721
- */KW.exports=Tr});var JW=g(function(hxe,YW){var k6e=As();class M4 extends k6e{}var q6e=vs();Object.defineProperty(M4.prototype,"of",q6e);YW.exports=M4});var XW=g(function(fxe,QW){/*!
722
- * ignore
723
- */var j6e=JW(),L6e=Er(),N1=Symbol("firstValue");/*!
724
- * ignore
725
- */class Mf extends L6e{constructor(e,t,r,n){super(e,t,"Union",n);if(!Array.isArray(t?.of)||t.of.length===0)throw Error("Union schema type requires an array of types");this.schemaTypes=t.of.map((s)=>n.interpretAsType(e,s,r)),this.$isSchemaUnion=!0}cast(e,t,r,n,s){let i=N1,o;for(let u=0;u<this.schemaTypes.length;++u)try{let a=this.schemaTypes[u].cast(e,t,r,n,s);if(a===e)return a;if(i===N1)i=a}catch(a){o=a}if(i!==N1)return i;throw o}applySetters(e,t,r,n,s){e=this._applySetters(e,t,r,n,s);let i=N1,o;for(let u=0;u<this.schemaTypes.length;++u)try{let a=this.schemaTypes[u]._applySetters(e,t,r,n,s);if(a==null)a=this.schemaTypes[u]._castNullish(a);else a=this.schemaTypes[u].cast(a,t,r,n,s);if(a===e)return a;if(i===N1)i=a}catch(a){o=a}if(i!==N1)return i;throw o}async doValidate(e,t,r){if(r&&r.skipSchemaValidators){if(e!=null&&typeof e.validate==="function")return e.validate();return}if(await super.doValidate(e,t,r),e!=null&&typeof e.validate==="function")await e.validate()}doValidateSync(e,t,r){if(!r||!r.skipSchemaValidators){let n=super.doValidateSync(e,t,r);if(n)return n}if(e!=null&&typeof e.$__validateSync==="function")return e.$__validateSync()}clone(){let e=super.clone();return e.schemaTypes=this.schemaTypes.map((t)=>t.clone()),e}toJSONSchema(e){let t=this.options.required&&typeof this.options.required!=="function",r={...e,_overrideRequired:!0},n=this.schemaTypes.map((s)=>s.toJSONSchema(r));if(t)return{anyOf:n};return{anyOf:[e?.useBsonType?{bsonType:"null"}:{type:"null"},...n]}}}Mf.schemaName="Union";Mf.defaultOptions={};Mf.prototype.OptionsConstructor=j6e;QW.exports=Mf});var Ef=g(function(U6e){/*!
726
- * Module exports.
727
- */U6e.Array=ky();U6e.BigInt=cz();U6e.Boolean=fz();U6e.Buffer=yz();U6e.Date=Cz();U6e.Decimal128=U6e.Decimal=xz();U6e.DocumentArray=yW();U6e.DocumentArrayElement=h4();U6e.Double=AW();U6e.Int32=bW();U6e.Map=xW();U6e.Mixed=_1();U6e.Number=vA();U6e.ObjectId=kW();U6e.String=S4();U6e.Subdocument=l4();U6e.UUID=GW();U6e.Union=XW();U6e.Oid=U6e.ObjectId;U6e.Object=U6e.Mixed;U6e.Bool=U6e.Boolean;U6e.ObjectID=U6e.ObjectId});var ec=g(function(N4,pH){/*!
728
- * Module dependencies.
729
- */var a3e=G("events").EventEmitter,c3e=Ha(),_t=Le(),tH=Z6(),l3e=Yk(),B4=Er(),sH=As(),h3e=yA(),A2=Oy(),iH=_A(),On=Zt(),S2=gr(),f3e=$n(),d3e=IU(),O2=OA(),p3e=Sy(),rH=gn(),m3e=SA(),y3e=vm(),_a=ks(),g3e=qU(),_3e=QU(),I1=Ui(),ye=Oe(),E3e=eV(),A3e=/\.\d+(\.|$)/,Ea,O3e=df().queryMiddlewareFunctions,S3e=df().documentMiddlewareFunctions,oH=O3e.concat(S3e).reduce((e,t)=>e.add(t),new Set),P4=ye.isPOJO,uH=0,w3e=/^\d+$/;function Y(e,t){if(!(this instanceof Y))return new Y(e,t);if(this.obj=e,this.paths={},this.aliases={},this.subpaths={},this.virtuals={},this.singleNestedPaths={},this.nested={},this.inherits={},this.callQueue=[],this._indexes=[],this._searchIndexes=[],this.methods=t?.methods||{},this.methodOptions={},this.statics=t?.statics||{},this.tree={},this.query=t?.query||{},this.childSchemas=[],this.plugins=[],this.$id=++uH,this.mapPaths=[],this.encryptedFields={},this.s={hooks:new c3e},this.options=this.defaultOptions(t),Array.isArray(e))for(let s of e)this.add(s);else if(e)this.add(e);if(t?.virtuals){let s=t.virtuals,i=Object.keys(s);for(let o of i){let u=s[o].options?s[o].options:void 0,a=this.virtual(o,u);if(s[o].get)a.get(s[o].get);if(s[o].set)a.set(s[o].set)}}let r=e?._id&&ye.isObject(e._id);if(!this.paths._id&&this.options._id&&!r)iH(this);this.setupTimestamp(this.options.timestamps)}function aH(e,t){for(let r of Object.keys(t)){let n=null;if(t[r]!=null)n=t[r];else{let i=S2(e.paths[r],"options");if(i==null)continue;n=i.alias}if(!n)continue;let s=e.paths[r].path;if(Array.isArray(n)){for(let i of n){if(typeof i!=="string")throw new _t("Invalid value for alias option on "+s+", got "+i);e.aliases[i]=s,e.virtual(i).get(function(o){return function(){if(typeof this.get==="function")return this.get(o);return this[o]}}(s)).set(function(o){return function(u){return this.$set(o,u)}}(s))}continue}if(typeof n!=="string")throw new _t("Invalid value for alias option on "+s+", got "+n);e.aliases[n]=s,e.virtual(n).get(function(i){return function(){if(typeof this.get==="function")return this.get(i);return this[i]}}(s)).set(function(i){return function(o){return this.$set(i,o)}}(s))}}/*!
730
- * Inherit from EventEmitter.
731
- */Y.prototype=Object.create(a3e.prototype);Y.prototype.constructor=Y;Y.prototype.instanceOfSchema=!0;/*!
732
- * ignore
733
- */Object.defineProperty(Y.prototype,"$schemaType",{configurable:!1,enumerable:!1,writable:!0});Object.defineProperty(Y.prototype,"childSchemas",{configurable:!1,enumerable:!0,writable:!0});Object.defineProperty(Y.prototype,"virtuals",{configurable:!1,enumerable:!0,writable:!0});Y.prototype.obj;Y.prototype.paths;Y.prototype.tree;Y.create=function(t,r){return new Y(t,r)};Y.prototype.clone=function(){let e=this._clone();return e.on("init",(t)=>this.emit("init",t)),e};/*!
734
- * ignore
735
- */Y.prototype._clone=function(t){t=t||(this.base==null?Y:this.base.Schema);let r=new t({},this._userProvidedOptions);r.base=this.base,r.obj=this.obj,r.options=On(this.options),r.callQueue=this.callQueue.map(function(n){return n}),r.methods=On(this.methods),r.methodOptions=On(this.methodOptions),r.statics=On(this.statics),r.query=On(this.query),r.plugins=Array.prototype.slice.call(this.plugins),r._indexes=On(this._indexes),r._searchIndexes=On(this._searchIndexes),r.s.hooks=this.s.hooks.clone(),r.tree=On(this.tree),r.paths=Object.fromEntries(Object.entries(this.paths).map(([n,s])=>[n,s.clone()])),r.nested=On(this.nested),r.subpaths=On(this.subpaths),r.mapPaths=[];for(let[n,s]of Object.entries(r.paths)){let i=n+".$*";if(!s.$isSchemaMap||!Object.hasOwn(r.paths,i))continue;r.paths[i]=s.$__schemaType,r.mapPaths.push(r.paths[i])}for(let n of Object.values(r.paths))if(n.$isSingleNested){let s=n.path;for(let i of Object.keys(n.schema.paths))r.singleNestedPaths[s+"."+i]=n.schema.paths[i];for(let i of Object.keys(n.schema.singleNestedPaths))r.singleNestedPaths[s+"."+i]=n.schema.singleNestedPaths[i];for(let i of Object.keys(n.schema.subpaths))r.singleNestedPaths[s+"."+i]=n.schema.subpaths[i];for(let i of Object.keys(n.schema.nested))r.singleNestedPaths[s+"."+i]="nested"}if(r._gatherChildSchemas(),r.virtuals=On(this.virtuals),r.$globalPluginsApplied=this.$globalPluginsApplied,r.$isRootDiscriminator=this.$isRootDiscriminator,r.$implicitlyCreated=this.$implicitlyCreated,this.$timestamps!=null)r.$timestamps=Object.assign({},this.$timestamps);if(r.$id=++uH,r.$originalSchemaId=this.$id,this.discriminatorMapping!=null)r.discriminatorMapping=Object.assign({},this.discriminatorMapping);if(this.discriminators!=null)r.discriminators=Object.assign({},this.discriminators);if(this._applyDiscriminators!=null)r._applyDiscriminators=new Map(this._applyDiscriminators);return r.aliases=Object.assign({},this.aliases),r.encryptedFields=On(this.encryptedFields),r};Y.prototype.pick=function(e,t){let r=new Y({},t||this.options);if(!Array.isArray(e))throw new _t('Schema#pick() only accepts an array argument, got "'+typeof e+'"');for(let n of e)if(this._hasEncryptedField(n)){let s=this.encryptedFields[n],i=this.path(n);r.add({[n]:{encrypt:s,[this.options.typeKey]:i}})}else if(this.nested[n])r.add({[n]:S2(this.tree,n)});else{let s=this.path(n);if(s==null)throw new _t("Path `"+n+"` is not in the schema");r.add({[n]:s})}if(!this._hasEncryptedFields())r.options.encryptionType=null;return r};Y.prototype.omit=function(e,t){let r=new Y(this,t||this.options);if(!Array.isArray(e))throw new _t('Schema#omit() only accepts an array argument, got "'+typeof e+'"');return r.remove(e),r};Y.prototype.defaultOptions=function(e){this._userProvidedOptions=e==null?{}:On(e);let t=this.base?.options||{},r=t.strict??!0,n=t.strictQuery??!1,s=t.strictRead??!1,i=t.id??!0;if(e={strict:r,strictQuery:n,strictRead:s,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",...e},e.strict??=r,e.strictQuery??=n,e.id??=i,e.versionKey&&typeof e.versionKey!=="string")throw new _t("`versionKey` must be falsy or string, got `"+typeof e.versionKey+"`");if(fH(e.defaultSort),typeof e.read==="string")e.read=O2(e.read);else if(Array.isArray(e.read)&&typeof e.read[0]==="string")e.read={mode:O2(e.read[0]),tags:e.read[1]};if(e.optimisticConcurrency&&!e.versionKey)throw new _t("Must set `versionKey` if using `optimisticConcurrency`");return e};Y.prototype.discriminator=function(e,t,r){return this._applyDiscriminators=this._applyDiscriminators||new Map,this._applyDiscriminators.set(e,{schema:t,options:r}),this};/*!
736
- * Get the document middleware for this schema, filtering out any hooks that are specific to queries.
737
- */Y.prototype._getDocumentMiddleware=function(t){let r=!!(this.options.shardKey||this.options.shardkey);return this.s.hooks.filter((n)=>{if(t&&n.fn[I1.skipOnSubdocuments])return!1;if(!r&&n.fn[I1.requiresShardKey])return!1;if(n.name==="updateOne"||n.name==="deleteOne")return!!n.document;if(n.name==="remove"||n.name==="init")return n.document==null||!!n.document;if(n.query!=null||n.document!=null)return n.document!==!1;return!0}).filter((n)=>{if(this.methods[n.name])return!n.fn[I1.builtInMiddleware];return!0})};/*!
738
- * Get this schema's default toObject/toJSON options, including Mongoose global
739
- * options.
740
- */Y.prototype._defaultToObjectOptions=function(e){let t=e?"toJSON":"toObject";if(this._defaultToObjectOptionsMap&&t in this._defaultToObjectOptionsMap)return this._defaultToObjectOptionsMap[t];let r=this.base?.options?.[t]||{},n=this.options[t]||{},s=Object.assign({},r,n);return this._defaultToObjectOptionsMap=this._defaultToObjectOptionsMap||{},this._defaultToObjectOptionsMap[t]=ye.hasOwnKeys(s)?s:null,s};Y.prototype.encryptionType=function(e){if(arguments.length===0)return this.options.encryptionType;if(!(typeof e==="string"||e===null))throw new _t(`invalid \`encryptionType\`: ${e}`);this.options.encryptionType=e};Y.prototype.add=function(t,r){if(t instanceof Y||t?.instanceOfSchema)return y3e(this,t),this;if(t._id===!1&&r==null)this.options._id=!1;if(r=r||"",r==="__proto__."||r==="constructor."||r==="prototype.")return this;let n=Object.keys(t),s=this.options.typeKey;for(let o of n){if(ye.specialProperties.has(o))continue;let u=r+o,a=t[o];if(a==null)throw TypeError("Invalid value for schema path `"+u+'`, got value "'+a+'"');if(o==="_id"&&a===!1)continue;let c=!1;if(typeof a==="string"){let l=this.base?.Schema.Types??Y.Types,f=a.charAt(0).toUpperCase()+a.substring(1);c=l[f]!=null}if(o!=="_id"&&(typeof a!=="object"&&typeof a!=="function"&&!c||a==null))throw TypeError(`Invalid schema configuration: \`${a}\` is not a valid type at path \`${o}\`. See https://bit.ly/mongoose-schematypes for a list of valid schema types.`);if(a instanceof A2||(a.constructor?.name??null)==="VirtualType"){this.virtual(a);continue}if(Array.isArray(a)&&a.length===1&&a[0]==null)throw TypeError("Invalid value for schema Array path `"+u+'`, got value "'+a[0]+'"');if(!(P4(a)||a instanceof sH)){if(r)this.nested[r.substring(0,r.length-1)]=!0;if(this.path(r+o,a),!a[0]?.instanceOfSchema&&ye.isPOJO(a[0]?.discriminators)){let l=this.path(r+o);for(let f in a[0].discriminators)l.discriminator(f,a[0].discriminators[f])}}else if(ye.hasOwnKeys(a)===!1){if(r)this.nested[r.substring(0,r.length-1)]=!0;this.path(u,a)}else if(!a[s]||s==="type"&&P4(a.type)&&a.type.type)this.nested[u]=!0,this.add(a,u+".");else{let l=a[s];if(P4(l)&&ye.hasOwnKeys(l)){if(r)this.nested[r.substring(0,r.length-1)]=!0;let f={};if(this._userProvidedOptions.typeKey)f.typeKey=this._userProvidedOptions.typeKey;if(this._userProvidedOptions.strict!=null)f.strict=this._userProvidedOptions.strict;if(this._userProvidedOptions.toObject!=null)f.toObject=ye.omit(this._userProvidedOptions.toObject,["transform"]);if(this._userProvidedOptions.toJSON!=null)f.toJSON=ye.omit(this._userProvidedOptions.toJSON,["transform"]);let h=new Y(l,f);h.$implicitlyCreated=!0;let d=Object.assign({},a,{[s]:h});this.path(r+o,d)}else{if(r)this.nested[r.substring(0,r.length-1)]=!0;if(this.path(r+o,a),!a?.instanceOfSchema&&ye.isPOJO(a?.discriminators)){let f=this.path(r+o);for(let h in a.discriminators)f.discriminator(h,a.discriminators[h])}}}if(a.instanceOfSchema&&a.encryptionType()!=null){if(this.encryptionType()!=a.encryptionType())throw new _t("encryptionType of a nested schema must match the encryption type of the parent schema.");for(let[l,f]of Object.entries(a.encryptedFields)){let h=u+"."+l;this._addEncryptedField(h,f)}}else if(typeof a==="object"&&"encrypt"in a){let{encrypt:l}=a;if(this.encryptionType()==null)throw new _t("encryptionType must be provided");this._addEncryptedField(u,l)}else this._removeEncryptedField(u)}let i=Object.fromEntries(Object.entries(t).map(([o])=>[r+o,null]));return aH(this,i),this};Y.prototype._addEncryptedField=function(t,r){if(this.path(t).autoEncryptionType()==null)throw new _t(`Invalid BSON type for FLE field: '${t}'`);this.encryptedFields[t]=On(r)};Y.prototype._removeEncryptedField=function(t){delete this.encryptedFields[t]};Y.prototype._hasEncryptedFields=function(){return ye.hasOwnKeys(this.encryptedFields)};Y.prototype._hasEncryptedField=function(t){return t in this.encryptedFields};Y.prototype._buildEncryptedFields=function(){return{fields:Object.entries(this.encryptedFields).map(([t,r])=>{let n=this.path(t).autoEncryptionType();return{path:t,bsonType:n,...r}})}};Y.prototype._buildSchemaMap=function(){function e(n,s,i){let o=0,u=n[o];for(;o<n.length-1;++o,u=n[o])s[u]=s[u]==null?{bsonType:"object",properties:{}}:s[u],s=s[u].properties;s[u]=i}let t=(n,[s,i])=>{let o=this.path(s).autoEncryptionType(),u=s.split("."),a={encrypt:{...i,bsonType:o}};return e(u,n,a),n};return{bsonType:"object",properties:Object.entries(this.encryptedFields).reduce(t,{})}};Y.prototype.alias=function(e,t){return aH(this,{[e]:t}),this};Y.prototype.removeIndex=function(t){if(arguments.length>1)throw new _t("removeIndex() takes only 1 argument");if(typeof t!=="object"&&typeof t!=="string")throw new _t("removeIndex() may only take either an object or a string as an argument");if(typeof t==="object"){for(let r=this._indexes.length-1;r>=0;--r)if(m3e(this._indexes[r][0],t))this._indexes.splice(r,1)}else for(let r=this._indexes.length-1;r>=0;--r)if(this._indexes[r][1]!=null&&this._indexes[r][1].name===t)this._indexes.splice(r,1);return this};Y.prototype.clearIndexes=function(){return this._indexes.length=0,this};Y.prototype.searchIndex=function(t){return this._searchIndexes.push(t),this};Y.reserved=Object.create(null);Y.prototype.reserved=Y.reserved;var An=Y.reserved;An.prototype=An.emit=An.listeners=An.removeListener=An.collection=An.errors=An.get=An.init=An.isModified=An.isNew=An.populated=An.remove=An.save=An.toObject=An.validate=1;An.collection=1;Y.prototype.path=function(e,t){if(t===void 0){if(Object.hasOwn(this.paths,e))return this.paths[e];let a=cH(e),c=C3e(this,e,a);if(c!=null)return c;let l=lH(this,e);if(l!=null)return l;if(c=this.hasMixedParent(a),c!=null)return c;return A3e.test(e)?b3e(this,e,a):void 0}let r=e.indexOf(".")===-1?[e]:e.split("."),n=r.pop();if(ye.specialProperties.has(n))throw new _t("Cannot set special property `"+n+"` on a schema");let s=r.length===0?n:r[0];if(Object.hasOwn(An,s)&&!this.options.suppressReservedKeysWarning){let a=`\`${s}\` 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.`;ye.warn(a)}if(typeof t==="object"&&ye.hasUserDefinedProperty(t,"ref"))E3e(t.ref,e);let i=this.tree,o="";for(let a of r){if(ye.specialProperties.has(a))throw new _t("Cannot set special property `"+a+"` on a schema");if(o=o+=(o.length>0?".":"")+a,!i[a])this.nested[o]=!0,i[a]={};if(typeof i[a]!=="object"){let c="Cannot set nested path `"+e+"`. Parent path `"+o+"` already set to type "+i[a].name+".";throw new _t(c)}i=i[a]}i[n]=On(t),this.paths[e]=this.interpretAsType(e,t,this.options),this._defaultsCache=null,this._hasSelectedPaths=void 0;let u=this.paths[e];if(this.childSchemas=this.childSchemas.filter((a)=>a.path!==e),u.$isSchemaMap){let a=e+".$*";if(this.paths[a]=u.$__schemaType,this.mapPaths.push(this.paths[a]),u.$__schemaType.$isSingleNested)this.childSchemas.push({schema:u.$__schemaType.schema,model:u.$__schemaType.Constructor,path:e})}if(u.$isSingleNested){for(let a of Object.keys(u.schema.paths))this.singleNestedPaths[e+"."+a]=u.schema.paths[a];for(let a of Object.keys(u.schema.singleNestedPaths))this.singleNestedPaths[e+"."+a]=u.schema.singleNestedPaths[a];for(let a of Object.keys(u.schema.subpaths))this.singleNestedPaths[e+"."+a]=u.schema.subpaths[a];for(let a of Object.keys(u.schema.nested))this.singleNestedPaths[e+"."+a]="nested";Object.defineProperty(u.schema,"base",{configurable:!0,enumerable:!1,writable:!1,value:this.base}),u.Constructor.base=this.base,this.childSchemas.push({schema:u.schema,model:u.Constructor,path:e})}else if(u.$isMongooseDocumentArray)Object.defineProperty(u.schema,"base",{configurable:!0,enumerable:!1,writable:!1,value:this.base}),u.Constructor.base=this.base,this.childSchemas.push({schema:u.schema,model:u.Constructor,path:e});if(u.$isMongooseArray&&!u.$isMongooseDocumentArray){let a=e,c=u,l=[];while(c.$isMongooseArray)a=a+".$",c.embeddedSchemaType._arrayPath=a,c.embeddedSchemaType._arrayParentPath=e,c=c.embeddedSchemaType,this.subpaths[a]=c;for(let f of l)this.subpaths[f.path]=f}if(u.$isMongooseDocumentArray){for(let a of Object.keys(u.schema.paths)){let c=u.schema.paths[a];if(this.subpaths[e+"."+a]=c,typeof c==="object"&&c!=null&&c.$parentSchemaDocArray==null)c.$parentSchemaDocArray=u}for(let a of Object.keys(u.schema.subpaths)){let c=u.schema.subpaths[a];if(this.subpaths[e+"."+a]=c,typeof c==="object"&&c!=null&&c.$parentSchemaDocArray==null)c.$parentSchemaDocArray=u}for(let a of Object.keys(u.schema.singleNestedPaths)){let c=u.schema.singleNestedPaths[a];if(this.subpaths[e+"."+a]=c,typeof c==="object"&&c!=null&&c.$parentSchemaDocArray==null)c.$parentSchemaDocArray=u}}return this};/*!
741
- * ignore
742
- */Y.prototype._gatherChildSchemas=function(){let t=[];for(let r of Object.keys(this.paths)){if(typeof r!=="string")continue;let n=this.paths[r];if(n.$isMongooseDocumentArray||n.$isSingleNested)t.push({schema:n.schema,model:n.Constructor,path:r});else if(n.$isSchemaMap&&n.$__schemaType.$isSingleNested)t.push({schema:n.$__schemaType.schema,model:n.$__schemaType.Constructor,path:r})}return this.childSchemas=t,t};/*!
743
- * ignore
744
- */function C3e(e,t,r){if(Object.hasOwn(e.paths,t))return e.paths[t];if(Object.hasOwn(e.subpaths,r)){let n=e.subpaths[r];if(n==="nested")return;return n}if(Object.hasOwn(e.singleNestedPaths,r)&&typeof e.singleNestedPaths[r]==="object"){let n=e.singleNestedPaths[r];if(n==="nested")return;return n}return null}/*!
745
- * ignore
746
- */function cH(e){if(!/\.\d+/.test(e))return e;return e.replace(/\.\d+\./g,".$.").replace(/\.\d+$/,".$")}/*!
747
- * ignore
748
- */function lH(e,t){if(e.mapPaths.length===0)return null;for(let r of e.mapPaths){let n=r.path.replace(/\.\$\*/g,"");if(t===n||t.startsWith(n+".")&&t.slice(n.length+1).indexOf(".")===-1)return r;else if(r.schema&&t.startsWith(n+".")){let s=t.slice(n.length+1);return s=s.slice(s.indexOf(".")+1),r.schema.path(s)}else if(r.$isSchemaMap&&t.startsWith(n+".")){let s=t.slice(n.length+1);s=s.slice(s.indexOf(".")+1);let i=r.$__schemaType._presplitPath;if(s.indexOf(".")===-1&&i[i.length-1]==="$*")return r.$__schemaType;else if(s.indexOf(".")!==-1&&r.$__schemaType.schema&&i[i.length-1]==="$*")return r.$__schemaType.schema.path(s.slice(s.indexOf(".")+1))}}return null}Object.defineProperty(Y.prototype,"base",{configurable:!0,enumerable:!1,writable:!0,value:null});Y.prototype.interpretAsType=function(e,t,r){if(t instanceof B4){if(t.path===e)return t;let a=t.clone();return a.path=e,a}let n=this.base?.Schema.Types??Y.Types,s=this.base?.Types??E1();if(!ye.isPOJO(t)&&!(t instanceof sH)){if(ye.getFunctionName(t.constructor)!=="Object"){let c=t;t={},t[r.typeKey]=c}}let i=t[r.typeKey]&&(t[r.typeKey]instanceof Function||r.typeKey!=="type"||!t.type.type)?t[r.typeKey]:{};if(i instanceof B4){if(i.path===e)return i;let a=i.clone();return a.path=e,a}let o;if(ye.isPOJO(i)||i==="mixed")return new n.Mixed(e,t,null,this);if(Array.isArray(i)||i===Array||i==="array"||i===n.Array){let a=i===Array||i==="array"?t.cast||t.of:i[0];if(a?.instanceOfSchema){if(!(a instanceof Y))if(this.options._isMerging)a=new Y(a);else throw TypeError("Schema for array path `"+e+`\` 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: ${e}: new Schema(...)`);return new n.DocumentArray(e,a,t,null,this)}if(a&&a[r.typeKey]&&a[r.typeKey].instanceOfSchema){if(!(a[r.typeKey]instanceof Y))if(this.options._isMerging)a[r.typeKey]=new Y(a[r.typeKey]);else throw TypeError("Schema for array path `"+e+`\` 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: ${e}: new Schema(...)`);return new n.DocumentArray(e,a[r.typeKey],t,a,this)}if(typeof a<"u"){if(Array.isArray(a)||a.type===Array||a.type=="Array"){if(a?.type=="Array")a.type=Array;return new n.Array(e,this.interpretAsType(e,a,r),t,null,this)}}let c=a!=null&&a[r.typeKey]&&(r.typeKey!=="type"||!a.type.type)?a[r.typeKey]:a;if(typeof a==="string")a=n[a.charAt(0).toUpperCase()+a.substring(1)];else if(ye.isPOJO(c))if(ye.hasOwnKeys(c)){let l={minimize:r.minimize};if(r.typeKey)l.typeKey=r.typeKey;if(Object.hasOwn(r,"strict"))l.strict=r.strict;if(Object.hasOwn(r,"strictQuery"))l.strictQuery=r.strictQuery;if(Object.hasOwn(r,"toObject"))l.toObject=ye.omit(r.toObject,["transform"]);if(Object.hasOwn(r,"toJSON"))l.toJSON=ye.omit(r.toJSON,["transform"]);if(Object.hasOwn(this._userProvidedOptions,"_id"))l._id=this._userProvidedOptions._id;else if(Y.Types.DocumentArray.defaultOptions._id!=null)l._id=Y.Types.DocumentArray.defaultOptions._id;let f=new Y(c,l);return f.$implicitlyCreated=!0,new n.DocumentArray(e,f,t,null,this)}else return new n.Array(e,n.Mixed,t,null,this);if(a){if(i=a[r.typeKey]&&(r.typeKey!=="type"||!a.type.type)?a[r.typeKey]:a,Array.isArray(i))return new n.Array(e,this.interpretAsType(e,a,r),t,null,this);if(o=typeof i==="string"?i:i.schemaName||ye.getFunctionName(i),o==="ClockDate")o="Date";if(o===void 0)throw TypeError(`Invalid schema configuration: Could not determine the embedded type for array \`${e}\`. See https://mongoosejs.com/docs/guide.html#definition for more info on supported schema syntaxes.`);if(!Object.hasOwn(n,o))throw TypeError(`Invalid schema configuration: \`${o}\` is not a valid type within the array \`${e}\`.See https://bit.ly/mongoose-schematypes for a list of valid schema types.`);if(o==="Union"&&typeof a==="object")a.parentSchema=this}return new n.Array(e,a||n.Mixed,t,r,this)}if(i?.instanceOfSchema)return new n.Subdocument(i,e,t,this);if(Buffer.isBuffer(i))o="Buffer";else if(typeof i==="function"||typeof i==="object")o=i.schemaName||ye.getFunctionName(i);else if(i===s.ObjectId)o="ObjectId";else if(i===s.Decimal128)o="Decimal128";else o=i==null?""+i:i.toString();if(o)o=o.charAt(0).toUpperCase()+o.substring(1);if(o==="ObjectID")o="ObjectId";if(o==="ClockDate")o="Date";if(o===void 0)throw TypeError(`Invalid schema configuration: \`${e}\` schematype definition is invalid. See https://mongoosejs.com/docs/guide.html#definition for more info on supported schema syntaxes.`);if(n[o]==null)throw TypeError(`Invalid schema configuration: \`${o}\` is not a valid type at path \`${e}\`. See https://bit.ly/mongoose-schematypes for a list of valid schema types.`);return new n[o](e,t,r,this)};Y.prototype.eachPath=function(e){let t=Object.keys(this.paths),r=t.length;for(let n=0;n<r;++n)e(t[n],this.paths[t[n]]);return this};Y.prototype.requiredPaths=function(t){if(this._requiredpaths&&!t)return this._requiredpaths;let r=Object.keys(this.paths),n=r.length,s=[];while(n--){let i=r[n];if(this.paths[i].isRequired)s.push(i)}return this._requiredpaths=s,this._requiredpaths};Y.prototype.pathsWithTransforms=function(t){if(this._pathsWithTransforms!==void 0&&!t)return this._pathsWithTransforms;let r=Object.keys(this.paths),n=[];for(let s of r){let i=this.paths[s],o=i.options.transform??i.constructor?.defaultOptions?.transform,u=i.embeddedSchemaType?.options?.transform??i.embeddedSchemaType?.constructor?.defaultOptions?.transform;if(o||u)n.push(s)}return this._pathsWithTransforms=n.length?n:null,this._pathsWithTransforms};Y.prototype._getDefaultsCache=function(){if(this._defaultsCache==null)this._defaultsCache=new l3e(this);return this._defaultsCache};Y.prototype.indexedPaths=function(){if(this._indexedpaths)return this._indexedpaths;return this._indexedpaths=this.indexes(),this._indexedpaths};Y.prototype.pathType=function(e){if(Object.hasOwn(this.paths,e))return"real";if(Object.hasOwn(this.virtuals,e))return"virtual";if(Object.hasOwn(this.nested,e))return"nested";let t=cH(e);if(Object.hasOwn(this.subpaths,t)||Object.hasOwn(this.subpaths,e))return"real";let r=Object.hasOwn(this.singleNestedPaths,t)||Object.hasOwn(this.singleNestedPaths,e);if(r)return r==="nested"?"nested":"real";if(lH(this,e)!=null)return"real";if(/\.\d+\.|\.\d+$/.test(e))return hH(this,e,t);return"adhocOrUndefined"};Y.prototype.hasMixedParent=function(e){let t=e.split(/\./g);e="";for(let r=0;r<t.length;++r)if(e=r>0?e+"."+t[r]:t[r],Object.hasOwn(this.paths,e)&&this.paths[e]instanceof Ea.Mixed)return this.paths[e];return null};Y.prototype.setupTimestamp=function(e){return _3e(this,e)};function hH(e,t,r){let n=t.split(/\.(\d+)\.|\.(\d+)$/).filter(Boolean);if(n.length<2)return Object.hasOwn(e.paths,n[0])?e.paths[n[0]]:"adhocOrUndefined";let s=e.path(n[0]),i=!1;if(!s)return"adhocOrUndefined";let o=n.length-1;for(let u=1;u<n.length;++u){i=!1;let a=n[u];if(u===o&&s&&!/\D/.test(a)){if(s.$isMongooseDocumentArray)s=s.embeddedSchemaType;else if(s instanceof Ea.Array)s=s.embeddedSchemaType;else s=void 0;break}if(!/\D/.test(a)){if(s instanceof Ea.Array&&u!==o)s=s.embeddedSchemaType;continue}if(!s?.schema){s=void 0;break}i=s.schema.pathType(a)==="nested",s=s.schema.path(a)}if(e.subpaths[r]=s,s)return"real";if(i)return"nested";return"adhocOrUndefined"}/*!
749
- * ignore
750
- */function b3e(e,t,r){return hH(e,t,r),e.subpaths[r]}Y.prototype.queue=function(e,t){return this.callQueue.push([e,t]),this};Y.prototype.pre=function(e){if(e instanceof RegExp){let t=Array.prototype.slice.call(arguments,1);for(let r of oH)if(e.test(r))this.pre.apply(this,[r].concat(t));return this}if(Array.isArray(e)){let t=Array.prototype.slice.call(arguments,1);for(let r of e)this.pre.apply(this,[r].concat(t));return this}return this.s.hooks.pre.apply(this.s.hooks,arguments),this};Y.prototype.post=function(e){if(e instanceof RegExp){let t=Array.prototype.slice.call(arguments,1);for(let r of oH)if(e.test(r))this.post.apply(this,[r].concat(t));return this}if(Array.isArray(e)){let t=Array.prototype.slice.call(arguments,1);for(let r of e)this.post.apply(this,[r].concat(t));return this}return this.s.hooks.post.apply(this.s.hooks,arguments),this};Y.prototype.plugin=function(e,t){if(typeof e!=="function")throw new _t('First param to `schema.plugin()` must be a function, got "'+typeof e+'"');if(t?.deduplicate){for(let r of this.plugins)if(r.fn===e)return this}return this.plugins.push({fn:e,opts:t}),e(this,t),this};Y.prototype.queryHelper=function(t,r){if(typeof t!=="string")throw new _t('First param to `schema.queryHelper()` must be a string, got "'+typeof t+'"');if(typeof r!=="function")throw new _t('Second param to `schema.queryHelper()` must be a function, got "'+typeof r+'"');return this.query[t]=r,this};Y.prototype.method=function(e,t,r){if(typeof e!=="string")for(let n in e)this.methods[n]=e[n],this.methodOptions[n]=On(r);else this.methods[e]=t,this.methodOptions[e]=On(r);return this};Y.prototype.static=function(e,t){if(typeof e!=="string")for(let r in e)this.statics[r]=e[r];else this.statics[e]=t;return this};Y.prototype.index=function(e,t){if(e||(e={}),t||(t={}),t.expires)ye.expires(t);for(let r in e)if(this.aliases[r])e=ye.renameObjKey(e,r,this.aliases[r]);for(let r of Object.keys(e))if(e[r]==="ascending"||e[r]==="asc")e[r]=1;else if(e[r]==="descending"||e[r]==="desc")e[r]=-1;return this._indexes.push([e,t]),this};Y.prototype.set=function(e,t,r){if(arguments.length===1)return this.options[e];switch(e){case"read":if(typeof t==="string")this.options[e]={mode:O2(t),tags:r};else if(Array.isArray(t)&&typeof t[0]==="string")this.options[e]={mode:O2(t[0]),tags:t[1]};else this.options[e]=t;this._userProvidedOptions[e]=this.options[e];break;case"timestamps":this.setupTimestamp(t),this.options[e]=t,this._userProvidedOptions[e]=this.options[e];break;case"_id":if(this.options[e]=t,this._userProvidedOptions[e]=this.options[e],t&&!this.paths._id)iH(this);else if(!t&&this.paths._id!=null&&this.paths._id.auto)this.remove("_id");break;default:this.options[e]=t,this._userProvidedOptions[e]=this.options[e];break}if(e==="strict")xf(this,{strict:t});if(e==="strictQuery")xf(this,{strictQuery:t});if(e==="toObject")t={...t},delete t.transform,xf(this,{toObject:t});if(e==="toJSON")t={...t},delete t.transform,xf(this,{toJSON:t});return this};/*!
751
- * Recursively set options on implicitly created schemas
752
- */function xf(e,t){for(let{schema:r}of e.childSchemas){if(!r.$implicitlyCreated)continue;Object.assign(r.options,t),xf(r,t)}}Y.prototype.get=function(e){return this.options[e]};var D3e="2d 2dsphere hashed text".split(" ");Object.defineProperty(Y,"indexTypes",{get:function(){return D3e},set:function(){throw new _t("Cannot overwrite Schema.indexTypes")}});Y.prototype.indexes=function(){return d3e(this)};Y.prototype.virtual=function(e,t){if(e instanceof A2||f3e(e)==="VirtualType")return this.virtual(e.path,e.options);let r=e.split(".");for(let s of r)if(ye.specialProperties.has(s))throw new _t("Cannot set special property `"+s+"` on a schema");if(t=new h3e(t),ye.hasUserDefinedProperty(t,["ref","refPath"])){if(t.localField==null)throw new _t("Reference virtuals require `localField` option");if(t.foreignField==null)throw new _t("Reference virtuals require `foreignField` option");let s=this.virtual(e);if(s.options=t,this.pre("init",function(a,c){if(_a.has(e,a)){let l=_a.get(e,a);if(!this.$$populatedVirtuals)this.$$populatedVirtuals={};if(t.justOne||t.count)this.$$populatedVirtuals[e]=Array.isArray(l)?l[0]:l;else this.$$populatedVirtuals[e]=Array.isArray(l)?l:l==null?[]:[l];if(c?.hydratedPopulatedDocs&&!t.count){let f=s._getModelNamesForPopulate(this),h=this.$$populatedVirtuals[e];if(!Array.isArray(h)&&!rH(h)&&f?.length===1){let d=this.db.model(f[0]);this.$$populatedVirtuals[e]=d.hydrate(h)}else if(Array.isArray(h)&&f?.length===1){let d=this.db.model(f[0]);for(let m=0;m<h.length;++m)if(!rH(h[m]))h[m]=d.hydrate(h[m],null,{hydratedPopulatedDocs:!0});let p=t.foreignField;this.$populated(e,h.map((m)=>m==null?m:m.get(typeof p==="function"?p.call(m,m):p)),{populateModelSymbol:d})}}_a.unset(e,a)}}),s.set(function(u){if(!this.$$populatedVirtuals)this.$$populatedVirtuals={};return g3e(this.$$populatedVirtuals,e,u,t)}),typeof t.get==="function")s.get(t.get);let i=e.split("."),o=i[0];for(let u=0;u<i.length-1;++u){if(this.paths[o]==null)continue;if(this.paths[o].$isMongooseDocumentArray||this.paths[o].$isSingleNested){let a=i.slice(u+1).join(".");this.paths[o].schema.virtual(a,t);break}else if(this.paths[o].$isSchemaMap){let a=i.slice(u+2).join(".");this.paths[o].$__schemaType.schema.virtual(a,t);break}o+="."+i[u+1]}return s}let n=this.virtuals;if(this.pathType(e)==="real")throw new _t('Virtual path "'+e+'" conflicts with a real path in the schema');if(n[e]=r.reduce(function(s,i,o){return s[i]||(s[i]=o===r.length-1?new A2(t,e):{}),s[i]},this.tree),t?.applyToArray&&r.length>1){let s=this.path(r.slice(0,-1).join("."));if(s?.$isMongooseArray)return s.virtual(r[r.length-1],t);else throw new _t(`Path "${s}" is not an array`)}return n[e]};Y.prototype.virtualpath=function(e){return Object.hasOwn(this.virtuals,e)?this.virtuals[e]:null};Y.prototype.remove=function(e){if(typeof e==="string")e=[e];if(Array.isArray(e))e.forEach(function(t){if(this.path(t)==null&&!this.nested[t])return;this._defaultsCache=null,this._hasSelectedPaths=void 0;for(let[r,n]of Object.entries(this.aliases))if(n===t||n.startsWith(t+".")){if(delete this.aliases[r],delete this.virtuals[r],S2(this.tree,r)instanceof A2)_2(this,r)}if(this.nested[t]){let r=Object.keys(this.paths).concat(Object.keys(this.nested));for(let n of r)if(n.startsWith(t+"."))delete this.paths[n],delete this.nested[n],_2(this,n);this.mapPaths=this.mapPaths.filter((n)=>!n.path.startsWith(t+".")),nH(this,t),delete this.nested[t],_2(this,t);return}delete this.paths[t];for(let r of Object.keys(this.paths))if(r.startsWith(t+"."))delete this.paths[r];this.mapPaths=this.mapPaths.filter((r)=>!r.path.startsWith(t+".")),nH(this,t),_2(this,t),this._removeEncryptedField(t)},this);return this};/*!
753
- * ignore
754
- */function nH(e,t){let r=t+".";for(let n of Object.keys(e.subpaths))if(n===t||n.startsWith(r))delete e.subpaths[n];for(let n of Object.keys(e.singleNestedPaths))if(n===t||n.startsWith(r))delete e.singleNestedPaths[n]}function _2(e,t){let r=t.split("."),n=r.pop(),s=e.tree;for(let i of r)if(s=s[i],s==null)return;delete s[n]}Y.prototype.removeVirtual=function(e){if(typeof e==="string")e=[e];if(Array.isArray(e)){for(let t of e)if(this.virtuals[t]==null)throw new _t(`Attempting to remove virtual "${t}" that does not exist.`);for(let t of e){if(Object.hasOwn(this.aliases,t)){let r=this.aliases[t];delete this.aliases[t];let n=S2(this.tree,r),s=n instanceof B4?n.options:n;for(let i of[this.paths[r]?.options,s])if(i?.alias===t)delete i.alias;else if(Array.isArray(i?.alias))i.alias=i.alias.filter((o)=>o!==t)}if(delete this.paths[t],delete this.virtuals[t],t.indexOf(".")!==-1)_a.unset(t,this.tree);else delete this.tree[t]}}return this};Y.prototype.loadClass=function(e,t){if(e===Object.prototype||e===Function.prototype||Object.hasOwn(e.prototype,"$isMongooseModelPrototype")||Object.hasOwn(e.prototype,"$isMongooseDocumentPrototype"))return this;if(this.loadClass(Object.getPrototypeOf(e),t),!t)Object.getOwnPropertyNames(e).forEach(function(r){if(r.match(/^(length|name|prototype|constructor|__proto__)$/))return;let n=Object.getOwnPropertyDescriptor(e,r);if(Object.hasOwn(n,"value"))this.static(r,n.value)},this);return Object.getOwnPropertyNames(e.prototype).forEach(function(r){if(r.match(/^(constructor)$/))return;let n=Object.getOwnPropertyDescriptor(e.prototype,r);if(!t){if(typeof n.value==="function")this.method(r,n.value)}if(typeof n.get==="function"){if(this.virtuals[r])this.virtuals[r].getters=[];this.virtual(r).get(n.get)}if(typeof n.set==="function"){if(this.virtuals[r])this.virtuals[r].setters=[];this.virtual(r).set(n.set)}},this),this};/*!
755
- * ignore
756
- */Y.prototype._getSchema=function(e){let t=this,r=t.path(e),n=[];if(r)return r.$fullPath=e,r;function s(o,u){let a=o.length+1,c,l;while(a--)if(l=o.slice(0,a).join("."),c=u.path(l),c){if(n.push(l),c.embeddedSchemaType||c.Constructor){if(c.embeddedSchemaType instanceof Ea.Mixed)return c.embeddedSchemaType.$fullPath=n.join("."),c.embeddedSchemaType;if(a!==o.length){let f=c,h=a;while(h<o.length&&f.embeddedSchemaType&&(o[h]==="$"||E2(o[h])))f=f.embeddedSchemaType,++h;if(h===o.length)return f;if(c.schema){let d;if(o[a]==="$"||E2(o[a])){if(a+1===o.length)return c.embeddedSchemaType;if(d=s(o.slice(a+1),c.schema),d)d.$parentSchemaDocArray=d.$parentSchemaDocArray||(c.schema.$isSingleNested?null:c);return d}if(d=s(o.slice(a),c.schema),d)d.$parentSchemaDocArray=d.$parentSchemaDocArray||(c.schema.$isSingleNested?null:c);return d}}}else if(c.$isSchemaMap){if(a>=o.length)return c;if(a+1>=o.length)return c.$__schemaType;if(c.$__schemaType instanceof Ea.Mixed)return c.$__schemaType;if(c.$__schemaType.schema!=null)return s(o.slice(a+1),c.$__schemaType.schema)}return c.$fullPath=n.join("."),c}}let i=e.split(".");for(let o=0;o<i.length;++o){if(i[o]==="$"||E2(i[o]))i[o]="0";if(w3e.test(i[o]))i[o]="$"}return s(i,t)};/*!
757
- * ignore
758
- */Y.prototype._getPathType=function(e){let t=this;if(t.path(e))return"real";function n(s,i){let o=s.length+1,u,a;while(o--)if(a=s.slice(0,o).join("."),u=i.path(a),u){if(u.embeddedSchemaType||u.Constructor){if(u.embeddedSchemaType instanceof Ea.Mixed)return{schema:u,pathType:"mixed"};if(o!==s.length&&u.schema){if(s[o]==="$"||E2(s[o])){if(o===s.length-1)return{schema:u,pathType:"nested"};return n(s.slice(o+1),u.schema)}return n(s.slice(o),u.schema)}return{schema:u,pathType:u.$isSingleNested?"nested":"array"}}return{schema:u,pathType:"real"}}else if(o===s.length&&Object.hasOwn(i.nested,a))return{schema:i,pathType:"nested"};return{schema:u||i,pathType:"undefined"}}return n(e.split("."),t)};Y.prototype._transformDuplicateKeyError=function(t){if(!this._duplicateKeyErrorMessagesByPath)return t;if(t.code!==11000&&t.code!==11001)return t;if(t.keyPattern!=null){let r=t.keyPattern,n=Object.keys(r);if(n.length!==1)return t;let s=n[0];if(!Object.hasOwn(this._duplicateKeyErrorMessagesByPath,s))return t;return new _t(this._duplicateKeyErrorMessagesByPath[s],{cause:t})}return t};/*!
759
- * ignore
760
- */function E2(e){return e.startsWith("$[")&&e.endsWith("]")}Y.prototype._preCompile=function(){fH(this.options.defaultSort),this.plugin(p3e,{deduplicate:!0}),T3e(this),F4(this,new Set),this._hasSelectedPaths=dH(this,[])};/*!
761
- * Throws if `defaultSort` is not a valid value for the `defaultSort` schema option. Disallows `$meta` sorts,
762
- * like `{ score: { $meta: 'textScore' } }`, because MongoDB throws on `$meta` sorts for queries without `$text`.
763
- */function fH(e){if(!e)return;let t="`defaultSort` must not be empty, use `defaultSort: null` to disable the default sort";if(typeof e==="string"){if(e.trim()==="")throw new _t(t);return}if(typeof e!=="object")throw new _t("`defaultSort` must be falsy, string, object, array, or Map, got `"+typeof e+"`");let r=e instanceof Map?Array.from(e):Array.isArray(e)?e:Object.entries(e);if(r.length===0)throw new _t(t);for(let n of r){if(!Array.isArray(n))throw new _t("`defaultSort` array must be an array of [key, value] arrays, like `[['name', 1]]`");if(n[1]!=null&&Object.hasOwn(n[1],"$meta"))throw new _t("`defaultSort` does not support `$meta` sorts, got `$meta` for `"+n[0]+"`")}}/*!
764
- * Clears caches that are derived from `schema.paths` on `schema` and all of its
765
- * nested schemas, because nested schemas can change until the model is compiled.
766
- */function F4(e,t){if(t.has(e))return;t.add(e),e._defaultsCache=null,e._pathsWithTransforms=void 0;for(let{schema:r}of e.childSchemas)F4(r,t);for(let r of Object.values(e.discriminators??{}))F4(r,t)}/*!
767
- * Returns true if any path in `schema`, including paths in nested schemas,
768
- * has a schema-level `select` option. If not, `applyPaths()` can skip walking
769
- * the schema on every query. Mirrors the paths that `applyPaths()` checks.
770
- */function dH(e,t){if(t.includes(e))return!1;t.push(e);for(let r of Object.keys(e.paths)){let n=e.paths[r];if(n.$isSchemaMap||r.endsWith(".$*")){if(n.options?.select===!1)return!0;continue}if(typeof n.selected==="boolean")return!0;if(n.$isMongooseArray&&!n.$isMongooseDocumentArray&&typeof n.embeddedSchemaType?.selected==="boolean")return!0;if(n.schema&&dH(n.schema,t))return!0}return t.pop(),!1}/*!
771
- * Build precomputed path tries for optimisticConcurrency include/exclude so
772
- * that lookups at save time are a single trie walk that handles nested paths
773
- * and map wildcards like `settings.$*`.
774
- */function T3e(e){let t=e.options.optimisticConcurrency;if(!t||t===!0)return;if(Array.isArray(t))e.options._optimisticConcurrencyTrie=new tH(t);else if(Array.isArray(t.exclude))e.options._optimisticConcurrencyExcludeTrie=new tH(t.exclude)}Y.prototype.toJSONSchema=function(t){let r=t?.useBsonType??!1,n=r?{required:[],properties:{}}:{type:"object",required:[],properties:{}};for(let s of Object.keys(this.paths)){let i=this.paths[s];if(i._presplitPath.indexOf("$*")!==-1)continue;let o=i._presplitPath.length>1,u=n;if(o)for(let c=0;c<i._presplitPath.length-1;++c){let l=i._presplitPath[c];if(u.properties[l]==null)u.properties[l]=r?{bsonType:["object","null"],properties:{}}:{type:["object","null"],properties:{}};u=u.properties[l]}let a=i._presplitPath[i._presplitPath.length-1];if(s==="_id"){if(!u.required)u.required=[];u.required.push("_id")}else if(i.options.required&&typeof i.options.required!=="function"){if(!u.required)u.required=[];u.required.push(a)}u.properties[a]=i.toJSONSchema(t)}if(n.required.length===0)delete n.required;return n};/*!
775
- * Module exports.
776
- */pH.exports=N4=Y;Y.Types=Ea=Ef();/*!
777
- * ignore
778
- */N4.ObjectId=Ea.ObjectId});var w2=g(function(mH,yH){/*!
779
- * Connection states
780
- */var Po=yH.exports=mH=Object.create(null);Po[0]="disconnected";Po[1]="connected";Po[2]="connecting";Po[3]="disconnecting";Po[99]="uninitialized";Po.disconnected=0;Po.connected=1;Po.connecting=2;Po.disconnecting=3;Po.uninitialized=99});var R4=g(function(mxe,gH){/*!
781
- * Module dependencies.
782
- */var M3e=$s();class I4 extends M3e{constructor(e,t,r,n){let s=e.map((i)=>i.message).join(", ");if(s.length>200)s=s.slice(0,200)+"...";super(`${n} failed with ${e.length} Mongoose validation errors: ${s}`);this.validationErrors=e,this.results=t,this.rawResult=r,this.operation=n}}Object.defineProperty(I4.prototype,"name",{value:"MongooseBulkWriteError"});/*!
783
- * exports
784
- */gH.exports=I4});var EH=g(function(yxe,_H){/*!
785
- * Module dependencies.
786
- */var x3e=Le();class $4 extends x3e{constructor(e,t){super(e);this.errors=t}}Object.defineProperty($4.prototype,"name",{value:"SyncIndexesError"});_H.exports=$4});var v4=g(function(gxe,AH){AH.exports=function e(t,r,n,s){if(t[s])return;if(t[s]=!0,!n?.skipTopLevel){let a=null;for(let c of r){let l=c[1]==null?null:c[1].tags;if(!Array.isArray(l)){t.plugin(c[0],c[1]);continue}if(a=a||new Set(t.options.pluginTags||[]),!l.find((f)=>a.has(f)))continue;t.plugin(c[0],c[1])}}if(n=Object.assign({},n),delete n.skipTopLevel,n.applyPluginsToChildSchemas!==!1)for(let a of Object.keys(t.paths)){let c=t.paths[a];if(c.schema!=null)e(c.schema,r,n,s),c.Constructor.prototype.$__setSchema(c.schema)}let i=t.discriminators;if(i==null)return;let o=n.applyPluginsToDiscriminators,u=Object.keys(i);for(let a of u){let c=i[a];e(c,r,{skipTopLevel:!o},s)}}});var C2=g(function(P3e,k4){/*!
787
- * ignore
788
- */var OH=null;P3e.get=function(){return OH};P3e.set=function(e){OH=e}});var q4=g(function(_xe,SH){function N3e(){return{ok:1,nInserted:0,nUpserted:0,nMatched:0,nModified:0,nRemoved:0,upserted:[],writeErrors:[],insertedIds:[],writeConcernErrors:[]}}SH.exports=N3e});var CH=g(function(Exe,wH){var I3e=Le();class j4 extends I3e{constructor(e,t){super(e);this.errors=t}}Object.defineProperty(j4.prototype,"name",{value:"CreateCollectionsError"});wH.exports=j4});var L4=g(function(v3e){/*!
789
- * Module dependencies.
790
- */var R3e=we().Binary,bH=vn(),DH=Zh(),$3e=$s(),TH=G("util");v3e.flatten=MH;v3e.modifiedPaths=xH;/*!
791
- * ignore
792
- */function MH(e,t,r,n){let s;if(e&&DH(e)&&!Buffer.isBuffer(e))s=Object.keys(e.toObject({transform:!1,virtuals:!1})||{});else s=Object.keys(e||{});let i=s.length,o={};t=t?t+".":"";for(let u=0;u<i;++u){let a=s[u],c=e[a];o[t+a]=c;let l=n?.path?.(t+a),f=n?.nested?.[t+a];if(l?.instance==="Mixed")continue;if(PH(c)){if(r?.skipArrays&&Array.isArray(c))continue;let h=MH(c,t+a,r,n);for(let d in h)o[d]=h[d];if(Array.isArray(c))o[t+a]=c}if(f){let h=Object.keys(n.paths);for(let d of h)if(d.startsWith(t+a+".")&&!Object.hasOwn(o,d))o[d]=void 0}}return o}/*!
793
- * ignore
794
- */function xH(e,t,r,n=null){if(e==null||typeof e!=="object")return;if(n==null)n={raw:{update:e,path:t},trace:new WeakSet};if(n.trace.has(e))throw new $3e(`a circular reference in the update value, updateValue:
795
- ${TH.inspect(n.raw.update,{showHidden:!1,depth:1})}
796
- updatePath: '${n.raw.path}'`);n.trace.add(e);let s=Object.keys(e||{}),i=s.length;r=r||{},t=t?t+".":"";for(let o=0;o<i;++o){let u=s[o],a=e[u],c=t+u;if(r[c]=!0,!Buffer.isBuffer(a)&&DH(a))a=a.toObject({transform:!1,virtuals:!1});if(PH(a))xH(a,t+u,r,n)}return n.trace.delete(e),r}/*!
797
- * ignore
798
- */function PH(e){return e&&typeof e==="object"&&!(e instanceof Date)&&!bH(e,"ObjectId")&&(!Array.isArray(e)||e.length!==0)&&!(e instanceof Buffer)&&!bH(e,"Decimal128")&&!(e instanceof R3e)}});var NH=g(function(Oxe,FH){var BH=L4().modifiedPaths;FH.exports=function(t){let r=Object.keys(t),n={},s={};for(let i of r){if(i.startsWith("$")){BH(t[i],"",n);continue}s[i]=t[i]}return BH(s,"",n),n}});var U4=g(function(Sxe,IH){var j3e=NH();IH.exports=function(t){if(t==null)return{};let r=j3e(t);return Object.keys(r).reduce((n,s)=>{let i=s.match(/\$\[[^\]]+\]/g);if(i==null)return n;for(let o of i){let u=s.indexOf(o);if(u!==s.lastIndexOf(o))throw Error(`Path '${s}' contains the same array filter multiple times`);n[o.substring(2,o.length-1)]=s.substring(0,u-1).replace(/\$\[[^\]]+\]/g,"0")}return n},{})}});var vH=g(function(wxe,$H){var L3e=ff(),RH=gr(),U3e=_i(),V4=BA(),V3e=U4();$H.exports=function(t,r,n,s,i){let o=s.indexOf(".")===-1?[s]:s.split("."),u=null,a="adhocOrUndefined";n=n||{},r=r||{};let c=Array.isArray(i?.arrayFilters)?i.arrayFilters:[],l=V3e(r),f=0;for(let h=0;h<o.length;++h){let d=o.slice(f,h+1).join("."),p=L3e(d);if(u=t.path(p),u==null)continue;if(a=t.pathType(p),(u.$isSingleNested||u.$isMongooseDocumentArrayElement)&&u.schema.discriminators!=null){let m=RH(u,"schema.options.discriminatorKey"),_=p+"."+m,y=_.replace(/\.\d+\./,"."),E=null;if(_ in n)E=V4(n[_]);if(y in n)E=V4(n[y]);let w=p.replace(/\.\d+$/,"");if(u.$isMongooseDocumentArrayElement&&RH(n[w],"$elemMatch."+m)!=null)E=V4(n[w].$elemMatch[m]);let b=d+"."+m;if(b in r)E=r[b];if(_ in r)E=r[_];for(let x of Object.keys(l)){let v=l[x]+"."+m,P=x+"."+m;if(v===y){let ge=c.find((Me)=>Object.hasOwn(Me,P));if(ge!=null)E=ge[P]}}if(E==null)continue;let M=U3e(u.Constructor.discriminators,E)?.schema;if(M==null)continue;let O=o.slice(h+1).join(".");if(u=M._getSchema(O),t=M,f=h+1,u!=null){a=M._getPathType(O);break}}}return{type:a,schematype:u}}});var qH=g(function(Cxe,kH){var z3e=fa();kH.exports=function(t,r,n,s,i,o,u){if(!t?.options?.immutable)return!1;let a=t.options.immutable;if(typeof a==="function")a=a.call(u,u);if(!a)return!1;if(o?.overwriteImmutable)return!1;if(r===!1)return!1;if(r==="throw")throw new z3e(null,`Field ${i} is immutable and strict = 'throw'`);return delete n[s],!0}});var UH=g(function(bxe,LH){var W3e=gr();LH.exports=function(t,r,n){if(r==null)return;let s=Object.keys(r);for(let i of s){let o=i.startsWith("$");if(i==="$set"){let u=Object.keys(r[i]);for(let a of u)jH(t,r[i],a,r,n)}else if(!o)jH(t,r,i,r,n)}};function jH(e,t,r,n,s){let i=e.path(r);if(i==null)return;let o=W3e(i,"options.immutable",null);if(o==null)return;if(typeof o==="function")o=o.call(s,s);if(!o)return;n.$setOnInsert=n.$setOnInsert||{},n.$setOnInsert[r]=t[r],delete t[r]}});var z4=g(function(Dxe,VH){var R1=la();VH.exports=function(t,r,n){if(r.indexOf(".")===-1){if(R1.has(r))return;t[r]=n;return}let s=r.split("."),i=s.pop(),o=t;for(let u of s){if(R1.has(u))continue;if(!Object.hasOwn(o,u)&&u in o)return;if(o[u]==null)o[u]={};o=o[u]}if(!R1.has(i))o[i]=n}});var Q4=g(function(Txe,ZH){var Pf=kn(),v1=Le(),zH=S4(),WH=fa(),H3e=Ga(),G4=mf(),K3e=nc(),G3e=$n(),W4=qs(),H4=_i(),K4=vH(),Y3e=Co(),HH=qH(),KH=gn(),J3e=O1(),Q3e=UH(),QH=Ui().schemaMixedSymbol,X3e=z4(),fn=Oe(),{internalToObjectOptions:GH}=ji(),Y4=new Set(["$currentDate","$inc","$min","$max","$mul","$rename","$set","$setOnInsert","$unset","$addToSet","$pop","$pull","$push","$pullAll","$bit"]);ZH.exports=function(t,r,n,s,i){if(r==null)return;if(n=n||{},Array.isArray(r)){let f=r.length;for(let h=0;h<f;++h){let d=Object.keys(r[h]);for(let p of d)r[h][p]=Z3e(p,r[h][p])}return r}if(t!=null&&i!=null&&fn.hasUserDefinedProperty(i,t.options.discriminatorKey)&&typeof i[t.options.discriminatorKey]!=="object"&&t.discriminators!=null){let f=i[t.options.discriminatorKey],h=H4(s.model.discriminators,f);t=W4(t.discriminators,f)||h?.schema||t}else if(t!=null&&n.overwriteDiscriminatorKey&&fn.hasUserDefinedProperty(r,t.options.discriminatorKey)&&t.discriminators!=null){let f=r[t.options.discriminatorKey],h=H4(s.model.discriminators,f);t=W4(t.discriminators,f)||h?.schema||t}else if(t!=null&&n.overwriteDiscriminatorKey&&r.$set!=null&&fn.hasUserDefinedProperty(r.$set,t.options.discriminatorKey)&&t.discriminators!=null){let f=r.$set[t.options.discriminatorKey],h=H4(s.model.discriminators,f);t=W4(t.discriminators,f)||h?.schema||t}if(n.upsert&&!n.overwriteImmutable)Q3e(t,r,s);if(KH(r)&&typeof r.toObject==="function")r=r.toObject(GH);let o=Object.keys(r),u=o.length,a={},c,l=!1;i=i||{};while(u--){let f=o[u];if(!Y4.has(f)){if(!a.$set)if(r.$set)a.$set=r.$set;else a.$set={};if(a.$set[f]=r[f],o.splice(u,1),!~o.indexOf("$set"))o.push("$set")}else if(f==="$set"){if(!a.$set)a[f]=r[f]}else a[f]=r[f]}u=o.length;while(u--){let f=o[u];if(c=a[f],l=l||f.startsWith("$"),KH(c))c=c.toObject(GH),a[f]=c;if(c&&typeof c==="object"&&!Buffer.isBuffer(c)&&Y4.has(f))XH(t,c,f,n,s,i);else{let h="Invalid atomic update value for "+f+". Expected an object, received "+typeof c;throw Error(h)}if(f.startsWith("$")&&fn.isEmptyObject(c))delete a[f]}if(fn.hasOwnKeys(a)===!1&&n.upsert&&fn.hasOwnKeys(i))return{$setOnInsert:{...i}};return a};/*!
799
- * ignore
800
- */function Z3e(e,t){if(e==="$unset"){if(typeof t!=="string"&&(!Array.isArray(t)||t.find((r)=>typeof r!=="string")))throw new v1("Invalid $unset in pipeline, must be a string or an array of strings");return t}if(e==="$project"){if(t==null||typeof t!=="object")throw new v1("Invalid $project in pipeline, must be an object");return t}if(e==="$addFields"||e==="$set"){if(t==null||typeof t!=="object")throw new v1("Invalid "+e+" in pipeline, must be an object");return t}else if(e==="$replaceRoot"||e==="$replaceWith"){if(t==null||typeof t!=="object")throw new v1("Invalid "+e+" in pipeline, must be an object");return t}throw new v1('Invalid update pipeline operator: "'+e+'"')}function XH(e,t,r,n,s,i,o){let u=n.strict;o=o?o+".":"";let a=Object.keys(t),c=a.length,l=!1,f,h,d,p=null,m=u??e.options.strict;while(c--){h=a[c],d=t[h];let _=o+h,y=!o&&J3e(h),E=y?e._getSchema(_):null,w=y&&Object.hasOwn(e.nested,h);if(y&&E==null&&!w)throw new v1('Invalid update: Unexpected modifier "'+h+'" as a key in operator "'+r+'". Did you mean something like { '+r+": { fieldName: { "+h+": [...] } } }? Modifiers must appear under a valid field path.");if(r==="$pull"){if(!y)E=e._getSchema(_);if(f=E,f==null){let A=K4(e,t,i,o+h,n);if(A.schematype!=null)f=A.schematype}if(f?.schema!=null){try{t[h]=K3e(f.schema,t[h],n,s)}catch(A){if(A instanceof Pf){p=su(A,s,h,p);continue}else throw A}l=!0;continue}}let b=o?o+h:h;if(e.discriminatorMapping!=null&&b===e.options.discriminatorKey&&e.discriminatorMapping.value!==t[h]&&!n.overwriteDiscriminatorKey){if(m==="throw"){let A=Error(`Can't modify discriminator key "`+b+'" on discriminator model');p=su(A,s,b,p);continue}else if(m){delete t[h];continue}}if(!y&&r!=="$pull")E=e._getSchema(_);if(f=E,G3e(d)==="Object"){if(f==null){let A=K4(e,t,i,o+h,n);if(A.schematype!=null)f=A.schematype}if(r!=="$setOnInsert"&&HH(f,u,t,h,o+h,n,s))continue;if(f&&(f.embeddedSchemaType||f.Constructor)&&r in J4)if("$each"in d){l=!0;try{t[h]={$each:$1(f,d.$each,r,h,s,o+h)}}catch(A){p=su(A,s,h,p)}if(d.$slice!=null)t[h].$slice=d.$slice|0;if(d.$sort)t[h].$sort=d.$sort;if(d.$position!=null)t[h].$position=G4(d.$position)}else{if(f?.$isSingleNested){let A=u==null?f.schema.options.strict:u;try{t[h]=f.castForQuery(null,d,s,{strict:A})}catch(M){p=su(M,s,h,p)}}else try{t[h]=$1(f,d,r,h,s,o+h)}catch(A){p=su(A,s,h,p)}if(t[h]===void 0){delete t[h];continue}l=!0}else if(r==="$currentDate"||r in J4&&f){try{t[h]=$1(f,d,r,h,s,o+h)}catch(A){p=su(A,s,h,p)}if(t[h]===void 0){delete t[h];continue}l=!0}else if(r==="$rename"){let A=new zH(`${o}${h}.$rename`);try{t[h]=$1(A,d,r,h,s,o+h)}catch(M){p=su(M,s,h,p)}if(t[h]===void 0){delete t[h];continue}l=!0}else{let A=o+h,M=e._getPathType(A),O=u;if(M?.schema&&O==null)O=M.schema.options.strict;if(M.pathType==="undefined"){if(O==="throw")throw new WH(A);else if(O){delete t[h];continue}}l|=XH(e,d,r,n,s,i,o+h)||fn.isObject(d)&&fn.hasOwnKeys(d)===!1}}else{let A=!w&&f==null&&(h==="$each"||h==="$or"||h==="$and"||h==="$in"),M=A?o:_;if(A)f=e._getSchema(M);if(r!=="$setOnInsert"&&HH(f,u,t,h,o+h,n,s))continue;let O=e._getPathType(M);if(f==null){let P=K4(e,t,i,M,n);if(P.schematype!=null)f=P.schematype,O=P.type}let x=u;if(O?.schema&&u==null)x=O.schema.options.strict;if(x&&!f&&!/real|nested/.test(O.pathType))if(x==="throw"&&Y3e(e.virtuals,M)==null)throw new WH(o+h);else delete t[h];else{if(r==="$rename"){try{if(t[h]==null)throw new Pf("String",t[h],`${o}${h}.$rename`);let P=new zH(`${o}${h}.$rename`,null,null,e);t[h]=P.castForQuery(null,t[h],s)}catch(P){p=su(P,s,h,p)}continue}try{if(o.length===0||h.indexOf(".")===-1)t[h]=$1(f,d,r,h,s,o+h);else if(x!==!1||f!=null)X3e(t,h,$1(f,d,r,h,s,o+h)),delete t[h]}catch(P){p=su(P,s,h,p)}if(Array.isArray(t[h])&&(r==="$addToSet"||r==="$push")&&h!=="$each"){if(f&&f.embeddedSchemaType&&!f.embeddedSchemaType.$isMongooseArray&&!f.embeddedSchemaType[QH])t[h]={$each:t[h]}}if(t[h]===void 0){delete t[h];continue}l=!0}}}if(p!=null)throw p;return l}/*!
801
- * ignore
802
- */function su(e,t,r,n){let s=t?.modelName!=null?t:t?.model;if(s!=null&&typeof e.setModel==="function")e.setModel(s);if(typeof t!=="object"||!t.options.multipleCastError)throw e;return n=n||new H3e,n.addError(r,e),n}var YH={$pop:1,$inc:1},eAe={$unset:1},J4={$push:1,$addToSet:1,$set:1,$setOnInsert:1};/*!
803
- * ignore
804
- */var JH={$set:1,$setOnInsert:1};function $1(e,t,r,n,s,i){if(!e){if(r in YH)try{return G4(t)}catch{throw new Pf("number",t,i)}return t}if(e.$isMongooseArray&&r in J4&&(fn.isObject(t)||Array.isArray(t))&&!JH[r]){let u=0,a=e;while(a.$isMongooseArray)++u,a=a.embeddedSchemaType;let c=0,l=t;while(Array.isArray(l))++c,l=l[0];let f=u-c;while(c<u)t=[t],++c;let h=e.applySetters(Array.isArray(t)?t:[t],s);for(let d=0;d<f;++d)h=h[0];return h}if(r in eAe)return t;if(r in YH){if(t==null)throw new Pf("number",t,e.path);if(r==="$inc")return e.castForQuery(null,t,s);try{return G4(t)}catch{throw new Pf("number",t,e.path)}}if(r==="$currentDate"){if(typeof t==="object")return{$type:t.$type};return Boolean(t)}if(Y4.has(n))return e.castForQuery(n,t,s);if(JH[r]){let u=t!=null&&e.$isMongooseArray&&e.$fullPath!=null&&!e.$fullPath.match(/\d+$/),a=e[QH]!=null;if(u||a)return e.applySetters(t,s);return e.castForQuery(null,t,s)}return e.castForQuery(null,t,s)}});var rK=g(function(Mxe,tK){var eK=O1();tK.exports=function(t,r,n){if(!Object.keys(n).some(eK))return r.castForQuery(null,n,t);let i=Object.keys(n),o=i.length;while(o--){let u=i[o],a=n[u];if(u==="$not"){if(a&&r&&!r.embeddedSchemaType&&!r.Constructor){let c=Object.keys(a);if(c.length&&eK(c[0]))for(let l of Object.keys(a))a[l]=r.castForQuery(l,a[l],t);else n[u]=r.castForQuery(u,a,t);continue}}else n[u]=r.castForQuery(u,a,t)}return n}});var sK=g(function(xxe,nK){var tAe=qs(),rAe=/^\d+$/;nK.exports=function(t,r,n){let s=t.path(r);if(s!=null)return s;let i=r.split("."),o="",u=!1;for(let a of i){if(u&&rAe.test(a))continue;if(o=o.length===0?a:o+"."+a,s=t.path(o),s?.schema){if(t=s.schema,!u&&s.$isMongooseDocumentArray)u=!0;if(n&&n[o])t=tAe(t.discriminators,n[o])??t;o=""}else if(s?.instance==="Mixed")break}return s}});var Z4=g(function(Pxe,X4){var nAe=qs(),sAe=rK(),iK=ff(),iAe=Co(),oK=sK(),{logicalOperators:oAe}=_f(),uAe=U4(),uK=Oe();X4.exports=function(t){aK(t.options.arrayFilters,t.getUpdate(),t.schema,t.model,t._mongooseOptions,t)};function aK(e,t,r,n,s,i){if(!Array.isArray(e))return;let o=uAe(t),u=r.options.strict;if(s.strict!=null)u=s.strict;if(n?.base.options.strictQuery!=null)u=n.base.options.strictQuery;if(r._userProvidedOptions.strictQuery!=null)u=r._userProvidedOptions.strictQuery;if(s.strictQuery!=null)u=s.strictQuery;cK(e,r,u,o,i)}X4.exports.castArrayFiltersForUpdate=aK;function cK(e,t,r,n,s){let i={};for(let o of e){if(o==null)throw Error(`Got null array filter in ${e}`);let u=Object.keys(o).filter((_)=>o[_]!=null);if(u.length===0)continue;let a=[];for(let _ of u)if(oAe.has(_))cK(o[_],t,r,n,s);else if(_.charAt(0)!=="$")a.push(_);if(a.length===0)continue;let c=a[0],l=c.indexOf("."),f=l===-1?c:c.substring(0,l),h=iAe(n,f);if(h==null)continue;let d=iK(h),p=oK(t,d,i),m=p!=null?p.schema:null;if(m?.discriminators!=null&&o[f+"."+m.options.discriminatorKey])m=nAe(m.discriminators,o[f+"."+m.options.discriminatorKey])||m,i[d]=o[f+"."+m.options.discriminatorKey];for(let _ of a){if(n[_]===null)continue;if(uK.hasOwnKeys(n)===!1)continue;let y=_.indexOf("."),E=y===-1?null:_.substring(y),w;if(E==null||m==null)w=p;else E=iK(E),w=oK(m,E,i);if(w==null){if(!r)continue;let b=E==null?d+".0":d+".0"+E;throw Error(`Could not find path "${b}" in schema`)}if(typeof o[_]==="object")o[_]=sAe(s,w,o[_]);else o[_]=w.castForQuery(null,o[_])}}}});var b2=g(function(Bxe,lK){lK.exports=function(t,r,n){if(!n||!r?.upsert)return;if(r.overwrite){if(!Bf(t,n))t[n]=0}else if(!Bf(t,n)&&!Bf(t?.$set,n)&&!Bf(t?.$inc,n)&&!Bf(t?.$setOnInsert,n)){if(!t.$setOnInsert)t.$setOnInsert={};t.$setOnInsert[n]=0}};function Bf(e,t){if(e==null||typeof e!=="object")return!1;return Object.hasOwn(e,t)}});var eO=g(function(Fxe,fK){var aAe=gr();fK.exports=function(e,t,r,n,s,i){let o=n?.setDefaultsOnInsert??s?.setDefaultsOnInsert??t.base.options.setDefaultsOnInsert;if(!n.upsert||o===!1)return r;let u=Object.keys(r||{}),a=Object.create(null),c={},l=u.length,f=!1;for(let p=0;p<l;++p)if(u[p].charAt(0)==="$"){f=!0;break}let h=Object.keys(e),d=h.length;for(let p=0;p<d;++p){let m=h[p],_=e[m];if(_&&typeof _==="object"){let w=Object.keys(_),b=w.length,A=!1;for(let M=0;M<b;++M)if(w[M].charAt(0)==="$"){A=!0;break}if(A)continue}if(a[m]=!0,m.indexOf(".")===-1)continue;let y=t.paths[m]?t.paths[m].splitPath():m.split("."),E=y[0];for(let w=1;w<y.length;++w)a[E]=!0,E+="."+y[w]}if(n?.overwrite&&!f)return r;return t.eachPath(function(p,m){if(m.path==="_id"&&m.options.auto)return;let _=m.getDefault(null,!0,{context:i});if(typeof _>"u")return;let y=m.splitPath();if(y.includes("$*"))return;if(cAe(r,a,p,y,f))return;if(r=r||{},r.$setOnInsert=r.$setOnInsert||{},aAe(r,p)==null)r.$setOnInsert[p]=_;c[p]=_}),r};function cAe(e,t,r,n,s){if(t[r])return!0;let i=n[0];for(let o=1;o<n.length;++o){if(t[i])return!0;i+="."+n[o]}if(s){for(let o in e)if(o.charAt(0)==="$"){if(hK(e[o],r,n))return!0}}else if(hK(e,r,n))return!0;return!1}function hK(e,t,r){if(e==null||typeof e!=="object")return!1;if(Object.hasOwn(e,t))return!0;let n=r[0];for(let i=1;i<r.length;++i){if(Object.hasOwn(e,n))return!0;n+="."+r[i]}let s=t+".";for(let i in e)if(i.startsWith(s))return!0;return!1}});var tO=g(function(Nxe,Mr){var lAe=Le(),hAe=_i(),dK=CA(),pK=DA(),fAe=nc(),mK=Q4(),{castArrayFiltersForUpdate:yK}=Z4(),D2=Zt(),gK=b2(),{inspect:dAe}=G("util"),_K=eO();Mr.exports=function(t,r,n){let s,i=t.schema.get("timestamps");if(typeof i?.currentTime==="function")s=i.currentTime();else s=t.base.now();if(r.insertOne)return(o)=>Mr.exports.castInsertOne(t,r.insertOne,n).then(()=>o(null),(u)=>o(u));else if(r.updateOne)return(o)=>{try{Mr.exports.castUpdateOne(t,r.updateOne,n,s),o(null)}catch(u){o(u)}};else if(r.updateMany)return(o)=>{try{Mr.exports.castUpdateMany(t,r.updateMany,n,s),o(null)}catch(u){o(u)}};else if(r.replaceOne)return(o)=>{Mr.exports.castReplaceOne(t,r.replaceOne,n).then(()=>o(null),(u)=>o(u))};else if(r.deleteOne)return(o)=>{try{Mr.exports.castDeleteOne(t,r.deleteOne),o(null)}catch(u){o(u)}};else if(r.deleteMany)return(o)=>{try{Mr.exports.castDeleteMany(t,r.deleteMany),o(null)}catch(u){o(u)}};else return(o)=>{let u=new lAe(`Invalid op passed to \`bulkWrite()\`: ${dAe(r)}`);o(u,null)}};Mr.exports.castInsertOne=async function(t,r,n){let s=k1(t,r.document),i=new s(r.document);if(s.schema.options.timestamps&&T2(r,n))i.initializeTimestamps();if(n.session!=null)i.$session(n.session);let o=s?.schema?.options?.versionKey;if(o&&i[o]==null)i[o]=0;if(r.document=i,n.skipValidation||r.skipValidation)return r;return await r.document.$validate(),r};Mr.exports.castUpdateOne=function(t,r,n,s){if(!r.filter)throw Error("Must provide a filter object.");if(!r.update)throw Error("Must provide an update object.");let i=k1(t,r.filter),o=i.schema,u=n.strict??i.schema.options.strict,a=D2(r.update);Nf(o,r.filter);let c=T2(r,n);if(i.schema.$timestamps!=null&&c){let h=i.schema.$timestamps.createdAt,d=i.schema.$timestamps.updatedAt;pK(s,h,d,a,{timestamps:r.timestamps,overwriteImmutable:r.overwriteImmutable},r.upsert)}if(c)dK(s,a,i.schema);let l=t.base.options.setDefaultsOnInsert;if((r.setDefaultsOnInsert??l)!==!1)_K(r.filter,i.schema,a,{setDefaultsOnInsert:!0,upsert:r.upsert});if(gK(a,r,i.schema.options.versionKey),r.filter=Ff(i,r.filter,{strict:u,upsert:r.upsert}),Array.isArray(r.arrayFilters))r.arrayFilters=D2(r.arrayFilters),yK(r.arrayFilters,a,o,i,n);return r.update=mK(i.schema,a,{strict:u,upsert:r.upsert,arrayFilters:r.arrayFilters,overwriteDiscriminatorKey:r.overwriteDiscriminatorKey,overwriteImmutable:r.overwriteImmutable},i,r.filter),r};Mr.exports.castUpdateMany=function(t,r,n,s){if(!r.filter)throw Error("Must provide a filter object.");if(!r.update)throw Error("Must provide an update object.");let i=k1(t,r.filter),o=i.schema,u=n.strict??i.schema.options.strict,a=D2(r.update),c=t.base.options.setDefaultsOnInsert;if((r.setDefaultsOnInsert??c)!==!1)_K(r.filter,i.schema,a,{setDefaultsOnInsert:!0,upsert:r.upsert});let f=T2(r,n);if(i.schema.$timestamps!=null&&f){let h=i.schema.$timestamps.createdAt,d=i.schema.$timestamps.updatedAt;pK(s,h,d,a,{timestamps:r.timestamps,overwriteImmutable:r.overwriteImmutable},r.upsert)}if(f)dK(s,a,i.schema);if(Nf(o,r.filter),gK(a,r,i.schema.options.versionKey),r.filter=Ff(i,r.filter,{strict:u,upsert:r.upsert}),Array.isArray(r.arrayFilters))r.arrayFilters=D2(r.arrayFilters),yK(r.arrayFilters,a,o,i,n);r.update=mK(i.schema,a,{strict:u,upsert:r.upsert,arrayFilters:r.arrayFilters,overwriteDiscriminatorKey:r.overwriteDiscriminatorKey,overwriteImmutable:r.overwriteImmutable},i,r.filter)};Mr.exports.castReplaceOne=async function(t,r,n){let s=k1(t,r.filter),i=s.schema,o=n.strict??s.schema.options.strict;Nf(i,r.filter),r.filter=Ff(s,r.filter,{strict:o,upsert:r.upsert});let u=new s(r.replacement,o,{skipId:!0});if(s.schema.options.timestamps&&T2(r,n))u.initializeTimestamps();if(n.session!=null)u.$session(n.session);let a=s?.schema?.options?.versionKey;if(a&&u[a]==null)u[a]=0;if(r.replacement=u,n.skipValidation||r.skipValidation){r.replacement=r.replacement.toBSON();return}await r.replacement.$validate(),r.replacement=r.replacement.toBSON()};Mr.exports.castDeleteOne=function(t,r){let n=k1(t,r.filter),s=n.schema;Nf(s,r.filter),r.filter=Ff(n,r.filter)};Mr.exports.castDeleteMany=function(t,r){let n=k1(t,r.filter),s=n.schema;Nf(s,r.filter),r.filter=Ff(n,r.filter)};Mr.exports.cast={insertOne:Mr.exports.castInsertOne,updateOne:Mr.exports.castUpdateOne,updateMany:Mr.exports.castUpdateMany,replaceOne:Mr.exports.castReplaceOne,deleteOne:Mr.exports.castDeleteOne,deleteMany:Mr.exports.castDeleteMany};function Ff(e,t,r){try{return fAe(e.schema,t,r)}catch(n){if(typeof n.setModel==="function")n.setModel(e);throw n}}function Nf(e,t){if(e==null)return;if(e.discriminatorMapping&&!e.discriminatorMapping.isRoot)t[e.discriminatorMapping.key]=e.discriminatorMapping.value}function k1(e,t){let r=e.schema.options.discriminatorKey;if(t!=null&&Object.hasOwn(t,r))e=hAe(e.discriminators,t[r])||e;return e}function T2(e,t){let r=e.timestamps,n=t.timestamps;if(r!=null)return r;else if(n!=null)return n;return!0}});var rO=g(function(Ixe,EK){EK.exports=function(t,r,n){return t.mongoose=t.mongoose||{},t.mongoose.validationErrors=r,t.mongoose.results=n,t}});var iO=g(function(Rxe,bK){/*!
805
- * Module dependencies.
806
- */var pAe=J6(),sO=G("events").EventEmitter,mAe=ec(),Ze=w2(),AK=R4(),Dt=$s(),yAe=_3(),gAe=EH(),_Ae=v4(),EAe=Zt(),wK=C2(),AAe=gr(),OAe=q4(),OK=Co(),SAe=Ou(),q1=Oe(),wAe=CH(),Aa=tO(),{modelSymbol:M2}=le(),CAe=U3(),nO=rO(),bAe=le().arrayAtomicsSymbol,If=le().sessionNewDocuments,DAe=globalThis.Date,TAe=["MONGODB-X509"];function de(e){if(this.base=e,this.collections={},this.models={},this.config={},this.replica=!1,this.options=null,this.otherDbs=[],this.relatedDbs={},this.states=Ze,this._readyState=Ze.disconnected,this._closeCalled=!1,this._hasOpened=!1,this.plugins=[],typeof e>"u"||!e.connections.length)this.id=0;else this.id=e.nextConnectionId;this._queue=[]}/*!
807
- * Inherit from EventEmitter
808
- */Object.setPrototypeOf(de.prototype,sO.prototype);Object.defineProperty(de.prototype,"readyState",{get:function(){if(this._readyState===Ze.connected&&this._lastHeartbeatAt!=null&&this.client?.topology?.s?.description?.type!=="LoadBalanced"&&typeof this.client?.topology?.s?.description?.heartbeatFrequencyMS==="number"&&DAe.now()-this._lastHeartbeatAt>=this.client.topology.s.description.heartbeatFrequencyMS*2)return Ze.disconnected;return this._readyState},set:function(e){if(!(e in Ze))throw new Dt("Invalid connection state: "+e);if(this._readyState!==e){this._readyState=e;for(let t of this.otherDbs)t.readyState=e;if(Ze.connected===e)this._hasOpened=!0;this.emit(Ze[e])}}});de.prototype.get=function(t){if(Object.hasOwn(this.config,t))return this.config[t];return AAe(this.options,t)};de.prototype.set=function(t,r){if(Object.hasOwn(this.config,t))return this.config[t]=r,r;return this.options=this.options||{},this.options[t]=r,r};de.prototype.collections;de.prototype.name;de.prototype.models;de.prototype.id;Object.defineProperty(de.prototype,"plugins",{configurable:!1,enumerable:!0,writable:!0});Object.defineProperty(de.prototype,"host",{configurable:!0,enumerable:!0,writable:!0});Object.defineProperty(de.prototype,"port",{configurable:!0,enumerable:!0,writable:!0});Object.defineProperty(de.prototype,"user",{configurable:!0,enumerable:!0,writable:!0});Object.defineProperty(de.prototype,"pass",{configurable:!0,enumerable:!0,writable:!0});de.prototype.db;de.prototype.client;de.prototype.config;de.prototype.createCollection=async function(t,r){if(typeof r==="function"||arguments.length>=3&&typeof arguments[2]==="function")throw new Dt("Connection.prototype.createCollection() no longer accepts a callback");return await this._waitForConnect(),this.db.createCollection(t,r)};de.prototype.bulkWrite=async function(t,r){await this._waitForConnect(),r=r||{};let n=r.ordered==null?!0:r.ordered,s=this.base.transactionAsyncLocalStorage?.getStore();if((!r||!Object.hasOwn(r,"session"))&&s?.session!=null)r={...r,session:s.session};let i=this.base.now(),o=null;if(n){let u=[];for(let a of t){if(typeof a.model!=="string"&&!a.model?.[M2])throw new Dt("Must specify model in Connection.prototype.bulkWrite() operations");let c=a.model[M2]?a.model:this.model(a.model);if(a.name==null)throw new Dt("Must specify operation name in Connection.prototype.bulkWrite()");if(!Object.hasOwn(Aa.cast,a.name))throw new Dt(`Unrecognized bulkWrite() operation name ${a.name}`);await Aa.cast[a.name](c,a,r,i),u.push({...a,namespace:c.namespace()})}o=await this.client.bulkWrite(u,r)}else{let u=[],a=[],c=[],l=[],f=[];for(let d=0;d<t.length;++d){let p=t[d];if(typeof p.model!=="string"&&!p.model?.[M2]){let y=new Dt("Must specify model in Connection.prototype.bulkWrite() operations");c.push({index:d,error:y}),f[d]=y;continue}let m;try{m=p.model[M2]?p.model:this.model(p.model)}catch(y){c.push({index:d,error:y});continue}if(p.name==null){let y=new Dt("Must specify operation name in Connection.prototype.bulkWrite()");c.push({index:d,error:y}),f[d]=y;continue}if(!Object.hasOwn(Aa.cast,p.name)){let y=new Dt(`Unrecognized bulkWrite() operation name ${p.name}`);c.push({index:d,error:y}),f[d]=y;continue}let _=null;try{_=Aa.cast[p.name](m,p,r,i)}catch(y){c.push({index:d,error:y}),f[d]=y;continue}if(CAe(_))l.push(_.then(()=>{u.push({...p,namespace:m.namespace()}),a.push(d)},(y)=>{c.push({index:d,error:y}),f[d]=y}));else u.push({...p,namespace:m.namespace()}),a.push(d)}if(l.length>0)await Promise.all(l);if(c=c.sort((d,p)=>d.index-p.index).map((d)=>d.error),u.length===0){if(r.throwOnValidationError&&c.length)throw new AK(c,f,o,"bulkWrite");let p=new(this.base.driver.get()).BulkWriteResult(OAe(),!1);return nO(p,c,f)}let h;[o,h]=await this.client.bulkWrite(u,r).then((d)=>[d,null]).catch((d)=>[null,d]);for(let d=0;d<a.length;++d)f[a[d]]=null;if(h){if(h.writeErrors?.forEach((d,p)=>{f[a[p]]=d}),c.length>0)nO(h,c,f),h.mongoose=h.mongoose||{},h.mongoose.validationErrors=c;throw h}if(c.length>0)if(r.throwOnValidationError)throw new AK(c,f,o,"bulkWrite");else nO(o,c,f)}return o};de.prototype.createCollections=async function(t={}){let r={},n={},{continueOnError:s}=t;delete t.continueOnError;for(let i of Object.values(this.models))try{r[i.modelName]=await i.createCollection({})}catch(o){if(!s){n[i.modelName]=o;break}else r[i.modelName]=o}if(!s&&q1.hasOwnKeys(n)){let i=Object.entries(n).map(([u,a])=>`${u}: ${a.message}`).join(", ");throw new wAe(i,n)}return r};de.prototype.withSession=async function(t){if(arguments.length===0)throw new Dt("Please provide an executor function");return await this.client.withSession(t)};de.prototype.startSession=async function(t){if(arguments.length>=2&&typeof arguments[1]==="function")throw new Dt("Connection.prototype.startSession() no longer accepts a callback");return await this._waitForConnect(),this.client.startSession(t)};de.prototype.transaction=function(t,r){return this.startSession().then((n)=>(n[If]=new Map,n.withTransaction(()=>MAe(t,n,this.base),r).then((s)=>(delete n[If],s)).catch((s)=>{throw delete n[If],s}).finally(()=>{n.endSession().catch(()=>{})})))};/*!
809
- * Reset document state in between transaction retries re: gh-13698
810
- */async function MAe(e,t,r){SK(t);try{return r.transactionAsyncLocalStorage==null?await e(t):await new Promise((s)=>{r.transactionAsyncLocalStorage.run({session:t},()=>s(e(t)))})}catch(n){throw SK(t),n}}/*!
811
- * If transaction was aborted, we need to reset newly inserted documents' `isNew`.
812
- */function SK(e){for(let t of e[If].keys()){let r=e[If].get(t);if(Object.hasOwn(r,"isNew"))t.$isNew=r.isNew;if(Object.hasOwn(r,"versionKey"))t.set(t.schema.options.versionKey,r.versionKey);if(Object.hasOwn(r,"isDeleted"))t.$isDeleted(r.isDeleted);for(let n of r.modifiedPaths)t.$__.activePaths.modify(n);for(let n of r.atomics.keys()){let s=t.$__getValue(n);if(s==null)continue;s[bAe]=r.atomics.get(n)}}}de.prototype.dropCollection=async function(t){if(arguments.length>=2&&typeof arguments[1]==="function")throw new Dt("Connection.prototype.dropCollection() no longer accepts a callback");return await this._waitForConnect(),this.db.dropCollection(t)};de.prototype._waitForConnect=async function(t){if((this.readyState===Ze.connecting||this.readyState===Ze.disconnected)&&this._shouldBufferCommands()){let r=this._getBufferTimeoutMS(),n=null,s=!1,i={},o=new Promise((u)=>{i.fn=u,this._queue.push(i)});if(t)await o;else await Promise.race([o,new Promise((u)=>{n=setTimeout(()=>{s=!0,u()},r)})]);if(s){let u=this._queue.indexOf(i);if(u!==-1)this._queue.splice(u,1);let a="Connection operation buffering timed out after "+r+"ms";throw new Dt(a)}else if(n!=null)clearTimeout(n)}};/*!
813
- * Get the default buffer timeout for this connection
814
- */de.prototype._getBufferTimeoutMS=function(){if(this.config.bufferTimeoutMS!=null)return this.config.bufferTimeoutMS;if(this.base?.get("bufferTimeoutMS")!=null)return this.base.get("bufferTimeoutMS");return 1e4};de.prototype.listCollections=async function(){return await this._waitForConnect(),await this.db.listCollections().toArray()};de.prototype.listDatabases=async function(){throw new Dt("listDatabases() not implemented by driver")};de.prototype.dropDatabase=async function(){if(arguments.length>=1&&typeof arguments[0]==="function")throw new Dt("Connection.prototype.dropDatabase() no longer accepts a callback");await this._waitForConnect();for(let t of Object.values(this.models))delete t.$init;return this.db.dropDatabase()};/*!
815
- * ignore
816
- */de.prototype._shouldBufferCommands=function(){if(this.config.bufferCommands!=null)return this.config.bufferCommands;if(this.base.get("bufferCommands")!=null)return this.base.get("bufferCommands");return!0};de.prototype.error=function(t,r){if(r)return r(t),null;if(this.listeners("error").length>0)this.emit("error",t);return Promise.reject(t)};de.prototype.onOpen=function(){this.readyState=Ze.connected,this._flushQueue();for(let e in this.collections)if(Object.hasOwn(this.collections,e))this.collections[e].onOpen();this.emit("open")};de.prototype._flushQueue=function(){let t=this._queue;this._queue=[];for(let r of t)r.fn.apply(r.ctx,r.args)};de.prototype.openUri=async function(t,r){if(this.readyState===Ze.connecting||this.readyState===Ze.connected){if(this._connectionString===t)return this}this._closeCalled=!1;let n=!1;if(r&&"_fireAndForget"in r)n=r._fireAndForget,delete r._fireAndForget;try{xAe.apply(arguments)}catch(s){if(n)throw s;throw this.$initialConnection=Promise.reject(s),s}this.$initialConnection=this.createClient(t,r).then(()=>this).catch((s)=>{if(this.readyState=Ze.disconnected,this.listeners("error").length>0)SAe(()=>this.emit("error",s));throw s});for(let s of Object.values(this.models))s.init().catch(function(){});if(n)return this;try{await this.$initialConnection}catch(s){throw CK(s)}return this};de.prototype.on=function(t,r){if(t==="error"&&this.$initialConnection)this.$initialConnection.catch(()=>{});return sO.prototype.on.call(this,t,r)};de.prototype.once=function(t,r){if(t==="error"&&this.$initialConnection)this.$initialConnection.catch(()=>{});return sO.prototype.once.call(this,t,r)};/*!
817
- * ignore
818
- */function xAe(e,t,r){if(typeof t==="function"&&r==null)throw new Dt("Connection.prototype.openUri() no longer accepts a callback");else if(typeof r==="function")throw new Dt("Connection.prototype.openUri() no longer accepts a callback")}/*!
819
- * ignore
820
- */function CK(e){if(e?.name==="MongoServerSelectionError"){let t=e;e=new yAe,e.assimilateError(t)}return e}de.prototype.destroy=async function(t){if(typeof t==="function"||arguments.length===2&&typeof arguments[1]==="function")throw new Dt("Connection.prototype.destroy() no longer accepts a callback");if(t!=null&&typeof t==="object")this.$wasForceClosed=!!t.force;else this.$wasForceClosed=!!t;return this._close(t,!0)};de.prototype.close=async function(t){if(typeof t==="function"||arguments.length===2&&typeof arguments[1]==="function")throw new Dt("Connection.prototype.close() no longer accepts a callback");if(t!=null&&typeof t==="object")this.$wasForceClosed=!!t.force;else this.$wasForceClosed=!!t;if(this._lastHeartbeatAt!=null)this._lastHeartbeatAt=null;for(let r of Object.values(this.models))delete r.$init;return this._close(t,!1)};de.prototype._close=async function(t,r){let n=this,s=this._closeCalled;if(this._closeCalled=!0,this._destroyCalled=r,this.client!=null)this.client._closeCalled=!0,this.client._destroyCalled=r;let i=this;switch(this.readyState){case Ze.disconnected:if(r){let o=this.base.connections.indexOf(i);if(o!==-1)this.base.connections.splice(o,1)}if(!s)await this.doClose(t),this.onClose(t);break;case Ze.connected:if(this.readyState=Ze.disconnecting,await this.doClose(t),r){let o=n.base.connections.indexOf(i);if(o!==-1)this.base.connections.splice(o,1)}this.onClose(t);break;case Ze.connecting:return new Promise((o,u)=>{let a=()=>{if(this.removeListener("open",a),this.removeListener("error",a),r)this.destroy(t).then(o,u);else this.close(t).then(o,u)};this.once("open",a),this.once("error",a)});case Ze.disconnecting:return new Promise((o)=>{this.once("close",()=>{if(r&&this.base.connections.indexOf(i)!==-1)this.base.connections.splice(this.base.connections.indexOf(i),1);o()})})}return this};de.prototype.doClose=function(){throw new Dt("Connection#doClose unimplemented by driver")};de.prototype.onClose=function(t){this.readyState=Ze.disconnected;for(let n in this.collections)if(Object.hasOwn(this.collections,n))this.collections[n].onClose(t);this.emit("close",t);let r=typeof t==="object"&&t!==null?t.force:t;for(let n of this.otherDbs)this._destroyCalled?n.destroy({force:r,skipCloseClient:!0}):n.close({force:r,skipCloseClient:!0})};de.prototype.collection=function(e,t){let r={autoIndex:this.config.autoIndex??this.base.options.autoIndex,autoCreate:this.config.autoCreate??this.base.options.autoCreate,autoSearchIndex:this.config.autoSearchIndex??this.base.options.autoSearchIndex};t=Object.assign({},r,t?EAe(t):{}),t.$wasForceClosed=this.$wasForceClosed;let n=this.base?.__driver?.Collection||wK.get().Collection;if(!(e in this.collections))this.collections[e]=new n(e,this,t);return this.collections[e]};de.prototype.plugin=function(e,t){return this.plugins.push([e,t]),this};de.prototype.model=function(t,r,n,s){if(!(this instanceof de))throw new Dt("`connection.model()` should not be run with `new`. If you are doing `new db.model(foo)(bar)`, use `db.model(foo)(bar)` instead");let i;if(typeof t==="function")i=t,t=i.name;if(typeof r==="string")n=r,r=!1;if(q1.isObject(r)){if(!r.instanceOfSchema)r=new mAe(r);else if(!(r instanceof this.base.Schema))r=r._clone(this.base.Schema)}if(r&&!r.instanceOfSchema)throw new Dt("The 2nd parameter to `mongoose.model()` should be a schema or a POJO");let o={cache:!1,overwriteModels:this.base.options.overwriteModels},u=Object.assign(o,s,{connection:this}),a=OK(this.models,t);if(a&&!n&&u.overwriteModels!==!0){if(r?.instanceOfSchema&&r!==a.schema)throw new Dt.OverwriteModelError(t);return a}let c;if(r?.instanceOfSchema){if(_Ae(r,this.plugins,null,"$connectionPluginsApplied"),c=this.base._model(i||t,r,n,u),!OK(this.models,t))this.models[t]=c;return c.init().catch(function(){}),c}if(a&&n)return c=a,r=c.prototype.schema,c.__subclass(this,r,n);if(arguments.length===1){if(c=a,!c)throw new Dt.MissingSchemaError(t);return c}if(!c)throw new Dt.MissingSchemaError(t);if(this===c.prototype.db&&(!n||n===c.collection.name)){if(!this.models[t])this.models[t]=c;return c}return this.models[t]=c.__subclass(this,r,n),this.models[t]};de.prototype.deleteModel=function(t){if(typeof t==="string"){let r=this.model(t);if(r==null)return this;let n=r.collection.name;delete this.models[t],delete this.collections[n],this.emit("deleteModel",r)}else if(t instanceof RegExp){let r=t,n=this.modelNames();for(let s of n)if(r.test(s))this.deleteModel(s)}else throw new Dt('First parameter to `deleteModel()` must be a string or regexp, got "'+t+'"');return this};de.prototype.watch=function(t,r){let n=this._waitForConnect().then(()=>this.db.watch(t,r));return new pAe(n,t,r)};de.prototype.asPromise=async function(){try{return await this.$initialConnection,this}catch(t){throw CK(t)}};de.prototype.modelNames=function(){return Object.keys(this.models)};de.prototype.shouldAuthenticate=function(){return this.user!=null&&(this.pass!=null||this.authMechanismDoesNotRequirePassword())};de.prototype.authMechanismDoesNotRequirePassword=function(){if(this.options?.auth)return TAe.indexOf(this.options.auth.authMechanism)>=0;return!0};de.prototype.optionsProvideAuthenticationData=function(t){return t&&t.user&&(t.pass||this.authMechanismDoesNotRequirePassword())};de.prototype.getClient=function(){return this.client};de.prototype.setClient=function(){throw new Dt("Connection#setClient not implemented by driver")};/*!
821
- * Called internally by `openUri()` to create a MongoClient instance.
822
- */de.prototype.createClient=function(){throw new Dt("Connection#createClient not implemented by driver")};de.prototype.syncIndexes=async function(t={}){let r={},n={},{continueOnError:s}=t;delete t.continueOnError;for(let i of Object.values(this.models))try{r[i.modelName]=await i.syncIndexes(t)}catch(o){if(!s){n[i.modelName]=o;break}else r[i.modelName]=o}if(!s&&q1.hasOwnKeys(n)){let i=Object.entries(n).map(([u,a])=>`${u}: ${a.message}`).join(", ");throw new gAe(i,n)}return r};/*!
823
- * Module exports.
824
- */de.STATES=Ze;bK.exports=de});var oO=g(function($xe,PAe){PAe.exports={name:"mongoose",description:"Mongoose MongoDB ODM",version:"9.13.2",author:"Guillermo Rauch <guillermo@learnboost.com>",keywords:["mongodb","document","model","schema","database","odm","data","datastore","query","nosql","orm","db"],type:"commonjs",license:"MIT",dependencies:{"@standard-schema/spec":"^1.1.0",kareem:"3.4.1",mongodb:"~7.9",mpath:"0.9.0",mquery:"6.0.1",ms:"2.1.3",sift:"17.1.4"},devDependencies:{"@ark/attest":"0.58.1","@eslint/js":"^9.39.3","@mongodb-js/mongodb-downloader":"^3.0.5","@types/node":"^20.19.0",acquit:"1.4.0","acquit-ignore":"0.2.2","acquit-require":"0.1.1",ajv:"8.20.0",c8:"12.0.0",cheerio:"1.2.0",dox:"1.0.0",eslint:"10.16.0","eslint-plugin-mocha-no-only":"1.2.0",express:"5.3.0","fs-extra":"~11.4.0",globals:"^17.4.0","highlight.js":"11.12.0",linkinator:"8.x","lodash.isequal":"4.5.0","lodash.isequalwith":"4.4.0","markdownlint-cli2":"0.24.2",marked:"18.3.0",mkdirp:"^3.0.1",mocha:"12.0.3",moment:"2.31.0","mongodb-client-encryption":"^7.2.0","mongodb-memory-server":"11.4.0","mongodb-runner":"^6.0.0",ncp:"^2.0.0",pug:"3.0.4",sinon:"22.1.0",tstyche:"^7.0.0",typescript:"5.9.3","typescript-eslint":"^8.31.1",uuid:"14.0.3",xss:"1.0.17"},directories:{lib:"./lib/mongoose"},scripts:{"docs:clean":"npm run docs:clean:stable","docs:clean:stable":"rm -rf index.html && rm -rf ./docs/*.html && rm -rf ./docs/api && rm -rf ./docs/tutorials/*.html && rm -rf ./docs/typescript/*.html && rm -rf ./docs/production/*.html && rm -rf ./docs/*.html && rm -rf ./docs/source/_docs && rm -rf ./tmp","docs:clean:5x":"rm -rf index.html && rm -rf ./docs/5.x && rm -rf ./docs/source/_docs && rm -rf ./tmp","docs:clean:6x":"rm -rf index.html && rm -rf ./docs/6.x && rm -rf ./docs/source/_docs && rm -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/production && 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/production ./tmp/docs/production && ncp ./docs/api ./tmp/docs/api && cp index.html ./tmp && cp docs/*.html ./tmp/docs/","docs:copy:tmp:5x":"rm -rf ./docs/5.x && ncp ./tmp ./docs/5.x","docs:copy:tmp:6x":"rm -rf ./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 && env GENERATE_SEARCH=true 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 && rm -rf ./docs/7.x && mv ./tmp ./docs/7.x","docs:prepare:publish:8x":"env DOCS_DEPLOY=true npm run docs:generate && git checkout gh-pages && rm -rf ./docs/8.x && mv ./tmp ./docs/8.x","docs:check-links":'linkinator http://127.0.0.1:8089 --silent --recurse --skip cdn.carbonads.com --skip m.servedby-buysellads.com --skip "127\\.0\\.0\\.1:8089/docs/\\d+.x"',"docs:update-mongodb-links":"node ./scripts/update-mongodb-links.js",checkLibCharset:"node ./scripts/checkLibCharset.js",lint:"eslint .","lint-js":"eslint . --ext .js --ext .cjs","lint-ts":"eslint . --ext .ts","lint-md":'markdownlint-cli2 "docs/**/*.md" "docs/*.md" "*.md"',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 --ignore "test/encryption/**/*.test.js" "./test/**/*.test.js"',"test:ci":"npm run test -- --reporter min --timeout 10000","test-deno":"deno run --allow-env --allow-read --allow-net --allow-run --allow-sys --allow-write ./test/deno.mjs","test-deno:ci":"npm run test-deno -- --reporter min","test-rs":'START_REPLICA_SET=1 mocha --timeout 30000 --exit --ignore "test/encryption/**/*.test.js" "./test/**/*.test.js"',"test-rs:ci":"npm run test-rs -- --reporter min","test:types":"tstyche","setup-test-encryption":"node scripts/setup-encryption-tests.js","test-encryption":"mocha --exit ./test/encryption/*.test.js","test-encryption:ci":"npm run test-encryption -- --reporter min",tdd:'mocha --watch --inspect --ignore "test/encryption/**/*.test.js" "./test/**/*.test.js" --watch-files lib/**/*.js test/**/*.js',"test-coverage":"c8 --reporter=html --reporter=text npm test","test-coverage:ci":"c8 --reporter=html --reporter=text npm run test:ci","ts-benchmark":"cd ./benchmarks/typescript/simple && npm install && npm run benchmark | node ../../../scripts/tsc-diagnostics-check","ts-benchmark:local":"node ./scripts/create-tarball && cd ./benchmarks/typescript/simple && rm -rf ./node_modules && 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"}}});var TK=g(function(vxe,DK){var BAe=Zt(),FAe=$s();function NAe(e,t){let r=t?t:{},n=r.readPreference?vAe(r.readPreference):kAe(e),s=BAe(r);return n&&n!=="primary"&&n!=="primaryPreferred"?IAe(n,s):s}function IAe(e,t){if(RAe(t)&&$Ae(e))jAe();else return qAe(t)}function RAe(e){let t=e.config?.autoIndex,{autoCreate:r,autoIndex:n}=e;return!!(t||r||n)}function $Ae(e){return e==="secondary"||e==="secondaryPreferred"}function vAe(e){return typeof e==="string"?e:e.mode}function kAe(e){let r=/(?:&|\?)readPreference=(\w+)(?:&|$)/.exec(e);return r?r[1]:null}function qAe(e){return e.config={autoIndex:!1},e.autoCreate=!1,e.autoIndex=!1,e}function jAe(){throw new FAe('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')}DK.exports=NAe});var MK=g(function(LAe){LAe.setTimeout=setTimeout});var BK=g(function(qxe,PK){/*!
825
- * Module dependencies.
826
- */var x2=iO(),ac=$s(),Ot=w2(),P2=Iu(),xK=oO(),VAe=TK(),zAe=MK().setTimeout,Bo=Oe(),WAe=ec(),HAe=globalThis.Date;function Ki(){x2.apply(this,arguments),this._listening=!1,this._lastHeartbeatAt=null}Ki.STATES=Ot;/*!
827
- * Inherits from Connection.
828
- */Object.setPrototypeOf(Ki.prototype,x2.prototype);Ki.prototype.useDb=function(e,t){if(t=t||{},t.useCache&&this.relatedDbs[e])return this.relatedDbs[e];let r=new this.constructor;r.name=e,r.base=this.base,r.collections={},r.models={},r.replica=this.replica,r.config=Object.assign({},this.config,r.config),r.name=this.name,r.options=this.options,r._readyState=this._readyState,r._closeCalled=this._closeCalled,r._hasOpened=this._hasOpened,r._listening=!1,r._parent=this,r.host=this.host,r.port=this.port,r.user=this.user,r.pass=this.pass;let n=this;if(r.client=n.client,this.db&&this._readyState===Ot.connected)s();else this._queue.push({fn:s});function s(){r.client=n.client,r.db=n.client.db(e),r._lastHeartbeatAt=n._lastHeartbeatAt,r.onOpen()}if(r.name=e,this.otherDbs.push(r),r.otherDbs.push(this),t?.useCache)this.relatedDbs[r.name]=r,r.relatedDbs=this.relatedDbs;return r};Ki.prototype.aggregate=function(t,r){return new this.base.Aggregate(null,this).append(t).option(r??{})};Ki.prototype.removeDb=function(t){let r=this.otherDbs.filter((n)=>n.name===t);if(!r.length)throw new ac(`No connections to database "${t}" found`);for(let n of r)n._closeCalled=!0,n._destroyCalled=!0,n._readyState=Ot.disconnected,n.$wasForceClosed=!0;delete this.relatedDbs[t],this.otherDbs=this.otherDbs.filter((n)=>n.name!==t)};Ki.prototype.doClose=async function(t){if(this.client==null)return this;let r=!1;if(t!=null&&typeof t==="object")r=t.skipCloseClient,t=t.force;if(r)return this;return await this.client.close(t),await new Promise((n)=>zAe(n,1)),this};Ki.prototype.listDatabases=async function(){return await this._waitForConnect(),await this.db.admin().listDatabases()};/*!
829
- * ignore
830
- */Ki.prototype.createClient=async function(t,r){if(typeof t!=="string")throw new ac(`The \`uri\` parameter to \`openUri()\` must be a string, got "${typeof t}". Make sure the first parameter to \`mongoose.connect()\` or \`mongoose.createConnection()\` is a string.`);if(this._destroyCalled)throw new ac("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===Ot.connecting||this.readyState===Ot.connected){if(this._connectionString!==t)throw new ac("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(r=VAe(t,r),r){let u=r.config?.autoIndex??r.autoIndex;if(u!=null)this.config.autoIndex=u!==!1,delete r.config,delete r.autoIndex;if("autoCreate"in r)this.config.autoCreate=!!r.autoCreate,delete r.autoCreate;if("sanitizeFilter"in r)this.config.sanitizeFilter=r.sanitizeFilter,delete r.sanitizeFilter;if("autoSearchIndex"in r)this.config.autoSearchIndex=r.autoSearchIndex,delete r.autoSearchIndex;if("bufferTimeoutMS"in r)this.config.bufferTimeoutMS=r.bufferTimeoutMS,delete r.bufferTimeoutMS;if(r.user||r.pass)r.auth=r.auth||{},r.auth.username=r.user,r.auth.password=r.pass,this.user=r.user,this.pass=r.pass;if(delete r.user,delete r.pass,r.bufferCommands!=null)this.config.bufferCommands=r.bufferCommands,delete r.bufferCommands}else r={};this._connectionOptions=r;let n=r.dbName;if(n!=null)this.$dbName=n;if(delete r.dbName,!Bo.hasUserDefinedProperty(r,"driverInfo"))r.driverInfo={name:"Mongoose",version:xK.version};let{schemaMap:s,encryptedFieldsMap:i}=this._buildEncryptionSchemas();if((Bo.hasOwnKeys(s)||Bo.hasOwnKeys(i))&&!r.autoEncryption)throw Error("Must provide `autoEncryption` when connecting with encrypted schemas.");if(Bo.hasOwnKeys(s))r.autoEncryption.schemaMap=s;if(Bo.hasOwnKeys(i))r.autoEncryption.encryptedFieldsMap=i;this.readyState=Ot.connecting,this._connectionString=t;let o;try{o=new P2.MongoClient(t,r)}catch(u){throw this.readyState=Ot.disconnected,u}this.client=o,o.setMaxListeners(0),await o.connect(),uO(this,o,r,n);for(let u of this.otherDbs)uO(u,o,{},u.name);return this};Ki.prototype._buildEncryptionSchemas=function(){let e={},t={},r=Object.values(this.models).filter((i)=>i.schema._hasEncryptedFields());for(let i of r){let{schema:o,collection:{collectionName:u}}=i,a=`${this.$dbName}.${u}`,c=o.encryptionType()==="csfle"?t:e;if(c[a]??=new WAe({},{encryptionType:o.encryptionType()}),o.discriminatorMapping&&!o.discriminatorMapping.isRoot){let f=o._baseSchema;o.eachPath((h)=>{if(f.path(h))return;if(!c[a]._hasEncryptedField(h))return;throw Error(`Cannot have duplicate keys in discriminators with encryption. key=${h}`)})}c[a].add(o)}let n=Object.fromEntries(Object.entries(t).map(([i,o])=>[i,o._buildSchemaMap()])),s=Object.fromEntries(Object.entries(e).map(([i,o])=>[i,o._buildEncryptedFields()]));return{schemaMap:n,encryptedFieldsMap:s}};/*!
831
- * ignore
832
- */Ki.prototype.setClient=function(t){if(!(t instanceof P2.MongoClient))throw new ac("Must call `setClient()` with an instance of MongoClient");if(this.readyState!==Ot.disconnected)throw new ac("Cannot call `setClient()` on a connection that is already connected.");if(t.topology==null)throw new ac("Cannot call `setClient()` with a MongoClient that you have not called `connect()` on yet.");this._connectionString=t.s.url,uO(this,t,{},t.s.options.dbName);for(let r of Object.values(this.models))r.init().catch(function(){});return this};/*!
833
- * ignore
834
- */function uO(e,t,r,n){let s=n!=null?t.db(n):t.db();e.db=s,e.client=t,e.host=t?.s?.options?.hosts?.[0]?.host,e.port=t?.s?.options?.hosts?.[0]?.port,e.name=n!=null?n:s.databaseName,e._closeCalled=t._closeCalled;let i=()=>{if(e.readyState!==Ot.connected)e.readyState=Ot.connected,e.emit("reconnect"),e.emit("reconnected"),e.onOpen()},o=t?.topology?.description?.type||"";if(o==="Single")t.on("serverDescriptionChanged",(u)=>{if(u.newDescription.type==="Unknown")e.readyState=Ot.disconnected;else i()});else if(o.startsWith("ReplicaSet"))t.on("topologyDescriptionChanged",(u)=>{let a=u.newDescription;if(e.readyState===Ot.connected&&a.type!=="ReplicaSetWithPrimary")e.readyState=Ot.disconnected;else if(e.readyState===Ot.disconnected&&a.type==="ReplicaSetWithPrimary")i()});if(e._lastHeartbeatAt=null,t.on("serverHeartbeatSucceeded",()=>{e._lastHeartbeatAt=HAe.now();for(let u of e.otherDbs)u._lastHeartbeatAt=e._lastHeartbeatAt;if(e._queue.length>0&&e.readyState===Ot.connected)e._flushQueue();for(let u of e.otherDbs)if(u._queue.length>0&&u.readyState===Ot.connected)u._flushQueue();for(let u of Object.values(e.collections))if(u.buffer)u.onOpen()}),r.monitorCommands)t.on("commandStarted",(u)=>e.emit("commandStarted",u)),t.on("commandFailed",(u)=>e.emit("commandFailed",u)),t.on("commandSucceeded",(u)=>e.emit("commandSucceeded",u));e.onOpen();for(let u in e.collections)if(Object.hasOwn(e.collections,u))e.collections[u].onOpen()}/*!
835
- * Module exports.
836
- */PK.exports=Ki});var FK=g(function(KAe){/*!
837
- * Module exports.
838
- */KAe.BulkWriteResult=g7();KAe.Collection=qk();KAe.Connection=BK();KAe.ClientEncryption=Iu().ClientEncryption});var IK=g(function(Lxe,NK){/*!
839
- * Valid mongoose options
840
- */var XAe=Object.freeze(["allowDiskUse","applyPluginsToChildSchemas","applyPluginsToDiscriminators","autoCreate","autoIndex","autoSearchIndex","bufferCommands","bufferTimeoutMS","cloneSchemas","createInitialConnection","debug","forceRepopulate","id","maxTimeMS","objectIdGetter","overwriteModels","returnDocument","returnOriginal","runValidators","sanitizeFilter","sanitizeProjection","selectPopulatedPaths","setDefaultsOnInsert","strict","strictPopulate","strictQuery","strictRead","timestamps.createdAt.immutable","toJSON","toObject","transactionAsyncLocalStorage","translateAliases","updatePipeline"]);NK.exports=XAe});var $K=g(function(Uxe,RK){/*!
841
- * Module dependencies.
842
- */var ZAe=Le();class aO extends ZAe{constructor(e){let t=e.map((r)=>r.message).join(", ");if(t.length>50)t=t.slice(0,50)+"...";super(`eachAsync() finished with ${e.length} errors: ${t}`);this.errors=e}}Object.defineProperty(aO.prototype,"name",{value:"EachAsyncMultiError"});/*!
843
- * exports
844
- */RK.exports=aO});var lO=g(function(Vxe,kK){/*!
845
- * Module dependencies.
846
- */var e4e=$K(),cO=Ou();kK.exports=async function(t,r,n){let s=n.parallel||1,{batchSize:i,signal:o,continueOnError:u}=n,a=[],c=t4e(),l=!1;return new Promise((d,p)=>{if(o!=null){if(o.aborted)return d(null);o.addEventListener("abort",()=>(l=!0,d(null)),{once:!0})}if(i!=null){if(typeof i!=="number")throw TypeError("batchSize must be a number");else if(!Number.isInteger(i))throw TypeError("batchSize must be an integer");else if(i<1)throw TypeError("batchSize must be at least 1")}f((m,_)=>{if(m!=null)return p(m);d(_)})});function f(d){let p=0,m=0,_=null;for(let E=0;E<s;++E)c(y());function y(){let E=[],w=!1;return b;function b(A){if(w||l)return A();else if(_)return A();t(function(M,O){if(_!=null)return A();if(M!=null)if(M.name==="MongoCursorExhaustedError")O=null;else if(u)a.push(M);else return _=M,d(M),A();if(O==null){if(w=!0,p<=0){let P=u?vK(a):_;d(P)}else if(i&&E.length)h(E,m++,v);return A()}if(++p,cO(()=>A()),i)E.push(O);if(i&&E.length!==i){cO(()=>c(b));return}let x=i?E:O;function v(P){if(i)p-=E.length,E=[];else--p;if(P!=null)if(u)a.push(P);else return _=P,d(P);if((w||l)&&p<=0){let ge=u?vK(a):_;return d(ge)}cO(()=>c(b))}h(x,m++,v)})}}}function h(d,p,m){let _;try{_=r(d,p)}catch(y){return m(y)}if(typeof _?.then==="function")_.then(function(){m(null)},function(y){m(y||Error("`eachAsync()` promise rejected without error"))});else m(null)}};function t4e(){let e=[],t=null,r=0;return function(i){if(t===null&&e.length===0)return t=r++,i(n);e.push(i)};function n(){if(e.length!==0)t=r++,e.shift()(n);else t=null}}function vK(e){if(e.length===0)return null;return new e4e(e)}});var hO=g(function(zxe,qK){qK.exports=function(t){return new Promise((r)=>{let n=()=>{if(!t._initializationComplete)return;t.removeListener("cursor",n),t.removeListener("error",n),r()};t.on("cursor",n),t.on("error",n)})}});var j1=g(function(Wxe,LK){var B2;try{B2=typeof process<"u"&&"getBuiltinModule"in process?process.getBuiltinModule("node:diagnostics_channel"):G("diagnostics_channel")}catch{}var r4e=!!B2&&typeof B2.tracingChannel==="function";function n4e(e){return!!e&&e.hasSubscribers!==!1}function jK(e){let t=r4e?B2.tracingChannel(e):void 0;function r(n,s){if(!n4e(t))return n();return t.tracePromise(n,s())}return{channel:t,trace:r}}LK.exports={createTracedChannel:jK,cursorNextChannel:jK("mongoose:cursor:next")}});var YK=g(function(Hxe,GK){/*!
847
- * Module dependencies.
848
- */var Rf=Le(),WK=G("stream").Readable,s4e=lO(),i4e=hO(),I2=sf(),HK=Ha(),fO=Ou(),{once:o4e}=G("events"),R2=G("util"),{cursorNextChannel:u4e}=j1(),{buildMiddlewareFilter:UK}=Yo();function Cs(e){WK.call(this,{autoDestroy:!0,objectMode:!0}),this.cursor=null,this._initializationComplete=!1,this.skipped=!1,this.query=e,this._closed=!1;let t=e.model;this._mongooseOptions={},this._transforms=[],this.model=t,this.options={},this._postMiddlewareFilter=null;let r=(s)=>{if(s!=null){if(this._initializationComplete=!0,s instanceof HK.skipWrappedFunction){let a=s.args[0];if(a!=null&&(!Array.isArray(a)||a.length)){let c=new Rf('Cannot `skipMiddlewareFunction()` with a value when using `.find().cursor()`, value must be nullish or empty array, got "'+R2.inspect(a)+'".');if(this._markError(c),this.listeners("error").length>0)this._errorEmitted=!0,this.emit("error",c);return}this.skipped=!0,this.emit("cursor",null);return}if(this._markError(s),this.listeners("error").length>0)this._errorEmitted=!0,this.emit("error",s);return}let i=null;try{i=e._optionsForExec()}catch(a){this._markError(a),this.listeners("error").length>0&&this.emit("error",a);return}let{middleware:o,...u}=i;if(Object.assign(this.options,u),Object.hasOwn(this.options,"middleware"))delete this.options.middleware;if(this._postMiddlewareFilter=UK(e.options,"post"),this._transforms=this._transforms.concat(e._transforms.slice()),this.options.transform)this._transforms.push(this.options.transform);if(this.options.batchSize)this.options._populateBatchSize=Math.min(this.options.batchSize,5000);if(e._mongooseOptions._asyncIterator)this._mongooseOptions._asyncIterator=!0;if(t.collection._shouldBufferCommands()&&t.collection.buffer)t.collection.queue.push([()=>VK(e,this)]);else VK(e,this)},n=UK(e.options,"pre");t.hooks.execPre("find",e,[],{filter:n}).then(()=>r(null)).catch((s)=>r(s))}R2.inherits(Cs,WK);/*!
849
- * ignore
850
- */function VK(e,t){try{let r=e.model.collection.find(e._conditions,t.options);t.cursor=r,t._initializationComplete=!0,t.emit("cursor",r)}catch(r){if(t._initializationComplete=!0,t._markError(r),t.listeners("error").length>0)t._errorEmitted=!0,t.emit("error",t._error)}}Cs.prototype._read=function(){$2(this,(e,t)=>{if(e)return this._errorEmitted=!0,this.emit("error",e);if(!t){this.push(null),this.cursor.close((r)=>{if(r)return this.emit("error",r)});return}this.push(t)})};Cs.prototype.getDriverCursor=async function(){if(this.cursor)return this.cursor;if(this._error)throw this._error;return await o4e(this,"cursor"),this.cursor};Object.defineProperty(Cs.prototype,"map",{value:function(e){return this._transforms.push(e),this},enumerable:!0,configurable:!0,writable:!0});Cs.prototype._markError=function(e){return this._error=e,this};Cs.prototype.close=async function(){if(typeof arguments[0]==="function")throw new Rf("QueryCursor.prototype.close() no longer accepts a callback");try{await this.cursor.close(),this._closed=!0,this.emit("close")}catch(t){if(this.listeners("error").length>0)this._errorEmitted=!0,this.emit("error",t);throw t}};Cs.prototype._destroy=function(t,r){let n=null;if(!this._initializationComplete)n=i4e(this);else n=Promise.resolve();return n.then(()=>this.cursor?.close()).then(()=>{this._closed=!0;let s=!this._errorEmitted&&this.listeners("error").length>0;r(s?t:null)}).catch((s)=>{r(s)}),this};Cs.prototype.rewind=function(){return KK(this,()=>{this.cursor.rewind()}),this};Cs.prototype.next=async function(){if(typeof arguments[0]==="function")throw new Rf("QueryCursor.prototype.next() no longer accepts a callback");if(this._closed)throw new Rf("Cannot call `next()` on a closed cursor");let t=this;return u4e.trace(function(){return new Promise((n,s)=>{$2(t,function(i,o){if(i)return s(i);n(o)})})},()=>({operation:t.query.op||"find",collection:t.query.mongooseCollection.name,database:t.model.db?.name,serverAddress:t.model.db?.host,serverPort:t.model.db?.port,batchSize:t.options.batchSize||t.query.options?.batchSize,tailable:t.options.tailable||t.query.options?.tailable||!1,args:{filter:t.query.getFilter(),options:t.query._mongooseOptions}}))};Cs.prototype.eachAsync=function(e,t){if(typeof arguments[2]==="function")throw new Rf("QueryCursor.prototype.eachAsync() no longer accepts a callback");if(typeof t==="function")t={};return t=t||{},s4e((r)=>$2(this,r),e,t)};Cs.prototype.options;Cs.prototype.addCursorFlag=function(e,t){return KK(this,()=>{this.cursor.addCursorFlag(e,t)}),this};if(Symbol.asyncIterator!=null)Cs.prototype[Symbol.asyncIterator]=function(){return this._mongooseOptions._asyncIterator=!0,this};function $2(e,t){let r=t;if(r=function(n,s){if(n)return t(n);if(s===null)if(e._mongooseOptions._asyncIterator)return t(null,{done:!0});else return t(null,null);if(e._transforms.length&&s!==null)s=e._transforms.reduce(function(i,o){return o.call(e,i)},s);if(e._mongooseOptions._asyncIterator)return t(null,{value:s,done:!1});return t(null,s)},e._error)return fO(function(){r(e._error)});if(e.skipped)return fO(()=>r(null,null));if(e.cursor){if(e.query._mongooseOptions.populate&&!e._pop)e._pop=I2.preparePopulationOptionsMQ(e.query,e.query._mongooseOptions),e._pop.__noPromise=!0;if(e.query._mongooseOptions.populate&&e.options._populateBatchSize>1)if(e._batchDocs&&e._batchDocs.length)return F2(e,e._batchDocs.shift(),e._pop,r);else if(e._batchExhausted)return r(null,null);else{e._batchDocs=[],e.cursor.next().then((n)=>{N2.call({ctx:e,callback:r},null,n)},(n)=>{N2.call({ctx:e,callback:r},n)});return}else return e.cursor.next().then((n)=>{if(!n){r(null,null);return}if(!e.query._mongooseOptions.populate)return F2(e,n,null,r);F2(e,n,e._pop,(s,i)=>{if(s!=null)return r(s);e.query.model.populate(i,e._pop).then((o)=>r(null,o),(o)=>r(o))})},(n)=>{r(n)})}else e.once("error",t),e.once("cursor",function(n){if(e.removeListener("error",t),n==null){if(e.skipped)return t(null,null);return}$2(e,t)})}/*!
851
- * ignore
852
- */function N2(e,t){if(e)return this.callback(e);if(!t)return this.ctx._batchExhausted=!0,zK.call(this);if(this.ctx._batchDocs.push(t),this.ctx._batchDocs.length<this.ctx.options._populateBatchSize)fO(()=>this.ctx.cursor.next().then((r)=>{N2.call(this,null,r)},(r)=>{N2.call(this,r)}));else zK.call(this)}/*!
853
- * ignore
854
- */function zK(){if(!this.ctx._batchDocs.length)return this.callback(null,null);this.ctx.query.model.populate(this.ctx._batchDocs,this.ctx._pop).then(()=>{F2(this.ctx,this.ctx._batchDocs.shift(),this.ctx._pop,this.callback)},(e)=>{this.callback(e)})}/*!
855
- * ignore
856
- */function F2(e,t,r,n){if(e.query._mongooseOptions.lean)return e.model.hooks.execPost("find",e.query,[[t]],{filter:e._postMiddlewareFilter}).then(()=>n(null,t),(a)=>n(a));let{model:s,_fields:i,_userProvidedFields:o,options:u}=e.query;I2.createModelAndInit(s,t,i,o,u,r,(a,c)=>{if(a!=null)return n(a);if(u.session!=null)c.$session(u.session);e.model.hooks.execPost("find",e.query,[[c]],{filter:e._postMiddlewareFilter}).then(()=>n(null,c),(l)=>n(l))})}/*!
857
- * ignore
858
- */function KK(e,t){if(e.cursor)return t();e.once("cursor",function(r){if(r==null)return;t()})}GK.exports=Cs});var dO=g(function(Kxe,QK){var L1=Oe();function a4e(e,t,r){JK(e,t,r,"maxTimeMS")}function c4e(e,t,r){JK(e,t,r,"allowDiskUse")}QK.exports={applyGlobalMaxTimeMS:a4e,applyGlobalDiskUse:c4e};function JK(e,t,r,n){if(L1.hasUserDefinedProperty(e,n))return;if(L1.hasUserDefinedProperty(t,n))e[n]=t[n];else if(L1.hasUserDefinedProperty(r,n))e[n]=r[n]}});var pO=g(function(Gxe,XK){XK.exports=function(t,r){if(r.readConcern!==void 0)return;if(r?.session?.transaction)return;let n=t.options?.readConcern?.level;if(n!=null)r.readConcern={level:n}}});var mO=g(function(Yxe,eG){var ZK=Oe();eG.exports=function(t,r){if(r.writeConcern!=null)return;if(r?.session?.transaction)return;let n=t.options.writeConcern??{};if(ZK.hasOwnKeys(n)){if(r.writeConcern={},!("w"in r)&&n.w!=null)r.writeConcern.w=n.w;if(!("j"in r)&&n.j!=null)r.writeConcern.j=n.j;if(!("wtimeout"in r)&&n.wtimeout!=null)r.writeConcern.wtimeout=n.wtimeout}else{if(!("w"in r)&&n.w!=null)r.w=n.w;if(!("j"in r)&&n.j!=null)r.j=n.j;if(!("wtimeout"in r)&&n.wtimeout!=null)r.wtimeout=n.wtimeout}}});var iG=g(function(Jxe,sG){var tG=$m(),rG=Zt(),nG=la();/*!
859
- * Deep clone a query's `_mongooseOptions` so a cloned query doesn't share state with the
860
- * original. `clone()` returns class instances as-is, so explicitly copy `PopulateOptions`,
861
- * including nested populate: populate options are mutable, and executing a query writes
862
- * per-execution state like `session` and `lean` into them.
863
- */sG.exports=function(t){let{populate:r,...n}=t,s=rG(n);if(r!=null){s.populate={};for(let i of Object.keys(r)){if(nG.has(i))continue;s.populate[i]=yO(r[i])}}return s};function yO(e){if(Array.isArray(e))return e.map(yO);if(e==null||typeof e!=="object")return e;let{populate:t,_docs:r,_childDocs:n,...s}=e,i=e instanceof tG?new tG(s):rG(s);if(t!==void 0)i.populate=yO(t);return i}});var v2=g(function(Qxe,oG){var l4e=f1(),h4e=So();/*!
864
- * ignore
865
- */oG.exports=function e(t){if(t==null)return!1;let r=Object.keys(t),n=r.length;if(n===0)return!1;for(let s=0;s<n;++s){let i=r[s];if(i.startsWith("+"))continue;if(l4e(t[i])&&!!t[i])if(h4e(t[i]))return e(t[i]);else return!!t[i]}return!1}});var aG=g(function(Xxe,uG){uG.exports=function(t,r){return t===r||r.startsWith(t+".")}});var fG=g(function(cc){/*!
866
- * Module dependencies.
867
- */var gO=cc.specialProperties=["__proto__","constructor","prototype"],k2=cc.clone=function e(t,r){if(t===void 0||t===null)return t;if(Array.isArray(t))return cc.cloneArray(t,r);if(t.constructor){if(/ObjectI[dD]$/.test(t.constructor.name))return typeof t.clone=="function"?t.clone():new t.constructor(t.id);if(t.constructor.name==="ReadPreference")return new t.constructor(t.mode,e(t.tags,r));if(t._bsontype=="Binary"&&t.buffer&&t.value)return typeof t.clone=="function"?t.clone():new t.constructor(t.value(!0),t.sub_type);if(t.constructor.name==="Date"||t.constructor.name==="Function")return new t.constructor(+t);if(t.constructor.name==="RegExp")return new RegExp(t);if(t.constructor.name==="Buffer")return Buffer.from(t)}if(d4e(t))return cc.cloneObject(t,r);if(t.valueOf)return t.valueOf()};/*!
868
- * ignore
869
- */cc.cloneObject=function(t,r){let n=r&&r.minimize,s={},i=Object.keys(t),o=i.length,u=!1,a,c="",l=0;for(l=0;l<o;++l){if(c=i[l],gO.indexOf(c)!==-1)continue;if(a=k2(t[c],r),!n||typeof a<"u")u||(u=!0),s[c]=a}return n?u&&s:s};cc.cloneArray=function(t,r){let n=[],s=t.length,i=0;for(;i<s;i++)n.push(k2(t[i],r));return n};cc.merge=function e(t,r){let n=Object.keys(r);for(let s of n){if(gO.indexOf(s)!==-1)continue;if(!Object.prototype.hasOwnProperty.call(t,s)||typeof t[s]>"u")t[s]=r[s];else if(cc.isObject(r[s]))e(t[s],r[s]);else t[s]=r[s]}};cc.mergeClone=function e(t,r){let n=Object.keys(r);for(let s of n){if(gO.indexOf(s)!==-1)continue;if(!Object.prototype.hasOwnProperty.call(t,s)||typeof t[s]>"u")t[s]=k2(r[s]);else if(cc.isObject(r[s]))e(t[s],r[s]);else t[s]=k2(r[s])}};cc.readPref=function(t){switch(t){case"p":t="primary";break;case"pp":t="primaryPreferred";break;case"s":t="secondary";break;case"sp":t="secondaryPreferred";break;case"n":t="nearest";break}return t};cc.readConcern=function(t){if(typeof t==="string"){switch(t){case"l":t="local";break;case"a":t="available";break;case"m":t="majority";break;case"lz":t="linearizable";break;case"s":t="snapshot";break}t={level:t}}return t};var f4e=Object.prototype.toString;cc.toString=function(e){return f4e.call(e)};var d4e=cc.isObject=function(e){return cc.toString(e)=="[object Object]"};cc.keys=Object.keys;cc.create=typeof Object.create=="function"?Object.create:p4e;function p4e(e){if(arguments.length>1)throw Error("Adding properties is not supported");function t(){}return t.prototype=e,new t}cc.inherits=function(e,t){e.prototype=cc.create(t.prototype),e.prototype.constructor=e};cc.isArgumentsObject=function(e){return Object.prototype.toString.call(e)==="[object Arguments]"}});var pG=g(function(dG){var er=dG;er.distinct=function(e){if(e._fields&&Object.keys(e._fields).length>0)return"field selection and slice";let t=Object.keys(er.distinct),r;return t.every(function(n){if(e.options[n])return r=n,!1;return!0}),r};er.distinct.select=er.distinct.slice=er.distinct.sort=er.distinct.limit=er.distinct.skip=er.distinct.batchSize=er.distinct.hint=er.distinct.tailable=!0;er.findOneAndUpdate=er.findOneAndDelete=function(e){let t=Object.keys(er.findOneAndUpdate),r;return t.every(function(n){if(e.options[n])return r=n,!1;return!0}),r};er.findOneAndUpdate.limit=er.findOneAndUpdate.skip=er.findOneAndUpdate.batchSize=er.findOneAndUpdate.tailable=!0;er.findOneAndReplace=function(e){let t=Object.keys(er.findOneAndUpdate),r;return t.every(function(n){if(e.options[n])return r=n,!1;return!0}),r};er.countDocuments=function(e){if(e._fields&&Object.keys(e._fields).length>0)return"field selection and slice";let t=Object.keys(er.countDocuments),r;return t.every(function(n){if(e.options[n])return r=n,!1;return!0}),r};er.countDocuments.slice=er.countDocuments.batchSize=er.countDocuments.tailable=!0});var EO=g(function(nPe,mG){nPe.isNode=typeof process<"u"&&typeof mG=="object"&&typeof global=="object"&&typeof Buffer=="function"&&process.argv;nPe.isMongo=!nPe.isNode&&typeof printjson=="function"&&typeof ObjectId=="function"&&typeof rs=="function"&&typeof sh=="function";nPe.isBrowser=!nPe.isNode&&!nPe.isMongo&&typeof window<"u";nPe.type=nPe.isNode?"node":nPe.isMongo?"mongo":nPe.isBrowser?"browser":"unknown"});var $f=g(function(gG,_G){var AO=["find","findOne","updateMany","updateOne","replaceOne","countDocuments","estimatedDocumentCount","distinct","findOneAndDelete","findOneAndReplace","findOneAndUpdate","aggregate","findCursor","deleteOne","deleteMany"];function OO(){}for(let e=0,t=AO.length;e<t;++e){let r=AO[e];OO.prototype[r]=b4e(r)}_G.exports=gG=OO;OO.methods=AO;function b4e(e){return function(){throw Error("collection."+e+" not implemented")}}});var SG=g(function(AG,OG){var D4e=$f();class EG extends D4e{constructor(e){super();this.collection=e,this.collectionName=e.collectionName}async find(e,t){return this.collection.find(e,t).toArray()}async findOne(e,t){return this.collection.findOne(e,t)}async countDocuments(e,t){return this.collection.countDocuments(e,t)}async estimatedDocumentCount(e,t){return this.collection.estimatedDocumentCount(e,t)}async distinct(e,t,r){return this.collection.distinct(e,t,r)}async updateMany(e,t,r){return this.collection.updateMany(e,t,r)}async updateOne(e,t,r){return this.collection.updateOne(e,t,r)}async replaceOne(e,t,r){return this.collection.replaceOne(e,t,r)}async deleteOne(e,t){return this.collection.deleteOne(e,t)}async deleteMany(e,t){return this.collection.deleteMany(e,t)}async findOneAndDelete(e,t){return this.collection.findOneAndDelete(e,t)}async findOneAndUpdate(e,t,r){return this.collection.findOneAndUpdate(e,t,r)}async findOneAndReplace(e,t,r){return this.collection.findOneAndReplace(e,t,r)}findCursor(e,t){return this.collection.find(e,t)}}OG.exports=AG=EG});var CG=g(function(sPe,wG){var U1=EO();if(U1.type=="unknown")throw Error("Unknown environment");wG.exports=U1.isNode?SG():U1.isMongo?$f():$f()});var bO=g(function(TG,MG){var DG=G("assert"),j2=G("util"),te=fG(),iu=j2.debuglog("mquery");function j(e,t){if(!(this instanceof j))return new j(e,t);let r=this.constructor.prototype;if(this.op=r.op||void 0,this.options=Object.assign({},r.options),this._conditions=r._conditions?te.clone(r._conditions):{},this._fields=r._fields?te.clone(r._fields):void 0,this._updateDoc=r._updateDoc?te.clone(r._updateDoc):void 0,this._path=r._path||void 0,this._distinctDoc=r._distinctDoc||void 0,this._collection=r._collection||void 0,this._traceFunction=r._traceFunction||void 0,t)this.setOptions(t);if(e)this.find(e)}j.prototype.toConstructor=function(){function t(n,s){if(!(this instanceof t))return new t(n,s);j.call(this,n,s)}te.inherits(t,j);let r=t.prototype;return r.options={},r.setOptions(this.options),r.op=this.op,r._conditions=te.clone(this._conditions),r._fields=te.clone(this._fields),r._updateDoc=te.clone(this._updateDoc),r._path=this._path,r._distinctDoc=this._distinctDoc,r._collection=this._collection,r._traceFunction=this._traceFunction,t};j.prototype.setOptions=function(e){if(!(e&&te.isObject(e)))return this;let t=te.keys(e),r;for(let n=0;n<t.length;++n){if(r=t[n],te.specialProperties.indexOf(r)!==-1)continue;if(typeof this[r]=="function"){let s=Array.isArray(e[r])?e[r]:[e[r]];this[r].apply(this,s)}else this.options[r]=e[r]}return this};j.prototype.collection=function(t){return this._collection=new j.Collection(t),this};j.prototype.collation=function(e){return this.options.collation=e,this};j.prototype.$where=function(e){return this._conditions.$where=e,this};j.prototype.where=function(){if(!arguments.length)return this;if(!this.op)this.op="find";let e=typeof arguments[0];if(e=="string"){if(vf(arguments[0]),this._path=arguments[0],arguments.length===2)this._conditions[this._path]=arguments[1];return this}if(e=="object"&&!Array.isArray(arguments[0]))return this.merge(arguments[0]);throw TypeError("path must be a string or object")};j.prototype.equals=function(t){this._ensurePath("equals");let r=this._path;return this._conditions[r]=t,this};j.prototype.eq=function(t){this._ensurePath("eq");let r=this._path;return this._conditions[r]=t,this};j.prototype.or=function(t){let r=this._conditions.$or||(this._conditions.$or=[]);if(!Array.isArray(t))t=[t];return r.push.apply(r,t),this};j.prototype.nor=function(t){let r=this._conditions.$nor||(this._conditions.$nor=[]);if(!Array.isArray(t))t=[t];return r.push.apply(r,t),this};j.prototype.and=function(t){let r=this._conditions.$and||(this._conditions.$and=[]);if(!Array.isArray(t))t=[t];return r.push.apply(r,t),this};/*!
870
- * gt, gte, lt, lte, ne, in, nin, all, regex, size, maxDistance
871
- *
872
- * Thing.where('type').nin(array)
873
- */"gt gte lt lte ne in nin all regex size maxDistance minDistance".split(" ").forEach(function(e){j.prototype[e]=function(){let t,r;if(arguments.length===1)this._ensurePath(e),r=arguments[0],t=this._path;else r=arguments[1],t=arguments[0];let n=ou(this._conditions,t),s=n===null||typeof n==="object"?n:this._conditions[t]={};return s["$"+e]=r,this}});j.prototype.mod=function(){let e,t;if(arguments.length===1)this._ensurePath("mod"),e=arguments[0],t=this._path;else if(arguments.length===2&&!Array.isArray(arguments[1]))this._ensurePath("mod"),e=[arguments[0],arguments[1]],t=this._path;else if(arguments.length===3)e=[arguments[1],arguments[2]],t=arguments[0];else e=arguments[1],t=arguments[0];let r=ou(this._conditions,t)||(this._conditions[t]={});return r.$mod=e,this};j.prototype.exists=function(){let e,t;if(arguments.length===0)this._ensurePath("exists"),e=this._path,t=!0;else if(arguments.length===1)if(typeof arguments[0]==="boolean")this._ensurePath("exists"),e=this._path,t=arguments[0];else e=arguments[0],t=!0;else if(arguments.length===2)e=arguments[0],t=arguments[1];let r=ou(this._conditions,e)||(this._conditions[e]={});return r.$exists=t,this};j.prototype.elemMatch=function(){if(arguments[0]==null)throw TypeError("Invalid argument");let e,t,r;if(typeof arguments[0]==="function")this._ensurePath("elemMatch"),t=this._path,e=arguments[0];else if(te.isObject(arguments[0]))this._ensurePath("elemMatch"),t=this._path,r=arguments[0];else if(typeof arguments[1]==="function")t=arguments[0],e=arguments[1];else if(arguments[1]&&te.isObject(arguments[1]))t=arguments[0],r=arguments[1];else throw TypeError("Invalid argument");if(e)r=new j,e(r),r=r._conditions;let n=ou(this._conditions,t)||(this._conditions[t]={});return n.$elemMatch=r,this};j.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);else if(2<arguments.length)return this.polygon.apply(this,arguments);let t=arguments[0];if(!t)throw TypeError("Invalid argument");if(t.center)return this.circle(t);if(t.box)return this.box.apply(this,t.box);if(t.polygon)return this.polygon.apply(this,t.polygon);if(t.type&&t.coordinates)return this.geometry(t);throw TypeError("Invalid argument")};j.prototype.box=function(){let e,t;if(arguments.length===3)e=arguments[0],t=[arguments[1],arguments[2]];else if(arguments.length===2)this._ensurePath("box"),e=this._path,t=[arguments[0],arguments[1]];else throw TypeError("Invalid argument");let r=ou(this._conditions,e)||(this._conditions[e]={});return r[this._geoComparison||"$geoWithin"]={$box:t},this};j.prototype.polygon=function(){let e,t;if(typeof arguments[0]=="string")e=Array.from(arguments),t=e.shift();else this._ensurePath("polygon"),t=this._path,e=Array.from(arguments);let r=ou(this._conditions,t)||(this._conditions[t]={});return r[this._geoComparison||"$geoWithin"]={$polygon:e},this};j.prototype.circle=function(){let e,t;if(arguments.length===1)this._ensurePath("circle"),e=this._path,t=arguments[0];else if(arguments.length===2)e=arguments[0],t=arguments[1];else throw TypeError("Invalid argument");if(!(("radius"in t)&&t.center))throw Error("center and radius are required");let r=ou(this._conditions,e)||(this._conditions[e]={}),n=t.spherical?"$centerSphere":"$center",s=this._geoComparison||"$geoWithin";if(r[s]={},r[s][n]=[t.center,t.radius],"unique"in t)r[s].$uniqueDocs=!!t.unique;return this};j.prototype.near=function(){let t,r;if(this._geoComparison="$near",arguments.length===0)return this;else if(arguments.length===1)this._ensurePath("near"),t=this._path,r=arguments[0];else if(arguments.length===2)t=arguments[0],r=arguments[1];else throw TypeError("Invalid argument");if(!r.center)throw Error("center is required");let n=ou(this._conditions,t)||(this._conditions[t]={}),s=r.spherical?"$nearSphere":"$near";if(Array.isArray(r.center)){n[s]=r.center;let i="maxDistance"in r?r.maxDistance:null;if(i!=null)n.$maxDistance=i;if(r.minDistance!=null)n.$minDistance=r.minDistance}else{if(r.center.type!="Point"||!Array.isArray(r.center.coordinates))throw Error(j2.format("Invalid GeoJSON specified for %s",s));if(n[s]={$geometry:r.center},"maxDistance"in r)n[s].$maxDistance=r.maxDistance;if("minDistance"in r)n[s].$minDistance=r.minDistance}return this};j.prototype.intersects=function(){if(this._ensurePath("intersects"),this._geoComparison="$geoIntersects",arguments.length===0)return this;let t=arguments[0];if(t!=null&&t.type&&t.coordinates)return this.geometry(t);throw TypeError("Invalid argument")};j.prototype.geometry=function(){if(!(this._geoComparison=="$within"||this._geoComparison=="$geoWithin"||this._geoComparison=="$near"||this._geoComparison=="$geoIntersects"))throw Error("geometry() must come after `within()`, `intersects()`, or `near()");let t,r;if(arguments.length===1)this._ensurePath("geometry"),r=this._path,t=arguments[0];else throw TypeError("Invalid argument");if(!(t.type&&Array.isArray(t.coordinates)))throw TypeError("Invalid argument");let n=ou(this._conditions,r)||(this._conditions[r]={});return n[this._geoComparison]={$geometry:t},this};j.prototype.select=function(){let t=arguments[0];if(!t)return this;if(arguments.length!==1)throw Error("Invalid select: select only takes 1 argument");this._validate("select");let r=this._fields||(this._fields={}),n=typeof t,s,i;if((n=="string"||te.isArgumentsObject(t))&&typeof t.length=="number"||Array.isArray(t)){if(n=="string")t=t.split(/\s+/);for(s=0,i=t.length;s<i;++s){let o=t[s];if(!o)continue;let u=o[0]=="-"?0:1;if(u===0)o=o.substring(1);vf(o),r[o]=u}return this}if(te.isObject(t)){let o=te.keys(t);for(s=0;s<o.length;++s){if(te.specialProperties.indexOf(o[s])!==-1)continue;r[o[s]]=t[o[s]]}return this}throw TypeError("Invalid select() argument. Must be string or object.")};j.prototype.slice=function(){if(arguments.length===0)return this;this._validate("slice");let e,t;if(arguments.length===1){let n=arguments[0];if(typeof n==="object"&&!Array.isArray(n)){let s=Object.keys(n),i=s.length;for(let o=0;o<i;++o){if(te.specialProperties.indexOf(s[o])!==-1)continue;this.slice(s[o],n[s[o]])}return this}this._ensurePath("slice"),e=this._path,t=arguments[0]}else if(arguments.length===2)if(typeof arguments[0]==="number")this._ensurePath("slice"),e=this._path,t=[arguments[0],arguments[1]];else e=arguments[0],t=arguments[1];else if(arguments.length===3)e=arguments[0],t=[arguments[1],arguments[2]];vf(e);let r=this._fields||(this._fields={});return r[e]={$slice:t},this};j.prototype.sort=function(e){if(!e)return this;let t,r,n;this._validate("sort");let s=typeof e;if(Array.isArray(e)){r=e.length;for(t=0;t<e.length;++t){if(!Array.isArray(e[t]))throw Error("Invalid sort() argument, must be array of arrays");T4e(this.options,e[t][0],e[t][1])}return this}if(arguments.length===1&&s=="string"){e=e.split(/\s+/),r=e.length;for(t=0;t<r;++t){if(n=e[t],!n)continue;let i=n[0]=="-"?-1:1;if(i===-1)n=n.substring(1);vf(n),bG(this.options,n,i)}return this}if(te.isObject(e)){let i=te.keys(e);for(t=0;t<i.length;++t){if(n=i[t],te.specialProperties.indexOf(n)!==-1)continue;bG(this.options,n,e[n])}return this}if(typeof Map<"u"&&e instanceof Map)return M4e(this.options,e),this;throw TypeError("Invalid sort() argument. Must be a string, object, or array.")};/*!
874
- * @ignore
875
- */var SO={1:1,"-1":-1,asc:1,ascending:1,desc:-1,descending:-1};function bG(e,t,r){if(Array.isArray(e.sort))throw TypeError("Can't mix sort syntaxes. Use either array or object:\n- `.sort([['field', 1], ['test', -1]])`\n- `.sort({ field: 1, test: -1 })`");let n;if(r&&r.$meta){n=e.sort||(e.sort={}),n[t]={$meta:r.$meta};return}n=e.sort||(e.sort={});let s=String(r||1).toLowerCase();if(s=SO[s],!s)throw TypeError("Invalid sort value: { "+t+": "+r+" }");n[t]=s}function T4e(e,t,r){if(e.sort=e.sort||[],!Array.isArray(e.sort))throw TypeError("Can't mix sort syntaxes. Use either array or object:\n- `.sort([['field', 1], ['test', -1]])`\n- `.sort({ field: 1, test: -1 })`");let n=String(r||1).toLowerCase();if(n=SO[n],!n)throw TypeError("Invalid sort value: [ "+t+", "+r+" ]");e.sort.push([t,n])}function M4e(e,t){if(e.sort=e.sort||new Map,!(e.sort instanceof Map))throw TypeError("Can't mix sort syntaxes. Use either array or object or map consistently");t.forEach(function(r,n){let s=String(r||1).toLowerCase();if(s=SO[s],!s)throw TypeError("Invalid sort value: < "+n+": "+r+" >");e.sort.set(n,s)})}/*!
876
- * limit, skip, batchSize, comment
877
- *
878
- * Sets these associated options.
879
- *
880
- * query.comment('feed query');
881
- */["limit","skip","batchSize","comment"].forEach(function(e){j.prototype[e]=function(t){return this._validate(e),this.options[e]=t,this}});j.prototype.maxTime=j.prototype.maxTimeMS=function(e){return this._validate("maxTime"),this.options.maxTimeMS=e,this};j.prototype.hint=function(){if(arguments.length===0)return this;this._validate("hint");let e=arguments[0];if(te.isObject(e)){let t=this.options.hint||(this.options.hint={});for(let r in e){if(te.specialProperties.indexOf(r)!==-1)continue;t[r]=e[r]}return this}if(typeof e==="string")return this.options.hint=e,this;throw TypeError("Invalid hint. "+e)};j.prototype.j=function(t){return this.options.j=t,this};j.prototype.slaveOk=function(e){return this.options.slaveOk=arguments.length?!!e:!0,this};j.prototype.read=j.prototype.setReadPreference=function(e){if(arguments.length>1&&!j.prototype.read.deprecationWarningIssued)console.error("Deprecation warning: 'tags' argument is not supported anymore in Query.read() method. Please use mongodb.ReadPreference object instead."),j.prototype.read.deprecationWarningIssued=!0;return this.options.readPreference=te.readPref(e),this};j.prototype.readConcern=j.prototype.r=function(e){return this.options.readConcern=te.readConcern(e),this};j.prototype.tailable=function(){return this._validate("tailable"),this.options.tailable=arguments.length?!!arguments[0]:!0,this};j.prototype.writeConcern=j.prototype.w=function(t){if(typeof t==="object"){if(typeof t.j<"u")this.options.j=t.j;if(typeof t.w<"u")this.options.w=t.w;if(typeof t.wtimeout<"u")this.options.wtimeout=t.wtimeout}else this.options.w=t==="m"?"majority":t;return this};j.prototype.wtimeout=j.prototype.wTimeout=function(t){return this.options.wtimeout=t,this};j.prototype.merge=function(e){if(!e)return this;if(!j.canMerge(e))throw TypeError("Invalid argument. Expected instanceof mquery or plain object");if(e instanceof j){if(e._conditions)te.merge(this._conditions,e._conditions);if(e._fields)this._fields||(this._fields={}),te.merge(this._fields,e._fields);if(e.options)this.options||(this.options={}),te.merge(this.options,e.options);if(e._updateDoc)this._updateDoc||(this._updateDoc={}),te.mergeClone(this._updateDoc,e._updateDoc);if(e._distinctDoc)this._distinctDoc=e._distinctDoc;return this}return te.merge(this._conditions,e),this};j.prototype.find=function(e){if(this.op="find",j.canMerge(e))this.merge(e);return this};j.prototype._find=async function(){let t=this._conditions,r=this._optionsForExec();if(this.$useProjection)r.projection=this._fieldsForExec();else r.fields=this._fieldsForExec();return iu("find",this._collection.collectionName,t,r),this._collection.find(t,r)};j.prototype.cursor=function(t){if(this.op){if(this.op!=="find")throw TypeError(".cursor only support .find method")}else this.find(t);let r=this._conditions,n=this._optionsForExec();if(this.$useProjection)n.projection=this._fieldsForExec();else n.fields=this._fieldsForExec();return iu("findCursor",this._collection.collectionName,r,n),this._collection.findCursor(r,n)};j.prototype.findOne=function(e){if(this.op="findOne",j.canMerge(e))this.merge(e);return this};j.prototype._findOne=async function(){let t=this._conditions,r=this._optionsForExec();if(this.$useProjection)r.projection=this._fieldsForExec();else r.fields=this._fieldsForExec();return iu("findOne",this._collection.collectionName,t,r),this._collection.findOne(t,r)};j.prototype.countDocuments=function(e){if(this.op="countDocuments",this._validate(),j.canMerge(e))this.merge(e);return this};j.prototype._countDocuments=async function(){let t=this._conditions,r=this._optionsForExec();return iu("countDocuments",this._collection.collectionName,t,r),this._collection.countDocuments(t,r)};j.prototype.estimatedDocumentCount=function(){return this.op="estimatedDocumentCount",this._validate(),this};j.prototype._estimatedDocumentCount=async function(){let t=this._conditions,r=this._optionsForExec();return iu("estimatedDocumentCount",this._collection.collectionName,t,r),this._collection.estimatedDocumentCount(t,r)};j.prototype.distinct=function(e,t){if(this.op="distinct",this._validate(),!t&&typeof e==="string")t=e,e=void 0;if(typeof t=="string")this._distinctDoc=t;if(j.canMerge(e))this.merge(e);return this};j.prototype._distinct=async function(){if(!this._distinctDoc)throw Error("No value for `distinct` has been declared");let t=this._conditions,r=this._optionsForExec();return this._collection.distinct(this._distinctDoc,t,r)};j.prototype.updateMany=function(t,r,n){return wO(this,"updateMany",t,r,n)};j.prototype._updateMany=async function(){return CO(this,"updateMany")};j.prototype.updateOne=function(t,r,n){return wO(this,"updateOne",t,r,n)};j.prototype._updateOne=async function(){return CO(this,"updateOne")};j.prototype.replaceOne=function(t,r,n){return this.setOptions({overwrite:!0}),wO(this,"replaceOne",t,r,n)};j.prototype._replaceOne=async function(){return CO(this,"replaceOne")};/*!
882
- * Internal helper for updateMany, updateOne
883
- */function wO(e,t,r,n,s){if(e.op=t,j.canMerge(r))e.merge(r);if(n)e._mergeUpdate(n);if(te.isObject(s))e.setOptions(s);return e}async function CO(e,t){let r=e._optionsForExec(),n=e._conditions,s=e._updateForExec();return iu(t,e._collection.collectionName,n,s,r),e._collection[t](n,s,r)}j.prototype.deleteOne=function(e){if(this.op="deleteOne",j.canMerge(e))this.merge(e);return this};j.prototype._deleteOne=async function(){let e=this._optionsForExec();delete e.justOne;let t=this._conditions;return iu("deleteOne",this._collection.collectionName,t,e),this._collection.deleteOne(t,e)};j.prototype.deleteMany=function(e){if(this.op="deleteMany",j.canMerge(e))this.merge(e);return this};j.prototype._deleteMany=async function(){let e=this._optionsForExec();delete e.justOne;let t=this._conditions;return this._collection.deleteMany(t,e)};j.prototype.findOneAndUpdate=function(e,t,r){if(this.op="findOneAndUpdate",this._validate(),j.canMerge(e))this.merge(e);if(t)this._mergeUpdate(t);return r&&this.setOptions(r),this};j.prototype._findOneAndUpdate=async function(){let e=this._conditions,t=this._updateForExec(),r=this._optionsForExec();return this._collection.findOneAndUpdate(e,t,r)};j.prototype.findOneAndReplace=function(e,t,r){if(this.op="findOneAndReplace",this._validate(),j.canMerge(e))this.merge(e);if(t)this._updateDoc=t,this.options=this.options||{},this.options.overwrite=!0;return r&&this.setOptions(r),this};j.prototype._findOneAndReplace=async function(){let e=this._conditions,t=this._updateForExec(),r=this._optionsForExec();return iu("findOneAndReplace",this._collection.collectionName,e,t,r),this._collection.findOneAndReplace(e,t,r)};j.prototype.findOneAndDelete=function(e,t){if(this.op="findOneAndDelete",this._validate(),j.canMerge(e))this.merge(e);return t&&this.setOptions(t),this};j.prototype._findOneAndDelete=async function(){let e=this._optionsForExec(),t=this._conditions;return iu("findOneAndDelete",this._collection.collectionName,t,e),this._collection.findOneAndDelete(t,e)};j.prototype.setTraceFunction=function(e){return this._traceFunction=e,this};j.prototype.exec=async function(t){if(typeof t==="string")this.op=t;DG.ok(this.op,"Missing query type: (find, etc)");let r="_"+this.op;if(typeof this[r]!=="function")throw TypeError(`this[${r}] is not a function`);return this[r]()};j.prototype.then=async function(e,t){return this.exec().then(e,t)};j.prototype.cursor=function(){if(this.op!="find")throw Error("cursor() is only available for find");let e=this._conditions,t=this._optionsForExec();if(this.$useProjection)t.projection=this._fieldsForExec();else t.fields=this._fieldsForExec();return this._collection.findCursor(e,t)};j.prototype.selected=function(){return!!(this._fields&&Object.keys(this._fields).length>0)};j.prototype.selectedInclusively=function(){if(!this._fields)return!1;let t=Object.keys(this._fields);if(t.length===0)return!1;for(let r=0;r<t.length;++r){let n=t[r];if(this._fields[n]===0)return!1;if(this._fields[n]&&typeof this._fields[n]==="object"&&this._fields[n].$meta)return!1}return!0};j.prototype.selectedExclusively=function(){if(!this._fields)return!1;let t=Object.keys(this._fields);if(t.length===0)return!1;for(let r=0;r<t.length;++r){let n=t[r];if(this._fields[n]===0)return!0}return!1};j.prototype._mergeUpdate=function(e){if(!this._updateDoc)this._updateDoc={};if(e instanceof j){if(e._updateDoc)te.mergeClone(this._updateDoc,e._updateDoc)}else te.mergeClone(this._updateDoc,e)};j.prototype._optionsForExec=function(){return te.clone(this.options)};j.prototype._fieldsForExec=function(){return te.clone(this._fields)};j.prototype._updateForExec=function(){let e=this._updateDoc==null?{}:te.clone(this._updateDoc),t=te.keys(e),r={};for(let n of t){if(this.options.overwrite){r[n]=e[n];continue}if(n[0]!=="$"){if(!r.$set)if(e.$set)r.$set=e.$set;else r.$set={};if(r.$set[n]=e[n],!~t.indexOf("$set"))t.push("$set")}else if(n==="$set"){if(!r.$set)r[n]=e[n]}else r[n]=e[n]}return this._compiledUpdate=r,r};j.prototype._ensurePath=function(e){if(!this._path){let t=e+"() must be used after where() when called with these arguments";throw Error(t)}};function ou(e,t){return vf(t),Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function vf(e){if(e!=null&&te.specialProperties.indexOf(String(e))!==-1)throw Error("Cannot use `"+e+"` as a query path")}/*!
884
- * Permissions
885
- */j.permissions=pG();j._isPermitted=function(e,t){let r=j.permissions[t];if(!r)return!0;return r[e]!==!0};j.prototype._validate=function(e){let t,r;if(e===void 0){if(r=j.permissions[this.op],typeof r!="function")return!0;t=r(this)}else if(!j._isPermitted(e,this.op))t=e;if(t)throw Error(t+" cannot be used with "+this.op)};j.canMerge=function(e){return e instanceof j||te.isObject(e)};j.setGlobalTraceFunction=function(e){j.traceFunction=e};/*!
886
- * Exports.
887
- */j.utils=te;j.env=EO();j.Collection=CG();j.BaseCollection=$f();MG.exports=TG=j});var L2=g(function(iPe,xG){xG.exports=function(t,r){if(typeof t==="string")t=t.split(/\s+/);if(!Array.isArray(t)&&Object.prototype.toString.call(t)!=="[object Arguments]")return t;let s=t.length,i={};for(let o=0;o<s;++o){let u=t[o];if(!u)continue;let a=u.charAt(0)==="-"?0:1;if(!r&&a===0)u=u.slice(1);i[u]=a}return i}});var FG=g(function(oPe,BG){BG.exports=function(t,r){let n=r?.arrayFilters;if(!Array.isArray(n))return;let s=Object.keys(t).map((i)=>Object.keys(t[i])).reduce((i,o)=>i.concat(o),[]);r.arrayFilters=r.arrayFilters.filter((i)=>PG(i,s))};function PG(e,t){let r=Object.keys(e)[0];if(r==null)return!0;if(r==="$and"||r==="$or"){if(!Array.isArray(e[r]))return!1;return e[r].find((i)=>PG(i,t))!=null}let n=r.indexOf("."),s=n===-1?r:r.slice(0,n);return t.find((i)=>i.includes("$["+s+"]"))!=null}});var U2=g(function(uPe,NG){/*!
888
- * ignore
889
- */NG.exports=function(t){if(typeof t!=="object"||t===null)return!1;let r=Object.keys(t),n=r.length;for(let s=0;s<n;++s)if(r[s][0]==="$")return!0;return!1}});var DO=g(function(aPe,IG){var x4e=Le(),P4e=U2(),{logicalOperators:B4e}=_f(),{trustedSymbol:F4e}=n1();IG.exports=function e(t){if(t==null||typeof t!=="object")return t;if(Array.isArray(t)){for(let n of t)e(n);return t}let r=Object.keys(t);for(let n of r){let s=t[n];if(s?.[F4e])continue;if(B4e.has(n)){e(s);continue}else if(n[0]==="$")throw new x4e(n+" is not allowed with sanitizeFilter");if(P4e(s)){let i=Object.keys(s);if(i.length===1&&i[0]==="$eq")continue;t[n]={$eq:t[n]}}}return t}});var $G=g(function(cPe,RG){RG.exports=function(t){if(t==null)return;let r=Object.keys(t);for(let n=0;n<r.length;++n){let s=t[r[n]];if(typeof s==="string"){t[r[n]]=1;continue}if(s==null||typeof s!=="object")continue;let i=s.$slice;if(!(s.$meta==="textScore"||s.$elemMatch!=null||typeof i==="number"||Array.isArray(i)&&i.every((u)=>typeof u==="number")))t[r[n]]=1}}});var qG=g(function(lPe,kG){var N4e=Ja(),I4e=v2();/*!
890
- * ignore
891
- */kG.exports=function(t,r,n){if(n==null)return;let s=Object.keys(n);if(r=r||{},I4e(t))for(let i of s){if(!vG(r,i))t[i]=1;else if(r[i]===0)delete t[i];let o=n[i]?.refPath;if(typeof o==="string"){if(!vG(r,o))t[o]=1;else if(r[o]===0)delete t[o]}}else if(N4e(t))for(let i of s){if(r[i]==null)delete t[i];let o=n[i]?.refPath;if(typeof o==="string"&&r[o]==null)delete t[o]}};/*!
892
- * ignore
893
- */function vG(e,t){let r=t.split("."),n=r.length,s=r[0];for(let i=1;i<n;++i){if(e[s]!=null||e[s+".$"]!=null)return!0;s+="."+r[i]}return e[s]!=null||e[s+".$"]!=null}});var UG=g(function(hPe,LG){/*!
894
- * Module dependencies.
895
- */var R4e=ff(),jG=L4().flatten,$4e=gn();LG.exports=async function(t,r,n,s){let i=Object.keys(n||{}),o={},u={},a={},c={},l=i.length,f=!1,h,d;for(let A=0;A<l;++A)if(i[A].startsWith("$")){if(f=!0,i[A]==="$push"||i[A]==="$addToSet"){let v=Object.keys(n[i[A]]);for(let P=0;P<v.length;++P)if(h=n[i[A]][v[P]],h?.$each)c[v[P]]=(c[v[P]]||[]).concat(h.$each);else c[v[P]]=(c[v[P]]||[]).concat([h]);continue}let M=jG(n[i[A]],null,null,r),O=Object.keys(M),x=O.length;for(let v=0;v<x;++v){let P=R4e(O[v]);if(d=i[A],P.includes("$"))continue;if(d==="$set"||d==="$setOnInsert"||d==="$pull"||d==="$pullAll")u[P]=M[O[v]],a[P]=d==="$pull"||d==="$pullAll";else if(d==="$unset")u[P]=void 0;o[P]=!0}}if(!f)u=jG(n,null,null,r),o=Object.keys(u);let p=Object.keys(u),m=p.length,_=[],y=[],E=null,w=t;for(let A=0;A<m;++A){let M=u[p[A]],O=r._getSchema(p[A]);if(O==null)continue;if(O.instance==="Mixed"&&O.path!==p[A]&&k4e(r,p[A]))continue;if(a[p[A]]&&O.$isMongooseArray)continue;if(M&&Array.isArray(M.$in))M.$in.forEach((x,v)=>{_.push(O.doValidate(x,w,{updateValidator:!0}).catch((P)=>{P.path=p[A]+".$in."+v,y.push(P)}))});else{if(E!=null&&v4e(E,p[A]))continue;if(O.$isMongooseDocumentArrayElement&&$4e(M))E??=new Set,E.add(p[A]),_.push(O.doValidate(M,w,{updateValidator:!0}).catch((x)=>{if(x.errors)for(let v of Object.keys(x.errors)){let P=x.errors[v];P.path=p[A]+"."+v,y.push(P)}else x.path=p[A],y.push(x)}));else{if(O.$isSingleNested)E??=new Set,E.add(p[A]);_.push(O.doValidate(M,w,{updateValidator:!0}).catch((x)=>{if(x)x.path=p[A],y.push(x)}))}}}let b=Object.keys(c);for(let A of b){let M=r._getSchema(A);if(M&&M.$isMongooseDocumentArray)_.push(M.doValidate(c[A],s?.context==="query"?t:null).catch((O)=>{O.path=A,y.push(O)}));else{M=r._getSchema(A+".0");for(let O of c[A])_.push(M.doValidate(O,s?.context==="query"?t:null,{updateValidator:!0}).catch((x)=>{x.path=A,y.push(x)}))}}return await Promise.all(_),y};/*!
896
- * Returns true if `path` is underneath a path in `alreadyValidated`. Checks each
897
- * ancestor of `path` with a Set lookup, so the cost depends on the depth of `path`
898
- * rather than on the number of subdocuments validated so far.
899
- */function v4e(e,t){for(let r=t.indexOf(".");r!==-1;r=t.indexOf(".",r+1))if(e.has(t.slice(0,r)))return!0;return!1}/*!
900
- * Returns true if the parent of `path` is a Mixed path, so `path` is a key
901
- * inside a Mixed value rather than a path in the schema.
902
- */function k4e(e,t){let r=t.lastIndexOf(".");if(r===-1)return!1;return e._getSchema(t.slice(0,r))?.instance==="Mixed"}});var H2=g(function(fPe,tY){/*!
903
- * Module dependencies.
904
- */var kf=kn(),q4e=Bm(),qf=Ha(),ft=Le(),uu=Lm(),TO=YK(),jf=Ga(),{applyGlobalMaxTimeMS:Lf,applyGlobalDiskUse:Uf}=dO(),j4e=OA(),L4e=pO(),U4e=mO(),V4e=nc(),z4e=Z4(),V2=mf(),W4e=Q4(),bs=Zt(),xO=iG(),H4e=b2(),WG=_i(),Fo=sf(),K4e=ji().internalToObjectOptions,G4e=Ja(),Y4e=v2(),J4e=gn(),Q4e=Jm(),VG=aG(),{logicalOperators:X4e}=_f(),z2=ks(),Vf=bO(),Z4e=L2(),FO=FG(),eOe=DO(),HG=$G(),{buildMiddlewareFilter:KG}=Yo(),tOe=qG(),NO=eO(),Mi=la(),rOe=UG(),xi=G("util"),X=Oe(),nOe=df().queryMiddlewareFunctions,{createTracedChannel:sOe}=j1(),{trace:iOe}=sOe("mongoose:query"),oOe=new Set(["allowDiskUse","batchSize","collation","comment","explain","hint","j","lean","limit","maxTimeMS","populate","projection","read","select","skip","slice","sort","tailable","w","writeConcern","wtimeout"]),uOe=new Set(["find","findOne","findOneAndDelete","findOneAndReplace","findOneAndUpdate"]),aOe=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"]]),z=Symbol("mongoose#Query#update");function q(e,t,r,n){if(!this._mongooseOptions)this._mongooseOptions={};t=t||{},this._transforms=[],this._hooks=new qf,this._execCount=0;let s=Object.keys(t);for(let o of s)this._mongooseOptions[o]=t[o];if(n)this.mongooseCollection=n;if(r)this.model=r,this.schema=r.schema;if(this.model?._mapreduce)this.lean();if(Vf.call(this,null,t),n)this.collection(n);if(e)this.find(e);this.options=this.options||{},this.$useProjection=!0;let i=this?.schema?.options?.collation||null;if(i!=null)this.options.collation=i}function PO(e){if(e==null)return!0;if(typeof e!=="object")return!0;for(let t of Object.keys(e)){let r=e[t];if(t==="$comment"||t==="$alwaysTrue")continue;if(!Array.isArray(r))return!1;if((t==="$and"||t==="$nor")&&r.every(PO))continue;if(t==="$or"&&(r.length===0||r.some(PO)))continue;return!1}return!0}function Oa(e,t){if(t?.requireFilter&&PO(e))throw new ft("Empty or invalid filter not allowed with requireFilter enabled")}/*!
905
- * inherit mquery
906
- */q.prototype=new Vf;q.prototype.constructor=q;Object.defineProperty(q.prototype,"_update",{configurable:!0,enumerable:!0,get:function(){return lc(this),this[z]},set:function(e){this[z]=e}});q.prototype.count=void 0;q.prototype.findOneAndRemove=void 0;q.base=Vf.prototype;/*!
907
- * Overwrite mquery's `_distinct`, because Mongoose uses that name
908
- * to store the field to apply distinct on.
909
- */Object.defineProperty(q.prototype,"_distinct",{configurable:!0,writable:!0,enumerable:!0,value:void 0});q.prototype.toConstructor=function(){let t=this.model,r=this.mongooseCollection,n=function(o,u){if(!(this instanceof n))return new n(o,u);this._mongooseOptions=xO(s._mongooseOptions),q.call(this,o,u||null,t,r)};xi.inherits(n,t.Query);let s=n.prototype;s.options={};let i=Object.assign({},this.options);if(i.sort!=null)s.sort(i.sort),delete i.sort;return s.setOptions(i),s.op=this.op,s._conditions=bs(this._conditions),s._fields=bs(this._fields),s[z]=bs(this[z],{flattenDecimals:!1}),s._path=this._path,s._distinct=this._distinct,s._collection=this._collection,s._mongooseOptions=xO(this._mongooseOptions),n};q.prototype.clone=function(){let e=this.model,t=this.mongooseCollection,r=new this.model.Query({},{},e,t),n=Object.assign({},this.options);if(n.sort!=null)r.sort(n.sort),delete n.sort;return r.setOptions(n),r.op=this.op,r._conditions=bs(this._conditions),r._fields=bs(this._fields),r[z]=bs(this[z],{flattenDecimals:!1}),r._path=this._path,r._distinct=this._distinct,r._collection=this._collection,r._mongooseOptions=xO(this._mongooseOptions),r};q.prototype.where=function(t){if(typeof t==="string"&&Mi.has(t))throw new ft(`Cannot use \`${t}\` as a query path`);return q.base.where.apply(this,arguments)};q.prototype.slice=function(...e){if(e.length===0)return this;this._validate("slice");let t,r;if(e.length===1){let s=e[0];if(typeof s==="object"&&!Array.isArray(s)){let i=Object.keys(s),o=i.length;for(let u=0;u<o;++u)this.slice(i[u],s[i[u]]);return this}this._ensurePath("slice"),t=this._path,r=e[0]}else if(e.length===2)if(typeof e[0]==="number")this._ensurePath("slice"),t=this._path,r=[e[0],e[1]];else t=e[0],r=e[1];else if(e.length===3)t=e[0],r=[e[1],e[2]];let n={};return n[t]={$slice:r},this.select(n),this};/*!
910
- * ignore
911
- */var cOe=new Set(nOe);q.prototype._validateOp=function(){if(this.op!=null&&!cOe.has(this.op))this.error(Error('Query has invalid `op`: "'+this.op+'"'));if(this.op!=="estimatedDocumentCount"&&this._conditions==null)throw new uu(this._conditions,"filter",this.op)};q.prototype.mod=function(){let e,t;if(arguments.length===1)this._ensurePath("mod"),e=arguments[0],t=this._path;else if(arguments.length===2&&!Array.isArray(arguments[1]))this._ensurePath("mod"),e=[arguments[0],arguments[1]],t=this._path;else if(arguments.length===3)e=[arguments[1],arguments[2]],t=arguments[0];else e=arguments[1],t=arguments[0];if(t!=null&&Mi.has(String(t)))throw new ft(`Cannot use \`${t}\` as a query path`);let r=Object.hasOwn(this._conditions,t)&&this._conditions[t]||(this._conditions[t]={});return r.$mod=e,this};q.prototype.limit=function(t){if(this._validate("limit"),typeof t==="string")try{t=V2(t)}catch{throw new kf("Number",t,"limit")}return this.options.limit=t,this};q.prototype.skip=function(t){if(this._validate("skip"),typeof t==="string")try{t=V2(t)}catch{throw new kf("Number",t,"skip")}return this.options.skip=t,this};q.prototype.projection=function(e){if(arguments.length===0)return this._fields;return this._fields={},this._userProvidedFields={},this.select(e),this._fields};q.prototype.select=function(){let t=arguments[0];if(!t)return this;if(arguments.length!==1)throw new ft("Invalid select: select only takes 1 argument");this._validate("select");let r=this._fields||(this._fields={}),n=this._userProvidedFields||(this._userProvidedFields={}),s=void 0;if(this.model!=null&&X.hasUserDefinedProperty(this.model.db.options,"sanitizeProjection"))s=this.model.db.options.sanitizeProjection;else if(this.model!=null&&X.hasUserDefinedProperty(this.model.base.options,"sanitizeProjection"))s=this.model.base.options.sanitizeProjection;else s=this._mongooseOptions.sanitizeProjection;function i(o){return typeof o==="string"&&s?o=1:o}if(t=Z4e(t,!0),X.isObject(t)){if(Object.hasOwn(t,"__proto__"))t={...t},delete t.__proto__;if(this.selectedInclusively())Object.entries(t).forEach(([o,u])=>{if(u){if(r["-"+o]!=null)delete r["-"+o];r[o]=n[o]=i(u)}else Object.keys(n).forEach((a)=>{if(VG(o,a))delete r[a],delete n[a]})});else if(this.selectedExclusively())Object.entries(t).forEach(([o,u])=>{if(!u){if(r["+"+o]!=null)delete r["+"+o];r[o]=n[o]=i(u)}else Object.keys(n).forEach((a)=>{if(VG(o,a))delete r[a],delete n[a]})});else{let o=Object.keys(t);for(let u=0;u<o.length;++u){let a=t[o[u]],c=o[u];r[c]=i(a),n[c]=i(a)}}return this}throw TypeError("Invalid select() argument. Must be string or object.")};q.prototype.schemaLevelProjections=function(t){return this._mongooseOptions.schemaLevelProjections=t,this};q.prototype.sanitizeProjection=function(t){return this._mongooseOptions.sanitizeProjection=t,this};q.prototype.read=function(t,r){if(typeof t==="string")t=j4e(t),this.options.readPreference={mode:t,tags:r};else this.options.readPreference=t;return this};q.prototype.toString=function(){if(this.op==="count"||this.op==="countDocuments"||this.op==="find"||this.op==="findOne"||this.op==="deleteMany"||this.op==="deleteOne"||this.op==="findOneAndDelete"||this.op==="remove")return`${this.model.modelName}.${this.op}(${xi.inspect(this._conditions)})`;if(this.op==="distinct")return`${this.model.modelName}.distinct('${this._distinct}', ${xi.inspect(this._conditions)})`;if(this.op==="findOneAndReplace"||this.op==="findOneAndUpdate"||this.op==="replaceOne"||this.op==="update"||this.op==="updateMany"||this.op==="updateOne")return`${this.model.modelName}.${this.op}(${xi.inspect(this._conditions)}, ${xi.inspect(this[z])})`;return`${this.model.modelName}.${this.op}()`};q.prototype.session=function(t){if(t==null)delete this.options.session;return this.options.session=t,this};q.prototype.writeConcern=function(t){if(t==null)return delete this.options.writeConcern,this;return this.options.writeConcern=t,this};q.prototype.w=function(t){if(t==null)delete this.options.w;if(this.options.writeConcern!=null)this.options.writeConcern.w=t;else this.options.w=t;return this};q.prototype.j=function(t){if(t==null)delete this.options.j;if(this.options.writeConcern!=null)this.options.writeConcern.j=t;else this.options.j=t;return this};q.prototype.wtimeout=function(t){if(t==null)delete this.options.wtimeout;if(this.options.writeConcern!=null)this.options.writeConcern.wtimeout=t;else this.options.wtimeout=t;return this};q.prototype.getOptions=function(){return this.options};q.prototype.setOptions=function(e,t){if(t){if(this._mongooseOptions=e&&bs(e)||{},this.options=e||{},"populate"in e)this.populate(this._mongooseOptions);return this}if(e==null)return this;if(typeof e!=="object")throw new ft('Options must be an object, got "'+e+'"');if(e=Object.assign({},e),Array.isArray(e.populate)){let r=e.populate;delete e.populate;let n=r.length;for(let s=0;s<n;++s)this.populate(r[s])}if("cloneUpdate"in e)this._mongooseOptions.cloneUpdate=e.cloneUpdate,delete e.cloneUpdate;if("defaults"in e)this._mongooseOptions.defaults=e.defaults;if(e.lean==null&&this.schema&&"lean"in this.schema.options)this._mongooseOptions.lean=this.schema.options.lean;if("overwriteDiscriminatorKey"in e)this._mongooseOptions.overwriteDiscriminatorKey=e.overwriteDiscriminatorKey,delete e.overwriteDiscriminatorKey;if("overwriteImmutable"in e)this._mongooseOptions.overwriteImmutable=e.overwriteImmutable,delete e.overwriteImmutable;if("sanitizeFilter"in e)this._mongooseOptions.sanitizeFilter=e.sanitizeFilter,delete e.sanitizeFilter;if("sanitizeProjection"in e){if(e.sanitizeProjection&&!this._mongooseOptions.sanitizeProjection)HG(this._fields);this._mongooseOptions.sanitizeProjection=e.sanitizeProjection,delete e.sanitizeProjection}if("schemaLevelProjections"in e)this._mongooseOptions.schemaLevelProjections=e.schemaLevelProjections,delete e.schemaLevelProjections;if("setDefaultsOnInsert"in e)this._mongooseOptions.setDefaultsOnInsert=e.setDefaultsOnInsert,delete e.setDefaultsOnInsert;if("strict"in e)this._mongooseOptions.strict=e.strict,delete e.strict;if("strictQuery"in e)this._mongooseOptions.strictQuery=e.strictQuery,delete e.strictQuery;if("timestamps"in e)this._mongooseOptions.timestamps=e.timestamps,delete e.timestamps;if("translateAliases"in e)this._mongooseOptions.translateAliases=e.translateAliases,delete e.translateAliases;if("updatePipeline"in e)this._mongooseOptions.updatePipeline=e.updatePipeline,delete e.updatePipeline;if(typeof e.limit==="string")try{e.limit=V2(e.limit)}catch{throw new kf("Number",e.limit,"limit")}if(typeof e.skip==="string")try{e.skip=V2(e.skip)}catch{throw new kf("Number",e.skip,"skip")}for(let r of Object.keys(e))if(oOe.has(r)){let n=Array.isArray(e[r])?e[r]:[e[r]];this[r].apply(this,n)}else this.options[r]=e[r];return this};q.prototype.explain=function(t){if(arguments.length===0)this.options.explain=!0;else if(t===!1)delete this.options.explain;else this.options.explain=t;return this};q.prototype.allowDiskUse=function(e){if(arguments.length===0)this.options.allowDiskUse=!0;else if(e===!1)delete this.options.allowDiskUse;else this.options.allowDiskUse=e;return this};q.prototype.maxTimeMS=function(e){return this.options.maxTimeMS=e,this};q.prototype.getFilter=function(){return this._conditions};q.prototype.getQuery=function(){return this._conditions};q.prototype.setQuery=function(e){this._conditions=e};q.prototype.getUpdate=function(){return this._update};q.prototype.setUpdate=function(e,t){if(this[z]=t===!1?e:bs(e),t!=null)this._mongooseOptions.cloneUpdate=t;this._updateIsShared=!1};q.prototype._fieldsForExec=function(){if(this._fields==null)return null;if(X.hasOwnKeys(this._fields)===!1)return null;return bs(this._fields)};q.prototype._updateForExec=function(){let e=bs(this[z],{transform:!1,depopulate:!0}),t=Object.keys(e),r=t.length,n={};while(r--){let s=t[r];if(s[0]!=="$"){if(!n.$set)if(e.$set)n.$set=e.$set;else n.$set={};if(n.$set[s]=e[s],t.splice(r,1),!~t.indexOf("$set"))t.push("$set")}else if(s==="$set"){if(!n.$set)n[s]=e[s]}else n[s]=e[s]}return n};q.prototype._optionsForExec=function(e){let t=bs(this.options);if(delete t.populate,e=e||this.model,!e)return t;if(X.isEmptyObject(t.sort))delete t.sort;else if(t.sort==null&&!t.tailable&&uOe.has(this.op)){let s=this.schema?.options.defaultSort;if(s&&!GG(this._conditions))t.sort=YG({},s)}L4e(e.schema,t),U4e(e.schema,t);let r=this.model?.db?.base.transactionAsyncLocalStorage?.getStore();if(!Object.hasOwn(this.options,"session")&&r?.session!=null)t.session=r.session;let n=e?.schema?.options?.read;if(!("readPreference"in t)&&n)t.readPreference=n;if(t.upsert!==void 0)t.upsert=!!t.upsert;if(t.writeConcern){if(t.j)t.writeConcern.j=t.j,delete t.j;if(t.w)t.writeConcern.w=t.w,delete t.w;if(t.wtimeout)t.writeConcern.wtimeout=t.wtimeout,delete t.wtimeout}if(this._applyPaths(),this._fields!=null){this._fields=this._castFields(this._fields);let s=this._fieldsForExec();if(s!=null)t.projection=s}return t};q.prototype.lean=function(e){return this._mongooseOptions.lean=arguments.length?e:!0,this};q.prototype.set=function(e,t){if(lc(this),typeof e==="object"){let n=Object.keys(e);for(let s of n)this.set(s,e[s]);return this}let r=this[z];if(r==null)r={},this[z]=r;if(e in r)delete r[e];return r.$set=r.$set||{},r.$set[e]=t,this};q.prototype.get=function(t){let r=this[z];if(r==null)return;let n=r.$set;if(n==null)return r[t];if(X.hasUserDefinedProperty(r,t))return r[t];if(X.hasUserDefinedProperty(n,t))return n[t];return};q.prototype.error=function(t){if(arguments.length===0)return this._error;return this._error=t,this};q.prototype._unsetCastError=function(){if(this._error==null||!(this._error instanceof kf))return;return this.error(null)};q.prototype.mongooseOptions=function(e){if(arguments.length>0)this._mongooseOptions=e;return this._mongooseOptions};q.prototype._castConditions=function(){if(this.model?.db.config?.sanitizeFilter??this.model?.db.options?.sanitizeFilter??this.model?.base.options.sanitizeFilter??this._mongooseOptions.sanitizeFilter)eOe(this._conditions);try{this.cast(this.model),this._unsetCastError()}catch(t){this.error(t)}};/*!
912
- * ignore
913
- */function W2(e){try{z4e(e)}catch(t){e.error(t)}}q.prototype._find=async function(){if(this._applyTranslateAliases(),this._castConditions(),this.error()!=null)throw this.error();let t=this._mongooseOptions,r=this._userProvidedFields||{},n=this.model.db.options,s=this.model.base.options;Lf(this.options,n,s),Uf(this.options,n,s);let i={session:this?.options?.session||null,lean:t.lean||null};if(t.defaults!=null)i.defaults=t.defaults;let o=this._optionsForExec(),u=this._conditions,a=o.projection,c=await this.mongooseCollection.find(u,o);if(o.explain)return c.explain(o.explain);let l=await c.toArray();if(l.length===0)return l;if(!t.populate){let h=this.schema.options.versionKey;if(t.lean?.versionKey===!1&&h)l.forEach((d)=>{if(h in d)delete d[h]});return t.lean?QG(this.model.schema,l,null,i):this._completeMany(l,a,r,i)}let f=Fo.preparePopulationOptionsMQ(this,t);if(this.options?._deferPopulate)return l=t.lean?l:await this._completeMany(l,a,r,i),this._deferredPopulate=f,l;if(t.lean)return this.model.populate(l,f);return l=await this._completeMany(l,a,r,i),await this.model.populate(l,f),l};q.prototype.find=function(e){if(typeof e==="function"||typeof arguments[1]==="function")throw new ft("Query.prototype.find() no longer accepts a callback");if(this.op="find",au(e))this.merge(e),zf(this);else if(e!=null)this.error(new uu(e,"filter","find"));return this};q.prototype.findAndCount=async function(){if(this.options.sort==null&&!this.schema?.options.defaultSort)throw new ft("Query.prototype.findAndCount() requires sort. Use `sort()` to set a sort order before calling `findAndCount()`.");if(X.isEmptyObject(this.options.sort))throw new ft("Query.prototype.findAndCount() does not allow an empty sort, like `sort(null)`. Remove the `sort()` call to use the schema's `defaultSort`.");if(this.options.limit==null)throw new ft("Query.prototype.findAndCount() requires limit. Use `limit()` to set a limit before calling `findAndCount()`.");this.op="find";let t=this.clone().countDocuments().skip(0).limit(null);return Promise.all([this.exec(),t.exec()])};q.prototype.merge=function(e){if(!e){if(e===null)this._conditions=null;return this}this._conditions=this._conditions??{};let t={overwrite:!0};if(e instanceof q){if(e._conditions){if(t.omit={},this._conditions&&this._conditions.$and&&e._conditions.$and)t.omit.$and=!0,this._conditions.$and=this._conditions.$and.concat(e._conditions.$and);if(this._conditions&&this._conditions.$or&&e._conditions.$or)t.omit.$or=!0,this._conditions.$or=this._conditions.$or.concat(e._conditions.$or);X.merge(this._conditions,e._conditions,t)}if(e._fields)this._fields||(this._fields={}),X.merge(this._fields,e._fields,t);if(e.options)this.options||(this.options={}),X.merge(this.options,e.options,t);if(e[z]!=null)lc(this),this[z]||(this[z]={}),X.mergeClone(this[z],e[z]);if(e._distinct)this._distinct=e._distinct;return X.merge(this._mongooseOptions,e._mongooseOptions),this}else if(this.model!=null&&e instanceof this.model.base.Types.ObjectId)return X.merge(this._conditions,{_id:e},t),this;else if(J4e(e))e=e.toObject(K4e);if(t.omit={},Array.isArray(e.$and)){if(t.omit.$and=!0,!this._conditions)this._conditions={};this._conditions.$and=(this._conditions.$and||[]).concat(e.$and.map((r)=>X.isPOJO(r)?X.merge({},r):r))}if(Array.isArray(e.$or)){if(t.omit.$or=!0,!this._conditions)this._conditions={};this._conditions.$or=(this._conditions.$or||[]).concat(e.$or.map((r)=>X.isPOJO(r)?X.merge({},r):r))}return X.merge(this._conditions,e,t),this};q.prototype.collation=function(e){if(this.options==null)this.options={};return this.options.collation=e,this};q.prototype._completeOne=function(e,t,r,n){if(!e&&!this.options.includeResultMetadata)return n(null,null);let s=this.model,i=this._userProvidedFields||{},o=this._mongooseOptions,u=this.options;if(!u.lean&&o.lean)u.lean=o.lean;if(u.explain)return n(null,e);if(!o.populate){let c=this.schema.options.versionKey;if(o.lean?.versionKey===!1&&c){if(c in e)delete e[c]}return o.lean?BO(s.schema,e,null,t,u,n):zG(s,e,t,u,r,i,null,n)}let a=Fo.preparePopulationOptionsMQ(this,this._mongooseOptions);if(o.lean)return s.populate(e,a).then((c)=>{BO(s.schema,c,null,t,u,n)},(c)=>{n(c)});zG(s,e,t,u,r,i,[],(c,l)=>{if(c!=null)return n(c);s.populate(l,a).then((f)=>{n(null,f)},(f)=>{n(f)})})};q.prototype._completeMany=async function(t,r,n,s){let i=this.model;return Promise.all(t.map((o)=>new Promise((u,a)=>{let c=o;if(o=Fo.createModel(i,o,r,n,s),s.session!=null)o.$session(s.session);o.$init(c,s,(l)=>{if(l!=null)return a(l);u(o)})})))};q.prototype._findOne=async function(){if(this._applyTranslateAliases(),this._castConditions(),this.error())throw this.error();let t=this.model.db.options,r=this.model.base.options;Lf(this.options,t,r),Uf(this.options,t,r);let n=this._optionsForExec(),s=await this.mongooseCollection.findOne(this._conditions,n);return new Promise((i,o)=>{this._completeOne(s,null,n.projection,(u,a)=>{if(u)return o(u);i(a)})})};q.prototype.findOne=function(e,t,r){if(typeof e==="function"||typeof t==="function"||typeof r==="function"||typeof arguments[3]==="function")throw new ft("Query.prototype.findOne() no longer accepts a callback");if(this.op="findOne",r)this.setOptions(r);if(t)this.select(t);if(au(e))this.merge(e),zf(this);else if(e!=null)this.error(new uu(e,"filter","findOne"));return this};q.prototype._countDocuments=async function(){if(this._applyTranslateAliases(),this._castConditions(),this.error())throw this.error();let t=this.model.db.options,r=this.model.base.options;Lf(this.options,t,r),Uf(this.options,t,r);let n=this._optionsForExec(),s=this._conditions;return this.mongooseCollection.countDocuments(s,n)};/*!
914
- * If `translateAliases` option is set, call `Model.translateAliases()`
915
- * on the following query properties: filter, projection, update, distinct.
916
- */q.prototype._applyTranslateAliases=function(){let t=!1;if("translateAliases"in this._mongooseOptions)t=this._mongooseOptions.translateAliases;else if(this.model?.schema?._userProvidedOptions?.translateAliases!=null)t=this.model.schema._userProvidedOptions.translateAliases;else if(this.model?.base?.options?.translateAliases!=null)t=this.model.base.options.translateAliases;if(!t)return;if(this.model?.schema?.aliases&&X.hasOwnKeys(this.model.schema.aliases)){if(lc(this),this.model.translateAliases(this._conditions,!0),this.model.translateAliases(this._fields,!0),this.model.translateAliases(this[z],!0),this._distinct!=null&&this.model.schema.aliases[this._distinct]!=null)this._distinct=this.model.schema.aliases[this._distinct]}};q.prototype._estimatedDocumentCount=async function(){if(this.error())throw this.error();let t=this._optionsForExec();return this.mongooseCollection.estimatedDocumentCount(t)};q.prototype.estimatedDocumentCount=function(e){if(typeof e==="function"||typeof arguments[1]==="function")throw new ft("Query.prototype.estimatedDocumentCount() no longer accepts a callback");if(this.op="estimatedDocumentCount",e!=null)this.setOptions(e);return this};q.prototype.countDocuments=function(e,t){if(typeof e==="function"||typeof t==="function"||typeof arguments[2]==="function")throw new ft("Query.prototype.countDocuments() no longer accepts a callback");if(this.op="countDocuments",au(e))this.merge(e);if(t!=null)this.setOptions(t);return this};q.prototype.__distinct=async function(){if(this._applyTranslateAliases(),this._castConditions(),this.error())throw this.error();let t=this.model.db.options,r=this.model.base.options;Lf(this.options,t,r),Uf(this.options,t,r);let n=this._optionsForExec();return this.mongooseCollection.distinct(this._distinct,this._conditions,n)};q.prototype.distinct=function(e,t,r){if(typeof e==="function"||typeof t==="function"||typeof r==="function"||typeof arguments[3]==="function")throw new ft("Query.prototype.distinct() no longer accepts a callback");if(this.op="distinct",au(t))this.merge(t),zf(this);else if(t!=null)this.error(new uu(t,"filter","distinct"));if(e!=null)this._distinct=e;if(r!=null)this.setOptions(r);return this};q.prototype.sort=function(e,t){if(arguments.length>2)throw new ft("sort() takes at most 2 arguments");if(t!=null&&typeof t!=="object")throw new ft("sort() options argument must be an object or nullish");if(this.options.sort==null)this.options.sort={};if(t?.override)this.options.sort={};return YG(this.options.sort,e),this};/*!
917
- * Returns true if `filter` has a `$near` or `$nearSphere` condition, including within logical operators.
918
- */function GG(e){for(let t of Object.keys(e)){let r=e[t];if(r==null||typeof r!=="object")continue;if(X4e.has(t)){if(Array.isArray(r)&&r.some((n)=>n!=null&&typeof n==="object"&&GG(n)))return!0}else if(Object.hasOwn(r,"$near")||Object.hasOwn(r,"$nearSphere"))return!0}return!1}/*!
919
- * Add the keys from `arg`, which can be any value that `Query.prototype.sort()` accepts, to the `sort` object.
920
- */function YG(e,t){if(typeof t==="string"){let r=t.indexOf(" ")===-1?[t]:t.split(" ");for(let n of r){let s=n[0]=="-"?-1:1;if(s===-1)n=n.slice(1);if(Mi.has(n))continue;e[n]=s}}else if(Array.isArray(t))for(let r of t){if(!Array.isArray(r))throw TypeError("Invalid sort() argument, must be array of arrays");let n=""+r[0];if(Mi.has(n))continue;e[n]=MO(r[1],n)}else if(typeof t==="object"&&t!=null&&!(t instanceof Map))for(let r of Object.keys(t)){if(Mi.has(r))continue;e[r]=MO(t[r],r)}else if(t instanceof Map)for(let r of t.keys()){if(r=""+r,Mi.has(r))continue;e[r]=MO(t.get(r),r)}else if(t!=null)throw TypeError("Invalid sort() argument. Must be a string, object, array, or map.");return e}/*!
921
- * Convert sort values
922
- */function MO(e,t){if(e===1||e==="asc"||e==="ascending")return 1;if(e===-1||e==="desc"||e==="descending")return-1;if(e!=null&&Object.hasOwn(e,"$meta")&&e.$meta!=null)return{$meta:e.$meta};throw TypeError("Invalid sort value: { "+t+": "+e+" }")}q.prototype.deleteOne=function(t,r){if(typeof t==="function"||typeof r==="function"||typeof arguments[2]==="function")throw new ft("Query.prototype.deleteOne() no longer accepts a callback");if(this.op="deleteOne",this.setOptions(r),au(t))this.merge(t),zf(this);else if(t!=null)this.error(new uu(t,"filter","deleteOne"));return this};q.prototype._deleteOne=async function(){if(this._applyTranslateAliases(),this._castConditions(),Oa(this._conditions,this.options),this.error()!=null)throw this.error();let t=this._optionsForExec();return this.mongooseCollection.deleteOne(this._conditions,t)};q.prototype.deleteMany=function(e,t){if(typeof e==="function"||typeof t==="function"||typeof arguments[2]==="function")throw new ft("Query.prototype.deleteMany() no longer accepts a callback");if(this.setOptions(t),this.op="deleteMany",au(e))this.merge(e),zf(this);else if(e!=null)this.error(new uu(e,"filter","deleteMany"));return this};q.prototype._deleteMany=async function(){if(this._applyTranslateAliases(),this._castConditions(),Oa(this._conditions,this.options),this.error()!=null)throw this.error();let t=this._optionsForExec();return this.mongooseCollection.deleteMany(this._conditions,t)};function zG(e,t,r,n,s,i,o,u){if(n.includeResultMetadata&&t==null)return a(null),null;Fo.createModelAndInit(e,t,s,i,n,o,a);function a(c,l){if(c)return u(c);if(n.includeResultMetadata){if(t&&l){if(n.session!=null)l.$session(n.session);r.value=l}else r.value=null;return u(null,r)}if(n.session!=null)l.$session(n.session);u(null,l)}}function zf(e){if(!e?.model?.schema)return;let t=e.model.schema;if(t?.discriminatorMapping&&!t.discriminatorMapping.isRoot)e._conditions[t.discriminatorMapping.key]=t.discriminatorMapping.value}q.prototype.findOneAndUpdate=function(e,t,r){if(typeof e==="function"||typeof t==="function"||typeof r==="function"||typeof arguments[3]==="function")throw new ft("Query.prototype.findOneAndUpdate() no longer accepts a callback");switch(this.op="findOneAndUpdate",this._validate(),arguments.length){case 2:r=void 0;break;case 1:t=e,e=r=void 0;break}if(au(e))this.merge(e);else if(e!=null)this.error(new uu(e,"filter","findOneAndUpdate"));if(r=r?bs(r):{},r.projection)this.select(r.projection),delete r.projection;if(r.fields)this.select(r.fields),delete r.fields;let n=this?.model?.base?.options?.returnDocument,s=this?.model?.base?.options?.returnOriginal;if(r.new==null&&r.returnDocument==null&&r.returnOriginal==null){if(n!=null)r.returnDocument=n;else if(s!=null)r.returnOriginal=s}let i=this?.model?.base?.options?.updatePipeline;if(r.updatePipeline==null&&i!=null)r.updatePipeline=i;if(!r.updatePipeline&&Array.isArray(t))throw new ft("Cannot pass an array to query updates unless the `updatePipeline` option is set.");if(this.setOptions(r),t)if(this[z]==null||X.isEmptyObject(this[z]))this[z]=t,this._updateIsShared=!0;else this._mergeUpdate(t);return this};q.prototype._findOneAndUpdate=async function(){if(this._applyTranslateAliases(),this._castConditions(),Oa(this._conditions,this.options),W2(this),this.error())throw this.error();let t=this.model.db.options,r=this.model.base.options;Lf(this.options,t,r),Uf(this.options,t,r);let n=this._optionsForExec(this.model);if(JG(n),this[z]=this._castUpdate(this[z]),this._updateIsShared=!1,H4e(this[z],n,this.schema.options.versionKey),this[z]=NO(this._conditions,this.model.schema,this[z],n,this._mongooseOptions,this),!this[z]||X.hasOwnKeys(this[z])===!1)if(n.upsert){let u=bs(this[z]);delete u._id,this[z]={$set:u}}else return this._execCount=0,await this._findOne();else if(this[z]instanceof Error)throw this[z];else if(this[z].$set&&X.hasOwnKeys(this[z].$set)===!1)delete this[z].$set;if(Wf(this,"runValidators",!1))await this.validate(this[z],n,!1);if(typeof this[z].toBSON==="function")this[z]=this[z].toBSON();let i=await this.mongooseCollection.findOneAndUpdate(this._conditions,this[z],n);for(let u of this._transforms)i=u(i);let o=!n.includeResultMetadata?i:i.value;return new Promise((u,a)=>{this._completeOne(o,i,n.projection,(c,l)=>{if(c)return a(c);u(l)})})};q.prototype.findOneAndDelete=function(e,t){if(typeof e==="function"||typeof t==="function"||typeof arguments[2]==="function")throw new ft("Query.prototype.findOneAndDelete() no longer accepts a callback");if(this.op="findOneAndDelete",this._validate(),au(e))this.merge(e);return t&&this.setOptions(t),this};q.prototype._findOneAndDelete=async function(){if(this._applyTranslateAliases(),this._castConditions(),Oa(this._conditions,this.options),this.error()!=null)throw this.error();let t=this.options.includeResultMetadata,r=this._conditions,n=this._optionsForExec(this.model),s=await this.mongooseCollection.findOneAndDelete(r,n);for(let o of this._transforms)s=o(s);let i=!t?s:s.value;return new Promise((o,u)=>{this._completeOne(i,s,n.projection,(a,c)=>{if(a)return u(a);o(c)})})};q.prototype.findOneAndReplace=function(e,t,r){if(typeof e==="function"||typeof t==="function"||typeof r==="function"||typeof arguments[4]==="function")throw new ft("Query.prototype.findOneAndReplace() no longer accepts a callback");if(this.op="findOneAndReplace",this._validate(),au(e))this.merge(e);else if(e!=null)this.error(new uu(e,"filter","findOneAndReplace"));if(t!=null)this._mergeUpdate(t);r=r||{};let n=this?.model?.base?.options?.returnDocument,s=this?.model?.base?.options?.returnOriginal;if(r.new==null&&r.returnDocument==null&&r.returnOriginal==null){if(n!=null)r.returnDocument=n;else if(s!=null)r.returnOriginal=s}return this.setOptions(r),this};q.prototype._findOneAndReplace=async function(){if(this._applyTranslateAliases(),this._castConditions(),Oa(this._conditions,this.options),this.error()!=null)throw this.error();let t=this._conditions,r=this._optionsForExec();JG(r);let n=this.options.includeResultMetadata,s={skipId:!0};if("strict"in this._mongooseOptions)s.strict=this._mongooseOptions.strict;let i=Wf(this,"runValidators",!1);try{let a=new this.model(this[z],null,s);if(i)await a.validate();else if(a.$__.validationError)throw a.$__.validationError;this[z]=a.toBSON()}catch(a){if(a instanceof jf)throw a;let c=new jf;throw c.errors[a.path]=a,c}let o=await this.mongooseCollection.findOneAndReplace(t,this[z],r);for(let a of this._transforms)o=a(o);let u=!n?o:o.value;return new Promise((a,c)=>{this._completeOne(u,o,r.projection,(l,f)=>{if(l)return c(l);a(f)})})};q.prototype.findById=function(e,t,r){return this.findOne({_id:e},t,r)};q.prototype.findByIdAndUpdate=function(e,t,r){return this.findOneAndUpdate({_id:e},t,r)};q.prototype.findByIdAndDelete=function(e,t){return this.findOneAndDelete({_id:e},t)};function JG(e){if("new"in e){let t=e.new?"'after'":"'before'";X.warn("mongoose: the `new` option for `findOneAndUpdate()` and `findOneAndReplace()` is deprecated. Use `returnDocument: "+t+"` instead."),e.returnDocument=e.new?"after":"before",delete e.new}if("returnOriginal"in e){let t=e.returnOriginal?"'before'":"'after'";X.warn("mongoose: the `returnOriginal` option for `findOneAndUpdate()` and `findOneAndReplace()` is deprecated. Use `returnDocument: "+t+"` instead."),e.returnDocument=e.returnOriginal?"before":"after",delete e.returnOriginal}if(typeof e.returnDocument==="string")e.returnOriginal=e.returnDocument==="before"}function Wf(e,t,r){let n=e._optionsForExec(e.model);if(t in n)return n[t];if(t in e.model.base.options)return e.model.base.options[t];return r}/*!
923
- * ignore
924
- */function BO(e,t,r,n,s,i){if(s.lean&&typeof s.lean.transform==="function"){s.lean.transform(t);for(let o=0;o<e.childSchemas.length;o++){let u=r?r+"."+e.childSchemas[o].model.path:e.childSchemas[o].model.path,a=e.childSchemas[o].schema,c=z2.get(u,t);if(c==null)continue;if(Array.isArray(c))for(let l=0;l<c.length;l++)s.lean.transform(c[l]);else s.lean.transform(c);BO(a,c,u,n,s)}if(i)return i(null,t);else return}if(s.includeResultMetadata)return i(null,n);return i(null,t)}/*!
925
- * ignore
926
- */function QG(e,t,r,n){if(n.lean&&typeof n.lean.transform==="function"){for(let s of t)n.lean.transform(s);for(let s=0;s<e.childSchemas.length;s++){let i=r?r+"."+e.childSchemas[s].model.path:e.childSchemas[s].model.path,o=e.childSchemas[s].schema,u=z2.get(i,t);if(u==null)continue;u=u.flat();for(let a=0;a<u.length;a++)n.lean.transform(u[a]);QG(o,u,i,n)}}return t}q.prototype._mergeUpdate=function(e){if(lc(this),!this._mongooseOptions.updatePipeline&&Array.isArray(e))throw new ft("Cannot pass an array to query updates unless the `updatePipeline` option is set.");if(!this[z])this[z]=Array.isArray(e)?[]:{};if(e==null||typeof e==="object"&&X.hasOwnKeys(e)===!1)return;if(e instanceof q){if(Array.isArray(this[z]))throw new ft(`Cannot mix array and object updates (current: ${V1(this[z])}, incoming: ${V1(e[z])})`);if(e[z])X.mergeClone(this[z],e[z])}else if(Array.isArray(e)){if(!Array.isArray(this[z]))if(this[z]==null||X.isEmptyObject(this[z]))this[z]=[];else throw new ft(`Cannot mix array and object updates (current: ${V1(this[z])}, incoming: ${V1(e)})`);this[z]=this[z].concat(e)}else{if(Array.isArray(this[z]))throw new ft(`Cannot mix array and object updates (current: ${V1(this[z])}, incoming: ${V1(e)})`);X.mergeClone(this[z],e)}};function V1(e){let t=xi.inspect(e,{depth:2,maxArrayLength:5,breakLength:80,compact:!0});if(t.length>200)return`${t.slice(0,197)}...`;return t}q.prototype.validate=async function(t,r,n){if(typeof arguments[3]==="function")throw new ft("Query.prototype.validate() no longer accepts a callback");if(await ZG(this,"validate"),n)await t.$validate();else{let s=await rOe(this,this.model.schema,t,r);if(s.length>0){let i=new jf(null);for(let o of s)i.addError(o.path,o);throw i}}await XG(this,null,null,"validate")};q.prototype._updateMany=async function(){if(this._applyTranslateAliases(),this._castConditions(),Oa(this._conditions,this.options),W2(this),this.error()!=null)throw this.error();let t=this._optionsForExec(this.model);if(lc(this),this[z]=this._castUpdate(this[z]),this[z]==null||X.hasOwnKeys(this[z])===!1)return{acknowledged:!1};if(FO(this[z],t),this[z]=NO(this._conditions,this.model.schema,this[z],t,this._mongooseOptions,this),Wf(this,"runValidators",!1))await this.validate(this[z],t,!1);if(typeof this[z].toBSON==="function")this[z]=this[z].toBSON();return this.mongooseCollection.updateMany(this._conditions,this[z],t)};q.prototype._updateOne=async function(){if(this._applyTranslateAliases(),this._castConditions(),Oa(this._conditions,this.options),W2(this),this.error()!=null)throw this.error();let t=this._optionsForExec(this.model);if(lc(this),this[z]=this._castUpdate(this[z]),this[z]==null||X.hasOwnKeys(this[z])===!1)return{acknowledged:!1};if(FO(this[z],t),this[z]=NO(this._conditions,this.model.schema,this[z],t,this._mongooseOptions,this),Wf(this,"runValidators",!1))await this.validate(this[z],t,!1);if(typeof this[z].toBSON==="function")this[z]=this[z].toBSON();return this.mongooseCollection.updateOne(this._conditions,this[z],t)};q.prototype._replaceOne=async function(){if(this._applyTranslateAliases(),this._castConditions(),Oa(this._conditions,this.options),W2(this),this.error()!=null)throw this.error();let t=this._optionsForExec(this.model),r={skipId:!0};if("strict"in this._mongooseOptions)r.strict=this._mongooseOptions.strict;let n=Wf(this,"runValidators",!1);try{if(this[z]=new this.model(this[z],null,r),FO(this[z],t),n)await this.validate(this[z],t,!0);else if(this[z].$__.validationError)throw this[z].$__.validationError;if(typeof this[z].toBSON==="function")this[z]=this[z].toBSON()}catch(s){if(s instanceof jf)throw s;let i=new jf;throw i.errors[s.path]=s,i}return this.mongooseCollection.replaceOne(this._conditions,this[z],t)};q.prototype.updateMany=function(e,t,r,n){if(typeof r==="function")n=r,r=void 0;else if(typeof t==="function")n=t,t=e,e={},r=void 0;else if(typeof e==="function")n=e,e=void 0,t=void 0,r=void 0;else if(typeof e==="object"&&!t&&!r&&!n)t=e,e=void 0,r=void 0,n=void 0;return IO(this,"updateMany",e,t,r,n)};q.prototype.updateOne=function(e,t,r,n){if(typeof r==="function")n=r,r=void 0;else if(typeof t==="function")n=t,t=e,e={},r=void 0;else if(typeof e==="function")n=e,e=void 0,t=void 0,r=void 0;else if(typeof e==="object"&&!t&&!r&&!n)t=e,e=void 0,r=void 0,n=void 0;return IO(this,"updateOne",e,t,r,n)};q.prototype.replaceOne=function(e,t,r,n){if(typeof r==="function")n=r,r=void 0;else if(typeof t==="function")n=t,t=e,e={},r=void 0;else if(typeof e==="function")n=e,e=void 0,t=void 0,r=void 0;else if(typeof e==="object"&&!t&&!r&&!n)t=e,e=void 0,r=void 0,n=void 0;return IO(this,"replaceOne",e,t,r,n)};function IO(e,t,r,n,s,i){if(e.op=t,n=n||{},!(r instanceof q)&&r!=null&&r.toString()!=="[object Object]")e.error(new uu(r,"filter",t));else e.merge(r);let o=e?.model?.base?.options?.updatePipeline;if(o!=null&&s?.updatePipeline==null)s=s||{},s.updatePipeline=o;if(!s?.updatePipeline&&Array.isArray(n))throw new ft("Cannot pass an array to query updates unless the `updatePipeline` option is set.");if(X.isObject(s))e.setOptions(s);if(e[z]==null||X.isEmptyObject(e[z]))e[z]=n,e._updateIsShared=!0;else e._mergeUpdate(n);if(i)return e.exec(i),e;return e}q.prototype.transform=function(e){return this._transforms.push(e),this};q.prototype.orFail=function(e){return this.transform((t)=>{switch(this.op){case"find":if(t.length===0)throw z1(e,this);break;case"findOne":if(t==null)throw z1(e,this);break;case"replaceOne":case"updateMany":case"updateOne":if(t?.matchedCount===0)throw z1(e,this);break;case"findOneAndDelete":case"findOneAndUpdate":case"findOneAndReplace":if(this.options.includeResultMetadata&&t!=null&&t.value==null)throw z1(e,this);if(!this.options.includeResultMetadata&&t==null)throw z1(e,this);break;case"deleteMany":case"deleteOne":if(t.deletedCount===0)throw z1(e,this);break;default:break}return t}),this};function z1(e,t){if(typeof e==="function")e=e.call(t);if(e==null)e=new q4e(t.getQuery(),t.model.modelName);return e}q.prototype.isPathSelectedInclusive=function(e){return Q4e(this._fields,e)};q.prototype.exec=async function(t){if(typeof t==="function"||arguments.length>=2&&typeof arguments[1]==="function")throw new ft("Query.prototype.exec() no longer accepts a callback");if(this._validateOp(),typeof t==="string")this.op=t;if(this.op==null)throw new ft("Query must have `op` before executing");if(this.model==null)throw new ft("Query must have an associated model before executing");let r=aOe.get(this.op);if(!r)throw new ft('Query has invalid `op`: "'+this.op+'"');if(this.options?.sort&&typeof this.options.sort==="object"&&Object.hasOwn(this.options.sort,""))throw new ft('Invalid field "" passed to sort()');if(this._execCount>0){let s=this.toString();if(s.length>60)s=s.slice(0,60)+"...";throw new ft("Query was already executed: "+s)}this._execCount++;let n=this;return iOe(async function(){let i=null;try{await n._hooks.execPre("exec",n,[])}catch(a){if(a instanceof qf.skipWrappedFunction)i=a;else throw a}let o,u=null;try{await ZG(n),o=i?i.args[0]:await n[r]();for(let a of n._transforms)o=a(o)}catch(a){if(a instanceof qf.skipWrappedFunction)o=a.args[0];else u=a;u=n.model.schema._transformDuplicateKeyError(u)}return o=await XG(n,o,u),await n._hooks.execPost("exec",n,[]),o},()=>({operation:n.op,collection:n.mongooseCollection.name,database:n.model.db?.name,serverAddress:n.model.db?.host,serverPort:n.model.db?.port,args:{filter:n.getFilter(),fields:n._fields,options:n._mongooseOptions}}))};/*!
927
- * ignore
928
- */async function XG(e,t,r,n){if(e._queryMiddleware==null){if(r!=null)throw r;return t}let i={filter:KG(e.options,"post")};if(r)i.error=r;let[o]=await e._queryMiddleware.execPost(n||e.op,e,[t],i);return o}/*!
929
- * ignore
930
- */function ZG(e,t){if(e._queryMiddleware==null)return;let r=KG(e.options,"pre");return e._queryMiddleware.execPre(t||e.op,e,[],{filter:r})}function lc(e){if(!e._updateIsShared)return;if(e.mongooseOptions().cloneUpdate===!1)return;e[z]=bs(e[z],{flattenDecimals:!1}),e._updateIsShared=!1}q.prototype.then=function(e,t){return this.exec().then(e,t)};q.prototype.catch=function(e){return this.exec().then(null,e)};q.prototype.finally=function(e){return this.exec().finally(e)};q.prototype[Symbol.toStringTag]=function(){return`Query { ${this.op} }`};q.prototype.pre=function(e){return this._hooks.pre("exec",e),this};q.prototype.post=function(e){return this._hooks.post("exec",e),this};q.prototype._castUpdate=function(t){let r=this.schema,n=r.options.discriminatorKey,s=r._baseSchema||r;if(this._mongooseOptions.overwriteDiscriminatorKey&&t[n]!=null&&s.discriminators){let o=Object.values(s.discriminators).find((u)=>u.discriminatorMapping.value===t[n]);if(o!=null)r=o}let i;if("upsert"in this.options)i=this.options.upsert;return W4e(r,t,{strict:this._mongooseOptions.strict,upsert:i,arrayFilters:this.options.arrayFilters,overwriteDiscriminatorKey:this._mongooseOptions.overwriteDiscriminatorKey,overwriteImmutable:this._mongooseOptions.overwriteImmutable},this,this._conditions)};q.prototype.populate=function(...e){if(!e.some(Boolean))return this;let t=X.populate.apply(null,e),r=this._mongooseOptions;if(r.lean!=null){let s=r.lean;for(let i of t)if(i?.options?.lean==null)i.options=i.options||{},i.options.lean=s}if(!X.isObject(r.populate))r.populate={};let n=r.populate;for(let s of t){let i=s.path;if(n[i]?.populate&&s.populate)s.populate=n[i].populate.concat(s.populate);n[s.path]=s}return this};q.prototype.getPopulatedPaths=function(){let t=this._mongooseOptions.populate||{},r=Object.keys(t);for(let n of Object.keys(t)){let s=t[n];if(!Array.isArray(s.populate))continue;eY(r,s.populate,n+".")}return r};/*!
931
- * ignore
932
- */function eY(e,t,r){for(let n of t){if(e.push(r+n.path),!Array.isArray(n.populate))continue;eY(e,n.populate,r+n.path+".")}}q.prototype.cast=function(e,t){t||(t=this._conditions),e=e||this.model;let r=e.schema.options.discriminatorKey;if(t!=null&&Object.hasOwn(t,r))e=WG(e.discriminators,t[r])||e;let n={upsert:this.options?.upsert};if("strict"in this._mongooseOptions)n.strict=this._mongooseOptions.strict;if("strictQuery"in this._mongooseOptions)n.strictQuery=this._mongooseOptions.strictQuery;n.sanitizeFilter=e.db.config?.sanitizeFilter??e.db.options?.sanitizeFilter??e.base.options.sanitizeFilter??this._mongooseOptions.sanitizeFilter;try{return V4e(e.schema,t,n,this)}catch(s){if(typeof s.setModel==="function")s.setModel(e);throw s}};q.prototype._castFields=function(t){let r,n,s,i,o;if(t){s=Object.keys(t),n=[];for(let u=0;u<s.length;++u)if(i=s[u],t[i].$elemMatch)r||(r={}),r[i]=t[i],n.push(i)}if(r){o=this.cast(this.model,r);for(let u=0;u<n.length;++u)i=n[u],t[i]=o[i]}return t};q.prototype._applyPaths=function(){if(!this.model)return;this._fields=this._fields||{};let t=void 0;if(this.model!=null&&X.hasUserDefinedProperty(this.model.db.options,"sanitizeProjection"))t=this.model.db.options.sanitizeProjection;else if(this.model!=null&&X.hasUserDefinedProperty(this.model.base.options,"sanitizeProjection"))t=this.model.base.options.sanitizeProjection;else t=this._mongooseOptions.sanitizeProjection;if(t)HG(this._fields);if(this._mongooseOptions.schemaLevelProjections??!0){let s=this.model.schema,i=s.options.discriminatorKey;if(this._conditions!=null&&Object.hasOwn(this._conditions,i))s=WG(this.model.discriminators,this._conditions[i])?.schema??s;Fo.applyPaths(this._fields,s,t)}let n=!0;if("selectPopulatedPaths"in this.model.base.options)n=this.model.base.options.selectPopulatedPaths;if("selectPopulatedPaths"in this.model.schema.options)n=this.model.schema.options.selectPopulatedPaths;if(n)tOe(this._fields,this._userProvidedFields,this._mongooseOptions.populate)};q.prototype.cursor=function(t){if(t)this.setOptions(t);try{this._castConditions()}catch(r){return new TO(this)._markError(r)}if(this.error())return new TO(this)._markError(this.error());return new TO(this)};q.prototype.tailable=function(e,t){if(typeof e?.constructor==="function"&&e.constructor.name==="Object")t=e,e=!0;if(e===void 0)e=!0;if(t&&typeof t==="object")for(let r of Object.keys(t))if(r==="awaitData"||r==="awaitdata")this.options.awaitData=!!t[r];else this.options[r]=t[r];return this.options.tailable=arguments.length?!!e:!0,this};q.prototype.near=function(){let e=[],t=this._mongooseOptions.nearSphere;if(arguments.length===1)if(Array.isArray(arguments[0]))e.push({center:arguments[0],spherical:t});else if(typeof arguments[0]==="string")e.push(arguments[0]);else if(X.isObject(arguments[0])){if(typeof arguments[0].spherical!=="boolean")arguments[0].spherical=t;e.push(arguments[0])}else throw TypeError("invalid argument");else if(arguments.length===2)if(typeof arguments[0]==="number"&&typeof arguments[1]==="number")e.push({center:[arguments[0],arguments[1]],spherical:t});else if(typeof arguments[0]==="string"&&Array.isArray(arguments[1]))e.push(arguments[0]),e.push({center:arguments[1],spherical:t});else if(typeof arguments[0]==="string"&&X.isObject(arguments[1])){if(e.push(arguments[0]),typeof arguments[1].spherical!=="boolean")arguments[1].spherical=t;e.push(arguments[1])}else throw TypeError("invalid argument");else if(arguments.length===3)if(typeof arguments[0]==="string"&&typeof arguments[1]==="number"&&typeof arguments[2]==="number")e.push(arguments[0]),e.push({center:[arguments[1],arguments[2]],spherical:t});else throw TypeError("invalid argument");else throw TypeError("invalid argument");return q.base.near.apply(this,e)};q.prototype.nearSphere=function(){return this._mongooseOptions.nearSphere=!0,this.near.apply(this,arguments),this};q.prototype[Symbol.asyncIterator]=function(){return this._mongooseOptions._asyncIterator=!0,this.cursor()};q.prototype.box=function(e,t){if(!Array.isArray(e)&&X.isObject(e))t=e.ur,e=e.ll;return q.base.box.call(this,e,t)};q.prototype.center=q.base.circle;q.prototype.centerSphere=function(){if(typeof arguments[0]?.constructor==="function"&&arguments[0].constructor.name==="Object")arguments[0].spherical=!0;if(typeof arguments[1]?.constructor==="function"&&arguments[1].constructor.name==="Object")arguments[1].spherical=!0;q.base.circle.apply(this,arguments)};q.prototype.selectedInclusively=function(){return Y4e(this._fields)};q.prototype.selectedExclusively=function(){return G4e(this._fields)};q.prototype.model;function au(e){return e instanceof q||X.isObject(e)||e===null}/*!
933
- * Export
934
- */tY.exports=q});var uY=g(function(dPe,oY){/*!
935
- * Module dependencies.
936
- */var Hf=Le(),sY=G("stream").Readable,lOe=lO(),hOe=hO(),fOe=Ou(),iY=Ha(),K2=G("util"),{cursorNextChannel:dOe}=j1(),{buildMiddlewareFilter:pOe}=Yo();function Ds(e){sY.call(this,{autoDestroy:!0,objectMode:!0}),this.cursor=null,this._initializationComplete=!1,this.agg=e,this._transforms=[];let{_connection:t,_model:r}=e;if(delete e.options.cursor.useMongooseAggCursor,this._mongooseOptions={},t){let n=e.options||{};if(Object.hasOwn(n,"middleware")){let{middleware:s,...i}=n;n=i}this.cursor=t.db.aggregate(e._pipeline,n),this._initializationComplete=!0,setImmediate(()=>this.emit("cursor",this.cursor))}else mOe(r,this,e)}K2.inherits(Ds,sY);/*!
937
- * ignore
938
- */function mOe(e,t,r){let n=pOe(r.options,"pre");e.hooks.execPre("aggregate",r,[],{filter:n}).then(()=>s(null),(i)=>s(i));function s(i){if(i!=null){yOe(t,i);return}if(typeof r.options?.cursor?.transform==="function")t._transforms.push(r.options.cursor.transform);if(e.collection._shouldBufferCommands()&&e.collection.buffer)e.collection.queue.push([()=>rY(e,t,r)]);else rY(e,t,r)}}/*!
939
- * ignore
940
- */function rY(e,t,r){try{let n=r.options;if(Object.hasOwn(n,"middleware")){let{middleware:i,...o}=n;n=o}let s=e.collection.aggregate(r._pipeline,n);t.cursor=s,t._initializationComplete=!0,t.emit("cursor",s)}catch(n){if(t._initializationComplete=!0,t._markError(n),t.listeners("error").length>0)t._errorEmitted=!0,t.emit("error",t._error)}}function yOe(e,t){if(e._initializationComplete=!0,t instanceof iY.skipWrappedFunction){let r=t.args[0];if(r!=null&&(!Array.isArray(r)||r.length)){let n=new Hf('Cannot `skipMiddlewareFunction()` with a value when using `.aggregate().cursor()`, value must be nullish or empty array, got "'+K2.inspect(r)+'".');if(e._markError(n),e.listeners("error").length>0)e._errorEmitted=!0,e.emit("error",n);return}e.emit("cursor",null);return}if(e._markError(t),e.listeners("error").length>0)e._errorEmitted=!0,e.emit("error",t)}Ds.prototype._read=function(){let e=this;G2(this,function(t,r){if(t)return e._errorEmitted=!0,e.emit("error",t);if(!r){e.push(null),e.cursor.close(function(n){if(n)return e.emit("error",n)});return}e.push(r)})};if(Symbol.asyncIterator!=null){let e="Mongoose does not support using async iterators with an existing aggregation cursor. See https://bit.ly/mongoose-async-iterate-aggregation";Ds.prototype[Symbol.asyncIterator]=function(){throw new Hf(e)}}Object.defineProperty(Ds.prototype,"map",{value:function(e){return this._transforms.push(e),this},enumerable:!0,configurable:!0,writable:!0});Ds.prototype._markError=function(e){return this._error=e,this};Ds.prototype.close=async function(){if(typeof arguments[0]==="function")throw new Hf("AggregationCursor.prototype.close() no longer accepts a callback");try{await this.cursor.close()}catch(t){if(this.listeners("error").length>0)this._errorEmitted=!0,this.emit("error",t);throw t}this.emit("close")};Ds.prototype._destroy=function(t,r){let n=null;if(!this._initializationComplete)n=hOe(this);else n=Promise.resolve();return n.then(()=>this.cursor?.close()).then(()=>{this._closed=!0;let s=!this._errorEmitted&&this.listeners("error").length>0;r(s?t:null)}).catch((s)=>{r(s)}),this};Ds.prototype.next=async function(){if(typeof arguments[0]==="function")throw new Hf("AggregationCursor.prototype.next() no longer accepts a callback");let t=this,r=this.agg._model;return dOe.trace(function(){return new Promise((s,i)=>{G2(t,(o,u)=>{if(o!=null)return i(o);s(u)})})},()=>({operation:"aggregate",collection:r?.collection?.name,database:r?.db?.name,serverAddress:r?.db?.host,serverPort:r?.db?.port,batchSize:t.agg.options?.cursor?.batchSize,tailable:!1,args:{pipeline:t.agg._pipeline,options:t.agg.options}}))};Ds.prototype.eachAsync=function(e,t){if(typeof arguments[2]==="function")throw new Hf("AggregationCursor.prototype.eachAsync() no longer accepts a callback");let r=this;if(typeof t==="function")t={};return t=t||{},lOe(function(n){return G2(r,n)},e,t)};if(Symbol.asyncIterator!=null)Ds.prototype[Symbol.asyncIterator]=function(){return this.transformNull()._transformForAsyncIterator()};/*!
941
- * ignore
942
- */Ds.prototype._transformForAsyncIterator=function(){if(this._transforms.indexOf(nY)===-1)this.map(nY);return this};/*!
943
- * ignore
944
- */Ds.prototype.transformNull=function(e){if(arguments.length===0)e=!0;return this._mongooseOptions.transformNull=e,this};/*!
945
- * ignore
946
- */function nY(e){return e==null?{done:!0}:{value:e,done:!1}}Ds.prototype.addCursorFlag=function(e,t){let r=this;return gOe(this,function(){r.cursor.addCursorFlag(e,t)}),this};/*!
947
- * ignore
948
- */function gOe(e,t){if(e.cursor)return t();e.once("cursor",function(){t()})}function G2(e,t){let r=t;if(e._transforms.length)r=function(n,s){if(n||s===null&&!e._mongooseOptions.transformNull)return t(n,s);t(n,e._transforms.reduce(function(i,o){return o(i)},s))};if(e._error)return fOe(function(){r(e._error)});if(e.cursor)return e.cursor.next().then((n)=>{if(!n)return r(null,null);r(null,n)},(n)=>r(n));else e.once("error",t),e.once("cursor",function(){G2(e,t)})}oY.exports=Ds});var RO=g(function(pPe,aY){aY.exports=function(t,r,n){let s=r?.discriminatorMapping;if(n=n||"",s&&!s.isRoot){let i=t,o=(n.length>0?n+".":n)+s.key,u=s.value;if(i[0]!=null&&i[0].$match&&(i[0].$match[o]===void 0||i[0].$match[o]===u))i[0].$match[o]=u;else if(i[0]?.$geoNear)i[0].$geoNear.query=i[0].$geoNear.query||{},i[0].$geoNear.query[o]=u;else if(i[0]?.$search)if(i[1]?.$match!=null)i[1].$match[o]=i[1].$match[o]||u;else{let a={};a[o]=u,i.splice(1,0,{$match:a})}else{let a={};a[o]=u,i.unshift({$match:a})}}}});var lY=g(function(mPe,cY){cY.exports=function e(t){if(!Array.isArray(t))return;for(let r of t){if(r==null)continue;let n=r.$group||r.$bucket||r.$bucketAuto;if(n!=null)for(let i of Object.keys(n))_Oe(n[i]);let s=Object.keys(r)[0];if(s&&typeof r[s]==="object"){let i=r[s];for(let o of Object.keys(i))if(i[o]!=null&&i[o].$function!=null&&typeof i[o].$function.body==="function")i[o].$function.body=i[o].$function.body.toString()}if(r.$facet!=null)for(let i of Object.keys(r.$facet))e(r.$facet[i])}};function _Oe(e){if(e==null||e.$accumulator==null)return;for(let t of["init","accumulate","merge","finalize"])if(typeof e.$accumulator[t]==="function")e.$accumulator[t]=String(e.$accumulator[t])}});var vO=g(function(yPe,pY){/*!
949
- * Module dependencies
950
- */var dY=uY(),ns=Le(),J2=H2(),{applyGlobalMaxTimeMS:EOe,applyGlobalDiskUse:AOe}=dO(),OOe=Zt(),SOe=$n(),$O=RO(),{buildMiddlewareFilter:Y2}=Yo(),wOe=lY(),W1=Oe(),{modelSymbol:COe}=le(),{createTracedChannel:bOe}=j1(),{trace:hY}=bOe("mongoose:aggregate"),DOe=J2.prototype.read,TOe=J2.prototype.readConcern,fY=new Set(["$$DESCEND","$$PRUNE","$$KEEP"]);function Ke(e,t){if(this._pipeline=[],t==null||t[COe])this._model=t;else this._connection=t;if(this.options={},arguments.length===1&&Array.isArray(e))this.append.apply(this,e)}Ke.prototype.options;Ke.prototype._optionsForExec=function(){let e=this.options||{},t=this.model()?.db?.base.transactionAsyncLocalStorage?.getStore();if(!Object.hasOwn(e,"session")&&t?.session!=null)e.session=t.session;return e};Ke.prototype.model=function(e){if(arguments.length===0)return this._model;if(this._model=e,e.schema!=null){if(this.options.readPreference==null&&e.schema.options.read!=null)this.options.readPreference=e.schema.options.read;if(this.options.collation==null&&e.schema.options.collation!=null)this.options.collation=e.schema.options.collation}return e};Ke.prototype.append=function(){let e=arguments.length===1&&Array.isArray(arguments[0])?arguments[0]:[...arguments];if(!e.every(MOe))throw new ns("Arguments must be aggregate pipeline operators");return this._pipeline=this._pipeline.concat(e),this};Ke.prototype.addFields=function(e){if(typeof e!=="object"||e===null||Array.isArray(e))throw new ns("Invalid addFields() argument. Must be an object");return this.append({$addFields:Object.assign({},e)})};Ke.prototype.project=function(e){let t={};if(typeof e==="object"&&!Array.isArray(e))Object.keys(e).forEach(function(r){if(r==="__proto__")return;t[r]=e[r]});else if(arguments.length===1&&typeof e==="string")e.split(/\s+/).forEach(function(r){if(!r)return;let n=r[0]==="-"?0:1;if(n===0)r=r.substring(1);t[r]=n});else throw new ns("Invalid project() argument. Must be string or object");return this.append({$project:t})};Ke.prototype.near=function(e){if(e==null)throw new ns("Aggregate `near()` must be called with non-nullish argument");if(e.near==null)throw new ns("Aggregate `near()` argument must have a `near` property");let t=Array.isArray(e.near)?e.near:e.near.coordinates;if(typeof e.near==="object"&&(!Array.isArray(t)||t.length<2||t.find((n)=>typeof n!=="number")))throw new ns(`Aggregate \`near()\` argument has invalid coordinates, got "${t}"`);let r={};return r.$geoNear=e,this.append(r)};/*!
951
- * define methods
952
- */"group match skip limit out densify fill".split(" ").forEach(function(e){Ke.prototype[e]=function(t){let r={};return r["$"+e]=t,this.append(r)}});Ke.prototype.unwind=function(){let e=[...arguments],t=[];for(let r of e)if(r&&typeof r==="object")t.push({$unwind:r});else if(typeof r==="string")t.push({$unwind:r[0]==="$"?r:"$"+r});else throw new ns('Invalid arg "'+r+'" to unwind(), must be string or object');return this.append.apply(this,t)};Ke.prototype.replaceRoot=function(e){let t;if(typeof e==="string")t=e.startsWith("$")?e:"$"+e;else t=e;return this.append({$replaceRoot:{newRoot:t}})};Ke.prototype.count=function(e){return this.append({$count:e})};Ke.prototype.sortByCount=function(e){if(e&&typeof e==="object")return this.append({$sortByCount:e});else if(typeof e==="string")return this.append({$sortByCount:e[0]==="$"?e:"$"+e});else throw TypeError('Invalid arg "'+e+'" to sortByCount(), must be string or object')};Ke.prototype.lookup=function(e){return this.append({$lookup:e})};Ke.prototype.graphLookup=function(e){let t={};if(e){if(!W1.isObject(e))throw TypeError("Invalid graphLookup() argument. Must be an object.");W1.mergeClone(t,e);let r=t.startWith;if(r&&typeof r==="string")t.startWith=t.startWith.startsWith("$")?t.startWith:"$"+t.startWith}return this.append({$graphLookup:t})};Ke.prototype.sample=function(e){return this.append({$sample:{size:e}})};Ke.prototype.sort=function(e){let t={};if(SOe(e)==="Object"){let r=["desc","descending",-1];Object.keys(e).forEach(function(n){if(e[n]instanceof Object&&e[n].$meta){t[n]=e[n];return}t[n]=r.indexOf(e[n])===-1?1:-1})}else if(arguments.length===1&&typeof e==="string")e.split(/\s+/).forEach(function(r){if(!r)return;let n=r[0]==="-"?-1:1;if(n===-1)r=r.substring(1);t[r]=n});else throw TypeError("Invalid sort() argument. Must be a string or object.");return this.append({$sort:t})};Ke.prototype.unionWith=function(e){return this.append({$unionWith:e})};Ke.prototype.read=function(e,t){return DOe.call(this,e,t),this};Ke.prototype.readConcern=function(e){return TOe.call(this,e),this};Ke.prototype.redact=function(e,t,r){if(arguments.length===3){if(typeof t==="string"&&!fY.has(t)||typeof r==="string"&&!fY.has(r))throw new ns("If thenExpr or elseExpr is string, it must be either $$DESCEND, $$PRUNE or $$KEEP");e={$cond:{if:e,then:t,else:r}}}else if(arguments.length!==1)throw TypeError("Invalid arguments");return this.append({$redact:e})};Ke.prototype.explain=async function(t){if(typeof t==="function"||typeof arguments[1]==="function")throw new ns("Aggregate.prototype.explain() no longer accepts a callback");let r=this._model;if(!this._pipeline.length)throw new ns("Aggregate has empty pipeline");$O(this._pipeline,this._model.schema);let n=Y2(this.options,"pre"),s=Y2(this.options,"post"),{middleware:i,...o}=this.options??{};try{await r.hooks.execPre("aggregate",this,[],{filter:n})}catch(c){return await r.hooks.execPost("aggregate",this,[null],{error:c,filter:s})}let u=await r.collection.aggregate(this._pipeline,o);if(t==null)t=!0;let a=null;try{a=await u.explain(t)}catch(c){return await r.hooks.execPost("aggregate",this,[null],{error:c,filter:s})}return await r.hooks.execPost("aggregate",this,[a],{error:null,filter:s}),a};Ke.prototype.allowDiskUse=function(e){return this.options.allowDiskUse=e,this};Ke.prototype.hint=function(e){return this.options.hint=e,this};Ke.prototype.session=function(e){if(e==null)delete this.options.session;else this.options.session=e;return this};Ke.prototype.option=function(e){for(let t in e)this.options[t]=e[t];return this};Ke.prototype.cursor=function(e){if(this._optionsForExec(),W1.hasUserDefinedProperty(e,"middleware")){let{middleware:t,...r}=e;this.options.middleware=t,e=r}return this.options.cursor=e||{},new dY(this)};Ke.prototype.collation=function(e){return this.options.collation=e,this};Ke.prototype.facet=function(e){return this.append({$facet:e})};Ke.prototype.search=function(e){return this.append({$search:e})};Ke.prototype.pipeline=function(){return this._pipeline};Ke.prototype.pipelineForUnionWith=function(){for(let t of this._pipeline)if(t?.$out!=null||t?.$merge!=null)throw new ns("Aggregate pipeline for $unionWith cannot include `$out` or `$merge` stages");return this._pipeline};Ke.prototype.exec=async function(){if(!this._model&&!this._connection)throw new ns("Aggregate not bound to any Model");if(typeof arguments[0]==="function")throw new ns("Aggregate.prototype.exec() no longer accepts a callback");if(this._connection){if(!this._pipeline.length)throw new ns("Aggregate has empty pipeline");this._optionsForExec();let s=this;return hY(async function(){return await(await s._connection.client.db().aggregate(s._pipeline,s.options)).toArray()},()=>({operation:"aggregate",database:s._connection.name,serverAddress:s._connection.host,serverPort:s._connection.port,args:{pipeline:s._pipeline,options:s.options}}))}let t=this._model,r=this._model.collection;if(EOe(this.options,t.db.options,t.base.options),AOe(this.options,t.db.options,t.base.options),this._optionsForExec(),this.options?.cursor)return new dY(this);$O(this._pipeline,this._model.schema),wOe(this._pipeline);let n=this;return hY(async function(){let i=Y2(n.options,"pre"),o=Y2(n.options,"post");try{await t.hooks.execPre("aggregate",n,[],{filter:i})}catch(l){return await t.hooks.execPost("aggregate",n,[null],{error:l,filter:o})}if(!n._pipeline.length)throw new ns("Aggregate has empty pipeline");let{middleware:u,...a}=OOe(n.options||{}),c;try{c=await(await r.aggregate(n._pipeline,a)).toArray()}catch(l){return await t.hooks.execPost("aggregate",n,[null],{error:l,filter:o})}return await t.hooks.execPost("aggregate",n,[c],{error:null,filter:o}),c},()=>({operation:"aggregate",collection:r.name,database:t.db?.name,serverAddress:t.db?.host,serverPort:t.db?.port,args:{pipeline:n._pipeline,options:n.options}}))};Ke.prototype.then=function(e,t){return this.exec().then(e,t)};Ke.prototype.catch=function(e){return this.exec().then(null,e)};Ke.prototype.finally=function(e){return this.exec().finally(e)};Ke.prototype[Symbol.asyncIterator]=function(){return this.cursor({useMongooseAggCursor:!0}).transformNull()._transformForAsyncIterator()};/*!
953
- * Helpers
954
- */function MOe(e){if(typeof e!=="object"||e===null)return!1;let t=Object.keys(e);return t.length===1&&t[0][0]==="$"}Ke._prepareDiscriminatorPipeline=$O;/*!
955
- * Exports
956
- */pY.exports=Ke});var yY=g(function(gPe,mY){var xOe=Zt();class kO{constructor(e){if(e==null)return;Object.assign(this,xOe(e))}}kO.prototype.__subdocs=null;mY.exports=kO});var _Y=g(function(_Pe,gY){gY.exports=function e(t,r){let n=Object.keys(r.paths),s=n.length;for(let i=0;i<s;++i){let o="",u=n[i],a=r.paths[u],c=a.splitPath(),l=c.length,f=t;for(let h=0;h<l;++h){if(f==null)break;let d=c[h];if(o+=(!o.length?"":".")+d,h===l-1){if(typeof f[d]<"u"){if(a.$isSingleNested)e(f[d],a.schema);else if(a.$isMongooseDocumentArray&&Array.isArray(f[d]))f[d].forEach((m)=>e(m,a.schema));break}let p=a.getDefault(t,!1,{skipCast:!0});if(typeof p<"u"){if(f[d]=p,a.$isSingleNested)e(p,a.schema);else if(a.$isMongooseDocumentArray&&Array.isArray(p))p.forEach((m)=>e(m,a.schema))}}else{if(f[d]==null)f[d]={};f=f[d]}}}}});var jO=g(function(EPe,EY){EY.exports=qO;function qO(e,t=new WeakSet,r=!1){if(t.has(e))return;t.add(e);for(let n of Object.keys(e.paths)){let s=e.paths[n];if(!s.schema)continue;if(qO(s.schema,t),!s.schema._applyDiscriminators)continue;if(s._appliedDiscriminators&&!r)continue;for(let i of s.schema._applyDiscriminators.keys()){let{schema:o,options:u}=s.schema._applyDiscriminators.get(i);qO(o,t),s.discriminator(i,o,r?{...u,overwriteExisting:!0}:u)}s._appliedDiscriminators=!0}}});var SY=g(function(APe,OY){var{buildMiddlewareFilter:AY,middlewareFiltersFromLastArg:POe}=Yo();/*!
957
- * ignore
958
- */OY.exports=Kf;/*!
959
- * ignore
960
- */Kf.middlewareFunctions=["deleteOne","remove","save","updateOne","validate","init"];/*!
961
- * ignore
962
- */var BOe=new Set(Kf.middlewareFunctions.flatMap((e)=>[e,`$__${e}`]));function Kf(e,t,r){r=r||{};let n={useErrorHandlers:!0,numCallbackParams:1,nullResultByDefault:!0,contextParameter:!0},s=r.decorateDoc?e:e.prototype;e.$appliedHooks=!0;for(let c of Object.keys(t.paths)){let l=t.paths[c],f=null,h=LO(l);if(h)f=h.childModel,l=h.type;else continue;if(f.$appliedHooks)continue;if(Kf(f,l.schema,{...r,decorateDoc:!1,isChildSchema:!0}),f.discriminators!=null){let d=Object.keys(f.discriminators);for(let p of d)Kf(f.discriminators[p],f.discriminators[p].schema,r)}}let i=t._getDocumentMiddleware(e.prototype.$isSubdocument);e._middleware=i;let o=s.$__init;if(i.hasHooks("init"))s.$__init=i.createWrapperSync("init",o,null,{...n,getOptions:(c)=>{let l=c[1];return{pre:{filter:AY(l,"pre")},post:{filter:AY(l,"post")}}}});else s.$__init=o;let u=Object.keys(t.methods),a=Object.assign({},n,{checkForPromise:!0});for(let c of u){if(BOe.has(c))continue;if(!i.hasHooks(c))continue;let l=s[c];s[`$__${c}`]=s[c];let f=l.supportsMiddlewareOption===!0?{...a,getOptions:POe}:a;s[c]=i.createWrapper(c,l,null,f)}}function LO(e){if(e.$isSingleNested||e.$isMongooseDocumentArray)return{childModel:e.Constructor,type:e};if(e.instance==="Array"){let t=e.getEmbeddedSchemaType();if(t)return LO(t)}if(e.instance==="Map"){let t=e.getEmbeddedSchemaType();if(t)return LO(t)}return null}});var bY=g(function(OPe,CY){var FOe=gr(),wY=Oe();CY.exports=function e(t,r){let n=UO();function s(i,o){Object.defineProperty(t.prototype,i,{get:function(){let u={};for(let a in o.methods[i])u[a]=o.methods[i][a].bind(this);return u},configurable:!0})}for(let i of Object.keys(r.methods)){let o=r.methods[i];if(Object.hasOwn(r.tree,i))throw Error('You have a method and a property in your schema both named "'+i+'"');if(typeof o==="function"&&n.prototype[i]===o){delete r.methods[i];continue}if(r.reserved[i]&&!FOe(r,`methodOptions.${i}.suppressWarning`,!1))wY.warn(`mongoose: the method name "${i}" 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('${i}', fn, { suppressWarning: true })\`.`);if(typeof o==="function")t.prototype[i]=o;else s(i,r)}t.$appliedMethods=!0;for(let i of Object.keys(r.paths)){let o=r.paths[i];if(o.$isSingleNested&&!o.Constructor.$appliedMethods)e(o.Constructor,o.schema);if(o.$isMongooseDocumentArray&&!o.Constructor.$appliedMethods)e(o.Constructor,o.schema)}}});var MY=g(function(SPe,TY){var DY=P3(),NOe=Ja(),IOe=v2(),Z2=Oe().isPOJO;TY.exports=function(t,r,n){if(r==null)return t;if(t==null)return t;let s=null;if(IOe(r))s=!1;else if(NOe(r))s=!0;if(s==null)return t;else if(s)return n=n||DY(r),Q2(t,r,n);else return n=n||DY(r),X2(t,r,n)};function Q2(e,t,r,n,s){if(e==null||typeof e!=="object")return e;if(Array.isArray(e))return e.map((o)=>Q2(o,t,r,n,s));let i={...e};n=s?n||{}:t;for(let o of Object.keys(i)){let u=s?s+"."+o:o;if(Object.hasOwn(t,u)||Object.hasOwn(n,o))if(Z2(t[u])||Z2(n[o]))i[o]=Q2(i[o],t,r,n[o],u);else delete i[o];else if(r[u])i[o]=Q2(i[o],t,r,n[o],u)}return i}function X2(e,t,r,n,s){if(e==null||typeof e!=="object")return e;if(Array.isArray(e))return e.map((o)=>X2(o,t,r,n,s));let i={...e};n=s?n||{}:t;for(let o of Object.keys(i)){let u=s?s+"."+o:o;if(Object.hasOwn(t,u)||Object.hasOwn(n,o)){if(Z2(t[u])||Z2(n[o]))i[o]=X2(i[o],t,r,n[o],u);continue}else if(r[u])i[o]=X2(i[o],t,r,n[o],u);else delete i[o]}return i}});var PY=g(function(wPe,xY){xY.exports=function(t){let r=!1;for(let n of Object.keys(t))if(t[n]==="text")r=!0;return r}});var FY=g(function(CPe,BY){var ROe=PY();BY.exports=function(t,r,n){if(ROe(t))return;if(Object.hasOwn(n,"collation")&&!Object.hasOwn(r,"collation"))r.collation=n.collation}});var IY=g(function(bPe,NY){var{middlewareFiltersFromLastArg:$Oe}=Yo(),{queryMiddlewareFunctions:vOe,aggregateMiddlewareFunctions:kOe,modelMiddlewareFunctions:qOe,documentMiddlewareFunctions:jOe}=df(),LOe=Array.from(new Set([...vOe,...kOe,...qOe,...jOe]));NY.exports=function(t,r,n){r=r.filter((s)=>{if(LOe.indexOf(s.name)!==-1)return!!s.model;return s.model!==!1});for(let s of Object.keys(n))if(r.hasHooks(s)){let i=t[s],o=i.supportsMiddlewareOption===!0?{getOptions:$Oe}:void 0;t[s]=r.createWrapper(s,i,null,o)}}});var $Y=g(function(DPe,RY){RY.exports=function(t,r){for(let n in r.statics)t[n]=r.statics[n]}});var VY=g(function(TPe,UY){var vY=wy(),kY=ks(),qY=Oe();UY.exports=jY;function jY(e,t,r){if(t==null)return t;return UOe(e,t,r),LY(e,t,r)}function UOe(e,t,r){for(let n of e.childSchemas){let s=n.model.path,i=n.schema;if(!s)continue;let o=kY.get(s,t);if(o==null||Array.isArray(o)&&o.flat(1/0).length===0)continue;jY(i,o,r)}}function LY(e,t,r){if(t==null||typeof t!=="object")return;if(Array.isArray(t)){for(let u of t)LY(e,u,r);return}if(e.discriminators&&qY.hasOwnKeys(e.discriminators))for(let u of Object.keys(e.discriminators)){let a=e.discriminators[u],c=a.discriminatorMapping.key,l=a.discriminatorMapping.value;if(t[c]==l){e=a;break}}let n=vY(e.options.timestamps,"createdAt"),s=vY(e.options.timestamps,"updatedAt"),i=r?.currentTime,o=null;if(i!=null)o=i();else if(e.base?.now)o=e.base.now();else o=new Date;if(n&&t[n]==null&&!r?.isUpdate)t[n]=o;if(s)t[s]=o}});var GY=g(function(MPe,KY){var zY=ks(),WY=Oe();KY.exports=HY;function HY(e,t,r){if(t==null)return t;let n=r,s=null;if(Array.isArray(r)){n=[],s=[];for(let i of r)if(i.length===1)s.push(i[0]);else n.push(i)}return VOe(e,t,n),VO(e,t,s)}function VOe(e,t,r){let n=!1;for(let s of e.childSchemas){let i=s.model.path,o=s.schema;if(!i)continue;let u=zY.get(i,t);if(u==null||Array.isArray(u)&&u.flat(1/0).length===0)continue;let a=null;if(Array.isArray(r)){a=[];for(let c of r)if(c[0]==i)a.push(c.slice(1));if(a.length===0)continue}HY(o,u,a),n=!0}if(r?.length&&!n)VO(e,t,r)}function VO(e,t,r){if(t==null||typeof t!=="object")return;if(Array.isArray(t)){for(let n of t)VO(e,n,r);return}if(e.discriminators&&WY.hasOwnKeys(e.discriminators))for(let n of Object.keys(e.discriminators)){let s=e.discriminators[n],i=s.discriminatorMapping.key,o=s.discriminatorMapping.value;if(t[i]==o){e=s;break}}if(r==null)r=Object.keys(e.virtuals);for(let n of r){if(e.virtuals[n]==null)continue;let s=e.virtuals[n],i=Array.isArray(n)?n:n.indexOf(".")===-1?[n]:n.split("."),o=t;for(let c=0;c<i.length-1;++c)o[i[c]]=i[c]in o?o[i[c]]:{},o=o[i[c]];let u=s.applyGetters(o[i[i.length-1]],t);if((s.options?.ref||s.options?.refPath)&&u===void 0)if(s.options.justOne)u=null;else u=[];o[i[i.length-1]]=u}}});var eg=g(function(xPe,YY){YY.exports=function e(t){if(!(this instanceof e))return new e(t);return this.val=t,this}});var Gf=g(function(PPe,JY){/*!
963
- * ignore
964
- */JY.exports=new WeakMap});var eJ=g(function(BPe,ZY){var zOe=Zt(),rg=Gf(),WOe=le().modelSymbol,QY=Oe();ZY.exports=XY;var tg=Symbol("mongoose#assignRawDocsToIdStructure#hasArray");function XY(e,t,r,n,s){let i=[],o=n.isVirtual&&n.justOne&&e.length>1?!1:n.sort&&e.length>1,u=n.$nullIfNotFound,a,c,l;if(QY.isMongooseArray(e))e=e.__array;let f=0,h=e.length;if(o&&s&&n[tg]===void 0){n[tg]=!1;for(let d in r)if(Array.isArray(r[d])){n[tg]=!0;break}}for(f=0;f<h;++f){if(l=e[f],Array.isArray(l)){XY(l,t,r,n,!0),i.push(l);continue}if(l===null&&o===!1){i.push(l);continue}if(c=String(l),a=t[c],n.clone&&a!=null)if(n.lean){let d=rg.get(a);a=zOe(a),rg.set(a,d)}else a=a.constructor.hydrate(a._doc);if(s)if(a)if(o){let d=r[c];if(n[tg])i.push(a);else i[d]=a}else i.push(a);else if(l?.[WOe]!=null)i.push(l);else i.push(n.retainNullValues||u?null:l);else i[f]=a||null}if(e.length=0,i.length)i.forEach(function(d,p){e[p]=d})}});var zO=g(function(FPe,tJ){tJ.exports=ng;/*!
965
- * ignore
966
- */function ng(e,t){if(e.virtuals[t])return{virtual:e.virtuals[t],path:void 0};let r=t.split("."),n="",s="";for(let i=0;i<r.length;++i){if(n+=(n.length>0?".":"")+r[i],e.virtuals[n]){if(i===r.length-1)return{virtual:e.virtuals[n],path:s};continue}if(e.nested[n])continue;if(e.paths[n]&&e.paths[n].schema){e=e.paths[n].schema;let o=r.slice(i+1).join(".");if(e.virtuals[o]){if(i===r.length-2)return{virtual:e.virtuals[o],nestedSchemaPath:[s,n].filter((u)=>!!u).join(".")};continue}if(i+1<r.length&&e.discriminators)for(let u of Object.keys(e.discriminators)){let a=ng(e.discriminators[u],o);if(a!=null){let c=[s,n,a.nestedSchemaPath].filter((l)=>!!l).join(".");return{virtual:a.virtual,nestedSchemaPath:c}}}s+=(s.length>0?".":"")+n,n="";continue}else if(e.paths[n]?.$isSchemaMap&&e.paths[n].$__schemaType?.schema){e=e.paths[n].$__schemaType.schema,++i;let o=r.slice(i+1).join(".");if(e.virtuals[o]){if(i===r.length-2)return{virtual:e.virtuals[o],nestedSchemaPath:[s,n,"$*"].filter((u)=>!!u).join(".")};continue}if(i+1<r.length&&e.discriminators)for(let u of Object.keys(e.discriminators)){let a=ng(e.discriminators[u],o);if(a!=null){let c=[s,n,a.nestedSchemaPath,"$*"].filter((l)=>!!l).join(".");return{virtual:a.virtual,nestedSchemaPath:c}}}s+=(s.length>0?".":"")+"$*"+n,n=""}if(e.discriminators)for(let o of Object.keys(e.discriminators)){let u=ng(e.discriminators[o],t);if(u)return u}return null}}});var nJ=g(function(sg,rJ){(function(e,t){typeof sg==="object"&&typeof rJ<"u"?t(sg):typeof define==="function"&&define.amd?define(["exports"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.sift={}))})(sg,function(e){var t=function(S,C){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(D,R){D.__proto__=R}||function(D,R){for(var J in R)if(Object.prototype.hasOwnProperty.call(R,J))D[J]=R[J]},t(S,C)};function r(S,C){if(typeof C!=="function"&&C!==null)throw TypeError("Class extends value "+String(C)+" is not a constructor or null");t(S,C);function D(){this.constructor=S}S.prototype=C===null?Object.create(C):(D.prototype=C.prototype,new D)}typeof SuppressedError==="function"&&SuppressedError;var n=function(S){var C="[object "+S+"]";return function(D){return s(D)===C}},s=function(S){return Object.prototype.toString.call(S)},i=function(S){if(S instanceof Date)return S.getTime();else if(u(S))return S.map(i);else if(S&&typeof S.toJSON==="function")return S.toJSON();return S},o=function(S){return S==null?null:S},u=n("Array"),a=n("Object"),c=n("Function"),l=function(S,C){return S.hasOwnProperty(C)&&!c(S[C])},f=function(S,C){return Array.isArray(C)&&!(S in C)&&isNaN(Number(S))},h=function(S,C){var D=S[C],R=Object.prototype[C];return R===void 0||D!==R||Object.prototype.hasOwnProperty.call(S,C)?D:void 0},d=function(S){return S&&(S.constructor===Object||S.constructor===Array||S.constructor.toString()==="function Object() { [native code] }"||S.constructor.toString()==="function Array() { [native code] }")&&!h(S,"toJSON")},p=function(S,C){if(S==null&&S==C)return!0;if(S===C)return!0;if(Object.prototype.toString.call(S)!==Object.prototype.toString.call(C))return!1;if(u(S)){if(S.length!==C.length)return!1;for(var D=0,R=S.length;D<R;D++)if(!p(S[D],C[D]))return!1;return!0}else if(a(S)){if(Object.keys(S).length!==Object.keys(C).length)return!1;for(var J in S){if(!Object.prototype.hasOwnProperty.call(S,J))continue;if(!p(S[J],C[J]))return!1}return!0}return!1},m=function(S,C,D,R,J,ce,pe){if(pe===void 0)pe=!0;var Ge=C[R];if(u(S)&&isNaN(Number(Ge))&&!l(S,Ge)){for(var Lr=0,xr=S.length;Lr<xr;Lr++)if(!m(S[Lr],C,D,R,Lr,S,pe))return!1}if(R===C.length||S==null)return D(S,J,ce,R===0,R===C.length&&(R>0||pe));return m(S[Ge],C,D,R+1,Ge,S)},_=function(){function S(C,D,R,J){this.params=C,this.owneryQuery=D,this.options=R,this.name=J,this.init()}return S.prototype.init=function(){},S.prototype.reset=function(){this.done=!1,this.keep=!1},S}(),y=function(S){r(C,S);function C(D,R,J,ce){var pe=S.call(this,D,R,J)||this;return pe.children=ce,pe}return C.prototype.reset=function(){this.keep=!1,this.done=!1;for(var D=0,R=this.children.length;D<R;D++)this.children[D].reset()},C.prototype.childrenNext=function(D,R,J,ce,pe){var Ge=!0,Lr=!0;for(var xr=0,Z1=this.children.length;xr<Z1;xr++){var Ni=this.children[xr];if(!Ni.done)Ni.next(D,R,J,ce,pe);if(!Ni.keep)Lr=!1;if(Ni.done){if(!Ni.keep)break}else Ge=!1}this.done=Ge,this.keep=Lr},C}(_),E=function(S){r(C,S);function C(D,R,J,ce,pe){var Ge=S.call(this,D,R,J,ce)||this;return Ge.name=pe,Ge}return C}(y),w=function(S){r(C,S);function C(){var D=S!==null&&S.apply(this,arguments)||this;return D.propop=!0,D}return C.prototype.next=function(D,R,J,ce,pe){this.childrenNext(D,R,J,ce,pe)},C}(y),b=function(S){r(C,S);function C(D,R,J,ce,pe){var Ge=S.call(this,R,J,ce,pe)||this;return Ge.keyPath=D,Ge.propop=!0,Ge._nextNestedValue=function(Lr,xr,Z1,Ni,zQ){return Ge.childrenNext(Lr,xr,Z1,Ni,zQ),!Ge.done},Ge}return C.prototype.next=function(D,R,J,ce,pe){m(D,this.keyPath,this._nextNestedValue,0,R,J,pe!==!1)},C}(y),A=function(S,C){if(S instanceof Function)return S;if(S instanceof RegExp)return function(R){var J=typeof R==="string"&&S.test(R);return S.lastIndex=0,J};var D=i(S);return function(R){return C(D,i(R))}},M=function(S){r(C,S);function C(){var D=S!==null&&S.apply(this,arguments)||this;return D.propop=!0,D}return C.prototype.init=function(){this._test=A(this.params,this.options.compare)},C.prototype.next=function(D,R,J){if(!Array.isArray(J)||J.hasOwnProperty(R)){if(this._test(D,R,J))this.done=!0,this.keep=!0}},C}(_),O=function(S,C,D){return new M(S,C,D)},x=function(S){return function(C,D,R,J){return S(C,D,R,J)}},v=function(S){return x(function(C,D,R,J){var ce=typeof i(C),pe=S(C);return new M(function(Ge){var Lr=o(Ge);return typeof i(Lr)===ce&&pe(Lr)},D,R,J)})},P=function(S,C,D,R){var J=R.operations[S];if(!J)ge(S);return J(C,D,R,S)},ge=function(S){throw Error("Unsupported operation: ".concat(S))},Me=function(S,C){for(var D in S){if(!Object.prototype.hasOwnProperty.call(S,D))continue;if(C.operations.hasOwnProperty(D)||D.charAt(0)==="$")return!0}return!1},oe=function(S,C,D,R,J){if(Me(C,J)){var ce=H(C,D,J),pe=ce[0],Ge=ce[1];if(Ge.length)throw Error("Property queries must contain only operations, or exact objects.");return new b(S,C,R,J,pe)}return new b(S,C,R,J,[new M(C,R,J)])},Yt=function(S,C,D){if(C===void 0)C=null;if(D===void 0)D={};var R=h(D,"compare"),J=h(D,"operations"),ce={compare:R||p,operations:Object.assign({},J||{})},pe=H(S,null,ce),Ge=pe[0],Lr=pe[1],xr=[];if(Ge.length)xr.push(new b([],S,C,ce,Ge));if(xr.push.apply(xr,Lr),xr.length===1)return xr[0];return new w(S,C,ce,xr)},H=function(S,C,D){var R=[],J=[];if(!d(S))return R.push(new M(S,S,D)),[R,J];for(var ce in S){if(!Object.prototype.hasOwnProperty.call(S,ce))continue;if(D.operations.hasOwnProperty(ce)){var pe=P(ce,S[ce],S,D);if(pe){if(!pe.propop&&C&&!D.operations[C])throw Error("Malformed query. ".concat(ce," cannot be matched against property."))}if(pe!=null)R.push(pe)}else if(ce.charAt(0)==="$")ge(ce);else J.push(oe(ce.split("."),S[ce],ce,S,D))}return[R,J]},Se=function(S){return function(C,D,R){return S.reset(),S.next(C,D,R),S.keep}},ct=function(S,C){if(C===void 0)C={};return Se(Yt(S,null,C))},ss=function(S){r(C,S);function C(){var D=S!==null&&S.apply(this,arguments)||this;return D.propop=!0,D}return C.prototype.init=function(){this._test=A(this.params,this.options.compare)},C.prototype.reset=function(){S.prototype.reset.call(this),this.keep=!0},C.prototype.next=function(D,R,J){if(!f(R,J)&&this._test(D))this.done=!0,this.keep=!1},C}(_),ze=function(S){r(C,S);function C(){var D=S!==null&&S.apply(this,arguments)||this;return D.propop=!0,D}return C.prototype.init=function(){if(!this.params||typeof this.params!=="object")throw Error("Malformed query. $elemMatch must by an object.");this._queryOperation=Yt(this.params,this.owneryQuery,this.options)},C.prototype.reset=function(){S.prototype.reset.call(this),this._queryOperation.reset()},C.prototype.next=function(D,R,J){if(u(D)){for(var ce=0,pe=D.length;ce<pe;ce++){this._queryOperation.reset();var Ge=D[ce];this._queryOperation.next(Ge,ce,D,!1),this.keep=this.keep||this._queryOperation.keep}this.done=this.keep||!a(J)}else this.done=!1,this.keep=!1},C}(_),Sn=function(S){r(C,S);function C(){var D=S!==null&&S.apply(this,arguments)||this;return D.propop=!0,D}return C.prototype.init=function(){this._queryOperation=Yt(this.params,this.owneryQuery,this.options)},C.prototype.reset=function(){S.prototype.reset.call(this),this._queryOperation.reset()},C.prototype.next=function(D,R,J,ce,pe){this._queryOperation.next(D,R,J,ce,pe),this.done=this._queryOperation.done,this.keep=!this._queryOperation.keep},C}(_),Ts=function(S){r(C,S);function C(){var D=S!==null&&S.apply(this,arguments)||this;return D.propop=!0,D}return C.prototype.init=function(){},C.prototype.next=function(D){if(u(D)&&D.length===this.params)this.done=!0,this.keep=!0},C}(_),Ms=function(S){if(S.length===0)throw Error("$and/$or/$nor must be a nonempty array")},hu=function(S){r(C,S);function C(){var D=S!==null&&S.apply(this,arguments)||this;return D.propop=!1,D}return C.prototype.init=function(){var D=this;Ms(this.params),this._ops=this.params.map(function(R){return Yt(R,null,D.options)})},C.prototype.reset=function(){this.done=!1,this.keep=!1;for(var D=0,R=this._ops.length;D<R;D++)this._ops[D].reset()},C.prototype.next=function(D,R,J,ce,pe){var Ge=!1,Lr=!1;for(var xr=0,Z1=this._ops.length;xr<Z1;xr++){var Ni=this._ops[xr];if(Ni.next(D,R,J,ce,pe),Ni.keep){Ge=!0,Lr=Ni.keep;break}}this.keep=Lr,this.done=Ge},C}(_),$Q=function(S){r(C,S);function C(){var D=S!==null&&S.apply(this,arguments)||this;return D.propop=!1,D}return C.prototype.next=function(D,R,J,ce,pe){S.prototype.next.call(this,D,R,J,ce,pe),this.keep=!this.keep},C}(hu),ES=function(S){r(C,S);function C(){var D=S!==null&&S.apply(this,arguments)||this;return D.propop=!0,D}return C.prototype.init=function(){var D=this,R=Array.isArray(this.params)?this.params:[this.params];this._testers=R.map(function(J){if(Me(J,D.options))throw Error("cannot nest $ under ".concat(D.name.toLowerCase()));return A(J,D.options.compare)})},C.prototype.next=function(D,R,J){if(f(R,J))return;var ce=!1,pe=!1;for(var Ge=0,Lr=this._testers.length;Ge<Lr;Ge++){var xr=this._testers[Ge];if(xr(D)){ce=!0,pe=!0;break}}this.keep=pe,this.done=ce},C}(_),vQ=function(S){r(C,S);function C(D,R,J,ce){var pe=S.call(this,D,R,J,ce)||this;return pe.propop=!0,pe._in=new ES(D,R,J,ce),pe}return C.prototype.next=function(D,R,J,ce){if(this._in.next(D,R,J),this._in.keep)this.keep=!1,this.done=!0},C.prototype.reset=function(){S.prototype.reset.call(this),this.keep=!0,this._in.reset()},C}(_),kQ=function(S){r(C,S);function C(){var D=S!==null&&S.apply(this,arguments)||this;return D.propop=!0,D}return C.prototype.reset=function(){S.prototype.reset.call(this),this.keep=!this.params},C.prototype.next=function(D,R,J,ce,pe){if(pe&&(J==null?D!==void 0:Object.prototype.hasOwnProperty.call(J,R)))this.done=!0,this.keep=Boolean(this.params)},C}(_),qQ=function(S){r(C,S);function C(D,R,J,ce){var pe=S.call(this,D,R,J,D.map(function(Ge){return Yt(Ge,R,J)}),ce)||this;return pe.propop=!1,Ms(D),pe}return C.prototype.next=function(D,R,J,ce,pe){this.childrenNext(D,R,J,ce,pe)},C}(E),jQ=function(S){r(C,S);function C(D,R,J,ce){var pe=S.call(this,D,R,J,D.map(function(Ge){return Yt(Ge,R,J)}),ce)||this;return pe.propop=!0,pe}return C.prototype.next=function(D,R,J,ce,pe){this.childrenNext(D,R,J,ce,pe)},C}(E),AS=function(S,C,D){return new M(S,C,D)},OS=function(S,C,D,R){return new ss(S,C,D,R)},SS=function(S,C,D,R){return new hu(S,C,D,R)},wS=function(S,C,D,R){return new $Q(S,C,D,R)},CS=function(S,C,D,R){return new ze(S,C,D,R)},bS=function(S,C,D,R){return new vQ(S,C,D,R)},DS=function(S,C,D,R){return new ES(S,C,D,R)},TS=v(function(S){return function(C){return C!=null&&C<S}}),MS=v(function(S){return function(C){return C===S||C<=S}}),xS=v(function(S){return function(C){return C!=null&&C>S}}),PS=v(function(S){return function(C){return C===S||C>=S}}),BS=function(S,C,D){var R=S[0],J=S[1];return new M(function(ce){return i(ce)%R===J},C,D)},FS=function(S,C,D,R){return new kQ(S,C,D,R)},NS=function(S,C,D){return new M(new RegExp(S,Object.prototype.hasOwnProperty.call(C,"$options")?C.$options:void 0),C,D)},IS=function(S,C,D,R){return new Sn(S,C,D,R)},RS={number:function(S){return typeof S==="number"},string:function(S){return typeof S==="string"},bool:function(S){return typeof S==="boolean"},array:function(S){return Array.isArray(S)},null:function(S){return S===null},timestamp:function(S){return S instanceof Date}},$S=function(S,C,D){return new M(function(R){if(typeof S==="string"){if(!Object.prototype.hasOwnProperty.call(RS,S))throw Error("Type alias does not exist");return RS[S](R)}return R!=null?R instanceof S||R.constructor===S:!1},C,D)},vS=function(S,C,D,R){return new qQ(S,C,D,R)},kS=function(S,C,D,R){return new jQ(S,C,D,R)},qS=function(S,C,D){return new Ts(S,C,D,"$size")},jS=function(){return null},LQ=function(){try{return Boolean(process.env.CSP_ENABLED)}catch(S){return!1}},LS=function(S,C,D){var R;if(c(S))R=S;else if(!LQ())R=Function("obj","return "+S);else throw Error('In CSP mode, sift does not support strings in "$where" condition');return new M(function(J){return R.bind(J)(J)},C,D)},UQ=Object.freeze({__proto__:null,$Size:Ts,$all:kS,$and:vS,$elemMatch:CS,$eq:AS,$exists:FS,$gt:xS,$gte:PS,$in:DS,$lt:TS,$lte:MS,$mod:BS,$ne:OS,$nin:bS,$nor:wS,$not:IS,$options:jS,$or:SS,$regex:NS,$size:qS,$type:$S,$where:LS}),US=function(S,C,D){if(D===void 0)D={};return Yt(S,C,{compare:h(D,"compare"),operations:Object.assign({},UQ,h(D,"operations")||{})})},VQ=function(S,C){if(C===void 0)C={};var D=US(S,null,C);return Se(D)};e.$Size=Ts,e.$all=kS,e.$and=vS,e.$elemMatch=CS,e.$eq=AS,e.$exists=FS,e.$gt=xS,e.$gte=PS,e.$in=DS,e.$lt=TS,e.$lte=MS,e.$mod=BS,e.$ne=OS,e.$nin=bS,e.$nor=wS,e.$not=IS,e.$options=jS,e.$or=SS,e.$regex=NS,e.$size=qS,e.$type=$S,e.$where=LS,e.EqualsOperation=M,e.createDefaultQueryOperation=US,e.createEqualsOperation=O,e.createOperationTester=Se,e.createQueryOperation=Yt,e.createQueryTester=ct,e.default=VQ,Object.defineProperty(e,"__esModule",{value:!0})})});var iJ=g(function(NPe,WO){var sJ=nJ();WO.exports=sJ.default;Object.assign(WO.exports,sJ)});var lJ=g(function(IPe,cJ){var HOe=By(),KOe=eg(),GOe=eJ(),HO=gr(),YOe=r1(),JOe=zO(),ig=Gf(),Jf=gn(),oJ=_y(),QOe=R3(),H1=ks(),uJ=iJ().default,Sa=Oe(),{populateModelSymbol:XOe}=le();cJ.exports=function(t){let r=Object.assign({},HO(t,"allOptions.options.options"),HO(t,"allOptions.options")),n=Object.assign({},t.options,r,{justOne:t.justOne,isVirtual:t.isVirtual});n.$nullIfNotFound=t.isVirtual;let s=t.populatedModel,i=[].concat(t.rawIds);t.allIds=[].concat(t.allIds),GOe(t.rawIds,t.rawDocs,t.rawOrder,n);let{docs:o,rawIds:u,options:a}=t,c=t.count&&t.isVirtual,l,f=0;function h(d){if(++f,c)return d;if(d instanceof KOe)return d.val;if(d===void 0)return d;let p=t.allIds[l];if(t.path.endsWith(".$*"))return Yf(d,a,n,p);if(t.justOne===!0&&Array.isArray(d)){let m=[];for(let _ of d){let y=ig.get(_);if(y==null||y===s)m.push(_)}while(d.length>m.length)Array.prototype.pop.apply(d,[]);for(let _=0;_<m.length;++_)d[_]=m[_];return Yf(d[0],a,n,p)}else if(t.justOne===!1&&!Array.isArray(d))return Yf([d],a,n,p);else if(t.justOne===!0&&!Array.isArray(d)&&Array.isArray(p))return Yf(d,a,n,d==null?d:p[f-1]);return Yf(d,a,n,p)}for(l=0;l<o.length;++l){f=0;let d=t.path.endsWith(".$*")?t.path.slice(0,-3):t.path,p=H1.get(d,o[l],oJ);if(p==null&&!JOe(t.originalModel.schema,d))continue;let m;if(c)m=ZOe(u[l]);else if(Array.isArray(t.match))m=Array.isArray(u[l])?u[l].filter((A)=>A==null||uJ(t.match[l])(A)):[u[l]].filter((A)=>A==null||uJ(t.match[l])(A))[0];else m=u[l];let _=t.originalModel.schema,y=Jf(o[l]),E=y?p instanceof Map:Sa.isPOJO(p);if(E=E&&HO(_._getSchema(d),"$isSchemaMap"),!t.isVirtual&&E){let A=p instanceof Map?Array.from(p.keys()):Object.keys(p);m=m.reduce((M,O,x)=>(M.set(A[x],O),M),new Map)}if(y&&Array.isArray(m)){for(let A of m)if(Jf(A))A.$__.parent=o[l]}else if(y&&Jf(m))m.$__.parent=o[l];if(t.isVirtual&&y){if(o[l].$populated(d,t.justOne?i[0]:i,t.allOptions),Array.isArray(m))m=m.map((A)=>A==null?void 0:A);H1.set(d,m,o[l],function(M,O,x){if(arguments.length>=3)return M[O]=x,M[O];if(M instanceof Map&&O==="$*")return[...M.values()];return M[O]},h,!1);continue}let w=d.split("."),b=o[l];for(let A=0;A<w.length-1;++A){if(Array.isArray(b)&&!Sa.isArrayIndex(w[A]))break;if(w[A]==="$*")break;if(b[w[A]]==null){let M=w.slice(0,A+1).join("."),O=_._getSchema(M);if(m==null&&O?.$isMongooseArray)break;b[w[A]]={}}if(b=b[w[A]],typeof b!=="object")break}if(y){if(t.allOptions.options[XOe]=t.allOptions.model,o[l].$populated(d,t.unpopulatedValues[l],t.allOptions.options),Jf(m))m.$__.wasPopulated={value:t.unpopulatedValues[l]};if(m instanceof Map&&!m.$isMongooseMap)m=new HOe(m,d,o[l],o[l].schema.path(d).$__schemaType)}if(H1.set(d,m,o[l],oJ,h,!1),y)QOe(o[l],[t.allOptions.options])}};function ZOe(e){if(Array.isArray(e)){if(e.some((t)=>Array.isArray(t)||t===null))return e.map((t)=>{if(t==null)return 0;if(Array.isArray(t))return t.filter((r)=>r!=null).length;return 1});return e.filter((t)=>t!=null).length}return e==null?0:1}function Yf(e,t,r,n){let s=typeof r.transform==="function",i=s?r.transform:(o)=>o;if(Array.isArray(e)){let o=[],u=e.length;for(let l=0;l<u;++l){let f=e[l],h=Array.isArray(n)?n[l]:n;if(!KO(f)&&(!r.retainNullValues||f!=null)&&!s)continue;else if(!r.retainNullValues&&f==null)continue;else if(s)f=i(KO(f)?f:null,h);if(aJ(f,t),o.push(f),t.originalLimit&&o.length>=t.originalLimit)break}let a=o.length;while(e.length>a)Array.prototype.pop.apply(e,[]);let c=0;if(Sa.isMongooseArray(e))for(c=0;c<a;++c)e.set(c,o[c],!0);else for(c=0;c<a;++c)e[c]=o[c];return e}if(KO(e)||Sa.isPOJO(e))return aJ(e,t),i(e,n);if(e instanceof Map)return e;if(r.justOne===!1)return[];return e==null?i(e,n):i(null,n)}function aJ(e,t){if(e!=null&&t.excludeId)if(typeof e.$__setValue==="function")delete e._doc._id;else delete e._id}function KO(e){if(e==null)return!1;return Array.isArray(e)||YOe(e,"$isMongooseMap")||Jf(e)||ig.has(e)}});var fJ=g(function(RPe,hJ){var eSe=Ga();hJ.exports=function(t){if(t instanceof eSe)return Object.keys(t.errors).map((r)=>({message:t.errors[r].message,path:r.split(".").map((s)=>{let i=+s;return Number.isInteger(i)&&String(i)===s?i:s})}));return[{message:t.message}]}});var GO=g(function($Pe,mJ){var tSe=eg(),rSe=v3(),{trusted:og}=n1(),dJ=U2();mJ.exports=function(t,r,n,s,i){let o=nSe(r);if(n.size===1){let u=Array.from(n)[0],a=s.schema.path(u);if(u!=="_id"||!o._id)t=pJ(t,a,i),o[u]=og({$in:t});else if(u==="_id"&&o._id){let l=dJ(o[u])?o[u]:{$eq:o[u]};o[u]={...og({$in:t}),...l}}let c=rSe(u);for(let l=0;l<c.length-1;++l){let f=c[l];if(o[f]!=null&&o[f].$elemMatch!=null){o[f]={...o[f],$elemMatch:{...o[f].$elemMatch,[u.slice(f.length+1)]:og({$in:t})}},delete o[u];break}}}else{let u=[];if(Array.isArray(o.$or))o.$and=[{$or:o.$or},{$or:u}],delete o.$or;else o.$or=u;for(let a of n)if(a!=="_id"||!o._id){let c=s.schema.path(a);t=pJ(t,c,i),u.push({[a]:{$in:t}})}else if(a==="_id"&&o._id){let c=dJ(o[a])?o[a]:{$eq:o[a]};o[a]={...og({$in:t}),...c}}}return o};function pJ(e,t,r){if(e=e.filter((n)=>!(n instanceof tSe)),!r)return e;return e.filter((n)=>{try{return t.cast(n),!0}catch{return!1}})}function nSe(e){if(Array.isArray(e)){if(e.length>1)return{$or:[].concat(e.map((t)=>Object.assign({},t)))};return Object.assign({},e[0])}return Object.assign({},e)}});var gJ=g(function(vPe,yJ){yJ.exports=function(t,r,n){if(t.length===0)return n();let s=t.length,i=null;for(let o of t)r(o,function(u){if(i!=null)return;if(u!=null)return i=u,n(i);if(--s<=0)return n()})}});var AJ=g(function(kPe,EJ){/*!
967
- * ignore
968
- */var _J=_1(),sSe=gr(),iSe=_i(),oSe=gn(),ug=Gf(),Pi=ks(),uSe=le().populateModelSymbol;EJ.exports=function e(t,r,n,s,i){let o=r.path(s),u=n;if(o)return o;let a=r.discriminatorMapping?.key;if(a&&t!=null){if(n?.[a]!=null)r=iSe(t.discriminators,n[a])?.schema||r;else if(t.discriminators!=null)return Object.keys(t.discriminators).reduce((l,f)=>{let h=t.discriminators[f];return l.concat(e(h,h.schema,null,s))},[])}function c(l,f,h,d){let p=l.length+1,m,_;while(p--){if(_=l.slice(0,p).join("."),m=f.path(_),m==null)continue;if(m.embeddedSchemaType||m.schema){if(m.embeddedSchemaType instanceof _J)return m.embeddedSchemaType;let w=null;if(m.schema?.discriminators!=null){let b=m.schema.discriminators,A=_+"."+m.schema.options.discriminatorKey,M=h?Pi.get(A,h)||[]:[];w=Object.keys(b).reduce(function(O,x){let v=b[x].discriminatorMapping.value;if(n==null||M.indexOf(x)!==-1||M.indexOf(v)!==-1)O.push(b[x]);return O},[])}if(p!==l.length&&m.schema){let b;if(l[p]==="$"){if(p+1===l.length)return m;if(b=c(l.slice(p+1),f,h?Pi.get(_,h):null,d.concat(l.slice(0,p))),b)b.$parentSchemaDocArray=b.$parentSchemaDocArray||(m.schema.$isSingleNested?null:m);return b}if(w!=null&&w.length>0){b=[];for(let A of w){let M=c(l.slice(p),A,h?Pi.get(_,h):null,d.concat(l.slice(0,p)));if(M!=null){if(M.$parentSchemaDocArray=M.$parentSchemaDocArray||(m.schema.$isSingleNested?null:m),M.$parentSchemaDocArray)b.$parentSchemaDocArray=M.$parentSchemaDocArray;b.push(M)}}return b}else{if(b=c(l.slice(p),m.schema,h?Pi.get(_,h):null,d.concat(l.slice(0,p))),b)b.$parentSchemaDocArray=b.$parentSchemaDocArray||(m.schema.$isSingleNested?null:m);return b}}else if(p!==l.length&&m.$isMongooseArray&&m.embeddedSchemaType.$isMongooseArray){let b=m;while(b.$isMongooseArray&&!b.$isMongooseDocumentArray)b=b.embeddedSchemaType;let A=c(l.slice(p),b.schema,null,d.concat(l.slice(0,p)));if(A!=null)return A;if(b.schema.discriminators){let M=[];for(let O of Object.keys(b.schema.discriminators)){let x=b.schema.discriminators[O]||b.schema,v=c(l.slice(p),x,null,d.concat(l.slice(0,p)));if(v!=null)M.push(v)}if(M.length>0)return M}}}else if(m.$isSchemaMap&&m.$__schemaType instanceof _J)return m.$__schemaType;let y=d.concat([_]).join(".");if(oSe(u)&&u.$populated(y,!0)&&p<l.length){let w=u.$populated(y,!0).options[uSe];if(w!=null)return c(l.slice(p),w.schema,h?Pi.get(_,h):null,d.concat(l.slice(0,p)))}let E=sSe(u,_);if(E!=null){let b=(Array.isArray(E)&&E.length>0?ug.get(E[0]):ug.get(E))?.schema??null;if(b!=null){let A=c(l.slice(p),b,h?Pi.get(_,h):null,d.concat(l.slice(0,p)));if(A!=null)return A.$parentSchemaDocArray=A.$parentSchemaDocArray||(b.$isSingleNested?null:b),A}}return m}}i=i||s.split(".");for(let l=0;l<i.length;++l)if(i[l]==="$")i[l]="0";return c(i,r,n,[])}});var MJ=g(function(qPe,TJ){var eS=$s(),aSe=eg(),cSe=Zt(),Gi=gr(),lSe=qs(),hSe=_i(),fSe=$n(),wJ=Co(),OJ=AJ(),dSe=zO(),Qf=gn(),tS=_y(),No=ks(),Xf=gA(),Et=Oe(),QO=le().modelSymbol,YO=le().populateModelSymbol,XO=Ui().schemaMixedSymbol,pSe=w3(),mSe=new RegExp("\\.\\d+(?=\\.|$)"),ySe=new RegExp("\\.\\d+(?=\\.|$)","g");TJ.exports=function(t,r,n){let s,i=r.length,o=[],u=n.model?.modelName||n.model,a,c,l,f,h={},d=t.schema;if(n._localModel!=null&&n._localModel.schema.nested[n.path])return[];let p=dSe(t.schema,n.path);if((p==null?null:p.virtual)!=null)return _Se(t,r,n,p);let _=d.paths[n.path]?.splitPath()??n.path.split("."),y=OJ(t,d,null,n.path,_);if(y=Array.isArray(y)?y:[y].filter((b)=>b!=null),!(n.strictPopulate===!1||n.options?.strictPopulate===!1)&&y.length===0&&n._localModel!=null)return new pSe(n._fullPath||n.path);for(let b=0;b<i;b++){s=r[b];let A=null;if(Qf(s)&&s.populated(n.path)){if((n.forceRepopulate??s.constructor.base.options.forceRepopulate)===!1)continue}let M=Qf(s)?s.$__schema:d;if(a=OJ(t,M,s,n.path,_),a!=null&&a.$isMongooseDocumentArray&&a.options.ref==null&&a.options.refPath==null)continue;if(a?.$parentSchemaDocArray&&Gi(n,"options.sort")!=null)return new eS("Cannot populate with `sort` on path "+n.path+" because it is a subproperty of a document array");l=null;let x=!1,v=null,P=null,ge=null;if(a?.instance==="Embedded"){if(a.options.ref){let ze={localField:n.path+"._id",foreignField:"_id",justOne:!0},Sn=w(s,a,u,t),Ts=No.get(n.path,s),Ms=No.get("_id",Ts);ZO(t,o,h,Sn.modelNames,n,ze,Ms,s,P,Ts)}continue}if(Array.isArray(a)){let ze=a;for(let Sn of ze){let Ts,Ms;try{Ms=w(s,Sn,u,t),Ts=Ms.modelNames,x=x||Ms.isRefPath,v=v||Ms.refPath,A=Ms.justOne}catch(hu){return hu}if(x&&!Ms.isRefPath)continue;if(!Ts)continue;l=l||[],f=f||new Set;for(let hu of Ts)if(f.has(hu)===!1)f.add(hu),l.push(hu)}}else{try{let ze=w(s,a,u,t);if(l=ze.modelNames,x=ze.isRefPath,v=v||ze.refPath,A=ze.justOne,P=Gi(a,"options.populate",null),x)ge=l,l=Array.from(new Set(l))}catch(ze){return ze}if(!l)continue}let Me={},oe=n.path,Yt="_id";if("justOne"in n&&n.justOne!==void 0)A=n.justOne;else if(a&&!a[XO]){if(n.path.endsWith("."+a.path)||n.path===a.path)A=Array.isArray(a)?a.every((ze)=>!ze.$isMongooseArray):!a.$isMongooseArray}if(!l)continue;Me.isVirtual=!1,Me.justOne=A,Me.localField=oe,Me.foreignField=Yt;let H=bJ(s,oe,t,n,null,a),Se=String(Et.getValue(Yt,s));n._docs[Se]=Array.isArray(H)?H.slice():H;let ct=Gi(n,"match",null),ss=typeof ct==="function";if(ss)ct=ct.call(s,s);if(nS(ct),Me.match=ct,Me.hasMatchFunction=ss,Me.isRefPath=x,Me.modelNamesInOrder=ge,x){let ze=typeof v==="string"?v.replace(ySe,""):v;l=ESe(s,d,Me,n,ze,H)||l}try{ZO(t,o,h,l,n,Me,H,s,P)}catch(ze){return ze}}return o;function w(b,A,M,O){let x,v=!1,P=null,ge=A;if(A?.instance==="Array")A=A.embeddedSchemaType;if(A?.$isSchemaMap)A=A.$__schemaType;let Me=A?.options?.ref;if(c=A?.options?.refPath,A!=null&&A[XO]&&!Me&&!c&&!M)return{modelNames:null};if(M)x=[M];else if(c!=null){if(typeof c==="function"){let oe=SJ(c,b,A,n.path,d,n._queryProjection);x=oe.modelNames,c=oe.refPath}else x=Xf(c,b,n.path,d,n._queryProjection);v=!0}else{let oe,Yt,H,Se,ct=O,ss=O.schema.options.discriminatorKey;if(!A&&ss&&(Se=Et.getValue(ss,b))){let ze=hSe(O.discriminators,Se)||O;if(ze!=null)ct=ze;else try{ct=rS(O.db,Se)}catch(Sn){return Sn}if(H=ct.schema._getSchema(n.path),H?.embeddedSchemaType)H=H.embeddedSchemaType}else H=A;if(ge&&ge.path.endsWith(".$*"))P=!ge.$isMongooseArray&&!ge._arrayPath;else if(H!=null)P=!H.$isMongooseArray&&!H._arrayPath;if((oe=Gi(H,"options.ref"))!=null)if(H!=null&&typeof oe==="function"&&n.path.endsWith("."+H.path)){x=new Set;let ze=n.path.slice(0,n.path.length-H.path.length-1),Sn=No.get(ze,b,tS),Ts=Array.isArray(Sn)?Et.array.flatten(Sn):Sn?[Sn]:[];for(let Ms of Ts)x.add(JO(oe,Ms));if(Ts.length===0)x=[JO(oe,b)];else x=Array.from(x)}else oe=JO(oe,b),x=[oe];else if((Yt=Gi(H,"options.refPath"))!=null)if(v=!0,typeof Yt==="function"){let ze=SJ(Yt,b,H,n.path,d,n._queryProjection);x=ze.modelNames,Yt=ze.refPath}else x=Xf(Yt,b,n.path,d,n._queryProjection)}if(!x)if(n._localModel==null)x=[O.modelName];else return{modelNames:x,justOne:P,isRefPath:v,refPath:c};if(!Array.isArray(x))x=[x];return{modelNames:x,justOne:P,isRefPath:v,refPath:c}}};function SJ(e,t,r,n,s,i){let o=[],u=null,a=r?.path;if(a!=null&&n.length>a.length+1&&n.charAt(n.length-a.length-1)==="."&&n.slice(n.length-a.length)===a){let d=function(p,m,_){if(p==null)return;if(_>=f.length){h=!0;let A=m+"."+a,M=e.call(p,p,A);u=u||M,o.push(...gSe(M,t,n,A,s,i));return}let y=f[_],E=p?._doc??p;if(y==="$*"){if(E instanceof Map){for(let[A,M]of E.entries())if(M!=null){let O=m.length===0?A:m+"."+A;d(M,O,_+1)}return}if(E!=null&&typeof E==="object")for(let A of Object.keys(E)){let M=E[A];if(M!=null){let O=m.length===0?A:m+"."+A;d(M,O,_+1)}}return}let w=E[y],b=m.length===0?y:m+"."+y;if(Array.isArray(w)){for(let A=0;A<w.length;++A)if(w[A]!=null)d(w[A],b+"."+A,_+1)}else if(w!=null)d(w,b,_+1)},l=n.slice(0,n.length-a.length-1),f=l.indexOf(".")===-1?[l]:l.split("."),h=!1;if(d(t,"",0),h)return{modelNames:o,refPath:u}}let c=e.call(t,t,n);return u=u||c,o.push(...Xf(c,t,n,s,i)),{modelNames:o,refPath:u}}function gSe(e,t,r,n,s,i){let o=typeof e==="string"&&mSe.test(e)?r:n;try{return Xf(e,t,o,s,i)}catch(u){if(o===n&&typeof u?.message==="string"&&u.message.startsWith("Could not normalize ref path"))return Xf(e,t,r,s,i);throw u}}/*!
969
- * ignore
970
- */function _Se(e,t,r,n){let s=[],i={},o=n.virtual;for(let u of t){let a=null,c={},l,f=n.nestedSchemaPath?n.nestedSchemaPath+".":"";if(typeof r.localField==="string")l=r.localField;else if(typeof o.options.localField==="function")l=f+o.options.localField.call(u,u);else if(Array.isArray(o.options.localField))l=o.options.localField.map((E)=>f+E);else l=f+o.options.localField;if(c.count=o.options.count,o.options.skip!=null&&!Object.hasOwn(r,"skip"))r.skip=o.options.skip;if(o.options.limit!=null&&!Object.hasOwn(r,"limit"))r.limit=o.options.limit;if(o.options.perDocumentLimit!=null&&!Object.hasOwn(r,"perDocumentLimit"))r.perDocumentLimit=o.options.perDocumentLimit;let h=o.options.foreignField;if(!l||!h)return new eS(`Cannot populate virtual \`${r.path}\` on model \`${e.modelName}\`, because options \`localField\` and / or \`foreignField\` are missing`);if(typeof l==="function")l=l.call(u,u);if(typeof h==="function")h=h.call(u,u);c.isRefPath=!1;let d=null;if("justOne"in r&&r.justOne!==void 0)d=r.justOne;if(n.nestedSchemaPath&&typeof o.options.ref==="function"){let E=Et.getValue(n.nestedSchemaPath,u);a=Array.isArray(E)?E.flatMap((w)=>o._getModelNamesForPopulate(w)):o._getModelNamesForPopulate(E)}else a=o._getModelNamesForPopulate(u);if(o.options.refPath)d=!!o.options.justOne,c.isRefPath=!0;else if(o.options.ref)d=!!o.options.justOne;c.isVirtual=!0,c.virtual=o,c.justOne=d;let p=Gi(c,"virtual.options.match",null)||Gi(c,"virtual.options.options.match",null),m=Gi(r,"match",null)||p,_=typeof m==="function";if(_)m=m.call(u,u,c.virtual);if(Array.isArray(l)&&Array.isArray(h)&&l.length===h.length){m=Object.assign({},m);for(let E=1;E<l.length;++E)m[h[E]]=DJ(No.get(l[E],u,tS),e.schema),_=!0;l=l[0],h=h[0]}c.localField=l,c.foreignField=h,c.match=m,c.hasMatchFunction=_,nS(m);let y=bJ(u,l,e,r,o);try{ZO(e,s,i,a,r,c,y,u)}catch(E){return E}}return s}/*!
971
- * ignore
972
- */function ZO(e,t,r,n,s,i,o,u,a,c){let l=s.connection??e.db;if(c=c===void 0?o:c,Array.isArray(c))c=Et.cloneArrays(c);if(n==null)return;let f=Et.array.flatten(n),h=f.length;while(h--){let d=f[h];if(d==null)continue;let p;if(s.model&&s.model[QO])p=s.model;else if(d[QO])p=d,d=p.modelName;else try{p=rS(l,d)}catch(y){if(o!==void 0)throw y;p=null}let m=o,_=i.modelNamesInOrder||n;if(i.isRefPath&&Array.isArray(o)&&o.length===_.length)m=CJ(o,_,d);if(!wJ(r,d)){let y={model:p};if(i.isVirtual&&Gi(i.virtual,"options.options"))y.options=cSe(i.virtual.options.options);else if(a!=null)y.options=Object.assign({},a);Et.merge(y,s),s[YO]=p,y[YO]=p,r[d]={model:p,options:y,match:i.hasMatchFunction?[i.match]:i.match,docs:[u],ids:[m],allIds:[o],unpopulatedValues:[c],localField:new Set([i.localField]),foreignField:new Set([i.foreignField]),justOne:i.justOne,isVirtual:i.isVirtual,virtual:i.virtual,count:i.count,isRefPath:!!i.isRefPath,[YO]:p},t.push(r[d])}else if(r[d].localField.add(i.localField),r[d].foreignField.add(i.foreignField),r[d].docs.push(u),r[d].ids.push(m),r[d].allIds.push(o),r[d].unpopulatedValues.push(c),r[d].isRefPath=r[d].isRefPath||!!i.isRefPath,i.hasMatchFunction)r[d].match.push(i.match)}}function rS(e,t){if(wJ(e.models,t)==null&&e._parent!=null)return rS(e._parent,t);return e.model(t)}function CJ(e,t,r){if(!Array.isArray(t))return t===r?Array.isArray(e)?Et.array.flatten(e):[e]:[];if(Array.isArray(e)&&Array.isArray(t))return e.flatMap((n,s)=>CJ(n,t[s],r));return[]}/*!
973
- * ignore
974
- */function JO(e,t){if(typeof e==="function"&&!e[QO])return e.call(t,t);return e}/*!
975
- * ignore
976
- */function bJ(e,t,r,n,s,i){let o=r.schema._getPathType(t),u=o==="real"?r.schema.path(t):o.schema,a=u?.getters||[];t=u?.instance==="Embedded"?t+"._id":t;let c=Gi(n,"options",{}),l="getters"in c?c.getters:Gi(s,"options.getters",!1);if(a.length!==0&&l){let f=Qf(e)?e:r.hydrate(e),h=Et.getValue(t,e);if(Array.isArray(h)){let d=Et.getValue(t.split(".").slice(0,-1),f);return h.map((p,m)=>u.applyGetters(p,d[m]))}else return u.applyGetters(h,f)}else return DJ(No.get(t,e,tS),i)}function DJ(e,t){if(Qf(e))return e._doc._id;if(e?._id!=null&&!t?.$isSchemaMap)return e._id;if(Array.isArray(e)){let r=e.__array??e;for(let n=0;n<r.length;++n)if(Qf(r[n]))r[n]=r[n]._doc._id;if(Et.isMongooseArray(e)&&e.$schema())return e.$schema()._castForPopulate(e,e.$parent());return[].concat(e)}if(fSe(e)==="Object"&&t?.[XO]==null){let r=[];for(let n of Object.keys(e))r.push(e[n]);return r}if(e instanceof Map)return Array.from(e.values());return e}/*!
977
- * ignore
978
- */function ESe(e,t,r,n,s,i){if(!r.isRefPath||s==null)return;let o=s.split("."),u="",a=void 0;for(let c=0;c<o.length;++c){let l=o[c];u=u+(u.length===0?"":".")+l;let f=t.path(u);if(f!=null&&f.$isMongooseDocumentArray&&f.Constructor.discriminators!=null&&Et.hasOwnKeys(f.Constructor.discriminators)){let h=Et.getValue(u,e),d=n.path.substring(u.length+1),p=f.Constructor.schema.options.discriminatorKey;a=[];for(let m of h){let _=Et.getValue(p,m),E=lSe(f.Constructor.discriminators,_)?.schema;if(E==null)continue;let w=E.path(d);if(w==null||w.options.refPath==null){let A=Et.getValue(r.localField.substring(u.length+1),m);i.forEach((M,O)=>{if(M===A)i[O]=aSe(M)});continue}let b=Et.getValue(o.slice(c+1).join("."),m);a.push(b)}}}return a}function nS(e){if(e==null)return;if(typeof e!=="object")return;for(let t of Object.keys(e)){if(t==="$where")throw new eS("Cannot use $where filter with populate() match");if(e[t]!=null&&typeof e[t]==="object")nS(e[t])}}});var PJ=g(function(jPe,xJ){var ASe=gr();xJ.exports=function(t){if(Array.isArray(t)){let n=Object.keys(t[0]);return n.length===1&&n[0]==="_id"&&t[0]._id!=="hashed"}if(typeof t!=="object")return!1;let r=ASe(t,"key",{});return Object.keys(r).length===1&&Object.hasOwn(r,"_id")}});var IJ=g(function(LPe,NJ){var BJ=gr(),ag=Oe(),FJ=Object.freeze({locale:"simple"});NJ.exports=function(t,r,n){if(n.textIndexVersion!=null){delete n.key._fts,delete n.key._ftsx;let u={...n.weights,...n.key};if(Object.keys(u).length!==Object.keys(t).length)return!1;for(let a of Object.keys(u)){if(!(a in t))return!1;let c=u[a];if(c!==BJ(r,"weights."+a)&&!(c===1&&BJ(r,"weights."+a)==null))return!1}if(r.default_language!==n.default_language)return n.default_language==="english"&&r.default_language==null;return!0}let s=["unique","partialFilterExpression","sparse","expireAfterSeconds","collation"];for(let u of s){if(!(u in r)&&!(u in n))continue;if(u==="collation"){let a=r.collation??FJ,c=n.collation??FJ;for(let l of Object.keys(a))if(a[l]!==c[l])return!1}else if(!ag.deepEqual(r[u],n[u]))return!1}let i=Object.keys(t),o=Object.keys(n.key);if(i.length!==o.length)return!1;for(let u=0;u<i.length;++u){if(i[u]!==o[u])return!1;if(!ag.deepEqual(t[i[u]],n.key[o[u]]))return!1}return!0}});var $J=g(function(UPe,RJ){RJ.exports=function(t,r){if(r.timeseries==null)return!1;let{timeField:n,metaField:s}=r.timeseries;if(typeof n!=="string"||typeof s!=="string")return!1;return Object.keys(t.key).length===2&&t.key[n]===1&&t.key[s]===1}});var jJ=g(function(VPe,qJ){var OSe=U2();function SSe(e,t){return kJ({baseModelName:e.baseModelName,discriminatorMapping:e.schema.discriminatorMapping,indexes:t,indexesType:"schema"})}function wSe(e,t){return kJ({baseModelName:e.baseModelName,discriminatorMapping:e.schema.discriminatorMapping,indexes:t,indexesType:"db"})}qJ.exports={getRelatedSchemaIndexes:SSe,getRelatedDBIndexes:wSe};function kJ({baseModelName:e,discriminatorMapping:t,indexes:r,indexesType:n}){let s=t?.key,i=t?.value;if(!s)return r;if(Boolean(e))return r.filter((u)=>{let a=vJ(u,n);return a&&a[s]===i});return r.filter((u)=>{let a=vJ(u,n);return!a||!a[s]||OSe(a[s])&&!("$eq"in a[s])})}function vJ(e,t){if(t==="schema")return e[1]?.partialFilterExpression;return e.partialFilterExpression}});var UJ=g(function(zPe,LJ){LJ.exports=CSe;/*!
979
- * Run `fn` over every entry of `params` with at most `limit` calls in flight at
980
- * a time, resolving to the results in input order. Currently only used by
981
- * `Model.insertMany()` to bound how many documents validate concurrently.
982
- */async function CSe(e,t,r){if(!(r>0))throw Error("Limit must be positive");let n=e.length;if(n===0)return[];let s=Array(n);if(r>=n){for(let l=0;l<n;++l)try{s[l]=t(e[l],l)}catch(f){s[l]=Promise.reject(f),s.length=l+1;break}return Promise.all(s)}let i=0,o=!1,u=null;function a(){if(i>=n||o)return;let l=i++,f;try{f=Promise.resolve(t(e[l],l))}catch(h){if(!o)o=!0,u=h;return}return f.then((h)=>(s[l]=h,a()),(h)=>{if(!o)o=!0,u=h})}let c=[];for(let l=0;l<r;++l)c.push(a());if(await Promise.all(c),o)throw u;return s}});var zJ=g(function(WPe,VJ){VJ.exports=function e(t,r,n){if(r==null)return;for(let s=0;s<r.length;++s)if(Array.isArray(r[s]))e(t,r[s],n+"."+s);else t.push(n+"."+s)}});var GJ=g(function(HPe,KJ){var WJ=gr(),bSe=gn(),cg=ks(),HJ=L2();/*!
983
- * ignore
984
- */KJ.exports=function(t,r,n){let s=HJ(WJ(r,"select",null),!0)||HJ(WJ(r,"options.select",null),!0);if(s==null)return;for(let i of t){if(!Object.hasOwn(s,"-"+i))continue;for(let o of n)if(bSe(o))cg.unset(i,o._doc);else cg.unset(i,o)}}});var JJ=g(function(KPe,YJ){var DSe=GO(),TSe=gr(),K1=Oe();YJ.exports=sS;/*!
985
- * If a single populate query would have more than this many elements in its `$in` filter,
986
- * Mongoose splits the populate into a separate query per document to avoid going over
987
- * MongoDB's 16 MB BSON size limit on queries. Overwritable for testing purposes. See gh-5890.
988
- */sS.maxInFilterLength=50000;/*!
989
- * Split a populate models-map entry into a separate query per document if either:
990
- *
991
- * 1. The `perDocumentLimit` option is set, so each document needs its own query with its
992
- * own `limit` (gh-7318), or
993
- * 2. A single populate query for `mod` would have too many elements in its `$in` filter
994
- * (gh-5890). With multiple foreign fields, `createPopulateQueryFilter()` repeats the ids
995
- * under `$or` once per foreign field, so the threshold counts one copy of `ids` per
996
- * foreign field.
997
- *
998
- * Returns a list of `[mod, match, select, assignmentOpts]` params, one per document, for
999
- * `_execPopulateQuery()`. Returns `null` if the populate query doesn't need to be split.
1000
- * A `null` `match` means the document has no ids to query: `_execPopulateQuery()` skips
1001
- * executing a query, and `_assign()` just sets the document's populated path to the
1002
- * default value.
1003
- *
1004
- * Splitting on document boundaries means each document's populated value is the result of
1005
- * exactly one query, so split entries can typically be assigned from only their own query's
1006
- * results (`_assignFromOwnResults`) rather than scanning every populate query's results.
1007
- * refPath is the exception: a single document's array can contain ids for multiple models,
1008
- * so assigning refPath populate results relies on every query's results being available for
1009
- * every document. refPath entries are therefore only split when `perDocumentLimit` requires
1010
- * it, not to keep the `$in` filter small. A single document whose ids alone overflow the
1011
- * BSON size limit cannot be split.
1012
- */function sS(e,t,r,n){if(e.docs.length<=1)return null;let s=e.options.perDocumentLimit==null?TSe(e.options,"options.perDocumentLimit",null):e.options.perDocumentLimit,i=t.length*e.foreignField.size;if(s==null&&(i<=sS.maxInFilterLength||e.isRefPath))return null;return e.docs.map((o,u)=>{let a={...e,docs:[o],ids:[e.ids[u]],allIds:[e.allIds[u]],unpopulatedValues:[e.unpopulatedValues[u]],match:Array.isArray(e.match)?[e.match[u]]:e.match,_assignFromOwnResults:!e.isRefPath},c=K1.array.flatten(a.ids,MSe);c=K1.array.unique(c);let l=c.length===0||c.every(K1.isNullOrUndefined)?null:DSe(c,a.match,a.foreignField,a.model,a.options.skipInvalidIds);return[a,l,r,n]})}/*!
1013
- * ignore
1014
- */function MSe(e){return e!==void 0}});var UO=g(function(pQ,mQ){/*!
1015
- * Module dependencies.
1016
- */var xSe=vO(),PSe=J6(),Bi=wo(),{createTracedChannel:lS}=j1(),{trace:BSe}=lS("mongoose:model:save"),{trace:FSe}=lS("mongoose:model:insertMany"),{trace:NSe}=lS("mongoose:model:bulkWrite"),ISe=Bm(),uS=G("events").EventEmitter,Io=Ha(),hg=R4(),Ee=$s(),nQ=Lm(),RSe=d3(),hc=H2(),$Se=yY(),aS=ec(),lg=Ga(),sQ=c3(),vSe=h3(),kSe=Vm(),qSe=B3(),jSe=_Y(),LSe=jO(),USe=SY(),iQ=bY(),VSe=MY(),zSe=pO(),oQ=FY(),WSe=IY(),uQ=$Y(),HSe=VY(),aQ=mO(),KSe=GY(),GSe=lJ(),YSe=tO(),wa=Zt(),JSe=fJ(),QSe=GO(),XSe=b2(),iS=q4(),cQ=Gm(),ZSe=n2(),ewe=gJ(),ed=gr(),twe=Co(),rwe=$n(),td=gn(),G1=qs(),Y1=_i(),nwe=MJ(),QJ=Ou(),hS=ji().internalToObjectOptions,fS=PJ(),lQ=IJ(),swe=SA(),iwe=$J(),{getRelatedDBIndexes:owe,getRelatedSchemaIndexes:uwe}=jJ(),dS=EA(),awe=Jm(),hQ=Gf(),cwe=UJ(),lwe=L2(),hwe=RO(),fQ=zJ(),fwe=GJ(),dwe=z4(),pwe=k3(),mwe=JJ(),{buildMiddlewareFilter:Ro}=Yo(),fg=G("util"),ue=Oe(),ywe=$3(),gwe=y3(),_we=jm(),fc=rO(),dc=Symbol("mongoose#Model#collection"),pc=Symbol("mongoose#Model#db"),{arrayAtomicsBackupSymbol:oS,arrayAtomicsSymbol:Ewe,modelSymbol:dQ}=le(),Zf=Symbol("mongoose#Model#subclassed"),{VERSION_INC:dg,VERSION_WHERE:XJ,VERSION_ALL:Awe}=Bi,Owe=Object.assign({},hS,{bson:!0});function V(e,t,r){if(t instanceof aS)throw 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 e==="string")throw TypeError("First argument to `Model` constructor must be an object, **not** a string. Make sure you're calling `mongoose.model()`, not `mongoose.Model()`.");Bi.call(this,e,t,r)}Object.setPrototypeOf(V.prototype,Bi.prototype);V.prototype.$isMongooseModelPrototype=!0;V.prototype.db;V.useConnection=function(t){if(typeof t?.model!=="function"||typeof t.collection!=="function"||typeof t.base?.version!=="string")throw new Ee("`useConnection()` requires a Mongoose connection.");if(this.db?.base?.version&&this.db?.base?.version!==t.base?.version)throw new Ee(`The connection passed to \`useConnection()\` has a different version of Mongoose (${t.base?.version}) than the model you are using (${this.db?.base?.version}).`);if(this.db)delete this.db.models[this.modelName],delete this.prototype.db,delete this.prototype[pc],delete this.prototype.collection,delete this.prototype.$collection,delete this.prototype[dc];this.db=t;let r=t.collection(this.collection.collectionName,t.options);return this.prototype.collection=r,this.prototype.$collection=r,this.prototype[dc]=r,this.prototype.db=t,this.prototype[pc]=t,this.collection=r,this.$__collection=r,t.models[this.modelName]=this,this};V.prototype.collection;V.prototype.$__collection;V.prototype.modelName;V.prototype.$where;V.prototype.baseModelName;V.events;V._middleware;/*!
1017
- * ignore
1018
- */function cS(e,t){if(e.$where==null)return;for(let r of Object.keys(e.$where))t[r]=e.$where[r]}/*!
1019
- * ignore
1020
- */function Swe(e,t){let r={};if(aQ(e.$__schema,t),typeof t.writeConcern<"u"){if(r.writeConcern={},"w"in t.writeConcern)r.writeConcern.w=t.writeConcern.w;if("j"in t.writeConcern)r.writeConcern.j=t.writeConcern.j;if("wtimeout"in t.writeConcern)r.writeConcern.wtimeout=t.writeConcern.wtimeout}else{if("w"in t)r.w=t.w;if("j"in t)r.j=t.j;if("wtimeout"in t)r.wtimeout=t.wtimeout}if("checkKeys"in t)r.checkKeys=t.checkKeys;let n=e.$session(),s=e[pc].base.transactionAsyncLocalStorage?.getStore();if(n!=null)r.session=n;else if(!Object.hasOwn(t,"session")&&s?.session!=null)r.session=s.session;return r}/*!
1021
- * ignore
1022
- */V.prototype.$__save=async function(t){try{if(t&&typeof t==="object"&&"validateBeforeSave"in t?!!t.validateBeforeSave:this.$__schema.options.validateBeforeSave){let c=t!=null&&typeof t==="object"&&Object.hasOwn(t,"validateModifiedOnly")?{validateModifiedOnly:t.validateModifiedOnly}:null;await this.$validate(c),this.$op="save"}await this._execDocumentPreHooks("save",t,[t])}catch(o){await this._execDocumentPostHooks("save",t,o);return}let r=null,n=null;try{let o=Swe(this,t);if(this.$isNew){let u=this.$__hasOnlyPrimitiveValues(),a=u?this.$__toObjectShallow():this.toObject(Owe);if((a||{})._id===void 0)throw new Ee("document must have an _id before saving");this.$__version(!0,a),this.$__reset(),J1(this,!1,u),this.$__.inserting=!0,r=await this[dc].insertOne(a,o).catch((c)=>{throw J1(this,!0,u),c})}else{this.$__.inserting=!1;let u=Array.isArray(t.pathsToSave)?t.pathsToSave:null,a=u!=null?new Set(u):null,c=this.$__delta(u,a),l=u!=null?c!=null?c[2]:this.$__dirty():null,f=u!=null?Object.keys(this.$__.activePaths.getStatePaths("default")).filter((h)=>!qSe(h,a,u)):null;if(c){n=this.$__where(c[0]),cS(this,n);let h=c[1];if(this.$__schema.options.minimize)for(let d of Object.values(h)){if(d==null)continue;for(let p of Object.keys(d)){if(d[p]==null||typeof d[p]!=="object")continue;if(!ue.isPOJO(d[p]))continue;if(ywe(d[p]),ue.hasOwnKeys(d[p])===!1)delete d[p],h.$unset=h.$unset||{},h.$unset[p]=1}}this.$__.modifiedPaths=this.modifiedPaths(),this.$__reset(),wwe(this,l,f),J1(this,!1),r=await this[dc].updateOne(n,h,o).catch((d)=>{throw this.$__undoReset(),d})}else{if(n=this.$__where(),cS(this,n),this.$__.version)this.$__version(n,c);zSe(this.$__schema,o),r=await this.constructor.collection.findOne(n,{...o,projection:{_id:1}}).then((h)=>({matchedCount:!h?0:1}))}}}catch(o){let u=this.$__schema._transformDuplicateKeyError(o);await this._execDocumentPostHooks("save",t,u);return}let s=0;if((t!=null?t.writeConcern!=null?t.writeConcern.w:t.w:0)!==0){if(r!=null)if(Array.isArray(r))s=r.length;else if(r.matchedCount!=null)s=r.matchedCount;else s=r;if(this.$__.version&&!this.$__.inserting){let u=dg===(dg&this.$__.version);this.$__.version=void 0;let a=this.$__schema.options.versionKey,c=this.$__getValue(a)||0;if(s<=0){this.$__undoReset();let l=this.$__.$versionError||new sQ(this,c,this.$__.modifiedPaths);await this._execDocumentPostHooks("save",t,l);return}if(u)this.$__setValue(a,c+1)}if(r!=null&&s<=0){this.$__undoReset();let u=new ISe(n,this.constructor.modelName,s,r);await this._execDocumentPostHooks("save",t,u);return}}this.$__.saving=void 0,this.$__.savedState={},this.$emit("save",this,s),this.constructor.emit("save",this,s),await this._execDocumentPostHooks("save",t)};/*!
1023
- * Restores $__.activePaths state and any atomics for paths that failed
1024
- * to save.
1025
- *
1026
- * @param {Document} doc
1027
- * @param {object[]} unsavedDirty
1028
- * @param {string[]} unsavedDefaultPaths
1029
- */function wwe(e,t,r){if(t==null)return;for(let n of t)if(e.$__.activePaths.modify(n.path),n.value?.[oS])n.value[Ewe]=n.value[oS],n.value[oS]=null;for(let n of r)e.$__.activePaths.default(n)}/*!
1030
- * ignore
1031
- */function Cwe(e,t,r){let n=e.$__schema.options.versionKey;if(!n)return null;let s=e.$__getValue(n)||0;return new sQ(e,s,t.concat(r))}V.prototype.save=async function(t){if(typeof t==="function"||typeof arguments[1]==="function")throw new Ee("Model.prototype.save() no longer accepts a callback");let r;if(this.$op="save",this.$__.saving)r=new vSe(this);else this.$__.saving=!0;if(t=new $Se(t),Object.hasOwn(t,"session"))this.$session(t.session);if(this.$__.timestamps!=null)t.timestamps=this.$__.timestamps;if(!this.$isNew)this.$__.$versionError=Cwe(this,this.modifiedPaths(),Object.keys(this.$__.activePaths.getStatePaths("default")));if(r)throw this.$__handleReject(r),r;this.$__.saveOptions=t;let n=this;return BSe(async function(){try{await n.$__save(t)}catch(i){throw n.$__handleReject(i),i}finally{n.$__.saving=null,n.$__.saveOptions=null,n.$__.$versionError=null,n.$op=null}return n},()=>({operation:"save",collection:n.constructor.collection.name,database:n.constructor.db?.name,serverAddress:n.constructor.db?.host,serverPort:n.constructor.db?.port,args:{options:t}}))};V.prototype.$save=V.prototype.save;V.prototype.$__version=function(e,t){let r=this.$__schema.options.versionKey;if(e===!0){if(r)dwe(t,r,0),this.$__setValue(r,0);return}if(r===!1)return;if(!this.$__isSelected(r))return;if(XJ===(XJ&this.$__.version)){let n=this.$__getValue(r);if(n!=null)e[r]=n}if(dg===(dg&this.$__.version))if(ed(t.$set,r,null)!=null)++t.$set[r];else t.$inc=t.$inc||{},t.$inc[r]=1};V.prototype.increment=function(){return this.$__.version=Awe,this};V.prototype.$__where=function(t){if(t||(t={}),!t._id)t._id=this._doc._id;if(this._doc._id===void 0)throw new Ee("No _id found on document!");return t};V.prototype.deleteOne=function(t){if(typeof t==="function"||typeof arguments[1]==="function")throw new Ee("Model.prototype.deleteOne() no longer accepts a callback");if(!t)t={};if(Object.hasOwn(t,"session"))this.$session(t.session);let r=this,n=this.$__where(),s=r.constructor.deleteOne();if(this.$session()!=null){if(!("session"in s.options))s.options.session=this.$session()}let i=Ro(t,"pre"),o=Ro(t,"post");return s.pre(async function(){let a=await r.constructor._middleware.execPre("deleteOne",r,[r,t],{filter:i});if(a[0]!==r||a[1]!==t)throw new Ee("Document deleteOne pre hooks cannot overwrite arguments");if(s.deleteOne(n,t),r.$where!=null)this.where(r.$where);return a}),s.pre(function(){return Promise.all(r.$getAllSubdocs().map((a)=>a.constructor._middleware.execPre("deleteOne",a,[a],{filter:i})))}),s.pre(function(){if(r.$__.isDeleted)throw new Io.skipWrappedFunction}),s.post(function(){return Promise.all(r.$getAllSubdocs().map((a)=>a.constructor._middleware.execPost("deleteOne",a,[a],{filter:o})))}),s.post(function(){return r.constructor._middleware.execPost("deleteOne",r,[r],{filter:o})}),s.transform(function(a){if(a?.deletedCount>0)r.$isDeleted(!0);return a}),s};V.prototype.$model=function(t){if(arguments.length===0)return this.constructor;return this[pc].model(t)};V.prototype.model=V.prototype.$model;V.exists=function(t,r){if(ke(this,"exists"),typeof arguments[2]==="function")throw new Ee("Model.exists() no longer accepts a callback");return this.findOne(t).select({_id:1}).sort(null).lean().setOptions(r)};V.discriminator=function(e,t,r){let n;if(typeof e==="function"){if(n=e,e=ue.getFunctionName(n),!(n.prototype instanceof V))throw new Ee("The provided class "+e+" must extend Model")}r=r||{};let s=ue.isPOJO(r)?r.value:r,i=typeof r.clone==="boolean"?r.clone:!0,o=typeof r.mergePlugins==="boolean"?r.mergePlugins:!0,u=typeof r.overwriteModels==="boolean"?r.overwriteModels:!1;if(ke(this,"discriminator"),ue.isObject(t)&&!t.instanceOfSchema)t=new aS(t);if(t instanceof aS&&i)t=t.clone();if(t=ZSe(this,e,t,s,o,r.mergeHooks,u),twe(this.db.models,e)&&!t.options.overwriteModels&&!u)throw new RSe(e);t.$isRootDiscriminator=!0,t.$globalPluginsApplied=!0,n=this.db.model(n||e,t,this.$__collection.name),this.discriminators[e]=n;let a=this.discriminators[e];if(Object.setPrototypeOf(a.prototype,this.prototype),Object.defineProperty(a,"baseModelName",{value:this.modelName,configurable:!0,writable:!1}),iQ(a,t),uQ(a,t),this[Zf]!=null)for(let c of this[Zf])c.discriminators=c.discriminators||{},c.discriminators[e]=n.__subclass(n.db,t,c.collection.name);return a};function ke(e,t){if(e==null||e===global)throw new Ee("`Model."+t+"()` cannot run without a model as `this`. Make sure you are calling `MyModel."+t+"()` where `MyModel` is a Mongoose model.");else if(e[dQ]==null)throw new Ee("`Model."+t+"()` cannot run without a model as `this`. Make sure you are not calling `new Model."+t+"()`")}/*!
1032
- * Give the constructor the ability to emit events.
1033
- */for(let e in uS.prototype)V[e]=uS.prototype[e];V.init=function(){if(ke(this,"init"),typeof arguments[0]==="function")throw new Ee("Model.init() no longer accepts a callback");if(this.schema.emit("init",this),this.$init!=null)return this.$init;let t=this.db,r=async()=>{if(!ue.getOption("autoIndex",this.schema.options,t.config,t.base.options))return;return await this.ensureIndexes({_automatic:!0})},n=async()=>{if(!ue.getOption("autoSearchIndex",this.schema.options,t.config,t.base.options))return;return await this.createSearchIndexes()},s=async()=>{let u=ue.getOption("autoCreate",this.schema.options,t.config);if(u==null)await t._waitForConnect(!0),u=ue.getOption("autoCreate",this.schema.options,t.config,t.base.options);if(!u)return;return await this.createCollection()};this.$init=s().then(()=>r()).then(()=>n());let i=this.$init.catch,o=this;return this.$init.catch=function(){return o.$caught=!0,i.apply(o.$init,arguments)},this.$init};V.createCollection=async function(t){if(ke(this,"createCollection"),typeof arguments[0]==="function"||typeof arguments[1]==="function")throw new Ee("Model.createCollection() no longer accepts a callback");let r=Ro(t,"pre"),n=Ro(t,"post");if(t?.middleware!=null){let{middleware:c,...l}=t;t=l}[t]=await this.hooks.execPre("createCollection",this,[t],{filter:r}).catch((c)=>{if(c instanceof Io.skipWrappedFunction)return[c];throw c});let s=this?.schema?.options?.collectionOptions;if(s!=null)t=Object.assign({},s,t);let i=this?.schema?.options?.collation;if(i!=null)t=Object.assign({collation:i},t);let o=this?.schema?.options?.capped;if(o!=null){if(typeof o==="number")t=Object.assign({capped:!0,size:o},t);else if(typeof o==="object")t=Object.assign({capped:!0},o,t)}let u=this?.schema?.options?.timeseries;if(u!=null){if(t=Object.assign({timeseries:u},t),t.expireAfterSeconds!=null);else if(t.expires!=null)ue.expires(t);else if(this.schema.options.expireAfterSeconds!=null)t.expireAfterSeconds=this.schema.options.expireAfterSeconds;else if(this.schema.options.expires!=null)t.expires=this.schema.options.expires,ue.expires(t)}let a=this?.schema?.options?.clusteredIndex;if(a!=null)t=Object.assign({clusteredIndex:{...a,unique:!0}},t);try{if(!(t instanceof Io.skipWrappedFunction))await this.db.createCollection(this.$__collection.collectionName,t)}catch(c){if(c!=null&&(c.name!=="MongoServerError"||c.code!==48))await this.hooks.execPost("createCollection",this,[null],{error:c,filter:n})}return await this.hooks.execPost("createCollection",this,[this.$__collection],{filter:n}),this.$__collection};V.syncIndexes=async function(t){if(ke(this,"syncIndexes"),typeof arguments[0]==="function"||typeof arguments[1]==="function")throw new Ee("Model.syncIndexes() no longer accepts a callback");if(t?.autoCreate??this.schema.options?.autoCreate??this.db.config.autoCreate??this.db.base?.options?.autoCreate??!0)try{await this.createCollection()}catch(i){if(i!=null&&(i.name!=="MongoServerError"||i.code!==48))throw i}let n=await this.diffIndexes({indexOptionsToCreate:!0}),s=await this.cleanIndexes({...t,toDrop:n.toDrop});return await this.createIndexes({...t,toCreate:n.toCreate}),s};V.createSearchIndex=async function(t){return ke(this,"createSearchIndex"),await this.$__collection.createSearchIndex(t)};V.updateSearchIndex=async function(t,r){return ke(this,"updateSearchIndex"),await this.$__collection.updateSearchIndex(t,r)};V.dropSearchIndex=async function(t){return ke(this,"dropSearchIndex"),await this.$__collection.dropSearchIndex(t)};V.listSearchIndexes=async function(t){return ke(this,"listSearchIndexes"),await(await this.$__collection.listSearchIndexes(t)).toArray()};V.diffIndexes=async function(t){if(typeof arguments[0]==="function"||typeof arguments[1]==="function")throw new Ee("Model.syncIndexes() no longer accepts a callback");let r=this,n=await r.listIndexes().catch((a)=>{if(a.codeName=="NamespaceNotFound")return;throw a});if(n===void 0)n=[];n=owe(r,n);let s=r.schema,i=uwe(r,s.indexes()),o=Dwe(s,i,n),u=bwe(s,i,n,o,t);return{toDrop:o,toCreate:u}};function bwe(e,t,r,n,s){let i=[],o=s?.indexOptionsToCreate??!1;for(let[u,a]of t){let c=!1,l=dS(e,wa(a));for(let f of r){if(fS(f))continue;if(lQ(u,l,f)&&!n.includes(f.name)){c=!0;break}}if(!c)if(o)i.push([u,a]);else i.push(u)}return i}function Dwe(e,t,r){let n=[];for(let s of r){let i=!1;if(fS(s))continue;if(iwe(s,e.options))continue;for(let[o,u]of t){let a=dS(e,wa(u));if(oQ(o,a,e.options),lQ(o,a,s)){i=!0;break}}if(i)continue;n.push(s.name)}return n}V.cleanIndexes=async function(t){if(ke(this,"cleanIndexes"),typeof arguments[0]==="function"||typeof arguments[1]==="function")throw new Ee("Model.cleanIndexes() no longer accepts a callback");let r=this;if(Array.isArray(t?.toDrop))return await ZJ(t.toDrop,r,t);let n=await r.diffIndexes();return await ZJ(n.toDrop,r,t)};async function ZJ(e,t,r){if(e.length===0)return[];let n=t.$__collection;if(r?.hideIndexes)await Promise.all(e.map((s)=>t.db.db.command({collMod:n.collectionName,index:{name:s,hidden:!0}})));else await Promise.all(e.map((s)=>n.dropIndex(s)));return e}V.listIndexes=async function(){if(ke(this,"listIndexes"),typeof arguments[0]==="function")throw new Ee("Model.listIndexes() no longer accepts a callback");if(this.$__collection.buffer)await new Promise((t)=>{this.$__collection.addQueue(t)});return this.$__collection.listIndexes().toArray()};V.ensureIndexes=async function(t){if(ke(this,"ensureIndexes"),typeof arguments[0]==="function"||typeof arguments[1]==="function")throw new Ee("Model.ensureIndexes() no longer accepts a callback");await new Promise((r,n)=>{Twe(this,t,(s)=>{if(s!=null)return n(s);r()})})};V.createIndexes=async function(t){if(ke(this,"createIndexes"),typeof arguments[0]==="function"||typeof arguments[1]==="function")throw new Ee("Model.createIndexes() no longer accepts a callback");return this.ensureIndexes(t)};/*!
1034
- * ignore
1035
- */function Twe(e,t,r){let n=Array.isArray(t?.toCreate)?t.toCreate:e.schema.indexes(),s;t=t||{};let i=function(h){if(h&&!e.$caught)e.emit("error",h);e.emit("index",h||s),r&&r(h||s)};for(let h of n)if(fS(h))ue.warn('mongoose: Cannot specify a custom index on `_id` for model name "'+e.modelName+'", MongoDB does not allow overwriting the default `_id` index. See https://bit.ly/mongodb-id-index');let o=[];for(let h of n){let d=h[0];if(h[1].name==null){for(let m of o)if(m[1].name==null&&swe(m[0],d)){ue.warn("mongoose: Duplicate schema index on "+JSON.stringify(d)+' for model "'+e.modelName+'". This is often due to declaring an index using both "index: true" and "schema.index()". MongoDB will not create the duplicate index and options on the duplicate definition (such as expireAfterSeconds or unique) will not be applied. Please remove the duplicate index definition.');break}}o.push(h)}if(!n.length){QJ(function(){i()});return}let u=function(h,d,p,m){e.emit("index-single-done",h,d,p,m)},a=function(h,d){e.emit("index-single-start",h,d)},c=e.schema._baseSchema,l=c?c.indexes():[];QJ(function(){if(t._automatic&&!e.collection.collection)e.collection.addQueue(f,[]);else f()});function f(){if(t._automatic){if(e.schema.options.autoIndex===!1||e.schema.options.autoIndex==null&&e.db.config.autoIndex===!1)return i()}let h=n.shift();if(!h)return i();if(t._automatic&&h[1]._autoIndex===!1)return f();if(l.find((_)=>ue.deepEqual(_,h)))return f();let d=wa(h[0]),p=wa(h[1]);delete p._autoIndex,dS(e.schema,p),aQ(e.schema,p),oQ(d,p,e.schema.options),a(d,p);let m=null;try{m=e.collection.createIndex(d,p)}catch(_){if(!s)s=_;if(!e.$caught)e.emit("error",_);u(_,d,p),f();return}m.then((_)=>{u(null,d,p,_),f()},(_)=>{if(!s)s=_;if(!e.$caught)e.emit("error",_);u(_,d,p),f()})}}V.createSearchIndexes=async function(){ke(this,"createSearchIndexes");let t=[];for(let r of this.schema._searchIndexes)t.push(await this.createSearchIndex(r));return t};V.schema;V.db;V.collection;V.$__collection;V.base;V.discriminators;V.translateAliases=function(t,r){ke(this,"translateAliases");let n=(s,i)=>{let o,u=[],a=s.split("."),c=this.schema;for(let f in a){let h=a[f];if(c?.aliases[h]){if(o=c.aliases[h],r&&o in t)throw new Ee(`Provided object has both field "${h}" and its alias "${o}"`);u.push(o)}else o=h,u.push(h);if(c?.paths[o])c=c.paths[o].schema;else c=null}let l=u.join(".");if(t instanceof Map)t.set(l,i);else t[l]=i;if(l!==s)if(t instanceof Map)t.delete(s);else delete t[s];return t};if(typeof t==="object"){if(t instanceof Map)for(let s of new Map(t))t=n(s[0],s[1]);else for(let s of Object.keys(t))if(t=n(s,t[s]),s[0]==="$")if(Array.isArray(t[s]))for(let i in t[s])t[s][i]=this.translateAliases(t[s][i]);else this.translateAliases(t[s]);return t}else return t};V.deleteOne=function(t,r){if(ke(this,"deleteOne"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function")throw new Ee("Model.prototype.deleteOne() no longer accepts a callback");let n=new this.Query({},{},this,this.$__collection);return n.setOptions(r),n.deleteOne(t)};V.deleteMany=function(t,r){if(ke(this,"deleteMany"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function")throw new Ee("Model.deleteMany() no longer accepts a callback");let n=new this.Query({},{},this,this.$__collection);return n.setOptions(r),n.deleteMany(t)};V.find=function(t,r,n){if(ke(this,"find"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function"||typeof arguments[3]==="function")throw new Ee("Model.find() no longer accepts a callback");let s=new this.Query({},{},this,this.$__collection);return s.select(r),s.setOptions(n),s.find(t)};V.findAndCount=async function(t,r,n){if(ke(this,"findAndCount"),n==null)throw new Ee("Model.findAndCount() requires an `options` argument with `sort` and `limit`");let s=this.find(t,r,n);if(n.sort==null&&!this.schema.options.defaultSort)throw new Ee("Model.findAndCount() requires `options.sort`");if(ue.isEmptyObject(s.options.sort))throw new Ee("Model.findAndCount() does not allow an empty `options.sort`, like `sort: null`. Omit `options.sort` to use the schema's `defaultSort`.");if(n.limit==null)throw new Ee("Model.findAndCount() requires `options.limit`");let i=s.clone().countDocuments().skip(0).limit(null);return Promise.all([s.exec(),i.exec()])};V.findById=function(t,r,n){if(ke(this,"findById"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function")throw new Ee("Model.findById() no longer accepts a callback");return this.findOne({_id:t},r,n)};V.findOne=function(t,r,n){if(ke(this,"findOne"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function")throw new Ee("Model.findOne() no longer accepts a callback");let s=new this.Query({},{},this,this.$__collection);return s.select(r),s.setOptions(n),s.findOne(t)};V.estimatedDocumentCount=function(t){return ke(this,"estimatedDocumentCount"),new this.Query({},{},this,this.$__collection).estimatedDocumentCount(t)};V.countDocuments=function(t,r){if(ke(this,"countDocuments"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function")throw new Ee("Model.countDocuments() no longer accepts a callback");let n=new this.Query({},{},this,this.$__collection);if(r!=null)n.setOptions(r);return n.countDocuments(t)};V.distinct=function(t,r,n){if(ke(this,"distinct"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function")throw new Ee("Model.distinct() no longer accepts a callback");let s=new this.Query({},{},this,this.$__collection);if(n!=null)s.setOptions(n);return s.distinct(t,r)};V.where=function(t,r){ke(this,"where");let n=new this.Query({},{},this,this.$__collection).find({});return n.where.apply(n,arguments)};V.$where=function(){ke(this,"$where");let t=new this.Query({},{},this,this.$__collection).find({});return t.$where.apply(t,arguments)};V.findOneAndUpdate=function(e,t,r){if(ke(this,"findOneAndUpdate"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function"||typeof arguments[3]==="function")throw new Ee("Model.findOneAndUpdate() no longer accepts a callback");let n;if(r)n=r.fields||r.projection;let s=new this.Query({},{},this,this.$__collection);return s.select(n),s.findOneAndUpdate(e,t,r)};V.findByIdAndUpdate=function(e,t,r){if(ke(this,"findByIdAndUpdate"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function"||typeof arguments[3]==="function")throw new Ee("Model.findByIdAndUpdate() no longer accepts a callback");if(e instanceof Bi)e=e._doc._id;return this.findOneAndUpdate.call(this,{_id:e},t,r)};V.findOneAndDelete=function(e,t){if(ke(this,"findOneAndDelete"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function")throw new Ee("Model.findOneAndDelete() no longer accepts a callback");let r;if(t)r=t.select,t.select=void 0;let n=new this.Query({},{},this,this.$__collection);return n.select(r),n.findOneAndDelete(e,t)};V.findByIdAndDelete=function(e,t){if(ke(this,"findByIdAndDelete"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function")throw new Ee("Model.findByIdAndDelete() no longer accepts a callback");return this.findOneAndDelete({_id:e},t)};V.findOneAndReplace=function(e,t,r){if(ke(this,"findOneAndReplace"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function"||typeof arguments[3]==="function")throw new Ee("Model.findOneAndReplace() no longer accepts a callback");let n;if(r)n=r.select,r.select=void 0;let s=new this.Query({},{},this,this.$__collection);return s.select(n),s.findOneAndReplace(e,t,r)};V.create=async function(t,r){if(typeof r==="function"||typeof arguments[2]==="function")throw new Ee("Model.create() no longer accepts a callback");ke(this,"create");let n,s=this.schema.options.discriminatorKey;if(Array.isArray(t))n=t,r=r!=null&&typeof r==="object"?r:{};else{let u=arguments[arguments.length-1];if(r={},typeof u==="function"||typeof r==="function"||typeof arguments[2]==="function")throw new Ee("Model.create() no longer accepts a callback");else if(n=[...arguments],n.length>1&&!u)n.pop();if(n.length===2&&n[0]!=null&&n[1]!=null&&n[0].session==null&&u&&rwe(u.session)==="ClientSession"&&!this.schema.path("session"))ue.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(n.length===0)return Array.isArray(t)?[]:null;let i=[],o=typeof r.aggregateErrors==="boolean"?!r.aggregateErrors:!0;if(delete r.aggregateErrors,r.session&&!r.ordered&&n.length>1)throw new Ee("Cannot call `create()` with a session and multiple documents unless `ordered: true` is set");if(!Array.isArray(t)&&n.length===1){let u=t,a=this.discriminators&&t[s]!=null?G1(this.discriminators,t[s])||Y1(this.discriminators,t[s]):this;if(a==null)throw new Ee(`Discriminator "${t[s]}" not found for model "${this.modelName}"`);if(!(u instanceof a))u=new a(u);return await u.$save(r),u}if(r.ordered){for(let u=0;u<n.length;u++)try{let a=n[u],c=this.discriminators&&a[s]!=null?G1(this.discriminators,a[s])||Y1(this.discriminators,a[s]):this;if(c==null)throw new Ee(`Discriminator "${a[s]}" not found for model "${this.modelName}"`);let l=a;if(!(l instanceof c))l=new c(l);await l.$save(r),i.push(l)}catch(a){if(!o)i.push(a);else throw a}return i}else if(!o)i=await Promise.allSettled(n.map(async(u)=>{let a=this.discriminators&&u[s]!=null?G1(this.discriminators,u[s])||Y1(this.discriminators,u[s]):this;if(a==null)throw new Ee(`Discriminator "${u[s]}" not found for model "${this.modelName}"`);let c=u;if(!(c instanceof a))c=new a(c);return await c.$save(r),c})),i=i.map((u)=>u.status==="fulfilled"?u.value:u.reason);else{let u=null;if(i=await Promise.all(n.map(async(a)=>{let c=this.discriminators&&a[s]!=null?G1(this.discriminators,a[s])||Y1(this.discriminators,a[s]):this;if(c==null)throw new Ee(`Discriminator "${a[s]}" not found for model "${this.modelName}"`);try{let l=a;if(!(l instanceof c))l=new c(l);return await l.$save(r),l}catch(l){if(!u)u=l}})),u)throw u}return i};V.insertOne=async function(t,r){if(ke(this,"insertOne"),t==null||typeof t!=="object")throw new nQ(t,"doc","insertOne");let n=this.schema.options.discriminatorKey,s=this.discriminators&&t[n]!=null?G1(this.discriminators,t[n])||Y1(this.discriminators,t[n]):this;if(s==null)throw new Ee(`Discriminator "${t[n]}" not found for model "${this.modelName}"`);if(!(t instanceof s))t=new s(t);return await t.$save(r)};V.watch=function(e,t){ke(this,"watch"),t=t||{};let r=t?.hydrate!==void 0?ue.omit(t,["hydrate"]):{...t};t.model=this,e=e||[],hwe(e,this.schema,"fullDocument");let n=this.db._waitForConnect().then(()=>this.$__collection.watch(e,r));return new PSe(n,e,t)};V.startSession=function(){return ke(this,"startSession"),this.db.startSession.apply(this.db,arguments)};V.insertMany=async function(t,r){if(ke(this,"insertMany"),typeof r==="function"||typeof arguments[2]==="function")throw new Ee("Model.insertMany() no longer accepts a callback");let n=this;return FSe(function(){return Mwe.call(n,t,r)},()=>({operation:"insertMany",collection:n.collection.name,database:n.db?.name,serverAddress:n.db?.host,serverPort:n.db?.port,args:{docs:t,options:r}}))};async function Mwe(e,t){t=t||{};let r=this._middleware.hasHooks("insertMany"),n=r?Ro(t,"pre"):null,s=r?Ro(t,"post"):null;if(r)try{[e]=await this._middleware.execPre("insertMany",this,[e],{filter:n})}catch(O){await this._middleware.execPost("insertMany",this,[e],{error:O,filter:s})}let i=this,o=t.limit||1000,u=!!t.rawResult,a=t.ordered==null?!0:!!t.ordered,c=!!t.throwOnValidationError,l=!!t.lean,f=this.db.base.transactionAsyncLocalStorage?.getStore();if(!Object.hasOwn(t,"session")&&f?.session!=null)t={...t,session:f.session};if(!Array.isArray(e))e=[e];let h=[],d=a?null:Array(e.length),p=t.session;function m(O,x){if(l)return O;let v=!1;if(!(O instanceof i)){if(O!=null&&typeof O!=="object")return Promise.reject(new nQ(O,"arr."+x,"insertMany"));O=new i(O),v=!0}if(p!=null)O.$session(p);return O.$validate(v?{_skipParallelValidateCheck:!0}:null).then(()=>O).catch((P)=>{if(a===!1){P.index=x,h.push(P),d[x]=P;return}throw P})}let _=await cwe(e,m,o),y={},E=[],w=l?E:[],b=i.schema.options.versionKey?i.schema.paths[i.schema.options.versionKey]?.splitPath():null,A=t.timestamps;for(let O=0;O<_.length;++O){let x=_[O];if(x==null)continue;if(y[E.length]=O,E.push(x),l)continue;if(b)x.$__setValue(b,0);if(A!==!1&&x.initializeTimestamps&&(!x.$__||x.$__.timestamps!==!1))x.initializeTimestamps(A);w.push(x.$__hasOnlyPrimitiveValues()?x.$__toObjectShallow():x.toObject(hS))}if(h.length>0&&a===!1)h.sort((O,x)=>O.index-x.index);if(E.length===0){if(c)throw new hg(h,d,null,"insertMany");if(u){let O={acknowledged:!0,insertedCount:0,insertedIds:{}};return fc(O,h,h),O}return[]}let M;try{M=await this.$__collection.insertMany(w,t)}catch(O){if(O.writeErrors==null&&O.result?.result?.writeErrors!=null)O.writeErrors=O.result.result.writeErrors;let x=O?.writeErrors,v=new Set((O?.writeErrors||[]).map((ge)=>ge.index));if(O.writeErrors!=null)for(let ge=0;ge<O.writeErrors.length;++ge){let Me=O.writeErrors[ge],oe=y[Me.index];if(Me.err!=null)Me.err.index=oe;if(!a)d[oe]=O.writeErrors[ge]}if(!a){for(let ge=0;ge<d.length;++ge)if(d[ge]===void 0)d[ge]=_[ge];O.results=d}let P=-1;if(O.insertedDocs=E.filter((ge,Me)=>{let oe=!x||v.has(Me);if(a){if(P>-1)return Me<P;if(oe)P=Me}return!oe}).map(function(Me){if(l)return Me;return Me.$__reset(!0),J1(Me,!1),Me}),u&&a===!1)fc(O,h,d);if(r)await this._middleware.execPost("insertMany",this,[e],{error:O,filter:s});else throw O}if(!l)for(let O of E){let x=O.$__hasOnlyPrimitiveValues();O.$__reset(!0,x),J1(O,!1,x)}if(a===!1&&c&&h.length>0){for(let O=0;O<d.length;++O)if(d[O]===void 0)d[O]=_[O];throw new hg(h,d,M,"insertMany")}if(u){if(a===!1){for(let O=0;O<d.length;++O)if(d[O]===void 0)d[O]=_[O];fc(M,h,d)}return M}if(t.populate!=null)return this.populate(E,t.populate).catch((O)=>{if(O!=null)O.insertedDocs=E;throw O});if(r){let[O]=await this._middleware.execPost("insertMany",this,[E],{filter:s});return O}return E}/*!
1036
- * @param {Document} doc The document to set `$isNew` on.
1037
- * @param {boolean} val The value to set `$isNew` to.
1038
- * @param {boolean} [hasOnlyPrimitiveValues] Skip getting subdocs for performance if we know there are none.
1039
- * @api private
1040
- */function J1(e,t,r){if(e.$isNew=t,e.$emit("isNew",t),e.constructor.emit("isNew",t),r)return;let n=e.$getAllSubdocs({useCache:!0});for(let s of n)s.$isNew=t,s.$emit("isNew",t)}V.bulkWrite=async function(t,r){if(ke(this,"bulkWrite"),typeof r==="function"||typeof arguments[2]==="function")throw new Ee("Model.bulkWrite() no longer accepts a callback");let n=this;return NSe(function(){return xwe.call(n,t,r)},()=>({operation:"bulkWrite",collection:n.collection.name,database:n.db?.name,serverAddress:n.db?.host,serverPort:n.db?.port,args:{ops:t,options:r}}))};async function xwe(e,t){t=t||{};let r=Ro(t,"pre"),n=Ro(t,"post");try{[e,t]=await this.hooks.execPre("bulkWrite",this,[e,t],{filter:r})}catch(a){if(a instanceof Io.skipWrappedFunction)e=a;else await this.hooks.execPost("bulkWrite",this,[null],{error:a,filter:n})}if(e instanceof Io.skipWrappedFunction)return e.args[0];let s=t.ordered==null?!0:t.ordered;if(e.length===0){let c=new(this.base.driver.get()).BulkWriteResult(iS(),!1);return c.n=0,fc(c,[],[]),c}let i=t?._skipCastBulkWrite?[]:e.map((a)=>YSe(this,a,t)),o=this.db.base.transactionAsyncLocalStorage?.getStore();if((!t||!Object.hasOwn(t,"session"))&&o?.session!=null)t={...t,session:o.session};let u=null;if(s){await new Promise((a,c)=>{ewe(i,(l,f)=>l(f),(l)=>{if(l)return c(l);a()})});try{u=await this.$__collection.bulkWrite(e,t)}catch(a){await this.hooks.execPost("bulkWrite",this,[null],{error:a,filter:n})}}else{let a=[],c=[],l=[];if(i.length>0)a=await Promise.all(e.map((p,m)=>{if(m>=i.length)return m;return new Promise((_)=>{i[m]((y)=>{if(y==null)_(m);else c.push({index:m,error:y}),l[m]=y;_()})})})),a=a.filter((p)=>p!=null);else a=e.map((p,m)=>m);c=c.sort((p,m)=>p.index-m.index).map((p)=>p.error);let f=a.sort((p,m)=>p-m).map((p)=>e[p]);if(f.length===0){if(t.throwOnValidationError&&c.length)throw new hg(c,l,u,"bulkWrite");let m=new(this.base.driver.get()).BulkWriteResult(iS(),!1);return m.result=iS(),fc(m,c,l),m}let h;[u,h]=await this.$__collection.bulkWrite(f,t).then((p)=>[p,null]).catch((p)=>[null,p]);let d={};if(h?.writeErrors)for(let p of h.writeErrors)d[p.err.index]=p;for(let p=0;p<a.length;++p)l[a[p]]=d[p]??null;if(h){if(c.length>0)fc(h,c,l);await this.hooks.execPost("bulkWrite",this,[null],{error:h,filter:n})}if(c.length>0)if(t.throwOnValidationError)throw new hg(c,l,u,"bulkWrite");else fc(u,c,l)}return await this.hooks.execPost("bulkWrite",this,[u],{filter:n}),u}V.bulkSave=async function(t,r){if(r=r||{},r.timestamps!=null)for(let h of t)h.$__.saveOptions=h.$__.saveOptions||{},h.$__.saveOptions.timestamps=r.timestamps;else for(let h of t)if(h.$__.timestamps!=null)h.$__.saveOptions=h.$__.saveOptions||{},h.$__.saveOptions.timestamps=h.$__.timestamps;if(Object.hasOwn(r,"session"))for(let h of t)h.$session(r.session);await Promise.all(t.map((h)=>Pwe(h,r)));let n=[],s=this.buildBulkWriteOperations(t,r,n),i={skipValidation:!0,_skipCastBulkWrite:!0,...r},{bulkWriteResult:o,bulkWriteError:u}=await this.bulkWrite(s,i).then((h)=>({bulkWriteResult:h,bulkWriteError:null}),(h)=>({bulkWriteResult:null,bulkWriteError:h}));if(u!=null&&u.name!=="MongoBulkWriteError")throw u;let a=o?.matchedCount??0,c=o?.insertedCount??0;if(s.length>0&&a+c<s.length&&!u)throw new gwe(this.modelName,t,o);let l=u?.writeErrors||[],f=t;if(l.length>0)if(r.ordered!==!1)f=t.slice(0,n[l[0].index]);else{let h=t.length>=25?{}:null;if(h!=null)for(let d of l)h[n[d.index]]=!0;f=t.filter((d,p)=>h==null?!l.some((m)=>n[m.index]===p):!h[p])}if(await Promise.all(f.map((h)=>Bwe(h,r))),u!=null)throw u;return o};async function Pwe(e,t){let r=Ro(t,"pre"),[n]=await e.schema.s.hooks.execPre("save",e,[t],{filter:r});if(n!==t)throw new Ee('Cannot overwrite options in pre("save") hook on bulkSave()')}async function Bwe(e,t){let r=e.$isNew;if(r)J1(e,!1);if(e.$__reset(),!r)e._applyVersionIncrement();let n=Ro(t,"post");return e.schema.s.hooks.execPost("save",e,[e],{filter:n})}V.applyDefaults=function e(t){if(t==null)return t;if(td(t)){kSe(t,t.$__.fields,t.$__.exclude);for(let r of t.$getAllSubdocs())e(r,r.$__.fields,r.$__.exclude);return t}return jSe(t,this.schema),t};V.applyVirtuals=function(t,r){if(t==null)return t;if(td(t))return t;return KSe(this.schema,t,r),t};V.applyTimestamps=function(t,r){if(t==null)return t;if(td(t))return t;return HSe(this.schema,t,r),t};V.castObject=function(t,r){r=r||{};let n={},s=this.schema,i=s.options.discriminatorKey;if(s.discriminators!=null&&t!=null&&t[i]!=null)s=cQ(s,t[i])||s;let o=Object.keys(s.paths);for(let a of o){if(!s.path(a)?.$isMongooseArray)continue;let l=ed(t,a);fQ(o,l,a)}let u=null;for(let a of o){let c=s.path(a);if(c==null)continue;let l=ed(t,a,void 0);if(l==null)continue;let f=a.indexOf(".")===-1?[a]:a.split("."),h=n;for(let d=0;d<f.length-1;++d){if(h[f[d]]==null)h[f[d]]=isNaN(f[d+1])?{}:[];h=h[f[d]]}if(c.$isMongooseDocumentArray){let d=c.options?.castNonArrays??c.constructor.options.castNonArrays;if(!Array.isArray(l)){if(!d){if(!r.ignoreCastErrors)u=u||new lg,u.addError(a,new _we(a,l))}else h[f[f.length-1]]=[V.castObject.call(c.Constructor,l)];continue}}if(c.$isSingleNested||c.$isMongooseDocumentArrayElement){try{l=V.castObject.call(c.Constructor,l)}catch(d){if(!r.ignoreCastErrors)u=u||new lg,u.addError(a,d);continue}h[f[f.length-1]]=l;continue}try{l=c.cast(l),h[f[f.length-1]]=l}catch(d){if(!r.ignoreCastErrors)u=u||new lg,u.addError(a,d);continue}}if(u!=null){if(this.modelName!=null)for(let a of Object.keys(u.errors)){let c=u.errors[a];if(typeof c.setModel==="function")c.setModel(this)}throw u}return n};V.buildBulkWriteOperations=function(t,r,n){if(!Array.isArray(t))throw new Ee(`bulkSave expects an array of documents to be passed, received \`${t}\` instead`);return i(),t.map((o,u)=>{if(!r.skipValidation){if(!(o instanceof Bi))throw new Ee(`documents.${u} was not a mongoose document, documents must be an array of mongoose documents (instanceof mongoose.Document).`);if(r.validateBeforeSave==null||r.validateBeforeSave){let f=o.$__validateSync();if(f!=null)throw f}}if(o.isNew){let f=o.$__schema.options.versionKey;if(f)o.$__setValue(f,0);let h={insertOne:{document:o}};return ue.injectTimestampsOption(h.insertOne,r.timestamps),n?.push(u),h}let c=o.$__delta();if(c!=null&&!ue.isEmptyObject(c[0])){let f=o.$__where(c[0]),h=c[1];cS(o,f);let d=this.schema.options.shardKey;if(d){let m=Object.keys(d),_=m.length;for(let y=0;y<_;++y)f[m[y]]=o[m[y]]}o.$__version(f,c);let p={updateOne:{filter:f,update:h}};return ue.injectTimestampsOption(p.updateOne,r.timestamps),n?.push(u),p}return null}).filter((o)=>o!==null);function i(){if(r=r||{},r.skipValidation==null)r.skipValidation=!1}};V.hydrate=function(t,r,n){if(ke(this,"hydrate"),n?.virtuals&&n?.hydratedPopulatedDocs===!1)throw new Ee("Cannot set `hydratedPopulatedDocs` option to false if `virtuals` option is truthy because `virtuals: true` also sets populated virtuals");if(r!=null){if(td(t))t=t.toObject(hS);r=lwe(r),t=VSe(t,r)}let s=sf().createModel(this,t,r,r,n);return s.$init(t,n),s};V.updateMany=function(t,r,n){if(ke(this,"updateMany"),r==null)throw new Ee("updateMany `update` parameter cannot be nullish");return pS(this,"updateMany",t,r,n)};V.updateOne=function(t,r,n){return ke(this,"updateOne"),pS(this,"updateOne",t,r,n)};V.replaceOne=function(t,r,n){ke(this,"replaceOne");let s=this?.schema?.options?.versionKey||null;if(s&&!r[s])r[s]=0;return pS(this,"replaceOne",t,r,n)};function pS(e,t,r,n,s){let i=new e.Query({},{},e,e.collection);if(r instanceof Bi)r=r.toObject();else r=wa(r);s=typeof s==="function"?s:wa(s);let o=e?.schema?.options?.versionKey??null;return XSe(n,s,o),i[t](r,n,s)}V.aggregate=function(t,r){if(ke(this,"aggregate"),typeof r==="function"||typeof arguments[2]==="function")throw new Ee("Model.aggregate() no longer accepts a callback");let n=new xSe(t||[]);if(n.model(this),r!=null)n.option(r);return n};V.validate=async function(t,r,n){if(arguments.length<3||arguments.length===3&&typeof arguments[2]==="function")n=t;if(typeof n==="function"||typeof arguments[3]==="function")throw new Ee("Model.validate() no longer accepts a callback");let s=this.schema,i=s.options.discriminatorKey;if(s.discriminators!=null&&t!=null&&t[i]!=null)s=cQ(s,t[i])||s;let o=Object.keys(s.paths);if(r!=null){let c=typeof r==="string"?new Set(r.split(" ")):Array.isArray(r)?new Set(r):new Set(o);o=o.filter((l)=>{if(r.pathsToSkip){if(Array.isArray(r.pathsToSkip)){if(r.pathsToSkip.find((d)=>d==l))return!1}else if(typeof r.pathsToSkip=="string"){if(r.pathsToSkip.indexOf(" ")!==-1&&r.pathsToSkip.split(" ").includes(l))return!1;else if(r.pathsToSkip===l)return!1}}let f=l.split("."),h=f[0];for(let d of f.slice(1)){if(c.has(h))return!0;h+="."+d}return c.has(l)})}for(let c of o){let l=s.path(c);if(!l?.$isMongooseArray||l.$isMongooseDocumentArray)continue;let f=ed(t,c);fQ(o,f,c)}let u=null;o=new Set(o);try{t=this.castObject(t)}catch(c){u=c;for(let l of Object.keys(u.errors||{}))o.delete(l)}let a=[];for(let c of o){let l=s.path(c);if(l==null)continue;let f=ed(t,c,void 0);a.push(l.doValidate(f,n,{path:c}).catch((h)=>{u=u||new lg,u.addError(c,h)}))}if(await Promise.all(a),u!=null)throw u;return t};Object.defineProperty(V,"~standard",{configurable:!0,get(){return{version:1,vendor:"mongoose",validate:(e,t)=>this.validate(e,t?.libraryOptions).then((r)=>({value:r}),(r)=>({issues:JSe(r)}))}}});V.populate=async function(t,r){if(ke(this,"populate"),typeof r==="function"||typeof arguments[2]==="function")throw new Ee("Model.populate() no longer accepts a callback");if(r=ue.populate(r),r.length===0)return t;if(r.find((n)=>n.ordered))for(let n of r)await eQ(this,t,n);else{let n=[];for(let s of r)n.push(eQ(this,t,s));await Promise.all(n)}return t};/*!
1041
- * Populates `docs` for a single `populateOptions` instance.
1042
- */var Fwe=/\s?-_id\s?/,Nwe=/\s?-_id\s?/g;async function eQ(e,t,r){if(r.strictPopulate==null){if(r._localModel?.schema._userProvidedOptions.strictPopulate!=null)r.strictPopulate=r._localModel.schema._userProvidedOptions.strictPopulate;else if(r._localModel!=null&&e.base.options.strictPopulate!=null)r.strictPopulate=e.base.options.strictPopulate;else if(e.base.options.strictPopulate!=null)r.strictPopulate=e.base.options.strictPopulate}if(!Array.isArray(t))t=[t];if(t.length===0||t.every(ue.isNullOrUndefined))return;let n=nwe(e,t,r);if(n instanceof Error)throw n;let s=n.length,i=[];function o(f){return f!==void 0}let u=!1,a=[];for(let f=0;f<s;++f){let h=n[f],d=h.options.select,p=ue.array.flatten(h.ids,o);p=ue.array.unique(p);let m={};if(m.sort=h&&h.options&&h.options.options&&h.options.options.sort||void 0,m.excludeId=Fwe.test(d)||d&&d._id===0,h.options&&h.options.options&&h.options.options.lean&&h.options.options.lean.transform)h.options.options._leanTransform=h.options.options.lean.transform,h.options.options.lean=!0;if(p.length===0||p.every(ue.isNullOrUndefined)){rQ(e,[],h,m);continue}if(u=!0,typeof r.foreignField==="string")h.foreignField.clear(),h.foreignField.add(r.foreignField);if(m.excludeId)if(typeof d==="string")d=d.replace(Nwe," ");else if(Array.isArray(d))d=d.filter((E)=>E!=="-_id");else{let{_id:E,...w}=d;d=w}if(h.options.options?.limit!=null)m.originalLimit=h.options.options.limit;else if(h.options.limit!=null)m.originalLimit=h.options.limit;let _=mwe(h,p,d,m);if(_!=null){a.push(..._);continue}let y=QSe(p,h.match,h.foreignField,h.model,h.options.skipInvalidIds);a.push([h,y,d,m])}if(!u){if(n.length!==0)return;if(r.populate!=null){let f=ue.populate(r.populate).map((h)=>Object.assign({},h,{path:r.path+"."+h.path}));return e.populate(t,f)}return}let c=new Map,l=[];if(r.ordered)for(let f=0;f<a.length;f++){let h=a[f],{docs:d,deferredPopulates:p}=await tQ.apply(null,h);if(l.push(d),!h[0]._assignFromOwnResults)i=i.concat(d);if(p.length>0)c.set(f,p)}else{let f=[];for(let d of a)f.push(tQ.apply(null,d));let h=await Promise.all(f);for(let d=0;d<h.length;d++){let{docs:p,deferredPopulates:m}=h[d];if(l.push(p),!a[d][0]._assignFromOwnResults)i=i.concat(p);if(m.length>0)c.set(d,m)}}for(let f=0;f<a.length;f++){let h=a[f],d=h[0],p=h[3],m=d._assignFromOwnResults?l[f]:i;for(let _ of m)d.options._childDocs.push(_);rQ(e,m,d,p)}if(c.size>0)for(let f=0;f<a.length;f++){let d=a[f][0];if(!Array.isArray(d.match))continue;let p=c.get(f);if(!p||p.length===0)continue;let m=[];for(let _ of d.docs){let y=td(_)?_.get(d.options.path):ue.getValue(d.options.path,_);if(Array.isArray(y))m.push(...y);else if(y!=null)m.push(y)}if(m.length>0)for(let _ of p)await d.model.populate(m,_)}for(let f=0;f<a.length;f++){let h=a[f][0];fwe(h.foreignField,h.options,h._assignFromOwnResults?l[f]:i)}for(let f=0;f<a.length;f++){let h=a[f][0];if(h.options?.options?._leanTransform){let d=h._assignFromOwnResults?l[f]:i;for(let p of d)h.options.options._leanTransform(p)}}}/*!
1043
- * ignore
1044
- */function tQ(e,t,r){if(t==null)return Promise.resolve({docs:[],deferredPopulates:[]});let n=wa(e.options.populate),s={};if(e.options.skip!==void 0)s.skip=e.options.skip;if(e.options.limit!==void 0)s.limit=e.options.limit;if(e.options.perDocumentLimit!==void 0)s.perDocumentLimit=e.options.perDocumentLimit;if(Object.assign(s,e.options.options),s.readPreference==null&&e.options._inheritedReadPreference!=null)s.readPreference=e.options._inheritedReadPreference;if(s.readConcern==null&&e.options._inheritedReadConcern!=null)s.readConcern=e.options._inheritedReadConcern;if(e.count)delete s.skip,s.sort??={};if(s.perDocumentLimit!=null)s.limit=s.perDocumentLimit,delete s.perDocumentLimit;else if(s.limit!=null)s.limit=s.limit*e.ids.length;if(Array.isArray(e.match))s._deferPopulate=!0;let i=e.model.find(t,r,s);for(let u of e.foreignField)if(u!=="_id"&&i.selectedInclusively()&&!awe(i._fields,u))i.select(u);if(e.count)for(let u of e.foreignField)i.select(u);let o=n&&Array.isArray(e.match);if(n){if(e.model.baseModelName!=null)if(Array.isArray(n))n.forEach((a)=>{a.strictPopulate=!1});else if(typeof n==="string")n={path:n,strictPopulate:!1};else n.strictPopulate=!1;let u=e.options._fullPath||e.options.path;if(Array.isArray(n)){for(let a of n)if(a._fullPath=u+"."+a.path,o&&a._localModel==null)a._localModel=e.model}else if(typeof n==="object"){if(n._fullPath=u+"."+n.path,o&&n._localModel==null)n._localModel=e.model}}if(n&&!o)i.populate(n);return i.exec().then((u)=>{for(let c of u)hQ.set(c,e.model);let a=[];if(i._deferredPopulate)a.push(...i._deferredPopulate),delete i._deferredPopulate;if(o)n=ue.populate(n),pwe(i,n),a.push(n);return{docs:u,deferredPopulates:a}})}/*!
1045
- * ignore
1046
- */function rQ(e,t,r,n){let{options:s,isVirtual:i,justOne:o}=r,u,a=s&&s.options&&s.options.lean||!1,c=t.length,l={},f={},h,d,p=wa(r.allIds);for(let m=0;m<c;m++){if(d=t[m],d==null)continue;for(let _ of r.foreignField){if(u=ue.getValue(_,d),Array.isArray(u)){u=ue.array.unique(ue.array.flatten(u));for(let y of u){if(y instanceof Bi)y=y._doc._id;if(h=String(y),f[h])if(Array.isArray(f[h]))f[h].push(d),l[h].push(m);else f[h]=[f[h],d],l[h]=[l[h],m];else if(i&&!o)f[h]=[d],l[h]=[m];else f[h]=d,l[h]=m}}else{if(u instanceof Bi)u=u._doc._id;if(h=String(u),f[h]){if(Array.isArray(f[h]))f[h].push(d),l[h].push(m);else if(i||f[h].constructor!==d.constructor||(f[h]instanceof Bi?String(f[h]._doc._id):String(f[h]._id))!==(d instanceof Bi?String(d._doc._id):String(d._id)))f[h]=[f[h],d],l[h]=[l[h],m]}else f[h]=d,l[h]=m}if(!a)d.$__.wasPopulated=d.$__.wasPopulated||{value:u}}}GSe({originalModel:e,rawIds:r.isVirtual?p:r.allIds,allIds:p,unpopulatedValues:r.unpopulatedValues,foreignField:r.foreignField,rawDocs:f,rawOrder:l,docs:r.docs,path:s.path,options:n,justOne:r.justOne,isVirtual:r.isVirtual,allOptions:r,populatedModel:r.model,lean:a,virtual:r.virtual,count:r.count,match:r.match})}V.compile=function(t,r,n,s,i){if(r.options.versionKey!==!1&&!r.paths[r.options.versionKey]){let f={};f[r.options.versionKey]=Number,r.add(f)}let u;if(typeof t==="function"&&t.prototype instanceof V)u=t,t=u.name,r.loadClass(u,!1),u.prototype.$isMongooseModelPrototype=!0;else u=function f(h,d,p){if(f.hooks.execPreSync("createModel",h),!(this instanceof f))return new f(h,d,p);let m=f.schema.options.discriminatorKey;if(f.discriminators==null||h==null||h[m]==null){V.call(this,h,d,p);return}let _=G1(f.discriminators,h[m])||Y1(f.discriminators,h[m]);if(_!=null)return new _(h,d,p);V.call(this,h,d,p)};if(u.hooks=r.s.hooks.clone(),u.base=i,u.modelName=t,!(u.prototype instanceof V))Object.setPrototypeOf(u,V),Object.setPrototypeOf(u.prototype,V.prototype);u.model=function(h){return this.db.model(h)},u.db=s,u.prototype.db=s,u.prototype[pc]=s,u.discriminators=u.prototype.discriminators=void 0,u[dQ]=!0,u.events=new uS,r._preCompile();let c={schemaUserProvidedOptions:r._userProvidedOptions||{},capped:r.options.capped,Promise:u.base.Promise,modelName:t};if(r.options.autoCreate!==void 0)c.autoCreate=r.options.autoCreate;let l=s.collection(n,c);return u.prototype.collection=l,u.prototype.$collection=l,u.prototype[dc]=l,u.prototype.$__setSchema(r),iQ(u,r),uQ(u,r),USe(u,r),WSe(u,r.s.hooks,r.statics),u.schema=u.prototype.$__schema,u.collection=l,u.$__collection=l,u.Query=function(){hc.apply(this,arguments)},Object.setPrototypeOf(u.Query.prototype,hc.prototype),u.Query.base=hc.base,u.Query.prototype.constructor=hc,u._applyQueryMiddleware(),Iwe(u,r.query),u};V.clientEncryption=function(){let t=this.base.driver.get().ClientEncryption;if(!t)throw new Ee("The mongodb driver must be used to obtain a ClientEncryption object.");let r=this.collection?.conn?.client;if(!r)return null;let n=r.options.autoEncryption;if(!n)return null;let{keyVaultNamespace:s,keyVaultClient:i,kmsProviders:o,credentialProviders:u,proxyOptions:a,tlsOptions:c}=n;return new t(i??r,{keyVaultNamespace:s,kmsProviders:o,credentialProviders:u,proxyOptions:a,tlsOptions:c})};V.$__updateConnection=function(t){this.db=t,this.prototype.db=t,this.prototype[pc]=t;let r=t.collection(this.collection.collectionName,this.collection.opts);this.prototype.collection=r,this.prototype.$collection=r,this.prototype[dc]=r,this.collection=r,this.$__collection=r};function Iwe(e,t){for(let r in t)e.Query.prototype[r]=t[r]}V.__subclass=function(t,r,n){let s=this,i=function l(f,h,d){if(!(this instanceof l))return new l(f,h,d);s.call(this,f,h,d)};if(Object.setPrototypeOf(i,s),Object.setPrototypeOf(i.prototype,s.prototype),i.db=t,i.prototype.db=t,i.prototype[pc]=t,s[Zf]=s[Zf]||[],s[Zf].push(i),s.discriminators!=null){i.discriminators={};for(let l of Object.keys(s.discriminators))i.discriminators[l]=s.discriminators[l].__subclass(s.db,s.discriminators[l].schema,n)}let o=r&&typeof r!=="string"?r:s.prototype.$__schema,u=o.options||{},a=o._userProvidedOptions||{};if(!n)n=s.prototype.$__schema.get("collection")||ue.toCollectionName(s.modelName,this.base.pluralize());let c={schemaUserProvidedOptions:a,capped:o&&u.capped};return i.prototype.collection=t.collection(n,c),i.prototype.$collection=i.prototype.collection,i.prototype[dc]=i.prototype.collection,i.collection=i.prototype.collection,i.$__collection=i.collection,i.init().catch(()=>{}),i};V.recompileSchema=function(){if(this.prototype.$__setSchema(this.schema),this.schema._applyDiscriminators!=null)for(let t of this.schema._applyDiscriminators.keys())this.discriminator(t,this.schema._applyDiscriminators.get(t));delete this.schema._defaultToObjectOptionsMap,LSe(this.schema,new WeakSet,!0),this.schema._preCompile()};V.inspect=function(){return`Model { ${this.modelName} }`};V.namespace=function(){return this.db.name+"."+this.collection.collectionName};if(fg.inspect.custom)V[fg.inspect.custom]=V.inspect;/*!
1047
- * Applies query middleware from this model's schema to this model's
1048
- * Query constructor.
1049
- */V._applyQueryMiddleware=function(){let t=this.Query,r=this.schema.s.hooks.filter((n)=>{let s=Rwe(n);if(n.name==="validate")return!!s.query;if(n.name==="deleteOne"||n.name==="updateOne")return!!s.query||ue.hasOwnKeys(s)===!1;if(n.query!=null||n.document!=null)return!!n.query;return!0});t.prototype._queryMiddleware=r};function Rwe(e){let t={};if(Object.hasOwn(e,"query"))t.query=e.query;if(Object.hasOwn(e,"document"))t.document=e.document;return t}/*!
1050
- * Module exports.
1051
- */mQ.exports=pQ=V});var gQ=g(function(rd,yQ){yQ.exports=kwe;rd.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 $we=rd.pluralization;rd.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 vwe=rd.uncountables;function kwe(e){let t;if(e=e.toLowerCase(),!~vwe.indexOf(e)){if(t=$we.filter(function(r){return e.match(r[0])}),t[0])return e.replace(t[0][0],t[0][1])}return e}});var SQ=g(function(GPe,OQ){/*!
1052
- * Module requirements
1053
- */var EQ=Le(),pg=G("util"),_Q=i3();class Ca extends EQ{constructor(){super("");this.errors={}}toString(){return _Q(this)}inspect(){return Object.assign(Error(this.message),this)}addError(e,t){if(t instanceof Ca){let{errors:r}=t;for(let n of Object.keys(r))this.addError(n,r[n]);return}this.errors[e]=t,this.message=_Q(this)}}if(pg.inspect.custom)Ca.prototype[pg.inspect.custom]=Ca.prototype.inspect;Object.defineProperty(Ca.prototype,"toJSON",{enumerable:!1,writable:!1,configurable:!0,value:function(){return Object.assign({},this,{name:this.name,message:this.message})}});Object.defineProperty(Ca.prototype,"name",{value:"SetOptionError"});class AQ extends EQ{constructor(e){super(`"${e}" is not a valid option to set`)}}Ca.SetOptionInnerError=AQ;/*!
1054
- * Module exports
1055
- */OQ.exports=Ca});var wQ=g(function(){var mg=Oe();if(typeof jest<"u"&&!process.env.SUPPRESS_JEST_WARNINGS){if(typeof window<"u")mg.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.");if(typeof setTimeout.clock?.Date==="function")mg.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 BQ=g(function(xQ,PQ){/*!
1056
- * Module dependencies.
1057
- */var qwe=wo(),jwe=G("events").EventEmitter,Q1=Ha(),Ls=ec(),Lwe=Er(),vo=Ef(),Uwe=Oy(),X1=w2(),yg=IK(),Vwe=E1(),zwe=H2(),CQ=UO(),Wwe=v4(),Hwe=s4(),mS=C2(),Kwe=gQ(),$o=Oe(),bQ=oO(),Gwe=nc(),Ywe=vO(),Jwe=n1().trusted,Qwe=DO(),Xwe=vn(),Zwe=Co(),lu=Le(),cu=SQ(),eCe=jO(),DQ=Symbol.for("mongoose:default"),TQ=Symbol("mongoose:defaultConnection");wQ();var tCe=/^[0-9A-Fa-f]{24}$/,{AsyncLocalStorage:MQ}=G("async_hooks");function re(e){if(this.connections=[],this.nextConnectionId=0,this.models={},this.events=new jwe,this.__driver=mS.get(),this.options=Object.assign({pluralization:!0,autoIndex:!0,autoCreate:!0,autoSearchIndex:!1},e),($o.getOption("createInitialConnection",this.options)??!0)&&this.__driver!=null)yS(this);if(this.options.pluralization)this._pluralize=Kwe;if(!e?.[DQ]){let r=this;this.Schema=function(){return this.base=r,Ls.apply(this,arguments)},this.Schema.prototype=Object.create(Ls.prototype),Object.assign(this.Schema,Ls),this.Schema.base=this,this.Schema.Types=Object.assign({},Ls.Types)}else for(let r of["Schema","model"])this[r]=re.prototype[r];if(this.Schema.prototype.base=this,e?.transactionAsyncLocalStorage)this.transactionAsyncLocalStorage=new MQ;Object.defineProperty(this,"plugins",{configurable:!1,enumerable:!0,writable:!1,value:Object.values(Hwe).map((r)=>[r,{deduplicate:!0}])})}re.prototype.cast=Gwe;re.prototype.STATES=X1;re.prototype.ConnectionStates=X1;re.prototype.driver=mS;re.prototype.setDriver=function(t){let r=this instanceof re?this:Wn;if(r.__driver===t)return r;if(r.connections&&r.connections.find((o)=>o.readyState!==X1.disconnected))throw new lu("Cannot modify Mongoose driver if a connection is already open. Call `mongoose.disconnect()` before modifying the driver");if(r.__driver=t,Array.isArray(t.plugins)){for(let o of t.plugins)if(typeof o==="function")r.plugin(o)}if(t.SchemaTypes!=null)Object.assign(Wn.Schema.Types,t.SchemaTypes);let s=t.Connection,i=r.connections[0];if(r.connections=[new s(r)],r.connections[0].models=r.models,i==null)return r;for(let o of Object.values(r.models)){if(o.db!==i)continue;o.$__updateConnection(r.connections[0])}return r};re.prototype.set=function(t,r){let n=this instanceof re?this:Wn;if(t==null){let o=new cu;throw o.addError(String(t),new cu.SetOptionInnerError(String(t))),o}if(arguments.length===1&&typeof t!=="object"){if(yg.indexOf(t)===-1){let o=new cu;throw o.addError(t,new cu.SetOptionInnerError(t)),o}return n.options[t]}let s={};if(arguments.length===2)s={[t]:r};if(arguments.length===1&&typeof t==="object")s=t;let i=void 0;for(let[o,u]of Object.entries(s)){if(yg.indexOf(o)===-1){if(!i)i=new cu;i.addError(o,new cu.SetOptionInnerError(o));continue}if(n.options[o]=u,o==="objectIdGetter")if(u)Object.defineProperty(n.Types.ObjectId.prototype,"_id",{enumerable:!1,configurable:!0,get:function(){return this}});else delete n.Types.ObjectId.prototype._id;else if(o==="transactionAsyncLocalStorage"){if(u&&!n.transactionAsyncLocalStorage)n.transactionAsyncLocalStorage=new MQ;else if(!u&&n.transactionAsyncLocalStorage)delete n.transactionAsyncLocalStorage}else if(o==="createInitialConnection"){if(u&&!n.connection)yS(n);else if(u===!1&&n.connection?.[TQ]){if(n.connection.readyState===X1.disconnected&&$o.hasOwnKeys(n.connection.models)===!1)n.connections.shift()}}else if(o==="returnOriginal"){if(n.options.returnDocument!=null)throw new lu("Cannot set `returnOriginal` when `returnDocument` is already set. Use `returnDocument` instead.");$o.warn("Mongoose: the `returnOriginal` option for `mongoose.set()` is deprecated. Use `mongoose.set('returnDocument', "+(u===!0?"'before'":"'after'")+")` instead.")}else if(o==="returnDocument"){if(n.options.returnOriginal!=null)throw new lu("Cannot set `returnDocument` when `returnOriginal` is already set. Use `returnDocument` instead of `returnOriginal`.")}}if(i)throw i;return n};re.prototype.get=re.prototype.set;re.prototype.createConnection=function(t,r){let n=this instanceof re?this:Wn,i=new n.__driver.Connection(n);if(n.connections.push(i),n.nextConnectionId++,n.events.emit("createConnection",i),arguments.length>0)i.openUri(t,{...r,_fireAndForget:!0});return i};re.prototype.connect=async function(t,r){if(typeof r==="function"||arguments.length>=3&&typeof arguments[2]==="function")throw new lu("Mongoose.prototype.connect() no longer accepts a callback");let n=this instanceof re?this:Wn;if(n.connection==null)yS(n);return n.connection.openUri(t,r).then(()=>n)};re.prototype.disconnect=async function(){if(arguments.length>=1&&typeof arguments[0]==="function")throw new lu("Mongoose.prototype.disconnect() no longer accepts a callback");let t=this instanceof re?this:Wn;if(t.connections.length<=0)return;await Promise.all(t.connections.map((n)=>n.close()))};re.prototype.startSession=function(){let t=this instanceof re?this:Wn;return t.connection.startSession.apply(t.connection,arguments)};re.prototype.pluralize=function(t){let r=this instanceof re?this:Wn;if(arguments.length>0)r._pluralize=t;return r._pluralize};re.prototype.model=function(t,r,n,s){let i=this instanceof re?this:Wn;if(typeof r==="string")n=r,r=!1;if(arguments.length===1){let c=Zwe(i.models,t);if(!c)throw new i.Error.MissingSchemaError(t);return c}if($o.isObject(r)&&!(r instanceof Ls))r=new Ls(r);if(r&&!(r instanceof Ls))throw new i.Error("The 2nd parameter to `mongoose.model()` should be a schema or a POJO");s=s||{};let o=r;if(r){if(i.get("cloneSchemas"))r=r.clone();i._applyPlugins(r)}let u=Object.hasOwn(i.options,"overwriteModels")?i.options.overwriteModels:s.overwriteModels;if(Object.hasOwn(i.models,t)&&s.cache!==!1&&u!==!0){if(o?.instanceOfSchema&&o!==i.models[t].schema)throw new i.Error.OverwriteModelError(t);if(n&&n!==i.models[t].collection.name){let c=i.models[t];return r=c.prototype.schema,c.__subclass(i.connection,r,n)}return i.models[t]}if(r==null)throw new i.Error.MissingSchemaError(t);let a=i._model(t,r,n,s);return i.connection.models[t]=a,i.models[t]=a,a};/*!
1058
- * ignore
1059
- */re.prototype._model=function(t,r,n,s){let i=this instanceof re?this:Wn,o;if(typeof t==="function"){if(o=t,t=o.name,!(o.prototype instanceof CQ))throw new i.Error("The provided class "+t+" must extend Model")}if(t==="__proto__")throw new i.Error('Model name "__proto__" is not allowed');if(r){if(i.get("cloneSchemas"))r=r.clone();i._applyPlugins(r)}if(r==null||!("pluralization"in r.options))r.options.pluralization=i.options.pluralization;if(!n)n=r.get("collection")||$o.toCollectionName(t,i.pluralize());eCe(r);let u=s.connection||i.connection;if(o=i.Model.compile(o||t,r,n,u,i),o.init().catch(function(){}),u.emit("model",o),r._applyDiscriminators!=null)for(let a of r._applyDiscriminators.keys()){let{schema:c,options:l}=r._applyDiscriminators.get(a);o.discriminator(a,c,l)}return o};re.prototype.deleteModel=function(t){let r=this instanceof re?this:Wn;return r.connection.deleteModel(t),delete r.models[t],r};re.prototype.modelNames=function(){let t=this instanceof re?this:Wn;return Object.keys(t.models)};re.prototype._applyPlugins=function(t,r){let n=this instanceof re?this:Wn;r=r||{},r.applyPluginsToDiscriminators=n.options?.applyPluginsToDiscriminators||!1,r.applyPluginsToChildSchemas=typeof n.options?.applyPluginsToChildSchemas==="boolean"?n.options.applyPluginsToChildSchemas:!0,Wwe(t,n.plugins,r,"$globalPluginsApplied")};re.prototype.plugin=function(t,r){let n=this instanceof re?this:Wn;return n.plugins.push([t,r]),n};re.prototype.__defineGetter__("connection",function(){return this.connections[0]});re.prototype.__defineSetter__("connection",function(e){if(e instanceof this.__driver.Connection)this.connections[0]=e,this.models=e.models});re.prototype.connections;re.prototype.nextConnectionId;re.prototype.Aggregate=Ywe;re.prototype.BaseCollection=__();Object.defineProperty(re.prototype,"Collection",{get:function(){return this.__driver.Collection},set:function(e){this.__driver.Collection=e}});Object.defineProperty(re.prototype,"Connection",{get:function(){return this.__driver.Connection},set:function(e){if(e===this.__driver.Connection)return;this.__driver.Connection=e}});re.prototype.BaseConnection=iO();re.prototype.version=bQ.version;re.prototype.Mongoose=re;re.prototype.Schema=Ls;re.prototype.SchemaType=Lwe;re.prototype.SchemaTypes=Ls.Types;re.prototype.VirtualType=Uwe;re.prototype.Types=Vwe;re.prototype.Query=zwe;re.prototype.Model=CQ;re.prototype.Document=qwe;re.prototype.ObjectId=vo.ObjectId;re.prototype.isValidObjectId=function(t){return(this instanceof re?this:Wn).Types.ObjectId.isValid(t)};re.prototype.isObjectIdOrHexString=function(t){return Xwe(t,"ObjectId")||typeof t==="string"&&tCe.test(t)};re.prototype.syncIndexes=function(t){return(this instanceof re?this:Wn).connection.syncIndexes(t)};re.prototype.Decimal128=vo.Decimal128;re.prototype.Mixed=vo.Mixed;re.prototype.Date=vo.Date;re.prototype.Number=vo.Number;re.prototype.Error=lu;re.prototype.MongooseError=lu;re.prototype.now=function(){return new Date};re.prototype.CastError=lu.CastError;re.prototype.SchemaTypeOptions=As();re.prototype.mongo=null;re.prototype.mquery=bO();re.prototype.sanitizeFilter=Qwe;re.prototype.trusted=Jwe;re.prototype.skipMiddlewareFunction=Q1.skipWrappedFunction;re.prototype.overwriteMiddlewareResult=Q1.overwriteResult;re.prototype.overwriteMiddlewareArguments=Q1.overwriteArguments;re.prototype.omitUndefined=xA();/*!
1060
- * Create a new default connection (`mongoose.connection`) for a Mongoose instance.
1061
- * No-op if there is already a default connection.
1062
- */function yS(e){if(e.connection)return;let t=e.createConnection();t[TQ]=!0,t.models=e.models}var Wn=PQ.exports=xQ=new re({[DQ]:!0})});var IQ=g(function(QPe,NQ){/*!
1063
- * Module dependencies.
1064
- */var FQ=FK();C2().set(FQ);var nd=BQ();nd.setDriver(FQ);nd.Mongoose.prototype.mongo=Iu();NQ.exports=nd});var RQ=g(function(XPe,Be){var K=IQ();Be.exports=K;Be.exports.default=K;Be.exports.mongoose=K;Be.exports.cast=K.cast;Be.exports.STATES=K.STATES;Be.exports.setDriver=K.setDriver;Be.exports.set=K.set;Be.exports.get=K.get;Be.exports.createConnection=K.createConnection;Be.exports.connect=K.connect;Be.exports.disconnect=K.disconnect;Be.exports.startSession=K.startSession;Be.exports.pluralize=K.pluralize;Be.exports.model=K.model;Be.exports.deleteModel=K.deleteModel;Be.exports.modelNames=K.modelNames;Be.exports.plugin=K.plugin;Be.exports.connections=K.connections;Be.exports.version=K.version;Be.exports.Aggregate=K.Aggregate;Be.exports.Mongoose=K.Mongoose;Be.exports.Schema=K.Schema;Be.exports.SchemaType=K.SchemaType;Be.exports.SchemaTypes=K.SchemaTypes;Be.exports.VirtualType=K.VirtualType;Be.exports.Types=K.Types;Be.exports.Query=K.Query;Be.exports.Model=K.Model;Be.exports.Document=K.Document;Be.exports.ObjectId=K.ObjectId;Be.exports.isValidObjectId=K.isValidObjectId;Be.exports.isObjectIdOrHexString=K.isObjectIdOrHexString;Be.exports.syncIndexes=K.syncIndexes;Be.exports.Decimal128=K.Decimal128;Be.exports.Mixed=K.Mixed;Be.exports.Date=K.Date;Be.exports.Number=K.Number;Be.exports.Error=K.Error;Be.exports.MongooseError=K.MongooseError;Be.exports.now=K.now;Be.exports.CastError=K.CastError;Be.exports.SchemaTypeOptions=K.SchemaTypeOptions;Be.exports.mongo=K.mongo;Be.exports.mquery=K.mquery;Be.exports.sanitizeFilter=K.sanitizeFilter;Be.exports.trusted=K.trusted;Be.exports.skipMiddlewareFunction=K.skipMiddlewareFunction;Be.exports.overwriteMiddlewareResult=K.overwriteMiddlewareResult});var Fi=QQ(RQ(),1);class sd extends Error{code;constructor(e,t){super(e);if(this.name=new.target.name,t!==void 0)this.code=t;Object.setPrototypeOf(this,new.target.prototype)}}class gS extends sd{column;value;constructor(e,t){super(`Duplicate unique value: ${e} = ${t}`,"DUPLICATE_ENTRY");this.column=e,this.value=t}}class _S extends sd{column;constructor(e){super(`Missing required field: ${e}`,"VALIDATION_ERROR");this.column=e}}class rCe extends sd{constructor(){super(`File konfigurasi wajib \`noxium.config.ts\` tidak ditemukan.
1
+ import f,{Schema as k}from"mongoose";class p extends Error{code;constructor(n,r){super(n);if(this.name=new.target.name,r!==void 0)this.code=r;Object.setPrototypeOf(this,new.target.prototype)}}class w extends p{column;value;constructor(n,r){super(`Duplicate unique value: ${n} = ${r}`,"DUPLICATE_ENTRY");this.column=n,this.value=r}}class j extends p{column;constructor(n){super(`Missing required field: ${n}`,"VALIDATION_ERROR");this.column=n}}class O extends p{constructor(){super(`File konfigurasi wajib \`noxium.config.ts\` tidak ditemukan.
1065
2
  Silakan buat file tersebut di direktori root proyek Anda (misalnya: \`noxium.config.ts\`).
1066
3
 
1067
4
  // noxium.config.ts
@@ -1075,7 +12,7 @@ export default function getConfig() {
1075
12
  },
1076
13
  };
1077
14
  }
1078
- `,"REQUIRED_CONFIG")}}class nCe extends sd{constructor(e){super(e,"INVALID_CONFIG")}}var gg=(e)=>{if(!e)return"";if(typeof e==="string")return e;if(typeof e==="object"&&e!==null&&"_id"in e)return String(e._id);return String(e)},id=(e,t)=>{if(!e)return e;let r={...e,id:gg(e._id??e.id)};if(t)for(let[n,s]of Object.entries(t)){let i=r[n];if(i&&typeof i==="object"&&!Array.isArray(i)){let o={id:gg(i._id??i.id)};for(let u of s)if(u in i)o[u]=i[u];r[n]=o,r.ownerId=o.id}else if(i)r[n]=gg(i)}else if(r.owner&&typeof r.owner==="object")r.owner=gg(r.owner._id??r.owner.id);return r};function rBe(e,t,r){if(Fi.default.connection.readyState===0)Fi.default.connect(r.mongo.uri,{dbName:r.mongo.dbName??"test"});let n={};for(let[u,a]of Object.entries(t.fields)){let c={};if(a.type==="ref"){if(c.type=Fi.Schema.Types.ObjectId,a.ref)c.ref=a.ref}else if(a.type===Date)c.type=Date;else if(a.type===Number)c.type=Number;else if(a.type===Boolean)c.type=Boolean;else c.type=String;if(a.required)c.required=!0;if(a.unique)c.unique=!0;if(a.default!==void 0)c.default=a.default;if(a.lowercase)c.lowercase=!0;if(a.trim)c.trim=!0;n[u]=c}let s=new Fi.Schema(n,{timestamps:t.timestamps!==!1});if(t.ttl)s.index({[t.ttl.field]:1},{expireAfterSeconds:t.ttl.seconds});let i=Fi.default.models[e]||Fi.default.model(e,s),o=async(u)=>{if(!t.hooks?.afterFind||u.length===0)return;await t.hooks.afterFind(u)};return{async insert(u){try{let a=await i.create(u);return id(a.toObject())}catch(a){if(a?.code===11000){let c=a.keyValue??a.keyPattern??{},l=Object.keys(c)[0]??"unknown";throw new gS(l,c[l])}if(a?.errors){let c=Object.keys(a.errors)[0]??"unknown";throw new _S(c)}throw a}},async update(u,a){if(!a)return null;let c={};if(typeof u==="object"&&u!==null){let f=Object.entries(u).filter(([,h])=>h!==void 0);if(f.length===0)return null;for(let[h,d]of f)if(h==="id")c._id=Fi.default.Types.ObjectId.isValid(String(d))?new Fi.default.Types.ObjectId(String(d)):d;else c[h]=d}else c._id=Fi.default.Types.ObjectId.isValid(String(u))?new Fi.default.Types.ObjectId(String(u)):u;let l=await i.findOneAndUpdate(c,{$set:a},{new:!0}).lean();return l?id(l):null},async findAll(u){let a=i.find({});if(u?.populate)for(let[l,f]of Object.entries(u.populate))a=a.populate(l,f.join(" "));let c=await a.lean();return await o(c),c.map((l)=>id(l,u?.populate))},async findUnique(u,a){let c=i.findOne(u);if(a?.populate)for(let[f,h]of Object.entries(a.populate))c=c.populate(f,h.join(" "));let l=await c.lean();if(!l)return null;return await o([l]),id(l,a?.populate)},async findMany(u={},a){let c=i.find(u);if(a?.populate)for(let[f,h]of Object.entries(a.populate))c=c.populate(f,h.join(" "));let l=await c.lean();return await o(l),l.map((f)=>id(f,a?.populate))},async deleteMany(u){let a=await i.deleteMany(u);return Number(a.deletedCount??0)}}}export{rBe as createMongoModelClient};
15
+ `,"REQUIRED_CONFIG")}}class h extends p{constructor(n){super(n,"INVALID_CONFIG")}}var b=(n)=>{if(!n)return"";if(typeof n==="string")return n;if(typeof n==="object"&&n!==null&&"_id"in n)return String(n._id);return String(n)},y=(n,r)=>{if(!n)return n;let a={...n,id:b(n._id??n.id)};if(r)for(let[d,g]of Object.entries(r)){let o=a[d];if(o&&typeof o==="object"&&!Array.isArray(o)){let u={id:b(o._id??o.id)};for(let i of g)if(i in o)u[i]=o[i];a[d]=u,a.ownerId=u.id}else if(o)a[d]=b(o)}else if(a.owner&&typeof a.owner==="object")a.owner=b(a.owner._id??a.owner.id);return a};function S(n,r,a){if(f.connection.readyState===0)f.connect(a.mongo.uri,{dbName:a.mongo.dbName??"test"});let d={};for(let[i,e]of Object.entries(r.fields)){let t={};if(e.type==="ref"){if(t.type=k.Types.ObjectId,e.ref)t.ref=e.ref}else if(e.type===Date)t.type=Date;else if(e.type===Number)t.type=Number;else if(e.type===Boolean)t.type=Boolean;else t.type=String;if(e.required)t.required=!0;if(e.unique)t.unique=!0;if(e.default!==void 0)t.default=e.default;if(e.lowercase)t.lowercase=!0;if(e.trim)t.trim=!0;d[i]=t}let g=new k(d,{timestamps:r.timestamps!==!1});if(r.ttl)g.index({[r.ttl.field]:1},{expireAfterSeconds:r.ttl.seconds});let o=f.models[n]||f.model(n,g),u=async(i)=>{if(!r.hooks?.afterFind||i.length===0)return;await r.hooks.afterFind(i)};return{async insert(i){try{let e=await o.create(i);return y(e.toObject())}catch(e){if(e?.code===11000){let t=e.keyValue??e.keyPattern??{},s=Object.keys(t)[0]??"unknown";throw new w(s,t[s])}if(e?.errors){let t=Object.keys(e.errors)[0]??"unknown";throw new j(t)}throw e}},async update(i,e){if(!e)return null;let t={};if(typeof i==="object"&&i!==null){let l=Object.entries(i).filter(([,c])=>c!==void 0);if(l.length===0)return null;for(let[c,m]of l)if(c==="id")t._id=f.Types.ObjectId.isValid(String(m))?new f.Types.ObjectId(String(m)):m;else t[c]=m}else t._id=f.Types.ObjectId.isValid(String(i))?new f.Types.ObjectId(String(i)):i;let s=await o.findOneAndUpdate(t,{$set:e},{new:!0}).lean();return s?y(s):null},async findAll(i){let e=o.find({});if(i?.populate)for(let[s,l]of Object.entries(i.populate))e=e.populate(s,l.join(" "));let t=await e.lean();return await u(t),t.map((s)=>y(s,i?.populate))},async findUnique(i,e){let t=o.findOne(i);if(e?.populate)for(let[l,c]of Object.entries(e.populate))t=t.populate(l,c.join(" "));let s=await t.lean();if(!s)return null;return await u([s]),y(s,e?.populate)},async findMany(i={},e){let t=o.find(i);if(e?.populate)for(let[l,c]of Object.entries(e.populate))t=t.populate(l,c.join(" "));let s=await t.lean();return await u(s),s.map((l)=>y(l,e?.populate))},async deleteMany(i){let e=await o.deleteMany(i);return Number(e.deletedCount??0)}}}export{S as createMongoModelClient};
1079
16
 
1080
- //# debugId=853F10519AB0CFAD64756E2164756E21
17
+ //# debugId=F020E3048AD9D86B64756E2164756E21
1081
18
  //# sourceMappingURL=mongo.mjs.map