neo4j-driver
Version:
The official Neo4j driver for Javascript
1 lines • 561 kB
JavaScript
!function(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(){"use strict";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 L={},U={},e={},t={},n={},o={},F=(Object.defineProperty(o,"__esModule",{value:!0}),o.getBrokenObjectReason=o.isBrokenObject=o.createBrokenObject=void 0,"__isBrokenObject__"),B="__reason__";o.createBrokenObject=function(r,e){function n(){throw r}return void 0===e&&(e={}),new Proxy(e,{get:function(e,t){return t===F||(t===B?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})},o.isBrokenObject=function(e){return null!==e&&"object"==typeof e&&!0===e[F]},o.getBrokenObjectReason=function(e){return e[B]},Object.defineProperty(n,"__esModule",{value:!0}),n.stringify=void 0;var W=o;n.stringify=function(e,r){return JSON.stringify(e,function(e,t){return(0,W.isBrokenObject)(t)?{__isBrokenObject__:!0,__reason__:(0,W.getBrokenObjectReason)(t)}:"bigint"==typeof t?"".concat(t,"n"):!0!==(null==r?void 0:r.useCustomToString)||"object"!=typeof t||Array.isArray(t)||"function"!=typeof t.toString||t.toString===Object.prototype.toString?t:null==t?void 0:t.toString()})};var q,z,V={},i=(i=V,Object.defineProperty(i,"__esModule",{value:!0}),i.rawPolyfilledDiagnosticRecord=void 0,i.rawPolyfilledDiagnosticRecord={OPERATION:"",OPERATION_CODE:"0",CURRENT_SCHEMA:"/"},Object.freeze(i.rawPolyfilledDiagnosticRecord),r&&r.__extends||(q=function(e,t){return(q=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}q(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),H=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.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Y=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&H(t,e,r);return G(t,e),t},K=(Object.defineProperty(t,"__esModule",{value:!0}),t.PROTOCOL_ERROR=t.SESSION_EXPIRED=t.SERVICE_UNAVAILABLE=t.GQLError=t.Neo4jError=t.isRetriableError=t.newGQLError=t.newError=void 0,Y(n)),Z=V,Y={DATABASE_ERROR:"DATABASE_ERROR",CLIENT_ERROR:"CLIENT_ERROR",TRANSIENT_ERROR:"TRANSIENT_ERROR",UNKNOWN:"UNKNOWN"},Q=(Object.freeze(Y),Object.values(Y)),X="ServiceUnavailable",J=(t.SERVICE_UNAVAILABLE=X,"SessionExpired"),$=(t.SESSION_EXPIRED=J,t.PROTOCOL_ERROR="ProtocolError",z=Error,i(ee,z),Object.defineProperty(ee.prototype,"diagnosticRecordAsJsonString",{get:function(){return K.stringify(this.diagnosticRecord,{useCustomToString:!0})},enumerable:!1,configurable:!0}),ee);function ee(e,t,r,n,o){var i=this;return(i=z.call(this,e,null!=o?{cause:o}:void 0)||this).constructor=ee,i.__proto__=ee.prototype,i.cause=null!=o?o:void 0,i.gqlStatus=t,i.gqlStatusDescription=r,i.diagnosticRecord=n,i.classification=void 0!==(e=i.diagnosticRecord)&&void 0!==e._classification&&Q.includes(e._classification)?null==e?void 0:e._classification:"UNKNOWN",i.rawClassification=null!=(o=null==n?void 0:n._classification)?o:void 0,i.name="GQLError",i}t.GQLError=$;i(ne,te=$),ne.isRetriable=function(e){return null!=e&&e instanceof ne&&e.retriable};var te,re=ne;function ne(e,t,r,n,o,i){e=te.call(this,e,r,n,o,i)||this;return e.constructor=ne,e.__proto__=ne.prototype,e.code=t,e.name="Neo4jError",e.retriable=(r=t)===X||r===J||"Neo.ClientError.Security.AuthorizationExpired"===r||function(e){return!0===(null==e?void 0:e.includes("TransientError"))}(r),e}t.Neo4jError=re,t.newError=function(e,t,r,n,o,i){return new re(e,null!=t?t:"N/A",null!=n?n:"50N42",null!=o?o:"error: general processing exception - unexpected error. "+e,null!=i?i:Z.rawPolyfilledDiagnosticRecord,r)},t.newGQLError=function(e,t,r,n,o){return new $(e,null!=r?r:"50N42",null!=n?n:"error: general processing exception - unexpected error. "+e,null!=o?o:Z.rawPolyfilledDiagnosticRecord,t)};Y=re.isRetriable;t.isRetriableError=Y;var i={},oe=(Object.defineProperty(i,"__esModule",{value:!0}),i.toString=i.toNumber=i.inSafeRange=i.isInt=i.int=void 0,t),ie=new Map,Y=(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*pe+(this.low>>>0)},d.prototype.toBigInt=function(){var e;return this.isZero()?BigInt(0):this.isPositive()?BigInt(this.high>>>0)*BigInt(pe)+BigInt(this.low>>>0):(e=this.negate(),BigInt(-1)*(BigInt(e.high>>>0)*BigInt(pe)+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){e=d.fromValue(e);if(this.equals(e))return 0;var t=this.isNegative(),r=e.isNegative();return 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=65535&e.high,a=e.low>>>16,s=0,c=0,l=0,f=0;return c+=(l=l+((f+=o+(65535&e.low))>>>16)+(n+a))>>>16,d.fromBits((l&=65535)<<16|(f&=65535),((s+=(c+=r+u)>>>16)+(t+i)&65535)<<16|(c&=65535))},d.prototype.subtract=function(e){e=d.fromValue(e);return this.add(e.negate())},d.prototype.multiply=function(e){if(this.isZero())return d.ZERO;e=d.fromValue(e);if(e.isZero())return d.ZERO;if(this.equals(d.MIN_VALUE))return e.isOdd()?d.MIN_VALUE:d.ZERO;if(e.equals(d.MIN_VALUE))return this.isOdd()?d.MIN_VALUE:d.ZERO;if(this.isNegative())return e.isNegative()?this.negate().multiply(e.negate()):this.negate().multiply(e).negate();if(e.isNegative())return this.multiply(e.negate()).negate();if(this.lessThan(he)&&e.lessThan(he))return d.fromNumber(this.toNumber()*e.toNumber());var 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,e=65535&e.low,s=0,c=0,l=0,f=(f=0)+((c=c+((l+=o*e)>>>16)+n*e)>>>16)+((c=(c&65535)+o*a)>>>16);return d.fromBits((c&=65535)<<16|(l&=65535),((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,oe.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){if(-128<=(e|=0)&&e<128&&null!=(t=ie.get(e)))return t;var t=new d(e,e<0?-1:0);return-128<=e&&e<128&&ie.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<=-de?d.MIN_VALUE:de<=e+1?d.MAX_VALUE:e<0?d.fromNumber(-e).negate():new d(e%pe|0,e/pe|0)},d.fromString=function(e,t,r){var n=(void 0===r?{}:r).strictStringValidation;if(0===e.length)throw(0,oe.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,oe.newError)("radix out of range: "+t.toString());if(0<(r=e.indexOf("-")))throw(0,oe.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)||function(e,t,r){e=e.toString(t),t=Math.max(r-e.length,0),r="0".repeat(t);return"".concat(r).concat(e)}(c,i,o.length)!==o.toLowerCase()))throw(0,oe.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).add(d.fromNumber(p))):(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(Y.prototype,"__isInteger__",{value:!0,enumerable:!1,configurable:!1});var a,ue,ae,se,ce,le,fe,pe=4294967296,de=pe*pe/2,he=Y.fromInt(1<<24),u=Y.fromValue,u=(i.int=u,Y.isInteger),u=(i.isInt=u,Y.inSafeRange),u=(i.inSafeRange=u,Y.toNumber),u=(i.toNumber=u,Y.toString),u=(i.toString=u,i.default=Y,{}),Y={},s={},be=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]}),ye=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||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&be(t,e,r);return ye(t,e),t},_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.")},ve=(Object.defineProperty(s,"__esModule",{value:!0}),s.ENCRYPTION_OFF=s.ENCRYPTION_ON=s.equals=s.validateQueryAndParameters=s.toNumber=s.assertValidDate=s.assertNumberOrInteger=s.assertNumber=s.assertString=s.assertObject=s.isString=s.isObject=s.isEmptyObjectOrNull=void 0,c(i)),me=n;s.ENCRYPTION_ON="ENCRYPTION_ON";function ge(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}function Oe(e,t){if(we(e))return e;throw new TypeError((0,me.stringify)(t)+" expected to be string but was: "+(0,me.stringify)(e))}function we(e){return"[object String]"===Object.prototype.toString.call(e)}function Ee(e,t){this._minNumber=e,this._maxNumber=t,this._minInteger=(0,se.int)(e),this._maxInteger=(0,se.int)(t)}function Pe(e,t,r){e=(0,se.int)(e),t=(0,se.int)(t),r=(0,se.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),function(e){if((e=(0,se.int)(e)).modulo(4).equals(0))return!e.modulo(100).equals(0)||!!e.modulo(400).equals(0)}(e)||(n=n.subtract(1))),n.subtract(a.DAYS_0000_TO_1970)}function Se(e,t){return(0,ce.newError)("".concat(t,' is expected to be a valid ZoneId but was: "').concat(e,'"'))}function Te(e,t,r){if((0,le.assertNumberOrInteger)(e,r),t.contains(e))return e;throw(0,ce.newError)("".concat(r," is expected to be in range ").concat(t.toString()," but was: ").concat(e.toString()))}function je(e,t){e=(0,se.int)(e),t=(0,se.int)(t);var r=e.div(t);return r=e.isPositive()!==t.isPositive()&&r.multiply(t).notEquals(e)?r.subtract(1):r}function Ce(e,t){return e=(0,se.int)(e),t=(0,se.int)(t),e.subtract(je(e,t).multiply(t))}function Re(e){return(e=(0,se.int)(e)).equals(0)?"":"."+Ie(e,9)}function Ie(e,t,r){var n=(e=(0,se.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}s.ENCRYPTION_OFF="ENCRYPTION_OFF",s.isEmptyObjectOrNull=function(e){if(null===e)return!0;if(!ge(e))return!1;for(var t in e)if(void 0!==e[t])return!1;return!0},s.isObject=ge,s.validateQueryAndParameters=function(e,t,r){var n="",t=null!=t?t:{},r=null!=(r=null==r?void 0:r.skipAsserts)&&r;if("string"==typeof e?n=e:e instanceof String?n=e.toString():"object"==typeof e&&null!=e.text&&(n=e.text,t=null!=(e=e.parameters)?e:{}),!r){e=n;if(Oe(e,"Cypher query"),0===e.trim().length)throw new TypeError("Cypher query is expected to be a non-empty string.");r=t;if(!ge(r))throw e=null!=r.constructor?" "+r.constructor.name:"",new TypeError("Query parameters are expected to either be undefined/null or an object, given:".concat(e," ").concat(JSON.stringify(r)))}return{validatedQuery:n,params:t}},s.assertObject=function(e,t){if(ge(e))return e;throw new TypeError(t+" expected to be an object but was: "+(0,me.stringify)(e))},s.assertString=Oe,s.assertNumber=function(e,t){if("number"!=typeof e)throw new TypeError(t+" expected to be a number but was: "+(0,me.stringify)(e));return e},s.assertNumberOrInteger=function(e,t){if("number"==typeof e||"bigint"==typeof e||(0,ve.isInt)(e))return e;throw new TypeError(t+" expected to be either a number or an Integer object but was: "+(0,me.stringify)(e))},s.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},s.isString=we,s.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)return!1;var i=Object.keys(t),u=Object.keys(r);if(i.length!==u.length)return!1;try{for(var a=_e(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},s.toNumber=function(e){return e instanceof ve.default?e.toNumber():"bigint"==typeof e?(0,ve.int)(e).toNumber():e},a=Y,ue=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]}),ae=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||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&ue(t,e,r);return ae(t,e),t},Object.defineProperty(a,"__esModule",{value:!0}),a.floorMod=a.floorDiv=a.assertValidZoneId=a.assertValidNanosecond=a.assertValidSecond=a.assertValidMinute=a.assertValidHour=a.assertValidDay=a.assertValidMonth=a.assertValidYear=a.timeZoneOffsetInSeconds=a.totalNanoseconds=a.newDate=a.toStandardDate=a.isoStringToStandardDate=a.dateToIsoString=a.timeZoneOffsetToIsoString=a.timeToIsoString=a.durationToIsoString=a.dateToEpochDay=a.localDateTimeToEpochSecond=a.localTimeToNanoOfDay=a.normalizeNanosecondsForDuration=a.normalizeSecondsForDuration=a.SECONDS_PER_DAY=a.DAYS_PER_400_YEAR_CYCLE=a.DAYS_0000_TO_1970=a.NANOS_PER_HOUR=a.NANOS_PER_MINUTE=a.NANOS_PER_MILLISECOND=a.NANOS_PER_SECOND=a.SECONDS_PER_HOUR=a.SECONDS_PER_MINUTE=a.MINUTES_PER_HOUR=a.NANOSECOND_OF_SECOND_RANGE=a.SECOND_OF_MINUTE_RANGE=a.MINUTE_OF_HOUR_RANGE=a.HOUR_OF_DAY_RANGE=a.DAY_OF_MONTH_RANGE=a.MONTH_OF_YEAR_RANGE=a.YEAR_RANGE=void 0,se=c(i),ce=t,le=s,Ee.prototype.contains=function(e){var t;return(0,se.isInt)(e)&&e instanceof se.default?e.greaterThanOrEqual(this._minInteger)&&e.lessThanOrEqual(this._maxInteger):"bigint"==typeof e?(t=(0,se.int)(e)).greaterThanOrEqual(this._minInteger)&&t.lessThanOrEqual(this._maxInteger):e>=this._minNumber&&e<=this._maxNumber},Ee.prototype.toString=function(){return"[".concat(this._minNumber,", ").concat(this._maxNumber,"]")},c=Ee,a.YEAR_RANGE=new c(-999999999,999999999),a.MONTH_OF_YEAR_RANGE=new c(1,12),a.DAY_OF_MONTH_RANGE=new c(1,31),a.HOUR_OF_DAY_RANGE=new c(0,23),a.MINUTE_OF_HOUR_RANGE=new c(0,59),a.SECOND_OF_MINUTE_RANGE=new c(0,59),a.NANOSECOND_OF_SECOND_RANGE=new c(0,999999999),a.MINUTES_PER_HOUR=60,a.SECONDS_PER_MINUTE=60,a.SECONDS_PER_HOUR=a.SECONDS_PER_MINUTE*a.MINUTES_PER_HOUR,a.NANOS_PER_SECOND=1e9,a.NANOS_PER_MILLISECOND=1e6,a.NANOS_PER_MINUTE=a.NANOS_PER_SECOND*a.SECONDS_PER_MINUTE,a.NANOS_PER_HOUR=a.NANOS_PER_MINUTE*a.MINUTES_PER_HOUR,a.DAYS_0000_TO_1970=719528,a.DAYS_PER_400_YEAR_CYCLE=146097,a.SECONDS_PER_DAY=86400,a.normalizeSecondsForDuration=function(e,t){return(0,se.int)(e).add(je(t,a.NANOS_PER_SECOND))},a.normalizeNanosecondsForDuration=function(e){return Ce(e,a.NANOS_PER_SECOND)},a.localTimeToNanoOfDay=function(e,t,r,n){return e=(0,se.int)(e),t=(0,se.int)(t),r=(0,se.int)(r),n=(0,se.int)(n),(e=(e=(e=e.multiply(a.NANOS_PER_HOUR)).add(t.multiply(a.NANOS_PER_MINUTE))).add(r.multiply(a.NANOS_PER_SECOND))).add(n)},a.localDateTimeToEpochSecond=function(e,t,r,n,o,i,u){return e=Pe(e,t,r),t=function(e,t,r){e=(0,se.int)(e),t=(0,se.int)(t),r=(0,se.int)(r);e=e.multiply(a.SECONDS_PER_HOUR);return(e=e.add(t.multiply(a.SECONDS_PER_MINUTE))).add(r)}(n,o,i),e.multiply(a.SECONDS_PER_DAY).add(t)},a.dateToEpochDay=Pe,a.durationToIsoString=function(e,t,r,n){return e=Ie(e),t=Ie(t),r=function(e,t){e=(0,se.int)(e),t=(0,se.int)(t);var r,n=e.isNegative(),o=t.greaterThan(0);e=n&&o?e.equals(-1)?"-0":e.add(1).toString():e.toString();o&&(r=Re((n?t.negate().add(2*a.NANOS_PER_SECOND):t.add(a.NANOS_PER_SECOND)).modulo(a.NANOS_PER_SECOND)));return null!=r?e+r:e}(r,n),"P".concat(e,"M").concat(t,"DT").concat(r,"S")},a.timeToIsoString=function(e,t,r,n){return e=Ie(e,2),t=Ie(t,2),r=Ie(r,2),n=Re(n),"".concat(e,":").concat(t,":").concat(r).concat(n)},a.timeZoneOffsetToIsoString=function(e){if((e=(0,se.int)(e)).equals(0))return"Z";var t=(r=e.isNegative())?"-":"+",r=Ie((e=r?e.multiply(-1):e).div(a.SECONDS_PER_HOUR),2),n=Ie(e.div(a.SECONDS_PER_MINUTE).modulo(a.MINUTES_PER_HOUR),2);return null!=(e=(e=e.modulo(a.SECONDS_PER_MINUTE)).equals(0)?null:Ie(e,2))?"".concat(t).concat(r,":").concat(n,":").concat(e):"".concat(t).concat(r,":").concat(n)},a.dateToIsoString=function(e,t,r){return e=function(e){e=(0,se.int)(e);if(e.isNegative()||e.greaterThan(9999))return Ie(e,6,{usePositiveSign:!0});return Ie(e,4)}(e),t=Ie(t,2),r=Ie(r,2),"".concat(e,"-").concat(t,"-").concat(r)},a.isoStringToStandardDate=function(e){return new Date(e)},a.toStandardDate=function(e){return new Date(e)},a.newDate=function(e){return new Date(e)},a.totalNanoseconds=function(e,t){return t=null!=t?t:0,e=e.getMilliseconds()*a.NANOS_PER_MILLISECOND,t instanceof se.default?t.add(e):"bigint"==typeof t?t+BigInt(e):t+e},a.timeZoneOffsetInSeconds=function(e){var t=e.getSeconds()>=e.getUTCSeconds()?e.getSeconds()-e.getUTCSeconds():e.getSeconds()-e.getUTCSeconds()+60;return 0===(e=e.getTimezoneOffset())?0+t:-1*e*a.SECONDS_PER_MINUTE+t},a.assertValidYear=function(e){return Te(e,a.YEAR_RANGE,"Year")},a.assertValidMonth=function(e){return Te(e,a.MONTH_OF_YEAR_RANGE,"Month")},a.assertValidDay=function(e){return Te(e,a.DAY_OF_MONTH_RANGE,"Day")},a.assertValidHour=function(e){return Te(e,a.HOUR_OF_DAY_RANGE,"Hour")},a.assertValidMinute=function(e){return Te(e,a.MINUTE_OF_HOUR_RANGE,"Minute")},a.assertValidSecond=function(e){return Te(e,a.SECOND_OF_MINUTE_RANGE,"Second")},a.assertValidNanosecond=function(e){return Te(e,a.NANOSECOND_OF_SECOND_RANGE,"Nanosecond")},fe=new Map,a.assertValidZoneId=function(t,r){var e=fe.get(r);if(!0!==e){if(!1===e)throw Se(r,t);try{Intl.DateTimeFormat(void 0,{timeZone:r}),fe.set(r,!0)}catch(e){throw fe.set(r,!1),Se(r,t)}}},a.floorDiv=je,a.floorMod=Ce;var Ae=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]}),ke=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||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&Ae(t,e,r);return ke(t,e),t},Me=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},l=(Object.defineProperty(u,"__esModule",{value:!0}),u.isDateTime=u.DateTime=u.isLocalDateTime=u.LocalDateTime=u.isDate=u.Date=u.isTime=u.Time=u.isLocalTime=u.LocalTime=u.isDuration=u.Duration=void 0,c(Y)),Ne=s,xe=t,De=c(i),c={value:!0,enumerable:!1,configurable:!1,writable:!1},Le="__isDuration__",Ue="__isLocalTime__",Fe="__isTime__",Be="__isDate__",We="__isLocalDateTime__",qe="__isDateTime__",f=(ze.prototype.toString=function(){return l.durationToIsoString(this.months,this.days,this.seconds,this.nanoseconds)},ze);function ze(e,t,r,n){this.months=(0,Ne.assertNumberOrInteger)(e,"Months"),this.days=(0,Ne.assertNumberOrInteger)(t,"Days"),(0,Ne.assertNumberOrInteger)(r,"Seconds"),(0,Ne.assertNumberOrInteger)(n,"Nanoseconds"),this.seconds=l.normalizeSecondsForDuration(r,n),this.nanoseconds=l.normalizeNanosecondsForDuration(n),Object.freeze(this)}u.Duration=f,Object.defineProperty(f.prototype,Le,c),u.isDuration=function(e){return Ze(e,Le)};Ve.fromStandardDate=function(e,t){Xe(e,t);t=l.totalNanoseconds(e,t);return new Ve(e.getHours(),e.getMinutes(),e.getSeconds(),t instanceof De.default?t.toInt():"bigint"==typeof t?(0,De.int)(t).toInt():t)},Ve.prototype.toString=function(){return l.timeToIsoString(this.hour,this.minute,this.second,this.nanosecond)};f=Ve;function Ve(e,t,r,n){this.hour=l.assertValidHour(e),this.minute=l.assertValidMinute(t),this.second=l.assertValidSecond(r),this.nanosecond=l.assertValidNanosecond(n),Object.freeze(this)}u.LocalTime=f,Object.defineProperty(f.prototype,Ue,c),u.isLocalTime=function(e){return Ze(e,Ue)};He.fromStandardDate=function(e,t){return Xe(e,t),new He(e.getHours(),e.getMinutes(),e.getSeconds(),(0,De.toNumber)(l.totalNanoseconds(e,t)),l.timeZoneOffsetInSeconds(e))},He.prototype.toString=function(){return l.timeToIsoString(this.hour,this.minute,this.second,this.nanosecond)+l.timeZoneOffsetToIsoString(this.timeZoneOffsetSeconds)};f=He;function He(e,t,r,n,o){this.hour=l.assertValidHour(e),this.minute=l.assertValidMinute(t),this.second=l.assertValidSecond(r),this.nanosecond=l.assertValidNanosecond(n),this.timeZoneOffsetSeconds=(0,Ne.assertNumberOrInteger)(o,"Time zone offset in seconds"),Object.freeze(this)}u.Time=f,Object.defineProperty(f.prototype,Fe,c),u.isTime=function(e){return Ze(e,Fe)};Ge.fromStandardDate=function(e){return Xe(e),new Ge(e.getFullYear(),e.getMonth()+1,e.getDate())},Ge.prototype.toStandardDate=function(){return l.isoStringToStandardDate(this.toString())},Ge.prototype.toString=function(){return l.dateToIsoString(this.year,this.month,this.day)};f=Ge;function Ge(e,t,r){this.year=l.assertValidYear(e),this.month=l.assertValidMonth(t),this.day=l.assertValidDay(r),Object.freeze(this)}u.Date=f,Object.defineProperty(f.prototype,Be,c),u.isDate=function(e){return Ze(e,Be)};Ye.fromStandardDate=function(e,t){return Xe(e,t),new Ye(e.getFullYear(),e.getMonth()+1,e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),(0,De.toNumber)(l.totalNanoseconds(e,t)))},Ye.prototype.toStandardDate=function(){return l.isoStringToStandardDate(this.toString())},Ye.prototype.toString=function(){return Qe(this.year,this.month,this.day,this.hour,this.minute,this.second,this.nanosecond)};f=Ye;function Ye(e,t,r,n,o,i,u){this.year=l.assertValidYear(e),this.month=l.assertValidMonth(t),this.day=l.assertValidDay(r),this.hour=l.assertValidHour(n),this.minute=l.assertValidMinute(o),this.second=l.assertValidSecond(i),this.nanosecond=l.assertValidNanosecond(u),Object.freeze(this)}u.LocalDateTime=f,Object.defineProperty(f.prototype,We,c),u.isLocalDateTime=function(e){return Ze(e,We)};Ke.fromStandardDate=function(e,t){return Xe(e,t),new Ke(e.getFullYear(),e.getMonth()+1,e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),(0,De.toNumber)(l.totalNanoseconds(e,t)),l.timeZoneOffsetInSeconds(e),null)},Ke.prototype.toStandardDate=function(){return l.toStandardDate(this._toUTC())},Ke.prototype.toString=function(){var e;return Qe(this.year,this.month,this.day,this.hour,this.minute,this.second,this.nanosecond)+(null!=this.timeZoneOffsetSeconds?l.timeZoneOffsetToIsoString(null!=(e=this.timeZoneOffsetSeconds)?e:0):"")+(null!=this.timeZoneId?"[".concat(this.timeZoneId,"]"):"")},Ke.prototype._toUTC=function(){if(void 0===this.timeZoneOffsetSeconds)throw new Error("Requires DateTime created with time zone offset");var e=l.localDateTimeToEpochSecond(this.year,this.month,this.day,this.hour,this.minute,this.second,this.nanosecond).subtract(null!=(e=this.timeZoneOffsetSeconds)?e:0);return(0,De.int)(e).multiply(1e3).add((0,De.int)(this.nanosecond).div(1e6)).toNumber()};f=Ke;function Ke(e,t,r,n,o,i,u,a,s){this.year=l.assertValidYear(e),this.month=l.assertValidMonth(t),this.day=l.assertValidDay(r),this.hour=l.assertValidHour(n),this.minute=l.assertValidMinute(o),this.second=l.assertValidSecond(i),this.nanosecond=l.assertValidNanosecond(u);e=Me(function(e,t){var r=null!=e,n=null!=t&&""!==t;if(!r&&!n)throw(0,xe.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));var o=[void 0,void 0];r&&((0,Ne.assertNumberOrInteger)(e,"Time zone offset in seconds"),o[0]=e);n&&((0,Ne.assertString)(t,"Time zone ID"),l.assertValidZoneId("Time zone ID",t),o[1]=t);return o}(a,s),2),t=e[0],r=e[1];this.timeZoneOffsetSeconds=t,this.timeZoneId=null!=r?r:void 0,Object.freeze(this)}function Ze(e,t){return null!=e&&!0===e[t]}function Qe(e,t,r,n,o,i,u){return l.dateToIsoString(e,t,r)+"T"+l.timeToIsoString(n,o,i,u)}function Xe(e,t){(0,Ne.assertValidDate)(e,"Standard date"),null!=t&&(0,Ne.assertNumberOrInteger)(t,"Nanosecond")}u.DateTime=f,Object.defineProperty(f.prototype,qe,c),u.isDateTime=function(e){return Ze(e,qe)};var f={},Je=(Object.defineProperty(f,"__esModule",{value:!0}),f.isPathSegment=f.PathSegment=f.isPath=f.Path=f.isUnboundRelationship=f.UnboundRelationship=f.isRelationship=f.Relationship=f.isNode=f.Node=void 0,n),c={value:!0,enumerable:!1,configurable:!1,writable:!1},$e="__isNode__",et="__isRelationship__",tt="__isUnboundRelationship__",rt="__isPath__",nt="__isPathSegment__";function ot(e,t){return null!=e&&!0===e[t]}ut.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,Je.stringify)(this.properties[r[t]]);e+="}"}return e+=")"};var it=ut;function ut(e,t,r,n){this.identity=e,this.labels=t,this.properties=r,this.elementId=pt(n,function(){return e.toString()})}f.Node=it,Object.defineProperty(it.prototype,$e,c),f.isNode=function(e){return ot(e,$e)};st.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,Je.stringify)(this.properties[t[r]]);e+="}"}return e+="]->("+this.endNodeElementId+")"};var at=st;function st(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=pt(i,function(){return e.toString()}),this.startNodeElementId=pt(u,function(){return t.toString()}),this.endNodeElementId=pt(a,function(){return r.toString()})}f.Relationship=at,Object.defineProperty(at.prototype,et,c),f.isRelationship=function(e){return ot(e,et)};ct.prototype.bind=function(e,t){return new at(this.identity,e,t,this.type,this.properties,this.elementId)},ct.prototype.bindTo=function(e,t){return new at(this.identity,e.identity,t.identity,this.type,this.properties,this.elementId,e.elementId,t.elementId)},ct.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,Je.stringify)(this.properties[t[r]]);e+="}"}return e+="]->"};it=ct;function ct(e,t,r,n){this.identity=e,this.type=t,this.properties=r,this.elementId=pt(n,function(){return e.toString()})}f.UnboundRelationship=it,Object.defineProperty(it.prototype,tt,c),f.isUnboundRelationship=function(e){return ot(e,tt)};function lt(e,t,r){this.start=e,this.relationship=t,this.end=r}f.PathSegment=lt,Object.defineProperty(lt.prototype,nt,c),f.isPathSegment=function(e){return ot(e,nt)};function ft(e,t,r){this.start=e,this.end=t,this.segments=r,this.length=r.length}function pt(e,t){return null==e?t():e}f.Path=ft,Object.defineProperty(ft.prototype,rt,c),f.isPath=function(e){return ot(e,rt)};var it={},dt=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={next:e(0),throw:e(1),return:e(2)};return"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];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}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}}}},ht=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},yt=(Object.defineProperty(it,"__esModule",{value:!0}),t);function _t(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)}_t.prototype.forEach=function(e){var t,r;try{for(var n=ht(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}}},_t.prototype.map=function(e){var t,r,n=[];try{for(var o=ht(this.entries()),i=o.next();!i.done;i=o.next()){var u=bt(i.value,2),a=u[0],s=u[1];n.push(e(s,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},_t.prototype.entries=function(){var t;return dt(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]}})},_t.prototype.values=function(){var t;return dt(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]}})},_t.prototype[Symbol.iterator]=function(){var t;return dt(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]}})},_t.prototype.toObject=function(){var t,e,r={};try{for(var n=ht(this.entries()),o=n.next();!o.done;o=n.next()){var i=bt(o.value,2),u=i[0],a=i[1];r[u]=a}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return r},_t.prototype.get=function(e){var t;if("number"!=typeof e){if(void 0===(t=this._fieldLookup[e]))throw(0,yt.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,yt.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]},_t.prototype.has=function(e){return"number"==typeof e?0<=e&&e<this._fields.length:void 0!==this._fieldLookup[e]},it.default=_t;var c={},vt=(Object.defineProperty(c,"__esModule",{value:!0}),c.isPoint=c.Point=void 0,s),mt="__isPoint__",p=(gt.prototype.toString=function(){return null==this.z||isNaN(this.z)?"Point{srid=".concat(Ot(this.srid),", x=").concat(Ot(this.x),", y=").concat(Ot(this.y),"}"):"Point{srid=".concat(Ot(this.srid),", x=").concat(Ot(this.x),", y=").concat(Ot(this.y),", z=").concat(Ot(this.z),"}")},gt);function gt(e,t,r,n){this.srid=(0,vt.assertNumberOrInteger)(e,"SRID"),this.x=(0,vt.assertNumber)(t,"X coordinate"),this.y=(0,vt.assertNumber)(r,"Y coordinate"),this.z=null==n?n:(0,vt.assertNumber)(n,"Z coordinate"),Object.freeze(this)}function Ot(e){return Number.isInteger(e)?e.toString()+".0":e.toString()}c.Point=p,Object.defineProperty(p.prototype,mt,{value:!0,enumerable:!1,configurable:!1,writable:!1}),c.isPoint=function(e){return null!=e&&!0===e[mt]};var p={},h={},b={},y=(Object.defineProperty(b,"__esModule",{value:!0}),b.FailedObserver=b.CompletedObserver=void 0,wt.prototype.subscribe=function(e){Pt(e,e.onKeys,[]),Pt(e,e.onCompleted,{})},wt.prototype.cancel=function(){},wt.prototype.pause=function(){},wt.prototype.resume=function(){},wt.prototype.prepareToHandleSingleResponse=function(){},wt.prototype.markCompleted=function(){},wt.prototype.onError=function(e){throw new Error("CompletedObserver not supposed to call onError",{cause:e})},wt);function wt(){}function Et(e){var t=e.error,e=e.onError;this._error=t,this._beforeError=e,this._observers=[],this.onError(t)}function Pt(e,t,r){null!=t&&t.bind(e)(r)}b.CompletedObserver=y,Et.prototype.subscribe=function(e){Pt(e,e.onError,this._error),this._observers.push(e)},Et.prototype.onError=function(t){Pt(this,this._beforeError,t),this._observers.forEach(function(e){return Pt(e,e.onError,t)})},Et.prototype.cancel=function(){},Et.prototype.pause=function(){},Et.prototype.resume=function(){},Et.prototype.markCompleted=function(){},Et.prototype.prepareToHandleSingleResponse=function(){},b.FailedObserver=Et;var y={},St=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]}),Tt=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||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&St(t,e,r);return Tt(t,e),t},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},Ct=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))},Rt=(Object.defineProperty(y,"__esModule",{value:!0}),y.Bookmarks=void 0,_(s)),_=(It.empty=function(){return At},It.prototype.isEmpty=function(){return 0===this._values.length},It.prototype.values=function(){return this._values},It.prototype[Symbol.iterator]=function(){return this._values[Symbol.iterator]()},It.prototype.asBeginTransactionParameters=function(){var e;return this.isEmpty()?{}:((e={}).bookmarks=this._values,e)},It);function It(e){this._values=function(e){if(null==e||""===e)return[];if(Rt.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(!Rt.isString(o))throw new TypeError("Bookmark value should be a string, given: '".concat(o,"'"));t.add(o)}}return Ct([],jt(t),!1)}throw new TypeError("Bookmarks should either be a string or a string array, given: '".concat(e,"'"))}(e)}var At=new(y.Bookmarks=_)(null);var kt,Mt,_={},Nt=(Object.defineProperty(_,"__esModule",{value:!0}),_.TELEMETRY_APIS=_.BOLT_PROTOCOL_V5_7=_.BOLT_PROTOCOL_V5_6=_.BOLT_PROTOCOL_V5_5=_.BOLT_PROTOCOL_V5_4=_.BOLT_PROTOCOL_V5_3=_.BOLT_PROTOCOL_V5_2=_.BOLT_PROTOCOL_V5_1=_.BOLT_PROTOCOL_V5_0=_.BOLT_PROTOCOL_V4_4=_.BOLT_PROTOCOL_V4_3=_.BOLT_PROTOCOL_V4_2=_.BOLT_PROTOCOL_V4_1=_.BOLT_PROTOCOL_V4_0=_.BOLT_PROTOCOL_V3=_.BOLT_PROTOCOL_V2=_.BOLT_PROTOCOL_V1=_.DEFAULT_POOL_MAX_SIZE=_.DEFAULT_POOL_ACQUISITION_TIMEOUT=_.DEFAULT_CONNECTION_TIMEOUT_MILLIS=_.ACCESS_MODE_WRITE=_.ACCESS_MODE_READ=_.FETCH_ALL=void 0,_.FETCH_ALL=-1,_.DEFAULT_POOL_ACQUISITION_TIMEOUT=6e4,_.DEFAULT_POOL_MAX_SIZE=100,_.DEFAULT_CONNECTION_TIMEOUT_MILLIS=3e4,_.ACCESS_MODE_READ="READ",_.ACCESS_MODE_WRITE="WRITE",_.BOLT_PROTOCOL_V1=1,_.BOLT_PROTOCOL_V2=2,_.BOLT_PROTOCOL_V3=3,_.BOLT_PROTOCOL_V4_0=4,_.BOLT_PROTOCOL_V4_1=4.1,_.BOLT_PROTOCOL_V4_2=4.2,_.BOLT_PROTOCOL_V4_3=4.3,_.BOLT_PROTOCOL_V4_4=4.4,_.BOLT_PROTOCOL_V5_0=5,_.BOLT_PROTOCOL_V5_1=5.1,_.BOLT_PROTOCOL_V5_2=5.2,_.BOLT_PROTOCOL_V5_3=5.3,_.BOLT_PROTOCOL_V5_4=5.4,_.BOLT_PROTOCOL_V5_5=5.5,_.BOLT_PROTOCOL_V5_6=5.6,_.BOLT_PROTOCOL_V5_7=5.7,_.TELEMETRY_APIS={MANAGED_TRANSACTION:0,UNMANAGED_TRANSACTION:1,AUTO_COMMIT_TRANSACTION:2,EXECUTE_QUERY:3},{}),v={},m=r&&r.__extends||(kt=function(e,t){return(kt=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}kt(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),xt=(Object.defineProperty(v,"__esModule",{value:!0}),v.Logger=void 0,t),Dt="error",Lt="warn",Ut="info",Ft="debug",Bt=((g={})[Dt]=0,g[Lt]=1,g[Ut]=2,g[Ft]=3,g),g=(Wt.create=function(e){return null!=(null==e?void 0:e.logging)?new Wt(function(e){if(null==(null==e?void 0:e.level))return"info";var e=e.level,t=Bt[e];if(null!=t||0===t)return e;throw(0,xt.newError)("Illegal logging level: ".concat(e,". Supported levels are: ").concat(Object.keys(Bt).toString()))}(e=e.logging),function(e){if(null!=(null==e?void 0:e.logger)){var t=e.logger;if(null!=t&&"function"==typeof t)return t}throw(0,xt.newError)("Illegal logger function: ".concat(null!=(e=null==(t=null==e?void 0:e.logger)?void 0:t.toString())?e:"undefined"))}(e)):this.noOp()},Wt.noOp=function(){return zt},Wt.prototype.isErrorEnabled=function(){return Vt(this._level,Dt)},Wt.prototype.error=function(e){this.isErrorEnabled()&&this._loggerFunction(Dt,e)},Wt.prototype.isWarnEnabled=function(){return Vt(this._level,Lt)},Wt.prototype.warn=function(e){this.isWarnEnabled()&&this._loggerFunction(Lt,e)},Wt.prototype.isInfoEnabled=function(){return Vt(this._level,Ut)},Wt.prototype.info=function(e){this.isInfoEnabled()&&this._loggerFunction(Ut,e)},Wt.prototype.isDebugEnabled=function(){return Vt(this._level,Ft)},Wt.prototype.debug=function(e){this.isDebugEnabled()&&this._loggerFunction(Ft,e)},Wt);function Wt(e,t){this._level=e,this._loggerFunction=t}function qt(){return Mt.call(this,Ut,function(e,t){})||this}v.Logger=g,m(qt,Mt=g),qt.prototype.isErrorEnabled=function(){return!1},qt.prototype.error=function(e){},qt.prototype.isWarnEnabled=function(){return!1},qt.prototype.warn=function(e){},qt.prototype.isInfoEnabled=function(){return!1},qt.prototype.info=function(e){},qt.prototype.isDebugEnabled=function(){return!1},qt.prototype.debug=function(e){};var zt=new qt;function Vt(e,t){return Bt[e]>=Bt[t]}var Ht,m=r&&r.__extends||(Ht=function(e,t){return(Ht=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}Ht(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Gt=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())})},Yt=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={next:e(0),throw:e(1),return:e(2)};return"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];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}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}}}},Kt=(Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.EMPTY_CONNECTION_HOLDER=Nt.ReadOnlyConnectionHolder=Nt.ConnectionHolder=void 0,t),Zt=s,Qt=_,Xt=y,Jt=v,g=($t.prototype.mode=function(){return this._mode},$t.prototype.database=function(){return this._database},$t.prototype.setDatabase=function(e){this._database=e},$t.prototype.bookmarks=function(){return this._bookmarks},$t.prototype.connectionProvider=function(){return this._connectionProvider},$t.prototype.referenceCount=function(){return this._referenceCount},$t.prototype.initializeConnection=function(){return 0!==this._referenceCount||null==this._connectionProvider?(this._referenceCount++,!1):(this._connectionPromise=this._createConnectionPromise(this._connectionProvider),this._referenceCount++,!0)},$t.prototype._createConnectionPromise=function(o){return Gt(this,void 0,void 0,function(){var t,r,n;return Yt(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)])];case 2:return[2,e.sent()]}})})},$t.prototype._getBookmarks=function(){return Gt(this,void 0,void 0,function(){return Yt(this,function(e){switch(e.label){case 0:return[4,this._getConnectionAcquistionBookmarks()];case 1:return[2,e.sent()]}})})},$t.prototype.getConnection=function(){return this._connectionPromise},$t.prototype.releaseConnection=function(){return 0===this._referenceCount?this._connectionPromise:(this._referenceCount--,0===this._referenceCount?this._releaseConnection():this._connectionPromise)},$t.prototype.close=function(e){return this._closed=!0,0===this._referenceCount?this._connectionPromise:(this._referenceCount=0,this._releaseConnection(e))},$t.prototype.log=function(){return this._log},$t.prototype._releaseConnection=function(t){return this._connectionPromise=this._connectionPromise.then(function(e){return null!=e?e.isOpen()&&(e.hasOngoingObservableRequests()||!0===t)?e.resetAndFlush().catch(or).then(function(){return e.release().then(function(){return null})}):e.release().then(function(){return null}):Promise.resolve(null)}).catch(this._logError),this._connectionPromise},$t.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},$t);function $t(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:Qt.ACCESS_MODE_WRITE,this._closed=!1,this._database=null!=r?(0,Zt.assertString)(r,"database"):"",this._bookmarks=null!=n?n:Xt.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(Xt.Bookmarks.empty())}}Nt.ConnectionHolder=g;