j?j:g+f));return 1===d?(b=a[c-1],e.push(k[b>>2]+k[63&b<<4]+"==")):2===d&&(b=(a[c-2]<<8)+a[c-1],e.push(k[b>>10]+k[63&b>>4]+k[63&b<<2]+"=")),e.join("")}c.byteLength=function(a){var b=d(a),c=b[0],e=b[1];return 3*(c+e)/4-e},c.toByteArray=f,c.fromByteArray=j;for(var k=[],l=[],m="undefined"==typeof Uint8Array?Array:Uint8Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,p=n.length;o 0) {
+ throw new Error('Invalid string. Length must be a multiple of 4')
+ }
+
+ // Trim off extra bytes after placeholder bytes are found
+ // See: https://github.com/beatgammit/base64-js/issues/42
+ var validLen = b64.indexOf('=')
+ if (validLen === -1) validLen = len
+
+ var placeHoldersLen = validLen === len
+ ? 0
+ : 4 - (validLen % 4)
+
+ return [validLen, placeHoldersLen]
+}
+
+// base64 is 4/3 + up to two characters of the original data
+function byteLength (b64) {
+ var lens = getLens(b64)
+ var validLen = lens[0]
+ var placeHoldersLen = lens[1]
+ return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
+}
+
+function _byteLength (b64, validLen, placeHoldersLen) {
+ return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
+}
+
+function toByteArray (b64) {
+ var tmp
+ var lens = getLens(b64)
+ var validLen = lens[0]
+ var placeHoldersLen = lens[1]
+
+ var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
+
+ var curByte = 0
+
+ // if there are placeholders, only get up to the last complete 4 chars
+ var len = placeHoldersLen > 0
+ ? validLen - 4
+ : validLen
+
+ var i
+ for (i = 0; i < len; i += 4) {
+ tmp =
+ (revLookup[b64.charCodeAt(i)] << 18) |
+ (revLookup[b64.charCodeAt(i + 1)] << 12) |
+ (revLookup[b64.charCodeAt(i + 2)] << 6) |
+ revLookup[b64.charCodeAt(i + 3)]
+ arr[curByte++] = (tmp >> 16) & 0xFF
+ arr[curByte++] = (tmp >> 8) & 0xFF
+ arr[curByte++] = tmp & 0xFF
+ }
+
+ if (placeHoldersLen === 2) {
+ tmp =
+ (revLookup[b64.charCodeAt(i)] << 2) |
+ (revLookup[b64.charCodeAt(i + 1)] >> 4)
+ arr[curByte++] = tmp & 0xFF
+ }
+
+ if (placeHoldersLen === 1) {
+ tmp =
+ (revLookup[b64.charCodeAt(i)] << 10) |
+ (revLookup[b64.charCodeAt(i + 1)] << 4) |
+ (revLookup[b64.charCodeAt(i + 2)] >> 2)
+ arr[curByte++] = (tmp >> 8) & 0xFF
+ arr[curByte++] = tmp & 0xFF
+ }
+
+ return arr
+}
+
+function tripletToBase64 (num) {
+ return lookup[num >> 18 & 0x3F] +
+ lookup[num >> 12 & 0x3F] +
+ lookup[num >> 6 & 0x3F] +
+ lookup[num & 0x3F]
+}
+
+function encodeChunk (uint8, start, end) {
+ var tmp
+ var output = []
+ for (var i = start; i < end; i += 3) {
+ tmp =
+ ((uint8[i] << 16) & 0xFF0000) +
+ ((uint8[i + 1] << 8) & 0xFF00) +
+ (uint8[i + 2] & 0xFF)
+ output.push(tripletToBase64(tmp))
+ }
+ return output.join('')
+}
+
+function fromByteArray (uint8) {
+ var tmp
+ var len = uint8.length
+ var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
+ var parts = []
+ var maxChunkLength = 16383 // must be multiple of 3
+
+ // go through the array every three bytes, we'll deal with trailing stuff later
+ for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
+ parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
+ }
+
+ // pad the end with zeros, but make sure to not forget the extra bytes
+ if (extraBytes === 1) {
+ tmp = uint8[len - 1]
+ parts.push(
+ lookup[tmp >> 2] +
+ lookup[(tmp << 4) & 0x3F] +
+ '=='
+ )
+ } else if (extraBytes === 2) {
+ tmp = (uint8[len - 2] << 8) + uint8[len - 1]
+ parts.push(
+ lookup[tmp >> 10] +
+ lookup[(tmp >> 4) & 0x3F] +
+ lookup[(tmp << 2) & 0x3F] +
+ '='
+ )
+ }
+
+ return parts.join('')
+}
diff --git a/node_modules/base64-js/package.json b/node_modules/base64-js/package.json
new file mode 100644
index 00000000..c3972e39
--- /dev/null
+++ b/node_modules/base64-js/package.json
@@ -0,0 +1,47 @@
+{
+ "name": "base64-js",
+ "description": "Base64 encoding/decoding in pure JS",
+ "version": "1.5.1",
+ "author": "T. Jameson Little ",
+ "typings": "index.d.ts",
+ "bugs": {
+ "url": "https://github.com/beatgammit/base64-js/issues"
+ },
+ "devDependencies": {
+ "babel-minify": "^0.5.1",
+ "benchmark": "^2.1.4",
+ "browserify": "^16.3.0",
+ "standard": "*",
+ "tape": "4.x"
+ },
+ "homepage": "https://github.com/beatgammit/base64-js",
+ "keywords": [
+ "base64"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/beatgammit/base64-js.git"
+ },
+ "scripts": {
+ "build": "browserify -s base64js -r ./ | minify > base64js.min.js",
+ "lint": "standard",
+ "test": "npm run lint && npm run unit",
+ "unit": "tape test/*.js"
+ },
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ]
+}
diff --git a/node_modules/bcryptjs/LICENSE b/node_modules/bcryptjs/LICENSE
new file mode 100644
index 00000000..6ffc6d98
--- /dev/null
+++ b/node_modules/bcryptjs/LICENSE
@@ -0,0 +1,27 @@
+bcrypt.js
+---------
+Copyright (c) 2012 Nevins Bartolomeo
+Copyright (c) 2012 Shane Girish
+Copyright (c) 2025 Daniel Wirtz
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/node_modules/bcryptjs/README.md b/node_modules/bcryptjs/README.md
new file mode 100644
index 00000000..15546c49
--- /dev/null
+++ b/node_modules/bcryptjs/README.md
@@ -0,0 +1,201 @@
+# bcrypt.js
+
+Optimized bcrypt in JavaScript with zero dependencies, with TypeScript support. Compatible to the C++
+[bcrypt](https://npmjs.org/package/bcrypt) binding on Node.js and also working in the browser.
+
+[](https://github.com/dcodeIO/bcrypt.js/actions/workflows/test.yml) [](https://github.com/dcodeIO/bcrypt.js/actions/workflows/publish.yml) [](https://www.npmjs.com/package/bcryptjs)
+
+## Security considerations
+
+Besides incorporating a salt to protect against rainbow table attacks, bcrypt is an adaptive function: over time, the
+iteration count can be increased to make it slower, so it remains resistant to brute-force search attacks even with
+increasing computation power. ([see](http://en.wikipedia.org/wiki/Bcrypt))
+
+While bcrypt.js is compatible to the C++ bcrypt binding, it is written in pure JavaScript and thus slower ([about 30%](https://github.com/dcodeIO/bcrypt.js/wiki/Benchmark)), effectively reducing the number of iterations that can be
+processed in an equal time span.
+
+The maximum input length is 72 bytes (note that UTF-8 encoded characters use up to 4 bytes) and the length of generated
+hashes is 60 characters. Note that maximum input length is not implicitly checked by the library for compatibility with
+the C++ binding on Node.js, but should be checked with `bcrypt.truncates(password)` where necessary.
+
+## Usage
+
+The package exports an ECMAScript module with an UMD fallback.
+
+```
+$> npm install bcryptjs
+```
+
+```ts
+import bcrypt from "bcryptjs";
+```
+
+### Usage with a CDN
+
+- From GitHub via [jsDelivr](https://www.jsdelivr.com):
+ `https://cdn.jsdelivr.net/gh/dcodeIO/bcrypt.js@TAG/index.js` (ESM)
+- From npm via [jsDelivr](https://www.jsdelivr.com):
+ `https://cdn.jsdelivr.net/npm/bcryptjs@VERSION/index.js` (ESM)
+ `https://cdn.jsdelivr.net/npm/bcryptjs@VERSION/umd/index.js` (UMD)
+- From npm via [unpkg](https://unpkg.com):
+ `https://unpkg.com/bcryptjs@VERSION/index.js` (ESM)
+ `https://unpkg.com/bcryptjs@VERSION/umd/index.js` (UMD)
+
+Replace `TAG` respectively `VERSION` with a [specific version](https://github.com/dcodeIO/bcrypt.js/releases) or omit it (not recommended in production) to use latest.
+
+When using the ESM variant in a browser, the `crypto` import needs to be stubbed out, for example using an [import map](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type/importmap). Bundlers should omit it automatically.
+
+### Usage - Sync
+
+To hash a password:
+
+```ts
+const salt = bcrypt.genSaltSync(10);
+const hash = bcrypt.hashSync("B4c0/\/", salt);
+// Store hash in your password DB
+```
+
+To check a password:
+
+```ts
+// Load hash from your password DB
+bcrypt.compareSync("B4c0/\/", hash); // true
+bcrypt.compareSync("not_bacon", hash); // false
+```
+
+Auto-gen a salt and hash:
+
+```ts
+const hash = bcrypt.hashSync("bacon", 10);
+```
+
+### Usage - Async
+
+To hash a password:
+
+```ts
+const salt = await bcrypt.genSalt(10);
+const hash = await bcrypt.hash("B4c0/\/", salt);
+// Store hash in your password DB
+```
+
+```ts
+bcrypt.genSalt(10, (err, salt) => {
+ bcrypt.hash("B4c0/\/", salt, function (err, hash) {
+ // Store hash in your password DB
+ });
+});
+```
+
+To check a password:
+
+```ts
+// Load hash from your password DB
+await bcrypt.compare("B4c0/\/", hash); // true
+await bcrypt.compare("not_bacon", hash); // false
+```
+
+```ts
+// Load hash from your password DB
+bcrypt.compare("B4c0/\/", hash, (err, res) => {
+ // res === true
+});
+bcrypt.compare("not_bacon", hash, (err, res) => {
+ // res === false
+});
+```
+
+Auto-gen a salt and hash:
+
+```ts
+await bcrypt.hash("B4c0/\/", 10);
+// Store hash in your password DB
+```
+
+```ts
+bcrypt.hash("B4c0/\/", 10, (err, hash) => {
+ // Store hash in your password DB
+});
+```
+
+**Note:** Under the hood, asynchronous APIs split an operation into small chunks. After the completion of a chunk, the execution of the next chunk is placed on the back of the [JS event queue](https://developer.mozilla.org/en/docs/Web/JavaScript/EventLoop), efficiently yielding for other computation to execute.
+
+### Usage - Command Line
+
+```
+Usage: bcrypt [rounds|salt]
+```
+
+## API
+
+### Callback types
+
+- **Callback<`T`>**: `(err: Error | null, result?: T) => void`
+ Called with an error on failure or a value of type `T` upon success.
+
+- **ProgressCallback**: `(percentage: number) => void`
+ Called with the percentage of rounds completed (0.0 - 1.0), maximally once per `MAX_EXECUTION_TIME = 100` ms.
+
+- **RandomFallback**: `(length: number) => number[]`
+ Called to obtain random bytes when both [Web Crypto API](http://www.w3.org/TR/WebCryptoAPI/) and Node.js
+ [crypto](http://nodejs.org/api/crypto.html) are not available.
+
+### Functions
+
+- bcrypt.**genSaltSync**(rounds?: `number`): `string`
+ Synchronously generates a salt. Number of rounds defaults to 10 when omitted.
+
+- bcrypt.**genSalt**(rounds?: `number`): `Promise`
+ Asynchronously generates a salt. Number of rounds defaults to 10 when omitted.
+
+- bcrypt.**genSalt**([rounds: `number`, ]callback: `Callback`): `void`
+ Asynchronously generates a salt. Number of rounds defaults to 10 when omitted.
+
+- bcrypt.**truncates**(password: `string`): `boolean`
+ Tests if a password will be truncated when hashed, that is its length is greater than 72 bytes when converted to UTF-8.
+
+- bcrypt.**hashSync**(password: `string`, salt?: `number | string`): `string`
+ Synchronously generates a hash for the given password. Number of rounds defaults to 10 when omitted.
+
+- bcrypt.**hash**(password: `string`, salt: `number | string`): `Promise`
+ Asynchronously generates a hash for the given password.
+
+- bcrypt.**hash**(password: `string`, salt: `number | string`, callback: `Callback`, progressCallback?: `ProgressCallback`): `void`
+ Asynchronously generates a hash for the given password.
+
+- bcrypt.**compareSync**(password: `string`, hash: `string`): `boolean`
+ Synchronously tests a password against a hash.
+
+- bcrypt.**compare**(password: `string`, hash: `string`): `Promise`
+ Asynchronously compares a password against a hash.
+
+- bcrypt.**compare**(password: `string`, hash: `string`, callback: `Callback`, progressCallback?: `ProgressCallback`)
+ Asynchronously compares a password against a hash.
+
+- bcrypt.**getRounds**(hash: `string`): `number`
+ Gets the number of rounds used to encrypt the specified hash.
+
+- bcrypt.**getSalt**(hash: `string`): `string`
+ Gets the salt portion from a hash. Does not validate the hash.
+
+- bcrypt.**setRandomFallback**(random: `RandomFallback`): `void`
+ Sets the pseudo random number generator to use as a fallback if neither [Web Crypto API](http://www.w3.org/TR/WebCryptoAPI/) nor Node.js [crypto](http://nodejs.org/api/crypto.html) are available. Please note: It is highly important that the PRNG used is cryptographically secure and that it is seeded properly!
+
+## Building
+
+Building the UMD fallback:
+
+```
+$> npm run build
+```
+
+Running the [tests](./tests):
+
+```
+$> npm test
+```
+
+## Credits
+
+Based on work started by Shane Girish at [bcrypt-nodejs](https://github.com/shaneGirish/bcrypt-nodejs), which is itself
+based on [javascript-bcrypt](http://code.google.com/p/javascript-bcrypt/) (New BSD-licensed).
diff --git a/node_modules/bcryptjs/bin/bcrypt b/node_modules/bcryptjs/bin/bcrypt
new file mode 100644
index 00000000..5c72e0fa
--- /dev/null
+++ b/node_modules/bcryptjs/bin/bcrypt
@@ -0,0 +1,23 @@
+#!/usr/bin/env node
+
+import path from "node:path";
+import bcrypt from "../index.js";
+
+if (process.argv.length < 3) {
+ console.log(
+ "Usage: " + path.basename(process.argv[1]) + " [rounds|salt]",
+ );
+ process.exit(1);
+} else {
+ var salt;
+ if (process.argv.length > 3) {
+ salt = process.argv[3];
+ var rounds = parseInt(salt, 10);
+ if (rounds == salt) {
+ salt = bcrypt.genSaltSync(rounds);
+ }
+ } else {
+ salt = bcrypt.genSaltSync();
+ }
+ console.log(bcrypt.hashSync(process.argv[2], salt));
+}
diff --git a/node_modules/bcryptjs/index.d.ts b/node_modules/bcryptjs/index.d.ts
new file mode 100644
index 00000000..3ae838f0
--- /dev/null
+++ b/node_modules/bcryptjs/index.d.ts
@@ -0,0 +1,3 @@
+import * as bcrypt from "./types.js";
+export * from "./types.js";
+export default bcrypt;
diff --git a/node_modules/bcryptjs/index.js b/node_modules/bcryptjs/index.js
new file mode 100644
index 00000000..4a19b3d1
--- /dev/null
+++ b/node_modules/bcryptjs/index.js
@@ -0,0 +1,1159 @@
+/*
+ Copyright (c) 2012 Nevins Bartolomeo
+ Copyright (c) 2012 Shane Girish
+ Copyright (c) 2025 Daniel Wirtz
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// The Node.js crypto module is used as a fallback for the Web Crypto API. When
+// building for the browser, inclusion of the crypto module should be disabled,
+// which the package hints at in its package.json for bundlers that support it.
+import nodeCrypto from "crypto";
+
+/**
+ * The random implementation to use as a fallback.
+ * @type {?function(number):!Array.}
+ * @inner
+ */
+var randomFallback = null;
+
+/**
+ * Generates cryptographically secure random bytes.
+ * @function
+ * @param {number} len Bytes length
+ * @returns {!Array.} Random bytes
+ * @throws {Error} If no random implementation is available
+ * @inner
+ */
+function randomBytes(len) {
+ // Web Crypto API. Globally available in the browser and in Node.js >=23.
+ try {
+ return crypto.getRandomValues(new Uint8Array(len));
+ } catch {}
+ // Node.js crypto module for non-browser environments.
+ try {
+ return nodeCrypto.randomBytes(len);
+ } catch {}
+ // Custom fallback specified with `setRandomFallback`.
+ if (!randomFallback) {
+ throw Error(
+ "Neither WebCryptoAPI nor a crypto module is available. Use bcrypt.setRandomFallback to set an alternative",
+ );
+ }
+ return randomFallback(len);
+}
+
+/**
+ * Sets the pseudo random number generator to use as a fallback if neither node's `crypto` module nor the Web Crypto
+ * API is available. Please note: It is highly important that the PRNG used is cryptographically secure and that it
+ * is seeded properly!
+ * @param {?function(number):!Array.} random Function taking the number of bytes to generate as its
+ * sole argument, returning the corresponding array of cryptographically secure random byte values.
+ * @see http://nodejs.org/api/crypto.html
+ * @see http://www.w3.org/TR/WebCryptoAPI/
+ */
+export function setRandomFallback(random) {
+ randomFallback = random;
+}
+
+/**
+ * Synchronously generates a salt.
+ * @param {number=} rounds Number of rounds to use, defaults to 10 if omitted
+ * @param {number=} seed_length Not supported.
+ * @returns {string} Resulting salt
+ * @throws {Error} If a random fallback is required but not set
+ */
+export function genSaltSync(rounds, seed_length) {
+ rounds = rounds || GENSALT_DEFAULT_LOG2_ROUNDS;
+ if (typeof rounds !== "number")
+ throw Error(
+ "Illegal arguments: " + typeof rounds + ", " + typeof seed_length,
+ );
+ if (rounds < 4) rounds = 4;
+ else if (rounds > 31) rounds = 31;
+ var salt = [];
+ salt.push("$2b$");
+ if (rounds < 10) salt.push("0");
+ salt.push(rounds.toString());
+ salt.push("$");
+ salt.push(base64_encode(randomBytes(BCRYPT_SALT_LEN), BCRYPT_SALT_LEN)); // May throw
+ return salt.join("");
+}
+
+/**
+ * Asynchronously generates a salt.
+ * @param {(number|function(Error, string=))=} rounds Number of rounds to use, defaults to 10 if omitted
+ * @param {(number|function(Error, string=))=} seed_length Not supported.
+ * @param {function(Error, string=)=} callback Callback receiving the error, if any, and the resulting salt
+ * @returns {!Promise} If `callback` has been omitted
+ * @throws {Error} If `callback` is present but not a function
+ */
+export function genSalt(rounds, seed_length, callback) {
+ if (typeof seed_length === "function")
+ (callback = seed_length), (seed_length = undefined); // Not supported.
+ if (typeof rounds === "function") (callback = rounds), (rounds = undefined);
+ if (typeof rounds === "undefined") rounds = GENSALT_DEFAULT_LOG2_ROUNDS;
+ else if (typeof rounds !== "number")
+ throw Error("illegal arguments: " + typeof rounds);
+
+ function _async(callback) {
+ nextTick(function () {
+ // Pretty thin, but salting is fast enough
+ try {
+ callback(null, genSaltSync(rounds));
+ } catch (err) {
+ callback(err);
+ }
+ });
+ }
+
+ if (callback) {
+ if (typeof callback !== "function")
+ throw Error("Illegal callback: " + typeof callback);
+ _async(callback);
+ } else
+ return new Promise(function (resolve, reject) {
+ _async(function (err, res) {
+ if (err) {
+ reject(err);
+ return;
+ }
+ resolve(res);
+ });
+ });
+}
+
+/**
+ * Synchronously generates a hash for the given password.
+ * @param {string} password Password to hash
+ * @param {(number|string)=} salt Salt length to generate or salt to use, default to 10
+ * @returns {string} Resulting hash
+ */
+export function hashSync(password, salt) {
+ if (typeof salt === "undefined") salt = GENSALT_DEFAULT_LOG2_ROUNDS;
+ if (typeof salt === "number") salt = genSaltSync(salt);
+ if (typeof password !== "string" || typeof salt !== "string")
+ throw Error("Illegal arguments: " + typeof password + ", " + typeof salt);
+ return _hash(password, salt);
+}
+
+/**
+ * Asynchronously generates a hash for the given password.
+ * @param {string} password Password to hash
+ * @param {number|string} salt Salt length to generate or salt to use
+ * @param {function(Error, string=)=} callback Callback receiving the error, if any, and the resulting hash
+ * @param {function(number)=} progressCallback Callback successively called with the percentage of rounds completed
+ * (0.0 - 1.0), maximally once per `MAX_EXECUTION_TIME = 100` ms.
+ * @returns {!Promise} If `callback` has been omitted
+ * @throws {Error} If `callback` is present but not a function
+ */
+export function hash(password, salt, callback, progressCallback) {
+ function _async(callback) {
+ if (typeof password === "string" && typeof salt === "number")
+ genSalt(salt, function (err, salt) {
+ _hash(password, salt, callback, progressCallback);
+ });
+ else if (typeof password === "string" && typeof salt === "string")
+ _hash(password, salt, callback, progressCallback);
+ else
+ nextTick(
+ callback.bind(
+ this,
+ Error("Illegal arguments: " + typeof password + ", " + typeof salt),
+ ),
+ );
+ }
+
+ if (callback) {
+ if (typeof callback !== "function")
+ throw Error("Illegal callback: " + typeof callback);
+ _async(callback);
+ } else
+ return new Promise(function (resolve, reject) {
+ _async(function (err, res) {
+ if (err) {
+ reject(err);
+ return;
+ }
+ resolve(res);
+ });
+ });
+}
+
+/**
+ * Compares two strings of the same length in constant time.
+ * @param {string} known Must be of the correct length
+ * @param {string} unknown Must be the same length as `known`
+ * @returns {boolean}
+ * @inner
+ */
+function safeStringCompare(known, unknown) {
+ var diff = known.length ^ unknown.length;
+ for (var i = 0; i < known.length; ++i) {
+ diff |= known.charCodeAt(i) ^ unknown.charCodeAt(i);
+ }
+ return diff === 0;
+}
+
+/**
+ * Synchronously tests a password against a hash.
+ * @param {string} password Password to compare
+ * @param {string} hash Hash to test against
+ * @returns {boolean} true if matching, otherwise false
+ * @throws {Error} If an argument is illegal
+ */
+export function compareSync(password, hash) {
+ if (typeof password !== "string" || typeof hash !== "string")
+ throw Error("Illegal arguments: " + typeof password + ", " + typeof hash);
+ if (hash.length !== 60) return false;
+ return safeStringCompare(
+ hashSync(password, hash.substring(0, hash.length - 31)),
+ hash,
+ );
+}
+
+/**
+ * Asynchronously tests a password against a hash.
+ * @param {string} password Password to compare
+ * @param {string} hashValue Hash to test against
+ * @param {function(Error, boolean)=} callback Callback receiving the error, if any, otherwise the result
+ * @param {function(number)=} progressCallback Callback successively called with the percentage of rounds completed
+ * (0.0 - 1.0), maximally once per `MAX_EXECUTION_TIME = 100` ms.
+ * @returns {!Promise} If `callback` has been omitted
+ * @throws {Error} If `callback` is present but not a function
+ */
+export function compare(password, hashValue, callback, progressCallback) {
+ function _async(callback) {
+ if (typeof password !== "string" || typeof hashValue !== "string") {
+ nextTick(
+ callback.bind(
+ this,
+ Error(
+ "Illegal arguments: " + typeof password + ", " + typeof hashValue,
+ ),
+ ),
+ );
+ return;
+ }
+ if (hashValue.length !== 60) {
+ nextTick(callback.bind(this, null, false));
+ return;
+ }
+ hash(
+ password,
+ hashValue.substring(0, 29),
+ function (err, comp) {
+ if (err) callback(err);
+ else callback(null, safeStringCompare(comp, hashValue));
+ },
+ progressCallback,
+ );
+ }
+
+ if (callback) {
+ if (typeof callback !== "function")
+ throw Error("Illegal callback: " + typeof callback);
+ _async(callback);
+ } else
+ return new Promise(function (resolve, reject) {
+ _async(function (err, res) {
+ if (err) {
+ reject(err);
+ return;
+ }
+ resolve(res);
+ });
+ });
+}
+
+/**
+ * Gets the number of rounds used to encrypt the specified hash.
+ * @param {string} hash Hash to extract the used number of rounds from
+ * @returns {number} Number of rounds used
+ * @throws {Error} If `hash` is not a string
+ */
+export function getRounds(hash) {
+ if (typeof hash !== "string")
+ throw Error("Illegal arguments: " + typeof hash);
+ return parseInt(hash.split("$")[2], 10);
+}
+
+/**
+ * Gets the salt portion from a hash. Does not validate the hash.
+ * @param {string} hash Hash to extract the salt from
+ * @returns {string} Extracted salt part
+ * @throws {Error} If `hash` is not a string or otherwise invalid
+ */
+export function getSalt(hash) {
+ if (typeof hash !== "string")
+ throw Error("Illegal arguments: " + typeof hash);
+ if (hash.length !== 60)
+ throw Error("Illegal hash length: " + hash.length + " != 60");
+ return hash.substring(0, 29);
+}
+
+/**
+ * Tests if a password will be truncated when hashed, that is its length is
+ * greater than 72 bytes when converted to UTF-8.
+ * @param {string} password The password to test
+ * @returns {boolean} `true` if truncated, otherwise `false`
+ */
+export function truncates(password) {
+ if (typeof password !== "string")
+ throw Error("Illegal arguments: " + typeof password);
+ return utf8Length(password) > 72;
+}
+
+/**
+ * Continues with the callback after yielding to the event loop.
+ * @function
+ * @param {function(...[*])} callback Callback to execute
+ * @inner
+ */
+var nextTick =
+ typeof setImmediate === "function"
+ ? setImmediate
+ : typeof scheduler === "object" && typeof scheduler.postTask === "function"
+ ? scheduler.postTask.bind(scheduler)
+ : setTimeout;
+
+/** Calculates the byte length of a string encoded as UTF8. */
+function utf8Length(string) {
+ var len = 0,
+ c = 0;
+ for (var i = 0; i < string.length; ++i) {
+ c = string.charCodeAt(i);
+ if (c < 128) len += 1;
+ else if (c < 2048) len += 2;
+ else if (
+ (c & 0xfc00) === 0xd800 &&
+ (string.charCodeAt(i + 1) & 0xfc00) === 0xdc00
+ ) {
+ ++i;
+ len += 4;
+ } else len += 3;
+ }
+ return len;
+}
+
+/** Converts a string to an array of UTF8 bytes. */
+function utf8Array(string) {
+ var offset = 0,
+ c1,
+ c2;
+ var buffer = new Array(utf8Length(string));
+ for (var i = 0, k = string.length; i < k; ++i) {
+ c1 = string.charCodeAt(i);
+ if (c1 < 128) {
+ buffer[offset++] = c1;
+ } else if (c1 < 2048) {
+ buffer[offset++] = (c1 >> 6) | 192;
+ buffer[offset++] = (c1 & 63) | 128;
+ } else if (
+ (c1 & 0xfc00) === 0xd800 &&
+ ((c2 = string.charCodeAt(i + 1)) & 0xfc00) === 0xdc00
+ ) {
+ c1 = 0x10000 + ((c1 & 0x03ff) << 10) + (c2 & 0x03ff);
+ ++i;
+ buffer[offset++] = (c1 >> 18) | 240;
+ buffer[offset++] = ((c1 >> 12) & 63) | 128;
+ buffer[offset++] = ((c1 >> 6) & 63) | 128;
+ buffer[offset++] = (c1 & 63) | 128;
+ } else {
+ buffer[offset++] = (c1 >> 12) | 224;
+ buffer[offset++] = ((c1 >> 6) & 63) | 128;
+ buffer[offset++] = (c1 & 63) | 128;
+ }
+ }
+ return buffer;
+}
+
+// A base64 implementation for the bcrypt algorithm. This is partly non-standard.
+
+/**
+ * bcrypt's own non-standard base64 dictionary.
+ * @type {!Array.}
+ * @const
+ * @inner
+ **/
+var BASE64_CODE =
+ "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split("");
+
+/**
+ * @type {!Array.}
+ * @const
+ * @inner
+ **/
+var BASE64_INDEX = [
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
+ -1, -1, -1, -1, -1, -1, -1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, -1, -1, -1, -1, -1, -1, 28,
+ 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
+ 48, 49, 50, 51, 52, 53, -1, -1, -1, -1, -1,
+];
+
+/**
+ * Encodes a byte array to base64 with up to len bytes of input.
+ * @param {!Array.} b Byte array
+ * @param {number} len Maximum input length
+ * @returns {string}
+ * @inner
+ */
+function base64_encode(b, len) {
+ var off = 0,
+ rs = [],
+ c1,
+ c2;
+ if (len <= 0 || len > b.length) throw Error("Illegal len: " + len);
+ while (off < len) {
+ c1 = b[off++] & 0xff;
+ rs.push(BASE64_CODE[(c1 >> 2) & 0x3f]);
+ c1 = (c1 & 0x03) << 4;
+ if (off >= len) {
+ rs.push(BASE64_CODE[c1 & 0x3f]);
+ break;
+ }
+ c2 = b[off++] & 0xff;
+ c1 |= (c2 >> 4) & 0x0f;
+ rs.push(BASE64_CODE[c1 & 0x3f]);
+ c1 = (c2 & 0x0f) << 2;
+ if (off >= len) {
+ rs.push(BASE64_CODE[c1 & 0x3f]);
+ break;
+ }
+ c2 = b[off++] & 0xff;
+ c1 |= (c2 >> 6) & 0x03;
+ rs.push(BASE64_CODE[c1 & 0x3f]);
+ rs.push(BASE64_CODE[c2 & 0x3f]);
+ }
+ return rs.join("");
+}
+
+/**
+ * Decodes a base64 encoded string to up to len bytes of output.
+ * @param {string} s String to decode
+ * @param {number} len Maximum output length
+ * @returns {!Array.}
+ * @inner
+ */
+function base64_decode(s, len) {
+ var off = 0,
+ slen = s.length,
+ olen = 0,
+ rs = [],
+ c1,
+ c2,
+ c3,
+ c4,
+ o,
+ code;
+ if (len <= 0) throw Error("Illegal len: " + len);
+ while (off < slen - 1 && olen < len) {
+ code = s.charCodeAt(off++);
+ c1 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1;
+ code = s.charCodeAt(off++);
+ c2 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1;
+ if (c1 == -1 || c2 == -1) break;
+ o = (c1 << 2) >>> 0;
+ o |= (c2 & 0x30) >> 4;
+ rs.push(String.fromCharCode(o));
+ if (++olen >= len || off >= slen) break;
+ code = s.charCodeAt(off++);
+ c3 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1;
+ if (c3 == -1) break;
+ o = ((c2 & 0x0f) << 4) >>> 0;
+ o |= (c3 & 0x3c) >> 2;
+ rs.push(String.fromCharCode(o));
+ if (++olen >= len || off >= slen) break;
+ code = s.charCodeAt(off++);
+ c4 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1;
+ o = ((c3 & 0x03) << 6) >>> 0;
+ o |= c4;
+ rs.push(String.fromCharCode(o));
+ ++olen;
+ }
+ var res = [];
+ for (off = 0; off < olen; off++) res.push(rs[off].charCodeAt(0));
+ return res;
+}
+
+/**
+ * @type {number}
+ * @const
+ * @inner
+ */
+var BCRYPT_SALT_LEN = 16;
+
+/**
+ * @type {number}
+ * @const
+ * @inner
+ */
+var GENSALT_DEFAULT_LOG2_ROUNDS = 10;
+
+/**
+ * @type {number}
+ * @const
+ * @inner
+ */
+var BLOWFISH_NUM_ROUNDS = 16;
+
+/**
+ * @type {number}
+ * @const
+ * @inner
+ */
+var MAX_EXECUTION_TIME = 100;
+
+/**
+ * @type {Array.}
+ * @const
+ * @inner
+ */
+var P_ORIG = [
+ 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0,
+ 0x082efa98, 0xec4e6c89, 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c,
+ 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, 0x9216d5d9, 0x8979fb1b,
+];
+
+/**
+ * @type {Array.}
+ * @const
+ * @inner
+ */
+var S_ORIG = [
+ 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96,
+ 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16,
+ 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, 0x0d95748f, 0x728eb658,
+ 0x718bcd58, 0x82154aee, 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013,
+ 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, 0x8e79dcb0, 0x603a180e,
+ 0x6c9e0e8b, 0xb01e8a3e, 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60,
+ 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, 0x55ca396a, 0x2aab10b6,
+ 0xb4cc5c34, 0x1141e8ce, 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a,
+ 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, 0xafd6ba33, 0x6c24cf5c,
+ 0x7a325381, 0x28958677, 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193,
+ 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, 0xef845d5d, 0xe98575b1,
+ 0xdc262302, 0xeb651b88, 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239,
+ 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, 0x21c66842, 0xf6e96c9a,
+ 0x670c9c61, 0xabd388f0, 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3,
+ 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, 0xa1f1651d, 0x39af0176,
+ 0x66ca593e, 0x82430e88, 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe,
+ 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, 0x4ed3aa62, 0x363f7706,
+ 0x1bfedf72, 0x429b023d, 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b,
+ 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, 0xe3fe501a, 0xb6794c3b,
+ 0x976ce0bd, 0x04c006ba, 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463,
+ 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, 0x6dfc511f, 0x9b30952c,
+ 0xcc814544, 0xaf5ebd09, 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3,
+ 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, 0x5579c0bd, 0x1a60320a,
+ 0xd6a100c6, 0x402c7279, 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8,
+ 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, 0x323db5fa, 0xfd238760,
+ 0x53317b48, 0x3e00df82, 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db,
+ 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, 0x695b27b0, 0xbbca58c8,
+ 0xe1ffa35d, 0xb8f011a0, 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b,
+ 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, 0xe1ddf2da, 0xa4cb7e33,
+ 0x62fb1341, 0xcee4c6e8, 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4,
+ 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, 0xd08ed1d0, 0xafc725e0,
+ 0x8e3c5b2f, 0x8e7594b7, 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c,
+ 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, 0x2f2f2218, 0xbe0e1777,
+ 0xea752dfe, 0x8b021fa1, 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299,
+ 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, 0x165fa266, 0x80957705,
+ 0x93cc7314, 0x211a1477, 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf,
+ 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, 0x00250e2d, 0x2071b35e,
+ 0x226800bb, 0x57b8e0af, 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa,
+ 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, 0x83260376, 0x6295cfa9,
+ 0x11c81968, 0x4e734a41, 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915,
+ 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, 0x08ba6fb5, 0x571be91f,
+ 0xf296ec6b, 0x2a0dd915, 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664,
+ 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a, 0x4b7a70e9, 0xb5b32944,
+ 0xdb75092e, 0xc4192623, 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266,
+ 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, 0x193602a5, 0x75094c29,
+ 0xa0591340, 0xe4183a3e, 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6,
+ 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, 0x4cdd2086, 0x8470eb26,
+ 0x6382e9c6, 0x021ecc5e, 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1,
+ 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, 0x3e07841c, 0x7fdeae5c,
+ 0x8e7d44ec, 0x5716f2b8, 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff,
+ 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, 0xd19113f9, 0x7ca92ff6,
+ 0x94324773, 0x22f54701, 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7,
+ 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, 0xe238cd99, 0x3bea0e2f,
+ 0x3280bba1, 0x183eb331, 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf,
+ 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, 0xde9a771f, 0xd9930810,
+ 0xb38bae12, 0xdccf3f2e, 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87,
+ 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, 0xec7aec3a, 0xdb851dfa,
+ 0x63094366, 0xc464c3d2, 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16,
+ 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, 0x71dff89e, 0x10314e55,
+ 0x81ac77d6, 0x5f11199b, 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509,
+ 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, 0x86e34570, 0xeae96fb1,
+ 0x860e5e0a, 0x5a3e2ab3, 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f,
+ 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, 0xc6150eba, 0x94e2ea78,
+ 0xa5fc3c53, 0x1e0a2df4, 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960,
+ 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, 0xe3bc4595, 0xa67bc883,
+ 0xb17f37d1, 0x018cff28, 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802,
+ 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, 0x1521b628, 0x29076170,
+ 0xecdd4775, 0x619f1510, 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf,
+ 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, 0xeecc86bc, 0x60622ca7,
+ 0x9cab5cab, 0xb2f3846e, 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50,
+ 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, 0x9b540b19, 0x875fa099,
+ 0x95f7997e, 0x623d7da8, 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281,
+ 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, 0x57f584a5, 0x1b227263,
+ 0x9b83c3ff, 0x1ac24696, 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128,
+ 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, 0x5d4a14d9, 0xe864b7e3,
+ 0x42105d14, 0x203e13e0, 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0,
+ 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, 0xd81e799e, 0x86854dc7,
+ 0xe44b476a, 0x3d816250, 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3,
+ 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, 0x095bbf00, 0xad19489d,
+ 0x1462b174, 0x23820e00, 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061,
+ 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, 0x7cde3759, 0xcbee7460,
+ 0x4085f2a7, 0xce77326e, 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735,
+ 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, 0x9e447a2e, 0xc3453484,
+ 0xfdd56705, 0x0e1e9ec9, 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340,
+ 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, 0x153e21e7, 0x8fb03d4a,
+ 0xe6e39f2b, 0xdb83adf7, 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934,
+ 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, 0xd4082471, 0x3320f46a,
+ 0x43b7d4b7, 0x500061af, 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840,
+ 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, 0xbfbc09ec, 0x03bd9785,
+ 0x7fac6dd0, 0x31cb8504, 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a,
+ 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, 0x68dc1462, 0xd7486900,
+ 0x680ec0a4, 0x27a18dee, 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6,
+ 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, 0x20fe9e35, 0xd9f385b9,
+ 0xee39d7ab, 0x3b124e8b, 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2,
+ 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb, 0xfb0af54e, 0xd8feb397,
+ 0x454056ac, 0xba489527, 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b,
+ 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, 0xa62a4a56, 0x3f3125f9,
+ 0x5ef47e1c, 0x9029317c, 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3,
+ 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc, 0x07f9c9ee, 0x41041f0f,
+ 0x404779a4, 0x5d886e17, 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564,
+ 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, 0x0e12b4c2, 0x02e1329e,
+ 0xaf664fd1, 0xcad18115, 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922,
+ 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728, 0xd0127845, 0x95b794fd,
+ 0x647d0862, 0xe7ccf5f0, 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e,
+ 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, 0xa812dc60, 0xa1ebddf8,
+ 0x991be14c, 0xdb6e6b0d, 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804,
+ 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, 0x667b9ffb, 0xcedb7d9c,
+ 0xa091cf0b, 0xd9155ea3, 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb,
+ 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, 0x6842ada7, 0xc66a2b3b,
+ 0x12754ccc, 0x782ef11c, 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350,
+ 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, 0x44421659, 0x0a121386,
+ 0xd90cec6e, 0xd5abea2a, 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe,
+ 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, 0xd1fd8346, 0xf6381fb0,
+ 0x7745ae04, 0xd736fccc, 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f,
+ 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61, 0x4e58f48f, 0xf2ddfda2,
+ 0xf474ef38, 0x8789bdc2, 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9,
+ 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, 0x466e598e, 0x20b45770,
+ 0x8cd55591, 0xc902de4c, 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e,
+ 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633, 0xe85a1f02, 0x09f0be8c,
+ 0x4a99a025, 0x1d6efe10, 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169,
+ 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, 0x50115e01, 0xa70683fa,
+ 0xa002b5c4, 0x0de6d027, 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5,
+ 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62, 0x11e69ed7, 0x2338ea63,
+ 0x53c2dd94, 0xc2c21634, 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76,
+ 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, 0x86e3725f, 0x724d9db9,
+ 0x1ac15bb4, 0xd39eb8fc, 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4,
+ 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, 0x6fd5c7e7, 0x56e14ec4,
+ 0x362abfce, 0xddc6c837, 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0,
+ 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742,
+ 0xd3822740, 0x99bc9bbe, 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b,
+ 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, 0x5748ab2f, 0xbc946e79,
+ 0xc6a376d2, 0x6549c2c8, 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6,
+ 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, 0xa1fad5f0, 0x6a2d519a,
+ 0x63ef8ce2, 0x9a86ee22, 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4,
+ 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, 0x2826a2f9, 0xa73a3ae1,
+ 0x4ba99586, 0xef5562e9, 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59,
+ 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, 0xe990fd5a, 0x9e34d797,
+ 0x2cf0b7d9, 0x022b8b51, 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28,
+ 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, 0xe029ac71, 0xe019a5e6,
+ 0x47b0acfd, 0xed93fa9b, 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28,
+ 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, 0x15056dd4, 0x88f46dba,
+ 0x03a16125, 0x0564f0bd, 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a,
+ 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, 0x7533d928, 0xb155fdf5,
+ 0x03563482, 0x8aba3cbb, 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f,
+ 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, 0xea7a90c2, 0xfb3e7bce,
+ 0x5121ce64, 0x774fbe32, 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680,
+ 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, 0xb39a460a, 0x6445c0dd,
+ 0x586cdecf, 0x1c20c8ae, 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb,
+ 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, 0x72eacea8, 0xfa6484bb,
+ 0x8d6612ae, 0xbf3c6f47, 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370,
+ 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, 0x4040cb08, 0x4eb4e2cc,
+ 0x34d2466a, 0x0115af84, 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048,
+ 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, 0x611560b1, 0xe7933fdc,
+ 0xbb3a792b, 0x344525bd, 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9,
+ 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, 0x1a908749, 0xd44fbd9a,
+ 0xd0dadecb, 0xd50ada38, 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f,
+ 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, 0xbf97222c, 0x15e6fc2a,
+ 0x0f91fc71, 0x9b941525, 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1,
+ 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, 0xe0ec6e0e, 0x1698db3b,
+ 0x4c98a0be, 0x3278e964, 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e,
+ 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, 0xdf359f8d, 0x9b992f2e,
+ 0xe60b6f47, 0x0fe3f11d, 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f,
+ 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, 0xf523f357, 0xa6327623,
+ 0x93a83531, 0x56cccd02, 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc,
+ 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, 0xe6c6c7bd, 0x327a140a,
+ 0x45e1d006, 0xc3f27b9a, 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6,
+ 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, 0x53113ec0, 0x1640e3d3,
+ 0x38abbd60, 0x2547adf0, 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060,
+ 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, 0x1948c25c, 0x02fb8a8c,
+ 0x01c36ae4, 0xd6ebe1f9, 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f,
+ 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6,
+];
+
+/**
+ * @type {Array.}
+ * @const
+ * @inner
+ */
+var C_ORIG = [
+ 0x4f727068, 0x65616e42, 0x65686f6c, 0x64657253, 0x63727944, 0x6f756274,
+];
+
+/**
+ * @param {Array.} lr
+ * @param {number} off
+ * @param {Array.} P
+ * @param {Array.} S
+ * @returns {Array.}
+ * @inner
+ */
+function _encipher(lr, off, P, S) {
+ // This is our bottleneck: 1714/1905 ticks / 90% - see profile.txt
+ var n,
+ l = lr[off],
+ r = lr[off + 1];
+
+ l ^= P[0];
+
+ /*
+ for (var i=0, k=BLOWFISH_NUM_ROUNDS-2; i<=k;)
+ // Feistel substitution on left word
+ n = S[l >>> 24],
+ n += S[0x100 | ((l >> 16) & 0xff)],
+ n ^= S[0x200 | ((l >> 8) & 0xff)],
+ n += S[0x300 | (l & 0xff)],
+ r ^= n ^ P[++i],
+ // Feistel substitution on right word
+ n = S[r >>> 24],
+ n += S[0x100 | ((r >> 16) & 0xff)],
+ n ^= S[0x200 | ((r >> 8) & 0xff)],
+ n += S[0x300 | (r & 0xff)],
+ l ^= n ^ P[++i];
+ */
+
+ //The following is an unrolled version of the above loop.
+ //Iteration 0
+ n = S[l >>> 24];
+ n += S[0x100 | ((l >> 16) & 0xff)];
+ n ^= S[0x200 | ((l >> 8) & 0xff)];
+ n += S[0x300 | (l & 0xff)];
+ r ^= n ^ P[1];
+ n = S[r >>> 24];
+ n += S[0x100 | ((r >> 16) & 0xff)];
+ n ^= S[0x200 | ((r >> 8) & 0xff)];
+ n += S[0x300 | (r & 0xff)];
+ l ^= n ^ P[2];
+ //Iteration 1
+ n = S[l >>> 24];
+ n += S[0x100 | ((l >> 16) & 0xff)];
+ n ^= S[0x200 | ((l >> 8) & 0xff)];
+ n += S[0x300 | (l & 0xff)];
+ r ^= n ^ P[3];
+ n = S[r >>> 24];
+ n += S[0x100 | ((r >> 16) & 0xff)];
+ n ^= S[0x200 | ((r >> 8) & 0xff)];
+ n += S[0x300 | (r & 0xff)];
+ l ^= n ^ P[4];
+ //Iteration 2
+ n = S[l >>> 24];
+ n += S[0x100 | ((l >> 16) & 0xff)];
+ n ^= S[0x200 | ((l >> 8) & 0xff)];
+ n += S[0x300 | (l & 0xff)];
+ r ^= n ^ P[5];
+ n = S[r >>> 24];
+ n += S[0x100 | ((r >> 16) & 0xff)];
+ n ^= S[0x200 | ((r >> 8) & 0xff)];
+ n += S[0x300 | (r & 0xff)];
+ l ^= n ^ P[6];
+ //Iteration 3
+ n = S[l >>> 24];
+ n += S[0x100 | ((l >> 16) & 0xff)];
+ n ^= S[0x200 | ((l >> 8) & 0xff)];
+ n += S[0x300 | (l & 0xff)];
+ r ^= n ^ P[7];
+ n = S[r >>> 24];
+ n += S[0x100 | ((r >> 16) & 0xff)];
+ n ^= S[0x200 | ((r >> 8) & 0xff)];
+ n += S[0x300 | (r & 0xff)];
+ l ^= n ^ P[8];
+ //Iteration 4
+ n = S[l >>> 24];
+ n += S[0x100 | ((l >> 16) & 0xff)];
+ n ^= S[0x200 | ((l >> 8) & 0xff)];
+ n += S[0x300 | (l & 0xff)];
+ r ^= n ^ P[9];
+ n = S[r >>> 24];
+ n += S[0x100 | ((r >> 16) & 0xff)];
+ n ^= S[0x200 | ((r >> 8) & 0xff)];
+ n += S[0x300 | (r & 0xff)];
+ l ^= n ^ P[10];
+ //Iteration 5
+ n = S[l >>> 24];
+ n += S[0x100 | ((l >> 16) & 0xff)];
+ n ^= S[0x200 | ((l >> 8) & 0xff)];
+ n += S[0x300 | (l & 0xff)];
+ r ^= n ^ P[11];
+ n = S[r >>> 24];
+ n += S[0x100 | ((r >> 16) & 0xff)];
+ n ^= S[0x200 | ((r >> 8) & 0xff)];
+ n += S[0x300 | (r & 0xff)];
+ l ^= n ^ P[12];
+ //Iteration 6
+ n = S[l >>> 24];
+ n += S[0x100 | ((l >> 16) & 0xff)];
+ n ^= S[0x200 | ((l >> 8) & 0xff)];
+ n += S[0x300 | (l & 0xff)];
+ r ^= n ^ P[13];
+ n = S[r >>> 24];
+ n += S[0x100 | ((r >> 16) & 0xff)];
+ n ^= S[0x200 | ((r >> 8) & 0xff)];
+ n += S[0x300 | (r & 0xff)];
+ l ^= n ^ P[14];
+ //Iteration 7
+ n = S[l >>> 24];
+ n += S[0x100 | ((l >> 16) & 0xff)];
+ n ^= S[0x200 | ((l >> 8) & 0xff)];
+ n += S[0x300 | (l & 0xff)];
+ r ^= n ^ P[15];
+ n = S[r >>> 24];
+ n += S[0x100 | ((r >> 16) & 0xff)];
+ n ^= S[0x200 | ((r >> 8) & 0xff)];
+ n += S[0x300 | (r & 0xff)];
+ l ^= n ^ P[16];
+
+ lr[off] = r ^ P[BLOWFISH_NUM_ROUNDS + 1];
+ lr[off + 1] = l;
+ return lr;
+}
+
+/**
+ * @param {Array.} data
+ * @param {number} offp
+ * @returns {{key: number, offp: number}}
+ * @inner
+ */
+function _streamtoword(data, offp) {
+ for (var i = 0, word = 0; i < 4; ++i)
+ (word = (word << 8) | (data[offp] & 0xff)),
+ (offp = (offp + 1) % data.length);
+ return { key: word, offp: offp };
+}
+
+/**
+ * @param {Array.} key
+ * @param {Array.} P
+ * @param {Array.} S
+ * @inner
+ */
+function _key(key, P, S) {
+ var offset = 0,
+ lr = [0, 0],
+ plen = P.length,
+ slen = S.length,
+ sw;
+ for (var i = 0; i < plen; i++)
+ (sw = _streamtoword(key, offset)),
+ (offset = sw.offp),
+ (P[i] = P[i] ^ sw.key);
+ for (i = 0; i < plen; i += 2)
+ (lr = _encipher(lr, 0, P, S)), (P[i] = lr[0]), (P[i + 1] = lr[1]);
+ for (i = 0; i < slen; i += 2)
+ (lr = _encipher(lr, 0, P, S)), (S[i] = lr[0]), (S[i + 1] = lr[1]);
+}
+
+/**
+ * Expensive key schedule Blowfish.
+ * @param {Array.} data
+ * @param {Array.} key
+ * @param {Array.} P
+ * @param {Array.} S
+ * @inner
+ */
+function _ekskey(data, key, P, S) {
+ var offp = 0,
+ lr = [0, 0],
+ plen = P.length,
+ slen = S.length,
+ sw;
+ for (var i = 0; i < plen; i++)
+ (sw = _streamtoword(key, offp)), (offp = sw.offp), (P[i] = P[i] ^ sw.key);
+ offp = 0;
+ for (i = 0; i < plen; i += 2)
+ (sw = _streamtoword(data, offp)),
+ (offp = sw.offp),
+ (lr[0] ^= sw.key),
+ (sw = _streamtoword(data, offp)),
+ (offp = sw.offp),
+ (lr[1] ^= sw.key),
+ (lr = _encipher(lr, 0, P, S)),
+ (P[i] = lr[0]),
+ (P[i + 1] = lr[1]);
+ for (i = 0; i < slen; i += 2)
+ (sw = _streamtoword(data, offp)),
+ (offp = sw.offp),
+ (lr[0] ^= sw.key),
+ (sw = _streamtoword(data, offp)),
+ (offp = sw.offp),
+ (lr[1] ^= sw.key),
+ (lr = _encipher(lr, 0, P, S)),
+ (S[i] = lr[0]),
+ (S[i + 1] = lr[1]);
+}
+
+/**
+ * Internaly crypts a string.
+ * @param {Array.} b Bytes to crypt
+ * @param {Array.} salt Salt bytes to use
+ * @param {number} rounds Number of rounds
+ * @param {function(Error, Array.=)=} callback Callback receiving the error, if any, and the resulting bytes. If
+ * omitted, the operation will be performed synchronously.
+ * @param {function(number)=} progressCallback Callback called with the current progress
+ * @returns {!Array.|undefined} Resulting bytes if callback has been omitted, otherwise `undefined`
+ * @inner
+ */
+function _crypt(b, salt, rounds, callback, progressCallback) {
+ var cdata = C_ORIG.slice(),
+ clen = cdata.length,
+ err;
+
+ // Validate
+ if (rounds < 4 || rounds > 31) {
+ err = Error("Illegal number of rounds (4-31): " + rounds);
+ if (callback) {
+ nextTick(callback.bind(this, err));
+ return;
+ } else throw err;
+ }
+ if (salt.length !== BCRYPT_SALT_LEN) {
+ err = Error(
+ "Illegal salt length: " + salt.length + " != " + BCRYPT_SALT_LEN,
+ );
+ if (callback) {
+ nextTick(callback.bind(this, err));
+ return;
+ } else throw err;
+ }
+ rounds = (1 << rounds) >>> 0;
+
+ var P,
+ S,
+ i = 0,
+ j;
+
+ //Use typed arrays when available - huge speedup!
+ if (typeof Int32Array === "function") {
+ P = new Int32Array(P_ORIG);
+ S = new Int32Array(S_ORIG);
+ } else {
+ P = P_ORIG.slice();
+ S = S_ORIG.slice();
+ }
+
+ _ekskey(salt, b, P, S);
+
+ /**
+ * Calcualtes the next round.
+ * @returns {Array.|undefined} Resulting array if callback has been omitted, otherwise `undefined`
+ * @inner
+ */
+ function next() {
+ if (progressCallback) progressCallback(i / rounds);
+ if (i < rounds) {
+ var start = Date.now();
+ for (; i < rounds; ) {
+ i = i + 1;
+ _key(b, P, S);
+ _key(salt, P, S);
+ if (Date.now() - start > MAX_EXECUTION_TIME) break;
+ }
+ } else {
+ for (i = 0; i < 64; i++)
+ for (j = 0; j < clen >> 1; j++) _encipher(cdata, j << 1, P, S);
+ var ret = [];
+ for (i = 0; i < clen; i++)
+ ret.push(((cdata[i] >> 24) & 0xff) >>> 0),
+ ret.push(((cdata[i] >> 16) & 0xff) >>> 0),
+ ret.push(((cdata[i] >> 8) & 0xff) >>> 0),
+ ret.push((cdata[i] & 0xff) >>> 0);
+ if (callback) {
+ callback(null, ret);
+ return;
+ } else return ret;
+ }
+ if (callback) nextTick(next);
+ }
+
+ // Async
+ if (typeof callback !== "undefined") {
+ next();
+
+ // Sync
+ } else {
+ var res;
+ while (true) if (typeof (res = next()) !== "undefined") return res || [];
+ }
+}
+
+/**
+ * Internally hashes a password.
+ * @param {string} password Password to hash
+ * @param {?string} salt Salt to use, actually never null
+ * @param {function(Error, string=)=} callback Callback receiving the error, if any, and the resulting hash. If omitted,
+ * hashing is performed synchronously.
+ * @param {function(number)=} progressCallback Callback called with the current progress
+ * @returns {string|undefined} Resulting hash if callback has been omitted, otherwise `undefined`
+ * @inner
+ */
+function _hash(password, salt, callback, progressCallback) {
+ var err;
+ if (typeof password !== "string" || typeof salt !== "string") {
+ err = Error("Invalid string / salt: Not a string");
+ if (callback) {
+ nextTick(callback.bind(this, err));
+ return;
+ } else throw err;
+ }
+
+ // Validate the salt
+ var minor, offset;
+ if (salt.charAt(0) !== "$" || salt.charAt(1) !== "2") {
+ err = Error("Invalid salt version: " + salt.substring(0, 2));
+ if (callback) {
+ nextTick(callback.bind(this, err));
+ return;
+ } else throw err;
+ }
+ if (salt.charAt(2) === "$") (minor = String.fromCharCode(0)), (offset = 3);
+ else {
+ minor = salt.charAt(2);
+ if (
+ (minor !== "a" && minor !== "b" && minor !== "y") ||
+ salt.charAt(3) !== "$"
+ ) {
+ err = Error("Invalid salt revision: " + salt.substring(2, 4));
+ if (callback) {
+ nextTick(callback.bind(this, err));
+ return;
+ } else throw err;
+ }
+ offset = 4;
+ }
+
+ // Extract number of rounds
+ if (salt.charAt(offset + 2) > "$") {
+ err = Error("Missing salt rounds");
+ if (callback) {
+ nextTick(callback.bind(this, err));
+ return;
+ } else throw err;
+ }
+ var r1 = parseInt(salt.substring(offset, offset + 1), 10) * 10,
+ r2 = parseInt(salt.substring(offset + 1, offset + 2), 10),
+ rounds = r1 + r2,
+ real_salt = salt.substring(offset + 3, offset + 25);
+ password += minor >= "a" ? "\x00" : "";
+
+ var passwordb = utf8Array(password),
+ saltb = base64_decode(real_salt, BCRYPT_SALT_LEN);
+
+ /**
+ * Finishes hashing.
+ * @param {Array.} bytes Byte array
+ * @returns {string}
+ * @inner
+ */
+ function finish(bytes) {
+ var res = [];
+ res.push("$2");
+ if (minor >= "a") res.push(minor);
+ res.push("$");
+ if (rounds < 10) res.push("0");
+ res.push(rounds.toString());
+ res.push("$");
+ res.push(base64_encode(saltb, saltb.length));
+ res.push(base64_encode(bytes, C_ORIG.length * 4 - 1));
+ return res.join("");
+ }
+
+ // Sync
+ if (typeof callback == "undefined")
+ return finish(_crypt(passwordb, saltb, rounds));
+ // Async
+ else {
+ _crypt(
+ passwordb,
+ saltb,
+ rounds,
+ function (err, bytes) {
+ if (err) callback(err, null);
+ else callback(null, finish(bytes));
+ },
+ progressCallback,
+ );
+ }
+}
+
+/**
+ * Encodes a byte array to base64 with up to len bytes of input, using the custom bcrypt alphabet.
+ * @function
+ * @param {!Array.} bytes Byte array
+ * @param {number} length Maximum input length
+ * @returns {string}
+ */
+export function encodeBase64(bytes, length) {
+ return base64_encode(bytes, length);
+}
+
+/**
+ * Decodes a base64 encoded string to up to len bytes of output, using the custom bcrypt alphabet.
+ * @function
+ * @param {string} string String to decode
+ * @param {number} length Maximum output length
+ * @returns {!Array.}
+ */
+export function decodeBase64(string, length) {
+ return base64_decode(string, length);
+}
+
+export default {
+ setRandomFallback,
+ genSaltSync,
+ genSalt,
+ hashSync,
+ hash,
+ compareSync,
+ compare,
+ getRounds,
+ getSalt,
+ truncates,
+ encodeBase64,
+ decodeBase64,
+};
diff --git a/node_modules/bcryptjs/package.json b/node_modules/bcryptjs/package.json
new file mode 100644
index 00000000..8b3ddb44
--- /dev/null
+++ b/node_modules/bcryptjs/package.json
@@ -0,0 +1,76 @@
+{
+ "name": "bcryptjs",
+ "description": "Optimized bcrypt in plain JavaScript with zero dependencies, with TypeScript support. Compatible to 'bcrypt'.",
+ "version": "3.0.3",
+ "author": "Daniel Wirtz ",
+ "contributors": [
+ "Shane Girish (https://github.com/shaneGirish)",
+ "Alex Murray <> (https://github.com/alexmurray)",
+ "Nicolas Pelletier <> (https://github.com/NicolasPelletier)",
+ "Josh Rogers <> (https://github.com/geekymole)",
+ "Noah Isaacson (https://github.com/nisaacson)"
+ ],
+ "repository": {
+ "type": "url",
+ "url": "https://github.com/dcodeIO/bcrypt.js.git"
+ },
+ "bugs": {
+ "url": "https://github.com/dcodeIO/bcrypt.js/issues"
+ },
+ "keywords": [
+ "bcrypt",
+ "password",
+ "auth",
+ "authentication",
+ "encryption",
+ "crypt",
+ "crypto"
+ ],
+ "type": "module",
+ "main": "umd/index.js",
+ "types": "umd/index.d.ts",
+ "exports": {
+ ".": {
+ "import": {
+ "types": "./index.d.ts",
+ "default": "./index.js"
+ },
+ "require": {
+ "types": "./umd/index.d.ts",
+ "default": "./umd/index.js"
+ }
+ }
+ },
+ "bin": {
+ "bcrypt": "bin/bcrypt"
+ },
+ "license": "BSD-3-Clause",
+ "scripts": {
+ "build": "node scripts/build.js",
+ "lint": "prettier --check .",
+ "format": "prettier --write .",
+ "test": "npm run test:unit && npm run test:typescript",
+ "test:unit": "node tests",
+ "test:typescript": "tsc --project tests/typescript/tsconfig.esnext.json && tsc --project tests/typescript/tsconfig.nodenext.json && tsc --project tests/typescript/tsconfig.commonjs.json && tsc --project tests/typescript/tsconfig.global.json"
+ },
+ "files": [
+ "index.js",
+ "index.d.ts",
+ "types.d.ts",
+ "umd/index.js",
+ "umd/index.d.ts",
+ "umd/types.d.ts",
+ "umd/package.json",
+ "LICENSE",
+ "README.md"
+ ],
+ "browser": {
+ "crypto": false
+ },
+ "devDependencies": {
+ "bcrypt": "^5.1.1",
+ "esm2umd": "^0.3.1",
+ "prettier": "^3.5.0",
+ "typescript": "^5.7.3"
+ }
+}
diff --git a/node_modules/bcryptjs/types.d.ts b/node_modules/bcryptjs/types.d.ts
new file mode 100644
index 00000000..3cbe5b16
--- /dev/null
+++ b/node_modules/bcryptjs/types.d.ts
@@ -0,0 +1,157 @@
+// Originally imported from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/8b36dbdf95b624b8a7cd7f8416f06c15d274f9e6/types/bcryptjs/index.d.ts
+// MIT license.
+
+/** Called with an error on failure or a value of type `T` upon success. */
+type Callback = (err: Error | null, result?: T) => void;
+/** Called with the percentage of rounds completed (0.0 - 1.0), maximally once per `MAX_EXECUTION_TIME = 100` ms. */
+type ProgressCallback = (percentage: number) => void;
+/** Called to obtain random bytes when both Web Crypto API and Node.js crypto are not available. */
+type RandomFallback = (length: number) => number[];
+
+/**
+ * Sets the pseudo random number generator to use as a fallback if neither node's crypto module nor the Web Crypto API is available.
+ * Please note: It is highly important that the PRNG used is cryptographically secure and that it is seeded properly!
+ * @param random Function taking the number of bytes to generate as its sole argument, returning the corresponding array of cryptographically secure random byte values.
+ */
+export declare function setRandomFallback(random: RandomFallback): void;
+
+/**
+ * Synchronously generates a salt.
+ * @param rounds Number of rounds to use, defaults to 10 if omitted
+ * @return Resulting salt
+ * @throws If a random fallback is required but not set
+ */
+export declare function genSaltSync(rounds?: number): string;
+
+/**
+ * Asynchronously generates a salt.
+ * @param rounds Number of rounds to use, defaults to 10 if omitted
+ * @return Promise with resulting salt, if callback has been omitted
+ */
+export declare function genSalt(rounds?: number): Promise;
+
+/**
+ * Asynchronously generates a salt.
+ * @param callback Callback receiving the error, if any, and the resulting salt
+ */
+export declare function genSalt(callback: Callback): void;
+
+/**
+ * Asynchronously generates a salt.
+ * @param rounds Number of rounds to use, defaults to 10 if omitted
+ * @param callback Callback receiving the error, if any, and the resulting salt
+ */
+export declare function genSalt(
+ rounds: number,
+ callback: Callback,
+): void;
+
+/**
+ * Synchronously generates a hash for the given password.
+ * @param password Password to hash
+ * @param salt Salt length to generate or salt to use, default to 10
+ * @return Resulting hash
+ */
+export declare function hashSync(
+ password: string,
+ salt?: number | string,
+): string;
+
+/**
+ * Asynchronously generates a hash for the given password.
+ * @param password Password to hash
+ * @param salt Salt length to generate or salt to use
+ * @return Promise with resulting hash, if callback has been omitted
+ */
+export declare function hash(
+ password: string,
+ salt: number | string,
+): Promise;
+
+/**
+ * Asynchronously generates a hash for the given password.
+ * @param password Password to hash
+ * @param salt Salt length to generate or salt to use
+ * @param callback Callback receiving the error, if any, and the resulting hash
+ * @param progressCallback Callback successively called with the percentage of rounds completed (0.0 - 1.0), maximally once per MAX_EXECUTION_TIME = 100 ms.
+ */
+export declare function hash(
+ password: string,
+ salt: number | string,
+ callback?: Callback,
+ progressCallback?: ProgressCallback,
+): void;
+
+/**
+ * Synchronously tests a password against a hash.
+ * @param password Password to test
+ * @param hash Hash to test against
+ * @return true if matching, otherwise false
+ */
+export declare function compareSync(password: string, hash: string): boolean;
+
+/**
+ * Asynchronously tests a password against a hash.
+ * @param password Password to test
+ * @param hash Hash to test against
+ * @return Promise, if callback has been omitted
+ */
+export declare function compare(
+ password: string,
+ hash: string,
+): Promise;
+
+/**
+ * Asynchronously tests a password against a hash.
+ * @param password Password to test
+ * @param hash Hash to test against
+ * @param callback Callback receiving the error, if any, otherwise the result
+ * @param progressCallback Callback successively called with the percentage of rounds completed (0.0 - 1.0), maximally once per MAX_EXECUTION_TIME = 100 ms.
+ */
+export declare function compare(
+ password: string,
+ hash: string,
+ callback?: Callback,
+ progressCallback?: ProgressCallback,
+): void;
+
+/**
+ * Gets the number of rounds used to encrypt the specified hash.
+ * @param hash Hash to extract the used number of rounds from
+ * @return Number of rounds used
+ */
+export declare function getRounds(hash: string): number;
+
+/**
+ * Gets the salt portion from a hash. Does not validate the hash.
+ * @param hash Hash to extract the salt from
+ * @return Extracted salt part
+ */
+export declare function getSalt(hash: string): string;
+
+/**
+ * Tests if a password will be truncated when hashed, that is its length is
+ * greater than 72 bytes when converted to UTF-8.
+ * @param password The password to test
+ * @returns `true` if truncated, otherwise `false`
+ */
+export declare function truncates(password: string): boolean;
+
+/**
+ * Encodes a byte array to base64 with up to len bytes of input, using the custom bcrypt alphabet.
+ * @function
+ * @param b Byte array
+ * @param len Maximum input length
+ */
+export declare function encodeBase64(
+ b: Readonly>,
+ len: number,
+): string;
+
+/**
+ * Decodes a base64 encoded string to up to len bytes of output, using the custom bcrypt alphabet.
+ * @function
+ * @param s String to decode
+ * @param len Maximum output length
+ */
+export declare function decodeBase64(s: string, len: number): number[];
diff --git a/node_modules/bcryptjs/umd/index.d.ts b/node_modules/bcryptjs/umd/index.d.ts
new file mode 100644
index 00000000..8c2eb070
--- /dev/null
+++ b/node_modules/bcryptjs/umd/index.d.ts
@@ -0,0 +1,3 @@
+import * as bcrypt from "./types.js";
+export = bcrypt;
+export as namespace bcrypt;
diff --git a/node_modules/bcryptjs/umd/index.js b/node_modules/bcryptjs/umd/index.js
new file mode 100644
index 00000000..517ea20d
--- /dev/null
+++ b/node_modules/bcryptjs/umd/index.js
@@ -0,0 +1,1220 @@
+// GENERATED FILE. DO NOT EDIT.
+(function (global, factory) {
+ function preferDefault(exports) {
+ return exports.default || exports;
+ }
+ if (typeof define === "function" && define.amd) {
+ define(["crypto"], function (_crypto) {
+ var exports = {};
+ factory(exports, _crypto);
+ return preferDefault(exports);
+ });
+ } else if (typeof exports === "object") {
+ factory(exports, require("crypto"));
+ if (typeof module === "object") module.exports = preferDefault(exports);
+ } else {
+ (function () {
+ var exports = {};
+ factory(exports, global.crypto);
+ global.bcrypt = preferDefault(exports);
+ })();
+ }
+})(
+ typeof globalThis !== "undefined"
+ ? globalThis
+ : typeof self !== "undefined"
+ ? self
+ : this,
+ function (_exports, _crypto) {
+ "use strict";
+
+ Object.defineProperty(_exports, "__esModule", {
+ value: true,
+ });
+ _exports.compare = compare;
+ _exports.compareSync = compareSync;
+ _exports.decodeBase64 = decodeBase64;
+ _exports.default = void 0;
+ _exports.encodeBase64 = encodeBase64;
+ _exports.genSalt = genSalt;
+ _exports.genSaltSync = genSaltSync;
+ _exports.getRounds = getRounds;
+ _exports.getSalt = getSalt;
+ _exports.hash = hash;
+ _exports.hashSync = hashSync;
+ _exports.setRandomFallback = setRandomFallback;
+ _exports.truncates = truncates;
+ _crypto = _interopRequireDefault(_crypto);
+ function _interopRequireDefault(e) {
+ return e && e.__esModule ? e : { default: e };
+ }
+ /*
+ Copyright (c) 2012 Nevins Bartolomeo
+ Copyright (c) 2012 Shane Girish
+ Copyright (c) 2025 Daniel Wirtz
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+ // The Node.js crypto module is used as a fallback for the Web Crypto API. When
+ // building for the browser, inclusion of the crypto module should be disabled,
+ // which the package hints at in its package.json for bundlers that support it.
+
+ /**
+ * The random implementation to use as a fallback.
+ * @type {?function(number):!Array.}
+ * @inner
+ */
+ var randomFallback = null;
+
+ /**
+ * Generates cryptographically secure random bytes.
+ * @function
+ * @param {number} len Bytes length
+ * @returns {!Array.} Random bytes
+ * @throws {Error} If no random implementation is available
+ * @inner
+ */
+ function randomBytes(len) {
+ // Web Crypto API. Globally available in the browser and in Node.js >=23.
+ try {
+ return crypto.getRandomValues(new Uint8Array(len));
+ } catch {}
+ // Node.js crypto module for non-browser environments.
+ try {
+ return _crypto.default.randomBytes(len);
+ } catch {}
+ // Custom fallback specified with `setRandomFallback`.
+ if (!randomFallback) {
+ throw Error(
+ "Neither WebCryptoAPI nor a crypto module is available. Use bcrypt.setRandomFallback to set an alternative",
+ );
+ }
+ return randomFallback(len);
+ }
+
+ /**
+ * Sets the pseudo random number generator to use as a fallback if neither node's `crypto` module nor the Web Crypto
+ * API is available. Please note: It is highly important that the PRNG used is cryptographically secure and that it
+ * is seeded properly!
+ * @param {?function(number):!Array.} random Function taking the number of bytes to generate as its
+ * sole argument, returning the corresponding array of cryptographically secure random byte values.
+ * @see http://nodejs.org/api/crypto.html
+ * @see http://www.w3.org/TR/WebCryptoAPI/
+ */
+ function setRandomFallback(random) {
+ randomFallback = random;
+ }
+
+ /**
+ * Synchronously generates a salt.
+ * @param {number=} rounds Number of rounds to use, defaults to 10 if omitted
+ * @param {number=} seed_length Not supported.
+ * @returns {string} Resulting salt
+ * @throws {Error} If a random fallback is required but not set
+ */
+ function genSaltSync(rounds, seed_length) {
+ rounds = rounds || GENSALT_DEFAULT_LOG2_ROUNDS;
+ if (typeof rounds !== "number")
+ throw Error(
+ "Illegal arguments: " + typeof rounds + ", " + typeof seed_length,
+ );
+ if (rounds < 4) rounds = 4;
+ else if (rounds > 31) rounds = 31;
+ var salt = [];
+ salt.push("$2b$");
+ if (rounds < 10) salt.push("0");
+ salt.push(rounds.toString());
+ salt.push("$");
+ salt.push(base64_encode(randomBytes(BCRYPT_SALT_LEN), BCRYPT_SALT_LEN)); // May throw
+ return salt.join("");
+ }
+
+ /**
+ * Asynchronously generates a salt.
+ * @param {(number|function(Error, string=))=} rounds Number of rounds to use, defaults to 10 if omitted
+ * @param {(number|function(Error, string=))=} seed_length Not supported.
+ * @param {function(Error, string=)=} callback Callback receiving the error, if any, and the resulting salt
+ * @returns {!Promise} If `callback` has been omitted
+ * @throws {Error} If `callback` is present but not a function
+ */
+ function genSalt(rounds, seed_length, callback) {
+ if (typeof seed_length === "function")
+ (callback = seed_length), (seed_length = undefined); // Not supported.
+ if (typeof rounds === "function")
+ (callback = rounds), (rounds = undefined);
+ if (typeof rounds === "undefined") rounds = GENSALT_DEFAULT_LOG2_ROUNDS;
+ else if (typeof rounds !== "number")
+ throw Error("illegal arguments: " + typeof rounds);
+ function _async(callback) {
+ nextTick(function () {
+ // Pretty thin, but salting is fast enough
+ try {
+ callback(null, genSaltSync(rounds));
+ } catch (err) {
+ callback(err);
+ }
+ });
+ }
+ if (callback) {
+ if (typeof callback !== "function")
+ throw Error("Illegal callback: " + typeof callback);
+ _async(callback);
+ } else
+ return new Promise(function (resolve, reject) {
+ _async(function (err, res) {
+ if (err) {
+ reject(err);
+ return;
+ }
+ resolve(res);
+ });
+ });
+ }
+
+ /**
+ * Synchronously generates a hash for the given password.
+ * @param {string} password Password to hash
+ * @param {(number|string)=} salt Salt length to generate or salt to use, default to 10
+ * @returns {string} Resulting hash
+ */
+ function hashSync(password, salt) {
+ if (typeof salt === "undefined") salt = GENSALT_DEFAULT_LOG2_ROUNDS;
+ if (typeof salt === "number") salt = genSaltSync(salt);
+ if (typeof password !== "string" || typeof salt !== "string")
+ throw Error(
+ "Illegal arguments: " + typeof password + ", " + typeof salt,
+ );
+ return _hash(password, salt);
+ }
+
+ /**
+ * Asynchronously generates a hash for the given password.
+ * @param {string} password Password to hash
+ * @param {number|string} salt Salt length to generate or salt to use
+ * @param {function(Error, string=)=} callback Callback receiving the error, if any, and the resulting hash
+ * @param {function(number)=} progressCallback Callback successively called with the percentage of rounds completed
+ * (0.0 - 1.0), maximally once per `MAX_EXECUTION_TIME = 100` ms.
+ * @returns {!Promise} If `callback` has been omitted
+ * @throws {Error} If `callback` is present but not a function
+ */
+ function hash(password, salt, callback, progressCallback) {
+ function _async(callback) {
+ if (typeof password === "string" && typeof salt === "number")
+ genSalt(salt, function (err, salt) {
+ _hash(password, salt, callback, progressCallback);
+ });
+ else if (typeof password === "string" && typeof salt === "string")
+ _hash(password, salt, callback, progressCallback);
+ else
+ nextTick(
+ callback.bind(
+ this,
+ Error(
+ "Illegal arguments: " + typeof password + ", " + typeof salt,
+ ),
+ ),
+ );
+ }
+ if (callback) {
+ if (typeof callback !== "function")
+ throw Error("Illegal callback: " + typeof callback);
+ _async(callback);
+ } else
+ return new Promise(function (resolve, reject) {
+ _async(function (err, res) {
+ if (err) {
+ reject(err);
+ return;
+ }
+ resolve(res);
+ });
+ });
+ }
+
+ /**
+ * Compares two strings of the same length in constant time.
+ * @param {string} known Must be of the correct length
+ * @param {string} unknown Must be the same length as `known`
+ * @returns {boolean}
+ * @inner
+ */
+ function safeStringCompare(known, unknown) {
+ var diff = known.length ^ unknown.length;
+ for (var i = 0; i < known.length; ++i) {
+ diff |= known.charCodeAt(i) ^ unknown.charCodeAt(i);
+ }
+ return diff === 0;
+ }
+
+ /**
+ * Synchronously tests a password against a hash.
+ * @param {string} password Password to compare
+ * @param {string} hash Hash to test against
+ * @returns {boolean} true if matching, otherwise false
+ * @throws {Error} If an argument is illegal
+ */
+ function compareSync(password, hash) {
+ if (typeof password !== "string" || typeof hash !== "string")
+ throw Error(
+ "Illegal arguments: " + typeof password + ", " + typeof hash,
+ );
+ if (hash.length !== 60) return false;
+ return safeStringCompare(
+ hashSync(password, hash.substring(0, hash.length - 31)),
+ hash,
+ );
+ }
+
+ /**
+ * Asynchronously tests a password against a hash.
+ * @param {string} password Password to compare
+ * @param {string} hashValue Hash to test against
+ * @param {function(Error, boolean)=} callback Callback receiving the error, if any, otherwise the result
+ * @param {function(number)=} progressCallback Callback successively called with the percentage of rounds completed
+ * (0.0 - 1.0), maximally once per `MAX_EXECUTION_TIME = 100` ms.
+ * @returns {!Promise} If `callback` has been omitted
+ * @throws {Error} If `callback` is present but not a function
+ */
+ function compare(password, hashValue, callback, progressCallback) {
+ function _async(callback) {
+ if (typeof password !== "string" || typeof hashValue !== "string") {
+ nextTick(
+ callback.bind(
+ this,
+ Error(
+ "Illegal arguments: " +
+ typeof password +
+ ", " +
+ typeof hashValue,
+ ),
+ ),
+ );
+ return;
+ }
+ if (hashValue.length !== 60) {
+ nextTick(callback.bind(this, null, false));
+ return;
+ }
+ hash(
+ password,
+ hashValue.substring(0, 29),
+ function (err, comp) {
+ if (err) callback(err);
+ else callback(null, safeStringCompare(comp, hashValue));
+ },
+ progressCallback,
+ );
+ }
+ if (callback) {
+ if (typeof callback !== "function")
+ throw Error("Illegal callback: " + typeof callback);
+ _async(callback);
+ } else
+ return new Promise(function (resolve, reject) {
+ _async(function (err, res) {
+ if (err) {
+ reject(err);
+ return;
+ }
+ resolve(res);
+ });
+ });
+ }
+
+ /**
+ * Gets the number of rounds used to encrypt the specified hash.
+ * @param {string} hash Hash to extract the used number of rounds from
+ * @returns {number} Number of rounds used
+ * @throws {Error} If `hash` is not a string
+ */
+ function getRounds(hash) {
+ if (typeof hash !== "string")
+ throw Error("Illegal arguments: " + typeof hash);
+ return parseInt(hash.split("$")[2], 10);
+ }
+
+ /**
+ * Gets the salt portion from a hash. Does not validate the hash.
+ * @param {string} hash Hash to extract the salt from
+ * @returns {string} Extracted salt part
+ * @throws {Error} If `hash` is not a string or otherwise invalid
+ */
+ function getSalt(hash) {
+ if (typeof hash !== "string")
+ throw Error("Illegal arguments: " + typeof hash);
+ if (hash.length !== 60)
+ throw Error("Illegal hash length: " + hash.length + " != 60");
+ return hash.substring(0, 29);
+ }
+
+ /**
+ * Tests if a password will be truncated when hashed, that is its length is
+ * greater than 72 bytes when converted to UTF-8.
+ * @param {string} password The password to test
+ * @returns {boolean} `true` if truncated, otherwise `false`
+ */
+ function truncates(password) {
+ if (typeof password !== "string")
+ throw Error("Illegal arguments: " + typeof password);
+ return utf8Length(password) > 72;
+ }
+
+ /**
+ * Continues with the callback after yielding to the event loop.
+ * @function
+ * @param {function(...[*])} callback Callback to execute
+ * @inner
+ */
+ var nextTick =
+ typeof setImmediate === "function"
+ ? setImmediate
+ : typeof scheduler === "object" &&
+ typeof scheduler.postTask === "function"
+ ? scheduler.postTask.bind(scheduler)
+ : setTimeout;
+
+ /** Calculates the byte length of a string encoded as UTF8. */
+ function utf8Length(string) {
+ var len = 0,
+ c = 0;
+ for (var i = 0; i < string.length; ++i) {
+ c = string.charCodeAt(i);
+ if (c < 128) len += 1;
+ else if (c < 2048) len += 2;
+ else if (
+ (c & 0xfc00) === 0xd800 &&
+ (string.charCodeAt(i + 1) & 0xfc00) === 0xdc00
+ ) {
+ ++i;
+ len += 4;
+ } else len += 3;
+ }
+ return len;
+ }
+
+ /** Converts a string to an array of UTF8 bytes. */
+ function utf8Array(string) {
+ var offset = 0,
+ c1,
+ c2;
+ var buffer = new Array(utf8Length(string));
+ for (var i = 0, k = string.length; i < k; ++i) {
+ c1 = string.charCodeAt(i);
+ if (c1 < 128) {
+ buffer[offset++] = c1;
+ } else if (c1 < 2048) {
+ buffer[offset++] = (c1 >> 6) | 192;
+ buffer[offset++] = (c1 & 63) | 128;
+ } else if (
+ (c1 & 0xfc00) === 0xd800 &&
+ ((c2 = string.charCodeAt(i + 1)) & 0xfc00) === 0xdc00
+ ) {
+ c1 = 0x10000 + ((c1 & 0x03ff) << 10) + (c2 & 0x03ff);
+ ++i;
+ buffer[offset++] = (c1 >> 18) | 240;
+ buffer[offset++] = ((c1 >> 12) & 63) | 128;
+ buffer[offset++] = ((c1 >> 6) & 63) | 128;
+ buffer[offset++] = (c1 & 63) | 128;
+ } else {
+ buffer[offset++] = (c1 >> 12) | 224;
+ buffer[offset++] = ((c1 >> 6) & 63) | 128;
+ buffer[offset++] = (c1 & 63) | 128;
+ }
+ }
+ return buffer;
+ }
+
+ // A base64 implementation for the bcrypt algorithm. This is partly non-standard.
+
+ /**
+ * bcrypt's own non-standard base64 dictionary.
+ * @type {!Array.}
+ * @const
+ * @inner
+ **/
+ var BASE64_CODE =
+ "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(
+ "",
+ );
+
+ /**
+ * @type {!Array.}
+ * @const
+ * @inner
+ **/
+ var BASE64_INDEX = [
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 54, 55, 56, 57, 58, 59, 60,
+ 61, 62, 63, -1, -1, -1, -1, -1, -1, -1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
+ 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, -1, -1,
+ -1, -1, -1, -1, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
+ 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, -1, -1, -1, -1,
+ ];
+
+ /**
+ * Encodes a byte array to base64 with up to len bytes of input.
+ * @param {!Array.} b Byte array
+ * @param {number} len Maximum input length
+ * @returns {string}
+ * @inner
+ */
+ function base64_encode(b, len) {
+ var off = 0,
+ rs = [],
+ c1,
+ c2;
+ if (len <= 0 || len > b.length) throw Error("Illegal len: " + len);
+ while (off < len) {
+ c1 = b[off++] & 0xff;
+ rs.push(BASE64_CODE[(c1 >> 2) & 0x3f]);
+ c1 = (c1 & 0x03) << 4;
+ if (off >= len) {
+ rs.push(BASE64_CODE[c1 & 0x3f]);
+ break;
+ }
+ c2 = b[off++] & 0xff;
+ c1 |= (c2 >> 4) & 0x0f;
+ rs.push(BASE64_CODE[c1 & 0x3f]);
+ c1 = (c2 & 0x0f) << 2;
+ if (off >= len) {
+ rs.push(BASE64_CODE[c1 & 0x3f]);
+ break;
+ }
+ c2 = b[off++] & 0xff;
+ c1 |= (c2 >> 6) & 0x03;
+ rs.push(BASE64_CODE[c1 & 0x3f]);
+ rs.push(BASE64_CODE[c2 & 0x3f]);
+ }
+ return rs.join("");
+ }
+
+ /**
+ * Decodes a base64 encoded string to up to len bytes of output.
+ * @param {string} s String to decode
+ * @param {number} len Maximum output length
+ * @returns {!Array.}
+ * @inner
+ */
+ function base64_decode(s, len) {
+ var off = 0,
+ slen = s.length,
+ olen = 0,
+ rs = [],
+ c1,
+ c2,
+ c3,
+ c4,
+ o,
+ code;
+ if (len <= 0) throw Error("Illegal len: " + len);
+ while (off < slen - 1 && olen < len) {
+ code = s.charCodeAt(off++);
+ c1 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1;
+ code = s.charCodeAt(off++);
+ c2 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1;
+ if (c1 == -1 || c2 == -1) break;
+ o = (c1 << 2) >>> 0;
+ o |= (c2 & 0x30) >> 4;
+ rs.push(String.fromCharCode(o));
+ if (++olen >= len || off >= slen) break;
+ code = s.charCodeAt(off++);
+ c3 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1;
+ if (c3 == -1) break;
+ o = ((c2 & 0x0f) << 4) >>> 0;
+ o |= (c3 & 0x3c) >> 2;
+ rs.push(String.fromCharCode(o));
+ if (++olen >= len || off >= slen) break;
+ code = s.charCodeAt(off++);
+ c4 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1;
+ o = ((c3 & 0x03) << 6) >>> 0;
+ o |= c4;
+ rs.push(String.fromCharCode(o));
+ ++olen;
+ }
+ var res = [];
+ for (off = 0; off < olen; off++) res.push(rs[off].charCodeAt(0));
+ return res;
+ }
+
+ /**
+ * @type {number}
+ * @const
+ * @inner
+ */
+ var BCRYPT_SALT_LEN = 16;
+
+ /**
+ * @type {number}
+ * @const
+ * @inner
+ */
+ var GENSALT_DEFAULT_LOG2_ROUNDS = 10;
+
+ /**
+ * @type {number}
+ * @const
+ * @inner
+ */
+ var BLOWFISH_NUM_ROUNDS = 16;
+
+ /**
+ * @type {number}
+ * @const
+ * @inner
+ */
+ var MAX_EXECUTION_TIME = 100;
+
+ /**
+ * @type {Array.}
+ * @const
+ * @inner
+ */
+ var P_ORIG = [
+ 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0,
+ 0x082efa98, 0xec4e6c89, 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c,
+ 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, 0x9216d5d9, 0x8979fb1b,
+ ];
+
+ /**
+ * @type {Array.}
+ * @const
+ * @inner
+ */
+ var S_ORIG = [
+ 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96,
+ 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16,
+ 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, 0x0d95748f, 0x728eb658,
+ 0x718bcd58, 0x82154aee, 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013,
+ 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, 0x8e79dcb0, 0x603a180e,
+ 0x6c9e0e8b, 0xb01e8a3e, 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60,
+ 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, 0x55ca396a, 0x2aab10b6,
+ 0xb4cc5c34, 0x1141e8ce, 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a,
+ 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, 0xafd6ba33, 0x6c24cf5c,
+ 0x7a325381, 0x28958677, 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193,
+ 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, 0xef845d5d, 0xe98575b1,
+ 0xdc262302, 0xeb651b88, 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239,
+ 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, 0x21c66842, 0xf6e96c9a,
+ 0x670c9c61, 0xabd388f0, 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3,
+ 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, 0xa1f1651d, 0x39af0176,
+ 0x66ca593e, 0x82430e88, 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe,
+ 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, 0x4ed3aa62, 0x363f7706,
+ 0x1bfedf72, 0x429b023d, 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b,
+ 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, 0xe3fe501a, 0xb6794c3b,
+ 0x976ce0bd, 0x04c006ba, 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463,
+ 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, 0x6dfc511f, 0x9b30952c,
+ 0xcc814544, 0xaf5ebd09, 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3,
+ 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, 0x5579c0bd, 0x1a60320a,
+ 0xd6a100c6, 0x402c7279, 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8,
+ 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, 0x323db5fa, 0xfd238760,
+ 0x53317b48, 0x3e00df82, 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db,
+ 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, 0x695b27b0, 0xbbca58c8,
+ 0xe1ffa35d, 0xb8f011a0, 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b,
+ 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, 0xe1ddf2da, 0xa4cb7e33,
+ 0x62fb1341, 0xcee4c6e8, 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4,
+ 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, 0xd08ed1d0, 0xafc725e0,
+ 0x8e3c5b2f, 0x8e7594b7, 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c,
+ 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, 0x2f2f2218, 0xbe0e1777,
+ 0xea752dfe, 0x8b021fa1, 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299,
+ 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, 0x165fa266, 0x80957705,
+ 0x93cc7314, 0x211a1477, 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf,
+ 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, 0x00250e2d, 0x2071b35e,
+ 0x226800bb, 0x57b8e0af, 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa,
+ 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, 0x83260376, 0x6295cfa9,
+ 0x11c81968, 0x4e734a41, 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915,
+ 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, 0x08ba6fb5, 0x571be91f,
+ 0xf296ec6b, 0x2a0dd915, 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664,
+ 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a, 0x4b7a70e9, 0xb5b32944,
+ 0xdb75092e, 0xc4192623, 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266,
+ 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, 0x193602a5, 0x75094c29,
+ 0xa0591340, 0xe4183a3e, 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6,
+ 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, 0x4cdd2086, 0x8470eb26,
+ 0x6382e9c6, 0x021ecc5e, 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1,
+ 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, 0x3e07841c, 0x7fdeae5c,
+ 0x8e7d44ec, 0x5716f2b8, 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff,
+ 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, 0xd19113f9, 0x7ca92ff6,
+ 0x94324773, 0x22f54701, 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7,
+ 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, 0xe238cd99, 0x3bea0e2f,
+ 0x3280bba1, 0x183eb331, 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf,
+ 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, 0xde9a771f, 0xd9930810,
+ 0xb38bae12, 0xdccf3f2e, 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87,
+ 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, 0xec7aec3a, 0xdb851dfa,
+ 0x63094366, 0xc464c3d2, 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16,
+ 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, 0x71dff89e, 0x10314e55,
+ 0x81ac77d6, 0x5f11199b, 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509,
+ 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, 0x86e34570, 0xeae96fb1,
+ 0x860e5e0a, 0x5a3e2ab3, 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f,
+ 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, 0xc6150eba, 0x94e2ea78,
+ 0xa5fc3c53, 0x1e0a2df4, 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960,
+ 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, 0xe3bc4595, 0xa67bc883,
+ 0xb17f37d1, 0x018cff28, 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802,
+ 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, 0x1521b628, 0x29076170,
+ 0xecdd4775, 0x619f1510, 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf,
+ 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, 0xeecc86bc, 0x60622ca7,
+ 0x9cab5cab, 0xb2f3846e, 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50,
+ 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, 0x9b540b19, 0x875fa099,
+ 0x95f7997e, 0x623d7da8, 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281,
+ 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, 0x57f584a5, 0x1b227263,
+ 0x9b83c3ff, 0x1ac24696, 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128,
+ 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, 0x5d4a14d9, 0xe864b7e3,
+ 0x42105d14, 0x203e13e0, 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0,
+ 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, 0xd81e799e, 0x86854dc7,
+ 0xe44b476a, 0x3d816250, 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3,
+ 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, 0x095bbf00, 0xad19489d,
+ 0x1462b174, 0x23820e00, 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061,
+ 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, 0x7cde3759, 0xcbee7460,
+ 0x4085f2a7, 0xce77326e, 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735,
+ 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, 0x9e447a2e, 0xc3453484,
+ 0xfdd56705, 0x0e1e9ec9, 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340,
+ 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, 0x153e21e7, 0x8fb03d4a,
+ 0xe6e39f2b, 0xdb83adf7, 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934,
+ 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, 0xd4082471, 0x3320f46a,
+ 0x43b7d4b7, 0x500061af, 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840,
+ 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, 0xbfbc09ec, 0x03bd9785,
+ 0x7fac6dd0, 0x31cb8504, 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a,
+ 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, 0x68dc1462, 0xd7486900,
+ 0x680ec0a4, 0x27a18dee, 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6,
+ 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, 0x20fe9e35, 0xd9f385b9,
+ 0xee39d7ab, 0x3b124e8b, 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2,
+ 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb, 0xfb0af54e, 0xd8feb397,
+ 0x454056ac, 0xba489527, 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b,
+ 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, 0xa62a4a56, 0x3f3125f9,
+ 0x5ef47e1c, 0x9029317c, 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3,
+ 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc, 0x07f9c9ee, 0x41041f0f,
+ 0x404779a4, 0x5d886e17, 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564,
+ 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, 0x0e12b4c2, 0x02e1329e,
+ 0xaf664fd1, 0xcad18115, 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922,
+ 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728, 0xd0127845, 0x95b794fd,
+ 0x647d0862, 0xe7ccf5f0, 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e,
+ 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, 0xa812dc60, 0xa1ebddf8,
+ 0x991be14c, 0xdb6e6b0d, 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804,
+ 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, 0x667b9ffb, 0xcedb7d9c,
+ 0xa091cf0b, 0xd9155ea3, 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb,
+ 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, 0x6842ada7, 0xc66a2b3b,
+ 0x12754ccc, 0x782ef11c, 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350,
+ 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, 0x44421659, 0x0a121386,
+ 0xd90cec6e, 0xd5abea2a, 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe,
+ 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, 0xd1fd8346, 0xf6381fb0,
+ 0x7745ae04, 0xd736fccc, 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f,
+ 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61, 0x4e58f48f, 0xf2ddfda2,
+ 0xf474ef38, 0x8789bdc2, 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9,
+ 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, 0x466e598e, 0x20b45770,
+ 0x8cd55591, 0xc902de4c, 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e,
+ 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633, 0xe85a1f02, 0x09f0be8c,
+ 0x4a99a025, 0x1d6efe10, 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169,
+ 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, 0x50115e01, 0xa70683fa,
+ 0xa002b5c4, 0x0de6d027, 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5,
+ 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62, 0x11e69ed7, 0x2338ea63,
+ 0x53c2dd94, 0xc2c21634, 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76,
+ 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, 0x86e3725f, 0x724d9db9,
+ 0x1ac15bb4, 0xd39eb8fc, 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4,
+ 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, 0x6fd5c7e7, 0x56e14ec4,
+ 0x362abfce, 0xddc6c837, 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0,
+ 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742,
+ 0xd3822740, 0x99bc9bbe, 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b,
+ 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, 0x5748ab2f, 0xbc946e79,
+ 0xc6a376d2, 0x6549c2c8, 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6,
+ 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, 0xa1fad5f0, 0x6a2d519a,
+ 0x63ef8ce2, 0x9a86ee22, 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4,
+ 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, 0x2826a2f9, 0xa73a3ae1,
+ 0x4ba99586, 0xef5562e9, 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59,
+ 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, 0xe990fd5a, 0x9e34d797,
+ 0x2cf0b7d9, 0x022b8b51, 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28,
+ 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, 0xe029ac71, 0xe019a5e6,
+ 0x47b0acfd, 0xed93fa9b, 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28,
+ 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, 0x15056dd4, 0x88f46dba,
+ 0x03a16125, 0x0564f0bd, 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a,
+ 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, 0x7533d928, 0xb155fdf5,
+ 0x03563482, 0x8aba3cbb, 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f,
+ 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, 0xea7a90c2, 0xfb3e7bce,
+ 0x5121ce64, 0x774fbe32, 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680,
+ 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, 0xb39a460a, 0x6445c0dd,
+ 0x586cdecf, 0x1c20c8ae, 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb,
+ 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, 0x72eacea8, 0xfa6484bb,
+ 0x8d6612ae, 0xbf3c6f47, 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370,
+ 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, 0x4040cb08, 0x4eb4e2cc,
+ 0x34d2466a, 0x0115af84, 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048,
+ 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, 0x611560b1, 0xe7933fdc,
+ 0xbb3a792b, 0x344525bd, 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9,
+ 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, 0x1a908749, 0xd44fbd9a,
+ 0xd0dadecb, 0xd50ada38, 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f,
+ 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, 0xbf97222c, 0x15e6fc2a,
+ 0x0f91fc71, 0x9b941525, 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1,
+ 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, 0xe0ec6e0e, 0x1698db3b,
+ 0x4c98a0be, 0x3278e964, 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e,
+ 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, 0xdf359f8d, 0x9b992f2e,
+ 0xe60b6f47, 0x0fe3f11d, 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f,
+ 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, 0xf523f357, 0xa6327623,
+ 0x93a83531, 0x56cccd02, 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc,
+ 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, 0xe6c6c7bd, 0x327a140a,
+ 0x45e1d006, 0xc3f27b9a, 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6,
+ 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, 0x53113ec0, 0x1640e3d3,
+ 0x38abbd60, 0x2547adf0, 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060,
+ 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, 0x1948c25c, 0x02fb8a8c,
+ 0x01c36ae4, 0xd6ebe1f9, 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f,
+ 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6,
+ ];
+
+ /**
+ * @type {Array.}
+ * @const
+ * @inner
+ */
+ var C_ORIG = [
+ 0x4f727068, 0x65616e42, 0x65686f6c, 0x64657253, 0x63727944, 0x6f756274,
+ ];
+
+ /**
+ * @param {Array.} lr
+ * @param {number} off
+ * @param {Array.} P
+ * @param {Array.} S
+ * @returns {Array.}
+ * @inner
+ */
+ function _encipher(lr, off, P, S) {
+ // This is our bottleneck: 1714/1905 ticks / 90% - see profile.txt
+ var n,
+ l = lr[off],
+ r = lr[off + 1];
+ l ^= P[0];
+
+ /*
+ for (var i=0, k=BLOWFISH_NUM_ROUNDS-2; i<=k;)
+ // Feistel substitution on left word
+ n = S[l >>> 24],
+ n += S[0x100 | ((l >> 16) & 0xff)],
+ n ^= S[0x200 | ((l >> 8) & 0xff)],
+ n += S[0x300 | (l & 0xff)],
+ r ^= n ^ P[++i],
+ // Feistel substitution on right word
+ n = S[r >>> 24],
+ n += S[0x100 | ((r >> 16) & 0xff)],
+ n ^= S[0x200 | ((r >> 8) & 0xff)],
+ n += S[0x300 | (r & 0xff)],
+ l ^= n ^ P[++i];
+ */
+
+ //The following is an unrolled version of the above loop.
+ //Iteration 0
+ n = S[l >>> 24];
+ n += S[0x100 | ((l >> 16) & 0xff)];
+ n ^= S[0x200 | ((l >> 8) & 0xff)];
+ n += S[0x300 | (l & 0xff)];
+ r ^= n ^ P[1];
+ n = S[r >>> 24];
+ n += S[0x100 | ((r >> 16) & 0xff)];
+ n ^= S[0x200 | ((r >> 8) & 0xff)];
+ n += S[0x300 | (r & 0xff)];
+ l ^= n ^ P[2];
+ //Iteration 1
+ n = S[l >>> 24];
+ n += S[0x100 | ((l >> 16) & 0xff)];
+ n ^= S[0x200 | ((l >> 8) & 0xff)];
+ n += S[0x300 | (l & 0xff)];
+ r ^= n ^ P[3];
+ n = S[r >>> 24];
+ n += S[0x100 | ((r >> 16) & 0xff)];
+ n ^= S[0x200 | ((r >> 8) & 0xff)];
+ n += S[0x300 | (r & 0xff)];
+ l ^= n ^ P[4];
+ //Iteration 2
+ n = S[l >>> 24];
+ n += S[0x100 | ((l >> 16) & 0xff)];
+ n ^= S[0x200 | ((l >> 8) & 0xff)];
+ n += S[0x300 | (l & 0xff)];
+ r ^= n ^ P[5];
+ n = S[r >>> 24];
+ n += S[0x100 | ((r >> 16) & 0xff)];
+ n ^= S[0x200 | ((r >> 8) & 0xff)];
+ n += S[0x300 | (r & 0xff)];
+ l ^= n ^ P[6];
+ //Iteration 3
+ n = S[l >>> 24];
+ n += S[0x100 | ((l >> 16) & 0xff)];
+ n ^= S[0x200 | ((l >> 8) & 0xff)];
+ n += S[0x300 | (l & 0xff)];
+ r ^= n ^ P[7];
+ n = S[r >>> 24];
+ n += S[0x100 | ((r >> 16) & 0xff)];
+ n ^= S[0x200 | ((r >> 8) & 0xff)];
+ n += S[0x300 | (r & 0xff)];
+ l ^= n ^ P[8];
+ //Iteration 4
+ n = S[l >>> 24];
+ n += S[0x100 | ((l >> 16) & 0xff)];
+ n ^= S[0x200 | ((l >> 8) & 0xff)];
+ n += S[0x300 | (l & 0xff)];
+ r ^= n ^ P[9];
+ n = S[r >>> 24];
+ n += S[0x100 | ((r >> 16) & 0xff)];
+ n ^= S[0x200 | ((r >> 8) & 0xff)];
+ n += S[0x300 | (r & 0xff)];
+ l ^= n ^ P[10];
+ //Iteration 5
+ n = S[l >>> 24];
+ n += S[0x100 | ((l >> 16) & 0xff)];
+ n ^= S[0x200 | ((l >> 8) & 0xff)];
+ n += S[0x300 | (l & 0xff)];
+ r ^= n ^ P[11];
+ n = S[r >>> 24];
+ n += S[0x100 | ((r >> 16) & 0xff)];
+ n ^= S[0x200 | ((r >> 8) & 0xff)];
+ n += S[0x300 | (r & 0xff)];
+ l ^= n ^ P[12];
+ //Iteration 6
+ n = S[l >>> 24];
+ n += S[0x100 | ((l >> 16) & 0xff)];
+ n ^= S[0x200 | ((l >> 8) & 0xff)];
+ n += S[0x300 | (l & 0xff)];
+ r ^= n ^ P[13];
+ n = S[r >>> 24];
+ n += S[0x100 | ((r >> 16) & 0xff)];
+ n ^= S[0x200 | ((r >> 8) & 0xff)];
+ n += S[0x300 | (r & 0xff)];
+ l ^= n ^ P[14];
+ //Iteration 7
+ n = S[l >>> 24];
+ n += S[0x100 | ((l >> 16) & 0xff)];
+ n ^= S[0x200 | ((l >> 8) & 0xff)];
+ n += S[0x300 | (l & 0xff)];
+ r ^= n ^ P[15];
+ n = S[r >>> 24];
+ n += S[0x100 | ((r >> 16) & 0xff)];
+ n ^= S[0x200 | ((r >> 8) & 0xff)];
+ n += S[0x300 | (r & 0xff)];
+ l ^= n ^ P[16];
+ lr[off] = r ^ P[BLOWFISH_NUM_ROUNDS + 1];
+ lr[off + 1] = l;
+ return lr;
+ }
+
+ /**
+ * @param {Array.} data
+ * @param {number} offp
+ * @returns {{key: number, offp: number}}
+ * @inner
+ */
+ function _streamtoword(data, offp) {
+ for (var i = 0, word = 0; i < 4; ++i)
+ (word = (word << 8) | (data[offp] & 0xff)),
+ (offp = (offp + 1) % data.length);
+ return {
+ key: word,
+ offp: offp,
+ };
+ }
+
+ /**
+ * @param {Array.} key
+ * @param {Array.} P
+ * @param {Array.} S
+ * @inner
+ */
+ function _key(key, P, S) {
+ var offset = 0,
+ lr = [0, 0],
+ plen = P.length,
+ slen = S.length,
+ sw;
+ for (var i = 0; i < plen; i++)
+ (sw = _streamtoword(key, offset)),
+ (offset = sw.offp),
+ (P[i] = P[i] ^ sw.key);
+ for (i = 0; i < plen; i += 2)
+ (lr = _encipher(lr, 0, P, S)), (P[i] = lr[0]), (P[i + 1] = lr[1]);
+ for (i = 0; i < slen; i += 2)
+ (lr = _encipher(lr, 0, P, S)), (S[i] = lr[0]), (S[i + 1] = lr[1]);
+ }
+
+ /**
+ * Expensive key schedule Blowfish.
+ * @param {Array.} data
+ * @param {Array.} key
+ * @param {Array.} P
+ * @param {Array.} S
+ * @inner
+ */
+ function _ekskey(data, key, P, S) {
+ var offp = 0,
+ lr = [0, 0],
+ plen = P.length,
+ slen = S.length,
+ sw;
+ for (var i = 0; i < plen; i++)
+ (sw = _streamtoword(key, offp)),
+ (offp = sw.offp),
+ (P[i] = P[i] ^ sw.key);
+ offp = 0;
+ for (i = 0; i < plen; i += 2)
+ (sw = _streamtoword(data, offp)),
+ (offp = sw.offp),
+ (lr[0] ^= sw.key),
+ (sw = _streamtoword(data, offp)),
+ (offp = sw.offp),
+ (lr[1] ^= sw.key),
+ (lr = _encipher(lr, 0, P, S)),
+ (P[i] = lr[0]),
+ (P[i + 1] = lr[1]);
+ for (i = 0; i < slen; i += 2)
+ (sw = _streamtoword(data, offp)),
+ (offp = sw.offp),
+ (lr[0] ^= sw.key),
+ (sw = _streamtoword(data, offp)),
+ (offp = sw.offp),
+ (lr[1] ^= sw.key),
+ (lr = _encipher(lr, 0, P, S)),
+ (S[i] = lr[0]),
+ (S[i + 1] = lr[1]);
+ }
+
+ /**
+ * Internaly crypts a string.
+ * @param {Array.} b Bytes to crypt
+ * @param {Array.} salt Salt bytes to use
+ * @param {number} rounds Number of rounds
+ * @param {function(Error, Array.=)=} callback Callback receiving the error, if any, and the resulting bytes. If
+ * omitted, the operation will be performed synchronously.
+ * @param {function(number)=} progressCallback Callback called with the current progress
+ * @returns {!Array.|undefined} Resulting bytes if callback has been omitted, otherwise `undefined`
+ * @inner
+ */
+ function _crypt(b, salt, rounds, callback, progressCallback) {
+ var cdata = C_ORIG.slice(),
+ clen = cdata.length,
+ err;
+
+ // Validate
+ if (rounds < 4 || rounds > 31) {
+ err = Error("Illegal number of rounds (4-31): " + rounds);
+ if (callback) {
+ nextTick(callback.bind(this, err));
+ return;
+ } else throw err;
+ }
+ if (salt.length !== BCRYPT_SALT_LEN) {
+ err = Error(
+ "Illegal salt length: " + salt.length + " != " + BCRYPT_SALT_LEN,
+ );
+ if (callback) {
+ nextTick(callback.bind(this, err));
+ return;
+ } else throw err;
+ }
+ rounds = (1 << rounds) >>> 0;
+ var P,
+ S,
+ i = 0,
+ j;
+
+ //Use typed arrays when available - huge speedup!
+ if (typeof Int32Array === "function") {
+ P = new Int32Array(P_ORIG);
+ S = new Int32Array(S_ORIG);
+ } else {
+ P = P_ORIG.slice();
+ S = S_ORIG.slice();
+ }
+ _ekskey(salt, b, P, S);
+
+ /**
+ * Calcualtes the next round.
+ * @returns {Array.|undefined} Resulting array if callback has been omitted, otherwise `undefined`
+ * @inner
+ */
+ function next() {
+ if (progressCallback) progressCallback(i / rounds);
+ if (i < rounds) {
+ var start = Date.now();
+ for (; i < rounds; ) {
+ i = i + 1;
+ _key(b, P, S);
+ _key(salt, P, S);
+ if (Date.now() - start > MAX_EXECUTION_TIME) break;
+ }
+ } else {
+ for (i = 0; i < 64; i++)
+ for (j = 0; j < clen >> 1; j++) _encipher(cdata, j << 1, P, S);
+ var ret = [];
+ for (i = 0; i < clen; i++)
+ ret.push(((cdata[i] >> 24) & 0xff) >>> 0),
+ ret.push(((cdata[i] >> 16) & 0xff) >>> 0),
+ ret.push(((cdata[i] >> 8) & 0xff) >>> 0),
+ ret.push((cdata[i] & 0xff) >>> 0);
+ if (callback) {
+ callback(null, ret);
+ return;
+ } else return ret;
+ }
+ if (callback) nextTick(next);
+ }
+
+ // Async
+ if (typeof callback !== "undefined") {
+ next();
+
+ // Sync
+ } else {
+ var res;
+ while (true)
+ if (typeof (res = next()) !== "undefined") return res || [];
+ }
+ }
+
+ /**
+ * Internally hashes a password.
+ * @param {string} password Password to hash
+ * @param {?string} salt Salt to use, actually never null
+ * @param {function(Error, string=)=} callback Callback receiving the error, if any, and the resulting hash. If omitted,
+ * hashing is performed synchronously.
+ * @param {function(number)=} progressCallback Callback called with the current progress
+ * @returns {string|undefined} Resulting hash if callback has been omitted, otherwise `undefined`
+ * @inner
+ */
+ function _hash(password, salt, callback, progressCallback) {
+ var err;
+ if (typeof password !== "string" || typeof salt !== "string") {
+ err = Error("Invalid string / salt: Not a string");
+ if (callback) {
+ nextTick(callback.bind(this, err));
+ return;
+ } else throw err;
+ }
+
+ // Validate the salt
+ var minor, offset;
+ if (salt.charAt(0) !== "$" || salt.charAt(1) !== "2") {
+ err = Error("Invalid salt version: " + salt.substring(0, 2));
+ if (callback) {
+ nextTick(callback.bind(this, err));
+ return;
+ } else throw err;
+ }
+ if (salt.charAt(2) === "$")
+ (minor = String.fromCharCode(0)), (offset = 3);
+ else {
+ minor = salt.charAt(2);
+ if (
+ (minor !== "a" && minor !== "b" && minor !== "y") ||
+ salt.charAt(3) !== "$"
+ ) {
+ err = Error("Invalid salt revision: " + salt.substring(2, 4));
+ if (callback) {
+ nextTick(callback.bind(this, err));
+ return;
+ } else throw err;
+ }
+ offset = 4;
+ }
+
+ // Extract number of rounds
+ if (salt.charAt(offset + 2) > "$") {
+ err = Error("Missing salt rounds");
+ if (callback) {
+ nextTick(callback.bind(this, err));
+ return;
+ } else throw err;
+ }
+ var r1 = parseInt(salt.substring(offset, offset + 1), 10) * 10,
+ r2 = parseInt(salt.substring(offset + 1, offset + 2), 10),
+ rounds = r1 + r2,
+ real_salt = salt.substring(offset + 3, offset + 25);
+ password += minor >= "a" ? "\x00" : "";
+ var passwordb = utf8Array(password),
+ saltb = base64_decode(real_salt, BCRYPT_SALT_LEN);
+
+ /**
+ * Finishes hashing.
+ * @param {Array.} bytes Byte array
+ * @returns {string}
+ * @inner
+ */
+ function finish(bytes) {
+ var res = [];
+ res.push("$2");
+ if (minor >= "a") res.push(minor);
+ res.push("$");
+ if (rounds < 10) res.push("0");
+ res.push(rounds.toString());
+ res.push("$");
+ res.push(base64_encode(saltb, saltb.length));
+ res.push(base64_encode(bytes, C_ORIG.length * 4 - 1));
+ return res.join("");
+ }
+
+ // Sync
+ if (typeof callback == "undefined")
+ return finish(_crypt(passwordb, saltb, rounds));
+ // Async
+ else {
+ _crypt(
+ passwordb,
+ saltb,
+ rounds,
+ function (err, bytes) {
+ if (err) callback(err, null);
+ else callback(null, finish(bytes));
+ },
+ progressCallback,
+ );
+ }
+ }
+
+ /**
+ * Encodes a byte array to base64 with up to len bytes of input, using the custom bcrypt alphabet.
+ * @function
+ * @param {!Array.} bytes Byte array
+ * @param {number} length Maximum input length
+ * @returns {string}
+ */
+ function encodeBase64(bytes, length) {
+ return base64_encode(bytes, length);
+ }
+
+ /**
+ * Decodes a base64 encoded string to up to len bytes of output, using the custom bcrypt alphabet.
+ * @function
+ * @param {string} string String to decode
+ * @param {number} length Maximum output length
+ * @returns {!Array.}
+ */
+ function decodeBase64(string, length) {
+ return base64_decode(string, length);
+ }
+ var _default = (_exports.default = {
+ setRandomFallback,
+ genSaltSync,
+ genSalt,
+ hashSync,
+ hash,
+ compareSync,
+ compare,
+ getRounds,
+ getSalt,
+ truncates,
+ encodeBase64,
+ decodeBase64,
+ });
+ },
+);
diff --git a/node_modules/bcryptjs/umd/package.json b/node_modules/bcryptjs/umd/package.json
new file mode 100644
index 00000000..5bbefffb
--- /dev/null
+++ b/node_modules/bcryptjs/umd/package.json
@@ -0,0 +1,3 @@
+{
+ "type": "commonjs"
+}
diff --git a/node_modules/bcryptjs/umd/types.d.ts b/node_modules/bcryptjs/umd/types.d.ts
new file mode 100644
index 00000000..3cbe5b16
--- /dev/null
+++ b/node_modules/bcryptjs/umd/types.d.ts
@@ -0,0 +1,157 @@
+// Originally imported from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/8b36dbdf95b624b8a7cd7f8416f06c15d274f9e6/types/bcryptjs/index.d.ts
+// MIT license.
+
+/** Called with an error on failure or a value of type `T` upon success. */
+type Callback = (err: Error | null, result?: T) => void;
+/** Called with the percentage of rounds completed (0.0 - 1.0), maximally once per `MAX_EXECUTION_TIME = 100` ms. */
+type ProgressCallback = (percentage: number) => void;
+/** Called to obtain random bytes when both Web Crypto API and Node.js crypto are not available. */
+type RandomFallback = (length: number) => number[];
+
+/**
+ * Sets the pseudo random number generator to use as a fallback if neither node's crypto module nor the Web Crypto API is available.
+ * Please note: It is highly important that the PRNG used is cryptographically secure and that it is seeded properly!
+ * @param random Function taking the number of bytes to generate as its sole argument, returning the corresponding array of cryptographically secure random byte values.
+ */
+export declare function setRandomFallback(random: RandomFallback): void;
+
+/**
+ * Synchronously generates a salt.
+ * @param rounds Number of rounds to use, defaults to 10 if omitted
+ * @return Resulting salt
+ * @throws If a random fallback is required but not set
+ */
+export declare function genSaltSync(rounds?: number): string;
+
+/**
+ * Asynchronously generates a salt.
+ * @param rounds Number of rounds to use, defaults to 10 if omitted
+ * @return Promise with resulting salt, if callback has been omitted
+ */
+export declare function genSalt(rounds?: number): Promise;
+
+/**
+ * Asynchronously generates a salt.
+ * @param callback Callback receiving the error, if any, and the resulting salt
+ */
+export declare function genSalt(callback: Callback): void;
+
+/**
+ * Asynchronously generates a salt.
+ * @param rounds Number of rounds to use, defaults to 10 if omitted
+ * @param callback Callback receiving the error, if any, and the resulting salt
+ */
+export declare function genSalt(
+ rounds: number,
+ callback: Callback,
+): void;
+
+/**
+ * Synchronously generates a hash for the given password.
+ * @param password Password to hash
+ * @param salt Salt length to generate or salt to use, default to 10
+ * @return Resulting hash
+ */
+export declare function hashSync(
+ password: string,
+ salt?: number | string,
+): string;
+
+/**
+ * Asynchronously generates a hash for the given password.
+ * @param password Password to hash
+ * @param salt Salt length to generate or salt to use
+ * @return Promise with resulting hash, if callback has been omitted
+ */
+export declare function hash(
+ password: string,
+ salt: number | string,
+): Promise;
+
+/**
+ * Asynchronously generates a hash for the given password.
+ * @param password Password to hash
+ * @param salt Salt length to generate or salt to use
+ * @param callback Callback receiving the error, if any, and the resulting hash
+ * @param progressCallback Callback successively called with the percentage of rounds completed (0.0 - 1.0), maximally once per MAX_EXECUTION_TIME = 100 ms.
+ */
+export declare function hash(
+ password: string,
+ salt: number | string,
+ callback?: Callback,
+ progressCallback?: ProgressCallback,
+): void;
+
+/**
+ * Synchronously tests a password against a hash.
+ * @param password Password to test
+ * @param hash Hash to test against
+ * @return true if matching, otherwise false
+ */
+export declare function compareSync(password: string, hash: string): boolean;
+
+/**
+ * Asynchronously tests a password against a hash.
+ * @param password Password to test
+ * @param hash Hash to test against
+ * @return Promise, if callback has been omitted
+ */
+export declare function compare(
+ password: string,
+ hash: string,
+): Promise;
+
+/**
+ * Asynchronously tests a password against a hash.
+ * @param password Password to test
+ * @param hash Hash to test against
+ * @param callback Callback receiving the error, if any, otherwise the result
+ * @param progressCallback Callback successively called with the percentage of rounds completed (0.0 - 1.0), maximally once per MAX_EXECUTION_TIME = 100 ms.
+ */
+export declare function compare(
+ password: string,
+ hash: string,
+ callback?: Callback,
+ progressCallback?: ProgressCallback,
+): void;
+
+/**
+ * Gets the number of rounds used to encrypt the specified hash.
+ * @param hash Hash to extract the used number of rounds from
+ * @return Number of rounds used
+ */
+export declare function getRounds(hash: string): number;
+
+/**
+ * Gets the salt portion from a hash. Does not validate the hash.
+ * @param hash Hash to extract the salt from
+ * @return Extracted salt part
+ */
+export declare function getSalt(hash: string): string;
+
+/**
+ * Tests if a password will be truncated when hashed, that is its length is
+ * greater than 72 bytes when converted to UTF-8.
+ * @param password The password to test
+ * @returns `true` if truncated, otherwise `false`
+ */
+export declare function truncates(password: string): boolean;
+
+/**
+ * Encodes a byte array to base64 with up to len bytes of input, using the custom bcrypt alphabet.
+ * @function
+ * @param b Byte array
+ * @param len Maximum input length
+ */
+export declare function encodeBase64(
+ b: Readonly>,
+ len: number,
+): string;
+
+/**
+ * Decodes a base64 encoded string to up to len bytes of output, using the custom bcrypt alphabet.
+ * @function
+ * @param s String to decode
+ * @param len Maximum output length
+ */
+export declare function decodeBase64(s: string, len: number): number[];
diff --git a/node_modules/bignumber.js/CHANGELOG.md b/node_modules/bignumber.js/CHANGELOG.md
new file mode 100644
index 00000000..d7af1b81
--- /dev/null
+++ b/node_modules/bignumber.js/CHANGELOG.md
@@ -0,0 +1,381 @@
+#### 9.3.1
+
+* 11/07/25
+* [BUGFIX] #388 `toPrecision` fix.
+
+#### 9.3.0
+
+* 19/04/25
+* Refactor type declarations:
+* Rename *bignumber.d.ts* to *types.d.ts*.
+* Rename *bignumber.d.cts* to *bignumber.d.ts*.
+* Add `export as namespace` to *bignumber.d.ts*.
+* Remove subpath exports from *package.json*.
+* Refactor named export from *bignumber.d.mts*.
+* #383 Remove `?` from static `BigNumber` and `default` properties.
+* Add blank lines after titles in *CHANGELOG.md*.
+
+#### 9.2.1
+
+* 08/04/25
+* #371 #382 Add `BigNumber` as named export.
+
+#### 9.2.0
+
+* 03/04/25
+* #355 Support `BigInt` argument.
+* #371 Provide separate type definitions for CommonJS and ES modules.
+* #374 Correct `comparedTo` return type.
+
+#### 9.1.2
+
+* 28/08/23
+* #354 Amend `round` to avoid bug in v8 Maglev compiler.
+* [BUGFIX] #344 `minimum(0, -0)` should be `-0`.
+
+#### 9.1.1
+
+* 04/12/22
+* #338 [BUGFIX] `exponentiatedBy`: ensure `0**-n === Infinity` for very large `n`.
+
+#### 9.1.0
+
+* 08/08/22
+* #329 Remove `import` example.
+* #277 Resolve lint warnings and add number `toString` note.
+* Correct `decimalPlaces()` return type in *bignumber.d.ts*.
+* Add ES module global `crypto` example.
+* #322 Add `exports` field to *package.json*.
+* #251 (#308) Amend *bignumber.d.ts* to allow instantiating a BigNumber without `new`.
+
+#### 9.0.2
+
+* 12/12/21
+* #250 [BUGFIX] Allow use of user-defined alphabet for base 10.
+* #295 Remove *bignumber.min.js* and amend *README.md*.
+* Update *.travis.yml* and *LICENCE.md*.
+
+#### 9.0.1
+
+* 28/09/20
+* [BUGFIX] #276 Correct `sqrt` initial estimate.
+* Update *.travis.yml*, *LICENCE.md* and *README.md*.
+
+#### 9.0.0
+
+* 27/05/2019
+* For compatibility with legacy browsers, remove `Symbol` references.
+
+#### 8.1.1
+
+* 24/02/2019
+* [BUGFIX] #222 Restore missing `var` to `export BigNumber`.
+* Allow any key in BigNumber.Instance in *bignumber.d.ts*.
+
+#### 8.1.0
+
+* 23/02/2019
+* [NEW FEATURE] #220 Create a BigNumber using `{s, e, c}`.
+* [NEW FEATURE] `isBigNumber`: if `BigNumber.DEBUG` is `true`, also check that the BigNumber instance is well-formed.
+* Remove `instanceof` checks; just use `_isBigNumber` to identify a BigNumber instance.
+* Add `_isBigNumber` to prototype in *bignumber.mjs*.
+* Add tests for BigNumber creation from object.
+* Update *API.html*.
+
+#### 8.0.2
+
+* 13/01/2019
+* #209 `toPrecision` without argument should follow `toString`.
+* Improve *Use* section of *README*.
+* Optimise `toString(10)`.
+* Add verson number to API doc.
+
+#### 8.0.1
+
+* 01/11/2018
+* Rest parameter must be array type in *bignumber.d.ts*.
+
+#### 8.0.0
+
+* 01/11/2018
+* [NEW FEATURE] Add `BigNumber.sum` method.
+* [NEW FEATURE]`toFormat`: add `prefix` and `suffix` options.
+* [NEW FEATURE] #178 Pass custom formatting to `toFormat`.
+* [BREAKING CHANGE] #184 `toFraction`: return array of BigNumbers not strings.
+* [NEW FEATURE] #185 Enable overwrite of `valueOf` to prevent accidental addition to string.
+* #183 Add Node.js `crypto` requirement to documentation.
+* [BREAKING CHANGE] #198 Disallow signs and whitespace in custom alphabet.
+* [NEW FEATURE] #188 Implement `util.inspect.custom` for Node.js REPL.
+* #170 Make `isBigNumber` a type guard in *bignumber.d.ts*.
+* [BREAKING CHANGE] `BigNumber.min` and `BigNumber.max`: don't accept an array.
+* Update *.travis.yml*.
+* Remove *bower.json*.
+
+#### 7.2.1
+
+* 24/05/2018
+* Add `browser` field to *package.json*.
+
+#### 7.2.0
+
+* 22/05/2018
+* #166 Correct *.mjs* file. Remove extension from `main` field in *package.json*.
+
+#### 7.1.0
+
+* 18/05/2018
+* Add `module` field to *package.json* for *bignumber.mjs*.
+
+#### 7.0.2
+
+* 17/05/2018
+* #165 Bugfix: upper-case letters for bases 11-36 in a custom alphabet.
+* Add note to *README* regarding creating BigNumbers from Number values.
+
+#### 7.0.1
+
+* 26/04/2018
+* #158 Fix global object variable name typo.
+
+#### 7.0.0
+
+* 26/04/2018
+* #143 Remove global BigNumber from typings.
+* #144 Enable compatibility with `Object.freeze(Object.prototype)`.
+* #148 #123 #11 Only throw on a number primitive with more than 15 significant digits if `BigNumber.DEBUG` is `true`.
+* Only throw on an invalid BigNumber value if `BigNumber.DEBUG` is `true`. Return BigNumber `NaN` instead.
+* #154 `exponentiatedBy`: allow BigNumber exponent.
+* #156 Prevent Content Security Policy *unsafe-eval* issue.
+* `toFraction`: allow `Infinity` maximum denominator.
+* Comment-out some excess tests to reduce test time.
+* Amend indentation and other spacing.
+
+#### 6.0.0
+
+* 26/01/2018
+* #137 Implement `APLHABET` configuration option.
+* Remove `ERRORS` configuration option.
+* Remove `toDigits` method; extend `precision` method accordingly.
+* Remove s`round` method; extend `decimalPlaces` method accordingly.
+* Remove methods: `ceil`, `floor`, and `truncated`.
+* Remove method aliases: `add`, `cmp`, `isInt`, `isNeg`, `trunc`, `mul`, `neg` and `sub`.
+* Rename methods: `shift` to `shiftedBy`, `another` to `clone`, `toPower` to `exponentiatedBy`, and `equals` to `isEqualTo`.
+* Rename methods: add `is` prefix to `greaterThan`, `greaterThanOrEqualTo`, `lessThan` and `lessThanOrEqualTo`.
+* Add methods: `multipliedBy`, `isBigNumber`, `isPositive`, `integerValue`, `maximum` and `minimum`.
+* Refactor test suite.
+* Add *CHANGELOG.md*.
+* Rewrite *bignumber.d.ts*.
+* Redo API image.
+
+#### 5.0.0
+
+* 27/11/2017
+* #81 Don't throw on constructor call without `new`.
+
+#### 4.1.0
+
+* 26/09/2017
+* Remove node 0.6 from *.travis.yml*.
+* Add *bignumber.mjs*.
+
+#### 4.0.4
+
+* 03/09/2017
+* Add missing aliases to *bignumber.d.ts*.
+
+#### 4.0.3
+
+* 30/08/2017
+* Add types: *bignumber.d.ts*.
+
+#### 4.0.2
+
+* 03/05/2017
+* #120 Workaround Safari/Webkit bug.
+
+#### 4.0.1
+
+* 05/04/2017
+* #121 BigNumber.default to BigNumber['default'].
+
+#### 4.0.0
+
+* 09/01/2017
+* Replace BigNumber.isBigNumber method with isBigNumber prototype property.
+
+#### 3.1.2
+
+* 08/01/2017
+* Minor documentation edit.
+
+#### 3.1.1
+
+* 08/01/2017
+* Uncomment `isBigNumber` tests.
+* Ignore dot files.
+
+#### 3.1.0
+
+* 08/01/2017
+* Add `isBigNumber` method.
+
+#### 3.0.2
+
+* 08/01/2017
+* Bugfix: Possible incorrect value of `ERRORS` after a `BigNumber.another` call (due to `parseNumeric` declaration in outer scope).
+
+#### 3.0.1
+
+* 23/11/2016
+* Apply fix for old ipads with `%` issue, see #57 and #102.
+* Correct error message.
+
+#### 3.0.0
+
+* 09/11/2016
+* Remove `require('crypto')` - leave it to the user.
+* Add `BigNumber.set` as `BigNumber.config` alias.
+* Default `POW_PRECISION` to `0`.
+
+#### 2.4.0
+
+* 14/07/2016
+* #97 Add exports to support ES6 imports.
+
+#### 2.3.0
+
+* 07/03/2016
+* #86 Add modulus parameter to `toPower`.
+
+#### 2.2.0
+
+* 03/03/2016
+* #91 Permit larger JS integers.
+
+#### 2.1.4
+
+* 15/12/2015
+* Correct UMD.
+
+#### 2.1.3
+
+* 13/12/2015
+* Refactor re global object and crypto availability when bundling.
+
+#### 2.1.2
+
+* 10/12/2015
+* Bugfix: `window.crypto` not assigned to `crypto`.
+
+#### 2.1.1
+
+* 09/12/2015
+* Prevent code bundler from adding `crypto` shim.
+
+#### 2.1.0
+
+* 26/10/2015
+* For `valueOf` and `toJSON`, include the minus sign with negative zero.
+
+#### 2.0.8
+
+* 2/10/2015
+* Internal round function bugfix.
+
+#### 2.0.6
+
+* 31/03/2015
+* Add bower.json. Tweak division after in-depth review.
+
+#### 2.0.5
+
+* 25/03/2015
+* Amend README. Remove bitcoin address.
+
+#### 2.0.4
+
+* 25/03/2015
+* Critical bugfix #58: division.
+
+#### 2.0.3
+
+* 18/02/2015
+* Amend README. Add source map.
+
+#### 2.0.2
+
+* 18/02/2015
+* Correct links.
+
+#### 2.0.1
+
+* 18/02/2015
+* Add `max`, `min`, `precision`, `random`, `shiftedBy`, `toDigits` and `truncated` methods.
+* Add the short-forms: `add`, `mul`, `sd`, `sub` and `trunc`.
+* Add an `another` method to enable multiple independent constructors to be created.
+* Add support for the base 2, 8 and 16 prefixes `0b`, `0o` and `0x`.
+* Enable a rounding mode to be specified as a second parameter to `toExponential`, `toFixed`, `toFormat` and `toPrecision`.
+* Add a `CRYPTO` configuration property so cryptographically-secure pseudo-random number generation can be specified.
+* Add a `MODULO_MODE` configuration property to enable the rounding mode used by the `modulo` operation to be specified.
+* Add a `POW_PRECISION` configuration property to enable the number of significant digits calculated by the power operation to be limited.
+* Improve code quality.
+* Improve documentation.
+
+#### 2.0.0
+
+* 29/12/2014
+* Add `dividedToIntegerBy`, `isInteger` and `toFormat` methods.
+* Remove the following short-forms: `isF`, `isZ`, `toE`, `toF`, `toFr`, `toN`, `toP`, `toS`.
+* Store a BigNumber's coefficient in base 1e14, rather than base 10.
+* Add fast path for integers to BigNumber constructor.
+* Incorporate the library into the online documentation.
+
+#### 1.5.0
+
+* 13/11/2014
+* Add `toJSON` and `decimalPlaces` methods.
+
+#### 1.4.1
+
+* 08/06/2014
+* Amend README.
+
+#### 1.4.0
+
+* 08/05/2014
+* Add `toNumber`.
+
+#### 1.3.0
+
+* 08/11/2013
+* Ensure correct rounding of `sqrt` in all, rather than almost all, cases.
+* Maximum radix to 64.
+
+#### 1.2.1
+
+* 17/10/2013
+* Sign of zero when x < 0 and x + (-x) = 0.
+
+#### 1.2.0
+
+* 19/9/2013
+* Throw Error objects for stack.
+
+#### 1.1.1
+
+* 22/8/2013
+* Show original value in constructor error message.
+
+#### 1.1.0
+
+* 1/8/2013
+* Allow numbers with trailing radix point.
+
+#### 1.0.1
+
+* Bugfix: error messages with incorrect method name
+
+#### 1.0.0
+
+* 8/11/2012
+* Initial release
diff --git a/node_modules/bignumber.js/LICENCE.md b/node_modules/bignumber.js/LICENCE.md
new file mode 100644
index 00000000..2800f9ee
--- /dev/null
+++ b/node_modules/bignumber.js/LICENCE.md
@@ -0,0 +1,26 @@
+The MIT License (MIT)
+=====================
+
+Copyright © `<2025>` `Michael Mclaughlin`
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the “Software”), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/node_modules/bignumber.js/README.md b/node_modules/bignumber.js/README.md
new file mode 100644
index 00000000..5a40d09f
--- /dev/null
+++ b/node_modules/bignumber.js/README.md
@@ -0,0 +1,289 @@
+
+
+A JavaScript library for arbitrary-precision decimal and non-decimal arithmetic.
+
+[](https://www.npmjs.com/package/bignumber.js)
+[](https://www.npmjs.com/package/bignumber.js)
+[](https://github.com/MikeMcl/bignumber.js/actions/workflows/ci.yml)
+
+
+
+## Features
+
+- Integers and decimals
+- Simple API but full-featured
+- Faster, smaller, and perhaps easier to use than JavaScript versions of Java's BigDecimal
+- 8 KB minified and gzipped
+- Replicates the `toExponential`, `toFixed`, `toPrecision` and `toString` methods of JavaScript's Number type
+- Includes a `toFraction` and a correctly-rounded `squareRoot` method
+- Supports cryptographically-secure pseudo-random number generation
+- No dependencies
+- Wide platform compatibility: uses JavaScript 1.5 (ECMAScript 3) features only
+- Comprehensive [documentation](http://mikemcl.github.io/bignumber.js/) and test set
+
+
+
+If a smaller and simpler library is required see [big.js](https://github.com/MikeMcl/big.js/).
+It's less than half the size but only works with decimal numbers and only has half the methods.
+It also has fewer configuration options than this library, and does not allow `NaN` or `Infinity`.
+
+See also [decimal.js](https://github.com/MikeMcl/decimal.js/), which among other things adds support for non-integer powers, and performs all operations to a specified number of significant digits.
+
+## Load
+
+The library is the single JavaScript file *bignumber.js* or ES module *bignumber.mjs*.
+
+### Browser
+
+```html
+
+```
+
+> ES module
+
+```html
+
+```
+
+### [Node.js](http://nodejs.org)
+
+```bash
+npm install bignumber.js
+```
+
+```javascript
+const BigNumber = require('bignumber.js');
+```
+
+> ES module
+
+```javascript
+import BigNumber from "bignumber.js";
+```
+
+### [Deno](https://deno.land/)
+
+```javascript
+// @deno-types="https://raw.githubusercontent.com/mikemcl/bignumber.js/v9.3.1/bignumber.d.mts"
+import BigNumber from 'https://raw.githubusercontent.com/mikemcl/bignumber.js/v9.3.1/bignumber.mjs';
+
+// @deno-types="https://unpkg.com/bignumber.js@latest/bignumber.d.mts"
+import { BigNumber } from 'https://unpkg.com/bignumber.js@latest/bignumber.mjs';
+```
+
+## Use
+
+The library exports a single constructor function, [`BigNumber`](http://mikemcl.github.io/bignumber.js/#bignumber), which accepts a value of type Number, String or BigNumber,
+
+```javascript
+let x = new BigNumber(123.4567);
+let y = BigNumber('123456.7e-3');
+let z = new BigNumber(x);
+x.isEqualTo(y) && y.isEqualTo(z) && x.isEqualTo(z); // true
+```
+
+To get the string value of a BigNumber use [`toString()`](http://mikemcl.github.io/bignumber.js/#toS) or [`toFixed()`](http://mikemcl.github.io/bignumber.js/#toFix). Using `toFixed()` prevents exponential notation being returned, no matter how large or small the value.
+
+```javascript
+let x = new BigNumber('1111222233334444555566');
+x.toString(); // "1.111222233334444555566e+21"
+x.toFixed(); // "1111222233334444555566"
+```
+
+If the limited precision of Number values is not well understood, it is recommended to create BigNumbers from String values rather than Number values to avoid a potential loss of precision.
+
+*In all further examples below, `let`, semicolons and `toString` calls are not shown. If a commented-out value is in quotes it means `toString` has been called on the preceding expression.*
+
+```javascript
+// Precision loss from using numeric literals with more than 15 significant digits.
+new BigNumber(1.0000000000000001) // '1'
+new BigNumber(88259496234518.57) // '88259496234518.56'
+new BigNumber(99999999999999999999) // '100000000000000000000'
+
+// Precision loss from using numeric literals outside the range of Number values.
+new BigNumber(2e+308) // 'Infinity'
+new BigNumber(1e-324) // '0'
+
+// Precision loss from the unexpected result of arithmetic with Number values.
+new BigNumber(0.7 + 0.1) // '0.7999999999999999'
+```
+
+When creating a BigNumber from a Number, note that a BigNumber is created from a Number's decimal `toString()` value not from its underlying binary value. If the latter is required, then pass the Number's `toString(2)` value and specify base 2.
+
+```javascript
+new BigNumber(Number.MAX_VALUE.toString(2), 2)
+```
+
+BigNumbers can be created from values in bases from 2 to 36. See [`ALPHABET`](http://mikemcl.github.io/bignumber.js/#alphabet) to extend this range.
+
+```javascript
+a = new BigNumber(1011, 2) // "11"
+b = new BigNumber('zz.9', 36) // "1295.25"
+c = a.plus(b) // "1306.25"
+```
+
+*Performance is better if base 10 is NOT specified for decimal values. Only specify base 10 when you want to limit the number of decimal places of the input value to the current [`DECIMAL_PLACES`](http://mikemcl.github.io/bignumber.js/#decimal-places) setting.*
+
+A BigNumber is immutable in the sense that it is not changed by its methods.
+
+```javascript
+0.3 - 0.1 // 0.19999999999999998
+x = new BigNumber(0.3)
+x.minus(0.1) // "0.2"
+x // "0.3"
+```
+
+The methods that return a BigNumber can be chained.
+
+```javascript
+x.dividedBy(y).plus(z).times(9)
+x.times('1.23456780123456789e+9').plus(9876.5432321).dividedBy('4444562598.111772').integerValue()
+```
+
+Some of the longer method names have a shorter alias.
+
+```javascript
+x.squareRoot().dividedBy(y).exponentiatedBy(3).isEqualTo(x.sqrt().div(y).pow(3)) // true
+x.modulo(y).multipliedBy(z).eq(x.mod(y).times(z)) // true
+```
+
+As with JavaScript's Number type, there are [`toExponential`](http://mikemcl.github.io/bignumber.js/#toE), [`toFixed`](http://mikemcl.github.io/bignumber.js/#toFix) and [`toPrecision`](http://mikemcl.github.io/bignumber.js/#toP) methods.
+
+```javascript
+x = new BigNumber(255.5)
+x.toExponential(5) // "2.55500e+2"
+x.toFixed(5) // "255.50000"
+x.toPrecision(5) // "255.50"
+x.toNumber() // 255.5
+```
+
+ A base can be specified for [`toString`](http://mikemcl.github.io/bignumber.js/#toS).
+
+*Performance is better if base 10 is NOT specified, i.e. use `toString()` not `toString(10)`. Only specify base 10 when you want to limit the number of decimal places of the string to the current [`DECIMAL_PLACES`](http://mikemcl.github.io/bignumber.js/#decimal-places) setting.*
+
+ ```javascript
+ x.toString(16) // "ff.8"
+ ```
+
+There is a [`toFormat`](http://mikemcl.github.io/bignumber.js/#toFor) method which may be useful for internationalisation.
+
+```javascript
+y = new BigNumber('1234567.898765')
+y.toFormat(2) // "1,234,567.90"
+```
+
+The maximum number of decimal places of the result of an operation involving division (i.e. a division, square root, base conversion or negative power operation) is set using the `set` or `config` method of the `BigNumber` constructor.
+
+The other arithmetic operations always give the exact result.
+
+```javascript
+BigNumber.set({ DECIMAL_PLACES: 10, ROUNDING_MODE: 4 })
+
+x = new BigNumber(2)
+y = new BigNumber(3)
+z = x.dividedBy(y) // "0.6666666667"
+z.squareRoot() // "0.8164965809"
+z.exponentiatedBy(-3) // "3.3749999995"
+z.toString(2) // "0.1010101011"
+z.multipliedBy(z) // "0.44444444448888888889"
+z.multipliedBy(z).decimalPlaces(10) // "0.4444444445"
+```
+
+There is a [`toFraction`](http://mikemcl.github.io/bignumber.js/#toFr) method with an optional *maximum denominator* argument
+
+```javascript
+y = new BigNumber(355)
+pi = y.dividedBy(113) // "3.1415929204"
+pi.toFraction() // [ "7853982301", "2500000000" ]
+pi.toFraction(1000) // [ "355", "113" ]
+```
+
+and [`isNaN`](http://mikemcl.github.io/bignumber.js/#isNaN) and [`isFinite`](http://mikemcl.github.io/bignumber.js/#isF) methods, as `NaN` and `Infinity` are valid `BigNumber` values.
+
+```javascript
+x = new BigNumber(NaN) // "NaN"
+y = new BigNumber(Infinity) // "Infinity"
+x.isNaN() && !y.isNaN() && !x.isFinite() && !y.isFinite() // true
+```
+
+The value of a BigNumber is stored in a decimal floating point format in terms of a coefficient, exponent and sign.
+
+```javascript
+x = new BigNumber(-123.456);
+x.c // [ 123, 45600000000000 ] coefficient (i.e. significand)
+x.e // 2 exponent
+x.s // -1 sign
+```
+
+For advanced usage, multiple BigNumber constructors can be created, each with its own independent configuration.
+
+```javascript
+// Set DECIMAL_PLACES for the original BigNumber constructor
+BigNumber.set({ DECIMAL_PLACES: 10 })
+
+// Create another BigNumber constructor, optionally passing in a configuration object
+BN = BigNumber.clone({ DECIMAL_PLACES: 5 })
+
+x = new BigNumber(1)
+y = new BN(1)
+
+x.div(3) // '0.3333333333'
+y.div(3) // '0.33333'
+```
+
+To avoid having to call `toString` or `valueOf` on a BigNumber to get its value in the Node.js REPL or when using `console.log` use
+
+```javascript
+BigNumber.prototype[require('util').inspect.custom] = BigNumber.prototype.valueOf;
+```
+
+For further information see the [API](http://mikemcl.github.io/bignumber.js/) reference in the *doc* directory.
+
+## Test
+
+The *test/modules* directory contains the test scripts for each method.
+
+The tests can be run with Node.js or a browser. For Node.js use
+
+```bash
+npm test
+```
+
+or
+
+```bash
+node test/test
+```
+
+To test a single method, use, for example
+
+```bash
+node test/methods/toFraction
+```
+
+For the browser, open *test/test.html*.
+
+## Minify
+
+To minify using, for example, [terser](https://github.com/terser/terser)
+
+```bash
+npm install -g terser
+```
+
+```bash
+terser big.js -c -m -o big.min.js
+```
+
+## Licence
+
+The MIT Licence.
+
+See [LICENCE](https://github.com/MikeMcl/bignumber.js/blob/main/LICENCE.md).
diff --git a/node_modules/bignumber.js/bignumber.d.mts b/node_modules/bignumber.js/bignumber.d.mts
new file mode 100644
index 00000000..a58ca365
--- /dev/null
+++ b/node_modules/bignumber.js/bignumber.d.mts
@@ -0,0 +1,6 @@
+///
+
+export default BigNumber;
+
+declare const BigNumberType: typeof BigNumber;
+export { BigNumberType as BigNumber };
diff --git a/node_modules/bignumber.js/bignumber.d.ts b/node_modules/bignumber.js/bignumber.d.ts
new file mode 100644
index 00000000..6fde7b0c
--- /dev/null
+++ b/node_modules/bignumber.js/bignumber.d.ts
@@ -0,0 +1,5 @@
+///
+
+export = BigNumber;
+
+export as namespace BigNumber;
diff --git a/node_modules/bignumber.js/bignumber.js b/node_modules/bignumber.js/bignumber.js
new file mode 100644
index 00000000..663c2ae7
--- /dev/null
+++ b/node_modules/bignumber.js/bignumber.js
@@ -0,0 +1,2922 @@
+;(function (globalObject) {
+ 'use strict';
+
+/*
+ * bignumber.js v9.3.1
+ * A JavaScript library for arbitrary-precision arithmetic.
+ * https://github.com/MikeMcl/bignumber.js
+ * Copyright (c) 2025 Michael Mclaughlin
+ * MIT Licensed.
+ *
+ * BigNumber.prototype methods | BigNumber methods
+ * |
+ * absoluteValue abs | clone
+ * comparedTo | config set
+ * decimalPlaces dp | DECIMAL_PLACES
+ * dividedBy div | ROUNDING_MODE
+ * dividedToIntegerBy idiv | EXPONENTIAL_AT
+ * exponentiatedBy pow | RANGE
+ * integerValue | CRYPTO
+ * isEqualTo eq | MODULO_MODE
+ * isFinite | POW_PRECISION
+ * isGreaterThan gt | FORMAT
+ * isGreaterThanOrEqualTo gte | ALPHABET
+ * isInteger | isBigNumber
+ * isLessThan lt | maximum max
+ * isLessThanOrEqualTo lte | minimum min
+ * isNaN | random
+ * isNegative | sum
+ * isPositive |
+ * isZero |
+ * minus |
+ * modulo mod |
+ * multipliedBy times |
+ * negated |
+ * plus |
+ * precision sd |
+ * shiftedBy |
+ * squareRoot sqrt |
+ * toExponential |
+ * toFixed |
+ * toFormat |
+ * toFraction |
+ * toJSON |
+ * toNumber |
+ * toPrecision |
+ * toString |
+ * valueOf |
+ *
+ */
+
+
+ var BigNumber,
+ isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,
+ mathceil = Math.ceil,
+ mathfloor = Math.floor,
+
+ bignumberError = '[BigNumber Error] ',
+ tooManyDigits = bignumberError + 'Number primitive has more than 15 significant digits: ',
+
+ BASE = 1e14,
+ LOG_BASE = 14,
+ MAX_SAFE_INTEGER = 0x1fffffffffffff, // 2^53 - 1
+ // MAX_INT32 = 0x7fffffff, // 2^31 - 1
+ POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13],
+ SQRT_BASE = 1e7,
+
+ // EDITABLE
+ // The limit on the value of DECIMAL_PLACES, TO_EXP_NEG, TO_EXP_POS, MIN_EXP, MAX_EXP, and
+ // the arguments to toExponential, toFixed, toFormat, and toPrecision.
+ MAX = 1E9; // 0 to MAX_INT32
+
+
+ /*
+ * Create and return a BigNumber constructor.
+ */
+ function clone(configObject) {
+ var div, convertBase, parseNumeric,
+ P = BigNumber.prototype = { constructor: BigNumber, toString: null, valueOf: null },
+ ONE = new BigNumber(1),
+
+
+ //----------------------------- EDITABLE CONFIG DEFAULTS -------------------------------
+
+
+ // The default values below must be integers within the inclusive ranges stated.
+ // The values can also be changed at run-time using BigNumber.set.
+
+ // The maximum number of decimal places for operations involving division.
+ DECIMAL_PLACES = 20, // 0 to MAX
+
+ // The rounding mode used when rounding to the above decimal places, and when using
+ // toExponential, toFixed, toFormat and toPrecision, and round (default value).
+ // UP 0 Away from zero.
+ // DOWN 1 Towards zero.
+ // CEIL 2 Towards +Infinity.
+ // FLOOR 3 Towards -Infinity.
+ // HALF_UP 4 Towards nearest neighbour. If equidistant, up.
+ // HALF_DOWN 5 Towards nearest neighbour. If equidistant, down.
+ // HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour.
+ // HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity.
+ // HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.
+ ROUNDING_MODE = 4, // 0 to 8
+
+ // EXPONENTIAL_AT : [TO_EXP_NEG , TO_EXP_POS]
+
+ // The exponent value at and beneath which toString returns exponential notation.
+ // Number type: -7
+ TO_EXP_NEG = -7, // 0 to -MAX
+
+ // The exponent value at and above which toString returns exponential notation.
+ // Number type: 21
+ TO_EXP_POS = 21, // 0 to MAX
+
+ // RANGE : [MIN_EXP, MAX_EXP]
+
+ // The minimum exponent value, beneath which underflow to zero occurs.
+ // Number type: -324 (5e-324)
+ MIN_EXP = -1e7, // -1 to -MAX
+
+ // The maximum exponent value, above which overflow to Infinity occurs.
+ // Number type: 308 (1.7976931348623157e+308)
+ // For MAX_EXP > 1e7, e.g. new BigNumber('1e100000000').plus(1) may be slow.
+ MAX_EXP = 1e7, // 1 to MAX
+
+ // Whether to use cryptographically-secure random number generation, if available.
+ CRYPTO = false, // true or false
+
+ // The modulo mode used when calculating the modulus: a mod n.
+ // The quotient (q = a / n) is calculated according to the corresponding rounding mode.
+ // The remainder (r) is calculated as: r = a - n * q.
+ //
+ // UP 0 The remainder is positive if the dividend is negative, else is negative.
+ // DOWN 1 The remainder has the same sign as the dividend.
+ // This modulo mode is commonly known as 'truncated division' and is
+ // equivalent to (a % n) in JavaScript.
+ // FLOOR 3 The remainder has the same sign as the divisor (Python %).
+ // HALF_EVEN 6 This modulo mode implements the IEEE 754 remainder function.
+ // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)).
+ // The remainder is always positive.
+ //
+ // The truncated division, floored division, Euclidian division and IEEE 754 remainder
+ // modes are commonly used for the modulus operation.
+ // Although the other rounding modes can also be used, they may not give useful results.
+ MODULO_MODE = 1, // 0 to 9
+
+ // The maximum number of significant digits of the result of the exponentiatedBy operation.
+ // If POW_PRECISION is 0, there will be unlimited significant digits.
+ POW_PRECISION = 0, // 0 to MAX
+
+ // The format specification used by the BigNumber.prototype.toFormat method.
+ FORMAT = {
+ prefix: '',
+ groupSize: 3,
+ secondaryGroupSize: 0,
+ groupSeparator: ',',
+ decimalSeparator: '.',
+ fractionGroupSize: 0,
+ fractionGroupSeparator: '\xA0', // non-breaking space
+ suffix: ''
+ },
+
+ // The alphabet used for base conversion. It must be at least 2 characters long, with no '+',
+ // '-', '.', whitespace, or repeated character.
+ // '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_'
+ ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyz',
+ alphabetHasNormalDecimalDigits = true;
+
+
+ //------------------------------------------------------------------------------------------
+
+
+ // CONSTRUCTOR
+
+
+ /*
+ * The BigNumber constructor and exported function.
+ * Create and return a new instance of a BigNumber object.
+ *
+ * v {number|string|BigNumber} A numeric value.
+ * [b] {number} The base of v. Integer, 2 to ALPHABET.length inclusive.
+ */
+ function BigNumber(v, b) {
+ var alphabet, c, caseChanged, e, i, isNum, len, str,
+ x = this;
+
+ // Enable constructor call without `new`.
+ if (!(x instanceof BigNumber)) return new BigNumber(v, b);
+
+ if (b == null) {
+
+ if (v && v._isBigNumber === true) {
+ x.s = v.s;
+
+ if (!v.c || v.e > MAX_EXP) {
+ x.c = x.e = null;
+ } else if (v.e < MIN_EXP) {
+ x.c = [x.e = 0];
+ } else {
+ x.e = v.e;
+ x.c = v.c.slice();
+ }
+
+ return;
+ }
+
+ if ((isNum = typeof v == 'number') && v * 0 == 0) {
+
+ // Use `1 / n` to handle minus zero also.
+ x.s = 1 / v < 0 ? (v = -v, -1) : 1;
+
+ // Fast path for integers, where n < 2147483648 (2**31).
+ if (v === ~~v) {
+ for (e = 0, i = v; i >= 10; i /= 10, e++);
+
+ if (e > MAX_EXP) {
+ x.c = x.e = null;
+ } else {
+ x.e = e;
+ x.c = [v];
+ }
+
+ return;
+ }
+
+ str = String(v);
+ } else {
+
+ if (!isNumeric.test(str = String(v))) return parseNumeric(x, str, isNum);
+
+ x.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1;
+ }
+
+ // Decimal point?
+ if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');
+
+ // Exponential form?
+ if ((i = str.search(/e/i)) > 0) {
+
+ // Determine exponent.
+ if (e < 0) e = i;
+ e += +str.slice(i + 1);
+ str = str.substring(0, i);
+ } else if (e < 0) {
+
+ // Integer.
+ e = str.length;
+ }
+
+ } else {
+
+ // '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}'
+ intCheck(b, 2, ALPHABET.length, 'Base');
+
+ // Allow exponential notation to be used with base 10 argument, while
+ // also rounding to DECIMAL_PLACES as with other bases.
+ if (b == 10 && alphabetHasNormalDecimalDigits) {
+ x = new BigNumber(v);
+ return round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE);
+ }
+
+ str = String(v);
+
+ if (isNum = typeof v == 'number') {
+
+ // Avoid potential interpretation of Infinity and NaN as base 44+ values.
+ if (v * 0 != 0) return parseNumeric(x, str, isNum, b);
+
+ x.s = 1 / v < 0 ? (str = str.slice(1), -1) : 1;
+
+ // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}'
+ if (BigNumber.DEBUG && str.replace(/^0\.0*|\./, '').length > 15) {
+ throw Error
+ (tooManyDigits + v);
+ }
+ } else {
+ x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1;
+ }
+
+ alphabet = ALPHABET.slice(0, b);
+ e = i = 0;
+
+ // Check that str is a valid base b number.
+ // Don't use RegExp, so alphabet can contain special characters.
+ for (len = str.length; i < len; i++) {
+ if (alphabet.indexOf(c = str.charAt(i)) < 0) {
+ if (c == '.') {
+
+ // If '.' is not the first character and it has not be found before.
+ if (i > e) {
+ e = len;
+ continue;
+ }
+ } else if (!caseChanged) {
+
+ // Allow e.g. hexadecimal 'FF' as well as 'ff'.
+ if (str == str.toUpperCase() && (str = str.toLowerCase()) ||
+ str == str.toLowerCase() && (str = str.toUpperCase())) {
+ caseChanged = true;
+ i = -1;
+ e = 0;
+ continue;
+ }
+ }
+
+ return parseNumeric(x, String(v), isNum, b);
+ }
+ }
+
+ // Prevent later check for length on converted number.
+ isNum = false;
+ str = convertBase(str, b, 10, x.s);
+
+ // Decimal point?
+ if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');
+ else e = str.length;
+ }
+
+ // Determine leading zeros.
+ for (i = 0; str.charCodeAt(i) === 48; i++);
+
+ // Determine trailing zeros.
+ for (len = str.length; str.charCodeAt(--len) === 48;);
+
+ if (str = str.slice(i, ++len)) {
+ len -= i;
+
+ // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}'
+ if (isNum && BigNumber.DEBUG &&
+ len > 15 && (v > MAX_SAFE_INTEGER || v !== mathfloor(v))) {
+ throw Error
+ (tooManyDigits + (x.s * v));
+ }
+
+ // Overflow?
+ if ((e = e - i - 1) > MAX_EXP) {
+
+ // Infinity.
+ x.c = x.e = null;
+
+ // Underflow?
+ } else if (e < MIN_EXP) {
+
+ // Zero.
+ x.c = [x.e = 0];
+ } else {
+ x.e = e;
+ x.c = [];
+
+ // Transform base
+
+ // e is the base 10 exponent.
+ // i is where to slice str to get the first element of the coefficient array.
+ i = (e + 1) % LOG_BASE;
+ if (e < 0) i += LOG_BASE; // i < 1
+
+ if (i < len) {
+ if (i) x.c.push(+str.slice(0, i));
+
+ for (len -= LOG_BASE; i < len;) {
+ x.c.push(+str.slice(i, i += LOG_BASE));
+ }
+
+ i = LOG_BASE - (str = str.slice(i)).length;
+ } else {
+ i -= len;
+ }
+
+ for (; i--; str += '0');
+ x.c.push(+str);
+ }
+ } else {
+
+ // Zero.
+ x.c = [x.e = 0];
+ }
+ }
+
+
+ // CONSTRUCTOR PROPERTIES
+
+
+ BigNumber.clone = clone;
+
+ BigNumber.ROUND_UP = 0;
+ BigNumber.ROUND_DOWN = 1;
+ BigNumber.ROUND_CEIL = 2;
+ BigNumber.ROUND_FLOOR = 3;
+ BigNumber.ROUND_HALF_UP = 4;
+ BigNumber.ROUND_HALF_DOWN = 5;
+ BigNumber.ROUND_HALF_EVEN = 6;
+ BigNumber.ROUND_HALF_CEIL = 7;
+ BigNumber.ROUND_HALF_FLOOR = 8;
+ BigNumber.EUCLID = 9;
+
+
+ /*
+ * Configure infrequently-changing library-wide settings.
+ *
+ * Accept an object with the following optional properties (if the value of a property is
+ * a number, it must be an integer within the inclusive range stated):
+ *
+ * DECIMAL_PLACES {number} 0 to MAX
+ * ROUNDING_MODE {number} 0 to 8
+ * EXPONENTIAL_AT {number|number[]} -MAX to MAX or [-MAX to 0, 0 to MAX]
+ * RANGE {number|number[]} -MAX to MAX (not zero) or [-MAX to -1, 1 to MAX]
+ * CRYPTO {boolean} true or false
+ * MODULO_MODE {number} 0 to 9
+ * POW_PRECISION {number} 0 to MAX
+ * ALPHABET {string} A string of two or more unique characters which does
+ * not contain '.'.
+ * FORMAT {object} An object with some of the following properties:
+ * prefix {string}
+ * groupSize {number}
+ * secondaryGroupSize {number}
+ * groupSeparator {string}
+ * decimalSeparator {string}
+ * fractionGroupSize {number}
+ * fractionGroupSeparator {string}
+ * suffix {string}
+ *
+ * (The values assigned to the above FORMAT object properties are not checked for validity.)
+ *
+ * E.g.
+ * BigNumber.config({ DECIMAL_PLACES : 20, ROUNDING_MODE : 4 })
+ *
+ * Ignore properties/parameters set to null or undefined, except for ALPHABET.
+ *
+ * Return an object with the properties current values.
+ */
+ BigNumber.config = BigNumber.set = function (obj) {
+ var p, v;
+
+ if (obj != null) {
+
+ if (typeof obj == 'object') {
+
+ // DECIMAL_PLACES {number} Integer, 0 to MAX inclusive.
+ // '[BigNumber Error] DECIMAL_PLACES {not a primitive number|not an integer|out of range}: {v}'
+ if (obj.hasOwnProperty(p = 'DECIMAL_PLACES')) {
+ v = obj[p];
+ intCheck(v, 0, MAX, p);
+ DECIMAL_PLACES = v;
+ }
+
+ // ROUNDING_MODE {number} Integer, 0 to 8 inclusive.
+ // '[BigNumber Error] ROUNDING_MODE {not a primitive number|not an integer|out of range}: {v}'
+ if (obj.hasOwnProperty(p = 'ROUNDING_MODE')) {
+ v = obj[p];
+ intCheck(v, 0, 8, p);
+ ROUNDING_MODE = v;
+ }
+
+ // EXPONENTIAL_AT {number|number[]}
+ // Integer, -MAX to MAX inclusive or
+ // [integer -MAX to 0 inclusive, 0 to MAX inclusive].
+ // '[BigNumber Error] EXPONENTIAL_AT {not a primitive number|not an integer|out of range}: {v}'
+ if (obj.hasOwnProperty(p = 'EXPONENTIAL_AT')) {
+ v = obj[p];
+ if (v && v.pop) {
+ intCheck(v[0], -MAX, 0, p);
+ intCheck(v[1], 0, MAX, p);
+ TO_EXP_NEG = v[0];
+ TO_EXP_POS = v[1];
+ } else {
+ intCheck(v, -MAX, MAX, p);
+ TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v);
+ }
+ }
+
+ // RANGE {number|number[]} Non-zero integer, -MAX to MAX inclusive or
+ // [integer -MAX to -1 inclusive, integer 1 to MAX inclusive].
+ // '[BigNumber Error] RANGE {not a primitive number|not an integer|out of range|cannot be zero}: {v}'
+ if (obj.hasOwnProperty(p = 'RANGE')) {
+ v = obj[p];
+ if (v && v.pop) {
+ intCheck(v[0], -MAX, -1, p);
+ intCheck(v[1], 1, MAX, p);
+ MIN_EXP = v[0];
+ MAX_EXP = v[1];
+ } else {
+ intCheck(v, -MAX, MAX, p);
+ if (v) {
+ MIN_EXP = -(MAX_EXP = v < 0 ? -v : v);
+ } else {
+ throw Error
+ (bignumberError + p + ' cannot be zero: ' + v);
+ }
+ }
+ }
+
+ // CRYPTO {boolean} true or false.
+ // '[BigNumber Error] CRYPTO not true or false: {v}'
+ // '[BigNumber Error] crypto unavailable'
+ if (obj.hasOwnProperty(p = 'CRYPTO')) {
+ v = obj[p];
+ if (v === !!v) {
+ if (v) {
+ if (typeof crypto != 'undefined' && crypto &&
+ (crypto.getRandomValues || crypto.randomBytes)) {
+ CRYPTO = v;
+ } else {
+ CRYPTO = !v;
+ throw Error
+ (bignumberError + 'crypto unavailable');
+ }
+ } else {
+ CRYPTO = v;
+ }
+ } else {
+ throw Error
+ (bignumberError + p + ' not true or false: ' + v);
+ }
+ }
+
+ // MODULO_MODE {number} Integer, 0 to 9 inclusive.
+ // '[BigNumber Error] MODULO_MODE {not a primitive number|not an integer|out of range}: {v}'
+ if (obj.hasOwnProperty(p = 'MODULO_MODE')) {
+ v = obj[p];
+ intCheck(v, 0, 9, p);
+ MODULO_MODE = v;
+ }
+
+ // POW_PRECISION {number} Integer, 0 to MAX inclusive.
+ // '[BigNumber Error] POW_PRECISION {not a primitive number|not an integer|out of range}: {v}'
+ if (obj.hasOwnProperty(p = 'POW_PRECISION')) {
+ v = obj[p];
+ intCheck(v, 0, MAX, p);
+ POW_PRECISION = v;
+ }
+
+ // FORMAT {object}
+ // '[BigNumber Error] FORMAT not an object: {v}'
+ if (obj.hasOwnProperty(p = 'FORMAT')) {
+ v = obj[p];
+ if (typeof v == 'object') FORMAT = v;
+ else throw Error
+ (bignumberError + p + ' not an object: ' + v);
+ }
+
+ // ALPHABET {string}
+ // '[BigNumber Error] ALPHABET invalid: {v}'
+ if (obj.hasOwnProperty(p = 'ALPHABET')) {
+ v = obj[p];
+
+ // Disallow if less than two characters,
+ // or if it contains '+', '-', '.', whitespace, or a repeated character.
+ if (typeof v == 'string' && !/^.?$|[+\-.\s]|(.).*\1/.test(v)) {
+ alphabetHasNormalDecimalDigits = v.slice(0, 10) == '0123456789';
+ ALPHABET = v;
+ } else {
+ throw Error
+ (bignumberError + p + ' invalid: ' + v);
+ }
+ }
+
+ } else {
+
+ // '[BigNumber Error] Object expected: {v}'
+ throw Error
+ (bignumberError + 'Object expected: ' + obj);
+ }
+ }
+
+ return {
+ DECIMAL_PLACES: DECIMAL_PLACES,
+ ROUNDING_MODE: ROUNDING_MODE,
+ EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS],
+ RANGE: [MIN_EXP, MAX_EXP],
+ CRYPTO: CRYPTO,
+ MODULO_MODE: MODULO_MODE,
+ POW_PRECISION: POW_PRECISION,
+ FORMAT: FORMAT,
+ ALPHABET: ALPHABET
+ };
+ };
+
+
+ /*
+ * Return true if v is a BigNumber instance, otherwise return false.
+ *
+ * If BigNumber.DEBUG is true, throw if a BigNumber instance is not well-formed.
+ *
+ * v {any}
+ *
+ * '[BigNumber Error] Invalid BigNumber: {v}'
+ */
+ BigNumber.isBigNumber = function (v) {
+ if (!v || v._isBigNumber !== true) return false;
+ if (!BigNumber.DEBUG) return true;
+
+ var i, n,
+ c = v.c,
+ e = v.e,
+ s = v.s;
+
+ out: if ({}.toString.call(c) == '[object Array]') {
+
+ if ((s === 1 || s === -1) && e >= -MAX && e <= MAX && e === mathfloor(e)) {
+
+ // If the first element is zero, the BigNumber value must be zero.
+ if (c[0] === 0) {
+ if (e === 0 && c.length === 1) return true;
+ break out;
+ }
+
+ // Calculate number of digits that c[0] should have, based on the exponent.
+ i = (e + 1) % LOG_BASE;
+ if (i < 1) i += LOG_BASE;
+
+ // Calculate number of digits of c[0].
+ //if (Math.ceil(Math.log(c[0] + 1) / Math.LN10) == i) {
+ if (String(c[0]).length == i) {
+
+ for (i = 0; i < c.length; i++) {
+ n = c[i];
+ if (n < 0 || n >= BASE || n !== mathfloor(n)) break out;
+ }
+
+ // Last element cannot be zero, unless it is the only element.
+ if (n !== 0) return true;
+ }
+ }
+
+ // Infinity/NaN
+ } else if (c === null && e === null && (s === null || s === 1 || s === -1)) {
+ return true;
+ }
+
+ throw Error
+ (bignumberError + 'Invalid BigNumber: ' + v);
+ };
+
+
+ /*
+ * Return a new BigNumber whose value is the maximum of the arguments.
+ *
+ * arguments {number|string|BigNumber}
+ */
+ BigNumber.maximum = BigNumber.max = function () {
+ return maxOrMin(arguments, -1);
+ };
+
+
+ /*
+ * Return a new BigNumber whose value is the minimum of the arguments.
+ *
+ * arguments {number|string|BigNumber}
+ */
+ BigNumber.minimum = BigNumber.min = function () {
+ return maxOrMin(arguments, 1);
+ };
+
+
+ /*
+ * Return a new BigNumber with a random value equal to or greater than 0 and less than 1,
+ * and with dp, or DECIMAL_PLACES if dp is omitted, decimal places (or less if trailing
+ * zeros are produced).
+ *
+ * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.
+ *
+ * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp}'
+ * '[BigNumber Error] crypto unavailable'
+ */
+ BigNumber.random = (function () {
+ var pow2_53 = 0x20000000000000;
+
+ // Return a 53 bit integer n, where 0 <= n < 9007199254740992.
+ // Check if Math.random() produces more than 32 bits of randomness.
+ // If it does, assume at least 53 bits are produced, otherwise assume at least 30 bits.
+ // 0x40000000 is 2^30, 0x800000 is 2^23, 0x1fffff is 2^21 - 1.
+ var random53bitInt = (Math.random() * pow2_53) & 0x1fffff
+ ? function () { return mathfloor(Math.random() * pow2_53); }
+ : function () { return ((Math.random() * 0x40000000 | 0) * 0x800000) +
+ (Math.random() * 0x800000 | 0); };
+
+ return function (dp) {
+ var a, b, e, k, v,
+ i = 0,
+ c = [],
+ rand = new BigNumber(ONE);
+
+ if (dp == null) dp = DECIMAL_PLACES;
+ else intCheck(dp, 0, MAX);
+
+ k = mathceil(dp / LOG_BASE);
+
+ if (CRYPTO) {
+
+ // Browsers supporting crypto.getRandomValues.
+ if (crypto.getRandomValues) {
+
+ a = crypto.getRandomValues(new Uint32Array(k *= 2));
+
+ for (; i < k;) {
+
+ // 53 bits:
+ // ((Math.pow(2, 32) - 1) * Math.pow(2, 21)).toString(2)
+ // 11111 11111111 11111111 11111111 11100000 00000000 00000000
+ // ((Math.pow(2, 32) - 1) >>> 11).toString(2)
+ // 11111 11111111 11111111
+ // 0x20000 is 2^21.
+ v = a[i] * 0x20000 + (a[i + 1] >>> 11);
+
+ // Rejection sampling:
+ // 0 <= v < 9007199254740992
+ // Probability that v >= 9e15, is
+ // 7199254740992 / 9007199254740992 ~= 0.0008, i.e. 1 in 1251
+ if (v >= 9e15) {
+ b = crypto.getRandomValues(new Uint32Array(2));
+ a[i] = b[0];
+ a[i + 1] = b[1];
+ } else {
+
+ // 0 <= v <= 8999999999999999
+ // 0 <= (v % 1e14) <= 99999999999999
+ c.push(v % 1e14);
+ i += 2;
+ }
+ }
+ i = k / 2;
+
+ // Node.js supporting crypto.randomBytes.
+ } else if (crypto.randomBytes) {
+
+ // buffer
+ a = crypto.randomBytes(k *= 7);
+
+ for (; i < k;) {
+
+ // 0x1000000000000 is 2^48, 0x10000000000 is 2^40
+ // 0x100000000 is 2^32, 0x1000000 is 2^24
+ // 11111 11111111 11111111 11111111 11111111 11111111 11111111
+ // 0 <= v < 9007199254740992
+ v = ((a[i] & 31) * 0x1000000000000) + (a[i + 1] * 0x10000000000) +
+ (a[i + 2] * 0x100000000) + (a[i + 3] * 0x1000000) +
+ (a[i + 4] << 16) + (a[i + 5] << 8) + a[i + 6];
+
+ if (v >= 9e15) {
+ crypto.randomBytes(7).copy(a, i);
+ } else {
+
+ // 0 <= (v % 1e14) <= 99999999999999
+ c.push(v % 1e14);
+ i += 7;
+ }
+ }
+ i = k / 7;
+ } else {
+ CRYPTO = false;
+ throw Error
+ (bignumberError + 'crypto unavailable');
+ }
+ }
+
+ // Use Math.random.
+ if (!CRYPTO) {
+
+ for (; i < k;) {
+ v = random53bitInt();
+ if (v < 9e15) c[i++] = v % 1e14;
+ }
+ }
+
+ k = c[--i];
+ dp %= LOG_BASE;
+
+ // Convert trailing digits to zeros according to dp.
+ if (k && dp) {
+ v = POWS_TEN[LOG_BASE - dp];
+ c[i] = mathfloor(k / v) * v;
+ }
+
+ // Remove trailing elements which are zero.
+ for (; c[i] === 0; c.pop(), i--);
+
+ // Zero?
+ if (i < 0) {
+ c = [e = 0];
+ } else {
+
+ // Remove leading elements which are zero and adjust exponent accordingly.
+ for (e = -1 ; c[0] === 0; c.splice(0, 1), e -= LOG_BASE);
+
+ // Count the digits of the first element of c to determine leading zeros, and...
+ for (i = 1, v = c[0]; v >= 10; v /= 10, i++);
+
+ // adjust the exponent accordingly.
+ if (i < LOG_BASE) e -= LOG_BASE - i;
+ }
+
+ rand.e = e;
+ rand.c = c;
+ return rand;
+ };
+ })();
+
+
+ /*
+ * Return a BigNumber whose value is the sum of the arguments.
+ *
+ * arguments {number|string|BigNumber}
+ */
+ BigNumber.sum = function () {
+ var i = 1,
+ args = arguments,
+ sum = new BigNumber(args[0]);
+ for (; i < args.length;) sum = sum.plus(args[i++]);
+ return sum;
+ };
+
+
+ // PRIVATE FUNCTIONS
+
+
+ // Called by BigNumber and BigNumber.prototype.toString.
+ convertBase = (function () {
+ var decimal = '0123456789';
+
+ /*
+ * Convert string of baseIn to an array of numbers of baseOut.
+ * Eg. toBaseOut('255', 10, 16) returns [15, 15].
+ * Eg. toBaseOut('ff', 16, 10) returns [2, 5, 5].
+ */
+ function toBaseOut(str, baseIn, baseOut, alphabet) {
+ var j,
+ arr = [0],
+ arrL,
+ i = 0,
+ len = str.length;
+
+ for (; i < len;) {
+ for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);
+
+ arr[0] += alphabet.indexOf(str.charAt(i++));
+
+ for (j = 0; j < arr.length; j++) {
+
+ if (arr[j] > baseOut - 1) {
+ if (arr[j + 1] == null) arr[j + 1] = 0;
+ arr[j + 1] += arr[j] / baseOut | 0;
+ arr[j] %= baseOut;
+ }
+ }
+ }
+
+ return arr.reverse();
+ }
+
+ // Convert a numeric string of baseIn to a numeric string of baseOut.
+ // If the caller is toString, we are converting from base 10 to baseOut.
+ // If the caller is BigNumber, we are converting from baseIn to base 10.
+ return function (str, baseIn, baseOut, sign, callerIsToString) {
+ var alphabet, d, e, k, r, x, xc, y,
+ i = str.indexOf('.'),
+ dp = DECIMAL_PLACES,
+ rm = ROUNDING_MODE;
+
+ // Non-integer.
+ if (i >= 0) {
+ k = POW_PRECISION;
+
+ // Unlimited precision.
+ POW_PRECISION = 0;
+ str = str.replace('.', '');
+ y = new BigNumber(baseIn);
+ x = y.pow(str.length - i);
+ POW_PRECISION = k;
+
+ // Convert str as if an integer, then restore the fraction part by dividing the
+ // result by its base raised to a power.
+
+ y.c = toBaseOut(toFixedPoint(coeffToString(x.c), x.e, '0'),
+ 10, baseOut, decimal);
+ y.e = y.c.length;
+ }
+
+ // Convert the number as integer.
+
+ xc = toBaseOut(str, baseIn, baseOut, callerIsToString
+ ? (alphabet = ALPHABET, decimal)
+ : (alphabet = decimal, ALPHABET));
+
+ // xc now represents str as an integer and converted to baseOut. e is the exponent.
+ e = k = xc.length;
+
+ // Remove trailing zeros.
+ for (; xc[--k] == 0; xc.pop());
+
+ // Zero?
+ if (!xc[0]) return alphabet.charAt(0);
+
+ // Does str represent an integer? If so, no need for the division.
+ if (i < 0) {
+ --e;
+ } else {
+ x.c = xc;
+ x.e = e;
+
+ // The sign is needed for correct rounding.
+ x.s = sign;
+ x = div(x, y, dp, rm, baseOut);
+ xc = x.c;
+ r = x.r;
+ e = x.e;
+ }
+
+ // xc now represents str converted to baseOut.
+
+ // The index of the rounding digit.
+ d = e + dp + 1;
+
+ // The rounding digit: the digit to the right of the digit that may be rounded up.
+ i = xc[d];
+
+ // Look at the rounding digits and mode to determine whether to round up.
+
+ k = baseOut / 2;
+ r = r || d < 0 || xc[d + 1] != null;
+
+ r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))
+ : i > k || i == k &&(rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||
+ rm == (x.s < 0 ? 8 : 7));
+
+ // If the index of the rounding digit is not greater than zero, or xc represents
+ // zero, then the result of the base conversion is zero or, if rounding up, a value
+ // such as 0.00001.
+ if (d < 1 || !xc[0]) {
+
+ // 1^-dp or 0
+ str = r ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) : alphabet.charAt(0);
+ } else {
+
+ // Truncate xc to the required number of decimal places.
+ xc.length = d;
+
+ // Round up?
+ if (r) {
+
+ // Rounding up may mean the previous digit has to be rounded up and so on.
+ for (--baseOut; ++xc[--d] > baseOut;) {
+ xc[d] = 0;
+
+ if (!d) {
+ ++e;
+ xc = [1].concat(xc);
+ }
+ }
+ }
+
+ // Determine trailing zeros.
+ for (k = xc.length; !xc[--k];);
+
+ // E.g. [4, 11, 15] becomes 4bf.
+ for (i = 0, str = ''; i <= k; str += alphabet.charAt(xc[i++]));
+
+ // Add leading zeros, decimal point and trailing zeros as required.
+ str = toFixedPoint(str, e, alphabet.charAt(0));
+ }
+
+ // The caller will add the sign.
+ return str;
+ };
+ })();
+
+
+ // Perform division in the specified base. Called by div and convertBase.
+ div = (function () {
+
+ // Assume non-zero x and k.
+ function multiply(x, k, base) {
+ var m, temp, xlo, xhi,
+ carry = 0,
+ i = x.length,
+ klo = k % SQRT_BASE,
+ khi = k / SQRT_BASE | 0;
+
+ for (x = x.slice(); i--;) {
+ xlo = x[i] % SQRT_BASE;
+ xhi = x[i] / SQRT_BASE | 0;
+ m = khi * xlo + xhi * klo;
+ temp = klo * xlo + ((m % SQRT_BASE) * SQRT_BASE) + carry;
+ carry = (temp / base | 0) + (m / SQRT_BASE | 0) + khi * xhi;
+ x[i] = temp % base;
+ }
+
+ if (carry) x = [carry].concat(x);
+
+ return x;
+ }
+
+ function compare(a, b, aL, bL) {
+ var i, cmp;
+
+ if (aL != bL) {
+ cmp = aL > bL ? 1 : -1;
+ } else {
+
+ for (i = cmp = 0; i < aL; i++) {
+
+ if (a[i] != b[i]) {
+ cmp = a[i] > b[i] ? 1 : -1;
+ break;
+ }
+ }
+ }
+
+ return cmp;
+ }
+
+ function subtract(a, b, aL, base) {
+ var i = 0;
+
+ // Subtract b from a.
+ for (; aL--;) {
+ a[aL] -= i;
+ i = a[aL] < b[aL] ? 1 : 0;
+ a[aL] = i * base + a[aL] - b[aL];
+ }
+
+ // Remove leading zeros.
+ for (; !a[0] && a.length > 1; a.splice(0, 1));
+ }
+
+ // x: dividend, y: divisor.
+ return function (x, y, dp, rm, base) {
+ var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0,
+ yL, yz,
+ s = x.s == y.s ? 1 : -1,
+ xc = x.c,
+ yc = y.c;
+
+ // Either NaN, Infinity or 0?
+ if (!xc || !xc[0] || !yc || !yc[0]) {
+
+ return new BigNumber(
+
+ // Return NaN if either NaN, or both Infinity or 0.
+ !x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN :
+
+ // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.
+ xc && xc[0] == 0 || !yc ? s * 0 : s / 0
+ );
+ }
+
+ q = new BigNumber(s);
+ qc = q.c = [];
+ e = x.e - y.e;
+ s = dp + e + 1;
+
+ if (!base) {
+ base = BASE;
+ e = bitFloor(x.e / LOG_BASE) - bitFloor(y.e / LOG_BASE);
+ s = s / LOG_BASE | 0;
+ }
+
+ // Result exponent may be one less then the current value of e.
+ // The coefficients of the BigNumbers from convertBase may have trailing zeros.
+ for (i = 0; yc[i] == (xc[i] || 0); i++);
+
+ if (yc[i] > (xc[i] || 0)) e--;
+
+ if (s < 0) {
+ qc.push(1);
+ more = true;
+ } else {
+ xL = xc.length;
+ yL = yc.length;
+ i = 0;
+ s += 2;
+
+ // Normalise xc and yc so highest order digit of yc is >= base / 2.
+
+ n = mathfloor(base / (yc[0] + 1));
+
+ // Not necessary, but to handle odd bases where yc[0] == (base / 2) - 1.
+ // if (n > 1 || n++ == 1 && yc[0] < base / 2) {
+ if (n > 1) {
+ yc = multiply(yc, n, base);
+ xc = multiply(xc, n, base);
+ yL = yc.length;
+ xL = xc.length;
+ }
+
+ xi = yL;
+ rem = xc.slice(0, yL);
+ remL = rem.length;
+
+ // Add zeros to make remainder as long as divisor.
+ for (; remL < yL; rem[remL++] = 0);
+ yz = yc.slice();
+ yz = [0].concat(yz);
+ yc0 = yc[0];
+ if (yc[1] >= base / 2) yc0++;
+ // Not necessary, but to prevent trial digit n > base, when using base 3.
+ // else if (base == 3 && yc0 == 1) yc0 = 1 + 1e-15;
+
+ do {
+ n = 0;
+
+ // Compare divisor and remainder.
+ cmp = compare(yc, rem, yL, remL);
+
+ // If divisor < remainder.
+ if (cmp < 0) {
+
+ // Calculate trial digit, n.
+
+ rem0 = rem[0];
+ if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);
+
+ // n is how many times the divisor goes into the current remainder.
+ n = mathfloor(rem0 / yc0);
+
+ // Algorithm:
+ // product = divisor multiplied by trial digit (n).
+ // Compare product and remainder.
+ // If product is greater than remainder:
+ // Subtract divisor from product, decrement trial digit.
+ // Subtract product from remainder.
+ // If product was less than remainder at the last compare:
+ // Compare new remainder and divisor.
+ // If remainder is greater than divisor:
+ // Subtract divisor from remainder, increment trial digit.
+
+ if (n > 1) {
+
+ // n may be > base only when base is 3.
+ if (n >= base) n = base - 1;
+
+ // product = divisor * trial digit.
+ prod = multiply(yc, n, base);
+ prodL = prod.length;
+ remL = rem.length;
+
+ // Compare product and remainder.
+ // If product > remainder then trial digit n too high.
+ // n is 1 too high about 5% of the time, and is not known to have
+ // ever been more than 1 too high.
+ while (compare(prod, rem, prodL, remL) == 1) {
+ n--;
+
+ // Subtract divisor from product.
+ subtract(prod, yL < prodL ? yz : yc, prodL, base);
+ prodL = prod.length;
+ cmp = 1;
+ }
+ } else {
+
+ // n is 0 or 1, cmp is -1.
+ // If n is 0, there is no need to compare yc and rem again below,
+ // so change cmp to 1 to avoid it.
+ // If n is 1, leave cmp as -1, so yc and rem are compared again.
+ if (n == 0) {
+
+ // divisor < remainder, so n must be at least 1.
+ cmp = n = 1;
+ }
+
+ // product = divisor
+ prod = yc.slice();
+ prodL = prod.length;
+ }
+
+ if (prodL < remL) prod = [0].concat(prod);
+
+ // Subtract product from remainder.
+ subtract(rem, prod, remL, base);
+ remL = rem.length;
+
+ // If product was < remainder.
+ if (cmp == -1) {
+
+ // Compare divisor and new remainder.
+ // If divisor < new remainder, subtract divisor from remainder.
+ // Trial digit n too low.
+ // n is 1 too low about 5% of the time, and very rarely 2 too low.
+ while (compare(yc, rem, yL, remL) < 1) {
+ n++;
+
+ // Subtract divisor from remainder.
+ subtract(rem, yL < remL ? yz : yc, remL, base);
+ remL = rem.length;
+ }
+ }
+ } else if (cmp === 0) {
+ n++;
+ rem = [0];
+ } // else cmp === 1 and n will be 0
+
+ // Add the next digit, n, to the result array.
+ qc[i++] = n;
+
+ // Update the remainder.
+ if (rem[0]) {
+ rem[remL++] = xc[xi] || 0;
+ } else {
+ rem = [xc[xi]];
+ remL = 1;
+ }
+ } while ((xi++ < xL || rem[0] != null) && s--);
+
+ more = rem[0] != null;
+
+ // Leading zero?
+ if (!qc[0]) qc.splice(0, 1);
+ }
+
+ if (base == BASE) {
+
+ // To calculate q.e, first get the number of digits of qc[0].
+ for (i = 1, s = qc[0]; s >= 10; s /= 10, i++);
+
+ round(q, dp + (q.e = i + e * LOG_BASE - 1) + 1, rm, more);
+
+ // Caller is convertBase.
+ } else {
+ q.e = e;
+ q.r = +more;
+ }
+
+ return q;
+ };
+ })();
+
+
+ /*
+ * Return a string representing the value of BigNumber n in fixed-point or exponential
+ * notation rounded to the specified decimal places or significant digits.
+ *
+ * n: a BigNumber.
+ * i: the index of the last digit required (i.e. the digit that may be rounded up).
+ * rm: the rounding mode.
+ * id: 1 (toExponential) or 2 (toPrecision).
+ */
+ function format(n, i, rm, id) {
+ var c0, e, ne, len, str;
+
+ if (rm == null) rm = ROUNDING_MODE;
+ else intCheck(rm, 0, 8);
+
+ if (!n.c) return n.toString();
+
+ c0 = n.c[0];
+ ne = n.e;
+
+ if (i == null) {
+ str = coeffToString(n.c);
+ str = id == 1 || id == 2 && (ne <= TO_EXP_NEG || ne >= TO_EXP_POS)
+ ? toExponential(str, ne)
+ : toFixedPoint(str, ne, '0');
+ } else {
+ n = round(new BigNumber(n), i, rm);
+
+ // n.e may have changed if the value was rounded up.
+ e = n.e;
+
+ str = coeffToString(n.c);
+ len = str.length;
+
+ // toPrecision returns exponential notation if the number of significant digits
+ // specified is less than the number of digits necessary to represent the integer
+ // part of the value in fixed-point notation.
+
+ // Exponential notation.
+ if (id == 1 || id == 2 && (i <= e || e <= TO_EXP_NEG)) {
+
+ // Append zeros?
+ for (; len < i; str += '0', len++);
+ str = toExponential(str, e);
+
+ // Fixed-point notation.
+ } else {
+ i -= ne + (id === 2 && e > ne);
+ str = toFixedPoint(str, e, '0');
+
+ // Append zeros?
+ if (e + 1 > len) {
+ if (--i > 0) for (str += '.'; i--; str += '0');
+ } else {
+ i += e - len;
+ if (i > 0) {
+ if (e + 1 == len) str += '.';
+ for (; i--; str += '0');
+ }
+ }
+ }
+ }
+
+ return n.s < 0 && c0 ? '-' + str : str;
+ }
+
+
+ // Handle BigNumber.max and BigNumber.min.
+ // If any number is NaN, return NaN.
+ function maxOrMin(args, n) {
+ var k, y,
+ i = 1,
+ x = new BigNumber(args[0]);
+
+ for (; i < args.length; i++) {
+ y = new BigNumber(args[i]);
+ if (!y.s || (k = compare(x, y)) === n || k === 0 && x.s === n) {
+ x = y;
+ }
+ }
+
+ return x;
+ }
+
+
+ /*
+ * Strip trailing zeros, calculate base 10 exponent and check against MIN_EXP and MAX_EXP.
+ * Called by minus, plus and times.
+ */
+ function normalise(n, c, e) {
+ var i = 1,
+ j = c.length;
+
+ // Remove trailing zeros.
+ for (; !c[--j]; c.pop());
+
+ // Calculate the base 10 exponent. First get the number of digits of c[0].
+ for (j = c[0]; j >= 10; j /= 10, i++);
+
+ // Overflow?
+ if ((e = i + e * LOG_BASE - 1) > MAX_EXP) {
+
+ // Infinity.
+ n.c = n.e = null;
+
+ // Underflow?
+ } else if (e < MIN_EXP) {
+
+ // Zero.
+ n.c = [n.e = 0];
+ } else {
+ n.e = e;
+ n.c = c;
+ }
+
+ return n;
+ }
+
+
+ // Handle values that fail the validity test in BigNumber.
+ parseNumeric = (function () {
+ var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i,
+ dotAfter = /^([^.]+)\.$/,
+ dotBefore = /^\.([^.]+)$/,
+ isInfinityOrNaN = /^-?(Infinity|NaN)$/,
+ whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
+
+ return function (x, str, isNum, b) {
+ var base,
+ s = isNum ? str : str.replace(whitespaceOrPlus, '');
+
+ // No exception on ±Infinity or NaN.
+ if (isInfinityOrNaN.test(s)) {
+ x.s = isNaN(s) ? null : s < 0 ? -1 : 1;
+ } else {
+ if (!isNum) {
+
+ // basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i
+ s = s.replace(basePrefix, function (m, p1, p2) {
+ base = (p2 = p2.toLowerCase()) == 'x' ? 16 : p2 == 'b' ? 2 : 8;
+ return !b || b == base ? p1 : m;
+ });
+
+ if (b) {
+ base = b;
+
+ // E.g. '1.' to '1', '.1' to '0.1'
+ s = s.replace(dotAfter, '$1').replace(dotBefore, '0.$1');
+ }
+
+ if (str != s) return new BigNumber(s, base);
+ }
+
+ // '[BigNumber Error] Not a number: {n}'
+ // '[BigNumber Error] Not a base {b} number: {n}'
+ if (BigNumber.DEBUG) {
+ throw Error
+ (bignumberError + 'Not a' + (b ? ' base ' + b : '') + ' number: ' + str);
+ }
+
+ // NaN
+ x.s = null;
+ }
+
+ x.c = x.e = null;
+ }
+ })();
+
+
+ /*
+ * Round x to sd significant digits using rounding mode rm. Check for over/under-flow.
+ * If r is truthy, it is known that there are more digits after the rounding digit.
+ */
+ function round(x, sd, rm, r) {
+ var d, i, j, k, n, ni, rd,
+ xc = x.c,
+ pows10 = POWS_TEN;
+
+ // if x is not Infinity or NaN...
+ if (xc) {
+
+ // rd is the rounding digit, i.e. the digit after the digit that may be rounded up.
+ // n is a base 1e14 number, the value of the element of array x.c containing rd.
+ // ni is the index of n within x.c.
+ // d is the number of digits of n.
+ // i is the index of rd within n including leading zeros.
+ // j is the actual index of rd within n (if < 0, rd is a leading zero).
+ out: {
+
+ // Get the number of digits of the first element of xc.
+ for (d = 1, k = xc[0]; k >= 10; k /= 10, d++);
+ i = sd - d;
+
+ // If the rounding digit is in the first element of xc...
+ if (i < 0) {
+ i += LOG_BASE;
+ j = sd;
+ n = xc[ni = 0];
+
+ // Get the rounding digit at index j of n.
+ rd = mathfloor(n / pows10[d - j - 1] % 10);
+ } else {
+ ni = mathceil((i + 1) / LOG_BASE);
+
+ if (ni >= xc.length) {
+
+ if (r) {
+
+ // Needed by sqrt.
+ for (; xc.length <= ni; xc.push(0));
+ n = rd = 0;
+ d = 1;
+ i %= LOG_BASE;
+ j = i - LOG_BASE + 1;
+ } else {
+ break out;
+ }
+ } else {
+ n = k = xc[ni];
+
+ // Get the number of digits of n.
+ for (d = 1; k >= 10; k /= 10, d++);
+
+ // Get the index of rd within n.
+ i %= LOG_BASE;
+
+ // Get the index of rd within n, adjusted for leading zeros.
+ // The number of leading zeros of n is given by LOG_BASE - d.
+ j = i - LOG_BASE + d;
+
+ // Get the rounding digit at index j of n.
+ rd = j < 0 ? 0 : mathfloor(n / pows10[d - j - 1] % 10);
+ }
+ }
+
+ r = r || sd < 0 ||
+
+ // Are there any non-zero digits after the rounding digit?
+ // The expression n % pows10[d - j - 1] returns all digits of n to the right
+ // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.
+ xc[ni + 1] != null || (j < 0 ? n : n % pows10[d - j - 1]);
+
+ r = rm < 4
+ ? (rd || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))
+ : rd > 5 || rd == 5 && (rm == 4 || r || rm == 6 &&
+
+ // Check whether the digit to the left of the rounding digit is odd.
+ ((i > 0 ? j > 0 ? n / pows10[d - j] : 0 : xc[ni - 1]) % 10) & 1 ||
+ rm == (x.s < 0 ? 8 : 7));
+
+ if (sd < 1 || !xc[0]) {
+ xc.length = 0;
+
+ if (r) {
+
+ // Convert sd to decimal places.
+ sd -= x.e + 1;
+
+ // 1, 0.1, 0.01, 0.001, 0.0001 etc.
+ xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE];
+ x.e = -sd || 0;
+ } else {
+
+ // Zero.
+ xc[0] = x.e = 0;
+ }
+
+ return x;
+ }
+
+ // Remove excess digits.
+ if (i == 0) {
+ xc.length = ni;
+ k = 1;
+ ni--;
+ } else {
+ xc.length = ni + 1;
+ k = pows10[LOG_BASE - i];
+
+ // E.g. 56700 becomes 56000 if 7 is the rounding digit.
+ // j > 0 means i > number of leading zeros of n.
+ xc[ni] = j > 0 ? mathfloor(n / pows10[d - j] % pows10[j]) * k : 0;
+ }
+
+ // Round up?
+ if (r) {
+
+ for (; ;) {
+
+ // If the digit to be rounded up is in the first element of xc...
+ if (ni == 0) {
+
+ // i will be the length of xc[0] before k is added.
+ for (i = 1, j = xc[0]; j >= 10; j /= 10, i++);
+ j = xc[0] += k;
+ for (k = 1; j >= 10; j /= 10, k++);
+
+ // if i != k the length has increased.
+ if (i != k) {
+ x.e++;
+ if (xc[0] == BASE) xc[0] = 1;
+ }
+
+ break;
+ } else {
+ xc[ni] += k;
+ if (xc[ni] != BASE) break;
+ xc[ni--] = 0;
+ k = 1;
+ }
+ }
+ }
+
+ // Remove trailing zeros.
+ for (i = xc.length; xc[--i] === 0; xc.pop());
+ }
+
+ // Overflow? Infinity.
+ if (x.e > MAX_EXP) {
+ x.c = x.e = null;
+
+ // Underflow? Zero.
+ } else if (x.e < MIN_EXP) {
+ x.c = [x.e = 0];
+ }
+ }
+
+ return x;
+ }
+
+
+ function valueOf(n) {
+ var str,
+ e = n.e;
+
+ if (e === null) return n.toString();
+
+ str = coeffToString(n.c);
+
+ str = e <= TO_EXP_NEG || e >= TO_EXP_POS
+ ? toExponential(str, e)
+ : toFixedPoint(str, e, '0');
+
+ return n.s < 0 ? '-' + str : str;
+ }
+
+
+ // PROTOTYPE/INSTANCE METHODS
+
+
+ /*
+ * Return a new BigNumber whose value is the absolute value of this BigNumber.
+ */
+ P.absoluteValue = P.abs = function () {
+ var x = new BigNumber(this);
+ if (x.s < 0) x.s = 1;
+ return x;
+ };
+
+
+ /*
+ * Return
+ * 1 if the value of this BigNumber is greater than the value of BigNumber(y, b),
+ * -1 if the value of this BigNumber is less than the value of BigNumber(y, b),
+ * 0 if they have the same value,
+ * or null if the value of either is NaN.
+ */
+ P.comparedTo = function (y, b) {
+ return compare(this, new BigNumber(y, b));
+ };
+
+
+ /*
+ * If dp is undefined or null or true or false, return the number of decimal places of the
+ * value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN.
+ *
+ * Otherwise, if dp is a number, return a new BigNumber whose value is the value of this
+ * BigNumber rounded to a maximum of dp decimal places using rounding mode rm, or
+ * ROUNDING_MODE if rm is omitted.
+ *
+ * [dp] {number} Decimal places: integer, 0 to MAX inclusive.
+ * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
+ *
+ * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'
+ */
+ P.decimalPlaces = P.dp = function (dp, rm) {
+ var c, n, v,
+ x = this;
+
+ if (dp != null) {
+ intCheck(dp, 0, MAX);
+ if (rm == null) rm = ROUNDING_MODE;
+ else intCheck(rm, 0, 8);
+
+ return round(new BigNumber(x), dp + x.e + 1, rm);
+ }
+
+ if (!(c = x.c)) return null;
+ n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE;
+
+ // Subtract the number of trailing zeros of the last number.
+ if (v = c[v]) for (; v % 10 == 0; v /= 10, n--);
+ if (n < 0) n = 0;
+
+ return n;
+ };
+
+
+ /*
+ * n / 0 = I
+ * n / N = N
+ * n / I = 0
+ * 0 / n = 0
+ * 0 / 0 = N
+ * 0 / N = N
+ * 0 / I = 0
+ * N / n = N
+ * N / 0 = N
+ * N / N = N
+ * N / I = N
+ * I / n = I
+ * I / 0 = I
+ * I / N = N
+ * I / I = N
+ *
+ * Return a new BigNumber whose value is the value of this BigNumber divided by the value of
+ * BigNumber(y, b), rounded according to DECIMAL_PLACES and ROUNDING_MODE.
+ */
+ P.dividedBy = P.div = function (y, b) {
+ return div(this, new BigNumber(y, b), DECIMAL_PLACES, ROUNDING_MODE);
+ };
+
+
+ /*
+ * Return a new BigNumber whose value is the integer part of dividing the value of this
+ * BigNumber by the value of BigNumber(y, b).
+ */
+ P.dividedToIntegerBy = P.idiv = function (y, b) {
+ return div(this, new BigNumber(y, b), 0, 1);
+ };
+
+
+ /*
+ * Return a BigNumber whose value is the value of this BigNumber exponentiated by n.
+ *
+ * If m is present, return the result modulo m.
+ * If n is negative round according to DECIMAL_PLACES and ROUNDING_MODE.
+ * If POW_PRECISION is non-zero and m is not present, round to POW_PRECISION using ROUNDING_MODE.
+ *
+ * The modular power operation works efficiently when x, n, and m are integers, otherwise it
+ * is equivalent to calculating x.exponentiatedBy(n).modulo(m) with a POW_PRECISION of 0.
+ *
+ * n {number|string|BigNumber} The exponent. An integer.
+ * [m] {number|string|BigNumber} The modulus.
+ *
+ * '[BigNumber Error] Exponent not an integer: {n}'
+ */
+ P.exponentiatedBy = P.pow = function (n, m) {
+ var half, isModExp, i, k, more, nIsBig, nIsNeg, nIsOdd, y,
+ x = this;
+
+ n = new BigNumber(n);
+
+ // Allow NaN and ±Infinity, but not other non-integers.
+ if (n.c && !n.isInteger()) {
+ throw Error
+ (bignumberError + 'Exponent not an integer: ' + valueOf(n));
+ }
+
+ if (m != null) m = new BigNumber(m);
+
+ // Exponent of MAX_SAFE_INTEGER is 15.
+ nIsBig = n.e > 14;
+
+ // If x is NaN, ±Infinity, ±0 or ±1, or n is ±Infinity, NaN or ±0.
+ if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) {
+
+ // The sign of the result of pow when x is negative depends on the evenness of n.
+ // If +n overflows to ±Infinity, the evenness of n would be not be known.
+ y = new BigNumber(Math.pow(+valueOf(x), nIsBig ? n.s * (2 - isOdd(n)) : +valueOf(n)));
+ return m ? y.mod(m) : y;
+ }
+
+ nIsNeg = n.s < 0;
+
+ if (m) {
+
+ // x % m returns NaN if abs(m) is zero, or m is NaN.
+ if (m.c ? !m.c[0] : !m.s) return new BigNumber(NaN);
+
+ isModExp = !nIsNeg && x.isInteger() && m.isInteger();
+
+ if (isModExp) x = x.mod(m);
+
+ // Overflow to ±Infinity: >=2**1e10 or >=1.0000024**1e15.
+ // Underflow to ±0: <=0.79**1e10 or <=0.9999975**1e15.
+ } else if (n.e > 9 && (x.e > 0 || x.e < -1 || (x.e == 0
+ // [1, 240000000]
+ ? x.c[0] > 1 || nIsBig && x.c[1] >= 24e7
+ // [80000000000000] [99999750000000]
+ : x.c[0] < 8e13 || nIsBig && x.c[0] <= 9999975e7))) {
+
+ // If x is negative and n is odd, k = -0, else k = 0.
+ k = x.s < 0 && isOdd(n) ? -0 : 0;
+
+ // If x >= 1, k = ±Infinity.
+ if (x.e > -1) k = 1 / k;
+
+ // If n is negative return ±0, else return ±Infinity.
+ return new BigNumber(nIsNeg ? 1 / k : k);
+
+ } else if (POW_PRECISION) {
+
+ // Truncating each coefficient array to a length of k after each multiplication
+ // equates to truncating significant digits to POW_PRECISION + [28, 41],
+ // i.e. there will be a minimum of 28 guard digits retained.
+ k = mathceil(POW_PRECISION / LOG_BASE + 2);
+ }
+
+ if (nIsBig) {
+ half = new BigNumber(0.5);
+ if (nIsNeg) n.s = 1;
+ nIsOdd = isOdd(n);
+ } else {
+ i = Math.abs(+valueOf(n));
+ nIsOdd = i % 2;
+ }
+
+ y = new BigNumber(ONE);
+
+ // Performs 54 loop iterations for n of 9007199254740991.
+ for (; ;) {
+
+ if (nIsOdd) {
+ y = y.times(x);
+ if (!y.c) break;
+
+ if (k) {
+ if (y.c.length > k) y.c.length = k;
+ } else if (isModExp) {
+ y = y.mod(m); //y = y.minus(div(y, m, 0, MODULO_MODE).times(m));
+ }
+ }
+
+ if (i) {
+ i = mathfloor(i / 2);
+ if (i === 0) break;
+ nIsOdd = i % 2;
+ } else {
+ n = n.times(half);
+ round(n, n.e + 1, 1);
+
+ if (n.e > 14) {
+ nIsOdd = isOdd(n);
+ } else {
+ i = +valueOf(n);
+ if (i === 0) break;
+ nIsOdd = i % 2;
+ }
+ }
+
+ x = x.times(x);
+
+ if (k) {
+ if (x.c && x.c.length > k) x.c.length = k;
+ } else if (isModExp) {
+ x = x.mod(m); //x = x.minus(div(x, m, 0, MODULO_MODE).times(m));
+ }
+ }
+
+ if (isModExp) return y;
+ if (nIsNeg) y = ONE.div(y);
+
+ return m ? y.mod(m) : k ? round(y, POW_PRECISION, ROUNDING_MODE, more) : y;
+ };
+
+
+ /*
+ * Return a new BigNumber whose value is the value of this BigNumber rounded to an integer
+ * using rounding mode rm, or ROUNDING_MODE if rm is omitted.
+ *
+ * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
+ *
+ * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {rm}'
+ */
+ P.integerValue = function (rm) {
+ var n = new BigNumber(this);
+ if (rm == null) rm = ROUNDING_MODE;
+ else intCheck(rm, 0, 8);
+ return round(n, n.e + 1, rm);
+ };
+
+
+ /*
+ * Return true if the value of this BigNumber is equal to the value of BigNumber(y, b),
+ * otherwise return false.
+ */
+ P.isEqualTo = P.eq = function (y, b) {
+ return compare(this, new BigNumber(y, b)) === 0;
+ };
+
+
+ /*
+ * Return true if the value of this BigNumber is a finite number, otherwise return false.
+ */
+ P.isFinite = function () {
+ return !!this.c;
+ };
+
+
+ /*
+ * Return true if the value of this BigNumber is greater than the value of BigNumber(y, b),
+ * otherwise return false.
+ */
+ P.isGreaterThan = P.gt = function (y, b) {
+ return compare(this, new BigNumber(y, b)) > 0;
+ };
+
+
+ /*
+ * Return true if the value of this BigNumber is greater than or equal to the value of
+ * BigNumber(y, b), otherwise return false.
+ */
+ P.isGreaterThanOrEqualTo = P.gte = function (y, b) {
+ return (b = compare(this, new BigNumber(y, b))) === 1 || b === 0;
+
+ };
+
+
+ /*
+ * Return true if the value of this BigNumber is an integer, otherwise return false.
+ */
+ P.isInteger = function () {
+ return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2;
+ };
+
+
+ /*
+ * Return true if the value of this BigNumber is less than the value of BigNumber(y, b),
+ * otherwise return false.
+ */
+ P.isLessThan = P.lt = function (y, b) {
+ return compare(this, new BigNumber(y, b)) < 0;
+ };
+
+
+ /*
+ * Return true if the value of this BigNumber is less than or equal to the value of
+ * BigNumber(y, b), otherwise return false.
+ */
+ P.isLessThanOrEqualTo = P.lte = function (y, b) {
+ return (b = compare(this, new BigNumber(y, b))) === -1 || b === 0;
+ };
+
+
+ /*
+ * Return true if the value of this BigNumber is NaN, otherwise return false.
+ */
+ P.isNaN = function () {
+ return !this.s;
+ };
+
+
+ /*
+ * Return true if the value of this BigNumber is negative, otherwise return false.
+ */
+ P.isNegative = function () {
+ return this.s < 0;
+ };
+
+
+ /*
+ * Return true if the value of this BigNumber is positive, otherwise return false.
+ */
+ P.isPositive = function () {
+ return this.s > 0;
+ };
+
+
+ /*
+ * Return true if the value of this BigNumber is 0 or -0, otherwise return false.
+ */
+ P.isZero = function () {
+ return !!this.c && this.c[0] == 0;
+ };
+
+
+ /*
+ * n - 0 = n
+ * n - N = N
+ * n - I = -I
+ * 0 - n = -n
+ * 0 - 0 = 0
+ * 0 - N = N
+ * 0 - I = -I
+ * N - n = N
+ * N - 0 = N
+ * N - N = N
+ * N - I = N
+ * I - n = I
+ * I - 0 = I
+ * I - N = N
+ * I - I = N
+ *
+ * Return a new BigNumber whose value is the value of this BigNumber minus the value of
+ * BigNumber(y, b).
+ */
+ P.minus = function (y, b) {
+ var i, j, t, xLTy,
+ x = this,
+ a = x.s;
+
+ y = new BigNumber(y, b);
+ b = y.s;
+
+ // Either NaN?
+ if (!a || !b) return new BigNumber(NaN);
+
+ // Signs differ?
+ if (a != b) {
+ y.s = -b;
+ return x.plus(y);
+ }
+
+ var xe = x.e / LOG_BASE,
+ ye = y.e / LOG_BASE,
+ xc = x.c,
+ yc = y.c;
+
+ if (!xe || !ye) {
+
+ // Either Infinity?
+ if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber(yc ? x : NaN);
+
+ // Either zero?
+ if (!xc[0] || !yc[0]) {
+
+ // Return y if y is non-zero, x if x is non-zero, or zero if both are zero.
+ return yc[0] ? (y.s = -b, y) : new BigNumber(xc[0] ? x :
+
+ // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity
+ ROUNDING_MODE == 3 ? -0 : 0);
+ }
+ }
+
+ xe = bitFloor(xe);
+ ye = bitFloor(ye);
+ xc = xc.slice();
+
+ // Determine which is the bigger number.
+ if (a = xe - ye) {
+
+ if (xLTy = a < 0) {
+ a = -a;
+ t = xc;
+ } else {
+ ye = xe;
+ t = yc;
+ }
+
+ t.reverse();
+
+ // Prepend zeros to equalise exponents.
+ for (b = a; b--; t.push(0));
+ t.reverse();
+ } else {
+
+ // Exponents equal. Check digit by digit.
+ j = (xLTy = (a = xc.length) < (b = yc.length)) ? a : b;
+
+ for (a = b = 0; b < j; b++) {
+
+ if (xc[b] != yc[b]) {
+ xLTy = xc[b] < yc[b];
+ break;
+ }
+ }
+ }
+
+ // x < y? Point xc to the array of the bigger number.
+ if (xLTy) {
+ t = xc;
+ xc = yc;
+ yc = t;
+ y.s = -y.s;
+ }
+
+ b = (j = yc.length) - (i = xc.length);
+
+ // Append zeros to xc if shorter.
+ // No need to add zeros to yc if shorter as subtract only needs to start at yc.length.
+ if (b > 0) for (; b--; xc[i++] = 0);
+ b = BASE - 1;
+
+ // Subtract yc from xc.
+ for (; j > a;) {
+
+ if (xc[--j] < yc[j]) {
+ for (i = j; i && !xc[--i]; xc[i] = b);
+ --xc[i];
+ xc[j] += BASE;
+ }
+
+ xc[j] -= yc[j];
+ }
+
+ // Remove leading zeros and adjust exponent accordingly.
+ for (; xc[0] == 0; xc.splice(0, 1), --ye);
+
+ // Zero?
+ if (!xc[0]) {
+
+ // Following IEEE 754 (2008) 6.3,
+ // n - n = +0 but n - n = -0 when rounding towards -Infinity.
+ y.s = ROUNDING_MODE == 3 ? -1 : 1;
+ y.c = [y.e = 0];
+ return y;
+ }
+
+ // No need to check for Infinity as +x - +y != Infinity && -x - -y != Infinity
+ // for finite x and y.
+ return normalise(y, xc, ye);
+ };
+
+
+ /*
+ * n % 0 = N
+ * n % N = N
+ * n % I = n
+ * 0 % n = 0
+ * -0 % n = -0
+ * 0 % 0 = N
+ * 0 % N = N
+ * 0 % I = 0
+ * N % n = N
+ * N % 0 = N
+ * N % N = N
+ * N % I = N
+ * I % n = N
+ * I % 0 = N
+ * I % N = N
+ * I % I = N
+ *
+ * Return a new BigNumber whose value is the value of this BigNumber modulo the value of
+ * BigNumber(y, b). The result depends on the value of MODULO_MODE.
+ */
+ P.modulo = P.mod = function (y, b) {
+ var q, s,
+ x = this;
+
+ y = new BigNumber(y, b);
+
+ // Return NaN if x is Infinity or NaN, or y is NaN or zero.
+ if (!x.c || !y.s || y.c && !y.c[0]) {
+ return new BigNumber(NaN);
+
+ // Return x if y is Infinity or x is zero.
+ } else if (!y.c || x.c && !x.c[0]) {
+ return new BigNumber(x);
+ }
+
+ if (MODULO_MODE == 9) {
+
+ // Euclidian division: q = sign(y) * floor(x / abs(y))
+ // r = x - qy where 0 <= r < abs(y)
+ s = y.s;
+ y.s = 1;
+ q = div(x, y, 0, 3);
+ y.s = s;
+ q.s *= s;
+ } else {
+ q = div(x, y, 0, MODULO_MODE);
+ }
+
+ y = x.minus(q.times(y));
+
+ // To match JavaScript %, ensure sign of zero is sign of dividend.
+ if (!y.c[0] && MODULO_MODE == 1) y.s = x.s;
+
+ return y;
+ };
+
+
+ /*
+ * n * 0 = 0
+ * n * N = N
+ * n * I = I
+ * 0 * n = 0
+ * 0 * 0 = 0
+ * 0 * N = N
+ * 0 * I = N
+ * N * n = N
+ * N * 0 = N
+ * N * N = N
+ * N * I = N
+ * I * n = I
+ * I * 0 = N
+ * I * N = N
+ * I * I = I
+ *
+ * Return a new BigNumber whose value is the value of this BigNumber multiplied by the value
+ * of BigNumber(y, b).
+ */
+ P.multipliedBy = P.times = function (y, b) {
+ var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc,
+ base, sqrtBase,
+ x = this,
+ xc = x.c,
+ yc = (y = new BigNumber(y, b)).c;
+
+ // Either NaN, ±Infinity or ±0?
+ if (!xc || !yc || !xc[0] || !yc[0]) {
+
+ // Return NaN if either is NaN, or one is 0 and the other is Infinity.
+ if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) {
+ y.c = y.e = y.s = null;
+ } else {
+ y.s *= x.s;
+
+ // Return ±Infinity if either is ±Infinity.
+ if (!xc || !yc) {
+ y.c = y.e = null;
+
+ // Return ±0 if either is ±0.
+ } else {
+ y.c = [0];
+ y.e = 0;
+ }
+ }
+
+ return y;
+ }
+
+ e = bitFloor(x.e / LOG_BASE) + bitFloor(y.e / LOG_BASE);
+ y.s *= x.s;
+ xcL = xc.length;
+ ycL = yc.length;
+
+ // Ensure xc points to longer array and xcL to its length.
+ if (xcL < ycL) {
+ zc = xc;
+ xc = yc;
+ yc = zc;
+ i = xcL;
+ xcL = ycL;
+ ycL = i;
+ }
+
+ // Initialise the result array with zeros.
+ for (i = xcL + ycL, zc = []; i--; zc.push(0));
+
+ base = BASE;
+ sqrtBase = SQRT_BASE;
+
+ for (i = ycL; --i >= 0;) {
+ c = 0;
+ ylo = yc[i] % sqrtBase;
+ yhi = yc[i] / sqrtBase | 0;
+
+ for (k = xcL, j = i + k; j > i;) {
+ xlo = xc[--k] % sqrtBase;
+ xhi = xc[k] / sqrtBase | 0;
+ m = yhi * xlo + xhi * ylo;
+ xlo = ylo * xlo + ((m % sqrtBase) * sqrtBase) + zc[j] + c;
+ c = (xlo / base | 0) + (m / sqrtBase | 0) + yhi * xhi;
+ zc[j--] = xlo % base;
+ }
+
+ zc[j] = c;
+ }
+
+ if (c) {
+ ++e;
+ } else {
+ zc.splice(0, 1);
+ }
+
+ return normalise(y, zc, e);
+ };
+
+
+ /*
+ * Return a new BigNumber whose value is the value of this BigNumber negated,
+ * i.e. multiplied by -1.
+ */
+ P.negated = function () {
+ var x = new BigNumber(this);
+ x.s = -x.s || null;
+ return x;
+ };
+
+
+ /*
+ * n + 0 = n
+ * n + N = N
+ * n + I = I
+ * 0 + n = n
+ * 0 + 0 = 0
+ * 0 + N = N
+ * 0 + I = I
+ * N + n = N
+ * N + 0 = N
+ * N + N = N
+ * N + I = N
+ * I + n = I
+ * I + 0 = I
+ * I + N = N
+ * I + I = I
+ *
+ * Return a new BigNumber whose value is the value of this BigNumber plus the value of
+ * BigNumber(y, b).
+ */
+ P.plus = function (y, b) {
+ var t,
+ x = this,
+ a = x.s;
+
+ y = new BigNumber(y, b);
+ b = y.s;
+
+ // Either NaN?
+ if (!a || !b) return new BigNumber(NaN);
+
+ // Signs differ?
+ if (a != b) {
+ y.s = -b;
+ return x.minus(y);
+ }
+
+ var xe = x.e / LOG_BASE,
+ ye = y.e / LOG_BASE,
+ xc = x.c,
+ yc = y.c;
+
+ if (!xe || !ye) {
+
+ // Return ±Infinity if either ±Infinity.
+ if (!xc || !yc) return new BigNumber(a / 0);
+
+ // Either zero?
+ // Return y if y is non-zero, x if x is non-zero, or zero if both are zero.
+ if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber(xc[0] ? x : a * 0);
+ }
+
+ xe = bitFloor(xe);
+ ye = bitFloor(ye);
+ xc = xc.slice();
+
+ // Prepend zeros to equalise exponents. Faster to use reverse then do unshifts.
+ if (a = xe - ye) {
+ if (a > 0) {
+ ye = xe;
+ t = yc;
+ } else {
+ a = -a;
+ t = xc;
+ }
+
+ t.reverse();
+ for (; a--; t.push(0));
+ t.reverse();
+ }
+
+ a = xc.length;
+ b = yc.length;
+
+ // Point xc to the longer array, and b to the shorter length.
+ if (a - b < 0) {
+ t = yc;
+ yc = xc;
+ xc = t;
+ b = a;
+ }
+
+ // Only start adding at yc.length - 1 as the further digits of xc can be ignored.
+ for (a = 0; b;) {
+ a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0;
+ xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE;
+ }
+
+ if (a) {
+ xc = [a].concat(xc);
+ ++ye;
+ }
+
+ // No need to check for zero, as +x + +y != 0 && -x + -y != 0
+ // ye = MAX_EXP + 1 possible
+ return normalise(y, xc, ye);
+ };
+
+
+ /*
+ * If sd is undefined or null or true or false, return the number of significant digits of
+ * the value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN.
+ * If sd is true include integer-part trailing zeros in the count.
+ *
+ * Otherwise, if sd is a number, return a new BigNumber whose value is the value of this
+ * BigNumber rounded to a maximum of sd significant digits using rounding mode rm, or
+ * ROUNDING_MODE if rm is omitted.
+ *
+ * sd {number|boolean} number: significant digits: integer, 1 to MAX inclusive.
+ * boolean: whether to count integer-part trailing zeros: true or false.
+ * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
+ *
+ * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}'
+ */
+ P.precision = P.sd = function (sd, rm) {
+ var c, n, v,
+ x = this;
+
+ if (sd != null && sd !== !!sd) {
+ intCheck(sd, 1, MAX);
+ if (rm == null) rm = ROUNDING_MODE;
+ else intCheck(rm, 0, 8);
+
+ return round(new BigNumber(x), sd, rm);
+ }
+
+ if (!(c = x.c)) return null;
+ v = c.length - 1;
+ n = v * LOG_BASE + 1;
+
+ if (v = c[v]) {
+
+ // Subtract the number of trailing zeros of the last element.
+ for (; v % 10 == 0; v /= 10, n--);
+
+ // Add the number of digits of the first element.
+ for (v = c[0]; v >= 10; v /= 10, n++);
+ }
+
+ if (sd && x.e + 1 > n) n = x.e + 1;
+
+ return n;
+ };
+
+
+ /*
+ * Return a new BigNumber whose value is the value of this BigNumber shifted by k places
+ * (powers of 10). Shift to the right if n > 0, and to the left if n < 0.
+ *
+ * k {number} Integer, -MAX_SAFE_INTEGER to MAX_SAFE_INTEGER inclusive.
+ *
+ * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {k}'
+ */
+ P.shiftedBy = function (k) {
+ intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER);
+ return this.times('1e' + k);
+ };
+
+
+ /*
+ * sqrt(-n) = N
+ * sqrt(N) = N
+ * sqrt(-I) = N
+ * sqrt(I) = I
+ * sqrt(0) = 0
+ * sqrt(-0) = -0
+ *
+ * Return a new BigNumber whose value is the square root of the value of this BigNumber,
+ * rounded according to DECIMAL_PLACES and ROUNDING_MODE.
+ */
+ P.squareRoot = P.sqrt = function () {
+ var m, n, r, rep, t,
+ x = this,
+ c = x.c,
+ s = x.s,
+ e = x.e,
+ dp = DECIMAL_PLACES + 4,
+ half = new BigNumber('0.5');
+
+ // Negative/NaN/Infinity/zero?
+ if (s !== 1 || !c || !c[0]) {
+ return new BigNumber(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0);
+ }
+
+ // Initial estimate.
+ s = Math.sqrt(+valueOf(x));
+
+ // Math.sqrt underflow/overflow?
+ // Pass x to Math.sqrt as integer, then adjust the exponent of the result.
+ if (s == 0 || s == 1 / 0) {
+ n = coeffToString(c);
+ if ((n.length + e) % 2 == 0) n += '0';
+ s = Math.sqrt(+n);
+ e = bitFloor((e + 1) / 2) - (e < 0 || e % 2);
+
+ if (s == 1 / 0) {
+ n = '5e' + e;
+ } else {
+ n = s.toExponential();
+ n = n.slice(0, n.indexOf('e') + 1) + e;
+ }
+
+ r = new BigNumber(n);
+ } else {
+ r = new BigNumber(s + '');
+ }
+
+ // Check for zero.
+ // r could be zero if MIN_EXP is changed after the this value was created.
+ // This would cause a division by zero (x/t) and hence Infinity below, which would cause
+ // coeffToString to throw.
+ if (r.c[0]) {
+ e = r.e;
+ s = e + dp;
+ if (s < 3) s = 0;
+
+ // Newton-Raphson iteration.
+ for (; ;) {
+ t = r;
+ r = half.times(t.plus(div(x, t, dp, 1)));
+
+ if (coeffToString(t.c).slice(0, s) === (n = coeffToString(r.c)).slice(0, s)) {
+
+ // The exponent of r may here be one less than the final result exponent,
+ // e.g 0.0009999 (e-4) --> 0.001 (e-3), so adjust s so the rounding digits
+ // are indexed correctly.
+ if (r.e < e) --s;
+ n = n.slice(s - 3, s + 1);
+
+ // The 4th rounding digit may be in error by -1 so if the 4 rounding digits
+ // are 9999 or 4999 (i.e. approaching a rounding boundary) continue the
+ // iteration.
+ if (n == '9999' || !rep && n == '4999') {
+
+ // On the first iteration only, check to see if rounding up gives the
+ // exact result as the nines may infinitely repeat.
+ if (!rep) {
+ round(t, t.e + DECIMAL_PLACES + 2, 0);
+
+ if (t.times(t).eq(x)) {
+ r = t;
+ break;
+ }
+ }
+
+ dp += 4;
+ s += 4;
+ rep = 1;
+ } else {
+
+ // If rounding digits are null, 0{0,4} or 50{0,3}, check for exact
+ // result. If not, then there are further digits and m will be truthy.
+ if (!+n || !+n.slice(1) && n.charAt(0) == '5') {
+
+ // Truncate to the first rounding digit.
+ round(r, r.e + DECIMAL_PLACES + 2, 1);
+ m = !r.times(r).eq(x);
+ }
+
+ break;
+ }
+ }
+ }
+ }
+
+ return round(r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m);
+ };
+
+
+ /*
+ * Return a string representing the value of this BigNumber in exponential notation and
+ * rounded using ROUNDING_MODE to dp fixed decimal places.
+ *
+ * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.
+ * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
+ *
+ * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'
+ */
+ P.toExponential = function (dp, rm) {
+ if (dp != null) {
+ intCheck(dp, 0, MAX);
+ dp++;
+ }
+ return format(this, dp, rm, 1);
+ };
+
+
+ /*
+ * Return a string representing the value of this BigNumber in fixed-point notation rounding
+ * to dp fixed decimal places using rounding mode rm, or ROUNDING_MODE if rm is omitted.
+ *
+ * Note: as with JavaScript's number type, (-0).toFixed(0) is '0',
+ * but e.g. (-0.00001).toFixed(0) is '-0'.
+ *
+ * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.
+ * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
+ *
+ * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'
+ */
+ P.toFixed = function (dp, rm) {
+ if (dp != null) {
+ intCheck(dp, 0, MAX);
+ dp = dp + this.e + 1;
+ }
+ return format(this, dp, rm);
+ };
+
+
+ /*
+ * Return a string representing the value of this BigNumber in fixed-point notation rounded
+ * using rm or ROUNDING_MODE to dp decimal places, and formatted according to the properties
+ * of the format or FORMAT object (see BigNumber.set).
+ *
+ * The formatting object may contain some or all of the properties shown below.
+ *
+ * FORMAT = {
+ * prefix: '',
+ * groupSize: 3,
+ * secondaryGroupSize: 0,
+ * groupSeparator: ',',
+ * decimalSeparator: '.',
+ * fractionGroupSize: 0,
+ * fractionGroupSeparator: '\xA0', // non-breaking space
+ * suffix: ''
+ * };
+ *
+ * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.
+ * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
+ * [format] {object} Formatting options. See FORMAT pbject above.
+ *
+ * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'
+ * '[BigNumber Error] Argument not an object: {format}'
+ */
+ P.toFormat = function (dp, rm, format) {
+ var str,
+ x = this;
+
+ if (format == null) {
+ if (dp != null && rm && typeof rm == 'object') {
+ format = rm;
+ rm = null;
+ } else if (dp && typeof dp == 'object') {
+ format = dp;
+ dp = rm = null;
+ } else {
+ format = FORMAT;
+ }
+ } else if (typeof format != 'object') {
+ throw Error
+ (bignumberError + 'Argument not an object: ' + format);
+ }
+
+ str = x.toFixed(dp, rm);
+
+ if (x.c) {
+ var i,
+ arr = str.split('.'),
+ g1 = +format.groupSize,
+ g2 = +format.secondaryGroupSize,
+ groupSeparator = format.groupSeparator || '',
+ intPart = arr[0],
+ fractionPart = arr[1],
+ isNeg = x.s < 0,
+ intDigits = isNeg ? intPart.slice(1) : intPart,
+ len = intDigits.length;
+
+ if (g2) {
+ i = g1;
+ g1 = g2;
+ g2 = i;
+ len -= i;
+ }
+
+ if (g1 > 0 && len > 0) {
+ i = len % g1 || g1;
+ intPart = intDigits.substr(0, i);
+ for (; i < len; i += g1) intPart += groupSeparator + intDigits.substr(i, g1);
+ if (g2 > 0) intPart += groupSeparator + intDigits.slice(i);
+ if (isNeg) intPart = '-' + intPart;
+ }
+
+ str = fractionPart
+ ? intPart + (format.decimalSeparator || '') + ((g2 = +format.fractionGroupSize)
+ ? fractionPart.replace(new RegExp('\\d{' + g2 + '}\\B', 'g'),
+ '$&' + (format.fractionGroupSeparator || ''))
+ : fractionPart)
+ : intPart;
+ }
+
+ return (format.prefix || '') + str + (format.suffix || '');
+ };
+
+
+ /*
+ * Return an array of two BigNumbers representing the value of this BigNumber as a simple
+ * fraction with an integer numerator and an integer denominator.
+ * The denominator will be a positive non-zero value less than or equal to the specified
+ * maximum denominator. If a maximum denominator is not specified, the denominator will be
+ * the lowest value necessary to represent the number exactly.
+ *
+ * [md] {number|string|BigNumber} Integer >= 1, or Infinity. The maximum denominator.
+ *
+ * '[BigNumber Error] Argument {not an integer|out of range} : {md}'
+ */
+ P.toFraction = function (md) {
+ var d, d0, d1, d2, e, exp, n, n0, n1, q, r, s,
+ x = this,
+ xc = x.c;
+
+ if (md != null) {
+ n = new BigNumber(md);
+
+ // Throw if md is less than one or is not an integer, unless it is Infinity.
+ if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) {
+ throw Error
+ (bignumberError + 'Argument ' +
+ (n.isInteger() ? 'out of range: ' : 'not an integer: ') + valueOf(n));
+ }
+ }
+
+ if (!xc) return new BigNumber(x);
+
+ d = new BigNumber(ONE);
+ n1 = d0 = new BigNumber(ONE);
+ d1 = n0 = new BigNumber(ONE);
+ s = coeffToString(xc);
+
+ // Determine initial denominator.
+ // d is a power of 10 and the minimum max denominator that specifies the value exactly.
+ e = d.e = s.length - x.e - 1;
+ d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp];
+ md = !md || n.comparedTo(d) > 0 ? (e > 0 ? d : n1) : n;
+
+ exp = MAX_EXP;
+ MAX_EXP = 1 / 0;
+ n = new BigNumber(s);
+
+ // n0 = d1 = 0
+ n0.c[0] = 0;
+
+ for (; ;) {
+ q = div(n, d, 0, 1);
+ d2 = d0.plus(q.times(d1));
+ if (d2.comparedTo(md) == 1) break;
+ d0 = d1;
+ d1 = d2;
+ n1 = n0.plus(q.times(d2 = n1));
+ n0 = d2;
+ d = n.minus(q.times(d2 = d));
+ n = d2;
+ }
+
+ d2 = div(md.minus(d0), d1, 0, 1);
+ n0 = n0.plus(d2.times(n1));
+ d0 = d0.plus(d2.times(d1));
+ n0.s = n1.s = x.s;
+ e = e * 2;
+
+ // Determine which fraction is closer to x, n0/d0 or n1/d1
+ r = div(n1, d1, e, ROUNDING_MODE).minus(x).abs().comparedTo(
+ div(n0, d0, e, ROUNDING_MODE).minus(x).abs()) < 1 ? [n1, d1] : [n0, d0];
+
+ MAX_EXP = exp;
+
+ return r;
+ };
+
+
+ /*
+ * Return the value of this BigNumber converted to a number primitive.
+ */
+ P.toNumber = function () {
+ return +valueOf(this);
+ };
+
+
+ /*
+ * Return a string representing the value of this BigNumber rounded to sd significant digits
+ * using rounding mode rm or ROUNDING_MODE. If sd is less than the number of digits
+ * necessary to represent the integer part of the value in fixed-point notation, then use
+ * exponential notation.
+ *
+ * [sd] {number} Significant digits. Integer, 1 to MAX inclusive.
+ * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
+ *
+ * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}'
+ */
+ P.toPrecision = function (sd, rm) {
+ if (sd != null) intCheck(sd, 1, MAX);
+ return format(this, sd, rm, 2);
+ };
+
+
+ /*
+ * Return a string representing the value of this BigNumber in base b, or base 10 if b is
+ * omitted. If a base is specified, including base 10, round according to DECIMAL_PLACES and
+ * ROUNDING_MODE. If a base is not specified, and this BigNumber has a positive exponent
+ * that is equal to or greater than TO_EXP_POS, or a negative exponent equal to or less than
+ * TO_EXP_NEG, return exponential notation.
+ *
+ * [b] {number} Integer, 2 to ALPHABET.length inclusive.
+ *
+ * '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}'
+ */
+ P.toString = function (b) {
+ var str,
+ n = this,
+ s = n.s,
+ e = n.e;
+
+ // Infinity or NaN?
+ if (e === null) {
+ if (s) {
+ str = 'Infinity';
+ if (s < 0) str = '-' + str;
+ } else {
+ str = 'NaN';
+ }
+ } else {
+ if (b == null) {
+ str = e <= TO_EXP_NEG || e >= TO_EXP_POS
+ ? toExponential(coeffToString(n.c), e)
+ : toFixedPoint(coeffToString(n.c), e, '0');
+ } else if (b === 10 && alphabetHasNormalDecimalDigits) {
+ n = round(new BigNumber(n), DECIMAL_PLACES + e + 1, ROUNDING_MODE);
+ str = toFixedPoint(coeffToString(n.c), n.e, '0');
+ } else {
+ intCheck(b, 2, ALPHABET.length, 'Base');
+ str = convertBase(toFixedPoint(coeffToString(n.c), e, '0'), 10, b, s, true);
+ }
+
+ if (s < 0 && n.c[0]) str = '-' + str;
+ }
+
+ return str;
+ };
+
+
+ /*
+ * Return as toString, but do not accept a base argument, and include the minus sign for
+ * negative zero.
+ */
+ P.valueOf = P.toJSON = function () {
+ return valueOf(this);
+ };
+
+
+ P._isBigNumber = true;
+
+ if (configObject != null) BigNumber.set(configObject);
+
+ return BigNumber;
+ }
+
+
+ // PRIVATE HELPER FUNCTIONS
+
+ // These functions don't need access to variables,
+ // e.g. DECIMAL_PLACES, in the scope of the `clone` function above.
+
+
+ function bitFloor(n) {
+ var i = n | 0;
+ return n > 0 || n === i ? i : i - 1;
+ }
+
+
+ // Return a coefficient array as a string of base 10 digits.
+ function coeffToString(a) {
+ var s, z,
+ i = 1,
+ j = a.length,
+ r = a[0] + '';
+
+ for (; i < j;) {
+ s = a[i++] + '';
+ z = LOG_BASE - s.length;
+ for (; z--; s = '0' + s);
+ r += s;
+ }
+
+ // Determine trailing zeros.
+ for (j = r.length; r.charCodeAt(--j) === 48;);
+
+ return r.slice(0, j + 1 || 1);
+ }
+
+
+ // Compare the value of BigNumbers x and y.
+ function compare(x, y) {
+ var a, b,
+ xc = x.c,
+ yc = y.c,
+ i = x.s,
+ j = y.s,
+ k = x.e,
+ l = y.e;
+
+ // Either NaN?
+ if (!i || !j) return null;
+
+ a = xc && !xc[0];
+ b = yc && !yc[0];
+
+ // Either zero?
+ if (a || b) return a ? b ? 0 : -j : i;
+
+ // Signs differ?
+ if (i != j) return i;
+
+ a = i < 0;
+ b = k == l;
+
+ // Either Infinity?
+ if (!xc || !yc) return b ? 0 : !xc ^ a ? 1 : -1;
+
+ // Compare exponents.
+ if (!b) return k > l ^ a ? 1 : -1;
+
+ j = (k = xc.length) < (l = yc.length) ? k : l;
+
+ // Compare digit by digit.
+ for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1;
+
+ // Compare lengths.
+ return k == l ? 0 : k > l ^ a ? 1 : -1;
+ }
+
+
+ /*
+ * Check that n is a primitive number, an integer, and in range, otherwise throw.
+ */
+ function intCheck(n, min, max, name) {
+ if (n < min || n > max || n !== mathfloor(n)) {
+ throw Error
+ (bignumberError + (name || 'Argument') + (typeof n == 'number'
+ ? n < min || n > max ? ' out of range: ' : ' not an integer: '
+ : ' not a primitive number: ') + String(n));
+ }
+ }
+
+
+ // Assumes finite n.
+ function isOdd(n) {
+ var k = n.c.length - 1;
+ return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0;
+ }
+
+
+ function toExponential(str, e) {
+ return (str.length > 1 ? str.charAt(0) + '.' + str.slice(1) : str) +
+ (e < 0 ? 'e' : 'e+') + e;
+ }
+
+
+ function toFixedPoint(str, e, z) {
+ var len, zs;
+
+ // Negative exponent?
+ if (e < 0) {
+
+ // Prepend zeros.
+ for (zs = z + '.'; ++e; zs += z);
+ str = zs + str;
+
+ // Positive exponent
+ } else {
+ len = str.length;
+
+ // Append zeros.
+ if (++e > len) {
+ for (zs = z, e -= len; --e; zs += z);
+ str += zs;
+ } else if (e < len) {
+ str = str.slice(0, e) + '.' + str.slice(e);
+ }
+ }
+
+ return str;
+ }
+
+
+ // EXPORT
+
+
+ BigNumber = clone();
+ BigNumber['default'] = BigNumber.BigNumber = BigNumber;
+
+ // AMD.
+ if (typeof define == 'function' && define.amd) {
+ define(function () { return BigNumber; });
+
+ // Node.js and other environments that support module.exports.
+ } else if (typeof module != 'undefined' && module.exports) {
+ module.exports = BigNumber;
+
+ // Browser.
+ } else {
+ if (!globalObject) {
+ globalObject = typeof self != 'undefined' && self ? self : window;
+ }
+
+ globalObject.BigNumber = BigNumber;
+ }
+})(this);
diff --git a/node_modules/bignumber.js/bignumber.mjs b/node_modules/bignumber.js/bignumber.mjs
new file mode 100644
index 00000000..31d910bc
--- /dev/null
+++ b/node_modules/bignumber.js/bignumber.mjs
@@ -0,0 +1,2907 @@
+/*
+ * bignumber.js v9.3.1
+ * A JavaScript library for arbitrary-precision arithmetic.
+ * https://github.com/MikeMcl/bignumber.js
+ * Copyright (c) 2025 Michael Mclaughlin
+ * MIT Licensed.
+ *
+ * BigNumber.prototype methods | BigNumber methods
+ * |
+ * absoluteValue abs | clone
+ * comparedTo | config set
+ * decimalPlaces dp | DECIMAL_PLACES
+ * dividedBy div | ROUNDING_MODE
+ * dividedToIntegerBy idiv | EXPONENTIAL_AT
+ * exponentiatedBy pow | RANGE
+ * integerValue | CRYPTO
+ * isEqualTo eq | MODULO_MODE
+ * isFinite | POW_PRECISION
+ * isGreaterThan gt | FORMAT
+ * isGreaterThanOrEqualTo gte | ALPHABET
+ * isInteger | isBigNumber
+ * isLessThan lt | maximum max
+ * isLessThanOrEqualTo lte | minimum min
+ * isNaN | random
+ * isNegative | sum
+ * isPositive |
+ * isZero |
+ * minus |
+ * modulo mod |
+ * multipliedBy times |
+ * negated |
+ * plus |
+ * precision sd |
+ * shiftedBy |
+ * squareRoot sqrt |
+ * toExponential |
+ * toFixed |
+ * toFormat |
+ * toFraction |
+ * toJSON |
+ * toNumber |
+ * toPrecision |
+ * toString |
+ * valueOf |
+ *
+ */
+
+
+var
+ isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,
+ mathceil = Math.ceil,
+ mathfloor = Math.floor,
+
+ bignumberError = '[BigNumber Error] ',
+ tooManyDigits = bignumberError + 'Number primitive has more than 15 significant digits: ',
+
+ BASE = 1e14,
+ LOG_BASE = 14,
+ MAX_SAFE_INTEGER = 0x1fffffffffffff, // 2^53 - 1
+ // MAX_INT32 = 0x7fffffff, // 2^31 - 1
+ POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13],
+ SQRT_BASE = 1e7,
+
+ // EDITABLE
+ // The limit on the value of DECIMAL_PLACES, TO_EXP_NEG, TO_EXP_POS, MIN_EXP, MAX_EXP, and
+ // the arguments to toExponential, toFixed, toFormat, and toPrecision.
+ MAX = 1E9; // 0 to MAX_INT32
+
+
+/*
+ * Create and return a BigNumber constructor.
+ */
+function clone(configObject) {
+ var div, convertBase, parseNumeric,
+ P = BigNumber.prototype = { constructor: BigNumber, toString: null, valueOf: null },
+ ONE = new BigNumber(1),
+
+
+ //----------------------------- EDITABLE CONFIG DEFAULTS -------------------------------
+
+
+ // The default values below must be integers within the inclusive ranges stated.
+ // The values can also be changed at run-time using BigNumber.set.
+
+ // The maximum number of decimal places for operations involving division.
+ DECIMAL_PLACES = 20, // 0 to MAX
+
+ // The rounding mode used when rounding to the above decimal places, and when using
+ // toExponential, toFixed, toFormat and toPrecision, and round (default value).
+ // UP 0 Away from zero.
+ // DOWN 1 Towards zero.
+ // CEIL 2 Towards +Infinity.
+ // FLOOR 3 Towards -Infinity.
+ // HALF_UP 4 Towards nearest neighbour. If equidistant, up.
+ // HALF_DOWN 5 Towards nearest neighbour. If equidistant, down.
+ // HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour.
+ // HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity.
+ // HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.
+ ROUNDING_MODE = 4, // 0 to 8
+
+ // EXPONENTIAL_AT : [TO_EXP_NEG , TO_EXP_POS]
+
+ // The exponent value at and beneath which toString returns exponential notation.
+ // Number type: -7
+ TO_EXP_NEG = -7, // 0 to -MAX
+
+ // The exponent value at and above which toString returns exponential notation.
+ // Number type: 21
+ TO_EXP_POS = 21, // 0 to MAX
+
+ // RANGE : [MIN_EXP, MAX_EXP]
+
+ // The minimum exponent value, beneath which underflow to zero occurs.
+ // Number type: -324 (5e-324)
+ MIN_EXP = -1e7, // -1 to -MAX
+
+ // The maximum exponent value, above which overflow to Infinity occurs.
+ // Number type: 308 (1.7976931348623157e+308)
+ // For MAX_EXP > 1e7, e.g. new BigNumber('1e100000000').plus(1) may be slow.
+ MAX_EXP = 1e7, // 1 to MAX
+
+ // Whether to use cryptographically-secure random number generation, if available.
+ CRYPTO = false, // true or false
+
+ // The modulo mode used when calculating the modulus: a mod n.
+ // The quotient (q = a / n) is calculated according to the corresponding rounding mode.
+ // The remainder (r) is calculated as: r = a - n * q.
+ //
+ // UP 0 The remainder is positive if the dividend is negative, else is negative.
+ // DOWN 1 The remainder has the same sign as the dividend.
+ // This modulo mode is commonly known as 'truncated division' and is
+ // equivalent to (a % n) in JavaScript.
+ // FLOOR 3 The remainder has the same sign as the divisor (Python %).
+ // HALF_EVEN 6 This modulo mode implements the IEEE 754 remainder function.
+ // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)).
+ // The remainder is always positive.
+ //
+ // The truncated division, floored division, Euclidian division and IEEE 754 remainder
+ // modes are commonly used for the modulus operation.
+ // Although the other rounding modes can also be used, they may not give useful results.
+ MODULO_MODE = 1, // 0 to 9
+
+ // The maximum number of significant digits of the result of the exponentiatedBy operation.
+ // If POW_PRECISION is 0, there will be unlimited significant digits.
+ POW_PRECISION = 0, // 0 to MAX
+
+ // The format specification used by the BigNumber.prototype.toFormat method.
+ FORMAT = {
+ prefix: '',
+ groupSize: 3,
+ secondaryGroupSize: 0,
+ groupSeparator: ',',
+ decimalSeparator: '.',
+ fractionGroupSize: 0,
+ fractionGroupSeparator: '\xA0', // non-breaking space
+ suffix: ''
+ },
+
+ // The alphabet used for base conversion. It must be at least 2 characters long, with no '+',
+ // '-', '.', whitespace, or repeated character.
+ // '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_'
+ ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyz',
+ alphabetHasNormalDecimalDigits = true;
+
+
+ //------------------------------------------------------------------------------------------
+
+
+ // CONSTRUCTOR
+
+
+ /*
+ * The BigNumber constructor and exported function.
+ * Create and return a new instance of a BigNumber object.
+ *
+ * v {number|string|BigNumber} A numeric value.
+ * [b] {number} The base of v. Integer, 2 to ALPHABET.length inclusive.
+ */
+ function BigNumber(v, b) {
+ var alphabet, c, caseChanged, e, i, isNum, len, str,
+ x = this;
+
+ // Enable constructor call without `new`.
+ if (!(x instanceof BigNumber)) return new BigNumber(v, b);
+
+ if (b == null) {
+
+ if (v && v._isBigNumber === true) {
+ x.s = v.s;
+
+ if (!v.c || v.e > MAX_EXP) {
+ x.c = x.e = null;
+ } else if (v.e < MIN_EXP) {
+ x.c = [x.e = 0];
+ } else {
+ x.e = v.e;
+ x.c = v.c.slice();
+ }
+
+ return;
+ }
+
+ if ((isNum = typeof v == 'number') && v * 0 == 0) {
+
+ // Use `1 / n` to handle minus zero also.
+ x.s = 1 / v < 0 ? (v = -v, -1) : 1;
+
+ // Fast path for integers, where n < 2147483648 (2**31).
+ if (v === ~~v) {
+ for (e = 0, i = v; i >= 10; i /= 10, e++);
+
+ if (e > MAX_EXP) {
+ x.c = x.e = null;
+ } else {
+ x.e = e;
+ x.c = [v];
+ }
+
+ return;
+ }
+
+ str = String(v);
+ } else {
+
+ if (!isNumeric.test(str = String(v))) return parseNumeric(x, str, isNum);
+
+ x.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1;
+ }
+
+ // Decimal point?
+ if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');
+
+ // Exponential form?
+ if ((i = str.search(/e/i)) > 0) {
+
+ // Determine exponent.
+ if (e < 0) e = i;
+ e += +str.slice(i + 1);
+ str = str.substring(0, i);
+ } else if (e < 0) {
+
+ // Integer.
+ e = str.length;
+ }
+
+ } else {
+
+ // '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}'
+ intCheck(b, 2, ALPHABET.length, 'Base');
+
+ // Allow exponential notation to be used with base 10 argument, while
+ // also rounding to DECIMAL_PLACES as with other bases.
+ if (b == 10 && alphabetHasNormalDecimalDigits) {
+ x = new BigNumber(v);
+ return round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE);
+ }
+
+ str = String(v);
+
+ if (isNum = typeof v == 'number') {
+
+ // Avoid potential interpretation of Infinity and NaN as base 44+ values.
+ if (v * 0 != 0) return parseNumeric(x, str, isNum, b);
+
+ x.s = 1 / v < 0 ? (str = str.slice(1), -1) : 1;
+
+ // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}'
+ if (BigNumber.DEBUG && str.replace(/^0\.0*|\./, '').length > 15) {
+ throw Error
+ (tooManyDigits + v);
+ }
+ } else {
+ x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1;
+ }
+
+ alphabet = ALPHABET.slice(0, b);
+ e = i = 0;
+
+ // Check that str is a valid base b number.
+ // Don't use RegExp, so alphabet can contain special characters.
+ for (len = str.length; i < len; i++) {
+ if (alphabet.indexOf(c = str.charAt(i)) < 0) {
+ if (c == '.') {
+
+ // If '.' is not the first character and it has not be found before.
+ if (i > e) {
+ e = len;
+ continue;
+ }
+ } else if (!caseChanged) {
+
+ // Allow e.g. hexadecimal 'FF' as well as 'ff'.
+ if (str == str.toUpperCase() && (str = str.toLowerCase()) ||
+ str == str.toLowerCase() && (str = str.toUpperCase())) {
+ caseChanged = true;
+ i = -1;
+ e = 0;
+ continue;
+ }
+ }
+
+ return parseNumeric(x, String(v), isNum, b);
+ }
+ }
+
+ // Prevent later check for length on converted number.
+ isNum = false;
+ str = convertBase(str, b, 10, x.s);
+
+ // Decimal point?
+ if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');
+ else e = str.length;
+ }
+
+ // Determine leading zeros.
+ for (i = 0; str.charCodeAt(i) === 48; i++);
+
+ // Determine trailing zeros.
+ for (len = str.length; str.charCodeAt(--len) === 48;);
+
+ if (str = str.slice(i, ++len)) {
+ len -= i;
+
+ // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}'
+ if (isNum && BigNumber.DEBUG &&
+ len > 15 && (v > MAX_SAFE_INTEGER || v !== mathfloor(v))) {
+ throw Error
+ (tooManyDigits + (x.s * v));
+ }
+
+ // Overflow?
+ if ((e = e - i - 1) > MAX_EXP) {
+
+ // Infinity.
+ x.c = x.e = null;
+
+ // Underflow?
+ } else if (e < MIN_EXP) {
+
+ // Zero.
+ x.c = [x.e = 0];
+ } else {
+ x.e = e;
+ x.c = [];
+
+ // Transform base
+
+ // e is the base 10 exponent.
+ // i is where to slice str to get the first element of the coefficient array.
+ i = (e + 1) % LOG_BASE;
+ if (e < 0) i += LOG_BASE; // i < 1
+
+ if (i < len) {
+ if (i) x.c.push(+str.slice(0, i));
+
+ for (len -= LOG_BASE; i < len;) {
+ x.c.push(+str.slice(i, i += LOG_BASE));
+ }
+
+ i = LOG_BASE - (str = str.slice(i)).length;
+ } else {
+ i -= len;
+ }
+
+ for (; i--; str += '0');
+ x.c.push(+str);
+ }
+ } else {
+
+ // Zero.
+ x.c = [x.e = 0];
+ }
+ }
+
+
+ // CONSTRUCTOR PROPERTIES
+
+
+ BigNumber.clone = clone;
+
+ BigNumber.ROUND_UP = 0;
+ BigNumber.ROUND_DOWN = 1;
+ BigNumber.ROUND_CEIL = 2;
+ BigNumber.ROUND_FLOOR = 3;
+ BigNumber.ROUND_HALF_UP = 4;
+ BigNumber.ROUND_HALF_DOWN = 5;
+ BigNumber.ROUND_HALF_EVEN = 6;
+ BigNumber.ROUND_HALF_CEIL = 7;
+ BigNumber.ROUND_HALF_FLOOR = 8;
+ BigNumber.EUCLID = 9;
+
+
+ /*
+ * Configure infrequently-changing library-wide settings.
+ *
+ * Accept an object with the following optional properties (if the value of a property is
+ * a number, it must be an integer within the inclusive range stated):
+ *
+ * DECIMAL_PLACES {number} 0 to MAX
+ * ROUNDING_MODE {number} 0 to 8
+ * EXPONENTIAL_AT {number|number[]} -MAX to MAX or [-MAX to 0, 0 to MAX]
+ * RANGE {number|number[]} -MAX to MAX (not zero) or [-MAX to -1, 1 to MAX]
+ * CRYPTO {boolean} true or false
+ * MODULO_MODE {number} 0 to 9
+ * POW_PRECISION {number} 0 to MAX
+ * ALPHABET {string} A string of two or more unique characters which does
+ * not contain '.'.
+ * FORMAT {object} An object with some of the following properties:
+ * prefix {string}
+ * groupSize {number}
+ * secondaryGroupSize {number}
+ * groupSeparator {string}
+ * decimalSeparator {string}
+ * fractionGroupSize {number}
+ * fractionGroupSeparator {string}
+ * suffix {string}
+ *
+ * (The values assigned to the above FORMAT object properties are not checked for validity.)
+ *
+ * E.g.
+ * BigNumber.config({ DECIMAL_PLACES : 20, ROUNDING_MODE : 4 })
+ *
+ * Ignore properties/parameters set to null or undefined, except for ALPHABET.
+ *
+ * Return an object with the properties current values.
+ */
+ BigNumber.config = BigNumber.set = function (obj) {
+ var p, v;
+
+ if (obj != null) {
+
+ if (typeof obj == 'object') {
+
+ // DECIMAL_PLACES {number} Integer, 0 to MAX inclusive.
+ // '[BigNumber Error] DECIMAL_PLACES {not a primitive number|not an integer|out of range}: {v}'
+ if (obj.hasOwnProperty(p = 'DECIMAL_PLACES')) {
+ v = obj[p];
+ intCheck(v, 0, MAX, p);
+ DECIMAL_PLACES = v;
+ }
+
+ // ROUNDING_MODE {number} Integer, 0 to 8 inclusive.
+ // '[BigNumber Error] ROUNDING_MODE {not a primitive number|not an integer|out of range}: {v}'
+ if (obj.hasOwnProperty(p = 'ROUNDING_MODE')) {
+ v = obj[p];
+ intCheck(v, 0, 8, p);
+ ROUNDING_MODE = v;
+ }
+
+ // EXPONENTIAL_AT {number|number[]}
+ // Integer, -MAX to MAX inclusive or
+ // [integer -MAX to 0 inclusive, 0 to MAX inclusive].
+ // '[BigNumber Error] EXPONENTIAL_AT {not a primitive number|not an integer|out of range}: {v}'
+ if (obj.hasOwnProperty(p = 'EXPONENTIAL_AT')) {
+ v = obj[p];
+ if (v && v.pop) {
+ intCheck(v[0], -MAX, 0, p);
+ intCheck(v[1], 0, MAX, p);
+ TO_EXP_NEG = v[0];
+ TO_EXP_POS = v[1];
+ } else {
+ intCheck(v, -MAX, MAX, p);
+ TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v);
+ }
+ }
+
+ // RANGE {number|number[]} Non-zero integer, -MAX to MAX inclusive or
+ // [integer -MAX to -1 inclusive, integer 1 to MAX inclusive].
+ // '[BigNumber Error] RANGE {not a primitive number|not an integer|out of range|cannot be zero}: {v}'
+ if (obj.hasOwnProperty(p = 'RANGE')) {
+ v = obj[p];
+ if (v && v.pop) {
+ intCheck(v[0], -MAX, -1, p);
+ intCheck(v[1], 1, MAX, p);
+ MIN_EXP = v[0];
+ MAX_EXP = v[1];
+ } else {
+ intCheck(v, -MAX, MAX, p);
+ if (v) {
+ MIN_EXP = -(MAX_EXP = v < 0 ? -v : v);
+ } else {
+ throw Error
+ (bignumberError + p + ' cannot be zero: ' + v);
+ }
+ }
+ }
+
+ // CRYPTO {boolean} true or false.
+ // '[BigNumber Error] CRYPTO not true or false: {v}'
+ // '[BigNumber Error] crypto unavailable'
+ if (obj.hasOwnProperty(p = 'CRYPTO')) {
+ v = obj[p];
+ if (v === !!v) {
+ if (v) {
+ if (typeof crypto != 'undefined' && crypto &&
+ (crypto.getRandomValues || crypto.randomBytes)) {
+ CRYPTO = v;
+ } else {
+ CRYPTO = !v;
+ throw Error
+ (bignumberError + 'crypto unavailable');
+ }
+ } else {
+ CRYPTO = v;
+ }
+ } else {
+ throw Error
+ (bignumberError + p + ' not true or false: ' + v);
+ }
+ }
+
+ // MODULO_MODE {number} Integer, 0 to 9 inclusive.
+ // '[BigNumber Error] MODULO_MODE {not a primitive number|not an integer|out of range}: {v}'
+ if (obj.hasOwnProperty(p = 'MODULO_MODE')) {
+ v = obj[p];
+ intCheck(v, 0, 9, p);
+ MODULO_MODE = v;
+ }
+
+ // POW_PRECISION {number} Integer, 0 to MAX inclusive.
+ // '[BigNumber Error] POW_PRECISION {not a primitive number|not an integer|out of range}: {v}'
+ if (obj.hasOwnProperty(p = 'POW_PRECISION')) {
+ v = obj[p];
+ intCheck(v, 0, MAX, p);
+ POW_PRECISION = v;
+ }
+
+ // FORMAT {object}
+ // '[BigNumber Error] FORMAT not an object: {v}'
+ if (obj.hasOwnProperty(p = 'FORMAT')) {
+ v = obj[p];
+ if (typeof v == 'object') FORMAT = v;
+ else throw Error
+ (bignumberError + p + ' not an object: ' + v);
+ }
+
+ // ALPHABET {string}
+ // '[BigNumber Error] ALPHABET invalid: {v}'
+ if (obj.hasOwnProperty(p = 'ALPHABET')) {
+ v = obj[p];
+
+ // Disallow if less than two characters,
+ // or if it contains '+', '-', '.', whitespace, or a repeated character.
+ if (typeof v == 'string' && !/^.?$|[+\-.\s]|(.).*\1/.test(v)) {
+ alphabetHasNormalDecimalDigits = v.slice(0, 10) == '0123456789';
+ ALPHABET = v;
+ } else {
+ throw Error
+ (bignumberError + p + ' invalid: ' + v);
+ }
+ }
+
+ } else {
+
+ // '[BigNumber Error] Object expected: {v}'
+ throw Error
+ (bignumberError + 'Object expected: ' + obj);
+ }
+ }
+
+ return {
+ DECIMAL_PLACES: DECIMAL_PLACES,
+ ROUNDING_MODE: ROUNDING_MODE,
+ EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS],
+ RANGE: [MIN_EXP, MAX_EXP],
+ CRYPTO: CRYPTO,
+ MODULO_MODE: MODULO_MODE,
+ POW_PRECISION: POW_PRECISION,
+ FORMAT: FORMAT,
+ ALPHABET: ALPHABET
+ };
+ };
+
+
+ /*
+ * Return true if v is a BigNumber instance, otherwise return false.
+ *
+ * If BigNumber.DEBUG is true, throw if a BigNumber instance is not well-formed.
+ *
+ * v {any}
+ *
+ * '[BigNumber Error] Invalid BigNumber: {v}'
+ */
+ BigNumber.isBigNumber = function (v) {
+ if (!v || v._isBigNumber !== true) return false;
+ if (!BigNumber.DEBUG) return true;
+
+ var i, n,
+ c = v.c,
+ e = v.e,
+ s = v.s;
+
+ out: if ({}.toString.call(c) == '[object Array]') {
+
+ if ((s === 1 || s === -1) && e >= -MAX && e <= MAX && e === mathfloor(e)) {
+
+ // If the first element is zero, the BigNumber value must be zero.
+ if (c[0] === 0) {
+ if (e === 0 && c.length === 1) return true;
+ break out;
+ }
+
+ // Calculate number of digits that c[0] should have, based on the exponent.
+ i = (e + 1) % LOG_BASE;
+ if (i < 1) i += LOG_BASE;
+
+ // Calculate number of digits of c[0].
+ //if (Math.ceil(Math.log(c[0] + 1) / Math.LN10) == i) {
+ if (String(c[0]).length == i) {
+
+ for (i = 0; i < c.length; i++) {
+ n = c[i];
+ if (n < 0 || n >= BASE || n !== mathfloor(n)) break out;
+ }
+
+ // Last element cannot be zero, unless it is the only element.
+ if (n !== 0) return true;
+ }
+ }
+
+ // Infinity/NaN
+ } else if (c === null && e === null && (s === null || s === 1 || s === -1)) {
+ return true;
+ }
+
+ throw Error
+ (bignumberError + 'Invalid BigNumber: ' + v);
+ };
+
+
+ /*
+ * Return a new BigNumber whose value is the maximum of the arguments.
+ *
+ * arguments {number|string|BigNumber}
+ */
+ BigNumber.maximum = BigNumber.max = function () {
+ return maxOrMin(arguments, -1);
+ };
+
+
+ /*
+ * Return a new BigNumber whose value is the minimum of the arguments.
+ *
+ * arguments {number|string|BigNumber}
+ */
+ BigNumber.minimum = BigNumber.min = function () {
+ return maxOrMin(arguments, 1);
+ };
+
+
+ /*
+ * Return a new BigNumber with a random value equal to or greater than 0 and less than 1,
+ * and with dp, or DECIMAL_PLACES if dp is omitted, decimal places (or less if trailing
+ * zeros are produced).
+ *
+ * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.
+ *
+ * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp}'
+ * '[BigNumber Error] crypto unavailable'
+ */
+ BigNumber.random = (function () {
+ var pow2_53 = 0x20000000000000;
+
+ // Return a 53 bit integer n, where 0 <= n < 9007199254740992.
+ // Check if Math.random() produces more than 32 bits of randomness.
+ // If it does, assume at least 53 bits are produced, otherwise assume at least 30 bits.
+ // 0x40000000 is 2^30, 0x800000 is 2^23, 0x1fffff is 2^21 - 1.
+ var random53bitInt = (Math.random() * pow2_53) & 0x1fffff
+ ? function () { return mathfloor(Math.random() * pow2_53); }
+ : function () { return ((Math.random() * 0x40000000 | 0) * 0x800000) +
+ (Math.random() * 0x800000 | 0); };
+
+ return function (dp) {
+ var a, b, e, k, v,
+ i = 0,
+ c = [],
+ rand = new BigNumber(ONE);
+
+ if (dp == null) dp = DECIMAL_PLACES;
+ else intCheck(dp, 0, MAX);
+
+ k = mathceil(dp / LOG_BASE);
+
+ if (CRYPTO) {
+
+ // Browsers supporting crypto.getRandomValues.
+ if (crypto.getRandomValues) {
+
+ a = crypto.getRandomValues(new Uint32Array(k *= 2));
+
+ for (; i < k;) {
+
+ // 53 bits:
+ // ((Math.pow(2, 32) - 1) * Math.pow(2, 21)).toString(2)
+ // 11111 11111111 11111111 11111111 11100000 00000000 00000000
+ // ((Math.pow(2, 32) - 1) >>> 11).toString(2)
+ // 11111 11111111 11111111
+ // 0x20000 is 2^21.
+ v = a[i] * 0x20000 + (a[i + 1] >>> 11);
+
+ // Rejection sampling:
+ // 0 <= v < 9007199254740992
+ // Probability that v >= 9e15, is
+ // 7199254740992 / 9007199254740992 ~= 0.0008, i.e. 1 in 1251
+ if (v >= 9e15) {
+ b = crypto.getRandomValues(new Uint32Array(2));
+ a[i] = b[0];
+ a[i + 1] = b[1];
+ } else {
+
+ // 0 <= v <= 8999999999999999
+ // 0 <= (v % 1e14) <= 99999999999999
+ c.push(v % 1e14);
+ i += 2;
+ }
+ }
+ i = k / 2;
+
+ // Node.js supporting crypto.randomBytes.
+ } else if (crypto.randomBytes) {
+
+ // buffer
+ a = crypto.randomBytes(k *= 7);
+
+ for (; i < k;) {
+
+ // 0x1000000000000 is 2^48, 0x10000000000 is 2^40
+ // 0x100000000 is 2^32, 0x1000000 is 2^24
+ // 11111 11111111 11111111 11111111 11111111 11111111 11111111
+ // 0 <= v < 9007199254740992
+ v = ((a[i] & 31) * 0x1000000000000) + (a[i + 1] * 0x10000000000) +
+ (a[i + 2] * 0x100000000) + (a[i + 3] * 0x1000000) +
+ (a[i + 4] << 16) + (a[i + 5] << 8) + a[i + 6];
+
+ if (v >= 9e15) {
+ crypto.randomBytes(7).copy(a, i);
+ } else {
+
+ // 0 <= (v % 1e14) <= 99999999999999
+ c.push(v % 1e14);
+ i += 7;
+ }
+ }
+ i = k / 7;
+ } else {
+ CRYPTO = false;
+ throw Error
+ (bignumberError + 'crypto unavailable');
+ }
+ }
+
+ // Use Math.random.
+ if (!CRYPTO) {
+
+ for (; i < k;) {
+ v = random53bitInt();
+ if (v < 9e15) c[i++] = v % 1e14;
+ }
+ }
+
+ k = c[--i];
+ dp %= LOG_BASE;
+
+ // Convert trailing digits to zeros according to dp.
+ if (k && dp) {
+ v = POWS_TEN[LOG_BASE - dp];
+ c[i] = mathfloor(k / v) * v;
+ }
+
+ // Remove trailing elements which are zero.
+ for (; c[i] === 0; c.pop(), i--);
+
+ // Zero?
+ if (i < 0) {
+ c = [e = 0];
+ } else {
+
+ // Remove leading elements which are zero and adjust exponent accordingly.
+ for (e = -1 ; c[0] === 0; c.splice(0, 1), e -= LOG_BASE);
+
+ // Count the digits of the first element of c to determine leading zeros, and...
+ for (i = 1, v = c[0]; v >= 10; v /= 10, i++);
+
+ // adjust the exponent accordingly.
+ if (i < LOG_BASE) e -= LOG_BASE - i;
+ }
+
+ rand.e = e;
+ rand.c = c;
+ return rand;
+ };
+ })();
+
+
+ /*
+ * Return a BigNumber whose value is the sum of the arguments.
+ *
+ * arguments {number|string|BigNumber}
+ */
+ BigNumber.sum = function () {
+ var i = 1,
+ args = arguments,
+ sum = new BigNumber(args[0]);
+ for (; i < args.length;) sum = sum.plus(args[i++]);
+ return sum;
+ };
+
+
+ // PRIVATE FUNCTIONS
+
+
+ // Called by BigNumber and BigNumber.prototype.toString.
+ convertBase = (function () {
+ var decimal = '0123456789';
+
+ /*
+ * Convert string of baseIn to an array of numbers of baseOut.
+ * Eg. toBaseOut('255', 10, 16) returns [15, 15].
+ * Eg. toBaseOut('ff', 16, 10) returns [2, 5, 5].
+ */
+ function toBaseOut(str, baseIn, baseOut, alphabet) {
+ var j,
+ arr = [0],
+ arrL,
+ i = 0,
+ len = str.length;
+
+ for (; i < len;) {
+ for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);
+
+ arr[0] += alphabet.indexOf(str.charAt(i++));
+
+ for (j = 0; j < arr.length; j++) {
+
+ if (arr[j] > baseOut - 1) {
+ if (arr[j + 1] == null) arr[j + 1] = 0;
+ arr[j + 1] += arr[j] / baseOut | 0;
+ arr[j] %= baseOut;
+ }
+ }
+ }
+
+ return arr.reverse();
+ }
+
+ // Convert a numeric string of baseIn to a numeric string of baseOut.
+ // If the caller is toString, we are converting from base 10 to baseOut.
+ // If the caller is BigNumber, we are converting from baseIn to base 10.
+ return function (str, baseIn, baseOut, sign, callerIsToString) {
+ var alphabet, d, e, k, r, x, xc, y,
+ i = str.indexOf('.'),
+ dp = DECIMAL_PLACES,
+ rm = ROUNDING_MODE;
+
+ // Non-integer.
+ if (i >= 0) {
+ k = POW_PRECISION;
+
+ // Unlimited precision.
+ POW_PRECISION = 0;
+ str = str.replace('.', '');
+ y = new BigNumber(baseIn);
+ x = y.pow(str.length - i);
+ POW_PRECISION = k;
+
+ // Convert str as if an integer, then restore the fraction part by dividing the
+ // result by its base raised to a power.
+
+ y.c = toBaseOut(toFixedPoint(coeffToString(x.c), x.e, '0'),
+ 10, baseOut, decimal);
+ y.e = y.c.length;
+ }
+
+ // Convert the number as integer.
+
+ xc = toBaseOut(str, baseIn, baseOut, callerIsToString
+ ? (alphabet = ALPHABET, decimal)
+ : (alphabet = decimal, ALPHABET));
+
+ // xc now represents str as an integer and converted to baseOut. e is the exponent.
+ e = k = xc.length;
+
+ // Remove trailing zeros.
+ for (; xc[--k] == 0; xc.pop());
+
+ // Zero?
+ if (!xc[0]) return alphabet.charAt(0);
+
+ // Does str represent an integer? If so, no need for the division.
+ if (i < 0) {
+ --e;
+ } else {
+ x.c = xc;
+ x.e = e;
+
+ // The sign is needed for correct rounding.
+ x.s = sign;
+ x = div(x, y, dp, rm, baseOut);
+ xc = x.c;
+ r = x.r;
+ e = x.e;
+ }
+
+ // xc now represents str converted to baseOut.
+
+ // The index of the rounding digit.
+ d = e + dp + 1;
+
+ // The rounding digit: the digit to the right of the digit that may be rounded up.
+ i = xc[d];
+
+ // Look at the rounding digits and mode to determine whether to round up.
+
+ k = baseOut / 2;
+ r = r || d < 0 || xc[d + 1] != null;
+
+ r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))
+ : i > k || i == k &&(rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||
+ rm == (x.s < 0 ? 8 : 7));
+
+ // If the index of the rounding digit is not greater than zero, or xc represents
+ // zero, then the result of the base conversion is zero or, if rounding up, a value
+ // such as 0.00001.
+ if (d < 1 || !xc[0]) {
+
+ // 1^-dp or 0
+ str = r ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) : alphabet.charAt(0);
+ } else {
+
+ // Truncate xc to the required number of decimal places.
+ xc.length = d;
+
+ // Round up?
+ if (r) {
+
+ // Rounding up may mean the previous digit has to be rounded up and so on.
+ for (--baseOut; ++xc[--d] > baseOut;) {
+ xc[d] = 0;
+
+ if (!d) {
+ ++e;
+ xc = [1].concat(xc);
+ }
+ }
+ }
+
+ // Determine trailing zeros.
+ for (k = xc.length; !xc[--k];);
+
+ // E.g. [4, 11, 15] becomes 4bf.
+ for (i = 0, str = ''; i <= k; str += alphabet.charAt(xc[i++]));
+
+ // Add leading zeros, decimal point and trailing zeros as required.
+ str = toFixedPoint(str, e, alphabet.charAt(0));
+ }
+
+ // The caller will add the sign.
+ return str;
+ };
+ })();
+
+
+ // Perform division in the specified base. Called by div and convertBase.
+ div = (function () {
+
+ // Assume non-zero x and k.
+ function multiply(x, k, base) {
+ var m, temp, xlo, xhi,
+ carry = 0,
+ i = x.length,
+ klo = k % SQRT_BASE,
+ khi = k / SQRT_BASE | 0;
+
+ for (x = x.slice(); i--;) {
+ xlo = x[i] % SQRT_BASE;
+ xhi = x[i] / SQRT_BASE | 0;
+ m = khi * xlo + xhi * klo;
+ temp = klo * xlo + ((m % SQRT_BASE) * SQRT_BASE) + carry;
+ carry = (temp / base | 0) + (m / SQRT_BASE | 0) + khi * xhi;
+ x[i] = temp % base;
+ }
+
+ if (carry) x = [carry].concat(x);
+
+ return x;
+ }
+
+ function compare(a, b, aL, bL) {
+ var i, cmp;
+
+ if (aL != bL) {
+ cmp = aL > bL ? 1 : -1;
+ } else {
+
+ for (i = cmp = 0; i < aL; i++) {
+
+ if (a[i] != b[i]) {
+ cmp = a[i] > b[i] ? 1 : -1;
+ break;
+ }
+ }
+ }
+
+ return cmp;
+ }
+
+ function subtract(a, b, aL, base) {
+ var i = 0;
+
+ // Subtract b from a.
+ for (; aL--;) {
+ a[aL] -= i;
+ i = a[aL] < b[aL] ? 1 : 0;
+ a[aL] = i * base + a[aL] - b[aL];
+ }
+
+ // Remove leading zeros.
+ for (; !a[0] && a.length > 1; a.splice(0, 1));
+ }
+
+ // x: dividend, y: divisor.
+ return function (x, y, dp, rm, base) {
+ var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0,
+ yL, yz,
+ s = x.s == y.s ? 1 : -1,
+ xc = x.c,
+ yc = y.c;
+
+ // Either NaN, Infinity or 0?
+ if (!xc || !xc[0] || !yc || !yc[0]) {
+
+ return new BigNumber(
+
+ // Return NaN if either NaN, or both Infinity or 0.
+ !x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN :
+
+ // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.
+ xc && xc[0] == 0 || !yc ? s * 0 : s / 0
+ );
+ }
+
+ q = new BigNumber(s);
+ qc = q.c = [];
+ e = x.e - y.e;
+ s = dp + e + 1;
+
+ if (!base) {
+ base = BASE;
+ e = bitFloor(x.e / LOG_BASE) - bitFloor(y.e / LOG_BASE);
+ s = s / LOG_BASE | 0;
+ }
+
+ // Result exponent may be one less then the current value of e.
+ // The coefficients of the BigNumbers from convertBase may have trailing zeros.
+ for (i = 0; yc[i] == (xc[i] || 0); i++);
+
+ if (yc[i] > (xc[i] || 0)) e--;
+
+ if (s < 0) {
+ qc.push(1);
+ more = true;
+ } else {
+ xL = xc.length;
+ yL = yc.length;
+ i = 0;
+ s += 2;
+
+ // Normalise xc and yc so highest order digit of yc is >= base / 2.
+
+ n = mathfloor(base / (yc[0] + 1));
+
+ // Not necessary, but to handle odd bases where yc[0] == (base / 2) - 1.
+ // if (n > 1 || n++ == 1 && yc[0] < base / 2) {
+ if (n > 1) {
+ yc = multiply(yc, n, base);
+ xc = multiply(xc, n, base);
+ yL = yc.length;
+ xL = xc.length;
+ }
+
+ xi = yL;
+ rem = xc.slice(0, yL);
+ remL = rem.length;
+
+ // Add zeros to make remainder as long as divisor.
+ for (; remL < yL; rem[remL++] = 0);
+ yz = yc.slice();
+ yz = [0].concat(yz);
+ yc0 = yc[0];
+ if (yc[1] >= base / 2) yc0++;
+ // Not necessary, but to prevent trial digit n > base, when using base 3.
+ // else if (base == 3 && yc0 == 1) yc0 = 1 + 1e-15;
+
+ do {
+ n = 0;
+
+ // Compare divisor and remainder.
+ cmp = compare(yc, rem, yL, remL);
+
+ // If divisor < remainder.
+ if (cmp < 0) {
+
+ // Calculate trial digit, n.
+
+ rem0 = rem[0];
+ if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);
+
+ // n is how many times the divisor goes into the current remainder.
+ n = mathfloor(rem0 / yc0);
+
+ // Algorithm:
+ // product = divisor multiplied by trial digit (n).
+ // Compare product and remainder.
+ // If product is greater than remainder:
+ // Subtract divisor from product, decrement trial digit.
+ // Subtract product from remainder.
+ // If product was less than remainder at the last compare:
+ // Compare new remainder and divisor.
+ // If remainder is greater than divisor:
+ // Subtract divisor from remainder, increment trial digit.
+
+ if (n > 1) {
+
+ // n may be > base only when base is 3.
+ if (n >= base) n = base - 1;
+
+ // product = divisor * trial digit.
+ prod = multiply(yc, n, base);
+ prodL = prod.length;
+ remL = rem.length;
+
+ // Compare product and remainder.
+ // If product > remainder then trial digit n too high.
+ // n is 1 too high about 5% of the time, and is not known to have
+ // ever been more than 1 too high.
+ while (compare(prod, rem, prodL, remL) == 1) {
+ n--;
+
+ // Subtract divisor from product.
+ subtract(prod, yL < prodL ? yz : yc, prodL, base);
+ prodL = prod.length;
+ cmp = 1;
+ }
+ } else {
+
+ // n is 0 or 1, cmp is -1.
+ // If n is 0, there is no need to compare yc and rem again below,
+ // so change cmp to 1 to avoid it.
+ // If n is 1, leave cmp as -1, so yc and rem are compared again.
+ if (n == 0) {
+
+ // divisor < remainder, so n must be at least 1.
+ cmp = n = 1;
+ }
+
+ // product = divisor
+ prod = yc.slice();
+ prodL = prod.length;
+ }
+
+ if (prodL < remL) prod = [0].concat(prod);
+
+ // Subtract product from remainder.
+ subtract(rem, prod, remL, base);
+ remL = rem.length;
+
+ // If product was < remainder.
+ if (cmp == -1) {
+
+ // Compare divisor and new remainder.
+ // If divisor < new remainder, subtract divisor from remainder.
+ // Trial digit n too low.
+ // n is 1 too low about 5% of the time, and very rarely 2 too low.
+ while (compare(yc, rem, yL, remL) < 1) {
+ n++;
+
+ // Subtract divisor from remainder.
+ subtract(rem, yL < remL ? yz : yc, remL, base);
+ remL = rem.length;
+ }
+ }
+ } else if (cmp === 0) {
+ n++;
+ rem = [0];
+ } // else cmp === 1 and n will be 0
+
+ // Add the next digit, n, to the result array.
+ qc[i++] = n;
+
+ // Update the remainder.
+ if (rem[0]) {
+ rem[remL++] = xc[xi] || 0;
+ } else {
+ rem = [xc[xi]];
+ remL = 1;
+ }
+ } while ((xi++ < xL || rem[0] != null) && s--);
+
+ more = rem[0] != null;
+
+ // Leading zero?
+ if (!qc[0]) qc.splice(0, 1);
+ }
+
+ if (base == BASE) {
+
+ // To calculate q.e, first get the number of digits of qc[0].
+ for (i = 1, s = qc[0]; s >= 10; s /= 10, i++);
+
+ round(q, dp + (q.e = i + e * LOG_BASE - 1) + 1, rm, more);
+
+ // Caller is convertBase.
+ } else {
+ q.e = e;
+ q.r = +more;
+ }
+
+ return q;
+ };
+ })();
+
+
+ /*
+ * Return a string representing the value of BigNumber n in fixed-point or exponential
+ * notation rounded to the specified decimal places or significant digits.
+ *
+ * n: a BigNumber.
+ * i: the index of the last digit required (i.e. the digit that may be rounded up).
+ * rm: the rounding mode.
+ * id: 1 (toExponential) or 2 (toPrecision).
+ */
+ function format(n, i, rm, id) {
+ var c0, e, ne, len, str;
+
+ if (rm == null) rm = ROUNDING_MODE;
+ else intCheck(rm, 0, 8);
+
+ if (!n.c) return n.toString();
+
+ c0 = n.c[0];
+ ne = n.e;
+
+ if (i == null) {
+ str = coeffToString(n.c);
+ str = id == 1 || id == 2 && (ne <= TO_EXP_NEG || ne >= TO_EXP_POS)
+ ? toExponential(str, ne)
+ : toFixedPoint(str, ne, '0');
+ } else {
+ n = round(new BigNumber(n), i, rm);
+
+ // n.e may have changed if the value was rounded up.
+ e = n.e;
+
+ str = coeffToString(n.c);
+ len = str.length;
+
+ // toPrecision returns exponential notation if the number of significant digits
+ // specified is less than the number of digits necessary to represent the integer
+ // part of the value in fixed-point notation.
+
+ // Exponential notation.
+ if (id == 1 || id == 2 && (i <= e || e <= TO_EXP_NEG)) {
+
+ // Append zeros?
+ for (; len < i; str += '0', len++);
+ str = toExponential(str, e);
+
+ // Fixed-point notation.
+ } else {
+ i -= ne + (id === 2 && e > ne);
+ str = toFixedPoint(str, e, '0');
+
+ // Append zeros?
+ if (e + 1 > len) {
+ if (--i > 0) for (str += '.'; i--; str += '0');
+ } else {
+ i += e - len;
+ if (i > 0) {
+ if (e + 1 == len) str += '.';
+ for (; i--; str += '0');
+ }
+ }
+ }
+ }
+
+ return n.s < 0 && c0 ? '-' + str : str;
+ }
+
+
+ // Handle BigNumber.max and BigNumber.min.
+ // If any number is NaN, return NaN.
+ function maxOrMin(args, n) {
+ var k, y,
+ i = 1,
+ x = new BigNumber(args[0]);
+
+ for (; i < args.length; i++) {
+ y = new BigNumber(args[i]);
+ if (!y.s || (k = compare(x, y)) === n || k === 0 && x.s === n) {
+ x = y;
+ }
+ }
+
+ return x;
+ }
+
+
+ /*
+ * Strip trailing zeros, calculate base 10 exponent and check against MIN_EXP and MAX_EXP.
+ * Called by minus, plus and times.
+ */
+ function normalise(n, c, e) {
+ var i = 1,
+ j = c.length;
+
+ // Remove trailing zeros.
+ for (; !c[--j]; c.pop());
+
+ // Calculate the base 10 exponent. First get the number of digits of c[0].
+ for (j = c[0]; j >= 10; j /= 10, i++);
+
+ // Overflow?
+ if ((e = i + e * LOG_BASE - 1) > MAX_EXP) {
+
+ // Infinity.
+ n.c = n.e = null;
+
+ // Underflow?
+ } else if (e < MIN_EXP) {
+
+ // Zero.
+ n.c = [n.e = 0];
+ } else {
+ n.e = e;
+ n.c = c;
+ }
+
+ return n;
+ }
+
+
+ // Handle values that fail the validity test in BigNumber.
+ parseNumeric = (function () {
+ var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i,
+ dotAfter = /^([^.]+)\.$/,
+ dotBefore = /^\.([^.]+)$/,
+ isInfinityOrNaN = /^-?(Infinity|NaN)$/,
+ whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
+
+ return function (x, str, isNum, b) {
+ var base,
+ s = isNum ? str : str.replace(whitespaceOrPlus, '');
+
+ // No exception on ±Infinity or NaN.
+ if (isInfinityOrNaN.test(s)) {
+ x.s = isNaN(s) ? null : s < 0 ? -1 : 1;
+ } else {
+ if (!isNum) {
+
+ // basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i
+ s = s.replace(basePrefix, function (m, p1, p2) {
+ base = (p2 = p2.toLowerCase()) == 'x' ? 16 : p2 == 'b' ? 2 : 8;
+ return !b || b == base ? p1 : m;
+ });
+
+ if (b) {
+ base = b;
+
+ // E.g. '1.' to '1', '.1' to '0.1'
+ s = s.replace(dotAfter, '$1').replace(dotBefore, '0.$1');
+ }
+
+ if (str != s) return new BigNumber(s, base);
+ }
+
+ // '[BigNumber Error] Not a number: {n}'
+ // '[BigNumber Error] Not a base {b} number: {n}'
+ if (BigNumber.DEBUG) {
+ throw Error
+ (bignumberError + 'Not a' + (b ? ' base ' + b : '') + ' number: ' + str);
+ }
+
+ // NaN
+ x.s = null;
+ }
+
+ x.c = x.e = null;
+ }
+ })();
+
+
+ /*
+ * Round x to sd significant digits using rounding mode rm. Check for over/under-flow.
+ * If r is truthy, it is known that there are more digits after the rounding digit.
+ */
+ function round(x, sd, rm, r) {
+ var d, i, j, k, n, ni, rd,
+ xc = x.c,
+ pows10 = POWS_TEN;
+
+ // if x is not Infinity or NaN...
+ if (xc) {
+
+ // rd is the rounding digit, i.e. the digit after the digit that may be rounded up.
+ // n is a base 1e14 number, the value of the element of array x.c containing rd.
+ // ni is the index of n within x.c.
+ // d is the number of digits of n.
+ // i is the index of rd within n including leading zeros.
+ // j is the actual index of rd within n (if < 0, rd is a leading zero).
+ out: {
+
+ // Get the number of digits of the first element of xc.
+ for (d = 1, k = xc[0]; k >= 10; k /= 10, d++);
+ i = sd - d;
+
+ // If the rounding digit is in the first element of xc...
+ if (i < 0) {
+ i += LOG_BASE;
+ j = sd;
+ n = xc[ni = 0];
+
+ // Get the rounding digit at index j of n.
+ rd = mathfloor(n / pows10[d - j - 1] % 10);
+ } else {
+ ni = mathceil((i + 1) / LOG_BASE);
+
+ if (ni >= xc.length) {
+
+ if (r) {
+
+ // Needed by sqrt.
+ for (; xc.length <= ni; xc.push(0));
+ n = rd = 0;
+ d = 1;
+ i %= LOG_BASE;
+ j = i - LOG_BASE + 1;
+ } else {
+ break out;
+ }
+ } else {
+ n = k = xc[ni];
+
+ // Get the number of digits of n.
+ for (d = 1; k >= 10; k /= 10, d++);
+
+ // Get the index of rd within n.
+ i %= LOG_BASE;
+
+ // Get the index of rd within n, adjusted for leading zeros.
+ // The number of leading zeros of n is given by LOG_BASE - d.
+ j = i - LOG_BASE + d;
+
+ // Get the rounding digit at index j of n.
+ rd = j < 0 ? 0 : mathfloor(n / pows10[d - j - 1] % 10);
+ }
+ }
+
+ r = r || sd < 0 ||
+
+ // Are there any non-zero digits after the rounding digit?
+ // The expression n % pows10[d - j - 1] returns all digits of n to the right
+ // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.
+ xc[ni + 1] != null || (j < 0 ? n : n % pows10[d - j - 1]);
+
+ r = rm < 4
+ ? (rd || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))
+ : rd > 5 || rd == 5 && (rm == 4 || r || rm == 6 &&
+
+ // Check whether the digit to the left of the rounding digit is odd.
+ ((i > 0 ? j > 0 ? n / pows10[d - j] : 0 : xc[ni - 1]) % 10) & 1 ||
+ rm == (x.s < 0 ? 8 : 7));
+
+ if (sd < 1 || !xc[0]) {
+ xc.length = 0;
+
+ if (r) {
+
+ // Convert sd to decimal places.
+ sd -= x.e + 1;
+
+ // 1, 0.1, 0.01, 0.001, 0.0001 etc.
+ xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE];
+ x.e = -sd || 0;
+ } else {
+
+ // Zero.
+ xc[0] = x.e = 0;
+ }
+
+ return x;
+ }
+
+ // Remove excess digits.
+ if (i == 0) {
+ xc.length = ni;
+ k = 1;
+ ni--;
+ } else {
+ xc.length = ni + 1;
+ k = pows10[LOG_BASE - i];
+
+ // E.g. 56700 becomes 56000 if 7 is the rounding digit.
+ // j > 0 means i > number of leading zeros of n.
+ xc[ni] = j > 0 ? mathfloor(n / pows10[d - j] % pows10[j]) * k : 0;
+ }
+
+ // Round up?
+ if (r) {
+
+ for (; ;) {
+
+ // If the digit to be rounded up is in the first element of xc...
+ if (ni == 0) {
+
+ // i will be the length of xc[0] before k is added.
+ for (i = 1, j = xc[0]; j >= 10; j /= 10, i++);
+ j = xc[0] += k;
+ for (k = 1; j >= 10; j /= 10, k++);
+
+ // if i != k the length has increased.
+ if (i != k) {
+ x.e++;
+ if (xc[0] == BASE) xc[0] = 1;
+ }
+
+ break;
+ } else {
+ xc[ni] += k;
+ if (xc[ni] != BASE) break;
+ xc[ni--] = 0;
+ k = 1;
+ }
+ }
+ }
+
+ // Remove trailing zeros.
+ for (i = xc.length; xc[--i] === 0; xc.pop());
+ }
+
+ // Overflow? Infinity.
+ if (x.e > MAX_EXP) {
+ x.c = x.e = null;
+
+ // Underflow? Zero.
+ } else if (x.e < MIN_EXP) {
+ x.c = [x.e = 0];
+ }
+ }
+
+ return x;
+ }
+
+
+ function valueOf(n) {
+ var str,
+ e = n.e;
+
+ if (e === null) return n.toString();
+
+ str = coeffToString(n.c);
+
+ str = e <= TO_EXP_NEG || e >= TO_EXP_POS
+ ? toExponential(str, e)
+ : toFixedPoint(str, e, '0');
+
+ return n.s < 0 ? '-' + str : str;
+ }
+
+
+ // PROTOTYPE/INSTANCE METHODS
+
+
+ /*
+ * Return a new BigNumber whose value is the absolute value of this BigNumber.
+ */
+ P.absoluteValue = P.abs = function () {
+ var x = new BigNumber(this);
+ if (x.s < 0) x.s = 1;
+ return x;
+ };
+
+
+ /*
+ * Return
+ * 1 if the value of this BigNumber is greater than the value of BigNumber(y, b),
+ * -1 if the value of this BigNumber is less than the value of BigNumber(y, b),
+ * 0 if they have the same value,
+ * or null if the value of either is NaN.
+ */
+ P.comparedTo = function (y, b) {
+ return compare(this, new BigNumber(y, b));
+ };
+
+
+ /*
+ * If dp is undefined or null or true or false, return the number of decimal places of the
+ * value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN.
+ *
+ * Otherwise, if dp is a number, return a new BigNumber whose value is the value of this
+ * BigNumber rounded to a maximum of dp decimal places using rounding mode rm, or
+ * ROUNDING_MODE if rm is omitted.
+ *
+ * [dp] {number} Decimal places: integer, 0 to MAX inclusive.
+ * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
+ *
+ * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'
+ */
+ P.decimalPlaces = P.dp = function (dp, rm) {
+ var c, n, v,
+ x = this;
+
+ if (dp != null) {
+ intCheck(dp, 0, MAX);
+ if (rm == null) rm = ROUNDING_MODE;
+ else intCheck(rm, 0, 8);
+
+ return round(new BigNumber(x), dp + x.e + 1, rm);
+ }
+
+ if (!(c = x.c)) return null;
+ n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE;
+
+ // Subtract the number of trailing zeros of the last number.
+ if (v = c[v]) for (; v % 10 == 0; v /= 10, n--);
+ if (n < 0) n = 0;
+
+ return n;
+ };
+
+
+ /*
+ * n / 0 = I
+ * n / N = N
+ * n / I = 0
+ * 0 / n = 0
+ * 0 / 0 = N
+ * 0 / N = N
+ * 0 / I = 0
+ * N / n = N
+ * N / 0 = N
+ * N / N = N
+ * N / I = N
+ * I / n = I
+ * I / 0 = I
+ * I / N = N
+ * I / I = N
+ *
+ * Return a new BigNumber whose value is the value of this BigNumber divided by the value of
+ * BigNumber(y, b), rounded according to DECIMAL_PLACES and ROUNDING_MODE.
+ */
+ P.dividedBy = P.div = function (y, b) {
+ return div(this, new BigNumber(y, b), DECIMAL_PLACES, ROUNDING_MODE);
+ };
+
+
+ /*
+ * Return a new BigNumber whose value is the integer part of dividing the value of this
+ * BigNumber by the value of BigNumber(y, b).
+ */
+ P.dividedToIntegerBy = P.idiv = function (y, b) {
+ return div(this, new BigNumber(y, b), 0, 1);
+ };
+
+
+ /*
+ * Return a BigNumber whose value is the value of this BigNumber exponentiated by n.
+ *
+ * If m is present, return the result modulo m.
+ * If n is negative round according to DECIMAL_PLACES and ROUNDING_MODE.
+ * If POW_PRECISION is non-zero and m is not present, round to POW_PRECISION using ROUNDING_MODE.
+ *
+ * The modular power operation works efficiently when x, n, and m are integers, otherwise it
+ * is equivalent to calculating x.exponentiatedBy(n).modulo(m) with a POW_PRECISION of 0.
+ *
+ * n {number|string|BigNumber} The exponent. An integer.
+ * [m] {number|string|BigNumber} The modulus.
+ *
+ * '[BigNumber Error] Exponent not an integer: {n}'
+ */
+ P.exponentiatedBy = P.pow = function (n, m) {
+ var half, isModExp, i, k, more, nIsBig, nIsNeg, nIsOdd, y,
+ x = this;
+
+ n = new BigNumber(n);
+
+ // Allow NaN and ±Infinity, but not other non-integers.
+ if (n.c && !n.isInteger()) {
+ throw Error
+ (bignumberError + 'Exponent not an integer: ' + valueOf(n));
+ }
+
+ if (m != null) m = new BigNumber(m);
+
+ // Exponent of MAX_SAFE_INTEGER is 15.
+ nIsBig = n.e > 14;
+
+ // If x is NaN, ±Infinity, ±0 or ±1, or n is ±Infinity, NaN or ±0.
+ if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) {
+
+ // The sign of the result of pow when x is negative depends on the evenness of n.
+ // If +n overflows to ±Infinity, the evenness of n would be not be known.
+ y = new BigNumber(Math.pow(+valueOf(x), nIsBig ? n.s * (2 - isOdd(n)) : +valueOf(n)));
+ return m ? y.mod(m) : y;
+ }
+
+ nIsNeg = n.s < 0;
+
+ if (m) {
+
+ // x % m returns NaN if abs(m) is zero, or m is NaN.
+ if (m.c ? !m.c[0] : !m.s) return new BigNumber(NaN);
+
+ isModExp = !nIsNeg && x.isInteger() && m.isInteger();
+
+ if (isModExp) x = x.mod(m);
+
+ // Overflow to ±Infinity: >=2**1e10 or >=1.0000024**1e15.
+ // Underflow to ±0: <=0.79**1e10 or <=0.9999975**1e15.
+ } else if (n.e > 9 && (x.e > 0 || x.e < -1 || (x.e == 0
+ // [1, 240000000]
+ ? x.c[0] > 1 || nIsBig && x.c[1] >= 24e7
+ // [80000000000000] [99999750000000]
+ : x.c[0] < 8e13 || nIsBig && x.c[0] <= 9999975e7))) {
+
+ // If x is negative and n is odd, k = -0, else k = 0.
+ k = x.s < 0 && isOdd(n) ? -0 : 0;
+
+ // If x >= 1, k = ±Infinity.
+ if (x.e > -1) k = 1 / k;
+
+ // If n is negative return ±0, else return ±Infinity.
+ return new BigNumber(nIsNeg ? 1 / k : k);
+
+ } else if (POW_PRECISION) {
+
+ // Truncating each coefficient array to a length of k after each multiplication
+ // equates to truncating significant digits to POW_PRECISION + [28, 41],
+ // i.e. there will be a minimum of 28 guard digits retained.
+ k = mathceil(POW_PRECISION / LOG_BASE + 2);
+ }
+
+ if (nIsBig) {
+ half = new BigNumber(0.5);
+ if (nIsNeg) n.s = 1;
+ nIsOdd = isOdd(n);
+ } else {
+ i = Math.abs(+valueOf(n));
+ nIsOdd = i % 2;
+ }
+
+ y = new BigNumber(ONE);
+
+ // Performs 54 loop iterations for n of 9007199254740991.
+ for (; ;) {
+
+ if (nIsOdd) {
+ y = y.times(x);
+ if (!y.c) break;
+
+ if (k) {
+ if (y.c.length > k) y.c.length = k;
+ } else if (isModExp) {
+ y = y.mod(m); //y = y.minus(div(y, m, 0, MODULO_MODE).times(m));
+ }
+ }
+
+ if (i) {
+ i = mathfloor(i / 2);
+ if (i === 0) break;
+ nIsOdd = i % 2;
+ } else {
+ n = n.times(half);
+ round(n, n.e + 1, 1);
+
+ if (n.e > 14) {
+ nIsOdd = isOdd(n);
+ } else {
+ i = +valueOf(n);
+ if (i === 0) break;
+ nIsOdd = i % 2;
+ }
+ }
+
+ x = x.times(x);
+
+ if (k) {
+ if (x.c && x.c.length > k) x.c.length = k;
+ } else if (isModExp) {
+ x = x.mod(m); //x = x.minus(div(x, m, 0, MODULO_MODE).times(m));
+ }
+ }
+
+ if (isModExp) return y;
+ if (nIsNeg) y = ONE.div(y);
+
+ return m ? y.mod(m) : k ? round(y, POW_PRECISION, ROUNDING_MODE, more) : y;
+ };
+
+
+ /*
+ * Return a new BigNumber whose value is the value of this BigNumber rounded to an integer
+ * using rounding mode rm, or ROUNDING_MODE if rm is omitted.
+ *
+ * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
+ *
+ * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {rm}'
+ */
+ P.integerValue = function (rm) {
+ var n = new BigNumber(this);
+ if (rm == null) rm = ROUNDING_MODE;
+ else intCheck(rm, 0, 8);
+ return round(n, n.e + 1, rm);
+ };
+
+
+ /*
+ * Return true if the value of this BigNumber is equal to the value of BigNumber(y, b),
+ * otherwise return false.
+ */
+ P.isEqualTo = P.eq = function (y, b) {
+ return compare(this, new BigNumber(y, b)) === 0;
+ };
+
+
+ /*
+ * Return true if the value of this BigNumber is a finite number, otherwise return false.
+ */
+ P.isFinite = function () {
+ return !!this.c;
+ };
+
+
+ /*
+ * Return true if the value of this BigNumber is greater than the value of BigNumber(y, b),
+ * otherwise return false.
+ */
+ P.isGreaterThan = P.gt = function (y, b) {
+ return compare(this, new BigNumber(y, b)) > 0;
+ };
+
+
+ /*
+ * Return true if the value of this BigNumber is greater than or equal to the value of
+ * BigNumber(y, b), otherwise return false.
+ */
+ P.isGreaterThanOrEqualTo = P.gte = function (y, b) {
+ return (b = compare(this, new BigNumber(y, b))) === 1 || b === 0;
+
+ };
+
+
+ /*
+ * Return true if the value of this BigNumber is an integer, otherwise return false.
+ */
+ P.isInteger = function () {
+ return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2;
+ };
+
+
+ /*
+ * Return true if the value of this BigNumber is less than the value of BigNumber(y, b),
+ * otherwise return false.
+ */
+ P.isLessThan = P.lt = function (y, b) {
+ return compare(this, new BigNumber(y, b)) < 0;
+ };
+
+
+ /*
+ * Return true if the value of this BigNumber is less than or equal to the value of
+ * BigNumber(y, b), otherwise return false.
+ */
+ P.isLessThanOrEqualTo = P.lte = function (y, b) {
+ return (b = compare(this, new BigNumber(y, b))) === -1 || b === 0;
+ };
+
+
+ /*
+ * Return true if the value of this BigNumber is NaN, otherwise return false.
+ */
+ P.isNaN = function () {
+ return !this.s;
+ };
+
+
+ /*
+ * Return true if the value of this BigNumber is negative, otherwise return false.
+ */
+ P.isNegative = function () {
+ return this.s < 0;
+ };
+
+
+ /*
+ * Return true if the value of this BigNumber is positive, otherwise return false.
+ */
+ P.isPositive = function () {
+ return this.s > 0;
+ };
+
+
+ /*
+ * Return true if the value of this BigNumber is 0 or -0, otherwise return false.
+ */
+ P.isZero = function () {
+ return !!this.c && this.c[0] == 0;
+ };
+
+
+ /*
+ * n - 0 = n
+ * n - N = N
+ * n - I = -I
+ * 0 - n = -n
+ * 0 - 0 = 0
+ * 0 - N = N
+ * 0 - I = -I
+ * N - n = N
+ * N - 0 = N
+ * N - N = N
+ * N - I = N
+ * I - n = I
+ * I - 0 = I
+ * I - N = N
+ * I - I = N
+ *
+ * Return a new BigNumber whose value is the value of this BigNumber minus the value of
+ * BigNumber(y, b).
+ */
+ P.minus = function (y, b) {
+ var i, j, t, xLTy,
+ x = this,
+ a = x.s;
+
+ y = new BigNumber(y, b);
+ b = y.s;
+
+ // Either NaN?
+ if (!a || !b) return new BigNumber(NaN);
+
+ // Signs differ?
+ if (a != b) {
+ y.s = -b;
+ return x.plus(y);
+ }
+
+ var xe = x.e / LOG_BASE,
+ ye = y.e / LOG_BASE,
+ xc = x.c,
+ yc = y.c;
+
+ if (!xe || !ye) {
+
+ // Either Infinity?
+ if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber(yc ? x : NaN);
+
+ // Either zero?
+ if (!xc[0] || !yc[0]) {
+
+ // Return y if y is non-zero, x if x is non-zero, or zero if both are zero.
+ return yc[0] ? (y.s = -b, y) : new BigNumber(xc[0] ? x :
+
+ // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity
+ ROUNDING_MODE == 3 ? -0 : 0);
+ }
+ }
+
+ xe = bitFloor(xe);
+ ye = bitFloor(ye);
+ xc = xc.slice();
+
+ // Determine which is the bigger number.
+ if (a = xe - ye) {
+
+ if (xLTy = a < 0) {
+ a = -a;
+ t = xc;
+ } else {
+ ye = xe;
+ t = yc;
+ }
+
+ t.reverse();
+
+ // Prepend zeros to equalise exponents.
+ for (b = a; b--; t.push(0));
+ t.reverse();
+ } else {
+
+ // Exponents equal. Check digit by digit.
+ j = (xLTy = (a = xc.length) < (b = yc.length)) ? a : b;
+
+ for (a = b = 0; b < j; b++) {
+
+ if (xc[b] != yc[b]) {
+ xLTy = xc[b] < yc[b];
+ break;
+ }
+ }
+ }
+
+ // x < y? Point xc to the array of the bigger number.
+ if (xLTy) {
+ t = xc;
+ xc = yc;
+ yc = t;
+ y.s = -y.s;
+ }
+
+ b = (j = yc.length) - (i = xc.length);
+
+ // Append zeros to xc if shorter.
+ // No need to add zeros to yc if shorter as subtract only needs to start at yc.length.
+ if (b > 0) for (; b--; xc[i++] = 0);
+ b = BASE - 1;
+
+ // Subtract yc from xc.
+ for (; j > a;) {
+
+ if (xc[--j] < yc[j]) {
+ for (i = j; i && !xc[--i]; xc[i] = b);
+ --xc[i];
+ xc[j] += BASE;
+ }
+
+ xc[j] -= yc[j];
+ }
+
+ // Remove leading zeros and adjust exponent accordingly.
+ for (; xc[0] == 0; xc.splice(0, 1), --ye);
+
+ // Zero?
+ if (!xc[0]) {
+
+ // Following IEEE 754 (2008) 6.3,
+ // n - n = +0 but n - n = -0 when rounding towards -Infinity.
+ y.s = ROUNDING_MODE == 3 ? -1 : 1;
+ y.c = [y.e = 0];
+ return y;
+ }
+
+ // No need to check for Infinity as +x - +y != Infinity && -x - -y != Infinity
+ // for finite x and y.
+ return normalise(y, xc, ye);
+ };
+
+
+ /*
+ * n % 0 = N
+ * n % N = N
+ * n % I = n
+ * 0 % n = 0
+ * -0 % n = -0
+ * 0 % 0 = N
+ * 0 % N = N
+ * 0 % I = 0
+ * N % n = N
+ * N % 0 = N
+ * N % N = N
+ * N % I = N
+ * I % n = N
+ * I % 0 = N
+ * I % N = N
+ * I % I = N
+ *
+ * Return a new BigNumber whose value is the value of this BigNumber modulo the value of
+ * BigNumber(y, b). The result depends on the value of MODULO_MODE.
+ */
+ P.modulo = P.mod = function (y, b) {
+ var q, s,
+ x = this;
+
+ y = new BigNumber(y, b);
+
+ // Return NaN if x is Infinity or NaN, or y is NaN or zero.
+ if (!x.c || !y.s || y.c && !y.c[0]) {
+ return new BigNumber(NaN);
+
+ // Return x if y is Infinity or x is zero.
+ } else if (!y.c || x.c && !x.c[0]) {
+ return new BigNumber(x);
+ }
+
+ if (MODULO_MODE == 9) {
+
+ // Euclidian division: q = sign(y) * floor(x / abs(y))
+ // r = x - qy where 0 <= r < abs(y)
+ s = y.s;
+ y.s = 1;
+ q = div(x, y, 0, 3);
+ y.s = s;
+ q.s *= s;
+ } else {
+ q = div(x, y, 0, MODULO_MODE);
+ }
+
+ y = x.minus(q.times(y));
+
+ // To match JavaScript %, ensure sign of zero is sign of dividend.
+ if (!y.c[0] && MODULO_MODE == 1) y.s = x.s;
+
+ return y;
+ };
+
+
+ /*
+ * n * 0 = 0
+ * n * N = N
+ * n * I = I
+ * 0 * n = 0
+ * 0 * 0 = 0
+ * 0 * N = N
+ * 0 * I = N
+ * N * n = N
+ * N * 0 = N
+ * N * N = N
+ * N * I = N
+ * I * n = I
+ * I * 0 = N
+ * I * N = N
+ * I * I = I
+ *
+ * Return a new BigNumber whose value is the value of this BigNumber multiplied by the value
+ * of BigNumber(y, b).
+ */
+ P.multipliedBy = P.times = function (y, b) {
+ var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc,
+ base, sqrtBase,
+ x = this,
+ xc = x.c,
+ yc = (y = new BigNumber(y, b)).c;
+
+ // Either NaN, ±Infinity or ±0?
+ if (!xc || !yc || !xc[0] || !yc[0]) {
+
+ // Return NaN if either is NaN, or one is 0 and the other is Infinity.
+ if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) {
+ y.c = y.e = y.s = null;
+ } else {
+ y.s *= x.s;
+
+ // Return ±Infinity if either is ±Infinity.
+ if (!xc || !yc) {
+ y.c = y.e = null;
+
+ // Return ±0 if either is ±0.
+ } else {
+ y.c = [0];
+ y.e = 0;
+ }
+ }
+
+ return y;
+ }
+
+ e = bitFloor(x.e / LOG_BASE) + bitFloor(y.e / LOG_BASE);
+ y.s *= x.s;
+ xcL = xc.length;
+ ycL = yc.length;
+
+ // Ensure xc points to longer array and xcL to its length.
+ if (xcL < ycL) {
+ zc = xc;
+ xc = yc;
+ yc = zc;
+ i = xcL;
+ xcL = ycL;
+ ycL = i;
+ }
+
+ // Initialise the result array with zeros.
+ for (i = xcL + ycL, zc = []; i--; zc.push(0));
+
+ base = BASE;
+ sqrtBase = SQRT_BASE;
+
+ for (i = ycL; --i >= 0;) {
+ c = 0;
+ ylo = yc[i] % sqrtBase;
+ yhi = yc[i] / sqrtBase | 0;
+
+ for (k = xcL, j = i + k; j > i;) {
+ xlo = xc[--k] % sqrtBase;
+ xhi = xc[k] / sqrtBase | 0;
+ m = yhi * xlo + xhi * ylo;
+ xlo = ylo * xlo + ((m % sqrtBase) * sqrtBase) + zc[j] + c;
+ c = (xlo / base | 0) + (m / sqrtBase | 0) + yhi * xhi;
+ zc[j--] = xlo % base;
+ }
+
+ zc[j] = c;
+ }
+
+ if (c) {
+ ++e;
+ } else {
+ zc.splice(0, 1);
+ }
+
+ return normalise(y, zc, e);
+ };
+
+
+ /*
+ * Return a new BigNumber whose value is the value of this BigNumber negated,
+ * i.e. multiplied by -1.
+ */
+ P.negated = function () {
+ var x = new BigNumber(this);
+ x.s = -x.s || null;
+ return x;
+ };
+
+
+ /*
+ * n + 0 = n
+ * n + N = N
+ * n + I = I
+ * 0 + n = n
+ * 0 + 0 = 0
+ * 0 + N = N
+ * 0 + I = I
+ * N + n = N
+ * N + 0 = N
+ * N + N = N
+ * N + I = N
+ * I + n = I
+ * I + 0 = I
+ * I + N = N
+ * I + I = I
+ *
+ * Return a new BigNumber whose value is the value of this BigNumber plus the value of
+ * BigNumber(y, b).
+ */
+ P.plus = function (y, b) {
+ var t,
+ x = this,
+ a = x.s;
+
+ y = new BigNumber(y, b);
+ b = y.s;
+
+ // Either NaN?
+ if (!a || !b) return new BigNumber(NaN);
+
+ // Signs differ?
+ if (a != b) {
+ y.s = -b;
+ return x.minus(y);
+ }
+
+ var xe = x.e / LOG_BASE,
+ ye = y.e / LOG_BASE,
+ xc = x.c,
+ yc = y.c;
+
+ if (!xe || !ye) {
+
+ // Return ±Infinity if either ±Infinity.
+ if (!xc || !yc) return new BigNumber(a / 0);
+
+ // Either zero?
+ // Return y if y is non-zero, x if x is non-zero, or zero if both are zero.
+ if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber(xc[0] ? x : a * 0);
+ }
+
+ xe = bitFloor(xe);
+ ye = bitFloor(ye);
+ xc = xc.slice();
+
+ // Prepend zeros to equalise exponents. Faster to use reverse then do unshifts.
+ if (a = xe - ye) {
+ if (a > 0) {
+ ye = xe;
+ t = yc;
+ } else {
+ a = -a;
+ t = xc;
+ }
+
+ t.reverse();
+ for (; a--; t.push(0));
+ t.reverse();
+ }
+
+ a = xc.length;
+ b = yc.length;
+
+ // Point xc to the longer array, and b to the shorter length.
+ if (a - b < 0) {
+ t = yc;
+ yc = xc;
+ xc = t;
+ b = a;
+ }
+
+ // Only start adding at yc.length - 1 as the further digits of xc can be ignored.
+ for (a = 0; b;) {
+ a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0;
+ xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE;
+ }
+
+ if (a) {
+ xc = [a].concat(xc);
+ ++ye;
+ }
+
+ // No need to check for zero, as +x + +y != 0 && -x + -y != 0
+ // ye = MAX_EXP + 1 possible
+ return normalise(y, xc, ye);
+ };
+
+
+ /*
+ * If sd is undefined or null or true or false, return the number of significant digits of
+ * the value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN.
+ * If sd is true include integer-part trailing zeros in the count.
+ *
+ * Otherwise, if sd is a number, return a new BigNumber whose value is the value of this
+ * BigNumber rounded to a maximum of sd significant digits using rounding mode rm, or
+ * ROUNDING_MODE if rm is omitted.
+ *
+ * sd {number|boolean} number: significant digits: integer, 1 to MAX inclusive.
+ * boolean: whether to count integer-part trailing zeros: true or false.
+ * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
+ *
+ * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}'
+ */
+ P.precision = P.sd = function (sd, rm) {
+ var c, n, v,
+ x = this;
+
+ if (sd != null && sd !== !!sd) {
+ intCheck(sd, 1, MAX);
+ if (rm == null) rm = ROUNDING_MODE;
+ else intCheck(rm, 0, 8);
+
+ return round(new BigNumber(x), sd, rm);
+ }
+
+ if (!(c = x.c)) return null;
+ v = c.length - 1;
+ n = v * LOG_BASE + 1;
+
+ if (v = c[v]) {
+
+ // Subtract the number of trailing zeros of the last element.
+ for (; v % 10 == 0; v /= 10, n--);
+
+ // Add the number of digits of the first element.
+ for (v = c[0]; v >= 10; v /= 10, n++);
+ }
+
+ if (sd && x.e + 1 > n) n = x.e + 1;
+
+ return n;
+ };
+
+
+ /*
+ * Return a new BigNumber whose value is the value of this BigNumber shifted by k places
+ * (powers of 10). Shift to the right if n > 0, and to the left if n < 0.
+ *
+ * k {number} Integer, -MAX_SAFE_INTEGER to MAX_SAFE_INTEGER inclusive.
+ *
+ * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {k}'
+ */
+ P.shiftedBy = function (k) {
+ intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER);
+ return this.times('1e' + k);
+ };
+
+
+ /*
+ * sqrt(-n) = N
+ * sqrt(N) = N
+ * sqrt(-I) = N
+ * sqrt(I) = I
+ * sqrt(0) = 0
+ * sqrt(-0) = -0
+ *
+ * Return a new BigNumber whose value is the square root of the value of this BigNumber,
+ * rounded according to DECIMAL_PLACES and ROUNDING_MODE.
+ */
+ P.squareRoot = P.sqrt = function () {
+ var m, n, r, rep, t,
+ x = this,
+ c = x.c,
+ s = x.s,
+ e = x.e,
+ dp = DECIMAL_PLACES + 4,
+ half = new BigNumber('0.5');
+
+ // Negative/NaN/Infinity/zero?
+ if (s !== 1 || !c || !c[0]) {
+ return new BigNumber(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0);
+ }
+
+ // Initial estimate.
+ s = Math.sqrt(+valueOf(x));
+
+ // Math.sqrt underflow/overflow?
+ // Pass x to Math.sqrt as integer, then adjust the exponent of the result.
+ if (s == 0 || s == 1 / 0) {
+ n = coeffToString(c);
+ if ((n.length + e) % 2 == 0) n += '0';
+ s = Math.sqrt(+n);
+ e = bitFloor((e + 1) / 2) - (e < 0 || e % 2);
+
+ if (s == 1 / 0) {
+ n = '5e' + e;
+ } else {
+ n = s.toExponential();
+ n = n.slice(0, n.indexOf('e') + 1) + e;
+ }
+
+ r = new BigNumber(n);
+ } else {
+ r = new BigNumber(s + '');
+ }
+
+ // Check for zero.
+ // r could be zero if MIN_EXP is changed after the this value was created.
+ // This would cause a division by zero (x/t) and hence Infinity below, which would cause
+ // coeffToString to throw.
+ if (r.c[0]) {
+ e = r.e;
+ s = e + dp;
+ if (s < 3) s = 0;
+
+ // Newton-Raphson iteration.
+ for (; ;) {
+ t = r;
+ r = half.times(t.plus(div(x, t, dp, 1)));
+
+ if (coeffToString(t.c).slice(0, s) === (n = coeffToString(r.c)).slice(0, s)) {
+
+ // The exponent of r may here be one less than the final result exponent,
+ // e.g 0.0009999 (e-4) --> 0.001 (e-3), so adjust s so the rounding digits
+ // are indexed correctly.
+ if (r.e < e) --s;
+ n = n.slice(s - 3, s + 1);
+
+ // The 4th rounding digit may be in error by -1 so if the 4 rounding digits
+ // are 9999 or 4999 (i.e. approaching a rounding boundary) continue the
+ // iteration.
+ if (n == '9999' || !rep && n == '4999') {
+
+ // On the first iteration only, check to see if rounding up gives the
+ // exact result as the nines may infinitely repeat.
+ if (!rep) {
+ round(t, t.e + DECIMAL_PLACES + 2, 0);
+
+ if (t.times(t).eq(x)) {
+ r = t;
+ break;
+ }
+ }
+
+ dp += 4;
+ s += 4;
+ rep = 1;
+ } else {
+
+ // If rounding digits are null, 0{0,4} or 50{0,3}, check for exact
+ // result. If not, then there are further digits and m will be truthy.
+ if (!+n || !+n.slice(1) && n.charAt(0) == '5') {
+
+ // Truncate to the first rounding digit.
+ round(r, r.e + DECIMAL_PLACES + 2, 1);
+ m = !r.times(r).eq(x);
+ }
+
+ break;
+ }
+ }
+ }
+ }
+
+ return round(r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m);
+ };
+
+
+ /*
+ * Return a string representing the value of this BigNumber in exponential notation and
+ * rounded using ROUNDING_MODE to dp fixed decimal places.
+ *
+ * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.
+ * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
+ *
+ * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'
+ */
+ P.toExponential = function (dp, rm) {
+ if (dp != null) {
+ intCheck(dp, 0, MAX);
+ dp++;
+ }
+ return format(this, dp, rm, 1);
+ };
+
+
+ /*
+ * Return a string representing the value of this BigNumber in fixed-point notation rounding
+ * to dp fixed decimal places using rounding mode rm, or ROUNDING_MODE if rm is omitted.
+ *
+ * Note: as with JavaScript's number type, (-0).toFixed(0) is '0',
+ * but e.g. (-0.00001).toFixed(0) is '-0'.
+ *
+ * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.
+ * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
+ *
+ * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'
+ */
+ P.toFixed = function (dp, rm) {
+ if (dp != null) {
+ intCheck(dp, 0, MAX);
+ dp = dp + this.e + 1;
+ }
+ return format(this, dp, rm);
+ };
+
+
+ /*
+ * Return a string representing the value of this BigNumber in fixed-point notation rounded
+ * using rm or ROUNDING_MODE to dp decimal places, and formatted according to the properties
+ * of the format or FORMAT object (see BigNumber.set).
+ *
+ * The formatting object may contain some or all of the properties shown below.
+ *
+ * FORMAT = {
+ * prefix: '',
+ * groupSize: 3,
+ * secondaryGroupSize: 0,
+ * groupSeparator: ',',
+ * decimalSeparator: '.',
+ * fractionGroupSize: 0,
+ * fractionGroupSeparator: '\xA0', // non-breaking space
+ * suffix: ''
+ * };
+ *
+ * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.
+ * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
+ * [format] {object} Formatting options. See FORMAT pbject above.
+ *
+ * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'
+ * '[BigNumber Error] Argument not an object: {format}'
+ */
+ P.toFormat = function (dp, rm, format) {
+ var str,
+ x = this;
+
+ if (format == null) {
+ if (dp != null && rm && typeof rm == 'object') {
+ format = rm;
+ rm = null;
+ } else if (dp && typeof dp == 'object') {
+ format = dp;
+ dp = rm = null;
+ } else {
+ format = FORMAT;
+ }
+ } else if (typeof format != 'object') {
+ throw Error
+ (bignumberError + 'Argument not an object: ' + format);
+ }
+
+ str = x.toFixed(dp, rm);
+
+ if (x.c) {
+ var i,
+ arr = str.split('.'),
+ g1 = +format.groupSize,
+ g2 = +format.secondaryGroupSize,
+ groupSeparator = format.groupSeparator || '',
+ intPart = arr[0],
+ fractionPart = arr[1],
+ isNeg = x.s < 0,
+ intDigits = isNeg ? intPart.slice(1) : intPart,
+ len = intDigits.length;
+
+ if (g2) {
+ i = g1;
+ g1 = g2;
+ g2 = i;
+ len -= i;
+ }
+
+ if (g1 > 0 && len > 0) {
+ i = len % g1 || g1;
+ intPart = intDigits.substr(0, i);
+ for (; i < len; i += g1) intPart += groupSeparator + intDigits.substr(i, g1);
+ if (g2 > 0) intPart += groupSeparator + intDigits.slice(i);
+ if (isNeg) intPart = '-' + intPart;
+ }
+
+ str = fractionPart
+ ? intPart + (format.decimalSeparator || '') + ((g2 = +format.fractionGroupSize)
+ ? fractionPart.replace(new RegExp('\\d{' + g2 + '}\\B', 'g'),
+ '$&' + (format.fractionGroupSeparator || ''))
+ : fractionPart)
+ : intPart;
+ }
+
+ return (format.prefix || '') + str + (format.suffix || '');
+ };
+
+
+ /*
+ * Return an array of two BigNumbers representing the value of this BigNumber as a simple
+ * fraction with an integer numerator and an integer denominator.
+ * The denominator will be a positive non-zero value less than or equal to the specified
+ * maximum denominator. If a maximum denominator is not specified, the denominator will be
+ * the lowest value necessary to represent the number exactly.
+ *
+ * [md] {number|string|BigNumber} Integer >= 1, or Infinity. The maximum denominator.
+ *
+ * '[BigNumber Error] Argument {not an integer|out of range} : {md}'
+ */
+ P.toFraction = function (md) {
+ var d, d0, d1, d2, e, exp, n, n0, n1, q, r, s,
+ x = this,
+ xc = x.c;
+
+ if (md != null) {
+ n = new BigNumber(md);
+
+ // Throw if md is less than one or is not an integer, unless it is Infinity.
+ if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) {
+ throw Error
+ (bignumberError + 'Argument ' +
+ (n.isInteger() ? 'out of range: ' : 'not an integer: ') + valueOf(n));
+ }
+ }
+
+ if (!xc) return new BigNumber(x);
+
+ d = new BigNumber(ONE);
+ n1 = d0 = new BigNumber(ONE);
+ d1 = n0 = new BigNumber(ONE);
+ s = coeffToString(xc);
+
+ // Determine initial denominator.
+ // d is a power of 10 and the minimum max denominator that specifies the value exactly.
+ e = d.e = s.length - x.e - 1;
+ d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp];
+ md = !md || n.comparedTo(d) > 0 ? (e > 0 ? d : n1) : n;
+
+ exp = MAX_EXP;
+ MAX_EXP = 1 / 0;
+ n = new BigNumber(s);
+
+ // n0 = d1 = 0
+ n0.c[0] = 0;
+
+ for (; ;) {
+ q = div(n, d, 0, 1);
+ d2 = d0.plus(q.times(d1));
+ if (d2.comparedTo(md) == 1) break;
+ d0 = d1;
+ d1 = d2;
+ n1 = n0.plus(q.times(d2 = n1));
+ n0 = d2;
+ d = n.minus(q.times(d2 = d));
+ n = d2;
+ }
+
+ d2 = div(md.minus(d0), d1, 0, 1);
+ n0 = n0.plus(d2.times(n1));
+ d0 = d0.plus(d2.times(d1));
+ n0.s = n1.s = x.s;
+ e = e * 2;
+
+ // Determine which fraction is closer to x, n0/d0 or n1/d1
+ r = div(n1, d1, e, ROUNDING_MODE).minus(x).abs().comparedTo(
+ div(n0, d0, e, ROUNDING_MODE).minus(x).abs()) < 1 ? [n1, d1] : [n0, d0];
+
+ MAX_EXP = exp;
+
+ return r;
+ };
+
+
+ /*
+ * Return the value of this BigNumber converted to a number primitive.
+ */
+ P.toNumber = function () {
+ return +valueOf(this);
+ };
+
+
+ /*
+ * Return a string representing the value of this BigNumber rounded to sd significant digits
+ * using rounding mode rm or ROUNDING_MODE. If sd is less than the number of digits
+ * necessary to represent the integer part of the value in fixed-point notation, then use
+ * exponential notation.
+ *
+ * [sd] {number} Significant digits. Integer, 1 to MAX inclusive.
+ * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
+ *
+ * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}'
+ */
+ P.toPrecision = function (sd, rm) {
+ if (sd != null) intCheck(sd, 1, MAX);
+ return format(this, sd, rm, 2);
+ };
+
+
+ /*
+ * Return a string representing the value of this BigNumber in base b, or base 10 if b is
+ * omitted. If a base is specified, including base 10, round according to DECIMAL_PLACES and
+ * ROUNDING_MODE. If a base is not specified, and this BigNumber has a positive exponent
+ * that is equal to or greater than TO_EXP_POS, or a negative exponent equal to or less than
+ * TO_EXP_NEG, return exponential notation.
+ *
+ * [b] {number} Integer, 2 to ALPHABET.length inclusive.
+ *
+ * '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}'
+ */
+ P.toString = function (b) {
+ var str,
+ n = this,
+ s = n.s,
+ e = n.e;
+
+ // Infinity or NaN?
+ if (e === null) {
+ if (s) {
+ str = 'Infinity';
+ if (s < 0) str = '-' + str;
+ } else {
+ str = 'NaN';
+ }
+ } else {
+ if (b == null) {
+ str = e <= TO_EXP_NEG || e >= TO_EXP_POS
+ ? toExponential(coeffToString(n.c), e)
+ : toFixedPoint(coeffToString(n.c), e, '0');
+ } else if (b === 10 && alphabetHasNormalDecimalDigits) {
+ n = round(new BigNumber(n), DECIMAL_PLACES + e + 1, ROUNDING_MODE);
+ str = toFixedPoint(coeffToString(n.c), n.e, '0');
+ } else {
+ intCheck(b, 2, ALPHABET.length, 'Base');
+ str = convertBase(toFixedPoint(coeffToString(n.c), e, '0'), 10, b, s, true);
+ }
+
+ if (s < 0 && n.c[0]) str = '-' + str;
+ }
+
+ return str;
+ };
+
+
+ /*
+ * Return as toString, but do not accept a base argument, and include the minus sign for
+ * negative zero.
+ */
+ P.valueOf = P.toJSON = function () {
+ return valueOf(this);
+ };
+
+
+ P._isBigNumber = true;
+
+ P[Symbol.toStringTag] = 'BigNumber';
+
+ // Node.js v10.12.0+
+ P[Symbol.for('nodejs.util.inspect.custom')] = P.valueOf;
+
+ if (configObject != null) BigNumber.set(configObject);
+
+ return BigNumber;
+}
+
+
+// PRIVATE HELPER FUNCTIONS
+
+// These functions don't need access to variables,
+// e.g. DECIMAL_PLACES, in the scope of the `clone` function above.
+
+
+function bitFloor(n) {
+ var i = n | 0;
+ return n > 0 || n === i ? i : i - 1;
+}
+
+
+// Return a coefficient array as a string of base 10 digits.
+function coeffToString(a) {
+ var s, z,
+ i = 1,
+ j = a.length,
+ r = a[0] + '';
+
+ for (; i < j;) {
+ s = a[i++] + '';
+ z = LOG_BASE - s.length;
+ for (; z--; s = '0' + s);
+ r += s;
+ }
+
+ // Determine trailing zeros.
+ for (j = r.length; r.charCodeAt(--j) === 48;);
+
+ return r.slice(0, j + 1 || 1);
+}
+
+
+// Compare the value of BigNumbers x and y.
+function compare(x, y) {
+ var a, b,
+ xc = x.c,
+ yc = y.c,
+ i = x.s,
+ j = y.s,
+ k = x.e,
+ l = y.e;
+
+ // Either NaN?
+ if (!i || !j) return null;
+
+ a = xc && !xc[0];
+ b = yc && !yc[0];
+
+ // Either zero?
+ if (a || b) return a ? b ? 0 : -j : i;
+
+ // Signs differ?
+ if (i != j) return i;
+
+ a = i < 0;
+ b = k == l;
+
+ // Either Infinity?
+ if (!xc || !yc) return b ? 0 : !xc ^ a ? 1 : -1;
+
+ // Compare exponents.
+ if (!b) return k > l ^ a ? 1 : -1;
+
+ j = (k = xc.length) < (l = yc.length) ? k : l;
+
+ // Compare digit by digit.
+ for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1;
+
+ // Compare lengths.
+ return k == l ? 0 : k > l ^ a ? 1 : -1;
+}
+
+
+/*
+ * Check that n is a primitive number, an integer, and in range, otherwise throw.
+ */
+function intCheck(n, min, max, name) {
+ if (n < min || n > max || n !== mathfloor(n)) {
+ throw Error
+ (bignumberError + (name || 'Argument') + (typeof n == 'number'
+ ? n < min || n > max ? ' out of range: ' : ' not an integer: '
+ : ' not a primitive number: ') + String(n));
+ }
+}
+
+
+// Assumes finite n.
+function isOdd(n) {
+ var k = n.c.length - 1;
+ return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0;
+}
+
+
+function toExponential(str, e) {
+ return (str.length > 1 ? str.charAt(0) + '.' + str.slice(1) : str) +
+ (e < 0 ? 'e' : 'e+') + e;
+}
+
+
+function toFixedPoint(str, e, z) {
+ var len, zs;
+
+ // Negative exponent?
+ if (e < 0) {
+
+ // Prepend zeros.
+ for (zs = z + '.'; ++e; zs += z);
+ str = zs + str;
+
+ // Positive exponent
+ } else {
+ len = str.length;
+
+ // Append zeros.
+ if (++e > len) {
+ for (zs = z, e -= len; --e; zs += z);
+ str += zs;
+ } else if (e < len) {
+ str = str.slice(0, e) + '.' + str.slice(e);
+ }
+ }
+
+ return str;
+}
+
+
+// EXPORT
+
+
+export var BigNumber = clone();
+
+export default BigNumber;
diff --git a/node_modules/bignumber.js/doc/API.html b/node_modules/bignumber.js/doc/API.html
new file mode 100644
index 00000000..bb2b7dd2
--- /dev/null
+++ b/node_modules/bignumber.js/doc/API.html
@@ -0,0 +1,2249 @@
+
+
+
+
+
+
+bignumber.js API
+
+
+
+
+
+
+
+
+
bignumber.js
+
+
A JavaScript library for arbitrary-precision arithmetic.
+
Hosted on GitHub .
+
+
API
+
+
+ See the README on GitHub for a
+ quick-start introduction.
+
+
+ In all examples below, var and semicolons are not shown, and if a commented-out
+ value is in quotes it means toString has been called on the preceding expression.
+
+
+
+
CONSTRUCTOR
+
+
+
+ BigNumberBigNumber(n [, base]) ⇒ BigNumber
+
+
+ n: number|string|BigNumber
+ base: number : integer, 2 to 36 inclusive. (See
+ ALPHABET to extend this range).
+
+
+ Returns a new instance of a BigNumber object with value n, where n
+ is a numeric value in the specified base, or base 10 if
+ base is omitted or is null or undefined.
+
+
+ Note that the BigNnumber constructor accepts an n of type number purely
+ as a convenience so that string quotes don't have to be typed when entering literal values,
+ and that it is the toString value of n that is used rather than its
+ underlying binary floating point value converted to decimal.
+
+
+x = new BigNumber(123.4567) // '123.4567'
+// 'new' is optional
+y = BigNumber(x) // '123.4567'
+
+ If n is a base 10 value it can be in normal or exponential notation.
+ Values in other bases must be in normal notation. Values in any base can have fraction digits,
+ i.e. digits after the decimal point.
+
+
+new BigNumber(43210) // '43210'
+new BigNumber('4.321e+4') // '43210'
+new BigNumber('-735.0918e-430') // '-7.350918e-428'
+new BigNumber('123412421.234324', 5) // '607236.557696'
+
+ Signed 0, signed Infinity and NaN are supported.
+
+
+new BigNumber('-Infinity') // '-Infinity'
+new BigNumber(NaN) // 'NaN'
+new BigNumber(-0) // '0'
+new BigNumber('.5') // '0.5'
+new BigNumber('+2') // '2'
+
+ String values in hexadecimal literal form, e.g. '0xff' or '0xFF'
+ (but not '0xfF'), are valid, as are string values with the octal and binary
+ prefixs '0o' and '0b'. String values in octal literal form without
+ the prefix will be interpreted as decimals, e.g. '011' is interpreted as 11, not 9.
+
+
+new BigNumber(-10110100.1, 2) // '-180.5'
+new BigNumber('-0b10110100.1') // '-180.5'
+new BigNumber('ff.8', 16) // '255.5'
+new BigNumber('0xff.8') // '255.5'
+
+ If a base is specified, n is rounded according to the current
+ DECIMAL_PLACES and
+ ROUNDING_MODE settings. This includes base
+ 10 so don't include a base parameter for decimal values unless
+ this behaviour is wanted.
+
+
BigNumber.config({ DECIMAL_PLACES: 5 })
+new BigNumber(1.23456789) // '1.23456789'
+new BigNumber(1.23456789, 10) // '1.23457'
+
An error is thrown if base is invalid. See Errors .
+
+ There is no limit to the number of digits of a value of type string (other than
+ that of JavaScript's maximum array size). See RANGE to set
+ the maximum and minimum possible exponent value of a BigNumber.
+
+
+new BigNumber('5032485723458348569331745.33434346346912144534543')
+new BigNumber('4.321e10000000')
+
BigNumber NaN is returned if n is invalid
+ (unless BigNumber.DEBUG is true, see below).
+
+new BigNumber('.1*') // 'NaN'
+new BigNumber('blurgh') // 'NaN'
+new BigNumber(9, 2) // 'NaN'
+
+ To aid in debugging, if BigNumber.DEBUG is true then an error will
+ be thrown on an invalid n. An error will also be thrown if n is of
+ type number and has more than 15 significant digits, as calling
+ toString or valueOf on
+ these numbers may not result in the intended value.
+
+
+console.log(823456789123456.3) // 823456789123456.2
+new BigNumber(823456789123456.3) // '823456789123456.2'
+BigNumber.DEBUG = true
+// '[BigNumber Error] Number primitive has more than 15 significant digits'
+new BigNumber(823456789123456.3)
+// '[BigNumber Error] Not a base 2 number'
+new BigNumber(9, 2)
+
+ A BigNumber can also be created from an object literal.
+ Use isBigNumber to check that it is well-formed.
+
+
new BigNumber({ s: 1, e: 2, c: [ 777, 12300000000000 ], _isBigNumber: true }) // '777.123'
+
+
+
+
+
Methods
+
The static methods of a BigNumber constructor.
+
+
+
+
+
clone
+ .clone([object]) ⇒ BigNumber constructor
+
+
object: object
+
+ Returns a new independent BigNumber constructor with configuration as described by
+ object (see config ), or with the default
+ configuration if object is null or undefined.
+
+
+ Throws if object is not an object. See Errors .
+
+
BigNumber.config({ DECIMAL_PLACES: 5 })
+BN = BigNumber.clone({ DECIMAL_PLACES: 9 })
+
+x = new BigNumber(1)
+y = new BN(1)
+
+x.div(3) // 0.33333
+y.div(3) // 0.333333333
+
+// BN = BigNumber.clone({ DECIMAL_PLACES: 9 }) is equivalent to:
+BN = BigNumber.clone()
+BN.config({ DECIMAL_PLACES: 9 })
+
+
+
+
configset([object]) ⇒ object
+
+ object: object : an object that contains some or all of the following
+ properties.
+
+
Configures the settings for this particular BigNumber constructor.
+
+
+ DECIMAL_PLACES
+
+ number : integer, 0 to 1e+9 inclusive
+ Default value: 20
+
+
+ The maximum number of decimal places of the results of operations involving
+ division, i.e. division, square root and base conversion operations, and power operations
+ with negative exponents.
+
+
+ BigNumber.config({ DECIMAL_PLACES: 5 })
+BigNumber.set({ DECIMAL_PLACES: 5 }) // equivalent
+
+
+
+
+ ROUNDING_MODE
+
+ number : integer, 0 to 8 inclusive
+ Default value: 4 (ROUND_HALF_UP)
+
+
+ The rounding mode used in the above operations and the default rounding mode of
+ decimalPlaces ,
+ precision ,
+ toExponential ,
+ toFixed ,
+ toFormat and
+ toPrecision .
+
+ The modes are available as enumerated properties of the BigNumber constructor.
+
+ BigNumber.config({ ROUNDING_MODE: 0 })
+BigNumber.set({ ROUNDING_MODE: BigNumber.ROUND_UP }) // equivalent
+
+
+
+
+ EXPONENTIAL_AT
+
+ number : integer, magnitude 0 to 1e+9 inclusive, or
+
+ number []: [ integer -1e+9 to 0 inclusive, integer
+ 0 to 1e+9 inclusive ]
+ Default value: [-7, 20]
+
+
+ The exponent value(s) at which toString returns exponential notation.
+
+
+ If a single number is assigned, the value is the exponent magnitude.
+ If an array of two numbers is assigned then the first number is the negative exponent
+ value at and beneath which exponential notation is used, and the second number is the
+ positive exponent value at and above which the same.
+
+
+ For example, to emulate JavaScript numbers in terms of the exponent values at which they
+ begin to use exponential notation, use [-7, 20].
+
+
+ BigNumber.config({ EXPONENTIAL_AT: 2 })
+new BigNumber(12.3) // '12.3' e is only 1
+new BigNumber(123) // '1.23e+2'
+new BigNumber(0.123) // '0.123' e is only -1
+new BigNumber(0.0123) // '1.23e-2'
+
+BigNumber.config({ EXPONENTIAL_AT: [-7, 20] })
+new BigNumber(123456789) // '123456789' e is only 8
+new BigNumber(0.000000123) // '1.23e-7'
+
+// Almost never return exponential notation:
+BigNumber.config({ EXPONENTIAL_AT: 1e+9 })
+
+// Always return exponential notation:
+BigNumber.config({ EXPONENTIAL_AT: 0 })
+
+
+ Regardless of the value of EXPONENTIAL_AT, the toFixed method
+ will always return a value in normal notation and the toExponential method
+ will always return a value in exponential form.
+
+
+ Calling toString with a base argument, e.g. toString(10), will
+ also always return normal notation.
+
+
+
+
+ RANGE
+
+ number : integer, magnitude 1 to 1e+9 inclusive, or
+
+ number []: [ integer -1e+9 to -1 inclusive, integer
+ 1 to 1e+9 inclusive ]
+ Default value: [-1e+9, 1e+9]
+
+
+ The exponent value(s) beyond which overflow to Infinity and underflow to
+ zero occurs.
+
+
+ If a single number is assigned, it is the maximum exponent magnitude: values wth a
+ positive exponent of greater magnitude become Infinity and those with a
+ negative exponent of greater magnitude become zero.
+
+ If an array of two numbers is assigned then the first number is the negative exponent
+ limit and the second number is the positive exponent limit.
+
+
+ For example, to emulate JavaScript numbers in terms of the exponent values at which they
+ become zero and Infinity, use [-324, 308].
+
+
+ BigNumber.config({ RANGE: 500 })
+BigNumber.config().RANGE // [ -500, 500 ]
+new BigNumber('9.999e499') // '9.999e+499'
+new BigNumber('1e500') // 'Infinity'
+new BigNumber('1e-499') // '1e-499'
+new BigNumber('1e-500') // '0'
+
+BigNumber.config({ RANGE: [-3, 4] })
+new BigNumber(99999) // '99999' e is only 4
+new BigNumber(100000) // 'Infinity' e is 5
+new BigNumber(0.001) // '0.01' e is only -3
+new BigNumber(0.0001) // '0' e is -4
+
+
+ The largest possible magnitude of a finite BigNumber is
+ 9.999...e+1000000000.
+ The smallest possible magnitude of a non-zero BigNumber is 1e-1000000000.
+
+
+
+
+ CRYPTO
+
+ boolean : true or false.
+ Default value: false
+
+
+ The value that determines whether cryptographically-secure pseudo-random number
+ generation is used.
+
+
+ If CRYPTO is set to true then the
+ random method will generate random digits using
+ crypto.getRandomValues in browsers that support it, or
+ crypto.randomBytes if using Node.js.
+
+
+ If neither function is supported by the host environment then attempting to set
+ CRYPTO to true will fail and an exception will be thrown.
+
+
+ If CRYPTO is false then the source of randomness used will be
+ Math.random (which is assumed to generate at least 30 bits of
+ randomness).
+
+ See random .
+
+
+// Node.js
+const crypto = require('crypto'); // CommonJS
+import * as crypto from 'crypto'; // ES module
+
+global.crypto = crypto;
+
+BigNumber.config({ CRYPTO: true })
+BigNumber.config().CRYPTO // true
+BigNumber.random() // 0.54340758610486147524
+
+
+
+
+ MODULO_MODE
+
+ number : integer, 0 to 9 inclusive
+ Default value: 1 (ROUND_DOWN )
+
+ The modulo mode used when calculating the modulus: a mod n.
+
+ The quotient, q = a / n, is calculated according to the
+ ROUNDING_MODE that corresponds to the chosen
+ MODULO_MODE.
+
+ The remainder, r, is calculated as: r = a - n * q.
+
+ The modes that are most commonly used for the modulus/remainder operation are shown in
+ the following table. Although the other rounding modes can be used, they may not give
+ useful results.
+
+
+
+ Property Value Description
+
+ ROUND_UP 0
+
+ The remainder is positive if the dividend is negative, otherwise it is negative.
+
+
+
+ ROUND_DOWN 1
+
+ The remainder has the same sign as the dividend.
+ This uses 'truncating division' and matches the behaviour of JavaScript's
+ remainder operator %.
+
+
+
+ ROUND_FLOOR 3
+
+ The remainder has the same sign as the divisor.
+ This matches Python's % operator.
+
+
+
+ ROUND_HALF_EVEN 6
+ The IEEE 754 remainder function.
+
+
+ EUCLID 9
+
+ The remainder is always positive. Euclidian division:
+ q = sign(n) * floor(a / abs(n))
+
+
+
+
+
+ The rounding/modulo modes are available as enumerated properties of the BigNumber
+ constructor.
+
+ See modulo .
+
+ BigNumber.config({ MODULO_MODE: BigNumber.EUCLID })
+BigNumber.config({ MODULO_MODE: 9 }) // equivalent
+
+
+
+
+ POW_PRECISION
+
+ number : integer, 0 to 1e+9 inclusive.
+ Default value: 0
+
+
+ The maximum precision, i.e. number of significant digits, of the result of the power
+ operation (unless a modulus is specified).
+
+ If set to 0, the number of significant digits will not be limited.
+ See exponentiatedBy .
+ BigNumber.config({ POW_PRECISION: 100 })
+
+
+
+ FORMAT
+ object
+
+ The FORMAT object configures the format of the string returned by the
+ toFormat method.
+
+
+ The example below shows the properties of the FORMAT object that are
+ recognised, and their default values.
+
+
+ Unlike the other configuration properties, the values of the properties of the
+ FORMAT object will not be checked for validity. The existing
+ FORMAT object will simply be replaced by the object that is passed in.
+ The object can include any number of the properties shown below.
+
+ See toFormat for examples of usage.
+
+
+BigNumber.config({
+ FORMAT: {
+ // string to prepend
+ prefix: '',
+ // decimal separator
+ decimalSeparator: '.',
+ // grouping separator of the integer part
+ groupSeparator: ',',
+ // primary grouping size of the integer part
+ groupSize: 3,
+ // secondary grouping size of the integer part
+ secondaryGroupSize: 0,
+ // grouping separator of the fraction part
+ fractionGroupSeparator: ' ',
+ // grouping size of the fraction part
+ fractionGroupSize: 0,
+ // string to append
+ suffix: ''
+ }
+});
+
+
+
+
+ ALPHABET
+
+ string
+ Default value: '0123456789abcdefghijklmnopqrstuvwxyz'
+
+
+ The alphabet used for base conversion. The length of the alphabet corresponds to the
+ maximum value of the base argument that can be passed to the
+ BigNumber constructor or
+ toString .
+
+
+ There is no maximum length for the alphabet, but it must be at least 2 characters long, and
+ it must not contain whitespace or a repeated character, or the sign indicators
+ '+' and '-', or the decimal separator '.'.
+
+
+ // duodecimal (base 12)
+BigNumber.config({ ALPHABET: '0123456789TE' })
+x = new BigNumber('T', 12)
+x.toString() // '10'
+x.toString(12) // 'T'
+
+
+
+
+
+
+
Returns an object with the above properties and their current values.
+
+ Throws if object is not an object, or if an invalid value is assigned to
+ one or more of the above properties. See Errors .
+
+
+BigNumber.config({
+ DECIMAL_PLACES: 40,
+ ROUNDING_MODE: BigNumber.ROUND_HALF_CEIL,
+ EXPONENTIAL_AT: [-10, 20],
+ RANGE: [-500, 500],
+ CRYPTO: true,
+ MODULO_MODE: BigNumber.ROUND_FLOOR,
+ POW_PRECISION: 80,
+ FORMAT: {
+ groupSize: 3,
+ groupSeparator: ' ',
+ decimalSeparator: ','
+ },
+ ALPHABET: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_'
+});
+
+obj = BigNumber.config();
+obj.DECIMAL_PLACES // 40
+obj.RANGE // [-500, 500]
+
+
+
+
+ isBigNumber.isBigNumber(value) ⇒ boolean
+
+
value: any
+
+ Returns true if value is a BigNumber instance, otherwise returns
+ false.
+
+
x = 42
+y = new BigNumber(x)
+
+BigNumber.isBigNumber(x) // false
+y instanceof BigNumber // true
+BigNumber.isBigNumber(y) // true
+
+BN = BigNumber.clone();
+z = new BN(x)
+z instanceof BigNumber // false
+BigNumber.isBigNumber(z) // true
+
+ If value is a BigNumber instance and BigNumber.DEBUG is true,
+ then this method will also check if value is well-formed, and throw if it is not.
+ See Errors .
+
+
+ The check can be useful if creating a BigNumber from an object literal.
+ See BigNumber .
+
+
+x = new BigNumber(10)
+
+// Change x.c to an illegitimate value.
+x.c = NaN
+
+BigNumber.DEBUG = false
+
+// No error.
+BigNumber.isBigNumber(x) // true
+
+BigNumber.DEBUG = true
+
+// Error.
+BigNumber.isBigNumber(x) // '[BigNumber Error] Invalid BigNumber'
+
+
+
+
maximum.max(n...) ⇒ BigNumber
+
+ n: number|string|BigNumber
+ See BigNumber for further parameter details.
+
+
+ Returns a BigNumber whose value is the maximum of the arguments.
+
+
The return value is always exact and unrounded.
+
x = new BigNumber('3257869345.0378653')
+BigNumber.maximum(4e9, x, '123456789.9') // '4000000000'
+
+arr = [12, '13', new BigNumber(14)]
+BigNumber.max.apply(null, arr) // '14'
+
+
+
+
minimum.min(n...) ⇒ BigNumber
+
+ n: number|string|BigNumber
+ See BigNumber for further parameter details.
+
+
+ Returns a BigNumber whose value is the minimum of the arguments.
+
+
The return value is always exact and unrounded.
+
x = new BigNumber('3257869345.0378653')
+BigNumber.minimum(4e9, x, '123456789.9') // '123456789.9'
+
+arr = [2, new BigNumber(-14), '-15.9999', -12]
+BigNumber.min.apply(null, arr) // '-15.9999'
+
+
+
+
+ random.random([dp]) ⇒ BigNumber
+
+
dp: number : integer, 0 to 1e+9 inclusive
+
+ Returns a new BigNumber with a pseudo-random value equal to or greater than 0 and
+ less than 1.
+
+
+ The return value will have dp decimal places (or less if trailing zeros are
+ produced).
+ If dp is omitted then the number of decimal places will default to the current
+ DECIMAL_PLACES setting.
+
+
+ Depending on the value of this BigNumber constructor's
+ CRYPTO setting and the support for the
+ crypto object in the host environment, the random digits of the return value are
+ generated by either Math.random (fastest), crypto.getRandomValues
+ (Web Cryptography API in recent browsers) or crypto.randomBytes (Node.js).
+
+
+ To be able to set CRYPTO to true when using
+ Node.js, the crypto object must be available globally:
+
+
// Node.js
+const crypto = require('crypto'); // CommonJS
+import * as crypto from 'crypto'; // ES module
+global.crypto = crypto;
+
+ If CRYPTO is true, i.e. one of the
+ crypto methods is to be used, the value of a returned BigNumber should be
+ cryptographically-secure and statistically indistinguishable from a random value.
+
+
+ Throws if dp is invalid. See Errors .
+
+
BigNumber.config({ DECIMAL_PLACES: 10 })
+BigNumber.random() // '0.4117936847'
+BigNumber.random(20) // '0.78193327636914089009'
+
+
+
+
sum.sum(n...) ⇒ BigNumber
+
+ n: number|string|BigNumber
+ See BigNumber for further parameter details.
+
+
Returns a BigNumber whose value is the sum of the arguments.
+
The return value is always exact and unrounded.
+
x = new BigNumber('3257869345.0378653')
+BigNumber.sum(4e9, x, '123456789.9') // '7381326134.9378653'
+
+arr = [2, new BigNumber(14), '15.9999', 12]
+BigNumber.sum.apply(null, arr) // '43.9999'
+
+
+
+
Properties
+
+ The library's enumerated rounding modes are stored as properties of the constructor.
+ (They are not referenced internally by the library itself.)
+
+
+ Rounding modes 0 to 6 (inclusive) are the same as those of Java's
+ BigDecimal class.
+
+
+
+ Property
+ Value
+ Description
+
+
+ ROUND_UP
+ 0
+ Rounds away from zero
+
+
+ ROUND_DOWN
+ 1
+ Rounds towards zero
+
+
+ ROUND_CEIL
+ 2
+ Rounds towards Infinity
+
+
+ ROUND_FLOOR
+ 3
+ Rounds towards -Infinity
+
+
+ ROUND_HALF_UP
+ 4
+
+ Rounds towards nearest neighbour.
+ If equidistant, rounds away from zero
+
+
+
+ ROUND_HALF_DOWN
+ 5
+
+ Rounds towards nearest neighbour.
+ If equidistant, rounds towards zero
+
+
+
+ ROUND_HALF_EVEN
+ 6
+
+ Rounds towards nearest neighbour.
+ If equidistant, rounds towards even neighbour
+
+
+
+ ROUND_HALF_CEIL
+ 7
+
+ Rounds towards nearest neighbour.
+ If equidistant, rounds towards Infinity
+
+
+
+ ROUND_HALF_FLOOR
+ 8
+
+ Rounds towards nearest neighbour.
+ If equidistant, rounds towards -Infinity
+
+
+
+
+BigNumber.config({ ROUNDING_MODE: BigNumber.ROUND_CEIL })
+BigNumber.config({ ROUNDING_MODE: 2 }) // equivalent
+
+
DEBUG
+
undefined|false|true
+
+ If BigNumber.DEBUG is set true then an error will be thrown
+ if this BigNumber constructor receives an invalid value, such as
+ a value of type number with more than 15 significant digits.
+ See BigNumber .
+
+
+ An error will also be thrown if the isBigNumber
+ method receives a BigNumber that is not well-formed.
+ See isBigNumber .
+
+
BigNumber.DEBUG = true
+
+
+
INSTANCE
+
+
+
Methods
+
The methods inherited by a BigNumber instance from its constructor's prototype object.
+
A BigNumber is immutable in the sense that it is not changed by its methods.
+
+ The treatment of ±0, ±Infinity and NaN is
+ consistent with how JavaScript treats these values.
+
+
Many method names have a shorter alias.
+
+
+
+
absoluteValue.abs() ⇒ BigNumber
+
+ Returns a BigNumber whose value is the absolute value, i.e. the magnitude, of the value of
+ this BigNumber.
+
+
The return value is always exact and unrounded.
+
+x = new BigNumber(-0.8)
+y = x.absoluteValue() // '0.8'
+z = y.abs() // '0.8'
+
+
+
+
+ comparedTo.comparedTo(n [, base]) ⇒ number
+
+
+ n: number|string|BigNumber
+ base: number
+ See BigNumber for further parameter details.
+
+
+ Returns
+
+ 1
+ If the value of this BigNumber is greater than the value of n
+
+
+ -1
+ If the value of this BigNumber is less than the value of n
+
+
+ 0
+ If this BigNumber and n have the same value
+
+
+ null
+ If the value of either this BigNumber or n is NaN
+
+
+
+x = new BigNumber(Infinity)
+y = new BigNumber(5)
+x.comparedTo(y) // 1
+x.comparedTo(x.minus(1)) // 0
+y.comparedTo(NaN) // null
+y.comparedTo('110', 2) // -1
+
+
+
+
+ decimalPlaces.dp([dp [, rm]]) ⇒ BigNumber|number
+
+
+ dp: number : integer, 0 to 1e+9 inclusive
+ rm: number : integer, 0 to 8 inclusive
+
+
+ If dp is a number, returns a BigNumber whose value is the value of this BigNumber
+ rounded by rounding mode rm to a maximum of dp decimal places.
+
+
+ If dp is omitted, or is null or undefined, the return
+ value is the number of decimal places of the value of this BigNumber, or null if
+ the value of this BigNumber is ±Infinity or NaN.
+
+
+ If rm is omitted, or is null or undefined,
+ ROUNDING_MODE is used.
+
+
+ Throws if dp or rm is invalid. See Errors .
+
+
+x = new BigNumber(1234.56)
+x.decimalPlaces(1) // '1234.6'
+x.dp() // 2
+x.decimalPlaces(2) // '1234.56'
+x.dp(10) // '1234.56'
+x.decimalPlaces(0, 1) // '1234'
+x.dp(0, 6) // '1235'
+x.decimalPlaces(1, 1) // '1234.5'
+x.dp(1, BigNumber.ROUND_HALF_EVEN) // '1234.6'
+x // '1234.56'
+y = new BigNumber('9.9e-101')
+y.dp() // 102
+
+
+
+
dividedBy.div(n [, base]) ⇒ BigNumber
+
+
+ n: number|string|BigNumber
+ base: number
+ See BigNumber for further parameter details.
+
+
+ Returns a BigNumber whose value is the value of this BigNumber divided by
+ n, rounded according to the current
+ DECIMAL_PLACES and
+ ROUNDING_MODE settings.
+
+
+x = new BigNumber(355)
+y = new BigNumber(113)
+x.dividedBy(y) // '3.14159292035398230088'
+x.div(5) // '71'
+x.div(47, 16) // '5'
+
+
+
+
+ dividedToIntegerBy.idiv(n [, base]) ⇒
+ BigNumber
+
+
+ n: number|string|BigNumber
+ base: number
+ See BigNumber for further parameter details.
+
+
+ Returns a BigNumber whose value is the integer part of dividing the value of this BigNumber by
+ n.
+
+
+x = new BigNumber(5)
+y = new BigNumber(3)
+x.dividedToIntegerBy(y) // '1'
+x.idiv(0.7) // '7'
+x.idiv('0.f', 16) // '5'
+
+
+
+
+ exponentiatedBy.pow(n [, m]) ⇒ BigNumber
+
+
+ n: number|string|BigNumber : integer
+ m: number|string|BigNumber
+
+
+ Returns a BigNumber whose value is the value of this BigNumber exponentiated by
+ n, i.e. raised to the power n, and optionally modulo a modulus
+ m.
+
+
+ Throws if n is not an integer. See Errors .
+
+
+ If n is negative the result is rounded according to the current
+ DECIMAL_PLACES and
+ ROUNDING_MODE settings.
+
+
+ As the number of digits of the result of the power operation can grow so large so quickly,
+ e.g. 123.45610000 has over 50000 digits, the number of significant
+ digits calculated is limited to the value of the
+ POW_PRECISION setting (unless a modulus
+ m is specified).
+
+
+ By default POW_PRECISION is set to 0.
+ This means that an unlimited number of significant digits will be calculated, and that the
+ method's performance will decrease dramatically for larger exponents.
+
+
+ If m is specified and the value of m, n and this
+ BigNumber are integers, and n is positive, then a fast modular exponentiation
+ algorithm is used, otherwise the operation will be performed as
+ x.exponentiatedBy(n).modulo(m) with a
+ POW_PRECISION of 0.
+
+
+Math.pow(0.7, 2) // 0.48999999999999994
+x = new BigNumber(0.7)
+x.exponentiatedBy(2) // '0.49'
+BigNumber(3).pow(-2) // '0.11111111111111111111'
+
+
+
+
+ integerValue.integerValue([rm]) ⇒ BigNumber
+
+
+ rm: number : integer, 0 to 8 inclusive
+
+
+ Returns a BigNumber whose value is the value of this BigNumber rounded to an integer using
+ rounding mode rm.
+
+
+ If rm is omitted, or is null or undefined,
+ ROUNDING_MODE is used.
+
+
+ Throws if rm is invalid. See Errors .
+
+
+x = new BigNumber(123.456)
+x.integerValue() // '123'
+x.integerValue(BigNumber.ROUND_CEIL) // '124'
+y = new BigNumber(-12.7)
+y.integerValue() // '-13'
+y.integerValue(BigNumber.ROUND_DOWN) // '-12'
+
+ The following is an example of how to add a prototype method that emulates JavaScript's
+ Math.round function. Math.ceil, Math.floor and
+ Math.trunc can be emulated in the same way with
+ BigNumber.ROUND_CEIL, BigNumber.ROUND_FLOOR and
+ BigNumber.ROUND_DOWN respectively.
+
+
+BigNumber.prototype.round = function () {
+ return this.integerValue(BigNumber.ROUND_HALF_CEIL);
+};
+x.round() // '123'
+
+
+
+
isEqualTo.eq(n [, base]) ⇒ boolean
+
+ n: number|string|BigNumber
+ base: number
+ See BigNumber for further parameter details.
+
+
+ Returns true if the value of this BigNumber is equal to the value of
+ n, otherwise returns false.
+ As with JavaScript, NaN does not equal NaN.
+
+
Note: This method uses the comparedTo method internally.
+
+0 === 1e-324 // true
+x = new BigNumber(0)
+x.isEqualTo('1e-324') // false
+BigNumber(-0).eq(x) // true ( -0 === 0 )
+BigNumber(255).eq('ff', 16) // true
+
+y = new BigNumber(NaN)
+y.isEqualTo(NaN) // false
+
+
+
+
isFinite.isFinite() ⇒ boolean
+
+ Returns true if the value of this BigNumber is a finite number, otherwise
+ returns false.
+
+
+ The only possible non-finite values of a BigNumber are NaN, Infinity
+ and -Infinity.
+
+
+x = new BigNumber(1)
+x.isFinite() // true
+y = new BigNumber(Infinity)
+y.isFinite() // false
+
+ Note: The native method isFinite() can be used if
+ n <= Number.MAX_VALUE.
+
+
+
+
+
isGreaterThan.gt(n [, base]) ⇒ boolean
+
+ n: number|string|BigNumber
+ base: number
+ See BigNumber for further parameter details.
+
+
+ Returns true if the value of this BigNumber is greater than the value of
+ n, otherwise returns false.
+
+
Note: This method uses the comparedTo method internally.
+
+0.1 > (0.3 - 0.2) // true
+x = new BigNumber(0.1)
+x.isGreaterThan(BigNumber(0.3).minus(0.2)) // false
+BigNumber(0).gt(x) // false
+BigNumber(11, 3).gt(11.1, 2) // true
+
+
+
+
+ isGreaterThanOrEqualTo.gte(n [, base]) ⇒ boolean
+
+
+ n: number|string|BigNumber
+ base: number
+ See BigNumber for further parameter details.
+
+
+ Returns true if the value of this BigNumber is greater than or equal to the value
+ of n, otherwise returns false.
+
+
Note: This method uses the comparedTo method internally.
+
+(0.3 - 0.2) >= 0.1 // false
+x = new BigNumber(0.3).minus(0.2)
+x.isGreaterThanOrEqualTo(0.1) // true
+BigNumber(1).gte(x) // true
+BigNumber(10, 18).gte('i', 36) // true
+
+
+
+
isInteger.isInteger() ⇒ boolean
+
+ Returns true if the value of this BigNumber is an integer, otherwise returns
+ false.
+
+
+x = new BigNumber(1)
+x.isInteger() // true
+y = new BigNumber(123.456)
+y.isInteger() // false
+
+
+
+
isLessThan.lt(n [, base]) ⇒ boolean
+
+ n: number|string|BigNumber
+ base: number
+ See BigNumber for further parameter details.
+
+
+ Returns true if the value of this BigNumber is less than the value of
+ n, otherwise returns false.
+
+
Note: This method uses the comparedTo method internally.
+
+(0.3 - 0.2) < 0.1 // true
+x = new BigNumber(0.3).minus(0.2)
+x.isLessThan(0.1) // false
+BigNumber(0).lt(x) // true
+BigNumber(11.1, 2).lt(11, 3) // true
+
+
+
+
+ isLessThanOrEqualTo.lte(n [, base]) ⇒ boolean
+
+
+ n: number|string|BigNumber
+ base: number
+ See BigNumber for further parameter details.
+
+
+ Returns true if the value of this BigNumber is less than or equal to the value of
+ n, otherwise returns false.
+
+
Note: This method uses the comparedTo method internally.
+
+0.1 <= (0.3 - 0.2) // false
+x = new BigNumber(0.1)
+x.isLessThanOrEqualTo(BigNumber(0.3).minus(0.2)) // true
+BigNumber(-1).lte(x) // true
+BigNumber(10, 18).lte('i', 36) // true
+
+
+
+
isNaN.isNaN() ⇒ boolean
+
+ Returns true if the value of this BigNumber is NaN, otherwise
+ returns false.
+
+
+x = new BigNumber(NaN)
+x.isNaN() // true
+y = new BigNumber('Infinity')
+y.isNaN() // false
+
Note: The native method isNaN() can also be used.
+
+
+
+
isNegative.isNegative() ⇒ boolean
+
+ Returns true if the sign of this BigNumber is negative, otherwise returns
+ false.
+
+
+x = new BigNumber(-0)
+x.isNegative() // true
+y = new BigNumber(2)
+y.isNegative() // false
+
Note: n < 0 can be used if n <= -Number.MIN_VALUE.
+
+
+
+
isPositive.isPositive() ⇒ boolean
+
+ Returns true if the sign of this BigNumber is positive, otherwise returns
+ false.
+
+
+x = new BigNumber(-0)
+x.isPositive() // false
+y = new BigNumber(2)
+y.isPositive() // true
+
+
+
+
isZero.isZero() ⇒ boolean
+
+ Returns true if the value of this BigNumber is zero or minus zero, otherwise
+ returns false.
+
+
+x = new BigNumber(-0)
+x.isZero() && x.isNegative() // true
+y = new BigNumber(Infinity)
+y.isZero() // false
+
Note: n == 0 can be used if n >= Number.MIN_VALUE.
+
+
+
+
+ minus.minus(n [, base]) ⇒ BigNumber
+
+
+ n: number|string|BigNumber
+ base: number
+ See BigNumber for further parameter details.
+
+
Returns a BigNumber whose value is the value of this BigNumber minus n.
+
The return value is always exact and unrounded.
+
+0.3 - 0.1 // 0.19999999999999998
+x = new BigNumber(0.3)
+x.minus(0.1) // '0.2'
+x.minus(0.6, 20) // '0'
+
+
+
+
modulo.mod(n [, base]) ⇒ BigNumber
+
+ n: number|string|BigNumber
+ base: number
+ See BigNumber for further parameter details.
+
+
+ Returns a BigNumber whose value is the value of this BigNumber modulo n, i.e.
+ the integer remainder of dividing this BigNumber by n.
+
+
+ The value returned, and in particular its sign, is dependent on the value of the
+ MODULO_MODE setting of this BigNumber constructor.
+ If it is 1 (default value), the result will have the same sign as this BigNumber,
+ and it will match that of Javascript's % operator (within the limits of double
+ precision) and BigDecimal's remainder method.
+
+
The return value is always exact and unrounded.
+
+ See MODULO_MODE for a description of the other
+ modulo modes.
+
+
+1 % 0.9 // 0.09999999999999998
+x = new BigNumber(1)
+x.modulo(0.9) // '0.1'
+y = new BigNumber(33)
+y.mod('a', 33) // '3'
+
+
+
+
+ multipliedBy.times(n [, base]) ⇒ BigNumber
+
+
+ n: number|string|BigNumber
+ base: number
+ See BigNumber for further parameter details.
+
+
+ Returns a BigNumber whose value is the value of this BigNumber multiplied by n.
+
+
The return value is always exact and unrounded.
+
+0.6 * 3 // 1.7999999999999998
+x = new BigNumber(0.6)
+y = x.multipliedBy(3) // '1.8'
+BigNumber('7e+500').times(y) // '1.26e+501'
+x.multipliedBy('-a', 16) // '-6'
+
+
+
+
negated.negated() ⇒ BigNumber
+
+ Returns a BigNumber whose value is the value of this BigNumber negated, i.e. multiplied by
+ -1.
+
+
+x = new BigNumber(1.8)
+x.negated() // '-1.8'
+y = new BigNumber(-1.3)
+y.negated() // '1.3'
+
+
+
+
plus.plus(n [, base]) ⇒ BigNumber
+
+ n: number|string|BigNumber
+ base: number
+ See BigNumber for further parameter details.
+
+
Returns a BigNumber whose value is the value of this BigNumber plus n.
+
The return value is always exact and unrounded.
+
+0.1 + 0.2 // 0.30000000000000004
+x = new BigNumber(0.1)
+y = x.plus(0.2) // '0.3'
+BigNumber(0.7).plus(x).plus(y) // '1.1'
+x.plus('0.1', 8) // '0.225'
+
+
+
+
+ precision.sd([d [, rm]]) ⇒ BigNumber|number
+
+
+ d: number|boolean : integer, 1 to 1e+9
+ inclusive, or true or false
+ rm: number : integer, 0 to 8 inclusive.
+
+
+ If d is a number, returns a BigNumber whose value is the value of this BigNumber
+ rounded to a precision of d significant digits using rounding mode
+ rm.
+
+
+ If d is omitted or is null or undefined, the return
+ value is the number of significant digits of the value of this BigNumber, or null
+ if the value of this BigNumber is ±Infinity or NaN.
+
+
+ If d is true then any trailing zeros of the integer
+ part of a number are counted as significant digits, otherwise they are not.
+
+
+ If rm is omitted or is null or undefined,
+ ROUNDING_MODE will be used.
+
+
+ Throws if d or rm is invalid. See Errors .
+
+
+x = new BigNumber(9876.54321)
+x.precision(6) // '9876.54'
+x.sd() // 9
+x.precision(6, BigNumber.ROUND_UP) // '9876.55'
+x.sd(2) // '9900'
+x.precision(2, 1) // '9800'
+x // '9876.54321'
+y = new BigNumber(987000)
+y.precision() // 3
+y.sd(true) // 6
+
+
+
+
shiftedBy.shiftedBy(n) ⇒ BigNumber
+
+ n: number : integer,
+ -9007199254740991 to 9007199254740991 inclusive
+
+
+ Returns a BigNumber whose value is the value of this BigNumber shifted by n
+ places.
+
+ The shift is of the decimal point, i.e. of powers of ten, and is to the left if n
+ is negative or to the right if n is positive.
+
+
The return value is always exact and unrounded.
+
+ Throws if n is invalid. See Errors .
+
+
+x = new BigNumber(1.23)
+x.shiftedBy(3) // '1230'
+x.shiftedBy(-3) // '0.00123'
+
+
+
+
squareRoot.sqrt() ⇒ BigNumber
+
+ Returns a BigNumber whose value is the square root of the value of this BigNumber,
+ rounded according to the current
+ DECIMAL_PLACES and
+ ROUNDING_MODE settings.
+
+
+ The return value will be correctly rounded, i.e. rounded as if the result was first calculated
+ to an infinite number of correct digits before rounding.
+
+
+x = new BigNumber(16)
+x.squareRoot() // '4'
+y = new BigNumber(3)
+y.sqrt() // '1.73205080756887729353'
+
+
+
+
+ toExponential.toExponential([dp [, rm]]) ⇒ string
+
+
+ dp: number : integer, 0 to 1e+9 inclusive
+ rm: number : integer, 0 to 8 inclusive
+
+
+ Returns a string representing the value of this BigNumber in exponential notation rounded
+ using rounding mode rm to dp decimal places, i.e with one digit
+ before the decimal point and dp digits after it.
+
+
+ If the value of this BigNumber in exponential notation has fewer than dp fraction
+ digits, the return value will be appended with zeros accordingly.
+
+
+ If dp is omitted, or is null or undefined, the number
+ of digits after the decimal point defaults to the minimum number of digits necessary to
+ represent the value exactly.
+ If rm is omitted or is null or undefined,
+ ROUNDING_MODE is used.
+
+
+ Throws if dp or rm is invalid. See Errors .
+
+
+x = 45.6
+y = new BigNumber(x)
+x.toExponential() // '4.56e+1'
+y.toExponential() // '4.56e+1'
+x.toExponential(0) // '5e+1'
+y.toExponential(0) // '5e+1'
+x.toExponential(1) // '4.6e+1'
+y.toExponential(1) // '4.6e+1'
+y.toExponential(1, 1) // '4.5e+1' (ROUND_DOWN)
+x.toExponential(3) // '4.560e+1'
+y.toExponential(3) // '4.560e+1'
+
+
+
+
+ toFixed.toFixed([dp [, rm]]) ⇒ string
+
+
+ dp: number : integer, 0 to 1e+9 inclusive
+ rm: number : integer, 0 to 8 inclusive
+
+
+ Returns a string representing the value of this BigNumber in normal (fixed-point) notation
+ rounded to dp decimal places using rounding mode rm.
+
+
+ If the value of this BigNumber in normal notation has fewer than dp fraction
+ digits, the return value will be appended with zeros accordingly.
+
+
+ Unlike Number.prototype.toFixed, which returns exponential notation if a number
+ is greater or equal to 1021 , this method will always return normal
+ notation.
+
+
+ If dp is omitted or is null or undefined, the return
+ value will be unrounded and in normal notation. This is also unlike
+ Number.prototype.toFixed, which returns the value to zero decimal places.
+ It is useful when fixed-point notation is required and the current
+ EXPONENTIAL_AT setting causes
+ toString to return exponential notation.
+ If rm is omitted or is null or undefined,
+ ROUNDING_MODE is used.
+
+
+ Throws if dp or rm is invalid. See Errors .
+
+
+x = 3.456
+y = new BigNumber(x)
+x.toFixed() // '3'
+y.toFixed() // '3.456'
+y.toFixed(0) // '3'
+x.toFixed(2) // '3.46'
+y.toFixed(2) // '3.46'
+y.toFixed(2, 1) // '3.45' (ROUND_DOWN)
+x.toFixed(5) // '3.45600'
+y.toFixed(5) // '3.45600'
+
+
+
+
+ toFormat.toFormat([dp [, rm[, format]]]) ⇒ string
+
+
+ dp: number : integer, 0 to 1e+9 inclusive
+ rm: number : integer, 0 to 8 inclusive
+ format: object : see FORMAT
+
+
+
+ Returns a string representing the value of this BigNumber in normal (fixed-point) notation
+ rounded to dp decimal places using rounding mode rm, and formatted
+ according to the properties of the format object.
+
+
+ See FORMAT and the examples below for the properties of the
+ format object, their types, and their usage. A formatting object may contain
+ some or all of the recognised properties.
+
+
+ If dp is omitted or is null or undefined, then the
+ return value is not rounded to a fixed number of decimal places.
+ If rm is omitted or is null or undefined,
+ ROUNDING_MODE is used.
+ If format is omitted or is null or undefined, the
+ FORMAT object is used.
+
+
+ Throws if dp, rm or format is invalid. See
+ Errors .
+
+
+fmt = {
+ prefix: '',
+ decimalSeparator: '.',
+ groupSeparator: ',',
+ groupSize: 3,
+ secondaryGroupSize: 0,
+ fractionGroupSeparator: ' ',
+ fractionGroupSize: 0,
+ suffix: ''
+}
+
+x = new BigNumber('123456789.123456789')
+
+// Set the global formatting options
+BigNumber.config({ FORMAT: fmt })
+
+x.toFormat() // '123,456,789.123456789'
+x.toFormat(3) // '123,456,789.123'
+
+// If a reference to the object assigned to FORMAT has been retained,
+// the format properties can be changed directly
+fmt.groupSeparator = ' '
+fmt.fractionGroupSize = 5
+x.toFormat() // '123 456 789.12345 6789'
+
+// Alternatively, pass the formatting options as an argument
+fmt = {
+ prefix: '=> ',
+ decimalSeparator: ',',
+ groupSeparator: '.',
+ groupSize: 3,
+ secondaryGroupSize: 2
+}
+
+x.toFormat() // '123 456 789.12345 6789'
+x.toFormat(fmt) // '=> 12.34.56.789,123456789'
+x.toFormat(2, fmt) // '=> 12.34.56.789,12'
+x.toFormat(3, BigNumber.ROUND_UP, fmt) // '=> 12.34.56.789,124'
+
+
+
+
+ toFraction.toFraction([maximum_denominator])
+ ⇒ [BigNumber, BigNumber]
+
+
+ maximum_denominator:
+ number|string|BigNumber : integer >= 1 and <=
+ Infinity
+
+
+ Returns an array of two BigNumbers representing the value of this BigNumber as a simple
+ fraction with an integer numerator and an integer denominator. The denominator will be a
+ positive non-zero value less than or equal to maximum_denominator.
+
+
+ If a maximum_denominator is not specified, or is null or
+ undefined, the denominator will be the lowest value necessary to represent the
+ number exactly.
+
+
+ Throws if maximum_denominator is invalid. See Errors .
+
+
+x = new BigNumber(1.75)
+x.toFraction() // '7, 4'
+
+pi = new BigNumber('3.14159265358')
+pi.toFraction() // '157079632679,50000000000'
+pi.toFraction(100000) // '312689, 99532'
+pi.toFraction(10000) // '355, 113'
+pi.toFraction(100) // '311, 99'
+pi.toFraction(10) // '22, 7'
+pi.toFraction(1) // '3, 1'
+
+
+
+
toJSON.toJSON() ⇒ string
+
As valueOf .
+
+x = new BigNumber('177.7e+457')
+y = new BigNumber(235.4325)
+z = new BigNumber('0.0098074')
+
+// Serialize an array of three BigNumbers
+str = JSON.stringify( [x, y, z] )
+// "["1.777e+459","235.4325","0.0098074"]"
+
+// Return an array of three BigNumbers
+JSON.parse(str, function (key, val) {
+ return key === '' ? val : new BigNumber(val)
+})
+
+
+
+
toNumber.toNumber() ⇒ number
+
Returns the value of this BigNumber as a JavaScript number primitive.
+
+ This method is identical to using type coercion with the unary plus operator.
+
+
+x = new BigNumber(456.789)
+x.toNumber() // 456.789
++x // 456.789
+
+y = new BigNumber('45987349857634085409857349856430985')
+y.toNumber() // 4.598734985763409e+34
+
+z = new BigNumber(-0)
+1 / z.toNumber() // -Infinity
+1 / +z // -Infinity
+
+
+
+
+ toPrecision.toPrecision([sd [, rm]]) ⇒ string
+
+
+ sd: number : integer, 1 to 1e+9 inclusive
+ rm: number : integer, 0 to 8 inclusive
+
+
+ Returns a string representing the value of this BigNumber rounded to sd
+ significant digits using rounding mode rm.
+
+
+ If sd is less than the number of digits necessary to represent the integer part
+ of the value in normal (fixed-point) notation, then exponential notation is used.
+
+
+ If sd is omitted, or is null or undefined, then the
+ return value is the same as n.toString().
+ If rm is omitted or is null or undefined,
+ ROUNDING_MODE is used.
+
+
+ Throws if sd or rm is invalid. See Errors .
+
+
+x = 45.6
+y = new BigNumber(x)
+x.toPrecision() // '45.6'
+y.toPrecision() // '45.6'
+x.toPrecision(1) // '5e+1'
+y.toPrecision(1) // '5e+1'
+y.toPrecision(2, 0) // '4.6e+1' (ROUND_UP)
+y.toPrecision(2, 1) // '4.5e+1' (ROUND_DOWN)
+x.toPrecision(5) // '45.600'
+y.toPrecision(5) // '45.600'
+
+
+
+
toString.toString([base]) ⇒ string
+
+ base: number : integer, 2 to ALPHABET.length
+ inclusive (see ALPHABET ).
+
+
+ Returns a string representing the value of this BigNumber in the specified base, or base
+ 10 if base is omitted or is null or
+ undefined.
+
+
+ For bases above 10, and using the default base conversion alphabet
+ (see ALPHABET ), values from 10 to
+ 35 are represented by a-z
+ (as with Number.prototype.toString).
+
+
+ If a base is specified the value is rounded according to the current
+ DECIMAL_PLACES
+ and ROUNDING_MODE settings.
+
+
+ If a base is not specified, and this BigNumber has a positive
+ exponent that is equal to or greater than the positive component of the
+ current EXPONENTIAL_AT setting,
+ or a negative exponent equal to or less than the negative component of the
+ setting, then exponential notation is returned.
+
+
If base is null or undefined it is ignored.
+
+ Throws if base is invalid. See Errors .
+
+
+x = new BigNumber(750000)
+x.toString() // '750000'
+BigNumber.config({ EXPONENTIAL_AT: 5 })
+x.toString() // '7.5e+5'
+
+y = new BigNumber(362.875)
+y.toString(2) // '101101010.111'
+y.toString(9) // '442.77777777777777777778'
+y.toString(32) // 'ba.s'
+
+BigNumber.config({ DECIMAL_PLACES: 4 });
+z = new BigNumber('1.23456789')
+z.toString() // '1.23456789'
+z.toString(10) // '1.2346'
+
+
+
+
valueOf.valueOf() ⇒ string
+
+ As toString , but does not accept a base argument and includes
+ the minus sign for negative zero.
+
+
+x = new BigNumber('-0')
+x.toString() // '0'
+x.valueOf() // '-0'
+y = new BigNumber('1.777e+457')
+y.valueOf() // '1.777e+457'
+
+
+
+
Properties
+
The properties of a BigNumber instance:
+
+
+ Property
+ Description
+ Type
+ Value
+
+
+ c
+ coefficient*
+ number []
+ Array of base 1e14 numbers
+
+
+ e
+ exponent
+ number
+ Integer, -1000000000 to 1000000000 inclusive
+
+
+ s
+ sign
+ number
+ -1 or 1
+
+
+
* significand
+
+ The value of any of the c, e and s properties may also
+ be null.
+
+
+ The above properties are best considered to be read-only. In early versions of this library it
+ was okay to change the exponent of a BigNumber by writing to its exponent property directly,
+ but this is no longer reliable as the value of the first element of the coefficient array is
+ now dependent on the exponent.
+
+
+ Note that, as with JavaScript numbers, the original exponent and fractional trailing zeros are
+ not necessarily preserved.
+
+
x = new BigNumber(0.123) // '0.123'
+x.toExponential() // '1.23e-1'
+x.c // '1,2,3'
+x.e // -1
+x.s // 1
+
+y = new Number(-123.4567000e+2) // '-12345.67'
+y.toExponential() // '-1.234567e+4'
+z = new BigNumber('-123.4567000e+2') // '-12345.67'
+z.toExponential() // '-1.234567e+4'
+z.c // '1,2,3,4,5,6,7'
+z.e // 4
+z.s // -1
+
+
+
+
Zero, NaN and Infinity
+
+ The table below shows how ±0, NaN and
+ ±Infinity are stored.
+
+
+
+
+ c
+ e
+ s
+
+
+ ±0
+ [0]
+ 0
+ ±1
+
+
+ NaN
+ null
+ null
+ null
+
+
+ ±Infinity
+ null
+ null
+ ±1
+
+
+
+x = new Number(-0) // 0
+1 / x == -Infinity // true
+
+y = new BigNumber(-0) // '0'
+y.c // '0' ( [0].toString() )
+y.e // 0
+y.s // -1
+
+
+
+
Errors
+
The table below shows the errors that are thrown.
+
+ The errors are generic Error objects whose message begins
+ '[BigNumber Error]'.
+
+
+
+ Method
+ Throws
+
+
+
+ BigNumber
+ comparedTo
+ dividedBy
+ dividedToIntegerBy
+ isEqualTo
+ isGreaterThan
+ isGreaterThanOrEqualTo
+ isLessThan
+ isLessThanOrEqualTo
+ minus
+ modulo
+ plus
+ multipliedBy
+
+ Base not a primitive number
+
+
+ Base not an integer
+
+
+ Base out of range
+
+
+ Number primitive has more than 15 significant digits*
+
+
+ Not a base... number*
+
+
+ Not a number*
+
+
+ clone
+ Object expected
+
+
+ config
+ Object expected
+
+
+ DECIMAL_PLACES not a primitive number
+
+
+ DECIMAL_PLACES not an integer
+
+
+ DECIMAL_PLACES out of range
+
+
+ ROUNDING_MODE not a primitive number
+
+
+ ROUNDING_MODE not an integer
+
+
+ ROUNDING_MODE out of range
+
+
+ EXPONENTIAL_AT not a primitive number
+
+
+ EXPONENTIAL_AT not an integer
+
+
+ EXPONENTIAL_AT out of range
+
+
+ RANGE not a primitive number
+
+
+ RANGE not an integer
+
+
+ RANGE cannot be zero
+
+
+ RANGE cannot be zero
+
+
+ CRYPTO not true or false
+
+
+ crypto unavailable
+
+
+ MODULO_MODE not a primitive number
+
+
+ MODULO_MODE not an integer
+
+
+ MODULO_MODE out of range
+
+
+ POW_PRECISION not a primitive number
+
+
+ POW_PRECISION not an integer
+
+
+ POW_PRECISION out of range
+
+
+ FORMAT not an object
+
+
+ ALPHABET invalid
+
+
+
+ decimalPlaces
+ precision
+ random
+ shiftedBy
+ toExponential
+ toFixed
+ toFormat
+ toPrecision
+
+ Argument not a primitive number
+
+
+ Argument not an integer
+
+
+ Argument out of range
+
+
+
+ decimalPlaces
+ precision
+
+ Argument not true or false
+
+
+ exponentiatedBy
+ Argument not an integer
+
+
+ isBigNumber
+ Invalid BigNumber*
+
+
+
+ minimum
+ maximum
+
+ Not a number*
+
+
+
+ random
+
+ crypto unavailable
+
+
+
+ toFormat
+
+ Argument not an object
+
+
+ toFraction
+ Argument not an integer
+
+
+ Argument out of range
+
+
+ toString
+ Base not a primitive number
+
+
+ Base not an integer
+
+
+ Base out of range
+
+
+
* Only thrown if BigNumber.DEBUG is true.
+
To determine if an exception is a BigNumber Error:
+
+try {
+ // ...
+} catch (e) {
+ if (e instanceof Error && e.message.indexOf('[BigNumber Error]') === 0) {
+ // ...
+ }
+}
+
+
+
+
Type coercion
+
+ To prevent the accidental use of a BigNumber in primitive number operations, or the
+ accidental addition of a BigNumber to a string, the valueOf method can be safely
+ overwritten as shown below.
+
+
+ The valueOf method is the same as the
+ toJSON method, and both are the same as the
+ toString method except they do not take a base
+ argument and they include the minus sign for negative zero.
+
+
+BigNumber.prototype.valueOf = function () {
+ throw Error('valueOf called!')
+}
+
+x = new BigNumber(1)
+x / 2 // '[BigNumber Error] valueOf called!'
+x + 'abc' // '[BigNumber Error] valueOf called!'
+
+
+
+
+
FAQ
+
+
Why are trailing fractional zeros removed from BigNumbers?
+
+ Some arbitrary-precision libraries retain trailing fractional zeros as they can indicate the
+ precision of a value. This can be useful but the results of arithmetic operations can be
+ misleading.
+
+
+x = new BigDecimal("1.0")
+y = new BigDecimal("1.1000")
+z = x.add(y) // 2.1000
+
+x = new BigDecimal("1.20")
+y = new BigDecimal("3.45000")
+z = x.multiply(y) // 4.1400000
+
+ To specify the precision of a value is to specify that the value lies
+ within a certain range.
+
+
+ In the first example, x has a value of 1.0. The trailing zero shows
+ the precision of the value, implying that it is in the range 0.95 to
+ 1.05. Similarly, the precision indicated by the trailing zeros of y
+ indicates that the value is in the range 1.09995 to 1.10005.
+
+
+ If we add the two lowest values in the ranges we have, 0.95 + 1.09995 = 2.04995,
+ and if we add the two highest values we have, 1.05 + 1.10005 = 2.15005, so the
+ range of the result of the addition implied by the precision of its operands is
+ 2.04995 to 2.15005.
+
+
+ The result given by BigDecimal of 2.1000 however, indicates that the value is in
+ the range 2.09995 to 2.10005 and therefore the precision implied by
+ its trailing zeros may be misleading.
+
+
+ In the second example, the true range is 4.122744 to 4.157256 yet
+ the BigDecimal answer of 4.1400000 indicates a range of 4.13999995
+ to 4.14000005. Again, the precision implied by the trailing zeros may be
+ misleading.
+
+
+ This library, like binary floating point and most calculators, does not retain trailing
+ fractional zeros. Instead, the toExponential, toFixed and
+ toPrecision methods enable trailing zeros to be added if and when required.
+
+
+
+
+
diff --git a/node_modules/bignumber.js/package.json b/node_modules/bignumber.js/package.json
new file mode 100644
index 00000000..6b1d95b9
--- /dev/null
+++ b/node_modules/bignumber.js/package.json
@@ -0,0 +1,60 @@
+{
+ "name": "bignumber.js",
+ "description": "A library for arbitrary-precision decimal and non-decimal arithmetic",
+ "version": "9.3.1",
+ "keywords": [
+ "arbitrary",
+ "precision",
+ "arithmetic",
+ "big",
+ "number",
+ "decimal",
+ "float",
+ "biginteger",
+ "bigdecimal",
+ "bignumber",
+ "bigint",
+ "bignum"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/MikeMcl/bignumber.js.git"
+ },
+ "main": "bignumber",
+ "module": "bignumber.mjs",
+ "browser": "bignumber.js",
+ "types": "bignumber.d.ts",
+ "exports": {
+ ".": {
+ "import": {
+ "types": "./bignumber.d.mts",
+ "default": "./bignumber.mjs"
+ },
+ "require": {
+ "types": "./bignumber.d.ts",
+ "default": "./bignumber.js"
+ },
+ "browser": {
+ "types": "./bignumber.d.ts",
+ "default": "./bignumber.js"
+ },
+ "default": {
+ "types": "./bignumber.d.ts",
+ "default": "./bignumber.js"
+ }
+ },
+ "./package.json": "./package.json"
+ },
+ "author": {
+ "name": "Michael Mclaughlin",
+ "email": "M8ch88l@gmail.com"
+ },
+ "engines": {
+ "node": "*"
+ },
+ "license": "MIT",
+ "scripts": {
+ "test": "node test/test"
+ },
+ "dependencies": {}
+}
diff --git a/node_modules/bignumber.js/types.d.ts b/node_modules/bignumber.js/types.d.ts
new file mode 100644
index 00000000..8145edd6
--- /dev/null
+++ b/node_modules/bignumber.js/types.d.ts
@@ -0,0 +1,1821 @@
+// Type definitions for bignumber.js >=8.1.0
+// Project: https://github.com/MikeMcl/bignumber.js
+// Definitions by: Michael Mclaughlin
+// Definitions: https://github.com/MikeMcl/bignumber.js
+
+// Documentation: http://mikemcl.github.io/bignumber.js/
+//
+// class BigNumber
+// type BigNumber.Constructor
+// type BigNumber.ModuloMode
+// type BigNumber.RoundingMode
+// type BigNumber.Value
+// interface BigNumber.Config
+// interface BigNumber.Format
+// interface BigNumber.Instance
+//
+// Example:
+//
+// import {BigNumber} from "bignumber.js"
+// //import BigNumber from "bignumber.js"
+//
+// let rm: BigNumber.RoundingMode = BigNumber.ROUND_UP;
+// let f: BigNumber.Format = { decimalSeparator: ',' };
+// let c: BigNumber.Config = { DECIMAL_PLACES: 4, ROUNDING_MODE: rm, FORMAT: f };
+// BigNumber.config(c);
+//
+// let v: BigNumber.Value = '12345.6789';
+// let b: BigNumber = new BigNumber(v);
+//
+// The use of compiler option `--strictNullChecks` is recommended.
+
+declare namespace BigNumber {
+
+ /** See `BigNumber.config` (alias `BigNumber.set`) and `BigNumber.clone`. */
+ interface Config {
+
+ /**
+ * An integer, 0 to 1e+9. Default value: 20.
+ *
+ * The maximum number of decimal places of the result of operations involving division, i.e.
+ * division, square root and base conversion operations, and exponentiation when the exponent is
+ * negative.
+ *
+ * ```ts
+ * BigNumber.config({ DECIMAL_PLACES: 5 })
+ * BigNumber.set({ DECIMAL_PLACES: 5 })
+ * ```
+ */
+ DECIMAL_PLACES?: number;
+
+ /**
+ * An integer, 0 to 8. Default value: `BigNumber.ROUND_HALF_UP` (4).
+ *
+ * The rounding mode used in operations that involve division (see `DECIMAL_PLACES`) and the
+ * default rounding mode of the `decimalPlaces`, `precision`, `toExponential`, `toFixed`,
+ * `toFormat` and `toPrecision` methods.
+ *
+ * The modes are available as enumerated properties of the BigNumber constructor.
+ *
+ * ```ts
+ * BigNumber.config({ ROUNDING_MODE: 0 })
+ * BigNumber.set({ ROUNDING_MODE: BigNumber.ROUND_UP })
+ * ```
+ */
+ ROUNDING_MODE?: BigNumber.RoundingMode;
+
+ /**
+ * An integer, 0 to 1e+9, or an array, [-1e+9 to 0, 0 to 1e+9].
+ * Default value: `[-7, 20]`.
+ *
+ * The exponent value(s) at which `toString` returns exponential notation.
+ *
+ * If a single number is assigned, the value is the exponent magnitude.
+ *
+ * If an array of two numbers is assigned then the first number is the negative exponent value at
+ * and beneath which exponential notation is used, and the second number is the positive exponent
+ * value at and above which exponential notation is used.
+ *
+ * For example, to emulate JavaScript numbers in terms of the exponent values at which they begin
+ * to use exponential notation, use `[-7, 20]`.
+ *
+ * ```ts
+ * BigNumber.config({ EXPONENTIAL_AT: 2 })
+ * new BigNumber(12.3) // '12.3' e is only 1
+ * new BigNumber(123) // '1.23e+2'
+ * new BigNumber(0.123) // '0.123' e is only -1
+ * new BigNumber(0.0123) // '1.23e-2'
+ *
+ * BigNumber.config({ EXPONENTIAL_AT: [-7, 20] })
+ * new BigNumber(123456789) // '123456789' e is only 8
+ * new BigNumber(0.000000123) // '1.23e-7'
+ *
+ * // Almost never return exponential notation:
+ * BigNumber.config({ EXPONENTIAL_AT: 1e+9 })
+ *
+ * // Always return exponential notation:
+ * BigNumber.config({ EXPONENTIAL_AT: 0 })
+ * ```
+ *
+ * Regardless of the value of `EXPONENTIAL_AT`, the `toFixed` method will always return a value in
+ * normal notation and the `toExponential` method will always return a value in exponential form.
+ * Calling `toString` with a base argument, e.g. `toString(10)`, will also always return normal
+ * notation.
+ */
+ EXPONENTIAL_AT?: number | [number, number];
+
+ /**
+ * An integer, magnitude 1 to 1e+9, or an array, [-1e+9 to -1, 1 to 1e+9].
+ * Default value: `[-1e+9, 1e+9]`.
+ *
+ * The exponent value(s) beyond which overflow to Infinity and underflow to zero occurs.
+ *
+ * If a single number is assigned, it is the maximum exponent magnitude: values wth a positive
+ * exponent of greater magnitude become Infinity and those with a negative exponent of greater
+ * magnitude become zero.
+ *
+ * If an array of two numbers is assigned then the first number is the negative exponent limit and
+ * the second number is the positive exponent limit.
+ *
+ * For example, to emulate JavaScript numbers in terms of the exponent values at which they
+ * become zero and Infinity, use [-324, 308].
+ *
+ * ```ts
+ * BigNumber.config({ RANGE: 500 })
+ * BigNumber.config().RANGE // [ -500, 500 ]
+ * new BigNumber('9.999e499') // '9.999e+499'
+ * new BigNumber('1e500') // 'Infinity'
+ * new BigNumber('1e-499') // '1e-499'
+ * new BigNumber('1e-500') // '0'
+ *
+ * BigNumber.config({ RANGE: [-3, 4] })
+ * new BigNumber(99999) // '99999' e is only 4
+ * new BigNumber(100000) // 'Infinity' e is 5
+ * new BigNumber(0.001) // '0.01' e is only -3
+ * new BigNumber(0.0001) // '0' e is -4
+ * ```
+ * The largest possible magnitude of a finite BigNumber is 9.999...e+1000000000.
+ * The smallest possible magnitude of a non-zero BigNumber is 1e-1000000000.
+ */
+ RANGE?: number | [number, number];
+
+ /**
+ * A boolean: `true` or `false`. Default value: `false`.
+ *
+ * The value that determines whether cryptographically-secure pseudo-random number generation is
+ * used. If `CRYPTO` is set to true then the random method will generate random digits using
+ * `crypto.getRandomValues` in browsers that support it, or `crypto.randomBytes` if using a
+ * version of Node.js that supports it.
+ *
+ * If neither function is supported by the host environment then attempting to set `CRYPTO` to
+ * `true` will fail and an exception will be thrown.
+ *
+ * If `CRYPTO` is `false` then the source of randomness used will be `Math.random` (which is
+ * assumed to generate at least 30 bits of randomness).
+ *
+ * See `BigNumber.random`.
+ *
+ * ```ts
+ * // Node.js
+ * global.crypto = require('crypto')
+ *
+ * BigNumber.config({ CRYPTO: true })
+ * BigNumber.config().CRYPTO // true
+ * BigNumber.random() // 0.54340758610486147524
+ * ```
+ */
+ CRYPTO?: boolean;
+
+ /**
+ * An integer, 0, 1, 3, 6 or 9. Default value: `BigNumber.ROUND_DOWN` (1).
+ *
+ * The modulo mode used when calculating the modulus: `a mod n`.
+ * The quotient, `q = a / n`, is calculated according to the `ROUNDING_MODE` that corresponds to
+ * the chosen `MODULO_MODE`.
+ * The remainder, `r`, is calculated as: `r = a - n * q`.
+ *
+ * The modes that are most commonly used for the modulus/remainder operation are shown in the
+ * following table. Although the other rounding modes can be used, they may not give useful
+ * results.
+ *
+ * Property | Value | Description
+ * :------------------|:------|:------------------------------------------------------------------
+ * `ROUND_UP` | 0 | The remainder is positive if the dividend is negative.
+ * `ROUND_DOWN` | 1 | The remainder has the same sign as the dividend.
+ * | | Uses 'truncating division' and matches JavaScript's `%` operator .
+ * `ROUND_FLOOR` | 3 | The remainder has the same sign as the divisor.
+ * | | This matches Python's `%` operator.
+ * `ROUND_HALF_EVEN` | 6 | The IEEE 754 remainder function.
+ * `EUCLID` | 9 | The remainder is always positive.
+ * | | Euclidian division: `q = sign(n) * floor(a / abs(n))`
+ *
+ * The rounding/modulo modes are available as enumerated properties of the BigNumber constructor.
+ *
+ * See `modulo`.
+ *
+ * ```ts
+ * BigNumber.config({ MODULO_MODE: BigNumber.EUCLID })
+ * BigNumber.set({ MODULO_MODE: 9 }) // equivalent
+ * ```
+ */
+ MODULO_MODE?: BigNumber.ModuloMode;
+
+ /**
+ * An integer, 0 to 1e+9. Default value: 0.
+ *
+ * The maximum precision, i.e. number of significant digits, of the result of the power operation
+ * - unless a modulus is specified.
+ *
+ * If set to 0, the number of significant digits will not be limited.
+ *
+ * See `exponentiatedBy`.
+ *
+ * ```ts
+ * BigNumber.config({ POW_PRECISION: 100 })
+ * ```
+ */
+ POW_PRECISION?: number;
+
+ /**
+ * An object including any number of the properties shown below.
+ *
+ * The object configures the format of the string returned by the `toFormat` method.
+ * The example below shows the properties of the object that are recognised, and
+ * their default values.
+ *
+ * Unlike the other configuration properties, the values of the properties of the `FORMAT` object
+ * will not be checked for validity - the existing object will simply be replaced by the object
+ * that is passed in.
+ *
+ * See `toFormat`.
+ *
+ * ```ts
+ * BigNumber.config({
+ * FORMAT: {
+ * // string to prepend
+ * prefix: '',
+ * // the decimal separator
+ * decimalSeparator: '.',
+ * // the grouping separator of the integer part
+ * groupSeparator: ',',
+ * // the primary grouping size of the integer part
+ * groupSize: 3,
+ * // the secondary grouping size of the integer part
+ * secondaryGroupSize: 0,
+ * // the grouping separator of the fraction part
+ * fractionGroupSeparator: ' ',
+ * // the grouping size of the fraction part
+ * fractionGroupSize: 0,
+ * // string to append
+ * suffix: ''
+ * }
+ * })
+ * ```
+ */
+ FORMAT?: BigNumber.Format;
+
+ /**
+ * The alphabet used for base conversion. The length of the alphabet corresponds to the maximum
+ * value of the base argument that can be passed to the BigNumber constructor or `toString`.
+ *
+ * Default value: `'0123456789abcdefghijklmnopqrstuvwxyz'`.
+ *
+ * There is no maximum length for the alphabet, but it must be at least 2 characters long,
+ * and it must not contain whitespace or a repeated character, or the sign indicators '+' and
+ * '-', or the decimal separator '.'.
+ *
+ * ```ts
+ * // duodecimal (base 12)
+ * BigNumber.config({ ALPHABET: '0123456789TE' })
+ * x = new BigNumber('T', 12)
+ * x.toString() // '10'
+ * x.toString(12) // 'T'
+ * ```
+ */
+ ALPHABET?: string;
+ }
+
+ /** See `FORMAT` and `toFormat`. */
+ interface Format {
+
+ /** The string to prepend. */
+ prefix?: string;
+
+ /** The decimal separator. */
+ decimalSeparator?: string;
+
+ /** The grouping separator of the integer part. */
+ groupSeparator?: string;
+
+ /** The primary grouping size of the integer part. */
+ groupSize?: number;
+
+ /** The secondary grouping size of the integer part. */
+ secondaryGroupSize?: number;
+
+ /** The grouping separator of the fraction part. */
+ fractionGroupSeparator?: string;
+
+ /** The grouping size of the fraction part. */
+ fractionGroupSize?: number;
+
+ /** The string to append. */
+ suffix?: string;
+ }
+
+ interface Instance {
+
+ /** The coefficient of the value of this BigNumber, an array of base 1e14 integer numbers, or null. */
+ readonly c: number[] | null;
+
+ /** The exponent of the value of this BigNumber, an integer number, -1000000000 to 1000000000, or null. */
+ readonly e: number | null;
+
+ /** The sign of the value of this BigNumber, -1, 1, or null. */
+ readonly s: number | null;
+
+ [key: string]: any;
+ }
+
+ type Constructor = typeof BigNumber;
+ type ModuloMode = 0 | 1 | 3 | 6 | 9;
+ type RoundingMode = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
+ type Value = string | number | bigint | Instance;
+}
+
+declare class BigNumber implements BigNumber.Instance {
+
+ /** Used internally to identify a BigNumber instance. */
+ private readonly _isBigNumber: true;
+
+ /** The coefficient of the value of this BigNumber, an array of base 1e14 integer numbers, or null. */
+ readonly c: number[] | null;
+
+ /** The exponent of the value of this BigNumber, an integer number, -1000000000 to 1000000000, or null. */
+ readonly e: number | null;
+
+ /** The sign of the value of this BigNumber, -1, 1, or null. */
+ readonly s: number | null;
+
+ /**
+ * Returns a new instance of a BigNumber object with value `n`, where `n` is a numeric value in
+ * the specified `base`, or base 10 if `base` is omitted.
+ *
+ * ```ts
+ * x = new BigNumber(123.4567) // '123.4567'
+ * // 'new' is optional
+ * y = BigNumber(x) // '123.4567'
+ * ```
+ *
+ * If `n` is a base 10 value it can be in normal (fixed-point) or exponential notation.
+ * Values in other bases must be in normal notation. Values in any base can have fraction digits,
+ * i.e. digits after the decimal point.
+ *
+ * ```ts
+ * new BigNumber(43210) // '43210'
+ * new BigNumber('4.321e+4') // '43210'
+ * new BigNumber('-735.0918e-430') // '-7.350918e-428'
+ * new BigNumber('123412421.234324', 5) // '607236.557696'
+ * ```
+ *
+ * Signed `0`, signed `Infinity` and `NaN` are supported.
+ *
+ * ```ts
+ * new BigNumber('-Infinity') // '-Infinity'
+ * new BigNumber(NaN) // 'NaN'
+ * new BigNumber(-0) // '0'
+ * new BigNumber('.5') // '0.5'
+ * new BigNumber('+2') // '2'
+ * ```
+ *
+ * String values in hexadecimal literal form, e.g. `'0xff'`, are valid, as are string values with
+ * the octal and binary prefixs `'0o'` and `'0b'`. String values in octal literal form without the
+ * prefix will be interpreted as decimals, e.g. `'011'` is interpreted as 11, not 9.
+ *
+ * ```ts
+ * new BigNumber(-10110100.1, 2) // '-180.5'
+ * new BigNumber('-0b10110100.1') // '-180.5'
+ * new BigNumber('ff.8', 16) // '255.5'
+ * new BigNumber('0xff.8') // '255.5'
+ * ```
+ *
+ * If a base is specified, `n` is rounded according to the current `DECIMAL_PLACES` and
+ * `ROUNDING_MODE` settings. This includes base 10, so don't include a `base` parameter for decimal
+ * values unless this behaviour is desired.
+ *
+ * ```ts
+ * BigNumber.config({ DECIMAL_PLACES: 5 })
+ * new BigNumber(1.23456789) // '1.23456789'
+ * new BigNumber(1.23456789, 10) // '1.23457'
+ * ```
+ *
+ * An error is thrown if `base` is invalid.
+ *
+ * There is no limit to the number of digits of a value of type string (other than that of
+ * JavaScript's maximum array size). See `RANGE` to set the maximum and minimum possible exponent
+ * value of a BigNumber.
+ *
+ * ```ts
+ * new BigNumber('5032485723458348569331745.33434346346912144534543')
+ * new BigNumber('4.321e10000000')
+ * ```
+ *
+ * BigNumber `NaN` is returned if `n` is invalid (unless `BigNumber.DEBUG` is `true`, see below).
+ *
+ * ```ts
+ * new BigNumber('.1*') // 'NaN'
+ * new BigNumber('blurgh') // 'NaN'
+ * new BigNumber(9, 2) // 'NaN'
+ * ```
+ *
+ * To aid in debugging, if `BigNumber.DEBUG` is `true` then an error will be thrown on an
+ * invalid `n`. An error will also be thrown if `n` is of type number with more than 15
+ * significant digits, as calling `toString` or `valueOf` on these numbers may not result in the
+ * intended value.
+ *
+ * ```ts
+ * console.log(823456789123456.3) // 823456789123456.2
+ * new BigNumber(823456789123456.3) // '823456789123456.2'
+ * BigNumber.DEBUG = true
+ * // 'Error: Number has more than 15 significant digits'
+ * new BigNumber(823456789123456.3)
+ * // 'Error: Not a base 2 number'
+ * new BigNumber(9, 2)
+ * ```
+ *
+ * A BigNumber can also be created from an object literal.
+ * Use `isBigNumber` to check that it is well-formed.
+ *
+ * ```ts
+ * new BigNumber({ s: 1, e: 2, c: [ 777, 12300000000000 ], _isBigNumber: true }) // '777.123'
+ * ```
+ *
+ * @param n A numeric value.
+ * @param base The base of `n`, integer, 2 to 36 (or `ALPHABET.length`, see `ALPHABET`).
+ */
+ constructor(n: BigNumber.Value, base?: number);
+
+ /**
+ * Returns a BigNumber whose value is the absolute value, i.e. the magnitude, of the value of this
+ * BigNumber.
+ *
+ * The return value is always exact and unrounded.
+ *
+ * ```ts
+ * x = new BigNumber(-0.8)
+ * x.absoluteValue() // '0.8'
+ * ```
+ */
+ absoluteValue(): BigNumber;
+
+ /**
+ * Returns a BigNumber whose value is the absolute value, i.e. the magnitude, of the value of this
+ * BigNumber.
+ *
+ * The return value is always exact and unrounded.
+ *
+ * ```ts
+ * x = new BigNumber(-0.8)
+ * x.abs() // '0.8'
+ * ```
+ */
+ abs(): BigNumber;
+
+ /**
+ * Returns | |
+ * :-------:|:--------------------------------------------------------------|
+ * 1 | If the value of this BigNumber is greater than the value of `n`
+ * -1 | If the value of this BigNumber is less than the value of `n`
+ * 0 | If this BigNumber and `n` have the same value
+ * `null` | If the value of either this BigNumber or `n` is `NaN`
+ *
+ * ```ts
+ *
+ * x = new BigNumber(Infinity)
+ * y = new BigNumber(5)
+ * x.comparedTo(y) // 1
+ * x.comparedTo(x.minus(1)) // 0
+ * y.comparedTo(NaN) // null
+ * y.comparedTo('110', 2) // -1
+ * ```
+ * @param n A numeric value.
+ * @param [base] The base of n.
+ */
+ comparedTo(n: BigNumber.Value, base?: number): 1 | -1 | 0 | null;
+
+ /**
+ * Returns a BigNumber whose value is the value of this BigNumber rounded by rounding mode
+ * `roundingMode` to a maximum of `decimalPlaces` decimal places.
+ *
+ * If `decimalPlaces` is omitted, the return value is the number of decimal places of the value of
+ * this BigNumber, or `null` if the value of this BigNumber is ±`Infinity` or `NaN`.
+ *
+ * If `roundingMode` is omitted, `ROUNDING_MODE` is used.
+ *
+ * Throws if `decimalPlaces` or `roundingMode` is invalid.
+ *
+ * ```ts
+ * x = new BigNumber(1234.56)
+ * x.decimalPlaces() // 2
+ * x.decimalPlaces(1) // '1234.6'
+ * x.decimalPlaces(2) // '1234.56'
+ * x.decimalPlaces(10) // '1234.56'
+ * x.decimalPlaces(0, 1) // '1234'
+ * x.decimalPlaces(0, 6) // '1235'
+ * x.decimalPlaces(1, 1) // '1234.5'
+ * x.decimalPlaces(1, BigNumber.ROUND_HALF_EVEN) // '1234.6'
+ * x // '1234.56'
+ * y = new BigNumber('9.9e-101')
+ * y.decimalPlaces() // 102
+ * ```
+ *
+ * @param [decimalPlaces] Decimal places, integer, 0 to 1e+9.
+ * @param [roundingMode] Rounding mode, integer, 0 to 8.
+ */
+ decimalPlaces(): number | null;
+ decimalPlaces(decimalPlaces: number, roundingMode?: BigNumber.RoundingMode): BigNumber;
+
+ /**
+ * Returns a BigNumber whose value is the value of this BigNumber rounded by rounding mode
+ * `roundingMode` to a maximum of `decimalPlaces` decimal places.
+ *
+ * If `decimalPlaces` is omitted, the return value is the number of decimal places of the value of
+ * this BigNumber, or `null` if the value of this BigNumber is ±`Infinity` or `NaN`.
+ *
+ * If `roundingMode` is omitted, `ROUNDING_MODE` is used.
+ *
+ * Throws if `decimalPlaces` or `roundingMode` is invalid.
+ *
+ * ```ts
+ * x = new BigNumber(1234.56)
+ * x.dp() // 2
+ * x.dp(1) // '1234.6'
+ * x.dp(2) // '1234.56'
+ * x.dp(10) // '1234.56'
+ * x.dp(0, 1) // '1234'
+ * x.dp(0, 6) // '1235'
+ * x.dp(1, 1) // '1234.5'
+ * x.dp(1, BigNumber.ROUND_HALF_EVEN) // '1234.6'
+ * x // '1234.56'
+ * y = new BigNumber('9.9e-101')
+ * y.dp() // 102
+ * ```
+ *
+ * @param [decimalPlaces] Decimal places, integer, 0 to 1e+9.
+ * @param [roundingMode] Rounding mode, integer, 0 to 8.
+ */
+ dp(): number | null;
+ dp(decimalPlaces: number, roundingMode?: BigNumber.RoundingMode): BigNumber;
+
+ /**
+ * Returns a BigNumber whose value is the value of this BigNumber divided by `n`, rounded
+ * according to the current `DECIMAL_PLACES` and `ROUNDING_MODE` settings.
+ *
+ * ```ts
+ * x = new BigNumber(355)
+ * y = new BigNumber(113)
+ * x.dividedBy(y) // '3.14159292035398230088'
+ * x.dividedBy(5) // '71'
+ * x.dividedBy(47, 16) // '5'
+ * ```
+ *
+ * @param n A numeric value.
+ * @param [base] The base of n.
+ */
+ dividedBy(n: BigNumber.Value, base?: number): BigNumber;
+
+ /**
+ * Returns a BigNumber whose value is the value of this BigNumber divided by `n`, rounded
+ * according to the current `DECIMAL_PLACES` and `ROUNDING_MODE` settings.
+ *
+ * ```ts
+ * x = new BigNumber(355)
+ * y = new BigNumber(113)
+ * x.div(y) // '3.14159292035398230088'
+ * x.div(5) // '71'
+ * x.div(47, 16) // '5'
+ * ```
+ *
+ * @param n A numeric value.
+ * @param [base] The base of n.
+ */
+ div(n: BigNumber.Value, base?: number): BigNumber;
+
+ /**
+ * Returns a BigNumber whose value is the integer part of dividing the value of this BigNumber by
+ * `n`.
+ *
+ * ```ts
+ * x = new BigNumber(5)
+ * y = new BigNumber(3)
+ * x.dividedToIntegerBy(y) // '1'
+ * x.dividedToIntegerBy(0.7) // '7'
+ * x.dividedToIntegerBy('0.f', 16) // '5'
+ * ```
+ *
+ * @param n A numeric value.
+ * @param [base] The base of n.
+ */
+ dividedToIntegerBy(n: BigNumber.Value, base?: number): BigNumber;
+
+ /**
+ * Returns a BigNumber whose value is the integer part of dividing the value of this BigNumber by
+ * `n`.
+ *
+ * ```ts
+ * x = new BigNumber(5)
+ * y = new BigNumber(3)
+ * x.idiv(y) // '1'
+ * x.idiv(0.7) // '7'
+ * x.idiv('0.f', 16) // '5'
+ * ```
+ *
+ * @param n A numeric value.
+ * @param [base] The base of n.
+ */
+ idiv(n: BigNumber.Value, base?: number): BigNumber;
+
+ /**
+ * Returns a BigNumber whose value is the value of this BigNumber exponentiated by `n`, i.e.
+ * raised to the power `n`, and optionally modulo a modulus `m`.
+ *
+ * If `n` is negative the result is rounded according to the current `DECIMAL_PLACES` and
+ * `ROUNDING_MODE` settings.
+ *
+ * As the number of digits of the result of the power operation can grow so large so quickly,
+ * e.g. 123.456**10000 has over 50000 digits, the number of significant digits calculated is
+ * limited to the value of the `POW_PRECISION` setting (unless a modulus `m` is specified).
+ *
+ * By default `POW_PRECISION` is set to 0. This means that an unlimited number of significant
+ * digits will be calculated, and that the method's performance will decrease dramatically for
+ * larger exponents.
+ *
+ * If `m` is specified and the value of `m`, `n` and this BigNumber are integers and `n` is
+ * positive, then a fast modular exponentiation algorithm is used, otherwise the operation will
+ * be performed as `x.exponentiatedBy(n).modulo(m)` with a `POW_PRECISION` of 0.
+ *
+ * Throws if `n` is not an integer.
+ *
+ * ```ts
+ * Math.pow(0.7, 2) // 0.48999999999999994
+ * x = new BigNumber(0.7)
+ * x.exponentiatedBy(2) // '0.49'
+ * BigNumber(3).exponentiatedBy(-2) // '0.11111111111111111111'
+ * ```
+ *
+ * @param n The exponent, an integer.
+ * @param [m] The modulus.
+ */
+ exponentiatedBy(n: BigNumber.Value, m?: BigNumber.Value): BigNumber;
+ exponentiatedBy(n: number, m?: BigNumber.Value): BigNumber;
+
+ /**
+ * Returns a BigNumber whose value is the value of this BigNumber exponentiated by `n`, i.e.
+ * raised to the power `n`, and optionally modulo a modulus `m`.
+ *
+ * If `n` is negative the result is rounded according to the current `DECIMAL_PLACES` and
+ * `ROUNDING_MODE` settings.
+ *
+ * As the number of digits of the result of the power operation can grow so large so quickly,
+ * e.g. 123.456**10000 has over 50000 digits, the number of significant digits calculated is
+ * limited to the value of the `POW_PRECISION` setting (unless a modulus `m` is specified).
+ *
+ * By default `POW_PRECISION` is set to 0. This means that an unlimited number of significant
+ * digits will be calculated, and that the method's performance will decrease dramatically for
+ * larger exponents.
+ *
+ * If `m` is specified and the value of `m`, `n` and this BigNumber are integers and `n` is
+ * positive, then a fast modular exponentiation algorithm is used, otherwise the operation will
+ * be performed as `x.pow(n).modulo(m)` with a `POW_PRECISION` of 0.
+ *
+ * Throws if `n` is not an integer.
+ *
+ * ```ts
+ * Math.pow(0.7, 2) // 0.48999999999999994
+ * x = new BigNumber(0.7)
+ * x.pow(2) // '0.49'
+ * BigNumber(3).pow(-2) // '0.11111111111111111111'
+ * ```
+ *
+ * @param n The exponent, an integer.
+ * @param [m] The modulus.
+ */
+ pow(n: BigNumber.Value, m?: BigNumber.Value): BigNumber;
+ pow(n: number, m?: BigNumber.Value): BigNumber;
+
+ /**
+ * Returns a BigNumber whose value is the value of this BigNumber rounded to an integer using
+ * rounding mode `rm`.
+ *
+ * If `rm` is omitted, `ROUNDING_MODE` is used.
+ *
+ * Throws if `rm` is invalid.
+ *
+ * ```ts
+ * x = new BigNumber(123.456)
+ * x.integerValue() // '123'
+ * x.integerValue(BigNumber.ROUND_CEIL) // '124'
+ * y = new BigNumber(-12.7)
+ * y.integerValue() // '-13'
+ * x.integerValue(BigNumber.ROUND_DOWN) // '-12'
+ * ```
+ *
+ * @param {BigNumber.RoundingMode} [rm] The roundng mode, an integer, 0 to 8.
+ */
+ integerValue(rm?: BigNumber.RoundingMode): BigNumber;
+
+ /**
+ * Returns `true` if the value of this BigNumber is equal to the value of `n`, otherwise returns
+ * `false`.
+ *
+ * As with JavaScript, `NaN` does not equal `NaN`.
+ *
+ * ```ts
+ * 0 === 1e-324 // true
+ * x = new BigNumber(0)
+ * x.isEqualTo('1e-324') // false
+ * BigNumber(-0).isEqualTo(x) // true ( -0 === 0 )
+ * BigNumber(255).isEqualTo('ff', 16) // true
+ *
+ * y = new BigNumber(NaN)
+ * y.isEqualTo(NaN) // false
+ * ```
+ *
+ * @param n A numeric value.
+ * @param [base] The base of n.
+ */
+ isEqualTo(n: BigNumber.Value, base?: number): boolean;
+
+ /**
+ * Returns `true` if the value of this BigNumber is equal to the value of `n`, otherwise returns
+ * `false`.
+ *
+ * As with JavaScript, `NaN` does not equal `NaN`.
+ *
+ * ```ts
+ * 0 === 1e-324 // true
+ * x = new BigNumber(0)
+ * x.eq('1e-324') // false
+ * BigNumber(-0).eq(x) // true ( -0 === 0 )
+ * BigNumber(255).eq('ff', 16) // true
+ *
+ * y = new BigNumber(NaN)
+ * y.eq(NaN) // false
+ * ```
+ *
+ * @param n A numeric value.
+ * @param [base] The base of n.
+ */
+ eq(n: BigNumber.Value, base?: number): boolean;
+
+ /**
+ * Returns `true` if the value of this BigNumber is a finite number, otherwise returns `false`.
+ *
+ * The only possible non-finite values of a BigNumber are `NaN`, `Infinity` and `-Infinity`.
+ *
+ * ```ts
+ * x = new BigNumber(1)
+ * x.isFinite() // true
+ * y = new BigNumber(Infinity)
+ * y.isFinite() // false
+ * ```
+ */
+ isFinite(): boolean;
+
+ /**
+ * Returns `true` if the value of this BigNumber is greater than the value of `n`, otherwise
+ * returns `false`.
+ *
+ * ```ts
+ * 0.1 > (0.3 - 0.2) // true
+ * x = new BigNumber(0.1)
+ * x.isGreaterThan(BigNumber(0.3).minus(0.2)) // false
+ * BigNumber(0).isGreaterThan(x) // false
+ * BigNumber(11, 3).isGreaterThan(11.1, 2) // true
+ * ```
+ *
+ * @param n A numeric value.
+ * @param [base] The base of n.
+ */
+ isGreaterThan(n: BigNumber.Value, base?: number): boolean;
+
+ /**
+ * Returns `true` if the value of this BigNumber is greater than the value of `n`, otherwise
+ * returns `false`.
+ *
+ * ```ts
+ * 0.1 > (0.3 - 0.2) // true
+ * x = new BigNumber(0.1)
+ * x.gt(BigNumber(0.3).minus(0.2)) // false
+ * BigNumber(0).gt(x) // false
+ * BigNumber(11, 3).gt(11.1, 2) // true
+ * ```
+ *
+ * @param n A numeric value.
+ * @param [base] The base of n.
+ */
+ gt(n: BigNumber.Value, base?: number): boolean;
+
+ /**
+ * Returns `true` if the value of this BigNumber is greater than or equal to the value of `n`,
+ * otherwise returns `false`.
+ *
+ * ```ts
+ * (0.3 - 0.2) >= 0.1 // false
+ * x = new BigNumber(0.3).minus(0.2)
+ * x.isGreaterThanOrEqualTo(0.1) // true
+ * BigNumber(1).isGreaterThanOrEqualTo(x) // true
+ * BigNumber(10, 18).isGreaterThanOrEqualTo('i', 36) // true
+ * ```
+ *
+ * @param n A numeric value.
+ * @param [base] The base of n.
+ */
+ isGreaterThanOrEqualTo(n: BigNumber.Value, base?: number): boolean;
+
+ /**
+ * Returns `true` if the value of this BigNumber is greater than or equal to the value of `n`,
+ * otherwise returns `false`.
+ *
+ * ```ts
+ * (0.3 - 0.2) >= 0.1 // false
+ * x = new BigNumber(0.3).minus(0.2)
+ * x.gte(0.1) // true
+ * BigNumber(1).gte(x) // true
+ * BigNumber(10, 18).gte('i', 36) // true
+ * ```
+ *
+ * @param n A numeric value.
+ * @param [base] The base of n.
+ */
+ gte(n: BigNumber.Value, base?: number): boolean;
+
+ /**
+ * Returns `true` if the value of this BigNumber is an integer, otherwise returns `false`.
+ *
+ * ```ts
+ * x = new BigNumber(1)
+ * x.isInteger() // true
+ * y = new BigNumber(123.456)
+ * y.isInteger() // false
+ * ```
+ */
+ isInteger(): boolean;
+
+ /**
+ * Returns `true` if the value of this BigNumber is less than the value of `n`, otherwise returns
+ * `false`.
+ *
+ * ```ts
+ * (0.3 - 0.2) < 0.1 // true
+ * x = new BigNumber(0.3).minus(0.2)
+ * x.isLessThan(0.1) // false
+ * BigNumber(0).isLessThan(x) // true
+ * BigNumber(11.1, 2).isLessThan(11, 3) // true
+ * ```
+ *
+ * @param n A numeric value.
+ * @param [base] The base of n.
+ */
+ isLessThan(n: BigNumber.Value, base?: number): boolean;
+
+ /**
+ * Returns `true` if the value of this BigNumber is less than the value of `n`, otherwise returns
+ * `false`.
+ *
+ * ```ts
+ * (0.3 - 0.2) < 0.1 // true
+ * x = new BigNumber(0.3).minus(0.2)
+ * x.lt(0.1) // false
+ * BigNumber(0).lt(x) // true
+ * BigNumber(11.1, 2).lt(11, 3) // true
+ * ```
+ *
+ * @param n A numeric value.
+ * @param [base] The base of n.
+ */
+ lt(n: BigNumber.Value, base?: number): boolean;
+
+ /**
+ * Returns `true` if the value of this BigNumber is less than or equal to the value of `n`,
+ * otherwise returns `false`.
+ *
+ * ```ts
+ * 0.1 <= (0.3 - 0.2) // false
+ * x = new BigNumber(0.1)
+ * x.isLessThanOrEqualTo(BigNumber(0.3).minus(0.2)) // true
+ * BigNumber(-1).isLessThanOrEqualTo(x) // true
+ * BigNumber(10, 18).isLessThanOrEqualTo('i', 36) // true
+ * ```
+ *
+ * @param n A numeric value.
+ * @param [base] The base of n.
+ */
+ isLessThanOrEqualTo(n: BigNumber.Value, base?: number): boolean;
+
+ /**
+ * Returns `true` if the value of this BigNumber is less than or equal to the value of `n`,
+ * otherwise returns `false`.
+ *
+ * ```ts
+ * 0.1 <= (0.3 - 0.2) // false
+ * x = new BigNumber(0.1)
+ * x.lte(BigNumber(0.3).minus(0.2)) // true
+ * BigNumber(-1).lte(x) // true
+ * BigNumber(10, 18).lte('i', 36) // true
+ * ```
+ *
+ * @param n A numeric value.
+ * @param [base] The base of n.
+ */
+ lte(n: BigNumber.Value, base?: number): boolean;
+
+ /**
+ * Returns `true` if the value of this BigNumber is `NaN`, otherwise returns `false`.
+ *
+ * ```ts
+ * x = new BigNumber(NaN)
+ * x.isNaN() // true
+ * y = new BigNumber('Infinity')
+ * y.isNaN() // false
+ * ```
+ */
+ isNaN(): boolean;
+
+ /**
+ * Returns `true` if the value of this BigNumber is negative, otherwise returns `false`.
+ *
+ * ```ts
+ * x = new BigNumber(-0)
+ * x.isNegative() // true
+ * y = new BigNumber(2)
+ * y.isNegative() // false
+ * ```
+ */
+ isNegative(): boolean;
+
+ /**
+ * Returns `true` if the value of this BigNumber is positive, otherwise returns `false`.
+ *
+ * ```ts
+ * x = new BigNumber(-0)
+ * x.isPositive() // false
+ * y = new BigNumber(2)
+ * y.isPositive() // true
+ * ```
+ */
+ isPositive(): boolean;
+
+ /**
+ * Returns `true` if the value of this BigNumber is zero or minus zero, otherwise returns `false`.
+ *
+ * ```ts
+ * x = new BigNumber(-0)
+ * x.isZero() // true
+ * ```
+ */
+ isZero(): boolean;
+
+ /**
+ * Returns a BigNumber whose value is the value of this BigNumber minus `n`.
+ *
+ * The return value is always exact and unrounded.
+ *
+ * ```ts
+ * 0.3 - 0.1 // 0.19999999999999998
+ * x = new BigNumber(0.3)
+ * x.minus(0.1) // '0.2'
+ * x.minus(0.6, 20) // '0'
+ * ```
+ *
+ * @param n A numeric value.
+ * @param [base] The base of n.
+ */
+ minus(n: BigNumber.Value, base?: number): BigNumber;
+
+ /**
+ * Returns a BigNumber whose value is the value of this BigNumber modulo `n`, i.e. the integer
+ * remainder of dividing this BigNumber by `n`.
+ *
+ * The value returned, and in particular its sign, is dependent on the value of the `MODULO_MODE`
+ * setting of this BigNumber constructor. If it is 1 (default value), the result will have the
+ * same sign as this BigNumber, and it will match that of Javascript's `%` operator (within the
+ * limits of double precision) and BigDecimal's `remainder` method.
+ *
+ * The return value is always exact and unrounded.
+ *
+ * See `MODULO_MODE` for a description of the other modulo modes.
+ *
+ * ```ts
+ * 1 % 0.9 // 0.09999999999999998
+ * x = new BigNumber(1)
+ * x.modulo(0.9) // '0.1'
+ * y = new BigNumber(33)
+ * y.modulo('a', 33) // '3'
+ * ```
+ *
+ * @param n A numeric value.
+ * @param [base] The base of n.
+ */
+ modulo(n: BigNumber.Value, base?: number): BigNumber;
+
+ /**
+ * Returns a BigNumber whose value is the value of this BigNumber modulo `n`, i.e. the integer
+ * remainder of dividing this BigNumber by `n`.
+ *
+ * The value returned, and in particular its sign, is dependent on the value of the `MODULO_MODE`
+ * setting of this BigNumber constructor. If it is 1 (default value), the result will have the
+ * same sign as this BigNumber, and it will match that of Javascript's `%` operator (within the
+ * limits of double precision) and BigDecimal's `remainder` method.
+ *
+ * The return value is always exact and unrounded.
+ *
+ * See `MODULO_MODE` for a description of the other modulo modes.
+ *
+ * ```ts
+ * 1 % 0.9 // 0.09999999999999998
+ * x = new BigNumber(1)
+ * x.mod(0.9) // '0.1'
+ * y = new BigNumber(33)
+ * y.mod('a', 33) // '3'
+ * ```
+ *
+ * @param n A numeric value.
+ * @param [base] The base of n.
+ */
+ mod(n: BigNumber.Value, base?: number): BigNumber;
+
+ /**
+ * Returns a BigNumber whose value is the value of this BigNumber multiplied by `n`.
+ *
+ * The return value is always exact and unrounded.
+ *
+ * ```ts
+ * 0.6 * 3 // 1.7999999999999998
+ * x = new BigNumber(0.6)
+ * y = x.multipliedBy(3) // '1.8'
+ * BigNumber('7e+500').multipliedBy(y) // '1.26e+501'
+ * x.multipliedBy('-a', 16) // '-6'
+ * ```
+ *
+ * @param n A numeric value.
+ * @param [base] The base of n.
+ */
+ multipliedBy(n: BigNumber.Value, base?: number): BigNumber;
+
+ /**
+ * Returns a BigNumber whose value is the value of this BigNumber multiplied by `n`.
+ *
+ * The return value is always exact and unrounded.
+ *
+ * ```ts
+ * 0.6 * 3 // 1.7999999999999998
+ * x = new BigNumber(0.6)
+ * y = x.times(3) // '1.8'
+ * BigNumber('7e+500').times(y) // '1.26e+501'
+ * x.times('-a', 16) // '-6'
+ * ```
+ *
+ * @param n A numeric value.
+ * @param [base] The base of n.
+ */
+ times(n: BigNumber.Value, base?: number): BigNumber;
+
+ /**
+ * Returns a BigNumber whose value is the value of this BigNumber negated, i.e. multiplied by -1.
+ *
+ * ```ts
+ * x = new BigNumber(1.8)
+ * x.negated() // '-1.8'
+ * y = new BigNumber(-1.3)
+ * y.negated() // '1.3'
+ * ```
+ */
+ negated(): BigNumber;
+
+ /**
+ * Returns a BigNumber whose value is the value of this BigNumber plus `n`.
+ *
+ * The return value is always exact and unrounded.
+ *
+ * ```ts
+ * 0.1 + 0.2 // 0.30000000000000004
+ * x = new BigNumber(0.1)
+ * y = x.plus(0.2) // '0.3'
+ * BigNumber(0.7).plus(x).plus(y) // '1.1'
+ * x.plus('0.1', 8) // '0.225'
+ * ```
+ *
+ * @param n A numeric value.
+ * @param [base] The base of n.
+ */
+ plus(n: BigNumber.Value, base?: number): BigNumber;
+
+ /**
+ * Returns the number of significant digits of the value of this BigNumber, or `null` if the value
+ * of this BigNumber is ±`Infinity` or `NaN`.
+ *
+ * If `includeZeros` is true then any trailing zeros of the integer part of the value of this
+ * BigNumber are counted as significant digits, otherwise they are not.
+ *
+ * Throws if `includeZeros` is invalid.
+ *
+ * ```ts
+ * x = new BigNumber(9876.54321)
+ * x.precision() // 9
+ * y = new BigNumber(987000)
+ * y.precision(false) // 3
+ * y.precision(true) // 6
+ * ```
+ *
+ * @param [includeZeros] Whether to include integer trailing zeros in the significant digit count.
+ */
+ precision(includeZeros?: boolean): number;
+
+ /**
+ * Returns a BigNumber whose value is the value of this BigNumber rounded to a precision of
+ * `significantDigits` significant digits using rounding mode `roundingMode`.
+ *
+ * If `roundingMode` is omitted, `ROUNDING_MODE` will be used.
+ *
+ * Throws if `significantDigits` or `roundingMode` is invalid.
+ *
+ * ```ts
+ * x = new BigNumber(9876.54321)
+ * x.precision(6) // '9876.54'
+ * x.precision(6, BigNumber.ROUND_UP) // '9876.55'
+ * x.precision(2) // '9900'
+ * x.precision(2, 1) // '9800'
+ * x // '9876.54321'
+ * ```
+ *
+ * @param significantDigits Significant digits, integer, 1 to 1e+9.
+ * @param [roundingMode] Rounding mode, integer, 0 to 8.
+ */
+ precision(significantDigits: number, roundingMode?: BigNumber.RoundingMode): BigNumber;
+
+ /**
+ * Returns the number of significant digits of the value of this BigNumber,
+ * or `null` if the value of this BigNumber is ±`Infinity` or `NaN`.
+ *
+ * If `includeZeros` is true then any trailing zeros of the integer part of
+ * the value of this BigNumber are counted as significant digits, otherwise
+ * they are not.
+ *
+ * Throws if `includeZeros` is invalid.
+ *
+ * ```ts
+ * x = new BigNumber(9876.54321)
+ * x.sd() // 9
+ * y = new BigNumber(987000)
+ * y.sd(false) // 3
+ * y.sd(true) // 6
+ * ```
+ *
+ * @param [includeZeros] Whether to include integer trailing zeros in the significant digit count.
+ */
+ sd(includeZeros?: boolean): number;
+
+ /**
+ * Returns a BigNumber whose value is the value of this BigNumber rounded to a precision of
+ * `significantDigits` significant digits using rounding mode `roundingMode`.
+ *
+ * If `roundingMode` is omitted, `ROUNDING_MODE` will be used.
+ *
+ * Throws if `significantDigits` or `roundingMode` is invalid.
+ *
+ * ```ts
+ * x = new BigNumber(9876.54321)
+ * x.sd(6) // '9876.54'
+ * x.sd(6, BigNumber.ROUND_UP) // '9876.55'
+ * x.sd(2) // '9900'
+ * x.sd(2, 1) // '9800'
+ * x // '9876.54321'
+ * ```
+ *
+ * @param significantDigits Significant digits, integer, 1 to 1e+9.
+ * @param [roundingMode] Rounding mode, integer, 0 to 8.
+ */
+ sd(significantDigits: number, roundingMode?: BigNumber.RoundingMode): BigNumber;
+
+ /**
+ * Returns a BigNumber whose value is the value of this BigNumber shifted by `n` places.
+ *
+ * The shift is of the decimal point, i.e. of powers of ten, and is to the left if `n` is negative
+ * or to the right if `n` is positive.
+ *
+ * The return value is always exact and unrounded.
+ *
+ * Throws if `n` is invalid.
+ *
+ * ```ts
+ * x = new BigNumber(1.23)
+ * x.shiftedBy(3) // '1230'
+ * x.shiftedBy(-3) // '0.00123'
+ * ```
+ *
+ * @param n The shift value, integer, -9007199254740991 to 9007199254740991.
+ */
+ shiftedBy(n: number): BigNumber;
+
+ /**
+ * Returns a BigNumber whose value is the square root of the value of this BigNumber, rounded
+ * according to the current `DECIMAL_PLACES` and `ROUNDING_MODE` settings.
+ *
+ * The return value will be correctly rounded, i.e. rounded as if the result was first calculated
+ * to an infinite number of correct digits before rounding.
+ *
+ * ```ts
+ * x = new BigNumber(16)
+ * x.squareRoot() // '4'
+ * y = new BigNumber(3)
+ * y.squareRoot() // '1.73205080756887729353'
+ * ```
+ */
+ squareRoot(): BigNumber;
+
+ /**
+ * Returns a BigNumber whose value is the square root of the value of this BigNumber, rounded
+ * according to the current `DECIMAL_PLACES` and `ROUNDING_MODE` settings.
+ *
+ * The return value will be correctly rounded, i.e. rounded as if the result was first calculated
+ * to an infinite number of correct digits before rounding.
+ *
+ * ```ts
+ * x = new BigNumber(16)
+ * x.sqrt() // '4'
+ * y = new BigNumber(3)
+ * y.sqrt() // '1.73205080756887729353'
+ * ```
+ */
+ sqrt(): BigNumber;
+
+ /**
+ * Returns a string representing the value of this BigNumber in exponential notation rounded using
+ * rounding mode `roundingMode` to `decimalPlaces` decimal places, i.e with one digit before the
+ * decimal point and `decimalPlaces` digits after it.
+ *
+ * If the value of this BigNumber in exponential notation has fewer than `decimalPlaces` fraction
+ * digits, the return value will be appended with zeros accordingly.
+ *
+ * If `decimalPlaces` is omitted, the number of digits after the decimal point defaults to the
+ * minimum number of digits necessary to represent the value exactly.
+ *
+ * If `roundingMode` is omitted, `ROUNDING_MODE` is used.
+ *
+ * Throws if `decimalPlaces` or `roundingMode` is invalid.
+ *
+ * ```ts
+ * x = 45.6
+ * y = new BigNumber(x)
+ * x.toExponential() // '4.56e+1'
+ * y.toExponential() // '4.56e+1'
+ * x.toExponential(0) // '5e+1'
+ * y.toExponential(0) // '5e+1'
+ * x.toExponential(1) // '4.6e+1'
+ * y.toExponential(1) // '4.6e+1'
+ * y.toExponential(1, 1) // '4.5e+1' (ROUND_DOWN)
+ * x.toExponential(3) // '4.560e+1'
+ * y.toExponential(3) // '4.560e+1'
+ * ```
+ *
+ * @param [decimalPlaces] Decimal places, integer, 0 to 1e+9.
+ * @param [roundingMode] Rounding mode, integer, 0 to 8.
+ */
+ toExponential(decimalPlaces: number, roundingMode?: BigNumber.RoundingMode): string;
+ toExponential(): string;
+
+ /**
+ * Returns a string representing the value of this BigNumber in normal (fixed-point) notation
+ * rounded to `decimalPlaces` decimal places using rounding mode `roundingMode`.
+ *
+ * If the value of this BigNumber in normal notation has fewer than `decimalPlaces` fraction
+ * digits, the return value will be appended with zeros accordingly.
+ *
+ * Unlike `Number.prototype.toFixed`, which returns exponential notation if a number is greater or
+ * equal to 10**21, this method will always return normal notation.
+ *
+ * If `decimalPlaces` is omitted, the return value will be unrounded and in normal notation.
+ * This is also unlike `Number.prototype.toFixed`, which returns the value to zero decimal places.
+ * It is useful when normal notation is required and the current `EXPONENTIAL_AT` setting causes
+ * `toString` to return exponential notation.
+ *
+ * If `roundingMode` is omitted, `ROUNDING_MODE` is used.
+ *
+ * Throws if `decimalPlaces` or `roundingMode` is invalid.
+ *
+ * ```ts
+ * x = 3.456
+ * y = new BigNumber(x)
+ * x.toFixed() // '3'
+ * y.toFixed() // '3.456'
+ * y.toFixed(0) // '3'
+ * x.toFixed(2) // '3.46'
+ * y.toFixed(2) // '3.46'
+ * y.toFixed(2, 1) // '3.45' (ROUND_DOWN)
+ * x.toFixed(5) // '3.45600'
+ * y.toFixed(5) // '3.45600'
+ * ```
+ *
+ * @param [decimalPlaces] Decimal places, integer, 0 to 1e+9.
+ * @param [roundingMode] Rounding mode, integer, 0 to 8.
+ */
+ toFixed(decimalPlaces: number, roundingMode?: BigNumber.RoundingMode): string;
+ toFixed(): string;
+
+ /**
+ * Returns a string representing the value of this BigNumber in normal (fixed-point) notation
+ * rounded to `decimalPlaces` decimal places using rounding mode `roundingMode`, and formatted
+ * according to the properties of the `format` or `FORMAT` object.
+ *
+ * The formatting object may contain some or all of the properties shown in the examples below.
+ *
+ * If `decimalPlaces` is omitted, then the return value is not rounded to a fixed number of
+ * decimal places.
+ *
+ * If `roundingMode` is omitted, `ROUNDING_MODE` is used.
+ *
+ * If `format` is omitted, `FORMAT` is used.
+ *
+ * Throws if `decimalPlaces`, `roundingMode`, or `format` is invalid.
+ *
+ * ```ts
+ * fmt = {
+ * decimalSeparator: '.',
+ * groupSeparator: ',',
+ * groupSize: 3,
+ * secondaryGroupSize: 0,
+ * fractionGroupSeparator: ' ',
+ * fractionGroupSize: 0
+ * }
+ *
+ * x = new BigNumber('123456789.123456789')
+ *
+ * // Set the global formatting options
+ * BigNumber.config({ FORMAT: fmt })
+ *
+ * x.toFormat() // '123,456,789.123456789'
+ * x.toFormat(3) // '123,456,789.123'
+ *
+ * // If a reference to the object assigned to FORMAT has been retained,
+ * // the format properties can be changed directly
+ * fmt.groupSeparator = ' '
+ * fmt.fractionGroupSize = 5
+ * x.toFormat() // '123 456 789.12345 6789'
+ *
+ * // Alternatively, pass the formatting options as an argument
+ * fmt = {
+ * decimalSeparator: ',',
+ * groupSeparator: '.',
+ * groupSize: 3,
+ * secondaryGroupSize: 2
+ * }
+ *
+ * x.toFormat() // '123 456 789.12345 6789'
+ * x.toFormat(fmt) // '12.34.56.789,123456789'
+ * x.toFormat(2, fmt) // '12.34.56.789,12'
+ * x.toFormat(3, BigNumber.ROUND_UP, fmt) // '12.34.56.789,124'
+ * ```
+ *
+ * @param [decimalPlaces] Decimal places, integer, 0 to 1e+9.
+ * @param [roundingMode] Rounding mode, integer, 0 to 8.
+ * @param [format] Formatting options object. See `BigNumber.Format`.
+ */
+ toFormat(decimalPlaces: number, roundingMode: BigNumber.RoundingMode, format?: BigNumber.Format): string;
+ toFormat(decimalPlaces: number, roundingMode?: BigNumber.RoundingMode): string;
+ toFormat(decimalPlaces?: number): string;
+ toFormat(decimalPlaces: number, format: BigNumber.Format): string;
+ toFormat(format: BigNumber.Format): string;
+
+ /**
+ * Returns an array of two BigNumbers representing the value of this BigNumber as a simple
+ * fraction with an integer numerator and an integer denominator.
+ * The denominator will be a positive non-zero value less than or equal to `max_denominator`.
+ * If a maximum denominator, `max_denominator`, is not specified, the denominator will be the
+ * lowest value necessary to represent the number exactly.
+ *
+ * Throws if `max_denominator` is invalid.
+ *
+ * ```ts
+ * x = new BigNumber(1.75)
+ * x.toFraction() // '7, 4'
+ *
+ * pi = new BigNumber('3.14159265358')
+ * pi.toFraction() // '157079632679,50000000000'
+ * pi.toFraction(100000) // '312689, 99532'
+ * pi.toFraction(10000) // '355, 113'
+ * pi.toFraction(100) // '311, 99'
+ * pi.toFraction(10) // '22, 7'
+ * pi.toFraction(1) // '3, 1'
+ * ```
+ *
+ * @param [max_denominator] The maximum denominator, integer > 0, or Infinity.
+ */
+ toFraction(max_denominator?: BigNumber.Value): [BigNumber, BigNumber];
+
+ /** As `valueOf`. */
+ toJSON(): string;
+
+ /**
+ * Returns the value of this BigNumber as a JavaScript primitive number.
+ *
+ * Using the unary plus operator gives the same result.
+ *
+ * ```ts
+ * x = new BigNumber(456.789)
+ * x.toNumber() // 456.789
+ * +x // 456.789
+ *
+ * y = new BigNumber('45987349857634085409857349856430985')
+ * y.toNumber() // 4.598734985763409e+34
+ *
+ * z = new BigNumber(-0)
+ * 1 / z.toNumber() // -Infinity
+ * 1 / +z // -Infinity
+ * ```
+ */
+ toNumber(): number;
+
+ /**
+ * Returns a string representing the value of this BigNumber rounded to `significantDigits`
+ * significant digits using rounding mode `roundingMode`.
+ *
+ * If `significantDigits` is less than the number of digits necessary to represent the integer
+ * part of the value in normal (fixed-point) notation, then exponential notation is used.
+ *
+ * If `significantDigits` is omitted, then the return value is the same as `n.toString()`.
+ *
+ * If `roundingMode` is omitted, `ROUNDING_MODE` is used.
+ *
+ * Throws if `significantDigits` or `roundingMode` is invalid.
+ *
+ * ```ts
+ * x = 45.6
+ * y = new BigNumber(x)
+ * x.toPrecision() // '45.6'
+ * y.toPrecision() // '45.6'
+ * x.toPrecision(1) // '5e+1'
+ * y.toPrecision(1) // '5e+1'
+ * y.toPrecision(2, 0) // '4.6e+1' (ROUND_UP)
+ * y.toPrecision(2, 1) // '4.5e+1' (ROUND_DOWN)
+ * x.toPrecision(5) // '45.600'
+ * y.toPrecision(5) // '45.600'
+ * ```
+ *
+ * @param [significantDigits] Significant digits, integer, 1 to 1e+9.
+ * @param [roundingMode] Rounding mode, integer 0 to 8.
+ */
+ toPrecision(significantDigits: number, roundingMode?: BigNumber.RoundingMode): string;
+ toPrecision(): string;
+
+ /**
+ * Returns a string representing the value of this BigNumber in base `base`, or base 10 if `base`
+ * is omitted.
+ *
+ * For bases above 10, and using the default base conversion alphabet (see `ALPHABET`), values
+ * from 10 to 35 are represented by a-z (the same as `Number.prototype.toString`).
+ *
+ * If a base is specified the value is rounded according to the current `DECIMAL_PLACES` and
+ * `ROUNDING_MODE` settings, otherwise it is not.
+ *
+ * If a base is not specified, and this BigNumber has a positive exponent that is equal to or
+ * greater than the positive component of the current `EXPONENTIAL_AT` setting, or a negative
+ * exponent equal to or less than the negative component of the setting, then exponential notation
+ * is returned.
+ *
+ * Throws if `base` is invalid.
+ *
+ * ```ts
+ * x = new BigNumber(750000)
+ * x.toString() // '750000'
+ * BigNumber.config({ EXPONENTIAL_AT: 5 })
+ * x.toString() // '7.5e+5'
+ *
+ * y = new BigNumber(362.875)
+ * y.toString(2) // '101101010.111'
+ * y.toString(9) // '442.77777777777777777778'
+ * y.toString(32) // 'ba.s'
+ *
+ * BigNumber.config({ DECIMAL_PLACES: 4 });
+ * z = new BigNumber('1.23456789')
+ * z.toString() // '1.23456789'
+ * z.toString(10) // '1.2346'
+ * ```
+ *
+ * @param [base] The base, integer, 2 to 36 (or `ALPHABET.length`, see `ALPHABET`).
+ */
+ toString(base?: number): string;
+
+ /**
+ * As `toString`, but does not accept a base argument and includes the minus sign for negative
+ * zero.
+ *
+ * ``ts
+ * x = new BigNumber('-0')
+ * x.toString() // '0'
+ * x.valueOf() // '-0'
+ * y = new BigNumber('1.777e+457')
+ * y.valueOf() // '1.777e+457'
+ * ```
+ */
+ valueOf(): string;
+
+ /** Helps ES6 import. */
+ private static readonly default: BigNumber.Constructor;
+
+ /** Helps ES6 import. */
+ private static readonly BigNumber: BigNumber.Constructor;
+
+ /** Rounds away from zero. */
+ static readonly ROUND_UP: 0;
+
+ /** Rounds towards zero. */
+ static readonly ROUND_DOWN: 1;
+
+ /** Rounds towards Infinity. */
+ static readonly ROUND_CEIL: 2;
+
+ /** Rounds towards -Infinity. */
+ static readonly ROUND_FLOOR: 3;
+
+ /** Rounds towards nearest neighbour. If equidistant, rounds away from zero . */
+ static readonly ROUND_HALF_UP: 4;
+
+ /** Rounds towards nearest neighbour. If equidistant, rounds towards zero. */
+ static readonly ROUND_HALF_DOWN: 5;
+
+ /** Rounds towards nearest neighbour. If equidistant, rounds towards even neighbour. */
+ static readonly ROUND_HALF_EVEN: 6;
+
+ /** Rounds towards nearest neighbour. If equidistant, rounds towards Infinity. */
+ static readonly ROUND_HALF_CEIL: 7;
+
+ /** Rounds towards nearest neighbour. If equidistant, rounds towards -Infinity. */
+ static readonly ROUND_HALF_FLOOR: 8;
+
+ /** See `MODULO_MODE`. */
+ static readonly EUCLID: 9;
+
+ /**
+ * To aid in debugging, if a `BigNumber.DEBUG` property is `true` then an error will be thrown
+ * if the BigNumber constructor receives an invalid `BigNumber.Value`, or if `BigNumber.isBigNumber`
+ * receives a BigNumber instance that is malformed.
+ *
+ * ```ts
+ * // No error, and BigNumber NaN is returned.
+ * new BigNumber('blurgh') // 'NaN'
+ * new BigNumber(9, 2) // 'NaN'
+ * BigNumber.DEBUG = true
+ * new BigNumber('blurgh') // '[BigNumber Error] Not a number'
+ * new BigNumber(9, 2) // '[BigNumber Error] Not a base 2 number'
+ * ```
+ *
+ * An error will also be thrown if a `BigNumber.Value` is of type number with more than 15
+ * significant digits, as calling `toString` or `valueOf` on such numbers may not result
+ * in the intended value.
+ *
+ * ```ts
+ * console.log(823456789123456.3) // 823456789123456.2
+ * // No error, and the returned BigNumber does not have the same value as the number literal.
+ * new BigNumber(823456789123456.3) // '823456789123456.2'
+ * BigNumber.DEBUG = true
+ * new BigNumber(823456789123456.3)
+ * // '[BigNumber Error] Number primitive has more than 15 significant digits'
+ * ```
+ *
+ * Check that a BigNumber instance is well-formed:
+ *
+ * ```ts
+ * x = new BigNumber(10)
+ *
+ * BigNumber.DEBUG = false
+ * // Change x.c to an illegitimate value.
+ * x.c = NaN
+ * // No error, as BigNumber.DEBUG is false.
+ * BigNumber.isBigNumber(x) // true
+ *
+ * BigNumber.DEBUG = true
+ * BigNumber.isBigNumber(x) // '[BigNumber Error] Invalid BigNumber'
+ * ```
+ */
+ static DEBUG?: boolean;
+
+ /**
+ * Returns a new independent BigNumber constructor with configuration as described by `object`, or
+ * with the default configuration if object is omitted.
+ *
+ * Throws if `object` is not an object.
+ *
+ * ```ts
+ * BigNumber.config({ DECIMAL_PLACES: 5 })
+ * BN = BigNumber.clone({ DECIMAL_PLACES: 9 })
+ *
+ * x = new BigNumber(1)
+ * y = new BN(1)
+ *
+ * x.div(3) // 0.33333
+ * y.div(3) // 0.333333333
+ *
+ * // BN = BigNumber.clone({ DECIMAL_PLACES: 9 }) is equivalent to:
+ * BN = BigNumber.clone()
+ * BN.config({ DECIMAL_PLACES: 9 })
+ * ```
+ *
+ * @param [object] The configuration object.
+ */
+ static clone(object?: BigNumber.Config): BigNumber.Constructor;
+
+ /**
+ * Configures the settings that apply to this BigNumber constructor.
+ *
+ * The configuration object, `object`, contains any number of the properties shown in the example
+ * below.
+ *
+ * Returns an object with the above properties and their current values.
+ *
+ * Throws if `object` is not an object, or if an invalid value is assigned to one or more of the
+ * properties.
+ *
+ * ```ts
+ * BigNumber.config({
+ * DECIMAL_PLACES: 40,
+ * ROUNDING_MODE: BigNumber.ROUND_HALF_CEIL,
+ * EXPONENTIAL_AT: [-10, 20],
+ * RANGE: [-500, 500],
+ * CRYPTO: true,
+ * MODULO_MODE: BigNumber.ROUND_FLOOR,
+ * POW_PRECISION: 80,
+ * FORMAT: {
+ * groupSize: 3,
+ * groupSeparator: ' ',
+ * decimalSeparator: ','
+ * },
+ * ALPHABET: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_'
+ * });
+ *
+ * BigNumber.config().DECIMAL_PLACES // 40
+ * ```
+ *
+ * @param object The configuration object.
+ */
+ static config(object?: BigNumber.Config): BigNumber.Config;
+
+ /**
+ * Returns `true` if `value` is a BigNumber instance, otherwise returns `false`.
+ *
+ * If `BigNumber.DEBUG` is `true`, throws if a BigNumber instance is not well-formed.
+ *
+ * ```ts
+ * x = 42
+ * y = new BigNumber(x)
+ *
+ * BigNumber.isBigNumber(x) // false
+ * y instanceof BigNumber // true
+ * BigNumber.isBigNumber(y) // true
+ *
+ * BN = BigNumber.clone();
+ * z = new BN(x)
+ * z instanceof BigNumber // false
+ * BigNumber.isBigNumber(z) // true
+ * ```
+ *
+ * @param value The value to test.
+ */
+ static isBigNumber(value: any): value is BigNumber;
+
+ /**
+ * Returns a BigNumber whose value is the maximum of the arguments.
+ *
+ * The return value is always exact and unrounded.
+ *
+ * ```ts
+ * x = new BigNumber('3257869345.0378653')
+ * BigNumber.maximum(4e9, x, '123456789.9') // '4000000000'
+ *
+ * arr = [12, '13', new BigNumber(14)]
+ * BigNumber.maximum.apply(null, arr) // '14'
+ * ```
+ *
+ * @param n A numeric value.
+ */
+ static maximum(...n: BigNumber.Value[]): BigNumber;
+
+ /**
+ * Returns a BigNumber whose value is the maximum of the arguments.
+ *
+ * The return value is always exact and unrounded.
+ *
+ * ```ts
+ * x = new BigNumber('3257869345.0378653')
+ * BigNumber.max(4e9, x, '123456789.9') // '4000000000'
+ *
+ * arr = [12, '13', new BigNumber(14)]
+ * BigNumber.max.apply(null, arr) // '14'
+ * ```
+ *
+ * @param n A numeric value.
+ */
+ static max(...n: BigNumber.Value[]): BigNumber;
+
+ /**
+ * Returns a BigNumber whose value is the minimum of the arguments.
+ *
+ * The return value is always exact and unrounded.
+ *
+ * ```ts
+ * x = new BigNumber('3257869345.0378653')
+ * BigNumber.minimum(4e9, x, '123456789.9') // '123456789.9'
+ *
+ * arr = [2, new BigNumber(-14), '-15.9999', -12]
+ * BigNumber.minimum.apply(null, arr) // '-15.9999'
+ * ```
+ *
+ * @param n A numeric value.
+ */
+ static minimum(...n: BigNumber.Value[]): BigNumber;
+
+ /**
+ * Returns a BigNumber whose value is the minimum of the arguments.
+ *
+ * The return value is always exact and unrounded.
+ *
+ * ```ts
+ * x = new BigNumber('3257869345.0378653')
+ * BigNumber.min(4e9, x, '123456789.9') // '123456789.9'
+ *
+ * arr = [2, new BigNumber(-14), '-15.9999', -12]
+ * BigNumber.min.apply(null, arr) // '-15.9999'
+ * ```
+ *
+ * @param n A numeric value.
+ */
+ static min(...n: BigNumber.Value[]): BigNumber;
+
+ /**
+ * Returns a new BigNumber with a pseudo-random value equal to or greater than 0 and less than 1.
+ *
+ * The return value will have `decimalPlaces` decimal places, or less if trailing zeros are
+ * produced. If `decimalPlaces` is omitted, the current `DECIMAL_PLACES` setting will be used.
+ *
+ * Depending on the value of this BigNumber constructor's `CRYPTO` setting and the support for the
+ * `crypto` object in the host environment, the random digits of the return value are generated by
+ * either `Math.random` (fastest), `crypto.getRandomValues` (Web Cryptography API in recent
+ * browsers) or `crypto.randomBytes` (Node.js).
+ *
+ * To be able to set `CRYPTO` to true when using Node.js, the `crypto` object must be available
+ * globally:
+ *
+ * ```ts
+ * global.crypto = require('crypto')
+ * ```
+ *
+ * If `CRYPTO` is true, i.e. one of the `crypto` methods is to be used, the value of a returned
+ * BigNumber should be cryptographically secure and statistically indistinguishable from a random
+ * value.
+ *
+ * Throws if `decimalPlaces` is invalid.
+ *
+ * ```ts
+ * BigNumber.config({ DECIMAL_PLACES: 10 })
+ * BigNumber.random() // '0.4117936847'
+ * BigNumber.random(20) // '0.78193327636914089009'
+ * ```
+ *
+ * @param [decimalPlaces] Decimal places, integer, 0 to 1e+9.
+ */
+ static random(decimalPlaces?: number): BigNumber;
+
+ /**
+ * Returns a BigNumber whose value is the sum of the arguments.
+ *
+ * The return value is always exact and unrounded.
+ *
+ * ```ts
+ * x = new BigNumber('3257869345.0378653')
+ * BigNumber.sum(4e9, x, '123456789.9') // '7381326134.9378653'
+ *
+ * arr = [2, new BigNumber(14), '15.9999', 12]
+ * BigNumber.sum.apply(null, arr) // '43.9999'
+ * ```
+ *
+ * @param n A numeric value.
+ */
+ static sum(...n: BigNumber.Value[]): BigNumber;
+
+ /**
+ * Configures the settings that apply to this BigNumber constructor.
+ *
+ * The configuration object, `object`, contains any number of the properties shown in the example
+ * below.
+ *
+ * Returns an object with the above properties and their current values.
+ *
+ * Throws if `object` is not an object, or if an invalid value is assigned to one or more of the
+ * properties.
+ *
+ * ```ts
+ * BigNumber.set({
+ * DECIMAL_PLACES: 40,
+ * ROUNDING_MODE: BigNumber.ROUND_HALF_CEIL,
+ * EXPONENTIAL_AT: [-10, 20],
+ * RANGE: [-500, 500],
+ * CRYPTO: true,
+ * MODULO_MODE: BigNumber.ROUND_FLOOR,
+ * POW_PRECISION: 80,
+ * FORMAT: {
+ * groupSize: 3,
+ * groupSeparator: ' ',
+ * decimalSeparator: ','
+ * },
+ * ALPHABET: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_'
+ * });
+ *
+ * BigNumber.set().DECIMAL_PLACES // 40
+ * ```
+ *
+ * @param object The configuration object.
+ */
+ static set(object?: BigNumber.Config): BigNumber.Config;
+}
+
+declare function BigNumber(n: BigNumber.Value, base?: number): BigNumber;
diff --git a/node_modules/data-uri-to-buffer/README.md b/node_modules/data-uri-to-buffer/README.md
new file mode 100644
index 00000000..d0f2e059
--- /dev/null
+++ b/node_modules/data-uri-to-buffer/README.md
@@ -0,0 +1,88 @@
+data-uri-to-buffer
+==================
+### Generate a Buffer instance from a [Data URI][rfc] string
+[](https://travis-ci.org/TooTallNate/node-data-uri-to-buffer)
+
+This module accepts a ["data" URI][rfc] String of data, and returns a
+node.js `Buffer` instance with the decoded data.
+
+
+Installation
+------------
+
+Install with `npm`:
+
+``` bash
+$ npm install data-uri-to-buffer
+```
+
+
+Example
+-------
+
+``` js
+import dataUriToBuffer from 'data-uri-to-buffer';
+
+// plain-text data is supported
+let uri = 'data:,Hello%2C%20World!';
+let decoded = dataUriToBuffer(uri);
+console.log(decoded.toString());
+// 'Hello, World!'
+
+// base64-encoded data is supported
+uri = 'data:text/plain;base64,SGVsbG8sIFdvcmxkIQ%3D%3D';
+decoded = dataUriToBuffer(uri);
+console.log(decoded.toString());
+// 'Hello, World!'
+```
+
+
+API
+---
+
+### dataUriToBuffer(String uri) → Buffer
+
+The `type` property on the Buffer instance gets set to the main type portion of
+the "mediatype" portion of the "data" URI, or defaults to `"text/plain"` if not
+specified.
+
+The `typeFull` property on the Buffer instance gets set to the entire
+"mediatype" portion of the "data" URI (including all parameters), or defaults
+to `"text/plain;charset=US-ASCII"` if not specified.
+
+The `charset` property on the Buffer instance gets set to the Charset portion of
+the "mediatype" portion of the "data" URI, or defaults to `"US-ASCII"` if the
+entire type is not specified, or defaults to `""` otherwise.
+
+*Note*: If the only the main type is specified but not the charset, e.g.
+`"data:text/plain,abc"`, the charset is set to the empty string. The spec only
+defaults to US-ASCII as charset if the entire type is not specified.
+
+
+License
+-------
+
+(The MIT License)
+
+Copyright (c) 2014 Nathan Rajlich <nathan@tootallnate.net>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+[rfc]: http://tools.ietf.org/html/rfc2397
diff --git a/node_modules/data-uri-to-buffer/dist/index.d.ts b/node_modules/data-uri-to-buffer/dist/index.d.ts
new file mode 100644
index 00000000..2a3d91ef
--- /dev/null
+++ b/node_modules/data-uri-to-buffer/dist/index.d.ts
@@ -0,0 +1,15 @@
+///
+export interface MimeBuffer extends Buffer {
+ type: string;
+ typeFull: string;
+ charset: string;
+}
+/**
+ * Returns a `Buffer` instance from the given data URI `uri`.
+ *
+ * @param {String} uri Data URI to turn into a Buffer instance
+ * @returns {Buffer} Buffer instance from Data URI
+ * @api public
+ */
+export declare function dataUriToBuffer(uri: string): MimeBuffer;
+export default dataUriToBuffer;
diff --git a/node_modules/data-uri-to-buffer/dist/index.js b/node_modules/data-uri-to-buffer/dist/index.js
new file mode 100644
index 00000000..4ddd0799
--- /dev/null
+++ b/node_modules/data-uri-to-buffer/dist/index.js
@@ -0,0 +1,53 @@
+/**
+ * Returns a `Buffer` instance from the given data URI `uri`.
+ *
+ * @param {String} uri Data URI to turn into a Buffer instance
+ * @returns {Buffer} Buffer instance from Data URI
+ * @api public
+ */
+export function dataUriToBuffer(uri) {
+ if (!/^data:/i.test(uri)) {
+ throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');
+ }
+ // strip newlines
+ uri = uri.replace(/\r?\n/g, '');
+ // split the URI up into the "metadata" and the "data" portions
+ const firstComma = uri.indexOf(',');
+ if (firstComma === -1 || firstComma <= 4) {
+ throw new TypeError('malformed data: URI');
+ }
+ // remove the "data:" scheme and parse the metadata
+ const meta = uri.substring(5, firstComma).split(';');
+ let charset = '';
+ let base64 = false;
+ const type = meta[0] || 'text/plain';
+ let typeFull = type;
+ for (let i = 1; i < meta.length; i++) {
+ if (meta[i] === 'base64') {
+ base64 = true;
+ }
+ else if (meta[i]) {
+ typeFull += `;${meta[i]}`;
+ if (meta[i].indexOf('charset=') === 0) {
+ charset = meta[i].substring(8);
+ }
+ }
+ }
+ // defaults to US-ASCII only if type is not provided
+ if (!meta[0] && !charset.length) {
+ typeFull += ';charset=US-ASCII';
+ charset = 'US-ASCII';
+ }
+ // get the encoded data portion and decode URI-encoded chars
+ const encoding = base64 ? 'base64' : 'ascii';
+ const data = unescape(uri.substring(firstComma + 1));
+ const buffer = Buffer.from(data, encoding);
+ // set `.type` and `.typeFull` properties to MIME type
+ buffer.type = type;
+ buffer.typeFull = typeFull;
+ // set the `.charset` property
+ buffer.charset = charset;
+ return buffer;
+}
+export default dataUriToBuffer;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/node_modules/data-uri-to-buffer/dist/index.js.map b/node_modules/data-uri-to-buffer/dist/index.js.map
new file mode 100644
index 00000000..696504a3
--- /dev/null
+++ b/node_modules/data-uri-to-buffer/dist/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,GAAW;IAC1C,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QACzB,MAAM,IAAI,SAAS,CAClB,kEAAkE,CAClE,CAAC;KACF;IAED,iBAAiB;IACjB,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAEhC,+DAA+D;IAC/D,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACpC,IAAI,UAAU,KAAK,CAAC,CAAC,IAAI,UAAU,IAAI,CAAC,EAAE;QACzC,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;KAC3C;IAED,mDAAmD;IACnD,MAAM,IAAI,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAErD,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,YAAY,CAAC;IACrC,IAAI,QAAQ,GAAG,IAAI,CAAC;IACpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACrC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE;YACzB,MAAM,GAAG,IAAI,CAAC;SACd;aAAM,IAAG,IAAI,CAAC,CAAC,CAAC,EAAE;YAClB,QAAQ,IAAI,IAAM,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;YAC5B,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;gBACtC,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;aAC/B;SACD;KACD;IACD,oDAAoD;IACpD,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;QAChC,QAAQ,IAAI,mBAAmB,CAAC;QAChC,OAAO,GAAG,UAAU,CAAC;KACrB;IAED,4DAA4D;IAC5D,MAAM,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;IAC7C,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC;IACrD,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAe,CAAC;IAEzD,sDAAsD;IACtD,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAE3B,8BAA8B;IAC9B,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC;IAEzB,OAAO,MAAM,CAAC;AACf,CAAC;AAED,eAAe,eAAe,CAAC"}
\ No newline at end of file
diff --git a/node_modules/data-uri-to-buffer/package.json b/node_modules/data-uri-to-buffer/package.json
new file mode 100644
index 00000000..9e427132
--- /dev/null
+++ b/node_modules/data-uri-to-buffer/package.json
@@ -0,0 +1,62 @@
+{
+ "name": "data-uri-to-buffer",
+ "version": "4.0.1",
+ "description": "Generate a Buffer instance from a Data URI string",
+ "type": "module",
+ "exports": "./dist/index.js",
+ "main": "./dist/index.js",
+ "types": "./dist/index.d.ts",
+ "files": [
+ "dist",
+ "src"
+ ],
+ "scripts": {
+ "build": "tsc",
+ "test": "jest",
+ "prepublishOnly": "npm run build"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/TooTallNate/node-data-uri-to-buffer.git"
+ },
+ "engines": {
+ "node": ">= 12"
+ },
+ "keywords": [
+ "data",
+ "uri",
+ "datauri",
+ "data-uri",
+ "buffer",
+ "convert",
+ "rfc2397",
+ "2397"
+ ],
+ "author": "Nathan Rajlich (http://n8.io/)",
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/TooTallNate/node-data-uri-to-buffer/issues"
+ },
+ "homepage": "https://github.com/TooTallNate/node-data-uri-to-buffer",
+ "devDependencies": {
+ "@types/jest": "^27.0.2",
+ "@types/node": "^12.20.36",
+ "jest": "^27.3.1",
+ "ts-jest": "^27.0.7",
+ "typescript": "^4.4.4"
+ },
+ "jest": {
+ "preset": "ts-jest",
+ "globals": {
+ "ts-jest": {
+ "diagnostics": false,
+ "isolatedModules": true
+ }
+ },
+ "verbose": false,
+ "testEnvironment": "node",
+ "testMatch": [
+ "/test/**/*.test.ts"
+ ]
+ }
+}
diff --git a/node_modules/data-uri-to-buffer/src/index.ts b/node_modules/data-uri-to-buffer/src/index.ts
new file mode 100644
index 00000000..9e5749f8
--- /dev/null
+++ b/node_modules/data-uri-to-buffer/src/index.ts
@@ -0,0 +1,68 @@
+export interface MimeBuffer extends Buffer {
+ type: string;
+ typeFull: string;
+ charset: string;
+}
+
+/**
+ * Returns a `Buffer` instance from the given data URI `uri`.
+ *
+ * @param {String} uri Data URI to turn into a Buffer instance
+ * @returns {Buffer} Buffer instance from Data URI
+ * @api public
+ */
+export function dataUriToBuffer(uri: string): MimeBuffer {
+ if (!/^data:/i.test(uri)) {
+ throw new TypeError(
+ '`uri` does not appear to be a Data URI (must begin with "data:")'
+ );
+ }
+
+ // strip newlines
+ uri = uri.replace(/\r?\n/g, '');
+
+ // split the URI up into the "metadata" and the "data" portions
+ const firstComma = uri.indexOf(',');
+ if (firstComma === -1 || firstComma <= 4) {
+ throw new TypeError('malformed data: URI');
+ }
+
+ // remove the "data:" scheme and parse the metadata
+ const meta = uri.substring(5, firstComma).split(';');
+
+ let charset = '';
+ let base64 = false;
+ const type = meta[0] || 'text/plain';
+ let typeFull = type;
+ for (let i = 1; i < meta.length; i++) {
+ if (meta[i] === 'base64') {
+ base64 = true;
+ } else if(meta[i]) {
+ typeFull += `;${ meta[i]}`;
+ if (meta[i].indexOf('charset=') === 0) {
+ charset = meta[i].substring(8);
+ }
+ }
+ }
+ // defaults to US-ASCII only if type is not provided
+ if (!meta[0] && !charset.length) {
+ typeFull += ';charset=US-ASCII';
+ charset = 'US-ASCII';
+ }
+
+ // get the encoded data portion and decode URI-encoded chars
+ const encoding = base64 ? 'base64' : 'ascii';
+ const data = unescape(uri.substring(firstComma + 1));
+ const buffer = Buffer.from(data, encoding) as MimeBuffer;
+
+ // set `.type` and `.typeFull` properties to MIME type
+ buffer.type = type;
+ buffer.typeFull = typeFull;
+
+ // set the `.charset` property
+ buffer.charset = charset;
+
+ return buffer;
+}
+
+export default dataUriToBuffer;
diff --git a/node_modules/date-fns/CHANGELOG.md b/node_modules/date-fns/CHANGELOG.md
new file mode 100644
index 00000000..fb80a730
--- /dev/null
+++ b/node_modules/date-fns/CHANGELOG.md
@@ -0,0 +1,2844 @@
+# Change Log
+
+All notable changes to this project will be documented in this file.
+This project adheres to [Semantic Versioning].
+
+This change log follows the format documented in [Keep a CHANGELOG].
+
+[semantic versioning]: http://semver.org/
+[keep a changelog]: http://keepachangelog.com/
+
+## v4.1.0 - 2024-09-17
+
+This release adds time zone support to format functions (that I somehow missed when working on the feature) and fixes a few bugs.
+
+Make sure also upgrade `TZDate` to v1.0.2 as it [includes a bunch of critical bug fixes](https://github.com/date-fns/tz/blob/main/CHANGELOG.md#v102---2024-09-14).
+
+### Fixed
+
+- Fixed internal `constructFrom` throwing an exception on `null` arguments. While `null` isn't allowed, the functions should rather return `Invalid Date` or `NaN` in such cases. See [#3885](https://github.com/date-fns/date-fns/issues/3885).
+
+### Added
+
+- Added missing time zone support to `format`, `formatISO`, `formatISO9075`, `formatRelative` and `formatRFC3339`. See [#3886](https://github.com/date-fns/date-fns/issues/3886).
+
+## v4.0.0 - 2024-09-16
+
+I have great news! First, ten years after its release, date-fns finally gets first-class time zone support.
+
+Another great news is that there aren't many breaking changes in this release. All of them are type-related and will affect only those explicitly using internal date-fns types. Finally, it has been less than a year since the last major release, which is an improvement over the previous four years between v2 and v3. I plan on keeping the pace and minimizing breaking changes moving forward.
+
+[Read more about the release in the announcement blog post](https://blog.date-fns.org/v40-with-time-zone-support/).
+
+\- [Sasha @kossnocorp](https://twitter.com/kossnocorp)
+
+### Added
+
+- Added time zones support via [`@date-fns/tz`](https://github.com/date-fns/tz)'s `TZDate` class and `tz` helper function. See its [README](https://github.com/date-fns/tz) for the details about the API.
+
+- All relevant functions now accept the context `in` option, which allows to specify the time zone to make the calculations in. If the function also returns a date, it will be in the specified time zone:
+
+ ```ts
+ import { addDays, startOfDay } from "date-fns";
+ import { tz } from "@date-fns/tz";
+
+ startOfDay(addDays(Date.now(), 5, { in: tz("Asia/Singapore") }));
+ //=> "2024-09-16T00:00:00.000+08:00"
+ ```
+
+ In the example, `addDays` will get the current date and time in Singapore and add 5 days to it. `startOfDay` will inherit the date type and return the start of the day in Singapore.
+
+### Changed
+
+- The function arguments, as well as `Interval`'s `start` and `end`, now can be of different types, allowing you to mix `UTCDate`, `TZDate`, `Date`, and other extensions, as well as primitives (strings and numbers).
+
+ The functions will normalize these values, make calculations, and return the result in the same type, preventing any bugs caused by the discrepancy. If passed, the type will be inferred from the context `in` option or the first encountered argument object type. The `Interval`'s `start` and `end` will be considered separately, starting from `start`.
+
+ In the given example, the result will be in the `TZDate` as the first argument is a number, and the `start` takes precedence over the `end`.
+
+ ```ts
+ clamp(Date.now(), {
+ start: new TZDate(start, "Asia/Singapore"),
+ end: new UTCDate(),
+ });
+ //=> TZDate
+ ```
+
+- **BREAKING**: This release contains a bunch of types changes that should not affect the library's expected usage. The changes are primarily internal and nuanced, so rather than listing them here, I recommend you running the type checker after the upgrade. If there are unfixable problems, please [open an issue](https://github.com/date-fns/date-fns/issues/new).
+
+- **BREAKING**: The package now is ESM-first. The CommonJS is still support and It should not affect most users, but it might break in certains environments. If you encounter any issues, please [report them](https://github.com/date-fns/date-fns/issues/new).
+
+### Fixed
+
+- Fixed CDN build compatibility with jQuery and other tools that expose `$` by properly wrapping the code in an IIFE.
+
+## v3.6.0 - 2024-03-18
+
+On this release worked @kossnocorp and @world1dan. Also, thanks to [@seated](https://github.com/seated) [for sponsoring me](https://github.com/sponsors/kossnocorp).
+
+### Fixed
+
+- [Fixed weeks in the Belarisuan locale's `formatDistance`.](https://github.com/date-fns/date-fns/pull/3720)
+
+### Added
+
+- [Added CDN versions of modules compatible with older browsers.](https://github.com/date-fns/date-fns/pull/3737) [See the CDN guide.](https://date-fns.org/docs/CDN)
+
+## v3.5.0 - 2024-03-15
+
+Kudos to @fturmel, @kossnocorp, @makstyle119, @tan75, @marcreichel, @tareknatsheh and @audunru for working on the release. Also, thanks to [@seated](https://github.com/seated) [for sponsoring me](https://github.com/sponsors/kossnocorp).
+
+### Fixed
+
+- [Fixed functions that use current date internally and made them work with date extensions like `UTCDate`.](https://github.com/date-fns/date-fns/issues/3730)
+
+- [Fixed `daysToWeeks` returning negative 0.](https://github.com/date-fns/date-fns/commit/882ced61c692c7c4a79eaaec6eb07cb9c8c9195b)
+
+- [Fixed German grammar for the "half a minute" string.](https://github.com/date-fns/date-fns/pull/3715)
+
+### Added
+
+- [Added the Northern Sámi (`se`) locale.](https://github.com/date-fns/date-fns/pull/3724)
+
+- Added the `constructNow` function that creates the current date using the passed reference date's constructor.
+
+## v3.4.0 - 2024-03-11
+
+Kudos to @kossnocorp, @sakamossan and @Revan99 for working on the release. Also, thanks to [@seated](https://github.com/seated) [for sponsoring me](https://github.com/sponsors/kossnocorp).
+
+### Added
+
+- [Added `roundToNearestHours` function.](https://github.com/date-fns/date-fns/pull/2752)
+
+- [Added Central Kurdish (`ckb`) locale.](https://github.com/date-fns/date-fns/pull/3421)
+
+## v3.3.1 - 2024-01-22
+
+Kudos to @kossnocorp and @fturmel for working on the release.
+
+### Fixed
+
+- Fixed DST issue in `getOverlappingDaysInIntervals`, resulting in an inconsistent number of days returned for intervals starting and ending in different DST periods.
+
+- Fixed functions incorrectly using `trunc` instead of `round`. The bug was introduced in v3.3.0. The affected functions: `differenceInCalendarDays`, `differenceInCalendarISOWeeks`, `differenceInCalendarWeeks`, `getISOWeek`, `getWeek`, and `getISOWeeksInYear`.
+
+## v3.3.0 - 2024-01-20
+
+On this release worked @kossnocorp, @TheKvikk, @fturmel and @ckcherry23.
+
+### Fixed
+
+- Fixed the bug in `getOverlappingDaysInIntervals` caused by incorrect sorting of interval components that led to 0 for timestamps of different lengths.
+
+- Fixed bugs when working with negative numbers caused by using `Math.floor` (`-1.1` → `-2`) instead of `Math.trunc` (`-1.1` → `-1`). Most of the conversion functions (i.e., `hoursToMinutes`) were affected when passing some negative fractional input. Also, some other functions that could be possibly affected by unfortunate timezone/date combinations were fixed.
+
+ The functions that were affected: `format`, `parse`, `getUnixTime`, `daysToWeeks`, `hoursToMilliseconds`, `hoursToMinutes`, `hoursToSeconds`, `milliseconds`, `minutesToMilliseconds`, `millisecondsToMinutes`, `monthsToYears`, `millisecondsToHours`, `millisecondsToSeconds`, `minutesToHours`, `minutesToSeconds`, `yearsToQuarters`, `yearsToMonths`, `yearsToDays`, `weeksToDays`, `secondsToMinutes`, `secondsToHours`, `quartersToYears`, `quartersToMonths` and `monthsToQuarters`.
+
+- [Fixed the Czech locale's `formatDistance` to include `1` in `formatDistance`.](https://github.com/date-fns/date-fns/pull/3269)
+
+- Fixed `differenceInSeconds` and other functions relying on rounding options that can produce a negative 0.
+
+- [Added a preprocessor to the locales API, enabling fixing a long-standing bug in the French locale.](https://github.com/date-fns/date-fns/pull/3662) ([#1391](https://github.com/date-fns/date-fns/issues/1391))
+
+- Added missing `yearsToDays` to the FP submodule.
+
+- Made functions using rounding methods always return `0` instead of `-0`.
+
+### Added
+
+- [Added `format` alias `formatDate` with corresponding `FormatDateOptions` interface](https://github.com/date-fns/date-fns/pull/3653).
+
+## v3.2.0 - 2024-01-09
+
+This release is brought to you by @kossnocorp, @fturmel, @grossbart, @MelvinVermeer, and @jcarstairs-scottlogic.
+
+### Fixed
+
+- Fixed types compatibility with Lodash's `flow` and fp-ts's `pipe`. ([#3641](https://github.com/date-fns/date-fns/issues/3641))
+
+- [Fixed inconsistent behavior of `roundToNearestMinutes`.](https://github.com/date-fns/date-fns/pull/3132)
+
+### Added
+
+- Added exports of `format`, `lightFormat`, and `parse` internals that enable 3rd-parties to consume those.
+
+## v3.1.0 - 2024-01-05
+
+This release is brought to you by @kossnocorp, @makstyle119 and @dmgawel.
+
+### Fixed
+
+- [Fixed the plural form of weeks in Swedish](https://github.com/date-fns/date-fns/pull/3448).
+
+### Added
+
+- [Added `yearsToDays` function](https://github.com/date-fns/date-fns/pull/3540).
+
+- Added warning about using protected tokens like `Y` or `D` without passing a corresponding option. [See #2950](https://github.com/date-fns/date-fns/issues/2950).
+
+## v3.0.6 - 2023-12-22
+
+On this release worked @imwh0im, @jamcry and @tyrw.
+
+### Fixed
+
+- [Fixed bug in `areIntervalsOverlapping` caused by incorrect sorting](https://github.com/date-fns/date-fns/pull/3628) ([#3614](https://github.com/date-fns/date-fns/issues/3614))
+
+## v3.0.5 - 2023-12-21
+
+This release is brought to you by @goku4199.
+
+### Fixed
+
+- [Fixed internal `toDate` not processing string arguments properly](https://github.com/date-fns/date-fns/pull/3626)
+
+## v3.0.4 - 2023-12-21
+
+This release is brought to you by @kossnocorp.
+
+### Fixed
+
+- Fixed isWithinInterval bug caused by incorrectly sorting dates ([#3623](https://github.com/date-fns/date-fns/issues/3623)).
+
+## v3.0.3 - 2023-12-21
+
+### Fixed
+
+- Rolled back pointing ESM types to the same `d.ts` files. Instead now it copies the content to avoid [the Masquerading as CJS problem](https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/FalseCJS.md) reported by "Are the types wrong?".
+
+## v3.0.2 - 2023-12-21
+
+### Fixed
+
+- Fixed [yet another issue caused by ESM types](https://github.com/date-fns/date-fns/issues/3620) by pointing to the same `d.ts` files.
+
+- [Added `package.json` to exports](https://github.com/date-fns/date-fns/pull/3601) to provide access to tooling.
+
+- [Fixed TypeScript 5.4 build break](https://github.com/date-fns/date-fns/pull/3598) by using the latest type names.
+
+## v3.0.1 - 2023-12-20
+
+### Fixed
+
+- [Fixed an error](https://github.com/date-fns/date-fns/pull/3618) in certain environments caused by `d.mts` files exporting only types.
+
+## v3.0.0 - 2023-12-18
+
+### Changed
+
+- **BREAKING**: date-fns is now a dual-package with the support of both ESM and CommonJS. The files exports are now explicitly in the `package.json`. The ESM files now have `.mjs` extension.
+
+- **BREAKING**: The package now has a flat structure, meaning functions are now named `node_modules/date-fns/add.mjs`, locales are `node_modules/date-fns/locale/enUS.mjs`, etc.
+
+- **BREAKING**: Now all file content’s exported via named exports instead of `export default`, which will require change direct imports i.e. `const addDays = require(‘date-fns/addDays’)` to `const { addDays } = require(‘date-fns/addDays’)`.
+
+- **BREAKING**: TypeScript types are now completely rewritten, check out the `d.ts` files for more information.
+
+- **BREAKING**: `constants` now is not exported via the index, so to import one use `import { daysInYear } from "date-fns/constants";`. It improves compatibility with setups that modularize imports [like Next.js](https://twitter.com/kossnocorp/status/1731181274579325260).
+
+- **BREAKING**: Functions now don’t check the number of passed arguments, delegating this task to type checkers. The functions are now slimmer because of this.
+
+- **BREAKING** The arguments are not explicitly converted to the target types. Instead, they are passed as is, delegating this task to type checkers.
+
+- **BREAKING**: Functions that accept `Interval` arguments now do not throw an error if the start is before the end and handle it as a negative interval. If one of the properties in an `Invalid Date`, these functions also do not throw and handle them as invalid intervals.
+
+ - `areIntervalsOverlapping` normalize intervals before comparison, so `{ start: a, end: b }` is practically equivalent to `{ start: b, end: a }`. When comparing intervals with one of the properties being `Invalid Date`, the function will return false unless the others are valid and equal, given the `inclusive` option is passed. Otherwise, and when even one of the intervals has both properties invalid, the function will always return `false`.
+
+ - `getOverlappingDaysInIntervals` now normalizes intervals before comparison, so `{ start: a, end: b }` is practically equivalent to `{ start: b, end: a }`. If any of the intervals’ properties is an `Invalid Date`, the function will always return 0.
+
+ - `isWithinInterval` now normalizes intervals before comparison, so `{ start: a, end: b }` is practically equivalent to `{ start: b, end: a }`. If any of the intervals’ properties is an `Invalid Date`, the function will always return false.
+
+ - `intervalToDuration` now returns negative durations for negative intervals. If one or both of the interval properties are invalid, the function will return an empty object.
+
+ - The eachXOfInterval functions (`eachDayOfInterval`, `eachHourOfInterval`, `eachMinuteOfInterval`, `eachMonthOfInterval`, `eachWeekendOfInterval`, `eachWeekendOfMonth`, `eachWeekendOfYear`, `eachWeekOfInterval`, `eachYearOfInterval`) now return a reversed array if the passed interval’s start is after the end. Invalid properties will result in an empty array. Functions that accept the `step` option now also allow negative, 0, and NaN values and return reversed results if the step is negative and an empty array otherwise.
+
+- **BREAKING**: `intervalToDuration` now skips 0 values in the resulting duration, resulting in more compact objects with only relevant properties.
+
+- **BREAKING**: `roundToNearestMinutes` now returns `Invalid Date` instead of throwing an error when `nearestTo` option is less than 1 or more than 30.
+
+- **BREAKING**: IE is no longer supported.
+
+- **BREAKING**: Now all functions use `Math.trunc` rounding method where rounding is required. The behavior is configurable on a per-function basis.
+
+- **BREAKING**: Undocumented `onlyNumeric` option was removed from `nn` and `sv` locales. If you relied on it, [please contact me](mailto:koss@nocorp.me).
+
+- **BREAKING**: Flow is not supported anymore. If you relied on it, [please contact me](mailto:koss@nocorp.me).
+
+- **BREAKING**: The locales now use regular functions instead of the UTC version, which should not break any code unless you used locales directly.
+
+### Added
+
+- All functions that accept date arguments now also accept strings.
+
+- All functions now export options interfaces.
+
+- Now functions allow passing custom Date extensions like [UTCDate](https://github.com/date-fns/utc). They will detect and use the arguments constructor to generate the result of the same class.
+
+- `eachMonthOfInterval`, `eachQuarterOfInterval`, `eachWeekOfInterval`, and `eachYearOfInterval` now accept the `step` option like most of the eachXOfInterval functions.
+
+- A new `interval` function that validates interval, emulating the v2 interval functions behavior.
+
+- `differenceInX` functions now accept options and allow setting up `roundingMethod` that configures how the result is rounded. `Math.trunc` is the default method.
+
+## v2.30.0
+
+Kudos to @kossnocorp and @Andarist for working on the release.
+
+### Changes
+
+- Fixed increased build size after enabling compatibility with older browsers in the previous release. This was done by adding @babel/runtime as a dependency. [See more details](https://github.com/date-fns/date-fns/issues/3208#issuecomment-1528592465).
+
+## v2.29.3 - 2022-09-13
+
+This release is prepared by our own @leshakoss.
+
+### Fixed
+
+- [Fixed Ukrainian (`uk`) locale grammar for `formatDistance`.](https://github.com/date-fns/date-fns/pull/3175)
+
+- [Improved browser compatibility by transforming the code with `@babel/preset-env`.](https://github.com/date-fns/date-fns/pull/3167)
+
+## v2.29.2 - 2022-08-18
+
+This release is brought to you by @nopears, @vadimpopa and @leshakoss.
+
+### Fixed
+
+- [Fixed `sv` locale abbreviated months matcher.](https://github.com/date-fns/date-fns/pull/3160)
+
+- [Fixed `uk` locale abbreviated months matcher.](https://github.com/date-fns/date-fns/pull/3139)
+
+- [Fixed a breaking change in `intervalToDuration` by removing a recently introduced RangeError.](https://github.com/date-fns/date-fns/pull/3153)
+
+## v2.29.1 - 2022-08-18
+
+Thanks to @fturmel for working on the release.
+
+### Fixed
+
+- [Fixed TypeScript and flow types for daysInYear constant.](https://github.com/date-fns/date-fns/pull/3125)
+
+## v2.29.0 - 2022-07-22
+
+On this release worked @tan75, @kossnocorp, @nopears, @Balastrong, @cpapazoglou, @dovca, @aliasgar55, @tomchentw, @JuanM04, @alexandresaura, @fturmel, @aezell, @andersravn, @TiagoPortfolio, @SukkaW, @Zebreus, @aviskarkc10, @maic66, @a-korzun, @Mejans, @davidspiess, @alexgul1, @matroskin062, @undecaf, @mprovenc, @jooola and @leshakoss.
+
+### Added
+
+- [Added `intlFormatDistance` function`.](https://github.com/date-fns/date-fns/pull/2173)
+
+- [Added `setDefaultOptions` and `getDefaultOptions` functions that allow you to set default default locale, `weekStartsOn` and `firstWeekContainsDate`.](https://github.com/date-fns/date-fns/pull/3069)
+
+- [Added `roundingMethod` option to `roundToNearestMinutes`.](https://github.com/date-fns/date-fns/pull/3091)
+
+- [Added Swiss Italian locale (`it-CH`).](https://github.com/date-fns/date-fns/pull/2886)
+
+- [Added Occitan (`oc`) locale.](https://github.com/date-fns/date-fns/pull/2106) ([#2061](https://github.com/date-fns/date-fns/issues/2061))
+
+- [Added Belarusian Classic (`be-tarask`) locale.](https://github.com/date-fns/date-fns/pull/3115)
+
+### Fixed
+
+- [Fixed Azerbaijani (`az`) locale for `formatDistance`.](https://github.com/date-fns/date-fns/pull/2924)
+
+- [Fixed Czech (`cs`) locale for `parse`.](https://github.com/date-fns/date-fns/pull/3059)
+
+- [Fixed TypeScript types for constants.](https://github.com/date-fns/date-fns/pull/2941)
+
+- [Fixed long formatters in the South African English locale (`en-ZA`).](https://github.com/date-fns/date-fns/pull/3014)
+
+- [Fixed a typo in the Icelandic locale (`is`) for `format`.](https://github.com/date-fns/date-fns/pull/2974)
+
+- [Fixed weekday format for `formatRelative` in the Portuguese locale (`pt`).](https://github.com/date-fns/date-fns/pull/2992)
+
+- [Fixed `intervalToDuration` being off by 1 day sometimes.](https://github.com/date-fns/date-fns/pull/2616)
+
+- [Fixed ordinal number formatting in Italian locale (`it`).](https://github.com/date-fns/date-fns/pull/1617)
+
+- [Fixed issue parsing months in Croatian (`hr`), Georgian (`ka`) and Serbian (`sr` and `sr-Latn`) locales.](https://github.com/date-fns/date-fns/pull/2898)
+
+### Changed
+
+- [Replaced `git.io` links with full URLs in error messages.](https://github.com/date-fns/date-fns/pull/3021)
+
+- [_Internal_: removed "v2.0.0 breaking changes" section from individual function docs](https://github.com/date-fns/date-fns/pull/2905)
+
+## v2.28.0 - 2021-12-28
+
+Kudos to @tan75, @fturmel, @arcanar7, @jeffjose, @helmut-lang, @zrev2220, @jooola, @minitesh, @cowboy-bebug, @mesqueeb, @JuanM04, @zhirzh, @damon02 and @leshakoss for working on the release.
+
+### Added
+
+- [Added West Frisian (`fy`) locale.](https://github.com/date-fns/date-fns/pull/2183)
+
+- [Added Uzbek Cyrillic locale (`uz-Cyrl`).](https://github.com/date-fns/date-fns/pull/2811)
+
+### Fixed
+
+- [add the missing accent mark for Saturday in Spanish locale (`es`) for `format`.](https://github.com/date-fns/date-fns/pull/2869)
+
+- [allowed `K` token to be used with `a` or `b` in `parse`.](https://github.com/date-fns/date-fns/pull/2814)
+
+## v2.27.0 - 2021-11-30
+
+Kudos to @tan75, @hg-pyun, @07akioni, @razvanmitre, @Haqverdi, @pgcalixto, @janziemba, @fturmel, @JuanM04, @zhirzh, @seanghay, @bulutfatih, @nodeadtree, @cHaLkdusT, @a-korzun, @fishmandev, @wingclover, @Zacharias3690, @kossnocorp and @leshakoss for working on the release.
+
+### Fixed
+
+- [Fixed translation for quarters in `format` in Chinese Simplified locale (`zh-CN`).](https://github.com/date-fns/date-fns/pull/2771)
+
+- [Fixed `P` token in `format` for Romanian locale (`ro`).](https://github.com/date-fns/date-fns/pull/2213)
+
+- [Fixed era and month formatters in Azerbaijani locale (`az`).](https://github.com/date-fns/date-fns/pull/1632)
+
+- [Fixed `formatRelative` patterns in Georgian locale (`ka`).](https://github.com/date-fns/date-fns/pull/2797)
+
+- [Fixed regular expressions for `parse` in Estonian locale (`er`).](https://github.com/date-fns/date-fns/pull/2038)
+
+- [Fixed the format of zeros in `formatDuration` in Czech locale (`cs`).](https://github.com/date-fns/date-fns/pull/2579)
+
+- [Fixed ordinal formatting for years, weeks, hours, minutes and seconds in `fr`, `fr-CA` and `fr-CH` locales.](https://github.com/date-fns/date-fns/pull/2626)
+
+- [Fixed constants not having proper TypeScript and Flow types.](https://github.com/date-fns/date-fns/pull/2791)
+
+- [Fixed translation for Monday in Turkish locale (`tr`).](https://github.com/date-fns/date-fns/pull/2720)
+
+- [Fixed `eachMinuteOfInterval` not handling intervals less than a minute correctly.](https://github.com/date-fns/date-fns/pull/2603)
+
+- [Fixed flow types for `closestTo` and `closestIndexTo`.](https://github.com/date-fns/date-fns/pull/2781)
+
+### Added
+
+- [Added Khmer locale (`km`).](https://github.com/date-fns/date-fns/pull/2713)
+
+## v2.26.0 - 2021-11-19
+
+Thanks to @kossnocorp, @leshakoss, @tan75, @gaplo, @AbdAllahAbdElFattah13, @fturmel, @kentaro84207, @V-Gutierrez, @atefBB, @jhonatanmacazana, @zhirzh, @Haqverdi, @mandaputtra, @micnic and @rikkalo for working on the release.
+
+### Fixed
+
+- [Fixed `formatRelative` format for `lastWeek` in Spanish locale.](https://github.com/date-fns/date-fns/pull/2753)
+
+- [Fixed translation for October in Hindi locale.](https://github.com/date-fns/date-fns/pull/2729)
+
+- [Fixed Azerbaijani locale to use correct era matchers for `parse`.](https://github.com/date-fns/date-fns/pull/1633)
+
+- [Added the functions that use `weekStartsOn` and `firstWeekContainsDate` that were missing from the `Locale` documentation page.](https://github.com/date-fns/date-fns/pull/2652)
+
+### Changed
+
+- [Changed abbreviation for August from "Ags" to "Agt" in Indonesian locale.](https://github.com/date-fns/date-fns/pull/2658)
+
+### Added
+
+- [Added Irish English locale (`en-IE`).](https://github.com/date-fns/date-fns/pull/2772)
+
+- [Added Arabic locale (`ar`).](https://github.com/date-fns/date-fns/pull/2721) ([#1670](https://github.com/date-fns/date-fns/issues/1670))
+
+- [Added Hong Kong Traditional Chinese locale (zh-HK).](https://github.com/date-fns/date-fns/pull/2686) ([#2684](https://github.com/date-fns/date-fns/issues/2684))
+
+- [Added Egyptian Arabic locale (ar-EG).](https://github.com/date-fns/date-fns/pull/2699)
+
+## v2.25.0 - 2021-10-05
+
+This release is brought to you by @kossnocorp, @gierschv, @fturmel, @redbmk, @mprovenc, @artyom-ivanov and @tan75.
+
+### Added
+
+- [Added Japanese Hiragana locale (`ja-Hira`).](https://github.com/date-fns/date-fns/pull/2663)
+
+- [Added standalone months support to `de` and `de-AT` locales.](https://github.com/date-fns/date-fns/pull/2602)
+
+## v2.24.0 - 2021-09-17
+
+Kudos to [Sasha Koss](http://github.com/kossnocorp), [Lucas Silva](http://github.com/LucasHFS), [Jan Ziemba](http://github.com/janziemba), [Anastasia Kobzar](http://github.com/rikkalo), [Deepak Gupta](http://github.com/Mr-DG-Wick), [Jonas L](http://github.com/jooola), [Kentaro Suzuki](http://github.com/kentaro84207), [Koussay Haj Kacem](http://github.com/essana3), [fturmel](http://github.com/fturmel), [Tan75](http://github.com/tan75) and [Adriaan Callaerts](http://github.com/call-a3) for working on the release.
+
+### Fixed
+
+- [Fixed an edge case in the Slovak locale caused by unescaped character.](https://github.com/date-fns/date-fns/pull/2540) ([#2083](https://github.com/date-fns/date-fns/issues/2083))
+
+### Changed
+
+- [Used `1` instead of `ein` for German `formatDuration` to make it consistent with other locales and formats.](https://github.com/date-fns/date-fns/pull/2576) ([#2505](https://github.com/date-fns/date-fns/issues/2505))
+
+- [Made Norwegian `formatDuration` consistent with other locales by using numeric representation instead of written.](https://github.com/date-fns/date-fns/pull/2631) ([#2469](https://github.com/date-fns/date-fns/issues/2469))
+
+- [Use the word "sekunda" instead of "vteřina" for second in the Czech locale.](https://github.com/date-fns/date-fns/pull/2577)
+
+- [Made Flemish short date format corresponds to the Flemish government.](https://github.com/date-fns/date-fns/pull/2535)
+
+### Added
+
+- [Added `roundingMethod` option to `differenceInHours`, `differenceInMinutes`, `differenceInQuarters`, `differenceInSeconds` and `differenceInWeeks` with `trunc` as the default method.](https://github.com/date-fns/date-fns/pull/2571) ([#2555](https://github.com/date-fns/date-fns/issues/2555))
+
+- [Added new functions: `previousDay`, `previousMonday`, `previousTuesday`, `previousWednesday`, `previousThursday`, `previousFriday`, `previousSaturday` and `previousSunday`.](https://github.com/date-fns/date-fns/pull/2522)
+
+## v2.23.0 - 2021-07-23
+
+Thanks to [Liam Tait](http://github.com/Liam-Tait), [fturmel](http://github.com/fturmel), [Takuya Uehara](http://github.com/indigolain), [Branislav Lazic](http://github.com/BranislavLazic), [Seyyed Morteza Moosavi](http://github.com/smmoosavi), [Felipe Armoni](http://github.com/komyg), [Sasha Koss](http://github.com/kossnocorp), [Michael Mok](http://github.com/pmmmwh), [Tan75](http://github.com/tan75) and [Maxim Topciu](http://github.com/maximtop) for working on the release.
+
+### Changed
+
+- [Improved `nextDay` performance by roughly 50%.](https://github.com/date-fns/date-fns/pull/2524)
+
+- [Added more ordinal formatting to the Japanese locale.](https://github.com/date-fns/date-fns/pull/2471)
+
+### Added
+
+- [Added a new `clamp` function that allows to bound a date to an interval.](https://github.com/date-fns/date-fns/pull/2498)
+
+- [Added Bosnian locale (bs).](https://github.com/date-fns/date-fns/pull/2495)
+
+- [Allowed passing `undefined` in the duration to add and sub functions.](https://github.com/date-fns/date-fns/pull/2515)
+
+## v2.22.1 - 2021-05-28
+
+Thanks to [Sasha Koss](http://github.com/kossnocorp) for working on the release.
+
+### Fixed
+
+- Fixed constant typings. ([#2491](https://github.com/date-fns/date-fns/issues/2491))
+
+## v2.22.0 - 2021-05-28
+
+[Sasha Koss](http://github.com/kossnocorp), [Lucas Silva](http://github.com/LucasHFS), [Lay](http://github.com/brownsugar), [jwbth](http://github.com/jwbth), [fturmel](http://github.com/fturmel), [Tan75](http://github.com/tan75) and [Anastasia Kobzar](http://github.com/rikkalo) worked on this release.
+
+### Fixed
+
+- [Fixed Taiwanese locale to use traditional Chinese and removed unnecessary spaces.](https://github.com/date-fns/date-fns/pull/2436)
+
+- [Fixed Russian locale to use correct long formats.](https://github.com/date-fns/date-fns/pull/2478)
+
+### Added
+
+- [Added 18 new conversion functions](https://github.com/date-fns/date-fns/pull/2433):
+ - `daysToWeeks`
+ - `hoursToMilliseconds`
+ - `hoursToMinutes`
+ - `hoursToSeconds`
+ - `millisecondsToHours`
+ - `millisecondsToMinutes`
+ - `millisecondsToSeconds`
+ - `minutesToHours`
+ - `minutesToMilliseconds`
+ - `minutesToSeconds`
+ - `monthsToQuarters`
+ - `monthsToYears`
+ - `quartersToMonths`
+ - `quartersToYears`
+ - `secondsToHours`
+ - `secondsToMilliseconds`
+ - `secondsToMinutes`
+ - `weeksToDays`
+ - `yearsToMonths`
+ - `yearsToQuarters`
+
+## v2.21.3 - 2021-05-08
+
+This release is brought to you by [Maxim Topciu](http://github.com/maximtop).
+
+### Fixed
+
+- [Fixed IE11 support by babelifing the shorthand properties.](https://github.com/date-fns/date-fns/pull/2467)
+
+## v2.21.2 - 2021-05-05
+
+Kudos to [Aleksei Korzun](http://github.com/a-korzun), [Maxim Topciu](http://github.com/maximtop), [Jonas L](http://github.com/jooola), [Mohammad ali Ali panah](http://github.com/always-maap) and [Tan75](http://github.com/tan75) for working on the release.
+
+### Fixed
+
+- [`differenceInBusinessDays` now returns `NaN` instead of `Invalid Date` when an invalid argument is passed to the function.](https://github.com/date-fns/date-fns/pull/2414)
+
+- [Fixed `weekStartsOn` in Persian locale.](https://github.com/date-fns/date-fns/pull/2430)
+
+## v2.21.1 - 2021-04-15
+
+Thanks to [Sasha Koss](http://github.com/kossnocorp) for working on the release.
+
+### Fixed
+
+- [Fixed a breaking change introduced by using modern default argument value syntax (see https://github.com/Hacker0x01/react-datepicker/issues/2870).](https://github.com/date-fns/date-fns/pull/2423)
+
+## v2.21.0 - 2021-04-14
+
+This release is brought to you by [Aleksei Korzun](http://github.com/a-korzun), [Tan75](http://github.com/tan75), [Rubens Mariuzzo](http://github.com/rmariuzzo), [Christoph Stenglein](http://github.com/cstenglein) and [Clément Tamisier](http://github.com/ctamisier).
+
+### Fixed
+
+- [Made `formatDistanceStrict` return `12 months` instead of `1 year` when `unit: 'month'`.](https://github.com/date-fns/date-fns/pull/2411)
+
+### Added
+
+- [Added Haitian Creole (`ht`) locale.](https://github.com/date-fns/date-fns/pull/2396)
+- [Added Austrian German (`de-AT`) locale.](https://github.com/date-fns/date-fns/pull/2362)
+
+## v2.20.3 - 2021-04-13
+
+Kudos to [fturmel](http://github.com/fturmel) for working on the release.
+
+### Fixed
+
+- [Fixed broken tree-shaking caused by missing links to corresponding ESM.](https://github.com/date-fns/date-fns/pull/2339) ([#2207](https://github.com/date-fns/date-fns/issues/2207))
+
+## v2.20.2 - 2021-04-12
+
+Kudos to [Maxim Topciu](http://github.com/maximtop) for working on the release.
+
+### Fixed
+
+- [Fixed IE11 incompatibility caused by the usage of spread syntax.](https://github.com/date-fns/date-fns/pull/2407) ([#2408](https://github.com/date-fns/date-fns/issues/2408))
+
+## v2.20.1 - 2021-04-09
+
+This release is brought to you by [Sasha Koss](http://github.com/kossnocorp) and [Tan75](http://github.com/tan75).
+
+### Fixed
+
+- Fixed `isDate` Flow typings that we broke in `v2.20.0`.
+
+## v2.20.0 - 2021-04-08
+
+This release is brought to you by [Sasha Koss](http://github.com/kossnocorp), [Maxim Topciu](http://github.com/maximtop), [tu4mo](http://github.com/tu4mo), [Tan75](http://github.com/tan75), [Ardit Dine](http://github.com/arditdine), [Carl Rosell](http://github.com/CarlRosell), [Roman Mahotskyi](http://github.com/enheit), [Mateusz Krzak](http://github.com/mateuszkrzak), [fgottschalk](http://github.com/fgottschalk), [Anastasia Kobzar](http://github.com/rikkalo), [Bilguun Ochirbat](http://github.com/bilguun0203), [Lesha Koss](http://github.com/leshakoss), [YuLe](http://github.com/yuler) and [guyroberts21](http://github.com/guyroberts21).
+
+### Fixed
+
+- [Made `formatDistanceStrict` and `formatDistanceToNowStrict` always return `1 year` instead of `12 months`.](https://github.com/date-fns/date-fns/pull/2391) ([#2388](https://github.com/date-fns/date-fns/issues/2388))
+
+- Fixed `nextDay`, `nextMonday` and `nextTuesday` missing in exports and type definitions. ([#2325](https://github.com/date-fns/date-fns/issues/2325))
+
+- [Fixed a DST bug in `formatDistanceStrict`.](https://github.com/date-fns/date-fns/pull/2329) ([#2307](https://github.com/date-fns/date-fns/issues/2307))
+
+### Added
+
+- [Added new `eachMinuteOfInterval` function.](https://github.com/date-fns/date-fns/pull/2382)
+
+- [Added Albanian (`sq`) locale](https://github.com/date-fns/date-fns/pull/2290)
+
+- [Added Mongolian (`mn`) locale](https://github.com/date-fns/date-fns/pull/1961)
+
+- [Added `nextWednesday`, `nextThursday`, `nextFriday`, `nextSaturday` and `nextSunday`.](https://github.com/date-fns/date-fns/pull/2291)
+
+## v2.19.0 - 2021-03-05
+
+[Tan75](http://github.com/tan75) worked on this release.
+
+### Fixed
+
+- [Assigned the correct `firstWeekContainsDate` value (`4`) for the French locale.](https://github.com/date-fns/date-fns/pull/2273) ([#2148](https://github.com/date-fns/date-fns/issues/2148))
+
+- [Fixed torsdag abbreviation in the Swedish locale.](https://github.com/date-fns/date-fns/pull/2220)
+
+- [Fixed a bug in `differenceInMonths` and `intervalToDuration` that occurs when dealing with the 28th of February.](https://github.com/date-fns/date-fns/pull/2256) ([#2255](https://github.com/date-fns/date-fns/issues/2255))
+
+### Added
+
+- [Added new functions: `nextDay`, `nextMonday` and `nextTuesday` that allows getting the next day of the week, Monday or Tuesday respectively.](https://github.com/date-fns/date-fns/pull/2214)
+
+## v2.18.0 - 2021-03-01
+
+Thanks to [Tan75](http://github.com/tan75) and [Lesha Koss](http://github.com/leshakoss).
+
+### Fixed
+
+- [Fixed documentation missing for `intlFormat`.](https://github.com/date-fns/date-fns/pull/2259) ([#2258](https://github.com/date-fns/date-fns/issues/2258))
+
+- [Fixed date formats in the Latvian locale.](https://github.com/date-fns/date-fns/pull/2205) ([#2202](https://github.com/date-fns/date-fns/issues/2202))
+
+### Added
+
+- [Added support of positive and negative offsets in `parseJSON`.](https://github.com/date-fns/date-fns/pull/2200) ([#2149](https://github.com/date-fns/date-fns/issues/2149))
+
+## [2.17.0] - 2021-02-05
+
+Kudos to [@shaykav](https://github.com/date-fns/date-fns/pull/1952), [@davidgape89](https://github.com/davidgape89), [@rikkalo](https://github.com/rikkalo), [@tan75](https://github.com/tan75), [@talgautb](https://github.com/talgautb), [@owenl131](https://github.com/owenl131), [@kylesezhi](https://github.com/kylesezhi), [@inigoiparragirre](https://github.com/inigoiparragirre), [@gius](https://github.com/gius), [@Endeauvirr](https://github.com/Endeauvirr) and [@frankyston](https://github.com/frankyston).
+
+### Fixed
+
+- [Fixed Russian locale parsing issue](https://github.com/date-fns/date-fns/pull/1950).
+
+- [Fixed `differenceInMonths` for edge cases, such as the end of February dates](https://github.com/date-fns/date-fns/pull/2185).
+
+- [Fixed suffixes for the Kazakh locale](https://github.com/date-fns/date-fns/pull/2010).
+
+- [Fixed `formatDuration` week translation in `pt` and `pt-BR` locales](https://github.com/date-fns/date-fns/pull/2125).
+
+- [Made Japanese locale to use the correct value for the start of the week](https://github.com/date-fns/date-fns/pull/2099).
+
+- [Adjusted date formats in the Basque locale](https://github.com/date-fns/date-fns/pull/2080).
+
+- [Fixed the short and medium date formats in the Czech locale](https://github.com/date-fns/date-fns/pull/2111).
+
+- [Adjusted the Polish translations of `formatDistance`](https://github.com/date-fns/date-fns/pull/2187).
+
+- [Fixed the week's abbreviations in the Brazilian Portuguese](https://github.com/date-fns/date-fns/pull/2170).
+
+### Added
+
+- [Added `intlFormat`](https://github.com/date-fns/date-fns/pull/2172) a lightweight formatting function that uses [Intl API](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl). Eventually, it will become the default formatting function, so it's highly recommended for new code.
+
+- [Added `en-ZA` locale](https://github.com/date-fns/date-fns/pull/1952).
+
+- [Added an ability to format lowercase am/pm with `aaa` and `bbb` tokens](https://github.com/date-fns/date-fns/pull/2016).
+
+- [Added ordinal formatting for Japanese year values](https://github.com/date-fns/date-fns/pull/2177/files).
+
+## [2.16.1] - 2020-07-31
+
+Kudos to [@aleksaps](https://github.com/aleksaps), [@leedriscoll](https://github.com/leedriscoll) and [@BanForFun](https://github.com/BanForFun) for pull-requests!
+
+### Fixed
+
+- [Fixed a typo in Scottish Gaelic (gd) locale](https://github.com/date-fns/date-fns/pull/1925).
+- [Fixed typos in Serbian Latin locale](https://github.com/date-fns/date-fns/pull/1928).
+- [Fixed greek grammar for Saturday on `formatRelative`](https://github.com/date-fns/date-fns/pull/1930).
+- Removed locale snapshots from the npm package making it lighter.
+
+## [2.16.0] - 2020-08-27
+
+Kudos to [@jvpelt](https://github.com/jvpelt), [@piotrl](https://github.com/piotrl), [@yotamofek](https://github.com/yotamofek), [@dwaxweiler](https://github.com/dwaxweiler), [@leedriscoll](https://github.com/leedriscoll) and [@bradevans](https://github.com/bradevans) for working on the release. Also thanks to [@PascalHonegger](https://github.com/PascalHonegger), [@pickfire](https://github.com/pickfire), [@TheJaredWilcurt](https://github.com/TheJaredWilcurt), [@SidKH](https://github.com/SidKH) and [@nfantone](https://github.com/nfantone) for improving the documentation.
+
+### Fixed
+
+- [Added correct translations for Welsh `1 minute` and `2 days`](https://github.com/date-fns/date-fns/pull/1903).
+- [Fixed `formatRFC3339` formatting timezone offset with minutes](https://github.com/date-fns/date-fns/pull/1890).
+- [Added missing locale type definition for `formatDuration`](https://github.com/date-fns/date-fns/pull/1881)
+- [Fixed Scottish Gaelic locale issues](https://github.com/date-fns/date-fns/pull/1914).
+
+### Changed
+
+- [Used shorter Hebrew alternative for "about"](https://github.com/date-fns/date-fns/pull/1893).
+- [Improved string arguments warning after upgrading to v2](https://github.com/date-fns/date-fns/pull/1910).
+
+### Added
+
+- [Added Luxembourgish (lb) locale](https://github.com/date-fns/date-fns/pull/1900).
+
+## [2.15.0] - 2020-07-17
+
+Thanks to [@belgamo](https://github.com/belgamo), [@Matsuuu](https://github.com/Matsuuu), [@Imballinst](https://github.com/Imballinst), [@arsnyder16](https://github.com/arsnyder16), [@pankajupadhyay29](https://github.com/pankajupadhyay29), [@DCBN](https://github.com/DCBN), [@leedriscoll](https://github.com/leedriscoll), [@gottsohn](https://github.com/gottsohn), [@mukuljainx](https://github.com/mukuljainx) and [@dtriana](https://github.com/dtriana) for working on the release. Also kudos to [@KidkArolis](https://github.com/KidkArolis), [@imgx64](https://github.com/imgx64), [@fjc0k](https://github.com/fjc0k), [@wmonk](https://github.com/wmonk), [@djD-REK](https://github.com/djD-REK), [@dandv](https://github.com/dandv), [@psimk](https://github.com/psimk) and [@brimworks](https://github.com/brimworks) for improving the documentation.
+
+### Fixed
+
+- [Fixed behavior of `addBusinessDays` when input date is a weekend day](https://github.com/date-fns/date-fns/pull/1790).
+- [Fixed `parseISO` not returning `Invalid Date` on incorrect string when there are spaces in it](https://github.com/date-fns/date-fns/pull/1791).
+- [Fixed `es` round-tripping dates with Wednesday](https://github.com/date-fns/date-fns/pull/1792).
+- [Fixed round-trip bug with `d`/`EEEE` ordering in tokens like `PPPPP`](https://github.com/date-fns/date-fns/pull/1795).
+- [Fixed issues with parsing values in Japanese](https://github.com/date-fns/date-fns/pull/1807).
+- [Fixed Hungarian breaking IE11](https://github.com/date-fns/date-fns/pull/1842).
+- [Fixed Spanish accents in Saturday and Wednesday](https://github.com/date-fns/date-fns/pull/1872).
+
+### Changed
+
+- [Improved the message of protected tokens error](https://github.com/date-fns/date-fns/pull/1641).
+
+### Added
+
+- [Added Swiss-French `fr-CH` locale](https://github.com/date-fns/date-fns/pull/1809).
+- [Added Flemish `nl-BE` locale](https://github.com/date-fns/date-fns/pull/1812).
+- [Added Scottish Gaelic `gd` locale](https://github.com/date-fns/date-fns/pull/1832).
+- [Added New Zealand English `en-NZ` locale](https://github.com/date-fns/date-fns/pull/1835).
+- [Added `isMatch` function](https://github.com/date-fns/date-fns/pull/1868).
+
+## [2.14.0] - 2020-05-18
+
+Kudos to [@julamb](https://github.com/julamb), [@JacobSoderblom](https://github.com/JacobSoderblom), [@justingrant](http://github.com/justingrant), [@dragunoff](https://github.com/dragunoff), [@jmate0321](https://github.com/jmate0321), [@gbhasha](https://github.com/gbhasha), [@rasck](https://github.com/rasck), [@AlbertoPdRF](https://github.com/AlbertoPdRF), [@sebastianhaberey](https://github.com/sebastianhaberey) and [@giogonzo](https://github.com/giogonzo) for working on the release!
+
+### Fixed
+
+- [Fixed DST issues with `add`, `addDays` and `addMonths`](https://github.com/date-fns/date-fns/pull/1760).
+- [Fixed "quarter" translation in the Bulgarian locale](https://github.com/date-fns/date-fns/pull/1763).
+- [Fixed `formatDistance` strings in the Hungarian locale](https://github.com/date-fns/date-fns/pull/1765).
+- [Fixed Danish month abbreviations](https://github.com/date-fns/date-fns/pull/1774).
+- [Fixed parsing of mei in the Dutch locale](https://github.com/date-fns/date-fns/pull/1774).
+- [Fixed missing preposition in `formatLong` in the Spanish locale](https://github.com/date-fns/date-fns/pull/1775).
+- [Fixed `formatRelative` in the Italian locale](https://github.com/date-fns/date-fns/pull/1777).
+
+### Added
+
+- [Added `eachQuarterOfInterval`](https://github.com/date-fns/date-fns/pull/1715).
+- [Added Basque (`eu`) locale](https://github.com/date-fns/date-fns/pull/1759).
+- [Added Indian English (`en-IN`) locale](https://github.com/date-fns/date-fns/pull/1767).
+- [Added `eachHourOfInterval`](https://github.com/date-fns/date-fns/pull/1776).
+
+## [2.13.0] - 2020-05-06
+
+Thanks to [@JorenVos](https://github.com/JorenVos), [@developergouli](https://github.com/developergouli), [@rhlowe](https://github.com/rhlowe) and [@justingrant](http://github.com/justingrant) for working on the release!
+
+### Fixed
+
+- [Fixed mei abbreviation in the Dutch locale](https://github.com/date-fns/date-fns/pull/1752).
+- [Fixed `differenceInDays` DST behavior broken in 2.12.0](https://github.com/date-fns/date-fns/pull/1754).
+
+### Added
+
+- [Added Kannada locale support](https://github.com/date-fns/date-fns/pull/1747).
+- [Added `formatISODuration` function](https://github.com/date-fns/date-fns/pull/1713).
+- [Added `intervalToDuration` function](https://github.com/date-fns/date-fns/pull/1713).
+
+## [2.12.0] - 2020-04-09
+
+Kudos to [@leshakoss](http://github.com/leshakoss), [@skyuplam](https://github.com/skyuplam), [@so99ynoodles](https://github.com/so99ynoodles), [@dkozickis](https://github.com/dkozickis), [@belgamo](https://github.com/belgamo), [@akgondber](https://github.com/akgondber), [@dcousens](https://github.com/dcousens) and [@BoomDev](https://github.com/BoomDev) for working on the release!
+
+### Fixed
+
+- [Fixed minulý štvrtok in Slovak locale](https://github.com/date-fns/date-fns/pull/1701).
+- Fixed date ordinalNumber for [ja/zh-CN/zh-TW](https://github.com/date-fns/date-fns/pull/1690) and [ko](https://github.com/date-fns/date-fns/pull/1696).
+- [Fixed quarters parsing](https://github.com/date-fns/date-fns/pull/1694).
+- [Fixed `setDay` with `weekStartsOn` != 0](https://github.com/date-fns/date-fns/pull/1639).
+- [Fixed differenceInDays across DST](https://github.com/date-fns/date-fns/pull/1630).
+- [Fixed required arguments exception message](https://github.com/date-fns/date-fns/pull/1674).
+
+### Added
+
+- [Added new function `formatDistanceToNowStrict`](https://github.com/date-fns/date-fns/pull/1679).
+
+## [2.11.1] - 2020-03-26
+
+### Fixed
+
+- Rebuilt TypeScript and flow types.
+
+## [2.11.0] - 2020-03-13
+
+Kudos to [@oakhan3](https://github.com/oakhan3), [@Mukhammadali](https://github.com/Mukhammadali), [@altrim](https://github.com/altrim), [@leepowellcouk](https://github.com/leepowellcouk), [@amatzon](@https://github.com/amatzon), [@bryanMt](https://github.com/bryanMt), [@kalekseev](https://github.com/kalekseev), [@eugene-platov](https://github.com/eugene-platov) and [@tjrobinson](https://github.com/tjrobinson) for working on the release.
+
+### Fixed
+
+- [Fixed a bug in `differenceInYears` causing incorrect results when the left date is a leap day](https://github.com/date-fns/date-fns/pull/1654).
+- [Fixed `parseISO` to work correctly around time shift dates](https://github.com/date-fns/date-fns/pull/1667).
+- [Fixed `format` to work correctly with GMT-0752/GMT-0456 and similar timezones](https://github.com/date-fns/date-fns/pull/1666).
+
+### Changed
+
+- [Changed `getDay` typings to return `0|1|2|3|4|5|6` instead of `number`](https://github.com/date-fns/date-fns/pull/1668).
+- [Improved Chinese locale](https://github.com/date-fns/date-fns/pull/1664):
+ - Change date format to meet the national standard (GB/T 7408-2005).
+ - Improve `ordinalNumber` function behavior.
+ - Add prefix in `formatRelative` depending on if it's a current week or not.
+
+### Added
+
+- [Added Uzbek `uz` locale](https://github.com/date-fns/date-fns/pull/1648).
+- [Updated Macedonian locale for v2](https://github.com/date-fns/date-fns/pull/1649).
+- [Added Maltese `mt` locale](https://github.com/date-fns/date-fns/pull/1658).
+
+## [2.10.0] - 2020-02-25
+
+### Fixed
+
+- [Fixed `formatISO` when formatting time with timezones with minute offsets > 0](https://github.com/date-fns/date-fns/pull/1599). Kudos to [@dcRUSTy](https://github.com/dcRUSTy).
+
+### Fixed
+
+- Fixed a bug in setDay when using weekStartsOn that is not 0
+
+### Added
+
+- [Added `weeks` to `Duration`](https://github.com/date-fns/date-fns/pull/1592).
+- [Added `weeks` support to `add` and `sub`](https://github.com/date-fns/date-fns/pull/1592).
+- [Added details message in `throwProtectedError`](https://github.com/date-fns/date-fns/pull/1592).
+
+## [2.9.0] - 2020-01-08
+
+Thanks to [@mborgbrant](https://github.com/mborgbrant), [@saintplay](https://github.com/saintplay), [@mrenty](https://github.com/mrenty), [@kibertoad](https://github.com/kibertoad), [@levibuzolic](https://github.com/levibuzolic), [@Anshuman71](https://github.com/Anshuman71), [@talgautb](https://github.com/talgautb), [@filipjuza](https://github.com/filipjuza), [@tobyzerner](https://github.com/tobyzerner), [@emil9453](https://github.com/emil9453), [@fintara](https://github.com/fintara), [@pascaliske](https://github.com/pascaliske), [@rramiachraf](https://github.com/rramiachraf), [@marnusw](https://github.com/marnusw) and [@Imballinst](https://github.com/Imballinst) for working on the release.
+
+### Fixed
+
+- [Fixed a bug with addBusinessDays returning the Tuesday when adding 1 day on weekends. Now it returns the Monday](https://github.com/date-fns/date-fns/pull/1588).
+- [Added missing timezone to `formatISO`](https://github.com/date-fns/date-fns/pull/1576).
+- [Removed dots from short day period names in the Kazakh locale](https://github.com/date-fns/date-fns/pull/1512).
+- [Fixed typo in formatDistance in the Czech locale](https://github.com/date-fns/date-fns/pull/1540).
+- [Fixed shortenings in the Bulgarian locale](https://github.com/date-fns/date-fns/pull/1560).
+- [Fixed regex for the May in the Portuguese locale](https://github.com/date-fns/date-fns/pull/1565).
+
+### Added
+
+- [Added `eachMonthOfInterval` and `eachYearOfInterval`](https://github.com/date-fns/date-fns/pull/618).
+- [Added `inclusive` option to `areIntervalsOverlapping](https://github.com/date-fns/date-fns/pull/643).
+- [Added `isExists` function that checks if the given date is exists](https://github.com/date-fns/date-fns/pull/682).
+- [Added `add` function to add seconds, minutes, hours, weeks, years in single call](https://github.com/date-fns/date-fns/pull/1581).
+- [Added `sub` function, the opposite of `add`](https://github.com/date-fns/date-fns/pull/1583).
+- [Added `Duration` type used in `add` and `sub`](https://github.com/date-fns/date-fns/pull/1583).
+- [Added Azerbaijani (az) locale](https://github.com/date-fns/date-fns/pull/1547).
+- [Added Moroccan Arabic (ar-MA) locale](https://github.com/date-fns/date-fns/pull/1578).
+
+### Changed
+
+- [Reduced the total minified build size by 1Kb/4%](https://github.com/date-fns/date-fns/pull/1563).
+- [Made all properties in `Locale` type optional](https://github.com/date-fns/date-fns/pull/1542).
+- [Added missing properties to `Locale` type](https://github.com/date-fns/date-fns/pull/1542).
+- [Add the locale code to `Locale` type](https://github.com/date-fns/date-fns/pull/1580).
+- [Added support of space time separator to `parseJSON`](https://github.com/date-fns/date-fns/pull/1579).
+- [Allowed up to 7 digits in milliseconds in `parseJSON`](https://github.com/date-fns/date-fns/pull/1579).
+
+## [2.8.1] - 2019-11-22
+
+Thanks to [@Imballinst](https://github.com/Imballinst) for the bug fix!
+
+### Fixed
+
+- [Add colon between the hour and minutes for `formatRFC3339`](https://github.com/date-fns/date-fns/pull/1549). [See #1548](https://github.com/date-fns/date-fns/issues/1548).
+
+## [2.8.0] - 2019-11-19
+
+Kudos to [@NaridaL](https://github.com/NaridaL), [@Zyten](https://github.com/Zyten), [@Imballinst](https://github.com/Imballinst), [@leshakoss](https://github.com/leshakoss) and [@Neorth](https://github.com/Neorth) for working on the release.
+
+### Fixed
+
+- [Remove the next week preposition in the Swedish locale](https://github.com/date-fns/date-fns/pull/1538).
+
+### Added
+
+- [Added Malay (ms) locale](https://github.com/date-fns/date-fns/pull/1537).
+- [Added `formatISO`, `formatISO9075`, `formatRFC3339`, and `formatRFC7231` functions](https://github.com/date-fns/date-fns/pull/1536).
+
+## [2.7.0] - 2019-11-07
+
+Thanks to [@mzgajner](https://github.com/mzgajner), [@NaridaL](https://github.com/NaridaL), [@Zyten](https://github.com/Zyten), [@leshakoss](https://github.com/leshakoss), [@fintara](https://github.com/fintara), [@kpr-hellofresh](https://github.com/kpr-hellofresh) for contributing to the release.
+
+### Fixed
+
+- [Fixed a mistake in the Slovenian locale](https://github.com/date-fns/date-fns/pull/1529).
+- [Fixed incorrect behavior of `parseISO` in Firefox caused by differences in `getTimezoneOffset`](https://github.com/date-fns/date-fns/pull/1495).
+
+### Changed
+
+- [Make object arguments types more elaborate in Flow type definitions](https://github.com/date-fns/date-fns/pull/1519).
+- [Get rid of deprecated Function in Flow type definitions](https://github.com/date-fns/date-fns/pull/1520).
+- [Allow `parseJSON` to accept strings without trailing 'Z' symbol and with up to 6 digits in the milliseconds' field](https://github.com/date-fns/date-fns/pull/1499).
+
+### Added
+
+- [Added Bulgarian (bg) locale](https://github.com/date-fns/date-fns/pull/1522).
+
+## [2.6.0] - 2019-10-22
+
+Kudos to [@marnusw](https://github.com/marnusw), [@cdrikd](https://github.com/cdrikd) and [@rogyvoje](https://github.com/rogyvoje) for working on the release!
+
+### Added
+
+- [Added `parseJSON` - lightweight function (just 411 B) that parses dates formatted with `toJSON`](https://github.com/date-fns/date-fns/pull/1463).
+- [Added the language code to each locale](https://github.com/date-fns/date-fns/pull/1489).
+- [Added `subBusinessDays` function](https://github.com/date-fns/date-fns/pull/1491).
+- [Added both Serbian - cyrillic (sr) and latin (sr-Latn) locales](https://github.com/date-fns/date-fns/pull/1494).
+
+## [2.5.1] - 2019-10-18
+
+Thanks to [@mitchellbutler](https://github.com/mitchellbutler) for the bug fix!
+
+### Fixed
+
+- [Fixed infinite loop in `addBusinessDays`](https://github.com/date-fns/date-fns/pull/1486).
+
+## [2.5.0] - 2019-10-16
+
+Kudos to [@dkozickis](https://github.com/dkozickis), [@drugoi](https://github.com/drugoi), [@kranthilakum](https://github.com/kranthilakum), [@102](https://github.com/102), [@gpetrioli](https://github.com/gpetrioli) and [@JulienMalige](https://github.com/JulienMalige) for making the release happen.
+
+### Fixed
+
+- [Fixed compatibility with IE11 by removing `findIndex` from the code](https://github.com/date-fns/date-fns/pull/1457).
+- [Fixed Greek locale patterns](https://github.com/date-fns/date-fns/pull/1480).
+
+### Added
+
+- [Added Kazakh (kk) locale](https://github.com/date-fns/date-fns/pull/1460).
+- [Added Telugu (te) locale](https://github.com/date-fns/date-fns/pull/1464).
+- [Added Canadian French (fr-CA) locale](https://github.com/date-fns/date-fns/issues/1465).
+- [Added Australian English (en-AU) locale](https://github.com/date-fns/date-fns/pull/1470).
+- [Exported `Interval` and `Locale` types from Flow typings](https://github.com/date-fns/date-fns/pull/1475).
+
+## [2.4.1] - 2019-09-28
+
+Thanks to [@mrclayman](https://github.com/mrclayman) for reporting the issue and [@leshakoss](https://github.com/leshakoss) for fixing it.
+
+### Fixed
+
+- [Fixed am/pm mixup in the Czech locale](https://github.com/date-fns/date-fns/pull/1453).
+
+## [2.4.0] - 2019-09-27
+
+This release is brought to you by these amazing people: [@lovelovedokidoki](https://github.com/lovelovedokidoki), [@alexigityan](https://github.com/alexigityan), [@kalekseev](https://github.com/kalekseev) and [@andybangs](https://github.com/andybangs). You rock!
+
+### Fixed
+
+- [Fixed Vietnamese parsing patterns](https://github.com/date-fns/date-fns/pull/1445).
+- [Fixed Czech parsing regexes](https://github.com/date-fns/date-fns/pull/1446).
+- [Fixed offset for Eastern Hemisphere in `parseISO`](https://github.com/date-fns/date-fns/pull/1450).
+
+### Added
+
+- [Added Armenian locale support](https://github.com/date-fns/date-fns/pull/1448).
+
+## [2.3.0] - 2019-09-24
+
+Huge thanks to [@lovelovedokidoki](https://github.com/lovelovedokidoki) who improved 8 (!) locales in an unstoppable open-source rampage and [@VesterDe](https://github.com/VesterDe) for fixing Slovenian locale 👏
+
+### Fixed
+
+- [Fixed the translation of "yesterday" in the Slovenian locale](https://github.com/date-fns/date-fns/pull/1420).
+- [Fixed French parsing issues with June and August](https://github.com/date-fns/date-fns/pull/1430).
+- [Improved Turkish parsing](https://github.com/date-fns/date-fns/pull/1432).
+- [Fixed "March" in Dutch parsing patterns](https://github.com/date-fns/date-fns/pull/1433).
+- [Fixed Hindi parsing patterns](https://github.com/date-fns/date-fns/pull/1434).
+
+### Added
+
+- [Added Finnish matching patterns](https://github.com/date-fns/date-fns/pull/1425).
+- [Accept abbreviated March, June, July in Norwegian locales](https://github.com/date-fns/date-fns/pull/1431).
+- [Added parsing for Greek months with long formatting](https://github.com/date-fns/date-fns/pull/1435).
+
+## [2.2.1] - 2019-09-12
+
+Kudos to date-fns contributors: [@mzgajner](https://github.com/mzgajner), [@sibiraj-s](https://github.com/sibiraj-s), [@mukeshmandiwal](https://github.com/mukeshmandiwal), [@SneakyFish5](https://github.com/SneakyFish5) and [@CarterLi](https://github.com/CarterLi).
+
+### Added
+
+- [Added new `set` function](https://github.com/date-fns/date-fns/pull/1398).
+- [Updated Slovenian (sl) locale for v2](https://github.com/date-fns/date-fns/pull/1418).
+- [Added Tamil (ta) locale](https://github.com/date-fns/date-fns/pull/1411).
+- [Added Hindi (hi) locale](https://github.com/date-fns/date-fns/pull/1409).
+- [Added support of `\n` in `format`, `lightFormat` and `parse`](https://github.com/date-fns/date-fns/pull/1417).
+
+## [2.1.0] - 2019-09-06
+
+Thanks to date-fns contributors: [@ManadayM](https://github.com/ManadayM), [@illuminist](https://github.com/illuminist), [@visualfanatic](https://github.com/visualfanatic), [@vsaarinen](https://github.com/vsaarinen) and at last but not the least [@leshakoss](https://github.com/leshakoss)!
+
+### Fixed
+
+- [Set start of the week to Sunday for Thai locale](https://github.com/date-fns/date-fns/pull/1402).
+- [Fixed month matching in Polish locale](https://github.com/date-fns/date-fns/pull/1404).
+- [Fixed `eachWeekendOfInterval` skipping the first date in the supplied interval](https://github.com/date-fns/date-fns/pull/1407).
+
+### Added
+
+- [Added Gujarati locale](https://github.com/date-fns/date-fns/pull/1400).
+
+## [2.0.1] - 2019-08-23
+
+### Fixed
+
+- [Fix](https://github.com/date-fns/date-fns/pull/1046) `getWeekOfMonth` with `options.weekStartsOn` set to 1 [not working for Sundays](https://github.com/date-fns/date-fns/issues/1040). Kudos to [@waseemahmad31](https://github.com/waseemahmad31)!
+
+## [2.0.0] - 2019-08-20
+
+If you're upgrading from v2 alpha or beta, [see the pre-release changelog](https://gist.github.com/kossnocorp/a307a464760b405bb78ef5020a4ab136).
+
+### Fixed
+
+- Fixed the `toDate` bug occurring when parsing ISO-8601 style dates (but not valid ISO format)
+ with a trailing Z (e.g `2012-01Z`), it returned Invalid Date for FireFox/IE11 [#510](https://github.com/date-fns/date-fns/issue/510)
+
+- Fixed `differenceIn...` functions returning negative zero in some cases:
+ [#692](https://github.com/date-fns/date-fns/issues/692)
+
+- `isDate` now works properly with dates passed across iframes [#754](https://github.com/date-fns/date-fns/pull/754).
+
+- Fixed a few bugs that appeared in timezones with offsets that include seconds (e.g. GMT+00:57:44).
+ See PR [#789](https://github.com/date-fns/date-fns/pull/789).
+
+- [Fixed DST issue](https://github.com/date-fns/date-fns/pull/1003). See [#972](https://github.com/date-fns/date-fns/issues/972) and [#992](https://github.com/date-fns/date-fns/issues/992) for more details.
+
+- Fixed DST issue in `eachDayOfInterval` that caused time in the days
+ after DST change to have the shift as well.
+
+- Fixed bug in Galician locale caused by incorrect usage of `getHours`
+ instead of `getUTCHours`.
+
+### Changed
+
+- **BREAKING**: now functions don't accept string arguments, but only
+ numbers or dates. When a string is passed, it will result in
+ an unexpected result (`Invalid Date`, `NaN`, etc).
+
+ From now on a string should be parsed using `parseISO` (ISO 8601)
+ or `parse`.
+
+ In v1 we've used `new Date()` to parse strings, but it resulted in many
+ hard-to-track bugs caused by inconsistencies in different browsers.
+ To address that we've implemented our ISO 8601 parser but that made
+ library to significantly grow in size. To prevent inevitable bugs
+ and keep the library tiny, we made this trade-off.
+
+ See [this post](https://blog.date-fns.org/post/we-cut-date-fns-v2-minimal-build-size-down-to-300-bytes-and-now-its-the-smallest-date-library-18f2nvh2z0yal) for more details.
+
+ ```javascript
+ // Before v2.0.0
+ addDays("2016-01-01", 1);
+
+ // v2.0.0 onward
+ addDays(parseISO("2016-01-01"), 1);
+ ```
+
+- **BREAKING**: new format string API for `format` function
+ which is based on [Unicode Technical Standard #35](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).
+ See [this post](https://blog.date-fns.org/post/unicode-tokens-in-date-fns-v2-sreatyki91jg) for more details.
+
+ | Unit | v2 Pattern | v1 Pattern | Result examples |
+ | ------------------------------- | ---------- | ---------- | --------------------------------- |
+ | Era | G..GGG | | AD, BC |
+ | | GGGG | | Anno Domini, Before Christ |
+ | | GGGGG | | A, B |
+ | Calendar year | y | | 44, 1, 1900, 2017 |
+ | | yo | | 44th, 1st, 0th, 17th |
+ | | yy | YY | 44, 01, 00, 17 |
+ | | yyy | | 044, 001, 1900, 2017 |
+ | | yyyy | YYYY | 0044, 0001, 1900, 2017 |
+ | | yyyyy | | ... |
+ | Local week-numbering year | Y | | 44, 1, 1900, 2017 |
+ | | Yo | | 44th, 1st, 1900th, 2017th |
+ | | YY | | 44, 01, 00, 17 |
+ | | YYY | | 044, 001, 1900, 2017 |
+ | | YYYY | | 0044, 0001, 1900, 2017 |
+ | | YYYYY | | ... |
+ | ISO week-numbering year | R | | -43, 0, 1, 1900, 2017 |
+ | | RR | GG | -43, 00, 01, 1900, 2017 |
+ | | RRR | | -043, 000, 001, 1900, 2017 |
+ | | RRRR | GGGG | -0043, 0000, 0001, 1900, 2017 |
+ | | RRRRR | | ... |
+ | Extended year | u | | -43, 0, 1, 1900, 2017 |
+ | | uu | | -43, 01, 1900, 2017 |
+ | | uuu | | -043, 001, 1900, 2017 |
+ | | uuuu | | -0043, 0001, 1900, 2017 |
+ | | uuuuu | | ... |
+ | Quarter (formatting) | Q | | 1, 2, 3, 4 |
+ | | Qo | | 1st, 2nd, 3rd, 4th |
+ | | QQ | | 01, 02, 03, 04 |
+ | | QQQ | | Q1, Q2, Q3, Q4 |
+ | | QQQQ | | 1st quarter, 2nd quarter, ... |
+ | | QQQQQ | | 1, 2, 3, 4 |
+ | Quarter (stand-alone) | q | Q | 1, 2, 3, 4 |
+ | | qo | Qo | 1st, 2nd, 3rd, 4th |
+ | | qq | | 01, 02, 03, 04 |
+ | | qqq | | Q1, Q2, Q3, Q4 |
+ | | qqqq | | 1st quarter, 2nd quarter, ... |
+ | | qqqqq | | 1, 2, 3, 4 |
+ | Month (formatting) | M | | 1, 2, ..., 12 |
+ | | Mo | | 1st, 2nd, ..., 12th |
+ | | MM | | 01, 02, ..., 12 |
+ | | MMM | | Jan, Feb, ..., Dec |
+ | | MMMM | | January, February, ..., December |
+ | | MMMMM | | J, F, ..., D |
+ | Month (stand-alone) | L | M | 1, 2, ..., 12 |
+ | | Lo | | 1st, 2nd, ..., 12th |
+ | | LL | MM | 01, 02, ..., 12 |
+ | | LLL | MMM | Jan, Feb, ..., Dec |
+ | | LLLL | MMMM | January, February, ..., December |
+ | | LLLLL | | J, F, ..., D |
+ | Local week of year | w | | 1, 2, ..., 53 |
+ | | wo | | 1st, 2nd, ..., 53th |
+ | | ww | | 01, 02, ..., 53 |
+ | ISO week of year | I | W | 1, 2, ..., 53 |
+ | | Io | Wo | 1st, 2nd, ..., 53th |
+ | | II | WW | 01, 02, ..., 53 |
+ | Day of month | d | D | 1, 2, ..., 31 |
+ | | do | Do | 1st, 2nd, ..., 31st |
+ | | dd | DD | 01, 02, ..., 31 |
+ | Day of year | D | DDD | 1, 2, ..., 365, 366 |
+ | | Do | DDDo | 1st, 2nd, ..., 365th, 366th |
+ | | DD | | 01, 02, ..., 365, 366 |
+ | | DDD | DDDD | 001, 002, ..., 365, 366 |
+ | | DDDD | | ... |
+ | Day of week (formatting) | E..EEE | | Mon, Tue, Wed, ..., Su |
+ | | EEEE | | Monday, Tuesday, ..., Sunday |
+ | | EEEEE | | M, T, W, T, F, S, S |
+ | | EEEEEE | | Mo, Tu, We, Th, Fr, Sa, Su |
+ | ISO day of week (formatting) | i | E | 1, 2, 3, ..., 7 |
+ | | io | do | 1st, 2nd, ..., 7th |
+ | | ii | | 01, 02, ..., 07 |
+ | | iii | ddd | Mon, Tue, Wed, ..., Su |
+ | | iiii | dddd | Monday, Tuesday, ..., Sunday |
+ | | iiiii | | M, T, W, T, F, S, S |
+ | | iiiiii | dd | Mo, Tu, We, Th, Fr, Sa, Su |
+ | Local day of week (formatting) | e | | 2, 3, 4, ..., 1 |
+ | | eo | | 2nd, 3rd, ..., 1st |
+ | | ee | | 02, 03, ..., 01 |
+ | | eee | | Mon, Tue, Wed, ..., Su |
+ | | eeee | | Monday, Tuesday, ..., Sunday |
+ | | eeeee | | M, T, W, T, F, S, S |
+ | | eeeeee | | Mo, Tu, We, Th, Fr, Sa, Su |
+ | Local day of week (stand-alone) | c | | 2, 3, 4, ..., 1 |
+ | | co | | 2nd, 3rd, ..., 1st |
+ | | cc | | 02, 03, ..., 01 |
+ | | ccc | | Mon, Tue, Wed, ..., Su |
+ | | cccc | | Monday, Tuesday, ..., Sunday |
+ | | ccccc | | M, T, W, T, F, S, S |
+ | | cccccc | | Mo, Tu, We, Th, Fr, Sa, Su |
+ | AM, PM | a..aaa | A | AM, PM |
+ | | aaaa | aa | a.m., p.m. |
+ | | aaaaa | | a, p |
+ | AM, PM, noon, midnight | b..bbb | | AM, PM, noon, midnight |
+ | | bbbb | | a.m., p.m., noon, midnight |
+ | | bbbbb | | a, p, n, mi |
+ | Flexible day period | B..BBB | | at night, in the morning, ... |
+ | | BBBB | | at night, in the morning, ... |
+ | | BBBBB | | at night, in the morning, ... |
+ | Hour [1-12] | h | | 1, 2, ..., 11, 12 |
+ | | ho | | 1st, 2nd, ..., 11th, 12th |
+ | | hh | | 01, 02, ..., 11, 12 |
+ | Hour [0-23] | H | | 0, 1, 2, ..., 23 |
+ | | Ho | | 0th, 1st, 2nd, ..., 23rd |
+ | | HH | | 00, 01, 02, ..., 23 |
+ | Hour [0-11] | K | | 1, 2, ..., 11, 0 |
+ | | Ko | | 1st, 2nd, ..., 11th, 0th |
+ | | KK | | 1, 2, ..., 11, 0 |
+ | Hour [1-24] | k | | 24, 1, 2, ..., 23 |
+ | | ko | | 24th, 1st, 2nd, ..., 23rd |
+ | | kk | | 24, 01, 02, ..., 23 |
+ | Minute | m | | 0, 1, ..., 59 |
+ | | mo | | 0th, 1st, ..., 59th |
+ | | mm | | 00, 01, ..., 59 |
+ | Second | s | | 0, 1, ..., 59 |
+ | | so | | 0th, 1st, ..., 59th |
+ | | ss | | 00, 01, ..., 59 |
+ | Fraction of second | S | | 0, 1, ..., 9 |
+ | | SS | | 00, 01, ..., 99 |
+ | | SSS | | 000, 0001, ..., 999 |
+ | | SSSS | | ... |
+ | Timezone (ISO-8601 w/ Z) | X | | -08, +0530, Z |
+ | | XX | | -0800, +0530, Z |
+ | | XXX | | -08:00, +05:30, Z |
+ | | XXXX | | -0800, +0530, Z, +123456 |
+ | | XXXXX | | -08:00, +05:30, Z, +12:34:56 |
+ | Timezone (ISO-8601 w/o Z) | x | | -08, +0530, +00 |
+ | | xx | ZZ | -0800, +0530, +0000 |
+ | | xxx | Z | -08:00, +05:30, +00:00 |
+ | | xxxx | | -0800, +0530, +0000, +123456 |
+ | | xxxxx | | -08:00, +05:30, +00:00, +12:34:56 |
+ | Timezone (GMT) | O...OOO | | GMT-8, GMT+5:30, GMT+0 |
+ | | OOOO | | GMT-08:00, GMT+05:30, GMT+00:00 |
+ | Timezone (specific non-locat.) | z...zzz | | GMT-8, GMT+5:30, GMT+0 |
+ | | zzzz | | GMT-08:00, GMT+05:30, GMT+00:00 |
+ | Seconds timestamp | t | X | 512969520 |
+ | | tt | | ... |
+ | Milliseconds timestamp | T | x | 512969520900 |
+ | | TT | | ... |
+ | Long localized date | P | | 5/29/53 |
+ | | PP | | May 29, 1453 |
+ | | PPP | | May 29th, 1453 |
+ | | PPPP | | Sunday, May 29th, 1453 |
+ | Long localized time | p | | 12:00 AM |
+ | | pp | | 12:00:00 AM |
+ | | ppp | | 12:00:00 AM GMT+2 |
+ | | pppp | | 12:00:00 AM GMT+02:00 |
+ | Combination of date and time | Pp | | 5/29/53, 12:00 AM |
+ | | PPpp | | May 29, 1453, 12:00 AM |
+ | | PPPppp | | May 29th, 1453 at ... |
+ | | PPPPpppp | | Sunday, May 29th, 1453 at ... |
+
+ Characters are now escaped using single quote symbols (`'`) instead of square brackets.
+ `format` now throws RangeError if it encounters an unescaped latin character
+ that isn't a valid formatting token.
+
+ To use `YY` and `YYYY` tokens that represent week-numbering years,
+ you should set `useAdditionalWeekYearTokens` option:
+
+ ```javascript
+ format(Date.now(), "YY", { useAdditionalWeekYearTokens: true });
+ //=> '86'
+ ```
+
+ To use `D` and `DD` tokens which represent days of the year,
+ set `useAdditionalDayOfYearTokens` option:
+
+ ```javascript
+ format(Date.now(), "D", { useAdditionalDayOfYearTokens: true });
+ //=> '364'
+ ```
+
+- **BREAKING**: function submodules now use camelCase naming schema:
+
+ ```javascript
+ // Before v2.0.0
+ import differenceInCalendarISOYears from "date-fns/difference_in_calendar_iso_years";
+
+ // v2.0.0 onward
+ import differenceInCalendarISOYears from "date-fns/differenceInCalendarISOYears";
+ ```
+
+- **BREAKING**: min and max functions now accept an array of dates
+ rather than spread arguments.
+
+ ```javascript
+ // Before v2.0.0
+ var date1 = new Date(1989, 6 /* Jul */, 10);
+ var date2 = new Date(1987, 1 /* Feb */, 11);
+
+ var minDate = min(date1, date2);
+ var maxDate = max(date1, date2);
+
+ // v2.0.0 onward:
+ var dates = [
+ new Date(1989, 6 /* Jul */, 10),
+ new Date(1987, 1 /* Feb */, 11),
+ ];
+
+ var minDate = min(dates);
+ var maxDate = max(dates);
+ ```
+
+- **BREAKING**: make the second argument of `format` required for the sake of explicitness.
+
+ ```javascript
+ // Before v2.0.0
+ format(new Date(2016, 0, 1));
+
+ // v2.0.0 onward
+ format(new Date(2016, 0, 1), "yyyy-MM-dd'T'HH:mm:ss.SSSxxx");
+ ```
+
+- **BREAKING** renamed ISO week-numbering year helpers:
+
+ - `addISOYears` → `addISOWeekYears`
+ - `differenceInCalendarISOYears` → `differenceInCalendarISOWeekYears`
+ - `differenceInISOYears` → `differenceInISOWeekYears`
+ - `endOfISOYear` → `endOfISOWeekYear`
+ - `getISOYear` → `getISOWeekYear`
+ - `isSameISOYear` → `isSameISOWeekYear`
+ - `lastDayOfISOYear` → `lastDayOfISOWeekYear`
+ - `setISOYear` → `setISOWeekYear`
+ - `subISOYears` → `subISOWeekYears`
+
+ i.e. "ISO year" renamed to "ISO week year", which is short for
+ [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).
+ It makes them consistent with locale-dependent week-numbering year helpers,
+ e.g., `startOfWeekYear`.
+
+- **BREAKING**: functions renamed:
+
+ - `areRangesOverlapping` → `areIntervalsOverlapping`
+ - `eachDay` → `eachDayOfInterval`
+ - `getOverlappingDaysInRanges` → `getOverlappingDaysInIntervals`
+ - `isWithinRange` → `isWithinInterval`
+
+ This change was made to mirror the use of the word "interval" in standard ISO 8601:2004 terminology:
+
+ ```
+ 2.1.3
+ time interval
+ part of the time axis limited by two instants
+ ```
+
+ Also these functions now accept an object with `start` and `end` properties
+ instead of two arguments as an interval. All these functions
+ throw `RangeError` if the start of the interval is after its end
+ or if any date in the interval is `Invalid Date`.
+
+ ```javascript
+ // Before v2.0.0
+
+ areRangesOverlapping(
+ new Date(2014, 0, 10),
+ new Date(2014, 0, 20),
+ new Date(2014, 0, 17),
+ new Date(2014, 0, 21),
+ );
+
+ eachDay(new Date(2014, 0, 10), new Date(2014, 0, 20));
+
+ getOverlappingDaysInRanges(
+ new Date(2014, 0, 10),
+ new Date(2014, 0, 20),
+ new Date(2014, 0, 17),
+ new Date(2014, 0, 21),
+ );
+
+ isWithinRange(
+ new Date(2014, 0, 3),
+ new Date(2014, 0, 1),
+ new Date(2014, 0, 7),
+ );
+
+ // v2.0.0 onward
+
+ areIntervalsOverlapping(
+ { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
+ { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) },
+ );
+
+ eachDayOfInterval({
+ start: new Date(2014, 0, 10),
+ end: new Date(2014, 0, 20),
+ });
+
+ getOverlappingDaysInIntervals(
+ { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
+ { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) },
+ );
+
+ isWithinInterval(new Date(2014, 0, 3), {
+ start: new Date(2014, 0, 1),
+ end: new Date(2014, 0, 7),
+ });
+ ```
+
+- **BREAKING**: functions renamed:
+
+ - `distanceInWords` → `formatDistance`
+ - `distanceInWordsStrict` → `formatDistanceStrict`
+ - `distanceInWordsToNow` → `formatDistanceToNow`
+
+ to make them consistent with `format` and `formatRelative`.
+
+- **BREAKING**: The order of arguments of `distanceInWords` and `distanceInWordsStrict`
+ is swapped to make them consistent with `differenceIn...` functions.
+
+ ```javascript
+ // Before v2.0.0
+
+ distanceInWords(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 11, 32, 0),
+ { addSuffix: true },
+ ); //=> 'in about 1 hour'
+
+ // v2.0.0 onward
+
+ formatDistance(
+ new Date(1986, 3, 4, 11, 32, 0),
+ new Date(1986, 3, 4, 10, 32, 0),
+ { addSuffix: true },
+ ); //=> 'in about 1 hour'
+ ```
+
+- **BREAKING**: `partialMethod` option in `formatDistanceStrict` is renamed to `roundingMethod`.
+
+ ```javascript
+ // Before v2.0.0
+
+ distanceInWordsStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 33, 1),
+ { partialMethod: "ceil" },
+ ); //=> '2 minutes'
+
+ // v2.0.0 onward
+
+ formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 33, 1),
+ new Date(1986, 3, 4, 10, 32, 0),
+ { roundingMethod: "ceil" },
+ ); //=> '2 minutes'
+ ```
+
+- **BREAKING**: in `formatDistanceStrict`, if `roundingMethod` is not specified,
+ it now defaults to `round` instead of `floor`.
+
+- **BREAKING**: `unit` option in `formatDistanceStrict` now accepts one of the strings:
+ 'second', 'minute', 'hour', 'day', 'month' or 'year' instead of 's', 'm', 'h', 'd', 'M' or 'Y'
+
+ ```javascript
+ // Before v2.0.0
+
+ distanceInWordsStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 33, 1),
+ { unit: "m" },
+ );
+
+ // v2.0.0 onward
+
+ formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 33, 1),
+ new Date(1986, 3, 4, 10, 32, 0),
+ { unit: "minute" },
+ );
+ ```
+
+- **BREAKING**: `parse` that previously used to convert strings and
+ numbers to dates now parses only strings in an arbitrary format
+ specified as an argument. Use `toDate` to coerce numbers and `parseISO`
+ to parse ISO 8601 strings.
+
+ ```javascript
+ // Before v2.0.0
+ parse("2016-01-01");
+ parse(1547005581366);
+ parse(new Date()); // Clone the date
+
+ // v2.0.0 onward
+ parse("2016-01-01", "yyyy-MM-dd", new Date());
+ parseISO("2016-01-01");
+ toDate(1547005581366);
+ toDate(new Date()); // Clone the date
+ ```
+
+- **BREAKING**: `toDate` (previously `parse`) now doesn't accept string
+ arguments but only numbers and dates. `toDate` called with an invalid
+ argument will return `Invalid Date`.
+
+- **BREAKING**: new locale format.
+ See [docs/Locale](https://date-fns.org/docs/Locale).
+ Locales renamed:
+
+ - `en` → `en-US`
+ - `zh_cn` → `zh-CN`
+ - `zh_tw` → `zh-TW`
+
+ ```javascript
+ // Before v2.0.0
+ import locale from "date-fns/locale/zh_cn";
+
+ // v2.0.0 onward
+ import locale from "date-fns/locale/zh-CN";
+ ```
+
+- **BREAKING**: now `closestTo` and `closestIndexTo` don't throw an exception
+ when the second argument is not an array, and return Invalid Date instead.
+
+- **BREAKING**: now `isValid` doesn't throw an exception
+ if the first argument is not an instance of Date.
+ Instead, argument is converted beforehand using `toDate`.
+
+ Examples:
+
+ | `isValid` argument | Before v2.0.0 | v2.0.0 onward |
+ | ------------------------- | ------------- | ------------- |
+ | `new Date()` | `true` | `true` |
+ | `new Date('2016-01-01')` | `true` | `true` |
+ | `new Date('')` | `false` | `false` |
+ | `new Date(1488370835081)` | `true` | `true` |
+ | `new Date(NaN)` | `false` | `false` |
+ | `'2016-01-01'` | `TypeError` | `false` |
+ | `''` | `TypeError` | `false` |
+ | `1488370835081` | `TypeError` | `true` |
+ | `NaN` | `TypeError` | `false` |
+
+ We introduce this change to make _date-fns_ consistent with ECMAScript behavior
+ that try to coerce arguments to the expected type
+ (which is also the case with other _date-fns_ functions).
+
+- **BREAKING**: functions now throw `RangeError` if optional values passed to `options`
+ are not `undefined` or have expected values.
+ This change is introduced for consistency with ECMAScript standard library which does the same.
+
+- **BREAKING**: `format`, `formatDistance` (previously `distanceInWords`) and
+ `formatDistanceStrict` (previously `distanceInWordsStrict`) now throw
+ `RangeError` if one of the passed arguments is invalid. It reflects behavior of
+ `toISOString` and Intl API. See [#1032](https://github.com/date-fns/date-fns/pull/1032).
+
+- **BREAKING**: all functions now implicitly convert arguments by following rules:
+
+ | | date | number | string | boolean |
+ | --------- | ------------ | ------ | ----------- | ------- |
+ | 0 | new Date(0) | 0 | '0' | false |
+ | '0' | Invalid Date | 0 | '0' | false |
+ | 1 | new Date(1) | 1 | '1' | true |
+ | '1' | Invalid Date | 1 | '1' | true |
+ | true | Invalid Date | NaN | 'true' | true |
+ | false | Invalid Date | NaN | 'false' | false |
+ | null | Invalid Date | NaN | 'null' | false |
+ | undefined | Invalid Date | NaN | 'undefined' | false |
+ | NaN | Invalid Date | NaN | 'NaN' | false |
+
+ Notes:
+
+ - as before, arguments expected to be `Date` are converted to `Date` using _date-fns'_ `toDate` function;
+ - arguments expected to be numbers are converted to integer numbers using our custom `toInteger` implementation
+ (see [#765](https://github.com/date-fns/date-fns/pull/765));
+ - arguments expected to be strings are converted to strings using JavaScript's `String` function;
+ - arguments expected to be booleans are converted to boolean using JavaScript's `Boolean` function.
+
+ `null` and `undefined` passed to optional arguments (i.e. properties of `options` argument)
+ are ignored as if no argument was passed.
+
+ If any resulting argument is invalid (i.e. `NaN` for numbers and `Invalid Date` for dates),
+ an invalid value will be returned:
+
+ - `false` for functions that return booleans (expect `isValid`);
+ - `Invalid Date` for functions that return dates;
+ - and `NaN` for functions that return numbers.
+
+ See tests and PRs [#460](https://github.com/date-fns/date-fns/pull/460) and
+ [#765](https://github.com/date-fns/date-fns/pull/765) for exact behavior.
+
+- **BREAKING**: all functions now check if the passed number of arguments is less
+ than the number of required arguments and will throw `TypeError` exception if so.
+
+- **BREAKING**: all functions that accept numbers as arguments, now coerce
+ values using `Number()` and also round off decimals. Positive decimals are
+ rounded using `Math.floor`, decimals less than zero are rounded using
+ `Math.ceil`.
+
+- **BREAKING**: The Bower & UMD/CDN package versions are no longer supported.
+
+- **BREAKING**: `null` now is not a valid date. `isValid(null)` returns `false`;
+ `toDate(null)` returns an invalid date. Since `toDate` is used internally
+ by all the functions, operations over `null` will also return an invalid date.
+ [See #537](https://github.com/date-fns/date-fns/issues/537) for the reasoning.
+
+- `toDate` (previously `parse`) and `isValid` functions now accept `any` type
+ as the first argument.
+
+- [Exclude `docs.json` from the npm package](https://github.com/date-fns/date-fns/pull/837). Kudos to [@hawkrives](https://github.com/hawkrives).
+
+### Added
+
+- FP functions like those in [lodash](https://github.com/lodash/lodash/wiki/FP-Guide),
+ that support [currying](https://en.wikipedia.org/wiki/Currying), and, as a consequence,
+ functional-style [function composing](https://medium.com/making-internets/why-using-chain-is-a-mistake-9bc1f80d51ba).
+
+ Functions with options (`format`, `parse`, etc.) have two FP counterparts:
+ one that has the options object as its first argument and one that hasn't.
+ The name of the former has `WithOptions` added to the end of its name.
+
+ In FP functions, the order of arguments is reversed.
+
+ See [FP Guide](https://date-fns.org/docs/FP-Guide) for more information.
+
+ ```javascript
+ import addYears from "date-fns/fp/addYears";
+ import formatWithOptions from "date-fns/fp/formatWithOptions";
+ import eo from "date-fns/locale/eo";
+
+ // If FP function has not received enough arguments, it returns another function
+ const addFiveYears = addYears(5);
+
+ // Several arguments can be curried at once
+ const dateToString = formatWithOptions({ locale: eo }, "d MMMM yyyy");
+
+ const dates = [
+ new Date(2017, 0 /* Jan */, 1),
+ new Date(2017, 1 /* Feb */, 11),
+ new Date(2017, 6 /* Jul */, 2),
+ ];
+
+ const formattedDates = dates.map((date) => dateToString(addFiveYears(date)));
+ //=> ['1 januaro 2022', '11 februaro 2022', '2 julio 2022']
+ ```
+
+- Added support for [ECMAScript Modules](http://www.ecma-international.org/ecma-262/6.0/#sec-modules).
+
+ It allows usage with bundlers that support tree-shaking,
+ like [rollup.js](http://rollupjs.org) and [webpack](https://webpack.js.org):
+
+ ```javascript
+ // Without tree-shaking:
+ import format from "date-fns/format";
+ import parse from "date-fns/parse";
+
+ // With tree-shaking:
+ import { format, parse } from "date-fns";
+ ```
+
+ Also, ESM functions provide default export, they can be used with TypeScript
+ to import functions in more idiomatic way:
+
+ ```typescript
+ // Before
+ import * as format from "date-fns/format";
+
+ // Now
+ import format from "date-fns/format";
+ ```
+
+- `formatRelative` function. See [formatRelative](https://date-fns.org/docs/formatRelative)
+
+- Flow typings for `index.js`, `fp/index.js`, `locale/index.js`, and their ESM equivalents.
+ See PR [#558](https://github.com/date-fns/date-fns/pull/558)
+
+- New locale-dependent week-numbering year helpers:
+
+ - `getWeek`
+
+ - `getWeekYear`
+
+ - `setWeek`
+
+ - `setWeekYear`
+
+ - `startOfWeekYear`
+
+- Added `eachWeekOfInterval`, the weekly equivalent of `eachDayOfInterval`
+
+- [Added `getUnixTime` function](https://github.com/date-fns/date-fns/pull/870). Kudos to [@Kingwl](https://github.com/Kingwl).
+
+- [New decade helpers](https://github.com/date-fns/date-fns/pull/839). Thanks to [@y-nk](https://github.com/y-nk)!
+
+ - `getDecade`
+
+ - `startOfDecade`
+
+ - `endOfDecade`
+
+ - `lastDayOfDecade`
+
+- [New `roundToNearestMinutes` function](https://github.com/date-fns/date-fns/pull/928). Kudos to [@xkizer](https://github.com/xkizer).
+
+- Added new function `fromUnixTime`. Thanks to [@xkizer](https://github.com/xkizer).
+
+- New interval, month, and year helpers to fetch a list of all Saturdays and Sundays (weekends) for a given date interval. `eachWeekendOfInterval` is the handler function while the other two are wrapper functions. Kudos to [@laekettavong](https://github.com/laekettavong)!
+
+ - `eachWeekendOfInterval`
+
+ - `eachWeekendOfMonth`
+
+ - `eachWeekendOfYear`
+
+- Build-efficient `lightFormat` that only supports the popular subset of tokens. See [#1050](https://github.com/date-fns/date-fns/pull/1015).
+
+- `parseISO` function that parses ISO 8601 strings. See [#1023](https://github.com/date-fns/date-fns/pull/1023).
+
+- Add constants that can be imported directly from `date-fns` or the submodule `date-fns/constants`:
+
+ - `maxTime`
+
+ - `minTime`
+
+- New locales:
+
+ - [Norwegian Nynorsk locale (nn)](https://github.com/date-fns/date-fns/pull/1172)
+ by [@draperunner](https://github.com/draperunner).
+
+ - [Ukrainian locale (ua)](https://github.com/date-fns/date-fns/pull/532)
+ by [@korzhyk](https://github.com/korzhyk).
+
+ - [Vietnamese locale (vi)](https://github.com/date-fns/date-fns/pull/546)
+ by [@trongthanh](https://github.com/trongthanh).
+
+ - [Persian locale (fa-IR)](https://github.com/date-fns/date-fns/pull/1113)
+ by [@mort3za](https://github.com/mort3za).
+
+ - [Latvian locale (lv)](https://github.com/date-fns/date-fns/pull/1175)
+ by [@prudolfs](https://github.com/prudolfs).
+
+ - [Bengali locale (bb)](https://github.com/date-fns/date-fns/pull/845)
+ by [@nutboltu](https://github.com/nutboltu) and [@touhidrahman](https://github.com/touhidrahman).
+
+ - [Hungarian (hu) and Lithuanian (lt) locales](https://github.com/date-fns/date-fns/pull/864)
+ by [@izifortune](https://github.com/izifortune) and [pardoeryanair](https://github.com/pardoeryanair).
+
+ - [Canadian English locale (en-CA)](https://github.com/date-fns/date-fns/pull/688)
+ by [@markowsiak](https://github.com/markowsiak).
+
+ - [Great Britain English locale (en-GB)](https://github.com/date-fns/date-fns/pull/563)
+ by [@glintik](https://github.com/glintik).
+
+ - [Uighur locale (ug)](https://github.com/date-fns/date-fns/pull/1080)
+ by [@abduwaly](https://github.com/abduwaly).
+
+- [Added new function `differenceInBusinessDays`](https://github.com/date-fns/date-fns/pull/1194)
+ which calculates the difference in business days. Kudos to [@ThorrStevens](https://github.com/ThorrStevens)!
+
+- [Added new function `addBusinessDays`](https://github.com/date-fns/date-fns/pull/1154),
+ similar to `addDays` but ignoring weekends. Thanks to [@ThorrStevens](https://github.com/ThorrStevens)!
+
+## [1.30.1] - 2018-12-10
+
+### Fixed
+
+- [Fixed DST issue](https://github.com/date-fns/date-fns/pull/1005). See [#972](https://github.com/date-fns/date-fns/issues/972) and [#992](https://github.com/date-fns/date-fns/issues/992) for more details. This fix was backported from v2.
+
+- Fix a few bugs that appear in timezones with offsets that include seconds (e.g. GMT+00:57:44). See PR [#789](https://github.com/date-fns/date-fns/issues/789). This fix was backported from v2.
+
+- [Fixed misspelled January in the Thai locale](https://github.com/date-fns/date-fns/pull/913). Thanks to [@ratchapol-an](https://github.com/ratchapol-an)!
+
+### Added
+
+- [Added Serbian locale](https://github.com/date-fns/date-fns/pull/717). Kudos to [@mawi12345](https://github.com/mawi12345)!
+
+- [Added Belarusian locale](https://github.com/date-fns/date-fns/pull/716). Kudos to [@mawi12345](https://github.com/mawi12345) again!
+
+### Changed
+
+- [Improved ja translation of distanceInWords](https://github.com/date-fns/date-fns/pull/880). Thanks to [@kudohamu](https://github.com/kudohamu)!
+
+## [1.30.0] - 2018-12-10
+
+⚠️ The release got failed.
+
+## [1.29.0] - 2017-10-11
+
+### Fixed
+
+- Fixed Italian translations for `formatDistance`. ([see the issue: #550](https://github.com/date-fns/date-fns/issues/550); [see the PR: #552](https://github.com/date-fns/date-fns/pull/552))
+ Thanks to [@giofilo](https://github.com/giofilo)!
+
+### Added
+
+- [Hungarian locale (hu)](https://github.com/date-fns/date-fns/pull/503)
+ (thanks to László Horváth [@horvathlg](https://github.com/horvathlg))
+
+- [Slovenian locale (sl)](https://github.com/date-fns/date-fns/pull/505)
+ (thanks to Adam Stradovnik [@Neoglyph](https://github.com/Neoglyph))
+
+- Added `step` to `eachDay` function. Thanks to [@BDav24](https://github.com/BDav24).
+ See PR [#487](https://github.com/date-fns/date-fns/pull/487).
+
+## [1.28.5] - 2017-05-19
+
+### Fixed
+
+- Fixed a.m./p.m. formatters in Chinese Simplified locale.
+ Thanks to [@fnlctrl](https://github.com/fnlctrl).
+ See PR [#486](https://github.com/date-fns/date-fns/pull/486)
+
+## [1.28.4] - 2017-04-26
+
+### Fixed
+
+- Fixed accents on weekdays in the Italian locale.
+ See PR [#481](https://github.com/date-fns/date-fns/pull/481).
+ Thanks to [@albertorestifo](https://github.com/albertorestifo)
+
+- Fixed typo in `ddd` format token in Spanish language locale.
+ Kudos to [@fjaguero](https://github.com/fjaguero).
+ See PR [#482](https://github.com/date-fns/date-fns/pull/482)
+
+## [1.28.3] - 2017-04-14
+
+### Fixed
+
+- Fixed ordinal numbers for Danish language locale. Thanks to [@kgram](https://github.com/kgram).
+ See PR [#474](https://github.com/date-fns/date-fns/pull/474)
+
+## [1.28.2] - 2017-03-27
+
+### Fixed
+
+- Fixed `dd` and `ddd` formatters in Polish language locale. Kudos to [@justrag](https://github.com/justrag).
+ See PR: [#467](https://github.com/date-fns/date-fns/pull/467)
+
+## [1.28.1] - 2017-03-19
+
+### Fixed
+
+- Fixed DST border bug in `addMilliseconds`, `addSeconds`, `addMinutes`, `addHours`,
+ `subMilliseconds`, `subSeconds`, `subMinutes` and `subHours`.
+ See issue [#465](https://github.com/date-fns/date-fns/issues/465)
+
+- Minor fix for Indonesian locale. Thanks to [@bentinata](https://github.com/bentinata).
+ See PR: [#458](https://github.com/date-fns/date-fns/pull/458)
+
+## [1.28.0] - 2017-02-27
+
+### Added
+
+- [Romanian locale (ro)](https://github.com/date-fns/date-fns/pull/446)
+ (thanks to Sergiu Munteanu [@jsergiu](https://github.com/jsergiu))
+
+### Fixed
+
+- All functions now convert all their arguments to the respective types.
+ See PR: [#443](https://github.com/date-fns/date-fns/pull/443)
+
+- Fixes for ordinals (1er, 2, 3, …) in French locale.
+ Thanks to [@fbonzon](https://github.com/fbonzon).
+ See PR: [#449](https://github.com/date-fns/date-fns/pull/449)
+
+## [1.27.2] - 2017-02-01
+
+### Fixed
+
+- Various fixes for Dutch locale. See PR: [#416](https://github.com/date-fns/date-fns/pull/416).
+ Thanks to Ruben Stolk [@rubenstolk](https://github.com/rubenstolk)
+
+## [1.27.1] - 2017-01-20
+
+### Fixed
+
+- Added generation of TypeScript locale sub-modules, allowing import of locales in TypeScript.
+
+## [1.27.0] - 2017-01-19
+
+### Added
+
+- [Macedonian locale (mk)](https://github.com/date-fns/date-fns/pull/398)
+ (thanks to Petar Vlahu [@vlahupetar](https://github.com/vlahupetar))
+
+## [1.26.0] - 2017-01-15
+
+### Added
+
+- `getTime`
+
+### Fixed
+
+- Various fixes for Japanese locale. See PR: [395](https://github.com/date-fns/date-fns/pull/395).
+ Thanks to Yamagishi Kazutoshi [@ykzts](https://github.com/ykzts)
+
+## [1.25.0] - 2017-01-11
+
+### Added
+
+- [Bulgarian locale (bg)](https://github.com/date-fns/date-fns/pull/357)
+ (thanks to Nikolay Stoynov [@arvigeus](https://github.com/arvigeus))
+
+- [Czech locale (cs)](https://github.com/date-fns/date-fns/pull/386)
+ (thanks to David Rus [@davidrus](https://github.com/davidrus))
+
+## [1.24.0] - 2017-01-06
+
+### Added
+
+- [Modern Standard Arabic locale (ar)](https://github.com/date-fns/date-fns/pull/367)
+ (thanks to Abdallah Hassan [@AbdallahAHO](https://github.com/AbdallahAHO))
+
+## [1.23.0] - 2017-01-05
+
+### Added
+
+- Auto generate TypeScript and flow typings from documentation on release.
+ Thanks to [@mattlewis92](https://github.com/mattlewis92).
+ See related PRs: [#355](https://github.com/date-fns/date-fns/pull/355),
+ [#370](https://github.com/date-fns/date-fns/pull/370)
+
+- [Croatian locale (hr)](https://github.com/date-fns/date-fns/pull/365)
+ (thanks to Matija Marohnić [@silvenon](https://github.com/silvenon))
+
+- [Thai locale (th)](https://github.com/date-fns/date-fns/pull/362)
+ (thanks to Athiwat Hirunworawongkun [@athivvat](https://github.com/athivvat))
+
+- [Finnish locale (fi)](https://github.com/date-fns/date-fns/pull/361)
+ (thanks to Pyry-Samuli Lahti [@Pyppe](https://github.com/Pyppe))
+
+## [1.22.0] - 2016-12-28
+
+### Added
+
+- [Icelandic locale (is)](https://github.com/date-fns/date-fns/pull/356)
+ (thanks to Derek Blank [@derekblank](https://github.com/derekblank))
+
+## [1.21.1] - 2016-12-18
+
+### Fixed
+
+- Fixed `isBefore` and `isAfter` documentation mistakes.
+
+## [1.21.0] - 2016-12-16
+
+### Added
+
+- [Filipino locale (fil)](https://github.com/date-fns/date-fns/pull/339)
+ (thanks to Ian De La Cruz [@RIanDeLaCruz](https://github.com/RIanDeLaCruz))
+
+- [Danish locale (da)](https://github.com/date-fns/date-fns/pull/343)
+ (kudos to Anders B. Hansen [@Andersbiha](https://github.com/Andersbiha))
+
+## [1.20.1] - 2016-12-14
+
+### Fixed
+
+- Fixed documentation for `getOverlappingDaysInRanges`.
+
+## [1.20.0] - 2016-12-13
+
+### Added
+
+- `areRangesOverlapping` and `getOverlappingDaysInRanges`
+ Thanks to Joanna T [@asia-t](https://github.com/asia-t).
+ See PR: [#331](https://github.com/date-fns/date-fns/pull/331)
+
+## [1.19.0] - 2016-12-13
+
+### Added
+
+- [Greek locale (el)](https://github.com/date-fns/date-fns/pull/334)
+ (kudos to Theodoros Orfanidis [@teoulas](https://github.com/teoulas))
+
+- [Slovak locale (sk)](https://github.com/date-fns/date-fns/pull/336)
+ (kudos to Marek Suscak [@mareksuscak](https://github.com/mareksuscak))
+
+- Added yarn support.
+ Thanks to Uladzimir Havenchyk [@havenchyk](https://github.com/havenchyk).
+ See PR: [#288](https://github.com/date-fns/date-fns/pull/288)
+
+## [1.18.0] - 2016-12-12
+
+### Added
+
+- [Turkish locale (tr)](https://github.com/date-fns/date-fns/pull/329)
+ (kudos to Alpcan Aydın [@alpcanaydin](https://github.com/alpcanaydin))
+
+- [Korean locale (ko)](https://github.com/date-fns/date-fns/pull/327)
+ (thanks to Hong Chulju [@angdev](https://github.com/angdev))
+
+### Fixed
+
+- `SS` and `SSS` formats in `format` are now correctly displayed with leading zeros.
+ Thanks to Paul Dijou [@pauldijou](https://github.com/pauldijou).
+ See PR: [#330](https://github.com/date-fns/date-fns/pull/330)
+
+## [1.17.0] - 2016-12-10
+
+### Added
+
+- [Polish locale (pl)](https://github.com/date-fns/date-fns/pull/294)
+ (thanks to Mateusz Derks [@ertrzyiks](https://github.com/ertrzyiks))
+
+- [Portuguese locale (pt)](https://github.com/date-fns/date-fns/pull/316)
+ (thanks to Dário Freire [@dfreire](https://github.com/dfreire))
+
+- [Swedish locale (sv)](https://github.com/date-fns/date-fns/pull/311)
+ (thanks to Johannes Ulén [@ejulen](https://github.com/ejulen))
+
+- [French locale (fr)](https://github.com/date-fns/date-fns/pull/281)
+ (thanks to Jean Dupouy [@izeau](https://github.com/izeau))
+
+- Performance tests. See PR: [#289](https://github.com/date-fns/date-fns/pull/289)
+
+### Fixed
+
+- Fixed TypeScript and flow typings for `isValid`.
+ See PR: [#310](https://github.com/date-fns/date-fns/pull/310)
+
+- Fixed incorrect locale tests that could potentially lead to `format` bugs.
+ Kudos to Mateusz Derks [@ertrzyiks](https://github.com/ertrzyiks).
+ See related PRs: [#312](https://github.com/date-fns/date-fns/pull/312),
+ [#320](https://github.com/date-fns/date-fns/pull/320)
+
+- Minor language fixes in the documentation.
+ Thanks to Vedad Šoše [@vedadsose](https://github.com/vedadsose) ([#314](https://github.com/date-fns/date-fns/pull/314))
+ and Asia [@asia-t](https://github.com/asia-t) ([#318](https://github.com/date-fns/date-fns/pull/318))
+
+### Changed
+
+- `format` now returns `String('Invalid Date')` if the passed date is invalid.
+ See PR: [#323](https://github.com/date-fns/date-fns/pull/323)
+
+- `distanceInWords`, `distanceInWordsToNow`, `distanceInWordsStrict` and `format` functions now
+ check if the passed locale is valid, and fallback to English locale otherwise.
+ See PR: [#321](https://github.com/date-fns/date-fns/pull/321)
+
+- _Internal_: use a loop instead of `Object.keys` in `buildFormattingTokensRegExp`
+ to improve compatibility with older browsers.
+ See PR: [#322](https://github.com/date-fns/date-fns/pull/322)
+
+## [1.16.0] - 2016-12-08
+
+### Added
+
+- [Italian locale (it)](https://github.com/date-fns/date-fns/pull/298)
+ (thanks to Alberto Restifo [@albertorestifo](https://github.com/albertorestifo))
+
+- For German `buildDistanceInWordsLocale`, add nominative case translations (for distances without a suffix).
+ Kudos to Asia [@asia-t](https://github.com/asia-t).
+ See related PR: [#295](https://github.com/date-fns/date-fns/pull/295)
+
+## [1.15.1] - 2016-12-07
+
+### Fixed
+
+- Fixed TypeScript imports from individual modules.
+ Thanks to [@mattlewis92](https://github.com/mattlewis92).
+ See related PR: [#287](https://github.com/date-fns/date-fns/pull/287)
+
+## [1.15.0] - 2016-12-07
+
+### Added
+
+- [Indonesian locale (id)](https://github.com/date-fns/date-fns/pull/299)
+ (thanks to Rahmat Budiharso [@rbudiharso](https://github.com/rbudiharso))
+
+- [Catalan locale (ca)](https://github.com/date-fns/date-fns/pull/300)
+ (thanks to Guillermo Grau [@guigrpa](https://github.com/guigrpa))
+
+### Fixed
+
+- Fixed some inaccuracies in Spanish locale.
+ Kudos to [@guigrpa](https://github.com/guigrpa).
+ See related PR: [#302](https://github.com/date-fns/date-fns/pull/302)
+
+## [1.14.1] - 2016-12-06
+
+### Fixed
+
+- Fixed broken test for Norwegian Bokmål locale.
+
+## [1.14.0] - 2016-12-06
+
+### Added
+
+- [Norwegian Bokmål locale (nb)](https://github.com/date-fns/date-fns/pull/291)
+ (thanks to Hans-Kristian Koren [@Hanse](https://github.com/Hanse))
+
+## [1.13.0] - 2016-12-06
+
+### Added
+
+- [Chinese Traditional locale (zh_tw)](https://github.com/date-fns/date-fns/pull/283)
+ (thanks to tonypai [@tpai](https://github.com/tpai)).
+
+- [Dutch language locale (nl)](https://github.com/date-fns/date-fns/pull/278)
+ (kudos to Jorik Tangelder [@jtangelder](https://github.com/jtangelder))
+
+## [1.12.1] - 2016-12-05
+
+### Fixed
+
+- Added `distanceInWordsStrict` to the list of supported functions in I18n doc.
+
+## [1.12.0] - 2016-12-05
+
+### Added
+
+- [Spanish language locale (es)](https://github.com/date-fns/date-fns/pull/269)
+ (thanks to Juan Angosto [@juanangosto](https://github.com/juanangosto)).
+
+### Fixed
+
+- Fixed flow typings for some of the functions.
+ See PR: [#273](https://github.com/date-fns/date-fns/pull/273)
+
+## [1.11.2] - 2016-11-28
+
+### Fixed
+
+- Bug in `parse` when it sometimes parses ISO week-numbering dates incorrectly.
+ See PR: [#262](https://github.com/date-fns/date-fns/pull/262)
+
+- Bug in some functions which caused them to handle dates earlier than 100 AD incorrectly.
+ See PR: [#263](https://github.com/date-fns/date-fns/pull/263)
+
+## [1.11.1] - 2016-11-24
+
+### Fixed
+
+- Include TypeScript typings with npm package.
+
+## [1.11.0] - 2016-11-23
+
+### Added
+
+- `distanceInWordsStrict`.
+ Kudos to [@STRML](https://github.com/STRML).
+ See related PR: [#254](https://github.com/date-fns/date-fns/pull/254)
+
+- [TypeScript](https://www.typescriptlang.org/) typings for all functions.
+ Kudos to [@mattlewis92](https://github.com/mattlewis92).
+ See related PR: [#255](https://github.com/date-fns/date-fns/pull/255)
+
+## [1.10.0] - 2016-11-01
+
+### Added
+
+- `parse` now can parse dates that are ISO 8601 centuries (e.g., `19` and `+0019`).
+
+ ```javascript
+ var result = parse("19");
+ //=> Mon Jan 01 1900 00:00:00
+ ```
+
+- In `parse`, added ability to specify the number of additional digits
+ for extended year or century format (possible values are 0, 1 or 2; default is 2).
+
+ ```javascript
+ parse("+002016-11-01");
+ parse("+02016-11-01", { additionalDigits: 1 });
+ parse("+2016-11-01", { additionalDigits: 0 });
+ ```
+
+## [1.9.0] - 2016-10-25
+
+### Added
+
+- Got index.js imports to work with SystemJS.
+
+## [1.8.1] - 2016-10-24
+
+### Fixed
+
+- Added Japanese and German language locales to the list in I18n doc.
+
+## [1.8.0] - 2016-10-23
+
+### Added
+
+- [Japanese language locale (ja)](https://github.com/date-fns/date-fns/pull/241)
+ (thanks to Thomas Eilmsteiner [@DeMuu](https://github.com/DeMuu) again!)
+
+- `getISODay`
+
+- `setISODay`
+
+## [1.7.0] - 2016-10-20
+
+### Added
+
+- [German language locale (de)](https://github.com/date-fns/date-fns/pull/237)
+ (thanks to Thomas Eilmsteiner [@DeMuu](https://github.com/DeMuu)).
+
+## [1.6.0] - 2016-10-16
+
+### Added
+
+- [Chinese Simplified locale (zh_cn)](https://github.com/date-fns/date-fns/pull/235)
+ (kudos to Changyu [@KingMario](https://github.com/KingMario) Geng).
+
+## [1.5.2] - 2016-10-13
+
+### Fixed
+
+- Incorrectly generated docs for `format`.
+
+- Fixed typo in I18n doc.
+
+## [1.5.1] - 2016-10-12
+
+### Fixed
+
+- A change log entry for [1.5.0] is added.
+
+## [1.5.0] - 2016-10-12
+
+### Added
+
+- [The initial I18n support](https://date-fns.org/docs/I18n)
+
+## [1.4.0] - 2016-10-09
+
+### Added
+
+- Basic [SystemJS](https://github.com/systemjs/systemjs) support.
+
+### Fixed
+
+- Fixed incorrect behaviour of `YYYY` and `YY` for years prior to 1000:
+ now `format(new Date('0001-01-01'), 'YYYY-MM-DD')` returns `0001-01-01`
+ instead of `1-01-01`.
+
+## [1.3.0] - 2016-05-26
+
+### Added
+
+- `closestIndexTo`
+
+## [1.2.0] - 2016-05-23
+
+### Added
+
+- Added an ability to pass negative numbers to `setDay`.
+
+## [1.1.1] - 2016-05-19
+
+### Fixed
+
+- Fixed [Flow](http://flowtype.org/) declarations for some of the functions.
+
+## [1.1.0] - 2016-05-19
+
+### Added
+
+- [Flow](http://flowtype.org/) declarations for each function
+ in [the ".js.flow" style](http://flowtype.org/docs/declarations.html#declaration-files).
+ Kudos to [@JohnyDays](https://github.com/JohnyDays). See related PRs:
+
+ - [#205](https://github.com/date-fns/date-fns/pull/205)
+
+ - [#207](https://github.com/date-fns/date-fns/pull/207)
+
+## [1.0.0] - 2016-05-18
+
+### Fixed
+
+- `format` now returns the correct result for key `E`.
+
+- Prevent `startOf...`, `endOf...` and `lastDayOf...` functions
+ to return dates with an incorrect time when the date is modifying
+ into another time zone.
+
+- `parse` now parses years from 1 AD to 99 AD correctly.
+
+- Fix a bug in `getISOWeek` appearing because of a changing time zone
+ (e.g., when the given date is in DST and the start of the ISO year is not).
+
+### Changed
+
+- **BREAKING**: all functions are moved to the root of the library, so they
+ are now accessible with `require('date-fns/name_of_function')` or
+ `import nameOfFunction from 'date-fns/name_of_function'`.
+
+ ```javascript
+ // Before v1.0.0
+ var addMonths = require("date-fns/src/add_months");
+
+ // v1.0.0 onward
+ var addMonths = require("date-fns/add_months");
+ ```
+
+- **BREAKING**: functions that had the last optional argument `weekStartsAt`
+ (i.e. `endOfWeek`, `isSameWeek`, `lastDayOfWeek`, `setDay`, `startOfWeek`)
+ now instead receive the object `options` with the property `options.weekStartsOn`
+ as the last argument.
+
+ ```javascript
+ // Before v1.0.0
+ var result = endOfWeek(new Date(2014, 8, 2), 1);
+
+ // v1.0.0 onward
+ var result = endOfWeek(new Date(2014, 8, 2), { weekStartsOn: 1 });
+ ```
+
+- **BREAKING**: remove the function `getTimeSinceMidnight` that was used inside
+ the other functions.
+
+- **BREAKING**: `differenceInDays` now returns the number of full days instead
+ of calendar days.
+
+- **BREAKING**: `eachDay` and `isWithinRange` now throw an exception
+ when the given range boundaries are invalid.
+
+- Faster `isLeapYear`.
+
+- _Internal_: make the documentation more verbose.
+
+- _Internal_: convert the tests from Chai to power-assert allowing them
+ to run against IE8.
+
+### Added
+
+- `addISOYears`
+
+- `closestTo`
+
+- `differenceInCalendarDays`
+
+- `differenceInCalendarISOWeeks`
+
+- `differenceInCalendarISOYears`
+
+- `differenceInCalendarMonths`
+
+- `differenceInCalendarQuarters`
+
+- `differenceInCalendarWeeks`
+
+- `differenceInCalendarYears`
+
+- `differenceInHours`
+
+- `differenceInISOYears`
+
+- `differenceInMilliseconds`
+
+- `differenceInMinutes`
+
+- `differenceInMonths`
+
+- `differenceInQuarters`
+
+- `differenceInSeconds`
+
+- `differenceInWeeks`
+
+- `differenceInYears`
+
+- `distanceInWords`
+
+- `distanceInWordsToNow`
+
+- `endOfISOWeek`
+
+- `endOfISOYear`
+
+- `endOfToday`
+
+- `endOfTomorrow`
+
+- `endOfYesterday`
+
+- `getDaysInYear`
+
+- `isDate`
+
+- `isFriday`
+
+- `isMonday`
+
+- `isSameISOWeek`
+
+- `isSameISOYear`
+
+- `isSaturday`
+
+- `isSunday`
+
+- `isThisHour`
+
+- `isThisISOWeek`
+
+- `isThisISOYear`
+
+- `isThisMinute`
+
+- `isThisMonth`
+
+- `isThisQuarter`
+
+- `isThisSecond`
+
+- `isThisWeek`
+
+- `isThisYear`
+
+- `isThursday`
+
+- `isTomorrow`
+
+- `isTuesday`
+
+- `isValid`
+
+- `isWednesday`
+
+- `isYesterday`
+
+- `lastDayOfISOWeek`
+
+- `lastDayOfISOYear`
+
+- `startOfISOWeek`
+
+- `startOfToday`
+
+- `startOfTomorrow`
+
+- `startOfYesterday`
+
+- `subISOYears`
+
+- Add `Qo`, `W`, `Wo`, `WW`, `GG`, `GGGG`, `Z`, `ZZ`, `X`, `x` keys to `format`.
+
+## [0.17.0] - 2015-09-29
+
+### Fixed
+
+- Fixed a lot of bugs appearing when date is modifying into other time zone
+ (e.g., when adding months and original date is in DST but new date is not).
+
+- Prevent instances of Date to lose milliseconds value when passed to.
+ `parse` in IE10.
+
+### Changed
+
+- `setISOWeek` now keeps time from original date.
+
+- _Internal_: reuse `getDaysInMonth` inside of `addMonths`.
+
+### Added
+
+- `differenceInDays`
+
+- `getTimeSinceMidnight`
+
+- `format` now has new format key `aa`, which returns `a.m.`/`p.m.`
+ as opposed to `a` that returns `am`/`pm`.
+
+- Complete UMD package (for Bower and CDN).
+
+## [0.16.0] - 2015-09-01
+
+### Changed
+
+- Use `parse` to clean date arguments in all functions.
+
+- `parse` now fallbacks to `new Date` when the argument
+ is not an ISO formatted date.
+
+- _Internal_: reuse `getDaysInMonth` inside of `setMonth`.
+
+### Added
+
+- `addQuarters`
+
+- `addWeeks`
+
+- `endOfQuarter`
+
+- `getDate`
+
+- `getDay`
+
+- `getDaysInMonth`
+
+- `getHours`
+
+- `getISOWeeksInYear`
+
+- `getMilliseconds`
+
+- `getMinutes`
+
+- `getMonth`
+
+- `getSeconds`
+
+- `getYear`
+
+- `isLeapYear`
+
+- `isSameHour`
+
+- `isSameMinute`
+
+- `isSameQuarter`
+
+- `isSameSecond`
+
+- `lastDayOfQuarter`
+
+- `lastDayOfWeek`
+
+- `max`
+
+- `min`
+
+- `setDate`
+
+- `setDay`
+
+- `setHours`
+
+- `setMilliseconds`
+
+- `setMinutes`
+
+- `setSeconds`
+
+- `startOfQuarter`
+
+- `subQuarters`
+
+- `subWeeks`
+
+## [0.15.0] - 2015-08-26
+
+### Changed
+
+- `format` now returns `a.m.`/`p.m.` instead of `am`/`pm`.
+
+- `setMonth` now sets last day of month if original date was last day
+ of longer month.
+
+- _Internal_: Fix code style according to ESLint.
+
+- _Internal_: Make tests run through all time zones.
+
+### Added
+
+- `getQuarter`
+
+- `setQuarter`
+
+- `getDayOfYear`
+
+- `setDayOfYear`
+
+- `isPast`
+
+- `addSeconds`
+
+- `subSeconds`
+
+- `startOfSecond`
+
+- `endOfSecond`
+
+- `startOfMinute`
+
+- `endOfMinute`
+
+- `addMilliseconds`
+
+- `subMilliseconds`
+
+- `endOfYear`
+
+- `addYears`
+
+- `subYears`
+
+- `lastDayOfYear`
+
+- `lastDayOfMonth`
+
+## [0.14.11] - 2015-08-21
+
+### Fixed
+
+- `format` now uses `parse` to avoid time zone bugs.
+
+### Changed
+
+- `setIsoWeek` now sets time to the start of the day.
+
+## [0.14.10] - 2015-07-29
+
+### Fixed
+
+- `format` now behaves correctly with 12:00 am.
+
+- `format` now behaves correctly with ordinal numbers.
+
+### Added
+
+- `compareAsc`
+
+- `compareDesc`
+
+- `addHours`
+
+- `subHours`
+
+- `isSameDay`
+
+- `parse`
+
+- `getISOYear`
+
+- `setISOYear`
+
+- `startOfISOYear`
+
+- `getISOWeek`
+
+- `setISOWeek`
+
+## [0.14.9] - 2015-01-14
+
+### Fixed
+
+- `addMonths` now correctly behaves with February
+ (see [#18](https://github.com/js-fns/date-fns/pull/18)).
+
+## [0.14.8] - 2014-12-25
+
+### Fixed
+
+- `format` function now behaves correctly with `pm`/`am`.
+
+## [0.14.6] - 2014-12-04
+
+### Fixed
+
+- Fix broken Bower support.
+
+## [0.14.0] - 2014-11-05
+
+### Added
+
+- Bower package.
+
+## [0.13.0] - 2014-10-22
+
+### Added
+
+- `addMinutes`
+
+- `subMinutes`
+
+- `isEqual`
+
+- `isBefore`
+
+- `isAfter`
+
+## [0.12.1] - 2014-10-19
+
+### Fixed
+
+- Incorrect rounding in `DDD` formatter.
+
+## [0.12.0] - 2014-10-15
+
+### Added
+
+- `isSameYear`
+
+## [0.11.0] - 2014-10-15
+
+### Added
+
+- `isWithinRange`
+
+## [0.10.0] - 2014-10-13
+
+### Added
+
+- `format`
+
+- `startOfYear`
+
+## [0.9.0] - 2014-10-10
+
+### Changed
+
+- _Internal_: simplify `isWeekend`
+
+### Added
+
+- `isFuture`
+
+## [0.8.0] - 2014-10-09
+
+### Changed
+
+- _Internal_: reuse `addDays` inside of `subDays`.
+
+### Added
+
+- `addMonths`
+
+- `subMonths`
+
+- `setMonth`
+
+- `setYear`
+
+## [0.7.0] - 2014-10-08
+
+### Added
+
+- `isSameWeek`
+
+## [0.6.0] - 2014-10-07
+
+### Fixed
+
+- Inconsistent behavior of `endOfMonth`.
+
+### Added
+
+- `isFirstDayOfMonth`
+
+- `isLastDayOfMonth`
+
+- `isSameMonth`
+
+## [0.5.0] - 2014-10-07
+
+### Added
+
+- `addDays`
+
+- `subDays`
+
+## [0.4.0] - 2014-10-07
+
+### Added
+
+- `startOfWeek`
+
+- `endOfWeek`
+
+- `eachDay`
+
+## [0.3.0] - 2014-10-06
+
+### Changed
+
+- `startOfDay` now sets milliseconds as well.
+
+### Added
+
+- `endOfDay`
+
+- `startOfMonth`
+
+- `endOfMonth`
+
+## [0.2.0] - 2014-10-06
+
+### Added
+
+- `isToday`
+
+- `isWeekend`
+
+## 0.1.0 - 2014-10-06
+
+### Added
+
+- `startOfDay`
+
+[unreleased]: https://github.com/date-fns/date-fns/compare/v2.16.1...HEAD
+[2.16.1]: https://github.com/date-fns/date-fns/compare/v2.16.0...v2.16.1
+[2.16.0]: https://github.com/date-fns/date-fns/compare/v2.15.0...v2.16.0
+[2.15.0]: https://github.com/date-fns/date-fns/compare/v2.14.0...v2.15.0
+[2.14.0]: https://github.com/date-fns/date-fns/compare/v2.13.0...v2.14.0
+[2.13.0]: https://github.com/date-fns/date-fns/compare/v2.12.0...v2.13.0
+[2.12.0]: https://github.com/date-fns/date-fns/compare/v2.11.1...v2.12.0
+[2.11.1]: https://github.com/date-fns/date-fns/compare/v2.11.0...v2.11.1
+[2.11.0]: https://github.com/date-fns/date-fns/compare/v2.10.0...v2.11.0
+[2.10.0]: https://github.com/date-fns/date-fns/compare/v2.9.0...v2.10.0
+[2.9.0]: https://github.com/date-fns/date-fns/compare/v2.8.1...v2.9.0
+[2.8.1]: https://github.com/date-fns/date-fns/compare/v2.8.0...v2.8.1
+[2.8.0]: https://github.com/date-fns/date-fns/compare/v2.7.0...v2.8.0
+[2.7.0]: https://github.com/date-fns/date-fns/compare/v2.6.0...v2.7.0
+[2.6.0]: https://github.com/date-fns/date-fns/compare/v2.5.1...v2.6.0
+[2.5.1]: https://github.com/date-fns/date-fns/compare/v2.5.0...v2.5.1
+[2.5.0]: https://github.com/date-fns/date-fns/compare/v2.4.1...v2.5.0
+[2.4.1]: https://github.com/date-fns/date-fns/compare/v2.4.0...v2.4.1
+[2.4.0]: https://github.com/date-fns/date-fns/compare/v2.3.0...v2.4.0
+[2.3.0]: https://github.com/date-fns/date-fns/compare/v2.2.1...v2.3.0
+[2.2.1]: https://github.com/date-fns/date-fns/compare/v2.1.0...v2.2.1
+[2.1.0]: https://github.com/date-fns/date-fns/compare/v2.0.1...v2.1.0
+[2.0.1]: https://github.com/date-fns/date-fns/compare/v2.0.0...v2.0.1
+[2.0.0]: https://github.com/date-fns/date-fns/compare/v1.28.5...v2.0.0
+[1.28.5]: https://github.com/date-fns/date-fns/compare/v1.28.4...v1.28.5
+[1.28.4]: https://github.com/date-fns/date-fns/compare/v1.28.3...v1.28.4
+[1.28.3]: https://github.com/date-fns/date-fns/compare/v1.28.2...v1.28.3
+[1.28.2]: https://github.com/date-fns/date-fns/compare/v1.28.1...v1.28.2
+[1.28.1]: https://github.com/date-fns/date-fns/compare/v1.28.0...v1.28.1
+[1.28.0]: https://github.com/date-fns/date-fns/compare/v1.27.2...v1.28.0
+[1.27.2]: https://github.com/date-fns/date-fns/compare/v1.27.1...v1.27.2
+[1.27.1]: https://github.com/date-fns/date-fns/compare/v1.27.0...v1.27.1
+[1.27.0]: https://github.com/date-fns/date-fns/compare/v1.26.0...v1.27.0
+[1.26.0]: https://github.com/date-fns/date-fns/compare/v1.25.0...v1.26.0
+[1.25.0]: https://github.com/date-fns/date-fns/compare/v1.24.0...v1.25.0
+[1.24.0]: https://github.com/date-fns/date-fns/compare/v1.23.0...v1.24.0
+[1.23.0]: https://github.com/date-fns/date-fns/compare/v1.22.0...v1.23.0
+[1.22.0]: https://github.com/date-fns/date-fns/compare/v1.21.1...v1.22.0
+[1.21.1]: https://github.com/date-fns/date-fns/compare/v1.21.0...v1.21.1
+[1.21.0]: https://github.com/date-fns/date-fns/compare/v1.20.1...v1.21.0
+[1.20.1]: https://github.com/date-fns/date-fns/compare/v1.20.0...v1.20.1
+[1.20.0]: https://github.com/date-fns/date-fns/compare/v1.19.0...v1.20.0
+[1.19.0]: https://github.com/date-fns/date-fns/compare/v1.18.0...v1.19.0
+[1.18.0]: https://github.com/date-fns/date-fns/compare/v1.17.0...v1.18.0
+[1.17.0]: https://github.com/date-fns/date-fns/compare/v1.16.0...v1.17.0
+[1.16.0]: https://github.com/date-fns/date-fns/compare/v1.15.1...v1.16.0
+[1.15.1]: https://github.com/date-fns/date-fns/compare/v1.15.0...v1.15.1
+[1.15.0]: https://github.com/date-fns/date-fns/compare/v1.14.1...v1.15.0
+[1.14.1]: https://github.com/date-fns/date-fns/compare/v1.14.0...v1.14.1
+[1.14.0]: https://github.com/date-fns/date-fns/compare/v1.13.0...v1.14.0
+[1.13.0]: https://github.com/date-fns/date-fns/compare/v1.12.1...v1.13.0
+[1.12.1]: https://github.com/date-fns/date-fns/compare/v1.12.0...v1.12.1
+[1.12.0]: https://github.com/date-fns/date-fns/compare/v1.11.2...v1.12.0
+[1.11.2]: https://github.com/date-fns/date-fns/compare/v1.11.1...v1.11.2
+[1.11.1]: https://github.com/date-fns/date-fns/compare/v1.11.0...v1.11.1
+[1.11.0]: https://github.com/date-fns/date-fns/compare/v1.10.0...v1.11.0
+[1.10.0]: https://github.com/date-fns/date-fns/compare/v1.9.0...v1.10.0
+[1.9.0]: https://github.com/date-fns/date-fns/compare/v1.8.1...v1.9.0
+[1.8.1]: https://github.com/date-fns/date-fns/compare/v1.8.0...v1.8.1
+[1.8.0]: https://github.com/date-fns/date-fns/compare/v1.7.0...v1.8.0
+[1.7.0]: https://github.com/date-fns/date-fns/compare/v1.6.0...v1.7.0
+[1.6.0]: https://github.com/date-fns/date-fns/compare/v1.5.2...v1.6.0
+[1.5.2]: https://github.com/date-fns/date-fns/compare/v1.5.1...v1.5.2
+[1.5.1]: https://github.com/date-fns/date-fns/compare/v1.5.0...v1.5.1
+[1.5.0]: https://github.com/date-fns/date-fns/compare/v1.4.0...v1.5.0
+[1.4.0]: https://github.com/date-fns/date-fns/compare/v1.3.0...v1.4.0
+[1.3.0]: https://github.com/date-fns/date-fns/compare/v1.2.0...v1.3.0
+[1.2.0]: https://github.com/date-fns/date-fns/compare/v1.1.1...v1.2.0
+[1.1.1]: https://github.com/date-fns/date-fns/compare/v1.1.0...v1.1.1
+[1.1.0]: https://github.com/date-fns/date-fns/compare/v1.0.0...v1.1.0
+[1.0.0]: https://github.com/date-fns/date-fns/compare/v0.17.0...v1.0.0
+[0.17.0]: https://github.com/date-fns/date-fns/compare/v0.16.0...v0.17.0
+[0.16.0]: https://github.com/date-fns/date-fns/compare/v0.15.0...v0.16.0
+[0.15.0]: https://github.com/date-fns/date-fns/compare/v0.14.11...v0.15.0
+[0.14.11]: https://github.com/date-fns/date-fns/compare/v0.14.10...v0.14.11
+[0.14.10]: https://github.com/date-fns/date-fns/compare/v0.14.9...v0.14.10
+[0.14.9]: https://github.com/date-fns/date-fns/compare/v0.14.8...v0.14.9
+[0.14.8]: https://github.com/date-fns/date-fns/compare/v0.14.6...v0.14.8
+[0.14.6]: https://github.com/date-fns/date-fns/compare/v0.14.0...v0.14.6
+[0.14.0]: https://github.com/date-fns/date-fns/compare/v0.13.0...v0.14.0
+[0.13.0]: https://github.com/date-fns/date-fns/compare/v0.12.1...v0.13.0
+[0.12.1]: https://github.com/date-fns/date-fns/compare/v0.12.0...v0.12.1
+[0.12.0]: https://github.com/date-fns/date-fns/compare/v0.11.0...v0.12.0
+[0.11.0]: https://github.com/date-fns/date-fns/compare/v0.10.0...v0.11.0
+[0.10.0]: https://github.com/date-fns/date-fns/compare/v0.9.0...v0.10.0
+[0.9.0]: https://github.com/date-fns/date-fns/compare/v0.8.0...v0.9.0
+[0.8.0]: https://github.com/date-fns/date-fns/compare/v0.7.0...v0.8.0
+[0.7.0]: https://github.com/date-fns/date-fns/compare/v0.6.0...v0.7.0
+[0.6.0]: https://github.com/date-fns/date-fns/compare/v0.5.0...v0.6.0
+[0.5.0]: https://github.com/date-fns/date-fns/compare/v0.4.0...v0.5.0
+[0.4.0]: https://github.com/date-fns/date-fns/compare/v0.3.0...v0.4.0
+[0.3.0]: https://github.com/date-fns/date-fns/compare/v0.2.0...v0.3.0
+[0.2.0]: https://github.com/date-fns/date-fns/compare/v0.1.0...v0.2.0
diff --git a/node_modules/date-fns/LICENSE.md b/node_modules/date-fns/LICENSE.md
new file mode 100644
index 00000000..29c6e85f
--- /dev/null
+++ b/node_modules/date-fns/LICENSE.md
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2021 Sasha Koss and Lesha Koss https://kossnocorp.mit-license.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node_modules/date-fns/README.md b/node_modules/date-fns/README.md
new file mode 100644
index 00000000..da9008e5
--- /dev/null
+++ b/node_modules/date-fns/README.md
@@ -0,0 +1,58 @@
+🔥️ **NEW**: [date-fns v4.0 with first-class time zone support is out!](https://blog.date-fns.org/v40-with-time-zone-support/)
+
+
+
+date-fns provides the most comprehensive, yet simple and consistent toolset for manipulating JavaScript dates in a browser & Node.js
+
+👉 [Documentation](https://date-fns.org/)
+
+👉 [Blog](https://blog.date-fns.org/)
+
+
+
+It's like [Lodash](https://lodash.com) for dates
+
+- It has [**200+ functions** for all occasions](https://date-fns.org/docs/Getting-Started/).
+- **Modular**: Pick what you need. Works with webpack, Browserify, or Rollup and also supports tree-shaking.
+- **Native dates**: Uses existing native type. It doesn't extend core objects for safety's sake.
+- **Immutable & Pure**: Built using pure functions and always returns a new date instance.
+- **TypeScript**: The library is 100% TypeScript with brand-new handcrafted types.
+- **I18n**: Dozens of locales. Include only what you need.
+- [and many more benefits](https://date-fns.org/)
+
+```js
+import { compareAsc, format } from "date-fns";
+
+format(new Date(2014, 1, 11), "yyyy-MM-dd");
+//=> '2014-02-11'
+
+const dates = [
+ new Date(1995, 6, 2),
+ new Date(1987, 1, 11),
+ new Date(1989, 6, 10),
+];
+dates.sort(compareAsc);
+//=> [
+// Wed Feb 11 1987 00:00:00,
+// Mon Jul 10 1989 00:00:00,
+// Sun Jul 02 1995 00:00:00
+// ]
+```
+
+The library is available as an [npm package](https://www.npmjs.com/package/date-fns).
+To install the package run:
+
+```bash
+npm install date-fns --save
+```
+
+## Docs
+
+[See date-fns.org](https://date-fns.org/) for more details, API,
+and other docs.
+
+
+
+## License
+
+[MIT © Sasha Koss](https://kossnocorp.mit-license.org/)
diff --git a/node_modules/date-fns/SECURITY.md b/node_modules/date-fns/SECURITY.md
new file mode 100644
index 00000000..14fd8fed
--- /dev/null
+++ b/node_modules/date-fns/SECURITY.md
@@ -0,0 +1,12 @@
+# Security Policy
+
+## Supported Versions
+
+Security updates are applied only to the latest release.
+
+## Reporting a Vulnerability
+
+If you have discovered a security vulnerability in this project, please report it privately. **Do not disclose it as a public issue.**
+This gives us time to work with you to fix the issue before public exposure, reducing the chance that the exploit will be used before a patch is released.
+Please disclose it to [Sasha Koss](mailto:koss@nocorp.me). This project is maintained by a team of volunteers
+on a reasonable-effort basis. As such, please give us at least 90 days to work on a fix before public exposure.
diff --git a/node_modules/date-fns/_lib/addLeadingZeros.cjs b/node_modules/date-fns/_lib/addLeadingZeros.cjs
new file mode 100644
index 00000000..5e18f469
--- /dev/null
+++ b/node_modules/date-fns/_lib/addLeadingZeros.cjs
@@ -0,0 +1,7 @@
+"use strict";
+exports.addLeadingZeros = addLeadingZeros;
+function addLeadingZeros(number, targetLength) {
+ const sign = number < 0 ? "-" : "";
+ const output = Math.abs(number).toString().padStart(targetLength, "0");
+ return sign + output;
+}
diff --git a/node_modules/date-fns/_lib/addLeadingZeros.d.cts b/node_modules/date-fns/_lib/addLeadingZeros.d.cts
new file mode 100644
index 00000000..812d8c65
--- /dev/null
+++ b/node_modules/date-fns/_lib/addLeadingZeros.d.cts
@@ -0,0 +1,4 @@
+export declare function addLeadingZeros(
+ number: number,
+ targetLength: number,
+): string;
diff --git a/node_modules/date-fns/_lib/addLeadingZeros.d.ts b/node_modules/date-fns/_lib/addLeadingZeros.d.ts
new file mode 100644
index 00000000..812d8c65
--- /dev/null
+++ b/node_modules/date-fns/_lib/addLeadingZeros.d.ts
@@ -0,0 +1,4 @@
+export declare function addLeadingZeros(
+ number: number,
+ targetLength: number,
+): string;
diff --git a/node_modules/date-fns/_lib/addLeadingZeros.js b/node_modules/date-fns/_lib/addLeadingZeros.js
new file mode 100644
index 00000000..3bafd190
--- /dev/null
+++ b/node_modules/date-fns/_lib/addLeadingZeros.js
@@ -0,0 +1,5 @@
+export function addLeadingZeros(number, targetLength) {
+ const sign = number < 0 ? "-" : "";
+ const output = Math.abs(number).toString().padStart(targetLength, "0");
+ return sign + output;
+}
diff --git a/node_modules/date-fns/_lib/defaultLocale.cjs b/node_modules/date-fns/_lib/defaultLocale.cjs
new file mode 100644
index 00000000..8255c1ce
--- /dev/null
+++ b/node_modules/date-fns/_lib/defaultLocale.cjs
@@ -0,0 +1,8 @@
+"use strict";
+Object.defineProperty(exports, "defaultLocale", {
+ enumerable: true,
+ get: function () {
+ return _index.enUS;
+ },
+});
+var _index = require("../locale/en-US.cjs");
diff --git a/node_modules/date-fns/_lib/defaultLocale.d.cts b/node_modules/date-fns/_lib/defaultLocale.d.cts
new file mode 100644
index 00000000..016e184d
--- /dev/null
+++ b/node_modules/date-fns/_lib/defaultLocale.d.cts
@@ -0,0 +1 @@
+export { enUS as defaultLocale } from "../locale/en-US.js";
diff --git a/node_modules/date-fns/_lib/defaultLocale.d.ts b/node_modules/date-fns/_lib/defaultLocale.d.ts
new file mode 100644
index 00000000..016e184d
--- /dev/null
+++ b/node_modules/date-fns/_lib/defaultLocale.d.ts
@@ -0,0 +1 @@
+export { enUS as defaultLocale } from "../locale/en-US.js";
diff --git a/node_modules/date-fns/_lib/defaultLocale.js b/node_modules/date-fns/_lib/defaultLocale.js
new file mode 100644
index 00000000..016e184d
--- /dev/null
+++ b/node_modules/date-fns/_lib/defaultLocale.js
@@ -0,0 +1 @@
+export { enUS as defaultLocale } from "../locale/en-US.js";
diff --git a/node_modules/date-fns/_lib/defaultOptions.cjs b/node_modules/date-fns/_lib/defaultOptions.cjs
new file mode 100644
index 00000000..2781398d
--- /dev/null
+++ b/node_modules/date-fns/_lib/defaultOptions.cjs
@@ -0,0 +1,13 @@
+"use strict";
+exports.getDefaultOptions = getDefaultOptions;
+exports.setDefaultOptions = setDefaultOptions;
+
+let defaultOptions = {};
+
+function getDefaultOptions() {
+ return defaultOptions;
+}
+
+function setDefaultOptions(newOptions) {
+ defaultOptions = newOptions;
+}
diff --git a/node_modules/date-fns/_lib/defaultOptions.d.cts b/node_modules/date-fns/_lib/defaultOptions.d.cts
new file mode 100644
index 00000000..f766bd03
--- /dev/null
+++ b/node_modules/date-fns/_lib/defaultOptions.d.cts
@@ -0,0 +1,11 @@
+import type {
+ FirstWeekContainsDateOptions,
+ Locale,
+ LocalizedOptions,
+ WeekOptions,
+} from "../types.js";
+export type DefaultOptions = LocalizedOptions &
+ WeekOptions &
+ FirstWeekContainsDateOptions;
+export declare function getDefaultOptions(): DefaultOptions;
+export declare function setDefaultOptions(newOptions: DefaultOptions): void;
diff --git a/node_modules/date-fns/_lib/defaultOptions.d.ts b/node_modules/date-fns/_lib/defaultOptions.d.ts
new file mode 100644
index 00000000..f766bd03
--- /dev/null
+++ b/node_modules/date-fns/_lib/defaultOptions.d.ts
@@ -0,0 +1,11 @@
+import type {
+ FirstWeekContainsDateOptions,
+ Locale,
+ LocalizedOptions,
+ WeekOptions,
+} from "../types.js";
+export type DefaultOptions = LocalizedOptions &
+ WeekOptions &
+ FirstWeekContainsDateOptions;
+export declare function getDefaultOptions(): DefaultOptions;
+export declare function setDefaultOptions(newOptions: DefaultOptions): void;
diff --git a/node_modules/date-fns/_lib/defaultOptions.js b/node_modules/date-fns/_lib/defaultOptions.js
new file mode 100644
index 00000000..672961f1
--- /dev/null
+++ b/node_modules/date-fns/_lib/defaultOptions.js
@@ -0,0 +1,9 @@
+let defaultOptions = {};
+
+export function getDefaultOptions() {
+ return defaultOptions;
+}
+
+export function setDefaultOptions(newOptions) {
+ defaultOptions = newOptions;
+}
diff --git a/node_modules/date-fns/_lib/format/formatters.cjs b/node_modules/date-fns/_lib/format/formatters.cjs
new file mode 100644
index 00000000..17e90e8a
--- /dev/null
+++ b/node_modules/date-fns/_lib/format/formatters.cjs
@@ -0,0 +1,780 @@
+"use strict";
+exports.formatters = void 0;
+var _index = require("../../getDayOfYear.cjs");
+var _index2 = require("../../getISOWeek.cjs");
+var _index3 = require("../../getISOWeekYear.cjs");
+var _index4 = require("../../getWeek.cjs");
+var _index5 = require("../../getWeekYear.cjs");
+
+var _index6 = require("../addLeadingZeros.cjs");
+var _index7 = require("./lightFormatters.cjs");
+
+const dayPeriodEnum = {
+ am: "am",
+ pm: "pm",
+ midnight: "midnight",
+ noon: "noon",
+ morning: "morning",
+ afternoon: "afternoon",
+ evening: "evening",
+ night: "night",
+};
+
+/*
+ * | | Unit | | Unit |
+ * |-----|--------------------------------|-----|--------------------------------|
+ * | a | AM, PM | A* | Milliseconds in day |
+ * | b | AM, PM, noon, midnight | B | Flexible day period |
+ * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
+ * | d | Day of month | D | Day of year |
+ * | e | Local day of week | E | Day of week |
+ * | f | | F* | Day of week in month |
+ * | g* | Modified Julian day | G | Era |
+ * | h | Hour [1-12] | H | Hour [0-23] |
+ * | i! | ISO day of week | I! | ISO week of year |
+ * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
+ * | k | Hour [1-24] | K | Hour [0-11] |
+ * | l* | (deprecated) | L | Stand-alone month |
+ * | m | Minute | M | Month |
+ * | n | | N | |
+ * | o! | Ordinal number modifier | O | Timezone (GMT) |
+ * | p! | Long localized time | P! | Long localized date |
+ * | q | Stand-alone quarter | Q | Quarter |
+ * | r* | Related Gregorian year | R! | ISO week-numbering year |
+ * | s | Second | S | Fraction of second |
+ * | t! | Seconds timestamp | T! | Milliseconds timestamp |
+ * | u | Extended year | U* | Cyclic year |
+ * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
+ * | w | Local week of year | W* | Week of month |
+ * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
+ * | y | Year (abs) | Y | Local week-numbering year |
+ * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
+ *
+ * Letters marked by * are not implemented but reserved by Unicode standard.
+ *
+ * Letters marked by ! are non-standard, but implemented by date-fns:
+ * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
+ * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
+ * i.e. 7 for Sunday, 1 for Monday, etc.
+ * - `I` is ISO week of year, as opposed to `w` which is local week of year.
+ * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
+ * `R` is supposed to be used in conjunction with `I` and `i`
+ * for universal ISO week-numbering date, whereas
+ * `Y` is supposed to be used in conjunction with `w` and `e`
+ * for week-numbering date specific to the locale.
+ * - `P` is long localized date format
+ * - `p` is long localized time format
+ */
+
+const formatters = (exports.formatters = {
+ // Era
+ G: function (date, token, localize) {
+ const era = date.getFullYear() > 0 ? 1 : 0;
+ switch (token) {
+ // AD, BC
+ case "G":
+ case "GG":
+ case "GGG":
+ return localize.era(era, { width: "abbreviated" });
+ // A, B
+ case "GGGGG":
+ return localize.era(era, { width: "narrow" });
+ // Anno Domini, Before Christ
+ case "GGGG":
+ default:
+ return localize.era(era, { width: "wide" });
+ }
+ },
+
+ // Year
+ y: function (date, token, localize) {
+ // Ordinal number
+ if (token === "yo") {
+ const signedYear = date.getFullYear();
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
+ const year = signedYear > 0 ? signedYear : 1 - signedYear;
+ return localize.ordinalNumber(year, { unit: "year" });
+ }
+
+ return _index7.lightFormatters.y(date, token);
+ },
+
+ // Local week-numbering year
+ Y: function (date, token, localize, options) {
+ const signedWeekYear = (0, _index5.getWeekYear)(date, options);
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
+ const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
+
+ // Two digit year
+ if (token === "YY") {
+ const twoDigitYear = weekYear % 100;
+ return (0, _index6.addLeadingZeros)(twoDigitYear, 2);
+ }
+
+ // Ordinal number
+ if (token === "Yo") {
+ return localize.ordinalNumber(weekYear, { unit: "year" });
+ }
+
+ // Padding
+ return (0, _index6.addLeadingZeros)(weekYear, token.length);
+ },
+
+ // ISO week-numbering year
+ R: function (date, token) {
+ const isoWeekYear = (0, _index3.getISOWeekYear)(date);
+
+ // Padding
+ return (0, _index6.addLeadingZeros)(isoWeekYear, token.length);
+ },
+
+ // Extended year. This is a single number designating the year of this calendar system.
+ // The main difference between `y` and `u` localizers are B.C. years:
+ // | Year | `y` | `u` |
+ // |------|-----|-----|
+ // | AC 1 | 1 | 1 |
+ // | BC 1 | 1 | 0 |
+ // | BC 2 | 2 | -1 |
+ // Also `yy` always returns the last two digits of a year,
+ // while `uu` pads single digit years to 2 characters and returns other years unchanged.
+ u: function (date, token) {
+ const year = date.getFullYear();
+ return (0, _index6.addLeadingZeros)(year, token.length);
+ },
+
+ // Quarter
+ Q: function (date, token, localize) {
+ const quarter = Math.ceil((date.getMonth() + 1) / 3);
+ switch (token) {
+ // 1, 2, 3, 4
+ case "Q":
+ return String(quarter);
+ // 01, 02, 03, 04
+ case "QQ":
+ return (0, _index6.addLeadingZeros)(quarter, 2);
+ // 1st, 2nd, 3rd, 4th
+ case "Qo":
+ return localize.ordinalNumber(quarter, { unit: "quarter" });
+ // Q1, Q2, Q3, Q4
+ case "QQQ":
+ return localize.quarter(quarter, {
+ width: "abbreviated",
+ context: "formatting",
+ });
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
+ case "QQQQQ":
+ return localize.quarter(quarter, {
+ width: "narrow",
+ context: "formatting",
+ });
+ // 1st quarter, 2nd quarter, ...
+ case "QQQQ":
+ default:
+ return localize.quarter(quarter, {
+ width: "wide",
+ context: "formatting",
+ });
+ }
+ },
+
+ // Stand-alone quarter
+ q: function (date, token, localize) {
+ const quarter = Math.ceil((date.getMonth() + 1) / 3);
+ switch (token) {
+ // 1, 2, 3, 4
+ case "q":
+ return String(quarter);
+ // 01, 02, 03, 04
+ case "qq":
+ return (0, _index6.addLeadingZeros)(quarter, 2);
+ // 1st, 2nd, 3rd, 4th
+ case "qo":
+ return localize.ordinalNumber(quarter, { unit: "quarter" });
+ // Q1, Q2, Q3, Q4
+ case "qqq":
+ return localize.quarter(quarter, {
+ width: "abbreviated",
+ context: "standalone",
+ });
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
+ case "qqqqq":
+ return localize.quarter(quarter, {
+ width: "narrow",
+ context: "standalone",
+ });
+ // 1st quarter, 2nd quarter, ...
+ case "qqqq":
+ default:
+ return localize.quarter(quarter, {
+ width: "wide",
+ context: "standalone",
+ });
+ }
+ },
+
+ // Month
+ M: function (date, token, localize) {
+ const month = date.getMonth();
+ switch (token) {
+ case "M":
+ case "MM":
+ return _index7.lightFormatters.M(date, token);
+ // 1st, 2nd, ..., 12th
+ case "Mo":
+ return localize.ordinalNumber(month + 1, { unit: "month" });
+ // Jan, Feb, ..., Dec
+ case "MMM":
+ return localize.month(month, {
+ width: "abbreviated",
+ context: "formatting",
+ });
+ // J, F, ..., D
+ case "MMMMM":
+ return localize.month(month, {
+ width: "narrow",
+ context: "formatting",
+ });
+ // January, February, ..., December
+ case "MMMM":
+ default:
+ return localize.month(month, { width: "wide", context: "formatting" });
+ }
+ },
+
+ // Stand-alone month
+ L: function (date, token, localize) {
+ const month = date.getMonth();
+ switch (token) {
+ // 1, 2, ..., 12
+ case "L":
+ return String(month + 1);
+ // 01, 02, ..., 12
+ case "LL":
+ return (0, _index6.addLeadingZeros)(month + 1, 2);
+ // 1st, 2nd, ..., 12th
+ case "Lo":
+ return localize.ordinalNumber(month + 1, { unit: "month" });
+ // Jan, Feb, ..., Dec
+ case "LLL":
+ return localize.month(month, {
+ width: "abbreviated",
+ context: "standalone",
+ });
+ // J, F, ..., D
+ case "LLLLL":
+ return localize.month(month, {
+ width: "narrow",
+ context: "standalone",
+ });
+ // January, February, ..., December
+ case "LLLL":
+ default:
+ return localize.month(month, { width: "wide", context: "standalone" });
+ }
+ },
+
+ // Local week of year
+ w: function (date, token, localize, options) {
+ const week = (0, _index4.getWeek)(date, options);
+
+ if (token === "wo") {
+ return localize.ordinalNumber(week, { unit: "week" });
+ }
+
+ return (0, _index6.addLeadingZeros)(week, token.length);
+ },
+
+ // ISO week of year
+ I: function (date, token, localize) {
+ const isoWeek = (0, _index2.getISOWeek)(date);
+
+ if (token === "Io") {
+ return localize.ordinalNumber(isoWeek, { unit: "week" });
+ }
+
+ return (0, _index6.addLeadingZeros)(isoWeek, token.length);
+ },
+
+ // Day of the month
+ d: function (date, token, localize) {
+ if (token === "do") {
+ return localize.ordinalNumber(date.getDate(), { unit: "date" });
+ }
+
+ return _index7.lightFormatters.d(date, token);
+ },
+
+ // Day of year
+ D: function (date, token, localize) {
+ const dayOfYear = (0, _index.getDayOfYear)(date);
+
+ if (token === "Do") {
+ return localize.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
+ }
+
+ return (0, _index6.addLeadingZeros)(dayOfYear, token.length);
+ },
+
+ // Day of week
+ E: function (date, token, localize) {
+ const dayOfWeek = date.getDay();
+ switch (token) {
+ // Tue
+ case "E":
+ case "EE":
+ case "EEE":
+ return localize.day(dayOfWeek, {
+ width: "abbreviated",
+ context: "formatting",
+ });
+ // T
+ case "EEEEE":
+ return localize.day(dayOfWeek, {
+ width: "narrow",
+ context: "formatting",
+ });
+ // Tu
+ case "EEEEEE":
+ return localize.day(dayOfWeek, {
+ width: "short",
+ context: "formatting",
+ });
+ // Tuesday
+ case "EEEE":
+ default:
+ return localize.day(dayOfWeek, {
+ width: "wide",
+ context: "formatting",
+ });
+ }
+ },
+
+ // Local day of week
+ e: function (date, token, localize, options) {
+ const dayOfWeek = date.getDay();
+ const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
+ switch (token) {
+ // Numerical value (Nth day of week with current locale or weekStartsOn)
+ case "e":
+ return String(localDayOfWeek);
+ // Padded numerical value
+ case "ee":
+ return (0, _index6.addLeadingZeros)(localDayOfWeek, 2);
+ // 1st, 2nd, ..., 7th
+ case "eo":
+ return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
+ case "eee":
+ return localize.day(dayOfWeek, {
+ width: "abbreviated",
+ context: "formatting",
+ });
+ // T
+ case "eeeee":
+ return localize.day(dayOfWeek, {
+ width: "narrow",
+ context: "formatting",
+ });
+ // Tu
+ case "eeeeee":
+ return localize.day(dayOfWeek, {
+ width: "short",
+ context: "formatting",
+ });
+ // Tuesday
+ case "eeee":
+ default:
+ return localize.day(dayOfWeek, {
+ width: "wide",
+ context: "formatting",
+ });
+ }
+ },
+
+ // Stand-alone local day of week
+ c: function (date, token, localize, options) {
+ const dayOfWeek = date.getDay();
+ const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
+ switch (token) {
+ // Numerical value (same as in `e`)
+ case "c":
+ return String(localDayOfWeek);
+ // Padded numerical value
+ case "cc":
+ return (0, _index6.addLeadingZeros)(localDayOfWeek, token.length);
+ // 1st, 2nd, ..., 7th
+ case "co":
+ return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
+ case "ccc":
+ return localize.day(dayOfWeek, {
+ width: "abbreviated",
+ context: "standalone",
+ });
+ // T
+ case "ccccc":
+ return localize.day(dayOfWeek, {
+ width: "narrow",
+ context: "standalone",
+ });
+ // Tu
+ case "cccccc":
+ return localize.day(dayOfWeek, {
+ width: "short",
+ context: "standalone",
+ });
+ // Tuesday
+ case "cccc":
+ default:
+ return localize.day(dayOfWeek, {
+ width: "wide",
+ context: "standalone",
+ });
+ }
+ },
+
+ // ISO day of week
+ i: function (date, token, localize) {
+ const dayOfWeek = date.getDay();
+ const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
+ switch (token) {
+ // 2
+ case "i":
+ return String(isoDayOfWeek);
+ // 02
+ case "ii":
+ return (0, _index6.addLeadingZeros)(isoDayOfWeek, token.length);
+ // 2nd
+ case "io":
+ return localize.ordinalNumber(isoDayOfWeek, { unit: "day" });
+ // Tue
+ case "iii":
+ return localize.day(dayOfWeek, {
+ width: "abbreviated",
+ context: "formatting",
+ });
+ // T
+ case "iiiii":
+ return localize.day(dayOfWeek, {
+ width: "narrow",
+ context: "formatting",
+ });
+ // Tu
+ case "iiiiii":
+ return localize.day(dayOfWeek, {
+ width: "short",
+ context: "formatting",
+ });
+ // Tuesday
+ case "iiii":
+ default:
+ return localize.day(dayOfWeek, {
+ width: "wide",
+ context: "formatting",
+ });
+ }
+ },
+
+ // AM or PM
+ a: function (date, token, localize) {
+ const hours = date.getHours();
+ const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
+
+ switch (token) {
+ case "a":
+ case "aa":
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: "abbreviated",
+ context: "formatting",
+ });
+ case "aaa":
+ return localize
+ .dayPeriod(dayPeriodEnumValue, {
+ width: "abbreviated",
+ context: "formatting",
+ })
+ .toLowerCase();
+ case "aaaaa":
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: "narrow",
+ context: "formatting",
+ });
+ case "aaaa":
+ default:
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: "wide",
+ context: "formatting",
+ });
+ }
+ },
+
+ // AM, PM, midnight, noon
+ b: function (date, token, localize) {
+ const hours = date.getHours();
+ let dayPeriodEnumValue;
+ if (hours === 12) {
+ dayPeriodEnumValue = dayPeriodEnum.noon;
+ } else if (hours === 0) {
+ dayPeriodEnumValue = dayPeriodEnum.midnight;
+ } else {
+ dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
+ }
+
+ switch (token) {
+ case "b":
+ case "bb":
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: "abbreviated",
+ context: "formatting",
+ });
+ case "bbb":
+ return localize
+ .dayPeriod(dayPeriodEnumValue, {
+ width: "abbreviated",
+ context: "formatting",
+ })
+ .toLowerCase();
+ case "bbbbb":
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: "narrow",
+ context: "formatting",
+ });
+ case "bbbb":
+ default:
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: "wide",
+ context: "formatting",
+ });
+ }
+ },
+
+ // in the morning, in the afternoon, in the evening, at night
+ B: function (date, token, localize) {
+ const hours = date.getHours();
+ let dayPeriodEnumValue;
+ if (hours >= 17) {
+ dayPeriodEnumValue = dayPeriodEnum.evening;
+ } else if (hours >= 12) {
+ dayPeriodEnumValue = dayPeriodEnum.afternoon;
+ } else if (hours >= 4) {
+ dayPeriodEnumValue = dayPeriodEnum.morning;
+ } else {
+ dayPeriodEnumValue = dayPeriodEnum.night;
+ }
+
+ switch (token) {
+ case "B":
+ case "BB":
+ case "BBB":
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: "abbreviated",
+ context: "formatting",
+ });
+ case "BBBBB":
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: "narrow",
+ context: "formatting",
+ });
+ case "BBBB":
+ default:
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: "wide",
+ context: "formatting",
+ });
+ }
+ },
+
+ // Hour [1-12]
+ h: function (date, token, localize) {
+ if (token === "ho") {
+ let hours = date.getHours() % 12;
+ if (hours === 0) hours = 12;
+ return localize.ordinalNumber(hours, { unit: "hour" });
+ }
+
+ return _index7.lightFormatters.h(date, token);
+ },
+
+ // Hour [0-23]
+ H: function (date, token, localize) {
+ if (token === "Ho") {
+ return localize.ordinalNumber(date.getHours(), { unit: "hour" });
+ }
+
+ return _index7.lightFormatters.H(date, token);
+ },
+
+ // Hour [0-11]
+ K: function (date, token, localize) {
+ const hours = date.getHours() % 12;
+
+ if (token === "Ko") {
+ return localize.ordinalNumber(hours, { unit: "hour" });
+ }
+
+ return (0, _index6.addLeadingZeros)(hours, token.length);
+ },
+
+ // Hour [1-24]
+ k: function (date, token, localize) {
+ let hours = date.getHours();
+ if (hours === 0) hours = 24;
+
+ if (token === "ko") {
+ return localize.ordinalNumber(hours, { unit: "hour" });
+ }
+
+ return (0, _index6.addLeadingZeros)(hours, token.length);
+ },
+
+ // Minute
+ m: function (date, token, localize) {
+ if (token === "mo") {
+ return localize.ordinalNumber(date.getMinutes(), { unit: "minute" });
+ }
+
+ return _index7.lightFormatters.m(date, token);
+ },
+
+ // Second
+ s: function (date, token, localize) {
+ if (token === "so") {
+ return localize.ordinalNumber(date.getSeconds(), { unit: "second" });
+ }
+
+ return _index7.lightFormatters.s(date, token);
+ },
+
+ // Fraction of second
+ S: function (date, token) {
+ return _index7.lightFormatters.S(date, token);
+ },
+
+ // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
+ X: function (date, token, _localize) {
+ const timezoneOffset = date.getTimezoneOffset();
+
+ if (timezoneOffset === 0) {
+ return "Z";
+ }
+
+ switch (token) {
+ // Hours and optional minutes
+ case "X":
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
+
+ // Hours, minutes and optional seconds without `:` delimiter
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
+ // so this token always has the same output as `XX`
+ case "XXXX":
+ case "XX": // Hours and minutes without `:` delimiter
+ return formatTimezone(timezoneOffset);
+
+ // Hours, minutes and optional seconds with `:` delimiter
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
+ // so this token always has the same output as `XXX`
+ case "XXXXX":
+ case "XXX": // Hours and minutes with `:` delimiter
+ default:
+ return formatTimezone(timezoneOffset, ":");
+ }
+ },
+
+ // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
+ x: function (date, token, _localize) {
+ const timezoneOffset = date.getTimezoneOffset();
+
+ switch (token) {
+ // Hours and optional minutes
+ case "x":
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
+
+ // Hours, minutes and optional seconds without `:` delimiter
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
+ // so this token always has the same output as `xx`
+ case "xxxx":
+ case "xx": // Hours and minutes without `:` delimiter
+ return formatTimezone(timezoneOffset);
+
+ // Hours, minutes and optional seconds with `:` delimiter
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
+ // so this token always has the same output as `xxx`
+ case "xxxxx":
+ case "xxx": // Hours and minutes with `:` delimiter
+ default:
+ return formatTimezone(timezoneOffset, ":");
+ }
+ },
+
+ // Timezone (GMT)
+ O: function (date, token, _localize) {
+ const timezoneOffset = date.getTimezoneOffset();
+
+ switch (token) {
+ // Short
+ case "O":
+ case "OO":
+ case "OOO":
+ return "GMT" + formatTimezoneShort(timezoneOffset, ":");
+ // Long
+ case "OOOO":
+ default:
+ return "GMT" + formatTimezone(timezoneOffset, ":");
+ }
+ },
+
+ // Timezone (specific non-location)
+ z: function (date, token, _localize) {
+ const timezoneOffset = date.getTimezoneOffset();
+
+ switch (token) {
+ // Short
+ case "z":
+ case "zz":
+ case "zzz":
+ return "GMT" + formatTimezoneShort(timezoneOffset, ":");
+ // Long
+ case "zzzz":
+ default:
+ return "GMT" + formatTimezone(timezoneOffset, ":");
+ }
+ },
+
+ // Seconds timestamp
+ t: function (date, token, _localize) {
+ const timestamp = Math.trunc(+date / 1000);
+ return (0, _index6.addLeadingZeros)(timestamp, token.length);
+ },
+
+ // Milliseconds timestamp
+ T: function (date, token, _localize) {
+ return (0, _index6.addLeadingZeros)(+date, token.length);
+ },
+});
+
+function formatTimezoneShort(offset, delimiter = "") {
+ const sign = offset > 0 ? "-" : "+";
+ const absOffset = Math.abs(offset);
+ const hours = Math.trunc(absOffset / 60);
+ const minutes = absOffset % 60;
+ if (minutes === 0) {
+ return sign + String(hours);
+ }
+ return (
+ sign + String(hours) + delimiter + (0, _index6.addLeadingZeros)(minutes, 2)
+ );
+}
+
+function formatTimezoneWithOptionalMinutes(offset, delimiter) {
+ if (offset % 60 === 0) {
+ const sign = offset > 0 ? "-" : "+";
+ return sign + (0, _index6.addLeadingZeros)(Math.abs(offset) / 60, 2);
+ }
+ return formatTimezone(offset, delimiter);
+}
+
+function formatTimezone(offset, delimiter = "") {
+ const sign = offset > 0 ? "-" : "+";
+ const absOffset = Math.abs(offset);
+ const hours = (0, _index6.addLeadingZeros)(Math.trunc(absOffset / 60), 2);
+ const minutes = (0, _index6.addLeadingZeros)(absOffset % 60, 2);
+ return sign + hours + delimiter + minutes;
+}
diff --git a/node_modules/date-fns/_lib/format/formatters.d.cts b/node_modules/date-fns/_lib/format/formatters.d.cts
new file mode 100644
index 00000000..074f682c
--- /dev/null
+++ b/node_modules/date-fns/_lib/format/formatters.d.cts
@@ -0,0 +1,18 @@
+import type { Localize } from "../../locale/types.js";
+import type {
+ FirstWeekContainsDateOptions,
+ LocalizedOptions,
+ WeekOptions,
+} from "../../types.js";
+type Formatter = (
+ date: Date,
+ token: string,
+ localize: Localize,
+ options: Required<
+ LocalizedOptions<"options"> & WeekOptions & FirstWeekContainsDateOptions
+ >,
+) => string;
+export declare const formatters: {
+ [token: string]: Formatter;
+};
+export {};
diff --git a/node_modules/date-fns/_lib/format/formatters.d.ts b/node_modules/date-fns/_lib/format/formatters.d.ts
new file mode 100644
index 00000000..074f682c
--- /dev/null
+++ b/node_modules/date-fns/_lib/format/formatters.d.ts
@@ -0,0 +1,18 @@
+import type { Localize } from "../../locale/types.js";
+import type {
+ FirstWeekContainsDateOptions,
+ LocalizedOptions,
+ WeekOptions,
+} from "../../types.js";
+type Formatter = (
+ date: Date,
+ token: string,
+ localize: Localize,
+ options: Required<
+ LocalizedOptions<"options"> & WeekOptions & FirstWeekContainsDateOptions
+ >,
+) => string;
+export declare const formatters: {
+ [token: string]: Formatter;
+};
+export {};
diff --git a/node_modules/date-fns/_lib/format/formatters.js b/node_modules/date-fns/_lib/format/formatters.js
new file mode 100644
index 00000000..149f25de
--- /dev/null
+++ b/node_modules/date-fns/_lib/format/formatters.js
@@ -0,0 +1,776 @@
+import { getDayOfYear } from "../../getDayOfYear.js";
+import { getISOWeek } from "../../getISOWeek.js";
+import { getISOWeekYear } from "../../getISOWeekYear.js";
+import { getWeek } from "../../getWeek.js";
+import { getWeekYear } from "../../getWeekYear.js";
+
+import { addLeadingZeros } from "../addLeadingZeros.js";
+import { lightFormatters } from "./lightFormatters.js";
+
+const dayPeriodEnum = {
+ am: "am",
+ pm: "pm",
+ midnight: "midnight",
+ noon: "noon",
+ morning: "morning",
+ afternoon: "afternoon",
+ evening: "evening",
+ night: "night",
+};
+
+/*
+ * | | Unit | | Unit |
+ * |-----|--------------------------------|-----|--------------------------------|
+ * | a | AM, PM | A* | Milliseconds in day |
+ * | b | AM, PM, noon, midnight | B | Flexible day period |
+ * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
+ * | d | Day of month | D | Day of year |
+ * | e | Local day of week | E | Day of week |
+ * | f | | F* | Day of week in month |
+ * | g* | Modified Julian day | G | Era |
+ * | h | Hour [1-12] | H | Hour [0-23] |
+ * | i! | ISO day of week | I! | ISO week of year |
+ * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
+ * | k | Hour [1-24] | K | Hour [0-11] |
+ * | l* | (deprecated) | L | Stand-alone month |
+ * | m | Minute | M | Month |
+ * | n | | N | |
+ * | o! | Ordinal number modifier | O | Timezone (GMT) |
+ * | p! | Long localized time | P! | Long localized date |
+ * | q | Stand-alone quarter | Q | Quarter |
+ * | r* | Related Gregorian year | R! | ISO week-numbering year |
+ * | s | Second | S | Fraction of second |
+ * | t! | Seconds timestamp | T! | Milliseconds timestamp |
+ * | u | Extended year | U* | Cyclic year |
+ * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
+ * | w | Local week of year | W* | Week of month |
+ * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
+ * | y | Year (abs) | Y | Local week-numbering year |
+ * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
+ *
+ * Letters marked by * are not implemented but reserved by Unicode standard.
+ *
+ * Letters marked by ! are non-standard, but implemented by date-fns:
+ * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
+ * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
+ * i.e. 7 for Sunday, 1 for Monday, etc.
+ * - `I` is ISO week of year, as opposed to `w` which is local week of year.
+ * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
+ * `R` is supposed to be used in conjunction with `I` and `i`
+ * for universal ISO week-numbering date, whereas
+ * `Y` is supposed to be used in conjunction with `w` and `e`
+ * for week-numbering date specific to the locale.
+ * - `P` is long localized date format
+ * - `p` is long localized time format
+ */
+
+export const formatters = {
+ // Era
+ G: function (date, token, localize) {
+ const era = date.getFullYear() > 0 ? 1 : 0;
+ switch (token) {
+ // AD, BC
+ case "G":
+ case "GG":
+ case "GGG":
+ return localize.era(era, { width: "abbreviated" });
+ // A, B
+ case "GGGGG":
+ return localize.era(era, { width: "narrow" });
+ // Anno Domini, Before Christ
+ case "GGGG":
+ default:
+ return localize.era(era, { width: "wide" });
+ }
+ },
+
+ // Year
+ y: function (date, token, localize) {
+ // Ordinal number
+ if (token === "yo") {
+ const signedYear = date.getFullYear();
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
+ const year = signedYear > 0 ? signedYear : 1 - signedYear;
+ return localize.ordinalNumber(year, { unit: "year" });
+ }
+
+ return lightFormatters.y(date, token);
+ },
+
+ // Local week-numbering year
+ Y: function (date, token, localize, options) {
+ const signedWeekYear = getWeekYear(date, options);
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
+ const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
+
+ // Two digit year
+ if (token === "YY") {
+ const twoDigitYear = weekYear % 100;
+ return addLeadingZeros(twoDigitYear, 2);
+ }
+
+ // Ordinal number
+ if (token === "Yo") {
+ return localize.ordinalNumber(weekYear, { unit: "year" });
+ }
+
+ // Padding
+ return addLeadingZeros(weekYear, token.length);
+ },
+
+ // ISO week-numbering year
+ R: function (date, token) {
+ const isoWeekYear = getISOWeekYear(date);
+
+ // Padding
+ return addLeadingZeros(isoWeekYear, token.length);
+ },
+
+ // Extended year. This is a single number designating the year of this calendar system.
+ // The main difference between `y` and `u` localizers are B.C. years:
+ // | Year | `y` | `u` |
+ // |------|-----|-----|
+ // | AC 1 | 1 | 1 |
+ // | BC 1 | 1 | 0 |
+ // | BC 2 | 2 | -1 |
+ // Also `yy` always returns the last two digits of a year,
+ // while `uu` pads single digit years to 2 characters and returns other years unchanged.
+ u: function (date, token) {
+ const year = date.getFullYear();
+ return addLeadingZeros(year, token.length);
+ },
+
+ // Quarter
+ Q: function (date, token, localize) {
+ const quarter = Math.ceil((date.getMonth() + 1) / 3);
+ switch (token) {
+ // 1, 2, 3, 4
+ case "Q":
+ return String(quarter);
+ // 01, 02, 03, 04
+ case "QQ":
+ return addLeadingZeros(quarter, 2);
+ // 1st, 2nd, 3rd, 4th
+ case "Qo":
+ return localize.ordinalNumber(quarter, { unit: "quarter" });
+ // Q1, Q2, Q3, Q4
+ case "QQQ":
+ return localize.quarter(quarter, {
+ width: "abbreviated",
+ context: "formatting",
+ });
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
+ case "QQQQQ":
+ return localize.quarter(quarter, {
+ width: "narrow",
+ context: "formatting",
+ });
+ // 1st quarter, 2nd quarter, ...
+ case "QQQQ":
+ default:
+ return localize.quarter(quarter, {
+ width: "wide",
+ context: "formatting",
+ });
+ }
+ },
+
+ // Stand-alone quarter
+ q: function (date, token, localize) {
+ const quarter = Math.ceil((date.getMonth() + 1) / 3);
+ switch (token) {
+ // 1, 2, 3, 4
+ case "q":
+ return String(quarter);
+ // 01, 02, 03, 04
+ case "qq":
+ return addLeadingZeros(quarter, 2);
+ // 1st, 2nd, 3rd, 4th
+ case "qo":
+ return localize.ordinalNumber(quarter, { unit: "quarter" });
+ // Q1, Q2, Q3, Q4
+ case "qqq":
+ return localize.quarter(quarter, {
+ width: "abbreviated",
+ context: "standalone",
+ });
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
+ case "qqqqq":
+ return localize.quarter(quarter, {
+ width: "narrow",
+ context: "standalone",
+ });
+ // 1st quarter, 2nd quarter, ...
+ case "qqqq":
+ default:
+ return localize.quarter(quarter, {
+ width: "wide",
+ context: "standalone",
+ });
+ }
+ },
+
+ // Month
+ M: function (date, token, localize) {
+ const month = date.getMonth();
+ switch (token) {
+ case "M":
+ case "MM":
+ return lightFormatters.M(date, token);
+ // 1st, 2nd, ..., 12th
+ case "Mo":
+ return localize.ordinalNumber(month + 1, { unit: "month" });
+ // Jan, Feb, ..., Dec
+ case "MMM":
+ return localize.month(month, {
+ width: "abbreviated",
+ context: "formatting",
+ });
+ // J, F, ..., D
+ case "MMMMM":
+ return localize.month(month, {
+ width: "narrow",
+ context: "formatting",
+ });
+ // January, February, ..., December
+ case "MMMM":
+ default:
+ return localize.month(month, { width: "wide", context: "formatting" });
+ }
+ },
+
+ // Stand-alone month
+ L: function (date, token, localize) {
+ const month = date.getMonth();
+ switch (token) {
+ // 1, 2, ..., 12
+ case "L":
+ return String(month + 1);
+ // 01, 02, ..., 12
+ case "LL":
+ return addLeadingZeros(month + 1, 2);
+ // 1st, 2nd, ..., 12th
+ case "Lo":
+ return localize.ordinalNumber(month + 1, { unit: "month" });
+ // Jan, Feb, ..., Dec
+ case "LLL":
+ return localize.month(month, {
+ width: "abbreviated",
+ context: "standalone",
+ });
+ // J, F, ..., D
+ case "LLLLL":
+ return localize.month(month, {
+ width: "narrow",
+ context: "standalone",
+ });
+ // January, February, ..., December
+ case "LLLL":
+ default:
+ return localize.month(month, { width: "wide", context: "standalone" });
+ }
+ },
+
+ // Local week of year
+ w: function (date, token, localize, options) {
+ const week = getWeek(date, options);
+
+ if (token === "wo") {
+ return localize.ordinalNumber(week, { unit: "week" });
+ }
+
+ return addLeadingZeros(week, token.length);
+ },
+
+ // ISO week of year
+ I: function (date, token, localize) {
+ const isoWeek = getISOWeek(date);
+
+ if (token === "Io") {
+ return localize.ordinalNumber(isoWeek, { unit: "week" });
+ }
+
+ return addLeadingZeros(isoWeek, token.length);
+ },
+
+ // Day of the month
+ d: function (date, token, localize) {
+ if (token === "do") {
+ return localize.ordinalNumber(date.getDate(), { unit: "date" });
+ }
+
+ return lightFormatters.d(date, token);
+ },
+
+ // Day of year
+ D: function (date, token, localize) {
+ const dayOfYear = getDayOfYear(date);
+
+ if (token === "Do") {
+ return localize.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
+ }
+
+ return addLeadingZeros(dayOfYear, token.length);
+ },
+
+ // Day of week
+ E: function (date, token, localize) {
+ const dayOfWeek = date.getDay();
+ switch (token) {
+ // Tue
+ case "E":
+ case "EE":
+ case "EEE":
+ return localize.day(dayOfWeek, {
+ width: "abbreviated",
+ context: "formatting",
+ });
+ // T
+ case "EEEEE":
+ return localize.day(dayOfWeek, {
+ width: "narrow",
+ context: "formatting",
+ });
+ // Tu
+ case "EEEEEE":
+ return localize.day(dayOfWeek, {
+ width: "short",
+ context: "formatting",
+ });
+ // Tuesday
+ case "EEEE":
+ default:
+ return localize.day(dayOfWeek, {
+ width: "wide",
+ context: "formatting",
+ });
+ }
+ },
+
+ // Local day of week
+ e: function (date, token, localize, options) {
+ const dayOfWeek = date.getDay();
+ const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
+ switch (token) {
+ // Numerical value (Nth day of week with current locale or weekStartsOn)
+ case "e":
+ return String(localDayOfWeek);
+ // Padded numerical value
+ case "ee":
+ return addLeadingZeros(localDayOfWeek, 2);
+ // 1st, 2nd, ..., 7th
+ case "eo":
+ return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
+ case "eee":
+ return localize.day(dayOfWeek, {
+ width: "abbreviated",
+ context: "formatting",
+ });
+ // T
+ case "eeeee":
+ return localize.day(dayOfWeek, {
+ width: "narrow",
+ context: "formatting",
+ });
+ // Tu
+ case "eeeeee":
+ return localize.day(dayOfWeek, {
+ width: "short",
+ context: "formatting",
+ });
+ // Tuesday
+ case "eeee":
+ default:
+ return localize.day(dayOfWeek, {
+ width: "wide",
+ context: "formatting",
+ });
+ }
+ },
+
+ // Stand-alone local day of week
+ c: function (date, token, localize, options) {
+ const dayOfWeek = date.getDay();
+ const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
+ switch (token) {
+ // Numerical value (same as in `e`)
+ case "c":
+ return String(localDayOfWeek);
+ // Padded numerical value
+ case "cc":
+ return addLeadingZeros(localDayOfWeek, token.length);
+ // 1st, 2nd, ..., 7th
+ case "co":
+ return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
+ case "ccc":
+ return localize.day(dayOfWeek, {
+ width: "abbreviated",
+ context: "standalone",
+ });
+ // T
+ case "ccccc":
+ return localize.day(dayOfWeek, {
+ width: "narrow",
+ context: "standalone",
+ });
+ // Tu
+ case "cccccc":
+ return localize.day(dayOfWeek, {
+ width: "short",
+ context: "standalone",
+ });
+ // Tuesday
+ case "cccc":
+ default:
+ return localize.day(dayOfWeek, {
+ width: "wide",
+ context: "standalone",
+ });
+ }
+ },
+
+ // ISO day of week
+ i: function (date, token, localize) {
+ const dayOfWeek = date.getDay();
+ const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
+ switch (token) {
+ // 2
+ case "i":
+ return String(isoDayOfWeek);
+ // 02
+ case "ii":
+ return addLeadingZeros(isoDayOfWeek, token.length);
+ // 2nd
+ case "io":
+ return localize.ordinalNumber(isoDayOfWeek, { unit: "day" });
+ // Tue
+ case "iii":
+ return localize.day(dayOfWeek, {
+ width: "abbreviated",
+ context: "formatting",
+ });
+ // T
+ case "iiiii":
+ return localize.day(dayOfWeek, {
+ width: "narrow",
+ context: "formatting",
+ });
+ // Tu
+ case "iiiiii":
+ return localize.day(dayOfWeek, {
+ width: "short",
+ context: "formatting",
+ });
+ // Tuesday
+ case "iiii":
+ default:
+ return localize.day(dayOfWeek, {
+ width: "wide",
+ context: "formatting",
+ });
+ }
+ },
+
+ // AM or PM
+ a: function (date, token, localize) {
+ const hours = date.getHours();
+ const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
+
+ switch (token) {
+ case "a":
+ case "aa":
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: "abbreviated",
+ context: "formatting",
+ });
+ case "aaa":
+ return localize
+ .dayPeriod(dayPeriodEnumValue, {
+ width: "abbreviated",
+ context: "formatting",
+ })
+ .toLowerCase();
+ case "aaaaa":
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: "narrow",
+ context: "formatting",
+ });
+ case "aaaa":
+ default:
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: "wide",
+ context: "formatting",
+ });
+ }
+ },
+
+ // AM, PM, midnight, noon
+ b: function (date, token, localize) {
+ const hours = date.getHours();
+ let dayPeriodEnumValue;
+ if (hours === 12) {
+ dayPeriodEnumValue = dayPeriodEnum.noon;
+ } else if (hours === 0) {
+ dayPeriodEnumValue = dayPeriodEnum.midnight;
+ } else {
+ dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
+ }
+
+ switch (token) {
+ case "b":
+ case "bb":
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: "abbreviated",
+ context: "formatting",
+ });
+ case "bbb":
+ return localize
+ .dayPeriod(dayPeriodEnumValue, {
+ width: "abbreviated",
+ context: "formatting",
+ })
+ .toLowerCase();
+ case "bbbbb":
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: "narrow",
+ context: "formatting",
+ });
+ case "bbbb":
+ default:
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: "wide",
+ context: "formatting",
+ });
+ }
+ },
+
+ // in the morning, in the afternoon, in the evening, at night
+ B: function (date, token, localize) {
+ const hours = date.getHours();
+ let dayPeriodEnumValue;
+ if (hours >= 17) {
+ dayPeriodEnumValue = dayPeriodEnum.evening;
+ } else if (hours >= 12) {
+ dayPeriodEnumValue = dayPeriodEnum.afternoon;
+ } else if (hours >= 4) {
+ dayPeriodEnumValue = dayPeriodEnum.morning;
+ } else {
+ dayPeriodEnumValue = dayPeriodEnum.night;
+ }
+
+ switch (token) {
+ case "B":
+ case "BB":
+ case "BBB":
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: "abbreviated",
+ context: "formatting",
+ });
+ case "BBBBB":
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: "narrow",
+ context: "formatting",
+ });
+ case "BBBB":
+ default:
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: "wide",
+ context: "formatting",
+ });
+ }
+ },
+
+ // Hour [1-12]
+ h: function (date, token, localize) {
+ if (token === "ho") {
+ let hours = date.getHours() % 12;
+ if (hours === 0) hours = 12;
+ return localize.ordinalNumber(hours, { unit: "hour" });
+ }
+
+ return lightFormatters.h(date, token);
+ },
+
+ // Hour [0-23]
+ H: function (date, token, localize) {
+ if (token === "Ho") {
+ return localize.ordinalNumber(date.getHours(), { unit: "hour" });
+ }
+
+ return lightFormatters.H(date, token);
+ },
+
+ // Hour [0-11]
+ K: function (date, token, localize) {
+ const hours = date.getHours() % 12;
+
+ if (token === "Ko") {
+ return localize.ordinalNumber(hours, { unit: "hour" });
+ }
+
+ return addLeadingZeros(hours, token.length);
+ },
+
+ // Hour [1-24]
+ k: function (date, token, localize) {
+ let hours = date.getHours();
+ if (hours === 0) hours = 24;
+
+ if (token === "ko") {
+ return localize.ordinalNumber(hours, { unit: "hour" });
+ }
+
+ return addLeadingZeros(hours, token.length);
+ },
+
+ // Minute
+ m: function (date, token, localize) {
+ if (token === "mo") {
+ return localize.ordinalNumber(date.getMinutes(), { unit: "minute" });
+ }
+
+ return lightFormatters.m(date, token);
+ },
+
+ // Second
+ s: function (date, token, localize) {
+ if (token === "so") {
+ return localize.ordinalNumber(date.getSeconds(), { unit: "second" });
+ }
+
+ return lightFormatters.s(date, token);
+ },
+
+ // Fraction of second
+ S: function (date, token) {
+ return lightFormatters.S(date, token);
+ },
+
+ // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
+ X: function (date, token, _localize) {
+ const timezoneOffset = date.getTimezoneOffset();
+
+ if (timezoneOffset === 0) {
+ return "Z";
+ }
+
+ switch (token) {
+ // Hours and optional minutes
+ case "X":
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
+
+ // Hours, minutes and optional seconds without `:` delimiter
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
+ // so this token always has the same output as `XX`
+ case "XXXX":
+ case "XX": // Hours and minutes without `:` delimiter
+ return formatTimezone(timezoneOffset);
+
+ // Hours, minutes and optional seconds with `:` delimiter
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
+ // so this token always has the same output as `XXX`
+ case "XXXXX":
+ case "XXX": // Hours and minutes with `:` delimiter
+ default:
+ return formatTimezone(timezoneOffset, ":");
+ }
+ },
+
+ // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
+ x: function (date, token, _localize) {
+ const timezoneOffset = date.getTimezoneOffset();
+
+ switch (token) {
+ // Hours and optional minutes
+ case "x":
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
+
+ // Hours, minutes and optional seconds without `:` delimiter
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
+ // so this token always has the same output as `xx`
+ case "xxxx":
+ case "xx": // Hours and minutes without `:` delimiter
+ return formatTimezone(timezoneOffset);
+
+ // Hours, minutes and optional seconds with `:` delimiter
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
+ // so this token always has the same output as `xxx`
+ case "xxxxx":
+ case "xxx": // Hours and minutes with `:` delimiter
+ default:
+ return formatTimezone(timezoneOffset, ":");
+ }
+ },
+
+ // Timezone (GMT)
+ O: function (date, token, _localize) {
+ const timezoneOffset = date.getTimezoneOffset();
+
+ switch (token) {
+ // Short
+ case "O":
+ case "OO":
+ case "OOO":
+ return "GMT" + formatTimezoneShort(timezoneOffset, ":");
+ // Long
+ case "OOOO":
+ default:
+ return "GMT" + formatTimezone(timezoneOffset, ":");
+ }
+ },
+
+ // Timezone (specific non-location)
+ z: function (date, token, _localize) {
+ const timezoneOffset = date.getTimezoneOffset();
+
+ switch (token) {
+ // Short
+ case "z":
+ case "zz":
+ case "zzz":
+ return "GMT" + formatTimezoneShort(timezoneOffset, ":");
+ // Long
+ case "zzzz":
+ default:
+ return "GMT" + formatTimezone(timezoneOffset, ":");
+ }
+ },
+
+ // Seconds timestamp
+ t: function (date, token, _localize) {
+ const timestamp = Math.trunc(+date / 1000);
+ return addLeadingZeros(timestamp, token.length);
+ },
+
+ // Milliseconds timestamp
+ T: function (date, token, _localize) {
+ return addLeadingZeros(+date, token.length);
+ },
+};
+
+function formatTimezoneShort(offset, delimiter = "") {
+ const sign = offset > 0 ? "-" : "+";
+ const absOffset = Math.abs(offset);
+ const hours = Math.trunc(absOffset / 60);
+ const minutes = absOffset % 60;
+ if (minutes === 0) {
+ return sign + String(hours);
+ }
+ return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
+}
+
+function formatTimezoneWithOptionalMinutes(offset, delimiter) {
+ if (offset % 60 === 0) {
+ const sign = offset > 0 ? "-" : "+";
+ return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
+ }
+ return formatTimezone(offset, delimiter);
+}
+
+function formatTimezone(offset, delimiter = "") {
+ const sign = offset > 0 ? "-" : "+";
+ const absOffset = Math.abs(offset);
+ const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);
+ const minutes = addLeadingZeros(absOffset % 60, 2);
+ return sign + hours + delimiter + minutes;
+}
diff --git a/node_modules/date-fns/_lib/format/lightFormatters.cjs b/node_modules/date-fns/_lib/format/lightFormatters.cjs
new file mode 100644
index 00000000..2036711f
--- /dev/null
+++ b/node_modules/date-fns/_lib/format/lightFormatters.cjs
@@ -0,0 +1,102 @@
+"use strict";
+exports.lightFormatters = void 0;
+var _index = require("../addLeadingZeros.cjs");
+
+/*
+ * | | Unit | | Unit |
+ * |-----|--------------------------------|-----|--------------------------------|
+ * | a | AM, PM | A* | |
+ * | d | Day of month | D | |
+ * | h | Hour [1-12] | H | Hour [0-23] |
+ * | m | Minute | M | Month |
+ * | s | Second | S | Fraction of second |
+ * | y | Year (abs) | Y | |
+ *
+ * Letters marked by * are not implemented but reserved by Unicode standard.
+ */
+
+const lightFormatters = (exports.lightFormatters = {
+ // Year
+ y(date, token) {
+ // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
+ // | Year | y | yy | yyy | yyyy | yyyyy |
+ // |----------|-------|----|-------|-------|-------|
+ // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
+ // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
+ // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
+ // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
+ // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
+
+ const signedYear = date.getFullYear();
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
+ const year = signedYear > 0 ? signedYear : 1 - signedYear;
+ return (0, _index.addLeadingZeros)(
+ token === "yy" ? year % 100 : year,
+ token.length,
+ );
+ },
+
+ // Month
+ M(date, token) {
+ const month = date.getMonth();
+ return token === "M"
+ ? String(month + 1)
+ : (0, _index.addLeadingZeros)(month + 1, 2);
+ },
+
+ // Day of the month
+ d(date, token) {
+ return (0, _index.addLeadingZeros)(date.getDate(), token.length);
+ },
+
+ // AM or PM
+ a(date, token) {
+ const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
+
+ switch (token) {
+ case "a":
+ case "aa":
+ return dayPeriodEnumValue.toUpperCase();
+ case "aaa":
+ return dayPeriodEnumValue;
+ case "aaaaa":
+ return dayPeriodEnumValue[0];
+ case "aaaa":
+ default:
+ return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
+ }
+ },
+
+ // Hour [1-12]
+ h(date, token) {
+ return (0, _index.addLeadingZeros)(
+ date.getHours() % 12 || 12,
+ token.length,
+ );
+ },
+
+ // Hour [0-23]
+ H(date, token) {
+ return (0, _index.addLeadingZeros)(date.getHours(), token.length);
+ },
+
+ // Minute
+ m(date, token) {
+ return (0, _index.addLeadingZeros)(date.getMinutes(), token.length);
+ },
+
+ // Second
+ s(date, token) {
+ return (0, _index.addLeadingZeros)(date.getSeconds(), token.length);
+ },
+
+ // Fraction of second
+ S(date, token) {
+ const numberOfDigits = token.length;
+ const milliseconds = date.getMilliseconds();
+ const fractionalSeconds = Math.trunc(
+ milliseconds * Math.pow(10, numberOfDigits - 3),
+ );
+ return (0, _index.addLeadingZeros)(fractionalSeconds, token.length);
+ },
+});
diff --git a/node_modules/date-fns/_lib/format/lightFormatters.d.cts b/node_modules/date-fns/_lib/format/lightFormatters.d.cts
new file mode 100644
index 00000000..602bbf62
--- /dev/null
+++ b/node_modules/date-fns/_lib/format/lightFormatters.d.cts
@@ -0,0 +1,11 @@
+export declare const lightFormatters: {
+ y(date: Date, token: string): string;
+ M(date: Date, token: string): string;
+ d(date: Date, token: string): string;
+ a(date: Date, token: string): string;
+ h(date: Date, token: string): string;
+ H(date: Date, token: string): string;
+ m(date: Date, token: string): string;
+ s(date: Date, token: string): string;
+ S(date: Date, token: string): string;
+};
diff --git a/node_modules/date-fns/_lib/format/lightFormatters.d.ts b/node_modules/date-fns/_lib/format/lightFormatters.d.ts
new file mode 100644
index 00000000..602bbf62
--- /dev/null
+++ b/node_modules/date-fns/_lib/format/lightFormatters.d.ts
@@ -0,0 +1,11 @@
+export declare const lightFormatters: {
+ y(date: Date, token: string): string;
+ M(date: Date, token: string): string;
+ d(date: Date, token: string): string;
+ a(date: Date, token: string): string;
+ h(date: Date, token: string): string;
+ H(date: Date, token: string): string;
+ m(date: Date, token: string): string;
+ s(date: Date, token: string): string;
+ S(date: Date, token: string): string;
+};
diff --git a/node_modules/date-fns/_lib/format/lightFormatters.js b/node_modules/date-fns/_lib/format/lightFormatters.js
new file mode 100644
index 00000000..c725ba58
--- /dev/null
+++ b/node_modules/date-fns/_lib/format/lightFormatters.js
@@ -0,0 +1,92 @@
+import { addLeadingZeros } from "../addLeadingZeros.js";
+
+/*
+ * | | Unit | | Unit |
+ * |-----|--------------------------------|-----|--------------------------------|
+ * | a | AM, PM | A* | |
+ * | d | Day of month | D | |
+ * | h | Hour [1-12] | H | Hour [0-23] |
+ * | m | Minute | M | Month |
+ * | s | Second | S | Fraction of second |
+ * | y | Year (abs) | Y | |
+ *
+ * Letters marked by * are not implemented but reserved by Unicode standard.
+ */
+
+export const lightFormatters = {
+ // Year
+ y(date, token) {
+ // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
+ // | Year | y | yy | yyy | yyyy | yyyyy |
+ // |----------|-------|----|-------|-------|-------|
+ // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
+ // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
+ // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
+ // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
+ // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
+
+ const signedYear = date.getFullYear();
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
+ const year = signedYear > 0 ? signedYear : 1 - signedYear;
+ return addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
+ },
+
+ // Month
+ M(date, token) {
+ const month = date.getMonth();
+ return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2);
+ },
+
+ // Day of the month
+ d(date, token) {
+ return addLeadingZeros(date.getDate(), token.length);
+ },
+
+ // AM or PM
+ a(date, token) {
+ const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
+
+ switch (token) {
+ case "a":
+ case "aa":
+ return dayPeriodEnumValue.toUpperCase();
+ case "aaa":
+ return dayPeriodEnumValue;
+ case "aaaaa":
+ return dayPeriodEnumValue[0];
+ case "aaaa":
+ default:
+ return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
+ }
+ },
+
+ // Hour [1-12]
+ h(date, token) {
+ return addLeadingZeros(date.getHours() % 12 || 12, token.length);
+ },
+
+ // Hour [0-23]
+ H(date, token) {
+ return addLeadingZeros(date.getHours(), token.length);
+ },
+
+ // Minute
+ m(date, token) {
+ return addLeadingZeros(date.getMinutes(), token.length);
+ },
+
+ // Second
+ s(date, token) {
+ return addLeadingZeros(date.getSeconds(), token.length);
+ },
+
+ // Fraction of second
+ S(date, token) {
+ const numberOfDigits = token.length;
+ const milliseconds = date.getMilliseconds();
+ const fractionalSeconds = Math.trunc(
+ milliseconds * Math.pow(10, numberOfDigits - 3),
+ );
+ return addLeadingZeros(fractionalSeconds, token.length);
+ },
+};
diff --git a/node_modules/date-fns/_lib/format/longFormatters.cjs b/node_modules/date-fns/_lib/format/longFormatters.cjs
new file mode 100644
index 00000000..ca4b1f62
--- /dev/null
+++ b/node_modules/date-fns/_lib/format/longFormatters.cjs
@@ -0,0 +1,67 @@
+"use strict";
+exports.longFormatters = void 0;
+
+const dateLongFormatter = (pattern, formatLong) => {
+ switch (pattern) {
+ case "P":
+ return formatLong.date({ width: "short" });
+ case "PP":
+ return formatLong.date({ width: "medium" });
+ case "PPP":
+ return formatLong.date({ width: "long" });
+ case "PPPP":
+ default:
+ return formatLong.date({ width: "full" });
+ }
+};
+
+const timeLongFormatter = (pattern, formatLong) => {
+ switch (pattern) {
+ case "p":
+ return formatLong.time({ width: "short" });
+ case "pp":
+ return formatLong.time({ width: "medium" });
+ case "ppp":
+ return formatLong.time({ width: "long" });
+ case "pppp":
+ default:
+ return formatLong.time({ width: "full" });
+ }
+};
+
+const dateTimeLongFormatter = (pattern, formatLong) => {
+ const matchResult = pattern.match(/(P+)(p+)?/) || [];
+ const datePattern = matchResult[1];
+ const timePattern = matchResult[2];
+
+ if (!timePattern) {
+ return dateLongFormatter(pattern, formatLong);
+ }
+
+ let dateTimeFormat;
+
+ switch (datePattern) {
+ case "P":
+ dateTimeFormat = formatLong.dateTime({ width: "short" });
+ break;
+ case "PP":
+ dateTimeFormat = formatLong.dateTime({ width: "medium" });
+ break;
+ case "PPP":
+ dateTimeFormat = formatLong.dateTime({ width: "long" });
+ break;
+ case "PPPP":
+ default:
+ dateTimeFormat = formatLong.dateTime({ width: "full" });
+ break;
+ }
+
+ return dateTimeFormat
+ .replace("{{date}}", dateLongFormatter(datePattern, formatLong))
+ .replace("{{time}}", timeLongFormatter(timePattern, formatLong));
+};
+
+const longFormatters = (exports.longFormatters = {
+ p: timeLongFormatter,
+ P: dateTimeLongFormatter,
+});
diff --git a/node_modules/date-fns/_lib/format/longFormatters.d.cts b/node_modules/date-fns/_lib/format/longFormatters.d.cts
new file mode 100644
index 00000000..db801d5b
--- /dev/null
+++ b/node_modules/date-fns/_lib/format/longFormatters.d.cts
@@ -0,0 +1,4 @@
+import type { FormatLong } from "../../locale/types.js";
+type LongFormatter = (pattern: string, formatLong: FormatLong) => string;
+export declare const longFormatters: Record;
+export {};
diff --git a/node_modules/date-fns/_lib/format/longFormatters.d.ts b/node_modules/date-fns/_lib/format/longFormatters.d.ts
new file mode 100644
index 00000000..db801d5b
--- /dev/null
+++ b/node_modules/date-fns/_lib/format/longFormatters.d.ts
@@ -0,0 +1,4 @@
+import type { FormatLong } from "../../locale/types.js";
+type LongFormatter = (pattern: string, formatLong: FormatLong) => string;
+export declare const longFormatters: Record;
+export {};
diff --git a/node_modules/date-fns/_lib/format/longFormatters.js b/node_modules/date-fns/_lib/format/longFormatters.js
new file mode 100644
index 00000000..67c510ea
--- /dev/null
+++ b/node_modules/date-fns/_lib/format/longFormatters.js
@@ -0,0 +1,64 @@
+const dateLongFormatter = (pattern, formatLong) => {
+ switch (pattern) {
+ case "P":
+ return formatLong.date({ width: "short" });
+ case "PP":
+ return formatLong.date({ width: "medium" });
+ case "PPP":
+ return formatLong.date({ width: "long" });
+ case "PPPP":
+ default:
+ return formatLong.date({ width: "full" });
+ }
+};
+
+const timeLongFormatter = (pattern, formatLong) => {
+ switch (pattern) {
+ case "p":
+ return formatLong.time({ width: "short" });
+ case "pp":
+ return formatLong.time({ width: "medium" });
+ case "ppp":
+ return formatLong.time({ width: "long" });
+ case "pppp":
+ default:
+ return formatLong.time({ width: "full" });
+ }
+};
+
+const dateTimeLongFormatter = (pattern, formatLong) => {
+ const matchResult = pattern.match(/(P+)(p+)?/) || [];
+ const datePattern = matchResult[1];
+ const timePattern = matchResult[2];
+
+ if (!timePattern) {
+ return dateLongFormatter(pattern, formatLong);
+ }
+
+ let dateTimeFormat;
+
+ switch (datePattern) {
+ case "P":
+ dateTimeFormat = formatLong.dateTime({ width: "short" });
+ break;
+ case "PP":
+ dateTimeFormat = formatLong.dateTime({ width: "medium" });
+ break;
+ case "PPP":
+ dateTimeFormat = formatLong.dateTime({ width: "long" });
+ break;
+ case "PPPP":
+ default:
+ dateTimeFormat = formatLong.dateTime({ width: "full" });
+ break;
+ }
+
+ return dateTimeFormat
+ .replace("{{date}}", dateLongFormatter(datePattern, formatLong))
+ .replace("{{time}}", timeLongFormatter(timePattern, formatLong));
+};
+
+export const longFormatters = {
+ p: timeLongFormatter,
+ P: dateTimeLongFormatter,
+};
diff --git a/node_modules/date-fns/_lib/getRoundingMethod.cjs b/node_modules/date-fns/_lib/getRoundingMethod.cjs
new file mode 100644
index 00000000..62b2986f
--- /dev/null
+++ b/node_modules/date-fns/_lib/getRoundingMethod.cjs
@@ -0,0 +1,11 @@
+"use strict";
+exports.getRoundingMethod = getRoundingMethod;
+
+function getRoundingMethod(method) {
+ return (number) => {
+ const round = method ? Math[method] : Math.trunc;
+ const result = round(number);
+ // Prevent negative zero
+ return result === 0 ? 0 : result;
+ };
+}
diff --git a/node_modules/date-fns/_lib/getRoundingMethod.d.cts b/node_modules/date-fns/_lib/getRoundingMethod.d.cts
new file mode 100644
index 00000000..a58f4019
--- /dev/null
+++ b/node_modules/date-fns/_lib/getRoundingMethod.d.cts
@@ -0,0 +1,4 @@
+import type { RoundingMethod } from "../types.js";
+export declare function getRoundingMethod(
+ method: RoundingMethod | undefined,
+): (number: number) => number;
diff --git a/node_modules/date-fns/_lib/getRoundingMethod.d.ts b/node_modules/date-fns/_lib/getRoundingMethod.d.ts
new file mode 100644
index 00000000..a58f4019
--- /dev/null
+++ b/node_modules/date-fns/_lib/getRoundingMethod.d.ts
@@ -0,0 +1,4 @@
+import type { RoundingMethod } from "../types.js";
+export declare function getRoundingMethod(
+ method: RoundingMethod | undefined,
+): (number: number) => number;
diff --git a/node_modules/date-fns/_lib/getRoundingMethod.js b/node_modules/date-fns/_lib/getRoundingMethod.js
new file mode 100644
index 00000000..8a8edac4
--- /dev/null
+++ b/node_modules/date-fns/_lib/getRoundingMethod.js
@@ -0,0 +1,8 @@
+export function getRoundingMethod(method) {
+ return (number) => {
+ const round = method ? Math[method] : Math.trunc;
+ const result = round(number);
+ // Prevent negative zero
+ return result === 0 ? 0 : result;
+ };
+}
diff --git a/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.cjs b/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.cjs
new file mode 100644
index 00000000..e5a03d95
--- /dev/null
+++ b/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.cjs
@@ -0,0 +1,31 @@
+"use strict";
+exports.getTimezoneOffsetInMilliseconds = getTimezoneOffsetInMilliseconds;
+var _index = require("../toDate.cjs");
+
+/**
+ * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
+ * They usually appear for dates that denote time before the timezones were introduced
+ * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
+ * and GMT+01:00:00 after that date)
+ *
+ * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
+ * which would lead to incorrect calculations.
+ *
+ * This function returns the timezone offset in milliseconds that takes seconds in account.
+ */
+function getTimezoneOffsetInMilliseconds(date) {
+ const _date = (0, _index.toDate)(date);
+ const utcDate = new Date(
+ Date.UTC(
+ _date.getFullYear(),
+ _date.getMonth(),
+ _date.getDate(),
+ _date.getHours(),
+ _date.getMinutes(),
+ _date.getSeconds(),
+ _date.getMilliseconds(),
+ ),
+ );
+ utcDate.setUTCFullYear(_date.getFullYear());
+ return +date - +utcDate;
+}
diff --git a/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.d.cts b/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.d.cts
new file mode 100644
index 00000000..09feea13
--- /dev/null
+++ b/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.d.cts
@@ -0,0 +1,15 @@
+import type { DateArg } from "../types.js";
+/**
+ * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
+ * They usually appear for dates that denote time before the timezones were introduced
+ * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
+ * and GMT+01:00:00 after that date)
+ *
+ * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
+ * which would lead to incorrect calculations.
+ *
+ * This function returns the timezone offset in milliseconds that takes seconds in account.
+ */
+export declare function getTimezoneOffsetInMilliseconds(
+ date: DateArg & {},
+): number;
diff --git a/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.d.ts b/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.d.ts
new file mode 100644
index 00000000..09feea13
--- /dev/null
+++ b/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.d.ts
@@ -0,0 +1,15 @@
+import type { DateArg } from "../types.js";
+/**
+ * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
+ * They usually appear for dates that denote time before the timezones were introduced
+ * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
+ * and GMT+01:00:00 after that date)
+ *
+ * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
+ * which would lead to incorrect calculations.
+ *
+ * This function returns the timezone offset in milliseconds that takes seconds in account.
+ */
+export declare function getTimezoneOffsetInMilliseconds(
+ date: DateArg & {},
+): number;
diff --git a/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js b/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
new file mode 100644
index 00000000..61ea9a15
--- /dev/null
+++ b/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
@@ -0,0 +1,29 @@
+import { toDate } from "../toDate.js";
+
+/**
+ * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
+ * They usually appear for dates that denote time before the timezones were introduced
+ * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
+ * and GMT+01:00:00 after that date)
+ *
+ * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
+ * which would lead to incorrect calculations.
+ *
+ * This function returns the timezone offset in milliseconds that takes seconds in account.
+ */
+export function getTimezoneOffsetInMilliseconds(date) {
+ const _date = toDate(date);
+ const utcDate = new Date(
+ Date.UTC(
+ _date.getFullYear(),
+ _date.getMonth(),
+ _date.getDate(),
+ _date.getHours(),
+ _date.getMinutes(),
+ _date.getSeconds(),
+ _date.getMilliseconds(),
+ ),
+ );
+ utcDate.setUTCFullYear(_date.getFullYear());
+ return +date - +utcDate;
+}
diff --git a/node_modules/date-fns/_lib/normalizeDates.cjs b/node_modules/date-fns/_lib/normalizeDates.cjs
new file mode 100644
index 00000000..84d7bce3
--- /dev/null
+++ b/node_modules/date-fns/_lib/normalizeDates.cjs
@@ -0,0 +1,11 @@
+"use strict";
+exports.normalizeDates = normalizeDates;
+var _index = require("../constructFrom.cjs");
+
+function normalizeDates(context, ...dates) {
+ const normalize = _index.constructFrom.bind(
+ null,
+ context || dates.find((date) => typeof date === "object"),
+ );
+ return dates.map(normalize);
+}
diff --git a/node_modules/date-fns/_lib/normalizeDates.d.cts b/node_modules/date-fns/_lib/normalizeDates.d.cts
new file mode 100644
index 00000000..67b262eb
--- /dev/null
+++ b/node_modules/date-fns/_lib/normalizeDates.d.cts
@@ -0,0 +1,13 @@
+import type { ContextFn, DateArg } from "../types.js";
+export declare function normalizeDates(
+ context: ContextFn | undefined,
+ ...dates: [DateArg, DateArg, DateArg]
+): [Date, Date, Date];
+export declare function normalizeDates(
+ context: ContextFn | undefined,
+ ...dates: [DateArg, DateArg]
+): [Date, Date];
+export declare function normalizeDates(
+ context: ContextFn | undefined,
+ ...dates: Array & {}>
+): Date[];
diff --git a/node_modules/date-fns/_lib/normalizeDates.d.ts b/node_modules/date-fns/_lib/normalizeDates.d.ts
new file mode 100644
index 00000000..67b262eb
--- /dev/null
+++ b/node_modules/date-fns/_lib/normalizeDates.d.ts
@@ -0,0 +1,13 @@
+import type { ContextFn, DateArg } from "../types.js";
+export declare function normalizeDates(
+ context: ContextFn | undefined,
+ ...dates: [DateArg, DateArg, DateArg]
+): [Date, Date, Date];
+export declare function normalizeDates(
+ context: ContextFn | undefined,
+ ...dates: [DateArg, DateArg]
+): [Date, Date];
+export declare function normalizeDates(
+ context: ContextFn | undefined,
+ ...dates: Array & {}>
+): Date[];
diff --git a/node_modules/date-fns/_lib/normalizeDates.js b/node_modules/date-fns/_lib/normalizeDates.js
new file mode 100644
index 00000000..879a21ee
--- /dev/null
+++ b/node_modules/date-fns/_lib/normalizeDates.js
@@ -0,0 +1,9 @@
+import { constructFrom } from "../constructFrom.js";
+
+export function normalizeDates(context, ...dates) {
+ const normalize = constructFrom.bind(
+ null,
+ context || dates.find((date) => typeof date === "object"),
+ );
+ return dates.map(normalize);
+}
diff --git a/node_modules/date-fns/_lib/normalizeInterval.cjs b/node_modules/date-fns/_lib/normalizeInterval.cjs
new file mode 100644
index 00000000..7cf9083d
--- /dev/null
+++ b/node_modules/date-fns/_lib/normalizeInterval.cjs
@@ -0,0 +1,12 @@
+"use strict";
+exports.normalizeInterval = normalizeInterval;
+var _index = require("./normalizeDates.cjs");
+
+function normalizeInterval(context, interval) {
+ const [start, end] = (0, _index.normalizeDates)(
+ context,
+ interval.start,
+ interval.end,
+ );
+ return { start, end };
+}
diff --git a/node_modules/date-fns/_lib/normalizeInterval.d.cts b/node_modules/date-fns/_lib/normalizeInterval.d.cts
new file mode 100644
index 00000000..8df613bd
--- /dev/null
+++ b/node_modules/date-fns/_lib/normalizeInterval.d.cts
@@ -0,0 +1,5 @@
+import type { ContextFn, Interval, NormalizedInterval } from "../types.js";
+export declare function normalizeInterval(
+ context: ContextFn | undefined,
+ interval: Interval,
+): NormalizedInterval;
diff --git a/node_modules/date-fns/_lib/normalizeInterval.d.ts b/node_modules/date-fns/_lib/normalizeInterval.d.ts
new file mode 100644
index 00000000..8df613bd
--- /dev/null
+++ b/node_modules/date-fns/_lib/normalizeInterval.d.ts
@@ -0,0 +1,5 @@
+import type { ContextFn, Interval, NormalizedInterval } from "../types.js";
+export declare function normalizeInterval(
+ context: ContextFn | undefined,
+ interval: Interval,
+): NormalizedInterval;
diff --git a/node_modules/date-fns/_lib/normalizeInterval.js b/node_modules/date-fns/_lib/normalizeInterval.js
new file mode 100644
index 00000000..6d236e74
--- /dev/null
+++ b/node_modules/date-fns/_lib/normalizeInterval.js
@@ -0,0 +1,6 @@
+import { normalizeDates } from "./normalizeDates.js";
+
+export function normalizeInterval(context, interval) {
+ const [start, end] = normalizeDates(context, interval.start, interval.end);
+ return { start, end };
+}
diff --git a/node_modules/date-fns/_lib/protectedTokens.cjs b/node_modules/date-fns/_lib/protectedTokens.cjs
new file mode 100644
index 00000000..64b6090c
--- /dev/null
+++ b/node_modules/date-fns/_lib/protectedTokens.cjs
@@ -0,0 +1,27 @@
+"use strict";
+exports.isProtectedDayOfYearToken = isProtectedDayOfYearToken;
+exports.isProtectedWeekYearToken = isProtectedWeekYearToken;
+exports.warnOrThrowProtectedError = warnOrThrowProtectedError;
+const dayOfYearTokenRE = /^D+$/;
+const weekYearTokenRE = /^Y+$/;
+
+const throwTokens = ["D", "DD", "YY", "YYYY"];
+
+function isProtectedDayOfYearToken(token) {
+ return dayOfYearTokenRE.test(token);
+}
+
+function isProtectedWeekYearToken(token) {
+ return weekYearTokenRE.test(token);
+}
+
+function warnOrThrowProtectedError(token, format, input) {
+ const _message = message(token, format, input);
+ console.warn(_message);
+ if (throwTokens.includes(token)) throw new RangeError(_message);
+}
+
+function message(token, format, input) {
+ const subject = token[0] === "Y" ? "years" : "days of the month";
+ return `Use \`${token.toLowerCase()}\` instead of \`${token}\` (in \`${format}\`) for formatting ${subject} to the input \`${input}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
+}
diff --git a/node_modules/date-fns/_lib/protectedTokens.d.cts b/node_modules/date-fns/_lib/protectedTokens.d.cts
new file mode 100644
index 00000000..ba5feba8
--- /dev/null
+++ b/node_modules/date-fns/_lib/protectedTokens.d.cts
@@ -0,0 +1,7 @@
+export declare function isProtectedDayOfYearToken(token: string): boolean;
+export declare function isProtectedWeekYearToken(token: string): boolean;
+export declare function warnOrThrowProtectedError(
+ token: string,
+ format: string,
+ input: string,
+): void;
diff --git a/node_modules/date-fns/_lib/protectedTokens.d.ts b/node_modules/date-fns/_lib/protectedTokens.d.ts
new file mode 100644
index 00000000..ba5feba8
--- /dev/null
+++ b/node_modules/date-fns/_lib/protectedTokens.d.ts
@@ -0,0 +1,7 @@
+export declare function isProtectedDayOfYearToken(token: string): boolean;
+export declare function isProtectedWeekYearToken(token: string): boolean;
+export declare function warnOrThrowProtectedError(
+ token: string,
+ format: string,
+ input: string,
+): void;
diff --git a/node_modules/date-fns/_lib/protectedTokens.js b/node_modules/date-fns/_lib/protectedTokens.js
new file mode 100644
index 00000000..38a13fa4
--- /dev/null
+++ b/node_modules/date-fns/_lib/protectedTokens.js
@@ -0,0 +1,23 @@
+const dayOfYearTokenRE = /^D+$/;
+const weekYearTokenRE = /^Y+$/;
+
+const throwTokens = ["D", "DD", "YY", "YYYY"];
+
+export function isProtectedDayOfYearToken(token) {
+ return dayOfYearTokenRE.test(token);
+}
+
+export function isProtectedWeekYearToken(token) {
+ return weekYearTokenRE.test(token);
+}
+
+export function warnOrThrowProtectedError(token, format, input) {
+ const _message = message(token, format, input);
+ console.warn(_message);
+ if (throwTokens.includes(token)) throw new RangeError(_message);
+}
+
+function message(token, format, input) {
+ const subject = token[0] === "Y" ? "years" : "days of the month";
+ return `Use \`${token.toLowerCase()}\` instead of \`${token}\` (in \`${format}\`) for formatting ${subject} to the input \`${input}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
+}
diff --git a/node_modules/date-fns/_lib/test.cjs b/node_modules/date-fns/_lib/test.cjs
new file mode 100644
index 00000000..dd91b560
--- /dev/null
+++ b/node_modules/date-fns/_lib/test.cjs
@@ -0,0 +1,59 @@
+"use strict";
+exports.assertType = assertType;
+exports.fakeDate = fakeDate;
+exports.generateOffset = generateOffset;
+exports.resetDefaultOptions = resetDefaultOptions;
+var _vitest = require("./test/vitest");
+var _index = require("./addLeadingZeros.cjs");
+var _index2 = require("./defaultOptions.cjs");
+var _sinon = require("./test/sinon");
+
+function assertType(_value) {}
+
+function resetDefaultOptions() {
+ (0, _index2.setDefaultOptions)({});
+}
+
+// This makes sure we create the consistent offsets across timezones, no matter where these tests are ran.
+function generateOffset(originalDate) {
+ // Add the timezone.
+ let offset = "";
+ const tzOffset = originalDate.getTimezoneOffset();
+
+ if (tzOffset !== 0) {
+ const absoluteOffset = Math.abs(tzOffset);
+ const hourOffset = (0, _index.addLeadingZeros)(
+ Math.trunc(absoluteOffset / 60),
+ 2,
+ );
+ const minuteOffset = (0, _index.addLeadingZeros)(absoluteOffset % 60, 2);
+ // If less than 0, the sign is +, because it is ahead of time.
+ const sign = tzOffset < 0 ? "+" : "-";
+
+ offset = `${sign}${hourOffset}:${minuteOffset}`;
+ } else {
+ offset = "Z";
+ }
+
+ return offset;
+}
+
+function fakeDate(date) {
+ let clock;
+
+ function fakeNow(date) {
+ clock?.restore();
+ clock = _sinon.default.useFakeTimers(+date);
+ }
+
+ (0, _vitest.beforeEach)(() => {
+ fakeNow(+date);
+ });
+
+ (0, _vitest.afterEach)(() => {
+ clock?.restore();
+ clock = undefined;
+ });
+
+ return { fakeNow };
+}
diff --git a/node_modules/date-fns/_lib/test.d.cts b/node_modules/date-fns/_lib/test.d.cts
new file mode 100644
index 00000000..f2279bc5
--- /dev/null
+++ b/node_modules/date-fns/_lib/test.d.cts
@@ -0,0 +1,14 @@
+export declare function assertType(_value: Type): void;
+export declare namespace assertType {
+ type Equal =
+ Exclude extends never
+ ? Exclude extends never
+ ? true
+ : false
+ : false;
+}
+export declare function resetDefaultOptions(): void;
+export declare function generateOffset(originalDate: Date): string;
+export declare function fakeDate(date: number | Date): {
+ fakeNow: (date: number | Date) => void;
+};
diff --git a/node_modules/date-fns/_lib/test.d.ts b/node_modules/date-fns/_lib/test.d.ts
new file mode 100644
index 00000000..f2279bc5
--- /dev/null
+++ b/node_modules/date-fns/_lib/test.d.ts
@@ -0,0 +1,14 @@
+export declare function assertType(_value: Type): void;
+export declare namespace assertType {
+ type Equal =
+ Exclude extends never
+ ? Exclude extends never
+ ? true
+ : false
+ : false;
+}
+export declare function resetDefaultOptions(): void;
+export declare function generateOffset(originalDate: Date): string;
+export declare function fakeDate(date: number | Date): {
+ fakeNow: (date: number | Date) => void;
+};
diff --git a/node_modules/date-fns/_lib/test.js b/node_modules/date-fns/_lib/test.js
new file mode 100644
index 00000000..79780f64
--- /dev/null
+++ b/node_modules/date-fns/_lib/test.js
@@ -0,0 +1,51 @@
+import { afterEach, beforeEach } from "./test/vitest";
+import { addLeadingZeros } from "./addLeadingZeros.js";
+import { setDefaultOptions } from "./defaultOptions.js";
+import sinon from "./test/sinon";
+
+export function assertType(_value) {}
+
+export function resetDefaultOptions() {
+ setDefaultOptions({});
+}
+
+// This makes sure we create the consistent offsets across timezones, no matter where these tests are ran.
+export function generateOffset(originalDate) {
+ // Add the timezone.
+ let offset = "";
+ const tzOffset = originalDate.getTimezoneOffset();
+
+ if (tzOffset !== 0) {
+ const absoluteOffset = Math.abs(tzOffset);
+ const hourOffset = addLeadingZeros(Math.trunc(absoluteOffset / 60), 2);
+ const minuteOffset = addLeadingZeros(absoluteOffset % 60, 2);
+ // If less than 0, the sign is +, because it is ahead of time.
+ const sign = tzOffset < 0 ? "+" : "-";
+
+ offset = `${sign}${hourOffset}:${minuteOffset}`;
+ } else {
+ offset = "Z";
+ }
+
+ return offset;
+}
+
+export function fakeDate(date) {
+ let clock;
+
+ function fakeNow(date) {
+ clock?.restore();
+ clock = sinon.useFakeTimers(+date);
+ }
+
+ beforeEach(() => {
+ fakeNow(+date);
+ });
+
+ afterEach(() => {
+ clock?.restore();
+ clock = undefined;
+ });
+
+ return { fakeNow };
+}
diff --git a/node_modules/date-fns/add.cjs b/node_modules/date-fns/add.cjs
new file mode 100644
index 00000000..8c211698
--- /dev/null
+++ b/node_modules/date-fns/add.cjs
@@ -0,0 +1,75 @@
+"use strict";
+exports.add = add;
+var _index = require("./addDays.cjs");
+var _index2 = require("./addMonths.cjs");
+var _index3 = require("./constructFrom.cjs");
+var _index4 = require("./toDate.cjs");
+
+/**
+ * The {@link add} function options.
+ */
+
+/**
+ * @name add
+ * @category Common Helpers
+ * @summary Add the specified years, months, weeks, days, hours, minutes, and seconds to the given date.
+ *
+ * @description
+ * Add the specified years, months, weeks, days, hours, minutes, and seconds to the given date.
+ *
+ * @typeParam DateType - The `Date` type the function operates on. Gets inferred from passed arguments. Allows using extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param duration - The object with years, months, weeks, days, hours, minutes, and seconds to be added.
+ * @param options - An object with options
+ *
+ * @returns The new date with the seconds added
+ *
+ * @example
+ * // Add the following duration to 1 September 2014, 10:19:50
+ * const result = add(new Date(2014, 8, 1, 10, 19, 50), {
+ * years: 2,
+ * months: 9,
+ * weeks: 1,
+ * days: 7,
+ * hours: 5,
+ * minutes: 9,
+ * seconds: 30,
+ * })
+ * //=> Thu Jun 15 2017 15:29:20
+ */
+function add(date, duration, options) {
+ const {
+ years = 0,
+ months = 0,
+ weeks = 0,
+ days = 0,
+ hours = 0,
+ minutes = 0,
+ seconds = 0,
+ } = duration;
+
+ // Add years and months
+ const _date = (0, _index4.toDate)(date, options?.in);
+ const dateWithMonths =
+ months || years
+ ? (0, _index2.addMonths)(_date, months + years * 12)
+ : _date;
+
+ // Add weeks and days
+ const dateWithDays =
+ days || weeks
+ ? (0, _index.addDays)(dateWithMonths, days + weeks * 7)
+ : dateWithMonths;
+
+ // Add days, hours, minutes, and seconds
+ const minutesToAdd = minutes + hours * 60;
+ const secondsToAdd = seconds + minutesToAdd * 60;
+ const msToAdd = secondsToAdd * 1000;
+
+ return (0, _index3.constructFrom)(
+ options?.in || date,
+ +dateWithDays + msToAdd,
+ );
+}
diff --git a/node_modules/date-fns/add.d.cts b/node_modules/date-fns/add.d.cts
new file mode 100644
index 00000000..eb51688d
--- /dev/null
+++ b/node_modules/date-fns/add.d.cts
@@ -0,0 +1,44 @@
+import type { ContextOptions, DateArg, Duration } from "./types.js";
+/**
+ * The {@link add} function options.
+ */
+export interface AddOptions
+ extends ContextOptions {}
+/**
+ * @name add
+ * @category Common Helpers
+ * @summary Add the specified years, months, weeks, days, hours, minutes, and seconds to the given date.
+ *
+ * @description
+ * Add the specified years, months, weeks, days, hours, minutes, and seconds to the given date.
+ *
+ * @typeParam DateType - The `Date` type the function operates on. Gets inferred from passed arguments. Allows using extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param duration - The object with years, months, weeks, days, hours, minutes, and seconds to be added.
+ * @param options - An object with options
+ *
+ * @returns The new date with the seconds added
+ *
+ * @example
+ * // Add the following duration to 1 September 2014, 10:19:50
+ * const result = add(new Date(2014, 8, 1, 10, 19, 50), {
+ * years: 2,
+ * months: 9,
+ * weeks: 1,
+ * days: 7,
+ * hours: 5,
+ * minutes: 9,
+ * seconds: 30,
+ * })
+ * //=> Thu Jun 15 2017 15:29:20
+ */
+export declare function add<
+ DateType extends Date,
+ ResultDate extends Date = DateType,
+>(
+ date: DateArg,
+ duration: Duration,
+ options?: AddOptions | undefined,
+): ResultDate;
diff --git a/node_modules/date-fns/add.d.ts b/node_modules/date-fns/add.d.ts
new file mode 100644
index 00000000..eb51688d
--- /dev/null
+++ b/node_modules/date-fns/add.d.ts
@@ -0,0 +1,44 @@
+import type { ContextOptions, DateArg, Duration } from "./types.js";
+/**
+ * The {@link add} function options.
+ */
+export interface AddOptions
+ extends ContextOptions {}
+/**
+ * @name add
+ * @category Common Helpers
+ * @summary Add the specified years, months, weeks, days, hours, minutes, and seconds to the given date.
+ *
+ * @description
+ * Add the specified years, months, weeks, days, hours, minutes, and seconds to the given date.
+ *
+ * @typeParam DateType - The `Date` type the function operates on. Gets inferred from passed arguments. Allows using extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param duration - The object with years, months, weeks, days, hours, minutes, and seconds to be added.
+ * @param options - An object with options
+ *
+ * @returns The new date with the seconds added
+ *
+ * @example
+ * // Add the following duration to 1 September 2014, 10:19:50
+ * const result = add(new Date(2014, 8, 1, 10, 19, 50), {
+ * years: 2,
+ * months: 9,
+ * weeks: 1,
+ * days: 7,
+ * hours: 5,
+ * minutes: 9,
+ * seconds: 30,
+ * })
+ * //=> Thu Jun 15 2017 15:29:20
+ */
+export declare function add<
+ DateType extends Date,
+ ResultDate extends Date = DateType,
+>(
+ date: DateArg,
+ duration: Duration,
+ options?: AddOptions | undefined,
+): ResultDate;
diff --git a/node_modules/date-fns/add.js b/node_modules/date-fns/add.js
new file mode 100644
index 00000000..7424ce04
--- /dev/null
+++ b/node_modules/date-fns/add.js
@@ -0,0 +1,69 @@
+import { addDays } from "./addDays.js";
+import { addMonths } from "./addMonths.js";
+import { constructFrom } from "./constructFrom.js";
+import { toDate } from "./toDate.js";
+
+/**
+ * The {@link add} function options.
+ */
+
+/**
+ * @name add
+ * @category Common Helpers
+ * @summary Add the specified years, months, weeks, days, hours, minutes, and seconds to the given date.
+ *
+ * @description
+ * Add the specified years, months, weeks, days, hours, minutes, and seconds to the given date.
+ *
+ * @typeParam DateType - The `Date` type the function operates on. Gets inferred from passed arguments. Allows using extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param duration - The object with years, months, weeks, days, hours, minutes, and seconds to be added.
+ * @param options - An object with options
+ *
+ * @returns The new date with the seconds added
+ *
+ * @example
+ * // Add the following duration to 1 September 2014, 10:19:50
+ * const result = add(new Date(2014, 8, 1, 10, 19, 50), {
+ * years: 2,
+ * months: 9,
+ * weeks: 1,
+ * days: 7,
+ * hours: 5,
+ * minutes: 9,
+ * seconds: 30,
+ * })
+ * //=> Thu Jun 15 2017 15:29:20
+ */
+export function add(date, duration, options) {
+ const {
+ years = 0,
+ months = 0,
+ weeks = 0,
+ days = 0,
+ hours = 0,
+ minutes = 0,
+ seconds = 0,
+ } = duration;
+
+ // Add years and months
+ const _date = toDate(date, options?.in);
+ const dateWithMonths =
+ months || years ? addMonths(_date, months + years * 12) : _date;
+
+ // Add weeks and days
+ const dateWithDays =
+ days || weeks ? addDays(dateWithMonths, days + weeks * 7) : dateWithMonths;
+
+ // Add days, hours, minutes, and seconds
+ const minutesToAdd = minutes + hours * 60;
+ const secondsToAdd = seconds + minutesToAdd * 60;
+ const msToAdd = secondsToAdd * 1000;
+
+ return constructFrom(options?.in || date, +dateWithDays + msToAdd);
+}
+
+// Fallback for modularized imports:
+export default add;
diff --git a/node_modules/date-fns/addBusinessDays.cjs b/node_modules/date-fns/addBusinessDays.cjs
new file mode 100644
index 00000000..0d297221
--- /dev/null
+++ b/node_modules/date-fns/addBusinessDays.cjs
@@ -0,0 +1,76 @@
+"use strict";
+exports.addBusinessDays = addBusinessDays;
+var _index = require("./constructFrom.cjs");
+var _index2 = require("./isSaturday.cjs");
+var _index3 = require("./isSunday.cjs");
+var _index4 = require("./isWeekend.cjs");
+var _index5 = require("./toDate.cjs");
+
+/**
+ * The {@link addBusinessDays} function options.
+ */
+
+/**
+ * @name addBusinessDays
+ * @category Day Helpers
+ * @summary Add the specified number of business days (mon - fri) to the given date.
+ *
+ * @description
+ * Add the specified number of business days (mon - fri) to the given date, ignoring weekends.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of business days to be added.
+ * @param options - An object with options
+ *
+ * @returns The new date with the business days added
+ *
+ * @example
+ * // Add 10 business days to 1 September 2014:
+ * const result = addBusinessDays(new Date(2014, 8, 1), 10)
+ * //=> Mon Sep 15 2014 00:00:00 (skipped weekend days)
+ */
+function addBusinessDays(date, amount, options) {
+ const _date = (0, _index5.toDate)(date, options?.in);
+ const startedOnWeekend = (0, _index4.isWeekend)(_date, options);
+
+ if (isNaN(amount)) return (0, _index.constructFrom)(options?.in, NaN);
+
+ const hours = _date.getHours();
+ const sign = amount < 0 ? -1 : 1;
+ const fullWeeks = Math.trunc(amount / 5);
+
+ _date.setDate(_date.getDate() + fullWeeks * 7);
+
+ // Get remaining days not part of a full week
+ let restDays = Math.abs(amount % 5);
+
+ // Loops over remaining days
+ while (restDays > 0) {
+ _date.setDate(_date.getDate() + sign);
+ if (!(0, _index4.isWeekend)(_date, options)) restDays -= 1;
+ }
+
+ // If the date is a weekend day and we reduce a dividable of
+ // 5 from it, we land on a weekend date.
+ // To counter this, we add days accordingly to land on the next business day
+ if (
+ startedOnWeekend &&
+ (0, _index4.isWeekend)(_date, options) &&
+ amount !== 0
+ ) {
+ // If we're reducing days, we want to add days until we land on a weekday
+ // If we're adding days we want to reduce days until we land on a weekday
+ if ((0, _index2.isSaturday)(_date, options))
+ _date.setDate(_date.getDate() + (sign < 0 ? 2 : -1));
+ if ((0, _index3.isSunday)(_date, options))
+ _date.setDate(_date.getDate() + (sign < 0 ? 1 : -2));
+ }
+
+ // Restore hours to avoid DST lag
+ _date.setHours(hours);
+
+ return _date;
+}
diff --git a/node_modules/date-fns/addBusinessDays.d.cts b/node_modules/date-fns/addBusinessDays.d.cts
new file mode 100644
index 00000000..d736a0bf
--- /dev/null
+++ b/node_modules/date-fns/addBusinessDays.d.cts
@@ -0,0 +1,36 @@
+import type { ContextOptions, DateArg } from "./types.js";
+/**
+ * The {@link addBusinessDays} function options.
+ */
+export interface AddBusinessDaysOptions
+ extends ContextOptions {}
+/**
+ * @name addBusinessDays
+ * @category Day Helpers
+ * @summary Add the specified number of business days (mon - fri) to the given date.
+ *
+ * @description
+ * Add the specified number of business days (mon - fri) to the given date, ignoring weekends.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of business days to be added.
+ * @param options - An object with options
+ *
+ * @returns The new date with the business days added
+ *
+ * @example
+ * // Add 10 business days to 1 September 2014:
+ * const result = addBusinessDays(new Date(2014, 8, 1), 10)
+ * //=> Mon Sep 15 2014 00:00:00 (skipped weekend days)
+ */
+export declare function addBusinessDays<
+ DateType extends Date,
+ ResultDate extends Date = DateType,
+>(
+ date: DateArg,
+ amount: number,
+ options?: AddBusinessDaysOptions | undefined,
+): ResultDate;
diff --git a/node_modules/date-fns/addBusinessDays.d.ts b/node_modules/date-fns/addBusinessDays.d.ts
new file mode 100644
index 00000000..d736a0bf
--- /dev/null
+++ b/node_modules/date-fns/addBusinessDays.d.ts
@@ -0,0 +1,36 @@
+import type { ContextOptions, DateArg } from "./types.js";
+/**
+ * The {@link addBusinessDays} function options.
+ */
+export interface AddBusinessDaysOptions
+ extends ContextOptions {}
+/**
+ * @name addBusinessDays
+ * @category Day Helpers
+ * @summary Add the specified number of business days (mon - fri) to the given date.
+ *
+ * @description
+ * Add the specified number of business days (mon - fri) to the given date, ignoring weekends.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of business days to be added.
+ * @param options - An object with options
+ *
+ * @returns The new date with the business days added
+ *
+ * @example
+ * // Add 10 business days to 1 September 2014:
+ * const result = addBusinessDays(new Date(2014, 8, 1), 10)
+ * //=> Mon Sep 15 2014 00:00:00 (skipped weekend days)
+ */
+export declare function addBusinessDays<
+ DateType extends Date,
+ ResultDate extends Date = DateType,
+>(
+ date: DateArg,
+ amount: number,
+ options?: AddBusinessDaysOptions | undefined,
+): ResultDate;
diff --git a/node_modules/date-fns/addBusinessDays.js b/node_modules/date-fns/addBusinessDays.js
new file mode 100644
index 00000000..6fb9a39c
--- /dev/null
+++ b/node_modules/date-fns/addBusinessDays.js
@@ -0,0 +1,73 @@
+import { constructFrom } from "./constructFrom.js";
+import { isSaturday } from "./isSaturday.js";
+import { isSunday } from "./isSunday.js";
+import { isWeekend } from "./isWeekend.js";
+import { toDate } from "./toDate.js";
+
+/**
+ * The {@link addBusinessDays} function options.
+ */
+
+/**
+ * @name addBusinessDays
+ * @category Day Helpers
+ * @summary Add the specified number of business days (mon - fri) to the given date.
+ *
+ * @description
+ * Add the specified number of business days (mon - fri) to the given date, ignoring weekends.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of business days to be added.
+ * @param options - An object with options
+ *
+ * @returns The new date with the business days added
+ *
+ * @example
+ * // Add 10 business days to 1 September 2014:
+ * const result = addBusinessDays(new Date(2014, 8, 1), 10)
+ * //=> Mon Sep 15 2014 00:00:00 (skipped weekend days)
+ */
+export function addBusinessDays(date, amount, options) {
+ const _date = toDate(date, options?.in);
+ const startedOnWeekend = isWeekend(_date, options);
+
+ if (isNaN(amount)) return constructFrom(options?.in, NaN);
+
+ const hours = _date.getHours();
+ const sign = amount < 0 ? -1 : 1;
+ const fullWeeks = Math.trunc(amount / 5);
+
+ _date.setDate(_date.getDate() + fullWeeks * 7);
+
+ // Get remaining days not part of a full week
+ let restDays = Math.abs(amount % 5);
+
+ // Loops over remaining days
+ while (restDays > 0) {
+ _date.setDate(_date.getDate() + sign);
+ if (!isWeekend(_date, options)) restDays -= 1;
+ }
+
+ // If the date is a weekend day and we reduce a dividable of
+ // 5 from it, we land on a weekend date.
+ // To counter this, we add days accordingly to land on the next business day
+ if (startedOnWeekend && isWeekend(_date, options) && amount !== 0) {
+ // If we're reducing days, we want to add days until we land on a weekday
+ // If we're adding days we want to reduce days until we land on a weekday
+ if (isSaturday(_date, options))
+ _date.setDate(_date.getDate() + (sign < 0 ? 2 : -1));
+ if (isSunday(_date, options))
+ _date.setDate(_date.getDate() + (sign < 0 ? 1 : -2));
+ }
+
+ // Restore hours to avoid DST lag
+ _date.setHours(hours);
+
+ return _date;
+}
+
+// Fallback for modularized imports:
+export default addBusinessDays;
diff --git a/node_modules/date-fns/addDays.cjs b/node_modules/date-fns/addDays.cjs
new file mode 100644
index 00000000..e251ff28
--- /dev/null
+++ b/node_modules/date-fns/addDays.cjs
@@ -0,0 +1,41 @@
+"use strict";
+exports.addDays = addDays;
+var _index = require("./constructFrom.cjs");
+var _index2 = require("./toDate.cjs");
+
+/**
+ * The {@link addDays} function options.
+ */
+
+/**
+ * @name addDays
+ * @category Day Helpers
+ * @summary Add the specified number of days to the given date.
+ *
+ * @description
+ * Add the specified number of days to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of days to be added.
+ * @param options - An object with options
+ *
+ * @returns The new date with the days added
+ *
+ * @example
+ * // Add 10 days to 1 September 2014:
+ * const result = addDays(new Date(2014, 8, 1), 10)
+ * //=> Thu Sep 11 2014 00:00:00
+ */
+function addDays(date, amount, options) {
+ const _date = (0, _index2.toDate)(date, options?.in);
+ if (isNaN(amount)) return (0, _index.constructFrom)(options?.in || date, NaN);
+
+ // If 0 days, no-op to avoid changing times in the hour before end of DST
+ if (!amount) return _date;
+
+ _date.setDate(_date.getDate() + amount);
+ return _date;
+}
diff --git a/node_modules/date-fns/addDays.d.cts b/node_modules/date-fns/addDays.d.cts
new file mode 100644
index 00000000..0e97aa06
--- /dev/null
+++ b/node_modules/date-fns/addDays.d.cts
@@ -0,0 +1,36 @@
+import type { ContextOptions, DateArg } from "./types.js";
+/**
+ * The {@link addDays} function options.
+ */
+export interface AddDaysOptions
+ extends ContextOptions {}
+/**
+ * @name addDays
+ * @category Day Helpers
+ * @summary Add the specified number of days to the given date.
+ *
+ * @description
+ * Add the specified number of days to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of days to be added.
+ * @param options - An object with options
+ *
+ * @returns The new date with the days added
+ *
+ * @example
+ * // Add 10 days to 1 September 2014:
+ * const result = addDays(new Date(2014, 8, 1), 10)
+ * //=> Thu Sep 11 2014 00:00:00
+ */
+export declare function addDays<
+ DateType extends Date,
+ ResultDate extends Date = DateType,
+>(
+ date: DateArg,
+ amount: number,
+ options?: AddDaysOptions | undefined,
+): ResultDate;
diff --git a/node_modules/date-fns/addDays.d.ts b/node_modules/date-fns/addDays.d.ts
new file mode 100644
index 00000000..0e97aa06
--- /dev/null
+++ b/node_modules/date-fns/addDays.d.ts
@@ -0,0 +1,36 @@
+import type { ContextOptions, DateArg } from "./types.js";
+/**
+ * The {@link addDays} function options.
+ */
+export interface AddDaysOptions
+ extends ContextOptions {}
+/**
+ * @name addDays
+ * @category Day Helpers
+ * @summary Add the specified number of days to the given date.
+ *
+ * @description
+ * Add the specified number of days to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of days to be added.
+ * @param options - An object with options
+ *
+ * @returns The new date with the days added
+ *
+ * @example
+ * // Add 10 days to 1 September 2014:
+ * const result = addDays(new Date(2014, 8, 1), 10)
+ * //=> Thu Sep 11 2014 00:00:00
+ */
+export declare function addDays<
+ DateType extends Date,
+ ResultDate extends Date = DateType,
+>(
+ date: DateArg,
+ amount: number,
+ options?: AddDaysOptions | undefined,
+): ResultDate;
diff --git a/node_modules/date-fns/addDays.js b/node_modules/date-fns/addDays.js
new file mode 100644
index 00000000..4d1cafa3
--- /dev/null
+++ b/node_modules/date-fns/addDays.js
@@ -0,0 +1,42 @@
+import { constructFrom } from "./constructFrom.js";
+import { toDate } from "./toDate.js";
+
+/**
+ * The {@link addDays} function options.
+ */
+
+/**
+ * @name addDays
+ * @category Day Helpers
+ * @summary Add the specified number of days to the given date.
+ *
+ * @description
+ * Add the specified number of days to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of days to be added.
+ * @param options - An object with options
+ *
+ * @returns The new date with the days added
+ *
+ * @example
+ * // Add 10 days to 1 September 2014:
+ * const result = addDays(new Date(2014, 8, 1), 10)
+ * //=> Thu Sep 11 2014 00:00:00
+ */
+export function addDays(date, amount, options) {
+ const _date = toDate(date, options?.in);
+ if (isNaN(amount)) return constructFrom(options?.in || date, NaN);
+
+ // If 0 days, no-op to avoid changing times in the hour before end of DST
+ if (!amount) return _date;
+
+ _date.setDate(_date.getDate() + amount);
+ return _date;
+}
+
+// Fallback for modularized imports:
+export default addDays;
diff --git a/node_modules/date-fns/addHours.cjs b/node_modules/date-fns/addHours.cjs
new file mode 100644
index 00000000..76b68ea9
--- /dev/null
+++ b/node_modules/date-fns/addHours.cjs
@@ -0,0 +1,38 @@
+"use strict";
+exports.addHours = addHours;
+var _index = require("./addMilliseconds.cjs");
+var _index2 = require("./constants.cjs");
+
+/**
+ * The {@link addHours} function options.
+ */
+
+/**
+ * @name addHours
+ * @category Hour Helpers
+ * @summary Add the specified number of hours to the given date.
+ *
+ * @description
+ * Add the specified number of hours to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of hours to be added
+ * @param options - An object with options
+ *
+ * @returns The new date with the hours added
+ *
+ * @example
+ * // Add 2 hours to 10 July 2014 23:00:00:
+ * const result = addHours(new Date(2014, 6, 10, 23, 0), 2)
+ * //=> Fri Jul 11 2014 01:00:00
+ */
+function addHours(date, amount, options) {
+ return (0, _index.addMilliseconds)(
+ date,
+ amount * _index2.millisecondsInHour,
+ options,
+ );
+}
diff --git a/node_modules/date-fns/addHours.d.cts b/node_modules/date-fns/addHours.d.cts
new file mode 100644
index 00000000..5fece22b
--- /dev/null
+++ b/node_modules/date-fns/addHours.d.cts
@@ -0,0 +1,36 @@
+import type { ContextOptions, DateArg } from "./types.js";
+/**
+ * The {@link addHours} function options.
+ */
+export interface AddHoursOptions
+ extends ContextOptions {}
+/**
+ * @name addHours
+ * @category Hour Helpers
+ * @summary Add the specified number of hours to the given date.
+ *
+ * @description
+ * Add the specified number of hours to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of hours to be added
+ * @param options - An object with options
+ *
+ * @returns The new date with the hours added
+ *
+ * @example
+ * // Add 2 hours to 10 July 2014 23:00:00:
+ * const result = addHours(new Date(2014, 6, 10, 23, 0), 2)
+ * //=> Fri Jul 11 2014 01:00:00
+ */
+export declare function addHours<
+ DateType extends Date,
+ ResultDate extends Date = DateType,
+>(
+ date: DateArg,
+ amount: number,
+ options?: AddHoursOptions | undefined,
+): ResultDate;
diff --git a/node_modules/date-fns/addHours.d.ts b/node_modules/date-fns/addHours.d.ts
new file mode 100644
index 00000000..5fece22b
--- /dev/null
+++ b/node_modules/date-fns/addHours.d.ts
@@ -0,0 +1,36 @@
+import type { ContextOptions, DateArg } from "./types.js";
+/**
+ * The {@link addHours} function options.
+ */
+export interface AddHoursOptions
+ extends ContextOptions {}
+/**
+ * @name addHours
+ * @category Hour Helpers
+ * @summary Add the specified number of hours to the given date.
+ *
+ * @description
+ * Add the specified number of hours to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of hours to be added
+ * @param options - An object with options
+ *
+ * @returns The new date with the hours added
+ *
+ * @example
+ * // Add 2 hours to 10 July 2014 23:00:00:
+ * const result = addHours(new Date(2014, 6, 10, 23, 0), 2)
+ * //=> Fri Jul 11 2014 01:00:00
+ */
+export declare function addHours<
+ DateType extends Date,
+ ResultDate extends Date = DateType,
+>(
+ date: DateArg,
+ amount: number,
+ options?: AddHoursOptions | undefined,
+): ResultDate;
diff --git a/node_modules/date-fns/addHours.js b/node_modules/date-fns/addHours.js
new file mode 100644
index 00000000..9d12ae79
--- /dev/null
+++ b/node_modules/date-fns/addHours.js
@@ -0,0 +1,35 @@
+import { addMilliseconds } from "./addMilliseconds.js";
+import { millisecondsInHour } from "./constants.js";
+
+/**
+ * The {@link addHours} function options.
+ */
+
+/**
+ * @name addHours
+ * @category Hour Helpers
+ * @summary Add the specified number of hours to the given date.
+ *
+ * @description
+ * Add the specified number of hours to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of hours to be added
+ * @param options - An object with options
+ *
+ * @returns The new date with the hours added
+ *
+ * @example
+ * // Add 2 hours to 10 July 2014 23:00:00:
+ * const result = addHours(new Date(2014, 6, 10, 23, 0), 2)
+ * //=> Fri Jul 11 2014 01:00:00
+ */
+export function addHours(date, amount, options) {
+ return addMilliseconds(date, amount * millisecondsInHour, options);
+}
+
+// Fallback for modularized imports:
+export default addHours;
diff --git a/node_modules/date-fns/addISOWeekYears.cjs b/node_modules/date-fns/addISOWeekYears.cjs
new file mode 100644
index 00000000..e8d7c4ad
--- /dev/null
+++ b/node_modules/date-fns/addISOWeekYears.cjs
@@ -0,0 +1,39 @@
+"use strict";
+exports.addISOWeekYears = addISOWeekYears;
+var _index = require("./getISOWeekYear.cjs");
+var _index2 = require("./setISOWeekYear.cjs");
+
+/**
+ * The {@link addISOWeekYears} function options.
+ */
+
+/**
+ * @name addISOWeekYears
+ * @category ISO Week-Numbering Year Helpers
+ * @summary Add the specified number of ISO week-numbering years to the given date.
+ *
+ * @description
+ * Add the specified number of ISO week-numbering years to the given date.
+ *
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of ISO week-numbering years to be added.
+ * @param options - An object with options
+ *
+ * @returns The new date with the ISO week-numbering years added
+ *
+ * @example
+ * // Add 5 ISO week-numbering years to 2 July 2010:
+ * const result = addISOWeekYears(new Date(2010, 6, 2), 5)
+ * //=> Fri Jun 26 2015 00:00:00
+ */
+function addISOWeekYears(date, amount, options) {
+ return (0, _index2.setISOWeekYear)(
+ date,
+ (0, _index.getISOWeekYear)(date, options) + amount,
+ options,
+ );
+}
diff --git a/node_modules/date-fns/addISOWeekYears.d.cts b/node_modules/date-fns/addISOWeekYears.d.cts
new file mode 100644
index 00000000..8e67e534
--- /dev/null
+++ b/node_modules/date-fns/addISOWeekYears.d.cts
@@ -0,0 +1,37 @@
+import type { ContextOptions, DateArg } from "./types.js";
+/**
+ * The {@link addISOWeekYears} function options.
+ */
+export interface AddISOWeekYearsOptions
+ extends ContextOptions {}
+/**
+ * @name addISOWeekYears
+ * @category ISO Week-Numbering Year Helpers
+ * @summary Add the specified number of ISO week-numbering years to the given date.
+ *
+ * @description
+ * Add the specified number of ISO week-numbering years to the given date.
+ *
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of ISO week-numbering years to be added.
+ * @param options - An object with options
+ *
+ * @returns The new date with the ISO week-numbering years added
+ *
+ * @example
+ * // Add 5 ISO week-numbering years to 2 July 2010:
+ * const result = addISOWeekYears(new Date(2010, 6, 2), 5)
+ * //=> Fri Jun 26 2015 00:00:00
+ */
+export declare function addISOWeekYears<
+ DateType extends Date,
+ ResultDate extends Date = DateType,
+>(
+ date: DateArg,
+ amount: number,
+ options?: AddISOWeekYearsOptions | undefined,
+): ResultDate;
diff --git a/node_modules/date-fns/addISOWeekYears.d.ts b/node_modules/date-fns/addISOWeekYears.d.ts
new file mode 100644
index 00000000..8e67e534
--- /dev/null
+++ b/node_modules/date-fns/addISOWeekYears.d.ts
@@ -0,0 +1,37 @@
+import type { ContextOptions, DateArg } from "./types.js";
+/**
+ * The {@link addISOWeekYears} function options.
+ */
+export interface AddISOWeekYearsOptions
+ extends ContextOptions {}
+/**
+ * @name addISOWeekYears
+ * @category ISO Week-Numbering Year Helpers
+ * @summary Add the specified number of ISO week-numbering years to the given date.
+ *
+ * @description
+ * Add the specified number of ISO week-numbering years to the given date.
+ *
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of ISO week-numbering years to be added.
+ * @param options - An object with options
+ *
+ * @returns The new date with the ISO week-numbering years added
+ *
+ * @example
+ * // Add 5 ISO week-numbering years to 2 July 2010:
+ * const result = addISOWeekYears(new Date(2010, 6, 2), 5)
+ * //=> Fri Jun 26 2015 00:00:00
+ */
+export declare function addISOWeekYears<
+ DateType extends Date,
+ ResultDate extends Date = DateType,
+>(
+ date: DateArg,
+ amount: number,
+ options?: AddISOWeekYearsOptions | undefined,
+): ResultDate;
diff --git a/node_modules/date-fns/addISOWeekYears.js b/node_modules/date-fns/addISOWeekYears.js
new file mode 100644
index 00000000..53f1f843
--- /dev/null
+++ b/node_modules/date-fns/addISOWeekYears.js
@@ -0,0 +1,36 @@
+import { getISOWeekYear } from "./getISOWeekYear.js";
+import { setISOWeekYear } from "./setISOWeekYear.js";
+
+/**
+ * The {@link addISOWeekYears} function options.
+ */
+
+/**
+ * @name addISOWeekYears
+ * @category ISO Week-Numbering Year Helpers
+ * @summary Add the specified number of ISO week-numbering years to the given date.
+ *
+ * @description
+ * Add the specified number of ISO week-numbering years to the given date.
+ *
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of ISO week-numbering years to be added.
+ * @param options - An object with options
+ *
+ * @returns The new date with the ISO week-numbering years added
+ *
+ * @example
+ * // Add 5 ISO week-numbering years to 2 July 2010:
+ * const result = addISOWeekYears(new Date(2010, 6, 2), 5)
+ * //=> Fri Jun 26 2015 00:00:00
+ */
+export function addISOWeekYears(date, amount, options) {
+ return setISOWeekYear(date, getISOWeekYear(date, options) + amount, options);
+}
+
+// Fallback for modularized imports:
+export default addISOWeekYears;
diff --git a/node_modules/date-fns/addMilliseconds.cjs b/node_modules/date-fns/addMilliseconds.cjs
new file mode 100644
index 00000000..a66d8805
--- /dev/null
+++ b/node_modules/date-fns/addMilliseconds.cjs
@@ -0,0 +1,37 @@
+"use strict";
+exports.addMilliseconds = addMilliseconds;
+var _index = require("./constructFrom.cjs");
+var _index2 = require("./toDate.cjs");
+
+/**
+ * The {@link addMilliseconds} function options.
+ */
+
+/**
+ * @name addMilliseconds
+ * @category Millisecond Helpers
+ * @summary Add the specified number of milliseconds to the given date.
+ *
+ * @description
+ * Add the specified number of milliseconds to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of milliseconds to be added.
+ * @param options - The options object
+ *
+ * @returns The new date with the milliseconds added
+ *
+ * @example
+ * // Add 750 milliseconds to 10 July 2014 12:45:30.000:
+ * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
+ * //=> Thu Jul 10 2014 12:45:30.750
+ */
+function addMilliseconds(date, amount, options) {
+ return (0, _index.constructFrom)(
+ options?.in || date,
+ +(0, _index2.toDate)(date) + amount,
+ );
+}
diff --git a/node_modules/date-fns/addMilliseconds.d.cts b/node_modules/date-fns/addMilliseconds.d.cts
new file mode 100644
index 00000000..741af0d6
--- /dev/null
+++ b/node_modules/date-fns/addMilliseconds.d.cts
@@ -0,0 +1,36 @@
+import type { ContextOptions, DateArg } from "./types.js";
+/**
+ * The {@link addMilliseconds} function options.
+ */
+export interface AddMillisecondsOptions
+ extends ContextOptions {}
+/**
+ * @name addMilliseconds
+ * @category Millisecond Helpers
+ * @summary Add the specified number of milliseconds to the given date.
+ *
+ * @description
+ * Add the specified number of milliseconds to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of milliseconds to be added.
+ * @param options - The options object
+ *
+ * @returns The new date with the milliseconds added
+ *
+ * @example
+ * // Add 750 milliseconds to 10 July 2014 12:45:30.000:
+ * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
+ * //=> Thu Jul 10 2014 12:45:30.750
+ */
+export declare function addMilliseconds<
+ DateType extends Date,
+ ResultDate extends Date = DateType,
+>(
+ date: DateArg,
+ amount: number,
+ options?: AddMillisecondsOptions | undefined,
+): ResultDate;
diff --git a/node_modules/date-fns/addMilliseconds.d.ts b/node_modules/date-fns/addMilliseconds.d.ts
new file mode 100644
index 00000000..741af0d6
--- /dev/null
+++ b/node_modules/date-fns/addMilliseconds.d.ts
@@ -0,0 +1,36 @@
+import type { ContextOptions, DateArg } from "./types.js";
+/**
+ * The {@link addMilliseconds} function options.
+ */
+export interface AddMillisecondsOptions
+ extends ContextOptions {}
+/**
+ * @name addMilliseconds
+ * @category Millisecond Helpers
+ * @summary Add the specified number of milliseconds to the given date.
+ *
+ * @description
+ * Add the specified number of milliseconds to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of milliseconds to be added.
+ * @param options - The options object
+ *
+ * @returns The new date with the milliseconds added
+ *
+ * @example
+ * // Add 750 milliseconds to 10 July 2014 12:45:30.000:
+ * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
+ * //=> Thu Jul 10 2014 12:45:30.750
+ */
+export declare function addMilliseconds<
+ DateType extends Date,
+ ResultDate extends Date = DateType,
+>(
+ date: DateArg,
+ amount: number,
+ options?: AddMillisecondsOptions | undefined,
+): ResultDate;
diff --git a/node_modules/date-fns/addMilliseconds.js b/node_modules/date-fns/addMilliseconds.js
new file mode 100644
index 00000000..69717429
--- /dev/null
+++ b/node_modules/date-fns/addMilliseconds.js
@@ -0,0 +1,35 @@
+import { constructFrom } from "./constructFrom.js";
+import { toDate } from "./toDate.js";
+
+/**
+ * The {@link addMilliseconds} function options.
+ */
+
+/**
+ * @name addMilliseconds
+ * @category Millisecond Helpers
+ * @summary Add the specified number of milliseconds to the given date.
+ *
+ * @description
+ * Add the specified number of milliseconds to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of milliseconds to be added.
+ * @param options - The options object
+ *
+ * @returns The new date with the milliseconds added
+ *
+ * @example
+ * // Add 750 milliseconds to 10 July 2014 12:45:30.000:
+ * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
+ * //=> Thu Jul 10 2014 12:45:30.750
+ */
+export function addMilliseconds(date, amount, options) {
+ return constructFrom(options?.in || date, +toDate(date) + amount);
+}
+
+// Fallback for modularized imports:
+export default addMilliseconds;
diff --git a/node_modules/date-fns/addMinutes.cjs b/node_modules/date-fns/addMinutes.cjs
new file mode 100644
index 00000000..1f8b29d3
--- /dev/null
+++ b/node_modules/date-fns/addMinutes.cjs
@@ -0,0 +1,36 @@
+"use strict";
+exports.addMinutes = addMinutes;
+var _index = require("./constants.cjs");
+var _index2 = require("./toDate.cjs");
+
+/**
+ * The {@link addMinutes} function options.
+ */
+
+/**
+ * @name addMinutes
+ * @category Minute Helpers
+ * @summary Add the specified number of minutes to the given date.
+ *
+ * @description
+ * Add the specified number of minutes to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of minutes to be added.
+ * @param options - An object with options
+ *
+ * @returns The new date with the minutes added
+ *
+ * @example
+ * // Add 30 minutes to 10 July 2014 12:00:00:
+ * const result = addMinutes(new Date(2014, 6, 10, 12, 0), 30)
+ * //=> Thu Jul 10 2014 12:30:00
+ */
+function addMinutes(date, amount, options) {
+ const _date = (0, _index2.toDate)(date, options?.in);
+ _date.setTime(_date.getTime() + amount * _index.millisecondsInMinute);
+ return _date;
+}
diff --git a/node_modules/date-fns/addMinutes.d.cts b/node_modules/date-fns/addMinutes.d.cts
new file mode 100644
index 00000000..2a8e29b8
--- /dev/null
+++ b/node_modules/date-fns/addMinutes.d.cts
@@ -0,0 +1,36 @@
+import type { ContextOptions, DateArg } from "./types.js";
+/**
+ * The {@link addMinutes} function options.
+ */
+export interface AddMinutesOptions
+ extends ContextOptions {}
+/**
+ * @name addMinutes
+ * @category Minute Helpers
+ * @summary Add the specified number of minutes to the given date.
+ *
+ * @description
+ * Add the specified number of minutes to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of minutes to be added.
+ * @param options - An object with options
+ *
+ * @returns The new date with the minutes added
+ *
+ * @example
+ * // Add 30 minutes to 10 July 2014 12:00:00:
+ * const result = addMinutes(new Date(2014, 6, 10, 12, 0), 30)
+ * //=> Thu Jul 10 2014 12:30:00
+ */
+export declare function addMinutes<
+ DateType extends Date,
+ ResultDate extends Date = DateType,
+>(
+ date: DateArg,
+ amount: number,
+ options?: AddMinutesOptions | undefined,
+): ResultDate;
diff --git a/node_modules/date-fns/addMinutes.d.ts b/node_modules/date-fns/addMinutes.d.ts
new file mode 100644
index 00000000..2a8e29b8
--- /dev/null
+++ b/node_modules/date-fns/addMinutes.d.ts
@@ -0,0 +1,36 @@
+import type { ContextOptions, DateArg } from "./types.js";
+/**
+ * The {@link addMinutes} function options.
+ */
+export interface AddMinutesOptions
+ extends ContextOptions {}
+/**
+ * @name addMinutes
+ * @category Minute Helpers
+ * @summary Add the specified number of minutes to the given date.
+ *
+ * @description
+ * Add the specified number of minutes to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of minutes to be added.
+ * @param options - An object with options
+ *
+ * @returns The new date with the minutes added
+ *
+ * @example
+ * // Add 30 minutes to 10 July 2014 12:00:00:
+ * const result = addMinutes(new Date(2014, 6, 10, 12, 0), 30)
+ * //=> Thu Jul 10 2014 12:30:00
+ */
+export declare function addMinutes<
+ DateType extends Date,
+ ResultDate extends Date = DateType,
+>(
+ date: DateArg,
+ amount: number,
+ options?: AddMinutesOptions | undefined,
+): ResultDate;
diff --git a/node_modules/date-fns/addMinutes.js b/node_modules/date-fns/addMinutes.js
new file mode 100644
index 00000000..3e21e9c9
--- /dev/null
+++ b/node_modules/date-fns/addMinutes.js
@@ -0,0 +1,37 @@
+import { millisecondsInMinute } from "./constants.js";
+import { toDate } from "./toDate.js";
+
+/**
+ * The {@link addMinutes} function options.
+ */
+
+/**
+ * @name addMinutes
+ * @category Minute Helpers
+ * @summary Add the specified number of minutes to the given date.
+ *
+ * @description
+ * Add the specified number of minutes to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of minutes to be added.
+ * @param options - An object with options
+ *
+ * @returns The new date with the minutes added
+ *
+ * @example
+ * // Add 30 minutes to 10 July 2014 12:00:00:
+ * const result = addMinutes(new Date(2014, 6, 10, 12, 0), 30)
+ * //=> Thu Jul 10 2014 12:30:00
+ */
+export function addMinutes(date, amount, options) {
+ const _date = toDate(date, options?.in);
+ _date.setTime(_date.getTime() + amount * millisecondsInMinute);
+ return _date;
+}
+
+// Fallback for modularized imports:
+export default addMinutes;
diff --git a/node_modules/date-fns/addMonths.cjs b/node_modules/date-fns/addMonths.cjs
new file mode 100644
index 00000000..f8511c0a
--- /dev/null
+++ b/node_modules/date-fns/addMonths.cjs
@@ -0,0 +1,78 @@
+"use strict";
+exports.addMonths = addMonths;
+var _index = require("./constructFrom.cjs");
+var _index2 = require("./toDate.cjs");
+
+/**
+ * The {@link addMonths} function options.
+ */
+
+/**
+ * @name addMonths
+ * @category Month Helpers
+ * @summary Add the specified number of months to the given date.
+ *
+ * @description
+ * Add the specified number of months to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of months to be added.
+ * @param options - The options object
+ *
+ * @returns The new date with the months added
+ *
+ * @example
+ * // Add 5 months to 1 September 2014:
+ * const result = addMonths(new Date(2014, 8, 1), 5)
+ * //=> Sun Feb 01 2015 00:00:00
+ *
+ * // Add one month to 30 January 2023:
+ * const result = addMonths(new Date(2023, 0, 30), 1)
+ * //=> Tue Feb 28 2023 00:00:00
+ */
+function addMonths(date, amount, options) {
+ const _date = (0, _index2.toDate)(date, options?.in);
+ if (isNaN(amount)) return (0, _index.constructFrom)(options?.in || date, NaN);
+ if (!amount) {
+ // If 0 months, no-op to avoid changing times in the hour before end of DST
+ return _date;
+ }
+ const dayOfMonth = _date.getDate();
+
+ // The JS Date object supports date math by accepting out-of-bounds values for
+ // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and
+ // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we
+ // want except that dates will wrap around the end of a month, meaning that
+ // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So
+ // we'll default to the end of the desired month by adding 1 to the desired
+ // month and using a date of 0 to back up one day to the end of the desired
+ // month.
+ const endOfDesiredMonth = (0, _index.constructFrom)(
+ options?.in || date,
+ _date.getTime(),
+ );
+ endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);
+ const daysInMonth = endOfDesiredMonth.getDate();
+ if (dayOfMonth >= daysInMonth) {
+ // If we're already at the end of the month, then this is the correct date
+ // and we're done.
+ return endOfDesiredMonth;
+ } else {
+ // Otherwise, we now know that setting the original day-of-month value won't
+ // cause an overflow, so set the desired day-of-month. Note that we can't
+ // just set the date of `endOfDesiredMonth` because that object may have had
+ // its time changed in the unusual case where where a DST transition was on
+ // the last day of the month and its local time was in the hour skipped or
+ // repeated next to a DST transition. So we use `date` instead which is
+ // guaranteed to still have the original time.
+ _date.setFullYear(
+ endOfDesiredMonth.getFullYear(),
+ endOfDesiredMonth.getMonth(),
+ dayOfMonth,
+ );
+ return _date;
+ }
+}
diff --git a/node_modules/date-fns/addMonths.d.cts b/node_modules/date-fns/addMonths.d.cts
new file mode 100644
index 00000000..503fb165
--- /dev/null
+++ b/node_modules/date-fns/addMonths.d.cts
@@ -0,0 +1,40 @@
+import type { ContextOptions, DateArg } from "./types.js";
+/**
+ * The {@link addMonths} function options.
+ */
+export interface AddMonthsOptions
+ extends ContextOptions {}
+/**
+ * @name addMonths
+ * @category Month Helpers
+ * @summary Add the specified number of months to the given date.
+ *
+ * @description
+ * Add the specified number of months to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of months to be added.
+ * @param options - The options object
+ *
+ * @returns The new date with the months added
+ *
+ * @example
+ * // Add 5 months to 1 September 2014:
+ * const result = addMonths(new Date(2014, 8, 1), 5)
+ * //=> Sun Feb 01 2015 00:00:00
+ *
+ * // Add one month to 30 January 2023:
+ * const result = addMonths(new Date(2023, 0, 30), 1)
+ * //=> Tue Feb 28 2023 00:00:00
+ */
+export declare function addMonths<
+ DateType extends Date,
+ ResultDate extends Date = DateType,
+>(
+ date: DateArg,
+ amount: number,
+ options?: AddMonthsOptions | undefined,
+): ResultDate;
diff --git a/node_modules/date-fns/addMonths.d.ts b/node_modules/date-fns/addMonths.d.ts
new file mode 100644
index 00000000..503fb165
--- /dev/null
+++ b/node_modules/date-fns/addMonths.d.ts
@@ -0,0 +1,40 @@
+import type { ContextOptions, DateArg } from "./types.js";
+/**
+ * The {@link addMonths} function options.
+ */
+export interface AddMonthsOptions
+ extends ContextOptions {}
+/**
+ * @name addMonths
+ * @category Month Helpers
+ * @summary Add the specified number of months to the given date.
+ *
+ * @description
+ * Add the specified number of months to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of months to be added.
+ * @param options - The options object
+ *
+ * @returns The new date with the months added
+ *
+ * @example
+ * // Add 5 months to 1 September 2014:
+ * const result = addMonths(new Date(2014, 8, 1), 5)
+ * //=> Sun Feb 01 2015 00:00:00
+ *
+ * // Add one month to 30 January 2023:
+ * const result = addMonths(new Date(2023, 0, 30), 1)
+ * //=> Tue Feb 28 2023 00:00:00
+ */
+export declare function addMonths<
+ DateType extends Date,
+ ResultDate extends Date = DateType,
+>(
+ date: DateArg,
+ amount: number,
+ options?: AddMonthsOptions | undefined,
+): ResultDate;
diff --git a/node_modules/date-fns/addMonths.js b/node_modules/date-fns/addMonths.js
new file mode 100644
index 00000000..a4eabae2
--- /dev/null
+++ b/node_modules/date-fns/addMonths.js
@@ -0,0 +1,76 @@
+import { constructFrom } from "./constructFrom.js";
+import { toDate } from "./toDate.js";
+
+/**
+ * The {@link addMonths} function options.
+ */
+
+/**
+ * @name addMonths
+ * @category Month Helpers
+ * @summary Add the specified number of months to the given date.
+ *
+ * @description
+ * Add the specified number of months to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of months to be added.
+ * @param options - The options object
+ *
+ * @returns The new date with the months added
+ *
+ * @example
+ * // Add 5 months to 1 September 2014:
+ * const result = addMonths(new Date(2014, 8, 1), 5)
+ * //=> Sun Feb 01 2015 00:00:00
+ *
+ * // Add one month to 30 January 2023:
+ * const result = addMonths(new Date(2023, 0, 30), 1)
+ * //=> Tue Feb 28 2023 00:00:00
+ */
+export function addMonths(date, amount, options) {
+ const _date = toDate(date, options?.in);
+ if (isNaN(amount)) return constructFrom(options?.in || date, NaN);
+ if (!amount) {
+ // If 0 months, no-op to avoid changing times in the hour before end of DST
+ return _date;
+ }
+ const dayOfMonth = _date.getDate();
+
+ // The JS Date object supports date math by accepting out-of-bounds values for
+ // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and
+ // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we
+ // want except that dates will wrap around the end of a month, meaning that
+ // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So
+ // we'll default to the end of the desired month by adding 1 to the desired
+ // month and using a date of 0 to back up one day to the end of the desired
+ // month.
+ const endOfDesiredMonth = constructFrom(options?.in || date, _date.getTime());
+ endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);
+ const daysInMonth = endOfDesiredMonth.getDate();
+ if (dayOfMonth >= daysInMonth) {
+ // If we're already at the end of the month, then this is the correct date
+ // and we're done.
+ return endOfDesiredMonth;
+ } else {
+ // Otherwise, we now know that setting the original day-of-month value won't
+ // cause an overflow, so set the desired day-of-month. Note that we can't
+ // just set the date of `endOfDesiredMonth` because that object may have had
+ // its time changed in the unusual case where where a DST transition was on
+ // the last day of the month and its local time was in the hour skipped or
+ // repeated next to a DST transition. So we use `date` instead which is
+ // guaranteed to still have the original time.
+ _date.setFullYear(
+ endOfDesiredMonth.getFullYear(),
+ endOfDesiredMonth.getMonth(),
+ dayOfMonth,
+ );
+ return _date;
+ }
+}
+
+// Fallback for modularized imports:
+export default addMonths;
diff --git a/node_modules/date-fns/addQuarters.cjs b/node_modules/date-fns/addQuarters.cjs
new file mode 100644
index 00000000..76ba510b
--- /dev/null
+++ b/node_modules/date-fns/addQuarters.cjs
@@ -0,0 +1,33 @@
+"use strict";
+exports.addQuarters = addQuarters;
+var _index = require("./addMonths.cjs");
+
+/**
+ * The {@link addQuarters} function options.
+ */
+
+/**
+ * @name addQuarters
+ * @category Quarter Helpers
+ * @summary Add the specified number of year quarters to the given date.
+ *
+ * @description
+ * Add the specified number of year quarters to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of quarters to be added.
+ * @param options - An object with options
+ *
+ * @returns The new date with the quarters added
+ *
+ * @example
+ * // Add 1 quarter to 1 September 2014:
+ * const result = addQuarters(new Date(2014, 8, 1), 1)
+ * //=; Mon Dec 01 2014 00:00:00
+ */
+function addQuarters(date, amount, options) {
+ return (0, _index.addMonths)(date, amount * 3, options);
+}
diff --git a/node_modules/date-fns/addQuarters.d.cts b/node_modules/date-fns/addQuarters.d.cts
new file mode 100644
index 00000000..cc37eabd
--- /dev/null
+++ b/node_modules/date-fns/addQuarters.d.cts
@@ -0,0 +1,36 @@
+import type { ContextOptions, DateArg } from "./types.js";
+/**
+ * The {@link addQuarters} function options.
+ */
+export interface AddQuartersOptions
+ extends ContextOptions {}
+/**
+ * @name addQuarters
+ * @category Quarter Helpers
+ * @summary Add the specified number of year quarters to the given date.
+ *
+ * @description
+ * Add the specified number of year quarters to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of quarters to be added.
+ * @param options - An object with options
+ *
+ * @returns The new date with the quarters added
+ *
+ * @example
+ * // Add 1 quarter to 1 September 2014:
+ * const result = addQuarters(new Date(2014, 8, 1), 1)
+ * //=; Mon Dec 01 2014 00:00:00
+ */
+export declare function addQuarters<
+ DateType extends Date,
+ ResultDate extends Date = DateType,
+>(
+ date: DateArg,
+ amount: number,
+ options?: AddQuartersOptions | undefined,
+): ResultDate;
diff --git a/node_modules/date-fns/addQuarters.d.ts b/node_modules/date-fns/addQuarters.d.ts
new file mode 100644
index 00000000..cc37eabd
--- /dev/null
+++ b/node_modules/date-fns/addQuarters.d.ts
@@ -0,0 +1,36 @@
+import type { ContextOptions, DateArg } from "./types.js";
+/**
+ * The {@link addQuarters} function options.
+ */
+export interface AddQuartersOptions
+ extends ContextOptions {}
+/**
+ * @name addQuarters
+ * @category Quarter Helpers
+ * @summary Add the specified number of year quarters to the given date.
+ *
+ * @description
+ * Add the specified number of year quarters to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of quarters to be added.
+ * @param options - An object with options
+ *
+ * @returns The new date with the quarters added
+ *
+ * @example
+ * // Add 1 quarter to 1 September 2014:
+ * const result = addQuarters(new Date(2014, 8, 1), 1)
+ * //=; Mon Dec 01 2014 00:00:00
+ */
+export declare function addQuarters<
+ DateType extends Date,
+ ResultDate extends Date = DateType,
+>(
+ date: DateArg,
+ amount: number,
+ options?: AddQuartersOptions | undefined,
+): ResultDate;
diff --git a/node_modules/date-fns/addQuarters.js b/node_modules/date-fns/addQuarters.js
new file mode 100644
index 00000000..e6fe8b0b
--- /dev/null
+++ b/node_modules/date-fns/addQuarters.js
@@ -0,0 +1,34 @@
+import { addMonths } from "./addMonths.js";
+
+/**
+ * The {@link addQuarters} function options.
+ */
+
+/**
+ * @name addQuarters
+ * @category Quarter Helpers
+ * @summary Add the specified number of year quarters to the given date.
+ *
+ * @description
+ * Add the specified number of year quarters to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of quarters to be added.
+ * @param options - An object with options
+ *
+ * @returns The new date with the quarters added
+ *
+ * @example
+ * // Add 1 quarter to 1 September 2014:
+ * const result = addQuarters(new Date(2014, 8, 1), 1)
+ * //=; Mon Dec 01 2014 00:00:00
+ */
+export function addQuarters(date, amount, options) {
+ return addMonths(date, amount * 3, options);
+}
+
+// Fallback for modularized imports:
+export default addQuarters;
diff --git a/node_modules/date-fns/addSeconds.cjs b/node_modules/date-fns/addSeconds.cjs
new file mode 100644
index 00000000..26c40d1b
--- /dev/null
+++ b/node_modules/date-fns/addSeconds.cjs
@@ -0,0 +1,33 @@
+"use strict";
+exports.addSeconds = addSeconds;
+var _index = require("./addMilliseconds.cjs");
+
+/**
+ * The {@link addSeconds} function options.
+ */
+
+/**
+ * @name addSeconds
+ * @category Second Helpers
+ * @summary Add the specified number of seconds to the given date.
+ *
+ * @description
+ * Add the specified number of seconds to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of seconds to be added.
+ * @param options - An object with options
+ *
+ * @returns The new date with the seconds added
+ *
+ * @example
+ * // Add 30 seconds to 10 July 2014 12:45:00:
+ * const result = addSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)
+ * //=> Thu Jul 10 2014 12:45:30
+ */
+function addSeconds(date, amount, options) {
+ return (0, _index.addMilliseconds)(date, amount * 1000, options);
+}
diff --git a/node_modules/date-fns/addSeconds.d.cts b/node_modules/date-fns/addSeconds.d.cts
new file mode 100644
index 00000000..30b9d9b9
--- /dev/null
+++ b/node_modules/date-fns/addSeconds.d.cts
@@ -0,0 +1,36 @@
+import type { ContextOptions, DateArg } from "./types.js";
+/**
+ * The {@link addSeconds} function options.
+ */
+export interface AddSecondsOptions
+ extends ContextOptions {}
+/**
+ * @name addSeconds
+ * @category Second Helpers
+ * @summary Add the specified number of seconds to the given date.
+ *
+ * @description
+ * Add the specified number of seconds to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of seconds to be added.
+ * @param options - An object with options
+ *
+ * @returns The new date with the seconds added
+ *
+ * @example
+ * // Add 30 seconds to 10 July 2014 12:45:00:
+ * const result = addSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)
+ * //=> Thu Jul 10 2014 12:45:30
+ */
+export declare function addSeconds<
+ DateType extends Date,
+ ResultDate extends Date = DateType,
+>(
+ date: DateArg,
+ amount: number,
+ options?: AddSecondsOptions | undefined,
+): ResultDate;
diff --git a/node_modules/date-fns/addSeconds.d.ts b/node_modules/date-fns/addSeconds.d.ts
new file mode 100644
index 00000000..30b9d9b9
--- /dev/null
+++ b/node_modules/date-fns/addSeconds.d.ts
@@ -0,0 +1,36 @@
+import type { ContextOptions, DateArg } from "./types.js";
+/**
+ * The {@link addSeconds} function options.
+ */
+export interface AddSecondsOptions
+ extends ContextOptions {}
+/**
+ * @name addSeconds
+ * @category Second Helpers
+ * @summary Add the specified number of seconds to the given date.
+ *
+ * @description
+ * Add the specified number of seconds to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of seconds to be added.
+ * @param options - An object with options
+ *
+ * @returns The new date with the seconds added
+ *
+ * @example
+ * // Add 30 seconds to 10 July 2014 12:45:00:
+ * const result = addSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)
+ * //=> Thu Jul 10 2014 12:45:30
+ */
+export declare function addSeconds<
+ DateType extends Date,
+ ResultDate extends Date = DateType,
+>(
+ date: DateArg,
+ amount: number,
+ options?: AddSecondsOptions | undefined,
+): ResultDate;
diff --git a/node_modules/date-fns/addSeconds.js b/node_modules/date-fns/addSeconds.js
new file mode 100644
index 00000000..b97049f2
--- /dev/null
+++ b/node_modules/date-fns/addSeconds.js
@@ -0,0 +1,34 @@
+import { addMilliseconds } from "./addMilliseconds.js";
+
+/**
+ * The {@link addSeconds} function options.
+ */
+
+/**
+ * @name addSeconds
+ * @category Second Helpers
+ * @summary Add the specified number of seconds to the given date.
+ *
+ * @description
+ * Add the specified number of seconds to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of seconds to be added.
+ * @param options - An object with options
+ *
+ * @returns The new date with the seconds added
+ *
+ * @example
+ * // Add 30 seconds to 10 July 2014 12:45:00:
+ * const result = addSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)
+ * //=> Thu Jul 10 2014 12:45:30
+ */
+export function addSeconds(date, amount, options) {
+ return addMilliseconds(date, amount * 1000, options);
+}
+
+// Fallback for modularized imports:
+export default addSeconds;
diff --git a/node_modules/date-fns/addWeeks.cjs b/node_modules/date-fns/addWeeks.cjs
new file mode 100644
index 00000000..b8b2d0a1
--- /dev/null
+++ b/node_modules/date-fns/addWeeks.cjs
@@ -0,0 +1,33 @@
+"use strict";
+exports.addWeeks = addWeeks;
+var _index = require("./addDays.cjs");
+
+/**
+ * The {@link addWeeks} function options.
+ */
+
+/**
+ * @name addWeeks
+ * @category Week Helpers
+ * @summary Add the specified number of weeks to the given date.
+ *
+ * @description
+ * Add the specified number of weeks to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of weeks to be added.
+ * @param options - An object with options
+ *
+ * @returns The new date with the weeks added
+ *
+ * @example
+ * // Add 4 weeks to 1 September 2014:
+ * const result = addWeeks(new Date(2014, 8, 1), 4)
+ * //=> Mon Sep 29 2014 00:00:00
+ */
+function addWeeks(date, amount, options) {
+ return (0, _index.addDays)(date, amount * 7, options);
+}
diff --git a/node_modules/date-fns/addWeeks.d.cts b/node_modules/date-fns/addWeeks.d.cts
new file mode 100644
index 00000000..5e718ed5
--- /dev/null
+++ b/node_modules/date-fns/addWeeks.d.cts
@@ -0,0 +1,36 @@
+import type { ContextOptions, DateArg } from "./types.js";
+/**
+ * The {@link addWeeks} function options.
+ */
+export interface AddWeeksOptions
+ extends ContextOptions {}
+/**
+ * @name addWeeks
+ * @category Week Helpers
+ * @summary Add the specified number of weeks to the given date.
+ *
+ * @description
+ * Add the specified number of weeks to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of weeks to be added.
+ * @param options - An object with options
+ *
+ * @returns The new date with the weeks added
+ *
+ * @example
+ * // Add 4 weeks to 1 September 2014:
+ * const result = addWeeks(new Date(2014, 8, 1), 4)
+ * //=> Mon Sep 29 2014 00:00:00
+ */
+export declare function addWeeks<
+ DateType extends Date,
+ ResultDate extends Date = DateType,
+>(
+ date: DateArg,
+ amount: number,
+ options?: AddWeeksOptions | undefined,
+): ResultDate;
diff --git a/node_modules/date-fns/addWeeks.d.ts b/node_modules/date-fns/addWeeks.d.ts
new file mode 100644
index 00000000..5e718ed5
--- /dev/null
+++ b/node_modules/date-fns/addWeeks.d.ts
@@ -0,0 +1,36 @@
+import type { ContextOptions, DateArg } from "./types.js";
+/**
+ * The {@link addWeeks} function options.
+ */
+export interface AddWeeksOptions
+ extends ContextOptions {}
+/**
+ * @name addWeeks
+ * @category Week Helpers
+ * @summary Add the specified number of weeks to the given date.
+ *
+ * @description
+ * Add the specified number of weeks to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of weeks to be added.
+ * @param options - An object with options
+ *
+ * @returns The new date with the weeks added
+ *
+ * @example
+ * // Add 4 weeks to 1 September 2014:
+ * const result = addWeeks(new Date(2014, 8, 1), 4)
+ * //=> Mon Sep 29 2014 00:00:00
+ */
+export declare function addWeeks<
+ DateType extends Date,
+ ResultDate extends Date = DateType,
+>(
+ date: DateArg,
+ amount: number,
+ options?: AddWeeksOptions | undefined,
+): ResultDate;
diff --git a/node_modules/date-fns/addWeeks.js b/node_modules/date-fns/addWeeks.js
new file mode 100644
index 00000000..15a35b2a
--- /dev/null
+++ b/node_modules/date-fns/addWeeks.js
@@ -0,0 +1,34 @@
+import { addDays } from "./addDays.js";
+
+/**
+ * The {@link addWeeks} function options.
+ */
+
+/**
+ * @name addWeeks
+ * @category Week Helpers
+ * @summary Add the specified number of weeks to the given date.
+ *
+ * @description
+ * Add the specified number of weeks to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of weeks to be added.
+ * @param options - An object with options
+ *
+ * @returns The new date with the weeks added
+ *
+ * @example
+ * // Add 4 weeks to 1 September 2014:
+ * const result = addWeeks(new Date(2014, 8, 1), 4)
+ * //=> Mon Sep 29 2014 00:00:00
+ */
+export function addWeeks(date, amount, options) {
+ return addDays(date, amount * 7, options);
+}
+
+// Fallback for modularized imports:
+export default addWeeks;
diff --git a/node_modules/date-fns/addYears.cjs b/node_modules/date-fns/addYears.cjs
new file mode 100644
index 00000000..054d6886
--- /dev/null
+++ b/node_modules/date-fns/addYears.cjs
@@ -0,0 +1,33 @@
+"use strict";
+exports.addYears = addYears;
+var _index = require("./addMonths.cjs");
+
+/**
+ * The {@link addYears} function options.
+ */
+
+/**
+ * @name addYears
+ * @category Year Helpers
+ * @summary Add the specified number of years to the given date.
+ *
+ * @description
+ * Add the specified number of years to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of years to be added.
+ * @param options - The options
+ *
+ * @returns The new date with the years added
+ *
+ * @example
+ * // Add 5 years to 1 September 2014:
+ * const result = addYears(new Date(2014, 8, 1), 5)
+ * //=> Sun Sep 01 2019 00:00:00
+ */
+function addYears(date, amount, options) {
+ return (0, _index.addMonths)(date, amount * 12, options);
+}
diff --git a/node_modules/date-fns/addYears.d.cts b/node_modules/date-fns/addYears.d.cts
new file mode 100644
index 00000000..1950d374
--- /dev/null
+++ b/node_modules/date-fns/addYears.d.cts
@@ -0,0 +1,36 @@
+import type { ContextOptions, DateArg } from "./types.js";
+/**
+ * The {@link addYears} function options.
+ */
+export interface AddYearsOptions
+ extends ContextOptions {}
+/**
+ * @name addYears
+ * @category Year Helpers
+ * @summary Add the specified number of years to the given date.
+ *
+ * @description
+ * Add the specified number of years to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of years to be added.
+ * @param options - The options
+ *
+ * @returns The new date with the years added
+ *
+ * @example
+ * // Add 5 years to 1 September 2014:
+ * const result = addYears(new Date(2014, 8, 1), 5)
+ * //=> Sun Sep 01 2019 00:00:00
+ */
+export declare function addYears<
+ DateType extends Date,
+ ResultDate extends Date = DateType,
+>(
+ date: DateArg,
+ amount: number,
+ options?: AddYearsOptions | undefined,
+): ResultDate;
diff --git a/node_modules/date-fns/addYears.d.ts b/node_modules/date-fns/addYears.d.ts
new file mode 100644
index 00000000..1950d374
--- /dev/null
+++ b/node_modules/date-fns/addYears.d.ts
@@ -0,0 +1,36 @@
+import type { ContextOptions, DateArg } from "./types.js";
+/**
+ * The {@link addYears} function options.
+ */
+export interface AddYearsOptions
+ extends ContextOptions {}
+/**
+ * @name addYears
+ * @category Year Helpers
+ * @summary Add the specified number of years to the given date.
+ *
+ * @description
+ * Add the specified number of years to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of years to be added.
+ * @param options - The options
+ *
+ * @returns The new date with the years added
+ *
+ * @example
+ * // Add 5 years to 1 September 2014:
+ * const result = addYears(new Date(2014, 8, 1), 5)
+ * //=> Sun Sep 01 2019 00:00:00
+ */
+export declare function addYears<
+ DateType extends Date,
+ ResultDate extends Date = DateType,
+>(
+ date: DateArg,
+ amount: number,
+ options?: AddYearsOptions | undefined,
+): ResultDate;
diff --git a/node_modules/date-fns/addYears.js b/node_modules/date-fns/addYears.js
new file mode 100644
index 00000000..055bf825
--- /dev/null
+++ b/node_modules/date-fns/addYears.js
@@ -0,0 +1,34 @@
+import { addMonths } from "./addMonths.js";
+
+/**
+ * The {@link addYears} function options.
+ */
+
+/**
+ * @name addYears
+ * @category Year Helpers
+ * @summary Add the specified number of years to the given date.
+ *
+ * @description
+ * Add the specified number of years to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of years to be added.
+ * @param options - The options
+ *
+ * @returns The new date with the years added
+ *
+ * @example
+ * // Add 5 years to 1 September 2014:
+ * const result = addYears(new Date(2014, 8, 1), 5)
+ * //=> Sun Sep 01 2019 00:00:00
+ */
+export function addYears(date, amount, options) {
+ return addMonths(date, amount * 12, options);
+}
+
+// Fallback for modularized imports:
+export default addYears;
diff --git a/node_modules/date-fns/areIntervalsOverlapping.cjs b/node_modules/date-fns/areIntervalsOverlapping.cjs
new file mode 100644
index 00000000..c4783833
--- /dev/null
+++ b/node_modules/date-fns/areIntervalsOverlapping.cjs
@@ -0,0 +1,70 @@
+"use strict";
+exports.areIntervalsOverlapping = areIntervalsOverlapping;
+var _index = require("./toDate.cjs");
+
+/**
+ * The {@link areIntervalsOverlapping} function options.
+ */
+
+/**
+ * @name areIntervalsOverlapping
+ * @category Interval Helpers
+ * @summary Is the given time interval overlapping with another time interval?
+ *
+ * @description
+ * Is the given time interval overlapping with another time interval? Adjacent intervals do not count as overlapping unless `inclusive` is set to `true`.
+ *
+ * @param intervalLeft - The first interval to compare.
+ * @param intervalRight - The second interval to compare.
+ * @param options - The object with options
+ *
+ * @returns Whether the time intervals are overlapping
+ *
+ * @example
+ * // For overlapping time intervals:
+ * areIntervalsOverlapping(
+ * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
+ * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) }
+ * )
+ * //=> true
+ *
+ * @example
+ * // For non-overlapping time intervals:
+ * areIntervalsOverlapping(
+ * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
+ * { start: new Date(2014, 0, 21), end: new Date(2014, 0, 22) }
+ * )
+ * //=> false
+ *
+ * @example
+ * // For adjacent time intervals:
+ * areIntervalsOverlapping(
+ * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
+ * { start: new Date(2014, 0, 20), end: new Date(2014, 0, 30) }
+ * )
+ * //=> false
+ *
+ * @example
+ * // Using the inclusive option:
+ * areIntervalsOverlapping(
+ * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
+ * { start: new Date(2014, 0, 20), end: new Date(2014, 0, 24) },
+ * { inclusive: true }
+ * )
+ * //=> true
+ */
+function areIntervalsOverlapping(intervalLeft, intervalRight, options) {
+ const [leftStartTime, leftEndTime] = [
+ +(0, _index.toDate)(intervalLeft.start, options?.in),
+ +(0, _index.toDate)(intervalLeft.end, options?.in),
+ ].sort((a, b) => a - b);
+ const [rightStartTime, rightEndTime] = [
+ +(0, _index.toDate)(intervalRight.start, options?.in),
+ +(0, _index.toDate)(intervalRight.end, options?.in),
+ ].sort((a, b) => a - b);
+
+ if (options?.inclusive)
+ return leftStartTime <= rightEndTime && rightStartTime <= leftEndTime;
+
+ return leftStartTime < rightEndTime && rightStartTime < leftEndTime;
+}
diff --git a/node_modules/date-fns/areIntervalsOverlapping.d.cts b/node_modules/date-fns/areIntervalsOverlapping.d.cts
new file mode 100644
index 00000000..75847d70
--- /dev/null
+++ b/node_modules/date-fns/areIntervalsOverlapping.d.cts
@@ -0,0 +1,60 @@
+import type { ContextOptions, Interval } from "./types.js";
+/**
+ * The {@link areIntervalsOverlapping} function options.
+ */
+export interface AreIntervalsOverlappingOptions extends ContextOptions {
+ /** Whether the comparison is inclusive or not */
+ inclusive?: boolean;
+}
+/**
+ * @name areIntervalsOverlapping
+ * @category Interval Helpers
+ * @summary Is the given time interval overlapping with another time interval?
+ *
+ * @description
+ * Is the given time interval overlapping with another time interval? Adjacent intervals do not count as overlapping unless `inclusive` is set to `true`.
+ *
+ * @param intervalLeft - The first interval to compare.
+ * @param intervalRight - The second interval to compare.
+ * @param options - The object with options
+ *
+ * @returns Whether the time intervals are overlapping
+ *
+ * @example
+ * // For overlapping time intervals:
+ * areIntervalsOverlapping(
+ * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
+ * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) }
+ * )
+ * //=> true
+ *
+ * @example
+ * // For non-overlapping time intervals:
+ * areIntervalsOverlapping(
+ * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
+ * { start: new Date(2014, 0, 21), end: new Date(2014, 0, 22) }
+ * )
+ * //=> false
+ *
+ * @example
+ * // For adjacent time intervals:
+ * areIntervalsOverlapping(
+ * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
+ * { start: new Date(2014, 0, 20), end: new Date(2014, 0, 30) }
+ * )
+ * //=> false
+ *
+ * @example
+ * // Using the inclusive option:
+ * areIntervalsOverlapping(
+ * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
+ * { start: new Date(2014, 0, 20), end: new Date(2014, 0, 24) },
+ * { inclusive: true }
+ * )
+ * //=> true
+ */
+export declare function areIntervalsOverlapping(
+ intervalLeft: Interval,
+ intervalRight: Interval,
+ options?: AreIntervalsOverlappingOptions,
+): boolean;
diff --git a/node_modules/date-fns/areIntervalsOverlapping.d.ts b/node_modules/date-fns/areIntervalsOverlapping.d.ts
new file mode 100644
index 00000000..75847d70
--- /dev/null
+++ b/node_modules/date-fns/areIntervalsOverlapping.d.ts
@@ -0,0 +1,60 @@
+import type { ContextOptions, Interval } from "./types.js";
+/**
+ * The {@link areIntervalsOverlapping} function options.
+ */
+export interface AreIntervalsOverlappingOptions extends ContextOptions {
+ /** Whether the comparison is inclusive or not */
+ inclusive?: boolean;
+}
+/**
+ * @name areIntervalsOverlapping
+ * @category Interval Helpers
+ * @summary Is the given time interval overlapping with another time interval?
+ *
+ * @description
+ * Is the given time interval overlapping with another time interval? Adjacent intervals do not count as overlapping unless `inclusive` is set to `true`.
+ *
+ * @param intervalLeft - The first interval to compare.
+ * @param intervalRight - The second interval to compare.
+ * @param options - The object with options
+ *
+ * @returns Whether the time intervals are overlapping
+ *
+ * @example
+ * // For overlapping time intervals:
+ * areIntervalsOverlapping(
+ * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
+ * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) }
+ * )
+ * //=> true
+ *
+ * @example
+ * // For non-overlapping time intervals:
+ * areIntervalsOverlapping(
+ * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
+ * { start: new Date(2014, 0, 21), end: new Date(2014, 0, 22) }
+ * )
+ * //=> false
+ *
+ * @example
+ * // For adjacent time intervals:
+ * areIntervalsOverlapping(
+ * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
+ * { start: new Date(2014, 0, 20), end: new Date(2014, 0, 30) }
+ * )
+ * //=> false
+ *
+ * @example
+ * // Using the inclusive option:
+ * areIntervalsOverlapping(
+ * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
+ * { start: new Date(2014, 0, 20), end: new Date(2014, 0, 24) },
+ * { inclusive: true }
+ * )
+ * //=> true
+ */
+export declare function areIntervalsOverlapping(
+ intervalLeft: Interval,
+ intervalRight: Interval,
+ options?: AreIntervalsOverlappingOptions,
+): boolean;
diff --git a/node_modules/date-fns/areIntervalsOverlapping.js b/node_modules/date-fns/areIntervalsOverlapping.js
new file mode 100644
index 00000000..63ddae89
--- /dev/null
+++ b/node_modules/date-fns/areIntervalsOverlapping.js
@@ -0,0 +1,71 @@
+import { toDate } from "./toDate.js";
+
+/**
+ * The {@link areIntervalsOverlapping} function options.
+ */
+
+/**
+ * @name areIntervalsOverlapping
+ * @category Interval Helpers
+ * @summary Is the given time interval overlapping with another time interval?
+ *
+ * @description
+ * Is the given time interval overlapping with another time interval? Adjacent intervals do not count as overlapping unless `inclusive` is set to `true`.
+ *
+ * @param intervalLeft - The first interval to compare.
+ * @param intervalRight - The second interval to compare.
+ * @param options - The object with options
+ *
+ * @returns Whether the time intervals are overlapping
+ *
+ * @example
+ * // For overlapping time intervals:
+ * areIntervalsOverlapping(
+ * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
+ * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) }
+ * )
+ * //=> true
+ *
+ * @example
+ * // For non-overlapping time intervals:
+ * areIntervalsOverlapping(
+ * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
+ * { start: new Date(2014, 0, 21), end: new Date(2014, 0, 22) }
+ * )
+ * //=> false
+ *
+ * @example
+ * // For adjacent time intervals:
+ * areIntervalsOverlapping(
+ * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
+ * { start: new Date(2014, 0, 20), end: new Date(2014, 0, 30) }
+ * )
+ * //=> false
+ *
+ * @example
+ * // Using the inclusive option:
+ * areIntervalsOverlapping(
+ * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
+ * { start: new Date(2014, 0, 20), end: new Date(2014, 0, 24) },
+ * { inclusive: true }
+ * )
+ * //=> true
+ */
+export function areIntervalsOverlapping(intervalLeft, intervalRight, options) {
+ const [leftStartTime, leftEndTime] = [
+ +toDate(intervalLeft.start, options?.in),
+ +toDate(intervalLeft.end, options?.in),
+ ].sort((a, b) => a - b);
+ const [rightStartTime, rightEndTime] = [
+ +toDate(intervalRight.start, options?.in),
+ +toDate(intervalRight.end, options?.in),
+ ].sort((a, b) => a - b);
+
+ if (options?.inclusive)
+ return leftStartTime <= rightEndTime && rightStartTime <= leftEndTime;
+
+ return leftStartTime < rightEndTime && rightStartTime < leftEndTime;
+}
+
+// Fallback for modularized imports:
+export default areIntervalsOverlapping;
diff --git a/node_modules/date-fns/cdn.js b/node_modules/date-fns/cdn.js
new file mode 100644
index 00000000..2971e2b9
--- /dev/null
+++ b/node_modules/date-fns/cdn.js
@@ -0,0 +1,5487 @@
+(() => {
+function _createForOfIteratorHelper(o, allowArrayLike) {var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];if (!it) {if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {if (it) o = it;var i = 0;var F = function F() {};return { s: F, n: function n() {if (i >= o.length) return { done: true };return { done: false, value: o[i++] };}, e: function e(_e) {throw _e;}, f: F };}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var normalCompletion = true,didErr = false,err;return { s: function s() {it = it.call(o);}, n: function n() {var step = it.next();normalCompletion = step.done;return step;}, e: function e(_e2) {didErr = true;err = _e2;}, f: function f() {try {if (!normalCompletion && it.return != null) it.return();} finally {if (didErr) throw err;}} };}function _callSuper(t, o, e) {return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));}function _possibleConstructorReturn(self, call) {if (call && (_typeof(call) === "object" || typeof call === "function")) {return call;} else if (call !== void 0) {throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self) {if (self === void 0) {throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct() {try {var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));} catch (t) {}return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {return !!t;})();}function _getPrototypeOf(o) {_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {return o.__proto__ || Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _inherits(subClass, superClass) {if (typeof superClass !== "function" && superClass !== null) {throw new TypeError("Super expression must either be null or a function");}subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });Object.defineProperty(subClass, "prototype", { writable: false });if (superClass) _setPrototypeOf(subClass, superClass);}function _setPrototypeOf(o, p) {_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {o.__proto__ = p;return o;};return _setPrototypeOf(o, p);}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);Object.defineProperty(Constructor, "prototype", { writable: false });return Constructor;}function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}function _toArray(arr) {return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest();}function _iterableToArray(iter) {if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);}function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];return arr2;}function _iterableToArrayLimit(r, l) {var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];if (null != t) {var e,n,i,u,a = [],f = !0,o = !1;try {if (i = (t = t.call(r)).next, 0 === l) {if (Object(t) !== t) return;f = !1;} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);} catch (r) {o = !0, n = r;} finally {try {if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;} finally {if (o) throw n;}}return a;}}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function ownKeys(e, r) {var t = Object.keys(e);if (Object.getOwnPropertySymbols) {var o = Object.getOwnPropertySymbols(e);r && (o = o.filter(function (r) {return Object.getOwnPropertyDescriptor(e, r).enumerable;})), t.push.apply(t, o);}return t;}function _objectSpread(e) {for (var r = 1; r < arguments.length; r++) {var t = null != arguments[r] ? arguments[r] : {};r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {_defineProperty(e, r, t[r]);}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));});}return e;}function _defineProperty(obj, key, value) {key = _toPropertyKey(key);if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toPropertyKey(t) {var i = _toPrimitive(t, "string");return "symbol" == _typeof(i) ? i : String(i);}function _toPrimitive(t, r) {if ("object" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || "default");if ("object" != _typeof(i)) return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return ("string" === r ? String : Number)(t);}function _typeof(o) {"@babel/helpers - typeof";return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;}, _typeof(o);}var __defProp = Object.defineProperty;
+var __export = function __export(target, all) {
+ for (var name in all)
+ __defProp(target, name, {
+ get: all[name],
+ enumerable: true,
+ configurable: true,
+ set: function set(newValue) {return all[name] = function () {return newValue;};}
+ });
+};
+
+// lib/index.js
+var exports_lib = {};
+__export(exports_lib, {
+ yearsToQuarters: function yearsToQuarters() {return _yearsToQuarters;},
+ yearsToMonths: function yearsToMonths() {return _yearsToMonths;},
+ yearsToDays: function yearsToDays() {return _yearsToDays;},
+ weeksToDays: function weeksToDays() {return _weeksToDays;},
+ transpose: function transpose() {return _transpose;},
+ toDate: function toDate() {return _toDate;},
+ subYears: function subYears() {return _subYears;},
+ subWeeks: function subWeeks() {return _subWeeks;},
+ subSeconds: function subSeconds() {return _subSeconds;},
+ subQuarters: function subQuarters() {return _subQuarters;},
+ subMonths: function subMonths() {return _subMonths;},
+ subMinutes: function subMinutes() {return _subMinutes;},
+ subMilliseconds: function subMilliseconds() {return _subMilliseconds;},
+ subISOWeekYears: function subISOWeekYears() {return _subISOWeekYears;},
+ subHours: function subHours() {return _subHours;},
+ subDays: function subDays() {return _subDays;},
+ subBusinessDays: function subBusinessDays() {return _subBusinessDays;},
+ sub: function sub() {return _sub;},
+ startOfYesterday: function startOfYesterday() {return _startOfYesterday;},
+ startOfYear: function startOfYear() {return _startOfYear;},
+ startOfWeekYear: function startOfWeekYear() {return _startOfWeekYear;},
+ startOfWeek: function startOfWeek() {return _startOfWeek;},
+ startOfTomorrow: function startOfTomorrow() {return _startOfTomorrow;},
+ startOfToday: function startOfToday() {return _startOfToday;},
+ startOfSecond: function startOfSecond() {return _startOfSecond;},
+ startOfQuarter: function startOfQuarter() {return _startOfQuarter;},
+ startOfMonth: function startOfMonth() {return _startOfMonth;},
+ startOfMinute: function startOfMinute() {return _startOfMinute;},
+ startOfISOWeekYear: function startOfISOWeekYear() {return _startOfISOWeekYear;},
+ startOfISOWeek: function startOfISOWeek() {return _startOfISOWeek;},
+ startOfHour: function startOfHour() {return _startOfHour;},
+ startOfDecade: function startOfDecade() {return _startOfDecade;},
+ startOfDay: function startOfDay() {return _startOfDay;},
+ setYear: function setYear() {return _setYear;},
+ setWeekYear: function setWeekYear() {return _setWeekYear;},
+ setWeek: function setWeek() {return _setWeek;},
+ setSeconds: function setSeconds() {return _setSeconds;},
+ setQuarter: function setQuarter() {return _setQuarter;},
+ setMonth: function setMonth() {return _setMonth;},
+ setMinutes: function setMinutes() {return _setMinutes;},
+ setMilliseconds: function setMilliseconds() {return _setMilliseconds;},
+ setISOWeekYear: function setISOWeekYear() {return _setISOWeekYear;},
+ setISOWeek: function setISOWeek() {return _setISOWeek;},
+ setISODay: function setISODay() {return _setISODay;},
+ setHours: function setHours() {return _setHours;},
+ setDefaultOptions: function setDefaultOptions() {return setDefaultOptions2;},
+ setDayOfYear: function setDayOfYear() {return _setDayOfYear;},
+ setDay: function setDay() {return _setDay;},
+ setDate: function setDate() {return _setDate;},
+ set: function set() {return _set;},
+ secondsToMinutes: function secondsToMinutes() {return _secondsToMinutes;},
+ secondsToMilliseconds: function secondsToMilliseconds() {return _secondsToMilliseconds;},
+ secondsToHours: function secondsToHours() {return _secondsToHours;},
+ roundToNearestMinutes: function roundToNearestMinutes() {return _roundToNearestMinutes;},
+ roundToNearestHours: function roundToNearestHours() {return _roundToNearestHours;},
+ quartersToYears: function quartersToYears() {return _quartersToYears;},
+ quartersToMonths: function quartersToMonths() {return _quartersToMonths;},
+ previousWednesday: function previousWednesday() {return _previousWednesday;},
+ previousTuesday: function previousTuesday() {return _previousTuesday;},
+ previousThursday: function previousThursday() {return _previousThursday;},
+ previousSunday: function previousSunday() {return _previousSunday;},
+ previousSaturday: function previousSaturday() {return _previousSaturday;},
+ previousMonday: function previousMonday() {return _previousMonday;},
+ previousFriday: function previousFriday() {return _previousFriday;},
+ previousDay: function previousDay() {return _previousDay;},
+ parsers: function parsers() {return _parsers;},
+ parseJSON: function parseJSON() {return _parseJSON;},
+ parseISO: function parseISO() {return _parseISO;},
+ parse: function parse() {return _parse;},
+ nextWednesday: function nextWednesday() {return _nextWednesday;},
+ nextTuesday: function nextTuesday() {return _nextTuesday;},
+ nextThursday: function nextThursday() {return _nextThursday;},
+ nextSunday: function nextSunday() {return _nextSunday;},
+ nextSaturday: function nextSaturday() {return _nextSaturday;},
+ nextMonday: function nextMonday() {return _nextMonday;},
+ nextFriday: function nextFriday() {return _nextFriday;},
+ nextDay: function nextDay() {return _nextDay;},
+ monthsToYears: function monthsToYears() {return _monthsToYears;},
+ monthsToQuarters: function monthsToQuarters() {return _monthsToQuarters;},
+ minutesToSeconds: function minutesToSeconds() {return _minutesToSeconds;},
+ minutesToMilliseconds: function minutesToMilliseconds() {return _minutesToMilliseconds;},
+ minutesToHours: function minutesToHours() {return _minutesToHours;},
+ min: function min() {return _min;},
+ millisecondsToSeconds: function millisecondsToSeconds() {return _millisecondsToSeconds;},
+ millisecondsToMinutes: function millisecondsToMinutes() {return _millisecondsToMinutes;},
+ millisecondsToHours: function millisecondsToHours() {return _millisecondsToHours;},
+ milliseconds: function milliseconds() {return _milliseconds;},
+ max: function max() {return _max;},
+ longFormatters: function longFormatters() {return _longFormatters;},
+ lightFormatters: function lightFormatters() {return _lightFormatters;},
+ lightFormat: function lightFormat() {return _lightFormat;},
+ lastDayOfYear: function lastDayOfYear() {return _lastDayOfYear;},
+ lastDayOfWeek: function lastDayOfWeek() {return _lastDayOfWeek;},
+ lastDayOfQuarter: function lastDayOfQuarter() {return _lastDayOfQuarter;},
+ lastDayOfMonth: function lastDayOfMonth() {return _lastDayOfMonth;},
+ lastDayOfISOWeekYear: function lastDayOfISOWeekYear() {return _lastDayOfISOWeekYear;},
+ lastDayOfISOWeek: function lastDayOfISOWeek() {return _lastDayOfISOWeek;},
+ lastDayOfDecade: function lastDayOfDecade() {return _lastDayOfDecade;},
+ isYesterday: function isYesterday() {return _isYesterday;},
+ isWithinInterval: function isWithinInterval() {return _isWithinInterval;},
+ isWeekend: function isWeekend() {return _isWeekend;},
+ isWednesday: function isWednesday() {return _isWednesday;},
+ isValid: function isValid() {return _isValid;},
+ isTuesday: function isTuesday() {return _isTuesday;},
+ isTomorrow: function isTomorrow() {return _isTomorrow;},
+ isToday: function isToday() {return _isToday;},
+ isThursday: function isThursday() {return _isThursday;},
+ isThisYear: function isThisYear() {return _isThisYear;},
+ isThisWeek: function isThisWeek() {return _isThisWeek;},
+ isThisSecond: function isThisSecond() {return _isThisSecond;},
+ isThisQuarter: function isThisQuarter() {return _isThisQuarter;},
+ isThisMonth: function isThisMonth() {return _isThisMonth;},
+ isThisMinute: function isThisMinute() {return _isThisMinute;},
+ isThisISOWeek: function isThisISOWeek() {return _isThisISOWeek;},
+ isThisHour: function isThisHour() {return _isThisHour;},
+ isSunday: function isSunday() {return _isSunday;},
+ isSaturday: function isSaturday() {return _isSaturday;},
+ isSameYear: function isSameYear() {return _isSameYear;},
+ isSameWeek: function isSameWeek() {return _isSameWeek;},
+ isSameSecond: function isSameSecond() {return _isSameSecond;},
+ isSameQuarter: function isSameQuarter() {return _isSameQuarter;},
+ isSameMonth: function isSameMonth() {return _isSameMonth;},
+ isSameMinute: function isSameMinute() {return _isSameMinute;},
+ isSameISOWeekYear: function isSameISOWeekYear() {return _isSameISOWeekYear;},
+ isSameISOWeek: function isSameISOWeek() {return _isSameISOWeek;},
+ isSameHour: function isSameHour() {return _isSameHour;},
+ isSameDay: function isSameDay() {return _isSameDay;},
+ isPast: function isPast() {return _isPast;},
+ isMonday: function isMonday() {return _isMonday;},
+ isMatch: function isMatch() {return _isMatch;},
+ isLeapYear: function isLeapYear() {return _isLeapYear;},
+ isLastDayOfMonth: function isLastDayOfMonth() {return _isLastDayOfMonth;},
+ isFuture: function isFuture() {return _isFuture;},
+ isFriday: function isFriday() {return _isFriday;},
+ isFirstDayOfMonth: function isFirstDayOfMonth() {return _isFirstDayOfMonth;},
+ isExists: function isExists() {return _isExists;},
+ isEqual: function isEqual() {return _isEqual;},
+ isDate: function isDate() {return _isDate;},
+ isBefore: function isBefore() {return _isBefore;},
+ isAfter: function isAfter() {return _isAfter;},
+ intlFormatDistance: function intlFormatDistance() {return _intlFormatDistance;},
+ intlFormat: function intlFormat() {return _intlFormat;},
+ intervalToDuration: function intervalToDuration() {return _intervalToDuration;},
+ interval: function interval() {return _interval;},
+ hoursToSeconds: function hoursToSeconds() {return _hoursToSeconds;},
+ hoursToMinutes: function hoursToMinutes() {return _hoursToMinutes;},
+ hoursToMilliseconds: function hoursToMilliseconds() {return _hoursToMilliseconds;},
+ getYear: function getYear() {return _getYear;},
+ getWeeksInMonth: function getWeeksInMonth() {return _getWeeksInMonth;},
+ getWeekYear: function getWeekYear() {return _getWeekYear;},
+ getWeekOfMonth: function getWeekOfMonth() {return _getWeekOfMonth;},
+ getWeek: function getWeek() {return _getWeek;},
+ getUnixTime: function getUnixTime() {return _getUnixTime;},
+ getTime: function getTime() {return _getTime;},
+ getSeconds: function getSeconds() {return _getSeconds;},
+ getQuarter: function getQuarter() {return _getQuarter;},
+ getOverlappingDaysInIntervals: function getOverlappingDaysInIntervals() {return _getOverlappingDaysInIntervals;},
+ getMonth: function getMonth() {return _getMonth;},
+ getMinutes: function getMinutes() {return _getMinutes;},
+ getMilliseconds: function getMilliseconds() {return _getMilliseconds;},
+ getISOWeeksInYear: function getISOWeeksInYear() {return _getISOWeeksInYear;},
+ getISOWeekYear: function getISOWeekYear() {return _getISOWeekYear;},
+ getISOWeek: function getISOWeek() {return _getISOWeek;},
+ getISODay: function getISODay() {return _getISODay;},
+ getHours: function getHours() {return _getHours;},
+ getDefaultOptions: function getDefaultOptions() {return getDefaultOptions2;},
+ getDecade: function getDecade() {return _getDecade;},
+ getDaysInYear: function getDaysInYear() {return _getDaysInYear;},
+ getDaysInMonth: function getDaysInMonth() {return _getDaysInMonth;},
+ getDayOfYear: function getDayOfYear() {return _getDayOfYear;},
+ getDay: function getDay() {return _getDay;},
+ getDate: function getDate() {return _getDate;},
+ fromUnixTime: function fromUnixTime() {return _fromUnixTime;},
+ formatters: function formatters() {return _formatters;},
+ formatRelative: function formatRelative() {return formatRelative3;},
+ formatRFC7231: function formatRFC7231() {return _formatRFC;},
+ formatRFC3339: function formatRFC3339() {return _formatRFC2;},
+ formatISODuration: function formatISODuration() {return _formatISODuration;},
+ formatISO9075: function formatISO9075() {return _formatISO;},
+ formatISO: function formatISO() {return _formatISO2;},
+ formatDuration: function formatDuration() {return _formatDuration;},
+ formatDistanceToNowStrict: function formatDistanceToNowStrict() {return _formatDistanceToNowStrict;},
+ formatDistanceToNow: function formatDistanceToNow() {return _formatDistanceToNow;},
+ formatDistanceStrict: function formatDistanceStrict() {return _formatDistanceStrict;},
+ formatDistance: function formatDistance() {return formatDistance3;},
+ formatDate: function formatDate() {return _format;},
+ format: function format() {return _format;},
+ endOfYesterday: function endOfYesterday() {return _endOfYesterday;},
+ endOfYear: function endOfYear() {return _endOfYear;},
+ endOfWeek: function endOfWeek() {return _endOfWeek;},
+ endOfTomorrow: function endOfTomorrow() {return _endOfTomorrow;},
+ endOfToday: function endOfToday() {return _endOfToday;},
+ endOfSecond: function endOfSecond() {return _endOfSecond;},
+ endOfQuarter: function endOfQuarter() {return _endOfQuarter;},
+ endOfMonth: function endOfMonth() {return _endOfMonth;},
+ endOfMinute: function endOfMinute() {return _endOfMinute;},
+ endOfISOWeekYear: function endOfISOWeekYear() {return _endOfISOWeekYear;},
+ endOfISOWeek: function endOfISOWeek() {return _endOfISOWeek;},
+ endOfHour: function endOfHour() {return _endOfHour;},
+ endOfDecade: function endOfDecade() {return _endOfDecade;},
+ endOfDay: function endOfDay() {return _endOfDay;},
+ eachYearOfInterval: function eachYearOfInterval() {return _eachYearOfInterval;},
+ eachWeekendOfYear: function eachWeekendOfYear() {return _eachWeekendOfYear;},
+ eachWeekendOfMonth: function eachWeekendOfMonth() {return _eachWeekendOfMonth;},
+ eachWeekendOfInterval: function eachWeekendOfInterval() {return _eachWeekendOfInterval;},
+ eachWeekOfInterval: function eachWeekOfInterval() {return _eachWeekOfInterval;},
+ eachQuarterOfInterval: function eachQuarterOfInterval() {return _eachQuarterOfInterval;},
+ eachMonthOfInterval: function eachMonthOfInterval() {return _eachMonthOfInterval;},
+ eachMinuteOfInterval: function eachMinuteOfInterval() {return _eachMinuteOfInterval;},
+ eachHourOfInterval: function eachHourOfInterval() {return _eachHourOfInterval;},
+ eachDayOfInterval: function eachDayOfInterval() {return _eachDayOfInterval;},
+ differenceInYears: function differenceInYears() {return _differenceInYears;},
+ differenceInWeeks: function differenceInWeeks() {return _differenceInWeeks;},
+ differenceInSeconds: function differenceInSeconds() {return _differenceInSeconds;},
+ differenceInQuarters: function differenceInQuarters() {return _differenceInQuarters;},
+ differenceInMonths: function differenceInMonths() {return _differenceInMonths;},
+ differenceInMinutes: function differenceInMinutes() {return _differenceInMinutes;},
+ differenceInMilliseconds: function differenceInMilliseconds() {return _differenceInMilliseconds;},
+ differenceInISOWeekYears: function differenceInISOWeekYears() {return _differenceInISOWeekYears;},
+ differenceInHours: function differenceInHours() {return _differenceInHours;},
+ differenceInDays: function differenceInDays() {return _differenceInDays;},
+ differenceInCalendarYears: function differenceInCalendarYears() {return _differenceInCalendarYears;},
+ differenceInCalendarWeeks: function differenceInCalendarWeeks() {return _differenceInCalendarWeeks;},
+ differenceInCalendarQuarters: function differenceInCalendarQuarters() {return _differenceInCalendarQuarters;},
+ differenceInCalendarMonths: function differenceInCalendarMonths() {return _differenceInCalendarMonths;},
+ differenceInCalendarISOWeeks: function differenceInCalendarISOWeeks() {return _differenceInCalendarISOWeeks;},
+ differenceInCalendarISOWeekYears: function differenceInCalendarISOWeekYears() {return _differenceInCalendarISOWeekYears;},
+ differenceInCalendarDays: function differenceInCalendarDays() {return _differenceInCalendarDays;},
+ differenceInBusinessDays: function differenceInBusinessDays() {return _differenceInBusinessDays;},
+ daysToWeeks: function daysToWeeks() {return _daysToWeeks;},
+ constructNow: function constructNow() {return _constructNow;},
+ constructFrom: function constructFrom() {return _constructFrom;},
+ compareDesc: function compareDesc() {return _compareDesc;},
+ compareAsc: function compareAsc() {return _compareAsc;},
+ closestTo: function closestTo() {return _closestTo;},
+ closestIndexTo: function closestIndexTo() {return _closestIndexTo;},
+ clamp: function clamp() {return _clamp;},
+ areIntervalsOverlapping: function areIntervalsOverlapping() {return _areIntervalsOverlapping;},
+ addYears: function addYears() {return _addYears;},
+ addWeeks: function addWeeks() {return _addWeeks;},
+ addSeconds: function addSeconds() {return _addSeconds;},
+ addQuarters: function addQuarters() {return _addQuarters;},
+ addMonths: function addMonths() {return _addMonths;},
+ addMinutes: function addMinutes() {return _addMinutes;},
+ addMilliseconds: function addMilliseconds() {return _addMilliseconds;},
+ addISOWeekYears: function addISOWeekYears() {return _addISOWeekYears;},
+ addHours: function addHours() {return _addHours;},
+ addDays: function addDays() {return _addDays;},
+ addBusinessDays: function addBusinessDays() {return _addBusinessDays;},
+ add: function add() {return _add;}
+});
+
+// lib/constants.js
+var daysInWeek = 7;
+var daysInYear = 365.2425;
+var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;
+var minTime = -maxTime;
+var millisecondsInWeek = 604800000;
+var millisecondsInDay = 86400000;
+var millisecondsInMinute = 60000;
+var millisecondsInHour = 3600000;
+var millisecondsInSecond = 1000;
+var minutesInYear = 525600;
+var minutesInMonth = 43200;
+var minutesInDay = 1440;
+var minutesInHour = 60;
+var monthsInQuarter = 3;
+var monthsInYear = 12;
+var quartersInYear = 4;
+var secondsInHour = 3600;
+var secondsInMinute = 60;
+var secondsInDay = secondsInHour * 24;
+var secondsInWeek = secondsInDay * 7;
+var secondsInYear = secondsInDay * daysInYear;
+var secondsInMonth = secondsInYear / 12;
+var secondsInQuarter = secondsInMonth * 3;
+var constructFromSymbol = Symbol.for("constructDateFrom");
+
+// lib/constructFrom.js
+function _constructFrom(date, value) {
+ if (typeof date === "function")
+ return date(value);
+ if (date && _typeof(date) === "object" && constructFromSymbol in date)
+ return date[constructFromSymbol](value);
+ if (date instanceof Date)
+ return new date.constructor(value);
+ return new Date(value);
+}
+
+// lib/toDate.js
+function _toDate(argument, context) {
+ return _constructFrom(context || argument, argument);
+}
+
+// lib/addDays.js
+function _addDays(date, amount, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ if (isNaN(amount))
+ return _constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, NaN);
+ if (!amount)
+ return _date;
+ _date.setDate(_date.getDate() + amount);
+ return _date;
+}
+
+// lib/addMonths.js
+function _addMonths(date, amount, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ if (isNaN(amount))
+ return _constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, NaN);
+ if (!amount) {
+ return _date;
+ }
+ var dayOfMonth = _date.getDate();
+ var endOfDesiredMonth = _constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, _date.getTime());
+ endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);
+ var daysInMonth = endOfDesiredMonth.getDate();
+ if (dayOfMonth >= daysInMonth) {
+ return endOfDesiredMonth;
+ } else {
+ _date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth);
+ return _date;
+ }
+}
+
+// lib/add.js
+function _add(date, duration, options) {
+ var _duration$years =
+
+
+
+
+
+
+
+ duration.years,years = _duration$years === void 0 ? 0 : _duration$years,_duration$months = duration.months,months = _duration$months === void 0 ? 0 : _duration$months,_duration$weeks = duration.weeks,weeks = _duration$weeks === void 0 ? 0 : _duration$weeks,_duration$days = duration.days,days = _duration$days === void 0 ? 0 : _duration$days,_duration$hours = duration.hours,hours = _duration$hours === void 0 ? 0 : _duration$hours,_duration$minutes = duration.minutes,minutes = _duration$minutes === void 0 ? 0 : _duration$minutes,_duration$seconds = duration.seconds,seconds = _duration$seconds === void 0 ? 0 : _duration$seconds;
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ var dateWithMonths = months || years ? _addMonths(_date, months + years * 12) : _date;
+ var dateWithDays = days || weeks ? _addDays(dateWithMonths, days + weeks * 7) : dateWithMonths;
+ var minutesToAdd = minutes + hours * 60;
+ var secondsToAdd = seconds + minutesToAdd * 60;
+ var msToAdd = secondsToAdd * 1000;
+ return _constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, +dateWithDays + msToAdd);
+}
+// lib/isSaturday.js
+function _isSaturday(date, options) {
+ return _toDate(date, options === null || options === void 0 ? void 0 : options.in).getDay() === 6;
+}
+
+// lib/isSunday.js
+function _isSunday(date, options) {
+ return _toDate(date, options === null || options === void 0 ? void 0 : options.in).getDay() === 0;
+}
+
+// lib/isWeekend.js
+function _isWeekend(date, options) {
+ var day = _toDate(date, options === null || options === void 0 ? void 0 : options.in).getDay();
+ return day === 0 || day === 6;
+}
+
+// lib/addBusinessDays.js
+function _addBusinessDays(date, amount, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ var startedOnWeekend = _isWeekend(_date, options);
+ if (isNaN(amount))
+ return _constructFrom(options === null || options === void 0 ? void 0 : options.in, NaN);
+ var hours = _date.getHours();
+ var sign = amount < 0 ? -1 : 1;
+ var fullWeeks = Math.trunc(amount / 5);
+ _date.setDate(_date.getDate() + fullWeeks * 7);
+ var restDays = Math.abs(amount % 5);
+ while (restDays > 0) {
+ _date.setDate(_date.getDate() + sign);
+ if (!_isWeekend(_date, options))
+ restDays -= 1;
+ }
+ if (startedOnWeekend && _isWeekend(_date, options) && amount !== 0) {
+ if (_isSaturday(_date, options))
+ _date.setDate(_date.getDate() + (sign < 0 ? 2 : -1));
+ if (_isSunday(_date, options))
+ _date.setDate(_date.getDate() + (sign < 0 ? 1 : -2));
+ }
+ _date.setHours(hours);
+ return _date;
+}
+// lib/addMilliseconds.js
+function _addMilliseconds(date, amount, options) {
+ return _constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, +_toDate(date) + amount);
+}
+
+// lib/addHours.js
+function _addHours(date, amount, options) {
+ return _addMilliseconds(date, amount * millisecondsInHour, options);
+}
+// lib/_lib/defaultOptions.js
+function getDefaultOptions() {
+ return defaultOptions;
+}
+function setDefaultOptions(newOptions) {
+ defaultOptions = newOptions;
+}
+var defaultOptions = {};
+
+// lib/startOfWeek.js
+function _startOfWeek(date, options) {var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _defaultOptions3$loca;
+ var defaultOptions3 = getDefaultOptions();
+ var weekStartsOn = (_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 || (_options$locale = options.locale) === null || _options$locale === void 0 || (_options$locale = _options$locale.options) === null || _options$locale === void 0 ? void 0 : _options$locale.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions3.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions3$loca = defaultOptions3.locale) === null || _defaultOptions3$loca === void 0 || (_defaultOptions3$loca = _defaultOptions3$loca.options) === null || _defaultOptions3$loca === void 0 ? void 0 : _defaultOptions3$loca.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0;
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ var day = _date.getDay();
+ var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
+ _date.setDate(_date.getDate() - diff);
+ _date.setHours(0, 0, 0, 0);
+ return _date;
+}
+
+// lib/startOfISOWeek.js
+function _startOfISOWeek(date, options) {
+ return _startOfWeek(date, _objectSpread(_objectSpread({}, options), {}, { weekStartsOn: 1 }));
+}
+
+// lib/getISOWeekYear.js
+function _getISOWeekYear(date, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ var year = _date.getFullYear();
+ var fourthOfJanuaryOfNextYear = _constructFrom(_date, 0);
+ fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
+ fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
+ var startOfNextYear = _startOfISOWeek(fourthOfJanuaryOfNextYear);
+ var fourthOfJanuaryOfThisYear = _constructFrom(_date, 0);
+ fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
+ fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
+ var startOfThisYear = _startOfISOWeek(fourthOfJanuaryOfThisYear);
+ if (_date.getTime() >= startOfNextYear.getTime()) {
+ return year + 1;
+ } else if (_date.getTime() >= startOfThisYear.getTime()) {
+ return year;
+ } else {
+ return year - 1;
+ }
+}
+
+// lib/_lib/getTimezoneOffsetInMilliseconds.js
+function getTimezoneOffsetInMilliseconds(date) {
+ var _date = _toDate(date);
+ var utcDate = new Date(Date.UTC(_date.getFullYear(), _date.getMonth(), _date.getDate(), _date.getHours(), _date.getMinutes(), _date.getSeconds(), _date.getMilliseconds()));
+ utcDate.setUTCFullYear(_date.getFullYear());
+ return +date - +utcDate;
+}
+
+// lib/_lib/normalizeDates.js
+function normalizeDates(context) {for (var _len = arguments.length, dates = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {dates[_key - 1] = arguments[_key];}
+ var normalize = _constructFrom.bind(null, context || dates.find(function (date) {return _typeof(date) === "object";}));
+ return dates.map(normalize);
+}
+
+// lib/startOfDay.js
+function _startOfDay(date, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ _date.setHours(0, 0, 0, 0);
+ return _date;
+}
+
+// lib/differenceInCalendarDays.js
+function _differenceInCalendarDays(laterDate, earlierDate, options) {
+ var _normalizeDates = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates2 = _slicedToArray(_normalizeDates, 2),laterDate_ = _normalizeDates2[0],earlierDate_ = _normalizeDates2[1];
+ var laterStartOfDay = _startOfDay(laterDate_);
+ var earlierStartOfDay = _startOfDay(earlierDate_);
+ var laterTimestamp = +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);
+ var earlierTimestamp = +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);
+ return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);
+}
+
+// lib/startOfISOWeekYear.js
+function _startOfISOWeekYear(date, options) {
+ var year = _getISOWeekYear(date, options);
+ var fourthOfJanuary = _constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, 0);
+ fourthOfJanuary.setFullYear(year, 0, 4);
+ fourthOfJanuary.setHours(0, 0, 0, 0);
+ return _startOfISOWeek(fourthOfJanuary);
+}
+
+// lib/setISOWeekYear.js
+function _setISOWeekYear(date, weekYear, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ var diff = _differenceInCalendarDays(_date, _startOfISOWeekYear(_date, options));
+ var fourthOfJanuary = _constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, 0);
+ fourthOfJanuary.setFullYear(weekYear, 0, 4);
+ fourthOfJanuary.setHours(0, 0, 0, 0);
+ _date = _startOfISOWeekYear(fourthOfJanuary);
+ _date.setDate(_date.getDate() + diff);
+ return _date;
+}
+
+// lib/addISOWeekYears.js
+function _addISOWeekYears(date, amount, options) {
+ return _setISOWeekYear(date, _getISOWeekYear(date, options) + amount, options);
+}
+// lib/addMinutes.js
+function _addMinutes(date, amount, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ _date.setTime(_date.getTime() + amount * millisecondsInMinute);
+ return _date;
+}
+// lib/addQuarters.js
+function _addQuarters(date, amount, options) {
+ return _addMonths(date, amount * 3, options);
+}
+// lib/addSeconds.js
+function _addSeconds(date, amount, options) {
+ return _addMilliseconds(date, amount * 1000, options);
+}
+// lib/addWeeks.js
+function _addWeeks(date, amount, options) {
+ return _addDays(date, amount * 7, options);
+}
+// lib/addYears.js
+function _addYears(date, amount, options) {
+ return _addMonths(date, amount * 12, options);
+}
+// lib/areIntervalsOverlapping.js
+function _areIntervalsOverlapping(intervalLeft, intervalRight, options) {
+ var _sort = [
+ +_toDate(intervalLeft.start, options === null || options === void 0 ? void 0 : options.in),
+ +_toDate(intervalLeft.end, options === null || options === void 0 ? void 0 : options.in)].
+ sort(function (a, b) {return a - b;}),_sort2 = _slicedToArray(_sort, 2),leftStartTime = _sort2[0],leftEndTime = _sort2[1];
+ var _sort3 = [
+ +_toDate(intervalRight.start, options === null || options === void 0 ? void 0 : options.in),
+ +_toDate(intervalRight.end, options === null || options === void 0 ? void 0 : options.in)].
+ sort(function (a, b) {return a - b;}),_sort4 = _slicedToArray(_sort3, 2),rightStartTime = _sort4[0],rightEndTime = _sort4[1];
+ if (options !== null && options !== void 0 && options.inclusive)
+ return leftStartTime <= rightEndTime && rightStartTime <= leftEndTime;
+ return leftStartTime < rightEndTime && rightStartTime < leftEndTime;
+}
+// lib/max.js
+function _max(dates, options) {
+ var result;
+ var context = options === null || options === void 0 ? void 0 : options.in;
+ dates.forEach(function (date) {
+ if (!context && _typeof(date) === "object")
+ context = _constructFrom.bind(null, date);
+ var date_ = _toDate(date, context);
+ if (!result || result < date_ || isNaN(+date_))
+ result = date_;
+ });
+ return _constructFrom(context, result || NaN);
+}
+
+// lib/min.js
+function _min(dates, options) {
+ var result;
+ var context = options === null || options === void 0 ? void 0 : options.in;
+ dates.forEach(function (date) {
+ if (!context && _typeof(date) === "object")
+ context = _constructFrom.bind(null, date);
+ var date_ = _toDate(date, context);
+ if (!result || result > date_ || isNaN(+date_))
+ result = date_;
+ });
+ return _constructFrom(context, result || NaN);
+}
+
+// lib/clamp.js
+function _clamp(date, interval, options) {
+ var _normalizeDates3 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, date, interval.start, interval.end),_normalizeDates4 = _slicedToArray(_normalizeDates3, 3),date_ = _normalizeDates4[0],start = _normalizeDates4[1],end = _normalizeDates4[2];
+ return _min([_max([date_, start], options), end], options);
+}
+// lib/closestIndexTo.js
+function _closestIndexTo(dateToCompare, dates) {
+ var timeToCompare = +_toDate(dateToCompare);
+ if (isNaN(timeToCompare))
+ return NaN;
+ var result;
+ var minDistance;
+ dates.forEach(function (date, index) {
+ var date_ = _toDate(date);
+ if (isNaN(+date_)) {
+ result = NaN;
+ minDistance = NaN;
+ return;
+ }
+ var distance = Math.abs(timeToCompare - +date_);
+ if (result == null || distance < minDistance) {
+ result = index;
+ minDistance = distance;
+ }
+ });
+ return result;
+}
+// lib/closestTo.js
+function _closestTo(dateToCompare, dates, options) {
+ var _normalizeDates5 = normalizeDates.apply(void 0, [options === null || options === void 0 ? void 0 : options.in, dateToCompare].concat(_toConsumableArray(dates))),_normalizeDates6 = _toArray(_normalizeDates5),dateToCompare_ = _normalizeDates6[0],dates_ = _normalizeDates6.slice(1);
+ var index = _closestIndexTo(dateToCompare_, dates_);
+ if (typeof index === "number" && isNaN(index))
+ return _constructFrom(dateToCompare_, NaN);
+ if (index !== undefined)
+ return dates_[index];
+}
+// lib/compareAsc.js
+function _compareAsc(dateLeft, dateRight) {
+ var diff = +_toDate(dateLeft) - +_toDate(dateRight);
+ if (diff < 0)
+ return -1;else
+ if (diff > 0)
+ return 1;
+ return diff;
+}
+// lib/compareDesc.js
+function _compareDesc(dateLeft, dateRight) {
+ var diff = +_toDate(dateLeft) - +_toDate(dateRight);
+ if (diff > 0)
+ return -1;else
+ if (diff < 0)
+ return 1;
+ return diff;
+}
+// lib/constructNow.js
+function _constructNow(date) {
+ return _constructFrom(date, Date.now());
+}
+// lib/daysToWeeks.js
+function _daysToWeeks(days) {
+ var result = Math.trunc(days / daysInWeek);
+ return result === 0 ? 0 : result;
+}
+// lib/isSameDay.js
+function _isSameDay(laterDate, earlierDate, options) {
+ var _normalizeDates7 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates8 = _slicedToArray(_normalizeDates7, 2),dateLeft_ = _normalizeDates8[0],dateRight_ = _normalizeDates8[1];
+ return +_startOfDay(dateLeft_) === +_startOfDay(dateRight_);
+}
+
+// lib/isDate.js
+function _isDate(value) {
+ return value instanceof Date || _typeof(value) === "object" && Object.prototype.toString.call(value) === "[object Date]";
+}
+
+// lib/isValid.js
+function _isValid(date) {
+ return !(!_isDate(date) && typeof date !== "number" || isNaN(+_toDate(date)));
+}
+
+// lib/differenceInBusinessDays.js
+function _differenceInBusinessDays(laterDate, earlierDate, options) {
+ var _normalizeDates9 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates10 = _slicedToArray(_normalizeDates9, 2),laterDate_ = _normalizeDates10[0],earlierDate_ = _normalizeDates10[1];
+ if (!_isValid(laterDate_) || !_isValid(earlierDate_))
+ return NaN;
+ var diff = _differenceInCalendarDays(laterDate_, earlierDate_);
+ var sign = diff < 0 ? -1 : 1;
+ var weeks = Math.trunc(diff / 7);
+ var result = weeks * 5;
+ var movingDate = _addDays(earlierDate_, weeks * 7);
+ while (!_isSameDay(laterDate_, movingDate)) {
+ result += _isWeekend(movingDate, options) ? 0 : sign;
+ movingDate = _addDays(movingDate, sign);
+ }
+ return result === 0 ? 0 : result;
+}
+// lib/differenceInCalendarISOWeekYears.js
+function _differenceInCalendarISOWeekYears(laterDate, earlierDate, options) {
+ var _normalizeDates11 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates12 = _slicedToArray(_normalizeDates11, 2),laterDate_ = _normalizeDates12[0],earlierDate_ = _normalizeDates12[1];
+ return _getISOWeekYear(laterDate_, options) - _getISOWeekYear(earlierDate_, options);
+}
+// lib/differenceInCalendarISOWeeks.js
+function _differenceInCalendarISOWeeks(laterDate, earlierDate, options) {
+ var _normalizeDates13 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates14 = _slicedToArray(_normalizeDates13, 2),laterDate_ = _normalizeDates14[0],earlierDate_ = _normalizeDates14[1];
+ var startOfISOWeekLeft = _startOfISOWeek(laterDate_);
+ var startOfISOWeekRight = _startOfISOWeek(earlierDate_);
+ var timestampLeft = +startOfISOWeekLeft - getTimezoneOffsetInMilliseconds(startOfISOWeekLeft);
+ var timestampRight = +startOfISOWeekRight - getTimezoneOffsetInMilliseconds(startOfISOWeekRight);
+ return Math.round((timestampLeft - timestampRight) / millisecondsInWeek);
+}
+// lib/differenceInCalendarMonths.js
+function _differenceInCalendarMonths(laterDate, earlierDate, options) {
+ var _normalizeDates15 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates16 = _slicedToArray(_normalizeDates15, 2),laterDate_ = _normalizeDates16[0],earlierDate_ = _normalizeDates16[1];
+ var yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();
+ var monthsDiff = laterDate_.getMonth() - earlierDate_.getMonth();
+ return yearsDiff * 12 + monthsDiff;
+}
+// lib/getQuarter.js
+function _getQuarter(date, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ var quarter = Math.trunc(_date.getMonth() / 3) + 1;
+ return quarter;
+}
+
+// lib/differenceInCalendarQuarters.js
+function _differenceInCalendarQuarters(laterDate, earlierDate, options) {
+ var _normalizeDates17 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates18 = _slicedToArray(_normalizeDates17, 2),laterDate_ = _normalizeDates18[0],earlierDate_ = _normalizeDates18[1];
+ var yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();
+ var quartersDiff = _getQuarter(laterDate_) - _getQuarter(earlierDate_);
+ return yearsDiff * 4 + quartersDiff;
+}
+// lib/differenceInCalendarWeeks.js
+function _differenceInCalendarWeeks(laterDate, earlierDate, options) {
+ var _normalizeDates19 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates20 = _slicedToArray(_normalizeDates19, 2),laterDate_ = _normalizeDates20[0],earlierDate_ = _normalizeDates20[1];
+ var laterStartOfWeek = _startOfWeek(laterDate_, options);
+ var earlierStartOfWeek = _startOfWeek(earlierDate_, options);
+ var laterTimestamp = +laterStartOfWeek - getTimezoneOffsetInMilliseconds(laterStartOfWeek);
+ var earlierTimestamp = +earlierStartOfWeek - getTimezoneOffsetInMilliseconds(earlierStartOfWeek);
+ return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInWeek);
+}
+// lib/differenceInCalendarYears.js
+function _differenceInCalendarYears(laterDate, earlierDate, options) {
+ var _normalizeDates21 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates22 = _slicedToArray(_normalizeDates21, 2),laterDate_ = _normalizeDates22[0],earlierDate_ = _normalizeDates22[1];
+ return laterDate_.getFullYear() - earlierDate_.getFullYear();
+}
+// lib/differenceInDays.js
+function _differenceInDays(laterDate, earlierDate, options) {
+ var _normalizeDates23 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates24 = _slicedToArray(_normalizeDates23, 2),laterDate_ = _normalizeDates24[0],earlierDate_ = _normalizeDates24[1];
+ var sign = compareLocalAsc(laterDate_, earlierDate_);
+ var difference = Math.abs(_differenceInCalendarDays(laterDate_, earlierDate_));
+ laterDate_.setDate(laterDate_.getDate() - sign * difference);
+ var isLastDayNotFull = Number(compareLocalAsc(laterDate_, earlierDate_) === -sign);
+ var result = sign * (difference - isLastDayNotFull);
+ return result === 0 ? 0 : result;
+}
+function compareLocalAsc(laterDate, earlierDate) {
+ var diff = laterDate.getFullYear() - earlierDate.getFullYear() || laterDate.getMonth() - earlierDate.getMonth() || laterDate.getDate() - earlierDate.getDate() || laterDate.getHours() - earlierDate.getHours() || laterDate.getMinutes() - earlierDate.getMinutes() || laterDate.getSeconds() - earlierDate.getSeconds() || laterDate.getMilliseconds() - earlierDate.getMilliseconds();
+ if (diff < 0)
+ return -1;
+ if (diff > 0)
+ return 1;
+ return diff;
+}
+// lib/_lib/getRoundingMethod.js
+function getRoundingMethod(method) {
+ return function (number) {
+ var round = method ? Math[method] : Math.trunc;
+ var result = round(number);
+ return result === 0 ? 0 : result;
+ };
+}
+
+// lib/differenceInHours.js
+function _differenceInHours(laterDate, earlierDate, options) {
+ var _normalizeDates25 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates26 = _slicedToArray(_normalizeDates25, 2),laterDate_ = _normalizeDates26[0],earlierDate_ = _normalizeDates26[1];
+ var diff = (+laterDate_ - +earlierDate_) / millisecondsInHour;
+ return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
+}
+// lib/subISOWeekYears.js
+function _subISOWeekYears(date, amount, options) {
+ return _addISOWeekYears(date, -amount, options);
+}
+
+// lib/differenceInISOWeekYears.js
+function _differenceInISOWeekYears(laterDate, earlierDate, options) {
+ var _normalizeDates27 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates28 = _slicedToArray(_normalizeDates27, 2),laterDate_ = _normalizeDates28[0],earlierDate_ = _normalizeDates28[1];
+ var sign = _compareAsc(laterDate_, earlierDate_);
+ var diff = Math.abs(_differenceInCalendarISOWeekYears(laterDate_, earlierDate_, options));
+ var adjustedDate = _subISOWeekYears(laterDate_, sign * diff, options);
+ var isLastISOWeekYearNotFull = Number(_compareAsc(adjustedDate, earlierDate_) === -sign);
+ var result = sign * (diff - isLastISOWeekYearNotFull);
+ return result === 0 ? 0 : result;
+}
+// lib/differenceInMilliseconds.js
+function _differenceInMilliseconds(laterDate, earlierDate) {
+ return +_toDate(laterDate) - +_toDate(earlierDate);
+}
+// lib/differenceInMinutes.js
+function _differenceInMinutes(dateLeft, dateRight, options) {
+ var diff = _differenceInMilliseconds(dateLeft, dateRight) / millisecondsInMinute;
+ return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
+}
+// lib/endOfDay.js
+function _endOfDay(date, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ _date.setHours(23, 59, 59, 999);
+ return _date;
+}
+
+// lib/endOfMonth.js
+function _endOfMonth(date, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ var month = _date.getMonth();
+ _date.setFullYear(_date.getFullYear(), month + 1, 0);
+ _date.setHours(23, 59, 59, 999);
+ return _date;
+}
+
+// lib/isLastDayOfMonth.js
+function _isLastDayOfMonth(date, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ return +_endOfDay(_date, options) === +_endOfMonth(_date, options);
+}
+
+// lib/differenceInMonths.js
+function _differenceInMonths(laterDate, earlierDate, options) {
+ var _normalizeDates29 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, laterDate, earlierDate),_normalizeDates30 = _slicedToArray(_normalizeDates29, 3),laterDate_ = _normalizeDates30[0],workingLaterDate = _normalizeDates30[1],earlierDate_ = _normalizeDates30[2];
+ var sign = _compareAsc(workingLaterDate, earlierDate_);
+ var difference = Math.abs(_differenceInCalendarMonths(workingLaterDate, earlierDate_));
+ if (difference < 1)
+ return 0;
+ if (workingLaterDate.getMonth() === 1 && workingLaterDate.getDate() > 27)
+ workingLaterDate.setDate(30);
+ workingLaterDate.setMonth(workingLaterDate.getMonth() - sign * difference);
+ var isLastMonthNotFull = _compareAsc(workingLaterDate, earlierDate_) === -sign;
+ if (_isLastDayOfMonth(laterDate_) && difference === 1 && _compareAsc(laterDate_, earlierDate_) === 1) {
+ isLastMonthNotFull = false;
+ }
+ var result = sign * (difference - +isLastMonthNotFull);
+ return result === 0 ? 0 : result;
+}
+// lib/differenceInQuarters.js
+function _differenceInQuarters(laterDate, earlierDate, options) {
+ var diff = _differenceInMonths(laterDate, earlierDate, options) / 3;
+ return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
+}
+// lib/differenceInSeconds.js
+function _differenceInSeconds(laterDate, earlierDate, options) {
+ var diff = _differenceInMilliseconds(laterDate, earlierDate) / 1000;
+ return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
+}
+// lib/differenceInWeeks.js
+function _differenceInWeeks(laterDate, earlierDate, options) {
+ var diff = _differenceInDays(laterDate, earlierDate, options) / 7;
+ return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
+}
+// lib/differenceInYears.js
+function _differenceInYears(laterDate, earlierDate, options) {
+ var _normalizeDates31 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates32 = _slicedToArray(_normalizeDates31, 2),laterDate_ = _normalizeDates32[0],earlierDate_ = _normalizeDates32[1];
+ var sign = _compareAsc(laterDate_, earlierDate_);
+ var diff = Math.abs(_differenceInCalendarYears(laterDate_, earlierDate_));
+ laterDate_.setFullYear(1584);
+ earlierDate_.setFullYear(1584);
+ var partial = _compareAsc(laterDate_, earlierDate_) === -sign;
+ var result = sign * (diff - +partial);
+ return result === 0 ? 0 : result;
+}
+// lib/_lib/normalizeInterval.js
+function normalizeInterval(context, interval) {
+ var _normalizeDates33 = normalizeDates(context, interval.start, interval.end),_normalizeDates34 = _slicedToArray(_normalizeDates33, 2),start = _normalizeDates34[0],end = _normalizeDates34[1];
+ return { start: start, end: end };
+}
+
+// lib/eachDayOfInterval.js
+function _eachDayOfInterval(interval, options) {var _options$step;
+ var _normalizeInterval = normalizeInterval(options === null || options === void 0 ? void 0 : options.in, interval),start = _normalizeInterval.start,end = _normalizeInterval.end;
+ var reversed = +start > +end;
+ var endTime = reversed ? +start : +end;
+ var date = reversed ? end : start;
+ date.setHours(0, 0, 0, 0);
+ var step = (_options$step = options === null || options === void 0 ? void 0 : options.step) !== null && _options$step !== void 0 ? _options$step : 1;
+ if (!step)
+ return [];
+ if (step < 0) {
+ step = -step;
+ reversed = !reversed;
+ }
+ var dates = [];
+ while (+date <= endTime) {
+ dates.push(_constructFrom(start, date));
+ date.setDate(date.getDate() + step);
+ date.setHours(0, 0, 0, 0);
+ }
+ return reversed ? dates.reverse() : dates;
+}
+// lib/eachHourOfInterval.js
+function _eachHourOfInterval(interval, options) {var _options$step2;
+ var _normalizeInterval2 = normalizeInterval(options === null || options === void 0 ? void 0 : options.in, interval),start = _normalizeInterval2.start,end = _normalizeInterval2.end;
+ var reversed = +start > +end;
+ var endTime = reversed ? +start : +end;
+ var date = reversed ? end : start;
+ date.setMinutes(0, 0, 0);
+ var step = (_options$step2 = options === null || options === void 0 ? void 0 : options.step) !== null && _options$step2 !== void 0 ? _options$step2 : 1;
+ if (!step)
+ return [];
+ if (step < 0) {
+ step = -step;
+ reversed = !reversed;
+ }
+ var dates = [];
+ while (+date <= endTime) {
+ dates.push(_constructFrom(start, date));
+ date.setHours(date.getHours() + step);
+ }
+ return reversed ? dates.reverse() : dates;
+}
+// lib/eachMinuteOfInterval.js
+function _eachMinuteOfInterval(interval, options) {var _options$step3;
+ var _normalizeInterval3 = normalizeInterval(options === null || options === void 0 ? void 0 : options.in, interval),start = _normalizeInterval3.start,end = _normalizeInterval3.end;
+ start.setSeconds(0, 0);
+ var reversed = +start > +end;
+ var endTime = reversed ? +start : +end;
+ var date = reversed ? end : start;
+ var step = (_options$step3 = options === null || options === void 0 ? void 0 : options.step) !== null && _options$step3 !== void 0 ? _options$step3 : 1;
+ if (!step)
+ return [];
+ if (step < 0) {
+ step = -step;
+ reversed = !reversed;
+ }
+ var dates = [];
+ while (+date <= endTime) {
+ dates.push(_constructFrom(start, date));
+ date = _addMinutes(date, step);
+ }
+ return reversed ? dates.reverse() : dates;
+}
+// lib/eachMonthOfInterval.js
+function _eachMonthOfInterval(interval, options) {var _options$step4;
+ var _normalizeInterval4 = normalizeInterval(options === null || options === void 0 ? void 0 : options.in, interval),start = _normalizeInterval4.start,end = _normalizeInterval4.end;
+ var reversed = +start > +end;
+ var endTime = reversed ? +start : +end;
+ var date = reversed ? end : start;
+ date.setHours(0, 0, 0, 0);
+ date.setDate(1);
+ var step = (_options$step4 = options === null || options === void 0 ? void 0 : options.step) !== null && _options$step4 !== void 0 ? _options$step4 : 1;
+ if (!step)
+ return [];
+ if (step < 0) {
+ step = -step;
+ reversed = !reversed;
+ }
+ var dates = [];
+ while (+date <= endTime) {
+ dates.push(_constructFrom(start, date));
+ date.setMonth(date.getMonth() + step);
+ }
+ return reversed ? dates.reverse() : dates;
+}
+// lib/startOfQuarter.js
+function _startOfQuarter(date, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ var currentMonth = _date.getMonth();
+ var month = currentMonth - currentMonth % 3;
+ _date.setMonth(month, 1);
+ _date.setHours(0, 0, 0, 0);
+ return _date;
+}
+
+// lib/eachQuarterOfInterval.js
+function _eachQuarterOfInterval(interval, options) {var _options$step5;
+ var _normalizeInterval5 = normalizeInterval(options === null || options === void 0 ? void 0 : options.in, interval),start = _normalizeInterval5.start,end = _normalizeInterval5.end;
+ var reversed = +start > +end;
+ var endTime = reversed ? +_startOfQuarter(start) : +_startOfQuarter(end);
+ var date = reversed ? _startOfQuarter(end) : _startOfQuarter(start);
+ var step = (_options$step5 = options === null || options === void 0 ? void 0 : options.step) !== null && _options$step5 !== void 0 ? _options$step5 : 1;
+ if (!step)
+ return [];
+ if (step < 0) {
+ step = -step;
+ reversed = !reversed;
+ }
+ var dates = [];
+ while (+date <= endTime) {
+ dates.push(_constructFrom(start, date));
+ date = _addQuarters(date, step);
+ }
+ return reversed ? dates.reverse() : dates;
+}
+// lib/eachWeekOfInterval.js
+function _eachWeekOfInterval(interval, options) {var _options$step6;
+ var _normalizeInterval6 = normalizeInterval(options === null || options === void 0 ? void 0 : options.in, interval),start = _normalizeInterval6.start,end = _normalizeInterval6.end;
+ var reversed = +start > +end;
+ var startDateWeek = reversed ? _startOfWeek(end, options) : _startOfWeek(start, options);
+ var endDateWeek = reversed ? _startOfWeek(start, options) : _startOfWeek(end, options);
+ startDateWeek.setHours(15);
+ endDateWeek.setHours(15);
+ var endTime = +endDateWeek.getTime();
+ var currentDate = startDateWeek;
+ var step = (_options$step6 = options === null || options === void 0 ? void 0 : options.step) !== null && _options$step6 !== void 0 ? _options$step6 : 1;
+ if (!step)
+ return [];
+ if (step < 0) {
+ step = -step;
+ reversed = !reversed;
+ }
+ var dates = [];
+ while (+currentDate <= endTime) {
+ currentDate.setHours(0);
+ dates.push(_constructFrom(start, currentDate));
+ currentDate = _addWeeks(currentDate, step);
+ currentDate.setHours(15);
+ }
+ return reversed ? dates.reverse() : dates;
+}
+// lib/eachWeekendOfInterval.js
+function _eachWeekendOfInterval(interval, options) {
+ var _normalizeInterval7 = normalizeInterval(options === null || options === void 0 ? void 0 : options.in, interval),start = _normalizeInterval7.start,end = _normalizeInterval7.end;
+ var dateInterval = _eachDayOfInterval({ start: start, end: end }, options);
+ var weekends = [];
+ var index = 0;
+ while (index < dateInterval.length) {
+ var date = dateInterval[index++];
+ if (_isWeekend(date))
+ weekends.push(_constructFrom(start, date));
+ }
+ return weekends;
+}
+// lib/startOfMonth.js
+function _startOfMonth(date, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ _date.setDate(1);
+ _date.setHours(0, 0, 0, 0);
+ return _date;
+}
+
+// lib/eachWeekendOfMonth.js
+function _eachWeekendOfMonth(date, options) {
+ var start = _startOfMonth(date, options);
+ var end = _endOfMonth(date, options);
+ return _eachWeekendOfInterval({ start: start, end: end }, options);
+}
+// lib/endOfYear.js
+function _endOfYear(date, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ var year = _date.getFullYear();
+ _date.setFullYear(year + 1, 0, 0);
+ _date.setHours(23, 59, 59, 999);
+ return _date;
+}
+
+// lib/startOfYear.js
+function _startOfYear(date, options) {
+ var date_ = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ date_.setFullYear(date_.getFullYear(), 0, 1);
+ date_.setHours(0, 0, 0, 0);
+ return date_;
+}
+
+// lib/eachWeekendOfYear.js
+function _eachWeekendOfYear(date, options) {
+ var start = _startOfYear(date, options);
+ var end = _endOfYear(date, options);
+ return _eachWeekendOfInterval({ start: start, end: end }, options);
+}
+// lib/eachYearOfInterval.js
+function _eachYearOfInterval(interval, options) {var _options$step7;
+ var _normalizeInterval8 = normalizeInterval(options === null || options === void 0 ? void 0 : options.in, interval),start = _normalizeInterval8.start,end = _normalizeInterval8.end;
+ var reversed = +start > +end;
+ var endTime = reversed ? +start : +end;
+ var date = reversed ? end : start;
+ date.setHours(0, 0, 0, 0);
+ date.setMonth(0, 1);
+ var step = (_options$step7 = options === null || options === void 0 ? void 0 : options.step) !== null && _options$step7 !== void 0 ? _options$step7 : 1;
+ if (!step)
+ return [];
+ if (step < 0) {
+ step = -step;
+ reversed = !reversed;
+ }
+ var dates = [];
+ while (+date <= endTime) {
+ dates.push(_constructFrom(start, date));
+ date.setFullYear(date.getFullYear() + step);
+ }
+ return reversed ? dates.reverse() : dates;
+}
+// lib/endOfDecade.js
+function _endOfDecade(date, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ var year = _date.getFullYear();
+ var decade = 9 + Math.floor(year / 10) * 10;
+ _date.setFullYear(decade, 11, 31);
+ _date.setHours(23, 59, 59, 999);
+ return _date;
+}
+// lib/endOfHour.js
+function _endOfHour(date, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ _date.setMinutes(59, 59, 999);
+ return _date;
+}
+// lib/endOfWeek.js
+function _endOfWeek(date, options) {var _ref4, _ref5, _ref6, _options$weekStartsOn2, _options$locale2, _defaultOptions4$loca;
+ var defaultOptions4 = getDefaultOptions();
+ var weekStartsOn = (_ref4 = (_ref5 = (_ref6 = (_options$weekStartsOn2 = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn2 !== void 0 ? _options$weekStartsOn2 : options === null || options === void 0 || (_options$locale2 = options.locale) === null || _options$locale2 === void 0 || (_options$locale2 = _options$locale2.options) === null || _options$locale2 === void 0 ? void 0 : _options$locale2.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : defaultOptions4.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : (_defaultOptions4$loca = defaultOptions4.locale) === null || _defaultOptions4$loca === void 0 || (_defaultOptions4$loca = _defaultOptions4$loca.options) === null || _defaultOptions4$loca === void 0 ? void 0 : _defaultOptions4$loca.weekStartsOn) !== null && _ref4 !== void 0 ? _ref4 : 0;
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ var day = _date.getDay();
+ var diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn);
+ _date.setDate(_date.getDate() + diff);
+ _date.setHours(23, 59, 59, 999);
+ return _date;
+}
+
+// lib/endOfISOWeek.js
+function _endOfISOWeek(date, options) {
+ return _endOfWeek(date, _objectSpread(_objectSpread({}, options), {}, { weekStartsOn: 1 }));
+}
+// lib/endOfISOWeekYear.js
+function _endOfISOWeekYear(date, options) {
+ var year = _getISOWeekYear(date, options);
+ var fourthOfJanuaryOfNextYear = _constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, 0);
+ fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
+ fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
+ var _date = _startOfISOWeek(fourthOfJanuaryOfNextYear, options);
+ _date.setMilliseconds(_date.getMilliseconds() - 1);
+ return _date;
+}
+// lib/endOfMinute.js
+function _endOfMinute(date, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ _date.setSeconds(59, 999);
+ return _date;
+}
+// lib/endOfQuarter.js
+function _endOfQuarter(date, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ var currentMonth = _date.getMonth();
+ var month = currentMonth - currentMonth % 3 + 3;
+ _date.setMonth(month, 0);
+ _date.setHours(23, 59, 59, 999);
+ return _date;
+}
+// lib/endOfSecond.js
+function _endOfSecond(date, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ _date.setMilliseconds(999);
+ return _date;
+}
+// lib/endOfToday.js
+function _endOfToday(options) {
+ return _endOfDay(Date.now(), options);
+}
+// lib/endOfTomorrow.js
+function _endOfTomorrow(options) {
+ var now = _constructNow(options === null || options === void 0 ? void 0 : options.in);
+ var year = now.getFullYear();
+ var month = now.getMonth();
+ var day = now.getDate();
+ var date = _constructNow(options === null || options === void 0 ? void 0 : options.in);
+ date.setFullYear(year, month, day + 1);
+ date.setHours(23, 59, 59, 999);
+ return options !== null && options !== void 0 && options.in ? options.in(date) : date;
+}
+// lib/endOfYesterday.js
+function _endOfYesterday(options) {
+ var now = _constructNow(options === null || options === void 0 ? void 0 : options.in);
+ var date = _constructFrom(options === null || options === void 0 ? void 0 : options.in, 0);
+ date.setFullYear(now.getFullYear(), now.getMonth(), now.getDate() - 1);
+ date.setHours(23, 59, 59, 999);
+ return date;
+}
+// lib/locale/en-US/_lib/formatDistance.js
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: "less than a second",
+ other: "less than {{count}} seconds"
+ },
+ xSeconds: {
+ one: "1 second",
+ other: "{{count}} seconds"
+ },
+ halfAMinute: "half a minute",
+ lessThanXMinutes: {
+ one: "less than a minute",
+ other: "less than {{count}} minutes"
+ },
+ xMinutes: {
+ one: "1 minute",
+ other: "{{count}} minutes"
+ },
+ aboutXHours: {
+ one: "about 1 hour",
+ other: "about {{count}} hours"
+ },
+ xHours: {
+ one: "1 hour",
+ other: "{{count}} hours"
+ },
+ xDays: {
+ one: "1 day",
+ other: "{{count}} days"
+ },
+ aboutXWeeks: {
+ one: "about 1 week",
+ other: "about {{count}} weeks"
+ },
+ xWeeks: {
+ one: "1 week",
+ other: "{{count}} weeks"
+ },
+ aboutXMonths: {
+ one: "about 1 month",
+ other: "about {{count}} months"
+ },
+ xMonths: {
+ one: "1 month",
+ other: "{{count}} months"
+ },
+ aboutXYears: {
+ one: "about 1 year",
+ other: "about {{count}} years"
+ },
+ xYears: {
+ one: "1 year",
+ other: "{{count}} years"
+ },
+ overXYears: {
+ one: "over 1 year",
+ other: "over {{count}} years"
+ },
+ almostXYears: {
+ one: "almost 1 year",
+ other: "almost {{count}} years"
+ }
+};
+var formatDistance = function formatDistance(token, count, options) {
+ var result;
+ var tokenValue = formatDistanceLocale[token];
+ if (typeof tokenValue === "string") {
+ result = tokenValue;
+ } else if (count === 1) {
+ result = tokenValue.one;
+ } else {
+ result = tokenValue.other.replace("{{count}}", count.toString());
+ }
+ if (options !== null && options !== void 0 && options.addSuffix) {
+ if (options.comparison && options.comparison > 0) {
+ return "in " + result;
+ } else {
+ return result + " ago";
+ }
+ }
+ return result;
+};
+
+// lib/locale/_lib/buildFormatLongFn.js
+function buildFormatLongFn(args) {
+ return function () {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+ var width = options.width ? String(options.width) : args.defaultWidth;
+ var format = args.formats[width] || args.formats[args.defaultWidth];
+ return format;
+ };
+}
+
+// lib/locale/en-US/_lib/formatLong.js
+var dateFormats = {
+ full: "EEEE, MMMM do, y",
+ long: "MMMM do, y",
+ medium: "MMM d, y",
+ short: "MM/dd/yyyy"
+};
+var timeFormats = {
+ full: "h:mm:ss a zzzz",
+ long: "h:mm:ss a z",
+ medium: "h:mm:ss a",
+ short: "h:mm a"
+};
+var dateTimeFormats = {
+ full: "{{date}} 'at' {{time}}",
+ long: "{{date}} 'at' {{time}}",
+ medium: "{{date}}, {{time}}",
+ short: "{{date}}, {{time}}"
+};
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: "full"
+ }),
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: "full"
+ }),
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: "full"
+ })
+};
+
+// lib/locale/en-US/_lib/formatRelative.js
+var formatRelativeLocale = {
+ lastWeek: "'last' eeee 'at' p",
+ yesterday: "'yesterday at' p",
+ today: "'today at' p",
+ tomorrow: "'tomorrow at' p",
+ nextWeek: "eeee 'at' p",
+ other: "P"
+};
+var formatRelative = function formatRelative(token, _date, _baseDate, _options) {return formatRelativeLocale[token];};
+
+// lib/locale/_lib/buildLocalizeFn.js
+function buildLocalizeFn(args) {
+ return function (value, options) {
+ var context = options !== null && options !== void 0 && options.context ? String(options.context) : "standalone";
+ var valuesArray;
+ if (context === "formatting" && args.formattingValues) {
+ var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
+ var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
+ valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
+ } else {
+ var _defaultWidth = args.defaultWidth;
+ var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
+ valuesArray = args.values[_width] || args.values[_defaultWidth];
+ }
+ var index = args.argumentCallback ? args.argumentCallback(value) : value;
+ return valuesArray[index];
+ };
+}
+
+// lib/locale/en-US/_lib/localize.js
+var eraValues = {
+ narrow: ["B", "A"],
+ abbreviated: ["BC", "AD"],
+ wide: ["Before Christ", "Anno Domini"]
+};
+var quarterValues = {
+ narrow: ["1", "2", "3", "4"],
+ abbreviated: ["Q1", "Q2", "Q3", "Q4"],
+ wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
+};
+var monthValues = {
+ narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
+ abbreviated: [
+ "Jan",
+ "Feb",
+ "Mar",
+ "Apr",
+ "May",
+ "Jun",
+ "Jul",
+ "Aug",
+ "Sep",
+ "Oct",
+ "Nov",
+ "Dec"],
+
+ wide: [
+ "January",
+ "February",
+ "March",
+ "April",
+ "May",
+ "June",
+ "July",
+ "August",
+ "September",
+ "October",
+ "November",
+ "December"]
+
+};
+var dayValues = {
+ narrow: ["S", "M", "T", "W", "T", "F", "S"],
+ short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
+ abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
+ wide: [
+ "Sunday",
+ "Monday",
+ "Tuesday",
+ "Wednesday",
+ "Thursday",
+ "Friday",
+ "Saturday"]
+
+};
+var dayPeriodValues = {
+ narrow: {
+ am: "a",
+ pm: "p",
+ midnight: "mi",
+ noon: "n",
+ morning: "morning",
+ afternoon: "afternoon",
+ evening: "evening",
+ night: "night"
+ },
+ abbreviated: {
+ am: "AM",
+ pm: "PM",
+ midnight: "midnight",
+ noon: "noon",
+ morning: "morning",
+ afternoon: "afternoon",
+ evening: "evening",
+ night: "night"
+ },
+ wide: {
+ am: "a.m.",
+ pm: "p.m.",
+ midnight: "midnight",
+ noon: "noon",
+ morning: "morning",
+ afternoon: "afternoon",
+ evening: "evening",
+ night: "night"
+ }
+};
+var formattingDayPeriodValues = {
+ narrow: {
+ am: "a",
+ pm: "p",
+ midnight: "mi",
+ noon: "n",
+ morning: "in the morning",
+ afternoon: "in the afternoon",
+ evening: "in the evening",
+ night: "at night"
+ },
+ abbreviated: {
+ am: "AM",
+ pm: "PM",
+ midnight: "midnight",
+ noon: "noon",
+ morning: "in the morning",
+ afternoon: "in the afternoon",
+ evening: "in the evening",
+ night: "at night"
+ },
+ wide: {
+ am: "a.m.",
+ pm: "p.m.",
+ midnight: "midnight",
+ noon: "noon",
+ morning: "in the morning",
+ afternoon: "in the afternoon",
+ evening: "in the evening",
+ night: "at night"
+ }
+};
+var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
+ var number = Number(dirtyNumber);
+ var rem100 = number % 100;
+ if (rem100 > 20 || rem100 < 10) {
+ switch (rem100 % 10) {
+ case 1:
+ return number + "st";
+ case 2:
+ return number + "nd";
+ case 3:
+ return number + "rd";
+ }
+ }
+ return number + "th";
+};
+var localize = {
+ ordinalNumber: ordinalNumber,
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: "wide"
+ }),
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: "wide",
+ argumentCallback: function argumentCallback(quarter) {return quarter - 1;}
+ }),
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: "wide"
+ }),
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: "wide"
+ }),
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: "wide",
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: "wide"
+ })
+};
+
+// lib/locale/_lib/buildMatchFn.js
+function buildMatchFn(args) {
+ return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+ var width = options.width;
+ var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
+ var matchResult = string.match(matchPattern);
+ if (!matchResult) {
+ return null;
+ }
+ var matchedString = matchResult[0];
+ var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
+ var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {return pattern.test(matchedString);}) : findKey(parsePatterns, function (pattern) {return pattern.test(matchedString);});
+ var value;
+ value = args.valueCallback ? args.valueCallback(key) : key;
+ value = options.valueCallback ? options.valueCallback(value) : value;
+ var rest = string.slice(matchedString.length);
+ return { value: value, rest: rest };
+ };
+}
+function findKey(object, predicate) {
+ for (var key in object) {
+ if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
+ return key;
+ }
+ }
+ return;
+}
+function findIndex(array, predicate) {
+ for (var key = 0; key < array.length; key++) {
+ if (predicate(array[key])) {
+ return key;
+ }
+ }
+ return;
+}
+
+// lib/locale/_lib/buildMatchPatternFn.js
+function buildMatchPatternFn(args) {
+ return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+ var matchResult = string.match(args.matchPattern);
+ if (!matchResult)
+ return null;
+ var matchedString = matchResult[0];
+ var parseResult = string.match(args.parsePattern);
+ if (!parseResult)
+ return null;
+ var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
+ value = options.valueCallback ? options.valueCallback(value) : value;
+ var rest = string.slice(matchedString.length);
+ return { value: value, rest: rest };
+ };
+}
+
+// lib/locale/en-US/_lib/match.js
+var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
+var parseOrdinalNumberPattern = /\d+/i;
+var matchEraPatterns = {
+ narrow: /^(b|a)/i,
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
+ wide: /^(before christ|before common era|anno domini|common era)/i
+};
+var parseEraPatterns = {
+ any: [/^b/i, /^(a|c)/i]
+};
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^q[1234]/i,
+ wide: /^[1234](th|st|nd|rd)? quarter/i
+};
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+};
+var matchMonthPatterns = {
+ narrow: /^[jfmasond]/i,
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
+};
+var parseMonthPatterns = {
+ narrow: [
+ /^j/i,
+ /^f/i,
+ /^m/i,
+ /^a/i,
+ /^m/i,
+ /^j/i,
+ /^j/i,
+ /^a/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i],
+
+ any: [
+ /^ja/i,
+ /^f/i,
+ /^mar/i,
+ /^ap/i,
+ /^may/i,
+ /^jun/i,
+ /^jul/i,
+ /^au/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i]
+
+};
+var matchDayPatterns = {
+ narrow: /^[smtwf]/i,
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
+};
+var parseDayPatterns = {
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
+};
+var matchDayPeriodPatterns = {
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
+};
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^a/i,
+ pm: /^p/i,
+ midnight: /^mi/i,
+ noon: /^no/i,
+ morning: /morning/i,
+ afternoon: /afternoon/i,
+ evening: /evening/i,
+ night: /night/i
+ }
+};
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function valueCallback(value) {return parseInt(value, 10);}
+ }),
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: "wide",
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: "any"
+ }),
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: "wide",
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: "any",
+ valueCallback: function valueCallback(index) {return index + 1;}
+ }),
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: "wide",
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: "any"
+ }),
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: "wide",
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: "any"
+ }),
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: "any",
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: "any"
+ })
+};
+
+// lib/locale/en-US.js
+var enUS = {
+ code: "en-US",
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 0,
+ firstWeekContainsDate: 1
+ }
+};
+// lib/getDayOfYear.js
+function _getDayOfYear(date, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ var diff = _differenceInCalendarDays(_date, _startOfYear(_date));
+ var dayOfYear = diff + 1;
+ return dayOfYear;
+}
+
+// lib/getISOWeek.js
+function _getISOWeek(date, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ var diff = +_startOfISOWeek(_date) - +_startOfISOWeekYear(_date);
+ return Math.round(diff / millisecondsInWeek) + 1;
+}
+
+// lib/getWeekYear.js
+function _getWeekYear(date, options) {var _ref7, _ref8, _ref9, _options$firstWeekCon, _options$locale3, _defaultOptions5$loca;
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ var year = _date.getFullYear();
+ var defaultOptions5 = getDefaultOptions();
+ var firstWeekContainsDate = (_ref7 = (_ref8 = (_ref9 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 || (_options$locale3 = options.locale) === null || _options$locale3 === void 0 || (_options$locale3 = _options$locale3.options) === null || _options$locale3 === void 0 ? void 0 : _options$locale3.firstWeekContainsDate) !== null && _ref9 !== void 0 ? _ref9 : defaultOptions5.firstWeekContainsDate) !== null && _ref8 !== void 0 ? _ref8 : (_defaultOptions5$loca = defaultOptions5.locale) === null || _defaultOptions5$loca === void 0 || (_defaultOptions5$loca = _defaultOptions5$loca.options) === null || _defaultOptions5$loca === void 0 ? void 0 : _defaultOptions5$loca.firstWeekContainsDate) !== null && _ref7 !== void 0 ? _ref7 : 1;
+ var firstWeekOfNextYear = _constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, 0);
+ firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
+ firstWeekOfNextYear.setHours(0, 0, 0, 0);
+ var startOfNextYear = _startOfWeek(firstWeekOfNextYear, options);
+ var firstWeekOfThisYear = _constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, 0);
+ firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
+ firstWeekOfThisYear.setHours(0, 0, 0, 0);
+ var startOfThisYear = _startOfWeek(firstWeekOfThisYear, options);
+ if (+_date >= +startOfNextYear) {
+ return year + 1;
+ } else if (+_date >= +startOfThisYear) {
+ return year;
+ } else {
+ return year - 1;
+ }
+}
+
+// lib/startOfWeekYear.js
+function _startOfWeekYear(date, options) {var _ref10, _ref11, _ref12, _options$firstWeekCon2, _options$locale4, _defaultOptions6$loca;
+ var defaultOptions6 = getDefaultOptions();
+ var firstWeekContainsDate = (_ref10 = (_ref11 = (_ref12 = (_options$firstWeekCon2 = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon2 !== void 0 ? _options$firstWeekCon2 : options === null || options === void 0 || (_options$locale4 = options.locale) === null || _options$locale4 === void 0 || (_options$locale4 = _options$locale4.options) === null || _options$locale4 === void 0 ? void 0 : _options$locale4.firstWeekContainsDate) !== null && _ref12 !== void 0 ? _ref12 : defaultOptions6.firstWeekContainsDate) !== null && _ref11 !== void 0 ? _ref11 : (_defaultOptions6$loca = defaultOptions6.locale) === null || _defaultOptions6$loca === void 0 || (_defaultOptions6$loca = _defaultOptions6$loca.options) === null || _defaultOptions6$loca === void 0 ? void 0 : _defaultOptions6$loca.firstWeekContainsDate) !== null && _ref10 !== void 0 ? _ref10 : 1;
+ var year = _getWeekYear(date, options);
+ var firstWeek = _constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, 0);
+ firstWeek.setFullYear(year, 0, firstWeekContainsDate);
+ firstWeek.setHours(0, 0, 0, 0);
+ var _date = _startOfWeek(firstWeek, options);
+ return _date;
+}
+
+// lib/getWeek.js
+function _getWeek(date, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ var diff = +_startOfWeek(_date, options) - +_startOfWeekYear(_date, options);
+ return Math.round(diff / millisecondsInWeek) + 1;
+}
+
+// lib/_lib/addLeadingZeros.js
+function addLeadingZeros(number, targetLength) {
+ var sign = number < 0 ? "-" : "";
+ var output = Math.abs(number).toString().padStart(targetLength, "0");
+ return sign + output;
+}
+
+// lib/_lib/format/lightFormatters.js
+var _lightFormatters = {
+ y: function y(date, token) {
+ var signedYear = date.getFullYear();
+ var year = signedYear > 0 ? signedYear : 1 - signedYear;
+ return addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
+ },
+ M: function M(date, token) {
+ var month = date.getMonth();
+ return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2);
+ },
+ d: function d(date, token) {
+ return addLeadingZeros(date.getDate(), token.length);
+ },
+ a: function a(date, token) {
+ var dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
+ switch (token) {
+ case "a":
+ case "aa":
+ return dayPeriodEnumValue.toUpperCase();
+ case "aaa":
+ return dayPeriodEnumValue;
+ case "aaaaa":
+ return dayPeriodEnumValue[0];
+ case "aaaa":
+ default:
+ return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
+ }
+ },
+ h: function h(date, token) {
+ return addLeadingZeros(date.getHours() % 12 || 12, token.length);
+ },
+ H: function H(date, token) {
+ return addLeadingZeros(date.getHours(), token.length);
+ },
+ m: function m(date, token) {
+ return addLeadingZeros(date.getMinutes(), token.length);
+ },
+ s: function s(date, token) {
+ return addLeadingZeros(date.getSeconds(), token.length);
+ },
+ S: function S(date, token) {
+ var numberOfDigits = token.length;
+ var milliseconds = date.getMilliseconds();
+ var fractionalSeconds = Math.trunc(milliseconds * Math.pow(10, numberOfDigits - 3));
+ return addLeadingZeros(fractionalSeconds, token.length);
+ }
+};
+
+// lib/_lib/format/formatters.js
+function formatTimezoneShort(offset) {var delimiter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
+ var sign = offset > 0 ? "-" : "+";
+ var absOffset = Math.abs(offset);
+ var hours = Math.trunc(absOffset / 60);
+ var minutes = absOffset % 60;
+ if (minutes === 0) {
+ return sign + String(hours);
+ }
+ return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
+}
+function formatTimezoneWithOptionalMinutes(offset, delimiter) {
+ if (offset % 60 === 0) {
+ var sign = offset > 0 ? "-" : "+";
+ return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
+ }
+ return formatTimezone(offset, delimiter);
+}
+function formatTimezone(offset) {var delimiter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
+ var sign = offset > 0 ? "-" : "+";
+ var absOffset = Math.abs(offset);
+ var hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);
+ var minutes = addLeadingZeros(absOffset % 60, 2);
+ return sign + hours + delimiter + minutes;
+}
+var dayPeriodEnum = {
+ am: "am",
+ pm: "pm",
+ midnight: "midnight",
+ noon: "noon",
+ morning: "morning",
+ afternoon: "afternoon",
+ evening: "evening",
+ night: "night"
+};
+var _formatters = {
+ G: function G(date, token, localize3) {
+ var era = date.getFullYear() > 0 ? 1 : 0;
+ switch (token) {
+ case "G":
+ case "GG":
+ case "GGG":
+ return localize3.era(era, { width: "abbreviated" });
+ case "GGGGG":
+ return localize3.era(era, { width: "narrow" });
+ case "GGGG":
+ default:
+ return localize3.era(era, { width: "wide" });
+ }
+ },
+ y: function y(date, token, localize3) {
+ if (token === "yo") {
+ var signedYear = date.getFullYear();
+ var year = signedYear > 0 ? signedYear : 1 - signedYear;
+ return localize3.ordinalNumber(year, { unit: "year" });
+ }
+ return _lightFormatters.y(date, token);
+ },
+ Y: function Y(date, token, localize3, options) {
+ var signedWeekYear = _getWeekYear(date, options);
+ var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
+ if (token === "YY") {
+ var twoDigitYear = weekYear % 100;
+ return addLeadingZeros(twoDigitYear, 2);
+ }
+ if (token === "Yo") {
+ return localize3.ordinalNumber(weekYear, { unit: "year" });
+ }
+ return addLeadingZeros(weekYear, token.length);
+ },
+ R: function R(date, token) {
+ var isoWeekYear = _getISOWeekYear(date);
+ return addLeadingZeros(isoWeekYear, token.length);
+ },
+ u: function u(date, token) {
+ var year = date.getFullYear();
+ return addLeadingZeros(year, token.length);
+ },
+ Q: function Q(date, token, localize3) {
+ var quarter = Math.ceil((date.getMonth() + 1) / 3);
+ switch (token) {
+ case "Q":
+ return String(quarter);
+ case "QQ":
+ return addLeadingZeros(quarter, 2);
+ case "Qo":
+ return localize3.ordinalNumber(quarter, { unit: "quarter" });
+ case "QQQ":
+ return localize3.quarter(quarter, {
+ width: "abbreviated",
+ context: "formatting"
+ });
+ case "QQQQQ":
+ return localize3.quarter(quarter, {
+ width: "narrow",
+ context: "formatting"
+ });
+ case "QQQQ":
+ default:
+ return localize3.quarter(quarter, {
+ width: "wide",
+ context: "formatting"
+ });
+ }
+ },
+ q: function q(date, token, localize3) {
+ var quarter = Math.ceil((date.getMonth() + 1) / 3);
+ switch (token) {
+ case "q":
+ return String(quarter);
+ case "qq":
+ return addLeadingZeros(quarter, 2);
+ case "qo":
+ return localize3.ordinalNumber(quarter, { unit: "quarter" });
+ case "qqq":
+ return localize3.quarter(quarter, {
+ width: "abbreviated",
+ context: "standalone"
+ });
+ case "qqqqq":
+ return localize3.quarter(quarter, {
+ width: "narrow",
+ context: "standalone"
+ });
+ case "qqqq":
+ default:
+ return localize3.quarter(quarter, {
+ width: "wide",
+ context: "standalone"
+ });
+ }
+ },
+ M: function M(date, token, localize3) {
+ var month = date.getMonth();
+ switch (token) {
+ case "M":
+ case "MM":
+ return _lightFormatters.M(date, token);
+ case "Mo":
+ return localize3.ordinalNumber(month + 1, { unit: "month" });
+ case "MMM":
+ return localize3.month(month, {
+ width: "abbreviated",
+ context: "formatting"
+ });
+ case "MMMMM":
+ return localize3.month(month, {
+ width: "narrow",
+ context: "formatting"
+ });
+ case "MMMM":
+ default:
+ return localize3.month(month, { width: "wide", context: "formatting" });
+ }
+ },
+ L: function L(date, token, localize3) {
+ var month = date.getMonth();
+ switch (token) {
+ case "L":
+ return String(month + 1);
+ case "LL":
+ return addLeadingZeros(month + 1, 2);
+ case "Lo":
+ return localize3.ordinalNumber(month + 1, { unit: "month" });
+ case "LLL":
+ return localize3.month(month, {
+ width: "abbreviated",
+ context: "standalone"
+ });
+ case "LLLLL":
+ return localize3.month(month, {
+ width: "narrow",
+ context: "standalone"
+ });
+ case "LLLL":
+ default:
+ return localize3.month(month, { width: "wide", context: "standalone" });
+ }
+ },
+ w: function w(date, token, localize3, options) {
+ var week = _getWeek(date, options);
+ if (token === "wo") {
+ return localize3.ordinalNumber(week, { unit: "week" });
+ }
+ return addLeadingZeros(week, token.length);
+ },
+ I: function I(date, token, localize3) {
+ var isoWeek = _getISOWeek(date);
+ if (token === "Io") {
+ return localize3.ordinalNumber(isoWeek, { unit: "week" });
+ }
+ return addLeadingZeros(isoWeek, token.length);
+ },
+ d: function d(date, token, localize3) {
+ if (token === "do") {
+ return localize3.ordinalNumber(date.getDate(), { unit: "date" });
+ }
+ return _lightFormatters.d(date, token);
+ },
+ D: function D(date, token, localize3) {
+ var dayOfYear = _getDayOfYear(date);
+ if (token === "Do") {
+ return localize3.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
+ }
+ return addLeadingZeros(dayOfYear, token.length);
+ },
+ E: function E(date, token, localize3) {
+ var dayOfWeek = date.getDay();
+ switch (token) {
+ case "E":
+ case "EE":
+ case "EEE":
+ return localize3.day(dayOfWeek, {
+ width: "abbreviated",
+ context: "formatting"
+ });
+ case "EEEEE":
+ return localize3.day(dayOfWeek, {
+ width: "narrow",
+ context: "formatting"
+ });
+ case "EEEEEE":
+ return localize3.day(dayOfWeek, {
+ width: "short",
+ context: "formatting"
+ });
+ case "EEEE":
+ default:
+ return localize3.day(dayOfWeek, {
+ width: "wide",
+ context: "formatting"
+ });
+ }
+ },
+ e: function e(date, token, localize3, options) {
+ var dayOfWeek = date.getDay();
+ var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
+ switch (token) {
+ case "e":
+ return String(localDayOfWeek);
+ case "ee":
+ return addLeadingZeros(localDayOfWeek, 2);
+ case "eo":
+ return localize3.ordinalNumber(localDayOfWeek, { unit: "day" });
+ case "eee":
+ return localize3.day(dayOfWeek, {
+ width: "abbreviated",
+ context: "formatting"
+ });
+ case "eeeee":
+ return localize3.day(dayOfWeek, {
+ width: "narrow",
+ context: "formatting"
+ });
+ case "eeeeee":
+ return localize3.day(dayOfWeek, {
+ width: "short",
+ context: "formatting"
+ });
+ case "eeee":
+ default:
+ return localize3.day(dayOfWeek, {
+ width: "wide",
+ context: "formatting"
+ });
+ }
+ },
+ c: function c(date, token, localize3, options) {
+ var dayOfWeek = date.getDay();
+ var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
+ switch (token) {
+ case "c":
+ return String(localDayOfWeek);
+ case "cc":
+ return addLeadingZeros(localDayOfWeek, token.length);
+ case "co":
+ return localize3.ordinalNumber(localDayOfWeek, { unit: "day" });
+ case "ccc":
+ return localize3.day(dayOfWeek, {
+ width: "abbreviated",
+ context: "standalone"
+ });
+ case "ccccc":
+ return localize3.day(dayOfWeek, {
+ width: "narrow",
+ context: "standalone"
+ });
+ case "cccccc":
+ return localize3.day(dayOfWeek, {
+ width: "short",
+ context: "standalone"
+ });
+ case "cccc":
+ default:
+ return localize3.day(dayOfWeek, {
+ width: "wide",
+ context: "standalone"
+ });
+ }
+ },
+ i: function i(date, token, localize3) {
+ var dayOfWeek = date.getDay();
+ var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
+ switch (token) {
+ case "i":
+ return String(isoDayOfWeek);
+ case "ii":
+ return addLeadingZeros(isoDayOfWeek, token.length);
+ case "io":
+ return localize3.ordinalNumber(isoDayOfWeek, { unit: "day" });
+ case "iii":
+ return localize3.day(dayOfWeek, {
+ width: "abbreviated",
+ context: "formatting"
+ });
+ case "iiiii":
+ return localize3.day(dayOfWeek, {
+ width: "narrow",
+ context: "formatting"
+ });
+ case "iiiiii":
+ return localize3.day(dayOfWeek, {
+ width: "short",
+ context: "formatting"
+ });
+ case "iiii":
+ default:
+ return localize3.day(dayOfWeek, {
+ width: "wide",
+ context: "formatting"
+ });
+ }
+ },
+ a: function a(date, token, localize3) {
+ var hours = date.getHours();
+ var dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
+ switch (token) {
+ case "a":
+ case "aa":
+ return localize3.dayPeriod(dayPeriodEnumValue, {
+ width: "abbreviated",
+ context: "formatting"
+ });
+ case "aaa":
+ return localize3.dayPeriod(dayPeriodEnumValue, {
+ width: "abbreviated",
+ context: "formatting"
+ }).toLowerCase();
+ case "aaaaa":
+ return localize3.dayPeriod(dayPeriodEnumValue, {
+ width: "narrow",
+ context: "formatting"
+ });
+ case "aaaa":
+ default:
+ return localize3.dayPeriod(dayPeriodEnumValue, {
+ width: "wide",
+ context: "formatting"
+ });
+ }
+ },
+ b: function b(date, token, localize3) {
+ var hours = date.getHours();
+ var dayPeriodEnumValue;
+ if (hours === 12) {
+ dayPeriodEnumValue = dayPeriodEnum.noon;
+ } else if (hours === 0) {
+ dayPeriodEnumValue = dayPeriodEnum.midnight;
+ } else {
+ dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
+ }
+ switch (token) {
+ case "b":
+ case "bb":
+ return localize3.dayPeriod(dayPeriodEnumValue, {
+ width: "abbreviated",
+ context: "formatting"
+ });
+ case "bbb":
+ return localize3.dayPeriod(dayPeriodEnumValue, {
+ width: "abbreviated",
+ context: "formatting"
+ }).toLowerCase();
+ case "bbbbb":
+ return localize3.dayPeriod(dayPeriodEnumValue, {
+ width: "narrow",
+ context: "formatting"
+ });
+ case "bbbb":
+ default:
+ return localize3.dayPeriod(dayPeriodEnumValue, {
+ width: "wide",
+ context: "formatting"
+ });
+ }
+ },
+ B: function B(date, token, localize3) {
+ var hours = date.getHours();
+ var dayPeriodEnumValue;
+ if (hours >= 17) {
+ dayPeriodEnumValue = dayPeriodEnum.evening;
+ } else if (hours >= 12) {
+ dayPeriodEnumValue = dayPeriodEnum.afternoon;
+ } else if (hours >= 4) {
+ dayPeriodEnumValue = dayPeriodEnum.morning;
+ } else {
+ dayPeriodEnumValue = dayPeriodEnum.night;
+ }
+ switch (token) {
+ case "B":
+ case "BB":
+ case "BBB":
+ return localize3.dayPeriod(dayPeriodEnumValue, {
+ width: "abbreviated",
+ context: "formatting"
+ });
+ case "BBBBB":
+ return localize3.dayPeriod(dayPeriodEnumValue, {
+ width: "narrow",
+ context: "formatting"
+ });
+ case "BBBB":
+ default:
+ return localize3.dayPeriod(dayPeriodEnumValue, {
+ width: "wide",
+ context: "formatting"
+ });
+ }
+ },
+ h: function h(date, token, localize3) {
+ if (token === "ho") {
+ var hours = date.getHours() % 12;
+ if (hours === 0)
+ hours = 12;
+ return localize3.ordinalNumber(hours, { unit: "hour" });
+ }
+ return _lightFormatters.h(date, token);
+ },
+ H: function H(date, token, localize3) {
+ if (token === "Ho") {
+ return localize3.ordinalNumber(date.getHours(), { unit: "hour" });
+ }
+ return _lightFormatters.H(date, token);
+ },
+ K: function K(date, token, localize3) {
+ var hours = date.getHours() % 12;
+ if (token === "Ko") {
+ return localize3.ordinalNumber(hours, { unit: "hour" });
+ }
+ return addLeadingZeros(hours, token.length);
+ },
+ k: function k(date, token, localize3) {
+ var hours = date.getHours();
+ if (hours === 0)
+ hours = 24;
+ if (token === "ko") {
+ return localize3.ordinalNumber(hours, { unit: "hour" });
+ }
+ return addLeadingZeros(hours, token.length);
+ },
+ m: function m(date, token, localize3) {
+ if (token === "mo") {
+ return localize3.ordinalNumber(date.getMinutes(), { unit: "minute" });
+ }
+ return _lightFormatters.m(date, token);
+ },
+ s: function s(date, token, localize3) {
+ if (token === "so") {
+ return localize3.ordinalNumber(date.getSeconds(), { unit: "second" });
+ }
+ return _lightFormatters.s(date, token);
+ },
+ S: function S(date, token) {
+ return _lightFormatters.S(date, token);
+ },
+ X: function X(date, token, _localize) {
+ var timezoneOffset = date.getTimezoneOffset();
+ if (timezoneOffset === 0) {
+ return "Z";
+ }
+ switch (token) {
+ case "X":
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
+ case "XXXX":
+ case "XX":
+ return formatTimezone(timezoneOffset);
+ case "XXXXX":
+ case "XXX":
+ default:
+ return formatTimezone(timezoneOffset, ":");
+ }
+ },
+ x: function x(date, token, _localize) {
+ var timezoneOffset = date.getTimezoneOffset();
+ switch (token) {
+ case "x":
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
+ case "xxxx":
+ case "xx":
+ return formatTimezone(timezoneOffset);
+ case "xxxxx":
+ case "xxx":
+ default:
+ return formatTimezone(timezoneOffset, ":");
+ }
+ },
+ O: function O(date, token, _localize) {
+ var timezoneOffset = date.getTimezoneOffset();
+ switch (token) {
+ case "O":
+ case "OO":
+ case "OOO":
+ return "GMT" + formatTimezoneShort(timezoneOffset, ":");
+ case "OOOO":
+ default:
+ return "GMT" + formatTimezone(timezoneOffset, ":");
+ }
+ },
+ z: function z(date, token, _localize) {
+ var timezoneOffset = date.getTimezoneOffset();
+ switch (token) {
+ case "z":
+ case "zz":
+ case "zzz":
+ return "GMT" + formatTimezoneShort(timezoneOffset, ":");
+ case "zzzz":
+ default:
+ return "GMT" + formatTimezone(timezoneOffset, ":");
+ }
+ },
+ t: function t(date, token, _localize) {
+ var timestamp = Math.trunc(+date / 1000);
+ return addLeadingZeros(timestamp, token.length);
+ },
+ T: function T(date, token, _localize) {
+ return addLeadingZeros(+date, token.length);
+ }
+};
+
+// lib/_lib/format/longFormatters.js
+var dateLongFormatter = function dateLongFormatter(pattern, formatLong3) {
+ switch (pattern) {
+ case "P":
+ return formatLong3.date({ width: "short" });
+ case "PP":
+ return formatLong3.date({ width: "medium" });
+ case "PPP":
+ return formatLong3.date({ width: "long" });
+ case "PPPP":
+ default:
+ return formatLong3.date({ width: "full" });
+ }
+};
+var timeLongFormatter = function timeLongFormatter(pattern, formatLong3) {
+ switch (pattern) {
+ case "p":
+ return formatLong3.time({ width: "short" });
+ case "pp":
+ return formatLong3.time({ width: "medium" });
+ case "ppp":
+ return formatLong3.time({ width: "long" });
+ case "pppp":
+ default:
+ return formatLong3.time({ width: "full" });
+ }
+};
+var dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong3) {
+ var matchResult = pattern.match(/(P+)(p+)?/) || [];
+ var datePattern = matchResult[1];
+ var timePattern = matchResult[2];
+ if (!timePattern) {
+ return dateLongFormatter(pattern, formatLong3);
+ }
+ var dateTimeFormat;
+ switch (datePattern) {
+ case "P":
+ dateTimeFormat = formatLong3.dateTime({ width: "short" });
+ break;
+ case "PP":
+ dateTimeFormat = formatLong3.dateTime({ width: "medium" });
+ break;
+ case "PPP":
+ dateTimeFormat = formatLong3.dateTime({ width: "long" });
+ break;
+ case "PPPP":
+ default:
+ dateTimeFormat = formatLong3.dateTime({ width: "full" });
+ break;
+ }
+ return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong3)).replace("{{time}}", timeLongFormatter(timePattern, formatLong3));
+};
+var _longFormatters = {
+ p: timeLongFormatter,
+ P: dateTimeLongFormatter
+};
+
+// lib/_lib/protectedTokens.js
+function isProtectedDayOfYearToken(token) {
+ return dayOfYearTokenRE.test(token);
+}
+function isProtectedWeekYearToken(token) {
+ return weekYearTokenRE.test(token);
+}
+function warnOrThrowProtectedError(token, format, input) {
+ var _message = message(token, format, input);
+ console.warn(_message);
+ if (throwTokens.includes(token))
+ throw new RangeError(_message);
+}
+function message(token, format, input) {
+ var subject = token[0] === "Y" ? "years" : "days of the month";
+ return "Use `".concat(token.toLowerCase(), "` instead of `").concat(token, "` (in `").concat(format, "`) for formatting ").concat(subject, " to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md");
+}
+var dayOfYearTokenRE = /^D+$/;
+var weekYearTokenRE = /^Y+$/;
+var throwTokens = ["D", "DD", "YY", "YYYY"];
+
+// lib/format.js
+function _format(date, formatStr, options) {var _ref13, _options$locale5, _ref14, _ref15, _ref16, _options$firstWeekCon3, _options$locale6, _defaultOptions7$loca, _ref17, _ref18, _ref19, _options$weekStartsOn3, _options$locale7, _defaultOptions7$loca2;
+ var defaultOptions7 = getDefaultOptions();
+ var locale = (_ref13 = (_options$locale5 = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale5 !== void 0 ? _options$locale5 : defaultOptions7.locale) !== null && _ref13 !== void 0 ? _ref13 : enUS;
+ var firstWeekContainsDate = (_ref14 = (_ref15 = (_ref16 = (_options$firstWeekCon3 = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon3 !== void 0 ? _options$firstWeekCon3 : options === null || options === void 0 || (_options$locale6 = options.locale) === null || _options$locale6 === void 0 || (_options$locale6 = _options$locale6.options) === null || _options$locale6 === void 0 ? void 0 : _options$locale6.firstWeekContainsDate) !== null && _ref16 !== void 0 ? _ref16 : defaultOptions7.firstWeekContainsDate) !== null && _ref15 !== void 0 ? _ref15 : (_defaultOptions7$loca = defaultOptions7.locale) === null || _defaultOptions7$loca === void 0 || (_defaultOptions7$loca = _defaultOptions7$loca.options) === null || _defaultOptions7$loca === void 0 ? void 0 : _defaultOptions7$loca.firstWeekContainsDate) !== null && _ref14 !== void 0 ? _ref14 : 1;
+ var weekStartsOn = (_ref17 = (_ref18 = (_ref19 = (_options$weekStartsOn3 = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn3 !== void 0 ? _options$weekStartsOn3 : options === null || options === void 0 || (_options$locale7 = options.locale) === null || _options$locale7 === void 0 || (_options$locale7 = _options$locale7.options) === null || _options$locale7 === void 0 ? void 0 : _options$locale7.weekStartsOn) !== null && _ref19 !== void 0 ? _ref19 : defaultOptions7.weekStartsOn) !== null && _ref18 !== void 0 ? _ref18 : (_defaultOptions7$loca2 = defaultOptions7.locale) === null || _defaultOptions7$loca2 === void 0 || (_defaultOptions7$loca2 = _defaultOptions7$loca2.options) === null || _defaultOptions7$loca2 === void 0 ? void 0 : _defaultOptions7$loca2.weekStartsOn) !== null && _ref17 !== void 0 ? _ref17 : 0;
+ var originalDate = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ if (!_isValid(originalDate)) {
+ throw new RangeError("Invalid time value");
+ }
+ var parts = formatStr.match(longFormattingTokensRegExp).map(function (substring) {
+ var firstCharacter = substring[0];
+ if (firstCharacter === "p" || firstCharacter === "P") {
+ var longFormatter = _longFormatters[firstCharacter];
+ return longFormatter(substring, locale.formatLong);
+ }
+ return substring;
+ }).join("").match(formattingTokensRegExp).map(function (substring) {
+ if (substring === "''") {
+ return { isToken: false, value: "'" };
+ }
+ var firstCharacter = substring[0];
+ if (firstCharacter === "'") {
+ return { isToken: false, value: cleanEscapedString(substring) };
+ }
+ if (_formatters[firstCharacter]) {
+ return { isToken: true, value: substring };
+ }
+ if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
+ throw new RangeError("Format string contains an unescaped latin alphabet character `" + firstCharacter + "`");
+ }
+ return { isToken: false, value: substring };
+ });
+ if (locale.localize.preprocessor) {
+ parts = locale.localize.preprocessor(originalDate, parts);
+ }
+ var formatterOptions = {
+ firstWeekContainsDate: firstWeekContainsDate,
+ weekStartsOn: weekStartsOn,
+ locale: locale
+ };
+ return parts.map(function (part) {
+ if (!part.isToken)
+ return part.value;
+ var token = part.value;
+ if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(token) || !(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(token)) {
+ warnOrThrowProtectedError(token, formatStr, String(date));
+ }
+ var formatter = _formatters[token[0]];
+ return formatter(originalDate, token, locale.localize, formatterOptions);
+ }).join("");
+}
+function cleanEscapedString(input) {
+ var matched = input.match(escapedStringRegExp);
+ if (!matched) {
+ return input;
+ }
+ return matched[1].replace(doubleQuoteRegExp, "'");
+}
+var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
+var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
+var escapedStringRegExp = /^'([^]*?)'?$/;
+var doubleQuoteRegExp = /''/g;
+var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
+// lib/formatDistance.js
+function formatDistance3(laterDate, earlierDate, options) {var _ref20, _options$locale8;
+ var defaultOptions8 = getDefaultOptions();
+ var locale = (_ref20 = (_options$locale8 = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale8 !== void 0 ? _options$locale8 : defaultOptions8.locale) !== null && _ref20 !== void 0 ? _ref20 : enUS;
+ var minutesInAlmostTwoDays = 2520;
+ var comparison = _compareAsc(laterDate, earlierDate);
+ if (isNaN(comparison))
+ throw new RangeError("Invalid time value");
+ var localizeOptions = Object.assign({}, options, {
+ addSuffix: options === null || options === void 0 ? void 0 : options.addSuffix,
+ comparison: comparison
+ });
+ var _normalizeDates35 = normalizeDates.apply(void 0, [options === null || options === void 0 ? void 0 : options.in].concat(_toConsumableArray(comparison > 0 ? [earlierDate, laterDate] : [laterDate, earlierDate]))),_normalizeDates36 = _slicedToArray(_normalizeDates35, 2),laterDate_ = _normalizeDates36[0],earlierDate_ = _normalizeDates36[1];
+ var seconds = _differenceInSeconds(earlierDate_, laterDate_);
+ var offsetInSeconds = (getTimezoneOffsetInMilliseconds(earlierDate_) - getTimezoneOffsetInMilliseconds(laterDate_)) / 1000;
+ var minutes = Math.round((seconds - offsetInSeconds) / 60);
+ var months;
+ if (minutes < 2) {
+ if (options !== null && options !== void 0 && options.includeSeconds) {
+ if (seconds < 5) {
+ return locale.formatDistance("lessThanXSeconds", 5, localizeOptions);
+ } else if (seconds < 10) {
+ return locale.formatDistance("lessThanXSeconds", 10, localizeOptions);
+ } else if (seconds < 20) {
+ return locale.formatDistance("lessThanXSeconds", 20, localizeOptions);
+ } else if (seconds < 40) {
+ return locale.formatDistance("halfAMinute", 0, localizeOptions);
+ } else if (seconds < 60) {
+ return locale.formatDistance("lessThanXMinutes", 1, localizeOptions);
+ } else {
+ return locale.formatDistance("xMinutes", 1, localizeOptions);
+ }
+ } else {
+ if (minutes === 0) {
+ return locale.formatDistance("lessThanXMinutes", 1, localizeOptions);
+ } else {
+ return locale.formatDistance("xMinutes", minutes, localizeOptions);
+ }
+ }
+ } else if (minutes < 45) {
+ return locale.formatDistance("xMinutes", minutes, localizeOptions);
+ } else if (minutes < 90) {
+ return locale.formatDistance("aboutXHours", 1, localizeOptions);
+ } else if (minutes < minutesInDay) {
+ var hours = Math.round(minutes / 60);
+ return locale.formatDistance("aboutXHours", hours, localizeOptions);
+ } else if (minutes < minutesInAlmostTwoDays) {
+ return locale.formatDistance("xDays", 1, localizeOptions);
+ } else if (minutes < minutesInMonth) {
+ var _days = Math.round(minutes / minutesInDay);
+ return locale.formatDistance("xDays", _days, localizeOptions);
+ } else if (minutes < minutesInMonth * 2) {
+ months = Math.round(minutes / minutesInMonth);
+ return locale.formatDistance("aboutXMonths", months, localizeOptions);
+ }
+ months = _differenceInMonths(earlierDate_, laterDate_);
+ if (months < 12) {
+ var nearestMonth = Math.round(minutes / minutesInMonth);
+ return locale.formatDistance("xMonths", nearestMonth, localizeOptions);
+ } else {
+ var monthsSinceStartOfYear = months % 12;
+ var years = Math.trunc(months / 12);
+ if (monthsSinceStartOfYear < 3) {
+ return locale.formatDistance("aboutXYears", years, localizeOptions);
+ } else if (monthsSinceStartOfYear < 9) {
+ return locale.formatDistance("overXYears", years, localizeOptions);
+ } else {
+ return locale.formatDistance("almostXYears", years + 1, localizeOptions);
+ }
+ }
+}
+// lib/formatDistanceStrict.js
+function _formatDistanceStrict(laterDate, earlierDate, options) {var _ref21, _options$locale9, _options$roundingMeth;
+ var defaultOptions9 = getDefaultOptions();
+ var locale = (_ref21 = (_options$locale9 = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale9 !== void 0 ? _options$locale9 : defaultOptions9.locale) !== null && _ref21 !== void 0 ? _ref21 : enUS;
+ var comparison = _compareAsc(laterDate, earlierDate);
+ if (isNaN(comparison)) {
+ throw new RangeError("Invalid time value");
+ }
+ var localizeOptions = Object.assign({}, options, {
+ addSuffix: options === null || options === void 0 ? void 0 : options.addSuffix,
+ comparison: comparison
+ });
+ var _normalizeDates37 = normalizeDates.apply(void 0, [options === null || options === void 0 ? void 0 : options.in].concat(_toConsumableArray(comparison > 0 ? [earlierDate, laterDate] : [laterDate, earlierDate]))),_normalizeDates38 = _slicedToArray(_normalizeDates37, 2),laterDate_ = _normalizeDates38[0],earlierDate_ = _normalizeDates38[1];
+ var roundingMethod = getRoundingMethod((_options$roundingMeth = options === null || options === void 0 ? void 0 : options.roundingMethod) !== null && _options$roundingMeth !== void 0 ? _options$roundingMeth : "round");
+ var milliseconds = earlierDate_.getTime() - laterDate_.getTime();
+ var minutes = milliseconds / millisecondsInMinute;
+ var timezoneOffset = getTimezoneOffsetInMilliseconds(earlierDate_) - getTimezoneOffsetInMilliseconds(laterDate_);
+ var dstNormalizedMinutes = (milliseconds - timezoneOffset) / millisecondsInMinute;
+ var defaultUnit = options === null || options === void 0 ? void 0 : options.unit;
+ var unit;
+ if (!defaultUnit) {
+ if (minutes < 1) {
+ unit = "second";
+ } else if (minutes < 60) {
+ unit = "minute";
+ } else if (minutes < minutesInDay) {
+ unit = "hour";
+ } else if (dstNormalizedMinutes < minutesInMonth) {
+ unit = "day";
+ } else if (dstNormalizedMinutes < minutesInYear) {
+ unit = "month";
+ } else {
+ unit = "year";
+ }
+ } else {
+ unit = defaultUnit;
+ }
+ if (unit === "second") {
+ var seconds = roundingMethod(milliseconds / 1000);
+ return locale.formatDistance("xSeconds", seconds, localizeOptions);
+ } else if (unit === "minute") {
+ var roundedMinutes = roundingMethod(minutes);
+ return locale.formatDistance("xMinutes", roundedMinutes, localizeOptions);
+ } else if (unit === "hour") {
+ var hours = roundingMethod(minutes / 60);
+ return locale.formatDistance("xHours", hours, localizeOptions);
+ } else if (unit === "day") {
+ var _days2 = roundingMethod(dstNormalizedMinutes / minutesInDay);
+ return locale.formatDistance("xDays", _days2, localizeOptions);
+ } else if (unit === "month") {
+ var _months = roundingMethod(dstNormalizedMinutes / minutesInMonth);
+ return _months === 12 && defaultUnit !== "month" ? locale.formatDistance("xYears", 1, localizeOptions) : locale.formatDistance("xMonths", _months, localizeOptions);
+ } else {
+ var years = roundingMethod(dstNormalizedMinutes / minutesInYear);
+ return locale.formatDistance("xYears", years, localizeOptions);
+ }
+}
+// lib/formatDistanceToNow.js
+function _formatDistanceToNow(date, options) {
+ return formatDistance3(date, _constructNow(date), options);
+}
+// lib/formatDistanceToNowStrict.js
+function _formatDistanceToNowStrict(date, options) {
+ return _formatDistanceStrict(date, _constructNow(date), options);
+}
+// lib/formatDuration.js
+function _formatDuration(duration, options) {var _ref22, _options$locale10, _options$format, _options$zero, _options$delimiter;
+ var defaultOptions10 = getDefaultOptions();
+ var locale = (_ref22 = (_options$locale10 = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale10 !== void 0 ? _options$locale10 : defaultOptions10.locale) !== null && _ref22 !== void 0 ? _ref22 : enUS;
+ var format2 = (_options$format = options === null || options === void 0 ? void 0 : options.format) !== null && _options$format !== void 0 ? _options$format : defaultFormat;
+ var zero = (_options$zero = options === null || options === void 0 ? void 0 : options.zero) !== null && _options$zero !== void 0 ? _options$zero : false;
+ var delimiter = (_options$delimiter = options === null || options === void 0 ? void 0 : options.delimiter) !== null && _options$delimiter !== void 0 ? _options$delimiter : " ";
+ if (!locale.formatDistance) {
+ return "";
+ }
+ var result = format2.reduce(function (acc, unit) {
+ var token = "x".concat(unit.replace(/(^.)/, function (m) {return m.toUpperCase();}));
+ var value = duration[unit];
+ if (value !== undefined && (zero || duration[unit])) {
+ return acc.concat(locale.formatDistance(token, value));
+ }
+ return acc;
+ }, []).join(delimiter);
+ return result;
+}
+var defaultFormat = [
+"years",
+"months",
+"weeks",
+"days",
+"hours",
+"minutes",
+"seconds"];
+
+// lib/formatISO.js
+function _formatISO2(date, options) {var _options$format2, _options$representati;
+ var date_ = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ if (isNaN(+date_)) {
+ throw new RangeError("Invalid time value");
+ }
+ var format2 = (_options$format2 = options === null || options === void 0 ? void 0 : options.format) !== null && _options$format2 !== void 0 ? _options$format2 : "extended";
+ var representation = (_options$representati = options === null || options === void 0 ? void 0 : options.representation) !== null && _options$representati !== void 0 ? _options$representati : "complete";
+ var result = "";
+ var tzOffset = "";
+ var dateDelimiter = format2 === "extended" ? "-" : "";
+ var timeDelimiter = format2 === "extended" ? ":" : "";
+ if (representation !== "time") {
+ var day = addLeadingZeros(date_.getDate(), 2);
+ var month = addLeadingZeros(date_.getMonth() + 1, 2);
+ var year = addLeadingZeros(date_.getFullYear(), 4);
+ result = "".concat(year).concat(dateDelimiter).concat(month).concat(dateDelimiter).concat(day);
+ }
+ if (representation !== "date") {
+ var offset = date_.getTimezoneOffset();
+ if (offset !== 0) {
+ var absoluteOffset = Math.abs(offset);
+ var hourOffset = addLeadingZeros(Math.trunc(absoluteOffset / 60), 2);
+ var minuteOffset = addLeadingZeros(absoluteOffset % 60, 2);
+ var sign = offset < 0 ? "+" : "-";
+ tzOffset = "".concat(sign).concat(hourOffset, ":").concat(minuteOffset);
+ } else {
+ tzOffset = "Z";
+ }
+ var hour = addLeadingZeros(date_.getHours(), 2);
+ var minute = addLeadingZeros(date_.getMinutes(), 2);
+ var second = addLeadingZeros(date_.getSeconds(), 2);
+ var separator = result === "" ? "" : "T";
+ var time = [hour, minute, second].join(timeDelimiter);
+ result = "".concat(result).concat(separator).concat(time).concat(tzOffset);
+ }
+ return result;
+}
+// lib/formatISO9075.js
+function _formatISO(date, options) {var _options$format3, _options$representati2;
+ var date_ = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ if (!_isValid(date_)) {
+ throw new RangeError("Invalid time value");
+ }
+ var format2 = (_options$format3 = options === null || options === void 0 ? void 0 : options.format) !== null && _options$format3 !== void 0 ? _options$format3 : "extended";
+ var representation = (_options$representati2 = options === null || options === void 0 ? void 0 : options.representation) !== null && _options$representati2 !== void 0 ? _options$representati2 : "complete";
+ var result = "";
+ var dateDelimiter = format2 === "extended" ? "-" : "";
+ var timeDelimiter = format2 === "extended" ? ":" : "";
+ if (representation !== "time") {
+ var day = addLeadingZeros(date_.getDate(), 2);
+ var month = addLeadingZeros(date_.getMonth() + 1, 2);
+ var year = addLeadingZeros(date_.getFullYear(), 4);
+ result = "".concat(year).concat(dateDelimiter).concat(month).concat(dateDelimiter).concat(day);
+ }
+ if (representation !== "date") {
+ var hour = addLeadingZeros(date_.getHours(), 2);
+ var minute = addLeadingZeros(date_.getMinutes(), 2);
+ var second = addLeadingZeros(date_.getSeconds(), 2);
+ var separator = result === "" ? "" : " ";
+ result = "".concat(result).concat(separator).concat(hour).concat(timeDelimiter).concat(minute).concat(timeDelimiter).concat(second);
+ }
+ return result;
+}
+// lib/formatISODuration.js
+function _formatISODuration(duration) {
+ var _duration$years2 =
+
+
+
+
+
+
+ duration.years,years = _duration$years2 === void 0 ? 0 : _duration$years2,_duration$months2 = duration.months,months = _duration$months2 === void 0 ? 0 : _duration$months2,_duration$days2 = duration.days,days = _duration$days2 === void 0 ? 0 : _duration$days2,_duration$hours2 = duration.hours,hours = _duration$hours2 === void 0 ? 0 : _duration$hours2,_duration$minutes2 = duration.minutes,minutes = _duration$minutes2 === void 0 ? 0 : _duration$minutes2,_duration$seconds2 = duration.seconds,seconds = _duration$seconds2 === void 0 ? 0 : _duration$seconds2;
+ return "P".concat(years, "Y").concat(months, "M").concat(days, "DT").concat(hours, "H").concat(minutes, "M").concat(seconds, "S");
+}
+// lib/formatRFC3339.js
+function _formatRFC2(date, options) {var _options$fractionDigi;
+ var date_ = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ if (!_isValid(date_)) {
+ throw new RangeError("Invalid time value");
+ }
+ var fractionDigits = (_options$fractionDigi = options === null || options === void 0 ? void 0 : options.fractionDigits) !== null && _options$fractionDigi !== void 0 ? _options$fractionDigi : 0;
+ var day = addLeadingZeros(date_.getDate(), 2);
+ var month = addLeadingZeros(date_.getMonth() + 1, 2);
+ var year = date_.getFullYear();
+ var hour = addLeadingZeros(date_.getHours(), 2);
+ var minute = addLeadingZeros(date_.getMinutes(), 2);
+ var second = addLeadingZeros(date_.getSeconds(), 2);
+ var fractionalSecond = "";
+ if (fractionDigits > 0) {
+ var milliseconds = date_.getMilliseconds();
+ var fractionalSeconds = Math.trunc(milliseconds * Math.pow(10, fractionDigits - 3));
+ fractionalSecond = "." + addLeadingZeros(fractionalSeconds, fractionDigits);
+ }
+ var offset = "";
+ var tzOffset = date_.getTimezoneOffset();
+ if (tzOffset !== 0) {
+ var absoluteOffset = Math.abs(tzOffset);
+ var hourOffset = addLeadingZeros(Math.trunc(absoluteOffset / 60), 2);
+ var minuteOffset = addLeadingZeros(absoluteOffset % 60, 2);
+ var sign = tzOffset < 0 ? "+" : "-";
+ offset = "".concat(sign).concat(hourOffset, ":").concat(minuteOffset);
+ } else {
+ offset = "Z";
+ }
+ return "".concat(year, "-").concat(month, "-").concat(day, "T").concat(hour, ":").concat(minute, ":").concat(second).concat(fractionalSecond).concat(offset);
+}
+// lib/formatRFC7231.js
+function _formatRFC(date) {
+ var _date = _toDate(date);
+ if (!_isValid(_date)) {
+ throw new RangeError("Invalid time value");
+ }
+ var dayName = days[_date.getUTCDay()];
+ var dayOfMonth = addLeadingZeros(_date.getUTCDate(), 2);
+ var monthName = months[_date.getUTCMonth()];
+ var year = _date.getUTCFullYear();
+ var hour = addLeadingZeros(_date.getUTCHours(), 2);
+ var minute = addLeadingZeros(_date.getUTCMinutes(), 2);
+ var second = addLeadingZeros(_date.getUTCSeconds(), 2);
+ return "".concat(dayName, ", ").concat(dayOfMonth, " ").concat(monthName, " ").concat(year, " ").concat(hour, ":").concat(minute, ":").concat(second, " GMT");
+}
+var days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
+var months = [
+"Jan",
+"Feb",
+"Mar",
+"Apr",
+"May",
+"Jun",
+"Jul",
+"Aug",
+"Sep",
+"Oct",
+"Nov",
+"Dec"];
+
+// lib/formatRelative.js
+function formatRelative3(date, baseDate, options) {var _ref23, _options$locale11, _ref24, _ref25, _ref26, _options$weekStartsOn4, _options$locale12, _defaultOptions11$loc;
+ var _normalizeDates39 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, date, baseDate),_normalizeDates40 = _slicedToArray(_normalizeDates39, 2),date_ = _normalizeDates40[0],baseDate_ = _normalizeDates40[1];
+ var defaultOptions11 = getDefaultOptions();
+ var locale = (_ref23 = (_options$locale11 = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale11 !== void 0 ? _options$locale11 : defaultOptions11.locale) !== null && _ref23 !== void 0 ? _ref23 : enUS;
+ var weekStartsOn = (_ref24 = (_ref25 = (_ref26 = (_options$weekStartsOn4 = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn4 !== void 0 ? _options$weekStartsOn4 : options === null || options === void 0 || (_options$locale12 = options.locale) === null || _options$locale12 === void 0 || (_options$locale12 = _options$locale12.options) === null || _options$locale12 === void 0 ? void 0 : _options$locale12.weekStartsOn) !== null && _ref26 !== void 0 ? _ref26 : defaultOptions11.weekStartsOn) !== null && _ref25 !== void 0 ? _ref25 : (_defaultOptions11$loc = defaultOptions11.locale) === null || _defaultOptions11$loc === void 0 || (_defaultOptions11$loc = _defaultOptions11$loc.options) === null || _defaultOptions11$loc === void 0 ? void 0 : _defaultOptions11$loc.weekStartsOn) !== null && _ref24 !== void 0 ? _ref24 : 0;
+ var diff = _differenceInCalendarDays(date_, baseDate_);
+ if (isNaN(diff)) {
+ throw new RangeError("Invalid time value");
+ }
+ var token;
+ if (diff < -6) {
+ token = "other";
+ } else if (diff < -1) {
+ token = "lastWeek";
+ } else if (diff < 0) {
+ token = "yesterday";
+ } else if (diff < 1) {
+ token = "today";
+ } else if (diff < 2) {
+ token = "tomorrow";
+ } else if (diff < 7) {
+ token = "nextWeek";
+ } else {
+ token = "other";
+ }
+ var formatStr = locale.formatRelative(token, date_, baseDate_, {
+ locale: locale,
+ weekStartsOn: weekStartsOn
+ });
+ return _format(date_, formatStr, { locale: locale, weekStartsOn: weekStartsOn });
+}
+// lib/fromUnixTime.js
+function _fromUnixTime(unixTime, options) {
+ return _toDate(unixTime * 1000, options === null || options === void 0 ? void 0 : options.in);
+}
+// lib/getDate.js
+function _getDate(date, options) {
+ return _toDate(date, options === null || options === void 0 ? void 0 : options.in).getDate();
+}
+// lib/getDay.js
+function _getDay(date, options) {
+ return _toDate(date, options === null || options === void 0 ? void 0 : options.in).getDay();
+}
+// lib/getDaysInMonth.js
+function _getDaysInMonth(date, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ var year = _date.getFullYear();
+ var monthIndex = _date.getMonth();
+ var lastDayOfMonth = _constructFrom(_date, 0);
+ lastDayOfMonth.setFullYear(year, monthIndex + 1, 0);
+ lastDayOfMonth.setHours(0, 0, 0, 0);
+ return lastDayOfMonth.getDate();
+}
+// lib/isLeapYear.js
+function _isLeapYear(date, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ var year = _date.getFullYear();
+ return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
+}
+
+// lib/getDaysInYear.js
+function _getDaysInYear(date, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ if (Number.isNaN(+_date))
+ return NaN;
+ return _isLeapYear(_date) ? 366 : 365;
+}
+// lib/getDecade.js
+function _getDecade(date, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ var year = _date.getFullYear();
+ var decade = Math.floor(year / 10) * 10;
+ return decade;
+}
+// lib/getDefaultOptions.js
+function getDefaultOptions2() {
+ return Object.assign({}, getDefaultOptions());
+}
+// lib/getHours.js
+function _getHours(date, options) {
+ return _toDate(date, options === null || options === void 0 ? void 0 : options.in).getHours();
+}
+// lib/getISODay.js
+function _getISODay(date, options) {
+ var day = _toDate(date, options === null || options === void 0 ? void 0 : options.in).getDay();
+ return day === 0 ? 7 : day;
+}
+// lib/getISOWeeksInYear.js
+function _getISOWeeksInYear(date, options) {
+ var thisYear = _startOfISOWeekYear(date, options);
+ var nextYear = _startOfISOWeekYear(_addWeeks(thisYear, 60));
+ var diff = +nextYear - +thisYear;
+ return Math.round(diff / millisecondsInWeek);
+}
+// lib/getMilliseconds.js
+function _getMilliseconds(date) {
+ return _toDate(date).getMilliseconds();
+}
+// lib/getMinutes.js
+function _getMinutes(date, options) {
+ return _toDate(date, options === null || options === void 0 ? void 0 : options.in).getMinutes();
+}
+// lib/getMonth.js
+function _getMonth(date, options) {
+ return _toDate(date, options === null || options === void 0 ? void 0 : options.in).getMonth();
+}
+// lib/getOverlappingDaysInIntervals.js
+function _getOverlappingDaysInIntervals(intervalLeft, intervalRight) {
+ var _sort5 = [
+ +_toDate(intervalLeft.start),
+ +_toDate(intervalLeft.end)].
+ sort(function (a, b) {return a - b;}),_sort6 = _slicedToArray(_sort5, 2),leftStart = _sort6[0],leftEnd = _sort6[1];
+ var _sort7 = [
+ +_toDate(intervalRight.start),
+ +_toDate(intervalRight.end)].
+ sort(function (a, b) {return a - b;}),_sort8 = _slicedToArray(_sort7, 2),rightStart = _sort8[0],rightEnd = _sort8[1];
+ var isOverlapping = leftStart < rightEnd && rightStart < leftEnd;
+ if (!isOverlapping)
+ return 0;
+ var overlapLeft = rightStart < leftStart ? leftStart : rightStart;
+ var left = overlapLeft - getTimezoneOffsetInMilliseconds(overlapLeft);
+ var overlapRight = rightEnd > leftEnd ? leftEnd : rightEnd;
+ var right = overlapRight - getTimezoneOffsetInMilliseconds(overlapRight);
+ return Math.ceil((right - left) / millisecondsInDay);
+}
+// lib/getSeconds.js
+function _getSeconds(date) {
+ return _toDate(date).getSeconds();
+}
+// lib/getTime.js
+function _getTime(date) {
+ return +_toDate(date);
+}
+// lib/getUnixTime.js
+function _getUnixTime(date) {
+ return Math.trunc(+_toDate(date) / 1000);
+}
+// lib/getWeekOfMonth.js
+function _getWeekOfMonth(date, options) {var _ref27, _ref28, _ref29, _options$weekStartsOn5, _options$locale13, _defaultOptions13$loc;
+ var defaultOptions13 = getDefaultOptions();
+ var weekStartsOn = (_ref27 = (_ref28 = (_ref29 = (_options$weekStartsOn5 = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn5 !== void 0 ? _options$weekStartsOn5 : options === null || options === void 0 || (_options$locale13 = options.locale) === null || _options$locale13 === void 0 || (_options$locale13 = _options$locale13.options) === null || _options$locale13 === void 0 ? void 0 : _options$locale13.weekStartsOn) !== null && _ref29 !== void 0 ? _ref29 : defaultOptions13.weekStartsOn) !== null && _ref28 !== void 0 ? _ref28 : (_defaultOptions13$loc = defaultOptions13.locale) === null || _defaultOptions13$loc === void 0 || (_defaultOptions13$loc = _defaultOptions13$loc.options) === null || _defaultOptions13$loc === void 0 ? void 0 : _defaultOptions13$loc.weekStartsOn) !== null && _ref27 !== void 0 ? _ref27 : 0;
+ var currentDayOfMonth = _getDate(_toDate(date, options === null || options === void 0 ? void 0 : options.in));
+ if (isNaN(currentDayOfMonth))
+ return NaN;
+ var startWeekDay = _getDay(_startOfMonth(date, options));
+ var lastDayOfFirstWeek = weekStartsOn - startWeekDay;
+ if (lastDayOfFirstWeek <= 0)
+ lastDayOfFirstWeek += 7;
+ var remainingDaysAfterFirstWeek = currentDayOfMonth - lastDayOfFirstWeek;
+ return Math.ceil(remainingDaysAfterFirstWeek / 7) + 1;
+}
+// lib/lastDayOfMonth.js
+function _lastDayOfMonth(date, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ var month = _date.getMonth();
+ _date.setFullYear(_date.getFullYear(), month + 1, 0);
+ _date.setHours(0, 0, 0, 0);
+ return _toDate(_date, options === null || options === void 0 ? void 0 : options.in);
+}
+
+// lib/getWeeksInMonth.js
+function _getWeeksInMonth(date, options) {
+ var contextDate = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ return _differenceInCalendarWeeks(_lastDayOfMonth(contextDate, options), _startOfMonth(contextDate, options), options) + 1;
+}
+// lib/getYear.js
+function _getYear(date, options) {
+ return _toDate(date, options === null || options === void 0 ? void 0 : options.in).getFullYear();
+}
+// lib/hoursToMilliseconds.js
+function _hoursToMilliseconds(hours) {
+ return Math.trunc(hours * millisecondsInHour);
+}
+// lib/hoursToMinutes.js
+function _hoursToMinutes(hours) {
+ return Math.trunc(hours * minutesInHour);
+}
+// lib/hoursToSeconds.js
+function _hoursToSeconds(hours) {
+ return Math.trunc(hours * secondsInHour);
+}
+// lib/interval.js
+function _interval(start, end, options) {
+ var _normalizeDates41 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, start, end),_normalizeDates42 = _slicedToArray(_normalizeDates41, 2),_start = _normalizeDates42[0],_end = _normalizeDates42[1];
+ if (isNaN(+_start))
+ throw new TypeError("Start date is invalid");
+ if (isNaN(+_end))
+ throw new TypeError("End date is invalid");
+ if (options !== null && options !== void 0 && options.assertPositive && +_start > +_end)
+ throw new TypeError("End date must be after start date");
+ return { start: _start, end: _end };
+}
+// lib/intervalToDuration.js
+function _intervalToDuration(interval2, options) {
+ var _normalizeInterval9 = normalizeInterval(options === null || options === void 0 ? void 0 : options.in, interval2),start = _normalizeInterval9.start,end = _normalizeInterval9.end;
+ var duration = {};
+ var years = _differenceInYears(end, start);
+ if (years)
+ duration.years = years;
+ var remainingMonths = _add(start, { years: duration.years });
+ var months2 = _differenceInMonths(end, remainingMonths);
+ if (months2)
+ duration.months = months2;
+ var remainingDays = _add(remainingMonths, { months: duration.months });
+ var days2 = _differenceInDays(end, remainingDays);
+ if (days2)
+ duration.days = days2;
+ var remainingHours = _add(remainingDays, { days: duration.days });
+ var hours = _differenceInHours(end, remainingHours);
+ if (hours)
+ duration.hours = hours;
+ var remainingMinutes = _add(remainingHours, { hours: duration.hours });
+ var minutes = _differenceInMinutes(end, remainingMinutes);
+ if (minutes)
+ duration.minutes = minutes;
+ var remainingSeconds = _add(remainingMinutes, { minutes: duration.minutes });
+ var seconds = _differenceInSeconds(end, remainingSeconds);
+ if (seconds)
+ duration.seconds = seconds;
+ return duration;
+}
+// lib/intlFormat.js
+function _intlFormat(date, formatOrLocale, localeOptions) {var _localeOptions;
+ var formatOptions;
+ if (isFormatOptions(formatOrLocale)) {
+ formatOptions = formatOrLocale;
+ } else {
+ localeOptions = formatOrLocale;
+ }
+ return new Intl.DateTimeFormat((_localeOptions = localeOptions) === null || _localeOptions === void 0 ? void 0 : _localeOptions.locale, formatOptions).format(_toDate(date));
+}
+function isFormatOptions(opts) {
+ return opts !== undefined && !("locale" in opts);
+}
+// lib/intlFormatDistance.js
+function _intlFormatDistance(laterDate, earlierDate, options) {
+ var value = 0;
+ var unit;
+ var _normalizeDates43 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates44 = _slicedToArray(_normalizeDates43, 2),laterDate_ = _normalizeDates44[0],earlierDate_ = _normalizeDates44[1];
+ if (!(options !== null && options !== void 0 && options.unit)) {
+ var diffInSeconds = _differenceInSeconds(laterDate_, earlierDate_);
+ if (Math.abs(diffInSeconds) < secondsInMinute) {
+ value = _differenceInSeconds(laterDate_, earlierDate_);
+ unit = "second";
+ } else if (Math.abs(diffInSeconds) < secondsInHour) {
+ value = _differenceInMinutes(laterDate_, earlierDate_);
+ unit = "minute";
+ } else if (Math.abs(diffInSeconds) < secondsInDay && Math.abs(_differenceInCalendarDays(laterDate_, earlierDate_)) < 1) {
+ value = _differenceInHours(laterDate_, earlierDate_);
+ unit = "hour";
+ } else if (Math.abs(diffInSeconds) < secondsInWeek && (value = _differenceInCalendarDays(laterDate_, earlierDate_)) && Math.abs(value) < 7) {
+ unit = "day";
+ } else if (Math.abs(diffInSeconds) < secondsInMonth) {
+ value = _differenceInCalendarWeeks(laterDate_, earlierDate_);
+ unit = "week";
+ } else if (Math.abs(diffInSeconds) < secondsInQuarter) {
+ value = _differenceInCalendarMonths(laterDate_, earlierDate_);
+ unit = "month";
+ } else if (Math.abs(diffInSeconds) < secondsInYear) {
+ if (_differenceInCalendarQuarters(laterDate_, earlierDate_) < 4) {
+ value = _differenceInCalendarQuarters(laterDate_, earlierDate_);
+ unit = "quarter";
+ } else {
+ value = _differenceInCalendarYears(laterDate_, earlierDate_);
+ unit = "year";
+ }
+ } else {
+ value = _differenceInCalendarYears(laterDate_, earlierDate_);
+ unit = "year";
+ }
+ } else {
+ unit = options === null || options === void 0 ? void 0 : options.unit;
+ if (unit === "second") {
+ value = _differenceInSeconds(laterDate_, earlierDate_);
+ } else if (unit === "minute") {
+ value = _differenceInMinutes(laterDate_, earlierDate_);
+ } else if (unit === "hour") {
+ value = _differenceInHours(laterDate_, earlierDate_);
+ } else if (unit === "day") {
+ value = _differenceInCalendarDays(laterDate_, earlierDate_);
+ } else if (unit === "week") {
+ value = _differenceInCalendarWeeks(laterDate_, earlierDate_);
+ } else if (unit === "month") {
+ value = _differenceInCalendarMonths(laterDate_, earlierDate_);
+ } else if (unit === "quarter") {
+ value = _differenceInCalendarQuarters(laterDate_, earlierDate_);
+ } else if (unit === "year") {
+ value = _differenceInCalendarYears(laterDate_, earlierDate_);
+ }
+ }
+ var rtf = new Intl.RelativeTimeFormat(options === null || options === void 0 ? void 0 : options.locale, _objectSpread({
+ numeric: "auto" },
+ options)
+ );
+ return rtf.format(value, unit);
+}
+// lib/isAfter.js
+function _isAfter(date, dateToCompare) {
+ return +_toDate(date) > +_toDate(dateToCompare);
+}
+// lib/isBefore.js
+function _isBefore(date, dateToCompare) {
+ return +_toDate(date) < +_toDate(dateToCompare);
+}
+// lib/isEqual.js
+function _isEqual(leftDate, rightDate) {
+ return +_toDate(leftDate) === +_toDate(rightDate);
+}
+// lib/isExists.js
+function _isExists(year, month, day) {
+ var date = new Date(year, month, day);
+ return date.getFullYear() === year && date.getMonth() === month && date.getDate() === day;
+}
+// lib/isFirstDayOfMonth.js
+function _isFirstDayOfMonth(date, options) {
+ return _toDate(date, options === null || options === void 0 ? void 0 : options.in).getDate() === 1;
+}
+// lib/isFriday.js
+function _isFriday(date, options) {
+ return _toDate(date, options === null || options === void 0 ? void 0 : options.in).getDay() === 5;
+}
+// lib/isFuture.js
+function _isFuture(date) {
+ return +_toDate(date) > Date.now();
+}
+// lib/transpose.js
+function _transpose(date, constructor) {
+ var date_ = isConstructor(constructor) ? new constructor(0) : _constructFrom(constructor, 0);
+ date_.setFullYear(date.getFullYear(), date.getMonth(), date.getDate());
+ date_.setHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
+ return date_;
+}
+function isConstructor(constructor) {var _constructor$prototyp;
+ return typeof constructor === "function" && ((_constructor$prototyp = constructor.prototype) === null || _constructor$prototyp === void 0 ? void 0 : _constructor$prototyp.constructor) === constructor;
+}
+
+// lib/parse/_lib/Setter.js
+var TIMEZONE_UNIT_PRIORITY = 10;var
+
+Setter = /*#__PURE__*/function () {function Setter() {_classCallCheck(this, Setter);_defineProperty(this, "subPriority",
+ 0);}_createClass(Setter, [{ key: "validate", value:
+ function validate(_utcDate, _options) {
+ return true;
+ } }]);return Setter;}();var
+
+
+ValueSetter = /*#__PURE__*/function (_Setter2) {_inherits(ValueSetter, _Setter2);
+ function ValueSetter(value, validateValue, setValue, priority, subPriority) {var _this;_classCallCheck(this, ValueSetter);
+ _this = _callSuper(this, ValueSetter);
+ _this.value = value;
+ _this.validateValue = validateValue;
+ _this.setValue = setValue;
+ _this.priority = priority;
+ if (subPriority) {
+ _this.subPriority = subPriority;
+ }return _this;
+ }_createClass(ValueSetter, [{ key: "validate", value:
+ function validate(date, options) {
+ return this.validateValue(date, this.value, options);
+ } }, { key: "set", value:
+ function set(date, flags, options) {
+ return this.setValue(date, flags, this.value, options);
+ } }]);return ValueSetter;}(Setter);var
+
+
+DateTimezoneSetter = /*#__PURE__*/function (_Setter3) {_inherits(DateTimezoneSetter, _Setter3);
+
+
+ function DateTimezoneSetter(context, reference) {var _this2;_classCallCheck(this, DateTimezoneSetter);
+ _this2 = _callSuper(this, DateTimezoneSetter);_defineProperty(_assertThisInitialized(_this2), "priority", TIMEZONE_UNIT_PRIORITY);_defineProperty(_assertThisInitialized(_this2), "subPriority", -1);
+ _this2.context = context || function (date) {return _constructFrom(reference, date);};return _this2;
+ }_createClass(DateTimezoneSetter, [{ key: "set", value:
+ function set(date, flags) {
+ if (flags.timestampIsSet)
+ return date;
+ return _constructFrom(date, _transpose(date, this.context));
+ } }]);return DateTimezoneSetter;}(Setter);
+
+
+// lib/parse/_lib/Parser.js
+var Parser = /*#__PURE__*/function () {function Parser() {_classCallCheck(this, Parser);}_createClass(Parser, [{ key: "run", value:
+ function run(dateString, token, match3, options) {
+ var result = this.parse(dateString, token, match3, options);
+ if (!result) {
+ return null;
+ }
+ return {
+ setter: new ValueSetter(result.value, this.validate, this.set, this.priority, this.subPriority),
+ rest: result.rest
+ };
+ } }, { key: "validate", value:
+ function validate(_utcDate, _value, _options) {
+ return true;
+ } }]);return Parser;}();
+
+
+// lib/parse/_lib/parsers/EraParser.js
+var EraParser = /*#__PURE__*/function (_Parser) {_inherits(EraParser, _Parser);function EraParser() {var _this3;_classCallCheck(this, EraParser);for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {args[_key2] = arguments[_key2];}_this3 = _callSuper(this, EraParser, [].concat(args));_defineProperty(_assertThisInitialized(_this3), "priority",
+ 140);_defineProperty(_assertThisInitialized(_this3), "incompatibleTokens",
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ["R", "u", "t", "T"]);return _this3;}_createClass(EraParser, [{ key: "parse", value: function parse(dateString, token, match3) {switch (token) {case "G":case "GG":case "GGG":return match3.era(dateString, { width: "abbreviated" }) || match3.era(dateString, { width: "narrow" });case "GGGGG":return match3.era(dateString, { width: "narrow" });case "GGGG":default:return match3.era(dateString, { width: "wide" }) || match3.era(dateString, { width: "abbreviated" }) || match3.era(dateString, { width: "narrow" });}} }, { key: "set", value: function set(date, flags, value) {flags.era = value;date.setFullYear(value, 0, 1);date.setHours(0, 0, 0, 0);return date;} }]);return EraParser;}(Parser);
+
+
+// lib/parse/_lib/constants.js
+var numericPatterns = {
+ month: /^(1[0-2]|0?\d)/,
+ date: /^(3[0-1]|[0-2]?\d)/,
+ dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,
+ week: /^(5[0-3]|[0-4]?\d)/,
+ hour23h: /^(2[0-3]|[0-1]?\d)/,
+ hour24h: /^(2[0-4]|[0-1]?\d)/,
+ hour11h: /^(1[0-1]|0?\d)/,
+ hour12h: /^(1[0-2]|0?\d)/,
+ minute: /^[0-5]?\d/,
+ second: /^[0-5]?\d/,
+ singleDigit: /^\d/,
+ twoDigits: /^\d{1,2}/,
+ threeDigits: /^\d{1,3}/,
+ fourDigits: /^\d{1,4}/,
+ anyDigitsSigned: /^-?\d+/,
+ singleDigitSigned: /^-?\d/,
+ twoDigitsSigned: /^-?\d{1,2}/,
+ threeDigitsSigned: /^-?\d{1,3}/,
+ fourDigitsSigned: /^-?\d{1,4}/
+};
+var timezonePatterns = {
+ basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
+ basic: /^([+-])(\d{2})(\d{2})|Z/,
+ basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
+ extended: /^([+-])(\d{2}):(\d{2})|Z/,
+ extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
+};
+
+// lib/parse/_lib/utils.js
+function mapValue(parseFnResult, mapFn) {
+ if (!parseFnResult) {
+ return parseFnResult;
+ }
+ return {
+ value: mapFn(parseFnResult.value),
+ rest: parseFnResult.rest
+ };
+}
+function parseNumericPattern(pattern, dateString) {
+ var matchResult = dateString.match(pattern);
+ if (!matchResult) {
+ return null;
+ }
+ return {
+ value: parseInt(matchResult[0], 10),
+ rest: dateString.slice(matchResult[0].length)
+ };
+}
+function parseTimezonePattern(pattern, dateString) {
+ var matchResult = dateString.match(pattern);
+ if (!matchResult) {
+ return null;
+ }
+ if (matchResult[0] === "Z") {
+ return {
+ value: 0,
+ rest: dateString.slice(1)
+ };
+ }
+ var sign = matchResult[1] === "+" ? 1 : -1;
+ var hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;
+ var minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;
+ var seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;
+ return {
+ value: sign * (hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * millisecondsInSecond),
+ rest: dateString.slice(matchResult[0].length)
+ };
+}
+function parseAnyDigitsSigned(dateString) {
+ return parseNumericPattern(numericPatterns.anyDigitsSigned, dateString);
+}
+function parseNDigits(n, dateString) {
+ switch (n) {
+ case 1:
+ return parseNumericPattern(numericPatterns.singleDigit, dateString);
+ case 2:
+ return parseNumericPattern(numericPatterns.twoDigits, dateString);
+ case 3:
+ return parseNumericPattern(numericPatterns.threeDigits, dateString);
+ case 4:
+ return parseNumericPattern(numericPatterns.fourDigits, dateString);
+ default:
+ return parseNumericPattern(new RegExp("^\\d{1," + n + "}"), dateString);
+ }
+}
+function parseNDigitsSigned(n, dateString) {
+ switch (n) {
+ case 1:
+ return parseNumericPattern(numericPatterns.singleDigitSigned, dateString);
+ case 2:
+ return parseNumericPattern(numericPatterns.twoDigitsSigned, dateString);
+ case 3:
+ return parseNumericPattern(numericPatterns.threeDigitsSigned, dateString);
+ case 4:
+ return parseNumericPattern(numericPatterns.fourDigitsSigned, dateString);
+ default:
+ return parseNumericPattern(new RegExp("^-?\\d{1," + n + "}"), dateString);
+ }
+}
+function dayPeriodEnumToHours(dayPeriod) {
+ switch (dayPeriod) {
+ case "morning":
+ return 4;
+ case "evening":
+ return 17;
+ case "pm":
+ case "noon":
+ case "afternoon":
+ return 12;
+ case "am":
+ case "midnight":
+ case "night":
+ default:
+ return 0;
+ }
+}
+function normalizeTwoDigitYear(twoDigitYear, currentYear) {
+ var isCommonEra = currentYear > 0;
+ var absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;
+ var result;
+ if (absCurrentYear <= 50) {
+ result = twoDigitYear || 100;
+ } else {
+ var rangeEnd = absCurrentYear + 50;
+ var rangeEndCentury = Math.trunc(rangeEnd / 100) * 100;
+ var isPreviousCentury = twoDigitYear >= rangeEnd % 100;
+ result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);
+ }
+ return isCommonEra ? result : 1 - result;
+}
+function isLeapYearIndex(year) {
+ return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
+}
+
+// lib/parse/_lib/parsers/YearParser.js
+var YearParser = /*#__PURE__*/function (_Parser2) {_inherits(YearParser, _Parser2);function YearParser() {var _this4;_classCallCheck(this, YearParser);for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {args[_key3] = arguments[_key3];}_this4 = _callSuper(this, YearParser, [].concat(args));_defineProperty(_assertThisInitialized(_this4), "priority",
+ 130);_defineProperty(_assertThisInitialized(_this4), "incompatibleTokens",
+ ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"]);return _this4;}_createClass(YearParser, [{ key: "parse", value:
+ function parse(dateString, token, match3) {
+ var valueCallback = function valueCallback(year) {return {
+ year: year,
+ isTwoDigitYear: token === "yy"
+ };};
+ switch (token) {
+ case "y":
+ return mapValue(parseNDigits(4, dateString), valueCallback);
+ case "yo":
+ return mapValue(match3.ordinalNumber(dateString, {
+ unit: "year"
+ }), valueCallback);
+ default:
+ return mapValue(parseNDigits(token.length, dateString), valueCallback);
+ }
+ } }, { key: "validate", value:
+ function validate(_date, value) {
+ return value.isTwoDigitYear || value.year > 0;
+ } }, { key: "set", value:
+ function set(date, flags, value) {
+ var currentYear = date.getFullYear();
+ if (value.isTwoDigitYear) {
+ var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);
+ date.setFullYear(normalizedTwoDigitYear, 0, 1);
+ date.setHours(0, 0, 0, 0);
+ return date;
+ }
+ var year = !("era" in flags) || flags.era === 1 ? value.year : 1 - value.year;
+ date.setFullYear(year, 0, 1);
+ date.setHours(0, 0, 0, 0);
+ return date;
+ } }]);return YearParser;}(Parser);
+
+
+// lib/parse/_lib/parsers/LocalWeekYearParser.js
+var LocalWeekYearParser = /*#__PURE__*/function (_Parser3) {_inherits(LocalWeekYearParser, _Parser3);function LocalWeekYearParser() {var _this5;_classCallCheck(this, LocalWeekYearParser);for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}_this5 = _callSuper(this, LocalWeekYearParser, [].concat(args));_defineProperty(_assertThisInitialized(_this5), "priority",
+ 130);_defineProperty(_assertThisInitialized(_this5), "incompatibleTokens",
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [
+ "y",
+ "R",
+ "u",
+ "Q",
+ "q",
+ "M",
+ "L",
+ "I",
+ "d",
+ "D",
+ "i",
+ "t",
+ "T"]);return _this5;}_createClass(LocalWeekYearParser, [{ key: "parse", value: function parse(dateString, token, match3) {var valueCallback = function valueCallback(year) {return { year: year, isTwoDigitYear: token === "YY" };};switch (token) {case "Y":return mapValue(parseNDigits(4, dateString), valueCallback);case "Yo":return mapValue(match3.ordinalNumber(dateString, { unit: "year" }), valueCallback);default:return mapValue(parseNDigits(token.length, dateString), valueCallback);}} }, { key: "validate", value: function validate(_date, value) {return value.isTwoDigitYear || value.year > 0;} }, { key: "set", value: function set(date, flags, value, options) {var currentYear = _getWeekYear(date, options);if (value.isTwoDigitYear) {var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);date.setFullYear(normalizedTwoDigitYear, 0, options.firstWeekContainsDate);date.setHours(0, 0, 0, 0);return _startOfWeek(date, options);}var year = !("era" in flags) || flags.era === 1 ? value.year : 1 - value.year;date.setFullYear(year, 0, options.firstWeekContainsDate);date.setHours(0, 0, 0, 0);return _startOfWeek(date, options);} }]);return LocalWeekYearParser;}(Parser);
+
+
+
+// lib/parse/_lib/parsers/ISOWeekYearParser.js
+var ISOWeekYearParser = /*#__PURE__*/function (_Parser4) {_inherits(ISOWeekYearParser, _Parser4);function ISOWeekYearParser() {var _this6;_classCallCheck(this, ISOWeekYearParser);for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}_this6 = _callSuper(this, ISOWeekYearParser, [].concat(args));_defineProperty(_assertThisInitialized(_this6), "priority",
+ 130);_defineProperty(_assertThisInitialized(_this6), "incompatibleTokens",
+
+
+
+
+
+
+
+
+
+
+
+
+ [
+ "G",
+ "y",
+ "Y",
+ "u",
+ "Q",
+ "q",
+ "M",
+ "L",
+ "w",
+ "d",
+ "D",
+ "e",
+ "c",
+ "t",
+ "T"]);return _this6;}_createClass(ISOWeekYearParser, [{ key: "parse", value: function parse(dateString, token) {if (token === "R") {return parseNDigitsSigned(4, dateString);}return parseNDigitsSigned(token.length, dateString);} }, { key: "set", value: function set(date, _flags, value) {var firstWeekOfYear = _constructFrom(date, 0);firstWeekOfYear.setFullYear(value, 0, 4);firstWeekOfYear.setHours(0, 0, 0, 0);return _startOfISOWeek(firstWeekOfYear);} }]);return ISOWeekYearParser;}(Parser);
+
+
+
+// lib/parse/_lib/parsers/ExtendedYearParser.js
+var ExtendedYearParser = /*#__PURE__*/function (_Parser5) {_inherits(ExtendedYearParser, _Parser5);function ExtendedYearParser() {var _this7;_classCallCheck(this, ExtendedYearParser);for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {args[_key6] = arguments[_key6];}_this7 = _callSuper(this, ExtendedYearParser, [].concat(args));_defineProperty(_assertThisInitialized(_this7), "priority",
+ 130);_defineProperty(_assertThisInitialized(_this7), "incompatibleTokens",
+
+
+
+
+
+
+
+
+
+
+
+ ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"]);return _this7;}_createClass(ExtendedYearParser, [{ key: "parse", value: function parse(dateString, token) {if (token === "u") {return parseNDigitsSigned(4, dateString);}return parseNDigitsSigned(token.length, dateString);} }, { key: "set", value: function set(date, _flags, value) {date.setFullYear(value, 0, 1);date.setHours(0, 0, 0, 0);return date;} }]);return ExtendedYearParser;}(Parser);
+
+
+// lib/parse/_lib/parsers/QuarterParser.js
+var QuarterParser = /*#__PURE__*/function (_Parser6) {_inherits(QuarterParser, _Parser6);function QuarterParser() {var _this8;_classCallCheck(this, QuarterParser);for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {args[_key7] = arguments[_key7];}_this8 = _callSuper(this, QuarterParser, [].concat(args));_defineProperty(_assertThisInitialized(_this8), "priority",
+ 120);_defineProperty(_assertThisInitialized(_this8), "incompatibleTokens",
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [
+ "Y",
+ "R",
+ "q",
+ "M",
+ "L",
+ "w",
+ "I",
+ "d",
+ "D",
+ "i",
+ "e",
+ "c",
+ "t",
+ "T"]);return _this8;}_createClass(QuarterParser, [{ key: "parse", value: function parse(dateString, token, match3) {switch (token) {case "Q":case "QQ":return parseNDigits(token.length, dateString);case "Qo":return match3.ordinalNumber(dateString, { unit: "quarter" });case "QQQ":return match3.quarter(dateString, { width: "abbreviated", context: "formatting" }) || match3.quarter(dateString, { width: "narrow", context: "formatting" });case "QQQQQ":return match3.quarter(dateString, { width: "narrow", context: "formatting" });case "QQQQ":default:return match3.quarter(dateString, { width: "wide", context: "formatting" }) || match3.quarter(dateString, { width: "abbreviated", context: "formatting" }) || match3.quarter(dateString, { width: "narrow", context: "formatting" });}} }, { key: "validate", value: function validate(_date, value) {return value >= 1 && value <= 4;} }, { key: "set", value: function set(date, _flags, value) {date.setMonth((value - 1) * 3, 1);date.setHours(0, 0, 0, 0);return date;} }]);return QuarterParser;}(Parser);
+
+
+
+// lib/parse/_lib/parsers/StandAloneQuarterParser.js
+var StandAloneQuarterParser = /*#__PURE__*/function (_Parser7) {_inherits(StandAloneQuarterParser, _Parser7);function StandAloneQuarterParser() {var _this9;_classCallCheck(this, StandAloneQuarterParser);for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {args[_key8] = arguments[_key8];}_this9 = _callSuper(this, StandAloneQuarterParser, [].concat(args));_defineProperty(_assertThisInitialized(_this9), "priority",
+ 120);_defineProperty(_assertThisInitialized(_this9), "incompatibleTokens",
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [
+ "Y",
+ "R",
+ "Q",
+ "M",
+ "L",
+ "w",
+ "I",
+ "d",
+ "D",
+ "i",
+ "e",
+ "c",
+ "t",
+ "T"]);return _this9;}_createClass(StandAloneQuarterParser, [{ key: "parse", value: function parse(dateString, token, match3) {switch (token) {case "q":case "qq":return parseNDigits(token.length, dateString);case "qo":return match3.ordinalNumber(dateString, { unit: "quarter" });case "qqq":return match3.quarter(dateString, { width: "abbreviated", context: "standalone" }) || match3.quarter(dateString, { width: "narrow", context: "standalone" });case "qqqqq":return match3.quarter(dateString, { width: "narrow", context: "standalone" });case "qqqq":default:return match3.quarter(dateString, { width: "wide", context: "standalone" }) || match3.quarter(dateString, { width: "abbreviated", context: "standalone" }) || match3.quarter(dateString, { width: "narrow", context: "standalone" });}} }, { key: "validate", value: function validate(_date, value) {return value >= 1 && value <= 4;} }, { key: "set", value: function set(date, _flags, value) {date.setMonth((value - 1) * 3, 1);date.setHours(0, 0, 0, 0);return date;} }]);return StandAloneQuarterParser;}(Parser);
+
+
+
+// lib/parse/_lib/parsers/MonthParser.js
+var MonthParser = /*#__PURE__*/function (_Parser8) {_inherits(MonthParser, _Parser8);function MonthParser() {var _this10;_classCallCheck(this, MonthParser);for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {args[_key9] = arguments[_key9];}_this10 = _callSuper(this, MonthParser, [].concat(args));_defineProperty(_assertThisInitialized(_this10), "incompatibleTokens",
+ [
+ "Y",
+ "R",
+ "q",
+ "Q",
+ "L",
+ "w",
+ "I",
+ "D",
+ "i",
+ "e",
+ "c",
+ "t",
+ "T"]);_defineProperty(_assertThisInitialized(_this10), "priority",
+
+ 110);return _this10;}_createClass(MonthParser, [{ key: "parse", value:
+ function parse(dateString, token, match3) {
+ var valueCallback = function valueCallback(value) {return value - 1;};
+ switch (token) {
+ case "M":
+ return mapValue(parseNumericPattern(numericPatterns.month, dateString), valueCallback);
+ case "MM":
+ return mapValue(parseNDigits(2, dateString), valueCallback);
+ case "Mo":
+ return mapValue(match3.ordinalNumber(dateString, {
+ unit: "month"
+ }), valueCallback);
+ case "MMM":
+ return match3.month(dateString, {
+ width: "abbreviated",
+ context: "formatting"
+ }) || match3.month(dateString, { width: "narrow", context: "formatting" });
+ case "MMMMM":
+ return match3.month(dateString, {
+ width: "narrow",
+ context: "formatting"
+ });
+ case "MMMM":
+ default:
+ return match3.month(dateString, { width: "wide", context: "formatting" }) || match3.month(dateString, {
+ width: "abbreviated",
+ context: "formatting"
+ }) || match3.month(dateString, { width: "narrow", context: "formatting" });
+ }
+ } }, { key: "validate", value:
+ function validate(_date, value) {
+ return value >= 0 && value <= 11;
+ } }, { key: "set", value:
+ function set(date, _flags, value) {
+ date.setMonth(value, 1);
+ date.setHours(0, 0, 0, 0);
+ return date;
+ } }]);return MonthParser;}(Parser);
+
+
+// lib/parse/_lib/parsers/StandAloneMonthParser.js
+var StandAloneMonthParser = /*#__PURE__*/function (_Parser9) {_inherits(StandAloneMonthParser, _Parser9);function StandAloneMonthParser() {var _this11;_classCallCheck(this, StandAloneMonthParser);for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {args[_key10] = arguments[_key10];}_this11 = _callSuper(this, StandAloneMonthParser, [].concat(args));_defineProperty(_assertThisInitialized(_this11), "priority",
+ 110);_defineProperty(_assertThisInitialized(_this11), "incompatibleTokens",
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [
+ "Y",
+ "R",
+ "q",
+ "Q",
+ "M",
+ "w",
+ "I",
+ "D",
+ "i",
+ "e",
+ "c",
+ "t",
+ "T"]);return _this11;}_createClass(StandAloneMonthParser, [{ key: "parse", value: function parse(dateString, token, match3) {var valueCallback = function valueCallback(value) {return value - 1;};switch (token) {case "L":return mapValue(parseNumericPattern(numericPatterns.month, dateString), valueCallback);case "LL":return mapValue(parseNDigits(2, dateString), valueCallback);case "Lo":return mapValue(match3.ordinalNumber(dateString, { unit: "month" }), valueCallback);case "LLL":return match3.month(dateString, { width: "abbreviated", context: "standalone" }) || match3.month(dateString, { width: "narrow", context: "standalone" });case "LLLLL":return match3.month(dateString, { width: "narrow", context: "standalone" });case "LLLL":default:return match3.month(dateString, { width: "wide", context: "standalone" }) || match3.month(dateString, { width: "abbreviated", context: "standalone" }) || match3.month(dateString, { width: "narrow", context: "standalone" });}} }, { key: "validate", value: function validate(_date, value) {return value >= 0 && value <= 11;} }, { key: "set", value: function set(date, _flags, value) {date.setMonth(value, 1);date.setHours(0, 0, 0, 0);return date;} }]);return StandAloneMonthParser;}(Parser);
+
+
+
+// lib/setWeek.js
+function _setWeek(date, week, options) {
+ var date_ = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ var diff = _getWeek(date_, options) - week;
+ date_.setDate(date_.getDate() - diff * 7);
+ return _toDate(date_, options === null || options === void 0 ? void 0 : options.in);
+}
+
+// lib/parse/_lib/parsers/LocalWeekParser.js
+var LocalWeekParser = /*#__PURE__*/function (_Parser10) {_inherits(LocalWeekParser, _Parser10);function LocalWeekParser() {var _this12;_classCallCheck(this, LocalWeekParser);for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) {args[_key11] = arguments[_key11];}_this12 = _callSuper(this, LocalWeekParser, [].concat(args));_defineProperty(_assertThisInitialized(_this12), "priority",
+ 100);_defineProperty(_assertThisInitialized(_this12), "incompatibleTokens",
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [
+ "y",
+ "R",
+ "u",
+ "q",
+ "Q",
+ "M",
+ "L",
+ "I",
+ "d",
+ "D",
+ "i",
+ "t",
+ "T"]);return _this12;}_createClass(LocalWeekParser, [{ key: "parse", value: function parse(dateString, token, match3) {switch (token) {case "w":return parseNumericPattern(numericPatterns.week, dateString);case "wo":return match3.ordinalNumber(dateString, { unit: "week" });default:return parseNDigits(token.length, dateString);}} }, { key: "validate", value: function validate(_date, value) {return value >= 1 && value <= 53;} }, { key: "set", value: function set(date, _flags, value, options) {return _startOfWeek(_setWeek(date, value, options), options);} }]);return LocalWeekParser;}(Parser);
+
+
+
+// lib/setISOWeek.js
+function _setISOWeek(date, week, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ var diff = _getISOWeek(_date, options) - week;
+ _date.setDate(_date.getDate() - diff * 7);
+ return _date;
+}
+
+// lib/parse/_lib/parsers/ISOWeekParser.js
+var ISOWeekParser = /*#__PURE__*/function (_Parser11) {_inherits(ISOWeekParser, _Parser11);function ISOWeekParser() {var _this13;_classCallCheck(this, ISOWeekParser);for (var _len12 = arguments.length, args = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) {args[_key12] = arguments[_key12];}_this13 = _callSuper(this, ISOWeekParser, [].concat(args));_defineProperty(_assertThisInitialized(_this13), "priority",
+ 100);_defineProperty(_assertThisInitialized(_this13), "incompatibleTokens",
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [
+ "y",
+ "Y",
+ "u",
+ "q",
+ "Q",
+ "M",
+ "L",
+ "w",
+ "d",
+ "D",
+ "e",
+ "c",
+ "t",
+ "T"]);return _this13;}_createClass(ISOWeekParser, [{ key: "parse", value: function parse(dateString, token, match3) {switch (token) {case "I":return parseNumericPattern(numericPatterns.week, dateString);case "Io":return match3.ordinalNumber(dateString, { unit: "week" });default:return parseNDigits(token.length, dateString);}} }, { key: "validate", value: function validate(_date, value) {return value >= 1 && value <= 53;} }, { key: "set", value: function set(date, _flags, value) {return _startOfISOWeek(_setISOWeek(date, value));} }]);return ISOWeekParser;}(Parser);
+
+
+
+// lib/parse/_lib/parsers/DateParser.js
+var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
+var DAYS_IN_MONTH_LEAP_YEAR = [
+31,
+29,
+31,
+30,
+31,
+30,
+31,
+31,
+30,
+31,
+30,
+31];var
+
+
+DateParser = /*#__PURE__*/function (_Parser12) {_inherits(DateParser, _Parser12);function DateParser() {var _this14;_classCallCheck(this, DateParser);for (var _len13 = arguments.length, args = new Array(_len13), _key13 = 0; _key13 < _len13; _key13++) {args[_key13] = arguments[_key13];}_this14 = _callSuper(this, DateParser, [].concat(args));_defineProperty(_assertThisInitialized(_this14), "priority",
+ 90);_defineProperty(_assertThisInitialized(_this14), "subPriority",
+ 1);_defineProperty(_assertThisInitialized(_this14), "incompatibleTokens",
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [
+ "Y",
+ "R",
+ "q",
+ "Q",
+ "w",
+ "I",
+ "D",
+ "i",
+ "e",
+ "c",
+ "t",
+ "T"]);return _this14;}_createClass(DateParser, [{ key: "parse", value: function parse(dateString, token, match3) {switch (token) {case "d":return parseNumericPattern(numericPatterns.date, dateString);case "do":return match3.ordinalNumber(dateString, { unit: "date" });default:return parseNDigits(token.length, dateString);}} }, { key: "validate", value: function validate(date, value) {var year = date.getFullYear();var isLeapYear3 = isLeapYearIndex(year);var month = date.getMonth();if (isLeapYear3) {return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];} else {return value >= 1 && value <= DAYS_IN_MONTH[month];}} }, { key: "set", value: function set(date, _flags, value) {date.setDate(value);date.setHours(0, 0, 0, 0);return date;} }]);return DateParser;}(Parser);
+
+
+
+// lib/parse/_lib/parsers/DayOfYearParser.js
+var DayOfYearParser = /*#__PURE__*/function (_Parser13) {_inherits(DayOfYearParser, _Parser13);function DayOfYearParser() {var _this15;_classCallCheck(this, DayOfYearParser);for (var _len14 = arguments.length, args = new Array(_len14), _key14 = 0; _key14 < _len14; _key14++) {args[_key14] = arguments[_key14];}_this15 = _callSuper(this, DayOfYearParser, [].concat(args));_defineProperty(_assertThisInitialized(_this15), "priority",
+ 90);_defineProperty(_assertThisInitialized(_this15), "subpriority",
+ 1);_defineProperty(_assertThisInitialized(_this15), "incompatibleTokens",
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [
+ "Y",
+ "R",
+ "q",
+ "Q",
+ "M",
+ "L",
+ "w",
+ "I",
+ "d",
+ "E",
+ "i",
+ "e",
+ "c",
+ "t",
+ "T"]);return _this15;}_createClass(DayOfYearParser, [{ key: "parse", value: function parse(dateString, token, match3) {switch (token) {case "D":case "DD":return parseNumericPattern(numericPatterns.dayOfYear, dateString);case "Do":return match3.ordinalNumber(dateString, { unit: "date" });default:return parseNDigits(token.length, dateString);}} }, { key: "validate", value: function validate(date, value) {var year = date.getFullYear();var isLeapYear3 = isLeapYearIndex(year);if (isLeapYear3) {return value >= 1 && value <= 366;} else {return value >= 1 && value <= 365;}} }, { key: "set", value: function set(date, _flags, value) {date.setMonth(0, value);date.setHours(0, 0, 0, 0);return date;} }]);return DayOfYearParser;}(Parser);
+
+
+
+// lib/setDay.js
+function _setDay(date, day, options) {var _ref30, _ref31, _ref32, _options$weekStartsOn6, _options$locale14, _defaultOptions14$loc;
+ var defaultOptions14 = getDefaultOptions();
+ var weekStartsOn = (_ref30 = (_ref31 = (_ref32 = (_options$weekStartsOn6 = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn6 !== void 0 ? _options$weekStartsOn6 : options === null || options === void 0 || (_options$locale14 = options.locale) === null || _options$locale14 === void 0 || (_options$locale14 = _options$locale14.options) === null || _options$locale14 === void 0 ? void 0 : _options$locale14.weekStartsOn) !== null && _ref32 !== void 0 ? _ref32 : defaultOptions14.weekStartsOn) !== null && _ref31 !== void 0 ? _ref31 : (_defaultOptions14$loc = defaultOptions14.locale) === null || _defaultOptions14$loc === void 0 || (_defaultOptions14$loc = _defaultOptions14$loc.options) === null || _defaultOptions14$loc === void 0 ? void 0 : _defaultOptions14$loc.weekStartsOn) !== null && _ref30 !== void 0 ? _ref30 : 0;
+ var date_ = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ var currentDay = date_.getDay();
+ var remainder = day % 7;
+ var dayIndex = (remainder + 7) % 7;
+ var delta = 7 - weekStartsOn;
+ var diff = day < 0 || day > 6 ? day - (currentDay + delta) % 7 : (dayIndex + delta) % 7 - (currentDay + delta) % 7;
+ return _addDays(date_, diff, options);
+}
+
+// lib/parse/_lib/parsers/DayParser.js
+var DayParser = /*#__PURE__*/function (_Parser14) {_inherits(DayParser, _Parser14);function DayParser() {var _this16;_classCallCheck(this, DayParser);for (var _len15 = arguments.length, args = new Array(_len15), _key15 = 0; _key15 < _len15; _key15++) {args[_key15] = arguments[_key15];}_this16 = _callSuper(this, DayParser, [].concat(args));_defineProperty(_assertThisInitialized(_this16), "priority",
+ 90);_defineProperty(_assertThisInitialized(_this16), "incompatibleTokens",
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ["D", "i", "e", "c", "t", "T"]);return _this16;}_createClass(DayParser, [{ key: "parse", value: function parse(dateString, token, match3) {switch (token) {case "E":case "EE":case "EEE":return match3.day(dateString, { width: "abbreviated", context: "formatting" }) || match3.day(dateString, { width: "short", context: "formatting" }) || match3.day(dateString, { width: "narrow", context: "formatting" });case "EEEEE":return match3.day(dateString, { width: "narrow", context: "formatting" });case "EEEEEE":return match3.day(dateString, { width: "short", context: "formatting" }) || match3.day(dateString, { width: "narrow", context: "formatting" });case "EEEE":default:return match3.day(dateString, { width: "wide", context: "formatting" }) || match3.day(dateString, { width: "abbreviated", context: "formatting" }) || match3.day(dateString, { width: "short", context: "formatting" }) || match3.day(dateString, { width: "narrow", context: "formatting" });}} }, { key: "validate", value: function validate(_date, value) {return value >= 0 && value <= 6;} }, { key: "set", value: function set(date, _flags, value, options) {date = _setDay(date, value, options);date.setHours(0, 0, 0, 0);return date;} }]);return DayParser;}(Parser);
+
+
+// lib/parse/_lib/parsers/LocalDayParser.js
+var LocalDayParser = /*#__PURE__*/function (_Parser15) {_inherits(LocalDayParser, _Parser15);function LocalDayParser() {var _this17;_classCallCheck(this, LocalDayParser);for (var _len16 = arguments.length, args = new Array(_len16), _key16 = 0; _key16 < _len16; _key16++) {args[_key16] = arguments[_key16];}_this17 = _callSuper(this, LocalDayParser, [].concat(args));_defineProperty(_assertThisInitialized(_this17), "priority",
+ 90);_defineProperty(_assertThisInitialized(_this17), "incompatibleTokens",
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [
+ "y",
+ "R",
+ "u",
+ "q",
+ "Q",
+ "M",
+ "L",
+ "I",
+ "d",
+ "D",
+ "E",
+ "i",
+ "c",
+ "t",
+ "T"]);return _this17;}_createClass(LocalDayParser, [{ key: "parse", value: function parse(dateString, token, match3, options) {var valueCallback = function valueCallback(value) {var wholeWeekDays = Math.floor((value - 1) / 7) * 7;return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;};switch (token) {case "e":case "ee":return mapValue(parseNDigits(token.length, dateString), valueCallback);case "eo":return mapValue(match3.ordinalNumber(dateString, { unit: "day" }), valueCallback);case "eee":return match3.day(dateString, { width: "abbreviated", context: "formatting" }) || match3.day(dateString, { width: "short", context: "formatting" }) || match3.day(dateString, { width: "narrow", context: "formatting" });case "eeeee":return match3.day(dateString, { width: "narrow", context: "formatting" });case "eeeeee":return match3.day(dateString, { width: "short", context: "formatting" }) || match3.day(dateString, { width: "narrow", context: "formatting" });case "eeee":default:return match3.day(dateString, { width: "wide", context: "formatting" }) || match3.day(dateString, { width: "abbreviated", context: "formatting" }) || match3.day(dateString, { width: "short", context: "formatting" }) || match3.day(dateString, { width: "narrow", context: "formatting" });}} }, { key: "validate", value: function validate(_date, value) {return value >= 0 && value <= 6;} }, { key: "set", value: function set(date, _flags, value, options) {date = _setDay(date, value, options);date.setHours(0, 0, 0, 0);return date;} }]);return LocalDayParser;}(Parser);
+
+
+
+// lib/parse/_lib/parsers/StandAloneLocalDayParser.js
+var StandAloneLocalDayParser = /*#__PURE__*/function (_Parser16) {_inherits(StandAloneLocalDayParser, _Parser16);function StandAloneLocalDayParser() {var _this18;_classCallCheck(this, StandAloneLocalDayParser);for (var _len17 = arguments.length, args = new Array(_len17), _key17 = 0; _key17 < _len17; _key17++) {args[_key17] = arguments[_key17];}_this18 = _callSuper(this, StandAloneLocalDayParser, [].concat(args));_defineProperty(_assertThisInitialized(_this18), "priority",
+ 90);_defineProperty(_assertThisInitialized(_this18), "incompatibleTokens",
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [
+ "y",
+ "R",
+ "u",
+ "q",
+ "Q",
+ "M",
+ "L",
+ "I",
+ "d",
+ "D",
+ "E",
+ "i",
+ "e",
+ "t",
+ "T"]);return _this18;}_createClass(StandAloneLocalDayParser, [{ key: "parse", value: function parse(dateString, token, match3, options) {var valueCallback = function valueCallback(value) {var wholeWeekDays = Math.floor((value - 1) / 7) * 7;return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;};switch (token) {case "c":case "cc":return mapValue(parseNDigits(token.length, dateString), valueCallback);case "co":return mapValue(match3.ordinalNumber(dateString, { unit: "day" }), valueCallback);case "ccc":return match3.day(dateString, { width: "abbreviated", context: "standalone" }) || match3.day(dateString, { width: "short", context: "standalone" }) || match3.day(dateString, { width: "narrow", context: "standalone" });case "ccccc":return match3.day(dateString, { width: "narrow", context: "standalone" });case "cccccc":return match3.day(dateString, { width: "short", context: "standalone" }) || match3.day(dateString, { width: "narrow", context: "standalone" });case "cccc":default:return match3.day(dateString, { width: "wide", context: "standalone" }) || match3.day(dateString, { width: "abbreviated", context: "standalone" }) || match3.day(dateString, { width: "short", context: "standalone" }) || match3.day(dateString, { width: "narrow", context: "standalone" });}} }, { key: "validate", value: function validate(_date, value) {return value >= 0 && value <= 6;} }, { key: "set", value: function set(date, _flags, value, options) {date = _setDay(date, value, options);date.setHours(0, 0, 0, 0);return date;} }]);return StandAloneLocalDayParser;}(Parser);
+
+
+
+// lib/setISODay.js
+function _setISODay(date, day, options) {
+ var date_ = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ var currentDay = _getISODay(date_, options);
+ var diff = day - currentDay;
+ return _addDays(date_, diff, options);
+}
+
+// lib/parse/_lib/parsers/ISODayParser.js
+var ISODayParser = /*#__PURE__*/function (_Parser17) {_inherits(ISODayParser, _Parser17);function ISODayParser() {var _this19;_classCallCheck(this, ISODayParser);for (var _len18 = arguments.length, args = new Array(_len18), _key18 = 0; _key18 < _len18; _key18++) {args[_key18] = arguments[_key18];}_this19 = _callSuper(this, ISODayParser, [].concat(args));_defineProperty(_assertThisInitialized(_this19), "priority",
+ 90);_defineProperty(_assertThisInitialized(_this19), "incompatibleTokens",
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [
+ "y",
+ "Y",
+ "u",
+ "q",
+ "Q",
+ "M",
+ "L",
+ "w",
+ "d",
+ "D",
+ "E",
+ "e",
+ "c",
+ "t",
+ "T"]);return _this19;}_createClass(ISODayParser, [{ key: "parse", value: function parse(dateString, token, match3) {var valueCallback = function valueCallback(value) {if (value === 0) {return 7;}return value;};switch (token) {case "i":case "ii":return parseNDigits(token.length, dateString);case "io":return match3.ordinalNumber(dateString, { unit: "day" });case "iii":return mapValue(match3.day(dateString, { width: "abbreviated", context: "formatting" }) || match3.day(dateString, { width: "short", context: "formatting" }) || match3.day(dateString, { width: "narrow", context: "formatting" }), valueCallback);case "iiiii":return mapValue(match3.day(dateString, { width: "narrow", context: "formatting" }), valueCallback);case "iiiiii":return mapValue(match3.day(dateString, { width: "short", context: "formatting" }) || match3.day(dateString, { width: "narrow", context: "formatting" }), valueCallback);case "iiii":default:return mapValue(match3.day(dateString, { width: "wide", context: "formatting" }) || match3.day(dateString, { width: "abbreviated", context: "formatting" }) || match3.day(dateString, { width: "short", context: "formatting" }) || match3.day(dateString, { width: "narrow", context: "formatting" }), valueCallback);}} }, { key: "validate", value: function validate(_date, value) {return value >= 1 && value <= 7;} }, { key: "set", value: function set(date, _flags, value) {date = _setISODay(date, value);date.setHours(0, 0, 0, 0);return date;} }]);return ISODayParser;}(Parser);
+
+
+
+// lib/parse/_lib/parsers/AMPMParser.js
+var AMPMParser = /*#__PURE__*/function (_Parser18) {_inherits(AMPMParser, _Parser18);function AMPMParser() {var _this20;_classCallCheck(this, AMPMParser);for (var _len19 = arguments.length, args = new Array(_len19), _key19 = 0; _key19 < _len19; _key19++) {args[_key19] = arguments[_key19];}_this20 = _callSuper(this, AMPMParser, [].concat(args));_defineProperty(_assertThisInitialized(_this20), "priority",
+ 80);_defineProperty(_assertThisInitialized(_this20), "incompatibleTokens",
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ["b", "B", "H", "k", "t", "T"]);return _this20;}_createClass(AMPMParser, [{ key: "parse", value: function parse(dateString, token, match3) {switch (token) {case "a":case "aa":case "aaa":return match3.dayPeriod(dateString, { width: "abbreviated", context: "formatting" }) || match3.dayPeriod(dateString, { width: "narrow", context: "formatting" });case "aaaaa":return match3.dayPeriod(dateString, { width: "narrow", context: "formatting" });case "aaaa":default:return match3.dayPeriod(dateString, { width: "wide", context: "formatting" }) || match3.dayPeriod(dateString, { width: "abbreviated", context: "formatting" }) || match3.dayPeriod(dateString, { width: "narrow", context: "formatting" });}} }, { key: "set", value: function set(date, _flags, value) {date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);return date;} }]);return AMPMParser;}(Parser);
+
+
+// lib/parse/_lib/parsers/AMPMMidnightParser.js
+var AMPMMidnightParser = /*#__PURE__*/function (_Parser19) {_inherits(AMPMMidnightParser, _Parser19);function AMPMMidnightParser() {var _this21;_classCallCheck(this, AMPMMidnightParser);for (var _len20 = arguments.length, args = new Array(_len20), _key20 = 0; _key20 < _len20; _key20++) {args[_key20] = arguments[_key20];}_this21 = _callSuper(this, AMPMMidnightParser, [].concat(args));_defineProperty(_assertThisInitialized(_this21), "priority",
+ 80);_defineProperty(_assertThisInitialized(_this21), "incompatibleTokens",
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ["a", "B", "H", "k", "t", "T"]);return _this21;}_createClass(AMPMMidnightParser, [{ key: "parse", value: function parse(dateString, token, match3) {switch (token) {case "b":case "bb":case "bbb":return match3.dayPeriod(dateString, { width: "abbreviated", context: "formatting" }) || match3.dayPeriod(dateString, { width: "narrow", context: "formatting" });case "bbbbb":return match3.dayPeriod(dateString, { width: "narrow", context: "formatting" });case "bbbb":default:return match3.dayPeriod(dateString, { width: "wide", context: "formatting" }) || match3.dayPeriod(dateString, { width: "abbreviated", context: "formatting" }) || match3.dayPeriod(dateString, { width: "narrow", context: "formatting" });}} }, { key: "set", value: function set(date, _flags, value) {date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);return date;} }]);return AMPMMidnightParser;}(Parser);
+
+
+// lib/parse/_lib/parsers/DayPeriodParser.js
+var DayPeriodParser = /*#__PURE__*/function (_Parser20) {_inherits(DayPeriodParser, _Parser20);function DayPeriodParser() {var _this22;_classCallCheck(this, DayPeriodParser);for (var _len21 = arguments.length, args = new Array(_len21), _key21 = 0; _key21 < _len21; _key21++) {args[_key21] = arguments[_key21];}_this22 = _callSuper(this, DayPeriodParser, [].concat(args));_defineProperty(_assertThisInitialized(_this22), "priority",
+ 80);_defineProperty(_assertThisInitialized(_this22), "incompatibleTokens",
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ["a", "b", "t", "T"]);return _this22;}_createClass(DayPeriodParser, [{ key: "parse", value: function parse(dateString, token, match3) {switch (token) {case "B":case "BB":case "BBB":return match3.dayPeriod(dateString, { width: "abbreviated", context: "formatting" }) || match3.dayPeriod(dateString, { width: "narrow", context: "formatting" });case "BBBBB":return match3.dayPeriod(dateString, { width: "narrow", context: "formatting" });case "BBBB":default:return match3.dayPeriod(dateString, { width: "wide", context: "formatting" }) || match3.dayPeriod(dateString, { width: "abbreviated", context: "formatting" }) || match3.dayPeriod(dateString, { width: "narrow", context: "formatting" });}} }, { key: "set", value: function set(date, _flags, value) {date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);return date;} }]);return DayPeriodParser;}(Parser);
+
+
+// lib/parse/_lib/parsers/Hour1to12Parser.js
+var Hour1to12Parser = /*#__PURE__*/function (_Parser21) {_inherits(Hour1to12Parser, _Parser21);function Hour1to12Parser() {var _this23;_classCallCheck(this, Hour1to12Parser);for (var _len22 = arguments.length, args = new Array(_len22), _key22 = 0; _key22 < _len22; _key22++) {args[_key22] = arguments[_key22];}_this23 = _callSuper(this, Hour1to12Parser, [].concat(args));_defineProperty(_assertThisInitialized(_this23), "priority",
+ 70);_defineProperty(_assertThisInitialized(_this23), "incompatibleTokens",
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ["H", "K", "k", "t", "T"]);return _this23;}_createClass(Hour1to12Parser, [{ key: "parse", value: function parse(dateString, token, match3) {switch (token) {case "h":return parseNumericPattern(numericPatterns.hour12h, dateString);case "ho":return match3.ordinalNumber(dateString, { unit: "hour" });default:return parseNDigits(token.length, dateString);}} }, { key: "validate", value: function validate(_date, value) {return value >= 1 && value <= 12;} }, { key: "set", value: function set(date, _flags, value) {var isPM = date.getHours() >= 12;if (isPM && value < 12) {date.setHours(value + 12, 0, 0, 0);} else if (!isPM && value === 12) {date.setHours(0, 0, 0, 0);} else {date.setHours(value, 0, 0, 0);}return date;} }]);return Hour1to12Parser;}(Parser);
+
+
+// lib/parse/_lib/parsers/Hour0to23Parser.js
+var Hour0to23Parser = /*#__PURE__*/function (_Parser22) {_inherits(Hour0to23Parser, _Parser22);function Hour0to23Parser() {var _this24;_classCallCheck(this, Hour0to23Parser);for (var _len23 = arguments.length, args = new Array(_len23), _key23 = 0; _key23 < _len23; _key23++) {args[_key23] = arguments[_key23];}_this24 = _callSuper(this, Hour0to23Parser, [].concat(args));_defineProperty(_assertThisInitialized(_this24), "priority",
+ 70);_defineProperty(_assertThisInitialized(_this24), "incompatibleTokens",
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ["a", "b", "h", "K", "k", "t", "T"]);return _this24;}_createClass(Hour0to23Parser, [{ key: "parse", value: function parse(dateString, token, match3) {switch (token) {case "H":return parseNumericPattern(numericPatterns.hour23h, dateString);case "Ho":return match3.ordinalNumber(dateString, { unit: "hour" });default:return parseNDigits(token.length, dateString);}} }, { key: "validate", value: function validate(_date, value) {return value >= 0 && value <= 23;} }, { key: "set", value: function set(date, _flags, value) {date.setHours(value, 0, 0, 0);return date;} }]);return Hour0to23Parser;}(Parser);
+
+
+// lib/parse/_lib/parsers/Hour0To11Parser.js
+var Hour0To11Parser = /*#__PURE__*/function (_Parser23) {_inherits(Hour0To11Parser, _Parser23);function Hour0To11Parser() {var _this25;_classCallCheck(this, Hour0To11Parser);for (var _len24 = arguments.length, args = new Array(_len24), _key24 = 0; _key24 < _len24; _key24++) {args[_key24] = arguments[_key24];}_this25 = _callSuper(this, Hour0To11Parser, [].concat(args));_defineProperty(_assertThisInitialized(_this25), "priority",
+ 70);_defineProperty(_assertThisInitialized(_this25), "incompatibleTokens",
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ["h", "H", "k", "t", "T"]);return _this25;}_createClass(Hour0To11Parser, [{ key: "parse", value: function parse(dateString, token, match3) {switch (token) {case "K":return parseNumericPattern(numericPatterns.hour11h, dateString);case "Ko":return match3.ordinalNumber(dateString, { unit: "hour" });default:return parseNDigits(token.length, dateString);}} }, { key: "validate", value: function validate(_date, value) {return value >= 0 && value <= 11;} }, { key: "set", value: function set(date, _flags, value) {var isPM = date.getHours() >= 12;if (isPM && value < 12) {date.setHours(value + 12, 0, 0, 0);} else {date.setHours(value, 0, 0, 0);}return date;} }]);return Hour0To11Parser;}(Parser);
+
+
+// lib/parse/_lib/parsers/Hour1To24Parser.js
+var Hour1To24Parser = /*#__PURE__*/function (_Parser24) {_inherits(Hour1To24Parser, _Parser24);function Hour1To24Parser() {var _this26;_classCallCheck(this, Hour1To24Parser);for (var _len25 = arguments.length, args = new Array(_len25), _key25 = 0; _key25 < _len25; _key25++) {args[_key25] = arguments[_key25];}_this26 = _callSuper(this, Hour1To24Parser, [].concat(args));_defineProperty(_assertThisInitialized(_this26), "priority",
+ 70);_defineProperty(_assertThisInitialized(_this26), "incompatibleTokens",
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ["a", "b", "h", "H", "K", "t", "T"]);return _this26;}_createClass(Hour1To24Parser, [{ key: "parse", value: function parse(dateString, token, match3) {switch (token) {case "k":return parseNumericPattern(numericPatterns.hour24h, dateString);case "ko":return match3.ordinalNumber(dateString, { unit: "hour" });default:return parseNDigits(token.length, dateString);}} }, { key: "validate", value: function validate(_date, value) {return value >= 1 && value <= 24;} }, { key: "set", value: function set(date, _flags, value) {var hours = value <= 24 ? value % 24 : value;date.setHours(hours, 0, 0, 0);return date;} }]);return Hour1To24Parser;}(Parser);
+
+
+// lib/parse/_lib/parsers/MinuteParser.js
+var MinuteParser = /*#__PURE__*/function (_Parser25) {_inherits(MinuteParser, _Parser25);function MinuteParser() {var _this27;_classCallCheck(this, MinuteParser);for (var _len26 = arguments.length, args = new Array(_len26), _key26 = 0; _key26 < _len26; _key26++) {args[_key26] = arguments[_key26];}_this27 = _callSuper(this, MinuteParser, [].concat(args));_defineProperty(_assertThisInitialized(_this27), "priority",
+ 60);_defineProperty(_assertThisInitialized(_this27), "incompatibleTokens",
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ["t", "T"]);return _this27;}_createClass(MinuteParser, [{ key: "parse", value: function parse(dateString, token, match3) {switch (token) {case "m":return parseNumericPattern(numericPatterns.minute, dateString);case "mo":return match3.ordinalNumber(dateString, { unit: "minute" });default:return parseNDigits(token.length, dateString);}} }, { key: "validate", value: function validate(_date, value) {return value >= 0 && value <= 59;} }, { key: "set", value: function set(date, _flags, value) {date.setMinutes(value, 0, 0);return date;} }]);return MinuteParser;}(Parser);
+
+
+// lib/parse/_lib/parsers/SecondParser.js
+var SecondParser = /*#__PURE__*/function (_Parser26) {_inherits(SecondParser, _Parser26);function SecondParser() {var _this28;_classCallCheck(this, SecondParser);for (var _len27 = arguments.length, args = new Array(_len27), _key27 = 0; _key27 < _len27; _key27++) {args[_key27] = arguments[_key27];}_this28 = _callSuper(this, SecondParser, [].concat(args));_defineProperty(_assertThisInitialized(_this28), "priority",
+ 50);_defineProperty(_assertThisInitialized(_this28), "incompatibleTokens",
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ["t", "T"]);return _this28;}_createClass(SecondParser, [{ key: "parse", value: function parse(dateString, token, match3) {switch (token) {case "s":return parseNumericPattern(numericPatterns.second, dateString);case "so":return match3.ordinalNumber(dateString, { unit: "second" });default:return parseNDigits(token.length, dateString);}} }, { key: "validate", value: function validate(_date, value) {return value >= 0 && value <= 59;} }, { key: "set", value: function set(date, _flags, value) {date.setSeconds(value, 0);return date;} }]);return SecondParser;}(Parser);
+
+
+// lib/parse/_lib/parsers/FractionOfSecondParser.js
+var FractionOfSecondParser = /*#__PURE__*/function (_Parser27) {_inherits(FractionOfSecondParser, _Parser27);function FractionOfSecondParser() {var _this29;_classCallCheck(this, FractionOfSecondParser);for (var _len28 = arguments.length, args = new Array(_len28), _key28 = 0; _key28 < _len28; _key28++) {args[_key28] = arguments[_key28];}_this29 = _callSuper(this, FractionOfSecondParser, [].concat(args));_defineProperty(_assertThisInitialized(_this29), "priority",
+ 30);_defineProperty(_assertThisInitialized(_this29), "incompatibleTokens",
+
+
+
+
+
+
+
+
+ ["t", "T"]);return _this29;}_createClass(FractionOfSecondParser, [{ key: "parse", value: function parse(dateString, token) {var valueCallback = function valueCallback(value) {return Math.trunc(value * Math.pow(10, -token.length + 3));};return mapValue(parseNDigits(token.length, dateString), valueCallback);} }, { key: "set", value: function set(date, _flags, value) {date.setMilliseconds(value);return date;} }]);return FractionOfSecondParser;}(Parser);
+
+
+// lib/parse/_lib/parsers/ISOTimezoneWithZParser.js
+var ISOTimezoneWithZParser = /*#__PURE__*/function (_Parser28) {_inherits(ISOTimezoneWithZParser, _Parser28);function ISOTimezoneWithZParser() {var _this30;_classCallCheck(this, ISOTimezoneWithZParser);for (var _len29 = arguments.length, args = new Array(_len29), _key29 = 0; _key29 < _len29; _key29++) {args[_key29] = arguments[_key29];}_this30 = _callSuper(this, ISOTimezoneWithZParser, [].concat(args));_defineProperty(_assertThisInitialized(_this30), "priority",
+ 10);_defineProperty(_assertThisInitialized(_this30), "incompatibleTokens",
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ["t", "T", "x"]);return _this30;}_createClass(ISOTimezoneWithZParser, [{ key: "parse", value: function parse(dateString, token) {switch (token) {case "X":return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, dateString);case "XX":return parseTimezonePattern(timezonePatterns.basic, dateString);case "XXXX":return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, dateString);case "XXXXX":return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, dateString);case "XXX":default:return parseTimezonePattern(timezonePatterns.extended, dateString);}} }, { key: "set", value: function set(date, flags, value) {if (flags.timestampIsSet) return date;return _constructFrom(date, date.getTime() - getTimezoneOffsetInMilliseconds(date) - value);} }]);return ISOTimezoneWithZParser;}(Parser);
+
+
+// lib/parse/_lib/parsers/ISOTimezoneParser.js
+var ISOTimezoneParser = /*#__PURE__*/function (_Parser29) {_inherits(ISOTimezoneParser, _Parser29);function ISOTimezoneParser() {var _this31;_classCallCheck(this, ISOTimezoneParser);for (var _len30 = arguments.length, args = new Array(_len30), _key30 = 0; _key30 < _len30; _key30++) {args[_key30] = arguments[_key30];}_this31 = _callSuper(this, ISOTimezoneParser, [].concat(args));_defineProperty(_assertThisInitialized(_this31), "priority",
+ 10);_defineProperty(_assertThisInitialized(_this31), "incompatibleTokens",
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ["t", "T", "X"]);return _this31;}_createClass(ISOTimezoneParser, [{ key: "parse", value: function parse(dateString, token) {switch (token) {case "x":return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, dateString);case "xx":return parseTimezonePattern(timezonePatterns.basic, dateString);case "xxxx":return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, dateString);case "xxxxx":return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, dateString);case "xxx":default:return parseTimezonePattern(timezonePatterns.extended, dateString);}} }, { key: "set", value: function set(date, flags, value) {if (flags.timestampIsSet) return date;return _constructFrom(date, date.getTime() - getTimezoneOffsetInMilliseconds(date) - value);} }]);return ISOTimezoneParser;}(Parser);
+
+
+// lib/parse/_lib/parsers/TimestampSecondsParser.js
+var TimestampSecondsParser = /*#__PURE__*/function (_Parser30) {_inherits(TimestampSecondsParser, _Parser30);function TimestampSecondsParser() {var _this32;_classCallCheck(this, TimestampSecondsParser);for (var _len31 = arguments.length, args = new Array(_len31), _key31 = 0; _key31 < _len31; _key31++) {args[_key31] = arguments[_key31];}_this32 = _callSuper(this, TimestampSecondsParser, [].concat(args));_defineProperty(_assertThisInitialized(_this32), "priority",
+ 40);_defineProperty(_assertThisInitialized(_this32), "incompatibleTokens",
+
+
+
+
+
+
+ "*");return _this32;}_createClass(TimestampSecondsParser, [{ key: "parse", value: function parse(dateString) {return parseAnyDigitsSigned(dateString);} }, { key: "set", value: function set(date, _flags, value) {return [_constructFrom(date, value * 1000), { timestampIsSet: true }];} }]);return TimestampSecondsParser;}(Parser);
+
+
+// lib/parse/_lib/parsers/TimestampMillisecondsParser.js
+var TimestampMillisecondsParser = /*#__PURE__*/function (_Parser31) {_inherits(TimestampMillisecondsParser, _Parser31);function TimestampMillisecondsParser() {var _this33;_classCallCheck(this, TimestampMillisecondsParser);for (var _len32 = arguments.length, args = new Array(_len32), _key32 = 0; _key32 < _len32; _key32++) {args[_key32] = arguments[_key32];}_this33 = _callSuper(this, TimestampMillisecondsParser, [].concat(args));_defineProperty(_assertThisInitialized(_this33), "priority",
+ 20);_defineProperty(_assertThisInitialized(_this33), "incompatibleTokens",
+
+
+
+
+
+
+ "*");return _this33;}_createClass(TimestampMillisecondsParser, [{ key: "parse", value: function parse(dateString) {return parseAnyDigitsSigned(dateString);} }, { key: "set", value: function set(date, _flags, value) {return [_constructFrom(date, value), { timestampIsSet: true }];} }]);return TimestampMillisecondsParser;}(Parser);
+
+
+// lib/parse/_lib/parsers.js
+var _parsers = {
+ G: new EraParser(),
+ y: new YearParser(),
+ Y: new LocalWeekYearParser(),
+ R: new ISOWeekYearParser(),
+ u: new ExtendedYearParser(),
+ Q: new QuarterParser(),
+ q: new StandAloneQuarterParser(),
+ M: new MonthParser(),
+ L: new StandAloneMonthParser(),
+ w: new LocalWeekParser(),
+ I: new ISOWeekParser(),
+ d: new DateParser(),
+ D: new DayOfYearParser(),
+ E: new DayParser(),
+ e: new LocalDayParser(),
+ c: new StandAloneLocalDayParser(),
+ i: new ISODayParser(),
+ a: new AMPMParser(),
+ b: new AMPMMidnightParser(),
+ B: new DayPeriodParser(),
+ h: new Hour1to12Parser(),
+ H: new Hour0to23Parser(),
+ K: new Hour0To11Parser(),
+ k: new Hour1To24Parser(),
+ m: new MinuteParser(),
+ s: new SecondParser(),
+ S: new FractionOfSecondParser(),
+ X: new ISOTimezoneWithZParser(),
+ x: new ISOTimezoneParser(),
+ t: new TimestampSecondsParser(),
+ T: new TimestampMillisecondsParser()
+};
+
+// lib/parse.js
+function _parse(dateStr, formatStr, referenceDate, options) {var _ref33, _options$locale15, _ref34, _ref35, _ref36, _options$firstWeekCon4, _options$locale16, _defaultOptions14$loc2, _ref37, _ref38, _ref39, _options$weekStartsOn7, _options$locale17, _defaultOptions14$loc3;
+ var invalidDate = function invalidDate() {return _constructFrom((options === null || options === void 0 ? void 0 : options.in) || referenceDate, NaN);};
+ var defaultOptions14 = getDefaultOptions2();
+ var locale = (_ref33 = (_options$locale15 = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale15 !== void 0 ? _options$locale15 : defaultOptions14.locale) !== null && _ref33 !== void 0 ? _ref33 : enUS;
+ var firstWeekContainsDate = (_ref34 = (_ref35 = (_ref36 = (_options$firstWeekCon4 = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon4 !== void 0 ? _options$firstWeekCon4 : options === null || options === void 0 || (_options$locale16 = options.locale) === null || _options$locale16 === void 0 || (_options$locale16 = _options$locale16.options) === null || _options$locale16 === void 0 ? void 0 : _options$locale16.firstWeekContainsDate) !== null && _ref36 !== void 0 ? _ref36 : defaultOptions14.firstWeekContainsDate) !== null && _ref35 !== void 0 ? _ref35 : (_defaultOptions14$loc2 = defaultOptions14.locale) === null || _defaultOptions14$loc2 === void 0 || (_defaultOptions14$loc2 = _defaultOptions14$loc2.options) === null || _defaultOptions14$loc2 === void 0 ? void 0 : _defaultOptions14$loc2.firstWeekContainsDate) !== null && _ref34 !== void 0 ? _ref34 : 1;
+ var weekStartsOn = (_ref37 = (_ref38 = (_ref39 = (_options$weekStartsOn7 = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn7 !== void 0 ? _options$weekStartsOn7 : options === null || options === void 0 || (_options$locale17 = options.locale) === null || _options$locale17 === void 0 || (_options$locale17 = _options$locale17.options) === null || _options$locale17 === void 0 ? void 0 : _options$locale17.weekStartsOn) !== null && _ref39 !== void 0 ? _ref39 : defaultOptions14.weekStartsOn) !== null && _ref38 !== void 0 ? _ref38 : (_defaultOptions14$loc3 = defaultOptions14.locale) === null || _defaultOptions14$loc3 === void 0 || (_defaultOptions14$loc3 = _defaultOptions14$loc3.options) === null || _defaultOptions14$loc3 === void 0 ? void 0 : _defaultOptions14$loc3.weekStartsOn) !== null && _ref37 !== void 0 ? _ref37 : 0;
+ if (!formatStr)
+ return dateStr ? invalidDate() : _toDate(referenceDate, options === null || options === void 0 ? void 0 : options.in);
+ var subFnOptions = {
+ firstWeekContainsDate: firstWeekContainsDate,
+ weekStartsOn: weekStartsOn,
+ locale: locale
+ };
+ var setters = [new DateTimezoneSetter(options === null || options === void 0 ? void 0 : options.in, referenceDate)];
+ var tokens = formatStr.match(longFormattingTokensRegExp2).map(function (substring) {
+ var firstCharacter = substring[0];
+ if (firstCharacter in _longFormatters) {
+ var longFormatter = _longFormatters[firstCharacter];
+ return longFormatter(substring, locale.formatLong);
+ }
+ return substring;
+ }).join("").match(formattingTokensRegExp2);
+ var usedTokens = [];var _iterator = _createForOfIteratorHelper(
+ tokens),_step;try {var _loop = function _loop() {var token = _step.value;
+ if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(token)) {
+ warnOrThrowProtectedError(token, formatStr, dateStr);
+ }
+ if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(token)) {
+ warnOrThrowProtectedError(token, formatStr, dateStr);
+ }
+ var firstCharacter = token[0];
+ var parser = _parsers[firstCharacter];
+ if (parser) {
+ var incompatibleTokens = parser.incompatibleTokens;
+ if (Array.isArray(incompatibleTokens)) {
+ var incompatibleToken = usedTokens.find(function (usedToken) {return incompatibleTokens.includes(usedToken.token) || usedToken.token === firstCharacter;});
+ if (incompatibleToken) {
+ throw new RangeError("The format string mustn't contain `".concat(incompatibleToken.fullToken, "` and `").concat(token, "` at the same time"));
+ }
+ } else if (parser.incompatibleTokens === "*" && usedTokens.length > 0) {
+ throw new RangeError("The format string mustn't contain `".concat(token, "` and any other token at the same time"));
+ }
+ usedTokens.push({ token: firstCharacter, fullToken: token });
+ var parseResult = parser.run(dateStr, token, locale.match, subFnOptions);
+ if (!parseResult) {return { v:
+ invalidDate() };
+ }
+ setters.push(parseResult.setter);
+ dateStr = parseResult.rest;
+ } else {
+ if (firstCharacter.match(unescapedLatinCharacterRegExp2)) {
+ throw new RangeError("Format string contains an unescaped latin alphabet character `" + firstCharacter + "`");
+ }
+ if (token === "''") {
+ token = "'";
+ } else if (firstCharacter === "'") {
+ token = cleanEscapedString2(token);
+ }
+ if (dateStr.indexOf(token) === 0) {
+ dateStr = dateStr.slice(token.length);
+ } else {return { v:
+ invalidDate() };
+ }
+ }
+ },_ret;for (_iterator.s(); !(_step = _iterator.n()).done;) {_ret = _loop();if (_ret) return _ret.v;}} catch (err) {_iterator.e(err);} finally {_iterator.f();}
+ if (dateStr.length > 0 && notWhitespaceRegExp.test(dateStr)) {
+ return invalidDate();
+ }
+ var uniquePrioritySetters = setters.map(function (setter) {return setter.priority;}).sort(function (a, b) {return b - a;}).filter(function (priority, index, array) {return array.indexOf(priority) === index;}).map(function (priority) {return setters.filter(function (setter) {return setter.priority === priority;}).sort(function (a, b) {return b.subPriority - a.subPriority;});}).map(function (setterArray) {return setterArray[0];});
+ var date = _toDate(referenceDate, options === null || options === void 0 ? void 0 : options.in);
+ if (isNaN(+date))
+ return invalidDate();
+ var flags = {};var _iterator2 = _createForOfIteratorHelper(
+ uniquePrioritySetters),_step2;try {for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {var setter = _step2.value;
+ if (!setter.validate(date, subFnOptions)) {
+ return invalidDate();
+ }
+ var result = setter.set(date, flags, subFnOptions);
+ if (Array.isArray(result)) {
+ date = result[0];
+ Object.assign(flags, result[1]);
+ } else {
+ date = result;
+ }
+ }} catch (err) {_iterator2.e(err);} finally {_iterator2.f();}
+ return date;
+}
+function cleanEscapedString2(input) {
+ return input.match(escapedStringRegExp2)[1].replace(doubleQuoteRegExp2, "'");
+}
+var formattingTokensRegExp2 = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
+var longFormattingTokensRegExp2 = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
+var escapedStringRegExp2 = /^'([^]*?)'?$/;
+var doubleQuoteRegExp2 = /''/g;
+var notWhitespaceRegExp = /\S/;
+var unescapedLatinCharacterRegExp2 = /[a-zA-Z]/;
+
+// lib/isMatch.js
+function _isMatch(dateStr, formatStr, options) {
+ return _isValid(_parse(dateStr, formatStr, new Date(), options));
+}
+// lib/isMonday.js
+function _isMonday(date, options) {
+ return _toDate(date, options === null || options === void 0 ? void 0 : options.in).getDay() === 1;
+}
+// lib/isPast.js
+function _isPast(date) {
+ return +_toDate(date) < Date.now();
+}
+// lib/startOfHour.js
+function _startOfHour(date, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ _date.setMinutes(0, 0, 0);
+ return _date;
+}
+
+// lib/isSameHour.js
+function _isSameHour(dateLeft, dateRight, options) {
+ var _normalizeDates45 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, dateLeft, dateRight),_normalizeDates46 = _slicedToArray(_normalizeDates45, 2),dateLeft_ = _normalizeDates46[0],dateRight_ = _normalizeDates46[1];
+ return +_startOfHour(dateLeft_) === +_startOfHour(dateRight_);
+}
+// lib/isSameWeek.js
+function _isSameWeek(laterDate, earlierDate, options) {
+ var _normalizeDates47 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates48 = _slicedToArray(_normalizeDates47, 2),laterDate_ = _normalizeDates48[0],earlierDate_ = _normalizeDates48[1];
+ return +_startOfWeek(laterDate_, options) === +_startOfWeek(earlierDate_, options);
+}
+
+// lib/isSameISOWeek.js
+function _isSameISOWeek(laterDate, earlierDate, options) {
+ return _isSameWeek(laterDate, earlierDate, _objectSpread(_objectSpread({}, options), {}, { weekStartsOn: 1 }));
+}
+// lib/isSameISOWeekYear.js
+function _isSameISOWeekYear(laterDate, earlierDate, options) {
+ var _normalizeDates49 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates50 = _slicedToArray(_normalizeDates49, 2),laterDate_ = _normalizeDates50[0],earlierDate_ = _normalizeDates50[1];
+ return +_startOfISOWeekYear(laterDate_) === +_startOfISOWeekYear(earlierDate_);
+}
+// lib/startOfMinute.js
+function _startOfMinute(date, options) {
+ var date_ = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ date_.setSeconds(0, 0);
+ return date_;
+}
+
+// lib/isSameMinute.js
+function _isSameMinute(laterDate, earlierDate) {
+ return +_startOfMinute(laterDate) === +_startOfMinute(earlierDate);
+}
+// lib/isSameMonth.js
+function _isSameMonth(laterDate, earlierDate, options) {
+ var _normalizeDates51 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates52 = _slicedToArray(_normalizeDates51, 2),laterDate_ = _normalizeDates52[0],earlierDate_ = _normalizeDates52[1];
+ return laterDate_.getFullYear() === earlierDate_.getFullYear() && laterDate_.getMonth() === earlierDate_.getMonth();
+}
+// lib/isSameQuarter.js
+function _isSameQuarter(laterDate, earlierDate, options) {
+ var _normalizeDates53 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates54 = _slicedToArray(_normalizeDates53, 2),dateLeft_ = _normalizeDates54[0],dateRight_ = _normalizeDates54[1];
+ return +_startOfQuarter(dateLeft_) === +_startOfQuarter(dateRight_);
+}
+// lib/startOfSecond.js
+function _startOfSecond(date, options) {
+ var date_ = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ date_.setMilliseconds(0);
+ return date_;
+}
+
+// lib/isSameSecond.js
+function _isSameSecond(laterDate, earlierDate) {
+ return +_startOfSecond(laterDate) === +_startOfSecond(earlierDate);
+}
+// lib/isSameYear.js
+function _isSameYear(laterDate, earlierDate, options) {
+ var _normalizeDates55 = normalizeDates(options === null || options === void 0 ? void 0 : options.in, laterDate, earlierDate),_normalizeDates56 = _slicedToArray(_normalizeDates55, 2),laterDate_ = _normalizeDates56[0],earlierDate_ = _normalizeDates56[1];
+ return laterDate_.getFullYear() === earlierDate_.getFullYear();
+}
+// lib/isThisHour.js
+function _isThisHour(date, options) {
+ return _isSameHour(_toDate(date, options === null || options === void 0 ? void 0 : options.in), _constructNow((options === null || options === void 0 ? void 0 : options.in) || date));
+}
+// lib/isThisISOWeek.js
+function _isThisISOWeek(date, options) {
+ return _isSameISOWeek(_constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, date), _constructNow((options === null || options === void 0 ? void 0 : options.in) || date));
+}
+// lib/isThisMinute.js
+function _isThisMinute(date) {
+ return _isSameMinute(date, _constructNow(date));
+}
+// lib/isThisMonth.js
+function _isThisMonth(date, options) {
+ return _isSameMonth(_constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, date), _constructNow((options === null || options === void 0 ? void 0 : options.in) || date));
+}
+// lib/isThisQuarter.js
+function _isThisQuarter(date, options) {
+ return _isSameQuarter(_constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, date), _constructNow((options === null || options === void 0 ? void 0 : options.in) || date));
+}
+// lib/isThisSecond.js
+function _isThisSecond(date) {
+ return _isSameSecond(date, _constructNow(date));
+}
+// lib/isThisWeek.js
+function _isThisWeek(date, options) {
+ return _isSameWeek(_constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, date), _constructNow((options === null || options === void 0 ? void 0 : options.in) || date), options);
+}
+// lib/isThisYear.js
+function _isThisYear(date, options) {
+ return _isSameYear(_constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, date), _constructNow((options === null || options === void 0 ? void 0 : options.in) || date));
+}
+// lib/isThursday.js
+function _isThursday(date, options) {
+ return _toDate(date, options === null || options === void 0 ? void 0 : options.in).getDay() === 4;
+}
+// lib/isToday.js
+function _isToday(date, options) {
+ return _isSameDay(_constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, date), _constructNow((options === null || options === void 0 ? void 0 : options.in) || date));
+}
+// lib/isTomorrow.js
+function _isTomorrow(date, options) {
+ return _isSameDay(date, _addDays(_constructNow((options === null || options === void 0 ? void 0 : options.in) || date), 1), options);
+}
+// lib/isTuesday.js
+function _isTuesday(date, options) {
+ return _toDate(date, options === null || options === void 0 ? void 0 : options.in).getDay() === 2;
+}
+// lib/isWednesday.js
+function _isWednesday(date, options) {
+ return _toDate(date, options === null || options === void 0 ? void 0 : options.in).getDay() === 3;
+}
+// lib/isWithinInterval.js
+function _isWithinInterval(date, interval2, options) {
+ var time = +_toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ var _sort9 = [
+ +_toDate(interval2.start, options === null || options === void 0 ? void 0 : options.in),
+ +_toDate(interval2.end, options === null || options === void 0 ? void 0 : options.in)].
+ sort(function (a, b) {return a - b;}),_sort10 = _slicedToArray(_sort9, 2),startTime = _sort10[0],endTime = _sort10[1];
+ return time >= startTime && time <= endTime;
+}
+// lib/subDays.js
+function _subDays(date, amount, options) {
+ return _addDays(date, -amount, options);
+}
+
+// lib/isYesterday.js
+function _isYesterday(date, options) {
+ return _isSameDay(_constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, date), _subDays(_constructNow((options === null || options === void 0 ? void 0 : options.in) || date), 1));
+}
+// lib/lastDayOfDecade.js
+function _lastDayOfDecade(date, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ var year = _date.getFullYear();
+ var decade = 9 + Math.floor(year / 10) * 10;
+ _date.setFullYear(decade + 1, 0, 0);
+ _date.setHours(0, 0, 0, 0);
+ return _toDate(_date, options === null || options === void 0 ? void 0 : options.in);
+}
+// lib/lastDayOfWeek.js
+function _lastDayOfWeek(date, options) {var _ref40, _ref41, _ref42, _options$weekStartsOn8, _options$locale18, _defaultOptions15$loc;
+ var defaultOptions15 = getDefaultOptions();
+ var weekStartsOn = (_ref40 = (_ref41 = (_ref42 = (_options$weekStartsOn8 = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn8 !== void 0 ? _options$weekStartsOn8 : options === null || options === void 0 || (_options$locale18 = options.locale) === null || _options$locale18 === void 0 || (_options$locale18 = _options$locale18.options) === null || _options$locale18 === void 0 ? void 0 : _options$locale18.weekStartsOn) !== null && _ref42 !== void 0 ? _ref42 : defaultOptions15.weekStartsOn) !== null && _ref41 !== void 0 ? _ref41 : (_defaultOptions15$loc = defaultOptions15.locale) === null || _defaultOptions15$loc === void 0 || (_defaultOptions15$loc = _defaultOptions15$loc.options) === null || _defaultOptions15$loc === void 0 ? void 0 : _defaultOptions15$loc.weekStartsOn) !== null && _ref40 !== void 0 ? _ref40 : 0;
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ var day = _date.getDay();
+ var diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn);
+ _date.setHours(0, 0, 0, 0);
+ _date.setDate(_date.getDate() + diff);
+ return _date;
+}
+
+// lib/lastDayOfISOWeek.js
+function _lastDayOfISOWeek(date, options) {
+ return _lastDayOfWeek(date, _objectSpread(_objectSpread({}, options), {}, { weekStartsOn: 1 }));
+}
+// lib/lastDayOfISOWeekYear.js
+function _lastDayOfISOWeekYear(date, options) {
+ var year = _getISOWeekYear(date, options);
+ var fourthOfJanuary = _constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, 0);
+ fourthOfJanuary.setFullYear(year + 1, 0, 4);
+ fourthOfJanuary.setHours(0, 0, 0, 0);
+ var date_ = _startOfISOWeek(fourthOfJanuary, options);
+ date_.setDate(date_.getDate() - 1);
+ return date_;
+}
+// lib/lastDayOfQuarter.js
+function _lastDayOfQuarter(date, options) {
+ var date_ = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ var currentMonth = date_.getMonth();
+ var month = currentMonth - currentMonth % 3 + 3;
+ date_.setMonth(month, 0);
+ date_.setHours(0, 0, 0, 0);
+ return date_;
+}
+// lib/lastDayOfYear.js
+function _lastDayOfYear(date, options) {
+ var date_ = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ var year = date_.getFullYear();
+ date_.setFullYear(year + 1, 0, 0);
+ date_.setHours(0, 0, 0, 0);
+ return date_;
+}
+// lib/lightFormat.js
+function _lightFormat(date, formatStr) {
+ var date_ = _toDate(date);
+ if (!_isValid(date_)) {
+ throw new RangeError("Invalid time value");
+ }
+ var tokens = formatStr.match(formattingTokensRegExp3);
+ if (!tokens)
+ return "";
+ var result = tokens.map(function (substring) {
+ if (substring === "''") {
+ return "'";
+ }
+ var firstCharacter = substring[0];
+ if (firstCharacter === "'") {
+ return cleanEscapedString3(substring);
+ }
+ var formatter = _lightFormatters[firstCharacter];
+ if (formatter) {
+ return formatter(date_, substring);
+ }
+ if (firstCharacter.match(unescapedLatinCharacterRegExp3)) {
+ throw new RangeError("Format string contains an unescaped latin alphabet character `" + firstCharacter + "`");
+ }
+ return substring;
+ }).join("");
+ return result;
+}
+function cleanEscapedString3(input) {
+ var matches = input.match(escapedStringRegExp3);
+ if (!matches)
+ return input;
+ return matches[1].replace(doubleQuoteRegExp3, "'");
+}
+var formattingTokensRegExp3 = /(\w)\1*|''|'(''|[^'])+('|$)|./g;
+var escapedStringRegExp3 = /^'([^]*?)'?$/;
+var doubleQuoteRegExp3 = /''/g;
+var unescapedLatinCharacterRegExp3 = /[a-zA-Z]/;
+// lib/milliseconds.js
+function _milliseconds(_ref43)
+
+
+
+
+
+
+
+{var years = _ref43.years,months2 = _ref43.months,weeks = _ref43.weeks,days2 = _ref43.days,hours = _ref43.hours,minutes = _ref43.minutes,seconds = _ref43.seconds;
+ var totalDays = 0;
+ if (years)
+ totalDays += years * daysInYear;
+ if (months2)
+ totalDays += months2 * (daysInYear / 12);
+ if (weeks)
+ totalDays += weeks * 7;
+ if (days2)
+ totalDays += days2;
+ var totalSeconds = totalDays * 24 * 60 * 60;
+ if (hours)
+ totalSeconds += hours * 60 * 60;
+ if (minutes)
+ totalSeconds += minutes * 60;
+ if (seconds)
+ totalSeconds += seconds;
+ return Math.trunc(totalSeconds * 1000);
+}
+// lib/millisecondsToHours.js
+function _millisecondsToHours(milliseconds2) {
+ var hours = milliseconds2 / millisecondsInHour;
+ return Math.trunc(hours);
+}
+// lib/millisecondsToMinutes.js
+function _millisecondsToMinutes(milliseconds2) {
+ var minutes = milliseconds2 / millisecondsInMinute;
+ return Math.trunc(minutes);
+}
+// lib/millisecondsToSeconds.js
+function _millisecondsToSeconds(milliseconds2) {
+ var seconds = milliseconds2 / millisecondsInSecond;
+ return Math.trunc(seconds);
+}
+// lib/minutesToHours.js
+function _minutesToHours(minutes) {
+ var hours = minutes / minutesInHour;
+ return Math.trunc(hours);
+}
+// lib/minutesToMilliseconds.js
+function _minutesToMilliseconds(minutes) {
+ return Math.trunc(minutes * millisecondsInMinute);
+}
+// lib/minutesToSeconds.js
+function _minutesToSeconds(minutes) {
+ return Math.trunc(minutes * secondsInMinute);
+}
+// lib/monthsToQuarters.js
+function _monthsToQuarters(months2) {
+ var quarters = months2 / monthsInQuarter;
+ return Math.trunc(quarters);
+}
+// lib/monthsToYears.js
+function _monthsToYears(months2) {
+ var years = months2 / monthsInYear;
+ return Math.trunc(years);
+}
+// lib/nextDay.js
+function _nextDay(date, day, options) {
+ var delta = day - _getDay(date, options);
+ if (delta <= 0)
+ delta += 7;
+ return _addDays(date, delta, options);
+}
+// lib/nextFriday.js
+function _nextFriday(date, options) {
+ return _nextDay(date, 5, options);
+}
+// lib/nextMonday.js
+function _nextMonday(date, options) {
+ return _nextDay(date, 1, options);
+}
+// lib/nextSaturday.js
+function _nextSaturday(date, options) {
+ return _nextDay(date, 6, options);
+}
+// lib/nextSunday.js
+function _nextSunday(date, options) {
+ return _nextDay(date, 0, options);
+}
+// lib/nextThursday.js
+function _nextThursday(date, options) {
+ return _nextDay(date, 4, options);
+}
+// lib/nextTuesday.js
+function _nextTuesday(date, options) {
+ return _nextDay(date, 2, options);
+}
+// lib/nextWednesday.js
+function _nextWednesday(date, options) {
+ return _nextDay(date, 3, options);
+}
+// lib/parseISO.js
+function _parseISO(argument, options) {var _options$additionalDi;
+ var invalidDate = function invalidDate() {return _constructFrom(options === null || options === void 0 ? void 0 : options.in, NaN);};
+ var additionalDigits = (_options$additionalDi = options === null || options === void 0 ? void 0 : options.additionalDigits) !== null && _options$additionalDi !== void 0 ? _options$additionalDi : 2;
+ var dateStrings = splitDateString(argument);
+ var date;
+ if (dateStrings.date) {
+ var parseYearResult = parseYear(dateStrings.date, additionalDigits);
+ date = parseDate(parseYearResult.restDateString, parseYearResult.year);
+ }
+ if (!date || isNaN(+date))
+ return invalidDate();
+ var timestamp = +date;
+ var time = 0;
+ var offset;
+ if (dateStrings.time) {
+ time = parseTime(dateStrings.time);
+ if (isNaN(time))
+ return invalidDate();
+ }
+ if (dateStrings.timezone) {
+ offset = parseTimezone(dateStrings.timezone);
+ if (isNaN(offset))
+ return invalidDate();
+ } else {
+ var tmpDate = new Date(timestamp + time);
+ var result = _toDate(0, options === null || options === void 0 ? void 0 : options.in);
+ result.setFullYear(tmpDate.getUTCFullYear(), tmpDate.getUTCMonth(), tmpDate.getUTCDate());
+ result.setHours(tmpDate.getUTCHours(), tmpDate.getUTCMinutes(), tmpDate.getUTCSeconds(), tmpDate.getUTCMilliseconds());
+ return result;
+ }
+ return _toDate(timestamp + time + offset, options === null || options === void 0 ? void 0 : options.in);
+}
+function splitDateString(dateString) {
+ var dateStrings = {};
+ var array = dateString.split(patterns.dateTimeDelimiter);
+ var timeString;
+ if (array.length > 2) {
+ return dateStrings;
+ }
+ if (/:/.test(array[0])) {
+ timeString = array[0];
+ } else {
+ dateStrings.date = array[0];
+ timeString = array[1];
+ if (patterns.timeZoneDelimiter.test(dateStrings.date)) {
+ dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0];
+ timeString = dateString.substr(dateStrings.date.length, dateString.length);
+ }
+ }
+ if (timeString) {
+ var token = patterns.timezone.exec(timeString);
+ if (token) {
+ dateStrings.time = timeString.replace(token[1], "");
+ dateStrings.timezone = token[1];
+ } else {
+ dateStrings.time = timeString;
+ }
+ }
+ return dateStrings;
+}
+function parseYear(dateString, additionalDigits) {
+ var regex = new RegExp("^(?:(\\d{4}|[+-]\\d{" + (4 + additionalDigits) + "})|(\\d{2}|[+-]\\d{" + (2 + additionalDigits) + "})$)");
+ var captures = dateString.match(regex);
+ if (!captures)
+ return { year: NaN, restDateString: "" };
+ var year = captures[1] ? parseInt(captures[1]) : null;
+ var century = captures[2] ? parseInt(captures[2]) : null;
+ return {
+ year: century === null ? year : century * 100,
+ restDateString: dateString.slice((captures[1] || captures[2]).length)
+ };
+}
+function parseDate(dateString, year) {
+ if (year === null)
+ return new Date(NaN);
+ var captures = dateString.match(dateRegex);
+ if (!captures)
+ return new Date(NaN);
+ var isWeekDate = !!captures[4];
+ var dayOfYear = parseDateUnit(captures[1]);
+ var month = parseDateUnit(captures[2]) - 1;
+ var day = parseDateUnit(captures[3]);
+ var week = parseDateUnit(captures[4]);
+ var dayOfWeek = parseDateUnit(captures[5]) - 1;
+ if (isWeekDate) {
+ if (!validateWeekDate(year, week, dayOfWeek)) {
+ return new Date(NaN);
+ }
+ return dayOfISOWeekYear(year, week, dayOfWeek);
+ } else {
+ var date = new Date(0);
+ if (!validateDate(year, month, day) || !validateDayOfYearDate(year, dayOfYear)) {
+ return new Date(NaN);
+ }
+ date.setUTCFullYear(year, month, Math.max(dayOfYear, day));
+ return date;
+ }
+}
+function parseDateUnit(value) {
+ return value ? parseInt(value) : 1;
+}
+function parseTime(timeString) {
+ var captures = timeString.match(timeRegex);
+ if (!captures)
+ return NaN;
+ var hours = parseTimeUnit(captures[1]);
+ var minutes = parseTimeUnit(captures[2]);
+ var seconds = parseTimeUnit(captures[3]);
+ if (!validateTime(hours, minutes, seconds)) {
+ return NaN;
+ }
+ return hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * 1000;
+}
+function parseTimeUnit(value) {
+ return value && parseFloat(value.replace(",", ".")) || 0;
+}
+function parseTimezone(timezoneString) {
+ if (timezoneString === "Z")
+ return 0;
+ var captures = timezoneString.match(timezoneRegex);
+ if (!captures)
+ return 0;
+ var sign = captures[1] === "+" ? -1 : 1;
+ var hours = parseInt(captures[2]);
+ var minutes = captures[3] && parseInt(captures[3]) || 0;
+ if (!validateTimezone(hours, minutes)) {
+ return NaN;
+ }
+ return sign * (hours * millisecondsInHour + minutes * millisecondsInMinute);
+}
+function dayOfISOWeekYear(isoWeekYear, week, day) {
+ var date = new Date(0);
+ date.setUTCFullYear(isoWeekYear, 0, 4);
+ var fourthOfJanuaryDay = date.getUTCDay() || 7;
+ var diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;
+ date.setUTCDate(date.getUTCDate() + diff);
+ return date;
+}
+function isLeapYearIndex2(year) {
+ return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
+}
+function validateDate(year, month, date) {
+ return month >= 0 && month <= 11 && date >= 1 && date <= (daysInMonths[month] || (isLeapYearIndex2(year) ? 29 : 28));
+}
+function validateDayOfYearDate(year, dayOfYear) {
+ return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex2(year) ? 366 : 365);
+}
+function validateWeekDate(_year, week, day) {
+ return week >= 1 && week <= 53 && day >= 0 && day <= 6;
+}
+function validateTime(hours, minutes, seconds) {
+ if (hours === 24) {
+ return minutes === 0 && seconds === 0;
+ }
+ return seconds >= 0 && seconds < 60 && minutes >= 0 && minutes < 60 && hours >= 0 && hours < 25;
+}
+function validateTimezone(_hours, minutes) {
+ return minutes >= 0 && minutes <= 59;
+}
+var patterns = {
+ dateTimeDelimiter: /[T ]/,
+ timeZoneDelimiter: /[Z ]/i,
+ timezone: /([Z+-].*)$/
+};
+var dateRegex = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/;
+var timeRegex = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/;
+var timezoneRegex = /^([+-])(\d{2})(?::?(\d{2}))?$/;
+var daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
+// lib/parseJSON.js
+function _parseJSON(dateStr, options) {
+ var parts = dateStr.match(/(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(?:\.(\d{0,7}))?(?:Z|(.)(\d{2}):?(\d{2})?)?/);
+ if (!parts)
+ return _toDate(NaN, options === null || options === void 0 ? void 0 : options.in);
+ return _toDate(Date.UTC(+parts[1], +parts[2] - 1, +parts[3], +parts[4] - (+parts[9] || 0) * (parts[8] == "-" ? -1 : 1), +parts[5] - (+parts[10] || 0) * (parts[8] == "-" ? -1 : 1), +parts[6], +((parts[7] || "0") + "00").substring(0, 3)), options === null || options === void 0 ? void 0 : options.in);
+}
+// lib/previousDay.js
+function _previousDay(date, day, options) {
+ var delta = _getDay(date, options) - day;
+ if (delta <= 0)
+ delta += 7;
+ return _subDays(date, delta, options);
+}
+// lib/previousFriday.js
+function _previousFriday(date, options) {
+ return _previousDay(date, 5, options);
+}
+// lib/previousMonday.js
+function _previousMonday(date, options) {
+ return _previousDay(date, 1, options);
+}
+// lib/previousSaturday.js
+function _previousSaturday(date, options) {
+ return _previousDay(date, 6, options);
+}
+// lib/previousSunday.js
+function _previousSunday(date, options) {
+ return _previousDay(date, 0, options);
+}
+// lib/previousThursday.js
+function _previousThursday(date, options) {
+ return _previousDay(date, 4, options);
+}
+// lib/previousTuesday.js
+function _previousTuesday(date, options) {
+ return _previousDay(date, 2, options);
+}
+// lib/previousWednesday.js
+function _previousWednesday(date, options) {
+ return _previousDay(date, 3, options);
+}
+// lib/quartersToMonths.js
+function _quartersToMonths(quarters) {
+ return Math.trunc(quarters * monthsInQuarter);
+}
+// lib/quartersToYears.js
+function _quartersToYears(quarters) {
+ var years = quarters / quartersInYear;
+ return Math.trunc(years);
+}
+// lib/roundToNearestHours.js
+function _roundToNearestHours(date, options) {var _options$nearestTo, _options$roundingMeth2;
+ var nearestTo = (_options$nearestTo = options === null || options === void 0 ? void 0 : options.nearestTo) !== null && _options$nearestTo !== void 0 ? _options$nearestTo : 1;
+ if (nearestTo < 1 || nearestTo > 12)
+ return _constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, NaN);
+ var date_ = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ var fractionalMinutes = date_.getMinutes() / 60;
+ var fractionalSeconds = date_.getSeconds() / 60 / 60;
+ var fractionalMilliseconds = date_.getMilliseconds() / 1000 / 60 / 60;
+ var hours = date_.getHours() + fractionalMinutes + fractionalSeconds + fractionalMilliseconds;
+ var method = (_options$roundingMeth2 = options === null || options === void 0 ? void 0 : options.roundingMethod) !== null && _options$roundingMeth2 !== void 0 ? _options$roundingMeth2 : "round";
+ var roundingMethod = getRoundingMethod(method);
+ var roundedHours = roundingMethod(hours / nearestTo) * nearestTo;
+ date_.setHours(roundedHours, 0, 0, 0);
+ return date_;
+}
+// lib/roundToNearestMinutes.js
+function _roundToNearestMinutes(date, options) {var _options$nearestTo2, _options$roundingMeth3;
+ var nearestTo = (_options$nearestTo2 = options === null || options === void 0 ? void 0 : options.nearestTo) !== null && _options$nearestTo2 !== void 0 ? _options$nearestTo2 : 1;
+ if (nearestTo < 1 || nearestTo > 30)
+ return _constructFrom(date, NaN);
+ var date_ = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ var fractionalSeconds = date_.getSeconds() / 60;
+ var fractionalMilliseconds = date_.getMilliseconds() / 1000 / 60;
+ var minutes = date_.getMinutes() + fractionalSeconds + fractionalMilliseconds;
+ var method = (_options$roundingMeth3 = options === null || options === void 0 ? void 0 : options.roundingMethod) !== null && _options$roundingMeth3 !== void 0 ? _options$roundingMeth3 : "round";
+ var roundingMethod = getRoundingMethod(method);
+ var roundedMinutes = roundingMethod(minutes / nearestTo) * nearestTo;
+ date_.setMinutes(roundedMinutes, 0, 0);
+ return date_;
+}
+// lib/secondsToHours.js
+function _secondsToHours(seconds) {
+ var hours = seconds / secondsInHour;
+ return Math.trunc(hours);
+}
+// lib/secondsToMilliseconds.js
+function _secondsToMilliseconds(seconds) {
+ return seconds * millisecondsInSecond;
+}
+// lib/secondsToMinutes.js
+function _secondsToMinutes(seconds) {
+ var minutes = seconds / secondsInMinute;
+ return Math.trunc(minutes);
+}
+// lib/setMonth.js
+function _setMonth(date, month, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ var year = _date.getFullYear();
+ var day = _date.getDate();
+ var midMonth = _constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, 0);
+ midMonth.setFullYear(year, month, 15);
+ midMonth.setHours(0, 0, 0, 0);
+ var daysInMonth = _getDaysInMonth(midMonth);
+ _date.setMonth(month, Math.min(day, daysInMonth));
+ return _date;
+}
+
+// lib/set.js
+function _set(date, values, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ if (isNaN(+_date))
+ return _constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, NaN);
+ if (values.year != null)
+ _date.setFullYear(values.year);
+ if (values.month != null)
+ _date = _setMonth(_date, values.month);
+ if (values.date != null)
+ _date.setDate(values.date);
+ if (values.hours != null)
+ _date.setHours(values.hours);
+ if (values.minutes != null)
+ _date.setMinutes(values.minutes);
+ if (values.seconds != null)
+ _date.setSeconds(values.seconds);
+ if (values.milliseconds != null)
+ _date.setMilliseconds(values.milliseconds);
+ return _date;
+}
+// lib/setDate.js
+function _setDate(date, dayOfMonth, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ _date.setDate(dayOfMonth);
+ return _date;
+}
+// lib/setDayOfYear.js
+function _setDayOfYear(date, dayOfYear, options) {
+ var date_ = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ date_.setMonth(0);
+ date_.setDate(dayOfYear);
+ return date_;
+}
+// lib/setDefaultOptions.js
+function setDefaultOptions2(options) {
+ var result = {};
+ var defaultOptions16 = getDefaultOptions();
+ for (var property in defaultOptions16) {
+ if (Object.prototype.hasOwnProperty.call(defaultOptions16, property)) {
+ result[property] = defaultOptions16[property];
+ }
+ }
+ for (var _property in options) {
+ if (Object.prototype.hasOwnProperty.call(options, _property)) {
+ if (options[_property] === undefined) {
+ delete result[_property];
+ } else {
+ result[_property] = options[_property];
+ }
+ }
+ }
+ setDefaultOptions(result);
+}
+// lib/setHours.js
+function _setHours(date, hours, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ _date.setHours(hours);
+ return _date;
+}
+// lib/setMilliseconds.js
+function _setMilliseconds(date, milliseconds2, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ _date.setMilliseconds(milliseconds2);
+ return _date;
+}
+// lib/setMinutes.js
+function _setMinutes(date, minutes, options) {
+ var date_ = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ date_.setMinutes(minutes);
+ return date_;
+}
+// lib/setQuarter.js
+function _setQuarter(date, quarter, options) {
+ var date_ = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ var oldQuarter = Math.trunc(date_.getMonth() / 3) + 1;
+ var diff = quarter - oldQuarter;
+ return _setMonth(date_, date_.getMonth() + diff * 3);
+}
+// lib/setSeconds.js
+function _setSeconds(date, seconds, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ _date.setSeconds(seconds);
+ return _date;
+}
+// lib/setWeekYear.js
+function _setWeekYear(date, weekYear, options) {var _ref44, _ref45, _ref46, _options$firstWeekCon5, _options$locale19, _defaultOptions17$loc;
+ var defaultOptions17 = getDefaultOptions();
+ var firstWeekContainsDate = (_ref44 = (_ref45 = (_ref46 = (_options$firstWeekCon5 = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon5 !== void 0 ? _options$firstWeekCon5 : options === null || options === void 0 || (_options$locale19 = options.locale) === null || _options$locale19 === void 0 || (_options$locale19 = _options$locale19.options) === null || _options$locale19 === void 0 ? void 0 : _options$locale19.firstWeekContainsDate) !== null && _ref46 !== void 0 ? _ref46 : defaultOptions17.firstWeekContainsDate) !== null && _ref45 !== void 0 ? _ref45 : (_defaultOptions17$loc = defaultOptions17.locale) === null || _defaultOptions17$loc === void 0 || (_defaultOptions17$loc = _defaultOptions17$loc.options) === null || _defaultOptions17$loc === void 0 ? void 0 : _defaultOptions17$loc.firstWeekContainsDate) !== null && _ref44 !== void 0 ? _ref44 : 1;
+ var diff = _differenceInCalendarDays(_toDate(date, options === null || options === void 0 ? void 0 : options.in), _startOfWeekYear(date, options), options);
+ var firstWeek = _constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, 0);
+ firstWeek.setFullYear(weekYear, 0, firstWeekContainsDate);
+ firstWeek.setHours(0, 0, 0, 0);
+ var date_ = _startOfWeekYear(firstWeek, options);
+ date_.setDate(date_.getDate() + diff);
+ return date_;
+}
+// lib/setYear.js
+function _setYear(date, year, options) {
+ var date_ = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ if (isNaN(+date_))
+ return _constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, NaN);
+ date_.setFullYear(year);
+ return date_;
+}
+// lib/startOfDecade.js
+function _startOfDecade(date, options) {
+ var _date = _toDate(date, options === null || options === void 0 ? void 0 : options.in);
+ var year = _date.getFullYear();
+ var decade = Math.floor(year / 10) * 10;
+ _date.setFullYear(decade, 0, 1);
+ _date.setHours(0, 0, 0, 0);
+ return _date;
+}
+// lib/startOfToday.js
+function _startOfToday(options) {
+ return _startOfDay(Date.now(), options);
+}
+// lib/startOfTomorrow.js
+function _startOfTomorrow(options) {
+ var now = _constructNow(options === null || options === void 0 ? void 0 : options.in);
+ var year = now.getFullYear();
+ var month = now.getMonth();
+ var day = now.getDate();
+ var date = _constructFrom(options === null || options === void 0 ? void 0 : options.in, 0);
+ date.setFullYear(year, month, day + 1);
+ date.setHours(0, 0, 0, 0);
+ return date;
+}
+// lib/startOfYesterday.js
+function _startOfYesterday(options) {
+ var now = _constructNow(options === null || options === void 0 ? void 0 : options.in);
+ var year = now.getFullYear();
+ var month = now.getMonth();
+ var day = now.getDate();
+ var date = _constructNow(options === null || options === void 0 ? void 0 : options.in);
+ date.setFullYear(year, month, day - 1);
+ date.setHours(0, 0, 0, 0);
+ return date;
+}
+// lib/subMonths.js
+function _subMonths(date, amount, options) {
+ return _addMonths(date, -amount, options);
+}
+
+// lib/sub.js
+function _sub(date, duration, options) {
+ var _duration$years3 =
+
+
+
+
+
+
+
+ duration.years,years = _duration$years3 === void 0 ? 0 : _duration$years3,_duration$months3 = duration.months,months2 = _duration$months3 === void 0 ? 0 : _duration$months3,_duration$weeks2 = duration.weeks,weeks = _duration$weeks2 === void 0 ? 0 : _duration$weeks2,_duration$days3 = duration.days,days2 = _duration$days3 === void 0 ? 0 : _duration$days3,_duration$hours3 = duration.hours,hours = _duration$hours3 === void 0 ? 0 : _duration$hours3,_duration$minutes3 = duration.minutes,minutes = _duration$minutes3 === void 0 ? 0 : _duration$minutes3,_duration$seconds3 = duration.seconds,seconds = _duration$seconds3 === void 0 ? 0 : _duration$seconds3;
+ var withoutMonths = _subMonths(date, months2 + years * 12, options);
+ var withoutDays = _subDays(withoutMonths, days2 + weeks * 7, options);
+ var minutesToSub = minutes + hours * 60;
+ var secondsToSub = seconds + minutesToSub * 60;
+ var msToSub = secondsToSub * 1000;
+ return _constructFrom((options === null || options === void 0 ? void 0 : options.in) || date, +withoutDays - msToSub);
+}
+// lib/subBusinessDays.js
+function _subBusinessDays(date, amount, options) {
+ return _addBusinessDays(date, -amount, options);
+}
+// lib/subHours.js
+function _subHours(date, amount, options) {
+ return _addHours(date, -amount, options);
+}
+// lib/subMilliseconds.js
+function _subMilliseconds(date, amount, options) {
+ return _addMilliseconds(date, -amount, options);
+}
+// lib/subMinutes.js
+function _subMinutes(date, amount, options) {
+ return _addMinutes(date, -amount, options);
+}
+// lib/subQuarters.js
+function _subQuarters(date, amount, options) {
+ return _addQuarters(date, -amount, options);
+}
+// lib/subSeconds.js
+function _subSeconds(date, amount, options) {
+ return _addSeconds(date, -amount, options);
+}
+// lib/subWeeks.js
+function _subWeeks(date, amount, options) {
+ return _addWeeks(date, -amount, options);
+}
+// lib/subYears.js
+function _subYears(date, amount, options) {
+ return _addYears(date, -amount, options);
+}
+// lib/weeksToDays.js
+function _weeksToDays(weeks) {
+ return Math.trunc(weeks * daysInWeek);
+}
+// lib/yearsToDays.js
+function _yearsToDays(years) {
+ return Math.trunc(years * daysInYear);
+}
+// lib/yearsToMonths.js
+function _yearsToMonths(years) {
+ return Math.trunc(years * monthsInYear);
+}
+// lib/yearsToQuarters.js
+function _yearsToQuarters(years) {
+ return Math.trunc(years * quartersInYear);
+}
+// lib/cdn.js
+window.dateFns = _objectSpread(_objectSpread({},
+window.dateFns),
+exports_lib);
+
+
+//# debugId=C576AA8F71413BF164756E2164756E21
+
+//# sourceMappingURL=cdn.js.map
+})();
\ No newline at end of file
diff --git a/node_modules/date-fns/cdn.js.map b/node_modules/date-fns/cdn.js.map
new file mode 100644
index 00000000..75faecb1
--- /dev/null
+++ b/node_modules/date-fns/cdn.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"cdn.js","names":["__defProp","Object","defineProperty","__export","target","all","name","get","enumerable","configurable","set","newValue","exports_lib","yearsToQuarters","yearsToMonths","yearsToDays","weeksToDays","transpose","toDate","subYears","subWeeks","subSeconds","subQuarters","subMonths","subMinutes","subMilliseconds","subISOWeekYears","subHours","subDays","subBusinessDays","sub","startOfYesterday","startOfYear","startOfWeekYear","startOfWeek","startOfTomorrow","startOfToday","startOfSecond","startOfQuarter","startOfMonth","startOfMinute","startOfISOWeekYear","startOfISOWeek","startOfHour","startOfDecade","startOfDay","setYear","setWeekYear","setWeek","setSeconds","setQuarter","setMonth","setMinutes","setMilliseconds","setISOWeekYear","setISOWeek","setISODay","setHours","setDefaultOptions","setDefaultOptions2","setDayOfYear","setDay","setDate","secondsToMinutes","secondsToMilliseconds","secondsToHours","roundToNearestMinutes","roundToNearestHours","quartersToYears","quartersToMonths","previousWednesday","previousTuesday","previousThursday","previousSunday","previousSaturday","previousMonday","previousFriday","previousDay","parsers","parseJSON","parseISO","parse","nextWednesday","nextTuesday","nextThursday","nextSunday","nextSaturday","nextMonday","nextFriday","nextDay","monthsToYears","monthsToQuarters","minutesToSeconds","minutesToMilliseconds","minutesToHours","min","millisecondsToSeconds","millisecondsToMinutes","millisecondsToHours","milliseconds","max","longFormatters","lightFormatters","lightFormat","lastDayOfYear","lastDayOfWeek","lastDayOfQuarter","lastDayOfMonth","lastDayOfISOWeekYear","lastDayOfISOWeek","lastDayOfDecade","isYesterday","isWithinInterval","isWeekend","isWednesday","isValid","isTuesday","isTomorrow","isToday","isThursday","isThisYear","isThisWeek","isThisSecond","isThisQuarter","isThisMonth","isThisMinute","isThisISOWeek","isThisHour","isSunday","isSaturday","isSameYear","isSameWeek","isSameSecond","isSameQuarter","isSameMonth","isSameMinute","isSameISOWeekYear","isSameISOWeek","isSameHour","isSameDay","isPast","isMonday","isMatch","isLeapYear","isLastDayOfMonth","isFuture","isFriday","isFirstDayOfMonth","isExists","isEqual","isDate","isBefore","isAfter","intlFormatDistance","intlFormat","intervalToDuration","interval","hoursToSeconds","hoursToMinutes","hoursToMilliseconds","getYear","getWeeksInMonth","getWeekYear","getWeekOfMonth","getWeek","getUnixTime","getTime","getSeconds","getQuarter","getOverlappingDaysInIntervals","getMonth","getMinutes","getMilliseconds","getISOWeeksInYear","getISOWeekYear","getISOWeek","getISODay","getHours","getDefaultOptions","getDefaultOptions2","getDecade","getDaysInYear","getDaysInMonth","getDayOfYear","getDay","getDate","fromUnixTime","formatters","formatRelative","formatRelative3","formatRFC7231","formatRFC3339","formatISODuration","formatISO9075","formatISO","formatDuration","formatDistanceToNowStrict","formatDistanceToNow","formatDistanceStrict","formatDistance","formatDistance3","formatDate","format","endOfYesterday","endOfYear","endOfWeek","endOfTomorrow","endOfToday","endOfSecond","endOfQuarter","endOfMonth","endOfMinute","endOfISOWeekYear","endOfISOWeek","endOfHour","endOfDecade","endOfDay","eachYearOfInterval","eachWeekendOfYear","eachWeekendOfMonth","eachWeekendOfInterval","eachWeekOfInterval","eachQuarterOfInterval","eachMonthOfInterval","eachMinuteOfInterval","eachHourOfInterval","eachDayOfInterval","differenceInYears","differenceInWeeks","differenceInSeconds","differenceInQuarters","differenceInMonths","differenceInMinutes","differenceInMilliseconds","differenceInISOWeekYears","differenceInHours","differenceInDays","differenceInCalendarYears","differenceInCalendarWeeks","differenceInCalendarQuarters","differenceInCalendarMonths","differenceInCalendarISOWeeks","differenceInCalendarISOWeekYears","differenceInCalendarDays","differenceInBusinessDays","daysToWeeks","constructNow","constructFrom","compareDesc","compareAsc","closestTo","closestIndexTo","clamp","areIntervalsOverlapping","addYears","addWeeks","addSeconds","addQuarters","addMonths","addMinutes","addMilliseconds","addISOWeekYears","addHours","addDays","addBusinessDays","add","daysInWeek","daysInYear","maxTime","Math","pow","minTime","millisecondsInWeek","millisecondsInDay","millisecondsInMinute","millisecondsInHour","millisecondsInSecond","minutesInYear","minutesInMonth","minutesInDay","minutesInHour","monthsInQuarter","monthsInYear","quartersInYear","secondsInHour","secondsInMinute","secondsInDay","secondsInWeek","secondsInYear","secondsInMonth","secondsInQuarter","constructFromSymbol","Symbol","for","date","value","_typeof","Date","constructor","argument","context","amount","options","_date","in","isNaN","NaN","dayOfMonth","endOfDesiredMonth","daysInMonth","setFullYear","getFullYear","duration","_duration$years","years","_duration$months","months","_duration$weeks","weeks","_duration$days","days","_duration$hours","hours","_duration$minutes","minutes","_duration$seconds","seconds","dateWithMonths","dateWithDays","minutesToAdd","secondsToAdd","msToAdd","day","startedOnWeekend","sign","fullWeeks","trunc","restDays","abs","defaultOptions","newOptions","_ref","_ref2","_ref3","_options$weekStartsOn","_options$locale","_defaultOptions3$loca","defaultOptions3","weekStartsOn","locale","diff","_objectSpread","year","fourthOfJanuaryOfNextYear","startOfNextYear","fourthOfJanuaryOfThisYear","startOfThisYear","getTimezoneOffsetInMilliseconds","utcDate","UTC","setUTCFullYear","normalizeDates","_len","arguments","length","dates","Array","_key","normalize","bind","find","map","laterDate","earlierDate","_normalizeDates","_normalizeDates2","_slicedToArray","laterDate_","earlierDate_","laterStartOfDay","earlierStartOfDay","laterTimestamp","earlierTimestamp","round","fourthOfJanuary","weekYear","setTime","intervalLeft","intervalRight","_sort","start","end","sort","a","b","_sort2","leftStartTime","leftEndTime","_sort3","_sort4","rightStartTime","rightEndTime","inclusive","result","forEach","date_","_normalizeDates3","_normalizeDates4","dateToCompare","timeToCompare","minDistance","index","distance","_normalizeDates5","apply","concat","_toConsumableArray","_normalizeDates6","_toArray","dateToCompare_","dates_","slice","undefined","dateLeft","dateRight","now","_normalizeDates7","_normalizeDates8","dateLeft_","dateRight_","prototype","toString","call","_normalizeDates9","_normalizeDates10","movingDate","_normalizeDates11","_normalizeDates12","_normalizeDates13","_normalizeDates14","startOfISOWeekLeft","startOfISOWeekRight","timestampLeft","timestampRight","_normalizeDates15","_normalizeDates16","yearsDiff","monthsDiff","quarter","_normalizeDates17","_normalizeDates18","quartersDiff","_normalizeDates19","_normalizeDates20","laterStartOfWeek","earlierStartOfWeek","_normalizeDates21","_normalizeDates22","_normalizeDates23","_normalizeDates24","compareLocalAsc","difference","isLastDayNotFull","Number","getRoundingMethod","method","number","_normalizeDates25","_normalizeDates26","roundingMethod","_normalizeDates27","_normalizeDates28","adjustedDate","isLastISOWeekYearNotFull","month","_normalizeDates29","_normalizeDates30","workingLaterDate","isLastMonthNotFull","_normalizeDates31","_normalizeDates32","partial","normalizeInterval","_normalizeDates33","_normalizeDates34","_options$step","_normalizeInterval","reversed","endTime","step","push","reverse","_options$step2","_normalizeInterval2","_options$step3","_normalizeInterval3","_options$step4","_normalizeInterval4","currentMonth","_options$step5","_normalizeInterval5","_options$step6","_normalizeInterval6","startDateWeek","endDateWeek","currentDate","_normalizeInterval7","dateInterval","weekends","_options$step7","_normalizeInterval8","decade","floor","_ref4","_ref5","_ref6","_options$weekStartsOn2","_options$locale2","_defaultOptions4$loca","defaultOptions4","formatDistanceLocale","lessThanXSeconds","one","other","xSeconds","halfAMinute","lessThanXMinutes","xMinutes","aboutXHours","xHours","xDays","aboutXWeeks","xWeeks","aboutXMonths","xMonths","aboutXYears","xYears","overXYears","almostXYears","token","count","tokenValue","replace","addSuffix","comparison","buildFormatLongFn","args","width","String","defaultWidth","formats","dateFormats","full","long","medium","short","timeFormats","dateTimeFormats","formatLong","time","dateTime","formatRelativeLocale","lastWeek","yesterday","today","tomorrow","nextWeek","_baseDate","_options","buildLocalizeFn","valuesArray","formattingValues","defaultFormattingWidth","values","argumentCallback","eraValues","narrow","abbreviated","wide","quarterValues","monthValues","dayValues","dayPeriodValues","am","pm","midnight","noon","morning","afternoon","evening","night","formattingDayPeriodValues","ordinalNumber","dirtyNumber","rem100","localize","era","dayPeriod","buildMatchFn","string","matchPattern","matchPatterns","defaultMatchWidth","matchResult","match","matchedString","parsePatterns","defaultParseWidth","key","isArray","findIndex","pattern","test","findKey","valueCallback","rest","object","predicate","hasOwnProperty","array","buildMatchPatternFn","parseResult","parsePattern","matchOrdinalNumberPattern","parseOrdinalNumberPattern","matchEraPatterns","parseEraPatterns","any","matchQuarterPatterns","parseQuarterPatterns","matchMonthPatterns","parseMonthPatterns","matchDayPatterns","parseDayPatterns","matchDayPeriodPatterns","parseDayPeriodPatterns","parseInt","enUS","code","firstWeekContainsDate","dayOfYear","_ref7","_ref8","_ref9","_options$firstWeekCon","_options$locale3","_defaultOptions5$loca","defaultOptions5","firstWeekOfNextYear","firstWeekOfThisYear","_ref10","_ref11","_ref12","_options$firstWeekCon2","_options$locale4","_defaultOptions6$loca","defaultOptions6","firstWeek","addLeadingZeros","targetLength","output","padStart","y","signedYear","M","d","dayPeriodEnumValue","toUpperCase","h","H","m","s","S","numberOfDigits","fractionalSeconds","formatTimezoneShort","offset","delimiter","absOffset","formatTimezoneWithOptionalMinutes","formatTimezone","dayPeriodEnum","G","localize3","unit","Y","signedWeekYear","twoDigitYear","R","isoWeekYear","u","Q","ceil","q","L","w","week","I","isoWeek","D","E","dayOfWeek","e","localDayOfWeek","c","i","isoDayOfWeek","toLowerCase","B","K","k","X","_localize","timezoneOffset","getTimezoneOffset","x","O","z","t","timestamp","T","dateLongFormatter","formatLong3","timeLongFormatter","dateTimeLongFormatter","datePattern","timePattern","dateTimeFormat","p","P","isProtectedDayOfYearToken","dayOfYearTokenRE","isProtectedWeekYearToken","weekYearTokenRE","warnOrThrowProtectedError","input","_message","message","console","warn","throwTokens","includes","RangeError","subject","formatStr","_ref13","_options$locale5","_ref14","_ref15","_ref16","_options$firstWeekCon3","_options$locale6","_defaultOptions7$loca","_ref17","_ref18","_ref19","_options$weekStartsOn3","_options$locale7","_defaultOptions7$loca2","defaultOptions7","originalDate","parts","longFormattingTokensRegExp","substring","firstCharacter","longFormatter","join","formattingTokensRegExp","isToken","cleanEscapedString","unescapedLatinCharacterRegExp","preprocessor","formatterOptions","part","useAdditionalWeekYearTokens","useAdditionalDayOfYearTokens","formatter","matched","escapedStringRegExp","doubleQuoteRegExp","_ref20","_options$locale8","defaultOptions8","minutesInAlmostTwoDays","localizeOptions","assign","_normalizeDates35","_normalizeDates36","offsetInSeconds","includeSeconds","nearestMonth","monthsSinceStartOfYear","_ref21","_options$locale9","_options$roundingMeth","defaultOptions9","_normalizeDates37","_normalizeDates38","dstNormalizedMinutes","defaultUnit","roundedMinutes","_ref22","_options$locale10","_options$format","_options$zero","_options$delimiter","defaultOptions10","format2","defaultFormat","zero","reduce","acc","_options$format2","_options$representati","representation","tzOffset","dateDelimiter","timeDelimiter","absoluteOffset","hourOffset","minuteOffset","hour","minute","second","separator","_options$format3","_options$representati2","_duration$years2","_duration$months2","_duration$days2","_duration$hours2","_duration$minutes2","_duration$seconds2","_options$fractionDigi","fractionDigits","fractionalSecond","dayName","getUTCDay","getUTCDate","monthName","getUTCMonth","getUTCFullYear","getUTCHours","getUTCMinutes","getUTCSeconds","baseDate","_ref23","_options$locale11","_ref24","_ref25","_ref26","_options$weekStartsOn4","_options$locale12","_defaultOptions11$loc","_normalizeDates39","_normalizeDates40","baseDate_","defaultOptions11","unixTime","monthIndex","thisYear","nextYear","_sort5","_sort6","leftStart","leftEnd","_sort7","_sort8","rightStart","rightEnd","isOverlapping","overlapLeft","left","overlapRight","right","_ref27","_ref28","_ref29","_options$weekStartsOn5","_options$locale13","_defaultOptions13$loc","defaultOptions13","currentDayOfMonth","startWeekDay","lastDayOfFirstWeek","remainingDaysAfterFirstWeek","contextDate","_normalizeDates41","_normalizeDates42","_start","_end","TypeError","assertPositive","interval2","_normalizeInterval9","remainingMonths","months2","remainingDays","days2","remainingHours","remainingMinutes","remainingSeconds","formatOrLocale","localeOptions","_localeOptions","formatOptions","isFormatOptions","Intl","DateTimeFormat","opts","_normalizeDates43","_normalizeDates44","diffInSeconds","rtf","RelativeTimeFormat","numeric","leftDate","rightDate","isConstructor","_constructor$prototyp","TIMEZONE_UNIT_PRIORITY","Setter","_classCallCheck","_defineProperty","_createClass","validate","_utcDate","ValueSetter","_Setter2","_inherits","validateValue","setValue","priority","subPriority","_this","_callSuper","flags","DateTimezoneSetter","_Setter3","reference","_this2","_assertThisInitialized","timestampIsSet","Parser","run","dateString","match3","setter","_value","EraParser","_Parser","_this3","_len2","_key2","numericPatterns","hour23h","hour24h","hour11h","hour12h","singleDigit","twoDigits","threeDigits","fourDigits","anyDigitsSigned","singleDigitSigned","twoDigitsSigned","threeDigitsSigned","fourDigitsSigned","timezonePatterns","basicOptionalMinutes","basic","basicOptionalSeconds","extended","extendedOptionalSeconds","mapValue","parseFnResult","mapFn","parseNumericPattern","parseTimezonePattern","parseAnyDigitsSigned","parseNDigits","n","RegExp","parseNDigitsSigned","dayPeriodEnumToHours","normalizeTwoDigitYear","currentYear","isCommonEra","absCurrentYear","rangeEnd","rangeEndCentury","isPreviousCentury","isLeapYearIndex","YearParser","_Parser2","_this4","_len3","_key3","isTwoDigitYear","normalizedTwoDigitYear","LocalWeekYearParser","_Parser3","_this5","_len4","_key4","ISOWeekYearParser","_Parser4","_this6","_len5","_key5","_flags","firstWeekOfYear","ExtendedYearParser","_Parser5","_this7","_len6","_key6","QuarterParser","_Parser6","_this8","_len7","_key7","StandAloneQuarterParser","_Parser7","_this9","_len8","_key8","MonthParser","_Parser8","_this10","_len9","_key9","StandAloneMonthParser","_Parser9","_this11","_len10","_key10","LocalWeekParser","_Parser10","_this12","_len11","_key11","ISOWeekParser","_Parser11","_this13","_len12","_key12","DAYS_IN_MONTH","DAYS_IN_MONTH_LEAP_YEAR","DateParser","_Parser12","_this14","_len13","_key13","isLeapYear3","DayOfYearParser","_Parser13","_this15","_len14","_key14","_ref30","_ref31","_ref32","_options$weekStartsOn6","_options$locale14","_defaultOptions14$loc","defaultOptions14","currentDay","remainder","dayIndex","delta","DayParser","_Parser14","_this16","_len15","_key15","LocalDayParser","_Parser15","_this17","_len16","_key16","wholeWeekDays","StandAloneLocalDayParser","_Parser16","_this18","_len17","_key17","ISODayParser","_Parser17","_this19","_len18","_key18","AMPMParser","_Parser18","_this20","_len19","_key19","AMPMMidnightParser","_Parser19","_this21","_len20","_key20","DayPeriodParser","_Parser20","_this22","_len21","_key21","Hour1to12Parser","_Parser21","_this23","_len22","_key22","isPM","Hour0to23Parser","_Parser22","_this24","_len23","_key23","Hour0To11Parser","_Parser23","_this25","_len24","_key24","Hour1To24Parser","_Parser24","_this26","_len25","_key25","MinuteParser","_Parser25","_this27","_len26","_key26","SecondParser","_Parser26","_this28","_len27","_key27","FractionOfSecondParser","_Parser27","_this29","_len28","_key28","ISOTimezoneWithZParser","_Parser28","_this30","_len29","_key29","ISOTimezoneParser","_Parser29","_this31","_len30","_key30","TimestampSecondsParser","_Parser30","_this32","_len31","_key31","TimestampMillisecondsParser","_Parser31","_this33","_len32","_key32","dateStr","referenceDate","_ref33","_options$locale15","_ref34","_ref35","_ref36","_options$firstWeekCon4","_options$locale16","_defaultOptions14$loc2","_ref37","_ref38","_ref39","_options$weekStartsOn7","_options$locale17","_defaultOptions14$loc3","invalidDate","subFnOptions","setters","tokens","longFormattingTokensRegExp2","formattingTokensRegExp2","usedTokens","_iterator","_createForOfIteratorHelper","_step","_loop","parser","incompatibleTokens","incompatibleToken","usedToken","fullToken","v","unescapedLatinCharacterRegExp2","cleanEscapedString2","indexOf","_ret","done","err","f","notWhitespaceRegExp","uniquePrioritySetters","filter","setterArray","_iterator2","_step2","escapedStringRegExp2","doubleQuoteRegExp2","_normalizeDates45","_normalizeDates46","_normalizeDates47","_normalizeDates48","_normalizeDates49","_normalizeDates50","_normalizeDates51","_normalizeDates52","_normalizeDates53","_normalizeDates54","_normalizeDates55","_normalizeDates56","_sort9","_sort10","startTime","_ref40","_ref41","_ref42","_options$weekStartsOn8","_options$locale18","_defaultOptions15$loc","defaultOptions15","formattingTokensRegExp3","cleanEscapedString3","unescapedLatinCharacterRegExp3","matches","escapedStringRegExp3","doubleQuoteRegExp3","_ref43","totalDays","totalSeconds","milliseconds2","quarters","_options$additionalDi","additionalDigits","dateStrings","splitDateString","parseYearResult","parseYear","parseDate","restDateString","parseTime","timezone","parseTimezone","tmpDate","getUTCMilliseconds","split","patterns","dateTimeDelimiter","timeString","timeZoneDelimiter","substr","exec","regex","captures","century","dateRegex","isWeekDate","parseDateUnit","validateWeekDate","dayOfISOWeekYear","validateDate","validateDayOfYearDate","timeRegex","parseTimeUnit","validateTime","parseFloat","timezoneString","timezoneRegex","validateTimezone","fourthOfJanuaryDay","setUTCDate","isLeapYearIndex2","daysInMonths","_year","_hours","_options$nearestTo","_options$roundingMeth2","nearestTo","fractionalMinutes","fractionalMilliseconds","roundedHours","_options$nearestTo2","_options$roundingMeth3","midMonth","defaultOptions16","property","oldQuarter","_ref44","_ref45","_ref46","_options$firstWeekCon5","_options$locale19","_defaultOptions17$loc","defaultOptions17","_duration$years3","_duration$months3","_duration$weeks2","_duration$days3","_duration$hours3","_duration$minutes3","_duration$seconds3","withoutMonths","withoutDays","minutesToSub","secondsToSub","msToSub","window","dateFns"],"sources":["cdn.js"],"sourcesContent":["var __defProp = Object.defineProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, {\n get: all[name],\n enumerable: true,\n configurable: true,\n set: (newValue) => all[name] = () => newValue\n });\n};\n\n// lib/index.js\nvar exports_lib = {};\n__export(exports_lib, {\n yearsToQuarters: () => yearsToQuarters,\n yearsToMonths: () => yearsToMonths,\n yearsToDays: () => yearsToDays,\n weeksToDays: () => weeksToDays,\n transpose: () => transpose,\n toDate: () => toDate,\n subYears: () => subYears,\n subWeeks: () => subWeeks,\n subSeconds: () => subSeconds,\n subQuarters: () => subQuarters,\n subMonths: () => subMonths,\n subMinutes: () => subMinutes,\n subMilliseconds: () => subMilliseconds,\n subISOWeekYears: () => subISOWeekYears,\n subHours: () => subHours,\n subDays: () => subDays,\n subBusinessDays: () => subBusinessDays,\n sub: () => sub,\n startOfYesterday: () => startOfYesterday,\n startOfYear: () => startOfYear,\n startOfWeekYear: () => startOfWeekYear,\n startOfWeek: () => startOfWeek,\n startOfTomorrow: () => startOfTomorrow,\n startOfToday: () => startOfToday,\n startOfSecond: () => startOfSecond,\n startOfQuarter: () => startOfQuarter,\n startOfMonth: () => startOfMonth,\n startOfMinute: () => startOfMinute,\n startOfISOWeekYear: () => startOfISOWeekYear,\n startOfISOWeek: () => startOfISOWeek,\n startOfHour: () => startOfHour,\n startOfDecade: () => startOfDecade,\n startOfDay: () => startOfDay,\n setYear: () => setYear,\n setWeekYear: () => setWeekYear,\n setWeek: () => setWeek,\n setSeconds: () => setSeconds,\n setQuarter: () => setQuarter,\n setMonth: () => setMonth,\n setMinutes: () => setMinutes,\n setMilliseconds: () => setMilliseconds,\n setISOWeekYear: () => setISOWeekYear,\n setISOWeek: () => setISOWeek,\n setISODay: () => setISODay,\n setHours: () => setHours,\n setDefaultOptions: () => setDefaultOptions2,\n setDayOfYear: () => setDayOfYear,\n setDay: () => setDay,\n setDate: () => setDate,\n set: () => set,\n secondsToMinutes: () => secondsToMinutes,\n secondsToMilliseconds: () => secondsToMilliseconds,\n secondsToHours: () => secondsToHours,\n roundToNearestMinutes: () => roundToNearestMinutes,\n roundToNearestHours: () => roundToNearestHours,\n quartersToYears: () => quartersToYears,\n quartersToMonths: () => quartersToMonths,\n previousWednesday: () => previousWednesday,\n previousTuesday: () => previousTuesday,\n previousThursday: () => previousThursday,\n previousSunday: () => previousSunday,\n previousSaturday: () => previousSaturday,\n previousMonday: () => previousMonday,\n previousFriday: () => previousFriday,\n previousDay: () => previousDay,\n parsers: () => parsers,\n parseJSON: () => parseJSON,\n parseISO: () => parseISO,\n parse: () => parse,\n nextWednesday: () => nextWednesday,\n nextTuesday: () => nextTuesday,\n nextThursday: () => nextThursday,\n nextSunday: () => nextSunday,\n nextSaturday: () => nextSaturday,\n nextMonday: () => nextMonday,\n nextFriday: () => nextFriday,\n nextDay: () => nextDay,\n monthsToYears: () => monthsToYears,\n monthsToQuarters: () => monthsToQuarters,\n minutesToSeconds: () => minutesToSeconds,\n minutesToMilliseconds: () => minutesToMilliseconds,\n minutesToHours: () => minutesToHours,\n min: () => min,\n millisecondsToSeconds: () => millisecondsToSeconds,\n millisecondsToMinutes: () => millisecondsToMinutes,\n millisecondsToHours: () => millisecondsToHours,\n milliseconds: () => milliseconds,\n max: () => max,\n longFormatters: () => longFormatters,\n lightFormatters: () => lightFormatters,\n lightFormat: () => lightFormat,\n lastDayOfYear: () => lastDayOfYear,\n lastDayOfWeek: () => lastDayOfWeek,\n lastDayOfQuarter: () => lastDayOfQuarter,\n lastDayOfMonth: () => lastDayOfMonth,\n lastDayOfISOWeekYear: () => lastDayOfISOWeekYear,\n lastDayOfISOWeek: () => lastDayOfISOWeek,\n lastDayOfDecade: () => lastDayOfDecade,\n isYesterday: () => isYesterday,\n isWithinInterval: () => isWithinInterval,\n isWeekend: () => isWeekend,\n isWednesday: () => isWednesday,\n isValid: () => isValid,\n isTuesday: () => isTuesday,\n isTomorrow: () => isTomorrow,\n isToday: () => isToday,\n isThursday: () => isThursday,\n isThisYear: () => isThisYear,\n isThisWeek: () => isThisWeek,\n isThisSecond: () => isThisSecond,\n isThisQuarter: () => isThisQuarter,\n isThisMonth: () => isThisMonth,\n isThisMinute: () => isThisMinute,\n isThisISOWeek: () => isThisISOWeek,\n isThisHour: () => isThisHour,\n isSunday: () => isSunday,\n isSaturday: () => isSaturday,\n isSameYear: () => isSameYear,\n isSameWeek: () => isSameWeek,\n isSameSecond: () => isSameSecond,\n isSameQuarter: () => isSameQuarter,\n isSameMonth: () => isSameMonth,\n isSameMinute: () => isSameMinute,\n isSameISOWeekYear: () => isSameISOWeekYear,\n isSameISOWeek: () => isSameISOWeek,\n isSameHour: () => isSameHour,\n isSameDay: () => isSameDay,\n isPast: () => isPast,\n isMonday: () => isMonday,\n isMatch: () => isMatch,\n isLeapYear: () => isLeapYear,\n isLastDayOfMonth: () => isLastDayOfMonth,\n isFuture: () => isFuture,\n isFriday: () => isFriday,\n isFirstDayOfMonth: () => isFirstDayOfMonth,\n isExists: () => isExists,\n isEqual: () => isEqual,\n isDate: () => isDate,\n isBefore: () => isBefore,\n isAfter: () => isAfter,\n intlFormatDistance: () => intlFormatDistance,\n intlFormat: () => intlFormat,\n intervalToDuration: () => intervalToDuration,\n interval: () => interval,\n hoursToSeconds: () => hoursToSeconds,\n hoursToMinutes: () => hoursToMinutes,\n hoursToMilliseconds: () => hoursToMilliseconds,\n getYear: () => getYear,\n getWeeksInMonth: () => getWeeksInMonth,\n getWeekYear: () => getWeekYear,\n getWeekOfMonth: () => getWeekOfMonth,\n getWeek: () => getWeek,\n getUnixTime: () => getUnixTime,\n getTime: () => getTime,\n getSeconds: () => getSeconds,\n getQuarter: () => getQuarter,\n getOverlappingDaysInIntervals: () => getOverlappingDaysInIntervals,\n getMonth: () => getMonth,\n getMinutes: () => getMinutes,\n getMilliseconds: () => getMilliseconds,\n getISOWeeksInYear: () => getISOWeeksInYear,\n getISOWeekYear: () => getISOWeekYear,\n getISOWeek: () => getISOWeek,\n getISODay: () => getISODay,\n getHours: () => getHours,\n getDefaultOptions: () => getDefaultOptions2,\n getDecade: () => getDecade,\n getDaysInYear: () => getDaysInYear,\n getDaysInMonth: () => getDaysInMonth,\n getDayOfYear: () => getDayOfYear,\n getDay: () => getDay,\n getDate: () => getDate,\n fromUnixTime: () => fromUnixTime,\n formatters: () => formatters,\n formatRelative: () => formatRelative3,\n formatRFC7231: () => formatRFC7231,\n formatRFC3339: () => formatRFC3339,\n formatISODuration: () => formatISODuration,\n formatISO9075: () => formatISO9075,\n formatISO: () => formatISO,\n formatDuration: () => formatDuration,\n formatDistanceToNowStrict: () => formatDistanceToNowStrict,\n formatDistanceToNow: () => formatDistanceToNow,\n formatDistanceStrict: () => formatDistanceStrict,\n formatDistance: () => formatDistance3,\n formatDate: () => format,\n format: () => format,\n endOfYesterday: () => endOfYesterday,\n endOfYear: () => endOfYear,\n endOfWeek: () => endOfWeek,\n endOfTomorrow: () => endOfTomorrow,\n endOfToday: () => endOfToday,\n endOfSecond: () => endOfSecond,\n endOfQuarter: () => endOfQuarter,\n endOfMonth: () => endOfMonth,\n endOfMinute: () => endOfMinute,\n endOfISOWeekYear: () => endOfISOWeekYear,\n endOfISOWeek: () => endOfISOWeek,\n endOfHour: () => endOfHour,\n endOfDecade: () => endOfDecade,\n endOfDay: () => endOfDay,\n eachYearOfInterval: () => eachYearOfInterval,\n eachWeekendOfYear: () => eachWeekendOfYear,\n eachWeekendOfMonth: () => eachWeekendOfMonth,\n eachWeekendOfInterval: () => eachWeekendOfInterval,\n eachWeekOfInterval: () => eachWeekOfInterval,\n eachQuarterOfInterval: () => eachQuarterOfInterval,\n eachMonthOfInterval: () => eachMonthOfInterval,\n eachMinuteOfInterval: () => eachMinuteOfInterval,\n eachHourOfInterval: () => eachHourOfInterval,\n eachDayOfInterval: () => eachDayOfInterval,\n differenceInYears: () => differenceInYears,\n differenceInWeeks: () => differenceInWeeks,\n differenceInSeconds: () => differenceInSeconds,\n differenceInQuarters: () => differenceInQuarters,\n differenceInMonths: () => differenceInMonths,\n differenceInMinutes: () => differenceInMinutes,\n differenceInMilliseconds: () => differenceInMilliseconds,\n differenceInISOWeekYears: () => differenceInISOWeekYears,\n differenceInHours: () => differenceInHours,\n differenceInDays: () => differenceInDays,\n differenceInCalendarYears: () => differenceInCalendarYears,\n differenceInCalendarWeeks: () => differenceInCalendarWeeks,\n differenceInCalendarQuarters: () => differenceInCalendarQuarters,\n differenceInCalendarMonths: () => differenceInCalendarMonths,\n differenceInCalendarISOWeeks: () => differenceInCalendarISOWeeks,\n differenceInCalendarISOWeekYears: () => differenceInCalendarISOWeekYears,\n differenceInCalendarDays: () => differenceInCalendarDays,\n differenceInBusinessDays: () => differenceInBusinessDays,\n daysToWeeks: () => daysToWeeks,\n constructNow: () => constructNow,\n constructFrom: () => constructFrom,\n compareDesc: () => compareDesc,\n compareAsc: () => compareAsc,\n closestTo: () => closestTo,\n closestIndexTo: () => closestIndexTo,\n clamp: () => clamp,\n areIntervalsOverlapping: () => areIntervalsOverlapping,\n addYears: () => addYears,\n addWeeks: () => addWeeks,\n addSeconds: () => addSeconds,\n addQuarters: () => addQuarters,\n addMonths: () => addMonths,\n addMinutes: () => addMinutes,\n addMilliseconds: () => addMilliseconds,\n addISOWeekYears: () => addISOWeekYears,\n addHours: () => addHours,\n addDays: () => addDays,\n addBusinessDays: () => addBusinessDays,\n add: () => add\n});\n\n// lib/constants.js\nvar daysInWeek = 7;\nvar daysInYear = 365.2425;\nvar maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\nvar minTime = -maxTime;\nvar millisecondsInWeek = 604800000;\nvar millisecondsInDay = 86400000;\nvar millisecondsInMinute = 60000;\nvar millisecondsInHour = 3600000;\nvar millisecondsInSecond = 1000;\nvar minutesInYear = 525600;\nvar minutesInMonth = 43200;\nvar minutesInDay = 1440;\nvar minutesInHour = 60;\nvar monthsInQuarter = 3;\nvar monthsInYear = 12;\nvar quartersInYear = 4;\nvar secondsInHour = 3600;\nvar secondsInMinute = 60;\nvar secondsInDay = secondsInHour * 24;\nvar secondsInWeek = secondsInDay * 7;\nvar secondsInYear = secondsInDay * daysInYear;\nvar secondsInMonth = secondsInYear / 12;\nvar secondsInQuarter = secondsInMonth * 3;\nvar constructFromSymbol = Symbol.for(\"constructDateFrom\");\n\n// lib/constructFrom.js\nfunction constructFrom(date, value) {\n if (typeof date === \"function\")\n return date(value);\n if (date && typeof date === \"object\" && constructFromSymbol in date)\n return date[constructFromSymbol](value);\n if (date instanceof Date)\n return new date.constructor(value);\n return new Date(value);\n}\n\n// lib/toDate.js\nfunction toDate(argument, context) {\n return constructFrom(context || argument, argument);\n}\n\n// lib/addDays.js\nfunction addDays(date, amount, options) {\n const _date = toDate(date, options?.in);\n if (isNaN(amount))\n return constructFrom(options?.in || date, NaN);\n if (!amount)\n return _date;\n _date.setDate(_date.getDate() + amount);\n return _date;\n}\n\n// lib/addMonths.js\nfunction addMonths(date, amount, options) {\n const _date = toDate(date, options?.in);\n if (isNaN(amount))\n return constructFrom(options?.in || date, NaN);\n if (!amount) {\n return _date;\n }\n const dayOfMonth = _date.getDate();\n const endOfDesiredMonth = constructFrom(options?.in || date, _date.getTime());\n endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);\n const daysInMonth = endOfDesiredMonth.getDate();\n if (dayOfMonth >= daysInMonth) {\n return endOfDesiredMonth;\n } else {\n _date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth);\n return _date;\n }\n}\n\n// lib/add.js\nfunction add(date, duration, options) {\n const {\n years = 0,\n months = 0,\n weeks = 0,\n days = 0,\n hours = 0,\n minutes = 0,\n seconds = 0\n } = duration;\n const _date = toDate(date, options?.in);\n const dateWithMonths = months || years ? addMonths(_date, months + years * 12) : _date;\n const dateWithDays = days || weeks ? addDays(dateWithMonths, days + weeks * 7) : dateWithMonths;\n const minutesToAdd = minutes + hours * 60;\n const secondsToAdd = seconds + minutesToAdd * 60;\n const msToAdd = secondsToAdd * 1000;\n return constructFrom(options?.in || date, +dateWithDays + msToAdd);\n}\n// lib/isSaturday.js\nfunction isSaturday(date, options) {\n return toDate(date, options?.in).getDay() === 6;\n}\n\n// lib/isSunday.js\nfunction isSunday(date, options) {\n return toDate(date, options?.in).getDay() === 0;\n}\n\n// lib/isWeekend.js\nfunction isWeekend(date, options) {\n const day = toDate(date, options?.in).getDay();\n return day === 0 || day === 6;\n}\n\n// lib/addBusinessDays.js\nfunction addBusinessDays(date, amount, options) {\n const _date = toDate(date, options?.in);\n const startedOnWeekend = isWeekend(_date, options);\n if (isNaN(amount))\n return constructFrom(options?.in, NaN);\n const hours = _date.getHours();\n const sign = amount < 0 ? -1 : 1;\n const fullWeeks = Math.trunc(amount / 5);\n _date.setDate(_date.getDate() + fullWeeks * 7);\n let restDays = Math.abs(amount % 5);\n while (restDays > 0) {\n _date.setDate(_date.getDate() + sign);\n if (!isWeekend(_date, options))\n restDays -= 1;\n }\n if (startedOnWeekend && isWeekend(_date, options) && amount !== 0) {\n if (isSaturday(_date, options))\n _date.setDate(_date.getDate() + (sign < 0 ? 2 : -1));\n if (isSunday(_date, options))\n _date.setDate(_date.getDate() + (sign < 0 ? 1 : -2));\n }\n _date.setHours(hours);\n return _date;\n}\n// lib/addMilliseconds.js\nfunction addMilliseconds(date, amount, options) {\n return constructFrom(options?.in || date, +toDate(date) + amount);\n}\n\n// lib/addHours.js\nfunction addHours(date, amount, options) {\n return addMilliseconds(date, amount * millisecondsInHour, options);\n}\n// lib/_lib/defaultOptions.js\nfunction getDefaultOptions() {\n return defaultOptions;\n}\nfunction setDefaultOptions(newOptions) {\n defaultOptions = newOptions;\n}\nvar defaultOptions = {};\n\n// lib/startOfWeek.js\nfunction startOfWeek(date, options) {\n const defaultOptions3 = getDefaultOptions();\n const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions3.weekStartsOn ?? defaultOptions3.locale?.options?.weekStartsOn ?? 0;\n const _date = toDate(date, options?.in);\n const day = _date.getDay();\n const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n _date.setDate(_date.getDate() - diff);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// lib/startOfISOWeek.js\nfunction startOfISOWeek(date, options) {\n return startOfWeek(date, { ...options, weekStartsOn: 1 });\n}\n\n// lib/getISOWeekYear.js\nfunction getISOWeekYear(date, options) {\n const _date = toDate(date, options?.in);\n const year = _date.getFullYear();\n const fourthOfJanuaryOfNextYear = constructFrom(_date, 0);\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);\n const fourthOfJanuaryOfThisYear = constructFrom(_date, 0);\n fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// lib/_lib/getTimezoneOffsetInMilliseconds.js\nfunction getTimezoneOffsetInMilliseconds(date) {\n const _date = toDate(date);\n const utcDate = new Date(Date.UTC(_date.getFullYear(), _date.getMonth(), _date.getDate(), _date.getHours(), _date.getMinutes(), _date.getSeconds(), _date.getMilliseconds()));\n utcDate.setUTCFullYear(_date.getFullYear());\n return +date - +utcDate;\n}\n\n// lib/_lib/normalizeDates.js\nfunction normalizeDates(context, ...dates) {\n const normalize = constructFrom.bind(null, context || dates.find((date) => typeof date === \"object\"));\n return dates.map(normalize);\n}\n\n// lib/startOfDay.js\nfunction startOfDay(date, options) {\n const _date = toDate(date, options?.in);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// lib/differenceInCalendarDays.js\nfunction differenceInCalendarDays(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate);\n const laterStartOfDay = startOfDay(laterDate_);\n const earlierStartOfDay = startOfDay(earlierDate_);\n const laterTimestamp = +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);\n const earlierTimestamp = +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);\n return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);\n}\n\n// lib/startOfISOWeekYear.js\nfunction startOfISOWeekYear(date, options) {\n const year = getISOWeekYear(date, options);\n const fourthOfJanuary = constructFrom(options?.in || date, 0);\n fourthOfJanuary.setFullYear(year, 0, 4);\n fourthOfJanuary.setHours(0, 0, 0, 0);\n return startOfISOWeek(fourthOfJanuary);\n}\n\n// lib/setISOWeekYear.js\nfunction setISOWeekYear(date, weekYear, options) {\n let _date = toDate(date, options?.in);\n const diff = differenceInCalendarDays(_date, startOfISOWeekYear(_date, options));\n const fourthOfJanuary = constructFrom(options?.in || date, 0);\n fourthOfJanuary.setFullYear(weekYear, 0, 4);\n fourthOfJanuary.setHours(0, 0, 0, 0);\n _date = startOfISOWeekYear(fourthOfJanuary);\n _date.setDate(_date.getDate() + diff);\n return _date;\n}\n\n// lib/addISOWeekYears.js\nfunction addISOWeekYears(date, amount, options) {\n return setISOWeekYear(date, getISOWeekYear(date, options) + amount, options);\n}\n// lib/addMinutes.js\nfunction addMinutes(date, amount, options) {\n const _date = toDate(date, options?.in);\n _date.setTime(_date.getTime() + amount * millisecondsInMinute);\n return _date;\n}\n// lib/addQuarters.js\nfunction addQuarters(date, amount, options) {\n return addMonths(date, amount * 3, options);\n}\n// lib/addSeconds.js\nfunction addSeconds(date, amount, options) {\n return addMilliseconds(date, amount * 1000, options);\n}\n// lib/addWeeks.js\nfunction addWeeks(date, amount, options) {\n return addDays(date, amount * 7, options);\n}\n// lib/addYears.js\nfunction addYears(date, amount, options) {\n return addMonths(date, amount * 12, options);\n}\n// lib/areIntervalsOverlapping.js\nfunction areIntervalsOverlapping(intervalLeft, intervalRight, options) {\n const [leftStartTime, leftEndTime] = [\n +toDate(intervalLeft.start, options?.in),\n +toDate(intervalLeft.end, options?.in)\n ].sort((a, b) => a - b);\n const [rightStartTime, rightEndTime] = [\n +toDate(intervalRight.start, options?.in),\n +toDate(intervalRight.end, options?.in)\n ].sort((a, b) => a - b);\n if (options?.inclusive)\n return leftStartTime <= rightEndTime && rightStartTime <= leftEndTime;\n return leftStartTime < rightEndTime && rightStartTime < leftEndTime;\n}\n// lib/max.js\nfunction max(dates, options) {\n let result;\n let context = options?.in;\n dates.forEach((date) => {\n if (!context && typeof date === \"object\")\n context = constructFrom.bind(null, date);\n const date_ = toDate(date, context);\n if (!result || result < date_ || isNaN(+date_))\n result = date_;\n });\n return constructFrom(context, result || NaN);\n}\n\n// lib/min.js\nfunction min(dates, options) {\n let result;\n let context = options?.in;\n dates.forEach((date) => {\n if (!context && typeof date === \"object\")\n context = constructFrom.bind(null, date);\n const date_ = toDate(date, context);\n if (!result || result > date_ || isNaN(+date_))\n result = date_;\n });\n return constructFrom(context, result || NaN);\n}\n\n// lib/clamp.js\nfunction clamp(date, interval, options) {\n const [date_, start, end] = normalizeDates(options?.in, date, interval.start, interval.end);\n return min([max([date_, start], options), end], options);\n}\n// lib/closestIndexTo.js\nfunction closestIndexTo(dateToCompare, dates) {\n const timeToCompare = +toDate(dateToCompare);\n if (isNaN(timeToCompare))\n return NaN;\n let result;\n let minDistance;\n dates.forEach((date, index) => {\n const date_ = toDate(date);\n if (isNaN(+date_)) {\n result = NaN;\n minDistance = NaN;\n return;\n }\n const distance = Math.abs(timeToCompare - +date_);\n if (result == null || distance < minDistance) {\n result = index;\n minDistance = distance;\n }\n });\n return result;\n}\n// lib/closestTo.js\nfunction closestTo(dateToCompare, dates, options) {\n const [dateToCompare_, ...dates_] = normalizeDates(options?.in, dateToCompare, ...dates);\n const index = closestIndexTo(dateToCompare_, dates_);\n if (typeof index === \"number\" && isNaN(index))\n return constructFrom(dateToCompare_, NaN);\n if (index !== undefined)\n return dates_[index];\n}\n// lib/compareAsc.js\nfunction compareAsc(dateLeft, dateRight) {\n const diff = +toDate(dateLeft) - +toDate(dateRight);\n if (diff < 0)\n return -1;\n else if (diff > 0)\n return 1;\n return diff;\n}\n// lib/compareDesc.js\nfunction compareDesc(dateLeft, dateRight) {\n const diff = +toDate(dateLeft) - +toDate(dateRight);\n if (diff > 0)\n return -1;\n else if (diff < 0)\n return 1;\n return diff;\n}\n// lib/constructNow.js\nfunction constructNow(date) {\n return constructFrom(date, Date.now());\n}\n// lib/daysToWeeks.js\nfunction daysToWeeks(days) {\n const result = Math.trunc(days / daysInWeek);\n return result === 0 ? 0 : result;\n}\n// lib/isSameDay.js\nfunction isSameDay(laterDate, earlierDate, options) {\n const [dateLeft_, dateRight_] = normalizeDates(options?.in, laterDate, earlierDate);\n return +startOfDay(dateLeft_) === +startOfDay(dateRight_);\n}\n\n// lib/isDate.js\nfunction isDate(value) {\n return value instanceof Date || typeof value === \"object\" && Object.prototype.toString.call(value) === \"[object Date]\";\n}\n\n// lib/isValid.js\nfunction isValid(date) {\n return !(!isDate(date) && typeof date !== \"number\" || isNaN(+toDate(date)));\n}\n\n// lib/differenceInBusinessDays.js\nfunction differenceInBusinessDays(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate);\n if (!isValid(laterDate_) || !isValid(earlierDate_))\n return NaN;\n const diff = differenceInCalendarDays(laterDate_, earlierDate_);\n const sign = diff < 0 ? -1 : 1;\n const weeks = Math.trunc(diff / 7);\n let result = weeks * 5;\n let movingDate = addDays(earlierDate_, weeks * 7);\n while (!isSameDay(laterDate_, movingDate)) {\n result += isWeekend(movingDate, options) ? 0 : sign;\n movingDate = addDays(movingDate, sign);\n }\n return result === 0 ? 0 : result;\n}\n// lib/differenceInCalendarISOWeekYears.js\nfunction differenceInCalendarISOWeekYears(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate);\n return getISOWeekYear(laterDate_, options) - getISOWeekYear(earlierDate_, options);\n}\n// lib/differenceInCalendarISOWeeks.js\nfunction differenceInCalendarISOWeeks(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate);\n const startOfISOWeekLeft = startOfISOWeek(laterDate_);\n const startOfISOWeekRight = startOfISOWeek(earlierDate_);\n const timestampLeft = +startOfISOWeekLeft - getTimezoneOffsetInMilliseconds(startOfISOWeekLeft);\n const timestampRight = +startOfISOWeekRight - getTimezoneOffsetInMilliseconds(startOfISOWeekRight);\n return Math.round((timestampLeft - timestampRight) / millisecondsInWeek);\n}\n// lib/differenceInCalendarMonths.js\nfunction differenceInCalendarMonths(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate);\n const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();\n const monthsDiff = laterDate_.getMonth() - earlierDate_.getMonth();\n return yearsDiff * 12 + monthsDiff;\n}\n// lib/getQuarter.js\nfunction getQuarter(date, options) {\n const _date = toDate(date, options?.in);\n const quarter = Math.trunc(_date.getMonth() / 3) + 1;\n return quarter;\n}\n\n// lib/differenceInCalendarQuarters.js\nfunction differenceInCalendarQuarters(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate);\n const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();\n const quartersDiff = getQuarter(laterDate_) - getQuarter(earlierDate_);\n return yearsDiff * 4 + quartersDiff;\n}\n// lib/differenceInCalendarWeeks.js\nfunction differenceInCalendarWeeks(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate);\n const laterStartOfWeek = startOfWeek(laterDate_, options);\n const earlierStartOfWeek = startOfWeek(earlierDate_, options);\n const laterTimestamp = +laterStartOfWeek - getTimezoneOffsetInMilliseconds(laterStartOfWeek);\n const earlierTimestamp = +earlierStartOfWeek - getTimezoneOffsetInMilliseconds(earlierStartOfWeek);\n return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInWeek);\n}\n// lib/differenceInCalendarYears.js\nfunction differenceInCalendarYears(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate);\n return laterDate_.getFullYear() - earlierDate_.getFullYear();\n}\n// lib/differenceInDays.js\nfunction differenceInDays(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate);\n const sign = compareLocalAsc(laterDate_, earlierDate_);\n const difference = Math.abs(differenceInCalendarDays(laterDate_, earlierDate_));\n laterDate_.setDate(laterDate_.getDate() - sign * difference);\n const isLastDayNotFull = Number(compareLocalAsc(laterDate_, earlierDate_) === -sign);\n const result = sign * (difference - isLastDayNotFull);\n return result === 0 ? 0 : result;\n}\nfunction compareLocalAsc(laterDate, earlierDate) {\n const diff = laterDate.getFullYear() - earlierDate.getFullYear() || laterDate.getMonth() - earlierDate.getMonth() || laterDate.getDate() - earlierDate.getDate() || laterDate.getHours() - earlierDate.getHours() || laterDate.getMinutes() - earlierDate.getMinutes() || laterDate.getSeconds() - earlierDate.getSeconds() || laterDate.getMilliseconds() - earlierDate.getMilliseconds();\n if (diff < 0)\n return -1;\n if (diff > 0)\n return 1;\n return diff;\n}\n// lib/_lib/getRoundingMethod.js\nfunction getRoundingMethod(method) {\n return (number) => {\n const round = method ? Math[method] : Math.trunc;\n const result = round(number);\n return result === 0 ? 0 : result;\n };\n}\n\n// lib/differenceInHours.js\nfunction differenceInHours(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate);\n const diff = (+laterDate_ - +earlierDate_) / millisecondsInHour;\n return getRoundingMethod(options?.roundingMethod)(diff);\n}\n// lib/subISOWeekYears.js\nfunction subISOWeekYears(date, amount, options) {\n return addISOWeekYears(date, -amount, options);\n}\n\n// lib/differenceInISOWeekYears.js\nfunction differenceInISOWeekYears(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate);\n const sign = compareAsc(laterDate_, earlierDate_);\n const diff = Math.abs(differenceInCalendarISOWeekYears(laterDate_, earlierDate_, options));\n const adjustedDate = subISOWeekYears(laterDate_, sign * diff, options);\n const isLastISOWeekYearNotFull = Number(compareAsc(adjustedDate, earlierDate_) === -sign);\n const result = sign * (diff - isLastISOWeekYearNotFull);\n return result === 0 ? 0 : result;\n}\n// lib/differenceInMilliseconds.js\nfunction differenceInMilliseconds(laterDate, earlierDate) {\n return +toDate(laterDate) - +toDate(earlierDate);\n}\n// lib/differenceInMinutes.js\nfunction differenceInMinutes(dateLeft, dateRight, options) {\n const diff = differenceInMilliseconds(dateLeft, dateRight) / millisecondsInMinute;\n return getRoundingMethod(options?.roundingMethod)(diff);\n}\n// lib/endOfDay.js\nfunction endOfDay(date, options) {\n const _date = toDate(date, options?.in);\n _date.setHours(23, 59, 59, 999);\n return _date;\n}\n\n// lib/endOfMonth.js\nfunction endOfMonth(date, options) {\n const _date = toDate(date, options?.in);\n const month = _date.getMonth();\n _date.setFullYear(_date.getFullYear(), month + 1, 0);\n _date.setHours(23, 59, 59, 999);\n return _date;\n}\n\n// lib/isLastDayOfMonth.js\nfunction isLastDayOfMonth(date, options) {\n const _date = toDate(date, options?.in);\n return +endOfDay(_date, options) === +endOfMonth(_date, options);\n}\n\n// lib/differenceInMonths.js\nfunction differenceInMonths(laterDate, earlierDate, options) {\n const [laterDate_, workingLaterDate, earlierDate_] = normalizeDates(options?.in, laterDate, laterDate, earlierDate);\n const sign = compareAsc(workingLaterDate, earlierDate_);\n const difference = Math.abs(differenceInCalendarMonths(workingLaterDate, earlierDate_));\n if (difference < 1)\n return 0;\n if (workingLaterDate.getMonth() === 1 && workingLaterDate.getDate() > 27)\n workingLaterDate.setDate(30);\n workingLaterDate.setMonth(workingLaterDate.getMonth() - sign * difference);\n let isLastMonthNotFull = compareAsc(workingLaterDate, earlierDate_) === -sign;\n if (isLastDayOfMonth(laterDate_) && difference === 1 && compareAsc(laterDate_, earlierDate_) === 1) {\n isLastMonthNotFull = false;\n }\n const result = sign * (difference - +isLastMonthNotFull);\n return result === 0 ? 0 : result;\n}\n// lib/differenceInQuarters.js\nfunction differenceInQuarters(laterDate, earlierDate, options) {\n const diff = differenceInMonths(laterDate, earlierDate, options) / 3;\n return getRoundingMethod(options?.roundingMethod)(diff);\n}\n// lib/differenceInSeconds.js\nfunction differenceInSeconds(laterDate, earlierDate, options) {\n const diff = differenceInMilliseconds(laterDate, earlierDate) / 1000;\n return getRoundingMethod(options?.roundingMethod)(diff);\n}\n// lib/differenceInWeeks.js\nfunction differenceInWeeks(laterDate, earlierDate, options) {\n const diff = differenceInDays(laterDate, earlierDate, options) / 7;\n return getRoundingMethod(options?.roundingMethod)(diff);\n}\n// lib/differenceInYears.js\nfunction differenceInYears(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate);\n const sign = compareAsc(laterDate_, earlierDate_);\n const diff = Math.abs(differenceInCalendarYears(laterDate_, earlierDate_));\n laterDate_.setFullYear(1584);\n earlierDate_.setFullYear(1584);\n const partial = compareAsc(laterDate_, earlierDate_) === -sign;\n const result = sign * (diff - +partial);\n return result === 0 ? 0 : result;\n}\n// lib/_lib/normalizeInterval.js\nfunction normalizeInterval(context, interval) {\n const [start, end] = normalizeDates(context, interval.start, interval.end);\n return { start, end };\n}\n\n// lib/eachDayOfInterval.js\nfunction eachDayOfInterval(interval, options) {\n const { start, end } = normalizeInterval(options?.in, interval);\n let reversed = +start > +end;\n const endTime = reversed ? +start : +end;\n const date = reversed ? end : start;\n date.setHours(0, 0, 0, 0);\n let step = options?.step ?? 1;\n if (!step)\n return [];\n if (step < 0) {\n step = -step;\n reversed = !reversed;\n }\n const dates = [];\n while (+date <= endTime) {\n dates.push(constructFrom(start, date));\n date.setDate(date.getDate() + step);\n date.setHours(0, 0, 0, 0);\n }\n return reversed ? dates.reverse() : dates;\n}\n// lib/eachHourOfInterval.js\nfunction eachHourOfInterval(interval, options) {\n const { start, end } = normalizeInterval(options?.in, interval);\n let reversed = +start > +end;\n const endTime = reversed ? +start : +end;\n const date = reversed ? end : start;\n date.setMinutes(0, 0, 0);\n let step = options?.step ?? 1;\n if (!step)\n return [];\n if (step < 0) {\n step = -step;\n reversed = !reversed;\n }\n const dates = [];\n while (+date <= endTime) {\n dates.push(constructFrom(start, date));\n date.setHours(date.getHours() + step);\n }\n return reversed ? dates.reverse() : dates;\n}\n// lib/eachMinuteOfInterval.js\nfunction eachMinuteOfInterval(interval, options) {\n const { start, end } = normalizeInterval(options?.in, interval);\n start.setSeconds(0, 0);\n let reversed = +start > +end;\n const endTime = reversed ? +start : +end;\n let date = reversed ? end : start;\n let step = options?.step ?? 1;\n if (!step)\n return [];\n if (step < 0) {\n step = -step;\n reversed = !reversed;\n }\n const dates = [];\n while (+date <= endTime) {\n dates.push(constructFrom(start, date));\n date = addMinutes(date, step);\n }\n return reversed ? dates.reverse() : dates;\n}\n// lib/eachMonthOfInterval.js\nfunction eachMonthOfInterval(interval, options) {\n const { start, end } = normalizeInterval(options?.in, interval);\n let reversed = +start > +end;\n const endTime = reversed ? +start : +end;\n const date = reversed ? end : start;\n date.setHours(0, 0, 0, 0);\n date.setDate(1);\n let step = options?.step ?? 1;\n if (!step)\n return [];\n if (step < 0) {\n step = -step;\n reversed = !reversed;\n }\n const dates = [];\n while (+date <= endTime) {\n dates.push(constructFrom(start, date));\n date.setMonth(date.getMonth() + step);\n }\n return reversed ? dates.reverse() : dates;\n}\n// lib/startOfQuarter.js\nfunction startOfQuarter(date, options) {\n const _date = toDate(date, options?.in);\n const currentMonth = _date.getMonth();\n const month = currentMonth - currentMonth % 3;\n _date.setMonth(month, 1);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// lib/eachQuarterOfInterval.js\nfunction eachQuarterOfInterval(interval, options) {\n const { start, end } = normalizeInterval(options?.in, interval);\n let reversed = +start > +end;\n const endTime = reversed ? +startOfQuarter(start) : +startOfQuarter(end);\n let date = reversed ? startOfQuarter(end) : startOfQuarter(start);\n let step = options?.step ?? 1;\n if (!step)\n return [];\n if (step < 0) {\n step = -step;\n reversed = !reversed;\n }\n const dates = [];\n while (+date <= endTime) {\n dates.push(constructFrom(start, date));\n date = addQuarters(date, step);\n }\n return reversed ? dates.reverse() : dates;\n}\n// lib/eachWeekOfInterval.js\nfunction eachWeekOfInterval(interval, options) {\n const { start, end } = normalizeInterval(options?.in, interval);\n let reversed = +start > +end;\n const startDateWeek = reversed ? startOfWeek(end, options) : startOfWeek(start, options);\n const endDateWeek = reversed ? startOfWeek(start, options) : startOfWeek(end, options);\n startDateWeek.setHours(15);\n endDateWeek.setHours(15);\n const endTime = +endDateWeek.getTime();\n let currentDate = startDateWeek;\n let step = options?.step ?? 1;\n if (!step)\n return [];\n if (step < 0) {\n step = -step;\n reversed = !reversed;\n }\n const dates = [];\n while (+currentDate <= endTime) {\n currentDate.setHours(0);\n dates.push(constructFrom(start, currentDate));\n currentDate = addWeeks(currentDate, step);\n currentDate.setHours(15);\n }\n return reversed ? dates.reverse() : dates;\n}\n// lib/eachWeekendOfInterval.js\nfunction eachWeekendOfInterval(interval, options) {\n const { start, end } = normalizeInterval(options?.in, interval);\n const dateInterval = eachDayOfInterval({ start, end }, options);\n const weekends = [];\n let index = 0;\n while (index < dateInterval.length) {\n const date = dateInterval[index++];\n if (isWeekend(date))\n weekends.push(constructFrom(start, date));\n }\n return weekends;\n}\n// lib/startOfMonth.js\nfunction startOfMonth(date, options) {\n const _date = toDate(date, options?.in);\n _date.setDate(1);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// lib/eachWeekendOfMonth.js\nfunction eachWeekendOfMonth(date, options) {\n const start = startOfMonth(date, options);\n const end = endOfMonth(date, options);\n return eachWeekendOfInterval({ start, end }, options);\n}\n// lib/endOfYear.js\nfunction endOfYear(date, options) {\n const _date = toDate(date, options?.in);\n const year = _date.getFullYear();\n _date.setFullYear(year + 1, 0, 0);\n _date.setHours(23, 59, 59, 999);\n return _date;\n}\n\n// lib/startOfYear.js\nfunction startOfYear(date, options) {\n const date_ = toDate(date, options?.in);\n date_.setFullYear(date_.getFullYear(), 0, 1);\n date_.setHours(0, 0, 0, 0);\n return date_;\n}\n\n// lib/eachWeekendOfYear.js\nfunction eachWeekendOfYear(date, options) {\n const start = startOfYear(date, options);\n const end = endOfYear(date, options);\n return eachWeekendOfInterval({ start, end }, options);\n}\n// lib/eachYearOfInterval.js\nfunction eachYearOfInterval(interval, options) {\n const { start, end } = normalizeInterval(options?.in, interval);\n let reversed = +start > +end;\n const endTime = reversed ? +start : +end;\n const date = reversed ? end : start;\n date.setHours(0, 0, 0, 0);\n date.setMonth(0, 1);\n let step = options?.step ?? 1;\n if (!step)\n return [];\n if (step < 0) {\n step = -step;\n reversed = !reversed;\n }\n const dates = [];\n while (+date <= endTime) {\n dates.push(constructFrom(start, date));\n date.setFullYear(date.getFullYear() + step);\n }\n return reversed ? dates.reverse() : dates;\n}\n// lib/endOfDecade.js\nfunction endOfDecade(date, options) {\n const _date = toDate(date, options?.in);\n const year = _date.getFullYear();\n const decade = 9 + Math.floor(year / 10) * 10;\n _date.setFullYear(decade, 11, 31);\n _date.setHours(23, 59, 59, 999);\n return _date;\n}\n// lib/endOfHour.js\nfunction endOfHour(date, options) {\n const _date = toDate(date, options?.in);\n _date.setMinutes(59, 59, 999);\n return _date;\n}\n// lib/endOfWeek.js\nfunction endOfWeek(date, options) {\n const defaultOptions4 = getDefaultOptions();\n const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions4.weekStartsOn ?? defaultOptions4.locale?.options?.weekStartsOn ?? 0;\n const _date = toDate(date, options?.in);\n const day = _date.getDay();\n const diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn);\n _date.setDate(_date.getDate() + diff);\n _date.setHours(23, 59, 59, 999);\n return _date;\n}\n\n// lib/endOfISOWeek.js\nfunction endOfISOWeek(date, options) {\n return endOfWeek(date, { ...options, weekStartsOn: 1 });\n}\n// lib/endOfISOWeekYear.js\nfunction endOfISOWeekYear(date, options) {\n const year = getISOWeekYear(date, options);\n const fourthOfJanuaryOfNextYear = constructFrom(options?.in || date, 0);\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);\n const _date = startOfISOWeek(fourthOfJanuaryOfNextYear, options);\n _date.setMilliseconds(_date.getMilliseconds() - 1);\n return _date;\n}\n// lib/endOfMinute.js\nfunction endOfMinute(date, options) {\n const _date = toDate(date, options?.in);\n _date.setSeconds(59, 999);\n return _date;\n}\n// lib/endOfQuarter.js\nfunction endOfQuarter(date, options) {\n const _date = toDate(date, options?.in);\n const currentMonth = _date.getMonth();\n const month = currentMonth - currentMonth % 3 + 3;\n _date.setMonth(month, 0);\n _date.setHours(23, 59, 59, 999);\n return _date;\n}\n// lib/endOfSecond.js\nfunction endOfSecond(date, options) {\n const _date = toDate(date, options?.in);\n _date.setMilliseconds(999);\n return _date;\n}\n// lib/endOfToday.js\nfunction endOfToday(options) {\n return endOfDay(Date.now(), options);\n}\n// lib/endOfTomorrow.js\nfunction endOfTomorrow(options) {\n const now = constructNow(options?.in);\n const year = now.getFullYear();\n const month = now.getMonth();\n const day = now.getDate();\n const date = constructNow(options?.in);\n date.setFullYear(year, month, day + 1);\n date.setHours(23, 59, 59, 999);\n return options?.in ? options.in(date) : date;\n}\n// lib/endOfYesterday.js\nfunction endOfYesterday(options) {\n const now = constructNow(options?.in);\n const date = constructFrom(options?.in, 0);\n date.setFullYear(now.getFullYear(), now.getMonth(), now.getDate() - 1);\n date.setHours(23, 59, 59, 999);\n return date;\n}\n// lib/locale/en-US/_lib/formatDistance.js\nvar formatDistanceLocale = {\n lessThanXSeconds: {\n one: \"less than a second\",\n other: \"less than {{count}} seconds\"\n },\n xSeconds: {\n one: \"1 second\",\n other: \"{{count}} seconds\"\n },\n halfAMinute: \"half a minute\",\n lessThanXMinutes: {\n one: \"less than a minute\",\n other: \"less than {{count}} minutes\"\n },\n xMinutes: {\n one: \"1 minute\",\n other: \"{{count}} minutes\"\n },\n aboutXHours: {\n one: \"about 1 hour\",\n other: \"about {{count}} hours\"\n },\n xHours: {\n one: \"1 hour\",\n other: \"{{count}} hours\"\n },\n xDays: {\n one: \"1 day\",\n other: \"{{count}} days\"\n },\n aboutXWeeks: {\n one: \"about 1 week\",\n other: \"about {{count}} weeks\"\n },\n xWeeks: {\n one: \"1 week\",\n other: \"{{count}} weeks\"\n },\n aboutXMonths: {\n one: \"about 1 month\",\n other: \"about {{count}} months\"\n },\n xMonths: {\n one: \"1 month\",\n other: \"{{count}} months\"\n },\n aboutXYears: {\n one: \"about 1 year\",\n other: \"about {{count}} years\"\n },\n xYears: {\n one: \"1 year\",\n other: \"{{count}} years\"\n },\n overXYears: {\n one: \"over 1 year\",\n other: \"over {{count}} years\"\n },\n almostXYears: {\n one: \"almost 1 year\",\n other: \"almost {{count}} years\"\n }\n};\nvar formatDistance = (token, count, options) => {\n let result;\n const tokenValue = formatDistanceLocale[token];\n if (typeof tokenValue === \"string\") {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace(\"{{count}}\", count.toString());\n }\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return \"in \" + result;\n } else {\n return result + \" ago\";\n }\n }\n return result;\n};\n\n// lib/locale/_lib/buildFormatLongFn.js\nfunction buildFormatLongFn(args) {\n return (options = {}) => {\n const width = options.width ? String(options.width) : args.defaultWidth;\n const format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}\n\n// lib/locale/en-US/_lib/formatLong.js\nvar dateFormats = {\n full: \"EEEE, MMMM do, y\",\n long: \"MMMM do, y\",\n medium: \"MMM d, y\",\n short: \"MM/dd/yyyy\"\n};\nvar timeFormats = {\n full: \"h:mm:ss a zzzz\",\n long: \"h:mm:ss a z\",\n medium: \"h:mm:ss a\",\n short: \"h:mm a\"\n};\nvar dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: \"{{date}}, {{time}}\",\n short: \"{{date}}, {{time}}\"\n};\nvar formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\"\n }),\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\"\n }),\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\"\n })\n};\n\n// lib/locale/en-US/_lib/formatRelative.js\nvar formatRelativeLocale = {\n lastWeek: \"'last' eeee 'at' p\",\n yesterday: \"'yesterday at' p\",\n today: \"'today at' p\",\n tomorrow: \"'tomorrow at' p\",\n nextWeek: \"eeee 'at' p\",\n other: \"P\"\n};\nvar formatRelative = (token, _date, _baseDate, _options) => formatRelativeLocale[token];\n\n// lib/locale/_lib/buildLocalizeFn.js\nfunction buildLocalizeFn(args) {\n return (value, options) => {\n const context = options?.context ? String(options.context) : \"standalone\";\n let valuesArray;\n if (context === \"formatting\" && args.formattingValues) {\n const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n const width = options?.width ? String(options.width) : defaultWidth;\n valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n const defaultWidth = args.defaultWidth;\n const width = options?.width ? String(options.width) : args.defaultWidth;\n valuesArray = args.values[width] || args.values[defaultWidth];\n }\n const index = args.argumentCallback ? args.argumentCallback(value) : value;\n return valuesArray[index];\n };\n}\n\n// lib/locale/en-US/_lib/localize.js\nvar eraValues = {\n narrow: [\"B\", \"A\"],\n abbreviated: [\"BC\", \"AD\"],\n wide: [\"Before Christ\", \"Anno Domini\"]\n};\nvar quarterValues = {\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n abbreviated: [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n wide: [\"1st quarter\", \"2nd quarter\", \"3rd quarter\", \"4th quarter\"]\n};\nvar monthValues = {\n narrow: [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"],\n abbreviated: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\"\n ],\n wide: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\"\n ]\n};\nvar dayValues = {\n narrow: [\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"],\n short: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n abbreviated: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n wide: [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\"\n ]\n};\nvar dayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\"\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\"\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\"\n }\n};\nvar formattingDayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\"\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\"\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\"\n }\n};\nvar ordinalNumber = (dirtyNumber, _options) => {\n const number = Number(dirtyNumber);\n const rem100 = number % 100;\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + \"st\";\n case 2:\n return number + \"nd\";\n case 3:\n return number + \"rd\";\n }\n }\n return number + \"th\";\n};\nvar localize = {\n ordinalNumber,\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: \"wide\"\n }),\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: \"wide\",\n argumentCallback: (quarter) => quarter - 1\n }),\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: \"wide\"\n }),\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: \"wide\"\n }),\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: \"wide\",\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: \"wide\"\n })\n};\n\n// lib/locale/_lib/buildMatchFn.js\nfunction buildMatchFn(args) {\n return (string, options = {}) => {\n const width = options.width;\n const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];\n const matchResult = string.match(matchPattern);\n if (!matchResult) {\n return null;\n }\n const matchedString = matchResult[0];\n const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];\n const key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) : findKey(parsePatterns, (pattern) => pattern.test(matchedString));\n let value;\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback ? options.valueCallback(value) : value;\n const rest = string.slice(matchedString.length);\n return { value, rest };\n };\n}\nfunction findKey(object, predicate) {\n for (const key in object) {\n if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {\n return key;\n }\n }\n return;\n}\nfunction findIndex(array, predicate) {\n for (let key = 0;key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n return;\n}\n\n// lib/locale/_lib/buildMatchPatternFn.js\nfunction buildMatchPatternFn(args) {\n return (string, options = {}) => {\n const matchResult = string.match(args.matchPattern);\n if (!matchResult)\n return null;\n const matchedString = matchResult[0];\n const parseResult = string.match(args.parsePattern);\n if (!parseResult)\n return null;\n let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];\n value = options.valueCallback ? options.valueCallback(value) : value;\n const rest = string.slice(matchedString.length);\n return { value, rest };\n };\n}\n\n// lib/locale/en-US/_lib/match.js\nvar matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nvar parseOrdinalNumberPattern = /\\d+/i;\nvar matchEraPatterns = {\n narrow: /^(b|a)/i,\n abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n wide: /^(before christ|before common era|anno domini|common era)/i\n};\nvar parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i]\n};\nvar matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i\n};\nvar parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i]\n};\nvar matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i\n};\nvar parseMonthPatterns = {\n narrow: [\n /^j/i,\n /^f/i,\n /^m/i,\n /^a/i,\n /^m/i,\n /^j/i,\n /^j/i,\n /^a/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i\n ],\n any: [\n /^ja/i,\n /^f/i,\n /^mar/i,\n /^ap/i,\n /^may/i,\n /^jun/i,\n /^jul/i,\n /^au/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i\n ]\n};\nvar matchDayPatterns = {\n narrow: /^[smtwf]/i,\n short: /^(su|mo|tu|we|th|fr|sa)/i,\n abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i\n};\nvar parseDayPatterns = {\n narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]\n};\nvar matchDayPeriodPatterns = {\n narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i\n};\nvar parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mi/i,\n noon: /^no/i,\n morning: /morning/i,\n afternoon: /afternoon/i,\n evening: /evening/i,\n night: /night/i\n }\n};\nvar match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: (value) => parseInt(value, 10)\n }),\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseEraPatterns,\n defaultParseWidth: \"any\"\n }),\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: \"any\",\n valueCallback: (index) => index + 1\n }),\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: \"any\"\n }),\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPatterns,\n defaultParseWidth: \"any\"\n }),\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: \"any\",\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: \"any\"\n })\n};\n\n// lib/locale/en-US.js\nvar enUS = {\n code: \"en-US\",\n formatDistance,\n formatLong,\n formatRelative,\n localize,\n match,\n options: {\n weekStartsOn: 0,\n firstWeekContainsDate: 1\n }\n};\n// lib/getDayOfYear.js\nfunction getDayOfYear(date, options) {\n const _date = toDate(date, options?.in);\n const diff = differenceInCalendarDays(_date, startOfYear(_date));\n const dayOfYear = diff + 1;\n return dayOfYear;\n}\n\n// lib/getISOWeek.js\nfunction getISOWeek(date, options) {\n const _date = toDate(date, options?.in);\n const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// lib/getWeekYear.js\nfunction getWeekYear(date, options) {\n const _date = toDate(date, options?.in);\n const year = _date.getFullYear();\n const defaultOptions5 = getDefaultOptions();\n const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions5.firstWeekContainsDate ?? defaultOptions5.locale?.options?.firstWeekContainsDate ?? 1;\n const firstWeekOfNextYear = constructFrom(options?.in || date, 0);\n firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);\n const firstWeekOfThisYear = constructFrom(options?.in || date, 0);\n firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);\n if (+_date >= +startOfNextYear) {\n return year + 1;\n } else if (+_date >= +startOfThisYear) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// lib/startOfWeekYear.js\nfunction startOfWeekYear(date, options) {\n const defaultOptions6 = getDefaultOptions();\n const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions6.firstWeekContainsDate ?? defaultOptions6.locale?.options?.firstWeekContainsDate ?? 1;\n const year = getWeekYear(date, options);\n const firstWeek = constructFrom(options?.in || date, 0);\n firstWeek.setFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setHours(0, 0, 0, 0);\n const _date = startOfWeek(firstWeek, options);\n return _date;\n}\n\n// lib/getWeek.js\nfunction getWeek(date, options) {\n const _date = toDate(date, options?.in);\n const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// lib/_lib/addLeadingZeros.js\nfunction addLeadingZeros(number, targetLength) {\n const sign = number < 0 ? \"-\" : \"\";\n const output = Math.abs(number).toString().padStart(targetLength, \"0\");\n return sign + output;\n}\n\n// lib/_lib/format/lightFormatters.js\nvar lightFormatters = {\n y(date, token) {\n const signedYear = date.getFullYear();\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return addLeadingZeros(token === \"yy\" ? year % 100 : year, token.length);\n },\n M(date, token) {\n const month = date.getMonth();\n return token === \"M\" ? String(month + 1) : addLeadingZeros(month + 1, 2);\n },\n d(date, token) {\n return addLeadingZeros(date.getDate(), token.length);\n },\n a(date, token) {\n const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? \"pm\" : \"am\";\n switch (token) {\n case \"a\":\n case \"aa\":\n return dayPeriodEnumValue.toUpperCase();\n case \"aaa\":\n return dayPeriodEnumValue;\n case \"aaaaa\":\n return dayPeriodEnumValue[0];\n case \"aaaa\":\n default:\n return dayPeriodEnumValue === \"am\" ? \"a.m.\" : \"p.m.\";\n }\n },\n h(date, token) {\n return addLeadingZeros(date.getHours() % 12 || 12, token.length);\n },\n H(date, token) {\n return addLeadingZeros(date.getHours(), token.length);\n },\n m(date, token) {\n return addLeadingZeros(date.getMinutes(), token.length);\n },\n s(date, token) {\n return addLeadingZeros(date.getSeconds(), token.length);\n },\n S(date, token) {\n const numberOfDigits = token.length;\n const milliseconds = date.getMilliseconds();\n const fractionalSeconds = Math.trunc(milliseconds * Math.pow(10, numberOfDigits - 3));\n return addLeadingZeros(fractionalSeconds, token.length);\n }\n};\n\n// lib/_lib/format/formatters.js\nfunction formatTimezoneShort(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = Math.trunc(absOffset / 60);\n const minutes = absOffset % 60;\n if (minutes === 0) {\n return sign + String(hours);\n }\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\nfunction formatTimezoneWithOptionalMinutes(offset, delimiter) {\n if (offset % 60 === 0) {\n const sign = offset > 0 ? \"-\" : \"+\";\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n return formatTimezone(offset, delimiter);\n}\nfunction formatTimezone(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);\n const minutes = addLeadingZeros(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\nvar dayPeriodEnum = {\n am: \"am\",\n pm: \"pm\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\"\n};\nvar formatters = {\n G: function(date, token, localize3) {\n const era = date.getFullYear() > 0 ? 1 : 0;\n switch (token) {\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return localize3.era(era, { width: \"abbreviated\" });\n case \"GGGGG\":\n return localize3.era(era, { width: \"narrow\" });\n case \"GGGG\":\n default:\n return localize3.era(era, { width: \"wide\" });\n }\n },\n y: function(date, token, localize3) {\n if (token === \"yo\") {\n const signedYear = date.getFullYear();\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize3.ordinalNumber(year, { unit: \"year\" });\n }\n return lightFormatters.y(date, token);\n },\n Y: function(date, token, localize3, options) {\n const signedWeekYear = getWeekYear(date, options);\n const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;\n if (token === \"YY\") {\n const twoDigitYear = weekYear % 100;\n return addLeadingZeros(twoDigitYear, 2);\n }\n if (token === \"Yo\") {\n return localize3.ordinalNumber(weekYear, { unit: \"year\" });\n }\n return addLeadingZeros(weekYear, token.length);\n },\n R: function(date, token) {\n const isoWeekYear = getISOWeekYear(date);\n return addLeadingZeros(isoWeekYear, token.length);\n },\n u: function(date, token) {\n const year = date.getFullYear();\n return addLeadingZeros(year, token.length);\n },\n Q: function(date, token, localize3) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n case \"Q\":\n return String(quarter);\n case \"QQ\":\n return addLeadingZeros(quarter, 2);\n case \"Qo\":\n return localize3.ordinalNumber(quarter, { unit: \"quarter\" });\n case \"QQQ\":\n return localize3.quarter(quarter, {\n width: \"abbreviated\",\n context: \"formatting\"\n });\n case \"QQQQQ\":\n return localize3.quarter(quarter, {\n width: \"narrow\",\n context: \"formatting\"\n });\n case \"QQQQ\":\n default:\n return localize3.quarter(quarter, {\n width: \"wide\",\n context: \"formatting\"\n });\n }\n },\n q: function(date, token, localize3) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n case \"q\":\n return String(quarter);\n case \"qq\":\n return addLeadingZeros(quarter, 2);\n case \"qo\":\n return localize3.ordinalNumber(quarter, { unit: \"quarter\" });\n case \"qqq\":\n return localize3.quarter(quarter, {\n width: \"abbreviated\",\n context: \"standalone\"\n });\n case \"qqqqq\":\n return localize3.quarter(quarter, {\n width: \"narrow\",\n context: \"standalone\"\n });\n case \"qqqq\":\n default:\n return localize3.quarter(quarter, {\n width: \"wide\",\n context: \"standalone\"\n });\n }\n },\n M: function(date, token, localize3) {\n const month = date.getMonth();\n switch (token) {\n case \"M\":\n case \"MM\":\n return lightFormatters.M(date, token);\n case \"Mo\":\n return localize3.ordinalNumber(month + 1, { unit: \"month\" });\n case \"MMM\":\n return localize3.month(month, {\n width: \"abbreviated\",\n context: \"formatting\"\n });\n case \"MMMMM\":\n return localize3.month(month, {\n width: \"narrow\",\n context: \"formatting\"\n });\n case \"MMMM\":\n default:\n return localize3.month(month, { width: \"wide\", context: \"formatting\" });\n }\n },\n L: function(date, token, localize3) {\n const month = date.getMonth();\n switch (token) {\n case \"L\":\n return String(month + 1);\n case \"LL\":\n return addLeadingZeros(month + 1, 2);\n case \"Lo\":\n return localize3.ordinalNumber(month + 1, { unit: \"month\" });\n case \"LLL\":\n return localize3.month(month, {\n width: \"abbreviated\",\n context: \"standalone\"\n });\n case \"LLLLL\":\n return localize3.month(month, {\n width: \"narrow\",\n context: \"standalone\"\n });\n case \"LLLL\":\n default:\n return localize3.month(month, { width: \"wide\", context: \"standalone\" });\n }\n },\n w: function(date, token, localize3, options) {\n const week = getWeek(date, options);\n if (token === \"wo\") {\n return localize3.ordinalNumber(week, { unit: \"week\" });\n }\n return addLeadingZeros(week, token.length);\n },\n I: function(date, token, localize3) {\n const isoWeek = getISOWeek(date);\n if (token === \"Io\") {\n return localize3.ordinalNumber(isoWeek, { unit: \"week\" });\n }\n return addLeadingZeros(isoWeek, token.length);\n },\n d: function(date, token, localize3) {\n if (token === \"do\") {\n return localize3.ordinalNumber(date.getDate(), { unit: \"date\" });\n }\n return lightFormatters.d(date, token);\n },\n D: function(date, token, localize3) {\n const dayOfYear = getDayOfYear(date);\n if (token === \"Do\") {\n return localize3.ordinalNumber(dayOfYear, { unit: \"dayOfYear\" });\n }\n return addLeadingZeros(dayOfYear, token.length);\n },\n E: function(date, token, localize3) {\n const dayOfWeek = date.getDay();\n switch (token) {\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return localize3.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\"\n });\n case \"EEEEE\":\n return localize3.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\"\n });\n case \"EEEEEE\":\n return localize3.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\"\n });\n case \"EEEE\":\n default:\n return localize3.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\"\n });\n }\n },\n e: function(date, token, localize3, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n case \"e\":\n return String(localDayOfWeek);\n case \"ee\":\n return addLeadingZeros(localDayOfWeek, 2);\n case \"eo\":\n return localize3.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"eee\":\n return localize3.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\"\n });\n case \"eeeee\":\n return localize3.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\"\n });\n case \"eeeeee\":\n return localize3.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\"\n });\n case \"eeee\":\n default:\n return localize3.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\"\n });\n }\n },\n c: function(date, token, localize3, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n case \"c\":\n return String(localDayOfWeek);\n case \"cc\":\n return addLeadingZeros(localDayOfWeek, token.length);\n case \"co\":\n return localize3.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"ccc\":\n return localize3.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"standalone\"\n });\n case \"ccccc\":\n return localize3.day(dayOfWeek, {\n width: \"narrow\",\n context: \"standalone\"\n });\n case \"cccccc\":\n return localize3.day(dayOfWeek, {\n width: \"short\",\n context: \"standalone\"\n });\n case \"cccc\":\n default:\n return localize3.day(dayOfWeek, {\n width: \"wide\",\n context: \"standalone\"\n });\n }\n },\n i: function(date, token, localize3) {\n const dayOfWeek = date.getDay();\n const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n switch (token) {\n case \"i\":\n return String(isoDayOfWeek);\n case \"ii\":\n return addLeadingZeros(isoDayOfWeek, token.length);\n case \"io\":\n return localize3.ordinalNumber(isoDayOfWeek, { unit: \"day\" });\n case \"iii\":\n return localize3.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\"\n });\n case \"iiiii\":\n return localize3.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\"\n });\n case \"iiiiii\":\n return localize3.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\"\n });\n case \"iiii\":\n default:\n return localize3.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\"\n });\n }\n },\n a: function(date, token, localize3) {\n const hours = date.getHours();\n const dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n switch (token) {\n case \"a\":\n case \"aa\":\n return localize3.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\"\n });\n case \"aaa\":\n return localize3.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\"\n }).toLowerCase();\n case \"aaaaa\":\n return localize3.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\"\n });\n case \"aaaa\":\n default:\n return localize3.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\"\n });\n }\n },\n b: function(date, token, localize3) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours === 12) {\n dayPeriodEnumValue = dayPeriodEnum.noon;\n } else if (hours === 0) {\n dayPeriodEnumValue = dayPeriodEnum.midnight;\n } else {\n dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n }\n switch (token) {\n case \"b\":\n case \"bb\":\n return localize3.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\"\n });\n case \"bbb\":\n return localize3.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\"\n }).toLowerCase();\n case \"bbbbb\":\n return localize3.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\"\n });\n case \"bbbb\":\n default:\n return localize3.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\"\n });\n }\n },\n B: function(date, token, localize3) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours >= 17) {\n dayPeriodEnumValue = dayPeriodEnum.evening;\n } else if (hours >= 12) {\n dayPeriodEnumValue = dayPeriodEnum.afternoon;\n } else if (hours >= 4) {\n dayPeriodEnumValue = dayPeriodEnum.morning;\n } else {\n dayPeriodEnumValue = dayPeriodEnum.night;\n }\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return localize3.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\"\n });\n case \"BBBBB\":\n return localize3.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\"\n });\n case \"BBBB\":\n default:\n return localize3.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\"\n });\n }\n },\n h: function(date, token, localize3) {\n if (token === \"ho\") {\n let hours = date.getHours() % 12;\n if (hours === 0)\n hours = 12;\n return localize3.ordinalNumber(hours, { unit: \"hour\" });\n }\n return lightFormatters.h(date, token);\n },\n H: function(date, token, localize3) {\n if (token === \"Ho\") {\n return localize3.ordinalNumber(date.getHours(), { unit: \"hour\" });\n }\n return lightFormatters.H(date, token);\n },\n K: function(date, token, localize3) {\n const hours = date.getHours() % 12;\n if (token === \"Ko\") {\n return localize3.ordinalNumber(hours, { unit: \"hour\" });\n }\n return addLeadingZeros(hours, token.length);\n },\n k: function(date, token, localize3) {\n let hours = date.getHours();\n if (hours === 0)\n hours = 24;\n if (token === \"ko\") {\n return localize3.ordinalNumber(hours, { unit: \"hour\" });\n }\n return addLeadingZeros(hours, token.length);\n },\n m: function(date, token, localize3) {\n if (token === \"mo\") {\n return localize3.ordinalNumber(date.getMinutes(), { unit: \"minute\" });\n }\n return lightFormatters.m(date, token);\n },\n s: function(date, token, localize3) {\n if (token === \"so\") {\n return localize3.ordinalNumber(date.getSeconds(), { unit: \"second\" });\n }\n return lightFormatters.s(date, token);\n },\n S: function(date, token) {\n return lightFormatters.S(date, token);\n },\n X: function(date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n if (timezoneOffset === 0) {\n return \"Z\";\n }\n switch (token) {\n case \"X\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n case \"XXXX\":\n case \"XX\":\n return formatTimezone(timezoneOffset);\n case \"XXXXX\":\n case \"XXX\":\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n x: function(date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n switch (token) {\n case \"x\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n case \"xxxx\":\n case \"xx\":\n return formatTimezone(timezoneOffset);\n case \"xxxxx\":\n case \"xxx\":\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n O: function(date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n switch (token) {\n case \"O\":\n case \"OO\":\n case \"OOO\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n case \"OOOO\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n z: function(date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n switch (token) {\n case \"z\":\n case \"zz\":\n case \"zzz\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n case \"zzzz\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n t: function(date, token, _localize) {\n const timestamp = Math.trunc(+date / 1000);\n return addLeadingZeros(timestamp, token.length);\n },\n T: function(date, token, _localize) {\n return addLeadingZeros(+date, token.length);\n }\n};\n\n// lib/_lib/format/longFormatters.js\nvar dateLongFormatter = (pattern, formatLong3) => {\n switch (pattern) {\n case \"P\":\n return formatLong3.date({ width: \"short\" });\n case \"PP\":\n return formatLong3.date({ width: \"medium\" });\n case \"PPP\":\n return formatLong3.date({ width: \"long\" });\n case \"PPPP\":\n default:\n return formatLong3.date({ width: \"full\" });\n }\n};\nvar timeLongFormatter = (pattern, formatLong3) => {\n switch (pattern) {\n case \"p\":\n return formatLong3.time({ width: \"short\" });\n case \"pp\":\n return formatLong3.time({ width: \"medium\" });\n case \"ppp\":\n return formatLong3.time({ width: \"long\" });\n case \"pppp\":\n default:\n return formatLong3.time({ width: \"full\" });\n }\n};\nvar dateTimeLongFormatter = (pattern, formatLong3) => {\n const matchResult = pattern.match(/(P+)(p+)?/) || [];\n const datePattern = matchResult[1];\n const timePattern = matchResult[2];\n if (!timePattern) {\n return dateLongFormatter(pattern, formatLong3);\n }\n let dateTimeFormat;\n switch (datePattern) {\n case \"P\":\n dateTimeFormat = formatLong3.dateTime({ width: \"short\" });\n break;\n case \"PP\":\n dateTimeFormat = formatLong3.dateTime({ width: \"medium\" });\n break;\n case \"PPP\":\n dateTimeFormat = formatLong3.dateTime({ width: \"long\" });\n break;\n case \"PPPP\":\n default:\n dateTimeFormat = formatLong3.dateTime({ width: \"full\" });\n break;\n }\n return dateTimeFormat.replace(\"{{date}}\", dateLongFormatter(datePattern, formatLong3)).replace(\"{{time}}\", timeLongFormatter(timePattern, formatLong3));\n};\nvar longFormatters = {\n p: timeLongFormatter,\n P: dateTimeLongFormatter\n};\n\n// lib/_lib/protectedTokens.js\nfunction isProtectedDayOfYearToken(token) {\n return dayOfYearTokenRE.test(token);\n}\nfunction isProtectedWeekYearToken(token) {\n return weekYearTokenRE.test(token);\n}\nfunction warnOrThrowProtectedError(token, format, input) {\n const _message = message(token, format, input);\n console.warn(_message);\n if (throwTokens.includes(token))\n throw new RangeError(_message);\n}\nfunction message(token, format, input) {\n const subject = token[0] === \"Y\" ? \"years\" : \"days of the month\";\n return `Use \\`${token.toLowerCase()}\\` instead of \\`${token}\\` (in \\`${format}\\`) for formatting ${subject} to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;\n}\nvar dayOfYearTokenRE = /^D+$/;\nvar weekYearTokenRE = /^Y+$/;\nvar throwTokens = [\"D\", \"DD\", \"YY\", \"YYYY\"];\n\n// lib/format.js\nfunction format(date, formatStr, options) {\n const defaultOptions7 = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions7.locale ?? enUS;\n const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions7.firstWeekContainsDate ?? defaultOptions7.locale?.options?.firstWeekContainsDate ?? 1;\n const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions7.weekStartsOn ?? defaultOptions7.locale?.options?.weekStartsOn ?? 0;\n const originalDate = toDate(date, options?.in);\n if (!isValid(originalDate)) {\n throw new RangeError(\"Invalid time value\");\n }\n let parts = formatStr.match(longFormattingTokensRegExp).map((substring) => {\n const firstCharacter = substring[0];\n if (firstCharacter === \"p\" || firstCharacter === \"P\") {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n }).join(\"\").match(formattingTokensRegExp).map((substring) => {\n if (substring === \"''\") {\n return { isToken: false, value: \"'\" };\n }\n const firstCharacter = substring[0];\n if (firstCharacter === \"'\") {\n return { isToken: false, value: cleanEscapedString(substring) };\n }\n if (formatters[firstCharacter]) {\n return { isToken: true, value: substring };\n }\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\"Format string contains an unescaped latin alphabet character `\" + firstCharacter + \"`\");\n }\n return { isToken: false, value: substring };\n });\n if (locale.localize.preprocessor) {\n parts = locale.localize.preprocessor(originalDate, parts);\n }\n const formatterOptions = {\n firstWeekContainsDate,\n weekStartsOn,\n locale\n };\n return parts.map((part) => {\n if (!part.isToken)\n return part.value;\n const token = part.value;\n if (!options?.useAdditionalWeekYearTokens && isProtectedWeekYearToken(token) || !options?.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(token)) {\n warnOrThrowProtectedError(token, formatStr, String(date));\n }\n const formatter = formatters[token[0]];\n return formatter(originalDate, token, locale.localize, formatterOptions);\n }).join(\"\");\n}\nfunction cleanEscapedString(input) {\n const matched = input.match(escapedStringRegExp);\n if (!matched) {\n return input;\n }\n return matched[1].replace(doubleQuoteRegExp, \"'\");\n}\nvar formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\nvar longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\nvar escapedStringRegExp = /^'([^]*?)'?$/;\nvar doubleQuoteRegExp = /''/g;\nvar unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n// lib/formatDistance.js\nfunction formatDistance3(laterDate, earlierDate, options) {\n const defaultOptions8 = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions8.locale ?? enUS;\n const minutesInAlmostTwoDays = 2520;\n const comparison = compareAsc(laterDate, earlierDate);\n if (isNaN(comparison))\n throw new RangeError(\"Invalid time value\");\n const localizeOptions = Object.assign({}, options, {\n addSuffix: options?.addSuffix,\n comparison\n });\n const [laterDate_, earlierDate_] = normalizeDates(options?.in, ...comparison > 0 ? [earlierDate, laterDate] : [laterDate, earlierDate]);\n const seconds = differenceInSeconds(earlierDate_, laterDate_);\n const offsetInSeconds = (getTimezoneOffsetInMilliseconds(earlierDate_) - getTimezoneOffsetInMilliseconds(laterDate_)) / 1000;\n const minutes = Math.round((seconds - offsetInSeconds) / 60);\n let months;\n if (minutes < 2) {\n if (options?.includeSeconds) {\n if (seconds < 5) {\n return locale.formatDistance(\"lessThanXSeconds\", 5, localizeOptions);\n } else if (seconds < 10) {\n return locale.formatDistance(\"lessThanXSeconds\", 10, localizeOptions);\n } else if (seconds < 20) {\n return locale.formatDistance(\"lessThanXSeconds\", 20, localizeOptions);\n } else if (seconds < 40) {\n return locale.formatDistance(\"halfAMinute\", 0, localizeOptions);\n } else if (seconds < 60) {\n return locale.formatDistance(\"lessThanXMinutes\", 1, localizeOptions);\n } else {\n return locale.formatDistance(\"xMinutes\", 1, localizeOptions);\n }\n } else {\n if (minutes === 0) {\n return locale.formatDistance(\"lessThanXMinutes\", 1, localizeOptions);\n } else {\n return locale.formatDistance(\"xMinutes\", minutes, localizeOptions);\n }\n }\n } else if (minutes < 45) {\n return locale.formatDistance(\"xMinutes\", minutes, localizeOptions);\n } else if (minutes < 90) {\n return locale.formatDistance(\"aboutXHours\", 1, localizeOptions);\n } else if (minutes < minutesInDay) {\n const hours = Math.round(minutes / 60);\n return locale.formatDistance(\"aboutXHours\", hours, localizeOptions);\n } else if (minutes < minutesInAlmostTwoDays) {\n return locale.formatDistance(\"xDays\", 1, localizeOptions);\n } else if (minutes < minutesInMonth) {\n const days = Math.round(minutes / minutesInDay);\n return locale.formatDistance(\"xDays\", days, localizeOptions);\n } else if (minutes < minutesInMonth * 2) {\n months = Math.round(minutes / minutesInMonth);\n return locale.formatDistance(\"aboutXMonths\", months, localizeOptions);\n }\n months = differenceInMonths(earlierDate_, laterDate_);\n if (months < 12) {\n const nearestMonth = Math.round(minutes / minutesInMonth);\n return locale.formatDistance(\"xMonths\", nearestMonth, localizeOptions);\n } else {\n const monthsSinceStartOfYear = months % 12;\n const years = Math.trunc(months / 12);\n if (monthsSinceStartOfYear < 3) {\n return locale.formatDistance(\"aboutXYears\", years, localizeOptions);\n } else if (monthsSinceStartOfYear < 9) {\n return locale.formatDistance(\"overXYears\", years, localizeOptions);\n } else {\n return locale.formatDistance(\"almostXYears\", years + 1, localizeOptions);\n }\n }\n}\n// lib/formatDistanceStrict.js\nfunction formatDistanceStrict(laterDate, earlierDate, options) {\n const defaultOptions9 = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions9.locale ?? enUS;\n const comparison = compareAsc(laterDate, earlierDate);\n if (isNaN(comparison)) {\n throw new RangeError(\"Invalid time value\");\n }\n const localizeOptions = Object.assign({}, options, {\n addSuffix: options?.addSuffix,\n comparison\n });\n const [laterDate_, earlierDate_] = normalizeDates(options?.in, ...comparison > 0 ? [earlierDate, laterDate] : [laterDate, earlierDate]);\n const roundingMethod = getRoundingMethod(options?.roundingMethod ?? \"round\");\n const milliseconds = earlierDate_.getTime() - laterDate_.getTime();\n const minutes = milliseconds / millisecondsInMinute;\n const timezoneOffset = getTimezoneOffsetInMilliseconds(earlierDate_) - getTimezoneOffsetInMilliseconds(laterDate_);\n const dstNormalizedMinutes = (milliseconds - timezoneOffset) / millisecondsInMinute;\n const defaultUnit = options?.unit;\n let unit;\n if (!defaultUnit) {\n if (minutes < 1) {\n unit = \"second\";\n } else if (minutes < 60) {\n unit = \"minute\";\n } else if (minutes < minutesInDay) {\n unit = \"hour\";\n } else if (dstNormalizedMinutes < minutesInMonth) {\n unit = \"day\";\n } else if (dstNormalizedMinutes < minutesInYear) {\n unit = \"month\";\n } else {\n unit = \"year\";\n }\n } else {\n unit = defaultUnit;\n }\n if (unit === \"second\") {\n const seconds = roundingMethod(milliseconds / 1000);\n return locale.formatDistance(\"xSeconds\", seconds, localizeOptions);\n } else if (unit === \"minute\") {\n const roundedMinutes = roundingMethod(minutes);\n return locale.formatDistance(\"xMinutes\", roundedMinutes, localizeOptions);\n } else if (unit === \"hour\") {\n const hours = roundingMethod(minutes / 60);\n return locale.formatDistance(\"xHours\", hours, localizeOptions);\n } else if (unit === \"day\") {\n const days = roundingMethod(dstNormalizedMinutes / minutesInDay);\n return locale.formatDistance(\"xDays\", days, localizeOptions);\n } else if (unit === \"month\") {\n const months = roundingMethod(dstNormalizedMinutes / minutesInMonth);\n return months === 12 && defaultUnit !== \"month\" ? locale.formatDistance(\"xYears\", 1, localizeOptions) : locale.formatDistance(\"xMonths\", months, localizeOptions);\n } else {\n const years = roundingMethod(dstNormalizedMinutes / minutesInYear);\n return locale.formatDistance(\"xYears\", years, localizeOptions);\n }\n}\n// lib/formatDistanceToNow.js\nfunction formatDistanceToNow(date, options) {\n return formatDistance3(date, constructNow(date), options);\n}\n// lib/formatDistanceToNowStrict.js\nfunction formatDistanceToNowStrict(date, options) {\n return formatDistanceStrict(date, constructNow(date), options);\n}\n// lib/formatDuration.js\nfunction formatDuration(duration, options) {\n const defaultOptions10 = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions10.locale ?? enUS;\n const format2 = options?.format ?? defaultFormat;\n const zero = options?.zero ?? false;\n const delimiter = options?.delimiter ?? \" \";\n if (!locale.formatDistance) {\n return \"\";\n }\n const result = format2.reduce((acc, unit) => {\n const token = `x${unit.replace(/(^.)/, (m) => m.toUpperCase())}`;\n const value = duration[unit];\n if (value !== undefined && (zero || duration[unit])) {\n return acc.concat(locale.formatDistance(token, value));\n }\n return acc;\n }, []).join(delimiter);\n return result;\n}\nvar defaultFormat = [\n \"years\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\"\n];\n// lib/formatISO.js\nfunction formatISO(date, options) {\n const date_ = toDate(date, options?.in);\n if (isNaN(+date_)) {\n throw new RangeError(\"Invalid time value\");\n }\n const format2 = options?.format ?? \"extended\";\n const representation = options?.representation ?? \"complete\";\n let result = \"\";\n let tzOffset = \"\";\n const dateDelimiter = format2 === \"extended\" ? \"-\" : \"\";\n const timeDelimiter = format2 === \"extended\" ? \":\" : \"\";\n if (representation !== \"time\") {\n const day = addLeadingZeros(date_.getDate(), 2);\n const month = addLeadingZeros(date_.getMonth() + 1, 2);\n const year = addLeadingZeros(date_.getFullYear(), 4);\n result = `${year}${dateDelimiter}${month}${dateDelimiter}${day}`;\n }\n if (representation !== \"date\") {\n const offset = date_.getTimezoneOffset();\n if (offset !== 0) {\n const absoluteOffset = Math.abs(offset);\n const hourOffset = addLeadingZeros(Math.trunc(absoluteOffset / 60), 2);\n const minuteOffset = addLeadingZeros(absoluteOffset % 60, 2);\n const sign = offset < 0 ? \"+\" : \"-\";\n tzOffset = `${sign}${hourOffset}:${minuteOffset}`;\n } else {\n tzOffset = \"Z\";\n }\n const hour = addLeadingZeros(date_.getHours(), 2);\n const minute = addLeadingZeros(date_.getMinutes(), 2);\n const second = addLeadingZeros(date_.getSeconds(), 2);\n const separator = result === \"\" ? \"\" : \"T\";\n const time = [hour, minute, second].join(timeDelimiter);\n result = `${result}${separator}${time}${tzOffset}`;\n }\n return result;\n}\n// lib/formatISO9075.js\nfunction formatISO9075(date, options) {\n const date_ = toDate(date, options?.in);\n if (!isValid(date_)) {\n throw new RangeError(\"Invalid time value\");\n }\n const format2 = options?.format ?? \"extended\";\n const representation = options?.representation ?? \"complete\";\n let result = \"\";\n const dateDelimiter = format2 === \"extended\" ? \"-\" : \"\";\n const timeDelimiter = format2 === \"extended\" ? \":\" : \"\";\n if (representation !== \"time\") {\n const day = addLeadingZeros(date_.getDate(), 2);\n const month = addLeadingZeros(date_.getMonth() + 1, 2);\n const year = addLeadingZeros(date_.getFullYear(), 4);\n result = `${year}${dateDelimiter}${month}${dateDelimiter}${day}`;\n }\n if (representation !== \"date\") {\n const hour = addLeadingZeros(date_.getHours(), 2);\n const minute = addLeadingZeros(date_.getMinutes(), 2);\n const second = addLeadingZeros(date_.getSeconds(), 2);\n const separator = result === \"\" ? \"\" : \" \";\n result = `${result}${separator}${hour}${timeDelimiter}${minute}${timeDelimiter}${second}`;\n }\n return result;\n}\n// lib/formatISODuration.js\nfunction formatISODuration(duration) {\n const {\n years = 0,\n months = 0,\n days = 0,\n hours = 0,\n minutes = 0,\n seconds = 0\n } = duration;\n return `P${years}Y${months}M${days}DT${hours}H${minutes}M${seconds}S`;\n}\n// lib/formatRFC3339.js\nfunction formatRFC3339(date, options) {\n const date_ = toDate(date, options?.in);\n if (!isValid(date_)) {\n throw new RangeError(\"Invalid time value\");\n }\n const fractionDigits = options?.fractionDigits ?? 0;\n const day = addLeadingZeros(date_.getDate(), 2);\n const month = addLeadingZeros(date_.getMonth() + 1, 2);\n const year = date_.getFullYear();\n const hour = addLeadingZeros(date_.getHours(), 2);\n const minute = addLeadingZeros(date_.getMinutes(), 2);\n const second = addLeadingZeros(date_.getSeconds(), 2);\n let fractionalSecond = \"\";\n if (fractionDigits > 0) {\n const milliseconds = date_.getMilliseconds();\n const fractionalSeconds = Math.trunc(milliseconds * Math.pow(10, fractionDigits - 3));\n fractionalSecond = \".\" + addLeadingZeros(fractionalSeconds, fractionDigits);\n }\n let offset = \"\";\n const tzOffset = date_.getTimezoneOffset();\n if (tzOffset !== 0) {\n const absoluteOffset = Math.abs(tzOffset);\n const hourOffset = addLeadingZeros(Math.trunc(absoluteOffset / 60), 2);\n const minuteOffset = addLeadingZeros(absoluteOffset % 60, 2);\n const sign = tzOffset < 0 ? \"+\" : \"-\";\n offset = `${sign}${hourOffset}:${minuteOffset}`;\n } else {\n offset = \"Z\";\n }\n return `${year}-${month}-${day}T${hour}:${minute}:${second}${fractionalSecond}${offset}`;\n}\n// lib/formatRFC7231.js\nfunction formatRFC7231(date) {\n const _date = toDate(date);\n if (!isValid(_date)) {\n throw new RangeError(\"Invalid time value\");\n }\n const dayName = days[_date.getUTCDay()];\n const dayOfMonth = addLeadingZeros(_date.getUTCDate(), 2);\n const monthName = months[_date.getUTCMonth()];\n const year = _date.getUTCFullYear();\n const hour = addLeadingZeros(_date.getUTCHours(), 2);\n const minute = addLeadingZeros(_date.getUTCMinutes(), 2);\n const second = addLeadingZeros(_date.getUTCSeconds(), 2);\n return `${dayName}, ${dayOfMonth} ${monthName} ${year} ${hour}:${minute}:${second} GMT`;\n}\nvar days = [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"];\nvar months = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\"\n];\n// lib/formatRelative.js\nfunction formatRelative3(date, baseDate, options) {\n const [date_, baseDate_] = normalizeDates(options?.in, date, baseDate);\n const defaultOptions11 = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions11.locale ?? enUS;\n const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions11.weekStartsOn ?? defaultOptions11.locale?.options?.weekStartsOn ?? 0;\n const diff = differenceInCalendarDays(date_, baseDate_);\n if (isNaN(diff)) {\n throw new RangeError(\"Invalid time value\");\n }\n let token;\n if (diff < -6) {\n token = \"other\";\n } else if (diff < -1) {\n token = \"lastWeek\";\n } else if (diff < 0) {\n token = \"yesterday\";\n } else if (diff < 1) {\n token = \"today\";\n } else if (diff < 2) {\n token = \"tomorrow\";\n } else if (diff < 7) {\n token = \"nextWeek\";\n } else {\n token = \"other\";\n }\n const formatStr = locale.formatRelative(token, date_, baseDate_, {\n locale,\n weekStartsOn\n });\n return format(date_, formatStr, { locale, weekStartsOn });\n}\n// lib/fromUnixTime.js\nfunction fromUnixTime(unixTime, options) {\n return toDate(unixTime * 1000, options?.in);\n}\n// lib/getDate.js\nfunction getDate(date, options) {\n return toDate(date, options?.in).getDate();\n}\n// lib/getDay.js\nfunction getDay(date, options) {\n return toDate(date, options?.in).getDay();\n}\n// lib/getDaysInMonth.js\nfunction getDaysInMonth(date, options) {\n const _date = toDate(date, options?.in);\n const year = _date.getFullYear();\n const monthIndex = _date.getMonth();\n const lastDayOfMonth = constructFrom(_date, 0);\n lastDayOfMonth.setFullYear(year, monthIndex + 1, 0);\n lastDayOfMonth.setHours(0, 0, 0, 0);\n return lastDayOfMonth.getDate();\n}\n// lib/isLeapYear.js\nfunction isLeapYear(date, options) {\n const _date = toDate(date, options?.in);\n const year = _date.getFullYear();\n return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;\n}\n\n// lib/getDaysInYear.js\nfunction getDaysInYear(date, options) {\n const _date = toDate(date, options?.in);\n if (Number.isNaN(+_date))\n return NaN;\n return isLeapYear(_date) ? 366 : 365;\n}\n// lib/getDecade.js\nfunction getDecade(date, options) {\n const _date = toDate(date, options?.in);\n const year = _date.getFullYear();\n const decade = Math.floor(year / 10) * 10;\n return decade;\n}\n// lib/getDefaultOptions.js\nfunction getDefaultOptions2() {\n return Object.assign({}, getDefaultOptions());\n}\n// lib/getHours.js\nfunction getHours(date, options) {\n return toDate(date, options?.in).getHours();\n}\n// lib/getISODay.js\nfunction getISODay(date, options) {\n const day = toDate(date, options?.in).getDay();\n return day === 0 ? 7 : day;\n}\n// lib/getISOWeeksInYear.js\nfunction getISOWeeksInYear(date, options) {\n const thisYear = startOfISOWeekYear(date, options);\n const nextYear = startOfISOWeekYear(addWeeks(thisYear, 60));\n const diff = +nextYear - +thisYear;\n return Math.round(diff / millisecondsInWeek);\n}\n// lib/getMilliseconds.js\nfunction getMilliseconds(date) {\n return toDate(date).getMilliseconds();\n}\n// lib/getMinutes.js\nfunction getMinutes(date, options) {\n return toDate(date, options?.in).getMinutes();\n}\n// lib/getMonth.js\nfunction getMonth(date, options) {\n return toDate(date, options?.in).getMonth();\n}\n// lib/getOverlappingDaysInIntervals.js\nfunction getOverlappingDaysInIntervals(intervalLeft, intervalRight) {\n const [leftStart, leftEnd] = [\n +toDate(intervalLeft.start),\n +toDate(intervalLeft.end)\n ].sort((a, b) => a - b);\n const [rightStart, rightEnd] = [\n +toDate(intervalRight.start),\n +toDate(intervalRight.end)\n ].sort((a, b) => a - b);\n const isOverlapping = leftStart < rightEnd && rightStart < leftEnd;\n if (!isOverlapping)\n return 0;\n const overlapLeft = rightStart < leftStart ? leftStart : rightStart;\n const left = overlapLeft - getTimezoneOffsetInMilliseconds(overlapLeft);\n const overlapRight = rightEnd > leftEnd ? leftEnd : rightEnd;\n const right = overlapRight - getTimezoneOffsetInMilliseconds(overlapRight);\n return Math.ceil((right - left) / millisecondsInDay);\n}\n// lib/getSeconds.js\nfunction getSeconds(date) {\n return toDate(date).getSeconds();\n}\n// lib/getTime.js\nfunction getTime(date) {\n return +toDate(date);\n}\n// lib/getUnixTime.js\nfunction getUnixTime(date) {\n return Math.trunc(+toDate(date) / 1000);\n}\n// lib/getWeekOfMonth.js\nfunction getWeekOfMonth(date, options) {\n const defaultOptions13 = getDefaultOptions();\n const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions13.weekStartsOn ?? defaultOptions13.locale?.options?.weekStartsOn ?? 0;\n const currentDayOfMonth = getDate(toDate(date, options?.in));\n if (isNaN(currentDayOfMonth))\n return NaN;\n const startWeekDay = getDay(startOfMonth(date, options));\n let lastDayOfFirstWeek = weekStartsOn - startWeekDay;\n if (lastDayOfFirstWeek <= 0)\n lastDayOfFirstWeek += 7;\n const remainingDaysAfterFirstWeek = currentDayOfMonth - lastDayOfFirstWeek;\n return Math.ceil(remainingDaysAfterFirstWeek / 7) + 1;\n}\n// lib/lastDayOfMonth.js\nfunction lastDayOfMonth(date, options) {\n const _date = toDate(date, options?.in);\n const month = _date.getMonth();\n _date.setFullYear(_date.getFullYear(), month + 1, 0);\n _date.setHours(0, 0, 0, 0);\n return toDate(_date, options?.in);\n}\n\n// lib/getWeeksInMonth.js\nfunction getWeeksInMonth(date, options) {\n const contextDate = toDate(date, options?.in);\n return differenceInCalendarWeeks(lastDayOfMonth(contextDate, options), startOfMonth(contextDate, options), options) + 1;\n}\n// lib/getYear.js\nfunction getYear(date, options) {\n return toDate(date, options?.in).getFullYear();\n}\n// lib/hoursToMilliseconds.js\nfunction hoursToMilliseconds(hours) {\n return Math.trunc(hours * millisecondsInHour);\n}\n// lib/hoursToMinutes.js\nfunction hoursToMinutes(hours) {\n return Math.trunc(hours * minutesInHour);\n}\n// lib/hoursToSeconds.js\nfunction hoursToSeconds(hours) {\n return Math.trunc(hours * secondsInHour);\n}\n// lib/interval.js\nfunction interval(start, end, options) {\n const [_start, _end] = normalizeDates(options?.in, start, end);\n if (isNaN(+_start))\n throw new TypeError(\"Start date is invalid\");\n if (isNaN(+_end))\n throw new TypeError(\"End date is invalid\");\n if (options?.assertPositive && +_start > +_end)\n throw new TypeError(\"End date must be after start date\");\n return { start: _start, end: _end };\n}\n// lib/intervalToDuration.js\nfunction intervalToDuration(interval2, options) {\n const { start, end } = normalizeInterval(options?.in, interval2);\n const duration = {};\n const years = differenceInYears(end, start);\n if (years)\n duration.years = years;\n const remainingMonths = add(start, { years: duration.years });\n const months2 = differenceInMonths(end, remainingMonths);\n if (months2)\n duration.months = months2;\n const remainingDays = add(remainingMonths, { months: duration.months });\n const days2 = differenceInDays(end, remainingDays);\n if (days2)\n duration.days = days2;\n const remainingHours = add(remainingDays, { days: duration.days });\n const hours = differenceInHours(end, remainingHours);\n if (hours)\n duration.hours = hours;\n const remainingMinutes = add(remainingHours, { hours: duration.hours });\n const minutes = differenceInMinutes(end, remainingMinutes);\n if (minutes)\n duration.minutes = minutes;\n const remainingSeconds = add(remainingMinutes, { minutes: duration.minutes });\n const seconds = differenceInSeconds(end, remainingSeconds);\n if (seconds)\n duration.seconds = seconds;\n return duration;\n}\n// lib/intlFormat.js\nfunction intlFormat(date, formatOrLocale, localeOptions) {\n let formatOptions;\n if (isFormatOptions(formatOrLocale)) {\n formatOptions = formatOrLocale;\n } else {\n localeOptions = formatOrLocale;\n }\n return new Intl.DateTimeFormat(localeOptions?.locale, formatOptions).format(toDate(date));\n}\nfunction isFormatOptions(opts) {\n return opts !== undefined && !(\"locale\" in opts);\n}\n// lib/intlFormatDistance.js\nfunction intlFormatDistance(laterDate, earlierDate, options) {\n let value = 0;\n let unit;\n const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate);\n if (!options?.unit) {\n const diffInSeconds = differenceInSeconds(laterDate_, earlierDate_);\n if (Math.abs(diffInSeconds) < secondsInMinute) {\n value = differenceInSeconds(laterDate_, earlierDate_);\n unit = \"second\";\n } else if (Math.abs(diffInSeconds) < secondsInHour) {\n value = differenceInMinutes(laterDate_, earlierDate_);\n unit = \"minute\";\n } else if (Math.abs(diffInSeconds) < secondsInDay && Math.abs(differenceInCalendarDays(laterDate_, earlierDate_)) < 1) {\n value = differenceInHours(laterDate_, earlierDate_);\n unit = \"hour\";\n } else if (Math.abs(diffInSeconds) < secondsInWeek && (value = differenceInCalendarDays(laterDate_, earlierDate_)) && Math.abs(value) < 7) {\n unit = \"day\";\n } else if (Math.abs(diffInSeconds) < secondsInMonth) {\n value = differenceInCalendarWeeks(laterDate_, earlierDate_);\n unit = \"week\";\n } else if (Math.abs(diffInSeconds) < secondsInQuarter) {\n value = differenceInCalendarMonths(laterDate_, earlierDate_);\n unit = \"month\";\n } else if (Math.abs(diffInSeconds) < secondsInYear) {\n if (differenceInCalendarQuarters(laterDate_, earlierDate_) < 4) {\n value = differenceInCalendarQuarters(laterDate_, earlierDate_);\n unit = \"quarter\";\n } else {\n value = differenceInCalendarYears(laterDate_, earlierDate_);\n unit = \"year\";\n }\n } else {\n value = differenceInCalendarYears(laterDate_, earlierDate_);\n unit = \"year\";\n }\n } else {\n unit = options?.unit;\n if (unit === \"second\") {\n value = differenceInSeconds(laterDate_, earlierDate_);\n } else if (unit === \"minute\") {\n value = differenceInMinutes(laterDate_, earlierDate_);\n } else if (unit === \"hour\") {\n value = differenceInHours(laterDate_, earlierDate_);\n } else if (unit === \"day\") {\n value = differenceInCalendarDays(laterDate_, earlierDate_);\n } else if (unit === \"week\") {\n value = differenceInCalendarWeeks(laterDate_, earlierDate_);\n } else if (unit === \"month\") {\n value = differenceInCalendarMonths(laterDate_, earlierDate_);\n } else if (unit === \"quarter\") {\n value = differenceInCalendarQuarters(laterDate_, earlierDate_);\n } else if (unit === \"year\") {\n value = differenceInCalendarYears(laterDate_, earlierDate_);\n }\n }\n const rtf = new Intl.RelativeTimeFormat(options?.locale, {\n numeric: \"auto\",\n ...options\n });\n return rtf.format(value, unit);\n}\n// lib/isAfter.js\nfunction isAfter(date, dateToCompare) {\n return +toDate(date) > +toDate(dateToCompare);\n}\n// lib/isBefore.js\nfunction isBefore(date, dateToCompare) {\n return +toDate(date) < +toDate(dateToCompare);\n}\n// lib/isEqual.js\nfunction isEqual(leftDate, rightDate) {\n return +toDate(leftDate) === +toDate(rightDate);\n}\n// lib/isExists.js\nfunction isExists(year, month, day) {\n const date = new Date(year, month, day);\n return date.getFullYear() === year && date.getMonth() === month && date.getDate() === day;\n}\n// lib/isFirstDayOfMonth.js\nfunction isFirstDayOfMonth(date, options) {\n return toDate(date, options?.in).getDate() === 1;\n}\n// lib/isFriday.js\nfunction isFriday(date, options) {\n return toDate(date, options?.in).getDay() === 5;\n}\n// lib/isFuture.js\nfunction isFuture(date) {\n return +toDate(date) > Date.now();\n}\n// lib/transpose.js\nfunction transpose(date, constructor) {\n const date_ = isConstructor(constructor) ? new constructor(0) : constructFrom(constructor, 0);\n date_.setFullYear(date.getFullYear(), date.getMonth(), date.getDate());\n date_.setHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n return date_;\n}\nfunction isConstructor(constructor) {\n return typeof constructor === \"function\" && constructor.prototype?.constructor === constructor;\n}\n\n// lib/parse/_lib/Setter.js\nvar TIMEZONE_UNIT_PRIORITY = 10;\n\nclass Setter {\n subPriority = 0;\n validate(_utcDate, _options) {\n return true;\n }\n}\n\nclass ValueSetter extends Setter {\n constructor(value, validateValue, setValue, priority, subPriority) {\n super();\n this.value = value;\n this.validateValue = validateValue;\n this.setValue = setValue;\n this.priority = priority;\n if (subPriority) {\n this.subPriority = subPriority;\n }\n }\n validate(date, options) {\n return this.validateValue(date, this.value, options);\n }\n set(date, flags, options) {\n return this.setValue(date, flags, this.value, options);\n }\n}\n\nclass DateTimezoneSetter extends Setter {\n priority = TIMEZONE_UNIT_PRIORITY;\n subPriority = -1;\n constructor(context, reference) {\n super();\n this.context = context || ((date) => constructFrom(reference, date));\n }\n set(date, flags) {\n if (flags.timestampIsSet)\n return date;\n return constructFrom(date, transpose(date, this.context));\n }\n}\n\n// lib/parse/_lib/Parser.js\nclass Parser {\n run(dateString, token, match3, options) {\n const result = this.parse(dateString, token, match3, options);\n if (!result) {\n return null;\n }\n return {\n setter: new ValueSetter(result.value, this.validate, this.set, this.priority, this.subPriority),\n rest: result.rest\n };\n }\n validate(_utcDate, _value, _options) {\n return true;\n }\n}\n\n// lib/parse/_lib/parsers/EraParser.js\nclass EraParser extends Parser {\n priority = 140;\n parse(dateString, token, match3) {\n switch (token) {\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return match3.era(dateString, { width: \"abbreviated\" }) || match3.era(dateString, { width: \"narrow\" });\n case \"GGGGG\":\n return match3.era(dateString, { width: \"narrow\" });\n case \"GGGG\":\n default:\n return match3.era(dateString, { width: \"wide\" }) || match3.era(dateString, { width: \"abbreviated\" }) || match3.era(dateString, { width: \"narrow\" });\n }\n }\n set(date, flags, value) {\n flags.era = value;\n date.setFullYear(value, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n incompatibleTokens = [\"R\", \"u\", \"t\", \"T\"];\n}\n\n// lib/parse/_lib/constants.js\nvar numericPatterns = {\n month: /^(1[0-2]|0?\\d)/,\n date: /^(3[0-1]|[0-2]?\\d)/,\n dayOfYear: /^(36[0-6]|3[0-5]\\d|[0-2]?\\d?\\d)/,\n week: /^(5[0-3]|[0-4]?\\d)/,\n hour23h: /^(2[0-3]|[0-1]?\\d)/,\n hour24h: /^(2[0-4]|[0-1]?\\d)/,\n hour11h: /^(1[0-1]|0?\\d)/,\n hour12h: /^(1[0-2]|0?\\d)/,\n minute: /^[0-5]?\\d/,\n second: /^[0-5]?\\d/,\n singleDigit: /^\\d/,\n twoDigits: /^\\d{1,2}/,\n threeDigits: /^\\d{1,3}/,\n fourDigits: /^\\d{1,4}/,\n anyDigitsSigned: /^-?\\d+/,\n singleDigitSigned: /^-?\\d/,\n twoDigitsSigned: /^-?\\d{1,2}/,\n threeDigitsSigned: /^-?\\d{1,3}/,\n fourDigitsSigned: /^-?\\d{1,4}/\n};\nvar timezonePatterns = {\n basicOptionalMinutes: /^([+-])(\\d{2})(\\d{2})?|Z/,\n basic: /^([+-])(\\d{2})(\\d{2})|Z/,\n basicOptionalSeconds: /^([+-])(\\d{2})(\\d{2})((\\d{2}))?|Z/,\n extended: /^([+-])(\\d{2}):(\\d{2})|Z/,\n extendedOptionalSeconds: /^([+-])(\\d{2}):(\\d{2})(:(\\d{2}))?|Z/\n};\n\n// lib/parse/_lib/utils.js\nfunction mapValue(parseFnResult, mapFn) {\n if (!parseFnResult) {\n return parseFnResult;\n }\n return {\n value: mapFn(parseFnResult.value),\n rest: parseFnResult.rest\n };\n}\nfunction parseNumericPattern(pattern, dateString) {\n const matchResult = dateString.match(pattern);\n if (!matchResult) {\n return null;\n }\n return {\n value: parseInt(matchResult[0], 10),\n rest: dateString.slice(matchResult[0].length)\n };\n}\nfunction parseTimezonePattern(pattern, dateString) {\n const matchResult = dateString.match(pattern);\n if (!matchResult) {\n return null;\n }\n if (matchResult[0] === \"Z\") {\n return {\n value: 0,\n rest: dateString.slice(1)\n };\n }\n const sign = matchResult[1] === \"+\" ? 1 : -1;\n const hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;\n const minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;\n const seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;\n return {\n value: sign * (hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * millisecondsInSecond),\n rest: dateString.slice(matchResult[0].length)\n };\n}\nfunction parseAnyDigitsSigned(dateString) {\n return parseNumericPattern(numericPatterns.anyDigitsSigned, dateString);\n}\nfunction parseNDigits(n, dateString) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigit, dateString);\n case 2:\n return parseNumericPattern(numericPatterns.twoDigits, dateString);\n case 3:\n return parseNumericPattern(numericPatterns.threeDigits, dateString);\n case 4:\n return parseNumericPattern(numericPatterns.fourDigits, dateString);\n default:\n return parseNumericPattern(new RegExp(\"^\\\\d{1,\" + n + \"}\"), dateString);\n }\n}\nfunction parseNDigitsSigned(n, dateString) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigitSigned, dateString);\n case 2:\n return parseNumericPattern(numericPatterns.twoDigitsSigned, dateString);\n case 3:\n return parseNumericPattern(numericPatterns.threeDigitsSigned, dateString);\n case 4:\n return parseNumericPattern(numericPatterns.fourDigitsSigned, dateString);\n default:\n return parseNumericPattern(new RegExp(\"^-?\\\\d{1,\" + n + \"}\"), dateString);\n }\n}\nfunction dayPeriodEnumToHours(dayPeriod) {\n switch (dayPeriod) {\n case \"morning\":\n return 4;\n case \"evening\":\n return 17;\n case \"pm\":\n case \"noon\":\n case \"afternoon\":\n return 12;\n case \"am\":\n case \"midnight\":\n case \"night\":\n default:\n return 0;\n }\n}\nfunction normalizeTwoDigitYear(twoDigitYear, currentYear) {\n const isCommonEra = currentYear > 0;\n const absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;\n let result;\n if (absCurrentYear <= 50) {\n result = twoDigitYear || 100;\n } else {\n const rangeEnd = absCurrentYear + 50;\n const rangeEndCentury = Math.trunc(rangeEnd / 100) * 100;\n const isPreviousCentury = twoDigitYear >= rangeEnd % 100;\n result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);\n }\n return isCommonEra ? result : 1 - result;\n}\nfunction isLeapYearIndex(year) {\n return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;\n}\n\n// lib/parse/_lib/parsers/YearParser.js\nclass YearParser extends Parser {\n priority = 130;\n incompatibleTokens = [\"Y\", \"R\", \"u\", \"w\", \"I\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n parse(dateString, token, match3) {\n const valueCallback = (year) => ({\n year,\n isTwoDigitYear: token === \"yy\"\n });\n switch (token) {\n case \"y\":\n return mapValue(parseNDigits(4, dateString), valueCallback);\n case \"yo\":\n return mapValue(match3.ordinalNumber(dateString, {\n unit: \"year\"\n }), valueCallback);\n default:\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n }\n validate(_date, value) {\n return value.isTwoDigitYear || value.year > 0;\n }\n set(date, flags, value) {\n const currentYear = date.getFullYear();\n if (value.isTwoDigitYear) {\n const normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);\n date.setFullYear(normalizedTwoDigitYear, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n const year = !(\"era\" in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setFullYear(year, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n}\n\n// lib/parse/_lib/parsers/LocalWeekYearParser.js\nclass LocalWeekYearParser extends Parser {\n priority = 130;\n parse(dateString, token, match3) {\n const valueCallback = (year) => ({\n year,\n isTwoDigitYear: token === \"YY\"\n });\n switch (token) {\n case \"Y\":\n return mapValue(parseNDigits(4, dateString), valueCallback);\n case \"Yo\":\n return mapValue(match3.ordinalNumber(dateString, {\n unit: \"year\"\n }), valueCallback);\n default:\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n }\n validate(_date, value) {\n return value.isTwoDigitYear || value.year > 0;\n }\n set(date, flags, value, options) {\n const currentYear = getWeekYear(date, options);\n if (value.isTwoDigitYear) {\n const normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);\n date.setFullYear(normalizedTwoDigitYear, 0, options.firstWeekContainsDate);\n date.setHours(0, 0, 0, 0);\n return startOfWeek(date, options);\n }\n const year = !(\"era\" in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setFullYear(year, 0, options.firstWeekContainsDate);\n date.setHours(0, 0, 0, 0);\n return startOfWeek(date, options);\n }\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"Q\",\n \"q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"t\",\n \"T\"\n ];\n}\n\n// lib/parse/_lib/parsers/ISOWeekYearParser.js\nclass ISOWeekYearParser extends Parser {\n priority = 130;\n parse(dateString, token) {\n if (token === \"R\") {\n return parseNDigitsSigned(4, dateString);\n }\n return parseNDigitsSigned(token.length, dateString);\n }\n set(date, _flags, value) {\n const firstWeekOfYear = constructFrom(date, 0);\n firstWeekOfYear.setFullYear(value, 0, 4);\n firstWeekOfYear.setHours(0, 0, 0, 0);\n return startOfISOWeek(firstWeekOfYear);\n }\n incompatibleTokens = [\n \"G\",\n \"y\",\n \"Y\",\n \"u\",\n \"Q\",\n \"q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"e\",\n \"c\",\n \"t\",\n \"T\"\n ];\n}\n\n// lib/parse/_lib/parsers/ExtendedYearParser.js\nclass ExtendedYearParser extends Parser {\n priority = 130;\n parse(dateString, token) {\n if (token === \"u\") {\n return parseNDigitsSigned(4, dateString);\n }\n return parseNDigitsSigned(token.length, dateString);\n }\n set(date, _flags, value) {\n date.setFullYear(value, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n incompatibleTokens = [\"G\", \"y\", \"Y\", \"R\", \"w\", \"I\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n}\n\n// lib/parse/_lib/parsers/QuarterParser.js\nclass QuarterParser extends Parser {\n priority = 120;\n parse(dateString, token, match3) {\n switch (token) {\n case \"Q\":\n case \"QQ\":\n return parseNDigits(token.length, dateString);\n case \"Qo\":\n return match3.ordinalNumber(dateString, { unit: \"quarter\" });\n case \"QQQ\":\n return match3.quarter(dateString, {\n width: \"abbreviated\",\n context: \"formatting\"\n }) || match3.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\"\n });\n case \"QQQQQ\":\n return match3.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\"\n });\n case \"QQQQ\":\n default:\n return match3.quarter(dateString, {\n width: \"wide\",\n context: \"formatting\"\n }) || match3.quarter(dateString, {\n width: \"abbreviated\",\n context: \"formatting\"\n }) || match3.quarter(dateString, {\n width: \"narrow\",\n context: \"formatting\"\n });\n }\n }\n validate(_date, value) {\n return value >= 1 && value <= 4;\n }\n set(date, _flags, value) {\n date.setMonth((value - 1) * 3, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\"\n ];\n}\n\n// lib/parse/_lib/parsers/StandAloneQuarterParser.js\nclass StandAloneQuarterParser extends Parser {\n priority = 120;\n parse(dateString, token, match3) {\n switch (token) {\n case \"q\":\n case \"qq\":\n return parseNDigits(token.length, dateString);\n case \"qo\":\n return match3.ordinalNumber(dateString, { unit: \"quarter\" });\n case \"qqq\":\n return match3.quarter(dateString, {\n width: \"abbreviated\",\n context: \"standalone\"\n }) || match3.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\"\n });\n case \"qqqqq\":\n return match3.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\"\n });\n case \"qqqq\":\n default:\n return match3.quarter(dateString, {\n width: \"wide\",\n context: \"standalone\"\n }) || match3.quarter(dateString, {\n width: \"abbreviated\",\n context: \"standalone\"\n }) || match3.quarter(dateString, {\n width: \"narrow\",\n context: \"standalone\"\n });\n }\n }\n validate(_date, value) {\n return value >= 1 && value <= 4;\n }\n set(date, _flags, value) {\n date.setMonth((value - 1) * 3, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\"\n ];\n}\n\n// lib/parse/_lib/parsers/MonthParser.js\nclass MonthParser extends Parser {\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"L\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\"\n ];\n priority = 110;\n parse(dateString, token, match3) {\n const valueCallback = (value) => value - 1;\n switch (token) {\n case \"M\":\n return mapValue(parseNumericPattern(numericPatterns.month, dateString), valueCallback);\n case \"MM\":\n return mapValue(parseNDigits(2, dateString), valueCallback);\n case \"Mo\":\n return mapValue(match3.ordinalNumber(dateString, {\n unit: \"month\"\n }), valueCallback);\n case \"MMM\":\n return match3.month(dateString, {\n width: \"abbreviated\",\n context: \"formatting\"\n }) || match3.month(dateString, { width: \"narrow\", context: \"formatting\" });\n case \"MMMMM\":\n return match3.month(dateString, {\n width: \"narrow\",\n context: \"formatting\"\n });\n case \"MMMM\":\n default:\n return match3.month(dateString, { width: \"wide\", context: \"formatting\" }) || match3.month(dateString, {\n width: \"abbreviated\",\n context: \"formatting\"\n }) || match3.month(dateString, { width: \"narrow\", context: \"formatting\" });\n }\n }\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n set(date, _flags, value) {\n date.setMonth(value, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n}\n\n// lib/parse/_lib/parsers/StandAloneMonthParser.js\nclass StandAloneMonthParser extends Parser {\n priority = 110;\n parse(dateString, token, match3) {\n const valueCallback = (value) => value - 1;\n switch (token) {\n case \"L\":\n return mapValue(parseNumericPattern(numericPatterns.month, dateString), valueCallback);\n case \"LL\":\n return mapValue(parseNDigits(2, dateString), valueCallback);\n case \"Lo\":\n return mapValue(match3.ordinalNumber(dateString, {\n unit: \"month\"\n }), valueCallback);\n case \"LLL\":\n return match3.month(dateString, {\n width: \"abbreviated\",\n context: \"standalone\"\n }) || match3.month(dateString, { width: \"narrow\", context: \"standalone\" });\n case \"LLLLL\":\n return match3.month(dateString, {\n width: \"narrow\",\n context: \"standalone\"\n });\n case \"LLLL\":\n default:\n return match3.month(dateString, { width: \"wide\", context: \"standalone\" }) || match3.month(dateString, {\n width: \"abbreviated\",\n context: \"standalone\"\n }) || match3.month(dateString, { width: \"narrow\", context: \"standalone\" });\n }\n }\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n set(date, _flags, value) {\n date.setMonth(value, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"M\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\"\n ];\n}\n\n// lib/setWeek.js\nfunction setWeek(date, week, options) {\n const date_ = toDate(date, options?.in);\n const diff = getWeek(date_, options) - week;\n date_.setDate(date_.getDate() - diff * 7);\n return toDate(date_, options?.in);\n}\n\n// lib/parse/_lib/parsers/LocalWeekParser.js\nclass LocalWeekParser extends Parser {\n priority = 100;\n parse(dateString, token, match3) {\n switch (token) {\n case \"w\":\n return parseNumericPattern(numericPatterns.week, dateString);\n case \"wo\":\n return match3.ordinalNumber(dateString, { unit: \"week\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n validate(_date, value) {\n return value >= 1 && value <= 53;\n }\n set(date, _flags, value, options) {\n return startOfWeek(setWeek(date, value, options), options);\n }\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"i\",\n \"t\",\n \"T\"\n ];\n}\n\n// lib/setISOWeek.js\nfunction setISOWeek(date, week, options) {\n const _date = toDate(date, options?.in);\n const diff = getISOWeek(_date, options) - week;\n _date.setDate(_date.getDate() - diff * 7);\n return _date;\n}\n\n// lib/parse/_lib/parsers/ISOWeekParser.js\nclass ISOWeekParser extends Parser {\n priority = 100;\n parse(dateString, token, match3) {\n switch (token) {\n case \"I\":\n return parseNumericPattern(numericPatterns.week, dateString);\n case \"Io\":\n return match3.ordinalNumber(dateString, { unit: \"week\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n validate(_date, value) {\n return value >= 1 && value <= 53;\n }\n set(date, _flags, value) {\n return startOfISOWeek(setISOWeek(date, value));\n }\n incompatibleTokens = [\n \"y\",\n \"Y\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"e\",\n \"c\",\n \"t\",\n \"T\"\n ];\n}\n\n// lib/parse/_lib/parsers/DateParser.js\nvar DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nvar DAYS_IN_MONTH_LEAP_YEAR = [\n 31,\n 29,\n 31,\n 30,\n 31,\n 30,\n 31,\n 31,\n 30,\n 31,\n 30,\n 31\n];\n\nclass DateParser extends Parser {\n priority = 90;\n subPriority = 1;\n parse(dateString, token, match3) {\n switch (token) {\n case \"d\":\n return parseNumericPattern(numericPatterns.date, dateString);\n case \"do\":\n return match3.ordinalNumber(dateString, { unit: \"date\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n validate(date, value) {\n const year = date.getFullYear();\n const isLeapYear3 = isLeapYearIndex(year);\n const month = date.getMonth();\n if (isLeapYear3) {\n return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];\n } else {\n return value >= 1 && value <= DAYS_IN_MONTH[month];\n }\n }\n set(date, _flags, value) {\n date.setDate(value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"w\",\n \"I\",\n \"D\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\"\n ];\n}\n\n// lib/parse/_lib/parsers/DayOfYearParser.js\nclass DayOfYearParser extends Parser {\n priority = 90;\n subpriority = 1;\n parse(dateString, token, match3) {\n switch (token) {\n case \"D\":\n case \"DD\":\n return parseNumericPattern(numericPatterns.dayOfYear, dateString);\n case \"Do\":\n return match3.ordinalNumber(dateString, { unit: \"date\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n validate(date, value) {\n const year = date.getFullYear();\n const isLeapYear3 = isLeapYearIndex(year);\n if (isLeapYear3) {\n return value >= 1 && value <= 366;\n } else {\n return value >= 1 && value <= 365;\n }\n }\n set(date, _flags, value) {\n date.setMonth(0, value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n incompatibleTokens = [\n \"Y\",\n \"R\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"I\",\n \"d\",\n \"E\",\n \"i\",\n \"e\",\n \"c\",\n \"t\",\n \"T\"\n ];\n}\n\n// lib/setDay.js\nfunction setDay(date, day, options) {\n const defaultOptions14 = getDefaultOptions();\n const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions14.weekStartsOn ?? defaultOptions14.locale?.options?.weekStartsOn ?? 0;\n const date_ = toDate(date, options?.in);\n const currentDay = date_.getDay();\n const remainder = day % 7;\n const dayIndex = (remainder + 7) % 7;\n const delta = 7 - weekStartsOn;\n const diff = day < 0 || day > 6 ? day - (currentDay + delta) % 7 : (dayIndex + delta) % 7 - (currentDay + delta) % 7;\n return addDays(date_, diff, options);\n}\n\n// lib/parse/_lib/parsers/DayParser.js\nclass DayParser extends Parser {\n priority = 90;\n parse(dateString, token, match3) {\n switch (token) {\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return match3.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\"\n }) || match3.day(dateString, { width: \"short\", context: \"formatting\" }) || match3.day(dateString, { width: \"narrow\", context: \"formatting\" });\n case \"EEEEE\":\n return match3.day(dateString, {\n width: \"narrow\",\n context: \"formatting\"\n });\n case \"EEEEEE\":\n return match3.day(dateString, { width: \"short\", context: \"formatting\" }) || match3.day(dateString, { width: \"narrow\", context: \"formatting\" });\n case \"EEEE\":\n default:\n return match3.day(dateString, { width: \"wide\", context: \"formatting\" }) || match3.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\"\n }) || match3.day(dateString, { width: \"short\", context: \"formatting\" }) || match3.day(dateString, { width: \"narrow\", context: \"formatting\" });\n }\n }\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n incompatibleTokens = [\"D\", \"i\", \"e\", \"c\", \"t\", \"T\"];\n}\n\n// lib/parse/_lib/parsers/LocalDayParser.js\nclass LocalDayParser extends Parser {\n priority = 90;\n parse(dateString, token, match3, options) {\n const valueCallback = (value) => {\n const wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;\n };\n switch (token) {\n case \"e\":\n case \"ee\":\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n case \"eo\":\n return mapValue(match3.ordinalNumber(dateString, {\n unit: \"day\"\n }), valueCallback);\n case \"eee\":\n return match3.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\"\n }) || match3.day(dateString, { width: \"short\", context: \"formatting\" }) || match3.day(dateString, { width: \"narrow\", context: \"formatting\" });\n case \"eeeee\":\n return match3.day(dateString, {\n width: \"narrow\",\n context: \"formatting\"\n });\n case \"eeeeee\":\n return match3.day(dateString, { width: \"short\", context: \"formatting\" }) || match3.day(dateString, { width: \"narrow\", context: \"formatting\" });\n case \"eeee\":\n default:\n return match3.day(dateString, { width: \"wide\", context: \"formatting\" }) || match3.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\"\n }) || match3.day(dateString, { width: \"short\", context: \"formatting\" }) || match3.day(dateString, { width: \"narrow\", context: \"formatting\" });\n }\n }\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"E\",\n \"i\",\n \"c\",\n \"t\",\n \"T\"\n ];\n}\n\n// lib/parse/_lib/parsers/StandAloneLocalDayParser.js\nclass StandAloneLocalDayParser extends Parser {\n priority = 90;\n parse(dateString, token, match3, options) {\n const valueCallback = (value) => {\n const wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;\n };\n switch (token) {\n case \"c\":\n case \"cc\":\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n case \"co\":\n return mapValue(match3.ordinalNumber(dateString, {\n unit: \"day\"\n }), valueCallback);\n case \"ccc\":\n return match3.day(dateString, {\n width: \"abbreviated\",\n context: \"standalone\"\n }) || match3.day(dateString, { width: \"short\", context: \"standalone\" }) || match3.day(dateString, { width: \"narrow\", context: \"standalone\" });\n case \"ccccc\":\n return match3.day(dateString, {\n width: \"narrow\",\n context: \"standalone\"\n });\n case \"cccccc\":\n return match3.day(dateString, { width: \"short\", context: \"standalone\" }) || match3.day(dateString, { width: \"narrow\", context: \"standalone\" });\n case \"cccc\":\n default:\n return match3.day(dateString, { width: \"wide\", context: \"standalone\" }) || match3.day(dateString, {\n width: \"abbreviated\",\n context: \"standalone\"\n }) || match3.day(dateString, { width: \"short\", context: \"standalone\" }) || match3.day(dateString, { width: \"narrow\", context: \"standalone\" });\n }\n }\n validate(_date, value) {\n return value >= 0 && value <= 6;\n }\n set(date, _flags, value, options) {\n date = setDay(date, value, options);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n incompatibleTokens = [\n \"y\",\n \"R\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"I\",\n \"d\",\n \"D\",\n \"E\",\n \"i\",\n \"e\",\n \"t\",\n \"T\"\n ];\n}\n\n// lib/setISODay.js\nfunction setISODay(date, day, options) {\n const date_ = toDate(date, options?.in);\n const currentDay = getISODay(date_, options);\n const diff = day - currentDay;\n return addDays(date_, diff, options);\n}\n\n// lib/parse/_lib/parsers/ISODayParser.js\nclass ISODayParser extends Parser {\n priority = 90;\n parse(dateString, token, match3) {\n const valueCallback = (value) => {\n if (value === 0) {\n return 7;\n }\n return value;\n };\n switch (token) {\n case \"i\":\n case \"ii\":\n return parseNDigits(token.length, dateString);\n case \"io\":\n return match3.ordinalNumber(dateString, { unit: \"day\" });\n case \"iii\":\n return mapValue(match3.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\"\n }) || match3.day(dateString, {\n width: \"short\",\n context: \"formatting\"\n }) || match3.day(dateString, {\n width: \"narrow\",\n context: \"formatting\"\n }), valueCallback);\n case \"iiiii\":\n return mapValue(match3.day(dateString, {\n width: \"narrow\",\n context: \"formatting\"\n }), valueCallback);\n case \"iiiiii\":\n return mapValue(match3.day(dateString, {\n width: \"short\",\n context: \"formatting\"\n }) || match3.day(dateString, {\n width: \"narrow\",\n context: \"formatting\"\n }), valueCallback);\n case \"iiii\":\n default:\n return mapValue(match3.day(dateString, {\n width: \"wide\",\n context: \"formatting\"\n }) || match3.day(dateString, {\n width: \"abbreviated\",\n context: \"formatting\"\n }) || match3.day(dateString, {\n width: \"short\",\n context: \"formatting\"\n }) || match3.day(dateString, {\n width: \"narrow\",\n context: \"formatting\"\n }), valueCallback);\n }\n }\n validate(_date, value) {\n return value >= 1 && value <= 7;\n }\n set(date, _flags, value) {\n date = setISODay(date, value);\n date.setHours(0, 0, 0, 0);\n return date;\n }\n incompatibleTokens = [\n \"y\",\n \"Y\",\n \"u\",\n \"q\",\n \"Q\",\n \"M\",\n \"L\",\n \"w\",\n \"d\",\n \"D\",\n \"E\",\n \"e\",\n \"c\",\n \"t\",\n \"T\"\n ];\n}\n\n// lib/parse/_lib/parsers/AMPMParser.js\nclass AMPMParser extends Parser {\n priority = 80;\n parse(dateString, token, match3) {\n switch (token) {\n case \"a\":\n case \"aa\":\n case \"aaa\":\n return match3.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\"\n }) || match3.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\"\n });\n case \"aaaaa\":\n return match3.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\"\n });\n case \"aaaa\":\n default:\n return match3.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\"\n }) || match3.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\"\n }) || match3.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\"\n });\n }\n }\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n incompatibleTokens = [\"b\", \"B\", \"H\", \"k\", \"t\", \"T\"];\n}\n\n// lib/parse/_lib/parsers/AMPMMidnightParser.js\nclass AMPMMidnightParser extends Parser {\n priority = 80;\n parse(dateString, token, match3) {\n switch (token) {\n case \"b\":\n case \"bb\":\n case \"bbb\":\n return match3.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\"\n }) || match3.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\"\n });\n case \"bbbbb\":\n return match3.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\"\n });\n case \"bbbb\":\n default:\n return match3.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\"\n }) || match3.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\"\n }) || match3.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\"\n });\n }\n }\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n incompatibleTokens = [\"a\", \"B\", \"H\", \"k\", \"t\", \"T\"];\n}\n\n// lib/parse/_lib/parsers/DayPeriodParser.js\nclass DayPeriodParser extends Parser {\n priority = 80;\n parse(dateString, token, match3) {\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return match3.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\"\n }) || match3.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\"\n });\n case \"BBBBB\":\n return match3.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\"\n });\n case \"BBBB\":\n default:\n return match3.dayPeriod(dateString, {\n width: \"wide\",\n context: \"formatting\"\n }) || match3.dayPeriod(dateString, {\n width: \"abbreviated\",\n context: \"formatting\"\n }) || match3.dayPeriod(dateString, {\n width: \"narrow\",\n context: \"formatting\"\n });\n }\n }\n set(date, _flags, value) {\n date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n }\n incompatibleTokens = [\"a\", \"b\", \"t\", \"T\"];\n}\n\n// lib/parse/_lib/parsers/Hour1to12Parser.js\nclass Hour1to12Parser extends Parser {\n priority = 70;\n parse(dateString, token, match3) {\n switch (token) {\n case \"h\":\n return parseNumericPattern(numericPatterns.hour12h, dateString);\n case \"ho\":\n return match3.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n validate(_date, value) {\n return value >= 1 && value <= 12;\n }\n set(date, _flags, value) {\n const isPM = date.getHours() >= 12;\n if (isPM && value < 12) {\n date.setHours(value + 12, 0, 0, 0);\n } else if (!isPM && value === 12) {\n date.setHours(0, 0, 0, 0);\n } else {\n date.setHours(value, 0, 0, 0);\n }\n return date;\n }\n incompatibleTokens = [\"H\", \"K\", \"k\", \"t\", \"T\"];\n}\n\n// lib/parse/_lib/parsers/Hour0to23Parser.js\nclass Hour0to23Parser extends Parser {\n priority = 70;\n parse(dateString, token, match3) {\n switch (token) {\n case \"H\":\n return parseNumericPattern(numericPatterns.hour23h, dateString);\n case \"Ho\":\n return match3.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n validate(_date, value) {\n return value >= 0 && value <= 23;\n }\n set(date, _flags, value) {\n date.setHours(value, 0, 0, 0);\n return date;\n }\n incompatibleTokens = [\"a\", \"b\", \"h\", \"K\", \"k\", \"t\", \"T\"];\n}\n\n// lib/parse/_lib/parsers/Hour0To11Parser.js\nclass Hour0To11Parser extends Parser {\n priority = 70;\n parse(dateString, token, match3) {\n switch (token) {\n case \"K\":\n return parseNumericPattern(numericPatterns.hour11h, dateString);\n case \"Ko\":\n return match3.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n validate(_date, value) {\n return value >= 0 && value <= 11;\n }\n set(date, _flags, value) {\n const isPM = date.getHours() >= 12;\n if (isPM && value < 12) {\n date.setHours(value + 12, 0, 0, 0);\n } else {\n date.setHours(value, 0, 0, 0);\n }\n return date;\n }\n incompatibleTokens = [\"h\", \"H\", \"k\", \"t\", \"T\"];\n}\n\n// lib/parse/_lib/parsers/Hour1To24Parser.js\nclass Hour1To24Parser extends Parser {\n priority = 70;\n parse(dateString, token, match3) {\n switch (token) {\n case \"k\":\n return parseNumericPattern(numericPatterns.hour24h, dateString);\n case \"ko\":\n return match3.ordinalNumber(dateString, { unit: \"hour\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n validate(_date, value) {\n return value >= 1 && value <= 24;\n }\n set(date, _flags, value) {\n const hours = value <= 24 ? value % 24 : value;\n date.setHours(hours, 0, 0, 0);\n return date;\n }\n incompatibleTokens = [\"a\", \"b\", \"h\", \"H\", \"K\", \"t\", \"T\"];\n}\n\n// lib/parse/_lib/parsers/MinuteParser.js\nclass MinuteParser extends Parser {\n priority = 60;\n parse(dateString, token, match3) {\n switch (token) {\n case \"m\":\n return parseNumericPattern(numericPatterns.minute, dateString);\n case \"mo\":\n return match3.ordinalNumber(dateString, { unit: \"minute\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n validate(_date, value) {\n return value >= 0 && value <= 59;\n }\n set(date, _flags, value) {\n date.setMinutes(value, 0, 0);\n return date;\n }\n incompatibleTokens = [\"t\", \"T\"];\n}\n\n// lib/parse/_lib/parsers/SecondParser.js\nclass SecondParser extends Parser {\n priority = 50;\n parse(dateString, token, match3) {\n switch (token) {\n case \"s\":\n return parseNumericPattern(numericPatterns.second, dateString);\n case \"so\":\n return match3.ordinalNumber(dateString, { unit: \"second\" });\n default:\n return parseNDigits(token.length, dateString);\n }\n }\n validate(_date, value) {\n return value >= 0 && value <= 59;\n }\n set(date, _flags, value) {\n date.setSeconds(value, 0);\n return date;\n }\n incompatibleTokens = [\"t\", \"T\"];\n}\n\n// lib/parse/_lib/parsers/FractionOfSecondParser.js\nclass FractionOfSecondParser extends Parser {\n priority = 30;\n parse(dateString, token) {\n const valueCallback = (value) => Math.trunc(value * Math.pow(10, -token.length + 3));\n return mapValue(parseNDigits(token.length, dateString), valueCallback);\n }\n set(date, _flags, value) {\n date.setMilliseconds(value);\n return date;\n }\n incompatibleTokens = [\"t\", \"T\"];\n}\n\n// lib/parse/_lib/parsers/ISOTimezoneWithZParser.js\nclass ISOTimezoneWithZParser extends Parser {\n priority = 10;\n parse(dateString, token) {\n switch (token) {\n case \"X\":\n return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, dateString);\n case \"XX\":\n return parseTimezonePattern(timezonePatterns.basic, dateString);\n case \"XXXX\":\n return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, dateString);\n case \"XXXXX\":\n return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, dateString);\n case \"XXX\":\n default:\n return parseTimezonePattern(timezonePatterns.extended, dateString);\n }\n }\n set(date, flags, value) {\n if (flags.timestampIsSet)\n return date;\n return constructFrom(date, date.getTime() - getTimezoneOffsetInMilliseconds(date) - value);\n }\n incompatibleTokens = [\"t\", \"T\", \"x\"];\n}\n\n// lib/parse/_lib/parsers/ISOTimezoneParser.js\nclass ISOTimezoneParser extends Parser {\n priority = 10;\n parse(dateString, token) {\n switch (token) {\n case \"x\":\n return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, dateString);\n case \"xx\":\n return parseTimezonePattern(timezonePatterns.basic, dateString);\n case \"xxxx\":\n return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, dateString);\n case \"xxxxx\":\n return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, dateString);\n case \"xxx\":\n default:\n return parseTimezonePattern(timezonePatterns.extended, dateString);\n }\n }\n set(date, flags, value) {\n if (flags.timestampIsSet)\n return date;\n return constructFrom(date, date.getTime() - getTimezoneOffsetInMilliseconds(date) - value);\n }\n incompatibleTokens = [\"t\", \"T\", \"X\"];\n}\n\n// lib/parse/_lib/parsers/TimestampSecondsParser.js\nclass TimestampSecondsParser extends Parser {\n priority = 40;\n parse(dateString) {\n return parseAnyDigitsSigned(dateString);\n }\n set(date, _flags, value) {\n return [constructFrom(date, value * 1000), { timestampIsSet: true }];\n }\n incompatibleTokens = \"*\";\n}\n\n// lib/parse/_lib/parsers/TimestampMillisecondsParser.js\nclass TimestampMillisecondsParser extends Parser {\n priority = 20;\n parse(dateString) {\n return parseAnyDigitsSigned(dateString);\n }\n set(date, _flags, value) {\n return [constructFrom(date, value), { timestampIsSet: true }];\n }\n incompatibleTokens = \"*\";\n}\n\n// lib/parse/_lib/parsers.js\nvar parsers = {\n G: new EraParser,\n y: new YearParser,\n Y: new LocalWeekYearParser,\n R: new ISOWeekYearParser,\n u: new ExtendedYearParser,\n Q: new QuarterParser,\n q: new StandAloneQuarterParser,\n M: new MonthParser,\n L: new StandAloneMonthParser,\n w: new LocalWeekParser,\n I: new ISOWeekParser,\n d: new DateParser,\n D: new DayOfYearParser,\n E: new DayParser,\n e: new LocalDayParser,\n c: new StandAloneLocalDayParser,\n i: new ISODayParser,\n a: new AMPMParser,\n b: new AMPMMidnightParser,\n B: new DayPeriodParser,\n h: new Hour1to12Parser,\n H: new Hour0to23Parser,\n K: new Hour0To11Parser,\n k: new Hour1To24Parser,\n m: new MinuteParser,\n s: new SecondParser,\n S: new FractionOfSecondParser,\n X: new ISOTimezoneWithZParser,\n x: new ISOTimezoneParser,\n t: new TimestampSecondsParser,\n T: new TimestampMillisecondsParser\n};\n\n// lib/parse.js\nfunction parse(dateStr, formatStr, referenceDate, options) {\n const invalidDate = () => constructFrom(options?.in || referenceDate, NaN);\n const defaultOptions14 = getDefaultOptions2();\n const locale = options?.locale ?? defaultOptions14.locale ?? enUS;\n const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions14.firstWeekContainsDate ?? defaultOptions14.locale?.options?.firstWeekContainsDate ?? 1;\n const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions14.weekStartsOn ?? defaultOptions14.locale?.options?.weekStartsOn ?? 0;\n if (!formatStr)\n return dateStr ? invalidDate() : toDate(referenceDate, options?.in);\n const subFnOptions = {\n firstWeekContainsDate,\n weekStartsOn,\n locale\n };\n const setters = [new DateTimezoneSetter(options?.in, referenceDate)];\n const tokens = formatStr.match(longFormattingTokensRegExp2).map((substring) => {\n const firstCharacter = substring[0];\n if (firstCharacter in longFormatters) {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n }).join(\"\").match(formattingTokensRegExp2);\n const usedTokens = [];\n for (let token of tokens) {\n if (!options?.useAdditionalWeekYearTokens && isProtectedWeekYearToken(token)) {\n warnOrThrowProtectedError(token, formatStr, dateStr);\n }\n if (!options?.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(token)) {\n warnOrThrowProtectedError(token, formatStr, dateStr);\n }\n const firstCharacter = token[0];\n const parser = parsers[firstCharacter];\n if (parser) {\n const { incompatibleTokens } = parser;\n if (Array.isArray(incompatibleTokens)) {\n const incompatibleToken = usedTokens.find((usedToken) => incompatibleTokens.includes(usedToken.token) || usedToken.token === firstCharacter);\n if (incompatibleToken) {\n throw new RangeError(`The format string mustn't contain \\`${incompatibleToken.fullToken}\\` and \\`${token}\\` at the same time`);\n }\n } else if (parser.incompatibleTokens === \"*\" && usedTokens.length > 0) {\n throw new RangeError(`The format string mustn't contain \\`${token}\\` and any other token at the same time`);\n }\n usedTokens.push({ token: firstCharacter, fullToken: token });\n const parseResult = parser.run(dateStr, token, locale.match, subFnOptions);\n if (!parseResult) {\n return invalidDate();\n }\n setters.push(parseResult.setter);\n dateStr = parseResult.rest;\n } else {\n if (firstCharacter.match(unescapedLatinCharacterRegExp2)) {\n throw new RangeError(\"Format string contains an unescaped latin alphabet character `\" + firstCharacter + \"`\");\n }\n if (token === \"''\") {\n token = \"'\";\n } else if (firstCharacter === \"'\") {\n token = cleanEscapedString2(token);\n }\n if (dateStr.indexOf(token) === 0) {\n dateStr = dateStr.slice(token.length);\n } else {\n return invalidDate();\n }\n }\n }\n if (dateStr.length > 0 && notWhitespaceRegExp.test(dateStr)) {\n return invalidDate();\n }\n const uniquePrioritySetters = setters.map((setter) => setter.priority).sort((a, b) => b - a).filter((priority, index, array) => array.indexOf(priority) === index).map((priority) => setters.filter((setter) => setter.priority === priority).sort((a, b) => b.subPriority - a.subPriority)).map((setterArray) => setterArray[0]);\n let date = toDate(referenceDate, options?.in);\n if (isNaN(+date))\n return invalidDate();\n const flags = {};\n for (const setter of uniquePrioritySetters) {\n if (!setter.validate(date, subFnOptions)) {\n return invalidDate();\n }\n const result = setter.set(date, flags, subFnOptions);\n if (Array.isArray(result)) {\n date = result[0];\n Object.assign(flags, result[1]);\n } else {\n date = result;\n }\n }\n return date;\n}\nfunction cleanEscapedString2(input) {\n return input.match(escapedStringRegExp2)[1].replace(doubleQuoteRegExp2, \"'\");\n}\nvar formattingTokensRegExp2 = /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\nvar longFormattingTokensRegExp2 = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\nvar escapedStringRegExp2 = /^'([^]*?)'?$/;\nvar doubleQuoteRegExp2 = /''/g;\nvar notWhitespaceRegExp = /\\S/;\nvar unescapedLatinCharacterRegExp2 = /[a-zA-Z]/;\n\n// lib/isMatch.js\nfunction isMatch(dateStr, formatStr, options) {\n return isValid(parse(dateStr, formatStr, new Date, options));\n}\n// lib/isMonday.js\nfunction isMonday(date, options) {\n return toDate(date, options?.in).getDay() === 1;\n}\n// lib/isPast.js\nfunction isPast(date) {\n return +toDate(date) < Date.now();\n}\n// lib/startOfHour.js\nfunction startOfHour(date, options) {\n const _date = toDate(date, options?.in);\n _date.setMinutes(0, 0, 0);\n return _date;\n}\n\n// lib/isSameHour.js\nfunction isSameHour(dateLeft, dateRight, options) {\n const [dateLeft_, dateRight_] = normalizeDates(options?.in, dateLeft, dateRight);\n return +startOfHour(dateLeft_) === +startOfHour(dateRight_);\n}\n// lib/isSameWeek.js\nfunction isSameWeek(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate);\n return +startOfWeek(laterDate_, options) === +startOfWeek(earlierDate_, options);\n}\n\n// lib/isSameISOWeek.js\nfunction isSameISOWeek(laterDate, earlierDate, options) {\n return isSameWeek(laterDate, earlierDate, { ...options, weekStartsOn: 1 });\n}\n// lib/isSameISOWeekYear.js\nfunction isSameISOWeekYear(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate);\n return +startOfISOWeekYear(laterDate_) === +startOfISOWeekYear(earlierDate_);\n}\n// lib/startOfMinute.js\nfunction startOfMinute(date, options) {\n const date_ = toDate(date, options?.in);\n date_.setSeconds(0, 0);\n return date_;\n}\n\n// lib/isSameMinute.js\nfunction isSameMinute(laterDate, earlierDate) {\n return +startOfMinute(laterDate) === +startOfMinute(earlierDate);\n}\n// lib/isSameMonth.js\nfunction isSameMonth(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate);\n return laterDate_.getFullYear() === earlierDate_.getFullYear() && laterDate_.getMonth() === earlierDate_.getMonth();\n}\n// lib/isSameQuarter.js\nfunction isSameQuarter(laterDate, earlierDate, options) {\n const [dateLeft_, dateRight_] = normalizeDates(options?.in, laterDate, earlierDate);\n return +startOfQuarter(dateLeft_) === +startOfQuarter(dateRight_);\n}\n// lib/startOfSecond.js\nfunction startOfSecond(date, options) {\n const date_ = toDate(date, options?.in);\n date_.setMilliseconds(0);\n return date_;\n}\n\n// lib/isSameSecond.js\nfunction isSameSecond(laterDate, earlierDate) {\n return +startOfSecond(laterDate) === +startOfSecond(earlierDate);\n}\n// lib/isSameYear.js\nfunction isSameYear(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate);\n return laterDate_.getFullYear() === earlierDate_.getFullYear();\n}\n// lib/isThisHour.js\nfunction isThisHour(date, options) {\n return isSameHour(toDate(date, options?.in), constructNow(options?.in || date));\n}\n// lib/isThisISOWeek.js\nfunction isThisISOWeek(date, options) {\n return isSameISOWeek(constructFrom(options?.in || date, date), constructNow(options?.in || date));\n}\n// lib/isThisMinute.js\nfunction isThisMinute(date) {\n return isSameMinute(date, constructNow(date));\n}\n// lib/isThisMonth.js\nfunction isThisMonth(date, options) {\n return isSameMonth(constructFrom(options?.in || date, date), constructNow(options?.in || date));\n}\n// lib/isThisQuarter.js\nfunction isThisQuarter(date, options) {\n return isSameQuarter(constructFrom(options?.in || date, date), constructNow(options?.in || date));\n}\n// lib/isThisSecond.js\nfunction isThisSecond(date) {\n return isSameSecond(date, constructNow(date));\n}\n// lib/isThisWeek.js\nfunction isThisWeek(date, options) {\n return isSameWeek(constructFrom(options?.in || date, date), constructNow(options?.in || date), options);\n}\n// lib/isThisYear.js\nfunction isThisYear(date, options) {\n return isSameYear(constructFrom(options?.in || date, date), constructNow(options?.in || date));\n}\n// lib/isThursday.js\nfunction isThursday(date, options) {\n return toDate(date, options?.in).getDay() === 4;\n}\n// lib/isToday.js\nfunction isToday(date, options) {\n return isSameDay(constructFrom(options?.in || date, date), constructNow(options?.in || date));\n}\n// lib/isTomorrow.js\nfunction isTomorrow(date, options) {\n return isSameDay(date, addDays(constructNow(options?.in || date), 1), options);\n}\n// lib/isTuesday.js\nfunction isTuesday(date, options) {\n return toDate(date, options?.in).getDay() === 2;\n}\n// lib/isWednesday.js\nfunction isWednesday(date, options) {\n return toDate(date, options?.in).getDay() === 3;\n}\n// lib/isWithinInterval.js\nfunction isWithinInterval(date, interval2, options) {\n const time = +toDate(date, options?.in);\n const [startTime, endTime] = [\n +toDate(interval2.start, options?.in),\n +toDate(interval2.end, options?.in)\n ].sort((a, b) => a - b);\n return time >= startTime && time <= endTime;\n}\n// lib/subDays.js\nfunction subDays(date, amount, options) {\n return addDays(date, -amount, options);\n}\n\n// lib/isYesterday.js\nfunction isYesterday(date, options) {\n return isSameDay(constructFrom(options?.in || date, date), subDays(constructNow(options?.in || date), 1));\n}\n// lib/lastDayOfDecade.js\nfunction lastDayOfDecade(date, options) {\n const _date = toDate(date, options?.in);\n const year = _date.getFullYear();\n const decade = 9 + Math.floor(year / 10) * 10;\n _date.setFullYear(decade + 1, 0, 0);\n _date.setHours(0, 0, 0, 0);\n return toDate(_date, options?.in);\n}\n// lib/lastDayOfWeek.js\nfunction lastDayOfWeek(date, options) {\n const defaultOptions15 = getDefaultOptions();\n const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions15.weekStartsOn ?? defaultOptions15.locale?.options?.weekStartsOn ?? 0;\n const _date = toDate(date, options?.in);\n const day = _date.getDay();\n const diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn);\n _date.setHours(0, 0, 0, 0);\n _date.setDate(_date.getDate() + diff);\n return _date;\n}\n\n// lib/lastDayOfISOWeek.js\nfunction lastDayOfISOWeek(date, options) {\n return lastDayOfWeek(date, { ...options, weekStartsOn: 1 });\n}\n// lib/lastDayOfISOWeekYear.js\nfunction lastDayOfISOWeekYear(date, options) {\n const year = getISOWeekYear(date, options);\n const fourthOfJanuary = constructFrom(options?.in || date, 0);\n fourthOfJanuary.setFullYear(year + 1, 0, 4);\n fourthOfJanuary.setHours(0, 0, 0, 0);\n const date_ = startOfISOWeek(fourthOfJanuary, options);\n date_.setDate(date_.getDate() - 1);\n return date_;\n}\n// lib/lastDayOfQuarter.js\nfunction lastDayOfQuarter(date, options) {\n const date_ = toDate(date, options?.in);\n const currentMonth = date_.getMonth();\n const month = currentMonth - currentMonth % 3 + 3;\n date_.setMonth(month, 0);\n date_.setHours(0, 0, 0, 0);\n return date_;\n}\n// lib/lastDayOfYear.js\nfunction lastDayOfYear(date, options) {\n const date_ = toDate(date, options?.in);\n const year = date_.getFullYear();\n date_.setFullYear(year + 1, 0, 0);\n date_.setHours(0, 0, 0, 0);\n return date_;\n}\n// lib/lightFormat.js\nfunction lightFormat(date, formatStr) {\n const date_ = toDate(date);\n if (!isValid(date_)) {\n throw new RangeError(\"Invalid time value\");\n }\n const tokens = formatStr.match(formattingTokensRegExp3);\n if (!tokens)\n return \"\";\n const result = tokens.map((substring) => {\n if (substring === \"''\") {\n return \"'\";\n }\n const firstCharacter = substring[0];\n if (firstCharacter === \"'\") {\n return cleanEscapedString3(substring);\n }\n const formatter = lightFormatters[firstCharacter];\n if (formatter) {\n return formatter(date_, substring);\n }\n if (firstCharacter.match(unescapedLatinCharacterRegExp3)) {\n throw new RangeError(\"Format string contains an unescaped latin alphabet character `\" + firstCharacter + \"`\");\n }\n return substring;\n }).join(\"\");\n return result;\n}\nfunction cleanEscapedString3(input) {\n const matches = input.match(escapedStringRegExp3);\n if (!matches)\n return input;\n return matches[1].replace(doubleQuoteRegExp3, \"'\");\n}\nvar formattingTokensRegExp3 = /(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\nvar escapedStringRegExp3 = /^'([^]*?)'?$/;\nvar doubleQuoteRegExp3 = /''/g;\nvar unescapedLatinCharacterRegExp3 = /[a-zA-Z]/;\n// lib/milliseconds.js\nfunction milliseconds({\n years,\n months: months2,\n weeks,\n days: days2,\n hours,\n minutes,\n seconds\n}) {\n let totalDays = 0;\n if (years)\n totalDays += years * daysInYear;\n if (months2)\n totalDays += months2 * (daysInYear / 12);\n if (weeks)\n totalDays += weeks * 7;\n if (days2)\n totalDays += days2;\n let totalSeconds = totalDays * 24 * 60 * 60;\n if (hours)\n totalSeconds += hours * 60 * 60;\n if (minutes)\n totalSeconds += minutes * 60;\n if (seconds)\n totalSeconds += seconds;\n return Math.trunc(totalSeconds * 1000);\n}\n// lib/millisecondsToHours.js\nfunction millisecondsToHours(milliseconds2) {\n const hours = milliseconds2 / millisecondsInHour;\n return Math.trunc(hours);\n}\n// lib/millisecondsToMinutes.js\nfunction millisecondsToMinutes(milliseconds2) {\n const minutes = milliseconds2 / millisecondsInMinute;\n return Math.trunc(minutes);\n}\n// lib/millisecondsToSeconds.js\nfunction millisecondsToSeconds(milliseconds2) {\n const seconds = milliseconds2 / millisecondsInSecond;\n return Math.trunc(seconds);\n}\n// lib/minutesToHours.js\nfunction minutesToHours(minutes) {\n const hours = minutes / minutesInHour;\n return Math.trunc(hours);\n}\n// lib/minutesToMilliseconds.js\nfunction minutesToMilliseconds(minutes) {\n return Math.trunc(minutes * millisecondsInMinute);\n}\n// lib/minutesToSeconds.js\nfunction minutesToSeconds(minutes) {\n return Math.trunc(minutes * secondsInMinute);\n}\n// lib/monthsToQuarters.js\nfunction monthsToQuarters(months2) {\n const quarters = months2 / monthsInQuarter;\n return Math.trunc(quarters);\n}\n// lib/monthsToYears.js\nfunction monthsToYears(months2) {\n const years = months2 / monthsInYear;\n return Math.trunc(years);\n}\n// lib/nextDay.js\nfunction nextDay(date, day, options) {\n let delta = day - getDay(date, options);\n if (delta <= 0)\n delta += 7;\n return addDays(date, delta, options);\n}\n// lib/nextFriday.js\nfunction nextFriday(date, options) {\n return nextDay(date, 5, options);\n}\n// lib/nextMonday.js\nfunction nextMonday(date, options) {\n return nextDay(date, 1, options);\n}\n// lib/nextSaturday.js\nfunction nextSaturday(date, options) {\n return nextDay(date, 6, options);\n}\n// lib/nextSunday.js\nfunction nextSunday(date, options) {\n return nextDay(date, 0, options);\n}\n// lib/nextThursday.js\nfunction nextThursday(date, options) {\n return nextDay(date, 4, options);\n}\n// lib/nextTuesday.js\nfunction nextTuesday(date, options) {\n return nextDay(date, 2, options);\n}\n// lib/nextWednesday.js\nfunction nextWednesday(date, options) {\n return nextDay(date, 3, options);\n}\n// lib/parseISO.js\nfunction parseISO(argument, options) {\n const invalidDate = () => constructFrom(options?.in, NaN);\n const additionalDigits = options?.additionalDigits ?? 2;\n const dateStrings = splitDateString(argument);\n let date;\n if (dateStrings.date) {\n const parseYearResult = parseYear(dateStrings.date, additionalDigits);\n date = parseDate(parseYearResult.restDateString, parseYearResult.year);\n }\n if (!date || isNaN(+date))\n return invalidDate();\n const timestamp = +date;\n let time = 0;\n let offset;\n if (dateStrings.time) {\n time = parseTime(dateStrings.time);\n if (isNaN(time))\n return invalidDate();\n }\n if (dateStrings.timezone) {\n offset = parseTimezone(dateStrings.timezone);\n if (isNaN(offset))\n return invalidDate();\n } else {\n const tmpDate = new Date(timestamp + time);\n const result = toDate(0, options?.in);\n result.setFullYear(tmpDate.getUTCFullYear(), tmpDate.getUTCMonth(), tmpDate.getUTCDate());\n result.setHours(tmpDate.getUTCHours(), tmpDate.getUTCMinutes(), tmpDate.getUTCSeconds(), tmpDate.getUTCMilliseconds());\n return result;\n }\n return toDate(timestamp + time + offset, options?.in);\n}\nfunction splitDateString(dateString) {\n const dateStrings = {};\n const array = dateString.split(patterns.dateTimeDelimiter);\n let timeString;\n if (array.length > 2) {\n return dateStrings;\n }\n if (/:/.test(array[0])) {\n timeString = array[0];\n } else {\n dateStrings.date = array[0];\n timeString = array[1];\n if (patterns.timeZoneDelimiter.test(dateStrings.date)) {\n dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0];\n timeString = dateString.substr(dateStrings.date.length, dateString.length);\n }\n }\n if (timeString) {\n const token = patterns.timezone.exec(timeString);\n if (token) {\n dateStrings.time = timeString.replace(token[1], \"\");\n dateStrings.timezone = token[1];\n } else {\n dateStrings.time = timeString;\n }\n }\n return dateStrings;\n}\nfunction parseYear(dateString, additionalDigits) {\n const regex = new RegExp(\"^(?:(\\\\d{4}|[+-]\\\\d{\" + (4 + additionalDigits) + \"})|(\\\\d{2}|[+-]\\\\d{\" + (2 + additionalDigits) + \"})$)\");\n const captures = dateString.match(regex);\n if (!captures)\n return { year: NaN, restDateString: \"\" };\n const year = captures[1] ? parseInt(captures[1]) : null;\n const century = captures[2] ? parseInt(captures[2]) : null;\n return {\n year: century === null ? year : century * 100,\n restDateString: dateString.slice((captures[1] || captures[2]).length)\n };\n}\nfunction parseDate(dateString, year) {\n if (year === null)\n return new Date(NaN);\n const captures = dateString.match(dateRegex);\n if (!captures)\n return new Date(NaN);\n const isWeekDate = !!captures[4];\n const dayOfYear = parseDateUnit(captures[1]);\n const month = parseDateUnit(captures[2]) - 1;\n const day = parseDateUnit(captures[3]);\n const week = parseDateUnit(captures[4]);\n const dayOfWeek = parseDateUnit(captures[5]) - 1;\n if (isWeekDate) {\n if (!validateWeekDate(year, week, dayOfWeek)) {\n return new Date(NaN);\n }\n return dayOfISOWeekYear(year, week, dayOfWeek);\n } else {\n const date = new Date(0);\n if (!validateDate(year, month, day) || !validateDayOfYearDate(year, dayOfYear)) {\n return new Date(NaN);\n }\n date.setUTCFullYear(year, month, Math.max(dayOfYear, day));\n return date;\n }\n}\nfunction parseDateUnit(value) {\n return value ? parseInt(value) : 1;\n}\nfunction parseTime(timeString) {\n const captures = timeString.match(timeRegex);\n if (!captures)\n return NaN;\n const hours = parseTimeUnit(captures[1]);\n const minutes = parseTimeUnit(captures[2]);\n const seconds = parseTimeUnit(captures[3]);\n if (!validateTime(hours, minutes, seconds)) {\n return NaN;\n }\n return hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * 1000;\n}\nfunction parseTimeUnit(value) {\n return value && parseFloat(value.replace(\",\", \".\")) || 0;\n}\nfunction parseTimezone(timezoneString) {\n if (timezoneString === \"Z\")\n return 0;\n const captures = timezoneString.match(timezoneRegex);\n if (!captures)\n return 0;\n const sign = captures[1] === \"+\" ? -1 : 1;\n const hours = parseInt(captures[2]);\n const minutes = captures[3] && parseInt(captures[3]) || 0;\n if (!validateTimezone(hours, minutes)) {\n return NaN;\n }\n return sign * (hours * millisecondsInHour + minutes * millisecondsInMinute);\n}\nfunction dayOfISOWeekYear(isoWeekYear, week, day) {\n const date = new Date(0);\n date.setUTCFullYear(isoWeekYear, 0, 4);\n const fourthOfJanuaryDay = date.getUTCDay() || 7;\n const diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;\n date.setUTCDate(date.getUTCDate() + diff);\n return date;\n}\nfunction isLeapYearIndex2(year) {\n return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;\n}\nfunction validateDate(year, month, date) {\n return month >= 0 && month <= 11 && date >= 1 && date <= (daysInMonths[month] || (isLeapYearIndex2(year) ? 29 : 28));\n}\nfunction validateDayOfYearDate(year, dayOfYear) {\n return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex2(year) ? 366 : 365);\n}\nfunction validateWeekDate(_year, week, day) {\n return week >= 1 && week <= 53 && day >= 0 && day <= 6;\n}\nfunction validateTime(hours, minutes, seconds) {\n if (hours === 24) {\n return minutes === 0 && seconds === 0;\n }\n return seconds >= 0 && seconds < 60 && minutes >= 0 && minutes < 60 && hours >= 0 && hours < 25;\n}\nfunction validateTimezone(_hours, minutes) {\n return minutes >= 0 && minutes <= 59;\n}\nvar patterns = {\n dateTimeDelimiter: /[T ]/,\n timeZoneDelimiter: /[Z ]/i,\n timezone: /([Z+-].*)$/\n};\nvar dateRegex = /^-?(?:(\\d{3})|(\\d{2})(?:-?(\\d{2}))?|W(\\d{2})(?:-?(\\d{1}))?|)$/;\nvar timeRegex = /^(\\d{2}(?:[.,]\\d*)?)(?::?(\\d{2}(?:[.,]\\d*)?))?(?::?(\\d{2}(?:[.,]\\d*)?))?$/;\nvar timezoneRegex = /^([+-])(\\d{2})(?::?(\\d{2}))?$/;\nvar daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n// lib/parseJSON.js\nfunction parseJSON(dateStr, options) {\n const parts = dateStr.match(/(\\d{4})-(\\d{2})-(\\d{2})[T ](\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d{0,7}))?(?:Z|(.)(\\d{2}):?(\\d{2})?)?/);\n if (!parts)\n return toDate(NaN, options?.in);\n return toDate(Date.UTC(+parts[1], +parts[2] - 1, +parts[3], +parts[4] - (+parts[9] || 0) * (parts[8] == \"-\" ? -1 : 1), +parts[5] - (+parts[10] || 0) * (parts[8] == \"-\" ? -1 : 1), +parts[6], +((parts[7] || \"0\") + \"00\").substring(0, 3)), options?.in);\n}\n// lib/previousDay.js\nfunction previousDay(date, day, options) {\n let delta = getDay(date, options) - day;\n if (delta <= 0)\n delta += 7;\n return subDays(date, delta, options);\n}\n// lib/previousFriday.js\nfunction previousFriday(date, options) {\n return previousDay(date, 5, options);\n}\n// lib/previousMonday.js\nfunction previousMonday(date, options) {\n return previousDay(date, 1, options);\n}\n// lib/previousSaturday.js\nfunction previousSaturday(date, options) {\n return previousDay(date, 6, options);\n}\n// lib/previousSunday.js\nfunction previousSunday(date, options) {\n return previousDay(date, 0, options);\n}\n// lib/previousThursday.js\nfunction previousThursday(date, options) {\n return previousDay(date, 4, options);\n}\n// lib/previousTuesday.js\nfunction previousTuesday(date, options) {\n return previousDay(date, 2, options);\n}\n// lib/previousWednesday.js\nfunction previousWednesday(date, options) {\n return previousDay(date, 3, options);\n}\n// lib/quartersToMonths.js\nfunction quartersToMonths(quarters) {\n return Math.trunc(quarters * monthsInQuarter);\n}\n// lib/quartersToYears.js\nfunction quartersToYears(quarters) {\n const years = quarters / quartersInYear;\n return Math.trunc(years);\n}\n// lib/roundToNearestHours.js\nfunction roundToNearestHours(date, options) {\n const nearestTo = options?.nearestTo ?? 1;\n if (nearestTo < 1 || nearestTo > 12)\n return constructFrom(options?.in || date, NaN);\n const date_ = toDate(date, options?.in);\n const fractionalMinutes = date_.getMinutes() / 60;\n const fractionalSeconds = date_.getSeconds() / 60 / 60;\n const fractionalMilliseconds = date_.getMilliseconds() / 1000 / 60 / 60;\n const hours = date_.getHours() + fractionalMinutes + fractionalSeconds + fractionalMilliseconds;\n const method = options?.roundingMethod ?? \"round\";\n const roundingMethod = getRoundingMethod(method);\n const roundedHours = roundingMethod(hours / nearestTo) * nearestTo;\n date_.setHours(roundedHours, 0, 0, 0);\n return date_;\n}\n// lib/roundToNearestMinutes.js\nfunction roundToNearestMinutes(date, options) {\n const nearestTo = options?.nearestTo ?? 1;\n if (nearestTo < 1 || nearestTo > 30)\n return constructFrom(date, NaN);\n const date_ = toDate(date, options?.in);\n const fractionalSeconds = date_.getSeconds() / 60;\n const fractionalMilliseconds = date_.getMilliseconds() / 1000 / 60;\n const minutes = date_.getMinutes() + fractionalSeconds + fractionalMilliseconds;\n const method = options?.roundingMethod ?? \"round\";\n const roundingMethod = getRoundingMethod(method);\n const roundedMinutes = roundingMethod(minutes / nearestTo) * nearestTo;\n date_.setMinutes(roundedMinutes, 0, 0);\n return date_;\n}\n// lib/secondsToHours.js\nfunction secondsToHours(seconds) {\n const hours = seconds / secondsInHour;\n return Math.trunc(hours);\n}\n// lib/secondsToMilliseconds.js\nfunction secondsToMilliseconds(seconds) {\n return seconds * millisecondsInSecond;\n}\n// lib/secondsToMinutes.js\nfunction secondsToMinutes(seconds) {\n const minutes = seconds / secondsInMinute;\n return Math.trunc(minutes);\n}\n// lib/setMonth.js\nfunction setMonth(date, month, options) {\n const _date = toDate(date, options?.in);\n const year = _date.getFullYear();\n const day = _date.getDate();\n const midMonth = constructFrom(options?.in || date, 0);\n midMonth.setFullYear(year, month, 15);\n midMonth.setHours(0, 0, 0, 0);\n const daysInMonth = getDaysInMonth(midMonth);\n _date.setMonth(month, Math.min(day, daysInMonth));\n return _date;\n}\n\n// lib/set.js\nfunction set(date, values, options) {\n let _date = toDate(date, options?.in);\n if (isNaN(+_date))\n return constructFrom(options?.in || date, NaN);\n if (values.year != null)\n _date.setFullYear(values.year);\n if (values.month != null)\n _date = setMonth(_date, values.month);\n if (values.date != null)\n _date.setDate(values.date);\n if (values.hours != null)\n _date.setHours(values.hours);\n if (values.minutes != null)\n _date.setMinutes(values.minutes);\n if (values.seconds != null)\n _date.setSeconds(values.seconds);\n if (values.milliseconds != null)\n _date.setMilliseconds(values.milliseconds);\n return _date;\n}\n// lib/setDate.js\nfunction setDate(date, dayOfMonth, options) {\n const _date = toDate(date, options?.in);\n _date.setDate(dayOfMonth);\n return _date;\n}\n// lib/setDayOfYear.js\nfunction setDayOfYear(date, dayOfYear, options) {\n const date_ = toDate(date, options?.in);\n date_.setMonth(0);\n date_.setDate(dayOfYear);\n return date_;\n}\n// lib/setDefaultOptions.js\nfunction setDefaultOptions2(options) {\n const result = {};\n const defaultOptions16 = getDefaultOptions();\n for (const property in defaultOptions16) {\n if (Object.prototype.hasOwnProperty.call(defaultOptions16, property)) {\n result[property] = defaultOptions16[property];\n }\n }\n for (const property in options) {\n if (Object.prototype.hasOwnProperty.call(options, property)) {\n if (options[property] === undefined) {\n delete result[property];\n } else {\n result[property] = options[property];\n }\n }\n }\n setDefaultOptions(result);\n}\n// lib/setHours.js\nfunction setHours(date, hours, options) {\n const _date = toDate(date, options?.in);\n _date.setHours(hours);\n return _date;\n}\n// lib/setMilliseconds.js\nfunction setMilliseconds(date, milliseconds2, options) {\n const _date = toDate(date, options?.in);\n _date.setMilliseconds(milliseconds2);\n return _date;\n}\n// lib/setMinutes.js\nfunction setMinutes(date, minutes, options) {\n const date_ = toDate(date, options?.in);\n date_.setMinutes(minutes);\n return date_;\n}\n// lib/setQuarter.js\nfunction setQuarter(date, quarter, options) {\n const date_ = toDate(date, options?.in);\n const oldQuarter = Math.trunc(date_.getMonth() / 3) + 1;\n const diff = quarter - oldQuarter;\n return setMonth(date_, date_.getMonth() + diff * 3);\n}\n// lib/setSeconds.js\nfunction setSeconds(date, seconds, options) {\n const _date = toDate(date, options?.in);\n _date.setSeconds(seconds);\n return _date;\n}\n// lib/setWeekYear.js\nfunction setWeekYear(date, weekYear, options) {\n const defaultOptions17 = getDefaultOptions();\n const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions17.firstWeekContainsDate ?? defaultOptions17.locale?.options?.firstWeekContainsDate ?? 1;\n const diff = differenceInCalendarDays(toDate(date, options?.in), startOfWeekYear(date, options), options);\n const firstWeek = constructFrom(options?.in || date, 0);\n firstWeek.setFullYear(weekYear, 0, firstWeekContainsDate);\n firstWeek.setHours(0, 0, 0, 0);\n const date_ = startOfWeekYear(firstWeek, options);\n date_.setDate(date_.getDate() + diff);\n return date_;\n}\n// lib/setYear.js\nfunction setYear(date, year, options) {\n const date_ = toDate(date, options?.in);\n if (isNaN(+date_))\n return constructFrom(options?.in || date, NaN);\n date_.setFullYear(year);\n return date_;\n}\n// lib/startOfDecade.js\nfunction startOfDecade(date, options) {\n const _date = toDate(date, options?.in);\n const year = _date.getFullYear();\n const decade = Math.floor(year / 10) * 10;\n _date.setFullYear(decade, 0, 1);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n// lib/startOfToday.js\nfunction startOfToday(options) {\n return startOfDay(Date.now(), options);\n}\n// lib/startOfTomorrow.js\nfunction startOfTomorrow(options) {\n const now = constructNow(options?.in);\n const year = now.getFullYear();\n const month = now.getMonth();\n const day = now.getDate();\n const date = constructFrom(options?.in, 0);\n date.setFullYear(year, month, day + 1);\n date.setHours(0, 0, 0, 0);\n return date;\n}\n// lib/startOfYesterday.js\nfunction startOfYesterday(options) {\n const now = constructNow(options?.in);\n const year = now.getFullYear();\n const month = now.getMonth();\n const day = now.getDate();\n const date = constructNow(options?.in);\n date.setFullYear(year, month, day - 1);\n date.setHours(0, 0, 0, 0);\n return date;\n}\n// lib/subMonths.js\nfunction subMonths(date, amount, options) {\n return addMonths(date, -amount, options);\n}\n\n// lib/sub.js\nfunction sub(date, duration, options) {\n const {\n years = 0,\n months: months2 = 0,\n weeks = 0,\n days: days2 = 0,\n hours = 0,\n minutes = 0,\n seconds = 0\n } = duration;\n const withoutMonths = subMonths(date, months2 + years * 12, options);\n const withoutDays = subDays(withoutMonths, days2 + weeks * 7, options);\n const minutesToSub = minutes + hours * 60;\n const secondsToSub = seconds + minutesToSub * 60;\n const msToSub = secondsToSub * 1000;\n return constructFrom(options?.in || date, +withoutDays - msToSub);\n}\n// lib/subBusinessDays.js\nfunction subBusinessDays(date, amount, options) {\n return addBusinessDays(date, -amount, options);\n}\n// lib/subHours.js\nfunction subHours(date, amount, options) {\n return addHours(date, -amount, options);\n}\n// lib/subMilliseconds.js\nfunction subMilliseconds(date, amount, options) {\n return addMilliseconds(date, -amount, options);\n}\n// lib/subMinutes.js\nfunction subMinutes(date, amount, options) {\n return addMinutes(date, -amount, options);\n}\n// lib/subQuarters.js\nfunction subQuarters(date, amount, options) {\n return addQuarters(date, -amount, options);\n}\n// lib/subSeconds.js\nfunction subSeconds(date, amount, options) {\n return addSeconds(date, -amount, options);\n}\n// lib/subWeeks.js\nfunction subWeeks(date, amount, options) {\n return addWeeks(date, -amount, options);\n}\n// lib/subYears.js\nfunction subYears(date, amount, options) {\n return addYears(date, -amount, options);\n}\n// lib/weeksToDays.js\nfunction weeksToDays(weeks) {\n return Math.trunc(weeks * daysInWeek);\n}\n// lib/yearsToDays.js\nfunction yearsToDays(years) {\n return Math.trunc(years * daysInYear);\n}\n// lib/yearsToMonths.js\nfunction yearsToMonths(years) {\n return Math.trunc(years * monthsInYear);\n}\n// lib/yearsToQuarters.js\nfunction yearsToQuarters(years) {\n return Math.trunc(years * quartersInYear);\n}\n// lib/cdn.js\nwindow.dateFns = {\n ...window.dateFns,\n ...exports_lib\n};\n\n//# debugId=C576AA8F71413BF164756E2164756E21\n"],"mappings":"goOAAA,IAAIA,SAAS,GAAGC,MAAM,CAACC,cAAc;AACrC,IAAIC,QAAQ,GAAG,SAAXA,QAAQA,CAAIC,MAAM,EAAEC,GAAG,EAAK;EAC9B,KAAK,IAAIC,IAAI,IAAID,GAAG;EAClBL,SAAS,CAACI,MAAM,EAAEE,IAAI,EAAE;IACtBC,GAAG,EAAEF,GAAG,CAACC,IAAI,CAAC;IACdE,UAAU,EAAE,IAAI;IAChBC,YAAY,EAAE,IAAI;IAClBC,GAAG,EAAE,SAAAA,IAACC,QAAQ,UAAKN,GAAG,CAACC,IAAI,CAAC,GAAG,oBAAMK,QAAQ;EAC/C,CAAC,CAAC;AACN,CAAC;;AAED;AACA,IAAIC,WAAW,GAAG,CAAC,CAAC;AACpBT,QAAQ,CAACS,WAAW,EAAE;EACpBC,eAAe,EAAE,SAAAA,gBAAA,UAAMA,gBAAe;EACtCC,aAAa,EAAE,SAAAA,cAAA,UAAMA,cAAa;EAClCC,WAAW,EAAE,SAAAA,YAAA,UAAMA,YAAW;EAC9BC,WAAW,EAAE,SAAAA,YAAA,UAAMA,YAAW;EAC9BC,SAAS,EAAE,SAAAA,UAAA,UAAMA,UAAS;EAC1BC,MAAM,EAAE,SAAAA,OAAA,UAAMA,OAAM;EACpBC,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AK,EAAE;EAC5B,OAAO7C,IAAI,CAACmE,KAAK,CAACtB,KAAK,GAAGhC,YAAY,CAAC;AACzC;AACA;AACA,SAAS7Q,gBAAeA,CAAC6S,KAAK,EAAE;EAC9B,OAAO7C,IAAI,CAACmE,KAAK,CAACtB,KAAK,GAAG/B,cAAc,CAAC;AAC3C;AACA;AACA2gC,MAAM,CAACC,OAAO,GAAAx8B,aAAA,CAAAA,aAAA;AACTu8B,MAAM,CAACC,OAAO;AACd3xC,WAAW,CACf;;;AAED","ignoreList":[]}
\ No newline at end of file
diff --git a/node_modules/date-fns/cdn.min.js b/node_modules/date-fns/cdn.min.js
new file mode 100644
index 00000000..d8ca15dd
--- /dev/null
+++ b/node_modules/date-fns/cdn.min.js
@@ -0,0 +1,3 @@
+(()=>{function SX(K,G){var X=typeof Symbol!=="undefined"&&K[Symbol.iterator]||K["@@iterator"];if(!X){if(Array.isArray(K)||(X=DG(K))||G&&K&&typeof K.length==="number"){if(X)K=X;var B=0,U=function q(){};return{s:U,n:function q(){if(B>=K.length)return{done:!0};return{done:!1,value:K[B++]}},e:function q(Q){throw Q},f:U}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var Z=!0,j=!1,J;return{s:function q(){X=X.call(K)},n:function q(){var Q=X.next();return Z=Q.done,Q},e:function q(Q){j=!0,J=Q},f:function q(){try{if(!Z&&X.return!=null)X.return()}finally{if(j)throw J}}}}function W(K,G,X){return G=OG(G),JK(K,hX()?Reflect.construct(G,X||[],OG(K).constructor):G.apply(K,X))}function JK(K,G){if(G&&(n(G)==="object"||typeof G==="function"))return G;else if(G!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return R(K)}function R(K){if(K===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return K}function hX(){try{var K=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(G){}return(hX=function G(){return!!K})()}function OG(K){return OG=Object.setPrototypeOf?Object.getPrototypeOf.bind():function G(X){return X.__proto__||Object.getPrototypeOf(X)},OG(K)}function z(K,G){if(typeof G!=="function"&&G!==null)throw new TypeError("Super expression must either be null or a function");if(K.prototype=Object.create(G&&G.prototype,{constructor:{value:K,writable:!0,configurable:!0}}),Object.defineProperty(K,"prototype",{writable:!1}),G)BX(K,G)}function BX(K,G){return BX=Object.setPrototypeOf?Object.setPrototypeOf.bind():function X(B,U){return B.__proto__=U,B},BX(K,G)}function Y(K,G){if(!(K instanceof G))throw new TypeError("Cannot call a class as a function")}function yX(K,G){for(var X=0;XK.length)G=K.length;for(var X=0,B=new Array(G);X=j)return Z;else return B.setFullYear(Z.getFullYear(),Z.getMonth(),U),B}function LG(K,G,X){var B=G.years,U=B===void 0?0:B,Z=G.months,j=Z===void 0?0:Z,J=G.weeks,q=J===void 0?0:J,Q=G.days,H=Q===void 0?0:Q,V=G.hours,x=V===void 0?0:V,C=G.minutes,w=C===void 0?0:C,M=G.seconds,A=M===void 0?0:M,T=N(K,X===null||X===void 0?void 0:X.in),b=j||U?TG(T,j+U*12):T,v=H||q?o(b,H+q*7):b,D=w+x*60,l=A+D*60,d=l*1000;return L((X===null||X===void 0?void 0:X.in)||K,+v+d)}function eX(K,G){return N(K,G===null||G===void 0?void 0:G.in).getDay()===6}function tX(K,G){return N(K,G===null||G===void 0?void 0:G.in).getDay()===0}function FG(K,G){var X=N(K,G===null||G===void 0?void 0:G.in).getDay();return X===0||X===6}function G0(K,G,X){var B=N(K,X===null||X===void 0?void 0:X.in),U=FG(B,X);if(isNaN(G))return L(X===null||X===void 0?void 0:X.in,NaN);var Z=B.getHours(),j=G<0?-1:1,J=Math.trunc(G/5);B.setDate(B.getDate()+J*7);var q=Math.abs(G%5);while(q>0)if(B.setDate(B.getDate()+j),!FG(B,X))q-=1;if(U&&FG(B,X)&&G!==0){if(eX(B,X))B.setDate(B.getDate()+(j<0?2:-1));if(tX(B,X))B.setDate(B.getDate()+(j<0?1:-2))}return B.setHours(Z),B}function kG(K,G,X){return L((X===null||X===void 0?void 0:X.in)||K,+N(K)+G)}function X0(K,G,X){return kG(K,G*xG,X)}function p(){return K0}function FK(K){K0=K}var K0={};function _(K,G){var X,B,U,Z,j,J,q=p(),Q=(X=(B=(U=(Z=G===null||G===void 0?void 0:G.weekStartsOn)!==null&&Z!==void 0?Z:G===null||G===void 0||(j=G.locale)===null||j===void 0||(j=j.options)===null||j===void 0?void 0:j.weekStartsOn)!==null&&U!==void 0?U:q.weekStartsOn)!==null&&B!==void 0?B:(J=q.locale)===null||J===void 0||(J=J.options)===null||J===void 0?void 0:J.weekStartsOn)!==null&&X!==void 0?X:0,H=N(K,G===null||G===void 0?void 0:G.in),V=H.getDay(),x=(V=Z.getTime())return B+1;else if(X.getTime()>=J.getTime())return B;else return B-1}function r(K){var G=N(K),X=new Date(Date.UTC(G.getFullYear(),G.getMonth(),G.getDate(),G.getHours(),G.getMinutes(),G.getSeconds(),G.getMilliseconds()));return X.setUTCFullYear(G.getFullYear()),+K-+X}function O(K){for(var G=arguments.length,X=new Array(G>1?G-1:0),B=1;BZ||isNaN(+Z))X=Z}),L(B,X||NaN)}function CK(K,G,X){var B=O(X===null||X===void 0?void 0:X.in,K,G.start,G.end),U=$(B,3),Z=U[0],j=U[1],J=U[2];return q0([J0([Z,j],X),J],X)}function Q0(K,G){var X=+N(K);if(isNaN(X))return NaN;var B,U;return G.forEach(function(Z,j){var J=N(Z);if(isNaN(+J)){B=NaN,U=NaN;return}var q=Math.abs(X-+J);if(B==null||q0)return 1;return X}function bK(K,G){var X=+N(K)-+N(G);if(X>0)return-1;else if(X<0)return 1;return X}function f(K){return L(K,Date.now())}function YK(K){var G=Math.trunc(K/_X);return G===0?0:G}function WG(K,G,X){var B=O(X===null||X===void 0?void 0:X.in,K,G),U=$(B,2),Z=U[0],j=U[1];return+wG(Z)===+wG(j)}function H0(K){return K instanceof Date||n(K)==="object"&&Object.prototype.toString.call(K)==="[object Date]"}function UG(K){return!(!H0(K)&&typeof K!=="number"||isNaN(+N(K)))}function IK(K,G,X){var B=O(X===null||X===void 0?void 0:X.in,K,G),U=$(B,2),Z=U[0],j=U[1];if(!UG(Z)||!UG(j))return NaN;var J=e(Z,j),q=J<0?-1:1,Q=Math.trunc(J/7),H=Q*5,V=o(j,Q*7);while(!WG(Z,V))H+=FG(V,X)?0:q,V=o(V,q);return H===0?0:H}function N0(K,G,X){var B=O(X===null||X===void 0?void 0:X.in,K,G),U=$(B,2),Z=U[0],j=U[1];return qG(Z,X)-qG(j,X)}function TK(K,G,X){var B=O(X===null||X===void 0?void 0:X.in,K,G),U=$(B,2),Z=U[0],j=U[1],J=a(Z),q=a(j),Q=+J-r(J),H=+q-r(q);return Math.round((Q-H)/IG)}function fG(K,G,X){var B=O(X===null||X===void 0?void 0:X.in,K,G),U=$(B,2),Z=U[0],j=U[1],J=Z.getFullYear()-j.getFullYear(),q=Z.getMonth()-j.getMonth();return J*12+q}function NX(K,G){var X=N(K,G===null||G===void 0?void 0:G.in),B=Math.trunc(X.getMonth()/3)+1;return B}function mG(K,G,X){var B=O(X===null||X===void 0?void 0:X.in,K,G),U=$(B,2),Z=U[0],j=U[1],J=Z.getFullYear()-j.getFullYear(),q=NX(Z)-NX(j);return J*4+q}function cG(K,G,X){var B=O(X===null||X===void 0?void 0:X.in,K,G),U=$(B,2),Z=U[0],j=U[1],J=_(Z,X),q=_(j,X),Q=+J-r(J),H=+q-r(q);return Math.round((Q-H)/IG)}function zG(K,G,X){var B=O(X===null||X===void 0?void 0:X.in,K,G),U=$(B,2),Z=U[0],j=U[1];return Z.getFullYear()-j.getFullYear()}function VX(K,G,X){var B=O(X===null||X===void 0?void 0:X.in,K,G),U=$(B,2),Z=U[0],j=U[1],J=V0(Z,j),q=Math.abs(e(Z,j));Z.setDate(Z.getDate()-J*q);var Q=Number(V0(Z,j)===-J),H=J*(q-Q);return H===0?0:H}function V0(K,G){var X=K.getFullYear()-G.getFullYear()||K.getMonth()-G.getMonth()||K.getDate()-G.getDate()||K.getHours()-G.getHours()||K.getMinutes()-G.getMinutes()||K.getSeconds()-G.getSeconds()||K.getMilliseconds()-G.getMilliseconds();if(X<0)return-1;if(X>0)return 1;return X}function HG(K){return function(G){var X=K?Math[K]:Math.trunc,B=X(G);return B===0?0:B}}function uG(K,G,X){var B=O(X===null||X===void 0?void 0:X.in,K,G),U=$(B,2),Z=U[0],j=U[1],J=(+Z-+j)/xG;return HG(X===null||X===void 0?void 0:X.roundingMethod)(J)}function x0(K,G,X){return U0(K,-G,X)}function WK(K,G,X){var B=O(X===null||X===void 0?void 0:X.in,K,G),U=$(B,2),Z=U[0],j=U[1],J=t(Z,j),q=Math.abs(N0(Z,j,X)),Q=x0(Z,J*q,X),H=Number(t(Q,j)===-J),V=J*(q-H);return V===0?0:V}function xX(K,G){return+N(K)-+N(G)}function _G(K,G,X){var B=xX(K,G)/BG;return HG(X===null||X===void 0?void 0:X.roundingMethod)(B)}function EX(K,G){var X=N(K,G===null||G===void 0?void 0:G.in);return X.setHours(23,59,59,999),X}function RX(K,G){var X=N(K,G===null||G===void 0?void 0:G.in),B=X.getMonth();return X.setFullYear(X.getFullYear(),B+1,0),X.setHours(23,59,59,999),X}function E0(K,G){var X=N(K,G===null||G===void 0?void 0:G.in);return+EX(X,G)===+RX(X,G)}function lG(K,G,X){var B=O(X===null||X===void 0?void 0:X.in,K,K,G),U=$(B,3),Z=U[0],j=U[1],J=U[2],q=t(j,J),Q=Math.abs(fG(j,J));if(Q<1)return 0;if(j.getMonth()===1&&j.getDate()>27)j.setDate(30);j.setMonth(j.getMonth()-q*Q);var H=t(j,J)===-q;if(E0(Z)&&Q===1&&t(Z,J)===1)H=!1;var V=q*(Q-+H);return V===0?0:V}function zK(K,G,X){var B=lG(K,G,X)/3;return HG(X===null||X===void 0?void 0:X.roundingMethod)(B)}function CG(K,G,X){var B=xX(K,G)/1000;return HG(X===null||X===void 0?void 0:X.roundingMethod)(B)}function $K(K,G,X){var B=VX(K,G,X)/7;return HG(X===null||X===void 0?void 0:X.roundingMethod)(B)}function R0(K,G,X){var B=O(X===null||X===void 0?void 0:X.in,K,G),U=$(B,2),Z=U[0],j=U[1],J=t(Z,j),q=Math.abs(zG(Z,j));Z.setFullYear(1584),j.setFullYear(1584);var Q=t(Z,j)===-J,H=J*(q-+Q);return H===0?0:H}function ZG(K,G){var X=O(K,G.start,G.end),B=$(X,2),U=B[0],Z=B[1];return{start:U,end:Z}}function A0(K,G){var X,B=ZG(G===null||G===void 0?void 0:G.in,K),U=B.start,Z=B.end,j=+U>+Z,J=j?+U:+Z,q=j?Z:U;q.setHours(0,0,0,0);var Q=(X=G===null||G===void 0?void 0:G.step)!==null&&X!==void 0?X:1;if(!Q)return[];if(Q<0)Q=-Q,j=!j;var H=[];while(+q<=J)H.push(L(U,q)),q.setDate(q.getDate()+Q),q.setHours(0,0,0,0);return j?H.reverse():H}function PK(K,G){var X,B=ZG(G===null||G===void 0?void 0:G.in,K),U=B.start,Z=B.end,j=+U>+Z,J=j?+U:+Z,q=j?Z:U;q.setMinutes(0,0,0);var Q=(X=G===null||G===void 0?void 0:G.step)!==null&&X!==void 0?X:1;if(!Q)return[];if(Q<0)Q=-Q,j=!j;var H=[];while(+q<=J)H.push(L(U,q)),q.setHours(q.getHours()+Q);return j?H.reverse():H}function vK(K,G){var X,B=ZG(G===null||G===void 0?void 0:G.in,K),U=B.start,Z=B.end;U.setSeconds(0,0);var j=+U>+Z,J=j?+U:+Z,q=j?Z:U,Q=(X=G===null||G===void 0?void 0:G.step)!==null&&X!==void 0?X:1;if(!Q)return[];if(Q<0)Q=-Q,j=!j;var H=[];while(+q<=J)H.push(L(U,q)),q=QX(q,Q);return j?H.reverse():H}function OK(K,G){var X,B=ZG(G===null||G===void 0?void 0:G.in,K),U=B.start,Z=B.end,j=+U>+Z,J=j?+U:+Z,q=j?Z:U;q.setHours(0,0,0,0),q.setDate(1);var Q=(X=G===null||G===void 0?void 0:G.step)!==null&&X!==void 0?X:1;if(!Q)return[];if(Q<0)Q=-Q,j=!j;var H=[];while(+q<=J)H.push(L(U,q)),q.setMonth(q.getMonth()+Q);return j?H.reverse():H}function EG(K,G){var X=N(K,G===null||G===void 0?void 0:G.in),B=X.getMonth(),U=B-B%3;return X.setMonth(U,1),X.setHours(0,0,0,0),X}function DK(K,G){var X,B=ZG(G===null||G===void 0?void 0:G.in,K),U=B.start,Z=B.end,j=+U>+Z,J=j?+EG(U):+EG(Z),q=j?EG(Z):EG(U),Q=(X=G===null||G===void 0?void 0:G.step)!==null&&X!==void 0?X:1;if(!Q)return[];if(Q<0)Q=-Q,j=!j;var H=[];while(+q<=J)H.push(L(U,q)),q=HX(q,Q);return j?H.reverse():H}function SK(K,G){var X,B=ZG(G===null||G===void 0?void 0:G.in,K),U=B.start,Z=B.end,j=+U>+Z,J=j?_(Z,G):_(U,G),q=j?_(U,G):_(Z,G);J.setHours(15),q.setHours(15);var Q=+q.getTime(),H=J,V=(X=G===null||G===void 0?void 0:G.step)!==null&&X!==void 0?X:1;if(!V)return[];if(V<0)V=-V,j=!j;var x=[];while(+H<=Q)H.setHours(0),x.push(L(U,H)),H=gG(H,V),H.setHours(15);return j?x.reverse():x}function AX(K,G){var X=ZG(G===null||G===void 0?void 0:G.in,K),B=X.start,U=X.end,Z=A0({start:B,end:U},G),j=[],J=0;while(J+Z,J=j?+U:+Z,q=j?Z:U;q.setHours(0,0,0,0),q.setMonth(0,1);var Q=(X=G===null||G===void 0?void 0:G.step)!==null&&X!==void 0?X:1;if(!Q)return[];if(Q<0)Q=-Q,j=!j;var H=[];while(+q<=J)H.push(L(U,q)),q.setFullYear(q.getFullYear()+Q);return j?H.reverse():H}function gK(K,G){var X=N(K,G===null||G===void 0?void 0:G.in),B=X.getFullYear(),U=9+Math.floor(B/10)*10;return X.setFullYear(U,11,31),X.setHours(23,59,59,999),X}function fK(K,G){var X=N(K,G===null||G===void 0?void 0:G.in);return X.setMinutes(59,59,999),X}function F0(K,G){var X,B,U,Z,j,J,q=p(),Q=(X=(B=(U=(Z=G===null||G===void 0?void 0:G.weekStartsOn)!==null&&Z!==void 0?Z:G===null||G===void 0||(j=G.locale)===null||j===void 0||(j=j.options)===null||j===void 0?void 0:j.weekStartsOn)!==null&&U!==void 0?U:q.weekStartsOn)!==null&&B!==void 0?B:(J=q.locale)===null||J===void 0||(J=J.options)===null||J===void 0?void 0:J.weekStartsOn)!==null&&X!==void 0?X:0,H=N(K,G===null||G===void 0?void 0:G.in),V=H.getDay(),x=(V0)return"in "+U;else return U+" ago";return U};function FX(K){return function(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},X=G.width?String(G.width):K.defaultWidth,B=K.formats[X]||K.formats[K.defaultWidth];return B}}var nK={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},aK={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},oK={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},eK={date:FX({formats:nK,defaultWidth:"full"}),time:FX({formats:aK,defaultWidth:"full"}),dateTime:FX({formats:oK,defaultWidth:"full"})},tK={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},GB=function K(G,X,B,U){return tK[G]};function $G(K){return function(G,X){var B=X!==null&&X!==void 0&&X.context?String(X.context):"standalone",U;if(B==="formatting"&&K.formattingValues){var Z=K.defaultFormattingWidth||K.defaultWidth,j=X!==null&&X!==void 0&&X.width?String(X.width):Z;U=K.formattingValues[j]||K.formattingValues[Z]}else{var J=K.defaultWidth,q=X!==null&&X!==void 0&&X.width?String(X.width):K.defaultWidth;U=K.values[q]||K.values[J]}var Q=K.argumentCallback?K.argumentCallback(G):G;return U[Q]}}var XB={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},KB={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},BB={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},UB={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},ZB={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},jB={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},JB=function K(G,X){var B=Number(G),U=B%100;if(U>20||U<10)switch(U%10){case 1:return B+"st";case 2:return B+"nd";case 3:return B+"rd"}return B+"th"},qB={ordinalNumber:JB,era:$G({values:XB,defaultWidth:"wide"}),quarter:$G({values:KB,defaultWidth:"wide",argumentCallback:function K(G){return G-1}}),month:$G({values:BB,defaultWidth:"wide"}),day:$G({values:UB,defaultWidth:"wide"}),dayPeriod:$G({values:ZB,defaultWidth:"wide",formattingValues:jB,defaultFormattingWidth:"wide"})};function PG(K){return function(G){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},B=X.width,U=B&&K.matchPatterns[B]||K.matchPatterns[K.defaultMatchWidth],Z=G.match(U);if(!Z)return null;var j=Z[0],J=B&&K.parsePatterns[B]||K.parsePatterns[K.defaultParseWidth],q=Array.isArray(J)?HB(J,function(V){return V.test(j)}):QB(J,function(V){return V.test(j)}),Q;Q=K.valueCallback?K.valueCallback(q):q,Q=X.valueCallback?X.valueCallback(Q):Q;var H=G.slice(j.length);return{value:Q,rest:H}}}function QB(K,G){for(var X in K)if(Object.prototype.hasOwnProperty.call(K,X)&&G(K[X]))return X;return}function HB(K,G){for(var X=0;X