neo4j-driver 6.2.0 → 6.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- ((e,t)=>{"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).neo4j=t()})(this,function(){var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function D(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var U={},L={},e={},t={},F={},n={},B=(Object.defineProperty(n,"__esModule",{value:!0}),n.createBrokenObject=function(r,e){void 0===e&&(e={});function n(){throw r}return new Proxy(e,{get:function(e,t){return t===B||(t===V?r:void("toJSON"!==t&&n()))},set:n,apply:n,construct:n,defineProperty:n,deleteProperty:n,getOwnPropertyDescriptor:n,getPrototypeOf:n,has:n,isExtensible:n,ownKeys:n,preventExtensions:n,setPrototypeOf:n})},n.isBrokenObject=function(e){return null!==e&&"object"==typeof e&&!0===e[B]},n.getBrokenObjectReason=function(e){return e[V]},"__isBrokenObject__"),V="__reason__";Object.defineProperty(F,"__esModule",{value:!0}),F.stringify=function(e,t){return JSON.stringify(e,function(e,r){return(0,q.isBrokenObject)(r)?{__isBrokenObject__:!0,__reason__:(0,q.getBrokenObjectReason)(r)}:"bigint"==typeof r?"".concat(r,"n"):!0!==(null==t?void 0:t.sortedElements)||"object"!=typeof r||Array.isArray(r)?!0!==(null==t?void 0:t.useCustomToString)||"object"!=typeof r||Array.isArray(r)||"function"!=typeof r.toString||r.toString===Object.prototype.toString?r:null==r?void 0:r.toString():Object.keys(r).sort().reduce(function(e,t){return e[t]=r[t],e},{})})};var q=n;var W,z,H,G={},o=(o=G,Object.defineProperty(o,"__esModule",{value:!0}),o.rawPolyfilledDiagnosticRecord=void 0,o.rawPolyfilledDiagnosticRecord={OPERATION:"",OPERATION_CODE:"0",CURRENT_SCHEMA:"/"},Object.freeze(o.rawPolyfilledDiagnosticRecord),r&&r.__extends||(W=function(e,t){return(W=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}W(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),Y=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),K=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=r&&r.__importStar||(z=function(e){return(z=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=z(e),n=0;n<r.length;n++)"default"!==r[n]&&Y(t,e,r[n]);return K(t,e),t}),Z=(Object.defineProperty(t,"__esModule",{value:!0}),t.PROTOCOL_ERROR=t.SESSION_EXPIRED=t.SERVICE_UNAVAILABLE=t.GQLError=t.Neo4jError=t.isRetryableError=t.isRetriableError=void 0,t.newError=function(e,t,r,n,o,i){return new oe(e,null!=t?t:ee,null!=n?n:"50N42",null!=o?o:"error: general processing exception - unexpected error. "+e,null!=i?i:Q.rawPolyfilledDiagnosticRecord,r)},t.newGQLError=function(e,t,r,n,o){return new te(e,null!=r?r:"50N42",null!=n?n:"error: general processing exception - unexpected error. "+e,null!=o?o:Q.rawPolyfilledDiagnosticRecord,t)},i(F)),Q=G,i={DATABASE_ERROR:"DATABASE_ERROR",CLIENT_ERROR:"CLIENT_ERROR",TRANSIENT_ERROR:"TRANSIENT_ERROR",UNKNOWN:"UNKNOWN"},X=(Object.freeze(i),Object.values(i)),J="ServiceUnavailable",$=(t.SERVICE_UNAVAILABLE=J,"SessionExpired"),ee=(t.SESSION_EXPIRED=$,t.PROTOCOL_ERROR="ProtocolError","N/A"),te=(H=Error,o(re,H),re.prototype.containsGqlCause=function(e){return void 0!==this.findByGqlStatus(e)},re.prototype.findByGqlStatus=function(e){return this.gqlStatus===e?this:void 0!==this.cause&&(this.cause instanceof re||this.cause instanceof oe)?this.cause.findByGqlStatus(e):void 0},Object.defineProperty(re.prototype,"diagnosticRecordAsJsonString",{get:function(){return Z.stringify(this.diagnosticRecord,{useCustomToString:!0})},enumerable:!1,configurable:!0}),re);function re(e,t,r,n,o){e=H.call(this,e,null!=o?{cause:o}:void 0)||this;return e.constructor=re,e.__proto__=re.prototype,e.cause=null!=o?o:void 0,e.gqlStatus=t,e.gqlStatusDescription=r,e.diagnosticRecord=n,e.classification=void 0!==(o=e.diagnosticRecord)&&void 0!==o._classification&&X.includes(o._classification)?null==o?void 0:o._classification:"UNKNOWN",e.rawClassification=null!=(t=null==n?void 0:n._classification)?t:void 0,e.name="GQLError",e}t.GQLError=te;o(ie,ne=te),ie.isRetriable=function(e){return this.isRetryable(e)},ie.isRetryable=function(e){return null!=e&&e instanceof ie&&e.retryable};var ne,oe=ie;function ie(e,t,r,n,o,i){e=ne.call(this,e,r,n,o,i)||this,e.constructor=ie,e.__proto__=ie.prototype,e.code=t,e.name="Neo4jError",n=(r=t)===J||r===$||"Neo.ClientError.Security.AuthorizationExpired"===r||(e=>!0===(null==e?void 0:e.includes("TransientError")))(r);return e.retriable=n,e.retryable=n,e}i=(t.Neo4jError=oe).isRetriable,t.isRetriableError=i,o=oe.isRetryable;t.isRetryableError=o;var i={},ue=(Object.defineProperty(i,"__esModule",{value:!0}),i.toString=i.toNumber=i.inSafeRange=i.isInt=i.int=void 0,t),ae=new Map,o=(d.prototype.inSafeRange=function(){return this.greaterThanOrEqual(d.MIN_SAFE_VALUE)&&this.lessThanOrEqual(d.MAX_SAFE_VALUE)},d.prototype.toInt=function(){return this.low},d.prototype.toNumber=function(){return this.high*se+(this.low>>>0)},d.prototype.toBigInt=function(){var e;return this.isZero()?BigInt(0):this.isPositive()?BigInt(this.high>>>0)*BigInt(se)+BigInt(this.low>>>0):(e=this.negate(),BigInt(-1)*(BigInt(e.high>>>0)*BigInt(se)+BigInt(e.low>>>0)))},d.prototype.toNumberOrInfinity=function(){return this.lessThan(d.MIN_SAFE_VALUE)?Number.NEGATIVE_INFINITY:this.greaterThan(d.MAX_SAFE_VALUE)?Number.POSITIVE_INFINITY:this.toNumber()},d.prototype.toString=function(e){if((e=null!=e?e:10)<2||36<e)throw RangeError("radix out of range: "+e.toString());if(this.isZero())return"0";var t,r,n;if(this.isNegative())return this.equals(d.MIN_VALUE)?(t=d.fromNumber(e),n=(r=this.div(t)).multiply(t).subtract(this),r.toString(e)+n.toInt().toString(e)):"-"+this.negate().toString(e);for(var o=d.fromNumber(Math.pow(e,6)),i=(n=this,"");;){var u=n.div(o),a=(n.subtract(u.multiply(o)).toInt()>>>0).toString(e);if((n=u).isZero())return a+i;for(;a.length<6;)a="0"+a;i=""+a+i}},d.prototype.valueOf=function(){return this.toBigInt()},d.prototype.getHighBits=function(){return this.high},d.prototype.getLowBits=function(){return this.low},d.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.equals(d.MIN_VALUE)?64:this.negate().getNumBitsAbs();for(var e=0!==this.high?this.high:this.low,t=0,t=31;0<t&&0==(e&1<<t);t--);return 0!==this.high?t+33:t+1},d.prototype.isZero=function(){return 0===this.high&&0===this.low},d.prototype.isNegative=function(){return this.high<0},d.prototype.isPositive=function(){return 0<=this.high},d.prototype.isOdd=function(){return 1==(1&this.low)},d.prototype.isEven=function(){return 0==(1&this.low)},d.prototype.equals=function(e){e=d.fromValue(e);return this.high===e.high&&this.low===e.low},d.prototype.notEquals=function(e){return!this.equals(e)},d.prototype.lessThan=function(e){return this.compare(e)<0},d.prototype.lessThanOrEqual=function(e){return this.compare(e)<=0},d.prototype.greaterThan=function(e){return 0<this.compare(e)},d.prototype.greaterThanOrEqual=function(e){return 0<=this.compare(e)},d.prototype.compare=function(e){var t,r,e=d.fromValue(e);return this.equals(e)?0:(t=this.isNegative(),r=e.isNegative(),t&&!r||(t||!r)&&this.subtract(e).isNegative()?-1:1)},d.prototype.negate=function(){return this.equals(d.MIN_VALUE)?d.MIN_VALUE:this.not().add(d.ONE)},d.prototype.add=function(e){var e=d.fromValue(e),t=this.high>>>16,r=65535&this.high,n=this.low>>>16,o=65535&this.low,i=e.high>>>16,u=0,a=0,s=0,c=0;return a+=(s=s+((c+=o+(65535&e.low))>>>16)+(n+(e.low>>>16)))>>>16,d.fromBits((s&=65535)<<16|(c&=65535),((u+=(a+=r+(65535&e.high))>>>16)+(t+i)&65535)<<16|(a&=65535))},d.prototype.subtract=function(e){e=d.fromValue(e);return this.add(e.negate())},d.prototype.multiply=function(e){var t,r,n,o,i,u,a,s,c,l,f;return this.isZero()||(e=d.fromValue(e)).isZero()?d.ZERO:this.equals(d.MIN_VALUE)?e.isOdd()?d.MIN_VALUE:d.ZERO:e.equals(d.MIN_VALUE)?this.isOdd()?d.MIN_VALUE:d.ZERO:this.isNegative()?e.isNegative()?this.negate().multiply(e.negate()):this.negate().multiply(e).negate():e.isNegative()?this.multiply(e.negate()).negate():this.lessThan(le)&&e.lessThan(le)?d.fromNumber(this.toNumber()*e.toNumber()):(t=this.high>>>16,r=65535&this.high,n=this.low>>>16,o=65535&this.low,i=e.high>>>16,u=65535&e.high,a=e.low>>>16,f=(f=l=c=s=0)+((c=c+((l+=o*(e=65535&e.low))>>>16)+n*e)>>>16)+((c=(c&65535)+o*a)>>>16),d.fromBits((c&=65535)<<16|(l&=65535),(s=(s=(s+=(f+=r*e)>>>16)+((f=(f&65535)+n*a)>>>16)+((f=(f&65535)+o*u)>>>16))+(t*e+r*a+n*u+o*i)&65535)<<16|(f&=65535)))},d.prototype.div=function(e){var t,r,n,o=d.fromValue(e);if(o.isZero())throw(0,ue.newError)("division by zero");if(this.isZero())return d.ZERO;if(this.equals(d.MIN_VALUE))return o.equals(d.ONE)||o.equals(d.NEG_ONE)?d.MIN_VALUE:o.equals(d.MIN_VALUE)?d.ONE:(n=this.shiftRight(1).div(o).shiftLeft(1)).equals(d.ZERO)?o.isNegative()?d.ONE:d.NEG_ONE:(t=this.subtract(o.multiply(n)),n.add(t.div(o)));if(o.equals(d.MIN_VALUE))return d.ZERO;if(this.isNegative())return o.isNegative()?this.negate().div(o.negate()):this.negate().div(o).negate();if(o.isNegative())return this.div(o.negate()).negate();for(r=d.ZERO,t=this;t.greaterThanOrEqual(o);){n=Math.max(1,Math.floor(t.toNumber()/o.toNumber()));for(var i=Math.ceil(Math.log(n)/Math.LN2),u=i<=48?1:Math.pow(2,i-48),a=d.fromNumber(n),s=a.multiply(o);s.isNegative()||s.greaterThan(t);)s=(a=d.fromNumber(n-=u)).multiply(o);a.isZero()&&(a=d.ONE),r=r.add(a),t=t.subtract(s)}return r},d.prototype.modulo=function(e){e=d.fromValue(e);return this.subtract(this.div(e).multiply(e))},d.prototype.not=function(){return d.fromBits(~this.low,~this.high)},d.prototype.and=function(e){e=d.fromValue(e);return d.fromBits(this.low&e.low,this.high&e.high)},d.prototype.or=function(e){e=d.fromValue(e);return d.fromBits(this.low|e.low,this.high|e.high)},d.prototype.xor=function(e){e=d.fromValue(e);return d.fromBits(this.low^e.low,this.high^e.high)},d.prototype.shiftLeft=function(e){e=d.toNumber(e);return 0==(e&=63)?d.ZERO:e<32?d.fromBits(this.low<<e,this.high<<e|this.low>>>32-e):d.fromBits(0,this.low<<e-32)},d.prototype.shiftRight=function(e){var t=d.toNumber(e),e=d.toNumber(e);return 0==(t&=63)?d.ZERO:e<32?d.fromBits(this.low>>>t|this.high<<32-t,this.high>>t):d.fromBits(this.high>>t-32,0<=this.high?0:-1)},d.isInteger=function(e){return!0===(null==e?void 0:e.__isInteger__)},d.fromInt=function(e){var t;return-128<=(e|=0)&&e<128&&null!=(t=ae.get(e))||(t=new d(e,e<0?-1:0),-128<=e&&e<128&&ae.set(e,t)),t},d.fromBits=function(e,t){return new d(e,t)},d.fromNumber=function(e){return isNaN(e)||!isFinite(e)?d.ZERO:e<=-ce?d.MIN_VALUE:ce<=e+1?d.MAX_VALUE:e<0?d.fromNumber(-e).negate():new d(e%se|0,e/se|0)},d.fromString=function(e,t,r){var n=(void 0===r?{}:r).strictStringValidation;if(0===e.length)throw(0,ue.newError)("number format error: empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return d.ZERO;if((t=null!=t?t:10)<2||36<t)throw(0,ue.newError)("radix out of range: "+t.toString());if(0<(r=e.indexOf("-")))throw(0,ue.newError)('number format error: interior "-" character: '+e);if(0===r)return d.fromString(e.substring(1),t).negate();for(var o,i,u=d.fromNumber(Math.pow(t,8)),a=d.ZERO,s=0;s<e.length;s+=8){var c,l=Math.min(8,e.length-s),f=e.substring(s,s+l),p=parseInt(f,t);if(!0===n&&(o=f,c=p,i=t,Number.isNaN(o)||Number.isNaN(c)||((e,t,r)=>(e=e.toString(t),t=Math.max(r-e.length,0),r="0".repeat(t),"".concat(r).concat(e)))(c,i,o.length)!==o.toLowerCase()))throw(0,ue.newError)('number format error: "'.concat(f,'" is NaN in radix ').concat(t,": ").concat(e));a=(l<8?(c=d.fromNumber(Math.pow(t,l)),a.multiply(c)):a=a.multiply(u)).add(d.fromNumber(p))}return a},d.fromValue=function(e,t){return void 0===t&&(t={}),e instanceof d?e:"number"==typeof e?(!0===t.ceilFloat&&(e=Math.ceil(e)),d.fromNumber(e)):"string"==typeof e?d.fromString(e,void 0,t):"bigint"==typeof e?d.fromString(e.toString()):new d(e.low,e.high)},d.toNumber=function(e){switch(typeof e){case"number":return e;case"bigint":return Number(e);default:return d.fromValue(e).toNumber()}},d.toString=function(e,t){return d.fromValue(e).toString(t)},d.inSafeRange=function(e){return d.fromValue(e).inSafeRange()},d.ZERO=d.fromInt(0),d.ONE=d.fromInt(1),d.NEG_ONE=d.fromInt(-1),d.MAX_VALUE=d.fromBits(-1,2147483647),d.MIN_VALUE=d.fromBits(0,-2147483648),d.MIN_SAFE_VALUE=d.fromBits(1,-2097152),d.MAX_SAFE_VALUE=d.fromBits(-1,2097151),d.__isInteger__=!0,d);function d(e,t){this.low=null!=e?e:0,this.high=null!=t?t:0}Object.defineProperty(o.prototype,"__isInteger__",{value:!0,enumerable:!1,configurable:!1});var se=4294967296,ce=se*se/2,le=o.fromInt(1<<24),u=o.fromValue,u=(i.int=u,o.isInteger),u=(i.isInt=u,o.inSafeRange),u=(i.inSafeRange=u,o.toNumber),u=(i.toNumber=u,o.toString),u=(i.toString=u,i.default=o,{}),o={},a={},fe={},pe={},de=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},he=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},be=(Object.defineProperty(pe,"__esModule",{value:!0}),pe.nameConventions=pe.StandardCase=void 0,pe.StandardCase={SnakeCase:"snake_case",KebabCase:"kebab-case",ScreamingSnakeCase:"SCREAMING_SNAKE_CASE",PascalCase:"PascalCase",CamelCase:"camelCase"},pe.nameConventions={snake_case:{tokenize:function(e){return e.split("_")},encode:function(e){return e.join("_")}},"kebab-case":{tokenize:function(e){return e.split("-")},encode:function(e){return e.join("-")}},PascalCase:{tokenize:function(e){return e.split(/(?=[A-Z])/).map(function(e){return e.toLowerCase()})},encode:function(e){var t,r,n="";try{for(var o=de(e),i=o.next();!i.done;i=o.next()){var u=i.value;n+=u=u.charAt(0).toUpperCase()+u.slice(1)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return n}},camelCase:{tokenize:function(e){return e.split(/(?=[A-Z])/).map(function(e){return e.toLowerCase()})},encode:function(e){var t,r,n="";try{for(var o=de(e.entries()),i=o.next();!i.done;i=o.next()){var u=he(i.value,2),a=u[0],s=u[1];n+=s=0!==a?s.charAt(0).toUpperCase()+s.slice(1):s}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return n}},SCREAMING_SNAKE_CASE:{tokenize:function(e){return e.split("_").map(function(e){return e.toLowerCase()})},encode:function(e){return e.join("_").toUpperCase()}}},fe),ye=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},_e=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},ve=(Object.defineProperty(be,"__esModule",{value:!0}),be.RecordObjectMapping=be.defaultNameMapping=be.rulesRegistry=void 0,be.as=function(e,t,r){var n,o,i,u,a="function"==typeof t?t:Object,s=we(t,r),c=[],l=new a;try{for(var f=ye(Object.entries(null!=s?s:{})),p=f.next();!p.done;p=f.next()){var d=_e(p.value,2),h=d[0],b=d[1];c.push(h),ge(e,l,h,b)}}catch(e){n={error:e}}finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(n)throw n.error}}try{for(var y=ye(Object.getOwnPropertyNames(l)),_=y.next();!_.done;_=y.next()){h=_.value;c.includes(h)||ge(e,l,h,null==s?void 0:s[h])}}catch(e){i={error:e}}finally{try{_&&!_.done&&(u=y.return)&&u.call(y)}finally{if(i)throw i.error}}return l},be.valueAs=Oe,be.optionalParameterConversion=function(e,t){return(!0!==t.optional||null!=e)&&null!=e&&null!=t.parameterConversion?t.parameterConversion(e):e},be.validateAndCleanParameters=function(e,t){var r={},n=we(Object.getPrototypeOf(e).constructor,t);{if(null==n)return e;for(var o in n){var i=e[o],u=null!=(u=n[o].from)?u:(0,be.defaultNameMapping)(o);if(null==(i=null!=i&&null!=n[o].parameterConversion?n[o].parameterConversion(i):i)){if(!0!==n[o].optional)throw(0,ve.newError)("Mapped Parameter object did not include required parameter with key ".concat(o,", \n check provided parameters and parameter rules."))}else null!=n[o].validate&&n[o].validate(i,o);r[u]=i}return r}},be.getRules=we,t),me=pe;function ge(e,t,r,n){var o,i,u=(0,be.defaultNameMapping)(r);try{i=e.get(null!=(o=null==n?void 0:n.from)?o:u)}catch(e){if(!0===(null==n?void 0:n.optional)&&e instanceof ve.Neo4jError)return;throw e}e="".concat(t.constructor.name,"#").concat(r);t[r]=Oe(i,e,n)}function Oe(e,t,r){return(!0!==(null==r?void 0:r.optional)||null!=e)&&("function"==typeof(null==r?void 0:r.validate)&&r.validate(e,t),null!=(null==r?void 0:r.convert))?r.convert(e,t):e}function we(e,t){t="object"==typeof e?e:t;return null!=t?t:"object"!=typeof e?be.rulesRegistry[e.name]:void 0}be.rulesRegistry={},be.defaultNameMapping=function(e){return e},be.RecordObjectMapping=Object.freeze({clearMappingRegistry:function(){be.rulesRegistry={}},getCaseTranslator:function(t,r){var e=Object.keys(me.nameConventions);if(!e.includes(t))throw(0,ve.newError)("Naming convention ".concat(t," is not recognized, \n please provide a recognized name convention or manually provide a translation function."));if(e.includes(r))return function(e){return me.nameConventions[t].encode(me.nameConventions[r].tokenize(e))};throw(0,ve.newError)("Naming convention ".concat(r," is not recognized, \n please provide a recognized name convention or manually provide a translation function."))},register:function(e,t){be.rulesRegistry[e.name]=t},translateIdentifiers:function(e){be.defaultNameMapping=e}});var s,Ee,Pe,Te,c,Se,je,Ce,Ie,Re=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ae=(Object.defineProperty(a,"__esModule",{value:!0}),a.ENCRYPTION_OFF=a.ENCRYPTION_ON=void 0,a.isEmptyObjectOrNull=function(e){if(null!==e){if(!xe(e))return!1;for(var t in e)if(void 0!==e[t])return!1}return!0},a.isObject=xe,a.isString=Ue,a.assertObject=function(e,t){if(xe(e))return e;throw new TypeError(t+" expected to be an object but was: "+(0,Me.stringify)(e))},a.assertString=De,a.assertNumber=function(e,t){if("number"==typeof e)return e;throw new TypeError(t+" expected to be a number but was: "+(0,Me.stringify)(e))},a.assertNumberOrInteger=function(e,t){if("number"==typeof e||"bigint"==typeof e||(0,Ae.isInt)(e))return e;throw new TypeError(t+" expected to be either a number or an Integer object but was: "+(0,Me.stringify)(e))},a.assertValidDate=function(e,t){if("[object Date]"!==Object.prototype.toString.call(e))throw new TypeError(t+" expected to be a standard JavaScript Date but was: "+(0,Me.stringify)(e));if(Number.isNaN(e.getTime()))throw new TypeError(t+" expected to be valid JavaScript Date but its time was NaN: "+(0,Me.stringify)(e));return e},a.validateQueryAndParameters=function(e,t,r){var n="",t=null!=t?t:{},o=null==r?void 0:r.parameterRules,i=null!=(i=null==r?void 0:r.skipAsserts)&&i;if("string"==typeof e)n=e;else if(e instanceof String)n=e.toString();else if("object"==typeof e&&null!=e.text){if(!i&&null!=(null==r?void 0:r.parameterRules))throw(0,ke.newError)("When using a Query object, parameterRules should be present in the object and not in a separate argument.");n=e.text,t=null!=(r=e.parameters)?r:{},o=e.parameterRules}i||(t=(0,Ne.validateAndCleanParameters)(t,o),(e=>{if(De(e,"Cypher query"),0===e.trim().length)throw new TypeError("Cypher query is expected to be a non-empty string.")})(n),(e=>{var t;if(!xe(e))throw t=null!=e.constructor?" "+e.constructor.name:"",new TypeError("Query parameters are expected to either be undefined/null or an object, given:".concat(t," ").concat(JSON.stringify(e)))})(t));return{validatedQuery:n,params:t}},a.equals=function e(t,r){var n,o;if(t===r)return!0;if(null===t||null===r)return!1;if("object"==typeof t&&"object"==typeof r){var i=Object.keys(t),u=Object.keys(r);if(i.length!==u.length)return!1;try{for(var a=Re(i),s=a.next();!s.done;s=a.next()){var c=s.value;if(!e(t[c],r[c]))return!1}}catch(e){n={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}return!0}return!1},i),Me=F,Ne=fe,ke=t;a.ENCRYPTION_ON="ENCRYPTION_ON";function xe(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}function De(e,t){if(Ue(e))return e;throw new TypeError((0,Me.stringify)(t)+" expected to be string but was: "+(0,Me.stringify)(e))}function Ue(e){return"[object String]"===Object.prototype.toString.call(e)}function Le(e,t){this._minNumber=e,this._maxNumber=t,this._minInteger=(0,c.int)(e),this._maxInteger=(0,c.int)(t)}function Fe(e){return(0,c.int)(e).div(12)}function Be(e){return(0,c.int)(e).modulo(12)}function Ve(e,t){return(0,c.int)(t).greaterThan(0)&&(0,c.int)(e).lessThan(0)&&(e=(0,c.int)(e).add(1)),(0,c.int)(e).div(s.SECONDS_PER_HOUR)}function qe(e,t){(0,c.int)(t).greaterThan(0)&&(0,c.int)(e).lessThan(0)&&(e=(0,c.int)(e).add(1));t=(0,c.int)(e).div(s.SECONDS_PER_MINUTE),e=t.isNegative();return Ye(t=e?t.negate():t,s.MINUTES_PER_HOUR).multiply(e?-1:1)}function We(e,t,r){e=(0,c.int)(e),t=(0,c.int)(t),r=(0,c.int)(r);var n=e.multiply(365);return n=(n=(n=e.greaterThanOrEqual(0)?n.add(e.add(3).div(4).subtract(e.add(99).div(100)).add(e.add(399).div(400))):n.subtract(e.div(-4).subtract(e.div(-100)).add(e.div(-400)))).add(t.multiply(367).subtract(362).div(12))).add(r.subtract(1)),t.greaterThan(2)&&(n=n.subtract(1),(e=>{if((e=(0,c.int)(e)).modulo(4).equals(0)){if(e.modulo(100).equals(0))return!!e.modulo(400).equals(0);return 1}})(e)||(n=n.subtract(1))),n.subtract(s.DAYS_0000_TO_1970)}function ze(e,t){return 1===e?t%400==0||t%4==0&&t%100!=0?29:28:[0,2,4,6,7,9,11].includes(e)?31:30}function He(e,t,r){if((0,je.assertNumberOrInteger)(e,r),t.contains(e))return e;throw(0,Se.newError)("".concat(r," is expected to be in range ").concat(t.toString()," but was: ").concat(e.toString()))}function Ge(e,t){e=(0,c.int)(e),t=(0,c.int)(t);var r=e.div(t);return r=e.isPositive()!==t.isPositive()&&r.multiply(t).notEquals(e)?r.subtract(1):r}function Ye(e,t){return e=(0,c.int)(e),t=(0,c.int)(t),e.subtract(Ge(e,t).multiply(t))}function Ke(e){return(e=(0,c.int)(e)).equals(0)?"":"."+Ze(e,9)}function Ze(e,t,r){var n=(e=(0,c.int)(e)).isNegative(),o=(e=n?e.negate():e).toString();if(null!=t)for(;o.length<t;)o="0"+o;return n?"-"+o:!0===(null==r?void 0:r.usePositiveSign)?"+"+o:o}a.ENCRYPTION_OFF="ENCRYPTION_OFF",s=o,Pe=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),Te=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=r&&r.__importStar||(Ee=function(e){return(Ee=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=Ee(e),n=0;n<r.length;n++)"default"!==r[n]&&Pe(t,e,r[n]);return Te(t,e),t}),Object.defineProperty(s,"__esModule",{value:!0}),s.SECONDS_PER_DAY=s.DAYS_PER_400_YEAR_CYCLE=s.DAYS_0000_TO_1970=s.NANOS_PER_HOUR=s.NANOS_PER_MINUTE=s.NANOS_PER_MILLISECOND=s.NANOS_PER_SECOND=s.SECONDS_PER_HOUR=s.SECONDS_PER_MINUTE=s.MINUTES_PER_HOUR=s.NANOSECOND_OF_SECOND_RANGE=s.SECOND_OF_MINUTE_RANGE=s.MINUTE_OF_HOUR_RANGE=s.HOUR_OF_DAY_RANGE=s.DAY_OF_MONTH_RANGE=s.MONTH_OF_YEAR_RANGE=s.YEAR_RANGE=void 0,s.normalizeYearsForDuration=Fe,s.normalizeMonthsForDuration=Be,s.normalizeHoursForDuration=Ve,s.normalizeMinutesForDuration=qe,s.normalizeSecondsForDuration=function(e,t){return(0,c.int)(e).add(Ge(t,s.NANOS_PER_SECOND))},s.normalizeNanosecondsForDuration=function(e){return Ye(e,s.NANOS_PER_SECOND)},s.localTimeToNanoOfDay=function(e,t,r,n){e=(0,c.int)(e),t=(0,c.int)(t),r=(0,c.int)(r),n=(0,c.int)(n);e=e.multiply(s.NANOS_PER_HOUR);return(e=(e=e.add(t.multiply(s.NANOS_PER_MINUTE))).add(r.multiply(s.NANOS_PER_SECOND))).add(n)},s.localDateTimeToEpochSecond=function(e,t,r,n,o,i,u){e=We(e,t,r),t=((e,t,r)=>(e=(0,c.int)(e),t=(0,c.int)(t),r=(0,c.int)(r),(e=(e=e.multiply(s.SECONDS_PER_HOUR)).add(t.multiply(s.SECONDS_PER_MINUTE))).add(r)))(n,o,i);return e.multiply(s.SECONDS_PER_DAY).add(t)},s.dateToEpochDay=We,s.durationToIsoString=function(e,t,r,n){if((0,c.int)(e).equals(0)&&(0,c.int)(t).equals(0)&&(0,c.int)(r).equals(0)&&(0,c.int)(n).equals(0))return"PT0S";var o=Ze(Fe(e)),e=Ze(Be(e)),t=Ze(t),i=Ze(Ve(r,n)),u=Ze(qe(r,n)),r=((e,t)=>{e=(0,c.int)(e),t=(0,c.int)(t);var r,n=e.isNegative(),o=t.greaterThan(0);return e=n&&o?(e=e.add(1).negate().modulo(60).negate()).equals(0)?"-0":e.toString():e.modulo(60).toString(),null!=(r=o?Ke((n?t.negate().add(2*s.NANOS_PER_SECOND):t.add(s.NANOS_PER_SECOND)).modulo(s.NANOS_PER_SECOND)):r)?e+r:e})(r,n);return"P".concat("0"!==o?o+"Y":"")+"".concat("0"!==e?e+"M":"")+"".concat("0"!==t?t+"D":"","T")+"".concat("0"!==i?i+"H":"")+"".concat("0"!==u?u+"M":"")+"".concat("0"!==r?r+"S":"")},s.timeToIsoString=function(e,t,r,n){e=Ze(e,2),t=Ze(t,2),r=Ze(r,2),n=Ke(n);return"".concat(e,":").concat(t,":").concat(r).concat(n)},s.timeZoneOffsetToIsoString=function(e){if((e=(0,c.int)(e)).equals(0))return"Z";var t=e.isNegative();t&&(e=e.multiply(-1));var t=t?"-":"+",r=Ze(e.div(s.SECONDS_PER_HOUR),2),n=Ze(e.div(s.SECONDS_PER_MINUTE).modulo(s.MINUTES_PER_HOUR),2),e=e.modulo(s.SECONDS_PER_MINUTE),e=e.equals(0)?null:Ze(e,2);return null!=e?"".concat(t).concat(r,":").concat(n,":").concat(e):"".concat(t).concat(r,":").concat(n)},s.dateToIsoString=function(e,t,r){e=(e=>(e=(0,c.int)(e)).isNegative()||e.greaterThan(9999)?Ze(e,6,{usePositiveSign:!0}):Ze(e,4))(e),t=Ze(t,2),r=Ze(r,2);return"".concat(e,"-").concat(t,"-").concat(r)},s.isoStringToStandardDate=function(e){return new Date(e)},s.toStandardDate=function(e){return new Date(e)},s.newDate=function(e){return new Date(e)},s.totalNanoseconds=function(e,t){t=null!=t?t:0;e=e.getMilliseconds()*s.NANOS_PER_MILLISECOND;return((e,t)=>e instanceof c.default?e.add(t):"bigint"==typeof e?e+BigInt(t):e+t)(t,e)},s.timeZoneOffsetInSeconds=function(e){var t=e.getSeconds()-e.getUTCSeconds(),r=e.getMinutes()-e.getUTCMinutes(),n=e.getHours()-e.getUTCHours(),e=(e=>e.getMonth()===e.getUTCMonth()?e.getDate()-e.getUTCDate():e.getFullYear()>e.getUTCFullYear()||e.getMonth()>e.getUTCMonth()&&e.getFullYear()===e.getUTCFullYear()?e.getDate()+ze(e.getUTCMonth(),e.getUTCFullYear())-e.getUTCDate():e.getDate()-(e.getUTCDate()+ze(e.getMonth(),e.getFullYear())))(e);return n*s.SECONDS_PER_HOUR+r*s.SECONDS_PER_MINUTE+t+e*s.SECONDS_PER_DAY},s.assertValidYear=function(e){return He(e,s.YEAR_RANGE,"Year")},s.assertValidMonth=function(e){return He(e,s.MONTH_OF_YEAR_RANGE,"Month")},s.assertValidDay=function(e){return He(e,s.DAY_OF_MONTH_RANGE,"Day")},s.assertValidHour=function(e){return He(e,s.HOUR_OF_DAY_RANGE,"Hour")},s.assertValidMinute=function(e){return He(e,s.MINUTE_OF_HOUR_RANGE,"Minute")},s.assertValidSecond=function(e){return He(e,s.SECOND_OF_MINUTE_RANGE,"Second")},s.assertValidNanosecond=function(e){return He(e,s.NANOSECOND_OF_SECOND_RANGE,"Nanosecond")},s.assertValidZoneId=function(t,r){var e=Ce.get(r);if(!0!==e){if(!1===e)throw Ie(r,t);try{Intl.DateTimeFormat(void 0,{timeZone:r}),Ce.set(r,!0)}catch(e){throw Ce.set(r,!1),Ie(r,t)}}},s.floorDiv=Ge,s.floorMod=Ye,c=l(i),Se=t,je=a,Le.prototype.contains=function(e){var t;return(0,c.isInt)(e)&&e instanceof c.default?e.greaterThanOrEqual(this._minInteger)&&e.lessThanOrEqual(this._maxInteger):"bigint"==typeof e?(t=(0,c.int)(e)).greaterThanOrEqual(this._minInteger)&&t.lessThanOrEqual(this._maxInteger):e>=this._minNumber&&e<=this._maxNumber},Le.prototype.toString=function(){return"[".concat(this._minNumber,", ").concat(this._maxNumber,"]")},l=Le,s.YEAR_RANGE=new l(-999999999,999999999),s.MONTH_OF_YEAR_RANGE=new l(1,12),s.DAY_OF_MONTH_RANGE=new l(1,31),s.HOUR_OF_DAY_RANGE=new l(0,23),s.MINUTE_OF_HOUR_RANGE=new l(0,59),s.SECOND_OF_MINUTE_RANGE=new l(0,59),s.NANOSECOND_OF_SECOND_RANGE=new l(0,999999999),s.MINUTES_PER_HOUR=60,s.SECONDS_PER_MINUTE=60,s.SECONDS_PER_HOUR=s.SECONDS_PER_MINUTE*s.MINUTES_PER_HOUR,s.NANOS_PER_SECOND=1e9,s.NANOS_PER_MILLISECOND=1e6,s.NANOS_PER_MINUTE=s.NANOS_PER_SECOND*s.SECONDS_PER_MINUTE,s.NANOS_PER_HOUR=s.NANOS_PER_MINUTE*s.MINUTES_PER_HOUR,s.DAYS_0000_TO_1970=719528,s.DAYS_PER_400_YEAR_CYCLE=146097,s.SECONDS_PER_DAY=86400,Ce=new Map,Ie=function(e,t){return(0,Se.newError)("".concat(t,' is expected to be a valid ZoneId but was: "').concat(e,'"'))};var Qe,Xe=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),Je=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=r&&r.__importStar||(Qe=function(e){return(Qe=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=Qe(e),n=0;n<r.length;n++)"default"!==r[n]&&Xe(t,e,r[n]);return Je(t,e),t}),$e=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},f=(Object.defineProperty(u,"__esModule",{value:!0}),u.DateTime=u.LocalDateTime=u.Date=u.Time=u.LocalTime=u.Duration=void 0,u.isDuration=function(e){return bt(e,nt)},u.isLocalTime=function(e){return bt(e,ot)},u.isTime=function(e){return bt(e,it)},u.isDate=function(e){return bt(e,ut)},u.isLocalDateTime=function(e){return bt(e,at)},u.isDateTime=function(e){return bt(e,st)},l(o)),et=a,tt=t,rt=l(i),l={value:!0,enumerable:!1,configurable:!1,writable:!1},nt="__isDuration__",ot="__isLocalTime__",it="__isTime__",ut="__isDate__",at="__isLocalDateTime__",st="__isDateTime__",p=(ct.fromString=function(e){if("T"===e.slice(-1).toUpperCase())throw(0,tt.newError)("Duration string '".concat(e,"' ends with 'T', time delimiter must be excluded if Duration contains no time components"));var t=String(e.replace(/,/g,".")).match(new RegExp(/^([-|+]?)[P|p](?:(-?\d*\.?\d*)[Y|y])?(?:(-?\d*\.?\d*)[M|m])?(?:(-?\d*\.?\d*)[W|w])?(?:(-?\d*\.?\d*)[D|d])?/.source+/([T|t](?:(-?\d*\.?\d*)[H|h])?(?:(-?\d*\.?\d*)[M|m])?(?:(-)?(\d*)(\.\d*)?[S|s])?)?$/.source));if(null===t)throw(0,tt.newError)("Duration could not be parsed from string: ".concat(e));if(null==t[2]&&null==t[3]&&null==t[4]&&null==t[5]&&null==t[7]&&null==t[8]&&null==t[10]&&null==t[11])throw(0,tt.newError)("Duration could not be parsed from string: ".concat(e));var e="-"===t[1]?-1:1,r=e*vt(t[2],"Years")*12+vt(t[3],"Months"),n=e*vt(t[4],"Weeks")*7+vt(t[5],"Days"),o=3600*vt(t[7],"Hours")+60*vt(t[8],"Minutes"),i=mt((null!=(i=t[9])?i:"")+(null!=(i=t[10])?i:"0")),u=e*(t=(null!=(u=t[9])?u:"")+"0"+(null!=(u=t[11])?u:""),Math.round(vt(t,"nanoseconds")*Math.pow(10,9)));return Ot(r,"Months"),Ot(n,"Days"),Ot(o,"Seconds"),Ot(u,"Nanoseconds"),new ct((0,rt.int)(r),(0,rt.int)(n),(0,rt.int)(BigInt(e)*(BigInt(o)+i.toBigInt())),(0,rt.int)(u))},ct.prototype.toString=function(){return f.durationToIsoString(this.months,this.days,this.seconds,this.nanoseconds)},ct);function ct(e,t,r,n){this.months=(0,et.assertNumberOrInteger)(e,"Months"),this.days=(0,et.assertNumberOrInteger)(t,"Days"),(0,et.assertNumberOrInteger)(r,"Seconds"),(0,et.assertNumberOrInteger)(n,"Nanoseconds"),this.seconds=f.normalizeSecondsForDuration(r,n),"number"==typeof r&&(0,rt.isInt)(this.seconds)&&(this.seconds=this.seconds.toNumber()),"bigint"==typeof r&&(0,rt.isInt)(this.seconds)&&(this.seconds=this.seconds.toBigInt()),this.nanoseconds=f.normalizeNanosecondsForDuration(n),"number"==typeof n&&(0,rt.isInt)(this.nanoseconds)&&(this.nanoseconds=this.nanoseconds.toNumber()),"bigint"==typeof n&&(0,rt.isInt)(this.nanoseconds)&&(this.nanoseconds=this.nanoseconds.toBigInt()),Object.freeze(this)}u.Duration=p,Object.defineProperty(p.prototype,nt,l);lt.fromStandardDate=function(e,t){_t(e,t);t=f.totalNanoseconds(e,t);return new lt(e.getHours(),e.getMinutes(),e.getSeconds(),t instanceof rt.default?t.toInt():"bigint"==typeof t?(0,rt.int)(t).toInt():t)},lt.prototype.toString=function(){return f.timeToIsoString(this.hour,this.minute,this.second,this.nanosecond)},lt.fromString=function(e){e=String(e.replace(/,/g,".")).match(/^[T|t]?(\d{2})(?::?(\d{2}))?(?::?(\d{2}))?(\.\d+)?$/);if(null===e)throw(0,tt.newError)("LocalTime could not be parsed from string");e=$e(gt(e[1],e[2],e[3],e[4]),4);return new lt(e[0],e[1],e[2],e[3])};p=lt;function lt(e,t,r,n){this.hour=f.assertValidHour(e),this.minute=f.assertValidMinute(t),this.second=f.assertValidSecond(r),this.nanosecond=f.assertValidNanosecond(n),Object.freeze(this)}u.LocalTime=p,Object.defineProperty(p.prototype,ot,l);ft.fromStandardDate=function(e,t){return _t(e,t),new ft(e.getHours(),e.getMinutes(),e.getSeconds(),(0,rt.toNumber)(f.totalNanoseconds(e,t)),f.timeZoneOffsetInSeconds(e))},ft.prototype.toString=function(){return f.timeToIsoString(this.hour,this.minute,this.second,this.nanosecond)+f.timeZoneOffsetToIsoString(this.timeZoneOffsetSeconds)},ft.fromString=function(e){e=String(e.replace(/,/g,".")).match(/^[T|t]?(\d{2})(?::?(\d{2}))?(?::?(\d{2}))?(\.\d+)?([Z|z]$|\+|-)(\d{2})?(?::?(\d{2}))?(?::?(\d{2}))?$/);if(null===e)throw(0,tt.newError)("Time could not be parsed from string");var t=$e(gt(e[1],e[2],e[3],e[4]),4),r=t[0],n=t[1],o=t[2],t=t[3];if("Z"===e[5])return new ft(r,n,o,t,(0,rt.int)(0));if(null==e[6])throw(0,tt.newError)("Error parsing timezone offset.");return new ft(r,n,o,t,(0,rt.int)(("+"===e[5]?1:-1)*(3600*mt(e[6]).toInt()+60*mt(e[7]).toInt()+mt(e[8]).toInt())))};p=ft;function ft(e,t,r,n,o){this.hour=f.assertValidHour(e),this.minute=f.assertValidMinute(t),this.second=f.assertValidSecond(r),this.nanosecond=f.assertValidNanosecond(n),this.timeZoneOffsetSeconds=(0,et.assertNumberOrInteger)(o,"Time zone offset in seconds"),Object.freeze(this)}u.Time=p,Object.defineProperty(p.prototype,it,l);pt.fromStandardDate=function(e){return this.fromStandardDateLocal(e)},pt.fromStandardDateLocal=function(e){return _t(e),new pt(e.getFullYear(),e.getMonth()+1,e.getDate())},pt.fromStandardDateUTC=function(e){return _t(e),new pt(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate())},pt.prototype.toStandardDate=function(){return f.isoStringToStandardDate(this.toString())},pt.prototype.toString=function(){return f.dateToIsoString(this.year,this.month,this.day)},pt.fromString=function(e){e=String(e.replace(/,/g,".")).match(/^([+|-]\d{5,}|\d{4})-(\d{2})-(\d{2})$/);if(null===e)throw(0,tt.newError)("Date could not be parsed from string. Expects date in format 'YYYY-MM-DD' or '[+|-]YYYYY-MM-DD'");return new pt(mt(e[1]),mt(e[2]),mt(e[3]))};p=pt;function pt(e,t,r){this.year=f.assertValidYear(e),this.month=f.assertValidMonth(t),this.day=f.assertValidDay(r),Object.freeze(this)}u.Date=p,Object.defineProperty(p.prototype,ut,l);dt.fromStandardDate=function(e,t){return _t(e,t),new dt(e.getFullYear(),e.getMonth()+1,e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),(0,rt.toNumber)(f.totalNanoseconds(e,t)))},dt.prototype.toStandardDate=function(){return f.isoStringToStandardDate(this.toString())},dt.prototype.toString=function(){return yt(this.year,this.month,this.day,this.hour,this.minute,this.second,this.nanosecond)},dt.fromString=function(e){e=String(e.replace(/,/g,".")).match(/^([+|-]\d{5,}|\d{4})-(\d{2})-(\d{2})[T|t](\d{2})(?::?(\d{2}))?(?::?(\d{2}))?(\.\d+)?$/);if(null===e)throw(0,tt.newError)("LocalDateTime could not be parsed from string");var t=$e(gt(e[4],e[5],e[6],e[7]),4),r=t[0],n=t[1],o=t[2],t=t[3];return new dt(mt(e[1]),mt(e[2]),mt(e[3]),r,n,o,t)};p=dt;function dt(e,t,r,n,o,i,u){this.year=f.assertValidYear(e),this.month=f.assertValidMonth(t),this.day=f.assertValidDay(r),this.hour=f.assertValidHour(n),this.minute=f.assertValidMinute(o),this.second=f.assertValidSecond(i),this.nanosecond=f.assertValidNanosecond(u),Object.freeze(this)}u.LocalDateTime=p,Object.defineProperty(p.prototype,at,l);ht.fromStandardDate=function(e,t){return _t(e,t),new ht(e.getFullYear(),e.getMonth()+1,e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),(0,rt.toNumber)(f.totalNanoseconds(e,t)),f.timeZoneOffsetInSeconds(e),null)},ht.prototype.toStandardDate=function(){return f.toStandardDate(this._toUTC())},ht.prototype.toString=function(){var e;return yt(this.year,this.month,this.day,this.hour,this.minute,this.second,this.nanosecond)+(null!=this.timeZoneOffsetSeconds?f.timeZoneOffsetToIsoString(null!=(e=this.timeZoneOffsetSeconds)?e:0):"")+(null!=this.timeZoneId?"[".concat(this.timeZoneId,"]"):"")},ht.fromString=function(e){e=String(e.replace(/,/g,".")).match(new RegExp(/^([+|-]\d{5,}|\d{4})-(\d{2})-(\d{2})[T|t](\d{2})(?::?(\d{2}))?(?::?(\d{2}))?(\.\d+)?/.source+/([Z|z]|\+|-)?(?:(\d{2})(?::?(\d{2}))?(?::?(\d{2}))?)?(?:\[([^\]]*)\])?$/.source));if(null===e)throw(0,tt.newError)("DateTime could not be parsed from string");var t=$e(gt(e[4],e[5],e[6],e[7]),4),r=t[0],n=t[1],o=t[2],t=t[3];if("Z"===e[8]){if(null!=e[9])throw(0,tt.newError)("DateTime could not be parsed from string, can not parse string with offset after Z");return new ht(mt(e[1]),mt(e[2]),mt(e[3]),r,n,o,t,(0,rt.int)(0),e[12])}if("+"===e[8]||"-"===e[8]){if(null==e[9])throw(0,tt.newError)("DateTime could not be parsed from string, could not parse an offset after ".concat(e[8]," sign."));return new ht(mt(e[1]),mt(e[2]),mt(e[3]),r,n,o,t,(0,rt.int)(("+"===e[8]?1:-1)*(3600*parseInt(e[9])+60*parseInt(e[10])+parseInt("0"+e[11]))),e[12])}if(void 0!==e[12])return new ht(mt(e[1]),mt(e[2]),mt(e[3]),r,n,o,t,void 0,e[12]);throw(0,tt.newError)("DateTime could not be parsed from string, provided string needs either timezoneId or offset")},ht.prototype._toUTC=function(){if(void 0===this.timeZoneOffsetSeconds)throw new Error("Requires DateTime created with time zone offset");var e=f.localDateTimeToEpochSecond(this.year,this.month,this.day,this.hour,this.minute,this.second,this.nanosecond).subtract(null!=(e=this.timeZoneOffsetSeconds)?e:0);return(0,rt.int)(e).multiply(1e3).add((0,rt.int)(this.nanosecond).div(1e6)).toNumber()};p=ht;function ht(e,t,r,n,o,i,u,a,s){this.year=f.assertValidYear(e),this.month=f.assertValidMonth(t),this.day=f.assertValidDay(r),this.hour=f.assertValidHour(n),this.minute=f.assertValidMinute(o),this.second=f.assertValidSecond(i),this.nanosecond=f.assertValidNanosecond(u);e=$e(((e,t)=>{var r,n=null!=e,o=null!=t&&""!==t;if(n||o)return r=[void 0,void 0],n&&((0,et.assertNumberOrInteger)(e,"Time zone offset in seconds"),r[0]=e),o&&((0,et.assertString)(t,"Time zone ID"),f.assertValidZoneId("Time zone ID",t),r[1]=t),r;throw(0,tt.newError)("Unable to create DateTime without either time zone offset or id. Please specify either of them. Given offset: ".concat(e," and id: ").concat(t))})(a,s),2),t=e[0],r=e[1];this.timeZoneOffsetSeconds=t,this.timeZoneId=null!=r?r:void 0,Object.freeze(this)}function bt(e,t){return null!=e&&!0===e[t]}function yt(e,t,r,n,o,i,u){return f.dateToIsoString(e,t,r)+"T"+f.timeToIsoString(n,o,i,u)}function _t(e,t){(0,et.assertValidDate)(e,"Standard date"),null!=t&&(0,et.assertNumberOrInteger)(t,"Nanosecond")}function vt(e,t){if(void 0===e||0===e.length)return 0;var r=parseFloat(e);if(isNaN(r))throw(0,tt.newError)("Failed to parse temporal field ".concat(t,". Got string: ").concat(e,"."));return r}function mt(e){return void 0===e||0===e.length?(0,rt.int)(0):(0,rt.int)(e)}function gt(e,t,r,n){var o,i,u,n=void 0!==n?parseFloat("0"+n):0,e=void 0===t||""===t?(o=mt(e),i=(0,rt.int)(60*n),u=(0,rt.int)(3600*n%60),(0,rt.int)(3600*n*Math.pow(10,9)%Math.pow(10,9))):void 0===r||""===r?(o=mt(e),i=mt(t),u=(0,rt.int)(60*n%60),(0,rt.int)(60*n*Math.pow(10,9)%Math.pow(10,9))):(o=mt(e),i=mt(t),u=mt(r),(0,rt.int)(n*Math.pow(10,9)));return[o,i,u,e]}function Ot(e,t){if(!Number.isInteger(e))throw(0,tt.newError)("Parsing Duration field: ".concat(t," resulted in a non-integer value. Bolt protocol can only send durations which can be simplified to integer values of months, days, seconds and nanoseconds."))}u.DateTime=p,Object.defineProperty(p.prototype,st,l);var p={},wt=(Object.defineProperty(p,"__esModule",{value:!0}),p.PathSegment=p.Path=p.UnboundRelationship=p.Relationship=p.Node=void 0,p.isNode=function(e){return It(e,Pt)},p.isRelationship=function(e){return It(e,Tt)},p.isUnboundRelationship=function(e){return It(e,St)},p.isPath=function(e){return It(e,jt)},p.isPathSegment=function(e){return It(e,Ct)},F),Et=fe,l={value:!0,enumerable:!1,configurable:!1,writable:!1},Pt="__isNode__",Tt="__isRelationship__",St="__isUnboundRelationship__",jt="__isPath__",Ct="__isPathSegment__";function It(e,t){return null!=e&&!0===e[t]}At.prototype.as=function(e,t){var r=this;return(0,Et.as)({get:function(e){return r.properties[e]}},e,t)},At.prototype.toString=function(){for(var e="("+this.elementId,t=0;t<this.labels.length;t++)e+=":"+this.labels[t];var r=Object.keys(this.properties);if(0<r.length){e+=" {";for(t=0;t<r.length;t++)0<t&&(e+=","),e+=r[t]+":"+(0,wt.stringify)(this.properties[r[t]]);e+="}"}return e+=")"};var Rt=At;function At(e,t,r,n){this.identity=e,this.labels=t,this.properties=r,this.elementId=Ut(n,function(){return e.toString()})}p.Node=Rt,Object.defineProperty(Rt.prototype,Pt,l);Nt.prototype.as=function(e,t){var r=this;return(0,Et.as)({get:function(e){return r.properties[e]}},e,t)},Nt.prototype.toString=function(){var e="("+this.startNodeElementId+")-[:"+this.type,t=Object.keys(this.properties);if(0<t.length){e+=" {";for(var r=0;r<t.length;r++)0<r&&(e+=","),e+=t[r]+":"+(0,wt.stringify)(this.properties[t[r]]);e+="}"}return e+="]->("+this.endNodeElementId+")"};var Mt=Nt;function Nt(e,t,r,n,o,i,u,a){this.identity=e,this.start=t,this.end=r,this.type=n,this.properties=o,this.elementId=Ut(i,function(){return e.toString()}),this.startNodeElementId=Ut(u,function(){return t.toString()}),this.endNodeElementId=Ut(a,function(){return r.toString()})}p.Relationship=Mt,Object.defineProperty(Mt.prototype,Tt,l);kt.prototype.bind=function(e,t){return new Mt(this.identity,e,t,this.type,this.properties,this.elementId)},kt.prototype.bindTo=function(e,t){return new Mt(this.identity,e.identity,t.identity,this.type,this.properties,this.elementId,e.elementId,t.elementId)},kt.prototype.as=function(e,t){var r=this;return(0,Et.as)({get:function(e){return r.properties[e]}},e,t)},kt.prototype.toString=function(){var e="-[:"+this.type,t=Object.keys(this.properties);if(0<t.length){e+=" {";for(var r=0;r<t.length;r++)0<r&&(e+=","),e+=t[r]+":"+(0,wt.stringify)(this.properties[t[r]]);e+="}"}return e+="]->"};Rt=kt;function kt(e,t,r,n){this.identity=e,this.type=t,this.properties=r,this.elementId=Ut(n,function(){return e.toString()})}p.UnboundRelationship=Rt,Object.defineProperty(Rt.prototype,St,l);function xt(e,t,r){this.start=e,this.relationship=t,this.end=r}p.PathSegment=xt,Object.defineProperty(xt.prototype,Ct,l);function Dt(e,t,r){this.start=e,this.end=t,this.segments=r,this.length=r.length}function Ut(e,t){return null==e?t():e}p.Path=Dt,Object.defineProperty(Dt.prototype,jt,l);var Rt={},Lt=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))s.label=t[1];else if(6===t[0]&&s.label<a[1])s.label=a[1],a=t;else{if(!(a&&s.label<a[2])){a[2]&&s.ops.pop(),s.trys.pop();continue}s.label=a[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Ft=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Bt=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Vt=(Object.defineProperty(Rt,"__esModule",{value:!0}),t),qt=fe;function Wt(e,t,r){var n;this.keys=e,this.length=e.length,this._fields=t,this._fieldLookup=null!=r?r:(n={},e.forEach(function(e,t){n[e]=t}),n)}Wt.prototype.forEach=function(e){var t,r;try{for(var n=Ft(this.entries()),o=n.next();!o.done;o=n.next()){var i=Bt(o.value,2),u=i[0];e(i[1],u,this)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},Wt.prototype.map=function(e){var t,r,n=[];try{for(var o=Ft(this.entries()),i=o.next();!i.done;i=o.next()){var u=Bt(i.value,2),a=u[0];n.push(e(u[1],a,this))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return n},Wt.prototype.as=function(e,t){return(0,qt.as)(this,e,t)},Wt.prototype.entries=function(){var t;return Lt(this,function(e){switch(e.label){case 0:t=0,e.label=1;case 1:return t<this.keys.length?[4,[this.keys[t],this._fields[t]]]:[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}})},Wt.prototype.values=function(){var t;return Lt(this,function(e){switch(e.label){case 0:t=0,e.label=1;case 1:return t<this.keys.length?[4,this._fields[t]]:[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}})},Wt.prototype[Symbol.iterator]=function(){var t;return Lt(this,function(e){switch(e.label){case 0:t=0,e.label=1;case 1:return t<this.keys.length?[4,this._fields[t]]:[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}})},Wt.prototype.toObject=function(){var t,e,r={};try{for(var n=Ft(this.entries()),o=n.next();!o.done;o=n.next()){var i=Bt(o.value,2);r[i[0]]=i[1]}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return r},Wt.prototype.get=function(e){var t;if("number"!=typeof e){if(void 0===(t=this._fieldLookup[e]))throw(0,Vt.newError)("This record has no field with key '".concat(e.toString(),"', available keys are: [")+this.keys.toString()+"].")}else t=e;if(t>this._fields.length-1||t<0)throw(0,Vt.newError)("This record has no field with index '"+t.toString()+"'. Remember that indexes start at `0`, and make sure your query returns records in the shape you meant it to.");return this._fields[t]},Wt.prototype.has=function(e){return"number"==typeof e?0<=e&&e<this._fields.length:void 0!==this._fieldLookup[e]},Rt.default=Wt;var l={},zt=(Object.defineProperty(l,"__esModule",{value:!0}),l.Point=void 0,l.isPoint=function(e){var t=e;return null!=e&&!0===t[Ht]},a),Ht="__isPoint__",Gt=(Yt.prototype.toString=function(){return null==this.z||isNaN(this.z)?"Point{srid=".concat(Kt(this.srid),", x=").concat(Kt(this.x),", y=").concat(Kt(this.y),"}"):"Point{srid=".concat(Kt(this.srid),", x=").concat(Kt(this.x),", y=").concat(Kt(this.y),", z=").concat(Kt(this.z),"}")},Yt);function Yt(e,t,r,n){this.srid=(0,zt.assertNumberOrInteger)(e,"SRID"),this.x=(0,zt.assertNumber)(t,"X coordinate"),this.y=(0,zt.assertNumber)(r,"Y coordinate"),this.z=null==n?n:(0,zt.assertNumber)(n,"Z coordinate"),Object.freeze(this)}function Kt(e){return Number.isInteger(e)?e.toString()+".0":e.toString()}l.Point=Gt,Object.defineProperty(Gt.prototype,Ht,{value:!0,enumerable:!1,configurable:!1,writable:!1});var Zt,Gt={},h={},Qt=r&&r.__assign||function(){return(Qt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Xt=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),Jt=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),b=r&&r.__importStar||(Zt=function(e){return(Zt=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=Zt(e),n=0;n<r.length;n++)"default"!==r[n]&&Xt(t,e,r[n]);return Jt(t,e),t}),$t=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},er=r&&r.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||((n=n||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},tr=(Object.defineProperty(h,"__esModule",{value:!0}),h.GqlStatusObject=h.Notification=h.notificationClassification=h.notificationCategory=h.notificationSeverityLevel=void 0,h.polyfillGqlStatusObject=dr,h.polyfillNotification=pr,h.buildGqlStatusObjectFromMetadata=function(e){if(null!=e.statuses)return e.statuses.map(function(e){return new lr(e)});var t=(e=>!0===(null==e?void 0:e.have_records_streamed)?hr.SUCCESS:!1===(null==e?void 0:e.has_keys)?hr.OMITTED_RESULT:!0===(null==e?void 0:e.pulled)?hr.NO_DATA:hr.NO_DATA_UNKNOWN_SUBCONDITION)(e.stream_summary);return er([t],$t(null!=(e=null==(t=e.notifications)?void 0:t.map(dr))?e:[]),!1).sort(function(e,t){return yr(e)-yr(t)})},h.buildNotificationsFromMetadata=function(e){return null==e.notifications?null==e.statuses?[]:e.statuses.map(pr).filter(function(e){return null!=e}):e.notifications.map(function(e){return new cr(e)})},b(F)),rr=G,nr=i,or={WARNING:{gql_status:"01N42",status_description:"warn: unknown warning"},NO_DATA:{gql_status:"02N42",status_description:"note: no data - unknown subcondition"},INFORMATION:{gql_status:"03N42",status_description:"info: unknown notification"},ERROR:{gql_status:"50N42",status_description:"error: general processing exception - unexpected error"}},ir={WARNING:"WARNING",INFORMATION:"INFORMATION",UNKNOWN:"UNKNOWN"},ur=(h.notificationSeverityLevel=ir,Object.freeze(ir),Object.values(ir)),b={HINT:"HINT",UNRECOGNIZED:"UNRECOGNIZED",UNSUPPORTED:"UNSUPPORTED",PERFORMANCE:"PERFORMANCE",DEPRECATION:"DEPRECATION",TOPOLOGY:"TOPOLOGY",SECURITY:"SECURITY",GENERIC:"GENERIC",SCHEMA:"SCHEMA",UNKNOWN:"UNKNOWN"},ar=(h.notificationCategory=b,Object.freeze(b),Object.values(b)),sr=b,cr=(h.notificationClassification=sr,function(e){this.code=e.code,this.title=e.title,this.description=e.description,this.position=_r(e.position),this.severityLevel=vr(e.severity),this.rawSeverityLevel=e.severity,this.category=mr(e.category),this.rawCategory=e.category}),lr=(h.Notification=cr,Object.defineProperty(fr.prototype,"diagnosticRecordAsJsonString",{get:function(){return tr.stringify(this.diagnosticRecord,{useCustomToString:!0})},enumerable:!1,configurable:!0}),fr);function fr(e){var t;this.gqlStatus=e.gql_status,this.statusDescription=e.status_description,this.diagnosticRecord=null!=(t=e.diagnostic_record)?t:{},this.position=null!=this.diagnosticRecord._position?_r(this.diagnosticRecord._position):void 0,this.severity=vr(this.diagnosticRecord._severity),this.rawSeverity=this.diagnosticRecord._severity,this.classification=mr(this.diagnosticRecord._classification),this.rawClassification=this.diagnosticRecord._classification,this.isNotification=null!=e.neo4j_code,Object.freeze(this)}function pr(e){var t;if(null!=e.neo4j_code)return new cr({code:e.neo4j_code,title:e.title,description:e.description,severity:null==(t=e.diagnostic_record)?void 0:t._severity,category:null==(t=e.diagnostic_record)?void 0:t._classification,position:null==(t=e.diagnostic_record)?void 0:t._position})}function dr(e){var t=e.severity===ir.WARNING?or.WARNING:or.INFORMATION,r={gql_status:t.gql_status,status_description:null!=(r=e.description)?r:t.status_description,neo4j_code:e.code,title:e.title,diagnostic_record:Qt({},rr.rawPolyfilledDiagnosticRecord)};return null!=e.severity&&(r.diagnostic_record._severity=e.severity),null!=e.category&&(r.diagnostic_record._classification=e.category),null!=e.position&&(r.diagnostic_record._position=e.position),new lr(r)}var hr={SUCCESS:new(h.GqlStatusObject=lr)({gql_status:"00000",status_description:"note: successful completion",diagnostic_record:rr.rawPolyfilledDiagnosticRecord}),NO_DATA:new lr({gql_status:"02000",status_description:"note: no data",diagnostic_record:rr.rawPolyfilledDiagnosticRecord}),NO_DATA_UNKNOWN_SUBCONDITION:new lr(Qt(Qt({},or.NO_DATA),{diagnostic_record:rr.rawPolyfilledDiagnosticRecord})),OMITTED_RESULT:new lr({gql_status:"00001",status_description:"note: successful completion - omitted result",diagnostic_record:rr.rawPolyfilledDiagnosticRecord})};Object.freeze(hr);var br=Object.freeze({"02":0,"01":1,"00":2});function yr(e){var e=null==(e=e.gqlStatus)?void 0:e.slice(0,2);return null!=(e=br[e])?e:9999}function _r(e){return null==e?{}:{offset:(0,nr.toNumber)(e.offset),line:(0,nr.toNumber)(e.line),column:(0,nr.toNumber)(e.column)}}function vr(e){return ur.includes(e)?e:ir.UNKNOWN}function mr(e){return ar.includes(e)?e:sr.UNKNOWN}h.default=lr,Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.Stats=Gt.QueryStatistics=Gt.ProfiledPlan=Gt.Plan=Gt.ServerInfo=Gt.queryType=void 0;var gr=i,Or=h,G=(wr.prototype.hasPlan=function(){return this.plan instanceof Er},wr.prototype.hasProfile=function(){return this.profile instanceof Pr},wr);function wr(e,t,r,n){this.query={text:e,parameters:t},this.queryType=r.type,this.counters=new Sr(null!=(e=r.stats)?e:{}),this.plan=(null!=r.plan||null!=r.profile)&&new Er(null!=(t=r.plan)?t:r.profile),this.profile=null!=r.profile&&new Pr(r.profile),this.notifications=(0,Or.buildNotificationsFromMetadata)(r),this.gqlStatusObjects=(0,Or.buildGqlStatusObjectFromMetadata)(r),this.server=new Cr(r.server,n),this.resultConsumedAfter=r.result_consumed_after,this.resultAvailableAfter=r.result_available_after,this.database={name:null!=(e=r.db)?e:null}}var Er=function t(e){this.operatorType=e.operatorType,this.identifiers=e.identifiers,this.arguments=e.args,this.children=null!=e.children?e.children.map(function(e){return new t(e)}):[]},Pr=(Gt.Plan=Er,Tr.prototype.hasPageCacheStats=function(){return 0<this.pageCacheMisses||0<this.pageCacheHits||0<this.pageCacheHitRatio},Tr);function Tr(e){this.operatorType=e.operatorType,this.identifiers=e.identifiers,this.arguments=e.args,this.dbHits=Ir("dbHits",e),this.rows=Ir("rows",e),this.pageCacheMisses=Ir("pageCacheMisses",e),this.pageCacheHits=Ir("pageCacheHits",e),this.pageCacheHitRatio=Ir("pageCacheHitRatio",e),this.time=Ir("time",e),this.children=null!=e.children?e.children.map(function(e){return new Tr(e)}):[]}Gt.ProfiledPlan=Pr;Gt.Stats=function(){this.nodesCreated=0,this.nodesDeleted=0,this.relationshipsCreated=0,this.relationshipsDeleted=0,this.propertiesSet=0,this.labelsAdded=0,this.labelsRemoved=0,this.indexesAdded=0,this.indexesRemoved=0,this.constraintsAdded=0,this.constraintsRemoved=0},jr.prototype.containsUpdates=function(){var r=this;return void 0!==this._containsUpdates?this._containsUpdates:0<Object.keys(this._stats).reduce(function(e,t){return e+r._stats[t]},0)},jr.prototype.updates=function(){return this._stats},jr.prototype.containsSystemUpdates=function(){return void 0!==this._containsSystemUpdates?this._containsSystemUpdates:0<this._systemUpdates},jr.prototype.systemUpdates=function(){return this._systemUpdates};var Sr=jr;function jr(r){var n=this;this._stats={nodesCreated:0,nodesDeleted:0,relationshipsCreated:0,relationshipsDeleted:0,propertiesSet:0,labelsAdded:0,labelsRemoved:0,indexesAdded:0,indexesRemoved:0,constraintsAdded:0,constraintsRemoved:0},this._systemUpdates=0,Object.keys(r).forEach(function(e){var t=e.replace(/(-\w)/g,function(e){return e[1].toUpperCase()});t in n._stats?n._stats[t]=(0,gr.toNumber)(r[e]):"systemUpdates"===t?n._systemUpdates=(0,gr.toNumber)(r[e]):"containsSystemUpdates"===t?n._containsSystemUpdates=r[e]:"containsUpdates"===t&&(n._containsUpdates=r[e])}),this._stats=Object.freeze(this._stats)}Gt.QueryStatistics=Sr;var Cr=function(e,t){null!=e&&(this.address=e.address,this.agent=e.version),this.protocolVersion=t};function Ir(e,t,r){return void 0===r&&(r=0),!1!==t&&e in t?(t=t[e],(0,gr.toNumber)(t)):r}Gt.ServerInfo=Cr;function Rr(){throw this.minimumSeverityLevel=void 0,this.disabledCategories=void 0,this.disabledClassifications=void 0,new Error("Not implemented")}Gt.queryType={READ_ONLY:"r",READ_WRITE:"rw",WRITE_ONLY:"w",SCHEMA_WRITE:"s"},Gt.default=G;var b={},G=(Object.defineProperty(b,"__esModule",{value:!0}),b.notificationFilterDisabledClassification=b.notificationFilterDisabledCategory=b.notificationFilterMinimumSeverityLevel=void 0,{OFF:"OFF",WARNING:"WARNING",INFORMATION:"INFORMATION"}),G=(b.notificationFilterMinimumSeverityLevel=G,Object.freeze(G),{HINT:"HINT",UNRECOGNIZED:"UNRECOGNIZED",UNSUPPORTED:"UNSUPPORTED",PERFORMANCE:"PERFORMANCE",TOPOLOGY:"TOPOLOGY",SECURITY:"SECURITY",DEPRECATION:"DEPRECATION",GENERIC:"GENERIC",SCHEMA:"SCHEMA"}),G=(b.notificationFilterDisabledCategory=G,Object.freeze(G),b.notificationFilterDisabledClassification=G,b.default=Rr,{}),y={},Ar={},_=(Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.FailedObserver=Ar.CompletedObserver=void 0,Mr.prototype.subscribe=function(e){kr(e,e.onKeys,[]),kr(e,e.onCompleted,{})},Mr.prototype.cancel=function(){},Mr.prototype.pause=function(){},Mr.prototype.resume=function(){},Mr.prototype.prepareToHandleSingleResponse=function(){},Mr.prototype.markCompleted=function(){},Mr.prototype.onError=function(e){throw new Error("CompletedObserver not supposed to call onError",{cause:e})},Mr);function Mr(){}function Nr(e){var t=e.error,e=e.onError;this._error=t,this._beforeError=e,this._observers=[],this.onError(t)}function kr(e,t,r){null!=t&&t.bind(e)(r)}Ar.CompletedObserver=_,Nr.prototype.subscribe=function(e){kr(e,e.onError,this._error),this._observers.push(e)},Nr.prototype.onError=function(t){kr(this,this._beforeError,t),this._observers.forEach(function(e){return kr(e,e.onError,t)})},Nr.prototype.cancel=function(){},Nr.prototype.pause=function(){},Nr.prototype.resume=function(){},Nr.prototype.markCompleted=function(){},Nr.prototype.prepareToHandleSingleResponse=function(){},Ar.FailedObserver=Nr;var xr,_={},Dr=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),Ur=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),v=r&&r.__importStar||(xr=function(e){return(xr=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=xr(e),n=0;n<r.length;n++)"default"!==r[n]&&Dr(t,e,r[n]);return Ur(t,e),t}),Lr=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Fr=r&&r.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||((n=n||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},Br=(Object.defineProperty(_,"__esModule",{value:!0}),_.Bookmarks=void 0,v(a)),v=(Vr.empty=function(){return qr},Vr.prototype.isEmpty=function(){return 0===this._values.length},Vr.prototype.values=function(){return this._values},Vr.prototype[Symbol.iterator]=function(){return this._values[Symbol.iterator]()},Vr.prototype.asBeginTransactionParameters=function(){var e;return this.isEmpty()?{}:((e={}).bookmarks=this._values,e)},Vr);function Vr(e){this._values=(e=>{if(null==e||""===e)return[];if(Br.isString(e))return[e];if(Array.isArray(e)){for(var t=new Set,r=function r(e){return e.reduce(function(e,t){return Array.isArray(t)?e.concat(r(t)):e.concat(t)},[])}(e),n=0;n<r.length;n++){var o=r[n];if(null!=o){if(!Br.isString(o))throw new TypeError("Bookmark value should be a string, given: '".concat(o,"'"));t.add(o)}}return Fr([],Lr(t),!1)}throw new TypeError("Bookmarks should either be a string or a string array, given: '".concat(e,"'"))})(e)}var qr=new(_.Bookmarks=v)(null);var v={},Wr={},m=(Object.defineProperty(Wr,"__esModule",{value:!0}),Wr.ProtocolVersion=void 0,zr.prototype.getMajor=function(){return this.major},zr.prototype.getMinor=function(){return this.major},zr.prototype.isLessThan=function(e){return this.major<e.major||this.major===e.major&&this.minor<e.minor},zr.prototype.isGreaterThan=function(e){return this.major>e.major||this.major===e.major&&this.minor>e.minor},zr.prototype.isGreaterOrEqualTo=function(e){return!this.isLessThan(e)},zr.prototype.isLessOrEqualTo=function(e){return!this.isGreaterThan(e)},zr.prototype.isEqualTo=function(e){return this.major===e.major&&this.minor===e.minor},zr.prototype.toString=function(){return this.major.toString()+"."+this.minor.toString()},zr);function zr(e,t){this.major=e,this.minor=t}Wr.ProtocolVersion=m,Object.defineProperty(v,"__esModule",{value:!0}),v.TELEMETRY_APIS=v.BOLT_PROTOCOL_V6_1=v.BOLT_PROTOCOL_V6_0=v.BOLT_PROTOCOL_V5_8=v.BOLT_PROTOCOL_V5_7=v.BOLT_PROTOCOL_V5_6=v.BOLT_PROTOCOL_V5_5=v.BOLT_PROTOCOL_V5_4=v.BOLT_PROTOCOL_V5_3=v.BOLT_PROTOCOL_V5_2=v.BOLT_PROTOCOL_V5_1=v.BOLT_PROTOCOL_V5_0=v.BOLT_PROTOCOL_V4_4=v.BOLT_PROTOCOL_V4_3=v.BOLT_PROTOCOL_V4_2=v.BOLT_PROTOCOL_V4_1=v.BOLT_PROTOCOL_V4_0=v.BOLT_PROTOCOL_V3=v.BOLT_PROTOCOL_V2=v.BOLT_PROTOCOL_V1=v.DEFAULT_POOL_MAX_SIZE=v.DEFAULT_POOL_ACQUISITION_TIMEOUT=v.DEFAULT_CONNECTION_TIMEOUT_MILLIS=v.ACCESS_MODE_WRITE=v.ACCESS_MODE_READ=v.FETCH_ALL=void 0;var Hr,Gr,m=Wr,g=(v.FETCH_ALL=-1,v.DEFAULT_POOL_ACQUISITION_TIMEOUT=6e4,v.DEFAULT_POOL_MAX_SIZE=100,v.DEFAULT_CONNECTION_TIMEOUT_MILLIS=3e4,v.ACCESS_MODE_READ="READ",v.ACCESS_MODE_WRITE="WRITE",new m.ProtocolVersion(1,0)),g=(v.BOLT_PROTOCOL_V1=g,new m.ProtocolVersion(2,0)),g=(v.BOLT_PROTOCOL_V2=g,new m.ProtocolVersion(3,0)),g=(v.BOLT_PROTOCOL_V3=g,new m.ProtocolVersion(4,0)),g=(v.BOLT_PROTOCOL_V4_0=g,new m.ProtocolVersion(4,1)),g=(v.BOLT_PROTOCOL_V4_1=g,new m.ProtocolVersion(4,2)),g=(v.BOLT_PROTOCOL_V4_2=g,new m.ProtocolVersion(4,3)),g=(v.BOLT_PROTOCOL_V4_3=g,new m.ProtocolVersion(4,4)),g=(v.BOLT_PROTOCOL_V4_4=g,new m.ProtocolVersion(5,0)),g=(v.BOLT_PROTOCOL_V5_0=g,new m.ProtocolVersion(5,1)),g=(v.BOLT_PROTOCOL_V5_1=g,new m.ProtocolVersion(5,2)),g=(v.BOLT_PROTOCOL_V5_2=g,new m.ProtocolVersion(5,3)),g=(v.BOLT_PROTOCOL_V5_3=g,new m.ProtocolVersion(5,4)),g=(v.BOLT_PROTOCOL_V5_4=g,new m.ProtocolVersion(5,5)),g=(v.BOLT_PROTOCOL_V5_5=g,new m.ProtocolVersion(5,6)),g=(v.BOLT_PROTOCOL_V5_6=g,new m.ProtocolVersion(5,7)),g=(v.BOLT_PROTOCOL_V5_7=g,new m.ProtocolVersion(5,8)),g=(v.BOLT_PROTOCOL_V5_8=g,new m.ProtocolVersion(6,0)),g=(v.BOLT_PROTOCOL_V6_0=g,new m.ProtocolVersion(6,1)),m=(v.BOLT_PROTOCOL_V6_1=g,v.TELEMETRY_APIS={MANAGED_TRANSACTION:0,UNMANAGED_TRANSACTION:1,AUTO_COMMIT_TRANSACTION:2,EXECUTE_QUERY:3},{}),g={},O=r&&r.__extends||(Hr=function(e,t){return(Hr=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Hr(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Yr=(Object.defineProperty(g,"__esModule",{value:!0}),g.Logger=void 0,t),Kr="error",Zr="warn",Qr="info",Xr="debug",Jr=((w={})[Kr]=0,w[Zr]=1,w[Qr]=2,w[Xr]=3,w),w=($r.create=function(e){return null!=(null==e?void 0:e.logging)?new $r((e=>{if(null==(null==e?void 0:e.level))return"info";var e=e.level,t=Jr[e];if(null!=t||0===t)return e;throw(0,Yr.newError)("Illegal logging level: ".concat(e,". Supported levels are: ").concat(Object.keys(Jr).toString()))})(e=e.logging),(e=>{if(null!=(null==e?void 0:e.logger)){var t=e.logger;if(null!=t&&"function"==typeof t)return t}throw(0,Yr.newError)("Illegal logger function: ".concat(null!=(e=null==(t=null==e?void 0:e.logger)?void 0:t.toString())?e:"undefined"))})(e)):this.noOp()},$r.noOp=function(){return tn},$r.prototype.isErrorEnabled=function(){return rn(this._level,Kr)},$r.prototype.error=function(e){this.isErrorEnabled()&&this._loggerFunction(Kr,e)},$r.prototype.isWarnEnabled=function(){return rn(this._level,Zr)},$r.prototype.warn=function(e){this.isWarnEnabled()&&this._loggerFunction(Zr,e)},$r.prototype.isInfoEnabled=function(){return rn(this._level,Qr)},$r.prototype.info=function(e){this.isInfoEnabled()&&this._loggerFunction(Qr,e)},$r.prototype.isDebugEnabled=function(){return rn(this._level,Xr)},$r.prototype.debug=function(e){this.isDebugEnabled()&&this._loggerFunction(Xr,e)},$r);function $r(e,t){this._level=e,this._loggerFunction=t}function en(){return Gr.call(this,Qr,function(e,t){})||this}g.Logger=w,O(en,Gr=w),en.prototype.isErrorEnabled=function(){return!1},en.prototype.error=function(e){},en.prototype.isWarnEnabled=function(){return!1},en.prototype.warn=function(e){},en.prototype.isInfoEnabled=function(){return!1},en.prototype.info=function(e){},en.prototype.isDebugEnabled=function(){return!1},en.prototype.debug=function(e){};var tn=new en;function rn(e,t){return Jr[t]<=Jr[e]}var nn,O=r&&r.__extends||(nn=function(e,t){return(nn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}nn(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),on=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},un=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))s.label=t[1];else if(6===t[0]&&s.label<a[1])s.label=a[1],a=t;else{if(!(a&&s.label<a[2])){a[2]&&s.ops.pop(),s.trys.pop();continue}s.label=a[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},an=(Object.defineProperty(m,"__esModule",{value:!0}),m.EMPTY_CONNECTION_HOLDER=m.ReadOnlyConnectionHolder=m.ConnectionHolder=void 0,t),sn=a,cn=v,ln=_,fn=g,w=(pn.prototype.mode=function(){return this._mode},pn.prototype.database=function(){return this._database},pn.prototype.setDatabase=function(e){this._database=e},pn.prototype.bookmarks=function(){return this._bookmarks},pn.prototype.connectionProvider=function(){return this._connectionProvider},pn.prototype.referenceCount=function(){return this._referenceCount},pn.prototype.initializeConnection=function(e){return 0!==this._referenceCount||null==this._connectionProvider?(this._referenceCount++,!1):(this._connectionPromise=this._createConnectionPromise(this._connectionProvider,e),this._referenceCount++,!0)},pn.prototype._createConnectionPromise=function(o,i){return on(this,void 0,void 0,function(){var t,r,n;return un(this,function(e){switch(e.label){case 0:return r=(t=o).acquireConnection,n={accessMode:this._mode,database:this._database},[4,this._getBookmarks()];case 1:return[4,r.apply(t,[(n.bookmarks=e.sent(),n.impersonatedUser=this._impersonatedUser,n.onDatabaseNameResolved=this._onDatabaseNameResolved,n.auth=this._auth,n.homeDb=i,n)])];case 2:return[2,e.sent()]}})})},pn.prototype._getBookmarks=function(){return on(this,void 0,void 0,function(){return un(this,function(e){switch(e.label){case 0:return[4,this._getConnectionAcquistionBookmarks()];case 1:return[2,e.sent()]}})})},pn.prototype.getConnection=function(){return this._connectionPromise},pn.prototype.releaseConnection=function(){return 0!==this._referenceCount&&(this._referenceCount--,0===this._referenceCount)?this._releaseConnection():this._connectionPromise},pn.prototype.close=function(e){return this._closed=!0,0===this._referenceCount?this._connectionPromise:(this._referenceCount=0,this._releaseConnection(e))},pn.prototype.log=function(){return this._log},pn.prototype._releaseConnection=function(t){return this._connectionPromise=this._connectionPromise.then(function(e){return null!=e?e.isOpen()&&(e.hasOngoingObservableRequests()||!0===t)?e.resetAndFlush().catch(vn).then(function(){return e.release().then(function(){return null})}):e.release().then(function(){return null}):Promise.resolve(null)}).catch(this._logError),this._connectionPromise},pn.prototype._logError=function(e){return this._log.isWarnEnabled()&&this._log.warn("ConnectionHolder got an error while releasing the connection. Error ".concat(e,". Stacktrace: ").concat(e.stack)),null},pn);function pn(e){var t=e.mode,r=e.database,r=void 0===r?"":r,n=e.bookmarks,o=e.connectionProvider,i=e.impersonatedUser,u=e.onDatabaseNameResolved,a=e.getConnectionAcquistionBookmarks,s=e.auth,e=e.log;this._mode=null!=t?t:cn.ACCESS_MODE_WRITE,this._closed=!1,this._database=null!=r?(0,sn.assertString)(r,"database"):"",this._bookmarks=null!=n?n:ln.Bookmarks.empty(),this._connectionProvider=o,this._impersonatedUser=i,this._referenceCount=0,this._connectionPromise=Promise.resolve(null),this._onDatabaseNameResolved=u,this._auth=s,this._log=e,this._logError=this._logError.bind(this),this._getConnectionAcquistionBookmarks=null!=a?a:function(){return Promise.resolve(ln.Bookmarks.empty())}}m.ConnectionHolder=w;O(yn,dn=w),yn.prototype.initializeConnection=function(){return 0!==this._connectionHolder.referenceCount()},yn.prototype.getConnection=function(){return this._connectionHolder.getConnection()},yn.prototype.releaseConnection=function(){return this._connectionHolder.getConnection().catch(function(){return Promise.resolve(null)})},yn.prototype.close=function(){return this._connectionHolder.getConnection().catch(function(){return Promise.resolve(null)})};var dn,hn,bn=yn;function yn(e){var t=dn.call(this,{mode:e.mode(),database:e.database(),bookmarks:e.bookmarks(),getConnectionAcquistionBookmarks:e._getConnectionAcquistionBookmarks,connectionProvider:e.connectionProvider(),log:e.log()})||this;return t._connectionHolder=e,t}function _n(){return hn.call(this,{log:fn.Logger.create({})})||this}m.ReadOnlyConnectionHolder=bn,m.default=bn,O(_n,hn=w),_n.prototype.mode=function(){},_n.prototype.database=function(){},_n.prototype.initializeConnection=function(){return!0},_n.prototype.getConnection=function(){return on(this,void 0,void 0,function(){return un(this,function(e){switch(e.label){case 0:return[4,Promise.reject((0,an.newError)("This connection holder does not serve connections"))];case 1:return[2,e.sent()]}})})},_n.prototype.releaseConnection=function(){return on(this,void 0,void 0,function(){return un(this,function(e){switch(e.label){case 0:return[4,Promise.resolve(null)];case 1:return[2,e.sent()]}})})},_n.prototype.close=function(){return on(this,void 0,void 0,function(){return un(this,function(e){switch(e.label){case 0:return[4,Promise.resolve(null)];case 1:return[2,e.sent()]}})})};bn=new _n;function vn(e){return null}m.EMPTY_CONNECTION_HOLDER=bn;var mn,O={},gn=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),On=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),w=r&&r.__importStar||(mn=function(e){return(mn=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=mn(e),n=0;n<r.length;n++)"default"!==r[n]&&gn(t,e,r[n]);return On(t,e),t}),wn=(Object.defineProperty(O,"__esModule",{value:!0}),O.TxConfig=void 0,w(a)),En=t,Pn=i,bn=(Tn.empty=function(){return Sn},Tn.prototype.isEmpty=function(){return Object.values(this).every(function(e){return null==e})},Tn);function Tn(e,t){var r;null!=(r=e)&&wn.assertObject(r,"Transaction config"),this.timeout=((e,t)=>{if(wn.isObject(e)&&null!=e.timeout){wn.assertNumberOrInteger(e.timeout,"Transaction timeout"),(e=>"number"==typeof e.timeout&&!Number.isInteger(e.timeout))(e)&&!0===(null==t?void 0:t.isInfoEnabled())&&null!=t&&t.info("Transaction timeout expected to be an integer, got: ".concat(e.timeout,". The value will be rounded up."));t=(0,Pn.int)(e.timeout,{ceilFloat:!0});if(t.isNegative())throw(0,En.newError)("Transaction timeout should not be negative");return t}return null})(e,t),this.metadata=(e=>{if(wn.isObject(e)&&null!=e.metadata){e=e.metadata;if(wn.assertObject(e,"config.metadata"),0!==Object.keys(e).length)return e}return null})(e)}var Sn=new(O.TxConfig=bn)({});var w={},jn=r&&r.__assign||function(){return(jn=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Cn=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},In=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))s.label=t[1];else if(6===t[0]&&s.label<a[1])s.label=a[1],a=t;else{if(!(a&&s.label<a[2])){a[2]&&s.ops.pop(),s.trys.pop();continue}s.label=a[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Rn=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},An=r&&r.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||((n=n||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},Mn=(Object.defineProperty(w,"__esModule",{value:!0}),w.TransactionExecutor=void 0,t),Nn=v;function kn(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setTimeout.apply(void 0,An([e,t],Rn(r),!1))}function xn(e){return clearTimeout(e)}function Dn(e,t,r,n,o){void 0===o&&(o={setTimeout:kn,clearTimeout:xn}),this._maxRetryTimeMs=Un(e,3e4),this._initialRetryDelayMs=Un(t,1e3),this._multiplier=Un(r,2),this._jitterFactor=Un(n,.2),this._setTimeout=o.setTimeout,this._clearTimeout=o.clearTimeout,this._inFlightTimeoutIds=[],this.pipelineBegin=!1,this.telemetryApi=Nn.TELEMETRY_APIS.MANAGED_TRANSACTION,this._verifyAfterConstruction()}function Un(e,t){return null!=e?e:t}Dn.prototype.execute=function(n,o,i){var u=this,a={apiTransactionConfig:{api:this.telemetryApi,onTelemetrySuccess:function(){a.apiTransactionConfig=void 0}}};return new Promise(function(e,t){u._executeTransactionInsidePromise(n,o,e,t,i,a).catch(t)}).catch(function(e){var t=Date.now(),r=u._initialRetryDelayMs;return u._retryTransactionPromise(n,o,e,t,r,i,a)})},Dn.prototype.close=function(){var t=this;this._inFlightTimeoutIds.forEach(function(e){return t._clearTimeout(e)}),this._inFlightTimeoutIds=[]},Dn.prototype._retryTransactionPromise=function(o,i,e,r,u,a,s){var c=this;return Date.now()-r>this._maxRetryTimeMs||!(0,Mn.isRetryableError)(e)?Promise.reject(e):new Promise(function(e,t){var r=c._computeDelayWithJitter(u),n=c._setTimeout(function(){c._inFlightTimeoutIds=c._inFlightTimeoutIds.filter(function(e){return e!==n}),c._executeTransactionInsidePromise(o,i,e,t,a,s).catch(t)},r);c._inFlightTimeoutIds.push(n)}).catch(function(e){var t=u*c._multiplier;return c._retryTransactionPromise(o,i,e,r,t,a,s)})},Dn.prototype._executeTransactionInsidePromise=function(u,a,s,c,l,f){return Cn(this,void 0,void 0,function(){var t,r,n,o,i=this;return In(this,function(e){switch(e.label){case 0:return(e.trys.push([0,4,,5]),r=u(null!=(null==f?void 0:f.apiTransactionConfig)?jn({},null==f?void 0:f.apiTransactionConfig):void 0),this.pipelineBegin)?(n=r,[3,3]):[3,1];case 1:return[4,r];case 2:n=e.sent(),e.label=3;case 3:return t=n,[3,5];case 4:return o=e.sent(),c(o),[2];case 5:return o=(null!=l?l:function(e){return e})(t),this._safeExecuteTransactionWork(o,a).then(function(e){return i._handleTransactionWorkSuccess(e,t,s,c)}).catch(function(e){return i._handleTransactionWorkFailure(e,t,c)}),[2]}})})},Dn.prototype._safeExecuteTransactionWork=function(e,t){try{var r=t(e);return Promise.resolve(r)}catch(e){return Promise.reject(e)}},Dn.prototype._handleTransactionWorkSuccess=function(e,t,r,n){t.isOpen()?t.commit().then(function(){r(e)}).catch(function(e){n(e)}):r(e)},Dn.prototype._handleTransactionWorkFailure=function(e,t,r){t.isOpen()?t.rollback().catch(function(e){}).then(function(){return r(e)}).catch(r):r(e)},Dn.prototype._computeDelayWithJitter=function(e){var t=e*this._jitterFactor,r=e-t,e=e+t;return Math.random()*(e-r)+r},Dn.prototype._verifyAfterConstruction=function(){if(this._maxRetryTimeMs<0)throw(0,Mn.newError)("Max retry time should be >= 0: "+this._maxRetryTimeMs.toString());if(this._initialRetryDelayMs<0)throw(0,Mn.newError)("Initial retry delay should >= 0: "+this._initialRetryDelayMs.toString());if(this._multiplier<1)throw(0,Mn.newError)("Multiplier should be >= 1.0: "+this._multiplier.toString());if(this._jitterFactor<0||1<this._jitterFactor)throw(0,Mn.newError)("Jitter factor should be in [0.0, 1.0]: "+this._jitterFactor.toFixed())},w.TransactionExecutor=Dn;var bn={},Ln=r&&r.__assign||function(){return(Ln=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Fn=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Bn=(Object.defineProperty(bn,"__esModule",{value:!0}),bn.Url=void 0,bn.parseDatabaseUrl=function(e){(0,Bn.assertString)(e,"URL");var t=(e=>(e=e.trim()).includes("://")?{schemeMissing:!1,url:e}:{schemeMissing:!0,url:"none://".concat(e)})(e),r=(e=>{function u(e,t){t=e.indexOf(t);return 0<=t?[e.substring(0,t),e[t],e.substring(t+1)]:[e,"",""]}function t(e){var t,r={},n=((t="@")===(t=0<=(t=(o=e).lastIndexOf(t))?[o.substring(0,t),o[t],o.substring(t+1)]:["","",o])[1]&&(r.userInfo=decodeURIComponent(t[0]),e=t[2]),Fn((o="]",n=u(n=e,i="["),[(i=u(n[2],o))[0],i[2]]),2)),o=n[0],i=n[1];return""!==o?(r.host=o,t=u(i,":")):(t=u(e,":"),r.host=t[0]),":"===t[1]&&(r.port=t[2]),r}var r,n={};return":"===(r=u(e,":"))[1]&&(n.scheme=decodeURIComponent(r[0]),e=r[2]),"#"===(r=u(e,"#"))[1]&&(n.fragment=decodeURIComponent(r[2]),e=r[0]),"?"===(r=u(e,"?"))[1]&&(n.query=r[2],e=r[0]),e.startsWith("//")?(r=u(e.substr(2),"/"),(n=Ln(Ln({},n),t(r[0]))).path=r[1]+r[2]):n.path=e,n})(t.url),t=t.schemeMissing?null:(e=>null==e?null:e=":"===(e=e.trim()).charAt(e.length-1)?e.substring(0,e.length-1):e)(r.scheme),n=(e=>{if(null!=e)return e.trim();throw new Error("Unable to extract host from null or undefined URL")})(r.host),o=(e=>{if(""===e||null==e)throw new Error("Illegal host ".concat(e));return e.includes(":")?Gn(e):e})(n),i=((e,t)=>null==(e="string"==typeof e?parseInt(e,10):e)||isNaN(e)?Yn(t):e)(r.port,t),o="".concat(o,":").concat(i),u=((e,r)=>{var e=null!=e?(e=>e="?"===(null==(e=(null!=e?e:"").trim())?void 0:e.charAt(0))?e.substring(1,e.length):e)(e):null,n={};return null!=e&&e.split("&").forEach(function(e){e=e.split("=");if(2!==e.length)throw new Error("Invalid parameters: '".concat(e.toString(),"' in URL '").concat(r,"'."));var t=Hn(e[0],"key",r),e=Hn(e[1],"value",r);if(void 0!==n[t])throw new Error("Duplicated query parameters with key '".concat(t,"' in URL '").concat(r,"'"));n[t]=e}),n})(null!=(u=r.query)?u:(e=>"string"!=typeof e?null:Fn(e.split("?"),2)[1])(r.resourceName),e);return new zn(t,n,i,o,u)},bn.defaultPortForScheme=Yn,bn.formatIPv4Address=function(e,t){return"".concat(e,":").concat(t)},bn.formatIPv6Address=function(e,t){e=Gn(e);return"".concat(e,":").concat(t)},a),Vn=7687,qn=7474,Wn=7473,zn=function(e,t,r,n,o){this.scheme=e,this.host=t,this.port=r,this.hostAndPort=n,this.query=o};function Hn(e,t,r){if(""===(e=(null!=e?e:"").trim()))throw new Error("Illegal empty ".concat(t," in URL query '").concat(r,"'"));return e}function Gn(e){var t="["===e.charAt(0),r="]"===e.charAt(e.length-1);if(t||r){if(t&&r)return e;throw new Error("Illegal IPv6 address ".concat(e))}return"[".concat(e,"]")}function Yn(e){return"http"===e?qn:"https"===e?Wn:Vn}bn.Url=zn;var Kn,Zn={},Qn=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),Xn=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),E=r&&r.__importStar||(Kn=function(e){return(Kn=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=Kn(e),n=0;n<r.length;n++)"default"!==r[n]&&Qn(t,e,r[n]);return Xn(t,e),t}),Jn=(Object.defineProperty(Zn,"__esModule",{value:!0}),Zn.ServerAddress=void 0,a),$n=E(bn);function eo(e,t,r,n){this._host=(0,Jn.assertString)(e,"host"),this._resolved=null!=t?(0,Jn.assertString)(t,"resolved"):null,this._port=(0,Jn.assertNumber)(r,"port"),this._hostPort=n,this._stringValue=null!=t?"".concat(n,"(").concat(t,")"):"".concat(n)}eo.prototype.host=function(){return this._host},eo.prototype.resolvedHost=function(){return null!=this._resolved?this._resolved:this._host},eo.prototype.port=function(){return this._port},eo.prototype.resolveWith=function(e){return new eo(this._host,e,this._port,this._hostPort)},eo.prototype.asHostPort=function(){return this._hostPort},eo.prototype.asKey=function(){return this._hostPort},eo.prototype.toString=function(){return this._stringValue},eo.fromUrl=function(e){e=$n.parseDatabaseUrl(e);return new eo(e.host,null,e.port,e.hostAndPort)},Zn.ServerAddress=eo;var E={},P={};function to(){}Object.defineProperty(P,"__esModule",{value:!0}),to.prototype.resolve=function(){throw new Error("Abstract function")},to.prototype._resolveToItself=function(e){return Promise.resolve([e])},P.default=to;var ro={},no=(Object.defineProperty(ro,"__esModule",{value:!0}),Zn);function oo(e){return Promise.resolve([e])}function io(e){this._resolverFunction=null!=e?e:oo}io.prototype.resolve=function(t){var r=this;return new Promise(function(e){return e(r._resolverFunction(t.asHostPort()))}).then(function(e){if(Array.isArray(e))return e.map(function(e){return no.ServerAddress.fromUrl(e)});throw new TypeError("Configured resolver function should either return an array of addresses or a Promise resolved with an array of addresses."+"Each address is '<host>:<port>'. Got: ".concat(e))})},ro.default=io;var uo,ao=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},P=(Object.defineProperty(E,"__esModule",{value:!0}),E.ConfiguredCustomResolver=E.BaseHostNameResolver=void 0,ao(P)),P=(E.BaseHostNameResolver=P.default,ao(ro)),ao=(E.ConfiguredCustomResolver=P.default,{}),P={};Object.defineProperty(P,"__esModule",{value:!0}),P.fromVersion=function(e,t){void 0===t&&(t=function(){return{get userAgent(){}}});var t=t(),r=null!=t.userAgent?t.userAgent.split("(")[1].split(")")[0]:void 0,t=t.userAgent||void 0;return{product:"neo4j-javascript/".concat(e),platform:r,languageDetails:t}},T=ao,uo=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),so=r&&r.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||uo(t,e,r)},Object.defineProperty(T,"__esModule",{value:!0}),so(P,T);var so={},P={},T=(Object.defineProperty(P,"__esModule",{value:!0}),P.DEFAULT_ACQUISITION_TIMEOUT=P.DEFAULT_MAX_SIZE=void 0,P.DEFAULT_MAX_SIZE=100,P.DEFAULT_ACQUISITION_TIMEOUT=6e4,co.defaultConfig=function(){return new co(100,6e4)},co.fromDriverConfig=function(e){return new co(fo(e.maxConnectionPoolSize)?e.maxConnectionPoolSize:100,fo(e.connectionAcquisitionTimeout)?e.connectionAcquisitionTimeout:6e4)},co);function co(e,t){this.maxSize=lo(e,100),this.acquisitionTimeout=lo(t,6e4)}function lo(e,t){return fo(e)?e:t}function fo(e){return 0===e||null!=e}P.default=T;var T={},po=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},ho=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))s.label=t[1];else if(6===t[0]&&s.label<a[1])s.label=a[1],a=t;else{if(!(a&&s.label<a[2])){a[2]&&s.ops.pop(),s.trys.pop();continue}s.label=a[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},bo=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},yo=(Object.defineProperty(T,"__esModule",{value:!0}),bo(P)),_o=t,vo=g,bo=(mo.prototype.acquire=function(s,c,l){return po(this,void 0,void 0,function(){var o,i,t,u,a=this;return ho(this,function(e){switch(e.label){case 0:if(o=c.asKey(),i=this._acquireRequests,t=i[o],(u=null!=s.startTime&&0!==s.startTime?(new Date).getTime()-s.startTime:0)>=this._acquisitionTimeout)throw this.getAcquisitionTimeoutError(c);return null==t&&(i[o]=[]),[4,new Promise(function(e,t){var r=setTimeout(function(){var e=i[o];null!=e&&(i[o]=e.filter(function(e){return e!==n})),n.isCompleted()||n.reject(a.getAcquisitionTimeoutError(c))},a._acquisitionTimeout-u),n=("object"==typeof r&&r.unref(),new wo(o,s,l,e,t,r,a._log));i[o].push(n),a._processPendingAcquireRequests(c)})];case 1:return[2,e.sent()]}})})},mo.prototype.getAcquisitionTimeoutError=function(e){var t=e.asKey(),r=this.activeResourceCount(e),e=this.has(e)?this._pools[t].length:0;return(0,_o.newError)("Connection acquisition timed out in ".concat(this._acquisitionTimeout," ms. Pool status: Active conn count = ").concat(r,", Idle conn count = ").concat(e,"."))},mo.prototype.purge=function(t){return po(this,void 0,void 0,function(){return ho(this,function(e){switch(e.label){case 0:return[4,this._purgeKey(t.asKey())];case 1:return[2,e.sent()]}})})},mo.prototype.apply=function(e,t){e=e.asKey();e in this._pools&&this._pools[e].apply(t)},mo.prototype.close=function(){return po(this,void 0,void 0,function(){var r=this;return ho(this,function(e){switch(e.label){case 0:return this._closed=!0,[4,Promise.all(Object.keys(this._pools).map(function(t){return po(r,void 0,void 0,function(){return ho(this,function(e){switch(e.label){case 0:return[4,this._purgeKey(t)];case 1:return[2,e.sent()]}})})})).then()];case 1:return[2,e.sent()]}})})},mo.prototype.keepAll=function(o){return po(this,void 0,void 0,function(){var t,r,n=this;return ho(this,function(e){switch(e.label){case 0:return t=o.map(function(e){return e.asKey()}),r=Object.keys(this._pools),r=r.filter(function(e){return!t.includes(e)}),[4,Promise.all(r.map(function(t){return po(n,void 0,void 0,function(){return ho(this,function(e){switch(e.label){case 0:return[4,this._purgeKey(t)];case 1:return[2,e.sent()]}})})})).then()];case 1:return[2,e.sent()]}})})},mo.prototype.has=function(e){return e.asKey()in this._pools},mo.prototype.activeResourceCount=function(e){return null!=(e=this._activeResourceCounts[e.asKey()])?e:0},mo.prototype._getOrInitializePoolFor=function(e){var t=this._pools[e];return null==t&&(t=new Co,this._pools[e]=t,this._pendingCreates[e]=0),t},mo.prototype._acquire=function(c,l,f){return po(this,void 0,void 0,function(){var t,n,r,o,i,u,a,s=this;return ho(this,function(e){switch(e.label){case 0:if(this._closed)throw(0,_o.newError)("Pool is closed, it is no more able to serve requests.");if(t=l.asKey(),n=this._getOrInitializePoolFor(t),f)return[3,10];e.label=1;case 1:if(!(0<n.length))return[3,10];if(null==(r=n.pop()))return[3,1];go(t,this._activeResourceCounts),null!=this._removeIdleObserver&&this._removeIdleObserver(r),o=!1,e.label=2;case 2:return e.trys.push([2,4,,6]),[4,this._validateOnAcquire(c,r)];case 3:return o=e.sent(),[3,6];case 4:return i=e.sent(),Oo(t,this._activeResourceCounts),n.removeInUse(r),[4,this._destroy(r)];case 5:throw e.sent(),i;case 6:return o?(this._log.isDebugEnabled()&&this._log.debug("".concat(r," acquired from the pool ").concat(t)),[2,{resource:r,pool:n}]):[3,7];case 7:return Oo(t,this._activeResourceCounts),n.removeInUse(r),[4,this._destroy(r)];case 8:e.sent(),e.label=9;case 9:return[3,1];case 10:if(0<this._maxSize&&this.activeResourceCount(l)+this._pendingCreates[t]>=this._maxSize)return[2,{resource:null,pool:n}];this._pendingCreates[t]=this._pendingCreates[t]+1,e.label=11;case 11:return(e.trys.push([11,,15,16]),this.activeResourceCount(l)+n.length>=this._maxSize&&f)?null==(a=n.pop())?[3,13]:(null!=this._removeIdleObserver&&this._removeIdleObserver(a),n.removeInUse(a),[4,this._destroy(a)]):[3,13];case 12:e.sent(),e.label=13;case 13:return[4,this._create(c,l,function(t,r){return po(s,void 0,void 0,function(){return ho(this,function(e){switch(e.label){case 0:return[4,this._release(t,r,n)];case 1:return[2,e.sent()]}})})})];case 14:return u=e.sent(),n.pushInUse(u),go(t,this._activeResourceCounts),this._log.isDebugEnabled()&&this._log.debug("".concat(u," created for the pool ").concat(t)),[3,16];case 15:return this._pendingCreates[t]=this._pendingCreates[t]-1,[7];case 16:return[2,{resource:u,pool:n}]}})})},mo.prototype._release=function(n,o,i){return po(this,void 0,void 0,function(){var t,r=this;return ho(this,function(e){switch(e.label){case 0:t=n.asKey(),e.label=1;case 1:return(e.trys.push([1,,9,10]),i.isActive())?[4,this._validateOnRelease(o)]:[3,6];case 2:return e.sent()?[3,4]:(this._log.isDebugEnabled()&&this._log.debug("".concat(o," destroyed and can't be released to the pool ").concat(t," because it is not functional")),i.removeInUse(o),[4,this._destroy(o)]);case 3:return e.sent(),[3,5];case 4:null!=this._installIdleObserver&&this._installIdleObserver(o,{onError:function(e){r._log.debug("Idle connection ".concat(o," destroyed because of error: ").concat(e));e=r._pools[t];null!=e&&(r._pools[t]=e.filter(function(e){return e!==o}),e.removeInUse(o)),r._destroy(o).catch(function(){})}}),i.push(o),this._log.isDebugEnabled()&&this._log.debug("".concat(o," released to the pool ").concat(t)),e.label=5;case 5:return[3,8];case 6:return this._log.isDebugEnabled()&&this._log.debug("".concat(o," destroyed and can't be released to the pool ").concat(t," because pool has been purged")),i.removeInUse(o),[4,this._destroy(o)];case 7:e.sent(),e.label=8;case 8:return[3,10];case 9:return Oo(t,this._activeResourceCounts),this._processPendingAcquireRequests(n),[7];case 10:return[2]}})})},mo.prototype._purgeKey=function(o){return po(this,void 0,void 0,function(){var t,r,n;return ho(this,function(e){switch(e.label){case 0:if(t=this._pools[o],r=[],null==t)return[3,2];for(;0<t.length;)null!=(n=t.pop())&&(null!=this._removeIdleObserver&&this._removeIdleObserver(n),r.push(this._destroy(n)));return t.close(),delete this._pools[o],[4,Promise.all(r)];case 1:e.sent(),e.label=2;case 2:return[2]}})})},mo.prototype._processPendingAcquireRequests=function(r){var n,o=this,i=r.asKey(),e=this._acquireRequests[i];null!=e&&(null!=(n=e.shift())?this._acquire(n.context,r,n.requireNew).catch(function(e){return n.reject(e),{resource:null,pool:null}}).then(function(e){var t=e.resource,e=e.pool;null!=t&&null!=e?n.isCompleted()?o._release(r,t,e).catch(function(e){o._log.isDebugEnabled()&&o._log.debug("".concat(t," could not be release back to the pool. Cause: ").concat(e))}):n.resolve(t):n.isCompleted()||(null==o._acquireRequests[i]&&(o._acquireRequests[i]=[]),o._acquireRequests[i].unshift(n))}).catch(function(e){return n.reject(e)}):delete this._acquireRequests[i])},mo);function mo(e){var t=e.create,t=void 0===t?function(e,t,r){return po(s,void 0,void 0,function(){return ho(this,function(e){switch(e.label){case 0:return[4,Promise.reject(new Error("Not implemented"))];case 1:return[2,e.sent()]}})})}:t,r=e.destroy,r=void 0===r?function(e){return po(s,void 0,void 0,function(){return ho(this,function(e){switch(e.label){case 0:return[4,Promise.resolve()];case 1:return[2,e.sent()]}})})}:r,n=e.validateOnAcquire,n=void 0===n?function(e,t){return!0}:n,o=e.validateOnRelease,o=void 0===o?function(e){return!0}:o,i=e.installIdleObserver,i=void 0===i?function(e,t){}:i,u=e.removeIdleObserver,u=void 0===u?function(e){}:u,a=e.config,a=void 0===a?yo.default.defaultConfig():a,e=e.log,e=void 0===e?vo.Logger.noOp():e,s=this;this._create=t,this._destroy=r,this._validateOnAcquire=n,this._validateOnRelease=o,this._installIdleObserver=i,this._removeIdleObserver=u,this._maxSize=a.maxSize,this._acquisitionTimeout=a.acquisitionTimeout,this._pools={},this._pendingCreates={},this._acquireRequests={},this._activeResourceCounts={},this._release=this._release.bind(this),this._log=e,this._closed=!1}function go(e,t){var r=null!=(r=t[e])?r:0;t[e]=r+1}function Oo(e,t){var r=(null!=(r=t[e])?r:0)-1;0<r?t[e]=r:delete t[e]}Object.defineProperty(Eo.prototype,"context",{get:function(){return this._context},enumerable:!1,configurable:!0}),Object.defineProperty(Eo.prototype,"requireNew",{get:function(){var e;return null!=(e=this._config.requireNew)&&e},enumerable:!1,configurable:!0}),Eo.prototype.isCompleted=function(){return this._completed},Eo.prototype.resolve=function(e){this._completed||(this._completed=!0,clearTimeout(this._timeoutId),this._log.isDebugEnabled()&&this._log.debug("".concat(e," acquired from the pool ").concat(this._key)),this._resolve(e))},Eo.prototype.reject=function(e){this._completed||(this._completed=!0,clearTimeout(this._timeoutId),this._reject(e))};var wo=Eo;function Eo(e,t,r,n,o,i,u){this._key=e,this._context=t,this._resolve=n,this._reject=o,this._timeoutId=i,this._log=u,this._completed=!1,this._config=null!=r?r:{}}Io.prototype.isActive=function(){return this._active},Io.prototype.close=function(){this._active=!1,this._elements=[],this._elementsInUse=new Set},Io.prototype.filter=function(e){return this._elements=this._elements.filter(e),this},Io.prototype.apply=function(e){this._elements.forEach(e),this._elementsInUse.forEach(e)},Object.defineProperty(Io.prototype,"length",{get:function(){return this._elements.length},enumerable:!1,configurable:!0}),Io.prototype.pop=function(){var e=this._elements.pop();return null!=e&&this._elementsInUse.add(e),e},Io.prototype.push=function(e){return this._elementsInUse.delete(e),this._elements.push(e)},Io.prototype.pushInUse=function(e){this._elementsInUse.add(e)},Io.prototype.removeInUse=function(e){this._elementsInUse.delete(e)};var Po,To,So,jo,Co=Io;function Io(){this._active=!0,this._elements=[],this._elementsInUse=new Set}T.default=bo,bo=so,To=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),So=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Uo=r&&r.__importStar||(Po=function(e){return(Po=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=Po(e),n=0;n<r.length;n++)"default"!==r[n]&&To(t,e,r[n]);return So(t,e),t}),S=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(bo,"__esModule",{value:!0}),bo.DEFAULT_MAX_SIZE=bo.DEFAULT_ACQUISITION_TIMEOUT=bo.PoolConfig=bo.Pool=void 0,jo=Uo(P),bo.PoolConfig=jo.default,Object.defineProperty(bo,"DEFAULT_ACQUISITION_TIMEOUT",{enumerable:!0,get:function(){return jo.DEFAULT_ACQUISITION_TIMEOUT}}),Object.defineProperty(bo,"DEFAULT_MAX_SIZE",{enumerable:!0,get:function(){return jo.DEFAULT_MAX_SIZE}}),Uo=S(T),bo.Pool=Uo.default,bo.default=Uo.default;function Ro(e){console.log("Uncaught error when processing result: "+e)}function Ao(e){}function Mo(e){}var No,ko,xo=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),Do=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),P=r&&r.__importStar||(No=function(e){return(No=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=No(e),n=0;n<r.length;n++)"default"!==r[n]&&xo(t,e,r[n]);return Do(t,e),t}),S=(Object.defineProperty(y,"__esModule",{value:!0}),y.pool=y.boltAgent=y.objectUtil=y.resolver=y.serverAddress=y.urlUtil=y.logger=y.transactionExecutor=y.txConfig=y.connectionHolder=y.constants=y.bookmarks=y.observer=y.temporalUtil=y.util=void 0,P(a)),T=(y.util=S,P(o)),bo=(y.temporalUtil=T,P(Ar)),Uo=(y.observer=bo,P(_)),S=(y.bookmarks=Uo,P(v)),o=(y.constants=S,P(m)),T=(y.connectionHolder=o,P(O)),bo=(y.txConfig=T,P(w)),Uo=(y.transactionExecutor=bo,P(g)),S=(y.logger=Uo,P(bn)),o=(y.urlUtil=S,P(Zn)),T=(y.serverAddress=o,P(E)),bo=(y.resolver=T,P(n)),Uo=(y.objectUtil=bo,P(ao)),bn=(y.boltAgent=Uo,P(so)),S=(y.pool=bn,r&&r.__extends||(ko=function(e,t){return(ko=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ko(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),Lo=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},Fo=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))s.label=t[1];else if(6===t[0]&&s.label<a[1])s.label=a[1],a=t;else{if(!(a&&s.label<a[2])){a[2]&&s.ops.pop(),s.trys.pop();continue}s.label=a[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Zn=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Bo=(Object.defineProperty(G,"__esModule",{value:!0}),Zn(Gt)),Vo=y,qo=t,Wo=Vo.connectionHolder.EMPTY_CONNECTION_HOLDER;zo.prototype.as=function(t,r){if(null!=this._p)throw(0,qo.newError)("Cannot call .as() on a Result that is being consumed");return this._mapper=function(e){return e.as(t,r)},this},zo.prototype.keys=function(){var o=this;return null!==this._keys?Promise.resolve(this._keys):null!==this._error?Promise.reject(this._error):new Promise(function(r,n){o._streamObserverPromise.then(function(e){var t=o._decorateObserver({onKeys:function(e){return r(e)},onError:function(e){return n(e)}},!0);o._ownedObservers.push(t),e.subscribe(t)}).catch(n)})},zo.prototype.summary=function(){var o=this;return null!==this._summary?Promise.resolve(this._summary):null!==this._error?Promise.reject(this._error):new Promise(function(r,n){o._streamObserverPromise.then(function(e){var t=o._decorateObserver({onCompleted:function(e){return r(e)},onError:function(e){return n(e)}});e.cancel(),o._ownedObservers.push(t),e.subscribe(t)}).catch(n)})},zo.prototype._getOrCreatePromise=function(){var o=this;return null==this._p&&(this._p=new Promise(function(t,r){var n=[];o._subscribe({onNext:function(e){null!=o._mapper?n.push(o._mapper(e)):n.push(e)},onCompleted:function(e){t({records:n,summary:e})},onError:function(e){r(e)}}).catch(function(){})})),this._p},zo.prototype[Symbol.asyncIterator]=function(){var e,n,r,o,i,u=this;return this.isOpen()?(n={paused:!0,firstRun:!0,finished:!1},r=function(){var e,t;null!=n.streaming&&(e=(t=null!=(t=null==(t=n.queuedObserver)?void 0:t.size)?t:0)>=u._watermarks.high,t=t<=u._watermarks.low,e&&!n.paused?(n.paused=!0,n.streaming.pause()):(t&&n.paused||n.firstRun&&!e)&&(n.firstRun=!1,n.paused=!1,n.streaming.resume()))},o=function(){return Lo(u,void 0,void 0,function(){var t;return Fo(this,function(e){switch(e.label){case 0:return void 0!==n.queuedObserver?[3,2]:(n.queuedObserver=this._createQueuedResultObserver(r),t=n,[4,this._subscribe(n.queuedObserver,!0).catch(function(){})]);case 1:t.streaming=e.sent(),r(),e.label=2;case 2:return[2,n.queuedObserver]}})})},i=function(e){if(void 0===e)throw(0,qo.newError)("InvalidState: Result stream finished without Summary",qo.PROTOCOL_ERROR);return!0},{next:function(){return Lo(u,void 0,void 0,function(){var t;return Fo(this,function(e){switch(e.label){case 0:return n.finished&&i(n.summary)?[2,{done:!0,value:n.summary}]:[4,o()];case 1:return[4,e.sent().dequeue()];case 2:return!0===(t=e.sent()).done&&(n.finished=t.done,n.summary=t.value),[2,t]}})})},return:function(r){return Lo(u,void 0,void 0,function(){var t;return Fo(this,function(e){switch(e.label){case 0:return n.finished&&i(n.summary)?[2,{done:!0,value:null!=r?r:n.summary}]:(null!=(t=n.streaming)&&t.cancel(),[4,o()]);case 1:return[4,e.sent().dequeueUntilDone()];case 2:return t=e.sent(),n.finished=!0,t.value=null!=r?r:t.value,n.summary=t.value,[2,t]}})})},peek:function(){return Lo(u,void 0,void 0,function(){return Fo(this,function(e){switch(e.label){case 0:return n.finished&&i(n.summary)?[2,{done:!0,value:n.summary}]:[4,o()];case 1:return[4,e.sent().head()];case 2:return[2,e.sent()]}})})}}):(e=(0,qo.newError)("Result is already consumed"),{next:function(){return Promise.reject(e)},peek:function(){return Promise.reject(e)}})},zo.prototype.then=function(e,t){return this._getOrCreatePromise().then(e,t)},zo.prototype.catch=function(e){return this._getOrCreatePromise().catch(e)},zo.prototype.finally=function(e){return this._getOrCreatePromise().finally(e)},zo.prototype.subscribe=function(e){this._subscribe(e).catch(function(){})},zo.prototype.isOpen=function(){return null===this._summary&&null===this._error},zo.prototype._subscribe=function(e,t,r){void 0===t&&(t=!1);var n=this._decorateObserver(e,r=void 0===r?!1:r);return this._ownedObservers.push(n),this._streamObserverPromise.then(function(e){return t&&e.pause(),e.subscribe(n),e}).catch(function(e){return null!=n.onError&&n.onError(e),Promise.reject(e)})},zo.prototype._decorateObserver=function(n,e){var t,o=this,r=null!=(t=n.onCompleted)?t:Ao,i=null!=(t=n.onError)?t:Ro,u=null!=(t=n.onKeys)?t:Mo;return{onNext:null!=n.onNext?n.onNext.bind(n):void 0,onKeys:function(e){return o._keys=e,u.call(n,e)},onCompleted:!0===e?void 0:function(e){o._releaseConnectionAndGetSummary(e).then(function(e){return null!==o._summary?r.call(n,o._summary):(o._summary=e,r.call(n,e))}).catch(i)},onError:function(r,e){!0===e&&void 0===o._retriedError&&r instanceof qo.Neo4jError&&!0===(null==(e=r.diagnosticRecord)?void 0:e._idempotent)&&void 0!==o._retry?(o._retriedError=r,o._streamObserverPromise.then(function(e){void 0!==e.unsubscribeAll&&e.unsubscribeAll()},function(){}),o._streamObserverPromise=o._retry(),o._streamObserverPromise.then(function(t){o._ownedObservers.forEach(function(e){t.subscribe(e)})},function(){})):o._retriedError!==r&&o._connectionHolder.releaseConnection().then(function(){var e,t;e=r,null!=(t=o._stack)&&(e.stack=e.toString()+"\n"+t),o._error=r,i.call(n,r)}).catch(i)}}},zo.prototype._cancel=function(){null===this._summary&&null===this._error&&this._streamObserverPromise.then(function(e){return e.cancel()}).catch(function(){})},zo.prototype._releaseConnectionAndGetSummary=function(t){var e=Vo.util.validateQueryAndParameters(this._query,this._parameters,{skipAsserts:!0}),r=e.validatedQuery,n=e.params,o=this._connectionHolder;return o.getConnection().then(function(e){return o.releaseConnection().then(function(){return null==e?void 0:e.getProtocolVersion()})},function(e){}).then(function(e){return new Bo.default(r,n,t,e)})},zo.prototype._createQueuedResultObserver=function(n){var t=this;function o(){var r={};return r.promise=new Promise(function(e,t){r.resolve=e,r.reject=t}),r}function i(e){return e instanceof Error}function r(){return Lo(this,void 0,void 0,function(){var t;return Fo(this,function(e){switch(e.label){case 0:if(0<u.length){if(t=null!=(t=u.shift())?t:(0,qo.newError)("Unexpected empty buffer",qo.PROTOCOL_ERROR),n(),i(t))throw t;return[2,t]}return a.resolvable=o(),[4,a.resolvable.promise];case 1:return[2,e.sent()]}})})}var u=[],a={resolvable:null},s={onNext:function(e){null!=t._mapper?s._push({done:!1,value:t._mapper(e)}):s._push({done:!1,value:e})},onCompleted:function(e){s._push({done:!0,value:e})},onError:function(e){s._push(e)},_push:function(e){var t;null!==a.resolvable?(t=a.resolvable,a.resolvable=null,i(e)?t.reject(e):t.resolve(e)):(u.push(e),n())},dequeue:r,dequeueUntilDone:function(){return Lo(t,void 0,void 0,function(){var t;return Fo(this,function(e){switch(e.label){case 0:return[4,r()];case 1:return!0===(t=e.sent()).done?[2,t]:[3,0];case 2:return[2]}})})},head:function(){return Lo(t,void 0,void 0,function(){var t,r;return Fo(this,function(e){switch(e.label){case 0:if(0<u.length){if(i(t=u[0]))throw t;return[2,t]}a.resolvable=o(),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,a.resolvable.promise];case 2:return t=e.sent(),u.unshift(t),[2,t];case 3:throw r=e.sent(),u.unshift(r),r;case 4:return n(),[7];case 5:return[2]}})})},get size(){return u.length}};return s};o=zo;function zo(e,t,r,n,o,i){var u;void 0===o&&(o={high:Number.MAX_VALUE,low:Number.MAX_VALUE}),this[Yo]="Result",this._stack=null!=(u=new Error("")).stack?u.stack.replace(/^Error(\n\r)*/,""):null,this._streamObserverPromise=e,this._p=null,this._query=t,this._parameters=null!=r?r:{},this._connectionHolder=null!=n?n:Wo,this._keys=null,this._summary=null,this._error=null,this._mapper=null,this._watermarks=o,this._retry=i,this._ownedObservers=[],this._retriedError=void 0}var Ho,Go,Yo=Symbol.toStringTag,E=(S(Ko,Ho=o),Ko);function Ko(){return null!==Ho&&Ho.apply(this,arguments)||this}function Zo(){return null!==Go&&Go.apply(this,arguments)||this}S(Zo,Go=o),G.default=E;T={};Object.defineProperty(T,"__esModule",{value:!0});T.default=function(e,t,r){this.keys=e,this.records=t,this.summary=r};n={},Object.defineProperty(n,"__esModule",{value:!0}),n.Releasable=void 0,Qo.prototype.release=function(){throw new Error("Not implemented")},bo=Qo;function Qo(){}function Xo(){}n.Releasable=bo,Xo.prototype.acquireConnection=function(e){throw Error("Not implemented")},Xo.prototype.supportsMultiDb=function(){throw Error("Not implemented")},Xo.prototype.supportsTransactionConfig=function(){throw Error("Not implemented")},Xo.prototype.supportsUserImpersonation=function(){throw Error("Not implemented")},Xo.prototype.supportsSessionAuth=function(){throw Error("Not implemented")},Xo.prototype.SSREnabled=function(){return!1},Xo.prototype.verifyConnectivityAndGetServerInfo=function(e){throw Error("Not implemented")},Xo.prototype.verifyAuthentication=function(e){throw Error("Not implemented")},Xo.prototype.getNegotiatedProtocolVersion=function(){throw Error("Not Implemented")},Xo.prototype.close=function(){throw Error("Not implemented")},n.default=Xo;ao={};function Jo(){}Object.defineProperty(ao,"__esModule",{value:!0}),Jo.prototype.beginTransaction=function(e){throw new Error("Not implemented")},Jo.prototype.run=function(e,t,r){throw new Error("Not implemented")},Jo.prototype.commitTransaction=function(e){throw new Error("Not implemented")},Jo.prototype.rollbackTransaction=function(e){throw new Error("Not implemented")},Jo.prototype.resetAndFlush=function(){throw new Error("Not implemented")},Jo.prototype.isOpen=function(){throw new Error("Not implemented")},Jo.prototype.getProtocolVersion=function(){throw new Error("Not implemented")},Jo.prototype.hasOngoingObservableRequests=function(){throw new Error("Not implemented")},ao.default=Jo;var Uo={},$o=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},ei=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))s.label=t[1];else if(6===t[0]&&s.label<a[1])s.label=a[1],a=t;else{if(!(a&&s.label<a[2])){a[2]&&s.ops.pop(),s.trys.pop();continue}s.label=a[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},P=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ti=(Object.defineProperty(Uo,"__esModule",{value:!0}),a),ri=m,ni=_,oi=O,ii=Ar,ui=t,ai=P(G);function si(e){var t=e.connectionHolder,r=e.onClose,n=e.onBookmarks,o=e.onConnection,i=e.reactive,u=e.fetchSize,a=e.impersonatedUser,s=e.highRecordWatermark,c=e.lowRecordWatermark,l=e.notificationFilter,e=e.apiTelemetryConfig,f=this;this._connectionHolder=t,this._reactive=i,this._state=ci.ACTIVE,this._onClose=r,this._onBookmarks=n,this._onConnection=o,this._onError=this._onErrorCallback.bind(this),this._fetchSize=u,this._onComplete=this._onCompleteCallback.bind(this),this._results=[],this._impersonatedUser=a,this._lowRecordWatermark=c,this._highRecordWatermark=s,this._bookmarks=ni.Bookmarks.empty(),this._notificationFilter=l,this._apiTelemetryConfig=e,this._acceptActive=function(){},this._activePromise=new Promise(function(e,t){f._acceptActive=e})}si.prototype._begin=function(o,i,u){var t=this;this._connectionHolder.getConnection().then(function(n){return $o(t,void 0,void 0,function(){var t,r=this;return ei(this,function(e){switch(e.label){case 0:return(this._onConnection(),null==n)?[3,2]:(t=this,[4,o()]);case 1:return t._bookmarks=e.sent(),[2,n.beginTransaction({bookmarks:this._bookmarks,txConfig:i,mode:this._connectionHolder.mode(),database:this._connectionHolder.database(),impersonatedUser:this._impersonatedUser,notificationFilter:this._notificationFilter,apiTelemetryConfig:this._apiTelemetryConfig,beforeError:function(e){null!=u&&u.onError(e),r._onError(e).catch(function(){})},afterComplete:function(e){null!=u&&u.onComplete(e),void 0!==e.db&&null!=(null==u?void 0:u.onDB)&&u.onDB(e.db),r._onComplete(e)}})];case 2:throw(0,ui.newError)("No connection available")}})})}).catch(function(e){null!=u&&u.onError(e),t._onError(e).catch(function(){})}).finally(function(){return t._acceptActive()})},si.prototype.run=function(e,t,r){e=(0,ti.validateQueryAndParameters)(e,t,{parameterRules:r}),t=e.validatedQuery,r=this._state.run(t,e.params,{connectionHolder:this._connectionHolder,onError:this._onError,onComplete:this._onComplete,onConnection:this._onConnection,reactive:this._reactive,fetchSize:this._fetchSize,highRecordWatermark:this._highRecordWatermark,lowRecordWatermark:this._lowRecordWatermark,preparationJob:this._activePromise});return this._results.push(r),r},si.prototype.commit=function(){var t=this,r=this._state.commit({connectionHolder:this._connectionHolder,onError:this._onError,onComplete:function(e){return t._onCompleteCallback(e,t._bookmarks)},onConnection:this._onConnection,pendingResults:this._results,preparationJob:this._activePromise});return this._state=r.state,this._onClose(),new Promise(function(e,t){r.result.subscribe({onCompleted:function(){return e()},onError:function(e){return t(e)}})})},si.prototype.rollback=function(){var r=this._state.rollback({connectionHolder:this._connectionHolder,onError:this._onError,onComplete:this._onComplete,onConnection:this._onConnection,pendingResults:this._results,preparationJob:this._activePromise});return this._state=r.state,this._onClose(),new Promise(function(e,t){r.result.subscribe({onCompleted:function(){return e()},onError:function(e){return t(e)}})})},si.prototype.isOpen=function(){return this._state===ci.ACTIVE},si.prototype.close=function(){return $o(this,void 0,void 0,function(){return ei(this,function(e){switch(e.label){case 0:return this.isOpen()?[4,this.rollback()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},si.prototype[Symbol.asyncDispose]=function(){return this.close()},si.prototype._onErrorCallback=function(t){return this._state===ci.FAILED?Promise.resolve(null):(this._state=ci.FAILED,this._onClose(),this._results.forEach(function(e){e.isOpen()&&e._streamObserverPromise.then(function(e){return e.onError(t)}).catch(function(e){})}),this._connectionHolder.releaseConnection())},si.prototype._onCompleteCallback=function(e,t){this._onBookmarks(new ni.Bookmarks(null==e?void 0:e.bookmark),null!=t?t:ni.Bookmarks.empty(),null==e?void 0:e.db)};var ci={ACTIVE:{commit:function(e){return{result:li(!0,e.connectionHolder,e.onError,e.onComplete,e.onConnection,e.pendingResults,e.preparationJob),state:ci.SUCCEEDED}},rollback:function(e){return{result:li(!1,e.connectionHolder,e.onError,e.onComplete,e.onConnection,e.pendingResults,e.preparationJob),state:ci.ROLLED_BACK}},run:function(t,r,e){var n=e.connectionHolder,o=e.onError,i=e.onComplete,u=e.onConnection,a=e.reactive,s=e.fetchSize,c=e.highRecordWatermark,l=e.lowRecordWatermark,e=e.preparationJob,f=null!=e?e:Promise.resolve();return fi(n.getConnection().then(function(e){return f.then(function(){return e})}).then(function(e){if(u(),null!=e)return e.run(t,r,{bookmarks:ni.Bookmarks.empty(),txConfig:oi.TxConfig.empty(),beforeError:o,afterComplete:i,reactive:a,fetchSize:s,highRecordWatermark:c,lowRecordWatermark:l});throw(0,ui.newError)("No connection available")}).catch(function(e){return new ii.FailedObserver({error:e,onError:o})}),t,r,n,c,l)}},FAILED:{commit:function(e){var t=e.connectionHolder,e=e.onError;return{result:fi(new ii.FailedObserver({error:(0,ui.newError)("Cannot commit this transaction, because it has been rolled back either because of an error or explicit termination."),onError:e}),"COMMIT",{},t,0,0),state:ci.FAILED}},rollback:function(e){e=e.connectionHolder;return{result:fi(new ii.CompletedObserver,"ROLLBACK",{},e,0,0),state:ci.FAILED}},run:function(e,t,r){var n=r.connectionHolder,r=r.onError;return fi(new ii.FailedObserver({error:(0,ui.newError)("Cannot run query in this transaction, because it has been rolled back either because of an error or explicit termination."),onError:r}),e,t,n,0,0)}},SUCCEEDED:{commit:function(e){var t=e.connectionHolder,e=e.onError;return{result:fi(new ii.FailedObserver({error:(0,ui.newError)("Cannot commit this transaction, because it has already been committed."),onError:e}),"COMMIT",{},ri.EMPTY_CONNECTION_HOLDER,0,0),state:ci.SUCCEEDED,connectionHolder:t}},rollback:function(e){var t=e.connectionHolder,e=e.onError;return{result:fi(new ii.FailedObserver({error:(0,ui.newError)("Cannot rollback this transaction, because it has already been committed."),onError:e}),"ROLLBACK",{},ri.EMPTY_CONNECTION_HOLDER,0,0),state:ci.SUCCEEDED,connectionHolder:t}},run:function(e,t,r){var n=r.connectionHolder,r=r.onError;return fi(new ii.FailedObserver({error:(0,ui.newError)("Cannot run query in this transaction, because it has already been committed."),onError:r}),e,t,n,0,0)}},ROLLED_BACK:{commit:function(e){var t=e.connectionHolder,e=e.onError;return{result:fi(new ii.FailedObserver({error:(0,ui.newError)("Cannot commit this transaction, because it has already been rolled back."),onError:e}),"COMMIT",{},t,0,0),state:ci.ROLLED_BACK}},rollback:function(e){e=e.connectionHolder;return{result:fi(new ii.FailedObserver({error:(0,ui.newError)("Cannot rollback this transaction, because it has already been rolled back.")}),"ROLLBACK",{},e,0,0),state:ci.ROLLED_BACK}},run:function(e,t,r){var n=r.connectionHolder,r=r.onError;return fi(new ii.FailedObserver({error:(0,ui.newError)("Cannot run query in this transaction, because it has already been rolled back."),onError:r}),e,t,n,0,0)}}};function li(r,e,n,o,i,u,t){var a=null!=t?t:Promise.resolve(),t=e.getConnection().then(function(e){return a.then(function(){return e})}).then(function(t){return i(),u.forEach(function(e){return e._cancel()}),Promise.all(u.map(function(e){return e.summary()})).then(function(e){if(null!=t)return r?t.commitTransaction({beforeError:n,afterComplete:o}):t.rollbackTransaction({beforeError:n,afterComplete:o});throw(0,ui.newError)("No connection available")})}).catch(function(e){return new ii.FailedObserver({error:e,onError:n})});return new ai.default(t,r?"COMMIT":"ROLLBACK",{},e,{high:Number.MAX_VALUE,low:Number.MAX_VALUE})}function fi(e,t,r,n,o,i){return void 0===n&&(n=ri.EMPTY_CONNECTION_HOLDER),new ai.default(Promise.resolve(e),t,r,new ri.ReadOnlyConnectionHolder(null!=n?n:ri.EMPTY_CONNECTION_HOLDER),{low:i,high:o})}Uo.default=si;so={};function pi(e){e=e.run;this._run=e}Object.defineProperty(so,"__esModule",{value:!0}),pi.fromTransaction=function(e){return new pi({run:e.run.bind(e)})},pi.prototype.run=function(e,t,r){return this._run(e,t,r)},so.default=pi;var di,hi,bi,bn={},Zn=r&&r.__extends||(di=function(e,t){return(di=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}di(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),yi=r&&r.__assign||function(){return(yi=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},S=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},o=(Object.defineProperty(bn,"__esModule",{value:!0}),S(Uo)),E=(bi=o.default,Zn(_i,bi),_i.prototype.then=function(e,t){return this._getOrCreateBeginPromise().then(e,t)},_i.prototype.catch=function(e){return this._getOrCreateBeginPromise().catch(e)},_i.prototype.finally=function(e){return this._getOrCreateBeginPromise().finally(e)},_i.prototype._getOrCreateBeginPromise=function(){var r=this;return null==this._beginPromise&&(this._beginPromise=new Promise(function(e,t){r._resolve=e,r._reject=t,null!=r._beginError&&t(r._beginError),null!=r._beginMetadata&&e(r._toTransaction())})),this._beginPromise},_i.prototype._toTransaction=function(){return yi(yi({},this),{run:bi.prototype.run.bind(this),commit:bi.prototype.commit.bind(this),rollback:bi.prototype.rollback.bind(this),close:bi.prototype.close.bind(this),isOpen:bi.prototype.isOpen.bind(this),_begin:this._begin.bind(this)})},_i.prototype._begin=function(e,t){return bi.prototype._begin.call(this,e,t,{onError:this._onBeginError.bind(this),onComplete:this._onBeginMetadata.bind(this),onDB:this._onDbCallback})},_i.prototype._onBeginError=function(e){this._beginError=e,null!=this._reject&&this._reject(e)},_i.prototype._onBeginMetadata=function(e){this._beginMetadata=null!=e?e:{},null!=this._resolve&&this._resolve(this._toTransaction())},_i);function _i(e){var t=e.connectionHolder,r=e.onDbCallback,t=bi.call(this,{connectionHolder:t,onClose:e.onClose,onBookmarks:e.onBookmarks,onConnection:e.onConnection,reactive:e.reactive,fetchSize:e.fetchSize,impersonatedUser:e.impersonatedUser,highRecordWatermark:e.highRecordWatermark,lowRecordWatermark:e.lowRecordWatermark,notificationFilter:e.notificationFilter,apiTelemetryConfig:e.apiTelemetryConfig})||this;return t[hi]="TransactionPromise",t._onDbCallback=r,t}hi=Symbol.toStringTag,bn.default=E;var bo={},P={},vi=(Object.defineProperty(P,"__esModule",{value:!0}),P.cacheKey=function(e,t){return null==t?void 0!==e?"basic"!==e.scheme?"kerberos"!==e.scheme?"bearer"!==e.scheme?"none"!==e.scheme?(0,vi.stringify)(e,{sortedElements:!0}):"none":"bearer:"+e.credentials:"kerberos:"+e.credentials:"basic:"+(null!=(e=e.principal)?e:""):"DEFAULT":"basic:"+t},F);var mi=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},gi=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))s.label=t[1];else if(6===t[0]&&s.label<a[1])s.label=a[1],a=t;else{if(!(a&&s.label<a[2])){a[2]&&s.ops.pop(),s.trys.pop();continue}s.label=a[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Oi=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},wi=r&&r.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||((n=n||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},S=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Ei=(Object.defineProperty(bo,"__esModule",{value:!0}),Ar),Pi=a,Ti=v,Si=t,ji=S(G),Ci=m,Ii=w,Ri=_,Ai=O,Mi=S(bn),Ni=S(so),ki=P;function xi(e){var t=e.mode,r=e.connectionProvider,n=e.bookmarks,o=e.database,i=e.config,u=e.reactive,a=e.fetchSize,s=e.impersonatedUser,c=e.bookmarkManager,l=e.notificationFilter,f=e.auth,p=e.log,d=e.homeDatabaseCallback,e=e.disableAutoCommitRetries,t=(this._mode=t,this._database=o,this._reactive=u,this._fetchSize=a,this._homeDatabaseCallback=d,this._auth=f,this._getConnectionAcquistionBookmarks=this._getConnectionAcquistionBookmarks.bind(this),this._readConnectionHolder=new Ci.ConnectionHolder({mode:Ti.ACCESS_MODE_READ,auth:f,database:o,bookmarks:n,connectionProvider:r,impersonatedUser:s,onDatabaseNameResolved:this._onDatabaseNameResolved.bind(this),getConnectionAcquistionBookmarks:this._getConnectionAcquistionBookmarks,log:p}),this._writeConnectionHolder=new Ci.ConnectionHolder({mode:Ti.ACCESS_MODE_WRITE,auth:f,database:o,bookmarks:n,connectionProvider:r,impersonatedUser:s,onDatabaseNameResolved:this._onDatabaseNameResolved.bind(this),getConnectionAcquistionBookmarks:this._getConnectionAcquistionBookmarks,log:p}),this._open=!0,this._hasTx=!1,this._impersonatedUser=s,this._lastBookmarks=null!=n?n:Ri.Bookmarks.empty(),this._configuredBookmarks=this._lastBookmarks,this._transactionExecutor=(e=>(e=null!=(e=null==e?void 0:e.maxTransactionRetryTime)?e:null,new Ii.TransactionExecutor(e)))(i),this._databaseNameResolved=""!==this._database,this._calculateWatermaks());this._lowRecordWatermark=t.low,this._highRecordWatermark=t.high,this._results=[],this._bookmarkManager=c,this._notificationFilter=l,this._log=p,this._databaseGuess=null==i?void 0:i.cachedHomeDatabase,this._isRoutingSession=null!=(u=null==i?void 0:i.routingDriver)&&u,this._disableAutoCommitRetries=null!=(a=null!=e?e:null==i?void 0:i.disableAutoCommitRetries)&&a}xi.prototype.run=function(e,t,r,n){var i=this,e=(0,Pi.validateQueryAndParameters)(e,t,{parameterRules:n}),u=e.validatedQuery,a=e.params,s=null!=r?new Ai.TxConfig(r,this._log):Ai.TxConfig.empty(),t=this._run(u,a,function(n,o){return mi(i,void 0,void 0,function(){var t,r=this;return gi(this,function(e){switch(e.label){case 0:return[4,this._bookmarks()];case 1:return t=e.sent(),this._assertSessionIsOpen(),[2,n.run(u,a,{bookmarks:t,txConfig:s,mode:this._mode,database:this._database,apiTelemetryConfig:!0===o?void 0:{api:Ti.TELEMETRY_APIS.AUTO_COMMIT_TRANSACTION},impersonatedUser:this._impersonatedUser,afterComplete:function(e){return r._onCompleteCallback(e,t)},reactive:this._reactive,fetchSize:this._fetchSize,lowRecordWatermark:this._lowRecordWatermark,highRecordWatermark:this._highRecordWatermark,notificationFilter:this._notificationFilter,onDb:this._onDatabaseNameResolved.bind(this)})]}})})});return this._results.push(t),t},xi.prototype._run=function(e,t,r){var n=this,o=this._acquireAndConsumeConnection(r),i=o.connectionHolder,o=o.resultPromise.catch(function(e){return Promise.resolve(new Ei.FailedObserver({error:e}))}),u={high:this._highRecordWatermark,low:this._lowRecordWatermark},a=this._disableAutoCommitRetries?void 0:function(){return n._acquireAndConsumeConnection(r,!0).resultPromise.catch(function(e){return Promise.resolve(new Ei.FailedObserver({error:e}))})};return new ji.default(o,e,t,i,u,a)},xi.prototype._acquireConnection=function(e){var r=this,e=this._acquireAndConsumeConnection(e),n=e.connectionHolder;return e.resultPromise.then(function(t){return mi(r,void 0,void 0,function(){return gi(this,function(e){switch(e.label){case 0:return[4,n.releaseConnection()];case 1:return e.sent(),[2,t]}})})})},xi.prototype._acquireAndConsumeConnection=function(t,r){var e=this._connectionHolderWithMode(this._mode),n=this._open?this._hasTx||!0!==r&&!e.initializeConnection(this._databaseGuess)?Promise.reject((0,Si.newError)("Queries cannot be run directly on a session with ongoing work; either await the previous work, run in an existing transaction or use a different session.")):e.getConnection().then(function(e){return t(e,r)}):Promise.reject((0,Si.newError)("Cannot run query in a closed session."));return{connectionHolder:e,resultPromise:n}},xi.prototype.beginTransaction=function(e){var t=Ai.TxConfig.empty();return null!=e&&(t=new Ai.TxConfig(e,this._log)),this._beginTransaction(this._mode,t,{api:Ti.TELEMETRY_APIS.UNMANAGED_TRANSACTION})},xi.prototype._beginTransaction=function(e,t,r){var n=this;if(!this._open)throw(0,Si.newError)("Cannot begin a transaction on a closed session.");if(this._hasTx)throw(0,Si.newError)("You cannot begin a transaction on a session with ongoing work; either run from within an existing transaction or use a different session.");e=xi._validateSessionMode(e),e=this._connectionHolderWithMode(e),e.initializeConnection(this._databaseGuess),this._hasTx=!0,e=new Mi.default({connectionHolder:e,impersonatedUser:this._impersonatedUser,onClose:this._transactionClosed.bind(this),onBookmarks:function(e,t,r){return n._updateBookmarks(e,t,r)},onConnection:this._assertSessionIsOpen.bind(this),reactive:this._reactive,fetchSize:this._fetchSize,lowRecordWatermark:this._lowRecordWatermark,highRecordWatermark:this._highRecordWatermark,notificationFilter:this._notificationFilter,apiTelemetryConfig:r,onDbCallback:this._onDatabaseNameResolved.bind(this)});return e._begin(function(){return n._bookmarks()},t),e},xi.prototype._assertSessionIsOpen=function(){if(!this._open)throw(0,Si.newError)("You cannot run more transactions on a closed session.")},xi.prototype._transactionClosed=function(){this._hasTx=!1},xi.prototype.lastBookmarks=function(){return this._lastBookmarks.values()},xi.prototype._bookmarks=function(){return mi(this,void 0,void 0,function(){var t;return gi(this,function(e){switch(e.label){case 0:return[4,null==(t=this._bookmarkManager)?void 0:t.getBookmarks()];case 1:return void 0===(t=e.sent())?[2,this._lastBookmarks]:[2,new Ri.Bookmarks(wi(wi([],Oi(t),!1),Oi(this._configuredBookmarks),!1))]}})})},xi.prototype.executeRead=function(e,t){t=new Ai.TxConfig(t,this._log);return this._executeInTransaction(Ti.ACCESS_MODE_READ,t,e)},xi.prototype.executeWrite=function(e,t){t=new Ai.TxConfig(t,this._log);return this._executeInTransaction(Ti.ACCESS_MODE_WRITE,t,e)},xi.prototype._executeInTransaction=function(t,r,e){var n=this;return this._transactionExecutor.execute(function(e){return n._beginTransaction(t,r,e)},e,Ni.default.fromTransaction)},xi.prototype._onDatabaseNameResolved=function(e){var t;this._isRoutingSession&&(this._databaseGuess=e,this._databaseNameResolved||(this._database=t=null!=e?e:"",this._readConnectionHolder.setDatabase(t),this._writeConnectionHolder.setDatabase(t),this._databaseNameResolved=!0,null!=this._homeDatabaseCallback&&this._homeDatabaseCallback((0,ki.cacheKey)(this._auth,this._impersonatedUser),e)))},xi.prototype._getConnectionAcquistionBookmarks=function(){return mi(this,void 0,void 0,function(){var t;return gi(this,function(e){switch(e.label){case 0:return[4,null==(t=this._bookmarkManager)?void 0:t.getBookmarks()];case 1:return void 0===(t=e.sent())?[2,this._lastBookmarks]:[2,new Ri.Bookmarks(wi(wi([],Oi(this._configuredBookmarks),!1),Oi(t),!1))]}})})},xi.prototype._updateBookmarks=function(e,t,r){var n;null==e||e.isEmpty()||(null!=(n=this._bookmarkManager)&&n.updateBookmarks(null!=(n=null==t?void 0:t.values())?n:[],null!=(t=null==e?void 0:e.values())?t:[]).catch(function(){}),this._lastBookmarks=e,this._configuredBookmarks=Ri.Bookmarks.empty())},xi.prototype.close=function(){return mi(this,void 0,void 0,function(){return gi(this,function(e){switch(e.label){case 0:return this._open?(this._open=!1,this._results.forEach(function(e){return e._cancel()}),this._transactionExecutor.close(),[4,this._readConnectionHolder.close(this._hasTx)]):[3,3];case 1:return e.sent(),[4,this._writeConnectionHolder.close(this._hasTx)];case 2:e.sent(),e.label=3;case 3:return[2]}})})},xi.prototype[Symbol.asyncDispose]=function(){return this.close()},xi.prototype._connectionHolderWithMode=function(e){if(e===Ti.ACCESS_MODE_READ)return this._readConnectionHolder;if(e===Ti.ACCESS_MODE_WRITE)return this._writeConnectionHolder;throw(0,Si.newError)("Unknown access mode: "+e)},xi.prototype._onCompleteCallback=function(e,t){this._updateBookmarks(new Ri.Bookmarks(e.bookmark),t,e.db)},xi.prototype._calculateWatermaks=function(){return this._fetchSize===Ti.FETCH_ALL?{low:Number.MAX_VALUE,high:Number.MAX_VALUE}:{low:.3*this._fetchSize,high:.7*this._fetchSize}},xi.prototype._configureTransactionExecutor=function(e,t){this._transactionExecutor.pipelineBegin=e,this._transactionExecutor.telemetryApi=t},xi._validateSessionMode=function(e){e=null!=e?e:Ti.ACCESS_MODE_WRITE;if(e!==Ti.ACCESS_MODE_READ&&e!==Ti.ACCESS_MODE_WRITE)throw(0,Si.newError)("Illegal session mode "+e);return e},bo.default=xi;var o={},Zn={},Di=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},Ui=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))s.label=t[1];else if(6===t[0]&&s.label<a[1])s.label=a[1],a=t;else{if(!(a&&s.label<a[2])){a[2]&&s.ops.pop(),s.trys.pop();continue}s.label=a[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Li=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Fi=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Bi=r&&r.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||((n=n||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},E=(Object.defineProperty(Zn,"__esModule",{value:!0}),Zn.bookmarkManager=function(e){void 0===e&&(e={});var t=new Set(e.initialBookmarks);return new qi(t,e.bookmarksSupplier,e.bookmarksConsumer)},Vi.prototype.updateBookmarks=function(e,t){return Di(this,void 0,void 0,function(){return Ui(this,function(e){throw new Error("Not implemented")})})},Vi.prototype.getBookmarks=function(){return Di(this,void 0,void 0,function(){return Ui(this,function(e){throw new Error("Not implemented")})})},Vi);function Vi(){throw new Error("Not implemented")}Zn.default=E;Wi.prototype.updateBookmarks=function(f,p){return Di(this,void 0,void 0,function(){var t,r,n,o,i,u,a,s,c,l;return Ui(this,function(e){switch(e.label){case 0:t=this._bookmarks;try{for(r=Li(f),n=r.next();!n.done;n=r.next())u=n.value,t.delete(u)}catch(e){a={error:e}}finally{try{n&&!n.done&&(s=r.return)&&s.call(r)}finally{if(a)throw a.error}}try{for(o=Li(p),i=o.next();!i.done;i=o.next())u=i.value,t.add(u)}catch(e){c={error:e}}finally{try{i&&!i.done&&(l=o.return)&&l.call(o)}finally{if(c)throw c.error}}return"function"!=typeof this._bookmarksConsumer?[3,2]:[4,this._bookmarksConsumer(Bi([],Fi(t),!1))];case 1:e.sent(),e.label=2;case 2:return[2]}})})},Wi.prototype.getBookmarks=function(){return Di(this,void 0,void 0,function(){var t,r,n,o,i,u,a;return Ui(this,function(e){switch(e.label){case 0:return t=new Set(this._bookmarks),"function"!=typeof this._bookmarksSupplier?[3,2]:[4,this._bookmarksSupplier()];case 1:a=null!=(a=e.sent())?a:[];try{for(r=Li(a),n=r.next();!n.done;n=r.next())o=n.value,t.add(o)}catch(e){i={error:e}}finally{try{n&&!n.done&&(u=r.return)&&u.call(r)}finally{if(i)throw i.error}}e.label=2;case 2:return[2,Bi([],Fi(t),!1)]}})})};var qi=Wi;function Wi(e,t,r){this._bookmarks=e,this._bookmarksSupplier=t,this._bookmarksConsumer=r}var Ar={},zi=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},Hi=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))s.label=t[1];else if(6===t[0]&&s.label<a[1])s.label=a[1],a=t;else{if(!(a&&s.label<a[2])){a[2]&&s.ops.pop(),s.trys.pop();continue}s.label=a[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},m=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Gi=(Object.defineProperty(Ar,"__esModule",{value:!0}),m(T)),Yi=t;function Ki(){}Ki.prototype.eagerResultTransformer=function(){return Zi},Ki.prototype.eager=function(){return Zi},Ki.prototype.mappedResultTransformer=function(e){return Qi(e)},Ki.prototype.mapped=function(e){return Qi(e)},Ki.prototype.first=function(){return Xi},Ki.prototype.summary=function(){return Ji},Ki.prototype.hydrated=function(r,n){var e=this;return function(t){return zi(e,void 0,void 0,function(){return Hi(this,function(e){switch(e.label){case 0:return[4,t.as(r,n).then()];case 1:return[2,e.sent()]}})})}};w=new Ki;function Zi(o){return zi(this,void 0,void 0,function(){var t,r,n;return Hi(this,function(e){switch(e.label){case 0:return[4,o];case 1:return r=e.sent(),t=r.summary,r=r.records,[4,o.keys()];case 2:return n=e.sent(),[2,new Gi.default(n,r,t)]}})})}function Qi(i){var e=this;if(null==i||null==i.collect&&null==i.map)throw(0,Yi.newError)("Requires a map or/and a collect functions.");return function(o){return zi(e,void 0,void 0,function(){return Hi(this,function(e){switch(e.label){case 0:return[4,new Promise(function(t,r){var n={records:[],keys:[]};o.subscribe({onKeys:function(e){n.keys=e},onNext:function(e){var t;null!=i.map?void 0!==(t=i.map(e))&&n.records.push(t):n.records.push(e)},onCompleted:function(e){null!=i.collect?t(i.collect(n.records,e,n.keys)):t({records:n.records,summary:e,keys:n.keys})},onError:function(e){r(e)}})})];case 1:return[2,e.sent()]}})})}}function Xi(o){return zi(this,void 0,void 0,function(){var t,r,n;return Hi(this,function(e){switch(e.label){case 0:return[4,(t=o[Symbol.asyncIterator]()).next()];case 1:n=e.sent(),r=n.value,n=n.done,e.label=2;case 2:return e.trys.push([2,,3,6]),!0===n?[2,void 0]:[2,r];case 3:return null==t.return?[3,5]:[4,t.return()];case 4:e.sent(),e.label=5;case 5:return[7];case 6:return[2]}})})}function Ji(t){return zi(this,void 0,void 0,function(){return Hi(this,function(e){switch(e.label){case 0:return[4,t.summary()];case 1:return[2,e.sent()]}})})}Object.freeze(w),Ar.default=w;var O={},$i=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},eu=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))s.label=t[1];else if(6===t[0]&&s.label<a[1])s.label=a[1],a=t;else{if(!(a&&s.label<a[2])){a[2]&&s.ops.pop(),s.trys.pop();continue}s.label=a[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},tu=(Object.defineProperty(O,"__esModule",{value:!0}),v);function ru(e){this._createSession=e}ru.prototype.execute=function(o,i,u,a){return $i(this,void 0,void 0,function(){var t,r,n=this;return eu(this,function(e){switch(e.label){case 0:t=this._createSession({database:o.database,bookmarkManager:o.bookmarkManager,impersonatedUser:o.impersonatedUser,auth:o.auth}),r=((e,t,r)=>("function"==typeof(null==e?void 0:e.addEventListener)&&e.addEventListener(t,r),{uninstall:function(){"function"==typeof(null==e?void 0:e.removeEventListener)&&e.removeEventListener(t,r)}}))(o.signal,"abort",function(){return $i(n,void 0,void 0,function(){return eu(this,function(e){switch(e.label){case 0:return[4,t.close()];case 1:return[2,e.sent()]}})})}),t._configureTransactionExecutor(!0,tu.TELEMETRY_APIS.EXECUTE_QUERY),e.label=1;case 1:return e.trys.push([1,,3,5]),[4,("READ"===o.routing?t.executeRead:t.executeWrite).bind(t)(function(r){return $i(n,void 0,void 0,function(){var t;return eu(this,function(e){switch(e.label){case 0:return t=r.run(i,u,a),[4,o.resultTransformer(t)];case 1:return[2,e.sent()]}})})},o.transactionConfig)];case 2:return[2,e.sent()];case 3:return r.uninstall(),[4,t.close()];case 4:return e.sent(),[7];case 5:return[2]}})})},O.default=ru;S={};function nu(e){this.maxSize=e,this.pruneCount=Math.max(Math.round(.01*e*Math.log(e)),1),this.map=new Map}Object.defineProperty(S,"__esModule",{value:!0}),nu.prototype.set=function(e,t){this.map.set(e,{database:t,lastUsed:Date.now()}),this._pruneCache()},nu.prototype.get=function(e){e=this.map.get(e);if(void 0!==e)return e.lastUsed=Date.now(),e.database},nu.prototype.delete=function(e){this.map.delete(e)},nu.prototype._pruneCache=function(){if(this.map.size>this.maxSize)for(var e=Array.from(this.map.entries()).sort(function(e,t){return e[1].lastUsed-t[1].lastUsed}),t=0;t<this.pruneCount;t++)this.map.delete(e[t][0])},S.default=nu;function ou(){this.routing=Tu.WRITE,this.resultTransformer=void 0,this.database="",this.impersonatedUser=void 0,this.bookmarkManager=void 0,this.transactionConfig=void 0,this.auth=void 0,this.signal=void 0}var iu=r&&r.__assign||function(){return(iu=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},uu=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},au=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))s.label=t[1];else if(6===t[0]&&s.label<a[1])s.label=a[1],a=t;else{if(!(a&&s.label<a[2])){a[2]&&s.ops.pop(),s.trys.pop();continue}s.label=a[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},E=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},su=(Object.defineProperty(o,"__esModule",{value:!0}),o.QueryConfig=o.SessionConfig=o.routing=o.WRITE=o.READ=o.Driver=void 0,_),cu=E(ro),lu=v,fu=g,pu=E(bo),du=a,hu=Zn,bu=E(Ar),yu=E(O),_u=t,vu=E(S),mu=P,gu=36e5,Ou=1e3,wu=lu.ACCESS_MODE_READ,Eu=(o.READ=wu,lu.ACCESS_MODE_WRITE),Pu=(o.WRITE=Eu,0),Tu=(o.SessionConfig=function(){this.defaultAccessMode=Eu,this.bookmarks=[],this.database="",this.impersonatedUser=void 0,this.auth=void 0,this.fetchSize=void 0,this.bookmarkManager=void 0,this.notificationFilter=void 0,this.disableAutoCommitRetries=void 0},{WRITE:"WRITE",READ:"READ"}),m=(o.routing=Tu,Object.freeze(Tu),o.QueryConfig=ou,Object.defineProperty(Su.prototype,"executeQueryBookmarkManager",{get:function(){return this._defaultExecuteQueryBookmarkManager},enumerable:!1,configurable:!0}),Su.prototype.executeQuery=function(e,t){return uu(this,arguments,void 0,function(t,r,n,o){var i,u,a;return void 0===n&&(n={}),au(this,function(e){switch(e.label){case 0:if(i=null===n.bookmarkManager?void 0:null!=(i=n.bookmarkManager)?i:this.executeQueryBookmarkManager,u=null!=(u=n.resultTransformer)?u:bu.default.eager(),(a=null!=(a=n.routing)?a:Tu.WRITE)!==Tu.READ&&a!==Tu.WRITE)throw(0,_u.newError)('Illegal query routing config: "'.concat(a,'"'));return[4,this._queryExecutor.execute({resultTransformer:u,bookmarkManager:i,routing:a,database:n.database,impersonatedUser:n.impersonatedUser,transactionConfig:n.transactionConfig,auth:n.auth,signal:n.signal},t,r,o)];case 1:return[2,e.sent()]}})})},Su.prototype.verifyConnectivity=function(e){var e=(void 0===e?{}:e).database,r=void 0===e?"":e,n=this._getOrCreateConnectionProvider();return new Promise(function(e,t){n.verifyConnectivityAndGetServerInfo({database:r,accessMode:wu}).then(function(){return e()}).catch(function(e){return t(e)})})},Su.prototype.verifyAuthentication=function(){return uu(this,arguments,void 0,function(e){var e=void 0===e?{}:e,t=e.database,r=e.auth;return au(this,function(e){switch(e.label){case 0:return[4,this._getOrCreateConnectionProvider().verifyAuthentication({database:null!=t?t:"system",auth:r,accessMode:wu})];case 1:return[2,e.sent()]}})})},Su.prototype.getServerInfo=function(e){e=(void 0===e?{}:e).database,e=void 0===e?"":e;return this._getOrCreateConnectionProvider().verifyConnectivityAndGetServerInfo({database:e,accessMode:wu})},Su.prototype.supportsMultiDb=function(){return this._getOrCreateConnectionProvider().supportsMultiDb()},Su.prototype.supportsTransactionConfig=function(){return this._getOrCreateConnectionProvider().supportsTransactionConfig()},Su.prototype.supportsUserImpersonation=function(){return this._getOrCreateConnectionProvider().supportsUserImpersonation()},Su.prototype.supportsSessionAuth=function(){return this._getOrCreateConnectionProvider().supportsSessionAuth()},Su.prototype.getNegotiatedProtocolVersion=function(){return this._getOrCreateConnectionProvider().getNegotiatedProtocolVersion()},Su.prototype.isEncrypted=function(){return this._isEncrypted()},Su.prototype._supportsRouting=function(){return this._meta.routing},Su.prototype._isEncrypted=function(){return this._config.encrypted===du.ENCRYPTION_ON||!0===this._config.encrypted},Su.prototype._getTrust=function(){return this._config.trust},Su.prototype.session=function(e){var e=void 0===e?{}:e,t=e.defaultAccessMode,r=e.database,n=e.bookmarkManager,o=e.notificationFilter,i=e.auth,u=e.disableAutoCommitRetries;return this._newSession({defaultAccessMode:void 0===t?Eu:t,bookmarkOrBookmarks:e.bookmarks,database:void 0===r?"":r,reactive:!1,impersonatedUser:e.impersonatedUser,fetchSize:Cu(e.fetchSize,this._config.fetchSize),bookmarkManager:n,notificationFilter:o,auth:i,disableAutoCommitRetries:u})},Su.prototype.close=function(){return this._log.info("Driver ".concat(this._id," closing")),null!=this._connectionProvider?this._connectionProvider.close():Promise.resolve()},Su.prototype[Symbol.asyncDispose]=function(){return this.close()},Su.prototype._afterConstruction=function(){this._log.info("".concat(this._meta.typename," driver ").concat(this._id," created for server address ").concat(this._meta.address.toString()))},Su.prototype._homeDatabaseCallback=function(e,t){this.homeDatabaseCache.set(e,t)},Su.prototype._newSession=function(e){var t=e.defaultAccessMode,r=e.bookmarkOrBookmarks,n=e.database,o=e.reactive,i=e.impersonatedUser,u=e.fetchSize,a=e.bookmarkManager,s=e.notificationFilter,c=e.auth,e=e.disableAutoCommitRetries,t=pu.default._validateSessionMode(t),l=this._getOrCreateConnectionProvider(),f=this.homeDatabaseCache.get((0,mu.cacheKey)(c,i)),p=this._homeDatabaseCallback.bind(this),r=null!=r?new su.Bookmarks(r):su.Bookmarks.empty();return this._createSession({mode:t,database:null!=n?n:"",connectionProvider:l,bookmarks:r,config:iu({cachedHomeDatabase:f,routingDriver:this._supportsRouting()},this._config),reactive:o,impersonatedUser:i,fetchSize:u,bookmarkManager:a,notificationFilter:s,auth:c,log:this._log,homeDatabaseCallback:p,disableAutoCommitRetries:e})},Su.prototype._getOrCreateConnectionProvider=function(){var e;return null==this._connectionProvider&&(this._connectionProvider=this._createConnectionProvider(this._id,this._config,this._log,(e=this._config,new cu.default(e.resolver)))),this._connectionProvider},Su);function Su(e,t,r,n,o){void 0===n&&(n=function(e){return new pu.default(e)}),void 0===o&&(o=function(e){return new yu.default(e)}),(i=t=void 0===t?{}:t).maxConnectionLifetime=ju(i.maxConnectionLifetime,gu),i.maxConnectionPoolSize=ju(i.maxConnectionPoolSize,lu.DEFAULT_POOL_MAX_SIZE),i.connectionAcquisitionTimeout=ju(i.connectionAcquisitionTimeout,lu.DEFAULT_POOL_ACQUISITION_TIMEOUT),i.fetchSize=Cu(i.fetchSize,Ou),i.connectionTimeout=(e=>0===(e=parseInt(e.connectionTimeout,10))||!isNaN(e)&&e<0?null:isNaN(e)?lu.DEFAULT_CONNECTION_TIMEOUT_MILLIS:e)(i),i.connectionLivenessCheckTimeout=(e=>{if(null!=e){if((e=parseInt(e,10))<0||Number.isNaN(e))throw new Error("The connectionLivenessCheckTimeout can only be a positive value or 0 for always. However connectionLivenessCheckTimeout = ".concat(e));return e}})(i.connectionLivenessCheckTimeout);var i=fu.Logger.create(t);((e,t)=>{var r=e.resolver;if(null!=r&&"function"!=typeof r)throw new TypeError("Configured resolver should be a function. Got: ".concat(typeof r));if(e.connectionAcquisitionTimeout<e.connectionTimeout&&t.warn('Configuration for "connectionAcquisitionTimeout" should be greater than or equal to "connectionTimeout". Otherwise, the connection acquisition timeout will take precedence for over the connection timeout in scenarios where a new connection is created while it is acquired'),null==(null==(r=e.notificationFilter)?void 0:r.disabledCategories)||null==(null==(t=e.notificationFilter)?void 0:t.disabledClassifications))return;throw new Error('The notificationFilter can\'t have both "disabledCategories" and "disabledClassifications" configured at the same time.')})(t,i),this._id=Pu++,this._meta=e,this._config=t,this._log=i,this._createConnectionProvider=r,this._createSession=n,this._defaultExecuteQueryBookmarkManager=(0,hu.bookmarkManager)(),this._queryExecutor=o(this.session.bind(this)),this._connectionProvider=null,this.homeDatabaseCache=new vu.default(1e4),this._afterConstruction()}function ju(e,t){e=parseInt(e,10);return 0<e||0===e?e:e<0?Number.MAX_SAFE_INTEGER:t}function Cu(e,t){e=parseInt(e,10);if(0<e||e===lu.FETCH_ALL)return e;if(0===e||e<0)throw new Error("The fetch size can only be a positive value or ".concat(lu.FETCH_ALL," for ALL. However fetchSize = ").concat(e));return t}o.Driver=m,o.default=m;var w={},Iu=(Object.defineProperty(w,"__esModule",{value:!0}),t),Ru=F;function Au(e){return null!=e&&""!==e&&(Object.getPrototypeOf(e)!==Object.prototype||0!==Object.keys(e).length)}w.default={basic:function(e,t,r){return null!=r?{scheme:"basic",principal:e,credentials:t,realm:r}:{scheme:"basic",principal:e,credentials:t}},kerberos:function(e){return{scheme:"kerberos",principal:"",credentials:e}},bearer:function(e){return{scheme:"bearer",credentials:e}},none:function(){return{scheme:"none"}},custom:function(e,t,r,n,o){n={scheme:n,principal:e};if(Au(t)&&(n.credentials=t),Au(r)&&(n.realm=r),Au(o)){try{(0,Ru.stringify)(o)}catch(e){throw(0,Iu.newError)("Circular references in custom auth token parameters",void 0,e)}n.parameters=o}return n}};var _={},Mu=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},Nu=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))s.label=t[1];else if(6===t[0]&&s.label<a[1])s.label=a[1],a=t;else{if(!(a&&s.label<a[2])){a[2]&&s.ops.pop(),s.trys.pop();continue}s.label=a[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},ro=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ku=(Object.defineProperty(_,"__esModule",{value:!0}),_.authTokenManagers=_.AuthTokenAndExpiration=void 0,_.staticAuthTokenManager=function(e){e=e.authToken;return new qu(e)},ro(w)),xu=y;function Du(){}function Uu(){}Du.prototype.getToken=function(){throw new Error("Not Implemented")},Du.prototype.handleSecurityException=function(e,t){throw new Error("Not implemented")},_.default=Du,_.AuthTokenAndExpiration=function(){this.token=ku.default.none(),this.expiration=void 0},Uu.prototype.bearer=function(e){e=e.tokenProvider;if("function"!=typeof e)throw new TypeError("tokenProvider should be function, but got: ".concat(typeof e));return new Bu(e,["Neo.ClientError.Security.Unauthorized","Neo.ClientError.Security.TokenExpired"])},Uu.prototype.basic=function(e){var t=this,r=e.tokenProvider;if("function"!=typeof r)throw new TypeError("tokenProvider should be function, but got: ".concat(typeof r));return new Bu(function(){return Mu(t,void 0,void 0,function(){var t;return Nu(this,function(e){switch(e.label){case 0:return t={},[4,r()];case 1:return[2,(t.token=e.sent(),t)]}})})},["Neo.ClientError.Security.Unauthorized"])};v=new Uu;_.authTokenManagers=v,Object.freeze(v);Fu.prototype.subscribe=function(e){this._subscribers.push(e)},Fu.prototype.onCompleted=function(t){this._subscribers.forEach(function(e){return e.onCompleted(t)})},Fu.prototype.onError=function(t){this._subscribers.forEach(function(e){return e.onError(t)})};var Lu=Fu;function Fu(e){this._subscribers=e=void 0===e?[]:e}Vu.prototype.getToken=function(){return Mu(this,void 0,void 0,function(){var t;return Nu(this,function(e){switch(e.label){case 0:return void 0===this._currentAuthData||void 0!==this._currentAuthData.expiration&&this._currentAuthData.expiration<new Date?[4,this._refreshAuthToken()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2,null==(t=this._currentAuthData)?void 0:t.token]}})})},Vu.prototype.handleSecurityException=function(e,t){return!!this._handledSecurityCodes.includes(t)&&(xu.util.equals(e,null==(t=this._currentAuthData)?void 0:t.token)&&this._scheduleRefreshAuthToken(),!0)},Vu.prototype._scheduleRefreshAuthToken=function(e){var r=this;void 0===this._refreshObservable&&(this._currentAuthData=void 0,this._refreshObservable=new Lu,Promise.resolve(this._tokenProvider()).then(function(e){var t;r._currentAuthData=e,null!=(t=r._refreshObservable)&&t.onCompleted(e)}).catch(function(e){var t;null!=(t=r._refreshObservable)&&t.onError(e)}).finally(function(){r._refreshObservable=void 0})),void 0!==e&&this._refreshObservable.subscribe(e)},Vu.prototype._refreshAuthToken=function(){return Mu(this,void 0,void 0,function(){var r=this;return Nu(this,function(e){switch(e.label){case 0:return[4,new Promise(function(e,t){r._scheduleRefreshAuthToken({onCompleted:e,onError:t})})];case 1:return[2,e.sent()]}})})};var Bu=Vu;function Vu(e,t,r,n){this._tokenProvider=e,this._handledSecurityCodes=t,this._currentAuthData=r,this._refreshObservable=n}Wu.prototype.getToken=function(){return this._authToken},Wu.prototype.handleSecurityException=function(e,t){return!1};var qu=Wu;function Wu(e){this._authToken=e}function zu(){this.encrypted=void 0,this.trust=void 0,this.trustedCertificates=[],this.maxConnectionPoolSize=100,this.maxConnectionLifetime=36e5,this.connectionAcquisitionTimeout=6e4,this.maxTransactionRetryTime=3e4,this.connectionLivenessCheckTimeout=void 0,this.connectionTimeout=3e4,this.disableLosslessIntegers=!1,this.useBigInt=!1,this.logging=void 0,this.resolver=void 0,this.notificationFilter=void 0,this.userAgent=void 0,this.telemetryDisabled=!1,this.clientCertificate=void 0}var Hu,Gu,g={},a=r&&r.__extends||(Hu=function(e,t){return(Hu=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Hu(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),O=(Object.defineProperty(g,"__esModule",{value:!0}),g.InternalConfig=g.Config=void 0,g.Config=zu,a(Yu,Gu=zu),Yu);function Yu(){return null!==Gu&&Gu.apply(this,arguments)||this}g.InternalConfig=O;var Ku,Zu,E={},S=r&&r.__extends||(Ku=function(e,t){return(Ku=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ku(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Qu=r&&r.__assign||function(){return(Qu=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Xu=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),Ju=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),P=r&&r.__importStar||(Zu=function(e){return(Zu=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=Zu(e),n=0;n<r.length;n++)"default"!==r[n]&&Xu(t,e,r[n]);return Ju(t,e),t}),$u=(Object.defineProperty(E,"__esModule",{value:!0}),E.clientCertificateProviders=E.RotatingClientCertificateProvider=E.ClientCertificateProvider=void 0,E.resolveCertificateProvider=function(e){if(null==e)return;if("object"==typeof e&&"hasUpdate"in e&&"getClientCertificate"in e&&"function"==typeof e.getClientCertificate&&"function"==typeof e.hasUpdate)return e;{var t;if(oa(e))return t=Qu({},e),{getClientCertificate:function(){return t},hasUpdate:function(){return!1}}}throw new TypeError("clientCertificate should be configured with ClientCertificate or ClientCertificateProvider, but got ".concat($u.stringify(e)))},P(F)),m=(E.default=function(){this.certfile="",this.keyfile="",this.password=void 0},ea.prototype.hasUpdate=function(){throw new Error("Not Implemented")},ea.prototype.getClientCertificate=function(){throw new Error("Not Implemented")},ea);function ea(){}E.ClientCertificateProvider=m;S(ra,ta=m),ra.prototype.updateCertificate=function(e){throw new Error("Not implemented")};var ta,ro=ra;function ra(){return null!==ta&&ta.apply(this,arguments)||this}function na(){}E.RotatingClientCertificateProvider=ro,na.prototype.rotating=function(e){var t,e=e.initialCertificate;if(null!=e&&oa(e))return t=Qu({},e),new sa(t);throw new TypeError("initialCertificate should be ClientCertificate, but got ".concat($u.stringify(e)))};v=new na;function oa(e){return null!=e&&"object"==typeof e&&"certfile"in e&&(ia(r=e.certfile)||ua(r,ia))&&"keyfile"in e&&(t(r=e.keyfile)||ua(r,t))&&aa("password",e);function t(e){return"string"==typeof e||null!=e&&"object"==typeof e&&"path"in e&&"string"==typeof e.path&&aa("password",e)}var r}function ia(e){return"string"==typeof e}function ua(e,t,r){return void 0===r&&(r=!1),Array.isArray(e)&&(r||0<e.length)&&e.filter(t).length===e.length}function aa(e,t){return!(e in t)||null==t[e]||"string"==typeof t[e]}E.clientCertificateProviders=v,Object.freeze(v);ca.prototype.hasUpdate=function(){try{return this._updated}finally{this._updated=!1}},ca.prototype.getClientCertificate=function(){return this._certificate},ca.prototype.updateCertificate=function(e){if(!oa(e))throw new TypeError("certificate should be ClientCertificate, but got ".concat($u.stringify(e)));this._certificate=Qu({},e),this._updated=!0};var sa=ca;function ca(e,t){void 0===t&&(t=!1),this._certificate=e,this._updated=t}var a={},la=(Object.defineProperty(a,"__esModule",{value:!0}),a.vector=function(t){try{return new da(t)}catch(e){throw(0,la.newError)("Invalid argument type passed to vector constructor function: should be signed integer or float TypedArray, got: ".concat(null!=(t=null==(t=null==t?void 0:t.constructor)?void 0:t.name)?t:"undefined or type without constructor name"))}},a.isVector=function(e){return null!=e&&!0===e[fa]},t),fa="__isVector__",pa={INT8:"INT8",INT16:"INT16",INT32:"INT32",INT64:"INT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"},da=(Object.freeze(pa),ha.prototype.asTypedArray=function(){return this._typedArray},ha.prototype.getType=function(){return this._type},ha.prototype.toString=function(){return"vector([".concat(this._typedArray.join(", "),"], ").concat(this._typedArray.length,", ").concat((e=>{switch(e){case"INT8":return"INTEGER8 NOT NULL";case"INT16":return"INTEGER16 NOT NULL";case"INT32":return"INTEGER32 NOT NULL";case"INT64":return"INTEGER NOT NULL";case"FLOAT32":return"FLOAT32 NOT NULL";case"FLOAT64":return"FLOAT NOT NULL";default:throw(0,la.newError)("Cannot stringify vector with unsupported type. Got type: ".concat(e))}})(this._type),")")},ha);function ha(e){var t;if(e instanceof Int8Array)this._type=pa.INT8;else if(e instanceof Int16Array)this._type=pa.INT16;else if(e instanceof Int32Array)this._type=pa.INT32;else if(e instanceof BigInt64Array)this._type=pa.INT64;else if(e instanceof Float32Array)this._type=pa.FLOAT32;else{if(!(e instanceof Float64Array))throw(0,la.newError)("Invalid argument type passed to Vector constructor: should be signed integer or float TypedArray, got: ".concat(null!=(t=null==(t=null==e?void 0:e.constructor)?void 0:t.name)?t:"undefined or type without constructor name"));this._type=pa.FLOAT64}this._typedArray=e}a.default=da,Object.defineProperty(da.prototype,fa,{value:!0,enumerable:!1,configurable:!1,writable:!1});var ba,ya,_a,va,ma,ga,Oa,wa,Ea,Pa,Ta,Sa,ja,O={},P={},Ca=(Object.defineProperty(P,"__esModule",{value:!0}),P.uuid=function(e){if("string"==typeof e)return Aa.fromString(e);if(e instanceof Uint8Array)return new Aa(e);throw(0,Ca.newError)("Invalid argument type passed to UUID constructor function: expected Uint8Array or uuid string, got: ".concat(null!=(e=null==(e=null==e?void 0:e.constructor)?void 0:e.name)?e:"undefined or type without constructor name"))},P.isUUID=function(e){return null!=e&&!0===e[Ia]},t),Ia="__isUUID__",Ra=[3,5,7,9],Aa=(Ma.prototype.getTypedArray=function(){return this._typedArray},Ma.prototype.toString=function(){for(var e="",t=0;t<this._typedArray.length;t++)e+=("0"+this._typedArray[t].toString(16)).slice(-2),-1!==Ra.indexOf(t)&&(e+="-");return e},Ma.fromString=function(e){if(null===e.match(/^[\da-fA-F]{32}$/)&&null===e.match(/^[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}$/))throw(0,Ca.newError)("UUID string base16 encoded should be of format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx or without any dashes, got: ".concat(e));e=e.replace(/-/g,"");for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substring(r,r+2),16));return new Ma(Uint8Array.from(t))},Ma);function Ma(e){if(16!==e.length)throw(0,Ca.newError)("Uint8Array representation of UUID must be of length 16, got ".concat(e.toString()));this._typedArray=e,Object.freeze(this)}function Na(e,t){if(null!=t){if(!0===t.stringify)return e.toString();if(!0===t.jsNativeDate)return e.toStandardDate()}return e}P.default=Aa,Object.defineProperty(Aa.prototype,Ia,{value:!0,enumerable:!1,configurable:!1,writable:!1}),ba=O,_a=r&&r.__assign||function(){return(_a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},va=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),ma=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),S=r&&r.__importStar||(ya=function(e){return(ya=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=ya(e),n=0;n<r.length;n++)"default"!==r[n]&&va(t,e,r[n]);return ma(t,e),t}),Object.defineProperty(ba,"__esModule",{value:!0}),ba.rule=void 0,ga=fe,Oa=p,wa=l,Ea=u,Pa=a,Ta=t,Sa=S(i),ja=P,ba.rule=Object.freeze({asBoolean:function(e){return _a({validate:function(e,t){if("boolean"!=typeof e)throw new TypeError("".concat(t," should be a boolean but received ").concat(typeof e))}},e)},asString:function(e){return _a({validate:function(e,t){if("string"!=typeof e)throw new TypeError("".concat(t," should be a string but received ").concat(typeof e))}},e)},asNumber:function(r){return _a({validate:function(e,t){if((0,Sa.isInt)(e)&&!0!==(null==r?void 0:r.isInteger))throw new TypeError('Number returned as Integer Object. To use asNumber mapping with Integers, set "isInteger" in rule configuration.');if(!0!==(null==r?void 0:r.isInteger)&&"bigint"==typeof e)throw new TypeError('Number returned as BigInt. To use asNumber mapping with integer values, set "isInteger" in rule configuration.');if("number"!=typeof e&&(!(0,Sa.isInt)(e)||!0!==(null==r?void 0:r.isInteger)))throw new TypeError("".concat(t," should be a number but received ").concat(typeof e));if(!0===(null==r?void 0:r.isInteger)&&"number"==typeof e&&!Number.isInteger(e))throw new TypeError("".concat(t," should be an integer value but received decimal number."))},convert:function(e){return"bigint"==typeof e?Number(e):(0,Sa.isInt)(e)?e.toNumber():e},parameterConversion:function(e){return!0===(null==r?void 0:r.isInteger)?Sa.default.fromValue(e):e}},r)},asBigInt:function(r){return _a({validate:function(e,t){if("bigint"!=typeof e&&(!0!==(null==r?void 0:r.acceptNumber)||"number"!=typeof e)&&!(0,Sa.isInt)(e))throw new TypeError("".concat(t," should be a bigint but received ").concat(typeof e))},convert:function(e){return"number"==typeof e?BigInt(e):(0,Sa.isInt)(e)?e.toBigInt():e}},r)},asInteger:function(r){return _a({validate:function(e,t){if("bigint"!=typeof e&&!(0,Sa.isInt)(e)&&("number"!=typeof e||!0!==(null==r?void 0:r.acceptNumber)))throw new TypeError("".concat(t," should be an Integer but received ").concat(typeof e))},convert:function(e){return"bigint"==typeof e?Sa.default.fromValue(e):e}},r)},asNode:function(e){return _a({validate:function(e,t){if(!(0,Oa.isNode)(e))throw new TypeError("".concat(t," should be a Node but received ").concat(typeof e))}},e)},asRelationship:function(e){return _a({validate:function(e,t){if(!(0,Oa.isRelationship)(e))throw new TypeError("".concat(t," should be a Relationship but received ").concat(typeof e))}},e)},asPath:function(e){return _a({validate:function(e,t){if(!(0,Oa.isPath)(e))throw new TypeError("".concat(t," should be a Path but received ").concat(typeof e))}},e)},asPoint:function(e){return _a({validate:function(e,t){if(!(0,wa.isPoint)(e))throw new TypeError("".concat(t," should be a Point but received ").concat(typeof e))}},e)},asDuration:function(t){if(null==(null==t?void 0:t.stringify)||null==(null==t?void 0:t.convert)&&null==t.parameterConversion)return _a({validate:function(e,t){if(!(0,Ea.isDuration)(e))throw new TypeError("".concat(t," should be a Duration but received ").concat(typeof e))},convert:function(e){return!0===(null==t?void 0:t.stringify)?e.toString():e},parameterConversion:!0===(null==t?void 0:t.stringify)?function(e){return Ea.Duration.fromString(e)}:void 0},t);throw(0,Ta.newError)("Provided rule already has convert and/or parameterConversion function, stringify can not be used in combination with custom conversion functions.")},asLocalTime:function(t){if(null==(null==t?void 0:t.stringify)||null==(null==t?void 0:t.convert)&&null==t.parameterConversion)return _a({validate:function(e,t){if(!(0,Ea.isLocalTime)(e))throw new TypeError("".concat(t," should be a LocalTime but received ").concat(typeof e))},convert:function(e){return!0===(null==t?void 0:t.stringify)?e.toString():e},parameterConversion:!0===(null==t?void 0:t.stringify)?function(e){return Ea.LocalTime.fromString(e)}:void 0},t);throw(0,Ta.newError)("Provided rule already has convert and/or parameterConversion function, stringify can not be used in combination with custom conversion functions.")},asTime:function(t){if(null==(null==t?void 0:t.stringify)||null==(null==t?void 0:t.convert)&&null==t.parameterConversion)return _a({validate:function(e,t){if(!(0,Ea.isTime)(e))throw new TypeError("".concat(t," should be a Time but received ").concat(typeof e))},convert:function(e){return!0===(null==t?void 0:t.stringify)?e.toString():e},parameterConversion:!0===(null==t?void 0:t.stringify)?function(e){return Ea.Time.fromString(e)}:void 0},t);throw(0,Ta.newError)("Provided rule already has convert and/or parameterConversion function, stringify can not be used in combination with custom conversion functions.")},asDate:function(t){if(null!=(null==t?void 0:t.stringify)&&(null!=(null==t?void 0:t.convert)||null!=t.parameterConversion))throw(0,Ta.newError)("Provided rule already has convert and/or parameterConversion function, stringify can not be used in combination with custom conversion functions.");if(null!=(null==t?void 0:t.jsNativeDate)&&(null!=(null==t?void 0:t.convert)||null!=t.parameterConversion))throw(0,Ta.newError)("Provided rule already has convert and/or parameterConversion function, jsNativeDate can not be used in combination with custom conversion functions.");if(!0===(null==t?void 0:t.stringify)&&!0===(null==t?void 0:t.jsNativeDate))throw(0,Ta.newError)("both stringify and jsNativeDate cannot be set; use one or neither");var e;return!0===(null==t?void 0:t.stringify)&&(e=function(e){return Ea.Date.fromString(e)}),!0===(null==t?void 0:t.jsNativeDate)&&(e=function(e){return Ea.Date.fromStandardDateLocal(e)}),_a({validate:function(e,t){if(!(0,Ea.isDate)(e))throw new TypeError("".concat(t," should be a Date but received ").concat(typeof e))},convert:function(e){return Na(e,t)},parameterConversion:e},t)},asLocalDateTime:function(t){if(null!=(null==t?void 0:t.stringify)&&(null!=(null==t?void 0:t.convert)||null!=t.parameterConversion))throw(0,Ta.newError)("Provided rule already has convert and/or parameterConversion function, stringify can not be used in combination with custom conversion functions.");if(null!=(null==t?void 0:t.jsNativeDate)&&(null!=(null==t?void 0:t.convert)||null!=t.parameterConversion))throw(0,Ta.newError)("Provided rule already has convert and/or parameterConversion function, jsNativeDate can not be used in combination with custom conversion functions.");if(!0===(null==t?void 0:t.stringify)&&!0===(null==t?void 0:t.jsNativeDate))throw(0,Ta.newError)("both stringify and jsNativeDate cannot be set; use one or neither");var e;return!0===(null==t?void 0:t.stringify)&&(e=function(e){return Ea.LocalDateTime.fromString(e)}),!0===(null==t?void 0:t.jsNativeDate)&&(e=function(e){return Ea.LocalDateTime.fromStandardDate(e)}),_a({validate:function(e,t){if(!(0,Ea.isLocalDateTime)(e))throw new TypeError("".concat(t," should be a LocalDateTime but received ").concat(typeof e))},convert:function(e){return Na(e,t)},parameterConversion:e},t)},asDateTime:function(t){if(null!=(null==t?void 0:t.stringify)&&(null!=(null==t?void 0:t.convert)||null!=t.parameterConversion))throw(0,Ta.newError)("Provided rule already has convert and/or parameterConversion function, stringify can not be used in combination with custom conversion functions.");if(null!=(null==t?void 0:t.jsNativeDate)&&(null!=(null==t?void 0:t.convert)||null!=t.parameterConversion))throw(0,Ta.newError)("Provided rule already has convert and/or parameterConversion function, jsNativeDate can not be used in combination with custom conversion functions.");if(!0===(null==t?void 0:t.stringify)&&!0===(null==t?void 0:t.jsNativeDate))throw(0,Ta.newError)("both stringify and jsNativeDate cannot be set; use one or neither");var e;return!0===(null==t?void 0:t.stringify)&&(e=function(e){return Ea.DateTime.fromString(e)}),!0===(null==t?void 0:t.jsNativeDate)&&(e=function(e){return Ea.DateTime.fromStandardDate(e)}),_a({validate:function(e,t){if(!(0,Ea.isDateTime)(e))throw new TypeError("".concat(t," should be a DateTime but received ").concat(typeof e))},convert:function(e){return Na(e,t)},parameterConversion:e},t)},asList:function(o){return _a({validate:function(e,r){var t;if(!Array.isArray(e))throw new TypeError("".concat(r," should be a list but received ").concat(typeof e));var n=null==(t=null==o?void 0:o.apply)?void 0:t.validate;null!=n&&e.forEach(function(e,t){return n(e,"".concat(r,"[").concat(t,"]"))})},convert:function(e,r){return null!=(null==o?void 0:o.apply)?e.map(function(e,t){return(0,ga.valueAs)(e,"".concat(r,"[").concat(t,"]"),o.apply)}):e},parameterConversion:function(e){var t=null==o?void 0:o.apply;return null!=t?e.map(function(e){return(0,ga.optionalParameterConversion)(e,t)}):e}},o)},asVector:function(r){if(null==(null==r?void 0:r.asTypedList)||null==(null==r?void 0:r.convert)&&null==r.parameterConversion)return _a({validate:function(e,t){if(!(0,Pa.isVector)(e))throw new TypeError("".concat(t," should be a vector but received ").concat(typeof e));if(null!=(null==r?void 0:r.dimension)&&e.asTypedArray().length!==r.dimension)throw new TypeError("".concat(t," should be a vector of length ").concat(r.dimension," but received length ").concat(e.asTypedArray().length));if(null!=(null==r?void 0:r.type)&&e.getType()!==r.type)throw new TypeError("".concat(t," should be a vector of type ").concat(r.type," but received type ").concat(e.getType()))},convert:function(e){return!0===(null==r?void 0:r.asTypedList)?e._typedArray:e},parameterConversion:!0===(null==r?void 0:r.asTypedList)?function(e){return(0,Pa.vector)(e)}:void 0},r);throw(0,Ta.newError)("Provided rule already has convert and/or parameterConversion function, asTypedList can not be used in combination with custom conversion functions.")},asUUID:function(t){if(null==(null==t?void 0:t.stringify)||null==(null==t?void 0:t.convert)&&null==t.parameterConversion)return _a({validate:function(e,t){if(!(0,ja.isUUID)(e))throw new TypeError("".concat(t," should be a UUID but received ").concat(typeof e))},convert:function(e){return!0===(null==t?void 0:t.stringify)?e.toString():e},parameterConversion:!0===(null==t?void 0:t.stringify)?function(e){return(0,ja.uuid)(e)}:void 0},t);throw(0,Ta.newError)("Provided rule already has convert and/or parameterConversion function, stringify can not be used in combination with custom conversion functions.")},asObject:function(e,t){var i="function"==typeof e?e:Object,u=(0,ga.getRules)(e,t);return _a({validate:function(e,t){for(var r in u){var n=null!=u[r].from?u[r].from:(0,ga.defaultNameMapping)(r);if(null==e[n]){if(!0===u[r].optional)continue;throw(0,Ta.newError)("Mapped object did not include required field ".concat(t," with key ").concat(n,"."))}null!=u[r].validate&&u[r].validate(e[n],"".concat(t,"[").concat(r,"]"))}},convert:function(e,t){var r,n=new i;for(r in u){var o=null!=u[r].from?u[r].from:(0,ga.defaultNameMapping)(r);null!=e[o]&&null!=u[r].convert?n[r]=u[r].convert(e[o],"".concat(t,"[").concat(o,"]")):n[r]=e[o]}return n},parameterConversion:function(e){var t,r={};for(t in u){var n=null!=u[t].from?u[t].from:(0,ga.defaultNameMapping)(t);null!=e[t]&&null!=u[t].parameterConversion?r[n]=u[t].parameterConversion(e[t]):r[n]=e[t]}return r}},ba.rule)}});var m={},ka=r&&r.__assign||function(){return(ka=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},xa=(Object.defineProperty(m,"__esModule",{value:!0}),fe),Da=O;m.default={booleanProperty:function(r){return function(e,t){t.metadata[t.name]=Da.rule.asBoolean(r)}},stringProperty:function(r){return function(e,t){t.metadata[t.name]=Da.rule.asString(r)}},numberProperty:function(r){return function(e,t){t.metadata[t.name]=Da.rule.asNumber(r)}},bigIntProperty:function(r){return function(e,t){t.metadata[t.name]=Da.rule.asBigInt(r)}},integerProperty:function(r){return function(e,t){t.metadata[t.name]=Da.rule.asInteger(r)}},nodeProperty:function(r){return function(e,t){t.metadata[t.name]=Da.rule.asNode(r)}},relationshipProperty:function(r){return function(e,t){t.metadata[t.name]=Da.rule.asRelationship(r)}},pathProperty:function(r){return function(e,t){t.metadata[t.name]=Da.rule.asPath(r)}},pointProperty:function(r){return function(e,t){t.metadata[t.name]=Da.rule.asPoint(r)}},durationProperty:function(r){return function(e,t){t.metadata[t.name]=Da.rule.asDuration(r)}},localTimeProperty:function(r){return function(e,t){t.metadata[t.name]=Da.rule.asLocalTime(r)}},timeProperty:function(r){return function(e,t){t.metadata[t.name]=Da.rule.asTime(r)}},dateProperty:function(r){return function(e,t){t.metadata[t.name]=Da.rule.asDate(r)}},localDateTimeProperty:function(r){return function(e,t){t.metadata[t.name]=Da.rule.asLocalDateTime(r)}},dateTimeProperty:function(r){return function(e,t){t.metadata[t.name]=Da.rule.asDateTime(r)}},listProperty:function(r){return function(e,t){t.metadata[t.name]=Da.rule.asList(ka({apply:ka({},t.metadata[t.name])},r))}},vectorProperty:function(r){return function(e,t){t.metadata[t.name]=Da.rule.asVector(r)}},uuidProperty:function(r){return function(e,t){t.metadata[t.name]=Da.rule.asUUID(r)}},objectProperty:function(r,n){return function(e,t){t.metadata[t.name]=Da.rule.asObject(r,n)}},optionalProperty:function(){return function(e,t){t.metadata[t.name]=ka({optional:!0},t.metadata[t.name])}},mapPropertyFromName:function(r){return function(e,t){t.metadata[t.name]=ka({from:r},t.metadata[t.name])}},convertPropertyToType:function(r){return function(e,t){t.metadata[t.name]=ka({convert:function(e){return e.as(r)}},t.metadata[t.name])}},mappedClass:function(){return function(e,t){xa.rulesRegistry[t.name]=t.metadata}}};var Ua,La,Fa,Ba,Va,qa,Wa,za,Ha,Ga,Ya,Ka,Za,Qa,Xa,Ja,$a,es,ts,rs,ns,os,is,ro={},us=(Object.defineProperty(ro,"__esModule",{value:!0}),ro.isUnsupportedType=function(e){return null!=e&&!0===e[us]},"__isUnsupportedType__"),v=(as.prototype.toString=function(){return"UnsupportedType<".concat(this.name,">")},as);function as(e,t,r,n){this.name=e,this.minimumProtocolVersion="".concat(t,".").concat(r),this.message=n}ro.default=v,Object.defineProperty(v.prototype,us,{value:!0,enumerable:!1,configurable:!1,writable:!1}),S=e,La=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),Fa=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),v=r&&r.__importStar||(Ua=function(e){return(Ua=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=Ua(e),n=0;n<r.length;n++)"default"!==r[n]&&La(t,e,r[n]);return Fa(t,e),t}),j=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(S,"__esModule",{value:!0}),S.Result=S.Stats=S.QueryStatistics=S.ProfiledPlan=S.Plan=S.GqlStatusObject=S.Notification=S.ServerInfo=S.queryType=S.ResultSummary=S.Record=S.isPathSegment=S.PathSegment=S.isPath=S.Path=S.isUnboundRelationship=S.UnboundRelationship=S.isRelationship=S.Relationship=S.isNode=S.Node=S.Time=S.LocalTime=S.LocalDateTime=S.isTime=S.isLocalTime=S.isLocalDateTime=S.isDuration=S.isDateTime=S.isDate=S.Duration=S.DateTime=S.Date=S.Point=S.isPoint=S.internal=S.toString=S.toNumber=S.inSafeRange=S.isInt=S.int=S.Integer=S.error=S.isRetriableError=S.isRetryableError=S.GQLError=S.newGQLError=S.Neo4jError=S.newError=S.authTokenManagers=void 0,S.uuid=S.isUUID=S.UUID=S.isUnsupportedType=S.UnsupportedType=S.StandardCase=S.RecordObjectMapping=S.mappingDecorators=S.rule=S.ProtocolVersion=S.vector=S.Vector=S.isVector=S.resolveCertificateProvider=S.clientCertificateProviders=S.notificationFilterMinimumSeverityLevel=S.notificationFilterDisabledClassification=S.notificationFilterDisabledCategory=S.notificationSeverityLevel=S.notificationClassification=S.notificationCategory=S.resultTransformers=S.routing=S.staticAuthTokenManager=S.bookmarkManager=S.auth=S.json=S.driver=S.types=S.Driver=S.Session=S.TransactionPromise=S.ManagedTransaction=S.Transaction=S.Connection=S.Releasable=S.ConnectionProvider=S.EagerResult=void 0,Ba=t,Object.defineProperty(S,"newError",{enumerable:!0,get:function(){return Ba.newError}}),Object.defineProperty(S,"Neo4jError",{enumerable:!0,get:function(){return Ba.Neo4jError}}),Object.defineProperty(S,"newGQLError",{enumerable:!0,get:function(){return Ba.newGQLError}}),Object.defineProperty(S,"GQLError",{enumerable:!0,get:function(){return Ba.GQLError}}),Object.defineProperty(S,"isRetryableError",{enumerable:!0,get:function(){return Ba.isRetryableError}}),Object.defineProperty(S,"isRetriableError",{enumerable:!0,get:function(){return Ba.isRetriableError}}),Va=v(i),S.Integer=Va.default,Object.defineProperty(S,"int",{enumerable:!0,get:function(){return Va.int}}),Object.defineProperty(S,"isInt",{enumerable:!0,get:function(){return Va.isInt}}),Object.defineProperty(S,"inSafeRange",{enumerable:!0,get:function(){return Va.inSafeRange}}),Object.defineProperty(S,"toNumber",{enumerable:!0,get:function(){return Va.toNumber}}),Object.defineProperty(S,"toString",{enumerable:!0,get:function(){return Va.toString}}),qa=u,Object.defineProperty(S,"Date",{enumerable:!0,get:function(){return qa.Date}}),Object.defineProperty(S,"DateTime",{enumerable:!0,get:function(){return qa.DateTime}}),Object.defineProperty(S,"Duration",{enumerable:!0,get:function(){return qa.Duration}}),Object.defineProperty(S,"isDate",{enumerable:!0,get:function(){return qa.isDate}}),Object.defineProperty(S,"isDateTime",{enumerable:!0,get:function(){return qa.isDateTime}}),Object.defineProperty(S,"isDuration",{enumerable:!0,get:function(){return qa.isDuration}}),Object.defineProperty(S,"isLocalDateTime",{enumerable:!0,get:function(){return qa.isLocalDateTime}}),Object.defineProperty(S,"isLocalTime",{enumerable:!0,get:function(){return qa.isLocalTime}}),Object.defineProperty(S,"isTime",{enumerable:!0,get:function(){return qa.isTime}}),Object.defineProperty(S,"LocalDateTime",{enumerable:!0,get:function(){return qa.LocalDateTime}}),Object.defineProperty(S,"LocalTime",{enumerable:!0,get:function(){return qa.LocalTime}}),Object.defineProperty(S,"Time",{enumerable:!0,get:function(){return qa.Time}}),Wa=p,Object.defineProperty(S,"Node",{enumerable:!0,get:function(){return Wa.Node}}),Object.defineProperty(S,"isNode",{enumerable:!0,get:function(){return Wa.isNode}}),Object.defineProperty(S,"Relationship",{enumerable:!0,get:function(){return Wa.Relationship}}),Object.defineProperty(S,"isRelationship",{enumerable:!0,get:function(){return Wa.isRelationship}}),Object.defineProperty(S,"UnboundRelationship",{enumerable:!0,get:function(){return Wa.UnboundRelationship}}),Object.defineProperty(S,"isUnboundRelationship",{enumerable:!0,get:function(){return Wa.isUnboundRelationship}}),Object.defineProperty(S,"Path",{enumerable:!0,get:function(){return Wa.Path}}),Object.defineProperty(S,"isPath",{enumerable:!0,get:function(){return Wa.isPath}}),Object.defineProperty(S,"PathSegment",{enumerable:!0,get:function(){return Wa.PathSegment}}),Object.defineProperty(S,"isPathSegment",{enumerable:!0,get:function(){return Wa.isPathSegment}}),t=j(Rt),S.Record=t.default,za=l,Object.defineProperty(S,"isPoint",{enumerable:!0,get:function(){return za.isPoint}}),Object.defineProperty(S,"Point",{enumerable:!0,get:function(){return za.Point}}),Ha=v(Gt),S.ResultSummary=Ha.default,Object.defineProperty(S,"queryType",{enumerable:!0,get:function(){return Ha.queryType}}),Object.defineProperty(S,"ServerInfo",{enumerable:!0,get:function(){return Ha.ServerInfo}}),Object.defineProperty(S,"Plan",{enumerable:!0,get:function(){return Ha.Plan}}),Object.defineProperty(S,"ProfiledPlan",{enumerable:!0,get:function(){return Ha.ProfiledPlan}}),Object.defineProperty(S,"QueryStatistics",{enumerable:!0,get:function(){return Ha.QueryStatistics}}),Object.defineProperty(S,"Stats",{enumerable:!0,get:function(){return Ha.Stats}}),Ga=v(h),S.GqlStatusObject=Ga.default,Object.defineProperty(S,"Notification",{enumerable:!0,get:function(){return Ga.Notification}}),Object.defineProperty(S,"notificationCategory",{enumerable:!0,get:function(){return Ga.notificationCategory}}),Object.defineProperty(S,"notificationClassification",{enumerable:!0,get:function(){return Ga.notificationClassification}}),Object.defineProperty(S,"notificationSeverityLevel",{enumerable:!0,get:function(){return Ga.notificationSeverityLevel}}),Ya=b,Object.defineProperty(S,"notificationFilterDisabledCategory",{enumerable:!0,get:function(){return Ya.notificationFilterDisabledCategory}}),Object.defineProperty(S,"notificationFilterDisabledClassification",{enumerable:!0,get:function(){return Ya.notificationFilterDisabledClassification}}),Object.defineProperty(S,"notificationFilterMinimumSeverityLevel",{enumerable:!0,get:function(){return Ya.notificationFilterMinimumSeverityLevel}}),i=j(G),S.Result=i.default,u=j(T),S.EagerResult=u.default,Ka=v(n),S.ConnectionProvider=Ka.default,Object.defineProperty(S,"Releasable",{enumerable:!0,get:function(){return Ka.Releasable}}),p=j(ao),S.Connection=p.default,Rt=j(Uo),S.Transaction=Rt.default,l=j(so),S.ManagedTransaction=l.default,Gt=j(bn),S.TransactionPromise=Gt.default,h=j(bo),S.Session=h.default,b=v(o),G=b,S.Driver=b.default,S.driver=G,T=j(w),S.auth=T.default,Za=Zn,Object.defineProperty(S,"bookmarkManager",{enumerable:!0,get:function(){return Za.bookmarkManager}}),Qa=_,Object.defineProperty(S,"authTokenManagers",{enumerable:!0,get:function(){return Qa.authTokenManagers}}),Object.defineProperty(S,"staticAuthTokenManager",{enumerable:!0,get:function(){return Qa.staticAuthTokenManager}}),Xa=o,Object.defineProperty(S,"routing",{enumerable:!0,get:function(){return Xa.routing}}),n=v(g),S.types=n,ao=v(F),S.json=ao,Uo=j(Ar),S.resultTransformers=Uo.default,Ja=E,Object.defineProperty(S,"clientCertificateProviders",{enumerable:!0,get:function(){return Ja.clientCertificateProviders}}),Object.defineProperty(S,"resolveCertificateProvider",{enumerable:!0,get:function(){return Ja.resolveCertificateProvider}}),so=v(y),S.internal=so,$a=Wr,Object.defineProperty(S,"ProtocolVersion",{enumerable:!0,get:function(){return $a.ProtocolVersion}}),es=v(a),S.Vector=es.default,Object.defineProperty(S,"vector",{enumerable:!0,get:function(){return es.vector}}),Object.defineProperty(S,"isVector",{enumerable:!0,get:function(){return es.isVector}}),ts=pe,Object.defineProperty(S,"StandardCase",{enumerable:!0,get:function(){return ts.StandardCase}}),rs=fe,Object.defineProperty(S,"RecordObjectMapping",{enumerable:!0,get:function(){return rs.RecordObjectMapping}}),ns=O,Object.defineProperty(S,"rule",{enumerable:!0,get:function(){return ns.rule}}),j=j(m),S.mappingDecorators=j.default,os=v(ro),S.UnsupportedType=os.default,Object.defineProperty(S,"isUnsupportedType",{enumerable:!0,get:function(){return os.isUnsupportedType}}),is=v(P),S.UUID=is.default,Object.defineProperty(S,"uuid",{enumerable:!0,get:function(){return is.uuid}}),Object.defineProperty(S,"isUUID",{enumerable:!0,get:function(){return is.isUUID}}),v={SERVICE_UNAVAILABLE:Ba.SERVICE_UNAVAILABLE,SESSION_EXPIRED:Ba.SESSION_EXPIRED,PROTOCOL_ERROR:Ba.PROTOCOL_ERROR},S.error=v,v={authTokenManagers:Qa.authTokenManagers,newError:Ba.newError,Neo4jError:Ba.Neo4jError,newGQLError:Ba.newGQLError,GQLError:Ba.GQLError,isRetryableError:Ba.isRetryableError,isRetriableError:Ba.isRetriableError,error:v,Integer:Va.default,int:Va.int,isInt:Va.isInt,inSafeRange:Va.inSafeRange,toNumber:Va.toNumber,toString:Va.toString,internal:so,isPoint:za.isPoint,Point:za.Point,Date:qa.Date,DateTime:qa.DateTime,Duration:qa.Duration,isDate:qa.isDate,isDateTime:qa.isDateTime,isDuration:qa.isDuration,isLocalDateTime:qa.isLocalDateTime,isLocalTime:qa.isLocalTime,isTime:qa.isTime,LocalDateTime:qa.LocalDateTime,LocalTime:qa.LocalTime,Time:qa.Time,Node:Wa.Node,isNode:Wa.isNode,Relationship:Wa.Relationship,isRelationship:Wa.isRelationship,UnboundRelationship:Wa.UnboundRelationship,isUnboundRelationship:Wa.isUnboundRelationship,Path:Wa.Path,isPath:Wa.isPath,PathSegment:Wa.PathSegment,isPathSegment:Wa.isPathSegment,Record:t.default,ResultSummary:Ha.default,queryType:Ha.queryType,ServerInfo:Ha.ServerInfo,Notification:Ga.Notification,GqlStatusObject:Ga.default,Plan:Ha.Plan,ProfiledPlan:Ha.ProfiledPlan,QueryStatistics:Ha.QueryStatistics,Stats:Ha.Stats,Result:i.default,EagerResult:u.default,Transaction:Rt.default,ManagedTransaction:l.default,TransactionPromise:Gt.default,Session:h.default,Driver:b.default,Connection:p.default,Releasable:Ka.Releasable,types:n,driver:G,json:ao,auth:T.default,bookmarkManager:Za.bookmarkManager,routing:Xa.routing,resultTransformers:Uo.default,notificationCategory:Ga.notificationCategory,notificationClassification:Ga.notificationClassification,notificationSeverityLevel:Ga.notificationSeverityLevel,notificationFilterDisabledCategory:Ya.notificationFilterDisabledCategory,notificationFilterDisabledClassification:Ya.notificationFilterDisabledClassification,notificationFilterMinimumSeverityLevel:Ya.notificationFilterMinimumSeverityLevel,clientCertificateProviders:Ja.clientCertificateProviders,resolveCertificateProvider:Ja.resolveCertificateProvider,ProtocolVersion:$a.ProtocolVersion,rule:ns.rule,mappingDecorators:j.default,RecordObjectMapping:rs.RecordObjectMapping,StandardCase:ts.StandardCase,UnsupportedType:os.default,isUnsupportedType:os.isUnsupportedType,isVector:es.isVector,vector:es.vector,isUUID:is.isUUID,uuid:is.uuid},S.default=v;bn={},bo={},w={},Zn={},_={};Object.defineProperty(_,"__esModule",{value:!0}),_.isFunction=void 0,_.isFunction=function(e){return"function"==typeof e};o={},g={},F={};Object.defineProperty(F,"__esModule",{value:!0}),F.createErrorClass=void 0,F.createErrorClass=function(e){return(e=e(function(e){Error.call(e),e.stack=(new Error).stack})).prototype=Object.create(Error.prototype),e.prototype.constructor=e},Object.defineProperty(g,"__esModule",{value:!0}),g.UnsubscriptionError=void 0;Ar=F,g.UnsubscriptionError=Ar.createErrorClass(function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map(function(e,t){return t+1+") "+e.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}),E={};Object.defineProperty(E,"__esModule",{value:!0}),E.arrRemove=void 0,E.arrRemove=function(e,t){e&&0<=(t=e.indexOf(t))&&e.splice(t,1)};var ss=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},cs=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},ls=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},fs=(Object.defineProperty(o,"__esModule",{value:!0}),o.isSubscription=o.EMPTY_SUBSCRIPTION=o.Subscription=void 0,_),ps=g,ds=E,hs=(bs.prototype.unsubscribe=function(){var t,e,r;if(!this.closed){this.closed=!0;var n=this._parentage;if(n)if(this._parentage=null,Array.isArray(n))try{for(var o=ss(n),i=o.next();!i.done;i=o.next())i.value.remove(this)}catch(e){a={error:e}}finally{try{i&&!i.done&&(u=o.return)&&u.call(o)}finally{if(a)throw a.error}}else n.remove(this);var u=this.initialTeardown;if(fs.isFunction(u))try{u()}catch(e){r=e instanceof ps.UnsubscriptionError?e.errors:[e]}var a=this._finalizers;if(a){this._finalizers=null;try{for(var s=ss(a),c=s.next();!c.done;c=s.next()){var l=c.value;try{ys(l)}catch(e){r=null!=r?r:[],e instanceof ps.UnsubscriptionError?r=ls(ls([],cs(r)),cs(e.errors)):r.push(e)}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}}if(r)throw new ps.UnsubscriptionError(r)}},bs.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)ys(e);else{if(e instanceof bs){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!=(t=this._finalizers)?t:[]).push(e)}},bs.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},bs.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},bs.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&ds.arrRemove(t,e)},bs.prototype.remove=function(e){var t=this._finalizers;t&&ds.arrRemove(t,e),e instanceof bs&&e._removeParent(this)},bs.EMPTY=((y=new bs).closed=!0,y),bs);function bs(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}function ys(e){fs.isFunction(e)?e():e.unsubscribe()}o.Subscription=hs,o.EMPTY_SUBSCRIPTION=hs.EMPTY,o.isSubscription=function(e){return e instanceof hs||e&&"closed"in e&&fs.isFunction(e.remove)&&fs.isFunction(e.add)&&fs.isFunction(e.unsubscribe)};var _s,vs,ms,Wr={},a=(Object.defineProperty(Wr,"__esModule",{value:!0}),Wr.config=void 0,Wr.config={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},{}),pe={},gs=(_s=pe,vs=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},ms=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Object.defineProperty(_s,"__esModule",{value:!0}),_s.timeoutProvider=void 0,_s.timeoutProvider={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=_s.timeoutProvider.delegate;return null!=o&&o.setTimeout?o.setTimeout.apply(o,ms([e,t],vs(r))):setTimeout.apply(void 0,ms([e,t],vs(r)))},clearTimeout:function(e){var t=_s.timeoutProvider.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0},Object.defineProperty(a,"__esModule",{value:!0}),a.reportUnhandledError=void 0,Wr),Os=pe;a.reportUnhandledError=function(t){Os.timeoutProvider.setTimeout(function(){var e=gs.config.onUnhandledError;if(!e)throw t;e(t)})};fe={};Object.defineProperty(fe,"__esModule",{value:!0}),fe.noop=void 0,fe.noop=function(){};O={};function ws(e,t,r){return{kind:e,value:t,error:r}}Object.defineProperty(O,"__esModule",{value:!0}),O.createNotification=O.nextNotification=O.errorNotification=O.COMPLETE_NOTIFICATION=void 0,O.COMPLETE_NOTIFICATION=ws("C",void 0,void 0),O.errorNotification=function(e){return ws("E",void 0,e)},O.nextNotification=function(e){return ws("N",e,void 0)},O.createNotification=ws;var Es,Ps,Ts,Ss,js,Cs,Is,Rs,As,Ms,Ns,ks,xs,Ds,m={},Us=(Object.defineProperty(m,"__esModule",{value:!0}),m.captureError=m.errorContext=void 0,Wr),Ls=null;function Fs(e){var t=Ts.call(this)||this;return t.isStopped=!1,e?(t.destination=e,js.isSubscription(e)&&e.add(t)):t.destination=Es.EMPTY_OBSERVER,t}function Bs(e,t){return Ns.call(e,t)}function Vs(e){this.partialObserver=e}function qs(e,t,r){var n=xs.call(this)||this;return r=Ss.isFunction(e)||!e?{next:null!=e?e:void 0,error:null!=t?t:void 0,complete:null!=r?r:void 0}:n&&Cs.config.useDeprecatedNextContext?((t=Object.create(e)).unsubscribe=function(){return n.unsubscribe()},{next:e.next&&Bs(e.next,t),error:e.error&&Bs(e.error,t),complete:e.complete&&Bs(e.complete,t)}):e,n.destination=new ks(r),n}function Ws(e){Cs.config.useDeprecatedSynchronousErrorHandling?Ms.captureError(e):Is.reportUnhandledError(e)}function zs(e,t){var r=Cs.config.onStoppedNotification;r&&As.timeoutProvider.setTimeout(function(){return r(e,t)})}m.errorContext=function(e){if(Us.config.useDeprecatedSynchronousErrorHandling){var t=!Ls;if(t&&(Ls={errorThrown:!1,error:null}),e(),t){var t=Ls,r=t.errorThrown;if(Ls=null,r)throw t.error}}else e()},m.captureError=function(e){Us.config.useDeprecatedSynchronousErrorHandling&&Ls&&(Ls.errorThrown=!0,Ls.error=e)},Es=Zn,ro=r&&r.__extends||(Ps=function(e,t){return(Ps=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ps(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Object.defineProperty(Es,"__esModule",{value:!0}),Es.EMPTY_OBSERVER=Es.SafeSubscriber=Es.Subscriber=void 0,Ss=_,Cs=Wr,Is=a,P=fe,Rs=O,As=pe,Ms=m,Ts=(js=o).Subscription,ro(Fs,Ts),Fs.create=function(e,t,r){return new Ds(e,t,r)},Fs.prototype.next=function(e){this.isStopped?zs(Rs.nextNotification(e),this):this._next(e)},Fs.prototype.error=function(e){this.isStopped?zs(Rs.errorNotification(e),this):(this.isStopped=!0,this._error(e))},Fs.prototype.complete=function(){this.isStopped?zs(Rs.COMPLETE_NOTIFICATION,this):(this.isStopped=!0,this._complete())},Fs.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,Ts.prototype.unsubscribe.call(this),this.destination=null)},Fs.prototype._next=function(e){this.destination.next(e)},Fs.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},Fs.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},so=Fs,Es.Subscriber=so,Ns=Function.prototype.bind,Vs.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){Ws(e)}},Vs.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){Ws(e)}else Ws(e)},Vs.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){Ws(e)}},ks=Vs,ro(qs,xs=so),Ds=qs,Es.SafeSubscriber=Ds,Es.EMPTY_OBSERVER={closed:!0,next:P.noop,error:function(e){throw e},complete:P.noop};t={},Object.defineProperty(t,"__esModule",{value:!0}),t.observable=void 0,t.observable="function"==typeof Symbol&&Symbol.observable||"@@observable",i={},u={};Object.defineProperty(u,"__esModule",{value:!0}),u.identity=void 0,u.identity=function(e){return e},Object.defineProperty(i,"__esModule",{value:!0}),i.pipeFromArray=i.pipe=void 0;var Hs=u;function Gs(t){return 0===t.length?Hs.identity:1===t.length?t[0]:function(e){return t.reduce(function(e,t){return t(e)},e)}}i.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Gs(e)},i.pipeFromArray=Gs,Object.defineProperty(w,"__esModule",{value:!0}),w.Observable=void 0;var Ys=Zn,Ks=o,Rt=t,Zs=i,Qs=Wr,Xs=_,Js=m;function $s(e){e&&(this._subscribe=e)}function ec(e){return null!=(e=null!=e?e:Qs.config.Promise)?e:Promise}$s.prototype.lift=function(e){var t=new $s;return t.source=this,t.operator=e,t},$s.prototype.subscribe=function(e,t,r){var n,o=this,i=(n=e)&&n instanceof Ys.Subscriber||(e=>e&&Xs.isFunction(e.next)&&Xs.isFunction(e.error)&&Xs.isFunction(e.complete))(n)&&Ks.isSubscription(n)?e:new Ys.SafeSubscriber(e,t,r);return Js.errorContext(function(){var e=o.operator,t=o.source;i.add(e?e.call(i,t):t?o._subscribe(i):o._trySubscribe(i))}),i},$s.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},$s.prototype.forEach=function(n,e){var o=this;return new(e=ec(e))(function(e,t){var r=new Ys.SafeSubscriber({next:function(e){try{n(e)}catch(e){t(e),r.unsubscribe()}},error:t,complete:e});o.subscribe(r)})},$s.prototype._subscribe=function(e){var t;return null==(t=this.source)?void 0:t.subscribe(e)},$s.prototype[Rt.observable]=function(){return this},$s.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Zs.pipeFromArray(e)(this)},$s.prototype.toPromise=function(e){var n=this;return new(e=ec(e))(function(e,t){var r;n.subscribe(function(e){return r=e},function(e){return t(e)},function(){return e(r)})})},$s.create=function(e){return new $s(e)},w.Observable=$s;var l={},Gt={},h={},tc=(Object.defineProperty(h,"__esModule",{value:!0}),h.operate=h.hasLift=void 0,_);function rc(e){return tc.isFunction(null==e?void 0:e.lift)}h.hasLift=rc,h.operate=function(t){return function(e){if(rc(e))return e.lift(function(e){try{return t(e,this)}catch(e){this.error(e)}});throw new TypeError("Unable to lift unknown Observable type")}};var nc,b={},p=r&&r.__extends||(nc=function(e,t){return(nc=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}nc(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),n=(Object.defineProperty(b,"__esModule",{value:!0}),b.OperatorSubscriber=b.createOperatorSubscriber=void 0,Zn);b.createOperatorSubscriber=function(e,t,r,n,o){return new ic(e,t,r,n,o)};p(uc,oc=n.Subscriber),uc.prototype.unsubscribe=function(){var e;this.shouldUnsubscribe&&!this.shouldUnsubscribe()||(e=this.closed,oc.prototype.unsubscribe.call(this),e)||null==(e=this.onFinalize)||e.call(this)};var oc,ic=uc;function uc(t,r,e,n,o,i){var u=oc.call(this,t)||this;return u.onFinalize=o,u.shouldUnsubscribe=i,u._next=r?function(e){try{r(e)}catch(e){t.error(e)}}:oc.prototype._next,u._error=n?function(e){try{n(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:oc.prototype._error,u._complete=e?function(){try{e()}catch(e){t.error(e)}finally{this.unsubscribe()}}:oc.prototype._complete,u}b.OperatorSubscriber=ic,Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.refCount=void 0;var ac=h,sc=b;Gt.refCount=function(){return ac.operate(function(r,n){var o=null,e=(r._refCount++,sc.createOperatorSubscriber(n,void 0,void 0,void 0,function(){var e,t;!r||r._refCount<=0||0<--r._refCount?o=null:(e=r._connection,t=o,o=null,!e||t&&e!==t||e.unsubscribe(),n.unsubscribe())}));r.subscribe(e),e.closed||(o=r.connect())})};var cc,G=r&&r.__extends||(cc=function(e,t){return(cc=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}cc(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(l,"__esModule",{value:!0}),l.ConnectableObservable=void 0;var lc,fc=o,pc=Gt,dc=b,hc=h,ao=(lc=w.Observable,G(bc,lc),bc.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},bc.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},bc.prototype._teardown=function(){this._refCount=0;var e=this._connection;(this._subject=this._connection=null)!=e&&e.unsubscribe()},bc.prototype.connect=function(){var t,r=this,e=this._connection;return e||(e=this._connection=new fc.Subscription,t=this.getSubject(),e.add(this.source.subscribe(dc.createOperatorSubscriber(t,void 0,function(){r._teardown(),t.complete()},function(e){r._teardown(),t.error(e)},function(){return r._teardown()}))),e.closed&&(this._connection=null,e=fc.Subscription.EMPTY)),e},bc.prototype.refCount=function(){return pc.refCount()(this)},bc);function bc(e,t){var r=lc.call(this)||this;return r.source=e,r.subjectFactory=t,r._subject=null,r._refCount=0,r._connection=null,hc.hasLift(e)&&(r.lift=e.lift),r}l.ConnectableObservable=ao;var yc,_c,vc,mc,gc,T={},Uo={},j=(yc=Uo,Object.defineProperty(yc,"__esModule",{value:!0}),yc.performanceTimestampProvider=void 0,yc.performanceTimestampProvider={now:function(){return(yc.performanceTimestampProvider.delegate||performance).now()},delegate:void 0},{}),Oc=(_c=j,vc=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},mc=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Object.defineProperty(_c,"__esModule",{value:!0}),_c.animationFrameProvider=void 0,gc=o,_c.animationFrameProvider={schedule:function(t){var e=requestAnimationFrame,r=cancelAnimationFrame,n=_c.animationFrameProvider.delegate,o=(n&&(e=n.requestAnimationFrame,r=n.cancelAnimationFrame),e(function(e){r=void 0,t(e)}));return new gc.Subscription(function(){return null==r?void 0:r(o)})},requestAnimationFrame:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=_c.animationFrameProvider.delegate;return((null==r?void 0:r.requestAnimationFrame)||requestAnimationFrame).apply(void 0,mc([],vc(e)))},cancelAnimationFrame:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=_c.animationFrameProvider.delegate;return((null==r?void 0:r.cancelAnimationFrame)||cancelAnimationFrame).apply(void 0,mc([],vc(e)))},delegate:void 0},Object.defineProperty(T,"__esModule",{value:!0}),T.animationFrames=void 0,w),wc=Uo,Ec=j;function Pc(a){return new Oc.Observable(function(r){var n=a||wc.performanceTimestampProvider,o=n.now(),i=0,u=function(){r.closed||(i=Ec.animationFrameProvider.requestAnimationFrame(function(e){i=0;var t=n.now();r.next({timestamp:a?t:e,elapsed:t-o}),u()}))};return u(),function(){i&&Ec.animationFrameProvider.cancelAnimationFrame(i)}})}T.animationFrames=function(e){return e?Pc(e):jc};var Tc,Sc,jc=Pc(),S={},v={},Ar=(Object.defineProperty(v,"__esModule",{value:!0}),v.ObjectUnsubscribedError=void 0,F),y=(v.ObjectUnsubscribedError=Ar.createErrorClass(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),r&&r.__extends||(Tc=function(e,t){return(Tc=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Tc(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),Cc=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ic=(Object.defineProperty(S,"__esModule",{value:!0}),S.AnonymousSubject=S.Subject=void 0,w),Rc=o,Ac=v,Mc=E,Nc=m,O=(Sc=Ic.Observable,y(kc,Sc),kc.prototype.lift=function(e){var t=new Dc(this,this);return t.operator=e,t},kc.prototype._throwIfClosed=function(){if(this.closed)throw new Ac.ObjectUnsubscribedError},kc.prototype.next=function(o){var i=this;Nc.errorContext(function(){var t,e;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var r=Cc(i.currentObservers),n=r.next();!n.done;n=r.next())n.value.next(o)}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}}})},kc.prototype.error=function(t){var r=this;Nc.errorContext(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=t;for(var e=r.observers;e.length;)e.shift().error(t)}})},kc.prototype.complete=function(){var t=this;Nc.errorContext(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}})},kc.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(kc.prototype,"observed",{get:function(){var e;return 0<(null==(e=this.observers)?void 0:e.length)},enumerable:!1,configurable:!0}),kc.prototype._trySubscribe=function(e){return this._throwIfClosed(),Sc.prototype._trySubscribe.call(this,e)},kc.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},kc.prototype._innerSubscribe=function(e){var t=this,r=this.hasError,n=this.isStopped,o=this.observers;return r||n?Rc.EMPTY_SUBSCRIPTION:(this.currentObservers=null,o.push(e),new Rc.Subscription(function(){t.currentObservers=null,Mc.arrRemove(o,e)}))},kc.prototype._checkFinalizedStatuses=function(e){var t=this.hasError,r=this.thrownError,n=this.isStopped;t?e.error(r):n&&e.complete()},kc.prototype.asObservable=function(){var e=new Ic.Observable;return e.source=this,e},kc.create=function(e,t){return new Dc(e,t)},kc);function kc(){var e=Sc.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}S.Subject=O;y(Uc,xc=O),Uc.prototype.next=function(e){var t,r;null!=(r=null==(t=this.destination)?void 0:t.next)&&r.call(t,e)},Uc.prototype.error=function(e){var t,r;null!=(r=null==(t=this.destination)?void 0:t.error)&&r.call(t,e)},Uc.prototype.complete=function(){var e,t;null!=(t=null==(e=this.destination)?void 0:e.complete)&&t.call(e)},Uc.prototype._subscribe=function(e){var t;return null!=(t=null==(t=this.source)?void 0:t.subscribe(e))?t:Rc.EMPTY_SUBSCRIPTION};var xc,Dc=Uc;function Uc(e,t){var r=xc.call(this)||this;return r.destination=e,r.source=t,r}S.AnonymousSubject=Dc;var Lc,pe={},ro=r&&r.__extends||(Lc=function(e,t){return(Lc=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Lc(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(pe,"__esModule",{value:!0}),pe.BehaviorSubject=void 0;Fc=S.Subject,ro(Bc,Fc),Object.defineProperty(Bc.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),Bc.prototype._subscribe=function(e){var t=Fc.prototype._subscribe.call(this,e);return t.closed||e.next(this._value),t},Bc.prototype.getValue=function(){var e=this.hasError,t=this.thrownError,r=this._value;if(e)throw t;return this._throwIfClosed(),r},Bc.prototype.next=function(e){Fc.prototype.next.call(this,this._value=e)};var Fc,so=Bc;function Bc(e){var t=Fc.call(this)||this;return t._value=e,t}pe.BehaviorSubject=so;var Vc,qc,P={},Rt={},p=(Vc=Rt,Object.defineProperty(Vc,"__esModule",{value:!0}),Vc.dateTimestampProvider=void 0,Vc.dateTimestampProvider={now:function(){return(Vc.dateTimestampProvider.delegate||Date).now()},delegate:void 0},r&&r.__extends||(qc=function(e,t){return(qc=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}qc(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}));Object.defineProperty(P,"__esModule",{value:!0}),P.ReplaySubject=void 0;var Wc,zc=Rt,n=(Wc=S.Subject,p(Hc,Wc),Hc.prototype.next=function(e){var t=this.isStopped,r=this._buffer,n=this._infiniteTimeWindow,o=this._timestampProvider,i=this._windowTime;t||(r.push(e),n)||r.push(o.now()+i),this._trimBuffer(),Wc.prototype.next.call(this,e)},Hc.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),r=this._infiniteTimeWindow,n=this._buffer.slice(),o=0;o<n.length&&!e.closed;o+=r?1:2)e.next(n[o]);return this._checkFinalizedStatuses(e),t},Hc.prototype._trimBuffer=function(){var e=this._bufferSize,t=this._timestampProvider,r=this._buffer,n=this._infiniteTimeWindow,o=(n?1:2)*e;if(e<1/0&&o<r.length&&r.splice(0,r.length-o),!n){for(var i=t.now(),u=0,a=1;a<r.length&&r[a]<=i;a+=2)u=a;u&&r.splice(0,u+1)}},Hc);function Hc(e,t,r){void 0===e&&(e=1/0),void 0===t&&(t=1/0),void 0===r&&(r=zc.dateTimestampProvider);var n=Wc.call(this)||this;return n._bufferSize=e,n._windowTime=t,n._timestampProvider=r,n._buffer=[],n._infiniteTimeWindow=!0,n._infiniteTimeWindow=t===1/0,n._bufferSize=Math.max(1,e),n._windowTime=Math.max(1,t),n}P.ReplaySubject=n;var Gc,G={},ao=r&&r.__extends||(Gc=function(e,t){return(Gc=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Gc(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(G,"__esModule",{value:!0}),G.AsyncSubject=void 0;Yc=S.Subject,ao(Kc,Yc),Kc.prototype._checkFinalizedStatuses=function(e){var t=this.hasError,r=this._hasValue,n=this._value,o=this.thrownError,i=this.isStopped,u=this._isComplete;t?e.error(o):(i||u)&&(r&&e.next(n),e.complete())},Kc.prototype.next=function(e){this.isStopped||(this._value=e,this._hasValue=!0)},Kc.prototype.complete=function(){var e=this._hasValue,t=this._value;this._isComplete||(this._isComplete=!0,e&&Yc.prototype.next.call(this,t),Yc.prototype.complete.call(this))};var Yc,Uo=Kc;function Kc(){var e=null!==Yc&&Yc.apply(this,arguments)||this;return e._value=null,e._hasValue=!1,e._isComplete=!1,e}G.AsyncSubject=Uo;var Zc,Ar={},m={},y={},O={},ro=r&&r.__extends||(Zc=function(e,t){return(Zc=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Zc(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(O,"__esModule",{value:!0}),O.Action=void 0;Qc=o.Subscription,ro(Xc,Qc),Xc.prototype.schedule=function(e,t){return this};var Qc,so=Xc;function Xc(e,t){return Qc.call(this)||this}O.Action=so;var Jc,$c,el,tl,p={},n=(Jc=p,$c=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},el=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Object.defineProperty(Jc,"__esModule",{value:!0}),Jc.intervalProvider=void 0,Jc.intervalProvider={setInterval:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=Jc.intervalProvider.delegate;return null!=o&&o.setInterval?o.setInterval.apply(o,el([e,t],$c(r))):setInterval.apply(void 0,el([e,t],$c(r)))},clearInterval:function(e){var t=Jc.intervalProvider.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},r&&r.__extends||(tl=function(e,t){return(tl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}tl(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}));Object.defineProperty(y,"__esModule",{value:!0}),y.AsyncAction=void 0;var rl,nl=p,ol=E,ao=(rl=O.Action,n(il,rl),il.prototype.schedule=function(e,t){var r;return void 0===t&&(t=0),this.closed||(this.state=e,e=this.id,r=this.scheduler,null!=e&&(this.id=this.recycleAsyncId(r,e,t)),this.pending=!0,this.delay=t,this.id=null!=(e=this.id)?e:this.requestAsyncId(r,this.id,t)),this},il.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),nl.intervalProvider.setInterval(e.flush.bind(e,this),r)},il.prototype.recycleAsyncId=function(e,t,r){if(null!=(r=void 0===r?0:r)&&this.delay===r&&!1===this.pending)return t;null!=t&&nl.intervalProvider.clearInterval(t)},il.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;e=this._execute(e,t);if(e)return e;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},il.prototype._execute=function(e,t){var r,n=!1;try{this.work(e)}catch(e){n=!0,r=e||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),r},il.prototype.unsubscribe=function(){var e,t,r;this.closed||(e=this.id,r=(t=this.scheduler).actions,this.work=this.state=this.scheduler=null,this.pending=!1,ol.arrRemove(r,this),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null,rl.prototype.unsubscribe.call(this))},il);function il(e,t){var r=rl.call(this,e,t)||this;return r.scheduler=e,r.work=t,r.pending=!1,r}y.AsyncAction=ao;var ul,al,sl,cl,ll,fl,Uo={},ro={},pl=(Object.defineProperty(ro,"__esModule",{value:!0}),ro.TestTools=ro.Immediate=void 0,1),dl={};function hl(e){return e in dl&&(delete dl[e],!0)}ro.Immediate={setImmediate:function(e){var t=pl++;return dl[t]=!0,(ul=ul||Promise.resolve()).then(function(){return hl(t)&&e()}),t},clearImmediate:function(e){hl(e)}},ro.TestTools={pending:function(){return Object.keys(dl).length}},al=Uo,sl=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},cl=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Object.defineProperty(al,"__esModule",{value:!0}),al.immediateProvider=void 0,ll=ro.Immediate.setImmediate,fl=ro.Immediate.clearImmediate,al.immediateProvider={setImmediate:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=al.immediateProvider.delegate;return((null==r?void 0:r.setImmediate)||ll).apply(void 0,cl([],sl(e)))},clearImmediate:function(e){var t=al.immediateProvider.delegate;return((null==t?void 0:t.clearImmediate)||fl)(e)},delegate:void 0};var bl,so=r&&r.__extends||(bl=function(e,t){return(bl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}bl(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(m,"__esModule",{value:!0}),m.AsapAction=void 0;var yl,_l=Uo,p=(yl=y.AsyncAction,so(vl,yl),vl.prototype.requestAsyncId=function(e,t,r){return null!==(r=void 0===r?0:r)&&0<r?yl.prototype.requestAsyncId.call(this,e,t,r):(e.actions.push(this),e._scheduled||(e._scheduled=_l.immediateProvider.setImmediate(e.flush.bind(e,void 0))))},vl.prototype.recycleAsyncId=function(e,t,r){if(null!=(r=void 0===r?0:r)?0<r:0<this.delay)return yl.prototype.recycleAsyncId.call(this,e,t,r);var r=e.actions;null!=t&&(null==(r=r[r.length-1])?void 0:r.id)!==t&&(_l.immediateProvider.clearImmediate(t),e._scheduled===t)&&(e._scheduled=void 0)},vl);function vl(e,t){var r=yl.call(this,e,t)||this;return r.scheduler=e,r.work=t,r}m.AsapAction=p;O={},n={},ao={},Object.defineProperty(ao,"__esModule",{value:!0}),ao.Scheduler=void 0,ro=Rt;function ml(e,t){void 0===t&&(t=ml.now),this.schedulerActionCtor=e,this.now=t}ml.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(r,t)},ml.now=ro.dateTimestampProvider.now,ao.Scheduler=ml;var gl,Ol,Uo=r&&r.__extends||(gl=function(e,t){return(gl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}gl(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),wl=(Object.defineProperty(n,"__esModule",{value:!0}),n.AsyncScheduler=void 0,ao),so=(Ol=wl.Scheduler,Uo(El,Ol),El.prototype.flush=function(e){var t,r=this.actions;if(this._active)r.push(e);else{this._active=!0;do{if(t=e.execute(e.state,e.delay))break}while(e=r.shift());if(this._active=!1,t){for(;e=r.shift();)e.unsubscribe();throw t}}},El);function El(e,t){void 0===t&&(t=wl.Scheduler.now);e=Ol.call(this,e,t)||this;return e.actions=[],e._active=!1,e}n.AsyncScheduler=so;var Pl,p=r&&r.__extends||(Pl=function(e,t){return(Pl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Pl(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(O,"__esModule",{value:!0}),O.AsapScheduler=void 0;Tl=n.AsyncScheduler,p(Sl,Tl),Sl.prototype.flush=function(e){this._active=!0;var t,r=this._scheduled,n=(this._scheduled=void 0,this.actions);e=e||n.shift();do{if(t=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===r&&n.shift());if(this._active=!1,t){for(;(e=n[0])&&e.id===r&&n.shift();)e.unsubscribe();throw t}};var Tl,ro=Sl;function Sl(){return null!==Tl&&Tl.apply(this,arguments)||this}O.AsapScheduler=ro,Uo=Ar,Object.defineProperty(Uo,"__esModule",{value:!0}),Uo.asap=Uo.asapScheduler=void 0,Uo.asapScheduler=new O.AsapScheduler(m.AsapAction),Uo.asap=Uo.asapScheduler;var jl,so={},ro=(p=so,Object.defineProperty(p,"__esModule",{value:!0}),p.async=p.asyncScheduler=void 0,p.asyncScheduler=new n.AsyncScheduler(y.AsyncAction),p.async=p.asyncScheduler,{}),O={},m=r&&r.__extends||(jl=function(e,t){return(jl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}jl(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(O,"__esModule",{value:!0}),O.QueueAction=void 0;Cl=y.AsyncAction,m(Il,Cl),Il.prototype.schedule=function(e,t){return 0<(t=void 0===t?0:t)?Cl.prototype.schedule.call(this,e,t):(this.delay=t,this.state=e,this.scheduler.flush(this),this)},Il.prototype.execute=function(e,t){return 0<t||this.closed?Cl.prototype.execute.call(this,e,t):this._execute(e,t)},Il.prototype.requestAsyncId=function(e,t,r){return null!=(r=void 0===r?0:r)&&0<r||null==r&&0<this.delay?Cl.prototype.requestAsyncId.call(this,e,t,r):(e.flush(this),0)};var Cl,Uo=Il;function Il(e,t){var r=Cl.call(this,e,t)||this;return r.scheduler=e,r.work=t,r}O.QueueAction=Uo;var Rl,p={},m=r&&r.__extends||(Rl=function(e,t){return(Rl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Rl(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(p,"__esModule",{value:!0}),p.QueueScheduler=void 0;Al=n.AsyncScheduler,m(Ml,Al);var Al,Uo=Ml;function Ml(){return null!==Al&&Al.apply(this,arguments)||this}p.QueueScheduler=Uo,m=ro,Object.defineProperty(m,"__esModule",{value:!0}),m.queue=m.queueScheduler=void 0,m.queueScheduler=new p.QueueScheduler(O.QueueAction),m.queue=m.queueScheduler;var Nl,Uo={},p={},O=r&&r.__extends||(Nl=function(e,t){return(Nl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Nl(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(p,"__esModule",{value:!0}),p.AnimationFrameAction=void 0;var kl,xl=j,m=(kl=y.AsyncAction,O(Dl,kl),Dl.prototype.requestAsyncId=function(e,t,r){return null!==(r=void 0===r?0:r)&&0<r?kl.prototype.requestAsyncId.call(this,e,t,r):(e.actions.push(this),e._scheduled||(e._scheduled=xl.animationFrameProvider.requestAnimationFrame(function(){return e.flush(void 0)})))},Dl.prototype.recycleAsyncId=function(e,t,r){if(null!=(r=void 0===r?0:r)?0<r:0<this.delay)return kl.prototype.recycleAsyncId.call(this,e,t,r);var r=e.actions;null!=t&&t===e._scheduled&&(null==(r=r[r.length-1])?void 0:r.id)!==t&&(xl.animationFrameProvider.cancelAnimationFrame(t),e._scheduled=void 0)},Dl);function Dl(e,t){var r=kl.call(this,e,t)||this;return r.scheduler=e,r.work=t,r}p.AnimationFrameAction=m;var Ul,j={},O=r&&r.__extends||(Ul=function(e,t){return(Ul=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ul(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(j,"__esModule",{value:!0}),j.AnimationFrameScheduler=void 0;Ll=n.AsyncScheduler,O(Fl,Ll),Fl.prototype.flush=function(e){this._active=!0,e?t=e.id:(t=this._scheduled,this._scheduled=void 0);var t,r,n=this.actions;e=e||n.shift();do{if(r=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}};var Ll,m=Fl;function Fl(){return null!==Ll&&Ll.apply(this,arguments)||this}j.AnimationFrameScheduler=m,O=Uo,Object.defineProperty(O,"__esModule",{value:!0}),O.animationFrame=O.animationFrameScheduler=void 0,O.animationFrameScheduler=new j.AnimationFrameScheduler(p.AnimationFrameAction),O.animationFrame=O.animationFrameScheduler;var Bl,Vl,m={},j=r&&r.__extends||(Bl=function(e,t){return(Bl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Bl(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),p=(Object.defineProperty(m,"__esModule",{value:!0}),m.VirtualAction=m.VirtualTimeScheduler=void 0,y),ql=o,O=(Vl=n.AsyncScheduler,j(Wl,Vl),Wl.prototype.flush=function(){for(var e,t,r=this.actions,n=this.maxFrames;(t=r[0])&&t.delay<=n&&(r.shift(),this.frame=t.delay,!(e=t.execute(t.state,t.delay))););if(e){for(;t=r.shift();)t.unsubscribe();throw e}},Wl.frameTimeFactor=10,Wl);function Wl(e,t){void 0===t&&(t=1/0);var r=Vl.call(this,e=void 0===e?Hl:e,function(){return r.frame})||this;return r.maxFrames=t,r.frame=0,r.index=-1,r}m.VirtualTimeScheduler=O;zl=p.AsyncAction,j(Gl,zl),Gl.prototype.schedule=function(e,t){if(void 0===t&&(t=0),Number.isFinite(t)){if(!this.id)return zl.prototype.schedule.call(this,e,t);this.active=!1;var r=new Gl(this.scheduler,this.work);return this.add(r),r.schedule(e,t)}return ql.Subscription.EMPTY},Gl.prototype.requestAsyncId=function(e,t,r){this.delay=e.frame+(r=void 0===r?0:r);r=e.actions;return r.push(this),r.sort(Gl.sortActions),1},Gl.prototype.recycleAsyncId=function(e,t,r){},Gl.prototype._execute=function(e,t){if(!0===this.active)return zl.prototype._execute.call(this,e,t)},Gl.sortActions=function(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1};var zl,Hl=Gl;function Gl(e,t,r){void 0===r&&(r=e.index+=1);var n=zl.call(this,e,t)||this;return n.scheduler=e,n.work=t,n.index=r,n.active=!0,n.index=e.index=r,n}m.VirtualAction=Hl;var Yl,Kl,y={},n={},O=(Yl=n,Object.defineProperty(Yl,"__esModule",{value:!0}),Yl.empty=Yl.EMPTY=void 0,Kl=w,Yl.EMPTY=new Kl.Observable(function(e){return e.complete()}),Yl.empty=function(e){return e?(t=e,new Kl.Observable(function(e){return t.schedule(function(){return e.complete()})})):Yl.EMPTY;var t},{}),p={},j={},Zl=(Object.defineProperty(j,"__esModule",{value:!0}),j.isScheduler=void 0,_);j.isScheduler=function(e){return e&&Zl.isFunction(e.schedule)},Object.defineProperty(p,"__esModule",{value:!0}),p.popNumber=p.popScheduler=p.popResultSelector=void 0;var Ql=_,Xl=j;function Jl(e){return e[e.length-1]}p.popResultSelector=function(e){return Ql.isFunction(Jl(e))?e.pop():void 0},p.popScheduler=function(e){return Xl.isScheduler(Jl(e))?e.pop():void 0},p.popNumber=function(e,t){return"number"==typeof Jl(e)?e.pop():t};var $l={},ef={},tf={},C={},rf={},nf=(Object.defineProperty(rf,"__esModule",{value:!0}),rf.isArrayLike=void 0,rf.isArrayLike=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e},{}),of=(Object.defineProperty(nf,"__esModule",{value:!0}),nf.isPromise=void 0,_);nf.isPromise=function(e){return of.isFunction(null==e?void 0:e.then)};var uf={},af=(Object.defineProperty(uf,"__esModule",{value:!0}),uf.isInteropObservable=void 0,t),sf=_;uf.isInteropObservable=function(e){return sf.isFunction(e[af.observable])};var cf={},lf=(Object.defineProperty(cf,"__esModule",{value:!0}),cf.isAsyncIterable=void 0,_);cf.isAsyncIterable=function(e){return Symbol.asyncIterator&&lf.isFunction(null==e?void 0:e[Symbol.asyncIterator])};var ff={};Object.defineProperty(ff,"__esModule",{value:!0}),ff.createInvalidObservableTypeError=void 0,ff.createInvalidObservableTypeError=function(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")};var pf={},df={};function hf(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}Object.defineProperty(df,"__esModule",{value:!0}),df.iterator=df.getSymbolIterator=void 0,df.getSymbolIterator=hf,df.iterator=hf(),Object.defineProperty(pf,"__esModule",{value:!0}),pf.isIterable=void 0;var bf=df,yf=_;pf.isIterable=function(e){return yf.isFunction(null==e?void 0:e[bf.iterator])};var _f={},vf=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))s.label=t[1];else if(6===t[0]&&s.label<a[1])s.label=a[1],a=t;else{if(!(a&&s.label<a[2])){a[2]&&s.ops.pop(),s.trys.pop();continue}s.label=a[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},mf=r&&r.__await||function(e){return this instanceof mf?(this.v=e,this):new mf(e)},gf=r&&r.__asyncGenerator||function(e,t,r){var o,i,u;if(Symbol.asyncIterator)return o=r.apply(e,t||[]),i=[],u={},n("next"),n("throw"),n("return"),u[Symbol.asyncIterator]=function(){return this},u;throw new TypeError("Symbol.asyncIterator is not defined.");function n(n){o[n]&&(u[n]=function(r){return new Promise(function(e,t){1<i.push([n,r,e,t])||a(n,r)})})}function a(e,t){try{(r=o[e](t)).value instanceof mf?Promise.resolve(r.value.v).then(s,c):l(i[0][2],r)}catch(e){l(i[0][3],e)}var r}function s(e){a("next",e)}function c(e){a("throw",e)}function l(e,t){e(t),i.shift(),i.length&&a(i[0][0],i[0][1])}},Of=(Object.defineProperty(_f,"__esModule",{value:!0}),_f.isReadableStreamLike=_f.readableStreamLikeToAsyncGenerator=void 0,_);_f.readableStreamLikeToAsyncGenerator=function(o){return gf(this,arguments,function(){var t,r,n;return vf(this,function(e){switch(e.label){case 0:t=o.getReader(),e.label=1;case 1:e.trys.push([1,,9,10]),e.label=2;case 2:return[4,mf(t.read())];case 3:return(r=e.sent(),n=r.value,r.done)?[4,mf(void 0)]:[3,5];case 4:return[2,e.sent()];case 5:return[4,mf(n)];case 6:return[4,e.sent()];case 7:return e.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})},_f.isReadableStreamLike=function(e){return Of.isFunction(null==e?void 0:e.getReader)};var wf=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},Ef=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))s.label=t[1];else if(6===t[0]&&s.label<a[1])s.label=a[1],a=t;else{if(!(a&&s.label<a[2])){a[2]&&s.ops.pop(),s.trys.pop();continue}s.label=a[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Pf=r&&r.__asyncValues||function(u){var e,t;if(Symbol.asyncIterator)return(e=u[Symbol.asyncIterator])?e.call(u):(u="function"==typeof Tf?Tf(u):u[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);throw new TypeError("Symbol.asyncIterator is not defined.");function r(i){t[i]=u[i]&&function(o){return new Promise(function(e,t){var r,n;o=u[i](o),r=e,e=t,n=o.done,t=o.value,Promise.resolve(t).then(function(e){r({value:e,done:n})},e)})}}},Tf=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Sf=(Object.defineProperty(C,"__esModule",{value:!0}),C.fromReadableStreamLike=C.fromAsyncIterable=C.fromIterable=C.fromPromise=C.fromArrayLike=C.fromInteropObservable=C.innerFrom=void 0,rf),jf=nf,Cf=w,If=uf,Rf=cf,Af=ff,Mf=pf,Nf=_f,kf=_,xf=a,Df=t;function Uf(r){return new Cf.Observable(function(e){var t=r[Df.observable]();if(kf.isFunction(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Lf(r){return new Cf.Observable(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()})}function Ff(e){return new Cf.Observable(function(t){e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,xf.reportUnhandledError)})}function Bf(u){return new Cf.Observable(function(e){var t,r;try{for(var n=Tf(u),o=n.next();!o.done;o=n.next()){var i=o.value;if(e.next(i),e.closed)return}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}e.complete()})}function Vf(e){return new Cf.Observable(function(t){!function(r,n){var o,i,u,a;return wf(this,void 0,void 0,function(){var t;return Ef(this,function(e){switch(e.label){case 0:e.trys.push([0,5,6,11]),o=Pf(r),e.label=1;case 1:return[4,o.next()];case 2:if((i=e.sent()).done)return[3,4];if(t=i.value,n.next(t),n.closed)return[2];e.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return t=e.sent(),u={error:t},[3,11];case 6:return(e.trys.push([6,,9,10]),i&&!i.done&&(a=o.return))?[4,a.call(o)]:[3,8];case 7:e.sent(),e.label=8;case 8:return[3,10];case 9:if(u)throw u.error;return[7];case 10:return[7];case 11:return n.complete(),[2]}})})}(e,t).catch(function(e){return t.error(e)})})}function qf(e){return Vf(Nf.readableStreamLikeToAsyncGenerator(e))}C.innerFrom=function(e){if(e instanceof Cf.Observable)return e;if(null!=e){if(If.isInteropObservable(e))return Uf(e);if(Sf.isArrayLike(e))return Lf(e);if(jf.isPromise(e))return Ff(e);if(Rf.isAsyncIterable(e))return Vf(e);if(Mf.isIterable(e))return Bf(e);if(Nf.isReadableStreamLike(e))return qf(e)}throw Af.createInvalidObservableTypeError(e)},C.fromInteropObservable=Uf,C.fromArrayLike=Lf,C.fromPromise=Ff,C.fromIterable=Bf,C.fromAsyncIterable=Vf,C.fromReadableStreamLike=qf;var a={},Wf={};Object.defineProperty(Wf,"__esModule",{value:!0}),Wf.executeSchedule=void 0,Wf.executeSchedule=function(e,t,r,n,o){if(void 0===n&&(n=0),void 0===o&&(o=!1),t=t.schedule(function(){r(),o?e.add(this.schedule(null,n)):this.unsubscribe()},n),e.add(t),!o)return t},Object.defineProperty(a,"__esModule",{value:!0}),a.observeOn=void 0;var zf=Wf,Hf=h,Gf=b;a.observeOn=function(r,n){return void 0===n&&(n=0),Hf.operate(function(e,t){e.subscribe(Gf.createOperatorSubscriber(t,function(e){return zf.executeSchedule(t,r,function(){return t.next(e)},n)},function(){return zf.executeSchedule(t,r,function(){return t.complete()},n)},function(e){return zf.executeSchedule(t,r,function(){return t.error(e)},n)}))})};var Yf={},Kf=(Object.defineProperty(Yf,"__esModule",{value:!0}),Yf.subscribeOn=void 0,h);Yf.subscribeOn=function(r,n){return void 0===n&&(n=0),Kf.operate(function(e,t){t.add(r.schedule(function(){return e.subscribe(t)},n))})},Object.defineProperty(tf,"__esModule",{value:!0}),tf.scheduleObservable=void 0;var Zf=C,Qf=a,Xf=Yf;tf.scheduleObservable=function(e,t){return Zf.innerFrom(e).pipe(Xf.subscribeOn(t),Qf.observeOn(t))};var Jf={},$f=(Object.defineProperty(Jf,"__esModule",{value:!0}),Jf.schedulePromise=void 0,C),ep=a,tp=Yf;Jf.schedulePromise=function(e,t){return $f.innerFrom(e).pipe(tp.subscribeOn(t),ep.observeOn(t))};var rp={},np=(Object.defineProperty(rp,"__esModule",{value:!0}),rp.scheduleArray=void 0,w);rp.scheduleArray=function(r,n){return new np.Observable(function(e){var t=0;return n.schedule(function(){t===r.length?e.complete():(e.next(r[t++]),e.closed||this.schedule())})})};var op={},ip=(Object.defineProperty(op,"__esModule",{value:!0}),op.scheduleIterable=void 0,w),up=df,ap=_,sp=Wf;op.scheduleIterable=function(e,t){return new ip.Observable(function(n){var o;return sp.executeSchedule(n,t,function(){o=e[up.iterator](),sp.executeSchedule(n,t,function(){var e,t,r;try{t=(e=o.next()).value,r=e.done}catch(e){return void n.error(e)}r?n.complete():n.next(t)},0,!0)}),function(){return ap.isFunction(null==o?void 0:o.return)&&o.return()}})};var df={},cp=(Object.defineProperty(df,"__esModule",{value:!0}),df.scheduleAsyncIterable=void 0,w),lp=Wf;df.scheduleAsyncIterable=function(r,n){if(r)return new cp.Observable(function(t){lp.executeSchedule(t,n,function(){var e=r[Symbol.asyncIterator]();lp.executeSchedule(t,n,function(){e.next().then(function(e){e.done?t.complete():t.next(e.value)})},0,!0)})});throw new Error("Iterable cannot be null")};var fp={},pp=(Object.defineProperty(fp,"__esModule",{value:!0}),fp.scheduleReadableStreamLike=void 0,df),dp=_f;fp.scheduleReadableStreamLike=function(e,t){return pp.scheduleAsyncIterable(dp.readableStreamLikeToAsyncGenerator(e),t)},Object.defineProperty(ef,"__esModule",{value:!0}),ef.scheduled=void 0;var hp=tf,bp=Jf,yp=rp,_p=op,vp=df,mp=uf,gp=nf,Op=rf,wp=pf,Ep=cf,Pp=ff,Tp=_f,Sp=fp;ef.scheduled=function(e,t){if(null!=e){if(mp.isInteropObservable(e))return hp.scheduleObservable(e,t);if(Op.isArrayLike(e))return yp.scheduleArray(e,t);if(gp.isPromise(e))return bp.schedulePromise(e,t);if(Ep.isAsyncIterable(e))return vp.scheduleAsyncIterable(e,t);if(wp.isIterable(e))return _p.scheduleIterable(e,t);if(Tp.isReadableStreamLike(e))return Sp.scheduleReadableStreamLike(e,t)}throw Pp.createInvalidObservableTypeError(e)},Object.defineProperty($l,"__esModule",{value:!0}),$l.from=void 0;var jp=ef,Cp=C;$l.from=function(e,t){return t?jp.scheduled(e,t):Cp.innerFrom(e)},Object.defineProperty(O,"__esModule",{value:!0}),O.of=void 0;var Ip=p,Rp=$l;O.of=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Ip.popScheduler(e);return Rp.from(e,r)};var Ap,Mp,Np,kp,tf={},xp=(Object.defineProperty(tf,"__esModule",{value:!0}),tf.throwError=void 0,w),Dp=_;function Up(e,t,r){this.kind=e,this.value=t,this.error=r,this.hasValue="N"===e}function Lp(e,t){var r,n=e.kind,o=e.value,e=e.error;if("string"!=typeof n)throw new TypeError('Invalid notification, missing "kind"');"N"===n?null!=(r=t.next)&&r.call(t,o):"E"===n?null!=(r=t.error)&&r.call(t,e):null!=(o=t.complete)&&o.call(t)}tf.throwError=function(e,t){function r(e){return e.error(n())}var n=Dp.isFunction(e)?e:function(){return e};return new xp.Observable(t?function(e){return t.schedule(r,0,e)}:r)},Jf=y,Object.defineProperty(Jf,"__esModule",{value:!0}),Jf.observeNotification=Jf.Notification=Jf.NotificationKind=void 0,Ap=n,Mp=O,Np=tf,kp=_,(rp=Jf.NotificationKind||(Jf.NotificationKind={})).NEXT="N",rp.ERROR="E",rp.COMPLETE="C",Up.prototype.observe=function(e){return Lp(this,e)},Up.prototype.do=function(e,t,r){var n=this.kind,o=this.value,i=this.error;return"N"===n?null==e?void 0:e(o):"E"===n?null==t?void 0:t(i):null==r?void 0:r()},Up.prototype.accept=function(e,t,r){var n;return kp.isFunction(null==(n=e)?void 0:n.next)?this.observe(e):this.do(e,t,r)},Up.prototype.toObservable=function(){var e=this.kind,t=this.value,r=this.error,t="N"===e?Mp.of(t):"E"===e?Np.throwError(function(){return r}):"C"===e?Ap.EMPTY:0;if(t)return t;throw new TypeError("Unexpected notification kind "+e)},Up.createNext=function(e){return new Up("N",e)},Up.createError=function(e){return new Up("E",void 0,e)},Up.createComplete=function(){return Up.completeNotification},Up.completeNotification=new Up("C"),rp=Up,Jf.Notification=rp,Jf.observeNotification=Lp;var df={},Fp=(Object.defineProperty(df,"__esModule",{value:!0}),df.isObservable=void 0,w),Bp=_;df.isObservable=function(e){return!!e&&(e instanceof Fp.Observable||Bp.isFunction(e.lift)&&Bp.isFunction(e.subscribe))};var uf={},nf={},pf=(Object.defineProperty(nf,"__esModule",{value:!0}),nf.EmptyError=void 0,F),Vp=(nf.EmptyError=pf.createErrorClass(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}),Object.defineProperty(uf,"__esModule",{value:!0}),uf.lastValueFrom=void 0,nf);uf.lastValueFrom=function(o,i){var u="object"==typeof i;return new Promise(function(e,t){var r,n=!1;o.subscribe({next:function(e){r=e,n=!0},error:t,complete:function(){n?e(r):u?e(i.defaultValue):t(new Vp.EmptyError)}})})};var cf={},qp=(Object.defineProperty(cf,"__esModule",{value:!0}),cf.firstValueFrom=void 0,nf),Wp=Zn;cf.firstValueFrom=function(n,o){var i="object"==typeof o;return new Promise(function(t,e){var r=new Wp.SafeSubscriber({next:function(e){t(e),r.unsubscribe()},error:e,complete:function(){i?t(o.defaultValue):e(new qp.EmptyError)}});n.subscribe(r)})};var zp,Hp,Gp,Yp,Kp,Zp,Qp,ff={},_f=(Object.defineProperty(ff,"__esModule",{value:!0}),ff.ArgumentOutOfRangeError=void 0,F),fp=(ff.ArgumentOutOfRangeError=_f.createErrorClass(function(e){return function(){e(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}}),{}),rp=(Object.defineProperty(fp,"__esModule",{value:!0}),fp.NotFoundError=void 0,F),Jf=(fp.NotFoundError=rp.createErrorClass(function(t){return function(e){t(this),this.name="NotFoundError",this.message=e}}),{}),pf=(Object.defineProperty(Jf,"__esModule",{value:!0}),Jf.SequenceError=void 0,F),_f=(Jf.SequenceError=pf.createErrorClass(function(t){return function(e){t(this),this.name="SequenceError",this.message=e}}),{}),rp={};function Xp(e){throw new zp.TimeoutError(e)}Object.defineProperty(rp,"__esModule",{value:!0}),rp.isValidDate=void 0,rp.isValidDate=function(e){return e instanceof Date&&!isNaN(e)},zp=_f,Object.defineProperty(zp,"__esModule",{value:!0}),zp.timeout=zp.TimeoutError=void 0,Hp=so,Gp=rp,Yp=h,Kp=C,Zp=b,Qp=Wf,zp.TimeoutError=F.createErrorClass(function(t){return function(e){void 0===e&&(e=null),t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=e}}),zp.timeout=function(e,t){var a=(e=Gp.isValidDate(e)?{first:e}:"number"==typeof e?{each:e}:e).first,s=e.each,r=e.with,c=void 0===r?Xp:r,l=void 0===(r=e.scheduler)?null!=t?t:Hp.asyncScheduler:r,f=void 0===(t=e.meta)?null:t;if(null==a&&null==s)throw new TypeError("No timeout provided.");return Yp.operate(function(e,t){function r(e){n=Qp.executeSchedule(t,l,function(){try{u.unsubscribe(),Kp.innerFrom(c({meta:f,lastValue:o,seen:i})).subscribe(t)}catch(e){t.error(e)}},e)}var n,o=null,i=0,u=e.subscribe(Zp.createOperatorSubscriber(t,function(e){null!=n&&n.unsubscribe(),i++,t.next(o=e),0<s&&r(s)},void 0,void 0,function(){null!=n&&n.closed||null!=n&&n.unsubscribe(),o=null}));i||r(null!=a?"number"==typeof a?a:+a-l.now():s)})};var pf={},F={},Jp={},$p={},ed=(Object.defineProperty($p,"__esModule",{value:!0}),$p.map=void 0,h),td=b;$p.map=function(n,o){return ed.operate(function(e,t){var r=0;e.subscribe(td.createOperatorSubscriber(t,function(e){t.next(n.call(o,e,r++))}))})};var rd=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},nd=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},od=(Object.defineProperty(Jp,"__esModule",{value:!0}),Jp.mapOneOrManyArgs=void 0,$p),id=Array.isArray;Jp.mapOneOrManyArgs=function(r){return od.map(function(e){return t=r,id(e=e)?t.apply(void 0,nd([],rd(e))):t(e);var t})};var ud=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},ad=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},sd=(Object.defineProperty(F,"__esModule",{value:!0}),F.bindCallbackInternals=void 0,j),cd=w,ld=Yf,fd=Jp,pd=a,dd=G;F.bindCallbackInternals=function r(a,s,n,o){if(n){if(!sd.isScheduler(n))return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r(a,s,o).apply(this,e).pipe(fd.mapOneOrManyArgs(n))};o=n}return o?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r(a,s).apply(this,e).pipe(ld.subscribeOn(o),pd.observeOn(o))}:function(){for(var t=this,r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var i=new dd.AsyncSubject,u=!0;return new cd.Observable(function(e){var n,o,e=i.subscribe(e);return u&&(n=u=!1,o=!1,s.apply(t,ad(ad([],ud(r)),[function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(a){var r=e.shift();if(null!=r)return void i.error(r)}i.next(1<e.length?e:e[0]),o=!0,n&&i.complete()}])),o&&i.complete(),n=!0),e})}},Object.defineProperty(pf,"__esModule",{value:!0}),pf.bindCallback=void 0;var hd=F;pf.bindCallback=function(e,t,r){return hd.bindCallbackInternals(!1,e,t,r)};var bd={},yd=(Object.defineProperty(bd,"__esModule",{value:!0}),bd.bindNodeCallback=void 0,F);bd.bindNodeCallback=function(e,t,r){return yd.bindCallbackInternals(!0,e,t,r)};var F={},_d={},vd=(Object.defineProperty(_d,"__esModule",{value:!0}),_d.argsArgArrayOrObject=void 0,Array.isArray),md=Object.getPrototypeOf,gd=Object.prototype,Od=Object.keys;_d.argsArgArrayOrObject=function(e){if(1===e.length){var t=e[0];if(vd(t))return{args:t,keys:null};if((r=t)&&"object"==typeof r&&md(r)===gd)return{args:(r=Od(t)).map(function(e){return t[e]}),keys:r}}var r;return{args:e,keys:null}};var wd={};Object.defineProperty(wd,"__esModule",{value:!0}),wd.createObject=void 0,wd.createObject=function(e,n){return e.reduce(function(e,t,r){return e[t]=n[r],e},{})},Object.defineProperty(F,"__esModule",{value:!0}),F.combineLatestInit=F.combineLatest=void 0;var Ed=w,Pd=_d,Td=$l,Sd=u,jd=Jp,Cd=p,Id=wd,Rd=b,Ad=Wf;function Md(a,s,c){return void 0===c&&(c=Sd.identity),function(u){Nd(s,function(){for(var e=a.length,n=new Array(e),o=e,i=e,t=0;t<e;t++)(r=>{Nd(s,function(){var e=Td.from(a[r],s),t=!1;e.subscribe(Rd.createOperatorSubscriber(u,function(e){n[r]=e,t||(t=!0,i--),i||u.next(c(n.slice()))},function(){--o||u.complete()}))},u)})(t)},u)}}function Nd(e,t,r){e?Ad.executeSchedule(r,e,t):t()}F.combineLatest=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Cd.popScheduler(e),n=Cd.popResultSelector(e),o=Pd.argsArgArrayOrObject(e),i=o.args,u=o.keys;return 0===i.length?Td.from([],r):(o=new Ed.Observable(Md(i,r,u?function(e){return Id.createObject(u,e)}:Sd.identity)),n?o.pipe(jd.mapOneOrManyArgs(n)):o)},F.combineLatestInit=Md;var kd={},xd={},Dd={},Ud={},Ld={},Fd=(Object.defineProperty(Ld,"__esModule",{value:!0}),Ld.mergeInternals=void 0,C),Bd=Wf,Vd=b;Ld.mergeInternals=function(e,r,n,o,i,u,a,t){var s=[],c=0,l=0,f=!1,p=function(){!f||s.length||c||r.complete()},d=function(e){return c<o?h(e):s.push(e)},h=function(e){u&&r.next(e),c++;var t=!1;Fd.innerFrom(n(e,l++)).subscribe(Vd.createOperatorSubscriber(r,function(e){null!=i&&i(e),u?d(e):r.next(e)},function(){t=!0},void 0,function(){if(t)try{c--;for(;s.length&&c<o;)(()=>{var e=s.shift();a?Bd.executeSchedule(r,a,function(){return h(e)}):h(e)})();p()}catch(e){r.error(e)}}))};return e.subscribe(Vd.createOperatorSubscriber(r,d,function(){f=!0,p()})),function(){null!=t&&t()}},Object.defineProperty(Ud,"__esModule",{value:!0}),Ud.mergeMap=void 0;var qd=$p,Wd=C,zd=h,Hd=Ld,Gd=_;Ud.mergeMap=function e(o,i,r){return void 0===r&&(r=1/0),Gd.isFunction(i)?e(function(r,n){return qd.map(function(e,t){return i(r,e,n,t)})(Wd.innerFrom(o(r,n)))},r):("number"==typeof i&&(r=i),zd.operate(function(e,t){return Hd.mergeInternals(e,t,o,r)}))},Object.defineProperty(Dd,"__esModule",{value:!0}),Dd.mergeAll=void 0;var Yd=Ud,Kd=u;Dd.mergeAll=function(e){return Yd.mergeMap(Kd.identity,e=void 0===e?1/0:e)},Object.defineProperty(xd,"__esModule",{value:!0}),xd.concatAll=void 0;var Zd=Dd;xd.concatAll=function(){return Zd.mergeAll(1)},Object.defineProperty(kd,"__esModule",{value:!0}),kd.concat=void 0;var Qd=xd,Xd=p,Jd=$l;kd.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Qd.concatAll()(Jd.from(e,Xd.popScheduler(e)))};var $d={},eh={},th=(Object.defineProperty(eh,"__esModule",{value:!0}),eh.defer=void 0,w),rh=C;eh.defer=function(t){return new th.Observable(function(e){rh.innerFrom(t()).subscribe(e)})},Object.defineProperty($d,"__esModule",{value:!0}),$d.connectable=void 0;var nh=S,oh=w,ih=eh,uh={connector:function(){return new nh.Subject},resetOnDisconnect:!0};$d.connectable=function(e,t){var r=null,n=(t=void 0===t?uh:t).connector,o=void 0===(t=t.resetOnDisconnect)||t,i=n();return(t=new oh.Observable(function(e){return i.subscribe(e)})).connect=function(){return r&&!r.closed||(r=ih.defer(function(){return e}).subscribe(i),o&&r.add(function(){return i=n()})),r},t};var ah={},sh=(Object.defineProperty(ah,"__esModule",{value:!0}),ah.forkJoin=void 0,w),ch=_d,lh=C,fh=p,ph=b,dh=Jp,hh=wd;ah.forkJoin=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=fh.popResultSelector(e),u=(n=ch.argsArgArrayOrObject(e)).args,a=n.keys,n=new sh.Observable(function(e){var t=u.length;if(t)for(var n=new Array(t),o=t,i=t,r=0;r<t;r++)(t=>{var r=!1;lh.innerFrom(u[t]).subscribe(ph.createOperatorSubscriber(e,function(e){r||(r=!0,i--),n[t]=e},function(){return o--},void 0,function(){o&&r||(i||e.next(a?hh.createObject(a,n):n),e.complete())}))})(r);else e.complete()});return r?n.pipe(dh.mapOneOrManyArgs(r)):n};var _d={},bh=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},yh=(Object.defineProperty(_d,"__esModule",{value:!0}),_d.fromEvent=void 0,C),_h=w,vh=Ud,mh=rf,gh=_,Oh=Jp,wh=["addListener","removeListener"],Eh=["addEventListener","removeEventListener"],Ph=["on","off"];function Th(r,n){return function(t){return function(e){return r[t](n,e)}}}_d.fromEvent=function t(r,n,o,e){if(gh.isFunction(o)&&(e=o,o=void 0),e)return t(r,n,o).pipe(Oh.mapOneOrManyArgs(e));var e=bh((e=r,gh.isFunction(e.addEventListener)&&gh.isFunction(e.removeEventListener)?Eh.map(function(t){return function(e){return r[t](n,e,o)}}):(e=r,gh.isFunction(e.addListener)&&gh.isFunction(e.removeListener)?wh.map(Th(r,n)):(e=r,gh.isFunction(e.on)&&gh.isFunction(e.off)?Ph.map(Th(r,n)):[]))),2),i=e[0],u=e[1];if(!i&&mh.isArrayLike(r))return vh.mergeMap(function(e){return t(e,n,o)})(yh.innerFrom(r));if(i)return new _h.Observable(function(r){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r.next(1<e.length?e:e[0])}return i(e),function(){return u(e)}});throw new TypeError("Invalid event target")};var wd={},Sh=(Object.defineProperty(wd,"__esModule",{value:!0}),wd.fromEventPattern=void 0,w),jh=_,Ch=Jp;wd.fromEventPattern=function e(n,o,t){return t?e(n,o).pipe(Ch.mapOneOrManyArgs(t)):new Sh.Observable(function(r){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r.next(1===e.length?e[0]:e)}var t=n(e);return jh.isFunction(o)?function(){return o(e,t)}:void 0})};var rf={},Ih=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))s.label=t[1];else if(6===t[0]&&s.label<a[1])s.label=a[1],a=t;else{if(!(a&&s.label<a[2])){a[2]&&s.ops.pop(),s.trys.pop();continue}s.label=a[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Rh=(Object.defineProperty(rf,"__esModule",{value:!0}),rf.generate=void 0,u),Ah=j,Mh=eh,Nh=op;rf.generate=function(e,r,n,t,o){var i,u,a;function s(){var t;return Ih(this,function(e){switch(e.label){case 0:t=a,e.label=1;case 1:return r&&!r(t)?[3,4]:[4,u(t)];case 2:e.sent(),e.label=3;case 3:return t=n(t),[3,1];case 4:return[2]}})}return 1===arguments.length?(a=e.initialState,r=e.condition,n=e.iterate,u=void 0===(i=e.resultSelector)?Rh.identity:i,o=e.scheduler):(a=e,!t||Ah.isScheduler(t)?(u=Rh.identity,o=t):u=t),Mh.defer(o?function(){return Nh.scheduleIterable(s(),o)}:s)};var op={},kh=(Object.defineProperty(op,"__esModule",{value:!0}),op.iif=void 0,eh);op.iif=function(e,t,r){return kh.defer(function(){return e()?t:r})};var xh={},Dh={},Uh=(Object.defineProperty(Dh,"__esModule",{value:!0}),Dh.timer=void 0,w),Lh=so,Fh=j,Bh=rp;Dh.timer=function(n,e,o){void 0===n&&(n=0),void 0===o&&(o=Lh.async);var i=-1;return null!=e&&(Fh.isScheduler(e)?o=e:i=e),new Uh.Observable(function(e){var t=Bh.isValidDate(n)?+n-o.now():n,r=0;return o.schedule(function(){e.closed||(e.next(r++),0<=i?this.schedule(void 0,i):e.complete())},t=t<0?0:t)})},Object.defineProperty(xh,"__esModule",{value:!0}),xh.interval=void 0;var Vh=so,qh=Dh;xh.interval=function(e,t){return qh.timer(e=(e=void 0===e?0:e)<0?0:e,e,t=void 0===t?Vh.asyncScheduler:t)};var j={},Wh=(Object.defineProperty(j,"__esModule",{value:!0}),j.merge=void 0,Dd),zh=C,Hh=n,Gh=p,Yh=$l;j.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Gh.popScheduler(e),n=Gh.popNumber(e,1/0),o=e;return o.length?1===o.length?zh.innerFrom(o[0]):Wh.mergeAll(n)(Yh.from(o,r)):Hh.EMPTY};var Kh,Zh={},Qh=(Kh=Zh,Object.defineProperty(Kh,"__esModule",{value:!0}),Kh.never=Kh.NEVER=void 0,Kh.NEVER=new w.Observable(fe.noop),Kh.never=function(){return Kh.NEVER},{}),Xh={},Jh=(Object.defineProperty(Xh,"__esModule",{value:!0}),Xh.argsOrArgArray=void 0,Array.isArray);Xh.argsOrArgArray=function(e){return 1===e.length&&Jh(e[0])?e[0]:e},Object.defineProperty(Qh,"__esModule",{value:!0}),Qh.onErrorResumeNext=void 0;var $h=w,eb=Xh,tb=b,rb=fe,nb=C;Qh.onErrorResumeNext=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=eb.argsOrArgArray(e);return new $h.Observable(function(r){var n=0,o=function(){if(n<i.length){var e=void 0;try{e=nb.innerFrom(i[n++])}catch(e){return void o()}var t=new tb.OperatorSubscriber(r,void 0,rb.noop,rb.noop);e.subscribe(t),t.add(o)}else r.complete()};o()})};var ob={},ib=(Object.defineProperty(ob,"__esModule",{value:!0}),ob.pairs=void 0,$l);ob.pairs=function(e,t){return ib.from(Object.entries(e),t)};var I={},ub={};Object.defineProperty(ub,"__esModule",{value:!0}),ub.not=void 0,ub.not=function(r,n){return function(e,t){return!r.call(n,e,t)}};var ab={},sb=(Object.defineProperty(ab,"__esModule",{value:!0}),ab.filter=void 0,h),cb=b;ab.filter=function(n,o){return sb.operate(function(e,t){var r=0;e.subscribe(cb.createOperatorSubscriber(t,function(e){return n.call(o,e,r++)&&t.next(e)}))})},Object.defineProperty(I,"__esModule",{value:!0}),I.partition=void 0;var lb=ub,fb=ab,pb=C;I.partition=function(e,t,r){return[fb.filter(t,r)(pb.innerFrom(e)),fb.filter(lb.not(t,r))(pb.innerFrom(e))]};var db={},hb=(Object.defineProperty(db,"__esModule",{value:!0}),db.raceInit=db.race=void 0,w),bb=C,yb=Xh,_b=b;function vb(t){return function(n){for(var o=[],e=0;o&&!n.closed&&e<t.length;e++)(r=>{o.push(bb.innerFrom(t[r]).subscribe(_b.createOperatorSubscriber(n,function(e){if(o){for(var t=0;t<o.length;t++)t!==r&&o[t].unsubscribe();o=null}n.next(e)})))})(e)}}db.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===(e=yb.argsOrArgArray(e)).length?bb.innerFrom(e[0]):new hb.Observable(vb(e))},db.raceInit=vb;var mb={},gb=(Object.defineProperty(mb,"__esModule",{value:!0}),mb.range=void 0,w),Ob=n;mb.range=function(r,e,n){var o;return null==e&&(e=r,r=0),e<=0?Ob.EMPTY:(o=e+r,new gb.Observable(n?function(e){var t=r;return n.schedule(function(){t<o?(e.next(t++),this.schedule()):e.complete()})}:function(e){for(var t=r;t<o&&!e.closed;)e.next(t++);e.complete()}))};var wb={},Eb=(Object.defineProperty(wb,"__esModule",{value:!0}),wb.using=void 0,w),Pb=C,Tb=n;wb.using=function(n,o){return new Eb.Observable(function(e){var t=n(),r=o(t);return(r?Pb.innerFrom(r):Tb.EMPTY).subscribe(e),function(){t&&t.unsubscribe()}})};var Sb={},jb=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Cb=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Ib=(Object.defineProperty(Sb,"__esModule",{value:!0}),Sb.zip=void 0,w),Rb=C,Ab=Xh,Mb=n,Nb=b,kb=p;Sb.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=kb.popResultSelector(e),u=Ab.argsOrArgArray(e);return u.length?new Ib.Observable(function(r){for(var n=u.map(function(){return[]}),o=u.map(function(){return!1}),e=(r.add(function(){n=o=null}),0);!r.closed&&e<u.length;e++)(t=>{Rb.innerFrom(u[t]).subscribe(Nb.createOperatorSubscriber(r,function(e){n[t].push(e),n.every(function(e){return e.length})&&(e=n.map(function(e){return e.shift()}),r.next(i?i.apply(void 0,Cb([],jb(e))):e),n.some(function(e,t){return!e.length&&o[t]}))&&r.complete()},function(){o[t]=!0,n[t].length||r.complete()}))})(e);return function(){n=o=null}}):Mb.EMPTY};var xb={},Db=(Object.defineProperty(xb,"__esModule",{value:!0}),{}),Ub=(Object.defineProperty(Db,"__esModule",{value:!0}),Db.audit=void 0,h),Lb=C,Fb=b;Db.audit=function(s){return Ub.operate(function(e,t){function r(){var e;null!=u&&u.unsubscribe(),u=null,o&&(o=!1,e=i,i=null,t.next(e)),a&&t.complete()}function n(){u=null,a&&t.complete()}var o=!1,i=null,u=null,a=!1;e.subscribe(Fb.createOperatorSubscriber(t,function(e){o=!0,i=e,u||Lb.innerFrom(s(e)).subscribe(u=Fb.createOperatorSubscriber(t,r,n))},function(){a=!0,o&&u&&!u.closed||t.complete()}))})};var Bb={},Vb=(Object.defineProperty(Bb,"__esModule",{value:!0}),Bb.auditTime=void 0,so),qb=Db,Wb=Dh;Bb.auditTime=function(e,t){return void 0===t&&(t=Vb.asyncScheduler),qb.audit(function(){return Wb.timer(e,t)})};var zb={},Hb=(Object.defineProperty(zb,"__esModule",{value:!0}),zb.buffer=void 0,h),Gb=fe,Yb=b,Kb=C;zb.buffer=function(n){return Hb.operate(function(e,t){var r=[];return e.subscribe(Yb.createOperatorSubscriber(t,function(e){return r.push(e)},function(){t.next(r),t.complete()})),Kb.innerFrom(n).subscribe(Yb.createOperatorSubscriber(t,function(){var e=r;r=[],t.next(e)},Gb.noop)),function(){r=null}})};var Zb={},Qb=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Xb=(Object.defineProperty(Zb,"__esModule",{value:!0}),Zb.bufferCount=void 0,h),Jb=b,$b=E;Zb.bufferCount=function(h,b){return b=null!=(b=void 0===b?null:b)?b:h,Xb.operate(function(e,f){var p=[],d=0;e.subscribe(Jb.createOperatorSubscriber(f,function(e){var t,r,n,o,i=null;d++%b==0&&p.push([]);try{for(var u=Qb(p),a=u.next();!a.done;a=u.next())(l=a.value).push(e),h<=l.length&&(i=null!=i?i:[]).push(l)}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}if(i)try{for(var s=Qb(i),c=s.next();!c.done;c=s.next()){var l=c.value;$b.arrRemove(p,l),f.next(l)}}catch(e){n={error:e}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}},function(){var t,e;try{for(var r=Qb(p),n=r.next();!n.done;n=r.next()){var o=n.value;f.next(o)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}f.complete()},void 0,function(){p=null}))})};var ey={},ty=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ry=(Object.defineProperty(ey,"__esModule",{value:!0}),ey.bufferTime=void 0,o),ny=h,oy=b,iy=E,uy=so,ay=p,sy=Wf;ey.bufferTime=function(i){for(var e,t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var u=null!=(e=ay.popScheduler(t))?e:uy.asyncScheduler,a=null!=(e=t[0])?e:null,l=t[1]||1/0;return ny.operate(function(e,r){var s=[],n=!1,c=function(e){var t=e.buffer;e.subs.unsubscribe(),iy.arrRemove(s,e),r.next(t),n&&o()},o=function(){var e,t;s&&(e=new ry.Subscription,r.add(e),s.push(t={buffer:[],subs:e}),sy.executeSchedule(e,u,function(){return c(t)},i))},t=(null!==a&&0<=a?sy.executeSchedule(r,u,o,a,!0):n=!0,o(),oy.createOperatorSubscriber(r,function(e){var t,r,n=s.slice();try{for(var o=ty(n),i=o.next();!i.done;i=o.next()){var u=i.value,a=u.buffer;a.push(e),l<=a.length&&c(u)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}},function(){for(;null!=s&&s.length;)r.next(s.shift().buffer);null!=t&&t.unsubscribe(),r.complete(),r.unsubscribe()},void 0,function(){return s=null}));e.subscribe(t)})};var cy={},ly=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},fy=(Object.defineProperty(cy,"__esModule",{value:!0}),cy.bufferToggle=void 0,o),py=h,dy=C,hy=b,by=fe,yy=E;cy.bufferToggle=function(t,o){return py.operate(function(e,n){var i=[];dy.innerFrom(t).subscribe(hy.createOperatorSubscriber(n,function(e){var t=[],r=(i.push(t),new fy.Subscription);r.add(dy.innerFrom(o(e)).subscribe(hy.createOperatorSubscriber(n,function(){yy.arrRemove(i,t),n.next(t),r.unsubscribe()},by.noop)))},by.noop)),e.subscribe(hy.createOperatorSubscriber(n,function(e){var t,r;try{for(var n=ly(i),o=n.next();!o.done;o=n.next())o.value.push(e)}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},function(){for(;0<i.length;)n.next(i.shift());n.complete()}))})};var _y={},vy=(Object.defineProperty(_y,"__esModule",{value:!0}),_y.bufferWhen=void 0,h),my=fe,gy=b,Oy=C;_y.bufferWhen=function(i){return vy.operate(function(e,t){var r=null,n=null,o=function(){null!=n&&n.unsubscribe();var e=r;r=[],e&&t.next(e),Oy.innerFrom(i()).subscribe(n=gy.createOperatorSubscriber(t,o,my.noop))};o(),e.subscribe(gy.createOperatorSubscriber(t,function(e){return null==r?void 0:r.push(e)},function(){r&&t.next(r),t.complete()},void 0,function(){return r=n=null}))})};var wy={},Ey=(Object.defineProperty(wy,"__esModule",{value:!0}),wy.catchError=void 0,C),Py=b,Ty=h;wy.catchError=function u(a){return Ty.operate(function(t,r){var n,o=null,i=!1,o=t.subscribe(Py.createOperatorSubscriber(r,void 0,void 0,function(e){n=Ey.innerFrom(a(e,u(a)(t))),o?(o.unsubscribe(),o=null,n.subscribe(r)):i=!0}));i&&(o.unsubscribe(),o=null,n.subscribe(r))})};var Sy={},jy={},R={},Cy={},Iy={},Ry={},Ay=(Object.defineProperty(Ry,"__esModule",{value:!0}),Ry.scanInternals=void 0,b);Ry.scanInternals=function(u,t,a,s,c){return function(e,r){var n=a,o=t,i=0;e.subscribe(Ay.createOperatorSubscriber(r,function(e){var t=i++;o=n?u(o,e,t):(n=!0,e),s&&r.next(o)},c&&function(){n&&r.next(o),r.complete()}))}},Object.defineProperty(Iy,"__esModule",{value:!0}),Iy.reduce=void 0;var My=Ry,Ny=h;Iy.reduce=function(e,t){return Ny.operate(My.scanInternals(e,t,2<=arguments.length,!1,!0))},Object.defineProperty(Cy,"__esModule",{value:!0}),Cy.toArray=void 0;function ky(e,t){return e.push(t),e}var xy=Iy,Dy=h;Cy.toArray=function(){return Dy.operate(function(e,t){xy.reduce(ky,[])(e).subscribe(t)})},Object.defineProperty(R,"__esModule",{value:!0}),R.joinAllInternals=void 0;var Uy=u,Ly=Jp,Fy=i,By=Ud,Vy=Cy;R.joinAllInternals=function(t,e){return Fy.pipe(Vy.toArray(),By.mergeMap(function(e){return t(e)}),e?Ly.mapOneOrManyArgs(e):Uy.identity)},Object.defineProperty(jy,"__esModule",{value:!0}),jy.combineLatestAll=void 0;var qy=F,Wy=R;jy.combineLatestAll=function(e){return Wy.joinAllInternals(qy.combineLatest,e)},Object.defineProperty(Sy,"__esModule",{value:!0}),Sy.combineAll=void 0;Sy.combineAll=jy.combineLatestAll;var zy={},Hy={},Gy=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Yy=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Ky=(Object.defineProperty(Hy,"__esModule",{value:!0}),Hy.combineLatest=void 0,F),Zy=h,Qy=Xh,Xy=Jp,Jy=i,$y=p;function e_(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=$y.popResultSelector(r);return t?Jy.pipe(e_.apply(void 0,Yy([],Gy(r))),Xy.mapOneOrManyArgs(t)):Zy.operate(function(e,t){Ky.combineLatestInit(Yy([e],Gy(Qy.argsOrArgArray(r))))(t)})}Hy.combineLatest=e_;var t_=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},r_=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},n_=(Object.defineProperty(zy,"__esModule",{value:!0}),zy.combineLatestWith=void 0,Hy);zy.combineLatestWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n_.combineLatest.apply(void 0,r_([],t_(e)))};var Jp={},o_=(Object.defineProperty(Jp,"__esModule",{value:!0}),Jp.concatMap=void 0,Ud),i_=_;Jp.concatMap=function(e,t){return i_.isFunction(t)?o_.mergeMap(e,t,1):o_.mergeMap(e,1)};var u_={},a_=(Object.defineProperty(u_,"__esModule",{value:!0}),u_.concatMapTo=void 0,Jp),s_=_;u_.concatMapTo=function(e,t){return s_.isFunction(t)?a_.concatMap(function(){return e},t):a_.concatMap(function(){return e})};var c_={},l_={},f_=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},p_=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},d_=(Object.defineProperty(l_,"__esModule",{value:!0}),l_.concat=void 0,h),h_=xd,b_=p,y_=$l;l_.concat=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var n=b_.popScheduler(r);return d_.operate(function(e,t){h_.concatAll()(y_.from(p_([e],f_(r)),n)).subscribe(t)})};var __=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},v_=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},m_=(Object.defineProperty(c_,"__esModule",{value:!0}),c_.concatWith=void 0,l_);c_.concatWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return m_.concat.apply(void 0,v_([],__(e)))};var g_={},O_={},w_=(Object.defineProperty(O_,"__esModule",{value:!0}),O_.fromSubscribable=void 0,w);O_.fromSubscribable=function(t){return new w_.Observable(function(e){return t.subscribe(e)})},Object.defineProperty(g_,"__esModule",{value:!0}),g_.connect=void 0;var E_=S,P_=C,T_=h,S_=O_,j_={connector:function(){return new E_.Subject}};g_.connect=function(n,e){var o=(e=void 0===e?j_:e).connector;return T_.operate(function(e,t){var r=o();P_.innerFrom(n(S_.fromSubscribable(r))).subscribe(t),t.add(e.subscribe(r))})};var O_={},C_=(Object.defineProperty(O_,"__esModule",{value:!0}),O_.count=void 0,Iy);O_.count=function(n){return C_.reduce(function(e,t,r){return!n||n(t,r)?e+1:e},0)};var I_={},R_=(Object.defineProperty(I_,"__esModule",{value:!0}),I_.debounce=void 0,h),A_=fe,M_=b,N_=C;I_.debounce=function(u){return R_.operate(function(e,t){function r(){var e;null!=i&&i.unsubscribe(),i=null,n&&(n=!1,e=o,o=null,t.next(e))}var n=!1,o=null,i=null;e.subscribe(M_.createOperatorSubscriber(t,function(e){null!=i&&i.unsubscribe(),n=!0,o=e,i=M_.createOperatorSubscriber(t,r,A_.noop),N_.innerFrom(u(e)).subscribe(i)},function(){r(),t.complete()},void 0,function(){o=i=null}))})};var k_={},x_=(Object.defineProperty(k_,"__esModule",{value:!0}),k_.debounceTime=void 0,so),D_=h,U_=b;k_.debounceTime=function(a,s){return void 0===s&&(s=x_.asyncScheduler),D_.operate(function(e,r){var n=null,t=null,o=null,i=function(){var e;n&&(n.unsubscribe(),e=t,t=n=null,r.next(e))};function u(){var e=o+a,t=s.now();t<e?(n=this.schedule(void 0,e-t),r.add(n)):i()}e.subscribe(U_.createOperatorSubscriber(r,function(e){t=e,o=s.now(),n||(n=s.schedule(u,a),r.add(n))},function(){i(),r.complete()},void 0,function(){t=n=null}))})};var A={},L_=(Object.defineProperty(A,"__esModule",{value:!0}),A.defaultIfEmpty=void 0,h),F_=b;A.defaultIfEmpty=function(n){return L_.operate(function(e,t){var r=!1;e.subscribe(F_.createOperatorSubscriber(t,function(e){r=!0,t.next(e)},function(){r||t.next(n),t.complete()}))})};var B_={},V_={},q_={},W_=(Object.defineProperty(q_,"__esModule",{value:!0}),q_.take=void 0,n),z_=h,H_=b;q_.take=function(n){return n<=0?function(){return W_.EMPTY}:z_.operate(function(e,t){var r=0;e.subscribe(H_.createOperatorSubscriber(t,function(e){++r<=n&&(t.next(e),n<=r)&&t.complete()}))})};var G_={},Y_=(Object.defineProperty(G_,"__esModule",{value:!0}),G_.ignoreElements=void 0,h),K_=b,Z_=fe;G_.ignoreElements=function(){return Y_.operate(function(e,t){e.subscribe(K_.createOperatorSubscriber(t,Z_.noop))})};var Q_={},X_=(Object.defineProperty(Q_,"__esModule",{value:!0}),Q_.mapTo=void 0,$p);Q_.mapTo=function(e){return X_.map(function(){return e})},Object.defineProperty(V_,"__esModule",{value:!0}),V_.delayWhen=void 0;var J_=kd,$_=q_,ev=G_,tv=Q_,rv=Ud,nv=C;V_.delayWhen=function t(r,n){return n?function(e){return J_.concat(n.pipe($_.take(1),ev.ignoreElements()),e.pipe(t(r)))}:rv.mergeMap(function(e,t){return nv.innerFrom(r(e,t)).pipe($_.take(1),tv.mapTo(e))})},Object.defineProperty(B_,"__esModule",{value:!0}),B_.delay=void 0;var ov=so,iv=V_,uv=Dh;B_.delay=function(e,t){var r=uv.timer(e,t=void 0===t?ov.asyncScheduler:t);return iv.delayWhen(function(){return r})};var av={},sv=(Object.defineProperty(av,"__esModule",{value:!0}),av.dematerialize=void 0,y),cv=h,lv=b;av.dematerialize=function(){return cv.operate(function(e,t){e.subscribe(lv.createOperatorSubscriber(t,function(e){return sv.observeNotification(e,t)}))})};var fv={},pv=(Object.defineProperty(fv,"__esModule",{value:!0}),fv.distinct=void 0,h),dv=b,hv=fe,bv=C;fv.distinct=function(o,t){return pv.operate(function(e,r){var n=new Set;e.subscribe(dv.createOperatorSubscriber(r,function(e){var t=o?o(e):e;n.has(t)||(n.add(t),r.next(e))})),t&&bv.innerFrom(t).subscribe(dv.createOperatorSubscriber(r,function(){return n.clear()},hv.noop))})};var yv={},_v=(Object.defineProperty(yv,"__esModule",{value:!0}),yv.distinctUntilChanged=void 0,u),vv=h,mv=b;function gv(e,t){return e===t}yv.distinctUntilChanged=function(i,u){return void 0===u&&(u=_v.identity),i=null!=i?i:gv,vv.operate(function(e,r){var n,o=!0;e.subscribe(mv.createOperatorSubscriber(r,function(e){var t=u(e);!o&&i(n,t)||(o=!1,n=t,r.next(e))}))})};var Ov={},wv=(Object.defineProperty(Ov,"__esModule",{value:!0}),Ov.distinctUntilKeyChanged=void 0,yv);Ov.distinctUntilKeyChanged=function(r,n){return wv.distinctUntilChanged(function(e,t){return n?n(e[r],t[r]):e[r]===t[r]})};var Ev={},Pv={},Tv=(Object.defineProperty(Pv,"__esModule",{value:!0}),Pv.throwIfEmpty=void 0,nf),Sv=h,jv=b;function Cv(){return new Tv.EmptyError}Pv.throwIfEmpty=function(n){return void 0===n&&(n=Cv),Sv.operate(function(e,t){var r=!1;e.subscribe(jv.createOperatorSubscriber(t,function(e){r=!0,t.next(e)},function(){return r?t.complete():t.error(n())}))})},Object.defineProperty(Ev,"__esModule",{value:!0}),Ev.elementAt=void 0;var Iv=ff,Rv=ab,Av=Pv,Mv=A,Nv=q_;Ev.elementAt=function(r,t){if(r<0)throw new Iv.ArgumentOutOfRangeError;var n=2<=arguments.length;return function(e){return e.pipe(Rv.filter(function(e,t){return t===r}),Nv.take(1),n?Mv.defaultIfEmpty(t):Av.throwIfEmpty(function(){return new Iv.ArgumentOutOfRangeError}))}};var kv={},xv=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Dv=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Uv=(Object.defineProperty(kv,"__esModule",{value:!0}),kv.endWith=void 0,kd),Lv=O;kv.endWith=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return Uv.concat(e,Lv.of.apply(void 0,Dv([],xv(t))))}};var Fv={},Bv=(Object.defineProperty(Fv,"__esModule",{value:!0}),Fv.every=void 0,h),Vv=b;Fv.every=function(o,i){return Bv.operate(function(t,r){var n=0;t.subscribe(Vv.createOperatorSubscriber(r,function(e){o.call(i,e,n++,t)||(r.next(!1),r.complete())},function(){r.next(!0),r.complete()}))})};var qv={},Wv={},zv={},Hv=(Object.defineProperty(zv,"__esModule",{value:!0}),zv.exhaustMap=void 0,$p),Gv=C,Yv=h,Kv=b;zv.exhaustMap=function t(i,o){return o?function(e){return e.pipe(t(function(r,n){return Gv.innerFrom(i(r,n)).pipe(Hv.map(function(e,t){return o(r,e,n,t)}))}))}:Yv.operate(function(e,t){var r=0,n=null,o=!1;e.subscribe(Kv.createOperatorSubscriber(t,function(e){n||(n=Kv.createOperatorSubscriber(t,void 0,function(){n=null,o&&t.complete()}),Gv.innerFrom(i(e,r++)).subscribe(n))},function(){o=!0,n||t.complete()}))})},Object.defineProperty(Wv,"__esModule",{value:!0}),Wv.exhaustAll=void 0;var Zv=zv,Qv=u;Wv.exhaustAll=function(){return Zv.exhaustMap(Qv.identity)},Object.defineProperty(qv,"__esModule",{value:!0}),qv.exhaust=void 0;qv.exhaust=Wv.exhaustAll;var Xv={},Jv=(Object.defineProperty(Xv,"__esModule",{value:!0}),Xv.expand=void 0,h),$v=Ld;Xv.expand=function(r,n,o){return n=((n=void 0===n?1/0:n)||0)<1?1/0:n,Jv.operate(function(e,t){return $v.mergeInternals(e,t,r,n,void 0,!0,o)})};var em={},tm=(Object.defineProperty(em,"__esModule",{value:!0}),em.finalize=void 0,h);em.finalize=function(r){return tm.operate(function(e,t){try{e.subscribe(t)}finally{t.add(r)}})};var rm={},nm=(Object.defineProperty(rm,"__esModule",{value:!0}),rm.createFind=rm.find=void 0,h),om=b;function im(i,u,e){var a="index"===e;return function(r,n){var o=0;r.subscribe(om.createOperatorSubscriber(n,function(e){var t=o++;i.call(u,e,t,r)&&(n.next(a?t:e),n.complete())},function(){n.next(a?-1:void 0),n.complete()}))}}rm.find=function(e,t){return nm.operate(im(e,t,"value"))},rm.createFind=im;var um={},am=(Object.defineProperty(um,"__esModule",{value:!0}),um.findIndex=void 0,h),sm=rm;um.findIndex=function(e,t){return am.operate(sm.createFind(e,t,"index"))};var cm={},lm=(Object.defineProperty(cm,"__esModule",{value:!0}),cm.first=void 0,nf),fm=ab,pm=q_,dm=A,hm=Pv,bm=u;cm.first=function(n,e){var t=2<=arguments.length;return function(r){return r.pipe(n?fm.filter(function(e,t){return n(e,t,r)}):bm.identity,pm.take(1),t?dm.defaultIfEmpty(e):hm.throwIfEmpty(function(){return new lm.EmptyError}))}};var ym={},_m=(Object.defineProperty(ym,"__esModule",{value:!0}),ym.groupBy=void 0,w),vm=C,mm=S,gm=h,Om=b;ym.groupBy=function(b,t,y,_){return gm.operate(function(e,s){function c(t){return r(function(e){return e.error(t)})}t&&"function"!=typeof t?(y=t.duration,l=t.element,_=t.connector):l=t;var l,f=new Map,r=function(e){f.forEach(e),e(s)},p=0,d=!1,h=new Om.OperatorSubscriber(s,function(e){try{var t,r,n=b(e),o=f.get(n);o||(f.set(n,o=_?_():new mm.Subject),i=n,u=o,(a=new _m.Observable(function(e){p++;var t=u.subscribe(e);return function(){t.unsubscribe(),0==--p&&d&&h.unsubscribe()}})).key=i,t=a,s.next(t),y&&(r=Om.createOperatorSubscriber(o,function(){o.complete(),null!=r&&r.unsubscribe()},void 0,void 0,function(){return f.delete(n)}),h.add(vm.innerFrom(y(t)).subscribe(r)))),o.next(l?l(e):e)}catch(e){c(e)}var i,u,a},function(){return r(function(e){return e.complete()})},c,function(){return f.clear()},function(){return d=!0,0===p});e.subscribe(h)})};var wm={},Em=(Object.defineProperty(wm,"__esModule",{value:!0}),wm.isEmpty=void 0,h),Pm=b;wm.isEmpty=function(){return Em.operate(function(e,t){e.subscribe(Pm.createOperatorSubscriber(t,function(){t.next(!1),t.complete()},function(){t.next(!0),t.complete()}))})};var Tm={},Sm={},jm=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Cm=(Object.defineProperty(Sm,"__esModule",{value:!0}),Sm.takeLast=void 0,n),Im=h,Rm=b;Sm.takeLast=function(t){return t<=0?function(){return Cm.EMPTY}:Im.operate(function(e,i){var u=[];e.subscribe(Rm.createOperatorSubscriber(i,function(e){u.push(e),t<u.length&&u.shift()},function(){var t,e;try{for(var r=jm(u),n=r.next();!n.done;n=r.next()){var o=n.value;i.next(o)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}i.complete()},void 0,function(){u=null}))})},Object.defineProperty(Tm,"__esModule",{value:!0}),Tm.last=void 0;var Am=nf,Mm=ab,Nm=Sm,km=Pv,xm=A,Dm=u;Tm.last=function(n,e){var t=2<=arguments.length;return function(r){return r.pipe(n?Mm.filter(function(e,t){return n(e,t,r)}):Dm.identity,Nm.takeLast(1),t?xm.defaultIfEmpty(e):km.throwIfEmpty(function(){return new Am.EmptyError}))}};var Um={},Lm=(Object.defineProperty(Um,"__esModule",{value:!0}),Um.materialize=void 0,y),Fm=h,Bm=b;Um.materialize=function(){return Fm.operate(function(e,t){e.subscribe(Bm.createOperatorSubscriber(t,function(e){t.next(Lm.Notification.createNext(e))},function(){t.next(Lm.Notification.createComplete()),t.complete()},function(e){t.next(Lm.Notification.createError(e)),t.complete()}))})};var Vm={},qm=(Object.defineProperty(Vm,"__esModule",{value:!0}),Vm.max=void 0,Iy),Wm=_;Vm.max=function(r){return qm.reduce(Wm.isFunction(r)?function(e,t){return 0<r(e,t)?e:t}:function(e,t){return t<e?e:t})};var zm={},Hm=(Object.defineProperty(zm,"__esModule",{value:!0}),zm.flatMap=void 0,Ud),Hm=(zm.flatMap=Hm.mergeMap,{}),Gm=(Object.defineProperty(Hm,"__esModule",{value:!0}),Hm.mergeMapTo=void 0,Ud),Ym=_;Hm.mergeMapTo=function(e,t,r){return void 0===r&&(r=1/0),Ym.isFunction(t)?Gm.mergeMap(function(){return e},t,r):Gm.mergeMap(function(){return e},r="number"==typeof t?t:r)};var Km={},Zm=(Object.defineProperty(Km,"__esModule",{value:!0}),Km.mergeScan=void 0,h),Qm=Ld;Km.mergeScan=function(n,o,i){return void 0===i&&(i=1/0),Zm.operate(function(e,t){var r=o;return Qm.mergeInternals(e,t,function(e,t){return n(r,e,t)},i,function(e){r=e},!1,void 0,function(){return r=null})})};var Ld={},Xm={},Jm=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},$m=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},e0=(Object.defineProperty(Xm,"__esModule",{value:!0}),Xm.merge=void 0,h),t0=Dd,r0=p,n0=$l;Xm.merge=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var n=r0.popScheduler(r),o=r0.popNumber(r,1/0);return e0.operate(function(e,t){t0.mergeAll(o)(n0.from($m([e],Jm(r)),n)).subscribe(t)})};var o0=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},i0=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},u0=(Object.defineProperty(Ld,"__esModule",{value:!0}),Ld.mergeWith=void 0,Xm);Ld.mergeWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return u0.merge.apply(void 0,i0([],o0(e)))};var a0={},s0=(Object.defineProperty(a0,"__esModule",{value:!0}),a0.min=void 0,Iy),c0=_;a0.min=function(r){return s0.reduce(c0.isFunction(r)?function(e,t){return r(e,t)<0?e:t}:function(e,t){return e<t?e:t})};var l0={},f0=(Object.defineProperty(l0,"__esModule",{value:!0}),l0.multicast=void 0,l),p0=_,d0=g_;l0.multicast=function(e,t){var r=p0.isFunction(e)?e:function(){return e};return p0.isFunction(t)?d0.connect(t,{connector:r}):function(e){return new f0.ConnectableObservable(e,r)}};var h0={},b0=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},y0=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},_0=(Object.defineProperty(h0,"__esModule",{value:!0}),h0.onErrorResumeNext=h0.onErrorResumeNextWith=void 0,Xh),v0=Qh;function m0(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=_0.argsOrArgArray(e);return function(e){return v0.onErrorResumeNext.apply(void 0,y0([e],b0(r)))}}h0.onErrorResumeNextWith=m0,h0.onErrorResumeNext=m0;var g0={},O0=(Object.defineProperty(g0,"__esModule",{value:!0}),g0.pairwise=void 0,h),w0=b;g0.pairwise=function(){return O0.operate(function(e,r){var n,o=!1;e.subscribe(w0.createOperatorSubscriber(r,function(e){var t=n;n=e,o&&r.next([t,e]),o=!0}))})};var E0={},P0=(Object.defineProperty(E0,"__esModule",{value:!0}),E0.pluck=void 0,$p);E0.pluck=function(){for(var o=[],e=0;e<arguments.length;e++)o[e]=arguments[e];var i=o.length;if(0===i)throw new Error("list of properties cannot be empty.");return P0.map(function(e){for(var t=e,r=0;r<i;r++){var n=null==t?void 0:t[o[r]];if(void 0===n)return;t=n}return t})};var T0={},S0=(Object.defineProperty(T0,"__esModule",{value:!0}),T0.publish=void 0,S),j0=l0,C0=g_;T0.publish=function(t){return t?function(e){return C0.connect(t)(e)}:function(e){return j0.multicast(new S0.Subject)(e)}};var I0={},R0=(Object.defineProperty(I0,"__esModule",{value:!0}),I0.publishBehavior=void 0,pe),A0=l;I0.publishBehavior=function(r){return function(e){var t=new R0.BehaviorSubject(r);return new A0.ConnectableObservable(e,function(){return t})}};var M0={},N0=(Object.defineProperty(M0,"__esModule",{value:!0}),M0.publishLast=void 0,G),k0=l;M0.publishLast=function(){return function(e){var t=new N0.AsyncSubject;return new k0.ConnectableObservable(e,function(){return t})}};var x0={},D0=(Object.defineProperty(x0,"__esModule",{value:!0}),x0.publishReplay=void 0,P),U0=l0,L0=_;x0.publishReplay=function(t,r,e,n){e&&!L0.isFunction(e)&&(n=e);var o=L0.isFunction(e)?e:void 0;return function(e){return U0.multicast(new D0.ReplaySubject(t,r,n),o)(e)}};var F0={},B0=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},V0=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},q0=(Object.defineProperty(F0,"__esModule",{value:!0}),F0.raceWith=void 0,db),W0=h,z0=u;F0.raceWith=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return r.length?W0.operate(function(e,t){q0.raceInit(V0([e],B0(r)))(t)}):z0.identity};var H0={},G0=(Object.defineProperty(H0,"__esModule",{value:!0}),H0.repeat=void 0,n),Y0=h,K0=b,Z0=C,Q0=Dh;H0.repeat=function(e){var t,a,s=1/0;return null!=e&&("object"==typeof e?(t=e.count,s=void 0===t?1/0:t,a=e.delay):s=e),s<=0?function(){return G0.EMPTY}:Y0.operate(function(t,r){var n,o=0,i=function(){var e,t;null!=n&&n.unsubscribe(),(n=null)!=a?(e="number"==typeof a?Q0.timer(a):Z0.innerFrom(a(o)),t=K0.createOperatorSubscriber(r,function(){t.unsubscribe(),u()}),e.subscribe(t)):u()},u=function(){var e=!1;n=t.subscribe(K0.createOperatorSubscriber(r,void 0,function(){++o<s?n?i():e=!0:r.complete()})),e&&i()};u()})};var X0={},J0=(Object.defineProperty(X0,"__esModule",{value:!0}),X0.repeatWhen=void 0,C),$0=S,eg=h,tg=b;X0.repeatWhen=function(l){return eg.operate(function(e,t){var r,n,o=!1,i=!1,u=!1,a=function(){return u&&i&&(t.complete(),!0)},s=function(){return n||(n=new $0.Subject,J0.innerFrom(l(n)).subscribe(tg.createOperatorSubscriber(t,function(){r?c():o=!0},function(){i=!0,a()}))),n},c=function(){u=!1,r=e.subscribe(tg.createOperatorSubscriber(t,void 0,function(){u=!0,a()||s().next()})),o&&(r.unsubscribe(),r=null,o=!1,c())};c()})};var rg={},ng=(Object.defineProperty(rg,"__esModule",{value:!0}),rg.retry=void 0,h),og=b,ig=u,ug=Dh,ag=C;rg.retry=function(e){var t=(e=(e=void 0===e?1/0:e)&&"object"==typeof e?e:{count:e}).count,c=void 0===t?1/0:t,l=e.delay,r=void 0!==(t=e.resetOnSuccess)&&t;return c<=0?ig.identity:ng.operate(function(e,i){var u,a=0,s=function(){var o=!1;u=e.subscribe(og.createOperatorSubscriber(i,function(e){r&&(a=0),i.next(e)},void 0,function(e){var t,r,n;a++<c?(t=function(){u?(u.unsubscribe(),u=null,s()):o=!0},null!=l?(r="number"==typeof l?ug.timer(l):ag.innerFrom(l(e,a)),n=og.createOperatorSubscriber(i,function(){n.unsubscribe(),t()},function(){i.complete()}),r.subscribe(n)):t()):i.error(e)})),o&&(u.unsubscribe(),u=null,s())};s()})};var sg={},cg=(Object.defineProperty(sg,"__esModule",{value:!0}),sg.retryWhen=void 0,C),lg=S,fg=h,pg=b;sg.retryWhen=function(u){return fg.operate(function(e,t){var r,n,o=!1,i=function(){r=e.subscribe(pg.createOperatorSubscriber(t,void 0,void 0,function(e){n||(n=new lg.Subject,cg.innerFrom(u(n)).subscribe(pg.createOperatorSubscriber(t,function(){return r?i():o=!0}))),n&&n.next(e)})),o&&(r.unsubscribe(),r=null,o=!1,i())};i()})};var dg={},hg=(Object.defineProperty(dg,"__esModule",{value:!0}),dg.sample=void 0,C),bg=h,yg=fe,_g=b;dg.sample=function(o){return bg.operate(function(e,t){var r=!1,n=null;e.subscribe(_g.createOperatorSubscriber(t,function(e){r=!0,n=e})),hg.innerFrom(o).subscribe(_g.createOperatorSubscriber(t,function(){var e;r&&(r=!1,e=n,n=null,t.next(e))},yg.noop))})};var vg={},mg=(Object.defineProperty(vg,"__esModule",{value:!0}),vg.sampleTime=void 0,so),gg=dg,Og=xh;vg.sampleTime=function(e,t){return gg.sample(Og.interval(e,t=void 0===t?mg.asyncScheduler:t))};var wg={},Eg=(Object.defineProperty(wg,"__esModule",{value:!0}),wg.scan=void 0,h),Pg=Ry;wg.scan=function(e,t){return Eg.operate(Pg.scanInternals(e,t,2<=arguments.length,!0))};var Ry={},Tg=(Object.defineProperty(Ry,"__esModule",{value:!0}),Ry.sequenceEqual=void 0,h),Sg=b,jg=C;function Cg(){return{buffer:[],complete:!1}}Ry.sequenceEqual=function(u,a){return void 0===a&&(a=function(e,t){return e===t}),Tg.operate(function(e,t){function r(r,n){var e=Sg.createOperatorSubscriber(t,function(e){var t=n.buffer;0===t.length?n.complete?i(!1):r.buffer.push(e):a(e,t.shift())||i(!1)},function(){r.complete=!0,n.complete&&i(0===n.buffer.length),null!=e&&e.unsubscribe()});return e}var n=Cg(),o=Cg(),i=function(e){t.next(e),t.complete()};e.subscribe(r(n,o)),jg.innerFrom(u).subscribe(r(o,n))})};var Ig={},Rg=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Ag=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Mg=(Object.defineProperty(Ig,"__esModule",{value:!0}),Ig.share=void 0,C),Ng=S,kg=Zn,xg=h;function Dg(e,t){for(var r,n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];if(!0===t)e();else if(!1!==t)return r=new kg.SafeSubscriber({next:function(){r.unsubscribe(),e()}}),Mg.innerFrom(t.apply(void 0,Ag([],Rg(n)))).subscribe(r)}Ig.share=function(e){var t=(e=void 0===e?{}:e).connector,p=void 0===t?function(){return new Ng.Subject}:t,d=void 0===(t=e.resetOnError)||t,h=void 0===(t=e.resetOnComplete)||t,b=void 0===(t=e.resetOnRefCountZero)||t;return function(e){function n(){var e=o;f(),null!=e&&e.unsubscribe()}var o,i,u,a=0,s=!1,c=!1,l=function(){null!=i&&i.unsubscribe(),i=void 0},f=function(){l(),o=u=void 0,s=c=!1};return xg.operate(function(e,t){a++,c||s||l();var r=u=null!=u?u:p();t.add(function(){0!==--a||c||s||(i=Dg(n,b))}),r.subscribe(t),!o&&0<a&&(o=new kg.SafeSubscriber({next:function(e){return r.next(e)},error:function(e){c=!0,l(),i=Dg(f,d,e),r.error(e)},complete:function(){s=!0,l(),i=Dg(f,h),r.complete()}}),Mg.innerFrom(e).subscribe(o))})(e)}};var Ug={},Lg=(Object.defineProperty(Ug,"__esModule",{value:!0}),Ug.shareReplay=void 0,P),Fg=Ig;Ug.shareReplay=function(e,t,r){var n,o,i=!1;return e&&"object"==typeof e?(n=e.bufferSize,o=void 0===n?1/0:n,t=void 0===(n=e.windowTime)?1/0:n,i=void 0!==(n=e.refCount)&&n,r=e.scheduler):o=null!=e?e:1/0,Fg.share({connector:function(){return new Lg.ReplaySubject(o,t,r)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})};var Bg={},Vg=(Object.defineProperty(Bg,"__esModule",{value:!0}),Bg.single=void 0,nf),qg=Jf,Wg=fp,zg=h,Hg=b;Bg.single=function(a){return zg.operate(function(t,r){var n,o=!1,i=!1,u=0;t.subscribe(Hg.createOperatorSubscriber(r,function(e){i=!0,a&&!a(e,u++,t)||(o&&r.error(new qg.SequenceError("Too many matching values")),o=!0,n=e)},function(){o?(r.next(n),r.complete()):r.error(i?new Wg.NotFoundError("No matching values"):new Vg.EmptyError)}))})};var Gg={},Yg=(Object.defineProperty(Gg,"__esModule",{value:!0}),Gg.skip=void 0,ab);Gg.skip=function(r){return Yg.filter(function(e,t){return r<=t})};var Kg={},Zg=(Object.defineProperty(Kg,"__esModule",{value:!0}),Kg.skipLast=void 0,u),Qg=h,Xg=b;Kg.skipLast=function(u){return u<=0?Zg.identity:Qg.operate(function(e,n){var o=new Array(u),i=0;return e.subscribe(Xg.createOperatorSubscriber(n,function(e){var t,r=i++;r<u?o[r]=e:(t=o[r=r%u],o[r]=e,n.next(t))})),function(){o=null}})};var Jg={},$g=(Object.defineProperty(Jg,"__esModule",{value:!0}),Jg.skipUntil=void 0,h),eO=b,tO=C,rO=fe;Jg.skipUntil=function(o){return $g.operate(function(e,t){var r=!1,n=eO.createOperatorSubscriber(t,function(){null!=n&&n.unsubscribe(),r=!0},rO.noop);tO.innerFrom(o).subscribe(n),e.subscribe(eO.createOperatorSubscriber(t,function(e){return r&&t.next(e)}))})};var nO={},oO=(Object.defineProperty(nO,"__esModule",{value:!0}),nO.skipWhile=void 0,h),iO=b;nO.skipWhile=function(o){return oO.operate(function(e,t){var r=!1,n=0;e.subscribe(iO.createOperatorSubscriber(t,function(e){return(r=r||!o(e,n++))&&t.next(e)}))})};var uO={},aO=(Object.defineProperty(uO,"__esModule",{value:!0}),uO.startWith=void 0,kd),sO=p,cO=h;uO.startWith=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var n=sO.popScheduler(r);return cO.operate(function(e,t){(n?aO.concat(r,e,n):aO.concat(r,e)).subscribe(t)})};var lO={},fO={},pO=(Object.defineProperty(fO,"__esModule",{value:!0}),fO.switchMap=void 0,C),dO=h,hO=b;fO.switchMap=function(s,c){return dO.operate(function(e,o){function i(){t&&!u&&o.complete()}var u=null,a=0,t=!1;e.subscribe(hO.createOperatorSubscriber(o,function(t){null!=u&&u.unsubscribe();var r=0,n=a++;pO.innerFrom(s(t,n)).subscribe(u=hO.createOperatorSubscriber(o,function(e){return o.next(c?c(t,e,n,r++):e)},function(){u=null,i()}))},function(){t=!0,i()}))})},Object.defineProperty(lO,"__esModule",{value:!0}),lO.switchAll=void 0;var bO=fO,yO=u;lO.switchAll=function(){return bO.switchMap(yO.identity)};var _O={},vO=(Object.defineProperty(_O,"__esModule",{value:!0}),_O.switchMapTo=void 0,fO),mO=_;_O.switchMapTo=function(e,t){return mO.isFunction(t)?vO.switchMap(function(){return e},t):vO.switchMap(function(){return e})};var gO={},OO=(Object.defineProperty(gO,"__esModule",{value:!0}),gO.switchScan=void 0,fO),wO=h;gO.switchScan=function(n,o){return wO.operate(function(e,t){var r=o;return OO.switchMap(function(e,t){return n(r,e,t)},function(e,t){return r=t})(e).subscribe(t),function(){r=null}})};var EO={},PO=(Object.defineProperty(EO,"__esModule",{value:!0}),EO.takeUntil=void 0,h),TO=b,SO=C,jO=fe;EO.takeUntil=function(r){return PO.operate(function(e,t){SO.innerFrom(r).subscribe(TO.createOperatorSubscriber(t,function(){return t.complete()},jO.noop)),t.closed||e.subscribe(t)})};var CO={},IO=(Object.defineProperty(CO,"__esModule",{value:!0}),CO.takeWhile=void 0,h),RO=b;CO.takeWhile=function(o,i){return void 0===i&&(i=!1),IO.operate(function(e,r){var n=0;e.subscribe(RO.createOperatorSubscriber(r,function(e){var t=o(e,n++);(t||i)&&r.next(e),t||r.complete()}))})};var AO={},MO=(Object.defineProperty(AO,"__esModule",{value:!0}),AO.tap=void 0,_),NO=h,kO=b,xO=u;AO.tap=function(e,t,r){var o=MO.isFunction(e)||t||r?{next:e,error:t,complete:r}:e;return o?NO.operate(function(e,r){null!=(t=o.subscribe)&&t.call(o);var t,n=!0;e.subscribe(kO.createOperatorSubscriber(r,function(e){var t;null!=(t=o.next)&&t.call(o,e),r.next(e)},function(){var e;n=!1,null!=(e=o.complete)&&e.call(o),r.complete()},function(e){var t;n=!1,null!=(t=o.error)&&t.call(o,e),r.error(e)},function(){var e;n&&null!=(e=o.unsubscribe)&&e.call(o),null!=(e=o.finalize)&&e.call(o)}))}):xO.identity};var _={},DO=(Object.defineProperty(_,"__esModule",{value:!0}),_.throttle=void 0,h),UO=b,LO=C;_.throttle=function(h,b){return DO.operate(function(e,t){var r=null!=b?b:{},n=r.leading,o=void 0===n||n,n=r.trailing,i=void 0!==n&&n,u=!1,a=null,s=null,c=!1,l=function(){null!=s&&s.unsubscribe(),s=null,i&&(d(),c)&&t.complete()},f=function(){s=null,c&&t.complete()},p=function(e){return s=LO.innerFrom(h(e)).subscribe(UO.createOperatorSubscriber(t,l,f))},d=function(){var e;u&&(u=!1,e=a,a=null,t.next(e),c||p(e))};e.subscribe(UO.createOperatorSubscriber(t,function(e){u=!0,a=e,s&&!s.closed||(o?d():p(e))},function(){c=!0,i&&u&&s&&!s.closed||t.complete()}))})};var FO={},BO=(Object.defineProperty(FO,"__esModule",{value:!0}),FO.throttleTime=void 0,so),VO=_,qO=Dh;FO.throttleTime=function(e,t,r){var n=qO.timer(e,t=void 0===t?BO.asyncScheduler:t);return VO.throttle(function(){return n},r)};var WO={},zO=(Object.defineProperty(WO,"__esModule",{value:!0}),WO.TimeInterval=WO.timeInterval=void 0,so),HO=h,GO=b;WO.timeInterval=function(i){return void 0===i&&(i=zO.asyncScheduler),HO.operate(function(e,n){var o=i.now();e.subscribe(GO.createOperatorSubscriber(n,function(e){var t=i.now(),r=t-o;o=t,n.next(new YO(e,r))}))})};var YO=function(e,t){this.value=e,this.interval=t},KO=(WO.TimeInterval=YO,{}),ZO=(Object.defineProperty(KO,"__esModule",{value:!0}),KO.timeoutWith=void 0,so),QO=rp,XO=_f;KO.timeoutWith=function(e,t,r){var n,o;if(r=null!=r?r:ZO.async,QO.isValidDate(e)?n=e:"number"==typeof e&&(o=e),!t)throw new TypeError("No observable provided to switch to");if(e=function(){return t},null==n&&null==o)throw new TypeError("No timeout provided.");return XO.timeout({first:n,each:o,scheduler:r,with:e})};var rp={},JO=(Object.defineProperty(rp,"__esModule",{value:!0}),rp.timestamp=void 0,Rt),$O=$p;rp.timestamp=function(t){return void 0===t&&(t=JO.dateTimestampProvider),$O.map(function(e){return{value:e,timestamp:t.now()}})};var Rt={},ew=(Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.window=void 0,S),tw=h,rw=b,nw=fe,ow=C;Rt.window=function(o){return tw.operate(function(e,t){function r(e){n.error(e),t.error(e)}var n=new ew.Subject;t.next(n.asObservable());return e.subscribe(rw.createOperatorSubscriber(t,function(e){return null==n?void 0:n.next(e)},function(){n.complete(),t.complete()},r)),ow.innerFrom(o).subscribe(rw.createOperatorSubscriber(t,function(){n.complete(),t.next(n=new ew.Subject)},nw.noop,r)),function(){null!=n&&n.unsubscribe(),n=null}})};var iw={},uw=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},aw=(Object.defineProperty(iw,"__esModule",{value:!0}),iw.windowCount=void 0,S),sw=h,cw=b;iw.windowCount=function(s,e){var c=0<(e=void 0===e?0:e)?e:s;return sw.operate(function(e,i){var u=[new aw.Subject],a=0;i.next(u[0].asObservable()),e.subscribe(cw.createOperatorSubscriber(i,function(e){try{for(var t=uw(u),r=t.next();!r.done;r=t.next())r.value.next(e)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=t.return)&&o.call(t)}finally{if(n)throw n.error}}var n,o=a-s+1;0<=o&&o%c==0&&u.shift().complete(),++a%c==0&&(n=new aw.Subject,u.push(n),i.next(n.asObservable()))},function(){for(;0<u.length;)u.shift().complete();i.complete()},function(e){for(;0<u.length;)u.shift().error(e);i.error(e)},function(){u=null}))})};var lw={},fw=(Object.defineProperty(lw,"__esModule",{value:!0}),lw.windowTime=void 0,S),pw=so,dw=o,hw=h,bw=b,yw=E,_w=p,vw=Wf;lw.windowTime=function(c){for(var e,t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var l=null!=(e=_w.popScheduler(t))?e:pw.asyncScheduler,f=null!=(e=t[0])?e:null,p=t[1]||1/0;return hw.operate(function(e,n){function r(t){s(function(e){e=e.window;return t(e)}),t(n),n.unsubscribe()}var o=[],i=!1,u=function(e){var t=e.window,r=e.subs;t.complete(),r.unsubscribe(),yw.arrRemove(o,e),i&&a()},a=function(){var e,t,r;o&&(e=new dw.Subscription,n.add(e),t=new fw.Subject,o.push(r={window:t,subs:e,seen:0}),n.next(t.asObservable()),vw.executeSchedule(e,l,function(){return u(r)},c))},s=(null!==f&&0<=f?vw.executeSchedule(n,l,a,f,!0):i=!0,a(),function(e){return o.slice().forEach(e)});return e.subscribe(bw.createOperatorSubscriber(n,function(t){s(function(e){e.window.next(t),p<=++e.seen&&u(e)})},function(){return r(function(e){return e.complete()})},function(t){return r(function(e){return e.error(t)})})),function(){o=null}})};var Wf={},mw=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},gw=(Object.defineProperty(Wf,"__esModule",{value:!0}),Wf.windowToggle=void 0,S),Ow=o,ww=h,Ew=C,Pw=b,Tw=fe,Sw=E;Wf.windowToggle=function(t,a){return ww.operate(function(e,o){function i(e){for(;0<u.length;)u.shift().error(e);o.error(e)}var u=[];Ew.innerFrom(t).subscribe(Pw.createOperatorSubscriber(o,function(e){var t,r=new gw.Subject,n=(u.push(r),new Ow.Subscription);try{t=Ew.innerFrom(a(e))}catch(e){return void i(e)}o.next(r.asObservable()),n.add(t.subscribe(Pw.createOperatorSubscriber(o,function(){Sw.arrRemove(u,r),r.complete(),n.unsubscribe()},Tw.noop,i)))},Tw.noop)),e.subscribe(Pw.createOperatorSubscriber(o,function(e){var t,r,n=u.slice();try{for(var o=mw(n),i=o.next();!i.done;i=o.next())i.value.next(e)}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}},function(){for(;0<u.length;)u.shift().complete();o.complete()},i,function(){for(;0<u.length;)u.shift().unsubscribe()}))})};var E={},jw=(Object.defineProperty(E,"__esModule",{value:!0}),E.windowWhen=void 0,S),Cw=h,Iw=b,Rw=C;E.windowWhen=function(u){return Cw.operate(function(e,t){var r,n,o=function(e){r.error(e),t.error(e)},i=function(){var e;null!=n&&n.unsubscribe(),null!=r&&r.complete(),r=new jw.Subject,t.next(r.asObservable());try{e=Rw.innerFrom(u())}catch(e){return void o(e)}e.subscribe(n=Iw.createOperatorSubscriber(t,i,i,o))};i(),e.subscribe(Iw.createOperatorSubscriber(t,function(e){return r.next(e)},function(){r.complete(),t.complete()},o,function(){null!=n&&n.unsubscribe(),r=null}))})};var Aw={},Mw=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Nw=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},kw=(Object.defineProperty(Aw,"__esModule",{value:!0}),Aw.withLatestFrom=void 0,h),xw=b,Dw=C,Uw=u,Lw=fe,Fw=p;Aw.withLatestFrom=function(){for(var a=[],e=0;e<arguments.length;e++)a[e]=arguments[e];var s=Fw.popResultSelector(a);return kw.operate(function(e,r){for(var t=a.length,n=new Array(t),o=a.map(function(){return!1}),i=!1,u=0;u<t;u++)(t=>{Dw.innerFrom(a[t]).subscribe(xw.createOperatorSubscriber(r,function(e){n[t]=e,!i&&!o[t]&&(o[t]=!0,i=o.every(Uw.identity))&&(o=null)},Lw.noop))})(u);e.subscribe(xw.createOperatorSubscriber(r,function(e){i&&(e=Nw([e],Mw(n)),r.next(s?s.apply(void 0,Nw([],Mw(e))):e))}))})};var b={},Bw=(Object.defineProperty(b,"__esModule",{value:!0}),b.zipAll=void 0,Sb),Vw=R;b.zipAll=function(e){return Vw.joinAllInternals(Bw.zip,e)};var C={},p={},qw=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Ww=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},zw=(Object.defineProperty(p,"__esModule",{value:!0}),p.zip=void 0,Sb),Hw=h;p.zip=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return Hw.operate(function(e,t){zw.zip.apply(void 0,Ww([e],qw(r))).subscribe(t)})};var Gw,Yw,Kw,Zw,Qw,Xw,Jw,$w,eE,tE,rE,nE,oE,iE,uE,aE,sE,cE,lE,fE,pE,dE,hE,bE,yE,_E,vE,mE,gE,OE,wE,EE,PE,TE,SE,jE,CE,IE,RE,AE,ME,NE,kE,xE,DE,UE,LE,FE,BE,VE,qE,WE,zE,HE,GE,YE,KE,ZE,QE,XE,JE,$E,eP,tP,rP,nP,oP,iP,uP,aP,sP,cP,lP,fP,pP,dP,hP,bP,yP,_P,vP,mP,gP,OP,wP,EP,PP,TP,SP,jP,CP,IP,RP,AP,MP,NP,kP,xP,DP,UP,LP,FP,BP,VP,qP,WP,zP,HP,GP,YP,KP,ZP,QP,XP,JP,$P,eT,tT,rT,nT,oT,iT,uT,aT,sT,cT,lT,fT,pT,dT,hT,bT,yT,_T,vT,mT,gT,OT,wT,ET,PT,TT,ST,jT,CT,IT,RT,AT,MT,NT,kT,xT,DT,UT,LT,FT,BT,VT,qT,WT,zT,HT,GT,YT,KT,ZT,QT,XT,JT=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},$T=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},eS=(Object.defineProperty(C,"__esModule",{value:!0}),C.zipWith=void 0,p);C.zipWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return eS.zip.apply(void 0,$T([],JT(e)))},R=bo,Gw=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),h=r&&r.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Gw(t,e,r)},Object.defineProperty(R,"__esModule",{value:!0}),R.interval=R.iif=R.generate=R.fromEventPattern=R.fromEvent=R.from=R.forkJoin=R.empty=R.defer=R.connectable=R.concat=R.combineLatest=R.bindNodeCallback=R.bindCallback=R.UnsubscriptionError=R.TimeoutError=R.SequenceError=R.ObjectUnsubscribedError=R.NotFoundError=R.EmptyError=R.ArgumentOutOfRangeError=R.firstValueFrom=R.lastValueFrom=R.isObservable=R.identity=R.noop=R.pipe=R.NotificationKind=R.Notification=R.Subscriber=R.Subscription=R.Scheduler=R.VirtualAction=R.VirtualTimeScheduler=R.animationFrameScheduler=R.animationFrame=R.queueScheduler=R.queue=R.asyncScheduler=R.async=R.asapScheduler=R.asap=R.AsyncSubject=R.ReplaySubject=R.BehaviorSubject=R.Subject=R.animationFrames=R.observable=R.ConnectableObservable=R.Observable=void 0,R.filter=R.expand=R.exhaustMap=R.exhaustAll=R.exhaust=R.every=R.endWith=R.elementAt=R.distinctUntilKeyChanged=R.distinctUntilChanged=R.distinct=R.dematerialize=R.delayWhen=R.delay=R.defaultIfEmpty=R.debounceTime=R.debounce=R.count=R.connect=R.concatWith=R.concatMapTo=R.concatMap=R.concatAll=R.combineLatestWith=R.combineLatestAll=R.combineAll=R.catchError=R.bufferWhen=R.bufferToggle=R.bufferTime=R.bufferCount=R.buffer=R.auditTime=R.audit=R.config=R.NEVER=R.EMPTY=R.scheduled=R.zip=R.using=R.timer=R.throwError=R.range=R.race=R.partition=R.pairs=R.onErrorResumeNext=R.of=R.never=R.merge=void 0,R.switchMap=R.switchAll=R.subscribeOn=R.startWith=R.skipWhile=R.skipUntil=R.skipLast=R.skip=R.single=R.shareReplay=R.share=R.sequenceEqual=R.scan=R.sampleTime=R.sample=R.refCount=R.retryWhen=R.retry=R.repeatWhen=R.repeat=R.reduce=R.raceWith=R.publishReplay=R.publishLast=R.publishBehavior=R.publish=R.pluck=R.pairwise=R.onErrorResumeNextWith=R.observeOn=R.multicast=R.min=R.mergeWith=R.mergeScan=R.mergeMapTo=R.mergeMap=R.flatMap=R.mergeAll=R.max=R.materialize=R.mapTo=R.map=R.last=R.isEmpty=R.ignoreElements=R.groupBy=R.first=R.findIndex=R.find=R.finalize=void 0,R.zipWith=R.zipAll=R.withLatestFrom=R.windowWhen=R.windowToggle=R.windowTime=R.windowCount=R.window=R.toArray=R.timestamp=R.timeoutWith=R.timeout=R.timeInterval=R.throwIfEmpty=R.throttleTime=R.throttle=R.tap=R.takeWhile=R.takeUntil=R.takeLast=R.take=R.switchScan=R.switchMapTo=void 0,Yw=w,Object.defineProperty(R,"Observable",{enumerable:!0,get:function(){return Yw.Observable}}),Kw=l,Object.defineProperty(R,"ConnectableObservable",{enumerable:!0,get:function(){return Kw.ConnectableObservable}}),Zw=t,Object.defineProperty(R,"observable",{enumerable:!0,get:function(){return Zw.observable}}),Qw=T,Object.defineProperty(R,"animationFrames",{enumerable:!0,get:function(){return Qw.animationFrames}}),Xw=S,Object.defineProperty(R,"Subject",{enumerable:!0,get:function(){return Xw.Subject}}),Jw=pe,Object.defineProperty(R,"BehaviorSubject",{enumerable:!0,get:function(){return Jw.BehaviorSubject}}),$w=P,Object.defineProperty(R,"ReplaySubject",{enumerable:!0,get:function(){return $w.ReplaySubject}}),eE=G,Object.defineProperty(R,"AsyncSubject",{enumerable:!0,get:function(){return eE.AsyncSubject}}),tE=Ar,Object.defineProperty(R,"asap",{enumerable:!0,get:function(){return tE.asap}}),Object.defineProperty(R,"asapScheduler",{enumerable:!0,get:function(){return tE.asapScheduler}}),rE=so,Object.defineProperty(R,"async",{enumerable:!0,get:function(){return rE.async}}),Object.defineProperty(R,"asyncScheduler",{enumerable:!0,get:function(){return rE.asyncScheduler}}),nE=ro,Object.defineProperty(R,"queue",{enumerable:!0,get:function(){return nE.queue}}),Object.defineProperty(R,"queueScheduler",{enumerable:!0,get:function(){return nE.queueScheduler}}),oE=Uo,Object.defineProperty(R,"animationFrame",{enumerable:!0,get:function(){return oE.animationFrame}}),Object.defineProperty(R,"animationFrameScheduler",{enumerable:!0,get:function(){return oE.animationFrameScheduler}}),iE=m,Object.defineProperty(R,"VirtualTimeScheduler",{enumerable:!0,get:function(){return iE.VirtualTimeScheduler}}),Object.defineProperty(R,"VirtualAction",{enumerable:!0,get:function(){return iE.VirtualAction}}),uE=ao,Object.defineProperty(R,"Scheduler",{enumerable:!0,get:function(){return uE.Scheduler}}),aE=o,Object.defineProperty(R,"Subscription",{enumerable:!0,get:function(){return aE.Subscription}}),sE=Zn,Object.defineProperty(R,"Subscriber",{enumerable:!0,get:function(){return sE.Subscriber}}),cE=y,Object.defineProperty(R,"Notification",{enumerable:!0,get:function(){return cE.Notification}}),Object.defineProperty(R,"NotificationKind",{enumerable:!0,get:function(){return cE.NotificationKind}}),lE=i,Object.defineProperty(R,"pipe",{enumerable:!0,get:function(){return lE.pipe}}),fE=fe,Object.defineProperty(R,"noop",{enumerable:!0,get:function(){return fE.noop}}),pE=u,Object.defineProperty(R,"identity",{enumerable:!0,get:function(){return pE.identity}}),dE=df,Object.defineProperty(R,"isObservable",{enumerable:!0,get:function(){return dE.isObservable}}),hE=uf,Object.defineProperty(R,"lastValueFrom",{enumerable:!0,get:function(){return hE.lastValueFrom}}),bE=cf,Object.defineProperty(R,"firstValueFrom",{enumerable:!0,get:function(){return bE.firstValueFrom}}),yE=ff,Object.defineProperty(R,"ArgumentOutOfRangeError",{enumerable:!0,get:function(){return yE.ArgumentOutOfRangeError}}),_E=nf,Object.defineProperty(R,"EmptyError",{enumerable:!0,get:function(){return _E.EmptyError}}),vE=fp,Object.defineProperty(R,"NotFoundError",{enumerable:!0,get:function(){return vE.NotFoundError}}),mE=v,Object.defineProperty(R,"ObjectUnsubscribedError",{enumerable:!0,get:function(){return mE.ObjectUnsubscribedError}}),gE=Jf,Object.defineProperty(R,"SequenceError",{enumerable:!0,get:function(){return gE.SequenceError}}),OE=_f,Object.defineProperty(R,"TimeoutError",{enumerable:!0,get:function(){return OE.TimeoutError}}),wE=g,Object.defineProperty(R,"UnsubscriptionError",{enumerable:!0,get:function(){return wE.UnsubscriptionError}}),EE=pf,Object.defineProperty(R,"bindCallback",{enumerable:!0,get:function(){return EE.bindCallback}}),PE=bd,Object.defineProperty(R,"bindNodeCallback",{enumerable:!0,get:function(){return PE.bindNodeCallback}}),TE=F,Object.defineProperty(R,"combineLatest",{enumerable:!0,get:function(){return TE.combineLatest}}),SE=kd,Object.defineProperty(R,"concat",{enumerable:!0,get:function(){return SE.concat}}),jE=$d,Object.defineProperty(R,"connectable",{enumerable:!0,get:function(){return jE.connectable}}),CE=eh,Object.defineProperty(R,"defer",{enumerable:!0,get:function(){return CE.defer}}),IE=n,Object.defineProperty(R,"empty",{enumerable:!0,get:function(){return IE.empty}}),RE=ah,Object.defineProperty(R,"forkJoin",{enumerable:!0,get:function(){return RE.forkJoin}}),AE=$l,Object.defineProperty(R,"from",{enumerable:!0,get:function(){return AE.from}}),ME=_d,Object.defineProperty(R,"fromEvent",{enumerable:!0,get:function(){return ME.fromEvent}}),NE=wd,Object.defineProperty(R,"fromEventPattern",{enumerable:!0,get:function(){return NE.fromEventPattern}}),kE=rf,Object.defineProperty(R,"generate",{enumerable:!0,get:function(){return kE.generate}}),xE=op,Object.defineProperty(R,"iif",{enumerable:!0,get:function(){return xE.iif}}),DE=xh,Object.defineProperty(R,"interval",{enumerable:!0,get:function(){return DE.interval}}),UE=j,Object.defineProperty(R,"merge",{enumerable:!0,get:function(){return UE.merge}}),LE=Zh,Object.defineProperty(R,"never",{enumerable:!0,get:function(){return LE.never}}),FE=O,Object.defineProperty(R,"of",{enumerable:!0,get:function(){return FE.of}}),BE=Qh,Object.defineProperty(R,"onErrorResumeNext",{enumerable:!0,get:function(){return BE.onErrorResumeNext}}),VE=ob,Object.defineProperty(R,"pairs",{enumerable:!0,get:function(){return VE.pairs}}),qE=I,Object.defineProperty(R,"partition",{enumerable:!0,get:function(){return qE.partition}}),WE=db,Object.defineProperty(R,"race",{enumerable:!0,get:function(){return WE.race}}),zE=mb,Object.defineProperty(R,"range",{enumerable:!0,get:function(){return zE.range}}),HE=tf,Object.defineProperty(R,"throwError",{enumerable:!0,get:function(){return HE.throwError}}),GE=Dh,Object.defineProperty(R,"timer",{enumerable:!0,get:function(){return GE.timer}}),YE=wb,Object.defineProperty(R,"using",{enumerable:!0,get:function(){return YE.using}}),KE=Sb,Object.defineProperty(R,"zip",{enumerable:!0,get:function(){return KE.zip}}),ZE=ef,Object.defineProperty(R,"scheduled",{enumerable:!0,get:function(){return ZE.scheduled}}),QE=n,Object.defineProperty(R,"EMPTY",{enumerable:!0,get:function(){return QE.EMPTY}}),XE=Zh,Object.defineProperty(R,"NEVER",{enumerable:!0,get:function(){return XE.NEVER}}),h(xb,R),JE=Wr,Object.defineProperty(R,"config",{enumerable:!0,get:function(){return JE.config}}),$E=Db,Object.defineProperty(R,"audit",{enumerable:!0,get:function(){return $E.audit}}),eP=Bb,Object.defineProperty(R,"auditTime",{enumerable:!0,get:function(){return eP.auditTime}}),tP=zb,Object.defineProperty(R,"buffer",{enumerable:!0,get:function(){return tP.buffer}}),rP=Zb,Object.defineProperty(R,"bufferCount",{enumerable:!0,get:function(){return rP.bufferCount}}),nP=ey,Object.defineProperty(R,"bufferTime",{enumerable:!0,get:function(){return nP.bufferTime}}),oP=cy,Object.defineProperty(R,"bufferToggle",{enumerable:!0,get:function(){return oP.bufferToggle}}),iP=_y,Object.defineProperty(R,"bufferWhen",{enumerable:!0,get:function(){return iP.bufferWhen}}),uP=wy,Object.defineProperty(R,"catchError",{enumerable:!0,get:function(){return uP.catchError}}),aP=Sy,Object.defineProperty(R,"combineAll",{enumerable:!0,get:function(){return aP.combineAll}}),sP=jy,Object.defineProperty(R,"combineLatestAll",{enumerable:!0,get:function(){return sP.combineLatestAll}}),cP=zy,Object.defineProperty(R,"combineLatestWith",{enumerable:!0,get:function(){return cP.combineLatestWith}}),lP=xd,Object.defineProperty(R,"concatAll",{enumerable:!0,get:function(){return lP.concatAll}}),fP=Jp,Object.defineProperty(R,"concatMap",{enumerable:!0,get:function(){return fP.concatMap}}),pP=u_,Object.defineProperty(R,"concatMapTo",{enumerable:!0,get:function(){return pP.concatMapTo}}),dP=c_,Object.defineProperty(R,"concatWith",{enumerable:!0,get:function(){return dP.concatWith}}),hP=g_,Object.defineProperty(R,"connect",{enumerable:!0,get:function(){return hP.connect}}),bP=O_,Object.defineProperty(R,"count",{enumerable:!0,get:function(){return bP.count}}),yP=I_,Object.defineProperty(R,"debounce",{enumerable:!0,get:function(){return yP.debounce}}),_P=k_,Object.defineProperty(R,"debounceTime",{enumerable:!0,get:function(){return _P.debounceTime}}),vP=A,Object.defineProperty(R,"defaultIfEmpty",{enumerable:!0,get:function(){return vP.defaultIfEmpty}}),mP=B_,Object.defineProperty(R,"delay",{enumerable:!0,get:function(){return mP.delay}}),gP=V_,Object.defineProperty(R,"delayWhen",{enumerable:!0,get:function(){return gP.delayWhen}}),OP=av,Object.defineProperty(R,"dematerialize",{enumerable:!0,get:function(){return OP.dematerialize}}),wP=fv,Object.defineProperty(R,"distinct",{enumerable:!0,get:function(){return wP.distinct}}),EP=yv,Object.defineProperty(R,"distinctUntilChanged",{enumerable:!0,get:function(){return EP.distinctUntilChanged}}),PP=Ov,Object.defineProperty(R,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return PP.distinctUntilKeyChanged}}),TP=Ev,Object.defineProperty(R,"elementAt",{enumerable:!0,get:function(){return TP.elementAt}}),SP=kv,Object.defineProperty(R,"endWith",{enumerable:!0,get:function(){return SP.endWith}}),jP=Fv,Object.defineProperty(R,"every",{enumerable:!0,get:function(){return jP.every}}),CP=qv,Object.defineProperty(R,"exhaust",{enumerable:!0,get:function(){return CP.exhaust}}),IP=Wv,Object.defineProperty(R,"exhaustAll",{enumerable:!0,get:function(){return IP.exhaustAll}}),RP=zv,Object.defineProperty(R,"exhaustMap",{enumerable:!0,get:function(){return RP.exhaustMap}}),AP=Xv,Object.defineProperty(R,"expand",{enumerable:!0,get:function(){return AP.expand}}),MP=ab,Object.defineProperty(R,"filter",{enumerable:!0,get:function(){return MP.filter}}),NP=em,Object.defineProperty(R,"finalize",{enumerable:!0,get:function(){return NP.finalize}}),kP=rm,Object.defineProperty(R,"find",{enumerable:!0,get:function(){return kP.find}}),xP=um,Object.defineProperty(R,"findIndex",{enumerable:!0,get:function(){return xP.findIndex}}),DP=cm,Object.defineProperty(R,"first",{enumerable:!0,get:function(){return DP.first}}),UP=ym,Object.defineProperty(R,"groupBy",{enumerable:!0,get:function(){return UP.groupBy}}),LP=G_,Object.defineProperty(R,"ignoreElements",{enumerable:!0,get:function(){return LP.ignoreElements}}),FP=wm,Object.defineProperty(R,"isEmpty",{enumerable:!0,get:function(){return FP.isEmpty}}),BP=Tm,Object.defineProperty(R,"last",{enumerable:!0,get:function(){return BP.last}}),VP=$p,Object.defineProperty(R,"map",{enumerable:!0,get:function(){return VP.map}}),qP=Q_,Object.defineProperty(R,"mapTo",{enumerable:!0,get:function(){return qP.mapTo}}),WP=Um,Object.defineProperty(R,"materialize",{enumerable:!0,get:function(){return WP.materialize}}),zP=Vm,Object.defineProperty(R,"max",{enumerable:!0,get:function(){return zP.max}}),HP=Dd,Object.defineProperty(R,"mergeAll",{enumerable:!0,get:function(){return HP.mergeAll}}),GP=zm,Object.defineProperty(R,"flatMap",{enumerable:!0,get:function(){return GP.flatMap}}),YP=Ud,Object.defineProperty(R,"mergeMap",{enumerable:!0,get:function(){return YP.mergeMap}}),KP=Hm,Object.defineProperty(R,"mergeMapTo",{enumerable:!0,get:function(){return KP.mergeMapTo}}),ZP=Km,Object.defineProperty(R,"mergeScan",{enumerable:!0,get:function(){return ZP.mergeScan}}),QP=Ld,Object.defineProperty(R,"mergeWith",{enumerable:!0,get:function(){return QP.mergeWith}}),XP=a0,Object.defineProperty(R,"min",{enumerable:!0,get:function(){return XP.min}}),JP=l0,Object.defineProperty(R,"multicast",{enumerable:!0,get:function(){return JP.multicast}}),$P=a,Object.defineProperty(R,"observeOn",{enumerable:!0,get:function(){return $P.observeOn}}),eT=h0,Object.defineProperty(R,"onErrorResumeNextWith",{enumerable:!0,get:function(){return eT.onErrorResumeNextWith}}),tT=g0,Object.defineProperty(R,"pairwise",{enumerable:!0,get:function(){return tT.pairwise}}),rT=E0,Object.defineProperty(R,"pluck",{enumerable:!0,get:function(){return rT.pluck}}),nT=T0,Object.defineProperty(R,"publish",{enumerable:!0,get:function(){return nT.publish}}),oT=I0,Object.defineProperty(R,"publishBehavior",{enumerable:!0,get:function(){return oT.publishBehavior}}),iT=M0,Object.defineProperty(R,"publishLast",{enumerable:!0,get:function(){return iT.publishLast}}),uT=x0,Object.defineProperty(R,"publishReplay",{enumerable:!0,get:function(){return uT.publishReplay}}),aT=F0,Object.defineProperty(R,"raceWith",{enumerable:!0,get:function(){return aT.raceWith}}),sT=Iy,Object.defineProperty(R,"reduce",{enumerable:!0,get:function(){return sT.reduce}}),cT=H0,Object.defineProperty(R,"repeat",{enumerable:!0,get:function(){return cT.repeat}}),lT=X0,Object.defineProperty(R,"repeatWhen",{enumerable:!0,get:function(){return lT.repeatWhen}}),fT=rg,Object.defineProperty(R,"retry",{enumerable:!0,get:function(){return fT.retry}}),pT=sg,Object.defineProperty(R,"retryWhen",{enumerable:!0,get:function(){return pT.retryWhen}}),dT=Gt,Object.defineProperty(R,"refCount",{enumerable:!0,get:function(){return dT.refCount}}),hT=dg,Object.defineProperty(R,"sample",{enumerable:!0,get:function(){return hT.sample}}),bT=vg,Object.defineProperty(R,"sampleTime",{enumerable:!0,get:function(){return bT.sampleTime}}),yT=wg,Object.defineProperty(R,"scan",{enumerable:!0,get:function(){return yT.scan}}),_T=Ry,Object.defineProperty(R,"sequenceEqual",{enumerable:!0,get:function(){return _T.sequenceEqual}}),vT=Ig,Object.defineProperty(R,"share",{enumerable:!0,get:function(){return vT.share}}),mT=Ug,Object.defineProperty(R,"shareReplay",{enumerable:!0,get:function(){return mT.shareReplay}}),gT=Bg,Object.defineProperty(R,"single",{enumerable:!0,get:function(){return gT.single}}),OT=Gg,Object.defineProperty(R,"skip",{enumerable:!0,get:function(){return OT.skip}}),wT=Kg,Object.defineProperty(R,"skipLast",{enumerable:!0,get:function(){return wT.skipLast}}),ET=Jg,Object.defineProperty(R,"skipUntil",{enumerable:!0,get:function(){return ET.skipUntil}}),PT=nO,Object.defineProperty(R,"skipWhile",{enumerable:!0,get:function(){return PT.skipWhile}}),TT=uO,Object.defineProperty(R,"startWith",{enumerable:!0,get:function(){return TT.startWith}}),ST=Yf,Object.defineProperty(R,"subscribeOn",{enumerable:!0,get:function(){return ST.subscribeOn}}),jT=lO,Object.defineProperty(R,"switchAll",{enumerable:!0,get:function(){return jT.switchAll}}),CT=fO,Object.defineProperty(R,"switchMap",{enumerable:!0,get:function(){return CT.switchMap}}),IT=_O,Object.defineProperty(R,"switchMapTo",{enumerable:!0,get:function(){return IT.switchMapTo}}),RT=gO,Object.defineProperty(R,"switchScan",{enumerable:!0,get:function(){return RT.switchScan}}),AT=q_,Object.defineProperty(R,"take",{enumerable:!0,get:function(){return AT.take}}),MT=Sm,Object.defineProperty(R,"takeLast",{enumerable:!0,get:function(){return MT.takeLast}}),NT=EO,Object.defineProperty(R,"takeUntil",{enumerable:!0,get:function(){return NT.takeUntil}}),kT=CO,Object.defineProperty(R,"takeWhile",{enumerable:!0,get:function(){return kT.takeWhile}}),xT=AO,Object.defineProperty(R,"tap",{enumerable:!0,get:function(){return xT.tap}}),DT=_,Object.defineProperty(R,"throttle",{enumerable:!0,get:function(){return DT.throttle}}),UT=FO,Object.defineProperty(R,"throttleTime",{enumerable:!0,get:function(){return UT.throttleTime}}),LT=Pv,Object.defineProperty(R,"throwIfEmpty",{enumerable:!0,get:function(){return LT.throwIfEmpty}}),FT=WO,Object.defineProperty(R,"timeInterval",{enumerable:!0,get:function(){return FT.timeInterval}}),BT=_f,Object.defineProperty(R,"timeout",{enumerable:!0,get:function(){return BT.timeout}}),VT=KO,Object.defineProperty(R,"timeoutWith",{enumerable:!0,get:function(){return VT.timeoutWith}}),qT=rp,Object.defineProperty(R,"timestamp",{enumerable:!0,get:function(){return qT.timestamp}}),WT=Cy,Object.defineProperty(R,"toArray",{enumerable:!0,get:function(){return WT.toArray}}),zT=Rt,Object.defineProperty(R,"window",{enumerable:!0,get:function(){return zT.window}}),HT=iw,Object.defineProperty(R,"windowCount",{enumerable:!0,get:function(){return HT.windowCount}}),GT=lw,Object.defineProperty(R,"windowTime",{enumerable:!0,get:function(){return GT.windowTime}}),YT=Wf,Object.defineProperty(R,"windowToggle",{enumerable:!0,get:function(){return YT.windowToggle}}),KT=E,Object.defineProperty(R,"windowWhen",{enumerable:!0,get:function(){return KT.windowWhen}}),ZT=Aw,Object.defineProperty(R,"withLatestFrom",{enumerable:!0,get:function(){return ZT.withLatestFrom}}),QT=b,Object.defineProperty(R,"zipAll",{enumerable:!0,get:function(){return QT.zipAll}}),XT=C,Object.defineProperty(R,"zipWith",{enumerable:!0,get:function(){return XT.zipWith}});var w={},l={},tS=(Object.defineProperty(l,"__esModule",{value:!0}),l.partition=void 0,ub),rS=ab;l.partition=function(t,r){return function(e){return[rS.filter(t,r)(e),rS.filter(tS.not(t,r))(e)]}};var nS,oS,iS,uS,aS,sS,cS,lS,fS,pS,dS,hS,bS,yS,_S,vS,mS,gS,OS,wS,ES,PS,TS,SS,jS,CS,IS,RS,AS,MS,NS,kS,xS,DS,US,LS,FS,BS,VS,qS,WS,zS,HS,GS,YS,KS,ZS,QS,XS,JS,$S,e1,t1,r1,n1,o1,i1,u1,a1,s1,c1,l1,f1,p1,d1,h1,b1,y1,_1,v1,m1,g1,O1,w1,E1,P1,T1,S1,j1,C1,I1,R1,A1,M1,N1,k1,x1,D1,U1,L1,F1,B1,V1,q1,W1,z1,H1,G1,Y1,K1,Z1,Q1,X1,J1,$1,ej,tj,rj,nj,oj,ij,uj,aj,t={},sj=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},cj=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},lj=(Object.defineProperty(t,"__esModule",{value:!0}),t.race=void 0,Xh),fj=F0;t.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return fj.raceWith.apply(void 0,cj([],sj(lj.argsOrArgArray(e))))},T=w,Object.defineProperty(T,"__esModule",{value:!0}),T.mergeAll=T.merge=T.max=T.materialize=T.mapTo=T.map=T.last=T.isEmpty=T.ignoreElements=T.groupBy=T.first=T.findIndex=T.find=T.finalize=T.filter=T.expand=T.exhaustMap=T.exhaustAll=T.exhaust=T.every=T.endWith=T.elementAt=T.distinctUntilKeyChanged=T.distinctUntilChanged=T.distinct=T.dematerialize=T.delayWhen=T.delay=T.defaultIfEmpty=T.debounceTime=T.debounce=T.count=T.connect=T.concatWith=T.concatMapTo=T.concatMap=T.concatAll=T.concat=T.combineLatestWith=T.combineLatest=T.combineLatestAll=T.combineAll=T.catchError=T.bufferWhen=T.bufferToggle=T.bufferTime=T.bufferCount=T.buffer=T.auditTime=T.audit=void 0,T.timeInterval=T.throwIfEmpty=T.throttleTime=T.throttle=T.tap=T.takeWhile=T.takeUntil=T.takeLast=T.take=T.switchScan=T.switchMapTo=T.switchMap=T.switchAll=T.subscribeOn=T.startWith=T.skipWhile=T.skipUntil=T.skipLast=T.skip=T.single=T.shareReplay=T.share=T.sequenceEqual=T.scan=T.sampleTime=T.sample=T.refCount=T.retryWhen=T.retry=T.repeatWhen=T.repeat=T.reduce=T.raceWith=T.race=T.publishReplay=T.publishLast=T.publishBehavior=T.publish=T.pluck=T.partition=T.pairwise=T.onErrorResumeNext=T.observeOn=T.multicast=T.min=T.mergeWith=T.mergeScan=T.mergeMapTo=T.mergeMap=T.flatMap=void 0,T.zipWith=T.zipAll=T.zip=T.withLatestFrom=T.windowWhen=T.windowToggle=T.windowTime=T.windowCount=T.window=T.toArray=T.timestamp=T.timeoutWith=T.timeout=void 0,nS=Db,Object.defineProperty(T,"audit",{enumerable:!0,get:function(){return nS.audit}}),oS=Bb,Object.defineProperty(T,"auditTime",{enumerable:!0,get:function(){return oS.auditTime}}),iS=zb,Object.defineProperty(T,"buffer",{enumerable:!0,get:function(){return iS.buffer}}),uS=Zb,Object.defineProperty(T,"bufferCount",{enumerable:!0,get:function(){return uS.bufferCount}}),aS=ey,Object.defineProperty(T,"bufferTime",{enumerable:!0,get:function(){return aS.bufferTime}}),sS=cy,Object.defineProperty(T,"bufferToggle",{enumerable:!0,get:function(){return sS.bufferToggle}}),cS=_y,Object.defineProperty(T,"bufferWhen",{enumerable:!0,get:function(){return cS.bufferWhen}}),lS=wy,Object.defineProperty(T,"catchError",{enumerable:!0,get:function(){return lS.catchError}}),fS=Sy,Object.defineProperty(T,"combineAll",{enumerable:!0,get:function(){return fS.combineAll}}),pS=jy,Object.defineProperty(T,"combineLatestAll",{enumerable:!0,get:function(){return pS.combineLatestAll}}),dS=Hy,Object.defineProperty(T,"combineLatest",{enumerable:!0,get:function(){return dS.combineLatest}}),hS=zy,Object.defineProperty(T,"combineLatestWith",{enumerable:!0,get:function(){return hS.combineLatestWith}}),bS=l_,Object.defineProperty(T,"concat",{enumerable:!0,get:function(){return bS.concat}}),yS=xd,Object.defineProperty(T,"concatAll",{enumerable:!0,get:function(){return yS.concatAll}}),_S=Jp,Object.defineProperty(T,"concatMap",{enumerable:!0,get:function(){return _S.concatMap}}),vS=u_,Object.defineProperty(T,"concatMapTo",{enumerable:!0,get:function(){return vS.concatMapTo}}),mS=c_,Object.defineProperty(T,"concatWith",{enumerable:!0,get:function(){return mS.concatWith}}),gS=g_,Object.defineProperty(T,"connect",{enumerable:!0,get:function(){return gS.connect}}),OS=O_,Object.defineProperty(T,"count",{enumerable:!0,get:function(){return OS.count}}),wS=I_,Object.defineProperty(T,"debounce",{enumerable:!0,get:function(){return wS.debounce}}),ES=k_,Object.defineProperty(T,"debounceTime",{enumerable:!0,get:function(){return ES.debounceTime}}),PS=A,Object.defineProperty(T,"defaultIfEmpty",{enumerable:!0,get:function(){return PS.defaultIfEmpty}}),TS=B_,Object.defineProperty(T,"delay",{enumerable:!0,get:function(){return TS.delay}}),SS=V_,Object.defineProperty(T,"delayWhen",{enumerable:!0,get:function(){return SS.delayWhen}}),jS=av,Object.defineProperty(T,"dematerialize",{enumerable:!0,get:function(){return jS.dematerialize}}),CS=fv,Object.defineProperty(T,"distinct",{enumerable:!0,get:function(){return CS.distinct}}),IS=yv,Object.defineProperty(T,"distinctUntilChanged",{enumerable:!0,get:function(){return IS.distinctUntilChanged}}),RS=Ov,Object.defineProperty(T,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return RS.distinctUntilKeyChanged}}),AS=Ev,Object.defineProperty(T,"elementAt",{enumerable:!0,get:function(){return AS.elementAt}}),MS=kv,Object.defineProperty(T,"endWith",{enumerable:!0,get:function(){return MS.endWith}}),NS=Fv,Object.defineProperty(T,"every",{enumerable:!0,get:function(){return NS.every}}),kS=qv,Object.defineProperty(T,"exhaust",{enumerable:!0,get:function(){return kS.exhaust}}),xS=Wv,Object.defineProperty(T,"exhaustAll",{enumerable:!0,get:function(){return xS.exhaustAll}}),DS=zv,Object.defineProperty(T,"exhaustMap",{enumerable:!0,get:function(){return DS.exhaustMap}}),US=Xv,Object.defineProperty(T,"expand",{enumerable:!0,get:function(){return US.expand}}),LS=ab,Object.defineProperty(T,"filter",{enumerable:!0,get:function(){return LS.filter}}),FS=em,Object.defineProperty(T,"finalize",{enumerable:!0,get:function(){return FS.finalize}}),BS=rm,Object.defineProperty(T,"find",{enumerable:!0,get:function(){return BS.find}}),VS=um,Object.defineProperty(T,"findIndex",{enumerable:!0,get:function(){return VS.findIndex}}),qS=cm,Object.defineProperty(T,"first",{enumerable:!0,get:function(){return qS.first}}),WS=ym,Object.defineProperty(T,"groupBy",{enumerable:!0,get:function(){return WS.groupBy}}),zS=G_,Object.defineProperty(T,"ignoreElements",{enumerable:!0,get:function(){return zS.ignoreElements}}),HS=wm,Object.defineProperty(T,"isEmpty",{enumerable:!0,get:function(){return HS.isEmpty}}),GS=Tm,Object.defineProperty(T,"last",{enumerable:!0,get:function(){return GS.last}}),YS=$p,Object.defineProperty(T,"map",{enumerable:!0,get:function(){return YS.map}}),KS=Q_,Object.defineProperty(T,"mapTo",{enumerable:!0,get:function(){return KS.mapTo}}),ZS=Um,Object.defineProperty(T,"materialize",{enumerable:!0,get:function(){return ZS.materialize}}),QS=Vm,Object.defineProperty(T,"max",{enumerable:!0,get:function(){return QS.max}}),XS=Xm,Object.defineProperty(T,"merge",{enumerable:!0,get:function(){return XS.merge}}),JS=Dd,Object.defineProperty(T,"mergeAll",{enumerable:!0,get:function(){return JS.mergeAll}}),$S=zm,Object.defineProperty(T,"flatMap",{enumerable:!0,get:function(){return $S.flatMap}}),e1=Ud,Object.defineProperty(T,"mergeMap",{enumerable:!0,get:function(){return e1.mergeMap}}),t1=Hm,Object.defineProperty(T,"mergeMapTo",{enumerable:!0,get:function(){return t1.mergeMapTo}}),r1=Km,Object.defineProperty(T,"mergeScan",{enumerable:!0,get:function(){return r1.mergeScan}}),n1=Ld,Object.defineProperty(T,"mergeWith",{enumerable:!0,get:function(){return n1.mergeWith}}),o1=a0,Object.defineProperty(T,"min",{enumerable:!0,get:function(){return o1.min}}),i1=l0,Object.defineProperty(T,"multicast",{enumerable:!0,get:function(){return i1.multicast}}),u1=a,Object.defineProperty(T,"observeOn",{enumerable:!0,get:function(){return u1.observeOn}}),a1=h0,Object.defineProperty(T,"onErrorResumeNext",{enumerable:!0,get:function(){return a1.onErrorResumeNext}}),s1=g0,Object.defineProperty(T,"pairwise",{enumerable:!0,get:function(){return s1.pairwise}}),c1=l,Object.defineProperty(T,"partition",{enumerable:!0,get:function(){return c1.partition}}),l1=E0,Object.defineProperty(T,"pluck",{enumerable:!0,get:function(){return l1.pluck}}),f1=T0,Object.defineProperty(T,"publish",{enumerable:!0,get:function(){return f1.publish}}),p1=I0,Object.defineProperty(T,"publishBehavior",{enumerable:!0,get:function(){return p1.publishBehavior}}),d1=M0,Object.defineProperty(T,"publishLast",{enumerable:!0,get:function(){return d1.publishLast}}),h1=x0,Object.defineProperty(T,"publishReplay",{enumerable:!0,get:function(){return h1.publishReplay}}),b1=t,Object.defineProperty(T,"race",{enumerable:!0,get:function(){return b1.race}}),y1=F0,Object.defineProperty(T,"raceWith",{enumerable:!0,get:function(){return y1.raceWith}}),_1=Iy,Object.defineProperty(T,"reduce",{enumerable:!0,get:function(){return _1.reduce}}),v1=H0,Object.defineProperty(T,"repeat",{enumerable:!0,get:function(){return v1.repeat}}),m1=X0,Object.defineProperty(T,"repeatWhen",{enumerable:!0,get:function(){return m1.repeatWhen}}),g1=rg,Object.defineProperty(T,"retry",{enumerable:!0,get:function(){return g1.retry}}),O1=sg,Object.defineProperty(T,"retryWhen",{enumerable:!0,get:function(){return O1.retryWhen}}),w1=Gt,Object.defineProperty(T,"refCount",{enumerable:!0,get:function(){return w1.refCount}}),E1=dg,Object.defineProperty(T,"sample",{enumerable:!0,get:function(){return E1.sample}}),P1=vg,Object.defineProperty(T,"sampleTime",{enumerable:!0,get:function(){return P1.sampleTime}}),T1=wg,Object.defineProperty(T,"scan",{enumerable:!0,get:function(){return T1.scan}}),S1=Ry,Object.defineProperty(T,"sequenceEqual",{enumerable:!0,get:function(){return S1.sequenceEqual}}),j1=Ig,Object.defineProperty(T,"share",{enumerable:!0,get:function(){return j1.share}}),C1=Ug,Object.defineProperty(T,"shareReplay",{enumerable:!0,get:function(){return C1.shareReplay}}),I1=Bg,Object.defineProperty(T,"single",{enumerable:!0,get:function(){return I1.single}}),R1=Gg,Object.defineProperty(T,"skip",{enumerable:!0,get:function(){return R1.skip}}),A1=Kg,Object.defineProperty(T,"skipLast",{enumerable:!0,get:function(){return A1.skipLast}}),M1=Jg,Object.defineProperty(T,"skipUntil",{enumerable:!0,get:function(){return M1.skipUntil}}),N1=nO,Object.defineProperty(T,"skipWhile",{enumerable:!0,get:function(){return N1.skipWhile}}),k1=uO,Object.defineProperty(T,"startWith",{enumerable:!0,get:function(){return k1.startWith}}),x1=Yf,Object.defineProperty(T,"subscribeOn",{enumerable:!0,get:function(){return x1.subscribeOn}}),D1=lO,Object.defineProperty(T,"switchAll",{enumerable:!0,get:function(){return D1.switchAll}}),U1=fO,Object.defineProperty(T,"switchMap",{enumerable:!0,get:function(){return U1.switchMap}}),L1=_O,Object.defineProperty(T,"switchMapTo",{enumerable:!0,get:function(){return L1.switchMapTo}}),F1=gO,Object.defineProperty(T,"switchScan",{enumerable:!0,get:function(){return F1.switchScan}}),B1=q_,Object.defineProperty(T,"take",{enumerable:!0,get:function(){return B1.take}}),V1=Sm,Object.defineProperty(T,"takeLast",{enumerable:!0,get:function(){return V1.takeLast}}),q1=EO,Object.defineProperty(T,"takeUntil",{enumerable:!0,get:function(){return q1.takeUntil}}),W1=CO,Object.defineProperty(T,"takeWhile",{enumerable:!0,get:function(){return W1.takeWhile}}),z1=AO,Object.defineProperty(T,"tap",{enumerable:!0,get:function(){return z1.tap}}),H1=_,Object.defineProperty(T,"throttle",{enumerable:!0,get:function(){return H1.throttle}}),G1=FO,Object.defineProperty(T,"throttleTime",{enumerable:!0,get:function(){return G1.throttleTime}}),Y1=Pv,Object.defineProperty(T,"throwIfEmpty",{enumerable:!0,get:function(){return Y1.throwIfEmpty}}),K1=WO,Object.defineProperty(T,"timeInterval",{enumerable:!0,get:function(){return K1.timeInterval}}),Z1=_f,Object.defineProperty(T,"timeout",{enumerable:!0,get:function(){return Z1.timeout}}),Q1=KO,Object.defineProperty(T,"timeoutWith",{enumerable:!0,get:function(){return Q1.timeoutWith}}),X1=rp,Object.defineProperty(T,"timestamp",{enumerable:!0,get:function(){return X1.timestamp}}),J1=Cy,Object.defineProperty(T,"toArray",{enumerable:!0,get:function(){return J1.toArray}}),$1=Rt,Object.defineProperty(T,"window",{enumerable:!0,get:function(){return $1.window}}),ej=iw,Object.defineProperty(T,"windowCount",{enumerable:!0,get:function(){return ej.windowCount}}),tj=lw,Object.defineProperty(T,"windowTime",{enumerable:!0,get:function(){return tj.windowTime}}),rj=Wf,Object.defineProperty(T,"windowToggle",{enumerable:!0,get:function(){return rj.windowToggle}}),nj=E,Object.defineProperty(T,"windowWhen",{enumerable:!0,get:function(){return nj.windowWhen}}),oj=Aw,Object.defineProperty(T,"withLatestFrom",{enumerable:!0,get:function(){return oj.withLatestFrom}}),ij=p,Object.defineProperty(T,"zip",{enumerable:!0,get:function(){return ij.zip}}),uj=b,Object.defineProperty(T,"zipAll",{enumerable:!0,get:function(){return uj.zipAll}}),aj=C,Object.defineProperty(T,"zipWith",{enumerable:!0,get:function(){return aj.zipWith}});var S={},pj=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},dj=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))s.label=t[1];else if(6===t[0]&&s.label<a[1])s.label=a[1],a=t;else{if(!(a&&s.label<a[2])){a[2]&&s.ops.pop(),s.trys.pop();continue}s.label=a[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},hj=(Object.defineProperty(S,"__esModule",{value:!0}),e),bj=bo,yj=w,_j=0,vj=1,mj=2;function gj(e,t){e=e.pipe((0,yj.publishReplay)(1),(0,yj.refCount)());this._result=e,this._keys=e.pipe((0,yj.mergeMap)(function(e){return(0,bj.from)(e.keys())}),(0,yj.publishReplay)(1),(0,yj.refCount)()),this._records=void 0,this._controls=new Oj,this._summary=new bj.ReplaySubject,this._state=t||_j}gj.prototype.keys=function(){return this._keys},gj.prototype.records=function(){var r=this,e=this._result.pipe((0,yj.mergeMap)(function(t){return new bj.Observable(function(e){return r._startStreaming({result:t,recordsObserver:e})})}));return e.push=function(){return r._push()},e},gj.prototype.consume=function(){var r=this;return this._result.pipe((0,yj.mergeMap)(function(t){return new bj.Observable(function(e){return r._startStreaming({result:t,summaryObserver:e})})}))},gj.prototype.pause=function(){this._controls.pause()},gj.prototype.resume=function(){return this._controls.resume()},gj.prototype.push=function(){return this._controls.push()},gj.prototype._startStreaming=function(e){var e=void 0===e?{}:e,t=e.result,r=e.recordsObserver,r=void 0===r?null:r,e=e.summaryObserver,e=void 0===e?null:e,n=[];return e&&n.push(this._summary.subscribe(e)),this._state<vj?(this._state=vj,this._setupRecordsStream(t),r?n.push(this._records.subscribe(r)):t._cancel(),n.push({unsubscribe:function(){t._cancel&&t._cancel()}})):r&&r.error((0,hj.newError)("Streaming has already started/consumed with a previous records or summary subscription.")),function(){n.forEach(function(e){return e.unsubscribe()})}},gj.prototype._toObservable=function(){var n=this;return new bj.Observable(function(r){n._result.subscribe({complete:function(){return r.complete()},next:function(e){return r.next(new gj((t=e,new bj.Observable(function(e){e.next(t),e.complete()}))),n._state);var t},error:function(e){return r.error(e)}})})},gj.prototype._setupRecordsStream=function(n){var t=this;return this._records||(this._records=function(o,i,u){var e=this;void 0===u&&(u=new Oj);var a=new bj.Subject,s=function(n){return pj(e,void 0,void 0,function(){var t,r;return dj(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,3,4]),u.pushing=!0,[4,n];case 1:return t=e.sent(),r=t.done,t=t.value,r?(a.complete(),i.complete()):(a.next(t),u.paused||s(o.next()).catch(function(){})),[3,4];case 2:return r=e.sent(),a.error(r),i.error(r),[3,4];case 3:return u.pushing=!1,[7];case 4:return[2]}})})};function t(t){return pj(this,void 0,void 0,function(){return dj(this,function(e){switch(e.label){case 0:return[4,s(o.next(t))];case 1:return e.sent(),[2]}})})}return(u.pusher=t)(),a}(n[Symbol.asyncIterator](),{complete:function(){return pj(t,void 0,void 0,function(){var t,r;return dj(this,function(e){switch(e.label){case 0:return this._state=mj,r=(t=this._summary).next,[4,n.summary()];case 1:return r.apply(t,[e.sent()]),this._summary.complete(),[2]}})})},error:function(e){t._state=mj,t._summary.error(e)}},this._controls)),this._records},S.default=gj;wj.prototype.pause=function(){this._paused=!0},Object.defineProperty(wj.prototype,"paused",{get:function(){return this._paused},enumerable:!1,configurable:!0}),Object.defineProperty(wj.prototype,"pushing",{get:function(){return this._pushing},set:function(e){this._pushing=e},enumerable:!1,configurable:!0}),wj.prototype.resume=function(){return pj(this,void 0,void 0,function(){var t;return dj(this,function(e){switch(e.label){case 0:return t=this._paused,this._paused=!1,!t||this._pushing?[3,2]:[4,this._push()];case 1:e.sent(),e.label=2;case 2:return[2]}})})},wj.prototype.push=function(){return pj(this,void 0,void 0,function(){return dj(this,function(e){switch(e.label){case 0:return this.pause(),[4,this._push()];case 1:return[2,e.sent()]}})})},Object.defineProperty(wj.prototype,"pusher",{get:function(){return this._push},set:function(e){this._push=e},enumerable:!1,configurable:!0});var Oj=wj;function wj(e){void 0===e&&(e=function(){return pj(t,void 0,void 0,function(){return dj(this,function(e){return[2]})})});var t=this;this._paused=!1,this._pushing=!1,this._push=e}var pe={},P=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Ej=(Object.defineProperty(pe,"__esModule",{value:!0}),bo),Pj=P(S);function Tj(e){this._txc=e}P(e),Tj.prototype.run=function(e,r){var n=this;return new Pj.default(new Ej.Observable(function(t){try{t.next(n._txc.run(e,r)),t.complete()}catch(e){t.error(e)}return function(){}}))},Tj.prototype.commit=function(){var e=this;return new Ej.Observable(function(t){e._txc.commit().then(function(){t.complete()}).catch(function(e){return t.error(e)})})},Tj.prototype.rollback=function(){var e=this;return new Ej.Observable(function(t){e._txc.rollback().then(function(){t.complete()}).catch(function(e){return t.error(e)})})},Tj.prototype.isOpen=function(){return this._txc.isOpen()},Tj.prototype.close=function(){var e=this;return new Ej.Observable(function(t){e._txc.close().then(function(){t.complete()}).catch(function(e){return t.error(e)})})},pe.default=Tj;G={},Ar=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};function Sj(e){e=e.run;this._run=e}Object.defineProperty(G,"__esModule",{value:!0}),Ar(S),Ar(pe),Sj.fromTransaction=function(e){return new Sj({run:e.run.bind(e)})},Sj.prototype.run=function(e,t){return this._run(e,t)},G.default=Sj;var so={},jj=(Object.defineProperty(so,"__esModule",{value:!0}),e),Cj=bo,Ij=w,Rj=(jj.internal.logger.Logger,jj.error.SERVICE_UNAVAILABLE);function Aj(e){var e=void 0===e?{}:e,t=e.maxRetryTimeout,r=e.initialDelay,r=void 0===r?1e3:r,n=e.delayMultiplier,n=void 0===n?2:n,o=e.delayJitter,o=void 0===o?.2:o,e=e.logger,e=void 0===e?null:e;this._maxRetryTimeout=Mj(void 0===t?3e4:t,3e4),this._initialDelay=Mj(r,1e3),this._delayMultiplier=Mj(n,2),this._delayJitter=Mj(o,.2),this._logger=e}function Mj(e,t){return e||0===e?e:t}Aj.prototype.retry=function(e){var a=this;return e.pipe((0,Ij.retryWhen)(function(e){var n=[],o=Date.now(),i=1,u=a._initialDelay;return e.pipe((0,Ij.mergeMap)(function(e){var t,r;return(0,jj.isRetryableError)(e)?(n.push(e),2<=i&&Date.now()-o>=a._maxRetryTimeout?((t=(0,jj.newError)("Failed after retried for ".concat(i," times in ").concat(a._maxRetryTimeout," ms. Make sure that your database is online and retry again."),Rj)).seenErrors=n,(0,Cj.throwError)(function(){return t})):(r=a._computeNextDelay(u),u*=a._delayMultiplier,i++,a._logger&&a._logger.warn("Transaction failed and will be retried in ".concat(r)),(0,Cj.of)(1).pipe((0,Ij.delay)(r)))):(0,Cj.throwError)(function(){return e})}))}))},Aj.prototype._computeNextDelay=function(e){var t=e*this._delayJitter;return e-t+2*t*Math.random()},so.default=Aj;var ro=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Nj=(Object.defineProperty(bn,"__esModule",{value:!0}),bo),kj=w,xj=ro(S),Uo=e,Dj=ro(pe),Uj=ro(G),Lj=ro(so),m=Uo.internal.constants,Fj=m.ACCESS_MODE_READ,Bj=m.ACCESS_MODE_WRITE,Vj=m.TELEMETRY_APIS,qj=Uo.internal.txConfig.TxConfig;function Wj(e){var e=void 0===e?{}:e,t=e.session,r=e.config,e=e.log;this._session=t,this._retryLogic=(e=>(e=e&&e.maxTransactionRetryTime?e.maxTransactionRetryTime:null,new Lj.default({maxRetryTimeout:e})))(r),this._log=e}Wj.prototype.run=function(e,r,n){var o=this;return new xj.default(new Nj.Observable(function(t){try{t.next(o._session.run(e,r,n)),t.complete()}catch(e){t.error(e)}return function(){}}))},Wj.prototype.beginTransaction=function(e){return this._beginTransaction(this._session._mode,e,{api:Vj.UNMANAGED_TRANSACTION})},Wj.prototype.executeRead=function(e,t){return this._executeInTransaction(Fj,e,t)},Wj.prototype.executeWrite=function(e,t){return this._executeInTransaction(Bj,e,t)},Wj.prototype._executeInTransaction=function(e,t,r){return this._runTransaction(e,t,r,function(e){return new Uj.default({run:e.run.bind(e)})})},Wj.prototype.close=function(){var e=this;return new Nj.Observable(function(t){e._session.close().then(function(){t.complete()}).catch(function(e){return t.error(e)})})},Wj.prototype[Symbol.asyncDispose]=function(){return this.close()},Wj.prototype.lastBookmarks=function(){return this._session.lastBookmarks()},Wj.prototype._beginTransaction=function(e,t,r){var n=this,o=qj.empty();return t&&(o=new qj(t,this._log)),new Nj.Observable(function(t){try{n._session._beginTransaction(e,o,r).then(function(e){t.next(new Dj.default(e)),t.complete()}).catch(function(e){return t.error(e)})}catch(e){t.error(e)}return function(){}})},Wj.prototype._runTransaction=function(e,r,t,n){var o=this,i=(void 0===n&&(n=function(e){return e}),qj.empty()),u=(t&&(i=new qj(t)),{apiTelemetryConfig:{api:Vj.MANAGED_TRANSACTION,onTelemetrySuccess:function(){u.apiTelemetryConfig=void 0}}});return this._retryLogic.retry((0,Nj.of)(1).pipe((0,kj.mergeMap)(function(){return o._beginTransaction(e,i,u.apiTelemetryConfig)}),(0,kj.mergeMap)(function(t){return(0,Nj.defer)(function(){try{return r(n(t))}catch(e){return(0,Nj.throwError)(function(){return e})}}).pipe((0,kj.catchError)(function(e){return t.rollback().pipe((0,kj.concatWith)((0,Nj.throwError)(function(){return e})))}),(0,kj.concatWith)(t.commit()))})))},bn.default=Wj;var zj,Hj,ao=r&&r.__extends||(zj=function(e,t){return(zj=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}zj(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Zn=(Object.defineProperty(L,"__esModule",{value:!0}),L.WRITE=L.READ=L.Driver=void 0,e),Gj=o(bn),Yj=Zn.internal.constants.FETCH_ALL,y=Zn.driver.READ,Kj=Zn.driver.WRITE,i=(L.READ=y,L.WRITE=Kj,ao(Zj,Hj=Zn.Driver),Zj.prototype.rxSession=function(e){var e=void 0===e?{}:e,t=e.defaultAccessMode,r=e.database,n=e.bookmarkManager,o=e.notificationFilter,i=e.disableAutoCommitRetries;return new Gj.default({session:this._newSession({defaultAccessMode:void 0===t?Kj:t,bookmarkOrBookmarks:e.bookmarks,database:void 0===r?"":r,impersonatedUser:e.impersonatedUser,auth:e.auth,reactive:!1,fetchSize:((e,t)=>{if(0<(e=parseInt(e,10))||e===Yj)return e;if(0===e||e<0)throw new Error("The fetch size can only be a positive value or ".concat(Yj," for ALL. However fetchSize = ").concat(e));return t})(e.fetchSize,this._config.fetchSize),bookmarkManager:n,notificationFilter:o,log:this._log,disableAutoCommitRetries:i}),config:this._config,log:this._log})},Zj);function Zj(){return null!==Hj&&Hj.apply(this,arguments)||this}L.Driver=i,L.default=i;fe={},Object.defineProperty(fe,"__esModule",{value:!0}),fe.default="6.2.0",u={},df={},uf={};function Qj(){}Object.defineProperty(uf,"__esModule",{value:!0}),Qj.prototype.selectReader=function(e){throw new Error("Abstract function")},Qj.prototype.selectWriter=function(e){throw new Error("Abstract function")},uf.default=Qj;cf={},ff={};function Xj(e){this._offset=e||0}Object.defineProperty(ff,"__esModule",{value:!0}),Xj.prototype.next=function(e){var t;return 0===e?-1:(t=this._offset,this._offset+=1,this._offset===Number.MAX_SAFE_INTEGER&&(this._offset=0),t%e)},ff.default=Xj;var Jj,$j,nf=r&&r.__extends||(Jj=function(e,t){return(Jj=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Jj(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),fp=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},eC=(Object.defineProperty(cf,"__esModule",{value:!0}),fp(ff)),v=fp(uf),Jf=($j=v.default,nf(tC,$j),tC.prototype.selectReader=function(e){return this._select(e,this._readersIndex)},tC.prototype.selectWriter=function(e){return this._select(e,this._writersIndex)},tC.prototype._select=function(e,t){var r=e.length;if(0===r)return null;var n=t.next(r),o=n,i=null,u=Number.MAX_SAFE_INTEGER;do{var a=e[o],s=this._connectionPool.activeResourceCount(a)}while(s<u&&(i=a,u=s),o===r-1?o=0:o++,o!==n);return i},tC);function tC(e){var t=$j.call(this)||this;return t._readersIndex=new eC.default,t._writersIndex=new eC.default,t._connectionPool=e,t}cf.default=Jf;g=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(df,"__esModule",{value:!0}),df.LeastConnectedLoadBalancingStrategy=df.LoadBalancingStrategy=void 0,pf=g(uf),df.LoadBalancingStrategy=pf.default,bd=g(cf),df.LeastConnectedLoadBalancingStrategy=bd.default,df.default=bd.default,F={},kd={},$d={},eh={},ah={},$l={},_d={},wd={byteLength:function(e){var e=sC(e),t=e[0],e=e[1];return 3*(t+e)/4-e}};wd.toByteArray=function(e){var t,r,n=sC(e),o=n[0],n=n[1],i=new oC(((e,t)=>3*(e+t)/4-t)(o,n)),u=0,a=0<n?o-4:o;for(r=0;r<a;r+=4)t=nC[e.charCodeAt(r)]<<18|nC[e.charCodeAt(r+1)]<<12|nC[e.charCodeAt(r+2)]<<6|nC[e.charCodeAt(r+3)],i[u++]=t>>16&255,i[u++]=t>>8&255,i[u++]=255&t;2===n&&(t=nC[e.charCodeAt(r)]<<2|nC[e.charCodeAt(r+1)]>>4,i[u++]=255&t);1===n&&(t=nC[e.charCodeAt(r)]<<10|nC[e.charCodeAt(r+1)]<<4|nC[e.charCodeAt(r+2)]>>2,i[u++]=t>>8&255,i[u++]=255&t);return i},wd.fromByteArray=function(e){for(var t,r=e.length,n=r%3,o=[],i=0,u=r-n;i<u;i+=16383)o.push(((e,t,r)=>{for(var n,o=[],i=t;i<r;i+=3)n=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push((e=>rC[e>>18&63]+rC[e>>12&63]+rC[e>>6&63]+rC[63&e])(n));return o.join("")})(e,i,u<i+16383?u:i+16383));1==n?(t=e[r-1],o.push(rC[t>>2]+rC[t<<4&63]+"==")):2==n&&(t=(e[r-2]<<8)+e[r-1],o.push(rC[t>>10]+rC[t>>4&63]+rC[t<<2&63]+"="));return o.join("")};for(var rC=[],nC=[],oC="undefined"!=typeof Uint8Array?Uint8Array:Array,iC="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",uC=0,aC=iC.length;uC<aC;++uC)rC[uC]=iC[uC],nC[iC.charCodeAt(uC)]=uC;function sC(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");e=e.indexOf("="),t=(e=-1===e?t:e)===t?0:4-e%4;return[e,t]}nC["-".charCodeAt(0)]=62,nC["_".charCodeAt(0)]=63;rf={read:function(e,t,r,n,o){var i,u,a=8*o-n-1,s=(1<<a)-1,c=s>>1,l=-7,f=r?o-1:0,p=r?-1:1,o=e[t+f];for(f+=p,i=o&(1<<-l)-1,o>>=-l,l+=a;0<l;i=256*i+e[t+f],f+=p,l-=8);for(u=i&(1<<-l)-1,i>>=-l,l+=n;0<l;u=256*u+e[t+f],f+=p,l-=8);if(0===i)i=1-c;else{if(i===s)return u?NaN:1/0*(o?-1:1);u+=Math.pow(2,n),i-=c}return(o?-1:1)*u*Math.pow(2,i-n)},write:function(e,t,r,n,o,i){var u,a,s=8*i-o-1,c=(1<<s)-1,l=c>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,d=n?1:-1,i=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,u=c):(u=Math.floor(Math.log(t)/Math.LN2),t*(n=Math.pow(2,-u))<1&&(u--,n*=2),2<=(t+=1<=u+l?f/n:f*Math.pow(2,1-l))*n&&(u++,n/=2),c<=u+l?(a=0,u=c):1<=u+l?(a=(t*n-1)*Math.pow(2,o),u+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,o),u=0));8<=o;e[r+p]=255&a,p+=d,a/=256,o-=8);for(u=u<<o|a,s+=o;0<s;e[r+p]=255&u,p+=d,u/=256,s-=8);e[r+p-d]|=128*i}};{var cC=_d;let b=wd,i=rf,t=(op="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null,cC.Buffer=M,cC.SlowBuffer=function(e){+e!=e&&(e=0);return M.alloc(+e)},cC.INSPECT_MAX_BYTES=50,2147483647);function lC(e){if(e>t)throw new RangeError('The value "'+e+'" is invalid for option "size"');e=new Uint8Array(e);return Object.setPrototypeOf(e,M.prototype),e}function M(e,t,r){if("number"!=typeof e)return fC(e,t,r);if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return dC(e)}function fC(n,o,e){if("string"==typeof n){var i=n;var u=o;if(!M.isEncoding(u="string"==typeof u&&""!==u?u:"utf8"))throw new TypeError("Unknown encoding: "+u);let e=0|_C(i,u),t=lC(e),r=t.write(i,u);return t=r!==e?t.slice(0,r):t}if(ArrayBuffer.isView(n))return BC(i=n,Uint8Array)?bC((u=new Uint8Array(i)).buffer,u.byteOffset,u.byteLength):hC(i);if(null!=n){if(BC(n,ArrayBuffer)||n&&BC(n.buffer,ArrayBuffer))return bC(n,o,e);if("undefined"!=typeof SharedArrayBuffer&&(BC(n,SharedArrayBuffer)||n&&BC(n.buffer,SharedArrayBuffer)))return bC(n,o,e);if("number"==typeof n)throw new TypeError('The "value" argument must not be of type number. Received type number');var t=n.valueOf&&n.valueOf();if(null!=t&&t!==n)return M.from(t,o,e);t=(e=>{var t,r;return M.isBuffer(e)?(t=0|yC(e.length),0!==(r=lC(t)).length&&e.copy(r,0,0,t),r):void 0!==e.length?"number"!=typeof e.length||VC(e.length)?lC(0):hC(e):"Buffer"===e.type&&Array.isArray(e.data)?hC(e.data):void 0})(n);if(t)return t;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof n[Symbol.toPrimitive])return M.from(n[Symbol.toPrimitive]("string"),o,e)}throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof n)}function pC(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function dC(e){return pC(e),lC(e<0?0:0|yC(e))}function hC(t){var r=t.length<0?0:0|yC(t.length),n=lC(r);for(let e=0;e<r;e+=1)n[e]=255&t[e];return n}function bC(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,M.prototype),n}function yC(e){if(e>=t)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+t.toString(16)+" bytes");return 0|e}function _C(e,t){if(M.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||BC(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=2<arguments.length&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return UC(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return LC(e).length;default:if(o)return n?-1:UC(e).length;t=(""+t).toLowerCase(),o=!0}}function vC(e,n,o){let t=!1;if((n=void 0===n||n<0?0:n)>this.length)return"";if((o=void 0===o||o>this.length?this.length:o)<=0)return"";if((o>>>=0)<=(n>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":{var r=this;var i=n;var u=o;var a=r.length;(!u||u<0||a<u)&&(u=a);let t="";for(let e=i=!i||i<0?0:i;e<u;++e)t+=y[r[e]];return t;return}case"utf8":case"utf-8":return PC(this,n,o);case"ascii":{var s=this;a=n;var c=o;let t="";c=Math.min(s.length,c);for(let e=a;e<c;++e)t+=String.fromCharCode(127&s[e]);return t;return}case"latin1":case"binary":{var l=this;i=n;var f=o;let t="";f=Math.min(l.length,f);for(let e=i;e<f;++e)t+=String.fromCharCode(l[e]);return t;return}case"base64":return p=this,h=o,0===(d=n)&&h===p.length?b.fromByteArray(p):b.fromByteArray(p.slice(d,h));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":{p=this;d=n;h=o;let t=p.slice(d,h),r="";for(let e=0;e<t.length-1;e+=2)r+=String.fromCharCode(t[e]+256*t[e+1]);return r;return}default:if(t)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),t=!0}var p,d,h}function mC(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function gC(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):2147483647<r?r=2147483647:r<-2147483648&&(r=-2147483648),(r=VC(r=+r)?o?0:e.length-1:r)<0&&(r=e.length+r),e.length<=r){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=M.from(t,n)),M.isBuffer(t))return 0===t.length?-1:OC(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?(o?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,t,r):OC(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function OC(r,n,t,e,o){let i=1,u=r.length,a=n.length;if(void 0!==e&&("ucs2"===(e=String(e).toLowerCase())||"ucs-2"===e||"utf16le"===e||"utf-16le"===e)){if(r.length<2||n.length<2)return-1;i=2,u/=2,a/=2,t/=2}function s(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}let c;if(o){let e=-1;for(c=t;c<u;c++)if(s(r,c)===s(n,-1===e?0:c-e)){if(-1===e&&(e=c),c-e+1===a)return e*i}else-1!==e&&(c-=c-e),e=-1}else for(t+a>u&&(t=u-a),c=t;0<=c;c--){let t=!0;for(let e=0;e<a;e++)if(s(r,c+e)!==s(n,e)){t=!1;break}if(t)return c}return-1}function wC(e,t,r,n){return FC((t=>{var r=[];for(let e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r})(t),e,r,n)}function EC(e,t,r,n){return FC(((t,r)=>{let n,o,i=[];for(let e=0;e<t.length&&!((r-=2)<0);++e)n=t.charCodeAt(e),o=n>>8,i.push(n%256),i.push(o);return i})(t,e.length-r),e,r,n)}function PC(u,e,t){t=Math.min(u.length,t);var r=[];let a=e;for(;a<t;){var s=u[a];let o=null,i=239<s?4:223<s?3:191<s?2:1;if(a+i<=t){let e,t,r,n;switch(i){case 1:s<128&&(o=s);break;case 2:128==(192&(e=u[a+1]))&&127<(n=(31&s)<<6|63&e)&&(o=n);break;case 3:e=u[a+1],t=u[a+2],128==(192&e)&&128==(192&t)&&2047<(n=(15&s)<<12|(63&e)<<6|63&t)&&(n<55296||57343<n)&&(o=n);break;case 4:e=u[a+1],t=u[a+2],r=u[a+3],128==(192&e)&&128==(192&t)&&128==(192&r)&&65535<(n=(15&s)<<18|(63&e)<<12|(63&t)<<6|63&r)&&n<1114112&&(o=n)}}null===o?(o=65533,i=1):65535<o&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),a+=i}{var n=r,o=n.length;if(o<=c)return String.fromCharCode.apply(String,n);let e="",t=0;for(;t<o;)e+=String.fromCharCode.apply(String,n.slice(t,t+=c));return e}}cC.kMaxLength=t,(M.TYPED_ARRAY_SUPPORT=(()=>{try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}})())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(M.prototype,"parent",{enumerable:!0,get:function(){if(M.isBuffer(this))return this.buffer}}),Object.defineProperty(M.prototype,"offset",{enumerable:!0,get:function(){if(M.isBuffer(this))return this.byteOffset}}),M.poolSize=8192,M.from=fC,Object.setPrototypeOf(M.prototype,Uint8Array.prototype),Object.setPrototypeOf(M,Uint8Array),M.alloc=function(e,t,r){return t=t,r=r,pC(e=e),!(e<=0)&&void 0!==t?"string"==typeof r?lC(e).fill(t,r):lC(e).fill(t):lC(e)},M.allocUnsafe=dC,M.allocUnsafeSlow=dC,M.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==M.prototype},M.compare=function(r,n){if(BC(r,Uint8Array)&&(r=M.from(r,r.offset,r.byteLength)),BC(n,Uint8Array)&&(n=M.from(n,n.offset,n.byteLength)),!M.isBuffer(r)||!M.isBuffer(n))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===n)return 0;let o=r.length,i=n.length;for(let e=0,t=Math.min(o,i);e<t;++e)if(r[e]!==n[e]){o=r[e],i=n[e];break}return o<i?-1:i<o?1:0},M.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},M.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return M.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=M.allocUnsafe(e);let o=0;for(r=0;r<t.length;++r){let e=t[r];if(BC(e,Uint8Array))o+e.length>n.length?(e=M.isBuffer(e)?e:M.from(e)).copy(n,o):Uint8Array.prototype.set.call(n,e,o);else{if(!M.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,o)}o+=e.length}return n},M.byteLength=_C,M.prototype._isBuffer=!0,M.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)mC(this,e,e+1);return this},M.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)mC(this,e,e+3),mC(this,e+1,e+2);return this},M.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)mC(this,e,e+7),mC(this,e+1,e+6),mC(this,e+2,e+5),mC(this,e+3,e+4);return this},M.prototype.toLocaleString=M.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?PC(this,0,e):vC.apply(this,arguments)},M.prototype.equals=function(e){if(M.isBuffer(e))return this===e||0===M.compare(this,e);throw new TypeError("Argument must be a Buffer")},M.prototype.inspect=function(){let e="";var t=cC.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},op&&(M.prototype[op]=M.prototype.inspect),M.prototype.compare=function(e,t,r,n,o){if(BC(e,Uint8Array)&&(e=M.from(e,e.offset,e.byteLength)),!M.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),(t=void 0===t?0:t)<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(o<=n&&r<=t)return 0;if(o<=n)return-1;if(r<=t)return 1;if(this===e)return 0;let i=(o>>>=0)-(n>>>=0),u=(r>>>=0)-(t>>>=0);var a=Math.min(i,u),s=this.slice(n,o),c=e.slice(t,r);for(let e=0;e<a;++e)if(s[e]!==c[e]){i=s[e],u=c[e];break}return i<u?-1:u<i?1:0},M.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},M.prototype.indexOf=function(e,t,r){return gC(this,e,t,r,!0)},M.prototype.lastIndexOf=function(e,t,r){return gC(this,e,t,r,!1)},M.prototype.write=function(t,r,n,e){if(void 0===r)e="utf8",n=this.length,r=0;else if(void 0===n&&"string"==typeof r)e=r,n=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r>>>=0,isFinite(n)?(n>>>=0,void 0===e&&(e="utf8")):(e=n,n=void 0)}var o,i,u,a=this.length-r;if((void 0===n||a<n)&&(n=a),0<t.length&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");e=e||"utf8";let s=!1;for(;;)switch(e){case"hex":{var c=this;var l=t;var f=r;var p=n;f=Number(f)||0;var d=c.length-f;(!p||d<(p=Number(p)))&&(p=d),(d=l.length)/2<p&&(p=d/2);let e;for(e=0;e<p;++e){var h=parseInt(l.substr(2*e,2),16);if(VC(h))return e;c[f+e]=h}return e;return}case"utf8":case"utf-8":return d=r,u=n,FC(UC(t,(i=this).length-d),i,d,u);case"ascii":case"latin1":case"binary":return wC(this,t,r,n);case"base64":return i=this,u=r,o=n,FC(LC(t),i,u,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return EC(this,t,r,n);default:if(s)throw new TypeError("Unknown encoding: "+e);e=(""+e).toLowerCase(),s=!0}},M.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};let c=4096;function TC(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(r<e+t)throw new RangeError("Trying to access beyond buffer length")}function SC(e,t,r,n,o,i){if(!M.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(o<t||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function jC(e,t,r,n,o){kC(t,n,o,e,r,7);n=Number(t&BigInt(4294967295)),e[r++]=n,e[r++]=n>>=8,e[r++]=n>>=8,e[r++]=n>>=8,o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=o,e[r++]=o>>=8,e[r++]=o>>=8,e[r++]=o>>=8,r}function CC(e,t,r,n,o){kC(t,n,o,e,r,7);n=Number(t&BigInt(4294967295)),e[r+7]=n,e[r+6]=n>>=8,e[r+5]=n>>=8,e[r+4]=n>>=8,o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=o,e[r+2]=o>>=8,e[r+1]=o>>=8,e[r]=o>>=8,r+8}function IC(e,t,r,n){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function RC(e,t,r,n,o){return t=+t,r>>>=0,o||IC(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function AC(e,t,r,n,o){return t=+t,r>>>=0,o||IC(e,0,r,8),i.write(e,t,r,n,52,8),r+8}M.prototype.slice=function(e,t){var r=this.length,r=((e=~~e)<0?(e+=r)<0&&(e=0):r<e&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):r<t&&(t=r),t<e&&(t=e),this.subarray(e,t));return Object.setPrototypeOf(r,M.prototype),r},M.prototype.readUintLE=M.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||TC(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return n},M.prototype.readUintBE=M.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||TC(e,t,this.length);let n=this[e+--t],o=1;for(;0<t&&(o*=256);)n+=this[e+--t]*o;return n},M.prototype.readUint8=M.prototype.readUInt8=function(e,t){return e>>>=0,t||TC(e,1,this.length),this[e]},M.prototype.readUint16LE=M.prototype.readUInt16LE=function(e,t){return e>>>=0,t||TC(e,2,this.length),this[e]|this[e+1]<<8},M.prototype.readUint16BE=M.prototype.readUInt16BE=function(e,t){return e>>>=0,t||TC(e,2,this.length),this[e]<<8|this[e+1]},M.prototype.readUint32LE=M.prototype.readUInt32LE=function(e,t){return e>>>=0,t||TC(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},M.prototype.readUint32BE=M.prototype.readUInt32BE=function(e,t){return e>>>=0,t||TC(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},M.prototype.readBigUInt64LE=qC(function(e){xC(e>>>=0,"offset");var t=this[e],r=this[e+7],t=(void 0!==t&&void 0!==r||DC(e,this.length-8),t+256*this[++e]+65536*this[++e]+this[++e]*2**24),e=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(t)+(BigInt(e)<<BigInt(32))}),M.prototype.readBigUInt64BE=qC(function(e){xC(e>>>=0,"offset");var t=this[e],r=this[e+7],t=(void 0!==t&&void 0!==r||DC(e,this.length-8),t*2**24+65536*this[++e]+256*this[++e]+this[++e]),e=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(t)<<BigInt(32))+BigInt(e)}),M.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||TC(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n},M.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||TC(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;0<n&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},M.prototype.readInt8=function(e,t){return e>>>=0,t||TC(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},M.prototype.readInt16LE=function(e,t){e>>>=0,t||TC(e,2,this.length);t=this[e]|this[e+1]<<8;return 32768&t?4294901760|t:t},M.prototype.readInt16BE=function(e,t){e>>>=0,t||TC(e,2,this.length);t=this[e+1]|this[e]<<8;return 32768&t?4294901760|t:t},M.prototype.readInt32LE=function(e,t){return e>>>=0,t||TC(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},M.prototype.readInt32BE=function(e,t){return e>>>=0,t||TC(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},M.prototype.readBigInt64LE=qC(function(e){xC(e>>>=0,"offset");var t=this[e],r=this[e+7],r=(void 0!==t&&void 0!==r||DC(e,this.length-8),this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24));return(BigInt(r)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),M.prototype.readBigInt64BE=qC(function(e){xC(e>>>=0,"offset");var t=this[e],r=this[e+7],t=(void 0!==t&&void 0!==r||DC(e,this.length-8),(t<<24)+65536*this[++e]+256*this[++e]+this[++e]);return(BigInt(t)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)}),M.prototype.readFloatLE=function(e,t){return e>>>=0,t||TC(e,4,this.length),i.read(this,e,!0,23,4)},M.prototype.readFloatBE=function(e,t){return e>>>=0,t||TC(e,4,this.length),i.read(this,e,!1,23,4)},M.prototype.readDoubleLE=function(e,t){return e>>>=0,t||TC(e,8,this.length),i.read(this,e,!0,52,8)},M.prototype.readDoubleBE=function(e,t){return e>>>=0,t||TC(e,8,this.length),i.read(this,e,!1,52,8)},M.prototype.writeUintLE=M.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||SC(this,e,t,r,Math.pow(2,8*r)-1,0);let o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},M.prototype.writeUintBE=M.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||SC(this,e,t,r,Math.pow(2,8*r)-1,0);let o=r-1,i=1;for(this[t+o]=255&e;0<=--o&&(i*=256);)this[t+o]=e/i&255;return t+r},M.prototype.writeUint8=M.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||SC(this,e,t,1,255,0),this[t]=255&e,t+1},M.prototype.writeUint16LE=M.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||SC(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},M.prototype.writeUint16BE=M.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||SC(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},M.prototype.writeUint32LE=M.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||SC(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},M.prototype.writeUint32BE=M.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||SC(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},M.prototype.writeBigUInt64LE=qC(function(e,t=0){return jC(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),M.prototype.writeBigUInt64BE=qC(function(e,t=0){return CC(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),M.prototype.writeIntLE=function(e,t,r,n){e=+e,t>>>=0,n||SC(this,e,t,r,(n=Math.pow(2,8*r-1))-1,-n);let o=0,i=1,u=0;for(this[t]=255&e;++o<r&&(i*=256);)e<0&&0===u&&0!==this[t+o-1]&&(u=1),this[t+o]=(e/i>>0)-u&255;return t+r},M.prototype.writeIntBE=function(e,t,r,n){e=+e,t>>>=0,n||SC(this,e,t,r,(n=Math.pow(2,8*r-1))-1,-n);let o=r-1,i=1,u=0;for(this[t+o]=255&e;0<=--o&&(i*=256);)e<0&&0===u&&0!==this[t+o+1]&&(u=1),this[t+o]=(e/i>>0)-u&255;return t+r},M.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||SC(this,e,t,1,127,-128),this[t]=255&(e=e<0?255+e+1:e),t+1},M.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||SC(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},M.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||SC(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},M.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||SC(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},M.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||SC(this,e,t,4,2147483647,-2147483648),this[t]=(e=e<0?4294967295+e+1:e)>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},M.prototype.writeBigInt64LE=qC(function(e,t=0){return jC(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),M.prototype.writeBigInt64BE=qC(function(e,t=0){return CC(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),M.prototype.writeFloatLE=function(e,t,r){return RC(this,e,t,!0,r)},M.prototype.writeFloatBE=function(e,t,r){return RC(this,e,t,!1,r)},M.prototype.writeDoubleLE=function(e,t,r){return AC(this,e,t,!0,r)},M.prototype.writeDoubleBE=function(e,t,r){return AC(this,e,t,!1,r)},M.prototype.copy=function(e,t,r,n){if(!M.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,n||0===n||(n=this.length),t>=e.length&&(t=e.length),(n=0<n&&n<r?r:n)===r)return 0;if(0===e.length||0===this.length)return 0;if((t=t||0)<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length);var o=(n=e.length-t<n-r?e.length-t+r:n)-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},M.prototype.fill=function(t,r,n,o){if("string"==typeof t){if("string"==typeof r?(o=r,r=0,n=this.length):"string"==typeof n&&(o=n,n=this.length),void 0!==o&&"string"!=typeof o)throw new TypeError("encoding must be a string");if("string"==typeof o&&!M.isEncoding(o))throw new TypeError("Unknown encoding: "+o);var e;1===t.length&&(e=t.charCodeAt(0),"utf8"===o&&e<128||"latin1"===o)&&(t=e)}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(!(n<=r)){r>>>=0,n=void 0===n?this.length:n>>>0;let e;if("number"==typeof(t=t||0))for(e=r;e<n;++e)this[e]=t;else{var i=M.isBuffer(t)?t:M.from(t,o),u=i.length;if(0===u)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(e=0;e<n-r;++e)this[e+r]=i[e%u]}}return this};let a={};function MC(e,t,r){a[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=this.name+` [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return this.name+` [${e}]: `+this.message}}}function NC(e){let t="",r=e.length;for(var n="-"===e[0]?1:0;r>=4+n;r-=3)t="_"+e.slice(r-3,r)+t;return""+e.slice(0,r)+t}function kC(t,r,n,e,o,i){if(n<t||t<r){var u="bigint"==typeof r?"n":"";let e;throw e=3<i?0===r||r===BigInt(0)?`>= 0${u} and < 2${u} ** `+8*(i+1)+u:`>= -(2${u} ** ${8*(i+1)-1}${u}) and < 2 ** `+(8*(i+1)-1)+u:`>= ${r}${u} and <= `+n+u,new a.ERR_OUT_OF_RANGE("value",e,t)}r=e,n=i,xC(u=o,"offset"),void 0!==r[u]&&void 0!==r[u+n]||DC(u,r.length-(n+1))}function xC(e,t){if("number"!=typeof e)throw new a.ERR_INVALID_ARG_TYPE(t,"number",e)}function DC(e,t,r){if(Math.floor(e)!==e)throw xC(e,r),new a.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new a.ERR_BUFFER_OUT_OF_BOUNDS;throw new a.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= `+t,e)}MC("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?e+" is outside of buffer bounds":"Attempt to access memory outside buffer bounds"},RangeError),MC("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type `+typeof t},TypeError),MC("ERR_OUT_OF_RANGE",function(e,t,r){e=`The value of "${e}" is out of range.`;let n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=NC(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=NC(n)),n+="n"),e+=` It must be ${t}. Received `+n},RangeError);let r=/[^+/0-9A-Za-z-_]/g;function UC(t,r){r=r||1/0;let n;var o=t.length;let i=null;var u=[];for(let e=0;e<o;++e){if(55295<(n=t.charCodeAt(e))&&n<57344){if(!i){if(56319<n){-1<(r-=3)&&u.push(239,191,189);continue}if(e+1===o){-1<(r-=3)&&u.push(239,191,189);continue}i=n;continue}if(n<56320){-1<(r-=3)&&u.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&-1<(r-=3)&&u.push(239,191,189);if(i=null,n<128){if(--r<0)break;u.push(n)}else if(n<2048){if((r-=2)<0)break;u.push(n>>6|192,63&n|128)}else if(n<65536){if((r-=3)<0)break;u.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;u.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return u}function LC(e){return b.toByteArray((e=>{if((e=(e=e.split("=")[0]).trim().replace(r,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e})(e))}function FC(e,t,r,n){let o;for(o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function BC(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function VC(e){return e!=e}let y=(()=>{var r="0123456789abcdef",n=new Array(256);for(let t=0;t<16;++t){var o=16*t;for(let e=0;e<16;++e)n[o+e]=r[t]+r[e]}return n})();function qC(e){return"undefined"==typeof BigInt?WC:e}function WC(){throw new Error("BigInt not supported")}}var zC,xh={},j={},O=r&&r.__extends||(zC=function(e,t){return(zC=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}zC(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Qh=(Object.defineProperty(j,"__esModule",{value:!0}),N.prototype.getUInt8=function(e){throw new Error("Not implemented")},N.prototype.getInt8=function(e){throw new Error("Not implemented")},N.prototype.getFloat64=function(e){throw new Error("Not implemented")},N.prototype.getVarInt=function(e){throw new Error("Not implemented")},N.prototype.putUInt8=function(e,t){throw new Error("Not implemented")},N.prototype.putInt8=function(e,t){throw new Error("Not implemented")},N.prototype.putFloat64=function(e,t){throw new Error("Not implemented")},N.prototype.getInt16=function(e){return this.getInt8(e)<<8|this.getUInt8(e+1)},N.prototype.getUInt16=function(e){return this.getUInt8(e)<<8|this.getUInt8(e+1)},N.prototype.getInt32=function(e){return this.getInt8(e)<<24|this.getUInt8(e+1)<<16|this.getUInt8(e+2)<<8|this.getUInt8(e+3)},N.prototype.getUInt32=function(e){return this.getUInt8(e)<<24|this.getUInt8(e+1)<<16|this.getUInt8(e+2)<<8|this.getUInt8(e+3)},N.prototype.getInt64=function(e){return this.getInt8(e)<<56|this.getUInt8(e+1)<<48|this.getUInt8(e+2)<<40|this.getUInt8(e+3)<<32|this.getUInt8(e+4)<<24|this.getUInt8(e+5)<<16|this.getUInt8(e+6)<<8|this.getUInt8(e+7)},N.prototype.getSlice=function(e,t){return new GC(e,t,this)},N.prototype.putInt16=function(e,t){this.putInt8(e,t>>8),this.putUInt8(e+1,255&t)},N.prototype.putUInt16=function(e,t){this.putUInt8(e,t>>8&255),this.putUInt8(e+1,255&t)},N.prototype.putInt32=function(e,t){this.putInt8(e,t>>24),this.putUInt8(e+1,t>>16&255),this.putUInt8(e+2,t>>8&255),this.putUInt8(e+3,255&t)},N.prototype.putUInt32=function(e,t){this.putUInt8(e,t>>24&255),this.putUInt8(e+1,t>>16&255),this.putUInt8(e+2,t>>8&255),this.putUInt8(e+3,255&t)},N.prototype.putInt64=function(e,t){this.putInt8(e,t>>48),this.putUInt8(e+1,t>>42&255),this.putUInt8(e+2,t>>36&255),this.putUInt8(e+3,t>>30&255),this.putUInt8(e+4,t>>24&255),this.putUInt8(e+5,t>>16&255),this.putUInt8(e+6,t>>8&255),this.putUInt8(e+7,255&t)},N.prototype.putVarInt=function(e,t){for(var r=0;1<t;){var n=t%128;128<=t&&(n+=128),t/=128,this.putUInt8(e+r,n),r+=1}return r},N.prototype.putBytes=function(e,t){for(var r=0,n=t.remaining();r<n;r++)this.putUInt8(e+r,t.readUInt8())},N.prototype.readUInt8=function(){return this.getUInt8(this._updatePos(1))},N.prototype.readInt8=function(){return this.getInt8(this._updatePos(1))},N.prototype.readUInt16=function(){return this.getUInt16(this._updatePos(2))},N.prototype.readUInt32=function(){return this.getUInt32(this._updatePos(4))},N.prototype.readInt16=function(){return this.getInt16(this._updatePos(2))},N.prototype.readInt32=function(){return this.getInt32(this._updatePos(4))},N.prototype.readInt64=function(){return this.getInt32(this._updatePos(8))},N.prototype.readFloat64=function(){return this.getFloat64(this._updatePos(8))},N.prototype.readVarInt=function(){var e=this.getVarInt(this.position);return this._updatePos(e.length),e.value},N.prototype.writeUInt8=function(e){this.putUInt8(this._updatePos(1),e)},N.prototype.writeInt8=function(e){this.putInt8(this._updatePos(1),e)},N.prototype.writeInt16=function(e){this.putInt16(this._updatePos(2),e)},N.prototype.writeInt32=function(e){this.putInt32(this._updatePos(4),e)},N.prototype.writeUInt32=function(e){this.putUInt32(this._updatePos(4),e)},N.prototype.writeInt64=function(e){this.putInt64(this._updatePos(8),e)},N.prototype.writeFloat64=function(e){this.putFloat64(this._updatePos(8),e)},N.prototype.writeVarInt=function(e){e=this.putVarInt(this.position,e);this._updatePos(e)},N.prototype.writeBytes=function(e){this.putBytes(this._updatePos(e.remaining()),e)},N.prototype.readSlice=function(e){return this.getSlice(this._updatePos(e),e)},N.prototype._updatePos=function(e){var t=this.position;return this.position+=e,t},N.prototype.remaining=function(){return this.length-this.position},N.prototype.hasRemaining=function(){return 0<this.remaining()},N.prototype.reset=function(){this.position=0},N.prototype.toString=function(){return this.constructor.name+"( position="+this.position+" )\n "+this.toHex()},N.prototype.toHex=function(){for(var e="",t=0;t<this.length;t++){var r=this.getUInt8(t).toString(16);e+=r=1===r.length?"0"+r:r,t!==this.length-1&&(e+=" ")}return e},N);function N(e){this.position=0,this.length=e}j.default=Qh;O(YC,HC=Qh),YC.prototype.putUInt8=function(e,t){this._inner.putUInt8(this._start+e,t)},YC.prototype.getUInt8=function(e){return this._inner.getUInt8(this._start+e)},YC.prototype.putInt8=function(e,t){this._inner.putInt8(this._start+e,t)},YC.prototype.putFloat64=function(e,t){this._inner.putFloat64(this._start+e,t)},YC.prototype.getInt8=function(e){return this._inner.getInt8(this._start+e)},YC.prototype.getFloat64=function(e){return this._inner.getFloat64(this._start+e)};var HC,GC=YC;function YC(e,t,r){t=HC.call(this,t)||this;return t._start=e,t._inner=r,t}var KC,ZC,ob=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},I=(Object.defineProperty(xh,"__esModule",{value:!0}),xh.BaseBuffer=void 0,ob(j)),db=(xh.BaseBuffer=I.default,xh.default=I.default,r&&r.__extends||(KC=function(e,t){return(KC=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}KC(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),mb=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},QC=(Object.defineProperty($l,"__esModule",{value:!0}),$l.alloc=function(e){return new XC(e)},mb(_d)),tf=mb(xh),XC=(ZC=tf.default,db(JC,ZC),JC.prototype.getUInt8=function(e){return this._buffer.readUInt8(e)},JC.prototype.getInt8=function(e){return this._buffer.readInt8(e)},JC.prototype.getFloat64=function(e){return this._buffer.readDoubleBE(e)},JC.prototype.getVarInt=function(e){for(var t=0,r=this._buffer.readInt8(e+t),n=r%128;1<=r/128;)n+=(r=this._buffer.readInt8(e+(t+=1)))%128;return{length:t+1,value:n}},JC.prototype.putUInt8=function(e,t){this._buffer.writeUInt8(t,e)},JC.prototype.putInt8=function(e,t){this._buffer.writeInt8(t,e)},JC.prototype.putFloat64=function(e,t){this._buffer.writeDoubleBE(t,e)},JC.prototype.putBytes=function(e,t){var r;t instanceof JC?(r=Math.min(t.length-t.position,this.length-e),t._buffer.copy(this._buffer,e,t.position,t.position+r),t.position+=r):ZC.prototype.putBytes.call(this,e,t)},JC.prototype.getSlice=function(e,t){return new JC(this._buffer.slice(e,e+t))},JC);function JC(e){var t=this,e=(e=e)instanceof QC.default.Buffer?e:"number"==typeof e&&"function"==typeof QC.default.Buffer.alloc?QC.default.Buffer.alloc(e):new QC.default.Buffer(e);return(t=ZC.call(this,e.length)||this)._buffer=e,t}$l.default=XC;var Dh=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},$C=(Object.defineProperty(ah,"__esModule",{value:!0}),Dh($l)),eI=e,wb=eI.internal.util,tI=wb.ENCRYPTION_OFF,rI=wb.ENCRYPTION_ON;function nI(e,t,r){void 0===t&&(t=oI),void 0===r&&(r=function(e){return new WebSocket(e)});var n,o=this,t=(this._open=!0,this._pending=[],this._error=null,this._handleConnectionError=this._handleConnectionError.bind(this),this._config=e,this._receiveTimeout=null,this._receiveTimeoutStarted=!1,this._receiveTimeoutId=null,this._closingPromise=null,((e,t)=>{var r=(e=>!0===e.encrypted||e.encrypted===rI)(e),n=(e=>!1===e.encrypted||e.encrypted===tI)(e),e=e.trust,t=(e=>(e="function"==typeof e?e():"")&&0<=e.toLowerCase().indexOf("https"))(t),o=r,i=n,u=t;if(null!==u&&(o&&!u?console.warn("Neo4j driver is configured to use secure WebSocket on a HTTP web page. WebSockets might not work in a mixed content environment. Please consider configuring driver to not use encryption."):i&&u&&console.warn("Neo4j driver is configured to use insecure WebSocket on a HTTPS web page. WebSockets might not work in a mixed content environment. Please consider configuring driver to use encryption.")),!n){if(t)return{scheme:"wss",error:null};if(r)return e&&"TRUST_SYSTEM_CA_SIGNED_CERTIFICATES"!==e?{scheme:null,error:(0,eI.newError)("The browser version of this driver only supports one trust strategy, 'TRUST_SYSTEM_CA_SIGNED_CERTIFICATES'. "+e+' is not supported. Please either use TRUST_SYSTEM_CA_SIGNED_CERTIFICATES or disable encryption by setting `encrypted:"'+tI+'"` in the driver configuration.')}:{scheme:"wss",error:null}}return{scheme:"ws",error:null}})(e,t)),i=t.scheme,t=t.error;t?this._error=t:(this._ws=((t,r,n)=>{var o=t+"://"+r.asHostPort();try{return n(o)}catch(e){if(((e,t)=>"SyntaxError"===e.name&&(e=>"["===e.charAt(0)&&-1!==e.indexOf("]"))(t.asHostPort()))(e,r))return o=((e,t)=>{var r=t.host().replace(/:/g,"-").replace("%","s")+".ipv6-literal.net";return"".concat(e,"://").concat(r,":").concat(t.port())})(t,r),n(o);throw e}})(i,e.address,r),this._ws.binaryType="arraybuffer",(n=this)._ws.onclose=function(e){e&&!e.wasClean&&n._handleConnectionError(),n._open=!1},this._ws.onopen=function(){n._clearConnectionTimeout();var e=n._pending;n._pending=null;for(var t=0;t<e.length;t++)n.write(e[t])},this._ws.onmessage=function(e){o._resetTimeout(),n.onmessage&&(e=new $C.default(e.data),n.onmessage(e))},this._ws.onerror=this._handleConnectionError,this._connectionTimeoutFired=!1,this._connectionTimeoutId=this._setupConnectionTimeout())}function oI(){return"undefined"!=typeof window&&window.location?window.location.protocol:null}nI.prototype._handleConnectionError=function(){this._connectionTimeoutFired?(this._error=(0,eI.newError)("Failed to establish connection in ".concat(this._config.connectionTimeout,"ms"),this._config.connectionErrorCode),this.onerror&&this.onerror(this._error)):this._open&&!this._timedout&&(this._error=(0,eI.newError)("WebSocket connection failure. Due to security constraints in your web browser, the reason for the failure is not available to this Neo4j Driver. Please use your browsers development console to determine the root cause of the failure. Common reasons include the database being unavailable, using the wrong connection URL or temporary network problems. If you have enabled encryption, ensure your browser is configured to trust the certificate Neo4j is configured to use. WebSocket `readyState` is: "+this._ws.readyState,this._config.connectionErrorCode),this.onerror)&&this.onerror(this._error)},nI.prototype.write=function(e){if(null!==this._pending)this._pending.push(e);else{if(!(e instanceof $C.default))throw(0,eI.newError)("Don't know how to send buffer: "+e);try{this._ws.send(e._buffer)}catch(e){if(1===this._ws.readyState)throw(0,eI.newError)("unexpected failure to write.",void 0,e);this._handleConnectionError()}}},nI.prototype.close=function(){var r=this;return null===this._closingPromise&&(this._closingPromise=new Promise(function(e,t){r._clearConnectionTimeout(),r._ws&&3!==r._ws.readyState?(r._open=!1,r.stopReceiveTimeout(),r._ws.onclose=function(){e()},r._ws.close()):e()})),this._closingPromise},nI.prototype.setupReceiveTimeout=function(e){this._receiveTimeout=e},nI.prototype.stopReceiveTimeout=function(){null!==this._receiveTimeout&&this._receiveTimeoutStarted&&(this._receiveTimeoutStarted=!1,null!=this._receiveTimeoutId&&clearTimeout(this._receiveTimeoutId),this._receiveTimeoutId=null)},nI.prototype.startReceiveTimeout=function(){this._open&&null!==this._receiveTimeout&&!this._receiveTimeoutStarted&&(this._receiveTimeoutStarted=!0,this._resetTimeout())},nI.prototype._resetTimeout=function(){var e=this;this._receiveTimeoutStarted&&(null!==this._receiveTimeoutId&&clearTimeout(this._receiveTimeoutId),this._receiveTimeoutId=setTimeout(function(){e._receiveTimeoutId=null,e._timedout=!0,e.stopReceiveTimeout(),e._error=(0,eI.newError)("Connection lost. Server didn't respond in ".concat(e._receiveTimeout,"ms"),e._config.connectionErrorCode),e.close(),e.onerror&&e.onerror(e._error)},this._receiveTimeout))},nI.prototype._setupConnectionTimeout=function(){var e,t=this,r=this._config.connectionTimeout;return r?(e=this._ws,setTimeout(function(){1!==e.readyState&&(t._connectionTimeoutFired=!0,e.close())},r)):null},nI.prototype._clearConnectionTimeout=function(){var e=this._connectionTimeoutId;!e&&0!==e||(this._connectionTimeoutFired=!1,this._connectionTimeoutId=null,clearTimeout(e))},ah.default=nI;var iI,Sb={},ef=r&&r.__extends||(iI=function(e,t){return(iI=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}iI(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(Sb,"__esModule",{value:!0});var uI,n=e.internal.resolver.BaseHostNameResolver,Zh=(ef(aI,uI=n),aI.prototype.resolve=function(e){return this._resolveToItself(e)},aI);function aI(){return null!==uI&&uI.apply(this,arguments)||this}Sb.default=Zh;var sI,h={},cI=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},lI=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))s.label=t[1];else if(6===t[0]&&s.label<a[1])s.label=a[1],a=t;else{if(!(a&&s.label<a[2])){a[2]&&s.ops.pop(),s.trys.pop();continue}s.label=a[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},xb=(Object.defineProperty(h,"__esModule",{value:!0}),h.default={load:function(t){return cI(this,void 0,void 0,function(){return lI(this,function(e){return[2,t]})})}},r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}}),Wr=(Object.defineProperty(eh,"__esModule",{value:!0}),eh.ClientCertificatesLoader=eh.HostNameResolver=eh.Channel=void 0,xb(ah)),R=xb(Sb),ub=xb(h),Xh=(eh.Channel=Wr.default,eh.HostNameResolver=R.default,eh.ClientCertificatesLoader=ub.default,{}),Db={},Bb=r&&r.__extends||(sI=function(e,t){return(sI=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}sI(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(Db,"__esModule",{value:!0});var fI,pI=$l,zb=(fI=xh.BaseBuffer,Bb(dI,fI),dI.prototype.getUInt8=function(e){for(var t=0;t<this._buffers.length;t++){var r=this._buffers[t];if(!(e>=r.length))return r.getUInt8(e);e-=r.length}},dI.prototype.getInt8=function(e){for(var t=0;t<this._buffers.length;t++){var r=this._buffers[t];if(!(e>=r.length))return r.getInt8(e);e-=r.length}},dI.prototype.getFloat64=function(e){for(var t=(0,pI.alloc)(8),r=0;r<8;r++)t.putUInt8(r,this.getUInt8(e+r));return t.getFloat64(0)},dI);function dI(e){for(var t=this,r=0,n=0;n<e.length;n++)r+=e[n].length;return(t=fI.call(this,r)||this)._buffers=e,t}Db.default=zb;var hI,bI,Zb=r&&r.__extends||(hI=function(e,t){return(hI=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}hI(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),ey=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},cy=(Object.defineProperty(Xh,"__esModule",{value:!0}),Xh.Dechunker=Xh.Chunker=void 0,ey(j)),yI=$l,_I=ey(Db),_y=(bI=cy.default,Zb(vI,bI),vI.prototype.putUInt8=function(e,t){this._ensure(1),this._buffer.writeUInt8(t)},vI.prototype.putInt8=function(e,t){this._ensure(1),this._buffer.writeInt8(t)},vI.prototype.putFloat64=function(e,t){this._ensure(8),this._buffer.writeFloat64(t)},vI.prototype.putBytes=function(e,t){for(;0<t.remaining();)this._ensure(1),this._buffer.remaining()>t.remaining()?this._buffer.writeBytes(t):this._buffer.writeBytes(t.readSlice(this._buffer.remaining()));return this},vI.prototype.flush=function(){var e;return 0<this._buffer.position&&(this._closeChunkIfOpen(),e=this._buffer,this._buffer=null,this._ch.write(e.getSlice(0,e.position)),this._buffer=(0,yI.alloc)(this._bufferSize),this._chunkOpen=!1),this},vI.prototype.messageBoundary=function(){this._closeChunkIfOpen(),this._buffer.remaining()<2&&this.flush(),this._buffer.writeInt16(0)},vI.prototype._ensure=function(e){e=this._chunkOpen?e:e+2;this._buffer.remaining()<e&&this.flush(),this._chunkOpen||(this._currentChunkStart=this._buffer.position,this._buffer.position=this._buffer.position+2,this._chunkOpen=!0)},vI.prototype._closeChunkIfOpen=function(){var e;this._chunkOpen&&(e=this._buffer.position-(this._currentChunkStart+2),this._buffer.putUInt16(this._currentChunkStart,e),this._chunkOpen=!1)},vI);function vI(e,t){var r=bI.call(this,0)||this;return r._bufferSize=t||1400,r._ch=e,r._buffer=(0,yI.alloc)(r._bufferSize),r._currentChunkStart=0,r._chunkOpen=!1,r}function mI(){this._currentMessage=[],this._partialChunkHeader=0,this._state=this.AWAITING_CHUNK}Xh.Chunker=_y,mI.prototype.AWAITING_CHUNK=function(e){return 2<=e.remaining()?this._onHeader(e.readUInt16()):(this._partialChunkHeader=e.readUInt8()<<8,this.IN_HEADER)},mI.prototype.IN_HEADER=function(e){return this._onHeader(65535&(this._partialChunkHeader|e.readUInt8()))},mI.prototype.IN_CHUNK=function(e){return this._chunkSize<=e.remaining()?(this._currentMessage.push(e.readSlice(this._chunkSize)),this.AWAITING_CHUNK):(this._chunkSize-=e.remaining(),this._currentMessage.push(e.readSlice(e.remaining())),this.IN_CHUNK)},mI.prototype.CLOSED=function(e){},mI.prototype._onHeader=function(e){if(0!==e)return this._chunkSize=e,this.IN_CHUNK;var t=void 0;switch(this._currentMessage.length){case 0:return this.AWAITING_CHUNK;case 1:t=this._currentMessage[0];break;default:t=new _I.default(this._currentMessage)}return this._currentMessage=[],this.onmessage(t),this.AWAITING_CHUNK},mI.prototype.write=function(e){for(;e.hasRemaining();)this._state=this._state(e)},Xh.Dechunker=mI;var wy={},gI=(Object.defineProperty(wy,"__esModule",{value:!0}),e),Sy=gI.internal.util,jy=Sy.ENCRYPTION_OFF,OI=gI.error.SERVICE_UNAVAILABLE,wI=[null,void 0,!0,!1,Sy.ENCRYPTION_ON,jy],EI=[null,void 0,"TRUST_ALL_CERTIFICATES","TRUST_CUSTOM_CA_SIGNED_CERTIFICATES","TRUST_SYSTEM_CA_SIGNED_CERTIFICATES"];wy.default=function(e,t,r,n){this.address=e,this.encrypted=(e=>{if(e=e.encrypted,-1!==wI.indexOf(e))return e;throw(0,gI.newError)("Illegal value of the encrypted setting ".concat(e,". Expected one of ").concat(wI))})(t),this.trust=(e=>{if(e=e.trust,-1!==EI.indexOf(e))return e;throw(0,gI.newError)("Illegal value of the trust setting ".concat(e,". Expected one of ").concat(EI))})(t),this.trustedCertificates=t.trustedCertificates||[],this.connectionErrorCode=r||OI,this.connectionTimeout=t.connectionTimeout,this.clientCertificate=n};var PI,TI,Hy={},zy={},l_={exports:{}};function SI(e,t){for(var r in e)t[r]=e[r]}function jI(e,t,r){return TI(e,t,r)}Jp=(xd=l_).exports,(TI=(PI=_d).Buffer).from&&TI.alloc&&TI.allocUnsafe&&TI.allocUnsafeSlow?xd.exports=PI:(SI(PI,Jp),Jp.Buffer=jI),jI.prototype=Object.create(TI.prototype),SI(TI,jI),jI.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return TI(e,t,r)},jI.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");e=TI(e);return void 0!==t?"string"==typeof r?e.fill(t,r):e.fill(t):e.fill(0),e},jI.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return TI(e)},jI.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return PI.SlowBuffer(e)};var CI=l_.exports.Buffer,II=CI.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function RI(e){var t=(e=>{if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}})(e);if("string"==typeof t||CI.isEncoding!==II&&II(e))return t||e;throw new Error("Unknown encoding: "+e)}function AI(e){var t;switch(this.encoding=RI(e),this.encoding){case"utf16le":this.text=kI,this.end=xI,t=4;break;case"utf8":this.fillLast=NI,t=4;break;case"base64":this.text=DI,this.end=UI,t=3;break;default:return this.write=LI,void(this.end=FI)}this.lastNeed=0,this.lastTotal=0,this.lastChar=CI.allocUnsafe(t)}function MI(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function NI(e){var t,r=this.lastTotal-this.lastNeed,n=(t=this,128!=(192&(n=e)[0])?(t.lastNeed=0,"�"):1<t.lastNeed&&1<n.length?128!=(192&n[1])?(t.lastNeed=1,"�"):2<t.lastNeed&&2<n.length&&128!=(192&n[2])?(t.lastNeed=2,"�"):void 0:void 0);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,r,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,r,0,e.length),void(this.lastNeed-=e.length))}function kI(e,t){if((e.length-t)%2!=0)return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1);t=e.toString("utf16le",t);if(t){var r=t.charCodeAt(t.length-1);if(55296<=r&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],t.slice(0,-1)}return t}function xI(e){var t,e=e&&e.length?this.write(e):"";return this.lastNeed?(t=this.lastTotal-this.lastNeed,e+this.lastChar.toString("utf16le",0,t)):e}function DI(e,t){var r=(e.length-t)%3;return 0==r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1==r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function UI(e){e=e&&e.length?this.write(e):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function LI(e){return e.toString(this.encoding)}function FI(e){return e&&e.length?this.write(e):""}(zy.StringDecoder=AI).prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},AI.prototype.end=function(e){e=e&&e.length?this.write(e):"";return this.lastNeed?e+"�":e},AI.prototype.text=function(e,t){var r=((e,t,r)=>{var n=t.length-1;if(!(n<r)){var o=MI(t[n]);if(0<=o)return 0<o&&(e.lastNeed=o-1),o;if(!(--n<r||-2===o)){if(0<=(o=MI(t[n])))return 0<o&&(e.lastNeed=o-2),o;if(!(--n<r||-2===o)&&0<=(o=MI(t[n])))return 0<o&&(2===o?o=0:e.lastNeed=o-3),o}}return 0})(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;r=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},AI.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};var BI,VI,qI,WI,zI,u_=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},HI=(Object.defineProperty(Hy,"__esModule",{value:!0}),u_($l)),GI=e,YI=u_(_d),KI=new zy.StringDecoder("utf8");Hy.default={encode:function(e){return new HI.default((e=e,"function"==typeof YI.default.Buffer.from?YI.default.Buffer.from(e,"utf8"):new YI.default.Buffer(e,"utf8")))},decode:function(e,t){if(Object.prototype.hasOwnProperty.call(e,"_buffer"))return n=t,a=(r=e).position,n=a+n,r.position=Math.min(n,r.length),r._buffer.toString("utf8",a,n);var o,i,u,r,n,a;if(Object.prototype.hasOwnProperty.call(e,"_buffers"))return o=function(e){return KI.write(e._buffer)},r=function(){return KI.end()},i=t,u=(a=e).position,a._updatePos(Math.min(t,a.length-u)),a._buffers.reduce(function(e,t){var r,n;return i<=0?e:u>=t.length?(u-=t.length,""):(t._updatePos(u-t.position),r=Math.min(t.length-u,i),n=t.readSlice(r),t._updatePos(r),i=Math.max(i-n.length,0),u=0,e+o(n))},"")+r();throw(0,GI.newError)("Don't know how to decode strings from '".concat(e,"'"))}},c_=$d,BI=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),g_=r&&r.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||BI(t,e,r)},VI=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(c_,"__esModule",{value:!0}),c_.utf8=c_.alloc=c_.ChannelConfig=void 0,g_(eh,c_),g_(Xh,c_),qI=wy,Object.defineProperty(c_,"ChannelConfig",{enumerable:!0,get:function(){return VI(qI).default}}),WI=$l,Object.defineProperty(c_,"alloc",{enumerable:!0,get:function(){return WI.alloc}}),zI=Hy,Object.defineProperty(c_,"utf8",{enumerable:!0,get:function(){return VI(zI).default}}),Object.defineProperty(kd,"__esModule",{value:!0}),kd.default=function(f,e){return function(t,o){var i=this;return new Promise(function(r,n){function e(e){n(e)}t.onerror=e.bind(i),t._error&&e(t._error),t.onmessage=function(t){try{var e=((e,t)=>{if(72!==(e=[e.readUInt8(),e.readUInt8(),e.readUInt8(),e.readUInt8()])[0]||84!==e[1]||84!==e[2]||80!==e[3])return new QI.ProtocolVersion(e[3],e[2]);throw t.error("Handshake failed since server responded with HTTP."),(0,QI.newError)("Server responded HTTP. Make sure you are not trying to connect to the http endpoint (HTTP defaults to port 7474 whereas BOLT defaults to port 7687)")})(t,o);r({protocolVersion:e,capabilites:0,buffer:t,consumeRemainingBuffer:function(e){t.hasRemaining()&&e(t.readSlice(t.remaining()))}})}catch(e){n(e)}},t.write((e=>{if(4<e.length)throw(0,QI.newError)("It should not have more than 4 versions of the protocol");var o=(0,ZI.alloc)(20);return o.writeInt32(XI),e.forEach(function(e){var t,r,n;e instanceof Array?(r=(n=e[0]).major,t=e[1].minor,o.writeInt32((n=n.minor)-t<<16|n<<8|r)):(r=e.major,o.writeInt32((n=e.minor)<<8|r))}),o.reset(),o})([eR(255,1),[eR(5,8),eR(5,0)],[eR(4,4),eR(4,2)],eR(3,0)]))})}(f,e).then(function(e){if(e.protocolVersion.isEqualTo(new QI.ProtocolVersion(255,1))){for(var n=f,o=e.buffer,t=o.readVarInt(),r=[],i=0;i<t;i++){var u=[o.readUInt8(),o.readUInt8(),o.readUInt8(),o.readUInt8()];r=r.concat((e=>{for(var t=[],r=e[3],n=e[2],o=0;o<=e[1];o++)t.push({major:r,minor:n-o});return t})(u))}o.readVarInt();var a=$I,s=0,c=0;for(r.sort(function(e,t){return Number(e.major)!==Number(t.major)?Number(t.major)-Number(e.major):Number(t.minor)-Number(e.minor)}),i=0;i<r.length;i++){var l=r[i];if(JI.includes(l.major+"."+l.minor)){s=l.major,c=l.minor;break}}return new Promise(function(e,t){try{var r=(0,ZI.alloc)(5);r.writeInt32(c<<8|s),r.writeVarInt(a),n.write(r),e({protocolVersion:new QI.ProtocolVersion(s,c),capabilites:a,consumeRemainingBuffer:function(e){o.hasRemaining()&&e(o.readSlice(o.remaining()))}})}catch(e){t(e)}})}return e})};var ZI=$d,QI=e,XI=1616949271,JI=["6.1","6.0","5.8","5.7","5.6","5.4","5.3","5.2","5.1","5.0","4.4","4.3","4.2","3.0"],$I=0;function eR(e,t){return{major:e,minor:t}}var tR,O_={},I_={},k_={},A={},B_={},V_=r&&r.__extends||(tR=function(e,t){return(tR=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}tR(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),av=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},fv=(Object.defineProperty(B_,"__esModule",{value:!0}),av(e),rR.ofRecord=function(e){return null===e?rR.ofNull():new lR(e)},rR.ofMessageResponse=function(e){return null===e?rR.ofNull():new oR(e)},rR.ofNull=function(){return new aR},Object.defineProperty(rR.prototype,"ttl",{get:function(){throw new Error("Not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(rR.prototype,"db",{get:function(){throw new Error("Not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(rR.prototype,"servers",{get:function(){throw new Error("Not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(rR.prototype,"isNull",{get:function(){throw new Error("Not implemented")},enumerable:!1,configurable:!0}),rR);function rR(){}B_.default=fv;V_(iR,nR=fv),Object.defineProperty(iR.prototype,"ttl",{get:function(){return this._response.rt.ttl},enumerable:!1,configurable:!0}),Object.defineProperty(iR.prototype,"servers",{get:function(){return this._response.rt.servers},enumerable:!1,configurable:!0}),Object.defineProperty(iR.prototype,"db",{get:function(){return this._response.rt.db},enumerable:!1,configurable:!0}),Object.defineProperty(iR.prototype,"isNull",{get:function(){return null===this._response},enumerable:!1,configurable:!0});var nR,oR=iR;function iR(e){var t=nR.call(this)||this;return t._response=e,t}V_(sR,uR=fv),Object.defineProperty(sR.prototype,"isNull",{get:function(){return!0},enumerable:!1,configurable:!0});var uR,aR=sR;function sR(){return null!==uR&&uR.apply(this,arguments)||this}V_(fR,cR=fv),Object.defineProperty(fR.prototype,"ttl",{get:function(){return this._record.get("ttl")},enumerable:!1,configurable:!0}),Object.defineProperty(fR.prototype,"servers",{get:function(){return this._record.get("servers")},enumerable:!1,configurable:!0}),Object.defineProperty(fR.prototype,"db",{get:function(){return this._record.has("db")?this._record.get("db"):null},enumerable:!1,configurable:!0}),Object.defineProperty(fR.prototype,"isNull",{get:function(){return null===this._record},enumerable:!1,configurable:!0});var cR,lR=fR;function fR(e){var t=cR.call(this)||this;return t._record=e,t}var yv={},Ov={},pR=(Object.defineProperty(Ov,"__esModule",{value:!0}),Ov.identity=function(e){return e},Ov.reuseOngoingRequest=function(o,i){void 0===i&&(i=null);var u=new Map;return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r,n=pR.json.stringify(e);return u.has(n)?u.get(n):(r=o.apply(i,e),u.set(n,r),r.finally(function(){u.delete(n)}))}},e);var Ev={},dR=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(Ev,"__esModule",{value:!0}),Ev.equals=function(e,t){var r,n;if(e!==t){if(null===e||null===t)return!1;if("object"!=typeof e||"object"!=typeof t)return!1;var o=Object.keys(e),i=Object.keys(t);if(o.length!==i.length)return!1;try{for(var u=dR(o),a=u.next();!a.done;a=u.next()){var s=a.value;if(e[s]!==t[s])return!1}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}}return!0};var hR,bR,yR=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),_R=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),kv=r&&r.__importStar||(hR=function(e){return(hR=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=hR(e),n=0;n<r.length;n++)"default"!==r[n]&&yR(t,e,r[n]);return _R(t,e),t}),Fv=(Object.defineProperty(yv,"__esModule",{value:!0}),yv.object=yv.functional=void 0,yv.functional=kv(Ov),yv.object=kv(Ev),r&&r.__extends||(bR=function(e,t){return(bR=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}bR(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),qv=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},vR=(Object.defineProperty(A,"__esModule",{value:!0}),A.TelemetryObserver=A.ProcedureRouteObserver=A.RouteObserver=A.CompletedObserver=A.FailedObserver=A.ResetObserver=A.LogoffObserver=A.LoginObserver=A.ResultStreamObserver=A.StreamObserver=void 0,e),mR=qv(B_),gR=yv,OR=vR.internal.constants.FETCH_ALL,wR=vR.error.PROTOCOL_ERROR,Wv=(ER.prototype.onNext=function(e){},ER.prototype.onError=function(e){},ER.prototype.onCompleted=function(e){},ER);function ER(){}A.StreamObserver=Wv;Fv(TR,PR=Wv),TR.prototype.pause=function(){this._paused=!0},TR.prototype.resume=function(){this._paused=!1,this._setupAutoPull(),this._state.pull(this)},TR.prototype.onNext=function(e){this._haveRecordStreamed=!0;var t=new vR.Record(this._fieldKeys,e,this._fieldLookup);this._observers.some(function(e){return e.onNext})?this._observers.forEach(function(e){e.onNext&&e.onNext(t)}):(this._queuedRecords.push(t),this._queuedRecords.length>this._highRecordWatermark&&(this._autoPull=!1))},TR.prototype.onCompleted=function(e){this._state.onSuccess(this,e)},TR.prototype.onError=function(e,t){this._state.onError(this,e,t)},TR.prototype.cancel=function(){this._state.discard(this)},TR.prototype.prepareToHandleSingleResponse=function(){this._head=[],this._fieldKeys=[],this._setState(qR.STREAMING)},TR.prototype.markCompleted=function(){this._head=[],this._fieldKeys=[],this._tail={},this._setState(qR.SUCCEEDED)},TR.prototype.subscribe=function(e){if(this._head&&e.onKeys&&e.onKeys(this._head),0<this._queuedRecords.length&&e.onNext)for(var t=0;t<this._queuedRecords.length;t++)e.onNext(this._queuedRecords[t]),this._queuedRecords.length-t-1<=this._lowRecordWatermark&&(this._autoPull=!0,this._state===qR.READY)&&this._handleStreaming();this._tail&&e.onCompleted&&e.onCompleted(this._tail),this._error&&e.onError(this._error,this._runError),this._observers.push(e),this._state===qR.READY&&this._handleStreaming()},TR.prototype.unsubscribeAll=function(){this._observers=[]},TR.prototype._handleHasMore=function(e){this._setState(qR.READY),this._handleStreaming(),delete e.has_more},TR.prototype._handlePullSuccess=function(e){var t,r=this,n=this._enrichMetadata(Object.assign(this._server?{server:this._server}:{},this._meta,{stream_summary:{have_records_streamed:this._haveRecordStreamed,pulled:this._pulled,has_keys:0<this._fieldKeys.length}},e));[void 0,null,"r","w","rw","s"].includes(n.type)?(this._setState(qR.SUCCEEDED),e=null,t=function(){r._tail=n,r._observers.some(function(e){return e.onCompleted})&&r._observers.forEach(function(e){e.onCompleted&&e.onCompleted(n)}),r._afterComplete&&r._afterComplete(n)},(e=this._beforeComplete?this._beforeComplete(n):e)?Promise.resolve(e).then(t):t()):this.onError((0,vR.newError)('Server returned invalid query type. Expected one of [undefined, null, "r", "w", "rw", "s"] but got \''.concat(n.type,"'"),wR))},TR.prototype._handleRunSuccess=function(e,t){var r=this;if(null===this._fieldKeys){if(this._fieldKeys=[],this._fieldLookup={},e.fields&&0<e.fields.length){this._fieldKeys=e.fields;for(var n=0;n<e.fields.length;n++)this._fieldLookup[e.fields[n]]=n}null!==e.db&&void 0!==this._onDb&&this._onDb(e.db),null!=e.fields&&delete e.fields,null!=e.qid&&(this._queryId=e.qid,delete e.qid),this._storeMetadataForCompletion(e);var o=null,i=(this._beforeKeys&&(o=this._beforeKeys(this._fieldKeys)),function(){r._head=r._fieldKeys,r._observers.some(function(e){return e.onKeys})&&r._observers.forEach(function(e){e.onKeys&&e.onKeys(r._fieldKeys)}),r._afterKeys&&r._afterKeys(r._fieldKeys),t()});o?Promise.resolve(o).then(i):i()}},TR.prototype._handleError=function(t,r){function e(){n._observers.some(function(e){return e.onError})&&n._observers.forEach(function(e){e.onError&&e.onError(t,r)}),n._afterError&&n._afterError(t)}var n=this,o=(this._setState(qR.FAILED),this._error=t,this._runError=r,null);this._beforeError&&(o=this._beforeError(t));o?Promise.resolve(o).then(e):e()},TR.prototype._handleStreaming=function(){!this._head||!this._observers.some(function(e){return e.onNext||e.onCompleted})&&!this._discard||this._paused||!this._discard&&!this._autoPull||this._more()},TR.prototype._more=function(){this._discard?this._discardFunction(this._queryId,this):(this._pulled=!0,this._moreFunction(this._queryId,this._fetchSize,this)),this._setState(qR.STREAMING)},TR.prototype._storeMetadataForCompletion=function(e){for(var t,r=Object.keys(e),n=r.length;n--;)t=r[n],this._meta[t]=e[t]},TR.prototype._setState=function(e){this._state=e},TR.prototype._setupAutoPull=function(){this._autoPull=!0};var PR,zv=TR;function TR(e){var e=void 0===e?{}:e,t=e.reactive,t=void 0!==t&&t,r=e.moreFunction,n=e.discardFunction,o=e.fetchSize,o=void 0===o?OR:o,i=e.beforeError,u=e.afterError,a=e.beforeKeys,s=e.afterKeys,c=e.beforeComplete,l=e.afterComplete,f=e.server,p=e.highRecordWatermark,p=void 0===p?Number.MAX_VALUE:p,d=e.lowRecordWatermark,d=void 0===d?Number.MAX_VALUE:d,h=e.enrichMetadata,e=e.onDb,b=PR.call(this)||this;return b._fieldKeys=null,b._fieldLookup=null,b._head=null,b._queuedRecords=[],b._tail=null,b._error=null,b._runError=!1,b._observers=[],b._meta={},b._server=f,b._beforeError=i,b._afterError=u,b._beforeKeys=a,b._afterKeys=s,b._beforeComplete=c,b._afterComplete=l,b._enrichMetadata=h||gR.functional.identity,b._queryId=null,b._moreFunction=r,b._discardFunction=n,b._discard=!1,b._fetchSize=o,b._lowRecordWatermark=d,b._highRecordWatermark=p,b._setState(t?qR.READY:qR.READY_STREAMING),b._setupAutoPull(),b._paused=!1,b._pulled=!t,b._haveRecordStreamed=!1,b._onDb=e,b}A.ResultStreamObserver=zv;Fv(jR,SR=Wv),jR.prototype.onNext=function(e){this.onError((0,vR.newError)("Received RECORD when initializing "+vR.json.stringify(e)))},jR.prototype.onError=function(e){this._onError&&this._onError(e)},jR.prototype.onCompleted=function(e){this._onCompleted&&this._onCompleted(e)};var SR,Xv=jR;function jR(e){var e=void 0===e?{}:e,t=e.onError,e=e.onCompleted,r=SR.call(this)||this;return r._onError=t,r._onCompleted=e,r}A.LoginObserver=Xv;Fv(IR,CR=Wv),IR.prototype.onNext=function(e){this.onError((0,vR.newError)("Received RECORD when logging off "+vR.json.stringify(e)))},IR.prototype.onError=function(e){this._onError&&this._onError(e)},IR.prototype.onCompleted=function(e){this._onCompleted&&this._onCompleted(e)};var CR,ab=IR;function IR(e){var e=void 0===e?{}:e,t=e.onError,e=e.onCompleted,r=CR.call(this)||this;return r._onError=t,r._onCompleted=e,r}A.LogoffObserver=ab;Fv(AR,RR=Wv),AR.prototype.onNext=function(e){this.onError((0,vR.newError)("Received RECORD when resetting: received record is: "+vR.json.stringify(e),wR))},AR.prototype.onError=function(e){e.code===wR&&this._onProtocolError&&this._onProtocolError(e.message),this._onError&&this._onError(e)},AR.prototype.onCompleted=function(e){this._onComplete&&this._onComplete(e)};var RR,em=AR;function AR(e){var e=void 0===e?{}:e,t=e.onProtocolError,r=e.onError,e=e.onComplete,n=RR.call(this)||this;return n._onProtocolError=t,n._onError=r,n._onComplete=e,n}A.ResetObserver=em;Fv(NR,MR=zv),NR.prototype.onNext=function(e){this.onError((0,vR.newError)("Received RECORD when sending telemetry "+vR.json.stringify(e),wR))},NR.prototype.onError=function(e){this._onError&&this._onError(e)},NR.prototype.onCompleted=function(e){this._onCompleted&&this._onCompleted(e)};var MR,rm=NR;function NR(e){var e=void 0===e?{}:e,t=e.onError,e=e.onCompleted,r=MR.call(this)||this;return r._onError=t,r._onCompleted=e,r}A.TelemetryObserver=rm;Fv(xR,kR=zv);var kR,um=xR;function xR(e){var t=e.error,e=kR.call(this,{beforeError:e.onError})||this;return e.onError(t),e}A.FailedObserver=um;Fv(UR,DR=zv);var DR,cm=UR;function UR(){var e=DR.call(this)||this;return DR.prototype.markCompleted.call(e),e}A.CompletedObserver=cm;Fv(FR,LR=Wv),FR.prototype.onNext=function(e){this._records.push(e)},FR.prototype.onError=function(e){e.code===wR&&this._onProtocolError&&this._onProtocolError(e.message),this._onError&&this._onError(e)},FR.prototype.onCompleted=function(){null!==this._records&&1!==this._records.length?this.onError((0,vR.newError)("Illegal response from router. Received "+this._records.length+" records but expected only one.\n"+vR.json.stringify(this._records),wR)):this._onCompleted&&this._onCompleted(mR.default.ofRecord(this._records[0]))};var LR,ym=FR;function FR(e){var t=e.resultObserver,r=e.onProtocolError,n=e.onError,e=e.onCompleted,o=LR.call(this)||this;return o._resultObserver=t,o._onError=n,o._onCompleted=e,o._records=[],o._onProtocolError=r,t.subscribe(o),o}A.ProcedureRouteObserver=ym;Fv(VR,BR=Wv),VR.prototype.onNext=function(e){this.onError((0,vR.newError)("Received RECORD when resetting: received record is: "+vR.json.stringify(e),wR))},VR.prototype.onError=function(e){e.code===wR&&this._onProtocolError&&this._onProtocolError(e.message),this._onError&&this._onError(e)},VR.prototype.onCompleted=function(e){this._onCompleted&&this._onCompleted(mR.default.ofMessageResponse(e))};var BR,G_=VR;function VR(e){var e=void 0===e?{}:e,t=e.onProtocolError,r=e.onError,e=e.onCompleted,n=BR.call(this)||this;return n._onProtocolError=t,n._onError=r,n._onCompleted=e,n}A.RouteObserver=G_;var qR={READY_STREAMING:{onSuccess:function(e,t){e._handleRunSuccess(t,function(){e._setState(qR.STREAMING)})},onError:function(e,t,r){e._handleError(t,null==r||r)},name:function(){return"READY_STREAMING"},pull:function(){},discard:function(e){e._discard=!0}},READY:{onSuccess:function(e,t){e._handleRunSuccess(t,function(){return e._handleStreaming()})},onError:function(e,t,r){e._handleError(t,null==r||r)},name:function(){return"READY"},pull:function(e){return e._more()},discard:function(e){e._discard=!0,null!=e._fieldKeys&&e._more()}},STREAMING:{onSuccess:function(e,t){t.has_more?e._handleHasMore(t):e._handlePullSuccess(t)},onError:function(e,t,r){e._handleError(t,null!=r&&r)},name:function(){return"STREAMING"},pull:function(){},discard:function(e){e._discard=!0}},FAILED:{onSuccess:function(e){},onError:function(e){},name:function(){return"FAILED"},pull:function(){},discard:function(){}},SUCCEEDED:{onError:function(e){},name:function(){return"SUCCEEDED"},pull:function(){},discard:function(){}}},WR=(Object.defineProperty(k_,"__esModule",{value:!0}),k_.assertDatabaseIsEmpty=function(e,t,r){void 0===t&&(t=function(){});if(e)throw e=(0,WR.newError)("Driver is connected to the database that does not support multiple databases. Please upgrade to neo4j 4.0.0 or later in order to use this functionality"),t(e.message),r.onError(e),e},k_.assertTxConfigIsEmpty=function(e,t,r){void 0===t&&(t=function(){});if(e&&!e.isEmpty())throw e=(0,WR.newError)("Driver is connected to the database that does not support transaction configuration. Please upgrade to neo4j 3.5.0 or later in order to use this functionality"),t(e.message),r.onError(e),e},k_.assertImpersonatedUserIsEmpty=function(e,t,r){void 0===t&&(t=function(){});if(e)throw e=(0,WR.newError)("Driver is connected to the database that does not support user impersonation. Please upgrade to neo4j 4.4.0 or later in order to use this functionality. "+"Trying to impersonate ".concat(e,".")),t(e.message),r.onError(e),e},k_.assertNotificationFilterIsEmpty=function(e,t,r){void 0===t&&(t=function(){});if(void 0!==e)throw e=(0,WR.newError)("Driver is connected to a database that does not support user notification filters. Please upgrade to Neo4j 5.7.0 or later in order to use this functionality. "+"Trying to set notifications to ".concat(WR.json.stringify(e),".")),t(e.message),r.onError(e),e},e);var wm={},Tm={},$p={},zR=(Object.defineProperty($p,"__esModule",{value:!0}),$p.Structure=void 0,$p.verifyStructSize=function(e,t,r){if(t!==r)throw(0,zR.newError)("Wrong struct size for ".concat(e,", expected ").concat(t," but was ").concat(r),HR)},e),HR=zR.error.PROTOCOL_ERROR,Q_=(Object.defineProperty(GR.prototype,"size",{get:function(){return this.fields.length},enumerable:!1,configurable:!0}),GR.prototype.toString=function(){for(var e="",t=0;t<this.fields.length;t++)0<t&&(e+=", "),e+=this.fields[t];return"Structure("+this.signature+", ["+e+"])"},GR);function GR(e,t){this.signature=e,this.fields=t}$p.Structure=Q_,$p.default=Q_,Object.defineProperty(Tm,"__esModule",{value:!0}),Tm.Unpacker=Tm.Packer=void 0;var YR=$d,KR=yv,ZR=$p,QR=e,XR=QR.error.PROTOCOL_ERROR;function JR(e,t){void 0===t&&(t=!1),this._ch=e,this._byteArraysSupported=!0,this.allowUUID=t}function $R(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!1),this._disableLosslessIntegers=e=void 0===e?!1:e,this._useBigInt=t,this.allowUUID=r}JR.prototype.packable=function(o,i){var e,u=this;void 0===i&&(i=KR.functional.identity);try{o=i(o)}catch(e){return function(){throw e}}if(null===o)return function(){return u._ch.writeUInt8(192)};if(!0===o)return function(){return u._ch.writeUInt8(195)};if(!1===o)return function(){return u._ch.writeUInt8(194)};if("number"==typeof o)return function(){return u.packFloat(o)};if("string"==typeof o)return function(){return u.packString(o)};if("bigint"==typeof o)return function(){return u.packInteger((0,QR.int)(o))};if((0,QR.isInt)(o))return function(){return u.packInteger(o)};if(o instanceof Int8Array)return function(){return u.packBytes(o)};if(o instanceof Array)return function(){u.packListHeader(o.length);for(var e=0;e<o.length;e++)u.packable(void 0===o[e]?null:o[e],i)()};if((0,QR.isUUID)(o))return this.allowUUID?function(){return u.packUUID(o)}:this._nonPackableValue("Cannot pack UUID, negotiated bolt version uses older packstream");if(null!=(e=o)&&"function"==typeof e[Symbol.iterator])return this.packableIterable(o,i);if(o instanceof ZR.Structure){for(var t=[],r=0;r<o.fields.length;r++)t[r]=this.packable(o.fields[r],i);return function(){return u.packStruct(o.signature,t)}}return"object"==typeof o?function(){for(var e=Object.keys(o),t=0,r=0;r<e.length;r++)void 0!==o[e[r]]&&t++;u.packMapHeader(t);for(r=0;r<e.length;r++){var n=e[r];void 0!==o[n]&&(u.packString(n),u.packable(o[n],i)())}}:this._nonPackableValue("Unable to pack the given value: ".concat(o))},JR.prototype.packableIterable=function(t,e){try{var r=Array.from(t);return this.packable(r,e)}catch(e){throw(0,QR.newError)("Cannot pack given iterable, ".concat(e.message,": ").concat(t))}},JR.prototype.packStruct=function(e,t){this.packStructHeader((t=t||[]).length,e);for(var r=0;r<t.length;r++)t[r]()},JR.prototype.packInteger=function(e){var t=e.high,r=e.low;e.greaterThanOrEqual(-16)&&e.lessThan(128)?this._ch.writeInt8(r):e.greaterThanOrEqual(-128)&&e.lessThan(-16)?(this._ch.writeUInt8(200),this._ch.writeInt8(r)):e.greaterThanOrEqual(-32768)&&e.lessThan(32768)?(this._ch.writeUInt8(201),this._ch.writeInt16(r)):(e.greaterThanOrEqual(-2147483648)&&e.lessThan(2147483648)?this._ch.writeUInt8(202):(this._ch.writeUInt8(203),this._ch.writeInt32(t)),this._ch.writeInt32(r))},JR.prototype.packFloat=function(e){this._ch.writeUInt8(193),this._ch.writeFloat64(e)},JR.prototype.packString=function(e){var e=YR.utf8.encode(e),t=e.length;if(t<16)this._ch.writeUInt8(128|t);else if(t<256)this._ch.writeUInt8(208),this._ch.writeUInt8(t);else{if(t<65536)this._ch.writeUInt8(209),this._ch.writeUInt8(t/256>>0);else{if(!(t<4294967296))throw(0,QR.newError)("UTF-8 strings of size "+t+" are not supported");this._ch.writeUInt8(210),this._ch.writeUInt8((t/16777216>>0)%256),this._ch.writeUInt8((t/65536>>0)%256),this._ch.writeUInt8((t/256>>0)%256)}this._ch.writeUInt8(t%256)}this._ch.writeBytes(e)},JR.prototype.packListHeader=function(e){if(e<16)this._ch.writeUInt8(144|e);else if(e<256)this._ch.writeUInt8(212),this._ch.writeUInt8(e);else{if(e<65536)this._ch.writeUInt8(213);else{if(!(e<4294967296))throw(0,QR.newError)("Lists of size "+e+" are not supported");this._ch.writeUInt8(214),this._ch.writeUInt8((e/16777216>>0)%256),this._ch.writeUInt8((e/65536>>0)%256)}this._ch.writeUInt8((e/256>>0)%256),this._ch.writeUInt8(e%256)}},JR.prototype.packBytes=function(e){if(!this._byteArraysSupported)throw(0,QR.newError)("Byte arrays are not supported by the database this driver is connected to");this.packBytesHeader(e.length);for(var t=0;t<e.length;t++)this._ch.writeInt8(e[t])},JR.prototype.packBytesHeader=function(e){if(e<256)this._ch.writeUInt8(204),this._ch.writeUInt8(e);else{if(e<65536)this._ch.writeUInt8(205);else{if(!(e<4294967296))throw(0,QR.newError)("Byte arrays of size "+e+" are not supported");this._ch.writeUInt8(206),this._ch.writeUInt8((e/16777216>>0)%256),this._ch.writeUInt8((e/65536>>0)%256)}this._ch.writeUInt8((e/256>>0)%256),this._ch.writeUInt8(e%256)}},JR.prototype.packMapHeader=function(e){if(e<16)this._ch.writeUInt8(160|e);else if(e<256)this._ch.writeUInt8(216),this._ch.writeUInt8(e);else{if(e<65536)this._ch.writeUInt8(217),this._ch.writeUInt8(e/256>>0);else{if(!(e<4294967296))throw(0,QR.newError)("Maps of size "+e+" are not supported");this._ch.writeUInt8(218),this._ch.writeUInt8((e/16777216>>0)%256),this._ch.writeUInt8((e/65536>>0)%256),this._ch.writeUInt8((e/256>>0)%256)}this._ch.writeUInt8(e%256)}},JR.prototype.packStructHeader=function(e,t){if(e<16)this._ch.writeUInt8(176|e),this._ch.writeUInt8(t);else if(e<256)this._ch.writeUInt8(220),this._ch.writeUInt8(e),this._ch.writeUInt8(t);else{if(!(e<65536))throw(0,QR.newError)("Structures of size "+e+" are not supported");this._ch.writeUInt8(221),this._ch.writeUInt8(e/256>>0),this._ch.writeUInt8(e%256)}},JR.prototype.packUUID=function(e){this._ch.writeUInt8(224);for(var t=e.getTypedArray(),r=0;r<t.length;r++)this._ch.writeUInt8(t[r])},JR.prototype.disableByteArrays=function(){this._byteArraysSupported=!1},JR.prototype._nonPackableValue=function(e){return function(){throw(0,QR.newError)(e,XR)}},Tm.Packer=JR,$R.prototype.unpack=function(e,t){void 0===t&&(t=KR.functional.identity);var r=e.readUInt8(),n=240&r,o=15&r;if(192===r)return null;var i=this._unpackBoolean(r);if(null!==i)return i;i=this._unpackNumberOrInteger(r,e);if(null!==i){if((0,QR.isInt)(i)){if(this._useBigInt)return i.toBigInt();if(this._disableLosslessIntegers)return i.toNumberOrInfinity()}return i}i=this._unpackString(r,n,o,e);if(null!==i)return i;i=this._unpackList(r,n,o,e,t);if(null!==i)return i;i=this._unpackByteArray(r,e);if(null!==i)return i;i=this._unpackUUID(r,e);if(null!==i)return i;i=this._unpackMap(r,n,o,e,t);if(null!==i)return i;i=this._unpackStruct(r,n,o,e,t);if(null!==i)return i;throw(0,QR.newError)("Unknown packed value with marker "+r.toString(16))},$R.prototype.unpackInteger=function(e){var t=e.readUInt8(),e=this._unpackInteger(t,e);if(null==e)throw(0,QR.newError)("Unable to unpack integer value with marker "+t.toString(16));return e},$R.prototype._unpackBoolean=function(e){return 195===e||194!==e&&null},$R.prototype._unpackNumberOrInteger=function(e,t){return 193===e?t.readFloat64():this._unpackInteger(e,t)},$R.prototype._unpackInteger=function(e,t){var r;return 0<=e&&e<128?(0,QR.int)(e):240<=e&&e<256?(0,QR.int)(e-256):200===e?(0,QR.int)(t.readInt8()):201===e?(0,QR.int)(t.readInt16()):202===e?(r=t.readInt32(),(0,QR.int)(r)):203===e?(r=t.readInt32(),e=t.readInt32(),new QR.Integer(e,r)):null},$R.prototype._unpackString=function(e,t,r,n){return 128===t?YR.utf8.decode(n,r):208===e?YR.utf8.decode(n,n.readUInt8()):209===e?YR.utf8.decode(n,n.readUInt16()):210===e?YR.utf8.decode(n,n.readUInt32()):null},$R.prototype._unpackList=function(e,t,r,n,o){return 144===t?this._unpackListWithSize(r,n,o):212===e?this._unpackListWithSize(n.readUInt8(),n,o):213===e?this._unpackListWithSize(n.readUInt16(),n,o):214===e?this._unpackListWithSize(n.readUInt32(),n,o):null},$R.prototype._unpackListWithSize=function(e,t,r){for(var n=[],o=0;o<e;o++)n.push(this.unpack(t,r));return n},$R.prototype._unpackByteArray=function(e,t){return 204===e?this._unpackByteArrayWithSize(t.readUInt8(),t):205===e?this._unpackByteArrayWithSize(t.readUInt16(),t):206===e?this._unpackByteArrayWithSize(t.readUInt32(),t):null},$R.prototype._unpackUUID=function(e,t){if(224!==e||!0!==this.allowUUID)return null;for(var r=new Uint8Array(16),n=0;n<16;n++)r[n]=t.readUInt8();return new QR.UUID(r)},$R.prototype._unpackByteArrayWithSize=function(e,t){for(var r=new Int8Array(e),n=0;n<e;n++)r[n]=t.readInt8();return r},$R.prototype._unpackMap=function(e,t,r,n,o){return 160===t?this._unpackMapWithSize(r,n,o):216===e?this._unpackMapWithSize(n.readUInt8(),n,o):217===e?this._unpackMapWithSize(n.readUInt16(),n,o):218===e?this._unpackMapWithSize(n.readUInt32(),n,o):null},$R.prototype._unpackMapWithSize=function(e,t,r){for(var n={},o=0;o<e;o++)n[this.unpack(t,r)]=this.unpack(t,r);return n},$R.prototype._unpackStruct=function(e,t,r,n,o){return 176===t?this._unpackStructWithSize(r,n,o):220===e?this._unpackStructWithSize(n.readUInt8(),n,o):221===e?this._unpackStructWithSize(n.readUInt16(),n,o):null},$R.prototype._unpackStructWithSize=function(e,t,r){for(var n=t.readUInt8(),o=new ZR.Structure(n,[]),i=0;i<e;i++)o.fields.push(this.unpack(t,r));return r(o)},Tm.Unpacker=$R;var eA,tA,rA,Um={},Vm=r&&r.__extends||(eA=function(e,t){return(eA=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}eA(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),nA=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),oA=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Xm=r&&r.__importStar||(tA=function(e){return(tA=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=tA(e),n=0;n<r.length;n++)"default"!==r[n]&&nA(t,e,r[n]);return oA(t,e),t}),Dd=(Object.defineProperty(Um,"__esModule",{value:!0}),Um.Unpacker=Um.Packer=void 0,Xm(Tm)),zm=(rA=Dd.Packer,Vm(iA,rA),iA.prototype.disableByteArrays=function(){throw new Error("Bolt V2 should always support byte arrays")},iA);function iA(){return null!==rA&&rA.apply(this,arguments)||this}Um.Packer=zm;uA=Dd.Unpacker,Vm(aA,uA);var uA,Ud=aA;function aA(e,t,r){return uA.call(this,e=void 0===e?!1:e,t=void 0===t?!1:t,r=void 0===r?!1:r)||this}Um.Unpacker=Ud;var sA,cA=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),lA=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Hm=r&&r.__importStar||(sA=function(e){return(sA=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=sA(e),n=0;n<r.length;n++)"default"!==r[n]&&cA(t,e,r[n]);return lA(t,e),t}),Km=(Object.defineProperty(wm,"__esModule",{value:!0}),wm.structure=wm.v2=wm.v1=void 0,Hm(Tm)),Ld=(wm.v1=Km,Hm(Um)),a0=(wm.v2=Ld,Hm($p)),l0=(wm.structure=a0,wm.default=Ld,{}),fA=(Object.defineProperty(l0,"__esModule",{value:!0}),l0.SIGNATURES=void 0,e),a=fA.internal.constants,pA=a.ACCESS_MODE_READ,dA=a.FETCH_ALL,hA=fA.internal.util.assertString,h0=Object.freeze({INIT:1,RESET:15,RUN:16,PULL_ALL:63,HELLO:1,GOODBYE:2,BEGIN:17,COMMIT:18,ROLLBACK:19,TELEMETRY:84,ROUTE:102,LOGON:106,LOGOFF:107,DISCARD:47,PULL:63}),g0=(l0.SIGNATURES=h0,k.init=function(e,t){return new k(1,[e,t],function(){return"INIT ".concat(e," {...}")})},k.run=function(e,t){return new k(16,[e,t],function(){return"RUN ".concat(e," ").concat(fA.json.stringify(t))})},k.pullAll=function(){return mA},k.reset=function(){return gA},k.hello=function(e,t,r,n){void 0===r&&(r=null),void 0===n&&(n=null);t=Object.assign({user_agent:e},t);return r&&(t.routing=r),n&&(t.patch_bolt=n),new k(1,[t],function(){return"HELLO {user_agent: '".concat(e,"', ...}")})},k.hello5x1=function(e,t){var r={user_agent:e};return(t=void 0===t?null:t)&&(r.routing=t),new k(1,[r],function(){return"HELLO {user_agent: '".concat(e,"', ...}")})},k.hello5x2=function(e,t,r){void 0===r&&(r=null);var n={user_agent:e};return _A(n,t=void 0===t?null:t),r&&(n.routing=r),new k(1,[n],function(){return"HELLO ".concat(fA.json.stringify(n))})},k.hello5x3=function(e,t,r,n){void 0===r&&(r=null),void 0===n&&(n=null);var o={};return e&&(o.user_agent=e),t&&(o.bolt_agent={product:t.product,platform:t.platform,language:t.language,language_details:t.languageDetails}),_A(o,r),n&&(o.routing=n),new k(1,[o],function(){return"HELLO ".concat(fA.json.stringify(o))})},k.hello5x5=function(e,t,r,n){void 0===r&&(r=null),void 0===n&&(n=null);var o={};return e&&(o.user_agent=e),t&&(o.bolt_agent={product:t.product,platform:t.platform,language:t.language,language_details:t.languageDetails}),vA(o,r),n&&(o.routing=n),new k(1,[o],function(){return"HELLO ".concat(fA.json.stringify(o))})},k.logon=function(e){return new k(106,[e],function(){return"LOGON { ... }"})},k.logoff=function(){return new k(107,[],function(){return"LOGOFF"})},k.begin=function(e){var e=void 0===e?{}:e,t=bA(e.bookmarks,e.txConfig,e.database,e.mode,e.impersonatedUser,e.notificationFilter);return new k(17,[t],function(){return"BEGIN ".concat(fA.json.stringify(t))})},k.begin5x5=function(e){var e=void 0===e?{}:e,t=bA(e.bookmarks,e.txConfig,e.database,e.mode,e.impersonatedUser,e.notificationFilter,{appendNotificationFilter:vA});return new k(17,[t],function(){return"BEGIN ".concat(fA.json.stringify(t))})},k.commit=function(){return OA},k.rollback=function(){return wA},k.runWithMetadata=function(e,t,r){var r=void 0===r?{}:r,n=bA(r.bookmarks,r.txConfig,r.database,r.mode,r.impersonatedUser,r.notificationFilter);return new k(16,[e,t,n],function(){return"RUN ".concat(e," ").concat(fA.json.stringify(t)," ").concat(fA.json.stringify(n))})},k.runWithMetadata5x5=function(e,t,r){var r=void 0===r?{}:r,n=bA(r.bookmarks,r.txConfig,r.database,r.mode,r.impersonatedUser,r.notificationFilter,{appendNotificationFilter:vA});return new k(16,[e,t,n],function(){return"RUN ".concat(e," ").concat(fA.json.stringify(t)," ").concat(fA.json.stringify(n))})},k.goodbye=function(){return EA},k.pull=function(e){var e=void 0===e?{}:e,t=e.stmtId,t=void 0===t?-1:t,e=e.n,r=yA(null==t?-1:t,(void 0===e?dA:e)||dA);return new k(63,[r],function(){return"PULL ".concat(fA.json.stringify(r))})},k.discard=function(e){var e=void 0===e?{}:e,t=e.stmtId,t=void 0===t?-1:t,e=e.n,r=yA(null==t?-1:t,(void 0===e?dA:e)||dA);return new k(47,[r],function(){return"DISCARD ".concat(fA.json.stringify(r))})},k.telemetry=function(e){var e=e.api,t=(0,fA.int)(e);return new k(84,[t],function(){return"TELEMETRY ".concat(t.toString())})},k.route=function(e,t,r){return new k(102,[e=void 0===e?{}:e,t=void 0===t?[]:t,r=void 0===r?null:r],function(){return"ROUTE ".concat(fA.json.stringify(e)," ").concat(fA.json.stringify(t)," ").concat(r)})},k.routeV4x4=function(e,t,r){void 0===e&&(e={}),void 0===t&&(t=[]);var n={};return(r=void 0===r?{}:r).databaseName&&(n.db=r.databaseName),r.impersonatedUser&&(n.imp_user=r.impersonatedUser),new k(102,[e,t,n],function(){return"ROUTE ".concat(fA.json.stringify(e)," ").concat(fA.json.stringify(t)," ").concat(fA.json.stringify(n))})},k);function k(e,t,r){this.signature=e,this.fields=t,this.toString=r}function bA(e,t,r,n,o,i,u){void 0===u&&(u={});var a={};return e.isEmpty()||(a.bookmarks=e.values()),null!==t.timeout&&(a.tx_timeout=t.timeout),t.metadata&&(a.tx_metadata=t.metadata),r&&(a.db=hA(r,"database")),o&&(a.imp_user=hA(o,"impersonatedUser")),n===pA&&(a.mode="r"),(null!=(e=u.appendNotificationFilter)?e:_A)(a,i),a}function yA(e,t){t={n:(0,fA.int)(t)};return-1!==e&&(t.qid=(0,fA.int)(e)),t}function _A(e,t){t&&(t.minimumSeverityLevel&&(e.notifications_minimum_severity=t.minimumSeverityLevel),t.disabledCategories&&(e.notifications_disabled_categories=t.disabledCategories),t.disabledClassifications)&&(e.notifications_disabled_categories=t.disabledClassifications)}function vA(e,t){t&&(t.minimumSeverityLevel&&(e.notifications_minimum_severity=t.minimumSeverityLevel),t.disabledCategories&&(e.notifications_disabled_classifications=t.disabledCategories),t.disabledClassifications)&&(e.notifications_disabled_classifications=t.disabledClassifications)}var mA=new(l0.default=g0)(63,[],function(){return"PULL_ALL"}),gA=new g0(15,[],function(){return"RESET"}),OA=new g0(18,[],function(){return"COMMIT"}),wA=new g0(19,[],function(){return"ROLLBACK"}),EA=new g0(2,[],function(){return"GOODBYE"}),l={},E0={},PA=(Object.defineProperty(E0,"__esModule",{value:!0}),E0.TypeTransformer=void 0,wm),TA=e.internal.objectUtil;function SA(e){this._transformers=e,this._transformersPerSignature=new Map(e.map(function(e){return[e.signature,e]})),this.fromStructure=this.fromStructure.bind(this),this.toStructure=this.toStructure.bind(this),Object.freeze(this)}function jA(e){var t=e.signature,r=e.fromStructure,n=e.toStructure,e=e.isTypeInstance;this.signature=t,this.isTypeInstance=e,this.fromStructure=r,this.toStructure=n,Object.freeze(this)}SA.prototype.fromStructure=function(e){try{return e instanceof PA.structure.Structure&&this._transformersPerSignature.has(e.signature)?(0,this._transformersPerSignature.get(e.signature).fromStructure)(e):e}catch(e){return TA.createBrokenObject(e)}},SA.prototype.toStructure=function(t){var e=typeof t;return("object"==e||"function"==e||"symbol"==e)&&null!==t&&void 0!==(e=this._transformers.find(function(e){return(0,e.isTypeInstance)(t)}))?e.toStructure(t):t},E0.default=SA,jA.prototype.extendsWith=function(e){return new jA({signature:e.signature||this.signature,fromStructure:e.fromStructure||this.fromStructure,toStructure:e.toStructure||this.toStructure,isTypeInstance:e.isTypeInstance||this.isTypeInstance})},E0.TypeTransformer=jA;var CA=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},IA=(Object.defineProperty(l,"__esModule",{value:!0}),e),RA=wm,AA=E0,MA=IA.error.PROTOCOL_ERROR;l.default={createNodeTransformer:function(){return new AA.TypeTransformer({signature:78,isTypeInstance:function(e){return e instanceof IA.Node},toStructure:function(e){throw(0,IA.newError)("It is not allowed to pass nodes in query parameters, given: ".concat(e),MA)},fromStructure:function(e){RA.structure.verifyStructSize("Node",3,e.size);var e=CA(e.fields,3),t=e[0];return new IA.Node(t,e[1],e[2])}})},createRelationshipTransformer:function(){return new AA.TypeTransformer({signature:82,isTypeInstance:function(e){return e instanceof IA.Relationship},toStructure:function(e){throw(0,IA.newError)("It is not allowed to pass relationships in query parameters, given: ".concat(e),MA)},fromStructure:function(e){RA.structure.verifyStructSize("Relationship",5,e.size);var e=CA(e.fields,5),t=e[0];return new IA.Relationship(t,e[1],e[2],e[3],e[4])}})},createUnboundRelationshipTransformer:function(){return new AA.TypeTransformer({signature:114,isTypeInstance:function(e){return e instanceof IA.UnboundRelationship},toStructure:function(e){throw(0,IA.newError)("It is not allowed to pass unbound relationships in query parameters, given: ".concat(e),MA)},fromStructure:function(e){RA.structure.verifyStructSize("UnboundRelationship",3,e.size);var e=CA(e.fields,3),t=e[0];return new IA.UnboundRelationship(t,e[1],e[2])}})},createPathTransformer:function(){return new AA.TypeTransformer({signature:80,isTypeInstance:function(e){return e instanceof IA.Path},toStructure:function(e){throw(0,IA.newError)("It is not allowed to pass paths in query parameters, given: ".concat(e),MA)},fromStructure:function(e){RA.structure.verifyStructSize("Path",3,e.size);for(var e=CA(e.fields,3),t=e[0],r=e[1],n=e[2],o=[],i=t[0],u=0;u<n.length;u+=2){var a=t[n[u+1]],s=(0,IA.toNumber)(n[u]),c=void 0;0<s?(c=r[s-1])instanceof IA.UnboundRelationship&&(r[s-1]=c=c.bindTo(i,a)):(c=r[-s-1])instanceof IA.UnboundRelationship&&(r[-s-1]=c=c.bindTo(a,i)),o.push(new IA.PathSegment(i,c,a)),i=a}return new IA.Path(t[0],t[t.length-1],o)}})},createVectorTransformer:function(){return new AA.TypeTransformer({signature:86,isTypeInstance:function(e){return e instanceof IA.Vector},toStructure:function(e){throw(0,IA.newError)("Sending vector types require server and driver to be communicating with Bolt protocol 6.0 or later. Please update your database version.")},fromStructure:function(e){throw(0,IA.newError)("Server tried to send Vector object, but server and driver are communicating on a version of the Bolt protocol that does not support vectors.")}})}};var NA,kA=r&&r.__assign||function(){return(kA=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},xA=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),DA=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),T0=r&&r.__importStar||(NA=function(e){return(NA=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=NA(e),n=0;n<r.length;n++)"default"!==r[n]&&xA(t,e,r[n]);return DA(t,e),t}),I0=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},UA=(Object.defineProperty(I_,"__esModule",{value:!0}),k_),LA=wm,FA=T0(l0),BA=A,VA=e,qA=I0(l),WA=I0(E0),zA=VA.internal.bookmarks.Bookmarks,M0=VA.internal.constants,HA=M0.ACCESS_MODE_WRITE,GA=M0.BOLT_PROTOCOL_V1,YA=(VA.internal.logger.Logger,VA.internal.txConfig.TxConfig),KA=Object.freeze({OPERATION:"",OPERATION_CODE:"0",CURRENT_SCHEMA:"/"}),x0=(Object.defineProperty(ZA.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new WA.default(Object.values(qA.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),Object.defineProperty(ZA.prototype,"version",{get:function(){return GA},enumerable:!1,configurable:!0}),Object.defineProperty(ZA.prototype,"supportsReAuth",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(ZA.prototype,"initialized",{get:function(){return!!this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(ZA.prototype,"authToken",{get:function(){return this._authToken},enumerable:!1,configurable:!0}),ZA.prototype.packer=function(){return this._packer},ZA.prototype.packable=function(e){return this._packer.packable(e,this.transformer.toStructure)},ZA.prototype.unpacker=function(){return this._unpacker},ZA.prototype.unpack=function(e){return this._unpacker.unpack(e,this.transformer.fromStructure)},ZA.prototype.transformMetadata=function(e){return e},ZA.prototype.enrichErrorMetadata=function(e){return kA(kA({},e),{diagnostic_record:null!==e.diagnostic_record?kA(kA({},KA),e.diagnostic_record):null})},ZA.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=e.authToken,o=e.notificationFilter,i=e.onError,u=e.onComplete,e=new BA.LoginObserver({onError:function(e){return t._onLoginError(e,i)},onCompleted:function(e){return t._onLoginCompleted(e,u)}});return(0,UA.assertNotificationFilterIsEmpty)(o,this._onProtocolError,e),this.write(FA.default.init(r,n),e,!0),e},ZA.prototype.logoff=function(e){var e=void 0===e?{}:e,t=e.onComplete,t=new BA.LogoffObserver({onCompleted:t,onError:e.onError}),e=(0,VA.newError)("Driver is connected to a database that does not support logoff. Please upgrade to Neo4j 5.5.0 or later in order to use this functionality.");throw this._onProtocolError(e.message),t.onError(e),e},ZA.prototype.logon=function(e){var t=this,e=void 0===e?{}:e,r=e.authToken,n=e.onComplete,o=e.onError,e=new BA.LoginObserver({onCompleted:function(){return t._onLoginCompleted({},r,n)},onError:function(e){return t._onLoginError(e,o)}}),i=(0,VA.newError)("Driver is connected to a database that does not support logon. Please upgrade to Neo4j 5.5.0 or later in order to use this functionality.");throw this._onProtocolError(i.message),e.onError(i),i},ZA.prototype.prepareToClose=function(){},ZA.prototype.beginTransaction=function(e){var e=void 0===e?{}:e,t=e.bookmarks,r=e.txConfig,n=e.database,o=e.mode,i=e.impersonatedUser,u=e.notificationFilter,a=e.beforeError,s=e.afterError,c=e.beforeComplete,e=e.afterComplete;return this.run("BEGIN",t?t.asBeginTransactionParameters():{},{bookmarks:t,txConfig:r,database:n,mode:o,impersonatedUser:i,notificationFilter:u,beforeError:a,afterError:s,beforeComplete:c,afterComplete:e,flush:!1})},ZA.prototype.commitTransaction=function(e){var e=void 0===e?{}:e,t=e.beforeError,r=e.afterError,n=e.beforeComplete,e=e.afterComplete;return this.run("COMMIT",{},{bookmarks:zA.empty(),txConfig:YA.empty(),mode:HA,beforeError:t,afterError:r,beforeComplete:n,afterComplete:e})},ZA.prototype.rollbackTransaction=function(e){var e=void 0===e?{}:e,t=e.beforeError,r=e.afterError,n=e.beforeComplete,e=e.afterComplete;return this.run("ROLLBACK",{},{bookmarks:zA.empty(),txConfig:YA.empty(),mode:HA,beforeError:t,afterError:r,beforeComplete:n,afterComplete:e})},ZA.prototype.run=function(e,t,r){var r=void 0===r?{}:r,n=(r.bookmarks,r.txConfig),o=r.database,i=r.impersonatedUser,u=r.notificationFilter,a=r.flush,a=void 0===a||a,s=r.highRecordWatermark,s=void 0===s?Number.MAX_VALUE:s,c=r.lowRecordWatermark,c=void 0===c?Number.MAX_VALUE:c,r=new BA.ResultStreamObserver({server:this._server,beforeKeys:r.beforeKeys,afterKeys:r.afterKeys,beforeError:r.beforeError,afterError:r.afterError,beforeComplete:r.beforeComplete,afterComplete:r.afterComplete,highRecordWatermark:s,lowRecordWatermark:c});return(0,UA.assertTxConfigIsEmpty)(n,this._onProtocolError,r),(0,UA.assertDatabaseIsEmpty)(o,this._onProtocolError,r),(0,UA.assertImpersonatedUserIsEmpty)(i,this._onProtocolError,r),(0,UA.assertNotificationFilterIsEmpty)(u,this._onProtocolError,r),this.write(FA.default.run(e,t),r,!1),this.write(FA.default.pullAll(),r,a),r},Object.defineProperty(ZA.prototype,"currentFailure",{get:function(){return this._responseHandler.currentFailure},enumerable:!1,configurable:!0}),ZA.prototype.reset=function(e){var e=void 0===e?{}:e,t=e.onError,t=new BA.ResetObserver({onProtocolError:this._onProtocolError,onError:t,onComplete:e.onComplete});return this.write(FA.default.reset(),t,!0),t},ZA.prototype.telemetry=function(e,t){e.api;e=void 0===t?{}:t,e.onError,t=e.onCompleted,e=new BA.CompletedObserver;return t&&t(),e},ZA.prototype._createPacker=function(e){return new LA.v1.Packer(e)},ZA.prototype._createUnpacker=function(e,t){return new LA.v1.Unpacker(e,t)},ZA.prototype.write=function(e,t,r){this._lastMessageSignature=e.signature;var n=new LA.structure.Structure(e.signature,e.fields);this.packable(n)(),this.queueObserverIfProtocolIsNotBroken(t)&&(this._log.isDebugEnabled()&&this._log.debug("C: ".concat(e)),this._chunker.messageBoundary(),r)&&this._chunker.flush()},ZA.prototype.isLastMessageLogon=function(){return this._lastMessageSignature===FA.SIGNATURES.HELLO||this._lastMessageSignature===FA.SIGNATURES.LOGON},ZA.prototype.isLastMessageReset=function(){return this._lastMessageSignature===FA.SIGNATURES.RESET},ZA.prototype.notifyFatalError=function(e){return this._fatalError=e,this._responseHandler._notifyErrorToObservers(e)},ZA.prototype.updateCurrentObserver=function(){return this._responseHandler._updateCurrentObserver()},ZA.prototype.hasOngoingObservableRequests=function(){return this._responseHandler.hasOngoingObservableRequests()},ZA.prototype.queueObserverIfProtocolIsNotBroken=function(e){return this.isBroken()?(this.notifyFatalErrorToObserver(e),!1):this._responseHandler._queueObserver(e)},ZA.prototype.isBroken=function(){return!!this._fatalError},ZA.prototype.notifyFatalErrorToObserver=function(e){e&&e.onError&&e.onError(this._fatalError,!1)},ZA.prototype.resetFailure=function(){this._responseHandler._resetFailure()},ZA.prototype._onLoginCompleted=function(e,t,r){this._initialized=!0,this._authToken=t,e&&(t=e.server,this._server.version||(this._server.version=t)),r&&r(e)},ZA.prototype._onLoginError=function(e,t){this._onProtocolError(e.message),t&&t(e)},ZA);function ZA(e,t,r,n,o,i){var r=void 0===r?{}:r,u=r.disableLosslessIntegers,r=r.useBigInt;void 0===n&&(n=function(){return null}),this._server=e||{},this._chunker=t,this._packer=this._createPacker(t),this._unpacker=this._createUnpacker(u,r),this._responseHandler=n(this),this._log=o,this._onProtocolError=i,this._fatalError=null,this._lastMessageSignature=null,this._config={disableLosslessIntegers:u,useBigInt:r}}I_.default=x0;var t={},F0={},Iy={},QA=(Object.defineProperty(Iy,"__esModule",{value:!0}),Iy.epochDayToDate=iM,Iy.nanoOfDayToLocalTime=uM,Iy.epochSecondAndNanoToLocalDateTime=function(e,t){var r=nM(e,rM),e=oM(e,rM).multiply(tM).add(t),t=iM(r),r=uM(e);return new QA.LocalDateTime(t.year,t.month,t.day,r.hour,r.minute,r.second,r.nanosecond)},e),H0=QA.internal.temporalUtil,XA=H0.DAYS_0000_TO_1970,JA=H0.DAYS_PER_400_YEAR_CYCLE,$A=H0.NANOS_PER_HOUR,eM=H0.NANOS_PER_MINUTE,tM=H0.NANOS_PER_SECOND,rM=H0.SECONDS_PER_DAY,nM=H0.floorDiv,oM=H0.floorMod;function iM(e){var e=(e=(0,QA.int)(e)).add(XA).subtract(60),t=(0,QA.int)(0),r=(e.lessThan(0)&&(t=(r=e.add(1).div(JA).subtract(1)).multiply(400),e=e.add(r.multiply(-JA))),e.multiply(400).add(591).div(JA)),n=e.subtract(r.multiply(365).add(r.div(4)).subtract(r.div(100)).add(r.div(400))),e=(n.lessThan(0)&&(r=r.subtract(1),n=e.subtract(r.multiply(365).add(r.div(4)).subtract(r.div(100)).add(r.div(400)))),r=r.add(t),n),t=e.multiply(5).add(2).div(153),n=t.add(2).modulo(12).add(1),e=e.subtract(t.multiply(306).add(5).div(10)).add(1),r=r.add(t.div(10));return new QA.Date(r,n,e)}function uM(e){var t=(e=(0,QA.int)(e)).div($A),r=(e=e.subtract(t.multiply($A))).div(eM),n=(e=e.subtract(r.multiply(eM))).div(tM),e=e.subtract(n.multiply(tM));return new QA.LocalTime(t,r,n,e)}var aM=r&&r.__assign||function(){return(aM=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},sM=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},X0=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},cM=(Object.defineProperty(F0,"__esModule",{value:!0}),e),lM=wm,fM=E0,pM=Iy,rg=X0(l),sg=cM.internal.temporalUtil,dM=sg.dateToEpochDay,hM=sg.localDateTimeToEpochSecond,bM=sg.localTimeToNanoOfDay;function yM(e,t,r){if(!t&&!r)return e;var n,o,i,u=Object.create(Object.getPrototypeOf(e));for(n in e)!0===Object.prototype.hasOwnProperty.call(e,n)&&(o=e[n],u[n]=(0,cM.isInt)(o)?(i=o,r?i.toBigInt():i.toNumberOrInfinity()):o);return Object.freeze(u),u}F0.default=aM(aM({},rg.default),{createPoint2DTransformer:function(){return new fM.TypeTransformer({signature:88,isTypeInstance:function(e){return(0,cM.isPoint)(e)&&null==e.z},toStructure:function(e){return new lM.structure.Structure(88,[(0,cM.int)(e.srid),e.x,e.y])},fromStructure:function(e){lM.structure.verifyStructSize("Point2D",3,e.size);var e=sM(e.fields,3),t=e[0];return new cM.Point(t,e[1],e[2],void 0)}})},createPoint3DTransformer:function(){return new fM.TypeTransformer({signature:89,isTypeInstance:function(e){return(0,cM.isPoint)(e)&&null!=e.z},toStructure:function(e){return new lM.structure.Structure(89,[(0,cM.int)(e.srid),e.x,e.y,e.z])},fromStructure:function(e){lM.structure.verifyStructSize("Point3D",4,e.size);var e=sM(e.fields,4),t=e[0];return new cM.Point(t,e[1],e[2],e[3])}})},createDurationTransformer:function(){return new fM.TypeTransformer({signature:69,isTypeInstance:cM.isDuration,toStructure:function(e){var t=(0,cM.int)(e.months),r=(0,cM.int)(e.days),n=(0,cM.int)(e.seconds),e=(0,cM.int)(e.nanoseconds);return new lM.structure.Structure(69,[t,r,n,e])},fromStructure:function(e){lM.structure.verifyStructSize("Duration",4,e.size);var e=sM(e.fields,4),t=e[0];return new cM.Duration(t,e[1],e[2],e[3])}})},createLocalTimeTransformer:function(e){var t=e.disableLosslessIntegers,r=e.useBigInt;return new fM.TypeTransformer({signature:116,isTypeInstance:cM.isLocalTime,toStructure:function(e){e=bM(e.hour,e.minute,e.second,e.nanosecond);return new lM.structure.Structure(116,[e])},fromStructure:function(e){lM.structure.verifyStructSize("LocalTime",1,e.size);e=sM(e.fields,1)[0];return yM((0,pM.nanoOfDayToLocalTime)(e),t,r)}})},createTimeTransformer:function(e){var r=e.disableLosslessIntegers,n=e.useBigInt;return new fM.TypeTransformer({signature:84,isTypeInstance:cM.isTime,toStructure:function(e){var t=bM(e.hour,e.minute,e.second,e.nanosecond),e=(0,cM.int)(e.timeZoneOffsetSeconds);return new lM.structure.Structure(84,[t,e])},fromStructure:function(e){lM.structure.verifyStructSize("Time",2,e.size);var e=sM(e.fields,2),t=e[0],e=e[1],t=(0,pM.nanoOfDayToLocalTime)(t);return yM(new cM.Time(t.hour,t.minute,t.second,t.nanosecond,e),r,n)}})},createDateTransformer:function(e){var t=e.disableLosslessIntegers,r=e.useBigInt;return new fM.TypeTransformer({signature:68,isTypeInstance:cM.isDate,toStructure:function(e){e=dM(e.year,e.month,e.day);return new lM.structure.Structure(68,[e])},fromStructure:function(e){lM.structure.verifyStructSize("Date",1,e.size);e=sM(e.fields,1)[0];return yM((0,pM.epochDayToDate)(e),t,r)}})},createLocalDateTimeTransformer:function(e){var r=e.disableLosslessIntegers,n=e.useBigInt;return new fM.TypeTransformer({signature:100,isTypeInstance:cM.isLocalDateTime,toStructure:function(e){var t=hM(e.year,e.month,e.day,e.hour,e.minute,e.second,e.nanosecond),e=(0,cM.int)(e.nanosecond);return new lM.structure.Structure(100,[t,e])},fromStructure:function(e){lM.structure.verifyStructSize("LocalDateTime",2,e.size);var e=sM(e.fields,2),t=e[0];return yM((0,pM.epochSecondAndNanoToLocalDateTime)(t,e[1]),r,n)}})},createDateTimeWithZoneIdTransformer:function(e){var n=e.disableLosslessIntegers,o=e.useBigInt;return new fM.TypeTransformer({signature:102,isTypeInstance:function(e){return(0,cM.isDateTime)(e)&&null!=e.timeZoneId},toStructure:function(e){var t=hM(e.year,e.month,e.day,e.hour,e.minute,e.second,e.nanosecond),r=(0,cM.int)(e.nanosecond),e=e.timeZoneId;return new lM.structure.Structure(102,[t,r,e])},fromStructure:function(e){lM.structure.verifyStructSize("DateTimeWithZoneId",3,e.size);var e=sM(e.fields,3),t=e[0],r=e[2],t=(0,pM.epochSecondAndNanoToLocalDateTime)(t,e[1]);return yM(new cM.DateTime(t.year,t.month,t.day,t.hour,t.minute,t.second,t.nanosecond,null,r),n,o)}})},createDateTimeWithOffsetTransformer:function(e){var n=e.disableLosslessIntegers,o=e.useBigInt;return new fM.TypeTransformer({signature:70,isTypeInstance:function(e){return(0,cM.isDateTime)(e)&&null==e.timeZoneId},toStructure:function(e){var t=hM(e.year,e.month,e.day,e.hour,e.minute,e.second,e.nanosecond),r=(0,cM.int)(e.nanosecond),e=(0,cM.int)(e.timeZoneOffsetSeconds);return new lM.structure.Structure(70,[t,r,e])},fromStructure:function(e){lM.structure.verifyStructSize("DateTimeWithZoneOffset",3,e.size);var e=sM(e.fields,3),t=e[0],r=e[2],t=(0,pM.epochSecondAndNanoToLocalDateTime)(t,e[1]);return yM(new cM.DateTime(t.year,t.month,t.day,t.hour,t.minute,t.second,t.nanosecond,r,null),n,o)}})}});var _M,vM,Gt=r&&r.__extends||(_M=function(e,t){return(_M=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}_M(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),dg=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},vg=(Object.defineProperty(t,"__esModule",{value:!0}),dg(I_)),mM=dg(wm),wg=e,gM=dg(F0),OM=dg(E0),wM=wg.internal.constants.BOLT_PROTOCOL_V2,Ry=(vM=vg.default,Gt(EM,vM),EM.prototype._createPacker=function(e){return new mM.default.Packer(e)},EM.prototype._createUnpacker=function(e,t){return new mM.default.Unpacker(e,t)},Object.defineProperty(EM.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new OM.default(Object.values(gM.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),Object.defineProperty(EM.prototype,"version",{get:function(){return wM},enumerable:!1,configurable:!0}),EM);function EM(){return null!==vM&&vM.apply(this,arguments)||this}t.default=Ry;var PM,TM,Ig={},Ug={},SM=r&&r.__assign||function(){return(SM=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Bg=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Gg=(Object.defineProperty(Ug,"__esModule",{value:!0}),Bg(F0)),Kg=(Ug.default=SM({},Gg.default),r&&r.__extends||(PM=function(e,t){return(PM=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}PM(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),jM=r&&r.__assign||function(){return(jM=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Jg=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},nO=(Object.defineProperty(Ig,"__esModule",{value:!0}),Jg(t)),CM=Jg(l0),IM=k_,RM=A,AM=Jg(Ug),MM=Jg(E0),NM=(e.internal.bookmarks.Bookmarks,e.internal.constants.BOLT_PROTOCOL_V3),kM=e.internal.txConfig.TxConfig,xM="context",DM="CALL dbms.cluster.routing.getRoutingTable($".concat(xM,")"),UM=new RM.StreamObserver,uO=(TM=nO.default,Kg(LM,TM),Object.defineProperty(LM.prototype,"version",{get:function(){return NM},enumerable:!1,configurable:!0}),Object.defineProperty(LM.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new MM.default(Object.values(AM.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),LM.prototype.transformMetadata=function(e){return"t_first"in e&&(e.result_available_after=e.t_first,delete e.t_first),"t_last"in e&&(e.result_consumed_after=e.t_last,delete e.t_last),e},LM.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=e.authToken,o=e.notificationFilter,i=e.onError,u=e.onComplete,e=new RM.LoginObserver({onError:function(e){return t._onLoginError(e,i)},onCompleted:function(e){return t._onLoginCompleted(e,n,u)}});return(0,IM.assertNotificationFilterIsEmpty)(o,this._onProtocolError,e),this.write(CM.default.hello(r,n),e,!0),e},LM.prototype.prepareToClose=function(){this.write(CM.default.goodbye(),UM,!0)},LM.prototype.beginTransaction=function(e){var e=void 0===e?{}:e,t=e.bookmarks,r=e.txConfig,n=e.database,o=e.impersonatedUser,i=e.notificationFilter,u=e.mode,e=new RM.ResultStreamObserver({server:this._server,beforeError:e.beforeError,afterError:e.afterError,beforeComplete:e.beforeComplete,afterComplete:e.afterComplete});return e.prepareToHandleSingleResponse(),(0,IM.assertDatabaseIsEmpty)(n,this._onProtocolError,e),(0,IM.assertImpersonatedUserIsEmpty)(o,this._onProtocolError,e),(0,IM.assertNotificationFilterIsEmpty)(i,this._onProtocolError,e),this.write(CM.default.begin({bookmarks:t,txConfig:r,mode:u}),e,!0),e},LM.prototype.commitTransaction=function(e){var e=void 0===e?{}:e,t=e.beforeError,t=new RM.ResultStreamObserver({server:this._server,beforeError:t,afterError:e.afterError,beforeComplete:e.beforeComplete,afterComplete:e.afterComplete});return t.prepareToHandleSingleResponse(),this.write(CM.default.commit(),t,!0),t},LM.prototype.rollbackTransaction=function(e){var e=void 0===e?{}:e,t=e.beforeError,t=new RM.ResultStreamObserver({server:this._server,beforeError:t,afterError:e.afterError,beforeComplete:e.beforeComplete,afterComplete:e.afterComplete});return t.prepareToHandleSingleResponse(),this.write(CM.default.rollback(),t,!0),t},LM.prototype.run=function(e,t,r){var r=void 0===r?{}:r,n=r.bookmarks,o=r.txConfig,i=r.database,u=r.impersonatedUser,a=r.notificationFilter,s=r.mode,c=r.flush,c=void 0===c||c,l=r.highRecordWatermark,l=void 0===l?Number.MAX_VALUE:l,f=r.lowRecordWatermark,f=void 0===f?Number.MAX_VALUE:f,r=new RM.ResultStreamObserver({server:this._server,beforeKeys:r.beforeKeys,afterKeys:r.afterKeys,beforeError:r.beforeError,afterError:r.afterError,beforeComplete:r.beforeComplete,afterComplete:r.afterComplete,highRecordWatermark:l,lowRecordWatermark:f});return(0,IM.assertDatabaseIsEmpty)(i,this._onProtocolError,r),(0,IM.assertImpersonatedUserIsEmpty)(u,this._onProtocolError,r),(0,IM.assertNotificationFilterIsEmpty)(a,this._onProtocolError,r),this.write(CM.default.runWithMetadata(e,t,{bookmarks:n,txConfig:o,mode:s}),r,!1),this.write(CM.default.pullAll(),r,c),r},LM.prototype.requestRoutingInformation=function(e){var t,r=e.routingContext,n=e.sessionContext,n=void 0===n?{}:n,o=e.onError,e=e.onCompleted,r=this.run(DM,((t={})[xM]=void 0===r?{}:r,t),jM(jM({},n),{txConfig:kM.empty()}));return new RM.ProcedureRouteObserver({resultObserver:r,onProtocolError:this._onProtocolError,onError:o,onCompleted:e})},LM);function LM(){return null!==TM&&TM.apply(this,arguments)||this}Ig.default=uO;var FM,BM,Yf={},lO={},VM=r&&r.__assign||function(){return(VM=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},fO=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},_O=(Object.defineProperty(lO,"__esModule",{value:!0}),fO(Ug)),gO=(lO.default=VM({},_O.default),r&&r.__extends||(FM=function(e,t){return(FM=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}FM(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),qM=r&&r.__assign||function(){return(qM=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},q_=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Sm=(Object.defineProperty(Yf,"__esModule",{value:!0}),q_(Ig)),WM=q_(l0),zM=k_,HM=A,GM=q_(lO),YM=q_(E0),EO=(e.internal.bookmarks.Bookmarks,e.internal.constants),KM=EO.BOLT_PROTOCOL_V4_0,ZM=EO.FETCH_ALL,QM=e.internal.txConfig.TxConfig,XM="context",JM="database",$M="CALL dbms.routing.getRoutingTable($".concat(XM,", $").concat(JM,")"),CO=(BM=Sm.default,gO(eN,BM),Object.defineProperty(eN.prototype,"version",{get:function(){return KM},enumerable:!1,configurable:!0}),Object.defineProperty(eN.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new YM.default(Object.values(GM.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),eN.prototype.beginTransaction=function(e){var e=void 0===e?{}:e,t=e.bookmarks,r=e.txConfig,n=e.database,o=e.impersonatedUser,i=e.notificationFilter,u=e.mode,e=new HM.ResultStreamObserver({server:this._server,beforeError:e.beforeError,afterError:e.afterError,beforeComplete:e.beforeComplete,afterComplete:e.afterComplete});return e.prepareToHandleSingleResponse(),(0,zM.assertImpersonatedUserIsEmpty)(o,this._onProtocolError,e),(0,zM.assertNotificationFilterIsEmpty)(i,this._onProtocolError,e),this.write(WM.default.begin({bookmarks:t,txConfig:r,database:n,mode:u}),e,!0),e},eN.prototype.run=function(e,t,r){var r=void 0===r?{}:r,n=r.bookmarks,o=r.txConfig,i=r.database,u=r.impersonatedUser,a=r.notificationFilter,s=r.mode,c=r.beforeKeys,l=r.afterKeys,f=r.beforeError,p=r.afterError,d=r.beforeComplete,h=r.afterComplete,b=r.flush,b=void 0===b||b,y=r.reactive,y=void 0!==y&&y,_=r.fetchSize,_=void 0===_?ZM:_,v=r.highRecordWatermark,v=void 0===v?Number.MAX_VALUE:v,r=r.lowRecordWatermark,r=void 0===r?Number.MAX_VALUE:r,c=new HM.ResultStreamObserver({server:this._server,reactive:y,fetchSize:_,moreFunction:this._requestMore.bind(this),discardFunction:this._requestDiscard.bind(this),beforeKeys:c,afterKeys:l,beforeError:f,afterError:p,beforeComplete:d,afterComplete:h,highRecordWatermark:v,lowRecordWatermark:r}),l=((0,zM.assertImpersonatedUserIsEmpty)(u,this._onProtocolError,c),(0,zM.assertNotificationFilterIsEmpty)(a,this._onProtocolError,c),y);return this.write(WM.default.runWithMetadata(e,t,{bookmarks:n,txConfig:o,database:i,mode:s}),c,l&&b),y||this.write(WM.default.pull({n:_}),c,b),c},eN.prototype._requestMore=function(e,t,r){this.write(WM.default.pull({stmtId:e,n:t}),r,!0)},eN.prototype._requestDiscard=function(e,t){this.write(WM.default.discard({stmtId:e}),t,!0)},eN.prototype._noOp=function(){},eN.prototype.requestRoutingInformation=function(e){var t,r=e.routingContext,n=e.databaseName,n=void 0===n?null:n,o=e.sessionContext,o=void 0===o?{}:o,i=e.onError,e=e.onCompleted,r=this.run($M,((t={})[XM]=void 0===r?{}:r,t[JM]=n,t),qM(qM({},o),{txConfig:QM.empty()}));return new HM.ProcedureRouteObserver({resultObserver:r,onProtocolError:this._onProtocolError,onError:i,onCompleted:e})},eN);function eN(){return null!==BM&&BM.apply(this,arguments)||this}Yf.default=CO;var tN,rN,AO={},_={},nN=r&&r.__assign||function(){return(nN=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},FO=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Pv=(Object.defineProperty(_,"__esModule",{value:!0}),FO(lO)),WO=(_.default=nN({},Pv.default),r&&r.__extends||(tN=function(e,t){return(tN=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}tN(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),_f=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},KO=(Object.defineProperty(AO,"__esModule",{value:!0}),_f(Yf)),oN=_f(l0),iN=A,rp=e,uN=k_,aN=_f(_),sN=_f(E0),cN=rp.internal.constants.BOLT_PROTOCOL_V4_1,Cy=(rN=KO.default,WO(lN,rN),Object.defineProperty(lN.prototype,"version",{get:function(){return cN},enumerable:!1,configurable:!0}),Object.defineProperty(lN.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new sN.default(Object.values(aN.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),lN.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=e.authToken,o=e.notificationFilter,i=e.onError,u=e.onComplete,e=new iN.LoginObserver({onError:function(e){return t._onLoginError(e,i)},onCompleted:function(e){return t._onLoginCompleted(e,n,u)}});return(0,uN.assertNotificationFilterIsEmpty)(o,this._onProtocolError,e),this.write(oN.default.hello(r,n,this._serversideRouting),e,!0),e},lN);function lN(e,t,r,n,o,i,u){e=rN.call(this,e,t,r,n=void 0===n?function(){return null}:n,o,i)||this;return e._serversideRouting=u,e}AO.default=Cy;var fN,pN,Rt={},iw={},dN=r&&r.__assign||function(){return(dN=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},lw=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Wf=(Object.defineProperty(iw,"__esModule",{value:!0}),lw(_)),E=(iw.default=dN({},Wf.default),r&&r.__extends||(fN=function(e,t){return(fN=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}fN(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),Aw=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},p=(Object.defineProperty(Rt,"__esModule",{value:!0}),Aw(AO)),b=e,hN=Aw(iw),bN=Aw(E0),yN=b.internal.constants.BOLT_PROTOCOL_V4_2,C=(pN=p.default,E(_N,pN),Object.defineProperty(_N.prototype,"version",{get:function(){return yN},enumerable:!1,configurable:!0}),Object.defineProperty(_N.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new bN.default(Object.values(hN.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),_N);function _N(){return null!==pN&&pN.apply(this,arguments)||this}Rt.default=C;var T={},P={},vN=r&&r.__assign||function(){return(vN=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Ar=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},bo=(Object.defineProperty(P,"__esModule",{value:!0}),Ar(iw)),w=(P.default=vN({},bo.default),{}),ro={},mN=r&&r.__assign||function(){return(mN=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},so=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},m=(Object.defineProperty(ro,"__esModule",{value:!0}),so(P)),gN=(ro.default=mN({},m.default),r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u}),Uo=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ON=(Object.defineProperty(w,"__esModule",{value:!0}),wm),wN=e,EN=Uo(ro),PN=Iy,TN=Ov,SN=wN.internal.temporalUtil.localDateTimeToEpochSecond;var jN=new Map;function CN(e,t,r){e=e,jN.has(e)||(n=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1,era:"narrow"}),jN.set(e,n));var n=jN.get(e),e=(0,wN.int)(t).multiply(1e3).add((0,wN.int)(r).div(1e6)).toNumber(),r=n.formatToParts(e).reduce(function(e,t){return"era"===t.type?e.adjustEra="B"===t.value.toUpperCase()?function(e){return e.subtract(1).negate()}:TN.identity:"hour"===t.type?e.hour=(0,wN.int)(t.value).modulo(24):"literal"!==t.type&&(e[t.type]=(0,wN.int)(t.value)),e},{}),e=(r.year=r.adjustEra(r.year),SN(r.year,r.month,r.day,r.hour,r.minute,r.second,r.nanosecond));return r.timeZoneOffsetSeconds=e.subtract(t),r.hour=r.hour.modulo(24),r}function IN(e,t,r){if(!t&&!r)return e;var n,o,i,u=Object.create(Object.getPrototypeOf(e));for(n in e)!0===Object.prototype.hasOwnProperty.call(e,n)&&(o=e[n],u[n]=(0,wN.isInt)(o)?(i=o,r?i.toBigInt():i.toNumberOrInfinity()):o);return Object.freeze(u),u}w.default={createDateTimeWithZoneIdTransformer:function(e,u){var n=e.disableLosslessIntegers,o=e.useBigInt;return EN.default.createDateTimeWithZoneIdTransformer(e).extendsWith({signature:105,fromStructure:function(e){ON.structure.verifyStructSize("DateTimeWithZoneId",3,e.size);var e=gN(e.fields,3),t=e[0],r=e[1],e=e[2],t=CN(e,t,r);return IN(new wN.DateTime(t.year,t.month,t.day,t.hour,t.minute,t.second,(0,wN.int)(r),t.timeZoneOffsetSeconds,e),n,o)},toStructure:function(e){var t=SN(e.year,e.month,e.day,e.hour,e.minute,e.second,e.nanosecond),r=null!=e.timeZoneOffsetSeconds?e.timeZoneOffsetSeconds:(r=e.timeZoneId,n=CN(r,i=t,o=e.nanosecond),n=SN(n.year,n.month,n.day,n.hour,n.minute,n.second,o).subtract(i),i=i.subtract(n),n=CN(r,i,o),SN(n.year,n.month,n.day,n.hour,n.minute,n.second,o).subtract(i)),n=(null==e.timeZoneOffsetSeconds&&u.warn('DateTime objects without "timeZoneOffsetSeconds" property are prune to bugs related to ambiguous times. For instance, 2022-10-30T2:30:00[Europe/Berlin] could be GMT+1 or GMT+2.'),t.subtract(r)),o=(0,wN.int)(e.nanosecond),i=e.timeZoneId;return new ON.structure.Structure(105,[n,o,i])}})},createDateTimeWithOffsetTransformer:function(e){var n=e.disableLosslessIntegers,o=e.useBigInt;return EN.default.createDateTimeWithOffsetTransformer(e).extendsWith({signature:73,toStructure:function(e){var t=SN(e.year,e.month,e.day,e.hour,e.minute,e.second,e.nanosecond),r=(0,wN.int)(e.nanosecond),e=(0,wN.int)(e.timeZoneOffsetSeconds),t=t.subtract(e);return new ON.structure.Structure(73,[t,r,e])},fromStructure:function(e){ON.structure.verifyStructSize("DateTimeWithZoneOffset",3,e.size);var e=gN(e.fields,3),t=e[0],r=e[1],e=e[2],t=(0,wN.int)(t).add(e),t=(0,PN.epochSecondAndNanoToLocalDateTime)(t,r);return IN(new wN.DateTime(t.year,t.month,t.day,t.hour,t.minute,t.second,t.nanosecond,e,null),n,o)}})}};var RN,AN,o=r&&r.__extends||(RN=function(e,t){return(RN=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}RN(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),MN=r&&r.__assign||function(){return(MN=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},y=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ao=(Object.defineProperty(T,"__esModule",{value:!0}),y(Rt)),NN=y(l0),kN=A,xN=k_,DN=y(P),UN=y(w),LN=y(E0),FN=e.internal.bookmarks.Bookmarks,BN=e.internal.constants.BOLT_PROTOCOL_V4_3,Zn=(AN=ao.default,o(VN,AN),Object.defineProperty(VN.prototype,"version",{get:function(){return BN},enumerable:!1,configurable:!0}),Object.defineProperty(VN.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new LN.default(Object.values(DN.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),VN.prototype.requestRoutingInformation=function(e){var t=e.routingContext,t=void 0===t?{}:t,r=e.databaseName,r=void 0===r?null:r,n=e.sessionContext,n=void 0===n?{}:n,e=new kN.RouteObserver({onProtocolError:this._onProtocolError,onError:e.onError,onCompleted:e.onCompleted}),n=n.bookmarks||FN.empty();return this.write(NN.default.route(t,n.values(),r),e,!0),e},VN.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=e.authToken,o=e.notificationFilter,i=e.onError,u=e.onComplete,e=new kN.LoginObserver({onError:function(e){return t._onLoginError(e,i)},onCompleted:function(e){return void 0!==e.patch_bolt&&t._applyPatches(e.patch_bolt),t._onLoginCompleted(e,n,u)}});return(0,xN.assertNotificationFilterIsEmpty)(o,this._onProtocolError,e),this.write(NN.default.hello(r,n,this._serversideRouting,["utc"]),e,!0),e},VN.prototype._applyPatches=function(e){e.includes("utc")&&this._applyUtcPatch()},VN.prototype._applyUtcPatch=function(){var t=this;this._transformer=new LN.default(Object.values(MN(MN({},DN.default),UN.default)).map(function(e){return e(t._config,t._log)}))},VN);function VN(){return null!==AN&&AN.apply(this,arguments)||this}T.default=Zn;var qN,WN,i={},ff=r&&r.__extends||(qN=function(e,t){return(qN=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}qN(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),zN=r&&r.__assign||function(){return(zN=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},fp=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},v=(Object.defineProperty(i,"__esModule",{value:!0}),fp(T)),nf=e,HN=fp(l0),GN=A,YN=k_,KN=fp(ro),ZN=fp(w),QN=fp(E0),Jf=nf.internal.constants,XN=Jf.BOLT_PROTOCOL_V4_4,JN=Jf.FETCH_ALL,$N=nf.internal.bookmarks.Bookmarks,uf=(WN=v.default,ff(e2,WN),Object.defineProperty(e2.prototype,"version",{get:function(){return XN},enumerable:!1,configurable:!0}),Object.defineProperty(e2.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new QN.default(Object.values(KN.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),e2.prototype.requestRoutingInformation=function(e){var t=e.routingContext,t=void 0===t?{}:t,r=e.databaseName,r=void 0===r?null:r,n=e.impersonatedUser,n=void 0===n?null:n,o=e.sessionContext,o=void 0===o?{}:o,e=new GN.RouteObserver({onProtocolError:this._onProtocolError,onError:e.onError,onCompleted:e.onCompleted}),o=o.bookmarks||$N.empty();return this.write(HN.default.routeV4x4(t,o.values(),{databaseName:r,impersonatedUser:n}),e,!0),e},e2.prototype.run=function(e,t,r){var r=void 0===r?{}:r,n=r.bookmarks,o=r.txConfig,i=r.database,u=r.mode,a=r.impersonatedUser,s=r.notificationFilter,c=r.beforeKeys,l=r.afterKeys,f=r.beforeError,p=r.afterError,d=r.beforeComplete,h=r.afterComplete,b=r.flush,b=void 0===b||b,y=r.reactive,y=void 0!==y&&y,_=r.fetchSize,_=void 0===_?JN:_,v=r.highRecordWatermark,v=void 0===v?Number.MAX_VALUE:v,r=r.lowRecordWatermark,r=void 0===r?Number.MAX_VALUE:r,c=new GN.ResultStreamObserver({server:this._server,reactive:y,fetchSize:_,moreFunction:this._requestMore.bind(this),discardFunction:this._requestDiscard.bind(this),beforeKeys:c,afterKeys:l,beforeError:f,afterError:p,beforeComplete:d,afterComplete:h,highRecordWatermark:v,lowRecordWatermark:r}),l=((0,YN.assertNotificationFilterIsEmpty)(s,this._onProtocolError,c),y);return this.write(HN.default.runWithMetadata(e,t,{bookmarks:n,txConfig:o,database:i,mode:u,impersonatedUser:a}),c,l&&b),y||this.write(HN.default.pull({n:_}),c,b),c},e2.prototype.beginTransaction=function(e){var e=void 0===e?{}:e,t=e.bookmarks,r=e.txConfig,n=e.database,o=e.mode,i=e.impersonatedUser,u=e.notificationFilter,e=new GN.ResultStreamObserver({server:this._server,beforeError:e.beforeError,afterError:e.afterError,beforeComplete:e.beforeComplete,afterComplete:e.afterComplete});return e.prepareToHandleSingleResponse(),(0,YN.assertNotificationFilterIsEmpty)(u,this._onProtocolError,e),this.write(HN.default.begin({bookmarks:t,txConfig:r,database:n,mode:o,impersonatedUser:i}),e,!0),e},e2.prototype._applyUtcPatch=function(){var t=this;this._transformer=new QN.default(Object.values(zN(zN({},KN.default),ZN.default)).map(function(e){return e(t._config,t._log)}))},e2);function e2(){return null!==WN&&WN.apply(this,arguments)||this}i.default=uf;var pf={},g={},t2=r&&r.__assign||function(){return(t2=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},r2=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},cf=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},n2=(Object.defineProperty(g,"__esModule",{value:!0}),wm),o2=e,i2=cf(ro),bd=cf(w);g.default=t2(t2(t2({},i2.default),bd.default),{createNodeTransformer:function(e){return i2.default.createNodeTransformer(e).extendsWith({fromStructure:function(e){n2.structure.verifyStructSize("Node",4,e.size);var e=r2(e.fields,4),t=e[0];return new o2.Node(t,e[1],e[2],e[3])}})},createRelationshipTransformer:function(e){return i2.default.createRelationshipTransformer(e).extendsWith({fromStructure:function(e){n2.structure.verifyStructSize("Relationship",8,e.size);var e=r2(e.fields,8),t=e[0];return new o2.Relationship(t,e[1],e[2],e[3],e[4],e[5],e[6],e[7])}})},createUnboundRelationshipTransformer:function(e){return i2.default.createUnboundRelationshipTransformer(e).extendsWith({fromStructure:function(e){n2.structure.verifyStructSize("UnboundRelationship",4,e.size);var e=r2(e.fields,4),t=e[0];return new o2.UnboundRelationship(t,e[1],e[2],e[3])}})}});var u2,a2,wd=r&&r.__extends||(u2=function(e,t){return(u2=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}u2(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),rf=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},op=(Object.defineProperty(pf,"__esModule",{value:!0}),rf(i)),s2=k_,c2=rf(g),l2=rf(E0),f2=rf(l0),p2=A,d2=e.internal.constants.BOLT_PROTOCOL_V5_0,O=(a2=op.default,wd(h2,a2),Object.defineProperty(h2.prototype,"version",{get:function(){return d2},enumerable:!1,configurable:!0}),Object.defineProperty(h2.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new l2.default(Object.values(c2.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),h2.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=e.authToken,o=e.notificationFilter,i=e.onError,u=e.onComplete,e=new p2.LoginObserver({onError:function(e){return t._onLoginError(e,i)},onCompleted:function(e){return t._onLoginCompleted(e,n,u)}});return(0,s2.assertNotificationFilterIsEmpty)(o,this._onProtocolError,e),this.write(f2.default.hello(r,n,this._serversideRouting),e,!0),e},h2);function h2(){return null!==a2&&a2.apply(this,arguments)||this}pf.default=O;var b2,y2,Qh={},ob={},_2=r&&r.__assign||function(){return(_2=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},I=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},mb=(Object.defineProperty(ob,"__esModule",{value:!0}),I(g)),tf=(ob.default=_2({},mb.default),r&&r.__extends||(b2=function(e,t){return(b2=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}b2(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),v2=r&&r.__assign||function(){return(v2=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},db=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Dh=(Object.defineProperty(Qh,"__esModule",{value:!0}),db(pf)),m2=k_,g2=db(ob),O2=db(E0),w2=db(l0),E2=A,P2=e.internal.constants.BOLT_PROTOCOL_V5_1,wb=(y2=Dh.default,tf(T2,y2),Object.defineProperty(T2.prototype,"version",{get:function(){return P2},enumerable:!1,configurable:!0}),Object.defineProperty(T2.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new O2.default(Object.values(g2.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),Object.defineProperty(T2.prototype,"supportsReAuth",{get:function(){return!0},enumerable:!1,configurable:!0}),T2.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=e.authToken,o=e.notificationFilter,i=e.onError,u=e.onComplete,a={},e=new E2.LoginObserver({onError:function(e){return t._onLoginError(e,i)},onCompleted:function(e){return a.metadata=e,t._onLoginCompleted(e)}});return(0,m2.assertNotificationFilterIsEmpty)(o,this._onProtocolError,e),this.write(w2.default.hello5x1(r,this._serversideRouting),e,!1),this.logon({authToken:n,onComplete:function(e){return u(v2(v2({},e),a.metadata))},onError:i,flush:!0})},T2.prototype.logon=function(e){var t=this,e=void 0===e?{}:e,r=e.authToken,n=e.onComplete,o=e.onError,e=e.flush,i=new E2.LoginObserver({onCompleted:function(){return t._onLoginCompleted(null,r,n)},onError:function(e){return t._onLoginError(e,o)}});return this.write(w2.default.logon(r),i,e),i},T2.prototype.logoff=function(e){var e=void 0===e?{}:e,t=e.onComplete,r=e.flush,t=new E2.LogoffObserver({onCompleted:t,onError:e.onError});return this.write(w2.default.logoff(),t,r),t},T2);function T2(){return null!==y2&&y2.apply(this,arguments)||this}Qh.default=wb;var S2,j2,ef={},n={},C2=r&&r.__assign||function(){return(C2=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Zh=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ah=(Object.defineProperty(n,"__esModule",{value:!0}),Zh(ob)),Sb=(n.default=C2({},ah.default),r&&r.__extends||(S2=function(e,t){return(S2=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}S2(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),I2=r&&r.__assign||function(){return(I2=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},xb=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},h=(Object.defineProperty(ef,"__esModule",{value:!0}),xb(Qh)),R2=xb(n),A2=xb(E0),M2=xb(l0),N2=A,Wr=e.internal.constants,k2=Wr.BOLT_PROTOCOL_V5_2,x2=Wr.FETCH_ALL,R=(j2=h.default,Sb(D2,j2),Object.defineProperty(D2.prototype,"version",{get:function(){return k2},enumerable:!1,configurable:!0}),Object.defineProperty(D2.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new A2.default(Object.values(R2.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),Object.defineProperty(D2.prototype,"supportsReAuth",{get:function(){return!0},enumerable:!1,configurable:!0}),D2.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=e.authToken,o=e.notificationFilter,i=e.onError,u=e.onComplete,a={},e=new N2.LoginObserver({onError:function(e){return t._onLoginError(e,i)},onCompleted:function(e){return a.metadata=e,t._onLoginCompleted(e)}});return this.write(M2.default.hello5x2(r,o,this._serversideRouting),e,!1),this.logon({authToken:n,onComplete:function(e){return u(I2(I2({},e),a.metadata))},onError:i,flush:!0})},D2.prototype.beginTransaction=function(e){var e=void 0===e?{}:e,t=e.bookmarks,r=e.txConfig,n=e.database,o=e.mode,i=e.impersonatedUser,u=e.notificationFilter,e=new N2.ResultStreamObserver({server:this._server,beforeError:e.beforeError,afterError:e.afterError,beforeComplete:e.beforeComplete,afterComplete:e.afterComplete});return e.prepareToHandleSingleResponse(),this.write(M2.default.begin({bookmarks:t,txConfig:r,database:n,mode:o,impersonatedUser:i,notificationFilter:u}),e,!0),e},D2.prototype.run=function(e,t,r){var r=void 0===r?{}:r,n=r.bookmarks,o=r.txConfig,i=r.database,u=r.mode,a=r.impersonatedUser,s=r.notificationFilter,c=r.beforeKeys,l=r.afterKeys,f=r.beforeError,p=r.afterError,d=r.beforeComplete,h=r.afterComplete,b=r.flush,b=void 0===b||b,y=r.reactive,y=void 0!==y&&y,_=r.fetchSize,_=void 0===_?x2:_,v=r.highRecordWatermark,v=void 0===v?Number.MAX_VALUE:v,r=r.lowRecordWatermark,r=void 0===r?Number.MAX_VALUE:r,c=new N2.ResultStreamObserver({server:this._server,reactive:y,fetchSize:_,moreFunction:this._requestMore.bind(this),discardFunction:this._requestDiscard.bind(this),beforeKeys:c,afterKeys:l,beforeError:f,afterError:p,beforeComplete:d,afterComplete:h,highRecordWatermark:v,lowRecordWatermark:r}),l=y;return this.write(M2.default.runWithMetadata(e,t,{bookmarks:n,txConfig:o,database:i,mode:u,impersonatedUser:a,notificationFilter:s}),c,l&&b),y||this.write(M2.default.pull({n:_}),c,b),c},D2);function D2(){return null!==j2&&j2.apply(this,arguments)||this}ef.default=R;var U2,L2,ub={},Bb={},F2=r&&r.__assign||function(){return(F2=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},zb=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},j=(Object.defineProperty(Bb,"__esModule",{value:!0}),zb(n)),ey=(Bb.default=F2({},j.default),r&&r.__extends||(U2=function(e,t){return(U2=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}U2(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),B2=r&&r.__assign||function(){return(B2=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Db=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},cy=(Object.defineProperty(ub,"__esModule",{value:!0}),Db(ef)),V2=Db(Bb),q2=Db(E0),W2=Db(l0),z2=A,H2=e.internal.constants.BOLT_PROTOCOL_V5_3,Zb=(L2=cy.default,ey(G2,L2),Object.defineProperty(G2.prototype,"version",{get:function(){return H2},enumerable:!1,configurable:!0}),Object.defineProperty(G2.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new q2.default(Object.values(V2.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),G2.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=e.boltAgent,o=e.authToken,i=e.notificationFilter,u=e.onError,a=e.onComplete,s={},e=new z2.LoginObserver({onError:function(e){return t._onLoginError(e,u)},onCompleted:function(e){return s.metadata=e,t._onLoginCompleted(e)}});return this.write(W2.default.hello5x3(r,n,i,this._serversideRouting),e,!1),this.logon({authToken:o,onComplete:function(e){return a(B2(B2({},e),s.metadata))},onError:u,flush:!0})},G2);function G2(){return null!==L2&&L2.apply(this,arguments)||this}ub.default=Zb;var Y2,K2,_y={},Sy={},Z2=r&&r.__assign||function(){return(Z2=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},jy=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},xd=(Object.defineProperty(Sy,"__esModule",{value:!0}),jy(Bb)),Jp=(Sy.default=Z2({},xd.default),r&&r.__extends||(Y2=function(e,t){return(Y2=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Y2(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),l_=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},u_=(Object.defineProperty(_y,"__esModule",{value:!0}),l_(ub)),Q2=l_(Sy),X2=l_(l0),J2=A,$2=l_(E0),ek=e.internal.constants.BOLT_PROTOCOL_V5_4,_d=(K2=u_.default,Jp(tk,K2),Object.defineProperty(tk.prototype,"version",{get:function(){return ek},enumerable:!1,configurable:!0}),Object.defineProperty(tk.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new $2.default(Object.values(Q2.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),tk.prototype.telemetry=function(e,t){var e=e.api,t=void 0===t?{}:t,r=t.onError,t=new J2.TelemetryObserver({onCompleted:t.onCompleted,onError:r});return this.write(X2.default.telemetry({api:e}),t,!1),t},tk);function tk(){return null!==K2&&K2.apply(this,arguments)||this}_y.default=_d;var rk,nk,zy={},eh={},ok=r&&r.__assign||function(){return(ok=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},g_=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Xh=(Object.defineProperty(eh,"__esModule",{value:!0}),g_(Sy)),wy=(eh.default=ok({},Xh.default),r&&r.__extends||(rk=function(e,t){return(rk=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}rk(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),ik=r&&r.__assign||function(){return(ik=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},$l=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Hy=(Object.defineProperty(zy,"__esModule",{value:!0}),$l(_y)),uk=$l(eh),ak=$l(E0),sk=$l(l0),ck=A,c_=e.internal.constants,lk=c_.BOLT_PROTOCOL_V5_5,fk=c_.FETCH_ALL,pk=Object.freeze({OPERATION:"",OPERATION_CODE:"0",CURRENT_SCHEMA:"/"}),av=(nk=Hy.default,wy(dk,nk),Object.defineProperty(dk.prototype,"version",{get:function(){return lk},enumerable:!1,configurable:!0}),Object.defineProperty(dk.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new ak.default(Object.values(uk.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),dk.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=e.boltAgent,o=e.authToken,i=e.notificationFilter,u=e.onError,a=e.onComplete,s={},e=new ck.LoginObserver({onError:function(e){return t._onLoginError(e,u)},onCompleted:function(e){return s.metadata=e,t._onLoginCompleted(e)}});return this.write(sk.default.hello5x5(r,n,i,this._serversideRouting),e,!1),this.logon({authToken:o,onComplete:function(e){return a(ik(ik({},e),s.metadata))},onError:u,flush:!0})},dk.prototype.beginTransaction=function(e){var e=void 0===e?{}:e,t=e.bookmarks,r=e.txConfig,n=e.database,o=e.mode,i=e.impersonatedUser,u=e.notificationFilter,e=new ck.ResultStreamObserver({server:this._server,beforeError:e.beforeError,afterError:e.afterError,beforeComplete:e.beforeComplete,afterComplete:e.afterComplete});return e.prepareToHandleSingleResponse(),this.write(sk.default.begin5x5({bookmarks:t,txConfig:r,database:n,mode:o,impersonatedUser:i,notificationFilter:u}),e,!0),e},dk.prototype.run=function(e,t,r){var r=void 0===r?{}:r,n=r.bookmarks,o=r.txConfig,i=r.database,u=r.mode,a=r.impersonatedUser,s=r.notificationFilter,c=r.beforeKeys,l=r.afterKeys,f=r.beforeError,p=r.afterError,d=r.beforeComplete,h=r.afterComplete,b=r.flush,b=void 0===b||b,y=r.reactive,y=void 0!==y&&y,_=r.fetchSize,_=void 0===_?fk:_,v=r.highRecordWatermark,v=void 0===v?Number.MAX_VALUE:v,r=r.lowRecordWatermark,r=void 0===r?Number.MAX_VALUE:r,c=new ck.ResultStreamObserver({server:this._server,reactive:y,fetchSize:_,moreFunction:this._requestMore.bind(this),discardFunction:this._requestDiscard.bind(this),beforeKeys:c,afterKeys:l,beforeError:f,afterError:p,beforeComplete:d,afterComplete:h,highRecordWatermark:v,lowRecordWatermark:r,enrichMetadata:this._enrichMetadata}),l=y;return this.write(sk.default.runWithMetadata5x5(e,t,{bookmarks:n,txConfig:o,database:i,mode:u,impersonatedUser:a,notificationFilter:s}),c,l&&b),y||this.write(sk.default.pull({n:_}),c,b),c},dk.prototype._enrichMetadata=function(e){return Array.isArray(e.statuses)&&(e.statuses=e.statuses.map(function(e){return ik(ik({},e),{description:null!=e.neo4j_code?e.status_description:e.description,diagnostic_record:null!==e.diagnostic_record?ik(ik({},pk),e.diagnostic_record):null})})),e},dk);function dk(){return null!==nk&&nk.apply(this,arguments)||this}zy.default=av;var hk,bk,V_={},fv={},yk=r&&r.__assign||function(){return(yk=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},kv=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Ev=(Object.defineProperty(fv,"__esModule",{value:!0}),kv(eh)),qv=(fv.default=yk({},Ev.default),r&&r.__extends||(hk=function(e,t){return(hk=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}hk(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),_k=r&&r.__assign||function(){return(_k=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Xv=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ab=(Object.defineProperty(V_,"__esModule",{value:!0}),Xv(zy)),vk=Xv(fv),mk=Xv(E0),gk=e.internal.constants.BOLT_PROTOCOL_V5_6,Ok=Object.freeze({OPERATION:"",OPERATION_CODE:"0",CURRENT_SCHEMA:"/"}),em=(bk=ab.default,qv(wk,bk),Object.defineProperty(wk.prototype,"version",{get:function(){return gk},enumerable:!1,configurable:!0}),Object.defineProperty(wk.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new mk.default(Object.values(vk.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),wk.prototype._enrichMetadata=function(e){return Array.isArray(e.statuses)&&(e.statuses=e.statuses.map(function(e){return _k(_k({},e),{diagnostic_record:null!==e.diagnostic_record?_k(_k({},Ok),e.diagnostic_record):null})})),e},wk);function wk(){return null!==bk&&bk.apply(this,arguments)||this}V_.default=em;var Ek,Pk,rm={},um={},Tk=r&&r.__assign||function(){return(Tk=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},zv=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},cm=(Object.defineProperty(um,"__esModule",{value:!0}),zv(fv)),ym=(um.default=Tk({},cm.default),r&&r.__extends||(Ek=function(e,t){return(Ek=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ek(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),Sk=r&&r.__assign||function(){return(Sk=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Fv=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Wv=(Object.defineProperty(rm,"__esModule",{value:!0}),Fv(V_)),jk=Fv(um),Ck=Fv(E0),Ik=e.internal.constants.BOLT_PROTOCOL_V5_7,Rk=Object.freeze({OPERATION:"",OPERATION_CODE:"0",CURRENT_SCHEMA:"/"}),G_=(Pk=Wv.default,ym(Ak,Pk),Object.defineProperty(Ak.prototype,"version",{get:function(){return Ik},enumerable:!1,configurable:!0}),Object.defineProperty(Ak.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new Ck.default(Object.values(jk.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),Ak.prototype.enrichErrorMetadata=function(e){return Sk(Sk({},e),{cause:null!=e.cause?this.enrichErrorMetadata(e.cause):null,code:e.neo4j_code,diagnostic_record:null!==e.diagnostic_record?Sk(Sk({},Rk),e.diagnostic_record):null})},Ak);function Ak(){return null!==Pk&&Pk.apply(this,arguments)||this}rm.default=G_;var Mk,Nk,Q_={},Xm={},kk=r&&r.__assign||function(){return(kk=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},zm=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Dd=(Object.defineProperty(Xm,"__esModule",{value:!0}),zm(um)),Vm=(Xm.default=kk({},Dd.default),r&&r.__extends||(Mk=function(e,t){return(Mk=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Mk(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),Ud=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Tm=(Object.defineProperty(Q_,"__esModule",{value:!0}),Ud(rm)),xk=Ud(Xm),Dk=Ud(E0),Uk=Ud(l0),Lk=A,Km=e.internal.constants,Fk=Km.BOLT_PROTOCOL_V5_8,Bk=Km.FETCH_ALL,Um=(Nk=Tm.default,Vm(Vk,Nk),Object.defineProperty(Vk.prototype,"version",{get:function(){return Fk},enumerable:!1,configurable:!0}),Object.defineProperty(Vk.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new Dk.default(Object.values(xk.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),Vk.prototype.run=function(e,t,r){var r=void 0===r?{}:r,n=r.bookmarks,o=r.txConfig,i=r.database,u=r.mode,a=r.impersonatedUser,s=r.notificationFilter,c=r.beforeKeys,l=r.afterKeys,f=r.beforeError,p=r.afterError,d=r.beforeComplete,h=r.afterComplete,b=r.flush,b=void 0===b||b,y=r.reactive,y=void 0!==y&&y,_=r.fetchSize,_=void 0===_?Bk:_,v=r.highRecordWatermark,v=void 0===v?Number.MAX_VALUE:v,m=r.lowRecordWatermark,m=void 0===m?Number.MAX_VALUE:m,r=r.onDb,c=new Lk.ResultStreamObserver({server:this._server,reactive:y,fetchSize:_,moreFunction:this._requestMore.bind(this),discardFunction:this._requestDiscard.bind(this),beforeKeys:c,afterKeys:l,beforeError:f,afterError:p,beforeComplete:d,afterComplete:h,highRecordWatermark:v,lowRecordWatermark:m,enrichMetadata:this._enrichMetadata,onDb:r}),l=y;return this.write(Uk.default.runWithMetadata5x5(e,t,{bookmarks:n,txConfig:o,database:i,mode:u,impersonatedUser:a,notificationFilter:s}),c,l&&b),y||this.write(Uk.default.pull({n:_}),c,b),c},Vk);function Vk(){return null!==Nk&&Nk.apply(this,arguments)||this}Q_.default=Um;var Hm={},$p={},qk=r&&r.__assign||function(){return(qk=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},a0=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Ld=(Object.defineProperty($p,"__esModule",{value:!0}),a0(Xm)),Wk=E0,zk=wm,Hk=e,Gk=198,Yk=193,Kk=200,Zk=201,Qk=202,Xk=203,Jk={INT8:Kk,INT16:Zk,INT32:Qk,INT64:Xk,FLOAT32:Gk,FLOAT64:Yk};function $k(e,t){(r=new DataView(new ArrayBuffer(2))).setInt16(0,1e3,!0);var r,n=1e3===new Int16Array(r.buffer)[0];if(n){var o=new DataView(new ArrayBuffer(t.byteLength)),i=new DataView(t),u=void 0,a=void 0,s=void 0;switch(e){case Kk:s=1,u=o.setInt8.bind(o),a=i.getInt8.bind(i);break;case Zk:s=2,u=o.setInt16.bind(o),a=i.getInt16.bind(i);break;case Qk:s=4,u=o.setInt32.bind(o),a=i.getInt32.bind(i);break;case Xk:s=8,u=o.setBigInt64.bind(o),a=i.getBigInt64.bind(i);break;case Gk:s=4,u=o.setInt32.bind(o),a=i.getInt32.bind(i);break;case Yk:s=8,u=o.setBigInt64.bind(o),a=i.getBigInt64.bind(i);break;default:throw(0,Hk.newError)("Vector is of unsupported type ".concat(e))}for(var c=0;c<t.byteLength;c+=s)u(c,a(c,n));return o.buffer}return t}$p.default=qk(qk({},Ld.default),{createVectorTransformer:function(){return new Wk.TypeTransformer({signature:86,isTypeInstance:function(e){return(0,Hk.isVector)(e)},toStructure:function(e){var t=Jk[e.getType()];if(void 0===t)throw(0,Hk.newError)("Vector object has unknown type: ".concat(e.getType()));e=$k(t,e.asTypedArray().buffer);return new zk.structure.Structure(86,[Int8Array.from([t]),new Int8Array(e)])},fromStructure:function(e){var t=Uint8Array.from(e.fields[0])[0],r=$k(t,e.fields[1].buffer);switch(t){case Kk:return new Hk.Vector(new Int8Array(r));case Zk:return new Hk.Vector(new Int16Array(r));case Qk:return new Hk.Vector(new Int32Array(r));case Xk:return new Hk.Vector(new BigInt64Array(r));case Gk:return new Hk.Vector(new Float32Array(r));case Yk:return new Hk.Vector(new Float64Array(r));default:throw(0,Hk.newError)("Received Vector structure with unsupported type marker: ".concat(t))}}})},createUnsupportedTypeTransformer:function(){return new Wk.TypeTransformer({signature:63,isTypeInstance:function(e){return(0,Hk.isUnsupportedType)(e)},toStructure:function(e){throw(0,Hk.newError)("UnsupportedType object can not be transmitted")},fromStructure:function(e){return new Hk.UnsupportedType(e.fields[0],e.fields[1],e.fields[2],e.fields[3].message)}})}});var ex,tx,a=r&&r.__extends||(ex=function(e,t){return(ex=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ex(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),h0=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},g0=(Object.defineProperty(Hm,"__esModule",{value:!0}),h0(Q_)),rx=h0($p),nx=h0(E0),ox=e.internal.constants.BOLT_PROTOCOL_V6_0,T0=(tx=g0.default,a(ix,tx),Object.defineProperty(ix.prototype,"version",{get:function(){return ox},enumerable:!1,configurable:!0}),Object.defineProperty(ix.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new nx.default(Object.values(rx.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),ix);function ix(){return null!==tx&&tx.apply(this,arguments)||this}Hm.default=T0;var ux,ax,I0={},M0={},sx=r&&r.__assign||function(){return(sx=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},x0=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},H0=(Object.defineProperty(M0,"__esModule",{value:!0}),x0($p)),X0=(M0.default=sx({},H0.default),r&&r.__extends||(ux=function(e,t){return(ux=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ux(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),l=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},sg=(Object.defineProperty(I0,"__esModule",{value:!0}),l(Hm)),cx=l(M0),lx=l(wm),fx=l(E0),px=e.internal.constants.BOLT_PROTOCOL_V6_1,rg=(ax=sg.default,X0(dx,ax),Object.defineProperty(dx.prototype,"version",{get:function(){return px},enumerable:!1,configurable:!0}),dx.prototype._createPacker=function(e){return new lx.default.Packer(e,!0)},dx.prototype._createUnpacker=function(e,t){return new lx.default.Unpacker(e,t,!0)},Object.defineProperty(dx.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new fx.default(Object.values(cx.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),dx);function dx(){return null!==ax&&ax.apply(this,arguments)||this}I0.default=rg;var dg={},hx=(Object.defineProperty(dg,"__esModule",{value:!0}),e);function bx(){}function yx(e){return e}var _x={onNext:bx,onCompleted:bx,onError:bx};function vx(e){var e=void 0===e?{}:e,t=e.transformMetadata,r=e.enrichErrorMetadata,n=e.log,e=e.observer;this._pendingObservers=[],this._log=n,this._transformMetadata=t||yx,this._enrichErrorMetadata=r||yx,this._observer=Object.assign({onObserversCountChange:bx,onError:bx,onFailure:bx,onErrorApplyTransformation:yx},e)}Object.defineProperty(vx.prototype,"currentFailure",{get:function(){return this._currentFailure},enumerable:!1,configurable:!0}),vx.prototype.handleResponse=function(e){var t=e.fields[0];switch(e.signature){case 113:this._log.isDebugEnabled()&&this._log.debug("S: RECORD ".concat(hx.json.stringify(e))),this._currentObserver.onNext(t);break;case 112:this._log.isDebugEnabled()&&this._log.debug("S: SUCCESS ".concat(hx.json.stringify(e)));try{var r=this._transformMetadata(t);this._currentObserver.onCompleted(r)}finally{this._updateCurrentObserver()}break;case 127:this._log.isDebugEnabled()&&this._log.debug("S: FAILURE ".concat(hx.json.stringify(e)));try{this._currentFailure=this._handleErrorPayload(this._enrichErrorMetadata(t)),this._currentObserver.onError(this._currentFailure)}finally{this._updateCurrentObserver(),this._observer.onFailure(this._currentFailure,!1)}break;case 126:this._log.isDebugEnabled()&&this._log.debug("S: IGNORED ".concat(hx.json.stringify(e)));try{this._currentFailure&&this._currentObserver.onError?this._currentObserver.onError(this._currentFailure,!1):this._currentObserver.onError&&this._currentObserver.onError((0,hx.newError)("Ignored either because of an error or RESET"))}finally{this._updateCurrentObserver()}break;default:this._observer.onError((0,hx.newError)("Unknown Bolt protocol message: "+e))}},vx.prototype._updateCurrentObserver=function(){this._currentObserver=this._pendingObservers.shift(),this._observer.onObserversCountChange(this._observersCount)},Object.defineProperty(vx.prototype,"_observersCount",{get:function(){return null==this._currentObserver?this._pendingObservers.length:this._pendingObservers.length+1},enumerable:!1,configurable:!0}),vx.prototype._queueObserver=function(e){return(e=e||_x).onCompleted=e.onCompleted||bx,e.onError=e.onError||bx,e.onNext=e.onNext||bx,void 0===this._currentObserver?this._currentObserver=e:this._pendingObservers.push(e),this._observer.onObserversCountChange(this._observersCount),!0},vx.prototype._notifyErrorToObservers=function(e){for(this._currentObserver&&this._currentObserver.onError&&this._currentObserver.onError(e);0<this._pendingObservers.length;){var t=this._pendingObservers.shift();t&&t.onError&&t.onError(e,!1)}},vx.prototype.hasOngoingObservableRequests=function(){return null!=this._currentObserver||0<this._pendingObservers.length},vx.prototype._resetFailure=function(){this._currentFailure=null},vx.prototype._handleErrorPayload=function(e){var t=(e=>"Neo.TransientError.Transaction.Terminated"===e?"Neo.ClientError.Transaction.Terminated":"Neo.TransientError.Transaction.LockClientStopped"===e?"Neo.ClientError.Transaction.LockClientStopped":e)(e.code),r=null!=e.cause?this._handleErrorCause(e.cause):void 0,t=(0,hx.newError)(e.message,t,r,e.gql_status,e.description,e.diagnostic_record);return this._observer.onErrorApplyTransformation(t)},vx.prototype._handleErrorCause=function(e){var t=null!=e.cause?this._handleErrorCause(e.cause):void 0,t=(0,hx.newGQLError)(e.message,t,e.gql_status,e.description,e.diagnostic_record);return this._observer.onErrorApplyTransformation(t)},dg.default=vx;var mx,wg=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},gx=(Object.defineProperty(O_,"__esModule",{value:!0}),O_.default=function(e){var e=void 0===e?{}:e,t=e.version,r=e.chunker,n=e.dechunker,o=e.channel,i=e.disableLosslessIntegers,u=e.useBigInt,a=e.serversideRouting,s=e.log,c=e.observer;return((e,t,r,n,o,i,u,a)=>{if(!(e instanceof gx.ProtocolVersion)||null==e)throw(0,gx.newError)("Unknown Bolt protocol version: "+e);switch(!0){case e.isEqualTo({major:1,minor:0}):return new Ox.default(t,r,n,i,a,u);case e.isEqualTo({major:2,minor:0}):return new wx.default(t,r,n,i,a,u);case e.isEqualTo({major:3,minor:0}):return new Ex.default(t,r,n,i,a,u);case e.isEqualTo({major:4,minor:0}):return new Px.default(t,r,n,i,a,u);case e.isEqualTo({major:4,minor:1}):return new Tx.default(t,r,n,i,a,u,o);case e.isEqualTo({major:4,minor:2}):return new Sx.default(t,r,n,i,a,u,o);case e.isEqualTo({major:4,minor:3}):return new jx.default(t,r,n,i,a,u,o);case e.isEqualTo({major:4,minor:4}):return new Cx.default(t,r,n,i,a,u,o);case e.isEqualTo({major:5,minor:0}):return new Ix.default(t,r,n,i,a,u,o);case e.isEqualTo({major:5,minor:1}):return new Rx.default(t,r,n,i,a,u,o);case e.isEqualTo({major:5,minor:2}):return new Ax.default(t,r,n,i,a,u,o);case e.isEqualTo({major:5,minor:3}):return new Mx.default(t,r,n,i,a,u,o);case e.isEqualTo({major:5,minor:4}):return new Nx.default(t,r,n,i,a,u,o);case e.isEqualTo({major:5,minor:5}):return new kx.default(t,r,n,i,a,u,o);case e.isEqualTo({major:5,minor:6}):return new xx.default(t,r,n,i,a,u,o);case e.isEqualTo({major:5,minor:7}):return new Dx.default(t,r,n,i,a,u,o);case e.isEqualTo({major:5,minor:8}):return new Ux.default(t,r,n,i,a,u,o);case e.isEqualTo({major:6,minor:0}):return new Lx.default(t,r,n,i,a,u,o);case e.isEqualTo({major:6,minor:1}):return new Fx.default(t,r,n,i,a,u,o);default:throw(0,gx.newError)("Unknown Bolt protocol version: "+e)}})(t,e.server,r,{disableLosslessIntegers:i,useBigInt:u},a,function(t){var r=new Bx.default({transformMetadata:t.transformMetadata.bind(t),enrichErrorMetadata:t.enrichErrorMetadata.bind(t),log:s,observer:c});return o.onerror=c.onError.bind(c),o.onmessage=function(e){return n.write(e)},n.onmessage=function(e){try{r.handleResponse(t.unpack(e))}catch(e){return c.onError(e)}},r},c.onProtocolError.bind(c),s)},e),Ox=wg(I_),wx=wg(t),Ex=wg(Ig),Px=wg(Yf),Tx=wg(AO),Sx=wg(Rt),jx=wg(T),Cx=wg(i),Ix=wg(pf),Rx=wg(Qh),Ax=wg(ef),Mx=wg(ub),Nx=wg(_y),kx=wg(zy),xx=wg(V_),Dx=wg(rm),Ux=wg(Q_),Lx=wg(Hm),Fx=wg(I0),Bx=wg(dg);vg=F,mx=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),Gt=r&&r.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||mx(t,e,r)},Ry=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(vg,"__esModule",{value:!0}),vg.RawRoutingTable=vg.BoltProtocol=void 0,Bg=Ry(kd),F0=Ry(O_),Gg=Ry(T),Ry=Ry(B_),Gt(A,vg),vg.BoltProtocol=Gg.default,vg.RawRoutingTable=Ry.default,vg.default={handshake:Bg.default,create:F0.default};var Vx,Jg={},nO={},Kg=r&&r.__extends||(Vx=function(e,t){return(Vx=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Vx(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(nO,"__esModule",{value:!0});Kg(Wx,qx=e.ConnectionProvider),Wx.prototype.acquireConnection=function(e){e=void 0===e?{}:e,e.accessMode,e=this._connection;return this._connection=null,Promise.resolve(e)};var qx,uO=Wx;function Wx(e){var t=qx.call(this)||this;return t._connection=e,t}nO.default=uO;var zx,fO={},Ug={},_O={},q_=r&&r.__extends||(zx=function(e,t){return(zx=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}zx(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(_O,"__esModule",{value:!0});q_(Gx,Hx=e.Connection),Object.defineProperty(Gx.prototype,"id",{get:function(){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(Gx.prototype,"databaseId",{get:function(){throw new Error("not implemented")},set:function(e){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(Gx.prototype,"authToken",{get:function(){throw new Error("not implemented")},set:function(e){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(Gx.prototype,"supportsReAuth",{get:function(){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(Gx.prototype,"creationTimestamp",{get:function(){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(Gx.prototype,"idleTimestamp",{get:function(){throw new Error("not implemented")},set:function(e){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Gx.prototype.protocol=function(){throw new Error("not implemented")},Object.defineProperty(Gx.prototype,"address",{get:function(){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(Gx.prototype,"version",{get:function(){throw new Error("not implemented")},set:function(e){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(Gx.prototype,"server",{get:function(){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Gx.prototype.connect=function(e,t,r,n){throw new Error("not implemented")},Gx.prototype.write=function(e,t,r){throw new Error("not implemented")},Gx.prototype.close=function(){throw new Error("not implemented")},Gx.prototype.handleAndTransformError=function(e,t){return this._errorHandler?this._errorHandler.handleAndTransformError(e,t,this):e};var Hx,EO=Gx;function Gx(e){var t=Hx.call(this)||this;return t._errorHandler=e,t}_O.default=EO;var Yx,Sm={},gO=r&&r.__extends||(Yx=function(e,t){return(Yx=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Yx(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Kx=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},Zx=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))s.label=t[1];else if(6===t[0]&&s.label<a[1])s.label=a[1],a=t;else{if(!(a&&s.label<a[2])){a[2]&&s.ops.pop(),s.trys.pop();continue}s.label=a[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},CO=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Qx=(Object.defineProperty(Sm,"__esModule",{value:!0}),Sm.createChannelConnection=function(i,u,a,s,e,c,l,t){void 0===c&&(c=null);void 0===t&&(t=function(e){return new Qx.Channel(e)});var e=new Qx.ChannelConfig(i,u,a.errorCode(),e),f=t(e);return Jx.default.handshake(f,s).then(function(e){var r=e.protocolVersion,e=e.consumeRemainingBuffer,n=new Qx.Chunker(f),o=new Qx.Dechunker,t=new nD(f,a,i,s,u.disableLosslessIntegers,c,n,u.notificationFilter,function(t){return Jx.default.create({version:r,channel:f,chunker:n,dechunker:o,disableLosslessIntegers:u.disableLosslessIntegers,useBigInt:u.useBigInt,serversideRouting:c,server:t.server,log:t.logger,observer:{onObserversCountChange:t._handleOngoingRequestsNumberChange.bind(t),onError:t._handleFatalError.bind(t),onFailure:t._resetOnFailure.bind(t),onProtocolError:t._handleProtocolError.bind(t),onErrorApplyTransformation:function(e){return t.handleAndTransformError(e,t._address)}}})},u.telemetryDisabled,l);return e(function(e){return o.write(e)}),t}).catch(function(e){return f.close().then(function(){throw e})})},$d),Xx=e,FO=CO(_O),Jx=CO(F),$x=Xx.error.PROTOCOL_ERROR,eD=Xx.internal.logger.Logger,tD=0;rD=FO.default,gO(oD,rD),oD.prototype.beginTransaction=function(e){return this._sendTelemetryIfEnabled(e),this._protocol.beginTransaction(e)},oD.prototype.run=function(e,t,r){return this._sendTelemetryIfEnabled(r),this._protocol.run(e,t,r)},oD.prototype._sendTelemetryIfEnabled=function(e){this._telemetryDisabledConnection||this._telemetryDisabledDriverConfig||null==e||null==e.apiTelemetryConfig||this._protocol.telemetry({api:e.apiTelemetryConfig.api},{onCompleted:e.apiTelemetryConfig.onTelemetrySuccess,onError:e.beforeError})},oD.prototype.commitTransaction=function(e){return this._protocol.commitTransaction(e)},oD.prototype.rollbackTransaction=function(e){return this._protocol.rollbackTransaction(e)},oD.prototype.getProtocolVersion=function(){return this._protocol.version},Object.defineProperty(oD.prototype,"authToken",{get:function(){return this._authToken},set:function(e){this._authToken=e},enumerable:!1,configurable:!0}),Object.defineProperty(oD.prototype,"supportsReAuth",{get:function(){return this._protocol.supportsReAuth},enumerable:!1,configurable:!0}),Object.defineProperty(oD.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(oD.prototype,"databaseId",{get:function(){return this._dbConnectionId},set:function(e){this._dbConnectionId=e},enumerable:!1,configurable:!0}),Object.defineProperty(oD.prototype,"idleTimestamp",{get:function(){return this._idleTimestamp},set:function(e){this._idleTimestamp=e},enumerable:!1,configurable:!0}),Object.defineProperty(oD.prototype,"creationTimestamp",{get:function(){return this._creationTimestamp},enumerable:!1,configurable:!0}),oD.prototype.connect=function(t,n,o,i){return Kx(this,void 0,void 0,function(){var r=this;return Zx(this,function(e){switch(e.label){case 0:if(this._protocol.initialized&&!this._protocol.supportsReAuth)throw(0,Xx.newError)("Connection does not support re-auth");return this._authToken=o,this._protocol.initialized?[3,2]:[4,this._initialize(t,n,o)];case 1:return[2,e.sent()];case 2:return i?[4,new Promise(function(e,t){r._protocol.logoff({onError:t}),r._protocol.logon({authToken:o,onError:t,onComplete:function(){return e(r)},flush:!0})})]:[3,4];case 3:return[2,e.sent()];case 4:return this._protocol.logoff(),this._protocol.logon({authToken:o,flush:!0}),[2,this]}})})},oD.prototype._initialize=function(e,n,o){var i=this,u=this;return new Promise(function(r,t){i._protocol.initialize({userAgent:e,boltAgent:n,authToken:o,notificationFilter:i._notificationFilter,onError:function(e){return t(e)},onComplete:function(e){var t;e&&(t=e.server,i.version&&!t||(i.version=t),i.databaseId||(i.databaseId=e.connection_id),e.hints&&(null!=(t=e.hints["connection.recv_timeout_seconds"])&&(t=(0,Xx.toNumber)(t),Number.isInteger(t)&&0<t?i._ch.setupReceiveTimeout(1e3*t):i._log.info("Server located at ".concat(i._address," supplied an invalid connection receive timeout value (").concat(t,"). ")+"Please, verify the server configuration and status because this can be the symptom of a bigger issue.")),!0===e.hints["telemetry.enabled"]&&(i._telemetryDisabledConnection=!1),i.SSREnabledHint=e.hints["ssr.enabled"]),i._ssrCallback(null!=(t=i.SSREnabledHint)&&t,"OPEN")),r(u)}})})},oD.prototype.protocol=function(){return this._protocol},Object.defineProperty(oD.prototype,"address",{get:function(){return this._address},enumerable:!1,configurable:!0}),Object.defineProperty(oD.prototype,"version",{get:function(){return this._server.version},set:function(e){this._server.version=e},enumerable:!1,configurable:!0}),Object.defineProperty(oD.prototype,"server",{get:function(){return this._server},enumerable:!1,configurable:!0}),Object.defineProperty(oD.prototype,"logger",{get:function(){return this._log},enumerable:!1,configurable:!0}),oD.prototype._handleFatalError=function(e){this._isBroken=!0,this._error=this.handleAndTransformError(this._protocol.currentFailure||e,this._address),this._log.isErrorEnabled()&&this._log.error("experienced a fatal error caused by ".concat(this._error," (").concat(Xx.json.stringify(this._error),")")),this._protocol.notifyFatalError(this._error)},oD.prototype._setIdle=function(e){this._idle=!0,this._ch.stopReceiveTimeout(),this._protocol.queueObserverIfProtocolIsNotBroken(e)},oD.prototype._unsetIdle=function(){this._idle=!1,this._updateCurrentObserver()},oD.prototype._queueObserver=function(e){return this._protocol.queueObserverIfProtocolIsNotBroken(e)},oD.prototype.hasOngoingObservableRequests=function(){return!this._idle&&this._protocol.hasOngoingObservableRequests()},oD.prototype.resetAndFlush=function(){var r=this;return new Promise(function(e,t){r._reset({onError:function(e){r._isBroken?t(e):(e=r._handleProtocolError("Received FAILURE as a response for RESET: ".concat(e)),t(e))},onComplete:function(){e()}})})},oD.prototype._resetOnFailure=function(){var e=this;this.isOpen()&&this._reset({onError:function(){e._protocol.resetFailure()},onComplete:function(){e._protocol.resetFailure()}})},oD.prototype._reset=function(t){var e,r=this;this._reseting?this._protocol.isLastMessageReset()?this._resetObservers.push(t):this._protocol.reset({onError:function(e){t.onError(e)},onComplete:function(){t.onComplete()}}):(this._resetObservers.push(t),this._reseting=!0,e=function(e){r._reseting=!1;var t=r._resetObservers;r._resetObservers=[],t.forEach(e)},this._protocol.reset({onError:function(t){e(function(e){return e.onError(t)})},onComplete:function(){e(function(e){return e.onComplete()})}}))},oD.prototype._updateCurrentObserver=function(){this._protocol.updateCurrentObserver()},oD.prototype.isOpen=function(){return!this._isBroken&&this._ch._open},oD.prototype._handleOngoingRequestsNumberChange=function(e){this._idle||(0===e?this._ch.stopReceiveTimeout():this._ch.startReceiveTimeout())},oD.prototype.close=function(){return Kx(this,void 0,void 0,function(){var t;return Zx(this,function(e){switch(e.label){case 0:return this._ssrCallback(null!=(t=this.SSREnabledHint)&&t,"CLOSE"),this._log.isDebugEnabled()&&this._log.debug("closing"),this._protocol&&this.isOpen()&&this._protocol.prepareToClose(),[4,this._ch.close()];case 1:return e.sent(),this._log.isDebugEnabled()&&this._log.debug("closed"),[2]}})})},oD.prototype.toString=function(){return"Connection [".concat(this.id,"][").concat(this.databaseId||"","]")},oD.prototype._handleProtocolError=function(e){this._protocol.resetFailure(),this._updateCurrentObserver();e=(0,Xx.newError)(e,$x);return this._handleFatalError(e),e};var rD,nD=oD;function oD(e,t,r,n,o,i,u,a,s,c,l){void 0===o&&(o=!1),void 0===i&&(i=null),void 0===l&&(l=function(e){});var f,p,t=rD.call(this,t)||this;return t._authToken=null,t._idle=!1,t._reseting=!1,t._resetObservers=[],t._id=tD++,t._address=r,t._server={address:r.asHostPort()},t._creationTimestamp=Date.now(),t._disableLosslessIntegers=o,t._ch=e,t._chunker=u,t._log=(f=t,new eD((p=n)._level,function(e,t){return p._loggerFunction(e,"".concat(f," ").concat(t))})),t._serversideRouting=i,t._notificationFilter=a,t._telemetryDisabledDriverConfig=!0===c,t._telemetryDisabledConnection=!0,t._ssrCallback=l,t._dbConnectionId=null,t._protocol=s(t),t._isBroken=!1,t._log.isDebugEnabled()&&t._log.debug("created towards ".concat(r)),t}Sm.default=nD;var iD,uD,lO={},Pv=r&&r.__extends||(iD=function(e,t){return(iD=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}iD(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),_f=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},rp=(Object.defineProperty(lO,"__esModule",{value:!0}),_f(_O)),KO=(uD=rp.default,Pv(aD,uD),aD.prototype.beginTransaction=function(e){return this._delegate.beginTransaction(e)},aD.prototype.run=function(e,t,r){return this._delegate.run(e,t,r)},aD.prototype.commitTransaction=function(e){return this._delegate.commitTransaction(e)},aD.prototype.rollbackTransaction=function(e){return this._delegate.rollbackTransaction(e)},aD.prototype.getProtocolVersion=function(){return this._delegate.getProtocolVersion()},Object.defineProperty(aD.prototype,"id",{get:function(){return this._delegate.id},enumerable:!1,configurable:!0}),Object.defineProperty(aD.prototype,"databaseId",{get:function(){return this._delegate.databaseId},set:function(e){this._delegate.databaseId=e},enumerable:!1,configurable:!0}),Object.defineProperty(aD.prototype,"server",{get:function(){return this._delegate.server},enumerable:!1,configurable:!0}),Object.defineProperty(aD.prototype,"authToken",{get:function(){return this._delegate.authToken},set:function(e){this._delegate.authToken=e},enumerable:!1,configurable:!0}),Object.defineProperty(aD.prototype,"supportsReAuth",{get:function(){return this._delegate.supportsReAuth},enumerable:!1,configurable:!0}),Object.defineProperty(aD.prototype,"address",{get:function(){return this._delegate.address},enumerable:!1,configurable:!0}),Object.defineProperty(aD.prototype,"version",{get:function(){return this._delegate.version},set:function(e){this._delegate.version=e},enumerable:!1,configurable:!0}),Object.defineProperty(aD.prototype,"creationTimestamp",{get:function(){return this._delegate.creationTimestamp},enumerable:!1,configurable:!0}),Object.defineProperty(aD.prototype,"idleTimestamp",{get:function(){return this._delegate.idleTimestamp},set:function(e){this._delegate.idleTimestamp=e},enumerable:!1,configurable:!0}),aD.prototype.isOpen=function(){return this._delegate.isOpen()},aD.prototype.protocol=function(){return this._delegate.protocol()},aD.prototype.connect=function(e,t,r,n){return this._delegate.connect(e,t,r,n)},aD.prototype.write=function(e,t,r){return this._delegate.write(e,t,r)},aD.prototype.resetAndFlush=function(){return this._delegate.resetAndFlush()},aD.prototype.hasOngoingObservableRequests=function(){return this._delegate.hasOngoingObservableRequests()},aD.prototype.close=function(){return this._delegate.close()},aD.prototype.release=function(){return this._originalErrorHandler&&(this._delegate._errorHandler=this._originalErrorHandler),this._delegate.release()},aD);function aD(e,t){var r=uD.call(this,t)||this;return t&&(r._originalErrorHandler=e._errorHandler,e._errorHandler=r._errorHandler),r._delegate=e,r}lO.default=KO;WO={};Object.defineProperty(WO,"__esModule",{value:!0});var sD,cD,lD,fD,pD=e.error.SERVICE_UNAVAILABLE,dD=e.error.SESSION_EXPIRED;function hD(e,t,r,n){this._errorCode=e,this._handleUnavailability=t||bD,this._handleWriteFailure=r||bD,this._handleSecurityError=n||bD}function bD(e){return e}hD.create=function(e){return new hD(e.errorCode,e.handleUnavailability,e.handleWriteFailure,e.handleSecurityError)},hD.prototype.errorCode=function(){return this._errorCode},hD.prototype.handleAndTransformError=function(e,t,r){var n;return null!=(n=e)&&null!=n.code&&n.code.startsWith("Neo.ClientError.Security.")?this._handleSecurityError(e,t,r):(e=>e&&(e.code===dD||e.code===pD||"Neo.TransientError.General.DatabaseUnavailable"===e.code))(e)?this._handleUnavailability(e,t,r):(e=>e&&("Neo.ClientError.Cluster.NotALeader"===e.code||"Neo.ClientError.General.ForbiddenOnReadOnlyDatabase"===e.code))(e)?this._handleWriteFailure(e,t,r):e},WO.default=hD,Cy=Ug,cD=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),lD=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),lw=r&&r.__importStar||(sD=function(e){return(sD=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=sD(e),n=0;n<r.length;n++)"default"!==r[n]&&cD(t,e,r[n]);return lD(t,e),t}),_=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(Cy,"__esModule",{value:!0}),Cy.createChannelConnection=Cy.ConnectionErrorHandler=Cy.DelegateConnection=Cy.ChannelConnection=Cy.Connection=void 0,Wf=_(_O),Cy.Connection=Wf.default,fD=lw(Sm),Cy.ChannelConnection=fD.default,Object.defineProperty(Cy,"createChannelConnection",{enumerable:!0,get:function(){return fD.createChannelConnection}}),lw=_(lO),Cy.DelegateConnection=lw.default,lw=_(WO),Cy.ConnectionErrorHandler=lw.default,Cy.default=Wf.default;var Aw={},yD=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},_D=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))s.label=t[1];else if(6===t[0]&&s.label<a[1])s.label=a[1],a=t;else{if(!(a&&s.label<a[2])){a[2]&&s.ops.pop(),s.trys.pop();continue}s.label=a[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},vD=(Object.defineProperty(Aw,"__esModule",{value:!0}),e),mD=yv;function gD(e){var t=e.authTokenManager,r=e.userAgent,e=e.boltAgent;this._authTokenManager=t||(0,vD.staticAuthTokenManager)({}),this._userAgent=r,this._boltAgent=e}gD.prototype.authenticate=function(e){return yD(this,arguments,void 0,function(e){var t,r=e.connection,n=e.auth,o=e.skipReAuth,i=e.waitReAuth,u=e.forceReAuth;return _D(this,function(e){switch(e.label){case 0:return null==n?[3,3]:(t=!0===r.supportsReAuth&&(!mD.object.equals(r.authToken,n)&&!0!==o||!0===u),null==r.authToken||t?[4,r.connect(this._userAgent,this._boltAgent,n,i||!1)]:[3,2]);case 1:return[2,e.sent()];case 2:return[2,r];case 3:return[4,this._authTokenManager.getToken()];case 4:return t=e.sent(),mD.object.equals(t,r.authToken)?[3,6]:[4,r.connect(this._userAgent,this._boltAgent,t,!1)];case 5:return[2,e.sent()];case 6:return[2,r]}})})},gD.prototype.handleError=function(e){var t=e.connection,e=e.code;return!!(t&&e&&e.startsWith("Neo.ClientError.Security."))&&this._authTokenManager.handleSecurityException(t.authToken,e)},Aw.default=gD;var b={},OD=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},wD=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))s.label=t[1];else if(6===t[0]&&s.label<a[1])s.label=a[1],a=t;else{if(!(a&&s.label<a[2])){a[2]&&s.ops.pop(),s.trys.pop();continue}s.label=a[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}};function ED(e){e=e.connectionLivenessCheckTimeout;this._connectionLivenessCheckTimeout=e}Object.defineProperty(b,"__esModule",{value:!0}),ED.prototype.check=function(r){return OD(this,void 0,void 0,function(){var t;return wD(this,function(e){switch(e.label){case 0:return this._isCheckDisabled||this._isNewlyCreatedConnection(r)?[2,!0]:(t=Date.now()-r.idleTimestamp,0===this._connectionLivenessCheckTimeout||t>this._connectionLivenessCheckTimeout?[4,r.resetAndFlush().then(function(){return!0})]:[3,2]);case 1:return[2,e.sent()];case 2:return[2,!0]}})})},Object.defineProperty(ED.prototype,"_isCheckDisabled",{get:function(){return null==this._connectionLivenessCheckTimeout||this._connectionLivenessCheckTimeout<0},enumerable:!1,configurable:!0}),ED.prototype._isNewlyCreatedConnection=function(e){return null==e.authToken},b.default=ED;var p={},PD=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},TD=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))s.label=t[1];else if(6===t[0]&&s.label<a[1])s.label=a[1],a=t;else{if(!(a&&s.label<a[2])){a[2]&&s.ops.pop(),s.trys.pop();continue}s.label=a[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},SD=(Object.defineProperty(p,"__esModule",{value:!0}),$d);function jD(e){var t=e.clientCertificateProvider,e=e.loader;this._clientCertificateProvider=t,this._loader=e||SD.ClientCertificatesLoader,this._clientCertificate=null}jD.prototype.getClientCertificate=function(){return PD(this,void 0,void 0,function(){var t,r,n=this;return TD(this,function(e){switch(e.label){case 0:return(t=null!=this._clientCertificateProvider)?(r=null==this._clientCertificate)?[3,2]:[4,this._clientCertificateProvider.hasUpdate()]:[3,3];case 1:r=e.sent(),e.label=2;case 2:t=r,e.label=3;case 3:return t&&(this._clientCertificate=Promise.resolve(this._clientCertificateProvider.getClientCertificate()).then(this._loader.load).then(function(e){return n._clientCertificate=e,n._clientCertificate}).catch(function(e){throw n._clientCertificate=null,e})),[2,this._clientCertificate]}})})},p.default=jD;var CD,ID,E=r&&r.__extends||(CD=function(e,t){return(CD=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}CD(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),RD=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},AD=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))s.label=t[1];else if(6===t[0]&&s.label<a[1])s.label=a[1],a=t;else{if(!(a&&s.label<a[2])){a[2]&&s.ops.pop(),s.trys.pop();continue}s.label=a[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},MD=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},ND=r&&r.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||((n=n||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},C=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},kD=(Object.defineProperty(fO,"__esModule",{value:!0}),Ug),xD=e,DD=C(Aw),UD=yv,LD=C(b),FD=C(p),BD=xD.error.SERVICE_UNAVAILABLE,VD=["Neo.ClientError.Security.CredentialsExpired","Neo.ClientError.Security.Forbidden","Neo.ClientError.Security.TokenExpired","Neo.ClientError.Security.Unauthorized"],Ar=xD.internal.pool,qD=Ar.Pool,WD=Ar.PoolConfig,iw=(ID=xD.ConnectionProvider,E(zD,ID),zD.prototype._createConnectionErrorHandler=function(){return new kD.ConnectionErrorHandler(BD)},zD.prototype._getClientCertificate=function(){return RD(this,void 0,void 0,function(){return AD(this,function(e){return[2,this._config.clientCertificate.getClientCertificate()]})})},zD.prototype._createConnection=function(e,r,n){var o=this,i=e.auth;return this._createChannelConnection(r).then(function(t){return t.release=function(){return t.idleTimestamp=Date.now(),n(r,t)},o._openConnections[t.id]=t,o._authenticationProvider.authenticate({connection:t,auth:i}).catch(function(e){throw o._destroyConnection(t),e})})},zD.prototype._validateConnectionOnAcquire=function(e,t){return RD(this,arguments,void 0,function(e,t){var r,n=e.auth,o=e.skipReAuth;return AD(this,function(e){switch(e.label){case 0:if(!this._validateConnection(t))return[2,!1];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this._livenessCheckProvider.check(t)];case 2:return e.sent(),[3,4];case 3:return r=e.sent(),this._log.debug("The connection ".concat(t.id," is not alive because of an error ").concat(r.code," '").concat(r.message,"'")),[2,!1];case 4:return e.trys.push([4,6,,7]),[4,this._authenticationProvider.authenticate({connection:t,auth:n,skipReAuth:o})];case 5:return e.sent(),[2,!0];case 6:return r=e.sent(),this._log.debug("The connection ".concat(t.id," is not valid because of an error ").concat(r.code," '").concat(r.message,"'")),[2,!1];case 7:return[2]}})})},zD.prototype._validateConnectionOnRelease=function(e){return!0!==e._sticky&&this._validateConnection(e)},zD.prototype._validateConnection=function(e){return!(!e.isOpen()||this._config.maxConnectionLifetime<Date.now()-e.creationTimestamp)},zD.prototype._destroyConnection=function(e){return delete this._openConnections[e.id],e.close()},zD.prototype._verifyConnectivityAndGetServerVersion=function(e){return RD(this,arguments,void 0,function(e){var t,r,n=e.address;return AD(this,function(e){switch(e.label){case 0:return[4,this._connectionPool.acquire({},n)];case 1:t=e.sent(),r=new xD.ServerInfo(t.server,t.protocol().version),e.label=2;case 2:return e.trys.push([2,,5,7]),t.protocol().isLastMessageLogon()?[3,4]:[4,t.resetAndFlush()];case 3:e.sent(),e.label=4;case 4:return[3,7];case 5:return[4,t.release()];case 6:return e.sent(),[7];case 7:return[2,r]}})})},zD.prototype._verifyAuthentication=function(e){return RD(this,arguments,void 0,function(e){var t,r,n,o,i,u=e.getAddress,a=e.auth;return AD(this,function(e){switch(e.label){case 0:t=[],e.label=1;case 1:return e.trys.push([1,8,9,11]),[4,u()];case 2:return r=e.sent(),[4,this._connectionPool.acquire({auth:a,skipReAuth:!0},r)];case 3:if(n=e.sent(),t.push(n),o=!n.protocol().isLastMessageLogon(),n.supportsReAuth)return o&&n.supportsReAuth?[4,this._authenticationProvider.authenticate({connection:n,auth:a,waitReAuth:!0,forceReAuth:!0})]:[3,5];throw(0,xD.newError)("Driver is connected to a database that does not support user switch.");case 4:return e.sent(),[3,7];case 5:return!o||n.supportsReAuth?[3,7]:[4,this._connectionPool.acquire({auth:a},r,{requireNew:!0})];case 6:(i=e.sent())._sticky=!0,t.push(i),e.label=7;case 7:return[2,!0];case 8:if(i=e.sent(),VD.includes(i.code))return[2,!1];throw i;case 9:return[4,Promise.all(t.map(function(e){return e.release()}))];case 10:return e.sent(),[7];case 11:return[2]}})})},zD.prototype._verifyStickyConnection=function(e){return RD(this,arguments,void 0,function(e){var t,r,n=e.auth,o=e.connection;return AD(this,function(e){switch(e.label){case 0:return(t=UD.object.equals(n,o.authToken),r=!t,o._sticky=t&&!o.supportsReAuth,r||o._sticky)?[4,o.release()]:[3,2];case 1:throw e.sent(),(0,xD.newError)("Driver is connected to a database that does not support user switch.");case 2:return[2]}})})},zD.prototype.close=function(){return RD(this,void 0,void 0,function(){return AD(this,function(e){switch(e.label){case 0:return[4,this._connectionPool.close()];case 1:return e.sent(),[4,Promise.all(Object.values(this._openConnections).map(function(e){return e.close()}))];case 2:return e.sent(),[2]}})})},zD._installIdleObserverOnConnection=function(e,t){e._setIdle(t)},zD._removeIdleObserverOnConnection=function(e){e._unsetIdle()},zD.prototype._handleSecurityError=function(e,t,r){return this._authenticationProvider.handleError({connection:r,code:e.code})&&(e.retriable=!0,e.retryable=!0),"Neo.ClientError.Security.AuthorizationExpired"===e.code&&this._connectionPool.apply(t,function(e){e.authToken=null}),r&&r.close().catch(function(){}),e},zD);function zD(e,t){var r=e.id,n=e.config,o=e.log,i=e.userAgent,u=e.boltAgent,a=e.authTokenManager,e=e.newPool,e=void 0===e?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new(qD.bind.apply(qD,ND([void 0],MD(e),!1)))}:e,s=(void 0===t&&(t=null),ID.call(this)||this);return s._id=r,s._config=n,s._log=o,s._clientCertificateHolder=new FD.default({clientCertificateProvider:s._config.clientCertificate}),s._authenticationProvider=new DD.default({authTokenManager:a,userAgent:i,boltAgent:u}),s._livenessCheckProvider=new LD.default({connectionLivenessCheckTimeout:n.connectionLivenessCheckTimeout}),s._userAgent=i,s._boltAgent=u,s._createChannelConnection=t||function(n){return RD(s,void 0,void 0,function(){var t,r;return AD(this,function(e){switch(e.label){case 0:return t=kD.createChannelConnection,r=[n,this._config,this._createConnectionErrorHandler(),this._log],[4,this._clientCertificateHolder.getClientCertificate()];case 1:return[2,t.apply(void 0,r.concat([e.sent()]))]}})})},s._connectionPool=e({create:s._createConnection.bind(s),destroy:s._destroyConnection.bind(s),validateOnAcquire:s._validateConnectionOnAcquire.bind(s),validateOnRelease:s._validateConnectionOnRelease.bind(s),installIdleObserver:zD._installIdleObserverOnConnection.bind(s),removeIdleObserver:zD._removeIdleObserverOnConnection.bind(s),config:WD.fromDriverConfig(n),log:s._log}),s._openConnections={},s}fO.default=iw;var HD,GD,bo={},so=r&&r.__extends||(HD=function(e,t){return(HD=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}HD(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),YD=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},KD=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))s.label=t[1];else if(6===t[0]&&s.label<a[1])s.label=a[1],a=t;else{if(!(a&&s.label<a[2])){a[2]&&s.ops.pop(),s.trys.pop();continue}s.label=a[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},m=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Uo=(Object.defineProperty(bo,"__esModule",{value:!0}),m(fO)),ZD=Ug,Iy=e.internal.constants,QD=Iy.BOLT_PROTOCOL_V3,XD=Iy.BOLT_PROTOCOL_V4_0,JD=Iy.BOLT_PROTOCOL_V4_4,$D=Iy.BOLT_PROTOCOL_V5_1,eU=e.error.SERVICE_UNAVAILABLE,Ov=(GD=Uo.default,so(tU,GD),tU.prototype.acquireConnection=function(){return YD(this,arguments,void 0,function(e){var t,r,n=this,e=void 0===e?{}:e,o=(e.accessMode,e.database),i=e.auth,u=e.forceReAuth;return KD(this,function(e){switch(e.label){case 0:return t=ZD.ConnectionErrorHandler.create({errorCode:eU,handleSecurityError:function(e,t,r){return n._handleSecurityError(e,t,r,o)}}),[4,this._connectionPool.acquire({auth:i,forceReAuth:u},this._address)];case 1:return(r=e.sent(),i)?[4,this._verifyStickyConnection({auth:i,connection:r,address:this._address})]:[3,3];case 2:return e.sent(),[2,r];case 3:return[2,new ZD.DelegateConnection(r,t)]}})})},tU.prototype._handleSecurityError=function(e,t,r,n){return this._log.warn("Direct driver ".concat(this._id," will close connection to ").concat(t," for database '").concat(n,"' because of an error ").concat(e.code," '").concat(e.message,"'")),GD.prototype._handleSecurityError.call(this,e,t,r)},tU.prototype._hasProtocolVersion=function(n){return YD(this,void 0,void 0,function(){var t,r;return KD(this,function(e){switch(e.label){case 0:return[4,this._createChannelConnection(this._address)];case 1:return t=e.sent(),r=t.protocol()?t.protocol().version:null,[4,t.close()];case 2:return e.sent(),r?[2,n(r)]:[2,!1]}})})},tU.prototype.supportsMultiDb=function(){return YD(this,void 0,void 0,function(){return KD(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return e.isGreaterOrEqualTo(XD)})];case 1:return[2,e.sent()]}})})},tU.prototype.getNegotiatedProtocolVersion=function(){var r=this;return new Promise(function(e,t){r._hasProtocolVersion(e).catch(t)})},tU.prototype.supportsTransactionConfig=function(){return YD(this,void 0,void 0,function(){return KD(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return e.isGreaterOrEqualTo(QD)})];case 1:return[2,e.sent()]}})})},tU.prototype.supportsUserImpersonation=function(){return YD(this,void 0,void 0,function(){return KD(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return e.isGreaterOrEqualTo(JD)})];case 1:return[2,e.sent()]}})})},tU.prototype.supportsSessionAuth=function(){return YD(this,void 0,void 0,function(){return KD(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return e.isGreaterOrEqualTo($D)})];case 1:return[2,e.sent()]}})})},tU.prototype.verifyAuthentication=function(e){return YD(this,arguments,void 0,function(e){var t=this,r=e.auth;return KD(this,function(e){return[2,this._verifyAuthentication({auth:r,getAddress:function(){return t._address}})]})})},tU.prototype.verifyConnectivityAndGetServerInfo=function(){return YD(this,void 0,void 0,function(){return KD(this,function(e){switch(e.label){case 0:return[4,this._verifyConnectivityAndGetServerVersion({address:this._address})];case 1:return[2,e.sent()]}})})},tU);function tU(e){var t=e.id,r=e.address,t=GD.call(this,{id:t,config:e.config,log:e.log,userAgent:e.userAgent,boltAgent:e.boltAgent,authTokenManager:e.authTokenManager,newPool:e.newPool})||this;return t._address=r,t}bo.default=Ov;var P={},y={},ao={},o={},rU=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},nU=r&&r.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||((n=n||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},oU=(Object.defineProperty(o,"__esModule",{value:!0}),o.createValidRoutingTable=pU,e),Zn=oU.internal.constants,iU=Zn.ACCESS_MODE_WRITE,uU=Zn.ACCESS_MODE_READ,aU=oU.internal.serverAddress.ServerAddress,sU=oU.error.PROTOCOL_ERROR,cU=(lU.fromRawRoutingTable=pU,lU.prototype.forget=function(e){this.readers=fU(this.readers,e),this.writers=fU(this.writers,e)},lU.prototype.forgetRouter=function(e){this.routers=fU(this.routers,e)},lU.prototype.forgetWriter=function(e){this.writers=fU(this.writers,e)},lU.prototype.isStaleFor=function(e){return this.expirationTime.lessThan(Date.now())||this.routers.length<1||e===uU&&0===this.readers.length||e===iU&&0===this.writers.length},lU.prototype.isExpiredFor=function(e){return this.expirationTime.add(e).lessThan(Date.now())},lU.prototype.allServers=function(){return nU(nU(nU([],rU(this.routers),!1),rU(this.readers),!1),rU(this.writers),!1)},lU.prototype.toString=function(){return"RoutingTable["+"database=".concat(this.databaseName,", ")+"expirationTime=".concat(this.expirationTime,", ")+"currentTime=".concat(Date.now(),", ")+"routers=[".concat(this.routers,"], ")+"readers=[".concat(this.readers,"], ")+"writers=[".concat(this.writers,"]]")},lU);function lU(e){var e=void 0===e?{}:e,t=e.database,r=e.routers,n=e.readers,o=e.writers,i=e.expirationTime,e=e.ttl;this.database=t||null,this.databaseName=t||"default database",this.routers=r||[],this.readers=n||[],this.writers=o||[],this.expirationTime=i||(0,oU.int)(0),this.ttl=e}function fU(e,t){return e.filter(function(e){return e.asKey()!==t.asKey()})}function pU(e,t,r){var n=r.ttl,o=((t,r)=>{try{var e=(0,oU.int)(Date.now()),n=(0,oU.int)(t.ttl).multiply(1e3).add(e);return n.lessThan(e)?oU.Integer.MAX_VALUE:n}catch(e){throw(0,oU.newError)("Unable to parse TTL entry from router ".concat(r," from raw routing table:\n").concat(oU.json.stringify(t),"\nError message: ").concat(e.message),sU)}})(r,t),i=((t,r)=>{try{var n=[],o=[],i=[];return t.servers.forEach(function(e){var t=e.role,e=e.addresses;"ROUTE"===t?n=hU(e).map(function(e){return aU.fromUrl(e)}):"WRITE"===t?i=hU(e).map(function(e){return aU.fromUrl(e)}):"READ"===t&&(o=hU(e).map(function(e){return aU.fromUrl(e)}))}),{routers:n,readers:o,writers:i}}catch(e){throw(0,oU.newError)("Unable to parse servers entry from router ".concat(r," from addresses:\n").concat(oU.json.stringify(t.servers),"\nError message: ").concat(e.message),sU)}})(r,t),u=i.routers,a=i.readers,i=i.writers;return dU(u,"routers",t),dU(a,"readers",t),new cU({database:e||r.db,routers:u,readers:a,writers:i,expirationTime:o,ttl:n})}function dU(e,t,r){if(0===e.length)throw(0,oU.newError)("Received no "+t+" from router "+r,sU)}function hU(e){if(Array.isArray(e))return Array.from(e);throw new TypeError("Array expected but got: "+e)}o.default=cU;var fp=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},bU=(Object.defineProperty(ao,"__esModule",{value:!0}),fp(o));function yU(e){this._routingContext=e}yU.prototype.lookupRoutingTableOnRouter=function(t,r,n,o){var i=this;return t._acquireConnection(function(e){return i._requestRawRoutingTable(e,t,r,n,o).then(function(e){return e.isNull?null:bU.default.fromRawRoutingTable(r,n,e)})})},yU.prototype._requestRawRoutingTable=function(r,n,o,e,i){var u=this;return new Promise(function(e,t){r.protocol().requestRoutingInformation({routingContext:u._routingContext,databaseName:o,impersonatedUser:i,sessionContext:{bookmarks:n._lastBookmarks,mode:n._mode,database:n._database,afterComplete:n._onComplete},onCompleted:e,onError:t})})},ao.default=yU;var _U,vU,mU,Jf=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},nf=(Object.defineProperty(y,"__esModule",{value:!0}),y.RoutingTable=y.Rediscovery=void 0,Jf(ao)),v=(y.Rediscovery=nf.default,Jf(o)),ff=(y.RoutingTable=v.default,y.default=nf.default,r&&r.__extends||(_U=function(e,t){return(_U=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}_U(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),gU=r&&r.__assign||function(){return(gU=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},OU=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),wU=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),uf=r&&r.__importStar||(vU=function(e){return(vU=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=vU(e),n=0;n<r.length;n++)"default"!==r[n]&&OU(t,e,r[n]);return wU(t,e),t}),EU=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},PU=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))s.label=t[1];else if(6===t[0]&&s.label<a[1])s.label=a[1],a=t;else{if(!(a&&s.label<a[2])){a[2]&&s.ops.pop(),s.trys.pop();continue}s.label=a[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},TU=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},SU=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},ro=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},jU=(Object.defineProperty(P,"__esModule",{value:!0}),e),CU=uf(y),IU=$d,RU=ro(nO),cf=ro(fO),AU=df,MU=Ug,NU=yv,kU=jU.error.SERVICE_UNAVAILABLE,xU=jU.error.SESSION_EXPIRED,DU=jU.internal.bookmarks.Bookmarks,w=jU.internal.constants,UU=w.ACCESS_MODE_READ,LU=w.ACCESS_MODE_WRITE,FU=w.BOLT_PROTOCOL_V3,BU=w.BOLT_PROTOCOL_V4_0,VU=w.BOLT_PROTOCOL_V4_4,qU=w.BOLT_PROTOCOL_V5_1,WU=null,zU=(0,jU.int)(3e4),bd=(mU=cf.default,ff(HU,mU),HU.prototype._createConnectionErrorHandler=function(){return new MU.ConnectionErrorHandler(xU)},HU.prototype._handleUnavailability=function(e,t,r){return this._log.warn("Routing driver ".concat(this._id," will forget ").concat(t," for database '").concat(r,"' because of an error ").concat(e.code," '").concat(e.message,"'")),this.forget(t,r||WU),e},HU.prototype._handleSecurityError=function(e,t,r,n){return this._log.warn("Routing driver ".concat(this._id," will close connections to ").concat(t," for database '").concat(n,"' because of an error ").concat(e.code," '").concat(e.message,"'")),mU.prototype._handleSecurityError.call(this,e,t,r,n)},HU.prototype._handleWriteFailure=function(e,t,r){return this._log.warn("Routing driver ".concat(this._id," will forget writer ").concat(t," for database '").concat(r,"' because of an error ").concat(e.code," '").concat(e.message,"'")),this.forgetWriter(t,r||WU),(0,jU.newError)("No longer possible to write to server at "+t,xU,e)},HU.prototype.acquireConnection=function(){return EU(this,arguments,void 0,function(e){var n,t,r,o,i=this,e=void 0===e?{}:e,u=e.accessMode,a=e.database,s=e.bookmarks,c=e.impersonatedUser,l=e.onDatabaseNameResolved,f=e.auth,p=e.homeDb;return PU(this,function(e){switch(e.label){case 0:return(n={database:a||WU},t=new MU.ConnectionErrorHandler(xU,function(e,t){return i._handleUnavailability(e,t,n.database)},function(e,t){return i._handleWriteFailure(e,t,null!=p?p:n.database)},function(e,t,r){return i._handleSecurityError(e,t,r,n.database)}),this._startTime=(new Date).getTime(),this.SSREnabled()&&void 0!==p&&""===a)?!(r=this._routingTableRegistry.get(p,function(){return new CU.RoutingTable({database:p})}))||r.isStaleFor(u)?[3,2]:[4,this._getConnectionFromRoutingTable(r,f,u,t)]:[3,2];case 1:if(r=e.sent(),this.SSREnabled())return[2,r];r.release(),e.label=2;case 2:return[4,this._freshRoutingTable({accessMode:u,database:n.database,bookmarks:s,impersonatedUser:c,auth:f,onDatabaseNameResolved:function(e){n.database=n.database||e,l&&l(e)}})];case 3:return o=e.sent(),[2,this._getConnectionFromRoutingTable(o,f,u,t)]}})})},HU.prototype._getConnectionFromRoutingTable=function(i,u,a,s){return EU(this,void 0,void 0,function(){var t,r,n,o;return PU(this,function(e){switch(e.label){case 0:if(a===UU)r=this._loadBalancingStrategy.selectReader(i.readers),t="read";else{if(a!==LU)throw(0,jU.newError)("Illegal mode "+a);r=this._loadBalancingStrategy.selectWriter(i.writers),t="write"}if(!r)throw(0,jU.newError)("Failed to obtain connection towards ".concat(t," server. Known routing table is: ").concat(i),xU);e.label=1;case 1:return e.trys.push([1,5,,6]),[4,this._connectionPool.acquire({auth:u,startTime:this._startTime},r)];case 2:return(n=e.sent(),u)?[4,this._verifyStickyConnection({auth:u,connection:n,address:r})]:[3,4];case 3:return e.sent(),[2,n];case 4:return[2,new MU.DelegateConnection(n,s)];case 5:throw o=e.sent(),s.handleAndTransformError(o,r);case 6:return[2]}})})},HU.prototype._hasProtocolVersion=function(u){return EU(this,void 0,void 0,function(){var t,r,n,o,i;return PU(this,function(e){switch(e.label){case 0:return[4,this._resolveSeedRouter(this._seedRouter)];case 1:t=e.sent(),n=0,e.label=2;case 2:if(!(n<t.length))return[3,8];e.label=3;case 3:return e.trys.push([3,6,,7]),[4,this._createChannelConnection(t[n])];case 4:return i=e.sent(),o=i.protocol()?i.protocol().version:null,[4,i.close()];case 5:return e.sent(),o?[2,u(o)]:[2,!1];case 6:return i=e.sent(),r=i,[3,7];case 7:return n++,[3,2];case 8:if(r)throw r;return[2,!1]}})})},HU.prototype.supportsMultiDb=function(){return EU(this,void 0,void 0,function(){return PU(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return e.isGreaterOrEqualTo(BU)})];case 1:return[2,e.sent()]}})})},HU.prototype.supportsTransactionConfig=function(){return EU(this,void 0,void 0,function(){return PU(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return e.isGreaterOrEqualTo(FU)})];case 1:return[2,e.sent()]}})})},HU.prototype.supportsUserImpersonation=function(){return EU(this,void 0,void 0,function(){return PU(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return e.isGreaterOrEqualTo(VU)})];case 1:return[2,e.sent()]}})})},HU.prototype.supportsSessionAuth=function(){return EU(this,void 0,void 0,function(){return PU(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return e.isGreaterOrEqualTo(qU)})];case 1:return[2,e.sent()]}})})},HU.prototype.getNegotiatedProtocolVersion=function(){var r=this;return new Promise(function(e,t){r._hasProtocolVersion(e).catch(t)})},HU.prototype.verifyAuthentication=function(e){return EU(this,arguments,void 0,function(e){var t=this,n=e.database,o=e.accessMode,i=e.auth;return PU(this,function(e){return this._startTime=(new Date).getTime(),[2,this._verifyAuthentication({auth:i,getAddress:function(){return EU(t,void 0,void 0,function(){var t,r;return PU(this,function(e){switch(e.label){case 0:return t={database:n||WU},[4,this._freshRoutingTable({accessMode:o,database:t.database,auth:i,onDatabaseNameResolved:function(e){t.database=t.database||e}})];case 1:if(r=e.sent(),0===(r=o===LU?r.writers:r.readers).length)throw(0,jU.newError)("No servers available for database '".concat(t.database,"' with access mode '").concat(o,"'"),kU);return[2,r[0]]}})})}})]})})},HU.prototype.verifyConnectivityAndGetServerInfo=function(e){return EU(this,arguments,void 0,function(e){var t,r,n,o,i,u,a,s,c,l=e.database,f=e.accessMode;return PU(this,function(e){switch(e.label){case 0:return t={database:l||WU},this._startTime=(new Date).getTime(),[4,this._freshRoutingTable({accessMode:f,database:t.database,onDatabaseNameResolved:function(e){t.database=t.database||e}})];case 1:r=e.sent(),r=f===LU?r.writers:r.readers,n=(0,jU.newError)("No servers available for database '".concat(t.database,"' with access mode '").concat(f,"'"),kU),e.label=2;case 2:e.trys.push([2,9,10,11]),o=TU(r),i=o.next(),e.label=3;case 3:if(i.done)return[3,8];u=i.value,e.label=4;case 4:return e.trys.push([4,6,,7]),[4,this._verifyConnectivityAndGetServerVersion({address:u})];case 5:return[2,e.sent()];case 6:return a=e.sent(),n=a,[3,7];case 7:return i=o.next(),[3,3];case 8:return[3,11];case 9:return a=e.sent(),s={error:a},[3,11];case 10:try{i&&!i.done&&(c=o.return)&&c.call(o)}finally{if(s)throw s.error}return[7];case 11:throw n}})})},HU.prototype.forget=function(t,e){this._routingTableRegistry.apply(e,{applyWhenExists:function(e){return e.forget(t)}}),this._connectionPool.purge(t).catch(function(){})},HU.prototype.forgetWriter=function(t,e){this._routingTableRegistry.apply(e,{applyWhenExists:function(e){return e.forgetWriter(t)}})},HU.prototype._freshRoutingTable=function(e){var e=void 0===e?{}:e,t=e.accessMode,r=e.database,n=e.bookmarks,o=e.impersonatedUser,i=e.onDatabaseNameResolved,e=e.auth,u=this._routingTableRegistry.get(r,function(){return new CU.RoutingTable({database:r})});return u.isStaleFor(t)?(this._log.info('Routing table is stale for database: "'.concat(r,'" and access mode: "').concat(t,'": ').concat(u)),this._refreshRoutingTable(u,n,o,e).then(function(e){return i(e.database),e})):u},HU.prototype._refreshRoutingTable=function(e,t,r,n){var o=e.routers;return this._useSeedRouter?this._fetchRoutingTableFromSeedRouterFallbackToKnownRouters(o,e,t,r,n):this._fetchRoutingTableFromKnownRoutersFallbackToSeedRouter(o,e,t,r,n)},HU.prototype._fetchRoutingTableFromSeedRouterFallbackToKnownRouters=function(u,a,s,c,l){return EU(this,void 0,void 0,function(){var t,r,n,o,i;return PU(this,function(e){switch(e.label){case 0:return t=[],[4,this._fetchRoutingTableUsingSeedRouter(t,this._seedRouter,a,s,c,l)];case 1:return(t=SU.apply(void 0,[e.sent(),2]),r=t[0],n=t[1],r)?(this._useSeedRouter=!1,[3,4]):[3,2];case 2:return[4,this._fetchRoutingTableUsingKnownRouters(u,a,s,c,l)];case 3:o=SU.apply(void 0,[e.sent(),2]),i=o[0],r=i,n=o[1]||n,e.label=4;case 4:return[4,this._applyRoutingTableIfPossible(a,r,n)];case 5:return[2,e.sent()]}})})},HU.prototype._fetchRoutingTableFromKnownRoutersFallbackToSeedRouter=function(o,i,u,a,s){return EU(this,void 0,void 0,function(){var t,r,n;return PU(this,function(e){switch(e.label){case 0:return[4,this._fetchRoutingTableUsingKnownRouters(o,i,u,a,s)];case 1:return r=SU.apply(void 0,[e.sent(),2]),t=r[0],r=r[1],t?[3,3]:[4,this._fetchRoutingTableUsingSeedRouter(o,this._seedRouter,i,u,a,s)];case 2:n=SU.apply(void 0,[e.sent(),2]),t=n[0],r=n[1],e.label=3;case 3:return[4,this._applyRoutingTableIfPossible(i,t,r)];case 4:return[2,e.sent()]}})})},HU.prototype._fetchRoutingTableUsingKnownRouters=function(n,o,i,u,a){return EU(this,void 0,void 0,function(){var t,r;return PU(this,function(e){switch(e.label){case 0:return[4,this._fetchRoutingTable(n,o,i,u,a)];case 1:return(t=SU.apply(void 0,[e.sent(),2]),r=t[0],t=t[1],r)?[2,[r,null]]:(r=n.length-1,HU._forgetRouter(o,n,r),[2,[null,t]])}})})},HU.prototype._fetchRoutingTableUsingSeedRouter=function(r,n,o,i,u,a){return EU(this,void 0,void 0,function(){var t;return PU(this,function(e){switch(e.label){case 0:return[4,this._resolveSeedRouter(n)];case 1:return t=e.sent(),t=t.filter(function(e){return r.indexOf(e)<0}),[4,this._fetchRoutingTable(t,o,i,u,a)];case 2:return[2,e.sent()]}})})},HU.prototype._resolveSeedRouter=function(n){return EU(this,void 0,void 0,function(){var t,r=this;return PU(this,function(e){switch(e.label){case 0:return[4,this._hostNameResolver.resolve(n)];case 1:return t=e.sent(),[4,Promise.all(t.map(function(e){return r._dnsResolver.resolve(e)}))];case 2:return t=e.sent(),[2,[].concat.apply([],t)]}})})},HU.prototype._fetchRoutingTable=function(s,c,l,f,p){return EU(this,void 0,void 0,function(){var t=this;return PU(this,function(e){return[2,s.reduce(function(i,u,a){return EU(t,void 0,void 0,function(){var t,r,n,o;return PU(this,function(e){switch(e.label){case 0:return[4,i];case 1:return(t=SU.apply(void 0,[e.sent(),1]),t=t[0])?[2,[t,null]]:(HU._forgetRouter(c,s,a-1),[4,this._createSessionForRediscovery(u,l,f,p)]);case 2:if(t=SU.apply(void 0,[e.sent(),2]),r=t[0],n=t[1],!r)return[3,8];e.label=3;case 3:return e.trys.push([3,5,6,7]),[4,this._rediscovery.lookupRoutingTableOnRouter(r,c.database,u,f)];case 4:return[2,[e.sent(),null]];case 5:return o=e.sent(),[2,this._handleRediscoveryError(o,u)];case 6:return r.close(),[7];case 7:return[3,9];case 8:return[2,[null,n]];case 9:return[2]}})})},Promise.resolve([null,null]))]})})},HU.prototype._createSessionForRediscovery=function(o,i,u,a){return EU(this,void 0,void 0,function(){var t,r,n=this;return PU(this,function(e){switch(e.label){case 0:return e.trys.push([0,4,,5]),[4,this._connectionPool.acquire({auth:a,startTime:this._startTime},o)];case 1:return(t=e.sent(),a)?[4,this._verifyStickyConnection({auth:a,connection:t,address:o})]:[3,3];case 2:e.sent(),e.label=3;case 3:return r=MU.ConnectionErrorHandler.create({errorCode:xU,handleSecurityError:function(e,t,r){return n._handleSecurityError(e,t,r)}}),r=t._sticky?new MU.DelegateConnection(t):new MU.DelegateConnection(t,r),r=new RU.default(r),t.protocol().version.isLessThan({major:4,minor:0})?[2,[new jU.Session({mode:LU,bookmarks:DU.empty(),connectionProvider:r}),null]]:[2,[new jU.Session({mode:UU,database:"system",bookmarks:i,connectionProvider:r,impersonatedUser:u}),null]];case 4:return r=e.sent(),[2,this._handleRediscoveryError(r,o)];case 5:return[2]}})})},HU.prototype._handleRediscoveryError=function(e,t){if(["Neo.ClientError.Database.DatabaseNotFound","Neo.ClientError.Transaction.InvalidBookmark","Neo.ClientError.Transaction.InvalidBookmarkMixture","Neo.ClientError.Statement.ArgumentError","Neo.ClientError.Request.Invalid","Neo.ClientError.Statement.TypeError","N/A"].includes(e.code)||null!=(n=(r=e).code)&&n.startsWith("Neo.ClientError.Security.")&&!["Neo.ClientError.Security.AuthorizationExpired"].includes(r.code))throw e;if("Neo.ClientError.Procedure.ProcedureNotFound"===e.code)throw(0,jU.newError)("Server at ".concat(t.asHostPort()," can't perform routing. Make sure you are connecting to a causal cluster"),kU,e);var r,n;return this._log.warn("unable to fetch routing table because of an error ".concat(e)),[null,e]},HU.prototype._applyRoutingTableIfPossible=function(t,r,n){return EU(this,void 0,void 0,function(){return PU(this,function(e){switch(e.label){case 0:if(r)return 0===r.writers.length&&(this._useSeedRouter=!0),[4,this._updateRoutingTable(r)];throw(0,jU.newError)("Could not perform discovery. No routing servers available. Known routing table: ".concat(t),kU,n);case 1:return e.sent(),[2,r]}})})},HU.prototype._updateRoutingTable=function(t){return EU(this,void 0,void 0,function(){return PU(this,function(e){switch(e.label){case 0:return[4,this._connectionPool.keepAll(t.allServers())];case 1:return e.sent(),this._routingTableRegistry.removeExpired(),this._routingTableRegistry.register(t),this._log.info("Updated routing table ".concat(t)),[2]}})})},HU._forgetRouter=function(e,t,r){t=t[r];e&&t&&e.forgetRouter(t)},HU.prototype._channelSsrCallback=function(e,t){if("OPEN"===t)!0===e?this._withSSR=this._withSSR+1:this._withoutSSR=this._withoutSSR+1;else{if("CLOSE"!==t)throw(0,jU.newError)("Channel SSR Callback invoked with action other than 'OPEN' or 'CLOSE'");!0===e?this._withSSR=this._withSSR-1:this._withoutSSR=this._withoutSSR-1}},HU.prototype.SSREnabled=function(){return 0<this._withSSR&&0===this._withoutSSR},HU);function HU(e){var t=e.id,r=e.address,n=e.routingContext,o=e.hostNameResolver,i=e.log,u=e.routingTablePurgeDelay,a=mU.call(this,{id:t,config:e.config,log:i,userAgent:e.userAgent,boltAgent:e.boltAgent,authTokenManager:e.authTokenManager,newPool:e.newPool},function(n){return EU(a,void 0,void 0,function(){var t,r;return PU(this,function(e){switch(e.label){case 0:return t=MU.createChannelConnection,r=[n,this._config,this._createConnectionErrorHandler(),this._log],[4,this._clientCertificateHolder.getClientCertificate()];case 1:return[2,t.apply(void 0,r.concat([e.sent(),this._routingContext,this._channelSsrCallback.bind(this)]))]}})})})||this;return a._routingContext=gU(gU({},n),{address:r.toString()}),a._seedRouter=r,a._rediscovery=new CU.default(a._routingContext),a._loadBalancingStrategy=new AU.LeastConnectedLoadBalancingStrategy(a._connectionPool),a._startTime=0,a._hostNameResolver=o,a._dnsResolver=new IU.HostNameResolver,a._log=i,a._useSeedRouter=!0,a._routingTableRegistry=new fL(u?(0,jU.int)(u):zU),a._refreshRoutingTable=NU.functional.reuseOngoingRequest(a._refreshRoutingTable,a),a._withSSR=0,a._withoutSSR=0,a}P.default=bd;pL.prototype.register=function(e){return this._tables.set(e.database,e),this},pL.prototype.apply=function(e,t){var t=void 0===t?{}:t,r=t.applyWhenExists,t=t.applyWhenDontExists,t=void 0===t?function(){}:t;return this._tables.has(e)?r(this._tables.get(e)):"string"==typeof e||null===e?t():this._forEach(r),this},pL.prototype.get=function(e,t){return this._tables.has(e)?this._tables.get(e):"function"==typeof t?t():t},pL.prototype.removeExpired=function(){var t=this;return this._removeIf(function(e){return e.isExpiredFor(t._routingTablePurgeDelay)})},pL.prototype._forEach=function(e){var t,r;try{for(var n=TU(this._tables),o=n.next();!o.done;o=n.next())e(SU(o.value,2)[1])}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return this},pL.prototype._remove=function(e){return this._tables.delete(e),this},pL.prototype._removeIf=function(e){var t,r;try{for(var n=TU(this._tables),o=n.next();!o.done;o=n.next()){var i=SU(o.value,2),u=i[0];e(i[1])&&this._remove(u)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return this};var GU,YU,KU,ZU,QU,XU,JU,$U,eL,tL,rL,nL,x,oL,iL,uL,aL,sL,cL,lL,fL=pL;function pL(e){this._tables=new Map,this._routingTablePurgeDelay=e}function dL(e,t,r){void 0===r&&(r={}),uL(e,"Bolt URL");var n,o=cL.parseDatabaseUrl(e),i=!1,u=!1;switch(o.scheme){case"bolt":break;case"bolt+s":u=!0,n="TRUST_SYSTEM_CA_SIGNED_CERTIFICATES";break;case"bolt+ssc":u=!0,n="TRUST_ALL_CERTIFICATES";break;case"neo4j":i=!0;break;case"neo4j+s":n="TRUST_SYSTEM_CA_SIGNED_CERTIFICATES",i=u=!0;break;case"neo4j+ssc":n="TRUST_ALL_CERTIFICATES",i=u=!0;break;default:throw new Error("Unknown scheme: ".concat(o.scheme))}if(u){if("encrypted"in r||"trust"in r)throw new Error("Encryption/trust can only be configured either through URL or config, not both");r.encrypted=iL,r.trust=n,r.clientCertificate=(0,x.resolveCertificateProvider)(r.clientCertificate)}var a,s="object"==typeof(a=t=t)&&null!=a&&"getToken"in a&&"handleSecurityException"in a&&"function"==typeof a.getToken&&"function"==typeof a.handleSecurityException?t:((a=(a=t)||{}).scheme=a.scheme||"none",(0,x.staticAuthTokenManager)({authToken:a})),c=(r.userAgent=r.userAgent||lL,r.boltAgent=x.internal.boltAgent.fromVersion(nL.default),sL.fromUrl(o.hostAndPort)),t={address:c,typename:i?"Routing":"Direct",routing:i};return new rL.Driver(t,r,(()=>{if(i)return function(e,t,r,n){return new oL.RoutingConnectionProvider({id:e,config:t,log:r,hostNameResolver:n,authTokenManager:s,address:c,userAgent:t.userAgent,boltAgent:t.boltAgent,routingContext:o.query})};if(aL(o.query))return function(e,t,r){return new oL.DirectConnectionProvider({id:e,config:t,log:r,authTokenManager:s,address:c,userAgent:t.userAgent,boltAgent:t.boltAgent})};throw new Error("Parameters are not supported with none routed scheme. Given URL: '".concat(e,"'"))})())}function hL(r,n){return eL(this,void 0,void 0,function(){var t;return tL(this,function(e){switch(e.label){case 0:t=dL(r,{scheme:"none",principal:"",credentials:""},n),e.label=1;case 1:return e.trys.push([1,,3,5]),[4,t.getNegotiatedProtocolVersion()];case 2:return e.sent(),[2,!0];case 3:return[4,t.close()];case 4:return e.sent(),[7];case 5:return[2]}})})}return rf=Jg,GU=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(rf,"__esModule",{value:!0}),rf.RoutingConnectionProvider=rf.DirectConnectionProvider=rf.PooledConnectionProvider=rf.SingleConnectionProvider=void 0,YU=nO,Object.defineProperty(rf,"SingleConnectionProvider",{enumerable:!0,get:function(){return GU(YU).default}}),KU=fO,Object.defineProperty(rf,"PooledConnectionProvider",{enumerable:!0,get:function(){return GU(KU).default}}),ZU=bo,Object.defineProperty(rf,"DirectConnectionProvider",{enumerable:!0,get:function(){return GU(ZU).default}}),QU=P,Object.defineProperty(rf,"RoutingConnectionProvider",{enumerable:!0,get:function(){return GU(QU).default}}),op=u,JU=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),$U=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),wd=r&&r.__importStar||(XU=function(e){return(XU=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=XU(e),n=0;n<r.length;n++)"default"!==r[n]&&JU(t,e,r[n]);return $U(t,e),t}),O=r&&r.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||JU(t,e,r)},Object.defineProperty(op,"__esModule",{value:!0}),op.packstream=op.channel=op.buf=op.bolt=op.loadBalancing=void 0,op.loadBalancing=wd(df),op.bolt=wd(F),op.buf=wd(xh),op.channel=wd($d),op.packstream=wd(wm),O(Jg,op),I=U,eL=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},tL=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))s.label=t[1];else if(6===t[0]&&s.label<a[1])s.label=a[1],a=t;else{if(!(a&&s.label<a[2])){a[2]&&s.ops.pop(),s.trys.pop();continue}s.label=a[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},g=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(I,"__esModule",{value:!0}),I.UnboundRelationship=I.Relationship=I.Node=I.Record=I.ServerInfo=I.GqlStatusObject=I.Notification=I.QueryStatistics=I.ProfiledPlan=I.Plan=I.ResultSummary=I.RxResult=I.RxManagedTransaction=I.RxTransaction=I.RxSession=I.EagerResult=I.Result=I.ManagedTransaction=I.Transaction=I.Session=I.Driver=I.temporal=I.spatial=I.graph=I.error=I.routing=I.session=I.types=I.logging=I.auth=I.isRetryableError=I.isRetriableError=I.Neo4jError=I.integer=I.isUnsupportedType=I.isUnboundRelationship=I.isRelationship=I.isPathSegment=I.isPath=I.isNode=I.isDateTime=I.isLocalDateTime=I.isDate=I.isTime=I.isLocalTime=I.isDuration=I.isPoint=I.isInt=I.int=I.authTokenManagers=void 0,I.isUUID=I.uuid=I.UUID=I.ProtocolVersion=I.StandardCase=I.RecordObjectMapping=I.mappingDecorators=I.rule=I.Rules=I.Rule=I.Vector=I.vector=I.isVector=I.clientCertificateProviders=I.notificationFilterMinimumSeverityLevel=I.notificationFilterDisabledClassification=I.notificationFilterDisabledCategory=I.notificationSeverityLevel=I.notificationClassification=I.notificationCategory=I.resultTransformers=I.bookmarkManager=I.DateTime=I.LocalDateTime=I.Date=I.Time=I.LocalTime=I.Duration=I.Integer=I.Point=I.PathSegment=I.Path=void 0,I.driver=dL,I.hasReachableServer=hL,rL=L,Object.defineProperty(I,"Driver",{enumerable:!0,get:function(){return rL.Driver}}),nL=g(fe),x=e,Object.defineProperty(I,"authTokenManagers",{enumerable:!0,get:function(){return x.authTokenManagers}}),Object.defineProperty(I,"Neo4jError",{enumerable:!0,get:function(){return x.Neo4jError}}),Object.defineProperty(I,"isRetriableError",{enumerable:!0,get:function(){return x.isRetriableError}}),Object.defineProperty(I,"isRetryableError",{enumerable:!0,get:function(){return x.isRetryableError}}),Object.defineProperty(I,"error",{enumerable:!0,get:function(){return x.error}}),Object.defineProperty(I,"Integer",{enumerable:!0,get:function(){return x.Integer}}),Object.defineProperty(I,"int",{enumerable:!0,get:function(){return x.int}}),Object.defineProperty(I,"isInt",{enumerable:!0,get:function(){return x.isInt}}),Object.defineProperty(I,"isPoint",{enumerable:!0,get:function(){return x.isPoint}}),Object.defineProperty(I,"Point",{enumerable:!0,get:function(){return x.Point}}),Object.defineProperty(I,"Date",{enumerable:!0,get:function(){return x.Date}}),Object.defineProperty(I,"DateTime",{enumerable:!0,get:function(){return x.DateTime}}),Object.defineProperty(I,"Duration",{enumerable:!0,get:function(){return x.Duration}}),Object.defineProperty(I,"isDate",{enumerable:!0,get:function(){return x.isDate}}),Object.defineProperty(I,"isDateTime",{enumerable:!0,get:function(){return x.isDateTime}}),Object.defineProperty(I,"isDuration",{enumerable:!0,get:function(){return x.isDuration}}),Object.defineProperty(I,"isLocalDateTime",{enumerable:!0,get:function(){return x.isLocalDateTime}}),Object.defineProperty(I,"isLocalTime",{enumerable:!0,get:function(){return x.isLocalTime}}),Object.defineProperty(I,"isNode",{enumerable:!0,get:function(){return x.isNode}}),Object.defineProperty(I,"isPath",{enumerable:!0,get:function(){return x.isPath}}),Object.defineProperty(I,"isPathSegment",{enumerable:!0,get:function(){return x.isPathSegment}}),Object.defineProperty(I,"isRelationship",{enumerable:!0,get:function(){return x.isRelationship}}),Object.defineProperty(I,"isTime",{enumerable:!0,get:function(){return x.isTime}}),Object.defineProperty(I,"isUnboundRelationship",{enumerable:!0,get:function(){return x.isUnboundRelationship}}),Object.defineProperty(I,"isUnsupportedType",{enumerable:!0,get:function(){return x.isUnsupportedType}}),Object.defineProperty(I,"LocalDateTime",{enumerable:!0,get:function(){return x.LocalDateTime}}),Object.defineProperty(I,"LocalTime",{enumerable:!0,get:function(){return x.LocalTime}}),Object.defineProperty(I,"Time",{enumerable:!0,get:function(){return x.Time}}),Object.defineProperty(I,"Node",{enumerable:!0,get:function(){return x.Node}}),Object.defineProperty(I,"Path",{enumerable:!0,get:function(){return x.Path}}),Object.defineProperty(I,"PathSegment",{enumerable:!0,get:function(){return x.PathSegment}}),Object.defineProperty(I,"Relationship",{enumerable:!0,get:function(){return x.Relationship}}),Object.defineProperty(I,"UnboundRelationship",{enumerable:!0,get:function(){return x.UnboundRelationship}}),Object.defineProperty(I,"Record",{enumerable:!0,get:function(){return x.Record}}),Object.defineProperty(I,"ResultSummary",{enumerable:!0,get:function(){return x.ResultSummary}}),Object.defineProperty(I,"Plan",{enumerable:!0,get:function(){return x.Plan}}),Object.defineProperty(I,"ProfiledPlan",{enumerable:!0,get:function(){return x.ProfiledPlan}}),Object.defineProperty(I,"QueryStatistics",{enumerable:!0,get:function(){return x.QueryStatistics}}),Object.defineProperty(I,"Notification",{enumerable:!0,get:function(){return x.Notification}}),Object.defineProperty(I,"GqlStatusObject",{enumerable:!0,get:function(){return x.GqlStatusObject}}),Object.defineProperty(I,"ServerInfo",{enumerable:!0,get:function(){return x.ServerInfo}}),Object.defineProperty(I,"Result",{enumerable:!0,get:function(){return x.Result}}),Object.defineProperty(I,"EagerResult",{enumerable:!0,get:function(){return x.EagerResult}}),Object.defineProperty(I,"auth",{enumerable:!0,get:function(){return x.auth}}),Object.defineProperty(I,"Session",{enumerable:!0,get:function(){return x.Session}}),Object.defineProperty(I,"Transaction",{enumerable:!0,get:function(){return x.Transaction}}),Object.defineProperty(I,"ManagedTransaction",{enumerable:!0,get:function(){return x.ManagedTransaction}}),Object.defineProperty(I,"bookmarkManager",{enumerable:!0,get:function(){return x.bookmarkManager}}),Object.defineProperty(I,"routing",{enumerable:!0,get:function(){return x.routing}}),Object.defineProperty(I,"resultTransformers",{enumerable:!0,get:function(){return x.resultTransformers}}),Object.defineProperty(I,"notificationCategory",{enumerable:!0,get:function(){return x.notificationCategory}}),Object.defineProperty(I,"notificationClassification",{enumerable:!0,get:function(){return x.notificationClassification}}),Object.defineProperty(I,"notificationSeverityLevel",{enumerable:!0,get:function(){return x.notificationSeverityLevel}}),Object.defineProperty(I,"notificationFilterDisabledCategory",{enumerable:!0,get:function(){return x.notificationFilterDisabledCategory}}),Object.defineProperty(I,"notificationFilterDisabledClassification",{enumerable:!0,get:function(){return x.notificationFilterDisabledClassification}}),Object.defineProperty(I,"notificationFilterMinimumSeverityLevel",{enumerable:!0,get:function(){return x.notificationFilterMinimumSeverityLevel}}),Object.defineProperty(I,"clientCertificateProviders",{enumerable:!0,get:function(){return x.clientCertificateProviders}}),Object.defineProperty(I,"isVector",{enumerable:!0,get:function(){return x.isVector}}),Object.defineProperty(I,"Vector",{enumerable:!0,get:function(){return x.Vector}}),Object.defineProperty(I,"vector",{enumerable:!0,get:function(){return x.vector}}),Object.defineProperty(I,"Rule",{enumerable:!0,get:function(){return x.Rule}}),Object.defineProperty(I,"Rules",{enumerable:!0,get:function(){return x.Rules}}),Object.defineProperty(I,"rule",{enumerable:!0,get:function(){return x.rule}}),Object.defineProperty(I,"mappingDecorators",{enumerable:!0,get:function(){return x.mappingDecorators}}),Object.defineProperty(I,"RecordObjectMapping",{enumerable:!0,get:function(){return x.RecordObjectMapping}}),Object.defineProperty(I,"StandardCase",{enumerable:!0,get:function(){return x.StandardCase}}),Object.defineProperty(I,"ProtocolVersion",{enumerable:!0,get:function(){return x.ProtocolVersion}}),Object.defineProperty(I,"UUID",{enumerable:!0,get:function(){return x.UUID}}),Object.defineProperty(I,"uuid",{enumerable:!0,get:function(){return x.uuid}}),Object.defineProperty(I,"isUUID",{enumerable:!0,get:function(){return x.isUUID}}),oL=u,mb=g(bn),I.RxSession=mb.default,k_=g(pe),I.RxTransaction=k_.default,db=g(G),I.RxManagedTransaction=db.default,g=g(S),I.RxResult=g.default,Dh=x.internal.util,iL=Dh.ENCRYPTION_ON,uL=Dh.assertString,aL=Dh.isEmptyObjectOrNull,sL=x.internal.serverAddress.ServerAddress,cL=x.internal.urlUtil,lL="neo4j-javascript/"+nL.default,I.logging=Dh={console:function(e){return{level:e,logger:function(e,t){return console.log("".concat(r.Date.now()," ").concat(e.toUpperCase()," ").concat(t))}}}},tf={Node:x.Node,Relationship:x.Relationship,UnboundRelationship:x.UnboundRelationship,PathSegment:x.PathSegment,Path:x.Path,Result:x.Result,EagerResult:x.EagerResult,ResultSummary:x.ResultSummary,Record:x.Record,Point:x.Point,Date:x.Date,DateTime:x.DateTime,Duration:x.Duration,LocalDateTime:x.LocalDateTime,LocalTime:x.LocalTime,Time:x.Time,Integer:x.Integer,Vector:x.Vector,Rule:x.Rule,Rules:x.Rules,ProtocolVersion:x.ProtocolVersion},I.types=tf,wb={READ:rL.READ,WRITE:rL.WRITE},I.session=wb,Zh={toNumber:x.toNumber,toString:x.toString,inSafeRange:x.inSafeRange},I.integer=Zh,ob={isPoint:x.isPoint},I.spatial=ob,ah={isDuration:x.isDuration,isLocalTime:x.isLocalTime,isTime:x.isTime,isDate:x.isDate,isLocalDateTime:x.isLocalDateTime,isDateTime:x.isDateTime},I.temporal=ah,xb={isNode:x.isNode,isPath:x.isPath,isPathSegment:x.isPathSegment,isRelationship:x.isRelationship,isUnboundRelationship:x.isUnboundRelationship},Zh={authTokenManagers:x.authTokenManagers,driver:dL,hasReachableServer:hL,int:x.int,isInt:x.isInt,isPoint:x.isPoint,isDuration:x.isDuration,isLocalTime:x.isLocalTime,isTime:x.isTime,isDate:x.isDate,isLocalDateTime:x.isLocalDateTime,isDateTime:x.isDateTime,isNode:x.isNode,isPath:x.isPath,isPathSegment:x.isPathSegment,isRelationship:x.isRelationship,isUnboundRelationship:x.isUnboundRelationship,isUnsupportedType:x.isUnsupportedType,integer:Zh,Neo4jError:x.Neo4jError,isRetriableError:x.isRetriableError,isRetryableError:x.isRetryableError,auth:x.auth,logging:Dh,types:tf,session:wb,routing:x.routing,error:x.error,graph:I.graph=xb,spatial:ob,temporal:ah,Driver:rL.Driver,Session:x.Session,Transaction:x.Transaction,ManagedTransaction:x.ManagedTransaction,Result:x.Result,EagerResult:x.EagerResult,RxSession:mb.default,RxTransaction:k_.default,RxManagedTransaction:db.default,RxResult:g.default,ResultSummary:x.ResultSummary,Plan:x.Plan,ProfiledPlan:x.ProfiledPlan,QueryStatistics:x.QueryStatistics,Notification:x.Notification,GqlStatusObject:x.GqlStatusObject,ServerInfo:x.ServerInfo,Record:x.Record,Node:x.Node,Relationship:x.Relationship,UnboundRelationship:x.UnboundRelationship,Path:x.Path,PathSegment:x.PathSegment,Point:x.Point,Integer:x.Integer,Duration:x.Duration,LocalTime:x.LocalTime,Time:x.Time,Date:x.Date,LocalDateTime:x.LocalDateTime,DateTime:x.DateTime,bookmarkManager:x.bookmarkManager,resultTransformers:x.resultTransformers,notificationCategory:x.notificationCategory,notificationSeverityLevel:x.notificationSeverityLevel,notificationFilterDisabledCategory:x.notificationFilterDisabledCategory,notificationFilterMinimumSeverityLevel:x.notificationFilterMinimumSeverityLevel,clientCertificateProviders:x.clientCertificateProviders,isVector:x.isVector,vector:x.vector,Vector:x.Vector,rule:x.rule,mappingDecorators:x.mappingDecorators,RecordObjectMapping:x.RecordObjectMapping,StandardCase:x.StandardCase,ProtocolVersion:x.ProtocolVersion,UUID:x.UUID,uuid:x.uuid,isUUID:x.isUUID},I.default=Zh,D(U)});
1
+ ((e,t)=>{"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).neo4j=t()})(this,function(){var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function D(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var U={},L={},e={},t={},F={},B={},V=(Object.defineProperty(B,"__esModule",{value:!0}),B.createBrokenObject=function(r,e){void 0===e&&(e={});function n(){throw r}return new Proxy(e,{get:function(e,t){return t===V||(t===q?r:void("toJSON"!==t&&n()))},set:n,apply:n,construct:n,defineProperty:n,deleteProperty:n,getOwnPropertyDescriptor:n,getPrototypeOf:n,has:n,isExtensible:n,ownKeys:n,preventExtensions:n,setPrototypeOf:n})},B.isBrokenObject=function(e){return null!==e&&"object"==typeof e&&!0===e[V]},B.getBrokenObjectReason=function(e){return e[q]},"__isBrokenObject__"),q="__reason__";Object.defineProperty(F,"__esModule",{value:!0}),F.stringify=function(e,t){return JSON.stringify(e,function(e,r){return(0,W.isBrokenObject)(r)?{__isBrokenObject__:!0,__reason__:(0,W.getBrokenObjectReason)(r)}:"bigint"==typeof r?"".concat(r,"n"):!0!==(null==t?void 0:t.sortedElements)||"object"!=typeof r||Array.isArray(r)?!0!==(null==t?void 0:t.useCustomToString)||"object"!=typeof r||Array.isArray(r)||"function"!=typeof r.toString||r.toString===Object.prototype.toString?r:null==r?void 0:r.toString():Object.keys(r).sort().reduce(function(e,t){return e[t]=r[t],e},{})})};var W=B;var z,H,G,n={},o=(o=n,Object.defineProperty(o,"__esModule",{value:!0}),o.rawPolyfilledDiagnosticRecord=void 0,o.rawPolyfilledDiagnosticRecord={OPERATION:"",OPERATION_CODE:"0",CURRENT_SCHEMA:"/"},Object.freeze(o.rawPolyfilledDiagnosticRecord),r&&r.__extends||(z=function(e,t){return(z=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}z(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),K=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),Y=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Z=r&&r.__importStar||(H=function(e){return(H=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=H(e),n=0;n<r.length;n++)"default"!==r[n]&&K(t,e,r[n]);return Y(t,e),t}),Q=(Object.defineProperty(t,"__esModule",{value:!0}),t.PROTOCOL_ERROR=t.SESSION_EXPIRED=t.SERVICE_UNAVAILABLE=t.GQLError=t.Neo4jError=t.isRetryableError=t.isRetriableError=void 0,t.newError=function(e,t,r,n,o,i){return new ie(e,null!=t?t:te,null!=n?n:"50N42",null!=o?o:"error: general processing exception - unexpected error. "+e,null!=i?i:X.rawPolyfilledDiagnosticRecord,r)},t.newGQLError=function(e,t,r,n,o){return new re(e,null!=r?r:"50N42",null!=n?n:"error: general processing exception - unexpected error. "+e,null!=o?o:X.rawPolyfilledDiagnosticRecord,t)},Z(F)),X=n,Z={DATABASE_ERROR:"DATABASE_ERROR",CLIENT_ERROR:"CLIENT_ERROR",TRANSIENT_ERROR:"TRANSIENT_ERROR",UNKNOWN:"UNKNOWN"},J=(Object.freeze(Z),Object.values(Z)),$="ServiceUnavailable",ee=(t.SERVICE_UNAVAILABLE=$,"SessionExpired"),te=(t.SESSION_EXPIRED=ee,t.PROTOCOL_ERROR="ProtocolError","N/A"),re=(G=Error,o(ne,G),ne.prototype.containsGqlCause=function(e){return void 0!==this.findByGqlStatus(e)},ne.prototype.findByGqlStatus=function(e){return this.gqlStatus===e?this:void 0!==this.cause&&(this.cause instanceof ne||this.cause instanceof ie)?this.cause.findByGqlStatus(e):void 0},Object.defineProperty(ne.prototype,"diagnosticRecordAsJsonString",{get:function(){return Q.stringify(this.diagnosticRecord,{useCustomToString:!0})},enumerable:!1,configurable:!0}),ne);function ne(e,t,r,n,o){e=G.call(this,e,null!=o?{cause:o}:void 0)||this;return e.constructor=ne,e.__proto__=ne.prototype,e.cause=null!=o?o:void 0,e.gqlStatus=t,e.gqlStatusDescription=r,e.diagnosticRecord=n,e.classification=void 0!==(o=e.diagnosticRecord)&&void 0!==o._classification&&J.includes(o._classification)?null==o?void 0:o._classification:"UNKNOWN",e.rawClassification=null!=(t=null==n?void 0:n._classification)?t:void 0,e.name="GQLError",e}t.GQLError=re;o(ae,oe=re),ae.isRetriable=function(e){return this.isRetryable(e)},ae.isRetryable=function(e){return null!=e&&e instanceof ae&&e.retryable};var oe,ie=ae;function ae(e,t,r,n,o,i){e=oe.call(this,e,r,n,o,i)||this,e.constructor=ae,e.__proto__=ae.prototype,e.code=t,e.name="Neo4jError",n=(r=t)===$||r===ee||"Neo.ClientError.Security.AuthorizationExpired"===r||(e=>!0===(null==e?void 0:e.includes("TransientError")))(r);return e.retriable=n,e.retryable=n,e}Z=(t.Neo4jError=ie).isRetriable,t.isRetriableError=Z,o=ie.isRetryable;t.isRetryableError=o;var Z={},ue=(Object.defineProperty(Z,"__esModule",{value:!0}),Z.toString=Z.toNumber=Z.inSafeRange=Z.isInt=Z.int=void 0,t),se=new Map,o=(d.prototype.inSafeRange=function(){return this.greaterThanOrEqual(d.MIN_SAFE_VALUE)&&this.lessThanOrEqual(d.MAX_SAFE_VALUE)},d.prototype.toInt=function(){return this.low},d.prototype.toNumber=function(){return this.high*ce+(this.low>>>0)},d.prototype.toBigInt=function(){var e;return this.isZero()?BigInt(0):this.isPositive()?BigInt(this.high>>>0)*BigInt(ce)+BigInt(this.low>>>0):(e=this.negate(),BigInt(-1)*(BigInt(e.high>>>0)*BigInt(ce)+BigInt(e.low>>>0)))},d.prototype.toNumberOrInfinity=function(){return this.lessThan(d.MIN_SAFE_VALUE)?Number.NEGATIVE_INFINITY:this.greaterThan(d.MAX_SAFE_VALUE)?Number.POSITIVE_INFINITY:this.toNumber()},d.prototype.toString=function(e){if((e=null!=e?e:10)<2||36<e)throw RangeError("radix out of range: "+e.toString());if(this.isZero())return"0";var t,r,n;if(this.isNegative())return this.equals(d.MIN_VALUE)?(t=d.fromNumber(e),n=(r=this.div(t)).multiply(t).subtract(this),r.toString(e)+n.toInt().toString(e)):"-"+this.negate().toString(e);for(var o=d.fromNumber(Math.pow(e,6)),i=(n=this,"");;){var a=n.div(o),u=(n.subtract(a.multiply(o)).toInt()>>>0).toString(e);if((n=a).isZero())return u+i;for(;u.length<6;)u="0"+u;i=""+u+i}},d.prototype.valueOf=function(){return this.toBigInt()},d.prototype.getHighBits=function(){return this.high},d.prototype.getLowBits=function(){return this.low},d.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.equals(d.MIN_VALUE)?64:this.negate().getNumBitsAbs();for(var e=0!==this.high?this.high:this.low,t=0,t=31;0<t&&0==(e&1<<t);t--);return 0!==this.high?t+33:t+1},d.prototype.isZero=function(){return 0===this.high&&0===this.low},d.prototype.isNegative=function(){return this.high<0},d.prototype.isPositive=function(){return 0<=this.high},d.prototype.isOdd=function(){return 1==(1&this.low)},d.prototype.isEven=function(){return 0==(1&this.low)},d.prototype.equals=function(e){e=d.fromValue(e);return this.high===e.high&&this.low===e.low},d.prototype.notEquals=function(e){return!this.equals(e)},d.prototype.lessThan=function(e){return this.compare(e)<0},d.prototype.lessThanOrEqual=function(e){return this.compare(e)<=0},d.prototype.greaterThan=function(e){return 0<this.compare(e)},d.prototype.greaterThanOrEqual=function(e){return 0<=this.compare(e)},d.prototype.compare=function(e){var t,r,e=d.fromValue(e);return this.equals(e)?0:(t=this.isNegative(),r=e.isNegative(),t&&!r||(t||!r)&&this.subtract(e).isNegative()?-1:1)},d.prototype.negate=function(){return this.equals(d.MIN_VALUE)?d.MIN_VALUE:this.not().add(d.ONE)},d.prototype.add=function(e){var e=d.fromValue(e),t=this.high>>>16,r=65535&this.high,n=this.low>>>16,o=65535&this.low,i=e.high>>>16,a=0,u=0,s=0,c=0;return u+=(s=s+((c+=o+(65535&e.low))>>>16)+(n+(e.low>>>16)))>>>16,d.fromBits((s&=65535)<<16|(c&=65535),((a+=(u+=r+(65535&e.high))>>>16)+(t+i)&65535)<<16|(u&=65535))},d.prototype.subtract=function(e){e=d.fromValue(e);return this.add(e.negate())},d.prototype.multiply=function(e){var t,r,n,o,i,a,u,s,c,l,f;return this.isZero()||(e=d.fromValue(e)).isZero()?d.ZERO:this.equals(d.MIN_VALUE)?e.isOdd()?d.MIN_VALUE:d.ZERO:e.equals(d.MIN_VALUE)?this.isOdd()?d.MIN_VALUE:d.ZERO:this.isNegative()?e.isNegative()?this.negate().multiply(e.negate()):this.negate().multiply(e).negate():e.isNegative()?this.multiply(e.negate()).negate():this.lessThan(fe)&&e.lessThan(fe)?d.fromNumber(this.toNumber()*e.toNumber()):(t=this.high>>>16,r=65535&this.high,n=this.low>>>16,o=65535&this.low,i=e.high>>>16,a=65535&e.high,u=e.low>>>16,f=(f=l=c=s=0)+((c=c+((l+=o*(e=65535&e.low))>>>16)+n*e)>>>16)+((c=(c&65535)+o*u)>>>16),d.fromBits((c&=65535)<<16|(l&=65535),(s=(s=(s+=(f+=r*e)>>>16)+((f=(f&65535)+n*u)>>>16)+((f=(f&65535)+o*a)>>>16))+(t*e+r*u+n*a+o*i)&65535)<<16|(f&=65535)))},d.prototype.div=function(e){var t,r,n,o=d.fromValue(e);if(o.isZero())throw(0,ue.newError)("division by zero");if(this.isZero())return d.ZERO;if(this.equals(d.MIN_VALUE))return o.equals(d.ONE)||o.equals(d.NEG_ONE)?d.MIN_VALUE:o.equals(d.MIN_VALUE)?d.ONE:(n=this.shiftRight(1).div(o).shiftLeft(1)).equals(d.ZERO)?o.isNegative()?d.ONE:d.NEG_ONE:(t=this.subtract(o.multiply(n)),n.add(t.div(o)));if(o.equals(d.MIN_VALUE))return d.ZERO;if(this.isNegative())return o.isNegative()?this.negate().div(o.negate()):this.negate().div(o).negate();if(o.isNegative())return this.div(o.negate()).negate();for(r=d.ZERO,t=this;t.greaterThanOrEqual(o);){n=Math.max(1,Math.floor(t.toNumber()/o.toNumber()));for(var i=Math.ceil(Math.log(n)/Math.LN2),a=i<=48?1:Math.pow(2,i-48),u=d.fromNumber(n),s=u.multiply(o);s.isNegative()||s.greaterThan(t);)s=(u=d.fromNumber(n-=a)).multiply(o);u.isZero()&&(u=d.ONE),r=r.add(u),t=t.subtract(s)}return r},d.prototype.modulo=function(e){e=d.fromValue(e);return this.subtract(this.div(e).multiply(e))},d.prototype.not=function(){return d.fromBits(~this.low,~this.high)},d.prototype.and=function(e){e=d.fromValue(e);return d.fromBits(this.low&e.low,this.high&e.high)},d.prototype.or=function(e){e=d.fromValue(e);return d.fromBits(this.low|e.low,this.high|e.high)},d.prototype.xor=function(e){e=d.fromValue(e);return d.fromBits(this.low^e.low,this.high^e.high)},d.prototype.shiftLeft=function(e){e=d.toNumber(e);return 0==(e&=63)?d.ZERO:e<32?d.fromBits(this.low<<e,this.high<<e|this.low>>>32-e):d.fromBits(0,this.low<<e-32)},d.prototype.shiftRight=function(e){var t=d.toNumber(e),e=d.toNumber(e);return 0==(t&=63)?d.ZERO:e<32?d.fromBits(this.low>>>t|this.high<<32-t,this.high>>t):d.fromBits(this.high>>t-32,0<=this.high?0:-1)},d.isInteger=function(e){return!0===(null==e?void 0:e.__isInteger__)},d.fromInt=function(e){var t;return-128<=(e|=0)&&e<128&&null!=(t=se.get(e))||(t=new d(e,e<0?-1:0),-128<=e&&e<128&&se.set(e,t)),t},d.fromBits=function(e,t){return new d(e,t)},d.fromNumber=function(e){return isNaN(e)||!isFinite(e)?d.ZERO:e<=-le?d.MIN_VALUE:le<=e+1?d.MAX_VALUE:e<0?d.fromNumber(-e).negate():new d(e%ce|0,e/ce|0)},d.fromString=function(e,t,r){var n=(void 0===r?{}:r).strictStringValidation;if(0===e.length)throw(0,ue.newError)("number format error: empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return d.ZERO;if((t=null!=t?t:10)<2||36<t)throw(0,ue.newError)("radix out of range: "+t.toString());if(0<(r=e.indexOf("-")))throw(0,ue.newError)('number format error: interior "-" character: '+e);if(0===r)return d.fromString(e.substring(1),t).negate();for(var o,i,a=d.fromNumber(Math.pow(t,8)),u=d.ZERO,s=0;s<e.length;s+=8){var c,l=Math.min(8,e.length-s),f=e.substring(s,s+l),p=parseInt(f,t);if(!0===n&&(o=f,c=p,i=t,Number.isNaN(o)||Number.isNaN(c)||((e,t,r)=>(e=e.toString(t),t=Math.max(r-e.length,0),r="0".repeat(t),"".concat(r).concat(e)))(c,i,o.length)!==o.toLowerCase()))throw(0,ue.newError)('number format error: "'.concat(f,'" is NaN in radix ').concat(t,": ").concat(e));u=(l<8?(c=d.fromNumber(Math.pow(t,l)),u.multiply(c)):u=u.multiply(a)).add(d.fromNumber(p))}return u},d.fromValue=function(e,t){return void 0===t&&(t={}),e instanceof d?e:"number"==typeof e?(!0===t.ceilFloat&&(e=Math.ceil(e)),d.fromNumber(e)):"string"==typeof e?d.fromString(e,void 0,t):"bigint"==typeof e?d.fromString(e.toString()):new d(e.low,e.high)},d.toNumber=function(e){switch(typeof e){case"number":return e;case"bigint":return Number(e);default:return d.fromValue(e).toNumber()}},d.toString=function(e,t){return d.fromValue(e).toString(t)},d.inSafeRange=function(e){return d.fromValue(e).inSafeRange()},d.ZERO=d.fromInt(0),d.ONE=d.fromInt(1),d.NEG_ONE=d.fromInt(-1),d.MAX_VALUE=d.fromBits(-1,2147483647),d.MIN_VALUE=d.fromBits(0,-2147483648),d.MIN_SAFE_VALUE=d.fromBits(1,-2097152),d.MAX_SAFE_VALUE=d.fromBits(-1,2097151),d.__isInteger__=!0,d);function d(e,t){this.low=null!=e?e:0,this.high=null!=t?t:0}Object.defineProperty(o.prototype,"__isInteger__",{value:!0,enumerable:!1,configurable:!1});var ce=4294967296,le=ce*ce/2,fe=o.fromInt(1<<24),i=o.fromValue,i=(Z.int=i,o.isInteger),i=(Z.isInt=i,o.inSafeRange),i=(Z.inSafeRange=i,o.toNumber),i=(Z.toNumber=i,o.toString),i=(Z.toString=i,Z.default=o,{}),o={},a={},u={},pe={},de=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},he=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},ye=(Object.defineProperty(pe,"__esModule",{value:!0}),pe.nameConventions=pe.StandardCase=void 0,pe.StandardCase={SnakeCase:"snake_case",KebabCase:"kebab-case",ScreamingSnakeCase:"SCREAMING_SNAKE_CASE",PascalCase:"PascalCase",CamelCase:"camelCase"},pe.nameConventions={snake_case:{tokenize:function(e){return e.split("_")},encode:function(e){return e.join("_")}},"kebab-case":{tokenize:function(e){return e.split("-")},encode:function(e){return e.join("-")}},PascalCase:{tokenize:function(e){return e.split(/(?=[A-Z])/).map(function(e){return e.toLowerCase()})},encode:function(e){var t,r,n="";try{for(var o=de(e),i=o.next();!i.done;i=o.next()){var a=i.value;n+=a=a.charAt(0).toUpperCase()+a.slice(1)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return n}},camelCase:{tokenize:function(e){return e.split(/(?=[A-Z])/).map(function(e){return e.toLowerCase()})},encode:function(e){var t,r,n="";try{for(var o=de(e.entries()),i=o.next();!i.done;i=o.next()){var a=he(i.value,2),u=a[0],s=a[1];n+=s=0!==u?s.charAt(0).toUpperCase()+s.slice(1):s}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return n}},SCREAMING_SNAKE_CASE:{tokenize:function(e){return e.split("_").map(function(e){return e.toLowerCase()})},encode:function(e){return e.join("_").toUpperCase()}}},u),be=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},_e=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},ve=(Object.defineProperty(ye,"__esModule",{value:!0}),ye.RecordObjectMapping=ye.defaultNameMapping=ye.rulesRegistry=void 0,ye.as=function(e,t,r){var n,o,i,a,u="function"==typeof t?t:Object,s=we(t,r),c=[],l=new u;try{for(var f=be(Object.entries(null!=s?s:{})),p=f.next();!p.done;p=f.next()){var d=_e(p.value,2),h=d[0],y=d[1];c.push(h),ge(e,l,h,y)}}catch(e){n={error:e}}finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(n)throw n.error}}try{for(var b=be(Object.getOwnPropertyNames(l)),_=b.next();!_.done;_=b.next()){h=_.value;c.includes(h)||ge(e,l,h,null==s?void 0:s[h])}}catch(e){i={error:e}}finally{try{_&&!_.done&&(a=b.return)&&a.call(b)}finally{if(i)throw i.error}}return l},ye.valueAs=Oe,ye.optionalParameterConversion=function(e,t){return(!0!==t.optional||null!=e)&&null!=e&&null!=t.parameterConversion?t.parameterConversion(e):e},ye.validateAndCleanParameters=function(e,t){var r={},n=we(Object.getPrototypeOf(e).constructor,t);{if(null==n)return e;for(var o in n){var i=e[o],a=null!=(a=n[o].from)?a:(0,ye.defaultNameMapping)(o);if(null==(i=null!=i&&null!=n[o].parameterConversion?n[o].parameterConversion(i):i)){if(!0!==n[o].optional)throw(0,ve.newError)("Mapped Parameter object did not include required parameter with key ".concat(o,", \n check provided parameters and parameter rules."))}else null!=n[o].validate&&n[o].validate(i,o);r[a]=i}return r}},ye.getRules=we,t),me=pe;function ge(e,t,r,n){var o,i,a=(0,ye.defaultNameMapping)(r);try{i=e.get(null!=(o=null==n?void 0:n.from)?o:a)}catch(e){if(!0===(null==n?void 0:n.optional)&&e instanceof ve.Neo4jError)return;throw e}e="".concat(t.constructor.name,"#").concat(r);t[r]=Oe(i,e,n)}function Oe(e,t,r){return(!0!==(null==r?void 0:r.optional)||null!=e)&&("function"==typeof(null==r?void 0:r.validate)&&r.validate(e,t),null!=(null==r?void 0:r.convert))?r.convert(e,t):e}function we(e,t){t="object"==typeof e?e:t;return null!=t?t:"object"!=typeof e?ye.rulesRegistry[e.name]:void 0}ye.rulesRegistry={},ye.defaultNameMapping=function(e){return e},ye.RecordObjectMapping=Object.freeze({clearMappingRegistry:function(){ye.rulesRegistry={}},getCaseTranslator:function(t,r){var e=Object.keys(me.nameConventions);if(!e.includes(t))throw(0,ve.newError)("Naming convention ".concat(t," is not recognized, \n please provide a recognized name convention or manually provide a translation function."));if(e.includes(r))return function(e){return me.nameConventions[t].encode(me.nameConventions[r].tokenize(e))};throw(0,ve.newError)("Naming convention ".concat(r," is not recognized, \n please provide a recognized name convention or manually provide a translation function."))},register:function(e,t){ye.rulesRegistry[e.name]=t},translateIdentifiers:function(e){ye.defaultNameMapping=e}});var s,Ee,Pe,Se,c,Te,je,Ce,Ie,Re=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ae=(Object.defineProperty(a,"__esModule",{value:!0}),a.ENCRYPTION_OFF=a.ENCRYPTION_ON=void 0,a.isEmptyObjectOrNull=function(e){if(null!==e){if(!xe(e))return!1;for(var t in e)if(void 0!==e[t])return!1}return!0},a.isObject=xe,a.isString=Ue,a.assertObject=function(e,t){if(xe(e))return e;throw new TypeError(t+" expected to be an object but was: "+(0,Me.stringify)(e))},a.assertString=De,a.assertNumber=function(e,t){if("number"==typeof e)return e;throw new TypeError(t+" expected to be a number but was: "+(0,Me.stringify)(e))},a.assertNumberOrInteger=function(e,t){if("number"==typeof e||"bigint"==typeof e||(0,Ae.isInt)(e))return e;throw new TypeError(t+" expected to be either a number or an Integer object but was: "+(0,Me.stringify)(e))},a.assertValidDate=function(e,t){if("[object Date]"!==Object.prototype.toString.call(e))throw new TypeError(t+" expected to be a standard JavaScript Date but was: "+(0,Me.stringify)(e));if(Number.isNaN(e.getTime()))throw new TypeError(t+" expected to be valid JavaScript Date but its time was NaN: "+(0,Me.stringify)(e));return e},a.validateQueryAndParameters=function(e,t,r){var n="",t=null!=t?t:{},o=null==r?void 0:r.parameterRules,i=null!=(i=null==r?void 0:r.skipAsserts)&&i;if("string"==typeof e)n=e;else if(e instanceof String)n=e.toString();else if("object"==typeof e&&null!=e.text){if(!i&&null!=(null==r?void 0:r.parameterRules))throw(0,Ne.newError)("When using a Query object, parameterRules should be present in the object and not in a separate argument.");n=e.text,t=null!=(r=e.parameters)?r:{},o=e.parameterRules}i||(t=(0,ke.validateAndCleanParameters)(t,o),(e=>{if(De(e,"Cypher query"),0===e.trim().length)throw new TypeError("Cypher query is expected to be a non-empty string.")})(n),(e=>{var t;if(!xe(e))throw t=null!=e.constructor?" "+e.constructor.name:"",new TypeError("Query parameters are expected to either be undefined/null or an object, given:".concat(t," ").concat(JSON.stringify(e)))})(t));return{validatedQuery:n,params:t}},a.equals=function e(t,r){var n,o;if(t===r)return!0;if(null===t||null===r)return!1;if("object"==typeof t&&"object"==typeof r){var i=Object.keys(t),a=Object.keys(r);if(i.length!==a.length)return!1;try{for(var u=Re(i),s=u.next();!s.done;s=u.next()){var c=s.value;if(!e(t[c],r[c]))return!1}}catch(e){n={error:e}}finally{try{s&&!s.done&&(o=u.return)&&o.call(u)}finally{if(n)throw n.error}}return!0}return!1},Z),Me=F,ke=u,Ne=t;a.ENCRYPTION_ON="ENCRYPTION_ON";function xe(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}function De(e,t){if(Ue(e))return e;throw new TypeError((0,Me.stringify)(t)+" expected to be string but was: "+(0,Me.stringify)(e))}function Ue(e){return"[object String]"===Object.prototype.toString.call(e)}function Le(e,t){this._minNumber=e,this._maxNumber=t,this._minInteger=(0,c.int)(e),this._maxInteger=(0,c.int)(t)}function Fe(e){return(0,c.int)(e).div(12)}function Be(e){return(0,c.int)(e).modulo(12)}function Ve(e,t){return(0,c.int)(t).greaterThan(0)&&(0,c.int)(e).lessThan(0)&&(e=(0,c.int)(e).add(1)),(0,c.int)(e).div(s.SECONDS_PER_HOUR)}function qe(e,t){(0,c.int)(t).greaterThan(0)&&(0,c.int)(e).lessThan(0)&&(e=(0,c.int)(e).add(1));t=(0,c.int)(e).div(s.SECONDS_PER_MINUTE),e=t.isNegative();return Ke(t=e?t.negate():t,s.MINUTES_PER_HOUR).multiply(e?-1:1)}function We(e,t,r){e=(0,c.int)(e),t=(0,c.int)(t),r=(0,c.int)(r);var n=e.multiply(365);return n=(n=(n=e.greaterThanOrEqual(0)?n.add(e.add(3).div(4).subtract(e.add(99).div(100)).add(e.add(399).div(400))):n.subtract(e.div(-4).subtract(e.div(-100)).add(e.div(-400)))).add(t.multiply(367).subtract(362).div(12))).add(r.subtract(1)),t.greaterThan(2)&&(n=n.subtract(1),(e=>{if((e=(0,c.int)(e)).modulo(4).equals(0)){if(e.modulo(100).equals(0))return!!e.modulo(400).equals(0);return 1}})(e)||(n=n.subtract(1))),n.subtract(s.DAYS_0000_TO_1970)}function ze(e,t){return 1===e?t%400==0||t%4==0&&t%100!=0?29:28:[0,2,4,6,7,9,11].includes(e)?31:30}function He(e,t,r){if((0,je.assertNumberOrInteger)(e,r),t.contains(e))return e;throw(0,Te.newError)("".concat(r," is expected to be in range ").concat(t.toString()," but was: ").concat(e.toString()))}function Ge(e,t){e=(0,c.int)(e),t=(0,c.int)(t);var r=e.div(t);return r=e.isPositive()!==t.isPositive()&&r.multiply(t).notEquals(e)?r.subtract(1):r}function Ke(e,t){return e=(0,c.int)(e),t=(0,c.int)(t),e.subtract(Ge(e,t).multiply(t))}function Ye(e){return(e=(0,c.int)(e)).equals(0)?"":"."+Ze(e,9)}function Ze(e,t,r){var n=(e=(0,c.int)(e)).isNegative(),o=(e=n?e.negate():e).toString();if(null!=t)for(;o.length<t;)o="0"+o;return n?"-"+o:!0===(null==r?void 0:r.usePositiveSign)?"+"+o:o}a.ENCRYPTION_OFF="ENCRYPTION_OFF",s=o,Pe=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),Se=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=r&&r.__importStar||(Ee=function(e){return(Ee=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=Ee(e),n=0;n<r.length;n++)"default"!==r[n]&&Pe(t,e,r[n]);return Se(t,e),t}),Object.defineProperty(s,"__esModule",{value:!0}),s.SECONDS_PER_DAY=s.DAYS_PER_400_YEAR_CYCLE=s.DAYS_0000_TO_1970=s.NANOS_PER_HOUR=s.NANOS_PER_MINUTE=s.NANOS_PER_MILLISECOND=s.NANOS_PER_SECOND=s.SECONDS_PER_HOUR=s.SECONDS_PER_MINUTE=s.MINUTES_PER_HOUR=s.NANOSECOND_OF_SECOND_RANGE=s.SECOND_OF_MINUTE_RANGE=s.MINUTE_OF_HOUR_RANGE=s.HOUR_OF_DAY_RANGE=s.DAY_OF_MONTH_RANGE=s.MONTH_OF_YEAR_RANGE=s.YEAR_RANGE=void 0,s.normalizeYearsForDuration=Fe,s.normalizeMonthsForDuration=Be,s.normalizeHoursForDuration=Ve,s.normalizeMinutesForDuration=qe,s.normalizeSecondsForDuration=function(e,t){return(0,c.int)(e).add(Ge(t,s.NANOS_PER_SECOND))},s.normalizeNanosecondsForDuration=function(e){return Ke(e,s.NANOS_PER_SECOND)},s.localTimeToNanoOfDay=function(e,t,r,n){e=(0,c.int)(e),t=(0,c.int)(t),r=(0,c.int)(r),n=(0,c.int)(n);e=e.multiply(s.NANOS_PER_HOUR);return(e=(e=e.add(t.multiply(s.NANOS_PER_MINUTE))).add(r.multiply(s.NANOS_PER_SECOND))).add(n)},s.localDateTimeToEpochSecond=function(e,t,r,n,o,i,a){e=We(e,t,r),t=((e,t,r)=>(e=(0,c.int)(e),t=(0,c.int)(t),r=(0,c.int)(r),(e=(e=e.multiply(s.SECONDS_PER_HOUR)).add(t.multiply(s.SECONDS_PER_MINUTE))).add(r)))(n,o,i);return e.multiply(s.SECONDS_PER_DAY).add(t)},s.dateToEpochDay=We,s.durationToIsoString=function(e,t,r,n){if((0,c.int)(e).equals(0)&&(0,c.int)(t).equals(0)&&(0,c.int)(r).equals(0)&&(0,c.int)(n).equals(0))return"PT0S";var o=Ze(Fe(e)),e=Ze(Be(e)),t=Ze(t),i=Ze(Ve(r,n)),a=Ze(qe(r,n)),r=((e,t)=>{e=(0,c.int)(e),t=(0,c.int)(t);var r,n=e.isNegative(),o=t.greaterThan(0);return e=n&&o?(e=e.add(1).negate().modulo(60).negate()).equals(0)?"-0":e.toString():e.modulo(60).toString(),null!=(r=o?Ye((n?t.negate().add(2*s.NANOS_PER_SECOND):t.add(s.NANOS_PER_SECOND)).modulo(s.NANOS_PER_SECOND)):r)?e+r:e})(r,n);return"P".concat("0"!==o?o+"Y":"")+"".concat("0"!==e?e+"M":"")+"".concat("0"!==t?t+"D":"","T")+"".concat("0"!==i?i+"H":"")+"".concat("0"!==a?a+"M":"")+"".concat("0"!==r?r+"S":"")},s.timeToIsoString=function(e,t,r,n){e=Ze(e,2),t=Ze(t,2),r=Ze(r,2),n=Ye(n);return"".concat(e,":").concat(t,":").concat(r).concat(n)},s.timeZoneOffsetToIsoString=function(e){if((e=(0,c.int)(e)).equals(0))return"Z";var t=e.isNegative();t&&(e=e.multiply(-1));var t=t?"-":"+",r=Ze(e.div(s.SECONDS_PER_HOUR),2),n=Ze(e.div(s.SECONDS_PER_MINUTE).modulo(s.MINUTES_PER_HOUR),2),e=e.modulo(s.SECONDS_PER_MINUTE),e=e.equals(0)?null:Ze(e,2);return null!=e?"".concat(t).concat(r,":").concat(n,":").concat(e):"".concat(t).concat(r,":").concat(n)},s.dateToIsoString=function(e,t,r){e=(e=>(e=(0,c.int)(e)).isNegative()||e.greaterThan(9999)?Ze(e,6,{usePositiveSign:!0}):Ze(e,4))(e),t=Ze(t,2),r=Ze(r,2);return"".concat(e,"-").concat(t,"-").concat(r)},s.isoStringToStandardDate=function(e){return new Date(e)},s.toStandardDate=function(e){return new Date(e)},s.newDate=function(e){return new Date(e)},s.totalNanoseconds=function(e,t){t=null!=t?t:0;e=e.getMilliseconds()*s.NANOS_PER_MILLISECOND;return((e,t)=>e instanceof c.default?e.add(t):"bigint"==typeof e?e+BigInt(t):e+t)(t,e)},s.timeZoneOffsetInSeconds=function(e){var t=e.getSeconds()-e.getUTCSeconds(),r=e.getMinutes()-e.getUTCMinutes(),n=e.getHours()-e.getUTCHours(),e=(e=>e.getMonth()===e.getUTCMonth()?e.getDate()-e.getUTCDate():e.getFullYear()>e.getUTCFullYear()||e.getMonth()>e.getUTCMonth()&&e.getFullYear()===e.getUTCFullYear()?e.getDate()+ze(e.getUTCMonth(),e.getUTCFullYear())-e.getUTCDate():e.getDate()-(e.getUTCDate()+ze(e.getMonth(),e.getFullYear())))(e);return n*s.SECONDS_PER_HOUR+r*s.SECONDS_PER_MINUTE+t+e*s.SECONDS_PER_DAY},s.assertValidYear=function(e){return He(e,s.YEAR_RANGE,"Year")},s.assertValidMonth=function(e){return He(e,s.MONTH_OF_YEAR_RANGE,"Month")},s.assertValidDay=function(e){return He(e,s.DAY_OF_MONTH_RANGE,"Day")},s.assertValidHour=function(e){return He(e,s.HOUR_OF_DAY_RANGE,"Hour")},s.assertValidMinute=function(e){return He(e,s.MINUTE_OF_HOUR_RANGE,"Minute")},s.assertValidSecond=function(e){return He(e,s.SECOND_OF_MINUTE_RANGE,"Second")},s.assertValidNanosecond=function(e){return He(e,s.NANOSECOND_OF_SECOND_RANGE,"Nanosecond")},s.assertValidZoneId=function(t,r){var e=Ce.get(r);if(!0!==e){if(!1===e)throw Ie(r,t);try{Intl.DateTimeFormat(void 0,{timeZone:r}),Ce.set(r,!0)}catch(e){throw Ce.set(r,!1),Ie(r,t)}}},s.floorDiv=Ge,s.floorMod=Ke,c=l(Z),Te=t,je=a,Le.prototype.contains=function(e){var t;return(0,c.isInt)(e)&&e instanceof c.default?e.greaterThanOrEqual(this._minInteger)&&e.lessThanOrEqual(this._maxInteger):"bigint"==typeof e?(t=(0,c.int)(e)).greaterThanOrEqual(this._minInteger)&&t.lessThanOrEqual(this._maxInteger):e>=this._minNumber&&e<=this._maxNumber},Le.prototype.toString=function(){return"[".concat(this._minNumber,", ").concat(this._maxNumber,"]")},l=Le,s.YEAR_RANGE=new l(-999999999,999999999),s.MONTH_OF_YEAR_RANGE=new l(1,12),s.DAY_OF_MONTH_RANGE=new l(1,31),s.HOUR_OF_DAY_RANGE=new l(0,23),s.MINUTE_OF_HOUR_RANGE=new l(0,59),s.SECOND_OF_MINUTE_RANGE=new l(0,59),s.NANOSECOND_OF_SECOND_RANGE=new l(0,999999999),s.MINUTES_PER_HOUR=60,s.SECONDS_PER_MINUTE=60,s.SECONDS_PER_HOUR=s.SECONDS_PER_MINUTE*s.MINUTES_PER_HOUR,s.NANOS_PER_SECOND=1e9,s.NANOS_PER_MILLISECOND=1e6,s.NANOS_PER_MINUTE=s.NANOS_PER_SECOND*s.SECONDS_PER_MINUTE,s.NANOS_PER_HOUR=s.NANOS_PER_MINUTE*s.MINUTES_PER_HOUR,s.DAYS_0000_TO_1970=719528,s.DAYS_PER_400_YEAR_CYCLE=146097,s.SECONDS_PER_DAY=86400,Ce=new Map,Ie=function(e,t){return(0,Te.newError)("".concat(t,' is expected to be a valid ZoneId but was: "').concat(e,'"'))};var Qe,Xe=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),Je=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=r&&r.__importStar||(Qe=function(e){return(Qe=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=Qe(e),n=0;n<r.length;n++)"default"!==r[n]&&Xe(t,e,r[n]);return Je(t,e),t}),$e=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},f=(Object.defineProperty(i,"__esModule",{value:!0}),i.DateTime=i.LocalDateTime=i.Date=i.Time=i.LocalTime=i.Duration=void 0,i.isDuration=function(e){return yt(e,nt)},i.isLocalTime=function(e){return yt(e,ot)},i.isTime=function(e){return yt(e,it)},i.isDate=function(e){return yt(e,at)},i.isLocalDateTime=function(e){return yt(e,ut)},i.isDateTime=function(e){return yt(e,st)},l(o)),et=a,tt=t,rt=l(Z),l={value:!0,enumerable:!1,configurable:!1,writable:!1},nt="__isDuration__",ot="__isLocalTime__",it="__isTime__",at="__isDate__",ut="__isLocalDateTime__",st="__isDateTime__",p=(ct.fromString=function(e){if("T"===e.slice(-1).toUpperCase())throw(0,tt.newError)("Duration string '".concat(e,"' ends with 'T', time delimiter must be excluded if Duration contains no time components"));var t=String(e.replace(/,/g,".")).match(new RegExp(/^([-|+]?)[P|p](?:(-?\d*\.?\d*)[Y|y])?(?:(-?\d*\.?\d*)[M|m])?(?:(-?\d*\.?\d*)[W|w])?(?:(-?\d*\.?\d*)[D|d])?/.source+/([T|t](?:(-?\d*\.?\d*)[H|h])?(?:(-?\d*\.?\d*)[M|m])?(?:(-)?(\d*)(\.\d*)?[S|s])?)?$/.source));if(null===t)throw(0,tt.newError)("Duration could not be parsed from string: ".concat(e));if(null==t[2]&&null==t[3]&&null==t[4]&&null==t[5]&&null==t[7]&&null==t[8]&&null==t[10]&&null==t[11])throw(0,tt.newError)("Duration could not be parsed from string: ".concat(e));var e="-"===t[1]?-1:1,r=e*vt(t[2],"Years")*12+vt(t[3],"Months"),n=e*vt(t[4],"Weeks")*7+vt(t[5],"Days"),o=3600*vt(t[7],"Hours")+60*vt(t[8],"Minutes"),i=mt((null!=(i=t[9])?i:"")+(null!=(i=t[10])?i:"0")),a=e*(t=(null!=(a=t[9])?a:"")+"0"+(null!=(a=t[11])?a:""),Math.round(vt(t,"nanoseconds")*Math.pow(10,9)));return Ot(r,"Months"),Ot(n,"Days"),Ot(o,"Seconds"),Ot(a,"Nanoseconds"),new ct((0,rt.int)(r),(0,rt.int)(n),(0,rt.int)(BigInt(e)*(BigInt(o)+i.toBigInt())),(0,rt.int)(a))},ct.prototype.toString=function(){return f.durationToIsoString(this.months,this.days,this.seconds,this.nanoseconds)},ct);function ct(e,t,r,n){this.months=(0,et.assertNumberOrInteger)(e,"Months"),this.days=(0,et.assertNumberOrInteger)(t,"Days"),(0,et.assertNumberOrInteger)(r,"Seconds"),(0,et.assertNumberOrInteger)(n,"Nanoseconds"),this.seconds=f.normalizeSecondsForDuration(r,n),"number"==typeof r&&(0,rt.isInt)(this.seconds)&&(this.seconds=this.seconds.toNumber()),"bigint"==typeof r&&(0,rt.isInt)(this.seconds)&&(this.seconds=this.seconds.toBigInt()),this.nanoseconds=f.normalizeNanosecondsForDuration(n),"number"==typeof n&&(0,rt.isInt)(this.nanoseconds)&&(this.nanoseconds=this.nanoseconds.toNumber()),"bigint"==typeof n&&(0,rt.isInt)(this.nanoseconds)&&(this.nanoseconds=this.nanoseconds.toBigInt()),Object.freeze(this)}i.Duration=p,Object.defineProperty(p.prototype,nt,l);lt.fromStandardDate=function(e,t){_t(e,t);t=f.totalNanoseconds(e,t);return new lt(e.getHours(),e.getMinutes(),e.getSeconds(),t instanceof rt.default?t.toInt():"bigint"==typeof t?(0,rt.int)(t).toInt():t)},lt.prototype.toString=function(){return f.timeToIsoString(this.hour,this.minute,this.second,this.nanosecond)},lt.fromString=function(e){e=String(e.replace(/,/g,".")).match(/^[T|t]?(\d{2})(?::?(\d{2}))?(?::?(\d{2}))?(\.\d+)?$/);if(null===e)throw(0,tt.newError)("LocalTime could not be parsed from string");e=$e(gt(e[1],e[2],e[3],e[4]),4);return new lt(e[0],e[1],e[2],e[3])};p=lt;function lt(e,t,r,n){this.hour=f.assertValidHour(e),this.minute=f.assertValidMinute(t),this.second=f.assertValidSecond(r),this.nanosecond=f.assertValidNanosecond(n),Object.freeze(this)}i.LocalTime=p,Object.defineProperty(p.prototype,ot,l);ft.fromStandardDate=function(e,t){return _t(e,t),new ft(e.getHours(),e.getMinutes(),e.getSeconds(),(0,rt.toNumber)(f.totalNanoseconds(e,t)),f.timeZoneOffsetInSeconds(e))},ft.prototype.toString=function(){return f.timeToIsoString(this.hour,this.minute,this.second,this.nanosecond)+f.timeZoneOffsetToIsoString(this.timeZoneOffsetSeconds)},ft.fromString=function(e){e=String(e.replace(/,/g,".")).match(/^[T|t]?(\d{2})(?::?(\d{2}))?(?::?(\d{2}))?(\.\d+)?([Z|z]$|\+|-)(\d{2})?(?::?(\d{2}))?(?::?(\d{2}))?$/);if(null===e)throw(0,tt.newError)("Time could not be parsed from string");var t=$e(gt(e[1],e[2],e[3],e[4]),4),r=t[0],n=t[1],o=t[2],t=t[3];if("Z"===e[5])return new ft(r,n,o,t,(0,rt.int)(0));if(null==e[6])throw(0,tt.newError)("Error parsing timezone offset.");return new ft(r,n,o,t,(0,rt.int)(("+"===e[5]?1:-1)*(3600*mt(e[6]).toInt()+60*mt(e[7]).toInt()+mt(e[8]).toInt())))};p=ft;function ft(e,t,r,n,o){this.hour=f.assertValidHour(e),this.minute=f.assertValidMinute(t),this.second=f.assertValidSecond(r),this.nanosecond=f.assertValidNanosecond(n),this.timeZoneOffsetSeconds=(0,et.assertNumberOrInteger)(o,"Time zone offset in seconds"),Object.freeze(this)}i.Time=p,Object.defineProperty(p.prototype,it,l);pt.fromStandardDate=function(e){return this.fromStandardDateLocal(e)},pt.fromStandardDateLocal=function(e){return _t(e),new pt(e.getFullYear(),e.getMonth()+1,e.getDate())},pt.fromStandardDateUTC=function(e){return _t(e),new pt(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate())},pt.prototype.toStandardDate=function(){return f.isoStringToStandardDate(this.toString())},pt.prototype.toString=function(){return f.dateToIsoString(this.year,this.month,this.day)},pt.fromString=function(e){e=String(e.replace(/,/g,".")).match(/^([+|-]\d{5,}|\d{4})-(\d{2})-(\d{2})$/);if(null===e)throw(0,tt.newError)("Date could not be parsed from string. Expects date in format 'YYYY-MM-DD' or '[+|-]YYYYY-MM-DD'");return new pt(mt(e[1]),mt(e[2]),mt(e[3]))};p=pt;function pt(e,t,r){this.year=f.assertValidYear(e),this.month=f.assertValidMonth(t),this.day=f.assertValidDay(r),Object.freeze(this)}i.Date=p,Object.defineProperty(p.prototype,at,l);dt.fromStandardDate=function(e,t){return _t(e,t),new dt(e.getFullYear(),e.getMonth()+1,e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),(0,rt.toNumber)(f.totalNanoseconds(e,t)))},dt.prototype.toStandardDate=function(){return f.isoStringToStandardDate(this.toString())},dt.prototype.toString=function(){return bt(this.year,this.month,this.day,this.hour,this.minute,this.second,this.nanosecond)},dt.fromString=function(e){e=String(e.replace(/,/g,".")).match(/^([+|-]\d{5,}|\d{4})-(\d{2})-(\d{2})[T|t](\d{2})(?::?(\d{2}))?(?::?(\d{2}))?(\.\d+)?$/);if(null===e)throw(0,tt.newError)("LocalDateTime could not be parsed from string");var t=$e(gt(e[4],e[5],e[6],e[7]),4),r=t[0],n=t[1],o=t[2],t=t[3];return new dt(mt(e[1]),mt(e[2]),mt(e[3]),r,n,o,t)};p=dt;function dt(e,t,r,n,o,i,a){this.year=f.assertValidYear(e),this.month=f.assertValidMonth(t),this.day=f.assertValidDay(r),this.hour=f.assertValidHour(n),this.minute=f.assertValidMinute(o),this.second=f.assertValidSecond(i),this.nanosecond=f.assertValidNanosecond(a),Object.freeze(this)}i.LocalDateTime=p,Object.defineProperty(p.prototype,ut,l);ht.fromStandardDate=function(e,t){return _t(e,t),new ht(e.getFullYear(),e.getMonth()+1,e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),(0,rt.toNumber)(f.totalNanoseconds(e,t)),f.timeZoneOffsetInSeconds(e),null)},ht.prototype.toStandardDate=function(){return f.toStandardDate(this._toUTC())},ht.prototype.toString=function(){var e;return bt(this.year,this.month,this.day,this.hour,this.minute,this.second,this.nanosecond)+(null!=this.timeZoneOffsetSeconds?f.timeZoneOffsetToIsoString(null!=(e=this.timeZoneOffsetSeconds)?e:0):"")+(null!=this.timeZoneId?"[".concat(this.timeZoneId,"]"):"")},ht.fromString=function(e){e=String(e.replace(/,/g,".")).match(new RegExp(/^([+|-]\d{5,}|\d{4})-(\d{2})-(\d{2})[T|t](\d{2})(?::?(\d{2}))?(?::?(\d{2}))?(\.\d+)?/.source+/([Z|z]|\+|-)?(?:(\d{2})(?::?(\d{2}))?(?::?(\d{2}))?)?(?:\[([^\]]*)\])?$/.source));if(null===e)throw(0,tt.newError)("DateTime could not be parsed from string");var t=$e(gt(e[4],e[5],e[6],e[7]),4),r=t[0],n=t[1],o=t[2],t=t[3];if("Z"===e[8]){if(null!=e[9])throw(0,tt.newError)("DateTime could not be parsed from string, can not parse string with offset after Z");return new ht(mt(e[1]),mt(e[2]),mt(e[3]),r,n,o,t,(0,rt.int)(0),e[12])}if("+"===e[8]||"-"===e[8]){if(null==e[9])throw(0,tt.newError)("DateTime could not be parsed from string, could not parse an offset after ".concat(e[8]," sign."));return new ht(mt(e[1]),mt(e[2]),mt(e[3]),r,n,o,t,(0,rt.int)(("+"===e[8]?1:-1)*(3600*parseInt(e[9])+60*parseInt(e[10])+parseInt("0"+e[11]))),e[12])}if(void 0!==e[12])return new ht(mt(e[1]),mt(e[2]),mt(e[3]),r,n,o,t,void 0,e[12]);throw(0,tt.newError)("DateTime could not be parsed from string, provided string needs either timezoneId or offset")},ht.prototype._toUTC=function(){if(void 0===this.timeZoneOffsetSeconds)throw new Error("Requires DateTime created with time zone offset");var e=f.localDateTimeToEpochSecond(this.year,this.month,this.day,this.hour,this.minute,this.second,this.nanosecond).subtract(null!=(e=this.timeZoneOffsetSeconds)?e:0);return(0,rt.int)(e).multiply(1e3).add((0,rt.int)(this.nanosecond).div(1e6)).toNumber()};p=ht;function ht(e,t,r,n,o,i,a,u,s){this.year=f.assertValidYear(e),this.month=f.assertValidMonth(t),this.day=f.assertValidDay(r),this.hour=f.assertValidHour(n),this.minute=f.assertValidMinute(o),this.second=f.assertValidSecond(i),this.nanosecond=f.assertValidNanosecond(a);e=$e(((e,t)=>{var r,n=null!=e,o=null!=t&&""!==t;if(n||o)return r=[void 0,void 0],n&&((0,et.assertNumberOrInteger)(e,"Time zone offset in seconds"),r[0]=e),o&&((0,et.assertString)(t,"Time zone ID"),f.assertValidZoneId("Time zone ID",t),r[1]=t),r;throw(0,tt.newError)("Unable to create DateTime without either time zone offset or id. Please specify either of them. Given offset: ".concat(e," and id: ").concat(t))})(u,s),2),t=e[0],r=e[1];this.timeZoneOffsetSeconds=t,this.timeZoneId=null!=r?r:void 0,Object.freeze(this)}function yt(e,t){return null!=e&&!0===e[t]}function bt(e,t,r,n,o,i,a){return f.dateToIsoString(e,t,r)+"T"+f.timeToIsoString(n,o,i,a)}function _t(e,t){(0,et.assertValidDate)(e,"Standard date"),null!=t&&(0,et.assertNumberOrInteger)(t,"Nanosecond")}function vt(e,t){if(void 0===e||0===e.length)return 0;var r=parseFloat(e);if(isNaN(r))throw(0,tt.newError)("Failed to parse temporal field ".concat(t,". Got string: ").concat(e,"."));return r}function mt(e){return void 0===e||0===e.length?(0,rt.int)(0):(0,rt.int)(e)}function gt(e,t,r,n){var o,i,a,n=void 0!==n?parseFloat("0"+n):0,e=void 0===t||""===t?(o=mt(e),i=(0,rt.int)(60*n),a=(0,rt.int)(3600*n%60),(0,rt.int)(3600*n*Math.pow(10,9)%Math.pow(10,9))):void 0===r||""===r?(o=mt(e),i=mt(t),a=(0,rt.int)(60*n%60),(0,rt.int)(60*n*Math.pow(10,9)%Math.pow(10,9))):(o=mt(e),i=mt(t),a=mt(r),(0,rt.int)(n*Math.pow(10,9)));return[o,i,a,e]}function Ot(e,t){if(!Number.isInteger(e))throw(0,tt.newError)("Parsing Duration field: ".concat(t," resulted in a non-integer value. Bolt protocol can only send durations which can be simplified to integer values of months, days, seconds and nanoseconds."))}i.DateTime=p,Object.defineProperty(p.prototype,st,l);var p={},wt=(Object.defineProperty(p,"__esModule",{value:!0}),p.PathSegment=p.Path=p.UnboundRelationship=p.Relationship=p.Node=void 0,p.isNode=function(e){return It(e,Pt)},p.isRelationship=function(e){return It(e,St)},p.isUnboundRelationship=function(e){return It(e,Tt)},p.isPath=function(e){return It(e,jt)},p.isPathSegment=function(e){return It(e,Ct)},F),Et=u,l={value:!0,enumerable:!1,configurable:!1,writable:!1},Pt="__isNode__",St="__isRelationship__",Tt="__isUnboundRelationship__",jt="__isPath__",Ct="__isPathSegment__";function It(e,t){return null!=e&&!0===e[t]}Rt.prototype.as=function(e,t){var r=this;return(0,Et.as)({get:function(e){return r.properties[e]}},e,t)},Rt.prototype.toString=function(){for(var e="("+this.elementId,t=0;t<this.labels.length;t++)e+=":"+this.labels[t];var r=Object.keys(this.properties);if(0<r.length){e+=" {";for(t=0;t<r.length;t++)0<t&&(e+=","),e+=r[t]+":"+(0,wt.stringify)(this.properties[r[t]]);e+="}"}return e+=")"};var h=Rt;function Rt(e,t,r,n){this.identity=e,this.labels=t,this.properties=r,this.elementId=Dt(n,function(){return e.toString()})}p.Node=h,Object.defineProperty(h.prototype,Pt,l);Mt.prototype.as=function(e,t){var r=this;return(0,Et.as)({get:function(e){return r.properties[e]}},e,t)},Mt.prototype.toString=function(){var e="("+this.startNodeElementId+")-[:"+this.type,t=Object.keys(this.properties);if(0<t.length){e+=" {";for(var r=0;r<t.length;r++)0<r&&(e+=","),e+=t[r]+":"+(0,wt.stringify)(this.properties[t[r]]);e+="}"}return e+="]->("+this.endNodeElementId+")"};var At=Mt;function Mt(e,t,r,n,o,i,a,u){this.identity=e,this.start=t,this.end=r,this.type=n,this.properties=o,this.elementId=Dt(i,function(){return e.toString()}),this.startNodeElementId=Dt(a,function(){return t.toString()}),this.endNodeElementId=Dt(u,function(){return r.toString()})}p.Relationship=At,Object.defineProperty(At.prototype,St,l);kt.prototype.bind=function(e,t){return new At(this.identity,e,t,this.type,this.properties,this.elementId)},kt.prototype.bindTo=function(e,t){return new At(this.identity,e.identity,t.identity,this.type,this.properties,this.elementId,e.elementId,t.elementId)},kt.prototype.as=function(e,t){var r=this;return(0,Et.as)({get:function(e){return r.properties[e]}},e,t)},kt.prototype.toString=function(){var e="-[:"+this.type,t=Object.keys(this.properties);if(0<t.length){e+=" {";for(var r=0;r<t.length;r++)0<r&&(e+=","),e+=t[r]+":"+(0,wt.stringify)(this.properties[t[r]]);e+="}"}return e+="]->"};h=kt;function kt(e,t,r,n){this.identity=e,this.type=t,this.properties=r,this.elementId=Dt(n,function(){return e.toString()})}p.UnboundRelationship=h,Object.defineProperty(h.prototype,Tt,l);function Nt(e,t,r){this.start=e,this.relationship=t,this.end=r}p.PathSegment=Nt,Object.defineProperty(Nt.prototype,Ct,l);function xt(e,t,r){this.start=e,this.end=t,this.segments=r,this.length=r.length}function Dt(e,t){return null==e?t():e}p.Path=xt,Object.defineProperty(xt.prototype,jt,l);var h={},Ut=r&&r.__generator||function(n,o){var i,a,u,s={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,a&&(u=2&t[0]?a.return:t[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,t[1])).done)return u;switch(a=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(u=0<(u=s.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3]))s.label=t[1];else if(6===t[0]&&s.label<u[1])s.label=u[1],u=t;else{if(!(u&&s.label<u[2])){u[2]&&s.ops.pop(),s.trys.pop();continue}s.label=u[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],a=0}finally{i=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Lt=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ft=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},Bt=(Object.defineProperty(h,"__esModule",{value:!0}),t),Vt=u;function qt(e,t,r){var n;this.keys=e,this.length=e.length,this._fields=t,this._fieldLookup=null!=r?r:(t=e,n=Object.create(null),t.forEach(function(e,t){n[e]=t}),n)}qt.prototype.forEach=function(e){var t,r;try{for(var n=Lt(this.entries()),o=n.next();!o.done;o=n.next()){var i=Ft(o.value,2),a=i[0];e(i[1],a,this)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},qt.prototype.map=function(e){var t,r,n=[];try{for(var o=Lt(this.entries()),i=o.next();!i.done;i=o.next()){var a=Ft(i.value,2),u=a[0];n.push(e(a[1],u,this))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return n},qt.prototype.as=function(e,t){return(0,Vt.as)(this,e,t)},qt.prototype.entries=function(){var t;return Ut(this,function(e){switch(e.label){case 0:t=0,e.label=1;case 1:return t<this.keys.length?[4,[this.keys[t],this._fields[t]]]:[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}})},qt.prototype.values=function(){var t;return Ut(this,function(e){switch(e.label){case 0:t=0,e.label=1;case 1:return t<this.keys.length?[4,this._fields[t]]:[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}})},qt.prototype[Symbol.iterator]=function(){var t;return Ut(this,function(e){switch(e.label){case 0:t=0,e.label=1;case 1:return t<this.keys.length?[4,this._fields[t]]:[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}})},qt.prototype.toObject=function(){var t,e,r={};try{for(var n=Lt(this.entries()),o=n.next();!o.done;o=n.next()){var i=Ft(o.value,2);r[i[0]]=i[1]}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return r},qt.prototype.get=function(e){var t;if("number"!=typeof e){if(void 0===(t=this._fieldLookup[e]))throw(0,Bt.newError)("This record has no field with key '".concat(e.toString(),"', available keys are: [")+this.keys.toString()+"].")}else t=e;if(t>this._fields.length-1||t<0)throw(0,Bt.newError)("This record has no field with index '"+t.toString()+"'. Remember that indexes start at `0`, and make sure your query returns records in the shape you meant it to.");return this._fields[t]},qt.prototype.has=function(e){return"number"==typeof e?0<=e&&e<this._fields.length:void 0!==this._fieldLookup[e]},h.default=qt;var l={},Wt=(Object.defineProperty(l,"__esModule",{value:!0}),l.Point=void 0,l.isPoint=function(e){var t=e;return null!=e&&!0===t[zt]},a),zt="__isPoint__",y=(Ht.prototype.toString=function(){return null==this.z||isNaN(this.z)?"Point{srid=".concat(Gt(this.srid),", x=").concat(Gt(this.x),", y=").concat(Gt(this.y),"}"):"Point{srid=".concat(Gt(this.srid),", x=").concat(Gt(this.x),", y=").concat(Gt(this.y),", z=").concat(Gt(this.z),"}")},Ht);function Ht(e,t,r,n){this.srid=(0,Wt.assertNumberOrInteger)(e,"SRID"),this.x=(0,Wt.assertNumber)(t,"X coordinate"),this.y=(0,Wt.assertNumber)(r,"Y coordinate"),this.z=null==n?n:(0,Wt.assertNumber)(n,"Z coordinate"),Object.freeze(this)}function Gt(e){return Number.isInteger(e)?e.toString()+".0":e.toString()}l.Point=y,Object.defineProperty(y.prototype,zt,{value:!0,enumerable:!1,configurable:!1,writable:!1});var Kt,y={},b={},Yt=r&&r.__assign||function(){return(Yt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Zt=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),Qt=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),_=r&&r.__importStar||(Kt=function(e){return(Kt=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=Kt(e),n=0;n<r.length;n++)"default"!==r[n]&&Zt(t,e,r[n]);return Qt(t,e),t}),Xt=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},Jt=r&&r.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||((n=n||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},$t=(Object.defineProperty(b,"__esModule",{value:!0}),b.GqlStatusObject=b.Notification=b.notificationClassification=b.notificationCategory=b.notificationSeverityLevel=void 0,b.polyfillGqlStatusObject=fr,b.polyfillNotification=lr,b.buildGqlStatusObjectFromMetadata=function(e){if(null!=e.statuses)return e.statuses.map(function(e){return new sr(e)});var t=(e=>!0===(null==e?void 0:e.have_records_streamed)?pr.SUCCESS:!1===(null==e?void 0:e.has_keys)?pr.OMITTED_RESULT:!0===(null==e?void 0:e.pulled)?pr.NO_DATA:pr.NO_DATA_UNKNOWN_SUBCONDITION)(e.stream_summary);return Jt([t],Xt(null!=(e=null==(t=e.notifications)?void 0:t.map(fr))?e:[]),!1).sort(function(e,t){return hr(e)-hr(t)})},b.buildNotificationsFromMetadata=function(e){return null==e.notifications?null==e.statuses?[]:e.statuses.map(lr).filter(function(e){return null!=e}):e.notifications.map(function(e){return new ur(e)})},_(F)),er=n,tr=Z,rr={WARNING:{gql_status:"01N42",status_description:"warn: unknown warning"},NO_DATA:{gql_status:"02N42",status_description:"note: no data - unknown subcondition"},INFORMATION:{gql_status:"03N42",status_description:"info: unknown notification"},ERROR:{gql_status:"50N42",status_description:"error: general processing exception - unexpected error"}},nr={WARNING:"WARNING",INFORMATION:"INFORMATION",UNKNOWN:"UNKNOWN"},or=(b.notificationSeverityLevel=nr,Object.freeze(nr),Object.values(nr)),_={HINT:"HINT",UNRECOGNIZED:"UNRECOGNIZED",UNSUPPORTED:"UNSUPPORTED",PERFORMANCE:"PERFORMANCE",DEPRECATION:"DEPRECATION",TOPOLOGY:"TOPOLOGY",SECURITY:"SECURITY",GENERIC:"GENERIC",SCHEMA:"SCHEMA",UNKNOWN:"UNKNOWN"},ir=(b.notificationCategory=_,Object.freeze(_),Object.values(_)),ar=_,ur=(b.notificationClassification=ar,function(e){this.code=e.code,this.title=e.title,this.description=e.description,this.position=yr(e.position),this.severityLevel=br(e.severity),this.rawSeverityLevel=e.severity,this.category=_r(e.category),this.rawCategory=e.category}),sr=(b.Notification=ur,Object.defineProperty(cr.prototype,"diagnosticRecordAsJsonString",{get:function(){return $t.stringify(this.diagnosticRecord,{useCustomToString:!0})},enumerable:!1,configurable:!0}),cr);function cr(e){var t;this.gqlStatus=e.gql_status,this.statusDescription=e.status_description,this.diagnosticRecord=null!=(t=e.diagnostic_record)?t:{},this.position=null!=this.diagnosticRecord._position?yr(this.diagnosticRecord._position):void 0,this.severity=br(this.diagnosticRecord._severity),this.rawSeverity=this.diagnosticRecord._severity,this.classification=_r(this.diagnosticRecord._classification),this.rawClassification=this.diagnosticRecord._classification,this.isNotification=null!=e.neo4j_code,Object.freeze(this)}function lr(e){var t;if(null!=e.neo4j_code)return new ur({code:e.neo4j_code,title:e.title,description:e.description,severity:null==(t=e.diagnostic_record)?void 0:t._severity,category:null==(t=e.diagnostic_record)?void 0:t._classification,position:null==(t=e.diagnostic_record)?void 0:t._position})}function fr(e){var t=e.severity===nr.WARNING?rr.WARNING:rr.INFORMATION,r={gql_status:t.gql_status,status_description:null!=(r=e.description)?r:t.status_description,neo4j_code:e.code,title:e.title,diagnostic_record:Yt({},er.rawPolyfilledDiagnosticRecord)};return null!=e.severity&&(r.diagnostic_record._severity=e.severity),null!=e.category&&(r.diagnostic_record._classification=e.category),null!=e.position&&(r.diagnostic_record._position=e.position),new sr(r)}var pr={SUCCESS:new(b.GqlStatusObject=sr)({gql_status:"00000",status_description:"note: successful completion",diagnostic_record:er.rawPolyfilledDiagnosticRecord}),NO_DATA:new sr({gql_status:"02000",status_description:"note: no data",diagnostic_record:er.rawPolyfilledDiagnosticRecord}),NO_DATA_UNKNOWN_SUBCONDITION:new sr(Yt(Yt({},rr.NO_DATA),{diagnostic_record:er.rawPolyfilledDiagnosticRecord})),OMITTED_RESULT:new sr({gql_status:"00001",status_description:"note: successful completion - omitted result",diagnostic_record:er.rawPolyfilledDiagnosticRecord})};Object.freeze(pr);var dr=Object.freeze({"02":0,"01":1,"00":2});function hr(e){var e=null==(e=e.gqlStatus)?void 0:e.slice(0,2);return null!=(e=dr[e])?e:9999}function yr(e){return null==e?{}:{offset:(0,tr.toNumber)(e.offset),line:(0,tr.toNumber)(e.line),column:(0,tr.toNumber)(e.column)}}function br(e){return or.includes(e)?e:nr.UNKNOWN}function _r(e){return ir.includes(e)?e:ar.UNKNOWN}b.default=sr,Object.defineProperty(y,"__esModule",{value:!0}),y.Stats=y.QueryStatistics=y.QueryProfile=y.ProfiledPlan=y.Plan=y.ServerInfo=y.queryType=void 0;var vr=Z,mr=b,n=(gr.prototype.hasPlan=function(){return this.plan instanceof Or},gr.prototype.hasProfile=function(){return this.queryProfile instanceof Sr},gr);function gr(e,t,r,n){this.query={text:e,parameters:t},this.queryType=r.type,this.counters=new Tr(null!=(e=r.stats)?e:{}),this.plan=(null!=r.plan||null!=r.profile)&&new Or(null!=(t=r.plan)?t:r.profile),this.profile=null!=r.profile&&new wr(r.profile),this.queryProfile=null!=r.profile&&new Sr(r.profile),this.notifications=(0,mr.buildNotificationsFromMetadata)(r),this.gqlStatusObjects=(0,mr.buildGqlStatusObjectFromMetadata)(r),this.server=new Cr(r.server,n),this.resultConsumedAfter=r.result_consumed_after,this.resultAvailableAfter=r.result_available_after,this.database={name:null!=(e=r.db)?e:null}}var Or=function t(e){this.operatorType=e.operatorType,this.identifiers=e.identifiers,this.arguments=e.args,this.children=null!=e.children?e.children.map(function(e){return new t(e)}):[]},wr=(y.Plan=Or,Er.prototype.hasPageCacheStats=function(){return 0<this.pageCacheMisses||0<this.pageCacheHits||0<this.pageCacheHitRatio},Er);function Er(e){this.operatorType=e.operatorType,this.identifiers=e.identifiers,this.arguments=e.args,this.dbHits=Ir("dbHits",e),this.rows=Ir("rows",e),this.pageCacheMisses=Ir("pageCacheMisses",e),this.pageCacheHits=Ir("pageCacheHits",e),this.pageCacheHitRatio=Ir("pageCacheHitRatio",e),this.time=Ir("time",e),this.children=null!=e.children?e.children.map(function(e){return new Er(e)}):[]}y.ProfiledPlan=wr;function Pr(){this.nodesCreated=0,this.nodesDeleted=0,this.relationshipsCreated=0,this.relationshipsDeleted=0,this.propertiesSet=0,this.labelsAdded=0,this.labelsRemoved=0,this.indexesAdded=0,this.indexesRemoved=0,this.constraintsAdded=0,this.constraintsRemoved=0}var Sr=function t(e){this.operatorType=e.operatorType,this.identifiers=e.identifiers,this.arguments=e.args,this.dbHits=Ir("dbHits",e,null),this.rows=Ir("rows",e,null),this.pageCacheMisses=Ir("pageCacheMisses",e,null),this.pageCacheHits=Ir("pageCacheHits",e,null),this.pageCacheHitRatio=Ir("pageCacheHitRatio",e,null),this.time=Ir("time",e,null),this.children=null!=e.children?e.children.map(function(e){return new t(e)}):[]},Tr=(y.QueryProfile=Sr,y.Stats=Pr,jr.prototype.containsUpdates=function(){var r=this;return void 0!==this._containsUpdates?this._containsUpdates:0<Object.keys(this._stats).reduce(function(e,t){return e+r._stats[t]},0)},jr.prototype.updates=function(){return this._stats},jr.prototype.containsSystemUpdates=function(){return void 0!==this._containsSystemUpdates?this._containsSystemUpdates:0<this._systemUpdates},jr.prototype.systemUpdates=function(){return this._systemUpdates},jr);function jr(r){var n=this;this._stats={nodesCreated:0,nodesDeleted:0,relationshipsCreated:0,relationshipsDeleted:0,propertiesSet:0,labelsAdded:0,labelsRemoved:0,indexesAdded:0,indexesRemoved:0,constraintsAdded:0,constraintsRemoved:0},this._systemUpdates=0,Object.keys(r).forEach(function(e){var t=e.replace(/(-\w)/g,function(e){return e[1].toUpperCase()});t in n._stats?n._stats[t]=(0,vr.toNumber)(r[e]):"systemUpdates"===t?n._systemUpdates=(0,vr.toNumber)(r[e]):"containsSystemUpdates"===t?n._containsSystemUpdates=r[e]:"containsUpdates"===t&&(n._containsUpdates=r[e])}),this._stats=Object.freeze(this._stats)}y.QueryStatistics=Tr;var Cr=function(e,t){null!=e&&(this.address=e.address,this.agent=e.version),this.protocolVersion=t};function Ir(e,t,r){var n,o;return n=e,!1!==(o=t)&&n in o?(n=t[e],(0,vr.toNumber)(n)):void 0!==r?r:0}y.ServerInfo=Cr;function Rr(){throw this.minimumSeverityLevel=void 0,this.disabledCategories=void 0,this.disabledClassifications=void 0,new Error("Not implemented")}y.queryType={READ_ONLY:"r",READ_WRITE:"rw",WRITE_ONLY:"w",SCHEMA_WRITE:"s"},y.default=n;var _={},n=(Object.defineProperty(_,"__esModule",{value:!0}),_.notificationFilterDisabledClassification=_.notificationFilterDisabledCategory=_.notificationFilterMinimumSeverityLevel=void 0,{OFF:"OFF",WARNING:"WARNING",INFORMATION:"INFORMATION"}),n=(_.notificationFilterMinimumSeverityLevel=n,Object.freeze(n),{HINT:"HINT",UNRECOGNIZED:"UNRECOGNIZED",UNSUPPORTED:"UNSUPPORTED",PERFORMANCE:"PERFORMANCE",TOPOLOGY:"TOPOLOGY",SECURITY:"SECURITY",DEPRECATION:"DEPRECATION",GENERIC:"GENERIC",SCHEMA:"SCHEMA"}),n=(_.notificationFilterDisabledCategory=n,Object.freeze(n),_.notificationFilterDisabledClassification=n,_.default=Rr,{}),v={},m={},Ar=(Object.defineProperty(m,"__esModule",{value:!0}),m.FailedObserver=m.CompletedObserver=void 0,Mr.prototype.subscribe=function(e){Nr(e,e.onKeys,[]),Nr(e,e.onCompleted,{})},Mr.prototype.cancel=function(){},Mr.prototype.pause=function(){},Mr.prototype.resume=function(){},Mr.prototype.prepareToHandleSingleResponse=function(){},Mr.prototype.markCompleted=function(){},Mr.prototype.onError=function(e){throw new Error("CompletedObserver not supposed to call onError",{cause:e})},Mr);function Mr(){}function kr(e){var t=e.error,e=e.onError;this._error=t,this._beforeError=e,this._observers=[],this.onError(t)}function Nr(e,t,r){null!=t&&t.bind(e)(r)}m.CompletedObserver=Ar,kr.prototype.subscribe=function(e){Nr(e,e.onError,this._error),this._observers.push(e)},kr.prototype.onError=function(t){Nr(this,this._beforeError,t),this._observers.forEach(function(e){return Nr(e,e.onError,t)})},kr.prototype.cancel=function(){},kr.prototype.pause=function(){},kr.prototype.resume=function(){},kr.prototype.markCompleted=function(){},kr.prototype.prepareToHandleSingleResponse=function(){},m.FailedObserver=kr;var xr,Ar={},Dr=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),Ur=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),g=r&&r.__importStar||(xr=function(e){return(xr=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=xr(e),n=0;n<r.length;n++)"default"!==r[n]&&Dr(t,e,r[n]);return Ur(t,e),t}),Lr=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},Fr=r&&r.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||((n=n||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},Br=(Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.Bookmarks=void 0,g(a)),g=(Vr.empty=function(){return qr},Vr.prototype.isEmpty=function(){return 0===this._values.length},Vr.prototype.values=function(){return this._values},Vr.prototype[Symbol.iterator]=function(){return this._values[Symbol.iterator]()},Vr.prototype.asBeginTransactionParameters=function(){var e;return this.isEmpty()?{}:((e={}).bookmarks=this._values,e)},Vr);function Vr(e){this._values=(e=>{if(null==e||""===e)return[];if(Br.isString(e))return[e];if(Array.isArray(e)){for(var t=new Set,r=function r(e){return e.reduce(function(e,t){return Array.isArray(t)?e.concat(r(t)):e.concat(t)},[])}(e),n=0;n<r.length;n++){var o=r[n];if(null!=o){if(!Br.isString(o))throw new TypeError("Bookmark value should be a string, given: '".concat(o,"'"));t.add(o)}}return Fr([],Lr(t),!1)}throw new TypeError("Bookmarks should either be a string or a string array, given: '".concat(e,"'"))})(e)}var qr=new(Ar.Bookmarks=g)(null);var g={},Wr={},O=(Object.defineProperty(Wr,"__esModule",{value:!0}),Wr.ProtocolVersion=void 0,zr.prototype.getMajor=function(){return this.major},zr.prototype.getMinor=function(){return this.major},zr.prototype.isLessThan=function(e){return this.major<e.major||this.major===e.major&&this.minor<e.minor},zr.prototype.isGreaterThan=function(e){return this.major>e.major||this.major===e.major&&this.minor>e.minor},zr.prototype.isGreaterOrEqualTo=function(e){return!this.isLessThan(e)},zr.prototype.isLessOrEqualTo=function(e){return!this.isGreaterThan(e)},zr.prototype.isEqualTo=function(e){return this.major===e.major&&this.minor===e.minor},zr.prototype.toString=function(){return this.major.toString()+"."+this.minor.toString()},zr);function zr(e,t){this.major=e,this.minor=t}Wr.ProtocolVersion=O,Object.defineProperty(g,"__esModule",{value:!0}),g.TELEMETRY_APIS=g.BOLT_PROTOCOL_V6_1=g.BOLT_PROTOCOL_V6_0=g.BOLT_PROTOCOL_V5_8=g.BOLT_PROTOCOL_V5_7=g.BOLT_PROTOCOL_V5_6=g.BOLT_PROTOCOL_V5_5=g.BOLT_PROTOCOL_V5_4=g.BOLT_PROTOCOL_V5_3=g.BOLT_PROTOCOL_V5_2=g.BOLT_PROTOCOL_V5_1=g.BOLT_PROTOCOL_V5_0=g.BOLT_PROTOCOL_V4_4=g.BOLT_PROTOCOL_V4_3=g.BOLT_PROTOCOL_V4_2=g.BOLT_PROTOCOL_V4_1=g.BOLT_PROTOCOL_V4_0=g.BOLT_PROTOCOL_V3=g.BOLT_PROTOCOL_V2=g.BOLT_PROTOCOL_V1=g.DEFAULT_POOL_MAX_SIZE=g.DEFAULT_POOL_ACQUISITION_TIMEOUT=g.DEFAULT_CONNECTION_TIMEOUT_MILLIS=g.ACCESS_MODE_WRITE=g.ACCESS_MODE_READ=g.FETCH_ALL=void 0;var Hr,Gr,O=Wr,w=(g.FETCH_ALL=-1,g.DEFAULT_POOL_ACQUISITION_TIMEOUT=6e4,g.DEFAULT_POOL_MAX_SIZE=100,g.DEFAULT_CONNECTION_TIMEOUT_MILLIS=3e4,g.ACCESS_MODE_READ="READ",g.ACCESS_MODE_WRITE="WRITE",new O.ProtocolVersion(1,0)),w=(g.BOLT_PROTOCOL_V1=w,new O.ProtocolVersion(2,0)),w=(g.BOLT_PROTOCOL_V2=w,new O.ProtocolVersion(3,0)),w=(g.BOLT_PROTOCOL_V3=w,new O.ProtocolVersion(4,0)),w=(g.BOLT_PROTOCOL_V4_0=w,new O.ProtocolVersion(4,1)),w=(g.BOLT_PROTOCOL_V4_1=w,new O.ProtocolVersion(4,2)),w=(g.BOLT_PROTOCOL_V4_2=w,new O.ProtocolVersion(4,3)),w=(g.BOLT_PROTOCOL_V4_3=w,new O.ProtocolVersion(4,4)),w=(g.BOLT_PROTOCOL_V4_4=w,new O.ProtocolVersion(5,0)),w=(g.BOLT_PROTOCOL_V5_0=w,new O.ProtocolVersion(5,1)),w=(g.BOLT_PROTOCOL_V5_1=w,new O.ProtocolVersion(5,2)),w=(g.BOLT_PROTOCOL_V5_2=w,new O.ProtocolVersion(5,3)),w=(g.BOLT_PROTOCOL_V5_3=w,new O.ProtocolVersion(5,4)),w=(g.BOLT_PROTOCOL_V5_4=w,new O.ProtocolVersion(5,5)),w=(g.BOLT_PROTOCOL_V5_5=w,new O.ProtocolVersion(5,6)),w=(g.BOLT_PROTOCOL_V5_6=w,new O.ProtocolVersion(5,7)),w=(g.BOLT_PROTOCOL_V5_7=w,new O.ProtocolVersion(5,8)),w=(g.BOLT_PROTOCOL_V5_8=w,new O.ProtocolVersion(6,0)),w=(g.BOLT_PROTOCOL_V6_0=w,new O.ProtocolVersion(6,1)),O=(g.BOLT_PROTOCOL_V6_1=w,g.TELEMETRY_APIS={MANAGED_TRANSACTION:0,UNMANAGED_TRANSACTION:1,AUTO_COMMIT_TRANSACTION:2,EXECUTE_QUERY:3},{}),w={},Kr=r&&r.__extends||(Hr=function(e,t){return(Hr=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Hr(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Yr=(Object.defineProperty(w,"__esModule",{value:!0}),w.Logger=void 0,t),Zr="error",Qr="warn",Xr="info",Jr="debug",$r=((E={})[Zr]=0,E[Qr]=1,E[Xr]=2,E[Jr]=3,E),E=(en.create=function(e){var t;return null!=(null==e?void 0:e.logging)?(e=e.logging,t=null!=(null==(t=e)?void 0:t.unredactDebugLogs)&&t.unredactDebugLogs,new en((e=>{if(null==(null==e?void 0:e.level))return"info";var e=e.level,t=$r[e];if(null!=t||0===t)return e;throw(0,Yr.newError)("Illegal logging level: ".concat(e,". Supported levels are: ").concat(Object.keys($r).toString()))})(e),(e=>{if(null!=(null==e?void 0:e.logger)){var t=e.logger;if(null!=t&&"function"==typeof t)return t}throw(0,Yr.newError)("Illegal logger function: ".concat(null!=(e=null==(t=null==e?void 0:e.logger)?void 0:t.toString())?e:"undefined"))})(e),t)):this.noOp()},en.noOp=function(){return rn},en.prototype.isErrorEnabled=function(){return nn(this._level,Zr)},en.prototype.error=function(e){this.isErrorEnabled()&&this._loggerFunction(Zr,e)},en.prototype.isWarnEnabled=function(){return nn(this._level,Qr)},en.prototype.warn=function(e){this.isWarnEnabled()&&this._loggerFunction(Qr,e)},en.prototype.isInfoEnabled=function(){return nn(this._level,Xr)},en.prototype.info=function(e){this.isInfoEnabled()&&this._loggerFunction(Xr,e)},en.prototype.isDebugEnabled=function(){return nn(this._level,Jr)},en.prototype.debug=function(e){this.isDebugEnabled()&&this._loggerFunction(Jr,e)},en);function en(e,t,r){this._level=e,this._loggerFunction=t,this.unredactDebugLogs=null!=r&&r}function tn(){return Gr.call(this,Xr,function(e,t){},!1)||this}w.Logger=E,Kr(tn,Gr=E),tn.prototype.isErrorEnabled=function(){return!1},tn.prototype.error=function(e){},tn.prototype.isWarnEnabled=function(){return!1},tn.prototype.warn=function(e){},tn.prototype.isInfoEnabled=function(){return!1},tn.prototype.info=function(e){},tn.prototype.isDebugEnabled=function(){return!1},tn.prototype.debug=function(e){};var rn=new tn;function nn(e,t){return $r[t]<=$r[e]}var on,Kr=r&&r.__extends||(on=function(e,t){return(on=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}on(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),an=r&&r.__awaiter||function(e,a,u,s){return new(u=u||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof u?t:new u(function(e){e(t)})).then(n,o)}i((s=s.apply(e,a||[])).next())})},un=r&&r.__generator||function(n,o){var i,a,u,s={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,a&&(u=2&t[0]?a.return:t[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,t[1])).done)return u;switch(a=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(u=0<(u=s.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3]))s.label=t[1];else if(6===t[0]&&s.label<u[1])s.label=u[1],u=t;else{if(!(u&&s.label<u[2])){u[2]&&s.ops.pop(),s.trys.pop();continue}s.label=u[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],a=0}finally{i=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},sn=(Object.defineProperty(O,"__esModule",{value:!0}),O.EMPTY_CONNECTION_HOLDER=O.ReadOnlyConnectionHolder=O.ConnectionHolder=void 0,t),cn=a,ln=g,fn=Ar,pn=w,E=(dn.prototype.mode=function(){return this._mode},dn.prototype.database=function(){return this._database},dn.prototype.setDatabase=function(e){this._database=e},dn.prototype.bookmarks=function(){return this._bookmarks},dn.prototype.connectionProvider=function(){return this._connectionProvider},dn.prototype.referenceCount=function(){return this._referenceCount},dn.prototype.initializeConnection=function(e){return 0!==this._referenceCount||null==this._connectionProvider?(this._referenceCount++,!1):(this._connectionPromise=this._createConnectionPromise(this._connectionProvider,e),this._referenceCount++,!0)},dn.prototype._createConnectionPromise=function(o,i){return an(this,void 0,void 0,function(){var t,r,n;return un(this,function(e){switch(e.label){case 0:return r=(t=o).acquireConnection,n={accessMode:this._mode,database:this._database},[4,this._getBookmarks()];case 1:return[4,r.apply(t,[(n.bookmarks=e.sent(),n.impersonatedUser=this._impersonatedUser,n.onDatabaseNameResolved=this._onDatabaseNameResolved,n.auth=this._auth,n.homeDb=i,n)])];case 2:return[2,e.sent()]}})})},dn.prototype._getBookmarks=function(){return an(this,void 0,void 0,function(){return un(this,function(e){switch(e.label){case 0:return[4,this._getConnectionAcquistionBookmarks()];case 1:return[2,e.sent()]}})})},dn.prototype.getConnection=function(){return this._connectionPromise},dn.prototype.releaseConnection=function(){return 0!==this._referenceCount&&(this._referenceCount--,0===this._referenceCount)?this._releaseConnection():this._connectionPromise},dn.prototype.close=function(e){return this._closed=!0,0===this._referenceCount?this._connectionPromise:(this._referenceCount=0,this._releaseConnection(e))},dn.prototype.log=function(){return this._log},dn.prototype._releaseConnection=function(t){return this._connectionPromise=this._connectionPromise.then(function(e){return null!=e?e.isOpen()&&(e.hasOngoingObservableRequests()||!0===t)?e.resetAndFlush().catch(vn).then(function(){return e.release().then(function(){return null})}):e.release().then(function(){return null}):Promise.resolve(null)}).catch(this._logError),this._connectionPromise},dn.prototype._logError=function(e){return this._log.isWarnEnabled()&&this._log.warn("ConnectionHolder got an error while releasing the connection. Error ".concat(e,". Stacktrace: ").concat(e.stack)),null},dn);function dn(e){var t=e.mode,r=e.database,r=void 0===r?"":r,n=e.bookmarks,o=e.connectionProvider,i=e.impersonatedUser,a=e.onDatabaseNameResolved,u=e.getConnectionAcquistionBookmarks,s=e.auth,e=e.log;this._mode=null!=t?t:ln.ACCESS_MODE_WRITE,this._closed=!1,this._database=null!=r?(0,cn.assertString)(r,"database"):"",this._bookmarks=null!=n?n:fn.Bookmarks.empty(),this._connectionProvider=o,this._impersonatedUser=i,this._referenceCount=0,this._connectionPromise=Promise.resolve(null),this._onDatabaseNameResolved=a,this._auth=s,this._log=e,this._logError=this._logError.bind(this),this._getConnectionAcquistionBookmarks=null!=u?u:function(){return Promise.resolve(fn.Bookmarks.empty())}}O.ConnectionHolder=E;Kr(bn,hn=E),bn.prototype.initializeConnection=function(){return 0!==this._connectionHolder.referenceCount()},bn.prototype.getConnection=function(){return this._connectionHolder.getConnection()},bn.prototype.releaseConnection=function(){return this._connectionHolder.getConnection().catch(function(){return Promise.resolve(null)})},bn.prototype.close=function(){return this._connectionHolder.getConnection().catch(function(){return Promise.resolve(null)})};var hn,yn,P=bn;function bn(e){var t=hn.call(this,{mode:e.mode(),database:e.database(),bookmarks:e.bookmarks(),getConnectionAcquistionBookmarks:e._getConnectionAcquistionBookmarks,connectionProvider:e.connectionProvider(),log:e.log()})||this;return t._connectionHolder=e,t}function _n(){return yn.call(this,{log:pn.Logger.create({})})||this}O.ReadOnlyConnectionHolder=P,O.default=P,Kr(_n,yn=E),_n.prototype.mode=function(){},_n.prototype.database=function(){},_n.prototype.initializeConnection=function(){return!0},_n.prototype.getConnection=function(){return an(this,void 0,void 0,function(){return un(this,function(e){switch(e.label){case 0:return[4,Promise.reject((0,sn.newError)("This connection holder does not serve connections"))];case 1:return[2,e.sent()]}})})},_n.prototype.releaseConnection=function(){return an(this,void 0,void 0,function(){return un(this,function(e){switch(e.label){case 0:return[4,Promise.resolve(null)];case 1:return[2,e.sent()]}})})},_n.prototype.close=function(){return an(this,void 0,void 0,function(){return un(this,function(e){switch(e.label){case 0:return[4,Promise.resolve(null)];case 1:return[2,e.sent()]}})})};P=new _n;function vn(e){return null}O.EMPTY_CONNECTION_HOLDER=P;var mn,Kr={},gn=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),On=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),E=r&&r.__importStar||(mn=function(e){return(mn=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=mn(e),n=0;n<r.length;n++)"default"!==r[n]&&gn(t,e,r[n]);return On(t,e),t}),wn=(Object.defineProperty(Kr,"__esModule",{value:!0}),Kr.TxConfig=void 0,E(a)),En=t,Pn=Z,P=(Sn.empty=function(){return Tn},Sn.prototype.isEmpty=function(){return Object.values(this).every(function(e){return null==e})},Sn);function Sn(e,t){var r;null!=(r=e)&&wn.assertObject(r,"Transaction config"),this.timeout=((e,t)=>{if(wn.isObject(e)&&null!=e.timeout){wn.assertNumberOrInteger(e.timeout,"Transaction timeout"),(e=>"number"==typeof e.timeout&&!Number.isInteger(e.timeout))(e)&&!0===(null==t?void 0:t.isInfoEnabled())&&null!=t&&t.info("Transaction timeout expected to be an integer, got: ".concat(e.timeout,". The value will be rounded up."));t=(0,Pn.int)(e.timeout,{ceilFloat:!0});if(t.isNegative())throw(0,En.newError)("Transaction timeout should not be negative");return t}return null})(e,t),this.metadata=(e=>{if(wn.isObject(e)&&null!=e.metadata){e=e.metadata;if(wn.assertObject(e,"config.metadata"),0!==Object.keys(e).length)return e}return null})(e)}var Tn=new(Kr.TxConfig=P)({});var E={},jn=r&&r.__assign||function(){return(jn=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Cn=r&&r.__awaiter||function(e,a,u,s){return new(u=u||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof u?t:new u(function(e){e(t)})).then(n,o)}i((s=s.apply(e,a||[])).next())})},In=r&&r.__generator||function(n,o){var i,a,u,s={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,a&&(u=2&t[0]?a.return:t[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,t[1])).done)return u;switch(a=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(u=0<(u=s.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3]))s.label=t[1];else if(6===t[0]&&s.label<u[1])s.label=u[1],u=t;else{if(!(u&&s.label<u[2])){u[2]&&s.ops.pop(),s.trys.pop();continue}s.label=u[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],a=0}finally{i=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Rn=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},An=r&&r.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||((n=n||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},Mn=(Object.defineProperty(E,"__esModule",{value:!0}),E.TransactionExecutor=void 0,t),kn=g;function Nn(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setTimeout.apply(void 0,An([e,t],Rn(r),!1))}function xn(e){return clearTimeout(e)}function Dn(e,t,r,n,o){void 0===o&&(o={setTimeout:Nn,clearTimeout:xn}),this._maxRetryTimeMs=Un(e,3e4),this._initialRetryDelayMs=Un(t,1e3),this._multiplier=Un(r,2),this._jitterFactor=Un(n,.2),this._setTimeout=o.setTimeout,this._clearTimeout=o.clearTimeout,this._inFlightTimeoutIds=[],this.pipelineBegin=!1,this.telemetryApi=kn.TELEMETRY_APIS.MANAGED_TRANSACTION,this._verifyAfterConstruction()}function Un(e,t){return null!=e?e:t}Dn.prototype.execute=function(n,o,i){var a=this,u={apiTransactionConfig:{api:this.telemetryApi,onTelemetrySuccess:function(){u.apiTransactionConfig=void 0}}};return new Promise(function(e,t){a._executeTransactionInsidePromise(n,o,e,t,i,u).catch(t)}).catch(function(e){var t=Date.now(),r=a._initialRetryDelayMs;return a._retryTransactionPromise(n,o,e,t,r,i,u)})},Dn.prototype.close=function(){var t=this;this._inFlightTimeoutIds.forEach(function(e){return t._clearTimeout(e)}),this._inFlightTimeoutIds=[]},Dn.prototype._retryTransactionPromise=function(o,i,e,r,a,u,s){var c=this;return Date.now()-r>this._maxRetryTimeMs||!(0,Mn.isRetryableError)(e)?Promise.reject(e):new Promise(function(e,t){var r=c._computeDelayWithJitter(a),n=c._setTimeout(function(){c._inFlightTimeoutIds=c._inFlightTimeoutIds.filter(function(e){return e!==n}),c._executeTransactionInsidePromise(o,i,e,t,u,s).catch(t)},r);c._inFlightTimeoutIds.push(n)}).catch(function(e){var t=a*c._multiplier;return c._retryTransactionPromise(o,i,e,r,t,u,s)})},Dn.prototype._executeTransactionInsidePromise=function(a,u,s,c,l,f){return Cn(this,void 0,void 0,function(){var t,r,n,o,i=this;return In(this,function(e){switch(e.label){case 0:return(e.trys.push([0,4,,5]),r=a(null!=(null==f?void 0:f.apiTransactionConfig)?jn({},null==f?void 0:f.apiTransactionConfig):void 0),this.pipelineBegin)?(n=r,[3,3]):[3,1];case 1:return[4,r];case 2:n=e.sent(),e.label=3;case 3:return t=n,[3,5];case 4:return o=e.sent(),c(o),[2];case 5:return o=(null!=l?l:function(e){return e})(t),this._safeExecuteTransactionWork(o,u).then(function(e){return i._handleTransactionWorkSuccess(e,t,s,c)}).catch(function(e){return i._handleTransactionWorkFailure(e,t,c)}),[2]}})})},Dn.prototype._safeExecuteTransactionWork=function(e,t){try{var r=t(e);return Promise.resolve(r)}catch(e){return Promise.reject(e)}},Dn.prototype._handleTransactionWorkSuccess=function(e,t,r,n){t.isOpen()?t.commit().then(function(){r(e)}).catch(function(e){n(e)}):r(e)},Dn.prototype._handleTransactionWorkFailure=function(e,t,r){t.isOpen()?t.rollback().catch(function(e){}).then(function(){return r(e)}).catch(r):r(e)},Dn.prototype._computeDelayWithJitter=function(e){var t=e*this._jitterFactor,r=e-t,e=e+t;return Math.random()*(e-r)+r},Dn.prototype._verifyAfterConstruction=function(){if(this._maxRetryTimeMs<0)throw(0,Mn.newError)("Max retry time should be >= 0: "+this._maxRetryTimeMs.toString());if(this._initialRetryDelayMs<0)throw(0,Mn.newError)("Initial retry delay should >= 0: "+this._initialRetryDelayMs.toString());if(this._multiplier<1)throw(0,Mn.newError)("Multiplier should be >= 1.0: "+this._multiplier.toString());if(this._jitterFactor<0||1<this._jitterFactor)throw(0,Mn.newError)("Jitter factor should be in [0.0, 1.0]: "+this._jitterFactor.toFixed())},E.TransactionExecutor=Dn;var P={},Ln=r&&r.__assign||function(){return(Ln=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Fn=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},Bn=(Object.defineProperty(P,"__esModule",{value:!0}),P.Url=void 0,P.parseDatabaseUrl=function(e){(0,Bn.assertString)(e,"URL");var t=(e=>(e=e.trim()).includes("://")?{schemeMissing:!1,url:e}:{schemeMissing:!0,url:"none://".concat(e)})(e),r=(e=>{function a(e,t){t=e.indexOf(t);return 0<=t?[e.substring(0,t),e[t],e.substring(t+1)]:[e,"",""]}function t(e){var t,r={},n=((t="@")===(t=0<=(t=(o=e).lastIndexOf(t))?[o.substring(0,t),o[t],o.substring(t+1)]:["","",o])[1]&&(r.userInfo=decodeURIComponent(t[0]),e=t[2]),Fn((o="]",n=a(n=e,i="["),[(i=a(n[2],o))[0],i[2]]),2)),o=n[0],i=n[1];return""!==o?(r.host=o,t=a(i,":")):(t=a(e,":"),r.host=t[0]),":"===t[1]&&(r.port=t[2]),r}var r,n={};return":"===(r=a(e,":"))[1]&&(n.scheme=decodeURIComponent(r[0]),e=r[2]),"#"===(r=a(e,"#"))[1]&&(n.fragment=decodeURIComponent(r[2]),e=r[0]),"?"===(r=a(e,"?"))[1]&&(n.query=r[2],e=r[0]),e.startsWith("//")?(r=a(e.substr(2),"/"),(n=Ln(Ln({},n),t(r[0]))).path=r[1]+r[2]):n.path=e,n})(t.url),t=t.schemeMissing?null:(e=>null==e?null:e=":"===(e=e.trim()).charAt(e.length-1)?e.substring(0,e.length-1):e)(r.scheme),n=(e=>{if(null!=e)return e.trim();throw new Error("Unable to extract host from null or undefined URL")})(r.host),o=(e=>{if(""===e||null==e)throw new Error("Illegal host ".concat(e));return e.includes(":")?Gn(e):e})(n),i=((e,t)=>null==(e="string"==typeof e?parseInt(e,10):e)||isNaN(e)?Kn(t):e)(r.port,t),o="".concat(o,":").concat(i),a=((e,r)=>{var e=null!=e?(e=>e="?"===(null==(e=(null!=e?e:"").trim())?void 0:e.charAt(0))?e.substring(1,e.length):e)(e):null,n={};return null!=e&&e.split("&").forEach(function(e){e=e.split("=");if(2!==e.length)throw new Error("Invalid parameters: '".concat(e.toString(),"' in URL '").concat(r,"'."));var t=Hn(e[0],"key",r),e=Hn(e[1],"value",r);if(void 0!==n[t])throw new Error("Duplicated query parameters with key '".concat(t,"' in URL '").concat(r,"'"));n[t]=e}),n})(null!=(a=r.query)?a:(e=>"string"!=typeof e?null:Fn(e.split("?"),2)[1])(r.resourceName),e);return new zn(t,n,i,o,a)},P.defaultPortForScheme=Kn,P.formatIPv4Address=function(e,t){return"".concat(e,":").concat(t)},P.formatIPv6Address=function(e,t){e=Gn(e);return"".concat(e,":").concat(t)},a),Vn=7687,qn=7474,Wn=7473,zn=function(e,t,r,n,o){this.scheme=e,this.host=t,this.port=r,this.hostAndPort=n,this.query=o};function Hn(e,t,r){if(""===(e=(null!=e?e:"").trim()))throw new Error("Illegal empty ".concat(t," in URL query '").concat(r,"'"));return e}function Gn(e){var t="["===e.charAt(0),r="]"===e.charAt(e.length-1);if(t||r){if(t&&r)return e;throw new Error("Illegal IPv6 address ".concat(e))}return"[".concat(e,"]")}function Kn(e){return"http"===e?qn:"https"===e?Wn:Vn}P.Url=zn;var Yn,S={},Zn=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),Qn=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Xn=r&&r.__importStar||(Yn=function(e){return(Yn=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=Yn(e),n=0;n<r.length;n++)"default"!==r[n]&&Zn(t,e,r[n]);return Qn(t,e),t}),Jn=(Object.defineProperty(S,"__esModule",{value:!0}),S.ServerAddress=void 0,a),$n=Xn(P);function eo(e,t,r,n){this._host=(0,Jn.assertString)(e,"host"),this._resolved=null!=t?(0,Jn.assertString)(t,"resolved"):null,this._port=(0,Jn.assertNumber)(r,"port"),this._hostPort=n,this._stringValue=null!=t?"".concat(n,"(").concat(t,")"):"".concat(n)}eo.prototype.host=function(){return this._host},eo.prototype.resolvedHost=function(){return null!=this._resolved?this._resolved:this._host},eo.prototype.port=function(){return this._port},eo.prototype.resolveWith=function(e){return new eo(this._host,e,this._port,this._hostPort)},eo.prototype.asHostPort=function(){return this._hostPort},eo.prototype.asKey=function(){return this._hostPort},eo.prototype.toString=function(){return this._stringValue},eo.fromUrl=function(e){e=$n.parseDatabaseUrl(e);return new eo(e.host,null,e.port,e.hostAndPort)},S.ServerAddress=eo;var Xn={},T={};function to(){}Object.defineProperty(T,"__esModule",{value:!0}),to.prototype.resolve=function(){throw new Error("Abstract function")},to.prototype._resolveToItself=function(e){return Promise.resolve([e])},T.default=to;var ro={},no=(Object.defineProperty(ro,"__esModule",{value:!0}),S);function oo(e){return Promise.resolve([e])}function io(e){this._resolverFunction=null!=e?e:oo}io.prototype.resolve=function(t){var r=this;return new Promise(function(e){return e(r._resolverFunction(t.asHostPort()))}).then(function(e){if(Array.isArray(e))return e.map(function(e){return no.ServerAddress.fromUrl(e)});throw new TypeError("Configured resolver function should either return an array of addresses or a Promise resolved with an array of addresses."+"Each address is '<host>:<port>'. Got: ".concat(e))})},ro.default=io;var ao,uo=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},T=(Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.ConfiguredCustomResolver=Xn.BaseHostNameResolver=void 0,uo(T)),T=(Xn.BaseHostNameResolver=T.default,uo(ro)),uo=(Xn.ConfiguredCustomResolver=T.default,{}),T={};Object.defineProperty(T,"__esModule",{value:!0}),T.fromVersion=function(e,t){void 0===t&&(t=function(){return{get userAgent(){}}});var t=t(),r=null!=t.userAgent?t.userAgent.split("(")[1].split(")")[0]:void 0,t=t.userAgent||void 0;return{product:"neo4j-javascript/".concat(e),platform:r,languageDetails:t}},co=uo,ao=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),so=r&&r.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||ao(t,e,r)},Object.defineProperty(co,"__esModule",{value:!0}),so(T,co);var so={},T={},co=(Object.defineProperty(T,"__esModule",{value:!0}),T.DEFAULT_ACQUISITION_TIMEOUT=T.DEFAULT_MAX_SIZE=void 0,T.DEFAULT_MAX_SIZE=100,T.DEFAULT_ACQUISITION_TIMEOUT=6e4,lo.defaultConfig=function(){return new lo(100,6e4)},lo.fromDriverConfig=function(e){return new lo(po(e.maxConnectionPoolSize)?e.maxConnectionPoolSize:100,po(e.connectionAcquisitionTimeout)?e.connectionAcquisitionTimeout:6e4)},lo);function lo(e,t){this.maxSize=fo(e,100),this.acquisitionTimeout=fo(t,6e4)}function fo(e,t){return po(e)?e:t}function po(e){return 0===e||null!=e}T.default=co;var co={},ho=r&&r.__awaiter||function(e,a,u,s){return new(u=u||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof u?t:new u(function(e){e(t)})).then(n,o)}i((s=s.apply(e,a||[])).next())})},yo=r&&r.__generator||function(n,o){var i,a,u,s={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,a&&(u=2&t[0]?a.return:t[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,t[1])).done)return u;switch(a=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(u=0<(u=s.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3]))s.label=t[1];else if(6===t[0]&&s.label<u[1])s.label=u[1],u=t;else{if(!(u&&s.label<u[2])){u[2]&&s.ops.pop(),s.trys.pop();continue}s.label=u[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],a=0}finally{i=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},bo=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},_o=(Object.defineProperty(co,"__esModule",{value:!0}),bo(T)),vo=t,mo=w,bo=(go.prototype.acquire=function(s,c,l){return ho(this,void 0,void 0,function(){var o,i,t,a,u=this;return yo(this,function(e){switch(e.label){case 0:if(o=c.asKey(),i=this._acquireRequests,t=i[o],(a=null!=s.startTime&&0!==s.startTime?(new Date).getTime()-s.startTime:0)>=this._acquisitionTimeout)throw this.getAcquisitionTimeoutError(c);return null==t&&(i[o]=[]),[4,new Promise(function(e,t){var r=setTimeout(function(){var e=i[o];null!=e&&(i[o]=e.filter(function(e){return e!==n})),n.isCompleted()||n.reject(u.getAcquisitionTimeoutError(c))},u._acquisitionTimeout-a),n=("object"==typeof r&&r.unref(),new Eo(o,s,l,e,t,r,u._log));i[o].push(n),u._processPendingAcquireRequests(c)})];case 1:return[2,e.sent()]}})})},go.prototype.getAcquisitionTimeoutError=function(e){var t=e.asKey(),r=this.activeResourceCount(e),e=this.has(e)?this._pools[t].length:0;return(0,vo.newError)("Connection acquisition timed out in ".concat(this._acquisitionTimeout," ms. Pool status: Active conn count = ").concat(r,", Idle conn count = ").concat(e,"."))},go.prototype.purge=function(t){return ho(this,void 0,void 0,function(){return yo(this,function(e){switch(e.label){case 0:return[4,this._purgeKey(t.asKey())];case 1:return[2,e.sent()]}})})},go.prototype.apply=function(e,t){e=e.asKey();e in this._pools&&this._pools[e].apply(t)},go.prototype.close=function(){return ho(this,void 0,void 0,function(){var r=this;return yo(this,function(e){switch(e.label){case 0:return this._closed=!0,[4,Promise.all(Object.keys(this._pools).map(function(t){return ho(r,void 0,void 0,function(){return yo(this,function(e){switch(e.label){case 0:return[4,this._purgeKey(t)];case 1:return[2,e.sent()]}})})})).then()];case 1:return[2,e.sent()]}})})},go.prototype.keepAll=function(o){return ho(this,void 0,void 0,function(){var t,r,n=this;return yo(this,function(e){switch(e.label){case 0:return t=o.map(function(e){return e.asKey()}),r=Object.keys(this._pools),r=r.filter(function(e){return!t.includes(e)}),[4,Promise.all(r.map(function(t){return ho(n,void 0,void 0,function(){return yo(this,function(e){switch(e.label){case 0:return[4,this._purgeKey(t)];case 1:return[2,e.sent()]}})})})).then()];case 1:return[2,e.sent()]}})})},go.prototype.has=function(e){return e.asKey()in this._pools},go.prototype.activeResourceCount=function(e){return null!=(e=this._activeResourceCounts[e.asKey()])?e:0},go.prototype._getOrInitializePoolFor=function(e){var t=this._pools[e];return null==t&&(t=new Io,this._pools[e]=t,this._pendingCreates[e]=0),t},go.prototype._acquire=function(c,l,f){return ho(this,void 0,void 0,function(){var t,n,r,o,i,a,u,s=this;return yo(this,function(e){switch(e.label){case 0:if(this._closed)throw(0,vo.newError)("Pool is closed, it is no more able to serve requests.");if(t=l.asKey(),n=this._getOrInitializePoolFor(t),f)return[3,10];e.label=1;case 1:if(!(0<n.length))return[3,10];if(null==(r=n.pop()))return[3,1];Oo(t,this._activeResourceCounts),null!=this._removeIdleObserver&&this._removeIdleObserver(r),o=!1,e.label=2;case 2:return e.trys.push([2,4,,6]),[4,this._validateOnAcquire(c,r)];case 3:return o=e.sent(),[3,6];case 4:return i=e.sent(),wo(t,this._activeResourceCounts),n.removeInUse(r),[4,this._destroy(r)];case 5:throw e.sent(),i;case 6:return o?(this._log.isDebugEnabled()&&this._log.debug("".concat(r," acquired from the pool ").concat(t)),[2,{resource:r,pool:n}]):[3,7];case 7:return wo(t,this._activeResourceCounts),n.removeInUse(r),[4,this._destroy(r)];case 8:e.sent(),e.label=9;case 9:return[3,1];case 10:if(0<this._maxSize&&this.activeResourceCount(l)+this._pendingCreates[t]>=this._maxSize)return[2,{resource:null,pool:n}];this._pendingCreates[t]=this._pendingCreates[t]+1,e.label=11;case 11:return(e.trys.push([11,,15,16]),this.activeResourceCount(l)+n.length>=this._maxSize&&f)?null==(u=n.pop())?[3,13]:(null!=this._removeIdleObserver&&this._removeIdleObserver(u),n.removeInUse(u),[4,this._destroy(u)]):[3,13];case 12:e.sent(),e.label=13;case 13:return[4,this._create(c,l,function(t,r){return ho(s,void 0,void 0,function(){return yo(this,function(e){switch(e.label){case 0:return[4,this._release(t,r,n)];case 1:return[2,e.sent()]}})})})];case 14:return a=e.sent(),n.pushInUse(a),Oo(t,this._activeResourceCounts),this._log.isDebugEnabled()&&this._log.debug("".concat(a," created for the pool ").concat(t)),[3,16];case 15:return this._pendingCreates[t]=this._pendingCreates[t]-1,[7];case 16:return[2,{resource:a,pool:n}]}})})},go.prototype._release=function(n,o,i){return ho(this,void 0,void 0,function(){var t,r=this;return yo(this,function(e){switch(e.label){case 0:t=n.asKey(),e.label=1;case 1:return(e.trys.push([1,,9,10]),i.isActive())?[4,this._validateOnRelease(o)]:[3,6];case 2:return e.sent()?[3,4]:(this._log.isDebugEnabled()&&this._log.debug("".concat(o," destroyed and can't be released to the pool ").concat(t," because it is not functional")),i.removeInUse(o),[4,this._destroy(o)]);case 3:return e.sent(),[3,5];case 4:null!=this._installIdleObserver&&this._installIdleObserver(o,{onError:function(e){r._log.debug("Idle connection ".concat(o," destroyed because of error: ").concat(e));e=r._pools[t];null!=e&&(r._pools[t]=e.filter(function(e){return e!==o}),e.removeInUse(o)),r._destroy(o).catch(function(){})}}),i.push(o),this._log.isDebugEnabled()&&this._log.debug("".concat(o," released to the pool ").concat(t)),e.label=5;case 5:return[3,8];case 6:return this._log.isDebugEnabled()&&this._log.debug("".concat(o," destroyed and can't be released to the pool ").concat(t," because pool has been purged")),i.removeInUse(o),[4,this._destroy(o)];case 7:e.sent(),e.label=8;case 8:return[3,10];case 9:return wo(t,this._activeResourceCounts),this._processPendingAcquireRequests(n),[7];case 10:return[2]}})})},go.prototype._purgeKey=function(o){return ho(this,void 0,void 0,function(){var t,r,n;return yo(this,function(e){switch(e.label){case 0:if(t=this._pools[o],r=[],null==t)return[3,2];for(;0<t.length;)null!=(n=t.pop())&&(null!=this._removeIdleObserver&&this._removeIdleObserver(n),r.push(this._destroy(n)));return t.close(),delete this._pools[o],[4,Promise.all(r)];case 1:e.sent(),e.label=2;case 2:return[2]}})})},go.prototype._processPendingAcquireRequests=function(r){var n,o=this,i=r.asKey(),e=this._acquireRequests[i];null!=e&&(null!=(n=e.shift())?this._acquire(n.context,r,n.requireNew).catch(function(e){return n.reject(e),{resource:null,pool:null}}).then(function(e){var t=e.resource,e=e.pool;null!=t&&null!=e?n.isCompleted()?o._release(r,t,e).catch(function(e){o._log.isDebugEnabled()&&o._log.debug("".concat(t," could not be release back to the pool. Cause: ").concat(e))}):n.resolve(t):n.isCompleted()||(null==o._acquireRequests[i]&&(o._acquireRequests[i]=[]),o._acquireRequests[i].unshift(n))}).catch(function(e){return n.reject(e)}):delete this._acquireRequests[i])},go);function go(e){var t=e.create,t=void 0===t?function(e,t,r){return ho(s,void 0,void 0,function(){return yo(this,function(e){switch(e.label){case 0:return[4,Promise.reject(new Error("Not implemented"))];case 1:return[2,e.sent()]}})})}:t,r=e.destroy,r=void 0===r?function(e){return ho(s,void 0,void 0,function(){return yo(this,function(e){switch(e.label){case 0:return[4,Promise.resolve()];case 1:return[2,e.sent()]}})})}:r,n=e.validateOnAcquire,n=void 0===n?function(e,t){return!0}:n,o=e.validateOnRelease,o=void 0===o?function(e){return!0}:o,i=e.installIdleObserver,i=void 0===i?function(e,t){}:i,a=e.removeIdleObserver,a=void 0===a?function(e){}:a,u=e.config,u=void 0===u?_o.default.defaultConfig():u,e=e.log,e=void 0===e?mo.Logger.noOp():e,s=this;this._create=t,this._destroy=r,this._validateOnAcquire=n,this._validateOnRelease=o,this._installIdleObserver=i,this._removeIdleObserver=a,this._maxSize=u.maxSize,this._acquisitionTimeout=u.acquisitionTimeout,this._pools={},this._pendingCreates={},this._acquireRequests={},this._activeResourceCounts={},this._release=this._release.bind(this),this._log=e,this._closed=!1}function Oo(e,t){var r=null!=(r=t[e])?r:0;t[e]=r+1}function wo(e,t){var r=(null!=(r=t[e])?r:0)-1;0<r?t[e]=r:delete t[e]}Object.defineProperty(Po.prototype,"context",{get:function(){return this._context},enumerable:!1,configurable:!0}),Object.defineProperty(Po.prototype,"requireNew",{get:function(){var e;return null!=(e=this._config.requireNew)&&e},enumerable:!1,configurable:!0}),Po.prototype.isCompleted=function(){return this._completed},Po.prototype.resolve=function(e){this._completed||(this._completed=!0,clearTimeout(this._timeoutId),this._log.isDebugEnabled()&&this._log.debug("".concat(e," acquired from the pool ").concat(this._key)),this._resolve(e))},Po.prototype.reject=function(e){this._completed||(this._completed=!0,clearTimeout(this._timeoutId),this._reject(e))};var Eo=Po;function Po(e,t,r,n,o,i,a){this._key=e,this._context=t,this._resolve=n,this._reject=o,this._timeoutId=i,this._log=a,this._completed=!1,this._config=null!=r?r:{}}Ro.prototype.isActive=function(){return this._active},Ro.prototype.close=function(){this._active=!1,this._elements=[],this._elementsInUse=new Set},Ro.prototype.filter=function(e){return this._elements=this._elements.filter(e),this},Ro.prototype.apply=function(e){this._elements.forEach(e),this._elementsInUse.forEach(e)},Object.defineProperty(Ro.prototype,"length",{get:function(){return this._elements.length},enumerable:!1,configurable:!0}),Ro.prototype.pop=function(){var e=this._elements.pop();return null!=e&&this._elementsInUse.add(e),e},Ro.prototype.push=function(e){return this._elementsInUse.delete(e),this._elements.push(e)},Ro.prototype.pushInUse=function(e){this._elementsInUse.add(e)},Ro.prototype.removeInUse=function(e){this._elementsInUse.delete(e)};var So,To,jo,Co,Io=Ro;function Ro(){this._active=!0,this._elements=[],this._elementsInUse=new Set}co.default=bo,bo=so,To=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),jo=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),C=r&&r.__importStar||(So=function(e){return(So=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=So(e),n=0;n<r.length;n++)"default"!==r[n]&&To(t,e,r[n]);return jo(t,e),t}),j=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(bo,"__esModule",{value:!0}),bo.DEFAULT_MAX_SIZE=bo.DEFAULT_ACQUISITION_TIMEOUT=bo.PoolConfig=bo.Pool=void 0,Co=C(T),bo.PoolConfig=Co.default,Object.defineProperty(bo,"DEFAULT_ACQUISITION_TIMEOUT",{enumerable:!0,get:function(){return Co.DEFAULT_ACQUISITION_TIMEOUT}}),Object.defineProperty(bo,"DEFAULT_MAX_SIZE",{enumerable:!0,get:function(){return Co.DEFAULT_MAX_SIZE}}),C=j(co),bo.Pool=C.default,bo.default=C.default;function Ao(e){console.log("Uncaught error when processing result: "+e)}function Mo(e){}function ko(e){}var No,xo,Do=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),Uo=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),T=r&&r.__importStar||(No=function(e){return(No=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=No(e),n=0;n<r.length;n++)"default"!==r[n]&&Do(t,e,r[n]);return Uo(t,e),t}),j=(Object.defineProperty(v,"__esModule",{value:!0}),v.pool=v.boltAgent=v.objectUtil=v.resolver=v.serverAddress=v.urlUtil=v.logger=v.transactionExecutor=v.txConfig=v.connectionHolder=v.constants=v.bookmarks=v.observer=v.temporalUtil=v.util=void 0,T(a)),co=(v.util=j,T(o)),bo=(v.temporalUtil=co,T(m)),C=(v.observer=bo,T(Ar)),j=(v.bookmarks=C,T(g)),o=(v.constants=j,T(O)),co=(v.connectionHolder=o,T(Kr)),bo=(v.txConfig=co,T(E)),C=(v.transactionExecutor=bo,T(w)),j=(v.logger=C,T(P)),o=(v.urlUtil=j,T(S)),co=(v.serverAddress=o,T(Xn)),bo=(v.resolver=co,T(B)),C=(v.objectUtil=bo,T(uo)),P=(v.boltAgent=C,T(so)),j=(v.pool=P,r&&r.__extends||(xo=function(e,t){return(xo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}xo(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),Lo=r&&r.__awaiter||function(e,a,u,s){return new(u=u||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof u?t:new u(function(e){e(t)})).then(n,o)}i((s=s.apply(e,a||[])).next())})},Fo=r&&r.__generator||function(n,o){var i,a,u,s={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,a&&(u=2&t[0]?a.return:t[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,t[1])).done)return u;switch(a=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(u=0<(u=s.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3]))s.label=t[1];else if(6===t[0]&&s.label<u[1])s.label=u[1],u=t;else{if(!(u&&s.label<u[2])){u[2]&&s.ops.pop(),s.trys.pop();continue}s.label=u[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],a=0}finally{i=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},S=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Bo=(Object.defineProperty(n,"__esModule",{value:!0}),S(y)),Vo=v,qo=t,Wo=Vo.connectionHolder.EMPTY_CONNECTION_HOLDER;zo.prototype.as=function(t,r){if(null!=this._p)throw(0,qo.newError)("Cannot call .as() on a Result that is being consumed");return this._mapper=function(e){return e.as(t,r)},this},zo.prototype.keys=function(){var o=this;return null!==this._keys?Promise.resolve(this._keys):null!==this._error?Promise.reject(this._error):new Promise(function(r,n){o._streamObserverPromise.then(function(e){var t=o._decorateObserver({onKeys:function(e){return r(e)},onError:function(e){return n(e)}},!0);o._ownedObservers.push(t),e.subscribe(t)}).catch(n)})},zo.prototype.summary=function(){var o=this;return null!==this._summary?Promise.resolve(this._summary):null!==this._error?Promise.reject(this._error):new Promise(function(r,n){o._streamObserverPromise.then(function(e){var t=o._decorateObserver({onCompleted:function(e){return r(e)},onError:function(e){return n(e)}});e.cancel(),o._ownedObservers.push(t),e.subscribe(t)}).catch(n)})},zo.prototype._getOrCreatePromise=function(){var o=this;return null==this._p&&(this._p=new Promise(function(t,r){var n=[];o._subscribe({onNext:function(e){null!=o._mapper?n.push(o._mapper(e)):n.push(e)},onCompleted:function(e){t({records:n,summary:e})},onError:function(e){r(e)}}).catch(function(){})})),this._p},zo.prototype[Symbol.asyncIterator]=function(){var e,n,r,o,i,a=this;return this.isOpen()?(n={paused:!0,firstRun:!0,finished:!1},r=function(){var e,t;null!=n.streaming&&(e=(t=null!=(t=null==(t=n.queuedObserver)?void 0:t.size)?t:0)>=a._watermarks.high,t=t<=a._watermarks.low,e&&!n.paused?(n.paused=!0,n.streaming.pause()):(t&&n.paused||n.firstRun&&!e)&&(n.firstRun=!1,n.paused=!1,n.streaming.resume()))},o=function(){return Lo(a,void 0,void 0,function(){var t;return Fo(this,function(e){switch(e.label){case 0:return void 0!==n.queuedObserver?[3,2]:(n.queuedObserver=this._createQueuedResultObserver(r),t=n,[4,this._subscribe(n.queuedObserver,!0).catch(function(){})]);case 1:t.streaming=e.sent(),r(),e.label=2;case 2:return[2,n.queuedObserver]}})})},i=function(e){if(void 0===e)throw(0,qo.newError)("InvalidState: Result stream finished without Summary",qo.PROTOCOL_ERROR);return!0},{next:function(){return Lo(a,void 0,void 0,function(){var t;return Fo(this,function(e){switch(e.label){case 0:return n.finished&&i(n.summary)?[2,{done:!0,value:n.summary}]:[4,o()];case 1:return[4,e.sent().dequeue()];case 2:return!0===(t=e.sent()).done&&(n.finished=t.done,n.summary=t.value),[2,t]}})})},return:function(r){return Lo(a,void 0,void 0,function(){var t;return Fo(this,function(e){switch(e.label){case 0:return n.finished&&i(n.summary)?[2,{done:!0,value:null!=r?r:n.summary}]:(null!=(t=n.streaming)&&t.cancel(),[4,o()]);case 1:return[4,e.sent().dequeueUntilDone()];case 2:return t=e.sent(),n.finished=!0,t.value=null!=r?r:t.value,n.summary=t.value,[2,t]}})})},peek:function(){return Lo(a,void 0,void 0,function(){return Fo(this,function(e){switch(e.label){case 0:return n.finished&&i(n.summary)?[2,{done:!0,value:n.summary}]:[4,o()];case 1:return[4,e.sent().head()];case 2:return[2,e.sent()]}})})}}):(e=(0,qo.newError)("Result is already consumed"),{next:function(){return Promise.reject(e)},peek:function(){return Promise.reject(e)}})},zo.prototype.then=function(e,t){return this._getOrCreatePromise().then(e,t)},zo.prototype.catch=function(e){return this._getOrCreatePromise().catch(e)},zo.prototype.finally=function(e){return this._getOrCreatePromise().finally(e)},zo.prototype.subscribe=function(e){this._subscribe(e).catch(function(){})},zo.prototype.isOpen=function(){return null===this._summary&&null===this._error},zo.prototype._subscribe=function(e,t,r){void 0===t&&(t=!1);var n=this._decorateObserver(e,r=void 0===r?!1:r);return this._ownedObservers.push(n),this._streamObserverPromise.then(function(e){return t&&e.pause(),e.subscribe(n),e}).catch(function(e){return null!=n.onError&&n.onError(e),Promise.reject(e)})},zo.prototype._decorateObserver=function(n,e){var t,o=this,r=null!=(t=n.onCompleted)?t:Mo,i=null!=(t=n.onError)?t:Ao,a=null!=(t=n.onKeys)?t:ko;return{onNext:null!=n.onNext?n.onNext.bind(n):void 0,onKeys:function(e){return o._keys=e,a.call(n,e)},onCompleted:!0===e?void 0:function(e){o._releaseConnectionAndGetSummary(e).then(function(e){return null!==o._summary?r.call(n,o._summary):(o._summary=e,r.call(n,e))}).catch(i)},onError:function(r,e){!0===e&&void 0===o._retriedError&&r instanceof qo.Neo4jError&&!0===(null==(e=r.diagnosticRecord)?void 0:e._idempotent)&&void 0!==o._retry?(o._retriedError=r,o._streamObserverPromise.then(function(e){void 0!==e.unsubscribeAll&&e.unsubscribeAll()},function(){}),o._streamObserverPromise=o._retry(),o._streamObserverPromise.then(function(t){o._ownedObservers.forEach(function(e){t.subscribe(e)})},function(){})):o._retriedError!==r&&o._connectionHolder.releaseConnection().then(function(){var e,t;e=r,null!=(t=o._stack)&&(e.stack=e.toString()+"\n"+t),o._error=r,i.call(n,r)}).catch(i)}}},zo.prototype._cancel=function(){null===this._summary&&null===this._error&&this._streamObserverPromise.then(function(e){return e.cancel()}).catch(function(){})},zo.prototype._releaseConnectionAndGetSummary=function(t){var e=Vo.util.validateQueryAndParameters(this._query,this._parameters,{skipAsserts:!0}),r=e.validatedQuery,n=e.params,o=this._connectionHolder;return o.getConnection().then(function(e){return o.releaseConnection().then(function(){return null==e?void 0:e.getProtocolVersion()})},function(e){}).then(function(e){return new Bo.default(r,n,t,e)})},zo.prototype._createQueuedResultObserver=function(n){var t=this;function o(){var r={};return r.promise=new Promise(function(e,t){r.resolve=e,r.reject=t}),r}function i(e){return e instanceof Error}function r(){return Lo(this,void 0,void 0,function(){var t;return Fo(this,function(e){switch(e.label){case 0:if(0<a.length){if(t=null!=(t=a.shift())?t:(0,qo.newError)("Unexpected empty buffer",qo.PROTOCOL_ERROR),n(),i(t))throw t;return[2,t]}return u.resolvable=o(),[4,u.resolvable.promise];case 1:return[2,e.sent()]}})})}var a=[],u={resolvable:null},s={onNext:function(e){null!=t._mapper?s._push({done:!1,value:t._mapper(e)}):s._push({done:!1,value:e})},onCompleted:function(e){s._push({done:!0,value:e})},onError:function(e){s._push(e)},_push:function(e){var t;null!==u.resolvable?(t=u.resolvable,u.resolvable=null,i(e)?t.reject(e):t.resolve(e)):(a.push(e),n())},dequeue:r,dequeueUntilDone:function(){return Lo(t,void 0,void 0,function(){var t;return Fo(this,function(e){switch(e.label){case 0:return[4,r()];case 1:return!0===(t=e.sent()).done?[2,t]:[3,0];case 2:return[2]}})})},head:function(){return Lo(t,void 0,void 0,function(){var t,r;return Fo(this,function(e){switch(e.label){case 0:if(0<a.length){if(i(t=a[0]))throw t;return[2,t]}u.resolvable=o(),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,u.resolvable.promise];case 2:return t=e.sent(),a.unshift(t),[2,t];case 3:throw r=e.sent(),a.unshift(r),r;case 4:return n(),[7];case 5:return[2]}})})},get size(){return a.length}};return s};o=zo;function zo(e,t,r,n,o,i){var a;void 0===o&&(o={high:Number.MAX_VALUE,low:Number.MAX_VALUE}),this[Ko]="Result",this._stack=null!=(a=new Error("")).stack?a.stack.replace(/^Error(\n\r)*/,""):null,this._streamObserverPromise=e,this._p=null,this._query=t,this._parameters=null!=r?r:{},this._connectionHolder=null!=n?n:Wo,this._keys=null,this._summary=null,this._error=null,this._mapper=null,this._watermarks=o,this._retry=i,this._ownedObservers=[],this._retriedError=void 0}var Ho,Go,Ko=Symbol.toStringTag,Xn=(j(Yo,Ho=o),Yo);function Yo(){return null!==Ho&&Ho.apply(this,arguments)||this}function Zo(){return null!==Go&&Go.apply(this,arguments)||this}j(Zo,Go=o),n.default=Xn;co={};Object.defineProperty(co,"__esModule",{value:!0});co.default=function(e,t,r){this.keys=e,this.records=t,this.summary=r};B={},Object.defineProperty(B,"__esModule",{value:!0}),B.Releasable=void 0,Qo.prototype.release=function(){throw new Error("Not implemented")},bo=Qo;function Qo(){}function Xo(){}B.Releasable=bo,Xo.prototype.acquireConnection=function(e){throw Error("Not implemented")},Xo.prototype.supportsMultiDb=function(){throw Error("Not implemented")},Xo.prototype.supportsTransactionConfig=function(){throw Error("Not implemented")},Xo.prototype.supportsUserImpersonation=function(){throw Error("Not implemented")},Xo.prototype.supportsSessionAuth=function(){throw Error("Not implemented")},Xo.prototype.SSREnabled=function(){return!1},Xo.prototype.verifyConnectivityAndGetServerInfo=function(e){throw Error("Not implemented")},Xo.prototype.verifyAuthentication=function(e){throw Error("Not implemented")},Xo.prototype.getNegotiatedProtocolVersion=function(){throw Error("Not Implemented")},Xo.prototype.close=function(){throw Error("Not implemented")},B.default=Xo;uo={};function Jo(){}Object.defineProperty(uo,"__esModule",{value:!0}),Jo.prototype.beginTransaction=function(e){throw new Error("Not implemented")},Jo.prototype.run=function(e,t,r){throw new Error("Not implemented")},Jo.prototype.commitTransaction=function(e){throw new Error("Not implemented")},Jo.prototype.rollbackTransaction=function(e){throw new Error("Not implemented")},Jo.prototype.resetAndFlush=function(){throw new Error("Not implemented")},Jo.prototype.isOpen=function(){throw new Error("Not implemented")},Jo.prototype.getProtocolVersion=function(){throw new Error("Not implemented")},Jo.prototype.hasOngoingObservableRequests=function(){throw new Error("Not implemented")},uo.default=Jo;var C={},$o=r&&r.__awaiter||function(e,a,u,s){return new(u=u||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof u?t:new u(function(e){e(t)})).then(n,o)}i((s=s.apply(e,a||[])).next())})},ei=r&&r.__generator||function(n,o){var i,a,u,s={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,a&&(u=2&t[0]?a.return:t[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,t[1])).done)return u;switch(a=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(u=0<(u=s.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3]))s.label=t[1];else if(6===t[0]&&s.label<u[1])s.label=u[1],u=t;else{if(!(u&&s.label<u[2])){u[2]&&s.ops.pop(),s.trys.pop();continue}s.label=u[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],a=0}finally{i=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},T=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ti=(Object.defineProperty(C,"__esModule",{value:!0}),a),ri=O,ni=Ar,oi=Kr,ii=m,ai=t,ui=T(n);function si(e){var t=e.connectionHolder,r=e.onClose,n=e.onBookmarks,o=e.onConnection,i=e.reactive,a=e.fetchSize,u=e.impersonatedUser,s=e.highRecordWatermark,c=e.lowRecordWatermark,l=e.notificationFilter,e=e.apiTelemetryConfig,f=this;this._connectionHolder=t,this._reactive=i,this._state=ci.ACTIVE,this._onClose=r,this._onBookmarks=n,this._onConnection=o,this._onError=this._onErrorCallback.bind(this),this._fetchSize=a,this._onComplete=this._onCompleteCallback.bind(this),this._results=[],this._impersonatedUser=u,this._lowRecordWatermark=c,this._highRecordWatermark=s,this._bookmarks=ni.Bookmarks.empty(),this._notificationFilter=l,this._apiTelemetryConfig=e,this._acceptActive=function(){},this._activePromise=new Promise(function(e,t){f._acceptActive=e})}si.prototype._begin=function(o,i,a){var t=this;this._connectionHolder.getConnection().then(function(n){return $o(t,void 0,void 0,function(){var t,r=this;return ei(this,function(e){switch(e.label){case 0:return(this._onConnection(),null==n)?[3,2]:(t=this,[4,o()]);case 1:return t._bookmarks=e.sent(),[2,n.beginTransaction({bookmarks:this._bookmarks,txConfig:i,mode:this._connectionHolder.mode(),database:this._connectionHolder.database(),impersonatedUser:this._impersonatedUser,notificationFilter:this._notificationFilter,apiTelemetryConfig:this._apiTelemetryConfig,beforeError:function(e){null!=a&&a.onError(e),r._onError(e).catch(function(){})},afterComplete:function(e){null!=a&&a.onComplete(e),void 0!==e.db&&null!=(null==a?void 0:a.onDB)&&a.onDB(e.db),r._onComplete(e)}})];case 2:throw(0,ai.newError)("No connection available")}})})}).catch(function(e){null!=a&&a.onError(e),t._onError(e).catch(function(){})}).finally(function(){return t._acceptActive()})},si.prototype.run=function(e,t,r){e=(0,ti.validateQueryAndParameters)(e,t,{parameterRules:r}),t=e.validatedQuery,r=this._state.run(t,e.params,{connectionHolder:this._connectionHolder,onError:this._onError,onComplete:this._onComplete,onConnection:this._onConnection,reactive:this._reactive,fetchSize:this._fetchSize,highRecordWatermark:this._highRecordWatermark,lowRecordWatermark:this._lowRecordWatermark,preparationJob:this._activePromise});return this._results.push(r),r},si.prototype.commit=function(){var t=this,r=this._state.commit({connectionHolder:this._connectionHolder,onError:this._onError,onComplete:function(e){return t._onCompleteCallback(e,t._bookmarks)},onConnection:this._onConnection,pendingResults:this._results,preparationJob:this._activePromise});return this._state=r.state,this._onClose(),new Promise(function(e,t){r.result.subscribe({onCompleted:function(){return e()},onError:function(e){return t(e)}})})},si.prototype.rollback=function(){var r=this._state.rollback({connectionHolder:this._connectionHolder,onError:this._onError,onComplete:this._onComplete,onConnection:this._onConnection,pendingResults:this._results,preparationJob:this._activePromise});return this._state=r.state,this._onClose(),new Promise(function(e,t){r.result.subscribe({onCompleted:function(){return e()},onError:function(e){return t(e)}})})},si.prototype.isOpen=function(){return this._state===ci.ACTIVE},si.prototype.close=function(){return $o(this,void 0,void 0,function(){return ei(this,function(e){switch(e.label){case 0:return this.isOpen()?[4,this.rollback()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},si.prototype[Symbol.asyncDispose]=function(){return this.close()},si.prototype._onErrorCallback=function(t){return this._state===ci.FAILED?Promise.resolve(null):(this._state=ci.FAILED,this._onClose(),this._results.forEach(function(e){e.isOpen()&&e._streamObserverPromise.then(function(e){return e.onError(t)}).catch(function(e){})}),this._connectionHolder.releaseConnection())},si.prototype._onCompleteCallback=function(e,t){this._onBookmarks(new ni.Bookmarks(null==e?void 0:e.bookmark),null!=t?t:ni.Bookmarks.empty(),null==e?void 0:e.db)};var ci={ACTIVE:{commit:function(e){return{result:li(!0,e.connectionHolder,e.onError,e.onComplete,e.onConnection,e.pendingResults,e.preparationJob),state:ci.SUCCEEDED}},rollback:function(e){return{result:li(!1,e.connectionHolder,e.onError,e.onComplete,e.onConnection,e.pendingResults,e.preparationJob),state:ci.ROLLED_BACK}},run:function(t,r,e){var n=e.connectionHolder,o=e.onError,i=e.onComplete,a=e.onConnection,u=e.reactive,s=e.fetchSize,c=e.highRecordWatermark,l=e.lowRecordWatermark,e=e.preparationJob,f=null!=e?e:Promise.resolve();return fi(n.getConnection().then(function(e){return f.then(function(){return e})}).then(function(e){if(a(),null!=e)return e.run(t,r,{bookmarks:ni.Bookmarks.empty(),txConfig:oi.TxConfig.empty(),beforeError:o,afterComplete:i,reactive:u,fetchSize:s,highRecordWatermark:c,lowRecordWatermark:l});throw(0,ai.newError)("No connection available")}).catch(function(e){return new ii.FailedObserver({error:e,onError:o})}),t,r,n,c,l)}},FAILED:{commit:function(e){var t=e.connectionHolder,e=e.onError;return{result:fi(new ii.FailedObserver({error:(0,ai.newError)("Cannot commit this transaction, because it has been rolled back either because of an error or explicit termination."),onError:e}),"COMMIT",{},t,0,0),state:ci.FAILED}},rollback:function(e){e=e.connectionHolder;return{result:fi(new ii.CompletedObserver,"ROLLBACK",{},e,0,0),state:ci.FAILED}},run:function(e,t,r){var n=r.connectionHolder,r=r.onError;return fi(new ii.FailedObserver({error:(0,ai.newError)("Cannot run query in this transaction, because it has been rolled back either because of an error or explicit termination."),onError:r}),e,t,n,0,0)}},SUCCEEDED:{commit:function(e){var t=e.connectionHolder,e=e.onError;return{result:fi(new ii.FailedObserver({error:(0,ai.newError)("Cannot commit this transaction, because it has already been committed."),onError:e}),"COMMIT",{},ri.EMPTY_CONNECTION_HOLDER,0,0),state:ci.SUCCEEDED,connectionHolder:t}},rollback:function(e){var t=e.connectionHolder,e=e.onError;return{result:fi(new ii.FailedObserver({error:(0,ai.newError)("Cannot rollback this transaction, because it has already been committed."),onError:e}),"ROLLBACK",{},ri.EMPTY_CONNECTION_HOLDER,0,0),state:ci.SUCCEEDED,connectionHolder:t}},run:function(e,t,r){var n=r.connectionHolder,r=r.onError;return fi(new ii.FailedObserver({error:(0,ai.newError)("Cannot run query in this transaction, because it has already been committed."),onError:r}),e,t,n,0,0)}},ROLLED_BACK:{commit:function(e){var t=e.connectionHolder,e=e.onError;return{result:fi(new ii.FailedObserver({error:(0,ai.newError)("Cannot commit this transaction, because it has already been rolled back."),onError:e}),"COMMIT",{},t,0,0),state:ci.ROLLED_BACK}},rollback:function(e){e=e.connectionHolder;return{result:fi(new ii.FailedObserver({error:(0,ai.newError)("Cannot rollback this transaction, because it has already been rolled back.")}),"ROLLBACK",{},e,0,0),state:ci.ROLLED_BACK}},run:function(e,t,r){var n=r.connectionHolder,r=r.onError;return fi(new ii.FailedObserver({error:(0,ai.newError)("Cannot run query in this transaction, because it has already been rolled back."),onError:r}),e,t,n,0,0)}}};function li(r,e,n,o,i,a,t){var u=null!=t?t:Promise.resolve(),t=e.getConnection().then(function(e){return u.then(function(){return e})}).then(function(t){return i(),a.forEach(function(e){return e._cancel()}),Promise.all(a.map(function(e){return e.summary()})).then(function(e){if(null!=t)return r?t.commitTransaction({beforeError:n,afterComplete:o}):t.rollbackTransaction({beforeError:n,afterComplete:o});throw(0,ai.newError)("No connection available")})}).catch(function(e){return new ii.FailedObserver({error:e,onError:n})});return new ui.default(t,r?"COMMIT":"ROLLBACK",{},e,{high:Number.MAX_VALUE,low:Number.MAX_VALUE})}function fi(e,t,r,n,o,i){return void 0===n&&(n=ri.EMPTY_CONNECTION_HOLDER),new ui.default(Promise.resolve(e),t,r,new ri.ReadOnlyConnectionHolder(null!=n?n:ri.EMPTY_CONNECTION_HOLDER),{low:i,high:o})}C.default=si;so={};function pi(e){e=e.run;this._run=e}Object.defineProperty(so,"__esModule",{value:!0}),pi.fromTransaction=function(e){return new pi({run:e.run.bind(e)})},pi.prototype.run=function(e,t,r){return this._run(e,t,r)},so.default=pi;var di,hi,yi,P={},S=r&&r.__extends||(di=function(e,t){return(di=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}di(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),bi=r&&r.__assign||function(){return(bi=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},j=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},o=(Object.defineProperty(P,"__esModule",{value:!0}),j(C)),Xn=(yi=o.default,S(_i,yi),_i.prototype.then=function(e,t){return this._getOrCreateBeginPromise().then(e,t)},_i.prototype.catch=function(e){return this._getOrCreateBeginPromise().catch(e)},_i.prototype.finally=function(e){return this._getOrCreateBeginPromise().finally(e)},_i.prototype._getOrCreateBeginPromise=function(){var r=this;return null==this._beginPromise&&(this._beginPromise=new Promise(function(e,t){r._resolve=e,r._reject=t,null!=r._beginError&&t(r._beginError),null!=r._beginMetadata&&e(r._toTransaction())})),this._beginPromise},_i.prototype._toTransaction=function(){return bi(bi({},this),{run:yi.prototype.run.bind(this),commit:yi.prototype.commit.bind(this),rollback:yi.prototype.rollback.bind(this),close:yi.prototype.close.bind(this),isOpen:yi.prototype.isOpen.bind(this),_begin:this._begin.bind(this)})},_i.prototype._begin=function(e,t){return yi.prototype._begin.call(this,e,t,{onError:this._onBeginError.bind(this),onComplete:this._onBeginMetadata.bind(this),onDB:this._onDbCallback})},_i.prototype._onBeginError=function(e){this._beginError=e,null!=this._reject&&this._reject(e)},_i.prototype._onBeginMetadata=function(e){this._beginMetadata=null!=e?e:{},null!=this._resolve&&this._resolve(this._toTransaction())},_i);function _i(e){var t=e.connectionHolder,r=e.onDbCallback,t=yi.call(this,{connectionHolder:t,onClose:e.onClose,onBookmarks:e.onBookmarks,onConnection:e.onConnection,reactive:e.reactive,fetchSize:e.fetchSize,impersonatedUser:e.impersonatedUser,highRecordWatermark:e.highRecordWatermark,lowRecordWatermark:e.lowRecordWatermark,notificationFilter:e.notificationFilter,apiTelemetryConfig:e.apiTelemetryConfig})||this;return t[hi]="TransactionPromise",t._onDbCallback=r,t}hi=Symbol.toStringTag,P.default=Xn;var bo={},T={},vi=(Object.defineProperty(T,"__esModule",{value:!0}),T.cacheKey=function(e,t){return null==t?void 0!==e?"basic"!==e.scheme?"kerberos"!==e.scheme?"bearer"!==e.scheme?"none"!==e.scheme?(0,vi.stringify)(e,{sortedElements:!0}):"none":"bearer:"+e.credentials:"kerberos:"+e.credentials:"basic:"+(null!=(e=e.principal)?e:""):"DEFAULT":"basic:"+t},F);var mi=r&&r.__awaiter||function(e,a,u,s){return new(u=u||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof u?t:new u(function(e){e(t)})).then(n,o)}i((s=s.apply(e,a||[])).next())})},gi=r&&r.__generator||function(n,o){var i,a,u,s={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,a&&(u=2&t[0]?a.return:t[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,t[1])).done)return u;switch(a=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(u=0<(u=s.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3]))s.label=t[1];else if(6===t[0]&&s.label<u[1])s.label=u[1],u=t;else{if(!(u&&s.label<u[2])){u[2]&&s.ops.pop(),s.trys.pop();continue}s.label=u[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],a=0}finally{i=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Oi=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},wi=r&&r.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||((n=n||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},j=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Ei=(Object.defineProperty(bo,"__esModule",{value:!0}),m),Pi=a,Si=g,Ti=t,ji=j(n),Ci=O,Ii=E,Ri=Ar,Ai=Kr,Mi=j(P),ki=j(so),Ni=T;function xi(e){var t=e.mode,r=e.connectionProvider,n=e.bookmarks,o=e.database,i=e.config,a=e.reactive,u=e.fetchSize,s=e.impersonatedUser,c=e.bookmarkManager,l=e.notificationFilter,f=e.auth,p=e.log,d=e.homeDatabaseCallback,e=e.disableAutoCommitRetries,t=(this._mode=t,this._database=o,this._reactive=a,this._fetchSize=u,this._homeDatabaseCallback=d,this._auth=f,this._getConnectionAcquistionBookmarks=this._getConnectionAcquistionBookmarks.bind(this),this._readConnectionHolder=new Ci.ConnectionHolder({mode:Si.ACCESS_MODE_READ,auth:f,database:o,bookmarks:n,connectionProvider:r,impersonatedUser:s,onDatabaseNameResolved:this._onDatabaseNameResolved.bind(this),getConnectionAcquistionBookmarks:this._getConnectionAcquistionBookmarks,log:p}),this._writeConnectionHolder=new Ci.ConnectionHolder({mode:Si.ACCESS_MODE_WRITE,auth:f,database:o,bookmarks:n,connectionProvider:r,impersonatedUser:s,onDatabaseNameResolved:this._onDatabaseNameResolved.bind(this),getConnectionAcquistionBookmarks:this._getConnectionAcquistionBookmarks,log:p}),this._open=!0,this._hasTx=!1,this._impersonatedUser=s,this._lastBookmarks=null!=n?n:Ri.Bookmarks.empty(),this._configuredBookmarks=this._lastBookmarks,this._transactionExecutor=(e=>(e=null!=(e=null==e?void 0:e.maxTransactionRetryTime)?e:null,new Ii.TransactionExecutor(e)))(i),this._databaseNameResolved=""!==this._database,this._calculateWatermaks());this._lowRecordWatermark=t.low,this._highRecordWatermark=t.high,this._results=[],this._bookmarkManager=c,this._notificationFilter=l,this._log=p,this._databaseGuess=null==i?void 0:i.cachedHomeDatabase,this._isRoutingSession=null!=(a=null==i?void 0:i.routingDriver)&&a,this._disableAutoCommitRetries=null!=(u=null!=e?e:null==i?void 0:i.disableAutoCommitRetries)&&u}xi.prototype.run=function(e,t,r,n){var i=this,e=(0,Pi.validateQueryAndParameters)(e,t,{parameterRules:n}),a=e.validatedQuery,u=e.params,s=null!=r?new Ai.TxConfig(r,this._log):Ai.TxConfig.empty(),t=this._run(a,u,function(n,o){return mi(i,void 0,void 0,function(){var t,r=this;return gi(this,function(e){switch(e.label){case 0:return[4,this._bookmarks()];case 1:return t=e.sent(),this._assertSessionIsOpen(),[2,n.run(a,u,{bookmarks:t,txConfig:s,mode:this._mode,database:this._database,apiTelemetryConfig:!0===o?void 0:{api:Si.TELEMETRY_APIS.AUTO_COMMIT_TRANSACTION},impersonatedUser:this._impersonatedUser,afterComplete:function(e){return r._onCompleteCallback(e,t)},reactive:this._reactive,fetchSize:this._fetchSize,lowRecordWatermark:this._lowRecordWatermark,highRecordWatermark:this._highRecordWatermark,notificationFilter:this._notificationFilter,onDb:this._onDatabaseNameResolved.bind(this)})]}})})});return this._results.push(t),t},xi.prototype._run=function(e,t,r){var n=this,o=this._acquireAndConsumeConnection(r),i=o.connectionHolder,o=o.resultPromise.catch(function(e){return Promise.resolve(new Ei.FailedObserver({error:e}))}),a={high:this._highRecordWatermark,low:this._lowRecordWatermark},u=this._disableAutoCommitRetries?void 0:function(){return n._acquireAndConsumeConnection(r,!0).resultPromise.catch(function(e){return Promise.resolve(new Ei.FailedObserver({error:e}))})};return new ji.default(o,e,t,i,a,u)},xi.prototype._acquireConnection=function(e){var r=this,e=this._acquireAndConsumeConnection(e),n=e.connectionHolder;return e.resultPromise.then(function(t){return mi(r,void 0,void 0,function(){return gi(this,function(e){switch(e.label){case 0:return[4,n.releaseConnection()];case 1:return e.sent(),[2,t]}})})})},xi.prototype._acquireAndConsumeConnection=function(t,r){var e=this._connectionHolderWithMode(this._mode),n=this._open?this._hasTx||!0!==r&&!e.initializeConnection(this._databaseGuess)?Promise.reject((0,Ti.newError)("Queries cannot be run directly on a session with ongoing work; either await the previous work, run in an existing transaction or use a different session.")):e.getConnection().then(function(e){return t(e,r)}):Promise.reject((0,Ti.newError)("Cannot run query in a closed session."));return{connectionHolder:e,resultPromise:n}},xi.prototype.beginTransaction=function(e){var t=Ai.TxConfig.empty();return null!=e&&(t=new Ai.TxConfig(e,this._log)),this._beginTransaction(this._mode,t,{api:Si.TELEMETRY_APIS.UNMANAGED_TRANSACTION})},xi.prototype._beginTransaction=function(e,t,r){var n=this;if(!this._open)throw(0,Ti.newError)("Cannot begin a transaction on a closed session.");if(this._hasTx)throw(0,Ti.newError)("You cannot begin a transaction on a session with ongoing work; either run from within an existing transaction or use a different session.");e=xi._validateSessionMode(e),e=this._connectionHolderWithMode(e),e.initializeConnection(this._databaseGuess),this._hasTx=!0,e=new Mi.default({connectionHolder:e,impersonatedUser:this._impersonatedUser,onClose:this._transactionClosed.bind(this),onBookmarks:function(e,t,r){return n._updateBookmarks(e,t,r)},onConnection:this._assertSessionIsOpen.bind(this),reactive:this._reactive,fetchSize:this._fetchSize,lowRecordWatermark:this._lowRecordWatermark,highRecordWatermark:this._highRecordWatermark,notificationFilter:this._notificationFilter,apiTelemetryConfig:r,onDbCallback:this._onDatabaseNameResolved.bind(this)});return e._begin(function(){return n._bookmarks()},t),e},xi.prototype._assertSessionIsOpen=function(){if(!this._open)throw(0,Ti.newError)("You cannot run more transactions on a closed session.")},xi.prototype._transactionClosed=function(){this._hasTx=!1},xi.prototype.lastBookmarks=function(){return this._lastBookmarks.values()},xi.prototype._bookmarks=function(){return mi(this,void 0,void 0,function(){var t;return gi(this,function(e){switch(e.label){case 0:return[4,null==(t=this._bookmarkManager)?void 0:t.getBookmarks()];case 1:return void 0===(t=e.sent())?[2,this._lastBookmarks]:[2,new Ri.Bookmarks(wi(wi([],Oi(t),!1),Oi(this._configuredBookmarks),!1))]}})})},xi.prototype.executeRead=function(e,t){t=new Ai.TxConfig(t,this._log);return this._executeInTransaction(Si.ACCESS_MODE_READ,t,e)},xi.prototype.executeWrite=function(e,t){t=new Ai.TxConfig(t,this._log);return this._executeInTransaction(Si.ACCESS_MODE_WRITE,t,e)},xi.prototype._executeInTransaction=function(t,r,e){var n=this;return this._transactionExecutor.execute(function(e){return n._beginTransaction(t,r,e)},e,ki.default.fromTransaction)},xi.prototype._onDatabaseNameResolved=function(e){var t;this._isRoutingSession&&(this._databaseGuess=e,this._databaseNameResolved||(this._database=t=null!=e?e:"",this._readConnectionHolder.setDatabase(t),this._writeConnectionHolder.setDatabase(t),this._databaseNameResolved=!0,null!=this._homeDatabaseCallback&&this._homeDatabaseCallback((0,Ni.cacheKey)(this._auth,this._impersonatedUser),e)))},xi.prototype._getConnectionAcquistionBookmarks=function(){return mi(this,void 0,void 0,function(){var t;return gi(this,function(e){switch(e.label){case 0:return[4,null==(t=this._bookmarkManager)?void 0:t.getBookmarks()];case 1:return void 0===(t=e.sent())?[2,this._lastBookmarks]:[2,new Ri.Bookmarks(wi(wi([],Oi(this._configuredBookmarks),!1),Oi(t),!1))]}})})},xi.prototype._updateBookmarks=function(e,t,r){var n;null==e||e.isEmpty()||(null!=(n=this._bookmarkManager)&&n.updateBookmarks(null!=(n=null==t?void 0:t.values())?n:[],null!=(t=null==e?void 0:e.values())?t:[]).catch(function(){}),this._lastBookmarks=e,this._configuredBookmarks=Ri.Bookmarks.empty())},xi.prototype.close=function(){return mi(this,void 0,void 0,function(){return gi(this,function(e){switch(e.label){case 0:return this._open?(this._open=!1,this._results.forEach(function(e){return e._cancel()}),this._transactionExecutor.close(),[4,this._readConnectionHolder.close(this._hasTx)]):[3,3];case 1:return e.sent(),[4,this._writeConnectionHolder.close(this._hasTx)];case 2:e.sent(),e.label=3;case 3:return[2]}})})},xi.prototype[Symbol.asyncDispose]=function(){return this.close()},xi.prototype._connectionHolderWithMode=function(e){if(e===Si.ACCESS_MODE_READ)return this._readConnectionHolder;if(e===Si.ACCESS_MODE_WRITE)return this._writeConnectionHolder;throw(0,Ti.newError)("Unknown access mode: "+e)},xi.prototype._onCompleteCallback=function(e,t){this._updateBookmarks(new Ri.Bookmarks(e.bookmark),t,e.db)},xi.prototype._calculateWatermaks=function(){return this._fetchSize===Si.FETCH_ALL?{low:Number.MAX_VALUE,high:Number.MAX_VALUE}:{low:.3*this._fetchSize,high:.7*this._fetchSize}},xi.prototype._configureTransactionExecutor=function(e,t){this._transactionExecutor.pipelineBegin=e,this._transactionExecutor.telemetryApi=t},xi._validateSessionMode=function(e){e=null!=e?e:Si.ACCESS_MODE_WRITE;if(e!==Si.ACCESS_MODE_READ&&e!==Si.ACCESS_MODE_WRITE)throw(0,Ti.newError)("Illegal session mode "+e);return e},bo.default=xi;var o={},S={},Di=r&&r.__awaiter||function(e,a,u,s){return new(u=u||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof u?t:new u(function(e){e(t)})).then(n,o)}i((s=s.apply(e,a||[])).next())})},Ui=r&&r.__generator||function(n,o){var i,a,u,s={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,a&&(u=2&t[0]?a.return:t[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,t[1])).done)return u;switch(a=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(u=0<(u=s.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3]))s.label=t[1];else if(6===t[0]&&s.label<u[1])s.label=u[1],u=t;else{if(!(u&&s.label<u[2])){u[2]&&s.ops.pop(),s.trys.pop();continue}s.label=u[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],a=0}finally{i=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Li=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Fi=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},Bi=r&&r.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||((n=n||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},Xn=(Object.defineProperty(S,"__esModule",{value:!0}),S.bookmarkManager=function(e){void 0===e&&(e={});var t=new Set(e.initialBookmarks);return new qi(t,e.bookmarksSupplier,e.bookmarksConsumer)},Vi.prototype.updateBookmarks=function(e,t){return Di(this,void 0,void 0,function(){return Ui(this,function(e){throw new Error("Not implemented")})})},Vi.prototype.getBookmarks=function(){return Di(this,void 0,void 0,function(){return Ui(this,function(e){throw new Error("Not implemented")})})},Vi);function Vi(){throw new Error("Not implemented")}S.default=Xn;Wi.prototype.updateBookmarks=function(f,p){return Di(this,void 0,void 0,function(){var t,r,n,o,i,a,u,s,c,l;return Ui(this,function(e){switch(e.label){case 0:t=this._bookmarks;try{for(r=Li(f),n=r.next();!n.done;n=r.next())a=n.value,t.delete(a)}catch(e){u={error:e}}finally{try{n&&!n.done&&(s=r.return)&&s.call(r)}finally{if(u)throw u.error}}try{for(o=Li(p),i=o.next();!i.done;i=o.next())a=i.value,t.add(a)}catch(e){c={error:e}}finally{try{i&&!i.done&&(l=o.return)&&l.call(o)}finally{if(c)throw c.error}}return"function"!=typeof this._bookmarksConsumer?[3,2]:[4,this._bookmarksConsumer(Bi([],Fi(t),!1))];case 1:e.sent(),e.label=2;case 2:return[2]}})})},Wi.prototype.getBookmarks=function(){return Di(this,void 0,void 0,function(){var t,r,n,o,i,a,u;return Ui(this,function(e){switch(e.label){case 0:return t=new Set(this._bookmarks),"function"!=typeof this._bookmarksSupplier?[3,2]:[4,this._bookmarksSupplier()];case 1:u=null!=(u=e.sent())?u:[];try{for(r=Li(u),n=r.next();!n.done;n=r.next())o=n.value,t.add(o)}catch(e){i={error:e}}finally{try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(i)throw i.error}}e.label=2;case 2:return[2,Bi([],Fi(t),!1)]}})})};var qi=Wi;function Wi(e,t,r){this._bookmarks=e,this._bookmarksSupplier=t,this._bookmarksConsumer=r}var m={},zi=r&&r.__awaiter||function(e,a,u,s){return new(u=u||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof u?t:new u(function(e){e(t)})).then(n,o)}i((s=s.apply(e,a||[])).next())})},Hi=r&&r.__generator||function(n,o){var i,a,u,s={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,a&&(u=2&t[0]?a.return:t[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,t[1])).done)return u;switch(a=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(u=0<(u=s.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3]))s.label=t[1];else if(6===t[0]&&s.label<u[1])s.label=u[1],u=t;else{if(!(u&&s.label<u[2])){u[2]&&s.ops.pop(),s.trys.pop();continue}s.label=u[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],a=0}finally{i=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},O=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Gi=(Object.defineProperty(m,"__esModule",{value:!0}),O(co)),Ki=t;function Yi(){}Yi.prototype.eagerResultTransformer=function(){return Zi},Yi.prototype.eager=function(){return Zi},Yi.prototype.mappedResultTransformer=function(e){return Qi(e)},Yi.prototype.mapped=function(e){return Qi(e)},Yi.prototype.first=function(){return Xi},Yi.prototype.summary=function(){return Ji},Yi.prototype.hydrated=function(r,n){var e=this;return function(t){return zi(e,void 0,void 0,function(){return Hi(this,function(e){switch(e.label){case 0:return[4,t.as(r,n).then()];case 1:return[2,e.sent()]}})})}};E=new Yi;function Zi(o){return zi(this,void 0,void 0,function(){var t,r,n;return Hi(this,function(e){switch(e.label){case 0:return[4,o];case 1:return r=e.sent(),t=r.summary,r=r.records,[4,o.keys()];case 2:return n=e.sent(),[2,new Gi.default(n,r,t)]}})})}function Qi(i){var e=this;if(null==i||null==i.collect&&null==i.map)throw(0,Ki.newError)("Requires a map or/and a collect functions.");return function(o){return zi(e,void 0,void 0,function(){return Hi(this,function(e){switch(e.label){case 0:return[4,new Promise(function(t,r){var n={records:[],keys:[]};o.subscribe({onKeys:function(e){n.keys=e},onNext:function(e){var t;null!=i.map?void 0!==(t=i.map(e))&&n.records.push(t):n.records.push(e)},onCompleted:function(e){null!=i.collect?t(i.collect(n.records,e,n.keys)):t({records:n.records,summary:e,keys:n.keys})},onError:function(e){r(e)}})})];case 1:return[2,e.sent()]}})})}}function Xi(o){return zi(this,void 0,void 0,function(){var t,r,n;return Hi(this,function(e){switch(e.label){case 0:return[4,(t=o[Symbol.asyncIterator]()).next()];case 1:n=e.sent(),r=n.value,n=n.done,e.label=2;case 2:return e.trys.push([2,,3,6]),!0===n?[2,void 0]:[2,r];case 3:return null==t.return?[3,5]:[4,t.return()];case 4:e.sent(),e.label=5;case 5:return[7];case 6:return[2]}})})}function Ji(t){return zi(this,void 0,void 0,function(){return Hi(this,function(e){switch(e.label){case 0:return[4,t.summary()];case 1:return[2,e.sent()]}})})}Object.freeze(E),m.default=E;var Kr={},$i=r&&r.__awaiter||function(e,a,u,s){return new(u=u||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof u?t:new u(function(e){e(t)})).then(n,o)}i((s=s.apply(e,a||[])).next())})},ea=r&&r.__generator||function(n,o){var i,a,u,s={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,a&&(u=2&t[0]?a.return:t[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,t[1])).done)return u;switch(a=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(u=0<(u=s.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3]))s.label=t[1];else if(6===t[0]&&s.label<u[1])s.label=u[1],u=t;else{if(!(u&&s.label<u[2])){u[2]&&s.ops.pop(),s.trys.pop();continue}s.label=u[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],a=0}finally{i=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},ta=(Object.defineProperty(Kr,"__esModule",{value:!0}),g);function ra(e){this._createSession=e}ra.prototype.execute=function(o,i,a,u){return $i(this,void 0,void 0,function(){var t,r,n=this;return ea(this,function(e){switch(e.label){case 0:t=this._createSession({database:o.database,bookmarkManager:o.bookmarkManager,impersonatedUser:o.impersonatedUser,auth:o.auth}),r=((e,t,r)=>("function"==typeof(null==e?void 0:e.addEventListener)&&e.addEventListener(t,r),{uninstall:function(){"function"==typeof(null==e?void 0:e.removeEventListener)&&e.removeEventListener(t,r)}}))(o.signal,"abort",function(){return $i(n,void 0,void 0,function(){return ea(this,function(e){switch(e.label){case 0:return[4,t.close()];case 1:return[2,e.sent()]}})})}),t._configureTransactionExecutor(!0,ta.TELEMETRY_APIS.EXECUTE_QUERY),e.label=1;case 1:return e.trys.push([1,,3,5]),[4,("READ"===o.routing?t.executeRead:t.executeWrite).bind(t)(function(r){return $i(n,void 0,void 0,function(){var t;return ea(this,function(e){switch(e.label){case 0:return t=r.run(i,a,u),[4,o.resultTransformer(t)];case 1:return[2,e.sent()]}})})},o.transactionConfig)];case 2:return[2,e.sent()];case 3:return r.uninstall(),[4,t.close()];case 4:return e.sent(),[7];case 5:return[2]}})})},Kr.default=ra;j={};function na(e){this.maxSize=e,this.pruneCount=Math.max(Math.round(.01*e*Math.log(e)),1),this.map=new Map}Object.defineProperty(j,"__esModule",{value:!0}),na.prototype.set=function(e,t){this.map.set(e,{database:t,lastUsed:Date.now()}),this._pruneCache()},na.prototype.get=function(e){e=this.map.get(e);if(void 0!==e)return e.lastUsed=Date.now(),e.database},na.prototype.delete=function(e){this.map.delete(e)},na.prototype._pruneCache=function(){if(this.map.size>this.maxSize)for(var e=Array.from(this.map.entries()).sort(function(e,t){return e[1].lastUsed-t[1].lastUsed}),t=0;t<this.pruneCount;t++)this.map.delete(e[t][0])},j.default=na;var oa,Xn={},O={},ia=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),aa=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),E=r&&r.__importStar||(oa=function(e){return(oa=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=oa(e),n=0;n<r.length;n++)"default"!==r[n]&&ia(t,e,r[n]);return aa(t,e),t}),ua=(Object.defineProperty(O,"__esModule",{value:!0}),O.isEnc=O.EncryptedValue=void 0,E(Z)),E=(sa.isEncryptedValue=function(e){return!0===(null==e?void 0:e.__isEncryptedValue__)},sa.__isEncryptedValue__=!0,sa);function sa(e,t,r,n,o,i,a,u){var s=this;this.cipherOutput=e,this.profileName=t,this.profileType=r,this.profileVersion=n instanceof BigInt?ua.default.fromString(n.toString()):(0,ua.int)(n),this.typeName=o,this.typeProtocolMajor=i instanceof BigInt?ua.default.fromString(i.toString()):(0,ua.int)(i),this.typeProtocolMinor=a instanceof BigInt?ua.default.fromString(a.toString()):(0,ua.int)(a),this.metadata={},Object.keys(u).sort().forEach(function(e){s.metadata[e]=u[e]})}O.EncryptedValue=E,Object.defineProperty(E.prototype,"__isEncryptedValue__",{value:!0,enumerable:!1,configurable:!1}),O.isEnc=E.isEncryptedValue;var E={},ca=r&&r.__awaiter||function(e,a,u,s){return new(u=u||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof u?t:new u(function(e){e(t)})).then(n,o)}i((s=s.apply(e,a||[])).next())})},la=r&&r.__generator||function(n,o){var i,a,u,s={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,a&&(u=2&t[0]?a.return:t[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,t[1])).done)return u;switch(a=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(u=0<(u=s.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3]))s.label=t[1];else if(6===t[0]&&s.label<u[1])s.label=u[1],u=t;else{if(!(u&&s.label<u[2])){u[2]&&s.ops.pop(),s.trys.pop();continue}s.label=u[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],a=0}finally{i=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},fa=(Object.defineProperty(E,"__esModule",{value:!0}),E.EncapsulatedKeyManager=void 0,t);function pa(e,t){this._profile=e,this._keyEncapsulationService=t}pa.prototype.create=function(r){return ca(this,void 0,void 0,function(){var t;return la(this,function(e){switch(e.label){case 0:return[4,this._keyEncapsulationService.encapsulate({})];case 1:return t=e.sent(),[4,this._profile.saveKey(r,t.encapsulation(),t.options())];case 2:return[2,e.sent()]}})})},pa.prototype.findById=function(r){return ca(this,void 0,void 0,function(){var t;return la(this,function(e){switch(e.label){case 0:return[4,this._profile.findKey({id:r})];case 1:return null!=(t=e.sent())?[2,{id:t.id,alias:t.alias}]:[2,void 0]}})})},pa.prototype.findByAlias=function(r){return ca(this,void 0,void 0,function(){var t;return la(this,function(e){switch(e.label){case 0:return[4,this._profile.findKey({alias:r})];case 1:return null!=(t=e.sent())?[2,{id:t.id,alias:t.alias}]:[2,void 0]}})})},pa.prototype.setAliasById=function(r,n){return ca(this,void 0,void 0,function(){var t;return la(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this._profile.keyRepository.setAliasById(r,n)];case 1:return[2,e.sent()];case 2:throw t=e.sent(),(0,fa.newError)("Call to EncapsulatedKeyRepository.setAliasById threw error, see cause","50N42",t);case 3:return[2]}})})},pa.prototype.deleteAliasById=function(t){return ca(this,void 0,void 0,function(){return la(this,function(e){switch(e.label){case 0:return[4,this.setAliasById(t,void 0)];case 1:return[2,e.sent()]}})})},pa.prototype.deleteById=function(r){return ca(this,void 0,void 0,function(){var t;return la(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this._profile.keyRepository.deleteById(r)];case 1:return[2,e.sent()];case 2:throw t=e.sent(),(0,fa.newError)("Call to EncapsulatedKeyRepository.deleteById threw error, see cause","50N42",t);case 3:return[2]}})})},E.EncapsulatedKeyManager=pa;var I={},da=r&&r.__awaiter||function(e,a,u,s){return new(u=u||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof u?t:new u(function(e){e(t)})).then(n,o)}i((s=s.apply(e,a||[])).next())})},ha=r&&r.__generator||function(n,o){var i,a,u,s={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,a&&(u=2&t[0]?a.return:t[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,t[1])).done)return u;switch(a=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(u=0<(u=s.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3]))s.label=t[1];else if(6===t[0]&&s.label<u[1])s.label=u[1],u=t;else{if(!(u&&s.label<u[2])){u[2]&&s.ops.pop(),s.trys.pop();continue}s.label=u[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],a=0}finally{i=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}};function ya(){}Object.defineProperty(I,"__esModule",{value:!0}),ya.prototype.encrypt=function(a,u,s){return da(this,void 0,void 0,function(){var t,r,n,o,i;return ha(this,function(e){switch(e.label){case 0:return t=this.getRandomValues(12),i={},n=(r=window.crypto.subtle).encrypt,o=[{name:"AES-GCM",iv:t,additionalData:s}],[4,window.crypto.subtle.importKey("raw",a,{name:"AES-GCM",length:256},!1,["encrypt"])];case 1:return[4,n.apply(r,o.concat([e.sent(),u]))];case 2:return[2,(i.cyphertext=e.sent(),i.iv=t,i)]}})})},ya.prototype.decrypt=function(o,i,a,u){return da(this,void 0,void 0,function(){var t,r,n;return ha(this,function(e){switch(e.label){case 0:return r=(t=window.crypto.subtle).decrypt,n=[{name:"AES-GCM",iv:i,additionalData:u}],[4,window.crypto.subtle.importKey("raw",o,{name:"AES-GCM",length:256},!1,["decrypt"])];case 1:return[4,r.apply(t,n.concat([e.sent(),a]))];case 2:return[2,e.sent()]}})})},ya.prototype.getRandomValues=function(e){return window.crypto.getRandomValues(new Uint8Array(e))},I.default=ya;var ba={},_a=(Object.defineProperty(ba,"__esModule",{value:!0}),ba.vector=function(t){try{return new ga(t)}catch(e){throw(0,_a.newError)("Invalid argument type passed to vector constructor function: should be signed integer or float TypedArray, got: ".concat(null!=(t=null==(t=null==t?void 0:t.constructor)?void 0:t.name)?t:"undefined or type without constructor name"))}},ba.isVector=function(e){return null!=e&&!0===e[va]},t),va="__isVector__",ma={INT8:"INT8",INT16:"INT16",INT32:"INT32",INT64:"INT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"},ga=(Object.freeze(ma),Oa.prototype.asTypedArray=function(){return this._typedArray},Oa.prototype.getType=function(){return this._type},Oa.prototype.toString=function(){return"vector([".concat(this._typedArray.join(", "),"], ").concat(this._typedArray.length,", ").concat((e=>{switch(e){case"INT8":return"INTEGER8 NOT NULL";case"INT16":return"INTEGER16 NOT NULL";case"INT32":return"INTEGER32 NOT NULL";case"INT64":return"INTEGER NOT NULL";case"FLOAT32":return"FLOAT32 NOT NULL";case"FLOAT64":return"FLOAT NOT NULL";default:throw(0,_a.newError)("Cannot stringify vector with unsupported type. Got type: ".concat(e))}})(this._type),")")},Oa);function Oa(e){var t;if(e instanceof Int8Array)this._type=ma.INT8;else if(e instanceof Int16Array)this._type=ma.INT16;else if(e instanceof Int32Array)this._type=ma.INT32;else if(e instanceof BigInt64Array)this._type=ma.INT64;else if(e instanceof Float32Array)this._type=ma.FLOAT32;else{if(!(e instanceof Float64Array))throw(0,_a.newError)("Invalid argument type passed to Vector constructor: should be signed integer or float TypedArray, got: ".concat(null!=(t=null==(t=null==e?void 0:e.constructor)?void 0:t.name)?t:"undefined or type without constructor name"));this._type=ma.FLOAT64}this._typedArray=e}ba.default=ga,Object.defineProperty(ga.prototype,va,{value:!0,enumerable:!1,configurable:!1,writable:!1});var wa={},Ea=(Object.defineProperty(wa,"__esModule",{value:!0}),wa.uuid=function(e){if("string"==typeof e)return Ta.fromString(e);if(e instanceof Uint8Array)return new Ta(e);throw(0,Ea.newError)("Invalid argument type passed to UUID constructor function: expected Uint8Array or uuid string, got: ".concat(null!=(e=null==(e=null==e?void 0:e.constructor)?void 0:e.name)?e:"undefined or type without constructor name"))},wa.isUUID=function(e){return null!=e&&!0===e[Pa]},t),Pa="__isUUID__",Sa=[3,5,7,9],Ta=(ja.prototype.getTypedArray=function(){return this._typedArray},ja.prototype.toString=function(){for(var e="",t=0;t<this._typedArray.length;t++)e+=("0"+this._typedArray[t].toString(16)).slice(-2),-1!==Sa.indexOf(t)&&(e+="-");return e},ja.fromString=function(e){if(null===e.match(/^[\da-fA-F]{32}$/)&&null===e.match(/^[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}$/))throw(0,Ea.newError)("UUID string base16 encoded should be of format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx or without any dashes, got: ".concat(e));e=e.replace(/-/g,"");for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substring(r,r+2),16));return new ja(Uint8Array.from(t))},ja);function ja(e){if(16!==e.length)throw(0,Ea.newError)("Uint8Array representation of UUID must be of length 16, got ".concat(e.toString()));this._typedArray=e,Object.freeze(this)}wa.default=Ta,Object.defineProperty(Ta.prototype,Pa,{value:!0,enumerable:!1,configurable:!1,writable:!1});var R={},Ca=(Object.defineProperty(R,"__esModule",{value:!0}),R.isUnsupportedType=function(e){return null!=e&&!0===e[Ca]},"__isUnsupportedType__"),Ia=(Ra.prototype.toString=function(){return"UnsupportedType<".concat(this.name,">")},Ra);function Ra(e,t,r,n){this.name=e,this.minimumProtocolVersion="".concat(t,".").concat(r),this.message=n}R.default=Ia,Object.defineProperty(Ia.prototype,Ca,{value:!0,enumerable:!1,configurable:!1,writable:!1});var Aa,Ma=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),ka=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Ia=r&&r.__importStar||(Aa=function(e){return(Aa=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=Aa(e),n=0;n<r.length;n++)"default"!==r[n]&&Ma(t,e,r[n]);return ka(t,e),t}),Na=r&&r.__awaiter||function(e,a,u,s){return new(u=u||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof u?t:new u(function(e){e(t)})).then(n,o)}i((s=s.apply(e,a||[])).next())})},xa=r&&r.__generator||function(n,o){var i,a,u,s={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,a&&(u=2&t[0]?a.return:t[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,t[1])).done)return u;switch(a=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(u=0<(u=s.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3]))s.label=t[1];else if(6===t[0]&&s.label<u[1])s.label=u[1],u=t;else{if(!(u&&s.label<u[2])){u[2]&&s.ops.pop(),s.trys.pop();continue}s.label=u[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],a=0}finally{i=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Da=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},A=(Object.defineProperty(Xn,"__esModule",{value:!0}),Ia(Z)),Ua=O,La=E,Fa=Da(I),Ba=i,Va=ba,qa=l,Wa=wa,za=t,Ha=F,Ga=Wr,Ka=Da(R),Ya=["BOOLEAN","DATE","INTEGER","LOCAL TIME","POINT","STRING","ZONED TIME","UUID","BYTES"];function Za(e,t){var r=this;this._boltProvider=e,this._profiles=new Map,t.forEach(function(e){if(r._profiles.has(e.name))throw(0,za.newError)("Multiple profiles with name ".concat(e.name," configured, each profile must have a unique name."));r._profiles.set(e.name,{profile:e,keyManager:new La.EncapsulatedKeyManager(e,e.encapsulationService)})}),this._cryptoProvider=new Fa.default}Za.prototype.encrypt=function(p){return Na(this,void 0,void 0,function(){var t,r,n,o,i,a,u,s,c,l,f;return xa(this,function(e){switch(e.label){case 0:if(t=this._getProfile(p.encryptionProfile),o=this._identifyType(p.value),r=o.typeName,n=o.typeProtocolMajor,o=o.typeProtocolMinor,i=this._boltProvider.encodeValue(p.value),void 0!==p.aad){if(u=this._identifyType(p.aad),!Ya.includes(u.typeName))throw(0,za.newError)("Unsupported AAD property type ".concat(u.typeName,", supported values are ").concat(Ya.toString()));a=this._boltProvider.encodeValue(p.aad)}return[4,this._getKeyRecord(t.profile,p.keyOptions)];case 1:s=e.sent(),e.label=2;case 2:return e.trys.push([2,5,,6]),[4,this._decapsulateKey(t.profile,s)];case 3:return c=e.sent(),[4,this._cryptoProvider.encrypt(c,i,a)];case 4:return c=e.sent(),f=c.cyphertext,l=c.iv,l={key_id:s.id(),iv:new Int8Array(l.buffer),aad:void 0!==a?new Int8Array(a):void 0,aad_encoding_scheme_major:null==u?void 0:u.typeProtocolMajor,aad_encoding_scheme_minor:null==u?void 0:u.typeProtocolMinor},[2,this._boltProvider.encodeObject(new Ua.EncryptedValue(new Int8Array(f),t.profile.name,t.profile.type,t.profile.version,r,n,o,l))];case 5:throw f=e.sent(),(0,za.newError)("Property encryption failed due to internal error, see cause.","50N42",f);case 6:return[2]}})})},Za.prototype.decrypt=function(c){return Na(this,void 0,void 0,function(){var t,r,n,o,i,a,u,s;return xa(this,function(e){switch(e.label){case 0:if((r=this._boltProvider.decodeObject(c.ciphertext)).typeProtocolMajor.notEquals((0,A.int)(1))||r.typeProtocolMinor.greaterThan((0,A.int)(0)))return[2,new Ka.default("Undecryptable Value",r.typeProtocolMajor.toNumber(),r.typeProtocolMinor.toNumber(),"Encrypted value was encoded with a newer driver, you must update your driver version to decode it.")];if("ENVELOPE"!==r.profileType||!r.profileVersion.equals((0,A.int)(1)))return[3,7];if(!0===c.usePersistedAad)t=void 0!==r.metadata.aad?r.metadata.aad.buffer:void 0;else if(void 0!==c.aad){if((n=this._identifyType(c.aad)).typeProtocolMajor===r.metadata.aad_encoding_scheme_major&&n.typeProtocolMinor===r.metadata.aad_encoding_scheme_minor)throw(0,za.newError)("AAD used to encrypt was encoded with a newer encoding scheme than this driver supports");t=this._boltProvider.encodeAAD(c.aad,new Ga.ProtocolVersion(r.metadata.aad_encoding_scheme_major,r.metadata.aad_encoding_scheme_minor))}n=this._getProfile(r.profileName),e.label=1;case 1:return e.trys.push([1,5,,6]),[4,this._getKeyRecord(n.profile,r.metadata.key_id)];case 2:return o=e.sent(),[4,this._decapsulateKey(n.profile,o)];case 3:return o=e.sent(),a=(i=this._boltProvider).decodeValue,[4,this._cryptoProvider.decrypt(o,r.metadata.iv,r.cipherOutput.buffer,t)];case 4:return s=a.apply(i,[e.sent(),new Ga.ProtocolVersion(r.typeProtocolMajor.toNumber(),r.typeProtocolMinor.toNumber())]),(u=this._identifyType(s)).typeProtocolMajor.equals(r.typeProtocolMajor)&&u.typeProtocolMinor.equals(r.typeProtocolMinor)?[2,s]:[2,new Ka.default("Encrypted<".concat(u.typeName,">"),r.typeProtocolMajor.toNumber(),r.typeProtocolMinor.toNumber(),"Encrypted value was encoded with a driver too old for this driver to read it.")];case 5:throw s=e.sent(),(0,za.newError)("Property decryption failed due to internal error, see cause.","50N42",s);case 6:return[3,8];case 7:throw(0,za.newError)("Unsupported encryption profile version ".concat(r.profileVersion.toString()," of profile type ").concat(r.profileType,"."));case 8:return[2]}})})},Za.prototype.keyManager=function(e){return this._getProfile(e).keyManager},Za.prototype._identifyType=function(t){if(null===t)return n=function(e){throw(0,za.newError)("Encrypted arrays cannot contain null values")},{typeName:"NULL",typeProtocolMajor:(0,A.int)(1),typeProtocolMinor:(0,A.int)(0),verification:n};if("string"==typeof t)return n=function(e){return"string"==typeof e},{typeName:"STRING",typeProtocolMajor:(0,A.int)(1),typeProtocolMinor:(0,A.int)(0),verification:n};if("boolean"==typeof t)return n=function(e){return"boolean"==typeof e},{typeName:"BOOLEAN",typeProtocolMajor:(0,A.int)(1),typeProtocolMinor:(0,A.int)(0),verification:n};if("number"==typeof t)return n=function(e){return"number"==typeof e},{typeName:"FLOAT",typeProtocolMajor:(0,A.int)(1),typeProtocolMinor:(0,A.int)(0),verification:n};if("bigint"==typeof t)return n=function(e){return"bigint"==typeof e},{typeName:"INTEGER",typeProtocolMajor:(0,A.int)(1),typeProtocolMinor:(0,A.int)(0),verification:n};if((0,A.isInt)(t))return n=function(e){return(0,A.isInt)(e)},{typeName:"INTEGER",typeProtocolMajor:(0,A.int)(1),typeProtocolMinor:(0,A.int)(0),verification:n};if((0,Ba.isDate)(t))return n=function(e){return(0,Ba.isDate)(e)},{typeName:"DATE",typeProtocolMajor:(0,A.int)(1),typeProtocolMinor:(0,A.int)(0),verification:n};if((0,Ba.isDuration)(t))return n=function(e){return(0,Ba.isDuration)(e)},{typeName:"DURATION",typeProtocolMajor:(0,A.int)(1),typeProtocolMinor:(0,A.int)(0),verification:n};if((0,Va.isVector)(t))return n=function(e){throw(0,za.newError)("Encrypted arrays cannot contain vector values")},{typeName:"VECTOR",typeProtocolMajor:(0,A.int)(1),typeProtocolMinor:(0,A.int)(0),verification:n};if(t instanceof Int8Array)return n=function(e){return e instanceof Int8Array},{typeName:"BYTES",typeProtocolMajor:(0,A.int)(1),typeProtocolMinor:(0,A.int)(0),verification:n};if((0,Ba.isLocalDateTime)(t))return n=function(e){return(0,Ba.isLocalDateTime)(e)},{typeName:"LOCAL DATETIME",typeProtocolMajor:(0,A.int)(1),typeProtocolMinor:(0,A.int)(0),verification:n};if((0,Ba.isLocalTime)(t))return n=function(e){return(0,Ba.isLocalTime)(e)},{typeName:"LOCAL TIME",typeProtocolMajor:(0,A.int)(1),typeProtocolMinor:(0,A.int)(0),verification:n};if((0,Ba.isDateTime)(t))return n=function(e){return(0,Ba.isDateTime)(e)},{typeName:"ZONED DATETIME",typeProtocolMajor:(0,A.int)(1),typeProtocolMinor:(0,A.int)(0),verification:n};if((0,Ba.isTime)(t))return n=function(e){return(0,Ba.isTime)(e)},{typeName:"ZONED TIME",typeProtocolMajor:(0,A.int)(1),typeProtocolMinor:(0,A.int)(0),verification:n};if((0,qa.isPoint)(t))return n=function(e){if((0,qa.isPoint)(e)){if((e.srid instanceof BigInt?A.default.fromString(e.srid.toString()):(0,A.int)(e.srid)).notEquals(t.srid instanceof BigInt?A.default.fromString(t.srid.toString()):(0,A.int)(t.srid)))throw(0,za.newError)("Encrypted arrays of Points must only contain Points with identical srids");if(null==e.z&&null!=t.z||null!=e.z&&null==t.z)throw(0,za.newError)("Encrypted arrays of Points must only contain Points of the same dimensionality.");return!0}return!1},{typeName:"POINT",typeProtocolMajor:(0,A.int)(1),typeProtocolMinor:(0,A.int)(0),verification:n};if((0,Wa.isUUID)(t))return n=function(e){return(0,Wa.isUUID)(e)},{typeName:"UUID",typeProtocolMajor:(0,A.int)(1),typeProtocolMinor:(0,A.int)(0),verification:n};if(Array.isArray(t)){var e,r,n,o=this._identifyType(t[0]);if(t.map(function(e){return o.verification(e)}).every(function(e){return e}))return e=(0,A.int)(1),r=(0,A.int)(0),(o.typeProtocolMajor.greaterThan(e)||o.typeProtocolMajor.equals(e)&&o.typeProtocolMinor.greaterThan(r))&&(e=o.typeProtocolMajor,r=o.typeProtocolMinor),{typeName:"LIST",typeProtocolMajor:e,typeProtocolMinor:r,verification:n=function(e){return!1}};throw(0,za.newError)("Every element of an encrypted array must be of the same property type")}throw(0,za.newError)("could not identify type of: ".concat((0,Ha.stringify)(t)))},Za.prototype._getProfile=function(e){if(null==e){if(1===this._profiles.size)return this._profiles.get(this._profiles.keys().next().value);throw(0,za.newError)("When using a driver with multiple encryption profiles configured, which encryption profile to use must be explicitly provided")}var t=this._profiles.get(e);if(void 0===t)throw(0,za.newError)("Could not find encryption profile with name ".concat(e));return t},Za.prototype._getKeyRecord=function(r,n){return Na(this,void 0,void 0,function(){var t;return xa(this,function(e){switch(e.label){case 0:return[4,r.findKey(n)];case 1:if(null==(t=e.sent()))throw(0,za.newError)("Could not find key with key options: ".concat((0,Ha.stringify)(n)));return[2,t]}})})},Za.prototype._decapsulateKey=function(r,n){return Na(this,void 0,void 0,function(){var t;return xa(this,function(e){switch(e.label){case 0:return[4,r.encapsulationService.decapsulate(n.encapsulation(),n.metadata())];case 1:if(32!==(t=e.sent()).length)throw(0,za.newError)("Expected decapulated key to be 32 bytes, found ".concat(t.length));return[2,t]}})})},Xn.default=Za;function Qa(){this.routing=vu.WRITE,this.resultTransformer=void 0,this.database="",this.impersonatedUser=void 0,this.bookmarkManager=void 0,this.transactionConfig=void 0,this.auth=void 0,this.signal=void 0}var Xa=r&&r.__assign||function(){return(Xa=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Ja=r&&r.__awaiter||function(e,a,u,s){return new(u=u||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof u?t:new u(function(e){e(t)})).then(n,o)}i((s=s.apply(e,a||[])).next())})},$a=r&&r.__generator||function(n,o){var i,a,u,s={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,a&&(u=2&t[0]?a.return:t[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,t[1])).done)return u;switch(a=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(u=0<(u=s.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3]))s.label=t[1];else if(6===t[0]&&s.label<u[1])s.label=u[1],u=t;else{if(!(u&&s.label<u[2])){u[2]&&s.ops.pop(),s.trys.pop();continue}s.label=u[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],a=0}finally{i=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Ia=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},eu=(Object.defineProperty(o,"__esModule",{value:!0}),o.QueryConfig=o.SessionConfig=o.routing=o.WRITE=o.READ=o.Driver=void 0,Ar),tu=Ia(ro),ru=g,nu=w,ou=Ia(bo),iu=a,au=S,uu=Ia(m),su=Ia(Kr),cu=t,lu=Ia(j),fu=T,pu=Ia(Xn),du=36e5,hu=1e3,yu=ru.ACCESS_MODE_READ,bu=(o.READ=yu,ru.ACCESS_MODE_WRITE),_u=(o.WRITE=bu,0),vu=(o.SessionConfig=function(){this.defaultAccessMode=bu,this.bookmarks=[],this.database="",this.impersonatedUser=void 0,this.auth=void 0,this.fetchSize=void 0,this.bookmarkManager=void 0,this.notificationFilter=void 0,this.disableAutoCommitRetries=void 0},{WRITE:"WRITE",READ:"READ"}),E=(o.routing=vu,Object.freeze(vu),o.QueryConfig=Qa,Object.defineProperty(mu.prototype,"executeQueryBookmarkManager",{get:function(){return this._defaultExecuteQueryBookmarkManager},enumerable:!1,configurable:!0}),mu.prototype.executeQuery=function(e,t){return Ja(this,arguments,void 0,function(t,r,n,o){var i,a,u;return void 0===n&&(n={}),$a(this,function(e){switch(e.label){case 0:if(i=null===n.bookmarkManager?void 0:null!=(i=n.bookmarkManager)?i:this.executeQueryBookmarkManager,a=null!=(a=n.resultTransformer)?a:uu.default.eager(),(u=null!=(u=n.routing)?u:vu.WRITE)!==vu.READ&&u!==vu.WRITE)throw(0,cu.newError)('Illegal query routing config: "'.concat(u,'"'));return[4,this._queryExecutor.execute({resultTransformer:a,bookmarkManager:i,routing:u,database:n.database,impersonatedUser:n.impersonatedUser,transactionConfig:n.transactionConfig,auth:n.auth,signal:n.signal},t,r,o)];case 1:return[2,e.sent()]}})})},mu.prototype.verifyConnectivity=function(e){var e=(void 0===e?{}:e).database,r=void 0===e?"":e,n=this._getOrCreateConnectionProvider();return new Promise(function(e,t){n.verifyConnectivityAndGetServerInfo({database:r,accessMode:yu}).then(function(){return e()}).catch(function(e){return t(e)})})},mu.prototype.verifyAuthentication=function(){return Ja(this,arguments,void 0,function(e){var e=void 0===e?{}:e,t=e.database,r=e.auth;return $a(this,function(e){switch(e.label){case 0:return[4,this._getOrCreateConnectionProvider().verifyAuthentication({database:null!=t?t:"system",auth:r,accessMode:yu})];case 1:return[2,e.sent()]}})})},mu.prototype.getServerInfo=function(e){e=(void 0===e?{}:e).database,e=void 0===e?"":e;return this._getOrCreateConnectionProvider().verifyConnectivityAndGetServerInfo({database:e,accessMode:yu})},mu.prototype.supportsMultiDb=function(){return this._getOrCreateConnectionProvider().supportsMultiDb()},mu.prototype.supportsTransactionConfig=function(){return this._getOrCreateConnectionProvider().supportsTransactionConfig()},mu.prototype.supportsUserImpersonation=function(){return this._getOrCreateConnectionProvider().supportsUserImpersonation()},mu.prototype.supportsSessionAuth=function(){return this._getOrCreateConnectionProvider().supportsSessionAuth()},mu.prototype.getNegotiatedProtocolVersion=function(){return this._getOrCreateConnectionProvider().getNegotiatedProtocolVersion()},mu.prototype.isEncrypted=function(){return this._isEncrypted()},mu.prototype._supportsRouting=function(){return this._meta.routing},mu.prototype._isEncrypted=function(){return this._config.encrypted===iu.ENCRYPTION_ON||!0===this._config.encrypted},mu.prototype._getTrust=function(){return this._config.trust},mu.prototype.session=function(e){var e=void 0===e?{}:e,t=e.defaultAccessMode,r=e.database,n=e.bookmarkManager,o=e.notificationFilter,i=e.auth,a=e.disableAutoCommitRetries;return this._newSession({defaultAccessMode:void 0===t?bu:t,bookmarkOrBookmarks:e.bookmarks,database:void 0===r?"":r,reactive:!1,impersonatedUser:e.impersonatedUser,fetchSize:Ou(e.fetchSize,this._config.fetchSize),bookmarkManager:n,notificationFilter:o,auth:i,disableAutoCommitRetries:a})},mu.prototype.close=function(){return this._log.info("Driver ".concat(this._id," closing")),null!=this._connectionProvider?this._connectionProvider.close():Promise.resolve()},mu.prototype[Symbol.asyncDispose]=function(){return this.close()},mu.prototype._afterConstruction=function(){this._log.info("".concat(this._meta.typename," driver ").concat(this._id," created for server address ").concat(this._meta.address.toString()))},mu.prototype._homeDatabaseCallback=function(e,t){this.homeDatabaseCache.set(e,t)},mu.prototype._newSession=function(e){var t=e.defaultAccessMode,r=e.bookmarkOrBookmarks,n=e.database,o=e.reactive,i=e.impersonatedUser,a=e.fetchSize,u=e.bookmarkManager,s=e.notificationFilter,c=e.auth,e=e.disableAutoCommitRetries,t=ou.default._validateSessionMode(t),l=this._getOrCreateConnectionProvider(),f=this.homeDatabaseCache.get((0,fu.cacheKey)(c,i)),p=this._homeDatabaseCallback.bind(this),r=null!=r?new eu.Bookmarks(r):eu.Bookmarks.empty();return this._createSession({mode:t,database:null!=n?n:"",connectionProvider:l,bookmarks:r,config:Xa({cachedHomeDatabase:f,routingDriver:this._supportsRouting()},this._config),reactive:o,impersonatedUser:i,fetchSize:a,bookmarkManager:u,notificationFilter:s,auth:c,log:this._log,homeDatabaseCallback:p,disableAutoCommitRetries:e})},mu.prototype._getOrCreateConnectionProvider=function(){var e;return null==this._connectionProvider&&(this._connectionProvider=this._createConnectionProvider(this._id,this._config,this._log,(e=this._config,new tu.default(e.resolver)))),this._connectionProvider},mu);function mu(e,t,r,n,o,i){void 0===o&&(o=function(e){return new ou.default(e)}),void 0===i&&(i=function(e){return new su.default(e)}),(a=t=void 0===t?{}:t).maxConnectionLifetime=gu(a.maxConnectionLifetime,du),a.maxConnectionPoolSize=gu(a.maxConnectionPoolSize,ru.DEFAULT_POOL_MAX_SIZE),a.connectionAcquisitionTimeout=gu(a.connectionAcquisitionTimeout,ru.DEFAULT_POOL_ACQUISITION_TIMEOUT),a.fetchSize=Ou(a.fetchSize,hu),a.connectionTimeout=(e=>0===(e=parseInt(e.connectionTimeout,10))||!isNaN(e)&&e<0?null:isNaN(e)?ru.DEFAULT_CONNECTION_TIMEOUT_MILLIS:e)(a),a.connectionLivenessCheckTimeout=(e=>{if(null!=e){if((e=parseInt(e,10))<0||Number.isNaN(e))throw new Error("The connectionLivenessCheckTimeout can only be a positive value or 0 for always. However connectionLivenessCheckTimeout = ".concat(e));return e}})(a.connectionLivenessCheckTimeout);var a=nu.Logger.create(t);((e,t)=>{var r=e.resolver;if(null!=r&&"function"!=typeof r)throw new TypeError("Configured resolver should be a function. Got: ".concat(typeof r));if(e.connectionAcquisitionTimeout<e.connectionTimeout&&t.warn('Configuration for "connectionAcquisitionTimeout" should be greater than or equal to "connectionTimeout". Otherwise, the connection acquisition timeout will take precedence for over the connection timeout in scenarios where a new connection is created while it is acquired'),null==(null==(r=e.notificationFilter)?void 0:r.disabledCategories)||null==(null==(t=e.notificationFilter)?void 0:t.disabledClassifications))return;throw new Error('The notificationFilter can\'t have both "disabledCategories" and "disabledClassifications" configured at the same time.')})(t,a),this._id=_u++,this._meta=e,this._config=t,this._log=a,this._createConnectionProvider=r,this._createSession=o,this._defaultExecuteQueryBookmarkManager=(0,au.bookmarkManager)(),this._queryExecutor=i(this.session.bind(this)),this.encryption=new pu.default(n,null!=(e=t.encryptionProfiles)?e:[]),this._connectionProvider=null,this.homeDatabaseCache=new lu.default(1e4),this._afterConstruction()}function gu(e,t){e=parseInt(e,10);return 0<e||0===e?e:e<0?Number.MAX_SAFE_INTEGER:t}function Ou(e,t){e=parseInt(e,10);if(0<e||e===ru.FETCH_ALL)return e;if(0===e||e<0)throw new Error("The fetch size can only be a positive value or ".concat(ru.FETCH_ALL," for ALL. However fetchSize = ").concat(e));return t}o.Driver=E,o.default=E;var Da={},wu=(Object.defineProperty(Da,"__esModule",{value:!0}),t),Eu=F;function Pu(e){return null!=e&&""!==e&&(Object.getPrototypeOf(e)!==Object.prototype||0!==Object.keys(e).length)}Da.default={basic:function(e,t,r){return null!=r?{scheme:"basic",principal:e,credentials:t,realm:r}:{scheme:"basic",principal:e,credentials:t}},kerberos:function(e){return{scheme:"kerberos",principal:"",credentials:e}},bearer:function(e){return{scheme:"bearer",credentials:e}},none:function(){return{scheme:"none"}},custom:function(e,t,r,n,o){n={scheme:n,principal:e};if(Pu(t)&&(n.credentials=t),Pu(r)&&(n.realm=r),Pu(o)){try{(0,Eu.stringify)(o)}catch(e){throw(0,wu.newError)("Circular references in custom auth token parameters",void 0,e)}n.parameters=o}return n}};var Ar={},Su=r&&r.__awaiter||function(e,a,u,s){return new(u=u||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof u?t:new u(function(e){e(t)})).then(n,o)}i((s=s.apply(e,a||[])).next())})},Tu=r&&r.__generator||function(n,o){var i,a,u,s={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,a&&(u=2&t[0]?a.return:t[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,t[1])).done)return u;switch(a=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(u=0<(u=s.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3]))s.label=t[1];else if(6===t[0]&&s.label<u[1])s.label=u[1],u=t;else{if(!(u&&s.label<u[2])){u[2]&&s.ops.pop(),s.trys.pop();continue}s.label=u[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],a=0}finally{i=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},ro=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ju=(Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.authTokenManagers=Ar.AuthTokenAndExpiration=void 0,Ar.staticAuthTokenManager=function(e){e=e.authToken;return new xu(e)},ro(Da)),Cu=v;function Iu(){}function Ru(){}Iu.prototype.getToken=function(){throw new Error("Not Implemented")},Iu.prototype.handleSecurityException=function(e,t){throw new Error("Not implemented")},Ar.default=Iu,Ar.AuthTokenAndExpiration=function(){this.token=ju.default.none(),this.expiration=void 0},Ru.prototype.bearer=function(e){e=e.tokenProvider;if("function"!=typeof e)throw new TypeError("tokenProvider should be function, but got: ".concat(typeof e));return new ku(e,["Neo.ClientError.Security.Unauthorized","Neo.ClientError.Security.TokenExpired"])},Ru.prototype.basic=function(e){var t=this,r=e.tokenProvider;if("function"!=typeof r)throw new TypeError("tokenProvider should be function, but got: ".concat(typeof r));return new ku(function(){return Su(t,void 0,void 0,function(){var t;return Tu(this,function(e){switch(e.label){case 0:return t={},[4,r()];case 1:return[2,(t.token=e.sent(),t)]}})})},["Neo.ClientError.Security.Unauthorized"])};g=new Ru;Ar.authTokenManagers=g,Object.freeze(g);Mu.prototype.subscribe=function(e){this._subscribers.push(e)},Mu.prototype.onCompleted=function(t){this._subscribers.forEach(function(e){return e.onCompleted(t)})},Mu.prototype.onError=function(t){this._subscribers.forEach(function(e){return e.onError(t)})};var Au=Mu;function Mu(e){this._subscribers=e=void 0===e?[]:e}Nu.prototype.getToken=function(){return Su(this,void 0,void 0,function(){var t;return Tu(this,function(e){switch(e.label){case 0:return void 0===this._currentAuthData||void 0!==this._currentAuthData.expiration&&this._currentAuthData.expiration<new Date?[4,this._refreshAuthToken()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2,null==(t=this._currentAuthData)?void 0:t.token]}})})},Nu.prototype.handleSecurityException=function(e,t){return!!this._handledSecurityCodes.includes(t)&&(Cu.util.equals(e,null==(t=this._currentAuthData)?void 0:t.token)&&this._scheduleRefreshAuthToken(),!0)},Nu.prototype._scheduleRefreshAuthToken=function(e){var r=this;void 0===this._refreshObservable&&(this._currentAuthData=void 0,this._refreshObservable=new Au,Promise.resolve(this._tokenProvider()).then(function(e){var t;r._currentAuthData=e,null!=(t=r._refreshObservable)&&t.onCompleted(e)}).catch(function(e){var t;null!=(t=r._refreshObservable)&&t.onError(e)}).finally(function(){r._refreshObservable=void 0})),void 0!==e&&this._refreshObservable.subscribe(e)},Nu.prototype._refreshAuthToken=function(){return Su(this,void 0,void 0,function(){var r=this;return Tu(this,function(e){switch(e.label){case 0:return[4,new Promise(function(e,t){r._scheduleRefreshAuthToken({onCompleted:e,onError:t})})];case 1:return[2,e.sent()]}})})};var ku=Nu;function Nu(e,t,r,n){this._tokenProvider=e,this._handledSecurityCodes=t,this._currentAuthData=r,this._refreshObservable=n}Du.prototype.getToken=function(){return this._authToken},Du.prototype.handleSecurityException=function(e,t){return!1};var xu=Du;function Du(e){this._authToken=e}function Uu(){this.encrypted=void 0,this.trust=void 0,this.trustedCertificates=[],this.maxConnectionPoolSize=100,this.maxConnectionLifetime=36e5,this.connectionAcquisitionTimeout=6e4,this.maxTransactionRetryTime=3e4,this.connectionLivenessCheckTimeout=void 0,this.connectionTimeout=3e4,this.disableLosslessIntegers=!1,this.useBigInt=!1,this.logging=void 0,this.resolver=void 0,this.notificationFilter=void 0,this.userAgent=void 0,this.telemetryDisabled=!1,this.clientCertificate=void 0,this.encryptionProfiles=void 0}var Lu,Fu,w={},a=r&&r.__extends||(Lu=function(e,t){return(Lu=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Lu(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Kr=(Object.defineProperty(w,"__esModule",{value:!0}),w.InternalConfig=w.Config=void 0,w.Config=Uu,a(Bu,Fu=Uu),Bu);function Bu(){return null!==Fu&&Fu.apply(this,arguments)||this}w.InternalConfig=Kr;var Vu,qu,j={},T=r&&r.__extends||(Vu=function(e,t){return(Vu=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Vu(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Wu=r&&r.__assign||function(){return(Wu=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},zu=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),Hu=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Ia=r&&r.__importStar||(qu=function(e){return(qu=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=qu(e),n=0;n<r.length;n++)"default"!==r[n]&&zu(t,e,r[n]);return Hu(t,e),t}),Gu=(Object.defineProperty(j,"__esModule",{value:!0}),j.clientCertificateProviders=j.RotatingClientCertificateProvider=j.ClientCertificateProvider=void 0,j.resolveCertificateProvider=function(e){if(null==e)return;if("object"==typeof e&&"hasUpdate"in e&&"getClientCertificate"in e&&"function"==typeof e.getClientCertificate&&"function"==typeof e.hasUpdate)return e;{var t;if(Xu(e))return t=Wu({},e),{getClientCertificate:function(){return t},hasUpdate:function(){return!1}}}throw new TypeError("clientCertificate should be configured with ClientCertificate or ClientCertificateProvider, but got ".concat(Gu.stringify(e)))},Ia(F)),E=(j.default=function(){this.certfile="",this.keyfile="",this.password=void 0},Ku.prototype.hasUpdate=function(){throw new Error("Not Implemented")},Ku.prototype.getClientCertificate=function(){throw new Error("Not Implemented")},Ku);function Ku(){}j.ClientCertificateProvider=E;T(Zu,Yu=E),Zu.prototype.updateCertificate=function(e){throw new Error("Not implemented")};var Yu,ro=Zu;function Zu(){return null!==Yu&&Yu.apply(this,arguments)||this}function Qu(){}j.RotatingClientCertificateProvider=ro,Qu.prototype.rotating=function(e){var t,e=e.initialCertificate;if(null!=e&&Xu(e))return t=Wu({},e),new ts(t);throw new TypeError("initialCertificate should be ClientCertificate, but got ".concat(Gu.stringify(e)))};g=new Qu;function Xu(e){return null!=e&&"object"==typeof e&&"certfile"in e&&(Ju(r=e.certfile)||$u(r,Ju))&&"keyfile"in e&&(t(r=e.keyfile)||$u(r,t))&&es("password",e);function t(e){return"string"==typeof e||null!=e&&"object"==typeof e&&"path"in e&&"string"==typeof e.path&&es("password",e)}var r}function Ju(e){return"string"==typeof e}function $u(e,t,r){return void 0===r&&(r=!1),Array.isArray(e)&&(r||0<e.length)&&e.filter(t).length===e.length}function es(e,t){return!(e in t)||null==t[e]||"string"==typeof t[e]}j.clientCertificateProviders=g,Object.freeze(g);rs.prototype.hasUpdate=function(){try{return this._updated}finally{this._updated=!1}},rs.prototype.getClientCertificate=function(){return this._certificate},rs.prototype.updateCertificate=function(e){if(!Xu(e))throw new TypeError("certificate should be ClientCertificate, but got ".concat(Gu.stringify(e)));this._certificate=Wu({},e),this._updated=!0};var ts=rs;function rs(e,t){void 0===t&&(t=!1),this._certificate=e,this._updated=t}var ns,os,is,as,us,ss,cs,ls,fs,ps,ds,hs,ys,a={};function bs(e,t){if(null!=t){if(!0===t.stringify)return e.toString();if(!0===t.jsNativeDate)return e.toStandardDate()}return e}ns=a,is=r&&r.__assign||function(){return(is=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},as=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),us=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Kr=r&&r.__importStar||(os=function(e){return(os=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=os(e),n=0;n<r.length;n++)"default"!==r[n]&&as(t,e,r[n]);return us(t,e),t}),Object.defineProperty(ns,"__esModule",{value:!0}),ns.rule=void 0,ss=u,cs=p,ls=l,fs=i,ps=ba,ds=t,hs=Kr(Z),ys=wa,ns.rule=Object.freeze({asBoolean:function(e){return is({validate:function(e,t){if("boolean"!=typeof e)throw new TypeError("".concat(t," should be a boolean but received ").concat(typeof e))}},e)},asString:function(e){return is({validate:function(e,t){if("string"!=typeof e)throw new TypeError("".concat(t," should be a string but received ").concat(typeof e))}},e)},asNumber:function(r){return is({validate:function(e,t){if((0,hs.isInt)(e)&&!0!==(null==r?void 0:r.isInteger))throw new TypeError('Number returned as Integer Object. To use asNumber mapping with Integers, set "isInteger" in rule configuration.');if(!0!==(null==r?void 0:r.isInteger)&&"bigint"==typeof e)throw new TypeError('Number returned as BigInt. To use asNumber mapping with integer values, set "isInteger" in rule configuration.');if("number"!=typeof e&&(!(0,hs.isInt)(e)||!0!==(null==r?void 0:r.isInteger)))throw new TypeError("".concat(t," should be a number but received ").concat(typeof e));if(!0===(null==r?void 0:r.isInteger)&&"number"==typeof e&&!Number.isInteger(e))throw new TypeError("".concat(t," should be an integer value but received decimal number."))},convert:function(e){return"bigint"==typeof e?Number(e):(0,hs.isInt)(e)?e.toNumber():e},parameterConversion:function(e){return!0===(null==r?void 0:r.isInteger)?hs.default.fromValue(e):e}},r)},asBigInt:function(r){return is({validate:function(e,t){if("bigint"!=typeof e&&(!0!==(null==r?void 0:r.acceptNumber)||"number"!=typeof e)&&!(0,hs.isInt)(e))throw new TypeError("".concat(t," should be a bigint but received ").concat(typeof e))},convert:function(e){return"number"==typeof e?BigInt(e):(0,hs.isInt)(e)?e.toBigInt():e}},r)},asInteger:function(r){return is({validate:function(e,t){if("bigint"!=typeof e&&!(0,hs.isInt)(e)&&("number"!=typeof e||!0!==(null==r?void 0:r.acceptNumber)))throw new TypeError("".concat(t," should be an Integer but received ").concat(typeof e))},convert:function(e){return"bigint"==typeof e?hs.default.fromValue(e):e}},r)},asNode:function(e){return is({validate:function(e,t){if(!(0,cs.isNode)(e))throw new TypeError("".concat(t," should be a Node but received ").concat(typeof e))}},e)},asRelationship:function(e){return is({validate:function(e,t){if(!(0,cs.isRelationship)(e))throw new TypeError("".concat(t," should be a Relationship but received ").concat(typeof e))}},e)},asPath:function(e){return is({validate:function(e,t){if(!(0,cs.isPath)(e))throw new TypeError("".concat(t," should be a Path but received ").concat(typeof e))}},e)},asPoint:function(e){return is({validate:function(e,t){if(!(0,ls.isPoint)(e))throw new TypeError("".concat(t," should be a Point but received ").concat(typeof e))}},e)},asDuration:function(t){if(null==(null==t?void 0:t.stringify)||null==(null==t?void 0:t.convert)&&null==t.parameterConversion)return is({validate:function(e,t){if(!(0,fs.isDuration)(e))throw new TypeError("".concat(t," should be a Duration but received ").concat(typeof e))},convert:function(e){return!0===(null==t?void 0:t.stringify)?e.toString():e},parameterConversion:!0===(null==t?void 0:t.stringify)?function(e){return fs.Duration.fromString(e)}:void 0},t);throw(0,ds.newError)("Provided rule already has convert and/or parameterConversion function, stringify can not be used in combination with custom conversion functions.")},asLocalTime:function(t){if(null==(null==t?void 0:t.stringify)||null==(null==t?void 0:t.convert)&&null==t.parameterConversion)return is({validate:function(e,t){if(!(0,fs.isLocalTime)(e))throw new TypeError("".concat(t," should be a LocalTime but received ").concat(typeof e))},convert:function(e){return!0===(null==t?void 0:t.stringify)?e.toString():e},parameterConversion:!0===(null==t?void 0:t.stringify)?function(e){return fs.LocalTime.fromString(e)}:void 0},t);throw(0,ds.newError)("Provided rule already has convert and/or parameterConversion function, stringify can not be used in combination with custom conversion functions.")},asTime:function(t){if(null==(null==t?void 0:t.stringify)||null==(null==t?void 0:t.convert)&&null==t.parameterConversion)return is({validate:function(e,t){if(!(0,fs.isTime)(e))throw new TypeError("".concat(t," should be a Time but received ").concat(typeof e))},convert:function(e){return!0===(null==t?void 0:t.stringify)?e.toString():e},parameterConversion:!0===(null==t?void 0:t.stringify)?function(e){return fs.Time.fromString(e)}:void 0},t);throw(0,ds.newError)("Provided rule already has convert and/or parameterConversion function, stringify can not be used in combination with custom conversion functions.")},asDate:function(t){if(null!=(null==t?void 0:t.stringify)&&(null!=(null==t?void 0:t.convert)||null!=t.parameterConversion))throw(0,ds.newError)("Provided rule already has convert and/or parameterConversion function, stringify can not be used in combination with custom conversion functions.");if(null!=(null==t?void 0:t.jsNativeDate)&&(null!=(null==t?void 0:t.convert)||null!=t.parameterConversion))throw(0,ds.newError)("Provided rule already has convert and/or parameterConversion function, jsNativeDate can not be used in combination with custom conversion functions.");if(!0===(null==t?void 0:t.stringify)&&!0===(null==t?void 0:t.jsNativeDate))throw(0,ds.newError)("both stringify and jsNativeDate cannot be set; use one or neither");var e;return!0===(null==t?void 0:t.stringify)&&(e=function(e){return fs.Date.fromString(e)}),!0===(null==t?void 0:t.jsNativeDate)&&(e=function(e){return fs.Date.fromStandardDateLocal(e)}),is({validate:function(e,t){if(!(0,fs.isDate)(e))throw new TypeError("".concat(t," should be a Date but received ").concat(typeof e))},convert:function(e){return bs(e,t)},parameterConversion:e},t)},asLocalDateTime:function(t){if(null!=(null==t?void 0:t.stringify)&&(null!=(null==t?void 0:t.convert)||null!=t.parameterConversion))throw(0,ds.newError)("Provided rule already has convert and/or parameterConversion function, stringify can not be used in combination with custom conversion functions.");if(null!=(null==t?void 0:t.jsNativeDate)&&(null!=(null==t?void 0:t.convert)||null!=t.parameterConversion))throw(0,ds.newError)("Provided rule already has convert and/or parameterConversion function, jsNativeDate can not be used in combination with custom conversion functions.");if(!0===(null==t?void 0:t.stringify)&&!0===(null==t?void 0:t.jsNativeDate))throw(0,ds.newError)("both stringify and jsNativeDate cannot be set; use one or neither");var e;return!0===(null==t?void 0:t.stringify)&&(e=function(e){return fs.LocalDateTime.fromString(e)}),!0===(null==t?void 0:t.jsNativeDate)&&(e=function(e){return fs.LocalDateTime.fromStandardDate(e)}),is({validate:function(e,t){if(!(0,fs.isLocalDateTime)(e))throw new TypeError("".concat(t," should be a LocalDateTime but received ").concat(typeof e))},convert:function(e){return bs(e,t)},parameterConversion:e},t)},asDateTime:function(t){if(null!=(null==t?void 0:t.stringify)&&(null!=(null==t?void 0:t.convert)||null!=t.parameterConversion))throw(0,ds.newError)("Provided rule already has convert and/or parameterConversion function, stringify can not be used in combination with custom conversion functions.");if(null!=(null==t?void 0:t.jsNativeDate)&&(null!=(null==t?void 0:t.convert)||null!=t.parameterConversion))throw(0,ds.newError)("Provided rule already has convert and/or parameterConversion function, jsNativeDate can not be used in combination with custom conversion functions.");if(!0===(null==t?void 0:t.stringify)&&!0===(null==t?void 0:t.jsNativeDate))throw(0,ds.newError)("both stringify and jsNativeDate cannot be set; use one or neither");var e;return!0===(null==t?void 0:t.stringify)&&(e=function(e){return fs.DateTime.fromString(e)}),!0===(null==t?void 0:t.jsNativeDate)&&(e=function(e){return fs.DateTime.fromStandardDate(e)}),is({validate:function(e,t){if(!(0,fs.isDateTime)(e))throw new TypeError("".concat(t," should be a DateTime but received ").concat(typeof e))},convert:function(e){return bs(e,t)},parameterConversion:e},t)},asList:function(o){return is({validate:function(e,r){var t;if(!Array.isArray(e))throw new TypeError("".concat(r," should be a list but received ").concat(typeof e));var n=null==(t=null==o?void 0:o.apply)?void 0:t.validate;null!=n&&e.forEach(function(e,t){return n(e,"".concat(r,"[").concat(t,"]"))})},convert:function(e,r){return null!=(null==o?void 0:o.apply)?e.map(function(e,t){return(0,ss.valueAs)(e,"".concat(r,"[").concat(t,"]"),o.apply)}):e},parameterConversion:function(e){var t=null==o?void 0:o.apply;return null!=t?e.map(function(e){return(0,ss.optionalParameterConversion)(e,t)}):e}},o)},asVector:function(r){if(null==(null==r?void 0:r.asTypedList)||null==(null==r?void 0:r.convert)&&null==r.parameterConversion)return is({validate:function(e,t){if(!(0,ps.isVector)(e))throw new TypeError("".concat(t," should be a vector but received ").concat(typeof e));if(null!=(null==r?void 0:r.dimension)&&e.asTypedArray().length!==r.dimension)throw new TypeError("".concat(t," should be a vector of length ").concat(r.dimension," but received length ").concat(e.asTypedArray().length));if(null!=(null==r?void 0:r.type)&&e.getType()!==r.type)throw new TypeError("".concat(t," should be a vector of type ").concat(r.type," but received type ").concat(e.getType()))},convert:function(e){return!0===(null==r?void 0:r.asTypedList)?e._typedArray:e},parameterConversion:!0===(null==r?void 0:r.asTypedList)?function(e){return(0,ps.vector)(e)}:void 0},r);throw(0,ds.newError)("Provided rule already has convert and/or parameterConversion function, asTypedList can not be used in combination with custom conversion functions.")},asUUID:function(t){if(null==(null==t?void 0:t.stringify)||null==(null==t?void 0:t.convert)&&null==t.parameterConversion)return is({validate:function(e,t){if(!(0,ys.isUUID)(e))throw new TypeError("".concat(t," should be a UUID but received ").concat(typeof e))},convert:function(e){return!0===(null==t?void 0:t.stringify)?e.toString():e},parameterConversion:!0===(null==t?void 0:t.stringify)?function(e){return(0,ys.uuid)(e)}:void 0},t);throw(0,ds.newError)("Provided rule already has convert and/or parameterConversion function, stringify can not be used in combination with custom conversion functions.")},asObject:function(e,t){var i="function"==typeof e?e:Object,a=(0,ss.getRules)(e,t);return is({validate:function(e,t){for(var r in a){var n=null!=a[r].from?a[r].from:(0,ss.defaultNameMapping)(r);if(null==e[n]){if(!0===a[r].optional)continue;throw(0,ds.newError)("Mapped object did not include required field ".concat(t," with key ").concat(n,"."))}null!=a[r].validate&&a[r].validate(e[n],"".concat(t,"[").concat(r,"]"))}},convert:function(e,t){var r,n=new i;for(r in a){var o=null!=a[r].from?a[r].from:(0,ss.defaultNameMapping)(r);null!=e[o]&&null!=a[r].convert?n[r]=a[r].convert(e[o],"".concat(t,"[").concat(o,"]")):n[r]=e[o]}return n},parameterConversion:function(e){var t,r={};for(t in a){var n=null!=a[t].from?a[t].from:(0,ss.defaultNameMapping)(t);null!=e[t]&&null!=a[t].parameterConversion?r[n]=a[t].parameterConversion(e[t]):r[n]=e[t]}return r}},ns.rule)}});var Ia={},_s=r&&r.__assign||function(){return(_s=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},vs=(Object.defineProperty(Ia,"__esModule",{value:!0}),u),ms=a;Ia.default={booleanProperty:function(r){return function(e,t){t.metadata[t.name]=ms.rule.asBoolean(r)}},stringProperty:function(r){return function(e,t){t.metadata[t.name]=ms.rule.asString(r)}},numberProperty:function(r){return function(e,t){t.metadata[t.name]=ms.rule.asNumber(r)}},bigIntProperty:function(r){return function(e,t){t.metadata[t.name]=ms.rule.asBigInt(r)}},integerProperty:function(r){return function(e,t){t.metadata[t.name]=ms.rule.asInteger(r)}},nodeProperty:function(r){return function(e,t){t.metadata[t.name]=ms.rule.asNode(r)}},relationshipProperty:function(r){return function(e,t){t.metadata[t.name]=ms.rule.asRelationship(r)}},pathProperty:function(r){return function(e,t){t.metadata[t.name]=ms.rule.asPath(r)}},pointProperty:function(r){return function(e,t){t.metadata[t.name]=ms.rule.asPoint(r)}},durationProperty:function(r){return function(e,t){t.metadata[t.name]=ms.rule.asDuration(r)}},localTimeProperty:function(r){return function(e,t){t.metadata[t.name]=ms.rule.asLocalTime(r)}},timeProperty:function(r){return function(e,t){t.metadata[t.name]=ms.rule.asTime(r)}},dateProperty:function(r){return function(e,t){t.metadata[t.name]=ms.rule.asDate(r)}},localDateTimeProperty:function(r){return function(e,t){t.metadata[t.name]=ms.rule.asLocalDateTime(r)}},dateTimeProperty:function(r){return function(e,t){t.metadata[t.name]=ms.rule.asDateTime(r)}},listProperty:function(r){return function(e,t){t.metadata[t.name]=ms.rule.asList(_s({apply:_s({},t.metadata[t.name])},r))}},vectorProperty:function(r){return function(e,t){t.metadata[t.name]=ms.rule.asVector(r)}},uuidProperty:function(r){return function(e,t){t.metadata[t.name]=ms.rule.asUUID(r)}},objectProperty:function(r,n){return function(e,t){t.metadata[t.name]=ms.rule.asObject(r,n)}},optionalProperty:function(){return function(e,t){t.metadata[t.name]=_s({optional:!0},t.metadata[t.name])}},mapPropertyFromName:function(r){return function(e,t){t.metadata[t.name]=_s({from:r},t.metadata[t.name])}},convertPropertyToType:function(r){return function(e,t){t.metadata[t.name]=_s({convert:function(e){return e.as(r)}},t.metadata[t.name])}},mappedClass:function(){return function(e,t){vs.rulesRegistry[t.name]=t.metadata}}};var T={},gs=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},Os=r&&r.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||((n=n||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},E=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ws=(Object.defineProperty(T,"__esModule",{value:!0}),T.BoltProvider=void 0,t),Es=E(R);function Ps(e,t,r){this._boltVersions=e,this._defaultMajorVersion=t,this._alloc=r,this._defaultBolt=null==(e=this._boltVersions.get(this._defaultMajorVersion))?void 0:e.bolt}Ps.prototype.encodeValue=function(e){var t=new Ss;return this._defaultBolt._createPacker(t).packable(e,this._defaultBolt.transformer.toStructure)(),t.buffer()},Ps.prototype.encodeAAD=function(e,t){var r=this._boltVersions.get(t.getMajor().toString());if(!0===(null==r?void 0:r.version.isGreaterOrEqualTo(t)))return r=new Ss,this._defaultBolt._createPacker(r).packable(e,this._defaultBolt.transformer.toStructure)(),r.buffer();throw(0,ws.newError)("Could not encode provided AAD as it was encoded with an unsupported encoding scheme")},Ps.prototype.decodeValue=function(e,t){var r=this._boltVersions.get(t.getMajor().toString());return!0===(null==r?void 0:r.version.isGreaterOrEqualTo(t))?r.bolt.unpack(this._alloc(e)):new Es.default("Undecryptable Value",t.getMajor(),t.getMinor(),"Encrypted value was encoded with a newer driver, you must update your driver version to decode it.")},Ps.prototype.encodeObject=function(e){var e=this._defaultBolt.transformer.toStructure(e),t=new Ss;return t.writeInt8(1),this._defaultBolt._createPacker(t).packable(e,this._defaultBolt.transformer.toStructure)(),new Int8Array(t.buffer())},Ps.prototype.decodeObject=function(e){if(0===e.length)throw(0,ws.newError)("Empty byte array provided as ciphertext to decryption.");if(1!==e[0])throw(0,ws.newError)("Object is encoded with version ".concat(e[0],", this driver only supports version 1."));var t=this._defaultBolt.transformer,e=this._alloc(e.buffer.slice(1)),r=this._defaultBolt.unpack(e);if(!1!==e.hasRemaining())throw(0,ws.newError)("Found data remaining after decoding ciphertext and metadata, unclean decode.");return t.fromStructure(r)},T.BoltProvider=Ps;Ts.prototype.writeUInt8=function(e){this._checkLength(1),new DataView(this._list.buffer).setUint8(this._location,e),this._location+=1},Ts.prototype.writeInt8=function(e){this._checkLength(1),new DataView(this._list.buffer).setInt8(this._location,e),this._location+=1},Ts.prototype.writeInt16=function(e){this._checkLength(2),new DataView(this._list.buffer).setInt16(this._location,e),this._location+=2},Ts.prototype.writeInt32=function(e){this._checkLength(4),new DataView(this._list.buffer).setInt32(this._location,e),this._location+=4},Ts.prototype.writeFloat64=function(e){this._checkLength(8),new DataView(this._list.buffer).setFloat64(this._location,e),this._location+=8},Ts.prototype.writeBytes=function(e){var t=new Int8Array(e._buffer);this._checkLength(t.byteLength);for(var r=0;r<t.byteLength;r++)this.writeInt8(t[r])},Ts.prototype.buffer=function(){return this._list.slice(0,this._location).buffer},Ts.prototype._checkLength=function(e){this._location+e>=this._list.byteLength&&(e=new Int8Array(1e5),e=new Int8Array(Os(Os([],gs(this._list),!1),gs(e),!1)),this._list=e)};var Ss=Ts;function Ts(){this._list=new Int8Array(1e5),this._location=0}var ro={},js=r&&r.__awaiter||function(e,a,u,s){return new(u=u||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof u?t:new u(function(e){e(t)})).then(n,o)}i((s=s.apply(e,a||[])).next())})},Cs=r&&r.__generator||function(n,o){var i,a,u,s={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,a&&(u=2&t[0]?a.return:t[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,t[1])).done)return u;switch(a=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(u=0<(u=s.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3]))s.label=t[1];else if(6===t[0]&&s.label<u[1])s.label=u[1],u=t;else{if(!(u&&s.label<u[2])){u[2]&&s.ops.pop(),s.trys.pop();continue}s.label=u[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],a=0}finally{i=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Is=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},Rs=r&&r.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||((n=n||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},g=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},As=(Object.defineProperty(ro,"__esModule",{value:!0}),ro.LocalEncapsulationResult=ro.LocalKeyEncapsulationService=void 0,ro.localKeyEncapsulationService=function(e){return new ks(e)},t),Ms=g(I);Ns.prototype.encapsulate=function(e){return js(this,void 0,void 0,function(){var r,n;return Cs(this,function(e){switch(e.label){case 0:return r=this._cryptoProvider.getRandomValues(32),[4,this._cryptoProvider.encrypt(this._kek,r.buffer,void 0)];case 1:return n=e.sent(),[2,new xs(r,new Int8Array(n.cyphertext),{iv:(t=n.iv,btoa(String.fromCharCode.apply(String,Rs([],Is(t),!1))))})]}var t})})},Ns.prototype.decapsulate=function(n,o){return js(this,void 0,void 0,function(){var r;return Cs(this,function(e){switch(e.label){case 0:return r=Uint8Array.bind,[4,this._cryptoProvider.decrypt(this._kek,(t=o.iv,Uint8Array.from(atob(t),function(e){return e.charCodeAt(0)})),n.buffer,void 0)];case 1:return[2,new(r.apply(Uint8Array,[void 0,e.sent()]))]}var t})})};var ks=Ns;function Ns(e){if(32!==e.byteLength)throw(0,As.newError)("LocalKeyEncapsualationService master key must be of byteLength 32 (256 bits), got ".concat(e.byteLength," (").concat(8*e.byteLength," bits)"));this._kek=e,this._cryptoProvider=new Ms.default}ro.LocalKeyEncapsulationService=ks;Ds.prototype.encapsulation=function(){return this._encapsulation},Ds.prototype.options=function(){return this._options},Ds.prototype.key=function(){return this._dek};var xs=Ds;function Ds(e,t,r){this._dek=e,this._encapsulation=t,this._options=r}ro.LocalEncapsulationResult=xs;var Us,Ls,Fs,Bs,Vs,qs,Ws,zs,Hs,Gs,Ks,Ys,Zs,Qs,Xs,Js,$s,ec,tc,rc,nc,oc,ic,ac,uc,sc,cc,Kr={},lc=r&&r.__awaiter||function(e,a,u,s){return new(u=u||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof u?t:new u(function(e){e(t)})).then(n,o)}i((s=s.apply(e,a||[])).next())})},fc=r&&r.__generator||function(n,o){var i,a,u,s={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,a&&(u=2&t[0]?a.return:t[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,t[1])).done)return u;switch(a=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(u=0<(u=s.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3]))s.label=t[1];else if(6===t[0]&&s.label<u[1])s.label=u[1],u=t;else{if(!(u&&s.label<u[2])){u[2]&&s.ops.pop(),s.trys.pop();continue}s.label=u[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],a=0}finally{i=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},pc=(Object.defineProperty(Kr,"__esModule",{value:!0}),Kr.EnvelopeEncryptionProfile=void 0,t),dc=Z,hc=F;function yc(e){var t;this.name=e.name,this.encapsulationService=e.encapsulationService,this.keyRepository=e.keyRepository,this._keyCacheEnabled=0!==e.keyCacheMaxSize,this._keyCacheTTL=null!=(t=e.keyCacheTTL)?t:9e5,this._keyCacheMaxSize=null!=(t=e.keyCacheMaxSize)?t:100,this._keyCache=new Map,this._keyCacheEnabled?this._keyAliasIndexEnabled=0!==e.keyAliasIndexMaxSize:this._keyAliasIndexEnabled=!1,this._keyAliasIndexTTL=null!=(t=e.keyAliasIndexTTL)?t:15e3,this._keyAliasIndexMaxSize=null!=(t=e.keyAliasIndexMaxSize)?t:100,this._aliasIndex=new Map,this.type="ENVELOPE",this.version=(0,dc.int)(1)}yc.prototype.findKey=function(r){return lc(this,void 0,void 0,function(){var t;return fc(this,function(e){switch(e.label){case 0:return"string"!=typeof r?[3,2]:[4,this._findById(r)];case 1:return t=e.sent(),[3,7];case 2:return null==r.id?[3,4]:[4,this._findById(r.id)];case 3:return t=e.sent(),[3,7];case 4:return null==r.alias?[3,6]:[4,this._findByAlias(r.alias)];case 5:return t=e.sent(),[3,7];case 6:throw(0,pc.newError)("invalid key options: ".concat((0,hc.stringify)(r)));case 7:return[2,t]}})})},yc.prototype.saveKey=function(r,n,o){return lc(this,void 0,void 0,function(){var t;return fc(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.keyRepository.create(r,n,o)];case 1:return[2,e.sent()];case 2:throw t=e.sent(),(0,pc.newError)("Call to EncapsulatedKeyRepository.create threw error, see cause","50N42",t);case 3:return[2]}})})},yc.prototype._findById=function(o){return lc(this,void 0,void 0,function(){var t,r,n;return fc(this,function(e){switch(e.label){case 0:if(this._keyCacheEnabled&&null!=(t=this._keyCache.get(o))){if((new Date).getTime()-(null!=(n=null==t?void 0:t.retrieved.getTime())?n:0)<(null!=(n=this._keyCacheTTL)?n:0))return[2,null==t?void 0:t.entry];this._keyCache.delete(o)}e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.keyRepository.findById(o)];case 2:return r=e.sent(),[3,4];case 3:throw n=e.sent(),(0,pc.newError)("Call to EncapsulatedKeyRepository.findById threw error, see cause","50N42",n);case 4:return null==r?[2,void 0]:(this._keyCache.set(o,{entry:r,retrieved:new Date}),this._pruneCache(this._keyCache,this._keyCacheMaxSize),[2,r])}})})},yc.prototype._findByAlias=function(o){return lc(this,void 0,void 0,function(){var t,r,n;return fc(this,function(e){switch(e.label){case 0:return this._keyAliasIndexEnabled?null==(t=this._aliasIndex.get(o))?[3,3]:(new Date).getTime()-(null!=(n=null==t?void 0:t.retrieved.getTime())?n:0)<(null!=(n=this._keyAliasIndexTTL)?n:0)?[4,this._findById(null==t?void 0:t.entry)]:[3,2]:[3,3];case 1:return[2,e.sent()];case 2:this._aliasIndex.delete(o),e.label=3;case 3:return e.trys.push([3,5,,6]),[4,this.keyRepository.findByAlias(o)];case 4:return r=e.sent(),[3,6];case 5:throw n=e.sent(),(0,pc.newError)("Call to EncapsulatedKeyRepository.findByAlias threw error, see cause","50N42",n);case 6:return null==r?[2,void 0]:(this._aliasIndex.set(o,{entry:r.id(),retrieved:new Date}),this._keyCache.set(r.id(),{entry:r,retrieved:new Date}),this._pruneCache(this._aliasIndex,this._keyAliasIndexMaxSize),this._pruneCache(this._keyCache,this._keyCacheMaxSize),[2,r])}})})},yc.prototype._pruneCache=function(e,t){if(e.size>t)for(var r=Array.from(e.entries()),n=(r.sort(function(e,t){return e[1].retrieved.getTime()-t[1].retrieved.getTime()}),0);e.size>t;)e.delete(r[n][0]),n++},Kr.EnvelopeEncryptionProfile=yc,E=e,Ls=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),Fs=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),g=r&&r.__importStar||(Us=function(e){return(Us=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=Us(e),n=0;n<r.length;n++)"default"!==r[n]&&Ls(t,e,r[n]);return Fs(t,e),t}),I=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(E,"__esModule",{value:!0}),E.Stats=E.QueryStatistics=E.ProfiledPlan=E.QueryProfile=E.Plan=E.GqlStatusObject=E.Notification=E.ServerInfo=E.queryType=E.ResultSummary=E.Record=E.isPathSegment=E.PathSegment=E.isPath=E.Path=E.isUnboundRelationship=E.UnboundRelationship=E.isRelationship=E.Relationship=E.isNode=E.Node=E.Time=E.LocalTime=E.LocalDateTime=E.isTime=E.isLocalTime=E.isLocalDateTime=E.isDuration=E.isDateTime=E.isDate=E.Duration=E.DateTime=E.Date=E.Point=E.isPoint=E.internal=E.toString=E.toNumber=E.inSafeRange=E.isInt=E.int=E.Integer=E.error=E.isRetriableError=E.isRetryableError=E.GQLError=E.newGQLError=E.Neo4jError=E.newError=E.authTokenManagers=void 0,E.EncryptionService=E.EnvelopeEncryptionProfile=E.localKeyEncapsulationService=E.LocalKeyEncapsulationService=E.BoltProvider=E.isEnc=E.EncryptedValue=E.uuid=E.isUUID=E.UUID=E.isUnsupportedType=E.UnsupportedType=E.StandardCase=E.RecordObjectMapping=E.mappingDecorators=E.rule=E.ProtocolVersion=E.vector=E.Vector=E.isVector=E.resolveCertificateProvider=E.clientCertificateProviders=E.notificationFilterMinimumSeverityLevel=E.notificationFilterDisabledClassification=E.notificationFilterDisabledCategory=E.notificationSeverityLevel=E.notificationClassification=E.notificationCategory=E.resultTransformers=E.routing=E.staticAuthTokenManager=E.bookmarkManager=E.auth=E.json=E.driver=E.types=E.Driver=E.Session=E.TransactionPromise=E.ManagedTransaction=E.Transaction=E.Connection=E.Releasable=E.ConnectionProvider=E.EagerResult=E.Result=void 0,Bs=t,Object.defineProperty(E,"newError",{enumerable:!0,get:function(){return Bs.newError}}),Object.defineProperty(E,"Neo4jError",{enumerable:!0,get:function(){return Bs.Neo4jError}}),Object.defineProperty(E,"newGQLError",{enumerable:!0,get:function(){return Bs.newGQLError}}),Object.defineProperty(E,"GQLError",{enumerable:!0,get:function(){return Bs.GQLError}}),Object.defineProperty(E,"isRetryableError",{enumerable:!0,get:function(){return Bs.isRetryableError}}),Object.defineProperty(E,"isRetriableError",{enumerable:!0,get:function(){return Bs.isRetriableError}}),Vs=g(Z),E.Integer=Vs.default,Object.defineProperty(E,"int",{enumerable:!0,get:function(){return Vs.int}}),Object.defineProperty(E,"isInt",{enumerable:!0,get:function(){return Vs.isInt}}),Object.defineProperty(E,"inSafeRange",{enumerable:!0,get:function(){return Vs.inSafeRange}}),Object.defineProperty(E,"toNumber",{enumerable:!0,get:function(){return Vs.toNumber}}),Object.defineProperty(E,"toString",{enumerable:!0,get:function(){return Vs.toString}}),qs=i,Object.defineProperty(E,"Date",{enumerable:!0,get:function(){return qs.Date}}),Object.defineProperty(E,"DateTime",{enumerable:!0,get:function(){return qs.DateTime}}),Object.defineProperty(E,"Duration",{enumerable:!0,get:function(){return qs.Duration}}),Object.defineProperty(E,"isDate",{enumerable:!0,get:function(){return qs.isDate}}),Object.defineProperty(E,"isDateTime",{enumerable:!0,get:function(){return qs.isDateTime}}),Object.defineProperty(E,"isDuration",{enumerable:!0,get:function(){return qs.isDuration}}),Object.defineProperty(E,"isLocalDateTime",{enumerable:!0,get:function(){return qs.isLocalDateTime}}),Object.defineProperty(E,"isLocalTime",{enumerable:!0,get:function(){return qs.isLocalTime}}),Object.defineProperty(E,"isTime",{enumerable:!0,get:function(){return qs.isTime}}),Object.defineProperty(E,"LocalDateTime",{enumerable:!0,get:function(){return qs.LocalDateTime}}),Object.defineProperty(E,"LocalTime",{enumerable:!0,get:function(){return qs.LocalTime}}),Object.defineProperty(E,"Time",{enumerable:!0,get:function(){return qs.Time}}),Ws=p,Object.defineProperty(E,"Node",{enumerable:!0,get:function(){return Ws.Node}}),Object.defineProperty(E,"isNode",{enumerable:!0,get:function(){return Ws.isNode}}),Object.defineProperty(E,"Relationship",{enumerable:!0,get:function(){return Ws.Relationship}}),Object.defineProperty(E,"isRelationship",{enumerable:!0,get:function(){return Ws.isRelationship}}),Object.defineProperty(E,"UnboundRelationship",{enumerable:!0,get:function(){return Ws.UnboundRelationship}}),Object.defineProperty(E,"isUnboundRelationship",{enumerable:!0,get:function(){return Ws.isUnboundRelationship}}),Object.defineProperty(E,"Path",{enumerable:!0,get:function(){return Ws.Path}}),Object.defineProperty(E,"isPath",{enumerable:!0,get:function(){return Ws.isPath}}),Object.defineProperty(E,"PathSegment",{enumerable:!0,get:function(){return Ws.PathSegment}}),Object.defineProperty(E,"isPathSegment",{enumerable:!0,get:function(){return Ws.isPathSegment}}),t=I(h),E.Record=t.default,zs=l,Object.defineProperty(E,"isPoint",{enumerable:!0,get:function(){return zs.isPoint}}),Object.defineProperty(E,"Point",{enumerable:!0,get:function(){return zs.Point}}),Hs=g(y),E.ResultSummary=Hs.default,Object.defineProperty(E,"queryType",{enumerable:!0,get:function(){return Hs.queryType}}),Object.defineProperty(E,"ServerInfo",{enumerable:!0,get:function(){return Hs.ServerInfo}}),Object.defineProperty(E,"Plan",{enumerable:!0,get:function(){return Hs.Plan}}),Object.defineProperty(E,"QueryProfile",{enumerable:!0,get:function(){return Hs.QueryProfile}}),Object.defineProperty(E,"ProfiledPlan",{enumerable:!0,get:function(){return Hs.ProfiledPlan}}),Object.defineProperty(E,"QueryStatistics",{enumerable:!0,get:function(){return Hs.QueryStatistics}}),Object.defineProperty(E,"Stats",{enumerable:!0,get:function(){return Hs.Stats}}),Gs=g(b),E.GqlStatusObject=Gs.default,Object.defineProperty(E,"Notification",{enumerable:!0,get:function(){return Gs.Notification}}),Object.defineProperty(E,"notificationCategory",{enumerable:!0,get:function(){return Gs.notificationCategory}}),Object.defineProperty(E,"notificationClassification",{enumerable:!0,get:function(){return Gs.notificationClassification}}),Object.defineProperty(E,"notificationSeverityLevel",{enumerable:!0,get:function(){return Gs.notificationSeverityLevel}}),Ks=_,Object.defineProperty(E,"notificationFilterDisabledCategory",{enumerable:!0,get:function(){return Ks.notificationFilterDisabledCategory}}),Object.defineProperty(E,"notificationFilterDisabledClassification",{enumerable:!0,get:function(){return Ks.notificationFilterDisabledClassification}}),Object.defineProperty(E,"notificationFilterMinimumSeverityLevel",{enumerable:!0,get:function(){return Ks.notificationFilterMinimumSeverityLevel}}),Z=I(n),E.Result=Z.default,i=I(co),E.EagerResult=i.default,Ys=g(B),E.ConnectionProvider=Ys.default,Object.defineProperty(E,"Releasable",{enumerable:!0,get:function(){return Ys.Releasable}}),p=I(uo),E.Connection=p.default,h=I(C),E.Transaction=h.default,l=I(so),E.ManagedTransaction=l.default,y=I(P),E.TransactionPromise=y.default,b=I(bo),E.Session=b.default,_=g(o),n=_,E.Driver=_.default,E.driver=n,co=I(Da),E.auth=co.default,Zs=S,Object.defineProperty(E,"bookmarkManager",{enumerable:!0,get:function(){return Zs.bookmarkManager}}),Qs=Ar,Object.defineProperty(E,"authTokenManagers",{enumerable:!0,get:function(){return Qs.authTokenManagers}}),Object.defineProperty(E,"staticAuthTokenManager",{enumerable:!0,get:function(){return Qs.staticAuthTokenManager}}),Xs=o,Object.defineProperty(E,"routing",{enumerable:!0,get:function(){return Xs.routing}}),B=g(w),E.types=B,uo=g(F),E.json=uo,C=I(m),E.resultTransformers=C.default,Js=j,Object.defineProperty(E,"clientCertificateProviders",{enumerable:!0,get:function(){return Js.clientCertificateProviders}}),Object.defineProperty(E,"resolveCertificateProvider",{enumerable:!0,get:function(){return Js.resolveCertificateProvider}}),so=g(v),E.internal=so,$s=Wr,Object.defineProperty(E,"ProtocolVersion",{enumerable:!0,get:function(){return $s.ProtocolVersion}}),ec=g(ba),E.Vector=ec.default,Object.defineProperty(E,"vector",{enumerable:!0,get:function(){return ec.vector}}),Object.defineProperty(E,"isVector",{enumerable:!0,get:function(){return ec.isVector}}),tc=pe,Object.defineProperty(E,"StandardCase",{enumerable:!0,get:function(){return tc.StandardCase}}),rc=u,Object.defineProperty(E,"RecordObjectMapping",{enumerable:!0,get:function(){return rc.RecordObjectMapping}}),nc=a,Object.defineProperty(E,"rule",{enumerable:!0,get:function(){return nc.rule}}),P=I(Ia),E.mappingDecorators=P.default,oc=g(R),E.UnsupportedType=oc.default,Object.defineProperty(E,"isUnsupportedType",{enumerable:!0,get:function(){return oc.isUnsupportedType}}),ic=g(wa),E.UUID=ic.default,Object.defineProperty(E,"uuid",{enumerable:!0,get:function(){return ic.uuid}}),Object.defineProperty(E,"isUUID",{enumerable:!0,get:function(){return ic.isUUID}}),ac=O,Object.defineProperty(E,"EncryptedValue",{enumerable:!0,get:function(){return ac.EncryptedValue}}),Object.defineProperty(E,"isEnc",{enumerable:!0,get:function(){return ac.isEnc}}),uc=T,Object.defineProperty(E,"BoltProvider",{enumerable:!0,get:function(){return uc.BoltProvider}}),sc=ro,Object.defineProperty(E,"localKeyEncapsulationService",{enumerable:!0,get:function(){return sc.localKeyEncapsulationService}}),Object.defineProperty(E,"LocalKeyEncapsulationService",{enumerable:!0,get:function(){return sc.LocalKeyEncapsulationService}}),cc=Kr,Object.defineProperty(E,"EnvelopeEncryptionProfile",{enumerable:!0,get:function(){return cc.EnvelopeEncryptionProfile}}),g=I(Xn),E.EncryptionService=g.default,I={SERVICE_UNAVAILABLE:Bs.SERVICE_UNAVAILABLE,SESSION_EXPIRED:Bs.SESSION_EXPIRED,PROTOCOL_ERROR:Bs.PROTOCOL_ERROR},I={authTokenManagers:Qs.authTokenManagers,newError:Bs.newError,Neo4jError:Bs.Neo4jError,newGQLError:Bs.newGQLError,GQLError:Bs.GQLError,isRetryableError:Bs.isRetryableError,isRetriableError:Bs.isRetriableError,error:E.error=I,Integer:Vs.default,int:Vs.int,isInt:Vs.isInt,inSafeRange:Vs.inSafeRange,toNumber:Vs.toNumber,toString:Vs.toString,internal:so,isPoint:zs.isPoint,Point:zs.Point,Date:qs.Date,DateTime:qs.DateTime,Duration:qs.Duration,isDate:qs.isDate,isDateTime:qs.isDateTime,isDuration:qs.isDuration,isLocalDateTime:qs.isLocalDateTime,isLocalTime:qs.isLocalTime,isTime:qs.isTime,LocalDateTime:qs.LocalDateTime,LocalTime:qs.LocalTime,Time:qs.Time,Node:Ws.Node,isNode:Ws.isNode,Relationship:Ws.Relationship,isRelationship:Ws.isRelationship,UnboundRelationship:Ws.UnboundRelationship,isUnboundRelationship:Ws.isUnboundRelationship,Path:Ws.Path,isPath:Ws.isPath,PathSegment:Ws.PathSegment,isPathSegment:Ws.isPathSegment,Record:t.default,ResultSummary:Hs.default,queryType:Hs.queryType,ServerInfo:Hs.ServerInfo,Notification:Gs.Notification,GqlStatusObject:Gs.default,Plan:Hs.Plan,QueryProfile:Hs.QueryProfile,ProfiledPlan:Hs.ProfiledPlan,QueryStatistics:Hs.QueryStatistics,Stats:Hs.Stats,Result:Z.default,EagerResult:i.default,Transaction:h.default,ManagedTransaction:l.default,TransactionPromise:y.default,Session:b.default,Driver:_.default,Connection:p.default,Releasable:Ys.Releasable,types:B,driver:n,json:uo,auth:co.default,bookmarkManager:Zs.bookmarkManager,routing:Xs.routing,resultTransformers:C.default,notificationCategory:Gs.notificationCategory,notificationClassification:Gs.notificationClassification,notificationSeverityLevel:Gs.notificationSeverityLevel,notificationFilterDisabledCategory:Ks.notificationFilterDisabledCategory,notificationFilterDisabledClassification:Ks.notificationFilterDisabledClassification,notificationFilterMinimumSeverityLevel:Ks.notificationFilterMinimumSeverityLevel,clientCertificateProviders:Js.clientCertificateProviders,resolveCertificateProvider:Js.resolveCertificateProvider,ProtocolVersion:$s.ProtocolVersion,rule:nc.rule,mappingDecorators:P.default,RecordObjectMapping:rc.RecordObjectMapping,StandardCase:tc.StandardCase,UnsupportedType:oc.default,isUnsupportedType:oc.isUnsupportedType,isVector:ec.isVector,vector:ec.vector,isUUID:ic.isUUID,uuid:ic.uuid,EncryptedValue:ac.EncryptedValue,isEnc:ac.isEnc,BoltProvider:uc.BoltProvider,LocalKeyEncapsulationService:sc.LocalKeyEncapsulationService,localKeyEncapsulationService:sc.localKeyEncapsulationService,EnvelopeEncryptionProfile:cc.EnvelopeEncryptionProfile,EncryptionService:g.default},E.default=I;bo={},Da={},S={},Ar={},o={};Object.defineProperty(o,"__esModule",{value:!0}),o.isFunction=void 0,o.isFunction=function(e){return"function"==typeof e};w={},F={},m={};Object.defineProperty(m,"__esModule",{value:!0}),m.createErrorClass=void 0,m.createErrorClass=function(e){return(e=e(function(e){Error.call(e),e.stack=(new Error).stack})).prototype=Object.create(Error.prototype),e.prototype.constructor=e},Object.defineProperty(F,"__esModule",{value:!0}),F.UnsubscriptionError=void 0;j=m,F.UnsubscriptionError=j.createErrorClass(function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map(function(e,t){return t+1+") "+e.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}),v={};Object.defineProperty(v,"__esModule",{value:!0}),v.arrRemove=void 0,v.arrRemove=function(e,t){e&&0<=(t=e.indexOf(t))&&e.splice(t,1)};var bc=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},_c=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},vc=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},mc=(Object.defineProperty(w,"__esModule",{value:!0}),w.isSubscription=w.EMPTY_SUBSCRIPTION=w.Subscription=void 0,o),gc=F,Oc=v,wc=(Ec.prototype.unsubscribe=function(){var t,e,r;if(!this.closed){this.closed=!0;var n=this._parentage;if(n)if(this._parentage=null,Array.isArray(n))try{for(var o=bc(n),i=o.next();!i.done;i=o.next())i.value.remove(this)}catch(e){u={error:e}}finally{try{i&&!i.done&&(a=o.return)&&a.call(o)}finally{if(u)throw u.error}}else n.remove(this);var a=this.initialTeardown;if(mc.isFunction(a))try{a()}catch(e){r=e instanceof gc.UnsubscriptionError?e.errors:[e]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var s=bc(u),c=s.next();!c.done;c=s.next()){var l=c.value;try{Pc(l)}catch(e){r=null!=r?r:[],e instanceof gc.UnsubscriptionError?r=vc(vc([],_c(r)),_c(e.errors)):r.push(e)}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}}if(r)throw new gc.UnsubscriptionError(r)}},Ec.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)Pc(e);else{if(e instanceof Ec){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!=(t=this._finalizers)?t:[]).push(e)}},Ec.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},Ec.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},Ec.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Oc.arrRemove(t,e)},Ec.prototype.remove=function(e){var t=this._finalizers;t&&Oc.arrRemove(t,e),e instanceof Ec&&e._removeParent(this)},Ec.EMPTY=((Wr=new Ec).closed=!0,Wr),Ec);function Ec(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}function Pc(e){mc.isFunction(e)?e():e.unsubscribe()}w.Subscription=wc,w.EMPTY_SUBSCRIPTION=wc.EMPTY,w.isSubscription=function(e){return e instanceof wc||e&&"closed"in e&&mc.isFunction(e.remove)&&mc.isFunction(e.add)&&mc.isFunction(e.unsubscribe)};var Sc,Tc,jc,ba={},pe=(Object.defineProperty(ba,"__esModule",{value:!0}),ba.config=void 0,ba.config={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},{}),u={},Cc=(Sc=u,Tc=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},jc=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Object.defineProperty(Sc,"__esModule",{value:!0}),Sc.timeoutProvider=void 0,Sc.timeoutProvider={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=Sc.timeoutProvider.delegate;return null!=o&&o.setTimeout?o.setTimeout.apply(o,jc([e,t],Tc(r))):setTimeout.apply(void 0,jc([e,t],Tc(r)))},clearTimeout:function(e){var t=Sc.timeoutProvider.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0},Object.defineProperty(pe,"__esModule",{value:!0}),pe.reportUnhandledError=void 0,ba),Ic=u;pe.reportUnhandledError=function(t){Ic.timeoutProvider.setTimeout(function(){var e=Cc.config.onUnhandledError;if(!e)throw t;e(t)})};a={};Object.defineProperty(a,"__esModule",{value:!0}),a.noop=void 0,a.noop=function(){};Ia={};function Rc(e,t,r){return{kind:e,value:t,error:r}}Object.defineProperty(Ia,"__esModule",{value:!0}),Ia.createNotification=Ia.nextNotification=Ia.errorNotification=Ia.COMPLETE_NOTIFICATION=void 0,Ia.COMPLETE_NOTIFICATION=Rc("C",void 0,void 0),Ia.errorNotification=function(e){return Rc("E",void 0,e)},Ia.nextNotification=function(e){return Rc("N",e,void 0)},Ia.createNotification=Rc;var Ac,Mc,kc,Nc,xc,Dc,Uc,Lc,Fc,Bc,Vc,qc,Wc,zc,R={},Hc=(Object.defineProperty(R,"__esModule",{value:!0}),R.captureError=R.errorContext=void 0,ba),Gc=null;function Kc(e){var t=kc.call(this)||this;return t.isStopped=!1,e?(t.destination=e,xc.isSubscription(e)&&e.add(t)):t.destination=Ac.EMPTY_OBSERVER,t}function Yc(e,t){return Vc.call(e,t)}function Zc(e){this.partialObserver=e}function Qc(e,t,r){var n=Wc.call(this)||this;return r=Nc.isFunction(e)||!e?{next:null!=e?e:void 0,error:null!=t?t:void 0,complete:null!=r?r:void 0}:n&&Dc.config.useDeprecatedNextContext?((t=Object.create(e)).unsubscribe=function(){return n.unsubscribe()},{next:e.next&&Yc(e.next,t),error:e.error&&Yc(e.error,t),complete:e.complete&&Yc(e.complete,t)}):e,n.destination=new qc(r),n}function Xc(e){Dc.config.useDeprecatedSynchronousErrorHandling?Bc.captureError(e):Uc.reportUnhandledError(e)}function Jc(e,t){var r=Dc.config.onStoppedNotification;r&&Fc.timeoutProvider.setTimeout(function(){return r(e,t)})}R.errorContext=function(e){if(Hc.config.useDeprecatedSynchronousErrorHandling){var t=!Gc;if(t&&(Gc={errorThrown:!1,error:null}),e(),t){var t=Gc,r=t.errorThrown;if(Gc=null,r)throw t.error}}else e()},R.captureError=function(e){Hc.config.useDeprecatedSynchronousErrorHandling&&Gc&&(Gc.errorThrown=!0,Gc.error=e)},Ac=Ar,wa=r&&r.__extends||(Mc=function(e,t){return(Mc=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Mc(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Object.defineProperty(Ac,"__esModule",{value:!0}),Ac.EMPTY_OBSERVER=Ac.SafeSubscriber=Ac.Subscriber=void 0,Nc=o,Dc=ba,Uc=pe,O=a,Lc=Ia,Fc=u,Bc=R,kc=(xc=w).Subscription,wa(Kc,kc),Kc.create=function(e,t,r){return new zc(e,t,r)},Kc.prototype.next=function(e){this.isStopped?Jc(Lc.nextNotification(e),this):this._next(e)},Kc.prototype.error=function(e){this.isStopped?Jc(Lc.errorNotification(e),this):(this.isStopped=!0,this._error(e))},Kc.prototype.complete=function(){this.isStopped?Jc(Lc.COMPLETE_NOTIFICATION,this):(this.isStopped=!0,this._complete())},Kc.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,kc.prototype.unsubscribe.call(this),this.destination=null)},Kc.prototype._next=function(e){this.destination.next(e)},Kc.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},Kc.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},T=Kc,Ac.Subscriber=T,Vc=Function.prototype.bind,Zc.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){Xc(e)}},Zc.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){Xc(e)}else Xc(e)},Zc.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){Xc(e)}},qc=Zc,wa(Qc,Wc=T),zc=Qc,Ac.SafeSubscriber=zc,Ac.EMPTY_OBSERVER={closed:!0,next:O.noop,error:function(e){throw e},complete:O.noop};ro={},Object.defineProperty(ro,"__esModule",{value:!0}),ro.observable=void 0,ro.observable="function"==typeof Symbol&&Symbol.observable||"@@observable",Kr={},Xn={};Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.identity=void 0,Xn.identity=function(e){return e},Object.defineProperty(Kr,"__esModule",{value:!0}),Kr.pipeFromArray=Kr.pipe=void 0;var $c=Xn;function el(t){return 0===t.length?$c.identity:1===t.length?t[0]:function(e){return t.reduce(function(e,t){return t(e)},e)}}Kr.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return el(e)},Kr.pipeFromArray=el,Object.defineProperty(S,"__esModule",{value:!0}),S.Observable=void 0;var tl=Ar,rl=w,so=ro,nl=Kr,ol=ba,il=o,al=R;function ul(e){e&&(this._subscribe=e)}function sl(e){return null!=(e=null!=e?e:ol.config.Promise)?e:Promise}ul.prototype.lift=function(e){var t=new ul;return t.source=this,t.operator=e,t},ul.prototype.subscribe=function(e,t,r){var n,o=this,i=(n=e)&&n instanceof tl.Subscriber||(e=>e&&il.isFunction(e.next)&&il.isFunction(e.error)&&il.isFunction(e.complete))(n)&&rl.isSubscription(n)?e:new tl.SafeSubscriber(e,t,r);return al.errorContext(function(){var e=o.operator,t=o.source;i.add(e?e.call(i,t):t?o._subscribe(i):o._trySubscribe(i))}),i},ul.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},ul.prototype.forEach=function(n,e){var o=this;return new(e=sl(e))(function(e,t){var r=new tl.SafeSubscriber({next:function(e){try{n(e)}catch(e){t(e),r.unsubscribe()}},error:t,complete:e});o.subscribe(r)})},ul.prototype._subscribe=function(e){var t;return null==(t=this.source)?void 0:t.subscribe(e)},ul.prototype[so.observable]=function(){return this},ul.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return nl.pipeFromArray(e)(this)},ul.prototype.toPromise=function(e){var n=this;return new(e=sl(e))(function(e,t){var r;n.subscribe(function(e){return r=e},function(e){return t(e)},function(){return e(r)})})},ul.create=function(e){return new ul(e)},S.Observable=ul;var t={},Z={},i={},cl=(Object.defineProperty(i,"__esModule",{value:!0}),i.operate=i.hasLift=void 0,o);function ll(e){return cl.isFunction(null==e?void 0:e.lift)}i.hasLift=ll,i.operate=function(t){return function(e){if(ll(e))return e.lift(function(e){try{return t(e,this)}catch(e){this.error(e)}});throw new TypeError("Unable to lift unknown Observable type")}};var fl,h={},l=r&&r.__extends||(fl=function(e,t){return(fl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}fl(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),y=(Object.defineProperty(h,"__esModule",{value:!0}),h.OperatorSubscriber=h.createOperatorSubscriber=void 0,Ar);h.createOperatorSubscriber=function(e,t,r,n,o){return new dl(e,t,r,n,o)};l(hl,pl=y.Subscriber),hl.prototype.unsubscribe=function(){var e;this.shouldUnsubscribe&&!this.shouldUnsubscribe()||(e=this.closed,pl.prototype.unsubscribe.call(this),e)||null==(e=this.onFinalize)||e.call(this)};var pl,dl=hl;function hl(t,r,e,n,o,i){var a=pl.call(this,t)||this;return a.onFinalize=o,a.shouldUnsubscribe=i,a._next=r?function(e){try{r(e)}catch(e){t.error(e)}}:pl.prototype._next,a._error=n?function(e){try{n(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:pl.prototype._error,a._complete=e?function(){try{e()}catch(e){t.error(e)}finally{this.unsubscribe()}}:pl.prototype._complete,a}h.OperatorSubscriber=dl,Object.defineProperty(Z,"__esModule",{value:!0}),Z.refCount=void 0;var yl=i,bl=h;Z.refCount=function(){return yl.operate(function(r,n){var o=null,e=(r._refCount++,bl.createOperatorSubscriber(n,void 0,void 0,void 0,function(){var e,t;!r||r._refCount<=0||0<--r._refCount?o=null:(e=r._connection,t=o,o=null,!e||t&&e!==t||e.unsubscribe(),n.unsubscribe())}));r.subscribe(e),e.closed||(o=r.connect())})};var _l,b=r&&r.__extends||(_l=function(e,t){return(_l=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}_l(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectableObservable=void 0;var vl,ml=w,gl=Z,Ol=h,wl=i,_=(vl=S.Observable,b(El,vl),El.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},El.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},El.prototype._teardown=function(){this._refCount=0;var e=this._connection;(this._subject=this._connection=null)!=e&&e.unsubscribe()},El.prototype.connect=function(){var t,r=this,e=this._connection;return e||(e=this._connection=new ml.Subscription,t=this.getSubject(),e.add(this.source.subscribe(Ol.createOperatorSubscriber(t,void 0,function(){r._teardown(),t.complete()},function(e){r._teardown(),t.error(e)},function(){return r._teardown()}))),e.closed&&(this._connection=null,e=ml.Subscription.EMPTY)),e},El.prototype.refCount=function(){return gl.refCount()(this)},El);function El(e,t){var r=vl.call(this)||this;return r.source=e,r.subjectFactory=t,r._subject=null,r._refCount=0,r._connection=null,wl.hasLift(e)&&(r.lift=e.lift),r}t.ConnectableObservable=_;var Pl,Sl,Tl,jl,Cl,p={},B={},n=(Pl=B,Object.defineProperty(Pl,"__esModule",{value:!0}),Pl.performanceTimestampProvider=void 0,Pl.performanceTimestampProvider={now:function(){return(Pl.performanceTimestampProvider.delegate||performance).now()},delegate:void 0},{}),Il=(Sl=n,Tl=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},jl=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Object.defineProperty(Sl,"__esModule",{value:!0}),Sl.animationFrameProvider=void 0,Cl=w,Sl.animationFrameProvider={schedule:function(t){var e=requestAnimationFrame,r=cancelAnimationFrame,n=Sl.animationFrameProvider.delegate,o=(n&&(e=n.requestAnimationFrame,r=n.cancelAnimationFrame),e(function(e){r=void 0,t(e)}));return new Cl.Subscription(function(){return null==r?void 0:r(o)})},requestAnimationFrame:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Sl.animationFrameProvider.delegate;return((null==r?void 0:r.requestAnimationFrame)||requestAnimationFrame).apply(void 0,jl([],Tl(e)))},cancelAnimationFrame:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Sl.animationFrameProvider.delegate;return((null==r?void 0:r.cancelAnimationFrame)||cancelAnimationFrame).apply(void 0,jl([],Tl(e)))},delegate:void 0},Object.defineProperty(p,"__esModule",{value:!0}),p.animationFrames=void 0,S),Rl=B,Al=n;function Ml(u){return new Il.Observable(function(r){var n=u||Rl.performanceTimestampProvider,o=n.now(),i=0,a=function(){r.closed||(i=Al.animationFrameProvider.requestAnimationFrame(function(e){i=0;var t=n.now();r.next({timestamp:u?t:e,elapsed:t-o}),a()}))};return a(),function(){i&&Al.animationFrameProvider.cancelAnimationFrame(i)}})}p.animationFrames=function(e){return e?Ml(e):xl};var kl,Nl,xl=Ml(),uo={},co={},C=(Object.defineProperty(co,"__esModule",{value:!0}),co.ObjectUnsubscribedError=void 0,m),P=(co.ObjectUnsubscribedError=C.createErrorClass(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),r&&r.__extends||(kl=function(e,t){return(kl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}kl(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),Dl=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ul=(Object.defineProperty(uo,"__esModule",{value:!0}),uo.AnonymousSubject=uo.Subject=void 0,S),Ll=w,Fl=co,Bl=v,Vl=R,g=(Nl=Ul.Observable,P(ql,Nl),ql.prototype.lift=function(e){var t=new zl(this,this);return t.operator=e,t},ql.prototype._throwIfClosed=function(){if(this.closed)throw new Fl.ObjectUnsubscribedError},ql.prototype.next=function(o){var i=this;Vl.errorContext(function(){var t,e;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var r=Dl(i.currentObservers),n=r.next();!n.done;n=r.next())n.value.next(o)}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}}})},ql.prototype.error=function(t){var r=this;Vl.errorContext(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=t;for(var e=r.observers;e.length;)e.shift().error(t)}})},ql.prototype.complete=function(){var t=this;Vl.errorContext(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}})},ql.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(ql.prototype,"observed",{get:function(){var e;return 0<(null==(e=this.observers)?void 0:e.length)},enumerable:!1,configurable:!0}),ql.prototype._trySubscribe=function(e){return this._throwIfClosed(),Nl.prototype._trySubscribe.call(this,e)},ql.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},ql.prototype._innerSubscribe=function(e){var t=this,r=this.hasError,n=this.isStopped,o=this.observers;return r||n?Ll.EMPTY_SUBSCRIPTION:(this.currentObservers=null,o.push(e),new Ll.Subscription(function(){t.currentObservers=null,Bl.arrRemove(o,e)}))},ql.prototype._checkFinalizedStatuses=function(e){var t=this.hasError,r=this.thrownError,n=this.isStopped;t?e.error(r):n&&e.complete()},ql.prototype.asObservable=function(){var e=new Ul.Observable;return e.source=this,e},ql.create=function(e,t){return new zl(e,t)},ql);function ql(){var e=Nl.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}uo.Subject=g;P(Hl,Wl=g),Hl.prototype.next=function(e){var t,r;null!=(r=null==(t=this.destination)?void 0:t.next)&&r.call(t,e)},Hl.prototype.error=function(e){var t,r;null!=(r=null==(t=this.destination)?void 0:t.error)&&r.call(t,e)},Hl.prototype.complete=function(){var e,t;null!=(t=null==(e=this.destination)?void 0:e.complete)&&t.call(e)},Hl.prototype._subscribe=function(e){var t;return null!=(t=null==(t=this.source)?void 0:t.subscribe(e))?t:Ll.EMPTY_SUBSCRIPTION};var Wl,zl=Hl;function Hl(e,t){var r=Wl.call(this)||this;return r.destination=e,r.source=t,r}uo.AnonymousSubject=zl;var Gl,E={},I=r&&r.__extends||(Gl=function(e,t){return(Gl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Gl(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(E,"__esModule",{value:!0}),E.BehaviorSubject=void 0;Kl=uo.Subject,I(Yl,Kl),Object.defineProperty(Yl.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),Yl.prototype._subscribe=function(e){var t=Kl.prototype._subscribe.call(this,e);return t.closed||e.next(this._value),t},Yl.prototype.getValue=function(){var e=this.hasError,t=this.thrownError,r=this._value;if(e)throw t;return this._throwIfClosed(),r},Yl.prototype.next=function(e){Kl.prototype.next.call(this,this._value=e)};var Kl,j=Yl;function Yl(e){var t=Kl.call(this)||this;return t._value=e,t}E.BehaviorSubject=j;var Zl,Ql,Wr={},Ia={},u=(Zl=Ia,Object.defineProperty(Zl,"__esModule",{value:!0}),Zl.dateTimestampProvider=void 0,Zl.dateTimestampProvider={now:function(){return(Zl.dateTimestampProvider.delegate||Date).now()},delegate:void 0},r&&r.__extends||(Ql=function(e,t){return(Ql=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ql(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}));Object.defineProperty(Wr,"__esModule",{value:!0}),Wr.ReplaySubject=void 0;var Xl,Jl=Ia,wa=(Xl=uo.Subject,u($l,Xl),$l.prototype.next=function(e){var t=this.isStopped,r=this._buffer,n=this._infiniteTimeWindow,o=this._timestampProvider,i=this._windowTime;t||(r.push(e),n)||r.push(o.now()+i),this._trimBuffer(),Xl.prototype.next.call(this,e)},$l.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),r=this._infiniteTimeWindow,n=this._buffer.slice(),o=0;o<n.length&&!e.closed;o+=r?1:2)e.next(n[o]);return this._checkFinalizedStatuses(e),t},$l.prototype._trimBuffer=function(){var e=this._bufferSize,t=this._timestampProvider,r=this._buffer,n=this._infiniteTimeWindow,o=(n?1:2)*e;if(e<1/0&&o<r.length&&r.splice(0,r.length-o),!n){for(var i=t.now(),a=0,u=1;u<r.length&&r[u]<=i;u+=2)a=u;a&&r.splice(0,a+1)}},$l);function $l(e,t,r){void 0===e&&(e=1/0),void 0===t&&(t=1/0),void 0===r&&(r=Jl.dateTimestampProvider);var n=Xl.call(this)||this;return n._bufferSize=e,n._windowTime=t,n._timestampProvider=r,n._buffer=[],n._infiniteTimeWindow=!0,n._infiniteTimeWindow=t===1/0,n._bufferSize=Math.max(1,e),n._windowTime=Math.max(1,t),n}Wr.ReplaySubject=wa;var ef,T={},O=r&&r.__extends||(ef=function(e,t){return(ef=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ef(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(T,"__esModule",{value:!0}),T.AsyncSubject=void 0;tf=uo.Subject,O(rf,tf),rf.prototype._checkFinalizedStatuses=function(e){var t=this.hasError,r=this._hasValue,n=this._value,o=this.thrownError,i=this.isStopped,a=this._isComplete;t?e.error(o):(i||a)&&(r&&e.next(n),e.complete())},rf.prototype.next=function(e){this.isStopped||(this._value=e,this._hasValue=!0)},rf.prototype.complete=function(){var e=this._hasValue,t=this._value;this._isComplete||(this._isComplete=!0,e&&tf.prototype.next.call(this,t),tf.prototype.complete.call(this))};var tf,so=rf;function rf(){var e=null!==tf&&tf.apply(this,arguments)||this;return e._value=null,e._hasValue=!1,e._isComplete=!1,e}T.AsyncSubject=so;var nf,l={},y={},b={},_={},B=r&&r.__extends||(nf=function(e,t){return(nf=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}nf(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(_,"__esModule",{value:!0}),_.Action=void 0;of=w.Subscription,B(af,of),af.prototype.schedule=function(e,t){return this};var of,C=af;function af(e,t){return of.call(this)||this}_.Action=C;var uf,sf,cf,lf,R={},P=(uf=R,sf=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},cf=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Object.defineProperty(uf,"__esModule",{value:!0}),uf.intervalProvider=void 0,uf.intervalProvider={setInterval:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=uf.intervalProvider.delegate;return null!=o&&o.setInterval?o.setInterval.apply(o,cf([e,t],sf(r))):setInterval.apply(void 0,cf([e,t],sf(r)))},clearInterval:function(e){var t=uf.intervalProvider.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},r&&r.__extends||(lf=function(e,t){return(lf=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}lf(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}));Object.defineProperty(b,"__esModule",{value:!0}),b.AsyncAction=void 0;var ff,pf=R,df=v,g=(ff=_.Action,P(hf,ff),hf.prototype.schedule=function(e,t){var r;return void 0===t&&(t=0),this.closed||(this.state=e,e=this.id,r=this.scheduler,null!=e&&(this.id=this.recycleAsyncId(r,e,t)),this.pending=!0,this.delay=t,this.id=null!=(e=this.id)?e:this.requestAsyncId(r,this.id,t)),this},hf.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),pf.intervalProvider.setInterval(e.flush.bind(e,this),r)},hf.prototype.recycleAsyncId=function(e,t,r){if(null!=(r=void 0===r?0:r)&&this.delay===r&&!1===this.pending)return t;null!=t&&pf.intervalProvider.clearInterval(t)},hf.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;e=this._execute(e,t);if(e)return e;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},hf.prototype._execute=function(e,t){var r,n=!1;try{this.work(e)}catch(e){n=!0,r=e||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),r},hf.prototype.unsubscribe=function(){var e,t,r;this.closed||(e=this.id,r=(t=this.scheduler).actions,this.work=this.state=this.scheduler=null,this.pending=!1,df.arrRemove(r,this),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null,ff.prototype.unsubscribe.call(this))},hf);function hf(e,t){var r=ff.call(this,e,t)||this;return r.scheduler=e,r.work=t,r.pending=!1,r}b.AsyncAction=g;var yf,bf,_f,vf,mf,gf,I={},j={},Of=(Object.defineProperty(j,"__esModule",{value:!0}),j.TestTools=j.Immediate=void 0,1),wf={};function Ef(e){return e in wf&&(delete wf[e],!0)}j.Immediate={setImmediate:function(e){var t=Of++;return wf[t]=!0,(yf=yf||Promise.resolve()).then(function(){return Ef(t)&&e()}),t},clearImmediate:function(e){Ef(e)}},j.TestTools={pending:function(){return Object.keys(wf).length}},bf=I,_f=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},vf=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Object.defineProperty(bf,"__esModule",{value:!0}),bf.immediateProvider=void 0,mf=j.Immediate.setImmediate,gf=j.Immediate.clearImmediate,bf.immediateProvider={setImmediate:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=bf.immediateProvider.delegate;return((null==r?void 0:r.setImmediate)||mf).apply(void 0,vf([],_f(e)))},clearImmediate:function(e){var t=bf.immediateProvider.delegate;return((null==t?void 0:t.clearImmediate)||gf)(e)},delegate:void 0};var Pf,u=r&&r.__extends||(Pf=function(e,t){return(Pf=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Pf(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(y,"__esModule",{value:!0}),y.AsapAction=void 0;var Sf,Tf=I,wa=(Sf=b.AsyncAction,u(jf,Sf),jf.prototype.requestAsyncId=function(e,t,r){return null!==(r=void 0===r?0:r)&&0<r?Sf.prototype.requestAsyncId.call(this,e,t,r):(e.actions.push(this),e._scheduled||(e._scheduled=Tf.immediateProvider.setImmediate(e.flush.bind(e,void 0))))},jf.prototype.recycleAsyncId=function(e,t,r){if(null!=(r=void 0===r?0:r)?0<r:0<this.delay)return Sf.prototype.recycleAsyncId.call(this,e,t,r);var r=e.actions;null!=t&&(null==(r=r[r.length-1])?void 0:r.id)!==t&&(Tf.immediateProvider.clearImmediate(t),e._scheduled===t)&&(e._scheduled=void 0)},jf);function jf(e,t){var r=Sf.call(this,e,t)||this;return r.scheduler=e,r.work=t,r}y.AsapAction=wa;O={},so={},B={},Object.defineProperty(B,"__esModule",{value:!0}),B.Scheduler=void 0,C=Ia;function Cf(e,t){void 0===t&&(t=Cf.now),this.schedulerActionCtor=e,this.now=t}Cf.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(r,t)},Cf.now=C.dateTimestampProvider.now,B.Scheduler=Cf;var If,Rf,R=r&&r.__extends||(If=function(e,t){return(If=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}If(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Af=(Object.defineProperty(so,"__esModule",{value:!0}),so.AsyncScheduler=void 0,B),_=(Rf=Af.Scheduler,R(Mf,Rf),Mf.prototype.flush=function(e){var t,r=this.actions;if(this._active)r.push(e);else{this._active=!0;do{if(t=e.execute(e.state,e.delay))break}while(e=r.shift());if(this._active=!1,t){for(;e=r.shift();)e.unsubscribe();throw t}}},Mf);function Mf(e,t){void 0===t&&(t=Af.Scheduler.now);e=Rf.call(this,e,t)||this;return e.actions=[],e._active=!1,e}so.AsyncScheduler=_;var kf,P=r&&r.__extends||(kf=function(e,t){return(kf=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}kf(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(O,"__esModule",{value:!0}),O.AsapScheduler=void 0;Nf=so.AsyncScheduler,P(xf,Nf),xf.prototype.flush=function(e){this._active=!0;var t,r=this._scheduled,n=(this._scheduled=void 0,this.actions);e=e||n.shift();do{if(t=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===r&&n.shift());if(this._active=!1,t){for(;(e=n[0])&&e.id===r&&n.shift();)e.unsubscribe();throw t}};var Nf,g=xf;function xf(){return null!==Nf&&Nf.apply(this,arguments)||this}O.AsapScheduler=g,j=l,Object.defineProperty(j,"__esModule",{value:!0}),j.asap=j.asapScheduler=void 0,j.asapScheduler=new O.AsapScheduler(y.AsapAction),j.asap=j.asapScheduler;var Df,I={},wa=(u=I,Object.defineProperty(u,"__esModule",{value:!0}),u.async=u.asyncScheduler=void 0,u.asyncScheduler=new so.AsyncScheduler(b.AsyncAction),u.async=u.asyncScheduler,{}),C={},R=r&&r.__extends||(Df=function(e,t){return(Df=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Df(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(C,"__esModule",{value:!0}),C.QueueAction=void 0;Uf=b.AsyncAction,R(Lf,Uf),Lf.prototype.schedule=function(e,t){return 0<(t=void 0===t?0:t)?Uf.prototype.schedule.call(this,e,t):(this.delay=t,this.state=e,this.scheduler.flush(this),this)},Lf.prototype.execute=function(e,t){return 0<t||this.closed?Uf.prototype.execute.call(this,e,t):this._execute(e,t)},Lf.prototype.requestAsyncId=function(e,t,r){return null!=(r=void 0===r?0:r)&&0<r||null==r&&0<this.delay?Uf.prototype.requestAsyncId.call(this,e,t,r):(e.flush(this),0)};var Uf,_=Lf;function Lf(e,t){var r=Uf.call(this,e,t)||this;return r.scheduler=e,r.work=t,r}C.QueueAction=_;var Ff,P={},g=r&&r.__extends||(Ff=function(e,t){return(Ff=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ff(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(P,"__esModule",{value:!0}),P.QueueScheduler=void 0;Bf=so.AsyncScheduler,g(Vf,Bf);var Bf,O=Vf;function Vf(){return null!==Bf&&Bf.apply(this,arguments)||this}P.QueueScheduler=O,y=wa,Object.defineProperty(y,"__esModule",{value:!0}),y.queue=y.queueScheduler=void 0,y.queueScheduler=new P.QueueScheduler(C.QueueAction),y.queue=y.queueScheduler;var qf,j={},u={},R=r&&r.__extends||(qf=function(e,t){return(qf=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}qf(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(u,"__esModule",{value:!0}),u.AnimationFrameAction=void 0;var Wf,zf=n,_=(Wf=b.AsyncAction,R(Hf,Wf),Hf.prototype.requestAsyncId=function(e,t,r){return null!==(r=void 0===r?0:r)&&0<r?Wf.prototype.requestAsyncId.call(this,e,t,r):(e.actions.push(this),e._scheduled||(e._scheduled=zf.animationFrameProvider.requestAnimationFrame(function(){return e.flush(void 0)})))},Hf.prototype.recycleAsyncId=function(e,t,r){if(null!=(r=void 0===r?0:r)?0<r:0<this.delay)return Wf.prototype.recycleAsyncId.call(this,e,t,r);var r=e.actions;null!=t&&t===e._scheduled&&(null==(r=r[r.length-1])?void 0:r.id)!==t&&(zf.animationFrameProvider.cancelAnimationFrame(t),e._scheduled=void 0)},Hf);function Hf(e,t){var r=Wf.call(this,e,t)||this;return r.scheduler=e,r.work=t,r}u.AnimationFrameAction=_;var Gf,g={},O=r&&r.__extends||(Gf=function(e,t){return(Gf=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Gf(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(g,"__esModule",{value:!0}),g.AnimationFrameScheduler=void 0;Kf=so.AsyncScheduler,O(Yf,Kf),Yf.prototype.flush=function(e){this._active=!0,e?t=e.id:(t=this._scheduled,this._scheduled=void 0);var t,r,n=this.actions;e=e||n.shift();do{if(r=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}};var Kf,P=Yf;function Yf(){return null!==Kf&&Kf.apply(this,arguments)||this}g.AnimationFrameScheduler=P,C=j,Object.defineProperty(C,"__esModule",{value:!0}),C.animationFrame=C.animationFrameScheduler=void 0,C.animationFrameScheduler=new g.AnimationFrameScheduler(u.AnimationFrameAction),C.animationFrame=C.animationFrameScheduler;var Zf,Qf,y={},n=r&&r.__extends||(Zf=function(e,t){return(Zf=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Zf(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),R=(Object.defineProperty(y,"__esModule",{value:!0}),y.VirtualAction=y.VirtualTimeScheduler=void 0,b),Xf=w,_=(Qf=so.AsyncScheduler,n(Jf,Qf),Jf.prototype.flush=function(){for(var e,t,r=this.actions,n=this.maxFrames;(t=r[0])&&t.delay<=n&&(r.shift(),this.frame=t.delay,!(e=t.execute(t.state,t.delay))););if(e){for(;t=r.shift();)t.unsubscribe();throw e}},Jf.frameTimeFactor=10,Jf);function Jf(e,t){void 0===t&&(t=1/0);var r=Qf.call(this,e=void 0===e?ep:e,function(){return r.frame})||this;return r.maxFrames=t,r.frame=0,r.index=-1,r}y.VirtualTimeScheduler=_;$f=R.AsyncAction,n(tp,$f),tp.prototype.schedule=function(e,t){if(void 0===t&&(t=0),Number.isFinite(t)){if(!this.id)return $f.prototype.schedule.call(this,e,t);this.active=!1;var r=new tp(this.scheduler,this.work);return this.add(r),r.schedule(e,t)}return Xf.Subscription.EMPTY},tp.prototype.requestAsyncId=function(e,t,r){this.delay=e.frame+(r=void 0===r?0:r);r=e.actions;return r.push(this),r.sort(tp.sortActions),1},tp.prototype.recycleAsyncId=function(e,t,r){},tp.prototype._execute=function(e,t){if(!0===this.active)return $f.prototype._execute.call(this,e,t)},tp.sortActions=function(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1};var $f,ep=tp;function tp(e,t,r){void 0===r&&(r=e.index+=1);var n=$f.call(this,e,t)||this;return n.scheduler=e,n.work=t,n.index=r,n.active=!0,n.index=e.index=r,n}y.VirtualAction=ep;var rp,np,O={},P={},g=(rp=P,Object.defineProperty(rp,"__esModule",{value:!0}),rp.empty=rp.EMPTY=void 0,np=S,rp.EMPTY=new np.Observable(function(e){return e.complete()}),rp.empty=function(e){return e?(t=e,new np.Observable(function(e){return t.schedule(function(){return e.complete()})})):rp.EMPTY;var t},{}),u={},C={},op=(Object.defineProperty(C,"__esModule",{value:!0}),C.isScheduler=void 0,o);C.isScheduler=function(e){return e&&op.isFunction(e.schedule)},Object.defineProperty(u,"__esModule",{value:!0}),u.popNumber=u.popScheduler=u.popResultSelector=void 0;var ip=o,ap=C;function up(e){return e[e.length-1]}u.popResultSelector=function(e){return ip.isFunction(up(e))?e.pop():void 0},u.popScheduler=function(e){return ap.isScheduler(up(e))?e.pop():void 0},u.popNumber=function(e,t){return"number"==typeof up(e)?e.pop():t};var b={},so={},_={},R={},n={},sp=(Object.defineProperty(n,"__esModule",{value:!0}),n.isArrayLike=void 0,n.isArrayLike=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e},{}),cp=(Object.defineProperty(sp,"__esModule",{value:!0}),sp.isPromise=void 0,o);sp.isPromise=function(e){return cp.isFunction(null==e?void 0:e.then)};var lp={},fp=(Object.defineProperty(lp,"__esModule",{value:!0}),lp.isInteropObservable=void 0,ro),pp=o;lp.isInteropObservable=function(e){return pp.isFunction(e[fp.observable])};var dp={},hp=(Object.defineProperty(dp,"__esModule",{value:!0}),dp.isAsyncIterable=void 0,o);dp.isAsyncIterable=function(e){return Symbol.asyncIterator&&hp.isFunction(null==e?void 0:e[Symbol.asyncIterator])};var yp={};Object.defineProperty(yp,"__esModule",{value:!0}),yp.createInvalidObservableTypeError=void 0,yp.createInvalidObservableTypeError=function(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")};var bp={},_p={};function vp(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}Object.defineProperty(_p,"__esModule",{value:!0}),_p.iterator=_p.getSymbolIterator=void 0,_p.getSymbolIterator=vp,_p.iterator=vp(),Object.defineProperty(bp,"__esModule",{value:!0}),bp.isIterable=void 0;var mp=_p,gp=o;bp.isIterable=function(e){return gp.isFunction(null==e?void 0:e[mp.iterator])};var Op={},wp=r&&r.__generator||function(n,o){var i,a,u,s={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,a&&(u=2&t[0]?a.return:t[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,t[1])).done)return u;switch(a=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(u=0<(u=s.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3]))s.label=t[1];else if(6===t[0]&&s.label<u[1])s.label=u[1],u=t;else{if(!(u&&s.label<u[2])){u[2]&&s.ops.pop(),s.trys.pop();continue}s.label=u[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],a=0}finally{i=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Ep=r&&r.__await||function(e){return this instanceof Ep?(this.v=e,this):new Ep(e)},Pp=r&&r.__asyncGenerator||function(e,t,r){var o,i,a;if(Symbol.asyncIterator)return o=r.apply(e,t||[]),i=[],a={},n("next"),n("throw"),n("return"),a[Symbol.asyncIterator]=function(){return this},a;throw new TypeError("Symbol.asyncIterator is not defined.");function n(n){o[n]&&(a[n]=function(r){return new Promise(function(e,t){1<i.push([n,r,e,t])||u(n,r)})})}function u(e,t){try{(r=o[e](t)).value instanceof Ep?Promise.resolve(r.value.v).then(s,c):l(i[0][2],r)}catch(e){l(i[0][3],e)}var r}function s(e){u("next",e)}function c(e){u("throw",e)}function l(e,t){e(t),i.shift(),i.length&&u(i[0][0],i[0][1])}},Sp=(Object.defineProperty(Op,"__esModule",{value:!0}),Op.isReadableStreamLike=Op.readableStreamLikeToAsyncGenerator=void 0,o);Op.readableStreamLikeToAsyncGenerator=function(o){return Pp(this,arguments,function(){var t,r,n;return wp(this,function(e){switch(e.label){case 0:t=o.getReader(),e.label=1;case 1:e.trys.push([1,,9,10]),e.label=2;case 2:return[4,Ep(t.read())];case 3:return(r=e.sent(),n=r.value,r.done)?[4,Ep(void 0)]:[3,5];case 4:return[2,e.sent()];case 5:return[4,Ep(n)];case 6:return[4,e.sent()];case 7:return e.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})},Op.isReadableStreamLike=function(e){return Sp.isFunction(null==e?void 0:e.getReader)};var Tp=r&&r.__awaiter||function(e,a,u,s){return new(u=u||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof u?t:new u(function(e){e(t)})).then(n,o)}i((s=s.apply(e,a||[])).next())})},jp=r&&r.__generator||function(n,o){var i,a,u,s={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,a&&(u=2&t[0]?a.return:t[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,t[1])).done)return u;switch(a=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(u=0<(u=s.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3]))s.label=t[1];else if(6===t[0]&&s.label<u[1])s.label=u[1],u=t;else{if(!(u&&s.label<u[2])){u[2]&&s.ops.pop(),s.trys.pop();continue}s.label=u[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],a=0}finally{i=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Cp=r&&r.__asyncValues||function(a){var e,t;if(Symbol.asyncIterator)return(e=a[Symbol.asyncIterator])?e.call(a):(a="function"==typeof Ip?Ip(a):a[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);throw new TypeError("Symbol.asyncIterator is not defined.");function r(i){t[i]=a[i]&&function(o){return new Promise(function(e,t){var r,n;o=a[i](o),r=e,e=t,n=o.done,t=o.value,Promise.resolve(t).then(function(e){r({value:e,done:n})},e)})}}},Ip=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Rp=(Object.defineProperty(R,"__esModule",{value:!0}),R.fromReadableStreamLike=R.fromAsyncIterable=R.fromIterable=R.fromPromise=R.fromArrayLike=R.fromInteropObservable=R.innerFrom=void 0,n),Ap=sp,Mp=S,kp=lp,Np=dp,xp=yp,Dp=bp,Up=Op,Lp=o,Fp=pe,Bp=ro;function Vp(r){return new Mp.Observable(function(e){var t=r[Bp.observable]();if(Lp.isFunction(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function qp(r){return new Mp.Observable(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()})}function Wp(e){return new Mp.Observable(function(t){e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,Fp.reportUnhandledError)})}function zp(a){return new Mp.Observable(function(e){var t,r;try{for(var n=Ip(a),o=n.next();!o.done;o=n.next()){var i=o.value;if(e.next(i),e.closed)return}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}e.complete()})}function Hp(e){return new Mp.Observable(function(t){!function(r,n){var o,i,a,u;return Tp(this,void 0,void 0,function(){var t;return jp(this,function(e){switch(e.label){case 0:e.trys.push([0,5,6,11]),o=Cp(r),e.label=1;case 1:return[4,o.next()];case 2:if((i=e.sent()).done)return[3,4];if(t=i.value,n.next(t),n.closed)return[2];e.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return t=e.sent(),a={error:t},[3,11];case 6:return(e.trys.push([6,,9,10]),i&&!i.done&&(u=o.return))?[4,u.call(o)]:[3,8];case 7:e.sent(),e.label=8;case 8:return[3,10];case 9:if(a)throw a.error;return[7];case 10:return[7];case 11:return n.complete(),[2]}})})}(e,t).catch(function(e){return t.error(e)})})}function Gp(e){return Hp(Up.readableStreamLikeToAsyncGenerator(e))}R.innerFrom=function(e){if(e instanceof Mp.Observable)return e;if(null!=e){if(kp.isInteropObservable(e))return Vp(e);if(Rp.isArrayLike(e))return qp(e);if(Ap.isPromise(e))return Wp(e);if(Np.isAsyncIterable(e))return Hp(e);if(Dp.isIterable(e))return zp(e);if(Up.isReadableStreamLike(e))return Gp(e)}throw xp.createInvalidObservableTypeError(e)},R.fromInteropObservable=Vp,R.fromArrayLike=qp,R.fromPromise=Wp,R.fromIterable=zp,R.fromAsyncIterable=Hp,R.fromReadableStreamLike=Gp;var pe={},Kp={};Object.defineProperty(Kp,"__esModule",{value:!0}),Kp.executeSchedule=void 0,Kp.executeSchedule=function(e,t,r,n,o){if(void 0===n&&(n=0),void 0===o&&(o=!1),t=t.schedule(function(){r(),o?e.add(this.schedule(null,n)):this.unsubscribe()},n),e.add(t),!o)return t},Object.defineProperty(pe,"__esModule",{value:!0}),pe.observeOn=void 0;var Yp=Kp,Zp=i,Qp=h;pe.observeOn=function(r,n){return void 0===n&&(n=0),Zp.operate(function(e,t){e.subscribe(Qp.createOperatorSubscriber(t,function(e){return Yp.executeSchedule(t,r,function(){return t.next(e)},n)},function(){return Yp.executeSchedule(t,r,function(){return t.complete()},n)},function(e){return Yp.executeSchedule(t,r,function(){return t.error(e)},n)}))})};var Xp={},Jp=(Object.defineProperty(Xp,"__esModule",{value:!0}),Xp.subscribeOn=void 0,i);Xp.subscribeOn=function(r,n){return void 0===n&&(n=0),Jp.operate(function(e,t){t.add(r.schedule(function(){return e.subscribe(t)},n))})},Object.defineProperty(_,"__esModule",{value:!0}),_.scheduleObservable=void 0;var $p=R,ed=pe,td=Xp;_.scheduleObservable=function(e,t){return $p.innerFrom(e).pipe(td.subscribeOn(t),ed.observeOn(t))};var rd={},nd=(Object.defineProperty(rd,"__esModule",{value:!0}),rd.schedulePromise=void 0,R),od=pe,id=Xp;rd.schedulePromise=function(e,t){return nd.innerFrom(e).pipe(id.subscribeOn(t),od.observeOn(t))};var ad={},ud=(Object.defineProperty(ad,"__esModule",{value:!0}),ad.scheduleArray=void 0,S);ad.scheduleArray=function(r,n){return new ud.Observable(function(e){var t=0;return n.schedule(function(){t===r.length?e.complete():(e.next(r[t++]),e.closed||this.schedule())})})};var sd={},cd=(Object.defineProperty(sd,"__esModule",{value:!0}),sd.scheduleIterable=void 0,S),ld=_p,fd=o,pd=Kp;sd.scheduleIterable=function(e,t){return new cd.Observable(function(n){var o;return pd.executeSchedule(n,t,function(){o=e[ld.iterator](),pd.executeSchedule(n,t,function(){var e,t,r;try{t=(e=o.next()).value,r=e.done}catch(e){return void n.error(e)}r?n.complete():n.next(t)},0,!0)}),function(){return fd.isFunction(null==o?void 0:o.return)&&o.return()}})};var _p={},dd=(Object.defineProperty(_p,"__esModule",{value:!0}),_p.scheduleAsyncIterable=void 0,S),hd=Kp;_p.scheduleAsyncIterable=function(r,n){if(r)return new dd.Observable(function(t){hd.executeSchedule(t,n,function(){var e=r[Symbol.asyncIterator]();hd.executeSchedule(t,n,function(){e.next().then(function(e){e.done?t.complete():t.next(e.value)})},0,!0)})});throw new Error("Iterable cannot be null")};var yd={},bd=(Object.defineProperty(yd,"__esModule",{value:!0}),yd.scheduleReadableStreamLike=void 0,_p),_d=Op;yd.scheduleReadableStreamLike=function(e,t){return bd.scheduleAsyncIterable(_d.readableStreamLikeToAsyncGenerator(e),t)},Object.defineProperty(so,"__esModule",{value:!0}),so.scheduled=void 0;var vd=_,md=rd,gd=ad,Od=sd,wd=_p,Ed=lp,Pd=sp,Sd=n,Td=bp,jd=dp,Cd=yp,Id=Op,Rd=yd;so.scheduled=function(e,t){if(null!=e){if(Ed.isInteropObservable(e))return vd.scheduleObservable(e,t);if(Sd.isArrayLike(e))return gd.scheduleArray(e,t);if(Pd.isPromise(e))return md.schedulePromise(e,t);if(jd.isAsyncIterable(e))return wd.scheduleAsyncIterable(e,t);if(Td.isIterable(e))return Od.scheduleIterable(e,t);if(Id.isReadableStreamLike(e))return Rd.scheduleReadableStreamLike(e,t)}throw Cd.createInvalidObservableTypeError(e)},Object.defineProperty(b,"__esModule",{value:!0}),b.from=void 0;var Ad=so,Md=R;b.from=function(e,t){return t?Ad.scheduled(e,t):Md.innerFrom(e)},Object.defineProperty(g,"__esModule",{value:!0}),g.of=void 0;var kd=u,Nd=b;g.of=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=kd.popScheduler(e);return Nd.from(e,r)};var xd,Dd,Ud,Ld,_={},Fd=(Object.defineProperty(_,"__esModule",{value:!0}),_.throwError=void 0,S),Bd=o;function Vd(e,t,r){this.kind=e,this.value=t,this.error=r,this.hasValue="N"===e}function qd(e,t){var r,n=e.kind,o=e.value,e=e.error;if("string"!=typeof n)throw new TypeError('Invalid notification, missing "kind"');"N"===n?null!=(r=t.next)&&r.call(t,o):"E"===n?null!=(r=t.error)&&r.call(t,e):null!=(o=t.complete)&&o.call(t)}_.throwError=function(e,t){function r(e){return e.error(n())}var n=Bd.isFunction(e)?e:function(){return e};return new Fd.Observable(t?function(e){return t.schedule(r,0,e)}:r)},rd=O,Object.defineProperty(rd,"__esModule",{value:!0}),rd.observeNotification=rd.Notification=rd.NotificationKind=void 0,xd=P,Dd=g,Ud=_,Ld=o,(ad=rd.NotificationKind||(rd.NotificationKind={})).NEXT="N",ad.ERROR="E",ad.COMPLETE="C",Vd.prototype.observe=function(e){return qd(this,e)},Vd.prototype.do=function(e,t,r){var n=this.kind,o=this.value,i=this.error;return"N"===n?null==e?void 0:e(o):"E"===n?null==t?void 0:t(i):null==r?void 0:r()},Vd.prototype.accept=function(e,t,r){var n;return Ld.isFunction(null==(n=e)?void 0:n.next)?this.observe(e):this.do(e,t,r)},Vd.prototype.toObservable=function(){var e=this.kind,t=this.value,r=this.error,t="N"===e?Dd.of(t):"E"===e?Ud.throwError(function(){return r}):"C"===e?xd.EMPTY:0;if(t)return t;throw new TypeError("Unexpected notification kind "+e)},Vd.createNext=function(e){return new Vd("N",e)},Vd.createError=function(e){return new Vd("E",void 0,e)},Vd.createComplete=function(){return Vd.completeNotification},Vd.completeNotification=new Vd("C"),ad=Vd,rd.Notification=ad,rd.observeNotification=qd;var _p={},Wd=(Object.defineProperty(_p,"__esModule",{value:!0}),_p.isObservable=void 0,S),zd=o;_p.isObservable=function(e){return!!e&&(e instanceof Wd.Observable||zd.isFunction(e.lift)&&zd.isFunction(e.subscribe))};var lp={},sp={},bp=(Object.defineProperty(sp,"__esModule",{value:!0}),sp.EmptyError=void 0,m),Hd=(sp.EmptyError=bp.createErrorClass(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}),Object.defineProperty(lp,"__esModule",{value:!0}),lp.lastValueFrom=void 0,sp);lp.lastValueFrom=function(o,i){var a="object"==typeof i;return new Promise(function(e,t){var r,n=!1;o.subscribe({next:function(e){r=e,n=!0},error:t,complete:function(){n?e(r):a?e(i.defaultValue):t(new Hd.EmptyError)}})})};var dp={},Gd=(Object.defineProperty(dp,"__esModule",{value:!0}),dp.firstValueFrom=void 0,sp),Kd=Ar;dp.firstValueFrom=function(n,o){var i="object"==typeof o;return new Promise(function(t,e){var r=new Kd.SafeSubscriber({next:function(e){t(e),r.unsubscribe()},error:e,complete:function(){i?t(o.defaultValue):e(new Gd.EmptyError)}});n.subscribe(r)})};var Yd,Zd,Qd,Xd,Jd,$d,eh,yp={},Op=(Object.defineProperty(yp,"__esModule",{value:!0}),yp.ArgumentOutOfRangeError=void 0,m),yd=(yp.ArgumentOutOfRangeError=Op.createErrorClass(function(e){return function(){e(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}}),{}),ad=(Object.defineProperty(yd,"__esModule",{value:!0}),yd.NotFoundError=void 0,m),rd=(yd.NotFoundError=ad.createErrorClass(function(t){return function(e){t(this),this.name="NotFoundError",this.message=e}}),{}),bp=(Object.defineProperty(rd,"__esModule",{value:!0}),rd.SequenceError=void 0,m),Op=(rd.SequenceError=bp.createErrorClass(function(t){return function(e){t(this),this.name="SequenceError",this.message=e}}),{}),ad={};function th(e){throw new Yd.TimeoutError(e)}Object.defineProperty(ad,"__esModule",{value:!0}),ad.isValidDate=void 0,ad.isValidDate=function(e){return e instanceof Date&&!isNaN(e)},Yd=Op,Object.defineProperty(Yd,"__esModule",{value:!0}),Yd.timeout=Yd.TimeoutError=void 0,Zd=I,Qd=ad,Xd=i,Jd=R,$d=h,eh=Kp,Yd.TimeoutError=m.createErrorClass(function(t){return function(e){void 0===e&&(e=null),t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=e}}),Yd.timeout=function(e,t){var u=(e=Qd.isValidDate(e)?{first:e}:"number"==typeof e?{each:e}:e).first,s=e.each,r=e.with,c=void 0===r?th:r,l=void 0===(r=e.scheduler)?null!=t?t:Zd.asyncScheduler:r,f=void 0===(t=e.meta)?null:t;if(null==u&&null==s)throw new TypeError("No timeout provided.");return Xd.operate(function(e,t){function r(e){n=eh.executeSchedule(t,l,function(){try{a.unsubscribe(),Jd.innerFrom(c({meta:f,lastValue:o,seen:i})).subscribe(t)}catch(e){t.error(e)}},e)}var n,o=null,i=0,a=e.subscribe($d.createOperatorSubscriber(t,function(e){null!=n&&n.unsubscribe(),i++,t.next(o=e),0<s&&r(s)},void 0,void 0,function(){null!=n&&n.closed||null!=n&&n.unsubscribe(),o=null}));i||r(null!=u?"number"==typeof u?u:+u-l.now():s)})};var bp={},m={},rh={},nh={},oh=(Object.defineProperty(nh,"__esModule",{value:!0}),nh.map=void 0,i),ih=h;nh.map=function(n,o){return oh.operate(function(e,t){var r=0;e.subscribe(ih.createOperatorSubscriber(t,function(e){t.next(n.call(o,e,r++))}))})};var ah=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},uh=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},sh=(Object.defineProperty(rh,"__esModule",{value:!0}),rh.mapOneOrManyArgs=void 0,nh),ch=Array.isArray;rh.mapOneOrManyArgs=function(r){return sh.map(function(e){return t=r,ch(e=e)?t.apply(void 0,uh([],ah(e))):t(e);var t})};var lh=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},fh=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},ph=(Object.defineProperty(m,"__esModule",{value:!0}),m.bindCallbackInternals=void 0,C),dh=S,hh=Xp,yh=rh,bh=pe,_h=T;m.bindCallbackInternals=function r(u,s,n,o){if(n){if(!ph.isScheduler(n))return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r(u,s,o).apply(this,e).pipe(yh.mapOneOrManyArgs(n))};o=n}return o?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r(u,s).apply(this,e).pipe(hh.subscribeOn(o),bh.observeOn(o))}:function(){for(var t=this,r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var i=new _h.AsyncSubject,a=!0;return new dh.Observable(function(e){var n,o,e=i.subscribe(e);return a&&(n=a=!1,o=!1,s.apply(t,fh(fh([],lh(r)),[function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(u){var r=e.shift();if(null!=r)return void i.error(r)}i.next(1<e.length?e:e[0]),o=!0,n&&i.complete()}])),o&&i.complete(),n=!0),e})}},Object.defineProperty(bp,"__esModule",{value:!0}),bp.bindCallback=void 0;var vh=m;bp.bindCallback=function(e,t,r){return vh.bindCallbackInternals(!1,e,t,r)};var mh={},gh=(Object.defineProperty(mh,"__esModule",{value:!0}),mh.bindNodeCallback=void 0,m);mh.bindNodeCallback=function(e,t,r){return gh.bindCallbackInternals(!0,e,t,r)};var m={},Oh={},wh=(Object.defineProperty(Oh,"__esModule",{value:!0}),Oh.argsArgArrayOrObject=void 0,Array.isArray),Eh=Object.getPrototypeOf,Ph=Object.prototype,Sh=Object.keys;Oh.argsArgArrayOrObject=function(e){if(1===e.length){var t=e[0];if(wh(t))return{args:t,keys:null};if((r=t)&&"object"==typeof r&&Eh(r)===Ph)return{args:(r=Sh(t)).map(function(e){return t[e]}),keys:r}}var r;return{args:e,keys:null}};var Th={};Object.defineProperty(Th,"__esModule",{value:!0}),Th.createObject=void 0,Th.createObject=function(e,n){return e.reduce(function(e,t,r){return e[t]=n[r],e},{})},Object.defineProperty(m,"__esModule",{value:!0}),m.combineLatestInit=m.combineLatest=void 0;var jh=S,Ch=Oh,Ih=b,Rh=Xn,Ah=rh,Mh=u,kh=Th,Nh=h,xh=Kp;function Dh(u,s,c){return void 0===c&&(c=Rh.identity),function(a){Uh(s,function(){for(var e=u.length,n=new Array(e),o=e,i=e,t=0;t<e;t++)(r=>{Uh(s,function(){var e=Ih.from(u[r],s),t=!1;e.subscribe(Nh.createOperatorSubscriber(a,function(e){n[r]=e,t||(t=!0,i--),i||a.next(c(n.slice()))},function(){--o||a.complete()}))},a)})(t)},a)}}function Uh(e,t,r){e?xh.executeSchedule(r,e,t):t()}m.combineLatest=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Mh.popScheduler(e),n=Mh.popResultSelector(e),o=Ch.argsArgArrayOrObject(e),i=o.args,a=o.keys;return 0===i.length?Ih.from([],r):(o=new jh.Observable(Dh(i,r,a?function(e){return kh.createObject(a,e)}:Rh.identity)),n?o.pipe(Ah.mapOneOrManyArgs(n)):o)},m.combineLatestInit=Dh;var Lh={},Fh={},Bh={},Vh={},qh={},Wh=(Object.defineProperty(qh,"__esModule",{value:!0}),qh.mergeInternals=void 0,R),zh=Kp,Hh=h;qh.mergeInternals=function(e,r,n,o,i,a,u,t){var s=[],c=0,l=0,f=!1,p=function(){!f||s.length||c||r.complete()},d=function(e){return c<o?h(e):s.push(e)},h=function(e){a&&r.next(e),c++;var t=!1;Wh.innerFrom(n(e,l++)).subscribe(Hh.createOperatorSubscriber(r,function(e){null!=i&&i(e),a?d(e):r.next(e)},function(){t=!0},void 0,function(){if(t)try{c--;for(;s.length&&c<o;)(()=>{var e=s.shift();u?zh.executeSchedule(r,u,function(){return h(e)}):h(e)})();p()}catch(e){r.error(e)}}))};return e.subscribe(Hh.createOperatorSubscriber(r,d,function(){f=!0,p()})),function(){null!=t&&t()}},Object.defineProperty(Vh,"__esModule",{value:!0}),Vh.mergeMap=void 0;var Gh=nh,Kh=R,Yh=i,Zh=qh,Qh=o;Vh.mergeMap=function e(o,i,r){return void 0===r&&(r=1/0),Qh.isFunction(i)?e(function(r,n){return Gh.map(function(e,t){return i(r,e,n,t)})(Kh.innerFrom(o(r,n)))},r):("number"==typeof i&&(r=i),Yh.operate(function(e,t){return Zh.mergeInternals(e,t,o,r)}))},Object.defineProperty(Bh,"__esModule",{value:!0}),Bh.mergeAll=void 0;var Xh=Vh,Jh=Xn;Bh.mergeAll=function(e){return Xh.mergeMap(Jh.identity,e=void 0===e?1/0:e)},Object.defineProperty(Fh,"__esModule",{value:!0}),Fh.concatAll=void 0;var $h=Bh;Fh.concatAll=function(){return $h.mergeAll(1)},Object.defineProperty(Lh,"__esModule",{value:!0}),Lh.concat=void 0;var ey=Fh,ty=u,ry=b;Lh.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ey.concatAll()(ry.from(e,ty.popScheduler(e)))};var ny={},oy={},iy=(Object.defineProperty(oy,"__esModule",{value:!0}),oy.defer=void 0,S),ay=R;oy.defer=function(t){return new iy.Observable(function(e){ay.innerFrom(t()).subscribe(e)})},Object.defineProperty(ny,"__esModule",{value:!0}),ny.connectable=void 0;var uy=uo,sy=S,cy=oy,ly={connector:function(){return new uy.Subject},resetOnDisconnect:!0};ny.connectable=function(e,t){var r=null,n=(t=void 0===t?ly:t).connector,o=void 0===(t=t.resetOnDisconnect)||t,i=n();return(t=new sy.Observable(function(e){return i.subscribe(e)})).connect=function(){return r&&!r.closed||(r=cy.defer(function(){return e}).subscribe(i),o&&r.add(function(){return i=n()})),r},t};var fy={},py=(Object.defineProperty(fy,"__esModule",{value:!0}),fy.forkJoin=void 0,S),dy=Oh,hy=R,yy=u,by=h,_y=rh,vy=Th;fy.forkJoin=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=yy.popResultSelector(e),a=(n=dy.argsArgArrayOrObject(e)).args,u=n.keys,n=new py.Observable(function(e){var t=a.length;if(t)for(var n=new Array(t),o=t,i=t,r=0;r<t;r++)(t=>{var r=!1;hy.innerFrom(a[t]).subscribe(by.createOperatorSubscriber(e,function(e){r||(r=!0,i--),n[t]=e},function(){return o--},void 0,function(){o&&r||(i||e.next(u?vy.createObject(u,n):n),e.complete())}))})(r);else e.complete()});return r?n.pipe(_y.mapOneOrManyArgs(r)):n};var Oh={},my=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},gy=(Object.defineProperty(Oh,"__esModule",{value:!0}),Oh.fromEvent=void 0,R),Oy=S,wy=Vh,Ey=n,Py=o,Sy=rh,Ty=["addListener","removeListener"],jy=["addEventListener","removeEventListener"],Cy=["on","off"];function Iy(r,n){return function(t){return function(e){return r[t](n,e)}}}Oh.fromEvent=function t(r,n,o,e){if(Py.isFunction(o)&&(e=o,o=void 0),e)return t(r,n,o).pipe(Sy.mapOneOrManyArgs(e));var e=my((e=r,Py.isFunction(e.addEventListener)&&Py.isFunction(e.removeEventListener)?jy.map(function(t){return function(e){return r[t](n,e,o)}}):(e=r,Py.isFunction(e.addListener)&&Py.isFunction(e.removeListener)?Ty.map(Iy(r,n)):(e=r,Py.isFunction(e.on)&&Py.isFunction(e.off)?Cy.map(Iy(r,n)):[]))),2),i=e[0],a=e[1];if(!i&&Ey.isArrayLike(r))return wy.mergeMap(function(e){return t(e,n,o)})(gy.innerFrom(r));if(i)return new Oy.Observable(function(r){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r.next(1<e.length?e:e[0])}return i(e),function(){return a(e)}});throw new TypeError("Invalid event target")};var Th={},Ry=(Object.defineProperty(Th,"__esModule",{value:!0}),Th.fromEventPattern=void 0,S),Ay=o,My=rh;Th.fromEventPattern=function e(n,o,t){return t?e(n,o).pipe(My.mapOneOrManyArgs(t)):new Ry.Observable(function(r){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r.next(1===e.length?e[0]:e)}var t=n(e);return Ay.isFunction(o)?function(){return o(e,t)}:void 0})};var n={},ky=r&&r.__generator||function(n,o){var i,a,u,s={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,a&&(u=2&t[0]?a.return:t[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,t[1])).done)return u;switch(a=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(u=0<(u=s.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3]))s.label=t[1];else if(6===t[0]&&s.label<u[1])s.label=u[1],u=t;else{if(!(u&&s.label<u[2])){u[2]&&s.ops.pop(),s.trys.pop();continue}s.label=u[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],a=0}finally{i=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Ny=(Object.defineProperty(n,"__esModule",{value:!0}),n.generate=void 0,Xn),xy=C,Dy=oy,Uy=sd;n.generate=function(e,r,n,t,o){var i,a,u;function s(){var t;return ky(this,function(e){switch(e.label){case 0:t=u,e.label=1;case 1:return r&&!r(t)?[3,4]:[4,a(t)];case 2:e.sent(),e.label=3;case 3:return t=n(t),[3,1];case 4:return[2]}})}return 1===arguments.length?(u=e.initialState,r=e.condition,n=e.iterate,a=void 0===(i=e.resultSelector)?Ny.identity:i,o=e.scheduler):(u=e,!t||xy.isScheduler(t)?(a=Ny.identity,o=t):a=t),Dy.defer(o?function(){return Uy.scheduleIterable(s(),o)}:s)};var sd={},Ly=(Object.defineProperty(sd,"__esModule",{value:!0}),sd.iif=void 0,oy);sd.iif=function(e,t,r){return Ly.defer(function(){return e()?t:r})};var Fy={},By={},Vy=(Object.defineProperty(By,"__esModule",{value:!0}),By.timer=void 0,S),qy=I,Wy=C,zy=ad;By.timer=function(n,e,o){void 0===n&&(n=0),void 0===o&&(o=qy.async);var i=-1;return null!=e&&(Wy.isScheduler(e)?o=e:i=e),new Vy.Observable(function(e){var t=zy.isValidDate(n)?+n-o.now():n,r=0;return o.schedule(function(){e.closed||(e.next(r++),0<=i?this.schedule(void 0,i):e.complete())},t=t<0?0:t)})},Object.defineProperty(Fy,"__esModule",{value:!0}),Fy.interval=void 0;var Hy=I,Gy=By;Fy.interval=function(e,t){return Gy.timer(e=(e=void 0===e?0:e)<0?0:e,e,t=void 0===t?Hy.asyncScheduler:t)};var C={},Ky=(Object.defineProperty(C,"__esModule",{value:!0}),C.merge=void 0,Bh),Yy=R,Zy=P,Qy=u,Xy=b;C.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Qy.popScheduler(e),n=Qy.popNumber(e,1/0),o=e;return o.length?1===o.length?Yy.innerFrom(o[0]):Ky.mergeAll(n)(Xy.from(o,r)):Zy.EMPTY};var Jy,$y={},eb=(Jy=$y,Object.defineProperty(Jy,"__esModule",{value:!0}),Jy.never=Jy.NEVER=void 0,Jy.NEVER=new S.Observable(a.noop),Jy.never=function(){return Jy.NEVER},{}),tb={},rb=(Object.defineProperty(tb,"__esModule",{value:!0}),tb.argsOrArgArray=void 0,Array.isArray);tb.argsOrArgArray=function(e){return 1===e.length&&rb(e[0])?e[0]:e},Object.defineProperty(eb,"__esModule",{value:!0}),eb.onErrorResumeNext=void 0;var nb=S,ob=tb,ib=h,ab=a,ub=R;eb.onErrorResumeNext=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=ob.argsOrArgArray(e);return new nb.Observable(function(r){var n=0,o=function(){if(n<i.length){var e=void 0;try{e=ub.innerFrom(i[n++])}catch(e){return void o()}var t=new ib.OperatorSubscriber(r,void 0,ab.noop,ab.noop);e.subscribe(t),t.add(o)}else r.complete()};o()})};var sb={},cb=(Object.defineProperty(sb,"__esModule",{value:!0}),sb.pairs=void 0,b);sb.pairs=function(e,t){return cb.from(Object.entries(e),t)};var M={},lb={};Object.defineProperty(lb,"__esModule",{value:!0}),lb.not=void 0,lb.not=function(r,n){return function(e,t){return!r.call(n,e,t)}};var fb={},pb=(Object.defineProperty(fb,"__esModule",{value:!0}),fb.filter=void 0,i),db=h;fb.filter=function(n,o){return pb.operate(function(e,t){var r=0;e.subscribe(db.createOperatorSubscriber(t,function(e){return n.call(o,e,r++)&&t.next(e)}))})},Object.defineProperty(M,"__esModule",{value:!0}),M.partition=void 0;var hb=lb,yb=fb,bb=R;M.partition=function(e,t,r){return[yb.filter(t,r)(bb.innerFrom(e)),yb.filter(hb.not(t,r))(bb.innerFrom(e))]};var _b={},vb=(Object.defineProperty(_b,"__esModule",{value:!0}),_b.raceInit=_b.race=void 0,S),mb=R,gb=tb,Ob=h;function wb(t){return function(n){for(var o=[],e=0;o&&!n.closed&&e<t.length;e++)(r=>{o.push(mb.innerFrom(t[r]).subscribe(Ob.createOperatorSubscriber(n,function(e){if(o){for(var t=0;t<o.length;t++)t!==r&&o[t].unsubscribe();o=null}n.next(e)})))})(e)}}_b.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===(e=gb.argsOrArgArray(e)).length?mb.innerFrom(e[0]):new vb.Observable(wb(e))},_b.raceInit=wb;var Eb={},Pb=(Object.defineProperty(Eb,"__esModule",{value:!0}),Eb.range=void 0,S),Sb=P;Eb.range=function(r,e,n){var o;return null==e&&(e=r,r=0),e<=0?Sb.EMPTY:(o=e+r,new Pb.Observable(n?function(e){var t=r;return n.schedule(function(){t<o?(e.next(t++),this.schedule()):e.complete()})}:function(e){for(var t=r;t<o&&!e.closed;)e.next(t++);e.complete()}))};var Tb={},jb=(Object.defineProperty(Tb,"__esModule",{value:!0}),Tb.using=void 0,S),Cb=R,Ib=P;Tb.using=function(n,o){return new jb.Observable(function(e){var t=n(),r=o(t);return(r?Cb.innerFrom(r):Ib.EMPTY).subscribe(e),function(){t&&t.unsubscribe()}})};var Rb={},Ab=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},Mb=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},kb=(Object.defineProperty(Rb,"__esModule",{value:!0}),Rb.zip=void 0,S),Nb=R,xb=tb,Db=P,Ub=h,Lb=u;Rb.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=Lb.popResultSelector(e),a=xb.argsOrArgArray(e);return a.length?new kb.Observable(function(r){for(var n=a.map(function(){return[]}),o=a.map(function(){return!1}),e=(r.add(function(){n=o=null}),0);!r.closed&&e<a.length;e++)(t=>{Nb.innerFrom(a[t]).subscribe(Ub.createOperatorSubscriber(r,function(e){n[t].push(e),n.every(function(e){return e.length})&&(e=n.map(function(e){return e.shift()}),r.next(i?i.apply(void 0,Mb([],Ab(e))):e),n.some(function(e,t){return!e.length&&o[t]}))&&r.complete()},function(){o[t]=!0,n[t].length||r.complete()}))})(e);return function(){n=o=null}}):Db.EMPTY};var Fb={},Bb=(Object.defineProperty(Fb,"__esModule",{value:!0}),{}),Vb=(Object.defineProperty(Bb,"__esModule",{value:!0}),Bb.audit=void 0,i),qb=R,Wb=h;Bb.audit=function(s){return Vb.operate(function(e,t){function r(){var e;null!=a&&a.unsubscribe(),a=null,o&&(o=!1,e=i,i=null,t.next(e)),u&&t.complete()}function n(){a=null,u&&t.complete()}var o=!1,i=null,a=null,u=!1;e.subscribe(Wb.createOperatorSubscriber(t,function(e){o=!0,i=e,a||qb.innerFrom(s(e)).subscribe(a=Wb.createOperatorSubscriber(t,r,n))},function(){u=!0,o&&a&&!a.closed||t.complete()}))})};var zb={},Hb=(Object.defineProperty(zb,"__esModule",{value:!0}),zb.auditTime=void 0,I),Gb=Bb,Kb=By;zb.auditTime=function(e,t){return void 0===t&&(t=Hb.asyncScheduler),Gb.audit(function(){return Kb.timer(e,t)})};var Yb={},Zb=(Object.defineProperty(Yb,"__esModule",{value:!0}),Yb.buffer=void 0,i),Qb=a,Xb=h,Jb=R;Yb.buffer=function(n){return Zb.operate(function(e,t){var r=[];return e.subscribe(Xb.createOperatorSubscriber(t,function(e){return r.push(e)},function(){t.next(r),t.complete()})),Jb.innerFrom(n).subscribe(Xb.createOperatorSubscriber(t,function(){var e=r;r=[],t.next(e)},Qb.noop)),function(){r=null}})};var $b={},e_=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},t_=(Object.defineProperty($b,"__esModule",{value:!0}),$b.bufferCount=void 0,i),r_=h,n_=v;$b.bufferCount=function(h,y){return y=null!=(y=void 0===y?null:y)?y:h,t_.operate(function(e,f){var p=[],d=0;e.subscribe(r_.createOperatorSubscriber(f,function(e){var t,r,n,o,i=null;d++%y==0&&p.push([]);try{for(var a=e_(p),u=a.next();!u.done;u=a.next())(l=u.value).push(e),h<=l.length&&(i=null!=i?i:[]).push(l)}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}if(i)try{for(var s=e_(i),c=s.next();!c.done;c=s.next()){var l=c.value;n_.arrRemove(p,l),f.next(l)}}catch(e){n={error:e}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}},function(){var t,e;try{for(var r=e_(p),n=r.next();!n.done;n=r.next()){var o=n.value;f.next(o)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}f.complete()},void 0,function(){p=null}))})};var o_={},i_=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a_=(Object.defineProperty(o_,"__esModule",{value:!0}),o_.bufferTime=void 0,w),u_=i,s_=h,c_=v,l_=I,f_=u,p_=Kp;o_.bufferTime=function(i){for(var e,t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var a=null!=(e=f_.popScheduler(t))?e:l_.asyncScheduler,u=null!=(e=t[0])?e:null,l=t[1]||1/0;return u_.operate(function(e,r){var s=[],n=!1,c=function(e){var t=e.buffer;e.subs.unsubscribe(),c_.arrRemove(s,e),r.next(t),n&&o()},o=function(){var e,t;s&&(e=new a_.Subscription,r.add(e),s.push(t={buffer:[],subs:e}),p_.executeSchedule(e,a,function(){return c(t)},i))},t=(null!==u&&0<=u?p_.executeSchedule(r,a,o,u,!0):n=!0,o(),s_.createOperatorSubscriber(r,function(e){var t,r,n=s.slice();try{for(var o=i_(n),i=o.next();!i.done;i=o.next()){var a=i.value,u=a.buffer;u.push(e),l<=u.length&&c(a)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}},function(){for(;null!=s&&s.length;)r.next(s.shift().buffer);null!=t&&t.unsubscribe(),r.complete(),r.unsubscribe()},void 0,function(){return s=null}));e.subscribe(t)})};var d_={},h_=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},y_=(Object.defineProperty(d_,"__esModule",{value:!0}),d_.bufferToggle=void 0,w),b_=i,__=R,v_=h,m_=a,g_=v;d_.bufferToggle=function(t,o){return b_.operate(function(e,n){var i=[];__.innerFrom(t).subscribe(v_.createOperatorSubscriber(n,function(e){var t=[],r=(i.push(t),new y_.Subscription);r.add(__.innerFrom(o(e)).subscribe(v_.createOperatorSubscriber(n,function(){g_.arrRemove(i,t),n.next(t),r.unsubscribe()},m_.noop)))},m_.noop)),e.subscribe(v_.createOperatorSubscriber(n,function(e){var t,r;try{for(var n=h_(i),o=n.next();!o.done;o=n.next())o.value.push(e)}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},function(){for(;0<i.length;)n.next(i.shift());n.complete()}))})};var O_={},w_=(Object.defineProperty(O_,"__esModule",{value:!0}),O_.bufferWhen=void 0,i),E_=a,P_=h,S_=R;O_.bufferWhen=function(i){return w_.operate(function(e,t){var r=null,n=null,o=function(){null!=n&&n.unsubscribe();var e=r;r=[],e&&t.next(e),S_.innerFrom(i()).subscribe(n=P_.createOperatorSubscriber(t,o,E_.noop))};o(),e.subscribe(P_.createOperatorSubscriber(t,function(e){return null==r?void 0:r.push(e)},function(){r&&t.next(r),t.complete()},void 0,function(){return r=n=null}))})};var T_={},j_=(Object.defineProperty(T_,"__esModule",{value:!0}),T_.catchError=void 0,R),C_=h,I_=i;T_.catchError=function a(u){return I_.operate(function(t,r){var n,o=null,i=!1,o=t.subscribe(C_.createOperatorSubscriber(r,void 0,void 0,function(e){n=j_.innerFrom(u(e,a(u)(t))),o?(o.unsubscribe(),o=null,n.subscribe(r)):i=!0}));i&&(o.unsubscribe(),o=null,n.subscribe(r))})};var R_={},A_={},k={},M_={},k_={},N_={},x_=(Object.defineProperty(N_,"__esModule",{value:!0}),N_.scanInternals=void 0,h);N_.scanInternals=function(a,t,u,s,c){return function(e,r){var n=u,o=t,i=0;e.subscribe(x_.createOperatorSubscriber(r,function(e){var t=i++;o=n?a(o,e,t):(n=!0,e),s&&r.next(o)},c&&function(){n&&r.next(o),r.complete()}))}},Object.defineProperty(k_,"__esModule",{value:!0}),k_.reduce=void 0;var D_=N_,U_=i;k_.reduce=function(e,t){return U_.operate(D_.scanInternals(e,t,2<=arguments.length,!1,!0))},Object.defineProperty(M_,"__esModule",{value:!0}),M_.toArray=void 0;function L_(e,t){return e.push(t),e}var F_=k_,B_=i;M_.toArray=function(){return B_.operate(function(e,t){F_.reduce(L_,[])(e).subscribe(t)})},Object.defineProperty(k,"__esModule",{value:!0}),k.joinAllInternals=void 0;var V_=Xn,q_=rh,W_=Kr,z_=Vh,H_=M_;k.joinAllInternals=function(t,e){return W_.pipe(H_.toArray(),z_.mergeMap(function(e){return t(e)}),e?q_.mapOneOrManyArgs(e):V_.identity)},Object.defineProperty(A_,"__esModule",{value:!0}),A_.combineLatestAll=void 0;var G_=m,K_=k;A_.combineLatestAll=function(e){return K_.joinAllInternals(G_.combineLatest,e)},Object.defineProperty(R_,"__esModule",{value:!0}),R_.combineAll=void 0;R_.combineAll=A_.combineLatestAll;var Y_={},Z_={},Q_=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},X_=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},J_=(Object.defineProperty(Z_,"__esModule",{value:!0}),Z_.combineLatest=void 0,m),$_=i,ev=tb,tv=rh,rv=Kr,nv=u;function ov(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=nv.popResultSelector(r);return t?rv.pipe(ov.apply(void 0,X_([],Q_(r))),tv.mapOneOrManyArgs(t)):$_.operate(function(e,t){J_.combineLatestInit(X_([e],Q_(ev.argsOrArgArray(r))))(t)})}Z_.combineLatest=ov;var iv=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},av=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},uv=(Object.defineProperty(Y_,"__esModule",{value:!0}),Y_.combineLatestWith=void 0,Z_);Y_.combineLatestWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return uv.combineLatest.apply(void 0,av([],iv(e)))};var rh={},sv=(Object.defineProperty(rh,"__esModule",{value:!0}),rh.concatMap=void 0,Vh),cv=o;rh.concatMap=function(e,t){return cv.isFunction(t)?sv.mergeMap(e,t,1):sv.mergeMap(e,1)};var lv={},fv=(Object.defineProperty(lv,"__esModule",{value:!0}),lv.concatMapTo=void 0,rh),pv=o;lv.concatMapTo=function(e,t){return pv.isFunction(t)?fv.concatMap(function(){return e},t):fv.concatMap(function(){return e})};var dv={},hv={},yv=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},bv=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},_v=(Object.defineProperty(hv,"__esModule",{value:!0}),hv.concat=void 0,i),vv=Fh,mv=u,gv=b;hv.concat=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var n=mv.popScheduler(r);return _v.operate(function(e,t){vv.concatAll()(gv.from(bv([e],yv(r)),n)).subscribe(t)})};var Ov=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},wv=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Ev=(Object.defineProperty(dv,"__esModule",{value:!0}),dv.concatWith=void 0,hv);dv.concatWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ev.concat.apply(void 0,wv([],Ov(e)))};var Pv={},Sv={},Tv=(Object.defineProperty(Sv,"__esModule",{value:!0}),Sv.fromSubscribable=void 0,S);Sv.fromSubscribable=function(t){return new Tv.Observable(function(e){return t.subscribe(e)})},Object.defineProperty(Pv,"__esModule",{value:!0}),Pv.connect=void 0;var jv=uo,Cv=R,Iv=i,Rv=Sv,Av={connector:function(){return new jv.Subject}};Pv.connect=function(n,e){var o=(e=void 0===e?Av:e).connector;return Iv.operate(function(e,t){var r=o();Cv.innerFrom(n(Rv.fromSubscribable(r))).subscribe(t),t.add(e.subscribe(r))})};var Sv={},Mv=(Object.defineProperty(Sv,"__esModule",{value:!0}),Sv.count=void 0,k_);Sv.count=function(n){return Mv.reduce(function(e,t,r){return!n||n(t,r)?e+1:e},0)};var kv={},Nv=(Object.defineProperty(kv,"__esModule",{value:!0}),kv.debounce=void 0,i),xv=a,Dv=h,Uv=R;kv.debounce=function(a){return Nv.operate(function(e,t){function r(){var e;null!=i&&i.unsubscribe(),i=null,n&&(n=!1,e=o,o=null,t.next(e))}var n=!1,o=null,i=null;e.subscribe(Dv.createOperatorSubscriber(t,function(e){null!=i&&i.unsubscribe(),n=!0,o=e,i=Dv.createOperatorSubscriber(t,r,xv.noop),Uv.innerFrom(a(e)).subscribe(i)},function(){r(),t.complete()},void 0,function(){o=i=null}))})};var Lv={},Fv=(Object.defineProperty(Lv,"__esModule",{value:!0}),Lv.debounceTime=void 0,I),Bv=i,Vv=h;Lv.debounceTime=function(u,s){return void 0===s&&(s=Fv.asyncScheduler),Bv.operate(function(e,r){var n=null,t=null,o=null,i=function(){var e;n&&(n.unsubscribe(),e=t,t=n=null,r.next(e))};function a(){var e=o+u,t=s.now();t<e?(n=this.schedule(void 0,e-t),r.add(n)):i()}e.subscribe(Vv.createOperatorSubscriber(r,function(e){t=e,o=s.now(),n||(n=s.schedule(a,u),r.add(n))},function(){i(),r.complete()},void 0,function(){t=n=null}))})};var qv={},Wv=(Object.defineProperty(qv,"__esModule",{value:!0}),qv.defaultIfEmpty=void 0,i),zv=h;qv.defaultIfEmpty=function(n){return Wv.operate(function(e,t){var r=!1;e.subscribe(zv.createOperatorSubscriber(t,function(e){r=!0,t.next(e)},function(){r||t.next(n),t.complete()}))})};var Hv={},Gv={},Kv={},Yv=(Object.defineProperty(Kv,"__esModule",{value:!0}),Kv.take=void 0,P),Zv=i,Qv=h;Kv.take=function(n){return n<=0?function(){return Yv.EMPTY}:Zv.operate(function(e,t){var r=0;e.subscribe(Qv.createOperatorSubscriber(t,function(e){++r<=n&&(t.next(e),n<=r)&&t.complete()}))})};var Xv={},Jv=(Object.defineProperty(Xv,"__esModule",{value:!0}),Xv.ignoreElements=void 0,i),$v=h,em=a;Xv.ignoreElements=function(){return Jv.operate(function(e,t){e.subscribe($v.createOperatorSubscriber(t,em.noop))})};var tm={},rm=(Object.defineProperty(tm,"__esModule",{value:!0}),tm.mapTo=void 0,nh);tm.mapTo=function(e){return rm.map(function(){return e})},Object.defineProperty(Gv,"__esModule",{value:!0}),Gv.delayWhen=void 0;var nm=Lh,om=Kv,im=Xv,am=tm,um=Vh,sm=R;Gv.delayWhen=function t(r,n){return n?function(e){return nm.concat(n.pipe(om.take(1),im.ignoreElements()),e.pipe(t(r)))}:um.mergeMap(function(e,t){return sm.innerFrom(r(e,t)).pipe(om.take(1),am.mapTo(e))})},Object.defineProperty(Hv,"__esModule",{value:!0}),Hv.delay=void 0;var cm=I,lm=Gv,fm=By;Hv.delay=function(e,t){var r=fm.timer(e,t=void 0===t?cm.asyncScheduler:t);return lm.delayWhen(function(){return r})};var pm={},dm=(Object.defineProperty(pm,"__esModule",{value:!0}),pm.dematerialize=void 0,O),hm=i,ym=h;pm.dematerialize=function(){return hm.operate(function(e,t){e.subscribe(ym.createOperatorSubscriber(t,function(e){return dm.observeNotification(e,t)}))})};var bm={},_m=(Object.defineProperty(bm,"__esModule",{value:!0}),bm.distinct=void 0,i),vm=h,mm=a,gm=R;bm.distinct=function(o,t){return _m.operate(function(e,r){var n=new Set;e.subscribe(vm.createOperatorSubscriber(r,function(e){var t=o?o(e):e;n.has(t)||(n.add(t),r.next(e))})),t&&gm.innerFrom(t).subscribe(vm.createOperatorSubscriber(r,function(){return n.clear()},mm.noop))})};var Om={},wm=(Object.defineProperty(Om,"__esModule",{value:!0}),Om.distinctUntilChanged=void 0,Xn),Em=i,Pm=h;function Sm(e,t){return e===t}Om.distinctUntilChanged=function(i,a){return void 0===a&&(a=wm.identity),i=null!=i?i:Sm,Em.operate(function(e,r){var n,o=!0;e.subscribe(Pm.createOperatorSubscriber(r,function(e){var t=a(e);!o&&i(n,t)||(o=!1,n=t,r.next(e))}))})};var Tm={},jm=(Object.defineProperty(Tm,"__esModule",{value:!0}),Tm.distinctUntilKeyChanged=void 0,Om);Tm.distinctUntilKeyChanged=function(r,n){return jm.distinctUntilChanged(function(e,t){return n?n(e[r],t[r]):e[r]===t[r]})};var Cm={},Im={},Rm=(Object.defineProperty(Im,"__esModule",{value:!0}),Im.throwIfEmpty=void 0,sp),Am=i,Mm=h;function km(){return new Rm.EmptyError}Im.throwIfEmpty=function(n){return void 0===n&&(n=km),Am.operate(function(e,t){var r=!1;e.subscribe(Mm.createOperatorSubscriber(t,function(e){r=!0,t.next(e)},function(){return r?t.complete():t.error(n())}))})},Object.defineProperty(Cm,"__esModule",{value:!0}),Cm.elementAt=void 0;var Nm=yp,xm=fb,Dm=Im,Um=qv,Lm=Kv;Cm.elementAt=function(r,t){if(r<0)throw new Nm.ArgumentOutOfRangeError;var n=2<=arguments.length;return function(e){return e.pipe(xm.filter(function(e,t){return t===r}),Lm.take(1),n?Um.defaultIfEmpty(t):Dm.throwIfEmpty(function(){return new Nm.ArgumentOutOfRangeError}))}};var Fm={},Bm=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},Vm=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},qm=(Object.defineProperty(Fm,"__esModule",{value:!0}),Fm.endWith=void 0,Lh),Wm=g;Fm.endWith=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return qm.concat(e,Wm.of.apply(void 0,Vm([],Bm(t))))}};var zm={},Hm=(Object.defineProperty(zm,"__esModule",{value:!0}),zm.every=void 0,i),Gm=h;zm.every=function(o,i){return Hm.operate(function(t,r){var n=0;t.subscribe(Gm.createOperatorSubscriber(r,function(e){o.call(i,e,n++,t)||(r.next(!1),r.complete())},function(){r.next(!0),r.complete()}))})};var Km={},Ym={},Zm={},Qm=(Object.defineProperty(Zm,"__esModule",{value:!0}),Zm.exhaustMap=void 0,nh),Xm=R,Jm=i,$m=h;Zm.exhaustMap=function t(i,o){return o?function(e){return e.pipe(t(function(r,n){return Xm.innerFrom(i(r,n)).pipe(Qm.map(function(e,t){return o(r,e,n,t)}))}))}:Jm.operate(function(e,t){var r=0,n=null,o=!1;e.subscribe($m.createOperatorSubscriber(t,function(e){n||(n=$m.createOperatorSubscriber(t,void 0,function(){n=null,o&&t.complete()}),Xm.innerFrom(i(e,r++)).subscribe(n))},function(){o=!0,n||t.complete()}))})},Object.defineProperty(Ym,"__esModule",{value:!0}),Ym.exhaustAll=void 0;var e0=Zm,t0=Xn;Ym.exhaustAll=function(){return e0.exhaustMap(t0.identity)},Object.defineProperty(Km,"__esModule",{value:!0}),Km.exhaust=void 0;Km.exhaust=Ym.exhaustAll;var r0={},n0=(Object.defineProperty(r0,"__esModule",{value:!0}),r0.expand=void 0,i),o0=qh;r0.expand=function(r,n,o){return n=((n=void 0===n?1/0:n)||0)<1?1/0:n,n0.operate(function(e,t){return o0.mergeInternals(e,t,r,n,void 0,!0,o)})};var i0={},a0=(Object.defineProperty(i0,"__esModule",{value:!0}),i0.finalize=void 0,i);i0.finalize=function(r){return a0.operate(function(e,t){try{e.subscribe(t)}finally{t.add(r)}})};var u0={},s0=(Object.defineProperty(u0,"__esModule",{value:!0}),u0.createFind=u0.find=void 0,i),c0=h;function l0(i,a,e){var u="index"===e;return function(r,n){var o=0;r.subscribe(c0.createOperatorSubscriber(n,function(e){var t=o++;i.call(a,e,t,r)&&(n.next(u?t:e),n.complete())},function(){n.next(u?-1:void 0),n.complete()}))}}u0.find=function(e,t){return s0.operate(l0(e,t,"value"))},u0.createFind=l0;var f0={},p0=(Object.defineProperty(f0,"__esModule",{value:!0}),f0.findIndex=void 0,i),d0=u0;f0.findIndex=function(e,t){return p0.operate(d0.createFind(e,t,"index"))};var h0={},y0=(Object.defineProperty(h0,"__esModule",{value:!0}),h0.first=void 0,sp),b0=fb,_0=Kv,v0=qv,m0=Im,g0=Xn;h0.first=function(n,e){var t=2<=arguments.length;return function(r){return r.pipe(n?b0.filter(function(e,t){return n(e,t,r)}):g0.identity,_0.take(1),t?v0.defaultIfEmpty(e):m0.throwIfEmpty(function(){return new y0.EmptyError}))}};var O0={},w0=(Object.defineProperty(O0,"__esModule",{value:!0}),O0.groupBy=void 0,S),E0=R,P0=uo,S0=i,T0=h;O0.groupBy=function(y,t,b,_){return S0.operate(function(e,s){function c(t){return r(function(e){return e.error(t)})}t&&"function"!=typeof t?(b=t.duration,l=t.element,_=t.connector):l=t;var l,f=new Map,r=function(e){f.forEach(e),e(s)},p=0,d=!1,h=new T0.OperatorSubscriber(s,function(e){try{var t,r,n=y(e),o=f.get(n);o||(f.set(n,o=_?_():new P0.Subject),i=n,a=o,(u=new w0.Observable(function(e){p++;var t=a.subscribe(e);return function(){t.unsubscribe(),0==--p&&d&&h.unsubscribe()}})).key=i,t=u,s.next(t),b&&(r=T0.createOperatorSubscriber(o,function(){o.complete(),null!=r&&r.unsubscribe()},void 0,void 0,function(){return f.delete(n)}),h.add(E0.innerFrom(b(t)).subscribe(r)))),o.next(l?l(e):e)}catch(e){c(e)}var i,a,u},function(){return r(function(e){return e.complete()})},c,function(){return f.clear()},function(){return d=!0,0===p});e.subscribe(h)})};var j0={},C0=(Object.defineProperty(j0,"__esModule",{value:!0}),j0.isEmpty=void 0,i),I0=h;j0.isEmpty=function(){return C0.operate(function(e,t){e.subscribe(I0.createOperatorSubscriber(t,function(){t.next(!1),t.complete()},function(){t.next(!0),t.complete()}))})};var R0={},A0={},M0=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},k0=(Object.defineProperty(A0,"__esModule",{value:!0}),A0.takeLast=void 0,P),N0=i,x0=h;A0.takeLast=function(t){return t<=0?function(){return k0.EMPTY}:N0.operate(function(e,i){var a=[];e.subscribe(x0.createOperatorSubscriber(i,function(e){a.push(e),t<a.length&&a.shift()},function(){var t,e;try{for(var r=M0(a),n=r.next();!n.done;n=r.next()){var o=n.value;i.next(o)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}i.complete()},void 0,function(){a=null}))})},Object.defineProperty(R0,"__esModule",{value:!0}),R0.last=void 0;var D0=sp,U0=fb,L0=A0,F0=Im,B0=qv,V0=Xn;R0.last=function(n,e){var t=2<=arguments.length;return function(r){return r.pipe(n?U0.filter(function(e,t){return n(e,t,r)}):V0.identity,L0.takeLast(1),t?B0.defaultIfEmpty(e):F0.throwIfEmpty(function(){return new D0.EmptyError}))}};var q0={},W0=(Object.defineProperty(q0,"__esModule",{value:!0}),q0.materialize=void 0,O),z0=i,H0=h;q0.materialize=function(){return z0.operate(function(e,t){e.subscribe(H0.createOperatorSubscriber(t,function(e){t.next(W0.Notification.createNext(e))},function(){t.next(W0.Notification.createComplete()),t.complete()},function(e){t.next(W0.Notification.createError(e)),t.complete()}))})};var G0={},K0=(Object.defineProperty(G0,"__esModule",{value:!0}),G0.max=void 0,k_),Y0=o;G0.max=function(r){return K0.reduce(Y0.isFunction(r)?function(e,t){return 0<r(e,t)?e:t}:function(e,t){return t<e?e:t})};var Z0={},Q0=(Object.defineProperty(Z0,"__esModule",{value:!0}),Z0.flatMap=void 0,Vh),Q0=(Z0.flatMap=Q0.mergeMap,{}),X0=(Object.defineProperty(Q0,"__esModule",{value:!0}),Q0.mergeMapTo=void 0,Vh),J0=o;Q0.mergeMapTo=function(e,t,r){return void 0===r&&(r=1/0),J0.isFunction(t)?X0.mergeMap(function(){return e},t,r):X0.mergeMap(function(){return e},r="number"==typeof t?t:r)};var $0={},eg=(Object.defineProperty($0,"__esModule",{value:!0}),$0.mergeScan=void 0,i),tg=qh;$0.mergeScan=function(n,o,i){return void 0===i&&(i=1/0),eg.operate(function(e,t){var r=o;return tg.mergeInternals(e,t,function(e,t){return n(r,e,t)},i,function(e){r=e},!1,void 0,function(){return r=null})})};var qh={},rg={},ng=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},og=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},ig=(Object.defineProperty(rg,"__esModule",{value:!0}),rg.merge=void 0,i),ag=Bh,ug=u,sg=b;rg.merge=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var n=ug.popScheduler(r),o=ug.popNumber(r,1/0);return ig.operate(function(e,t){ag.mergeAll(o)(sg.from(og([e],ng(r)),n)).subscribe(t)})};var cg=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},lg=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},fg=(Object.defineProperty(qh,"__esModule",{value:!0}),qh.mergeWith=void 0,rg);qh.mergeWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return fg.merge.apply(void 0,lg([],cg(e)))};var pg={},dg=(Object.defineProperty(pg,"__esModule",{value:!0}),pg.min=void 0,k_),hg=o;pg.min=function(r){return dg.reduce(hg.isFunction(r)?function(e,t){return r(e,t)<0?e:t}:function(e,t){return e<t?e:t})};var yg={},bg=(Object.defineProperty(yg,"__esModule",{value:!0}),yg.multicast=void 0,t),_g=o,vg=Pv;yg.multicast=function(e,t){var r=_g.isFunction(e)?e:function(){return e};return _g.isFunction(t)?vg.connect(t,{connector:r}):function(e){return new bg.ConnectableObservable(e,r)}};var mg={},gg=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},Og=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},wg=(Object.defineProperty(mg,"__esModule",{value:!0}),mg.onErrorResumeNext=mg.onErrorResumeNextWith=void 0,tb),Eg=eb;function Pg(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=wg.argsOrArgArray(e);return function(e){return Eg.onErrorResumeNext.apply(void 0,Og([e],gg(r)))}}mg.onErrorResumeNextWith=Pg,mg.onErrorResumeNext=Pg;var Sg={},Tg=(Object.defineProperty(Sg,"__esModule",{value:!0}),Sg.pairwise=void 0,i),jg=h;Sg.pairwise=function(){return Tg.operate(function(e,r){var n,o=!1;e.subscribe(jg.createOperatorSubscriber(r,function(e){var t=n;n=e,o&&r.next([t,e]),o=!0}))})};var Cg={},Ig=(Object.defineProperty(Cg,"__esModule",{value:!0}),Cg.pluck=void 0,nh);Cg.pluck=function(){for(var o=[],e=0;e<arguments.length;e++)o[e]=arguments[e];var i=o.length;if(0===i)throw new Error("list of properties cannot be empty.");return Ig.map(function(e){for(var t=e,r=0;r<i;r++){var n=null==t?void 0:t[o[r]];if(void 0===n)return;t=n}return t})};var Rg={},Ag=(Object.defineProperty(Rg,"__esModule",{value:!0}),Rg.publish=void 0,uo),Mg=yg,kg=Pv;Rg.publish=function(t){return t?function(e){return kg.connect(t)(e)}:function(e){return Mg.multicast(new Ag.Subject)(e)}};var Ng={},xg=(Object.defineProperty(Ng,"__esModule",{value:!0}),Ng.publishBehavior=void 0,E),Dg=t;Ng.publishBehavior=function(r){return function(e){var t=new xg.BehaviorSubject(r);return new Dg.ConnectableObservable(e,function(){return t})}};var Ug={},Lg=(Object.defineProperty(Ug,"__esModule",{value:!0}),Ug.publishLast=void 0,T),Fg=t;Ug.publishLast=function(){return function(e){var t=new Lg.AsyncSubject;return new Fg.ConnectableObservable(e,function(){return t})}};var Bg={},Vg=(Object.defineProperty(Bg,"__esModule",{value:!0}),Bg.publishReplay=void 0,Wr),qg=yg,Wg=o;Bg.publishReplay=function(t,r,e,n){e&&!Wg.isFunction(e)&&(n=e);var o=Wg.isFunction(e)?e:void 0;return function(e){return qg.multicast(new Vg.ReplaySubject(t,r,n),o)(e)}};var zg={},Hg=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},Gg=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Kg=(Object.defineProperty(zg,"__esModule",{value:!0}),zg.raceWith=void 0,_b),Yg=i,Zg=Xn;zg.raceWith=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return r.length?Yg.operate(function(e,t){Kg.raceInit(Gg([e],Hg(r)))(t)}):Zg.identity};var Qg={},Xg=(Object.defineProperty(Qg,"__esModule",{value:!0}),Qg.repeat=void 0,P),Jg=i,$g=h,eO=R,tO=By;Qg.repeat=function(e){var t,u,s=1/0;return null!=e&&("object"==typeof e?(t=e.count,s=void 0===t?1/0:t,u=e.delay):s=e),s<=0?function(){return Xg.EMPTY}:Jg.operate(function(t,r){var n,o=0,i=function(){var e,t;null!=n&&n.unsubscribe(),(n=null)!=u?(e="number"==typeof u?tO.timer(u):eO.innerFrom(u(o)),t=$g.createOperatorSubscriber(r,function(){t.unsubscribe(),a()}),e.subscribe(t)):a()},a=function(){var e=!1;n=t.subscribe($g.createOperatorSubscriber(r,void 0,function(){++o<s?n?i():e=!0:r.complete()})),e&&i()};a()})};var rO={},nO=(Object.defineProperty(rO,"__esModule",{value:!0}),rO.repeatWhen=void 0,R),oO=uo,iO=i,aO=h;rO.repeatWhen=function(l){return iO.operate(function(e,t){var r,n,o=!1,i=!1,a=!1,u=function(){return a&&i&&(t.complete(),!0)},s=function(){return n||(n=new oO.Subject,nO.innerFrom(l(n)).subscribe(aO.createOperatorSubscriber(t,function(){r?c():o=!0},function(){i=!0,u()}))),n},c=function(){a=!1,r=e.subscribe(aO.createOperatorSubscriber(t,void 0,function(){a=!0,u()||s().next()})),o&&(r.unsubscribe(),r=null,o=!1,c())};c()})};var uO={},sO=(Object.defineProperty(uO,"__esModule",{value:!0}),uO.retry=void 0,i),cO=h,lO=Xn,fO=By,pO=R;uO.retry=function(e){var t=(e=(e=void 0===e?1/0:e)&&"object"==typeof e?e:{count:e}).count,c=void 0===t?1/0:t,l=e.delay,r=void 0!==(t=e.resetOnSuccess)&&t;return c<=0?lO.identity:sO.operate(function(e,i){var a,u=0,s=function(){var o=!1;a=e.subscribe(cO.createOperatorSubscriber(i,function(e){r&&(u=0),i.next(e)},void 0,function(e){var t,r,n;u++<c?(t=function(){a?(a.unsubscribe(),a=null,s()):o=!0},null!=l?(r="number"==typeof l?fO.timer(l):pO.innerFrom(l(e,u)),n=cO.createOperatorSubscriber(i,function(){n.unsubscribe(),t()},function(){i.complete()}),r.subscribe(n)):t()):i.error(e)})),o&&(a.unsubscribe(),a=null,s())};s()})};var dO={},hO=(Object.defineProperty(dO,"__esModule",{value:!0}),dO.retryWhen=void 0,R),yO=uo,bO=i,_O=h;dO.retryWhen=function(a){return bO.operate(function(e,t){var r,n,o=!1,i=function(){r=e.subscribe(_O.createOperatorSubscriber(t,void 0,void 0,function(e){n||(n=new yO.Subject,hO.innerFrom(a(n)).subscribe(_O.createOperatorSubscriber(t,function(){return r?i():o=!0}))),n&&n.next(e)})),o&&(r.unsubscribe(),r=null,o=!1,i())};i()})};var vO={},mO=(Object.defineProperty(vO,"__esModule",{value:!0}),vO.sample=void 0,R),gO=i,OO=a,wO=h;vO.sample=function(o){return gO.operate(function(e,t){var r=!1,n=null;e.subscribe(wO.createOperatorSubscriber(t,function(e){r=!0,n=e})),mO.innerFrom(o).subscribe(wO.createOperatorSubscriber(t,function(){var e;r&&(r=!1,e=n,n=null,t.next(e))},OO.noop))})};var EO={},PO=(Object.defineProperty(EO,"__esModule",{value:!0}),EO.sampleTime=void 0,I),SO=vO,TO=Fy;EO.sampleTime=function(e,t){return SO.sample(TO.interval(e,t=void 0===t?PO.asyncScheduler:t))};var jO={},CO=(Object.defineProperty(jO,"__esModule",{value:!0}),jO.scan=void 0,i),IO=N_;jO.scan=function(e,t){return CO.operate(IO.scanInternals(e,t,2<=arguments.length,!0))};var N_={},RO=(Object.defineProperty(N_,"__esModule",{value:!0}),N_.sequenceEqual=void 0,i),AO=h,MO=R;function kO(){return{buffer:[],complete:!1}}N_.sequenceEqual=function(a,u){return void 0===u&&(u=function(e,t){return e===t}),RO.operate(function(e,t){function r(r,n){var e=AO.createOperatorSubscriber(t,function(e){var t=n.buffer;0===t.length?n.complete?i(!1):r.buffer.push(e):u(e,t.shift())||i(!1)},function(){r.complete=!0,n.complete&&i(0===n.buffer.length),null!=e&&e.unsubscribe()});return e}var n=kO(),o=kO(),i=function(e){t.next(e),t.complete()};e.subscribe(r(n,o)),MO.innerFrom(a).subscribe(r(o,n))})};var NO={},xO=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},DO=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},UO=(Object.defineProperty(NO,"__esModule",{value:!0}),NO.share=void 0,R),LO=uo,FO=Ar,BO=i;function VO(e,t){for(var r,n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];if(!0===t)e();else if(!1!==t)return r=new FO.SafeSubscriber({next:function(){r.unsubscribe(),e()}}),UO.innerFrom(t.apply(void 0,DO([],xO(n)))).subscribe(r)}NO.share=function(e){var t=(e=void 0===e?{}:e).connector,p=void 0===t?function(){return new LO.Subject}:t,d=void 0===(t=e.resetOnError)||t,h=void 0===(t=e.resetOnComplete)||t,y=void 0===(t=e.resetOnRefCountZero)||t;return function(e){function n(){var e=o;f(),null!=e&&e.unsubscribe()}var o,i,a,u=0,s=!1,c=!1,l=function(){null!=i&&i.unsubscribe(),i=void 0},f=function(){l(),o=a=void 0,s=c=!1};return BO.operate(function(e,t){u++,c||s||l();var r=a=null!=a?a:p();t.add(function(){0!==--u||c||s||(i=VO(n,y))}),r.subscribe(t),!o&&0<u&&(o=new FO.SafeSubscriber({next:function(e){return r.next(e)},error:function(e){c=!0,l(),i=VO(f,d,e),r.error(e)},complete:function(){s=!0,l(),i=VO(f,h),r.complete()}}),UO.innerFrom(e).subscribe(o))})(e)}};var qO={},WO=(Object.defineProperty(qO,"__esModule",{value:!0}),qO.shareReplay=void 0,Wr),zO=NO;qO.shareReplay=function(e,t,r){var n,o,i=!1;return e&&"object"==typeof e?(n=e.bufferSize,o=void 0===n?1/0:n,t=void 0===(n=e.windowTime)?1/0:n,i=void 0!==(n=e.refCount)&&n,r=e.scheduler):o=null!=e?e:1/0,zO.share({connector:function(){return new WO.ReplaySubject(o,t,r)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})};var HO={},GO=(Object.defineProperty(HO,"__esModule",{value:!0}),HO.single=void 0,sp),KO=rd,YO=yd,ZO=i,QO=h;HO.single=function(u){return ZO.operate(function(t,r){var n,o=!1,i=!1,a=0;t.subscribe(QO.createOperatorSubscriber(r,function(e){i=!0,u&&!u(e,a++,t)||(o&&r.error(new KO.SequenceError("Too many matching values")),o=!0,n=e)},function(){o?(r.next(n),r.complete()):r.error(i?new YO.NotFoundError("No matching values"):new GO.EmptyError)}))})};var XO={},JO=(Object.defineProperty(XO,"__esModule",{value:!0}),XO.skip=void 0,fb);XO.skip=function(r){return JO.filter(function(e,t){return r<=t})};var $O={},ew=(Object.defineProperty($O,"__esModule",{value:!0}),$O.skipLast=void 0,Xn),tw=i,rw=h;$O.skipLast=function(a){return a<=0?ew.identity:tw.operate(function(e,n){var o=new Array(a),i=0;return e.subscribe(rw.createOperatorSubscriber(n,function(e){var t,r=i++;r<a?o[r]=e:(t=o[r=r%a],o[r]=e,n.next(t))})),function(){o=null}})};var nw={},ow=(Object.defineProperty(nw,"__esModule",{value:!0}),nw.skipUntil=void 0,i),iw=h,aw=R,uw=a;nw.skipUntil=function(o){return ow.operate(function(e,t){var r=!1,n=iw.createOperatorSubscriber(t,function(){null!=n&&n.unsubscribe(),r=!0},uw.noop);aw.innerFrom(o).subscribe(n),e.subscribe(iw.createOperatorSubscriber(t,function(e){return r&&t.next(e)}))})};var sw={},cw=(Object.defineProperty(sw,"__esModule",{value:!0}),sw.skipWhile=void 0,i),lw=h;sw.skipWhile=function(o){return cw.operate(function(e,t){var r=!1,n=0;e.subscribe(lw.createOperatorSubscriber(t,function(e){return(r=r||!o(e,n++))&&t.next(e)}))})};var fw={},pw=(Object.defineProperty(fw,"__esModule",{value:!0}),fw.startWith=void 0,Lh),dw=u,hw=i;fw.startWith=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var n=dw.popScheduler(r);return hw.operate(function(e,t){(n?pw.concat(r,e,n):pw.concat(r,e)).subscribe(t)})};var yw={},bw={},_w=(Object.defineProperty(bw,"__esModule",{value:!0}),bw.switchMap=void 0,R),vw=i,mw=h;bw.switchMap=function(s,c){return vw.operate(function(e,o){function i(){t&&!a&&o.complete()}var a=null,u=0,t=!1;e.subscribe(mw.createOperatorSubscriber(o,function(t){null!=a&&a.unsubscribe();var r=0,n=u++;_w.innerFrom(s(t,n)).subscribe(a=mw.createOperatorSubscriber(o,function(e){return o.next(c?c(t,e,n,r++):e)},function(){a=null,i()}))},function(){t=!0,i()}))})},Object.defineProperty(yw,"__esModule",{value:!0}),yw.switchAll=void 0;var gw=bw,Ow=Xn;yw.switchAll=function(){return gw.switchMap(Ow.identity)};var ww={},Ew=(Object.defineProperty(ww,"__esModule",{value:!0}),ww.switchMapTo=void 0,bw),Pw=o;ww.switchMapTo=function(e,t){return Pw.isFunction(t)?Ew.switchMap(function(){return e},t):Ew.switchMap(function(){return e})};var Sw={},Tw=(Object.defineProperty(Sw,"__esModule",{value:!0}),Sw.switchScan=void 0,bw),jw=i;Sw.switchScan=function(n,o){return jw.operate(function(e,t){var r=o;return Tw.switchMap(function(e,t){return n(r,e,t)},function(e,t){return r=t})(e).subscribe(t),function(){r=null}})};var Cw={},Iw=(Object.defineProperty(Cw,"__esModule",{value:!0}),Cw.takeUntil=void 0,i),Rw=h,Aw=R,Mw=a;Cw.takeUntil=function(r){return Iw.operate(function(e,t){Aw.innerFrom(r).subscribe(Rw.createOperatorSubscriber(t,function(){return t.complete()},Mw.noop)),t.closed||e.subscribe(t)})};var kw={},Nw=(Object.defineProperty(kw,"__esModule",{value:!0}),kw.takeWhile=void 0,i),xw=h;kw.takeWhile=function(o,i){return void 0===i&&(i=!1),Nw.operate(function(e,r){var n=0;e.subscribe(xw.createOperatorSubscriber(r,function(e){var t=o(e,n++);(t||i)&&r.next(e),t||r.complete()}))})};var Dw={},Uw=(Object.defineProperty(Dw,"__esModule",{value:!0}),Dw.tap=void 0,o),Lw=i,Fw=h,Bw=Xn;Dw.tap=function(e,t,r){var o=Uw.isFunction(e)||t||r?{next:e,error:t,complete:r}:e;return o?Lw.operate(function(e,r){null!=(t=o.subscribe)&&t.call(o);var t,n=!0;e.subscribe(Fw.createOperatorSubscriber(r,function(e){var t;null!=(t=o.next)&&t.call(o,e),r.next(e)},function(){var e;n=!1,null!=(e=o.complete)&&e.call(o),r.complete()},function(e){var t;n=!1,null!=(t=o.error)&&t.call(o,e),r.error(e)},function(){var e;n&&null!=(e=o.unsubscribe)&&e.call(o),null!=(e=o.finalize)&&e.call(o)}))}):Bw.identity};var o={},Vw=(Object.defineProperty(o,"__esModule",{value:!0}),o.throttle=void 0,i),qw=h,Ww=R;o.throttle=function(h,y){return Vw.operate(function(e,t){var r=null!=y?y:{},n=r.leading,o=void 0===n||n,n=r.trailing,i=void 0!==n&&n,a=!1,u=null,s=null,c=!1,l=function(){null!=s&&s.unsubscribe(),s=null,i&&(d(),c)&&t.complete()},f=function(){s=null,c&&t.complete()},p=function(e){return s=Ww.innerFrom(h(e)).subscribe(qw.createOperatorSubscriber(t,l,f))},d=function(){var e;a&&(a=!1,e=u,u=null,t.next(e),c||p(e))};e.subscribe(qw.createOperatorSubscriber(t,function(e){a=!0,u=e,s&&!s.closed||(o?d():p(e))},function(){c=!0,i&&a&&s&&!s.closed||t.complete()}))})};var zw={},Hw=(Object.defineProperty(zw,"__esModule",{value:!0}),zw.throttleTime=void 0,I),Gw=o,Kw=By;zw.throttleTime=function(e,t,r){var n=Kw.timer(e,t=void 0===t?Hw.asyncScheduler:t);return Gw.throttle(function(){return n},r)};var Yw={},Zw=(Object.defineProperty(Yw,"__esModule",{value:!0}),Yw.TimeInterval=Yw.timeInterval=void 0,I),Qw=i,Xw=h;Yw.timeInterval=function(i){return void 0===i&&(i=Zw.asyncScheduler),Qw.operate(function(e,n){var o=i.now();e.subscribe(Xw.createOperatorSubscriber(n,function(e){var t=i.now(),r=t-o;o=t,n.next(new Jw(e,r))}))})};var Jw=function(e,t){this.value=e,this.interval=t},$w=(Yw.TimeInterval=Jw,{}),eE=(Object.defineProperty($w,"__esModule",{value:!0}),$w.timeoutWith=void 0,I),tE=ad,rE=Op;$w.timeoutWith=function(e,t,r){var n,o;if(r=null!=r?r:eE.async,tE.isValidDate(e)?n=e:"number"==typeof e&&(o=e),!t)throw new TypeError("No observable provided to switch to");if(e=function(){return t},null==n&&null==o)throw new TypeError("No timeout provided.");return rE.timeout({first:n,each:o,scheduler:r,with:e})};var ad={},nE=(Object.defineProperty(ad,"__esModule",{value:!0}),ad.timestamp=void 0,Ia),oE=nh;ad.timestamp=function(t){return void 0===t&&(t=nE.dateTimestampProvider),oE.map(function(e){return{value:e,timestamp:t.now()}})};var Ia={},iE=(Object.defineProperty(Ia,"__esModule",{value:!0}),Ia.window=void 0,uo),aE=i,uE=h,sE=a,cE=R;Ia.window=function(o){return aE.operate(function(e,t){function r(e){n.error(e),t.error(e)}var n=new iE.Subject;t.next(n.asObservable());return e.subscribe(uE.createOperatorSubscriber(t,function(e){return null==n?void 0:n.next(e)},function(){n.complete(),t.complete()},r)),cE.innerFrom(o).subscribe(uE.createOperatorSubscriber(t,function(){n.complete(),t.next(n=new iE.Subject)},sE.noop,r)),function(){null!=n&&n.unsubscribe(),n=null}})};var lE={},fE=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},pE=(Object.defineProperty(lE,"__esModule",{value:!0}),lE.windowCount=void 0,uo),dE=i,hE=h;lE.windowCount=function(s,e){var c=0<(e=void 0===e?0:e)?e:s;return dE.operate(function(e,i){var a=[new pE.Subject],u=0;i.next(a[0].asObservable()),e.subscribe(hE.createOperatorSubscriber(i,function(e){try{for(var t=fE(a),r=t.next();!r.done;r=t.next())r.value.next(e)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=t.return)&&o.call(t)}finally{if(n)throw n.error}}var n,o=u-s+1;0<=o&&o%c==0&&a.shift().complete(),++u%c==0&&(n=new pE.Subject,a.push(n),i.next(n.asObservable()))},function(){for(;0<a.length;)a.shift().complete();i.complete()},function(e){for(;0<a.length;)a.shift().error(e);i.error(e)},function(){a=null}))})};var yE={},bE=(Object.defineProperty(yE,"__esModule",{value:!0}),yE.windowTime=void 0,uo),_E=I,vE=w,mE=i,gE=h,OE=v,wE=u,EE=Kp;yE.windowTime=function(c){for(var e,t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var l=null!=(e=wE.popScheduler(t))?e:_E.asyncScheduler,f=null!=(e=t[0])?e:null,p=t[1]||1/0;return mE.operate(function(e,n){function r(t){s(function(e){e=e.window;return t(e)}),t(n),n.unsubscribe()}var o=[],i=!1,a=function(e){var t=e.window,r=e.subs;t.complete(),r.unsubscribe(),OE.arrRemove(o,e),i&&u()},u=function(){var e,t,r;o&&(e=new vE.Subscription,n.add(e),t=new bE.Subject,o.push(r={window:t,subs:e,seen:0}),n.next(t.asObservable()),EE.executeSchedule(e,l,function(){return a(r)},c))},s=(null!==f&&0<=f?EE.executeSchedule(n,l,u,f,!0):i=!0,u(),function(e){return o.slice().forEach(e)});return e.subscribe(gE.createOperatorSubscriber(n,function(t){s(function(e){e.window.next(t),p<=++e.seen&&a(e)})},function(){return r(function(e){return e.complete()})},function(t){return r(function(e){return e.error(t)})})),function(){o=null}})};var Kp={},PE=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},SE=(Object.defineProperty(Kp,"__esModule",{value:!0}),Kp.windowToggle=void 0,uo),TE=w,jE=i,CE=R,IE=h,RE=a,AE=v;Kp.windowToggle=function(t,u){return jE.operate(function(e,o){function i(e){for(;0<a.length;)a.shift().error(e);o.error(e)}var a=[];CE.innerFrom(t).subscribe(IE.createOperatorSubscriber(o,function(e){var t,r=new SE.Subject,n=(a.push(r),new TE.Subscription);try{t=CE.innerFrom(u(e))}catch(e){return void i(e)}o.next(r.asObservable()),n.add(t.subscribe(IE.createOperatorSubscriber(o,function(){AE.arrRemove(a,r),r.complete(),n.unsubscribe()},RE.noop,i)))},RE.noop)),e.subscribe(IE.createOperatorSubscriber(o,function(e){var t,r,n=a.slice();try{for(var o=PE(n),i=o.next();!i.done;i=o.next())i.value.next(e)}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}},function(){for(;0<a.length;)a.shift().complete();o.complete()},i,function(){for(;0<a.length;)a.shift().unsubscribe()}))})};var v={},ME=(Object.defineProperty(v,"__esModule",{value:!0}),v.windowWhen=void 0,uo),kE=i,NE=h,xE=R;v.windowWhen=function(a){return kE.operate(function(e,t){var r,n,o=function(e){r.error(e),t.error(e)},i=function(){var e;null!=n&&n.unsubscribe(),null!=r&&r.complete(),r=new ME.Subject,t.next(r.asObservable());try{e=xE.innerFrom(a())}catch(e){return void o(e)}e.subscribe(n=NE.createOperatorSubscriber(t,i,i,o))};i(),e.subscribe(NE.createOperatorSubscriber(t,function(e){return r.next(e)},function(){r.complete(),t.complete()},o,function(){null!=n&&n.unsubscribe(),r=null}))})};var DE={},UE=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},LE=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},FE=(Object.defineProperty(DE,"__esModule",{value:!0}),DE.withLatestFrom=void 0,i),BE=h,VE=R,qE=Xn,WE=a,zE=u;DE.withLatestFrom=function(){for(var u=[],e=0;e<arguments.length;e++)u[e]=arguments[e];var s=zE.popResultSelector(u);return FE.operate(function(e,r){for(var t=u.length,n=new Array(t),o=u.map(function(){return!1}),i=!1,a=0;a<t;a++)(t=>{VE.innerFrom(u[t]).subscribe(BE.createOperatorSubscriber(r,function(e){n[t]=e,!i&&!o[t]&&(o[t]=!0,i=o.every(qE.identity))&&(o=null)},WE.noop))})(a);e.subscribe(BE.createOperatorSubscriber(r,function(e){i&&(e=LE([e],UE(n)),r.next(s?s.apply(void 0,LE([],UE(e))):e))}))})};var h={},HE=(Object.defineProperty(h,"__esModule",{value:!0}),h.zipAll=void 0,Rb),GE=k;h.zipAll=function(e){return GE.joinAllInternals(HE.zip,e)};var R={},u={},KE=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},YE=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},ZE=(Object.defineProperty(u,"__esModule",{value:!0}),u.zip=void 0,Rb),QE=i;u.zip=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return QE.operate(function(e,t){ZE.zip.apply(void 0,YE([e],KE(r))).subscribe(t)})};var XE,JE,$E,eP,tP,rP,nP,oP,iP,aP,uP,sP,cP,lP,fP,pP,dP,hP,yP,bP,_P,vP,mP,gP,OP,wP,EP,PP,SP,TP,jP,CP,IP,RP,AP,MP,kP,NP,xP,DP,UP,LP,FP,BP,VP,qP,WP,zP,HP,GP,KP,YP,ZP,QP,XP,JP,$P,e1,t1,r1,n1,o1,i1,a1,u1,s1,c1,l1,f1,p1,d1,h1,y1,b1,_1,v1,m1,g1,O1,w1,E1,P1,S1,T1,j1,C1,I1,R1,A1,M1,k1,N1,x1,D1,U1,L1,F1,B1,V1,q1,W1,z1,H1,G1,K1,Y1,Z1,Q1,X1,J1,$1,eS,tS,rS,nS,oS,iS,aS,uS,sS,cS,lS,fS,pS,dS,hS,yS,bS,_S,vS,mS,gS,OS,wS,ES,PS,SS,TS,jS,CS,IS,RS,AS,MS,kS,NS,xS,DS,US,LS,FS,BS,VS,qS,WS,zS,HS,GS,KS,YS,ZS,QS,XS,JS,$S,eT,tT,rT,nT=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},oT=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},iT=(Object.defineProperty(R,"__esModule",{value:!0}),R.zipWith=void 0,u);R.zipWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return iT.zip.apply(void 0,oT([],nT(e)))},k=Da,XE=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),i=r&&r.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||XE(t,e,r)},Object.defineProperty(k,"__esModule",{value:!0}),k.interval=k.iif=k.generate=k.fromEventPattern=k.fromEvent=k.from=k.forkJoin=k.empty=k.defer=k.connectable=k.concat=k.combineLatest=k.bindNodeCallback=k.bindCallback=k.UnsubscriptionError=k.TimeoutError=k.SequenceError=k.ObjectUnsubscribedError=k.NotFoundError=k.EmptyError=k.ArgumentOutOfRangeError=k.firstValueFrom=k.lastValueFrom=k.isObservable=k.identity=k.noop=k.pipe=k.NotificationKind=k.Notification=k.Subscriber=k.Subscription=k.Scheduler=k.VirtualAction=k.VirtualTimeScheduler=k.animationFrameScheduler=k.animationFrame=k.queueScheduler=k.queue=k.asyncScheduler=k.async=k.asapScheduler=k.asap=k.AsyncSubject=k.ReplaySubject=k.BehaviorSubject=k.Subject=k.animationFrames=k.observable=k.ConnectableObservable=k.Observable=void 0,k.filter=k.expand=k.exhaustMap=k.exhaustAll=k.exhaust=k.every=k.endWith=k.elementAt=k.distinctUntilKeyChanged=k.distinctUntilChanged=k.distinct=k.dematerialize=k.delayWhen=k.delay=k.defaultIfEmpty=k.debounceTime=k.debounce=k.count=k.connect=k.concatWith=k.concatMapTo=k.concatMap=k.concatAll=k.combineLatestWith=k.combineLatestAll=k.combineAll=k.catchError=k.bufferWhen=k.bufferToggle=k.bufferTime=k.bufferCount=k.buffer=k.auditTime=k.audit=k.config=k.NEVER=k.EMPTY=k.scheduled=k.zip=k.using=k.timer=k.throwError=k.range=k.race=k.partition=k.pairs=k.onErrorResumeNext=k.of=k.never=k.merge=void 0,k.switchMap=k.switchAll=k.subscribeOn=k.startWith=k.skipWhile=k.skipUntil=k.skipLast=k.skip=k.single=k.shareReplay=k.share=k.sequenceEqual=k.scan=k.sampleTime=k.sample=k.refCount=k.retryWhen=k.retry=k.repeatWhen=k.repeat=k.reduce=k.raceWith=k.publishReplay=k.publishLast=k.publishBehavior=k.publish=k.pluck=k.pairwise=k.onErrorResumeNextWith=k.observeOn=k.multicast=k.min=k.mergeWith=k.mergeScan=k.mergeMapTo=k.mergeMap=k.flatMap=k.mergeAll=k.max=k.materialize=k.mapTo=k.map=k.last=k.isEmpty=k.ignoreElements=k.groupBy=k.first=k.findIndex=k.find=k.finalize=void 0,k.zipWith=k.zipAll=k.withLatestFrom=k.windowWhen=k.windowToggle=k.windowTime=k.windowCount=k.window=k.toArray=k.timestamp=k.timeoutWith=k.timeout=k.timeInterval=k.throwIfEmpty=k.throttleTime=k.throttle=k.tap=k.takeWhile=k.takeUntil=k.takeLast=k.take=k.switchScan=k.switchMapTo=void 0,JE=S,Object.defineProperty(k,"Observable",{enumerable:!0,get:function(){return JE.Observable}}),$E=t,Object.defineProperty(k,"ConnectableObservable",{enumerable:!0,get:function(){return $E.ConnectableObservable}}),eP=ro,Object.defineProperty(k,"observable",{enumerable:!0,get:function(){return eP.observable}}),tP=p,Object.defineProperty(k,"animationFrames",{enumerable:!0,get:function(){return tP.animationFrames}}),rP=uo,Object.defineProperty(k,"Subject",{enumerable:!0,get:function(){return rP.Subject}}),nP=E,Object.defineProperty(k,"BehaviorSubject",{enumerable:!0,get:function(){return nP.BehaviorSubject}}),oP=Wr,Object.defineProperty(k,"ReplaySubject",{enumerable:!0,get:function(){return oP.ReplaySubject}}),iP=T,Object.defineProperty(k,"AsyncSubject",{enumerable:!0,get:function(){return iP.AsyncSubject}}),aP=l,Object.defineProperty(k,"asap",{enumerable:!0,get:function(){return aP.asap}}),Object.defineProperty(k,"asapScheduler",{enumerable:!0,get:function(){return aP.asapScheduler}}),uP=I,Object.defineProperty(k,"async",{enumerable:!0,get:function(){return uP.async}}),Object.defineProperty(k,"asyncScheduler",{enumerable:!0,get:function(){return uP.asyncScheduler}}),sP=wa,Object.defineProperty(k,"queue",{enumerable:!0,get:function(){return sP.queue}}),Object.defineProperty(k,"queueScheduler",{enumerable:!0,get:function(){return sP.queueScheduler}}),cP=j,Object.defineProperty(k,"animationFrame",{enumerable:!0,get:function(){return cP.animationFrame}}),Object.defineProperty(k,"animationFrameScheduler",{enumerable:!0,get:function(){return cP.animationFrameScheduler}}),lP=y,Object.defineProperty(k,"VirtualTimeScheduler",{enumerable:!0,get:function(){return lP.VirtualTimeScheduler}}),Object.defineProperty(k,"VirtualAction",{enumerable:!0,get:function(){return lP.VirtualAction}}),fP=B,Object.defineProperty(k,"Scheduler",{enumerable:!0,get:function(){return fP.Scheduler}}),pP=w,Object.defineProperty(k,"Subscription",{enumerable:!0,get:function(){return pP.Subscription}}),dP=Ar,Object.defineProperty(k,"Subscriber",{enumerable:!0,get:function(){return dP.Subscriber}}),hP=O,Object.defineProperty(k,"Notification",{enumerable:!0,get:function(){return hP.Notification}}),Object.defineProperty(k,"NotificationKind",{enumerable:!0,get:function(){return hP.NotificationKind}}),yP=Kr,Object.defineProperty(k,"pipe",{enumerable:!0,get:function(){return yP.pipe}}),bP=a,Object.defineProperty(k,"noop",{enumerable:!0,get:function(){return bP.noop}}),_P=Xn,Object.defineProperty(k,"identity",{enumerable:!0,get:function(){return _P.identity}}),vP=_p,Object.defineProperty(k,"isObservable",{enumerable:!0,get:function(){return vP.isObservable}}),mP=lp,Object.defineProperty(k,"lastValueFrom",{enumerable:!0,get:function(){return mP.lastValueFrom}}),gP=dp,Object.defineProperty(k,"firstValueFrom",{enumerable:!0,get:function(){return gP.firstValueFrom}}),OP=yp,Object.defineProperty(k,"ArgumentOutOfRangeError",{enumerable:!0,get:function(){return OP.ArgumentOutOfRangeError}}),wP=sp,Object.defineProperty(k,"EmptyError",{enumerable:!0,get:function(){return wP.EmptyError}}),EP=yd,Object.defineProperty(k,"NotFoundError",{enumerable:!0,get:function(){return EP.NotFoundError}}),PP=co,Object.defineProperty(k,"ObjectUnsubscribedError",{enumerable:!0,get:function(){return PP.ObjectUnsubscribedError}}),SP=rd,Object.defineProperty(k,"SequenceError",{enumerable:!0,get:function(){return SP.SequenceError}}),TP=Op,Object.defineProperty(k,"TimeoutError",{enumerable:!0,get:function(){return TP.TimeoutError}}),jP=F,Object.defineProperty(k,"UnsubscriptionError",{enumerable:!0,get:function(){return jP.UnsubscriptionError}}),CP=bp,Object.defineProperty(k,"bindCallback",{enumerable:!0,get:function(){return CP.bindCallback}}),IP=mh,Object.defineProperty(k,"bindNodeCallback",{enumerable:!0,get:function(){return IP.bindNodeCallback}}),RP=m,Object.defineProperty(k,"combineLatest",{enumerable:!0,get:function(){return RP.combineLatest}}),AP=Lh,Object.defineProperty(k,"concat",{enumerable:!0,get:function(){return AP.concat}}),MP=ny,Object.defineProperty(k,"connectable",{enumerable:!0,get:function(){return MP.connectable}}),kP=oy,Object.defineProperty(k,"defer",{enumerable:!0,get:function(){return kP.defer}}),NP=P,Object.defineProperty(k,"empty",{enumerable:!0,get:function(){return NP.empty}}),xP=fy,Object.defineProperty(k,"forkJoin",{enumerable:!0,get:function(){return xP.forkJoin}}),DP=b,Object.defineProperty(k,"from",{enumerable:!0,get:function(){return DP.from}}),UP=Oh,Object.defineProperty(k,"fromEvent",{enumerable:!0,get:function(){return UP.fromEvent}}),LP=Th,Object.defineProperty(k,"fromEventPattern",{enumerable:!0,get:function(){return LP.fromEventPattern}}),FP=n,Object.defineProperty(k,"generate",{enumerable:!0,get:function(){return FP.generate}}),BP=sd,Object.defineProperty(k,"iif",{enumerable:!0,get:function(){return BP.iif}}),VP=Fy,Object.defineProperty(k,"interval",{enumerable:!0,get:function(){return VP.interval}}),qP=C,Object.defineProperty(k,"merge",{enumerable:!0,get:function(){return qP.merge}}),WP=$y,Object.defineProperty(k,"never",{enumerable:!0,get:function(){return WP.never}}),zP=g,Object.defineProperty(k,"of",{enumerable:!0,get:function(){return zP.of}}),HP=eb,Object.defineProperty(k,"onErrorResumeNext",{enumerable:!0,get:function(){return HP.onErrorResumeNext}}),GP=sb,Object.defineProperty(k,"pairs",{enumerable:!0,get:function(){return GP.pairs}}),KP=M,Object.defineProperty(k,"partition",{enumerable:!0,get:function(){return KP.partition}}),YP=_b,Object.defineProperty(k,"race",{enumerable:!0,get:function(){return YP.race}}),ZP=Eb,Object.defineProperty(k,"range",{enumerable:!0,get:function(){return ZP.range}}),QP=_,Object.defineProperty(k,"throwError",{enumerable:!0,get:function(){return QP.throwError}}),XP=By,Object.defineProperty(k,"timer",{enumerable:!0,get:function(){return XP.timer}}),JP=Tb,Object.defineProperty(k,"using",{enumerable:!0,get:function(){return JP.using}}),$P=Rb,Object.defineProperty(k,"zip",{enumerable:!0,get:function(){return $P.zip}}),e1=so,Object.defineProperty(k,"scheduled",{enumerable:!0,get:function(){return e1.scheduled}}),t1=P,Object.defineProperty(k,"EMPTY",{enumerable:!0,get:function(){return t1.EMPTY}}),r1=$y,Object.defineProperty(k,"NEVER",{enumerable:!0,get:function(){return r1.NEVER}}),i(Fb,k),n1=ba,Object.defineProperty(k,"config",{enumerable:!0,get:function(){return n1.config}}),o1=Bb,Object.defineProperty(k,"audit",{enumerable:!0,get:function(){return o1.audit}}),i1=zb,Object.defineProperty(k,"auditTime",{enumerable:!0,get:function(){return i1.auditTime}}),a1=Yb,Object.defineProperty(k,"buffer",{enumerable:!0,get:function(){return a1.buffer}}),u1=$b,Object.defineProperty(k,"bufferCount",{enumerable:!0,get:function(){return u1.bufferCount}}),s1=o_,Object.defineProperty(k,"bufferTime",{enumerable:!0,get:function(){return s1.bufferTime}}),c1=d_,Object.defineProperty(k,"bufferToggle",{enumerable:!0,get:function(){return c1.bufferToggle}}),l1=O_,Object.defineProperty(k,"bufferWhen",{enumerable:!0,get:function(){return l1.bufferWhen}}),f1=T_,Object.defineProperty(k,"catchError",{enumerable:!0,get:function(){return f1.catchError}}),p1=R_,Object.defineProperty(k,"combineAll",{enumerable:!0,get:function(){return p1.combineAll}}),d1=A_,Object.defineProperty(k,"combineLatestAll",{enumerable:!0,get:function(){return d1.combineLatestAll}}),h1=Y_,Object.defineProperty(k,"combineLatestWith",{enumerable:!0,get:function(){return h1.combineLatestWith}}),y1=Fh,Object.defineProperty(k,"concatAll",{enumerable:!0,get:function(){return y1.concatAll}}),b1=rh,Object.defineProperty(k,"concatMap",{enumerable:!0,get:function(){return b1.concatMap}}),_1=lv,Object.defineProperty(k,"concatMapTo",{enumerable:!0,get:function(){return _1.concatMapTo}}),v1=dv,Object.defineProperty(k,"concatWith",{enumerable:!0,get:function(){return v1.concatWith}}),m1=Pv,Object.defineProperty(k,"connect",{enumerable:!0,get:function(){return m1.connect}}),g1=Sv,Object.defineProperty(k,"count",{enumerable:!0,get:function(){return g1.count}}),O1=kv,Object.defineProperty(k,"debounce",{enumerable:!0,get:function(){return O1.debounce}}),w1=Lv,Object.defineProperty(k,"debounceTime",{enumerable:!0,get:function(){return w1.debounceTime}}),E1=qv,Object.defineProperty(k,"defaultIfEmpty",{enumerable:!0,get:function(){return E1.defaultIfEmpty}}),P1=Hv,Object.defineProperty(k,"delay",{enumerable:!0,get:function(){return P1.delay}}),S1=Gv,Object.defineProperty(k,"delayWhen",{enumerable:!0,get:function(){return S1.delayWhen}}),T1=pm,Object.defineProperty(k,"dematerialize",{enumerable:!0,get:function(){return T1.dematerialize}}),j1=bm,Object.defineProperty(k,"distinct",{enumerable:!0,get:function(){return j1.distinct}}),C1=Om,Object.defineProperty(k,"distinctUntilChanged",{enumerable:!0,get:function(){return C1.distinctUntilChanged}}),I1=Tm,Object.defineProperty(k,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return I1.distinctUntilKeyChanged}}),R1=Cm,Object.defineProperty(k,"elementAt",{enumerable:!0,get:function(){return R1.elementAt}}),A1=Fm,Object.defineProperty(k,"endWith",{enumerable:!0,get:function(){return A1.endWith}}),M1=zm,Object.defineProperty(k,"every",{enumerable:!0,get:function(){return M1.every}}),k1=Km,Object.defineProperty(k,"exhaust",{enumerable:!0,get:function(){return k1.exhaust}}),N1=Ym,Object.defineProperty(k,"exhaustAll",{enumerable:!0,get:function(){return N1.exhaustAll}}),x1=Zm,Object.defineProperty(k,"exhaustMap",{enumerable:!0,get:function(){return x1.exhaustMap}}),D1=r0,Object.defineProperty(k,"expand",{enumerable:!0,get:function(){return D1.expand}}),U1=fb,Object.defineProperty(k,"filter",{enumerable:!0,get:function(){return U1.filter}}),L1=i0,Object.defineProperty(k,"finalize",{enumerable:!0,get:function(){return L1.finalize}}),F1=u0,Object.defineProperty(k,"find",{enumerable:!0,get:function(){return F1.find}}),B1=f0,Object.defineProperty(k,"findIndex",{enumerable:!0,get:function(){return B1.findIndex}}),V1=h0,Object.defineProperty(k,"first",{enumerable:!0,get:function(){return V1.first}}),q1=O0,Object.defineProperty(k,"groupBy",{enumerable:!0,get:function(){return q1.groupBy}}),W1=Xv,Object.defineProperty(k,"ignoreElements",{enumerable:!0,get:function(){return W1.ignoreElements}}),z1=j0,Object.defineProperty(k,"isEmpty",{enumerable:!0,get:function(){return z1.isEmpty}}),H1=R0,Object.defineProperty(k,"last",{enumerable:!0,get:function(){return H1.last}}),G1=nh,Object.defineProperty(k,"map",{enumerable:!0,get:function(){return G1.map}}),K1=tm,Object.defineProperty(k,"mapTo",{enumerable:!0,get:function(){return K1.mapTo}}),Y1=q0,Object.defineProperty(k,"materialize",{enumerable:!0,get:function(){return Y1.materialize}}),Z1=G0,Object.defineProperty(k,"max",{enumerable:!0,get:function(){return Z1.max}}),Q1=Bh,Object.defineProperty(k,"mergeAll",{enumerable:!0,get:function(){return Q1.mergeAll}}),X1=Z0,Object.defineProperty(k,"flatMap",{enumerable:!0,get:function(){return X1.flatMap}}),J1=Vh,Object.defineProperty(k,"mergeMap",{enumerable:!0,get:function(){return J1.mergeMap}}),$1=Q0,Object.defineProperty(k,"mergeMapTo",{enumerable:!0,get:function(){return $1.mergeMapTo}}),eS=$0,Object.defineProperty(k,"mergeScan",{enumerable:!0,get:function(){return eS.mergeScan}}),tS=qh,Object.defineProperty(k,"mergeWith",{enumerable:!0,get:function(){return tS.mergeWith}}),rS=pg,Object.defineProperty(k,"min",{enumerable:!0,get:function(){return rS.min}}),nS=yg,Object.defineProperty(k,"multicast",{enumerable:!0,get:function(){return nS.multicast}}),oS=pe,Object.defineProperty(k,"observeOn",{enumerable:!0,get:function(){return oS.observeOn}}),iS=mg,Object.defineProperty(k,"onErrorResumeNextWith",{enumerable:!0,get:function(){return iS.onErrorResumeNextWith}}),aS=Sg,Object.defineProperty(k,"pairwise",{enumerable:!0,get:function(){return aS.pairwise}}),uS=Cg,Object.defineProperty(k,"pluck",{enumerable:!0,get:function(){return uS.pluck}}),sS=Rg,Object.defineProperty(k,"publish",{enumerable:!0,get:function(){return sS.publish}}),cS=Ng,Object.defineProperty(k,"publishBehavior",{enumerable:!0,get:function(){return cS.publishBehavior}}),lS=Ug,Object.defineProperty(k,"publishLast",{enumerable:!0,get:function(){return lS.publishLast}}),fS=Bg,Object.defineProperty(k,"publishReplay",{enumerable:!0,get:function(){return fS.publishReplay}}),pS=zg,Object.defineProperty(k,"raceWith",{enumerable:!0,get:function(){return pS.raceWith}}),dS=k_,Object.defineProperty(k,"reduce",{enumerable:!0,get:function(){return dS.reduce}}),hS=Qg,Object.defineProperty(k,"repeat",{enumerable:!0,get:function(){return hS.repeat}}),yS=rO,Object.defineProperty(k,"repeatWhen",{enumerable:!0,get:function(){return yS.repeatWhen}}),bS=uO,Object.defineProperty(k,"retry",{enumerable:!0,get:function(){return bS.retry}}),_S=dO,Object.defineProperty(k,"retryWhen",{enumerable:!0,get:function(){return _S.retryWhen}}),vS=Z,Object.defineProperty(k,"refCount",{enumerable:!0,get:function(){return vS.refCount}}),mS=vO,Object.defineProperty(k,"sample",{enumerable:!0,get:function(){return mS.sample}}),gS=EO,Object.defineProperty(k,"sampleTime",{enumerable:!0,get:function(){return gS.sampleTime}}),OS=jO,Object.defineProperty(k,"scan",{enumerable:!0,get:function(){return OS.scan}}),wS=N_,Object.defineProperty(k,"sequenceEqual",{enumerable:!0,get:function(){return wS.sequenceEqual}}),ES=NO,Object.defineProperty(k,"share",{enumerable:!0,get:function(){return ES.share}}),PS=qO,Object.defineProperty(k,"shareReplay",{enumerable:!0,get:function(){return PS.shareReplay}}),SS=HO,Object.defineProperty(k,"single",{enumerable:!0,get:function(){return SS.single}}),TS=XO,Object.defineProperty(k,"skip",{enumerable:!0,get:function(){return TS.skip}}),jS=$O,Object.defineProperty(k,"skipLast",{enumerable:!0,get:function(){return jS.skipLast}}),CS=nw,Object.defineProperty(k,"skipUntil",{enumerable:!0,get:function(){return CS.skipUntil}}),IS=sw,Object.defineProperty(k,"skipWhile",{enumerable:!0,get:function(){return IS.skipWhile}}),RS=fw,Object.defineProperty(k,"startWith",{enumerable:!0,get:function(){return RS.startWith}}),AS=Xp,Object.defineProperty(k,"subscribeOn",{enumerable:!0,get:function(){return AS.subscribeOn}}),MS=yw,Object.defineProperty(k,"switchAll",{enumerable:!0,get:function(){return MS.switchAll}}),kS=bw,Object.defineProperty(k,"switchMap",{enumerable:!0,get:function(){return kS.switchMap}}),NS=ww,Object.defineProperty(k,"switchMapTo",{enumerable:!0,get:function(){return NS.switchMapTo}}),xS=Sw,Object.defineProperty(k,"switchScan",{enumerable:!0,get:function(){return xS.switchScan}}),DS=Kv,Object.defineProperty(k,"take",{enumerable:!0,get:function(){return DS.take}}),US=A0,Object.defineProperty(k,"takeLast",{enumerable:!0,get:function(){return US.takeLast}}),LS=Cw,Object.defineProperty(k,"takeUntil",{enumerable:!0,get:function(){return LS.takeUntil}}),FS=kw,Object.defineProperty(k,"takeWhile",{enumerable:!0,get:function(){return FS.takeWhile}}),BS=Dw,Object.defineProperty(k,"tap",{enumerable:!0,get:function(){return BS.tap}}),VS=o,Object.defineProperty(k,"throttle",{enumerable:!0,get:function(){return VS.throttle}}),qS=zw,Object.defineProperty(k,"throttleTime",{enumerable:!0,get:function(){return qS.throttleTime}}),WS=Im,Object.defineProperty(k,"throwIfEmpty",{enumerable:!0,get:function(){return WS.throwIfEmpty}}),zS=Yw,Object.defineProperty(k,"timeInterval",{enumerable:!0,get:function(){return zS.timeInterval}}),HS=Op,Object.defineProperty(k,"timeout",{enumerable:!0,get:function(){return HS.timeout}}),GS=$w,Object.defineProperty(k,"timeoutWith",{enumerable:!0,get:function(){return GS.timeoutWith}}),KS=ad,Object.defineProperty(k,"timestamp",{enumerable:!0,get:function(){return KS.timestamp}}),YS=M_,Object.defineProperty(k,"toArray",{enumerable:!0,get:function(){return YS.toArray}}),ZS=Ia,Object.defineProperty(k,"window",{enumerable:!0,get:function(){return ZS.window}}),QS=lE,Object.defineProperty(k,"windowCount",{enumerable:!0,get:function(){return QS.windowCount}}),XS=yE,Object.defineProperty(k,"windowTime",{enumerable:!0,get:function(){return XS.windowTime}}),JS=Kp,Object.defineProperty(k,"windowToggle",{enumerable:!0,get:function(){return JS.windowToggle}}),$S=v,Object.defineProperty(k,"windowWhen",{enumerable:!0,get:function(){return $S.windowWhen}}),eT=DE,Object.defineProperty(k,"withLatestFrom",{enumerable:!0,get:function(){return eT.withLatestFrom}}),tT=h,Object.defineProperty(k,"zipAll",{enumerable:!0,get:function(){return tT.zipAll}}),rT=R,Object.defineProperty(k,"zipWith",{enumerable:!0,get:function(){return rT.zipWith}});var S={},t={},aT=(Object.defineProperty(t,"__esModule",{value:!0}),t.partition=void 0,lb),uT=fb;t.partition=function(t,r){return function(e){return[uT.filter(t,r)(e),uT.filter(aT.not(t,r))(e)]}};var sT,cT,lT,fT,pT,dT,hT,yT,bT,_T,vT,mT,gT,OT,wT,ET,PT,ST,TT,jT,CT,IT,RT,AT,MT,kT,NT,xT,DT,UT,LT,FT,BT,VT,qT,WT,zT,HT,GT,KT,YT,ZT,QT,XT,JT,$T,ej,tj,rj,nj,oj,ij,aj,uj,sj,cj,lj,fj,pj,dj,hj,yj,bj,_j,vj,mj,gj,Oj,wj,Ej,Pj,Sj,Tj,jj,Cj,Ij,Rj,Aj,Mj,kj,Nj,xj,Dj,Uj,Lj,Fj,Bj,Vj,qj,Wj,zj,Hj,Gj,Kj,Yj,Zj,Qj,Xj,Jj,$j,eC,tC,rC,nC,oC,iC,aC,uC,sC,cC,lC,fC,pC,ro={},dC=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},hC=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},yC=(Object.defineProperty(ro,"__esModule",{value:!0}),ro.race=void 0,tb),bC=zg;ro.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return bC.raceWith.apply(void 0,hC([],dC(yC.argsOrArgArray(e))))},p=S,Object.defineProperty(p,"__esModule",{value:!0}),p.mergeAll=p.merge=p.max=p.materialize=p.mapTo=p.map=p.last=p.isEmpty=p.ignoreElements=p.groupBy=p.first=p.findIndex=p.find=p.finalize=p.filter=p.expand=p.exhaustMap=p.exhaustAll=p.exhaust=p.every=p.endWith=p.elementAt=p.distinctUntilKeyChanged=p.distinctUntilChanged=p.distinct=p.dematerialize=p.delayWhen=p.delay=p.defaultIfEmpty=p.debounceTime=p.debounce=p.count=p.connect=p.concatWith=p.concatMapTo=p.concatMap=p.concatAll=p.concat=p.combineLatestWith=p.combineLatest=p.combineLatestAll=p.combineAll=p.catchError=p.bufferWhen=p.bufferToggle=p.bufferTime=p.bufferCount=p.buffer=p.auditTime=p.audit=void 0,p.timeInterval=p.throwIfEmpty=p.throttleTime=p.throttle=p.tap=p.takeWhile=p.takeUntil=p.takeLast=p.take=p.switchScan=p.switchMapTo=p.switchMap=p.switchAll=p.subscribeOn=p.startWith=p.skipWhile=p.skipUntil=p.skipLast=p.skip=p.single=p.shareReplay=p.share=p.sequenceEqual=p.scan=p.sampleTime=p.sample=p.refCount=p.retryWhen=p.retry=p.repeatWhen=p.repeat=p.reduce=p.raceWith=p.race=p.publishReplay=p.publishLast=p.publishBehavior=p.publish=p.pluck=p.partition=p.pairwise=p.onErrorResumeNext=p.observeOn=p.multicast=p.min=p.mergeWith=p.mergeScan=p.mergeMapTo=p.mergeMap=p.flatMap=void 0,p.zipWith=p.zipAll=p.zip=p.withLatestFrom=p.windowWhen=p.windowToggle=p.windowTime=p.windowCount=p.window=p.toArray=p.timestamp=p.timeoutWith=p.timeout=void 0,sT=Bb,Object.defineProperty(p,"audit",{enumerable:!0,get:function(){return sT.audit}}),cT=zb,Object.defineProperty(p,"auditTime",{enumerable:!0,get:function(){return cT.auditTime}}),lT=Yb,Object.defineProperty(p,"buffer",{enumerable:!0,get:function(){return lT.buffer}}),fT=$b,Object.defineProperty(p,"bufferCount",{enumerable:!0,get:function(){return fT.bufferCount}}),pT=o_,Object.defineProperty(p,"bufferTime",{enumerable:!0,get:function(){return pT.bufferTime}}),dT=d_,Object.defineProperty(p,"bufferToggle",{enumerable:!0,get:function(){return dT.bufferToggle}}),hT=O_,Object.defineProperty(p,"bufferWhen",{enumerable:!0,get:function(){return hT.bufferWhen}}),yT=T_,Object.defineProperty(p,"catchError",{enumerable:!0,get:function(){return yT.catchError}}),bT=R_,Object.defineProperty(p,"combineAll",{enumerable:!0,get:function(){return bT.combineAll}}),_T=A_,Object.defineProperty(p,"combineLatestAll",{enumerable:!0,get:function(){return _T.combineLatestAll}}),vT=Z_,Object.defineProperty(p,"combineLatest",{enumerable:!0,get:function(){return vT.combineLatest}}),mT=Y_,Object.defineProperty(p,"combineLatestWith",{enumerable:!0,get:function(){return mT.combineLatestWith}}),gT=hv,Object.defineProperty(p,"concat",{enumerable:!0,get:function(){return gT.concat}}),OT=Fh,Object.defineProperty(p,"concatAll",{enumerable:!0,get:function(){return OT.concatAll}}),wT=rh,Object.defineProperty(p,"concatMap",{enumerable:!0,get:function(){return wT.concatMap}}),ET=lv,Object.defineProperty(p,"concatMapTo",{enumerable:!0,get:function(){return ET.concatMapTo}}),PT=dv,Object.defineProperty(p,"concatWith",{enumerable:!0,get:function(){return PT.concatWith}}),ST=Pv,Object.defineProperty(p,"connect",{enumerable:!0,get:function(){return ST.connect}}),TT=Sv,Object.defineProperty(p,"count",{enumerable:!0,get:function(){return TT.count}}),jT=kv,Object.defineProperty(p,"debounce",{enumerable:!0,get:function(){return jT.debounce}}),CT=Lv,Object.defineProperty(p,"debounceTime",{enumerable:!0,get:function(){return CT.debounceTime}}),IT=qv,Object.defineProperty(p,"defaultIfEmpty",{enumerable:!0,get:function(){return IT.defaultIfEmpty}}),RT=Hv,Object.defineProperty(p,"delay",{enumerable:!0,get:function(){return RT.delay}}),AT=Gv,Object.defineProperty(p,"delayWhen",{enumerable:!0,get:function(){return AT.delayWhen}}),MT=pm,Object.defineProperty(p,"dematerialize",{enumerable:!0,get:function(){return MT.dematerialize}}),kT=bm,Object.defineProperty(p,"distinct",{enumerable:!0,get:function(){return kT.distinct}}),NT=Om,Object.defineProperty(p,"distinctUntilChanged",{enumerable:!0,get:function(){return NT.distinctUntilChanged}}),xT=Tm,Object.defineProperty(p,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return xT.distinctUntilKeyChanged}}),DT=Cm,Object.defineProperty(p,"elementAt",{enumerable:!0,get:function(){return DT.elementAt}}),UT=Fm,Object.defineProperty(p,"endWith",{enumerable:!0,get:function(){return UT.endWith}}),LT=zm,Object.defineProperty(p,"every",{enumerable:!0,get:function(){return LT.every}}),FT=Km,Object.defineProperty(p,"exhaust",{enumerable:!0,get:function(){return FT.exhaust}}),BT=Ym,Object.defineProperty(p,"exhaustAll",{enumerable:!0,get:function(){return BT.exhaustAll}}),VT=Zm,Object.defineProperty(p,"exhaustMap",{enumerable:!0,get:function(){return VT.exhaustMap}}),qT=r0,Object.defineProperty(p,"expand",{enumerable:!0,get:function(){return qT.expand}}),WT=fb,Object.defineProperty(p,"filter",{enumerable:!0,get:function(){return WT.filter}}),zT=i0,Object.defineProperty(p,"finalize",{enumerable:!0,get:function(){return zT.finalize}}),HT=u0,Object.defineProperty(p,"find",{enumerable:!0,get:function(){return HT.find}}),GT=f0,Object.defineProperty(p,"findIndex",{enumerable:!0,get:function(){return GT.findIndex}}),KT=h0,Object.defineProperty(p,"first",{enumerable:!0,get:function(){return KT.first}}),YT=O0,Object.defineProperty(p,"groupBy",{enumerable:!0,get:function(){return YT.groupBy}}),ZT=Xv,Object.defineProperty(p,"ignoreElements",{enumerable:!0,get:function(){return ZT.ignoreElements}}),QT=j0,Object.defineProperty(p,"isEmpty",{enumerable:!0,get:function(){return QT.isEmpty}}),XT=R0,Object.defineProperty(p,"last",{enumerable:!0,get:function(){return XT.last}}),JT=nh,Object.defineProperty(p,"map",{enumerable:!0,get:function(){return JT.map}}),$T=tm,Object.defineProperty(p,"mapTo",{enumerable:!0,get:function(){return $T.mapTo}}),ej=q0,Object.defineProperty(p,"materialize",{enumerable:!0,get:function(){return ej.materialize}}),tj=G0,Object.defineProperty(p,"max",{enumerable:!0,get:function(){return tj.max}}),rj=rg,Object.defineProperty(p,"merge",{enumerable:!0,get:function(){return rj.merge}}),nj=Bh,Object.defineProperty(p,"mergeAll",{enumerable:!0,get:function(){return nj.mergeAll}}),oj=Z0,Object.defineProperty(p,"flatMap",{enumerable:!0,get:function(){return oj.flatMap}}),ij=Vh,Object.defineProperty(p,"mergeMap",{enumerable:!0,get:function(){return ij.mergeMap}}),aj=Q0,Object.defineProperty(p,"mergeMapTo",{enumerable:!0,get:function(){return aj.mergeMapTo}}),uj=$0,Object.defineProperty(p,"mergeScan",{enumerable:!0,get:function(){return uj.mergeScan}}),sj=qh,Object.defineProperty(p,"mergeWith",{enumerable:!0,get:function(){return sj.mergeWith}}),cj=pg,Object.defineProperty(p,"min",{enumerable:!0,get:function(){return cj.min}}),lj=yg,Object.defineProperty(p,"multicast",{enumerable:!0,get:function(){return lj.multicast}}),fj=pe,Object.defineProperty(p,"observeOn",{enumerable:!0,get:function(){return fj.observeOn}}),pj=mg,Object.defineProperty(p,"onErrorResumeNext",{enumerable:!0,get:function(){return pj.onErrorResumeNext}}),dj=Sg,Object.defineProperty(p,"pairwise",{enumerable:!0,get:function(){return dj.pairwise}}),hj=t,Object.defineProperty(p,"partition",{enumerable:!0,get:function(){return hj.partition}}),yj=Cg,Object.defineProperty(p,"pluck",{enumerable:!0,get:function(){return yj.pluck}}),bj=Rg,Object.defineProperty(p,"publish",{enumerable:!0,get:function(){return bj.publish}}),_j=Ng,Object.defineProperty(p,"publishBehavior",{enumerable:!0,get:function(){return _j.publishBehavior}}),vj=Ug,Object.defineProperty(p,"publishLast",{enumerable:!0,get:function(){return vj.publishLast}}),mj=Bg,Object.defineProperty(p,"publishReplay",{enumerable:!0,get:function(){return mj.publishReplay}}),gj=ro,Object.defineProperty(p,"race",{enumerable:!0,get:function(){return gj.race}}),Oj=zg,Object.defineProperty(p,"raceWith",{enumerable:!0,get:function(){return Oj.raceWith}}),wj=k_,Object.defineProperty(p,"reduce",{enumerable:!0,get:function(){return wj.reduce}}),Ej=Qg,Object.defineProperty(p,"repeat",{enumerable:!0,get:function(){return Ej.repeat}}),Pj=rO,Object.defineProperty(p,"repeatWhen",{enumerable:!0,get:function(){return Pj.repeatWhen}}),Sj=uO,Object.defineProperty(p,"retry",{enumerable:!0,get:function(){return Sj.retry}}),Tj=dO,Object.defineProperty(p,"retryWhen",{enumerable:!0,get:function(){return Tj.retryWhen}}),jj=Z,Object.defineProperty(p,"refCount",{enumerable:!0,get:function(){return jj.refCount}}),Cj=vO,Object.defineProperty(p,"sample",{enumerable:!0,get:function(){return Cj.sample}}),Ij=EO,Object.defineProperty(p,"sampleTime",{enumerable:!0,get:function(){return Ij.sampleTime}}),Rj=jO,Object.defineProperty(p,"scan",{enumerable:!0,get:function(){return Rj.scan}}),Aj=N_,Object.defineProperty(p,"sequenceEqual",{enumerable:!0,get:function(){return Aj.sequenceEqual}}),Mj=NO,Object.defineProperty(p,"share",{enumerable:!0,get:function(){return Mj.share}}),kj=qO,Object.defineProperty(p,"shareReplay",{enumerable:!0,get:function(){return kj.shareReplay}}),Nj=HO,Object.defineProperty(p,"single",{enumerable:!0,get:function(){return Nj.single}}),xj=XO,Object.defineProperty(p,"skip",{enumerable:!0,get:function(){return xj.skip}}),Dj=$O,Object.defineProperty(p,"skipLast",{enumerable:!0,get:function(){return Dj.skipLast}}),Uj=nw,Object.defineProperty(p,"skipUntil",{enumerable:!0,get:function(){return Uj.skipUntil}}),Lj=sw,Object.defineProperty(p,"skipWhile",{enumerable:!0,get:function(){return Lj.skipWhile}}),Fj=fw,Object.defineProperty(p,"startWith",{enumerable:!0,get:function(){return Fj.startWith}}),Bj=Xp,Object.defineProperty(p,"subscribeOn",{enumerable:!0,get:function(){return Bj.subscribeOn}}),Vj=yw,Object.defineProperty(p,"switchAll",{enumerable:!0,get:function(){return Vj.switchAll}}),qj=bw,Object.defineProperty(p,"switchMap",{enumerable:!0,get:function(){return qj.switchMap}}),Wj=ww,Object.defineProperty(p,"switchMapTo",{enumerable:!0,get:function(){return Wj.switchMapTo}}),zj=Sw,Object.defineProperty(p,"switchScan",{enumerable:!0,get:function(){return zj.switchScan}}),Hj=Kv,Object.defineProperty(p,"take",{enumerable:!0,get:function(){return Hj.take}}),Gj=A0,Object.defineProperty(p,"takeLast",{enumerable:!0,get:function(){return Gj.takeLast}}),Kj=Cw,Object.defineProperty(p,"takeUntil",{enumerable:!0,get:function(){return Kj.takeUntil}}),Yj=kw,Object.defineProperty(p,"takeWhile",{enumerable:!0,get:function(){return Yj.takeWhile}}),Zj=Dw,Object.defineProperty(p,"tap",{enumerable:!0,get:function(){return Zj.tap}}),Qj=o,Object.defineProperty(p,"throttle",{enumerable:!0,get:function(){return Qj.throttle}}),Xj=zw,Object.defineProperty(p,"throttleTime",{enumerable:!0,get:function(){return Xj.throttleTime}}),Jj=Im,Object.defineProperty(p,"throwIfEmpty",{enumerable:!0,get:function(){return Jj.throwIfEmpty}}),$j=Yw,Object.defineProperty(p,"timeInterval",{enumerable:!0,get:function(){return $j.timeInterval}}),eC=Op,Object.defineProperty(p,"timeout",{enumerable:!0,get:function(){return eC.timeout}}),tC=$w,Object.defineProperty(p,"timeoutWith",{enumerable:!0,get:function(){return tC.timeoutWith}}),rC=ad,Object.defineProperty(p,"timestamp",{enumerable:!0,get:function(){return rC.timestamp}}),nC=M_,Object.defineProperty(p,"toArray",{enumerable:!0,get:function(){return nC.toArray}}),oC=Ia,Object.defineProperty(p,"window",{enumerable:!0,get:function(){return oC.window}}),iC=lE,Object.defineProperty(p,"windowCount",{enumerable:!0,get:function(){return iC.windowCount}}),aC=yE,Object.defineProperty(p,"windowTime",{enumerable:!0,get:function(){return aC.windowTime}}),uC=Kp,Object.defineProperty(p,"windowToggle",{enumerable:!0,get:function(){return uC.windowToggle}}),sC=v,Object.defineProperty(p,"windowWhen",{enumerable:!0,get:function(){return sC.windowWhen}}),cC=DE,Object.defineProperty(p,"withLatestFrom",{enumerable:!0,get:function(){return cC.withLatestFrom}}),lC=u,Object.defineProperty(p,"zip",{enumerable:!0,get:function(){return lC.zip}}),fC=h,Object.defineProperty(p,"zipAll",{enumerable:!0,get:function(){return fC.zipAll}}),pC=R,Object.defineProperty(p,"zipWith",{enumerable:!0,get:function(){return pC.zipWith}});var uo={},_C=r&&r.__awaiter||function(e,a,u,s){return new(u=u||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof u?t:new u(function(e){e(t)})).then(n,o)}i((s=s.apply(e,a||[])).next())})},vC=r&&r.__generator||function(n,o){var i,a,u,s={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,a&&(u=2&t[0]?a.return:t[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,t[1])).done)return u;switch(a=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(u=0<(u=s.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3]))s.label=t[1];else if(6===t[0]&&s.label<u[1])s.label=u[1],u=t;else{if(!(u&&s.label<u[2])){u[2]&&s.ops.pop(),s.trys.pop();continue}s.label=u[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],a=0}finally{i=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},mC=(Object.defineProperty(uo,"__esModule",{value:!0}),e),gC=Da,OC=S,wC=0,EC=1,PC=2;function SC(e,t){e=e.pipe((0,OC.publishReplay)(1),(0,OC.refCount)());this._result=e,this._keys=e.pipe((0,OC.mergeMap)(function(e){return(0,gC.from)(e.keys())}),(0,OC.publishReplay)(1),(0,OC.refCount)()),this._records=void 0,this._controls=new TC,this._summary=new gC.ReplaySubject,this._state=t||wC}SC.prototype.keys=function(){return this._keys},SC.prototype.records=function(){var r=this,e=this._result.pipe((0,OC.mergeMap)(function(t){return new gC.Observable(function(e){return r._startStreaming({result:t,recordsObserver:e})})}));return e.push=function(){return r._push()},e},SC.prototype.consume=function(){var r=this;return this._result.pipe((0,OC.mergeMap)(function(t){return new gC.Observable(function(e){return r._startStreaming({result:t,summaryObserver:e})})}))},SC.prototype.pause=function(){this._controls.pause()},SC.prototype.resume=function(){return this._controls.resume()},SC.prototype.push=function(){return this._controls.push()},SC.prototype._startStreaming=function(e){var e=void 0===e?{}:e,t=e.result,r=e.recordsObserver,r=void 0===r?null:r,e=e.summaryObserver,e=void 0===e?null:e,n=[];return e&&n.push(this._summary.subscribe(e)),this._state<EC?(this._state=EC,this._setupRecordsStream(t),r?n.push(this._records.subscribe(r)):t._cancel(),n.push({unsubscribe:function(){t._cancel&&t._cancel()}})):r&&r.error((0,mC.newError)("Streaming has already started/consumed with a previous records or summary subscription.")),function(){n.forEach(function(e){return e.unsubscribe()})}},SC.prototype._toObservable=function(){var n=this;return new gC.Observable(function(r){n._result.subscribe({complete:function(){return r.complete()},next:function(e){return r.next(new SC((t=e,new gC.Observable(function(e){e.next(t),e.complete()}))),n._state);var t},error:function(e){return r.error(e)}})})},SC.prototype._setupRecordsStream=function(n){var t=this;return this._records||(this._records=function(o,i,a){var e=this;void 0===a&&(a=new TC);var u=new gC.Subject,s=function(n){return _C(e,void 0,void 0,function(){var t,r;return vC(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,3,4]),a.pushing=!0,[4,n];case 1:return t=e.sent(),r=t.done,t=t.value,r?(u.complete(),i.complete()):(u.next(t),a.paused||s(o.next()).catch(function(){})),[3,4];case 2:return r=e.sent(),u.error(r),i.error(r),[3,4];case 3:return a.pushing=!1,[7];case 4:return[2]}})})};function t(t){return _C(this,void 0,void 0,function(){return vC(this,function(e){switch(e.label){case 0:return[4,s(o.next(t))];case 1:return e.sent(),[2]}})})}return(a.pusher=t)(),u}(n[Symbol.asyncIterator](),{complete:function(){return _C(t,void 0,void 0,function(){var t,r;return vC(this,function(e){switch(e.label){case 0:return this._state=PC,r=(t=this._summary).next,[4,n.summary()];case 1:return r.apply(t,[e.sent()]),this._summary.complete(),[2]}})})},error:function(e){t._state=PC,t._summary.error(e)}},this._controls)),this._records},uo.default=SC;jC.prototype.pause=function(){this._paused=!0},Object.defineProperty(jC.prototype,"paused",{get:function(){return this._paused},enumerable:!1,configurable:!0}),Object.defineProperty(jC.prototype,"pushing",{get:function(){return this._pushing},set:function(e){this._pushing=e},enumerable:!1,configurable:!0}),jC.prototype.resume=function(){return _C(this,void 0,void 0,function(){var t;return vC(this,function(e){switch(e.label){case 0:return t=this._paused,this._paused=!1,!t||this._pushing?[3,2]:[4,this._push()];case 1:e.sent(),e.label=2;case 2:return[2]}})})},jC.prototype.push=function(){return _C(this,void 0,void 0,function(){return vC(this,function(e){switch(e.label){case 0:return this.pause(),[4,this._push()];case 1:return[2,e.sent()]}})})},Object.defineProperty(jC.prototype,"pusher",{get:function(){return this._push},set:function(e){this._push=e},enumerable:!1,configurable:!0});var TC=jC;function jC(e){void 0===e&&(e=function(){return _C(t,void 0,void 0,function(){return vC(this,function(e){return[2]})})});var t=this;this._paused=!1,this._pushing=!1,this._push=e}var E={},Wr=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},CC=(Object.defineProperty(E,"__esModule",{value:!0}),Da),IC=Wr(uo);function RC(e){this._txc=e}Wr(e),RC.prototype.run=function(e,r){var n=this;return new IC.default(new CC.Observable(function(t){try{t.next(n._txc.run(e,r)),t.complete()}catch(e){t.error(e)}return function(){}}))},RC.prototype.commit=function(){var e=this;return new CC.Observable(function(t){e._txc.commit().then(function(){t.complete()}).catch(function(e){return t.error(e)})})},RC.prototype.rollback=function(){var e=this;return new CC.Observable(function(t){e._txc.rollback().then(function(){t.complete()}).catch(function(e){return t.error(e)})})},RC.prototype.isOpen=function(){return this._txc.isOpen()},RC.prototype.close=function(){var e=this;return new CC.Observable(function(t){e._txc.close().then(function(){t.complete()}).catch(function(e){return t.error(e)})})},E.default=RC;T={},l=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};function AC(e){e=e.run;this._run=e}Object.defineProperty(T,"__esModule",{value:!0}),l(uo),l(E),AC.fromTransaction=function(e){return new AC({run:e.run.bind(e)})},AC.prototype.run=function(e,t){return this._run(e,t)},T.default=AC;var I={},MC=(Object.defineProperty(I,"__esModule",{value:!0}),e),kC=Da,NC=S,xC=(MC.internal.logger.Logger,MC.error.SERVICE_UNAVAILABLE);function DC(e){var e=void 0===e?{}:e,t=e.maxRetryTimeout,r=e.initialDelay,r=void 0===r?1e3:r,n=e.delayMultiplier,n=void 0===n?2:n,o=e.delayJitter,o=void 0===o?.2:o,e=e.logger,e=void 0===e?null:e;this._maxRetryTimeout=UC(void 0===t?3e4:t,3e4),this._initialDelay=UC(r,1e3),this._delayMultiplier=UC(n,2),this._delayJitter=UC(o,.2),this._logger=e}function UC(e,t){return e||0===e?e:t}DC.prototype.retry=function(e){var u=this;return e.pipe((0,NC.retryWhen)(function(e){var n=[],o=Date.now(),i=1,a=u._initialDelay;return e.pipe((0,NC.mergeMap)(function(e){var t,r;return(0,MC.isRetryableError)(e)?(n.push(e),2<=i&&Date.now()-o>=u._maxRetryTimeout?((t=(0,MC.newError)("Failed after retried for ".concat(i," times in ").concat(u._maxRetryTimeout," ms. Make sure that your database is online and retry again."),xC)).seenErrors=n,(0,kC.throwError)(function(){return t})):(r=u._computeNextDelay(a),a*=u._delayMultiplier,i++,u._logger&&u._logger.warn("Transaction failed and will be retried in ".concat(r)),(0,kC.of)(1).pipe((0,NC.delay)(r)))):(0,kC.throwError)(function(){return e})}))}))},DC.prototype._computeNextDelay=function(e){var t=e*this._delayJitter;return e-t+2*t*Math.random()},I.default=DC;var wa=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},LC=(Object.defineProperty(bo,"__esModule",{value:!0}),Da),FC=S,BC=wa(uo),j=e,VC=wa(E),qC=wa(T),WC=wa(I),y=j.internal.constants,zC=y.ACCESS_MODE_READ,HC=y.ACCESS_MODE_WRITE,GC=y.TELEMETRY_APIS,KC=j.internal.txConfig.TxConfig;function YC(e){var e=void 0===e?{}:e,t=e.session,r=e.config,e=e.log;this._session=t,this._retryLogic=(e=>(e=e&&e.maxTransactionRetryTime?e.maxTransactionRetryTime:null,new WC.default({maxRetryTimeout:e})))(r),this._log=e}YC.prototype.run=function(e,r,n){var o=this;return new BC.default(new LC.Observable(function(t){try{t.next(o._session.run(e,r,n)),t.complete()}catch(e){t.error(e)}return function(){}}))},YC.prototype.beginTransaction=function(e){return this._beginTransaction(this._session._mode,e,{api:GC.UNMANAGED_TRANSACTION})},YC.prototype.executeRead=function(e,t){return this._executeInTransaction(zC,e,t)},YC.prototype.executeWrite=function(e,t){return this._executeInTransaction(HC,e,t)},YC.prototype._executeInTransaction=function(e,t,r){return this._runTransaction(e,t,r,function(e){return new qC.default({run:e.run.bind(e)})})},YC.prototype.close=function(){var e=this;return new LC.Observable(function(t){e._session.close().then(function(){t.complete()}).catch(function(e){return t.error(e)})})},YC.prototype[Symbol.asyncDispose]=function(){return this.close()},YC.prototype.lastBookmarks=function(){return this._session.lastBookmarks()},YC.prototype._beginTransaction=function(e,t,r){var n=this,o=KC.empty();return t&&(o=new KC(t,this._log)),new LC.Observable(function(t){try{n._session._beginTransaction(e,o,r).then(function(e){t.next(new VC.default(e)),t.complete()}).catch(function(e){return t.error(e)})}catch(e){t.error(e)}return function(){}})},YC.prototype._runTransaction=function(e,r,t,n){var o=this,i=(void 0===n&&(n=function(e){return e}),KC.empty()),a=(t&&(i=new KC(t)),{apiTelemetryConfig:{api:GC.MANAGED_TRANSACTION,onTelemetrySuccess:function(){a.apiTelemetryConfig=void 0}}});return this._retryLogic.retry((0,LC.of)(1).pipe((0,FC.mergeMap)(function(){return o._beginTransaction(e,i,a.apiTelemetryConfig)}),(0,FC.mergeMap)(function(t){return(0,LC.defer)(function(){try{return r(n(t))}catch(e){return(0,LC.throwError)(function(){return e})}}).pipe((0,FC.catchError)(function(e){return t.rollback().pipe((0,FC.concatWith)((0,LC.throwError)(function(){return e})))}),(0,FC.concatWith)(t.commit()))})))},bo.default=YC;var ZC,QC,B=r&&r.__extends||(ZC=function(e,t){return(ZC=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ZC(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),w=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Ar=(Object.defineProperty(L,"__esModule",{value:!0}),L.WRITE=L.READ=L.Driver=void 0,e),XC=w(bo),JC=Ar.internal.constants.FETCH_ALL,O=Ar.driver.READ,$C=Ar.driver.WRITE,Kr=(L.READ=O,L.WRITE=$C,B(eI,QC=Ar.Driver),eI.prototype.rxSession=function(e){var e=void 0===e?{}:e,t=e.defaultAccessMode,r=e.database,n=e.bookmarkManager,o=e.notificationFilter,i=e.disableAutoCommitRetries;return new XC.default({session:this._newSession({defaultAccessMode:void 0===t?$C:t,bookmarkOrBookmarks:e.bookmarks,database:void 0===r?"":r,impersonatedUser:e.impersonatedUser,auth:e.auth,reactive:!1,fetchSize:((e,t)=>{if(0<(e=parseInt(e,10))||e===JC)return e;if(0===e||e<0)throw new Error("The fetch size can only be a positive value or ".concat(JC," for ALL. However fetchSize = ").concat(e));return t})(e.fetchSize,this._config.fetchSize),bookmarkManager:n,notificationFilter:o,log:this._log,disableAutoCommitRetries:i}),config:this._config,log:this._log})},eI);function eI(){return null!==QC&&QC.apply(this,arguments)||this}L.Driver=Kr,L.default=Kr;a={},Object.defineProperty(a,"__esModule",{value:!0}),a.default="6.3.0",Xn={},_p={},lp={};function tI(){}Object.defineProperty(lp,"__esModule",{value:!0}),tI.prototype.selectReader=function(e){throw new Error("Abstract function")},tI.prototype.selectWriter=function(e){throw new Error("Abstract function")},lp.default=tI;dp={},yp={};function rI(e){this._offset=e||0}Object.defineProperty(yp,"__esModule",{value:!0}),rI.prototype.next=function(e){var t;return 0===e?-1:(t=this._offset,this._offset+=1,this._offset===Number.MAX_SAFE_INTEGER&&(this._offset=0),t%e)},yp.default=rI;var nI,oI,sp=r&&r.__extends||(nI=function(e,t){return(nI=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}nI(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),yd=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},iI=(Object.defineProperty(dp,"__esModule",{value:!0}),yd(yp)),co=yd(lp),rd=(oI=co.default,sp(aI,oI),aI.prototype.selectReader=function(e){return this._select(e,this._readersIndex)},aI.prototype.selectWriter=function(e){return this._select(e,this._writersIndex)},aI.prototype._select=function(e,t){var r=e.length;if(0===r)return null;var n=t.next(r),o=n,i=null,a=Number.MAX_SAFE_INTEGER;do{var u=e[o],s=this._connectionPool.activeResourceCount(u)}while(s<a&&(i=u,a=s),o===r-1?o=0:o++,o!==n);return i},aI);function aI(e){var t=oI.call(this)||this;return t._readersIndex=new iI.default,t._writersIndex=new iI.default,t._connectionPool=e,t}dp.default=rd;var uI,F=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},bp=(Object.defineProperty(_p,"__esModule",{value:!0}),_p.LeastConnectedLoadBalancingStrategy=_p.LoadBalancingStrategy=void 0,F(lp)),mh=(_p.LoadBalancingStrategy=bp.default,F(dp)),m=(_p.LeastConnectedLoadBalancingStrategy=mh.default,_p.default=mh.default,{}),Lh={},ny=r&&r.__extends||(uI=function(e,t){return(uI=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}uI(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),oy=(Object.defineProperty(Lh,"__esModule",{value:!0}),sI.prototype.getUInt8=function(e){throw new Error("Not implemented")},sI.prototype.getInt8=function(e){throw new Error("Not implemented")},sI.prototype.getFloat64=function(e){throw new Error("Not implemented")},sI.prototype.getVarInt=function(e){throw new Error("Not implemented")},sI.prototype.putUInt8=function(e,t){throw new Error("Not implemented")},sI.prototype.putInt8=function(e,t){throw new Error("Not implemented")},sI.prototype.putFloat64=function(e,t){throw new Error("Not implemented")},sI.prototype.getInt16=function(e){return this.getInt8(e)<<8|this.getUInt8(e+1)},sI.prototype.getUInt16=function(e){return this.getUInt8(e)<<8|this.getUInt8(e+1)},sI.prototype.getInt32=function(e){return this.getInt8(e)<<24|this.getUInt8(e+1)<<16|this.getUInt8(e+2)<<8|this.getUInt8(e+3)},sI.prototype.getUInt32=function(e){e=this.getInt32(e);return 0<=e?e:Math.pow(2,32)+e},sI.prototype.getSlice=function(e,t){return new lI(e,t,this)},sI.prototype.putInt16=function(e,t){this.putInt8(e,t>>8),this.putUInt8(e+1,255&t)},sI.prototype.putUInt16=function(e,t){this.putUInt8(e,t>>8&255),this.putUInt8(e+1,255&t)},sI.prototype.putInt32=function(e,t){this.putInt8(e,t>>24),this.putUInt8(e+1,t>>16&255),this.putUInt8(e+2,t>>8&255),this.putUInt8(e+3,255&t)},sI.prototype.putUInt32=function(e,t){this.putUInt8(e,t>>24&255),this.putUInt8(e+1,t>>16&255),this.putUInt8(e+2,t>>8&255),this.putUInt8(e+3,255&t)},sI.prototype.putVarInt=function(e,t){for(var r=0;1<t;){var n=t%128;128<=t&&(n+=128),t/=128,this.putUInt8(e+r,n),r+=1}return r},sI.prototype.putBytes=function(e,t){for(var r=0,n=t.remaining();r<n;r++)this.putUInt8(e+r,t.readUInt8())},sI.prototype.readUInt8=function(){return this.getUInt8(this._updatePos(1))},sI.prototype.readInt8=function(){return this.getInt8(this._updatePos(1))},sI.prototype.readUInt16=function(){return this.getUInt16(this._updatePos(2))},sI.prototype.readUInt32=function(){return this.getUInt32(this._updatePos(4))},sI.prototype.readInt16=function(){return this.getInt16(this._updatePos(2))},sI.prototype.readInt32=function(){return this.getInt32(this._updatePos(4))},sI.prototype.readFloat64=function(){return this.getFloat64(this._updatePos(8))},sI.prototype.readVarInt=function(){var e=this.getVarInt(this.position);return this._updatePos(e.length),e.value},sI.prototype.writeUInt8=function(e){this.putUInt8(this._updatePos(1),e)},sI.prototype.writeInt8=function(e){this.putInt8(this._updatePos(1),e)},sI.prototype.writeInt16=function(e){this.putInt16(this._updatePos(2),e)},sI.prototype.writeInt32=function(e){this.putInt32(this._updatePos(4),e)},sI.prototype.writeUInt32=function(e){this.putUInt32(this._updatePos(4),e)},sI.prototype.writeFloat64=function(e){this.putFloat64(this._updatePos(8),e)},sI.prototype.writeVarInt=function(e){e=this.putVarInt(this.position,e);this._updatePos(e)},sI.prototype.writeBytes=function(e){this.putBytes(this._updatePos(e.remaining()),e)},sI.prototype.readSlice=function(e){return this.getSlice(this._updatePos(e),e)},sI.prototype._updatePos=function(e){var t=this.position;return this.position+=e,t},sI.prototype.remaining=function(){return this.length-this.position},sI.prototype.hasRemaining=function(){return 0<this.remaining()},sI.prototype.reset=function(){this.position=0},sI.prototype.toString=function(){return this.constructor.name+"( position="+this.position+" )\n "+this.toHex()},sI.prototype.toHex=function(){for(var e="",t=0;t<this.length;t++){var r=this.getUInt8(t).toString(16);e+=r=1===r.length?"0"+r:r,t!==this.length-1&&(e+=" ")}return e},sI);function sI(e){this.position=0,this.length=e}Lh.default=oy;ny(fI,cI=oy),fI.prototype.putUInt8=function(e,t){this._inner.putUInt8(this._start+e,t)},fI.prototype.getUInt8=function(e){return this._inner.getUInt8(this._start+e)},fI.prototype.putInt8=function(e,t){this._inner.putInt8(this._start+e,t)},fI.prototype.putFloat64=function(e,t){this._inner.putFloat64(this._start+e,t)},fI.prototype.getInt8=function(e){return this._inner.getInt8(this._start+e)},fI.prototype.getFloat64=function(e){return this._inner.getFloat64(this._start+e)};var cI,lI=fI;function fI(e,t,r){t=cI.call(this,t)||this;return t._start=e,t._inner=r,t}fy=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(m,"__esModule",{value:!0}),m.BaseBuffer=void 0,b=fy(Lh),m.BaseBuffer=b.default,m.default=b.default,Oh={},Th={},n={},sd={},Fy={},C={byteLength:function(e){var e=vI(e),t=e[0],e=e[1];return 3*(t+e)/4-e}};C.toByteArray=function(e){var t,r,n=vI(e),o=n[0],n=n[1],i=new hI(((e,t)=>3*(e+t)/4-t)(o,n)),a=0,u=0<n?o-4:o;for(r=0;r<u;r+=4)t=dI[e.charCodeAt(r)]<<18|dI[e.charCodeAt(r+1)]<<12|dI[e.charCodeAt(r+2)]<<6|dI[e.charCodeAt(r+3)],i[a++]=t>>16&255,i[a++]=t>>8&255,i[a++]=255&t;2===n&&(t=dI[e.charCodeAt(r)]<<2|dI[e.charCodeAt(r+1)]>>4,i[a++]=255&t);1===n&&(t=dI[e.charCodeAt(r)]<<10|dI[e.charCodeAt(r+1)]<<4|dI[e.charCodeAt(r+2)]>>2,i[a++]=t>>8&255,i[a++]=255&t);return i},C.fromByteArray=function(e){for(var t,r=e.length,n=r%3,o=[],i=0,a=r-n;i<a;i+=16383)o.push(((e,t,r)=>{for(var n,o=[],i=t;i<r;i+=3)n=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push((e=>pI[e>>18&63]+pI[e>>12&63]+pI[e>>6&63]+pI[63&e])(n));return o.join("")})(e,i,a<i+16383?a:i+16383));1==n?(t=e[r-1],o.push(pI[t>>2]+pI[t<<4&63]+"==")):2==n&&(t=(e[r-2]<<8)+e[r-1],o.push(pI[t>>10]+pI[t>>4&63]+pI[t<<2&63]+"="));return o.join("")};for(var pI=[],dI=[],hI="undefined"!=typeof Uint8Array?Uint8Array:Array,yI="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bI=0,_I=yI.length;bI<_I;++bI)pI[bI]=yI[bI],dI[yI.charCodeAt(bI)]=bI;function vI(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");e=e.indexOf("="),t=(e=-1===e?t:e)===t?0:4-e%4;return[e,t]}dI["-".charCodeAt(0)]=62,dI["_".charCodeAt(0)]=63;g={read:function(e,t,r,n,o){var i,a,u=8*o-n-1,s=(1<<u)-1,c=s>>1,l=-7,f=r?o-1:0,p=r?-1:1,o=e[t+f];for(f+=p,i=o&(1<<-l)-1,o>>=-l,l+=u;0<l;i=256*i+e[t+f],f+=p,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=n;0<l;a=256*a+e[t+f],f+=p,l-=8);if(0===i)i=1-c;else{if(i===s)return a?NaN:1/0*(o?-1:1);a+=Math.pow(2,n),i-=c}return(o?-1:1)*a*Math.pow(2,i-n)},write:function(e,t,r,n,o,i){var a,u,s=8*i-o-1,c=(1<<s)-1,l=c>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,d=n?1:-1,i=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(n=Math.pow(2,-a))<1&&(a--,n*=2),2<=(t+=1<=a+l?f/n:f*Math.pow(2,1-l))*n&&(a++,n/=2),c<=a+l?(u=0,a=c):1<=a+l?(u=(t*n-1)*Math.pow(2,o),a+=l):(u=t*Math.pow(2,l-1)*Math.pow(2,o),a=0));8<=o;e[r+p]=255&u,p+=d,u/=256,o-=8);for(a=a<<o|u,s+=o;0<s;e[r+p]=255&a,p+=d,a/=256,s-=8);e[r+p-d]|=128*i}};{var mI=Fy;let y=C,i=g,t=(eb="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null,mI.Buffer=N,mI.SlowBuffer=function(e){+e!=e&&(e=0);return N.alloc(+e)},mI.INSPECT_MAX_BYTES=50,2147483647);function gI(e){if(e>t)throw new RangeError('The value "'+e+'" is invalid for option "size"');e=new Uint8Array(e);return Object.setPrototypeOf(e,N.prototype),e}function N(e,t,r){if("number"!=typeof e)return OI(e,t,r);if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return EI(e)}function OI(n,o,e){if("string"==typeof n){var i=n;var a=o;if(!N.isEncoding(a="string"==typeof a&&""!==a?a:"utf8"))throw new TypeError("Unknown encoding: "+a);let e=0|jI(i,a),t=gI(e),r=t.write(i,a);return t=r!==e?t.slice(0,r):t}if(ArrayBuffer.isView(n))return QI(i=n,Uint8Array)?SI((a=new Uint8Array(i)).buffer,a.byteOffset,a.byteLength):PI(i);if(null!=n){if(QI(n,ArrayBuffer)||n&&QI(n.buffer,ArrayBuffer))return SI(n,o,e);if("undefined"!=typeof SharedArrayBuffer&&(QI(n,SharedArrayBuffer)||n&&QI(n.buffer,SharedArrayBuffer)))return SI(n,o,e);if("number"==typeof n)throw new TypeError('The "value" argument must not be of type number. Received type number');var t=n.valueOf&&n.valueOf();if(null!=t&&t!==n)return N.from(t,o,e);t=(e=>{var t,r;return N.isBuffer(e)?(t=0|TI(e.length),0!==(r=gI(t)).length&&e.copy(r,0,0,t),r):void 0!==e.length?"number"!=typeof e.length||XI(e.length)?gI(0):PI(e):"Buffer"===e.type&&Array.isArray(e.data)?PI(e.data):void 0})(n);if(t)return t;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof n[Symbol.toPrimitive])return N.from(n[Symbol.toPrimitive]("string"),o,e)}throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof n)}function wI(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function EI(e){return wI(e),gI(e<0?0:0|TI(e))}function PI(t){var r=t.length<0?0:0|TI(t.length),n=gI(r);for(let e=0;e<r;e+=1)n[e]=255&t[e];return n}function SI(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,N.prototype),n}function TI(e){if(e>=t)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+t.toString(16)+" bytes");return 0|e}function jI(e,t){if(N.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||QI(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=2<arguments.length&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return KI(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return YI(e).length;default:if(o)return n?-1:KI(e).length;t=(""+t).toLowerCase(),o=!0}}function CI(e,n,o){let t=!1;if((n=void 0===n||n<0?0:n)>this.length)return"";if((o=void 0===o||o>this.length?this.length:o)<=0)return"";if((o>>>=0)<=(n>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":{var r=this;var i=n;var a=o;var u=r.length;(!a||a<0||u<a)&&(a=u);let t="";for(let e=i=!i||i<0?0:i;e<a;++e)t+=b[r[e]];return t;return}case"utf8":case"utf-8":return NI(this,n,o);case"ascii":{var s=this;u=n;var c=o;let t="";c=Math.min(s.length,c);for(let e=u;e<c;++e)t+=String.fromCharCode(127&s[e]);return t;return}case"latin1":case"binary":{var l=this;i=n;var f=o;let t="";f=Math.min(l.length,f);for(let e=i;e<f;++e)t+=String.fromCharCode(l[e]);return t;return}case"base64":return p=this,h=o,0===(d=n)&&h===p.length?y.fromByteArray(p):y.fromByteArray(p.slice(d,h));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":{p=this;d=n;h=o;let t=p.slice(d,h),r="";for(let e=0;e<t.length-1;e+=2)r+=String.fromCharCode(t[e]+256*t[e+1]);return r;return}default:if(t)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),t=!0}var p,d,h}function II(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function RI(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):2147483647<r?r=2147483647:r<-2147483648&&(r=-2147483648),(r=XI(r=+r)?o?0:e.length-1:r)<0&&(r=e.length+r),e.length<=r){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=N.from(t,n)),N.isBuffer(t))return 0===t.length?-1:AI(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?(o?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,t,r):AI(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function AI(r,n,t,e,o){let i=1,a=r.length,u=n.length;if(void 0!==e&&("ucs2"===(e=String(e).toLowerCase())||"ucs-2"===e||"utf16le"===e||"utf-16le"===e)){if(r.length<2||n.length<2)return-1;i=2,a/=2,u/=2,t/=2}function s(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}let c;if(o){let e=-1;for(c=t;c<a;c++)if(s(r,c)===s(n,-1===e?0:c-e)){if(-1===e&&(e=c),c-e+1===u)return e*i}else-1!==e&&(c-=c-e),e=-1}else for(t+u>a&&(t=a-u),c=t;0<=c;c--){let t=!0;for(let e=0;e<u;e++)if(s(r,c+e)!==s(n,e)){t=!1;break}if(t)return c}return-1}function MI(e,t,r,n){return ZI((t=>{var r=[];for(let e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r})(t),e,r,n)}function kI(e,t,r,n){return ZI(((t,r)=>{let n,o,i=[];for(let e=0;e<t.length&&!((r-=2)<0);++e)n=t.charCodeAt(e),o=n>>8,i.push(n%256),i.push(o);return i})(t,e.length-r),e,r,n)}function NI(a,e,t){t=Math.min(a.length,t);var r=[];let u=e;for(;u<t;){var s=a[u];let o=null,i=239<s?4:223<s?3:191<s?2:1;if(u+i<=t){let e,t,r,n;switch(i){case 1:s<128&&(o=s);break;case 2:128==(192&(e=a[u+1]))&&127<(n=(31&s)<<6|63&e)&&(o=n);break;case 3:e=a[u+1],t=a[u+2],128==(192&e)&&128==(192&t)&&2047<(n=(15&s)<<12|(63&e)<<6|63&t)&&(n<55296||57343<n)&&(o=n);break;case 4:e=a[u+1],t=a[u+2],r=a[u+3],128==(192&e)&&128==(192&t)&&128==(192&r)&&65535<(n=(15&s)<<18|(63&e)<<12|(63&t)<<6|63&r)&&n<1114112&&(o=n)}}null===o?(o=65533,i=1):65535<o&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),u+=i}{var n=r,o=n.length;if(o<=c)return String.fromCharCode.apply(String,n);let e="",t=0;for(;t<o;)e+=String.fromCharCode.apply(String,n.slice(t,t+=c));return e}}mI.kMaxLength=t,(N.TYPED_ARRAY_SUPPORT=(()=>{try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}})())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(N.prototype,"parent",{enumerable:!0,get:function(){if(N.isBuffer(this))return this.buffer}}),Object.defineProperty(N.prototype,"offset",{enumerable:!0,get:function(){if(N.isBuffer(this))return this.byteOffset}}),N.poolSize=8192,N.from=OI,Object.setPrototypeOf(N.prototype,Uint8Array.prototype),Object.setPrototypeOf(N,Uint8Array),N.alloc=function(e,t,r){return t=t,r=r,wI(e=e),!(e<=0)&&void 0!==t?"string"==typeof r?gI(e).fill(t,r):gI(e).fill(t):gI(e)},N.allocUnsafe=EI,N.allocUnsafeSlow=EI,N.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==N.prototype},N.compare=function(r,n){if(QI(r,Uint8Array)&&(r=N.from(r,r.offset,r.byteLength)),QI(n,Uint8Array)&&(n=N.from(n,n.offset,n.byteLength)),!N.isBuffer(r)||!N.isBuffer(n))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===n)return 0;let o=r.length,i=n.length;for(let e=0,t=Math.min(o,i);e<t;++e)if(r[e]!==n[e]){o=r[e],i=n[e];break}return o<i?-1:i<o?1:0},N.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},N.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return N.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=N.allocUnsafe(e);let o=0;for(r=0;r<t.length;++r){let e=t[r];if(QI(e,Uint8Array))o+e.length>n.length?(e=N.isBuffer(e)?e:N.from(e)).copy(n,o):Uint8Array.prototype.set.call(n,e,o);else{if(!N.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,o)}o+=e.length}return n},N.byteLength=jI,N.prototype._isBuffer=!0,N.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)II(this,e,e+1);return this},N.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)II(this,e,e+3),II(this,e+1,e+2);return this},N.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)II(this,e,e+7),II(this,e+1,e+6),II(this,e+2,e+5),II(this,e+3,e+4);return this},N.prototype.toLocaleString=N.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?NI(this,0,e):CI.apply(this,arguments)},N.prototype.equals=function(e){if(N.isBuffer(e))return this===e||0===N.compare(this,e);throw new TypeError("Argument must be a Buffer")},N.prototype.inspect=function(){let e="";var t=mI.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},eb&&(N.prototype[eb]=N.prototype.inspect),N.prototype.compare=function(e,t,r,n,o){if(QI(e,Uint8Array)&&(e=N.from(e,e.offset,e.byteLength)),!N.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),(t=void 0===t?0:t)<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(o<=n&&r<=t)return 0;if(o<=n)return-1;if(r<=t)return 1;if(this===e)return 0;let i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);var u=Math.min(i,a),s=this.slice(n,o),c=e.slice(t,r);for(let e=0;e<u;++e)if(s[e]!==c[e]){i=s[e],a=c[e];break}return i<a?-1:a<i?1:0},N.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},N.prototype.indexOf=function(e,t,r){return RI(this,e,t,r,!0)},N.prototype.lastIndexOf=function(e,t,r){return RI(this,e,t,r,!1)},N.prototype.write=function(t,r,n,e){if(void 0===r)e="utf8",n=this.length,r=0;else if(void 0===n&&"string"==typeof r)e=r,n=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r>>>=0,isFinite(n)?(n>>>=0,void 0===e&&(e="utf8")):(e=n,n=void 0)}var o,i,a,u=this.length-r;if((void 0===n||u<n)&&(n=u),0<t.length&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");e=e||"utf8";let s=!1;for(;;)switch(e){case"hex":{var c=this;var l=t;var f=r;var p=n;f=Number(f)||0;var d=c.length-f;(!p||d<(p=Number(p)))&&(p=d),(d=l.length)/2<p&&(p=d/2);let e;for(e=0;e<p;++e){var h=parseInt(l.substr(2*e,2),16);if(XI(h))return e;c[f+e]=h}return e;return}case"utf8":case"utf-8":return d=r,a=n,ZI(KI(t,(i=this).length-d),i,d,a);case"ascii":case"latin1":case"binary":return MI(this,t,r,n);case"base64":return i=this,a=r,o=n,ZI(YI(t),i,a,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return kI(this,t,r,n);default:if(s)throw new TypeError("Unknown encoding: "+e);e=(""+e).toLowerCase(),s=!0}},N.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};let c=4096;function xI(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(r<e+t)throw new RangeError("Trying to access beyond buffer length")}function DI(e,t,r,n,o,i){if(!N.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(o<t||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function UI(e,t,r,n,o){zI(t,n,o,e,r,7);n=Number(t&BigInt(4294967295)),e[r++]=n,e[r++]=n>>=8,e[r++]=n>>=8,e[r++]=n>>=8,o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=o,e[r++]=o>>=8,e[r++]=o>>=8,e[r++]=o>>=8,r}function LI(e,t,r,n,o){zI(t,n,o,e,r,7);n=Number(t&BigInt(4294967295)),e[r+7]=n,e[r+6]=n>>=8,e[r+5]=n>>=8,e[r+4]=n>>=8,o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=o,e[r+2]=o>>=8,e[r+1]=o>>=8,e[r]=o>>=8,r+8}function FI(e,t,r,n){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function BI(e,t,r,n,o){return t=+t,r>>>=0,o||FI(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function VI(e,t,r,n,o){return t=+t,r>>>=0,o||FI(e,0,r,8),i.write(e,t,r,n,52,8),r+8}N.prototype.slice=function(e,t){var r=this.length,r=((e=~~e)<0?(e+=r)<0&&(e=0):r<e&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):r<t&&(t=r),t<e&&(t=e),this.subarray(e,t));return Object.setPrototypeOf(r,N.prototype),r},N.prototype.readUintLE=N.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||xI(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return n},N.prototype.readUintBE=N.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||xI(e,t,this.length);let n=this[e+--t],o=1;for(;0<t&&(o*=256);)n+=this[e+--t]*o;return n},N.prototype.readUint8=N.prototype.readUInt8=function(e,t){return e>>>=0,t||xI(e,1,this.length),this[e]},N.prototype.readUint16LE=N.prototype.readUInt16LE=function(e,t){return e>>>=0,t||xI(e,2,this.length),this[e]|this[e+1]<<8},N.prototype.readUint16BE=N.prototype.readUInt16BE=function(e,t){return e>>>=0,t||xI(e,2,this.length),this[e]<<8|this[e+1]},N.prototype.readUint32LE=N.prototype.readUInt32LE=function(e,t){return e>>>=0,t||xI(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},N.prototype.readUint32BE=N.prototype.readUInt32BE=function(e,t){return e>>>=0,t||xI(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},N.prototype.readBigUInt64LE=JI(function(e){HI(e>>>=0,"offset");var t=this[e],r=this[e+7],t=(void 0!==t&&void 0!==r||GI(e,this.length-8),t+256*this[++e]+65536*this[++e]+this[++e]*2**24),e=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(t)+(BigInt(e)<<BigInt(32))}),N.prototype.readBigUInt64BE=JI(function(e){HI(e>>>=0,"offset");var t=this[e],r=this[e+7],t=(void 0!==t&&void 0!==r||GI(e,this.length-8),t*2**24+65536*this[++e]+256*this[++e]+this[++e]),e=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(t)<<BigInt(32))+BigInt(e)}),N.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||xI(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n},N.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||xI(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;0<n&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},N.prototype.readInt8=function(e,t){return e>>>=0,t||xI(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},N.prototype.readInt16LE=function(e,t){e>>>=0,t||xI(e,2,this.length);t=this[e]|this[e+1]<<8;return 32768&t?4294901760|t:t},N.prototype.readInt16BE=function(e,t){e>>>=0,t||xI(e,2,this.length);t=this[e+1]|this[e]<<8;return 32768&t?4294901760|t:t},N.prototype.readInt32LE=function(e,t){return e>>>=0,t||xI(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},N.prototype.readInt32BE=function(e,t){return e>>>=0,t||xI(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},N.prototype.readBigInt64LE=JI(function(e){HI(e>>>=0,"offset");var t=this[e],r=this[e+7],r=(void 0!==t&&void 0!==r||GI(e,this.length-8),this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24));return(BigInt(r)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),N.prototype.readBigInt64BE=JI(function(e){HI(e>>>=0,"offset");var t=this[e],r=this[e+7],t=(void 0!==t&&void 0!==r||GI(e,this.length-8),(t<<24)+65536*this[++e]+256*this[++e]+this[++e]);return(BigInt(t)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)}),N.prototype.readFloatLE=function(e,t){return e>>>=0,t||xI(e,4,this.length),i.read(this,e,!0,23,4)},N.prototype.readFloatBE=function(e,t){return e>>>=0,t||xI(e,4,this.length),i.read(this,e,!1,23,4)},N.prototype.readDoubleLE=function(e,t){return e>>>=0,t||xI(e,8,this.length),i.read(this,e,!0,52,8)},N.prototype.readDoubleBE=function(e,t){return e>>>=0,t||xI(e,8,this.length),i.read(this,e,!1,52,8)},N.prototype.writeUintLE=N.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||DI(this,e,t,r,Math.pow(2,8*r)-1,0);let o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},N.prototype.writeUintBE=N.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||DI(this,e,t,r,Math.pow(2,8*r)-1,0);let o=r-1,i=1;for(this[t+o]=255&e;0<=--o&&(i*=256);)this[t+o]=e/i&255;return t+r},N.prototype.writeUint8=N.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||DI(this,e,t,1,255,0),this[t]=255&e,t+1},N.prototype.writeUint16LE=N.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||DI(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},N.prototype.writeUint16BE=N.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||DI(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},N.prototype.writeUint32LE=N.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||DI(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},N.prototype.writeUint32BE=N.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||DI(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},N.prototype.writeBigUInt64LE=JI(function(e,t=0){return UI(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),N.prototype.writeBigUInt64BE=JI(function(e,t=0){return LI(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),N.prototype.writeIntLE=function(e,t,r,n){e=+e,t>>>=0,n||DI(this,e,t,r,(n=Math.pow(2,8*r-1))-1,-n);let o=0,i=1,a=0;for(this[t]=255&e;++o<r&&(i*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/i>>0)-a&255;return t+r},N.prototype.writeIntBE=function(e,t,r,n){e=+e,t>>>=0,n||DI(this,e,t,r,(n=Math.pow(2,8*r-1))-1,-n);let o=r-1,i=1,a=0;for(this[t+o]=255&e;0<=--o&&(i*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/i>>0)-a&255;return t+r},N.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||DI(this,e,t,1,127,-128),this[t]=255&(e=e<0?255+e+1:e),t+1},N.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||DI(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},N.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||DI(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},N.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||DI(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},N.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||DI(this,e,t,4,2147483647,-2147483648),this[t]=(e=e<0?4294967295+e+1:e)>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},N.prototype.writeBigInt64LE=JI(function(e,t=0){return UI(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),N.prototype.writeBigInt64BE=JI(function(e,t=0){return LI(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),N.prototype.writeFloatLE=function(e,t,r){return BI(this,e,t,!0,r)},N.prototype.writeFloatBE=function(e,t,r){return BI(this,e,t,!1,r)},N.prototype.writeDoubleLE=function(e,t,r){return VI(this,e,t,!0,r)},N.prototype.writeDoubleBE=function(e,t,r){return VI(this,e,t,!1,r)},N.prototype.copy=function(e,t,r,n){if(!N.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,n||0===n||(n=this.length),t>=e.length&&(t=e.length),(n=0<n&&n<r?r:n)===r)return 0;if(0===e.length||0===this.length)return 0;if((t=t||0)<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length);var o=(n=e.length-t<n-r?e.length-t+r:n)-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},N.prototype.fill=function(t,r,n,o){if("string"==typeof t){if("string"==typeof r?(o=r,r=0,n=this.length):"string"==typeof n&&(o=n,n=this.length),void 0!==o&&"string"!=typeof o)throw new TypeError("encoding must be a string");if("string"==typeof o&&!N.isEncoding(o))throw new TypeError("Unknown encoding: "+o);var e;1===t.length&&(e=t.charCodeAt(0),"utf8"===o&&e<128||"latin1"===o)&&(t=e)}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(!(n<=r)){r>>>=0,n=void 0===n?this.length:n>>>0;let e;if("number"==typeof(t=t||0))for(e=r;e<n;++e)this[e]=t;else{var i=N.isBuffer(t)?t:N.from(t,o),a=i.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(e=0;e<n-r;++e)this[e+r]=i[e%a]}}return this};let u={};function qI(e,t,r){u[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=this.name+` [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return this.name+` [${e}]: `+this.message}}}function WI(e){let t="",r=e.length;for(var n="-"===e[0]?1:0;r>=4+n;r-=3)t="_"+e.slice(r-3,r)+t;return""+e.slice(0,r)+t}function zI(t,r,n,e,o,i){if(n<t||t<r){var a="bigint"==typeof r?"n":"";let e;throw e=3<i?0===r||r===BigInt(0)?`>= 0${a} and < 2${a} ** `+8*(i+1)+a:`>= -(2${a} ** ${8*(i+1)-1}${a}) and < 2 ** `+(8*(i+1)-1)+a:`>= ${r}${a} and <= `+n+a,new u.ERR_OUT_OF_RANGE("value",e,t)}r=e,n=i,HI(a=o,"offset"),void 0!==r[a]&&void 0!==r[a+n]||GI(a,r.length-(n+1))}function HI(e,t){if("number"!=typeof e)throw new u.ERR_INVALID_ARG_TYPE(t,"number",e)}function GI(e,t,r){if(Math.floor(e)!==e)throw HI(e,r),new u.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new u.ERR_BUFFER_OUT_OF_BOUNDS;throw new u.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= `+t,e)}qI("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?e+" is outside of buffer bounds":"Attempt to access memory outside buffer bounds"},RangeError),qI("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type `+typeof t},TypeError),qI("ERR_OUT_OF_RANGE",function(e,t,r){e=`The value of "${e}" is out of range.`;let n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=WI(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=WI(n)),n+="n"),e+=` It must be ${t}. Received `+n},RangeError);let r=/[^+/0-9A-Za-z-_]/g;function KI(t,r){r=r||1/0;let n;var o=t.length;let i=null;var a=[];for(let e=0;e<o;++e){if(55295<(n=t.charCodeAt(e))&&n<57344){if(!i){if(56319<n){-1<(r-=3)&&a.push(239,191,189);continue}if(e+1===o){-1<(r-=3)&&a.push(239,191,189);continue}i=n;continue}if(n<56320){-1<(r-=3)&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&-1<(r-=3)&&a.push(239,191,189);if(i=null,n<128){if(--r<0)break;a.push(n)}else if(n<2048){if((r-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((r-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function YI(e){return y.toByteArray((e=>{if((e=(e=e.split("=")[0]).trim().replace(r,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e})(e))}function ZI(e,t,r,n){let o;for(o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function QI(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function XI(e){return e!=e}let b=(()=>{var r="0123456789abcdef",n=new Array(256);for(let t=0;t<16;++t){var o=16*t;for(let e=0;e<16;++e)n[o+e]=r[t]+r[e]}return n})();function JI(e){return"undefined"==typeof BigInt?$I:e}function $I(){throw new Error("BigInt not supported")}}var eR,tR,sb=r&&r.__extends||(eR=function(e,t){return(eR=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}eR(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),M=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},rR=(Object.defineProperty(sd,"__esModule",{value:!0}),sd.alloc=function(e){return new nR(e)},M(Fy)),_b=M(m),nR=(tR=_b.default,sb(oR,tR),oR.prototype.getUInt8=function(e){return this._buffer.readUInt8(e)},oR.prototype.getInt8=function(e){return this._buffer.readInt8(e)},oR.prototype.getFloat64=function(e){return this._buffer.readDoubleBE(e)},oR.prototype.getVarInt=function(e){for(var t=0,r=this._buffer.readUint8(e+t),n=r%128;128<=r&&t<=3;)n+=(127&(r=this._buffer.readUint8(e+(t+=1))))<<7*t;return{length:t+1,value:n}},oR.prototype.putUInt8=function(e,t){this._buffer.writeUInt8(t,e)},oR.prototype.putInt8=function(e,t){this._buffer.writeInt8(t,e)},oR.prototype.putFloat64=function(e,t){this._buffer.writeDoubleBE(t,e)},oR.prototype.putBytes=function(e,t){var r;t instanceof oR?(r=Math.min(t.length-t.position,this.length-e),t._buffer.copy(this._buffer,e,t.position,t.position+r),t.position+=r):tR.prototype.putBytes.call(this,e,t)},oR.prototype.getSlice=function(e,t){return new oR(this._buffer.slice(e,e+t))},oR);function oR(e){var t=this,e=(e=e)instanceof rR.default.Buffer?e:"number"==typeof e&&"function"==typeof rR.default.Buffer.alloc?rR.default.Buffer.alloc(e):new rR.default.Buffer(e);return(t=tR.call(this,e.length)||this)._buffer=e,t}sd.default=nR;var Eb=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},iR=(Object.defineProperty(n,"__esModule",{value:!0}),Eb(sd)),aR=e,_=aR.internal.util,uR=_.ENCRYPTION_OFF,sR=_.ENCRYPTION_ON;function cR(e,t,r){void 0===t&&(t=lR),void 0===r&&(r=function(e){return new WebSocket(e)});var n,o=this,t=(this._open=!0,this._pending=[],this._error=null,this._handleConnectionError=this._handleConnectionError.bind(this),this._config=e,this._receiveTimeout=null,this._receiveTimeoutStarted=!1,this._receiveTimeoutId=null,this._closingPromise=null,((e,t)=>{var r=(e=>!0===e.encrypted||e.encrypted===sR)(e),n=(e=>!1===e.encrypted||e.encrypted===uR)(e),e=e.trust,t=(e=>(e="function"==typeof e?e():"")&&0<=e.toLowerCase().indexOf("https"))(t),o=r,i=n,a=t;if(null!==a&&(o&&!a?console.warn("Neo4j driver is configured to use secure WebSocket on a HTTP web page. WebSockets might not work in a mixed content environment. Please consider configuring driver to not use encryption."):i&&a&&console.warn("Neo4j driver is configured to use insecure WebSocket on a HTTPS web page. WebSockets might not work in a mixed content environment. Please consider configuring driver to use encryption.")),!n){if(t)return{scheme:"wss",error:null};if(r)return e&&"TRUST_SYSTEM_CA_SIGNED_CERTIFICATES"!==e?{scheme:null,error:(0,aR.newError)("The browser version of this driver only supports one trust strategy, 'TRUST_SYSTEM_CA_SIGNED_CERTIFICATES'. "+e+' is not supported. Please either use TRUST_SYSTEM_CA_SIGNED_CERTIFICATES or disable encryption by setting `encrypted:"'+uR+'"` in the driver configuration.')}:{scheme:"wss",error:null}}return{scheme:"ws",error:null}})(e,t)),i=t.scheme,t=t.error;t?this._error=t:(this._ws=((t,r,n)=>{var o=t+"://"+r.asHostPort();try{return n(o)}catch(e){if(((e,t)=>"SyntaxError"===e.name&&(e=>"["===e.charAt(0)&&-1!==e.indexOf("]"))(t.asHostPort()))(e,r))return o=((e,t)=>{var r=t.host().replace(/:/g,"-").replace("%","s")+".ipv6-literal.net";return"".concat(e,"://").concat(r,":").concat(t.port())})(t,r),n(o);throw e}})(i,e.address,r),this._ws.binaryType="arraybuffer",(n=this)._ws.onclose=function(e){e&&!e.wasClean&&n._handleConnectionError(),n._open=!1},this._ws.onopen=function(){n._clearConnectionTimeout();var e=n._pending;n._pending=null;for(var t=0;t<e.length;t++)n.write(e[t])},this._ws.onmessage=function(e){o._resetTimeout(),n.onmessage&&(e=new iR.default(e.data),n.onmessage(e))},this._ws.onerror=this._handleConnectionError,this._connectionTimeoutFired=!1,this._connectionTimeoutId=this._setupConnectionTimeout())}function lR(){return"undefined"!=typeof window&&window.location?window.location.protocol:null}cR.prototype._handleConnectionError=function(){this._connectionTimeoutFired?(this._error=(0,aR.newError)("Failed to establish connection in ".concat(this._config.connectionTimeout,"ms"),this._config.connectionErrorCode),this.onerror&&this.onerror(this._error)):this._open&&!this._timedout&&(this._error=(0,aR.newError)("WebSocket connection failure. Due to security constraints in your web browser, the reason for the failure is not available to this Neo4j Driver. Please use your browsers development console to determine the root cause of the failure. Common reasons include the database being unavailable, using the wrong connection URL or temporary network problems. If you have enabled encryption, ensure your browser is configured to trust the certificate Neo4j is configured to use. WebSocket `readyState` is: "+this._ws.readyState,this._config.connectionErrorCode),this.onerror)&&this.onerror(this._error)},cR.prototype.write=function(e){if(null!==this._pending)this._pending.push(e);else{if(!(e instanceof iR.default))throw(0,aR.newError)("Don't know how to send buffer: "+e);try{this._ws.send(e._buffer)}catch(e){if(1===this._ws.readyState)throw(0,aR.newError)("unexpected failure to write.",void 0,e);this._handleConnectionError()}}},cR.prototype.close=function(){var r=this;return null===this._closingPromise&&(this._closingPromise=new Promise(function(e,t){r._clearConnectionTimeout(),r._ws&&3!==r._ws.readyState?(r._open=!1,r.stopReceiveTimeout(),r._ws.onclose=function(){e()},r._ws.close()):e()})),this._closingPromise},cR.prototype.setupReceiveTimeout=function(e){this._receiveTimeout=e},cR.prototype.stopReceiveTimeout=function(){null!==this._receiveTimeout&&this._receiveTimeoutStarted&&(this._receiveTimeoutStarted=!1,null!=this._receiveTimeoutId&&clearTimeout(this._receiveTimeoutId),this._receiveTimeoutId=null)},cR.prototype.startReceiveTimeout=function(){this._open&&null!==this._receiveTimeout&&!this._receiveTimeoutStarted&&(this._receiveTimeoutStarted=!0,this._resetTimeout())},cR.prototype._resetTimeout=function(){var e=this;this._receiveTimeoutStarted&&(null!==this._receiveTimeoutId&&clearTimeout(this._receiveTimeoutId),this._receiveTimeoutId=setTimeout(function(){e._receiveTimeoutId=null,e._timedout=!0,e.stopReceiveTimeout(),e._error=(0,aR.newError)("Connection lost. Server didn't respond in ".concat(e._receiveTimeout,"ms"),e._config.connectionErrorCode),e.close(),e.onerror&&e.onerror(e._error)},this._receiveTimeout))},cR.prototype._setupConnectionTimeout=function(){var e,t=this,r=this._config.connectionTimeout;return r?(e=this._ws,setTimeout(function(){1!==e.readyState&&(t._connectionTimeoutFired=!0,e.close())},r)):null},cR.prototype._clearConnectionTimeout=function(){var e=this._connectionTimeoutId;!e&&0!==e||(this._connectionTimeoutFired=!1,this._connectionTimeoutId=null,clearTimeout(e))},n.default=cR;var fR,By={},Tb=r&&r.__extends||(fR=function(e,t){return(fR=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}fR(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(By,"__esModule",{value:!0});var pR,Rb=e.internal.resolver.BaseHostNameResolver,so=(Tb(dR,pR=Rb),dR.prototype.resolve=function(e){return this._resolveToItself(e)},dR);function dR(){return null!==pR&&pR.apply(this,arguments)||this}By.default=so;var hR,yR,P={},bR=r&&r.__awaiter||function(e,a,u,s){return new(u=u||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof u?t:new u(function(e){e(t)})).then(n,o)}i((s=s.apply(e,a||[])).next())})},_R=r&&r.__generator||function(n,o){var i,a,u,s={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,a&&(u=2&t[0]?a.return:t[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,t[1])).done)return u;switch(a=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(u=0<(u=s.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3]))s.label=t[1];else if(6===t[0]&&s.label<u[1])s.label=u[1],u=t;else{if(!(u&&s.label<u[2])){u[2]&&s.ops.pop(),s.trys.pop();continue}s.label=u[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],a=0}finally{i=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},$y=(Object.defineProperty(P,"__esModule",{value:!0}),P.default={load:function(t){return bR(this,void 0,void 0,function(){return _R(this,function(e){return[2,t]})})}},r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}}),i=(Object.defineProperty(Th,"__esModule",{value:!0}),Th.ClientCertificatesLoader=Th.HostNameResolver=Th.Channel=void 0,$y(n)),Fb=$y(By),ba=$y(P),k=(Th.Channel=i.default,Th.HostNameResolver=Fb.default,Th.ClientCertificatesLoader=ba.default,{}),lb={},tb=r&&r.__extends||(hR=function(e,t){return(hR=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}hR(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),vR=(Object.defineProperty(lb,"__esModule",{value:!0}),e),mR=sd,Bb=(yR=m.BaseBuffer,tb(gR,yR),gR.prototype.getUInt8=function(e){for(var t=0;t<this._buffers.length;t++){var r=this._buffers[t];if(!(e>=r.length))return r.getUInt8(e);e-=r.length}throw(0,vR.newError)("Read beyond end of CombinedBuffer")},gR.prototype.getInt8=function(e){for(var t=0;t<this._buffers.length;t++){var r=this._buffers[t];if(!(e>=r.length))return r.getInt8(e);e-=r.length}throw(0,vR.newError)("Read beyond end of CombinedBuffer")},gR.prototype.getFloat64=function(e){for(var t=(0,mR.alloc)(8),r=0;r<8;r++)t.putUInt8(r,this.getUInt8(e+r));return t.getFloat64(0)},gR);function gR(e){for(var t=this,r=0,n=0;n<e.length;n++)r+=e[n].length;return(t=yR.call(this,r)||this)._buffers=e,t}lb.default=Bb;var OR,wR,zb=r&&r.__extends||(OR=function(e,t){return(OR=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}OR(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Yb=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},$b=(Object.defineProperty(k,"__esModule",{value:!0}),k.Dechunker=k.Chunker=void 0,Yb(Lh)),ER=sd,PR=Yb(lb),o_=(wR=$b.default,zb(SR,wR),SR.prototype.putUInt8=function(e,t){this._ensure(1),this._buffer.writeUInt8(t)},SR.prototype.putInt8=function(e,t){this._ensure(1),this._buffer.writeInt8(t)},SR.prototype.putFloat64=function(e,t){this._ensure(8),this._buffer.writeFloat64(t)},SR.prototype.putBytes=function(e,t){for(;0<t.remaining();)this._ensure(1),this._buffer.remaining()>t.remaining()?this._buffer.writeBytes(t):this._buffer.writeBytes(t.readSlice(this._buffer.remaining()));return this},SR.prototype.flush=function(){var e;return 0<this._buffer.position&&(this._closeChunkIfOpen(),e=this._buffer,this._buffer=null,this._ch.write(e.getSlice(0,e.position)),this._buffer=(0,ER.alloc)(this._bufferSize),this._chunkOpen=!1),this},SR.prototype.messageBoundary=function(){this._closeChunkIfOpen(),this._buffer.remaining()<2&&this.flush(),this._buffer.writeInt16(0)},SR.prototype._ensure=function(e){e=this._chunkOpen?e:e+2;this._buffer.remaining()<e&&this.flush(),this._chunkOpen||(this._currentChunkStart=this._buffer.position,this._buffer.position=this._buffer.position+2,this._chunkOpen=!0)},SR.prototype._closeChunkIfOpen=function(){var e;this._chunkOpen&&(e=this._buffer.position-(this._currentChunkStart+2),this._buffer.putUInt16(this._currentChunkStart,e),this._chunkOpen=!1)},SR);function SR(e,t){var r=wR.call(this,0)||this;return r._bufferSize=t||1400,r._ch=e,r._buffer=(0,ER.alloc)(r._bufferSize),r._currentChunkStart=0,r._chunkOpen=!1,r}function TR(){this._currentMessage=[],this._partialChunkHeader=0,this._state=this.AWAITING_CHUNK}k.Chunker=o_,TR.prototype.AWAITING_CHUNK=function(e){return 2<=e.remaining()?this._onHeader(e.readUInt16()):(this._partialChunkHeader=e.readUInt8()<<8,this.IN_HEADER)},TR.prototype.IN_HEADER=function(e){return this._onHeader(65535&(this._partialChunkHeader|e.readUInt8()))},TR.prototype.IN_CHUNK=function(e){return this._chunkSize<=e.remaining()?(this._currentMessage.push(e.readSlice(this._chunkSize)),this.AWAITING_CHUNK):(this._chunkSize-=e.remaining(),this._currentMessage.push(e.readSlice(e.remaining())),this.IN_CHUNK)},TR.prototype.CLOSED=function(e){},TR.prototype._onHeader=function(e){if(0!==e)return this._chunkSize=e,this.IN_CHUNK;var t=void 0;switch(this._currentMessage.length){case 0:return this.AWAITING_CHUNK;case 1:t=this._currentMessage[0];break;default:t=new PR.default(this._currentMessage)}return this._currentMessage=[],this.onmessage(t),this.AWAITING_CHUNK},TR.prototype.write=function(e){for(;e.hasRemaining();)this._state=this._state(e)},k.Dechunker=TR;var d_={},jR=(Object.defineProperty(d_,"__esModule",{value:!0}),e),O_=jR.internal.util,T_=O_.ENCRYPTION_OFF,CR=jR.error.SERVICE_UNAVAILABLE,IR=[null,void 0,!0,!1,O_.ENCRYPTION_ON,T_],RR=[null,void 0,"TRUST_ALL_CERTIFICATES","TRUST_CUSTOM_CA_SIGNED_CERTIFICATES","TRUST_SYSTEM_CA_SIGNED_CERTIFICATES"];d_.default=function(e,t,r,n){this.address=e,this.encrypted=(e=>{if(e=e.encrypted,-1!==IR.indexOf(e))return e;throw(0,jR.newError)("Illegal value of the encrypted setting ".concat(e,". Expected one of ").concat(IR))})(t),this.trust=(e=>{if(e=e.trust,-1!==RR.indexOf(e))return e;throw(0,jR.newError)("Illegal value of the trust setting ".concat(e,". Expected one of ").concat(RR))})(t),this.trustedCertificates=t.trustedCertificates||[],this.connectionErrorCode=r||CR,this.connectionTimeout=t.connectionTimeout,this.clientCertificate=n};var AR,MR,R_={},A_={},Z_={exports:{}};function kR(e,t){for(var r in e)t[r]=e[r]}function NR(e,t,r){return MR(e,t,r)}hv=(Y_=Z_).exports,(MR=(AR=Fy).Buffer).from&&MR.alloc&&MR.allocUnsafe&&MR.allocUnsafeSlow?Y_.exports=AR:(kR(AR,hv),hv.Buffer=NR),NR.prototype=Object.create(MR.prototype),kR(MR,NR),NR.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return MR(e,t,r)},NR.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");e=MR(e);return void 0!==t?"string"==typeof r?e.fill(t,r):e.fill(t):e.fill(0),e},NR.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return MR(e)},NR.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return AR.SlowBuffer(e)};var xR=Z_.exports.Buffer,DR=xR.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function UR(e){var t=(e=>{if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}})(e);if("string"==typeof t||xR.isEncoding!==DR&&DR(e))return t||e;throw new Error("Unknown encoding: "+e)}function LR(e){var t;switch(this.encoding=UR(e),this.encoding){case"utf16le":this.text=VR,this.end=qR,t=4;break;case"utf8":this.fillLast=BR,t=4;break;case"base64":this.text=WR,this.end=zR,t=3;break;default:return this.write=HR,void(this.end=GR)}this.lastNeed=0,this.lastTotal=0,this.lastChar=xR.allocUnsafe(t)}function FR(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function BR(e){var t,r=this.lastTotal-this.lastNeed,n=(t=this,128!=(192&(n=e)[0])?(t.lastNeed=0,"�"):1<t.lastNeed&&1<n.length?128!=(192&n[1])?(t.lastNeed=1,"�"):2<t.lastNeed&&2<n.length&&128!=(192&n[2])?(t.lastNeed=2,"�"):void 0:void 0);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,r,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,r,0,e.length),void(this.lastNeed-=e.length))}function VR(e,t){if((e.length-t)%2!=0)return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1);t=e.toString("utf16le",t);if(t){var r=t.charCodeAt(t.length-1);if(55296<=r&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],t.slice(0,-1)}return t}function qR(e){var t,e=e&&e.length?this.write(e):"";return this.lastNeed?(t=this.lastTotal-this.lastNeed,e+this.lastChar.toString("utf16le",0,t)):e}function WR(e,t){var r=(e.length-t)%3;return 0==r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1==r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function zR(e){e=e&&e.length?this.write(e):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function HR(e){return e.toString(this.encoding)}function GR(e){return e&&e.length?this.write(e):""}(A_.StringDecoder=LR).prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},LR.prototype.end=function(e){e=e&&e.length?this.write(e):"";return this.lastNeed?e+"�":e},LR.prototype.text=function(e,t){var r=((e,t,r)=>{var n=t.length-1;if(!(n<r)){var o=FR(t[n]);if(0<=o)return 0<o&&(e.lastNeed=o-1),o;if(!(--n<r||-2===o)){if(0<=(o=FR(t[n])))return 0<o&&(e.lastNeed=o-2),o;if(!(--n<r||-2===o)&&0<=(o=FR(t[n])))return 0<o&&(2===o?o=0:e.lastNeed=o-3),o}}return 0})(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;r=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},LR.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};var KR,YR,ZR,QR,XR,Fh=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},JR=(Object.defineProperty(R_,"__esModule",{value:!0}),Fh(sd)),$R=e,eA=Fh(Fy),tA=A_;R_.default={encode:function(e){return new JR.default((e=e,"function"==typeof eA.default.Buffer.from?eA.default.Buffer.from(e,"utf8"):new eA.default.Buffer(e,"utf8")))},decode:function(e,t){if(Object.prototype.hasOwnProperty.call(e,"_buffer"))return r=t,o=(n=e).position,r=o+r,n.position=Math.min(r,n.length),n._buffer.toString("utf8",o,r);if(!Object.prototype.hasOwnProperty.call(e,"_buffers"))throw(0,$R.newError)("Don't know how to decode strings from '".concat(e,"'"));var r,n=e,o=t,i=new tA.StringDecoder("utf8");try{return((e,t,o,r)=>{var i=t,a=e.position;return e._updatePos(Math.min(t,e.length-a)),e._buffers.reduce(function(e,t){var r,n;return i<=0?e:a>=t.length?(a-=t.length,""):(t._updatePos(a-t.position),r=Math.min(t.length-a,i),n=t.readSlice(r),t._updatePos(r),i=Math.max(i-n.length,0),a=0,e+o(n))},"")+r()})(n,o,function(e){return i.write(e._buffer)},function(){return i.end()})}finally{i.end()}}},rh=Oh,KR=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),lv=r&&r.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||KR(t,e,r)},YR=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(rh,"__esModule",{value:!0}),rh.utf8=rh.alloc=rh.ChannelConfig=void 0,lv(Th,rh),lv(k,rh),ZR=d_,Object.defineProperty(rh,"ChannelConfig",{enumerable:!0,get:function(){return YR(ZR).default}}),QR=sd,Object.defineProperty(rh,"alloc",{enumerable:!0,get:function(){return QR.alloc}}),XR=R_,Object.defineProperty(rh,"utf8",{enumerable:!0,get:function(){return YR(XR).default}});var dv={},Pv={},Sv={},kv={},rA=(Object.defineProperty(kv,"__esModule",{value:!0}),kv.identity=function(e){return e},kv.reuseOngoingRequest=function(o,i){void 0===i&&(i=null);var a=new Map;return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r,n=rA.json.stringify(e);return a.has(n)?a.get(n):(r=o.apply(i,e),a.set(n,r),r.finally(function(){a.delete(n)}))}},e);var Lv={},nA=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(Lv,"__esModule",{value:!0}),Lv.equals=function(e,t){var r,n;if(e!==t){if(null===e||null===t)return!1;if("object"!=typeof e||"object"!=typeof t)return!1;var o=Object.keys(e),i=Object.keys(t);if(o.length!==i.length)return!1;try{for(var a=nA(o),u=a.next();!u.done;u=a.next()){var s=u.value;if(e[s]!==t[s])return!1}}catch(e){r={error:e}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}}return!0};var oA,iA=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),aA=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),qv=r&&r.__importStar||(oA=function(e){return(oA=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=oA(e),n=0;n<r.length;n++)"default"!==r[n]&&iA(t,e,r[n]);return aA(t,e),t}),Hv=(Object.defineProperty(Sv,"__esModule",{value:!0}),Sv.object=Sv.functional=void 0,Sv.functional=qv(kv),Sv.object=qv(Lv),{}),uA=(Object.defineProperty(Hv,"__esModule",{value:!0}),Hv.Structure=void 0,Hv.verifyStructSize=function(e,t,r){if(t!==r)throw(0,uA.newError)("Wrong struct size for ".concat(e,", expected ").concat(t," but was ").concat(r),sA)},e),sA=uA.error.PROTOCOL_ERROR,Gv=(Object.defineProperty(cA.prototype,"size",{get:function(){return this.fields.length},enumerable:!1,configurable:!0}),cA.prototype.toString=function(){for(var e="",t=0;t<this.fields.length;t++)0<t&&(e+=", "),e+=this.fields[t];return"Structure("+this.signature+", ["+e+"])"},cA);function cA(e,t){this.signature=e,this.fields=t}Hv.Structure=Gv,Hv.default=Gv,Object.defineProperty(Pv,"__esModule",{value:!0}),Pv.Unpacker=Pv.Packer=void 0;var lA=Oh,fA=Sv,pA=Hv,dA=e,hA=dA.error.PROTOCOL_ERROR;function yA(e,t){void 0===t&&(t=!1),this._ch=e,this._byteArraysSupported=!0,this.allowUUID=t}function bA(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!1),this._disableLosslessIntegers=e=void 0===e?!1:e,this._useBigInt=t,this.allowUUID=r}yA.prototype.packable=function(o,i){var e,a=this;void 0===i&&(i=fA.functional.identity);try{o=i(o)}catch(e){return function(){throw e}}if(null===o)return function(){return a._ch.writeUInt8(192)};if(!0===o)return function(){return a._ch.writeUInt8(195)};if(!1===o)return function(){return a._ch.writeUInt8(194)};if("number"==typeof o)return function(){return a.packFloat(o)};if("string"==typeof o)return function(){return a.packString(o)};if("bigint"==typeof o)return function(){return a.packInteger((0,dA.int)(o))};if((0,dA.isInt)(o))return function(){return a.packInteger(o)};if(o instanceof Int8Array)return function(){return a.packBytes(o)};if(o instanceof Array)return function(){a.packListHeader(o.length);for(var e=0;e<o.length;e++)a.packable(void 0===o[e]?null:o[e],i)()};if((0,dA.isUUID)(o))return this.allowUUID?function(){return a.packUUID(o)}:this._nonPackableValue("Cannot pack UUID, negotiated bolt version uses older packstream");if(null!=(e=o)&&"function"==typeof e[Symbol.iterator])return this.packableIterable(o,i);if(o instanceof pA.Structure){for(var t=[],r=0;r<o.fields.length;r++)t[r]=this.packable(o.fields[r],i);return function(){return a.packStruct(o.signature,t)}}return"object"==typeof o?function(){for(var e=Object.keys(o),t=0,r=0;r<e.length;r++)void 0!==o[e[r]]&&t++;a.packMapHeader(t);for(r=0;r<e.length;r++){var n=e[r];void 0!==o[n]&&(a.packString(n),a.packable(o[n],i)())}}:this._nonPackableValue("Unable to pack the given value: ".concat(o))},yA.prototype.packableIterable=function(t,e){try{var r=Array.from(t);return this.packable(r,e)}catch(e){throw(0,dA.newError)("Cannot pack given iterable, ".concat(e.message,": ").concat(t))}},yA.prototype.packStruct=function(e,t){this.packStructHeader((t=t||[]).length,e);for(var r=0;r<t.length;r++)t[r]()},yA.prototype.packInteger=function(e){var t=e.high,r=e.low;e.greaterThanOrEqual(-16)&&e.lessThan(128)?this._ch.writeInt8(r):e.greaterThanOrEqual(-128)&&e.lessThan(-16)?(this._ch.writeUInt8(200),this._ch.writeInt8(r)):e.greaterThanOrEqual(-32768)&&e.lessThan(32768)?(this._ch.writeUInt8(201),this._ch.writeInt16(r)):(e.greaterThanOrEqual(-2147483648)&&e.lessThan(2147483648)?this._ch.writeUInt8(202):(this._ch.writeUInt8(203),this._ch.writeInt32(t)),this._ch.writeInt32(r))},yA.prototype.packFloat=function(e){this._ch.writeUInt8(193),this._ch.writeFloat64(e)},yA.prototype.packString=function(e){var e=lA.utf8.encode(e),t=e.length;if(t<16)this._ch.writeUInt8(128|t);else if(t<256)this._ch.writeUInt8(208),this._ch.writeUInt8(t);else{if(t<65536)this._ch.writeUInt8(209),this._ch.writeUInt8(t/256>>0);else{if(!(t<4294967296))throw(0,dA.newError)("UTF-8 strings of size "+t+" are not supported");this._ch.writeUInt8(210),this._ch.writeUInt8((t/16777216>>0)%256),this._ch.writeUInt8((t/65536>>0)%256),this._ch.writeUInt8((t/256>>0)%256)}this._ch.writeUInt8(t%256)}this._ch.writeBytes(e)},yA.prototype.packListHeader=function(e){if(e<16)this._ch.writeUInt8(144|e);else if(e<256)this._ch.writeUInt8(212),this._ch.writeUInt8(e);else{if(e<65536)this._ch.writeUInt8(213);else{if(!(e<4294967296))throw(0,dA.newError)("Lists of size "+e+" are not supported");this._ch.writeUInt8(214),this._ch.writeUInt8((e/16777216>>0)%256),this._ch.writeUInt8((e/65536>>0)%256)}this._ch.writeUInt8((e/256>>0)%256),this._ch.writeUInt8(e%256)}},yA.prototype.packBytes=function(e){if(!this._byteArraysSupported)throw(0,dA.newError)("Byte arrays are not supported by the database this driver is connected to");this.packBytesHeader(e.length);for(var t=0;t<e.length;t++)this._ch.writeInt8(e[t])},yA.prototype.packBytesHeader=function(e){if(e<256)this._ch.writeUInt8(204),this._ch.writeUInt8(e);else{if(e<65536)this._ch.writeUInt8(205);else{if(!(e<4294967296))throw(0,dA.newError)("Byte arrays of size "+e+" are not supported");this._ch.writeUInt8(206),this._ch.writeUInt8((e/16777216>>0)%256),this._ch.writeUInt8((e/65536>>0)%256)}this._ch.writeUInt8((e/256>>0)%256),this._ch.writeUInt8(e%256)}},yA.prototype.packMapHeader=function(e){if(e<16)this._ch.writeUInt8(160|e);else if(e<256)this._ch.writeUInt8(216),this._ch.writeUInt8(e);else{if(e<65536)this._ch.writeUInt8(217),this._ch.writeUInt8(e/256>>0);else{if(!(e<4294967296))throw(0,dA.newError)("Maps of size "+e+" are not supported");this._ch.writeUInt8(218),this._ch.writeUInt8((e/16777216>>0)%256),this._ch.writeUInt8((e/65536>>0)%256),this._ch.writeUInt8((e/256>>0)%256)}this._ch.writeUInt8(e%256)}},yA.prototype.packStructHeader=function(e,t){if(e<16)this._ch.writeUInt8(176|e),this._ch.writeUInt8(t);else if(e<256)this._ch.writeUInt8(220),this._ch.writeUInt8(e),this._ch.writeUInt8(t);else{if(!(e<65536))throw(0,dA.newError)("Structures of size "+e+" are not supported");this._ch.writeUInt8(221),this._ch.writeUInt8(e/256>>0),this._ch.writeUInt8(e%256)}},yA.prototype.packUUID=function(e){this._ch.writeUInt8(224);for(var t=e.getTypedArray(),r=0;r<t.length;r++)this._ch.writeUInt8(t[r])},yA.prototype.disableByteArrays=function(){this._byteArraysSupported=!1},yA.prototype._nonPackableValue=function(e){return function(){throw(0,dA.newError)(e,hA)}},Pv.Packer=yA,bA.prototype.unpack=function(e,t){void 0===t&&(t=fA.functional.identity);var r=e.readUInt8(),n=240&r,o=15&r;if(192===r)return null;var i=this._unpackBoolean(r);if(null!==i)return i;i=this._unpackNumberOrInteger(r,e);if(null!==i){if((0,dA.isInt)(i)){if(this._useBigInt)return i.toBigInt();if(this._disableLosslessIntegers)return i.toNumberOrInfinity()}return i}i=this._unpackString(r,n,o,e);if(null!==i)return i;i=this._unpackList(r,n,o,e,t);if(null!==i)return i;i=this._unpackByteArray(r,e);if(null!==i)return i;i=this._unpackUUID(r,e);if(null!==i)return i;i=this._unpackMap(r,n,o,e,t);if(null!==i)return i;i=this._unpackStruct(r,n,o,e,t);if(null!==i)return i;throw(0,dA.newError)("Unknown packed value with marker "+r.toString(16))},bA.prototype.unpackInteger=function(e){var t=e.readUInt8(),e=this._unpackInteger(t,e);if(null==e)throw(0,dA.newError)("Unable to unpack integer value with marker "+t.toString(16));return e},bA.prototype._unpackBoolean=function(e){return 195===e||194!==e&&null},bA.prototype._unpackNumberOrInteger=function(e,t){return 193===e?t.readFloat64():this._unpackInteger(e,t)},bA.prototype._unpackInteger=function(e,t){var r;return 0<=e&&e<128?(0,dA.int)(e):240<=e&&e<256?(0,dA.int)(e-256):200===e?(0,dA.int)(t.readInt8()):201===e?(0,dA.int)(t.readInt16()):202===e?(r=t.readInt32(),(0,dA.int)(r)):203===e?(r=t.readInt32(),e=t.readInt32(),new dA.Integer(e,r)):null},bA.prototype._unpackString=function(e,t,r,n){return 128===t?lA.utf8.decode(n,r):208===e?lA.utf8.decode(n,n.readUInt8()):209===e?lA.utf8.decode(n,n.readUInt16()):210===e?lA.utf8.decode(n,n.readUInt32()):null},bA.prototype._unpackList=function(e,t,r,n,o){return 144===t?this._unpackListWithSize(r,n,o):212===e?this._unpackListWithSize(n.readUInt8(),n,o):213===e?this._unpackListWithSize(n.readUInt16(),n,o):214===e?this._unpackListWithSize(n.readUInt32(),n,o):null},bA.prototype._unpackListWithSize=function(e,t,r){for(var n=[],o=0;o<e;o++)n.push(this.unpack(t,r));return n},bA.prototype._unpackByteArray=function(e,t){return 204===e?this._unpackByteArrayWithSize(t.readUInt8(),t):205===e?this._unpackByteArrayWithSize(t.readUInt16(),t):206===e?this._unpackByteArrayWithSize(t.readUInt32(),t):null},bA.prototype._unpackUUID=function(e,t){if(224!==e||!0!==this.allowUUID)return null;for(var r=new Uint8Array(16),n=0;n<16;n++)r[n]=t.readUInt8();return new dA.UUID(r)},bA.prototype._unpackByteArrayWithSize=function(e,t){for(var r=new Int8Array(e),n=0;n<e;n++)r[n]=t.readInt8();return r},bA.prototype._unpackMap=function(e,t,r,n,o){return 160===t?this._unpackMapWithSize(r,n,o):216===e?this._unpackMapWithSize(n.readUInt8(),n,o):217===e?this._unpackMapWithSize(n.readUInt16(),n,o):218===e?this._unpackMapWithSize(n.readUInt32(),n,o):null},bA.prototype._unpackMapWithSize=function(e,t,r){for(var n={},o=0;o<e;o++){var i=this.unpack(t,r),a=this.unpack(t,r);Object.defineProperty(n,i,{value:a,writable:!0,enumerable:!0,configurable:!0})}return n},bA.prototype._unpackStruct=function(e,t,r,n,o){return 176===t?this._unpackStructWithSize(r,n,o):220===e?this._unpackStructWithSize(n.readUInt8(),n,o):221===e?this._unpackStructWithSize(n.readUInt16(),n,o):null},bA.prototype._unpackStructWithSize=function(e,t,r){for(var n=t.readUInt8(),o=new pA.Structure(n,[]),i=0;i<e;i++)o.fields.push(this.unpack(t,r));return r(o)},Pv.Unpacker=bA;var _A,vA,mA,pm={},bm=r&&r.__extends||(_A=function(e,t){return(_A=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}_A(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),gA=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),OA=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Om=r&&r.__importStar||(vA=function(e){return(vA=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=vA(e),n=0;n<r.length;n++)"default"!==r[n]&&gA(t,e,r[n]);return OA(t,e),t}),Tm=(Object.defineProperty(pm,"__esModule",{value:!0}),pm.Unpacker=pm.Packer=void 0,Om(Pv)),Cm=(mA=Tm.Packer,bm(wA,mA),wA.prototype.disableByteArrays=function(){throw new Error("Bolt V2 should always support byte arrays")},wA);function wA(){return null!==mA&&mA.apply(this,arguments)||this}pm.Packer=Cm;EA=Tm.Unpacker,bm(PA,EA);var EA,Fm=PA;function PA(e,t,r){return EA.call(this,e=void 0===e?!1:e,t=void 0===t?!1:t,r=void 0===r?!1:r)||this}pm.Unpacker=Fm;var SA,TA,jA=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),CA=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),zm=r&&r.__importStar||(SA=function(e){return(SA=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=SA(e),n=0;n<r.length;n++)"default"!==r[n]&&jA(t,e,r[n]);return CA(t,e),t}),Km=(Object.defineProperty(dv,"__esModule",{value:!0}),dv.structure=dv.v2=dv.v1=void 0,zm(Pv)),Ym=(dv.v1=Km,zm(pm)),Zm=(dv.v2=Ym,zm(Hv)),r0=(dv.structure=Zm,dv.default=Ym,{}),fb={},i0=r&&r.__extends||(TA=function(e,t){return(TA=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}TA(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(fb,"__esModule",{value:!0});i0(RA,IA=e.ConnectionProvider),RA.prototype.acquireConnection=function(e){e=void 0===e?{}:e,e.accessMode,e=this._connection;return this._connection=null,Promise.resolve(e)};var IA,u0=RA;function RA(e){var t=IA.call(this)||this;return t._connection=e,t}fb.default=u0;var f0={},h0={},O0={},Xv={},j0={},AA=(Object.defineProperty(j0,"__esModule",{value:!0}),j0.default=function(f,e){return function(t,o){var i=this;return new Promise(function(r,n){function e(e){n(e)}t.onerror=e.bind(i),t._error&&e(t._error),t.onmessage=function(t){try{var e=((e,t)=>{if(72!==(e=[e.readUInt8(),e.readUInt8(),e.readUInt8(),e.readUInt8()])[0]||84!==e[1]||84!==e[2]||80!==e[3])return new MA.ProtocolVersion(e[3],e[2]);throw t.error("Handshake failed since server responded with HTTP."),(0,MA.newError)("Server responded HTTP. Make sure you are not trying to connect to the http endpoint (HTTP defaults to port 7474 whereas BOLT defaults to port 7687)")})(t,o);r({protocolVersion:e,capabilites:0,buffer:t,consumeRemainingBuffer:function(e){t.hasRemaining()&&e(t.readSlice(t.remaining()))}})}catch(e){n(e)}},t.write((e=>{if(4<e.length)throw(0,MA.newError)("It should not have more than 4 versions of the protocol");var o=(0,AA.alloc)(20);return o.writeInt32(kA),e.forEach(function(e){var t,r,n;e instanceof Array?(r=(n=e[0]).major,t=e[1].minor,o.writeInt32((n=n.minor)-t<<16|n<<8|r)):(r=e.major,o.writeInt32((n=e.minor)<<8|r))}),o.reset(),o})([DA(255,1),[DA(5,8),DA(5,0)],[DA(4,4),DA(4,2)],DA(3,0)]))})}(f,e).then(function(e){if(e.protocolVersion.isEqualTo(new MA.ProtocolVersion(255,1))){for(var n=f,o=e.buffer,t=o.readVarInt(),r=[],i=0;i<t;i++){var a=[o.readUInt8(),o.readUInt8(),o.readUInt8(),o.readUInt8()];r=r.concat((e=>{for(var t=[],r=e[3],n=e[2],o=0;o<=e[1];o++)t.push({major:r,minor:n-o});return t})(a))}o.readVarInt();var u=xA,s=0,c=0;for(r.sort(function(e,t){return Number(e.major)!==Number(t.major)?Number(t.major)-Number(e.major):Number(t.minor)-Number(e.minor)}),i=0;i<r.length;i++){var l=r[i];if(NA.includes(l.major+"."+l.minor)){s=l.major,c=l.minor;break}}return new Promise(function(e,t){try{var r=(0,AA.alloc)(5);r.writeInt32(c<<8|s),r.writeVarInt(u),n.write(r),e({protocolVersion:new MA.ProtocolVersion(s,c),capabilites:u,consumeRemainingBuffer:function(e){o.hasRemaining()&&e(o.readSlice(o.remaining()))}})}catch(e){t(e)}})}return e})},Oh),MA=e,kA=1616949271,NA=["6.1","6.0","5.8","5.7","5.6","5.4","5.3","5.2","5.1","5.0","4.4","4.3","4.2","3.0"],xA=0;function DA(e,t){return{major:e,minor:t}}var UA,R0={},nh={},tm={},q0={},G0={},rg=r&&r.__extends||(UA=function(e,t){return(UA=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}UA(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Bh=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Z0=(Object.defineProperty(G0,"__esModule",{value:!0}),Bh(e),LA.ofRecord=function(e){return null===e?LA.ofNull():new GA(e)},LA.ofMessageResponse=function(e){return null===e?LA.ofNull():new BA(e)},LA.ofNull=function(){return new WA},Object.defineProperty(LA.prototype,"ttl",{get:function(){throw new Error("Not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(LA.prototype,"db",{get:function(){throw new Error("Not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(LA.prototype,"servers",{get:function(){throw new Error("Not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(LA.prototype,"isNull",{get:function(){throw new Error("Not implemented")},enumerable:!1,configurable:!0}),LA);function LA(){}G0.default=Z0;rg(VA,FA=Z0),Object.defineProperty(VA.prototype,"ttl",{get:function(){return this._response.rt.ttl},enumerable:!1,configurable:!0}),Object.defineProperty(VA.prototype,"servers",{get:function(){return this._response.rt.servers},enumerable:!1,configurable:!0}),Object.defineProperty(VA.prototype,"db",{get:function(){return this._response.rt.db},enumerable:!1,configurable:!0}),Object.defineProperty(VA.prototype,"isNull",{get:function(){return null===this._response},enumerable:!1,configurable:!0});var FA,BA=VA;function VA(e){var t=FA.call(this)||this;return t._response=e,t}rg(zA,qA=Z0),Object.defineProperty(zA.prototype,"isNull",{get:function(){return!0},enumerable:!1,configurable:!0});var qA,WA=zA;function zA(){return null!==qA&&qA.apply(this,arguments)||this}rg(KA,HA=Z0),Object.defineProperty(KA.prototype,"ttl",{get:function(){return this._record.get("ttl")},enumerable:!1,configurable:!0}),Object.defineProperty(KA.prototype,"servers",{get:function(){return this._record.get("servers")},enumerable:!1,configurable:!0}),Object.defineProperty(KA.prototype,"db",{get:function(){return this._record.has("db")?this._record.get("db"):null},enumerable:!1,configurable:!0}),Object.defineProperty(KA.prototype,"isNull",{get:function(){return null===this._record},enumerable:!1,configurable:!0});var HA,GA=KA;function KA(e){var t=HA.call(this)||this;return t._record=e,t}var YA,Vh=r&&r.__extends||(YA=function(e,t){return(YA=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}YA(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Q0=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ZA=(Object.defineProperty(q0,"__esModule",{value:!0}),q0.TelemetryObserver=q0.ProcedureRouteObserver=q0.RouteObserver=q0.CompletedObserver=q0.FailedObserver=q0.ResetObserver=q0.LogoffObserver=q0.LoginObserver=q0.ResultStreamObserver=q0.StreamObserver=void 0,e),QA=Q0(G0),XA=Sv,JA=ZA.internal.constants.FETCH_ALL,$A=ZA.error.PROTOCOL_ERROR,$0=(eM.prototype.onNext=function(e){},eM.prototype.onError=function(e){},eM.prototype.onCompleted=function(e){},eM);function eM(){}q0.StreamObserver=$0;Vh(rM,tM=$0),rM.prototype.pause=function(){this._paused=!0},rM.prototype.resume=function(){this._paused=!1,this._setupAutoPull(),this._state.pull(this)},rM.prototype.onNext=function(e){this._haveRecordStreamed=!0;var t=new ZA.Record(this._fieldKeys,e,this._fieldLookup);this._observers.some(function(e){return e.onNext})?this._observers.forEach(function(e){e.onNext&&e.onNext(t)}):(this._queuedRecords.push(t),this._queuedRecords.length>this._highRecordWatermark&&(this._autoPull=!1))},rM.prototype.onCompleted=function(e){this._state.onSuccess(this,e)},rM.prototype.onError=function(e,t){this._state.onError(this,e,t)},rM.prototype.cancel=function(){this._state.discard(this)},rM.prototype.prepareToHandleSingleResponse=function(){this._head=[],this._fieldKeys=[],this._setState(mM.STREAMING)},rM.prototype.markCompleted=function(){this._head=[],this._fieldKeys=[],this._tail={},this._setState(mM.SUCCEEDED)},rM.prototype.subscribe=function(e){if(this._head&&e.onKeys&&e.onKeys(this._head),0<this._queuedRecords.length&&e.onNext)for(var t=0;t<this._queuedRecords.length;t++)e.onNext(this._queuedRecords[t]),this._queuedRecords.length-t-1<=this._lowRecordWatermark&&(this._autoPull=!0,this._state===mM.READY)&&this._handleStreaming();this._tail&&e.onCompleted&&e.onCompleted(this._tail),this._error&&e.onError(this._error,this._runError),this._observers.push(e),this._state===mM.READY&&this._handleStreaming()},rM.prototype.unsubscribeAll=function(){this._observers=[]},rM.prototype._handleHasMore=function(e){this._setState(mM.READY),this._handleStreaming(),delete e.has_more},rM.prototype._handlePullSuccess=function(e){var t,r=this,n=this._enrichMetadata(Object.assign(this._server?{server:this._server}:{},this._meta,{stream_summary:{have_records_streamed:this._haveRecordStreamed,pulled:this._pulled,has_keys:0<this._fieldKeys.length}},e));[void 0,null,"r","w","rw","s"].includes(n.type)?(this._setState(mM.SUCCEEDED),e=null,t=function(){r._tail=n,r._observers.some(function(e){return e.onCompleted})&&r._observers.forEach(function(e){e.onCompleted&&e.onCompleted(n)}),r._afterComplete&&r._afterComplete(n)},(e=this._beforeComplete?this._beforeComplete(n):e)?Promise.resolve(e).then(t):t()):this.onError((0,ZA.newError)('Server returned invalid query type. Expected one of [undefined, null, "r", "w", "rw", "s"] but got \''.concat(n.type,"'"),$A))},rM.prototype._handleRunSuccess=function(e,t){var r=this;if(null===this._fieldKeys){if(this._fieldKeys=[],this._fieldLookup=Object.create(null),e.fields&&0<e.fields.length){this._fieldKeys=e.fields;for(var n=0;n<e.fields.length;n++)this._fieldLookup[e.fields[n]]=n}null!==e.db&&void 0!==this._onDb&&this._onDb(e.db),null!=e.fields&&delete e.fields,null!=e.qid&&(this._queryId=e.qid,delete e.qid),this._storeMetadataForCompletion(e);var o=null,i=(this._beforeKeys&&(o=this._beforeKeys(this._fieldKeys)),function(){r._head=r._fieldKeys,r._observers.some(function(e){return e.onKeys})&&r._observers.forEach(function(e){e.onKeys&&e.onKeys(r._fieldKeys)}),r._afterKeys&&r._afterKeys(r._fieldKeys),t()});o?Promise.resolve(o).then(i):i()}},rM.prototype._handleError=function(t,r){function e(){n._observers.some(function(e){return e.onError})&&n._observers.forEach(function(e){e.onError&&e.onError(t,r)}),n._afterError&&n._afterError(t)}var n=this,o=(this._setState(mM.FAILED),this._error=t,this._runError=r,null);this._beforeError&&(o=this._beforeError(t));o?Promise.resolve(o).then(e):e()},rM.prototype._handleStreaming=function(){!this._head||!this._observers.some(function(e){return e.onNext||e.onCompleted})&&!this._discard||this._paused||!this._discard&&!this._autoPull||this._more()},rM.prototype._more=function(){this._discard?this._discardFunction(this._queryId,this):(this._pulled=!0,this._moreFunction(this._queryId,this._fetchSize,this)),this._setState(mM.STREAMING)},rM.prototype._storeMetadataForCompletion=function(e){for(var t,r=Object.keys(e),n=r.length;n--;)t=r[n],this._meta[t]=e[t]},rM.prototype._setState=function(e){this._state=e},rM.prototype._setupAutoPull=function(){this._autoPull=!0};var tM,qh=rM;function rM(e){var e=void 0===e?{}:e,t=e.reactive,t=void 0!==t&&t,r=e.moreFunction,n=e.discardFunction,o=e.fetchSize,o=void 0===o?JA:o,i=e.beforeError,a=e.afterError,u=e.beforeKeys,s=e.afterKeys,c=e.beforeComplete,l=e.afterComplete,f=e.server,p=e.highRecordWatermark,p=void 0===p?Number.MAX_VALUE:p,d=e.lowRecordWatermark,d=void 0===d?Number.MAX_VALUE:d,h=e.enrichMetadata,e=e.onDb,y=tM.call(this)||this;return y._fieldKeys=null,y._fieldLookup=null,y._head=null,y._queuedRecords=[],y._tail=null,y._error=null,y._runError=!1,y._observers=[],y._meta={},y._server=f,y._beforeError=i,y._afterError=a,y._beforeKeys=u,y._afterKeys=s,y._beforeComplete=c,y._afterComplete=l,y._enrichMetadata=h||XA.functional.identity,y._queryId=null,y._moreFunction=r,y._discardFunction=n,y._discard=!1,y._fetchSize=o,y._lowRecordWatermark=d,y._highRecordWatermark=p,y._setState(t?mM.READY:mM.READY_STREAMING),y._setupAutoPull(),y._paused=!1,y._pulled=!t,y._haveRecordStreamed=!1,y._onDb=e,y}q0.ResultStreamObserver=qh;Vh(oM,nM=$0),oM.prototype.onNext=function(e){this.onError((0,ZA.newError)("Received RECORD when initializing "+ZA.json.stringify(e)))},oM.prototype.onError=function(e){this._onError&&this._onError(e)},oM.prototype.onCompleted=function(e){this._onCompleted&&this._onCompleted(e)};var nM,pg=oM;function oM(e){var e=void 0===e?{}:e,t=e.onError,e=e.onCompleted,r=nM.call(this)||this;return r._onError=t,r._onCompleted=e,r}q0.LoginObserver=pg;Vh(aM,iM=$0),aM.prototype.onNext=function(e){this.onError((0,ZA.newError)("Received RECORD when logging off "+ZA.json.stringify(e)))},aM.prototype.onError=function(e){this._onError&&this._onError(e)},aM.prototype.onCompleted=function(e){this._onCompleted&&this._onCompleted(e)};var iM,yg=aM;function aM(e){var e=void 0===e?{}:e,t=e.onError,e=e.onCompleted,r=iM.call(this)||this;return r._onError=t,r._onCompleted=e,r}q0.LogoffObserver=yg;Vh(sM,uM=$0),sM.prototype.onNext=function(e){this.onError((0,ZA.newError)("Received RECORD when resetting: received record is: "+ZA.json.stringify(e),$A))},sM.prototype.onError=function(e){e.code===$A&&this._onProtocolError&&this._onProtocolError(e.message),this._onError&&this._onError(e)},sM.prototype.onCompleted=function(e){this._onComplete&&this._onComplete(e)};var uM,pe=sM;function sM(e){var e=void 0===e?{}:e,t=e.onProtocolError,r=e.onError,e=e.onComplete,n=uM.call(this)||this;return n._onProtocolError=t,n._onError=r,n._onComplete=e,n}q0.ResetObserver=pe;Vh(lM,cM=qh),lM.prototype.onNext=function(e){this.onError((0,ZA.newError)("Received RECORD when sending telemetry "+ZA.json.stringify(e),$A))},lM.prototype.onError=function(e){this._onError&&this._onError(e)},lM.prototype.onCompleted=function(e){this._onCompleted&&this._onCompleted(e)};var cM,mg=lM;function lM(e){var e=void 0===e?{}:e,t=e.onError,e=e.onCompleted,r=cM.call(this)||this;return r._onError=t,r._onCompleted=e,r}q0.TelemetryObserver=mg;Vh(pM,fM=qh);var fM,Sg=pM;function pM(e){var t=e.error,e=fM.call(this,{beforeError:e.onError})||this;return e.onError(t),e}q0.FailedObserver=Sg;Vh(hM,dM=qh);var dM,t=hM;function hM(){var e=dM.call(this)||this;return dM.prototype.markCompleted.call(e),e}q0.CompletedObserver=t;Vh(bM,yM=$0),bM.prototype.onNext=function(e){this._records.push(e)},bM.prototype.onError=function(e){e.code===$A&&this._onProtocolError&&this._onProtocolError(e.message),this._onError&&this._onError(e)},bM.prototype.onCompleted=function(){null!==this._records&&1!==this._records.length?this.onError((0,ZA.newError)("Illegal response from router. Received "+this._records.length+" records but expected only one.\n"+ZA.json.stringify(this._records),$A)):this._onCompleted&&this._onCompleted(QA.default.ofRecord(this._records[0]))};var yM,Cg=bM;function bM(e){var t=e.resultObserver,r=e.onProtocolError,n=e.onError,e=e.onCompleted,o=yM.call(this)||this;return o._resultObserver=t,o._onError=n,o._onCompleted=e,o._records=[],o._onProtocolError=r,t.subscribe(o),o}q0.ProcedureRouteObserver=Cg;Vh(vM,_M=$0),vM.prototype.onNext=function(e){this.onError((0,ZA.newError)("Received RECORD when resetting: received record is: "+ZA.json.stringify(e),$A))},vM.prototype.onError=function(e){e.code===$A&&this._onProtocolError&&this._onProtocolError(e.message),this._onError&&this._onError(e)},vM.prototype.onCompleted=function(e){this._onCompleted&&this._onCompleted(QA.default.ofMessageResponse(e))};var _M,Rg=vM;function vM(e){var e=void 0===e?{}:e,t=e.onProtocolError,r=e.onError,e=e.onCompleted,n=_M.call(this)||this;return n._onProtocolError=t,n._onError=r,n._onCompleted=e,n}q0.RouteObserver=Rg;var mM={READY_STREAMING:{onSuccess:function(e,t){e._handleRunSuccess(t,function(){e._setState(mM.STREAMING)})},onError:function(e,t,r){e._handleError(t,null==r||r)},name:function(){return"READY_STREAMING"},pull:function(){},discard:function(e){e._discard=!0}},READY:{onSuccess:function(e,t){e._handleRunSuccess(t,function(){return e._handleStreaming()})},onError:function(e,t,r){e._handleError(t,null==r||r)},name:function(){return"READY"},pull:function(e){return e._more()},discard:function(e){e._discard=!0,null!=e._fieldKeys&&e._more()}},STREAMING:{onSuccess:function(e,t){t.has_more?e._handleHasMore(t):e._handlePullSuccess(t)},onError:function(e,t,r){e._handleError(t,null!=r&&r)},name:function(){return"STREAMING"},pull:function(){},discard:function(e){e._discard=!0}},FAILED:{onSuccess:function(e){},onError:function(e){},name:function(){return"FAILED"},pull:function(){},discard:function(){}},SUCCEEDED:{onError:function(e){},name:function(){return"SUCCEEDED"},pull:function(){},discard:function(){}}},gM=(Object.defineProperty(tm,"__esModule",{value:!0}),tm.assertDatabaseIsEmpty=function(e,t,r){void 0===t&&(t=function(){});if(e)throw e=(0,gM.newError)("Driver is connected to the database that does not support multiple databases. Please upgrade to neo4j 4.0.0 or later in order to use this functionality"),t(e.message),r.onError(e),e},tm.assertTxConfigIsEmpty=function(e,t,r){void 0===t&&(t=function(){});if(e&&!e.isEmpty())throw e=(0,gM.newError)("Driver is connected to the database that does not support transaction configuration. Please upgrade to neo4j 3.5.0 or later in order to use this functionality"),t(e.message),r.onError(e),e},tm.assertImpersonatedUserIsEmpty=function(e,t,r){void 0===t&&(t=function(){});if(e)throw e=(0,gM.newError)("Driver is connected to the database that does not support user impersonation. Please upgrade to neo4j 4.4.0 or later in order to use this functionality. "+"Trying to impersonate ".concat(e,".")),t(e.message),r.onError(e),e},tm.assertNotificationFilterIsEmpty=function(e,t,r){void 0===t&&(t=function(){});if(void 0!==e)throw e=(0,gM.newError)("Driver is connected to a database that does not support user notification filters. Please upgrade to Neo4j 5.7.0 or later in order to use this functionality. "+"Trying to set notifications to ".concat(gM.json.stringify(e),".")),t(e.message),r.onError(e),e},e);var Ng={},OM=(Object.defineProperty(Ng,"__esModule",{value:!0}),Ng.SIGNATURES=void 0,e),Ug=OM.internal.constants,wM=Ug.ACCESS_MODE_READ,EM=Ug.FETCH_ALL,PM=OM.internal.util.assertString,Bg=Object.freeze({INIT:1,RESET:15,RUN:16,PULL_ALL:63,HELLO:1,GOODBYE:2,BEGIN:17,COMMIT:18,ROLLBACK:19,TELEMETRY:84,ROUTE:102,LOGON:106,LOGOFF:107,DISCARD:47,PULL:63}),ro=(Ng.SIGNATURES=Bg,SM.init=function(e,t){return new SM(1,[e,t],function(){return"INIT ".concat(e," {...}")})},SM.run=function(t,r){return new SM(16,[t,r],function(e){return!0===e?"RUN ".concat(t," ").concat(OM.json.stringify(r)):"RUN ".concat(t," { ... }")})},SM.pullAll=function(){return RM},SM.reset=function(){return AM},SM.hello=function(e,t,r,n){void 0===r&&(r=null),void 0===n&&(n=null);t=Object.assign({user_agent:e},t);return r&&(t.routing=r),n&&(t.patch_bolt=n),new SM(1,[t],function(){return"HELLO {user_agent: '".concat(e,"', ...}")})},SM.hello5x1=function(e,t){var r={user_agent:e};return(t=void 0===t?null:t)&&(r.routing=t),new SM(1,[r],function(){return"HELLO {user_agent: '".concat(e,"', ...}")})},SM.hello5x2=function(e,t,r){void 0===r&&(r=null);var n={user_agent:e};return CM(n,t=void 0===t?null:t),r&&(n.routing=r),new SM(1,[n],function(){return"HELLO ".concat(OM.json.stringify(n))})},SM.hello5x3=function(e,t,r,n){void 0===r&&(r=null),void 0===n&&(n=null);var o={};return e&&(o.user_agent=e),t&&(o.bolt_agent={product:t.product,platform:t.platform,language:t.language,language_details:t.languageDetails}),CM(o,r),n&&(o.routing=n),new SM(1,[o],function(){return"HELLO ".concat(OM.json.stringify(o))})},SM.hello5x5=function(e,t,r,n){void 0===r&&(r=null),void 0===n&&(n=null);var o={};return e&&(o.user_agent=e),t&&(o.bolt_agent={product:t.product,platform:t.platform,language:t.language,language_details:t.languageDetails}),IM(o,r),n&&(o.routing=n),new SM(1,[o],function(){return"HELLO ".concat(OM.json.stringify(o))})},SM.logon=function(e){return new SM(106,[e],function(){return"LOGON { ... }"})},SM.logoff=function(){return new SM(107,[],function(){return"LOGOFF"})},SM.begin=function(e){var e=void 0===e?{}:e,t=TM(e.bookmarks,e.txConfig,e.database,e.mode,e.impersonatedUser,e.notificationFilter);return new SM(17,[t],function(){return"BEGIN ".concat(OM.json.stringify(t))})},SM.begin5x5=function(e){var e=void 0===e?{}:e,t=TM(e.bookmarks,e.txConfig,e.database,e.mode,e.impersonatedUser,e.notificationFilter,{appendNotificationFilter:IM});return new SM(17,[t],function(){return"BEGIN ".concat(OM.json.stringify(t))})},SM.commit=function(){return MM},SM.rollback=function(){return kM},SM.runWithMetadata=function(t,r,e){var e=void 0===e?{}:e,n=TM(e.bookmarks,e.txConfig,e.database,e.mode,e.impersonatedUser,e.notificationFilter);return new SM(16,[t,r,n],function(e){return(!0===e?"RUN ".concat(t," ").concat(OM.json.stringify(r)," "):"RUN ".concat(t," { ... } ")).concat(OM.json.stringify(n))})},SM.runWithMetadata5x5=function(t,r,e){var e=void 0===e?{}:e,n=TM(e.bookmarks,e.txConfig,e.database,e.mode,e.impersonatedUser,e.notificationFilter,{appendNotificationFilter:IM});return new SM(16,[t,r,n],function(e){return(!0===e?"RUN ".concat(t," ").concat(OM.json.stringify(r)," "):"RUN ".concat(t," { ... } ")).concat(OM.json.stringify(n))})},SM.goodbye=function(){return NM},SM.pull=function(e){var e=void 0===e?{}:e,t=e.stmtId,t=void 0===t?-1:t,e=e.n,r=jM(null==t?-1:t,(void 0===e?EM:e)||EM);return new SM(63,[r],function(){return"PULL ".concat(OM.json.stringify(r))})},SM.discard=function(e){var e=void 0===e?{}:e,t=e.stmtId,t=void 0===t?-1:t,e=e.n,r=jM(null==t?-1:t,(void 0===e?EM:e)||EM);return new SM(47,[r],function(){return"DISCARD ".concat(OM.json.stringify(r))})},SM.telemetry=function(e){var e=e.api,t=(0,OM.int)(e);return new SM(84,[t],function(){return"TELEMETRY ".concat(t.toString())})},SM.route=function(e,t,r){return new SM(102,[e=void 0===e?{}:e,t=void 0===t?[]:t,r=void 0===r?null:r],function(){return"ROUTE ".concat(OM.json.stringify(e)," ").concat(OM.json.stringify(t)," ").concat(r)})},SM.routeV4x4=function(e,t,r){void 0===e&&(e={}),void 0===t&&(t=[]);var n={};return(r=void 0===r?{}:r).databaseName&&(n.db=r.databaseName),r.impersonatedUser&&(n.imp_user=r.impersonatedUser),new SM(102,[e,t,n],function(){return"ROUTE ".concat(OM.json.stringify(e)," ").concat(OM.json.stringify(t)," ").concat(OM.json.stringify(n))})},SM);function SM(e,t,r){this.signature=e,this.fields=t,this.toString=r}function TM(e,t,r,n,o,i,a){void 0===a&&(a={});var u={};return e.isEmpty()||(u.bookmarks=e.values()),null!==t.timeout&&(u.tx_timeout=t.timeout),t.metadata&&(u.tx_metadata=t.metadata),r&&(u.db=PM(r,"database")),o&&(u.imp_user=PM(o,"impersonatedUser")),n===wM&&(u.mode="r"),(null!=(e=a.appendNotificationFilter)?e:CM)(u,i),u}function jM(e,t){t={n:(0,OM.int)(t)};return-1!==e&&(t.qid=(0,OM.int)(e)),t}function CM(e,t){t&&(t.minimumSeverityLevel&&(e.notifications_minimum_severity=t.minimumSeverityLevel),t.disabledCategories&&(e.notifications_disabled_categories=t.disabledCategories),t.disabledClassifications)&&(e.notifications_disabled_categories=t.disabledClassifications)}function IM(e,t){t&&(t.minimumSeverityLevel&&(e.notifications_minimum_severity=t.minimumSeverityLevel),t.disabledCategories&&(e.notifications_disabled_classifications=t.disabledCategories),t.disabledClassifications)&&(e.notifications_disabled_classifications=t.disabledClassifications)}var RM=new(Ng.default=ro)(63,[],function(){return"PULL_ALL"}),AM=new ro(15,[],function(){return"RESET"}),MM=new ro(18,[],function(){return"COMMIT"}),kM=new ro(19,[],function(){return"ROLLBACK"}),NM=new ro(2,[],function(){return"GOODBYE"}),zg={},k_={},xM=(Object.defineProperty(k_,"__esModule",{value:!0}),k_.TypeTransformer=void 0,dv),DM=e.internal.objectUtil;function UM(e){this._transformers=e,this._transformersPerSignature=new Map(e.map(function(e){return[e.signature,e]})),this.fromStructure=this.fromStructure.bind(this),this.toStructure=this.toStructure.bind(this),Object.freeze(this)}function LM(e){var t=e.signature,r=e.fromStructure,n=e.toStructure,e=e.isTypeInstance;this.signature=t,this.isTypeInstance=e,this.fromStructure=r,this.toStructure=n,Object.freeze(this)}UM.prototype.fromStructure=function(e){try{return e instanceof xM.structure.Structure&&this._transformersPerSignature.has(e.signature)?(0,this._transformersPerSignature.get(e.signature).fromStructure)(e):e}catch(e){return DM.createBrokenObject(e)}},UM.prototype.toStructure=function(t){var e=typeof t;return("object"==e||"function"==e||"symbol"==e)&&null!==t&&void 0!==(e=this._transformers.find(function(e){return(0,e.isTypeInstance)(t)}))?e.toStructure(t):t},k_.default=UM,LM.prototype.extendsWith=function(e){return new LM({signature:e.signature||this.signature,fromStructure:e.fromStructure||this.fromStructure,toStructure:e.toStructure||this.toStructure,isTypeInstance:e.isTypeInstance||this.isTypeInstance})},k_.TypeTransformer=LM;var FM=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},BM=(Object.defineProperty(zg,"__esModule",{value:!0}),e),VM=dv,qM=k_,WM=BM.error.PROTOCOL_ERROR;zg.default={createNodeTransformer:function(){return new qM.TypeTransformer({signature:78,isTypeInstance:function(e){return e instanceof BM.Node},toStructure:function(e){throw(0,BM.newError)("It is not allowed to pass nodes in query parameters, given: ".concat(e),WM)},fromStructure:function(e){VM.structure.verifyStructSize("Node",3,e.size);var e=FM(e.fields,3),t=e[0];return new BM.Node(t,e[1],e[2])}})},createRelationshipTransformer:function(){return new qM.TypeTransformer({signature:82,isTypeInstance:function(e){return e instanceof BM.Relationship},toStructure:function(e){throw(0,BM.newError)("It is not allowed to pass relationships in query parameters, given: ".concat(e),WM)},fromStructure:function(e){VM.structure.verifyStructSize("Relationship",5,e.size);var e=FM(e.fields,5),t=e[0];return new BM.Relationship(t,e[1],e[2],e[3],e[4])}})},createUnboundRelationshipTransformer:function(){return new qM.TypeTransformer({signature:114,isTypeInstance:function(e){return e instanceof BM.UnboundRelationship},toStructure:function(e){throw(0,BM.newError)("It is not allowed to pass unbound relationships in query parameters, given: ".concat(e),WM)},fromStructure:function(e){VM.structure.verifyStructSize("UnboundRelationship",3,e.size);var e=FM(e.fields,3),t=e[0];return new BM.UnboundRelationship(t,e[1],e[2])}})},createPathTransformer:function(){return new qM.TypeTransformer({signature:80,isTypeInstance:function(e){return e instanceof BM.Path},toStructure:function(e){throw(0,BM.newError)("It is not allowed to pass paths in query parameters, given: ".concat(e),WM)},fromStructure:function(e){VM.structure.verifyStructSize("Path",3,e.size);for(var e=FM(e.fields,3),t=e[0],r=e[1],n=e[2],o=[],i=t[0],a=0;a<n.length;a+=2){var u=t[n[a+1]],s=(0,BM.toNumber)(n[a]),c=void 0;0<s?(c=r[s-1])instanceof BM.UnboundRelationship&&(r[s-1]=c=c.bindTo(i,u)):(c=r[-s-1])instanceof BM.UnboundRelationship&&(r[-s-1]=c=c.bindTo(u,i)),o.push(new BM.PathSegment(i,c,u)),i=u}return new BM.Path(t[0],t[t.length-1],o)}})},createVectorTransformer:function(){return new qM.TypeTransformer({signature:86,isTypeInstance:function(e){return e instanceof BM.Vector},toStructure:function(e){throw(0,BM.newError)("Sending vector types require server and driver to be communicating with Bolt protocol 6.0 or later. Please update your database version.")},fromStructure:function(e){throw(0,BM.newError)("Server tried to send Vector object, but server and driver are communicating on a version of the Bolt protocol that does not support vectors.")}})},createEncryptedValueTransformer:function(){return new qM.TypeTransformer({signature:101,isTypeInstance:function(e){return(0,BM.isEnc)(e)},toStructure:function(e){var t=e.profileType;return new VM.structure.Structure(101,[t,e.profileVersion,e.profileName,e.cipherOutput,e.typeName,e.typeProtocolMajor,e.typeProtocolMinor,e.metadata])},fromStructure:function(e){if(8!==e.fields.length)throw(0,BM.newError)("Expects encrypted structure to have 8 fields, found ".concat(e.fields.length));var t=e.fields[0],r=e.fields[1],n=e.fields[2],o=e.fields[3],i=e.fields[4],a=e.fields[5],u=e.fields[6],e=e.fields[7];return new BM.EncryptedValue(o,n,t,r,i,a,u,e)}})}};var zM,HM=r&&r.__assign||function(){return(HM=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},GM=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),KM=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Qg=r&&r.__importStar||(zM=function(e){return(zM=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=zM(e),n=0;n<r.length;n++)"default"!==r[n]&&GM(t,e,r[n]);return KM(t,e),t}),rO=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},YM=(Object.defineProperty(nh,"__esModule",{value:!0}),tm),ZM=dv,QM=Qg(Ng),XM=q0,JM=e,$M=rO(zg),e2=rO(k_),t2=JM.internal.bookmarks.Bookmarks,uO=JM.internal.constants,r2=uO.ACCESS_MODE_WRITE,n2=uO.BOLT_PROTOCOL_V1,o2=(JM.internal.logger.Logger,JM.internal.txConfig.TxConfig),i2=Object.freeze({OPERATION:"",OPERATION_CODE:"0",CURRENT_SCHEMA:"/"}),dO=(Object.defineProperty(a2.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new e2.default(Object.values($M.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),Object.defineProperty(a2.prototype,"version",{get:function(){return n2},enumerable:!1,configurable:!0}),Object.defineProperty(a2.prototype,"supportsReAuth",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(a2.prototype,"initialized",{get:function(){return!!this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(a2.prototype,"authToken",{get:function(){return this._authToken},enumerable:!1,configurable:!0}),a2.prototype.packer=function(){return this._packer},a2.prototype.packable=function(e){return this._packer.packable(e,this.transformer.toStructure)},a2.prototype.unpacker=function(){return this._unpacker},a2.prototype.unpack=function(e){return this._unpacker.unpack(e,this.transformer.fromStructure)},a2.prototype.transformMetadata=function(e){return e},a2.prototype.enrichErrorMetadata=function(e){return HM(HM({},e),{diagnostic_record:null!==e.diagnostic_record?HM(HM({},i2),e.diagnostic_record):null})},a2.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=e.authToken,o=e.notificationFilter,i=e.onError,a=e.onComplete,e=new XM.LoginObserver({onError:function(e){return t._onLoginError(e,i)},onCompleted:function(e){return t._onLoginCompleted(e,a)}});return(0,YM.assertNotificationFilterIsEmpty)(o,this._onProtocolError,e),this.write(QM.default.init(r,n),e,!0),e},a2.prototype.logoff=function(e){var e=void 0===e?{}:e,t=e.onComplete,t=new XM.LogoffObserver({onCompleted:t,onError:e.onError}),e=(0,JM.newError)("Driver is connected to a database that does not support logoff. Please upgrade to Neo4j 5.5.0 or later in order to use this functionality.");throw this._onProtocolError(e.message),t.onError(e),e},a2.prototype.logon=function(e){var t=this,e=void 0===e?{}:e,r=e.authToken,n=e.onComplete,o=e.onError,e=new XM.LoginObserver({onCompleted:function(){return t._onLoginCompleted({},r,n)},onError:function(e){return t._onLoginError(e,o)}}),i=(0,JM.newError)("Driver is connected to a database that does not support logon. Please upgrade to Neo4j 5.5.0 or later in order to use this functionality.");throw this._onProtocolError(i.message),e.onError(i),i},a2.prototype.prepareToClose=function(){},a2.prototype.beginTransaction=function(e){var e=void 0===e?{}:e,t=e.bookmarks,r=e.txConfig,n=e.database,o=e.mode,i=e.impersonatedUser,a=e.notificationFilter,u=e.beforeError,s=e.afterError,c=e.beforeComplete,e=e.afterComplete;return this.run("BEGIN",t?t.asBeginTransactionParameters():{},{bookmarks:t,txConfig:r,database:n,mode:o,impersonatedUser:i,notificationFilter:a,beforeError:u,afterError:s,beforeComplete:c,afterComplete:e,flush:!1})},a2.prototype.commitTransaction=function(e){var e=void 0===e?{}:e,t=e.beforeError,r=e.afterError,n=e.beforeComplete,e=e.afterComplete;return this.run("COMMIT",{},{bookmarks:t2.empty(),txConfig:o2.empty(),mode:r2,beforeError:t,afterError:r,beforeComplete:n,afterComplete:e})},a2.prototype.rollbackTransaction=function(e){var e=void 0===e?{}:e,t=e.beforeError,r=e.afterError,n=e.beforeComplete,e=e.afterComplete;return this.run("ROLLBACK",{},{bookmarks:t2.empty(),txConfig:o2.empty(),mode:r2,beforeError:t,afterError:r,beforeComplete:n,afterComplete:e})},a2.prototype.run=function(e,t,r){var r=void 0===r?{}:r,n=(r.bookmarks,r.txConfig),o=r.database,i=r.impersonatedUser,a=r.notificationFilter,u=r.flush,u=void 0===u||u,s=r.highRecordWatermark,s=void 0===s?Number.MAX_VALUE:s,c=r.lowRecordWatermark,c=void 0===c?Number.MAX_VALUE:c,r=new XM.ResultStreamObserver({server:this._server,beforeKeys:r.beforeKeys,afterKeys:r.afterKeys,beforeError:r.beforeError,afterError:r.afterError,beforeComplete:r.beforeComplete,afterComplete:r.afterComplete,highRecordWatermark:s,lowRecordWatermark:c});return(0,YM.assertTxConfigIsEmpty)(n,this._onProtocolError,r),(0,YM.assertDatabaseIsEmpty)(o,this._onProtocolError,r),(0,YM.assertImpersonatedUserIsEmpty)(i,this._onProtocolError,r),(0,YM.assertNotificationFilterIsEmpty)(a,this._onProtocolError,r),this.write(QM.default.run(e,t),r,!1),this.write(QM.default.pullAll(),r,u),r},Object.defineProperty(a2.prototype,"currentFailure",{get:function(){return this._responseHandler.currentFailure},enumerable:!1,configurable:!0}),a2.prototype.reset=function(e){var e=void 0===e?{}:e,t=e.onError,t=new XM.ResetObserver({onProtocolError:this._onProtocolError,onError:t,onComplete:e.onComplete});return this.write(QM.default.reset(),t,!0),t},a2.prototype.telemetry=function(e,t){e.api;e=void 0===t?{}:t,e.onError,t=e.onCompleted,e=new XM.CompletedObserver;return t&&t(),e},a2.prototype._createPacker=function(e){return new ZM.v1.Packer(e)},a2.prototype._createUnpacker=function(e,t){return new ZM.v1.Unpacker(e,t)},a2.prototype.write=function(e,t,r){this._lastMessageSignature=e.signature;var n=new ZM.structure.Structure(e.signature,e.fields);this.packable(n)(),this.queueObserverIfProtocolIsNotBroken(t)&&(this._log.isDebugEnabled()&&this._log.debug("C: ".concat(e.toString(this._log.unredactDebugLogs))),this._chunker.messageBoundary(),r)&&this._chunker.flush()},a2.prototype.isLastMessageLogon=function(){return this._lastMessageSignature===QM.SIGNATURES.HELLO||this._lastMessageSignature===QM.SIGNATURES.LOGON},a2.prototype.isLastMessageReset=function(){return this._lastMessageSignature===QM.SIGNATURES.RESET},a2.prototype.notifyFatalError=function(e){return this._fatalError=e,this._responseHandler._notifyErrorToObservers(e)},a2.prototype.updateCurrentObserver=function(){return this._responseHandler._updateCurrentObserver()},a2.prototype.hasOngoingObservableRequests=function(){return this._responseHandler.hasOngoingObservableRequests()},a2.prototype.queueObserverIfProtocolIsNotBroken=function(e){return this.isBroken()?(this.notifyFatalErrorToObserver(e),!1):this._responseHandler._queueObserver(e)},a2.prototype.isBroken=function(){return!!this._fatalError},a2.prototype.notifyFatalErrorToObserver=function(e){e&&e.onError&&e.onError(this._fatalError,!1)},a2.prototype.resetFailure=function(){this._responseHandler._resetFailure()},a2.prototype._onLoginCompleted=function(e,t,r){this._initialized=!0,this._authToken=t,e&&(t=e.server,this._server.version||(this._server.version=t)),r&&r(e)},a2.prototype._onLoginError=function(e,t){this._onProtocolError(e.message),t&&t(e)},a2);function a2(e,t,r,n,o,i){var r=void 0===r?{}:r,a=r.disableLosslessIntegers,r=r.useBigInt;void 0===n&&(n=function(){return null}),this._server=e||{},this._chunker=t,this._packer=this._createPacker(t),this._unpacker=this._createUnpacker(a,r),this._responseHandler=n(this),this._log=o,this._onProtocolError=i,this._fatalError=null,this._lastMessageSignature=null,this._config={disableLosslessIntegers:a,useBigInt:r}}nh.default=dO;var Z={},vO={},EO={},u2=(Object.defineProperty(EO,"__esModule",{value:!0}),EO.epochDayToDate=b2,EO.nanoOfDayToLocalTime=_2,EO.epochSecondAndNanoToLocalDateTime=function(e,t){var r=h2(e,d2),e=y2(e,d2).multiply(p2).add(t),t=b2(r),r=_2(e);return new u2.LocalDateTime(t.year,t.month,t.day,r.hour,r.minute,r.second,r.nanosecond)},e),jO=u2.internal.temporalUtil,s2=jO.DAYS_0000_TO_1970,c2=jO.DAYS_PER_400_YEAR_CYCLE,l2=jO.NANOS_PER_HOUR,f2=jO.NANOS_PER_MINUTE,p2=jO.NANOS_PER_SECOND,d2=jO.SECONDS_PER_DAY,h2=jO.floorDiv,y2=jO.floorMod;function b2(e){var e=(e=(0,u2.int)(e)).add(s2).subtract(60),t=(0,u2.int)(0),r=(e.lessThan(0)&&(t=(r=e.add(1).div(c2).subtract(1)).multiply(400),e=e.add(r.multiply(-c2))),e.multiply(400).add(591).div(c2)),n=e.subtract(r.multiply(365).add(r.div(4)).subtract(r.div(100)).add(r.div(400))),e=(n.lessThan(0)&&(r=r.subtract(1),n=e.subtract(r.multiply(365).add(r.div(4)).subtract(r.div(100)).add(r.div(400)))),r=r.add(t),n),t=e.multiply(5).add(2).div(153),n=t.add(2).modulo(12).add(1),e=e.subtract(t.multiply(306).add(5).div(10)).add(1),r=r.add(t.div(10));return new u2.Date(r,n,e)}function _2(e){var t=(e=(0,u2.int)(e)).div(l2),r=(e=e.subtract(t.multiply(l2))).div(f2),n=(e=e.subtract(r.multiply(f2))).div(p2),e=e.subtract(n.multiply(p2));return new u2.LocalTime(t,r,n,e)}var v2=r&&r.__assign||function(){return(v2=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},m2=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},N_=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},g2=(Object.defineProperty(vO,"__esModule",{value:!0}),e),O2=dv,w2=k_,E2=EO,NO=N_(zg),qO=g2.internal.temporalUtil,P2=qO.dateToEpochDay,S2=qO.localDateTimeToEpochSecond,T2=qO.localTimeToNanoOfDay;function j2(e,t,r){if(!t&&!r)return e;var n,o,i,a=Object.create(Object.getPrototypeOf(e));for(n in e)!0===Object.prototype.hasOwnProperty.call(e,n)&&(o=e[n],a[n]=(0,g2.isInt)(o)?(i=o,r?i.toBigInt():i.toNumberOrInfinity()):o);return Object.freeze(a),a}vO.default=v2(v2({},NO.default),{createPoint2DTransformer:function(){return new w2.TypeTransformer({signature:88,isTypeInstance:function(e){return(0,g2.isPoint)(e)&&null==e.z},toStructure:function(e){return new O2.structure.Structure(88,[(0,g2.int)(e.srid),e.x,e.y])},fromStructure:function(e){O2.structure.verifyStructSize("Point2D",3,e.size);var e=m2(e.fields,3),t=e[0];return new g2.Point(t,e[1],e[2],void 0)}})},createPoint3DTransformer:function(){return new w2.TypeTransformer({signature:89,isTypeInstance:function(e){return(0,g2.isPoint)(e)&&null!=e.z},toStructure:function(e){return new O2.structure.Structure(89,[(0,g2.int)(e.srid),e.x,e.y,e.z])},fromStructure:function(e){O2.structure.verifyStructSize("Point3D",4,e.size);var e=m2(e.fields,4),t=e[0];return new g2.Point(t,e[1],e[2],e[3])}})},createDurationTransformer:function(){return new w2.TypeTransformer({signature:69,isTypeInstance:g2.isDuration,toStructure:function(e){var t=(0,g2.int)(e.months),r=(0,g2.int)(e.days),n=(0,g2.int)(e.seconds),e=(0,g2.int)(e.nanoseconds);return new O2.structure.Structure(69,[t,r,n,e])},fromStructure:function(e){O2.structure.verifyStructSize("Duration",4,e.size);var e=m2(e.fields,4),t=e[0];return new g2.Duration(t,e[1],e[2],e[3])}})},createLocalTimeTransformer:function(e){var t=e.disableLosslessIntegers,r=e.useBigInt;return new w2.TypeTransformer({signature:116,isTypeInstance:g2.isLocalTime,toStructure:function(e){e=T2(e.hour,e.minute,e.second,e.nanosecond);return new O2.structure.Structure(116,[e])},fromStructure:function(e){O2.structure.verifyStructSize("LocalTime",1,e.size);e=m2(e.fields,1)[0];return j2((0,E2.nanoOfDayToLocalTime)(e),t,r)}})},createTimeTransformer:function(e){var r=e.disableLosslessIntegers,n=e.useBigInt;return new w2.TypeTransformer({signature:84,isTypeInstance:g2.isTime,toStructure:function(e){var t=T2(e.hour,e.minute,e.second,e.nanosecond),e=(0,g2.int)(e.timeZoneOffsetSeconds);return new O2.structure.Structure(84,[t,e])},fromStructure:function(e){O2.structure.verifyStructSize("Time",2,e.size);var e=m2(e.fields,2),t=e[0],e=e[1],t=(0,E2.nanoOfDayToLocalTime)(t);return j2(new g2.Time(t.hour,t.minute,t.second,t.nanosecond,e),r,n)}})},createDateTransformer:function(e){var t=e.disableLosslessIntegers,r=e.useBigInt;return new w2.TypeTransformer({signature:68,isTypeInstance:g2.isDate,toStructure:function(e){e=P2(e.year,e.month,e.day);return new O2.structure.Structure(68,[e])},fromStructure:function(e){O2.structure.verifyStructSize("Date",1,e.size);e=m2(e.fields,1)[0];return j2((0,E2.epochDayToDate)(e),t,r)}})},createLocalDateTimeTransformer:function(e){var r=e.disableLosslessIntegers,n=e.useBigInt;return new w2.TypeTransformer({signature:100,isTypeInstance:g2.isLocalDateTime,toStructure:function(e){var t=S2(e.year,e.month,e.day,e.hour,e.minute,e.second,e.nanosecond),e=(0,g2.int)(e.nanosecond);return new O2.structure.Structure(100,[t,e])},fromStructure:function(e){O2.structure.verifyStructSize("LocalDateTime",2,e.size);var e=m2(e.fields,2),t=e[0];return j2((0,E2.epochSecondAndNanoToLocalDateTime)(t,e[1]),r,n)}})},createDateTimeWithZoneIdTransformer:function(e){var n=e.disableLosslessIntegers,o=e.useBigInt;return new w2.TypeTransformer({signature:102,isTypeInstance:function(e){return(0,g2.isDateTime)(e)&&null!=e.timeZoneId},toStructure:function(e){var t=S2(e.year,e.month,e.day,e.hour,e.minute,e.second,e.nanosecond),r=(0,g2.int)(e.nanosecond),e=e.timeZoneId;return new O2.structure.Structure(102,[t,r,e])},fromStructure:function(e){O2.structure.verifyStructSize("DateTimeWithZoneId",3,e.size);var e=m2(e.fields,3),t=e[0],r=e[2],t=(0,E2.epochSecondAndNanoToLocalDateTime)(t,e[1]);return j2(new g2.DateTime(t.year,t.month,t.day,t.hour,t.minute,t.second,t.nanosecond,null,r),n,o)}})},createDateTimeWithOffsetTransformer:function(e){var n=e.disableLosslessIntegers,o=e.useBigInt;return new w2.TypeTransformer({signature:70,isTypeInstance:function(e){return(0,g2.isDateTime)(e)&&null==e.timeZoneId},toStructure:function(e){var t=S2(e.year,e.month,e.day,e.hour,e.minute,e.second,e.nanosecond),r=(0,g2.int)(e.nanosecond),e=(0,g2.int)(e.timeZoneOffsetSeconds);return new O2.structure.Structure(70,[t,r,e])},fromStructure:function(e){O2.structure.verifyStructSize("DateTimeWithZoneOffset",3,e.size);var e=m2(e.fields,3),t=e[0],r=e[2],t=(0,E2.epochSecondAndNanoToLocalDateTime)(t,e[1]);return j2(new g2.DateTime(t.year,t.month,t.day,t.hour,t.minute,t.second,t.nanosecond,r,null),n,o)}})}});var C2,I2,HO=r&&r.__extends||(C2=function(e,t){return(C2=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}C2(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),XO=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},$O=(Object.defineProperty(Z,"__esModule",{value:!0}),XO(nh)),R2=XO(dv),nw=e,A2=XO(vO),M2=XO(k_),k2=nw.internal.constants.BOLT_PROTOCOL_V2,sw=(I2=$O.default,HO(N2,I2),N2.prototype._createPacker=function(e){return new R2.default.Packer(e)},N2.prototype._createUnpacker=function(e,t){return new R2.default.Unpacker(e,t)},Object.defineProperty(N2.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new M2.default(Object.values(A2.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),Object.defineProperty(N2.prototype,"version",{get:function(){return k2},enumerable:!1,configurable:!0}),N2);function N2(){return null!==I2&&I2.apply(this,arguments)||this}Z.default=sw;var x2,D2,fw={},Xp={},U2=r&&r.__assign||function(){return(U2=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},yw=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},bw=(Object.defineProperty(Xp,"__esModule",{value:!0}),yw(vO)),ww=(Xp.default=U2({},bw.default),r&&r.__extends||(x2=function(e,t){return(x2=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}x2(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),L2=r&&r.__assign||function(){return(L2=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Sw=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Kv=(Object.defineProperty(fw,"__esModule",{value:!0}),Sw(Z)),F2=Sw(Ng),B2=tm,V2=q0,q2=Sw(Xp),W2=Sw(k_),z2=(e.internal.bookmarks.Bookmarks,e.internal.constants.BOLT_PROTOCOL_V3),H2=e.internal.txConfig.TxConfig,G2="context",K2="CALL dbms.cluster.routing.getRoutingTable($".concat(G2,")"),Y2=new V2.StreamObserver,A0=(D2=Kv.default,ww(Z2,D2),Object.defineProperty(Z2.prototype,"version",{get:function(){return z2},enumerable:!1,configurable:!0}),Object.defineProperty(Z2.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new W2.default(Object.values(q2.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),Z2.prototype.transformMetadata=function(e){return"t_first"in e&&(e.result_available_after=e.t_first,delete e.t_first),"t_last"in e&&(e.result_consumed_after=e.t_last,delete e.t_last),e},Z2.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=e.authToken,o=e.notificationFilter,i=e.onError,a=e.onComplete,e=new V2.LoginObserver({onError:function(e){return t._onLoginError(e,i)},onCompleted:function(e){return t._onLoginCompleted(e,n,a)}});return(0,B2.assertNotificationFilterIsEmpty)(o,this._onProtocolError,e),this.write(F2.default.hello(r,n),e,!0),e},Z2.prototype.prepareToClose=function(){this.write(F2.default.goodbye(),Y2,!0)},Z2.prototype.beginTransaction=function(e){var e=void 0===e?{}:e,t=e.bookmarks,r=e.txConfig,n=e.database,o=e.impersonatedUser,i=e.notificationFilter,a=e.mode,e=new V2.ResultStreamObserver({server:this._server,beforeError:e.beforeError,afterError:e.afterError,beforeComplete:e.beforeComplete,afterComplete:e.afterComplete});return e.prepareToHandleSingleResponse(),(0,B2.assertDatabaseIsEmpty)(n,this._onProtocolError,e),(0,B2.assertImpersonatedUserIsEmpty)(o,this._onProtocolError,e),(0,B2.assertNotificationFilterIsEmpty)(i,this._onProtocolError,e),this.write(F2.default.begin({bookmarks:t,txConfig:r,mode:a}),e,!0),e},Z2.prototype.commitTransaction=function(e){var e=void 0===e?{}:e,t=e.beforeError,t=new V2.ResultStreamObserver({server:this._server,beforeError:t,afterError:e.afterError,beforeComplete:e.beforeComplete,afterComplete:e.afterComplete});return t.prepareToHandleSingleResponse(),this.write(F2.default.commit(),t,!0),t},Z2.prototype.rollbackTransaction=function(e){var e=void 0===e?{}:e,t=e.beforeError,t=new V2.ResultStreamObserver({server:this._server,beforeError:t,afterError:e.afterError,beforeComplete:e.beforeComplete,afterComplete:e.afterComplete});return t.prepareToHandleSingleResponse(),this.write(F2.default.rollback(),t,!0),t},Z2.prototype.run=function(e,t,r){var r=void 0===r?{}:r,n=r.bookmarks,o=r.txConfig,i=r.database,a=r.impersonatedUser,u=r.notificationFilter,s=r.mode,c=r.flush,c=void 0===c||c,l=r.highRecordWatermark,l=void 0===l?Number.MAX_VALUE:l,f=r.lowRecordWatermark,f=void 0===f?Number.MAX_VALUE:f,r=new V2.ResultStreamObserver({server:this._server,beforeKeys:r.beforeKeys,afterKeys:r.afterKeys,beforeError:r.beforeError,afterError:r.afterError,beforeComplete:r.beforeComplete,afterComplete:r.afterComplete,highRecordWatermark:l,lowRecordWatermark:f});return(0,B2.assertDatabaseIsEmpty)(i,this._onProtocolError,r),(0,B2.assertImpersonatedUserIsEmpty)(a,this._onProtocolError,r),(0,B2.assertNotificationFilterIsEmpty)(u,this._onProtocolError,r),this.write(F2.default.runWithMetadata(e,t,{bookmarks:n,txConfig:o,mode:s}),r,!1),this.write(F2.default.pullAll(),r,c),r},Z2.prototype.requestRoutingInformation=function(e){var t,r=e.routingContext,n=e.sessionContext,n=void 0===n?{}:n,o=e.onError,e=e.onCompleted,r=this.run(K2,((t={})[G2]=void 0===r?{}:r,t),L2(L2({},n),{txConfig:H2.empty()}));return new V2.ProcedureRouteObserver({resultObserver:r,onProtocolError:this._onProtocolError,onError:o,onCompleted:e})},Z2);function Z2(){return null!==D2&&D2.apply(this,arguments)||this}fw.default=A0;var Q2,X2,Cw={},kw={},J2=r&&r.__assign||function(){return(J2=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Dw=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},o=(Object.defineProperty(kw,"__esModule",{value:!0}),Dw(Xp)),zw=(kw.default=J2({},o.default),r&&r.__extends||(Q2=function(e,t){return(Q2=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Q2(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),$2=r&&r.__assign||function(){return($2=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Im=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Yw=(Object.defineProperty(Cw,"__esModule",{value:!0}),Im(fw)),ek=Im(Ng),tk=tm,rk=q0,nk=Im(kw),ok=Im(k_),Op=(e.internal.bookmarks.Bookmarks,e.internal.constants),ik=Op.BOLT_PROTOCOL_V4_0,ak=Op.FETCH_ALL,uk=e.internal.txConfig.TxConfig,sk="context",ck="database",lk="CALL dbms.routing.getRoutingTable($".concat(sk,", $").concat(ck,")"),$w=(X2=Yw.default,zw(fk,X2),Object.defineProperty(fk.prototype,"version",{get:function(){return ik},enumerable:!1,configurable:!0}),Object.defineProperty(fk.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new ok.default(Object.values(nk.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),fk.prototype.beginTransaction=function(e){var e=void 0===e?{}:e,t=e.bookmarks,r=e.txConfig,n=e.database,o=e.impersonatedUser,i=e.notificationFilter,a=e.mode,e=new rk.ResultStreamObserver({server:this._server,beforeError:e.beforeError,afterError:e.afterError,beforeComplete:e.beforeComplete,afterComplete:e.afterComplete});return e.prepareToHandleSingleResponse(),(0,tk.assertImpersonatedUserIsEmpty)(o,this._onProtocolError,e),(0,tk.assertNotificationFilterIsEmpty)(i,this._onProtocolError,e),this.write(ek.default.begin({bookmarks:t,txConfig:r,database:n,mode:a}),e,!0),e},fk.prototype.run=function(e,t,r){var r=void 0===r?{}:r,n=r.bookmarks,o=r.txConfig,i=r.database,a=r.impersonatedUser,u=r.notificationFilter,s=r.mode,c=r.beforeKeys,l=r.afterKeys,f=r.beforeError,p=r.afterError,d=r.beforeComplete,h=r.afterComplete,y=r.flush,y=void 0===y||y,b=r.reactive,b=void 0!==b&&b,_=r.fetchSize,_=void 0===_?ak:_,v=r.highRecordWatermark,v=void 0===v?Number.MAX_VALUE:v,r=r.lowRecordWatermark,r=void 0===r?Number.MAX_VALUE:r,c=new rk.ResultStreamObserver({server:this._server,reactive:b,fetchSize:_,moreFunction:this._requestMore.bind(this),discardFunction:this._requestDiscard.bind(this),beforeKeys:c,afterKeys:l,beforeError:f,afterError:p,beforeComplete:d,afterComplete:h,highRecordWatermark:v,lowRecordWatermark:r}),l=((0,tk.assertImpersonatedUserIsEmpty)(a,this._onProtocolError,c),(0,tk.assertNotificationFilterIsEmpty)(u,this._onProtocolError,c),b);return this.write(ek.default.runWithMetadata(e,t,{bookmarks:n,txConfig:o,database:i,mode:s}),c,l&&y),b||this.write(ek.default.pull({n:_}),c,y),c},fk.prototype._requestMore=function(e,t,r){this.write(ek.default.pull({stmtId:e,n:t}),r,!0)},fk.prototype._requestDiscard=function(e,t){this.write(ek.default.discard({stmtId:e}),t,!0)},fk.prototype._noOp=function(){},fk.prototype.requestRoutingInformation=function(e){var t,r=e.routingContext,n=e.databaseName,n=void 0===n?null:n,o=e.sessionContext,o=void 0===o?{}:o,i=e.onError,e=e.onCompleted,r=this.run(lk,((t={})[sk]=void 0===r?{}:r,t[ck]=n,t),$2($2({},o),{txConfig:uk.empty()}));return new rk.ProcedureRouteObserver({resultObserver:r,onProtocolError:this._onProtocolError,onError:i,onCompleted:e})},fk);function fk(){return null!==X2&&X2.apply(this,arguments)||this}Cw.default=$w;var pk,dk,ad={},M_={},hk=r&&r.__assign||function(){return(hk=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Ia=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},lE=(Object.defineProperty(M_,"__esModule",{value:!0}),Ia(kw)),yE=(M_.default=hk({},lE.default),r&&r.__extends||(pk=function(e,t){return(pk=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}pk(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),Kp=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},v=(Object.defineProperty(ad,"__esModule",{value:!0}),Kp(Cw)),yk=Kp(Ng),bk=q0,DE=e,_k=tm,vk=Kp(M_),mk=Kp(k_),gk=DE.internal.constants.BOLT_PROTOCOL_V4_1,u=(dk=v.default,yE(Ok,dk),Object.defineProperty(Ok.prototype,"version",{get:function(){return gk},enumerable:!1,configurable:!0}),Object.defineProperty(Ok.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new mk.default(Object.values(vk.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),Ok.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=e.authToken,o=e.notificationFilter,i=e.onError,a=e.onComplete,e=new bk.LoginObserver({onError:function(e){return t._onLoginError(e,i)},onCompleted:function(e){return t._onLoginCompleted(e,n,a)}});return(0,_k.assertNotificationFilterIsEmpty)(o,this._onProtocolError,e),this.write(yk.default.hello(r,n,this._serversideRouting),e,!0),e},Ok);function Ok(e,t,r,n,o,i,a){e=dk.call(this,e,t,r,n=void 0===n?function(){return null}:n,o,i)||this;return e._serversideRouting=a,e}ad.default=u;var wk,Ek,h={},R={},Pk=r&&r.__assign||function(){return(Pk=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},p=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Wr=(Object.defineProperty(R,"__esModule",{value:!0}),p(M_)),l=(R.default=Pk({},Wr.default),r&&r.__extends||(wk=function(e,t){return(wk=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}wk(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),Da=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},S=(Object.defineProperty(h,"__esModule",{value:!0}),Da(ad)),wa=e,Sk=Da(R),Tk=Da(k_),jk=wa.internal.constants.BOLT_PROTOCOL_V4_2,I=(Ek=S.default,l(Ck,Ek),Object.defineProperty(Ck.prototype,"version",{get:function(){return jk},enumerable:!1,configurable:!0}),Object.defineProperty(Ck.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new Tk.default(Object.values(Sk.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),Ck);function Ck(){return null!==Ek&&Ek.apply(this,arguments)||this}h.default=I;var y={},j={},Ik=r&&r.__assign||function(){return(Ik=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},w=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},O=(Object.defineProperty(j,"__esModule",{value:!0}),w(R)),B=(j.default=Ik({},O.default),{}),Ar={},Rk=r&&r.__assign||function(){return(Rk=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Kr=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},yp=(Object.defineProperty(Ar,"__esModule",{value:!0}),Kr(j)),Ak=(Ar.default=Rk({},yp.default),r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}),yd=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Mk=(Object.defineProperty(B,"__esModule",{value:!0}),dv),kk=e,Nk=yd(Ar),xk=EO,Dk=kv,Uk=kk.internal.temporalUtil.localDateTimeToEpochSecond;var Lk=new Map;function Fk(e,t,r){e=e,Lk.has(e)||(n=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1,era:"narrow"}),Lk.set(e,n));var n=Lk.get(e),e=(0,kk.int)(t).multiply(1e3).add((0,kk.int)(r).div(1e6)).toNumber(),r=n.formatToParts(e).reduce(function(e,t){return"era"===t.type?e.adjustEra="B"===t.value.toUpperCase()?function(e){return e.subtract(1).negate()}:Dk.identity:"hour"===t.type?e.hour=(0,kk.int)(t.value).modulo(24):"literal"!==t.type&&(e[t.type]=(0,kk.int)(t.value)),e},{}),e=(r.year=r.adjustEra(r.year),Uk(r.year,r.month,r.day,r.hour,r.minute,r.second,r.nanosecond));return r.timeZoneOffsetSeconds=e.subtract(t),r.hour=r.hour.modulo(24),r}function Bk(e,t,r){if(!t&&!r)return e;var n,o,i,a=Object.create(Object.getPrototypeOf(e));for(n in e)!0===Object.prototype.hasOwnProperty.call(e,n)&&(o=e[n],a[n]=(0,kk.isInt)(o)?(i=o,r?i.toBigInt():i.toNumberOrInfinity()):o);return Object.freeze(a),a}B.default={createDateTimeWithZoneIdTransformer:function(e,a){var n=e.disableLosslessIntegers,o=e.useBigInt;return Nk.default.createDateTimeWithZoneIdTransformer(e).extendsWith({signature:105,fromStructure:function(e){Mk.structure.verifyStructSize("DateTimeWithZoneId",3,e.size);var e=Ak(e.fields,3),t=e[0],r=e[1],e=e[2],t=Fk(e,t,r);return Bk(new kk.DateTime(t.year,t.month,t.day,t.hour,t.minute,t.second,(0,kk.int)(r),t.timeZoneOffsetSeconds,e),n,o)},toStructure:function(e){var t=Uk(e.year,e.month,e.day,e.hour,e.minute,e.second,e.nanosecond),r=null!=e.timeZoneOffsetSeconds?e.timeZoneOffsetSeconds:(r=e.timeZoneId,n=Fk(r,i=t,o=e.nanosecond),n=Uk(n.year,n.month,n.day,n.hour,n.minute,n.second,o).subtract(i),i=i.subtract(n),n=Fk(r,i,o),Uk(n.year,n.month,n.day,n.hour,n.minute,n.second,o).subtract(i)),n=(null==e.timeZoneOffsetSeconds&&a.warn('DateTime objects without "timeZoneOffsetSeconds" property are prune to bugs related to ambiguous times. For instance, 2022-10-30T2:30:00[Europe/Berlin] could be GMT+1 or GMT+2.'),t.subtract(r)),o=(0,kk.int)(e.nanosecond),i=e.timeZoneId;return new Mk.structure.Structure(105,[n,o,i])}})},createDateTimeWithOffsetTransformer:function(e){var n=e.disableLosslessIntegers,o=e.useBigInt;return Nk.default.createDateTimeWithOffsetTransformer(e).extendsWith({signature:73,toStructure:function(e){var t=Uk(e.year,e.month,e.day,e.hour,e.minute,e.second,e.nanosecond),r=(0,kk.int)(e.nanosecond),e=(0,kk.int)(e.timeZoneOffsetSeconds),t=t.subtract(e);return new Mk.structure.Structure(73,[t,r,e])},fromStructure:function(e){Mk.structure.verifyStructSize("DateTimeWithZoneOffset",3,e.size);var e=Ak(e.fields,3),t=e[0],r=e[1],e=e[2],t=(0,kk.int)(t).add(e),t=(0,xk.epochSecondAndNanoToLocalDateTime)(t,r);return Bk(new kk.DateTime(t.year,t.month,t.day,t.hour,t.minute,t.second,t.nanosecond,e,null),n,o)}})}};var Vk,qk,co=r&&r.__extends||(Vk=function(e,t){return(Vk=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Vk(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Wk=r&&r.__assign||function(){return(Wk=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},sp=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},rd=(Object.defineProperty(y,"__esModule",{value:!0}),sp(h)),zk=sp(Ng),Hk=q0,Gk=tm,Kk=sp(j),Yk=sp(B),Zk=sp(k_),Qk=e.internal.bookmarks.Bookmarks,Xk=e.internal.constants.BOLT_PROTOCOL_V4_3,lp=(qk=rd.default,co(Jk,qk),Object.defineProperty(Jk.prototype,"version",{get:function(){return Xk},enumerable:!1,configurable:!0}),Object.defineProperty(Jk.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new Zk.default(Object.values(Kk.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),Jk.prototype.requestRoutingInformation=function(e){var t=e.routingContext,t=void 0===t?{}:t,r=e.databaseName,r=void 0===r?null:r,n=e.sessionContext,n=void 0===n?{}:n,e=new Hk.RouteObserver({onProtocolError:this._onProtocolError,onError:e.onError,onCompleted:e.onCompleted}),n=n.bookmarks||Qk.empty();return this.write(zk.default.route(t,n.values(),r),e,!0),e},Jk.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=e.authToken,o=e.notificationFilter,i=e.onError,a=e.onComplete,e=new Hk.LoginObserver({onError:function(e){return t._onLoginError(e,i)},onCompleted:function(e){return void 0!==e.patch_bolt&&t._applyPatches(e.patch_bolt),t._onLoginCompleted(e,n,a)}});return(0,Gk.assertNotificationFilterIsEmpty)(o,this._onProtocolError,e),this.write(zk.default.hello(r,n,this._serversideRouting,["utc"]),e,!0),e},Jk.prototype._applyPatches=function(e){e.includes("utc")&&this._applyUtcPatch()},Jk.prototype._applyUtcPatch=function(){var t=this;this._transformer=new Zk.default(Object.values(Wk(Wk({},Kk.default),Yk.default)).map(function(e){return e(t._config,t._log)}))},Jk);function Jk(){return null!==qk&&qk.apply(this,arguments)||this}y.default=lp;var $k,eN,bp={},F=r&&r.__extends||($k=function(e,t){return($k=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}$k(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),tN=r&&r.__assign||function(){return(tN=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},dp=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},mh=(Object.defineProperty(bp,"__esModule",{value:!0}),dp(y)),ny=e,rN=dp(Ng),nN=q0,oN=tm,iN=dp(Ar),aN=dp(B),uN=dp(k_),oy=ny.internal.constants,sN=oy.BOLT_PROTOCOL_V4_4,cN=oy.FETCH_ALL,lN=ny.internal.bookmarks.Bookmarks,fy=(eN=mh.default,F(fN,eN),Object.defineProperty(fN.prototype,"version",{get:function(){return sN},enumerable:!1,configurable:!0}),Object.defineProperty(fN.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new uN.default(Object.values(iN.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),fN.prototype.requestRoutingInformation=function(e){var t=e.routingContext,t=void 0===t?{}:t,r=e.databaseName,r=void 0===r?null:r,n=e.impersonatedUser,n=void 0===n?null:n,o=e.sessionContext,o=void 0===o?{}:o,e=new nN.RouteObserver({onProtocolError:this._onProtocolError,onError:e.onError,onCompleted:e.onCompleted}),o=o.bookmarks||lN.empty();return this.write(rN.default.routeV4x4(t,o.values(),{databaseName:r,impersonatedUser:n}),e,!0),e},fN.prototype.run=function(e,t,r){var r=void 0===r?{}:r,n=r.bookmarks,o=r.txConfig,i=r.database,a=r.mode,u=r.impersonatedUser,s=r.notificationFilter,c=r.beforeKeys,l=r.afterKeys,f=r.beforeError,p=r.afterError,d=r.beforeComplete,h=r.afterComplete,y=r.flush,y=void 0===y||y,b=r.reactive,b=void 0!==b&&b,_=r.fetchSize,_=void 0===_?cN:_,v=r.highRecordWatermark,v=void 0===v?Number.MAX_VALUE:v,r=r.lowRecordWatermark,r=void 0===r?Number.MAX_VALUE:r,c=new nN.ResultStreamObserver({server:this._server,reactive:b,fetchSize:_,moreFunction:this._requestMore.bind(this),discardFunction:this._requestDiscard.bind(this),beforeKeys:c,afterKeys:l,beforeError:f,afterError:p,beforeComplete:d,afterComplete:h,highRecordWatermark:v,lowRecordWatermark:r}),l=((0,oN.assertNotificationFilterIsEmpty)(s,this._onProtocolError,c),b);return this.write(rN.default.runWithMetadata(e,t,{bookmarks:n,txConfig:o,database:i,mode:a,impersonatedUser:u}),c,l&&y),b||this.write(rN.default.pull({n:_}),c,y),c},fN.prototype.beginTransaction=function(e){var e=void 0===e?{}:e,t=e.bookmarks,r=e.txConfig,n=e.database,o=e.mode,i=e.impersonatedUser,a=e.notificationFilter,e=new nN.ResultStreamObserver({server:this._server,beforeError:e.beforeError,afterError:e.afterError,beforeComplete:e.beforeComplete,afterComplete:e.afterComplete});return e.prepareToHandleSingleResponse(),(0,oN.assertNotificationFilterIsEmpty)(a,this._onProtocolError,e),this.write(rN.default.begin({bookmarks:t,txConfig:r,database:n,mode:o,impersonatedUser:i}),e,!0),e},fN.prototype._applyUtcPatch=function(){var t=this;this._transformer=new uN.default(Object.values(tN(tN({},iN.default),aN.default)).map(function(e){return e(t._config,t._log)}))},fN);function fN(){return null!==eN&&eN.apply(this,arguments)||this}bp.default=fy;var b={},C={},pN=r&&r.__assign||function(){return(pN=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},dN=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},g=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},hN=(Object.defineProperty(C,"__esModule",{value:!0}),dv),yN=e,bN=g(Ar),eb=g(B);C.default=pN(pN(pN({},bN.default),eb.default),{createNodeTransformer:function(e){return bN.default.createNodeTransformer(e).extendsWith({fromStructure:function(e){hN.structure.verifyStructSize("Node",4,e.size);var e=dN(e.fields,4),t=e[0];return new yN.Node(t,e[1],e[2],e[3])}})},createRelationshipTransformer:function(e){return bN.default.createRelationshipTransformer(e).extendsWith({fromStructure:function(e){hN.structure.verifyStructSize("Relationship",8,e.size);var e=dN(e.fields,8),t=e[0];return new yN.Relationship(t,e[1],e[2],e[3],e[4],e[5],e[6],e[7])}})},createUnboundRelationshipTransformer:function(e){return bN.default.createUnboundRelationshipTransformer(e).extendsWith({fromStructure:function(e){hN.structure.verifyStructSize("UnboundRelationship",4,e.size);var e=dN(e.fields,4),t=e[0];return new yN.UnboundRelationship(t,e[1],e[2],e[3])}})}});var _N,vN,M=r&&r.__extends||(_N=function(e,t){return(_N=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}_N(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),_b=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},sb=(Object.defineProperty(b,"__esModule",{value:!0}),_b(bp)),mN=tm,gN=_b(C),ON=_b(k_),wN=_b(Ng),EN=q0,PN=e.internal.constants.BOLT_PROTOCOL_V5_0,Eb=(vN=sb.default,M(SN,vN),Object.defineProperty(SN.prototype,"version",{get:function(){return PN},enumerable:!1,configurable:!0}),Object.defineProperty(SN.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new ON.default(Object.values(gN.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),SN.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=e.authToken,o=e.notificationFilter,i=e.onError,a=e.onComplete,e=new EN.LoginObserver({onError:function(e){return t._onLoginError(e,i)},onCompleted:function(e){return t._onLoginCompleted(e,n,a)}});return(0,mN.assertNotificationFilterIsEmpty)(o,this._onProtocolError,e),this.write(wN.default.hello(r,n,this._serversideRouting),e,!0),e},SN);function SN(){return null!==vN&&vN.apply(this,arguments)||this}b.default=Eb;var TN,jN,_={},Tb={},CN=r&&r.__assign||function(){return(CN=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Rb=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},so=(Object.defineProperty(Tb,"__esModule",{value:!0}),Rb(C)),n=(Tb.default=CN({},so.default),r&&r.__extends||(TN=function(e,t){return(TN=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}TN(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),IN=r&&r.__assign||function(){return(IN=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},By=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},$y=(Object.defineProperty(_,"__esModule",{value:!0}),By(b)),RN=tm,AN=By(Tb),MN=By(k_),kN=By(Ng),NN=q0,xN=e.internal.constants.BOLT_PROTOCOL_V5_1,P=(jN=$y.default,n(DN,jN),Object.defineProperty(DN.prototype,"version",{get:function(){return xN},enumerable:!1,configurable:!0}),Object.defineProperty(DN.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new MN.default(Object.values(AN.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),Object.defineProperty(DN.prototype,"supportsReAuth",{get:function(){return!0},enumerable:!1,configurable:!0}),DN.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=e.authToken,o=e.notificationFilter,i=e.onError,a=e.onComplete,u={},e=new NN.LoginObserver({onError:function(e){return t._onLoginError(e,i)},onCompleted:function(e){return u.metadata=e,t._onLoginCompleted(e)}});return(0,RN.assertNotificationFilterIsEmpty)(o,this._onProtocolError,e),this.write(kN.default.hello5x1(r,this._serversideRouting),e,!1),this.logon({authToken:n,onComplete:function(e){return a(IN(IN({},e),u.metadata))},onError:i,flush:!0})},DN.prototype.logon=function(e){var t=this,e=void 0===e?{}:e,r=e.authToken,n=e.onComplete,o=e.onError,e=e.flush,i=new NN.LoginObserver({onCompleted:function(){return t._onLoginCompleted(null,r,n)},onError:function(e){return t._onLoginError(e,o)}});return this.write(kN.default.logon(r),i,e),i},DN.prototype.logoff=function(e){var e=void 0===e?{}:e,t=e.onComplete,r=e.flush,t=new NN.LogoffObserver({onCompleted:t,onError:e.onError});return this.write(kN.default.logoff(),t,r),t},DN);function DN(){return null!==jN&&jN.apply(this,arguments)||this}_.default=P;var UN,LN,i={},Fb={},FN=r&&r.__assign||function(){return(FN=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},ba=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},tb=(Object.defineProperty(Fb,"__esModule",{value:!0}),ba(Tb)),Bb=(Fb.default=FN({},tb.default),r&&r.__extends||(UN=function(e,t){return(UN=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}UN(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),BN=r&&r.__assign||function(){return(BN=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Lh=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Yb=(Object.defineProperty(i,"__esModule",{value:!0}),Lh(_)),VN=Lh(Fb),qN=Lh(k_),WN=Lh(Ng),zN=q0,lb=e.internal.constants,HN=lb.BOLT_PROTOCOL_V5_2,GN=lb.FETCH_ALL,$b=(LN=Yb.default,Bb(KN,LN),Object.defineProperty(KN.prototype,"version",{get:function(){return HN},enumerable:!1,configurable:!0}),Object.defineProperty(KN.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new qN.default(Object.values(VN.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),Object.defineProperty(KN.prototype,"supportsReAuth",{get:function(){return!0},enumerable:!1,configurable:!0}),KN.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=e.authToken,o=e.notificationFilter,i=e.onError,a=e.onComplete,u={},e=new zN.LoginObserver({onError:function(e){return t._onLoginError(e,i)},onCompleted:function(e){return u.metadata=e,t._onLoginCompleted(e)}});return this.write(WN.default.hello5x2(r,o,this._serversideRouting),e,!1),this.logon({authToken:n,onComplete:function(e){return a(BN(BN({},e),u.metadata))},onError:i,flush:!0})},KN.prototype.beginTransaction=function(e){var e=void 0===e?{}:e,t=e.bookmarks,r=e.txConfig,n=e.database,o=e.mode,i=e.impersonatedUser,a=e.notificationFilter,e=new zN.ResultStreamObserver({server:this._server,beforeError:e.beforeError,afterError:e.afterError,beforeComplete:e.beforeComplete,afterComplete:e.afterComplete});return e.prepareToHandleSingleResponse(),this.write(WN.default.begin({bookmarks:t,txConfig:r,database:n,mode:o,impersonatedUser:i,notificationFilter:a}),e,!0),e},KN.prototype.run=function(e,t,r){var r=void 0===r?{}:r,n=r.bookmarks,o=r.txConfig,i=r.database,a=r.mode,u=r.impersonatedUser,s=r.notificationFilter,c=r.beforeKeys,l=r.afterKeys,f=r.beforeError,p=r.afterError,d=r.beforeComplete,h=r.afterComplete,y=r.flush,y=void 0===y||y,b=r.reactive,b=void 0!==b&&b,_=r.fetchSize,_=void 0===_?GN:_,v=r.highRecordWatermark,v=void 0===v?Number.MAX_VALUE:v,r=r.lowRecordWatermark,r=void 0===r?Number.MAX_VALUE:r,c=new zN.ResultStreamObserver({server:this._server,reactive:b,fetchSize:_,moreFunction:this._requestMore.bind(this),discardFunction:this._requestDiscard.bind(this),beforeKeys:c,afterKeys:l,beforeError:f,afterError:p,beforeComplete:d,afterComplete:h,highRecordWatermark:v,lowRecordWatermark:r}),l=b;return this.write(WN.default.runWithMetadata(e,t,{bookmarks:n,txConfig:o,database:i,mode:a,impersonatedUser:u,notificationFilter:s}),c,l&&y),b||this.write(WN.default.pull({n:_}),c,y),c},KN);function KN(){return null!==LN&&LN.apply(this,arguments)||this}i.default=$b;var YN,ZN,zb={},o_={},QN=r&&r.__assign||function(){return(QN=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},O_=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},T_=(Object.defineProperty(o_,"__esModule",{value:!0}),O_(Fb)),Y_=(o_.default=QN({},T_.default),r&&r.__extends||(YN=function(e,t){return(YN=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}YN(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),XN=r&&r.__assign||function(){return(XN=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},hv=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Z_=(Object.defineProperty(zb,"__esModule",{value:!0}),hv(i)),JN=hv(o_),$N=hv(k_),ex=hv(Ng),tx=q0,rx=e.internal.constants.BOLT_PROTOCOL_V5_3,Fh=(ZN=Z_.default,Y_(nx,ZN),Object.defineProperty(nx.prototype,"version",{get:function(){return rx},enumerable:!1,configurable:!0}),Object.defineProperty(nx.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new $N.default(Object.values(JN.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),nx.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=e.boltAgent,o=e.authToken,i=e.notificationFilter,a=e.onError,u=e.onComplete,s={},e=new tx.LoginObserver({onError:function(e){return t._onLoginError(e,a)},onCompleted:function(e){return s.metadata=e,t._onLoginCompleted(e)}});return this.write(ex.default.hello5x3(r,n,i,this._serversideRouting),e,!1),this.logon({authToken:o,onComplete:function(e){return u(XN(XN({},e),s.metadata))},onError:a,flush:!0})},nx);function nx(){return null!==ZN&&ZN.apply(this,arguments)||this}zb.default=Fh;var ox,ix,Fy={},A_={},ax=r&&r.__assign||function(){return(ax=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Th=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},lv=(Object.defineProperty(A_,"__esModule",{value:!0}),Th(o_)),k=(A_.default=ax({},lv.default),r&&r.__extends||(ox=function(e,t){return(ox=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ox(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),d_=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},sd=(Object.defineProperty(Fy,"__esModule",{value:!0}),d_(zb)),ux=d_(A_),sx=d_(Ng),cx=q0,lx=d_(k_),fx=e.internal.constants.BOLT_PROTOCOL_V5_4,R_=(ix=sd.default,k(px,ix),Object.defineProperty(px.prototype,"version",{get:function(){return fx},enumerable:!1,configurable:!0}),Object.defineProperty(px.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new lx.default(Object.values(ux.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),px.prototype.telemetry=function(e,t){var e=e.api,t=void 0===t?{}:t,r=t.onError,t=new cx.TelemetryObserver({onCompleted:t.onCompleted,onError:r});return this.write(sx.default.telemetry({api:e}),t,!1),t},px);function px(){return null!==ix&&ix.apply(this,arguments)||this}Fy.default=R_;var dx,hx,rh={},qv={},yx=r&&r.__assign||function(){return(yx=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Lv=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Gv=(Object.defineProperty(qv,"__esModule",{value:!0}),Lv(A_)),Om=(qv.default=yx({},Gv.default),r&&r.__extends||(dx=function(e,t){return(dx=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}dx(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),bx=r&&r.__assign||function(){return(bx=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Cm=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Tm=(Object.defineProperty(rh,"__esModule",{value:!0}),Cm(Fy)),_x=Cm(qv),vx=Cm(k_),mx=Cm(Ng),gx=q0,bm=e.internal.constants,Ox=bm.BOLT_PROTOCOL_V5_5,wx=bm.FETCH_ALL,Ex=Object.freeze({OPERATION:"",OPERATION_CODE:"0",CURRENT_SCHEMA:"/"}),Fm=(hx=Tm.default,Om(Px,hx),Object.defineProperty(Px.prototype,"version",{get:function(){return Ox},enumerable:!1,configurable:!0}),Object.defineProperty(Px.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new vx.default(Object.values(_x.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),Px.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=e.boltAgent,o=e.authToken,i=e.notificationFilter,a=e.onError,u=e.onComplete,s={},e=new gx.LoginObserver({onError:function(e){return t._onLoginError(e,a)},onCompleted:function(e){return s.metadata=e,t._onLoginCompleted(e)}});return this.write(mx.default.hello5x5(r,n,i,this._serversideRouting),e,!1),this.logon({authToken:o,onComplete:function(e){return u(bx(bx({},e),s.metadata))},onError:a,flush:!0})},Px.prototype.beginTransaction=function(e){var e=void 0===e?{}:e,t=e.bookmarks,r=e.txConfig,n=e.database,o=e.mode,i=e.impersonatedUser,a=e.notificationFilter,e=new gx.ResultStreamObserver({server:this._server,beforeError:e.beforeError,afterError:e.afterError,beforeComplete:e.beforeComplete,afterComplete:e.afterComplete});return e.prepareToHandleSingleResponse(),this.write(mx.default.begin5x5({bookmarks:t,txConfig:r,database:n,mode:o,impersonatedUser:i,notificationFilter:a}),e,!0),e},Px.prototype.run=function(e,t,r){var r=void 0===r?{}:r,n=r.bookmarks,o=r.txConfig,i=r.database,a=r.mode,u=r.impersonatedUser,s=r.notificationFilter,c=r.beforeKeys,l=r.afterKeys,f=r.beforeError,p=r.afterError,d=r.beforeComplete,h=r.afterComplete,y=r.flush,y=void 0===y||y,b=r.reactive,b=void 0!==b&&b,_=r.fetchSize,_=void 0===_?wx:_,v=r.highRecordWatermark,v=void 0===v?Number.MAX_VALUE:v,r=r.lowRecordWatermark,r=void 0===r?Number.MAX_VALUE:r,c=new gx.ResultStreamObserver({server:this._server,reactive:b,fetchSize:_,moreFunction:this._requestMore.bind(this),discardFunction:this._requestDiscard.bind(this),beforeKeys:c,afterKeys:l,beforeError:f,afterError:p,beforeComplete:d,afterComplete:h,highRecordWatermark:v,lowRecordWatermark:r,enrichMetadata:this._enrichMetadata}),l=b;return this.write(mx.default.runWithMetadata5x5(e,t,{bookmarks:n,txConfig:o,database:i,mode:a,impersonatedUser:u,notificationFilter:s}),c,l&&y),b||this.write(mx.default.pull({n:_}),c,y),c},Px.prototype._enrichMetadata=function(e){return Array.isArray(e.statuses)&&(e.statuses=e.statuses.map(function(e){return bx(bx({},e),{description:null!=e.neo4j_code?e.status_description:e.description,diagnostic_record:null!==e.diagnostic_record?bx(bx({},Ex),e.diagnostic_record):null})})),e},Px);function Px(){return null!==hx&&hx.apply(this,arguments)||this}rh.default=Fm;var Sx,Tx,Pv={},Km={},jx=r&&r.__assign||function(){return(jx=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},pm=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},zm=(Object.defineProperty(Km,"__esModule",{value:!0}),pm(qv)),Hv=(Km.default=jx({},zm.default),r&&r.__extends||(Sx=function(e,t){return(Sx=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Sx(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),Cx=r&&r.__assign||function(){return(Cx=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Zm=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Ym=(Object.defineProperty(Pv,"__esModule",{value:!0}),Zm(rh)),Ix=Zm(Km),Rx=Zm(k_),Ax=e.internal.constants.BOLT_PROTOCOL_V5_6,Mx=Object.freeze({OPERATION:"",OPERATION_CODE:"0",CURRENT_SCHEMA:"/"}),i0=(Tx=Ym.default,Hv(kx,Tx),Object.defineProperty(kx.prototype,"version",{get:function(){return Ax},enumerable:!1,configurable:!0}),Object.defineProperty(kx.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new Rx.default(Object.values(Ix.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),kx.prototype._enrichMetadata=function(e){return Array.isArray(e.statuses)&&(e.statuses=e.statuses.map(function(e){return Cx(Cx({},e),{diagnostic_record:null!==e.diagnostic_record?Cx(Cx({},Mx),e.diagnostic_record):null})})),e},kx);function kx(){return null!==Tx&&Tx.apply(this,arguments)||this}Pv.default=i0;var Nx,xx,u0={},Bh={},Dx=r&&r.__assign||function(){return(Dx=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},rg=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Z0=(Object.defineProperty(Bh,"__esModule",{value:!0}),rg(Km)),Q0=(Bh.default=Dx({},Z0.default),r&&r.__extends||(Nx=function(e,t){return(Nx=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Nx(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),Ux=r&&r.__assign||function(){return(Ux=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},pg=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},yg=(Object.defineProperty(u0,"__esModule",{value:!0}),pg(Pv)),Lx=pg(Bh),Fx=pg(k_),Bx=e.internal.constants.BOLT_PROTOCOL_V5_7,Vx=Object.freeze({OPERATION:"",OPERATION_CODE:"0",CURRENT_SCHEMA:"/"}),pe=(xx=yg.default,Q0(qx,xx),Object.defineProperty(qx.prototype,"version",{get:function(){return Bx},enumerable:!1,configurable:!0}),Object.defineProperty(qx.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new Fx.default(Object.values(Lx.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),qx.prototype.enrichErrorMetadata=function(e){return Ux(Ux({},e),{cause:null!=e.cause?this.enrichErrorMetadata(e.cause):null,code:e.neo4j_code,diagnostic_record:null!==e.diagnostic_record?Ux(Ux({},Vx),e.diagnostic_record):null})},qx);function qx(){return null!==xx&&xx.apply(this,arguments)||this}u0.default=pe;var Wx,zx,mg={},Sg={},Hx=r&&r.__assign||function(){return(Hx=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},qh=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},t=(Object.defineProperty(Sg,"__esModule",{value:!0}),qh(Bh)),Cg=(Sg.default=Hx({},t.default),r&&r.__extends||(Wx=function(e,t){return(Wx=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Wx(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),Vh=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},$0=(Object.defineProperty(mg,"__esModule",{value:!0}),Vh(u0)),Gx=Vh(Sg),Kx=Vh(k_),Yx=Vh(Ng),Zx=q0,Rg=e.internal.constants,Qx=Rg.BOLT_PROTOCOL_V5_8,Xx=Rg.FETCH_ALL,Ug=(zx=$0.default,Cg(Jx,zx),Object.defineProperty(Jx.prototype,"version",{get:function(){return Qx},enumerable:!1,configurable:!0}),Object.defineProperty(Jx.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new Kx.default(Object.values(Gx.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),Jx.prototype.run=function(e,t,r){var r=void 0===r?{}:r,n=r.bookmarks,o=r.txConfig,i=r.database,a=r.mode,u=r.impersonatedUser,s=r.notificationFilter,c=r.beforeKeys,l=r.afterKeys,f=r.beforeError,p=r.afterError,d=r.beforeComplete,h=r.afterComplete,y=r.flush,y=void 0===y||y,b=r.reactive,b=void 0!==b&&b,_=r.fetchSize,_=void 0===_?Xx:_,v=r.highRecordWatermark,v=void 0===v?Number.MAX_VALUE:v,m=r.lowRecordWatermark,m=void 0===m?Number.MAX_VALUE:m,r=r.onDb,c=new Zx.ResultStreamObserver({server:this._server,reactive:b,fetchSize:_,moreFunction:this._requestMore.bind(this),discardFunction:this._requestDiscard.bind(this),beforeKeys:c,afterKeys:l,beforeError:f,afterError:p,beforeComplete:d,afterComplete:h,highRecordWatermark:v,lowRecordWatermark:m,enrichMetadata:this._enrichMetadata,onDb:r}),l=b;return this.write(Yx.default.runWithMetadata5x5(e,t,{bookmarks:n,txConfig:o,database:i,mode:a,impersonatedUser:u,notificationFilter:s}),c,l&&y),b||this.write(Yx.default.pull({n:_}),c,y),c},Jx);function Jx(){return null!==zx&&zx.apply(this,arguments)||this}mg.default=Ug;var Bg={},ro={},$x=r&&r.__assign||function(){return($x=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Qg=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},rO=(Object.defineProperty(ro,"__esModule",{value:!0}),Qg(Sg)),eD=k_,tD=dv,rD=e,nD=198,oD=193,iD=200,aD=201,uD=202,sD=203,cD={INT8:iD,INT16:aD,INT32:uD,INT64:sD,FLOAT32:nD,FLOAT64:oD};function lD(e,t){(r=new DataView(new ArrayBuffer(2))).setInt16(0,1e3,!0);var r,n=1e3===new Int16Array(r.buffer)[0];if(n){var o=new DataView(new ArrayBuffer(t.byteLength)),i=new DataView(t),a=void 0,u=void 0,s=void 0;switch(e){case iD:s=1,a=o.setInt8.bind(o),u=i.getInt8.bind(i);break;case aD:s=2,a=o.setInt16.bind(o),u=i.getInt16.bind(i);break;case uD:s=4,a=o.setInt32.bind(o),u=i.getInt32.bind(i);break;case sD:s=8,a=o.setBigInt64.bind(o),u=i.getBigInt64.bind(i);break;case nD:s=4,a=o.setInt32.bind(o),u=i.getInt32.bind(i);break;case oD:s=8,a=o.setBigInt64.bind(o),u=i.getBigInt64.bind(i);break;default:throw(0,rD.newError)("Vector is of unsupported type ".concat(e))}for(var c=0;c<t.byteLength;c+=s)a(c,u(c,n));return o.buffer}return t}ro.default=$x($x({},rO.default),{createVectorTransformer:function(){return new eD.TypeTransformer({signature:86,isTypeInstance:function(e){return(0,rD.isVector)(e)},toStructure:function(e){var t=cD[e.getType()];if(void 0===t)throw(0,rD.newError)("Vector object has unknown type: ".concat(e.getType()));e=lD(t,e.asTypedArray().buffer);return new tD.structure.Structure(86,[Int8Array.from([t]),new Int8Array(e)])},fromStructure:function(e){var t=Uint8Array.from(e.fields[0])[0],r=lD(t,e.fields[1].buffer);switch(t){case iD:return new rD.Vector(new Int8Array(r));case aD:return new rD.Vector(new Int16Array(r));case uD:return new rD.Vector(new Int32Array(r));case sD:return new rD.Vector(new BigInt64Array(r));case nD:return new rD.Vector(new Float32Array(r));case oD:return new rD.Vector(new Float64Array(r));default:throw(0,rD.newError)("Received Vector structure with unsupported type marker: ".concat(t))}}})},createUnsupportedTypeTransformer:function(){return new eD.TypeTransformer({signature:63,isTypeInstance:function(e){return(0,rD.isUnsupportedType)(e)},toStructure:function(e){throw(0,rD.newError)("UnsupportedType object can not be transmitted")},fromStructure:function(e){return new rD.UnsupportedType(e.fields[0],e.fields[1],e.fields[2],e.fields[3].message)}})}});var fD,pD,uO=r&&r.__extends||(fD=function(e,t){return(fD=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}fD(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),dO=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},jO=(Object.defineProperty(Bg,"__esModule",{value:!0}),dO(mg)),dD=dO(ro),hD=dO(k_),yD=e.internal.constants.BOLT_PROTOCOL_V6_0,N_=(pD=jO.default,uO(bD,pD),Object.defineProperty(bD.prototype,"version",{get:function(){return yD},enumerable:!1,configurable:!0}),Object.defineProperty(bD.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new hD.default(Object.values(dD.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),bD);function bD(){return null!==pD&&pD.apply(this,arguments)||this}Bg.default=N_;var _D,vD,zg={},qO={},mD=r&&r.__assign||function(){return(mD=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},NO=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},XO=(Object.defineProperty(qO,"__esModule",{value:!0}),NO(ro)),nw=(qO.default=mD({},XO.default),r&&r.__extends||(_D=function(e,t){return(_D=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}_D(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),$O=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},HO=(Object.defineProperty(zg,"__esModule",{value:!0}),$O(Bg)),gD=$O(qO),OD=$O(dv),wD=$O(k_),ED=e.internal.constants.BOLT_PROTOCOL_V6_1,sw=(vD=HO.default,nw(PD,vD),Object.defineProperty(PD.prototype,"version",{get:function(){return ED},enumerable:!1,configurable:!0}),PD.prototype._createPacker=function(e){return new OD.default.Packer(e,!0)},PD.prototype._createUnpacker=function(e,t){return new OD.default.Unpacker(e,t,!0)},Object.defineProperty(PD.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new wD.default(Object.values(gD.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),PD);function PD(){return null!==vD&&vD.apply(this,arguments)||this}zg.default=sw;var yw={},SD=(Object.defineProperty(yw,"__esModule",{value:!0}),e);function TD(){}function jD(e){return e}var CD={onNext:TD,onCompleted:TD,onError:TD};function ID(e){var e=void 0===e?{}:e,t=e.transformMetadata,r=e.enrichErrorMetadata,n=e.log,e=e.observer;this._pendingObservers=[],this._log=n,this._transformMetadata=t||jD,this._enrichErrorMetadata=r||jD,this._observer=Object.assign({onObserversCountChange:TD,onError:TD,onFailure:TD,onErrorApplyTransformation:jD},e)}Object.defineProperty(ID.prototype,"currentFailure",{get:function(){return this._currentFailure},enumerable:!1,configurable:!0}),ID.prototype.handleResponse=function(e){var t,r=e.fields[0];switch(e.signature){case 113:this._log.isDebugEnabled()&&(t=!0===this._log.unredactDebugLogs?SD.json.stringify(e):'{"signature":'.concat(e.signature,',"fields":[{ ... }]}'),this._log.debug("S: RECORD ".concat(t))),this._currentObserver.onNext(r);break;case 112:this._log.isDebugEnabled()&&this._log.debug("S: SUCCESS ".concat(SD.json.stringify(e)));try{var n=this._transformMetadata(r);this._currentObserver.onCompleted(n)}finally{this._updateCurrentObserver()}break;case 127:this._log.isDebugEnabled()&&this._log.debug("S: FAILURE ".concat(SD.json.stringify(e)));try{this._currentFailure=this._handleErrorPayload(this._enrichErrorMetadata(r)),this._currentObserver.onError(this._currentFailure)}finally{this._updateCurrentObserver(),this._observer.onFailure(this._currentFailure,!1)}break;case 126:this._log.isDebugEnabled()&&this._log.debug("S: IGNORED ".concat(SD.json.stringify(e)));try{this._currentFailure&&this._currentObserver.onError?this._currentObserver.onError(this._currentFailure,!1):this._currentObserver.onError&&this._currentObserver.onError((0,SD.newError)("Ignored either because of an error or RESET"))}finally{this._updateCurrentObserver()}break;default:this._observer.onError((0,SD.newError)("Unknown Bolt protocol message: "+e))}},ID.prototype._updateCurrentObserver=function(){this._currentObserver=this._pendingObservers.shift(),this._observer.onObserversCountChange(this._observersCount)},Object.defineProperty(ID.prototype,"_observersCount",{get:function(){return null==this._currentObserver?this._pendingObservers.length:this._pendingObservers.length+1},enumerable:!1,configurable:!0}),ID.prototype._queueObserver=function(e){return(e=e||CD).onCompleted=e.onCompleted||TD,e.onError=e.onError||TD,e.onNext=e.onNext||TD,void 0===this._currentObserver?this._currentObserver=e:this._pendingObservers.push(e),this._observer.onObserversCountChange(this._observersCount),!0},ID.prototype._notifyErrorToObservers=function(e){for(this._currentObserver&&this._currentObserver.onError&&this._currentObserver.onError(e);0<this._pendingObservers.length;){var t=this._pendingObservers.shift();t&&t.onError&&t.onError(e,!1)}},ID.prototype.hasOngoingObservableRequests=function(){return null!=this._currentObserver||0<this._pendingObservers.length},ID.prototype._resetFailure=function(){this._currentFailure=null},ID.prototype._handleErrorPayload=function(e){var t=(e=>"Neo.TransientError.Transaction.Terminated"===e?"Neo.ClientError.Transaction.Terminated":"Neo.TransientError.Transaction.LockClientStopped"===e?"Neo.ClientError.Transaction.LockClientStopped":e)(e.code),r=null!=e.cause?this._handleErrorCause(e.cause):void 0,t=(0,SD.newError)(e.message,t,r,e.gql_status,e.description,e.diagnostic_record);return this._observer.onErrorApplyTransformation(t)},ID.prototype._handleErrorCause=function(e){var t=null!=e.cause?this._handleErrorCause(e.cause):void 0,t=(0,SD.newGQLError)(e.message,t,e.gql_status,e.description,e.diagnostic_record);return this._observer.onErrorApplyTransformation(t)},yw.default=ID;var RD,vO=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},AD=(Object.defineProperty(R0,"__esModule",{value:!0}),R0.default=function(e){var e=void 0===e?{}:e,t=e.version,r=e.chunker,n=e.dechunker,o=e.channel,i=e.disableLosslessIntegers,a=e.useBigInt,u=e.serversideRouting,s=e.log,c=e.observer;return((e,t,r,n,o,i,a,u)=>{if(!(e instanceof AD.ProtocolVersion)||null==e)throw(0,AD.newError)("Unknown Bolt protocol version: "+e);switch(!0){case e.isEqualTo({major:1,minor:0}):return new MD.default(t,r,n,i,u,a);case e.isEqualTo({major:2,minor:0}):return new kD.default(t,r,n,i,u,a);case e.isEqualTo({major:3,minor:0}):return new ND.default(t,r,n,i,u,a);case e.isEqualTo({major:4,minor:0}):return new xD.default(t,r,n,i,u,a);case e.isEqualTo({major:4,minor:1}):return new DD.default(t,r,n,i,u,a,o);case e.isEqualTo({major:4,minor:2}):return new UD.default(t,r,n,i,u,a,o);case e.isEqualTo({major:4,minor:3}):return new LD.default(t,r,n,i,u,a,o);case e.isEqualTo({major:4,minor:4}):return new FD.default(t,r,n,i,u,a,o);case e.isEqualTo({major:5,minor:0}):return new BD.default(t,r,n,i,u,a,o);case e.isEqualTo({major:5,minor:1}):return new VD.default(t,r,n,i,u,a,o);case e.isEqualTo({major:5,minor:2}):return new qD.default(t,r,n,i,u,a,o);case e.isEqualTo({major:5,minor:3}):return new WD.default(t,r,n,i,u,a,o);case e.isEqualTo({major:5,minor:4}):return new zD.default(t,r,n,i,u,a,o);case e.isEqualTo({major:5,minor:5}):return new HD.default(t,r,n,i,u,a,o);case e.isEqualTo({major:5,minor:6}):return new GD.default(t,r,n,i,u,a,o);case e.isEqualTo({major:5,minor:7}):return new KD.default(t,r,n,i,u,a,o);case e.isEqualTo({major:5,minor:8}):return new YD.default(t,r,n,i,u,a,o);case e.isEqualTo({major:6,minor:0}):return new ZD.default(t,r,n,i,u,a,o);case e.isEqualTo({major:6,minor:1}):return new QD.default(t,r,n,i,u,a,o);default:throw(0,AD.newError)("Unknown Bolt protocol version: "+e)}})(t,e.server,r,{disableLosslessIntegers:i,useBigInt:a},u,function(t){var r=new XD.default({transformMetadata:t.transformMetadata.bind(t),enrichErrorMetadata:t.enrichErrorMetadata.bind(t),log:s,observer:c});return o.onerror=c.onError.bind(c),o.onmessage=function(e){return n.write(e)},n.onmessage=function(e){try{r.handleResponse(t.unpack(e))}catch(e){return c.onError(e)}},r},c.onProtocolError.bind(c),s)},e),MD=vO(nh),kD=vO(Z),ND=vO(fw),xD=vO(Cw),DD=vO(ad),UD=vO(h),LD=vO(y),FD=vO(bp),BD=vO(b),VD=vO(_),qD=vO(i),WD=vO(zb),zD=vO(Fy),HD=vO(rh),GD=vO(Pv),KD=vO(u0),YD=vO(mg),ZD=vO(Bg),QD=vO(zg),XD=vO(yw);bw=Xv,RD=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),Sw=r&&r.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||RD(t,e,r)},Kv=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(bw,"__esModule",{value:!0}),bw.RawRoutingTable=bw.BoltProtocol=void 0,ww=Kv(j0),A0=Kv(R0),Dw=Kv(zg),Kv=Kv(G0),Sw(q0,bw),bw.BoltProtocol=Dw.default,bw.RawRoutingTable=Kv.default,bw.default={handshake:ww.default,create:A0.default,BoltProtocol:bw.BoltProtocol};var JD,Xp=r&&r.__extends||(JD=function(e,t){return(JD=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}JD(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(O0,"__esModule",{value:!0});Xp(eU,$D=e.Connection),Object.defineProperty(eU.prototype,"id",{get:function(){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(eU.prototype,"databaseId",{get:function(){throw new Error("not implemented")},set:function(e){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(eU.prototype,"authToken",{get:function(){throw new Error("not implemented")},set:function(e){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(eU.prototype,"supportsReAuth",{get:function(){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(eU.prototype,"creationTimestamp",{get:function(){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(eU.prototype,"idleTimestamp",{get:function(){throw new Error("not implemented")},set:function(e){throw new Error("not implemented")},enumerable:!1,configurable:!0}),eU.prototype.protocol=function(){throw new Error("not implemented")},Object.defineProperty(eU.prototype,"address",{get:function(){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(eU.prototype,"version",{get:function(){throw new Error("not implemented")},set:function(e){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(eU.prototype,"server",{get:function(){throw new Error("not implemented")},enumerable:!1,configurable:!0}),eU.prototype.connect=function(e,t,r,n){throw new Error("not implemented")},eU.prototype.write=function(e,t,r){throw new Error("not implemented")},eU.prototype.close=function(){throw new Error("not implemented")},eU.prototype.handleAndTransformError=function(e,t){return this._errorHandler?this._errorHandler.handleAndTransformError(e,t,this):e};var $D,o=eU;function eU(e){var t=$D.call(this)||this;return t._errorHandler=e,t}O0.default=o;var tU,Im={},Op=r&&r.__extends||(tU=function(e,t){return(tU=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}tU(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),rU=r&&r.__awaiter||function(e,a,u,s){return new(u=u||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof u?t:new u(function(e){e(t)})).then(n,o)}i((s=s.apply(e,a||[])).next())})},nU=r&&r.__generator||function(n,o){var i,a,u,s={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,a&&(u=2&t[0]?a.return:t[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,t[1])).done)return u;switch(a=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(u=0<(u=s.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3]))s.label=t[1];else if(6===t[0]&&s.label<u[1])s.label=u[1],u=t;else{if(!(u&&s.label<u[2])){u[2]&&s.ops.pop(),s.trys.pop();continue}s.label=u[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],a=0}finally{i=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Yw=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},oU=(Object.defineProperty(Im,"__esModule",{value:!0}),Im.createChannelConnection=function(i,a,u,s,e,c,l,t){void 0===c&&(c=null);void 0===t&&(t=function(e){return new oU.Channel(e)});var e=new oU.ChannelConfig(i,a,u.errorCode(),e),f=t(e);return aU.default.handshake(f,s).then(function(e){var r=e.protocolVersion,e=e.consumeRemainingBuffer,n=new oU.Chunker(f),o=new oU.Dechunker,t=new fU(f,u,i,s,a.disableLosslessIntegers,c,n,a.notificationFilter,function(t){return aU.default.create({version:r,channel:f,chunker:n,dechunker:o,disableLosslessIntegers:a.disableLosslessIntegers,useBigInt:a.useBigInt,serversideRouting:c,server:t.server,log:t.logger,observer:{onObserversCountChange:t._handleOngoingRequestsNumberChange.bind(t),onError:t._handleFatalError.bind(t),onFailure:t._resetOnFailure.bind(t),onProtocolError:t._handleProtocolError.bind(t),onErrorApplyTransformation:function(e){return t.handleAndTransformError(e,t._address)}}})},a.telemetryDisabled,l);return e(function(e){return o.write(e)}),t}).catch(function(e){return f.close().then(function(){throw e})})},Oh),iU=e,zw=Yw(O0),aU=Yw(Xv),uU=iU.error.PROTOCOL_ERROR,sU=iU.internal.logger.Logger,cU=0;lU=zw.default,Op(pU,lU),pU.prototype.beginTransaction=function(e){return this._sendTelemetryIfEnabled(e),this._protocol.beginTransaction(e)},pU.prototype.run=function(e,t,r){return this._sendTelemetryIfEnabled(r),this._protocol.run(e,t,r)},pU.prototype._sendTelemetryIfEnabled=function(e){this._telemetryDisabledConnection||this._telemetryDisabledDriverConfig||null==e||null==e.apiTelemetryConfig||this._protocol.telemetry({api:e.apiTelemetryConfig.api},{onCompleted:e.apiTelemetryConfig.onTelemetrySuccess,onError:e.beforeError})},pU.prototype.commitTransaction=function(e){return this._protocol.commitTransaction(e)},pU.prototype.rollbackTransaction=function(e){return this._protocol.rollbackTransaction(e)},pU.prototype.getProtocolVersion=function(){return this._protocol.version},Object.defineProperty(pU.prototype,"authToken",{get:function(){return this._authToken},set:function(e){this._authToken=e},enumerable:!1,configurable:!0}),Object.defineProperty(pU.prototype,"supportsReAuth",{get:function(){return this._protocol.supportsReAuth},enumerable:!1,configurable:!0}),Object.defineProperty(pU.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(pU.prototype,"databaseId",{get:function(){return this._dbConnectionId},set:function(e){this._dbConnectionId=e},enumerable:!1,configurable:!0}),Object.defineProperty(pU.prototype,"idleTimestamp",{get:function(){return this._idleTimestamp},set:function(e){this._idleTimestamp=e},enumerable:!1,configurable:!0}),Object.defineProperty(pU.prototype,"creationTimestamp",{get:function(){return this._creationTimestamp},enumerable:!1,configurable:!0}),pU.prototype.connect=function(t,n,o,i){return rU(this,void 0,void 0,function(){var r=this;return nU(this,function(e){switch(e.label){case 0:if(this._protocol.initialized&&!this._protocol.supportsReAuth)throw(0,iU.newError)("Connection does not support re-auth");return this._authToken=o,this._protocol.initialized?[3,2]:[4,this._initialize(t,n,o)];case 1:return[2,e.sent()];case 2:return i?[4,new Promise(function(e,t){r._protocol.logoff({onError:t}),r._protocol.logon({authToken:o,onError:t,onComplete:function(){return e(r)},flush:!0})})]:[3,4];case 3:return[2,e.sent()];case 4:return this._protocol.logoff(),this._protocol.logon({authToken:o,flush:!0}),[2,this]}})})},pU.prototype._initialize=function(e,n,o){var i=this,a=this;return new Promise(function(r,t){i._protocol.initialize({userAgent:e,boltAgent:n,authToken:o,notificationFilter:i._notificationFilter,onError:function(e){return t(e)},onComplete:function(e){var t;e&&(t=e.server,i.version&&!t||(i.version=t),i.databaseId||(i.databaseId=e.connection_id),e.hints&&(null!=(t=e.hints["connection.recv_timeout_seconds"])&&(t=(0,iU.toNumber)(t),Number.isInteger(t)&&0<t?i._ch.setupReceiveTimeout(1e3*t):i._log.info("Server located at ".concat(i._address," supplied an invalid connection receive timeout value (").concat(t,"). ")+"Please, verify the server configuration and status because this can be the symptom of a bigger issue.")),!0===e.hints["telemetry.enabled"]&&(i._telemetryDisabledConnection=!1),i.SSREnabledHint=e.hints["ssr.enabled"]),i._ssrCallback(null!=(t=i.SSREnabledHint)&&t,"OPEN")),r(a)}})})},pU.prototype.protocol=function(){return this._protocol},Object.defineProperty(pU.prototype,"address",{get:function(){return this._address},enumerable:!1,configurable:!0}),Object.defineProperty(pU.prototype,"version",{get:function(){return this._server.version},set:function(e){this._server.version=e},enumerable:!1,configurable:!0}),Object.defineProperty(pU.prototype,"server",{get:function(){return this._server},enumerable:!1,configurable:!0}),Object.defineProperty(pU.prototype,"logger",{get:function(){return this._log},enumerable:!1,configurable:!0}),pU.prototype._handleFatalError=function(e){this._isBroken=!0,this._error=this.handleAndTransformError(this._protocol.currentFailure||e,this._address),this._log.isErrorEnabled()&&this._log.error("experienced a fatal error caused by ".concat(this._error," (").concat(iU.json.stringify(this._error),")")),this._protocol.notifyFatalError(this._error)},pU.prototype._setIdle=function(e){this._idle=!0,this._ch.stopReceiveTimeout(),this._protocol.queueObserverIfProtocolIsNotBroken(e)},pU.prototype._unsetIdle=function(){this._idle=!1,this._updateCurrentObserver()},pU.prototype._queueObserver=function(e){return this._protocol.queueObserverIfProtocolIsNotBroken(e)},pU.prototype.hasOngoingObservableRequests=function(){return!this._idle&&this._protocol.hasOngoingObservableRequests()},pU.prototype.resetAndFlush=function(){var r=this;return new Promise(function(e,t){r._reset({onError:function(e){r._isBroken?t(e):(e=r._handleProtocolError("Received FAILURE as a response for RESET: ".concat(e)),t(e))},onComplete:function(){e()}})})},pU.prototype._resetOnFailure=function(){var e=this;this.isOpen()&&this._reset({onError:function(){e._protocol.resetFailure()},onComplete:function(){e._protocol.resetFailure()}})},pU.prototype._reset=function(t){var e,r=this;this._reseting?this._protocol.isLastMessageReset()?this._resetObservers.push(t):this._protocol.reset({onError:function(e){t.onError(e)},onComplete:function(){t.onComplete()}}):(this._resetObservers.push(t),this._reseting=!0,e=function(e){r._reseting=!1;var t=r._resetObservers;r._resetObservers=[],t.forEach(e)},this._protocol.reset({onError:function(t){e(function(e){return e.onError(t)})},onComplete:function(){e(function(e){return e.onComplete()})}}))},pU.prototype._updateCurrentObserver=function(){this._protocol.updateCurrentObserver()},pU.prototype.isOpen=function(){return!this._isBroken&&this._ch._open},pU.prototype._handleOngoingRequestsNumberChange=function(e){this._idle||(0===e?this._ch.stopReceiveTimeout():this._ch.startReceiveTimeout())},pU.prototype.close=function(){return rU(this,void 0,void 0,function(){var t;return nU(this,function(e){switch(e.label){case 0:return this._ssrCallback(null!=(t=this.SSREnabledHint)&&t,"CLOSE"),this._log.isDebugEnabled()&&this._log.debug("closing"),this._protocol&&this.isOpen()&&this._protocol.prepareToClose(),[4,this._ch.close()];case 1:return e.sent(),this._log.isDebugEnabled()&&this._log.debug("closed"),[2]}})})},pU.prototype.toString=function(){return"Connection [".concat(this.id,"][").concat(this.databaseId||"","]")},pU.prototype._handleProtocolError=function(e){this._protocol.resetFailure(),this._updateCurrentObserver();e=(0,iU.newError)(e,uU);return this._handleFatalError(e),e};var lU,fU=pU;function pU(e,t,r,n,o,i,a,u,s,c,l){void 0===o&&(o=!1),void 0===i&&(i=null),void 0===l&&(l=function(e){});var f,p,t=lU.call(this,t)||this;return t._authToken=null,t._idle=!1,t._reseting=!1,t._resetObservers=[],t._id=cU++,t._address=r,t._server={address:r.asHostPort()},t._creationTimestamp=Date.now(),t._disableLosslessIntegers=o,t._ch=e,t._chunker=a,t._log=(f=t,new sU((p=n)._level,function(e,t){return p._loggerFunction(e,"".concat(f," ").concat(t))},p.unredactDebugLogs)),t._serversideRouting=i,t._notificationFilter=u,t._telemetryDisabledDriverConfig=!0===c,t._telemetryDisabledConnection=!0,t._ssrCallback=l,t._dbConnectionId=null,t._protocol=s(t),t._isBroken=!1,t._log.isDebugEnabled()&&t._log.debug("created towards ".concat(r)),t}Im.default=fU;var dU,hU,$w={},Ia=r&&r.__extends||(dU=function(e,t){return(dU=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}dU(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),kw=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},lE=(Object.defineProperty($w,"__esModule",{value:!0}),kw(O0)),Kp=(hU=lE.default,Ia(yU,hU),yU.prototype.beginTransaction=function(e){return this._delegate.beginTransaction(e)},yU.prototype.run=function(e,t,r){return this._delegate.run(e,t,r)},yU.prototype.commitTransaction=function(e){return this._delegate.commitTransaction(e)},yU.prototype.rollbackTransaction=function(e){return this._delegate.rollbackTransaction(e)},yU.prototype.getProtocolVersion=function(){return this._delegate.getProtocolVersion()},Object.defineProperty(yU.prototype,"id",{get:function(){return this._delegate.id},enumerable:!1,configurable:!0}),Object.defineProperty(yU.prototype,"databaseId",{get:function(){return this._delegate.databaseId},set:function(e){this._delegate.databaseId=e},enumerable:!1,configurable:!0}),Object.defineProperty(yU.prototype,"server",{get:function(){return this._delegate.server},enumerable:!1,configurable:!0}),Object.defineProperty(yU.prototype,"authToken",{get:function(){return this._delegate.authToken},set:function(e){this._delegate.authToken=e},enumerable:!1,configurable:!0}),Object.defineProperty(yU.prototype,"supportsReAuth",{get:function(){return this._delegate.supportsReAuth},enumerable:!1,configurable:!0}),Object.defineProperty(yU.prototype,"address",{get:function(){return this._delegate.address},enumerable:!1,configurable:!0}),Object.defineProperty(yU.prototype,"version",{get:function(){return this._delegate.version},set:function(e){this._delegate.version=e},enumerable:!1,configurable:!0}),Object.defineProperty(yU.prototype,"creationTimestamp",{get:function(){return this._delegate.creationTimestamp},enumerable:!1,configurable:!0}),Object.defineProperty(yU.prototype,"idleTimestamp",{get:function(){return this._delegate.idleTimestamp},set:function(e){this._delegate.idleTimestamp=e},enumerable:!1,configurable:!0}),yU.prototype.isOpen=function(){return this._delegate.isOpen()},yU.prototype.protocol=function(){return this._delegate.protocol()},yU.prototype.connect=function(e,t,r,n){return this._delegate.connect(e,t,r,n)},yU.prototype.write=function(e,t,r){return this._delegate.write(e,t,r)},yU.prototype.resetAndFlush=function(){return this._delegate.resetAndFlush()},yU.prototype.hasOngoingObservableRequests=function(){return this._delegate.hasOngoingObservableRequests()},yU.prototype.close=function(){return this._delegate.close()},yU.prototype.release=function(){return this._originalErrorHandler&&(this._delegate._errorHandler=this._originalErrorHandler),this._delegate.release()},yU);function yU(e,t){var r=hU.call(this,t)||this;return t&&(r._originalErrorHandler=e._errorHandler,e._errorHandler=r._errorHandler),r._delegate=e,r}$w.default=Kp;DE={};Object.defineProperty(DE,"__esModule",{value:!0});var bU,_U,vU,mU,gU=e.error.SERVICE_UNAVAILABLE,OU=e.error.SESSION_EXPIRED;function wU(e,t,r,n){this._errorCode=e,this._handleUnavailability=t||EU,this._handleWriteFailure=r||EU,this._handleSecurityError=n||EU}function EU(e){return e}wU.create=function(e){return new wU(e.errorCode,e.handleUnavailability,e.handleWriteFailure,e.handleSecurityError)},wU.prototype.errorCode=function(){return this._errorCode},wU.prototype.handleAndTransformError=function(e,t,r){var n;return null!=(n=e)&&null!=n.code&&n.code.startsWith("Neo.ClientError.Security.")?this._handleSecurityError(e,t,r):(e=>e&&(e.code===OU||e.code===gU||"Neo.TransientError.General.DatabaseUnavailable"===e.code))(e)?this._handleUnavailability(e,t,r):(e=>e&&("Neo.ClientError.Cluster.NotALeader"===e.code||"Neo.ClientError.General.ForbiddenOnReadOnlyDatabase"===e.code))(e)?this._handleWriteFailure(e,t,r):e},DE.default=wU,v=h0,_U=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),vU=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),yE=r&&r.__importStar||(bU=function(e){return(bU=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=bU(e),n=0;n<r.length;n++)"default"!==r[n]&&_U(t,e,r[n]);return vU(t,e),t}),u=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(v,"__esModule",{value:!0}),v.createChannelConnection=v.ConnectionErrorHandler=v.DelegateConnection=v.ChannelConnection=v.Connection=void 0,p=u(O0),v.Connection=p.default,mU=yE(Im),v.ChannelConnection=mU.default,Object.defineProperty(v,"createChannelConnection",{enumerable:!0,get:function(){return mU.createChannelConnection}}),yE=u($w),v.DelegateConnection=yE.default,yE=u(DE),v.ConnectionErrorHandler=yE.default,v.default=p.default;var M_={},PU=r&&r.__awaiter||function(e,a,u,s){return new(u=u||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof u?t:new u(function(e){e(t)})).then(n,o)}i((s=s.apply(e,a||[])).next())})},SU=r&&r.__generator||function(n,o){var i,a,u,s={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,a&&(u=2&t[0]?a.return:t[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,t[1])).done)return u;switch(a=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(u=0<(u=s.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3]))s.label=t[1];else if(6===t[0]&&s.label<u[1])s.label=u[1],u=t;else{if(!(u&&s.label<u[2])){u[2]&&s.ops.pop(),s.trys.pop();continue}s.label=u[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],a=0}finally{i=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},TU=(Object.defineProperty(M_,"__esModule",{value:!0}),e),jU=Sv;function CU(e){var t=e.authTokenManager,r=e.userAgent,e=e.boltAgent;this._authTokenManager=t||(0,TU.staticAuthTokenManager)({}),this._userAgent=r,this._boltAgent=e}CU.prototype.authenticate=function(e){return PU(this,arguments,void 0,function(e){var t,r=e.connection,n=e.auth,o=e.skipReAuth,i=e.waitReAuth,a=e.forceReAuth;return SU(this,function(e){switch(e.label){case 0:return null==n?[3,3]:(t=!0===r.supportsReAuth&&(!jU.object.equals(r.authToken,n)&&!0!==o||!0===a),null==r.authToken||t?[4,r.connect(this._userAgent,this._boltAgent,n,i||!1)]:[3,2]);case 1:return[2,e.sent()];case 2:return[2,r];case 3:return[4,this._authTokenManager.getToken()];case 4:return t=e.sent(),jU.object.equals(t,r.authToken)?[3,6]:[4,r.connect(this._userAgent,this._boltAgent,t,!1)];case 5:return[2,e.sent()];case 6:return[2,r]}})})},CU.prototype.handleError=function(e){var t=e.connection,e=e.code;return!!(t&&e&&e.startsWith("Neo.ClientError.Security."))&&this._authTokenManager.handleSecurityException(t.authToken,e)},M_.default=CU;var Wr={},IU=r&&r.__awaiter||function(e,a,u,s){return new(u=u||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof u?t:new u(function(e){e(t)})).then(n,o)}i((s=s.apply(e,a||[])).next())})},RU=r&&r.__generator||function(n,o){var i,a,u,s={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,a&&(u=2&t[0]?a.return:t[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,t[1])).done)return u;switch(a=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(u=0<(u=s.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3]))s.label=t[1];else if(6===t[0]&&s.label<u[1])s.label=u[1],u=t;else{if(!(u&&s.label<u[2])){u[2]&&s.ops.pop(),s.trys.pop();continue}s.label=u[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],a=0}finally{i=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}};function AU(e){e=e.connectionLivenessCheckTimeout;this._connectionLivenessCheckTimeout=e}Object.defineProperty(Wr,"__esModule",{value:!0}),AU.prototype.check=function(r){return IU(this,void 0,void 0,function(){var t;return RU(this,function(e){switch(e.label){case 0:return this._isCheckDisabled||this._isNewlyCreatedConnection(r)?[2,!0]:(t=Date.now()-r.idleTimestamp,0===this._connectionLivenessCheckTimeout||t>this._connectionLivenessCheckTimeout?[4,r.resetAndFlush().then(function(){return!0})]:[3,2]);case 1:return[2,e.sent()];case 2:return[2,!0]}})})},Object.defineProperty(AU.prototype,"_isCheckDisabled",{get:function(){return null==this._connectionLivenessCheckTimeout||this._connectionLivenessCheckTimeout<0},enumerable:!1,configurable:!0}),AU.prototype._isNewlyCreatedConnection=function(e){return null==e.authToken},Wr.default=AU;var Da={},MU=r&&r.__awaiter||function(e,a,u,s){return new(u=u||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof u?t:new u(function(e){e(t)})).then(n,o)}i((s=s.apply(e,a||[])).next())})},kU=r&&r.__generator||function(n,o){var i,a,u,s={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,a&&(u=2&t[0]?a.return:t[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,t[1])).done)return u;switch(a=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(u=0<(u=s.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3]))s.label=t[1];else if(6===t[0]&&s.label<u[1])s.label=u[1],u=t;else{if(!(u&&s.label<u[2])){u[2]&&s.ops.pop(),s.trys.pop();continue}s.label=u[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],a=0}finally{i=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},NU=(Object.defineProperty(Da,"__esModule",{value:!0}),Oh);function xU(e){var t=e.clientCertificateProvider,e=e.loader;this._clientCertificateProvider=t,this._loader=e||NU.ClientCertificatesLoader,this._clientCertificate=null}xU.prototype.getClientCertificate=function(){return MU(this,void 0,void 0,function(){var t,r,n=this;return kU(this,function(e){switch(e.label){case 0:return(t=null!=this._clientCertificateProvider)?(r=null==this._clientCertificate)?[3,2]:[4,this._clientCertificateProvider.hasUpdate()]:[3,3];case 1:r=e.sent(),e.label=2;case 2:t=r,e.label=3;case 3:return t&&(this._clientCertificate=Promise.resolve(this._clientCertificateProvider.getClientCertificate()).then(this._loader.load).then(function(e){return n._clientCertificate=e,n._clientCertificate}).catch(function(e){throw n._clientCertificate=null,e})),[2,this._clientCertificate]}})})},Da.default=xU;var DU,UU,wa=r&&r.__extends||(DU=function(e,t){return(DU=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}DU(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),LU=r&&r.__awaiter||function(e,a,u,s){return new(u=u||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof u?t:new u(function(e){e(t)})).then(n,o)}i((s=s.apply(e,a||[])).next())})},FU=r&&r.__generator||function(n,o){var i,a,u,s={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,a&&(u=2&t[0]?a.return:t[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,t[1])).done)return u;switch(a=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(u=0<(u=s.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3]))s.label=t[1];else if(6===t[0]&&s.label<u[1])s.label=u[1],u=t;else{if(!(u&&s.label<u[2])){u[2]&&s.ops.pop(),s.trys.pop();continue}s.label=u[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],a=0}finally{i=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},BU=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},VU=r&&r.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||((n=n||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},S=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},qU=(Object.defineProperty(f0,"__esModule",{value:!0}),h0),WU=e,zU=S(M_),HU=Sv,GU=S(Wr),KU=S(Da),YU=WU.error.SERVICE_UNAVAILABLE,ZU=["Neo.ClientError.Security.CredentialsExpired","Neo.ClientError.Security.Forbidden","Neo.ClientError.Security.TokenExpired","Neo.ClientError.Security.Unauthorized"],l=WU.internal.pool,QU=l.Pool,XU=l.PoolConfig,I=(UU=WU.ConnectionProvider,wa(JU,UU),JU.prototype._createConnectionErrorHandler=function(){return new qU.ConnectionErrorHandler(YU)},JU.prototype._getClientCertificate=function(){return LU(this,void 0,void 0,function(){return FU(this,function(e){return[2,this._config.clientCertificate.getClientCertificate()]})})},JU.prototype._createConnection=function(e,r,n){var o=this,i=e.auth;return this._createChannelConnection(r).then(function(t){return t.release=function(){return t.idleTimestamp=Date.now(),n(r,t)},o._openConnections[t.id]=t,o._authenticationProvider.authenticate({connection:t,auth:i}).catch(function(e){throw o._destroyConnection(t),e})})},JU.prototype._validateConnectionOnAcquire=function(e,t){return LU(this,arguments,void 0,function(e,t){var r,n=e.auth,o=e.skipReAuth;return FU(this,function(e){switch(e.label){case 0:if(!this._validateConnection(t))return[2,!1];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this._livenessCheckProvider.check(t)];case 2:return e.sent(),[3,4];case 3:return r=e.sent(),this._log.debug("The connection ".concat(t.id," is not alive because of an error ").concat(r.code," '").concat(r.message,"'")),[2,!1];case 4:return e.trys.push([4,6,,7]),[4,this._authenticationProvider.authenticate({connection:t,auth:n,skipReAuth:o})];case 5:return e.sent(),[2,!0];case 6:return r=e.sent(),this._log.debug("The connection ".concat(t.id," is not valid because of an error ").concat(r.code," '").concat(r.message,"'")),[2,!1];case 7:return[2]}})})},JU.prototype._validateConnectionOnRelease=function(e){return!0!==e._sticky&&this._validateConnection(e)},JU.prototype._validateConnection=function(e){return!(!e.isOpen()||this._config.maxConnectionLifetime<Date.now()-e.creationTimestamp)},JU.prototype._destroyConnection=function(e){return delete this._openConnections[e.id],e.close()},JU.prototype._verifyConnectivityAndGetServerVersion=function(e){return LU(this,arguments,void 0,function(e){var t,r,n=e.address;return FU(this,function(e){switch(e.label){case 0:return[4,this._connectionPool.acquire({},n)];case 1:t=e.sent(),r=new WU.ServerInfo(t.server,t.protocol().version),e.label=2;case 2:return e.trys.push([2,,5,7]),t.protocol().isLastMessageLogon()?[3,4]:[4,t.resetAndFlush()];case 3:e.sent(),e.label=4;case 4:return[3,7];case 5:return[4,t.release()];case 6:return e.sent(),[7];case 7:return[2,r]}})})},JU.prototype._verifyAuthentication=function(e){return LU(this,arguments,void 0,function(e){var t,r,n,o,i,a=e.getAddress,u=e.auth;return FU(this,function(e){switch(e.label){case 0:t=[],e.label=1;case 1:return e.trys.push([1,8,9,11]),[4,a()];case 2:return r=e.sent(),[4,this._connectionPool.acquire({auth:u,skipReAuth:!0},r)];case 3:if(n=e.sent(),t.push(n),o=!n.protocol().isLastMessageLogon(),n.supportsReAuth)return o&&n.supportsReAuth?[4,this._authenticationProvider.authenticate({connection:n,auth:u,waitReAuth:!0,forceReAuth:!0})]:[3,5];throw(0,WU.newError)("Driver is connected to a database that does not support user switch.");case 4:return e.sent(),[3,7];case 5:return!o||n.supportsReAuth?[3,7]:[4,this._connectionPool.acquire({auth:u},r,{requireNew:!0})];case 6:(i=e.sent())._sticky=!0,t.push(i),e.label=7;case 7:return[2,!0];case 8:if(i=e.sent(),ZU.includes(i.code))return[2,!1];throw i;case 9:return[4,Promise.all(t.map(function(e){return e.release()}))];case 10:return e.sent(),[7];case 11:return[2]}})})},JU.prototype._verifyStickyConnection=function(e){return LU(this,arguments,void 0,function(e){var t,r,n=e.auth,o=e.connection;return FU(this,function(e){switch(e.label){case 0:return(t=HU.object.equals(n,o.authToken),r=!t,o._sticky=t&&!o.supportsReAuth,r||o._sticky)?[4,o.release()]:[3,2];case 1:throw e.sent(),(0,WU.newError)("Driver is connected to a database that does not support user switch.");case 2:return[2]}})})},JU.prototype.close=function(){return LU(this,void 0,void 0,function(){return FU(this,function(e){switch(e.label){case 0:return[4,this._connectionPool.close()];case 1:return e.sent(),[4,Promise.all(Object.values(this._openConnections).map(function(e){return e.close()}))];case 2:return e.sent(),[2]}})})},JU._installIdleObserverOnConnection=function(e,t){e._setIdle(t)},JU._removeIdleObserverOnConnection=function(e){e._unsetIdle()},JU.prototype._handleSecurityError=function(e,t,r){return this._authenticationProvider.handleError({connection:r,code:e.code})&&(e.retriable=!0,e.retryable=!0),"Neo.ClientError.Security.AuthorizationExpired"===e.code&&this._connectionPool.apply(t,function(e){e.authToken=null}),r&&r.close().catch(function(){}),e},JU);function JU(e,t){var r=e.id,n=e.config,o=e.log,i=e.userAgent,a=e.boltAgent,u=e.authTokenManager,e=e.newPool,e=void 0===e?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new(QU.bind.apply(QU,VU([void 0],BU(e),!1)))}:e,s=(void 0===t&&(t=null),UU.call(this)||this);return s._id=r,s._config=n,s._log=o,s._clientCertificateHolder=new KU.default({clientCertificateProvider:s._config.clientCertificate}),s._authenticationProvider=new zU.default({authTokenManager:u,userAgent:i,boltAgent:a}),s._livenessCheckProvider=new GU.default({connectionLivenessCheckTimeout:n.connectionLivenessCheckTimeout}),s._userAgent=i,s._boltAgent=a,s._createChannelConnection=t||function(n){return LU(s,void 0,void 0,function(){var t,r;return FU(this,function(e){switch(e.label){case 0:return t=qU.createChannelConnection,r=[n,this._config,this._createConnectionErrorHandler(),this._log],[4,this._clientCertificateHolder.getClientCertificate()];case 1:return[2,t.apply(void 0,r.concat([e.sent()]))]}})})},s._connectionPool=e({create:s._createConnection.bind(s),destroy:s._destroyConnection.bind(s),validateOnAcquire:s._validateConnectionOnAcquire.bind(s),validateOnRelease:s._validateConnectionOnRelease.bind(s),installIdleObserver:JU._installIdleObserverOnConnection.bind(s),removeIdleObserver:JU._removeIdleObserverOnConnection.bind(s),config:XU.fromDriverConfig(n),log:s._log}),s._openConnections={},s}f0.default=I;var $U,eL,w={},R=r&&r.__extends||($U=function(e,t){return($U=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}$U(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),tL=r&&r.__awaiter||function(e,a,u,s){return new(u=u||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof u?t:new u(function(e){e(t)})).then(n,o)}i((s=s.apply(e,a||[])).next())})},rL=r&&r.__generator||function(n,o){var i,a,u,s={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,a&&(u=2&t[0]?a.return:t[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,t[1])).done)return u;switch(a=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(u=0<(u=s.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3]))s.label=t[1];else if(6===t[0]&&s.label<u[1])s.label=u[1],u=t;else{if(!(u&&s.label<u[2])){u[2]&&s.ops.pop(),s.trys.pop();continue}s.label=u[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],a=0}finally{i=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},O=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Kr=(Object.defineProperty(w,"__esModule",{value:!0}),O(f0)),nL=h0,yp=e.internal.constants,oL=yp.BOLT_PROTOCOL_V3,iL=yp.BOLT_PROTOCOL_V4_0,aL=yp.BOLT_PROTOCOL_V4_4,uL=yp.BOLT_PROTOCOL_V5_1,sL=e.error.SERVICE_UNAVAILABLE,yd=(eL=Kr.default,R(cL,eL),cL.prototype.acquireConnection=function(){return tL(this,arguments,void 0,function(e){var t,r,n=this,e=void 0===e?{}:e,o=(e.accessMode,e.database),i=e.auth,a=e.forceReAuth;return rL(this,function(e){switch(e.label){case 0:return t=nL.ConnectionErrorHandler.create({errorCode:sL,handleSecurityError:function(e,t,r){return n._handleSecurityError(e,t,r,o)}}),[4,this._connectionPool.acquire({auth:i,forceReAuth:a},this._address)];case 1:return(r=e.sent(),i)?[4,this._verifyStickyConnection({auth:i,connection:r,address:this._address})]:[3,3];case 2:return e.sent(),[2,r];case 3:return[2,new nL.DelegateConnection(r,t)]}})})},cL.prototype._handleSecurityError=function(e,t,r,n){return this._log.warn("Direct driver ".concat(this._id," will close connection to ").concat(t," for database '").concat(n,"' because of an error ").concat(e.code," '").concat(e.message,"'")),eL.prototype._handleSecurityError.call(this,e,t,r)},cL.prototype._hasProtocolVersion=function(n){return tL(this,void 0,void 0,function(){var t,r;return rL(this,function(e){switch(e.label){case 0:return[4,this._createChannelConnection(this._address)];case 1:return t=e.sent(),r=t.protocol()?t.protocol().version:null,[4,t.close()];case 2:return e.sent(),r?[2,n(r)]:[2,!1]}})})},cL.prototype.supportsMultiDb=function(){return tL(this,void 0,void 0,function(){return rL(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return e.isGreaterOrEqualTo(iL)})];case 1:return[2,e.sent()]}})})},cL.prototype.getNegotiatedProtocolVersion=function(){var r=this;return new Promise(function(e,t){r._hasProtocolVersion(e).catch(t)})},cL.prototype.supportsTransactionConfig=function(){return tL(this,void 0,void 0,function(){return rL(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return e.isGreaterOrEqualTo(oL)})];case 1:return[2,e.sent()]}})})},cL.prototype.supportsUserImpersonation=function(){return tL(this,void 0,void 0,function(){return rL(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return e.isGreaterOrEqualTo(aL)})];case 1:return[2,e.sent()]}})})},cL.prototype.supportsSessionAuth=function(){return tL(this,void 0,void 0,function(){return rL(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return e.isGreaterOrEqualTo(uL)})];case 1:return[2,e.sent()]}})})},cL.prototype.verifyAuthentication=function(e){return tL(this,arguments,void 0,function(e){var t=this,r=e.auth;return rL(this,function(e){return[2,this._verifyAuthentication({auth:r,getAddress:function(){return t._address}})]})})},cL.prototype.verifyConnectivityAndGetServerInfo=function(){return tL(this,void 0,void 0,function(){return rL(this,function(e){switch(e.label){case 0:return[4,this._verifyConnectivityAndGetServerVersion({address:this._address})];case 1:return[2,e.sent()]}})})},cL);function cL(e){var t=e.id,r=e.address,t=eL.call(this,{id:t,config:e.config,log:e.log,userAgent:e.userAgent,boltAgent:e.boltAgent,authTokenManager:e.authTokenManager,newPool:e.newPool})||this;return t._address=r,t}w.default=yd;var EO={},kv={},j={},sp={},lL=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},fL=r&&r.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||((n=n||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},pL=(Object.defineProperty(sp,"__esModule",{value:!0}),sp.createValidRoutingTable=gL,e),rd=pL.internal.constants,dL=rd.ACCESS_MODE_WRITE,hL=rd.ACCESS_MODE_READ,yL=pL.internal.serverAddress.ServerAddress,bL=pL.error.PROTOCOL_ERROR,_L=(vL.fromRawRoutingTable=gL,vL.prototype.forget=function(e){this.readers=mL(this.readers,e),this.writers=mL(this.writers,e)},vL.prototype.forgetRouter=function(e){this.routers=mL(this.routers,e)},vL.prototype.forgetWriter=function(e){this.writers=mL(this.writers,e)},vL.prototype.isStaleFor=function(e){return this.expirationTime.lessThan(Date.now())||this.routers.length<1||e===hL&&0===this.readers.length||e===dL&&0===this.writers.length},vL.prototype.isExpiredFor=function(e){return this.expirationTime.add(e).lessThan(Date.now())},vL.prototype.allServers=function(){return fL(fL(fL([],lL(this.routers),!1),lL(this.readers),!1),lL(this.writers),!1)},vL.prototype.toString=function(){return"RoutingTable["+"database=".concat(this.databaseName,", ")+"expirationTime=".concat(this.expirationTime,", ")+"currentTime=".concat(Date.now(),", ")+"routers=[".concat(this.routers,"], ")+"readers=[".concat(this.readers,"], ")+"writers=[".concat(this.writers,"]]")},vL);function vL(e){var e=void 0===e?{}:e,t=e.database,r=e.routers,n=e.readers,o=e.writers,i=e.expirationTime,e=e.ttl;this.database=t||null,this.databaseName=t||"default database",this.routers=r||[],this.readers=n||[],this.writers=o||[],this.expirationTime=i||(0,pL.int)(0),this.ttl=e}function mL(e,t){return e.filter(function(e){return e.asKey()!==t.asKey()})}function gL(e,t,r){var n=r.ttl,o=((t,r)=>{try{var e=(0,pL.int)(Date.now()),n=(0,pL.int)(t.ttl).multiply(1e3).add(e);return n.lessThan(e)?pL.Integer.MAX_VALUE:n}catch(e){throw(0,pL.newError)("Unable to parse TTL entry from router ".concat(r," from raw routing table:\n").concat(pL.json.stringify(t),"\nError message: ").concat(e.message),bL)}})(r,t),i=((t,r)=>{try{var n=[],o=[],i=[];return t.servers.forEach(function(e){var t=e.role,e=e.addresses;"ROUTE"===t?n=wL(e).map(function(e){return yL.fromUrl(e)}):"WRITE"===t?i=wL(e).map(function(e){return yL.fromUrl(e)}):"READ"===t&&(o=wL(e).map(function(e){return yL.fromUrl(e)}))}),{routers:n,readers:o,writers:i}}catch(e){throw(0,pL.newError)("Unable to parse servers entry from router ".concat(r," from addresses:\n").concat(pL.json.stringify(t.servers),"\nError message: ").concat(e.message),bL)}})(r,t),a=i.routers,u=i.readers,i=i.writers;return OL(a,"routers",t),OL(u,"readers",t),new _L({database:e||r.db,routers:a,readers:u,writers:i,expirationTime:o,ttl:n})}function OL(e,t,r){if(0===e.length)throw(0,pL.newError)("Received no "+t+" from router "+r,bL)}function wL(e){if(Array.isArray(e))return Array.from(e);throw new TypeError("Array expected but got: "+e)}sp.default=_L;var co=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},EL=(Object.defineProperty(j,"__esModule",{value:!0}),co(sp));function PL(e){this._routingContext=e}PL.prototype.lookupRoutingTableOnRouter=function(t,r,n,o){var i=this;return t._acquireConnection(function(e){return i._requestRawRoutingTable(e,t,r,n,o).then(function(e){return e.isNull?null:EL.default.fromRawRoutingTable(r,n,e)})})},PL.prototype._requestRawRoutingTable=function(r,n,o,e,i){var a=this;return new Promise(function(e,t){r.protocol().requestRoutingInformation({routingContext:a._routingContext,databaseName:o,impersonatedUser:i,sessionContext:{bookmarks:n._lastBookmarks,mode:n._mode,database:n._database,afterComplete:n._onComplete},onCompleted:e,onError:t})})},j.default=PL;var SL,TL,jL,lp=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},dp=(Object.defineProperty(kv,"__esModule",{value:!0}),kv.RoutingTable=kv.Rediscovery=void 0,lp(j)),oy=(kv.Rediscovery=dp.default,lp(sp)),ny=(kv.RoutingTable=oy.default,kv.default=dp.default,r&&r.__extends||(SL=function(e,t){return(SL=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}SL(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),CL=r&&r.__assign||function(){return(CL=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},IL=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),RL=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),mh=r&&r.__importStar||(TL=function(e){return(TL=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=TL(e),n=0;n<r.length;n++)"default"!==r[n]&&IL(t,e,r[n]);return RL(t,e),t}),AL=r&&r.__awaiter||function(e,a,u,s){return new(u=u||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof u?t:new u(function(e){e(t)})).then(n,o)}i((s=s.apply(e,a||[])).next())})},ML=r&&r.__generator||function(n,o){var i,a,u,s={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,a&&(u=2&t[0]?a.return:t[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,t[1])).done)return u;switch(a=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(u=0<(u=s.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3]))s.label=t[1];else if(6===t[0]&&s.label<u[1])s.label=u[1],u=t;else{if(!(u&&s.label<u[2])){u[2]&&s.ops.pop(),s.trys.pop();continue}s.label=u[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],a=0}finally{i=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},kL=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},NL=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},xL=r&&r.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||((n=n||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},F=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},DL=(Object.defineProperty(EO,"__esModule",{value:!0}),e),UL=mh(kv),LL=Oh,FL=F(fb),fy=F(f0),BL=_p,VL=h0,qL=Sv,WL=DL.error.SERVICE_UNAVAILABLE,zL=DL.error.SESSION_EXPIRED,HL=DL.internal.bookmarks.Bookmarks,Ar=DL.internal.constants,GL=Ar.ACCESS_MODE_READ,KL=Ar.ACCESS_MODE_WRITE,YL=Ar.BOLT_PROTOCOL_V3,ZL=Ar.BOLT_PROTOCOL_V4_0,QL=Ar.BOLT_PROTOCOL_V4_4,XL=Ar.BOLT_PROTOCOL_V5_1,JL=null,$L=(0,DL.int)(3e4),g=(jL=fy.default,ny(e4,jL),e4.prototype._createConnectionErrorHandler=function(){return new VL.ConnectionErrorHandler(zL)},e4.prototype._handleUnavailability=function(e,t,r){return this._log.warn("Routing driver ".concat(this._id," will forget ").concat(t," for database '").concat(r,"' because of an error ").concat(e.code," '").concat(e.message,"'")),this.forget(t,r||JL),e},e4.prototype._handleSecurityError=function(e,t,r,n){return this._log.warn("Routing driver ".concat(this._id," will close connections to ").concat(t," for database '").concat(n,"' because of an error ").concat(e.code," '").concat(e.message,"'")),jL.prototype._handleSecurityError.call(this,e,t,r,n)},e4.prototype._handleWriteFailure=function(e,t,r){return this._log.warn("Routing driver ".concat(this._id," will forget writer ").concat(t," for database '").concat(r,"' because of an error ").concat(e.code," '").concat(e.message,"'")),this.forgetWriter(t,r||JL),(0,DL.newError)("No longer possible to write to server at "+t,zL,e)},e4.prototype.acquireConnection=function(){return AL(this,arguments,void 0,function(e){var n,t,r,o,i=this,e=void 0===e?{}:e,a=e.accessMode,u=e.database,s=e.bookmarks,c=e.impersonatedUser,l=e.onDatabaseNameResolved,f=e.auth,p=e.homeDb;return ML(this,function(e){switch(e.label){case 0:return(n={database:u||JL},t=new VL.ConnectionErrorHandler(zL,function(e,t){return i._handleUnavailability(e,t,n.database)},function(e,t){return i._handleWriteFailure(e,t,null!=p?p:n.database)},function(e,t,r){return i._handleSecurityError(e,t,r,n.database)}),this._startTime=(new Date).getTime(),this.SSREnabled()&&void 0!==p&&""===u)?!(r=this._routingTableRegistry.get(p,function(){return new UL.RoutingTable({database:p})}))||r.isStaleFor(a)?[3,2]:[4,this._getConnectionFromRoutingTable(r,f,a,t)]:[3,2];case 1:if(r=e.sent(),this.SSREnabled())return[2,r];r.release(),e.label=2;case 2:return[4,this._freshRoutingTable({accessMode:a,database:n.database,bookmarks:s,impersonatedUser:c,auth:f,onDatabaseNameResolved:function(e){n.database=n.database||e,l&&l(e)}})];case 3:return o=e.sent(),[2,this._getConnectionFromRoutingTable(o,f,a,t)]}})})},e4.prototype._getConnectionFromRoutingTable=function(i,a,u,s){return AL(this,void 0,void 0,function(){var t,r,n,o;return ML(this,function(e){switch(e.label){case 0:if(u===GL)r=this._loadBalancingStrategy.selectReader(i.readers),t="read";else{if(u!==KL)throw(0,DL.newError)("Illegal mode "+u);r=this._loadBalancingStrategy.selectWriter(i.writers),t="write"}if(!r)throw(0,DL.newError)("Failed to obtain connection towards ".concat(t," server. Known routing table is: ").concat(i),zL);e.label=1;case 1:return e.trys.push([1,5,,6]),[4,this._connectionPool.acquire({auth:a,startTime:this._startTime},r)];case 2:return(n=e.sent(),a)?[4,this._verifyStickyConnection({auth:a,connection:n,address:r})]:[3,4];case 3:return e.sent(),[2,n];case 4:return[2,new VL.DelegateConnection(n,s)];case 5:throw o=e.sent(),s.handleAndTransformError(o,r);case 6:return[2]}})})},e4.prototype._hasProtocolVersion=function(a){return AL(this,void 0,void 0,function(){var t,r,n,o,i;return ML(this,function(e){switch(e.label){case 0:return[4,this._resolveSeedRouter(this._seedRouter)];case 1:t=e.sent(),n=0,e.label=2;case 2:if(!(n<t.length))return[3,8];e.label=3;case 3:return e.trys.push([3,6,,7]),[4,this._createChannelConnection(t[n])];case 4:return i=e.sent(),o=i.protocol()?i.protocol().version:null,[4,i.close()];case 5:return e.sent(),o?[2,a(o)]:[2,!1];case 6:return i=e.sent(),r=i,[3,7];case 7:return n++,[3,2];case 8:if(r)throw r;return[2,!1]}})})},e4.prototype.supportsMultiDb=function(){return AL(this,void 0,void 0,function(){return ML(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return e.isGreaterOrEqualTo(ZL)})];case 1:return[2,e.sent()]}})})},e4.prototype.supportsTransactionConfig=function(){return AL(this,void 0,void 0,function(){return ML(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return e.isGreaterOrEqualTo(YL)})];case 1:return[2,e.sent()]}})})},e4.prototype.supportsUserImpersonation=function(){return AL(this,void 0,void 0,function(){return ML(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return e.isGreaterOrEqualTo(QL)})];case 1:return[2,e.sent()]}})})},e4.prototype.supportsSessionAuth=function(){return AL(this,void 0,void 0,function(){return ML(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return e.isGreaterOrEqualTo(XL)})];case 1:return[2,e.sent()]}})})},e4.prototype.getNegotiatedProtocolVersion=function(){var r=this;return new Promise(function(e,t){r._hasProtocolVersion(e).catch(t)})},e4.prototype.verifyAuthentication=function(e){return AL(this,arguments,void 0,function(e){var t=this,n=e.database,o=e.accessMode,i=e.auth;return ML(this,function(e){return this._startTime=(new Date).getTime(),[2,this._verifyAuthentication({auth:i,getAddress:function(){return AL(t,void 0,void 0,function(){var t,r;return ML(this,function(e){switch(e.label){case 0:return t={database:n||JL},[4,this._freshRoutingTable({accessMode:o,database:t.database,auth:i,onDatabaseNameResolved:function(e){t.database=t.database||e}})];case 1:if(r=e.sent(),0===(r=o===KL?r.writers:r.readers).length)throw(0,DL.newError)("No servers available for database '".concat(t.database,"' with access mode '").concat(o,"'"),WL);return[2,r[0]]}})})}})]})})},e4.prototype.verifyConnectivityAndGetServerInfo=function(e){return AL(this,arguments,void 0,function(e){var t,r,n,o,i,a,u,s,c,l=e.database,f=e.accessMode;return ML(this,function(e){switch(e.label){case 0:return t={database:l||JL},this._startTime=(new Date).getTime(),[4,this._freshRoutingTable({accessMode:f,database:t.database,onDatabaseNameResolved:function(e){t.database=t.database||e}})];case 1:r=e.sent(),r=f===KL?r.writers:r.readers,n=(0,DL.newError)("No servers available for database '".concat(t.database,"' with access mode '").concat(f,"'"),WL),e.label=2;case 2:e.trys.push([2,9,10,11]),o=kL(r),i=o.next(),e.label=3;case 3:if(i.done)return[3,8];a=i.value,e.label=4;case 4:return e.trys.push([4,6,,7]),[4,this._verifyConnectivityAndGetServerVersion({address:a})];case 5:return[2,e.sent()];case 6:return u=e.sent(),n=u,[3,7];case 7:return i=o.next(),[3,3];case 8:return[3,11];case 9:return u=e.sent(),s={error:u},[3,11];case 10:try{i&&!i.done&&(c=o.return)&&c.call(o)}finally{if(s)throw s.error}return[7];case 11:throw n}})})},e4.prototype.forget=function(t,e){this._routingTableRegistry.apply(e,{applyWhenExists:function(e){return e.forget(t)}}),this._connectionPool.purge(t).catch(function(){})},e4.prototype.forgetWriter=function(t,e){this._routingTableRegistry.apply(e,{applyWhenExists:function(e){return e.forgetWriter(t)}})},e4.prototype._freshRoutingTable=function(e){var e=void 0===e?{}:e,t=e.accessMode,r=e.database,n=e.bookmarks,o=e.impersonatedUser,i=e.onDatabaseNameResolved,e=e.auth,a=this._routingTableRegistry.get(r,function(){return new UL.RoutingTable({database:r})});return a.isStaleFor(t)?(this._log.info('Routing table is stale for database: "'.concat(r,'" and access mode: "').concat(t,'": ').concat(a)),this._refreshRoutingTable(a,n,o,e).then(function(e){return i(e.database),e})):a},e4.prototype._refreshRoutingTable=function(e,t,r,n){var o=e.routers;return this._useSeedRouter?this._fetchRoutingTableFromSeedRouterFallbackToKnownRouters(o,e,t,r,n):this._fetchRoutingTableFromKnownRoutersFallbackToSeedRouter(o,e,t,r,n)},e4.prototype._fetchRoutingTableFromSeedRouterFallbackToKnownRouters=function(a,u,s,c,l){return AL(this,void 0,void 0,function(){var t,r,n,o,i;return ML(this,function(e){switch(e.label){case 0:return t=[],[4,this._fetchRoutingTableUsingSeedRouter(t,this._seedRouter,u,s,c,l)];case 1:return(t=NL.apply(void 0,[e.sent(),2]),r=t[0],n=t[1],r)?(this._useSeedRouter=!1,[3,4]):[3,2];case 2:return[4,this._fetchRoutingTableUsingKnownRouters(a,u,s,c,l)];case 3:o=NL.apply(void 0,[e.sent(),2]),i=o[0],r=i,n=o[1]||n,e.label=4;case 4:return[4,this._applyRoutingTableIfPossible(u,r,n)];case 5:return[2,e.sent()]}})})},e4.prototype._fetchRoutingTableFromKnownRoutersFallbackToSeedRouter=function(o,i,a,u,s){return AL(this,void 0,void 0,function(){var t,r,n;return ML(this,function(e){switch(e.label){case 0:return[4,this._fetchRoutingTableUsingKnownRouters(o,i,a,u,s)];case 1:return r=NL.apply(void 0,[e.sent(),2]),t=r[0],r=r[1],t?[3,3]:[4,this._fetchRoutingTableUsingSeedRouter(o,this._seedRouter,i,a,u,s)];case 2:n=NL.apply(void 0,[e.sent(),2]),t=n[0],r=n[1],e.label=3;case 3:return[4,this._applyRoutingTableIfPossible(i,t,r)];case 4:return[2,e.sent()]}})})},e4.prototype._fetchRoutingTableUsingKnownRouters=function(n,o,i,a,u){return AL(this,void 0,void 0,function(){var t,r;return ML(this,function(e){switch(e.label){case 0:return[4,this._fetchRoutingTable(n,o,i,a,u)];case 1:return(t=NL.apply(void 0,[e.sent(),2]),r=t[0],t=t[1],r)?[2,[r,null]]:(r=n.length-1,e4._forgetRouter(o,n,r),[2,[null,t]])}})})},e4.prototype._fetchRoutingTableUsingSeedRouter=function(r,n,o,i,a,u){return AL(this,void 0,void 0,function(){var t;return ML(this,function(e){switch(e.label){case 0:return[4,this._resolveSeedRouter(n)];case 1:return t=e.sent(),t=t.filter(function(e){return r.indexOf(e)<0}),[4,this._fetchRoutingTable(t,o,i,a,u)];case 2:return[2,e.sent()]}})})},e4.prototype._resolveSeedRouter=function(n){return AL(this,void 0,void 0,function(){var t,r=this;return ML(this,function(e){switch(e.label){case 0:return[4,this._hostNameResolver.resolve(n)];case 1:return t=e.sent(),[4,Promise.all(t.map(function(e){return r._dnsResolver.resolve(e)}))];case 2:return t=e.sent(),[2,[].concat.apply([],t)]}})})},e4.prototype._fetchRoutingTable=function(s,c,l,f,p){return AL(this,void 0,void 0,function(){var t=this;return ML(this,function(e){return[2,s.reduce(function(i,a,u){return AL(t,void 0,void 0,function(){var t,r,n,o;return ML(this,function(e){switch(e.label){case 0:return[4,i];case 1:return(t=NL.apply(void 0,[e.sent(),1]),t=t[0])?[2,[t,null]]:(e4._forgetRouter(c,s,u-1),[4,this._createSessionForRediscovery(a,l,f,p)]);case 2:if(t=NL.apply(void 0,[e.sent(),2]),r=t[0],n=t[1],!r)return[3,8];e.label=3;case 3:return e.trys.push([3,5,6,7]),[4,this._rediscovery.lookupRoutingTableOnRouter(r,c.database,a,f)];case 4:return[2,[e.sent(),null]];case 5:return o=e.sent(),[2,this._handleRediscoveryError(o,a)];case 6:return r.close(),[7];case 7:return[3,9];case 8:return[2,[null,n]];case 9:return[2]}})})},Promise.resolve([null,null]))]})})},e4.prototype._createSessionForRediscovery=function(o,i,a,u){return AL(this,void 0,void 0,function(){var t,r,n=this;return ML(this,function(e){switch(e.label){case 0:return e.trys.push([0,4,,5]),[4,this._connectionPool.acquire({auth:u,startTime:this._startTime},o)];case 1:return(t=e.sent(),u)?[4,this._verifyStickyConnection({auth:u,connection:t,address:o})]:[3,3];case 2:e.sent(),e.label=3;case 3:return r=VL.ConnectionErrorHandler.create({errorCode:zL,handleSecurityError:function(e,t,r){return n._handleSecurityError(e,t,r)}}),r=t._sticky?new VL.DelegateConnection(t):new VL.DelegateConnection(t,r),r=new FL.default(r),t.protocol().version.isLessThan({major:4,minor:0})?[2,[new DL.Session({mode:KL,bookmarks:HL.empty(),connectionProvider:r}),null]]:[2,[new DL.Session({mode:GL,database:"system",bookmarks:i,connectionProvider:r,impersonatedUser:a}),null]];case 4:return r=e.sent(),[2,this._handleRediscoveryError(r,o)];case 5:return[2]}})})},e4.prototype._handleRediscoveryError=function(e,t){if(["Neo.ClientError.Database.DatabaseNotFound","Neo.ClientError.Transaction.InvalidBookmark","Neo.ClientError.Transaction.InvalidBookmarkMixture","Neo.ClientError.Statement.ArgumentError","Neo.ClientError.Request.Invalid","Neo.ClientError.Statement.TypeError","N/A"].includes(e.code)||null!=(n=(r=e).code)&&n.startsWith("Neo.ClientError.Security.")&&!["Neo.ClientError.Security.AuthorizationExpired"].includes(r.code))throw e;if("Neo.ClientError.Procedure.ProcedureNotFound"===e.code)throw(0,DL.newError)("Server at ".concat(t.asHostPort()," can't perform routing. Make sure you are connecting to a causal cluster"),WL,e);var r,n;return this._log.warn("unable to fetch routing table because of an error ".concat(e)),[null,e]},e4.prototype._applyRoutingTableIfPossible=function(t,r,n){return AL(this,void 0,void 0,function(){return ML(this,function(e){switch(e.label){case 0:if(r)return 0===r.writers.length&&(this._useSeedRouter=!0),[4,this._updateRoutingTable(r)];throw(0,DL.newError)("Could not perform discovery. No routing servers available. Known routing table: ".concat(t),WL,n);case 1:return e.sent(),[2,r]}})})},e4.prototype._updateRoutingTable=function(t){return AL(this,void 0,void 0,function(){return ML(this,function(e){switch(e.label){case 0:return this._routingTableRegistry.removeExpired(),this._routingTableRegistry.register(t),[4,this._connectionPool.keepAll(this._routingTableRegistry.allServers())];case 1:return e.sent(),this._log.info("Updated routing table ".concat(t)),[2]}})})},e4._forgetRouter=function(e,t,r){t=t[r];e&&t&&e.forgetRouter(t)},e4.prototype._channelSsrCallback=function(e,t){if("OPEN"===t)!0===e?this._withSSR=this._withSSR+1:this._withoutSSR=this._withoutSSR+1;else{if("CLOSE"!==t)throw(0,DL.newError)("Channel SSR Callback invoked with action other than 'OPEN' or 'CLOSE'");!0===e?this._withSSR=this._withSSR-1:this._withoutSSR=this._withoutSSR-1}},e4.prototype.SSREnabled=function(){return 0<this._withSSR&&0===this._withoutSSR},e4);function e4(e){var t=e.id,r=e.address,n=e.routingContext,o=e.hostNameResolver,i=e.log,a=e.routingTablePurgeDelay,u=jL.call(this,{id:t,config:e.config,log:i,userAgent:e.userAgent,boltAgent:e.boltAgent,authTokenManager:e.authTokenManager,newPool:e.newPool},function(n){return AL(u,void 0,void 0,function(){var t,r;return ML(this,function(e){switch(e.label){case 0:return t=VL.createChannelConnection,r=[n,this._config,this._createConnectionErrorHandler(),this._log],[4,this._clientCertificateHolder.getClientCertificate()];case 1:return[2,t.apply(void 0,r.concat([e.sent(),this._routingContext,this._channelSsrCallback.bind(this)]))]}})})})||this;return u._routingContext=CL(CL({},n),{address:r.toString()}),u._seedRouter=r,u._rediscovery=new UL.default(u._routingContext),u._loadBalancingStrategy=new BL.LeastConnectedLoadBalancingStrategy(u._connectionPool),u._startTime=0,u._hostNameResolver=o,u._dnsResolver=new LL.HostNameResolver,u._log=i,u._useSeedRouter=!0,u._routingTableRegistry=new O4(a?(0,DL.int)(a):$L),u._refreshRoutingTable=qL.functional.reuseOngoingRequest(u._refreshRoutingTable,u),u._withSSR=0,u._withoutSSR=0,u}EO.default=g;w4.prototype.register=function(e){return this._tables.set(e.database,e),this},w4.prototype.apply=function(e,t){var t=void 0===t?{}:t,r=t.applyWhenExists,t=t.applyWhenDontExists,t=void 0===t?function(){}:t;return this._tables.has(e)?r(this._tables.get(e)):"string"==typeof e||null===e?t():this._forEach(r),this},w4.prototype.get=function(e,t){return this._tables.has(e)?this._tables.get(e):"function"==typeof t?t():t},w4.prototype.allServers=function(){var t=new Map;return this._forEach(function(e){return e.allServers().forEach(function(e){return t.set(e.asKey(),e)})}),xL([],NL(t.values()),!1)},w4.prototype.removeExpired=function(){var t=this;return this._removeIf(function(e){return e.isExpiredFor(t._routingTablePurgeDelay)})},w4.prototype._forEach=function(e){var t,r;try{for(var n=kL(this._tables),o=n.next();!o.done;o=n.next())e(NL(o.value,2)[1])}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return this},w4.prototype._remove=function(e){return this._tables.delete(e),this},w4.prototype._removeIf=function(e){var t,r;try{for(var n=kL(this._tables),o=n.next();!o.done;o=n.next()){var i=NL(o.value,2),a=i[0];e(i[1])&&this._remove(a)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return this};var t4,r4,n4,o4,i4,a4,u4,s4,c4,l4,f4,p4,d4,x,h4,C,y4,b4,_4,v4,m4,g4,O4=w4;function w4(e){this._tables=new Map,this._routingTablePurgeDelay=e}function E4(e,t,r){void 0===r&&(r={}),b4(e,"Bolt URL");var n,o=m4.parseDatabaseUrl(e),i=new Map,i=(i.set("1",{version:new x.ProtocolVersion(1,0),bolt:new h4.BoltProtocol(void 0,void 0,{disableLosslessIntegers:r.disableLosslessIntegers,useBigInt:r.useBigInt})}),new x.BoltProvider(i,"1",h4.channel.alloc)),a=!1,u=!1;switch(o.scheme){case"bolt":break;case"bolt+s":u=!0,n="TRUST_SYSTEM_CA_SIGNED_CERTIFICATES";break;case"bolt+ssc":u=!0,n="TRUST_ALL_CERTIFICATES";break;case"neo4j":a=!0;break;case"neo4j+s":n="TRUST_SYSTEM_CA_SIGNED_CERTIFICATES",a=u=!0;break;case"neo4j+ssc":n="TRUST_ALL_CERTIFICATES",a=u=!0;break;default:throw new Error("Unknown scheme: ".concat(o.scheme))}if(u){if("encrypted"in r||"trust"in r)throw new Error("Encryption/trust can only be configured either through URL or config, not both");r.encrypted=y4,r.trust=n,r.clientCertificate=(0,x.resolveCertificateProvider)(r.clientCertificate)}var s=(e=>{if("object"==typeof(t=e)&&null!=t&&"getToken"in t&&"handleSecurityException"in t&&"function"==typeof t.getToken&&"function"==typeof t.handleSecurityException)return e;var t=c4({},e);if(null==t.scheme){if(0!==Object.entries(t).length)throw(0,x.newError)("Auth token is missing 'scheme'. Use neo4j.auth.basic/bearer/kerberos, or set scheme explicitly.");t.scheme="none"}return(0,x.staticAuthTokenManager)({authToken:t})})(t),c=(r.userAgent=r.userAgent||g4,r.boltAgent=x.internal.boltAgent.fromVersion(d4.default),v4.fromUrl(o.hostAndPort)),t={address:c,typename:a?"Routing":"Direct",routing:a};return new p4.Driver(t,r,(()=>{if(a)return function(e,t,r,n){return new h4.RoutingConnectionProvider({id:e,config:t,log:r,hostNameResolver:n,authTokenManager:s,address:c,userAgent:t.userAgent,boltAgent:t.boltAgent,routingContext:o.query})};if(_4(o.query))return function(e,t,r){return new h4.DirectConnectionProvider({id:e,config:t,log:r,authTokenManager:s,address:c,userAgent:t.userAgent,boltAgent:t.boltAgent})};throw new Error("Parameters are not supported with none routed scheme. Given URL: '".concat(e,"'"))})(),i)}function P4(r,n){return l4(this,void 0,void 0,function(){var t;return f4(this,function(e){switch(e.label){case 0:t=E4(r,{scheme:"none",principal:"",credentials:""},n),e.label=1;case 1:return e.trys.push([1,,3,5]),[4,t.getNegotiatedProtocolVersion()];case 2:return e.sent(),[2,!0];case 3:return[4,t.close()];case 4:return e.sent(),[7];case 5:return[2]}})})}return B=r0,t4=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(B,"__esModule",{value:!0}),B.RoutingConnectionProvider=B.DirectConnectionProvider=B.PooledConnectionProvider=B.SingleConnectionProvider=void 0,r4=fb,Object.defineProperty(B,"SingleConnectionProvider",{enumerable:!0,get:function(){return t4(r4).default}}),n4=f0,Object.defineProperty(B,"PooledConnectionProvider",{enumerable:!0,get:function(){return t4(n4).default}}),o4=w,Object.defineProperty(B,"DirectConnectionProvider",{enumerable:!0,get:function(){return t4(o4).default}}),i4=EO,Object.defineProperty(B,"RoutingConnectionProvider",{enumerable:!0,get:function(){return t4(i4).default}}),eb=Xn,u4=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),s4=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),_b=r&&r.__importStar||(a4=function(e){return(a4=Object.getOwnPropertyNames||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=a4(e),n=0;n<r.length;n++)"default"!==r[n]&&u4(t,e,r[n]);return s4(t,e),t}),sb=r&&r.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||u4(t,e,r)},Object.defineProperty(eb,"__esModule",{value:!0}),eb.packstream=eb.channel=eb.buf=eb.loadBalancing=void 0,eb.loadBalancing=_b(_p),eb.buf=_b(m),eb.channel=_b(Oh),eb.packstream=_b(dv),sb(r0,eb),sb(Xv,eb),M=U,c4=r&&r.__assign||function(){return(c4=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},l4=r&&r.__awaiter||function(e,a,u,s){return new(u=u||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof u?t:new u(function(e){e(t)})).then(n,o)}i((s=s.apply(e,a||[])).next())})},f4=r&&r.__generator||function(n,o){var i,a,u,s={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=e(0),c.throw=e(1),c.return=e(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,a&&(u=2&t[0]?a.return:t[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,t[1])).done)return u;switch(a=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(u=0<(u=s.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3]))s.label=t[1];else if(6===t[0]&&s.label<u[1])s.label=u[1],u=t;else{if(!(u&&s.label<u[2])){u[2]&&s.ops.pop(),s.trys.pop();continue}s.label=u[2],s.ops.push(t)}}t=o.call(n,s)}catch(e){t=[6,e],a=0}finally{i=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Eb=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(M,"__esModule",{value:!0}),M.UnboundRelationship=M.Relationship=M.Node=M.Record=M.ServerInfo=M.GqlStatusObject=M.Notification=M.QueryStatistics=M.ProfiledPlan=M.Plan=M.ResultSummary=M.RxResult=M.RxManagedTransaction=M.RxTransaction=M.RxSession=M.EagerResult=M.Result=M.ManagedTransaction=M.Transaction=M.Session=M.Driver=M.temporal=M.spatial=M.graph=M.error=M.routing=M.session=M.types=M.logging=M.auth=M.isRetryableError=M.isRetriableError=M.Neo4jError=M.integer=M.isUnsupportedType=M.isUnboundRelationship=M.isRelationship=M.isPathSegment=M.isPath=M.isNode=M.isDateTime=M.isLocalDateTime=M.isDate=M.isTime=M.isLocalTime=M.isDuration=M.isPoint=M.isInt=M.int=M.authTokenManagers=void 0,M.EncryptionProfile=M.SecretKey=M.KeyEncapsulationService=M.EncapsulatedKey=M.EncapsulatedKeyRecord=M.UnsupportedType=M.EncryptionService=M.EnvelopeEncryptionProfile=M.EncapsulatedKeyRecordRepository=M.localKeyEncapsulationService=M.LocalKeyEncapsulationService=M.isUUID=M.uuid=M.UUID=M.ProtocolVersion=M.StandardCase=M.RecordObjectMapping=M.mappingDecorators=M.rule=M.Rules=M.Rule=M.Vector=M.vector=M.isVector=M.clientCertificateProviders=M.notificationFilterMinimumSeverityLevel=M.notificationFilterDisabledClassification=M.notificationFilterDisabledCategory=M.notificationSeverityLevel=M.notificationClassification=M.notificationCategory=M.resultTransformers=M.bookmarkManager=M.DateTime=M.LocalDateTime=M.Date=M.Time=M.LocalTime=M.Duration=M.Integer=M.Point=M.PathSegment=M.Path=void 0,M.driver=E4,M.hasReachableServer=P4,p4=L,Object.defineProperty(M,"Driver",{enumerable:!0,get:function(){return p4.Driver}}),d4=Eb(a),x=e,Object.defineProperty(M,"authTokenManagers",{enumerable:!0,get:function(){return x.authTokenManagers}}),Object.defineProperty(M,"Neo4jError",{enumerable:!0,get:function(){return x.Neo4jError}}),Object.defineProperty(M,"isRetriableError",{enumerable:!0,get:function(){return x.isRetriableError}}),Object.defineProperty(M,"isRetryableError",{enumerable:!0,get:function(){return x.isRetryableError}}),Object.defineProperty(M,"error",{enumerable:!0,get:function(){return x.error}}),Object.defineProperty(M,"Integer",{enumerable:!0,get:function(){return x.Integer}}),Object.defineProperty(M,"int",{enumerable:!0,get:function(){return x.int}}),Object.defineProperty(M,"isInt",{enumerable:!0,get:function(){return x.isInt}}),Object.defineProperty(M,"isPoint",{enumerable:!0,get:function(){return x.isPoint}}),Object.defineProperty(M,"Point",{enumerable:!0,get:function(){return x.Point}}),Object.defineProperty(M,"Date",{enumerable:!0,get:function(){return x.Date}}),Object.defineProperty(M,"DateTime",{enumerable:!0,get:function(){return x.DateTime}}),Object.defineProperty(M,"Duration",{enumerable:!0,get:function(){return x.Duration}}),Object.defineProperty(M,"isDate",{enumerable:!0,get:function(){return x.isDate}}),Object.defineProperty(M,"isDateTime",{enumerable:!0,get:function(){return x.isDateTime}}),Object.defineProperty(M,"isDuration",{enumerable:!0,get:function(){return x.isDuration}}),Object.defineProperty(M,"isLocalDateTime",{enumerable:!0,get:function(){return x.isLocalDateTime}}),Object.defineProperty(M,"isLocalTime",{enumerable:!0,get:function(){return x.isLocalTime}}),Object.defineProperty(M,"isNode",{enumerable:!0,get:function(){return x.isNode}}),Object.defineProperty(M,"isPath",{enumerable:!0,get:function(){return x.isPath}}),Object.defineProperty(M,"isPathSegment",{enumerable:!0,get:function(){return x.isPathSegment}}),Object.defineProperty(M,"isRelationship",{enumerable:!0,get:function(){return x.isRelationship}}),Object.defineProperty(M,"isTime",{enumerable:!0,get:function(){return x.isTime}}),Object.defineProperty(M,"isUnboundRelationship",{enumerable:!0,get:function(){return x.isUnboundRelationship}}),Object.defineProperty(M,"isUnsupportedType",{enumerable:!0,get:function(){return x.isUnsupportedType}}),Object.defineProperty(M,"LocalDateTime",{enumerable:!0,get:function(){return x.LocalDateTime}}),Object.defineProperty(M,"LocalTime",{enumerable:!0,get:function(){return x.LocalTime}}),Object.defineProperty(M,"Time",{enumerable:!0,get:function(){return x.Time}}),Object.defineProperty(M,"Node",{enumerable:!0,get:function(){return x.Node}}),Object.defineProperty(M,"Path",{enumerable:!0,get:function(){return x.Path}}),Object.defineProperty(M,"PathSegment",{enumerable:!0,get:function(){return x.PathSegment}}),Object.defineProperty(M,"Relationship",{enumerable:!0,get:function(){return x.Relationship}}),Object.defineProperty(M,"UnboundRelationship",{enumerable:!0,get:function(){return x.UnboundRelationship}}),Object.defineProperty(M,"Record",{enumerable:!0,get:function(){return x.Record}}),Object.defineProperty(M,"ResultSummary",{enumerable:!0,get:function(){return x.ResultSummary}}),Object.defineProperty(M,"Plan",{enumerable:!0,get:function(){return x.Plan}}),Object.defineProperty(M,"ProfiledPlan",{enumerable:!0,get:function(){return x.ProfiledPlan}}),Object.defineProperty(M,"QueryStatistics",{enumerable:!0,get:function(){return x.QueryStatistics}}),Object.defineProperty(M,"Notification",{enumerable:!0,get:function(){return x.Notification}}),Object.defineProperty(M,"GqlStatusObject",{enumerable:!0,get:function(){return x.GqlStatusObject}}),Object.defineProperty(M,"ServerInfo",{enumerable:!0,get:function(){return x.ServerInfo}}),Object.defineProperty(M,"Result",{enumerable:!0,get:function(){return x.Result}}),Object.defineProperty(M,"EagerResult",{enumerable:!0,get:function(){return x.EagerResult}}),Object.defineProperty(M,"auth",{enumerable:!0,get:function(){return x.auth}}),Object.defineProperty(M,"Session",{enumerable:!0,get:function(){return x.Session}}),Object.defineProperty(M,"Transaction",{enumerable:!0,get:function(){return x.Transaction}}),Object.defineProperty(M,"ManagedTransaction",{enumerable:!0,get:function(){return x.ManagedTransaction}}),Object.defineProperty(M,"bookmarkManager",{enumerable:!0,get:function(){return x.bookmarkManager}}),Object.defineProperty(M,"routing",{enumerable:!0,get:function(){return x.routing}}),Object.defineProperty(M,"resultTransformers",{enumerable:!0,get:function(){return x.resultTransformers}}),Object.defineProperty(M,"notificationCategory",{enumerable:!0,get:function(){return x.notificationCategory}}),Object.defineProperty(M,"notificationClassification",{enumerable:!0,get:function(){return x.notificationClassification}}),Object.defineProperty(M,"notificationSeverityLevel",{enumerable:!0,get:function(){return x.notificationSeverityLevel}}),Object.defineProperty(M,"notificationFilterDisabledCategory",{enumerable:!0,get:function(){return x.notificationFilterDisabledCategory}}),Object.defineProperty(M,"notificationFilterDisabledClassification",{enumerable:!0,get:function(){return x.notificationFilterDisabledClassification}}),Object.defineProperty(M,"notificationFilterMinimumSeverityLevel",{enumerable:!0,get:function(){return x.notificationFilterMinimumSeverityLevel}}),Object.defineProperty(M,"clientCertificateProviders",{enumerable:!0,get:function(){return x.clientCertificateProviders}}),Object.defineProperty(M,"isVector",{enumerable:!0,get:function(){return x.isVector}}),Object.defineProperty(M,"Vector",{enumerable:!0,get:function(){return x.Vector}}),Object.defineProperty(M,"vector",{enumerable:!0,get:function(){return x.vector}}),Object.defineProperty(M,"Rule",{enumerable:!0,get:function(){return x.Rule}}),Object.defineProperty(M,"Rules",{enumerable:!0,get:function(){return x.Rules}}),Object.defineProperty(M,"rule",{enumerable:!0,get:function(){return x.rule}}),Object.defineProperty(M,"mappingDecorators",{enumerable:!0,get:function(){return x.mappingDecorators}}),Object.defineProperty(M,"RecordObjectMapping",{enumerable:!0,get:function(){return x.RecordObjectMapping}}),Object.defineProperty(M,"StandardCase",{enumerable:!0,get:function(){return x.StandardCase}}),Object.defineProperty(M,"ProtocolVersion",{enumerable:!0,get:function(){return x.ProtocolVersion}}),Object.defineProperty(M,"UUID",{enumerable:!0,get:function(){return x.UUID}}),Object.defineProperty(M,"uuid",{enumerable:!0,get:function(){return x.uuid}}),Object.defineProperty(M,"isUUID",{enumerable:!0,get:function(){return x.isUUID}}),Object.defineProperty(M,"LocalKeyEncapsulationService",{enumerable:!0,get:function(){return x.LocalKeyEncapsulationService}}),Object.defineProperty(M,"localKeyEncapsulationService",{enumerable:!0,get:function(){return x.localKeyEncapsulationService}}),Object.defineProperty(M,"EncapsulatedKeyRecordRepository",{enumerable:!0,get:function(){return x.EncapsulatedKeyRecordRepository}}),Object.defineProperty(M,"EnvelopeEncryptionProfile",{enumerable:!0,get:function(){return x.EnvelopeEncryptionProfile}}),Object.defineProperty(M,"EncryptionService",{enumerable:!0,get:function(){return x.EncryptionService}}),Object.defineProperty(M,"UnsupportedType",{enumerable:!0,get:function(){return x.UnsupportedType}}),Object.defineProperty(M,"EncapsulatedKeyRecord",{enumerable:!0,get:function(){return x.EncapsulatedKeyRecord}}),Object.defineProperty(M,"EncapsulatedKey",{enumerable:!0,get:function(){return x.EncapsulatedKey}}),Object.defineProperty(M,"KeyEncapsulationService",{enumerable:!0,get:function(){return x.KeyEncapsulationService}}),Object.defineProperty(M,"SecretKey",{enumerable:!0,get:function(){return x.SecretKey}}),Object.defineProperty(M,"EncryptionProfile",{enumerable:!0,get:function(){return x.EncryptionProfile}}),h4=Xn,Rb=Eb(bo),M.RxSession=Rb.default,C=Eb(E),M.RxTransaction=C.default,so=Eb(T),M.RxManagedTransaction=so.default,Eb=Eb(uo),M.RxResult=Eb.default,tm=x.internal.util,y4=tm.ENCRYPTION_ON,b4=tm.assertString,_4=tm.isEmptyObjectOrNull,v4=x.internal.serverAddress.ServerAddress,m4=x.internal.urlUtil,g4="neo4j-javascript/"+d4.default,M.logging=tm={console:function(e,t){return{level:e,logger:function(e,t){return console.log("".concat(r.Date.now()," ").concat(e.toUpperCase()," ").concat(t))},unredactDebugLogs:t}}},By={Node:x.Node,Relationship:x.Relationship,UnboundRelationship:x.UnboundRelationship,PathSegment:x.PathSegment,Path:x.Path,Result:x.Result,EagerResult:x.EagerResult,ResultSummary:x.ResultSummary,Record:x.Record,Point:x.Point,Date:x.Date,DateTime:x.DateTime,Duration:x.Duration,LocalDateTime:x.LocalDateTime,LocalTime:x.LocalTime,Time:x.Time,Integer:x.Integer,Vector:x.Vector,Rule:x.Rule,Rules:x.Rules,ProtocolVersion:x.ProtocolVersion,EncapsulatedKeyRecordRepository:x.EncapsulatedKeyRecordRepository,EnvelopeEncryptionProfile:x.EnvelopeEncryptionProfile,EncapsulatedKeyRecord:x.EncapsulatedKeyRecord,EncryptionService:x.EncryptionService},M.types=By,$y={READ:p4.READ,WRITE:p4.WRITE},M.session=$y,n={toNumber:x.toNumber,toString:x.toString,inSafeRange:x.inSafeRange},M.integer=n,P={isPoint:x.isPoint},M.spatial=P,ba={isDuration:x.isDuration,isLocalTime:x.isLocalTime,isTime:x.isTime,isDate:x.isDate,isLocalDateTime:x.isLocalDateTime,isDateTime:x.isDateTime},M.temporal=ba,Tb={isNode:x.isNode,isPath:x.isPath,isPathSegment:x.isPathSegment,isRelationship:x.isRelationship,isUnboundRelationship:x.isUnboundRelationship},n={authTokenManagers:x.authTokenManagers,driver:E4,hasReachableServer:P4,int:x.int,isInt:x.isInt,isPoint:x.isPoint,isDuration:x.isDuration,isLocalTime:x.isLocalTime,isTime:x.isTime,isDate:x.isDate,isLocalDateTime:x.isLocalDateTime,isDateTime:x.isDateTime,isNode:x.isNode,isPath:x.isPath,isPathSegment:x.isPathSegment,isRelationship:x.isRelationship,isUnboundRelationship:x.isUnboundRelationship,isUnsupportedType:x.isUnsupportedType,integer:n,Neo4jError:x.Neo4jError,isRetriableError:x.isRetriableError,isRetryableError:x.isRetryableError,auth:x.auth,logging:tm,types:By,session:$y,routing:x.routing,error:x.error,graph:M.graph=Tb,spatial:P,temporal:ba,Driver:p4.Driver,Session:x.Session,Transaction:x.Transaction,ManagedTransaction:x.ManagedTransaction,Result:x.Result,EagerResult:x.EagerResult,RxSession:Rb.default,RxTransaction:C.default,RxManagedTransaction:so.default,RxResult:Eb.default,ResultSummary:x.ResultSummary,Plan:x.Plan,ProfiledPlan:x.ProfiledPlan,QueryStatistics:x.QueryStatistics,Notification:x.Notification,GqlStatusObject:x.GqlStatusObject,ServerInfo:x.ServerInfo,Record:x.Record,Node:x.Node,Relationship:x.Relationship,UnboundRelationship:x.UnboundRelationship,Path:x.Path,PathSegment:x.PathSegment,Point:x.Point,Integer:x.Integer,Duration:x.Duration,LocalTime:x.LocalTime,Time:x.Time,Date:x.Date,LocalDateTime:x.LocalDateTime,DateTime:x.DateTime,bookmarkManager:x.bookmarkManager,resultTransformers:x.resultTransformers,notificationCategory:x.notificationCategory,notificationSeverityLevel:x.notificationSeverityLevel,notificationFilterDisabledCategory:x.notificationFilterDisabledCategory,notificationFilterMinimumSeverityLevel:x.notificationFilterMinimumSeverityLevel,clientCertificateProviders:x.clientCertificateProviders,isVector:x.isVector,vector:x.vector,Vector:x.Vector,rule:x.rule,mappingDecorators:x.mappingDecorators,RecordObjectMapping:x.RecordObjectMapping,StandardCase:x.StandardCase,ProtocolVersion:x.ProtocolVersion,UUID:x.UUID,uuid:x.uuid,isUUID:x.isUUID,LocalKeyEncapsulationService:x.LocalKeyEncapsulationService,localKeyEncapsulationService:x.localKeyEncapsulationService,EncapsulatedKeyRecordRepository:x.EncapsulatedKeyRecordRepository,EnvelopeEncryptionProfile:x.EnvelopeEncryptionProfile},M.default=n,D(U)});