odm-client 0.0.1

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.
@@ -0,0 +1,12 @@
1
+ "use strict";var Ql=Object.defineProperty;var Zl=(e,t,r)=>t in e?Ql(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var se=(e,t,r)=>Zl(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ht=require("./deps/query-builder-h6B2D2BCoQ-wqso6i87o.js"),gn=require("timers"),Mc=require("crypto"),D1=require("fs"),$l=require("http"),Ar=require("process"),ao=require("stream"),e2=require("events"),t2=require("util"),Fc=require("timers/promises"),T1=require("dns"),Rc=require("os"),r2=require("url"),Nc=require("zlib"),B1=require("net"),Ic=require("fs/promises"),vc=require("tls"),n2=require("child_process");var jt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pr(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var is={},ei={},pe={},Oe={};const i2=(()=>{const e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype),Symbol.toStringTag).get;return t=>e.call(t)})();function hr(e){return i2(e)==="Uint8Array"}function b1(e){return typeof e=="object"&&e!=null&&Symbol.toStringTag in e&&(e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer")}function un(e){return e instanceof RegExp||Object.prototype.toString.call(e)==="[object RegExp]"}function M1(e){return typeof e=="object"&&e!=null&&Symbol.toStringTag in e&&e[Symbol.toStringTag]==="Map"}function an(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function Et(e,t){return JSON.stringify(e,(r,n)=>typeof n=="bigint"?{$numberLong:`${n}`}:M1(n)?Object.fromEntries(n):n)}function o2(e){if(e!=null&&typeof e=="object"&&"stylize"in e&&typeof e.stylize=="function")return e.stylize}const Rr=7,dn=Symbol.for("@@mdb.bson.version"),ti=2147483647,ri=-2147483648,Pc=Math.pow(2,63)-1,Lc=-Math.pow(2,63),kc=Math.pow(2,53),Uc=-Math.pow(2,53),F1=1,jc=2,R1=3,xc=4,N1=5,s2=6,zc=7,Vc=8,Wc=9,I1=10,Yi=11,u2=12,v1=13,Gc=14,qc=15,Hn=16,Hc=17,P1=18,Kc=19,Yc=255,Xc=127,a2=0,L1=4,Jc=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 q extends Error{get bsonError(){return!0}get name(){return"BSONError"}constructor(t,r){super(t,r)}static isBSONError(t){return t!=null&&typeof t=="object"&&"bsonError"in t&&t.bsonError===!0&&"name"in t&&"message"in t&&"stack"in t}}class Nr extends q{get name(){return"BSONVersionError"}constructor(){super(`Unsupported BSON version, bson types must be from bson ${Rr}.x.x`)}}class Xi extends q{get name(){return"BSONRuntimeError"}constructor(t){super(t)}}class xt extends q{constructor(r,n,i){super(`${r}. offset: ${n}`,i);se(this,"offset");this.offset=n}get name(){return"BSONOffsetError"}}let Ru,Nu;function Qc(e,t,r,n){if(n){Ru??(Ru=new TextDecoder("utf8",{fatal:!0}));try{return Ru.decode(e.subarray(t,r))}catch(i){throw new q("Invalid UTF-8 string in BSON document",{cause:i})}}return Nu??(Nu=new TextDecoder("utf8",{fatal:!1})),Nu.decode(e.subarray(t,r))}function Zc(e,t,r){if(e.length===0)return"";const 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]);const i=[];for(let o=t;o<r;o++){const u=e[o];if(u>127)return null;i.push(u)}return String.fromCharCode(...i)}function c2(e,t,r){if(t.length===0)return 0;if(t.length>25||e.length-r<t.length)return null;for(let n=0,i=r;n<t.length;n++,i++){const o=t.charCodeAt(n);if(o>127)return null;e[i]=o}return t.length}function l2(e){return yt.fromNumberArray(Array.from({length:e},()=>Math.floor(Math.random()*256)))}function h2(e){return crypto.getRandomValues(yt.allocate(e))}const d2=(()=>{const{crypto:e}=globalThis;return e!=null&&typeof e.getRandomValues=="function"?h2:l2})(),yt={isUint8Array:hr,toLocalBufferType(e){if(Buffer.isBuffer(e))return e;if(ArrayBuffer.isView(e))return Buffer.from(e.buffer,e.byteOffset,e.byteLength);const t=(e==null?void 0: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 q("Cannot create Buffer from the passed potentialBuffer.")},allocate(e){return Buffer.alloc(e)},allocateUnsafe(e){return Buffer.allocUnsafe(e)},compare(e,t){return yt.toLocalBufferType(e).compare(t)},concat(e){return Buffer.concat(e)},copy(e,t,r,n,i){return yt.toLocalBufferType(e).copy(t,r??0,n??0,i??e.length)},equals(e,t){return yt.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 yt.toLocalBufferType(e).toString("base64")},fromISO88591(e){return Buffer.from(e,"binary")},toISO88591(e){return yt.toLocalBufferType(e).toString("binary")},fromHex(e){return Buffer.from(e,"hex")},toHex(e){return yt.toLocalBufferType(e).toString("hex")},toUTF8(e,t,r,n){const i=r-t<=20?Zc(e,t,r):null;if(i!=null)return i;const o=yt.toLocalBufferType(e).toString("utf8",t,r);if(n){for(let u=0;u<o.length;u++)if(o.charCodeAt(u)===65533){Qc(e,t,r,!0);break}}return o},utf8ByteLength(e){return Buffer.byteLength(e,"utf8")},encodeUTF8Into(e,t,r){const n=c2(e,t,r);return n??yt.toLocalBufferType(e).write(t,r,void 0,"utf8")},randomBytes:d2,swap32(e){return yt.toLocalBufferType(e).swap32()}};function f2(){const{navigator:e}=globalThis;return typeof e=="object"&&e.product==="ReactNative"}function m2(e){if(e<0)throw new RangeError(`The argument 'byteLength' is invalid. Received ${e}`);return Mr.fromNumberArray(Array.from({length:e},()=>Math.floor(Math.random()*256)))}const E2=(()=>{var t;const{crypto:e}=globalThis;if(e!=null&&typeof e.getRandomValues=="function")return r=>e.getRandomValues(Mr.allocate(r));if(f2()){const{console:r}=globalThis;(t=r==null?void 0:r.warn)==null||t.call(r,"BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.")}return m2})(),Iu=/(\d|[a-f])/i,Mr={isUint8Array:hr,toLocalBufferType(e){const t=(e==null?void 0: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 q("Cannot make a Uint8Array from passed potentialBuffer.")},allocate(e){if(typeof e!="number")throw new TypeError(`The "size" argument must be of type number. Received ${String(e)}`);return new Uint8Array(e)},allocateUnsafe(e){return Mr.allocate(e)},compare(e,t){if(e===t)return 0;const 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}return e.length<t.length?-1:e.length>t.length?1:0},concat(e){if(e.length===0)return Mr.allocate(0);let t=0;for(const i of e)t+=i.length;const r=Mr.allocate(t);let n=0;for(const i of e)r.set(i,n),n+=i.length;return r},copy(e,t,r,n,i){if(i!==void 0&&i<0)throw new RangeError(`The value of "sourceEnd" is out of range. It must be >= 0. Received ${i}`);if(i=i??e.length,n!==void 0&&(n<0||n>i))throw new RangeError(`The value of "sourceStart" is out of range. It must be >= 0 and <= ${i}. Received ${n}`);if(n=n??0,r!==void 0&&r<0)throw new RangeError(`The value of "targetStart" is out of range. It must be >= 0. Received ${r}`);r=r??0;const o=e.subarray(n,i),u=Math.min(o.length,t.length-r);return u<=0?0:(t.set(o.subarray(0,u),r),u)},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(Mr.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){const t=e.length%2===0?e:e.slice(0,e.length-1),r=[];for(let n=0;n<t.length;n+=2){const i=t[n],o=t[n+1];if(!Iu.test(i)||!Iu.test(o))break;const u=Number.parseInt(`${i}${o}`,16);r.push(u)}return Uint8Array.from(r)},toHex(e){return Array.from(e,t=>t.toString(16).padStart(2,"0")).join("")},toUTF8(e,t,r,n){const i=r-t<=20?Zc(e,t,r):null;return i??Qc(e,t,r,n)},utf8ByteLength(e){return new TextEncoder().encode(e).byteLength},encodeUTF8Into(e,t,r){const n=new TextEncoder().encode(t);return e.set(n,r),n.byteLength},randomBytes:E2,swap32(e){if(e.length%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e.length;t+=4){const r=e[t],n=e[t+1],i=e[t+2],o=e[t+3];e[t]=o,e[t+1]=i,e[t+2]=n,e[t+3]=r}return e}};var bc;const g2=typeof Buffer=="function"&&((bc=Buffer.prototype)==null?void 0:bc._isBuffer)!==!0,W=g2?yt:Mr,co=Symbol.for("@@mdb.bson.type");class at{get[co](){return this._bsontype}get[dn](){return Rr}[Symbol.for("nodejs.util.inspect.custom")](t,r,n){return this.inspect(t,r,n)}}const cn=new Float64Array(1),we=new Uint8Array(cn.buffer,0,8);cn[0]=-1;const os=we[7]===0,ue={isBigEndian:os,getNonnegativeInt32LE(e,t){if(e[t+3]>127)throw new 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){const 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:os?(e,t)=>(we[7]=e[t],we[6]=e[t+1],we[5]=e[t+2],we[4]=e[t+3],we[3]=e[t+4],we[2]=e[t+5],we[1]=e[t+6],we[0]=e[t+7],cn[0]):(e,t)=>(we[0]=e[t],we[1]=e[t+1],we[2]=e[t+2],we[3]=e[t+3],we[4]=e[t+4],we[5]=e[t+5],we[6]=e[t+6],we[7]=e[t+7],cn[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){const n=0xffffffffn;let i=Number(r&n);e[t]=i,i>>=8,e[t+1]=i,i>>=8,e[t+2]=i,i>>=8,e[t+3]=i;let o=Number(r>>32n&n);return e[t+4]=o,o>>=8,e[t+5]=o,o>>=8,e[t+6]=o,o>>=8,e[t+7]=o,8},setFloat64LE:os?(e,t,r)=>(cn[0]=r,e[t]=we[7],e[t+1]=we[6],e[t+2]=we[5],e[t+3]=we[4],e[t+4]=we[3],e[t+5]=we[2],e[t+6]=we[1],e[t+7]=we[0],8):(e,t,r)=>(cn[0]=r,e[t]=we[0],e[t+1]=we[1],e[t+2]=we[2],e[t+3]=we[3],e[t+4]=we[4],e[t+5]=we[5],e[t+6]=we[6],e[t+7]=we[7],8)},ge=class ge extends at{constructor(r,n){super();se(this,"buffer");se(this,"sub_type");se(this,"position");if(r!=null&&typeof r=="string"&&!ArrayBuffer.isView(r)&&!b1(r)&&!Array.isArray(r))throw new q("Binary can only be constructed from Uint8Array or number[]");this.sub_type=n??ge.BSON_BINARY_SUBTYPE_DEFAULT,r==null?(this.buffer=W.allocate(ge.BUFFER_SIZE),this.position=0):(this.buffer=Array.isArray(r)?W.fromNumberArray(r):W.toLocalBufferType(r),this.position=this.buffer.byteLength)}get _bsontype(){return"Binary"}put(r){if(typeof r=="string"&&r.length!==1)throw new q("only accepts single character String");if(typeof r!="number"&&r.length!==1)throw new q("only accepts single character Uint8Array or Array");let n;if(typeof r=="string"?n=r.charCodeAt(0):typeof r=="number"?n=r:n=r[0],n<0||n>255)throw new q("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.byteLength>this.position)this.buffer[this.position++]=n;else{const i=W.allocate(ge.BUFFER_SIZE+this.buffer.length);i.set(this.buffer,0),this.buffer=i,this.buffer[this.position++]=n}}write(r,n){if(n=typeof n=="number"?n:this.position,this.buffer.byteLength<n+r.length){const i=W.allocate(this.buffer.byteLength+r.length);i.set(this.buffer,0),this.buffer=i}if(ArrayBuffer.isView(r))this.buffer.set(W.toLocalBufferType(r),n),this.position=n+r.byteLength>this.position?n+r.length:this.position;else if(typeof r=="string")throw new q("input cannot be string")}read(r,n){n=n&&n>0?n:this.position;const i=r+n;return this.buffer.subarray(r,i>this.position?this.position:i)}value(){return this.buffer.length===this.position?this.buffer:this.buffer.subarray(0,this.position)}length(){return this.position}toJSON(){return W.toBase64(this.buffer.subarray(0,this.position))}toString(r){return r==="hex"?W.toHex(this.buffer.subarray(0,this.position)):r==="base64"?W.toBase64(this.buffer.subarray(0,this.position)):r==="utf8"||r==="utf-8"?W.toUTF8(this.buffer,0,this.position,!1):W.toUTF8(this.buffer,0,this.position,!1)}toExtendedJSON(r){r=r||{},this.sub_type===ge.SUBTYPE_VECTOR&&Yt(this);const n=W.toBase64(this.buffer),i=Number(this.sub_type).toString(16);return r.legacy?{$binary:n,$type:i.length===1?"0"+i:i}:{$binary:{base64:n,subType:i.length===1?"0"+i:i}}}toUUID(){if(this.sub_type===ge.SUBTYPE_UUID)return new Xe(this.buffer.subarray(0,this.position));throw new q(`Binary sub_type "${this.sub_type}" is not supported for converting to UUID. Only "${ge.SUBTYPE_UUID}" is currently supported.`)}static createFromHexString(r,n){return new ge(W.fromHex(r),n)}static createFromBase64(r,n){return new ge(W.fromBase64(r),n)}static fromExtendedJSON(r,n){n=n||{};let i,o;if("$binary"in r?n.legacy&&typeof r.$binary=="string"&&"$type"in r?(o=r.$type?parseInt(r.$type,16):0,i=W.fromBase64(r.$binary)):typeof r.$binary!="string"&&(o=r.$binary.subType?parseInt(r.$binary.subType,16):0,i=W.fromBase64(r.$binary.base64)):"$uuid"in r&&(o=4,i=Xe.bytesFromString(r.$uuid)),!i)throw new q(`Unexpected Binary Extended JSON format ${JSON.stringify(r)}`);return o===L1?new Xe(i):new ge(i,o)}inspect(r,n,i){i??(i=Et);const o=W.toBase64(this.buffer.subarray(0,this.position)),u=i(o,n),h=i(this.sub_type,n);return`Binary.createFromBase64(${u}, ${h})`}toInt8Array(){if(this.sub_type!==ge.SUBTYPE_VECTOR)throw new q("Binary sub_type is not Vector");if(this.buffer[0]!==ge.VECTOR_TYPE.Int8)throw new q("Binary datatype field is not Int8");return Yt(this),new Int8Array(this.buffer.buffer.slice(this.buffer.byteOffset+2,this.buffer.byteOffset+this.position))}toFloat32Array(){if(this.sub_type!==ge.SUBTYPE_VECTOR)throw new q("Binary sub_type is not Vector");if(this.buffer[0]!==ge.VECTOR_TYPE.Float32)throw new q("Binary datatype field is not Float32");Yt(this);const r=new Uint8Array(this.buffer.buffer.slice(this.buffer.byteOffset+2,this.buffer.byteOffset+this.position));return ue.isBigEndian&&W.swap32(r),new Float32Array(r.buffer)}toPackedBits(){if(this.sub_type!==ge.SUBTYPE_VECTOR)throw new q("Binary sub_type is not Vector");if(this.buffer[0]!==ge.VECTOR_TYPE.PackedBit)throw new q("Binary datatype field is not packed bit");return Yt(this),new Uint8Array(this.buffer.buffer.slice(this.buffer.byteOffset+2,this.buffer.byteOffset+this.position))}toBits(){if(this.sub_type!==ge.SUBTYPE_VECTOR)throw new q("Binary sub_type is not Vector");if(this.buffer[0]!==ge.VECTOR_TYPE.PackedBit)throw new q("Binary datatype field is not packed bit");Yt(this);const n=(this.length()-2)*8-this.buffer[1],i=new Int8Array(n);for(let o=0;o<i.length;o++){const u=o/8|0,h=this.buffer[u+2],s=7-o%8,a=h>>s&1;i[o]=a}return i}static fromInt8Array(r){const n=W.allocate(r.byteLength+2);n[0]=ge.VECTOR_TYPE.Int8,n[1]=0;const i=new Uint8Array(r.buffer,r.byteOffset,r.byteLength);n.set(i,2);const o=new this(n,this.SUBTYPE_VECTOR);return Yt(o),o}static fromFloat32Array(r){const n=W.allocate(r.byteLength+2);n[0]=ge.VECTOR_TYPE.Float32,n[1]=0;const i=new Uint8Array(r.buffer,r.byteOffset,r.byteLength);n.set(i,2),ue.isBigEndian&&W.swap32(new Uint8Array(n.buffer,2));const o=new this(n,this.SUBTYPE_VECTOR);return Yt(o),o}static fromPackedBits(r,n=0){const i=W.allocate(r.byteLength+2);i[0]=ge.VECTOR_TYPE.PackedBit,i[1]=n,i.set(r,2);const o=new this(i,this.SUBTYPE_VECTOR);return Yt(o),o}static fromBits(r){const n=r.length+7>>>3,i=new Uint8Array(n+2);i[0]=ge.VECTOR_TYPE.PackedBit;const o=r.length%8;i[1]=o===0?0:8-o;for(let u=0;u<r.length;u++){const h=u>>>3,s=r[u];if(s!==0&&s!==1)throw new q(`Invalid bit value at ${u}: must be 0 or 1, found ${r[u]}`);if(s===0)continue;const a=7-u%8;i[h+2]|=s<<a}return new this(i,ge.SUBTYPE_VECTOR)}};se(ge,"BSON_BINARY_SUBTYPE_DEFAULT",0),se(ge,"BUFFER_SIZE",256),se(ge,"SUBTYPE_DEFAULT",0),se(ge,"SUBTYPE_FUNCTION",1),se(ge,"SUBTYPE_BYTE_ARRAY",2),se(ge,"SUBTYPE_UUID_OLD",3),se(ge,"SUBTYPE_UUID",4),se(ge,"SUBTYPE_MD5",5),se(ge,"SUBTYPE_ENCRYPTED",6),se(ge,"SUBTYPE_COLUMN",7),se(ge,"SUBTYPE_SENSITIVE",8),se(ge,"SUBTYPE_VECTOR",9),se(ge,"SUBTYPE_USER_DEFINED",128),se(ge,"VECTOR_TYPE",Object.freeze({Int8:3,Float32:39,PackedBit:16}));let je=ge;function Yt(e){if(e.sub_type!==je.SUBTYPE_VECTOR)return;const t=e.position,r=e.buffer[0],n=e.buffer[1];if((r===je.VECTOR_TYPE.Float32||r===je.VECTOR_TYPE.Int8)&&n!==0)throw new q("Invalid Vector: padding must be zero for int8 and float32 vectors");if(r===je.VECTOR_TYPE.Float32&&t!==0&&t-2!==0&&(t-2)%4!==0)throw new q("Invalid Vector: Float32 vector must contain a multiple of 4 bytes");if(r===je.VECTOR_TYPE.PackedBit&&n!==0&&t===2)throw new q("Invalid Vector: padding must be zero for packed bit vectors that are empty");if(r===je.VECTOR_TYPE.PackedBit&&n>7)throw new q(`Invalid Vector: padding must be a value between 0 and 7. found: ${n}`)}const ss=16,A2=/^[0-9A-F]{32}$/i,p2=/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i;class Xe extends je{constructor(t){let r;if(t==null)r=Xe.generate();else if(t instanceof Xe)r=W.toLocalBufferType(new Uint8Array(t.buffer));else if(ArrayBuffer.isView(t)&&t.byteLength===ss)r=W.toLocalBufferType(t);else if(typeof t=="string")r=Xe.bytesFromString(t);else throw new q("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(r,L1)}get id(){return this.buffer}set id(t){this.buffer=t}toHexString(t=!0){return t?[W.toHex(this.buffer.subarray(0,4)),W.toHex(this.buffer.subarray(4,6)),W.toHex(this.buffer.subarray(6,8)),W.toHex(this.buffer.subarray(8,10)),W.toHex(this.buffer.subarray(10,16))].join("-"):W.toHex(this.buffer)}toString(t){return t==="hex"?W.toHex(this.id):t==="base64"?W.toBase64(this.id):this.toHexString()}toJSON(){return this.toHexString()}equals(t){if(!t)return!1;if(t instanceof Xe)return W.equals(t.id,this.id);try{return W.equals(new Xe(t).id,this.id)}catch{return!1}}toBinary(){return new je(this.id,je.SUBTYPE_UUID)}static generate(){const t=W.randomBytes(ss);return t[6]=t[6]&15|64,t[8]=t[8]&63|128,t}static isValid(t){return t?typeof t=="string"?Xe.isValidUUIDString(t):hr(t)?t.byteLength===ss:t._bsontype==="Binary"&&t.sub_type===this.SUBTYPE_UUID&&t.buffer.byteLength===16:!1}static createFromHexString(t){const r=Xe.bytesFromString(t);return new Xe(r)}static createFromBase64(t){return new Xe(W.fromBase64(t))}static bytesFromString(t){if(!Xe.isValidUUIDString(t))throw new q("UUID string representation must be 32 hex digits or canonical hyphenated representation");return W.fromHex(t.replace(/-/g,""))}static isValidUUIDString(t){return A2.test(t)||p2.test(t)}inspect(t,r,n){return n??(n=Et),`new UUID(${n(this.toHexString(),r)})`}}class $t extends at{constructor(r,n){super();se(this,"code");se(this,"scope");this.code=r.toString(),this.scope=n??null}get _bsontype(){return"Code"}toJSON(){return this.scope!=null?{code:this.code,scope:this.scope}:{code:this.code}}toExtendedJSON(){return this.scope?{$code:this.code,$scope:this.scope}:{$code:this.code}}static fromExtendedJSON(r){return new $t(r.$code,r.$scope)}inspect(r,n,i){i??(i=Et);let o=i(this.code,n);const u=o.includes(`
2
+ `);this.scope!=null&&(o+=`,${u?`
3
+ `:" "}${i(this.scope,n)}`);const h=u&&this.scope===null;return`new Code(${u?`
4
+ `:""}${o}${h?`
5
+ `:""})`}}function $c(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 Gt extends at{constructor(r,n,i,o){super();se(this,"collection");se(this,"oid");se(this,"db");se(this,"fields");const u=r.split(".");u.length===2&&(i=u.shift(),r=u.shift()),this.collection=r,this.oid=n,this.db=i,this.fields=o||{}}get _bsontype(){return"DBRef"}get namespace(){return this.collection}set namespace(r){this.collection=r}toJSON(){const r=Object.assign({$ref:this.collection,$id:this.oid},this.fields);return this.db!=null&&(r.$db=this.db),r}toExtendedJSON(r){r=r||{};let n={$ref:this.collection,$id:this.oid};return r.legacy||(this.db&&(n.$db=this.db),n=Object.assign(n,this.fields)),n}static fromExtendedJSON(r){const n=Object.assign({},r);return delete n.$ref,delete n.$id,delete n.$db,new Gt(r.$ref,r.$id,r.$db,n)}inspect(r,n,i){i??(i=Et);const o=[i(this.namespace,n),i(this.oid,n),...this.db?[i(this.db,n)]:[],...Object.keys(this.fields).length>0?[i(this.fields,n)]:[]];return o[1]=i===Et?`new ObjectId(${o[1]})`:o[1],`new DBRef(${o.join(", ")})`}}function e0(e){if(e==="")return e;let t=0;const r=e[t]==="-",n=e[t]==="+";(n||r)&&(t+=1);let i=!1;for(;t<e.length&&e[t]==="0";++t)i=!0;return i?`${r?"-":""}${e.length===t?"0":e.slice(t)}`:n?e.slice(1):e}function C2(e,t){t=t??10;const r="0123456789abcdefghijklmnopqrstuvwxyz".slice(0,t);return new RegExp(`[^-+${r}]`,"i").test(e)?!1:e}let Ct;try{Ct=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{}const vu=65536,S2=1<<24,ln=vu*vu,t0=ln*ln,Pu=t0/2,Lu={},ku={},y2=20,O2=/^(\+?0|(\+|-)?[1-9][0-9]*)$/,G=class G extends at{constructor(r=0,n,i){super();se(this,"high");se(this,"low");se(this,"unsigned");const o=typeof n=="boolean"?n:!!i,u=typeof n=="number"?n:0,h=typeof r=="string"?G.fromString(r,o):typeof r=="bigint"?G.fromBigInt(r,o):{low:r|0,high:u|0,unsigned:o};this.low=h.low,this.high=h.high,this.unsigned=h.unsigned}get _bsontype(){return"Long"}get __isLong__(){return!0}static fromBits(r,n,i){return new G(r,n,i)}static fromInt(r,n){let i,o,u;return n?(r>>>=0,(u=0<=r&&r<256)&&(o=ku[r],o)?o:(i=G.fromBits(r,(r|0)<0?-1:0,!0),u&&(ku[r]=i),i)):(r|=0,(u=-128<=r&&r<128)&&(o=Lu[r],o)?o:(i=G.fromBits(r,r<0?-1:0,!1),u&&(Lu[r]=i),i))}static fromNumber(r,n){if(isNaN(r))return n?G.UZERO:G.ZERO;if(n){if(r<0)return G.UZERO;if(r>=t0)return G.MAX_UNSIGNED_VALUE}else{if(r<=-Pu)return G.MIN_VALUE;if(r+1>=Pu)return G.MAX_VALUE}return r<0?G.fromNumber(-r,n).neg():G.fromBits(r%ln|0,r/ln|0,n)}static fromBigInt(r,n){const i=0xffffffffn,o=32n;return new G(Number(r&i),Number(r>>o&i),n)}static _fromString(r,n,i){if(r.length===0)throw new q("empty string");if(i<2||36<i)throw new q("radix");let o;if((o=r.indexOf("-"))>0)throw new q("interior hyphen");if(o===0)return G._fromString(r.substring(1),n,i).neg();const u=G.fromNumber(Math.pow(i,8));let h=G.ZERO;for(let s=0;s<r.length;s+=8){const a=Math.min(8,r.length-s),E=parseInt(r.substring(s,s+a),i);if(a<8){const l=G.fromNumber(Math.pow(i,a));h=h.mul(l).add(G.fromNumber(E))}else h=h.mul(u),h=h.add(G.fromNumber(E))}return h.unsigned=n,h}static fromStringStrict(r,n,i){let o=!1;if(typeof n=="number"?(i=n,n=!1):o=!!n,i??(i=10),r.trim()!==r)throw new q(`Input: '${r}' contains leading and/or trailing whitespace`);if(!C2(r,i))throw new q(`Input: '${r}' contains invalid characters for radix: ${i}`);const u=e0(r),h=G._fromString(u,o,i);if(h.toString(i).toLowerCase()!==u.toLowerCase())throw new q(`Input: ${r} is not representable as ${h.unsigned?"an unsigned":"a signed"} 64-bit Long ${i!=null?`with radix: ${i}`:""}`);return h}static fromString(r,n,i){let o=!1;return typeof n=="number"?(i=n,n=!1):o=!!n,i??(i=10),r==="NaN"&&i<24||(r==="Infinity"||r==="+Infinity"||r==="-Infinity")&&i<35?G.ZERO:G._fromString(r,o,i)}static fromBytes(r,n,i){return i?G.fromBytesLE(r,n):G.fromBytesBE(r,n)}static fromBytesLE(r,n){return new G(r[0]|r[1]<<8|r[2]<<16|r[3]<<24,r[4]|r[5]<<8|r[6]<<16|r[7]<<24,n)}static fromBytesBE(r,n){return new G(r[4]<<24|r[5]<<16|r[6]<<8|r[7],r[0]<<24|r[1]<<16|r[2]<<8|r[3],n)}static isLong(r){return r!=null&&typeof r=="object"&&"__isLong__"in r&&r.__isLong__===!0}static fromValue(r,n){return typeof r=="number"?G.fromNumber(r,n):typeof r=="string"?G.fromString(r,n):G.fromBits(r.low,r.high,typeof n=="boolean"?n:r.unsigned)}add(r){G.isLong(r)||(r=G.fromValue(r));const n=this.high>>>16,i=this.high&65535,o=this.low>>>16,u=this.low&65535,h=r.high>>>16,s=r.high&65535,a=r.low>>>16,E=r.low&65535;let l=0,g=0,m=0,C=0;return C+=u+E,m+=C>>>16,C&=65535,m+=o+a,g+=m>>>16,m&=65535,g+=i+s,l+=g>>>16,g&=65535,l+=n+h,l&=65535,G.fromBits(m<<16|C,l<<16|g,this.unsigned)}and(r){return G.isLong(r)||(r=G.fromValue(r)),G.fromBits(this.low&r.low,this.high&r.high,this.unsigned)}compare(r){if(G.isLong(r)||(r=G.fromValue(r)),this.eq(r))return 0;const n=this.isNegative(),i=r.isNegative();return n&&!i?-1:!n&&i?1:this.unsigned?r.high>>>0>this.high>>>0||r.high===this.high&&r.low>>>0>this.low>>>0?-1:1:this.sub(r).isNegative()?-1:1}comp(r){return this.compare(r)}divide(r){if(G.isLong(r)||(r=G.fromValue(r)),r.isZero())throw new q("division by zero");if(Ct){if(!this.unsigned&&this.high===-2147483648&&r.low===-1&&r.high===-1)return this;const u=(this.unsigned?Ct.div_u:Ct.div_s)(this.low,this.high,r.low,r.high);return G.fromBits(u,Ct.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?G.UZERO:G.ZERO;let n,i,o;if(this.unsigned){if(r.unsigned||(r=r.toUnsigned()),r.gt(this))return G.UZERO;if(r.gt(this.shru(1)))return G.UONE;o=G.UZERO}else{if(this.eq(G.MIN_VALUE))return r.eq(G.ONE)||r.eq(G.NEG_ONE)?G.MIN_VALUE:r.eq(G.MIN_VALUE)?G.ONE:(n=this.shr(1).div(r).shl(1),n.eq(G.ZERO)?r.isNegative()?G.ONE:G.NEG_ONE:(i=this.sub(r.mul(n)),o=n.add(i.div(r)),o));if(r.eq(G.MIN_VALUE))return this.unsigned?G.UZERO:G.ZERO;if(this.isNegative())return r.isNegative()?this.neg().div(r.neg()):this.neg().div(r).neg();if(r.isNegative())return this.div(r.neg()).neg();o=G.ZERO}for(i=this;i.gte(r);){n=Math.max(1,Math.floor(i.toNumber()/r.toNumber()));const u=Math.ceil(Math.log(n)/Math.LN2),h=u<=48?1:Math.pow(2,u-48);let s=G.fromNumber(n),a=s.mul(r);for(;a.isNegative()||a.gt(i);)n-=h,s=G.fromNumber(n,this.unsigned),a=s.mul(r);s.isZero()&&(s=G.ONE),o=o.add(s),i=i.sub(a)}return o}div(r){return this.divide(r)}equals(r){return G.isLong(r)||(r=G.fromValue(r)),this.unsigned!==r.unsigned&&this.high>>>31===1&&r.high>>>31===1?!1:this.high===r.high&&this.low===r.low}eq(r){return this.equals(r)}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(G.MIN_VALUE)?64:this.neg().getNumBitsAbs();const r=this.high!==0?this.high:this.low;let n;for(n=31;n>0&&!(r&1<<n);n--);return this.high!==0?n+33:n+1}greaterThan(r){return this.comp(r)>0}gt(r){return this.greaterThan(r)}greaterThanOrEqual(r){return this.comp(r)>=0}gte(r){return this.greaterThanOrEqual(r)}ge(r){return this.greaterThanOrEqual(r)}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(r){return this.comp(r)<0}lt(r){return this.lessThan(r)}lessThanOrEqual(r){return this.comp(r)<=0}lte(r){return this.lessThanOrEqual(r)}modulo(r){if(G.isLong(r)||(r=G.fromValue(r)),Ct){const n=(this.unsigned?Ct.rem_u:Ct.rem_s)(this.low,this.high,r.low,r.high);return G.fromBits(n,Ct.get_high(),this.unsigned)}return this.sub(this.div(r).mul(r))}mod(r){return this.modulo(r)}rem(r){return this.modulo(r)}multiply(r){if(this.isZero())return G.ZERO;if(G.isLong(r)||(r=G.fromValue(r)),Ct){const S=Ct.mul(this.low,this.high,r.low,r.high);return G.fromBits(S,Ct.get_high(),this.unsigned)}if(r.isZero())return G.ZERO;if(this.eq(G.MIN_VALUE))return r.isOdd()?G.MIN_VALUE:G.ZERO;if(r.eq(G.MIN_VALUE))return this.isOdd()?G.MIN_VALUE:G.ZERO;if(this.isNegative())return r.isNegative()?this.neg().mul(r.neg()):this.neg().mul(r).neg();if(r.isNegative())return this.mul(r.neg()).neg();if(this.lt(G.TWO_PWR_24)&&r.lt(G.TWO_PWR_24))return G.fromNumber(this.toNumber()*r.toNumber(),this.unsigned);const n=this.high>>>16,i=this.high&65535,o=this.low>>>16,u=this.low&65535,h=r.high>>>16,s=r.high&65535,a=r.low>>>16,E=r.low&65535;let l=0,g=0,m=0,C=0;return C+=u*E,m+=C>>>16,C&=65535,m+=o*E,g+=m>>>16,m&=65535,m+=u*a,g+=m>>>16,m&=65535,g+=i*E,l+=g>>>16,g&=65535,g+=o*a,l+=g>>>16,g&=65535,g+=u*s,l+=g>>>16,g&=65535,l+=n*E+i*a+o*s+u*h,l&=65535,G.fromBits(m<<16|C,l<<16|g,this.unsigned)}mul(r){return this.multiply(r)}negate(){return!this.unsigned&&this.eq(G.MIN_VALUE)?G.MIN_VALUE:this.not().add(G.ONE)}neg(){return this.negate()}not(){return G.fromBits(~this.low,~this.high,this.unsigned)}notEquals(r){return!this.equals(r)}neq(r){return this.notEquals(r)}ne(r){return this.notEquals(r)}or(r){return G.isLong(r)||(r=G.fromValue(r)),G.fromBits(this.low|r.low,this.high|r.high,this.unsigned)}shiftLeft(r){return G.isLong(r)&&(r=r.toInt()),(r&=63)===0?this:r<32?G.fromBits(this.low<<r,this.high<<r|this.low>>>32-r,this.unsigned):G.fromBits(0,this.low<<r-32,this.unsigned)}shl(r){return this.shiftLeft(r)}shiftRight(r){return G.isLong(r)&&(r=r.toInt()),(r&=63)===0?this:r<32?G.fromBits(this.low>>>r|this.high<<32-r,this.high>>r,this.unsigned):G.fromBits(this.high>>r-32,this.high>=0?0:-1,this.unsigned)}shr(r){return this.shiftRight(r)}shiftRightUnsigned(r){if(G.isLong(r)&&(r=r.toInt()),r&=63,r===0)return this;{const n=this.high;if(r<32){const i=this.low;return G.fromBits(i>>>r|n<<32-r,n>>>r,this.unsigned)}else return r===32?G.fromBits(n,0,this.unsigned):G.fromBits(n>>>r-32,0,this.unsigned)}}shr_u(r){return this.shiftRightUnsigned(r)}shru(r){return this.shiftRightUnsigned(r)}subtract(r){return G.isLong(r)||(r=G.fromValue(r)),this.add(r.neg())}sub(r){return this.subtract(r)}toInt(){return this.unsigned?this.low>>>0:this.low}toNumber(){return this.unsigned?(this.high>>>0)*ln+(this.low>>>0):this.high*ln+(this.low>>>0)}toBigInt(){return BigInt(this.toString())}toBytes(r){return r?this.toBytesLE():this.toBytesBE()}toBytesLE(){const r=this.high,n=this.low;return[n&255,n>>>8&255,n>>>16&255,n>>>24,r&255,r>>>8&255,r>>>16&255,r>>>24]}toBytesBE(){const r=this.high,n=this.low;return[r>>>24,r>>>16&255,r>>>8&255,r&255,n>>>24,n>>>16&255,n>>>8&255,n&255]}toSigned(){return this.unsigned?G.fromBits(this.low,this.high,!1):this}toString(r){if(r=r||10,r<2||36<r)throw new q("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(G.MIN_VALUE)){const u=G.fromNumber(r),h=this.div(u),s=h.mul(u).sub(this);return h.toString(r)+s.toInt().toString(r)}else return"-"+this.neg().toString(r);const n=G.fromNumber(Math.pow(r,6),this.unsigned);let i=this,o="";for(;;){const u=i.div(n);let s=(i.sub(u.mul(n)).toInt()>>>0).toString(r);if(i=u,i.isZero())return s+o;for(;s.length<6;)s="0"+s;o=""+s+o}}toUnsigned(){return this.unsigned?this:G.fromBits(this.low,this.high,!0)}xor(r){return G.isLong(r)||(r=G.fromValue(r)),G.fromBits(this.low^r.low,this.high^r.high,this.unsigned)}eqz(){return this.isZero()}le(r){return this.lessThanOrEqual(r)}toExtendedJSON(r){return r&&r.relaxed?this.toNumber():{$numberLong:this.toString()}}static fromExtendedJSON(r,n){const{useBigInt64:i=!1,relaxed:o=!0}={...n};if(r.$numberLong.length>y2)throw new q("$numberLong string is too long");if(!O2.test(r.$numberLong))throw new q(`$numberLong string "${r.$numberLong}" is in an invalid format`);if(i){const h=BigInt(r.$numberLong);return BigInt.asIntN(64,h)}const u=G.fromString(r.$numberLong);return o?u.toNumber():u}inspect(r,n,i){i??(i=Et);const o=i(this.toString(),n),u=this.unsigned?`, ${i(this.unsigned,n)}`:"";return`new Long(${o}${u})`}};se(G,"TWO_PWR_24",G.fromInt(S2)),se(G,"MAX_UNSIGNED_VALUE",G.fromBits(-1,-1,!0)),se(G,"ZERO",G.fromInt(0)),se(G,"UZERO",G.fromInt(0,!0)),se(G,"ONE",G.fromInt(1)),se(G,"UONE",G.fromInt(1,!0)),se(G,"NEG_ONE",G.fromInt(-1)),se(G,"MAX_VALUE",G.fromBits(-1,2147483647,!1)),se(G,"MIN_VALUE",G.fromBits(0,-2147483648,!1));let ie=G;const w2=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,_2=/^(\+|-)?(Infinity|inf)$/i,D2=/^(\+|-)?NaN$/i,Yr=6111,On=-6176,Uu=6176,ju=34,us=W.fromNumberArray([124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse()),xu=W.fromNumberArray([248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse()),zu=W.fromNumberArray([120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse()),T2=/^([-+])?(\d+)?$/,B2=31,Vu=16383,b2=30,M2=31;function Wu(e){return!isNaN(parseInt(e,10))}function F2(e){const t=ie.fromNumber(1e9);let r=ie.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 ie(e.parts[n],0)),e.parts[n]=r.div(t).low,r=r.modulo(t);return{quotient:e,rem:r}}function R2(e,t){if(!e&&!t)return{high:ie.fromNumber(0),low:ie.fromNumber(0)};const r=e.shiftRightUnsigned(32),n=new ie(e.getLowBits(),0),i=t.shiftRightUnsigned(32),o=new ie(t.getLowBits(),0);let u=r.multiply(i),h=r.multiply(o);const s=n.multiply(i);let a=n.multiply(o);return u=u.add(h.shiftRightUnsigned(32)),h=new ie(h.getLowBits(),0).add(s).add(a.shiftRightUnsigned(32)),u=u.add(h.shiftRightUnsigned(32)),a=h.shiftLeft(32).add(new ie(a.getLowBits(),0)),{high:u,low:a}}function N2(e,t){const r=e.high>>>0,n=t.high>>>0;if(r<n)return!0;if(r===n){const i=e.low>>>0,o=t.low>>>0;if(i<o)return!0}return!1}function Bt(e,t){throw new q(`"${e}" is not a valid Decimal128 string - ${t}`)}class $e extends at{constructor(r){super();se(this,"bytes");if(typeof r=="string")this.bytes=$e.fromString(r).bytes;else if(r instanceof Uint8Array||hr(r)){if(r.byteLength!==16)throw new q("Decimal128 must take a Buffer of 16 bytes");this.bytes=r}else throw new q("Decimal128 must take a Buffer or string")}get _bsontype(){return"Decimal128"}static fromString(r){return $e._fromString(r,{allowRounding:!1})}static fromStringWithRounding(r){return $e._fromString(r,{allowRounding:!0})}static _fromString(r,n){let i=!1,o=!1,u=!1,h=!1,s=0,a=0,E=0,l=0,g=0;const m=[0];let C=0,S=0,D=0,O=0,M=new ie(0,0),p=new ie(0,0),B=0,d=0;if(r.length>=7e3)throw new q(""+r+" not a valid Decimal128 string");const b=r.match(w2),f=r.match(_2),c=r.match(D2);if(!b&&!f&&!c||r.length===0)throw new q(""+r+" not a valid Decimal128 string");if(b){const A=b[2],y=b[4],F=b[5],R=b[6];y&&R===void 0&&Bt(r,"missing exponent power"),y&&A===void 0&&Bt(r,"missing exponent base"),y===void 0&&(F||R)&&Bt(r,"missing e before exponent")}if((r[d]==="+"||r[d]==="-")&&(o=!0,i=r[d++]==="-"),!Wu(r[d])&&r[d]!=="."){if(r[d]==="i"||r[d]==="I")return new $e(i?xu:zu);if(r[d]==="N")return new $e(us)}for(;Wu(r[d])||r[d]===".";){if(r[d]==="."){u&&Bt(r,"contains multiple periods"),u=!0,d=d+1;continue}C<ju&&(r[d]!=="0"||h)&&(h||(g=a),h=!0,m[S++]=parseInt(r[d],10),C=C+1),h&&(E=E+1),u&&(l=l+1),a=a+1,d=d+1}if(u&&!a)throw new q(""+r+" not a valid Decimal128 string");if(r[d]==="e"||r[d]==="E"){const A=r.substr(++d).match(T2);if(!A||!A[2])return new $e(us);O=parseInt(A[0],10),d=d+A[0].length}if(r[d])return new $e(us);if(!C)m[0]=0,E=1,C=1,s=0;else if(D=C-1,s=E,s!==1)for(;r[g+s-1+Number(o)+Number(u)]==="0";)s=s-1;for(O<=l&&l>O+16384?O=On:O=O-l;O>Yr;){if(D=D+1,D>=ju){if(s===0){O=Yr;break}Bt(r,"overflow")}O=O-1}if(n.allowRounding){for(;O<On||C<E;){if(D===0&&s<C){O=On,s=0;break}if(C<E?E=E-1:D=D-1,O<Yr)O=O+1;else{if(m.join("").match(/^0+$/)){O=Yr;break}Bt(r,"overflow")}}if(D+1<s){let A=a;u&&(g=g+1,A=A+1),o&&(g=g+1,A=A+1);const y=parseInt(r[g+D+1],10);let F=0;if(y>=5&&(F=1,y===5)){F=m[D]%2===1?1:0;for(let R=g+D+2;R<A;R++)if(parseInt(r[R],10)){F=1;break}}if(F){let R=D;for(;R>=0&&++m[R]>9;R--)if(m[R]=0,R===0)if(O<Yr)O=O+1,m[R]=1;else return new $e(i?xu:zu)}}}else{for(;O<On||C<E;){if(D===0){if(s===0){O=On;break}Bt(r,"exponent underflow")}C<E?(r[E-1+Number(o)+Number(u)]!=="0"&&s!==0&&Bt(r,"inexact rounding"),E=E-1):(m[D]!==0&&Bt(r,"inexact rounding"),D=D-1),O<Yr?O=O+1:Bt(r,"overflow")}D+1<s&&(u&&(g=g+1),o&&(g=g+1),parseInt(r[g+D+1],10)!==0&&Bt(r,"inexact rounding"))}if(M=ie.fromNumber(0),p=ie.fromNumber(0),s===0)M=ie.fromNumber(0),p=ie.fromNumber(0);else if(D<17){let A=0;for(p=ie.fromNumber(m[A++]),M=new ie(0,0);A<=D;A++)p=p.multiply(ie.fromNumber(10)),p=p.add(ie.fromNumber(m[A]))}else{let A=0;for(M=ie.fromNumber(m[A++]);A<=D-17;A++)M=M.multiply(ie.fromNumber(10)),M=M.add(ie.fromNumber(m[A]));for(p=ie.fromNumber(m[A++]);A<=D;A++)p=p.multiply(ie.fromNumber(10)),p=p.add(ie.fromNumber(m[A]))}const w=R2(M,ie.fromString("100000000000000000"));w.low=w.low.add(p),N2(w.low,p)&&(w.high=w.high.add(ie.fromNumber(1))),B=O+Uu;const T={low:ie.fromNumber(0),high:ie.fromNumber(0)};w.high.shiftRightUnsigned(49).and(ie.fromNumber(1)).equals(ie.fromNumber(1))?(T.high=T.high.or(ie.fromNumber(3).shiftLeft(61)),T.high=T.high.or(ie.fromNumber(B).and(ie.fromNumber(16383).shiftLeft(47))),T.high=T.high.or(w.high.and(ie.fromNumber(0x7fffffffffff)))):(T.high=T.high.or(ie.fromNumber(B&16383).shiftLeft(49)),T.high=T.high.or(w.high.and(ie.fromNumber(562949953421311)))),T.low=w.low,i&&(T.high=T.high.or(ie.fromString("9223372036854775808")));const _=W.allocateUnsafe(16);return d=0,_[d++]=T.low.low&255,_[d++]=T.low.low>>8&255,_[d++]=T.low.low>>16&255,_[d++]=T.low.low>>24&255,_[d++]=T.low.high&255,_[d++]=T.low.high>>8&255,_[d++]=T.low.high>>16&255,_[d++]=T.low.high>>24&255,_[d++]=T.high.low&255,_[d++]=T.high.low>>8&255,_[d++]=T.high.low>>16&255,_[d++]=T.high.low>>24&255,_[d++]=T.high.high&255,_[d++]=T.high.high>>8&255,_[d++]=T.high.high>>16&255,_[d++]=T.high.high>>24&255,new $e(_)}toString(){let r,n=0;const i=new Array(36);for(let d=0;d<i.length;d++)i[d]=0;let o=0,u=!1,h,s={parts:[0,0,0,0]},a,E;const l=[];o=0;const g=this.bytes,m=g[o++]|g[o++]<<8|g[o++]<<16|g[o++]<<24,C=g[o++]|g[o++]<<8|g[o++]<<16|g[o++]<<24,S=g[o++]|g[o++]<<8|g[o++]<<16|g[o++]<<24,D=g[o++]|g[o++]<<8|g[o++]<<16|g[o++]<<24;o=0,{low:new ie(m,C),high:new ie(S,D)}.high.lessThan(ie.ZERO)&&l.push("-");const M=D>>26&B2;if(M>>3===3){if(M===b2)return l.join("")+"Infinity";if(M===M2)return"NaN";r=D>>15&Vu,h=8+(D>>14&1)}else h=D>>14&7,r=D>>17&Vu;const p=r-Uu;if(s.parts[0]=(D&16383)+((h&15)<<14),s.parts[1]=S,s.parts[2]=C,s.parts[3]=m,s.parts[0]===0&&s.parts[1]===0&&s.parts[2]===0&&s.parts[3]===0)u=!0;else for(E=3;E>=0;E--){let d=0;const b=F2(s);if(s=b.quotient,d=b.rem.low,!!d)for(a=8;a>=0;a--)i[E*9+a]=d%10,d=Math.floor(d/10)}if(u)n=1,i[o]=0;else for(n=36;!i[o];)n=n-1,o=o+1;const B=n-1+p;if(B>=34||B<=-7||p>0){if(n>34)return l.push("0"),p>0?l.push(`E+${p}`):p<0&&l.push(`E${p}`),l.join("");l.push(`${i[o++]}`),n=n-1,n&&l.push(".");for(let d=0;d<n;d++)l.push(`${i[o++]}`);l.push("E"),B>0?l.push(`+${B}`):l.push(`${B}`)}else if(p>=0)for(let d=0;d<n;d++)l.push(`${i[o++]}`);else{let d=n+p;if(d>0)for(let b=0;b<d;b++)l.push(`${i[o++]}`);else l.push("0");for(l.push(".");d++<0;)l.push("0");for(let b=0;b<n-Math.max(d-1,0);b++)l.push(`${i[o++]}`)}return l.join("")}toJSON(){return{$numberDecimal:this.toString()}}toExtendedJSON(){return{$numberDecimal:this.toString()}}static fromExtendedJSON(r){return $e.fromString(r.$numberDecimal)}inspect(r,n,i){return i??(i=Et),`new Decimal128(${i(this.toString(),n)})`}}class Ot extends at{constructor(r){super();se(this,"value");r instanceof Number&&(r=r.valueOf()),this.value=+r}get _bsontype(){return"Double"}static fromString(r){const n=Number(r);if(r==="NaN")return new Ot(NaN);if(r==="Infinity")return new Ot(1/0);if(r==="-Infinity")return new Ot(-1/0);if(!Number.isFinite(n))throw new q(`Input: ${r} is not representable as a Double`);if(r.trim()!==r)throw new q(`Input: '${r}' contains whitespace`);if(r==="")throw new q("Input is an empty string");if(/[^-0-9.+eE]/.test(r))throw new q(`Input: '${r}' is not in decimal or exponential notation`);return new Ot(n)}valueOf(){return this.value}toJSON(){return this.value}toString(r){return this.value.toString(r)}toExtendedJSON(r){return r&&(r.legacy||r.relaxed&&isFinite(this.value))?this.value:Object.is(Math.sign(this.value),-0)?{$numberDouble:"-0.0"}:{$numberDouble:Number.isInteger(this.value)?this.value.toFixed(1):this.value.toString()}}static fromExtendedJSON(r,n){const i=parseFloat(r.$numberDouble);return n&&n.relaxed?i:new Ot(i)}inspect(r,n,i){return i??(i=Et),`new Double(${i(this.value,n)})`}}class er extends at{constructor(r){super();se(this,"value");r instanceof Number&&(r=r.valueOf()),this.value=+r|0}get _bsontype(){return"Int32"}static fromString(r){const n=e0(r),i=Number(r);if(ti<i)throw new q(`Input: '${r}' is larger than the maximum value for Int32`);if(ri>i)throw new q(`Input: '${r}' is smaller than the minimum value for Int32`);if(Number.isSafeInteger(i)){if(i.toString()!==n)throw new q(`Input: '${r}' is not a valid Int32 string`)}else throw new q(`Input: '${r}' is not a safe integer`);return new er(i)}valueOf(){return this.value}toString(r){return this.value.toString(r)}toJSON(){return this.value}toExtendedJSON(r){return r&&(r.relaxed||r.legacy)?this.value:{$numberInt:this.value.toString()}}static fromExtendedJSON(r,n){return n&&n.relaxed?parseInt(r.$numberInt,10):new er(r.$numberInt)}inspect(r,n,i){return i??(i=Et),`new Int32(${i(this.value,n)})`}}class xr extends at{get _bsontype(){return"MaxKey"}toExtendedJSON(){return{$maxKey:1}}static fromExtendedJSON(){return new xr}inspect(){return"new MaxKey()"}}class zr extends at{get _bsontype(){return"MinKey"}toExtendedJSON(){return{$minKey:1}}static fromExtendedJSON(){return new zr}inspect(){return"new MinKey()"}}let yr=null;const wn=new WeakMap,ke=class ke extends at{constructor(r){super();se(this,"buffer");let n;if(typeof r=="object"&&r&&"id"in r){if(typeof r.id!="string"&&!ArrayBuffer.isView(r.id))throw new q("Argument passed in must have an id that is of type string or Buffer");"toHexString"in r&&typeof r.toHexString=="function"?n=W.fromHex(r.toHexString()):n=r.id}else n=r;if(n==null)this.buffer=ke.generate();else if(ArrayBuffer.isView(n)&&n.byteLength===12)this.buffer=W.toLocalBufferType(n);else if(typeof n=="string")if(ke.validateHexString(n))this.buffer=W.fromHex(n),ke.cacheHexString&&wn.set(this,n);else throw new q("input must be a 24 character hex string, 12 byte Uint8Array, or an integer");else throw new q("Argument passed in does not match the accepted types")}get _bsontype(){return"ObjectId"}get id(){return this.buffer}set id(r){this.buffer=r,ke.cacheHexString&&wn.set(this,W.toHex(r))}static validateHexString(r){if((r==null?void 0:r.length)!==24)return!1;for(let n=0;n<24;n++){const i=r.charCodeAt(n);if(!(i>=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70))return!1}return!0}toHexString(){if(ke.cacheHexString){const n=wn.get(this);if(n)return n}const r=W.toHex(this.id);return ke.cacheHexString&&wn.set(this,r),r}static getInc(){return ke.index=(ke.index+1)%16777215}static generate(r){typeof r!="number"&&(r=Math.floor(Date.now()/1e3));const n=ke.getInc(),i=W.allocateUnsafe(12);return ue.setInt32BE(i,0,r),yr===null&&(yr=W.randomBytes(5)),i[4]=yr[0],i[5]=yr[1],i[6]=yr[2],i[7]=yr[3],i[8]=yr[4],i[11]=n&255,i[10]=n>>8&255,i[9]=n>>16&255,i}toString(r){return r==="base64"?W.toBase64(this.id):r==="hex"?this.toHexString():this.toHexString()}toJSON(){return this.toHexString()}static is(r){return r!=null&&typeof r=="object"&&"_bsontype"in r&&r._bsontype==="ObjectId"}equals(r){if(r==null)return!1;if(ke.is(r))return this.buffer[11]===r.buffer[11]&&W.equals(this.buffer,r.buffer);if(typeof r=="string")return r.toLowerCase()===this.toHexString();if(typeof r=="object"&&typeof r.toHexString=="function"){const n=r.toHexString(),i=this.toHexString();return typeof n=="string"&&n.toLowerCase()===i}return!1}getTimestamp(){const r=new Date,n=ue.getUint32BE(this.buffer,0);return r.setTime(Math.floor(n)*1e3),r}static createPk(){return new ke}serializeInto(r,n){return r[n]=this.buffer[0],r[n+1]=this.buffer[1],r[n+2]=this.buffer[2],r[n+3]=this.buffer[3],r[n+4]=this.buffer[4],r[n+5]=this.buffer[5],r[n+6]=this.buffer[6],r[n+7]=this.buffer[7],r[n+8]=this.buffer[8],r[n+9]=this.buffer[9],r[n+10]=this.buffer[10],r[n+11]=this.buffer[11],12}static createFromTime(r){const n=W.allocate(12);for(let i=11;i>=4;i--)n[i]=0;return ue.setInt32BE(n,0,r),new ke(n)}static createFromHexString(r){if((r==null?void 0:r.length)!==24)throw new q("hex string must be 24 characters");return new ke(W.fromHex(r))}static createFromBase64(r){if((r==null?void 0:r.length)!==16)throw new q("base64 string must be 16 characters");return new ke(W.fromBase64(r))}static isValid(r){if(r==null)return!1;if(typeof r=="string")return ke.validateHexString(r);try{return new ke(r),!0}catch{return!1}}toExtendedJSON(){return this.toHexString?{$oid:this.toHexString()}:{$oid:this.toString("hex")}}static fromExtendedJSON(r){return new ke(r.$oid)}isCached(){return ke.cacheHexString&&wn.has(this)}inspect(r,n,i){return i??(i=Et),`new ObjectId(${i(this.toHexString(),n)})`}};se(ke,"index",Math.floor(Math.random()*16777215)),se(ke,"cacheHexString");let Er=ke;function xi(e,t,r){let n=5;if(Array.isArray(e))for(let i=0;i<e.length;i++)n+=Gu(i.toString(),e[i],t,!0,r);else{typeof(e==null?void 0:e.toBSON)=="function"&&(e=e.toBSON());for(const i of Object.keys(e))n+=Gu(i,e[i],t,!1,r)}return n}function Gu(e,t,r=!1,n=!1,i=!1){switch(typeof(t==null?void 0:t.toBSON)=="function"&&(t=t.toBSON()),typeof t){case"string":return 1+W.utf8ByteLength(e)+1+4+W.utf8ByteLength(t)+1;case"number":return Math.floor(t)===t&&t>=Uc&&t<=kc&&t>=ri&&t<=ti?(e!=null?W.utf8ByteLength(e)+1:0)+5:(e!=null?W.utf8ByteLength(e)+1:0)+9;case"undefined":return n||!i?(e!=null?W.utf8ByteLength(e)+1:0)+1:0;case"boolean":return(e!=null?W.utf8ByteLength(e)+1:0)+2;case"object":if(t!=null&&typeof t._bsontype=="string"&&t[dn]!==Rr)throw new Nr;if(t==null||t._bsontype==="MinKey"||t._bsontype==="MaxKey")return(e!=null?W.utf8ByteLength(e)+1:0)+1;if(t._bsontype==="ObjectId")return(e!=null?W.utf8ByteLength(e)+1:0)+13;if(t instanceof Date||an(t))return(e!=null?W.utf8ByteLength(e)+1:0)+9;if(ArrayBuffer.isView(t)||t instanceof ArrayBuffer||b1(t))return(e!=null?W.utf8ByteLength(e)+1:0)+6+t.byteLength;if(t._bsontype==="Long"||t._bsontype==="Double"||t._bsontype==="Timestamp")return(e!=null?W.utf8ByteLength(e)+1:0)+9;if(t._bsontype==="Decimal128")return(e!=null?W.utf8ByteLength(e)+1:0)+17;if(t._bsontype==="Code")return t.scope!=null&&Object.keys(t.scope).length>0?(e!=null?W.utf8ByteLength(e)+1:0)+1+4+4+W.utf8ByteLength(t.code.toString())+1+xi(t.scope,r,i):(e!=null?W.utf8ByteLength(e)+1:0)+1+4+W.utf8ByteLength(t.code.toString())+1;if(t._bsontype==="Binary"){const o=t;return o.sub_type===je.SUBTYPE_BYTE_ARRAY?(e!=null?W.utf8ByteLength(e)+1:0)+(o.position+1+4+1+4):(e!=null?W.utf8ByteLength(e)+1:0)+(o.position+1+4+1)}else{if(t._bsontype==="Symbol")return(e!=null?W.utf8ByteLength(e)+1:0)+W.utf8ByteLength(t.value)+4+1+1;if(t._bsontype==="DBRef"){const o=Object.assign({$ref:t.collection,$id:t.oid},t.fields);return t.db!=null&&(o.$db=t.db),(e!=null?W.utf8ByteLength(e)+1:0)+1+xi(o,r,i)}else return t instanceof RegExp||un(t)?(e!=null?W.utf8ByteLength(e)+1:0)+1+W.utf8ByteLength(t.source)+1+(t.global?1:0)+(t.ignoreCase?1:0)+(t.multiline?1:0)+1:t._bsontype==="BSONRegExp"?(e!=null?W.utf8ByteLength(e)+1:0)+1+W.utf8ByteLength(t.pattern)+1+W.utf8ByteLength(t.options)+1:(e!=null?W.utf8ByteLength(e)+1:0)+xi(t,r,i)+1}case"function":return r?(e!=null?W.utf8ByteLength(e)+1:0)+1+4+W.utf8ByteLength(t.toString())+1:0;case"bigint":return(e!=null?W.utf8ByteLength(e)+1:0)+9;case"symbol":return 0;default:throw new q(`Unrecognized JS type: ${typeof t}`)}}function I2(e){return e.split("").sort().join("")}class wt extends at{constructor(r,n){super();se(this,"pattern");se(this,"options");if(this.pattern=r,this.options=I2(n??""),this.pattern.indexOf("\0")!==-1)throw new q(`BSON Regex patterns cannot contain null bytes, found: ${JSON.stringify(this.pattern)}`);if(this.options.indexOf("\0")!==-1)throw new q(`BSON Regex options cannot contain null bytes, found: ${JSON.stringify(this.options)}`);for(let i=0;i<this.options.length;i++)if(!(this.options[i]==="i"||this.options[i]==="m"||this.options[i]==="x"||this.options[i]==="l"||this.options[i]==="s"||this.options[i]==="u"))throw new q(`The regular expression option [${this.options[i]}] is not supported`)}get _bsontype(){return"BSONRegExp"}static parseOptions(r){return r?r.split("").sort().join(""):""}toExtendedJSON(r){return r=r||{},r.legacy?{$regex:this.pattern,$options:this.options}:{$regularExpression:{pattern:this.pattern,options:this.options}}}static fromExtendedJSON(r){if("$regex"in r)if(typeof r.$regex!="string"){if(r.$regex._bsontype==="BSONRegExp")return r}else return new wt(r.$regex,wt.parseOptions(r.$options));if("$regularExpression"in r)return new wt(r.$regularExpression.pattern,wt.parseOptions(r.$regularExpression.options));throw new q(`Unexpected BSONRegExp EJSON object form: ${JSON.stringify(r)}`)}inspect(r,n,i){const o=o2(n)??(s=>s);i??(i=Et);const u=o(i(this.pattern),"regexp"),h=o(i(this.options),"regexp");return`new BSONRegExp(${u}, ${h})`}}class Vr extends at{constructor(r){super();se(this,"value");this.value=r}get _bsontype(){return"BSONSymbol"}valueOf(){return this.value}toString(){return this.value}toJSON(){return this.value}toExtendedJSON(){return{$symbol:this.value}}static fromExtendedJSON(r){return new Vr(r.$symbol)}inspect(r,n,i){return i??(i=Et),`new BSONSymbol(${i(this.value,n)})`}}const v2=ie,cr=class cr extends v2{get _bsontype(){return"Timestamp"}get[co](){return"Timestamp"}get i(){return this.low>>>0}get t(){return this.high>>>0}constructor(t){if(t==null)super(0,0,!0);else if(typeof t=="bigint")super(t,!0);else if(ie.isLong(t))super(t.low,t.high,!0);else if(typeof t=="object"&&"t"in t&&"i"in t){if(typeof t.t!="number"&&(typeof t.t!="object"||t.t._bsontype!=="Int32"))throw new q("Timestamp constructed from { t, i } must provide t as a number");if(typeof t.i!="number"&&(typeof t.i!="object"||t.i._bsontype!=="Int32"))throw new q("Timestamp constructed from { t, i } must provide i as a number");const r=Number(t.t),n=Number(t.i);if(r<0||Number.isNaN(r))throw new q("Timestamp constructed from { t, i } must provide a positive t");if(n<0||Number.isNaN(n))throw new q("Timestamp constructed from { t, i } must provide a positive i");if(r>4294967295)throw new q("Timestamp constructed from { t, i } must provide t equal or less than uint32 max");if(n>4294967295)throw new q("Timestamp constructed from { t, i } must provide i equal or less than uint32 max");super(n,r,!0)}else throw new q("A Timestamp can only be constructed with: bigint, Long, or { t: number; i: number }")}toJSON(){return{$timestamp:this.toString()}}static fromInt(t){return new cr(ie.fromInt(t,!0))}static fromNumber(t){return new cr(ie.fromNumber(t,!0))}static fromBits(t,r){return new cr({i:t,t:r})}static fromString(t,r){return new cr(ie.fromString(t,!0,r))}toExtendedJSON(){return{$timestamp:{t:this.t,i:this.i}}}static fromExtendedJSON(t){const r=ie.isLong(t.$timestamp.i)?t.$timestamp.i.getLowBitsUnsigned():t.$timestamp.i,n=ie.isLong(t.$timestamp.t)?t.$timestamp.t.getLowBitsUnsigned():t.$timestamp.t;return new cr({t:n,i:r})}inspect(t,r,n){n??(n=Et);const i=n(this.t,r),o=n(this.i,r);return`new Timestamp({ t: ${i}, i: ${o} })`}};se(cr,"MAX_VALUE",ie.MAX_UNSIGNED_VALUE);let vr=cr;const P2=ie.fromNumber(kc),L2=ie.fromNumber(Uc);function r0(e,t,r){t=t??{};const n=t&&t.index?t.index:0,i=ue.getInt32LE(e,n);if(i<5)throw new q(`bson size must be >= 5, is ${i}`);if(t.allowObjectSmallerThanBufferSize&&e.length<i)throw new q(`buffer length ${e.length} must be >= bson size ${i}`);if(!t.allowObjectSmallerThanBufferSize&&e.length!==i)throw new q(`buffer length ${e.length} must === bson size ${i}`);if(i+n>e.byteLength)throw new q(`(bson size ${i} + options.index ${n} must be <= buffer length ${e.byteLength})`);if(e[n+i-1]!==0)throw new q("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00");return zi(e,n,t,r)}const k2=/^\$ref$|^\$id$|^\$db$/;function zi(e,t,r,n=!1){const i=r.fieldsAsRaw==null?null:r.fieldsAsRaw,o=r.raw==null?!1:r.raw,u=typeof r.bsonRegExp=="boolean"?r.bsonRegExp:!1,h=r.promoteBuffers??!1,s=r.promoteLongs??!0,a=r.promoteValues??!0,E=r.useBigInt64??!1;if(E&&!a)throw new q("Must either request bigint or Long for int64 deserialization");if(E&&!s)throw new q("Must either request bigint or Long for int64 deserialization");const l=r.validation==null?{utf8:!0}:r.validation;let g=!0,m,C;const S=l.utf8;if(typeof S=="boolean")m=S;else{g=!1;const d=Object.keys(S).map(function(b){return S[b]});if(d.length===0)throw new q("UTF-8 validation setting cannot be empty");if(typeof d[0]!="boolean")throw new q("Invalid UTF-8 validation option, must specify boolean values");if(m=d[0],!d.every(b=>b===m))throw new q("Invalid UTF-8 validation option - keys must be all true or all false")}if(!g){C=new Set;for(const d of Object.keys(S))C.add(d)}const D=t;if(e.length<5)throw new q("corrupt bson message < 5 bytes long");const O=ue.getInt32LE(e,t);if(t+=4,O<5||O>e.length)throw new q("corrupt bson message");const M=n?[]:{};let p=0,B=n?!1:null;for(;;){const d=e[t++];if(d===0)break;let b=t;for(;e[b]!==0&&b<e.length;)b++;if(b>=e.byteLength)throw new q("Bad BSON Document: illegal CString");const f=n?p++:W.toUTF8(e,t,b,!1);let c=!0;g||C!=null&&C.has(f)?c=m:c=!m,B!==!1&&f[0]==="$"&&(B=k2.test(f));let w;if(t=b+1,d===jc){const T=ue.getInt32LE(e,t);if(t+=4,T<=0||T>e.length-t||e[t+T-1]!==0)throw new q("bad string length in bson");w=W.toUTF8(e,t,t+T-1,c),t=t+T}else if(d===zc){const T=W.allocateUnsafe(12);for(let _=0;_<12;_++)T[_]=e[t+_];w=new Er(T),t=t+12}else if(d===Hn&&a===!1)w=new er(ue.getInt32LE(e,t)),t+=4;else if(d===Hn)w=ue.getInt32LE(e,t),t+=4;else if(d===F1)w=ue.getFloat64LE(e,t),t+=8,a===!1&&(w=new Ot(w));else if(d===Wc){const T=ue.getInt32LE(e,t),_=ue.getInt32LE(e,t+4);t+=8,w=new Date(new ie(T,_).toNumber())}else if(d===Vc){if(e[t]!==0&&e[t]!==1)throw new q("illegal boolean type value");w=e[t++]===1}else if(d===R1){const T=t,_=ue.getInt32LE(e,t);if(_<=0||_>e.length-t)throw new q("bad embedded document length in bson");if(o)w=e.subarray(t,t+_);else{let A=r;g||(A={...r,validation:{utf8:c}}),w=zi(e,T,A,!1)}t=t+_}else if(d===xc){const T=t,_=ue.getInt32LE(e,t);let A=r;const y=t+_;if(i&&i[f]&&(A={...r,raw:!0}),g||(A={...A,validation:{utf8:c}}),w=zi(e,T,A,!0),t=t+_,e[t-1]!==0)throw new q("invalid array terminator byte");if(t!==y)throw new q("corrupted array bson")}else if(d===s2)w=void 0;else if(d===I1)w=null;else if(d===P1)if(E)w=ue.getBigInt64LE(e,t),t+=8;else{const T=ue.getInt32LE(e,t),_=ue.getInt32LE(e,t+4);t+=8;const A=new ie(T,_);s&&a===!0?w=A.lessThanOrEqual(P2)&&A.greaterThanOrEqual(L2)?A.toNumber():A:w=A}else if(d===Kc){const T=W.allocateUnsafe(16);for(let _=0;_<16;_++)T[_]=e[t+_];t=t+16,w=new $e(T)}else if(d===N1){let T=ue.getInt32LE(e,t);t+=4;const _=T,A=e[t++];if(T<0)throw new q("Negative binary type element size found");if(T>e.byteLength)throw new q("Binary type size larger than document size");if(A===je.SUBTYPE_BYTE_ARRAY){if(T=ue.getInt32LE(e,t),t+=4,T<0)throw new q("Negative binary type element size found for subtype 0x02");if(T>_-4)throw new q("Binary type with subtype 0x02 contains too long binary size");if(T<_-4)throw new q("Binary type with subtype 0x02 contains too short binary size")}h&&a?w=W.toLocalBufferType(e.subarray(t,t+T)):(w=new je(e.subarray(t,t+T),A),A===L1&&Xe.isValid(w)&&(w=w.toUUID())),t=t+T}else if(d===Yi&&u===!1){for(b=t;e[b]!==0&&b<e.length;)b++;if(b>=e.length)throw new q("Bad BSON Document: illegal CString");const T=W.toUTF8(e,t,b,!1);for(t=b+1,b=t;e[b]!==0&&b<e.length;)b++;if(b>=e.length)throw new q("Bad BSON Document: illegal CString");const _=W.toUTF8(e,t,b,!1);t=b+1;const A=new Array(_.length);for(b=0;b<_.length;b++)switch(_[b]){case"m":A[b]="m";break;case"s":A[b]="g";break;case"i":A[b]="i";break}w=new RegExp(T,A.join(""))}else if(d===Yi&&u===!0){for(b=t;e[b]!==0&&b<e.length;)b++;if(b>=e.length)throw new q("Bad BSON Document: illegal CString");const T=W.toUTF8(e,t,b,!1);for(t=b+1,b=t;e[b]!==0&&b<e.length;)b++;if(b>=e.length)throw new q("Bad BSON Document: illegal CString");const _=W.toUTF8(e,t,b,!1);t=b+1,w=new wt(T,_)}else if(d===Gc){const T=ue.getInt32LE(e,t);if(t+=4,T<=0||T>e.length-t||e[t+T-1]!==0)throw new q("bad string length in bson");const _=W.toUTF8(e,t,t+T-1,c);w=a?_:new Vr(_),t=t+T}else if(d===Hc)w=new vr({i:ue.getUint32LE(e,t),t:ue.getUint32LE(e,t+4)}),t+=8;else if(d===Yc)w=new zr;else if(d===Xc)w=new xr;else if(d===v1){const T=ue.getInt32LE(e,t);if(t+=4,T<=0||T>e.length-t||e[t+T-1]!==0)throw new q("bad string length in bson");const _=W.toUTF8(e,t,t+T-1,c);w=new $t(_),t=t+T}else if(d===qc){const T=ue.getInt32LE(e,t);if(t+=4,T<13)throw new q("code_w_scope total size shorter minimum expected length");const _=ue.getInt32LE(e,t);if(t+=4,_<=0||_>e.length-t||e[t+_-1]!==0)throw new q("bad string length in bson");const A=W.toUTF8(e,t,t+_-1,c);t=t+_;const y=t,F=ue.getInt32LE(e,t),R=zi(e,y,r,!1);if(t=t+F,T<8+F+_)throw new q("code_w_scope total size is too short, truncating scope");if(T>8+F+_)throw new q("code_w_scope total size is too long, clips outer document");w=new $t(A,R)}else if(d===u2){const T=ue.getInt32LE(e,t);if(t+=4,T<=0||T>e.length-t||e[t+T-1]!==0)throw new q("bad string length in bson");const _=W.toUTF8(e,t,t+T-1,c);t=t+T;const A=W.allocateUnsafe(12);for(let F=0;F<12;F++)A[F]=e[t+F];const y=new Er(A);t=t+12,w=new Gt(_,y)}else throw new q(`Detected unknown BSON type ${d.toString(16)} for fieldname "${f}"`);f==="__proto__"?Object.defineProperty(M,f,{value:w,writable:!0,enumerable:!0,configurable:!0}):M[f]=w}if(O!==t-D)throw n?new q("corrupt array bson"):new q("corrupt object bson");if(!B)return M;if($c(M)){const d=Object.assign({},M);return delete d.$ref,delete d.$id,delete d.$db,new Gt(M.$ref,M.$id,M.$db,d)}return M}const Ji=/\x00/,qu=new Set(["$db","$ref","$id","$clusterTime"]);function as(e,t,r,n){e[n++]=jc;const i=W.encodeUTF8Into(e,t,n);n=n+i+1,e[n-1]=0;const o=W.encodeUTF8Into(e,r,n+4);return ue.setInt32LE(e,n,o+1),n=n+4+o,e[n++]=0,n}function cs(e,t,r,n){const o=!Object.is(r,-0)&&Number.isSafeInteger(r)&&r<=ti&&r>=ri?Hn:F1;e[n++]=o;const u=W.encodeUTF8Into(e,t,n);return n=n+u,e[n++]=0,o===Hn?n+=ue.setInt32LE(e,n,r):n+=ue.setFloat64LE(e,n,r),n}function ls(e,t,r,n){e[n++]=P1;const i=W.encodeUTF8Into(e,t,n);return n+=i,e[n++]=0,n+=ue.setBigInt64LE(e,n,r),n}function Xr(e,t,r,n){e[n++]=I1;const i=W.encodeUTF8Into(e,t,n);return n=n+i,e[n++]=0,n}function hs(e,t,r,n){e[n++]=Vc;const i=W.encodeUTF8Into(e,t,n);return n=n+i,e[n++]=0,e[n++]=r?1:0,n}function ds(e,t,r,n){e[n++]=Wc;const i=W.encodeUTF8Into(e,t,n);n=n+i,e[n++]=0;const o=ie.fromNumber(r.getTime()),u=o.getLowBits(),h=o.getHighBits();return n+=ue.setInt32LE(e,n,u),n+=ue.setInt32LE(e,n,h),n}function fs(e,t,r,n){e[n++]=Yi;const i=W.encodeUTF8Into(e,t,n);if(n=n+i,e[n++]=0,r.source&&r.source.match(Ji)!=null)throw new q("value "+r.source+" must not contain null bytes");return n=n+W.encodeUTF8Into(e,r.source,n),e[n++]=0,r.ignoreCase&&(e[n++]=105),r.global&&(e[n++]=115),r.multiline&&(e[n++]=109),e[n++]=0,n}function ms(e,t,r,n){e[n++]=Yi;const i=W.encodeUTF8Into(e,t,n);if(n=n+i,e[n++]=0,r.pattern.match(Ji)!=null)throw new q("pattern "+r.pattern+" must not contain null bytes");n=n+W.encodeUTF8Into(e,r.pattern,n),e[n++]=0;const o=r.options.split("").sort().join("");return n=n+W.encodeUTF8Into(e,o,n),e[n++]=0,n}function Es(e,t,r,n){r===null?e[n++]=I1:r._bsontype==="MinKey"?e[n++]=Yc:e[n++]=Xc;const i=W.encodeUTF8Into(e,t,n);return n=n+i,e[n++]=0,n}function gs(e,t,r,n){e[n++]=zc;const i=W.encodeUTF8Into(e,t,n);return n=n+i,e[n++]=0,n+=r.serializeInto(e,n),n}function As(e,t,r,n){e[n++]=N1;const i=W.encodeUTF8Into(e,t,n);n=n+i,e[n++]=0;const o=r.length;if(n+=ue.setInt32LE(e,n,o),e[n++]=a2,o<=16)for(let u=0;u<o;u++)e[n+u]=r[u];else e.set(r,n);return n=n+o,n}function ps(e,t,r,n,i,o,u,h,s){if(s.has(r))throw new q("Cannot convert circular structure to BSON");s.add(r),e[n++]=Array.isArray(r)?xc:R1;const a=W.encodeUTF8Into(e,t,n);n=n+a,e[n++]=0;const E=ni(e,r,i,n,o+1,u,h,s);return s.delete(r),E}function Cs(e,t,r,n){e[n++]=Kc;const i=W.encodeUTF8Into(e,t,n);n=n+i,e[n++]=0;for(let o=0;o<16;o++)e[n+o]=r.bytes[o];return n+16}function Ss(e,t,r,n){e[n++]=r._bsontype==="Long"?P1:Hc;const i=W.encodeUTF8Into(e,t,n);n=n+i,e[n++]=0;const o=r.getLowBits(),u=r.getHighBits();return n+=ue.setInt32LE(e,n,o),n+=ue.setInt32LE(e,n,u),n}function ys(e,t,r,n){r=r.valueOf(),e[n++]=Hn;const i=W.encodeUTF8Into(e,t,n);return n=n+i,e[n++]=0,n+=ue.setInt32LE(e,n,r),n}function Os(e,t,r,n){e[n++]=F1;const i=W.encodeUTF8Into(e,t,n);return n=n+i,e[n++]=0,n+=ue.setFloat64LE(e,n,r.value),n}function ws(e,t,r,n){e[n++]=v1;const i=W.encodeUTF8Into(e,t,n);n=n+i,e[n++]=0;const o=r.toString(),u=W.encodeUTF8Into(e,o,n+4)+1;return ue.setInt32LE(e,n,u),n=n+4+u-1,e[n++]=0,n}function _s(e,t,r,n,i=!1,o=0,u=!1,h=!0,s){if(r.scope&&typeof r.scope=="object"){e[n++]=qc;const a=W.encodeUTF8Into(e,t,n);n=n+a,e[n++]=0;let E=n;const l=r.code;n=n+4;const g=W.encodeUTF8Into(e,l,n+4)+1;ue.setInt32LE(e,n,g),e[n+4+g-1]=0,n=n+g+4;const m=ni(e,r.scope,i,n,o+1,u,h,s);n=m-1;const C=m-E;E+=ue.setInt32LE(e,E,C),e[n++]=0}else{e[n++]=v1;const a=W.encodeUTF8Into(e,t,n);n=n+a,e[n++]=0;const E=r.code.toString(),l=W.encodeUTF8Into(e,E,n+4)+1;ue.setInt32LE(e,n,l),n=n+4+l-1,e[n++]=0}return n}function Ds(e,t,r,n){e[n++]=N1;const i=W.encodeUTF8Into(e,t,n);n=n+i,e[n++]=0;const o=r.buffer;let u=r.position;if(r.sub_type===je.SUBTYPE_BYTE_ARRAY&&(u=u+4),n+=ue.setInt32LE(e,n,u),e[n++]=r.sub_type,r.sub_type===je.SUBTYPE_BYTE_ARRAY&&(u=u-4,n+=ue.setInt32LE(e,n,u)),r.sub_type===je.SUBTYPE_VECTOR&&Yt(r),u<=16)for(let h=0;h<u;h++)e[n+h]=o[h];else e.set(o,n);return n=n+r.position,n}function Ts(e,t,r,n){e[n++]=Gc;const i=W.encodeUTF8Into(e,t,n);n=n+i,e[n++]=0;const o=W.encodeUTF8Into(e,r.value,n+4)+1;return ue.setInt32LE(e,n,o),n=n+4+o-1,e[n++]=0,n}function Bs(e,t,r,n,i,o,u){e[n++]=R1;const h=W.encodeUTF8Into(e,t,n);n=n+h,e[n++]=0;let s=n,a={$ref:r.collection||r.namespace,$id:r.oid};r.db!=null&&(a.$db=r.db),a=Object.assign(a,r.fields);const E=ni(e,a,!1,n,i+1,o,!0,u),l=E-s;return s+=ue.setInt32LE(e,n,l),E}function ni(e,t,r,n,i,o,u,h){if(h==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 q("serialize does not support an array as the root input");if(typeof t!="object")throw new q("serialize does not support non-object as the root input");if("_bsontype"in t&&typeof t._bsontype=="string")throw new q("BSON types cannot be serialized as a document");if(an(t)||un(t)||hr(t)||b1(t))throw new q("date, regexp, typedarray, and arraybuffer cannot be BSON documents");h=new Set}h.add(t);let s=n+4;if(Array.isArray(t))for(let E=0;E<t.length;E++){const l=`${E}`;let g=t[E];typeof(g==null?void 0:g.toBSON)=="function"&&(g=g.toBSON());const m=typeof g;if(g===void 0)s=Xr(e,l,g,s);else if(g===null)s=Xr(e,l,g,s);else if(m==="string")s=as(e,l,g,s);else if(m==="number")s=cs(e,l,g,s);else if(m==="bigint")s=ls(e,l,g,s);else if(m==="boolean")s=hs(e,l,g,s);else if(m==="object"&&g._bsontype==null)g instanceof Date||an(g)?s=ds(e,l,g,s):g instanceof Uint8Array||hr(g)?s=As(e,l,g,s):g instanceof RegExp||un(g)?s=fs(e,l,g,s):s=ps(e,l,g,s,r,i,o,u,h);else if(m==="object"){if(g[dn]!==Rr)throw new Nr;if(g._bsontype==="ObjectId")s=gs(e,l,g,s);else if(g._bsontype==="Decimal128")s=Cs(e,l,g,s);else if(g._bsontype==="Long"||g._bsontype==="Timestamp")s=Ss(e,l,g,s);else if(g._bsontype==="Double")s=Os(e,l,g,s);else if(g._bsontype==="Code")s=_s(e,l,g,s,r,i,o,u,h);else if(g._bsontype==="Binary")s=Ds(e,l,g,s);else if(g._bsontype==="BSONSymbol")s=Ts(e,l,g,s);else if(g._bsontype==="DBRef")s=Bs(e,l,g,s,i,o,h);else if(g._bsontype==="BSONRegExp")s=ms(e,l,g,s);else if(g._bsontype==="Int32")s=ys(e,l,g,s);else if(g._bsontype==="MinKey"||g._bsontype==="MaxKey")s=Es(e,l,g,s);else if(typeof g._bsontype<"u")throw new q(`Unrecognized or invalid _bsontype: ${String(g._bsontype)}`)}else m==="function"&&o&&(s=ws(e,l,g,s))}else if(t instanceof Map||M1(t)){const E=t.entries();let l=!1;for(;!l;){const g=E.next();if(l=!!g.done,l)continue;const m=g.value?g.value[0]:void 0;let C=g.value?g.value[1]:void 0;typeof(C==null?void 0:C.toBSON)=="function"&&(C=C.toBSON());const S=typeof C;if(typeof m=="string"&&!qu.has(m)){if(m.match(Ji)!=null)throw new q("key "+m+" must not contain null bytes");if(r){if(m[0]==="$")throw new q("key "+m+" must not start with '$'");if(m.includes("."))throw new q("key "+m+" must not contain '.'")}}if(C===void 0)u===!1&&(s=Xr(e,m,C,s));else if(C===null)s=Xr(e,m,C,s);else if(S==="string")s=as(e,m,C,s);else if(S==="number")s=cs(e,m,C,s);else if(S==="bigint")s=ls(e,m,C,s);else if(S==="boolean")s=hs(e,m,C,s);else if(S==="object"&&C._bsontype==null)C instanceof Date||an(C)?s=ds(e,m,C,s):C instanceof Uint8Array||hr(C)?s=As(e,m,C,s):C instanceof RegExp||un(C)?s=fs(e,m,C,s):s=ps(e,m,C,s,r,i,o,u,h);else if(S==="object"){if(C[dn]!==Rr)throw new Nr;if(C._bsontype==="ObjectId")s=gs(e,m,C,s);else if(C._bsontype==="Decimal128")s=Cs(e,m,C,s);else if(C._bsontype==="Long"||C._bsontype==="Timestamp")s=Ss(e,m,C,s);else if(C._bsontype==="Double")s=Os(e,m,C,s);else if(C._bsontype==="Code")s=_s(e,m,C,s,r,i,o,u,h);else if(C._bsontype==="Binary")s=Ds(e,m,C,s);else if(C._bsontype==="BSONSymbol")s=Ts(e,m,C,s);else if(C._bsontype==="DBRef")s=Bs(e,m,C,s,i,o,h);else if(C._bsontype==="BSONRegExp")s=ms(e,m,C,s);else if(C._bsontype==="Int32")s=ys(e,m,C,s);else if(C._bsontype==="MinKey"||C._bsontype==="MaxKey")s=Es(e,m,C,s);else if(typeof C._bsontype<"u")throw new q(`Unrecognized or invalid _bsontype: ${String(C._bsontype)}`)}else S==="function"&&o&&(s=ws(e,m,C,s))}}else{if(typeof(t==null?void 0:t.toBSON)=="function"&&(t=t.toBSON(),t!=null&&typeof t!="object"))throw new q("toBSON function did not return an object");for(const E of Object.keys(t)){let l=t[E];typeof(l==null?void 0:l.toBSON)=="function"&&(l=l.toBSON());const g=typeof l;if(typeof E=="string"&&!qu.has(E)){if(E.match(Ji)!=null)throw new q("key "+E+" must not contain null bytes");if(r){if(E[0]==="$")throw new q("key "+E+" must not start with '$'");if(E.includes("."))throw new q("key "+E+" must not contain '.'")}}if(l===void 0)u===!1&&(s=Xr(e,E,l,s));else if(l===null)s=Xr(e,E,l,s);else if(g==="string")s=as(e,E,l,s);else if(g==="number")s=cs(e,E,l,s);else if(g==="bigint")s=ls(e,E,l,s);else if(g==="boolean")s=hs(e,E,l,s);else if(g==="object"&&l._bsontype==null)l instanceof Date||an(l)?s=ds(e,E,l,s):l instanceof Uint8Array||hr(l)?s=As(e,E,l,s):l instanceof RegExp||un(l)?s=fs(e,E,l,s):s=ps(e,E,l,s,r,i,o,u,h);else if(g==="object"){if(l[dn]!==Rr)throw new Nr;if(l._bsontype==="ObjectId")s=gs(e,E,l,s);else if(l._bsontype==="Decimal128")s=Cs(e,E,l,s);else if(l._bsontype==="Long"||l._bsontype==="Timestamp")s=Ss(e,E,l,s);else if(l._bsontype==="Double")s=Os(e,E,l,s);else if(l._bsontype==="Code")s=_s(e,E,l,s,r,i,o,u,h);else if(l._bsontype==="Binary")s=Ds(e,E,l,s);else if(l._bsontype==="BSONSymbol")s=Ts(e,E,l,s);else if(l._bsontype==="DBRef")s=Bs(e,E,l,s,i,o,h);else if(l._bsontype==="BSONRegExp")s=ms(e,E,l,s);else if(l._bsontype==="Int32")s=ys(e,E,l,s);else if(l._bsontype==="MinKey"||l._bsontype==="MaxKey")s=Es(e,E,l,s);else if(typeof l._bsontype<"u")throw new q(`Unrecognized or invalid _bsontype: ${String(l._bsontype)}`)}else g==="function"&&o&&(s=ws(e,E,l,s))}}h.delete(t),e[s++]=0;const a=s-n;return n+=ue.setInt32LE(e,n,a),s}function U2(e){return e!=null&&typeof e=="object"&&"_bsontype"in e&&typeof e._bsontype=="string"}const j2={$oid:Er,$binary:je,$uuid:je,$symbol:Vr,$numberInt:er,$numberDecimal:$e,$numberDouble:Ot,$numberLong:ie,$minKey:zr,$maxKey:xr,$regex:wt,$regularExpression:wt,$timestamp:vr};function n0(e,t={}){if(typeof e=="number"){const n=e<=ti&&e>=ri,i=e<=Pc&&e>=Lc;if(t.relaxed||t.legacy)return e;if(Number.isInteger(e)&&!Object.is(e,-0)){if(n)return new er(e);if(i)return t.useBigInt64?BigInt(e):ie.fromNumber(e)}return new Ot(e)}if(e==null||typeof e!="object")return e;if(e.$undefined)return null;const r=Object.keys(e).filter(n=>n.startsWith("$")&&e[n]!=null);for(let n=0;n<r.length;n++){const i=j2[r[n]];if(i)return i.fromExtendedJSON(e,t)}if(e.$date!=null){const n=e.$date,i=new Date;if(t.legacy)if(typeof n=="number")i.setTime(n);else if(typeof n=="string")i.setTime(Date.parse(n));else if(typeof n=="bigint")i.setTime(Number(n));else throw new Xi(`Unrecognized type for EJSON date: ${typeof n}`);else if(typeof n=="string")i.setTime(Date.parse(n));else if(ie.isLong(n))i.setTime(n.toNumber());else if(typeof n=="number"&&t.relaxed)i.setTime(n);else if(typeof n=="bigint")i.setTime(Number(n));else throw new Xi(`Unrecognized type for EJSON date: ${typeof n}`);return i}if(e.$code!=null){const n=Object.assign({},e);return e.$scope&&(n.$scope=n0(e.$scope)),$t.fromExtendedJSON(e)}if($c(e)||e.$dbPointer){const n=e.$ref?e:e.$dbPointer;if(n instanceof Gt)return n;const i=Object.keys(n).filter(u=>u.startsWith("$"));let o=!0;if(i.forEach(u=>{["$ref","$id","$db"].indexOf(u)===-1&&(o=!1)}),o)return Gt.fromExtendedJSON(n)}return e}function x2(e,t){return e.map((r,n)=>{t.seenObjects.push({propertyName:`index ${n}`,obj:null});try{return Qt(r,t)}finally{t.seenObjects.pop()}})}function Hu(e){const t=e.toISOString();return e.getUTCMilliseconds()!==0?t:t.slice(0,-5)+"Z"}function Qt(e,t){if(e instanceof Map||M1(e)){const r=Object.create(null);for(const[n,i]of e){if(typeof n!="string")throw new q("Can only serialize maps with string keys");r[n]=i}return Qt(r,t)}if((typeof e=="object"||typeof e=="function")&&e!==null){const r=t.seenObjects.findIndex(n=>n.obj===e);if(r!==-1){const n=t.seenObjects.map(E=>E.propertyName),i=n.slice(0,r).map(E=>`${E} -> `).join(""),o=n[r],u=" -> "+n.slice(r+1,n.length-1).map(E=>`${E} -> `).join(""),h=n[n.length-1],s=" ".repeat(i.length+o.length/2),a="-".repeat(u.length+(o.length+h.length)/2-1);throw new q(`Converting circular structure to EJSON:
6
+ ${i}${o}${u}${h}
7
+ ${s}\\${a}/`)}t.seenObjects[t.seenObjects.length-1].obj=e}if(Array.isArray(e))return x2(e,t);if(e===void 0)return t.ignoreUndefined?void 0:null;if(e instanceof Date||an(e)){const r=e.getTime(),n=r>-1&&r<2534023188e5;return t.legacy?t.relaxed&&n?{$date:e.getTime()}:{$date:Hu(e)}:t.relaxed&&n?{$date:Hu(e)}:{$date:{$numberLong:e.getTime().toString()}}}if(typeof e=="number"&&(!t.relaxed||!isFinite(e))){if(Number.isInteger(e)&&!Object.is(e,-0)){if(e>=ri&&e<=ti)return{$numberInt:e.toString()};if(e>=Lc&&e<=Pc)return{$numberLong:e.toString()}}return{$numberDouble:Object.is(e,-0)?"-0.0":e.toString()}}if(typeof e=="bigint")return t.relaxed?Number(BigInt.asIntN(64,e)):{$numberLong:BigInt.asIntN(64,e).toString()};if(e instanceof RegExp||un(e)){let r=e.flags;if(r===void 0){const i=e.toString().match(/[gimuy]*$/);i&&(r=i[0])}return new wt(e.source,r).toExtendedJSON(t)}return e!=null&&typeof e=="object"?V2(e,t):e}const z2={Binary:e=>new je(e.value(),e.sub_type),Code:e=>new $t(e.code,e.scope),DBRef:e=>new Gt(e.collection||e.namespace,e.oid,e.db,e.fields),Decimal128:e=>new $e(e.bytes),Double:e=>new Ot(e.value),Int32:e=>new er(e.value),Long:e=>ie.fromBits(e.low!=null?e.low:e.low_,e.low!=null?e.high:e.high_,e.low!=null?e.unsigned:e.unsigned_),MaxKey:()=>new xr,MinKey:()=>new zr,ObjectId:e=>new Er(e),BSONRegExp:e=>new wt(e.pattern,e.options),BSONSymbol:e=>new Vr(e.value),Timestamp:e=>vr.fromBits(e.low,e.high)};function V2(e,t){if(e==null||typeof e!="object")throw new q("not an object instance");const r=e._bsontype;if(typeof r>"u"){const n={};for(const i of Object.keys(e)){t.seenObjects.push({propertyName:i,obj:null});try{const o=Qt(e[i],t);i==="__proto__"?Object.defineProperty(n,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):n[i]=o}finally{t.seenObjects.pop()}}return n}else{if(e!=null&&typeof e=="object"&&typeof e._bsontype=="string"&&e[dn]!==Rr)throw new Nr;if(U2(e)){let n=e;if(typeof n.toExtendedJSON!="function"){const i=z2[e._bsontype];if(!i)throw new q("Unrecognized or invalid _bsontype: "+e._bsontype);n=i(n)}return r==="Code"&&n.scope?n=new $t(n.code,Qt(n.scope,t)):r==="DBRef"&&n.oid&&(n=new Gt(Qt(n.collection,t),Qt(n.oid,t),Qt(n.db,t),Qt(n.fields,t))),n.toExtendedJSON(t)}else throw new q("_bsontype must be a string, but was: "+typeof r)}}function i0(e,t){const r={useBigInt64:(t==null?void 0:t.useBigInt64)??!1,relaxed:(t==null?void 0:t.relaxed)??!0,legacy:(t==null?void 0:t.legacy)??!1};return JSON.parse(e,(n,i)=>{if(n.indexOf("\0")!==-1)throw new q(`BSON Document field names cannot contain null bytes, found: ${JSON.stringify(n)}`);return n0(i,r)})}function o0(e,t,r,n){r!=null&&typeof r=="object"&&(n=r,r=0),t!=null&&typeof t=="object"&&!Array.isArray(t)&&(n=t,t=void 0,r=0);const i=Object.assign({relaxed:!0,legacy:!1},n,{seenObjects:[{propertyName:"(root)",obj:null}]}),o=Qt(e,i);return JSON.stringify(o,t,r)}function W2(e,t){return t=t||{},JSON.parse(o0(e,t))}function G2(e,t){return t=t||{},i0(JSON.stringify(e),t)}const Wr=Object.create(null);Wr.parse=i0;Wr.stringify=o0;Wr.serialize=W2;Wr.deserialize=G2;Object.freeze(Wr);const Pe={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 bs(e,t){try{return ue.getNonnegativeInt32LE(e,t)}catch(r){throw new xt("BSON size cannot be negative",t,{cause:r})}}function Ms(e,t){let r=t;for(;e[r]!==0;r++);if(r===e.length-1)throw new xt("Null terminator not found",t);return r}function q2(e,t=0){if(t??(t=0),e.length<5)throw new xt(`Input must be at least 5 bytes, got ${e.length} bytes`,t);const r=bs(e,t);if(r>e.length-t)throw new xt(`Parsed documentSize (${r} bytes) does not match input length (${e.length} bytes)`,t);if(e[t+r-1]!==0)throw new xt("BSON documents must end in 0x00",t+r);const n=[];let i=t+4;for(;i<=r+t;){const o=e[i];if(i+=1,o===0){if(i-t!==r)throw new xt("Invalid 0x00 type byte",i);break}const u=i,h=Ms(e,i)-u;i+=h+1;let s;if(o===Pe.double||o===Pe.long||o===Pe.date||o===Pe.timestamp)s=8;else if(o===Pe.int)s=4;else if(o===Pe.objectId)s=12;else if(o===Pe.decimal)s=16;else if(o===Pe.bool)s=1;else if(o===Pe.null||o===Pe.undefined||o===Pe.maxKey||o===Pe.minKey)s=0;else if(o===Pe.regex)s=Ms(e,Ms(e,i)+1)+1-i;else if(o===Pe.object||o===Pe.array||o===Pe.javascriptWithScope)s=bs(e,i);else if(o===Pe.string||o===Pe.binData||o===Pe.dbPointer||o===Pe.javascript||o===Pe.symbol)s=bs(e,i)+4,o===Pe.binData&&(s+=1),o===Pe.dbPointer&&(s+=12);else throw new xt(`Invalid 0x${o.toString(16).padStart(2,"0")} type byte`,i);if(s>r)throw new xt("value reports length larger than document",i);n.push([o,u,h,i,s]),i+=s}return n}const An=Object.create(null);An.parseToElements=q2;An.ByteUtils=W;An.NumberUtils=ue;Object.freeze(An);const s0=1024*1024*17;let dr=W.allocate(s0);function u0(e){dr.length<e&&(dr=W.allocate(e))}function a0(e,t={}){const r=typeof t.checkKeys=="boolean"?t.checkKeys:!1,n=typeof t.serializeFunctions=="boolean"?t.serializeFunctions:!1,i=typeof t.ignoreUndefined=="boolean"?t.ignoreUndefined:!0,o=typeof t.minInternalBufferSize=="number"?t.minInternalBufferSize:s0;dr.length<o&&(dr=W.allocate(o));const u=ni(dr,e,r,0,0,n,i,null),h=W.allocateUnsafe(u);return h.set(dr.subarray(0,u),0),h}function c0(e,t,r={}){const n=typeof r.checkKeys=="boolean"?r.checkKeys:!1,i=typeof r.serializeFunctions=="boolean"?r.serializeFunctions:!1,o=typeof r.ignoreUndefined=="boolean"?r.ignoreUndefined:!0,u=typeof r.index=="number"?r.index:0,h=ni(dr,e,n,0,0,i,o,null);return t.set(dr.subarray(0,h),u),u+h-1}function l0(e,t={}){return r0(W.toLocalBufferType(e),t)}function h0(e,t={}){t=t||{};const r=typeof t.serializeFunctions=="boolean"?t.serializeFunctions:!1,n=typeof t.ignoreUndefined=="boolean"?t.ignoreUndefined:!0;return xi(e,r,n)}function d0(e,t,r,n,i,o){const u=Object.assign({allowObjectSmallerThanBufferSize:!0,index:0},o),h=W.toLocalBufferType(e);let s=t;for(let a=0;a<r;a++){const E=ue.getInt32LE(h,s);u.index=s,n[i+a]=r0(h,u),s=s+E}return s}var H2=Object.freeze({__proto__:null,BSONError:q,BSONOffsetError:xt,BSONRegExp:wt,BSONRuntimeError:Xi,BSONSymbol:Vr,BSONType:Jc,BSONValue:at,BSONVersionError:Nr,Binary:je,ByteUtils:W,Code:$t,DBRef:Gt,Decimal128:$e,Double:Ot,EJSON:Wr,Int32:er,Long:ie,MaxKey:xr,MinKey:zr,NumberUtils:ue,ObjectId:Er,Timestamp:vr,UUID:Xe,bsonType:co,calculateObjectSize:h0,deserialize:l0,deserializeStream:d0,onDemand:An,serialize:a0,serializeWithBufferAndIndex:c0,setInternalBufferSize:u0});Oe.BSON=H2;Oe.BSONError=q;Oe.BSONOffsetError=xt;Oe.BSONRegExp=wt;Oe.BSONRuntimeError=Xi;Oe.BSONSymbol=Vr;Oe.BSONType=Jc;Oe.BSONValue=at;Oe.BSONVersionError=Nr;Oe.Binary=je;Oe.ByteUtils=W;Oe.Code=$t;Oe.DBRef=Gt;Oe.Decimal128=$e;Oe.Double=Ot;Oe.EJSON=Wr;Oe.Int32=er;Oe.Long=ie;Oe.MaxKey=xr;Oe.MinKey=zr;Oe.NumberUtils=ue;Oe.ObjectId=Er;Oe.Timestamp=vr;Oe.UUID=Xe;Oe.bsonType=co;Oe.calculateObjectSize=h0;Oe.deserialize=l0;Oe.deserializeStream=d0;Oe.onDemand=An;Oe.serialize=a0;Oe.serializeWithBufferAndIndex=c0;Oe.setInternalBufferSize=u0;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toUTF8=e.getBigInt64LE=e.getFloat64LE=e.getInt32LE=e.UUID=e.Timestamp=e.serialize=e.ObjectId=e.NumberUtils=e.MinKey=e.MaxKey=e.Long=e.Int32=e.EJSON=e.Double=e.deserialize=e.Decimal128=e.DBRef=e.Code=e.calculateObjectSize=e.BSONType=e.BSONSymbol=e.BSONRegExp=e.BSONError=e.BSON=e.Binary=void 0,e.parseToElementsToArray=n,e.pluckBSONSerializeOptions=i,e.resolveBSONOptions=o,e.parseUtf8ValidationOption=u;const t=Oe;var r=Oe;Object.defineProperty(e,"Binary",{enumerable:!0,get:function(){return r.Binary}}),Object.defineProperty(e,"BSON",{enumerable:!0,get:function(){return r.BSON}}),Object.defineProperty(e,"BSONError",{enumerable:!0,get:function(){return r.BSONError}}),Object.defineProperty(e,"BSONRegExp",{enumerable:!0,get:function(){return r.BSONRegExp}}),Object.defineProperty(e,"BSONSymbol",{enumerable:!0,get:function(){return r.BSONSymbol}}),Object.defineProperty(e,"BSONType",{enumerable:!0,get:function(){return r.BSONType}}),Object.defineProperty(e,"calculateObjectSize",{enumerable:!0,get:function(){return r.calculateObjectSize}}),Object.defineProperty(e,"Code",{enumerable:!0,get:function(){return r.Code}}),Object.defineProperty(e,"DBRef",{enumerable:!0,get:function(){return r.DBRef}}),Object.defineProperty(e,"Decimal128",{enumerable:!0,get:function(){return r.Decimal128}}),Object.defineProperty(e,"deserialize",{enumerable:!0,get:function(){return r.deserialize}}),Object.defineProperty(e,"Double",{enumerable:!0,get:function(){return r.Double}}),Object.defineProperty(e,"EJSON",{enumerable:!0,get:function(){return r.EJSON}}),Object.defineProperty(e,"Int32",{enumerable:!0,get:function(){return r.Int32}}),Object.defineProperty(e,"Long",{enumerable:!0,get:function(){return r.Long}}),Object.defineProperty(e,"MaxKey",{enumerable:!0,get:function(){return r.MaxKey}}),Object.defineProperty(e,"MinKey",{enumerable:!0,get:function(){return r.MinKey}}),Object.defineProperty(e,"NumberUtils",{enumerable:!0,get:function(){return r.NumberUtils}}),Object.defineProperty(e,"ObjectId",{enumerable:!0,get:function(){return r.ObjectId}}),Object.defineProperty(e,"serialize",{enumerable:!0,get:function(){return r.serialize}}),Object.defineProperty(e,"Timestamp",{enumerable:!0,get:function(){return r.Timestamp}}),Object.defineProperty(e,"UUID",{enumerable:!0,get:function(){return r.UUID}});function n(h,s){const a=t.BSON.onDemand.parseToElements(h,s);return Array.isArray(a)?a:[...a]}e.getInt32LE=t.BSON.onDemand.NumberUtils.getInt32LE,e.getFloat64LE=t.BSON.onDemand.NumberUtils.getFloat64LE,e.getBigInt64LE=t.BSON.onDemand.NumberUtils.getBigInt64LE,e.toUTF8=t.BSON.onDemand.ByteUtils.toUTF8;function i(h){const{fieldsAsRaw:s,useBigInt64:a,promoteValues:E,promoteBuffers:l,promoteLongs:g,serializeFunctions:m,ignoreUndefined:C,bsonRegExp:S,raw:D,enableUtf8Validation:O}=h;return{fieldsAsRaw:s,useBigInt64:a,promoteValues:E,promoteBuffers:l,promoteLongs:g,serializeFunctions:m,ignoreUndefined:C,bsonRegExp:S,raw:D,enableUtf8Validation:O}}function o(h,s){const a=s==null?void 0:s.bsonOptions;return{raw:(h==null?void 0:h.raw)??(a==null?void 0:a.raw)??!1,useBigInt64:(h==null?void 0:h.useBigInt64)??(a==null?void 0:a.useBigInt64)??!1,promoteLongs:(h==null?void 0:h.promoteLongs)??(a==null?void 0:a.promoteLongs)??!0,promoteValues:(h==null?void 0:h.promoteValues)??(a==null?void 0:a.promoteValues)??!0,promoteBuffers:(h==null?void 0:h.promoteBuffers)??(a==null?void 0:a.promoteBuffers)??!1,ignoreUndefined:(h==null?void 0:h.ignoreUndefined)??(a==null?void 0:a.ignoreUndefined)??!1,bsonRegExp:(h==null?void 0:h.bsonRegExp)??(a==null?void 0:a.bsonRegExp)??!1,serializeFunctions:(h==null?void 0:h.serializeFunctions)??(a==null?void 0:a.serializeFunctions)??!1,fieldsAsRaw:(h==null?void 0:h.fieldsAsRaw)??(a==null?void 0:a.fieldsAsRaw)??{},enableUtf8Validation:(h==null?void 0:h.enableUtf8Validation)??(a==null?void 0:a.enableUtf8Validation)??!0}}function u(h){return(h==null?void 0:h.enableUtf8Validation)===!1?{utf8:!1}:{utf8:{writeErrors:!1}}}})(pe);var qe={},fe={};Object.defineProperty(fe,"__esModule",{value:!0});fe.OP_MSG=fe.OP_COMPRESSED=fe.OP_DELETE=fe.OP_QUERY=fe.OP_INSERT=fe.OP_UPDATE=fe.OP_REPLY=fe.MIN_SUPPORTED_RAW_DATA_SERVER_VERSION=fe.MIN_SUPPORTED_RAW_DATA_WIRE_VERSION=fe.MIN_SUPPORTED_QE_SERVER_VERSION=fe.MIN_SUPPORTED_QE_WIRE_VERSION=fe.MAX_SUPPORTED_WIRE_VERSION=fe.MIN_SUPPORTED_WIRE_VERSION=fe.MIN_SUPPORTED_SNAPSHOT_READS_SERVER_VERSION=fe.MIN_SUPPORTED_SNAPSHOT_READS_WIRE_VERSION=fe.MAX_SUPPORTED_SERVER_VERSION=fe.MIN_SUPPORTED_SERVER_VERSION=void 0;fe.MIN_SUPPORTED_SERVER_VERSION="4.2";fe.MAX_SUPPORTED_SERVER_VERSION="8.2";fe.MIN_SUPPORTED_SNAPSHOT_READS_WIRE_VERSION=13;fe.MIN_SUPPORTED_SNAPSHOT_READS_SERVER_VERSION="5.0";fe.MIN_SUPPORTED_WIRE_VERSION=8;fe.MAX_SUPPORTED_WIRE_VERSION=27;fe.MIN_SUPPORTED_QE_WIRE_VERSION=21;fe.MIN_SUPPORTED_QE_SERVER_VERSION="7.0";fe.MIN_SUPPORTED_RAW_DATA_WIRE_VERSION=27;fe.MIN_SUPPORTED_RAW_DATA_SERVER_VERSION="8.2";fe.OP_REPLY=1;fe.OP_UPDATE=2001;fe.OP_INSERT=2002;fe.OP_QUERY=2004;fe.OP_DELETE=2006;fe.OP_COMPRESSED=2012;fe.OP_MSG=2013;var Q={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MongoWriteConcernError=e.MongoServerSelectionError=e.MongoSystemError=e.MongoMissingDependencyError=e.MongoMissingCredentialsError=e.MongoCompatibilityError=e.MongoInvalidArgumentError=e.MongoParseError=e.MongoNetworkTimeoutError=e.MongoNetworkError=e.MongoClientClosedError=e.MongoTopologyClosedError=e.MongoCursorExhaustedError=e.MongoServerClosedError=e.MongoCursorInUseError=e.MongoOperationTimeoutError=e.MongoUnexpectedServerResponseError=e.MongoGridFSChunkError=e.MongoGridFSStreamError=e.MongoTailableCursorError=e.MongoChangeStreamError=e.MongoClientBulkWriteExecutionError=e.MongoClientBulkWriteCursorError=e.MongoClientBulkWriteError=e.MongoGCPError=e.MongoAzureError=e.MongoOIDCError=e.MongoAWSError=e.MongoKerberosError=e.MongoExpiredSessionError=e.MongoTransactionError=e.MongoNotConnectedError=e.MongoDecompressionError=e.MongoBatchReExecutionError=e.MongoStalePrimaryError=e.MongoRuntimeError=e.MongoAPIError=e.MongoDriverError=e.MongoServerError=e.MongoError=e.MongoErrorLabel=e.GET_MORE_RESUMABLE_CODES=e.MONGODB_ERROR_CODES=e.NODE_IS_RECOVERING_ERROR_MESSAGE=e.LEGACY_NOT_PRIMARY_OR_SECONDARY_ERROR_MESSAGE=e.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE=void 0,e.needsRetryableWriteLabel=ce,e.isRetryableWriteError=le,e.isRetryableReadError=he,e.isNodeShuttingDownError=nt,e.isStateChangeError=k,e.isNetworkTimeoutError=P,e.isResumableError=X,e.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE=new RegExp("not master","i"),e.LEGACY_NOT_PRIMARY_OR_SECONDARY_ERROR_MESSAGE=new RegExp("not master or secondary","i"),e.NODE_IS_RECOVERING_ERROR_MESSAGE=new RegExp("node is recovering","i"),e.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}),e.GET_MORE_RESUMABLE_CODES=new Set([e.MONGODB_ERROR_CODES.HostUnreachable,e.MONGODB_ERROR_CODES.HostNotFound,e.MONGODB_ERROR_CODES.NetworkTimeout,e.MONGODB_ERROR_CODES.ShutdownInProgress,e.MONGODB_ERROR_CODES.PrimarySteppedDown,e.MONGODB_ERROR_CODES.ExceededTimeLimit,e.MONGODB_ERROR_CODES.SocketException,e.MONGODB_ERROR_CODES.NotWritablePrimary,e.MONGODB_ERROR_CODES.InterruptedAtShutdown,e.MONGODB_ERROR_CODES.InterruptedDueToReplStateChange,e.MONGODB_ERROR_CODES.NotPrimaryNoSecondaryOk,e.MONGODB_ERROR_CODES.NotPrimaryOrSecondary,e.MONGODB_ERROR_CODES.StaleShardVersion,e.MONGODB_ERROR_CODES.StaleEpoch,e.MONGODB_ERROR_CODES.StaleConfig,e.MONGODB_ERROR_CODES.RetryChangeStream,e.MONGODB_ERROR_CODES.FailedToSatisfyReadPreference,e.MONGODB_ERROR_CODES.CursorNotFound]),e.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 t(V){return V!=null&&typeof V=="object"&&"errors"in V&&Array.isArray(V.errors)}class r extends Error{get errorLabels(){return Array.from(this.errorLabelSet)}constructor(z,Z){super(z,Z),this.errorLabelSet=new Set}static buildErrorMessage(z){return typeof z=="string"?z:t(z)&&z.message.length===0?z.errors.length===0?"AggregateError has an empty errors array. Please check the `cause` property for more information.":z.errors.map(({message:Z})=>Z).join(", "):z!=null&&typeof z=="object"&&"message"in z&&typeof z.message=="string"?z.message:"empty error message"}get name(){return"MongoError"}get errmsg(){return this.message}hasErrorLabel(z){return this.errorLabelSet.has(z)}addErrorLabel(z){this.errorLabelSet.add(z)}}e.MongoError=r;class n extends r{constructor(z){if(super(z.message||z.errmsg||z.$err||"n/a"),z.errorLabels)for(const Z of z.errorLabels)this.addErrorLabel(Z);this.errorResponse=z;for(const Z in z)Z!=="errorLabels"&&Z!=="errmsg"&&Z!=="message"&&Z!=="errorResponse"&&(this[Z]=z[Z])}get name(){return"MongoServerError"}}e.MongoServerError=n;class i extends r{constructor(z,Z){super(z,Z)}get name(){return"MongoDriverError"}}e.MongoDriverError=i;class o extends i{constructor(z,Z){super(z,Z)}get name(){return"MongoAPIError"}}e.MongoAPIError=o;class u extends i{constructor(z,Z){super(z,Z)}get name(){return"MongoRuntimeError"}}e.MongoRuntimeError=u;class h extends u{constructor(z,Z){super(z,Z)}get name(){return"MongoStalePrimaryError"}}e.MongoStalePrimaryError=h;class s extends o{constructor(z="This batch has already been executed, create new batch to execute"){super(z)}get name(){return"MongoBatchReExecutionError"}}e.MongoBatchReExecutionError=s;class a extends u{constructor(z){super(z)}get name(){return"MongoDecompressionError"}}e.MongoDecompressionError=a;class E extends o{constructor(z){super(z)}get name(){return"MongoNotConnectedError"}}e.MongoNotConnectedError=E;class l extends o{constructor(z){super(z)}get name(){return"MongoTransactionError"}}e.MongoTransactionError=l;class g extends o{constructor(z="Cannot use a session that has ended"){super(z)}get name(){return"MongoExpiredSessionError"}}e.MongoExpiredSessionError=g;class m extends u{constructor(z){super(z)}get name(){return"MongoKerberosError"}}e.MongoKerberosError=m;class C extends u{constructor(z,Z){super(z,Z)}get name(){return"MongoAWSError"}}e.MongoAWSError=C;class S extends u{constructor(z){super(z)}get name(){return"MongoOIDCError"}}e.MongoOIDCError=S;class D extends S{constructor(z){super(z)}get name(){return"MongoAzureError"}}e.MongoAzureError=D;class O extends S{constructor(z){super(z)}get name(){return"MongoGCPError"}}e.MongoGCPError=O;class M extends n{constructor(z){super(z),this.writeConcernErrors=[],this.writeErrors=new Map}get name(){return"MongoClientBulkWriteError"}}e.MongoClientBulkWriteError=M;class p extends u{constructor(z){super(z)}get name(){return"MongoClientBulkWriteCursorError"}}e.MongoClientBulkWriteCursorError=p;class B extends u{constructor(z){super(z)}get name(){return"MongoClientBulkWriteExecutionError"}}e.MongoClientBulkWriteExecutionError=B;class d extends u{constructor(z){super(z)}get name(){return"MongoChangeStreamError"}}e.MongoChangeStreamError=d;class b extends o{constructor(z="Tailable cursor does not support this operation"){super(z)}get name(){return"MongoTailableCursorError"}}e.MongoTailableCursorError=b;class f extends u{constructor(z){super(z)}get name(){return"MongoGridFSStreamError"}}e.MongoGridFSStreamError=f;class c extends u{constructor(z){super(z)}get name(){return"MongoGridFSChunkError"}}e.MongoGridFSChunkError=c;class w extends u{constructor(z,Z){super(z,Z)}get name(){return"MongoUnexpectedServerResponseError"}}e.MongoUnexpectedServerResponseError=w;class T extends i{get name(){return"MongoOperationTimeoutError"}}e.MongoOperationTimeoutError=T;class _ extends o{constructor(z="Cursor is already initialized"){super(z)}get name(){return"MongoCursorInUseError"}}e.MongoCursorInUseError=_;class A extends o{constructor(z="Server is closed"){super(z)}get name(){return"MongoServerClosedError"}}e.MongoServerClosedError=A;class y extends o{constructor(z){super(z||"Cursor is exhausted")}get name(){return"MongoCursorExhaustedError"}}e.MongoCursorExhaustedError=y;class F extends o{constructor(z="Topology is closed"){super(z)}get name(){return"MongoTopologyClosedError"}}e.MongoTopologyClosedError=F;class R extends o{constructor(){super("Operation interrupted because client was closed")}get name(){return"MongoClientClosedError"}}e.MongoClientClosedError=R;class v extends r{constructor(z,Z){super(z,{cause:Z==null?void 0:Z.cause}),this.beforeHandshake=!!(Z!=null&&Z.beforeHandshake)}get name(){return"MongoNetworkError"}}e.MongoNetworkError=v;class J extends v{constructor(z,Z){super(z,Z)}get name(){return"MongoNetworkTimeoutError"}}e.MongoNetworkTimeoutError=J;class I extends i{constructor(z){super(z)}get name(){return"MongoParseError"}}e.MongoParseError=I;class N extends o{constructor(z,Z){super(z,Z)}get name(){return"MongoInvalidArgumentError"}}e.MongoInvalidArgumentError=N;class j extends o{constructor(z){super(z)}get name(){return"MongoCompatibilityError"}}e.MongoCompatibilityError=j;class x extends o{constructor(z){super(z)}get name(){return"MongoMissingCredentialsError"}}e.MongoMissingCredentialsError=x;class Y extends o{constructor(z,Z){super(z,Z),this.dependencyName=Z.dependencyName}get name(){return"MongoMissingDependencyError"}}e.MongoMissingDependencyError=Y;class $ extends r{constructor(z,Z){var Be;Z&&Z.error?super(r.buildErrorMessage(Z.error.message||Z.error),{cause:Z.error}):super(z),Z&&(this.reason=Z),this.code=(Be=Z.error)==null?void 0:Be.code}get name(){return"MongoSystemError"}}e.MongoSystemError=$;class K extends ${constructor(z,Z){super(z,Z)}get name(){return"MongoServerSelectionError"}}e.MongoServerSelectionError=K;class ee extends n{constructor(z){super({...z.writeConcernError,...z}),this.errInfo=z.writeConcernError.errInfo,this.result=z}get name(){return"MongoWriteConcernError"}}e.MongoWriteConcernError=ee;const ae=new Set([e.MONGODB_ERROR_CODES.HostUnreachable,e.MONGODB_ERROR_CODES.HostNotFound,e.MONGODB_ERROR_CODES.NetworkTimeout,e.MONGODB_ERROR_CODES.ShutdownInProgress,e.MONGODB_ERROR_CODES.PrimarySteppedDown,e.MONGODB_ERROR_CODES.SocketException,e.MONGODB_ERROR_CODES.NotWritablePrimary,e.MONGODB_ERROR_CODES.InterruptedAtShutdown,e.MONGODB_ERROR_CODES.InterruptedDueToReplStateChange,e.MONGODB_ERROR_CODES.NotPrimaryNoSecondaryOk,e.MONGODB_ERROR_CODES.NotPrimaryOrSecondary,e.MONGODB_ERROR_CODES.ExceededTimeLimit,e.MONGODB_ERROR_CODES.ReadConcernMajorityNotAvailableYet]),ye=ae;function ce(V,z,Z){if(V instanceof v)return!0;if(V instanceof r&&(z>=9||le(V))&&!V.hasErrorLabel(e.MongoErrorLabel.HandshakeError))return!1;if(V instanceof ee){if(Z==="Mongos"&&z<9)return ye.has(V.result.code??0);const it=V.result.writeConcernError.code??Number(V.code);return ye.has(Number.isNaN(it)?0:it)}return V instanceof r?ye.has(Number(V.code)):!!(e.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE.test(V.message)||e.NODE_IS_RECOVERING_ERROR_MESSAGE.test(V.message))}function le(V){return V.hasErrorLabel(e.MongoErrorLabel.RetryableWriteError)||V.hasErrorLabel(e.MongoErrorLabel.PoolRequestedRetry)}function he(V){return!!((typeof V.code=="number"?ae.has(V.code):!1)||V instanceof v||e.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE.test(V.message)||e.NODE_IS_RECOVERING_ERROR_MESSAGE.test(V.message))}const Ee=new Set([e.MONGODB_ERROR_CODES.ShutdownInProgress,e.MONGODB_ERROR_CODES.PrimarySteppedDown,e.MONGODB_ERROR_CODES.InterruptedAtShutdown,e.MONGODB_ERROR_CODES.InterruptedDueToReplStateChange,e.MONGODB_ERROR_CODES.NotPrimaryOrSecondary]),re=new Set([e.MONGODB_ERROR_CODES.NotWritablePrimary,e.MONGODB_ERROR_CODES.NotPrimaryNoSecondaryOk,e.MONGODB_ERROR_CODES.LegacyNotPrimary]),Ce=new Set([e.MONGODB_ERROR_CODES.InterruptedAtShutdown,e.MONGODB_ERROR_CODES.ShutdownInProgress]);function _e(V){return typeof V.code=="number"?Ee.has(V.code):e.LEGACY_NOT_PRIMARY_OR_SECONDARY_ERROR_MESSAGE.test(V.message)||e.NODE_IS_RECOVERING_ERROR_MESSAGE.test(V.message)}function He(V){return typeof V.code=="number"?re.has(V.code):_e(V)?!1:e.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE.test(V.message)}function nt(V){return!!(typeof V.code=="number"&&Ce.has(V.code))}function k(V){return _e(V)||He(V)}function P(V){return!!(V instanceof v&&V.message.match(/timed out/))}function X(V,z){return V==null||!(V instanceof r)?!1:V instanceof v||V instanceof K?!0:z!=null&&z>=9?V.code===e.MONGODB_ERROR_CODES.CursorNotFound?!0:V.hasErrorLabel(e.MongoErrorLabel.ResumableChangeStreamError):typeof V.code=="number"?e.GET_MORE_RESUMABLE_CODES.has(V.code):!1}})(Q);var Ke={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ReadPreference=e.ReadPreferenceMode=void 0;const t=Q;e.ReadPreferenceMode=Object.freeze({primary:"primary",primaryPreferred:"primaryPreferred",secondary:"secondary",secondaryPreferred:"secondaryPreferred",nearest:"nearest"});const n=class n{constructor(o,u,h){if(!n.isValid(o))throw new t.MongoInvalidArgumentError(`Invalid read preference mode ${JSON.stringify(o)}`);if(h==null&&typeof u=="object"&&!Array.isArray(u))h=u,u=void 0;else if(u&&!Array.isArray(u))throw new t.MongoInvalidArgumentError("ReadPreference tags must be an array");if(this.mode=o,this.tags=u,this.hedge=h==null?void 0:h.hedge,this.maxStalenessSeconds=void 0,h=h??{},h.maxStalenessSeconds!=null){if(h.maxStalenessSeconds<=0)throw new t.MongoInvalidArgumentError("maxStalenessSeconds must be a positive integer");this.maxStalenessSeconds=h.maxStalenessSeconds}if(this.mode===n.PRIMARY){if(this.tags&&Array.isArray(this.tags)&&this.tags.length>0)throw new t.MongoInvalidArgumentError("Primary read preference cannot be combined with tags");if(this.maxStalenessSeconds)throw new t.MongoInvalidArgumentError("Primary read preference cannot be combined with maxStalenessSeconds");if(this.hedge)throw new t.MongoInvalidArgumentError("Primary read preference cannot be combined with hedge")}}get preference(){return this.mode}static fromString(o){return new n(o)}static fromOptions(o){var s;if(!o)return;const u=o.readPreference??((s=o.session)==null?void 0:s.transaction.options.readPreference),h=o.readPreferenceTags;if(u!=null){if(typeof u=="string")return new n(u,h,{maxStalenessSeconds:o.maxStalenessSeconds,hedge:o.hedge});if(!(u instanceof n)&&typeof u=="object"){const a=u.mode||u.preference;if(a&&typeof a=="string")return new n(a,u.tags??h,{maxStalenessSeconds:u.maxStalenessSeconds,hedge:o.hedge})}return h&&(u.tags=h),u}}static translate(o){if(o.readPreference==null)return o;const u=o.readPreference;if(typeof u=="string")o.readPreference=new n(u);else if(u&&!(u instanceof n)&&typeof u=="object"){const h=u.mode||u.preference;h&&typeof h=="string"&&(o.readPreference=new n(h,u.tags,{maxStalenessSeconds:u.maxStalenessSeconds}))}else if(!(u instanceof n))throw new t.MongoInvalidArgumentError(`Invalid read preference: ${u}`);return o}static isValid(o){return new Set([n.PRIMARY,n.PRIMARY_PREFERRED,n.SECONDARY,n.SECONDARY_PREFERRED,n.NEAREST,null]).has(o)}isValid(o){return n.isValid(typeof o=="string"?o:this.mode)}secondaryOk(){return new Set([n.PRIMARY_PREFERRED,n.SECONDARY,n.SECONDARY_PREFERRED,n.NEAREST]).has(this.mode)}equals(o){return o.mode===this.mode}toJSON(){const o={mode:this.mode};return Array.isArray(this.tags)&&(o.tags=this.tags),this.maxStalenessSeconds&&(o.maxStalenessSeconds=this.maxStalenessSeconds),this.hedge&&(o.hedge=this.hedge),o}};n.PRIMARY=e.ReadPreferenceMode.primary,n.PRIMARY_PREFERRED=e.ReadPreferenceMode.primaryPreferred,n.SECONDARY=e.ReadPreferenceMode.secondary,n.SECONDARY_PREFERRED=e.ReadPreferenceMode.secondaryPreferred,n.NEAREST=e.ReadPreferenceMode.nearest,n.primary=new n(e.ReadPreferenceMode.primary),n.primaryPreferred=new n(e.ReadPreferenceMode.primaryPreferred),n.secondary=new n(e.ReadPreferenceMode.secondary),n.secondaryPreferred=new n(e.ReadPreferenceMode.secondaryPreferred),n.nearest=new n(e.ReadPreferenceMode.nearest);let r=n;e.ReadPreference=r})(Ke);var pn={},Ne={};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.ServerType=Ne.TopologyType=Ne.STATE_CONNECTED=Ne.STATE_CONNECTING=Ne.STATE_CLOSED=Ne.STATE_CLOSING=void 0;Ne._advanceClusterTime=K2;Ne.STATE_CLOSING="closing";Ne.STATE_CLOSED="closed";Ne.STATE_CONNECTING="connecting";Ne.STATE_CONNECTED="connected";Ne.TopologyType=Object.freeze({Single:"Single",ReplicaSetNoPrimary:"ReplicaSetNoPrimary",ReplicaSetWithPrimary:"ReplicaSetWithPrimary",Sharded:"Sharded",Unknown:"Unknown",LoadBalanced:"LoadBalanced"});Ne.ServerType=Object.freeze({Standalone:"Standalone",Mongos:"Mongos",PossiblePrimary:"PossiblePrimary",RSPrimary:"RSPrimary",RSSecondary:"RSSecondary",RSArbiter:"RSArbiter",RSOther:"RSOther",RSGhost:"RSGhost",Unknown:"Unknown",LoadBalancer:"LoadBalancer"});function K2(e,t){(e.clusterTime==null||t.clusterTime.greaterThan(e.clusterTime.clusterTime))&&(e.clusterTime=t)}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DeprioritizedServers=e.MIN_SECONDARY_WRITE_WIRE_VERSION=void 0,e.writableServerSelector=s,e.sameServerSelector=a,e.secondaryWritableServerSelector=E,e.readPreferenceServerSelector=b;const t=Q,r=Ke,n=Ne,i=1e4,o=90;e.MIN_SECONDARY_WRITE_WIRE_VERSION=13;class u{constructor(c){this.deprioritized=new Set;for(const w of c??[])this.add(w)}add({address:c}){this.deprioritized.add(c)}has({address:c}){return this.deprioritized.has(c)}}e.DeprioritizedServers=u;function h(f,c){const w=f.filter(T=>!c.has(T));return w.length?w:f}function s(){return function(c,w,T){const _=h(w.filter(({isWritable:A})=>A),T);return C(c,_)}}function a(f){return function(w,T,_){return f?T.filter(A=>A.address===f.address&&A.type!==n.ServerType.Unknown):[]}}function E(f,c){return!c||!f||f&&f<e.MIN_SECONDARY_WRITE_WIRE_VERSION?b(r.ReadPreference.primary):b(c)}function l(f,c,w){if(f.maxStalenessSeconds==null||f.maxStalenessSeconds<0)return w;const T=f.maxStalenessSeconds,_=(c.heartbeatFrequencyMS+i)/1e3;if(T<_)throw new t.MongoInvalidArgumentError(`Option "maxStalenessSeconds" must be at least ${_} seconds`);if(T<o)throw new t.MongoInvalidArgumentError(`Option "maxStalenessSeconds" must be at least ${o} seconds`);if(c.type===n.TopologyType.ReplicaSetWithPrimary){const A=Array.from(c.servers.values()).filter(S)[0];return w.filter(y=>{const R=(y.lastUpdateTime-y.lastWriteDate-(A.lastUpdateTime-A.lastWriteDate)+c.heartbeatFrequencyMS)/1e3,v=f.maxStalenessSeconds??0;return R<=v})}if(c.type===n.TopologyType.ReplicaSetNoPrimary){if(w.length===0)return w;const A=w.reduce((y,F)=>F.lastWriteDate>y.lastWriteDate?F:y);return w.filter(y=>{const R=(A.lastWriteDate-y.lastWriteDate+c.heartbeatFrequencyMS)/1e3,v=f.maxStalenessSeconds??0;return R<=v})}return w}function g(f,c){return Object.entries(f).every(([w,T])=>c[w]!=null&&c[w]===T)}function m({tags:f},c){if(f==null||f.length===0)return c;for(const w of f){const T=c.filter(_=>g(w,_.tags));if(T.length)return T}return[]}function C(f,c){const w=c.reduce((_,A)=>Math.min(A.roundTripTime,_),1/0),T=w+f.localThresholdMS;return c.filter(_=>_.roundTripTime<=T&&_.roundTripTime>=w)}function S(f){return f.type===n.ServerType.RSPrimary}function D(f){return f.type===n.ServerType.RSSecondary}function O(f){return f.type===n.ServerType.RSSecondary||f.type===n.ServerType.RSPrimary}function M(f){return f.type!==n.ServerType.Unknown}function p(f){return f.type===n.ServerType.LoadBalancer}function B(f){return c=>!f.has(c)}function d(f,c,w,T){const _=f.mode;switch(_){case"primary":return w.filter(S);case"primaryPreferred":{const A=w.filter(S),y=A.filter(B(T));if(y.length)return y;const F=m(f,l(f,c,w.filter(D))),R=F.filter(B(T));return R.length?C(c,R):A.length?A:C(c,F)}case"nearest":{const A=h(m(f,l(f,c,w.filter(O))),T);return C(c,A)}case"secondary":case"secondaryPreferred":{const A=m(f,l(f,c,w.filter(D))),y=A.filter(B(T));if(y.length)return C(c,y);if(_===r.ReadPreference.SECONDARY_PREFERRED){const F=w.filter(S),R=F.filter(B(T));return R.length?R:A.length?C(c,A):F}return C(c,A)}default:throw new t.MongoRuntimeError(`unexpected readPreference=${_} (should never happen). Please report a bug in the Node driver Jira project.`)}}function b(f){if(!f.isValid())throw new t.MongoInvalidArgumentError("Invalid read preference specified");return function(w,T,_){switch(w.type){case"Single":return C(w,T.filter(M));case"ReplicaSetNoPrimary":case"ReplicaSetWithPrimary":return d(f,w,T,_);case"Sharded":{const A=h(T,_);return C(w,A.filter(M))}case"Unknown":return[];case"LoadBalanced":return T.filter(p);default:throw w.type,new t.MongoRuntimeError(`unexpected topology type: ${w.type} (this should never happen). Please file a bug in the Node driver Jira project.`)}}}})(pn);var Te={},Fs={},Ve={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.END=e.CHANGE=e.INIT=e.MORE=e.RESPONSE=e.SERVER_HEARTBEAT_FAILED=e.SERVER_HEARTBEAT_SUCCEEDED=e.SERVER_HEARTBEAT_STARTED=e.COMMAND_FAILED=e.COMMAND_SUCCEEDED=e.COMMAND_STARTED=e.CLUSTER_TIME_RECEIVED=e.CONNECTION_CHECKED_IN=e.CONNECTION_CHECKED_OUT=e.CONNECTION_CHECK_OUT_FAILED=e.CONNECTION_CHECK_OUT_STARTED=e.CONNECTION_CLOSED=e.CONNECTION_READY=e.CONNECTION_CREATED=e.CONNECTION_POOL_READY=e.CONNECTION_POOL_CLEARED=e.CONNECTION_POOL_CLOSED=e.CONNECTION_POOL_CREATED=e.WAITING_FOR_SUITABLE_SERVER=e.SERVER_SELECTION_SUCCEEDED=e.SERVER_SELECTION_FAILED=e.SERVER_SELECTION_STARTED=e.TOPOLOGY_DESCRIPTION_CHANGED=e.TOPOLOGY_CLOSED=e.TOPOLOGY_OPENING=e.SERVER_DESCRIPTION_CHANGED=e.SERVER_CLOSED=e.SERVER_OPENING=e.DESCRIPTION_RECEIVED=e.UNPINNED=e.PINNED=e.MESSAGE=e.ENDED=e.CLOSED=e.CONNECT=e.OPEN=e.CLOSE=e.TIMEOUT=e.ERROR=e.SYSTEM_JS_COLLECTION=e.SYSTEM_COMMAND_COLLECTION=e.SYSTEM_USER_COLLECTION=e.SYSTEM_PROFILE_COLLECTION=e.SYSTEM_INDEX_COLLECTION=e.SYSTEM_NAMESPACE_COLLECTION=void 0,e.kDecoratedKeys=e.kDecorateResult=e.LEGACY_HELLO_COMMAND_CAMEL_CASE=e.LEGACY_HELLO_COMMAND=e.MONGO_CLIENT_EVENTS=e.LOCAL_SERVER_EVENTS=e.SERVER_RELAY_EVENTS=e.APM_EVENTS=e.TOPOLOGY_EVENTS=e.CMAP_EVENTS=e.HEARTBEAT_EVENTS=e.RESUME_TOKEN_CHANGED=void 0,e.SYSTEM_NAMESPACE_COLLECTION="system.namespaces",e.SYSTEM_INDEX_COLLECTION="system.indexes",e.SYSTEM_PROFILE_COLLECTION="system.profile",e.SYSTEM_USER_COLLECTION="system.users",e.SYSTEM_COMMAND_COLLECTION="$cmd",e.SYSTEM_JS_COLLECTION="system.js",e.ERROR="error",e.TIMEOUT="timeout",e.CLOSE="close",e.OPEN="open",e.CONNECT="connect",e.CLOSED="closed",e.ENDED="ended",e.MESSAGE="message",e.PINNED="pinned",e.UNPINNED="unpinned",e.DESCRIPTION_RECEIVED="descriptionReceived",e.SERVER_OPENING="serverOpening",e.SERVER_CLOSED="serverClosed",e.SERVER_DESCRIPTION_CHANGED="serverDescriptionChanged",e.TOPOLOGY_OPENING="topologyOpening",e.TOPOLOGY_CLOSED="topologyClosed",e.TOPOLOGY_DESCRIPTION_CHANGED="topologyDescriptionChanged",e.SERVER_SELECTION_STARTED="serverSelectionStarted",e.SERVER_SELECTION_FAILED="serverSelectionFailed",e.SERVER_SELECTION_SUCCEEDED="serverSelectionSucceeded",e.WAITING_FOR_SUITABLE_SERVER="waitingForSuitableServer",e.CONNECTION_POOL_CREATED="connectionPoolCreated",e.CONNECTION_POOL_CLOSED="connectionPoolClosed",e.CONNECTION_POOL_CLEARED="connectionPoolCleared",e.CONNECTION_POOL_READY="connectionPoolReady",e.CONNECTION_CREATED="connectionCreated",e.CONNECTION_READY="connectionReady",e.CONNECTION_CLOSED="connectionClosed",e.CONNECTION_CHECK_OUT_STARTED="connectionCheckOutStarted",e.CONNECTION_CHECK_OUT_FAILED="connectionCheckOutFailed",e.CONNECTION_CHECKED_OUT="connectionCheckedOut",e.CONNECTION_CHECKED_IN="connectionCheckedIn",e.CLUSTER_TIME_RECEIVED="clusterTimeReceived",e.COMMAND_STARTED="commandStarted",e.COMMAND_SUCCEEDED="commandSucceeded",e.COMMAND_FAILED="commandFailed",e.SERVER_HEARTBEAT_STARTED="serverHeartbeatStarted",e.SERVER_HEARTBEAT_SUCCEEDED="serverHeartbeatSucceeded",e.SERVER_HEARTBEAT_FAILED="serverHeartbeatFailed",e.RESPONSE="response",e.MORE="more",e.INIT="init",e.CHANGE="change",e.END="end",e.RESUME_TOKEN_CHANGED="resumeTokenChanged",e.HEARTBEAT_EVENTS=Object.freeze([e.SERVER_HEARTBEAT_STARTED,e.SERVER_HEARTBEAT_SUCCEEDED,e.SERVER_HEARTBEAT_FAILED]),e.CMAP_EVENTS=Object.freeze([e.CONNECTION_POOL_CREATED,e.CONNECTION_POOL_READY,e.CONNECTION_POOL_CLEARED,e.CONNECTION_POOL_CLOSED,e.CONNECTION_CREATED,e.CONNECTION_READY,e.CONNECTION_CLOSED,e.CONNECTION_CHECK_OUT_STARTED,e.CONNECTION_CHECK_OUT_FAILED,e.CONNECTION_CHECKED_OUT,e.CONNECTION_CHECKED_IN]),e.TOPOLOGY_EVENTS=Object.freeze([e.SERVER_OPENING,e.SERVER_CLOSED,e.SERVER_DESCRIPTION_CHANGED,e.TOPOLOGY_OPENING,e.TOPOLOGY_CLOSED,e.TOPOLOGY_DESCRIPTION_CHANGED,e.ERROR,e.TIMEOUT,e.CLOSE]),e.APM_EVENTS=Object.freeze([e.COMMAND_STARTED,e.COMMAND_SUCCEEDED,e.COMMAND_FAILED]),e.SERVER_RELAY_EVENTS=Object.freeze([e.SERVER_HEARTBEAT_STARTED,e.SERVER_HEARTBEAT_SUCCEEDED,e.SERVER_HEARTBEAT_FAILED,e.COMMAND_STARTED,e.COMMAND_SUCCEEDED,e.COMMAND_FAILED,...e.CMAP_EVENTS]),e.LOCAL_SERVER_EVENTS=Object.freeze([e.CONNECT,e.DESCRIPTION_RECEIVED,e.CLOSED,e.ENDED]),e.MONGO_CLIENT_EVENTS=Object.freeze([...e.CMAP_EVENTS,...e.APM_EVENTS,...e.TOPOLOGY_EVENTS,...e.HEARTBEAT_EVENTS]),e.LEGACY_HELLO_COMMAND="ismaster",e.LEGACY_HELLO_COMMAND_CAMEL_CASE="isMaster",e.kDecorateResult=Symbol.for("@@mdb.decorateDecryptionResult"),e.kDecoratedKeys=Symbol.for("@@mdb.decryptedKeys")})(Ve);var Pt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ReadConcern=e.ReadConcernLevel=void 0,e.ReadConcernLevel=Object.freeze({local:"local",majority:"majority",linearizable:"linearizable",available:"available",snapshot:"snapshot"});class t{constructor(n){this.level=e.ReadConcernLevel[n]??n}static fromOptions(n){if(n!=null){if(n.readConcern){const{readConcern:i}=n;if(i instanceof t)return i;if(typeof i=="string")return new t(i);if("level"in i&&i.level)return new t(i.level)}if(n.level)return new t(n.level)}}static get MAJORITY(){return e.ReadConcernLevel.majority}static get AVAILABLE(){return e.ReadConcernLevel.available}static get LINEARIZABLE(){return e.ReadConcernLevel.linearizable}static get SNAPSHOT(){return e.ReadConcernLevel.snapshot}toJSON(){return{level:this.level}}}e.ReadConcern=t})(Pt);var or={},At={},lo={};Object.defineProperty(lo,"__esModule",{value:!0});lo.OnDemandDocument=void 0;const me=pe,_n={type:0,nameOffset:1,nameLength:2,offset:3,length:4};class Qi{constructor(t,r=0,n=!1,i){this.cache=Object.create(null),this.indexFound=Object.create(null),this.bson=t,this.offset=r,this.isArray=n,this.elements=i??(0,me.parseToElementsToArray)(this.bson,r)}isElementName(t,r){const n=r[_n.nameLength],i=r[_n.nameOffset];if(t.length!==n)return!1;const o=i+n;for(let u=i,h=0;h<t.length&&u<o;h++,u++)if(this.bson[u]!==t.charCodeAt(h))return!1;return!0}getElement(t){const r=this.cache[t];if(r===!1)return null;if(r!=null)return r;if(typeof t=="number")if(this.isArray)if(t<this.elements.length){const i={element:this.elements[t],value:void 0};return this.cache[t]=i,this.indexFound[t]=!0,i}else return null;else return null;for(let n=0;n<this.elements.length;n++){const i=this.elements[n];if(!(n in this.indexFound)&&this.isElementName(t,i)){const o={element:i,value:void 0};return this.cache[t]=o,this.indexFound[n]=!0,o}}return this.cache[t]=!1,null}toJSValue(t,r){const n=t[_n.type],i=t[_n.offset],o=t[_n.length];if(r!==n)return null;switch(r){case me.BSONType.null:case me.BSONType.undefined:return null;case me.BSONType.double:return(0,me.getFloat64LE)(this.bson,i);case me.BSONType.int:return(0,me.getInt32LE)(this.bson,i);case me.BSONType.long:return(0,me.getBigInt64LE)(this.bson,i);case me.BSONType.bool:return!!this.bson[i];case me.BSONType.objectId:return new me.ObjectId(this.bson.subarray(i,i+12));case me.BSONType.timestamp:return new me.Timestamp((0,me.getBigInt64LE)(this.bson,i));case me.BSONType.string:return(0,me.toUTF8)(this.bson,i+4,i+o-1,!1);case me.BSONType.binData:{const u=(0,me.getInt32LE)(this.bson,i),h=this.bson[i+4];if(h===2){const s=(0,me.getInt32LE)(this.bson,i+1+4);if(s<0)throw new me.BSONError("Negative binary type element size found for subtype 0x02");if(s>u-4)throw new me.BSONError("Binary type with subtype 0x02 contains too long binary size");if(s<u-4)throw new me.BSONError("Binary type with subtype 0x02 contains too short binary size");return new me.Binary(this.bson.subarray(i+1+4+4,i+1+4+4+s),2)}return new me.Binary(this.bson.subarray(i+1+4,i+1+4+u),h)}case me.BSONType.date:return new Date(Number((0,me.getBigInt64LE)(this.bson,i)));case me.BSONType.object:return new Qi(this.bson,i);case me.BSONType.array:return new Qi(this.bson,i,!0);default:throw new me.BSONError(`Unsupported BSON type: ${r}`)}}size(){return this.elements.length}has(t){const r=this.cache[t];return r===!1?!1:r!=null?!0:this.getElement(t)!=null}get(t,r,n){const i=this.getElement(t);if(i==null){if(n===!0)throw new me.BSONError(`BSON element "${t}" is missing`);return null}if(i.value==null){const o=this.toJSValue(i.element,r);if(o==null){if(n===!0)throw new me.BSONError(`BSON element "${t}" is missing`);return null}i.value=o}return i.value}getNumber(t,r){const n=this.get(t,me.BSONType.bool),i=n==null?null:n?1:0,o=this.get(t,me.BSONType.long),u=o==null?null:Number(o),h=i??u??this.get(t,me.BSONType.int)??this.get(t,me.BSONType.double);if(r===!0&&h==null)throw new me.BSONError(`BSON element "${t}" is missing`);return h}toObject(t){return(0,me.deserialize)(this.bson,{...t,index:this.offset,allowObjectSmallerThanBufferSize:!0})}toBytes(){const t=(0,me.getInt32LE)(this.bson,this.offset);return this.bson.subarray(this.offset,this.offset+t)}}lo.OnDemandDocument=Qi;var Ku;function De(){if(Ku)return At;Ku=1,Object.defineProperty(At,"__esModule",{value:!0}),At.ClientBulkWriteCursorResponse=At.ExplainedCursorResponse=At.CursorResponse=At.MongoDBResponse=void 0,At.isErrorResponse=o;const e=pe,t=Q,r=ne(),n=lo,i={nameOffset:1,nameLength:2,offset:3,length:4};function o(l,g){for(let m=0;m<g.length;m++){const C=g[m];if(C[i.nameLength]===2){const S=C[i.nameOffset];if(l[S]===111&&l[S+1]===107){const D=C[i.offset],O=C[i.length];for(let M=D;M<D+O;M++)if(l[M]!==0)return!1;return!0}}}return!0}const E=class E extends n.OnDemandDocument{get(g,m,C){try{return super.get(g,m,C)}catch(S){throw new t.MongoUnexpectedServerResponseError(S.message,{cause:S})}}static is(g){return g instanceof E}static make(g){const m=(0,e.parseToElementsToArray)(g,0);return o(g,m)?new E(g,0,!1,m):new this(g,0,!1,m)}get isMaxTimeExpiredError(){var S,D;if(this.ok===0&&this.code===t.MONGODB_ERROR_CODES.MaxTimeMSExpired)return!0;if(this.ok===0)return!1;if(((S=this.get("writeConcernError",e.BSONType.object))==null?void 0:S.getNumber("code"))===t.MONGODB_ERROR_CODES.MaxTimeMSExpired)return!0;const C=this.get("writeErrors",e.BSONType.array);if(C!=null&&C.size()){for(let O=0;O<C.size();O++)if(((D=C.get(O,e.BSONType.object))==null?void 0:D.getNumber("code"))===t.MONGODB_ERROR_CODES.MaxTimeMSExpired)return!0}return!1}get recoveryToken(){var g;return((g=this.get("recoveryToken",e.BSONType.object))==null?void 0:g.toObject({promoteValues:!1,promoteLongs:!1,promoteBuffers:!1,validation:{utf8:!0}}))??null}get atClusterTime(){var g;return((g=this.get("cursor",e.BSONType.object))==null?void 0:g.get("atClusterTime",e.BSONType.timestamp))??this.get("atClusterTime",e.BSONType.timestamp)}get operationTime(){return this.get("operationTime",e.BSONType.timestamp)}get ok(){return this.getNumber("ok")?1:0}get $err(){return this.get("$err",e.BSONType.string)}get errmsg(){return this.get("errmsg",e.BSONType.string)}get code(){return this.getNumber("code")}get $clusterTime(){var g;if(!("clusterTime"in this)){const m=this.get("$clusterTime",e.BSONType.object);if(m==null)return this.clusterTime=null,null;const C=m.get("clusterTime",e.BSONType.timestamp,!0),S=(g=m.get("signature",e.BSONType.object))==null?void 0:g.toObject();this.clusterTime={clusterTime:C,signature:S}}return this.clusterTime??null}toObject(g){const m={...(0,e.pluckBSONSerializeOptions)(g??{}),validation:(0,e.parseUtf8ValidationOption)(g)};return super.toObject(m)}};E.empty=new E(new Uint8Array([13,0,0,0,16,111,107,0,1,0,0,0,0]));let u=E;At.MongoDBResponse=u;class h extends u{constructor(){super(...arguments),this._batch=null,this.iterated=0,this._encryptedBatch=null}static get emptyGetMore(){return new h((0,e.serialize)({ok:1,cursor:{id:0n,nextBatch:[]}}))}static is(g){return g instanceof h||g===h.emptyGetMore}get cursor(){return this.get("cursor",e.BSONType.object,!0)}get id(){try{return e.Long.fromBigInt(this.cursor.get("id",e.BSONType.long,!0))}catch(g){throw new t.MongoUnexpectedServerResponseError(g.message,{cause:g})}}get ns(){const g=this.cursor.get("ns",e.BSONType.string);return g!=null?(0,r.ns)(g):null}get length(){return Math.max(this.batchSize-this.iterated,0)}get encryptedBatch(){var m;if(this.encryptedResponse==null)return null;if(this._encryptedBatch!=null)return this._encryptedBatch;const g=(m=this.encryptedResponse)==null?void 0:m.get("cursor",e.BSONType.object);if(g!=null&&g.has("firstBatch"))this._encryptedBatch=g.get("firstBatch",e.BSONType.array,!0);else if(g!=null&&g.has("nextBatch"))this._encryptedBatch=g.get("nextBatch",e.BSONType.array,!0);else throw new t.MongoUnexpectedServerResponseError("Cursor document did not contain a batch");return this._encryptedBatch}get batch(){if(this._batch!=null)return this._batch;const g=this.cursor;if(g.has("firstBatch"))this._batch=g.get("firstBatch",e.BSONType.array,!0);else if(g.has("nextBatch"))this._batch=g.get("nextBatch",e.BSONType.array,!0);else throw new t.MongoUnexpectedServerResponseError("Cursor document did not contain a batch");return this._batch}get batchSize(){var g;return(g=this.batch)==null?void 0:g.size()}get postBatchResumeToken(){var g;return((g=this.cursor.get("postBatchResumeToken",e.BSONType.object))==null?void 0:g.toObject({promoteValues:!1,promoteLongs:!1,promoteBuffers:!1,validation:{utf8:!0}}))??null}shift(g){var S;if(this.iterated>=this.batchSize)return null;const m=this.batch.get(this.iterated,e.BSONType.object,!0)??null,C=((S=this.encryptedBatch)==null?void 0:S.get(this.iterated,e.BSONType.object,!0))??null;if(this.iterated+=1,g!=null&&g.raw)return m.toBytes();{const D=m.toObject(g);return C&&(0,r.decorateDecryptionResult)(D,C.toObject(g),!0),D}}clear(){this.iterated=this.batchSize}}At.CursorResponse=h;class s extends h{constructor(){super(...arguments),this.isExplain=!0,this._length=1}get id(){return e.Long.fromBigInt(0n)}get batchSize(){return 0}get ns(){return null}get length(){return this._length}shift(g){return this._length===0?null:(this._length-=1,this.toObject(g))}}At.ExplainedCursorResponse=s;class a extends h{get insertedCount(){return this.get("nInserted",e.BSONType.int,!0)}get upsertedCount(){return this.get("nUpserted",e.BSONType.int,!0)}get matchedCount(){return this.get("nMatched",e.BSONType.int,!0)}get modifiedCount(){return this.get("nModified",e.BSONType.int,!0)}get deletedCount(){return this.get("nDeleted",e.BSONType.int,!0)}get writeConcernError(){return this.get("writeConcernError",e.BSONType.object,!1)}}return At.ClientBulkWriteCursorResponse=a,At}var Yu;function ct(){if(Yu)return or;Yu=1,Object.defineProperty(or,"__esModule",{value:!0}),or.WriteConcern=or.WRITE_CONCERN_KEYS=void 0,or.throwIfWriteConcernError=n;const e=De(),t=Q;or.WRITE_CONCERN_KEYS=["w","wtimeout","j","journal","fsync"];class r{constructor(o,u,h,s){o!=null&&(Number.isNaN(Number(o))?this.w=o:this.w=Number(o)),u!=null&&(this.wtimeoutMS=this.wtimeout=u),h!=null&&(this.journal=this.j=h),s!=null&&(this.journal=this.j=!!s)}static apply(o,u){const h={};return u.w!=null&&(h.w=u.w),u.wtimeoutMS!=null&&(h.wtimeout=u.wtimeoutMS),u.journal!=null&&(h.j=u.j),o.writeConcern=h,o}static fromOptions(o,u){if(o==null)return;u=u??{};let h;typeof o=="string"||typeof o=="number"?h={w:o}:o instanceof r?h=o:h=o.writeConcern;const a={...u instanceof r?u:u.writeConcern,...h},{w:E=void 0,wtimeout:l=void 0,j:g=void 0,fsync:m=void 0,journal:C=void 0,wtimeoutMS:S=void 0}=a;if(E!=null||l!=null||S!=null||g!=null||C!=null||m!=null)return new r(E,l??S,g??C,m)}}or.WriteConcern=r;function n(i){if(typeof i=="object"&&i!=null){const o=e.MongoDBResponse.is(i)&&i.has("writeConcernError")?i.toObject():!e.MongoDBResponse.is(i)&&"writeConcernError"in i?i:null;if(o!=null)throw new t.MongoWriteConcernError(o)}}return or}var Xu;function ne(){return Xu||(Xu=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.kDispose=e.randomBytes=e.COSMOS_DB_MSG=e.DOCUMENT_DB_MSG=e.COSMOS_DB_CHECK=e.DOCUMENT_DB_CHECK=e.MONGODB_WARNING_CODE=e.DEFAULT_PK_FACTORY=e.HostAddress=e.BufferPool=e.List=e.MongoDBCollectionNamespace=e.MongoDBNamespace=e.ByteUtils=void 0,e.isUint8Array=C,e.hostMatchesWildcards=S,e.normalizeHintField=D,e.isObject=M,e.mergeOptions=p,e.filterOptions=B,e.isPromiseLike=d,e.decorateWithCollation=b,e.decorateWithReadConcern=f,e.getTopology=c,e.ns=w,e.makeCounter=A,e.uuidV4=y,e.maxWireVersion=F,e.arrayStrictEqual=R,e.errorStrictEqual=v,e.makeStateMachine=J,e.processTimeMS=I,e.calculateDurationInMs=N,e.hasAtomicOperators=j,e.resolveTimeoutOptions=x,e.resolveOptions=Y,e.isSuperset=$,e.isHello=K,e.setDifference=ee,e.isRecord=ye,e.emitWarning=Ee,e.emitWarningOnce=Ce,e.enumToString=_e,e.supportsRetryableWrites=He,e.shuffle=nt,e.commandSupportsReadConcern=k,e.compareObjectId=P,e.parseInteger=X,e.parseUnsignedInteger=V,e.checkParentDomainMatch=z,e.get=Z,e.isHostMatch=Be,e.promiseWithResolvers=lt,e.squashError=it,e.once=ql,e.maybeAddIdToDocuments=Hl,e.fileIsAccessible=Kl,e.csotMin=Yl,e.noop=Xl,e.decorateDecryptionResult=Fu,e.addAbortListener=rs,e.abortable=Jl;const t=Mc,r=D1,n=$l,i=Ar,o=gn,u=pe,h=fe,s=Ve,a=Q,E=Pt,l=Ke,g=Ne,m=ct();e.ByteUtils={toLocalBufferType(L){return Buffer.isBuffer(L)?L:Buffer.from(L.buffer,L.byteOffset,L.byteLength)},equals(L,U){return e.ByteUtils.toLocalBufferType(L).equals(U)},compare(L,U){return e.ByteUtils.toLocalBufferType(L).compare(U)},toBase64(L){return e.ByteUtils.toLocalBufferType(L).toString("base64")}};function C(L){return L!=null&&typeof L=="object"&&Symbol.toStringTag in L&&L[Symbol.toStringTag]==="Uint8Array"}function S(L,U){for(const H of U)if(L===H||H.startsWith("*.")&&(L!=null&&L.endsWith(H.substring(2,H.length)))||H.startsWith("*/")&&(L!=null&&L.endsWith(H.substring(2,H.length))))return!0;return!1}function D(L){let U;if(typeof L=="string")U=L;else if(Array.isArray(L))U={},L.forEach(H=>{U[H]=1});else if(L!=null&&typeof L=="object"){U={};for(const H in L)U[H]=L[H]}return U}const O=L=>Object.prototype.toString.call(L);function M(L){return O(L)==="[object Object]"}function p(L,U){return{...L,...U}}function B(L,U){const H={};for(const te in L)U.includes(te)&&(H[te]=L[te]);return H}function d(L){return L!=null&&typeof L=="object"&&"then"in L&&typeof L.then=="function"}function b(L,U){U.collation&&typeof U.collation=="object"&&(L.collation=U.collation)}function f(L,U,H){if(H&&H.session&&H.session.inTransaction())return;const te=Object.assign({},L.readConcern||{});U.s.readConcern&&Object.assign(te,U.s.readConcern),Object.keys(te).length>0&&Object.assign(L,{readConcern:te})}function c(L){if("topology"in L&&L.topology)return L.topology;if("client"in L&&L.client.topology)return L.client.topology;throw new a.MongoNotConnectedError("MongoClient must be connected to perform this operation")}function w(L){return T.fromString(L)}class T{constructor(U,H){this.db=U,this.collection=H===""?void 0:H}toString(){return this.collection?`${this.db}.${this.collection}`:this.db}withCollection(U){return new _(this.db,U)}static fromString(U){if(typeof U!="string"||U==="")throw new a.MongoRuntimeError(`Cannot parse namespace from "${U}"`);const[H,...te]=U.split("."),oe=te.join(".");return new T(H,oe===""?void 0:oe)}}e.MongoDBNamespace=T;class _ extends T{constructor(U,H){super(U,H),this.collection=H}static fromString(U){return super.fromString(U)}}e.MongoDBCollectionNamespace=_;function*A(L=0){let U=L;for(;;){const H=U;U+=1,yield H}}function y(){const L=t.randomBytes(16);return L[6]=L[6]&15|64,L[8]=L[8]&63|128,L}function F(L){var U;if(L){if(L.hello)return L.hello.maxWireVersion;if((U=L.serverApi)!=null&&U.version||L.loadBalanced)return h.MAX_SUPPORTED_WIRE_VERSION;if("lastHello"in L&&typeof L.lastHello=="function"){const H=L.lastHello();if(H)return H.maxWireVersion}if(L.description&&"maxWireVersion"in L.description&&L.description.maxWireVersion!=null)return L.description.maxWireVersion}return 0}function R(L,U){return!Array.isArray(L)||!Array.isArray(U)?!1:L.length===U.length&&L.every((H,te)=>H===U[te])}function v(L,U){return L===U?!0:!L||!U?L===U:!(L==null&&U!=null||L!=null&&U==null||L.constructor.name!==U.constructor.name||L.message!==U.message)}function J(L){return function(H,te){const oe=L[H.s.state];if(oe&&oe.indexOf(te)<0)throw new a.MongoRuntimeError(`illegal state transition from [${H.s.state}] => [${te}], allowed: [${oe}]`);H.emit("stateChanged",H.s.state,te),H.s.state=te}}function I(){return Math.floor(performance.now())}function N(L){if(typeof L!="number")return-1;const U=I()-L;return U<0?0:U}function j(L,U){if(Array.isArray(L)){for(const te of L)if(j(te))return!0;return!1}const H=Object.keys(L);if(U!=null&&U.ignoreUndefined){let te=!0;for(const oe of H)if(L[oe]!==void 0){te=!1;break}if(te)throw new a.MongoInvalidArgumentError("Update operations require that all atomic operators have defined values, but none were provided.")}return H.length>0&&H[0][0]==="$"}function x(L,U){const{socketTimeoutMS:H,serverSelectionTimeoutMS:te,waitQueueTimeoutMS:oe,timeoutMS:Le}=L.s.options;return{socketTimeoutMS:H,serverSelectionTimeoutMS:te,waitQueueTimeoutMS:oe,timeoutMS:Le,...U}}function Y(L,U){const H=Object.assign({},U,(0,u.resolveBSONOptions)(U,L)),te=(U==null?void 0:U.timeoutMS)??(L==null?void 0:L.timeoutMS),oe=U==null?void 0:U.session;if(!(oe!=null&&oe.inTransaction())){const xe=E.ReadConcern.fromOptions(U)??(L==null?void 0:L.readConcern);xe&&(H.readConcern=xe);let gt=m.WriteConcern.fromOptions(U)??(L==null?void 0:L.writeConcern);gt&&(te!=null&&(gt=m.WriteConcern.fromOptions({writeConcern:{...gt,wtimeout:void 0,wtimeoutMS:void 0}})),H.writeConcern=gt)}H.timeoutMS=te;const Le=l.ReadPreference.fromOptions(U)??(L==null?void 0:L.readPreference);if(Le&&(H.readPreference=Le),(oe==null?void 0:oe.explicit)&&(oe==null?void 0:oe.timeoutContext)!=null&&(U==null?void 0:U.timeoutMS)!=null)throw new a.MongoInvalidArgumentError("An operation cannot be given a timeoutMS setting when inside a withTransaction call that has a timeoutMS setting");return H}function $(L,U){L=Array.isArray(L)?new Set(L):L,U=Array.isArray(U)?new Set(U):U;for(const H of U)if(!L.has(H))return!1;return!0}function K(L){return!!(L[s.LEGACY_HELLO_COMMAND]||L.hello)}function ee(L,U){const H=new Set(L);for(const te of U)H.delete(te);return H}const ae=(L,U)=>Object.prototype.hasOwnProperty.call(L,U);function ye(L,U=void 0){if(!M(L))return!1;const H=L.constructor;if(H&&H.prototype&&(!M(H.prototype)||!ae(H.prototype,"isPrototypeOf")))return!1;if(U){const te=Object.keys(L);return $(te,U)}return!0}class ce{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(const U of this.nodes())yield U.value}*nodes(){let U=this.head.next;for(;U!==this.head;){const{next:H}=U;yield U,U=H}}push(U){this.count+=1;const H={next:this.head,prev:this.head.prev,value:U};this.head.prev.next=H,this.head.prev=H}pushMany(U){for(const H of U)this.push(H)}unshift(U){this.count+=1;const H={next:this.head.next,prev:this.head,value:U};this.head.next.prev=H,this.head.next=H}remove(U){if(U===this.head||this.length===0)return null;this.count-=1;const H=U.prev,te=U.next;return H.next=te,te.prev=H,U.value}shift(){return this.remove(this.head.next)}pop(){return this.remove(this.head.prev)}prune(U){for(const H of this.nodes())U(H.value)&&this.remove(H)}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}}e.List=ce;class le{constructor(){this.buffers=new ce,this.totalByteLength=0}get length(){return this.totalByteLength}append(U){this.buffers.push(U),this.totalByteLength+=U.length}getInt32(){if(this.totalByteLength<4)return null;const U=this.buffers.first();if(U!=null&&U.byteLength>=4)return U.readInt32LE(0);const H=this.read(4),te=H.readInt32LE(0);return this.totalByteLength+=4,this.buffers.unshift(H),te}read(U){if(typeof U!="number"||U<0)throw new a.MongoInvalidArgumentError('Argument "size" must be a non-negative number');if(U>this.totalByteLength)return Buffer.alloc(0);const H=Buffer.allocUnsafe(U);for(let te=0;te<U;){const oe=this.buffers.shift();if(oe==null)break;const Le=U-te,Re=Math.min(Le,oe.byteLength),xe=oe.subarray(0,Re);H.set(xe,te),te+=Re,this.totalByteLength-=Re,Re<oe.byteLength&&this.buffers.unshift(oe.subarray(Re))}return H}}e.BufferPool=le;class he{constructor(U){this.host=void 0,this.port=void 0,this.socketPath=void 0,this.isIPv6=!1;const H=U.split(" ").join("%20");if(H.endsWith(".sock")){this.socketPath=decodeURIComponent(H);return}const te=`iLoveJS://${H}`;let oe;try{oe=new URL(te)}catch(gt){const yn=new a.MongoRuntimeError(`Unable to parse ${H} with URL`);throw yn.cause=gt,yn}const Le=oe.hostname,Re=oe.port;let xe=decodeURIComponent(Le).toLowerCase();if(xe.startsWith("[")&&xe.endsWith("]")&&(this.isIPv6=!0,xe=xe.substring(1,Le.length-1)),this.host=xe.toLowerCase(),typeof Re=="number"?this.port=Re:typeof Re=="string"&&Re!==""?this.port=Number.parseInt(Re,10):this.port=27017,this.port===0)throw new a.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(){return typeof this.host=="string"?this.isIPv6?`[${this.host}]:${this.port}`:`${this.host}:${this.port}`:`${this.socketPath}`}static fromString(U){return new he(U)}static fromHostPort(U,H){return U.includes(":")&&(U=`[${U}]`),he.fromString(`${U}:${H}`)}static fromSrvRecord({name:U,port:H}){return he.fromHostPort(U,H)}toHostPort(){if(this.socketPath)return{host:this.socketPath,port:0};const U=this.host??"",H=this.port??0;return{host:U,port:H}}}e.HostAddress=he,e.DEFAULT_PK_FACTORY={createPk(){return new u.ObjectId}},e.MONGODB_WARNING_CODE="MONGODB DRIVER";function Ee(L){return i.emitWarning(L,{code:e.MONGODB_WARNING_CODE})}const re=new Set;function Ce(L){if(!re.has(L))return re.add(L),Ee(L)}function _e(L){return Object.values(L).join(", ")}function He(L){return L?!!(L.loadBalanced||L.description.logicalSessionTimeoutMinutes!=null&&L.description.type!==g.ServerType.Standalone):!1}function nt(L,U=0){const H=Array.from(L);if(U>H.length)throw new a.MongoRuntimeError("Limit must be less than the number of items");let te=H.length;const oe=U%H.length===0?1:H.length-U;for(;te>oe;){const Le=Math.floor(Math.random()*te);te-=1;const Re=H[te];H[te]=H[Le],H[Le]=Re}return U%H.length===0?H:H.slice(oe)}function k(L){return!!(L.aggregate||L.count||L.distinct||L.find||L.geoNear)}function P(L,U){return L==null&&U==null?0:L==null?-1:U==null?1:e.ByteUtils.compare(L.id,U.id)}function X(L){if(typeof L=="number")return Math.trunc(L);const U=Number.parseInt(String(L),10);return Number.isNaN(U)?null:U}function V(L){const U=X(L);return U!=null&&U>=0?U:null}function z(L,U){const H=L.endsWith(".")?L.slice(0,L.length-1):L,te=U.endsWith(".")?U.slice(0,U.length-1):U,oe=/^.*?\./,Le=te.split(".").length<3,Re=`.${H.replace(oe,"")}`;let xe=Le?te:`.${te.replace(oe,"")}`;if(xe.startsWith(".")||(xe="."+xe),Le&&H.split(".").length<=te.split(".").length)throw new a.MongoAPIError("Server record does not have at least one more domain level than parent URI");if(!Re.endsWith(xe))throw new a.MongoAPIError("Server record does not share hostname with parent URI")}function Z(L,U={}){return new Promise((H,te)=>{let oe;const Le=n.get(L,U,Re=>{Re.setEncoding("utf8");let xe="";Re.on("data",gt=>xe+=gt),Re.on("end",()=>{(0,o.clearTimeout)(oe),H({status:Re.statusCode,body:xe})})}).on("error",Re=>{(0,o.clearTimeout)(oe),te(Re)}).end();oe=(0,o.setTimeout)(()=>{Le.destroy(new a.MongoNetworkTimeoutError("request timed out after 10 seconds"))},1e4)})}e.DOCUMENT_DB_CHECK=/(\.docdb\.amazonaws\.com$)|(\.docdb-elastic\.amazonaws\.com$)/,e.COSMOS_DB_CHECK=/\.cosmos\.azure\.com$/,e.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",e.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 Be(L,U){return!!(U&&L.test(U.toLowerCase()))}function lt(){let L,U;return{promise:new Promise(function(oe,Le){L=oe,U=Le}),resolve:L,reject:U}}function it(L){}const Ti=L=>new Promise((U,H)=>{t.randomBytes(L,(te,oe)=>{if(te)return H(te);U(oe)})});e.randomBytes=Ti;async function ql(L,U,H){var yn;(yn=H==null?void 0:H.signal)==null||yn.throwIfAborted();const{promise:te,resolve:oe,reject:Le}=lt(),Re=ns=>oe(ns),xe=ns=>Le(ns),gt=rs(H==null?void 0:H.signal,function(){Le(this.reason)});L.once(U,Re).once("error",xe);try{return await te}finally{L.off(U,Re),L.off("error",xe),gt==null||gt[e.kDispose]()}}function Hl(L,U,H){var oe;return(H.forceServerObjectId??((oe=L.db.options)==null?void 0:oe.forceServerObjectId)??!1)||U._id==null&&(U._id=L.s.pkFactory.createPk()),U}async function Kl(L,U){try{return await r.promises.access(L,U),!0}catch{return!1}}function Yl(L,U){return L===0?U:U===0?L:Math.min(L,U)}function Xl(){}function Fu(L,U,H=!0){if(H&&(Buffer.isBuffer(U)&&(U=(0,u.deserialize)(U)),Buffer.isBuffer(L)))throw new a.MongoRuntimeError("Expected result of decryption to be deserialized BSON object");if(!(!L||typeof L!="object"))for(const te of Object.keys(L)){const oe=U[te];if(oe&&oe._bsontype==="Binary"&&oe.sub_type===6){L[s.kDecoratedKeys]||Object.defineProperty(L,s.kDecoratedKeys,{value:[],configurable:!0,enumerable:!1,writable:!1}),L[s.kDecoratedKeys].push(te);continue}Fu(L[te],oe,!1)}}e.kDispose=Symbol.dispose??Symbol("dispose");function rs(L,U){if(L!=null)return L.addEventListener("abort",U,{once:!0}),{[e.kDispose]:()=>L.removeEventListener("abort",U)}}async function Jl(L,{signal:U}){if(U==null)return await L;const{promise:H,reject:te}=lt(),oe=U.aborted?te(U.reason):rs(U,function(){te(this.reason)});try{return await Promise.race([L,H])}finally{oe==null||oe[e.kDispose]()}}}(Fs)),Fs}Object.defineProperty(Te,"__esModule",{value:!0});Te.LegacyTimeoutContext=Te.CSOTTimeoutContext=Te.TimeoutContext=Te.Timeout=Te.TimeoutError=void 0;const Ju=gn,br=Q,l1=ne();class h1 extends Error{get name(){return"TimeoutError"}constructor(t,r){super(t,r),this.duration=r.duration}static is(t){return t!=null&&typeof t=="object"&&"name"in t&&t.name==="TimeoutError"}}Te.TimeoutError=h1;class dt extends Promise{get remainingTime(){return this.timedOut?0:this.duration===0?1/0:this.start+this.duration-Math.trunc(performance.now())}get timeElapsed(){return Math.trunc(performance.now())-this.start}constructor(t=()=>null,r){const n=(r==null?void 0:r.duration)??0,i=!!(r!=null&&r.unref),o=r==null?void 0:r.rejection;if(n<0)throw new br.MongoInvalidArgumentError("Cannot create a Timeout with a negative duration");let u;super((h,s)=>{u=s,t(l1.noop,s)}),this.ended=null,this.timedOut=!1,this.cleared=!1,this.duration=n,this.start=Math.trunc(performance.now()),o==null&&this.duration>0?(this.id=(0,Ju.setTimeout)(()=>{this.ended=Math.trunc(performance.now()),this.timedOut=!0,u(new h1(`Expired after ${n}ms`,{duration:n}))},this.duration),typeof this.id.unref=="function"&&i&&this.id.unref()):o!=null&&(this.ended=Math.trunc(performance.now()),this.timedOut=!0,u(o))}clear(){(0,Ju.clearTimeout)(this.id),this.id=void 0,this.timedOut=!1,this.cleared=!0}throwIfExpired(){if(this.timedOut)throw this.then(void 0,l1.squashError),new h1("Timed out",{duration:this.duration})}static expires(t,r){return new dt(void 0,{duration:t,unref:r})}static reject(t){return new dt(void 0,{duration:0,unref:!0,rejection:t})}}Te.Timeout=dt;function Y2(e){return e!=null&&typeof e=="object"&&"serverSelectionTimeoutMS"in e&&typeof e.serverSelectionTimeoutMS=="number"&&"waitQueueTimeoutMS"in e&&typeof e.waitQueueTimeoutMS=="number"}function X2(e){return e!=null&&typeof e=="object"&&"serverSelectionTimeoutMS"in e&&typeof e.serverSelectionTimeoutMS=="number"&&"timeoutMS"in e&&typeof e.timeoutMS=="number"}class k1{static create(t){var r,n;if(((r=t.session)==null?void 0:r.timeoutContext)!=null)return(n=t.session)==null?void 0:n.timeoutContext;if(X2(t))return new Kn(t);if(Y2(t))return new ho(t);throw new br.MongoRuntimeError("Unrecognized options")}}Te.TimeoutContext=k1;class Kn extends k1{constructor(t){super(),this.minRoundTripTime=0,this.start=Math.trunc(performance.now()),this.timeoutMS=t.timeoutMS,this.serverSelectionTimeoutMS=t.serverSelectionTimeoutMS,this.socketTimeoutMS=t.socketTimeoutMS,this.clearServerSelectionTimeout=!1}get maxTimeMS(){return this.remainingTimeMS-this.minRoundTripTime}get remainingTimeMS(){const t=Math.trunc(performance.now())-this.start;return this.timeoutMS<=0?1/0:this.timeoutMS-t}csotEnabled(){return!0}get serverSelectionTimeout(){var t;if(typeof this._serverSelectionTimeout!="object"||(t=this._serverSelectionTimeout)!=null&&t.cleared){const{remainingTimeMS:r,serverSelectionTimeoutMS:n}=this;if(r<=0)return dt.reject(new br.MongoOperationTimeoutError(`Timed out in server selection after ${this.timeoutMS}ms`));n!==0&&(0,l1.csotMin)(r,n)===n?this._serverSelectionTimeout=dt.expires(n):r>0&&Number.isFinite(r)?this._serverSelectionTimeout=dt.expires(r):this._serverSelectionTimeout=null}return this._serverSelectionTimeout}get connectionCheckoutTimeout(){var t;if(typeof this._connectionCheckoutTimeout!="object"||(t=this._connectionCheckoutTimeout)!=null&&t.cleared)if(typeof this._serverSelectionTimeout=="object")this._connectionCheckoutTimeout=this._serverSelectionTimeout;else throw new br.MongoRuntimeError("Unreachable. If you are seeing this error, please file a ticket on the NODE driver project on Jira");return this._connectionCheckoutTimeout}get timeoutForSocketWrite(){const{remainingTimeMS:t}=this;return Number.isFinite(t)?t>0?dt.expires(t):dt.reject(new br.MongoOperationTimeoutError("Timed out before socket write")):null}get timeoutForSocketRead(){const{remainingTimeMS:t}=this;return Number.isFinite(t)?t>0?dt.expires(t):dt.reject(new br.MongoOperationTimeoutError("Timed out before socket read")):null}refresh(){var t,r;this.start=Math.trunc(performance.now()),this.minRoundTripTime=0,(t=this._serverSelectionTimeout)==null||t.clear(),(r=this._connectionCheckoutTimeout)==null||r.clear()}clear(){var t,r;(t=this._serverSelectionTimeout)==null||t.clear(),(r=this._connectionCheckoutTimeout)==null||r.clear()}getRemainingTimeMSOrThrow(t){const{remainingTimeMS:r}=this;if(r<=0)throw new br.MongoOperationTimeoutError(t??`Expired after ${this.timeoutMS}ms`);return r}clone(){const t=new Kn({timeoutMS:this.timeoutMS,serverSelectionTimeoutMS:this.serverSelectionTimeoutMS});return t.start=this.start,t}refreshed(){return new Kn(this)}addMaxTimeMSToCommand(t,r){if(r.omitMaxTimeMS)return;const n=this.remainingTimeMS-this.minRoundTripTime;n>0&&Number.isFinite(n)&&(t.maxTimeMS=n)}getSocketTimeoutMS(){return 0}}Te.CSOTTimeoutContext=Kn;class ho extends k1{constructor(t){super(),this.options=t,this.clearServerSelectionTimeout=!0}csotEnabled(){return!1}get serverSelectionTimeout(){return this.options.serverSelectionTimeoutMS!=null&&this.options.serverSelectionTimeoutMS>0?dt.expires(this.options.serverSelectionTimeoutMS):null}get connectionCheckoutTimeout(){return this.options.waitQueueTimeoutMS!=null&&this.options.waitQueueTimeoutMS>0?dt.expires(this.options.waitQueueTimeoutMS):null}get timeoutForSocketWrite(){return null}get timeoutForSocketRead(){return null}refresh(){}clear(){}get maxTimeMS(){return null}refreshed(){return new ho(this.options)}addMaxTimeMSToCommand(t,r){}getSocketTimeoutMS(){return this.options.socketTimeoutMS}}Te.LegacyTimeoutContext=ho;var ii={},Ie={},oi={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Explain=e.ExplainVerbosity=void 0,e.validateExplainTimeoutOptions=n,e.decorateWithExplain=i;const t=Q;e.ExplainVerbosity=Object.freeze({queryPlanner:"queryPlanner",queryPlannerExtended:"queryPlannerExtended",executionStats:"executionStats",allPlansExecution:"allPlansExecution"});class r{constructor(u,h){typeof u=="boolean"?this.verbosity=u?e.ExplainVerbosity.allPlansExecution:e.ExplainVerbosity.queryPlanner:this.verbosity=u,this.maxTimeMS=h}static fromOptions({explain:u}={}){if(u==null)return;if(typeof u=="boolean"||typeof u=="string")return new r(u);const{verbosity:h,maxTimeMS:s}=u;return new r(h,s)}}e.Explain=r;function n(o,u){const{maxTimeMS:h,timeoutMS:s}=o;if(s!=null&&(h!=null||(u==null?void 0:u.maxTimeMS)!=null))throw new t.MongoAPIError("Cannot use maxTimeMS with timeoutMS for explain commands.")}function i(o,u){const{verbosity:h,maxTimeMS:s}=u,a={explain:o,verbosity:h};return typeof s=="number"&&(a.maxTimeMS=s),a}})(oi);var Me={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractOperation=e.Aspect=void 0,e.defineAspects=i;const t=pe,r=Ke;e.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 n{constructor(u={}){this.readPreference=this.hasAspect(e.Aspect.WRITE_OPERATION)?r.ReadPreference.primary:r.ReadPreference.fromOptions(u)??r.ReadPreference.primary,this.bsonOptions=(0,t.resolveBSONOptions)(u),this._session=u.session!=null?u.session:void 0,this.options=u,this.bypassPinningCheck=!!u.bypassPinningCheck}hasAspect(u){const h=this.constructor;return h.aspects==null?!1:h.aspects.has(u)}get session(){return this._session}set session(u){this._session=u}clearSession(){this._session=void 0}resetBatch(){return!0}get canRetryRead(){return this.hasAspect(e.Aspect.RETRYABLE)&&this.hasAspect(e.Aspect.READ_OPERATION)}get canRetryWrite(){return this.hasAspect(e.Aspect.RETRYABLE)&&this.hasAspect(e.Aspect.WRITE_OPERATION)}handleOk(u){return u.toObject(this.bsonOptions)}handleError(u){throw u}}e.AbstractOperation=n;function i(o,u){return!Array.isArray(u)&&!(u instanceof Set)&&(u=[u]),u=new Set(u),Object.defineProperty(o,"aspects",{value:u,writable:!1}),u}})(Me);Object.defineProperty(Ie,"__esModule",{value:!0});Ie.CommandOperation=void 0;const J2=fe,Q2=Q,Rs=oi,Z2=Pt,Bi=ne(),Qu=ct(),Or=Me;class $2 extends Or.AbstractOperation{constructor(t,r){super(r),this.options=r??{};const n=(r==null?void 0:r.dbName)||(r==null?void 0:r.authdb);if(n?this.ns=new Bi.MongoDBNamespace(n,"$cmd"):this.ns=t?t.s.namespace.withCollection("$cmd"):new Bi.MongoDBNamespace("admin","$cmd"),this.readConcern=Z2.ReadConcern.fromOptions(r),this.writeConcern=Qu.WriteConcern.fromOptions(r),this.hasAspect(Or.Aspect.EXPLAINABLE))this.explain=Rs.Explain.fromOptions(r),this.explain&&(0,Rs.validateExplainTimeoutOptions)(this.options,this.explain);else if((r==null?void 0:r.explain)!=null)throw new Q2.MongoInvalidArgumentError('Option "explain" is not supported on this command')}get canRetryWrite(){return this.hasAspect(Or.Aspect.EXPLAINABLE)?this.explain==null:super.canRetryWrite}buildOptions(t){return{...this.options,...this.bsonOptions,timeoutContext:t,readPreference:this.readPreference,session:this.session}}buildCommand(t,r){const n=this.buildCommandDocument(t,r),i=this.session&&this.session.inTransaction();return this.readConcern&&(0,Bi.commandSupportsReadConcern)(n)&&!i&&Object.assign(n,{readConcern:this.readConcern}),this.writeConcern&&this.hasAspect(Or.Aspect.WRITE_OPERATION)&&!i&&Qu.WriteConcern.apply(n,this.writeConcern),this.options.collation&&typeof this.options.collation=="object"&&!this.hasAspect(Or.Aspect.SKIP_COLLATION)&&Object.assign(n,{collation:this.options.collation}),typeof this.options.maxTimeMS=="number"&&(n.maxTimeMS=this.options.maxTimeMS),this.options.rawData!=null&&this.hasAspect(Or.Aspect.SUPPORTS_RAW_DATA)&&(0,Bi.maxWireVersion)(t)>=J2.MIN_SUPPORTED_RAW_DATA_WIRE_VERSION&&(n.rawData=this.options.rawData),this.hasAspect(Or.Aspect.EXPLAINABLE)&&this.explain?(0,Rs.decorateWithExplain)(n,this.explain):n}}Ie.CommandOperation=$2;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.AggregateOperation=e.DB_AGGREGATE_COLLECTION=void 0;const t=De(),r=Q,n=ct(),i=Ie,o=Me;e.DB_AGGREGATE_COLLECTION=1;class u extends i.CommandOperation{constructor(s,a,E){if(super(void 0,{...E,dbName:s.db}),this.SERVER_COMMAND_RESPONSE_TYPE=t.CursorResponse,this.options={...E},this.target=s.collection||e.DB_AGGREGATE_COLLECTION,this.pipeline=a,this.hasWriteStage=!1,typeof(E==null?void 0:E.out)=="string")this.pipeline=this.pipeline.concat({$out:E.out}),this.hasWriteStage=!0;else if(a.length>0){const l=a[a.length-1];(l.$out||l.$merge)&&(this.hasWriteStage=!0)}if(this.hasWriteStage||delete this.options.writeConcern,(E==null?void 0:E.cursor)!=null&&typeof E.cursor!="object")throw new r.MongoInvalidArgumentError("Cursor options must be an object");this.SERVER_COMMAND_RESPONSE_TYPE=this.explain?t.ExplainedCursorResponse:t.CursorResponse}get commandName(){return"aggregate"}get canRetryRead(){return!this.hasWriteStage}addToPipeline(s){this.pipeline.push(s)}buildCommandDocument(){const s=this.options,a={aggregate:this.target,pipeline:this.pipeline};return this.hasWriteStage&&this.writeConcern&&n.WriteConcern.apply(a,this.writeConcern),s.bypassDocumentValidation===!0&&(a.bypassDocumentValidation=s.bypassDocumentValidation),typeof s.allowDiskUse=="boolean"&&(a.allowDiskUse=s.allowDiskUse),s.hint&&(a.hint=s.hint),s.let&&(a.let=s.let),s.comment!==void 0&&(a.comment=s.comment),a.cursor=s.cursor||{},s.batchSize&&!this.hasWriteStage&&(a.cursor.batchSize=s.batchSize),a}handleOk(s){return s}}e.AggregateOperation=u,(0,o.defineAspects)(u,[o.Aspect.READ_OPERATION,o.Aspect.RETRYABLE,o.Aspect.EXPLAINABLE,o.Aspect.CURSOR_CREATING,o.Aspect.SUPPORTS_RAW_DATA])})(ii);Object.defineProperty(qe,"__esModule",{value:!0});qe.executeOperation=ih;qe.autoConnect=f0;const eh=fe,et=Q,Zu=Ke,bi=pn,th=Te,Zi=ne(),rh=ii,Xt=Me,nh=et.MONGODB_ERROR_CODES.IllegalOperation,$u="This MongoDB deployment does not support retryable writes. Please add retryWrites=false to your connection string.";async function ih(e,t,r){if(!(t instanceof Xt.AbstractOperation))throw new et.MongoRuntimeError("This method requires a valid operation instance");const n=e.topology==null?await(0,Zi.abortable)(f0(e),t.options):e.topology;let i=t.session,o;if(i==null)o=Symbol(),i=e.startSession({owner:o,explicit:!1});else{if(i.hasEnded)throw new et.MongoExpiredSessionError("Use of expired sessions is not permitted");if(i.snapshotEnabled&&(0,Zi.maxWireVersion)(n)<eh.MIN_SUPPORTED_SNAPSHOT_READS_WIRE_VERSION)throw new et.MongoCompatibilityError("Snapshot reads require MongoDB 5.0 or later");if(i.client!==e)throw new et.MongoInvalidArgumentError("ClientSession must be from the same MongoClient")}t.session??(t.session=i);const u=t.readPreference??Zu.ReadPreference.primary,h=!!(i!=null&&i.inTransaction()),s=t.hasAspect(Xt.Aspect.READ_OPERATION);if(h&&!u.equals(Zu.ReadPreference.primary)&&(s||t.commandName==="runCommand"))throw new et.MongoTransactionError(`Read preference in a transaction must be primary, not: ${u.mode}`);i!=null&&i.isPinned&&i.transaction.isCommitted&&!t.bypassPinningCheck&&i.unpin(),r??(r=th.TimeoutContext.create({session:i,serverSelectionTimeoutMS:e.s.options.serverSelectionTimeoutMS,waitQueueTimeoutMS:e.s.options.waitQueueTimeoutMS,timeoutMS:t.options.timeoutMS}));try{return await oh(t,{topology:n,timeoutContext:r,session:i,readPreference:u})}finally{(i==null?void 0:i.owner)!=null&&i.owner===o&&await i.endSession()}}async function f0(e){if(e.topology==null){if(e.s.hasBeenClosed)throw new et.MongoNotConnectedError("Client must be connected before running operations");e.s.options.__skipPingOnConnect=!0;try{if(await e.connect(),e.topology==null)throw new et.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}async function oh(e,{topology:t,timeoutContext:r,session:n,readPreference:i}){var D;let o;e.hasAspect(Xt.Aspect.MUST_SELECT_SAME_SERVER)?o=(0,bi.sameServerSelector)((D=e.server)==null?void 0:D.description):e instanceof rh.AggregateOperation&&e.hasWriteStage?o=(0,bi.secondaryWritableServerSelector)(t.commonWireVersion,i):o=i;let u=await t.selectServer(o,{session:n,operationName:e.commandName,timeoutContext:r,signal:e.options.signal,deprioritizedServers:new bi.DeprioritizedServers});const h=e.hasAspect(Xt.Aspect.READ_OPERATION),s=e.hasAspect(Xt.Aspect.WRITE_OPERATION),a=(n==null?void 0:n.inTransaction())??!1,E=t.s.options.retryReads&&!a&&e.canRetryRead,l=t.s.options.retryWrites&&!a&&(0,Zi.supportsRetryableWrites)(u)&&e.canRetryWrite,g=e.hasAspect(Xt.Aspect.RETRYABLE)&&n!=null&&(h&&E||s&&l);s&&l&&n!=null&&(e.options.willRetryWrite=!0,n.incrementTransactionNumber());const m=g?r.csotEnabled()?1/0:2:1;let C;const S=new bi.DeprioritizedServers;for(let O=0;O<m;O++){if(C){if(s&&C.code===nh)throw new et.MongoServerError({message:$u,errmsg:$u,originalError:C});if(e.hasAspect(Xt.Aspect.COMMAND_BATCHING)&&!e.canRetryWrite||s&&!(0,et.isRetryableWriteError)(C)||h&&!(0,et.isRetryableReadError)(C))throw C;if(C instanceof et.MongoNetworkError&&e.hasAspect(Xt.Aspect.CURSOR_CREATING)&&n!=null&&n.isPinned&&!n.inTransaction()&&n.unpin({force:!0,forceClear:!0}),u=await t.selectServer(o,{session:n,operationName:e.commandName,deprioritizedServers:S,signal:e.options.signal}),s&&!(0,Zi.supportsRetryableWrites)(u))throw new et.MongoUnexpectedServerResponseError("Selected server does not support retryable writes")}e.server=u;try{O>0&&e.hasAspect(Xt.Aspect.COMMAND_BATCHING)&&e.resetBatch();try{const M=await u.command(e,r);return e.handleOk(M)}catch(M){return e.handleError(M)}}catch(M){if(!(M instanceof et.MongoError))throw M;if(C!=null&&M.hasErrorLabel(et.MongoErrorLabel.NoWritesPerformed))throw C;S.add(u.description),C=M,r.clear()}}throw C??new et.MongoRuntimeError("Tried to propagate retryability error, but no error was found.")}var fo={};Object.defineProperty(fo,"__esModule",{value:!0});fo.ListDatabasesOperation=void 0;const sh=De(),ea=ne(),uh=Ie,Ns=Me;class m0 extends uh.CommandOperation{constructor(t,r){super(t,r),this.SERVER_COMMAND_RESPONSE_TYPE=sh.MongoDBResponse,this.options=r??{},this.ns=new ea.MongoDBNamespace("admin","$cmd")}get commandName(){return"listDatabases"}buildCommandDocument(t,r){const n={listDatabases:1};return typeof this.options.nameOnly=="boolean"&&(n.nameOnly=this.options.nameOnly),this.options.filter&&(n.filter=this.options.filter),typeof this.options.authorizedDatabases=="boolean"&&(n.authorizedDatabases=this.options.authorizedDatabases),(0,ea.maxWireVersion)(t)>=9&&this.options.comment!==void 0&&(n.comment=this.options.comment),n}}fo.ListDatabasesOperation=m0;(0,Ns.defineAspects)(m0,[Ns.Aspect.READ_OPERATION,Ns.Aspect.RETRYABLE]);var si={};Object.defineProperty(si,"__esModule",{value:!0});si.RemoveUserOperation=void 0;const ah=De(),ch=Ie,ta=Me;class E0 extends ch.CommandOperation{constructor(t,r,n){super(t,n),this.SERVER_COMMAND_RESPONSE_TYPE=ah.MongoDBResponse,this.options=n,this.username=r}get commandName(){return"dropUser"}buildCommandDocument(t){return{dropUser:this.username}}handleOk(t){return!0}}si.RemoveUserOperation=E0;(0,ta.defineAspects)(E0,[ta.Aspect.WRITE_OPERATION]);var tr={};Object.defineProperty(tr,"__esModule",{value:!0});tr.RunCursorCommandOperation=tr.RunCommandOperation=void 0;const g0=De(),lh=Me;class A0 extends lh.AbstractOperation{constructor(t,r,n){super(n),this.SERVER_COMMAND_RESPONSE_TYPE=g0.MongoDBResponse,this.command=r,this.options=n,this.ns=t.withCollection("$cmd")}get commandName(){return"runCommand"}buildCommand(t,r){return this.command}buildOptions(t){return{...this.options,session:this.session,timeoutContext:t,signal:this.options.signal,readPreference:this.options.readPreference}}}tr.RunCommandOperation=A0;class hh extends A0{constructor(){super(...arguments),this.SERVER_COMMAND_RESPONSE_TYPE=g0.CursorResponse}handleOk(t){return t}}tr.RunCursorCommandOperation=hh;var mo={};Object.defineProperty(mo,"__esModule",{value:!0});mo.ValidateCollectionOperation=void 0;const dh=De(),Is=Q,fh=Ie;class mh extends fh.CommandOperation{constructor(t,r,n){super(t.s.db,n),this.SERVER_COMMAND_RESPONSE_TYPE=dh.MongoDBResponse,this.options=n,this.collectionName=r}get commandName(){return"validate"}buildCommandDocument(t,r){return{validate:this.collectionName,...Object.fromEntries(Object.entries(this.options).filter(n=>n[0]!=="session"))}}handleOk(t){const r=super.handleOk(t);if(r.result!=null&&typeof r.result!="string")throw new Is.MongoUnexpectedServerResponseError("Error with validation data");if(r.result!=null&&r.result.match(/exception|corrupt/)!=null)throw new Is.MongoUnexpectedServerResponseError(`Invalid collection ${this.collectionName}`);if(r.valid!=null&&!r.valid)throw new Is.MongoUnexpectedServerResponseError(`Invalid collection ${this.collectionName}`);return t}}mo.ValidateCollectionOperation=mh;Object.defineProperty(ei,"__esModule",{value:!0});ei.Admin=void 0;const Eh=pe,Mi=qe,gh=fo,Ah=si,ph=tr,Ch=mo,Sh=ne();class yh{constructor(t){this.s={db:t}}async command(t,r){return await(0,Mi.executeOperation)(this.s.db.client,new ph.RunCommandOperation(new Sh.MongoDBNamespace("admin"),t,{...(0,Eh.resolveBSONOptions)(r),session:r==null?void 0:r.session,readPreference:r==null?void 0:r.readPreference,timeoutMS:(r==null?void 0:r.timeoutMS)??this.s.db.timeoutMS}))}async buildInfo(t){return await this.command({buildinfo:1},t)}async serverInfo(t){return await this.command({buildinfo:1},t)}async serverStatus(t){return await this.command({serverStatus:1},t)}async ping(t){return await this.command({ping:1},t)}async removeUser(t,r){return await(0,Mi.executeOperation)(this.s.db.client,new Ah.RemoveUserOperation(this.s.db,t,{dbName:"admin",...r}))}async validateCollection(t,r={}){return await(0,Mi.executeOperation)(this.s.db.client,new Ch.ValidateCollectionOperation(this,t,r))}async listDatabases(t){return await(0,Mi.executeOperation)(this.s.db.client,new gh.ListDatabasesOperation(this.s.db,{timeoutMS:this.s.db.timeoutMS,...t}))}async replSetGetStatus(t){return await this.command({replSetGetStatus:1},t)}}ei.Admin=yh;var ui={},Yn={},Wt={};Object.defineProperty(Wt,"__esModule",{value:!0});Wt.DeleteManyOperation=Wt.DeleteOneOperation=Wt.DeleteOperation=void 0;Wt.makeDeleteStatement=U1;const Oh=De(),Xn=Q,wh=ne(),_h=Ie,st=Me;class Eo extends _h.CommandOperation{constructor(t,r,n){super(void 0,n),this.SERVER_COMMAND_RESPONSE_TYPE=Oh.MongoDBResponse,this.options=n,this.ns=t,this.statements=r}get commandName(){return"delete"}get canRetryWrite(){return super.canRetryWrite===!1?!1:this.statements.every(t=>t.limit!=null?t.limit>0:!0)}buildCommandDocument(t,r){const n=this.options,i=typeof n.ordered=="boolean"?n.ordered:!0,o={delete:this.ns.collection,deletes:this.statements,ordered:i};if(n.let&&(o.let=n.let),n.comment!==void 0&&(o.comment=n.comment),this.writeConcern&&this.writeConcern.w===0&&(0,wh.maxWireVersion)(t)<9&&this.statements.find(h=>h.hint))throw new Xn.MongoCompatibilityError("hint for the delete command is only supported on MongoDB 4.4+");return o}}Wt.DeleteOperation=Eo;class p0 extends Eo{constructor(t,r,n){super(t,[U1(r,{...n,limit:1})],n)}handleOk(t){var n;const r=super.handleOk(t);if(this.explain)return r;if(r.code)throw new Xn.MongoServerError(r);if(r.writeErrors)throw new Xn.MongoServerError(r.writeErrors[0]);return{acknowledged:((n=this.writeConcern)==null?void 0:n.w)!==0,deletedCount:r.n}}}Wt.DeleteOneOperation=p0;class C0 extends Eo{constructor(t,r,n){super(t,[U1(r,n)],n)}handleOk(t){var n;const r=super.handleOk(t);if(this.explain)return r;if(r.code)throw new Xn.MongoServerError(r);if(r.writeErrors)throw new Xn.MongoServerError(r.writeErrors[0]);return{acknowledged:((n=this.writeConcern)==null?void 0:n.w)!==0,deletedCount:r.n}}}Wt.DeleteManyOperation=C0;function U1(e,t){const r={q:e,limit:typeof t.limit=="number"?t.limit:0};return t.collation&&(r.collation=t.collation),t.hint&&(r.hint=t.hint),r}(0,st.defineAspects)(Eo,[st.Aspect.RETRYABLE,st.Aspect.WRITE_OPERATION,st.Aspect.SUPPORTS_RAW_DATA]);(0,st.defineAspects)(p0,[st.Aspect.RETRYABLE,st.Aspect.WRITE_OPERATION,st.Aspect.EXPLAINABLE,st.Aspect.SKIP_COLLATION,st.Aspect.SUPPORTS_RAW_DATA]);(0,st.defineAspects)(C0,[st.Aspect.WRITE_OPERATION,st.Aspect.EXPLAINABLE,st.Aspect.SKIP_COLLATION,st.Aspect.SUPPORTS_RAW_DATA]);var Pr={};Object.defineProperty(Pr,"__esModule",{value:!0});Pr.InsertOneOperation=Pr.InsertOperation=void 0;const Dh=De(),ra=Q,Th=ne(),Bh=Ie,fr=Me;class j1 extends Bh.CommandOperation{constructor(t,r,n){super(void 0,n),this.SERVER_COMMAND_RESPONSE_TYPE=Dh.MongoDBResponse,this.options={...n,checkKeys:n.checkKeys??!1},this.ns=t,this.documents=r}get commandName(){return"insert"}buildCommandDocument(t,r){const n=this.options??{},i=typeof n.ordered=="boolean"?n.ordered:!0,o={insert:this.ns.collection,documents:this.documents,ordered:i};return typeof n.bypassDocumentValidation=="boolean"&&(o.bypassDocumentValidation=n.bypassDocumentValidation),n.comment!==void 0&&(o.comment=n.comment),o}}Pr.InsertOperation=j1;class S0 extends j1{constructor(t,r,n){super(t.s.namespace,[(0,Th.maybeAddIdToDocuments)(t,r,n)],n)}handleOk(t){var n;const r=super.handleOk(t);if(r.code)throw new ra.MongoServerError(r);if(r.writeErrors)throw new ra.MongoServerError(r.writeErrors[0]);return{acknowledged:((n=this.writeConcern)==null?void 0:n.w)!==0,insertedId:this.documents[0]._id}}}Pr.InsertOneOperation=S0;(0,fr.defineAspects)(j1,[fr.Aspect.RETRYABLE,fr.Aspect.WRITE_OPERATION,fr.Aspect.SUPPORTS_RAW_DATA]);(0,fr.defineAspects)(S0,[fr.Aspect.RETRYABLE,fr.Aspect.WRITE_OPERATION,fr.Aspect.SUPPORTS_RAW_DATA]);var _t={},Gr={};Object.defineProperty(Gr,"__esModule",{value:!0});Gr.formatSort=Uh;const y0=Q;function Cn(e=1){const t=`${e}`.toLowerCase();if(bh(e))return e;switch(t){case"ascending":case"asc":case"1":return 1;case"descending":case"desc":case"-1":return-1;default:throw new y0.MongoInvalidArgumentError(`Invalid sort direction: ${JSON.stringify(e)}`)}}function bh(e){return typeof e=="object"&&e!=null&&"$meta"in e&&typeof e.$meta=="string"}function Mh(e){if(Array.isArray(e)&&e.length===2)try{return Cn(e[1]),!0}catch{return!1}return!1}function Fh(e){return Array.isArray(e)&&Array.isArray(e[0])}function Rh(e){return e instanceof Map&&e.size>0}function Nh(e){return Array.isArray(e)}function Ih(e){return new Map([[`${e[0]}`,Cn([e[1]])]])}function vh(e){const t=e.map(([r,n])=>[`${r}`,Cn(n)]);return new Map(t)}function Ph(e){const t=e.map(r=>[`${r}`,1]);return new Map(t)}function Lh(e){const t=Object.entries(e).map(([r,n])=>[`${r}`,Cn(n)]);return new Map(t)}function kh(e){const t=Array.from(e).map(([r,n])=>[`${r}`,Cn(n)]);return new Map(t)}function Uh(e,t){if(e!=null){if(typeof e=="string")return new Map([[e,Cn(t)]]);if(typeof e!="object")throw new y0.MongoInvalidArgumentError(`Invalid sort format: ${JSON.stringify(e)} Sort must be a valid object`);if(!Nh(e))return Rh(e)?kh(e):Object.keys(e).length?Lh(e):void 0;if(e.length)return Fh(e)?vh(e):Mh(e)?Ih(e):Ph(e)}}Object.defineProperty(_t,"__esModule",{value:!0});_t.ReplaceOneOperation=_t.UpdateManyOperation=_t.UpdateOneOperation=_t.UpdateOperation=void 0;_t.makeUpdateStatement=go;const jh=De(),Rt=Q,xh=Gr,x1=ne(),zh=Ie,ze=Me;class ai extends zh.CommandOperation{constructor(t,r,n){super(void 0,n),this.SERVER_COMMAND_RESPONSE_TYPE=jh.MongoDBResponse,this.options=n,this.ns=t,this.statements=r}get commandName(){return"update"}get canRetryWrite(){return super.canRetryWrite===!1?!1:this.statements.every(t=>t.multi==null||t.multi===!1)}buildCommandDocument(t,r){const n=this.options,i={update:this.ns.collection,updates:this.statements,ordered:n.ordered??!0};return typeof n.bypassDocumentValidation=="boolean"&&(i.bypassDocumentValidation=n.bypassDocumentValidation),n.let&&(i.let=n.let),n.comment!==void 0&&(i.comment=n.comment),i}}_t.UpdateOperation=ai;class O0 extends ai{constructor(t,r,n,i){if(super(t,[go(r,n,{...i,multi:!1})],i),!(0,x1.hasAtomicOperators)(n,i))throw new Rt.MongoInvalidArgumentError("Update document requires atomic operators")}handleOk(t){var n;const r=super.handleOk(t);if(this.explain!=null)return r;if(r.code)throw new Rt.MongoServerError(r);if(r.writeErrors)throw new Rt.MongoServerError(r.writeErrors[0]);return{acknowledged:((n=this.writeConcern)==null?void 0:n.w)!==0,modifiedCount:r.nModified??r.n,upsertedId:Array.isArray(r.upserted)&&r.upserted.length>0?r.upserted[0]._id:null,upsertedCount:Array.isArray(r.upserted)&&r.upserted.length?r.upserted.length:0,matchedCount:Array.isArray(r.upserted)&&r.upserted.length>0?0:r.n}}}_t.UpdateOneOperation=O0;class w0 extends ai{constructor(t,r,n,i){if(super(t,[go(r,n,{...i,multi:!0})],i),!(0,x1.hasAtomicOperators)(n,i))throw new Rt.MongoInvalidArgumentError("Update document requires atomic operators")}handleOk(t){var n;const r=super.handleOk(t);if(this.explain!=null)return r;if(r.code)throw new Rt.MongoServerError(r);if(r.writeErrors)throw new Rt.MongoServerError(r.writeErrors[0]);return{acknowledged:((n=this.writeConcern)==null?void 0:n.w)!==0,modifiedCount:r.nModified??r.n,upsertedId:Array.isArray(r.upserted)&&r.upserted.length>0?r.upserted[0]._id:null,upsertedCount:Array.isArray(r.upserted)&&r.upserted.length?r.upserted.length:0,matchedCount:Array.isArray(r.upserted)&&r.upserted.length>0?0:r.n}}}_t.UpdateManyOperation=w0;class _0 extends ai{constructor(t,r,n,i){if(super(t,[go(r,n,{...i,multi:!1})],i),(0,x1.hasAtomicOperators)(n))throw new Rt.MongoInvalidArgumentError("Replacement document must not contain atomic operators")}handleOk(t){var n;const r=super.handleOk(t);if(this.explain!=null)return r;if(r.code)throw new Rt.MongoServerError(r);if(r.writeErrors)throw new Rt.MongoServerError(r.writeErrors[0]);return{acknowledged:((n=this.writeConcern)==null?void 0:n.w)!==0,modifiedCount:r.nModified??r.n,upsertedId:Array.isArray(r.upserted)&&r.upserted.length>0?r.upserted[0]._id:null,upsertedCount:Array.isArray(r.upserted)&&r.upserted.length?r.upserted.length:0,matchedCount:Array.isArray(r.upserted)&&r.upserted.length>0?0:r.n}}}_t.ReplaceOneOperation=_0;function go(e,t,r){if(e==null||typeof e!="object")throw new Rt.MongoInvalidArgumentError("Selector must be a valid JavaScript object");if(t==null||typeof t!="object")throw new Rt.MongoInvalidArgumentError("Document must be a valid JavaScript object");const n={q:e,u:t};return typeof r.upsert=="boolean"&&(n.upsert=r.upsert),r.multi&&(n.multi=r.multi),r.hint&&(n.hint=r.hint),r.arrayFilters&&(n.arrayFilters=r.arrayFilters),r.collation&&(n.collation=r.collation),!r.multi&&r.sort!=null&&(n.sort=(0,xh.formatSort)(r.sort)),n}(0,ze.defineAspects)(ai,[ze.Aspect.RETRYABLE,ze.Aspect.WRITE_OPERATION,ze.Aspect.SKIP_COLLATION,ze.Aspect.SUPPORTS_RAW_DATA]);(0,ze.defineAspects)(O0,[ze.Aspect.RETRYABLE,ze.Aspect.WRITE_OPERATION,ze.Aspect.EXPLAINABLE,ze.Aspect.SKIP_COLLATION,ze.Aspect.SUPPORTS_RAW_DATA]);(0,ze.defineAspects)(w0,[ze.Aspect.WRITE_OPERATION,ze.Aspect.EXPLAINABLE,ze.Aspect.SKIP_COLLATION,ze.Aspect.SUPPORTS_RAW_DATA]);(0,ze.defineAspects)(_0,[ze.Aspect.RETRYABLE,ze.Aspect.WRITE_OPERATION,ze.Aspect.SKIP_COLLATION,ze.Aspect.SUPPORTS_RAW_DATA]);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BulkOperationBase=e.FindOperators=e.MongoBulkWriteError=e.WriteError=e.WriteConcernError=e.BulkWriteResult=e.Batch=e.BatchType=void 0,e.mergeBatchResults=C;const t=pe,r=Q,n=Wt,i=qe,o=Pr,u=_t,h=Te,s=ne(),a=ct();e.BatchType=Object.freeze({INSERT:1,UPDATE:2,DELETE:3});class E{constructor(c,w){this.originalZeroIndex=w,this.currentIndex=0,this.originalIndexes=[],this.batchType=c,this.operations=[],this.size=0,this.sizeBytes=0}}e.Batch=E;class l{static generateIdMap(c){const w={};for(const T of c)w[T.index]=T._id;return w}constructor(c,w){this.result=c,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=l.generateIdMap(this.result.upserted),this.insertedIds=l.generateIdMap(this.getSuccessfullyInsertedIds(c,w)),Object.defineProperty(this,"result",{value:this.result,enumerable:!1})}get ok(){return this.result.ok}getSuccessfullyInsertedIds(c,w){return c.writeErrors.length===0?c.insertedIds:w?c.insertedIds.slice(0,c.writeErrors[0].index):c.insertedIds.filter(({index:T})=>!c.writeErrors.some(_=>T===_.index))}getUpsertedIdAt(c){return this.result.upserted[c]}getRawResponse(){return this.result}hasWriteErrors(){return this.result.writeErrors.length>0}getWriteErrorCount(){return this.result.writeErrors.length}getWriteErrorAt(c){return c<this.result.writeErrors.length?this.result.writeErrors[c]:void 0}getWriteErrors(){return this.result.writeErrors}getWriteConcernError(){if(this.result.writeConcernErrors.length!==0){if(this.result.writeConcernErrors.length===1)return this.result.writeConcernErrors[0];{let c="";for(let w=0;w<this.result.writeConcernErrors.length;w++){const T=this.result.writeConcernErrors[w];c=c+T.errmsg,w===0&&(c=c+" and ")}return new g({errmsg:c,code:r.MONGODB_ERROR_CODES.WriteConcernTimeout})}}}toString(){return`BulkWriteResult(${t.EJSON.stringify(this.result)})`}isOk(){return this.result.ok===1}}e.BulkWriteResult=l;class g{constructor(c){this.serverError=c}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})`}}e.WriteConcernError=g;class m{constructor(c){this.err=c}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())})`}}e.WriteError=m;function C(f,c,w,T){if(w?T=w:T&&T.result&&(T=T.result),T==null)return;if(T.ok===0&&c.ok===1){c.ok=0;const A={index:0,code:T.code||0,errmsg:T.message,errInfo:T.errInfo,op:f.operations[0]};c.writeErrors.push(new m(A));return}else if(T.ok===0&&c.ok===0)return;p(f)&&T.n&&(c.nInserted=c.nInserted+T.n),d(f)&&T.n&&(c.nRemoved=c.nRemoved+T.n);let _=0;if(Array.isArray(T.upserted)){_=T.upserted.length;for(let A=0;A<T.upserted.length;A++)c.upserted.push({index:T.upserted[A].index+f.originalZeroIndex,_id:T.upserted[A]._id})}else T.upserted&&(_=1,c.upserted.push({index:f.originalZeroIndex,_id:T.upserted}));if(B(f)&&T.n){const A=T.nModified;c.nUpserted=c.nUpserted+_,c.nMatched=c.nMatched+(T.n-_),typeof A=="number"?c.nModified=c.nModified+A:c.nModified=0}if(Array.isArray(T.writeErrors))for(let A=0;A<T.writeErrors.length;A++){const y={index:f.originalIndexes[T.writeErrors[A].index],code:T.writeErrors[A].code,errmsg:T.writeErrors[A].errmsg,errInfo:T.writeErrors[A].errInfo,op:f.operations[T.writeErrors[A].index]};c.writeErrors.push(new m(y))}T.writeConcernError&&c.writeConcernErrors.push(new g(T.writeConcernError))}async function S(f,c){if(f.s.batches.length===0)return new l(f.s.bulkResult,f.isOrdered);for(const T of f.s.batches){const _=(0,s.resolveOptions)(f,{...c,ordered:f.isOrdered});_.bypassDocumentValidation!==!0&&delete _.bypassDocumentValidation,f.s.bypassDocumentValidation===!0&&(_.bypassDocumentValidation=!0),f.s.checkKeys===!1&&(_.checkKeys=!1),f.retryWrites&&(B(T)&&(f.retryWrites=f.retryWrites&&!T.operations.some(v=>v.multi)),d(T)&&(f.retryWrites=f.retryWrites&&!T.operations.some(v=>v.limit===0)));const A=p(T)?new o.InsertOperation(f.s.namespace,T.operations,_):B(T)?new u.UpdateOperation(f.s.namespace,T.operations,_):d(T)?new n.DeleteOperation(f.s.namespace,T.operations,_):null;if(A==null)throw new r.MongoRuntimeError(`Unknown batchType: ${T.batchType}`);let y=null,F;try{F=await(0,i.executeOperation)(f.s.collection.client,A,_.timeoutContext)}catch(v){y=v}if(y!=null)if(y instanceof r.MongoWriteConcernError){C(T,f.s.bulkResult,y,F);const v=new l(f.s.bulkResult,f.isOrdered);throw new D({message:y.result.writeConcernError.errmsg,code:y.result.writeConcernError.code},v)}else throw new D(y,new l(f.s.bulkResult,f.isOrdered));C(T,f.s.bulkResult,y,F);const R=new l(f.s.bulkResult,f.isOrdered);f.handleWriteError(R)}f.s.batches.length=0;const w=new l(f.s.bulkResult,f.isOrdered);return f.handleWriteError(w),w}class D extends r.MongoServerError{constructor(c,w){super(c),this.writeErrors=[],c instanceof g?this.err=c:c instanceof Error||(this.message=c.message,this.code=c.code,this.writeErrors=c.writeErrors??[]),this.result=w,Object.assign(this,c)}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}}e.MongoBulkWriteError=D;class O{constructor(c){this.bulkOperation=c}update(c){const w=b(this.bulkOperation);return this.bulkOperation.addToOperationsList(e.BatchType.UPDATE,(0,u.makeUpdateStatement)(w.selector,c,{...w,multi:!0}))}updateOne(c){if(!(0,s.hasAtomicOperators)(c,this.bulkOperation.bsonOptions))throw new r.MongoInvalidArgumentError("Update document requires atomic operators");const w=b(this.bulkOperation);return this.bulkOperation.addToOperationsList(e.BatchType.UPDATE,(0,u.makeUpdateStatement)(w.selector,c,{...w,multi:!1}))}replaceOne(c){if((0,s.hasAtomicOperators)(c))throw new r.MongoInvalidArgumentError("Replacement document must not use atomic operators");const w=b(this.bulkOperation);return this.bulkOperation.addToOperationsList(e.BatchType.UPDATE,(0,u.makeUpdateStatement)(w.selector,c,{...w,multi:!1}))}deleteOne(){const c=b(this.bulkOperation);return this.bulkOperation.addToOperationsList(e.BatchType.DELETE,(0,n.makeDeleteStatement)(c.selector,{...c,limit:1}))}delete(){const c=b(this.bulkOperation);return this.bulkOperation.addToOperationsList(e.BatchType.DELETE,(0,n.makeDeleteStatement)(c.selector,{...c,limit:0}))}upsert(){return this.bulkOperation.s.currentOp||(this.bulkOperation.s.currentOp={}),this.bulkOperation.s.currentOp.upsert=!0,this}collation(c){return this.bulkOperation.s.currentOp||(this.bulkOperation.s.currentOp={}),this.bulkOperation.s.currentOp.collation=c,this}arrayFilters(c){return this.bulkOperation.s.currentOp||(this.bulkOperation.s.currentOp={}),this.bulkOperation.s.currentOp.arrayFilters=c,this}hint(c){return this.bulkOperation.s.currentOp||(this.bulkOperation.s.currentOp={}),this.bulkOperation.s.currentOp.hint=c,this}}e.FindOperators=O;class M{constructor(c,w,T){var Y;this.collection=c,this.retryWrites=(Y=c.db.options)==null?void 0:Y.retryWrites,this.isOrdered=T;const _=(0,s.getTopology)(c);w=w??{};const A=c.s.namespace,y=!1,F=void 0,R=_.lastHello(),v=!!(_.s.options&&_.s.options.autoEncrypter),J=R&&R.maxBsonObjectSize?R.maxBsonObjectSize:1024*1024*16,I=v?1024*1024*2:J,N=R&&R.maxWriteBatchSize?R.maxWriteBatchSize:1e3,j=(N-1).toString(10).length+2,x={ok:1,writeErrors:[],writeConcernErrors:[],insertedIds:[],nInserted:0,nUpserted:0,nMatched:0,nModified:0,nRemoved:0,upserted:[]};this.s={bulkResult:x,currentBatch:void 0,currentIndex:0,currentBatchSize:0,currentBatchSizeBytes:0,currentInsertBatch:void 0,currentUpdateBatch:void 0,currentRemoveBatch:void 0,batches:[],writeConcern:a.WriteConcern.fromOptions(w),maxBsonObjectSize:J,maxBatchSizeBytes:I,maxWriteBatchSize:N,maxKeySize:j,namespace:A,topology:_,options:w,bsonOptions:(0,t.resolveBSONOptions)(w),currentOp:F,executed:y,collection:c,err:void 0,checkKeys:typeof w.checkKeys=="boolean"?w.checkKeys:!1},w.bypassDocumentValidation===!0&&(this.s.bypassDocumentValidation=!0)}insert(c){return(0,s.maybeAddIdToDocuments)(this.collection,c,{forceServerObjectId:this.shouldForceServerObjectId()}),this.addToOperationsList(e.BatchType.INSERT,c)}find(c){if(!c)throw new r.MongoInvalidArgumentError("Bulk find operation must specify a selector");return this.s.currentOp={selector:c},new O(this)}raw(c){if(c==null||typeof c!="object")throw new r.MongoInvalidArgumentError("Operation must be an object with an operation key");if("insertOne"in c){const w=this.shouldForceServerObjectId(),T=c.insertOne&&c.insertOne.document==null?c.insertOne:c.insertOne.document;return(0,s.maybeAddIdToDocuments)(this.collection,T,{forceServerObjectId:w}),this.addToOperationsList(e.BatchType.INSERT,T)}if("replaceOne"in c||"updateOne"in c||"updateMany"in c){if("replaceOne"in c){if("q"in c.replaceOne)throw new r.MongoInvalidArgumentError("Raw operations are not allowed");const w=(0,u.makeUpdateStatement)(c.replaceOne.filter,c.replaceOne.replacement,{...c.replaceOne,multi:!1});if((0,s.hasAtomicOperators)(w.u))throw new r.MongoInvalidArgumentError("Replacement document must not use atomic operators");return this.addToOperationsList(e.BatchType.UPDATE,w)}if("updateOne"in c){if("q"in c.updateOne)throw new r.MongoInvalidArgumentError("Raw operations are not allowed");const w=(0,u.makeUpdateStatement)(c.updateOne.filter,c.updateOne.update,{...c.updateOne,multi:!1});if(!(0,s.hasAtomicOperators)(w.u,this.bsonOptions))throw new r.MongoInvalidArgumentError("Update document requires atomic operators");return this.addToOperationsList(e.BatchType.UPDATE,w)}if("updateMany"in c){if("q"in c.updateMany)throw new r.MongoInvalidArgumentError("Raw operations are not allowed");const w=(0,u.makeUpdateStatement)(c.updateMany.filter,c.updateMany.update,{...c.updateMany,multi:!0});if(!(0,s.hasAtomicOperators)(w.u,this.bsonOptions))throw new r.MongoInvalidArgumentError("Update document requires atomic operators");return this.addToOperationsList(e.BatchType.UPDATE,w)}}if("deleteOne"in c){if("q"in c.deleteOne)throw new r.MongoInvalidArgumentError("Raw operations are not allowed");return this.addToOperationsList(e.BatchType.DELETE,(0,n.makeDeleteStatement)(c.deleteOne.filter,{...c.deleteOne,limit:1}))}if("deleteMany"in c){if("q"in c.deleteMany)throw new r.MongoInvalidArgumentError("Raw operations are not allowed");return this.addToOperationsList(e.BatchType.DELETE,(0,n.makeDeleteStatement)(c.deleteMany.filter,{...c.deleteMany,limit:0}))}throw new r.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(){const c=[...this.s.batches];return this.isOrdered?this.s.currentBatch&&c.push(this.s.currentBatch):(this.s.currentInsertBatch&&c.push(this.s.currentInsertBatch),this.s.currentUpdateBatch&&c.push(this.s.currentUpdateBatch),this.s.currentRemoveBatch&&c.push(this.s.currentRemoveBatch)),c}async execute(c={}){if(this.s.executed)throw new r.MongoBatchReExecutionError;const w=a.WriteConcern.fromOptions(c);if(w&&(this.s.writeConcern=w),this.isOrdered?this.s.currentBatch&&this.s.batches.push(this.s.currentBatch):(this.s.currentInsertBatch&&this.s.batches.push(this.s.currentInsertBatch),this.s.currentUpdateBatch&&this.s.batches.push(this.s.currentUpdateBatch),this.s.currentRemoveBatch&&this.s.batches.push(this.s.currentRemoveBatch)),this.s.batches.length===0)throw new r.MongoInvalidArgumentError("Invalid BulkOperation, Batch cannot be empty");this.s.executed=!0;const T=(0,s.resolveOptions)(this.collection,{...this.s.options,...c});return T.timeoutContext??(T.timeoutContext=h.TimeoutContext.create({session:T.session,timeoutMS:T.timeoutMS,serverSelectionTimeoutMS:this.collection.client.s.options.serverSelectionTimeoutMS,waitQueueTimeoutMS:this.collection.client.s.options.waitQueueTimeoutMS})),T.session==null?await this.collection.client.withSession({explicit:!1},async _=>await S(this,{...T,session:_})):await S(this,{...T})}handleWriteError(c){if(this.s.bulkResult.writeErrors.length>0){const T=this.s.bulkResult.writeErrors[0].errmsg?this.s.bulkResult.writeErrors[0].errmsg:"write operation failed";throw new D({message:T,code:this.s.bulkResult.writeErrors[0].code,writeErrors:this.s.bulkResult.writeErrors},c)}const w=c.getWriteConcernError();if(w)throw new D(w,c)}shouldForceServerObjectId(){var c;return this.s.options.forceServerObjectId===!0||((c=this.s.collection.db.options)==null?void 0:c.forceServerObjectId)===!0}}e.BulkOperationBase=M;function p(f){return f.batchType===e.BatchType.INSERT}function B(f){return f.batchType===e.BatchType.UPDATE}function d(f){return f.batchType===e.BatchType.DELETE}function b(f){let{currentOp:c}=f.s;return f.s.currentOp=void 0,c||(c={}),c}})(Yn);Object.defineProperty(ui,"__esModule",{value:!0});ui.OrderedBulkOperation=void 0;const Vh=pe,na=Q,Fi=Yn;class Wh extends Fi.BulkOperationBase{constructor(t,r){super(t,r,!0)}addToOperationsList(t,r){const n=Vh.calculateObjectSize(r,{checkKeys:!1,ignoreUndefined:!1});if(n>=this.s.maxBsonObjectSize)throw new na.MongoInvalidArgumentError(`Document is larger than the maximum size ${this.s.maxBsonObjectSize}`);this.s.currentBatch==null&&(this.s.currentBatch=new Fi.Batch(t,this.s.currentIndex));const i=this.s.maxKeySize;if((this.s.currentBatchSize+1>=this.s.maxWriteBatchSize||this.s.currentBatchSize>0&&this.s.currentBatchSizeBytes+i+n>=this.s.maxBatchSizeBytes||this.s.currentBatch.batchType!==t)&&(this.s.batches.push(this.s.currentBatch),this.s.currentBatch=new Fi.Batch(t,this.s.currentIndex),this.s.currentBatchSize=0,this.s.currentBatchSizeBytes=0),t===Fi.BatchType.INSERT&&this.s.bulkResult.insertedIds.push({index:this.s.currentIndex,_id:r._id}),Array.isArray(r))throw new na.MongoInvalidArgumentError("Operation passed in cannot be an Array");return this.s.currentBatch.originalIndexes.push(this.s.currentIndex),this.s.currentBatch.operations.push(r),this.s.currentBatchSize+=1,this.s.currentBatchSizeBytes+=i+n,this.s.currentIndex+=1,this}}ui.OrderedBulkOperation=Wh;var ci={};Object.defineProperty(ci,"__esModule",{value:!0});ci.UnorderedBulkOperation=void 0;const Gh=pe,ia=Q,Kt=Yn;class qh extends Kt.BulkOperationBase{constructor(t,r){super(t,r,!1)}handleWriteError(t){if(!this.s.batches.length)return super.handleWriteError(t)}addToOperationsList(t,r){const n=Gh.calculateObjectSize(r,{checkKeys:!1,ignoreUndefined:!1});if(n>=this.s.maxBsonObjectSize)throw new ia.MongoInvalidArgumentError(`Document is larger than the maximum size ${this.s.maxBsonObjectSize}`);this.s.currentBatch=void 0,t===Kt.BatchType.INSERT?this.s.currentBatch=this.s.currentInsertBatch:t===Kt.BatchType.UPDATE?this.s.currentBatch=this.s.currentUpdateBatch:t===Kt.BatchType.DELETE&&(this.s.currentBatch=this.s.currentRemoveBatch);const i=this.s.maxKeySize;if(this.s.currentBatch==null&&(this.s.currentBatch=new Kt.Batch(t,this.s.currentIndex)),(this.s.currentBatch.size+1>=this.s.maxWriteBatchSize||this.s.currentBatch.size>0&&this.s.currentBatch.sizeBytes+i+n>=this.s.maxBatchSizeBytes||this.s.currentBatch.batchType!==t)&&(this.s.batches.push(this.s.currentBatch),this.s.currentBatch=new Kt.Batch(t,this.s.currentIndex)),Array.isArray(r))throw new ia.MongoInvalidArgumentError("Operation passed in cannot be an Array");return this.s.currentBatch.operations.push(r),this.s.currentBatch.originalIndexes.push(this.s.currentIndex),this.s.currentIndex=this.s.currentIndex+1,t===Kt.BatchType.INSERT?(this.s.currentInsertBatch=this.s.currentBatch,this.s.bulkResult.insertedIds.push({index:this.s.bulkResult.insertedIds.length,_id:r._id})):t===Kt.BatchType.UPDATE?this.s.currentUpdateBatch=this.s.currentBatch:t===Kt.BatchType.DELETE&&(this.s.currentRemoveBatch=this.s.currentBatch),this.s.currentBatch.size+=1,this.s.currentBatch.sizeBytes+=i+n,this}}ci.UnorderedBulkOperation=qh;var Jr={},Dn={},qr={},tt={},Je={},Cr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MongoLogger=e.MongoLoggableComponent=e.SEVERITY_LEVEL_MAP=e.DEFAULT_MAX_DOCUMENT_LENGTH=e.SeverityLevel=void 0,e.parseSeverityFromString=h,e.createStdioLogger=s,e.stringifyWithMaxLen=g,e.defaultLogTransform=p;const t=Ar,r=t2,n=pe,i=Ve,o=ne();e.SeverityLevel=Object.freeze({EMERGENCY:"emergency",ALERT:"alert",CRITICAL:"critical",ERROR:"error",WARNING:"warn",NOTICE:"notice",INFORMATIONAL:"info",DEBUG:"debug",TRACE:"trace",OFF:"off"}),e.DEFAULT_MAX_DOCUMENT_LENGTH=1e3;class u extends Map{constructor(b){const f=[];for(const[c,w]of b)f.push([w,c]);f.push(...b),super(f)}getNumericSeverityLevel(b){return this.get(b)}getSeverityLevelName(b){return this.get(b)}}e.SEVERITY_LEVEL_MAP=new u([[e.SeverityLevel.OFF,-1/0],[e.SeverityLevel.EMERGENCY,0],[e.SeverityLevel.ALERT,1],[e.SeverityLevel.CRITICAL,2],[e.SeverityLevel.ERROR,3],[e.SeverityLevel.WARNING,4],[e.SeverityLevel.NOTICE,5],[e.SeverityLevel.INFORMATIONAL,6],[e.SeverityLevel.DEBUG,7],[e.SeverityLevel.TRACE,8]]),e.MongoLoggableComponent=Object.freeze({COMMAND:"command",TOPOLOGY:"topology",SERVER_SELECTION:"serverSelection",CONNECTION:"connection",CLIENT:"client"});function h(d){const b=Object.values(e.SeverityLevel),f=d==null?void 0:d.toLowerCase();return f!=null&&b.includes(f)?f:null}function s(d){return{write:b=>new Promise((f,c)=>{const w=(0,r.inspect)(b,{compact:!0,breakLength:1/0});d.write(`${w}
8
+ `,"utf-8",T=>{if(T)return c(T);f(!0)})})}}function a({MONGODB_LOG_PATH:d},{mongodbLogPath:b}){return typeof b=="string"&&/^stderr$/i.test(b)?{mongodbLogPath:s(t.stderr),mongodbLogPathIsStdErr:!0}:typeof b=="string"&&/^stdout$/i.test(b)?{mongodbLogPath:s(t.stdout),mongodbLogPathIsStdErr:!1}:typeof b=="object"&&typeof(b==null?void 0:b.write)=="function"?{mongodbLogPath:b,mongodbLogPathIsStdErr:!1}:d&&/^stderr$/i.test(d)?{mongodbLogPath:s(t.stderr),mongodbLogPathIsStdErr:!0}:d&&/^stdout$/i.test(d)?{mongodbLogPath:s(t.stdout),mongodbLogPathIsStdErr:!1}:{mongodbLogPath:s(t.stderr),mongodbLogPathIsStdErr:!0}}function E(d,b,f){return h(d)??h(b)??f}function l(d,b){const f=e.SEVERITY_LEVEL_MAP.getNumericSeverityLevel(d),c=e.SEVERITY_LEVEL_MAP.getNumericSeverityLevel(b);return f<c?-1:f>c?1:0}function g(d,b,f={}){let c="",w=0;const T=function(A,y){if(!(w>=b)){if(A==="")return w+=1,y;if(w+=A.length+4,y==null)return y;switch(typeof y){case"string":w+=y.length+2;break;case"number":case"bigint":w+=String(y).length;break;case"boolean":w+=y?4:5;break;case"object":if((0,o.isUint8Array)(y))w+=22+y.byteLength+y.byteLength*.33+18|0;else if("_bsontype"in y){const F=y;switch(F._bsontype){case"Int32":w+=String(F.value).length;break;case"Double":w+=(F.value|0)===F.value?String(F.value).length+2:String(F.value).length;break;case"Long":w+=F.toString().length;break;case"ObjectId":w+=35;break;case"MaxKey":case"MinKey":w+=13;break;case"Binary":w+=22+y.position+y.position*.33+18|0;break;case"Timestamp":w+=19+String(F.t).length+5+String(F.i).length+2;break;case"Code":F.scope==null?w+=F.code.length+10+2:w+=F.code.length+10+11;break;case"BSONRegExp":w+=34+F.pattern.length+13+F.options.length+3;break}}}return y}};if(typeof d=="string")c=d;else if(typeof d=="function")c=d.name;else try{b!==0?c=n.EJSON.stringify(d,T,0,f):c=n.EJSON.stringify(d,f)}catch(_){c=`Extended JSON serialization failed with: ${_.message}`}return b!==0&&c.length>b&&c.charCodeAt(b-1)!==c.codePointAt(b-1)&&(b--,b===0)?"":b!==0&&c.length>b?`${c.slice(0,b)}...`:c}function m(d){const b=d;return b.toLog!==void 0&&typeof b.toLog=="function"}function C(d,b,f=e.DEFAULT_MAX_DOCUMENT_LENGTH){const{selector:c,operation:w,topologyDescription:T,message:_}=b;return d.selector=g(c,f),d.operation=w,d.topologyDescription=g(T,f),d.message=_,d}function S(d,b){d.commandName=b.commandName,d.requestId=b.requestId,d.driverConnectionId=b.connectionId;const{host:f,port:c}=o.HostAddress.fromString(b.address).toHostPort();return d.serverHost=f,d.serverPort=c,b!=null&&b.serviceId&&(d.serviceId=b.serviceId.toHexString()),d.databaseName=b.databaseName,d.serverConnectionId=b.serverConnectionId,d}function D(d,b){const{host:f,port:c}=o.HostAddress.fromString(b.address).toHostPort();return d.serverHost=f,d.serverPort=c,d}function O(d,b){return d.topologyId=b.topologyId,d}function M(d,b){const{awaited:f,connectionId:c}=b;d.awaited=f,d.driverConnectionId=b.connectionId;const{host:w,port:T}=o.HostAddress.fromString(c).toHostPort();return d.serverHost=w,d.serverPort=T,d}function p(d,b=e.DEFAULT_MAX_DOCUMENT_LENGTH){var c,w,T,_,A;let f=Object.create(null);switch(d.name){case i.SERVER_SELECTION_STARTED:return f=C(f,d,b),f;case i.SERVER_SELECTION_FAILED:return f=C(f,d,b),f.failure=(c=d.failure)==null?void 0:c.message,f;case i.SERVER_SELECTION_SUCCEEDED:return f=C(f,d,b),f.serverHost=d.serverHost,f.serverPort=d.serverPort,f;case i.WAITING_FOR_SUITABLE_SERVER:return f=C(f,d,b),f.remainingTimeMS=d.remainingTimeMS,f;case i.COMMAND_STARTED:return f=S(f,d),f.message="Command started",f.command=g(d.command,b,{relaxed:!0}),f.databaseName=d.databaseName,f;case i.COMMAND_SUCCEEDED:return f=S(f,d),f.message="Command succeeded",f.durationMS=d.duration,f.reply=g(d.reply,b,{relaxed:!0}),f;case i.COMMAND_FAILED:return f=S(f,d),f.message="Command failed",f.durationMS=d.duration,f.failure=((w=d.failure)==null?void 0:w.message)??"(redacted)",f;case i.CONNECTION_POOL_CREATED:if(f=D(f,d),f.message="Connection pool created",d.options){const{maxIdleTimeMS:y,minPoolSize:F,maxPoolSize:R,maxConnecting:v,waitQueueTimeoutMS:J}=d.options;f={...f,maxIdleTimeMS:y,minPoolSize:F,maxPoolSize:R,maxConnecting:v,waitQueueTimeoutMS:J}}return f;case i.CONNECTION_POOL_READY:return f=D(f,d),f.message="Connection pool ready",f;case i.CONNECTION_POOL_CLEARED:return f=D(f,d),f.message="Connection pool cleared",((T=d.serviceId)==null?void 0:T._bsontype)==="ObjectId"&&(f.serviceId=(_=d.serviceId)==null?void 0:_.toHexString()),f;case i.CONNECTION_POOL_CLOSED:return f=D(f,d),f.message="Connection pool closed",f;case i.CONNECTION_CREATED:return f=D(f,d),f.message="Connection created",f.driverConnectionId=d.connectionId,f;case i.CONNECTION_READY:return f=D(f,d),f.message="Connection ready",f.driverConnectionId=d.connectionId,f.durationMS=d.durationMS,f;case i.CONNECTION_CLOSED:switch(f=D(f,d),f.message="Connection closed",f.driverConnectionId=d.connectionId,d.reason){case"stale":f.reason="Connection became stale because the pool was cleared";break;case"idle":f.reason="Connection has been available but unused for longer than the configured max idle time";break;case"error":f.reason="An error occurred while using the connection",d.error&&(f.error=d.error);break;case"poolClosed":f.reason="Connection pool was closed";break;default:f.reason=`Unknown close reason: ${d.reason}`}return f;case i.CONNECTION_CHECK_OUT_STARTED:return f=D(f,d),f.message="Connection checkout started",f;case i.CONNECTION_CHECK_OUT_FAILED:switch(f=D(f,d),f.message="Connection checkout failed",d.reason){case"poolClosed":f.reason="Connection pool was closed";break;case"timeout":f.reason="Wait queue timeout elapsed without a connection becoming available";break;case"connectionError":f.reason="An error occurred while trying to establish a new connection",d.error&&(f.error=d.error);break;default:f.reason=`Unknown close reason: ${d.reason}`}return f.durationMS=d.durationMS,f;case i.CONNECTION_CHECKED_OUT:return f=D(f,d),f.message="Connection checked out",f.driverConnectionId=d.connectionId,f.durationMS=d.durationMS,f;case i.CONNECTION_CHECKED_IN:return f=D(f,d),f.message="Connection checked in",f.driverConnectionId=d.connectionId,f;case i.SERVER_OPENING:return f=O(f,d),f=D(f,d),f.message="Starting server monitoring",f;case i.SERVER_CLOSED:return f=O(f,d),f=D(f,d),f.message="Stopped server monitoring",f;case i.SERVER_HEARTBEAT_STARTED:return f=O(f,d),f=M(f,d),f.message="Server heartbeat started",f;case i.SERVER_HEARTBEAT_SUCCEEDED:return f=O(f,d),f=M(f,d),f.message="Server heartbeat succeeded",f.durationMS=d.duration,f.serverConnectionId=d.serverConnectionId,f.reply=g(d.reply,b,{relaxed:!0}),f;case i.SERVER_HEARTBEAT_FAILED:return f=O(f,d),f=M(f,d),f.message="Server heartbeat failed",f.durationMS=d.duration,f.failure=(A=d.failure)==null?void 0:A.message,f;case i.TOPOLOGY_OPENING:return f=O(f,d),f.message="Starting topology monitoring",f;case i.TOPOLOGY_CLOSED:return f=O(f,d),f.message="Stopped topology monitoring",f;case i.TOPOLOGY_DESCRIPTION_CHANGED:return f=O(f,d),f.message="Topology description changed",f.previousDescription=f.reply=g(d.previousDescription,b),f.newDescription=f.reply=g(d.newDescription,b),f;default:for(const[y,F]of Object.entries(d))F!=null&&(f[y]=F)}return f}class B{constructor(b){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=b.componentSeverities,this.maxDocumentLength=b.maxDocumentLength,this.logDestination=b.logDestination,this.logDestinationIsStdErr=b.logDestinationIsStdErr,this.severities=this.createLoggingSeverities()}createLoggingSeverities(){const b=Object();for(const f of Object.values(e.MongoLoggableComponent)){b[f]={};for(const c of Object.values(e.SeverityLevel))b[f][c]=l(c,this.componentSeverities[f])<=0}return b}turnOffSeverities(){for(const b of Object.values(e.MongoLoggableComponent)){this.componentSeverities[b]=e.SeverityLevel.OFF;for(const f of Object.values(e.SeverityLevel))this.severities[b][f]=!1}}logWriteFailureHandler(b){if(this.logDestinationIsStdErr){this.turnOffSeverities(),this.clearPendingLog();return}this.logDestination=s(t.stderr),this.logDestinationIsStdErr=!0,this.clearPendingLog(),this.error(e.MongoLoggableComponent.CLIENT,{toLog:function(){return{message:"User input for mongodbLogPath is now invalid. Logging is halted.",error:b.message}}}),this.turnOffSeverities(),this.clearPendingLog()}clearPendingLog(){this.pendingLog=null}willLog(b,f){return f===e.SeverityLevel.OFF?!1:this.severities[b][f]}log(b,f,c){if(!this.willLog(f,b))return;let w={t:new Date,c:f,s:b};if(typeof c=="string"?w.message=c:typeof c=="object"&&(m(c)?w={...w,...c.toLog()}:w={...w,...p(c,this.maxDocumentLength)}),(0,o.isPromiseLike)(this.pendingLog)){this.pendingLog=this.pendingLog.then(()=>this.logDestination.write(w)).then(this.clearPendingLog.bind(this),this.logWriteFailureHandler.bind(this));return}try{const T=this.logDestination.write(w);(0,o.isPromiseLike)(T)&&(this.pendingLog=T.then(this.clearPendingLog.bind(this),this.logWriteFailureHandler.bind(this)))}catch(T){this.logWriteFailureHandler(T)}}static resolveOptions(b,f){var _,A,y,F,R,v;const c=a(b,f),w={...b,...f,mongodbLogPath:c.mongodbLogPath,mongodbLogPathIsStdErr:c.mongodbLogPathIsStdErr},T=E((_=w.mongodbLogComponentSeverities)==null?void 0:_.default,w.MONGODB_LOG_ALL,e.SeverityLevel.OFF);return{componentSeverities:{command:E((A=w.mongodbLogComponentSeverities)==null?void 0:A.command,w.MONGODB_LOG_COMMAND,T),topology:E((y=w.mongodbLogComponentSeverities)==null?void 0:y.topology,w.MONGODB_LOG_TOPOLOGY,T),serverSelection:E((F=w.mongodbLogComponentSeverities)==null?void 0:F.serverSelection,w.MONGODB_LOG_SERVER_SELECTION,T),connection:E((R=w.mongodbLogComponentSeverities)==null?void 0:R.connection,w.MONGODB_LOG_CONNECTION,T),client:E((v=w.mongodbLogComponentSeverities)==null?void 0:v.client,w.MONGODB_LOG_CLIENT,T),default:T},maxDocumentLength:w.mongodbLogMaxDocumentLength??(0,o.parseUnsignedInteger)(w.MONGODB_LOG_MAX_DOCUMENT_LENGTH)??1e3,logDestination:w.mongodbLogPath,logDestinationIsStdErr:w.mongodbLogPathIsStdErr}}}e.MongoLogger=B})(Cr);Object.defineProperty(Je,"__esModule",{value:!0});Je.CancellationToken=Je.TypedEventEmitter=void 0;const Hh=e2,Kh=Cr,Yh=ne();class D0 extends Hh.EventEmitter{emitAndLog(t,...r){var n;this.emit(t,...r),this.component&&((n=this.mongoLogger)==null||n.debug(this.component,r[0]))}emitAndLogHeartbeat(t,r,n,...i){var o;if(this.emit(t,...i),this.component){const u={topologyId:r,serverConnectionId:n??null,...i[0]};(o=this.mongoLogger)==null||o.debug(this.component,u)}}emitAndLogCommand(t,r,n,i,...o){var u;if(t&&this.emit(r,...o),i){const h={databaseName:n,...o[0]};(u=this.mongoLogger)==null||u.debug(Kh.MongoLoggableComponent.COMMAND,h)}}}Je.TypedEventEmitter=D0;class Xh extends D0{constructor(...t){super(...t),this.on("error",Yh.noop)}}Je.CancellationToken=Xh;var li={};Object.defineProperty(li,"__esModule",{value:!0});li.GetMoreOperation=void 0;const Jh=De(),oa=Q,Qh=ne(),Vi=Me;class T0 extends Vi.AbstractOperation{constructor(t,r,n,i){super(i),this.SERVER_COMMAND_RESPONSE_TYPE=Jh.CursorResponse,this.options=i,this.ns=t,this.cursorId=r,this.server=n}get commandName(){return"getMore"}buildCommand(t){if(this.cursorId==null||this.cursorId.isZero())throw new oa.MongoRuntimeError("Unable to iterate cursor with no id");const r=this.ns.collection;if(r==null)throw new oa.MongoRuntimeError("A collection name must be determined before getMore");const n={getMore:this.cursorId,collection:r};return typeof this.options.batchSize=="number"&&(n.batchSize=Math.abs(this.options.batchSize)),typeof this.options.maxAwaitTimeMS=="number"&&(n.maxTimeMS=this.options.maxAwaitTimeMS),this.options.comment!==void 0&&(0,Qh.maxWireVersion)(t)>=9&&(n.comment=this.options.comment),n}buildOptions(t){return{returnFieldSelector:null,documentsReturnedIn:"nextBatch",timeoutContext:t,...this.options}}handleOk(t){return t}}li.GetMoreOperation=T0;(0,Vi.defineAspects)(T0,[Vi.Aspect.READ_OPERATION,Vi.Aspect.MUST_SELECT_SAME_SERVER]);var Ao={};Object.defineProperty(Ao,"__esModule",{value:!0});Ao.KillCursorsOperation=void 0;const Zh=De(),$h=Q,d1=Me;class B0 extends d1.AbstractOperation{constructor(t,r,n,i){super(i),this.SERVER_COMMAND_RESPONSE_TYPE=Zh.MongoDBResponse,this.ns=r,this.cursorId=t,this.server=n}get commandName(){return"killCursors"}buildCommand(t,r){const n=this.ns.collection;if(n==null)throw new $h.MongoRuntimeError("A collection name must be determined before killCursors");return{killCursors:n,cursors:[this.cursorId]}}buildOptions(t){return{session:this.session,timeoutContext:t}}handleError(t){}}Ao.KillCursorsOperation=B0;(0,d1.defineAspects)(B0,[d1.Aspect.MUST_SELECT_SAME_SERVER]);var ut={},hi={};Object.defineProperty(hi,"__esModule",{value:!0});hi.ConnectionPoolMetrics=void 0;const Jt=class Jt{constructor(){this.txnConnections=0,this.cursorConnections=0,this.otherConnections=0}markPinned(t){t===Jt.TXN?this.txnConnections+=1:t===Jt.CURSOR?this.cursorConnections+=1:this.otherConnections+=1}markUnpinned(t){t===Jt.TXN?this.txnConnections-=1:t===Jt.CURSOR?this.cursorConnections-=1:this.otherConnections-=1}info(t){return`Timed out while checking out a connection from connection pool: maxPoolSize: ${t}, 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}};Jt.TXN="txn",Jt.CURSOR="cursor",Jt.OTHER="other";let f1=Jt;hi.ConnectionPoolMetrics=f1;var z1={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Transaction=e.TxnState=void 0,e.isTransactionCommand=a;const t=Q,r=Pt,n=Ke,i=ct();e.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"});const o={[e.TxnState.NO_TRANSACTION]:[e.TxnState.NO_TRANSACTION,e.TxnState.STARTING_TRANSACTION],[e.TxnState.STARTING_TRANSACTION]:[e.TxnState.TRANSACTION_IN_PROGRESS,e.TxnState.TRANSACTION_COMMITTED,e.TxnState.TRANSACTION_COMMITTED_EMPTY,e.TxnState.TRANSACTION_ABORTED],[e.TxnState.TRANSACTION_IN_PROGRESS]:[e.TxnState.TRANSACTION_IN_PROGRESS,e.TxnState.TRANSACTION_COMMITTED,e.TxnState.TRANSACTION_ABORTED],[e.TxnState.TRANSACTION_COMMITTED]:[e.TxnState.TRANSACTION_COMMITTED,e.TxnState.TRANSACTION_COMMITTED_EMPTY,e.TxnState.STARTING_TRANSACTION,e.TxnState.NO_TRANSACTION],[e.TxnState.TRANSACTION_ABORTED]:[e.TxnState.STARTING_TRANSACTION,e.TxnState.NO_TRANSACTION],[e.TxnState.TRANSACTION_COMMITTED_EMPTY]:[e.TxnState.TRANSACTION_COMMITTED_EMPTY,e.TxnState.NO_TRANSACTION]},u=new Set([e.TxnState.STARTING_TRANSACTION,e.TxnState.TRANSACTION_IN_PROGRESS]),h=new Set([e.TxnState.TRANSACTION_COMMITTED,e.TxnState.TRANSACTION_COMMITTED_EMPTY,e.TxnState.TRANSACTION_ABORTED]);class s{constructor(l){l=l??{},this.state=e.TxnState.NO_TRANSACTION,this.options={};const g=i.WriteConcern.fromOptions(l);if(g){if(g.w===0)throw new t.MongoTransactionError("Transactions do not support unacknowledged write concern");this.options.writeConcern=g}l.readConcern&&(this.options.readConcern=r.ReadConcern.fromOptions(l)),l.readPreference&&(this.options.readPreference=n.ReadPreference.fromOptions(l)),l.maxCommitTimeMS&&(this.options.maxTimeMS=l.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===e.TxnState.STARTING_TRANSACTION}get isActive(){return u.has(this.state)}get isCommitted(){return h.has(this.state)}transition(l){const g=o[this.state];if(g&&g.includes(l)){this.state=l,(this.state===e.TxnState.NO_TRANSACTION||this.state===e.TxnState.STARTING_TRANSACTION||this.state===e.TxnState.TRANSACTION_ABORTED)&&this.unpinServer();return}throw new t.MongoRuntimeError(`Attempted illegal state transition from [${this.state}] to [${l}]`)}pinServer(l){this.isActive&&(this._pinnedServer=l)}unpinServer(){this._pinnedServer=void 0}}e.Transaction=s;function a(E){return!!(E.commitTransaction||E.abortTransaction)}})(z1);Object.defineProperty(ut,"__esModule",{value:!0});ut.ServerSessionPool=ut.ServerSession=ut.ClientSession=void 0;ut.maybeClearPinnedConnection=Gi;ut.applySession=id;ut.updateSessionFromResponse=od;const ed=Fc,Wi=pe,$i=hi,b0=Ve,de=Q,td=Je,Ri=qe,vs=tr,rd=Pt,Ps=Ke,m1=Ne,Ls=Te,be=z1,Ye=ne(),Qr=ct();class V1 extends td.TypedEventEmitter{constructor(t,r,n,i){var u;if(super(),this.timeoutContext=null,this.on("error",Ye.noop),t==null)throw new de.MongoRuntimeError("ClientSession requires a MongoClient");if(r==null||!(r instanceof F0))throw new de.MongoRuntimeError("ClientSession requires a ServerSessionPool");if(n=n??{},this.snapshotEnabled=n.snapshot===!0,n.causalConsistency===!0&&this.snapshotEnabled)throw new de.MongoInvalidArgumentError('Properties "causalConsistency" and "snapshot" are mutually exclusive');this.client=t,this.sessionPool=r,this.hasEnded=!1,this.clientOptions=i,this.timeoutMS=n.defaultTimeoutMS??((u=t.s.options)==null?void 0:u.timeoutMS),this.explicit=!!n.explicit,this._serverSession=this.explicit?this.sessionPool.acquire():null,this.txnNumberIncrement=0;const o=this.explicit&&n.snapshot!==!0;this.supports={causalConsistency:n.causalConsistency??o},this.clusterTime=n.initialClusterTime,this.operationTime=void 0,this.owner=n.owner,this.defaultTransactionOptions={...n.defaultTransactionOptions},this.transaction=new be.Transaction}get id(){var t;return(t=this.serverSession)==null?void 0:t.id}get serverSession(){let t=this._serverSession;if(t==null){if(this.explicit)throw new de.MongoRuntimeError("Unexpected null serverSession for an explicit session");if(this.hasEnded)throw new de.MongoRuntimeError("Unexpected null serverSession for an ended implicit session");t=this.sessionPool.acquire(),this._serverSession=t}return t}get loadBalanced(){var t;return((t=this.client.topology)==null?void 0:t.description.type)===m1.TopologyType.LoadBalanced}pin(t){if(this.pinnedConnection)throw TypeError("Cannot pin multiple connections to the same session");this.pinnedConnection=t,t.emit(b0.PINNED,this.inTransaction()?$i.ConnectionPoolMetrics.TXN:$i.ConnectionPoolMetrics.CURSOR)}unpin(t){if(this.loadBalanced)return Gi(this,t);this.transaction.unpinServer()}get isPinned(){return this.loadBalanced?!!this.pinnedConnection:this.transaction.isPinned}async endSession(t){try{this.inTransaction()&&await this.abortTransaction({...t,throwTimeout:!0})}catch(r){if(r.name==="MongoOperationTimeoutError")throw r;(0,Ye.squashError)(r)}finally{if(!this.hasEnded){const r=this.serverSession;r!=null&&(this.sessionPool.release(r),this._serverSession=new W1(r)),this.hasEnded=!0,this.emit("ended",this)}Gi(this,{force:!0,...t})}}async[Symbol.asyncDispose](){await this.endSession({force:!0})}advanceOperationTime(t){if(this.operationTime==null){this.operationTime=t;return}t.greaterThan(this.operationTime)&&(this.operationTime=t)}advanceClusterTime(t){var r,n;if(!t||typeof t!="object")throw new de.MongoInvalidArgumentError("input cluster time must be an object");if(!t.clusterTime||t.clusterTime._bsontype!=="Timestamp")throw new de.MongoInvalidArgumentError('input cluster time "clusterTime" property must be a valid BSON Timestamp');if(!t.signature||((r=t.signature.hash)==null?void 0:r._bsontype)!=="Binary"||typeof t.signature.keyId!="bigint"&&typeof t.signature.keyId!="number"&&((n=t.signature.keyId)==null?void 0:n._bsontype)!=="Long")throw new de.MongoInvalidArgumentError('input cluster time must have a valid "signature" property with BSON Binary hash and BSON Long keyId');(0,m1._advanceClusterTime)(this,t)}equals(t){return!(t instanceof V1)||this.id==null||t.id==null?!1:Ye.ByteUtils.equals(this.id.id.buffer,t.id.id.buffer)}incrementTransactionNumber(){this.txnNumberIncrement+=1}inTransaction(){return this.transaction.isActive}startTransaction(t){var r,n,i;if(this.snapshotEnabled)throw new de.MongoCompatibilityError("Transactions are not supported in snapshot sessions");if(this.inTransaction())throw new de.MongoTransactionError("Transaction already in progress");this.isPinned&&this.transaction.isCommitted&&this.unpin(),this.commitAttempted=!1,this.incrementTransactionNumber(),this.transaction=new be.Transaction({readConcern:(t==null?void 0:t.readConcern)??this.defaultTransactionOptions.readConcern??((r=this.clientOptions)==null?void 0:r.readConcern),writeConcern:(t==null?void 0:t.writeConcern)??this.defaultTransactionOptions.writeConcern??((n=this.clientOptions)==null?void 0:n.writeConcern),readPreference:(t==null?void 0:t.readPreference)??this.defaultTransactionOptions.readPreference??((i=this.clientOptions)==null?void 0:i.readPreference),maxCommitTimeMS:(t==null?void 0:t.maxCommitTimeMS)??this.defaultTransactionOptions.maxCommitTimeMS}),this.transaction.transition(be.TxnState.STARTING_TRANSACTION)}async commitTransaction(t){var h;if(this.transaction.state===be.TxnState.NO_TRANSACTION)throw new de.MongoTransactionError("No transaction started");if(this.transaction.state===be.TxnState.STARTING_TRANSACTION||this.transaction.state===be.TxnState.TRANSACTION_COMMITTED_EMPTY){this.transaction.transition(be.TxnState.TRANSACTION_COMMITTED_EMPTY);return}if(this.transaction.state===be.TxnState.TRANSACTION_ABORTED)throw new de.MongoTransactionError("Cannot call commitTransaction after calling abortTransaction");const r={commitTransaction:1},n=typeof(t==null?void 0:t.timeoutMS)=="number"?t.timeoutMS:typeof this.timeoutMS=="number"?this.timeoutMS:null,i=this.transaction.options.writeConcern??((h=this.clientOptions)==null?void 0:h.writeConcern);if(i!=null)if(n==null&&this.timeoutContext==null)Qr.WriteConcern.apply(r,{wtimeoutMS:1e4,w:"majority",...i});else{const s=Object.keys(i);(s.length>2||!s.includes("wtimeoutMS")&&!s.includes("wTimeoutMS"))&&Qr.WriteConcern.apply(r,{...i,wtimeoutMS:void 0})}(this.transaction.state===be.TxnState.TRANSACTION_COMMITTED||this.commitAttempted)&&(n==null&&this.timeoutContext==null?Qr.WriteConcern.apply(r,{wtimeoutMS:1e4,...i,w:"majority"}):Qr.WriteConcern.apply(r,{w:"majority",...i,wtimeoutMS:void 0})),typeof this.transaction.options.maxTimeMS=="number"&&(r.maxTimeMS=this.transaction.options.maxTimeMS),this.transaction.recoveryToken&&(r.recoveryToken=this.transaction.recoveryToken);const o=new vs.RunCommandOperation(new Ye.MongoDBNamespace("admin"),r,{session:this,readPreference:Ps.ReadPreference.primary,bypassPinningCheck:!0}),u=this.timeoutContext??(typeof n=="number"?Ls.TimeoutContext.create({serverSelectionTimeoutMS:this.clientOptions.serverSelectionTimeoutMS,socketTimeoutMS:this.clientOptions.socketTimeoutMS,timeoutMS:n}):null);try{await(0,Ri.executeOperation)(this.client,o,u),this.commitAttempted=void 0;return}catch(s){if(this.commitAttempted=!0,s instanceof de.MongoError&&(0,de.isRetryableWriteError)(s)){Qr.WriteConcern.apply(r,{wtimeoutMS:1e4,...i,w:"majority"}),this.unpin({force:!0});try{await(0,Ri.executeOperation)(this.client,new vs.RunCommandOperation(new Ye.MongoDBNamespace("admin"),r,{session:this,readPreference:Ps.ReadPreference.primary,bypassPinningCheck:!0}),u);return}catch(a){throw ua(a)&&a.addErrorLabel(de.MongoErrorLabel.UnknownTransactionCommitResult),sa(a)&&this.unpin({error:a}),a}}throw ua(s)&&s.addErrorLabel(de.MongoErrorLabel.UnknownTransactionCommitResult),sa(s)&&this.unpin({error:s}),s}finally{this.transaction.transition(be.TxnState.TRANSACTION_COMMITTED)}}async abortTransaction(t){var h,s;if(this.transaction.state===be.TxnState.NO_TRANSACTION)throw new de.MongoTransactionError("No transaction started");if(this.transaction.state===be.TxnState.STARTING_TRANSACTION){this.transaction.transition(be.TxnState.TRANSACTION_ABORTED);return}if(this.transaction.state===be.TxnState.TRANSACTION_ABORTED)throw new de.MongoTransactionError("Cannot call abortTransaction twice");if(this.transaction.state===be.TxnState.TRANSACTION_COMMITTED||this.transaction.state===be.TxnState.TRANSACTION_COMMITTED_EMPTY)throw new de.MongoTransactionError("Cannot call abortTransaction after calling commitTransaction");const r={abortTransaction:1},n=typeof(t==null?void 0:t.timeoutMS)=="number"?t.timeoutMS:(h=this.timeoutContext)!=null&&h.csotEnabled()?this.timeoutContext.timeoutMS:typeof this.timeoutMS=="number"?this.timeoutMS:null,i=n!=null?Ls.TimeoutContext.create({timeoutMS:n,serverSelectionTimeoutMS:this.clientOptions.serverSelectionTimeoutMS,socketTimeoutMS:this.clientOptions.socketTimeoutMS}):null,o=this.transaction.options.writeConcern??((s=this.clientOptions)==null?void 0:s.writeConcern);o!=null&&n==null&&Qr.WriteConcern.apply(r,{wtimeoutMS:1e4,w:"majority",...o}),this.transaction.recoveryToken&&(r.recoveryToken=this.transaction.recoveryToken);const u=new vs.RunCommandOperation(new Ye.MongoDBNamespace("admin"),r,{session:this,readPreference:Ps.ReadPreference.primary,bypassPinningCheck:!0});try{await(0,Ri.executeOperation)(this.client,u,i),this.unpin();return}catch(a){if(this.unpin(),a.name==="MongoRuntimeError"||t!=null&&t.throwTimeout&&a.name==="MongoOperationTimeoutError")throw a;if(a instanceof de.MongoError&&(0,de.isRetryableWriteError)(a))try{await(0,Ri.executeOperation)(this.client,u,i);return}catch(E){if(E.name==="MongoRuntimeError"||t!=null&&t.throwTimeout&&E.name==="MongoOperationTimeoutError")throw E}}finally{this.transaction.transition(be.TxnState.TRANSACTION_ABORTED),this.loadBalanced&&Gi(this,{force:!1})}}toBSON(){throw new de.MongoRuntimeError("ClientSession cannot be serialized to BSON.")}async withTransaction(t,r){var a,E,l,g;const i=(r==null?void 0:r.timeoutMS)??this.timeoutMS??null;this.timeoutContext=i!=null?Ls.TimeoutContext.create({timeoutMS:i,serverSelectionTimeoutMS:this.clientOptions.serverSelectionTimeoutMS,socketTimeoutMS:this.clientOptions.socketTimeoutMS}):null;const o=(a=this.timeoutContext)!=null&&a.csotEnabled()?this.timeoutContext.start:(0,Ye.processTimeMS)();let u=!1,h,s=null;try{e:for(let m=0,C=!1;!u;++m,C=m>0){if(C){const p=Math.random()*Math.min(5*1.5**(m-1),500);if(((E=this.timeoutContext)==null?void 0:E.csotEnabled())&&p>this.timeoutContext.remainingTimeMS||(0,Ye.processTimeMS)()+p>o+12e4)throw s??new de.MongoRuntimeError("Transaction retry did not record an error: should never occur. Please file a bug.");await(0,ed.setTimeout)(p)}this.startTransaction(r);try{const S=t(this);if(!(0,Ye.isPromiseLike)(S))throw new de.MongoInvalidArgumentError("Function provided to `withTransaction` must return a Promise");if(h=await S,this.transaction.state===be.TxnState.NO_TRANSACTION||this.transaction.state===be.TxnState.TRANSACTION_COMMITTED||this.transaction.state===be.TxnState.TRANSACTION_ABORTED)return h}catch(S){if(!(S instanceof de.MongoError)||S instanceof de.MongoInvalidArgumentError)throw await this.abortTransaction(),S;if((this.transaction.state===be.TxnState.STARTING_TRANSACTION||this.transaction.state===be.TxnState.TRANSACTION_IN_PROGRESS)&&await this.abortTransaction(),S.hasErrorLabel(de.MongoErrorLabel.TransientTransactionError)&&((l=this.timeoutContext)!=null&&l.csotEnabled()||(0,Ye.processTimeMS)()-o<12e4)){s=S;continue e}throw S}t:for(;!u;)try{await this.commitTransaction(),u=!0}catch(S){if(!(!((g=this.timeoutContext)!=null&&g.csotEnabled())&&(0,Ye.processTimeMS)()-o>=12e4)){if(!po(S)&&S.hasErrorLabel(de.MongoErrorLabel.UnknownTransactionCommitResult))continue t;if(S.hasErrorLabel(de.MongoErrorLabel.TransientTransactionError)){s=S;continue e}}throw S}}return h}finally{this.timeoutContext=null}}}ut.ClientSession=V1;const nd=new Set(["CannotSatisfyWriteConcern","UnknownReplWriteConcern","UnsatisfiableWriteConcern"]);function sa(e){if(e instanceof de.MongoError){if((0,de.isRetryableWriteError)(e)||e instanceof de.MongoWriteConcernError||po(e)){if(M0(e))return!0}else if(e.hasErrorLabel(de.MongoErrorLabel.TransientTransactionError))return!0}return!1}function ua(e){let t=(0,de.isRetryableWriteError)(e);return t||(t=e instanceof de.MongoWriteConcernError),t||(t=po(e)),t&&(t=M0(e)),t}function M0(e){const t=e instanceof de.MongoServerError&&e.codeName&&nd.has(e.codeName);return po(e)||!t&&e.code!==de.MONGODB_ERROR_CODES.UnsatisfiableWriteConcern&&e.code!==de.MONGODB_ERROR_CODES.UnknownReplWriteConcern}function Gi(e,t){const r=e.pinnedConnection,n=t==null?void 0:t.error;if(e.inTransaction()&&n&&n instanceof de.MongoError&&n.hasErrorLabel(de.MongoErrorLabel.TransientTransactionError))return;const i=e.client.topology;if(r&&i!=null){const u=Array.from(i.s.servers.values())[0];((t==null?void 0:t.error)==null||t!=null&&t.force)&&(u.pool.checkIn(r),e.pinnedConnection=void 0,r.emit(b0.UNPINNED,e.transaction.state!==be.TxnState.NO_TRANSACTION?$i.ConnectionPoolMetrics.TXN:$i.ConnectionPoolMetrics.CURSOR),t!=null&&t.forceClear&&u.pool.clear({serviceId:r.serviceId}))}}function po(e){var t;return e==null||!(e instanceof de.MongoServerError)?!1:e.code===de.MONGODB_ERROR_CODES.MaxTimeMSExpired||((t=e.writeConcernError)==null?void 0:t.code)===de.MONGODB_ERROR_CODES.MaxTimeMSExpired}class W1{constructor(t){if(t!=null){const r=Buffer.allocUnsafe(16);r.set(t.id.id.buffer),this.id={id:new Wi.Binary(r,t.id.id.sub_type)},this.lastUse=t.lastUse,this.txnNumber=t.txnNumber,this.isDirty=t.isDirty;return}this.id={id:new Wi.Binary((0,Ye.uuidV4)(),Wi.Binary.SUBTYPE_UUID)},this.lastUse=(0,Ye.processTimeMS)(),this.txnNumber=0,this.isDirty=!1}hasTimedOut(t){return Math.round((0,Ye.calculateDurationInMs)(this.lastUse)%864e5%36e5/6e4)>t-1}}ut.ServerSession=W1;class F0{constructor(t){if(t==null)throw new de.MongoRuntimeError("ServerSessionPool requires a MongoClient");this.client=t,this.sessions=new Ye.List}acquire(){var n,i;const t=((n=this.client.topology)==null?void 0:n.logicalSessionTimeoutMinutes)??10;let r=null;for(;this.sessions.length>0;){const o=this.sessions.shift();if(o!=null&&((i=this.client.topology)!=null&&i.loadBalanced||!o.hasTimedOut(t))){r=o;break}}return r==null&&(r=new W1),r}release(t){var n,i;const r=((n=this.client.topology)==null?void 0:n.logicalSessionTimeoutMinutes)??10;if((i=this.client.topology)!=null&&i.loadBalanced&&!r&&this.sessions.unshift(t),!!r&&(this.sessions.prune(o=>o.hasTimedOut(r)),!t.hasTimedOut(r))){if(t.isDirty)return;this.sessions.unshift(t)}}}ut.ServerSessionPool=F0;function id(e,t,r){var u,h;if(e.hasEnded)return new de.MongoExpiredSessionError;const n=e.serverSession;if(n==null)return new de.MongoRuntimeError("Unable to acquire server session");if(((u=r.writeConcern)==null?void 0:u.w)===0)return e&&e.explicit?new de.MongoAPIError("Cannot have explicit session with unacknowledged writes"):void 0;n.lastUse=(0,Ye.processTimeMS)(),t.lsid=n.id;const i=e.inTransaction()||(0,be.isTransactionCommand)(t);if((!!r.willRetryWrite||i)&&(n.txnNumber+=e.txnNumberIncrement,e.txnNumberIncrement=0,t.txnNumber=Wi.Long.fromNumber(n.txnNumber)),!i){e.transaction.state!==be.TxnState.NO_TRANSACTION&&e.transaction.transition(be.TxnState.NO_TRANSACTION),e.supports.causalConsistency&&e.operationTime&&(0,Ye.commandSupportsReadConcern)(t)?(t.readConcern=t.readConcern||{},Object.assign(t.readConcern,{afterClusterTime:e.operationTime})):e.snapshotEnabled&&(t.readConcern=t.readConcern||{level:rd.ReadConcernLevel.snapshot},e.snapshotTime!=null&&Object.assign(t.readConcern,{atClusterTime:e.snapshotTime}));return}if(t.autocommit=!1,e.transaction.state===be.TxnState.STARTING_TRANSACTION){e.transaction.transition(be.TxnState.TRANSACTION_IN_PROGRESS),t.startTransaction=!0;const s=e.transaction.options.readConcern||((h=e==null?void 0:e.clientOptions)==null?void 0:h.readConcern);s&&(t.readConcern=s),e.supports.causalConsistency&&e.operationTime&&(t.readConcern=t.readConcern||{},Object.assign(t.readConcern,{afterClusterTime:e.operationTime}))}}function od(e,t){if(t.$clusterTime&&(0,m1._advanceClusterTime)(e,t.$clusterTime),t.operationTime&&e&&e.supports.causalConsistency&&e.advanceOperationTime(t.operationTime),t.recoveryToken&&e&&e.inTransaction()&&(e.transaction._recoveryToken=t.recoveryToken),e!=null&&e.snapshotEnabled&&e.snapshotTime==null){const r=t.atClusterTime;r&&(e.snapshotTime=r)}}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CursorTimeoutContext=e.AbstractCursor=e.CursorTimeoutMode=e.CURSOR_FLAGS=void 0;const t=ao,r=pe,n=Q,i=Je,o=qe,u=li,h=Ao,s=Pt,a=Ke,E=ut,l=Te,g=ne();e.CURSOR_FLAGS=["tailable","oplogReplay","noCursorTimeout","awaitData","exhaust","partial"];function m(){this.client.s.activeCursors.delete(this)}e.CursorTimeoutMode=Object.freeze({ITERATION:"iteration",LIFETIME:"cursorLifetime"});const O=class O extends i.TypedEventEmitter{constructor(p,B,d={}){var f;if(super(),this.documents=null,this.hasEmittedClose=!1,this.on("error",g.noop),!p.s.isMongoClient)throw new n.MongoRuntimeError("Cursor must be constructed with MongoClient");if(this.cursorClient=p,this.cursorNamespace=B,this.cursorId=null,this.initialized=!1,this.isClosed=!1,this.isKilled=!1,this.cursorOptions={readPreference:d.readPreference&&d.readPreference instanceof a.ReadPreference?d.readPreference:a.ReadPreference.primary,...(0,r.pluckBSONSerializeOptions)(d),timeoutMS:(f=d==null?void 0:d.timeoutContext)!=null&&f.csotEnabled()?d.timeoutContext.timeoutMS:d.timeoutMS,tailable:d.tailable,awaitData:d.awaitData},this.cursorOptions.timeoutMS!=null)if(d.timeoutMode==null)if(d.tailable){if(d.awaitData&&d.maxAwaitTimeMS!=null&&d.maxAwaitTimeMS>=this.cursorOptions.timeoutMS)throw new n.MongoInvalidArgumentError("Cannot specify maxAwaitTimeMS >= timeoutMS for a tailable awaitData cursor");this.cursorOptions.timeoutMode=e.CursorTimeoutMode.ITERATION}else this.cursorOptions.timeoutMode=e.CursorTimeoutMode.LIFETIME;else{if(d.tailable&&d.timeoutMode===e.CursorTimeoutMode.LIFETIME)throw new n.MongoInvalidArgumentError("Cannot set tailable cursor's timeoutMode to LIFETIME");this.cursorOptions.timeoutMode=d.timeoutMode}else if(d.timeoutMode!=null)throw new n.MongoInvalidArgumentError("Cannot set timeoutMode without setting timeoutMS");this.cursorOptions.omitMaxTimeMS=this.cursorOptions.timeoutMS!=null&&(this.cursorOptions.timeoutMode===e.CursorTimeoutMode.ITERATION&&!this.cursorOptions.tailable||this.cursorOptions.tailable&&!this.cursorOptions.awaitData);const b=s.ReadConcern.fromOptions(d);b&&(this.cursorOptions.readConcern=b),typeof d.batchSize=="number"&&(this.cursorOptions.batchSize=d.batchSize),d.comment!==void 0&&(this.cursorOptions.comment=d.comment),typeof d.maxTimeMS=="number"&&(this.cursorOptions.maxTimeMS=d.maxTimeMS),typeof d.maxAwaitTimeMS=="number"&&(this.cursorOptions.maxAwaitTimeMS=d.maxAwaitTimeMS),this.cursorSession=d.session??null,this.deserializationOptions={...this.cursorOptions,validation:{utf8:(d==null?void 0:d.enableUtf8Validation)!==!1}},this.timeoutContext=d.timeoutContext,this.signal=d.signal,this.abortListener=(0,g.addAbortListener)(this.signal,()=>void this.close().then(void 0,g.squashError)),this.trackCursor()}get id(){return this.cursorId??void 0}get isDead(){var p;return(((p=this.cursorId)==null?void 0:p.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(p){this.cursorSession=p}get closed(){var p;return this.isClosed&&(((p=this.documents)==null?void 0:p.length)??0)===0}get killed(){return this.isKilled}get loadBalanced(){var p;return!!((p=this.cursorClient.topology)!=null&&p.loadBalanced)}async[Symbol.asyncDispose](){await this.close()}trackCursor(){this.cursorClient.s.activeCursors.add(this),this.listeners("close").includes(m)||this.once("close",m)}bufferedCount(){var p;return((p=this.documents)==null?void 0:p.length)??0}readBufferedDocuments(p){var b,f,c;const B=[],d=Math.min(p??((b=this.documents)==null?void 0:b.length)??0,((f=this.documents)==null?void 0:f.length)??0);for(let w=0;w<d;w++){const T=(c=this.documents)==null?void 0:c.shift(this.deserializationOptions);T!=null&&B.push(T)}return B}async*[Symbol.asyncIterator](){var p,B,d;if((p=this.signal)==null||p.throwIfAborted(),!this.closed)try{for(;;){if(this.isKilled||this.closed||this.cursorId!=null&&this.isDead&&(((B=this.documents)==null?void 0:B.length)??0)===0)return;const b=await this.next();if(b===null)return;yield b,(d=this.signal)==null||d.throwIfAborted()}}finally{if(!this.isClosed)try{await this.close()}catch(b){(0,g.squashError)(b)}}}stream(){const p=new S(this),B=(0,g.addAbortListener)(this.signal,function(){p.destroy(this.reason)});return p.once("end",()=>{B==null||B[g.kDispose]()}),p}async hasNext(){var p,B,d,b,f;if((p=this.signal)==null||p.throwIfAborted(),this.cursorId===r.Long.ZERO)return!1;this.cursorOptions.timeoutMode===e.CursorTimeoutMode.ITERATION&&this.cursorId!=null&&((B=this.timeoutContext)==null||B.refresh());try{do{if((((d=this.documents)==null?void 0:d.length)??0)!==0)return!0;await this.fetchBatch()}while(!this.isDead||(((b=this.documents)==null?void 0:b.length)??0)!==0)}finally{this.cursorOptions.timeoutMode===e.CursorTimeoutMode.ITERATION&&((f=this.timeoutContext)==null||f.clear())}return!1}async next(){var p,B,d,b,f;if((p=this.signal)==null||p.throwIfAborted(),this.cursorId===r.Long.ZERO)throw new n.MongoCursorExhaustedError;this.cursorOptions.timeoutMode===e.CursorTimeoutMode.ITERATION&&this.cursorId!=null&&((B=this.timeoutContext)==null||B.refresh());try{do{const c=(d=this.documents)==null?void 0:d.shift(this.deserializationOptions);if(c!=null)return this.transform!=null?await this.transformDocument(c):c;await this.fetchBatch()}while(!this.isDead||(((b=this.documents)==null?void 0:b.length)??0)!==0)}finally{this.cursorOptions.timeoutMode===e.CursorTimeoutMode.ITERATION&&((f=this.timeoutContext)==null||f.clear())}return null}async tryNext(){var p,B,d,b,f;if((p=this.signal)==null||p.throwIfAborted(),this.cursorId===r.Long.ZERO)throw new n.MongoCursorExhaustedError;this.cursorOptions.timeoutMode===e.CursorTimeoutMode.ITERATION&&this.cursorId!=null&&((B=this.timeoutContext)==null||B.refresh());try{let c=(d=this.documents)==null?void 0:d.shift(this.deserializationOptions);if(c!=null)return this.transform!=null?await this.transformDocument(c):c;if(await this.fetchBatch(),c=(b=this.documents)==null?void 0:b.shift(this.deserializationOptions),c!=null)return this.transform!=null?await this.transformDocument(c):c}finally{this.cursorOptions.timeoutMode===e.CursorTimeoutMode.ITERATION&&((f=this.timeoutContext)==null||f.clear())}return null}async forEach(p){var B;if((B=this.signal)==null||B.throwIfAborted(),typeof p!="function")throw new n.MongoInvalidArgumentError('Argument "iterator" must be a function');for await(const d of this)if(p(d)===!1)break}async close(p){await this.cleanup(p==null?void 0:p.timeoutMS)}async toArray(){var B;(B=this.signal)==null||B.throwIfAborted();const p=[];for await(const d of this){p.push(d);const b=this.readBufferedDocuments();if(this.transform!=null)for(const f of b)p.push(await this.transformDocument(f));else for(const f of b)p.push(f)}return p}addCursorFlag(p,B){if(this.throwIfInitialized(),!e.CURSOR_FLAGS.includes(p))throw new n.MongoInvalidArgumentError(`Flag ${p} is not one of ${e.CURSOR_FLAGS}`);if(typeof B!="boolean")throw new n.MongoInvalidArgumentError(`Flag ${p} must be a boolean value`);return this.cursorOptions[p]=B,this}map(p){this.throwIfInitialized();const B=this.transform;return B?this.transform=d=>p(B(d)):this.transform=p,this}withReadPreference(p){if(this.throwIfInitialized(),p instanceof a.ReadPreference)this.cursorOptions.readPreference=p;else if(typeof p=="string")this.cursorOptions.readPreference=a.ReadPreference.fromString(p);else throw new n.MongoInvalidArgumentError(`Invalid read preference: ${p}`);return this}withReadConcern(p){this.throwIfInitialized();const B=s.ReadConcern.fromOptions({readConcern:p});return B&&(this.cursorOptions.readConcern=B),this}maxTimeMS(p){if(this.throwIfInitialized(),typeof p!="number")throw new n.MongoInvalidArgumentError("Argument for maxTimeMS must be a number");return this.cursorOptions.maxTimeMS=p,this}batchSize(p){if(this.throwIfInitialized(),this.cursorOptions.tailable)throw new n.MongoTailableCursorError("Tailable cursor does not support batchSize");if(typeof p!="number")throw new n.MongoInvalidArgumentError('Operation "batchSize" requires an integer');return this.cursorOptions.batchSize=p,this}rewind(){var p,B,d;if(this.timeoutContext&&this.timeoutContext.owner!==this)throw new n.MongoAPIError("Cannot rewind cursor that does not own its timeout context.");this.initialized&&(this.cursorId=null,(p=this.documents)==null||p.clear(),(B=this.timeoutContext)==null||B.clear(),this.timeoutContext=void 0,this.isClosed=!1,this.isKilled=!1,this.initialized=!1,this.hasEmittedClose=!1,this.trackCursor(),((d=this.cursorSession)==null?void 0:d.explicit)===!1&&(this.cursorSession.hasEnded||this.cursorSession.endSession().then(void 0,g.squashError),this.cursorSession=null))}async getMore(){if(this.cursorId==null)throw new n.MongoRuntimeError("Unexpected null cursor id. A cursor creating command should have set this");if(this.selectedServer==null)throw new n.MongoRuntimeError("Unexpected null selectedServer. A cursor creating command should have set this");if(this.cursorSession==null)throw new n.MongoRuntimeError("Unexpected null session. A cursor creating command should have set this");const p={...this.cursorOptions,session:this.cursorSession,batchSize:this.cursorOptions.batchSize},B=new u.GetMoreOperation(this.cursorNamespace,this.cursorId,this.selectedServer,p);return await(0,o.executeOperation)(this.cursorClient,B,this.timeoutContext)}async cursorInit(){this.cursorOptions.timeoutMS!=null&&(this.timeoutContext??(this.timeoutContext=new D(l.TimeoutContext.create({serverSelectionTimeoutMS:this.client.s.options.serverSelectionTimeoutMS,timeoutMS:this.cursorOptions.timeoutMS}),this)));try{this.cursorSession??(this.cursorSession=this.cursorClient.startSession({owner:this,explicit:!1}));const p=await this._initialize(this.cursorSession);this.cursorOptions.omitMaxTimeMS=this.cursorOptions.timeoutMS!=null;const B=p.response;this.selectedServer=p.server,this.cursorId=B.id,this.cursorNamespace=B.ns??this.namespace,this.documents=B,this.initialized=!0}catch(p){throw this.initialized=!0,await this.cleanup(void 0,p),p}this.isDead&&await this.cleanup()}async fetchBatch(){var p;if(!this.isClosed){if(this.isDead){await this.cleanup();return}if(!(this.cursorId==null&&(await this.cursorInit(),(((p=this.documents)==null?void 0:p.length)??0)!==0||this.isDead))){try{const B=await this.getMore();this.cursorId=B.id,this.documents=B}catch(B){try{await this.cleanup(void 0,B)}catch(d){(0,g.squashError)(d)}throw B}this.isDead&&await this.cleanup()}}}async cleanup(p,B){var c;(c=this.abortListener)==null||c[g.kDispose](),this.isClosed=!0;const d=()=>{var w,T;return p!=null?((w=this.timeoutContext)==null||w.clear(),new D(l.TimeoutContext.create({serverSelectionTimeoutMS:this.client.s.options.serverSelectionTimeoutMS,timeoutMS:p}),this)):(T=this.timeoutContext)==null?void 0:T.refreshed()};await(async w=>{try{await w()}finally{this.emitClose()}})(async()=>{const w=this.cursorSession;if(w)try{if(!this.isKilled&&this.cursorId&&!this.cursorId.isZero()&&this.cursorNamespace&&this.selectedServer&&!w.hasEnded){this.isKilled=!0;const T=this.cursorId;this.cursorId=r.Long.ZERO,await(0,o.executeOperation)(this.cursorClient,new h.KillCursorsOperation(T,this.cursorNamespace,this.selectedServer,{session:w}),d())}}catch(T){(0,g.squashError)(T)}finally{w.owner===this&&await w.endSession({error:B}),w.inTransaction()||(0,E.maybeClearPinnedConnection)(w,{error:B})}})}emitClose(){var p;try{!this.hasEmittedClose&&((((p=this.documents)==null?void 0:p.length)??0)===0||this.isClosed)&&this.emit("close")}finally{this.hasEmittedClose=!0}}async transformDocument(p){if(this.transform==null)return p;try{const B=this.transform(p);if(B===null){const d="Cursor returned a `null` document, but the cursor is not exhausted. Mapping documents to `null` is not supported in the cursor transform.";throw new n.MongoAPIError(d)}return B}catch(B){try{await this.close()}catch(d){(0,g.squashError)(d)}throw B}}throwIfInitialized(){if(this.initialized)throw new n.MongoCursorInUseError}};O.CLOSE="close";let C=O;e.AbstractCursor=C;class S extends t.Readable{constructor(p){super({objectMode:!0,autoDestroy:!1,highWaterMark:1}),this._readInProgress=!1,this._cursor=p}_read(p){this._readInProgress||(this._readInProgress=!0,this._readNext())}_destroy(p,B){this._cursor.close().then(()=>B(p),d=>B(d))}_readNext(){if(this._cursor.id===r.Long.ZERO){this.push(null);return}this._cursor.next().then(p=>{if(p==null)this.push(null);else if(this.destroyed)this._cursor.close().then(void 0,g.squashError);else{if(this.push(p))return this._readNext();this._readInProgress=!1}},p=>p.message.match(/server is closed/)?(this._cursor.close().then(void 0,g.squashError),this.push(null)):p.message.match(/operation was interrupted/)?this.push(null):this.destroy(p)).catch(p=>{this._readInProgress=!1,this.destroy(p)})}}class D extends l.TimeoutContext{constructor(p,B){super(),this.timeoutContext=p,this.owner=B}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 D(this.timeoutContext.refreshed(),this.owner)}addMaxTimeMSToCommand(p,B){this.timeoutContext.addMaxTimeMSToCommand(p,B)}getSocketTimeoutMS(){return this.timeoutContext.getSocketTimeoutMS()}}e.CursorTimeoutContext=D})(tt);var Sn={};Object.defineProperty(Sn,"__esModule",{value:!0});Sn.ExplainableCursor=void 0;const sd=tt;class ud extends sd.AbstractCursor{resolveExplainTimeoutOptions(t,r){let n,i;return t==null&&r==null?(n=void 0,i=void 0):t!=null&&r==null?(n=typeof t!="object"||"verbosity"in t?t:void 0,i=typeof t=="object"&&"timeoutMS"in t?t:void 0):(n=t,i=r),{timeout:i,explain:n}}}Sn.ExplainableCursor=ud;Object.defineProperty(qr,"__esModule",{value:!0});qr.AggregationCursor=void 0;const ks=Q,aa=oi,ca=ii,la=qe,ad=ne(),ha=tt,cd=Sn;class G1 extends cd.ExplainableCursor{constructor(t,r,n=[],i={}){super(t,r,i),this.pipeline=n,this.aggregateOptions=i;const o=this.pipeline[this.pipeline.length-1];if(this.cursorOptions.timeoutMS!=null&&this.cursorOptions.timeoutMode===ha.CursorTimeoutMode.ITERATION&&((o==null?void 0:o.$merge)!=null||(o==null?void 0:o.$out)!=null))throw new ks.MongoAPIError("Cannot use $out or $merge stage with ITERATION timeoutMode")}clone(){const t=(0,ad.mergeOptions)({},this.aggregateOptions);return delete t.session,new G1(this.client,this.namespace,this.pipeline,{...t})}map(t){return super.map(t)}async _initialize(t){const r={...this.aggregateOptions,...this.cursorOptions,session:t,signal:this.signal};if(r.explain)try{(0,aa.validateExplainTimeoutOptions)(r,aa.Explain.fromOptions(r))}catch{throw new ks.MongoAPIError("timeoutMS cannot be used with explain when explain is specified in aggregateOptions")}const n=new ca.AggregateOperation(this.namespace,this.pipeline,r),i=await(0,la.executeOperation)(this.client,n,this.timeoutContext);return{server:n.server,session:t,response:i}}async explain(t,r){const{explain:n,timeout:i}=this.resolveExplainTimeoutOptions(t,r);return(await(0,la.executeOperation)(this.client,new ca.AggregateOperation(this.namespace,this.pipeline,{...this.aggregateOptions,...this.cursorOptions,...i,explain:n??!0}))).shift(this.deserializationOptions)}addStage(t){if(this.throwIfInitialized(),this.cursorOptions.timeoutMS!=null&&this.cursorOptions.timeoutMode===ha.CursorTimeoutMode.ITERATION&&(t.$out!=null||t.$merge!=null))throw new ks.MongoAPIError("Cannot use $out or $merge stage with ITERATION timeoutMode");return this.pipeline.push(t),this}group(t){return this.addStage({$group:t})}limit(t){return this.addStage({$limit:t})}match(t){return this.addStage({$match:t})}out(t){return this.addStage({$out:t})}project(t){return this.addStage({$project:t})}lookup(t){return this.addStage({$lookup:t})}redact(t){return this.addStage({$redact:t})}skip(t){return this.addStage({$skip:t})}sort(t){return this.addStage({$sort:t})}unwind(t){return this.addStage({$unwind:t})}geoNear(t){return this.addStage({$geoNear:t})}}qr.AggregationCursor=G1;var Lr={},di={};Object.defineProperty(di,"__esModule",{value:!0});di.CountOperation=void 0;const ld=De(),hd=Ie,Ni=Me;class R0 extends hd.CommandOperation{constructor(t,r,n){super({s:{namespace:t}},n),this.SERVER_COMMAND_RESPONSE_TYPE=ld.MongoDBResponse,this.options=n,this.collectionName=t.collection,this.query=r}get commandName(){return"count"}buildCommandDocument(t,r){const n=this.options,i={count:this.collectionName,query:this.query};return typeof n.limit=="number"&&(i.limit=n.limit),typeof n.skip=="number"&&(i.skip=n.skip),n.hint!=null&&(i.hint=n.hint),typeof n.maxTimeMS=="number"&&(i.maxTimeMS=n.maxTimeMS),i}handleOk(t){return t.getNumber("n")??0}}di.CountOperation=R0;(0,Ni.defineAspects)(R0,[Ni.Aspect.READ_OPERATION,Ni.Aspect.RETRYABLE,Ni.Aspect.SUPPORTS_RAW_DATA]);var Co={};Object.defineProperty(Co,"__esModule",{value:!0});Co.FindOperation=void 0;const Us=De(),dd=Q,fd=Gr,md=ne(),Ed=Ie,Zr=Me;class N0 extends Ed.CommandOperation{constructor(t,r={},n={}){if(super(void 0,n),this.SERVER_COMMAND_RESPONSE_TYPE=Us.CursorResponse,this.options={...n},delete this.options.writeConcern,this.ns=t,typeof r!="object"||Array.isArray(r))throw new dd.MongoInvalidArgumentError("Query filter must be a plain object or ObjectId");this.filter=r!=null&&r._bsontype==="ObjectId"?{_id:r}:r,this.SERVER_COMMAND_RESPONSE_TYPE=this.explain?Us.ExplainedCursorResponse:Us.CursorResponse}get commandName(){return"find"}buildOptions(t){return{...this.options,...this.bsonOptions,documentsReturnedIn:"firstBatch",session:this.session,timeoutContext:t}}handleOk(t){return t}buildCommandDocument(){return gd(this.ns,this.filter,this.options)}}Co.FindOperation=N0;function gd(e,t,r){const n={find:e.collection,filter:t};if(r.sort&&(n.sort=(0,fd.formatSort)(r.sort)),r.projection){let i=r.projection;i&&Array.isArray(i)&&(i=i.length?i.reduce((o,u)=>(o[u]=1,o),{}):{_id:1}),n.projection=i}return r.hint&&(n.hint=(0,md.normalizeHintField)(r.hint)),typeof r.skip=="number"&&(n.skip=r.skip),typeof r.limit=="number"&&(r.limit<0?(n.limit=-r.limit,n.singleBatch=!0):n.limit=r.limit),typeof r.batchSize=="number"&&(r.batchSize<0?n.limit=-r.batchSize:r.batchSize===r.limit?n.batchSize=r.batchSize+1:n.batchSize=r.batchSize),typeof r.singleBatch=="boolean"&&(n.singleBatch=r.singleBatch),r.comment!==void 0&&(n.comment=r.comment),r.max&&(n.max=r.max),r.min&&(n.min=r.min),typeof r.returnKey=="boolean"&&(n.returnKey=r.returnKey),typeof r.showRecordId=="boolean"&&(n.showRecordId=r.showRecordId),typeof r.tailable=="boolean"&&(n.tailable=r.tailable),typeof r.oplogReplay=="boolean"&&(n.oplogReplay=r.oplogReplay),typeof r.timeout=="boolean"?n.noCursorTimeout=!r.timeout:typeof r.noCursorTimeout=="boolean"&&(n.noCursorTimeout=r.noCursorTimeout),typeof r.awaitData=="boolean"&&(n.awaitData=r.awaitData),typeof r.allowPartialResults=="boolean"&&(n.allowPartialResults=r.allowPartialResults),typeof r.allowDiskUse=="boolean"&&(n.allowDiskUse=r.allowDiskUse),r.let&&(n.let=r.let),n}(0,Zr.defineAspects)(N0,[Zr.Aspect.READ_OPERATION,Zr.Aspect.RETRYABLE,Zr.Aspect.EXPLAINABLE,Zr.Aspect.CURSOR_CREATING,Zr.Aspect.SUPPORTS_RAW_DATA]);Object.defineProperty(Lr,"__esModule",{value:!0});Lr.FindCursor=Lr.FLAGS=void 0;const Ad=De(),pt=Q,da=oi,pd=di,js=qe,fa=Co,xs=Gr,Ii=ne(),Cd=Sn;Lr.FLAGS=["tailable","oplogReplay","noCursorTimeout","awaitData","exhaust","partial"];class q1 extends Cd.ExplainableCursor{constructor(t,r,n={},i={}){super(t,r,i),this.numReturned=0,this.cursorFilter=n,this.findOptions=i,i.sort!=null&&(this.findOptions.sort=(0,xs.formatSort)(i.sort))}clone(){const t=(0,Ii.mergeOptions)({},this.findOptions);return delete t.session,new q1(this.client,this.namespace,this.cursorFilter,{...t})}map(t){return super.map(t)}async _initialize(t){const r={...this.findOptions,...this.cursorOptions,session:t,signal:this.signal};if(r.explain)try{(0,da.validateExplainTimeoutOptions)(r,da.Explain.fromOptions(r))}catch{throw new pt.MongoAPIError("timeoutMS cannot be used with explain when explain is specified in findOptions")}const n=new fa.FindOperation(this.namespace,this.cursorFilter,r),i=await(0,js.executeOperation)(this.client,n,this.timeoutContext);return this.numReturned=i.batchSize,{server:n.server,session:t,response:i}}async getMore(){var u;const t=this.numReturned,r=this.findOptions.limit??1/0,n=r-t;if(t===r&&!((u=this.id)!=null&&u.isZero())){try{await this.close()}catch(h){(0,Ii.squashError)(h)}return Ad.CursorResponse.emptyGetMore}let i=Ii.noop;const{batchSize:o}=this.cursorOptions;o!=null&&o>n&&(this.cursorOptions.batchSize=n,i=()=>{this.cursorOptions.batchSize=o});try{const h=await super.getMore();return this.numReturned=this.numReturned+h.batchSize,h}finally{i==null||i()}}async count(t){if((0,Ii.emitWarningOnce)("cursor.count is deprecated and will be removed in the next major version, please use `collection.estimatedDocumentCount` or `collection.countDocuments` instead "),typeof t=="boolean")throw new pt.MongoInvalidArgumentError("Invalid first parameter to count");return await(0,js.executeOperation)(this.client,new pd.CountOperation(this.namespace,this.cursorFilter,{...this.findOptions,...this.cursorOptions,...t}))}async explain(t,r){const{explain:n,timeout:i}=this.resolveExplainTimeoutOptions(t,r);return(await(0,js.executeOperation)(this.client,new fa.FindOperation(this.namespace,this.cursorFilter,{...this.findOptions,...this.cursorOptions,...i,explain:n??!0}))).shift(this.deserializationOptions)}filter(t){return this.throwIfInitialized(),this.cursorFilter=t,this}hint(t){return this.throwIfInitialized(),this.findOptions.hint=t,this}min(t){return this.throwIfInitialized(),this.findOptions.min=t,this}max(t){return this.throwIfInitialized(),this.findOptions.max=t,this}returnKey(t){return this.throwIfInitialized(),this.findOptions.returnKey=t,this}showRecordId(t){return this.throwIfInitialized(),this.findOptions.showRecordId=t,this}addQueryModifier(t,r){if(this.throwIfInitialized(),t[0]!=="$")throw new pt.MongoInvalidArgumentError(`${t} is not a valid query modifier`);switch(t.substr(1)){case"comment":this.findOptions.comment=r;break;case"explain":this.findOptions.explain=r;break;case"hint":this.findOptions.hint=r;break;case"max":this.findOptions.max=r;break;case"maxTimeMS":this.findOptions.maxTimeMS=r;break;case"min":this.findOptions.min=r;break;case"orderby":this.findOptions.sort=(0,xs.formatSort)(r);break;case"query":this.cursorFilter=r;break;case"returnKey":this.findOptions.returnKey=r;break;case"showDiskLoc":this.findOptions.showRecordId=r;break;default:throw new pt.MongoInvalidArgumentError(`Invalid query modifier: ${t}`)}return this}comment(t){return this.throwIfInitialized(),this.findOptions.comment=t,this}maxAwaitTimeMS(t){if(this.throwIfInitialized(),typeof t!="number")throw new pt.MongoInvalidArgumentError("Argument for maxAwaitTimeMS must be a number");return this.findOptions.maxAwaitTimeMS=t,this}maxTimeMS(t){if(this.throwIfInitialized(),typeof t!="number")throw new pt.MongoInvalidArgumentError("Argument for maxTimeMS must be a number");return this.findOptions.maxTimeMS=t,this}project(t){return this.throwIfInitialized(),this.findOptions.projection=t,this}sort(t,r){if(this.throwIfInitialized(),this.findOptions.tailable)throw new pt.MongoTailableCursorError("Tailable cursor does not support sorting");return this.findOptions.sort=(0,xs.formatSort)(t,r),this}allowDiskUse(t=!0){if(this.throwIfInitialized(),!this.findOptions.sort)throw new pt.MongoInvalidArgumentError('Option "allowDiskUse" requires a sort specification');return t?(this.findOptions.allowDiskUse=!0,this):(this.findOptions.allowDiskUse=!1,this)}collation(t){return this.throwIfInitialized(),this.findOptions.collation=t,this}limit(t){if(this.throwIfInitialized(),this.findOptions.tailable)throw new pt.MongoTailableCursorError("Tailable cursor does not support limit");if(typeof t!="number")throw new pt.MongoInvalidArgumentError('Operation "limit" requires an integer');return this.findOptions.limit=t,this}skip(t){if(this.throwIfInitialized(),this.findOptions.tailable)throw new pt.MongoTailableCursorError("Tailable cursor does not support skip");if(typeof t!="number")throw new pt.MongoInvalidArgumentError('Operation "skip" requires an integer');return this.findOptions.skip=t,this}}Lr.FindCursor=q1;var fi={},Nt={};Object.defineProperty(Nt,"__esModule",{value:!0});Nt.ListIndexesOperation=Nt.DropIndexOperation=Nt.CreateIndexesOperation=void 0;const H1=De(),Sd=Q,K1=ne(),Y1=Ie,bt=Me,yd=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 Od(e){return typeof e=="number"||e==="2d"||e==="2dsphere"||e==="text"||e==="geoHaystack"}function wd(e){return Array.isArray(e)&&e.length===2&&Od(e[1])}function _d(e){const t=new Map,r=!Array.isArray(e)||wd(e)?[e]:e;for(const 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(const[i,o]of n)t.set(i,o);else if((0,K1.isObject)(n))for(const[i,o]of Object.entries(n))t.set(i,o);return t}function Dd(e){const t=Object.entries(e).filter(([r])=>yd.has(r));return Object.fromEntries(t.map(([r,n])=>r==="version"?["v",n]:[r,n]))}class Jn extends Y1.CommandOperation{constructor(t,r,n,i){super(t,i),this.SERVER_COMMAND_RESPONSE_TYPE=H1.MongoDBResponse,this.options=i??{},this.options.collation=void 0,this.collectionName=r,this.indexes=n.map(o=>{const u=o.key instanceof Map?o.key:new Map(Object.entries(o.key)),h=o.name??Array.from(u).flat().join("_");return{...Dd(o),name:h,key:u}}),this.ns=t.s.namespace}static fromIndexDescriptionArray(t,r,n,i){return new Jn(t,r,n,i)}static fromIndexSpecification(t,r,n,i={}){const o=_d(n),u={...i,key:o};return new Jn(t,r,[u],i)}get commandName(){return"createIndexes"}buildCommandDocument(t){const r=this.options,n=this.indexes,i=(0,K1.maxWireVersion)(t),o={createIndexes:this.collectionName,indexes:n};if(r.commitQuorum!=null){if(i<9)throw new Sd.MongoCompatibilityError("Option `commitQuorum` for `createIndexes` not supported on servers < 4.4");o.commitQuorum=r.commitQuorum}return o}handleOk(t){return this.indexes.map(n=>n.name||"")}}Nt.CreateIndexesOperation=Jn;class I0 extends Y1.CommandOperation{constructor(t,r,n){super(t,n),this.SERVER_COMMAND_RESPONSE_TYPE=H1.MongoDBResponse,this.options=n??{},this.collection=t,this.indexName=r,this.ns=t.fullNamespace}get commandName(){return"dropIndexes"}buildCommandDocument(t){return{dropIndexes:this.collection.collectionName,index:this.indexName}}}Nt.DropIndexOperation=I0;class v0 extends Y1.CommandOperation{constructor(t,r){super(t,r),this.SERVER_COMMAND_RESPONSE_TYPE=H1.CursorResponse,this.options={...r},delete this.options.writeConcern,this.collectionNamespace=t.s.namespace}get commandName(){return"listIndexes"}buildCommandDocument(t){const r=(0,K1.maxWireVersion)(t),n=this.options.batchSize?{batchSize:this.options.batchSize}:{},i={listIndexes:this.collectionNamespace.collection,cursor:n};return r>=9&&this.options.comment!==void 0&&(i.comment=this.options.comment),i}handleOk(t){return t}}Nt.ListIndexesOperation=v0;(0,bt.defineAspects)(v0,[bt.Aspect.READ_OPERATION,bt.Aspect.RETRYABLE,bt.Aspect.CURSOR_CREATING,bt.Aspect.SUPPORTS_RAW_DATA]);(0,bt.defineAspects)(Jn,[bt.Aspect.WRITE_OPERATION,bt.Aspect.SUPPORTS_RAW_DATA]);(0,bt.defineAspects)(I0,[bt.Aspect.WRITE_OPERATION,bt.Aspect.SUPPORTS_RAW_DATA]);Object.defineProperty(fi,"__esModule",{value:!0});fi.ListIndexesCursor=void 0;const Td=qe,Bd=Nt,bd=tt;class X1 extends bd.AbstractCursor{constructor(t,r){super(t.client,t.s.namespace,r),this.parent=t,this.options=r}clone(){return new X1(this.parent,{...this.options,...this.cursorOptions})}async _initialize(t){const r=new Bd.ListIndexesOperation(this.parent,{...this.cursorOptions,...this.options,session:t}),n=await(0,Td.executeOperation)(this.parent.client,r,this.timeoutContext);return{server:r.server,session:t,response:n}}}fi.ListIndexesCursor=X1;var So={};Object.defineProperty(So,"__esModule",{value:!0});So.ListSearchIndexesCursor=void 0;const Md=qr;class Fd extends Md.AggregationCursor{constructor({fullNamespace:t,client:r},n,i={}){const o=n==null?[{$listSearchIndexes:{}}]:[{$listSearchIndexes:{name:n}}];super(r,t,o,i)}}So.ListSearchIndexesCursor=Fd;var yo={};Object.defineProperty(yo,"__esModule",{value:!0});yo.DistinctOperation=void 0;const Rd=De(),Nd=Ie,Tn=Me;class P0 extends Nd.CommandOperation{constructor(t,r,n,i){super(t,i),this.SERVER_COMMAND_RESPONSE_TYPE=Rd.MongoDBResponse,this.options=i??{},this.collection=t,this.key=r,this.query=n}get commandName(){return"distinct"}buildCommandDocument(t){const r={distinct:this.collection.collectionName,key:this.key,query:this.query};return this.options.comment!==void 0&&(r.comment=this.options.comment),this.options.hint!=null&&(r.hint=this.options.hint),r}handleOk(t){return this.explain?t.toObject(this.bsonOptions):t.toObject(this.bsonOptions).values}}yo.DistinctOperation=P0;(0,Tn.defineAspects)(P0,[Tn.Aspect.READ_OPERATION,Tn.Aspect.RETRYABLE,Tn.Aspect.EXPLAINABLE,Tn.Aspect.SUPPORTS_RAW_DATA]);var Oo={};Object.defineProperty(Oo,"__esModule",{value:!0});Oo.EstimatedDocumentCountOperation=void 0;const Id=De(),vd=Ie,Bn=Me;class L0 extends vd.CommandOperation{constructor(t,r={}){super(t,r),this.SERVER_COMMAND_RESPONSE_TYPE=Id.MongoDBResponse,this.options=r,this.collectionName=t.collectionName}get commandName(){return"count"}buildCommandDocument(t,r){const n={count:this.collectionName};return typeof this.options.maxTimeMS=="number"&&(n.maxTimeMS=this.options.maxTimeMS),this.options.comment!==void 0&&(n.comment=this.options.comment),n}handleOk(t){return t.getNumber("n")??0}}Oo.EstimatedDocumentCountOperation=L0;(0,Bn.defineAspects)(L0,[Bn.Aspect.READ_OPERATION,Bn.Aspect.RETRYABLE,Bn.Aspect.CURSOR_CREATING,Bn.Aspect.SUPPORTS_RAW_DATA]);var J1={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FindOneAndUpdateOperation=e.FindOneAndReplaceOperation=e.FindOneAndDeleteOperation=e.FindAndModifyOperation=e.ReturnDocument=void 0;const t=De(),r=Q,n=Ke,i=Gr,o=ne(),u=Ie,h=Me;e.ReturnDocument=Object.freeze({BEFORE:"before",AFTER:"after"});function s(m,C){return m.new=C.returnDocument===e.ReturnDocument.AFTER,m.upsert=C.upsert===!0,C.bypassDocumentValidation===!0&&(m.bypassDocumentValidation=C.bypassDocumentValidation),m}class a extends u.CommandOperation{constructor(C,S,D){super(C,D),this.SERVER_COMMAND_RESPONSE_TYPE=t.MongoDBResponse,this.options=D,this.readPreference=n.ReadPreference.primary,this.collection=C,this.query=S}get commandName(){return"findAndModify"}buildCommandDocument(C,S){var p;const D=this.options,O={findAndModify:this.collection.collectionName,query:this.query,remove:!1,new:!1,upsert:!1};D.includeResultMetadata??(D.includeResultMetadata=!1);const M=(0,i.formatSort)(D.sort);if(M&&(O.sort=M),D.projection&&(O.fields=D.projection),D.maxTimeMS&&(O.maxTimeMS=D.maxTimeMS),D.writeConcern&&(O.writeConcern=D.writeConcern),D.let&&(O.let=D.let),D.comment!==void 0&&(O.comment=D.comment),(0,o.decorateWithCollation)(O,D),D.hint){if(((p=this.writeConcern)==null?void 0:p.w)===0&&(0,o.maxWireVersion)(C)<9)throw new r.MongoCompatibilityError("hint for the findAndModify command is only supported on MongoDB 4.4+");O.hint=D.hint}return O}handleOk(C){const S=super.handleOk(C);return this.options.includeResultMetadata?S:S.value??null}}e.FindAndModifyOperation=a;class E extends a{constructor(C,S,D){if(S==null||typeof S!="object")throw new r.MongoInvalidArgumentError('Argument "filter" must be an object');super(C,S,D)}buildCommandDocument(C,S){const D=super.buildCommandDocument(C,S);return D.remove=!0,D}}e.FindOneAndDeleteOperation=E;class l extends a{constructor(C,S,D,O){if(S==null||typeof S!="object")throw new r.MongoInvalidArgumentError('Argument "filter" must be an object');if(D==null||typeof D!="object")throw new r.MongoInvalidArgumentError('Argument "replacement" must be an object');if((0,o.hasAtomicOperators)(D))throw new r.MongoInvalidArgumentError("Replacement document must not contain atomic operators");super(C,S,O),this.replacement=D}buildCommandDocument(C,S){const D=super.buildCommandDocument(C,S);return D.update=this.replacement,s(D,this.options),D}}e.FindOneAndReplaceOperation=l;class g extends a{constructor(C,S,D,O){if(S==null||typeof S!="object")throw new r.MongoInvalidArgumentError('Argument "filter" must be an object');if(D==null||typeof D!="object")throw new r.MongoInvalidArgumentError('Argument "update" must be an object');if(!(0,o.hasAtomicOperators)(D,O))throw new r.MongoInvalidArgumentError("Update document requires atomic operators");super(C,S,O),this.update=D,this.options=O}buildCommandDocument(C,S){const D=super.buildCommandDocument(C,S);return D.update=this.update,s(D,this.options),this.options.arrayFilters&&(D.arrayFilters=this.options.arrayFilters),D}}e.FindOneAndUpdateOperation=g,(0,h.defineAspects)(a,[h.Aspect.WRITE_OPERATION,h.Aspect.RETRYABLE,h.Aspect.EXPLAINABLE,h.Aspect.SUPPORTS_RAW_DATA])})(J1);var bn={},ma;function k0(){if(ma)return bn;ma=1,Object.defineProperty(bn,"__esModule",{value:!0}),bn.RenameOperation=void 0;const e=De(),t=mi(),r=ne(),n=Ie,i=Me;class o extends n.CommandOperation{constructor(h,s,a){super(h,a),this.SERVER_COMMAND_RESPONSE_TYPE=e.MongoDBResponse,this.collection=h,this.newName=s,this.options=a,this.ns=new r.MongoDBNamespace("admin","$cmd")}get commandName(){return"renameCollection"}buildCommandDocument(h,s){const a=this.collection.namespace,E=this.collection.s.namespace.withCollection(this.newName).toString(),l=typeof this.options.dropTarget=="boolean"?this.options.dropTarget:!1;return{renameCollection:a,to:E,dropTarget:l}}handleOk(h){return new t.Collection(this.collection.db,this.newName,this.collection.s.options)}}return bn.RenameOperation=o,(0,i.defineAspects)(o,[i.Aspect.WRITE_OPERATION]),bn}var wo={};Object.defineProperty(wo,"__esModule",{value:!0});wo.CreateSearchIndexesOperation=void 0;const Pd=De(),Ld=Me;class kd extends Ld.AbstractOperation{constructor(t,r){super(),this.SERVER_COMMAND_RESPONSE_TYPE=Pd.MongoDBResponse,this.collection=t,this.descriptions=r,this.ns=t.fullNamespace}get commandName(){return"createSearchIndexes"}buildCommand(t,r){return{createSearchIndexes:this.collection.fullNamespace.collection,indexes:this.descriptions}}handleOk(t){return super.handleOk(t).indexesCreated.map(r=>r.name)}buildOptions(t){return{session:this.session,timeoutContext:t}}}wo.CreateSearchIndexesOperation=kd;var _o={};Object.defineProperty(_o,"__esModule",{value:!0});_o.DropSearchIndexOperation=void 0;const Ud=De(),Ea=Q,jd=Me;class xd extends jd.AbstractOperation{constructor(t,r){super(),this.SERVER_COMMAND_RESPONSE_TYPE=Ud.MongoDBResponse,this.collection=t,this.name=r,this.ns=t.fullNamespace}get commandName(){return"dropSearchIndex"}buildCommand(t,r){const i={dropSearchIndex:this.collection.fullNamespace.collection};return typeof this.name=="string"&&(i.name=this.name),i}handleOk(t){}buildOptions(t){return{session:this.session,timeoutContext:t}}handleError(t){if(!(t instanceof Ea.MongoServerError&&t.code===Ea.MONGODB_ERROR_CODES.NamespaceNotFound))throw t}}_o.DropSearchIndexOperation=xd;var Do={};Object.defineProperty(Do,"__esModule",{value:!0});Do.UpdateSearchIndexOperation=void 0;const zd=De(),Vd=Me;class Wd extends Vd.AbstractOperation{constructor(t,r,n){super(),this.SERVER_COMMAND_RESPONSE_TYPE=zd.MongoDBResponse,this.collection=t,this.name=r,this.definition=n,this.ns=t.fullNamespace}get commandName(){return"updateSearchIndex"}buildCommand(t,r){return{updateSearchIndex:this.collection.fullNamespace.collection,name:this.name,definition:this.definition}}handleOk(t){}buildOptions(t){return{session:this.session,timeoutContext:t}}}Do.UpdateSearchIndexOperation=Wd;var ga;function mi(){if(ga)return Dn;ga=1,Object.defineProperty(Dn,"__esModule",{value:!0}),Dn.Collection=void 0;const e=pe,t=ui,r=ci,n=wi(),i=qr,o=Lr,u=fi,h=So,s=Q,a=di,E=Wt,l=yo,g=Oo,m=qe,C=J1,S=Nt,D=Pr,O=k0(),M=wo,p=_o,B=Do,d=_t,b=Pt,f=Ke,c=ne(),w=ct();class T{constructor(A,y,F){var R;this.db=A,this.s={db:A,options:F,namespace:new c.MongoDBCollectionNamespace(A.databaseName,y),pkFactory:((R=A.options)==null?void 0:R.pkFactory)??c.DEFAULT_PK_FACTORY,readPreference:f.ReadPreference.fromOptions(F),bsonOptions:(0,e.resolveBSONOptions)(F,A),readConcern:b.ReadConcern.fromOptions(F),writeConcern:w.WriteConcern.fromOptions(F)},this.client=A.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(){return this.s.readConcern==null?this.db.readConcern:this.s.readConcern}get readPreference(){return this.s.readPreference==null?this.db.readPreference:this.s.readPreference}get bsonOptions(){return this.s.bsonOptions}get writeConcern(){return this.s.writeConcern==null?this.db.writeConcern:this.s.writeConcern}get hint(){return this.s.collectionHint}set hint(A){this.s.collectionHint=(0,c.normalizeHintField)(A)}get timeoutMS(){return this.s.options.timeoutMS}async insertOne(A,y){return await(0,m.executeOperation)(this.client,new D.InsertOneOperation(this,A,(0,c.resolveOptions)(this,y)))}async insertMany(A,y){var R;if(!Array.isArray(A))throw new s.MongoInvalidArgumentError('Argument "docs" must be an array of documents');y=(0,c.resolveOptions)(this,y??{});const F=((R=w.WriteConcern.fromOptions(y))==null?void 0:R.w)!==0;try{const v=await this.bulkWrite(A.map(J=>({insertOne:{document:J}})),y);return{acknowledged:F,insertedCount:v.insertedCount,insertedIds:v.insertedIds}}catch(v){throw v&&v.message==="Operation must be an object with an operation key"?new s.MongoInvalidArgumentError("Collection.insertMany() cannot be called with an array that has null/undefined values"):v}}async bulkWrite(A,y){if(!Array.isArray(A))throw new s.MongoInvalidArgumentError('Argument "operations" must be an array of documents');y=(0,c.resolveOptions)(this,y??{}),this.client.topology!=null||await(0,m.autoConnect)(this.client);const R=y.ordered===!1?this.initializeUnorderedBulkOp(y):this.initializeOrderedBulkOp(y);for(const v of A)R.raw(v);return await R.execute({...y})}async updateOne(A,y,F){return await(0,m.executeOperation)(this.client,new d.UpdateOneOperation(this.s.namespace,A,y,(0,c.resolveOptions)(this,F)))}async replaceOne(A,y,F){return await(0,m.executeOperation)(this.client,new d.ReplaceOneOperation(this.s.namespace,A,y,(0,c.resolveOptions)(this,F)))}async updateMany(A,y,F){return await(0,m.executeOperation)(this.client,new d.UpdateManyOperation(this.s.namespace,A,y,(0,c.resolveOptions)(this,F)))}async deleteOne(A={},y={}){return await(0,m.executeOperation)(this.client,new E.DeleteOneOperation(this.s.namespace,A,(0,c.resolveOptions)(this,y)))}async deleteMany(A={},y={}){return await(0,m.executeOperation)(this.client,new E.DeleteManyOperation(this.s.namespace,A,(0,c.resolveOptions)(this,y)))}async rename(A,y){return await(0,m.executeOperation)(this.client,new O.RenameOperation(this,A,(0,c.resolveOptions)(void 0,{...y,readPreference:f.ReadPreference.PRIMARY})))}async drop(A){return await this.db.dropCollection(this.collectionName,A)}async findOne(A={},y={}){const{...F}=y;F.singleBatch=!0;const R=this.find(A,F).limit(1),v=await R.next();return await R.close(),v}find(A={},y={}){return new o.FindCursor(this.client,this.s.namespace,A,(0,c.resolveOptions)(this,y))}async options(A){A=(0,c.resolveOptions)(this,A);const[y]=await this.db.listCollections({name:this.collectionName},{...A,nameOnly:!1}).toArray();if(y==null||y.options==null)throw new s.MongoAPIError(`collection ${this.namespace} not found`);return y.options}async isCapped(A){const{capped:y}=await this.options(A);return!!y}async createIndex(A,y){return(await(0,m.executeOperation)(this.client,S.CreateIndexesOperation.fromIndexSpecification(this,this.collectionName,A,(0,c.resolveOptions)(this,y))))[0]}async createIndexes(A,y){return await(0,m.executeOperation)(this.client,S.CreateIndexesOperation.fromIndexDescriptionArray(this,this.collectionName,A,(0,c.resolveOptions)(this,{...y,maxTimeMS:void 0})))}async dropIndex(A,y){return await(0,m.executeOperation)(this.client,new S.DropIndexOperation(this,A,{...(0,c.resolveOptions)(this,y),readPreference:f.ReadPreference.primary}))}async dropIndexes(A){try{return await(0,m.executeOperation)(this.client,new S.DropIndexOperation(this,"*",(0,c.resolveOptions)(this,A))),!0}catch(y){if(y instanceof s.MongoOperationTimeoutError)throw y;return!1}}listIndexes(A){return new u.ListIndexesCursor(this,(0,c.resolveOptions)(this,A))}async indexExists(A,y){const F=Array.isArray(A)?A:[A],R=new Set(await this.listIndexes(y).map(({name:v})=>v).toArray());return F.every(v=>R.has(v))}async indexInformation(A){return await this.indexes({...A,full:(A==null?void 0:A.full)??!1})}async estimatedDocumentCount(A){return await(0,m.executeOperation)(this.client,new g.EstimatedDocumentCountOperation(this,(0,c.resolveOptions)(this,A)))}async countDocuments(A={},y={}){const F=[];F.push({$match:A}),typeof y.skip=="number"&&F.push({$skip:y.skip}),typeof y.limit=="number"&&F.push({$limit:y.limit}),F.push({$group:{_id:1,n:{$sum:1}}});const R=this.aggregate(F,y),v=await R.next();return await R.close(),(v==null?void 0:v.n)??0}async distinct(A,y={},F={}){return await(0,m.executeOperation)(this.client,new l.DistinctOperation(this,A,y,(0,c.resolveOptions)(this,F)))}async indexes(A){const y=await this.listIndexes(A).toArray();return(A==null?void 0:A.full)??!0?y:Object.fromEntries(y.map(({name:v,key:J})=>[v,Object.entries(J)]))}async findOneAndDelete(A,y){return await(0,m.executeOperation)(this.client,new C.FindOneAndDeleteOperation(this,A,(0,c.resolveOptions)(this,y)))}async findOneAndReplace(A,y,F){return await(0,m.executeOperation)(this.client,new C.FindOneAndReplaceOperation(this,A,y,(0,c.resolveOptions)(this,F)))}async findOneAndUpdate(A,y,F){return await(0,m.executeOperation)(this.client,new C.FindOneAndUpdateOperation(this,A,y,(0,c.resolveOptions)(this,F)))}aggregate(A=[],y){if(!Array.isArray(A))throw new s.MongoInvalidArgumentError('Argument "pipeline" must be an array of aggregation stages');return new i.AggregationCursor(this.client,this.s.namespace,A,(0,c.resolveOptions)(this,y))}watch(A=[],y={}){return Array.isArray(A)||(y=A,A=[]),new n.ChangeStream(this,A,(0,c.resolveOptions)(this,y))}initializeUnorderedBulkOp(A){return new r.UnorderedBulkOperation(this,(0,c.resolveOptions)(this,A))}initializeOrderedBulkOp(A){return new t.OrderedBulkOperation(this,(0,c.resolveOptions)(this,A))}async count(A={},y={}){return await(0,m.executeOperation)(this.client,new a.CountOperation(this.fullNamespace,A,(0,c.resolveOptions)(this,y)))}listSearchIndexes(A,y){y=typeof A=="object"?A:y??{};const F=A==null||typeof A=="object"?null:A;return new h.ListSearchIndexesCursor(this,F,y)}async createSearchIndex(A){const[y]=await this.createSearchIndexes([A]);return y}async createSearchIndexes(A){return await(0,m.executeOperation)(this.client,new M.CreateSearchIndexesOperation(this,A))}async dropSearchIndex(A){return await(0,m.executeOperation)(this.client,new p.DropSearchIndexOperation(this,A))}async updateSearchIndex(A,y){return await(0,m.executeOperation)(this.client,new B.UpdateSearchIndexOperation(this,A,y))}}return Dn.Collection=T,Dn}var Mn={},Aa;function U0(){if(Aa)return Mn;Aa=1,Object.defineProperty(Mn,"__esModule",{value:!0}),Mn.ChangeStreamCursor=void 0;const e=wi(),t=Ve,r=ii,n=qe,i=ne(),o=tt;class u extends o.AbstractCursor{constructor(s,a,E=[],l={}){super(s,a,{...l,tailable:!0,awaitData:!0}),this.pipeline=E,this.changeStreamCursorOptions=l,this._resumeToken=null,this.startAtOperationTime=l.startAtOperationTime??null,l.startAfter?this.resumeToken=l.startAfter:l.resumeAfter&&(this.resumeToken=l.resumeAfter)}set resumeToken(s){this._resumeToken=s,this.emit(e.ChangeStream.RESUME_TOKEN_CHANGED,s)}get resumeToken(){return this._resumeToken}get resumeOptions(){const s={...this.changeStreamCursorOptions};for(const a of["resumeAfter","startAfter","startAtOperationTime"])delete s[a];return this.resumeToken!=null?this.changeStreamCursorOptions.startAfter&&!this.hasReceived?s.startAfter=this.resumeToken:s.resumeAfter=this.resumeToken:this.startAtOperationTime!=null&&(s.startAtOperationTime=this.startAtOperationTime),s}cacheResumeToken(s){this.bufferedCount()===0&&this.postBatchResumeToken?this.resumeToken=this.postBatchResumeToken:this.resumeToken=s,this.hasReceived=!0}_processBatch(s){const{postBatchResumeToken:a}=s;a&&(this.postBatchResumeToken=a,s.batchSize===0&&(this.resumeToken=a))}clone(){return new u(this.client,this.namespace,this.pipeline,{...this.cursorOptions})}async _initialize(s){const a=new r.AggregateOperation(this.namespace,this.pipeline,{...this.cursorOptions,...this.changeStreamCursorOptions,session:s}),E=await(0,n.executeOperation)(s.client,a,this.timeoutContext),l=a.server;return this.maxWireVersion=(0,i.maxWireVersion)(l),this.startAtOperationTime==null&&this.changeStreamCursorOptions.resumeAfter==null&&this.changeStreamCursorOptions.startAfter==null&&(this.startAtOperationTime=E.operationTime),this._processBatch(E),this.emit(t.INIT,E),this.emit(t.RESPONSE),{server:l,session:s,response:E}}async getMore(){const s=await super.getMore();return this.maxWireVersion=(0,i.maxWireVersion)(this.server),this._processBatch(s),this.emit(e.ChangeStream.MORE,s),this.emit(e.ChangeStream.RESPONSE),s}}return Mn.ChangeStreamCursor=u,Mn}var Fn={},Ei={},To={};Object.defineProperty(To,"__esModule",{value:!0});To.ListCollectionsOperation=void 0;const zs=De(),Gd=ne(),qd=Ie,Rn=Me;class j0 extends qd.CommandOperation{constructor(t,r,n){super(t,n),this.SERVER_COMMAND_RESPONSE_TYPE=zs.CursorResponse,this.options={...n},delete this.options.writeConcern,this.db=t,this.filter=r,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?zs.ExplainedCursorResponse:zs.CursorResponse}get commandName(){return"listCollections"}buildCommandDocument(t){const r={listCollections:1,filter:this.filter,cursor:this.batchSize?{batchSize:this.batchSize}:{},nameOnly:this.nameOnly,authorizedCollections:this.authorizedCollections};return(0,Gd.maxWireVersion)(t)>=9&&this.options.comment!==void 0&&(r.comment=this.options.comment),r}handleOk(t){return t}}To.ListCollectionsOperation=j0;(0,Rn.defineAspects)(j0,[Rn.Aspect.READ_OPERATION,Rn.Aspect.RETRYABLE,Rn.Aspect.CURSOR_CREATING,Rn.Aspect.SUPPORTS_RAW_DATA]);Object.defineProperty(Ei,"__esModule",{value:!0});Ei.ListCollectionsCursor=void 0;const Hd=qe,Kd=To,Yd=tt;class Q1 extends Yd.AbstractCursor{constructor(t,r,n){super(t.client,t.s.namespace,n),this.parent=t,this.filter=r,this.options=n}clone(){return new Q1(this.parent,this.filter,{...this.options,...this.cursorOptions})}async _initialize(t){const r=new Kd.ListCollectionsOperation(this.parent,this.filter,{...this.cursorOptions,...this.options,session:t,signal:this.signal}),n=await(0,Hd.executeOperation)(this.parent.client,r,this.timeoutContext);return{server:r.server,session:t,response:n}}}Ei.ListCollectionsCursor=Q1;var Bo={};Object.defineProperty(Bo,"__esModule",{value:!0});Bo.RunCommandCursor=void 0;const $r=Q,pa=qe,Xd=li,Jd=tr,Qd=ne(),Zd=tt;class $d extends Zd.AbstractCursor{setComment(t){return this.getMoreOptions.comment=t,this}setMaxTimeMS(t){return this.getMoreOptions.maxAwaitTimeMS=t,this}setBatchSize(t){return this.getMoreOptions.batchSize=t,this}clone(){throw new $r.MongoAPIError("Clone not supported, create a new cursor with db.runCursorCommand")}withReadConcern(t){throw new $r.MongoAPIError("RunCommandCursor does not support readConcern it must be attached to the command being run")}addCursorFlag(t,r){throw new $r.MongoAPIError("RunCommandCursor does not support cursor flags, they must be attached to the command being run")}maxTimeMS(t){throw new $r.MongoAPIError("maxTimeMS must be configured on the command document directly, to configure getMore.maxTimeMS use cursor.setMaxTimeMS()")}batchSize(t){throw new $r.MongoAPIError("batchSize must be configured on the command document directly, to configure getMore.batchSize use cursor.setBatchSize()")}constructor(t,r,n={}){super(t.client,(0,Qd.ns)(t.namespace),n),this.getMoreOptions={},this.db=t,this.command=Object.freeze({...r})}async _initialize(t){const r=new Jd.RunCursorCommandOperation(this.db.s.namespace,this.command,{...this.cursorOptions,session:t,readPreference:this.cursorOptions.readPreference}),n=await(0,pa.executeOperation)(this.client,r,this.timeoutContext);return{server:r.server,session:t,response:n}}async getMore(){if(!this.session)throw new $r.MongoRuntimeError("Unexpected null session. A cursor creating command should have set this");const t=new Xd.GetMoreOperation(this.namespace,this.id,this.server,{...this.cursorOptions,session:this.session,...this.getMoreOptions});return await(0,pa.executeOperation)(this.client,t,this.timeoutContext)}}Bo.RunCommandCursor=$d;var en={},Ca;function ef(){if(Ca)return en;Ca=1,Object.defineProperty(en,"__esModule",{value:!0}),en.CreateCollectionOperation=void 0,en.createCollections=m;const e=fe,t=De(),r=mi(),n=Q,i=Te,o=ne(),u=Ie,h=qe,s=Nt,a=Me,E=new Set(["w","wtimeout","timeoutMS","j","fsync","pkFactory","raw","readPreference","session","readConcern","writeConcern","raw","fieldsAsRaw","useBigInt64","promoteLongs","promoteValues","promoteBuffers","bsonRegExp","serializeFunctions","ignoreUndefined","enableUtf8Validation"]),l="Driver support of Queryable Encryption is incompatible with server. Upgrade server to use Queryable Encryption.";class g extends u.CommandOperation{constructor(S,D,O={}){super(S,O),this.SERVER_COMMAND_RESPONSE_TYPE=t.MongoDBResponse,this.options=O,this.db=S,this.name=D}get commandName(){return"create"}buildCommandDocument(S,D){const O=([M,p])=>p!=null&&typeof p!="function"&&!E.has(M);return{create:this.name,...Object.fromEntries(Object.entries(this.options).filter(O))}}handleOk(S){return new r.Collection(this.db,this.name,this.options)}}en.CreateCollectionOperation=g;async function m(C,S,D){var B,d;const O=i.TimeoutContext.create({session:D.session,serverSelectionTimeoutMS:C.client.s.options.serverSelectionTimeoutMS,waitQueueTimeoutMS:C.client.s.options.waitQueueTimeoutMS,timeoutMS:D.timeoutMS}),M=D.encryptedFields??((d=(B=C.client.s.options.autoEncryption)==null?void 0:B.encryptedFieldsMap)==null?void 0:d[`${C.databaseName}.${S}`]);if(M){class b extends g{buildCommandDocument(T,_){if(!T.description.loadBalanced&&(0,o.maxWireVersion)(T)<e.MIN_SUPPORTED_QE_WIRE_VERSION)throw new n.MongoCompatibilityError(`${l} The minimum server version required is ${e.MIN_SUPPORTED_QE_SERVER_VERSION}`);return super.buildCommandDocument(T,_)}}const f=M.escCollection??`enxcol_.${S}.esc`,c=M.ecocCollection??`enxcol_.${S}.ecoc`;for(const w of[f,c]){const T=new b(C,w,{clusteredIndex:{key:{_id:1},unique:!0},session:D.session});await(0,h.executeOperation)(C.client,T,O)}D.encryptedFields||(D={...D,encryptedFields:M})}const p=await(0,h.executeOperation)(C.client,new g(C,S,D),O);if(M){const b=s.CreateIndexesOperation.fromIndexSpecification(C,S,{__safeContent__:1},{session:D.session});await(0,h.executeOperation)(C.client,b,O)}return p}return(0,a.defineAspects)(g,[a.Aspect.WRITE_OPERATION]),en}var sr={},Sa;function tf(){if(Sa)return sr;Sa=1,Object.defineProperty(sr,"__esModule",{value:!0}),sr.DropDatabaseOperation=sr.DropCollectionOperation=void 0,sr.dropCollections=a;const e=ts(),t=De(),r=tt,n=Q,i=Te,o=Ie,u=qe,h=Me;class s extends o.CommandOperation{constructor(g,m,C={}){super(g,C),this.SERVER_COMMAND_RESPONSE_TYPE=t.MongoDBResponse,this.options=C,this.name=m}get commandName(){return"drop"}buildCommandDocument(g,m){return{drop:this.name}}handleOk(g){return!0}handleError(g){if(!(g instanceof e.MongoServerError)||Number(g.code)!==n.MONGODB_ERROR_CODES.NamespaceNotFound)throw g;return!1}}sr.DropCollectionOperation=s;async function a(l,g,m){var O,M,p;const C=i.TimeoutContext.create({session:m.session,serverSelectionTimeoutMS:l.client.s.options.serverSelectionTimeoutMS,waitQueueTimeoutMS:l.client.s.options.waitQueueTimeoutMS,timeoutMS:m.timeoutMS}),S=(O=l.client.s.options.autoEncryption)==null?void 0:O.encryptedFieldsMap;let D=m.encryptedFields??(S==null?void 0:S[`${l.databaseName}.${g}`]);if(!D&&S){const B=await l.listCollections({name:g},{nameOnly:!1,session:m.session,timeoutContext:new r.CursorTimeoutContext(C,Symbol())}).toArray();D=(p=(M=B==null?void 0:B[0])==null?void 0:M.options)==null?void 0:p.encryptedFields}if(D){const B=D.escCollection||`enxcol_.${g}.esc`,d=D.ecocCollection||`enxcol_.${g}.ecoc`;for(const b of[B,d]){const f=new s(l,b,m);await(0,u.executeOperation)(l.client,f,C)}}return await(0,u.executeOperation)(l.client,new s(l,g,m),C)}class E extends o.CommandOperation{constructor(g,m){super(g,m),this.SERVER_COMMAND_RESPONSE_TYPE=t.MongoDBResponse,this.options=m}get commandName(){return"dropDatabase"}buildCommandDocument(g,m){return{dropDatabase:1}}handleOk(g){return!0}}return sr.DropDatabaseOperation=E,(0,h.defineAspects)(s,[h.Aspect.WRITE_OPERATION]),(0,h.defineAspects)(E,[h.Aspect.WRITE_OPERATION]),sr}var bo={};Object.defineProperty(bo,"__esModule",{value:!0});bo.ProfilingLevelOperation=void 0;const rf=pe,nf=De(),ya=Q,of=Ie;class sf extends nf.MongoDBResponse{get was(){return this.get("was",rf.BSONType.int,!0)}}class uf extends of.CommandOperation{constructor(t,r){super(t,r),this.SERVER_COMMAND_RESPONSE_TYPE=sf,this.options=r}get commandName(){return"profile"}buildCommandDocument(t){return{profile:-1}}handleOk(t){if(t.ok===1){const r=t.was;if(r===0)return"off";if(r===1)return"slow_only";if(r===2)return"all";throw new ya.MongoUnexpectedServerResponseError(`Illegal profiling level value ${r}`)}else throw new ya.MongoUnexpectedServerResponseError("Error with profile command")}}bo.ProfilingLevelOperation=uf;var Z1={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SetProfilingLevelOperation=e.ProfilingLevel=void 0;const t=De(),r=Q,n=ne(),i=Ie,o=new Set(["off","slow_only","all"]);e.ProfilingLevel=Object.freeze({off:"off",slowOnly:"slow_only",all:"all"});class u extends i.CommandOperation{constructor(s,a,E){switch(super(s,E),this.SERVER_COMMAND_RESPONSE_TYPE=t.MongoDBResponse,this.options=E,a){case e.ProfilingLevel.off:this.profile=0;break;case e.ProfilingLevel.slowOnly:this.profile=1;break;case e.ProfilingLevel.all:this.profile=2;break;default:this.profile=0;break}this.level=a}get commandName(){return"profile"}buildCommandDocument(s){const a=this.level;if(!o.has(a))throw new r.MongoInvalidArgumentError(`Profiling level must be one of "${(0,n.enumToString)(e.ProfilingLevel)}"`);return{profile:this.profile}}handleOk(s){return this.level}}e.SetProfilingLevelOperation=u})(Z1);var Mo={};Object.defineProperty(Mo,"__esModule",{value:!0});Mo.DbStatsOperation=void 0;const af=De(),cf=Ie,Oa=Me;class x0 extends cf.CommandOperation{constructor(t,r){super(t,r),this.SERVER_COMMAND_RESPONSE_TYPE=af.MongoDBResponse,this.options=r}get commandName(){return"dbStats"}buildCommandDocument(t){const r={dbStats:!0};return this.options.scale!=null&&(r.scale=this.options.scale),r}}Mo.DbStatsOperation=x0;(0,Oa.defineAspects)(x0,[Oa.Aspect.READ_OPERATION]);var wa;function $1(){if(wa)return Fn;wa=1,Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.Db=void 0;const e=ei,t=pe,r=wi(),n=mi(),i=Ve,o=qr,u=Ei,h=Bo,s=Q,a=ef(),E=tf(),l=qe,g=Nt,m=bo,C=si,S=k0(),D=tr,O=Z1,M=Mo,p=Pt,B=Ke,d=ne(),b=ct(),f=["writeConcern","readPreference","readPreferenceTags","native_parser","forceServerObjectId","pkFactory","serializeFunctions","raw","authSource","ignoreUndefined","readConcern","retryMiliSeconds","numberOfRetries","useBigInt64","promoteBuffers","promoteLongs","bsonRegExp","enableUtf8Validation","promoteValues","compression","retryWrites","timeoutMS"],w=class w{constructor(_,A,y){if(y=y??{},y=(0,d.filterOptions)(y,f),typeof A=="string"&&A.includes("."))throw new s.MongoInvalidArgumentError("Database names cannot contain the character '.'");this.s={options:y,readPreference:B.ReadPreference.fromOptions(y),bsonOptions:(0,t.resolveBSONOptions)(y,_),pkFactory:(y==null?void 0:y.pkFactory)??d.DEFAULT_PK_FACTORY,readConcern:p.ReadConcern.fromOptions(y),writeConcern:b.WriteConcern.fromOptions(y),namespace:new d.MongoDBNamespace(A)},this.client=_}get databaseName(){return this.s.namespace.db}get options(){return this.s.options}get secondaryOk(){var _;return((_=this.s.readPreference)==null?void 0:_.preference)!=="primary"||!1}get readConcern(){return this.s.readConcern}get readPreference(){return this.s.readPreference==null?this.client.readPreference:this.s.readPreference}get bsonOptions(){return this.s.bsonOptions}get writeConcern(){return this.s.writeConcern}get namespace(){return this.s.namespace.toString()}get timeoutMS(){var _;return(_=this.s.options)==null?void 0:_.timeoutMS}async createCollection(_,A){return A=(0,d.resolveOptions)(this,A),await(0,a.createCollections)(this,_,A)}async command(_,A){return await(0,l.executeOperation)(this.client,new D.RunCommandOperation(this.s.namespace,_,(0,d.resolveOptions)(void 0,{...(0,t.resolveBSONOptions)(A),timeoutMS:(A==null?void 0:A.timeoutMS)??this.timeoutMS,session:A==null?void 0:A.session,readPreference:A==null?void 0:A.readPreference,signal:A==null?void 0:A.signal})))}aggregate(_=[],A){return new o.AggregationCursor(this.client,this.s.namespace,_,(0,d.resolveOptions)(this,A))}admin(){return new e.Admin(this)}collection(_,A={}){if(typeof A=="function")throw new s.MongoInvalidArgumentError("The callback form of this helper has been removed.");return new n.Collection(this,_,(0,d.resolveOptions)(this,A))}async stats(_){return await(0,l.executeOperation)(this.client,new M.DbStatsOperation(this,(0,d.resolveOptions)(this,_)))}listCollections(_={},A={}){return new u.ListCollectionsCursor(this,_,(0,d.resolveOptions)(this,A))}async renameCollection(_,A,y){return await(0,l.executeOperation)(this.client,new S.RenameOperation(this.collection(_),A,(0,d.resolveOptions)(void 0,{...y,readPreference:B.ReadPreference.primary})))}async dropCollection(_,A){return A=(0,d.resolveOptions)(this,A),await(0,E.dropCollections)(this,_,A)}async dropDatabase(_){return await(0,l.executeOperation)(this.client,new E.DropDatabaseOperation(this,(0,d.resolveOptions)(this,_)))}async collections(_){return _=(0,d.resolveOptions)(this,_),(await this.listCollections({},{..._,nameOnly:!0}).toArray()).filter(({name:y})=>!y.includes("$")).map(({name:y})=>new n.Collection(this,y,this.s.options))}async createIndex(_,A,y){return(await(0,l.executeOperation)(this.client,g.CreateIndexesOperation.fromIndexSpecification(this,_,A,y)))[0]}async removeUser(_,A){return await(0,l.executeOperation)(this.client,new C.RemoveUserOperation(this,_,(0,d.resolveOptions)(this,A)))}async setProfilingLevel(_,A){return await(0,l.executeOperation)(this.client,new O.SetProfilingLevelOperation(this,_,(0,d.resolveOptions)(this,A)))}async profilingLevel(_){return await(0,l.executeOperation)(this.client,new m.ProfilingLevelOperation(this,(0,d.resolveOptions)(this,_)))}async indexInformation(_,A){return await this.collection(_).indexInformation((0,d.resolveOptions)(this,A))}watch(_=[],A={}){return Array.isArray(_)||(A=_,_=[]),new r.ChangeStream(this,_,(0,d.resolveOptions)(this,A))}runCursorCommand(_,A){return new h.RunCommandCursor(this,_,A)}};w.SYSTEM_NAMESPACE_COLLECTION=i.SYSTEM_NAMESPACE_COLLECTION,w.SYSTEM_INDEX_COLLECTION=i.SYSTEM_INDEX_COLLECTION,w.SYSTEM_PROFILE_COLLECTION=i.SYSTEM_PROFILE_COLLECTION,w.SYSTEM_USER_COLLECTION=i.SYSTEM_USER_COLLECTION,w.SYSTEM_COMMAND_COLLECTION=i.SYSTEM_COMMAND_COLLECTION,w.SYSTEM_JS_COLLECTION=i.SYSTEM_JS_COLLECTION;let c=w;return Fn.Db=c,Fn}var wr={},Fo={},Ro={},Qe={};const lf={},hf=Object.freeze(Object.defineProperty({__proto__:null,default:lf},Symbol.toStringTag,{value:"Module"})),df=pr(hf),ff={},mf=Object.freeze(Object.defineProperty({__proto__:null,default:ff},Symbol.toStringTag,{value:"Module"})),Ef=pr(mf),gf={},Af=Object.freeze(Object.defineProperty({__proto__:null,default:gf},Symbol.toStringTag,{value:"Module"})),pf=pr(Af),Cf={},Sf=Object.freeze(Object.defineProperty({__proto__:null,default:Cf},Symbol.toStringTag,{value:"Module"})),yf=pr(Sf),Of={},wf=Object.freeze(Object.defineProperty({__proto__:null,default:Of},Symbol.toStringTag,{value:"Module"})),_f=pr(wf),Df={},Tf=Object.freeze(Object.defineProperty({__proto__:null,default:Df},Symbol.toStringTag,{value:"Module"})),Bf=pr(Tf),bf={},Mf=Object.freeze(Object.defineProperty({__proto__:null,default:bf},Symbol.toStringTag,{value:"Module"})),Ff=pr(Mf);Object.defineProperty(Qe,"__esModule",{value:!0});Qe.getKerberos=Rf;Qe.getZstdLibrary=Nf;Qe.getAwsCredentialProvider=If;Qe.getGcpMetadata=vf;Qe.getSnappy=Pf;Qe.getSocks=Lf;Qe.getMongoDBClientEncryption=kf;const Hr=Q;function No(e){const t=e?{kModuleError:e}:{};return new Proxy(t,{get:(r,n)=>{if(n==="kModuleError")return e;throw e},set:()=>{throw e}})}function Rf(){let e;try{e=df}catch(t){e=No(new Hr.MongoMissingDependencyError("Optional module `kerberos` not found. Please install it to enable kerberos authentication",{cause:t,dependencyName:"kerberos"}))}return e}function Nf(){let e;try{e=Ef}catch(t){e=No(new Hr.MongoMissingDependencyError("Optional module `@mongodb-js/zstd` not found. Please install it to enable zstd compression",{cause:t,dependencyName:"zstd"}))}return e}function If(){try{return pf}catch(e){return No(new Hr.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 vf(){try{return yf}catch(e){return No(new Hr.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 Pf(){try{return _f}catch(e){return{kModuleError:new Hr.MongoMissingDependencyError("Optional module `snappy` not found. Please install it to enable snappy compression",{cause:e,dependencyName:"snappy"})}}}function Lf(){try{return Bf}catch(e){return{kModuleError:new Hr.MongoMissingDependencyError("Optional module `socks` not found. Please install it to connections over a SOCKS5 proxy",{cause:e,dependencyName:"socks"})}}}function kf(){let e=null;try{e=Ff}catch(t){return{kModuleError:new Hr.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 Dt={};Object.defineProperty(Dt,"__esModule",{value:!0});Dt.AuthProvider=Dt.AuthContext=void 0;const Uf=Q;class jf{constructor(t,r,n){this.reauthenticating=!1,this.connection=t,this.credentials=r,this.options=n}}Dt.AuthContext=jf;class xf{async prepare(t,r){return t}async reauth(t){if(t.reauthenticating)throw new Uf.MongoRuntimeError("Reauthentication already in progress.");try{t.reauthenticating=!0,await this.auth(t)}finally{t.reauthenticating=!1}}}Dt.AuthProvider=xf;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GSSAPI=e.GSSAPICanonicalizationValue=void 0,e.performGSSAPICanonicalizeHostName=S,e.resolveCname=D;const t=T1,r=Rc,n=Qe,i=Q,o=ne(),u=Dt;e.GSSAPICanonicalizationValue=Object.freeze({on:!0,off:!1,none:"none",forward:"forward",forwardAndReverse:"forwardAndReverse"});async function h(M,p){return await M.command((0,o.ns)("$external.$cmd"),p)}let s;class a extends u.AuthProvider{async auth(p){const{connection:B,credentials:d}=p;if(d==null)throw new i.MongoMissingCredentialsError("Credentials required for GSSAPI authentication");const{username:b}=d,f=await E(p),c=await f.step(""),w=await h(B,l(c)),T=await m(f,10,w.payload),_=await h(B,g(T,w.conversationId)),A=await C(f,b,_.payload);await h(B,{saslContinue:1,conversationId:_.conversationId,payload:A})}}e.GSSAPI=a;async function E(M){const{hostAddress:p}=M.options,{credentials:B}=M;if(!p||typeof p.host!="string"||!B)throw new i.MongoInvalidArgumentError("Connection must have host and port and credentials defined.");if(O(),"kModuleError"in s)throw s.kModuleError;const{initializeClient:d}=s,{username:b,password:f}=B,c=B.mechanismProperties,w=c.SERVICE_NAME??"mongodb",T=await S(p.host,c),_={};f!=null&&Object.assign(_,{user:b,password:f});const A=c.SERVICE_HOST??T;let y=`${w}${r.platform()==="win32"?"/":"@"}${A}`;return"SERVICE_REALM"in c&&(y=`${y}@${c.SERVICE_REALM}`),await d(y,_)}function l(M){return{saslStart:1,mechanism:"GSSAPI",payload:M,autoAuthorize:1}}function g(M,p){return{saslContinue:1,conversationId:p,payload:M}}async function m(M,p,B){try{return await M.step(B)||""}catch(d){if(p===0)throw d;return await m(M,p-1,B)}}async function C(M,p,B){const d=await M.unwrap(B);return await M.wrap(d||"",{user:p})}async function S(M,p){const B=p.CANONICALIZE_HOST_NAME;if(!B||B===e.GSSAPICanonicalizationValue.none)return M;if(B===e.GSSAPICanonicalizationValue.on||B===e.GSSAPICanonicalizationValue.forwardAndReverse){const{address:d}=await t.promises.lookup(M);try{const b=await t.promises.resolvePtr(d);return b.length>0?b[0]:M}catch{return await D(M)}}else return await D(M)}async function D(M){try{const p=await t.promises.resolveCname(M);return p.length>0?p[0]:M}catch{return M}}function O(){s||(s=(0,n.getKerberos)())}})(Ro);var qt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.AUTH_MECHS_AUTH_SRC_EXTERNAL=e.AuthMechanism=void 0,e.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"}),e.AUTH_MECHS_AUTH_SRC_EXTERNAL=new Set([e.AuthMechanism.MONGODB_GSSAPI,e.AuthMechanism.MONGODB_AWS,e.AuthMechanism.MONGODB_OIDC,e.AuthMechanism.MONGODB_X509])})(qt);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MongoCredentials=e.DEFAULT_ALLOWED_HOSTS=void 0;const t=Q,r=Ro,n=qt;function i(a){return a&&Array.isArray(a.saslSupportedMechs)?a.saslSupportedMechs.includes(n.AuthMechanism.MONGODB_SCRAM_SHA256)?n.AuthMechanism.MONGODB_SCRAM_SHA256:n.AuthMechanism.MONGODB_SCRAM_SHA1:n.AuthMechanism.MONGODB_SCRAM_SHA256}const o=["test","azure","gcp","k8s"],u="Auth mechanism property ALLOWED_HOSTS must be an array of strings.";e.DEFAULT_ALLOWED_HOSTS=["*.mongodb.net","*.mongodb-qa.net","*.mongodb-dev.net","*.mongodbgov.net","localhost","127.0.0.1","::1","*.mongo.com"];const h="TOKEN_RESOURCE must be set in the auth mechanism properties when ENVIRONMENT is azure or gcp.";class s{constructor(E){this.username=E.username??"",this.password=E.password,this.source=E.source,!this.source&&E.db&&(this.source=E.db),this.mechanism=E.mechanism||n.AuthMechanism.MONGODB_DEFAULT,this.mechanismProperties=E.mechanismProperties||{},this.mechanism===n.AuthMechanism.MONGODB_OIDC&&!this.mechanismProperties.ALLOWED_HOSTS&&(this.mechanismProperties={...this.mechanismProperties,ALLOWED_HOSTS:e.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){return this.mechanism.match(/DEFAULT/i)?new s({username:this.username,password:this.password,source:this.source,mechanism:i(E),mechanismProperties:this.mechanismProperties}):this}validate(){if((this.mechanism===n.AuthMechanism.MONGODB_GSSAPI||this.mechanism===n.AuthMechanism.MONGODB_PLAIN||this.mechanism===n.AuthMechanism.MONGODB_SCRAM_SHA1||this.mechanism===n.AuthMechanism.MONGODB_SCRAM_SHA256)&&!this.username)throw new t.MongoMissingCredentialsError(`Username required for mechanism '${this.mechanism}'`);if(this.mechanism===n.AuthMechanism.MONGODB_OIDC){if(this.username&&this.mechanismProperties.ENVIRONMENT&&this.mechanismProperties.ENVIRONMENT!=="azure")throw new t.MongoInvalidArgumentError(`username and ENVIRONMENT '${this.mechanismProperties.ENVIRONMENT}' may not be used together for mechanism '${this.mechanism}'.`);if(this.username&&this.password)throw new t.MongoInvalidArgumentError(`No password is allowed in ENVIRONMENT '${this.mechanismProperties.ENVIRONMENT}' for '${this.mechanism}'.`);if((this.mechanismProperties.ENVIRONMENT==="azure"||this.mechanismProperties.ENVIRONMENT==="gcp")&&!this.mechanismProperties.TOKEN_RESOURCE)throw new t.MongoInvalidArgumentError(h);if(this.mechanismProperties.ENVIRONMENT&&!o.includes(this.mechanismProperties.ENVIRONMENT))throw new t.MongoInvalidArgumentError(`Currently only a ENVIRONMENT in ${o.join(",")} is supported for mechanism '${this.mechanism}'.`);if(!this.mechanismProperties.ENVIRONMENT&&!this.mechanismProperties.OIDC_CALLBACK&&!this.mechanismProperties.OIDC_HUMAN_CALLBACK)throw new t.MongoInvalidArgumentError(`Either a ENVIRONMENT, OIDC_CALLBACK, or OIDC_HUMAN_CALLBACK must be specified for mechanism '${this.mechanism}'.`);if(this.mechanismProperties.ALLOWED_HOSTS){const l=this.mechanismProperties.ALLOWED_HOSTS;if(!Array.isArray(l))throw new t.MongoInvalidArgumentError(u);for(const g of l)if(typeof g!="string")throw new t.MongoInvalidArgumentError(u)}}if(n.AUTH_MECHS_AUTH_SRC_EXTERNAL.has(this.mechanism)&&this.source!=null&&this.source!=="$external")throw new t.MongoAPIError(`Invalid source '${this.source}' for mechanism '${this.mechanism}' specified.`);if(this.mechanism===n.AuthMechanism.MONGODB_PLAIN&&this.source==null)throw new t.MongoAPIError("PLAIN Authentication Mechanism needs an auth source");if(this.mechanism===n.AuthMechanism.MONGODB_X509&&this.password!=null){if(this.password===""){Reflect.set(this,"password",void 0);return}throw new t.MongoAPIError("Password not allowed for mechanism MONGODB-X509")}const E=this.mechanismProperties.CANONICALIZE_HOST_NAME??!1;if(!Object.values(r.GSSAPICanonicalizationValue).includes(E))throw new t.MongoAPIError(`Invalid CANONICALIZE_HOST_NAME value: ${E}`)}static merge(E,l){return new s({username:l.username??(E==null?void 0:E.username)??"",password:l.password??(E==null?void 0:E.password)??"",mechanism:l.mechanism??(E==null?void 0:E.mechanism)??n.AuthMechanism.MONGODB_DEFAULT,mechanismProperties:l.mechanismProperties??(E==null?void 0:E.mechanismProperties)??{},source:l.source??l.db??(E==null?void 0:E.source)??"admin"})}}e.MongoCredentials=s})(Fo);var Sr={};const zf="7.1.0",Vf={version:zf};Object.defineProperty(Sr,"__esModule",{value:!0});Sr.LimitedSizeDocument=void 0;Sr.isDriverInfoEqual=qf;Sr.makeClientMetadata=Hf;Sr.getFAASEnv=z0;const vi=Rc,eu=Ar,Ir=pe,_a=Q,Wf=ne(),Gf=Vf.version;function qf(e,t){const r=(n,i)=>(n||(n=void 0),i||(i=void 0),n===i);return r(e.name,t.name)&&r(e.platform,t.platform)&&r(e.version,t.version)}class tu{constructor(t){this.document=new Map,this.documentSize=5,this.maxSize=t}ifItFitsItSits(t,r){const n=Ir.BSON.serialize(new Map().set(t,r)).byteLength-5;return n+this.documentSize>this.maxSize?!1:(this.documentSize+=n,this.document.set(t,r),!0)}toObject(){return Ir.BSON.deserialize(Ir.BSON.serialize(this.document),{promoteLongs:!1,promoteBuffers:!1,promoteValues:!1,useBigInt64:!1})}}Sr.LimitedSizeDocument=tu;async function Hf(e,{appName:t=""}){const r=new tu(512);if(t.length>0){const h=Buffer.byteLength(t,"utf8")<=128?t:Buffer.from(t,"utf8").subarray(0,128).toString("utf8");r.ifItFitsItSits("application",{name:h})}const n={name:"nodejs",version:Gf};for(const{name:h="",version:s=""}of e)h.length>0&&(n.name=`${n.name}|${h}`),s.length>0&&(n.version=`${n.version}|${s}`);if(!r.ifItFitsItSits("driver",n))throw new _a.MongoInvalidArgumentError("Unable to include driverInfo name and version, metadata cannot exceed 512 bytes");let i=Xf();for(const{platform:h=""}of e)h.length>0&&(i=`${i}|${h}`);if(!r.ifItFitsItSits("platform",i))throw new _a.MongoInvalidArgumentError("Unable to include driverInfo platform, metadata cannot exceed 512 bytes");const o=new Map().set("name",vi.platform()).set("architecture",vi.arch()).set("version",vi.release()).set("type",vi.type());if(!r.ifItFitsItSits("os",o)){for(const h of o.keys())if(o.delete(h),o.size===0||r.ifItFitsItSits("os",o))break}const u=z0();if(u!=null&&!r.ifItFitsItSits("env",u)){for(const h of u.keys())if(u.delete(h),u.size===0||r.ifItFitsItSits("env",u))break}return await Yf(r.toObject())}let Da;async function Kf(){Da??(Da=(0,Wf.fileIsAccessible)("/.dockerenv"));const e=await Da,{KUBERNETES_SERVICE_HOST:t=""}=eu.env,r=t.length>0,n={};return e&&(n.runtime="docker"),r&&(n.orchestrator="kubernetes"),n}async function Yf(e){const t=await Kf();if(Object.keys(t).length===0)return e;const r=new tu(512),n={...e==null?void 0:e.env,container:t};for(const[i,o]of Object.entries(e))i!=="env"?r.ifItFitsItSits(i,o):r.ifItFitsItSits("env",n)||r.ifItFitsItSits("env",o);return"env"in e||r.ifItFitsItSits("env",n),r.toObject()}function z0(){const{AWS_EXECUTION_ENV:e="",AWS_LAMBDA_RUNTIME_API:t="",FUNCTIONS_WORKER_RUNTIME:r="",K_SERVICE:n="",FUNCTION_NAME:i="",VERCEL:o="",AWS_LAMBDA_FUNCTION_MEMORY_SIZE:u="",AWS_REGION:h="",FUNCTION_MEMORY_MB:s="",FUNCTION_REGION:a="",FUNCTION_TIMEOUT_SEC:E="",VERCEL_REGION:l=""}=eu.env,g=e.startsWith("AWS_Lambda_")||t.length>0,m=r.length>0,C=n.length>0||i.length>0,S=o.length>0,D=new Map;return S&&!(m||C)?(l.length>0&&D.set("region",l),D.set("name","vercel"),D):g&&!(m||C||S)?(h.length>0&&D.set("region",h),u.length>0&&Number.isInteger(+u)&&D.set("memory_mb",new Ir.Int32(u)),D.set("name","aws.lambda"),D):m&&!(C||g||S)?(D.set("name","azure.func"),D):C&&!(m||g||S)?(a.length>0&&D.set("region",a),s.length>0&&Number.isInteger(+s)&&D.set("memory_mb",new Ir.Int32(s)),E.length>0&&Number.isInteger(+E)&&D.set("timeout_sec",new Ir.Int32(E)),D.set("name","gcp.func"),D):null}function Xf(){var t,r;const e=Ir.NumberUtils.isBigEndian?"BE":"LE";return"Deno"in globalThis?`Deno v${typeof((t=Deno==null?void 0:Deno.version)==null?void 0:t.deno)=="string"?(r=Deno==null?void 0:Deno.version)==null?void 0:r.deno:"0.0.0-unknown"}, ${e}`:"Bun"in globalThis?`Bun v${typeof(Bun==null?void 0:Bun.version)=="string"?Bun==null?void 0:Bun.version:"0.0.0-unknown"}, ${e}`:`Node.js ${eu.version}, ${e}`}var Vs={},Ws={},rt={},ru={},V0={},Io={};(function(e){function t(O,M,p){return p.globals&&(O=p.globals[O.name]),new O(`${p.context?p.context:"Value"} ${M}.`)}function r(O,M){if(typeof O=="bigint")throw t(TypeError,"is a BigInt which cannot be converted to a number",M);return M.globals?M.globals.Number(O):Number(O)}function n(O){return O>0&&O%1===.5&&!(O&1)||O<0&&O%1===-.5&&(O&1)===1?h(Math.floor(O)):h(Math.round(O))}function i(O){return h(Math.trunc(O))}function o(O){return O<0?-1:1}function u(O,M){const p=O%M;return o(M)!==o(p)?p+M:p}function h(O){return O===0?0:O}function s(O,{unsigned:M}){let p,B;M?(p=0,B=2**O-1):(p=-(2**(O-1)),B=2**(O-1)-1);const d=2**O,b=2**(O-1);return(f,c={})=>{let w=r(f,c);if(w=h(w),c.enforceRange){if(!Number.isFinite(w))throw t(TypeError,"is not a finite number",c);if(w=i(w),w<p||w>B)throw t(TypeError,`is outside the accepted range of ${p} to ${B}, inclusive`,c);return w}return!Number.isNaN(w)&&c.clamp?(w=Math.min(Math.max(w,p),B),w=n(w),w):!Number.isFinite(w)||w===0?0:(w=i(w),w>=p&&w<=B?w:(w=u(w,d),!M&&w>=b?w-d:w))}}function a(O,{unsigned:M}){const p=Number.MAX_SAFE_INTEGER,B=M?0:Number.MIN_SAFE_INTEGER,d=M?BigInt.asUintN:BigInt.asIntN;return(b,f={})=>{let c=r(b,f);if(c=h(c),f.enforceRange){if(!Number.isFinite(c))throw t(TypeError,"is not a finite number",f);if(c=i(c),c<B||c>p)throw t(TypeError,`is outside the accepted range of ${B} to ${p}, inclusive`,f);return c}if(!Number.isNaN(c)&&f.clamp)return c=Math.min(Math.max(c,B),p),c=n(c),c;if(!Number.isFinite(c)||c===0)return 0;let w=BigInt(i(c));return w=d(O,w),Number(w)}}e.any=O=>O,e.undefined=()=>{},e.boolean=O=>!!O,e.byte=s(8,{unsigned:!1}),e.octet=s(8,{unsigned:!0}),e.short=s(16,{unsigned:!1}),e["unsigned short"]=s(16,{unsigned:!0}),e.long=s(32,{unsigned:!1}),e["unsigned long"]=s(32,{unsigned:!0}),e["long long"]=a(64,{unsigned:!1}),e["unsigned long long"]=a(64,{unsigned:!0}),e.double=(O,M={})=>{const p=r(O,M);if(!Number.isFinite(p))throw t(TypeError,"is not a finite floating-point value",M);return p},e["unrestricted double"]=(O,M={})=>r(O,M),e.float=(O,M={})=>{const p=r(O,M);if(!Number.isFinite(p))throw t(TypeError,"is not a finite floating-point value",M);if(Object.is(p,-0))return p;const B=Math.fround(p);if(!Number.isFinite(B))throw t(TypeError,"is outside the range of a single-precision floating-point value",M);return B},e["unrestricted float"]=(O,M={})=>{const p=r(O,M);return isNaN(p)||Object.is(p,-0)?p:Math.fround(p)},e.DOMString=(O,M={})=>{if(M.treatNullAsEmptyString&&O===null)return"";if(typeof O=="symbol")throw t(TypeError,"is a symbol, which cannot be converted to a string",M);return(M.globals?M.globals.String:String)(O)},e.ByteString=(O,M={})=>{const p=e.DOMString(O,M);let B;for(let d=0;(B=p.codePointAt(d))!==void 0;++d)if(B>255)throw t(TypeError,"is not a valid ByteString",M);return p},e.USVString=(O,M={})=>{const p=e.DOMString(O,M),B=p.length,d=[];for(let b=0;b<B;++b){const f=p.charCodeAt(b);if(f<55296||f>57343)d.push(String.fromCodePoint(f));else if(56320<=f&&f<=57343)d.push(String.fromCodePoint(65533));else if(b===B-1)d.push(String.fromCodePoint(65533));else{const c=p.charCodeAt(b+1);if(56320<=c&&c<=57343){const w=f&1023,T=c&1023;d.push(String.fromCodePoint(65536+1024*w+T)),++b}else d.push(String.fromCodePoint(65533))}}return d.join("")},e.object=(O,M={})=>{if(O===null||typeof O!="object"&&typeof O!="function")throw t(TypeError,"is not an object",M);return O};const E=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get,l=typeof SharedArrayBuffer=="function"?Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype,"byteLength").get:null;function g(O){try{return E.call(O),!0}catch{return!1}}function m(O){try{return l.call(O),!0}catch{return!1}}function C(O){try{return new Uint8Array(O),!1}catch{return!0}}e.ArrayBuffer=(O,M={})=>{if(!g(O))throw M.allowShared&&!m(O)?t(TypeError,"is not an ArrayBuffer or SharedArrayBuffer",M):t(TypeError,"is not an ArrayBuffer",M);if(C(O))throw t(TypeError,"is a detached ArrayBuffer",M);return O};const S=Object.getOwnPropertyDescriptor(DataView.prototype,"byteLength").get;e.DataView=(O,M={})=>{try{S.call(O)}catch{throw t(TypeError,"is not a DataView",M)}if(!M.allowShared&&m(O.buffer))throw t(TypeError,"is backed by a SharedArrayBuffer, which is not allowed",M);if(C(O.buffer))throw t(TypeError,"is backed by a detached ArrayBuffer",M);return O};const D=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array).prototype,Symbol.toStringTag).get;[Int8Array,Int16Array,Int32Array,Uint8Array,Uint16Array,Uint32Array,Uint8ClampedArray,Float32Array,Float64Array].forEach(O=>{const{name:M}=O,p=/^[AEIOU]/u.test(M)?"an":"a";e[M]=(B,d={})=>{if(!ArrayBuffer.isView(B)||D.call(B)!==M)throw t(TypeError,`is not ${p} ${M} object`,d);if(!d.allowShared&&m(B.buffer))throw t(TypeError,"is a view on a SharedArrayBuffer, which is not allowed",d);if(C(B.buffer))throw t(TypeError,"is a view on a detached ArrayBuffer",d);return B}}),e.ArrayBufferView=(O,M={})=>{if(!ArrayBuffer.isView(O))throw t(TypeError,"is not a view on an ArrayBuffer or SharedArrayBuffer",M);if(!M.allowShared&&m(O.buffer))throw t(TypeError,"is a view on a SharedArrayBuffer, which is not allowed",M);if(C(O.buffer))throw t(TypeError,"is a view on a detached ArrayBuffer",M);return O},e.BufferSource=(O,M={})=>{if(ArrayBuffer.isView(O)){if(!M.allowShared&&m(O.buffer))throw t(TypeError,"is a view on a SharedArrayBuffer, which is not allowed",M);if(C(O.buffer))throw t(TypeError,"is a view on a detached ArrayBuffer",M);return O}if(!M.allowShared&&!g(O))throw t(TypeError,"is not an ArrayBuffer or a view on one",M);if(M.allowShared&&!m(O)&&!g(O))throw t(TypeError,"is not an ArrayBuffer, SharedArrayBuffer, or a view on one",M);if(C(O))throw t(TypeError,"is a detached ArrayBuffer",M);return O},e.DOMTimeStamp=e["unsigned long long"]})(Io);var W0={exports:{}};(function(e,t){function r(x){return typeof x=="object"&&x!==null||typeof x=="function"}const n=Function.prototype.call.bind(Object.prototype.hasOwnProperty);function i(x,Y){for(const $ of Reflect.ownKeys(Y)){const K=Reflect.getOwnPropertyDescriptor(Y,$);if(K&&!Reflect.defineProperty(x,$,K))throw new TypeError(`Cannot redefine property: ${String($)}`)}}function o(x,Y){const $=l(x);return Object.defineProperties(Object.create($["%Object.prototype%"]),Object.getOwnPropertyDescriptors(Y))}const u=Symbol("wrapper"),h=Symbol("impl"),s=Symbol("SameObject caches"),a=Symbol.for("[webidl2js] constructor registry"),E=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);function l(x){if(n(x,a))return x[a];const Y=Object.create(null);Y["%Object.prototype%"]=x.Object.prototype,Y["%IteratorPrototype%"]=Object.getPrototypeOf(Object.getPrototypeOf(new x.Array()[Symbol.iterator]()));try{Y["%AsyncIteratorPrototype%"]=Object.getPrototypeOf(Object.getPrototypeOf(x.eval("(async function* () {})").prototype))}catch{Y["%AsyncIteratorPrototype%"]=E}return x[a]=Y,Y}function g(x,Y,$){return x[s]||(x[s]=Object.create(null)),Y in x[s]||(x[s][Y]=$()),x[s][Y]}function m(x){return x?x[u]:null}function C(x){return x?x[h]:null}function S(x){const Y=m(x);return Y||x}function D(x){const Y=C(x);return Y||x}const O=Symbol("internal");function M(x){if(typeof x!="string")return!1;const Y=x>>>0;if(Y===2**32-1)return!1;const $=`${Y}`;return x===$}const p=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get;function B(x){try{return p.call(x),!0}catch{return!1}}function d([x,Y],$){let K;switch($){case"key":K=x;break;case"value":K=Y;break;case"key+value":K=[x,Y];break}return{value:K,done:!1}}const b=Symbol("supports property index"),f=Symbol("supported property indices"),c=Symbol("supports property name"),w=Symbol("supported property names"),T=Symbol("indexed property get"),_=Symbol("indexed property set new"),A=Symbol("indexed property set existing"),y=Symbol("named property get"),F=Symbol("named property set new"),R=Symbol("named property set existing"),v=Symbol("named property delete"),J=Symbol("async iterator get the next iteration result"),I=Symbol("async iterator return steps"),N=Symbol("async iterator initialization steps"),j=Symbol("async iterator end of iteration");e.exports={isObject:r,hasOwn:n,define:i,newObjectInRealm:o,wrapperSymbol:u,implSymbol:h,getSameObject:g,ctorRegistrySymbol:a,initCtorRegistry:l,wrapperForImpl:m,implForWrapper:C,tryWrapperForImpl:S,tryImplForWrapper:D,iterInternalSymbol:O,isArrayBuffer:B,isArrayIndexPropName:M,supportsPropertyIndex:b,supportedPropertyIndices:f,supportsPropertyName:c,supportedPropertyNames:w,indexedGet:T,indexedSetNew:_,indexedSetExisting:A,namedGet:y,namedSetNew:F,namedSetExisting:R,namedDelete:v,asyncIteratorNext:J,asyncIteratorReturn:I,asyncIteratorInit:N,asyncIteratorEOI:j,iteratorResult:d}})(W0);var nu=W0.exports,Gs={},G0={exports:{}};const fn=2147483647,zt=36,iu=1,Qn=26,Jf=38,Qf=700,q0=72,H0=128,K0="-",Zf=/^xn--/,$f=/[^\0-\x7F]/,e3=/[\x2E\u3002\uFF0E\uFF61]/g,t3={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},qs=zt-iu,Vt=Math.floor,Hs=String.fromCharCode;function ar(e){throw new RangeError(t3[e])}function r3(e,t){const r=[];let n=e.length;for(;n--;)r[n]=t(e[n]);return r}function Y0(e,t){const r=e.split("@");let n="";r.length>1&&(n=r[0]+"@",e=r[1]),e=e.replace(e3,".");const i=e.split("."),o=r3(i,t).join(".");return n+o}function ou(e){const t=[];let r=0;const n=e.length;for(;r<n;){const i=e.charCodeAt(r++);if(i>=55296&&i<=56319&&r<n){const o=e.charCodeAt(r++);(o&64512)==56320?t.push(((i&1023)<<10)+(o&1023)+65536):(t.push(i),r--)}else t.push(i)}return t}const X0=e=>String.fromCodePoint(...e),n3=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:zt},Ta=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},J0=function(e,t,r){let n=0;for(e=r?Vt(e/Qf):e>>1,e+=Vt(e/t);e>qs*Qn>>1;n+=zt)e=Vt(e/qs);return Vt(n+(qs+1)*e/(e+Jf))},su=function(e){const t=[],r=e.length;let n=0,i=H0,o=q0,u=e.lastIndexOf(K0);u<0&&(u=0);for(let h=0;h<u;++h)e.charCodeAt(h)>=128&&ar("not-basic"),t.push(e.charCodeAt(h));for(let h=u>0?u+1:0;h<r;){const s=n;for(let E=1,l=zt;;l+=zt){h>=r&&ar("invalid-input");const g=n3(e.charCodeAt(h++));g>=zt&&ar("invalid-input"),g>Vt((fn-n)/E)&&ar("overflow"),n+=g*E;const m=l<=o?iu:l>=o+Qn?Qn:l-o;if(g<m)break;const C=zt-m;E>Vt(fn/C)&&ar("overflow"),E*=C}const a=t.length+1;o=J0(n-s,a,s==0),Vt(n/a)>fn-i&&ar("overflow"),i+=Vt(n/a),n%=a,t.splice(n++,0,i)}return String.fromCodePoint(...t)},uu=function(e){const t=[];e=ou(e);const r=e.length;let n=H0,i=0,o=q0;for(const s of e)s<128&&t.push(Hs(s));const u=t.length;let h=u;for(u&&t.push(K0);h<r;){let s=fn;for(const E of e)E>=n&&E<s&&(s=E);const a=h+1;s-n>Vt((fn-i)/a)&&ar("overflow"),i+=(s-n)*a,n=s;for(const E of e)if(E<n&&++i>fn&&ar("overflow"),E===n){let l=i;for(let g=zt;;g+=zt){const m=g<=o?iu:g>=o+Qn?Qn:g-o;if(l<m)break;const C=l-m,S=zt-m;t.push(Hs(Ta(m+C%S,0))),l=Vt(C/S)}t.push(Hs(Ta(l,0))),o=J0(i,a,h===u),i=0,++h}++i,++n}return t.join("")},Q0=function(e){return Y0(e,function(t){return Zf.test(t)?su(t.slice(4).toLowerCase()):t})},Z0=function(e){return Y0(e,function(t){return $f.test(t)?"xn--"+uu(t):t})},i3={version:"2.3.1",ucs2:{decode:ou,encode:X0},decode:su,encode:uu,toASCII:Z0,toUnicode:Q0},o3=Object.freeze(Object.defineProperty({__proto__:null,decode:su,default:i3,encode:uu,toASCII:Z0,toUnicode:Q0,ucs2decode:ou,ucs2encode:X0},Symbol.toStringTag,{value:"Module"})),s3=pr(o3),u3=/[\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-\u1ACE\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{10EFC}-\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{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{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]/u,a3=/[\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,c3=/[\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\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{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-\u1ACE\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{10EFC}-\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{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{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-\u1ACE\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{10EFC}-\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{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{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-\u088E\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{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,l3=/[\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-\u088E\u0890\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{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{10EC4}\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,h3=/[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\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\u0CDD\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-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\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{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{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{16F00}-\u{16F4A}\u{16F50}-\u{16F87}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{16FF0}\u{16FF1}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18CFF}-\u{18D08}\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{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{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}]/u,d3=/[\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-\u088E\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{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{10EC4}\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,f3=/^[\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-\u088E\u0890\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-\u1ACE\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-\u20C0\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-\u2B95\u2B97-\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-\uFBC2\uFBD3-\uFD8F\uFD92-\uFDC7\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{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{10EC4}\u{10EFC}-\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{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{1CCF9}\u{1CD00}-\u{1CEB3}\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{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{1F6D7}\u{1F6DC}-\u{1F6EC}\u{1F6F0}-\u{1F6FC}\u{1F700}-\u{1F776}\u{1F77B}-\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{1F900}-\u{1FA53}\u{1FA60}-\u{1FA6D}\u{1FA70}-\u{1FA7C}\u{1FA80}-\u{1FA89}\u{1FA8F}-\u{1FAC6}\u{1FACE}-\u{1FADC}\u{1FADF}-\u{1FAE9}\u{1FAF0}-\u{1FAF8}\u{1FB00}-\u{1FB92}\u{1FB94}-\u{1FBF9}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*$/u,m3=/[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-\u088E\u0890\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{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{10EC4}\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-\u1ACE\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{10EFC}-\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{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{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]*$/u,E3=/[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,g3=/[\u0600-\u0605\u0660-\u0669\u066B\u066C\u06DD\u0890\u0891\u08E2\u{10D30}-\u{10D39}\u{10D40}-\u{10D49}\u{10E60}-\u{10E7E}]/u,A3=/^[\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\u0C5D\u0C60-\u0C63\u0C66-\u0C6F\u0C77-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDD\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-\u1ACE\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-\u20C0\u20D0-\u20F0\u2100-\u218B\u2190-\u2429\u2440-\u244A\u2460-\u2B73\u2B76-\u2B95\u2B97-\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-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\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\uFD3E-\uFD4F\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{10EFC}-\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{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{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{16F00}-\u{16F4A}\u{16F4F}-\u{16F87}\u{16F8F}-\u{16F9F}\u{16FE0}-\u{16FE4}\u{16FF0}\u{16FF1}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18CFF}-\u{18D08}\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{1CCF9}\u{1CD00}-\u{1CEB3}\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{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{1F6D7}\u{1F6DC}-\u{1F6EC}\u{1F6F0}-\u{1F6FC}\u{1F700}-\u{1F776}\u{1F77B}-\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{1F900}-\u{1FA53}\u{1FA60}-\u{1FA6D}\u{1FA70}-\u{1FA7C}\u{1FA80}-\u{1FA89}\u{1FA8F}-\u{1FAC6}\u{1FACE}-\u{1FADC}\u{1FADF}-\u{1FAE9}\u{1FAF0}-\u{1FAF8}\u{1FB00}-\u{1FB92}\u{1FB94}-\u{1FBF9}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}]*$/u,p3=/[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\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\u0CDD\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-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\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{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{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{16F00}-\u{16F4A}\u{16F50}-\u{16F87}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{16FF0}\u{16FF1}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18CFF}-\u{18D08}\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{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{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}\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-\u1ACE\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{10EFC}-\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{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{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]*$/u;var C3={combiningMarks:u3,combiningClassVirama:a3,validZWNJ:c3,bidiDomain:l3,bidiS1LTR:h3,bidiS1RTL:d3,bidiS2:f3,bidiS3:m3,bidiS4EN:E3,bidiS4AN:g3,bidiS5:A3,bidiS6:p3};const S3=[[[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," ̈"],[169,2],[170,1,"a"],[[171,172],2],[173,7],[174,2],[175,1," ̄"],[[176,177],2],[178,1,"2"],[179,1,"3"],[180,1," ́"],[181,1,"μ"],[182,2],[183,2],[184,1," ̧"],[185,1,"1"],[186,1,"o"],[187,2],[188,1,"1⁄4"],[189,1,"1⁄2"],[190,1,"3⁄4"],[191,2],[192,1,"à"],[193,1,"á"],[194,1,"â"],[195,1,"ã"],[196,1,"ä"],[197,1,"å"],[198,1,"æ"],[199,1,"ç"],[200,1,"è"],[201,1,"é"],[202,1,"ê"],[203,1,"ë"],[204,1,"ì"],[205,1,"í"],[206,1,"î"],[207,1,"ï"],[208,1,"ð"],[209,1,"ñ"],[210,1,"ò"],[211,1,"ó"],[212,1,"ô"],[213,1,"õ"],[214,1,"ö"],[215,2],[216,1,"ø"],[217,1,"ù"],[218,1,"ú"],[219,1,"û"],[220,1,"ü"],[221,1,"ý"],[222,1,"þ"],[223,6,"ss"],[[224,246],2],[247,2],[[248,255],2],[256,1,"ā"],[257,2],[258,1,"ă"],[259,2],[260,1,"ą"],[261,2],[262,1,"ć"],[263,2],[264,1,"ĉ"],[265,2],[266,1,"ċ"],[267,2],[268,1,"č"],[269,2],[270,1,"ď"],[271,2],[272,1,"đ"],[273,2],[274,1,"ē"],[275,2],[276,1,"ĕ"],[277,2],[278,1,"ė"],[279,2],[280,1,"ę"],[281,2],[282,1,"ě"],[283,2],[284,1,"ĝ"],[285,2],[286,1,"ğ"],[287,2],[288,1,"ġ"],[289,2],[290,1,"ģ"],[291,2],[292,1,"ĥ"],[293,2],[294,1,"ħ"],[295,2],[296,1,"ĩ"],[297,2],[298,1,"ī"],[299,2],[300,1,"ĭ"],[301,2],[302,1,"į"],[303,2],[304,1,"i̇"],[305,2],[[306,307],1,"ij"],[308,1,"ĵ"],[309,2],[310,1,"ķ"],[[311,312],2],[313,1,"ĺ"],[314,2],[315,1,"ļ"],[316,2],[317,1,"ľ"],[318,2],[[319,320],1,"l·"],[321,1,"ł"],[322,2],[323,1,"ń"],[324,2],[325,1,"ņ"],[326,2],[327,1,"ň"],[328,2],[329,1,"ʼn"],[330,1,"ŋ"],[331,2],[332,1,"ō"],[333,2],[334,1,"ŏ"],[335,2],[336,1,"ő"],[337,2],[338,1,"œ"],[339,2],[340,1,"ŕ"],[341,2],[342,1,"ŗ"],[343,2],[344,1,"ř"],[345,2],[346,1,"ś"],[347,2],[348,1,"ŝ"],[349,2],[350,1,"ş"],[351,2],[352,1,"š"],[353,2],[354,1,"ţ"],[355,2],[356,1,"ť"],[357,2],[358,1,"ŧ"],[359,2],[360,1,"ũ"],[361,2],[362,1,"ū"],[363,2],[364,1,"ŭ"],[365,2],[366,1,"ů"],[367,2],[368,1,"ű"],[369,2],[370,1,"ų"],[371,2],[372,1,"ŵ"],[373,2],[374,1,"ŷ"],[375,2],[376,1,"ÿ"],[377,1,"ź"],[378,2],[379,1,"ż"],[380,2],[381,1,"ž"],[382,2],[383,1,"s"],[384,2],[385,1,"ɓ"],[386,1,"ƃ"],[387,2],[388,1,"ƅ"],[389,2],[390,1,"ɔ"],[391,1,"ƈ"],[392,2],[393,1,"ɖ"],[394,1,"ɗ"],[395,1,"ƌ"],[[396,397],2],[398,1,"ǝ"],[399,1,"ə"],[400,1,"ɛ"],[401,1,"ƒ"],[402,2],[403,1,"ɠ"],[404,1,"ɣ"],[405,2],[406,1,"ɩ"],[407,1,"ɨ"],[408,1,"ƙ"],[[409,411],2],[412,1,"ɯ"],[413,1,"ɲ"],[414,2],[415,1,"ɵ"],[416,1,"ơ"],[417,2],[418,1,"ƣ"],[419,2],[420,1,"ƥ"],[421,2],[422,1,"ʀ"],[423,1,"ƨ"],[424,2],[425,1,"ʃ"],[[426,427],2],[428,1,"ƭ"],[429,2],[430,1,"ʈ"],[431,1,"ư"],[432,2],[433,1,"ʊ"],[434,1,"ʋ"],[435,1,"ƴ"],[436,2],[437,1,"ƶ"],[438,2],[439,1,"ʒ"],[440,1,"ƹ"],[[441,443],2],[444,1,"ƽ"],[[445,451],2],[[452,454],1,"dž"],[[455,457],1,"lj"],[[458,460],1,"nj"],[461,1,"ǎ"],[462,2],[463,1,"ǐ"],[464,2],[465,1,"ǒ"],[466,2],[467,1,"ǔ"],[468,2],[469,1,"ǖ"],[470,2],[471,1,"ǘ"],[472,2],[473,1,"ǚ"],[474,2],[475,1,"ǜ"],[[476,477],2],[478,1,"ǟ"],[479,2],[480,1,"ǡ"],[481,2],[482,1,"ǣ"],[483,2],[484,1,"ǥ"],[485,2],[486,1,"ǧ"],[487,2],[488,1,"ǩ"],[489,2],[490,1,"ǫ"],[491,2],[492,1,"ǭ"],[493,2],[494,1,"ǯ"],[[495,496],2],[[497,499],1,"dz"],[500,1,"ǵ"],[501,2],[502,1,"ƕ"],[503,1,"ƿ"],[504,1,"ǹ"],[505,2],[506,1,"ǻ"],[507,2],[508,1,"ǽ"],[509,2],[510,1,"ǿ"],[511,2],[512,1,"ȁ"],[513,2],[514,1,"ȃ"],[515,2],[516,1,"ȅ"],[517,2],[518,1,"ȇ"],[519,2],[520,1,"ȉ"],[521,2],[522,1,"ȋ"],[523,2],[524,1,"ȍ"],[525,2],[526,1,"ȏ"],[527,2],[528,1,"ȑ"],[529,2],[530,1,"ȓ"],[531,2],[532,1,"ȕ"],[533,2],[534,1,"ȗ"],[535,2],[536,1,"ș"],[537,2],[538,1,"ț"],[539,2],[540,1,"ȝ"],[541,2],[542,1,"ȟ"],[543,2],[544,1,"ƞ"],[545,2],[546,1,"ȣ"],[547,2],[548,1,"ȥ"],[549,2],[550,1,"ȧ"],[551,2],[552,1,"ȩ"],[553,2],[554,1,"ȫ"],[555,2],[556,1,"ȭ"],[557,2],[558,1,"ȯ"],[559,2],[560,1,"ȱ"],[561,2],[562,1,"ȳ"],[563,2],[[564,566],2],[[567,569],2],[570,1,"ⱥ"],[571,1,"ȼ"],[572,2],[573,1,"ƚ"],[574,1,"ⱦ"],[[575,576],2],[577,1,"ɂ"],[578,2],[579,1,"ƀ"],[580,1,"ʉ"],[581,1,"ʌ"],[582,1,"ɇ"],[583,2],[584,1,"ɉ"],[585,2],[586,1,"ɋ"],[587,2],[588,1,"ɍ"],[589,2],[590,1,"ɏ"],[591,2],[[592,680],2],[[681,685],2],[[686,687],2],[688,1,"h"],[689,1,"ɦ"],[690,1,"j"],[691,1,"r"],[692,1,"ɹ"],[693,1,"ɻ"],[694,1,"ʁ"],[695,1,"w"],[696,1,"y"],[[697,705],2],[[706,709],2],[[710,721],2],[[722,727],2],[728,1," ̆"],[729,1," ̇"],[730,1," ̊"],[731,1," ̨"],[732,1," ̃"],[733,1," ̋"],[734,2],[735,2],[736,1,"ɣ"],[737,1,"l"],[738,1,"s"],[739,1,"x"],[740,1,"ʕ"],[[741,745],2],[[746,747],2],[748,2],[749,2],[750,2],[[751,767],2],[[768,831],2],[832,1,"̀"],[833,1,"́"],[834,2],[835,1,"̓"],[836,1,"̈́"],[837,1,"ι"],[[838,846],2],[847,7],[[848,855],2],[[856,860],2],[[861,863],2],[[864,865],2],[866,2],[[867,879],2],[880,1,"ͱ"],[881,2],[882,1,"ͳ"],[883,2],[884,1,"ʹ"],[885,2],[886,1,"ͷ"],[887,2],[[888,889],3],[890,1," ι"],[[891,893],2],[894,1,";"],[895,1,"ϳ"],[[896,899],3],[900,1," ́"],[901,1," ̈́"],[902,1,"ά"],[903,1,"·"],[904,1,"έ"],[905,1,"ή"],[906,1,"ί"],[907,3],[908,1,"ό"],[909,3],[910,1,"ύ"],[911,1,"ώ"],[912,2],[913,1,"α"],[914,1,"β"],[915,1,"γ"],[916,1,"δ"],[917,1,"ε"],[918,1,"ζ"],[919,1,"η"],[920,1,"θ"],[921,1,"ι"],[922,1,"κ"],[923,1,"λ"],[924,1,"μ"],[925,1,"ν"],[926,1,"ξ"],[927,1,"ο"],[928,1,"π"],[929,1,"ρ"],[930,3],[931,1,"σ"],[932,1,"τ"],[933,1,"υ"],[934,1,"φ"],[935,1,"χ"],[936,1,"ψ"],[937,1,"ω"],[938,1,"ϊ"],[939,1,"ϋ"],[[940,961],2],[962,6,"σ"],[[963,974],2],[975,1,"ϗ"],[976,1,"β"],[977,1,"θ"],[978,1,"υ"],[979,1,"ύ"],[980,1,"ϋ"],[981,1,"φ"],[982,1,"π"],[983,2],[984,1,"ϙ"],[985,2],[986,1,"ϛ"],[987,2],[988,1,"ϝ"],[989,2],[990,1,"ϟ"],[991,2],[992,1,"ϡ"],[993,2],[994,1,"ϣ"],[995,2],[996,1,"ϥ"],[997,2],[998,1,"ϧ"],[999,2],[1e3,1,"ϩ"],[1001,2],[1002,1,"ϫ"],[1003,2],[1004,1,"ϭ"],[1005,2],[1006,1,"ϯ"],[1007,2],[1008,1,"κ"],[1009,1,"ρ"],[1010,1,"σ"],[1011,2],[1012,1,"θ"],[1013,1,"ε"],[1014,2],[1015,1,"ϸ"],[1016,2],[1017,1,"σ"],[1018,1,"ϻ"],[1019,2],[1020,2],[1021,1,"ͻ"],[1022,1,"ͼ"],[1023,1,"ͽ"],[1024,1,"ѐ"],[1025,1,"ё"],[1026,1,"ђ"],[1027,1,"ѓ"],[1028,1,"є"],[1029,1,"ѕ"],[1030,1,"і"],[1031,1,"ї"],[1032,1,"ј"],[1033,1,"љ"],[1034,1,"њ"],[1035,1,"ћ"],[1036,1,"ќ"],[1037,1,"ѝ"],[1038,1,"ў"],[1039,1,"џ"],[1040,1,"а"],[1041,1,"б"],[1042,1,"в"],[1043,1,"г"],[1044,1,"д"],[1045,1,"е"],[1046,1,"ж"],[1047,1,"з"],[1048,1,"и"],[1049,1,"й"],[1050,1,"к"],[1051,1,"л"],[1052,1,"м"],[1053,1,"н"],[1054,1,"о"],[1055,1,"п"],[1056,1,"р"],[1057,1,"с"],[1058,1,"т"],[1059,1,"у"],[1060,1,"ф"],[1061,1,"х"],[1062,1,"ц"],[1063,1,"ч"],[1064,1,"ш"],[1065,1,"щ"],[1066,1,"ъ"],[1067,1,"ы"],[1068,1,"ь"],[1069,1,"э"],[1070,1,"ю"],[1071,1,"я"],[[1072,1103],2],[1104,2],[[1105,1116],2],[1117,2],[[1118,1119],2],[1120,1,"ѡ"],[1121,2],[1122,1,"ѣ"],[1123,2],[1124,1,"ѥ"],[1125,2],[1126,1,"ѧ"],[1127,2],[1128,1,"ѩ"],[1129,2],[1130,1,"ѫ"],[1131,2],[1132,1,"ѭ"],[1133,2],[1134,1,"ѯ"],[1135,2],[1136,1,"ѱ"],[1137,2],[1138,1,"ѳ"],[1139,2],[1140,1,"ѵ"],[1141,2],[1142,1,"ѷ"],[1143,2],[1144,1,"ѹ"],[1145,2],[1146,1,"ѻ"],[1147,2],[1148,1,"ѽ"],[1149,2],[1150,1,"ѿ"],[1151,2],[1152,1,"ҁ"],[1153,2],[1154,2],[[1155,1158],2],[1159,2],[[1160,1161],2],[1162,1,"ҋ"],[1163,2],[1164,1,"ҍ"],[1165,2],[1166,1,"ҏ"],[1167,2],[1168,1,"ґ"],[1169,2],[1170,1,"ғ"],[1171,2],[1172,1,"ҕ"],[1173,2],[1174,1,"җ"],[1175,2],[1176,1,"ҙ"],[1177,2],[1178,1,"қ"],[1179,2],[1180,1,"ҝ"],[1181,2],[1182,1,"ҟ"],[1183,2],[1184,1,"ҡ"],[1185,2],[1186,1,"ң"],[1187,2],[1188,1,"ҥ"],[1189,2],[1190,1,"ҧ"],[1191,2],[1192,1,"ҩ"],[1193,2],[1194,1,"ҫ"],[1195,2],[1196,1,"ҭ"],[1197,2],[1198,1,"ү"],[1199,2],[1200,1,"ұ"],[1201,2],[1202,1,"ҳ"],[1203,2],[1204,1,"ҵ"],[1205,2],[1206,1,"ҷ"],[1207,2],[1208,1,"ҹ"],[1209,2],[1210,1,"һ"],[1211,2],[1212,1,"ҽ"],[1213,2],[1214,1,"ҿ"],[1215,2],[1216,1,"ӏ"],[1217,1,"ӂ"],[1218,2],[1219,1,"ӄ"],[1220,2],[1221,1,"ӆ"],[1222,2],[1223,1,"ӈ"],[1224,2],[1225,1,"ӊ"],[1226,2],[1227,1,"ӌ"],[1228,2],[1229,1,"ӎ"],[1230,2],[1231,2],[1232,1,"ӑ"],[1233,2],[1234,1,"ӓ"],[1235,2],[1236,1,"ӕ"],[1237,2],[1238,1,"ӗ"],[1239,2],[1240,1,"ә"],[1241,2],[1242,1,"ӛ"],[1243,2],[1244,1,"ӝ"],[1245,2],[1246,1,"ӟ"],[1247,2],[1248,1,"ӡ"],[1249,2],[1250,1,"ӣ"],[1251,2],[1252,1,"ӥ"],[1253,2],[1254,1,"ӧ"],[1255,2],[1256,1,"ө"],[1257,2],[1258,1,"ӫ"],[1259,2],[1260,1,"ӭ"],[1261,2],[1262,1,"ӯ"],[1263,2],[1264,1,"ӱ"],[1265,2],[1266,1,"ӳ"],[1267,2],[1268,1,"ӵ"],[1269,2],[1270,1,"ӷ"],[1271,2],[1272,1,"ӹ"],[1273,2],[1274,1,"ӻ"],[1275,2],[1276,1,"ӽ"],[1277,2],[1278,1,"ӿ"],[1279,2],[1280,1,"ԁ"],[1281,2],[1282,1,"ԃ"],[1283,2],[1284,1,"ԅ"],[1285,2],[1286,1,"ԇ"],[1287,2],[1288,1,"ԉ"],[1289,2],[1290,1,"ԋ"],[1291,2],[1292,1,"ԍ"],[1293,2],[1294,1,"ԏ"],[1295,2],[1296,1,"ԑ"],[1297,2],[1298,1,"ԓ"],[1299,2],[1300,1,"ԕ"],[1301,2],[1302,1,"ԗ"],[1303,2],[1304,1,"ԙ"],[1305,2],[1306,1,"ԛ"],[1307,2],[1308,1,"ԝ"],[1309,2],[1310,1,"ԟ"],[1311,2],[1312,1,"ԡ"],[1313,2],[1314,1,"ԣ"],[1315,2],[1316,1,"ԥ"],[1317,2],[1318,1,"ԧ"],[1319,2],[1320,1,"ԩ"],[1321,2],[1322,1,"ԫ"],[1323,2],[1324,1,"ԭ"],[1325,2],[1326,1,"ԯ"],[1327,2],[1328,3],[1329,1,"ա"],[1330,1,"բ"],[1331,1,"գ"],[1332,1,"դ"],[1333,1,"ե"],[1334,1,"զ"],[1335,1,"է"],[1336,1,"ը"],[1337,1,"թ"],[1338,1,"ժ"],[1339,1,"ի"],[1340,1,"լ"],[1341,1,"խ"],[1342,1,"ծ"],[1343,1,"կ"],[1344,1,"հ"],[1345,1,"ձ"],[1346,1,"ղ"],[1347,1,"ճ"],[1348,1,"մ"],[1349,1,"յ"],[1350,1,"ն"],[1351,1,"շ"],[1352,1,"ո"],[1353,1,"չ"],[1354,1,"պ"],[1355,1,"ջ"],[1356,1,"ռ"],[1357,1,"ս"],[1358,1,"վ"],[1359,1,"տ"],[1360,1,"ր"],[1361,1,"ց"],[1362,1,"ւ"],[1363,1,"փ"],[1364,1,"ք"],[1365,1,"օ"],[1366,1,"ֆ"],[[1367,1368],3],[1369,2],[[1370,1375],2],[1376,2],[[1377,1414],2],[1415,1,"եւ"],[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,"اٴ"],[1654,1,"وٴ"],[1655,1,"ۇٴ"],[1656,1,"يٴ"],[[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,3],[[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,"क़"],[2393,1,"ख़"],[2394,1,"ग़"],[2395,1,"ज़"],[2396,1,"ड़"],[2397,1,"ढ़"],[2398,1,"फ़"],[2399,1,"य़"],[[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,"ড়"],[2525,1,"ঢ়"],[2526,3],[2527,1,"য়"],[[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,"ਲ਼"],[2612,3],[2613,2],[2614,1,"ਸ਼"],[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,"ਖ਼"],[2650,1,"ਗ਼"],[2651,1,"ਜ਼"],[2652,2],[2653,3],[2654,1,"ਫ਼"],[[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,"ଡ଼"],[2909,1,"ଢ଼"],[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,3164],3],[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,3292],3],[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,"ํา"],[[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,"ໍາ"],[[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,"ຫນ"],[3805,1,"ຫມ"],[[3806,3807],2],[[3808,3839],3],[3840,2],[[3841,3850],2],[3851,2],[3852,1,"་"],[[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,"གྷ"],[[3908,3911],2],[3912,3],[[3913,3916],2],[3917,1,"ཌྷ"],[[3918,3921],2],[3922,1,"དྷ"],[[3923,3926],2],[3927,1,"བྷ"],[[3928,3931],2],[3932,1,"ཛྷ"],[[3933,3944],2],[3945,1,"ཀྵ"],[3946,2],[[3947,3948],2],[[3949,3952],3],[[3953,3954],2],[3955,1,"ཱི"],[3956,2],[3957,1,"ཱུ"],[3958,1,"ྲྀ"],[3959,1,"ྲཱྀ"],[3960,1,"ླྀ"],[3961,1,"ླཱྀ"],[[3962,3968],2],[3969,1,"ཱྀ"],[[3970,3972],2],[3973,2],[[3974,3979],2],[[3980,3983],2],[[3984,3986],2],[3987,1,"ྒྷ"],[[3988,3989],2],[3990,2],[3991,2],[3992,3],[[3993,3996],2],[3997,1,"ྜྷ"],[[3998,4001],2],[4002,1,"ྡྷ"],[[4003,4006],2],[4007,1,"ྦྷ"],[[4008,4011],2],[4012,1,"ྫྷ"],[4013,2],[[4014,4016],2],[[4017,4023],2],[4024,2],[4025,1,"ྐྵ"],[[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,"ⴀ"],[4257,1,"ⴁ"],[4258,1,"ⴂ"],[4259,1,"ⴃ"],[4260,1,"ⴄ"],[4261,1,"ⴅ"],[4262,1,"ⴆ"],[4263,1,"ⴇ"],[4264,1,"ⴈ"],[4265,1,"ⴉ"],[4266,1,"ⴊ"],[4267,1,"ⴋ"],[4268,1,"ⴌ"],[4269,1,"ⴍ"],[4270,1,"ⴎ"],[4271,1,"ⴏ"],[4272,1,"ⴐ"],[4273,1,"ⴑ"],[4274,1,"ⴒ"],[4275,1,"ⴓ"],[4276,1,"ⴔ"],[4277,1,"ⴕ"],[4278,1,"ⴖ"],[4279,1,"ⴗ"],[4280,1,"ⴘ"],[4281,1,"ⴙ"],[4282,1,"ⴚ"],[4283,1,"ⴛ"],[4284,1,"ⴜ"],[4285,1,"ⴝ"],[4286,1,"ⴞ"],[4287,1,"ⴟ"],[4288,1,"ⴠ"],[4289,1,"ⴡ"],[4290,1,"ⴢ"],[4291,1,"ⴣ"],[4292,1,"ⴤ"],[4293,1,"ⴥ"],[4294,3],[4295,1,"ⴧ"],[[4296,4300],3],[4301,1,"ⴭ"],[[4302,4303],3],[[4304,4342],2],[[4343,4344],2],[[4345,4346],2],[4347,2],[4348,1,"ნ"],[[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,"Ᏸ"],[5113,1,"Ᏹ"],[5114,1,"Ᏺ"],[5115,1,"Ᏻ"],[5116,1,"Ᏼ"],[5117,1,"Ᏽ"],[[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,6e3],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,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,"в"],[7297,1,"д"],[7298,1,"о"],[7299,1,"с"],[[7300,7301],1,"т"],[7302,1,"ъ"],[7303,1,"ѣ"],[7304,1,"ꙋ"],[7305,1,"ᲊ"],[7306,2],[[7307,7311],3],[7312,1,"ა"],[7313,1,"ბ"],[7314,1,"გ"],[7315,1,"დ"],[7316,1,"ე"],[7317,1,"ვ"],[7318,1,"ზ"],[7319,1,"თ"],[7320,1,"ი"],[7321,1,"კ"],[7322,1,"ლ"],[7323,1,"მ"],[7324,1,"ნ"],[7325,1,"ო"],[7326,1,"პ"],[7327,1,"ჟ"],[7328,1,"რ"],[7329,1,"ს"],[7330,1,"ტ"],[7331,1,"უ"],[7332,1,"ფ"],[7333,1,"ქ"],[7334,1,"ღ"],[7335,1,"ყ"],[7336,1,"შ"],[7337,1,"ჩ"],[7338,1,"ც"],[7339,1,"ძ"],[7340,1,"წ"],[7341,1,"ჭ"],[7342,1,"ხ"],[7343,1,"ჯ"],[7344,1,"ჰ"],[7345,1,"ჱ"],[7346,1,"ჲ"],[7347,1,"ჳ"],[7348,1,"ჴ"],[7349,1,"ჵ"],[7350,1,"ჶ"],[7351,1,"ჷ"],[7352,1,"ჸ"],[7353,1,"ჹ"],[7354,1,"ჺ"],[[7355,7356],3],[7357,1,"ჽ"],[7358,1,"ჾ"],[7359,1,"ჿ"],[[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,"æ"],[7470,1,"b"],[7471,2],[7472,1,"d"],[7473,1,"e"],[7474,1,"ǝ"],[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,"ȣ"],[7486,1,"p"],[7487,1,"r"],[7488,1,"t"],[7489,1,"u"],[7490,1,"w"],[7491,1,"a"],[7492,1,"ɐ"],[7493,1,"ɑ"],[7494,1,"ᴂ"],[7495,1,"b"],[7496,1,"d"],[7497,1,"e"],[7498,1,"ə"],[7499,1,"ɛ"],[7500,1,"ɜ"],[7501,1,"g"],[7502,2],[7503,1,"k"],[7504,1,"m"],[7505,1,"ŋ"],[7506,1,"o"],[7507,1,"ɔ"],[7508,1,"ᴖ"],[7509,1,"ᴗ"],[7510,1,"p"],[7511,1,"t"],[7512,1,"u"],[7513,1,"ᴝ"],[7514,1,"ɯ"],[7515,1,"v"],[7516,1,"ᴥ"],[7517,1,"β"],[7518,1,"γ"],[7519,1,"δ"],[7520,1,"φ"],[7521,1,"χ"],[7522,1,"i"],[7523,1,"r"],[7524,1,"u"],[7525,1,"v"],[7526,1,"β"],[7527,1,"γ"],[7528,1,"ρ"],[7529,1,"φ"],[7530,1,"χ"],[7531,2],[[7532,7543],2],[7544,1,"н"],[[7545,7578],2],[7579,1,"ɒ"],[7580,1,"c"],[7581,1,"ɕ"],[7582,1,"ð"],[7583,1,"ɜ"],[7584,1,"f"],[7585,1,"ɟ"],[7586,1,"ɡ"],[7587,1,"ɥ"],[7588,1,"ɨ"],[7589,1,"ɩ"],[7590,1,"ɪ"],[7591,1,"ᵻ"],[7592,1,"ʝ"],[7593,1,"ɭ"],[7594,1,"ᶅ"],[7595,1,"ʟ"],[7596,1,"ɱ"],[7597,1,"ɰ"],[7598,1,"ɲ"],[7599,1,"ɳ"],[7600,1,"ɴ"],[7601,1,"ɵ"],[7602,1,"ɸ"],[7603,1,"ʂ"],[7604,1,"ʃ"],[7605,1,"ƫ"],[7606,1,"ʉ"],[7607,1,"ʊ"],[7608,1,"ᴜ"],[7609,1,"ʋ"],[7610,1,"ʌ"],[7611,1,"z"],[7612,1,"ʐ"],[7613,1,"ʑ"],[7614,1,"ʒ"],[7615,1,"θ"],[[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,"ḁ"],[7681,2],[7682,1,"ḃ"],[7683,2],[7684,1,"ḅ"],[7685,2],[7686,1,"ḇ"],[7687,2],[7688,1,"ḉ"],[7689,2],[7690,1,"ḋ"],[7691,2],[7692,1,"ḍ"],[7693,2],[7694,1,"ḏ"],[7695,2],[7696,1,"ḑ"],[7697,2],[7698,1,"ḓ"],[7699,2],[7700,1,"ḕ"],[7701,2],[7702,1,"ḗ"],[7703,2],[7704,1,"ḙ"],[7705,2],[7706,1,"ḛ"],[7707,2],[7708,1,"ḝ"],[7709,2],[7710,1,"ḟ"],[7711,2],[7712,1,"ḡ"],[7713,2],[7714,1,"ḣ"],[7715,2],[7716,1,"ḥ"],[7717,2],[7718,1,"ḧ"],[7719,2],[7720,1,"ḩ"],[7721,2],[7722,1,"ḫ"],[7723,2],[7724,1,"ḭ"],[7725,2],[7726,1,"ḯ"],[7727,2],[7728,1,"ḱ"],[7729,2],[7730,1,"ḳ"],[7731,2],[7732,1,"ḵ"],[7733,2],[7734,1,"ḷ"],[7735,2],[7736,1,"ḹ"],[7737,2],[7738,1,"ḻ"],[7739,2],[7740,1,"ḽ"],[7741,2],[7742,1,"ḿ"],[7743,2],[7744,1,"ṁ"],[7745,2],[7746,1,"ṃ"],[7747,2],[7748,1,"ṅ"],[7749,2],[7750,1,"ṇ"],[7751,2],[7752,1,"ṉ"],[7753,2],[7754,1,"ṋ"],[7755,2],[7756,1,"ṍ"],[7757,2],[7758,1,"ṏ"],[7759,2],[7760,1,"ṑ"],[7761,2],[7762,1,"ṓ"],[7763,2],[7764,1,"ṕ"],[7765,2],[7766,1,"ṗ"],[7767,2],[7768,1,"ṙ"],[7769,2],[7770,1,"ṛ"],[7771,2],[7772,1,"ṝ"],[7773,2],[7774,1,"ṟ"],[7775,2],[7776,1,"ṡ"],[7777,2],[7778,1,"ṣ"],[7779,2],[7780,1,"ṥ"],[7781,2],[7782,1,"ṧ"],[7783,2],[7784,1,"ṩ"],[7785,2],[7786,1,"ṫ"],[7787,2],[7788,1,"ṭ"],[7789,2],[7790,1,"ṯ"],[7791,2],[7792,1,"ṱ"],[7793,2],[7794,1,"ṳ"],[7795,2],[7796,1,"ṵ"],[7797,2],[7798,1,"ṷ"],[7799,2],[7800,1,"ṹ"],[7801,2],[7802,1,"ṻ"],[7803,2],[7804,1,"ṽ"],[7805,2],[7806,1,"ṿ"],[7807,2],[7808,1,"ẁ"],[7809,2],[7810,1,"ẃ"],[7811,2],[7812,1,"ẅ"],[7813,2],[7814,1,"ẇ"],[7815,2],[7816,1,"ẉ"],[7817,2],[7818,1,"ẋ"],[7819,2],[7820,1,"ẍ"],[7821,2],[7822,1,"ẏ"],[7823,2],[7824,1,"ẑ"],[7825,2],[7826,1,"ẓ"],[7827,2],[7828,1,"ẕ"],[[7829,7833],2],[7834,1,"aʾ"],[7835,1,"ṡ"],[[7836,7837],2],[7838,1,"ß"],[7839,2],[7840,1,"ạ"],[7841,2],[7842,1,"ả"],[7843,2],[7844,1,"ấ"],[7845,2],[7846,1,"ầ"],[7847,2],[7848,1,"ẩ"],[7849,2],[7850,1,"ẫ"],[7851,2],[7852,1,"ậ"],[7853,2],[7854,1,"ắ"],[7855,2],[7856,1,"ằ"],[7857,2],[7858,1,"ẳ"],[7859,2],[7860,1,"ẵ"],[7861,2],[7862,1,"ặ"],[7863,2],[7864,1,"ẹ"],[7865,2],[7866,1,"ẻ"],[7867,2],[7868,1,"ẽ"],[7869,2],[7870,1,"ế"],[7871,2],[7872,1,"ề"],[7873,2],[7874,1,"ể"],[7875,2],[7876,1,"ễ"],[7877,2],[7878,1,"ệ"],[7879,2],[7880,1,"ỉ"],[7881,2],[7882,1,"ị"],[7883,2],[7884,1,"ọ"],[7885,2],[7886,1,"ỏ"],[7887,2],[7888,1,"ố"],[7889,2],[7890,1,"ồ"],[7891,2],[7892,1,"ổ"],[7893,2],[7894,1,"ỗ"],[7895,2],[7896,1,"ộ"],[7897,2],[7898,1,"ớ"],[7899,2],[7900,1,"ờ"],[7901,2],[7902,1,"ở"],[7903,2],[7904,1,"ỡ"],[7905,2],[7906,1,"ợ"],[7907,2],[7908,1,"ụ"],[7909,2],[7910,1,"ủ"],[7911,2],[7912,1,"ứ"],[7913,2],[7914,1,"ừ"],[7915,2],[7916,1,"ử"],[7917,2],[7918,1,"ữ"],[7919,2],[7920,1,"ự"],[7921,2],[7922,1,"ỳ"],[7923,2],[7924,1,"ỵ"],[7925,2],[7926,1,"ỷ"],[7927,2],[7928,1,"ỹ"],[7929,2],[7930,1,"ỻ"],[7931,2],[7932,1,"ỽ"],[7933,2],[7934,1,"ỿ"],[7935,2],[[7936,7943],2],[7944,1,"ἀ"],[7945,1,"ἁ"],[7946,1,"ἂ"],[7947,1,"ἃ"],[7948,1,"ἄ"],[7949,1,"ἅ"],[7950,1,"ἆ"],[7951,1,"ἇ"],[[7952,7957],2],[[7958,7959],3],[7960,1,"ἐ"],[7961,1,"ἑ"],[7962,1,"ἒ"],[7963,1,"ἓ"],[7964,1,"ἔ"],[7965,1,"ἕ"],[[7966,7967],3],[[7968,7975],2],[7976,1,"ἠ"],[7977,1,"ἡ"],[7978,1,"ἢ"],[7979,1,"ἣ"],[7980,1,"ἤ"],[7981,1,"ἥ"],[7982,1,"ἦ"],[7983,1,"ἧ"],[[7984,7991],2],[7992,1,"ἰ"],[7993,1,"ἱ"],[7994,1,"ἲ"],[7995,1,"ἳ"],[7996,1,"ἴ"],[7997,1,"ἵ"],[7998,1,"ἶ"],[7999,1,"ἷ"],[[8e3,8005],2],[[8006,8007],3],[8008,1,"ὀ"],[8009,1,"ὁ"],[8010,1,"ὂ"],[8011,1,"ὃ"],[8012,1,"ὄ"],[8013,1,"ὅ"],[[8014,8015],3],[[8016,8023],2],[8024,3],[8025,1,"ὑ"],[8026,3],[8027,1,"ὓ"],[8028,3],[8029,1,"ὕ"],[8030,3],[8031,1,"ὗ"],[[8032,8039],2],[8040,1,"ὠ"],[8041,1,"ὡ"],[8042,1,"ὢ"],[8043,1,"ὣ"],[8044,1,"ὤ"],[8045,1,"ὥ"],[8046,1,"ὦ"],[8047,1,"ὧ"],[8048,2],[8049,1,"ά"],[8050,2],[8051,1,"έ"],[8052,2],[8053,1,"ή"],[8054,2],[8055,1,"ί"],[8056,2],[8057,1,"ό"],[8058,2],[8059,1,"ύ"],[8060,2],[8061,1,"ώ"],[[8062,8063],3],[8064,1,"ἀι"],[8065,1,"ἁι"],[8066,1,"ἂι"],[8067,1,"ἃι"],[8068,1,"ἄι"],[8069,1,"ἅι"],[8070,1,"ἆι"],[8071,1,"ἇι"],[8072,1,"ἀι"],[8073,1,"ἁι"],[8074,1,"ἂι"],[8075,1,"ἃι"],[8076,1,"ἄι"],[8077,1,"ἅι"],[8078,1,"ἆι"],[8079,1,"ἇι"],[8080,1,"ἠι"],[8081,1,"ἡι"],[8082,1,"ἢι"],[8083,1,"ἣι"],[8084,1,"ἤι"],[8085,1,"ἥι"],[8086,1,"ἦι"],[8087,1,"ἧι"],[8088,1,"ἠι"],[8089,1,"ἡι"],[8090,1,"ἢι"],[8091,1,"ἣι"],[8092,1,"ἤι"],[8093,1,"ἥι"],[8094,1,"ἦι"],[8095,1,"ἧι"],[8096,1,"ὠι"],[8097,1,"ὡι"],[8098,1,"ὢι"],[8099,1,"ὣι"],[8100,1,"ὤι"],[8101,1,"ὥι"],[8102,1,"ὦι"],[8103,1,"ὧι"],[8104,1,"ὠι"],[8105,1,"ὡι"],[8106,1,"ὢι"],[8107,1,"ὣι"],[8108,1,"ὤι"],[8109,1,"ὥι"],[8110,1,"ὦι"],[8111,1,"ὧι"],[[8112,8113],2],[8114,1,"ὰι"],[8115,1,"αι"],[8116,1,"άι"],[8117,3],[8118,2],[8119,1,"ᾶι"],[8120,1,"ᾰ"],[8121,1,"ᾱ"],[8122,1,"ὰ"],[8123,1,"ά"],[8124,1,"αι"],[8125,1," ̓"],[8126,1,"ι"],[8127,1," ̓"],[8128,1," ͂"],[8129,1," ̈͂"],[8130,1,"ὴι"],[8131,1,"ηι"],[8132,1,"ήι"],[8133,3],[8134,2],[8135,1,"ῆι"],[8136,1,"ὲ"],[8137,1,"έ"],[8138,1,"ὴ"],[8139,1,"ή"],[8140,1,"ηι"],[8141,1," ̓̀"],[8142,1," ̓́"],[8143,1," ̓͂"],[[8144,8146],2],[8147,1,"ΐ"],[[8148,8149],3],[[8150,8151],2],[8152,1,"ῐ"],[8153,1,"ῑ"],[8154,1,"ὶ"],[8155,1,"ί"],[8156,3],[8157,1," ̔̀"],[8158,1," ̔́"],[8159,1," ̔͂"],[[8160,8162],2],[8163,1,"ΰ"],[[8164,8167],2],[8168,1,"ῠ"],[8169,1,"ῡ"],[8170,1,"ὺ"],[8171,1,"ύ"],[8172,1,"ῥ"],[8173,1," ̈̀"],[8174,1," ̈́"],[8175,1,"`"],[[8176,8177],3],[8178,1,"ὼι"],[8179,1,"ωι"],[8180,1,"ώι"],[8181,3],[8182,2],[8183,1,"ῶι"],[8184,1,"ὸ"],[8185,1,"ό"],[8186,1,"ὼ"],[8187,1,"ώ"],[8188,1,"ωι"],[8189,1," ́"],[8190,1," ̔"],[8191,3],[[8192,8202],1," "],[8203,7],[[8204,8205],6,""],[[8206,8207],3],[8208,2],[8209,1,"‐"],[[8210,8214],2],[8215,1," ̳"],[[8216,8227],2],[[8228,8230],3],[8231,2],[[8232,8238],3],[8239,1," "],[[8240,8242],2],[8243,1,"′′"],[8244,1,"′′′"],[8245,2],[8246,1,"‵‵"],[8247,1,"‵‵‵"],[[8248,8251],2],[8252,1,"!!"],[8253,2],[8254,1," ̅"],[[8255,8262],2],[8263,1,"??"],[8264,1,"?!"],[8265,1,"!?"],[[8266,8269],2],[[8270,8274],2],[[8275,8276],2],[[8277,8278],2],[8279,1,"′′′′"],[[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,"−"],[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,"−"],[8332,1,"="],[8333,1,"("],[8334,1,")"],[8335,3],[8336,1,"a"],[8337,1,"e"],[8338,1,"o"],[8339,1,"x"],[8340,1,"ə"],[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,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,"°c"],[8452,2],[8453,1,"c/o"],[8454,1,"c/u"],[8455,1,"ɛ"],[8456,2],[8457,1,"°f"],[8458,1,"g"],[[8459,8462],1,"h"],[8463,1,"ħ"],[[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,"ω"],[8487,2],[8488,1,"z"],[8489,2],[8490,1,"k"],[8491,1,"å"],[8492,1,"b"],[8493,1,"c"],[8494,2],[[8495,8496],1,"e"],[8497,1,"f"],[8498,1,"ⅎ"],[8499,1,"m"],[8500,1,"o"],[8501,1,"א"],[8502,1,"ב"],[8503,1,"ג"],[8504,1,"ד"],[8505,1,"i"],[8506,2],[8507,1,"fax"],[8508,1,"π"],[[8509,8510],1,"γ"],[8511,1,"π"],[8512,1,"∑"],[[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⁄7"],[8529,1,"1⁄9"],[8530,1,"1⁄10"],[8531,1,"1⁄3"],[8532,1,"2⁄3"],[8533,1,"1⁄5"],[8534,1,"2⁄5"],[8535,1,"3⁄5"],[8536,1,"4⁄5"],[8537,1,"1⁄6"],[8538,1,"5⁄6"],[8539,1,"1⁄8"],[8540,1,"3⁄8"],[8541,1,"5⁄8"],[8542,1,"7⁄8"],[8543,1,"1⁄"],[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,"ↄ"],[8580,2],[[8581,8584],2],[8585,1,"0⁄3"],[[8586,8587],2],[[8588,8591],3],[[8592,8682],2],[[8683,8691],2],[[8692,8703],2],[[8704,8747],2],[8748,1,"∫∫"],[8749,1,"∫∫∫"],[8750,2],[8751,1,"∮∮"],[8752,1,"∮∮∮"],[[8753,8945],2],[[8946,8959],2],[8960,2],[8961,2],[[8962,9e3],2],[9001,1,"〈"],[9002,1,"〉"],[[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,"∫∫∫∫"],[[10765,10867],2],[10868,1,"::="],[10869,1,"=="],[10870,1,"==="],[[10871,10971],2],[10972,1,"⫝̸"],[[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,3],[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,"ⰰ"],[11265,1,"ⰱ"],[11266,1,"ⰲ"],[11267,1,"ⰳ"],[11268,1,"ⰴ"],[11269,1,"ⰵ"],[11270,1,"ⰶ"],[11271,1,"ⰷ"],[11272,1,"ⰸ"],[11273,1,"ⰹ"],[11274,1,"ⰺ"],[11275,1,"ⰻ"],[11276,1,"ⰼ"],[11277,1,"ⰽ"],[11278,1,"ⰾ"],[11279,1,"ⰿ"],[11280,1,"ⱀ"],[11281,1,"ⱁ"],[11282,1,"ⱂ"],[11283,1,"ⱃ"],[11284,1,"ⱄ"],[11285,1,"ⱅ"],[11286,1,"ⱆ"],[11287,1,"ⱇ"],[11288,1,"ⱈ"],[11289,1,"ⱉ"],[11290,1,"ⱊ"],[11291,1,"ⱋ"],[11292,1,"ⱌ"],[11293,1,"ⱍ"],[11294,1,"ⱎ"],[11295,1,"ⱏ"],[11296,1,"ⱐ"],[11297,1,"ⱑ"],[11298,1,"ⱒ"],[11299,1,"ⱓ"],[11300,1,"ⱔ"],[11301,1,"ⱕ"],[11302,1,"ⱖ"],[11303,1,"ⱗ"],[11304,1,"ⱘ"],[11305,1,"ⱙ"],[11306,1,"ⱚ"],[11307,1,"ⱛ"],[11308,1,"ⱜ"],[11309,1,"ⱝ"],[11310,1,"ⱞ"],[11311,1,"ⱟ"],[[11312,11358],2],[11359,2],[11360,1,"ⱡ"],[11361,2],[11362,1,"ɫ"],[11363,1,"ᵽ"],[11364,1,"ɽ"],[[11365,11366],2],[11367,1,"ⱨ"],[11368,2],[11369,1,"ⱪ"],[11370,2],[11371,1,"ⱬ"],[11372,2],[11373,1,"ɑ"],[11374,1,"ɱ"],[11375,1,"ɐ"],[11376,1,"ɒ"],[11377,2],[11378,1,"ⱳ"],[11379,2],[11380,2],[11381,1,"ⱶ"],[[11382,11383],2],[[11384,11387],2],[11388,1,"j"],[11389,1,"v"],[11390,1,"ȿ"],[11391,1,"ɀ"],[11392,1,"ⲁ"],[11393,2],[11394,1,"ⲃ"],[11395,2],[11396,1,"ⲅ"],[11397,2],[11398,1,"ⲇ"],[11399,2],[11400,1,"ⲉ"],[11401,2],[11402,1,"ⲋ"],[11403,2],[11404,1,"ⲍ"],[11405,2],[11406,1,"ⲏ"],[11407,2],[11408,1,"ⲑ"],[11409,2],[11410,1,"ⲓ"],[11411,2],[11412,1,"ⲕ"],[11413,2],[11414,1,"ⲗ"],[11415,2],[11416,1,"ⲙ"],[11417,2],[11418,1,"ⲛ"],[11419,2],[11420,1,"ⲝ"],[11421,2],[11422,1,"ⲟ"],[11423,2],[11424,1,"ⲡ"],[11425,2],[11426,1,"ⲣ"],[11427,2],[11428,1,"ⲥ"],[11429,2],[11430,1,"ⲧ"],[11431,2],[11432,1,"ⲩ"],[11433,2],[11434,1,"ⲫ"],[11435,2],[11436,1,"ⲭ"],[11437,2],[11438,1,"ⲯ"],[11439,2],[11440,1,"ⲱ"],[11441,2],[11442,1,"ⲳ"],[11443,2],[11444,1,"ⲵ"],[11445,2],[11446,1,"ⲷ"],[11447,2],[11448,1,"ⲹ"],[11449,2],[11450,1,"ⲻ"],[11451,2],[11452,1,"ⲽ"],[11453,2],[11454,1,"ⲿ"],[11455,2],[11456,1,"ⳁ"],[11457,2],[11458,1,"ⳃ"],[11459,2],[11460,1,"ⳅ"],[11461,2],[11462,1,"ⳇ"],[11463,2],[11464,1,"ⳉ"],[11465,2],[11466,1,"ⳋ"],[11467,2],[11468,1,"ⳍ"],[11469,2],[11470,1,"ⳏ"],[11471,2],[11472,1,"ⳑ"],[11473,2],[11474,1,"ⳓ"],[11475,2],[11476,1,"ⳕ"],[11477,2],[11478,1,"ⳗ"],[11479,2],[11480,1,"ⳙ"],[11481,2],[11482,1,"ⳛ"],[11483,2],[11484,1,"ⳝ"],[11485,2],[11486,1,"ⳟ"],[11487,2],[11488,1,"ⳡ"],[11489,2],[11490,1,"ⳣ"],[[11491,11492],2],[[11493,11498],2],[11499,1,"ⳬ"],[11500,2],[11501,1,"ⳮ"],[[11502,11505],2],[11506,1,"ⳳ"],[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,"ⵡ"],[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,"母"],[[11936,12018],2],[12019,1,"龟"],[[12020,12031],3],[12032,1,"一"],[12033,1,"丨"],[12034,1,"丶"],[12035,1,"丿"],[12036,1,"乙"],[12037,1,"亅"],[12038,1,"二"],[12039,1,"亠"],[12040,1,"人"],[12041,1,"儿"],[12042,1,"入"],[12043,1,"八"],[12044,1,"冂"],[12045,1,"冖"],[12046,1,"冫"],[12047,1,"几"],[12048,1,"凵"],[12049,1,"刀"],[12050,1,"力"],[12051,1,"勹"],[12052,1,"匕"],[12053,1,"匚"],[12054,1,"匸"],[12055,1,"十"],[12056,1,"卜"],[12057,1,"卩"],[12058,1,"厂"],[12059,1,"厶"],[12060,1,"又"],[12061,1,"口"],[12062,1,"囗"],[12063,1,"土"],[12064,1,"士"],[12065,1,"夂"],[12066,1,"夊"],[12067,1,"夕"],[12068,1,"大"],[12069,1,"女"],[12070,1,"子"],[12071,1,"宀"],[12072,1,"寸"],[12073,1,"小"],[12074,1,"尢"],[12075,1,"尸"],[12076,1,"屮"],[12077,1,"山"],[12078,1,"巛"],[12079,1,"工"],[12080,1,"己"],[12081,1,"巾"],[12082,1,"干"],[12083,1,"幺"],[12084,1,"广"],[12085,1,"廴"],[12086,1,"廾"],[12087,1,"弋"],[12088,1,"弓"],[12089,1,"彐"],[12090,1,"彡"],[12091,1,"彳"],[12092,1,"心"],[12093,1,"戈"],[12094,1,"戶"],[12095,1,"手"],[12096,1,"支"],[12097,1,"攴"],[12098,1,"文"],[12099,1,"斗"],[12100,1,"斤"],[12101,1,"方"],[12102,1,"无"],[12103,1,"日"],[12104,1,"曰"],[12105,1,"月"],[12106,1,"木"],[12107,1,"欠"],[12108,1,"止"],[12109,1,"歹"],[12110,1,"殳"],[12111,1,"毋"],[12112,1,"比"],[12113,1,"毛"],[12114,1,"氏"],[12115,1,"气"],[12116,1,"水"],[12117,1,"火"],[12118,1,"爪"],[12119,1,"父"],[12120,1,"爻"],[12121,1,"爿"],[12122,1,"片"],[12123,1,"牙"],[12124,1,"牛"],[12125,1,"犬"],[12126,1,"玄"],[12127,1,"玉"],[12128,1,"瓜"],[12129,1,"瓦"],[12130,1,"甘"],[12131,1,"生"],[12132,1,"用"],[12133,1,"田"],[12134,1,"疋"],[12135,1,"疒"],[12136,1,"癶"],[12137,1,"白"],[12138,1,"皮"],[12139,1,"皿"],[12140,1,"目"],[12141,1,"矛"],[12142,1,"矢"],[12143,1,"石"],[12144,1,"示"],[12145,1,"禸"],[12146,1,"禾"],[12147,1,"穴"],[12148,1,"立"],[12149,1,"竹"],[12150,1,"米"],[12151,1,"糸"],[12152,1,"缶"],[12153,1,"网"],[12154,1,"羊"],[12155,1,"羽"],[12156,1,"老"],[12157,1,"而"],[12158,1,"耒"],[12159,1,"耳"],[12160,1,"聿"],[12161,1,"肉"],[12162,1,"臣"],[12163,1,"自"],[12164,1,"至"],[12165,1,"臼"],[12166,1,"舌"],[12167,1,"舛"],[12168,1,"舟"],[12169,1,"艮"],[12170,1,"色"],[12171,1,"艸"],[12172,1,"虍"],[12173,1,"虫"],[12174,1,"血"],[12175,1,"行"],[12176,1,"衣"],[12177,1,"襾"],[12178,1,"見"],[12179,1,"角"],[12180,1,"言"],[12181,1,"谷"],[12182,1,"豆"],[12183,1,"豕"],[12184,1,"豸"],[12185,1,"貝"],[12186,1,"赤"],[12187,1,"走"],[12188,1,"足"],[12189,1,"身"],[12190,1,"車"],[12191,1,"辛"],[12192,1,"辰"],[12193,1,"辵"],[12194,1,"邑"],[12195,1,"酉"],[12196,1,"釆"],[12197,1,"里"],[12198,1,"金"],[12199,1,"長"],[12200,1,"門"],[12201,1,"阜"],[12202,1,"隶"],[12203,1,"隹"],[12204,1,"雨"],[12205,1,"靑"],[12206,1,"非"],[12207,1,"面"],[12208,1,"革"],[12209,1,"韋"],[12210,1,"韭"],[12211,1,"音"],[12212,1,"頁"],[12213,1,"風"],[12214,1,"飛"],[12215,1,"食"],[12216,1,"首"],[12217,1,"香"],[12218,1,"馬"],[12219,1,"骨"],[12220,1,"高"],[12221,1,"髟"],[12222,1,"鬥"],[12223,1,"鬯"],[12224,1,"鬲"],[12225,1,"鬼"],[12226,1,"魚"],[12227,1,"鳥"],[12228,1,"鹵"],[12229,1,"鹿"],[12230,1,"麥"],[12231,1,"麻"],[12232,1,"黃"],[12233,1,"黍"],[12234,1,"黑"],[12235,1,"黹"],[12236,1,"黽"],[12237,1,"鼎"],[12238,1,"鼓"],[12239,1,"鼠"],[12240,1,"鼻"],[12241,1,"齊"],[12242,1,"齒"],[12243,1,"龍"],[12244,1,"龜"],[12245,1,"龠"],[[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,"〒"],[12343,2],[12344,1,"十"],[12345,1,"卄"],[12346,1,"卅"],[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," ゙"],[12444,1," ゚"],[[12445,12446],2],[12447,1,"より"],[12448,2],[[12449,12542],2],[12543,1,"コト"],[[12544,12548],3],[[12549,12588],2],[12589,2],[12590,2],[12591,2],[12592,3],[12593,1,"ᄀ"],[12594,1,"ᄁ"],[12595,1,"ᆪ"],[12596,1,"ᄂ"],[12597,1,"ᆬ"],[12598,1,"ᆭ"],[12599,1,"ᄃ"],[12600,1,"ᄄ"],[12601,1,"ᄅ"],[12602,1,"ᆰ"],[12603,1,"ᆱ"],[12604,1,"ᆲ"],[12605,1,"ᆳ"],[12606,1,"ᆴ"],[12607,1,"ᆵ"],[12608,1,"ᄚ"],[12609,1,"ᄆ"],[12610,1,"ᄇ"],[12611,1,"ᄈ"],[12612,1,"ᄡ"],[12613,1,"ᄉ"],[12614,1,"ᄊ"],[12615,1,"ᄋ"],[12616,1,"ᄌ"],[12617,1,"ᄍ"],[12618,1,"ᄎ"],[12619,1,"ᄏ"],[12620,1,"ᄐ"],[12621,1,"ᄑ"],[12622,1,"ᄒ"],[12623,1,"ᅡ"],[12624,1,"ᅢ"],[12625,1,"ᅣ"],[12626,1,"ᅤ"],[12627,1,"ᅥ"],[12628,1,"ᅦ"],[12629,1,"ᅧ"],[12630,1,"ᅨ"],[12631,1,"ᅩ"],[12632,1,"ᅪ"],[12633,1,"ᅫ"],[12634,1,"ᅬ"],[12635,1,"ᅭ"],[12636,1,"ᅮ"],[12637,1,"ᅯ"],[12638,1,"ᅰ"],[12639,1,"ᅱ"],[12640,1,"ᅲ"],[12641,1,"ᅳ"],[12642,1,"ᅴ"],[12643,1,"ᅵ"],[12644,7],[12645,1,"ᄔ"],[12646,1,"ᄕ"],[12647,1,"ᇇ"],[12648,1,"ᇈ"],[12649,1,"ᇌ"],[12650,1,"ᇎ"],[12651,1,"ᇓ"],[12652,1,"ᇗ"],[12653,1,"ᇙ"],[12654,1,"ᄜ"],[12655,1,"ᇝ"],[12656,1,"ᇟ"],[12657,1,"ᄝ"],[12658,1,"ᄞ"],[12659,1,"ᄠ"],[12660,1,"ᄢ"],[12661,1,"ᄣ"],[12662,1,"ᄧ"],[12663,1,"ᄩ"],[12664,1,"ᄫ"],[12665,1,"ᄬ"],[12666,1,"ᄭ"],[12667,1,"ᄮ"],[12668,1,"ᄯ"],[12669,1,"ᄲ"],[12670,1,"ᄶ"],[12671,1,"ᅀ"],[12672,1,"ᅇ"],[12673,1,"ᅌ"],[12674,1,"ᇱ"],[12675,1,"ᇲ"],[12676,1,"ᅗ"],[12677,1,"ᅘ"],[12678,1,"ᅙ"],[12679,1,"ᆄ"],[12680,1,"ᆅ"],[12681,1,"ᆈ"],[12682,1,"ᆑ"],[12683,1,"ᆒ"],[12684,1,"ᆔ"],[12685,1,"ᆞ"],[12686,1,"ᆡ"],[12687,3],[[12688,12689],2],[12690,1,"一"],[12691,1,"二"],[12692,1,"三"],[12693,1,"四"],[12694,1,"上"],[12695,1,"中"],[12696,1,"下"],[12697,1,"甲"],[12698,1,"乙"],[12699,1,"丙"],[12700,1,"丁"],[12701,1,"天"],[12702,1,"地"],[12703,1,"人"],[[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,"(ᄀ)"],[12801,1,"(ᄂ)"],[12802,1,"(ᄃ)"],[12803,1,"(ᄅ)"],[12804,1,"(ᄆ)"],[12805,1,"(ᄇ)"],[12806,1,"(ᄉ)"],[12807,1,"(ᄋ)"],[12808,1,"(ᄌ)"],[12809,1,"(ᄎ)"],[12810,1,"(ᄏ)"],[12811,1,"(ᄐ)"],[12812,1,"(ᄑ)"],[12813,1,"(ᄒ)"],[12814,1,"(가)"],[12815,1,"(나)"],[12816,1,"(다)"],[12817,1,"(라)"],[12818,1,"(마)"],[12819,1,"(바)"],[12820,1,"(사)"],[12821,1,"(아)"],[12822,1,"(자)"],[12823,1,"(차)"],[12824,1,"(카)"],[12825,1,"(타)"],[12826,1,"(파)"],[12827,1,"(하)"],[12828,1,"(주)"],[12829,1,"(오전)"],[12830,1,"(오후)"],[12831,3],[12832,1,"(一)"],[12833,1,"(二)"],[12834,1,"(三)"],[12835,1,"(四)"],[12836,1,"(五)"],[12837,1,"(六)"],[12838,1,"(七)"],[12839,1,"(八)"],[12840,1,"(九)"],[12841,1,"(十)"],[12842,1,"(月)"],[12843,1,"(火)"],[12844,1,"(水)"],[12845,1,"(木)"],[12846,1,"(金)"],[12847,1,"(土)"],[12848,1,"(日)"],[12849,1,"(株)"],[12850,1,"(有)"],[12851,1,"(社)"],[12852,1,"(名)"],[12853,1,"(特)"],[12854,1,"(財)"],[12855,1,"(祝)"],[12856,1,"(労)"],[12857,1,"(代)"],[12858,1,"(呼)"],[12859,1,"(学)"],[12860,1,"(監)"],[12861,1,"(企)"],[12862,1,"(資)"],[12863,1,"(協)"],[12864,1,"(祭)"],[12865,1,"(休)"],[12866,1,"(自)"],[12867,1,"(至)"],[12868,1,"問"],[12869,1,"幼"],[12870,1,"文"],[12871,1,"箏"],[[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,"ᄀ"],[12897,1,"ᄂ"],[12898,1,"ᄃ"],[12899,1,"ᄅ"],[12900,1,"ᄆ"],[12901,1,"ᄇ"],[12902,1,"ᄉ"],[12903,1,"ᄋ"],[12904,1,"ᄌ"],[12905,1,"ᄎ"],[12906,1,"ᄏ"],[12907,1,"ᄐ"],[12908,1,"ᄑ"],[12909,1,"ᄒ"],[12910,1,"가"],[12911,1,"나"],[12912,1,"다"],[12913,1,"라"],[12914,1,"마"],[12915,1,"바"],[12916,1,"사"],[12917,1,"아"],[12918,1,"자"],[12919,1,"차"],[12920,1,"카"],[12921,1,"타"],[12922,1,"파"],[12923,1,"하"],[12924,1,"참고"],[12925,1,"주의"],[12926,1,"우"],[12927,2],[12928,1,"一"],[12929,1,"二"],[12930,1,"三"],[12931,1,"四"],[12932,1,"五"],[12933,1,"六"],[12934,1,"七"],[12935,1,"八"],[12936,1,"九"],[12937,1,"十"],[12938,1,"月"],[12939,1,"火"],[12940,1,"水"],[12941,1,"木"],[12942,1,"金"],[12943,1,"土"],[12944,1,"日"],[12945,1,"株"],[12946,1,"有"],[12947,1,"社"],[12948,1,"名"],[12949,1,"特"],[12950,1,"財"],[12951,1,"祝"],[12952,1,"労"],[12953,1,"秘"],[12954,1,"男"],[12955,1,"女"],[12956,1,"適"],[12957,1,"優"],[12958,1,"印"],[12959,1,"注"],[12960,1,"項"],[12961,1,"休"],[12962,1,"写"],[12963,1,"正"],[12964,1,"上"],[12965,1,"中"],[12966,1,"下"],[12967,1,"左"],[12968,1,"右"],[12969,1,"医"],[12970,1,"宗"],[12971,1,"学"],[12972,1,"監"],[12973,1,"企"],[12974,1,"資"],[12975,1,"協"],[12976,1,"夜"],[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月"],[12993,1,"2月"],[12994,1,"3月"],[12995,1,"4月"],[12996,1,"5月"],[12997,1,"6月"],[12998,1,"7月"],[12999,1,"8月"],[13e3,1,"9月"],[13001,1,"10月"],[13002,1,"11月"],[13003,1,"12月"],[13004,1,"hg"],[13005,1,"erg"],[13006,1,"ev"],[13007,1,"ltd"],[13008,1,"ア"],[13009,1,"イ"],[13010,1,"ウ"],[13011,1,"エ"],[13012,1,"オ"],[13013,1,"カ"],[13014,1,"キ"],[13015,1,"ク"],[13016,1,"ケ"],[13017,1,"コ"],[13018,1,"サ"],[13019,1,"シ"],[13020,1,"ス"],[13021,1,"セ"],[13022,1,"ソ"],[13023,1,"タ"],[13024,1,"チ"],[13025,1,"ツ"],[13026,1,"テ"],[13027,1,"ト"],[13028,1,"ナ"],[13029,1,"ニ"],[13030,1,"ヌ"],[13031,1,"ネ"],[13032,1,"ノ"],[13033,1,"ハ"],[13034,1,"ヒ"],[13035,1,"フ"],[13036,1,"ヘ"],[13037,1,"ホ"],[13038,1,"マ"],[13039,1,"ミ"],[13040,1,"ム"],[13041,1,"メ"],[13042,1,"モ"],[13043,1,"ヤ"],[13044,1,"ユ"],[13045,1,"ヨ"],[13046,1,"ラ"],[13047,1,"リ"],[13048,1,"ル"],[13049,1,"レ"],[13050,1,"ロ"],[13051,1,"ワ"],[13052,1,"ヰ"],[13053,1,"ヱ"],[13054,1,"ヲ"],[13055,1,"令和"],[13056,1,"アパート"],[13057,1,"アルファ"],[13058,1,"アンペア"],[13059,1,"アール"],[13060,1,"イニング"],[13061,1,"インチ"],[13062,1,"ウォン"],[13063,1,"エスクード"],[13064,1,"エーカー"],[13065,1,"オンス"],[13066,1,"オーム"],[13067,1,"カイリ"],[13068,1,"カラット"],[13069,1,"カロリー"],[13070,1,"ガロン"],[13071,1,"ガンマ"],[13072,1,"ギガ"],[13073,1,"ギニー"],[13074,1,"キュリー"],[13075,1,"ギルダー"],[13076,1,"キロ"],[13077,1,"キログラム"],[13078,1,"キロメートル"],[13079,1,"キロワット"],[13080,1,"グラム"],[13081,1,"グラムトン"],[13082,1,"クルゼイロ"],[13083,1,"クローネ"],[13084,1,"ケース"],[13085,1,"コルナ"],[13086,1,"コーポ"],[13087,1,"サイクル"],[13088,1,"サンチーム"],[13089,1,"シリング"],[13090,1,"センチ"],[13091,1,"セント"],[13092,1,"ダース"],[13093,1,"デシ"],[13094,1,"ドル"],[13095,1,"トン"],[13096,1,"ナノ"],[13097,1,"ノット"],[13098,1,"ハイツ"],[13099,1,"パーセント"],[13100,1,"パーツ"],[13101,1,"バーレル"],[13102,1,"ピアストル"],[13103,1,"ピクル"],[13104,1,"ピコ"],[13105,1,"ビル"],[13106,1,"ファラッド"],[13107,1,"フィート"],[13108,1,"ブッシェル"],[13109,1,"フラン"],[13110,1,"ヘクタール"],[13111,1,"ペソ"],[13112,1,"ペニヒ"],[13113,1,"ヘルツ"],[13114,1,"ペンス"],[13115,1,"ページ"],[13116,1,"ベータ"],[13117,1,"ポイント"],[13118,1,"ボルト"],[13119,1,"ホン"],[13120,1,"ポンド"],[13121,1,"ホール"],[13122,1,"ホーン"],[13123,1,"マイクロ"],[13124,1,"マイル"],[13125,1,"マッハ"],[13126,1,"マルク"],[13127,1,"マンション"],[13128,1,"ミクロン"],[13129,1,"ミリ"],[13130,1,"ミリバール"],[13131,1,"メガ"],[13132,1,"メガトン"],[13133,1,"メートル"],[13134,1,"ヤード"],[13135,1,"ヤール"],[13136,1,"ユアン"],[13137,1,"リットル"],[13138,1,"リラ"],[13139,1,"ルピー"],[13140,1,"ルーブル"],[13141,1,"レム"],[13142,1,"レントゲン"],[13143,1,"ワット"],[13144,1,"0点"],[13145,1,"1点"],[13146,1,"2点"],[13147,1,"3点"],[13148,1,"4点"],[13149,1,"5点"],[13150,1,"6点"],[13151,1,"7点"],[13152,1,"8点"],[13153,1,"9点"],[13154,1,"10点"],[13155,1,"11点"],[13156,1,"12点"],[13157,1,"13点"],[13158,1,"14点"],[13159,1,"15点"],[13160,1,"16点"],[13161,1,"17点"],[13162,1,"18点"],[13163,1,"19点"],[13164,1,"20点"],[13165,1,"21点"],[13166,1,"22点"],[13167,1,"23点"],[13168,1,"24点"],[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,"平成"],[13180,1,"昭和"],[13181,1,"大正"],[13182,1,"明治"],[13183,1,"株式会社"],[13184,1,"pa"],[13185,1,"na"],[13186,1,"μa"],[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,"μf"],[13197,1,"μg"],[13198,1,"mg"],[13199,1,"kg"],[13200,1,"hz"],[13201,1,"khz"],[13202,1,"mhz"],[13203,1,"ghz"],[13204,1,"thz"],[13205,1,"μl"],[13206,1,"ml"],[13207,1,"dl"],[13208,1,"kl"],[13209,1,"fm"],[13210,1,"nm"],[13211,1,"μm"],[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∕s"],[13224,1,"m∕s2"],[13225,1,"pa"],[13226,1,"kpa"],[13227,1,"mpa"],[13228,1,"gpa"],[13229,1,"rad"],[13230,1,"rad∕s"],[13231,1,"rad∕s2"],[13232,1,"ps"],[13233,1,"ns"],[13234,1,"μs"],[13235,1,"ms"],[13236,1,"pv"],[13237,1,"nv"],[13238,1,"μv"],[13239,1,"mv"],[13240,1,"kv"],[13241,1,"mv"],[13242,1,"pw"],[13243,1,"nw"],[13244,1,"μw"],[13245,1,"mw"],[13246,1,"kw"],[13247,1,"mw"],[13248,1,"kω"],[13249,1,"mω"],[13250,3],[13251,1,"bq"],[13252,1,"cc"],[13253,1,"cd"],[13254,1,"c∕kg"],[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∕m"],[13279,1,"a∕m"],[13280,1,"1日"],[13281,1,"2日"],[13282,1,"3日"],[13283,1,"4日"],[13284,1,"5日"],[13285,1,"6日"],[13286,1,"7日"],[13287,1,"8日"],[13288,1,"9日"],[13289,1,"10日"],[13290,1,"11日"],[13291,1,"12日"],[13292,1,"13日"],[13293,1,"14日"],[13294,1,"15日"],[13295,1,"16日"],[13296,1,"17日"],[13297,1,"18日"],[13298,1,"19日"],[13299,1,"20日"],[13300,1,"21日"],[13301,1,"22日"],[13302,1,"23日"],[13303,1,"24日"],[13304,1,"25日"],[13305,1,"26日"],[13306,1,"27日"],[13307,1,"28日"],[13308,1,"29日"],[13309,1,"30日"],[13310,1,"31日"],[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,"ꙁ"],[42561,2],[42562,1,"ꙃ"],[42563,2],[42564,1,"ꙅ"],[42565,2],[42566,1,"ꙇ"],[42567,2],[42568,1,"ꙉ"],[42569,2],[42570,1,"ꙋ"],[42571,2],[42572,1,"ꙍ"],[42573,2],[42574,1,"ꙏ"],[42575,2],[42576,1,"ꙑ"],[42577,2],[42578,1,"ꙓ"],[42579,2],[42580,1,"ꙕ"],[42581,2],[42582,1,"ꙗ"],[42583,2],[42584,1,"ꙙ"],[42585,2],[42586,1,"ꙛ"],[42587,2],[42588,1,"ꙝ"],[42589,2],[42590,1,"ꙟ"],[42591,2],[42592,1,"ꙡ"],[42593,2],[42594,1,"ꙣ"],[42595,2],[42596,1,"ꙥ"],[42597,2],[42598,1,"ꙧ"],[42599,2],[42600,1,"ꙩ"],[42601,2],[42602,1,"ꙫ"],[42603,2],[42604,1,"ꙭ"],[[42605,42607],2],[[42608,42611],2],[[42612,42619],2],[[42620,42621],2],[42622,2],[42623,2],[42624,1,"ꚁ"],[42625,2],[42626,1,"ꚃ"],[42627,2],[42628,1,"ꚅ"],[42629,2],[42630,1,"ꚇ"],[42631,2],[42632,1,"ꚉ"],[42633,2],[42634,1,"ꚋ"],[42635,2],[42636,1,"ꚍ"],[42637,2],[42638,1,"ꚏ"],[42639,2],[42640,1,"ꚑ"],[42641,2],[42642,1,"ꚓ"],[42643,2],[42644,1,"ꚕ"],[42645,2],[42646,1,"ꚗ"],[42647,2],[42648,1,"ꚙ"],[42649,2],[42650,1,"ꚛ"],[42651,2],[42652,1,"ъ"],[42653,1,"ь"],[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,"ꜣ"],[42787,2],[42788,1,"ꜥ"],[42789,2],[42790,1,"ꜧ"],[42791,2],[42792,1,"ꜩ"],[42793,2],[42794,1,"ꜫ"],[42795,2],[42796,1,"ꜭ"],[42797,2],[42798,1,"ꜯ"],[[42799,42801],2],[42802,1,"ꜳ"],[42803,2],[42804,1,"ꜵ"],[42805,2],[42806,1,"ꜷ"],[42807,2],[42808,1,"ꜹ"],[42809,2],[42810,1,"ꜻ"],[42811,2],[42812,1,"ꜽ"],[42813,2],[42814,1,"ꜿ"],[42815,2],[42816,1,"ꝁ"],[42817,2],[42818,1,"ꝃ"],[42819,2],[42820,1,"ꝅ"],[42821,2],[42822,1,"ꝇ"],[42823,2],[42824,1,"ꝉ"],[42825,2],[42826,1,"ꝋ"],[42827,2],[42828,1,"ꝍ"],[42829,2],[42830,1,"ꝏ"],[42831,2],[42832,1,"ꝑ"],[42833,2],[42834,1,"ꝓ"],[42835,2],[42836,1,"ꝕ"],[42837,2],[42838,1,"ꝗ"],[42839,2],[42840,1,"ꝙ"],[42841,2],[42842,1,"ꝛ"],[42843,2],[42844,1,"ꝝ"],[42845,2],[42846,1,"ꝟ"],[42847,2],[42848,1,"ꝡ"],[42849,2],[42850,1,"ꝣ"],[42851,2],[42852,1,"ꝥ"],[42853,2],[42854,1,"ꝧ"],[42855,2],[42856,1,"ꝩ"],[42857,2],[42858,1,"ꝫ"],[42859,2],[42860,1,"ꝭ"],[42861,2],[42862,1,"ꝯ"],[42863,2],[42864,1,"ꝯ"],[[42865,42872],2],[42873,1,"ꝺ"],[42874,2],[42875,1,"ꝼ"],[42876,2],[42877,1,"ᵹ"],[42878,1,"ꝿ"],[42879,2],[42880,1,"ꞁ"],[42881,2],[42882,1,"ꞃ"],[42883,2],[42884,1,"ꞅ"],[42885,2],[42886,1,"ꞇ"],[[42887,42888],2],[[42889,42890],2],[42891,1,"ꞌ"],[42892,2],[42893,1,"ɥ"],[42894,2],[42895,2],[42896,1,"ꞑ"],[42897,2],[42898,1,"ꞓ"],[42899,2],[[42900,42901],2],[42902,1,"ꞗ"],[42903,2],[42904,1,"ꞙ"],[42905,2],[42906,1,"ꞛ"],[42907,2],[42908,1,"ꞝ"],[42909,2],[42910,1,"ꞟ"],[42911,2],[42912,1,"ꞡ"],[42913,2],[42914,1,"ꞣ"],[42915,2],[42916,1,"ꞥ"],[42917,2],[42918,1,"ꞧ"],[42919,2],[42920,1,"ꞩ"],[42921,2],[42922,1,"ɦ"],[42923,1,"ɜ"],[42924,1,"ɡ"],[42925,1,"ɬ"],[42926,1,"ɪ"],[42927,2],[42928,1,"ʞ"],[42929,1,"ʇ"],[42930,1,"ʝ"],[42931,1,"ꭓ"],[42932,1,"ꞵ"],[42933,2],[42934,1,"ꞷ"],[42935,2],[42936,1,"ꞹ"],[42937,2],[42938,1,"ꞻ"],[42939,2],[42940,1,"ꞽ"],[42941,2],[42942,1,"ꞿ"],[42943,2],[42944,1,"ꟁ"],[42945,2],[42946,1,"ꟃ"],[42947,2],[42948,1,"ꞔ"],[42949,1,"ʂ"],[42950,1,"ᶎ"],[42951,1,"ꟈ"],[42952,2],[42953,1,"ꟊ"],[42954,2],[42955,1,"ɤ"],[42956,1,"ꟍ"],[42957,2],[[42958,42959],3],[42960,1,"ꟑ"],[42961,2],[42962,3],[42963,2],[42964,3],[42965,2],[42966,1,"ꟗ"],[42967,2],[42968,1,"ꟙ"],[42969,2],[42970,1,"ꟛ"],[42971,2],[42972,1,"ƛ"],[[42973,42993],3],[42994,1,"c"],[42995,1,"f"],[42996,1,"q"],[42997,1,"ꟶ"],[42998,2],[42999,2],[43e3,1,"ħ"],[43001,1,"œ"],[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,"ꜧ"],[43869,1,"ꬷ"],[43870,1,"ɫ"],[43871,1,"ꭒ"],[[43872,43875],2],[[43876,43877],2],[[43878,43879],2],[43880,2],[43881,1,"ʍ"],[[43882,43883],2],[[43884,43887],3],[43888,1,"Ꭰ"],[43889,1,"Ꭱ"],[43890,1,"Ꭲ"],[43891,1,"Ꭳ"],[43892,1,"Ꭴ"],[43893,1,"Ꭵ"],[43894,1,"Ꭶ"],[43895,1,"Ꭷ"],[43896,1,"Ꭸ"],[43897,1,"Ꭹ"],[43898,1,"Ꭺ"],[43899,1,"Ꭻ"],[43900,1,"Ꭼ"],[43901,1,"Ꭽ"],[43902,1,"Ꭾ"],[43903,1,"Ꭿ"],[43904,1,"Ꮀ"],[43905,1,"Ꮁ"],[43906,1,"Ꮂ"],[43907,1,"Ꮃ"],[43908,1,"Ꮄ"],[43909,1,"Ꮅ"],[43910,1,"Ꮆ"],[43911,1,"Ꮇ"],[43912,1,"Ꮈ"],[43913,1,"Ꮉ"],[43914,1,"Ꮊ"],[43915,1,"Ꮋ"],[43916,1,"Ꮌ"],[43917,1,"Ꮍ"],[43918,1,"Ꮎ"],[43919,1,"Ꮏ"],[43920,1,"Ꮐ"],[43921,1,"Ꮑ"],[43922,1,"Ꮒ"],[43923,1,"Ꮓ"],[43924,1,"Ꮔ"],[43925,1,"Ꮕ"],[43926,1,"Ꮖ"],[43927,1,"Ꮗ"],[43928,1,"Ꮘ"],[43929,1,"Ꮙ"],[43930,1,"Ꮚ"],[43931,1,"Ꮛ"],[43932,1,"Ꮜ"],[43933,1,"Ꮝ"],[43934,1,"Ꮞ"],[43935,1,"Ꮟ"],[43936,1,"Ꮠ"],[43937,1,"Ꮡ"],[43938,1,"Ꮢ"],[43939,1,"Ꮣ"],[43940,1,"Ꮤ"],[43941,1,"Ꮥ"],[43942,1,"Ꮦ"],[43943,1,"Ꮧ"],[43944,1,"Ꮨ"],[43945,1,"Ꮩ"],[43946,1,"Ꮪ"],[43947,1,"Ꮫ"],[43948,1,"Ꮬ"],[43949,1,"Ꮭ"],[43950,1,"Ꮮ"],[43951,1,"Ꮯ"],[43952,1,"Ꮰ"],[43953,1,"Ꮱ"],[43954,1,"Ꮲ"],[43955,1,"Ꮳ"],[43956,1,"Ꮴ"],[43957,1,"Ꮵ"],[43958,1,"Ꮶ"],[43959,1,"Ꮷ"],[43960,1,"Ꮸ"],[43961,1,"Ꮹ"],[43962,1,"Ꮺ"],[43963,1,"Ꮻ"],[43964,1,"Ꮼ"],[43965,1,"Ꮽ"],[43966,1,"Ꮾ"],[43967,1,"Ꮿ"],[[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,"豈"],[63745,1,"更"],[63746,1,"車"],[63747,1,"賈"],[63748,1,"滑"],[63749,1,"串"],[63750,1,"句"],[[63751,63752],1,"龜"],[63753,1,"契"],[63754,1,"金"],[63755,1,"喇"],[63756,1,"奈"],[63757,1,"懶"],[63758,1,"癩"],[63759,1,"羅"],[63760,1,"蘿"],[63761,1,"螺"],[63762,1,"裸"],[63763,1,"邏"],[63764,1,"樂"],[63765,1,"洛"],[63766,1,"烙"],[63767,1,"珞"],[63768,1,"落"],[63769,1,"酪"],[63770,1,"駱"],[63771,1,"亂"],[63772,1,"卵"],[63773,1,"欄"],[63774,1,"爛"],[63775,1,"蘭"],[63776,1,"鸞"],[63777,1,"嵐"],[63778,1,"濫"],[63779,1,"藍"],[63780,1,"襤"],[63781,1,"拉"],[63782,1,"臘"],[63783,1,"蠟"],[63784,1,"廊"],[63785,1,"朗"],[63786,1,"浪"],[63787,1,"狼"],[63788,1,"郎"],[63789,1,"來"],[63790,1,"冷"],[63791,1,"勞"],[63792,1,"擄"],[63793,1,"櫓"],[63794,1,"爐"],[63795,1,"盧"],[63796,1,"老"],[63797,1,"蘆"],[63798,1,"虜"],[63799,1,"路"],[63800,1,"露"],[63801,1,"魯"],[63802,1,"鷺"],[63803,1,"碌"],[63804,1,"祿"],[63805,1,"綠"],[63806,1,"菉"],[63807,1,"錄"],[63808,1,"鹿"],[63809,1,"論"],[63810,1,"壟"],[63811,1,"弄"],[63812,1,"籠"],[63813,1,"聾"],[63814,1,"牢"],[63815,1,"磊"],[63816,1,"賂"],[63817,1,"雷"],[63818,1,"壘"],[63819,1,"屢"],[63820,1,"樓"],[63821,1,"淚"],[63822,1,"漏"],[63823,1,"累"],[63824,1,"縷"],[63825,1,"陋"],[63826,1,"勒"],[63827,1,"肋"],[63828,1,"凜"],[63829,1,"凌"],[63830,1,"稜"],[63831,1,"綾"],[63832,1,"菱"],[63833,1,"陵"],[63834,1,"讀"],[63835,1,"拏"],[63836,1,"樂"],[63837,1,"諾"],[63838,1,"丹"],[63839,1,"寧"],[63840,1,"怒"],[63841,1,"率"],[63842,1,"異"],[63843,1,"北"],[63844,1,"磻"],[63845,1,"便"],[63846,1,"復"],[63847,1,"不"],[63848,1,"泌"],[63849,1,"數"],[63850,1,"索"],[63851,1,"參"],[63852,1,"塞"],[63853,1,"省"],[63854,1,"葉"],[63855,1,"說"],[63856,1,"殺"],[63857,1,"辰"],[63858,1,"沈"],[63859,1,"拾"],[63860,1,"若"],[63861,1,"掠"],[63862,1,"略"],[63863,1,"亮"],[63864,1,"兩"],[63865,1,"凉"],[63866,1,"梁"],[63867,1,"糧"],[63868,1,"良"],[63869,1,"諒"],[63870,1,"量"],[63871,1,"勵"],[63872,1,"呂"],[63873,1,"女"],[63874,1,"廬"],[63875,1,"旅"],[63876,1,"濾"],[63877,1,"礪"],[63878,1,"閭"],[63879,1,"驪"],[63880,1,"麗"],[63881,1,"黎"],[63882,1,"力"],[63883,1,"曆"],[63884,1,"歷"],[63885,1,"轢"],[63886,1,"年"],[63887,1,"憐"],[63888,1,"戀"],[63889,1,"撚"],[63890,1,"漣"],[63891,1,"煉"],[63892,1,"璉"],[63893,1,"秊"],[63894,1,"練"],[63895,1,"聯"],[63896,1,"輦"],[63897,1,"蓮"],[63898,1,"連"],[63899,1,"鍊"],[63900,1,"列"],[63901,1,"劣"],[63902,1,"咽"],[63903,1,"烈"],[63904,1,"裂"],[63905,1,"說"],[63906,1,"廉"],[63907,1,"念"],[63908,1,"捻"],[63909,1,"殮"],[63910,1,"簾"],[63911,1,"獵"],[63912,1,"令"],[63913,1,"囹"],[63914,1,"寧"],[63915,1,"嶺"],[63916,1,"怜"],[63917,1,"玲"],[63918,1,"瑩"],[63919,1,"羚"],[63920,1,"聆"],[63921,1,"鈴"],[63922,1,"零"],[63923,1,"靈"],[63924,1,"領"],[63925,1,"例"],[63926,1,"禮"],[63927,1,"醴"],[63928,1,"隸"],[63929,1,"惡"],[63930,1,"了"],[63931,1,"僚"],[63932,1,"寮"],[63933,1,"尿"],[63934,1,"料"],[63935,1,"樂"],[63936,1,"燎"],[63937,1,"療"],[63938,1,"蓼"],[63939,1,"遼"],[63940,1,"龍"],[63941,1,"暈"],[63942,1,"阮"],[63943,1,"劉"],[63944,1,"杻"],[63945,1,"柳"],[63946,1,"流"],[63947,1,"溜"],[63948,1,"琉"],[63949,1,"留"],[63950,1,"硫"],[63951,1,"紐"],[63952,1,"類"],[63953,1,"六"],[63954,1,"戮"],[63955,1,"陸"],[63956,1,"倫"],[63957,1,"崙"],[63958,1,"淪"],[63959,1,"輪"],[63960,1,"律"],[63961,1,"慄"],[63962,1,"栗"],[63963,1,"率"],[63964,1,"隆"],[63965,1,"利"],[63966,1,"吏"],[63967,1,"履"],[63968,1,"易"],[63969,1,"李"],[63970,1,"梨"],[63971,1,"泥"],[63972,1,"理"],[63973,1,"痢"],[63974,1,"罹"],[63975,1,"裏"],[63976,1,"裡"],[63977,1,"里"],[63978,1,"離"],[63979,1,"匿"],[63980,1,"溺"],[63981,1,"吝"],[63982,1,"燐"],[63983,1,"璘"],[63984,1,"藺"],[63985,1,"隣"],[63986,1,"鱗"],[63987,1,"麟"],[63988,1,"林"],[63989,1,"淋"],[63990,1,"臨"],[63991,1,"立"],[63992,1,"笠"],[63993,1,"粒"],[63994,1,"狀"],[63995,1,"炙"],[63996,1,"識"],[63997,1,"什"],[63998,1,"茶"],[63999,1,"刺"],[64e3,1,"切"],[64001,1,"度"],[64002,1,"拓"],[64003,1,"糖"],[64004,1,"宅"],[64005,1,"洞"],[64006,1,"暴"],[64007,1,"輻"],[64008,1,"行"],[64009,1,"降"],[64010,1,"見"],[64011,1,"廓"],[64012,1,"兀"],[64013,1,"嗀"],[[64014,64015],2],[64016,1,"塚"],[64017,2],[64018,1,"晴"],[[64019,64020],2],[64021,1,"凞"],[64022,1,"猪"],[64023,1,"益"],[64024,1,"礼"],[64025,1,"神"],[64026,1,"祥"],[64027,1,"福"],[64028,1,"靖"],[64029,1,"精"],[64030,1,"羽"],[64031,2],[64032,1,"蘒"],[64033,2],[64034,1,"諸"],[[64035,64036],2],[64037,1,"逸"],[64038,1,"都"],[[64039,64041],2],[64042,1,"飯"],[64043,1,"飼"],[64044,1,"館"],[64045,1,"鶴"],[64046,1,"郞"],[64047,1,"隷"],[64048,1,"侮"],[64049,1,"僧"],[64050,1,"免"],[64051,1,"勉"],[64052,1,"勤"],[64053,1,"卑"],[64054,1,"喝"],[64055,1,"嘆"],[64056,1,"器"],[64057,1,"塀"],[64058,1,"墨"],[64059,1,"層"],[64060,1,"屮"],[64061,1,"悔"],[64062,1,"慨"],[64063,1,"憎"],[64064,1,"懲"],[64065,1,"敏"],[64066,1,"既"],[64067,1,"暑"],[64068,1,"梅"],[64069,1,"海"],[64070,1,"渚"],[64071,1,"漢"],[64072,1,"煮"],[64073,1,"爫"],[64074,1,"琢"],[64075,1,"碑"],[64076,1,"社"],[64077,1,"祉"],[64078,1,"祈"],[64079,1,"祐"],[64080,1,"祖"],[64081,1,"祝"],[64082,1,"禍"],[64083,1,"禎"],[64084,1,"穀"],[64085,1,"突"],[64086,1,"節"],[64087,1,"練"],[64088,1,"縉"],[64089,1,"繁"],[64090,1,"署"],[64091,1,"者"],[64092,1,"臭"],[[64093,64094],1,"艹"],[64095,1,"著"],[64096,1,"褐"],[64097,1,"視"],[64098,1,"謁"],[64099,1,"謹"],[64100,1,"賓"],[64101,1,"贈"],[64102,1,"辶"],[64103,1,"逸"],[64104,1,"難"],[64105,1,"響"],[64106,1,"頻"],[64107,1,"恵"],[64108,1,"𤋮"],[64109,1,"舘"],[[64110,64111],3],[64112,1,"並"],[64113,1,"况"],[64114,1,"全"],[64115,1,"侀"],[64116,1,"充"],[64117,1,"冀"],[64118,1,"勇"],[64119,1,"勺"],[64120,1,"喝"],[64121,1,"啕"],[64122,1,"喙"],[64123,1,"嗢"],[64124,1,"塚"],[64125,1,"墳"],[64126,1,"奄"],[64127,1,"奔"],[64128,1,"婢"],[64129,1,"嬨"],[64130,1,"廒"],[64131,1,"廙"],[64132,1,"彩"],[64133,1,"徭"],[64134,1,"惘"],[64135,1,"慎"],[64136,1,"愈"],[64137,1,"憎"],[64138,1,"慠"],[64139,1,"懲"],[64140,1,"戴"],[64141,1,"揄"],[64142,1,"搜"],[64143,1,"摒"],[64144,1,"敖"],[64145,1,"晴"],[64146,1,"朗"],[64147,1,"望"],[64148,1,"杖"],[64149,1,"歹"],[64150,1,"殺"],[64151,1,"流"],[64152,1,"滛"],[64153,1,"滋"],[64154,1,"漢"],[64155,1,"瀞"],[64156,1,"煮"],[64157,1,"瞧"],[64158,1,"爵"],[64159,1,"犯"],[64160,1,"猪"],[64161,1,"瑱"],[64162,1,"甆"],[64163,1,"画"],[64164,1,"瘝"],[64165,1,"瘟"],[64166,1,"益"],[64167,1,"盛"],[64168,1,"直"],[64169,1,"睊"],[64170,1,"着"],[64171,1,"磌"],[64172,1,"窱"],[64173,1,"節"],[64174,1,"类"],[64175,1,"絛"],[64176,1,"練"],[64177,1,"缾"],[64178,1,"者"],[64179,1,"荒"],[64180,1,"華"],[64181,1,"蝹"],[64182,1,"襁"],[64183,1,"覆"],[64184,1,"視"],[64185,1,"調"],[64186,1,"諸"],[64187,1,"請"],[64188,1,"謁"],[64189,1,"諾"],[64190,1,"諭"],[64191,1,"謹"],[64192,1,"變"],[64193,1,"贈"],[64194,1,"輸"],[64195,1,"遲"],[64196,1,"醙"],[64197,1,"鉶"],[64198,1,"陼"],[64199,1,"難"],[64200,1,"靖"],[64201,1,"韛"],[64202,1,"響"],[64203,1,"頋"],[64204,1,"頻"],[64205,1,"鬒"],[64206,1,"龜"],[64207,1,"𢡊"],[64208,1,"𢡄"],[64209,1,"𣏕"],[64210,1,"㮝"],[64211,1,"䀘"],[64212,1,"䀹"],[64213,1,"𥉉"],[64214,1,"𥳐"],[64215,1,"𧻓"],[64216,1,"齃"],[64217,1,"龎"],[[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,"մն"],[64276,1,"մե"],[64277,1,"մի"],[64278,1,"վն"],[64279,1,"մխ"],[[64280,64284],3],[64285,1,"יִ"],[64286,2],[64287,1,"ײַ"],[64288,1,"ע"],[64289,1,"א"],[64290,1,"ד"],[64291,1,"ה"],[64292,1,"כ"],[64293,1,"ל"],[64294,1,"ם"],[64295,1,"ר"],[64296,1,"ת"],[64297,1,"+"],[64298,1,"שׁ"],[64299,1,"שׂ"],[64300,1,"שּׁ"],[64301,1,"שּׂ"],[64302,1,"אַ"],[64303,1,"אָ"],[64304,1,"אּ"],[64305,1,"בּ"],[64306,1,"גּ"],[64307,1,"דּ"],[64308,1,"הּ"],[64309,1,"וּ"],[64310,1,"זּ"],[64311,3],[64312,1,"טּ"],[64313,1,"יּ"],[64314,1,"ךּ"],[64315,1,"כּ"],[64316,1,"לּ"],[64317,3],[64318,1,"מּ"],[64319,3],[64320,1,"נּ"],[64321,1,"סּ"],[64322,3],[64323,1,"ףּ"],[64324,1,"פּ"],[64325,3],[64326,1,"צּ"],[64327,1,"קּ"],[64328,1,"רּ"],[64329,1,"שּ"],[64330,1,"תּ"],[64331,1,"וֹ"],[64332,1,"בֿ"],[64333,1,"כֿ"],[64334,1,"פֿ"],[64335,1,"אל"],[[64336,64337],1,"ٱ"],[[64338,64341],1,"ٻ"],[[64342,64345],1,"پ"],[[64346,64349],1,"ڀ"],[[64350,64353],1,"ٺ"],[[64354,64357],1,"ٿ"],[[64358,64361],1,"ٹ"],[[64362,64365],1,"ڤ"],[[64366,64369],1,"ڦ"],[[64370,64373],1,"ڄ"],[[64374,64377],1,"ڃ"],[[64378,64381],1,"چ"],[[64382,64385],1,"ڇ"],[[64386,64387],1,"ڍ"],[[64388,64389],1,"ڌ"],[[64390,64391],1,"ڎ"],[[64392,64393],1,"ڈ"],[[64394,64395],1,"ژ"],[[64396,64397],1,"ڑ"],[[64398,64401],1,"ک"],[[64402,64405],1,"گ"],[[64406,64409],1,"ڳ"],[[64410,64413],1,"ڱ"],[[64414,64415],1,"ں"],[[64416,64419],1,"ڻ"],[[64420,64421],1,"ۀ"],[[64422,64425],1,"ہ"],[[64426,64429],1,"ھ"],[[64430,64431],1,"ے"],[[64432,64433],1,"ۓ"],[[64434,64449],2],[64450,2],[[64451,64466],3],[[64467,64470],1,"ڭ"],[[64471,64472],1,"ۇ"],[[64473,64474],1,"ۆ"],[[64475,64476],1,"ۈ"],[64477,1,"ۇٴ"],[[64478,64479],1,"ۋ"],[[64480,64481],1,"ۅ"],[[64482,64483],1,"ۉ"],[[64484,64487],1,"ې"],[[64488,64489],1,"ى"],[[64490,64491],1,"ئا"],[[64492,64493],1,"ئە"],[[64494,64495],1,"ئو"],[[64496,64497],1,"ئۇ"],[[64498,64499],1,"ئۆ"],[[64500,64501],1,"ئۈ"],[[64502,64504],1,"ئې"],[[64505,64507],1,"ئى"],[[64508,64511],1,"ی"],[64512,1,"ئج"],[64513,1,"ئح"],[64514,1,"ئم"],[64515,1,"ئى"],[64516,1,"ئي"],[64517,1,"بج"],[64518,1,"بح"],[64519,1,"بخ"],[64520,1,"بم"],[64521,1,"بى"],[64522,1,"بي"],[64523,1,"تج"],[64524,1,"تح"],[64525,1,"تخ"],[64526,1,"تم"],[64527,1,"تى"],[64528,1,"تي"],[64529,1,"ثج"],[64530,1,"ثم"],[64531,1,"ثى"],[64532,1,"ثي"],[64533,1,"جح"],[64534,1,"جم"],[64535,1,"حج"],[64536,1,"حم"],[64537,1,"خج"],[64538,1,"خح"],[64539,1,"خم"],[64540,1,"سج"],[64541,1,"سح"],[64542,1,"سخ"],[64543,1,"سم"],[64544,1,"صح"],[64545,1,"صم"],[64546,1,"ضج"],[64547,1,"ضح"],[64548,1,"ضخ"],[64549,1,"ضم"],[64550,1,"طح"],[64551,1,"طم"],[64552,1,"ظم"],[64553,1,"عج"],[64554,1,"عم"],[64555,1,"غج"],[64556,1,"غم"],[64557,1,"فج"],[64558,1,"فح"],[64559,1,"فخ"],[64560,1,"فم"],[64561,1,"فى"],[64562,1,"في"],[64563,1,"قح"],[64564,1,"قم"],[64565,1,"قى"],[64566,1,"قي"],[64567,1,"كا"],[64568,1,"كج"],[64569,1,"كح"],[64570,1,"كخ"],[64571,1,"كل"],[64572,1,"كم"],[64573,1,"كى"],[64574,1,"كي"],[64575,1,"لج"],[64576,1,"لح"],[64577,1,"لخ"],[64578,1,"لم"],[64579,1,"لى"],[64580,1,"لي"],[64581,1,"مج"],[64582,1,"مح"],[64583,1,"مخ"],[64584,1,"مم"],[64585,1,"مى"],[64586,1,"مي"],[64587,1,"نج"],[64588,1,"نح"],[64589,1,"نخ"],[64590,1,"نم"],[64591,1,"نى"],[64592,1,"ني"],[64593,1,"هج"],[64594,1,"هم"],[64595,1,"هى"],[64596,1,"هي"],[64597,1,"يج"],[64598,1,"يح"],[64599,1,"يخ"],[64600,1,"يم"],[64601,1,"يى"],[64602,1,"يي"],[64603,1,"ذٰ"],[64604,1,"رٰ"],[64605,1,"ىٰ"],[64606,1," ٌّ"],[64607,1," ٍّ"],[64608,1," َّ"],[64609,1," ُّ"],[64610,1," ِّ"],[64611,1," ّٰ"],[64612,1,"ئر"],[64613,1,"ئز"],[64614,1,"ئم"],[64615,1,"ئن"],[64616,1,"ئى"],[64617,1,"ئي"],[64618,1,"بر"],[64619,1,"بز"],[64620,1,"بم"],[64621,1,"بن"],[64622,1,"بى"],[64623,1,"بي"],[64624,1,"تر"],[64625,1,"تز"],[64626,1,"تم"],[64627,1,"تن"],[64628,1,"تى"],[64629,1,"تي"],[64630,1,"ثر"],[64631,1,"ثز"],[64632,1,"ثم"],[64633,1,"ثن"],[64634,1,"ثى"],[64635,1,"ثي"],[64636,1,"فى"],[64637,1,"في"],[64638,1,"قى"],[64639,1,"قي"],[64640,1,"كا"],[64641,1,"كل"],[64642,1,"كم"],[64643,1,"كى"],[64644,1,"كي"],[64645,1,"لم"],[64646,1,"لى"],[64647,1,"لي"],[64648,1,"ما"],[64649,1,"مم"],[64650,1,"نر"],[64651,1,"نز"],[64652,1,"نم"],[64653,1,"نن"],[64654,1,"نى"],[64655,1,"ني"],[64656,1,"ىٰ"],[64657,1,"ير"],[64658,1,"يز"],[64659,1,"يم"],[64660,1,"ين"],[64661,1,"يى"],[64662,1,"يي"],[64663,1,"ئج"],[64664,1,"ئح"],[64665,1,"ئخ"],[64666,1,"ئم"],[64667,1,"ئه"],[64668,1,"بج"],[64669,1,"بح"],[64670,1,"بخ"],[64671,1,"بم"],[64672,1,"به"],[64673,1,"تج"],[64674,1,"تح"],[64675,1,"تخ"],[64676,1,"تم"],[64677,1,"ته"],[64678,1,"ثم"],[64679,1,"جح"],[64680,1,"جم"],[64681,1,"حج"],[64682,1,"حم"],[64683,1,"خج"],[64684,1,"خم"],[64685,1,"سج"],[64686,1,"سح"],[64687,1,"سخ"],[64688,1,"سم"],[64689,1,"صح"],[64690,1,"صخ"],[64691,1,"صم"],[64692,1,"ضج"],[64693,1,"ضح"],[64694,1,"ضخ"],[64695,1,"ضم"],[64696,1,"طح"],[64697,1,"ظم"],[64698,1,"عج"],[64699,1,"عم"],[64700,1,"غج"],[64701,1,"غم"],[64702,1,"فج"],[64703,1,"فح"],[64704,1,"فخ"],[64705,1,"فم"],[64706,1,"قح"],[64707,1,"قم"],[64708,1,"كج"],[64709,1,"كح"],[64710,1,"كخ"],[64711,1,"كل"],[64712,1,"كم"],[64713,1,"لج"],[64714,1,"لح"],[64715,1,"لخ"],[64716,1,"لم"],[64717,1,"له"],[64718,1,"مج"],[64719,1,"مح"],[64720,1,"مخ"],[64721,1,"مم"],[64722,1,"نج"],[64723,1,"نح"],[64724,1,"نخ"],[64725,1,"نم"],[64726,1,"نه"],[64727,1,"هج"],[64728,1,"هم"],[64729,1,"هٰ"],[64730,1,"يج"],[64731,1,"يح"],[64732,1,"يخ"],[64733,1,"يم"],[64734,1,"يه"],[64735,1,"ئم"],[64736,1,"ئه"],[64737,1,"بم"],[64738,1,"به"],[64739,1,"تم"],[64740,1,"ته"],[64741,1,"ثم"],[64742,1,"ثه"],[64743,1,"سم"],[64744,1,"سه"],[64745,1,"شم"],[64746,1,"شه"],[64747,1,"كل"],[64748,1,"كم"],[64749,1,"لم"],[64750,1,"نم"],[64751,1,"نه"],[64752,1,"يم"],[64753,1,"يه"],[64754,1,"ـَّ"],[64755,1,"ـُّ"],[64756,1,"ـِّ"],[64757,1,"طى"],[64758,1,"طي"],[64759,1,"عى"],[64760,1,"عي"],[64761,1,"غى"],[64762,1,"غي"],[64763,1,"سى"],[64764,1,"سي"],[64765,1,"شى"],[64766,1,"شي"],[64767,1,"حى"],[64768,1,"حي"],[64769,1,"جى"],[64770,1,"جي"],[64771,1,"خى"],[64772,1,"خي"],[64773,1,"صى"],[64774,1,"صي"],[64775,1,"ضى"],[64776,1,"ضي"],[64777,1,"شج"],[64778,1,"شح"],[64779,1,"شخ"],[64780,1,"شم"],[64781,1,"شر"],[64782,1,"سر"],[64783,1,"صر"],[64784,1,"ضر"],[64785,1,"طى"],[64786,1,"طي"],[64787,1,"عى"],[64788,1,"عي"],[64789,1,"غى"],[64790,1,"غي"],[64791,1,"سى"],[64792,1,"سي"],[64793,1,"شى"],[64794,1,"شي"],[64795,1,"حى"],[64796,1,"حي"],[64797,1,"جى"],[64798,1,"جي"],[64799,1,"خى"],[64800,1,"خي"],[64801,1,"صى"],[64802,1,"صي"],[64803,1,"ضى"],[64804,1,"ضي"],[64805,1,"شج"],[64806,1,"شح"],[64807,1,"شخ"],[64808,1,"شم"],[64809,1,"شر"],[64810,1,"سر"],[64811,1,"صر"],[64812,1,"ضر"],[64813,1,"شج"],[64814,1,"شح"],[64815,1,"شخ"],[64816,1,"شم"],[64817,1,"سه"],[64818,1,"شه"],[64819,1,"طم"],[64820,1,"سج"],[64821,1,"سح"],[64822,1,"سخ"],[64823,1,"شج"],[64824,1,"شح"],[64825,1,"شخ"],[64826,1,"طم"],[64827,1,"ظم"],[[64828,64829],1,"اً"],[[64830,64831],2],[[64832,64847],2],[64848,1,"تجم"],[[64849,64850],1,"تحج"],[64851,1,"تحم"],[64852,1,"تخم"],[64853,1,"تمج"],[64854,1,"تمح"],[64855,1,"تمخ"],[[64856,64857],1,"جمح"],[64858,1,"حمي"],[64859,1,"حمى"],[64860,1,"سحج"],[64861,1,"سجح"],[64862,1,"سجى"],[[64863,64864],1,"سمح"],[64865,1,"سمج"],[[64866,64867],1,"سمم"],[[64868,64869],1,"صحح"],[64870,1,"صمم"],[[64871,64872],1,"شحم"],[64873,1,"شجي"],[[64874,64875],1,"شمخ"],[[64876,64877],1,"شمم"],[64878,1,"ضحى"],[[64879,64880],1,"ضخم"],[[64881,64882],1,"طمح"],[64883,1,"طمم"],[64884,1,"طمي"],[64885,1,"عجم"],[[64886,64887],1,"عمم"],[64888,1,"عمى"],[64889,1,"غمم"],[64890,1,"غمي"],[64891,1,"غمى"],[[64892,64893],1,"فخم"],[64894,1,"قمح"],[64895,1,"قمم"],[64896,1,"لحم"],[64897,1,"لحي"],[64898,1,"لحى"],[[64899,64900],1,"لجج"],[[64901,64902],1,"لخم"],[[64903,64904],1,"لمح"],[64905,1,"محج"],[64906,1,"محم"],[64907,1,"محي"],[64908,1,"مجح"],[64909,1,"مجم"],[64910,1,"مخج"],[64911,1,"مخم"],[[64912,64913],3],[64914,1,"مجخ"],[64915,1,"همج"],[64916,1,"همم"],[64917,1,"نحم"],[64918,1,"نحى"],[[64919,64920],1,"نجم"],[64921,1,"نجى"],[64922,1,"نمي"],[64923,1,"نمى"],[[64924,64925],1,"يمم"],[64926,1,"بخي"],[64927,1,"تجي"],[64928,1,"تجى"],[64929,1,"تخي"],[64930,1,"تخى"],[64931,1,"تمي"],[64932,1,"تمى"],[64933,1,"جمي"],[64934,1,"جحى"],[64935,1,"جمى"],[64936,1,"سخى"],[64937,1,"صحي"],[64938,1,"شحي"],[64939,1,"ضحي"],[64940,1,"لجي"],[64941,1,"لمي"],[64942,1,"يحي"],[64943,1,"يجي"],[64944,1,"يمي"],[64945,1,"ممي"],[64946,1,"قمي"],[64947,1,"نحي"],[64948,1,"قمح"],[64949,1,"لحم"],[64950,1,"عمي"],[64951,1,"كمي"],[64952,1,"نجح"],[64953,1,"مخي"],[64954,1,"لجم"],[64955,1,"كمم"],[64956,1,"لجم"],[64957,1,"نجح"],[64958,1,"جحي"],[64959,1,"حجي"],[64960,1,"مجي"],[64961,1,"فمي"],[64962,1,"بحي"],[64963,1,"كمم"],[64964,1,"عجم"],[64965,1,"صمم"],[64966,1,"سخي"],[64967,1,"نجي"],[[64968,64974],3],[64975,2],[[64976,65007],3],[65008,1,"صلے"],[65009,1,"قلے"],[65010,1,"الله"],[65011,1,"اكبر"],[65012,1,"محمد"],[65013,1,"صلعم"],[65014,1,"رسول"],[65015,1,"عليه"],[65016,1,"وسلم"],[65017,1,"صلى"],[65018,1,"صلى الله عليه وسلم"],[65019,1,"جل جلاله"],[65020,1,"ریال"],[65021,2],[[65022,65023],2],[[65024,65039],7],[65040,1,","],[65041,1,"、"],[65042,3],[65043,1,":"],[65044,1,";"],[65045,1,"!"],[65046,1,"?"],[65047,1,"〖"],[65048,1,"〗"],[65049,3],[[65050,65055],3],[[65056,65059],2],[[65060,65062],2],[[65063,65069],2],[[65070,65071],2],[65072,3],[65073,1,"—"],[65074,1,"–"],[[65075,65076],1,"_"],[65077,1,"("],[65078,1,")"],[65079,1,"{"],[65080,1,"}"],[65081,1,"〔"],[65082,1,"〕"],[65083,1,"【"],[65084,1,"】"],[65085,1,"《"],[65086,1,"》"],[65087,1,"〈"],[65088,1,"〉"],[65089,1,"「"],[65090,1,"」"],[65091,1,"『"],[65092,1,"』"],[[65093,65094],2],[65095,1,"["],[65096,1,"]"],[[65097,65100],1," ̅"],[[65101,65103],1,"_"],[65104,1,","],[65105,1,"、"],[65106,3],[65107,3],[65108,1,";"],[65109,1,":"],[65110,1,"?"],[65111,1,"!"],[65112,1,"—"],[65113,1,"("],[65114,1,")"],[65115,1,"{"],[65116,1,"}"],[65117,1,"〔"],[65118,1,"〕"],[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," ً"],[65137,1,"ـً"],[65138,1," ٌ"],[65139,2],[65140,1," ٍ"],[65141,3],[65142,1," َ"],[65143,1,"ـَ"],[65144,1," ُ"],[65145,1,"ـُ"],[65146,1," ِ"],[65147,1,"ـِ"],[65148,1," ّ"],[65149,1,"ـّ"],[65150,1," ْ"],[65151,1,"ـْ"],[65152,1,"ء"],[[65153,65154],1,"آ"],[[65155,65156],1,"أ"],[[65157,65158],1,"ؤ"],[[65159,65160],1,"إ"],[[65161,65164],1,"ئ"],[[65165,65166],1,"ا"],[[65167,65170],1,"ب"],[[65171,65172],1,"ة"],[[65173,65176],1,"ت"],[[65177,65180],1,"ث"],[[65181,65184],1,"ج"],[[65185,65188],1,"ح"],[[65189,65192],1,"خ"],[[65193,65194],1,"د"],[[65195,65196],1,"ذ"],[[65197,65198],1,"ر"],[[65199,65200],1,"ز"],[[65201,65204],1,"س"],[[65205,65208],1,"ش"],[[65209,65212],1,"ص"],[[65213,65216],1,"ض"],[[65217,65220],1,"ط"],[[65221,65224],1,"ظ"],[[65225,65228],1,"ع"],[[65229,65232],1,"غ"],[[65233,65236],1,"ف"],[[65237,65240],1,"ق"],[[65241,65244],1,"ك"],[[65245,65248],1,"ل"],[[65249,65252],1,"م"],[[65253,65256],1,"ن"],[[65257,65260],1,"ه"],[[65261,65262],1,"و"],[[65263,65264],1,"ى"],[[65265,65268],1,"ي"],[[65269,65270],1,"لآ"],[[65271,65272],1,"لأ"],[[65273,65274],1,"لإ"],[[65275,65276],1,"لا"],[[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,"⦅"],[65376,1,"⦆"],[65377,1,"."],[65378,1,"「"],[65379,1,"」"],[65380,1,"、"],[65381,1,"・"],[65382,1,"ヲ"],[65383,1,"ァ"],[65384,1,"ィ"],[65385,1,"ゥ"],[65386,1,"ェ"],[65387,1,"ォ"],[65388,1,"ャ"],[65389,1,"ュ"],[65390,1,"ョ"],[65391,1,"ッ"],[65392,1,"ー"],[65393,1,"ア"],[65394,1,"イ"],[65395,1,"ウ"],[65396,1,"エ"],[65397,1,"オ"],[65398,1,"カ"],[65399,1,"キ"],[65400,1,"ク"],[65401,1,"ケ"],[65402,1,"コ"],[65403,1,"サ"],[65404,1,"シ"],[65405,1,"ス"],[65406,1,"セ"],[65407,1,"ソ"],[65408,1,"タ"],[65409,1,"チ"],[65410,1,"ツ"],[65411,1,"テ"],[65412,1,"ト"],[65413,1,"ナ"],[65414,1,"ニ"],[65415,1,"ヌ"],[65416,1,"ネ"],[65417,1,"ノ"],[65418,1,"ハ"],[65419,1,"ヒ"],[65420,1,"フ"],[65421,1,"ヘ"],[65422,1,"ホ"],[65423,1,"マ"],[65424,1,"ミ"],[65425,1,"ム"],[65426,1,"メ"],[65427,1,"モ"],[65428,1,"ヤ"],[65429,1,"ユ"],[65430,1,"ヨ"],[65431,1,"ラ"],[65432,1,"リ"],[65433,1,"ル"],[65434,1,"レ"],[65435,1,"ロ"],[65436,1,"ワ"],[65437,1,"ン"],[65438,1,"゙"],[65439,1,"゚"],[65440,7],[65441,1,"ᄀ"],[65442,1,"ᄁ"],[65443,1,"ᆪ"],[65444,1,"ᄂ"],[65445,1,"ᆬ"],[65446,1,"ᆭ"],[65447,1,"ᄃ"],[65448,1,"ᄄ"],[65449,1,"ᄅ"],[65450,1,"ᆰ"],[65451,1,"ᆱ"],[65452,1,"ᆲ"],[65453,1,"ᆳ"],[65454,1,"ᆴ"],[65455,1,"ᆵ"],[65456,1,"ᄚ"],[65457,1,"ᄆ"],[65458,1,"ᄇ"],[65459,1,"ᄈ"],[65460,1,"ᄡ"],[65461,1,"ᄉ"],[65462,1,"ᄊ"],[65463,1,"ᄋ"],[65464,1,"ᄌ"],[65465,1,"ᄍ"],[65466,1,"ᄎ"],[65467,1,"ᄏ"],[65468,1,"ᄐ"],[65469,1,"ᄑ"],[65470,1,"ᄒ"],[[65471,65473],3],[65474,1,"ᅡ"],[65475,1,"ᅢ"],[65476,1,"ᅣ"],[65477,1,"ᅤ"],[65478,1,"ᅥ"],[65479,1,"ᅦ"],[[65480,65481],3],[65482,1,"ᅧ"],[65483,1,"ᅨ"],[65484,1,"ᅩ"],[65485,1,"ᅪ"],[65486,1,"ᅫ"],[65487,1,"ᅬ"],[[65488,65489],3],[65490,1,"ᅭ"],[65491,1,"ᅮ"],[65492,1,"ᅯ"],[65493,1,"ᅰ"],[65494,1,"ᅱ"],[65495,1,"ᅲ"],[[65496,65497],3],[65498,1,"ᅳ"],[65499,1,"ᅴ"],[65500,1,"ᅵ"],[[65501,65503],3],[65504,1,"¢"],[65505,1,"£"],[65506,1,"¬"],[65507,1," ̄"],[65508,1,"¦"],[65509,1,"¥"],[65510,1,"₩"],[65511,3],[65512,1,"│"],[65513,1,"←"],[65514,1,"↑"],[65515,1,"→"],[65516,1,"↓"],[65517,1,"■"],[65518,1,"○"],[[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],[[66e3,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,"𐐨"],[66561,1,"𐐩"],[66562,1,"𐐪"],[66563,1,"𐐫"],[66564,1,"𐐬"],[66565,1,"𐐭"],[66566,1,"𐐮"],[66567,1,"𐐯"],[66568,1,"𐐰"],[66569,1,"𐐱"],[66570,1,"𐐲"],[66571,1,"𐐳"],[66572,1,"𐐴"],[66573,1,"𐐵"],[66574,1,"𐐶"],[66575,1,"𐐷"],[66576,1,"𐐸"],[66577,1,"𐐹"],[66578,1,"𐐺"],[66579,1,"𐐻"],[66580,1,"𐐼"],[66581,1,"𐐽"],[66582,1,"𐐾"],[66583,1,"𐐿"],[66584,1,"𐑀"],[66585,1,"𐑁"],[66586,1,"𐑂"],[66587,1,"𐑃"],[66588,1,"𐑄"],[66589,1,"𐑅"],[66590,1,"𐑆"],[66591,1,"𐑇"],[66592,1,"𐑈"],[66593,1,"𐑉"],[66594,1,"𐑊"],[66595,1,"𐑋"],[66596,1,"𐑌"],[66597,1,"𐑍"],[66598,1,"𐑎"],[66599,1,"𐑏"],[[66600,66637],2],[[66638,66717],2],[[66718,66719],3],[[66720,66729],2],[[66730,66735],3],[66736,1,"𐓘"],[66737,1,"𐓙"],[66738,1,"𐓚"],[66739,1,"𐓛"],[66740,1,"𐓜"],[66741,1,"𐓝"],[66742,1,"𐓞"],[66743,1,"𐓟"],[66744,1,"𐓠"],[66745,1,"𐓡"],[66746,1,"𐓢"],[66747,1,"𐓣"],[66748,1,"𐓤"],[66749,1,"𐓥"],[66750,1,"𐓦"],[66751,1,"𐓧"],[66752,1,"𐓨"],[66753,1,"𐓩"],[66754,1,"𐓪"],[66755,1,"𐓫"],[66756,1,"𐓬"],[66757,1,"𐓭"],[66758,1,"𐓮"],[66759,1,"𐓯"],[66760,1,"𐓰"],[66761,1,"𐓱"],[66762,1,"𐓲"],[66763,1,"𐓳"],[66764,1,"𐓴"],[66765,1,"𐓵"],[66766,1,"𐓶"],[66767,1,"𐓷"],[66768,1,"𐓸"],[66769,1,"𐓹"],[66770,1,"𐓺"],[66771,1,"𐓻"],[[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,"𐖗"],[66929,1,"𐖘"],[66930,1,"𐖙"],[66931,1,"𐖚"],[66932,1,"𐖛"],[66933,1,"𐖜"],[66934,1,"𐖝"],[66935,1,"𐖞"],[66936,1,"𐖟"],[66937,1,"𐖠"],[66938,1,"𐖡"],[66939,3],[66940,1,"𐖣"],[66941,1,"𐖤"],[66942,1,"𐖥"],[66943,1,"𐖦"],[66944,1,"𐖧"],[66945,1,"𐖨"],[66946,1,"𐖩"],[66947,1,"𐖪"],[66948,1,"𐖫"],[66949,1,"𐖬"],[66950,1,"𐖭"],[66951,1,"𐖮"],[66952,1,"𐖯"],[66953,1,"𐖰"],[66954,1,"𐖱"],[66955,3],[66956,1,"𐖳"],[66957,1,"𐖴"],[66958,1,"𐖵"],[66959,1,"𐖶"],[66960,1,"𐖷"],[66961,1,"𐖸"],[66962,1,"𐖹"],[66963,3],[66964,1,"𐖻"],[66965,1,"𐖼"],[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,"ː"],[67458,1,"ˑ"],[67459,1,"æ"],[67460,1,"ʙ"],[67461,1,"ɓ"],[67462,3],[67463,1,"ʣ"],[67464,1,"ꭦ"],[67465,1,"ʥ"],[67466,1,"ʤ"],[67467,1,"ɖ"],[67468,1,"ɗ"],[67469,1,"ᶑ"],[67470,1,"ɘ"],[67471,1,"ɞ"],[67472,1,"ʩ"],[67473,1,"ɤ"],[67474,1,"ɢ"],[67475,1,"ɠ"],[67476,1,"ʛ"],[67477,1,"ħ"],[67478,1,"ʜ"],[67479,1,"ɧ"],[67480,1,"ʄ"],[67481,1,"ʪ"],[67482,1,"ʫ"],[67483,1,"ɬ"],[67484,1,"𝼄"],[67485,1,"ꞎ"],[67486,1,"ɮ"],[67487,1,"𝼅"],[67488,1,"ʎ"],[67489,1,"𝼆"],[67490,1,"ø"],[67491,1,"ɶ"],[67492,1,"ɷ"],[67493,1,"q"],[67494,1,"ɺ"],[67495,1,"𝼈"],[67496,1,"ɽ"],[67497,1,"ɾ"],[67498,1,"ʀ"],[67499,1,"ʨ"],[67500,1,"ʦ"],[67501,1,"ꭧ"],[67502,1,"ʧ"],[67503,1,"ʈ"],[67504,1,"ⱱ"],[67505,3],[67506,1,"ʏ"],[67507,1,"ʡ"],[67508,1,"ʢ"],[67509,1,"ʘ"],[67510,1,"ǀ"],[67511,1,"ǁ"],[67512,1,"ǂ"],[67513,1,"𝼊"],[67514,1,"𝼞"],[[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,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,"𐳀"],[68737,1,"𐳁"],[68738,1,"𐳂"],[68739,1,"𐳃"],[68740,1,"𐳄"],[68741,1,"𐳅"],[68742,1,"𐳆"],[68743,1,"𐳇"],[68744,1,"𐳈"],[68745,1,"𐳉"],[68746,1,"𐳊"],[68747,1,"𐳋"],[68748,1,"𐳌"],[68749,1,"𐳍"],[68750,1,"𐳎"],[68751,1,"𐳏"],[68752,1,"𐳐"],[68753,1,"𐳑"],[68754,1,"𐳒"],[68755,1,"𐳓"],[68756,1,"𐳔"],[68757,1,"𐳕"],[68758,1,"𐳖"],[68759,1,"𐳗"],[68760,1,"𐳘"],[68761,1,"𐳙"],[68762,1,"𐳚"],[68763,1,"𐳛"],[68764,1,"𐳜"],[68765,1,"𐳝"],[68766,1,"𐳞"],[68767,1,"𐳟"],[68768,1,"𐳠"],[68769,1,"𐳡"],[68770,1,"𐳢"],[68771,1,"𐳣"],[68772,1,"𐳤"],[68773,1,"𐳥"],[68774,1,"𐳦"],[68775,1,"𐳧"],[68776,1,"𐳨"],[68777,1,"𐳩"],[68778,1,"𐳪"],[68779,1,"𐳫"],[68780,1,"𐳬"],[68781,1,"𐳭"],[68782,1,"𐳮"],[68783,1,"𐳯"],[68784,1,"𐳰"],[68785,1,"𐳱"],[68786,1,"𐳲"],[[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,"𐵰"],[68945,1,"𐵱"],[68946,1,"𐵲"],[68947,1,"𐵳"],[68948,1,"𐵴"],[68949,1,"𐵵"],[68950,1,"𐵶"],[68951,1,"𐵷"],[68952,1,"𐵸"],[68953,1,"𐵹"],[68954,1,"𐵺"],[68955,1,"𐵻"],[68956,1,"𐵼"],[68957,1,"𐵽"],[68958,1,"𐵾"],[68959,1,"𐵿"],[68960,1,"𐶀"],[68961,1,"𐶁"],[68962,1,"𐶂"],[68963,1,"𐶃"],[68964,1,"𐶄"],[68965,1,"𐶅"],[[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,69371],3],[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,"𑣀"],[71841,1,"𑣁"],[71842,1,"𑣂"],[71843,1,"𑣃"],[71844,1,"𑣄"],[71845,1,"𑣅"],[71846,1,"𑣆"],[71847,1,"𑣇"],[71848,1,"𑣈"],[71849,1,"𑣉"],[71850,1,"𑣊"],[71851,1,"𑣋"],[71852,1,"𑣌"],[71853,1,"𑣍"],[71854,1,"𑣎"],[71855,1,"𑣏"],[71856,1,"𑣐"],[71857,1,"𑣑"],[71858,1,"𑣒"],[71859,1,"𑣓"],[71860,1,"𑣔"],[71861,1,"𑣕"],[71862,1,"𑣖"],[71863,1,"𑣗"],[71864,1,"𑣘"],[71865,1,"𑣙"],[71866,1,"𑣚"],[71867,1,"𑣛"],[71868,1,"𑣜"],[71869,1,"𑣝"],[71870,1,"𑣞"],[71871,1,"𑣟"],[[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,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,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,"𖹠"],[93761,1,"𖹡"],[93762,1,"𖹢"],[93763,1,"𖹣"],[93764,1,"𖹤"],[93765,1,"𖹥"],[93766,1,"𖹦"],[93767,1,"𖹧"],[93768,1,"𖹨"],[93769,1,"𖹩"],[93770,1,"𖹪"],[93771,1,"𖹫"],[93772,1,"𖹬"],[93773,1,"𖹭"],[93774,1,"𖹮"],[93775,1,"𖹯"],[93776,1,"𖹰"],[93777,1,"𖹱"],[93778,1,"𖹲"],[93779,1,"𖹳"],[93780,1,"𖹴"],[93781,1,"𖹵"],[93782,1,"𖹶"],[93783,1,"𖹷"],[93784,1,"𖹸"],[93785,1,"𖹹"],[93786,1,"𖹺"],[93787,1,"𖹻"],[93788,1,"𖹼"],[93789,1,"𖹽"],[93790,1,"𖹾"],[93791,1,"𖹿"],[[93792,93823],2],[[93824,93850],2],[[93851,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,94207],3],[[94208,100332],2],[[100333,100337],2],[[100338,100343],2],[[100344,100351],3],[[100352,101106],2],[[101107,101589],2],[[101590,101630],3],[101631,2],[[101632,101640],2],[[101641,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"],[118e3,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,118015],3],[[118016,118451],2],[[118452,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,"𝅗𝅥"],[119135,1,"𝅘𝅥"],[119136,1,"𝅘𝅥𝅮"],[119137,1,"𝅘𝅥𝅯"],[119138,1,"𝅘𝅥𝅰"],[119139,1,"𝅘𝅥𝅱"],[119140,1,"𝅘𝅥𝅲"],[[119141,119154],2],[[119155,119162],7],[[119163,119226],2],[119227,1,"𝆹𝅥"],[119228,1,"𝆺𝅥"],[119229,1,"𝆹𝅥𝅮"],[119230,1,"𝆺𝅥𝅮"],[119231,1,"𝆹𝅥𝅯"],[119232,1,"𝆺𝅥𝅯"],[[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"],[12e4,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,"ı"],[120485,1,"ȷ"],[[120486,120487],3],[120488,1,"α"],[120489,1,"β"],[120490,1,"γ"],[120491,1,"δ"],[120492,1,"ε"],[120493,1,"ζ"],[120494,1,"η"],[120495,1,"θ"],[120496,1,"ι"],[120497,1,"κ"],[120498,1,"λ"],[120499,1,"μ"],[120500,1,"ν"],[120501,1,"ξ"],[120502,1,"ο"],[120503,1,"π"],[120504,1,"ρ"],[120505,1,"θ"],[120506,1,"σ"],[120507,1,"τ"],[120508,1,"υ"],[120509,1,"φ"],[120510,1,"χ"],[120511,1,"ψ"],[120512,1,"ω"],[120513,1,"∇"],[120514,1,"α"],[120515,1,"β"],[120516,1,"γ"],[120517,1,"δ"],[120518,1,"ε"],[120519,1,"ζ"],[120520,1,"η"],[120521,1,"θ"],[120522,1,"ι"],[120523,1,"κ"],[120524,1,"λ"],[120525,1,"μ"],[120526,1,"ν"],[120527,1,"ξ"],[120528,1,"ο"],[120529,1,"π"],[120530,1,"ρ"],[[120531,120532],1,"σ"],[120533,1,"τ"],[120534,1,"υ"],[120535,1,"φ"],[120536,1,"χ"],[120537,1,"ψ"],[120538,1,"ω"],[120539,1,"∂"],[120540,1,"ε"],[120541,1,"θ"],[120542,1,"κ"],[120543,1,"φ"],[120544,1,"ρ"],[120545,1,"π"],[120546,1,"α"],[120547,1,"β"],[120548,1,"γ"],[120549,1,"δ"],[120550,1,"ε"],[120551,1,"ζ"],[120552,1,"η"],[120553,1,"θ"],[120554,1,"ι"],[120555,1,"κ"],[120556,1,"λ"],[120557,1,"μ"],[120558,1,"ν"],[120559,1,"ξ"],[120560,1,"ο"],[120561,1,"π"],[120562,1,"ρ"],[120563,1,"θ"],[120564,1,"σ"],[120565,1,"τ"],[120566,1,"υ"],[120567,1,"φ"],[120568,1,"χ"],[120569,1,"ψ"],[120570,1,"ω"],[120571,1,"∇"],[120572,1,"α"],[120573,1,"β"],[120574,1,"γ"],[120575,1,"δ"],[120576,1,"ε"],[120577,1,"ζ"],[120578,1,"η"],[120579,1,"θ"],[120580,1,"ι"],[120581,1,"κ"],[120582,1,"λ"],[120583,1,"μ"],[120584,1,"ν"],[120585,1,"ξ"],[120586,1,"ο"],[120587,1,"π"],[120588,1,"ρ"],[[120589,120590],1,"σ"],[120591,1,"τ"],[120592,1,"υ"],[120593,1,"φ"],[120594,1,"χ"],[120595,1,"ψ"],[120596,1,"ω"],[120597,1,"∂"],[120598,1,"ε"],[120599,1,"θ"],[120600,1,"κ"],[120601,1,"φ"],[120602,1,"ρ"],[120603,1,"π"],[120604,1,"α"],[120605,1,"β"],[120606,1,"γ"],[120607,1,"δ"],[120608,1,"ε"],[120609,1,"ζ"],[120610,1,"η"],[120611,1,"θ"],[120612,1,"ι"],[120613,1,"κ"],[120614,1,"λ"],[120615,1,"μ"],[120616,1,"ν"],[120617,1,"ξ"],[120618,1,"ο"],[120619,1,"π"],[120620,1,"ρ"],[120621,1,"θ"],[120622,1,"σ"],[120623,1,"τ"],[120624,1,"υ"],[120625,1,"φ"],[120626,1,"χ"],[120627,1,"ψ"],[120628,1,"ω"],[120629,1,"∇"],[120630,1,"α"],[120631,1,"β"],[120632,1,"γ"],[120633,1,"δ"],[120634,1,"ε"],[120635,1,"ζ"],[120636,1,"η"],[120637,1,"θ"],[120638,1,"ι"],[120639,1,"κ"],[120640,1,"λ"],[120641,1,"μ"],[120642,1,"ν"],[120643,1,"ξ"],[120644,1,"ο"],[120645,1,"π"],[120646,1,"ρ"],[[120647,120648],1,"σ"],[120649,1,"τ"],[120650,1,"υ"],[120651,1,"φ"],[120652,1,"χ"],[120653,1,"ψ"],[120654,1,"ω"],[120655,1,"∂"],[120656,1,"ε"],[120657,1,"θ"],[120658,1,"κ"],[120659,1,"φ"],[120660,1,"ρ"],[120661,1,"π"],[120662,1,"α"],[120663,1,"β"],[120664,1,"γ"],[120665,1,"δ"],[120666,1,"ε"],[120667,1,"ζ"],[120668,1,"η"],[120669,1,"θ"],[120670,1,"ι"],[120671,1,"κ"],[120672,1,"λ"],[120673,1,"μ"],[120674,1,"ν"],[120675,1,"ξ"],[120676,1,"ο"],[120677,1,"π"],[120678,1,"ρ"],[120679,1,"θ"],[120680,1,"σ"],[120681,1,"τ"],[120682,1,"υ"],[120683,1,"φ"],[120684,1,"χ"],[120685,1,"ψ"],[120686,1,"ω"],[120687,1,"∇"],[120688,1,"α"],[120689,1,"β"],[120690,1,"γ"],[120691,1,"δ"],[120692,1,"ε"],[120693,1,"ζ"],[120694,1,"η"],[120695,1,"θ"],[120696,1,"ι"],[120697,1,"κ"],[120698,1,"λ"],[120699,1,"μ"],[120700,1,"ν"],[120701,1,"ξ"],[120702,1,"ο"],[120703,1,"π"],[120704,1,"ρ"],[[120705,120706],1,"σ"],[120707,1,"τ"],[120708,1,"υ"],[120709,1,"φ"],[120710,1,"χ"],[120711,1,"ψ"],[120712,1,"ω"],[120713,1,"∂"],[120714,1,"ε"],[120715,1,"θ"],[120716,1,"κ"],[120717,1,"φ"],[120718,1,"ρ"],[120719,1,"π"],[120720,1,"α"],[120721,1,"β"],[120722,1,"γ"],[120723,1,"δ"],[120724,1,"ε"],[120725,1,"ζ"],[120726,1,"η"],[120727,1,"θ"],[120728,1,"ι"],[120729,1,"κ"],[120730,1,"λ"],[120731,1,"μ"],[120732,1,"ν"],[120733,1,"ξ"],[120734,1,"ο"],[120735,1,"π"],[120736,1,"ρ"],[120737,1,"θ"],[120738,1,"σ"],[120739,1,"τ"],[120740,1,"υ"],[120741,1,"φ"],[120742,1,"χ"],[120743,1,"ψ"],[120744,1,"ω"],[120745,1,"∇"],[120746,1,"α"],[120747,1,"β"],[120748,1,"γ"],[120749,1,"δ"],[120750,1,"ε"],[120751,1,"ζ"],[120752,1,"η"],[120753,1,"θ"],[120754,1,"ι"],[120755,1,"κ"],[120756,1,"λ"],[120757,1,"μ"],[120758,1,"ν"],[120759,1,"ξ"],[120760,1,"ο"],[120761,1,"π"],[120762,1,"ρ"],[[120763,120764],1,"σ"],[120765,1,"τ"],[120766,1,"υ"],[120767,1,"φ"],[120768,1,"χ"],[120769,1,"ψ"],[120770,1,"ω"],[120771,1,"∂"],[120772,1,"ε"],[120773,1,"θ"],[120774,1,"κ"],[120775,1,"φ"],[120776,1,"ρ"],[120777,1,"π"],[[120778,120779],1,"ϝ"],[[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,"а"],[122929,1,"б"],[122930,1,"в"],[122931,1,"г"],[122932,1,"д"],[122933,1,"е"],[122934,1,"ж"],[122935,1,"з"],[122936,1,"и"],[122937,1,"к"],[122938,1,"л"],[122939,1,"м"],[122940,1,"о"],[122941,1,"п"],[122942,1,"р"],[122943,1,"с"],[122944,1,"т"],[122945,1,"у"],[122946,1,"ф"],[122947,1,"х"],[122948,1,"ц"],[122949,1,"ч"],[122950,1,"ш"],[122951,1,"ы"],[122952,1,"э"],[122953,1,"ю"],[122954,1,"ꚉ"],[122955,1,"ә"],[122956,1,"і"],[122957,1,"ј"],[122958,1,"ө"],[122959,1,"ү"],[122960,1,"ӏ"],[122961,1,"а"],[122962,1,"б"],[122963,1,"в"],[122964,1,"г"],[122965,1,"д"],[122966,1,"е"],[122967,1,"ж"],[122968,1,"з"],[122969,1,"и"],[122970,1,"к"],[122971,1,"л"],[122972,1,"о"],[122973,1,"п"],[122974,1,"с"],[122975,1,"у"],[122976,1,"ф"],[122977,1,"х"],[122978,1,"ц"],[122979,1,"ч"],[122980,1,"ш"],[122981,1,"ъ"],[122982,1,"ы"],[122983,1,"ґ"],[122984,1,"і"],[122985,1,"ѕ"],[122986,1,"џ"],[122987,1,"ҫ"],[122988,1,"ꙑ"],[122989,1,"ұ"],[[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,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,"𞤢"],[125185,1,"𞤣"],[125186,1,"𞤤"],[125187,1,"𞤥"],[125188,1,"𞤦"],[125189,1,"𞤧"],[125190,1,"𞤨"],[125191,1,"𞤩"],[125192,1,"𞤪"],[125193,1,"𞤫"],[125194,1,"𞤬"],[125195,1,"𞤭"],[125196,1,"𞤮"],[125197,1,"𞤯"],[125198,1,"𞤰"],[125199,1,"𞤱"],[125200,1,"𞤲"],[125201,1,"𞤳"],[125202,1,"𞤴"],[125203,1,"𞤵"],[125204,1,"𞤶"],[125205,1,"𞤷"],[125206,1,"𞤸"],[125207,1,"𞤹"],[125208,1,"𞤺"],[125209,1,"𞤻"],[125210,1,"𞤼"],[125211,1,"𞤽"],[125212,1,"𞤾"],[125213,1,"𞤿"],[125214,1,"𞥀"],[125215,1,"𞥁"],[125216,1,"𞥂"],[125217,1,"𞥃"],[[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,"ا"],[126465,1,"ب"],[126466,1,"ج"],[126467,1,"د"],[126468,3],[126469,1,"و"],[126470,1,"ز"],[126471,1,"ح"],[126472,1,"ط"],[126473,1,"ي"],[126474,1,"ك"],[126475,1,"ل"],[126476,1,"م"],[126477,1,"ن"],[126478,1,"س"],[126479,1,"ع"],[126480,1,"ف"],[126481,1,"ص"],[126482,1,"ق"],[126483,1,"ر"],[126484,1,"ش"],[126485,1,"ت"],[126486,1,"ث"],[126487,1,"خ"],[126488,1,"ذ"],[126489,1,"ض"],[126490,1,"ظ"],[126491,1,"غ"],[126492,1,"ٮ"],[126493,1,"ں"],[126494,1,"ڡ"],[126495,1,"ٯ"],[126496,3],[126497,1,"ب"],[126498,1,"ج"],[126499,3],[126500,1,"ه"],[[126501,126502],3],[126503,1,"ح"],[126504,3],[126505,1,"ي"],[126506,1,"ك"],[126507,1,"ل"],[126508,1,"م"],[126509,1,"ن"],[126510,1,"س"],[126511,1,"ع"],[126512,1,"ف"],[126513,1,"ص"],[126514,1,"ق"],[126515,3],[126516,1,"ش"],[126517,1,"ت"],[126518,1,"ث"],[126519,1,"خ"],[126520,3],[126521,1,"ض"],[126522,3],[126523,1,"غ"],[[126524,126529],3],[126530,1,"ج"],[[126531,126534],3],[126535,1,"ح"],[126536,3],[126537,1,"ي"],[126538,3],[126539,1,"ل"],[126540,3],[126541,1,"ن"],[126542,1,"س"],[126543,1,"ع"],[126544,3],[126545,1,"ص"],[126546,1,"ق"],[126547,3],[126548,1,"ش"],[[126549,126550],3],[126551,1,"خ"],[126552,3],[126553,1,"ض"],[126554,3],[126555,1,"غ"],[126556,3],[126557,1,"ں"],[126558,3],[126559,1,"ٯ"],[126560,3],[126561,1,"ب"],[126562,1,"ج"],[126563,3],[126564,1,"ه"],[[126565,126566],3],[126567,1,"ح"],[126568,1,"ط"],[126569,1,"ي"],[126570,1,"ك"],[126571,3],[126572,1,"م"],[126573,1,"ن"],[126574,1,"س"],[126575,1,"ع"],[126576,1,"ف"],[126577,1,"ص"],[126578,1,"ق"],[126579,3],[126580,1,"ش"],[126581,1,"ت"],[126582,1,"ث"],[126583,1,"خ"],[126584,3],[126585,1,"ض"],[126586,1,"ظ"],[126587,1,"غ"],[126588,1,"ٮ"],[126589,3],[126590,1,"ڡ"],[126591,3],[126592,1,"ا"],[126593,1,"ب"],[126594,1,"ج"],[126595,1,"د"],[126596,1,"ه"],[126597,1,"و"],[126598,1,"ز"],[126599,1,"ح"],[126600,1,"ط"],[126601,1,"ي"],[126602,3],[126603,1,"ل"],[126604,1,"م"],[126605,1,"ن"],[126606,1,"س"],[126607,1,"ع"],[126608,1,"ف"],[126609,1,"ص"],[126610,1,"ق"],[126611,1,"ر"],[126612,1,"ش"],[126613,1,"ت"],[126614,1,"ث"],[126615,1,"خ"],[126616,1,"ذ"],[126617,1,"ض"],[126618,1,"ظ"],[126619,1,"غ"],[[126620,126624],3],[126625,1,"ب"],[126626,1,"ج"],[126627,1,"د"],[126628,3],[126629,1,"و"],[126630,1,"ز"],[126631,1,"ح"],[126632,1,"ط"],[126633,1,"ي"],[126634,3],[126635,1,"ل"],[126636,1,"م"],[126637,1,"ن"],[126638,1,"س"],[126639,1,"ع"],[126640,1,"ف"],[126641,1,"ص"],[126642,1,"ق"],[126643,1,"ر"],[126644,1,"ش"],[126645,1,"ت"],[126646,1,"ث"],[126647,1,"خ"],[126648,1,"ذ"],[126649,1,"ض"],[126650,1,"ظ"],[126651,1,"غ"],[[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,"〔s〕"],[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,"ほか"],[127489,1,"ココ"],[127490,1,"サ"],[[127491,127503],3],[127504,1,"手"],[127505,1,"字"],[127506,1,"双"],[127507,1,"デ"],[127508,1,"二"],[127509,1,"多"],[127510,1,"解"],[127511,1,"天"],[127512,1,"交"],[127513,1,"映"],[127514,1,"無"],[127515,1,"料"],[127516,1,"前"],[127517,1,"後"],[127518,1,"再"],[127519,1,"新"],[127520,1,"初"],[127521,1,"終"],[127522,1,"生"],[127523,1,"販"],[127524,1,"声"],[127525,1,"吹"],[127526,1,"演"],[127527,1,"投"],[127528,1,"捕"],[127529,1,"一"],[127530,1,"三"],[127531,1,"遊"],[127532,1,"左"],[127533,1,"中"],[127534,1,"右"],[127535,1,"指"],[127536,1,"走"],[127537,1,"打"],[127538,1,"禁"],[127539,1,"空"],[127540,1,"合"],[127541,1,"満"],[127542,1,"有"],[127543,1,"月"],[127544,1,"申"],[127545,1,"割"],[127546,1,"営"],[127547,1,"配"],[[127548,127551],3],[127552,1,"〔本〕"],[127553,1,"〔三〕"],[127554,1,"〔二〕"],[127555,1,"〔安〕"],[127556,1,"〔点〕"],[127557,1,"〔打〕"],[127558,1,"〔盗〕"],[127559,1,"〔勝〕"],[127560,1,"〔敗〕"],[[127561,127567],3],[127568,1,"得"],[127569,1,"可"],[[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],[[128e3,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,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],3],[[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,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,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,129678],3],[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,129741],3],[[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,129775],3],[[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,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],3],[[177984,178205],2],[[178206,178207],3],[[178208,183969],2],[[183970,183983],3],[[183984,191456],2],[[191457,191471],3],[[191472,192093],2],[[192094,194559],3],[194560,1,"丽"],[194561,1,"丸"],[194562,1,"乁"],[194563,1,"𠄢"],[194564,1,"你"],[194565,1,"侮"],[194566,1,"侻"],[194567,1,"倂"],[194568,1,"偺"],[194569,1,"備"],[194570,1,"僧"],[194571,1,"像"],[194572,1,"㒞"],[194573,1,"𠘺"],[194574,1,"免"],[194575,1,"兔"],[194576,1,"兤"],[194577,1,"具"],[194578,1,"𠔜"],[194579,1,"㒹"],[194580,1,"內"],[194581,1,"再"],[194582,1,"𠕋"],[194583,1,"冗"],[194584,1,"冤"],[194585,1,"仌"],[194586,1,"冬"],[194587,1,"况"],[194588,1,"𩇟"],[194589,1,"凵"],[194590,1,"刃"],[194591,1,"㓟"],[194592,1,"刻"],[194593,1,"剆"],[194594,1,"割"],[194595,1,"剷"],[194596,1,"㔕"],[194597,1,"勇"],[194598,1,"勉"],[194599,1,"勤"],[194600,1,"勺"],[194601,1,"包"],[194602,1,"匆"],[194603,1,"北"],[194604,1,"卉"],[194605,1,"卑"],[194606,1,"博"],[194607,1,"即"],[194608,1,"卽"],[[194609,194611],1,"卿"],[194612,1,"𠨬"],[194613,1,"灰"],[194614,1,"及"],[194615,1,"叟"],[194616,1,"𠭣"],[194617,1,"叫"],[194618,1,"叱"],[194619,1,"吆"],[194620,1,"咞"],[194621,1,"吸"],[194622,1,"呈"],[194623,1,"周"],[194624,1,"咢"],[194625,1,"哶"],[194626,1,"唐"],[194627,1,"啓"],[194628,1,"啣"],[[194629,194630],1,"善"],[194631,1,"喙"],[194632,1,"喫"],[194633,1,"喳"],[194634,1,"嗂"],[194635,1,"圖"],[194636,1,"嘆"],[194637,1,"圗"],[194638,1,"噑"],[194639,1,"噴"],[194640,1,"切"],[194641,1,"壮"],[194642,1,"城"],[194643,1,"埴"],[194644,1,"堍"],[194645,1,"型"],[194646,1,"堲"],[194647,1,"報"],[194648,1,"墬"],[194649,1,"𡓤"],[194650,1,"売"],[194651,1,"壷"],[194652,1,"夆"],[194653,1,"多"],[194654,1,"夢"],[194655,1,"奢"],[194656,1,"𡚨"],[194657,1,"𡛪"],[194658,1,"姬"],[194659,1,"娛"],[194660,1,"娧"],[194661,1,"姘"],[194662,1,"婦"],[194663,1,"㛮"],[194664,1,"㛼"],[194665,1,"嬈"],[[194666,194667],1,"嬾"],[194668,1,"𡧈"],[194669,1,"寃"],[194670,1,"寘"],[194671,1,"寧"],[194672,1,"寳"],[194673,1,"𡬘"],[194674,1,"寿"],[194675,1,"将"],[194676,1,"当"],[194677,1,"尢"],[194678,1,"㞁"],[194679,1,"屠"],[194680,1,"屮"],[194681,1,"峀"],[194682,1,"岍"],[194683,1,"𡷤"],[194684,1,"嵃"],[194685,1,"𡷦"],[194686,1,"嵮"],[194687,1,"嵫"],[194688,1,"嵼"],[194689,1,"巡"],[194690,1,"巢"],[194691,1,"㠯"],[194692,1,"巽"],[194693,1,"帨"],[194694,1,"帽"],[194695,1,"幩"],[194696,1,"㡢"],[194697,1,"𢆃"],[194698,1,"㡼"],[194699,1,"庰"],[194700,1,"庳"],[194701,1,"庶"],[194702,1,"廊"],[194703,1,"𪎒"],[194704,1,"廾"],[[194705,194706],1,"𢌱"],[194707,1,"舁"],[[194708,194709],1,"弢"],[194710,1,"㣇"],[194711,1,"𣊸"],[194712,1,"𦇚"],[194713,1,"形"],[194714,1,"彫"],[194715,1,"㣣"],[194716,1,"徚"],[194717,1,"忍"],[194718,1,"志"],[194719,1,"忹"],[194720,1,"悁"],[194721,1,"㤺"],[194722,1,"㤜"],[194723,1,"悔"],[194724,1,"𢛔"],[194725,1,"惇"],[194726,1,"慈"],[194727,1,"慌"],[194728,1,"慎"],[194729,1,"慌"],[194730,1,"慺"],[194731,1,"憎"],[194732,1,"憲"],[194733,1,"憤"],[194734,1,"憯"],[194735,1,"懞"],[194736,1,"懲"],[194737,1,"懶"],[194738,1,"成"],[194739,1,"戛"],[194740,1,"扝"],[194741,1,"抱"],[194742,1,"拔"],[194743,1,"捐"],[194744,1,"𢬌"],[194745,1,"挽"],[194746,1,"拼"],[194747,1,"捨"],[194748,1,"掃"],[194749,1,"揤"],[194750,1,"𢯱"],[194751,1,"搢"],[194752,1,"揅"],[194753,1,"掩"],[194754,1,"㨮"],[194755,1,"摩"],[194756,1,"摾"],[194757,1,"撝"],[194758,1,"摷"],[194759,1,"㩬"],[194760,1,"敏"],[194761,1,"敬"],[194762,1,"𣀊"],[194763,1,"旣"],[194764,1,"書"],[194765,1,"晉"],[194766,1,"㬙"],[194767,1,"暑"],[194768,1,"㬈"],[194769,1,"㫤"],[194770,1,"冒"],[194771,1,"冕"],[194772,1,"最"],[194773,1,"暜"],[194774,1,"肭"],[194775,1,"䏙"],[194776,1,"朗"],[194777,1,"望"],[194778,1,"朡"],[194779,1,"杞"],[194780,1,"杓"],[194781,1,"𣏃"],[194782,1,"㭉"],[194783,1,"柺"],[194784,1,"枅"],[194785,1,"桒"],[194786,1,"梅"],[194787,1,"𣑭"],[194788,1,"梎"],[194789,1,"栟"],[194790,1,"椔"],[194791,1,"㮝"],[194792,1,"楂"],[194793,1,"榣"],[194794,1,"槪"],[194795,1,"檨"],[194796,1,"𣚣"],[194797,1,"櫛"],[194798,1,"㰘"],[194799,1,"次"],[194800,1,"𣢧"],[194801,1,"歔"],[194802,1,"㱎"],[194803,1,"歲"],[194804,1,"殟"],[194805,1,"殺"],[194806,1,"殻"],[194807,1,"𣪍"],[194808,1,"𡴋"],[194809,1,"𣫺"],[194810,1,"汎"],[194811,1,"𣲼"],[194812,1,"沿"],[194813,1,"泍"],[194814,1,"汧"],[194815,1,"洖"],[194816,1,"派"],[194817,1,"海"],[194818,1,"流"],[194819,1,"浩"],[194820,1,"浸"],[194821,1,"涅"],[194822,1,"𣴞"],[194823,1,"洴"],[194824,1,"港"],[194825,1,"湮"],[194826,1,"㴳"],[194827,1,"滋"],[194828,1,"滇"],[194829,1,"𣻑"],[194830,1,"淹"],[194831,1,"潮"],[194832,1,"𣽞"],[194833,1,"𣾎"],[194834,1,"濆"],[194835,1,"瀹"],[194836,1,"瀞"],[194837,1,"瀛"],[194838,1,"㶖"],[194839,1,"灊"],[194840,1,"災"],[194841,1,"灷"],[194842,1,"炭"],[194843,1,"𠔥"],[194844,1,"煅"],[194845,1,"𤉣"],[194846,1,"熜"],[194847,1,"𤎫"],[194848,1,"爨"],[194849,1,"爵"],[194850,1,"牐"],[194851,1,"𤘈"],[194852,1,"犀"],[194853,1,"犕"],[194854,1,"𤜵"],[194855,1,"𤠔"],[194856,1,"獺"],[194857,1,"王"],[194858,1,"㺬"],[194859,1,"玥"],[[194860,194861],1,"㺸"],[194862,1,"瑇"],[194863,1,"瑜"],[194864,1,"瑱"],[194865,1,"璅"],[194866,1,"瓊"],[194867,1,"㼛"],[194868,1,"甤"],[194869,1,"𤰶"],[194870,1,"甾"],[194871,1,"𤲒"],[194872,1,"異"],[194873,1,"𢆟"],[194874,1,"瘐"],[194875,1,"𤾡"],[194876,1,"𤾸"],[194877,1,"𥁄"],[194878,1,"㿼"],[194879,1,"䀈"],[194880,1,"直"],[194881,1,"𥃳"],[194882,1,"𥃲"],[194883,1,"𥄙"],[194884,1,"𥄳"],[194885,1,"眞"],[[194886,194887],1,"真"],[194888,1,"睊"],[194889,1,"䀹"],[194890,1,"瞋"],[194891,1,"䁆"],[194892,1,"䂖"],[194893,1,"𥐝"],[194894,1,"硎"],[194895,1,"碌"],[194896,1,"磌"],[194897,1,"䃣"],[194898,1,"𥘦"],[194899,1,"祖"],[194900,1,"𥚚"],[194901,1,"𥛅"],[194902,1,"福"],[194903,1,"秫"],[194904,1,"䄯"],[194905,1,"穀"],[194906,1,"穊"],[194907,1,"穏"],[194908,1,"𥥼"],[[194909,194910],1,"𥪧"],[194911,1,"竮"],[194912,1,"䈂"],[194913,1,"𥮫"],[194914,1,"篆"],[194915,1,"築"],[194916,1,"䈧"],[194917,1,"𥲀"],[194918,1,"糒"],[194919,1,"䊠"],[194920,1,"糨"],[194921,1,"糣"],[194922,1,"紀"],[194923,1,"𥾆"],[194924,1,"絣"],[194925,1,"䌁"],[194926,1,"緇"],[194927,1,"縂"],[194928,1,"繅"],[194929,1,"䌴"],[194930,1,"𦈨"],[194931,1,"𦉇"],[194932,1,"䍙"],[194933,1,"𦋙"],[194934,1,"罺"],[194935,1,"𦌾"],[194936,1,"羕"],[194937,1,"翺"],[194938,1,"者"],[194939,1,"𦓚"],[194940,1,"𦔣"],[194941,1,"聠"],[194942,1,"𦖨"],[194943,1,"聰"],[194944,1,"𣍟"],[194945,1,"䏕"],[194946,1,"育"],[194947,1,"脃"],[194948,1,"䐋"],[194949,1,"脾"],[194950,1,"媵"],[194951,1,"𦞧"],[194952,1,"𦞵"],[194953,1,"𣎓"],[194954,1,"𣎜"],[194955,1,"舁"],[194956,1,"舄"],[194957,1,"辞"],[194958,1,"䑫"],[194959,1,"芑"],[194960,1,"芋"],[194961,1,"芝"],[194962,1,"劳"],[194963,1,"花"],[194964,1,"芳"],[194965,1,"芽"],[194966,1,"苦"],[194967,1,"𦬼"],[194968,1,"若"],[194969,1,"茝"],[194970,1,"荣"],[194971,1,"莭"],[194972,1,"茣"],[194973,1,"莽"],[194974,1,"菧"],[194975,1,"著"],[194976,1,"荓"],[194977,1,"菊"],[194978,1,"菌"],[194979,1,"菜"],[194980,1,"𦰶"],[194981,1,"𦵫"],[194982,1,"𦳕"],[194983,1,"䔫"],[194984,1,"蓱"],[194985,1,"蓳"],[194986,1,"蔖"],[194987,1,"𧏊"],[194988,1,"蕤"],[194989,1,"𦼬"],[194990,1,"䕝"],[194991,1,"䕡"],[194992,1,"𦾱"],[194993,1,"𧃒"],[194994,1,"䕫"],[194995,1,"虐"],[194996,1,"虜"],[194997,1,"虧"],[194998,1,"虩"],[194999,1,"蚩"],[195e3,1,"蚈"],[195001,1,"蜎"],[195002,1,"蛢"],[195003,1,"蝹"],[195004,1,"蜨"],[195005,1,"蝫"],[195006,1,"螆"],[195007,1,"䗗"],[195008,1,"蟡"],[195009,1,"蠁"],[195010,1,"䗹"],[195011,1,"衠"],[195012,1,"衣"],[195013,1,"𧙧"],[195014,1,"裗"],[195015,1,"裞"],[195016,1,"䘵"],[195017,1,"裺"],[195018,1,"㒻"],[195019,1,"𧢮"],[195020,1,"𧥦"],[195021,1,"䚾"],[195022,1,"䛇"],[195023,1,"誠"],[195024,1,"諭"],[195025,1,"變"],[195026,1,"豕"],[195027,1,"𧲨"],[195028,1,"貫"],[195029,1,"賁"],[195030,1,"贛"],[195031,1,"起"],[195032,1,"𧼯"],[195033,1,"𠠄"],[195034,1,"跋"],[195035,1,"趼"],[195036,1,"跰"],[195037,1,"𠣞"],[195038,1,"軔"],[195039,1,"輸"],[195040,1,"𨗒"],[195041,1,"𨗭"],[195042,1,"邔"],[195043,1,"郱"],[195044,1,"鄑"],[195045,1,"𨜮"],[195046,1,"鄛"],[195047,1,"鈸"],[195048,1,"鋗"],[195049,1,"鋘"],[195050,1,"鉼"],[195051,1,"鏹"],[195052,1,"鐕"],[195053,1,"𨯺"],[195054,1,"開"],[195055,1,"䦕"],[195056,1,"閷"],[195057,1,"𨵷"],[195058,1,"䧦"],[195059,1,"雃"],[195060,1,"嶲"],[195061,1,"霣"],[195062,1,"𩅅"],[195063,1,"𩈚"],[195064,1,"䩮"],[195065,1,"䩶"],[195066,1,"韠"],[195067,1,"𩐊"],[195068,1,"䪲"],[195069,1,"𩒖"],[[195070,195071],1,"頋"],[195072,1,"頩"],[195073,1,"𩖶"],[195074,1,"飢"],[195075,1,"䬳"],[195076,1,"餩"],[195077,1,"馧"],[195078,1,"駂"],[195079,1,"駾"],[195080,1,"䯎"],[195081,1,"𩬰"],[195082,1,"鬒"],[195083,1,"鱀"],[195084,1,"鳽"],[195085,1,"䳎"],[195086,1,"䳭"],[195087,1,"鵧"],[195088,1,"𪃎"],[195089,1,"䳸"],[195090,1,"𪄅"],[195091,1,"𪈎"],[195092,1,"𪊑"],[195093,1,"麻"],[195094,1,"䵖"],[195095,1,"黹"],[195096,1,"黾"],[195097,1,"鼅"],[195098,1,"鼏"],[195099,1,"鼖"],[195100,1,"鼻"],[195101,1,"𪘀"],[[195102,196605],3],[[196606,196607],3],[[196608,201546],2],[[201547,201551],3],[[201552,205743],2],[[205744,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],[[918e3,983037],3],[[983038,983039],3],[[983040,1048573],3],[[1048574,1048575],3],[[1048576,1114109],3],[[1114110,1114111],3]];var $0={};$0.STATUS_MAPPING={mapped:1,valid:2,disallowed:3,deviation:6,ignored:7};const au=s3,St=C3,Ba=S3,{STATUS_MAPPING:lr}=$0;function E1(e){return/[^\x00-\x7F]/u.test(e)}function el(e){let t=0,r=Ba.length-1;for(;t<=r;){const n=Math.floor((t+r)/2),i=Ba[n],o=Array.isArray(i[0])?i[0][0]:i[0],u=Array.isArray(i[0])?i[0][1]:i[0];if(o<=e&&u>=e)return i.slice(1);o>e?r=n-1:t=n+1}return null}function y3(e,{transitionalProcessing:t}){let r="";for(const n of e){const[i,o]=el(n.codePointAt(0));switch(i){case lr.disallowed:r+=n;break;case lr.ignored:break;case lr.mapped:t&&n==="ẞ"?r+="ss":r+=o;break;case lr.deviation:t?r+=o:r+=n;break;case lr.valid:r+=n;break}}return r}function O3(e,{checkHyphens:t,checkBidi:r,checkJoiners:n,transitionalProcessing:i,useSTD3ASCIIRules:o,isBidi:u}){if(e.length===0)return!0;if(e.normalize("NFC")!==e)return!1;const h=Array.from(e);if(t&&(h[2]==="-"&&h[3]==="-"||e.startsWith("-")||e.endsWith("-"))||!t&&e.startsWith("xn--")||e.includes(".")||St.combiningMarks.test(h[0]))return!1;for(const s of h){const a=s.codePointAt(0),[E]=el(a);if(i){if(E!==lr.valid)return!1}else if(E!==lr.valid&&E!==lr.deviation)return!1;if(o&&a<=127&&!/^(?:[a-z]|[0-9]|-)$/u.test(s))return!1}if(n){let s=0;for(const[a,E]of h.entries())if(E==="‌"||E==="‍"){if(a>0){if(St.combiningClassVirama.test(h[a-1]))continue;if(E==="‌"){const l=h.indexOf("‌",a+1),g=l<0?h.slice(s):h.slice(s,l);if(St.validZWNJ.test(g.join(""))){s=a+1;continue}}}return!1}}if(r&&u){let s;if(St.bidiS1LTR.test(h[0]))s=!1;else if(St.bidiS1RTL.test(h[0]))s=!0;else return!1;if(s){if(!St.bidiS2.test(e)||!St.bidiS3.test(e)||St.bidiS4EN.test(e)&&St.bidiS4AN.test(e))return!1}else if(!St.bidiS5.test(e)||!St.bidiS6.test(e))return!1}return!0}function w3(e){const t=e.map(r=>{if(r.startsWith("xn--"))try{return au.decode(r.substring(4))}catch{return""}return r}).join(".");return St.bidiDomain.test(t)}function tl(e,t){let r=y3(e,t);r=r.normalize("NFC");const n=r.split("."),i=w3(n);let o=!1;for(const[u,h]of n.entries()){let s=h,a=t.transitionalProcessing;if(s.startsWith("xn--")){if(E1(s)){o=!0;continue}try{s=au.decode(s.substring(4))}catch{if(!t.ignoreInvalidPunycode){o=!0;continue}}n[u]=s,(s===""||!E1(s))&&(o=!0),a=!1}if(o)continue;O3(s,{...t,transitionalProcessing:a,isBidi:i})||(o=!0)}return{string:n.join("."),error:o}}function _3(e,{checkHyphens:t=!1,checkBidi:r=!1,checkJoiners:n=!1,useSTD3ASCIIRules:i=!1,verifyDNSLength:o=!1,transitionalProcessing:u=!1,ignoreInvalidPunycode:h=!1}={}){const s=tl(e,{checkHyphens:t,checkBidi:r,checkJoiners:n,useSTD3ASCIIRules:i,transitionalProcessing:u,ignoreInvalidPunycode:h});let a=s.string.split(".");if(a=a.map(E=>{if(E1(E))try{return`xn--${au.encode(E)}`}catch{s.error=!0}return E}),o){const E=a.join(".").length;(E>253||E===0)&&(s.error=!0);for(let l=0;l<a.length;++l)if(a[l].length>63||a[l].length===0){s.error=!0;break}}return s.error?null:a.join(".")}function D3(e,{checkHyphens:t=!1,checkBidi:r=!1,checkJoiners:n=!1,useSTD3ASCIIRules:i=!1,transitionalProcessing:o=!1,ignoreInvalidPunycode:u=!1}={}){const h=tl(e,{checkHyphens:t,checkBidi:r,checkJoiners:n,useSTD3ASCIIRules:i,transitionalProcessing:o,ignoreInvalidPunycode:u});return{domain:h.string,error:h.error}}var T3={toASCII:_3,toUnicode:D3};function cu(e){return e>=48&&e<=57}function rl(e){return e>=65&&e<=90||e>=97&&e<=122}function B3(e){return rl(e)||cu(e)}function b3(e){return cu(e)||e>=65&&e<=70||e>=97&&e<=102}var nl={isASCIIDigit:cu,isASCIIAlpha:rl,isASCIIAlphanumeric:B3,isASCIIHex:b3};const M3=new TextEncoder,F3=new TextDecoder("utf-8",{ignoreBOM:!0});function R3(e){return M3.encode(e)}function N3(e){return F3.decode(e)}var lu={utf8Encode:R3,utf8DecodeWithoutBOM:N3};const{isASCIIHex:ba}=nl,{utf8Encode:il}=lu;function Se(e){return e.codePointAt(0)}function I3(e){let t=e.toString(16).toUpperCase();return t.length===1&&(t=`0${t}`),`%${t}`}function ol(e){const t=new Uint8Array(e.byteLength);let r=0;for(let n=0;n<e.byteLength;++n){const i=e[n];if(i!==37)t[r++]=i;else if(i===37&&(!ba(e[n+1])||!ba(e[n+2])))t[r++]=i;else{const o=parseInt(String.fromCodePoint(e[n+1],e[n+2]),16);t[r++]=o,n+=2}}return t.slice(0,r)}function v3(e){const t=il(e);return ol(t)}function hu(e){return e<=31||e>126}const P3=new Set([Se(" "),Se('"'),Se("<"),Se(">"),Se("`")]);function L3(e){return hu(e)||P3.has(e)}const k3=new Set([Se(" "),Se('"'),Se("#"),Se("<"),Se(">")]);function du(e){return hu(e)||k3.has(e)}function U3(e){return du(e)||e===Se("'")}const j3=new Set([Se("?"),Se("`"),Se("{"),Se("}"),Se("^")]);function sl(e){return du(e)||j3.has(e)}const x3=new Set([Se("/"),Se(":"),Se(";"),Se("="),Se("@"),Se("["),Se("\\"),Se("]"),Se("|")]);function ul(e){return sl(e)||x3.has(e)}const z3=new Set([Se("$"),Se("%"),Se("&"),Se("+"),Se(",")]);function V3(e){return ul(e)||z3.has(e)}const W3=new Set([Se("!"),Se("'"),Se("("),Se(")"),Se("~")]);function G3(e){return V3(e)||W3.has(e)}function al(e,t){const r=il(e);let n="";for(const i of r)t(i)?n+=I3(i):n+=String.fromCharCode(i);return n}function q3(e,t){return al(String.fromCodePoint(e),t)}function H3(e,t,r=!1){let n="";for(const i of e)r&&i===" "?n+="+":n+=al(i,t);return n}var fu={isC0ControlPercentEncode:hu,isFragmentPercentEncode:L3,isQueryPercentEncode:du,isSpecialQueryPercentEncode:U3,isPathPercentEncode:sl,isUserinfoPercentEncode:ul,isURLEncodedPercentEncode:G3,percentDecodeString:v3,percentDecodeBytes:ol,utf8PercentEncodeString:H3,utf8PercentEncodeCodePoint:q3};(function(e){const t=T3,r=nl,{utf8DecodeWithoutBOM:n}=lu,{percentDecodeString:i,utf8PercentEncodeCodePoint:o,utf8PercentEncodeString:u,isC0ControlPercentEncode:h,isFragmentPercentEncode:s,isQueryPercentEncode:a,isSpecialQueryPercentEncode:E,isPathPercentEncode:l,isUserinfoPercentEncode:g}=fu;function m(k){return k.codePointAt(0)}const C={ftp:21,file:null,http:80,https:443,ws:80,wss:443},S=Symbol("failure");function D(k){return[...k].length}function O(k,P){const X=k[P];return isNaN(X)?void 0:String.fromCodePoint(X)}function M(k){return k==="."||k.toLowerCase()==="%2e"}function p(k){return k=k.toLowerCase(),k===".."||k==="%2e."||k===".%2e"||k==="%2e%2e"}function B(k,P){return r.isASCIIAlpha(k)&&(P===m(":")||P===m("|"))}function d(k){return k.length===2&&r.isASCIIAlpha(k.codePointAt(0))&&(k[1]===":"||k[1]==="|")}function b(k){return k.length===2&&r.isASCIIAlpha(k.codePointAt(0))&&k[1]===":"}function f(k){return k.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|<|>|\?|@|\[|\\|\]|\^|\|/u)!==-1}function c(k){return f(k)||k.search(/[\u0000-\u001F]|%|\u007F/u)!==-1}function w(k){return C[k]!==void 0}function T(k){return w(k.scheme)}function _(k){return!w(k.scheme)}function A(k){return C[k]}function y(k){if(k==="")return S;let P=10;if(k.length>=2&&k.charAt(0)==="0"&&k.charAt(1).toLowerCase()==="x"?(k=k.substring(2),P=16):k.length>=2&&k.charAt(0)==="0"&&(k=k.substring(1),P=8),k==="")return 0;let X=/[^0-7]/u;return P===10&&(X=/[^0-9]/u),P===16&&(X=/[^0-9A-Fa-f]/u),X.test(k)?S:parseInt(k,P)}function F(k){const P=k.split(".");if(P[P.length-1]===""&&P.length>1&&P.pop(),P.length>4)return S;const X=[];for(const Z of P){const Be=y(Z);if(Be===S)return S;X.push(Be)}for(let Z=0;Z<X.length-1;++Z)if(X[Z]>255)return S;if(X[X.length-1]>=256**(5-X.length))return S;let V=X.pop(),z=0;for(const Z of X)V+=Z*256**(3-z),++z;return V}function R(k){let P="",X=k;for(let V=1;V<=4;++V)P=String(X%256)+P,V!==4&&(P=`.${P}`),X=Math.floor(X/256);return P}function v(k){const P=[0,0,0,0,0,0,0,0];let X=0,V=null,z=0;if(k=Array.from(k,Z=>Z.codePointAt(0)),k[z]===m(":")){if(k[z+1]!==m(":"))return S;z+=2,++X,V=X}for(;z<k.length;){if(X===8)return S;if(k[z]===m(":")){if(V!==null)return S;++z,++X,V=X;continue}let Z=0,Be=0;for(;Be<4&&r.isASCIIHex(k[z]);)Z=Z*16+parseInt(O(k,z),16),++z,++Be;if(k[z]===m(".")){if(Be===0||(z-=Be,X>6))return S;let lt=0;for(;k[z]!==void 0;){let it=null;if(lt>0)if(k[z]===m(".")&&lt<4)++z;else return S;if(!r.isASCIIDigit(k[z]))return S;for(;r.isASCIIDigit(k[z]);){const Ti=parseInt(O(k,z));if(it===null)it=Ti;else{if(it===0)return S;it=it*10+Ti}if(it>255)return S;++z}P[X]=P[X]*256+it,++lt,(lt===2||lt===4)&&++X}if(lt!==4)return S;break}else if(k[z]===m(":")){if(++z,k[z]===void 0)return S}else if(k[z]!==void 0)return S;P[X]=Z,++X}if(V!==null){let Z=X-V;for(X=7;X!==0&&Z>0;){const Be=P[V+Z-1];P[V+Z-1]=P[X],P[X]=Be,--X,--Z}}else if(V===null&&X!==8)return S;return P}function J(k){let P="";const X=x(k);let V=!1;for(let z=0;z<=7;++z)if(!(V&&k[z]===0)){if(V&&(V=!1),X===z){P+=z===0?"::":":",V=!0;continue}P+=k[z].toString(16),z!==7&&(P+=":")}return P}function I(k,P=!1){if(k[0]==="[")return k[k.length-1]!=="]"?S:v(k.substring(1,k.length-1));if(P)return j(k);const X=n(i(k)),V=$(X);return V===S?S:N(V)?F(V):V}function N(k){const P=k.split(".");if(P[P.length-1]===""){if(P.length===1)return!1;P.pop()}const X=P[P.length-1];return!!(y(X)!==S||/^[0-9]+$/u.test(X))}function j(k){return f(k)?S:u(k,h)}function x(k){let P=null,X=1,V=null,z=0;for(let Z=0;Z<k.length;++Z)k[Z]!==0?(z>X&&(P=V,X=z),V=null,z=0):(V===null&&(V=Z),++z);return z>X?V:P}function Y(k){return typeof k=="number"?R(k):k instanceof Array?`[${J(k)}]`:k}function $(k,P=!1){const X=t.toASCII(k,{checkHyphens:P,checkBidi:!0,checkJoiners:!0,useSTD3ASCIIRules:P,transitionalProcessing:!1,verifyDNSLength:P,ignoreInvalidPunycode:!1});return X===null||!P&&(X===""||c(X))?S:X}function K(k){let P=0,X=k.length;for(;P<X&&!(k.charCodeAt(P)>32);++P);for(;X>P&&!(k.charCodeAt(X-1)>32);--X);return k.substring(P,X)}function ee(k){return k.replace(/\u0009|\u000A|\u000D/ug,"")}function ae(k){const{path:P}=k;P.length!==0&&(k.scheme==="file"&&P.length===1&&he(P[0])||P.pop())}function ye(k){return k.username!==""||k.password!==""}function ce(k){return k.host===null||k.host===""||k.scheme==="file"}function le(k){return typeof k.path=="string"}function he(k){return/^[A-Za-z]:$/u.test(k)}function Ee(k,P,X,V,z){if(this.pointer=0,this.input=k,this.base=P||null,this.encodingOverride=X||"utf-8",this.stateOverride=z,this.url=V,this.failure=!1,this.parseError=!1,!this.url){this.url={scheme:"",username:"",password:"",host:null,port:null,path:[],query:null,fragment:null};const Be=K(this.input);Be!==this.input&&(this.parseError=!0),this.input=Be}const Z=ee(this.input);for(Z!==this.input&&(this.parseError=!0),this.input=Z,this.state=z||"scheme start",this.buffer="",this.atFlag=!1,this.arrFlag=!1,this.passwordTokenSeenFlag=!1,this.input=Array.from(this.input,Be=>Be.codePointAt(0));this.pointer<=this.input.length;++this.pointer){const Be=this.input[this.pointer],lt=isNaN(Be)?void 0:String.fromCodePoint(Be),it=this[`parse ${this.state}`](Be,lt);if(it){if(it===S){this.failure=!0;break}}else break}}Ee.prototype["parse scheme start"]=function(P,X){if(r.isASCIIAlpha(P))this.buffer+=X.toLowerCase(),this.state="scheme";else if(!this.stateOverride)this.state="no scheme",--this.pointer;else return this.parseError=!0,S;return!0},Ee.prototype["parse scheme"]=function(P,X){if(r.isASCIIAlphanumeric(P)||P===m("+")||P===m("-")||P===m("."))this.buffer+=X.toLowerCase();else if(P===m(":")){if(this.stateOverride&&(T(this.url)&&!w(this.buffer)||!T(this.url)&&w(this.buffer)||(ye(this.url)||this.url.port!==null)&&this.buffer==="file"||this.url.scheme==="file"&&this.url.host===""))return!1;if(this.url.scheme=this.buffer,this.stateOverride)return this.url.port===A(this.url.scheme)&&(this.url.port=null),!1;this.buffer="",this.url.scheme==="file"?((this.input[this.pointer+1]!==m("/")||this.input[this.pointer+2]!==m("/"))&&(this.parseError=!0),this.state="file"):T(this.url)&&this.base!==null&&this.base.scheme===this.url.scheme?this.state="special relative or authority":T(this.url)?this.state="special authority slashes":this.input[this.pointer+1]===m("/")?(this.state="path or authority",++this.pointer):(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,S;return!0},Ee.prototype["parse no scheme"]=function(P){return this.base===null||le(this.base)&&P!==m("#")?S:(le(this.base)&&P===m("#")?(this.url.scheme=this.base.scheme,this.url.path=this.base.path,this.url.query=this.base.query,this.url.fragment="",this.state="fragment"):this.base.scheme==="file"?(this.state="file",--this.pointer):(this.state="relative",--this.pointer),!0)},Ee.prototype["parse special relative or authority"]=function(P){return P===m("/")&&this.input[this.pointer+1]===m("/")?(this.state="special authority ignore slashes",++this.pointer):(this.parseError=!0,this.state="relative",--this.pointer),!0},Ee.prototype["parse path or authority"]=function(P){return P===m("/")?this.state="authority":(this.state="path",--this.pointer),!0},Ee.prototype["parse relative"]=function(P){return this.url.scheme=this.base.scheme,P===m("/")?this.state="relative slash":T(this.url)&&P===m("\\")?(this.parseError=!0,this.state="relative slash"):(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,P===m("?")?(this.url.query="",this.state="query"):P===m("#")?(this.url.fragment="",this.state="fragment"):isNaN(P)||(this.url.query=null,this.url.path.pop(),this.state="path",--this.pointer)),!0},Ee.prototype["parse relative slash"]=function(P){return T(this.url)&&(P===m("/")||P===m("\\"))?(P===m("\\")&&(this.parseError=!0),this.state="special authority ignore slashes"):P===m("/")?this.state="authority":(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),!0},Ee.prototype["parse special authority slashes"]=function(P){return P===m("/")&&this.input[this.pointer+1]===m("/")?(this.state="special authority ignore slashes",++this.pointer):(this.parseError=!0,this.state="special authority ignore slashes",--this.pointer),!0},Ee.prototype["parse special authority ignore slashes"]=function(P){return P!==m("/")&&P!==m("\\")?(this.state="authority",--this.pointer):this.parseError=!0,!0},Ee.prototype["parse authority"]=function(P,X){if(P===m("@")){this.parseError=!0,this.atFlag&&(this.buffer=`%40${this.buffer}`),this.atFlag=!0;const V=D(this.buffer);for(let z=0;z<V;++z){const Z=this.buffer.codePointAt(z);if(Z===m(":")&&!this.passwordTokenSeenFlag){this.passwordTokenSeenFlag=!0;continue}const Be=o(Z,g);this.passwordTokenSeenFlag?this.url.password+=Be:this.url.username+=Be}this.buffer=""}else if(isNaN(P)||P===m("/")||P===m("?")||P===m("#")||T(this.url)&&P===m("\\")){if(this.atFlag&&this.buffer==="")return this.parseError=!0,S;this.pointer-=D(this.buffer)+1,this.buffer="",this.state="host"}else this.buffer+=X;return!0},Ee.prototype["parse hostname"]=Ee.prototype["parse host"]=function(P,X){if(this.stateOverride&&this.url.scheme==="file")--this.pointer,this.state="file host";else if(P===m(":")&&!this.arrFlag){if(this.buffer==="")return this.parseError=!0,S;if(this.stateOverride==="hostname")return!1;const V=I(this.buffer,_(this.url));if(V===S)return S;this.url.host=V,this.buffer="",this.state="port"}else if(isNaN(P)||P===m("/")||P===m("?")||P===m("#")||T(this.url)&&P===m("\\")){if(--this.pointer,T(this.url)&&this.buffer==="")return this.parseError=!0,S;if(this.stateOverride&&this.buffer===""&&(ye(this.url)||this.url.port!==null))return this.parseError=!0,!1;const V=I(this.buffer,_(this.url));if(V===S)return S;if(this.url.host=V,this.buffer="",this.state="path start",this.stateOverride)return!1}else P===m("[")?this.arrFlag=!0:P===m("]")&&(this.arrFlag=!1),this.buffer+=X;return!0},Ee.prototype["parse port"]=function(P,X){if(r.isASCIIDigit(P))this.buffer+=X;else if(isNaN(P)||P===m("/")||P===m("?")||P===m("#")||T(this.url)&&P===m("\\")||this.stateOverride){if(this.buffer!==""){const V=parseInt(this.buffer);if(V>2**16-1)return this.parseError=!0,S;this.url.port=V===A(this.url.scheme)?null:V,this.buffer=""}if(this.stateOverride)return!1;this.state="path start",--this.pointer}else return this.parseError=!0,S;return!0};const re=new Set([m("/"),m("\\"),m("?"),m("#")]);function Ce(k,P){const X=k.length-P;return X>=2&&B(k[P],k[P+1])&&(X===2||re.has(k[P+2]))}Ee.prototype["parse file"]=function(P){return this.url.scheme="file",this.url.host="",P===m("/")||P===m("\\")?(P===m("\\")&&(this.parseError=!0),this.state="file slash"):this.base!==null&&this.base.scheme==="file"?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query=this.base.query,P===m("?")?(this.url.query="",this.state="query"):P===m("#")?(this.url.fragment="",this.state="fragment"):isNaN(P)||(this.url.query=null,Ce(this.input,this.pointer)?(this.parseError=!0,this.url.path=[]):ae(this.url),this.state="path",--this.pointer)):(this.state="path",--this.pointer),!0},Ee.prototype["parse file slash"]=function(P){return P===m("/")||P===m("\\")?(P===m("\\")&&(this.parseError=!0),this.state="file host"):(this.base!==null&&this.base.scheme==="file"&&(!Ce(this.input,this.pointer)&&b(this.base.path[0])&&this.url.path.push(this.base.path[0]),this.url.host=this.base.host),this.state="path",--this.pointer),!0},Ee.prototype["parse file host"]=function(P,X){if(isNaN(P)||P===m("/")||P===m("\\")||P===m("?")||P===m("#"))if(--this.pointer,!this.stateOverride&&d(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 V=I(this.buffer,_(this.url));if(V===S)return S;if(V==="localhost"&&(V=""),this.url.host=V,this.stateOverride)return!1;this.buffer="",this.state="path start"}else this.buffer+=X;return!0},Ee.prototype["parse path start"]=function(P){return T(this.url)?(P===m("\\")&&(this.parseError=!0),this.state="path",P!==m("/")&&P!==m("\\")&&--this.pointer):!this.stateOverride&&P===m("?")?(this.url.query="",this.state="query"):!this.stateOverride&&P===m("#")?(this.url.fragment="",this.state="fragment"):P!==void 0?(this.state="path",P!==m("/")&&--this.pointer):this.stateOverride&&this.url.host===null&&this.url.path.push(""),!0},Ee.prototype["parse path"]=function(P){return isNaN(P)||P===m("/")||T(this.url)&&P===m("\\")||!this.stateOverride&&(P===m("?")||P===m("#"))?(T(this.url)&&P===m("\\")&&(this.parseError=!0),p(this.buffer)?(ae(this.url),P!==m("/")&&!(T(this.url)&&P===m("\\"))&&this.url.path.push("")):M(this.buffer)&&P!==m("/")&&!(T(this.url)&&P===m("\\"))?this.url.path.push(""):M(this.buffer)||(this.url.scheme==="file"&&this.url.path.length===0&&d(this.buffer)&&(this.buffer=`${this.buffer[0]}:`),this.url.path.push(this.buffer)),this.buffer="",P===m("?")&&(this.url.query="",this.state="query"),P===m("#")&&(this.url.fragment="",this.state="fragment")):(P===m("%")&&(!r.isASCIIHex(this.input[this.pointer+1])||!r.isASCIIHex(this.input[this.pointer+2]))&&(this.parseError=!0),this.buffer+=o(P,l)),!0},Ee.prototype["parse opaque path"]=function(P){if(P===m("?"))this.url.query="",this.state="query";else if(P===m("#"))this.url.fragment="",this.state="fragment";else if(P===m(" ")){const X=this.input[this.pointer+1];X===m("?")||X===m("#")?this.url.path+="%20":this.url.path+=" "}else!isNaN(P)&&P!==m("%")&&(this.parseError=!0),P===m("%")&&(!r.isASCIIHex(this.input[this.pointer+1])||!r.isASCIIHex(this.input[this.pointer+2]))&&(this.parseError=!0),isNaN(P)||(this.url.path+=o(P,h));return!0},Ee.prototype["parse query"]=function(P,X){if((!T(this.url)||this.url.scheme==="ws"||this.url.scheme==="wss")&&(this.encodingOverride="utf-8"),!this.stateOverride&&P===m("#")||isNaN(P)){const V=T(this.url)?E:a;this.url.query+=u(this.buffer,V),this.buffer="",P===m("#")&&(this.url.fragment="",this.state="fragment")}else isNaN(P)||(P===m("%")&&(!r.isASCIIHex(this.input[this.pointer+1])||!r.isASCIIHex(this.input[this.pointer+2]))&&(this.parseError=!0),this.buffer+=X);return!0},Ee.prototype["parse fragment"]=function(P){return isNaN(P)||(P===m("%")&&(!r.isASCIIHex(this.input[this.pointer+1])||!r.isASCIIHex(this.input[this.pointer+2]))&&(this.parseError=!0),this.url.fragment+=o(P,s)),!0};function _e(k,P){let X=`${k.scheme}:`;return k.host!==null&&(X+="//",(k.username!==""||k.password!=="")&&(X+=k.username,k.password!==""&&(X+=`:${k.password}`),X+="@"),X+=Y(k.host),k.port!==null&&(X+=`:${k.port}`)),k.host===null&&!le(k)&&k.path.length>1&&k.path[0]===""&&(X+="/."),X+=nt(k),k.query!==null&&(X+=`?${k.query}`),!P&&k.fragment!==null&&(X+=`#${k.fragment}`),X}function He(k){let P=`${k.scheme}://`;return P+=Y(k.host),k.port!==null&&(P+=`:${k.port}`),P}function nt(k){if(le(k))return k.path;let P="";for(const X of k.path)P+=`/${X}`;return P}e.exports.serializeURL=_e,e.exports.serializePath=nt,e.exports.serializeURLOrigin=function(k){switch(k.scheme){case"blob":{const P=e.exports.parseURL(nt(k));return P===null||P.scheme!=="http"&&P.scheme!=="https"?"null":e.exports.serializeURLOrigin(P)}case"ftp":case"http":case"https":case"ws":case"wss":return He({scheme:k.scheme,host:k.host,port:k.port});case"file":return"null";default:return"null"}},e.exports.basicURLParse=function(k,P){P===void 0&&(P={});const X=new Ee(k,P.baseURL,P.encodingOverride,P.url,P.stateOverride);return X.failure?null:X.url},e.exports.setTheUsername=function(k,P){k.username=u(P,g)},e.exports.setThePassword=function(k,P){k.password=u(P,g)},e.exports.serializeHost=Y,e.exports.cannotHaveAUsernamePasswordPort=ce,e.exports.hasAnOpaquePath=le,e.exports.serializeInteger=function(k){return String(k)},e.exports.parseURL=function(k,P){return P===void 0&&(P={}),e.exports.basicURLParse(k,{baseURL:P.baseURL,encodingOverride:P.encodingOverride})}})(G0);var cl=G0.exports,Ks,Ma;function ll(){if(Ma)return Ks;Ma=1;const{utf8Encode:e,utf8DecodeWithoutBOM:t}=lu,{percentDecodeBytes:r,utf8PercentEncodeString:n,isURLEncodedPercentEncode:i}=fu;function o(l){return l.codePointAt(0)}function u(l){const g=a(l,o("&")),m=[];for(const C of g){if(C.length===0)continue;let S,D;const O=C.indexOf(o("="));O>=0?(S=C.slice(0,O),D=C.slice(O+1)):(S=C,D=new Uint8Array(0)),S=E(S,43,32),D=E(D,43,32);const M=t(r(S)),p=t(r(D));m.push([M,p])}return m}function h(l){return u(e(l))}function s(l){let g="";for(const[m,C]of l.entries()){const S=n(C[0],i,!0),D=n(C[1],i,!0);m!==0&&(g+="&"),g+=`${S}=${D}`}return g}function a(l,g){const m=[];let C=0,S=l.indexOf(g);for(;S>=0;)m.push(l.slice(C,S)),C=S+1,S=l.indexOf(g,C);return C!==l.length&&m.push(l.slice(C)),m}function E(l,g,m){let C=l.indexOf(g);for(;C>=0;)l[C]=m,C=l.indexOf(g,C+1);return l}return Ks={parseUrlencodedString:h,serializeUrlencoded:s},Ks}var mu={},hl={};const Fa=Io,Pi=nu;hl.convert=(e,t,{context:r="The provided value"}={})=>{if(typeof t!="function")throw new e.TypeError(r+" is not a function");function n(...i){const o=Pi.tryWrapperForImpl(this);let u;for(let h=0;h<i.length;h++)i[h]=Pi.tryWrapperForImpl(i[h]);return u=Reflect.apply(t,o,i),u=Fa.any(u,{context:r,globals:e}),u}return n.construct=(...i)=>{for(let u=0;u<i.length;u++)i[u]=Pi.tryWrapperForImpl(i[u]);let o=Reflect.construct(t,i);return o=Fa.any(o,{context:r,globals:e}),o},n[Pi.wrapperSymbol]=t,n.objectReference=t,n};var Ys={},Ra;function K3(){if(Ra)return Ys;Ra=1;const e=ll();return Ys.implementation=class{constructor(r,n,{doNotStripQMark:i=!1}){let o=n[0];if(this._list=[],this._url=null,!i&&typeof o=="string"&&o[0]==="?"&&(o=o.slice(1)),Array.isArray(o))for(const u of o){if(u.length!==2)throw new TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence's element does not contain exactly two elements.");this._list.push([u[0],u[1]])}else if(typeof o=="object"&&Object.getPrototypeOf(o)===null)for(const u of Object.keys(o)){const h=o[u];this._list.push([u,h])}else this._list=e.parseUrlencodedString(o)}_updateSteps(){if(this._url!==null){let r=e.serializeUrlencoded(this._list);r===""&&(r=null),this._url._url.query=r}}get size(){return this._list.length}append(r,n){this._list.push([r,n]),this._updateSteps()}delete(r,n){let i=0;for(;i<this._list.length;)this._list[i][0]===r&&(n===void 0||this._list[i][1]===n)?this._list.splice(i,1):i++;this._updateSteps()}get(r){for(const n of this._list)if(n[0]===r)return n[1];return null}getAll(r){const n=[];for(const i of this._list)i[0]===r&&n.push(i[1]);return n}has(r,n){for(const i of this._list)if(i[0]===r&&(n===void 0||i[1]===n))return!0;return!1}set(r,n){let i=!1,o=0;for(;o<this._list.length;)this._list[o][0]===r?i?this._list.splice(o,1):(i=!0,this._list[o][1]=n,o++):o++;i||this._list.push([r,n]),this._updateSteps()}sort(){this._list.sort((r,n)=>r[0]<n[0]?-1:r[0]>n[0]?1:0),this._updateSteps()}[Symbol.iterator](){return this._list[Symbol.iterator]()}toString(){return e.serializeUrlencoded(this._list)}},Ys}(function(e){const t=Io,r=nu,n=hl,i=r.newObjectInRealm,o=r.implSymbol,u=r.ctorRegistrySymbol,h="URLSearchParams";e.is=l=>r.isObject(l)&&r.hasOwn(l,o)&&l[o]instanceof E.implementation,e.isImpl=l=>r.isObject(l)&&l instanceof E.implementation,e.convert=(l,g,{context:m="The provided value"}={})=>{if(e.is(g))return r.implForWrapper(g);throw new l.TypeError(`${m} is not of type 'URLSearchParams'.`)},e.createDefaultIterator=(l,g,m)=>{const S=l[u]["URLSearchParams Iterator"],D=Object.create(S);return Object.defineProperty(D,r.iterInternalSymbol,{value:{target:g,kind:m,index:0},configurable:!0}),D};function s(l,g){let m;return g!==void 0&&(m=g.prototype),r.isObject(m)||(m=l[u].URLSearchParams.prototype),Object.create(m)}e.create=(l,g,m)=>{const C=s(l);return e.setup(C,l,g,m)},e.createImpl=(l,g,m)=>{const C=e.create(l,g,m);return r.implForWrapper(C)},e._internalSetup=(l,g)=>{},e.setup=(l,g,m=[],C={})=>(C.wrapper=l,e._internalSetup(l,g),Object.defineProperty(l,o,{value:new E.implementation(g,m,C),configurable:!0}),l[o][r.wrapperSymbol]=l,E.init&&E.init(l[o]),l),e.new=(l,g)=>{const m=s(l,g);return e._internalSetup(m,l),Object.defineProperty(m,o,{value:Object.create(E.implementation.prototype),configurable:!0}),m[o][r.wrapperSymbol]=m,E.init&&E.init(m[o]),m[o]};const a=new Set(["Window","Worker"]);e.install=(l,g)=>{if(!g.some(S=>a.has(S)))return;const m=r.initCtorRegistry(l);class C{constructor(){const D=[];{let O=arguments[0];if(O!==void 0)if(r.isObject(O))if(O[Symbol.iterator]!==void 0)if(r.isObject(O)){const M=[],p=O;for(let B of p){if(r.isObject(B)){const d=[],b=B;for(let f of b)f=t.USVString(f,{context:"Failed to construct 'URLSearchParams': parameter 1 sequence's element's element",globals:l}),d.push(f);B=d}else throw new l.TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence's element is not an iterable object.");M.push(B)}O=M}else throw new l.TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence is not an iterable object.");else if(r.isObject(O)){const M=Object.create(null);for(const p of Reflect.ownKeys(O)){const B=Object.getOwnPropertyDescriptor(O,p);if(B&&B.enumerable){let d=p;d=t.USVString(d,{context:"Failed to construct 'URLSearchParams': parameter 1 record's key",globals:l});let b=O[p];b=t.USVString(b,{context:"Failed to construct 'URLSearchParams': parameter 1 record's value",globals:l}),M[d]=b}}O=M}else throw new l.TypeError("Failed to construct 'URLSearchParams': parameter 1 record is not an object.");else O=t.USVString(O,{context:"Failed to construct 'URLSearchParams': parameter 1",globals:l});else O="";D.push(O)}return e.setup(Object.create(new.target.prototype),l,D)}append(D,O){const M=this!==null&&this!==void 0?this:l;if(!e.is(M))throw new l.TypeError("'append' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<2)throw new l.TypeError(`Failed to execute 'append' on 'URLSearchParams': 2 arguments required, but only ${arguments.length} present.`);const p=[];{let B=arguments[0];B=t.USVString(B,{context:"Failed to execute 'append' on 'URLSearchParams': parameter 1",globals:l}),p.push(B)}{let B=arguments[1];B=t.USVString(B,{context:"Failed to execute 'append' on 'URLSearchParams': parameter 2",globals:l}),p.push(B)}return r.tryWrapperForImpl(M[o].append(...p))}delete(D){const O=this!==null&&this!==void 0?this:l;if(!e.is(O))throw new l.TypeError("'delete' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new l.TypeError(`Failed to execute 'delete' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.`);const M=[];{let p=arguments[0];p=t.USVString(p,{context:"Failed to execute 'delete' on 'URLSearchParams': parameter 1",globals:l}),M.push(p)}{let p=arguments[1];p!==void 0&&(p=t.USVString(p,{context:"Failed to execute 'delete' on 'URLSearchParams': parameter 2",globals:l})),M.push(p)}return r.tryWrapperForImpl(O[o].delete(...M))}get(D){const O=this!==null&&this!==void 0?this:l;if(!e.is(O))throw new l.TypeError("'get' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new l.TypeError(`Failed to execute 'get' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.`);const M=[];{let p=arguments[0];p=t.USVString(p,{context:"Failed to execute 'get' on 'URLSearchParams': parameter 1",globals:l}),M.push(p)}return O[o].get(...M)}getAll(D){const O=this!==null&&this!==void 0?this:l;if(!e.is(O))throw new l.TypeError("'getAll' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new l.TypeError(`Failed to execute 'getAll' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.`);const M=[];{let p=arguments[0];p=t.USVString(p,{context:"Failed to execute 'getAll' on 'URLSearchParams': parameter 1",globals:l}),M.push(p)}return r.tryWrapperForImpl(O[o].getAll(...M))}has(D){const O=this!==null&&this!==void 0?this:l;if(!e.is(O))throw new l.TypeError("'has' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new l.TypeError(`Failed to execute 'has' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.`);const M=[];{let p=arguments[0];p=t.USVString(p,{context:"Failed to execute 'has' on 'URLSearchParams': parameter 1",globals:l}),M.push(p)}{let p=arguments[1];p!==void 0&&(p=t.USVString(p,{context:"Failed to execute 'has' on 'URLSearchParams': parameter 2",globals:l})),M.push(p)}return O[o].has(...M)}set(D,O){const M=this!==null&&this!==void 0?this:l;if(!e.is(M))throw new l.TypeError("'set' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<2)throw new l.TypeError(`Failed to execute 'set' on 'URLSearchParams': 2 arguments required, but only ${arguments.length} present.`);const p=[];{let B=arguments[0];B=t.USVString(B,{context:"Failed to execute 'set' on 'URLSearchParams': parameter 1",globals:l}),p.push(B)}{let B=arguments[1];B=t.USVString(B,{context:"Failed to execute 'set' on 'URLSearchParams': parameter 2",globals:l}),p.push(B)}return r.tryWrapperForImpl(M[o].set(...p))}sort(){const D=this!==null&&this!==void 0?this:l;if(!e.is(D))throw new l.TypeError("'sort' called on an object that is not a valid instance of URLSearchParams.");return r.tryWrapperForImpl(D[o].sort())}toString(){const D=this!==null&&this!==void 0?this:l;if(!e.is(D))throw new l.TypeError("'toString' called on an object that is not a valid instance of URLSearchParams.");return D[o].toString()}keys(){if(!e.is(this))throw new l.TypeError("'keys' called on an object that is not a valid instance of URLSearchParams.");return e.createDefaultIterator(l,this,"key")}values(){if(!e.is(this))throw new l.TypeError("'values' called on an object that is not a valid instance of URLSearchParams.");return e.createDefaultIterator(l,this,"value")}entries(){if(!e.is(this))throw new l.TypeError("'entries' called on an object that is not a valid instance of URLSearchParams.");return e.createDefaultIterator(l,this,"key+value")}forEach(D){if(!e.is(this))throw new l.TypeError("'forEach' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new l.TypeError("Failed to execute 'forEach' on 'iterable': 1 argument required, but only 0 present.");D=n.convert(l,D,{context:"Failed to execute 'forEach' on 'iterable': The callback provided as parameter 1"});const O=arguments[1];let M=Array.from(this[o]),p=0;for(;p<M.length;){const[B,d]=M[p].map(r.tryWrapperForImpl);D.call(O,d,B,this),M=Array.from(this[o]),p++}}get size(){const D=this!==null&&this!==void 0?this:l;if(!e.is(D))throw new l.TypeError("'get size' called on an object that is not a valid instance of URLSearchParams.");return D[o].size}}Object.defineProperties(C.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:C.prototype.entries,configurable:!0,writable:!0}}),m[h]=C,m["URLSearchParams Iterator"]=Object.create(m["%IteratorPrototype%"],{[Symbol.toStringTag]:{configurable:!0,value:"URLSearchParams Iterator"}}),r.define(m["URLSearchParams Iterator"],{next(){const S=this&&this[r.iterInternalSymbol];if(!S)throw new l.TypeError("next() called on a value that is not a URLSearchParams iterator object");const{target:D,kind:O,index:M}=S,p=Array.from(D[o]),B=p.length;if(M>=B)return i(l,{value:void 0,done:!0});const d=p[M];return S.index=M+1,i(l,r.iteratorResult(d.map(r.tryWrapperForImpl),O))}}),Object.defineProperty(l,h,{configurable:!0,writable:!0,value:C})};const E=K3()})(mu);var Na;function Y3(){if(Na)return Gs;Na=1;const e=cl,t=ll(),r=mu;return Gs.implementation=class dl{constructor(i,[o,u]){let h=null;if(u!==void 0&&(h=e.basicURLParse(u),h===null))throw new TypeError(`Invalid base URL: ${u}`);const s=e.basicURLParse(o,{baseURL:h});if(s===null)throw new TypeError(`Invalid URL: ${o}`);const a=s.query!==null?s.query:"";this._url=s,this._query=r.createImpl(i,[a],{doNotStripQMark:!0}),this._query._url=this}static parse(i,o,u){try{return new dl(i,[o,u])}catch{return null}}static canParse(i,o){let u=null;return!(o!==void 0&&(u=e.basicURLParse(o),u===null)||e.basicURLParse(i,{baseURL:u})===null)}get href(){return e.serializeURL(this._url)}set href(i){const o=e.basicURLParse(i);if(o===null)throw new TypeError(`Invalid URL: ${i}`);this._url=o,this._query._list.splice(0);const{query:u}=o;u!==null&&(this._query._list=t.parseUrlencodedString(u))}get origin(){return e.serializeURLOrigin(this._url)}get protocol(){return`${this._url.scheme}:`}set protocol(i){e.basicURLParse(`${i}:`,{url:this._url,stateOverride:"scheme start"})}get username(){return this._url.username}set username(i){e.cannotHaveAUsernamePasswordPort(this._url)||e.setTheUsername(this._url,i)}get password(){return this._url.password}set password(i){e.cannotHaveAUsernamePasswordPort(this._url)||e.setThePassword(this._url,i)}get host(){const i=this._url;return i.host===null?"":i.port===null?e.serializeHost(i.host):`${e.serializeHost(i.host)}:${e.serializeInteger(i.port)}`}set host(i){e.hasAnOpaquePath(this._url)||e.basicURLParse(i,{url:this._url,stateOverride:"host"})}get hostname(){return this._url.host===null?"":e.serializeHost(this._url.host)}set hostname(i){e.hasAnOpaquePath(this._url)||e.basicURLParse(i,{url:this._url,stateOverride:"hostname"})}get port(){return this._url.port===null?"":e.serializeInteger(this._url.port)}set port(i){e.cannotHaveAUsernamePasswordPort(this._url)||(i===""?this._url.port=null:e.basicURLParse(i,{url:this._url,stateOverride:"port"}))}get pathname(){return e.serializePath(this._url)}set pathname(i){e.hasAnOpaquePath(this._url)||(this._url.path=[],e.basicURLParse(i,{url:this._url,stateOverride:"path start"}))}get search(){return this._url.query===null||this._url.query===""?"":`?${this._url.query}`}set search(i){const o=this._url;if(i===""){o.query=null,this._query._list=[];return}const u=i[0]==="?"?i.substring(1):i;o.query="",e.basicURLParse(u,{url:o,stateOverride:"query"}),this._query._list=t.parseUrlencodedString(u)}get searchParams(){return this._query}get hash(){return this._url.fragment===null||this._url.fragment===""?"":`#${this._url.fragment}`}set hash(i){if(i===""){this._url.fragment=null;return}const o=i[0]==="#"?i.substring(1):i;this._url.fragment="",e.basicURLParse(o,{url:this._url,stateOverride:"fragment"})}toJSON(){return this.href}},Gs}(function(e){const t=Io,r=nu,n=r.implSymbol,i=r.ctorRegistrySymbol,o="URL";e.is=a=>r.isObject(a)&&r.hasOwn(a,n)&&a[n]instanceof s.implementation,e.isImpl=a=>r.isObject(a)&&a instanceof s.implementation,e.convert=(a,E,{context:l="The provided value"}={})=>{if(e.is(E))return r.implForWrapper(E);throw new a.TypeError(`${l} is not of type 'URL'.`)};function u(a,E){let l;return E!==void 0&&(l=E.prototype),r.isObject(l)||(l=a[i].URL.prototype),Object.create(l)}e.create=(a,E,l)=>{const g=u(a);return e.setup(g,a,E,l)},e.createImpl=(a,E,l)=>{const g=e.create(a,E,l);return r.implForWrapper(g)},e._internalSetup=(a,E)=>{},e.setup=(a,E,l=[],g={})=>(g.wrapper=a,e._internalSetup(a,E),Object.defineProperty(a,n,{value:new s.implementation(E,l,g),configurable:!0}),a[n][r.wrapperSymbol]=a,s.init&&s.init(a[n]),a),e.new=(a,E)=>{const l=u(a,E);return e._internalSetup(l,a),Object.defineProperty(l,n,{value:Object.create(s.implementation.prototype),configurable:!0}),l[n][r.wrapperSymbol]=l,s.init&&s.init(l[n]),l[n]};const h=new Set(["Window","Worker"]);e.install=(a,E)=>{if(!E.some(m=>h.has(m)))return;const l=r.initCtorRegistry(a);class g{constructor(C){if(arguments.length<1)throw new a.TypeError(`Failed to construct 'URL': 1 argument required, but only ${arguments.length} present.`);const S=[];{let D=arguments[0];D=t.USVString(D,{context:"Failed to construct 'URL': parameter 1",globals:a}),S.push(D)}{let D=arguments[1];D!==void 0&&(D=t.USVString(D,{context:"Failed to construct 'URL': parameter 2",globals:a})),S.push(D)}return e.setup(Object.create(new.target.prototype),a,S)}toJSON(){const C=this!==null&&this!==void 0?this:a;if(!e.is(C))throw new a.TypeError("'toJSON' called on an object that is not a valid instance of URL.");return C[n].toJSON()}get href(){const C=this!==null&&this!==void 0?this:a;if(!e.is(C))throw new a.TypeError("'get href' called on an object that is not a valid instance of URL.");return C[n].href}set href(C){const S=this!==null&&this!==void 0?this:a;if(!e.is(S))throw new a.TypeError("'set href' called on an object that is not a valid instance of URL.");C=t.USVString(C,{context:"Failed to set the 'href' property on 'URL': The provided value",globals:a}),S[n].href=C}toString(){const C=this;if(!e.is(C))throw new a.TypeError("'toString' called on an object that is not a valid instance of URL.");return C[n].href}get origin(){const C=this!==null&&this!==void 0?this:a;if(!e.is(C))throw new a.TypeError("'get origin' called on an object that is not a valid instance of URL.");return C[n].origin}get protocol(){const C=this!==null&&this!==void 0?this:a;if(!e.is(C))throw new a.TypeError("'get protocol' called on an object that is not a valid instance of URL.");return C[n].protocol}set protocol(C){const S=this!==null&&this!==void 0?this:a;if(!e.is(S))throw new a.TypeError("'set protocol' called on an object that is not a valid instance of URL.");C=t.USVString(C,{context:"Failed to set the 'protocol' property on 'URL': The provided value",globals:a}),S[n].protocol=C}get username(){const C=this!==null&&this!==void 0?this:a;if(!e.is(C))throw new a.TypeError("'get username' called on an object that is not a valid instance of URL.");return C[n].username}set username(C){const S=this!==null&&this!==void 0?this:a;if(!e.is(S))throw new a.TypeError("'set username' called on an object that is not a valid instance of URL.");C=t.USVString(C,{context:"Failed to set the 'username' property on 'URL': The provided value",globals:a}),S[n].username=C}get password(){const C=this!==null&&this!==void 0?this:a;if(!e.is(C))throw new a.TypeError("'get password' called on an object that is not a valid instance of URL.");return C[n].password}set password(C){const S=this!==null&&this!==void 0?this:a;if(!e.is(S))throw new a.TypeError("'set password' called on an object that is not a valid instance of URL.");C=t.USVString(C,{context:"Failed to set the 'password' property on 'URL': The provided value",globals:a}),S[n].password=C}get host(){const C=this!==null&&this!==void 0?this:a;if(!e.is(C))throw new a.TypeError("'get host' called on an object that is not a valid instance of URL.");return C[n].host}set host(C){const S=this!==null&&this!==void 0?this:a;if(!e.is(S))throw new a.TypeError("'set host' called on an object that is not a valid instance of URL.");C=t.USVString(C,{context:"Failed to set the 'host' property on 'URL': The provided value",globals:a}),S[n].host=C}get hostname(){const C=this!==null&&this!==void 0?this:a;if(!e.is(C))throw new a.TypeError("'get hostname' called on an object that is not a valid instance of URL.");return C[n].hostname}set hostname(C){const S=this!==null&&this!==void 0?this:a;if(!e.is(S))throw new a.TypeError("'set hostname' called on an object that is not a valid instance of URL.");C=t.USVString(C,{context:"Failed to set the 'hostname' property on 'URL': The provided value",globals:a}),S[n].hostname=C}get port(){const C=this!==null&&this!==void 0?this:a;if(!e.is(C))throw new a.TypeError("'get port' called on an object that is not a valid instance of URL.");return C[n].port}set port(C){const S=this!==null&&this!==void 0?this:a;if(!e.is(S))throw new a.TypeError("'set port' called on an object that is not a valid instance of URL.");C=t.USVString(C,{context:"Failed to set the 'port' property on 'URL': The provided value",globals:a}),S[n].port=C}get pathname(){const C=this!==null&&this!==void 0?this:a;if(!e.is(C))throw new a.TypeError("'get pathname' called on an object that is not a valid instance of URL.");return C[n].pathname}set pathname(C){const S=this!==null&&this!==void 0?this:a;if(!e.is(S))throw new a.TypeError("'set pathname' called on an object that is not a valid instance of URL.");C=t.USVString(C,{context:"Failed to set the 'pathname' property on 'URL': The provided value",globals:a}),S[n].pathname=C}get search(){const C=this!==null&&this!==void 0?this:a;if(!e.is(C))throw new a.TypeError("'get search' called on an object that is not a valid instance of URL.");return C[n].search}set search(C){const S=this!==null&&this!==void 0?this:a;if(!e.is(S))throw new a.TypeError("'set search' called on an object that is not a valid instance of URL.");C=t.USVString(C,{context:"Failed to set the 'search' property on 'URL': The provided value",globals:a}),S[n].search=C}get searchParams(){const C=this!==null&&this!==void 0?this:a;if(!e.is(C))throw new a.TypeError("'get searchParams' called on an object that is not a valid instance of URL.");return r.getSameObject(this,"searchParams",()=>r.tryWrapperForImpl(C[n].searchParams))}get hash(){const C=this!==null&&this!==void 0?this:a;if(!e.is(C))throw new a.TypeError("'get hash' called on an object that is not a valid instance of URL.");return C[n].hash}set hash(C){const S=this!==null&&this!==void 0?this:a;if(!e.is(S))throw new a.TypeError("'set hash' called on an object that is not a valid instance of URL.");C=t.USVString(C,{context:"Failed to set the 'hash' property on 'URL': The provided value",globals:a}),S[n].hash=C}static parse(C){if(arguments.length<1)throw new a.TypeError(`Failed to execute 'parse' on 'URL': 1 argument required, but only ${arguments.length} present.`);const S=[];{let D=arguments[0];D=t.USVString(D,{context:"Failed to execute 'parse' on 'URL': parameter 1",globals:a}),S.push(D)}{let D=arguments[1];D!==void 0&&(D=t.USVString(D,{context:"Failed to execute 'parse' on 'URL': parameter 2",globals:a})),S.push(D)}return r.tryWrapperForImpl(s.implementation.parse(a,...S))}static canParse(C){if(arguments.length<1)throw new a.TypeError(`Failed to execute 'canParse' on 'URL': 1 argument required, but only ${arguments.length} present.`);const S=[];{let D=arguments[0];D=t.USVString(D,{context:"Failed to execute 'canParse' on 'URL': parameter 1",globals:a}),S.push(D)}{let D=arguments[1];D!==void 0&&(D=t.USVString(D,{context:"Failed to execute 'canParse' on 'URL': parameter 2",globals:a})),S.push(D)}return s.implementation.canParse(...S)}}Object.defineProperties(g.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(g,{parse:{enumerable:!0},canParse:{enumerable:!0}}),l[o]=g,Object.defineProperty(a,o,{configurable:!0,writable:!0,value:g}),E.includes("Window")&&Object.defineProperty(a,"webkitURL",{configurable:!0,writable:!0,value:g})};const s=Y3()})(V0);const X3=V0,J3=mu;ru.URL=X3;ru.URLSearchParams=J3;const{URL:Q3,URLSearchParams:Z3}=ru,Lt=cl,fl=fu,vo={Array,Object,Promise,String,TypeError};Q3.install(vo,["Window"]);Z3.install(vo,["Window"]);rt.URL=vo.URL;rt.URLSearchParams=vo.URLSearchParams;rt.parseURL=Lt.parseURL;rt.basicURLParse=Lt.basicURLParse;rt.serializeURL=Lt.serializeURL;rt.serializePath=Lt.serializePath;rt.serializeHost=Lt.serializeHost;rt.serializeInteger=Lt.serializeInteger;rt.serializeURLOrigin=Lt.serializeURLOrigin;rt.setTheUsername=Lt.setTheUsername;rt.setThePassword=Lt.setThePassword;rt.cannotHaveAUsernamePasswordPort=Lt.cannotHaveAUsernamePasswordPort;rt.hasAnOpaquePath=Lt.hasAnOpaquePath;rt.percentDecodeString=fl.percentDecodeString;rt.percentDecodeBytes=fl.percentDecodeBytes;var Nn={},Ia;function $3(){if(Ia)return Nn;Ia=1;var e=jt&&jt.__createBinding||(Object.create?function(u,h,s,a){a===void 0&&(a=s);var E=Object.getOwnPropertyDescriptor(h,s);(!E||("get"in E?!h.__esModule:E.writable||E.configurable))&&(E={enumerable:!0,get:function(){return h[s]}}),Object.defineProperty(u,a,E)}:function(u,h,s,a){a===void 0&&(a=s),u[a]=h[s]}),t=jt&&jt.__setModuleDefault||(Object.create?function(u,h){Object.defineProperty(u,"default",{enumerable:!0,value:h})}:function(u,h){u.default=h}),r=jt&&jt.__importStar||function(){var u=function(h){return u=Object.getOwnPropertyNames||function(s){var a=[];for(var E in s)Object.prototype.hasOwnProperty.call(s,E)&&(a[a.length]=E);return a},u(h)};return function(h){if(h&&h.__esModule)return h;var s={};if(h!=null)for(var a=u(h),E=0;E<a.length;E++)a[E]!=="default"&&e(s,h,a[E]);return t(s,h),s}}();Object.defineProperty(Nn,"__esModule",{value:!0}),Nn.redactValidConnectionString=i,Nn.redactConnectionString=o;const n=r(ml());function i(u,h){const s=u.clone(),a=(h==null?void 0:h.replacementString)??"_credentials_",E=(h==null?void 0:h.redactUsernames)??!0;if((s.username||s.password)&&E?(s.username=a,s.password=""):s.password&&(s.password=a),s.searchParams.has("authMechanismProperties")){const l=new n.CommaAndColonSeparatedRecord(s.searchParams.get("authMechanismProperties"));l.get("AWS_SESSION_TOKEN")&&(l.set("AWS_SESSION_TOKEN",a),s.searchParams.set("authMechanismProperties",l.toString()))}return s.searchParams.has("tlsCertificateKeyFilePassword")&&s.searchParams.set("tlsCertificateKeyFilePassword",a),s.searchParams.has("proxyUsername")&&E&&s.searchParams.set("proxyUsername",a),s.searchParams.has("proxyPassword")&&s.searchParams.set("proxyPassword",a),s}function o(u,h){const s=(h==null?void 0:h.replacementString)??"<credentials>",a=(h==null?void 0:h.redactUsernames)??!0;let E;try{E=new n.default(u)}catch{}if(E)return h={...h,replacementString:"___credentials___"},E.redact(h).toString().replace(/___credentials___/g,s);const l=s,g=[m=>m.replace(a?/(\/\/)(.*)(@)/g:/(\/\/[^@]*:)(.*)(@)/g,`$1${l}$3`),m=>m.replace(/(AWS_SESSION_TOKEN(:|%3A))([^,&]+)/gi,`$1${l}`),m=>m.replace(/(tlsCertificateKeyFilePassword=)([^&]+)/gi,`$1${l}`),m=>a?m.replace(/(proxyUsername=)([^&]+)/gi,`$1${l}`):m,m=>m.replace(/(proxyPassword=)([^&]+)/gi,`$1${l}`)];for(const m of g)u=m(u);return u}return Nn}var va;function ml(){return va||(va=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CommaAndColonSeparatedRecord=e.ConnectionString=e.redactConnectionString=void 0;const t=rt,r=$3();Object.defineProperty(e,"redactConnectionString",{enumerable:!0,get:function(){return r.redactConnectionString}});const n="__this_is_a_placeholder__";function i(m){return m.startsWith("mongodb://")||m.startsWith("mongodb+srv://")}const o=/^(?<protocol>[^/]+):\/\/(?:(?<username>[^:@]*)(?::(?<password>[^@]*))?@)?(?<hosts>(?!:)[^/?@]*)(?<rest>.*)/;class u extends Map{delete(C){return super.delete(this._normalizeKey(C))}get(C){return super.get(this._normalizeKey(C))}has(C){return super.has(this._normalizeKey(C))}set(C,S){return super.set(this._normalizeKey(C),S)}_normalizeKey(C){C=`${C}`;for(const S of this.keys())if(S.toLowerCase()===C.toLowerCase()){C=S;break}return C}}function h(m){return class extends m{append(S,D){return super.append(this._normalizeKey(S),D)}delete(S){return super.delete(this._normalizeKey(S))}get(S){return super.get(this._normalizeKey(S))}getAll(S){return super.getAll(this._normalizeKey(S))}has(S){return super.has(this._normalizeKey(S))}set(S,D){return super.set(this._normalizeKey(S),D)}keys(){return super.keys()}values(){return super.values()}entries(){return super.entries()}[Symbol.iterator](){return super[Symbol.iterator]()}_normalizeKey(S){return u.prototype._normalizeKey.call(this,S)}}}class s extends t.URL{}class a extends Error{get name(){return"MongoParseError"}}class E extends s{constructor(S,D={}){var C=(...g)=>(super(...g),se(this,"_hosts"),this);const{looseValidation:O}=D;if(!O&&!i(S))throw new a('Invalid scheme, expected connection string to start with "mongodb://" or "mongodb+srv://"');const M=S.match(o);if(!M)throw new a(`Invalid connection string "${S}"`);const{protocol:p,username:B,password:d,hosts:b,rest:f}=M.groups??{};if(!O){if(!p||!b)throw new a(`Protocol and host list are required in "${S}"`);try{decodeURIComponent(B??""),decodeURIComponent(d??"")}catch(T){throw new a(T.message)}const w=/[:/?#[\]@]/gi;if(B!=null&&B.match(w))throw new a(`Username contains unescaped characters ${B}`);if(!B||!d){const T=S.replace(`${p}://`,"");if(T.startsWith("@")||T.startsWith(":"))throw new a("URI contained empty userinfo section")}if(d!=null&&d.match(w))throw new a("Password contains unescaped characters")}let c="";typeof B=="string"&&(c+=B),typeof d=="string"&&(c+=`:${d}`),c&&(c+="@");try{C(`${p.toLowerCase()}://${c}${n}${f}`)}catch(w){throw O&&new E(S,{...D,looseValidation:!1}),typeof w.message=="string"&&(w.message=w.message.replace(n,b)),w}if(this._hosts=b.split(","),!O){if(this.isSRV&&this.hosts.length!==1)throw new a("mongodb+srv URI cannot have multiple service names");if(this.isSRV&&this.hosts.some(w=>w.includes(":")))throw new a("mongodb+srv URI cannot have port number")}this.pathname||(this.pathname="/"),Object.setPrototypeOf(this.searchParams,h(this.searchParams.constructor).prototype)}get host(){return n}set host(S){throw new Error("No single host for connection string")}get hostname(){return n}set hostname(S){throw new Error("No single host for connection string")}get port(){return""}set port(S){throw new Error("No single host for connection string")}get href(){return this.toString()}set href(S){throw new Error("Cannot set href for connection strings")}get isSRV(){return this.protocol.includes("srv")}get hosts(){return this._hosts}set hosts(S){this._hosts=S}toString(){return super.toString().replace(n,this.hosts.join(","))}clone(){return new E(this.toString(),{looseValidation:!0})}redact(S){return(0,r.redactValidConnectionString)(this,S)}typedSearchParams(){return this.searchParams}[Symbol.for("nodejs.util.inspect.custom")](){const{href:S,origin:D,protocol:O,username:M,password:p,hosts:B,pathname:d,search:b,searchParams:f,hash:c}=this;return{href:S,origin:D,protocol:O,username:M,password:p,hosts:B,pathname:d,search:b,searchParams:f,hash:c}}}e.ConnectionString=E;class l extends u{constructor(C){super();for(const S of(C??"").split(",")){if(!S)continue;const D=S.indexOf(":");D===-1?this.set(S,""):this.set(S.slice(0,D),S.slice(D+1))}}toString(){return[...this].map(C=>C.join(":")).join(",")}}e.CommaAndColonSeparatedRecord=l,e.default=E}(Ws)),Ws}var Xs={},ot={},Pa;function Po(){if(Pa)return ot;Pa=1,Object.defineProperty(ot,"__esModule",{value:!0}),ot.OpCompressedRequest=ot.OpMsgResponse=ot.OpMsgRequest=ot.DocumentSequence=ot.OpReply=ot.OpQueryRequest=void 0;const e=pe,t=Q,r=Lo(),n=fe;let i=0;const o=2,u=4,h=8,s=16,a=32,E=64,l=128,g=1,m=2,C=4,S=8,D=e.BSON.onDemand.ByteUtils.encodeUTF8Into;class O{constructor(y,F,R){this.moreToCome=!1;const v=`${y}.$cmd`;if(typeof y!="string")throw new t.MongoRuntimeError("Database name must be a string for a query");if(F==null)throw new t.MongoRuntimeError("A query document must be specified for query");if(v.indexOf("\0")!==-1)throw new t.MongoRuntimeError("Namespace cannot contain a null character");this.databaseName=y,this.query=F,this.ns=v,this.numberToSkip=R.numberToSkip||0,this.numberToReturn=R.numberToReturn||0,this.returnFieldSelector=R.returnFieldSelector||void 0,this.requestId=R.requestId??O.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||1024*1024*16,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=i++}nextRequestId(){return i+1}static getRequestId(){return++i}toBin(){const y=[];let F=null,R=0;this.tailable&&(R|=o),this.secondaryOk&&(R|=u),this.oplogReplay&&(R|=h),this.noCursorTimeout&&(R|=s),this.awaitData&&(R|=a),this.exhaust&&(R|=E),this.partial&&(R|=l),this.batchSize!==this.numberToReturn&&(this.numberToReturn=this.batchSize);const v=Buffer.alloc(4*4+4+Buffer.byteLength(this.ns)+1+4+4);y.push(v);const J=e.serialize(this.query,{checkKeys:this.checkKeys,serializeFunctions:this.serializeFunctions,ignoreUndefined:this.ignoreUndefined});y.push(J),this.returnFieldSelector&&Object.keys(this.returnFieldSelector).length>0&&(F=e.serialize(this.returnFieldSelector,{checkKeys:this.checkKeys,serializeFunctions:this.serializeFunctions,ignoreUndefined:this.ignoreUndefined}),y.push(F));const I=v.length+J.length+(F?F.length:0);let N=4;return v[3]=I>>24&255,v[2]=I>>16&255,v[1]=I>>8&255,v[0]=I&255,v[N+3]=this.requestId>>24&255,v[N+2]=this.requestId>>16&255,v[N+1]=this.requestId>>8&255,v[N]=this.requestId&255,N=N+4,v[N+3]=0,v[N+2]=0,v[N+1]=0,v[N]=0,N=N+4,v[N+3]=n.OP_QUERY>>24&255,v[N+2]=n.OP_QUERY>>16&255,v[N+1]=n.OP_QUERY>>8&255,v[N]=n.OP_QUERY&255,N=N+4,v[N+3]=R>>24&255,v[N+2]=R>>16&255,v[N+1]=R>>8&255,v[N]=R&255,N=N+4,N=N+v.write(this.ns,N,"utf8")+1,v[N-1]=0,v[N+3]=this.numberToSkip>>24&255,v[N+2]=this.numberToSkip>>16&255,v[N+1]=this.numberToSkip>>8&255,v[N]=this.numberToSkip&255,N=N+4,v[N+3]=this.numberToReturn>>24&255,v[N+2]=this.numberToReturn>>16&255,v[N+1]=this.numberToReturn>>8&255,v[N]=this.numberToReturn&255,N=N+4,y}}ot.OpQueryRequest=O;class M{constructor(y,F,R,v){this.index=0,this.sections=[],this.moreToCome=!1,this.parsed=!1,this.raw=y,this.data=R,this.opts=v??{useBigInt64:!1,promoteLongs:!0,promoteValues:!0,promoteBuffers:!1,bsonRegExp:!1},this.length=F.length,this.requestId=F.requestId,this.responseTo=F.responseTo,this.opCode=F.opCode,this.fromCompressed=F.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=this.data.readInt32LE(0),this.cursorId=new e.Long(this.data.readInt32LE(4),this.data.readInt32LE(8)),this.startingFrom=this.data.readInt32LE(12),this.numberReturned=this.data.readInt32LE(16),this.numberReturned<0||this.numberReturned>2**32-1)throw new RangeError(`OP_REPLY numberReturned is an invalid array length ${this.numberReturned}`);this.cursorNotFound=(this.responseFlags&g)!==0,this.queryFailure=(this.responseFlags&m)!==0,this.shardConfigStale=(this.responseFlags&C)!==0,this.awaitCapable=(this.responseFlags&S)!==0;for(let y=0;y<this.numberReturned;y++){const F=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+F);this.sections.push(R),this.index=this.index+F}return this.parsed=!0,this.sections[0]}}ot.OpReply=M;const p=1,B=2,d=65536;class b{constructor(y,F){this.field=y,this.documents=[],this.chunks=[],this.serializedDocumentsLength=0;const R=Buffer.allocUnsafe(5+this.field.length+1);if(R[0]=1,D(R,`${this.field}\0`,5),this.chunks.push(R),this.header=R,F)for(const v of F)this.push(v,e.serialize(v))}push(y,F){var R;return this.serializedDocumentsLength+=F.length,this.documents.push(y),this.chunks.push(F),(R=this.header)==null||R.writeInt32LE(4+this.field.length+1+this.serializedDocumentsLength,1),this.serializedDocumentsLength+this.header.length}toBin(){return Buffer.concat(this.chunks)}}ot.DocumentSequence=b;class f{constructor(y,F,R){var v;if(F==null)throw new t.MongoInvalidArgumentError("Query document must be specified for query");this.databaseName=y,this.command=F,this.command.$db=y,this.options=R??{},this.requestId=R.requestId?R.requestId:f.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||1024*1024*16,this.checksumPresent=!1,this.moreToCome=R.moreToCome??((v=F.writeConcern)==null?void 0:v.w)===0,this.exhaustAllowed=typeof R.exhaustAllowed=="boolean"?R.exhaustAllowed:!1}toBin(){const y=[];let F=0;this.checksumPresent&&(F|=p),this.moreToCome&&(F|=B),this.exhaustAllowed&&(F|=d);const R=Buffer.alloc(4*4+4);y.push(R);let v=R.length;const J=this.command;return v+=this.makeSections(y,J),R.writeInt32LE(v,0),R.writeInt32LE(this.requestId,4),R.writeInt32LE(0,8),R.writeInt32LE(n.OP_MSG,12),R.writeUInt32LE(F,16),y}makeSections(y,F){const R=this.extractDocumentSequences(F),v=Buffer.allocUnsafe(1);v[0]=0;const J=this.serializeBson(F);return y.push(v),y.push(J),y.push(R),v.length+J.length+R.length}extractDocumentSequences(y){const F=[];for(const[R,v]of Object.entries(y))v instanceof b&&(F.push(v.toBin()),delete y[R]);return F.length>0?Buffer.concat(F):Buffer.alloc(0)}serializeBson(y){return e.serialize(y,{checkKeys:this.checkKeys,serializeFunctions:this.serializeFunctions,ignoreUndefined:this.ignoreUndefined})}static getRequestId(){return i=i+1&2147483647,i}}ot.OpMsgRequest=f;class c{constructor(y,F,R,v){this.index=0,this.sections=[],this.parsed=!1,this.raw=y,this.data=R,this.opts=v??{useBigInt64:!1,promoteLongs:!0,promoteValues:!0,promoteBuffers:!1,bsonRegExp:!1},this.length=F.length,this.requestId=F.requestId,this.responseTo=F.responseTo,this.opCode=F.opCode,this.fromCompressed=F.fromCompressed,this.responseFlags=R.readInt32LE(0),this.checksumPresent=(this.responseFlags&p)!==0,this.moreToCome=(this.responseFlags&B)!==0,this.exhaustAllowed=(this.responseFlags&d)!==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];for(this.index=4;this.index<this.data.length;){const y=this.data.readUInt8(this.index++);if(y===0){const F=this.data.readUInt32LE(this.index),R=this.data.subarray(this.index,this.index+F);this.sections.push(R),this.index+=F}else if(y===1)throw new t.MongoRuntimeError("OP_MSG Payload Type 1 detected unsupported protocol")}return this.parsed=!0,this.sections[0]}}ot.OpMsgResponse=c;const w=16,T=9;class _{constructor(y,F){this.command=y,this.options={zlibCompressionLevel:F.zlibCompressionLevel,agreedCompressor:F.agreedCompressor}}static canCompress(y){const F=y instanceof f?y.command:y.query,R=Object.keys(F)[0];return!r.uncompressibleCommands.has(R)}async toBin(){const y=Buffer.concat(this.command.toBin()),F=y.slice(w),R=y.readInt32LE(12),v=await(0,r.compress)(this.options,F),J=Buffer.alloc(w);J.writeInt32LE(w+T+v.length,0),J.writeInt32LE(this.command.requestId,4),J.writeInt32LE(0,8),J.writeInt32LE(n.OP_COMPRESSED,12);const I=Buffer.alloc(T);return I.writeInt32LE(R,0),I.writeInt32LE(F.length,4),I.writeUInt8(r.Compressor[this.options.agreedCompressor],8),[J,I,v]}}return ot.OpCompressedRequest=_,ot}var La;function Lo(){return La||(La=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.uncompressibleCommands=e.Compressor=void 0,e.compress=m,e.decompress=C,e.compressCommand=O,e.decompressResponse=M;const t=Nc,r=Ve,n=Qe,i=Q,o=Po(),u=fe;e.Compressor=Object.freeze({none:0,snappy:1,zlib:2,zstd:3}),e.uncompressibleCommands=new Set([r.LEGACY_HELLO_COMMAND,"saslStart","saslContinue","getnonce","authenticate","createUser","updateUser","copydbSaslStart","copydbgetnonce","copydb"]);const h=3,s=p=>new Promise((B,d)=>{t.inflate(p,(b,f)=>{if(b)return d(b);B(f)})}),a=(p,B)=>new Promise((d,b)=>{t.deflate(p,B,(f,c)=>{if(f)return b(f);d(c)})});let E,l=null;function g(){if(l==null){const p=(0,n.getSnappy)();if("kModuleError"in p)throw p.kModuleError;l=p}return l}async function m(p,B){const d={};switch(p.agreedCompressor){case"snappy":return l??(l=g()),await l.compress(B);case"zstd":{if(S(),"kModuleError"in E)throw E.kModuleError;return await E.compress(B,h)}case"zlib":return p.zlibCompressionLevel&&(d.level=p.zlibCompressionLevel),await a(B,d);default:throw new i.MongoInvalidArgumentError(`Unknown compressor ${p.agreedCompressor} failed to compress`)}}async function C(p,B){if(p!==e.Compressor.snappy&&p!==e.Compressor.zstd&&p!==e.Compressor.zlib&&p!==e.Compressor.none)throw new i.MongoDecompressionError(`Server sent message compressed using an unsupported compressor. (Received compressor ID ${p})`);switch(p){case e.Compressor.snappy:return l??(l=g()),await l.uncompress(B,{asBuffer:!0});case e.Compressor.zstd:{if(S(),"kModuleError"in E)throw E.kModuleError;return await E.decompress(B)}case e.Compressor.zlib:return await s(B);default:return B}}function S(){E||(E=(0,n.getZstdLibrary)())}const D=16;async function O(p,B){const b=await(B.agreedCompressor==="none"||!o.OpCompressedRequest.canCompress(p)?p:new o.OpCompressedRequest(p,{agreedCompressor:B.agreedCompressor??"none",zlibCompressionLevel:B.zlibCompressionLevel??0})).toBin();return Buffer.concat(b)}async function M(p){const B={length:p.readInt32LE(0),requestId:p.readInt32LE(4),responseTo:p.readInt32LE(8),opCode:p.readInt32LE(12)};if(B.opCode!==u.OP_COMPRESSED){const T=B.opCode===u.OP_MSG?o.OpMsgResponse:o.OpReply,_=p.subarray(D);return new T(p,B,_)}const d={...B,fromCompressed:!0,opCode:p.readInt32LE(D),length:p.readInt32LE(D+4)},b=p[D+8],f=p.slice(D+9),c=d.opCode===u.OP_MSG?o.OpMsgResponse:o.OpReply,w=await C(b,f);if(w.length!==d.length)throw new i.MongoDecompressionError("Message body and message header must be the same length");return new c(p,d,w)}}(Xs)),Xs}var In={},_r={},tn={},Ge={};Object.defineProperty(Ge,"__esModule",{value:!0});Ge.MongoCryptKMSRequestNetworkTimeoutError=Ge.MongoCryptAzureKMSRequestError=Ge.MongoCryptCreateEncryptedCollectionError=Ge.MongoCryptCreateDataKeyError=Ge.MongoCryptInvalidArgumentError=Ge.defaultErrorWrapper=Ge.MongoCryptError=void 0;const e6=Q;class Kr extends e6.MongoError{constructor(t,r={}){super(t,r)}get name(){return"MongoCryptError"}}Ge.MongoCryptError=Kr;const t6=e=>new Kr(e.message,{cause:e});Ge.defaultErrorWrapper=t6;class r6 extends Kr{constructor(t){super(t)}get name(){return"MongoCryptInvalidArgumentError"}}Ge.MongoCryptInvalidArgumentError=r6;class n6 extends Kr{constructor(t,{cause:r}){super(`Unable to complete creating data keys: ${r.message}`,{cause:r}),this.encryptedFields=t}get name(){return"MongoCryptCreateDataKeyError"}}Ge.MongoCryptCreateDataKeyError=n6;class i6 extends Kr{constructor(t,{cause:r}){super(`Unable to create collection: ${r.message}`,{cause:r}),this.encryptedFields=t}get name(){return"MongoCryptCreateEncryptedCollectionError"}}Ge.MongoCryptCreateEncryptedCollectionError=i6;class o6 extends Kr{constructor(t,r){super(t),this.body=r}get name(){return"MongoCryptAzureKMSRequestError"}}Ge.MongoCryptAzureKMSRequestError=o6;class s6 extends Kr{get name(){return"MongoCryptKMSRequestNetworkTimeoutError"}}Ge.MongoCryptKMSRequestNetworkTimeoutError=s6;var gi={},Eu={},Ai={};Object.defineProperty(Ai,"__esModule",{value:!0});Ai.AWSSDKCredentialProvider=void 0;const u6=Ar,a6=Qe,c6=Q;class Ut{constructor(t){t&&(this._provider=t)}static get awsSDK(){return Ut._awsSDK??(Ut._awsSDK=(0,a6.getAwsCredentialProvider)()),Ut._awsSDK}get provider(){if("kModuleError"in Ut.awsSDK)throw Ut.awsSDK.kModuleError;if(this._provider)return this._provider;let{AWS_STS_REGIONAL_ENDPOINTS:t="",AWS_REGION:r=""}=u6.env;t=t.toLowerCase(),r=r.toLowerCase();const n=r.length!==0&&t.length!==0,o=t==="regional"||t==="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(r);return this._provider=n&&o?Ut.awsSDK.fromNodeProviderChain({clientConfig:{region:r}}):Ut.awsSDK.fromNodeProviderChain(),this._provider}async getCredentials(){try{const t=await this.provider();return{AccessKeyId:t.accessKeyId,SecretAccessKey:t.secretAccessKey,Token:t.sessionToken,Expiration:t.expiration}}catch(t){throw new c6.MongoAWSError(t.message,{cause:t})}}}Ai.AWSSDKCredentialProvider=Ut;Object.defineProperty(Eu,"__esModule",{value:!0});Eu.loadAWSCredentials=h6;const l6=Ai;async function h6(e,t){const r=new l6.AWSSDKCredentialProvider(t),{SecretAccessKey:n="",AccessKeyId:i="",Token:o}=await r.getCredentials(),u={secretAccessKey:n,accessKeyId:i};return o!=null&&(u.sessionToken=o),{...e,aws:u}}var gu={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.tokenCache=e.AzureCredentialCache=e.AZURE_BASE_URL=void 0,e.addAzureParams=h,e.prepareRequest=s,e.fetchAzureKMSToken=a,e.loadAzureCredentials=E;const t=Q,r=ne(),n=Ge,i=6e3;e.AZURE_BASE_URL="http://169.254.169.254/metadata/identity/oauth2/token?";class o{constructor(){this.cachedToken=null}async getToken(){return(this.cachedToken==null||this.needsRefresh(this.cachedToken))&&(this.cachedToken=await this._getToken()),{accessToken:this.cachedToken.accessToken}}needsRefresh(g){return g.expiresOnTimestamp-Date.now()<=i}resetCache(){this.cachedToken=null}_getToken(){return a()}}e.AzureCredentialCache=o,e.tokenCache=new o;async function u(l){const{status:g,body:m}=l,C=(()=>{try{return JSON.parse(m)}catch{throw new n.MongoCryptAzureKMSRequestError("Malformed JSON body in GET request.")}})();if(g!==200)throw new n.MongoCryptAzureKMSRequestError("Unable to complete request.",C);if(!C.access_token)throw new n.MongoCryptAzureKMSRequestError("Malformed response body - missing field `access_token`.");if(!C.expires_in)throw new n.MongoCryptAzureKMSRequestError("Malformed response body - missing field `expires_in`.");const S=Number(C.expires_in)*1e3;if(Number.isNaN(S))throw new n.MongoCryptAzureKMSRequestError("Malformed response body - unable to parse int from `expires_in` field.");return{accessToken:C.access_token,expiresOnTimestamp:Date.now()+S}}function h(l,g,m){return l.searchParams.append("api-version","2018-02-01"),l.searchParams.append("resource",g),m&&l.searchParams.append("client_id",m),l}function s(l){var C;const g=new URL(((C=l.url)==null?void 0:C.toString())??e.AZURE_BASE_URL);return h(g,"https://vault.azure.net"),{headers:{...l.headers,"Content-Type":"application/json",Metadata:!0},url:g}}async function a(l={}){const{headers:g,url:m}=s(l);try{const C=await(0,r.get)(m,{headers:g});return await u(C)}catch(C){throw C instanceof t.MongoNetworkTimeoutError?new n.MongoCryptAzureKMSRequestError(`[Azure KMS] ${C.message}`):C}}async function E(l){const g=await e.tokenCache.getToken();return{...l,azure:g}}})(gu);var Au={};Object.defineProperty(Au,"__esModule",{value:!0});Au.loadGCPCredentials=f6;const d6=Qe;async function f6(e){const t=(0,d6.getGcpMetadata)();if("kModuleError"in t)return e;const{access_token:r}=await t.instance({property:"service-accounts/default/token"});return{...e,gcp:{accessToken:r}}}Object.defineProperty(gi,"__esModule",{value:!0});gi.isEmptyCredentials=qi;gi.refreshKMSCredentials=A6;const m6=Eu,E6=gu,g6=Au;function qi(e,t){const r=t[e];return r==null?!1:typeof r=="object"&&Object.keys(r).length===0}async function A6(e,t){let r=e;return qi("aws",e)&&(r=await(0,m6.loadAWSCredentials)(r,t==null?void 0:t.aws)),qi("gcp",e)&&(r=await(0,g6.loadGCPCredentials)(r)),qi("azure",e)&&(r=await(0,E6.loadAzureCredentials)(r)),r}var vn={},ka;function El(){if(ka)return vn;ka=1,Object.defineProperty(vn,"__esModule",{value:!0}),vn.StateMachine=void 0;const e=Ic,t=B1,r=Ar,n=vc,i=pe,o=tt,u=Qe,h=Q,s=Te,a=ne(),E=pu(),l=Ge;let g=null;function m(){if(g==null){const A=(0,u.getSocks)();if("kModuleError"in A)throw A.kModuleError;g=A}return g}const C=0,S=1,D=2,O=3,M=7,p=4,B=5,d=6,b=443,f=new Map([[C,"MONGOCRYPT_CTX_ERROR"],[S,"MONGOCRYPT_CTX_NEED_MONGO_COLLINFO"],[D,"MONGOCRYPT_CTX_NEED_MONGO_MARKINGS"],[O,"MONGOCRYPT_CTX_NEED_MONGO_KEYS"],[M,"MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS"],[p,"MONGOCRYPT_CTX_NEED_KMS"],[B,"MONGOCRYPT_CTX_READY"],[d,"MONGOCRYPT_CTX_DONE"]]),c=["tlsInsecure","tlsAllowInvalidCertificates","tlsAllowInvalidHostnames"];function w(A){r.env.MONGODB_CRYPT_DEBUG&&console.error(A)}let T;class _{constructor(y,F=(0,i.pluckBSONSerializeOptions)(y)){this.options=y,this.bsonOptions=F}async execute(y,F,R){var K;const v=y._keyVaultNamespace,J=y._keyVaultClient,I=y._metaDataClient,N=y._mongocryptdClient,j=y._mongocryptdManager;let x=null;const Y=()=>F.status,$=()=>F.state;for(;$()!==d&&$()!==C;)switch((K=R.signal)==null||K.throwIfAborted(),w(`[context#${F.id}] ${f.get($())||$()}`),$()){case S:{const ee=(0,i.deserialize)(F.nextMongoOperation());if(!I)throw new l.MongoCryptError("unreachable state machine state: entered MONGOCRYPT_CTX_NEED_MONGO_COLLINFO but metadata client is undefined");const ae=this.fetchCollectionInfo(I,F.ns,ee,R);for await(const ye of ae)if(F.addMongoOperationResponse((0,i.serialize)(ye)),$()===C)break;if($()===C)break;F.finishMongoOperation();break}case D:{const ee=F.nextMongoOperation();if($()===C)break;if(!N)throw new l.MongoCryptError("unreachable state machine state: entered MONGOCRYPT_CTX_NEED_MONGO_MARKINGS but mongocryptdClient is undefined");const ae=j?await j.withRespawn(this.markCommand.bind(this,N,F.ns,ee,R)):await this.markCommand(N,F.ns,ee,R);F.addMongoOperationResponse(ae),F.finishMongoOperation();break}case O:{const ee=F.nextMongoOperation(),ae=await this.fetchKeys(J,v,ee,R);ae.length===0&&(x=T??(T=(0,i.serialize)({v:[]})));for(const ye of ae)F.addMongoOperationResponse((0,i.serialize)(ye));F.finishMongoOperation();break}case M:{const ee=await y.askForKMSCredentials();F.provideKMSProviders((0,i.serialize)(ee));break}case p:{await Promise.all(this.requests(F,R)),F.finishKMSRequests();break}case B:{const ee=F.finalize();if($()===C){const ae=Y().message||"Finalization error";throw new l.MongoCryptError(ae)}x=ee;break}default:throw new l.MongoCryptError(`Unknown state: ${$()}`)}if($()===C||x==null){const ee=Y().message;throw ee||w("unidentifiable error in MongoCrypt - received an error status from `libmongocrypt` but received no error message."),new l.MongoCryptError(ee??"unidentifiable error in MongoCrypt - received an error status from `libmongocrypt` but received no error message.")}return x}async kmsRequest(y,F){var ye,ce;const R=y.endpoint.split(":"),v=R[1]!=null?Number.parseInt(R[1],10):b,J={host:R[0],servername:R[0],port:v,...(0,E.autoSelectSocketOptions)(this.options.socketOptions||{})},I=y.message,N=new a.BufferPool;let j,x;function Y(){for(const le of[x,j])le&&le.destroy()}function $(le){return new l.MongoCryptError("KMS request failed",{cause:le})}function K(){return new l.MongoCryptError("KMS request closed")}const ee=this.options.tlsOptions;if(ee){const le=y.kmsProvider,he=ee[le];if(he){const Ee=this.validateTlsOptions(le,he);if(Ee)throw Ee;try{await this.setTlsOptions(he,J)}catch(re){throw $(re)}}}let ae;try{if(this.options.proxyOptions&&this.options.proxyOptions.proxyHost){j=new t.Socket;const{promise:re,reject:Ce,resolve:_e}=(0,a.promiseWithResolvers)();j.once("error",nt=>Ce($(nt))).once("close",()=>Ce(K())).once("connect",()=>_e());const He={...J,host:this.options.proxyOptions.proxyHost,port:this.options.proxyOptions.proxyPort||1080};j.connect(He),await re;try{g??(g=m()),J.socket=(await g.SocksClient.createConnection({existing_socket:j,command:"connect",destination:{host:J.host,port:J.port},proxy:{host:"iLoveJavaScript",port:0,type:5,userId:this.options.proxyOptions.proxyUsername,password:this.options.proxyOptions.proxyPassword}})).socket}catch(nt){throw $(nt)}}x=n.connect(J,()=>{x.write(I)});const{promise:le,reject:he,resolve:Ee}=(0,a.promiseWithResolvers)();ae=(0,a.addAbortListener)(F==null?void 0:F.signal,function(){Y(),he(this.reason)}),x.once("error",re=>he($(re))).once("close",()=>he(K())).on("data",re=>{for(N.append(re);y.bytesNeeded>0&&N.length;){const Ce=Math.min(y.bytesNeeded,N.length);y.addResponse(N.read(Ce))}y.bytesNeeded<=0&&Ee()}),await((ye=F==null?void 0:F.timeoutContext)!=null&&ye.csotEnabled()?Promise.all([le,s.Timeout.expires((ce=F.timeoutContext)==null?void 0:ce.remainingTimeMS)]):le)}catch(le){throw le instanceof s.TimeoutError?new h.MongoOperationTimeoutError("KMS request timed out"):le}finally{Y(),ae==null||ae[a.kDispose]()}}*requests(y,F){for(let R=y.nextKMSRequest();R!=null;R=y.nextKMSRequest())yield this.kmsRequest(R,F)}validateTlsOptions(y,F){const R=Object.keys(F);for(const v of c)if(R.includes(v))return new l.MongoCryptError(`Insecure TLS options prohibited for ${y}: ${v}`)}async setTlsOptions(y,F){if(y.secureContext&&(F.secureContext=y.secureContext),y.tlsCertificateKeyFile){const R=await e.readFile(y.tlsCertificateKeyFile);F.cert=F.key=R}y.tlsCAFile&&(F.ca=await e.readFile(y.tlsCAFile)),y.tlsCertificateKeyFilePassword&&(F.passphrase=y.tlsCertificateKeyFilePassword)}fetchCollectionInfo(y,F,R,v){const{db:J}=a.MongoDBCollectionNamespace.fromString(F);return y.db(J).listCollections(R,{promoteLongs:!1,promoteValues:!1,timeoutContext:(v==null?void 0:v.timeoutContext)&&new o.CursorTimeoutContext(v==null?void 0:v.timeoutContext,Symbol()),signal:v==null?void 0:v.signal,nameOnly:!1})}async markCommand(y,F,R,v){var Y;const{db:J}=a.MongoDBCollectionNamespace.fromString(F),I={promoteLongs:!1,promoteValues:!1},N=(0,i.deserialize)(R,I),j={timeoutMS:void 0,signal:void 0};(Y=v==null?void 0:v.timeoutContext)!=null&&Y.csotEnabled()&&(j.timeoutMS=v.timeoutContext.remainingTimeMS),v!=null&&v.signal&&(j.signal=v.signal);const x=await y.db(J).command(N,{...I,...j});return(0,i.serialize)(x,this.bsonOptions)}fetchKeys(y,F,R,v){const{db:J,collection:I}=a.MongoDBCollectionNamespace.fromString(F),N={timeoutContext:void 0,signal:void 0};return(v==null?void 0:v.timeoutContext)!=null&&(N.timeoutContext=new o.CursorTimeoutContext(v.timeoutContext,Symbol())),(v==null?void 0:v.signal)!=null&&(N.signal=v.signal),y.db(J).collection(I,{readConcern:{level:"majority"}}).find((0,i.deserialize)(R),N).toArray()}}return vn.StateMachine=_,vn}var Ua;function pu(){if(Ua)return tn;Ua=1,Object.defineProperty(tn,"__esModule",{value:!0}),tn.ClientEncryption=void 0,tn.autoSelectSocketOptions=s;const e=pe,t=Qe,r=Te,n=ne(),i=Ge,o=gi,u=El();class h{static getMongoCrypt(){const E=(0,t.getMongoDBClientEncryption)();if("kModuleError"in E)throw E.kModuleError;return E.MongoCrypt}constructor(E,l){var S;this._client=E,this._proxyOptions=l.proxyOptions??{},this._tlsOptions=l.tlsOptions??{},this._kmsProviders=l.kmsProviders||{};const{timeoutMS:g}=(0,n.resolveTimeoutOptions)(E,l);if(this._timeoutMS=g,this._credentialProviders=l.credentialProviders,(S=l.credentialProviders)!=null&&S.aws&&!(0,o.isEmptyCredentials)("aws",this._kmsProviders))throw new i.MongoCryptInvalidArgumentError("Can only provide a custom AWS credential provider when the state machine is configured for automatic AWS credential fetching");if(l.keyVaultNamespace==null)throw new i.MongoCryptInvalidArgumentError("Missing required option `keyVaultNamespace`");const m={...l,kmsProviders:Buffer.isBuffer(this._kmsProviders)?this._kmsProviders:(0,e.serialize)(this._kmsProviders),errorWrapper:i.defaultErrorWrapper};this._keyVaultNamespace=l.keyVaultNamespace,this._keyVaultClient=l.keyVaultClient||E;const C=h.getMongoCrypt();this._mongoCrypt=new C(m)}async createDataKey(E,l={}){if(l.keyAltNames&&!Array.isArray(l.keyAltNames))throw new i.MongoCryptInvalidArgumentError(`Option "keyAltNames" must be an array of strings, but was of type ${typeof l.keyAltNames}.`);let g;l.keyAltNames&&l.keyAltNames.length>0&&(g=l.keyAltNames.map((b,f)=>{if(typeof b!="string")throw new i.MongoCryptInvalidArgumentError(`Option "keyAltNames" must be an array of strings, but item at index ${f} was of type ${typeof b}`);return(0,e.serialize)({keyAltName:b})}));let m;l.keyMaterial&&(m=(0,e.serialize)({keyMaterial:l.keyMaterial}));const C=(0,e.serialize)({provider:E,...l.masterKey}),S=this._mongoCrypt.makeDataKeyContext(C,{keyAltNames:g,keyMaterial:m}),D=new u.StateMachine({proxyOptions:this._proxyOptions,tlsOptions:this._tlsOptions,socketOptions:s(this._client.s.options)}),O=(l==null?void 0:l.timeoutContext)??r.TimeoutContext.create((0,n.resolveTimeoutOptions)(this._client,{timeoutMS:this._timeoutMS})),M=(0,e.deserialize)(await D.execute(this,S,{timeoutContext:O})),{db:p,collection:B}=n.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace),{insertedId:d}=await this._keyVaultClient.db(p).collection(B).insertOne(M,{writeConcern:{w:"majority"},timeoutMS:O!=null&&O.csotEnabled()?O==null?void 0:O.getRemainingTimeMSOrThrow():void 0});return d}async rewrapManyDataKey(E,l){let g;if(l){const b=Object.assign({provider:l.provider},l.masterKey);g=(0,e.serialize)(b)}const m=(0,e.serialize)(E),C=this._mongoCrypt.makeRewrapManyDataKeyContext(m,g),S=new u.StateMachine({proxyOptions:this._proxyOptions,tlsOptions:this._tlsOptions,socketOptions:s(this._client.s.options)}),D=r.TimeoutContext.create((0,n.resolveTimeoutOptions)(this._client,{timeoutMS:this._timeoutMS})),{v:O}=(0,e.deserialize)(await S.execute(this,C,{timeoutContext:D}));if(O.length===0)return{};const{db:M,collection:p}=n.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace),B=O.map(b=>({updateOne:{filter:{_id:b._id},update:{$set:{masterKey:b.masterKey,keyMaterial:b.keyMaterial},$currentDate:{updateDate:!0}}}}));return{bulkWriteResult:await this._keyVaultClient.db(M).collection(p).bulkWrite(B,{writeConcern:{w:"majority"},timeoutMS:D.csotEnabled()?D==null?void 0:D.remainingTimeMS:void 0})}}async deleteKey(E){const{db:l,collection:g}=n.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);return await this._keyVaultClient.db(l).collection(g).deleteOne({_id:E},{writeConcern:{w:"majority"},timeoutMS:this._timeoutMS})}getKeys(){const{db:E,collection:l}=n.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);return this._keyVaultClient.db(E).collection(l).find({},{readConcern:{level:"majority"},timeoutMS:this._timeoutMS})}async getKey(E){const{db:l,collection:g}=n.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);return await this._keyVaultClient.db(l).collection(g).findOne({_id:E},{readConcern:{level:"majority"},timeoutMS:this._timeoutMS})}async getKeyByAltName(E){const{db:l,collection:g}=n.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);return await this._keyVaultClient.db(l).collection(g).findOne({keyAltNames:E},{readConcern:{level:"majority"},timeoutMS:this._timeoutMS})}async addKeyAltName(E,l){const{db:g,collection:m}=n.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);return await this._keyVaultClient.db(g).collection(m).findOneAndUpdate({_id:E},{$addToSet:{keyAltNames:l}},{writeConcern:{w:"majority"},returnDocument:"before",timeoutMS:this._timeoutMS})}async removeKeyAltName(E,l){const{db:g,collection:m}=n.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace),C=[{$set:{keyAltNames:{$cond:[{$eq:["$keyAltNames",[l]]},"$$REMOVE",{$filter:{input:"$keyAltNames",cond:{$ne:["$$this",l]}}}]}}}];return await this._keyVaultClient.db(g).collection(m).findOneAndUpdate({_id:E},C,{writeConcern:{w:"majority"},returnDocument:"before",timeoutMS:this._timeoutMS})}async createEncryptedCollection(E,l,g){const{provider:m,masterKey:C,createCollectionOptions:{encryptedFields:{...S},...D}}=g,O=this._timeoutMS!=null?r.TimeoutContext.create((0,n.resolveTimeoutOptions)(this._client,{timeoutMS:this._timeoutMS})):void 0;if(Array.isArray(S.fields)){const M=S.fields.map(async d=>d==null||typeof d!="object"||d.keyId!=null?d:{...d,keyId:await this.createDataKey(m,{masterKey:C,timeoutContext:O!=null&&O.csotEnabled()?O==null?void 0:O.clone():void 0})}),p=await Promise.allSettled(M);S.fields=p.map((d,b)=>d.status==="fulfilled"?d.value:S.fields[b]);const B=p.find(d=>d.status==="rejected");if(B!=null)throw new i.MongoCryptCreateDataKeyError(S,{cause:B.reason})}try{return{collection:await E.createCollection(l,{...D,encryptedFields:S,timeoutMS:O!=null&&O.csotEnabled()?O==null?void 0:O.getRemainingTimeMSOrThrow():void 0}),encryptedFields:S}}catch(M){throw new i.MongoCryptCreateEncryptedCollectionError(S,{cause:M})}}async encrypt(E,l){return await this._encrypt(E,!1,l)}async encryptExpression(E,l){return await this._encrypt(E,!0,l)}async decrypt(E){const l=(0,e.serialize)({v:E}),g=this._mongoCrypt.makeExplicitDecryptionContext(l),m=new u.StateMachine({proxyOptions:this._proxyOptions,tlsOptions:this._tlsOptions,socketOptions:s(this._client.s.options)}),C=this._timeoutMS!=null?r.TimeoutContext.create((0,n.resolveTimeoutOptions)(this._client,{timeoutMS:this._timeoutMS})):void 0,{v:S}=(0,e.deserialize)(await m.execute(this,g,{timeoutContext:C}));return S}async askForKMSCredentials(){return await(0,o.refreshKMSCredentials)(this._kmsProviders,this._credentialProviders)}static get libmongocryptVersion(){return h.getMongoCrypt().libmongocryptVersion}async _encrypt(E,l,g){const{algorithm:m,keyId:C,keyAltName:S,contentionFactor:D,queryType:O,rangeOptions:M,textOptions:p}=g,B={expressionMode:l,algorithm:m};if(C&&(B.keyId=C.buffer),S){if(C)throw new i.MongoCryptInvalidArgumentError('"options" cannot contain both "keyId" and "keyAltName"');if(typeof S!="string")throw new i.MongoCryptInvalidArgumentError(`"options.keyAltName" must be of type string, but was of type ${typeof S}`);B.keyAltName=(0,e.serialize)({keyAltName:S})}(typeof D=="number"||typeof D=="bigint")&&(B.contentionFactor=D),typeof O=="string"&&(B.queryType=O),typeof M=="object"&&(B.rangeOptions=(0,e.serialize)(M)),typeof p=="object"&&(B.textOptions=(0,e.serialize)(p));const d=(0,e.serialize)({v:E}),b=new u.StateMachine({proxyOptions:this._proxyOptions,tlsOptions:this._tlsOptions,socketOptions:s(this._client.s.options)}),f=this._mongoCrypt.makeExplicitEncryptionContext(d,B),c=this._timeoutMS!=null?r.TimeoutContext.create((0,n.resolveTimeoutOptions)(this._client,{timeoutMS:this._timeoutMS})):void 0,{v:w}=(0,e.deserialize)(await b.execute(this,f,{timeoutContext:c}));return w}}tn.ClientEncryption=h;function s(a){const E={autoSelectFamily:!0};return"autoSelectFamily"in a&&(E.autoSelectFamily=a.autoSelectFamily),"autoSelectFamilyAttemptTimeout"in a&&(E.autoSelectFamilyAttemptTimeout=a.autoSelectFamilyAttemptTimeout),E}return tn}var ko={};Object.defineProperty(ko,"__esModule",{value:!0});ko.MongocryptdManager=void 0;const p6=Q,so=class so{constructor(t={}){this.spawnPath="",this.spawnArgs=[],this.uri=typeof t.mongocryptdURI=="string"&&t.mongocryptdURI.length>0?t.mongocryptdURI:so.DEFAULT_MONGOCRYPTD_URI,this.bypassSpawn=!!t.mongocryptdBypassSpawn,Object.hasOwn(t,"mongocryptdSpawnPath")&&t.mongocryptdSpawnPath&&(this.spawnPath=t.mongocryptdSpawnPath),Object.hasOwn(t,"mongocryptdSpawnArgs")&&Array.isArray(t.mongocryptdSpawnArgs)&&(this.spawnArgs=this.spawnArgs.concat(t.mongocryptdSpawnArgs)),this.spawnArgs.filter(r=>typeof r=="string").every(r=>r.indexOf("--idleShutdownTimeoutSecs")<0)&&this.spawnArgs.push("--idleShutdownTimeoutSecs","60")}async spawn(){const t=this.spawnPath||"mongocryptd",{spawn:r}=n2;this._child=r(t,this.spawnArgs,{stdio:"ignore",detached:!0}),this._child.on("error",()=>{}),this._child.unref()}async withRespawn(t){try{return await t()}catch(n){if(!(n instanceof p6.MongoNetworkTimeoutError&&!this.bypassSpawn))throw n}return await this.spawn(),await t()}};so.DEFAULT_MONGOCRYPTD_URI="mongodb://localhost:27020";let g1=so;ko.MongocryptdManager=g1;var ja;function gl(){if(ja)return _r;ja=1;var e;Object.defineProperty(_r,"__esModule",{value:!0}),_r.AutoEncrypter=_r.AutoEncryptionLoggerLevel=void 0;const t=B1,r=pe,n=Ve,i=Qe,o=Q,u=En(),h=ne(),s=pu(),a=Ge,E=ko,l=gi,g=El();_r.AutoEncryptionLoggerLevel=Object.freeze({FatalError:0,Error:1,Warning:2,Info:3,Trace:4});const C=class C{static getMongoCrypt(){const D=(0,i.getMongoDBClientEncryption)();if("kModuleError"in D)throw D.kModuleError;return D.MongoCrypt}constructor(D,O){var B,d,b;if(this[e]=!1,this._client=D,this._bypassEncryption=O.bypassAutoEncryption===!0,this._keyVaultNamespace=O.keyVaultNamespace||"admin.datakeys",this._keyVaultClient=O.keyVaultClient||D,this._metaDataClient=O.metadataClient||D,this._proxyOptions=O.proxyOptions||{},this._tlsOptions=O.tlsOptions||{},this._kmsProviders=O.kmsProviders||{},this._credentialProviders=O.credentialProviders,(B=O.credentialProviders)!=null&&B.aws&&!(0,l.isEmptyCredentials)("aws",this._kmsProviders))throw new a.MongoCryptInvalidArgumentError("Can only provide a custom AWS credential provider when the state machine is configured for automatic AWS credential fetching");const M={errorWrapper:a.defaultErrorWrapper};O.schemaMap&&(M.schemaMap=Buffer.isBuffer(O.schemaMap)?O.schemaMap:(0,r.serialize)(O.schemaMap)),O.encryptedFieldsMap&&(M.encryptedFieldsMap=Buffer.isBuffer(O.encryptedFieldsMap)?O.encryptedFieldsMap:(0,r.serialize)(O.encryptedFieldsMap)),M.kmsProviders=Buffer.isBuffer(this._kmsProviders)?this._kmsProviders:(0,r.serialize)(this._kmsProviders),(d=O.options)!=null&&d.logger&&(M.logger=O.options.logger),O.extraOptions&&O.extraOptions.cryptSharedLibPath&&(M.cryptSharedLibPath=O.extraOptions.cryptSharedLibPath),O.bypassQueryAnalysis&&(M.bypassQueryAnalysis=O.bypassQueryAnalysis),O.keyExpirationMS!=null&&(M.keyExpirationMS=O.keyExpirationMS),this._bypassMongocryptdAndCryptShared=this._bypassEncryption||!!O.bypassQueryAnalysis,O.extraOptions&&O.extraOptions.cryptSharedLibSearchPaths?M.cryptSharedLibSearchPaths=O.extraOptions.cryptSharedLibSearchPaths:this._bypassMongocryptdAndCryptShared||(M.cryptSharedLibSearchPaths=["$SYSTEM"]);const p=C.getMongoCrypt();if(this._mongocrypt=new p(M),this._contextCounter=0,O.extraOptions&&O.extraOptions.cryptSharedLibRequired&&!this.cryptSharedLibVersionInfo)throw new a.MongoCryptInvalidArgumentError("`cryptSharedLibRequired` set but no crypt_shared library loaded");if(!this._bypassMongocryptdAndCryptShared&&!this.cryptSharedLibVersionInfo){this._mongocryptdManager=new E.MongocryptdManager(O.extraOptions);const f={serverSelectionTimeoutMS:1e4};(O.extraOptions==null||typeof O.extraOptions.mongocryptdURI!="string")&&!t.getDefaultAutoSelectFamily&&(f.family=4),t.getDefaultAutoSelectFamily&&Object.assign(f,(0,s.autoSelectSocketOptions)(((b=this._client.s)==null?void 0:b.options)??{})),this._mongocryptdClient=new u.MongoClient(this._mongocryptdManager.uri,f)}}async init(){if(!(this._bypassMongocryptdAndCryptShared||this.cryptSharedLibVersionInfo)){if(!this._mongocryptdManager)throw new o.MongoRuntimeError("Reached impossible state: mongocryptdManager is undefined when neither bypassSpawn nor the shared lib are specified.");if(!this._mongocryptdClient)throw new o.MongoRuntimeError("Reached impossible state: mongocryptdClient is undefined when neither bypassSpawn nor the shared lib are specified.");this._mongocryptdManager.bypassSpawn||await this._mongocryptdManager.spawn();try{return await this._mongocryptdClient.connect()}catch(D){throw new o.MongoRuntimeError("Unable to connect to `mongocryptd`, please make sure it is running or in your PATH for auto-spawn",{cause:D})}}}async close(){var D;await((D=this._mongocryptdClient)==null?void 0:D.close())}async encrypt(D,O,M={}){var b;if((b=M.signal)==null||b.throwIfAborted(),this._bypassEncryption)return O;const p=Buffer.isBuffer(O)?O:(0,r.serialize)(O,M),B=this._mongocrypt.makeEncryptionContext(h.MongoDBCollectionNamespace.fromString(D).db,p);B.id=this._contextCounter++,B.ns=D,B.document=O;const d=new g.StateMachine({promoteValues:!1,promoteLongs:!1,proxyOptions:this._proxyOptions,tlsOptions:this._tlsOptions,socketOptions:(0,s.autoSelectSocketOptions)(this._client.s.options)});return(0,r.deserialize)(await d.execute(this,B,M),{promoteValues:!1,promoteLongs:!1})}async decrypt(D,O={}){var B;(B=O.signal)==null||B.throwIfAborted();const M=this._mongocrypt.makeDecryptionContext(D);return M.id=this._contextCounter++,await new g.StateMachine({...O,proxyOptions:this._proxyOptions,tlsOptions:this._tlsOptions,socketOptions:(0,s.autoSelectSocketOptions)(this._client.s.options)}).execute(this,M,O)}async askForKMSCredentials(){return await(0,l.refreshKMSCredentials)(this._kmsProviders,this._credentialProviders)}get cryptSharedLibVersionInfo(){return this._mongocrypt.cryptSharedLibVersionInfo}static get libmongocryptVersion(){return C.getMongoCrypt().libmongocryptVersion}};e=n.kDecorateResult;let m=C;return _r.AutoEncrypter=m,_r}var xa;function C6(){if(xa)return In;xa=1,Object.defineProperty(In,"__esModule",{value:!0}),In.Encrypter=void 0;const e=gl(),t=Ve,r=Qe,n=Q,i=En();class o{constructor(h,s,a){if(typeof a.autoEncryption!="object")throw new n.MongoInvalidArgumentError('Option "autoEncryption" must be specified');this.internalClient=null,this.bypassAutoEncryption=!!a.autoEncryption.bypassAutoEncryption,this.needsConnecting=!1,a.maxPoolSize===0&&a.autoEncryption.keyVaultClient==null?a.autoEncryption.keyVaultClient=h:a.autoEncryption.keyVaultClient==null&&(a.autoEncryption.keyVaultClient=this.getInternalClient(h,s,a)),this.bypassAutoEncryption?a.autoEncryption.metadataClient=void 0:a.maxPoolSize===0?a.autoEncryption.metadataClient=h:a.autoEncryption.metadataClient=this.getInternalClient(h,s,a),a.proxyHost&&(a.autoEncryption.proxyOptions={proxyHost:a.proxyHost,proxyPort:a.proxyPort,proxyUsername:a.proxyUsername,proxyPassword:a.proxyPassword}),this.autoEncrypter=new e.AutoEncrypter(h,a.autoEncryption)}getInternalClient(h,s,a){let E=this.internalClient;if(E==null){const l={};for(const g of[...Object.getOwnPropertyNames(a),...Object.getOwnPropertySymbols(a)])["autoEncryption","minPoolSize","servers","caseTranslate","dbName"].includes(g)||Reflect.set(l,g,Reflect.get(a,g));l.minPoolSize=0,E=new i.MongoClient(s,l),this.internalClient=E;for(const g of t.MONGO_CLIENT_EVENTS)for(const m of h.listeners(g))E.on(g,m);h.on("newListener",(g,m)=>{E==null||E.on(g,m)}),this.needsConnecting=!0}return E}async connectInternalClient(){const h=this.internalClient;this.needsConnecting&&h!=null&&(this.needsConnecting=!1,await h.connect())}async close(h){let s;try{await this.autoEncrypter.close()}catch(E){s=E}const a=this.internalClient;if(a!=null&&h!==a)return await a.close();if(s!=null)throw s}static checkForMongoCrypt(){const h=(0,r.getMongoDBClientEncryption)();if("kModuleError"in h)throw new n.MongoMissingDependencyError("Auto-encryption requested, but the module is not installed. Please add `mongodb-client-encryption` as a dependency of your project",{cause:h.kModuleError,dependencyName:"mongodb-client-encryption"})}}return In.Encrypter=o,In}var Js={},Cu={},It={},Su={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SENSITIVE_COMMANDS=e.CommandFailedEvent=e.CommandSucceededEvent=e.CommandStartedEvent=void 0;const t=Ve,r=ne(),n=Po();class i{constructor(O,M,p){this.name=t.COMMAND_STARTED;const B=m(M),d=s(B),{address:b,connectionId:f,serviceId:c}=S(O);e.SENSITIVE_COMMANDS.has(d)&&(this.commandObj={},this.commandObj[d]=!0),this.address=b,this.connectionId=f,this.serviceId=c,this.requestId=M.requestId,this.databaseName=M.databaseName,this.commandName=d,this.command=E(d,B,B),this.serverConnectionId=p}get hasServiceId(){return!!this.serviceId}}e.CommandStartedEvent=i;class o{constructor(O,M,p,B,d){this.name=t.COMMAND_SUCCEEDED;const b=m(M),f=s(b),{address:c,connectionId:w,serviceId:T}=S(O);this.address=c,this.connectionId=w,this.serviceId=T,this.requestId=M.requestId,this.commandName=f,this.duration=(0,r.calculateDurationInMs)(B),this.reply=E(f,b,C(p)),this.serverConnectionId=d,this.databaseName=M.databaseName}get hasServiceId(){return!!this.serviceId}}e.CommandSucceededEvent=o;class u{constructor(O,M,p,B,d){this.name=t.COMMAND_FAILED;const b=m(M),f=s(b),{address:c,connectionId:w,serviceId:T}=S(O);this.address=c,this.connectionId=w,this.serviceId=T,this.requestId=M.requestId,this.commandName=f,this.duration=(0,r.calculateDurationInMs)(B),this.failure=E(f,b,p),this.serverConnectionId=d,this.databaseName=M.databaseName}get hasServiceId(){return!!this.serviceId}}e.CommandFailedEvent=u,e.SENSITIVE_COMMANDS=new Set(["authenticate","saslStart","saslContinue","getnonce","createUser","updateUser","copydbgetnonce","copydbsaslstart","copydb"]);const h=new Set(["hello",t.LEGACY_HELLO_COMMAND,t.LEGACY_HELLO_COMMAND_CAMEL_CASE]),s=D=>Object.keys(D)[0],a=D=>D.ns.split(".")[1],E=(D,O,M)=>e.SENSITIVE_COMMANDS.has(D)||h.has(D)&&O.speculativeAuthenticate?{}:M,l={$query:"filter",$orderby:"sort",$hint:"hint",$comment:"comment",$maxScan:"maxScan",$max:"max",$min:"min",$returnKey:"returnKey",$showDiskLoc:"showRecordId",$maxTimeMS:"maxTimeMS",$snapshot:"snapshot"},g={numberToSkip:"skip",numberToReturn:"batchSize",returnFieldSelector:"projection"};function m(D){var p;if(D instanceof n.OpMsgRequest){const B={...D.command};return B.ops instanceof n.DocumentSequence&&(B.ops=B.ops.documents),B.nsInfo instanceof n.DocumentSequence&&(B.nsInfo=B.nsInfo.documents),B}if((p=D.query)!=null&&p.$query){let B;return D.ns==="admin.$cmd"?B=Object.assign({},D.query.$query):(B={find:a(D)},Object.keys(l).forEach(d=>{D.query[d]!=null&&(B[l[d]]={...D.query[d]})})),Object.keys(g).forEach(d=>{const b=d;D[b]!=null&&(B[g[b]]=D[b])}),B}let O={};const M={...D};return D.query&&(O={...D.query},M.query=O),D.query?O:M}function C(D){return D&&(D.result?D.result:D)}function S(D){let O;return"id"in D&&(O=D.id),{address:D.address,serviceId:D.serviceId,connectionId:O}}})(Su);var Uo={},nr={};Object.defineProperty(nr,"__esModule",{value:!0});nr.ServerDescription=void 0;nr.parseServerType=Al;nr.compareTopologyVersion=pl;const rn=pe,S6=Q,nn=ne(),We=Ne,y6=new Set([We.ServerType.RSPrimary,We.ServerType.Standalone,We.ServerType.Mongos,We.ServerType.LoadBalancer]),O6=new Set([We.ServerType.RSPrimary,We.ServerType.RSSecondary,We.ServerType.Mongos,We.ServerType.Standalone,We.ServerType.LoadBalancer]);class w6{constructor(t,r,n={}){var i,o,u,h,s,a,E;if(t==null||t==="")throw new S6.MongoRuntimeError("ServerDescription must be provided with a non-empty address");this.address=typeof t=="string"?nn.HostAddress.fromString(t).toString():t.toString(),this.type=Al(r,n),this.hosts=((i=r==null?void 0:r.hosts)==null?void 0:i.map(l=>l.toLowerCase()))??[],this.passives=((o=r==null?void 0:r.passives)==null?void 0:o.map(l=>l.toLowerCase()))??[],this.arbiters=((u=r==null?void 0:r.arbiters)==null?void 0:u.map(l=>l.toLowerCase()))??[],this.tags=(r==null?void 0:r.tags)??{},this.minWireVersion=(r==null?void 0:r.minWireVersion)??0,this.maxWireVersion=(r==null?void 0:r.maxWireVersion)??0,this.roundTripTime=(n==null?void 0:n.roundTripTime)??-1,this.minRoundTripTime=(n==null?void 0:n.minRoundTripTime)??0,this.lastUpdateTime=(0,nn.processTimeMS)(),this.lastWriteDate=((h=r==null?void 0:r.lastWrite)==null?void 0:h.lastWriteDate)??0,this.error=n.error??null,(s=this.error)==null||s.stack,this.topologyVersion=((a=this.error)==null?void 0:a.topologyVersion)??(r==null?void 0:r.topologyVersion)??null,this.setName=(r==null?void 0:r.setName)??null,this.setVersion=(r==null?void 0:r.setVersion)??null,this.electionId=(r==null?void 0:r.electionId)??null,this.logicalSessionTimeoutMinutes=(r==null?void 0:r.logicalSessionTimeoutMinutes)??null,this.maxMessageSizeBytes=(r==null?void 0:r.maxMessageSizeBytes)??null,this.maxWriteBatchSize=(r==null?void 0:r.maxWriteBatchSize)??null,this.maxBsonObjectSize=(r==null?void 0:r.maxBsonObjectSize)??null,this.primary=(r==null?void 0:r.primary)??null,this.me=((E=r==null?void 0:r.me)==null?void 0:E.toLowerCase())??null,this.$clusterTime=(r==null?void 0:r.$clusterTime)??null,this.iscryptd=!!(r!=null&&r.iscryptd)}get hostAddress(){return nn.HostAddress.fromString(this.address)}get allHosts(){return this.hosts.concat(this.arbiters).concat(this.passives)}get isReadable(){return this.type===We.ServerType.RSSecondary||this.isWritable}get isDataBearing(){return O6.has(this.type)}get isWritable(){return y6.has(this.type)}get host(){const t=`:${this.port}`.length;return this.address.slice(0,-t)}get port(){const t=this.address.split(":").pop();return t?Number.parseInt(t,10):27017}equals(t){const r=this.topologyVersion===(t==null?void 0:t.topologyVersion)||pl(this.topologyVersion,t==null?void 0:t.topologyVersion)===0,n=this.electionId!=null&&(t==null?void 0:t.electionId)!=null?(0,nn.compareObjectId)(this.electionId,t.electionId)===0:this.electionId===(t==null?void 0:t.electionId);return t!=null&&t.iscryptd===this.iscryptd&&(0,nn.errorStrictEqual)(this.error,t.error)&&this.type===t.type&&this.minWireVersion===t.minWireVersion&&(0,nn.arrayStrictEqual)(this.hosts,t.hosts)&&_6(this.tags,t.tags)&&this.setName===t.setName&&this.setVersion===t.setVersion&&n&&this.primary===t.primary&&this.logicalSessionTimeoutMinutes===t.logicalSessionTimeoutMinutes&&r}}nr.ServerDescription=w6;function Al(e,t){return t!=null&&t.loadBalanced?We.ServerType.LoadBalancer:!e||!e.ok?We.ServerType.Unknown:e.isreplicaset?We.ServerType.RSGhost:e.msg&&e.msg==="isdbgrid"?We.ServerType.Mongos:e.setName?e.hidden?We.ServerType.RSOther:e.isWritablePrimary?We.ServerType.RSPrimary:e.secondary?We.ServerType.RSSecondary:e.arbiterOnly?We.ServerType.RSArbiter:We.ServerType.RSOther:We.ServerType.Standalone}function _6(e,t){const r=Object.keys(e),n=Object.keys(t);return r.length===n.length&&r.every(i=>t[i]===e[i])}function pl(e,t){if(e==null||t==null||!e.processId.equals(t.processId))return-1;const r=typeof e.counter=="bigint"?rn.Long.fromBigInt(e.counter):rn.Long.isLong(e.counter)?e.counter:rn.Long.fromNumber(e.counter),n=typeof t.counter=="bigint"?rn.Long.fromBigInt(t.counter):rn.Long.isLong(t.counter)?t.counter:rn.Long.fromNumber(t.counter);return r.compare(n)}Object.defineProperty(Uo,"__esModule",{value:!0});Uo.StreamDescription=void 0;const D6=pe,T6=Ne,B6=nr,b6=["minWireVersion","maxWireVersion","maxBsonObjectSize","maxMessageSizeBytes","maxWriteBatchSize","logicalSessionTimeoutMinutes"];class M6{constructor(t,r){this.hello=null,this.address=t,this.type=T6.ServerType.Unknown,this.minWireVersion=void 0,this.maxWireVersion=void 0,this.maxBsonObjectSize=16777216,this.maxMessageSizeBytes=48e6,this.maxWriteBatchSize=1e5,this.logicalSessionTimeoutMinutes=r==null?void 0:r.logicalSessionTimeoutMinutes,this.loadBalanced=!!(r!=null&&r.loadBalanced),this.compressors=r&&r.compressors&&Array.isArray(r.compressors)?r.compressors:[],this.serverConnectionId=null}receiveResponse(t){if(t!=null){this.hello=t,this.type=(0,B6.parseServerType)(t),"connectionId"in t?this.serverConnectionId=this.parseServerConnectionID(t.connectionId):this.serverConnectionId=null;for(const r of b6)t[r]!=null&&(this[r]=t[r]),"__nodejs_mock_server__"in t&&(this.__nodejs_mock_server__=t.__nodejs_mock_server__);t.compression&&(this.compressor=this.compressors.filter(r=>{var n;return(n=t.compression)==null?void 0:n.includes(r)})[0])}}parseServerConnectionID(t){return D6.Long.isLong(t)?t.toBigInt():BigInt(t)}}Uo.StreamDescription=M6;var yu={};Object.defineProperty(yu,"__esModule",{value:!0});yu.onData=F6;const Pn=ne();function F6(e,{timeoutContext:t,signal:r}){r==null||r.throwIfAborted();const n=new Pn.List,i=new Pn.List;let o=null,u=!1;const h={next(){const m=n.shift();if(m!=null)return Promise.resolve({value:m,done:!1});if(o!=null){const O=Promise.reject(o);return o=null,O}if(u)return g();const{promise:C,resolve:S,reject:D}=(0,Pn.promiseWithResolvers)();return i.push({resolve:S,reject:D}),C},return(){return g()},throw(m){return l(m),Promise.resolve({value:void 0,done:!0})},[Symbol.asyncIterator](){return this},async[Symbol.asyncDispose](){await g()}};e.on("data",E),e.on("error",l);const s=(0,Pn.addAbortListener)(r,function(){l(this.reason)}),a=t==null?void 0:t.timeoutForSocketRead;return a==null||a.throwIfExpired(),a==null||a.then(void 0,l),h;function E(m){const C=i.shift();C!=null?C.resolve({value:m,done:!1}):n.push(m)}function l(m){const C=i.shift();C!=null?C.reject(m):o=m,g()}function g(){e.off("data",E),e.off("error",l),s==null||s[Pn.kDispose](),u=!0,a==null||a.clear();const m={value:void 0,done:u};for(const C of i)C.resolve(m);return Promise.resolve(m)}}var jo={},pi={};Object.defineProperty(pi,"__esModule",{value:!0});pi.TopologyDescription=void 0;const R6=pe,xo=fe,Hi=Q,A1=ne(),Ae=Ne,mr=nr,N6=xo.MIN_SUPPORTED_SERVER_VERSION,I6=xo.MAX_SUPPORTED_SERVER_VERSION,za=xo.MIN_SUPPORTED_WIRE_VERSION,Va=xo.MAX_SUPPORTED_WIRE_VERSION,v6=new Set([Ae.ServerType.Mongos,Ae.ServerType.Unknown]),Wa=new Set([Ae.ServerType.Mongos,Ae.ServerType.Standalone]),Ga=new Set([Ae.ServerType.RSSecondary,Ae.ServerType.RSArbiter,Ae.ServerType.RSOther]);class Gn{constructor(t,r=null,n=null,i=null,o=null,u=null,h=null){h=h??{},this.type=t??Ae.TopologyType.Unknown,this.servers=r??new Map,this.stale=!1,this.compatible=!0,this.heartbeatFrequencyMS=h.heartbeatFrequencyMS??0,this.localThresholdMS=h.localThresholdMS??15,this.setName=n??null,this.maxElectionId=o??null,this.maxSetVersion=i??null,this.commonWireVersion=u??0;for(const s of this.servers.values())if(!(s.type===Ae.ServerType.Unknown||s.type===Ae.ServerType.LoadBalancer)&&(s.minWireVersion>Va&&(this.compatible=!1,this.compatibilityError=`Server at ${s.address} requires wire version ${s.minWireVersion}, but this version of the driver only supports up to ${Va} (MongoDB ${I6})`),s.maxWireVersion<za)){this.compatible=!1,this.compatibilityError=`Server at ${s.address} reports wire version ${s.maxWireVersion}, but this version of the driver requires at least ${za} (MongoDB ${N6}).`;break}this.logicalSessionTimeoutMinutes=null;for(const[,s]of this.servers)if(s.isReadable){if(s.logicalSessionTimeoutMinutes==null){this.logicalSessionTimeoutMinutes=null;break}if(this.logicalSessionTimeoutMinutes==null){this.logicalSessionTimeoutMinutes=s.logicalSessionTimeoutMinutes;continue}this.logicalSessionTimeoutMinutes=Math.min(this.logicalSessionTimeoutMinutes,s.logicalSessionTimeoutMinutes)}}updateFromSrvPollingEvent(t,r=0){const n=t.hostnames(),i=new Set(this.servers.keys()),o=new Set(n),u=new Set;for(const s of i)o.delete(s),n.has(s)||u.add(s);if(o.size===0&&u.size===0)return this;const h=new Map(this.servers);for(const s of u)h.delete(s);if(o.size>0){if(r===0)for(const s of o)h.set(s,new mr.ServerDescription(s));else if(h.size<r){const s=(0,A1.shuffle)(o,r-h.size);for(const a of s)h.set(a,new mr.ServerDescription(a))}}return new Gn(this.type,h,this.setName,this.maxSetVersion,this.maxElectionId,this.commonWireVersion,{heartbeatFrequencyMS:this.heartbeatFrequencyMS,localThresholdMS:this.localThresholdMS})}update(t){const r=t.address;let{type:n,setName:i,maxSetVersion:o,maxElectionId:u,commonWireVersion:h}=this;const s=t.type,a=new Map(this.servers);if(t.maxWireVersion!==0&&(h===0?h=t.maxWireVersion:h=Math.min(h,t.maxWireVersion)),typeof t.setName=="string"&&typeof i=="string"&&t.setName!==i&&(n===Ae.TopologyType.Single?t=new mr.ServerDescription(r):a.delete(r)),a.set(r,t),n===Ae.TopologyType.Single)return new Gn(Ae.TopologyType.Single,a,i,o,u,h,{heartbeatFrequencyMS:this.heartbeatFrequencyMS,localThresholdMS:this.localThresholdMS});if(n===Ae.TopologyType.Unknown&&(s===Ae.ServerType.Standalone&&this.servers.size!==1?a.delete(r):n=P6(s)),n===Ae.TopologyType.Sharded&&(v6.has(s)||a.delete(r)),n===Ae.TopologyType.ReplicaSetNoPrimary){if(Wa.has(s)&&a.delete(r),s===Ae.ServerType.RSPrimary){const E=qa(a,t,i,o,u);n=E[0],i=E[1],o=E[2],u=E[3]}else if(Ga.has(s)){const E=k6(a,t,i);n=E[0],i=E[1]}}if(n===Ae.TopologyType.ReplicaSetWithPrimary)if(Wa.has(s))a.delete(r),n=Fr(a);else if(s===Ae.ServerType.RSPrimary){const E=qa(a,t,i,o,u);n=E[0],i=E[1],o=E[2],u=E[3]}else Ga.has(s)?n=L6(a,t,i):n=Fr(a);return new Gn(n,a,i,o,u,h,{heartbeatFrequencyMS:this.heartbeatFrequencyMS,localThresholdMS:this.localThresholdMS})}get error(){const t=Array.from(this.servers.values()).filter(r=>r.error);return t.length>0?t[0].error:null}get hasKnownServers(){return Array.from(this.servers.values()).some(t=>t.type!==Ae.ServerType.Unknown)}get hasDataBearingServers(){return Array.from(this.servers.values()).some(t=>t.isDataBearing)}hasServer(t){return this.servers.has(t)}toJSON(){return R6.EJSON.serialize(this)}}pi.TopologyDescription=Gn;function P6(e){switch(e){case Ae.ServerType.Standalone:return Ae.TopologyType.Single;case Ae.ServerType.Mongos:return Ae.TopologyType.Sharded;case Ae.ServerType.RSPrimary:return Ae.TopologyType.ReplicaSetWithPrimary;case Ae.ServerType.RSOther:case Ae.ServerType.RSSecondary:return Ae.TopologyType.ReplicaSetNoPrimary;default:return Ae.TopologyType.Unknown}}function qa(e,t,r=null,n=null,i=null){const o=(s,a,E)=>`primary marked stale due to electionId/setVersion mismatch: server setVersion: ${s.setVersion}, server electionId: ${s.electionId}, topology setVersion: ${a}, topology electionId: ${E}`;if(r=r||t.setName,r!==t.setName)return e.delete(t.address),[Fr(e),r,n,i];if(t.maxWireVersion>=17){const s=(0,A1.compareObjectId)(i,t.electionId),a=s===0,E=s===-1,l=(n??-1)<=(t.setVersion??-1);if(E||a&&l)i=t.electionId,n=t.setVersion;else return e.set(t.address,new mr.ServerDescription(t.address,void 0,{error:new Hi.MongoStalePrimaryError(o(t,n,i))})),[Fr(e),r,n,i]}else{const s=t.electionId?t.electionId:null;if(t.setVersion&&s){if(n&&i&&(n>t.setVersion||(0,A1.compareObjectId)(i,s)>0))return e.set(t.address,new mr.ServerDescription(t.address,void 0,{error:new Hi.MongoStalePrimaryError(o(t,n,i))})),[Fr(e),r,n,i];i=t.electionId}t.setVersion!=null&&(n==null||t.setVersion>n)&&(n=t.setVersion)}for(const[s,a]of e)if(a.type===Ae.ServerType.RSPrimary&&a.address!==t.address){e.set(s,new mr.ServerDescription(a.address,void 0,{error:new Hi.MongoStalePrimaryError("primary marked stale due to discovery of newer primary")}));break}t.allHosts.forEach(s=>{e.has(s)||e.set(s,new mr.ServerDescription(s))});const u=Array.from(e.keys()),h=t.allHosts;return u.filter(s=>h.indexOf(s)===-1).forEach(s=>{e.delete(s)}),[Fr(e),r,n,i]}function L6(e,t,r=null){if(r==null)throw new Hi.MongoRuntimeError('Argument "setName" is required if connected to a replica set');return(r!==t.setName||t.me&&t.address!==t.me)&&e.delete(t.address),Fr(e)}function k6(e,t,r=null){const n=Ae.TopologyType.ReplicaSetNoPrimary;return r=r??t.setName,r!==t.setName?(e.delete(t.address),[n,r]):(t.allHosts.forEach(i=>{e.has(i)||e.set(i,new mr.ServerDescription(i))}),t.me&&t.address!==t.me&&e.delete(t.address),[n,r])}function Fr(e){for(const t of e.values())if(t.type===Ae.ServerType.RSPrimary)return Ae.TopologyType.ReplicaSetWithPrimary;return Ae.TopologyType.ReplicaSetNoPrimary}Object.defineProperty(jo,"__esModule",{value:!0});jo.getReadPreference=x6;jo.isSharded=z6;const U6=Q,Qs=Ke,Ha=Ne,j6=pi;function x6(e){let t=(e==null?void 0:e.readPreference)??Qs.ReadPreference.primary;if(typeof t=="string"&&(t=Qs.ReadPreference.fromString(t)),!(t instanceof Qs.ReadPreference))throw new U6.MongoInvalidArgumentError('Option "readPreference" must be a ReadPreference instance');return t}function z6(e){return e==null?!1:e.description&&e.description.type===Ha.ServerType.Mongos?!0:e.description&&e.description instanceof j6.TopologyDescription?Array.from(e.description.servers.values()).some(r=>r.type===Ha.ServerType.Mongos):!1}Object.defineProperty(It,"__esModule",{value:!0});It.CryptoConnection=It.SizedMessageTransform=It.Connection=void 0;It.hasSessionSupport=J6;const V6=ao,Cl=gn,W6=pe,ur=Ve,ve=Q,Ka=Cr,G6=Je,q6=Ke,H6=Ne,Ya=ut,Xa=Te,ht=ne(),Zs=Su,Li=Po(),K6=Uo,Y6=Lo(),X6=yu,qn=De(),$s=jo;function J6(e){return e.description.logicalSessionTimeoutMinutes!=null}function Q6(e,t){if(t.proxyHost)return t.hostAddress.toString();const{remoteAddress:r,remotePort:n}=e;return typeof r=="string"&&typeof n=="number"?ht.HostAddress.fromHostPort(r,n).toString():(0,ht.uuidV4)().toString("hex")}const Ze=class Ze extends G6.TypedEventEmitter{constructor(t,r){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",ht.noop),this.socket=t,this.id=r.id,this.address=Q6(t,r),this.socketTimeoutMS=r.socketTimeoutMS??0,this.monitorCommands=r.monitorCommands,this.serverApi=r.serverApi,this.mongoLogger=r.mongoLogger,this.established=!1,this.description=new K6.StreamDescription(this.address,r),this.generation=r.generation,this.lastUseTime=(0,ht.processTimeMS)(),this.messageStream=this.socket.on("error",this.onSocketError.bind(this)).pipe(new Sl({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(t){this.description.receiveResponse(t),Object.freeze(this.description)}get serviceId(){var t;return(t=this.hello)==null?void 0:t.serviceId}get loadBalanced(){return this.description.loadBalanced}get idleTime(){return(0,ht.calculateDurationInMs)(this.lastUseTime)}get hasSessionSupport(){return this.description.logicalSessionTimeoutMinutes!=null}get supportsOpMsg(){return this.description!=null&&(0,ht.maxWireVersion)(this)>=6&&!this.description.__nodejs_mock_server__}get shouldEmitAndLogCommand(){var t,r;return(this.monitorCommands||this.established&&!((t=this.authContext)!=null&&t.reauthenticating)&&((r=this.mongoLogger)==null?void 0:r.willLog(Ka.MongoLoggableComponent.COMMAND,Ka.SeverityLevel.DEBUG)))??!1}markAvailable(){this.lastUseTime=(0,ht.processTimeMS)()}onSocketError(t){this.onError(new ve.MongoNetworkError(t.message,{cause:t}))}onTransformError(t){this.onError(t)}onError(t){this.cleanup(t)}onClose(){const t=`connection ${this.id} to ${this.address} closed`;this.cleanup(new ve.MongoNetworkError(t))}onTimeout(){this.delayedTimeoutId=(0,Cl.setTimeout)(()=>{const t=`connection ${this.id} to ${this.address} timed out`,r=this.hello==null;this.cleanup(new ve.MongoNetworkTimeoutError(t,{beforeHandshake:r}))},1).unref()}destroy(){if(this.closed)return;this.removeAllListeners(Ze.PINNED),this.removeAllListeners(Ze.UNPINNED);const t=`connection ${this.id} to ${this.address} closed`;this.cleanup(new ve.MongoNetworkError(t))}cleanup(t){var r;this.closed||(this.socket.destroy(),this.error=t,(r=this.dataEvents)==null||r.throw(t).then(void 0,ht.squashError),this.closed=!0,this.emit(Ze.CLOSE))}prepareCommand(t,r,n){var E;let i={...r};const o=(0,$s.getReadPreference)(n),u=n==null?void 0:n.session;let h=this.clusterTime;if(this.serverApi){const{version:l,strict:g,deprecationErrors:m}=this.serverApi;i.apiVersion=l,g!=null&&(i.apiStrict=g),m!=null&&(i.apiDeprecationErrors=m)}if(this.hasSessionSupport&&u){u.clusterTime&&h&&u.clusterTime.clusterTime.greaterThan(h.clusterTime)&&(h=u.clusterTime);const l=(0,Ya.applySession)(u,i,n);if(l)throw l}else if(u!=null&&u.explicit)throw new ve.MongoCompatibilityError("Current topology does not support sessions");h&&(i.$clusterTime=h),this.description.type!==H6.ServerType.Standalone&&(!(0,$s.isSharded)(this)&&!this.description.loadBalanced&&this.supportsOpMsg&&n.directConnection===!0&&(o==null?void 0:o.mode)==="primary"?i.$readPreference=q6.ReadPreference.primaryPreferred.toJSON():(0,$s.isSharded)(this)&&!this.supportsOpMsg&&(o==null?void 0:o.mode)!=="primary"?i={$query:i,$readPreference:o.toJSON()}:(o==null?void 0:o.mode)!=="primary"&&(i.$readPreference=o.toJSON()));const s={numberToSkip:0,numberToReturn:-1,checkKeys:!1,secondaryOk:o.secondaryOk(),...n};return(E=n.timeoutContext)==null||E.addMaxTimeMSToCommand(i,n),this.supportsOpMsg?new Li.OpMsgRequest(t,i,s):new Li.OpQueryRequest(t,i,s)}async*sendWire(t,r,n){var o,u;this.throwIfAborted();const i=r.socketTimeoutMS??((o=r==null?void 0:r.timeoutContext)==null?void 0:o.getSocketTimeoutMS())??this.socketTimeoutMS;this.socket.setTimeout(i);try{if(await this.writeCommand(t,{agreedCompressor:this.description.compressor??"none",zlibCompressionLevel:this.description.zlibCompressionLevel,timeoutContext:r.timeoutContext,signal:r.signal}),t.moreToCome){yield qn.MongoDBResponse.empty;return}if(this.throwIfAborted(),(u=r.timeoutContext)!=null&&u.csotEnabled()&&r.timeoutContext.minRoundTripTime!=null&&r.timeoutContext.remainingTimeMS<r.timeoutContext.minRoundTripTime)throw new ve.MongoOperationTimeoutError("Server roundtrip time is greater than the time remaining");for await(const h of this.readMany(r)){this.socket.setTimeout(0);const s=h.parse();yield(n??qn.MongoDBResponse).make(s),this.throwIfAborted(),this.socket.setTimeout(i)}}finally{this.socket.setTimeout(0)}}async*sendCommand(t,r,n,i){var E,l;(E=n==null?void 0:n.signal)==null||E.throwIfAborted();const o=this.prepareCommand(t.db,r,n);let u=0;this.shouldEmitAndLogCommand&&(u=(0,ht.processTimeMS)(),this.emitAndLogCommand(this.monitorCommands,Ze.COMMAND_STARTED,o.databaseName,this.established,new Zs.CommandStartedEvent(this,o,this.description.serverConnectionId)));const h=n.documentsReturnedIn==null||!n.raw?n:{...n,raw:!1,fieldsAsRaw:{[n.documentsReturnedIn]:!0}};let s,a;try{this.throwIfAborted();for await(s of this.sendWire(o,n,i)){if(a=void 0,n.session!=null&&(0,Ya.updateSessionFromResponse)(n.session,s),s.$clusterTime&&(this.clusterTime=s.$clusterTime,this.emit(Ze.CLUSTER_TIME_RECEIVED,s.$clusterTime)),s.ok===0)throw(l=n.timeoutContext)!=null&&l.csotEnabled()&&s.isMaxTimeExpiredError?new ve.MongoOperationTimeoutError("Server reported a timeout error",{cause:new ve.MongoServerError(a??(a=s.toObject(h)))}):new ve.MongoServerError(a??(a=s.toObject(h)));this.shouldEmitAndLogCommand&&this.emitAndLogCommand(this.monitorCommands,Ze.COMMAND_SUCCEEDED,o.databaseName,this.established,new Zs.CommandSucceededEvent(this,o,o.moreToCome?{ok:1}:a??(a=s.toObject(h)),u,this.description.serverConnectionId)),i==null?yield a??(a=s.toObject(h)):yield s,this.throwIfAborted()}}catch(g){throw this.shouldEmitAndLogCommand&&this.emitAndLogCommand(this.monitorCommands,Ze.COMMAND_FAILED,o.databaseName,this.established,new Zs.CommandFailedEvent(this,o,g,u,this.description.serverConnectionId)),g}}async command(t,r,n={},i){var o,u,h;this.throwIfAborted(),(o=n.signal)==null||o.throwIfAborted();for await(const s of this.sendCommand(t,r,n,i)){if((u=n.timeoutContext)!=null&&u.csotEnabled()){if(qn.MongoDBResponse.is(s)){if(s.isMaxTimeExpiredError)throw new ve.MongoOperationTimeoutError("Server reported a timeout error",{cause:new ve.MongoServerError(s.toObject())})}else if(Array.isArray(s==null?void 0:s.writeErrors)&&s.writeErrors.some(a=>(a==null?void 0:a.code)===ve.MONGODB_ERROR_CODES.MaxTimeMSExpired)||((h=s==null?void 0:s.writeConcernError)==null?void 0:h.code)===ve.MONGODB_ERROR_CODES.MaxTimeMSExpired)throw new ve.MongoOperationTimeoutError("Server reported a timeout error",{cause:new ve.MongoServerError(s)})}return s}throw new ve.MongoUnexpectedServerResponseError("Unable to get response from server")}exhaustCommand(t,r,n,i){(async()=>{this.throwIfAborted();for await(const u of this.sendCommand(t,r,n))i(void 0,u),this.throwIfAborted();throw new ve.MongoUnexpectedServerResponseError("Server ended moreToCome unexpectedly")})().then(void 0,i)}throwIfAborted(){if(this.error)throw this.error}async writeCommand(t,r){var s,a,E;const n=r.agreedCompressor==="none"||!Li.OpCompressedRequest.canCompress(t)?t:new Li.OpCompressedRequest(t,{agreedCompressor:r.agreedCompressor??"none",zlibCompressionLevel:r.zlibCompressionLevel??0}),i=Buffer.concat(await n.toBin());if((s=r.timeoutContext)!=null&&s.csotEnabled()&&r.timeoutContext.minRoundTripTime!=null&&r.timeoutContext.remainingTimeMS<r.timeoutContext.minRoundTripTime)throw new ve.MongoOperationTimeoutError("Server roundtrip time is greater than the time remaining");try{if(this.socket.write(i))return}catch(l){const g=new ve.MongoNetworkError("unexpected error writing to socket",{cause:l});throw this.onError(g),g}const o=(0,ht.once)(this.socket,"drain",r),u=(a=r==null?void 0:r.timeoutContext)==null?void 0:a.timeoutForSocketWrite,h=u?Promise.race([o,u]):o;try{return await h}catch(l){if(Xa.TimeoutError.is(l)){const g=new ve.MongoOperationTimeoutError("Timed out at socket write");throw this.onError(g),g}else l===((E=r.signal)==null?void 0:E.reason)&&this.onError(l);throw l}finally{u==null||u.clear()}}async*readMany(t){var r;try{this.dataEvents=(0,X6.onData)(this.messageStream,t),this.messageStream.resume();for await(const n of this.dataEvents){const i=await(0,Y6.decompressResponse)(n);if(yield i,!i.moreToCome)return}}catch(n){if(Xa.TimeoutError.is(n)){const i=new ve.MongoOperationTimeoutError(`Timed out during socket read (${n.duration}ms)`);throw this.dataEvents=null,this.onError(i),i}else n===((r=t.signal)==null?void 0:r.reason)&&this.onError(n);throw n}finally{this.dataEvents=null,this.messageStream.pause()}}};Ze.COMMAND_STARTED=ur.COMMAND_STARTED,Ze.COMMAND_SUCCEEDED=ur.COMMAND_SUCCEEDED,Ze.COMMAND_FAILED=ur.COMMAND_FAILED,Ze.CLUSTER_TIME_RECEIVED=ur.CLUSTER_TIME_RECEIVED,Ze.CLOSE=ur.CLOSE,Ze.PINNED=ur.PINNED,Ze.UNPINNED=ur.UNPINNED;let eo=Ze;It.Connection=eo;class Sl extends V6.Transform{constructor({connection:t}){super({writableObjectMode:!1,readableObjectMode:!0}),this.bufferPool=new ht.BufferPool,this.connection=t}_transform(t,r,n){for(this.connection.delayedTimeoutId!=null&&((0,Cl.clearTimeout)(this.connection.delayedTimeoutId),this.connection.delayedTimeoutId=null),this.bufferPool.append(t);this.bufferPool.length;){const i=this.bufferPool.getInt32();if(i==null)break;if(i<0)return n(new ve.MongoParseError(`Message size cannot be negative: ${i}`));if(i>this.bufferPool.length)break;const o=this.bufferPool.read(i);if(!this.push(o))return n(new ve.MongoRuntimeError("SizedMessageTransform does not support backpressure"))}n()}}It.SizedMessageTransform=Sl;class Z6 extends eo{constructor(t,r){super(t,r),this.autoEncrypter=r.autoEncrypter}async command(t,r,n,i){const{autoEncrypter:o}=this;if(!o)throw new ve.MongoRuntimeError("No AutoEncrypter available for encryption");if((0,ht.maxWireVersion)(this)===0)return await super.command(t,r,n,i);const h=r.find||r.findAndModify?r.sort:null,s=r.createIndexes?r.indexes.map(m=>m.key):null,a=await o.encrypt(t.toString(),r,n);if(h!=null&&(r.find||r.findAndModify)&&(a.sort=h),s!=null&&r.createIndexes)for(const[m,C]of s.entries())a.indexes[m].key=C;const E=await super.command(t,a,n,i??qn.MongoDBResponse),l=await o.decrypt(E.toBytes(),n),g=(i==null?void 0:i.make(l))??(0,W6.deserialize)(l,n);return o[ur.kDecorateResult]&&(i==null?(0,ht.decorateDecryptionResult)(g,E.toObject(),!0):g instanceof qn.CursorResponse&&(g.encryptedResponse=E)),g}}It.CryptoConnection=Z6;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LEGAL_TCP_SOCKET_OPTIONS=e.LEGAL_TLS_SOCKET_OPTIONS=void 0,e.connect=g,e.makeConnection=m,e.performInitialHandshake=S,e.prepareHandshakeDocument=D,e.makeSocket=p;const t=B1,r=vc,n=Ve,i=Qe,o=Q,u=ne(),h=Dt,s=qt,a=It,E=fe;function l(f){f.addErrorLabel(o.MongoErrorLabel.SystemOverloadedError),f.addErrorLabel(o.MongoErrorLabel.RetryableError)}async function g(f){let c=null;try{const w=await p(f);return c=m(f,w),await S(c,f),c}catch(w){throw c==null||c.destroy(),w}}function m(f,c){let w=f.connectionType??a.Connection;return f.autoEncrypter&&(w=a.CryptoConnection),new w(c,f)}function C(f,c){const w=Number(f.maxWireVersion),T=Number(f.minWireVersion),_=!Number.isNaN(w)&&w>=E.MIN_SUPPORTED_WIRE_VERSION,A=!Number.isNaN(T)&&T<=E.MAX_SUPPORTED_WIRE_VERSION;if(_){if(A)return null;const F=`Server at ${c.hostAddress} reports minimum wire version ${JSON.stringify(f.minWireVersion)}, but this version of the Node.js Driver requires at most ${E.MAX_SUPPORTED_WIRE_VERSION} (MongoDB ${E.MAX_SUPPORTED_SERVER_VERSION})`;return new o.MongoCompatibilityError(F)}const y=`Server at ${c.hostAddress} reports maximum wire version ${JSON.stringify(f.maxWireVersion)??0}, but this version of the Node.js Driver requires at least ${E.MIN_SUPPORTED_WIRE_VERSION} (MongoDB ${E.MIN_SUPPORTED_SERVER_VERSION})`;return new o.MongoCompatibilityError(y)}async function S(f,c){const w=c.credentials;if(w&&w.mechanism!==s.AuthMechanism.MONGODB_DEFAULT&&!c.authProviders.getOrCreateProvider(w.mechanism,w.mechanismProperties))throw new o.MongoInvalidArgumentError(`AuthMechanism '${w.mechanism}' not supported`);const T=new h.AuthContext(f,w,c);f.authContext=T;const _=await D(T),A={...c,raw:!1};typeof c.connectTimeoutMS=="number"&&(A.socketTimeoutMS=c.connectTimeoutMS);const y=new Date().getTime(),F=await v(_,A);"isWritablePrimary"in F||(F.isWritablePrimary=F[n.LEGACY_HELLO_COMMAND]),F.helloOk&&(f.helloOk=!0);const R=C(F,c);if(R)throw R;if(c.loadBalanced&&!F.serviceId)throw new o.MongoCompatibilityError("Driver attempted to initialize in load balancing mode, but the server does not support this mode.");if(f.hello=F,f.lastHelloMS=new Date().getTime()-y,!F.arbiterOnly&&w){T.response=F;const J=w.resolveAuthMechanism(F),I=c.authProviders.getOrCreateProvider(J.mechanism,J.mechanismProperties);if(!I)throw new o.MongoInvalidArgumentError(`No AuthProvider for ${J.mechanism} defined.`);try{await I.auth(T)}catch(N){throw N instanceof o.MongoError&&(N.addErrorLabel(o.MongoErrorLabel.HandshakeError),(0,o.needsRetryableWriteLabel)(N,F.maxWireVersion,f.description.type)&&N.addErrorLabel(o.MongoErrorLabel.RetryableWriteError)),N}}f.established=!0;async function v(J,I){try{return await f.command((0,u.ns)("admin.$cmd"),J,I)}catch(N){throw N instanceof o.MongoError&&N.addErrorLabel(o.MongoErrorLabel.HandshakeError),N instanceof o.MongoNetworkError&&l(N),N}}}async function D(f){const c=f.options,w=c.compressors?c.compressors:[],{serverApi:T}=f.connection,_=await c.metadata,A={[T!=null&&T.version||c.loadBalanced===!0?"hello":n.LEGACY_HELLO_COMMAND]:1,helloOk:!0,client:_,compression:w};c.loadBalanced===!0&&(A.loadBalanced=!0);const y=f.credentials;if(y){if(y.mechanism===s.AuthMechanism.MONGODB_DEFAULT&&y.username){A.saslSupportedMechs=`${y.source}.${y.username}`;const R=f.options.authProviders.getOrCreateProvider(s.AuthMechanism.MONGODB_SCRAM_SHA256,y.mechanismProperties);if(!R)throw new o.MongoInvalidArgumentError(`No AuthProvider for ${s.AuthMechanism.MONGODB_SCRAM_SHA256} defined.`);return await R.prepare(A,f)}const F=f.options.authProviders.getOrCreateProvider(y.mechanism,y.mechanismProperties);if(!F)throw new o.MongoInvalidArgumentError(`No AuthProvider for ${y.mechanism} defined.`);return await F.prepare(A,f)}return A}e.LEGAL_TLS_SOCKET_OPTIONS=["allowPartialTrustChain","ALPNProtocols","ca","cert","checkServerIdentity","ciphers","crl","ecdhCurve","key","minDHSize","passphrase","pfx","rejectUnauthorized","secureContext","secureProtocol","servername","session"],e.LEGAL_TCP_SOCKET_OPTIONS=["autoSelectFamily","autoSelectFamilyAttemptTimeout","keepAliveInitialDelay","family","hints","localAddress","localPort","lookup"];function O(f){const c=f.hostAddress;if(!c)throw new o.MongoInvalidArgumentError('Option "hostAddress" is required');const w={};for(const T of e.LEGAL_TCP_SOCKET_OPTIONS)f[T]!=null&&(w[T]=f[T]);if(w.keepAliveInitialDelay??(w.keepAliveInitialDelay=12e4),w.keepAlive=!0,w.noDelay=f.noDelay??!0,typeof c.socketPath=="string")return w.path=c.socketPath,w;if(typeof c.host=="string")return w.host=c.host,w.port=c.port,w;throw new o.MongoRuntimeError(`Unexpected HostAddress ${JSON.stringify(c)}`)}function M(f){const c=O(f);for(const w of e.LEGAL_TLS_SOCKET_OPTIONS)f[w]!=null&&(c[w]=f[w]);return f.existingSocket&&(c.socket=f.existingSocket),c.servername==null&&c.host&&!t.isIP(c.host)&&(c.servername=c.host),c}async function p(f){var v;const c=f.tls??!1,w=f.connectTimeoutMS??3e4,T=f.existingSocket;let _;if(f.proxyHost!=null)return await b({...f,connectTimeoutMS:w});if(c){const J=r.connect(M(f));typeof J.disableRenegotiation=="function"&&J.disableRenegotiation(),_=J}else T?_=T:_=t.createConnection(O(f));_.setTimeout(w);let A=null;const{promise:y,resolve:F,reject:R}=(0,u.promiseWithResolvers)();if(T)F(_);else{const J=performance.now(),I=c?"secureConnect":"connect";_.once(I,()=>F(_)).once("error",N=>R(new o.MongoNetworkError(o.MongoError.buildErrorMessage(N),{cause:N}))).once("timeout",()=>{R(new o.MongoNetworkTimeoutError(`Socket '${I}' timed out after ${performance.now()-J|0}ms (connectTimeoutMS: ${w})`))}).once("close",()=>R(new o.MongoNetworkError(`Socket closed after ${performance.now()-J|0} during connection establishment`))),f.cancellationToken!=null&&(A=()=>R(new o.MongoNetworkError(`Socket connection establishment was cancelled after ${performance.now()-J|0}`)),f.cancellationToken.once("cancel",A))}try{return _=await y,_}catch(J){throw l(J),_.destroy(),J}finally{_.setTimeout(0),A!=null&&((v=f.cancellationToken)==null||v.removeListener("cancel",A))}}let B=null;function d(){if(B==null){const f=(0,i.getSocks)();if("kModuleError"in f)throw f.kModuleError;B=f}return B}async function b(f){const c=u.HostAddress.fromHostPort(f.proxyHost??"",f.proxyPort??1080),w=await p({...f,hostAddress:c,tls:!1,proxyHost:void 0}),T=O(f);if(typeof T.host!="string"||typeof T.port!="number")throw new o.MongoInvalidArgumentError("Can only make Socks5 connections to TCP hosts");B??(B=d());let _;try{_=(await B.SocksClient.createConnection({existing_socket:w,timeout:f.connectTimeoutMS,command:"connect",destination:{host:T.host,port:T.port},proxy:{host:"iLoveJavaScript",port:0,type:5,userId:f.proxyUsername||void 0,password:f.proxyPassword||void 0}})).socket}catch(A){throw new o.MongoNetworkError(o.MongoError.buildErrorMessage(A),{cause:A})}return await p({...f,existingSocket:_,proxyHost:void 0})}})(Cu);var Ue={};Object.defineProperty(Ue,"__esModule",{value:!0});Ue.ServerHeartbeatFailedEvent=Ue.ServerHeartbeatSucceededEvent=Ue.ServerHeartbeatStartedEvent=Ue.TopologyClosedEvent=Ue.TopologyOpeningEvent=Ue.TopologyDescriptionChangedEvent=Ue.ServerClosedEvent=Ue.ServerOpeningEvent=Ue.ServerDescriptionChangedEvent=void 0;const ir=Ve;class $6{constructor(t,r,n,i){this.name=ir.SERVER_DESCRIPTION_CHANGED,this.topologyId=t,this.address=r,this.previousDescription=n,this.newDescription=i}}Ue.ServerDescriptionChangedEvent=$6;class em{constructor(t,r){this.name=ir.SERVER_OPENING,this.topologyId=t,this.address=r}}Ue.ServerOpeningEvent=em;class tm{constructor(t,r){this.name=ir.SERVER_CLOSED,this.topologyId=t,this.address=r}}Ue.ServerClosedEvent=tm;class rm{constructor(t,r,n){this.name=ir.TOPOLOGY_DESCRIPTION_CHANGED,this.topologyId=t,this.previousDescription=r,this.newDescription=n}}Ue.TopologyDescriptionChangedEvent=rm;class nm{constructor(t){this.name=ir.TOPOLOGY_OPENING,this.topologyId=t}}Ue.TopologyOpeningEvent=nm;class im{constructor(t){this.name=ir.TOPOLOGY_CLOSED,this.topologyId=t}}Ue.TopologyClosedEvent=im;class om{constructor(t,r){this.name=ir.SERVER_HEARTBEAT_STARTED,this.connectionId=t,this.awaited=r}}Ue.ServerHeartbeatStartedEvent=om;class sm{constructor(t,r,n,i){this.name=ir.SERVER_HEARTBEAT_SUCCEEDED,this.connectionId=t,this.duration=r,this.reply=n??{},this.awaited=i}}Ue.ServerHeartbeatSucceededEvent=sm;class um{constructor(t,r,n,i){this.name=ir.SERVER_HEARTBEAT_FAILED,this.connectionId=t,this.duration=r,this.failure=n,this.awaited=i}}Ue.ServerHeartbeatFailedEvent=um;var Ln={},yl={},Fe={};Object.defineProperty(Fe,"__esModule",{value:!0});Fe.ConnectionPoolClearedEvent=Fe.ConnectionCheckedInEvent=Fe.ConnectionCheckedOutEvent=Fe.ConnectionCheckOutFailedEvent=Fe.ConnectionCheckOutStartedEvent=Fe.ConnectionClosedEvent=Fe.ConnectionReadyEvent=Fe.ConnectionCreatedEvent=Fe.ConnectionPoolClosedEvent=Fe.ConnectionPoolReadyEvent=Fe.ConnectionPoolCreatedEvent=Fe.ConnectionPoolMonitoringEvent=void 0;const kt=Ve,Ou=ne();class Tt{constructor(t){this.time=new Date,this.address=t.address}}Fe.ConnectionPoolMonitoringEvent=Tt;class am extends Tt{constructor(t){super(t),this.name=kt.CONNECTION_POOL_CREATED;const{maxConnecting:r,maxPoolSize:n,minPoolSize:i,maxIdleTimeMS:o,waitQueueTimeoutMS:u}=t.options;this.options={maxConnecting:r,maxPoolSize:n,minPoolSize:i,maxIdleTimeMS:o,waitQueueTimeoutMS:u}}}Fe.ConnectionPoolCreatedEvent=am;class cm extends Tt{constructor(t){super(t),this.name=kt.CONNECTION_POOL_READY}}Fe.ConnectionPoolReadyEvent=cm;class lm extends Tt{constructor(t){super(t),this.name=kt.CONNECTION_POOL_CLOSED}}Fe.ConnectionPoolClosedEvent=lm;class hm extends Tt{constructor(t,r){super(t),this.name=kt.CONNECTION_CREATED,this.connectionId=r.id}}Fe.ConnectionCreatedEvent=hm;class dm extends Tt{constructor(t,r,n){super(t),this.name=kt.CONNECTION_READY,this.durationMS=(0,Ou.processTimeMS)()-n,this.connectionId=r.id}}Fe.ConnectionReadyEvent=dm;class fm extends Tt{constructor(t,r,n,i){super(t),this.name=kt.CONNECTION_CLOSED,this.connectionId=r.id,this.reason=n,this.serviceId=r.serviceId,this.error=i??null}}Fe.ConnectionClosedEvent=fm;class mm extends Tt{constructor(t){super(t),this.name=kt.CONNECTION_CHECK_OUT_STARTED}}Fe.ConnectionCheckOutStartedEvent=mm;class Em extends Tt{constructor(t,r,n,i){super(t),this.name=kt.CONNECTION_CHECK_OUT_FAILED,this.durationMS=(0,Ou.processTimeMS)()-n,this.reason=r,this.error=i}}Fe.ConnectionCheckOutFailedEvent=Em;class gm extends Tt{constructor(t,r,n){super(t),this.name=kt.CONNECTION_CHECKED_OUT,this.durationMS=(0,Ou.processTimeMS)()-n,this.connectionId=r.id}}Fe.ConnectionCheckedOutEvent=gm;class Am extends Tt{constructor(t,r){super(t),this.name=kt.CONNECTION_CHECKED_IN,this.connectionId=r.id}}Fe.ConnectionCheckedInEvent=Am;class pm extends Tt{constructor(t,r={}){super(t),this.name=kt.CONNECTION_POOL_CLEARED,this.serviceId=r.serviceId,this.interruptInUseConnections=r.interruptInUseConnections}}Fe.ConnectionPoolClearedEvent=pm;var Ft={};Object.defineProperty(Ft,"__esModule",{value:!0});Ft.WaitQueueTimeoutError=Ft.PoolClearedOnNetworkError=Ft.PoolClearedError=Ft.PoolClosedError=void 0;const to=Q;class Cm extends to.MongoDriverError{constructor(t){super("Attempted to check out a connection from closed connection pool"),this.address=t.address}get name(){return"MongoPoolClosedError"}}Ft.PoolClosedError=Cm;class Ol extends to.MongoNetworkError{constructor(t,r){var i;const n=r||`Connection pool for ${t.address} was cleared because another operation failed with: "${(i=t.serverError)==null?void 0:i.message}"`;super(n,t.serverError?{cause:t.serverError}:void 0),this.address=t.address,this.addErrorLabel(to.MongoErrorLabel.PoolRequestedRetry)}get name(){return"MongoPoolClearedError"}}Ft.PoolClearedError=Ol;class Sm extends Ol{constructor(t){super(t,`Connection to ${t.address} interrupted due to server monitor timeout`)}get name(){return"PoolClearedOnNetworkError"}}Ft.PoolClearedOnNetworkError=Sm;class ym extends to.MongoDriverError{constructor(t,r){super(t),this.address=r}get name(){return"MongoWaitQueueTimeoutError"}}Ft.WaitQueueTimeoutError=ym;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConnectionPool=e.PoolState=void 0;const t=gn,r=Ve,n=Q,i=Je,o=Te,u=ne(),h=Cu,s=It,a=Fe,E=Ft,l=hi;e.PoolState=Object.freeze({paused:"paused",ready:"ready",closed:"closed"});const m=class m extends i.TypedEventEmitter{constructor(S,D){var O;if(super(),this.on("error",u.noop),this.options=Object.freeze({connectionType:s.Connection,...D,maxPoolSize:D.maxPoolSize??100,minPoolSize:D.minPoolSize??0,maxConnecting:D.maxConnecting??2,maxIdleTimeMS:D.maxIdleTimeMS??0,waitQueueTimeoutMS:D.waitQueueTimeoutMS??0,minPoolSizeCheckFrequencyMS:D.minPoolSizeCheckFrequencyMS??100,autoEncrypter:D.autoEncrypter}),this.options.minPoolSize>this.options.maxPoolSize)throw new n.MongoInvalidArgumentError("Connection pool minimum size must not be greater than maximum pool size");this.poolState=e.PoolState.paused,this.server=S,this.connections=new u.List,this.pending=0,this.checkedOut=new Set,this.minPoolSizeTimer=void 0,this.generation=0,this.serviceGenerations=new Map,this.connectionCounter=(0,u.makeCounter)(1),this.cancellationToken=new i.CancellationToken,this.cancellationToken.setMaxListeners(1/0),this.waitQueue=new u.List,this.metrics=new l.ConnectionPoolMetrics,this.processingWaitQueue=!1,this.mongoLogger=(O=this.server.topology.client)==null?void 0:O.mongoLogger,this.component="connection",queueMicrotask(()=>{this.emitAndLog(m.CONNECTION_POOL_CREATED,new a.ConnectionPoolCreatedEvent(this))})}get address(){return this.options.hostAddress.toString()}get closed(){return this.poolState===e.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(){this.poolState===e.PoolState.paused&&(this.poolState=e.PoolState.ready,this.emitAndLog(m.CONNECTION_POOL_READY,new a.ConnectionPoolReadyEvent(this)),(0,t.clearTimeout)(this.minPoolSizeTimer),this.ensureMinPoolSize())}async checkOut(S){const D=(0,u.processTimeMS)();this.emitAndLog(m.CONNECTION_CHECK_OUT_STARTED,new a.ConnectionCheckOutStartedEvent(this));const{promise:O,resolve:M,reject:p}=(0,u.promiseWithResolvers)(),B=S.timeoutContext.connectionCheckoutTimeout,d={resolve:M,reject:p,cancelled:!1,checkoutTime:D},b=(0,u.addAbortListener)(S.signal,function(){d.cancelled=!0,p(this.reason)});this.waitQueue.push(d),queueMicrotask(()=>this.processWaitQueue());try{return B==null||B.throwIfExpired(),await(B?Promise.race([O,B]):O)}catch(f){if(o.TimeoutError.is(f)){B==null||B.clear(),d.cancelled=!0,this.emitAndLog(m.CONNECTION_CHECK_OUT_FAILED,new a.ConnectionCheckOutFailedEvent(this,"timeout",d.checkoutTime));const c=new E.WaitQueueTimeoutError(this.loadBalanced?this.waitQueueErrorMetrics():"Timed out while checking out a connection from connection pool",this.address);throw S.timeoutContext.csotEnabled()?new n.MongoOperationTimeoutError("Timed out during connection checkout",{cause:c}):c}throw f}finally{b==null||b[u.kDispose](),B==null||B.clear()}}checkIn(S){if(!this.checkedOut.has(S))return;const D=this.closed,O=this.connectionIsStale(S),M=!!(D||O||S.closed);if(M||(S.markAvailable(),this.connections.unshift(S)),this.checkedOut.delete(S),this.emitAndLog(m.CONNECTION_CHECKED_IN,new a.ConnectionCheckedInEvent(this,S)),M){const p=S.closed?"error":D?"poolClosed":"stale";this.destroyConnection(S,p)}queueMicrotask(()=>this.processWaitQueue())}clear(S={}){if(this.closed)return;if(this.loadBalanced){const{serviceId:p}=S;if(!p)throw new n.MongoRuntimeError("ConnectionPool.clear() called in load balanced mode with no serviceId.");const B=p.toHexString(),d=this.serviceGenerations.get(B);if(d==null)throw new n.MongoRuntimeError("Service generations are required in load balancer mode.");this.serviceGenerations.set(B,d+1),this.emitAndLog(m.CONNECTION_POOL_CLEARED,new a.ConnectionPoolClearedEvent(this,{serviceId:p}));return}const D=S.interruptInUseConnections??!1,O=this.generation;this.generation+=1;const M=this.poolState===e.PoolState.paused;this.poolState=e.PoolState.paused,this.clearMinPoolSizeTimer(),M||this.emitAndLog(m.CONNECTION_POOL_CLEARED,new a.ConnectionPoolClearedEvent(this,{interruptInUseConnections:D})),D&&queueMicrotask(()=>this.interruptInUseConnections(O)),this.processWaitQueue()}interruptInUseConnections(S){for(const D of this.checkedOut)D.generation<=S&&D.onError(new E.PoolClearedOnNetworkError(this))}closeCheckedOutConnections(){for(const S of this.checkedOut)S.onError(new n.MongoClientClosedError)}close(){if(!this.closed){this.cancellationToken.emit("cancel"),typeof this.connectionCounter.return=="function"&&this.connectionCounter.return(void 0),this.poolState=e.PoolState.closed,this.clearMinPoolSizeTimer(),this.processWaitQueue();for(const S of this.connections)this.emitAndLog(m.CONNECTION_CLOSED,new a.ConnectionClosedEvent(this,S,"poolClosed")),S.destroy();this.connections.clear(),this.emitAndLog(m.CONNECTION_POOL_CLOSED,new a.ConnectionPoolClosedEvent(this))}}async reauthenticate(S){const D=S.authContext;if(!D)throw new n.MongoRuntimeError("No auth context found on connection.");const O=D.credentials;if(!O)throw new n.MongoMissingCredentialsError("Connection is missing credentials when asked to reauthenticate");const M=O.resolveAuthMechanism(S.hello),p=this.server.topology.client.s.authProviders.getOrCreateProvider(M.mechanism,M.mechanismProperties);if(!p)throw new n.MongoMissingCredentialsError(`Reauthenticate failed due to no auth provider for ${O.mechanism}`);await p.reauth(D)}clearMinPoolSizeTimer(){const S=this.minPoolSizeTimer;S&&(0,t.clearTimeout)(S)}destroyConnection(S,D){this.emitAndLog(m.CONNECTION_CLOSED,new a.ConnectionClosedEvent(this,S,D)),S.destroy()}connectionIsStale(S){const D=S.serviceId;if(this.loadBalanced&&D){const O=D.toHexString(),M=this.serviceGenerations.get(O);return S.generation!==M}return S.generation!==this.generation}connectionIsIdle(S){return!!(this.options.maxIdleTimeMS&&S.idleTime>this.options.maxIdleTimeMS)}destroyConnectionIfPerished(S){const D=this.connectionIsStale(S),O=this.connectionIsIdle(S);if(!D&&!O&&!S.closed)return!1;const M=S.closed?"error":D?"stale":"idle";return this.destroyConnection(S,M),!0}createConnection(S){const D={...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++;const O=(0,u.processTimeMS)();this.emitAndLog(m.CONNECTION_CREATED,new a.ConnectionCreatedEvent(this,{id:D.id})),(0,h.connect)(D).then(M=>{if(this.poolState!==e.PoolState.ready){this.pending--,M.destroy(),S(this.closed?new E.PoolClosedError(this):new E.PoolClearedError(this));return}for(const p of[...r.APM_EVENTS,s.Connection.CLUSTER_TIME_RECEIVED])M.on(p,B=>this.emit(p,B));if(this.loadBalanced){M.on(s.Connection.PINNED,B=>this.metrics.markPinned(B)),M.on(s.Connection.UNPINNED,B=>this.metrics.markUnpinned(B));const p=M.serviceId;if(p){let B;const d=p.toHexString();(B=this.serviceGenerations.get(d))?M.generation=B:(this.serviceGenerations.set(d,0),M.generation=0)}}M.markAvailable(),this.emitAndLog(m.CONNECTION_READY,new a.ConnectionReadyEvent(this,M,O)),this.pending--,S(void 0,M)},M=>{this.pending--,this.server.handleError(M),this.emitAndLog(m.CONNECTION_CLOSED,new a.ConnectionClosedEvent(this,{id:D.id,serviceId:void 0},"error",M)),(M instanceof n.MongoNetworkError||M instanceof n.MongoServerError)&&(M.connectionGeneration=D.generation),S(M??new n.MongoRuntimeError("Connection creation failed without error"))})}ensureMinPoolSize(){const S=this.options.minPoolSize;this.poolState===e.PoolState.ready&&(this.connections.prune(D=>this.destroyConnectionIfPerished(D)),this.totalConnectionCount<S&&this.pendingConnectionCount<this.options.maxConnecting?this.createConnection((D,O)=>{!D&&O&&(this.connections.push(O),queueMicrotask(()=>this.processWaitQueue())),this.poolState===e.PoolState.ready&&((0,t.clearTimeout)(this.minPoolSizeTimer),this.minPoolSizeTimer=(0,t.setTimeout)(()=>this.ensureMinPoolSize(),this.options.minPoolSizeCheckFrequencyMS))}):((0,t.clearTimeout)(this.minPoolSizeTimer),this.minPoolSizeTimer=(0,t.setTimeout)(()=>this.ensureMinPoolSize(),this.options.minPoolSizeCheckFrequencyMS)))}processWaitQueue(){if(this.processingWaitQueue)return;for(this.processingWaitQueue=!0;this.waitQueueSize;){const O=this.waitQueue.first();if(!O){this.waitQueue.shift();continue}if(O.cancelled){this.waitQueue.shift();continue}if(this.poolState!==e.PoolState.ready){const p=this.closed?"poolClosed":"connectionError",B=this.closed?new E.PoolClosedError(this):new E.PoolClearedError(this);this.emitAndLog(m.CONNECTION_CHECK_OUT_FAILED,new a.ConnectionCheckOutFailedEvent(this,p,O.checkoutTime,B)),this.waitQueue.shift(),O.reject(B);continue}if(!this.availableConnectionCount)break;const M=this.connections.shift();if(!M)break;this.destroyConnectionIfPerished(M)||(this.checkedOut.add(M),this.emitAndLog(m.CONNECTION_CHECKED_OUT,new a.ConnectionCheckedOutEvent(this,M,O.checkoutTime)),this.waitQueue.shift(),O.resolve(M))}const{maxPoolSize:S,maxConnecting:D}=this.options;for(;this.waitQueueSize>0&&this.pendingConnectionCount<D&&(S===0||this.totalConnectionCount<S);){const O=this.waitQueue.shift();!O||O.cancelled||this.createConnection((M,p)=>{O.cancelled?!M&&p&&this.connections.push(p):M?(this.emitAndLog(m.CONNECTION_CHECK_OUT_FAILED,new a.ConnectionCheckOutFailedEvent(this,"connectionError",O.checkoutTime,M)),O.reject(M)):p&&(this.checkedOut.add(p),this.emitAndLog(m.CONNECTION_CHECKED_OUT,new a.ConnectionCheckedOutEvent(this,p,O.checkoutTime)),O.resolve(p)),queueMicrotask(()=>this.processWaitQueue())})}this.processingWaitQueue=!1}};m.CONNECTION_POOL_CREATED=r.CONNECTION_POOL_CREATED,m.CONNECTION_POOL_CLOSED=r.CONNECTION_POOL_CLOSED,m.CONNECTION_POOL_CLEARED=r.CONNECTION_POOL_CLEARED,m.CONNECTION_POOL_READY=r.CONNECTION_POOL_READY,m.CONNECTION_CREATED=r.CONNECTION_CREATED,m.CONNECTION_READY=r.CONNECTION_READY,m.CONNECTION_CLOSED=r.CONNECTION_CLOSED,m.CONNECTION_CHECK_OUT_STARTED=r.CONNECTION_CHECK_OUT_STARTED,m.CONNECTION_CHECK_OUT_FAILED=r.CONNECTION_CHECK_OUT_FAILED,m.CONNECTION_CHECKED_OUT=r.CONNECTION_CHECKED_OUT,m.CONNECTION_CHECKED_IN=r.CONNECTION_CHECKED_IN;let g=m;e.ConnectionPool=g})(yl);var Ja;function wl(){if(Ja)return Ln;Ja=1,Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.Server=void 0;const e=It,t=yl,r=Ft,n=Ve,i=Q,o=Je,u=ii,h=z1,s=ne(),a=ct(),E=Ne,l=_l(),g=nr,m=pn,C=(0,s.makeStateMachine)({[E.STATE_CLOSED]:[E.STATE_CLOSED,E.STATE_CONNECTING],[E.STATE_CONNECTING]:[E.STATE_CONNECTING,E.STATE_CLOSING,E.STATE_CONNECTED,E.STATE_CLOSED],[E.STATE_CONNECTED]:[E.STATE_CONNECTED,E.STATE_CLOSING,E.STATE_CLOSED],[E.STATE_CLOSING]:[E.STATE_CLOSING,E.STATE_CLOSED]}),b=class b extends o.TypedEventEmitter{constructor(c,w,T){super(),this.on("error",s.noop),this.serverApi=T.serverApi;const _={hostAddress:w.hostAddress,...T};this.topology=c,this.pool=new t.ConnectionPool(this,_),this.s={description:w,options:T,state:E.STATE_CLOSED,operationCount:0};for(const A of[...n.CMAP_EVENTS,...n.APM_EVENTS])this.pool.on(A,y=>this.emit(A,y));if(this.pool.on(e.Connection.CLUSTER_TIME_RECEIVED,A=>{this.clusterTime=A}),this.loadBalanced){this.monitor=null;return}this.monitor=new l.Monitor(this,this.s.options);for(const A of n.HEARTBEAT_EVENTS)this.monitor.on(A,y=>this.emit(A,y));this.monitor.on("resetServer",A=>D(this,A)),this.monitor.on(b.SERVER_HEARTBEAT_SUCCEEDED,A=>{var y,F;this.emit(b.DESCRIPTION_RECEIVED,new g.ServerDescription(this.description.hostAddress,A.reply,{roundTripTime:(y=this.monitor)==null?void 0:y.roundTripTime,minRoundTripTime:(F=this.monitor)==null?void 0:F.minRoundTripTime})),this.s.state===E.STATE_CONNECTING&&(C(this,E.STATE_CONNECTED),this.emit(b.CONNECT,this))})}get clusterTime(){return this.topology.clusterTime}set clusterTime(c){this.topology.clusterTime=c}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}get loadBalanced(){return this.topology.description.type===E.TopologyType.LoadBalanced}connect(){var c;this.s.state===E.STATE_CLOSED&&(C(this,E.STATE_CONNECTING),this.loadBalanced?(C(this,E.STATE_CONNECTED),this.emit(b.CONNECT,this)):(c=this.monitor)==null||c.connect())}closeCheckedOutConnections(){return this.pool.closeCheckedOutConnections()}close(){var c;this.s.state!==E.STATE_CLOSED&&(C(this,E.STATE_CLOSING),this.loadBalanced||(c=this.monitor)==null||c.close(),this.pool.close(),C(this,E.STATE_CLOSED),this.emit("closed"))}requestCheck(){var c;this.loadBalanced||(c=this.monitor)==null||c.requestCheck()}async command(c,w){var I;if(this.s.state===E.STATE_CLOSING||this.s.state===E.STATE_CLOSED)throw new i.MongoServerClosedError;const T=c.session;let _=T==null?void 0:T.pinnedConnection;if(this.incrementOperationCount(),_==null)try{_=await this.pool.checkOut({timeoutContext:w,signal:c.options.signal})}catch(N){throw this.decrementOperationCount(),N instanceof r.PoolClearedError||this.handleError(N),N}let A=null;const y=()=>{if(this.decrementOperationCount(),(T==null?void 0:T.pinnedConnection)!==_)if(A!=null){const N=()=>{this.pool.checkIn(_)};A.then(N,N)}else this.pool.checkIn(_)};let F;try{F=c.buildCommand(_,T)}catch(N){throw y(),N}const R=c.buildOptions(w),v=c.ns;this.loadBalanced&&O(F,T)&&!(T!=null&&T.pinnedConnection)&&(T==null||T.pin(_)),R.directConnection=this.topology.s.options.directConnection,c instanceof u.AggregateOperation&&c.hasWriteStage&&(0,s.maxWireVersion)(_)<m.MIN_SECONDARY_WRITE_WIRE_VERSION&&delete R.readPreference,this.description.iscryptd&&(R.omitMaxTimeMS=!0);try{try{const N=await _.command(v,F,R,c.SERVER_COMMAND_RESPONSE_TYPE);return(0,a.throwIfWriteConcernError)(N),N}catch(N){throw this.decorateCommandError(_,F,R,N)}}catch(N){if(N instanceof i.MongoError&&((I=N.code)==null?void 0:I.valueOf())===i.MONGODB_ERROR_CODES.Reauthenticate){A=this.pool.reauthenticate(_),A.then(void 0,j=>{A=null,(0,s.squashError)(j)}),await(0,s.abortable)(A,R),A=null;try{const j=await _.command(v,F,R,c.SERVER_COMMAND_RESPONSE_TYPE);return(0,a.throwIfWriteConcernError)(j),j}catch(j){throw this.decorateCommandError(_,F,R,j)}}else throw N}finally{y()}}handleError(c,w){if(!(c instanceof i.MongoError)||d(this,c))return;const T=c instanceof i.MongoNetworkError&&!(c instanceof i.MongoNetworkTimeoutError),_=c instanceof i.MongoNetworkError&&c.beforeHandshake,A=c.hasErrorLabel(i.MongoErrorLabel.HandshakeError),y=c.hasErrorLabel(i.MongoErrorLabel.SystemOverloadedError);if((0,i.isStateChangeError)(c)||c instanceof i.MongoParseError){const F=(0,i.isNodeShuttingDownError)(c);if(!this.loadBalanced){F&&c.addErrorLabel(i.MongoErrorLabel.ResetPool),D(this,c),queueMicrotask(()=>this.requestCheck());return}w&&F&&this.pool.clear({serviceId:w.serviceId})}else if(T||_||A){if(y)return;this.loadBalanced?w&&this.pool.clear({serviceId:w.serviceId}):(c.addErrorLabel(i.MongoErrorLabel.ResetPool),D(this,c))}}decorateCommandError(c,w,T,_){if(typeof _!="object"||_==null||!("name"in _))throw new i.MongoRuntimeError("An unexpected error type: "+typeof _);if(_.name==="AbortError"&&"cause"in _&&_.cause instanceof i.MongoError&&(_=_.cause),!(_ instanceof i.MongoError)||M(this.pool,c))return _;const A=T==null?void 0:T.session;return _ instanceof i.MongoNetworkError?(A&&!A.hasEnded&&A.serverSession&&(A.serverSession.isDirty=!0),p(A,w)&&!_.hasErrorLabel(i.MongoErrorLabel.TransientTransactionError)&&_.addErrorLabel(i.MongoErrorLabel.TransientTransactionError),(B(this.topology)||(0,h.isTransactionCommand)(w))&&(0,s.supportsRetryableWrites)(this)&&!p(A,w)&&_.addErrorLabel(i.MongoErrorLabel.RetryableWriteError)):(B(this.topology)||(0,h.isTransactionCommand)(w))&&(0,i.needsRetryableWriteLabel)(_,(0,s.maxWireVersion)(this),this.description.type)&&!p(A,w)&&_.addErrorLabel(i.MongoErrorLabel.RetryableWriteError),A&&A.isPinned&&_.hasErrorLabel(i.MongoErrorLabel.TransientTransactionError)&&A.unpin({force:!0}),this.handleError(_,c),_}decrementOperationCount(){return this.s.operationCount-=1}incrementOperationCount(){return this.s.operationCount+=1}};b.SERVER_HEARTBEAT_STARTED=n.SERVER_HEARTBEAT_STARTED,b.SERVER_HEARTBEAT_SUCCEEDED=n.SERVER_HEARTBEAT_SUCCEEDED,b.SERVER_HEARTBEAT_FAILED=n.SERVER_HEARTBEAT_FAILED,b.CONNECT=n.CONNECT,b.DESCRIPTION_RECEIVED=n.DESCRIPTION_RECEIVED,b.CLOSED=n.CLOSED,b.ENDED=n.ENDED;let S=b;Ln.Server=S;function D(f,c){var w;f.loadBalanced||(c instanceof i.MongoNetworkError&&!(c instanceof i.MongoNetworkTimeoutError)&&((w=f.monitor)==null||w.reset()),f.emit(S.DESCRIPTION_RECEIVED,new g.ServerDescription(f.description.hostAddress,void 0,{error:c})))}function O(f,c){return c?c.inTransaction()||c.transaction.isCommitted&&"commitTransaction"in f||"aggregate"in f||"find"in f||"getMore"in f||"listCollections"in f||"listIndexes"in f||"bulkWrite"in f:!1}function M(f,c){return c.serviceId?c.generation!==f.serviceGenerations.get(c.serviceId.toHexString()):c.generation!==f.generation}function p(f,c){return f&&f.inTransaction()&&!(0,h.isTransactionCommand)(c)}function B(f){return f.s.options.retryWrites!==!1}function d(f,c){const w=f.pool.generation,T=c.connectionGeneration;if(T&&T<w)return!0;const _=f.description.topologyVersion;return(0,g.compareTopologyVersion)(_,c.topologyVersion)>=0}return Ln}var Qa;function _l(){return Qa||(Qa=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RTTSampler=e.MonitorInterval=e.RTTPinger=e.Monitor=e.ServerMonitoringMode=void 0;const t=gn,r=pe,n=Cu,i=Sr,o=Ve,u=Q,h=Cr,s=Je,a=ne(),E=Ne,l=Ue,g=wl(),m="idle",C="monitoring",S=(0,a.makeStateMachine)({[E.STATE_CLOSING]:[E.STATE_CLOSING,m,E.STATE_CLOSED],[E.STATE_CLOSED]:[E.STATE_CLOSED,C],[m]:[m,C,E.STATE_CLOSING],[C]:[C,m,E.STATE_CLOSING]}),D=new Set([E.STATE_CLOSING,E.STATE_CLOSED,C]);function O(_){return _.s.state===E.STATE_CLOSED||_.s.state===E.STATE_CLOSING}e.ServerMonitoringMode=Object.freeze({auto:"auto",poll:"poll",stream:"stream"});class M extends s.TypedEventEmitter{constructor(A,y){var v;super(),this.component=h.MongoLoggableComponent.TOPOLOGY,this.on("error",a.noop),this.server=A,this.connection=null,this.cancellationToken=new s.CancellationToken,this.cancellationToken.setMaxListeners(1/0),this.monitorId=void 0,this.s={state:E.STATE_CLOSED},this.address=A.description.address,this.options=Object.freeze({connectTimeoutMS:y.connectTimeoutMS??1e4,heartbeatFrequencyMS:y.heartbeatFrequencyMS??1e4,minHeartbeatFrequencyMS:y.minHeartbeatFrequencyMS??500,serverMonitoringMode:y.serverMonitoringMode}),this.isRunningInFaasEnv=(0,i.getFAASEnv)()!=null,this.mongoLogger=(v=this.server.topology.client)==null?void 0:v.mongoLogger,this.rttSampler=new T(10);const F=this.cancellationToken,R={id:"<monitor>",generation:A.pool.generation,cancellationToken:F,hostAddress:A.description.hostAddress,...y,raw:!1,useBigInt64:!1,promoteLongs:!0,promoteValues:!0,promoteBuffers:!0};delete R.credentials,R.autoEncrypter&&delete R.autoEncrypter,this.connectOptions=Object.freeze(R)}connect(){if(this.s.state!==E.STATE_CLOSED)return;const A=this.options.heartbeatFrequencyMS,y=this.options.minHeartbeatFrequencyMS;this.monitorId=new w(b(this),{heartbeatFrequencyMS:A,minHeartbeatFrequencyMS:y,immediate:!0})}requestCheck(){var A;D.has(this.s.state)||(A=this.monitorId)==null||A.wake()}reset(){const A=this.server.description.topologyVersion;if(O(this)||A==null)return;S(this,E.STATE_CLOSING),p(this),S(this,m);const y=this.options.heartbeatFrequencyMS,F=this.options.minHeartbeatFrequencyMS;this.monitorId=new w(b(this),{heartbeatFrequencyMS:y,minHeartbeatFrequencyMS:F})}close(){O(this)||(S(this,E.STATE_CLOSING),p(this),this.emit("close"),S(this,E.STATE_CLOSED))}get roundTripTime(){return this.rttSampler.average()}get minRoundTripTime(){return this.rttSampler.min()}get latestRtt(){return this.rttSampler.last}addRttSample(A){this.rttSampler.addSample(A)}clearRttSamples(){this.rttSampler.clear()}}e.Monitor=M;function p(_){var A,y,F;(A=_.monitorId)==null||A.stop(),_.monitorId=void 0,(y=_.rttPinger)==null||y.close(),_.rttPinger=void 0,_.cancellationToken.emit("cancel"),(F=_.connection)==null||F.destroy(),_.connection=null,_.clearRttSamples()}function B(_,A){if(A==null)return!1;const y=_.options.serverMonitoringMode;return y===e.ServerMonitoringMode.poll?!1:y===e.ServerMonitoringMode.stream?!0:!_.isRunningInFaasEnv}function d(_,A){let y,F;const R=_.server.description.topologyVersion,v=B(_,R);_.emitAndLogHeartbeat(g.Server.SERVER_HEARTBEAT_STARTED,_.server.topology.s.id,void 0,new l.ServerHeartbeatStartedEvent(_.address,v));function J(j){var Y;(Y=_.connection)==null||Y.destroy(),_.connection=null,_.emitAndLogHeartbeat(g.Server.SERVER_HEARTBEAT_FAILED,_.server.topology.s.id,void 0,new l.ServerHeartbeatFailedEvent(_.address,(0,a.calculateDurationInMs)(y),j,F));const x=j instanceof u.MongoError?j:new u.MongoError(u.MongoError.buildErrorMessage(j),{cause:j});x.addErrorLabel(u.MongoErrorLabel.ResetPool),x instanceof u.MongoNetworkTimeoutError&&x.addErrorLabel(u.MongoErrorLabel.InterruptInUseConnections),_.emit("resetServer",x),A(j)}function I(j){var Y;"isWritablePrimary"in j||(j.isWritablePrimary=j[o.LEGACY_HELLO_COMMAND]);const x=v&&_.rttPinger?_.rttPinger.latestRtt??(0,a.calculateDurationInMs)(y):(0,a.calculateDurationInMs)(y);_.addRttSample(x),_.emitAndLogHeartbeat(g.Server.SERVER_HEARTBEAT_SUCCEEDED,_.server.topology.s.id,j.connectionId,new l.ServerHeartbeatSucceededEvent(_.address,x,j,v)),v?(_.emitAndLogHeartbeat(g.Server.SERVER_HEARTBEAT_STARTED,_.server.topology.s.id,void 0,new l.ServerHeartbeatStartedEvent(_.address,!0)),y=(0,a.processTimeMS)()):((Y=_.rttPinger)==null||Y.close(),_.rttPinger=void 0,A(void 0,j))}const{connection:N}=_;if(N&&!N.closed){const{serverApi:j,helloOk:x}=N,Y=_.options.connectTimeoutMS,$=_.options.heartbeatFrequencyMS,K={[j!=null&&j.version||x?"hello":o.LEGACY_HELLO_COMMAND]:1,...v&&R?{maxAwaitTimeMS:$,topologyVersion:f(R)}:{}},ee=v?{socketTimeoutMS:Y?Y+$:0,exhaustAllowed:!0}:{socketTimeoutMS:Y};if(v&&_.rttPinger==null&&(_.rttPinger=new c(_)),y=(0,a.processTimeMS)(),v)return F=!0,N.exhaustCommand((0,a.ns)("admin.$cmd"),K,ee,(ae,ye)=>ae?J(ae):I(ye));F=!1,N.command((0,a.ns)("admin.$cmd"),K,ee).then(I,J);return}(async()=>{const j=await(0,n.makeSocket)(_.connectOptions),x=(0,n.makeConnection)(_.connectOptions,j);y=(0,a.processTimeMS)();try{return await(0,n.performInitialHandshake)(x,_.connectOptions),x}catch(Y){throw x.destroy(),Y}})().then(j=>{var Y,$;if(O(_)){j.destroy();return}const x=(0,a.calculateDurationInMs)(y);_.addRttSample(x),_.connection=j,_.emitAndLogHeartbeat(g.Server.SERVER_HEARTBEAT_SUCCEEDED,_.server.topology.s.id,(Y=j.hello)==null?void 0:Y.connectionId,new l.ServerHeartbeatSucceededEvent(_.address,x,j.hello,B(_,($=j.hello)==null?void 0:$.topologyVersion))),A(void 0,j.hello)},j=>{_.connection=null,F=!1,J(j)})}function b(_){return A=>{if(_.s.state===C){queueMicrotask(A);return}S(_,C);function y(){O(_)||S(_,m),A()}d(_,(F,R)=>{if(F&&_.server.description.type===E.ServerType.Unknown)return y();B(_,R==null?void 0:R.topologyVersion)&&(0,t.setTimeout)(()=>{var v;O(_)||(v=_.monitorId)==null||v.wake()},0),y()})}}function f(_){return{processId:_.processId,counter:r.Long.isLong(_.counter)?_.counter:r.Long.fromNumber(_.counter)}}class c{constructor(A){this.connection=void 0,this.cancellationToken=A.cancellationToken,this.closed=!1,this.monitor=A,this.latestRtt=A.latestRtt??void 0;const y=A.options.heartbeatFrequencyMS;this.monitorId=(0,t.setTimeout)(()=>this.measureRoundTripTime(),y)}get roundTripTime(){return this.monitor.roundTripTime}get minRoundTripTime(){return this.monitor.minRoundTripTime}close(){var A;this.closed=!0,(0,t.clearTimeout)(this.monitorId),(A=this.connection)==null||A.destroy(),this.connection=void 0}measureAndReschedule(A,y){if(this.closed){y==null||y.destroy();return}this.connection==null&&(this.connection=y),this.latestRtt=(0,a.calculateDurationInMs)(A),this.monitorId=(0,t.setTimeout)(()=>this.measureRoundTripTime(),this.monitor.options.heartbeatFrequencyMS)}measureRoundTripTime(){var R;const A=(0,a.processTimeMS)();if(this.closed)return;const y=this.connection;if(y==null){(0,n.connect)(this.monitor.connectOptions).then(v=>{this.measureAndReschedule(A,v)},()=>{this.connection=void 0});return}const F=(R=y.serverApi)!=null&&R.version||y.helloOk?"hello":o.LEGACY_HELLO_COMMAND;y.command((0,a.ns)("admin.$cmd"),{[F]:1},void 0).then(()=>this.measureAndReschedule(A),()=>{var v;(v=this.connection)==null||v.destroy(),this.connection=void 0})}}e.RTTPinger=c;class w{constructor(A,y={}){this.isExpeditedCallToFnScheduled=!1,this.stopped=!1,this.isExecutionInProgress=!1,this.hasExecutedOnce=!1,this._executeAndReschedule=()=>{this.stopped||(this.timerId&&(0,t.clearTimeout)(this.timerId),this.isExpeditedCallToFnScheduled=!1,this.isExecutionInProgress=!0,this.fn(()=>{this.lastExecutionEnded=(0,a.processTimeMS)(),this.isExecutionInProgress=!1,this._reschedule(this.heartbeatFrequencyMS)}))},this.fn=A,this.lastExecutionEnded=-1/0,this.heartbeatFrequencyMS=y.heartbeatFrequencyMS??1e3,this.minHeartbeatFrequencyMS=y.minHeartbeatFrequencyMS??500,y.immediate?this._executeAndReschedule():this._reschedule(void 0)}wake(){const y=(0,a.processTimeMS)()-this.lastExecutionEnded;if(y<0)return this._executeAndReschedule();if(!this.isExecutionInProgress&&!this.isExpeditedCallToFnScheduled){if(y<this.minHeartbeatFrequencyMS){this.isExpeditedCallToFnScheduled=!0,this._reschedule(this.minHeartbeatFrequencyMS-y);return}this._executeAndReschedule()}}stop(){this.stopped=!0,this.timerId&&((0,t.clearTimeout)(this.timerId),this.timerId=void 0),this.lastExecutionEnded=-1/0,this.isExpeditedCallToFnScheduled=!1}toString(){return JSON.stringify(this)}toJSON(){const A=(0,a.processTimeMS)(),y=A-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:A,timeSinceLastCall:y}}_reschedule(A){this.stopped||(this.timerId&&(0,t.clearTimeout)(this.timerId),this.timerId=(0,t.setTimeout)(this._executeAndReschedule,A||this.heartbeatFrequencyMS))}}e.MonitorInterval=w;class T{constructor(A=10){this.rttSamples=new Float64Array(A),this.length=0,this.writeIndex=0}addSample(A){this.rttSamples[this.writeIndex++]=A,this.length<this.rttSamples.length&&this.length++,this.writeIndex%=this.rttSamples.length}min(){if(this.length<2)return 0;let A=this.rttSamples[0];for(let y=1;y<this.length;y++)this.rttSamples[y]<A&&(A=this.rttSamples[y]);return A}average(){if(this.length===0)return 0;let A=0;for(let y=0;y<this.length;y++)A+=this.rttSamples[y];return A/this.length}get last(){return this.length===0?null:this.rttSamples[this.writeIndex===0?this.length-1:this.writeIndex-1]}clear(){this.length=0,this.writeIndex=0}}e.RTTSampler=T}(Js)),Js}var Za;function Dl(){return Za||(Za=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_OPTIONS=e.OPTIONS=void 0,e.resolveSRVRecord=c,e.parseOptions=R;const t=T1,r=ml(),n=Ar,i=r2,o=Fo,u=qt,h=Lo(),s=C6(),a=Q,E=En(),l=Cr,g=Pt,m=Ke,C=_l(),S=ne(),D=ct(),O=["authSource","replicaSet","loadBalanced"],M="loadBalanced option only supported with a single host in the URI",p="loadBalanced option not supported with a replicaSet option",B="loadBalanced option not supported when directConnection is provided";function d(I){return async function(j){try{return await t.promises[I](j)}catch(x){if(x.code===t.TIMEOUT)return await t.promises[I](j);throw x}}}const b=d("resolveSrv"),f=d("resolveTxt");async function c(I){if(typeof I.srvHost!="string")throw new a.MongoAPIError('Option "srvHost" must not be empty');const N=I.srvHost,j=f(N);j.then(void 0,S.squashError);const x=`_${I.srvServiceName}._tcp.${N}`,Y=await b(x);if(Y.length===0)throw new a.MongoAPIError("No addresses found at host");for(const{name:he}of Y)(0,S.checkParentDomainMatch)(he,N);const $=Y.map(he=>S.HostAddress.fromString(`${he.name}:${he.port??27017}`));v($,I,!0);let K;try{K=await j}catch(he){if(he.code!=="ENODATA"&&he.code!=="ENOTFOUND")throw he;return $}if(K.length>1)throw new a.MongoParseError("Multiple text records not allowed");const ee=new i.URLSearchParams(K[0].join(""));if([...ee.keys()].some(he=>!O.includes(he)))throw new a.MongoParseError(`Text record may only set any of: ${O.join(", ")}`);if(O.some(he=>ee.get(he)===""))throw new a.MongoParseError("Cannot have empty URI params in DNS TXT Record");const ye=ee.get("authSource")??void 0,ce=ee.get("replicaSet")??void 0,le=ee.get("loadBalanced")??void 0;if(!I.userSpecifiedAuthSource&&ye&&I.credentials&&!u.AUTH_MECHS_AUTH_SRC_EXTERNAL.has(I.credentials.mechanism)&&(I.credentials=o.MongoCredentials.merge(I.credentials,{source:ye})),!I.userSpecifiedReplicaSet&&ce&&(I.replicaSet=ce),le==="true"&&(I.loadBalanced=!0),I.replicaSet&&I.srvMaxHosts>0)throw new a.MongoParseError("Cannot combine replicaSet option with srvMaxHosts");return v($,I,!0),$}function w(I){if(!I)return;const N=(j,x)=>{if(I.has(j)&&I.has(x))throw new a.MongoAPIError(`The '${j}' option cannot be used with the '${x}' option`)};N("tlsInsecure","tlsAllowInvalidCertificates"),N("tlsInsecure","tlsAllowInvalidHostnames")}function T(I,N){if(typeof N=="boolean")return N;switch(N){case"true":return!0;case"false":return!1;default:throw new a.MongoParseError(`${I} must be either "true" or "false"`)}}function _(I,N){const j=(0,S.parseInteger)(N);if(j!=null)return j;throw new a.MongoParseError(`Expected ${I} to be stringified int value, got: ${N}`)}function A(I,N){const j=_(I,N);if(j<0)throw new a.MongoParseError(`${I} can only be a positive int value, got: ${N}`);return j}function*y(I){if(I==="")return;const N=I.split(",");for(const j of N){const[x,Y]=j.split(/:(.*)/);if(Y==null)throw new a.MongoParseError("Cannot have undefined values in key value pairs");yield[x,Y]}}class F extends Map{constructor(N=[]){super(N.map(([j,x])=>[j.toLowerCase(),x]))}has(N){return super.has(N.toLowerCase())}get(N){return super.get(N.toLowerCase())}set(N,j){return super.set(N.toLowerCase(),j)}delete(N){return super.delete(N.toLowerCase())}}function R(I,N=void 0,j={}){if(N!=null&&!(N instanceof E.MongoClient)&&(j=N,N=void 0),j.useBigInt64&&typeof j.promoteLongs=="boolean"&&!j.promoteLongs)throw new a.MongoAPIError("Must request either bigint or Long for int64 deserialization");if(j.useBigInt64&&typeof j.promoteValues=="boolean"&&!j.promoteValues)throw new a.MongoAPIError("Must request either bigint or Long for int64 deserialization");const x=new r.default(I),{hosts:Y,isSRV:$}=x,K=Object.create(null);K.hosts=$?[]:Y.map(S.HostAddress.fromString);const ee=new F;if(x.pathname!=="/"&&x.pathname!==""){const re=decodeURIComponent(x.pathname[0]==="/"?x.pathname.slice(1):x.pathname);re&&ee.set("dbName",[re])}if(x.username!==""){const re={username:decodeURIComponent(x.username)};typeof x.password=="string"&&(re.password=decodeURIComponent(x.password)),ee.set("auth",[re])}for(const re of x.searchParams.keys()){const Ce=x.searchParams.getAll(re),_e=/readPreferenceTags/i.test(re);if(!_e&&Ce.length>1)throw new a.MongoInvalidArgumentError(`URI option "${re}" cannot appear more than once in the connection string`);if(!_e&&Ce.includes(""))throw new a.MongoAPIError(`URI option "${re}" cannot be specified with no value`);ee.has(re)||ee.set(re,Ce)}const ae=new F(Object.entries(j).filter(([,re])=>re!=null));if(ee.has("serverApi"))throw new a.MongoParseError("URI cannot contain `serverApi`, it can only be passed to the client");const ye=ee.get("authMechanismProperties");if(ye){for(const re of ye)if(/(^|,)ALLOWED_HOSTS:/.test(re))throw new a.MongoParseError("Auth mechanism property ALLOWED_HOSTS is not allowed in the connection string.")}if(ae.has("loadBalanced"))throw new a.MongoParseError("loadBalanced is only a valid option in the URI");const ce=new F,le=new Set([...ee.keys(),...ae.keys()]);for(const re of le){const Ce=[],_e=ae.get(re);_e!=null&&Ce.push(_e);const He=ee.get(re)??[];Ce.push(...He),ce.set(re,Ce)}if(ce.has("tls")||ce.has("ssl")){const re=(ce.get("tls")||[]).concat(ce.get("ssl")||[]).map(T.bind(null,"tls/ssl"));if(new Set(re).size!==1)throw new a.MongoParseError("All values of tls/ssl must be the same.")}w(ce);const he=(0,S.setDifference)(le,Array.from(Object.keys(e.OPTIONS)).map(re=>re.toLowerCase()));if(he.size!==0){const re=he.size>1?"options":"option",Ce=he.size>1?"are":"is";throw new a.MongoParseError(`${re} ${Array.from(he).join(", ")} ${Ce} not supported`)}for(const[re,Ce]of Object.entries(e.OPTIONS)){const _e=ce.get(re);if(!_e||_e.length===0)e.DEFAULT_OPTIONS.has(re)&&J(K,re,Ce,[e.DEFAULT_OPTIONS.get(re)]);else{const{deprecated:He}=Ce;if(He){const nt=typeof He=="string"?`: ${He}`:"";(0,S.emitWarning)(`${re} is a deprecated option${nt}`)}J(K,re,Ce,_e)}}if(K.credentials){const re=K.credentials.mechanism===u.AuthMechanism.MONGODB_GSSAPI,Ce=K.credentials.mechanism===u.AuthMechanism.MONGODB_X509,_e=K.credentials.mechanism===u.AuthMechanism.MONGODB_AWS,He=K.credentials.mechanism===u.AuthMechanism.MONGODB_OIDC;if((re||Ce)&&ce.has("authSource")&&K.credentials.source!=="$external")throw new a.MongoParseError(`authMechanism ${K.credentials.mechanism} requires an authSource of '$external'`);if(!(re||Ce||_e||He)&&K.dbName&&!ce.has("authSource")&&(K.credentials=o.MongoCredentials.merge(K.credentials,{source:K.dbName})),_e){const{username:nt,password:k}=K.credentials;if(nt||k)throw new a.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(K.credentials.mechanismProperties.AWS_SESSION_TOKEN)throw new a.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.")}K.credentials.validate(),K.credentials.password===""&&K.credentials.username===""&&K.credentials.mechanism===u.AuthMechanism.MONGODB_DEFAULT&&Object.keys(K.credentials.mechanismProperties).length===0&&delete K.credentials}if(K.dbName||(K.dbName="test"),v(Y,K,$),N&&K.autoEncryption&&(s.Encrypter.checkForMongoCrypt(),K.encrypter=new s.Encrypter(N,I,j),K.autoEncrypter=K.encrypter.autoEncrypter),K.userSpecifiedAuthSource=ae.has("authSource")||ee.has("authSource"),K.userSpecifiedReplicaSet=ae.has("replicaSet")||ee.has("replicaSet"),$){if(K.srvHost=Y[0],K.directConnection)throw new a.MongoAPIError("SRV URI does not support directConnection");if(K.srvMaxHosts>0&&typeof K.replicaSet=="string")throw new a.MongoParseError("Cannot use srvMaxHosts option with replicaSet");const re=!ae.has("tls")&&!ee.has("tls"),Ce=!ae.has("ssl")&&!ee.has("ssl");re&&Ce&&(K.tls=!0)}else if(ee.has("srvMaxHosts")||ae.has("srvMaxHosts")||ee.has("srvServiceName")||ae.has("srvServiceName"))throw new a.MongoParseError("Cannot use srvMaxHosts or srvServiceName with a non-srv connection string");if(K.directConnection&&K.hosts.length!==1)throw new a.MongoParseError("directConnection option requires exactly one host");if(!K.proxyHost&&(K.proxyPort||K.proxyUsername||K.proxyPassword))throw new a.MongoParseError("Must specify proxyHost if other proxy options are passed");if(K.proxyUsername&&!K.proxyPassword||!K.proxyUsername&&K.proxyPassword)throw new a.MongoParseError("Can only specify both of proxy username/password or neither");if(["proxyHost","proxyPort","proxyUsername","proxyPassword"].map(re=>ee.get(re)??[]).some(re=>re.length>1))throw new a.MongoParseError("Proxy options cannot be specified multiple times in the connection string");return K.mongoLoggerOptions=l.MongoLogger.resolveOptions({MONGODB_LOG_COMMAND:n.env.MONGODB_LOG_COMMAND,MONGODB_LOG_TOPOLOGY:n.env.MONGODB_LOG_TOPOLOGY,MONGODB_LOG_SERVER_SELECTION:n.env.MONGODB_LOG_SERVER_SELECTION,MONGODB_LOG_CONNECTION:n.env.MONGODB_LOG_CONNECTION,MONGODB_LOG_CLIENT:n.env.MONGODB_LOG_CLIENT,MONGODB_LOG_ALL:n.env.MONGODB_LOG_ALL,MONGODB_LOG_MAX_DOCUMENT_LENGTH:n.env.MONGODB_LOG_MAX_DOCUMENT_LENGTH,MONGODB_LOG_PATH:n.env.MONGODB_LOG_PATH},{mongodbLogPath:K.mongodbLogPath,mongodbLogComponentSeverities:K.mongodbLogComponentSeverities,mongodbLogMaxDocumentLength:K.mongodbLogMaxDocumentLength}),K}function v(I,N,j){if(N.loadBalanced){if(I.length>1)throw new a.MongoParseError(M);if(N.replicaSet)throw new a.MongoParseError(p);if(N.directConnection)throw new a.MongoParseError(B);if(j&&N.srvMaxHosts>0)throw new a.MongoParseError("Cannot limit srv hosts with loadBalanced enabled")}}function J(I,N,j,x){const{target:Y,type:$,transform:K}=j,ee=Y??N;switch($){case"boolean":I[ee]=T(ee,x[0]);break;case"int":I[ee]=_(ee,x[0]);break;case"uint":I[ee]=A(ee,x[0]);break;case"string":if(x[0]==null)break;I[ee]=String(x[0]);break;case"record":if(!(0,S.isRecord)(x[0]))throw new a.MongoParseError(`${ee} must be an object`);I[ee]=x[0];break;case"any":I[ee]=x[0];break;default:{if(!K)throw new a.MongoParseError("Descriptors missing a type must define a transform");const ae=K({name:ee,options:I,values:x});I[ee]=ae;break}}}e.OPTIONS={appName:{type:"string"},auth:{target:"credentials",transform({name:I,options:N,values:[j]}){if(!(0,S.isRecord)(j,["username","password"]))throw new a.MongoParseError(`${I} must be an object with 'username' and 'password' properties`);return o.MongoCredentials.merge(N.credentials,{username:j.username,password:j.password})}},authMechanism:{target:"credentials",transform({options:I,values:[N]}){var K,ee;const j=Object.values(u.AuthMechanism),[x]=j.filter(ae=>ae.match(RegExp(String.raw`\b${N}\b`,"i")));if(!x)throw new a.MongoParseError(`authMechanism one of ${j}, got ${N}`);let Y=(K=I.credentials)==null?void 0:K.source;(x===u.AuthMechanism.MONGODB_PLAIN||u.AUTH_MECHS_AUTH_SRC_EXTERNAL.has(x))&&(Y="$external");let $=(ee=I.credentials)==null?void 0:ee.password;return x===u.AuthMechanism.MONGODB_X509&&$===""&&($=void 0),o.MongoCredentials.merge(I.credentials,{mechanism:x,source:Y,password:$})}},authMechanismProperties:{target:"credentials",transform({options:I,values:N}){let j=Object.create(null);for(const x of N)if(typeof x=="string")for(const[Y,$]of y(x))try{j[Y]=T(Y,$)}catch{j[Y]=$}else{if(!(0,S.isRecord)(x))throw new a.MongoParseError("AuthMechanismProperties must be an object");j={...x}}return o.MongoCredentials.merge(I.credentials,{mechanismProperties:j})}},authSource:{target:"credentials",transform({options:I,values:[N]}){const j=String(N);return o.MongoCredentials.merge(I.credentials,{source:j})}},autoEncryption:{type:"record"},autoSelectFamily:{type:"boolean",default:!0},autoSelectFamilyAttemptTimeout:{type:"uint"},bsonRegExp:{type:"boolean"},serverApi:{target:"serverApi",transform({values:[I]}){const N=typeof I=="string"?{version:I}:I,j=N&&N.version;if(!j)throw new a.MongoParseError(`Invalid \`serverApi\` property; must specify a version from the following enum: ["${Object.values(E.ServerApiVersion).join('", "')}"]`);if(!Object.values(E.ServerApiVersion).some(x=>x===j))throw new a.MongoParseError(`Invalid server API version=${j}; must be in the following enum: ["${Object.values(E.ServerApiVersion).join('", "')}"]`);return N}},checkKeys:{type:"boolean"},compressors:{default:"none",target:"compressors",transform({values:I}){const N=new Set;for(const j of I){const x=typeof j=="string"?j.split(","):j;if(!Array.isArray(x))throw new a.MongoInvalidArgumentError("compressors must be an array or a comma-delimited list of strings");for(const Y of x)if(Object.keys(h.Compressor).includes(String(Y)))N.add(String(Y));else throw new a.MongoInvalidArgumentError(`${Y} is not a valid compression mechanism. Must be one of: ${Object.keys(h.Compressor)}.`)}return[...N]}},connectTimeoutMS:{default:3e4,type:"uint"},dbName:{type:"string"},directConnection:{default:!1,type:"boolean"},driverInfo:{default:{},type:"record"},enableUtf8Validation:{type:"boolean",default:!0},family:{transform({name:I,values:[N]}){const j=_(I,N);if(j===4||j===6)return j;throw new a.MongoParseError(`Option 'family' must be 4 or 6 got ${j}.`)}},fieldsAsRaw:{type:"record"},forceServerObjectId:{default:!1,type:"boolean"},fsync:{deprecated:"Please use journal instead",target:"writeConcern",transform({name:I,options:N,values:[j]}){const x=D.WriteConcern.fromOptions({writeConcern:{...N.writeConcern,fsync:T(I,j)}});if(!x)throw new a.MongoParseError(`Unable to make a writeConcern from fsync=${j}`);return x}},heartbeatFrequencyMS:{default:1e4,type:"uint"},ignoreUndefined:{type:"boolean"},j:{deprecated:"Please use journal instead",target:"writeConcern",transform({name:I,options:N,values:[j]}){const x=D.WriteConcern.fromOptions({writeConcern:{...N.writeConcern,journal:T(I,j)}});if(!x)throw new a.MongoParseError(`Unable to make a writeConcern from journal=${j}`);return x}},journal:{target:"writeConcern",transform({name:I,options:N,values:[j]}){const x=D.WriteConcern.fromOptions({writeConcern:{...N.writeConcern,journal:T(I,j)}});if(!x)throw new a.MongoParseError(`Unable to make a writeConcern from journal=${j}`);return x}},loadBalanced:{default:!1,type:"boolean"},localThresholdMS:{default:15,type:"uint"},maxConnecting:{default:2,transform({name:I,values:[N]}){const j=A(I,N);if(j===0)throw new a.MongoInvalidArgumentError("maxConnecting must be > 0 if specified");return j}},maxIdleTimeMS:{default:0,type:"uint"},maxPoolSize:{default:100,type:"uint"},maxStalenessSeconds:{target:"readPreference",transform({name:I,options:N,values:[j]}){const x=A(I,j);return N.readPreference?m.ReadPreference.fromOptions({readPreference:{...N.readPreference,maxStalenessSeconds:x}}):new m.ReadPreference("secondary",void 0,{maxStalenessSeconds:x})}},minInternalBufferSize:{type:"uint"},minPoolSize:{default:0,type:"uint"},minHeartbeatFrequencyMS:{default:500,type:"uint"},monitorCommands:{default:!1,type:"boolean"},name:{target:"driverInfo",transform({values:[I],options:N}){return{...N.driverInfo,name:String(I)}}},noDelay:{default:!0,type:"boolean"},pkFactory:{default:S.DEFAULT_PK_FACTORY,transform({values:[I]}){if((0,S.isRecord)(I,["createPk"])&&typeof I.createPk=="function")return I;throw new a.MongoParseError(`Option pkFactory must be an object with a createPk function, got ${I}`)}},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:[I],options:N}){if(I instanceof g.ReadConcern||(0,S.isRecord)(I,["level"]))return g.ReadConcern.fromOptions({...N.readConcern,...I});throw new a.MongoParseError(`ReadConcern must be an object, got ${JSON.stringify(I)}`)}},readConcernLevel:{target:"readConcern",transform({values:[I],options:N}){return g.ReadConcern.fromOptions({...N.readConcern,level:I})}},readPreference:{default:m.ReadPreference.primary,transform({values:[I],options:N}){var j,x,Y;if(I instanceof m.ReadPreference)return m.ReadPreference.fromOptions({readPreference:{...N.readPreference,...I},...I});if((0,S.isRecord)(I,["mode"])){const $=m.ReadPreference.fromOptions({readPreference:{...N.readPreference,...I},...I});if($)return $;throw new a.MongoParseError(`Cannot make read preference from ${JSON.stringify(I)}`)}if(typeof I=="string"){const $={hedge:(j=N.readPreference)==null?void 0:j.hedge,maxStalenessSeconds:(x=N.readPreference)==null?void 0:x.maxStalenessSeconds};return new m.ReadPreference(I,(Y=N.readPreference)==null?void 0:Y.tags,$)}throw new a.MongoParseError(`Unknown ReadPreference value: ${I}`)}},readPreferenceTags:{target:"readPreference",transform({values:I,options:N}){const j=Array.isArray(I[0])?I[0]:I,x=[];for(const Y of j){const $=Object.create(null);if(typeof Y=="string")for(const[K,ee]of y(Y))$[K]=ee;if((0,S.isRecord)(Y))for(const[K,ee]of Object.entries(Y))$[K]=ee;x.push($)}return m.ReadPreference.fromOptions({readPreference:N.readPreference,readPreferenceTags:x})}},replicaSet:{type:"string"},retryReads:{default:!0,type:"boolean"},retryWrites:{default:!0,type:"boolean"},serializeFunctions:{type:"boolean"},serverMonitoringMode:{default:"auto",transform({values:[I]}){if(!Object.values(C.ServerMonitoringMode).includes(I))throw new a.MongoParseError("serverMonitoringMode must be one of `auto`, `poll`, or `stream`");return I}},serverSelectionTimeoutMS:{default:3e4,type:"uint"},servername:{type:"string"},socketTimeoutMS:{default:0,type:"uint"},srvMaxHosts:{type:"uint",default:0},srvServiceName:{type:"string",default:"mongodb"},ssl:{target:"tls",type:"boolean"},timeoutMS:{type:"uint"},tls:{type:"boolean"},tlsAllowInvalidCertificates:{target:"rejectUnauthorized",transform({name:I,values:[N]}){return!T(I,N)}},tlsAllowInvalidHostnames:{target:"checkServerIdentity",transform({name:I,values:[N]}){return T(I,N)?()=>{}:void 0}},tlsCAFile:{type:"string"},tlsCRLFile:{type:"string"},tlsCertificateKeyFile:{type:"string"},tlsCertificateKeyFilePassword:{target:"passphrase",type:"any"},tlsInsecure:{transform({name:I,options:N,values:[j]}){const x=T(I,j);return x?(N.checkServerIdentity=()=>{},N.rejectUnauthorized=!1):(N.checkServerIdentity=N.tlsAllowInvalidHostnames?()=>{}:void 0,N.rejectUnauthorized=!N.tlsAllowInvalidCertificates),x}},w:{target:"writeConcern",transform({values:[I],options:N}){return D.WriteConcern.fromOptions({writeConcern:{...N.writeConcern,w:I}})}},waitQueueTimeoutMS:{default:0,type:"uint"},writeConcern:{target:"writeConcern",transform({values:[I],options:N}){if((0,S.isRecord)(I)||I instanceof D.WriteConcern)return D.WriteConcern.fromOptions({writeConcern:{...N.writeConcern,...I}});if(I==="majority"||typeof I=="number")return D.WriteConcern.fromOptions({writeConcern:{...N.writeConcern,w:I}});throw new a.MongoParseError(`Invalid WriteConcern cannot parse: ${JSON.stringify(I)}`)}},wtimeout:{deprecated:"Please use wtimeoutMS instead",target:"writeConcern",transform({values:[I],options:N}){const j=D.WriteConcern.fromOptions({writeConcern:{...N.writeConcern,wtimeout:A("wtimeout",I)}});if(j)return j;throw new a.MongoParseError("Cannot make WriteConcern from wtimeout")}},wtimeoutMS:{target:"writeConcern",transform({values:[I],options:N}){const j=D.WriteConcern.fromOptions({writeConcern:{...N.writeConcern,wtimeoutMS:A("wtimeoutMS",I)}});if(j)return j;throw new a.MongoParseError("Cannot make WriteConcern from wtimeout")}},zlibCompressionLevel:{default:0,type:"int"},mongodbLogPath:{transform({values:[I]}){if(!(typeof I=="string"&&["stderr","stdout"].includes(I)||I&&typeof I=="object"&&"write"in I&&typeof I.write=="function"))throw new a.MongoAPIError("Option 'mongodbLogPath' must be of type 'stderr' | 'stdout' | MongoDBLogWritable");return I}},mongodbLogComponentSeverities:{transform({values:[I]}){if(typeof I!="object"||!I)throw new a.MongoAPIError("Option 'mongodbLogComponentSeverities' must be a non-null object");for(const[N,j]of Object.entries(I)){if(typeof j!="string"||typeof N!="string")throw new a.MongoAPIError("User input for option 'mongodbLogComponentSeverities' object cannot include a non-string key or value");if(!Object.values(l.MongoLoggableComponent).some(x=>x===N)&&N!=="default")throw new a.MongoAPIError(`User input for option 'mongodbLogComponentSeverities' contains invalid key: ${N}`);if(!Object.values(l.SeverityLevel).some(x=>x===j))throw new a.MongoAPIError(`Option 'mongodbLogComponentSeverities' does not support ${j} as a value for ${N}`)}return I}},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"}},e.DEFAULT_OPTIONS=new F(Object.entries(e.OPTIONS).filter(([,I])=>I.default!=null).map(([I,N])=>[I,N.default]))}(Vs)),Vs}var Ci={},zo={},wu={};Object.defineProperty(wu,"__esModule",{value:!0});wu.aws4Sign=Om;const ro=pe,$a=async e=>{const t=p1(e),r=await crypto.subtle.digest("SHA-256",t);return ro.BSON.onDemand.ByteUtils.toHex(new Uint8Array(r))},kn=async(e,t)=>{let r;typeof e=="string"?r=p1(e):r=e;const n=await crypto.subtle.importKey("raw",r,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),i=p1(t),o=await crypto.subtle.sign("HMAC",n,i);return new Uint8Array(o)},Dr=e=>e.toString().trim().replace(/\s+/g," ");function p1(e){const t=new Uint8Array(ro.BSON.onDemand.ByteUtils.utf8ByteLength(e));return ro.BSON.onDemand.ByteUtils.encodeUTF8Into(t,e,0),t}async function Om(e,t){const n=e.date.toISOString().replace(/[:-]|\.\d{3}/g,""),i=n.substring(0,8),o=e.method,u=e.path,h="",s=new Headers({"content-length":Dr(e.headers["Content-Length"]),"content-type":Dr(e.headers["Content-Type"]),host:Dr(e.host),"x-amz-date":Dr(n),"x-mongodb-gs2-cb-flag":Dr(e.headers["X-MongoDB-GS2-CB-Flag"]),"x-mongodb-server-nonce":Dr(e.headers["X-MongoDB-Server-Nonce"])});"sessionToken"in t&&t.sessionToken&&s.append("x-amz-security-token",Dr(t.sessionToken));const a=Array.from(s.entries()).map(([w,T])=>`${w.toLowerCase()}:${T}`).sort().join(`
9
+ `),l=Array.from(s.keys()).map(w=>w.toLowerCase()).sort().join(";"),g=await $a(e.body),m=[o,u,h,a+`
10
+ `,l,g].join(`
11
+ `),C=await $a(m),S="AWS4-HMAC-SHA256",D=`${i}/${e.region}/${e.service}/aws4_request`,O=[S,n,D,C].join(`
12
+ `),M=await kn("AWS4"+t.secretAccessKey,i),p=await kn(M,e.region),B=await kn(p,e.service),d=await kn(B,"aws4_request"),b=await kn(d,O),f=ro.BSON.onDemand.ByteUtils.toHex(b);return{Authorization:["AWS4-HMAC-SHA256 Credential="+t.accessKeyId+"/"+D,"SignedHeaders="+l,"Signature="+f].join(", "),"X-Amz-Date":n}}Object.defineProperty(zo,"__esModule",{value:!0});zo.MongoDBAWS=void 0;const e1=pe,sn=Q,on=ne(),wm=Dt,_m=Ai,Dm=wu,Tm=Fo,Bm=qt,bm=110,t1={useBigInt64:!1,promoteLongs:!0,promoteValues:!0,promoteBuffers:!1,bsonRegExp:!1};class Mm extends wm.AuthProvider{constructor(t){super(),this.credentialFetcher=new _m.AWSSDKCredentialProvider(t)}async auth(t){const{connection:r}=t;if(!t.credentials)throw new sn.MongoMissingCredentialsError("AuthContext must provide credentials.");if((0,on.maxWireVersion)(r)<9)throw new sn.MongoCompatibilityError("MONGODB-AWS authentication requires MongoDB version 4.4 or later");t.credentials=await Fm(t.credentials,this.credentialFetcher);const{credentials:n}=t,i=n.username,o=n.password,u=n.mechanismProperties.AWS_SESSION_TOKEN,h=u?{accessKeyId:i,secretAccessKey:o,sessionToken:u}:{accessKeyId:i,secretAccessKey:o},s=n.source,a=await(0,on.randomBytes)(32),E={saslStart:1,mechanism:"MONGODB-AWS",payload:e1.serialize({r:a,p:bm},t1)},l=await r.command((0,on.ns)(`${s}.$cmd`),E,void 0),g=e1.deserialize(l.payload.buffer,t1),m=g.h,C=g.s.buffer;if(C.length!==64)throw new sn.MongoRuntimeError(`Invalid server nonce length ${C.length}, expected 64`);if(!on.ByteUtils.equals(C.subarray(0,a.byteLength),a))throw new sn.MongoRuntimeError("Server nonce does not begin with client nonce");if(m.length<1||m.length>255||m.indexOf("..")!==-1)throw new sn.MongoRuntimeError(`Server returned an invalid host: "${m}"`);const S="Action=GetCallerIdentity&Version=2011-06-15",D=await(0,Dm.aws4Sign)({method:"POST",host:m,region:Rm(g.h),service:"sts",headers:{"Content-Type":"application/x-www-form-urlencoded","Content-Length":S.length,"X-MongoDB-Server-Nonce":on.ByteUtils.toBase64(C),"X-MongoDB-GS2-CB-Flag":"n"},path:"/",body:S,date:new Date},h),O={a:D.Authorization,d:D["X-Amz-Date"]};u&&(O.t=u);const M={saslContinue:1,conversationId:l.conversationId,payload:e1.serialize(O,t1)};await r.command((0,on.ns)(`${s}.$cmd`),M,void 0)}}zo.MongoDBAWS=Mm;async function Fm(e,t){function r(i){if(!i.AccessKeyId||!i.SecretAccessKey)throw new sn.MongoMissingCredentialsError("Could not obtain temporary MONGODB-AWS credentials");return new Tm.MongoCredentials({username:i.AccessKeyId,password:i.SecretAccessKey,source:e.source,mechanism:Bm.AuthMechanism.MONGODB_AWS,mechanismProperties:{AWS_SESSION_TOKEN:i.Token}})}const n=await t.getCredentials();return r(n)}function Rm(e){const t=e.split(".");return t.length===1||t[1]==="amazonaws"?"us-east-1":t[1]}var r1={},Un={},Zt={},Vo={};Object.defineProperty(Vo,"__esModule",{value:!0});Vo.finishCommandDocument=Nm;Vo.startCommandDocument=Im;const hn=pe,Tl=qt;function Nm(e,t){return t!=null?{saslContinue:1,conversationId:t,payload:new hn.Binary(hn.BSON.serialize({jwt:e}))}:{saslStart:1,mechanism:Tl.AuthMechanism.MONGODB_OIDC,payload:new hn.Binary(hn.BSON.serialize({jwt:e}))}}function Im(e){const t={};return e.username&&(t.n=e.username),{saslStart:1,autoAuthorize:1,mechanism:Tl.AuthMechanism.MONGODB_OIDC,payload:new hn.Binary(hn.BSON.serialize(t))}}Object.defineProperty(Zt,"__esModule",{value:!0});Zt.CallbackWorkflow=Zt.AUTOMATED_TIMEOUT_MS=Zt.HUMAN_TIMEOUT_MS=void 0;const vm=Fc,Pm=Q,ec=ne(),n1=Vo;Zt.HUMAN_TIMEOUT_MS=3e5;Zt.AUTOMATED_TIMEOUT_MS=6e4;const Lm=["accessToken","expiresInSeconds","refreshToken"],km="User provided OIDC callbacks must return a valid object with an accessToken.",i1=100;class Um{constructor(t,r){this.cache=t,this.callback=this.withLock(r),this.lastExecutionTime=Date.now()-i1}async speculativeAuth(t,r){if(this.cache.hasAccessToken){const n=this.cache.getAccessToken();t.accessToken=n;const i=(0,n1.finishCommandDocument)(n);return i.db=r.source,{speculativeAuthenticate:i}}return{}}async reauthenticate(t,r){this.cache.hasAccessToken&&(t.accessToken===this.cache.getAccessToken()?(this.cache.removeAccessToken(),delete t.accessToken):t.accessToken=this.cache.getAccessToken()),await this.execute(t,r)}async startAuthentication(t,r,n){let i;return n!=null&&n.speculativeAuthenticate?i=n.speculativeAuthenticate:i=await t.command((0,ec.ns)(r.source),(0,n1.startCommandDocument)(r),void 0),i}async finishAuthentication(t,r,n,i){await t.command((0,ec.ns)(r.source),(0,n1.finishCommandDocument)(n,i),void 0)}async executeAndValidateCallback(t){const r=await this.callback(t);if(jm(r))throw new Pm.MongoMissingCredentialsError(km);return r}withLock(t){let r=Promise.resolve();return async n=>(await r,r=r.catch(()=>null).then(async()=>{const i=Date.now()-this.lastExecutionTime;return i<=i1&&await(0,vm.setTimeout)(i1-i,{signal:n.timeoutContext}),this.lastExecutionTime=Date.now(),await t(n)}),await r)}}Zt.CallbackWorkflow=Um;function jm(e){return e==null||typeof e!="object"||!("accessToken"in e)?!0:!Object.getOwnPropertyNames(e).every(t=>Lm.includes(t))}var tc;function Bl(){if(tc)return Un;tc=1,Object.defineProperty(Un,"__esModule",{value:!0}),Un.AutomatedCallbackWorkflow=void 0;const e=Q,t=Te,r=_u(),n=Zt;class i extends n.CallbackWorkflow{constructor(u,h){super(u,h)}async execute(u,h){if(this.cache.hasAccessToken){const a=this.cache.getAccessToken();u.accessToken||(u.accessToken=a);try{return await this.finishAuthentication(u,h,a)}catch(E){if(E instanceof e.MongoError&&E.code===e.MONGODB_ERROR_CODES.AuthenticationFailed)return this.cache.removeAccessToken(),await this.execute(u,h);throw E}}const s=await this.fetchAccessToken(h);this.cache.put(s),u.accessToken=s.accessToken,await this.finishAuthentication(u,h,s.accessToken)}async fetchAccessToken(u){const h=new AbortController,s={timeoutContext:h.signal,version:r.OIDC_VERSION};u.username&&(s.username=u.username),u.mechanismProperties.TOKEN_RESOURCE&&(s.tokenAudience=u.mechanismProperties.TOKEN_RESOURCE);const a=t.Timeout.expires(n.AUTOMATED_TIMEOUT_MS);try{return await Promise.race([this.executeAndValidateCallback(s),a])}catch(E){throw t.TimeoutError.is(E)?(h.abort(),new e.MongoOIDCError(`OIDC callback timed out after ${n.AUTOMATED_TIMEOUT_MS}ms.`)):E}finally{a.clear()}}}return Un.AutomatedCallbackWorkflow=i,Un}var Wo={};Object.defineProperty(Wo,"__esModule",{value:!0});Wo.callback=void 0;const rc=gu,C1=Q,xm=ne(),zm=Object.freeze({Metadata:"true",Accept:"application/json"}),Vm="Azure endpoint did not return a value with only access_token and expires_in properties",Wm="TOKEN_RESOURCE must be set in the auth mechanism properties when ENVIRONMENT is azure.",Gm=async e=>{const t=e.tokenAudience,r=e.username;if(!t)throw new C1.MongoAzureError(Wm);const n=await qm(t,r);if(!Hm(n))throw new C1.MongoAzureError(Vm);return n};Wo.callback=Gm;async function qm(e,t){const r=new URL(rc.AZURE_BASE_URL);(0,rc.addAzureParams)(r,e,t);const n=await(0,xm.get)(r,{headers:zm});if(n.status!==200)throw new C1.MongoAzureError(`Status code ${n.status} returned from the Azure endpoint. Response body: ${n.body}`);const i=JSON.parse(n.body);return{accessToken:i.access_token,expiresInSeconds:Number(i.expires_in)}}function Hm(e){return e==null||typeof e!="object"?!1:"accessToken"in e&&typeof e.accessToken=="string"&&"expiresInSeconds"in e&&typeof e.expiresInSeconds=="number"}var Go={};Object.defineProperty(Go,"__esModule",{value:!0});Go.callback=void 0;const bl=Q,Km=ne(),Ym="http://metadata/computeMetadata/v1/instance/service-accounts/default/identity",Xm=Object.freeze({"Metadata-Flavor":"Google"}),Jm="TOKEN_RESOURCE must be set in the auth mechanism properties when ENVIRONMENT is gcp.",Qm=async e=>{const t=e.tokenAudience;if(!t)throw new bl.MongoGCPError(Jm);return await Zm(t)};Go.callback=Qm;async function Zm(e){const t=new URL(Ym);t.searchParams.append("audience",e);const r=await(0,Km.get)(t,{headers:Xm});if(r.status!==200)throw new bl.MongoGCPError(`Status code ${r.status} returned from the GCP endpoint. Response body: ${r.body}`);return{accessToken:r.body}}var qo={};Object.defineProperty(qo,"__esModule",{value:!0});qo.callback=void 0;const $m=Ic,ki=Ar,eE="/var/run/secrets/kubernetes.io/serviceaccount/token",nc="AZURE_FEDERATED_TOKEN_FILE",ic="AWS_WEB_IDENTITY_TOKEN_FILE",tE=async()=>{let e;return ki.env[nc]?e=ki.env[nc]:ki.env[ic]?e=ki.env[ic]:e=eE,{accessToken:await(0,$m.readFile)(e,"utf8")}};qo.callback=tE;var Si={};Object.defineProperty(Si,"__esModule",{value:!0});Si.TokenCache=void 0;const rE=Q;class o1 extends rE.MongoDriverError{}class nE{get hasAccessToken(){return!!this.accessToken}get hasRefreshToken(){return!!this.refreshToken}get hasIdpInfo(){return!!this.idpInfo}getAccessToken(){if(!this.accessToken)throw new o1("Attempted to get an access token when none exists.");return this.accessToken}getRefreshToken(){if(!this.refreshToken)throw new o1("Attempted to get a refresh token when none exists.");return this.refreshToken}getIdpInfo(){if(!this.idpInfo)throw new o1("Attempted to get IDP information when none exists.");return this.idpInfo}put(t,r){this.accessToken=t.accessToken,this.refreshToken=t.refreshToken,this.expiresInSeconds=t.expiresInSeconds,r&&(this.idpInfo=r)}removeAccessToken(){this.accessToken=void 0}removeRefreshToken(){this.refreshToken=void 0}}Si.TokenCache=nE;var Ho={};Object.defineProperty(Ho,"__esModule",{value:!0});Ho.callback=void 0;const iE=D1,oE=Ar,sE=Q,uE="OIDC_TOKEN_FILE must be set in the environment.",aE=async()=>{const e=oE.env.OIDC_TOKEN_FILE;if(!e)throw new sE.MongoAWSError(uE);return{accessToken:await iE.promises.readFile(e,"utf8")}};Ho.callback=aE;var oc;function _u(){return oc||(oc=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MongoDBOIDC=e.OIDC_WORKFLOWS=e.OIDC_VERSION=void 0;const t=Q,r=Dt,n=Bl(),i=Wo,o=Go,u=qo,h=Si,s=Ho,a="AuthContext must provide credentials.";e.OIDC_VERSION=1,e.OIDC_WORKFLOWS=new Map,e.OIDC_WORKFLOWS.set("test",()=>new n.AutomatedCallbackWorkflow(new h.TokenCache,s.callback)),e.OIDC_WORKFLOWS.set("azure",()=>new n.AutomatedCallbackWorkflow(new h.TokenCache,i.callback)),e.OIDC_WORKFLOWS.set("gcp",()=>new n.AutomatedCallbackWorkflow(new h.TokenCache,o.callback)),e.OIDC_WORKFLOWS.set("k8s",()=>new n.AutomatedCallbackWorkflow(new h.TokenCache,u.callback));class E extends r.AuthProvider{constructor(m){if(super(),!m)throw new t.MongoInvalidArgumentError("No workflow provided to the OIDC auth provider.");this.workflow=m}async auth(m){var M;const{connection:C,reauthenticating:S,response:D}=m;if((M=D==null?void 0:D.speculativeAuthenticate)!=null&&M.done&&!S)return;const O=l(m);S?await this.workflow.reauthenticate(C,O):await this.workflow.execute(C,O,D)}async prepare(m,C){const{connection:S}=C,D=l(C),O=await this.workflow.speculativeAuth(S,D);return{...m,...O}}}e.MongoDBOIDC=E;function l(g){const{credentials:m}=g;if(!m)throw new t.MongoMissingCredentialsError(a);return m}}(r1)),r1}var Ko={};Object.defineProperty(Ko,"__esModule",{value:!0});Ko.HumanCallbackWorkflow=void 0;const cE=pe,jn=Q,sc=Te,lE=_u(),s1=Zt;class hE extends s1.CallbackWorkflow{constructor(t,r){super(t,r)}async execute(t,r){if(this.cache.hasAccessToken){const h=this.cache.getAccessToken();t.accessToken=h;try{return await this.finishAuthentication(t,r,h)}catch(s){if(s instanceof jn.MongoError&&s.code===jn.MONGODB_ERROR_CODES.AuthenticationFailed)return this.cache.removeAccessToken(),delete t.accessToken,await this.execute(t,r);throw s}}if(this.cache.hasRefreshToken){const h=this.cache.getRefreshToken(),s=await this.fetchAccessToken(this.cache.getIdpInfo(),r,h);this.cache.put(s),t.accessToken=s.accessToken;try{return await this.finishAuthentication(t,r,s.accessToken)}catch(a){if(a instanceof jn.MongoError&&a.code===jn.MONGODB_ERROR_CODES.AuthenticationFailed)return this.cache.removeRefreshToken(),delete t.accessToken,await this.execute(t,r);throw a}}const n=await this.startAuthentication(t,r),i=n.conversationId,o=cE.BSON.deserialize(n.payload.buffer),u=await this.fetchAccessToken(o,r);return this.cache.put(u,o),t.accessToken=u.accessToken,await this.finishAuthentication(t,r,u.accessToken,i)}async fetchAccessToken(t,r,n){const i=new AbortController,o={timeoutContext:i.signal,version:lE.OIDC_VERSION,idpInfo:t};r.username&&(o.username=r.username),n&&(o.refreshToken=n);const u=sc.Timeout.expires(s1.HUMAN_TIMEOUT_MS);try{return await Promise.race([this.executeAndValidateCallback(o),u])}catch(h){throw sc.TimeoutError.is(h)?(i.abort(),new jn.MongoOIDCError(`OIDC callback timed out after ${s1.HUMAN_TIMEOUT_MS}ms.`)):h}finally{u.clear()}}}Ko.HumanCallbackWorkflow=hE;var Yo={};Object.defineProperty(Yo,"__esModule",{value:!0});Yo.Plain=void 0;const dE=pe,fE=Q,mE=ne(),EE=Dt;class gE extends EE.AuthProvider{async auth(t){const{connection:r,credentials:n}=t;if(!n)throw new fE.MongoMissingCredentialsError("AuthContext must provide credentials.");const{username:i,password:o}=n,h={saslStart:1,mechanism:"PLAIN",payload:new dE.Binary(Buffer.from(`\0${i}\0${o}`)),autoAuthorize:1};await r.command((0,mE.ns)("$external.$cmd"),h,void 0)}}Yo.Plain=gE;var mn={};const uc=e=>e.codePointAt(0),AE=e=>e[0],pE=e=>e[e.length-1];function ac(e){const t=[],r=e.length;for(let n=0;n<r;n+=1){const i=e.charCodeAt(n);if(i>=55296&&i<=56319&&r>n+1){const o=e.charCodeAt(n+1);if(o>=56320&&o<=57343){t.push((i-55296)*1024+o-56320+65536),n+=1;continue}}t.push(i)}return t}function Zn({unassigned_code_points:e,commonly_mapped_to_nothing:t,non_ASCII_space_characters:r,prohibited_characters:n,bidirectional_r_al:i,bidirectional_l:o},u,h={}){const s=r,a=t;if(typeof u!="string")throw new TypeError("Expected string.");if(u.length===0)return"";const E=ac(u).map(M=>s.get(M)?32:M).filter(M=>!a.get(M)),l=String.fromCodePoint.apply(null,E).normalize("NFKC"),g=ac(l);if(g.some(M=>n.get(M)))throw new Error("Prohibited character, see https://tools.ietf.org/html/rfc4013#section-2.3");if(h.allowUnassigned!==!0&&g.some(p=>e.get(p)))throw new Error("Unassigned code point, see https://tools.ietf.org/html/rfc4013#section-2.5");const C=g.some(M=>i.get(M)),S=g.some(M=>o.get(M));if(C&&S)throw new Error("String must not contain RandALCat and LCat at the same time, see https://tools.ietf.org/html/rfc3454#section-6");const D=i.get(uc(AE(l))),O=i.get(uc(pE(l)));if(C&&!(D&&O))throw new 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 l}Zn.saslprep=Zn;Zn.default=Zn;var CE=Zn,Du={},SE=rr;function rr(e,t){if(!(this instanceof rr))return new rr(e,t);this.length=0,this.updates=[],this.path=new Uint16Array(4),this.pages=new Array(32768),this.maxPages=this.pages.length,this.level=0,this.pageSize=e||1024,this.deduplicate=t?t.deduplicate:null,this.zeros=this.deduplicate?Xo(this.deduplicate.length):null}rr.prototype.updated=function(e){for(;this.deduplicate&&e.buffer[e.deduplicate]===this.deduplicate[e.deduplicate];)if(e.deduplicate++,e.deduplicate===this.deduplicate.length){e.deduplicate=0,e.buffer.equals&&e.buffer.equals(this.deduplicate)&&(e.buffer=this.deduplicate);break}e.updated||!this.updates||(e.updated=!0,this.updates.push(e))};rr.prototype.lastUpdate=function(){if(!this.updates||!this.updates.length)return null;var e=this.updates.pop();return e.updated=!1,e};rr.prototype._array=function(e,t){if(e>=this.maxPages){if(t)return;yE(this,e)}_E(e,this.path);for(var r=this.pages,n=this.level;n>0;n--){var i=this.path[n],o=r[i];if(!o){if(t)return;o=r[i]=new Array(32768)}r=o}return r};rr.prototype.get=function(e,t){var r=this._array(e,t),n=this.path[0],i=r&&r[n];return!i&&!t&&(i=r[n]=new Ml(e,Xo(this.pageSize)),e>=this.length&&(this.length=e+1)),i&&i.buffer===this.deduplicate&&this.deduplicate&&!t&&(i.buffer=wE(i.buffer),i.deduplicate=0),i};rr.prototype.set=function(e,t){var r=this._array(e,!1),n=this.path[0];if(e>=this.length&&(this.length=e+1),!t||this.zeros&&t.equals&&t.equals(this.zeros)){r[n]=void 0;return}this.deduplicate&&t.equals&&t.equals(this.deduplicate)&&(t=this.deduplicate);var i=r[n],o=OE(t,this.pageSize);i?i.buffer=o:r[n]=new Ml(e,o)};rr.prototype.toBuffer=function(){for(var e=new Array(this.length),t=Xo(this.pageSize),r=0;r<e.length;)for(var n=this._array(r,!0),i=0;i<32768&&r<e.length;i++)e[r++]=n&&n[i]?n[i].buffer:t;return Buffer.concat(e)};function yE(e,t){for(;e.maxPages<t;){var r=e.pages;e.pages=new Array(32768),e.pages[0]=r,e.level++,e.maxPages*=32768}}function OE(e,t){if(e.length===t)return e;if(e.length>t)return e.slice(0,t);var r=Xo(t);return e.copy(r),r}function Xo(e){if(Buffer.alloc)return Buffer.alloc(e);var t=new Buffer(e);return t.fill(0),t}function wE(e){var t=Buffer.allocUnsafe?Buffer.allocUnsafe(e.length):new Buffer(e.length);return e.copy(t),t}function Ml(e,t){this.offset=e*t.length,this.buffer=t,this.updated=!1,this.deduplicate=0}function _E(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 DE=SE,TE=gr;function gr(e){if(!(this instanceof gr))return new gr(e);if(e||(e={}),Buffer.isBuffer(e)&&(e={buffer:e}),this.pageOffset=e.pageOffset||0,this.pageSize=e.pageSize||1024,this.pages=e.pages||DE(this.pageSize),this.byteLength=this.pages.length*this.pageSize,this.length=8*this.byteLength,!bE(this.pageSize))throw new 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}}gr.prototype.get=function(e){var t=e&7,r=(e-t)/8;return!!(this.getByte(r)&128>>t)};gr.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};gr.prototype.set=function(e,t){var r=e&7,n=(e-r)/8,i=this.getByte(n);return this.setByte(n,t?i|128>>r:i&(255^128>>r))};gr.prototype.toBuffer=function(){for(var e=BE(this.pages.length*this.pageSize),t=0;t<this.pages.length;t++){var r=this.pages.get(t,!0),n=t*this.pageSize;r&&r.buffer.copy(e,n,this.pageOffset,this.pageOffset+this.pageSize)}return e};gr.prototype.setByte=function(e,t){var r=e&this._pageMask,n=(e-r)/this.pageSize,i=this.pages.get(n,!1);return r+=this.pageOffset,i.buffer[r]===t?!1:(i.buffer[r]=t,e>=this.byteLength&&(this.byteLength=e+1,this.length=this.byteLength*8),this._trackUpdates&&this.pages.updated(i),!0)};function BE(e){if(Buffer.alloc)return Buffer.alloc(e);var t=new Buffer(e);return t.fill(0),t}function bE(e){return!(e&e-1)}var ME=jt&&jt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Du,"__esModule",{value:!0});Du.createMemoryCodePoints=RE;const FE=ME(TE);function RE(e){let t=0;function r(){const a=e.readUInt32BE(t);t+=4;const E=e.slice(t,t+a);return t+=a,(0,FE.default)({buffer:E})}const n=r(),i=r(),o=r(),u=r(),h=r(),s=r();return{unassigned_code_points:n,commonly_mapped_to_nothing:i,non_ASCII_space_characters:o,prohibited_characters:u,bidirectional_r_al:h,bidirectional_l:s}}var Tu={};Object.defineProperty(Tu,"__esModule",{value:!0});const NE=Nc;Tu.default=(0,NE.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 Fl=jt&&jt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};const IE=Fl(CE),vE=Du,PE=Fl(Tu),LE=(0,vE.createMemoryCodePoints)(PE.default);function $n(e,t){return(0,IE.default)(LE,e,t)}$n.saslprep=$n;$n.default=$n;var kE=$n;Object.defineProperty(mn,"__esModule",{value:!0});mn.ScramSHA256=mn.ScramSHA1=void 0;const UE=kE,kr=Mc,S1=pe,Mt=Q,no=ne(),jE=Dt,cc=qt;class Rl extends jE.AuthProvider{constructor(t){super(),this.cryptoMethod=t||"sha1"}async prepare(t,r){const n=this.cryptoMethod,i=r.credentials;if(!i)throw new Mt.MongoMissingCredentialsError("AuthContext must provide credentials.");const o=await(0,no.randomBytes)(24);return r.nonce=o,{...t,speculativeAuthenticate:{...vl(n,i,o),db:i.source}}}async auth(t){const{reauthenticating:r,response:n}=t;return n!=null&&n.speculativeAuthenticate&&!r?await Pl(this.cryptoMethod,n.speculativeAuthenticate,t):await xE(this.cryptoMethod,t)}}function Nl(e){return e.replace("=","=3D").replace(",","=2C")}function Il(e,t){return Buffer.concat([Buffer.from("n=","utf8"),Buffer.from(e,"utf8"),Buffer.from(",r=","utf8"),Buffer.from(t.toString("base64"),"utf8")])}function vl(e,t,r){const n=Nl(t.username);return{saslStart:1,mechanism:e==="sha1"?cc.AuthMechanism.MONGODB_SCRAM_SHA1:cc.AuthMechanism.MONGODB_SCRAM_SHA256,payload:new S1.Binary(Buffer.concat([Buffer.from("n,,","utf8"),Il(n,r)])),autoAuthorize:1,options:{skipEmptyExchange:!0}}}async function xE(e,t){const{connection:r,credentials:n}=t;if(!n)throw new Mt.MongoMissingCredentialsError("AuthContext must provide credentials.");if(!t.nonce)throw new Mt.MongoInvalidArgumentError("AuthContext must contain a valid nonce property");const i=t.nonce,o=n.source,u=vl(e,n,i),h=await r.command((0,no.ns)(`${o}.$cmd`),u,void 0);await Pl(e,h,t)}async function Pl(e,t,r){const n=r.connection,i=r.credentials;if(!i)throw new Mt.MongoMissingCredentialsError("AuthContext must provide credentials.");if(!r.nonce)throw new Mt.MongoInvalidArgumentError("Unable to continue SCRAM without valid nonce");const o=r.nonce,u=i.source,h=Nl(i.username),s=i.password,a=e==="sha256"?(0,UE.saslprep)(s):zE(h,s),E=Buffer.isBuffer(t.payload)?new S1.Binary(t.payload):t.payload,l=lc(E),g=parseInt(l.i,10);if(g&&g<4096)throw new Mt.MongoRuntimeError(`Server returned an invalid iteration count ${g}`);const m=l.s,C=l.r;if(C.startsWith("nonce"))throw new Mt.MongoRuntimeError(`Server returned an invalid nonce: ${C}`);const S=`c=biws,r=${C}`,D=HE(a,Buffer.from(m,"base64"),g,e),O=Ui(e,D,"Client Key"),M=Ui(e,D,"Server Key"),p=WE(e,O),B=[Il(h,o),E.toString("utf8"),S].join(","),d=Ui(e,p,B),b=`p=${VE(O,d)}`,f=[S,b].join(","),c=Ui(e,M,B),w={saslContinue:1,conversationId:t.conversationId,payload:new S1.Binary(Buffer.from(f))},T=await n.command((0,no.ns)(`${u}.$cmd`),w,void 0),_=lc(T.payload);if(!KE(Buffer.from(_.v,"base64"),c))throw new Mt.MongoRuntimeError("Server returned an invalid signature");if(T.done!==!1)return;const A={saslContinue:1,conversationId:T.conversationId,payload:Buffer.alloc(0)};await n.command((0,no.ns)(`${u}.$cmd`),A,void 0)}function lc(e){const t=e.toString("utf8"),r={},n=t.split(",");for(let i=0;i<n.length;i++){const o=(n[i].match(/^([^=]*)=(.*)$/)??[]).slice(1);r[o[0]]=o[1]}return r}function zE(e,t){if(typeof e!="string")throw new Mt.MongoInvalidArgumentError("Username must be a string");if(typeof t!="string")throw new Mt.MongoInvalidArgumentError("Password must be a string");if(t.length===0)throw new Mt.MongoInvalidArgumentError("Password cannot be empty");let r;try{r=kr.createHash("md5")}catch(n){throw kr.getFips()?new Error("Auth mechanism SCRAM-SHA-1 is not supported in FIPS mode"):n}return r.update(`${e}:mongo:${t}`,"utf8"),r.digest("hex")}function VE(e,t){Buffer.isBuffer(e)||(e=Buffer.from(e)),Buffer.isBuffer(t)||(t=Buffer.from(t));const r=Math.max(e.length,t.length),n=[];for(let i=0;i<r;i+=1)n.push(e[i]^t[i]);return Buffer.from(n).toString("base64")}function WE(e,t){return kr.createHash(e).update(t).digest()}function Ui(e,t,r){return kr.createHmac(e,t).update(r).digest()}let Ki={},y1=0;function GE(){Ki={},y1=0}const qE={sha256:32,sha1:20};function HE(e,t,r,n){const i=[e,t.toString("base64"),r].join("_");if(Ki[i]!=null)return Ki[i];const o=kr.pbkdf2Sync(e,t,r,qE[n],n);return y1>=200&&GE(),Ki[i]=o,y1+=1,o}function KE(e,t){if(e.length!==t.length)return!1;if(typeof kr.timingSafeEqual=="function")return kr.timingSafeEqual(e,t);let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return r===0}class YE extends Rl{constructor(){super("sha1")}}mn.ScramSHA1=YE;class XE extends Rl{constructor(){super("sha256")}}mn.ScramSHA256=XE;var Jo={};Object.defineProperty(Jo,"__esModule",{value:!0});Jo.X509=void 0;const hc=Q,JE=ne(),QE=Dt;class ZE extends QE.AuthProvider{async prepare(t,r){const{credentials:n}=r;if(!n)throw new hc.MongoMissingCredentialsError("AuthContext must provide credentials.");return{...t,speculativeAuthenticate:dc(n)}}async auth(t){const r=t.connection,n=t.credentials;if(!n)throw new hc.MongoMissingCredentialsError("AuthContext must provide credentials.");const i=t.response;i!=null&&i.speculativeAuthenticate||await r.command((0,JE.ns)("$external.$cmd"),dc(n),void 0)}}Jo.X509=ZE;function dc(e){const t={authenticate:1,mechanism:"MONGODB-X509"};return e.username&&(t.user=e.username),t}Object.defineProperty(Ci,"__esModule",{value:!0});Ci.MongoClientAuthProviders=void 0;const $E=Ro,e4=zo,Ll=_u(),t4=Bl(),r4=Ko,fc=Si,n4=Yo,Tr=qt,mc=mn,i4=Jo,kl=Q,o4=new Map([[Tr.AuthMechanism.MONGODB_AWS,({AWS_CREDENTIAL_PROVIDER:e})=>new e4.MongoDBAWS(e)],[Tr.AuthMechanism.MONGODB_GSSAPI,()=>new $E.GSSAPI],[Tr.AuthMechanism.MONGODB_OIDC,e=>new Ll.MongoDBOIDC(u4(e))],[Tr.AuthMechanism.MONGODB_PLAIN,()=>new n4.Plain],[Tr.AuthMechanism.MONGODB_SCRAM_SHA1,()=>new mc.ScramSHA1],[Tr.AuthMechanism.MONGODB_SCRAM_SHA256,()=>new mc.ScramSHA256],[Tr.AuthMechanism.MONGODB_X509,()=>new i4.X509]]);class s4{constructor(){this.existingProviders=new Map}getOrCreateProvider(t,r){const n=this.existingProviders.get(t);if(n)return n;const i=o4.get(t);if(!i)throw new kl.MongoInvalidArgumentError(`authMechanism ${t} not supported`);const o=i(r);return this.existingProviders.set(t,o),o}}Ci.MongoClientAuthProviders=s4;function u4(e){var t;if(e.OIDC_HUMAN_CALLBACK)return new r4.HumanCallbackWorkflow(new fc.TokenCache,e.OIDC_HUMAN_CALLBACK);if(e.OIDC_CALLBACK)return new t4.AutomatedCallbackWorkflow(new fc.TokenCache,e.OIDC_CALLBACK);{const r=e.ENVIRONMENT,n=(t=Ll.OIDC_WORKFLOWS.get(r))==null?void 0:t();if(!n)throw new kl.MongoInvalidArgumentError(`Could not load workflow for environment ${e.ENVIRONMENT}`);return n}}var xn={},Qo={},yi={};Object.defineProperty(yi,"__esModule",{value:!0});yi.ClientBulkWriteOperation=void 0;const a4=De(),c4=ne(),l4=Ie,Br=Me;class Ul extends l4.CommandOperation{get commandName(){return"bulkWrite"}constructor(t,r){super(void 0,r),this.SERVER_COMMAND_RESPONSE_TYPE=a4.ClientBulkWriteCursorResponse,this.commandBuilder=t,this.options=r,this.ns=new c4.MongoDBNamespace("admin","$cmd")}resetBatch(){return this.commandBuilder.resetBatch()}get canRetryWrite(){return this.commandBuilder.isBatchRetryable}handleOk(t){return t}buildCommandDocument(t,r){const n=this.commandBuilder.buildBatch(t.description.maxMessageSizeBytes,t.description.maxWriteBatchSize,t.description.maxBsonObjectSize);return this.canRetryWrite||(this.options.willRetryWrite=!1),n}}yi.ClientBulkWriteOperation=Ul;(0,Br.defineAspects)(Ul,[Br.Aspect.WRITE_OPERATION,Br.Aspect.SKIP_COLLATION,Br.Aspect.CURSOR_CREATING,Br.Aspect.RETRYABLE,Br.Aspect.COMMAND_BATCHING,Br.Aspect.SUPPORTS_RAW_DATA]);Object.defineProperty(Qo,"__esModule",{value:!0});Qo.ClientBulkWriteCursor=void 0;const h4=yi,d4=qe,Ec=ne(),f4=tt;class Bu extends f4.AbstractCursor{constructor(t,r,n={}){super(t,new Ec.MongoDBNamespace("admin","$cmd"),n),this.commandBuilder=r,this.clientBulkWriteOptions=n}get response(){return this.cursorResponse?this.cursorResponse:null}get operations(){return this.commandBuilder.lastOperations}clone(){const t=(0,Ec.mergeOptions)({},this.clientBulkWriteOptions);return delete t.session,new Bu(this.client,this.commandBuilder,{...t})}async _initialize(t){const r=new h4.ClientBulkWriteOperation(this.commandBuilder,{...this.clientBulkWriteOptions,...this.cursorOptions,session:t}),n=await(0,d4.executeOperation)(this.client,r,this.timeoutContext);return this.cursorResponse=n,{server:r.server,session:t,response:n}}}Qo.ClientBulkWriteCursor=Bu;var jl={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.buildReplaceOneOperation=e.buildUpdateManyOperation=e.buildUpdateOneOperation=e.buildDeleteManyOperation=e.buildDeleteOneOperation=e.buildInsertOneOperation=e.ClientBulkWriteCommandBuilder=void 0,e.buildOperation=M;const t=pe,r=Po(),n=Q,i=Gr,o=ne(),u=1e3;class h{constructor(B,d,b){this.models=B,this.options=d,this.pkFactory=b??o.DEFAULT_PK_FACTORY,this.currentModelIndex=0,this.previousModelIndex=0,this.lastOperations=[],this.isBatchRetryable=!0}get errorsOnly(){return"verboseResults"in this.options?!this.options.verboseResults:!0}hasNextBatch(){return this.currentModelIndex<this.models.length}resetBatch(){return this.currentModelIndex=this.previousModelIndex,!0}buildBatch(B,d,b){this.isBatchRetryable=!0;let f=0,c=0;const w=this.baseCommand(),T=new Map;for(this.previousModelIndex=this.currentModelIndex;this.currentModelIndex<this.models.length;){const _=this.models[this.currentModelIndex],A=_.namespace,y=T.get(A);if((_.name==="deleteMany"||_.name==="updateMany")&&(this.isBatchRetryable=!1),y!=null){const F=M(_,y,this.pkFactory,this.options);let R;try{R=t.BSON.serialize(F)}catch(v){throw new n.MongoInvalidArgumentError("Could not serialize operation to BSON",{cause:v})}if(s("ops",R,b),f+R.length<B&&w.ops.documents.length<d)f=u+w.ops.push(F,R),this.currentModelIndex++;else break}else{T.set(A,c);const F={ns:A},R=M(_,c,this.pkFactory,this.options);let v,J;try{v=t.BSON.serialize(F),J=t.BSON.serialize(R)}catch(I){throw new n.MongoInvalidArgumentError("Could not serialize ns info to BSON",{cause:I})}if(s("nsInfo",v,b),s("ops",J,b),f+v.length+J.length<B&&w.ops.documents.length<d)f=u+w.nsInfo.push(F,v)+w.ops.push(R,J),c++,this.currentModelIndex++;else break}}return this.lastOperations=w.ops.documents,w}baseCommand(){const B={bulkWrite:1,errorsOnly:this.errorsOnly,ordered:this.options.ordered??!0,ops:new r.DocumentSequence("ops"),nsInfo:new r.DocumentSequence("nsInfo")};return this.options.bypassDocumentValidation!=null&&(B.bypassDocumentValidation=this.options.bypassDocumentValidation),this.options.let&&(B.let=this.options.let),this.options.comment!==void 0&&(B.comment=this.options.comment),B}}e.ClientBulkWriteCommandBuilder=h;function s(p,B,d){if(B.length>d)throw new n.MongoInvalidArgumentError(`Client bulk write operation ${p} of length ${B.length} exceeds the max bson object size of ${d}`)}const a=(p,B,d)=>{const b={insert:B,document:p.document};return b.document._id=p.document._id??d.createPk(),b};e.buildInsertOneOperation=a;const E=(p,B)=>g(p,B,!1);e.buildDeleteOneOperation=E;const l=(p,B)=>g(p,B,!0);e.buildDeleteManyOperation=l;function g(p,B,d){const b={delete:B,multi:d,filter:p.filter};return p.hint&&(b.hint=p.hint),p.collation&&(b.collation=p.collation),b}const m=(p,B,d)=>D(p,B,!1,d);e.buildUpdateOneOperation=m;const C=(p,B,d)=>D(p,B,!0,d);e.buildUpdateManyOperation=C;function S(p,B){if(!(0,o.hasAtomicOperators)(p,B))throw new n.MongoAPIError("Client bulk write update models must only contain atomic modifiers (start with $) and must not be empty.")}function D(p,B,d,b){S(p.update,b);const f={update:B,multi:d,filter:p.filter,updateMods:p.update};return p.hint&&(f.hint=p.hint),p.upsert&&(f.upsert=p.upsert),p.arrayFilters&&(f.arrayFilters=p.arrayFilters),p.collation&&(f.collation=p.collation),!d&&"sort"in p&&p.sort!=null&&(f.sort=(0,i.formatSort)(p.sort)),f}const O=(p,B)=>{if((0,o.hasAtomicOperators)(p.replacement))throw new n.MongoAPIError("Client bulk write replace models must not contain atomic modifiers (start with $) and must not be empty.");const d={update:B,multi:!1,filter:p.filter,updateMods:p.replacement};return p.hint&&(d.hint=p.hint),p.upsert&&(d.upsert=p.upsert),p.collation&&(d.collation=p.collation),p.sort!=null&&(d.sort=(0,i.formatSort)(p.sort)),d};e.buildReplaceOneOperation=O;function M(p,B,d,b){switch(p.name){case"insertOne":return(0,e.buildInsertOneOperation)(p,B,d);case"deleteOne":return(0,e.buildDeleteOneOperation)(p,B);case"deleteMany":return(0,e.buildDeleteManyOperation)(p,B);case"updateOne":return(0,e.buildUpdateOneOperation)(p,B,b);case"updateMany":return(0,e.buildUpdateManyOperation)(p,B,b);case"replaceOne":return(0,e.buildReplaceOneOperation)(p,B)}}})(jl);var zn={},gc;function m4(){if(gc)return zn;gc=1,Object.defineProperty(zn,"__esModule",{value:!0}),zn.ClientBulkWriteResultsMerger=void 0;const e=ts(),t=Q,r={acknowledged:!1,insertedCount:0,upsertedCount:0,matchedCount:0,modifiedCount:0,deletedCount:0,insertResults:void 0,updateResults:void 0,deleteResults:void 0};class n{static unacknowledged(){return r}constructor(o){this.options=o,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},o.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(o){let u;try{for await(const h of o)if(h.ok===1)this.options.verboseResults&&this.processDocument(o,h);else if(this.options.ordered){const s=new t.MongoClientBulkWriteError({message:"Mongo client ordered bulk write encountered a write error."});throw s.writeErrors.set(h.idx+this.currentBatchOffset,{code:h.code,message:h.errmsg}),s.partialResult=this.result,s}else this.writeErrors.set(h.idx+this.currentBatchOffset,{code:h.code,message:h.errmsg})}catch(h){if(h instanceof e.MongoWriteConcernError){const s=h.result;if(u={insertedCount:s.nInserted,upsertedCount:s.nUpserted,matchedCount:s.nMatched,modifiedCount:s.nModified,deletedCount:s.nDeleted,writeConcernError:s.writeConcernError},this.options.verboseResults&&s.cursor.firstBatch)for(const a of s.cursor.firstBatch)a.ok===1&&this.processDocument(o,a)}else throw h}finally{if(o.response){const h=o.response;this.incrementCounts(h)}this.currentBatchOffset+=o.operations.length}if(u){const h=u.writeConcernError;this.incrementCounts(u),this.writeConcernErrors.push({code:h.code,message:h.errmsg})}return this.result}processDocument(o,u){var s,a,E;const h=o.operations[u.idx];if("insert"in h&&((s=this.result.insertResults)==null||s.set(u.idx+this.currentBatchOffset,{insertedId:h.document._id})),"update"in h){const l={matchedCount:u.n,modifiedCount:u.nModified??0,didUpsert:u.upserted!=null};u.upserted&&(l.upsertedId=u.upserted._id),(a=this.result.updateResults)==null||a.set(u.idx+this.currentBatchOffset,l)}"delete"in h&&((E=this.result.deleteResults)==null||E.set(u.idx+this.currentBatchOffset,{deletedCount:u.n}))}incrementCounts(o){this.result.insertedCount+=o.insertedCount,this.result.upsertedCount+=o.upsertedCount,this.result.matchedCount+=o.matchedCount,this.result.modifiedCount+=o.modifiedCount,this.result.deletedCount+=o.deletedCount}}return zn.ClientBulkWriteResultsMerger=n,zn}var Ac;function E4(){if(Ac)return xn;Ac=1,Object.defineProperty(xn,"__esModule",{value:!0}),xn.ClientBulkWriteExecutor=void 0;const e=tt,t=Qo,r=Q,n=Te,i=ne(),o=ct(),u=qe,h=yi,s=jl,a=m4();class E{constructor(g,m,C){var S;if(m.length===0)throw new r.MongoClientBulkWriteExecutionError("No client bulk write models were provided.");if(this.client=g,this.operations=m,this.options={ordered:!0,bypassDocumentValidation:!1,verboseResults:!1,...C},this.options.writeConcern||(this.options.writeConcern=o.WriteConcern.fromOptions(this.client.s.options)),((S=this.options.writeConcern)==null?void 0:S.w)===0){if(this.options.verboseResults)throw new r.MongoInvalidArgumentError("Cannot request unacknowledged write concern and verbose results");if(this.options.ordered)throw new r.MongoInvalidArgumentError("Cannot request unacknowledged write concern and ordered writes")}}async execute(){var D;const g=this.client.s.options.pkFactory,m=new s.ClientBulkWriteCommandBuilder(this.operations,this.options,g),C=(0,i.resolveTimeoutOptions)(this.client,this.options),S=n.TimeoutContext.create(C);if(((D=this.options.writeConcern)==null?void 0:D.w)===0){for(;m.hasNextBatch();){const O=new h.ClientBulkWriteOperation(m,this.options);await(0,u.executeOperation)(this.client,O,S)}return a.ClientBulkWriteResultsMerger.unacknowledged()}else{const O=new a.ClientBulkWriteResultsMerger(this.options);for(;m.hasNextBatch();){const M=new e.CursorTimeoutContext(S,Symbol()),p={...this.options,timeoutContext:M,...C.timeoutMS!=null&&{timeoutMode:e.CursorTimeoutMode.LIFETIME}},B=new t.ClientBulkWriteCursor(this.client,m,p);try{await O.merge(B)}catch(d){if(d instanceof r.MongoServerError&&!(d instanceof r.MongoClientBulkWriteError)){const b=new r.MongoClientBulkWriteError({message:"Mongo client bulk write encountered an error during execution"});throw b.cause=d,b.partialResult=O.bulkWriteResult,b}else throw d}}if(O.writeConcernErrors.length>0||O.writeErrors.size>0){const M=new r.MongoClientBulkWriteError({message:"Mongo client bulk write encountered errors during execution."});throw M.writeConcernErrors=O.writeConcernErrors,M.writeErrors=O.writeErrors,M.partialResult=O.bulkWriteResult,M}return O.bulkWriteResult}}}return xn.ClientBulkWriteExecutor=E,xn}var Zo={};Object.defineProperty(Zo,"__esModule",{value:!0});Zo.EndSessionsOperation=void 0;const g4=De(),A4=Ie,p4=Ke,C4=ne(),pc=Me;class xl extends A4.CommandOperation{constructor(t){super(),this.writeConcern={w:0},this.ns=C4.MongoDBNamespace.fromString("admin.$cmd"),this.SERVER_COMMAND_RESPONSE_TYPE=g4.MongoDBResponse,this.sessions=t}buildCommandDocument(t,r){return{endSessions:this.sessions}}buildOptions(t){return{timeoutContext:t,readPreference:p4.ReadPreference.primaryPreferred}}get commandName(){return"endSessions"}}Zo.EndSessionsOperation=xl;(0,pc.defineAspects)(xl,pc.Aspect.WRITE_OPERATION);var Vn={},ft={};Object.defineProperty(ft,"__esModule",{value:!0});ft.WaitingForSuitableServerEvent=ft.ServerSelectionSucceededEvent=ft.ServerSelectionFailedEvent=ft.ServerSelectionStartedEvent=ft.ServerSelectionEvent=void 0;const S4=ne(),$o=Ve;class Oi{constructor(t,r,n){this.selector=t,this.operation=n,this.topologyDescription=r}}ft.ServerSelectionEvent=Oi;class y4 extends Oi{constructor(t,r,n){super(t,r,n),this.name=$o.SERVER_SELECTION_STARTED,this.message="Server selection started"}}ft.ServerSelectionStartedEvent=y4;class O4 extends Oi{constructor(t,r,n,i){super(t,r,i),this.name=$o.SERVER_SELECTION_FAILED,this.message="Server selection failed",this.failure=n}}ft.ServerSelectionFailedEvent=O4;class w4 extends Oi{constructor(t,r,n,i){super(t,r,i),this.name=$o.SERVER_SELECTION_SUCCEEDED,this.message="Server selection succeeded";const{host:o,port:u}=S4.HostAddress.fromString(n).toHostPort();this.serverHost=o,this.serverPort=u}}ft.ServerSelectionSucceededEvent=w4;class _4 extends Oi{constructor(t,r,n,i){super(t,r,i),this.name=$o.WAITING_FOR_SUITABLE_SERVER,this.message="Waiting for suitable server to become available",this.remainingTimeMS=n}}ft.WaitingForSuitableServerEvent=_4;var Ur={};Object.defineProperty(Ur,"__esModule",{value:!0});Ur.SrvPoller=Ur.SrvPollingEvent=void 0;const D4=T1,u1=gn,T4=Q,B4=Je,Wn=ne();class zl{constructor(t){this.srvRecords=t}hostnames(){return new Set(this.srvRecords.map(t=>Wn.HostAddress.fromSrvRecord(t).toString()))}}Ur.SrvPollingEvent=zl;const uo=class uo extends B4.TypedEventEmitter{constructor(t){if(super(),this.on("error",Wn.noop),!t||!t.srvHost)throw new T4.MongoRuntimeError("Options for SrvPoller must exist and include srvHost");this.srvHost=t.srvHost,this.srvMaxHosts=t.srvMaxHosts??0,this.srvServiceName=t.srvServiceName??"mongodb",this.rescanSrvIntervalMS=6e4,this.heartbeatFrequencyMS=t.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(){this._timeout||this.schedule()}stop(){this._timeout&&((0,u1.clearTimeout)(this._timeout),this.generation+=1,this._timeout=void 0)}schedule(){this._timeout&&(0,u1.clearTimeout)(this._timeout),this._timeout=(0,u1.setTimeout)(()=>{this._poll().then(void 0,Wn.squashError)},this.intervalMS)}success(t){this.haMode=!1,this.schedule(),this.emit(uo.SRV_RECORD_DISCOVERY,new zl(t))}failure(){this.haMode=!0,this.schedule()}async _poll(){const t=this.generation;let r;try{r=await D4.promises.resolveSrv(this.srvAddress)}catch{this.failure();return}if(t!==this.generation)return;const n=[];for(const i of r)try{(0,Wn.checkParentDomainMatch)(i.name,this.srvHost),n.push(i)}catch(o){(0,Wn.squashError)(o)}if(!n.length){this.failure();return}this.success(n)}};uo.SRV_RECORD_DISCOVERY="srvRecordDiscovery";let O1=uo;Ur.SrvPoller=O1;var Cc;function b4(){if(Cc)return Vn;Cc=1,Object.defineProperty(Vn,"__esModule",{value:!0}),Vn.Topology=void 0;const e=Dl(),t=Ve,r=Q,n=Cr,i=Je,o=Ke,u=Te,h=ne(),s=Ne,a=Ue,E=wl(),l=nr,g=pn,m=ft,C=Ur,S=pi;let D=0;const O=(0,h.makeStateMachine)({[s.STATE_CLOSED]:[s.STATE_CLOSED,s.STATE_CONNECTING],[s.STATE_CONNECTING]:[s.STATE_CONNECTING,s.STATE_CLOSING,s.STATE_CONNECTED,s.STATE_CLOSED],[s.STATE_CONNECTED]:[s.STATE_CONNECTED,s.STATE_CLOSING,s.STATE_CLOSED],[s.STATE_CLOSING]:[s.STATE_CLOSING,s.STATE_CLOSED]}),T=class T extends i.TypedEventEmitter{constructor(A,y,F){super(),this.on("error",h.noop),this.client=A,F=F??{hosts:[h.HostAddress.fromString("localhost:27017")],...Object.fromEntries(e.DEFAULT_OPTIONS.entries())},typeof y=="string"?y=[h.HostAddress.fromString(y)]:Array.isArray(y)||(y=[y]);const R=[];for(const j of y)if(typeof j=="string")R.push(h.HostAddress.fromString(j));else if(j instanceof h.HostAddress)R.push(j);else throw new r.MongoRuntimeError(`Topology cannot be constructed from ${JSON.stringify(j)}`);const v=B(F),J=D++,I=F.srvMaxHosts==null||F.srvMaxHosts===0||F.srvMaxHosts>=R.length?R:(0,h.shuffle)(R,F.srvMaxHosts),N=new Map;for(const j of I)N.set(j.toString(),new l.ServerDescription(j));this.waitQueue=new h.List,this.s={id:J,options:F,seedlist:R,state:s.STATE_CLOSED,description:new S.TopologyDescription(v,N,F.replicaSet,void 0,void 0,void 0,F),serverSelectionTimeoutMS:F.serverSelectionTimeoutMS,heartbeatFrequencyMS:F.heartbeatFrequencyMS,minHeartbeatFrequencyMS:F.minHeartbeatFrequencyMS,servers:new Map,credentials:F==null?void 0:F.credentials,clusterTime:void 0,detectShardedTopology:j=>this.detectShardedTopology(j),detectSrvRecords:j=>this.detectSrvRecords(j)},this.mongoLogger=A.mongoLogger,this.component="topology",F.srvHost&&!F.loadBalanced&&(this.s.srvPoller=F.srvPoller??new C.SrvPoller({heartbeatFrequencyMS:this.s.heartbeatFrequencyMS,srvHost:F.srvHost,srvMaxHosts:F.srvMaxHosts,srvServiceName:F.srvServiceName}),this.on(T.TOPOLOGY_DESCRIPTION_CHANGED,this.s.detectShardedTopology)),this.connectionLock=void 0}detectShardedTopology(A){var I,N,j;const y=A.previousDescription.type,F=A.newDescription.type,R=y!==s.TopologyType.Sharded&&F===s.TopologyType.Sharded,v=(I=this.s.srvPoller)==null?void 0:I.listeners(C.SrvPoller.SRV_RECORD_DISCOVERY),J=!!(v!=null&&v.includes(this.s.detectSrvRecords));R&&!J&&((N=this.s.srvPoller)==null||N.on(C.SrvPoller.SRV_RECORD_DISCOVERY,this.s.detectSrvRecords),(j=this.s.srvPoller)==null||j.start())}detectSrvRecords(A){const y=this.s.description;this.s.description=this.s.description.updateFromSrvPollingEvent(A,this.s.options.srvMaxHosts),this.s.description!==y&&(b(this),this.emitAndLog(T.TOPOLOGY_DESCRIPTION_CHANGED,new a.TopologyDescriptionChangedEvent(this.s.id,y,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(A){this.connectionLock??(this.connectionLock=this._connect(A));try{return await this.connectionLock,this}finally{this.connectionLock=void 0}}async _connect(A){if(A=A??{},this.s.state===s.STATE_CONNECTED)return this;O(this,s.STATE_CONNECTING),this.emitAndLog(T.TOPOLOGY_OPENING,new a.TopologyOpeningEvent(this.s.id)),this.emitAndLog(T.TOPOLOGY_DESCRIPTION_CHANGED,new a.TopologyDescriptionChangedEvent(this.s.id,new S.TopologyDescription(s.TopologyType.Unknown),this.s.description));const y=Array.from(this.s.description.servers.values());if(this.s.servers=new Map(y.map(I=>[I.address,d(this,I)])),this.s.options.loadBalanced)for(const I of y){const N=new l.ServerDescription(I.hostAddress,void 0,{loadBalanced:this.s.options.loadBalanced});this.serverUpdateHandler(N)}const F=this.client.s.options.serverSelectionTimeoutMS,R=A.readPreference??o.ReadPreference.primary,v=u.TimeoutContext.create({timeoutMS:void 0,serverSelectionTimeoutMS:F,waitQueueTimeoutMS:this.client.s.options.waitQueueTimeoutMS}),J={operationName:"handshake",...A,timeoutContext:v,deprioritizedServers:new g.DeprioritizedServers};try{const I=await this.selectServer((0,g.readPreferenceServerSelector)(R),J);if(!(this.s.options.__skipPingOnConnect===!0)){const j=await I.pool.checkOut({timeoutContext:v});return I.pool.checkIn(j),O(this,s.STATE_CONNECTED),this.emit(T.OPEN,this),this.emit(T.CONNECT,this),this}return O(this,s.STATE_CONNECTED),this.emit(T.OPEN,this),this.emit(T.CONNECT,this),this}catch(I){throw this.close(),I}}closeCheckedOutConnections(){for(const A of this.s.servers.values())return A.closeCheckedOutConnections()}close(){if(!(this.s.state===s.STATE_CLOSED||this.s.state===s.STATE_CLOSING)){for(const A of this.s.servers.values())p(A,this);this.s.servers.clear(),O(this,s.STATE_CLOSING),f(this.waitQueue,new r.MongoTopologyClosedError),this.s.srvPoller&&(this.s.srvPoller.stop(),this.s.srvPoller.removeListener(C.SrvPoller.SRV_RECORD_DISCOVERY,this.s.detectSrvRecords)),this.removeListener(T.TOPOLOGY_DESCRIPTION_CHANGED,this.s.detectShardedTopology),O(this,s.STATE_CLOSED),this.emitAndLog(T.TOPOLOGY_CLOSED,new a.TopologyClosedEvent(this.s.id))}}async selectServer(A,y){var K,ee,ae,ye,ce,le,he,Ee,re,Ce;let F;if(typeof A!="function")if(typeof A=="string")F=(0,g.readPreferenceServerSelector)(o.ReadPreference.fromString(A));else{let _e;A instanceof o.ReadPreference?_e=A:(o.ReadPreference.translate(y),_e=y.readPreference||o.ReadPreference.primary),F=(0,g.readPreferenceServerSelector)(_e)}else F=A;y={serverSelectionTimeoutMS:this.s.serverSelectionTimeoutMS,...y},(K=this.client.mongoLogger)!=null&&K.willLog(n.MongoLoggableComponent.SERVER_SELECTION,n.SeverityLevel.DEBUG)&&((ee=this.client.mongoLogger)==null||ee.debug(n.MongoLoggableComponent.SERVER_SELECTION,new m.ServerSelectionStartedEvent(A,this.description,y.operationName)));let R;y.timeoutContext?R=y.timeoutContext.serverSelectionTimeout:R=u.Timeout.expires(y.serverSelectionTimeoutMS??0);const v=this.description.type===s.TopologyType.Sharded,J=y.session,I=J&&J.transaction;if(v&&I&&I.server)return(ae=this.client.mongoLogger)!=null&&ae.willLog(n.MongoLoggableComponent.SERVER_SELECTION,n.SeverityLevel.DEBUG)&&((ye=this.client.mongoLogger)==null||ye.debug(n.MongoLoggableComponent.SERVER_SELECTION,new m.ServerSelectionSucceededEvent(A,this.description,I.server.pool.address,y.operationName))),(ce=y.timeoutContext)!=null&&ce.clearServerSelectionTimeout&&(R==null||R.clear()),I.server;const{promise:N,resolve:j,reject:x}=(0,h.promiseWithResolvers)(),Y={serverSelector:F,topologyDescription:this.description,mongoLogger:this.client.mongoLogger,transaction:I,resolve:j,reject:x,cancelled:!1,startTime:(0,h.processTimeMS)(),operationName:y.operationName,waitingLogged:!1,deprioritizedServers:y.deprioritizedServers},$=(0,h.addAbortListener)(y.signal,function(){Y.cancelled=!0,x(this.reason)});this.waitQueue.push(Y),c(this);try{R==null||R.throwIfExpired();const _e=await(R?Promise.race([N,R]):N);return(le=y.timeoutContext)!=null&&le.csotEnabled()&&_e.description.minRoundTripTime!==0&&(y.timeoutContext.minRoundTripTime=_e.description.minRoundTripTime),_e}catch(_e){if(u.TimeoutError.is(_e)){Y.cancelled=!0;const He=new r.MongoServerSelectionError(`Server selection timed out after ${R==null?void 0:R.duration} ms`,this.description);throw(he=this.client.mongoLogger)!=null&&he.willLog(n.MongoLoggableComponent.SERVER_SELECTION,n.SeverityLevel.DEBUG)&&((Ee=this.client.mongoLogger)==null||Ee.debug(n.MongoLoggableComponent.SERVER_SELECTION,new m.ServerSelectionFailedEvent(A,this.description,He,y.operationName))),(re=y.timeoutContext)!=null&&re.csotEnabled()?new r.MongoOperationTimeoutError("Timed out during server selection",{cause:He}):He}throw _e}finally{$==null||$[h.kDispose](),(Ce=y.timeoutContext)!=null&&Ce.clearServerSelectionTimeout&&(R==null||R.clear())}}serverUpdateHandler(A){if(!this.s.description.hasServer(A.address)||w(this.s.description,A))return;const y=this.s.description,F=this.s.description.servers.get(A.address);if(!F)return;const R=A.$clusterTime;R&&(0,s._advanceClusterTime)(this,R);const v=F&&F.equals(A);if(this.s.description=this.s.description.update(A),this.s.description.compatibilityError){this.emit(T.ERROR,new r.MongoCompatibilityError(this.s.description.compatibilityError));return}if(!v){const J=this.s.description.servers.get(A.address);J&&this.emit(T.SERVER_DESCRIPTION_CHANGED,new a.ServerDescriptionChangedEvent(this.s.id,A.address,F,J))}b(this,A),this.waitQueue.length>0&&c(this),v||this.emitAndLog(T.TOPOLOGY_DESCRIPTION_CHANGED,new a.TopologyDescriptionChangedEvent(this.s.id,y,this.s.description))}auth(A,y){typeof A=="function"&&(y=A,A=void 0),typeof y=="function"&&y(void 0,!0)}isConnected(){return this.s.state===s.STATE_CONNECTED}isDestroyed(){return this.s.state===s.STATE_CLOSED}lastHello(){const A=Array.from(this.description.servers.values());return A.length===0?{}:A.filter(R=>R.type!==s.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(A){this.s.clusterTime=A}};T.SERVER_OPENING=t.SERVER_OPENING,T.SERVER_CLOSED=t.SERVER_CLOSED,T.SERVER_DESCRIPTION_CHANGED=t.SERVER_DESCRIPTION_CHANGED,T.TOPOLOGY_OPENING=t.TOPOLOGY_OPENING,T.TOPOLOGY_CLOSED=t.TOPOLOGY_CLOSED,T.TOPOLOGY_DESCRIPTION_CHANGED=t.TOPOLOGY_DESCRIPTION_CHANGED,T.ERROR=t.ERROR,T.OPEN=t.OPEN,T.CONNECT=t.CONNECT,T.CLOSE=t.CLOSE,T.TIMEOUT=t.TIMEOUT;let M=T;Vn.Topology=M;function p(_,A){for(const y of t.LOCAL_SERVER_EVENTS)_.removeAllListeners(y);_.close(),A.emitAndLog(M.SERVER_CLOSED,new a.ServerClosedEvent(A.s.id,_.description.address));for(const y of t.SERVER_RELAY_EVENTS)_.removeAllListeners(y)}function B(_){return _!=null&&_.directConnection?s.TopologyType.Single:_!=null&&_.replicaSet?s.TopologyType.ReplicaSetNoPrimary:_!=null&&_.loadBalanced?s.TopologyType.LoadBalanced:s.TopologyType.Unknown}function d(_,A){_.emitAndLog(M.SERVER_OPENING,new a.ServerOpeningEvent(_.s.id,A.address));const y=new E.Server(_,A,_.s.options);for(const F of t.SERVER_RELAY_EVENTS)y.on(F,R=>_.emit(F,R));return y.on(E.Server.DESCRIPTION_RECEIVED,F=>_.serverUpdateHandler(F)),y.connect(),y}function b(_,A){if(A&&_.s.servers.has(A.address)){const y=_.s.servers.get(A.address);if(y){if(y.s.description=A,A.error instanceof r.MongoError&&A.error.hasErrorLabel(r.MongoErrorLabel.ResetPool)){const F=A.error.hasErrorLabel(r.MongoErrorLabel.InterruptInUseConnections);y.pool.clear({interruptInUseConnections:F})}else if(A.error==null){const F=_.s.description.type;(A.isDataBearing||A.type!==s.ServerType.Unknown&&F===s.TopologyType.Single)&&y.pool.ready()}}}for(const y of _.description.servers.values())if(!_.s.servers.has(y.address)){const F=d(_,y);_.s.servers.set(y.address,F)}for(const y of _.s.servers){const F=y[0];if(_.description.hasServer(F)||!_.s.servers.has(F))continue;const R=_.s.servers.get(F);_.s.servers.delete(F),R&&p(R,_)}}function f(_,A){var y,F;for(;_.length;){const R=_.shift();R&&(R.cancelled||((y=R.mongoLogger)!=null&&y.willLog(n.MongoLoggableComponent.SERVER_SELECTION,n.SeverityLevel.DEBUG)&&((F=R.mongoLogger)==null||F.debug(n.MongoLoggableComponent.SERVER_SELECTION,new m.ServerSelectionFailedEvent(R.serverSelector,R.topologyDescription,A,R.operationName))),R.reject(A)))}}function c(_){var R,v,J,I,N,j,x,Y;if(_.s.state===s.STATE_CLOSED){f(_.waitQueue,new r.MongoTopologyClosedError);return}const A=_.description.type===s.TopologyType.Sharded,y=Array.from(_.description.servers.values()),F=_.waitQueue.length;for(let $=0;$<F;++$){const K=_.waitQueue.shift();if(!K||K.cancelled)continue;let ee;try{const ce=K.serverSelector,le=K.deprioritizedServers;ee=ce?ce(_.description,y,le):y}catch(ce){(R=_.client.mongoLogger)!=null&&R.willLog(n.MongoLoggableComponent.SERVER_SELECTION,n.SeverityLevel.DEBUG)&&((v=_.client.mongoLogger)==null||v.debug(n.MongoLoggableComponent.SERVER_SELECTION,new m.ServerSelectionFailedEvent(K.serverSelector,_.description,ce,K.operationName))),K.reject(ce);continue}let ae;if(ee.length===0){K.waitingLogged||((J=_.client.mongoLogger)!=null&&J.willLog(n.MongoLoggableComponent.SERVER_SELECTION,n.SeverityLevel.INFORMATIONAL)&&((I=_.client.mongoLogger)==null||I.info(n.MongoLoggableComponent.SERVER_SELECTION,new m.WaitingForSuitableServerEvent(K.serverSelector,_.description,_.s.serverSelectionTimeoutMS!==0?_.s.serverSelectionTimeoutMS-((0,h.processTimeMS)()-K.startTime):-1,K.operationName))),K.waitingLogged=!0),_.waitQueue.push(K);continue}else if(ee.length===1)ae=_.s.servers.get(ee[0].address);else{const ce=(0,h.shuffle)(ee,2),le=_.s.servers.get(ce[0].address),he=_.s.servers.get(ce[1].address);ae=le&&he&&le.s.operationCount<he.s.operationCount?le:he}if(!ae){const ce=new r.MongoServerSelectionError("server selection returned a server description but the server was not found in the topology",_.description);(N=_.client.mongoLogger)!=null&&N.willLog(n.MongoLoggableComponent.SERVER_SELECTION,n.SeverityLevel.DEBUG)&&((j=_.client.mongoLogger)==null||j.debug(n.MongoLoggableComponent.SERVER_SELECTION,new m.ServerSelectionFailedEvent(K.serverSelector,_.description,ce,K.operationName))),K.reject(ce);return}const ye=K.transaction;A&&ye&&ye.isActive&&ae&&ye.pinServer(ae),(x=_.client.mongoLogger)!=null&&x.willLog(n.MongoLoggableComponent.SERVER_SELECTION,n.SeverityLevel.DEBUG)&&((Y=_.client.mongoLogger)==null||Y.debug(n.MongoLoggableComponent.SERVER_SELECTION,new m.ServerSelectionSucceededEvent(K.serverSelector,K.topologyDescription,ae.pool.address,K.operationName))),K.resolve(ae)}if(_.waitQueue.length>0)for(const[,$]of _.s.servers)queueMicrotask(function(){return $.requestCheck()})}function w(_,A){const y=_.servers.get(A.address),F=y==null?void 0:y.topologyVersion;return(0,l.compareTopologyVersion)(F,A.topologyVersion)>0}return Vn}var Sc;function En(){if(Sc)return wr;Sc=1,Object.defineProperty(wr,"__esModule",{value:!0}),wr.MongoClient=wr.ServerApiVersion=void 0;const e=D1,t=ts(),r=pe,n=wi(),i=Fo,o=qt,u=Sr,h=Dl(),s=Ve,a=$1(),E=Q,l=Ci,g=Cr,m=Je,C=E4(),S=Zo,D=qe,O=Ke,M=pn,p=b4(),B=ut,d=ne();wr.ServerApiVersion=Object.freeze({v1:"1"});class b extends m.TypedEventEmitter{constructor(c,w){super(),this.driverInfoList=[],this.on("error",d.noop),this.options=(0,h.parseOptions)(c,this,w),this.appendMetadata(this.options.driverInfo);const T=Object.values(this.options.mongoLoggerOptions.componentSeverities).some(A=>A!==g.SeverityLevel.OFF);this.mongoLogger=T?new g.MongoLogger(this.options.mongoLoggerOptions):void 0;const _=this;this.s={url:c,bsonOptions:(0,r.resolveBSONOptions)(this.options),namespace:(0,d.ns)("admin"),hasBeenClosed:!1,sessionPool:new B.ServerSessionPool(this),activeSessions:new Set,activeCursors:new Set,authProviders:new l.MongoClientAuthProviders,get options(){return _.options},get readConcern(){return _.options.readConcern},get writeConcern(){return _.options.writeConcern},get readPreference(){return _.options.readPreference},get isMongoClient(){return!0}},this.checkForNonGenuineHosts()}async[Symbol.asyncDispose](){await this.close()}appendMetadata(c){this.driverInfoList.some(T=>(0,u.isDriverInfoEqual)(T,c))||(this.driverInfoList.push(c),this.options.metadata=(0,u.makeClientMetadata)(this.driverInfoList,this.options).then(void 0,d.squashError).then(T=>T??{}))}checkForNonGenuineHosts(){var A,y;const c=this.options.hosts.filter(F=>(0,d.isHostMatch)(d.DOCUMENT_DB_CHECK,F.host)),w=(0,d.isHostMatch)(d.DOCUMENT_DB_CHECK,this.options.srvHost),T=this.options.hosts.filter(F=>(0,d.isHostMatch)(d.COSMOS_DB_CHECK,F.host)),_=(0,d.isHostMatch)(d.COSMOS_DB_CHECK,this.options.srvHost);c.length!==0||w?(A=this.mongoLogger)==null||A.info("client",d.DOCUMENT_DB_MSG):(T.length!==0||_)&&((y=this.mongoLogger)==null||y.info("client",d.COSMOS_DB_MSG))}get serverApi(){return this.options.serverApi&&Object.freeze({...this.options.serverApi})}get monitorCommands(){return this.options.monitorCommands}set monitorCommands(c){this.options.monitorCommands=c}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 this.s.options.timeoutMS}async bulkWrite(c,w){if(this.autoEncrypter)throw new E.MongoInvalidArgumentError("MongoClient bulkWrite does not currently support automatic encryption.");return await new C.ClientBulkWriteExecutor(this,c,(0,d.resolveOptions)(this,w)).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(){var T,_,A,y,F,R;if(this.topology&&this.topology.isConnected())return this;const c=this.options;if(c.tls&&(typeof c.tlsCAFile=="string"&&(c.ca??(c.ca=await e.promises.readFile(c.tlsCAFile))),typeof c.tlsCRLFile=="string"&&(c.crl??(c.crl=await e.promises.readFile(c.tlsCRLFile))),typeof c.tlsCertificateKeyFile=="string"&&(!c.key||!c.cert))){const v=await e.promises.readFile(c.tlsCertificateKeyFile);c.key??(c.key=v),c.cert??(c.cert=v)}if(typeof c.srvHost=="string"){const v=await(0,h.resolveSRVRecord)(c);for(const[J,I]of v.entries())c.hosts[J]=I}if(((T=c.credentials)==null?void 0:T.mechanism)===o.AuthMechanism.MONGODB_OIDC){const v=((A=(_=c.credentials)==null?void 0:_.mechanismProperties)==null?void 0:A.ALLOWED_HOSTS)||i.DEFAULT_ALLOWED_HOSTS;if(!!!((F=(y=c.credentials)==null?void 0:y.mechanismProperties)!=null&&F.ENVIRONMENT)){for(const I of c.hosts)if(!(0,d.hostMatchesWildcards)(I.toHostPort().host,v))throw new E.MongoInvalidArgumentError(`Host '${I}' is not valid for OIDC authentication with ALLOWED_HOSTS of '${v.join(",")}'`)}}this.topology=new p.Topology(this,c.hosts,c),this.topology.once(p.Topology.OPEN,()=>this.emit("open",this));for(const v of s.MONGO_CLIENT_EVENTS)this.topology.on(v,(...J)=>this.emit(v,...J));const w=async()=>{var v,J;try{await((v=this.topology)==null?void 0:v.connect(c))}catch(I){throw(J=this.topology)==null||J.close(),I}};return this.autoEncrypter?(await((R=this.autoEncrypter)==null?void 0:R.init()),await w(),await c.encrypter.connectInternalClient()):await w(),this}async close(c=!1){if(this.closeLock)return await this.closeLock;try{this.closeLock=this._close(),await this.closeLock}finally{this.closeLock=void 0}}async _close(){var F;Object.defineProperty(this.s,"hasBeenClosed",{value:!0,enumerable:!0,configurable:!1,writable:!1}),(F=this.topology)==null||F.closeCheckedOutConnections();const c=Array.from(this.s.activeCursors,R=>R.close());this.s.activeCursors.clear(),await Promise.all(c);const w=Array.from(this.s.activeSessions,R=>R.endSession());if(this.s.activeSessions.clear(),await Promise.all(w),this.topology==null)return;(this.topology.description.type===t.TopologyType.LoadBalanced||this.topology.description.logicalSessionTimeoutMinutes!=null)&&await y(this,this.topology);const _=this.topology;this.topology=void 0,_.close();const{encrypter:A}=this.options;A&&await A.close(this);async function y(R,{description:v}){const J=(0,M.readPreferenceServerSelector)(O.ReadPreference.primaryPreferred),I=Array.from(v.servers.values());if(J(v,I,new M.DeprioritizedServers).length!==0){const j=Array.from(R.s.sessionPool.sessions,({id:x})=>x);if(j.length!==0)try{await(0,D.executeOperation)(R,new S.EndSessionsOperation(j))}catch(x){(0,d.squashError)(x)}}}}db(c,w){w=w??{},c||(c=this.s.options.dbName);const T=Object.assign({},this.options,w);return new a.Db(this,c,T)}static async connect(c,w){return await new this(c,w).connect()}startSession(c){const w=new B.ClientSession(this,this.s.sessionPool,{explicit:!0,...c},this.options);return this.s.activeSessions.add(w),w.once("ended",()=>{this.s.activeSessions.delete(w)}),w}async withSession(c,w){const T={owner:Symbol(),...typeof c=="object"?c:{}},_=typeof c=="function"?c:w;if(_==null)throw new E.MongoInvalidArgumentError("Missing required callback parameter");const A=this.startSession(T);try{return await _(A)}finally{try{await A.endSession()}catch(y){(0,d.squashError)(y)}}}watch(c=[],w={}){return Array.isArray(c)||(w=c,c=[]),new n.ChangeStream(this,c,(0,d.resolveOptions)(this,w))}}return wr.MongoClient=b,wr}var yc;function wi(){if(yc)return Jr;yc=1,Object.defineProperty(Jr,"__esModule",{value:!0}),Jr.ChangeStream=void 0,Jr.filterOutOptions=D;const e=mi(),t=Ve,r=tt,n=U0(),i=$1(),o=Q,u=En(),h=Je,s=pn,a=Te,E=ne(),l={COLLECTION:Symbol("Collection"),DATABASE:Symbol("Database"),CLUSTER:Symbol("Cluster")},g=[t.RESUME_TOKEN_CHANGED,t.END,t.CLOSE],m="A change stream document has been received that lacks a resume token (_id).",C="ChangeStream is closed",S=M();function D(B){return Object.fromEntries(Object.entries(B).filter(([d,b])=>!S.has(d)))}const p=class p extends h.TypedEventEmitter{async[Symbol.asyncDispose](){await this.close()}constructor(d,b=[],f={}){super(),this.pipeline=b,this.options={...f};let c;if(delete this.options.writeConcern,d instanceof e.Collection)this.type=l.COLLECTION,c=d.s.db.client.options.serverSelectionTimeoutMS;else if(d instanceof i.Db)this.type=l.DATABASE,c=d.client.options.serverSelectionTimeoutMS;else if(d instanceof u.MongoClient)this.type=l.CLUSTER,c=d.options.serverSelectionTimeoutMS;else throw new o.MongoChangeStreamError("Parent provided to ChangeStream constructor must be an instance of Collection, Db, or MongoClient");this.contextOwner=Symbol(),this.parent=d,this.namespace=d.s.namespace,!this.options.readPreference&&d.readPreference&&(this.options.readPreference=d.readPreference),this.cursor=this._createChangeStreamCursor(f),this.isClosed=!1,this.mode=!1,this.on("newListener",w=>{w==="change"&&this.cursor&&this.listenerCount("change")===0&&this._streamEvents(this.cursor)}),this.on("removeListener",w=>{var T;w==="change"&&this.listenerCount("change")===0&&this.cursor&&((T=this.cursorStream)==null||T.removeAllListeners("data"))}),this.options.timeoutMS!=null&&(this.timeoutContext=new a.CSOTTimeoutContext({timeoutMS:this.options.timeoutMS,serverSelectionTimeoutMS:c}))}get resumeToken(){var d;return(d=this.cursor)==null?void 0:d.resumeToken}async hasNext(){var d,b;this._setIsIterator(),(d=this.timeoutContext)==null||d.refresh();try{for(;;)try{return await this.cursor.hasNext()}catch(f){try{await this._processErrorIteratorMode(f,this.cursor.id!=null)}catch(c){if(c instanceof o.MongoOperationTimeoutError&&this.cursor.id==null)throw c;try{await this.close()}catch(w){(0,E.squashError)(w)}throw c}}}finally{(b=this.timeoutContext)==null||b.clear()}}async next(){var d,b;this._setIsIterator(),(d=this.timeoutContext)==null||d.refresh();try{for(;;)try{const f=await this.cursor.next();return this._processChange(f??null)}catch(f){try{await this._processErrorIteratorMode(f,this.cursor.id!=null)}catch(c){if(c instanceof o.MongoOperationTimeoutError&&this.cursor.id==null)throw c;try{await this.close()}catch(w){(0,E.squashError)(w)}throw c}}}finally{(b=this.timeoutContext)==null||b.clear()}}async tryNext(){var d,b;this._setIsIterator(),(d=this.timeoutContext)==null||d.refresh();try{for(;;)try{const f=await this.cursor.tryNext();return f?this._processChange(f):null}catch(f){try{await this._processErrorIteratorMode(f,this.cursor.id!=null)}catch(c){if(c instanceof o.MongoOperationTimeoutError&&this.cursor.id==null)throw c;try{await this.close()}catch(w){(0,E.squashError)(w)}throw c}}}finally{(b=this.timeoutContext)==null||b.clear()}}async*[Symbol.asyncIterator](){if(!this.closed)try{for(;;)yield await this.next()}finally{try{await this.close()}catch(d){(0,E.squashError)(d)}}}get closed(){return this.isClosed||this.cursor.closed}async close(){var b;(b=this.timeoutContext)==null||b.clear(),this.timeoutContext=void 0,this.isClosed=!0;const d=this.cursor;try{await d.close()}finally{this._endStream()}}stream(){if(this.closed)throw new o.MongoChangeStreamError(C);return this.cursor.stream()}_setIsEmitter(){if(this.mode==="iterator")throw new o.MongoAPIError("ChangeStream cannot be used as an EventEmitter after being used as an iterator");this.mode="emitter"}_setIsIterator(){if(this.mode==="emitter")throw new o.MongoAPIError("ChangeStream cannot be used as an iterator after being used as an EventEmitter");this.mode="iterator"}_createChangeStreamCursor(d){const b=D(d);this.type===l.CLUSTER&&(b.allChangesForCluster=!0);const f=[{$changeStream:b},...this.pipeline],c=this.type===l.CLUSTER?this.parent:this.type===l.DATABASE?this.parent.client:this.type===l.COLLECTION?this.parent.client:null;if(c==null)throw new o.MongoRuntimeError(`Changestream type should only be one of cluster, database, collection. Found ${this.type.toString()}`);const w=new n.ChangeStreamCursor(c,this.namespace,f,{...d,timeoutContext:this.timeoutContext?new r.CursorTimeoutContext(this.timeoutContext,this.contextOwner):void 0});for(const T of g)w.on(T,_=>this.emit(T,_));return this.listenerCount(p.CHANGE)>0&&this._streamEvents(w),w}_closeEmitterModeWithError(d){this.emit(p.ERROR,d),this.close().then(void 0,E.squashError)}_streamEvents(d){this._setIsEmitter();const b=this.cursorStream??d.stream();this.cursorStream=b,b.on("data",f=>{var c;try{const w=this._processChange(f);this.emit(p.CHANGE,w)}catch(w){this.emit(p.ERROR,w)}(c=this.timeoutContext)==null||c.refresh()}),b.on("error",f=>this._processErrorStreamMode(f,this.cursor.id!=null))}_endStream(){var d,b,f,c;(d=this.cursorStream)==null||d.removeAllListeners("data"),(b=this.cursorStream)==null||b.removeAllListeners("close"),(f=this.cursorStream)==null||f.removeAllListeners("end"),(c=this.cursorStream)==null||c.destroy(),this.cursorStream=void 0}_processChange(d){if(this.isClosed)throw new o.MongoAPIError(C);if(d==null)throw new o.MongoRuntimeError(C);if(d&&!d._id)throw new o.MongoChangeStreamError(m);return this.cursor.cacheResumeToken(d._id),this.options.startAtOperationTime=void 0,d}_processErrorStreamMode(d,b){this.isClosed||(b&&((0,o.isResumableError)(d,this.cursor.maxWireVersion)||d instanceof o.MongoOperationTimeoutError)?(this._endStream(),this.cursor.close().then(()=>this._resume(d),f=>((0,E.squashError)(f),this._resume(d))).then(()=>{d instanceof o.MongoOperationTimeoutError&&this.emit(p.ERROR,d)},()=>this._closeEmitterModeWithError(d))):this._closeEmitterModeWithError(d))}async _processErrorIteratorMode(d,b){if(this.isClosed)throw new o.MongoAPIError(C);if(b&&((0,o.isResumableError)(d,this.cursor.maxWireVersion)||d instanceof o.MongoOperationTimeoutError)){try{await this.cursor.close()}catch(f){(0,E.squashError)(f)}if(await this._resume(d),d instanceof o.MongoOperationTimeoutError)throw d}else{try{await this.close()}catch(f){(0,E.squashError)(f)}throw d}}async _resume(d){var f;(f=this.timeoutContext)==null||f.refresh();const b=(0,E.getTopology)(this.parent);try{await b.selectServer(this.cursor.readPreference,{operationName:"reconnect topology in change stream",timeoutContext:this.timeoutContext,deprioritizedServers:new s.DeprioritizedServers}),this.cursor=this._createChangeStreamCursor(this.cursor.resumeOptions)}catch{throw await this.close(),d}}};p.RESPONSE=t.RESPONSE,p.MORE=t.MORE,p.INIT=t.INIT,p.CLOSE=t.CLOSE,p.CHANGE=t.CHANGE,p.END=t.END,p.ERROR=t.ERROR,p.RESUME_TOKEN_CHANGED=t.RESUME_TOKEN_CHANGED;let O=p;Jr.ChangeStream=O;function M(){const B={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:""};return new Set(Object.keys(B))}return Jr}var es={},_i={};Object.defineProperty(_i,"__esModule",{value:!0});_i.GridFSBucketReadStream=void 0;const M4=ao,F4=tt,mt=Q,R4=Te,bu=class bu extends M4.Readable{constructor(t,r,n,i,o){super({emitClose:!0}),this.s={bytesToTrim:0,bytesToSkip:0,bytesRead:0,chunks:t,expected:0,files:r,filter:i,init:!1,expectedEnd:0,options:{start:0,end:0,...o},readPreference:n,timeoutContext:(o==null?void 0:o.timeoutMS)!=null?new R4.CSOTTimeoutContext({timeoutMS:o.timeoutMS,serverSelectionTimeoutMS:0}):void 0}}_read(){this.destroyed||v4(this,()=>N4(this))}start(t=0){return Oc(this),this.s.options.start=t,this}end(t=0){return Oc(this),this.s.options.end=t,this}async abort(){var r,n;this.push(null),this.destroy();const t=(r=this.s.timeoutContext)==null?void 0:r.getRemainingTimeMSOrThrow();await((n=this.s.cursor)==null?void 0:n.close({timeoutMS:t}))}};bu.FILE="file";let io=bu;_i.GridFSBucketReadStream=io;function Oc(e){if(e.s.init)throw new mt.MongoGridFSStreamError("Options cannot be changed after the stream is initialized")}function N4(e){if(e.destroyed||!e.s.cursor||!e.s.file)return;const t=r=>{var l;if(e.destroyed)return;if(!r){e.push(null),(l=e.s.cursor)==null||l.close().then(void 0,g=>e.destroy(g));return}if(!e.s.file)return;const n=e.s.file.length-e.s.bytesRead,i=e.s.expected++,o=Math.min(e.s.file.chunkSize,n);if(r.n>i)return e.destroy(new mt.MongoGridFSChunkError(`ChunkIsMissing: Got unexpected n: ${r.n}, expected: ${i}`));if(r.n<i)return e.destroy(new mt.MongoGridFSChunkError(`ExtraChunk: Got unexpected n: ${r.n}, expected: ${i}`));let u=Buffer.isBuffer(r.data)?r.data:r.data.buffer;if(u.byteLength!==o)return n<=0?e.destroy(new mt.MongoGridFSChunkError(`ExtraChunk: Got unexpected n: ${r.n}, expected file length ${e.s.file.length} bytes but already read ${e.s.bytesRead} bytes`)):e.destroy(new mt.MongoGridFSChunkError(`ChunkIsWrongSize: Got unexpected length: ${u.byteLength}, expected: ${o}`));if(e.s.bytesRead+=u.byteLength,u.byteLength===0)return e.push(null);let h=null,s=null;e.s.bytesToSkip!=null&&(h=e.s.bytesToSkip,e.s.bytesToSkip=0);const a=i===e.s.expectedEnd-1,E=e.s.options.end-e.s.bytesToSkip;a&&e.s.bytesToTrim!=null?s=e.s.file.chunkSize-e.s.bytesToTrim:e.s.options.end&&E<r.data.byteLength&&(s=E),(h!=null||s!=null)&&(u=u.slice(h||0,s||u.byteLength)),e.push(u)};e.s.cursor.next().then(t,r=>{e.destroyed||e.destroy(r)})}function I4(e){var i,o;const t={};e.s.readPreference&&(t.readPreference=e.s.readPreference),e.s.options&&e.s.options.sort&&(t.sort=e.s.options.sort),e.s.options&&e.s.options.skip&&(t.skip=e.s.options.skip);const r=u=>{var a,E;if(e.destroyed)return;if(!u){const g=`FileNotFound: file ${e.s.filter._id?e.s.filter._id.toString():e.s.filter.filename} was not found`,m=new mt.MongoRuntimeError(g);return m.code="ENOENT",e.destroy(m)}if(u.length<=0){e.push(null);return}if(e.destroyed){e.destroy();return}try{e.s.bytesToSkip=P4(e,u,e.s.options)}catch(l){return e.destroy(l)}const h={files_id:u._id};if(e.s.options&&e.s.options.start!=null){const l=Math.floor(e.s.options.start/u.chunkSize);l>0&&(h.n={$gte:l})}let s;try{s=(E=e.s.timeoutContext)==null?void 0:E.getRemainingTimeMSOrThrow(`Download timed out after ${(a=e.s.timeoutContext)==null?void 0:a.timeoutMS}ms`)}catch(l){return e.destroy(l)}e.s.cursor=e.s.chunks.find(h,{timeoutMode:e.s.options.timeoutMS!=null?F4.CursorTimeoutMode.LIFETIME:void 0,timeoutMS:s}).sort({n:1}),e.s.readPreference&&e.s.cursor.withReadPreference(e.s.readPreference),e.s.expectedEnd=Math.ceil(u.length/u.chunkSize),e.s.file=u;try{e.s.bytesToTrim=L4(e,u,e.s.cursor,e.s.options)}catch(l){return e.destroy(l)}e.emit(io.FILE,u)};let n;try{n=(o=e.s.timeoutContext)==null?void 0:o.getRemainingTimeMSOrThrow(`Download timed out after ${(i=e.s.timeoutContext)==null?void 0:i.timeoutMS}ms`)}catch(u){e.destroyed||e.destroy(u);return}t.timeoutMS=n,e.s.files.findOne(e.s.filter,t).then(r,u=>{e.destroyed||e.destroy(u)})}function v4(e,t){if(e.s.file)return t();e.s.init||(I4(e),e.s.init=!0),e.once("file",()=>{t()})}function P4(e,t,r){if(r&&r.start!=null){if(r.start>t.length)throw new mt.MongoInvalidArgumentError(`Stream start (${r.start}) must not be more than the length of the file (${t.length})`);if(r.start<0)throw new mt.MongoInvalidArgumentError(`Stream start (${r.start}) must not be negative`);if(r.end!=null&&r.end<r.start)throw new mt.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 mt.MongoInvalidArgumentError("Start option must be defined")}function L4(e,t,r,n){if(n&&n.end!=null){if(n.end>t.length)throw new mt.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 mt.MongoInvalidArgumentError(`Stream end (${n.end}) must not be negative`);const i=n.start!=null?Math.floor(n.start/t.chunkSize):0;return r.limit(Math.ceil(n.end/t.chunkSize)-i),e.s.expectedEnd=Math.ceil(n.end/t.chunkSize),Math.ceil(n.end/t.chunkSize)*t.chunkSize-n.end}throw new mt.MongoInvalidArgumentError("End option must be defined")}var Di={};Object.defineProperty(Di,"__esModule",{value:!0});Di.GridFSBucketWriteStream=void 0;const k4=ao,Vl=pe,Wl=tt,vt=Q,U4=Te,wc=ne(),j4=ct();class x4 extends k4.Writable{constructor(t,r,n){super(),this.gridFSFile=null,n=n??{},this.bucket=t,this.chunks=t.s._chunksCollection,this.filename=r,this.files=t.s._filesCollection,this.options=n,this.writeConcern=j4.WriteConcern.fromOptions(n)||t.s.options.writeConcern,this.done=!1,this.id=n.id?n.id:new Vl.ObjectId,this.chunkSizeBytes=n.chunkSizeBytes||this.bucket.s.options.chunkSizeBytes,this.bufToStore=Buffer.alloc(this.chunkSizeBytes),this.length=0,this.n=0,this.pos=0,this.state={streamEnd:!1,outstandingRequests:0,errored:!1,aborted:!1},n.timeoutMS!=null&&(this.timeoutContext=new U4.CSOTTimeoutContext({timeoutMS:n.timeoutMS,serverSelectionTimeoutMS:(0,wc.resolveTimeoutOptions)(this.bucket.s.db.client,{}).serverSelectionTimeoutMS}))}_construct(t){if(!this.bucket.s.calledOpenUploadStream)this.bucket.s.calledOpenUploadStream=!0,V4(this).then(()=>{this.bucket.s.checkedIndexes=!0,this.bucket.emit("index"),t()},r=>{if(r instanceof vt.MongoOperationTimeoutError)return jr(this,r,t);(0,wc.squashError)(r),t()});else return queueMicrotask(t)}_write(t,r,n){G4(this,t,r,n)}_final(t){if(this.state.streamEnd)return queueMicrotask(t);this.state.streamEnd=!0,q4(this,t)}async abort(){var r,n;if(this.state.streamEnd)throw new vt.MongoAPIError("Cannot abort a stream that has already completed");if(this.state.aborted)throw new vt.MongoAPIError("Cannot call abort() on a stream twice");this.state.aborted=!0;const t=(n=this.timeoutContext)==null?void 0:n.getRemainingTimeMSOrThrow(`Upload timed out after ${(r=this.timeoutContext)==null?void 0:r.timeoutMS}ms`);await this.chunks.deleteMany({files_id:this.id},{timeoutMS:t})}}Di.GridFSBucketWriteStream=x4;function jr(e,t,r){if(e.state.errored){queueMicrotask(r);return}e.state.errored=!0,queueMicrotask(()=>r(t))}function Gl(e,t,r){return{_id:new Vl.ObjectId,files_id:e,n:t,data:r}}async function z4(e){var o,u,h,s;const t={files_id:1,n:1};let r;r=(u=e.timeoutContext)==null?void 0:u.getRemainingTimeMSOrThrow(`Upload timed out after ${(o=e.timeoutContext)==null?void 0:o.timeoutMS}ms`);let n;try{n=await e.chunks.listIndexes({timeoutMode:r!=null?Wl.CursorTimeoutMode.LIFETIME:void 0,timeoutMS:r}).toArray()}catch(a){if(a instanceof vt.MongoError&&a.code===vt.MONGODB_ERROR_CODES.NamespaceNotFound)n=[];else throw a}!!n.find(a=>Object.keys(a.key).length===2&&a.key.files_id===1&&a.key.n===1)||(r=(s=e.timeoutContext)==null?void 0:s.getRemainingTimeMSOrThrow(`Upload timed out after ${(h=e.timeoutContext)==null?void 0:h.timeoutMS}ms`),await e.chunks.createIndex(t,{...e.writeConcern,background:!0,unique:!0,timeoutMS:r}))}function w1(e,t){var r,n;if(e.done)return queueMicrotask(t);if(e.state.streamEnd&&e.state.outstandingRequests===0&&!e.state.errored){e.done=!0;const i=W4(e.id,e.length,e.chunkSizeBytes,e.filename,e.options.metadata);if(oo(e,t))return;const o=(r=e.timeoutContext)==null?void 0:r.remainingTimeMS;if(o!=null&&o<=0)return jr(e,new vt.MongoOperationTimeoutError(`Upload timed out after ${(n=e.timeoutContext)==null?void 0:n.timeoutMS}ms`),t);e.files.insertOne(i,{writeConcern:e.writeConcern,timeoutMS:o}).then(()=>{e.gridFSFile=i,t()},u=>jr(e,u,t));return}queueMicrotask(t)}async function V4(e){var h,s,a,E,l,g;let t=(s=e.timeoutContext)==null?void 0:s.getRemainingTimeMSOrThrow(`Upload timed out after ${(h=e.timeoutContext)==null?void 0:h.timeoutMS}ms`);if(await e.files.findOne({},{projection:{_id:1},timeoutMS:t})!=null)return;const n={filename:1,uploadDate:1};let i;t=(E=e.timeoutContext)==null?void 0:E.getRemainingTimeMSOrThrow(`Upload timed out after ${(a=e.timeoutContext)==null?void 0:a.timeoutMS}ms`);const o={timeoutMode:t!=null?Wl.CursorTimeoutMode.LIFETIME:void 0,timeoutMS:t};try{i=await e.files.listIndexes(o).toArray()}catch(m){if(m instanceof vt.MongoError&&m.code===vt.MONGODB_ERROR_CODES.NamespaceNotFound)i=[];else throw m}!!i.find(m=>Object.keys(m.key).length===2&&m.key.filename===1&&m.key.uploadDate===1)||(t=(g=e.timeoutContext)==null?void 0:g.getRemainingTimeMSOrThrow(`Upload timed out after ${(l=e.timeoutContext)==null?void 0:l.timeoutMS}ms`),await e.files.createIndex(n,{background:!1,timeoutMS:t})),await z4(e)}function W4(e,t,r,n,i){const o={_id:e,length:t,chunkSize:r,uploadDate:new Date,filename:n};return i&&(o.metadata=i),o}function G4(e,t,r,n){var a,E;if(oo(e,n))return;const i=Buffer.isBuffer(t)?t:Buffer.from(t,r);if(e.length+=i.length,e.pos+i.length<e.chunkSizeBytes){i.copy(e.bufToStore,e.pos),e.pos+=i.length,queueMicrotask(n);return}let o=i.length,u=e.chunkSizeBytes-e.pos,h=Math.min(u,i.length),s=0;for(;o>0;){const l=i.length-o;i.copy(e.bufToStore,e.pos,l,l+h),e.pos+=h,u-=h;let g;if(u===0){g=Gl(e.id,e.n,Buffer.from(e.bufToStore));const m=(a=e.timeoutContext)==null?void 0:a.remainingTimeMS;if(m!=null&&m<=0)return jr(e,new vt.MongoOperationTimeoutError(`Upload timed out after ${(E=e.timeoutContext)==null?void 0:E.timeoutMS}ms`),n);if(++e.state.outstandingRequests,++s,oo(e,n))return;e.chunks.insertOne(g,{writeConcern:e.writeConcern,timeoutMS:m}).then(()=>{--e.state.outstandingRequests,--s,s||w1(e,n)},C=>jr(e,C,n)),u=e.chunkSizeBytes,e.pos=0,++e.n}o-=h,h=Math.min(u,o)}}function q4(e,t){var o,u;if(e.pos===0)return w1(e,t);const r=Buffer.alloc(e.pos);e.bufToStore.copy(r,0,0,e.pos);const n=Gl(e.id,e.n,r);if(oo(e,t))return;const i=(o=e.timeoutContext)==null?void 0:o.remainingTimeMS;if(i!=null&&i<=0)return jr(e,new vt.MongoOperationTimeoutError(`Upload timed out after ${(u=e.timeoutContext)==null?void 0:u.timeoutMS}ms`),t);++e.state.outstandingRequests,e.chunks.insertOne(n,{writeConcern:e.writeConcern,timeoutMS:i}).then(()=>{--e.state.outstandingRequests,w1(e,t)},h=>jr(e,h,t))}function oo(e,t){return e.state.aborted?(queueMicrotask(()=>t(new vt.MongoAPIError("Stream has been aborted"))),!0):!1}Object.defineProperty(es,"__esModule",{value:!0});es.GridFSBucket=void 0;const a1=Q,H4=Je,_c=Te,ji=ne(),K4=ct(),Dc=_i,Tc=Di,Y4={bucketName:"fs",chunkSizeBytes:255*1024},Mu=class Mu extends H4.TypedEventEmitter{constructor(t,r){super(),this.on("error",ji.noop),this.setMaxListeners(0);const n=(0,ji.resolveOptions)(t,{...Y4,...r,writeConcern:K4.WriteConcern.fromOptions(r)});this.s={db:t,options:n,_chunksCollection:t.collection(n.bucketName+".chunks"),_filesCollection:t.collection(n.bucketName+".files"),checkedIndexes:!1,calledOpenUploadStream:!1}}openUploadStream(t,r){return new Tc.GridFSBucketWriteStream(this,t,{timeoutMS:this.s.options.timeoutMS,...r})}openUploadStreamWithId(t,r,n){return new Tc.GridFSBucketWriteStream(this,r,{timeoutMS:this.s.options.timeoutMS,...n,id:t})}openDownloadStream(t,r){return new Dc.GridFSBucketReadStream(this.s._chunksCollection,this.s._filesCollection,this.s.options.readPreference,{_id:t},{timeoutMS:this.s.options.timeoutMS,...r})}async delete(t,r){const{timeoutMS:n}=(0,ji.resolveOptions)(this.s.db,r);let i;n&&(i=new _c.CSOTTimeoutContext({timeoutMS:n,serverSelectionTimeoutMS:this.s.db.client.s.options.serverSelectionTimeoutMS}));const{deletedCount:o}=await this.s._filesCollection.deleteOne({_id:t},{timeoutMS:i==null?void 0:i.remainingTimeMS}),u=i==null?void 0:i.remainingTimeMS;if(u!=null&&u<=0)throw new a1.MongoOperationTimeoutError(`Timed out after ${n}ms`);if(await this.s._chunksCollection.deleteMany({files_id:t},{timeoutMS:u}),o===0)throw new a1.MongoRuntimeError(`File not found for id ${t}`)}find(t={},r={}){return this.s._filesCollection.find(t,r)}openDownloadStreamByName(t,r){let n={uploadDate:-1},i;return r&&r.revision!=null&&(r.revision>=0?(n={uploadDate:1},i=r.revision):i=-r.revision-1),new Dc.GridFSBucketReadStream(this.s._chunksCollection,this.s._filesCollection,this.s.options.readPreference,{filename:t},{timeoutMS:this.s.options.timeoutMS,...r,sort:n,skip:i})}async rename(t,r,n){const i={_id:t},o={$set:{filename:r}},{matchedCount:u}=await this.s._filesCollection.updateOne(i,o,n);if(u===0)throw new a1.MongoRuntimeError(`File with id ${t} not found`)}async drop(t){const{timeoutMS:r}=(0,ji.resolveOptions)(this.s.db,t);let n;if(r&&(n=new _c.CSOTTimeoutContext({timeoutMS:r,serverSelectionTimeoutMS:this.s.db.client.s.options.serverSelectionTimeoutMS})),n){await this.s._filesCollection.drop({timeoutMS:n.remainingTimeMS});const i=n.getRemainingTimeMSOrThrow(`Timed out after ${r}ms`);await this.s._chunksCollection.drop({timeoutMS:i})}else await this.s._filesCollection.drop(),await this.s._chunksCollection.drop()}};Mu.INDEX="index";let _1=Mu;es.GridFSBucket=_1;var Bc;function ts(){return Bc||(Bc=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MongoRuntimeError=e.MongoParseError=e.MongoOperationTimeoutError=e.MongoOIDCError=e.MongoNotConnectedError=e.MongoNetworkTimeoutError=e.MongoNetworkError=e.MongoMissingDependencyError=e.MongoMissingCredentialsError=e.MongoKerberosError=e.MongoInvalidArgumentError=e.MongoGridFSStreamError=e.MongoGridFSChunkError=e.MongoGCPError=e.MongoExpiredSessionError=e.MongoError=e.MongoDriverError=e.MongoDecompressionError=e.MongoCursorInUseError=e.MongoCursorExhaustedError=e.MongoCompatibilityError=e.MongoClientClosedError=e.MongoClientBulkWriteExecutionError=e.MongoClientBulkWriteError=e.MongoClientBulkWriteCursorError=e.MongoChangeStreamError=e.MongoBatchReExecutionError=e.MongoAzureError=e.MongoAWSError=e.MongoAPIError=e.ExplainableCursor=e.ChangeStreamCursor=e.ClientEncryption=e.MongoBulkWriteError=e.UUID=e.Timestamp=e.ObjectId=e.MinKey=e.MaxKey=e.Long=e.Int32=e.Double=e.Decimal128=e.DBRef=e.Code=e.BSONType=e.BSONSymbol=e.BSONRegExp=e.Binary=e.BSON=void 0,e.CommandStartedEvent=e.CommandFailedEvent=e.WriteConcern=e.ReadPreference=e.ReadConcern=e.TopologyType=e.ServerType=e.ReadPreferenceMode=e.ReadConcernLevel=e.ProfilingLevel=e.ReturnDocument=e.SeverityLevel=e.MongoLoggableComponent=e.ServerApiVersion=e.ExplainVerbosity=e.MongoErrorLabel=e.CursorTimeoutMode=e.CURSOR_FLAGS=e.Compressor=e.AuthMechanism=e.GSSAPICanonicalizationValue=e.AutoEncryptionLoggerLevel=e.BatchType=e.UnorderedBulkOperation=e.OrderedBulkOperation=e.MongoClient=e.ListIndexesCursor=e.ListCollectionsCursor=e.GridFSBucketWriteStream=e.GridFSBucketReadStream=e.GridFSBucket=e.FindCursor=e.Db=e.Collection=e.ClientSession=e.ChangeStream=e.CancellationToken=e.AggregationCursor=e.Admin=e.AbstractCursor=e.MongoWriteConcernError=e.MongoUnexpectedServerResponseError=e.MongoTransactionError=e.MongoTopologyClosedError=e.MongoTailableCursorError=e.MongoSystemError=e.MongoStalePrimaryError=e.MongoServerSelectionError=e.MongoServerError=e.MongoServerClosedError=void 0,e.MongoClientAuthProviders=e.MongoCryptKMSRequestNetworkTimeoutError=e.MongoCryptInvalidArgumentError=e.MongoCryptError=e.MongoCryptCreateEncryptedCollectionError=e.MongoCryptCreateDataKeyError=e.MongoCryptAzureKMSRequestError=e.SrvPollingEvent=e.WaitingForSuitableServerEvent=e.ServerSelectionSucceededEvent=e.ServerSelectionStartedEvent=e.ServerSelectionFailedEvent=e.ServerSelectionEvent=e.TopologyOpeningEvent=e.TopologyDescriptionChangedEvent=e.TopologyClosedEvent=e.ServerOpeningEvent=e.ServerHeartbeatSucceededEvent=e.ServerHeartbeatStartedEvent=e.ServerHeartbeatFailedEvent=e.ServerDescriptionChangedEvent=e.ServerClosedEvent=e.ConnectionReadyEvent=e.ConnectionPoolReadyEvent=e.ConnectionPoolMonitoringEvent=e.ConnectionPoolCreatedEvent=e.ConnectionPoolClosedEvent=e.ConnectionPoolClearedEvent=e.ConnectionCreatedEvent=e.ConnectionClosedEvent=e.ConnectionCheckOutStartedEvent=e.ConnectionCheckOutFailedEvent=e.ConnectionCheckedOutEvent=e.ConnectionCheckedInEvent=e.CommandSucceededEvent=void 0;const t=ei;Object.defineProperty(e,"Admin",{enumerable:!0,get:function(){return t.Admin}});const r=ui;Object.defineProperty(e,"OrderedBulkOperation",{enumerable:!0,get:function(){return r.OrderedBulkOperation}});const n=ci;Object.defineProperty(e,"UnorderedBulkOperation",{enumerable:!0,get:function(){return n.UnorderedBulkOperation}});const i=wi();Object.defineProperty(e,"ChangeStream",{enumerable:!0,get:function(){return i.ChangeStream}});const o=mi();Object.defineProperty(e,"Collection",{enumerable:!0,get:function(){return o.Collection}});const u=tt;Object.defineProperty(e,"AbstractCursor",{enumerable:!0,get:function(){return u.AbstractCursor}});const h=qr;Object.defineProperty(e,"AggregationCursor",{enumerable:!0,get:function(){return h.AggregationCursor}});const s=Lr;Object.defineProperty(e,"FindCursor",{enumerable:!0,get:function(){return s.FindCursor}});const a=Ei;Object.defineProperty(e,"ListCollectionsCursor",{enumerable:!0,get:function(){return a.ListCollectionsCursor}});const E=fi;Object.defineProperty(e,"ListIndexesCursor",{enumerable:!0,get:function(){return E.ListIndexesCursor}});const l=$1();Object.defineProperty(e,"Db",{enumerable:!0,get:function(){return l.Db}});const g=es;Object.defineProperty(e,"GridFSBucket",{enumerable:!0,get:function(){return g.GridFSBucket}});const m=_i;Object.defineProperty(e,"GridFSBucketReadStream",{enumerable:!0,get:function(){return m.GridFSBucketReadStream}});const C=Di;Object.defineProperty(e,"GridFSBucketWriteStream",{enumerable:!0,get:function(){return C.GridFSBucketWriteStream}});const S=En();Object.defineProperty(e,"MongoClient",{enumerable:!0,get:function(){return S.MongoClient}});const D=Je;Object.defineProperty(e,"CancellationToken",{enumerable:!0,get:function(){return D.CancellationToken}});const O=ut;Object.defineProperty(e,"ClientSession",{enumerable:!0,get:function(){return O.ClientSession}});var M=pe;Object.defineProperty(e,"BSON",{enumerable:!0,get:function(){return M.BSON}});var p=pe;Object.defineProperty(e,"Binary",{enumerable:!0,get:function(){return p.Binary}}),Object.defineProperty(e,"BSONRegExp",{enumerable:!0,get:function(){return p.BSONRegExp}}),Object.defineProperty(e,"BSONSymbol",{enumerable:!0,get:function(){return p.BSONSymbol}}),Object.defineProperty(e,"BSONType",{enumerable:!0,get:function(){return p.BSONType}}),Object.defineProperty(e,"Code",{enumerable:!0,get:function(){return p.Code}}),Object.defineProperty(e,"DBRef",{enumerable:!0,get:function(){return p.DBRef}}),Object.defineProperty(e,"Decimal128",{enumerable:!0,get:function(){return p.Decimal128}}),Object.defineProperty(e,"Double",{enumerable:!0,get:function(){return p.Double}}),Object.defineProperty(e,"Int32",{enumerable:!0,get:function(){return p.Int32}}),Object.defineProperty(e,"Long",{enumerable:!0,get:function(){return p.Long}}),Object.defineProperty(e,"MaxKey",{enumerable:!0,get:function(){return p.MaxKey}}),Object.defineProperty(e,"MinKey",{enumerable:!0,get:function(){return p.MinKey}}),Object.defineProperty(e,"ObjectId",{enumerable:!0,get:function(){return p.ObjectId}}),Object.defineProperty(e,"Timestamp",{enumerable:!0,get:function(){return p.Timestamp}}),Object.defineProperty(e,"UUID",{enumerable:!0,get:function(){return p.UUID}});var B=Yn;Object.defineProperty(e,"MongoBulkWriteError",{enumerable:!0,get:function(){return B.MongoBulkWriteError}});var d=pu();Object.defineProperty(e,"ClientEncryption",{enumerable:!0,get:function(){return d.ClientEncryption}});var b=U0();Object.defineProperty(e,"ChangeStreamCursor",{enumerable:!0,get:function(){return b.ChangeStreamCursor}});var f=Sn;Object.defineProperty(e,"ExplainableCursor",{enumerable:!0,get:function(){return f.ExplainableCursor}});var c=Q;Object.defineProperty(e,"MongoAPIError",{enumerable:!0,get:function(){return c.MongoAPIError}}),Object.defineProperty(e,"MongoAWSError",{enumerable:!0,get:function(){return c.MongoAWSError}}),Object.defineProperty(e,"MongoAzureError",{enumerable:!0,get:function(){return c.MongoAzureError}}),Object.defineProperty(e,"MongoBatchReExecutionError",{enumerable:!0,get:function(){return c.MongoBatchReExecutionError}}),Object.defineProperty(e,"MongoChangeStreamError",{enumerable:!0,get:function(){return c.MongoChangeStreamError}}),Object.defineProperty(e,"MongoClientBulkWriteCursorError",{enumerable:!0,get:function(){return c.MongoClientBulkWriteCursorError}}),Object.defineProperty(e,"MongoClientBulkWriteError",{enumerable:!0,get:function(){return c.MongoClientBulkWriteError}}),Object.defineProperty(e,"MongoClientBulkWriteExecutionError",{enumerable:!0,get:function(){return c.MongoClientBulkWriteExecutionError}}),Object.defineProperty(e,"MongoClientClosedError",{enumerable:!0,get:function(){return c.MongoClientClosedError}}),Object.defineProperty(e,"MongoCompatibilityError",{enumerable:!0,get:function(){return c.MongoCompatibilityError}}),Object.defineProperty(e,"MongoCursorExhaustedError",{enumerable:!0,get:function(){return c.MongoCursorExhaustedError}}),Object.defineProperty(e,"MongoCursorInUseError",{enumerable:!0,get:function(){return c.MongoCursorInUseError}}),Object.defineProperty(e,"MongoDecompressionError",{enumerable:!0,get:function(){return c.MongoDecompressionError}}),Object.defineProperty(e,"MongoDriverError",{enumerable:!0,get:function(){return c.MongoDriverError}}),Object.defineProperty(e,"MongoError",{enumerable:!0,get:function(){return c.MongoError}}),Object.defineProperty(e,"MongoExpiredSessionError",{enumerable:!0,get:function(){return c.MongoExpiredSessionError}}),Object.defineProperty(e,"MongoGCPError",{enumerable:!0,get:function(){return c.MongoGCPError}}),Object.defineProperty(e,"MongoGridFSChunkError",{enumerable:!0,get:function(){return c.MongoGridFSChunkError}}),Object.defineProperty(e,"MongoGridFSStreamError",{enumerable:!0,get:function(){return c.MongoGridFSStreamError}}),Object.defineProperty(e,"MongoInvalidArgumentError",{enumerable:!0,get:function(){return c.MongoInvalidArgumentError}}),Object.defineProperty(e,"MongoKerberosError",{enumerable:!0,get:function(){return c.MongoKerberosError}}),Object.defineProperty(e,"MongoMissingCredentialsError",{enumerable:!0,get:function(){return c.MongoMissingCredentialsError}}),Object.defineProperty(e,"MongoMissingDependencyError",{enumerable:!0,get:function(){return c.MongoMissingDependencyError}}),Object.defineProperty(e,"MongoNetworkError",{enumerable:!0,get:function(){return c.MongoNetworkError}}),Object.defineProperty(e,"MongoNetworkTimeoutError",{enumerable:!0,get:function(){return c.MongoNetworkTimeoutError}}),Object.defineProperty(e,"MongoNotConnectedError",{enumerable:!0,get:function(){return c.MongoNotConnectedError}}),Object.defineProperty(e,"MongoOIDCError",{enumerable:!0,get:function(){return c.MongoOIDCError}}),Object.defineProperty(e,"MongoOperationTimeoutError",{enumerable:!0,get:function(){return c.MongoOperationTimeoutError}}),Object.defineProperty(e,"MongoParseError",{enumerable:!0,get:function(){return c.MongoParseError}}),Object.defineProperty(e,"MongoRuntimeError",{enumerable:!0,get:function(){return c.MongoRuntimeError}}),Object.defineProperty(e,"MongoServerClosedError",{enumerable:!0,get:function(){return c.MongoServerClosedError}}),Object.defineProperty(e,"MongoServerError",{enumerable:!0,get:function(){return c.MongoServerError}}),Object.defineProperty(e,"MongoServerSelectionError",{enumerable:!0,get:function(){return c.MongoServerSelectionError}}),Object.defineProperty(e,"MongoStalePrimaryError",{enumerable:!0,get:function(){return c.MongoStalePrimaryError}}),Object.defineProperty(e,"MongoSystemError",{enumerable:!0,get:function(){return c.MongoSystemError}}),Object.defineProperty(e,"MongoTailableCursorError",{enumerable:!0,get:function(){return c.MongoTailableCursorError}}),Object.defineProperty(e,"MongoTopologyClosedError",{enumerable:!0,get:function(){return c.MongoTopologyClosedError}}),Object.defineProperty(e,"MongoTransactionError",{enumerable:!0,get:function(){return c.MongoTransactionError}}),Object.defineProperty(e,"MongoUnexpectedServerResponseError",{enumerable:!0,get:function(){return c.MongoUnexpectedServerResponseError}}),Object.defineProperty(e,"MongoWriteConcernError",{enumerable:!0,get:function(){return c.MongoWriteConcernError}});var w=Yn;Object.defineProperty(e,"BatchType",{enumerable:!0,get:function(){return w.BatchType}});var T=gl();Object.defineProperty(e,"AutoEncryptionLoggerLevel",{enumerable:!0,get:function(){return T.AutoEncryptionLoggerLevel}});var _=Ro;Object.defineProperty(e,"GSSAPICanonicalizationValue",{enumerable:!0,get:function(){return _.GSSAPICanonicalizationValue}});var A=qt;Object.defineProperty(e,"AuthMechanism",{enumerable:!0,get:function(){return A.AuthMechanism}});var y=Lo();Object.defineProperty(e,"Compressor",{enumerable:!0,get:function(){return y.Compressor}});var F=tt;Object.defineProperty(e,"CURSOR_FLAGS",{enumerable:!0,get:function(){return F.CURSOR_FLAGS}}),Object.defineProperty(e,"CursorTimeoutMode",{enumerable:!0,get:function(){return F.CursorTimeoutMode}});var R=Q;Object.defineProperty(e,"MongoErrorLabel",{enumerable:!0,get:function(){return R.MongoErrorLabel}});var v=oi;Object.defineProperty(e,"ExplainVerbosity",{enumerable:!0,get:function(){return v.ExplainVerbosity}});var J=En();Object.defineProperty(e,"ServerApiVersion",{enumerable:!0,get:function(){return J.ServerApiVersion}});var I=Cr;Object.defineProperty(e,"MongoLoggableComponent",{enumerable:!0,get:function(){return I.MongoLoggableComponent}}),Object.defineProperty(e,"SeverityLevel",{enumerable:!0,get:function(){return I.SeverityLevel}});var N=J1;Object.defineProperty(e,"ReturnDocument",{enumerable:!0,get:function(){return N.ReturnDocument}});var j=Z1;Object.defineProperty(e,"ProfilingLevel",{enumerable:!0,get:function(){return j.ProfilingLevel}});var x=Pt;Object.defineProperty(e,"ReadConcernLevel",{enumerable:!0,get:function(){return x.ReadConcernLevel}});var Y=Ke;Object.defineProperty(e,"ReadPreferenceMode",{enumerable:!0,get:function(){return Y.ReadPreferenceMode}});var $=Ne;Object.defineProperty(e,"ServerType",{enumerable:!0,get:function(){return $.ServerType}}),Object.defineProperty(e,"TopologyType",{enumerable:!0,get:function(){return $.TopologyType}});var K=Pt;Object.defineProperty(e,"ReadConcern",{enumerable:!0,get:function(){return K.ReadConcern}});var ee=Ke;Object.defineProperty(e,"ReadPreference",{enumerable:!0,get:function(){return ee.ReadPreference}});var ae=ct();Object.defineProperty(e,"WriteConcern",{enumerable:!0,get:function(){return ae.WriteConcern}});var ye=Su;Object.defineProperty(e,"CommandFailedEvent",{enumerable:!0,get:function(){return ye.CommandFailedEvent}}),Object.defineProperty(e,"CommandStartedEvent",{enumerable:!0,get:function(){return ye.CommandStartedEvent}}),Object.defineProperty(e,"CommandSucceededEvent",{enumerable:!0,get:function(){return ye.CommandSucceededEvent}});var ce=Fe;Object.defineProperty(e,"ConnectionCheckedInEvent",{enumerable:!0,get:function(){return ce.ConnectionCheckedInEvent}}),Object.defineProperty(e,"ConnectionCheckedOutEvent",{enumerable:!0,get:function(){return ce.ConnectionCheckedOutEvent}}),Object.defineProperty(e,"ConnectionCheckOutFailedEvent",{enumerable:!0,get:function(){return ce.ConnectionCheckOutFailedEvent}}),Object.defineProperty(e,"ConnectionCheckOutStartedEvent",{enumerable:!0,get:function(){return ce.ConnectionCheckOutStartedEvent}}),Object.defineProperty(e,"ConnectionClosedEvent",{enumerable:!0,get:function(){return ce.ConnectionClosedEvent}}),Object.defineProperty(e,"ConnectionCreatedEvent",{enumerable:!0,get:function(){return ce.ConnectionCreatedEvent}}),Object.defineProperty(e,"ConnectionPoolClearedEvent",{enumerable:!0,get:function(){return ce.ConnectionPoolClearedEvent}}),Object.defineProperty(e,"ConnectionPoolClosedEvent",{enumerable:!0,get:function(){return ce.ConnectionPoolClosedEvent}}),Object.defineProperty(e,"ConnectionPoolCreatedEvent",{enumerable:!0,get:function(){return ce.ConnectionPoolCreatedEvent}}),Object.defineProperty(e,"ConnectionPoolMonitoringEvent",{enumerable:!0,get:function(){return ce.ConnectionPoolMonitoringEvent}}),Object.defineProperty(e,"ConnectionPoolReadyEvent",{enumerable:!0,get:function(){return ce.ConnectionPoolReadyEvent}}),Object.defineProperty(e,"ConnectionReadyEvent",{enumerable:!0,get:function(){return ce.ConnectionReadyEvent}});var le=Ue;Object.defineProperty(e,"ServerClosedEvent",{enumerable:!0,get:function(){return le.ServerClosedEvent}}),Object.defineProperty(e,"ServerDescriptionChangedEvent",{enumerable:!0,get:function(){return le.ServerDescriptionChangedEvent}}),Object.defineProperty(e,"ServerHeartbeatFailedEvent",{enumerable:!0,get:function(){return le.ServerHeartbeatFailedEvent}}),Object.defineProperty(e,"ServerHeartbeatStartedEvent",{enumerable:!0,get:function(){return le.ServerHeartbeatStartedEvent}}),Object.defineProperty(e,"ServerHeartbeatSucceededEvent",{enumerable:!0,get:function(){return le.ServerHeartbeatSucceededEvent}}),Object.defineProperty(e,"ServerOpeningEvent",{enumerable:!0,get:function(){return le.ServerOpeningEvent}}),Object.defineProperty(e,"TopologyClosedEvent",{enumerable:!0,get:function(){return le.TopologyClosedEvent}}),Object.defineProperty(e,"TopologyDescriptionChangedEvent",{enumerable:!0,get:function(){return le.TopologyDescriptionChangedEvent}}),Object.defineProperty(e,"TopologyOpeningEvent",{enumerable:!0,get:function(){return le.TopologyOpeningEvent}});var he=ft;Object.defineProperty(e,"ServerSelectionEvent",{enumerable:!0,get:function(){return he.ServerSelectionEvent}}),Object.defineProperty(e,"ServerSelectionFailedEvent",{enumerable:!0,get:function(){return he.ServerSelectionFailedEvent}}),Object.defineProperty(e,"ServerSelectionStartedEvent",{enumerable:!0,get:function(){return he.ServerSelectionStartedEvent}}),Object.defineProperty(e,"ServerSelectionSucceededEvent",{enumerable:!0,get:function(){return he.ServerSelectionSucceededEvent}}),Object.defineProperty(e,"WaitingForSuitableServerEvent",{enumerable:!0,get:function(){return he.WaitingForSuitableServerEvent}});var Ee=Ur;Object.defineProperty(e,"SrvPollingEvent",{enumerable:!0,get:function(){return Ee.SrvPollingEvent}});var re=Ge;Object.defineProperty(e,"MongoCryptAzureKMSRequestError",{enumerable:!0,get:function(){return re.MongoCryptAzureKMSRequestError}}),Object.defineProperty(e,"MongoCryptCreateDataKeyError",{enumerable:!0,get:function(){return re.MongoCryptCreateDataKeyError}}),Object.defineProperty(e,"MongoCryptCreateEncryptedCollectionError",{enumerable:!0,get:function(){return re.MongoCryptCreateEncryptedCollectionError}}),Object.defineProperty(e,"MongoCryptError",{enumerable:!0,get:function(){return re.MongoCryptError}}),Object.defineProperty(e,"MongoCryptInvalidArgumentError",{enumerable:!0,get:function(){return re.MongoCryptInvalidArgumentError}}),Object.defineProperty(e,"MongoCryptKMSRequestNetworkTimeoutError",{enumerable:!0,get:function(){return re.MongoCryptKMSRequestNetworkTimeoutError}});var Ce=Ci;Object.defineProperty(e,"MongoClientAuthProviders",{enumerable:!0,get:function(){return Ce.MongoClientAuthProviders}})}(is)),is}var c1=ts();class X4{constructor(t,r,n){se(this,"client");se(this,"schemaMeta");se(this,"context");se(this,"fieldMetaMap",{});se(this,"idField","_id");this.client=t,this.schemaMeta=r,this.context=n,this.fieldMetaMap=Object.entries(r).reduce((i,[o,u])=>(i[o]=u.columns.reduce((h,s)=>(h[s.name]=s,h),{}),i),{})}getObjectId(t){return new c1.ObjectId(t)}getCollection(t){return this.client.collection(t)}normalizeId(t){return typeof t=="string"&&c1.ObjectId.isValid(t)?new c1.ObjectId(t):t}buildSort(t){const r={};return t.forEach(n=>{r[n.fieldName]=n.order==="asc"?1:-1}),r}buildFindOptions(t){const r={};if(t!=null&&t.select&&(r.projection=t.select),(t==null?void 0:t.offset)!=null&&(r.skip=t.offset),(t==null?void 0:t.limit)!=null&&(r.limit=t.limit),t!=null&&t.orderBy){const n=Ht.QueryBuilder.getOrderByArray(t.orderBy);n.length>0&&(r.sort=this.buildSort(n))}return r}async findUnique(t,{where:r,select:n}){const i=this.getCollection(t),o=Object.keys(r??{});if(o.length===1&&o[0]===this.idField){const a={[this.idField]:this.normalizeId(r[this.idField])},E={};return n&&(E.projection=n),await i.findOne(a,E)}const u=Ht.QueryBuilder.buildMongodbQuery(r,this.fieldMetaMap[t],this.getObjectId),h={};return n&&(h.projection=n),(await i.find(u,{...h,limit:1}).toArray())[0]??null}async findUniqueOrThrow(t,{where:r,select:n}){const i=await this.findUnique(t,{where:r,select:n});if(!i)throw new Error("Data Not Found");return i}async findFirst(t,r){const n=this.getCollection(t),i=Ht.QueryBuilder.buildMongodbQuery((r==null?void 0:r.where)??{},this.fieldMetaMap[t],this.getObjectId),o=this.buildFindOptions({...r,limit:1});return await n.findOne(i,o)}async findFirstOrThrow(t,r){const n=await this.findFirst(t,r);if(!n)throw new Error("Data Not Found");return n}async findManyInner(t,r){const n=this.getCollection(t),i=Ht.QueryBuilder.buildMongodbQuery((r==null?void 0:r.where)??{},this.fieldMetaMap[t],this.getObjectId),o=this.buildFindOptions(r);return{data:await n.find(i,o).toArray()}}async findMany(t,r){const n=r==null?void 0:r.where,i=r==null?void 0:r.orderBy,o=r==null?void 0:r.select,{data:u}=await this.findManyInner(t,{where:n,orderBy:i,select:o,limit:1e3,offset:0});return u}async findPage(t,r){const i=(r==null?void 0:r.limit)||10;if(i>1e3)throw new Error("limit must be less than or equal to 1000");const o=r==null?void 0:r.where,u=r==null?void 0:r.orderBy,h=(r==null?void 0:r.page)||1,s=r==null?void 0:r.select,a=(h-1)*i,E=this.findManyInner(t,{where:o,orderBy:u,select:s,limit:i,offset:a}),l=this.count(t,{where:o}),{data:g}=await E,m=await l,C=Math.ceil(m/i);return{data:g,total:m,page:h,pageCount:C,limit:i,hasPrev:h>1,hasNext:h<C}}async create(t,{data:r}){const n=this.getCollection(t),i=Ht.applyDefaultValues(r,this.schemaMeta[t],this.context);return{_id:(await n.insertOne(i)).insertedId.toString()}}async update(t,{where:r,data:n}){const i=this.getCollection(t),o=Ht.applyUpdateValues(n,this.schemaMeta[t]),u=Object.keys(r??{});if(u.length===1&&u[0]===this.idField){const s={[this.idField]:this.normalizeId(r[this.idField])};await i.updateOne(s,o);return}const h=Ht.QueryBuilder.buildMongodbQuery(r,this.fieldMetaMap[t],this.getObjectId);await i.updateMany(h,o)}async delete(t,{where:r}){const n=this.getCollection(t),i=Object.keys(r??{});if(i.length===1&&i[0]===this.idField){const u={[this.idField]:this.normalizeId(r[this.idField])};await n.deleteOne(u);return}const o=Ht.QueryBuilder.buildMongodbQuery(r,this.fieldMetaMap[t],this.getObjectId);await n.deleteMany(o)}async count(t,r){try{const n=this.getCollection(t),i=Ht.QueryBuilder.buildMongodbQuery((r==null?void 0:r.where)??{},this.fieldMetaMap[t],this.getObjectId);return await n.countDocuments(i)}catch(n){throw console.error("count error:",n),n}}}function J4(e,t,r){const n=new X4(e,t,r),i={};return Object.keys(t).forEach(o=>{i[o]={findUnique:u=>n.findUnique(o,u),findUniqueOrThrow:u=>n.findUniqueOrThrow(o,u),findFirst:u=>n.findFirst(o,u),findFirstOrThrow:u=>n.findFirstOrThrow(o,u),findMany:u=>n.findMany(o,u),findPage:u=>n.findPage(o,u),create:u=>n.create(o,u),update:u=>n.update(o,u),delete:u=>n.delete(o,u),count:u=>n.count(o,u)}}),i}exports.createMongoDBClient=J4;