@firebase/firestore 3.1.1 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/firestore/src/register.d.ts +1 -1
  3. package/dist/firestore/src/remote/persistent_stream.d.ts +5 -1
  4. package/dist/firestore/src/util/async_queue.d.ts +4 -2
  5. package/dist/index.esm2017.js +1055 -1047
  6. package/dist/index.esm2017.js.map +1 -1
  7. package/dist/index.esm5.js +1483 -1474
  8. package/dist/index.esm5.js.map +1 -1
  9. package/dist/index.node.cjs.js +7049 -9102
  10. package/dist/index.node.cjs.js.map +1 -1
  11. package/dist/{index.node.cjs.esm2017.js → index.node.mjs} +51 -20
  12. package/dist/index.node.mjs.map +1 -0
  13. package/dist/index.rn.js +534 -526
  14. package/dist/index.rn.js.map +1 -1
  15. package/dist/internal.d.ts +4 -2
  16. package/dist/lite/firestore/src/register.d.ts +1 -1
  17. package/dist/lite/firestore/src/remote/persistent_stream.d.ts +5 -1
  18. package/dist/lite/firestore/src/util/async_queue.d.ts +4 -2
  19. package/dist/lite/index.browser.esm2017.js +2 -2
  20. package/dist/lite/index.browser.esm2017.js.map +1 -1
  21. package/dist/lite/index.browser.esm5.js +2 -2
  22. package/dist/lite/index.browser.esm5.js.map +1 -1
  23. package/dist/lite/index.node.cjs.js +1804 -2261
  24. package/dist/lite/index.node.cjs.js.map +1 -1
  25. package/dist/lite/{index.node.esm2017.js → index.node.mjs} +3 -3
  26. package/dist/lite/index.node.mjs.map +1 -0
  27. package/dist/lite/index.rn.esm2017.js +2 -2
  28. package/dist/lite/index.rn.esm2017.js.map +1 -1
  29. package/dist/lite/internal.d.ts +4 -2
  30. package/dist/lite/packages/firestore/src/register.d.ts +1 -1
  31. package/dist/lite/packages/firestore/src/remote/persistent_stream.d.ts +5 -1
  32. package/dist/lite/packages/firestore/src/util/async_queue.d.ts +4 -2
  33. package/dist/lite/private.d.ts +4 -2
  34. package/dist/packages/firestore/dist/index.esm2017.d.ts +102 -102
  35. package/dist/packages/firestore/src/register.d.ts +1 -1
  36. package/dist/packages/firestore/src/remote/persistent_stream.d.ts +5 -1
  37. package/dist/packages/firestore/src/util/async_queue.d.ts +4 -2
  38. package/dist/private.d.ts +4 -2
  39. package/lite/package.json +1 -1
  40. package/package.json +15 -9
  41. package/dist/index.node.cjs.esm2017.js.map +0 -1
  42. package/dist/lite/firestore/dist/lite/index.node.esm2017.d.ts +0 -1195
  43. package/dist/lite/index.node.esm2017.js.map +0 -1
  44. package/dist/packages/firestore/dist/index.node.cjs.esm2017.d.ts +0 -1844
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.node.mjs","sources":["index.node.mjs"],"sourcesContent":["import { _getProvider, getApp, _removeServiceInstance, _registerComponent, registerVersion, SDK_VERSION as SDK_VERSION$1 } from '@firebase/app';\nimport { Component } from '@firebase/component';\nimport { Logger, LogLevel } from '@firebase/logger';\nimport { inspect, TextEncoder, TextDecoder } from 'util';\nimport { getUA, isIndexedDBAvailable, isSafari, createMockUserToken, getModularInstance, deepEqual } from '@firebase/util';\nimport { randomBytes as randomBytes$1 } from 'crypto';\nimport module from 'module';\nimport { credentials, Metadata, loadPackageDefinition } from '@grpc/grpc-js';\nimport { resolve, join } from 'path';\nimport { loadSync } from '@grpc/proto-loader';\n\nconst name = \"@firebase/firestore\";\nconst version$1 = \"3.2.0\";\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Simple wrapper around a nullable UID. Mostly exists to make code more\r\n * readable.\r\n */\r\nclass User {\r\n constructor(uid) {\r\n this.uid = uid;\r\n }\r\n isAuthenticated() {\r\n return this.uid != null;\r\n }\r\n /**\r\n * Returns a key representing this user, suitable for inclusion in a\r\n * dictionary.\r\n */\r\n toKey() {\r\n if (this.isAuthenticated()) {\r\n return 'uid:' + this.uid;\r\n }\r\n else {\r\n return 'anonymous-user';\r\n }\r\n }\r\n isEqual(otherUser) {\r\n return otherUser.uid === this.uid;\r\n }\r\n}\r\n/** A user with a null UID. */\r\nUser.UNAUTHENTICATED = new User(null);\r\n// TODO(mikelehen): Look into getting a proper uid-equivalent for\r\n// non-FirebaseAuth providers.\r\nUser.GOOGLE_CREDENTIALS = new User('google-credentials-uid');\r\nUser.FIRST_PARTY = new User('first-party-uid');\r\nUser.MOCK_USER = new User('mock-user');\n\nconst version = \"9.2.0\";\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nlet SDK_VERSION = version;\r\nfunction setSDKVersion(version) {\r\n SDK_VERSION = version;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/** Formats an object as a JSON string, suitable for logging. */\r\nfunction formatJSON(value) {\r\n // util.inspect() results in much more readable output than JSON.stringify()\r\n return inspect(value, { depth: 100 });\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst logClient = new Logger('@firebase/firestore');\r\n// Helper methods are needed because variables can't be exported as read/write\r\nfunction getLogLevel() {\r\n return logClient.logLevel;\r\n}\r\n/**\r\n * Sets the verbosity of Cloud Firestore logs (debug, error, or silent).\r\n *\r\n * @param logLevel - The verbosity you set for activity and error logging. Can\r\n * be any of the following values:\r\n *\r\n * <ul>\r\n * <li>`debug` for the most verbose logging level, primarily for\r\n * debugging.</li>\r\n * <li>`error` to log errors only.</li>\r\n * <li><code>`silent` to turn off logging.</li>\r\n * </ul>\r\n */\r\nfunction setLogLevel(logLevel) {\r\n logClient.setLogLevel(logLevel);\r\n}\r\nfunction logDebug(msg, ...obj) {\r\n if (logClient.logLevel <= LogLevel.DEBUG) {\r\n const args = obj.map(argToString);\r\n logClient.debug(`Firestore (${SDK_VERSION}): ${msg}`, ...args);\r\n }\r\n}\r\nfunction logError(msg, ...obj) {\r\n if (logClient.logLevel <= LogLevel.ERROR) {\r\n const args = obj.map(argToString);\r\n logClient.error(`Firestore (${SDK_VERSION}): ${msg}`, ...args);\r\n }\r\n}\r\n/**\r\n * @internal\r\n */\r\nfunction logWarn(msg, ...obj) {\r\n if (logClient.logLevel <= LogLevel.WARN) {\r\n const args = obj.map(argToString);\r\n logClient.warn(`Firestore (${SDK_VERSION}): ${msg}`, ...args);\r\n }\r\n}\r\n/**\r\n * Converts an additional log parameter to a string representation.\r\n */\r\nfunction argToString(obj) {\r\n if (typeof obj === 'string') {\r\n return obj;\r\n }\r\n else {\r\n try {\r\n return formatJSON(obj);\r\n }\r\n catch (e) {\r\n // Converting to JSON failed, just log the object directly\r\n return obj;\r\n }\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Unconditionally fails, throwing an Error with the given message.\r\n * Messages are stripped in production builds.\r\n *\r\n * Returns `never` and can be used in expressions:\r\n * @example\r\n * let futureVar = fail('not implemented yet');\r\n */\r\nfunction fail(failure = 'Unexpected state') {\r\n // Log the failure in addition to throw an exception, just in case the\r\n // exception is swallowed.\r\n const message = `FIRESTORE (${SDK_VERSION}) INTERNAL ASSERTION FAILED: ` + failure;\r\n logError(message);\r\n // NOTE: We don't use FirestoreError here because these are internal failures\r\n // that cannot be handled by the user. (Also it would create a circular\r\n // dependency between the error and assert modules which doesn't work.)\r\n throw new Error(message);\r\n}\r\n/**\r\n * Fails if the given assertion condition is false, throwing an Error with the\r\n * given message if it did.\r\n *\r\n * Messages are stripped in production builds.\r\n */\r\nfunction hardAssert(assertion, message) {\r\n if (!assertion) {\r\n fail();\r\n }\r\n}\r\n/**\r\n * Fails if the given assertion condition is false, throwing an Error with the\r\n * given message if it did.\r\n *\r\n * The code of callsites invoking this function are stripped out in production\r\n * builds. Any side-effects of code within the debugAssert() invocation will not\r\n * happen in this case.\r\n *\r\n * @internal\r\n */\r\nfunction debugAssert(assertion, message) {\r\n if (!assertion) {\r\n fail();\r\n }\r\n}\r\n/**\r\n * Casts `obj` to `T`. In non-production builds, verifies that `obj` is an\r\n * instance of `T` before casting.\r\n */\r\nfunction debugCast(obj, \r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nconstructor) {\r\n return obj;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst Code = {\r\n // Causes are copied from:\r\n // https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h\r\n /** Not an error; returned on success. */\r\n OK: 'ok',\r\n /** The operation was cancelled (typically by the caller). */\r\n CANCELLED: 'cancelled',\r\n /** Unknown error or an error from a different error domain. */\r\n UNKNOWN: 'unknown',\r\n /**\r\n * Client specified an invalid argument. Note that this differs from\r\n * FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments that are\r\n * problematic regardless of the state of the system (e.g., a malformed file\r\n * name).\r\n */\r\n INVALID_ARGUMENT: 'invalid-argument',\r\n /**\r\n * Deadline expired before operation could complete. For operations that\r\n * change the state of the system, this error may be returned even if the\r\n * operation has completed successfully. For example, a successful response\r\n * from a server could have been delayed long enough for the deadline to\r\n * expire.\r\n */\r\n DEADLINE_EXCEEDED: 'deadline-exceeded',\r\n /** Some requested entity (e.g., file or directory) was not found. */\r\n NOT_FOUND: 'not-found',\r\n /**\r\n * Some entity that we attempted to create (e.g., file or directory) already\r\n * exists.\r\n */\r\n ALREADY_EXISTS: 'already-exists',\r\n /**\r\n * The caller does not have permission to execute the specified operation.\r\n * PERMISSION_DENIED must not be used for rejections caused by exhausting\r\n * some resource (use RESOURCE_EXHAUSTED instead for those errors).\r\n * PERMISSION_DENIED must not be used if the caller can not be identified\r\n * (use UNAUTHENTICATED instead for those errors).\r\n */\r\n PERMISSION_DENIED: 'permission-denied',\r\n /**\r\n * The request does not have valid authentication credentials for the\r\n * operation.\r\n */\r\n UNAUTHENTICATED: 'unauthenticated',\r\n /**\r\n * Some resource has been exhausted, perhaps a per-user quota, or perhaps the\r\n * entire file system is out of space.\r\n */\r\n RESOURCE_EXHAUSTED: 'resource-exhausted',\r\n /**\r\n * Operation was rejected because the system is not in a state required for\r\n * the operation's execution. For example, directory to be deleted may be\r\n * non-empty, an rmdir operation is applied to a non-directory, etc.\r\n *\r\n * A litmus test that may help a service implementor in deciding\r\n * between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE:\r\n * (a) Use UNAVAILABLE if the client can retry just the failing call.\r\n * (b) Use ABORTED if the client should retry at a higher-level\r\n * (e.g., restarting a read-modify-write sequence).\r\n * (c) Use FAILED_PRECONDITION if the client should not retry until\r\n * the system state has been explicitly fixed. E.g., if an \"rmdir\"\r\n * fails because the directory is non-empty, FAILED_PRECONDITION\r\n * should be returned since the client should not retry unless\r\n * they have first fixed up the directory by deleting files from it.\r\n * (d) Use FAILED_PRECONDITION if the client performs conditional\r\n * REST Get/Update/Delete on a resource and the resource on the\r\n * server does not match the condition. E.g., conflicting\r\n * read-modify-write on the same resource.\r\n */\r\n FAILED_PRECONDITION: 'failed-precondition',\r\n /**\r\n * The operation was aborted, typically due to a concurrency issue like\r\n * sequencer check failures, transaction aborts, etc.\r\n *\r\n * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,\r\n * and UNAVAILABLE.\r\n */\r\n ABORTED: 'aborted',\r\n /**\r\n * Operation was attempted past the valid range. E.g., seeking or reading\r\n * past end of file.\r\n *\r\n * Unlike INVALID_ARGUMENT, this error indicates a problem that may be fixed\r\n * if the system state changes. For example, a 32-bit file system will\r\n * generate INVALID_ARGUMENT if asked to read at an offset that is not in the\r\n * range [0,2^32-1], but it will generate OUT_OF_RANGE if asked to read from\r\n * an offset past the current file size.\r\n *\r\n * There is a fair bit of overlap between FAILED_PRECONDITION and\r\n * OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific error)\r\n * when it applies so that callers who are iterating through a space can\r\n * easily look for an OUT_OF_RANGE error to detect when they are done.\r\n */\r\n OUT_OF_RANGE: 'out-of-range',\r\n /** Operation is not implemented or not supported/enabled in this service. */\r\n UNIMPLEMENTED: 'unimplemented',\r\n /**\r\n * Internal errors. Means some invariants expected by underlying System has\r\n * been broken. If you see one of these errors, Something is very broken.\r\n */\r\n INTERNAL: 'internal',\r\n /**\r\n * The service is currently unavailable. This is a most likely a transient\r\n * condition and may be corrected by retrying with a backoff.\r\n *\r\n * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,\r\n * and UNAVAILABLE.\r\n */\r\n UNAVAILABLE: 'unavailable',\r\n /** Unrecoverable data loss or corruption. */\r\n DATA_LOSS: 'data-loss'\r\n};\r\n/** An error returned by a Firestore operation. */\r\nclass FirestoreError extends Error {\r\n /** @hideconstructor */\r\n constructor(\r\n /**\r\n * The backend error code associated with this error.\r\n */\r\n code, \r\n /**\r\n * A custom error description.\r\n */\r\n message) {\r\n super(message);\r\n this.code = code;\r\n this.message = message;\r\n /** The custom name for all FirestoreErrors. */\r\n this.name = 'FirebaseError';\r\n // HACK: We write a toString property directly because Error is not a real\r\n // class and so inheritance does not work correctly. We could alternatively\r\n // do the same \"back-door inheritance\" trick that FirebaseError does.\r\n this.toString = () => `${this.name}: [code=${this.code}]: ${this.message}`;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nclass Deferred {\r\n constructor() {\r\n this.promise = new Promise((resolve, reject) => {\r\n this.resolve = resolve;\r\n this.reject = reject;\r\n });\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nclass OAuthToken {\r\n constructor(value, user) {\r\n this.user = user;\r\n this.type = 'OAuth';\r\n this.authHeaders = {};\r\n // Set the headers using Object Literal notation to avoid minification\r\n this.authHeaders['Authorization'] = `Bearer ${value}`;\r\n }\r\n}\r\n/**\r\n * A CredentialsProvider that always yields an empty token.\r\n * @internal\r\n */\r\nclass EmptyCredentialsProvider {\r\n getToken() {\r\n return Promise.resolve(null);\r\n }\r\n invalidateToken() { }\r\n start(asyncQueue, changeListener) {\r\n // Fire with initial user.\r\n asyncQueue.enqueueRetryable(() => changeListener(User.UNAUTHENTICATED));\r\n }\r\n shutdown() { }\r\n}\r\n/**\r\n * A CredentialsProvider that always returns a constant token. Used for\r\n * emulator token mocking.\r\n */\r\nclass EmulatorCredentialsProvider {\r\n constructor(token) {\r\n this.token = token;\r\n /**\r\n * Stores the listener registered with setChangeListener()\r\n * This isn't actually necessary since the UID never changes, but we use this\r\n * to verify the listen contract is adhered to in tests.\r\n */\r\n this.changeListener = null;\r\n }\r\n getToken() {\r\n return Promise.resolve(this.token);\r\n }\r\n invalidateToken() { }\r\n start(asyncQueue, changeListener) {\r\n this.changeListener = changeListener;\r\n // Fire with initial user.\r\n asyncQueue.enqueueRetryable(() => changeListener(this.token.user));\r\n }\r\n shutdown() {\r\n this.changeListener = null;\r\n }\r\n}\r\nclass FirebaseCredentialsProvider {\r\n constructor(authProvider) {\r\n this.authProvider = authProvider;\r\n /** Tracks the current User. */\r\n this.currentUser = User.UNAUTHENTICATED;\r\n /**\r\n * Counter used to detect if the token changed while a getToken request was\r\n * outstanding.\r\n */\r\n this.tokenCounter = 0;\r\n this.forceRefresh = false;\r\n this.auth = null;\r\n }\r\n start(asyncQueue, changeListener) {\r\n let lastTokenId = this.tokenCounter;\r\n // A change listener that prevents double-firing for the same token change.\r\n const guardedChangeListener = user => {\r\n if (this.tokenCounter !== lastTokenId) {\r\n lastTokenId = this.tokenCounter;\r\n return changeListener(user);\r\n }\r\n else {\r\n return Promise.resolve();\r\n }\r\n };\r\n // A promise that can be waited on to block on the next token change.\r\n // This promise is re-created after each change.\r\n let nextToken = new Deferred();\r\n this.tokenListener = () => {\r\n this.tokenCounter++;\r\n this.currentUser = this.getUser();\r\n nextToken.resolve();\r\n nextToken = new Deferred();\r\n asyncQueue.enqueueRetryable(() => guardedChangeListener(this.currentUser));\r\n };\r\n const awaitNextToken = () => {\r\n const currentTokenAttempt = nextToken;\r\n asyncQueue.enqueueRetryable(async () => {\r\n await currentTokenAttempt.promise;\r\n await guardedChangeListener(this.currentUser);\r\n });\r\n };\r\n const registerAuth = (auth) => {\r\n logDebug('FirebaseCredentialsProvider', 'Auth detected');\r\n this.auth = auth;\r\n this.auth.addAuthTokenListener(this.tokenListener);\r\n awaitNextToken();\r\n };\r\n this.authProvider.onInit(auth => registerAuth(auth));\r\n // Our users can initialize Auth right after Firestore, so we give it\r\n // a chance to register itself with the component framework before we\r\n // determine whether to start up in unauthenticated mode.\r\n setTimeout(() => {\r\n if (!this.auth) {\r\n const auth = this.authProvider.getImmediate({ optional: true });\r\n if (auth) {\r\n registerAuth(auth);\r\n }\r\n else {\r\n // If auth is still not available, proceed with `null` user\r\n logDebug('FirebaseCredentialsProvider', 'Auth not yet detected');\r\n nextToken.resolve();\r\n nextToken = new Deferred();\r\n }\r\n }\r\n }, 0);\r\n awaitNextToken();\r\n }\r\n getToken() {\r\n // Take note of the current value of the tokenCounter so that this method\r\n // can fail (with an ABORTED error) if there is a token change while the\r\n // request is outstanding.\r\n const initialTokenCounter = this.tokenCounter;\r\n const forceRefresh = this.forceRefresh;\r\n this.forceRefresh = false;\r\n if (!this.auth) {\r\n return Promise.resolve(null);\r\n }\r\n return this.auth.getToken(forceRefresh).then(tokenData => {\r\n // Cancel the request since the token changed while the request was\r\n // outstanding so the response is potentially for a previous user (which\r\n // user, we can't be sure).\r\n if (this.tokenCounter !== initialTokenCounter) {\r\n logDebug('FirebaseCredentialsProvider', 'getToken aborted due to token change.');\r\n return this.getToken();\r\n }\r\n else {\r\n if (tokenData) {\r\n hardAssert(typeof tokenData.accessToken === 'string');\r\n return new OAuthToken(tokenData.accessToken, this.currentUser);\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n });\r\n }\r\n invalidateToken() {\r\n this.forceRefresh = true;\r\n }\r\n shutdown() {\r\n if (this.auth) {\r\n this.auth.removeAuthTokenListener(this.tokenListener);\r\n }\r\n }\r\n // Auth.getUid() can return null even with a user logged in. It is because\r\n // getUid() is synchronous, but the auth code populating Uid is asynchronous.\r\n // This method should only be called in the AuthTokenListener callback\r\n // to guarantee to get the actual user.\r\n getUser() {\r\n const currentUid = this.auth && this.auth.getUid();\r\n hardAssert(currentUid === null || typeof currentUid === 'string');\r\n return new User(currentUid);\r\n }\r\n}\r\n/*\r\n * FirstPartyToken provides a fresh token each time its value\r\n * is requested, because if the token is too old, requests will be rejected.\r\n * Technically this may no longer be necessary since the SDK should gracefully\r\n * recover from unauthenticated errors (see b/33147818 for context), but it's\r\n * safer to keep the implementation as-is.\r\n */\r\nclass FirstPartyToken {\r\n constructor(gapi, sessionIndex, iamToken) {\r\n this.gapi = gapi;\r\n this.sessionIndex = sessionIndex;\r\n this.iamToken = iamToken;\r\n this.type = 'FirstParty';\r\n this.user = User.FIRST_PARTY;\r\n }\r\n get authHeaders() {\r\n const headers = {\r\n 'X-Goog-AuthUser': this.sessionIndex\r\n };\r\n // Use array notation to prevent minification\r\n const authHeader = this.gapi['auth']['getAuthHeaderValueForFirstParty']([]);\r\n if (authHeader) {\r\n headers['Authorization'] = authHeader;\r\n }\r\n if (this.iamToken) {\r\n headers['X-Goog-Iam-Authorization-Token'] = this.iamToken;\r\n }\r\n return headers;\r\n }\r\n}\r\n/*\r\n * Provides user credentials required for the Firestore JavaScript SDK\r\n * to authenticate the user, using technique that is only available\r\n * to applications hosted by Google.\r\n */\r\nclass FirstPartyCredentialsProvider {\r\n constructor(gapi, sessionIndex, iamToken) {\r\n this.gapi = gapi;\r\n this.sessionIndex = sessionIndex;\r\n this.iamToken = iamToken;\r\n }\r\n getToken() {\r\n return Promise.resolve(new FirstPartyToken(this.gapi, this.sessionIndex, this.iamToken));\r\n }\r\n start(asyncQueue, changeListener) {\r\n // Fire with initial uid.\r\n asyncQueue.enqueueRetryable(() => changeListener(User.FIRST_PARTY));\r\n }\r\n shutdown() { }\r\n invalidateToken() { }\r\n}\r\n/**\r\n * Builds a CredentialsProvider depending on the type of\r\n * the credentials passed in.\r\n */\r\nfunction makeCredentialsProvider(credentials) {\r\n if (!credentials) {\r\n return new EmptyCredentialsProvider();\r\n }\r\n switch (credentials['type']) {\r\n case 'gapi':\r\n const client = credentials['client'];\r\n // Make sure this really is a Gapi client.\r\n hardAssert(!!(typeof client === 'object' &&\r\n client !== null &&\r\n client['auth'] &&\r\n client['auth']['getAuthHeaderValueForFirstParty']));\r\n return new FirstPartyCredentialsProvider(client, credentials['sessionIndex'] || '0', credentials['iamToken'] || null);\r\n case 'provider':\r\n return credentials['client'];\r\n default:\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'makeCredentialsProvider failed due to invalid credential type');\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2018 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * `ListenSequence` is a monotonic sequence. It is initialized with a minimum value to\r\n * exceed. All subsequent calls to next will return increasing values. If provided with a\r\n * `SequenceNumberSyncer`, it will additionally bump its next value when told of a new value, as\r\n * well as write out sequence numbers that it produces via `next()`.\r\n */\r\nclass ListenSequence {\r\n constructor(previousValue, sequenceNumberSyncer) {\r\n this.previousValue = previousValue;\r\n if (sequenceNumberSyncer) {\r\n sequenceNumberSyncer.sequenceNumberHandler = sequenceNumber => this.setPreviousValue(sequenceNumber);\r\n this.writeNewSequenceNumber = sequenceNumber => sequenceNumberSyncer.writeSequenceNumber(sequenceNumber);\r\n }\r\n }\r\n setPreviousValue(externalPreviousValue) {\r\n this.previousValue = Math.max(externalPreviousValue, this.previousValue);\r\n return this.previousValue;\r\n }\r\n next() {\r\n const nextValue = ++this.previousValue;\r\n if (this.writeNewSequenceNumber) {\r\n this.writeNewSequenceNumber(nextValue);\r\n }\r\n return nextValue;\r\n }\r\n}\r\nListenSequence.INVALID = -1;\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst DOCUMENT_KEY_NAME = '__name__';\r\n/**\r\n * Path represents an ordered sequence of string segments.\r\n */\r\nclass BasePath {\r\n constructor(segments, offset, length) {\r\n if (offset === undefined) {\r\n offset = 0;\r\n }\r\n else if (offset > segments.length) {\r\n fail();\r\n }\r\n if (length === undefined) {\r\n length = segments.length - offset;\r\n }\r\n else if (length > segments.length - offset) {\r\n fail();\r\n }\r\n this.segments = segments;\r\n this.offset = offset;\r\n this.len = length;\r\n }\r\n get length() {\r\n return this.len;\r\n }\r\n isEqual(other) {\r\n return BasePath.comparator(this, other) === 0;\r\n }\r\n child(nameOrPath) {\r\n const segments = this.segments.slice(this.offset, this.limit());\r\n if (nameOrPath instanceof BasePath) {\r\n nameOrPath.forEach(segment => {\r\n segments.push(segment);\r\n });\r\n }\r\n else {\r\n segments.push(nameOrPath);\r\n }\r\n return this.construct(segments);\r\n }\r\n /** The index of one past the last segment of the path. */\r\n limit() {\r\n return this.offset + this.length;\r\n }\r\n popFirst(size) {\r\n size = size === undefined ? 1 : size;\r\n return this.construct(this.segments, this.offset + size, this.length - size);\r\n }\r\n popLast() {\r\n return this.construct(this.segments, this.offset, this.length - 1);\r\n }\r\n firstSegment() {\r\n return this.segments[this.offset];\r\n }\r\n lastSegment() {\r\n return this.get(this.length - 1);\r\n }\r\n get(index) {\r\n return this.segments[this.offset + index];\r\n }\r\n isEmpty() {\r\n return this.length === 0;\r\n }\r\n isPrefixOf(other) {\r\n if (other.length < this.length) {\r\n return false;\r\n }\r\n for (let i = 0; i < this.length; i++) {\r\n if (this.get(i) !== other.get(i)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n isImmediateParentOf(potentialChild) {\r\n if (this.length + 1 !== potentialChild.length) {\r\n return false;\r\n }\r\n for (let i = 0; i < this.length; i++) {\r\n if (this.get(i) !== potentialChild.get(i)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n forEach(fn) {\r\n for (let i = this.offset, end = this.limit(); i < end; i++) {\r\n fn(this.segments[i]);\r\n }\r\n }\r\n toArray() {\r\n return this.segments.slice(this.offset, this.limit());\r\n }\r\n static comparator(p1, p2) {\r\n const len = Math.min(p1.length, p2.length);\r\n for (let i = 0; i < len; i++) {\r\n const left = p1.get(i);\r\n const right = p2.get(i);\r\n if (left < right) {\r\n return -1;\r\n }\r\n if (left > right) {\r\n return 1;\r\n }\r\n }\r\n if (p1.length < p2.length) {\r\n return -1;\r\n }\r\n if (p1.length > p2.length) {\r\n return 1;\r\n }\r\n return 0;\r\n }\r\n}\r\n/**\r\n * A slash-separated path for navigating resources (documents and collections)\r\n * within Firestore.\r\n *\r\n * @internal\r\n */\r\nclass ResourcePath extends BasePath {\r\n construct(segments, offset, length) {\r\n return new ResourcePath(segments, offset, length);\r\n }\r\n canonicalString() {\r\n // NOTE: The client is ignorant of any path segments containing escape\r\n // sequences (e.g. __id123__) and just passes them through raw (they exist\r\n // for legacy reasons and should not be used frequently).\r\n return this.toArray().join('/');\r\n }\r\n toString() {\r\n return this.canonicalString();\r\n }\r\n /**\r\n * Creates a resource path from the given slash-delimited string. If multiple\r\n * arguments are provided, all components are combined. Leading and trailing\r\n * slashes from all components are ignored.\r\n */\r\n static fromString(...pathComponents) {\r\n // NOTE: The client is ignorant of any path segments containing escape\r\n // sequences (e.g. __id123__) and just passes them through raw (they exist\r\n // for legacy reasons and should not be used frequently).\r\n const segments = [];\r\n for (const path of pathComponents) {\r\n if (path.indexOf('//') >= 0) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, `Invalid segment (${path}). Paths must not contain // in them.`);\r\n }\r\n // Strip leading and traling slashed.\r\n segments.push(...path.split('/').filter(segment => segment.length > 0));\r\n }\r\n return new ResourcePath(segments);\r\n }\r\n static emptyPath() {\r\n return new ResourcePath([]);\r\n }\r\n}\r\nconst identifierRegExp = /^[_a-zA-Z][_a-zA-Z0-9]*$/;\r\n/**\r\n * A dot-separated path for navigating sub-objects within a document.\r\n * @internal\r\n */\r\nclass FieldPath$1 extends BasePath {\r\n construct(segments, offset, length) {\r\n return new FieldPath$1(segments, offset, length);\r\n }\r\n /**\r\n * Returns true if the string could be used as a segment in a field path\r\n * without escaping.\r\n */\r\n static isValidIdentifier(segment) {\r\n return identifierRegExp.test(segment);\r\n }\r\n canonicalString() {\r\n return this.toArray()\r\n .map(str => {\r\n str = str.replace(/\\\\/g, '\\\\\\\\').replace(/`/g, '\\\\`');\r\n if (!FieldPath$1.isValidIdentifier(str)) {\r\n str = '`' + str + '`';\r\n }\r\n return str;\r\n })\r\n .join('.');\r\n }\r\n toString() {\r\n return this.canonicalString();\r\n }\r\n /**\r\n * Returns true if this field references the key of a document.\r\n */\r\n isKeyField() {\r\n return this.length === 1 && this.get(0) === DOCUMENT_KEY_NAME;\r\n }\r\n /**\r\n * The field designating the key of a document.\r\n */\r\n static keyField() {\r\n return new FieldPath$1([DOCUMENT_KEY_NAME]);\r\n }\r\n /**\r\n * Parses a field string from the given server-formatted string.\r\n *\r\n * - Splitting the empty string is not allowed (for now at least).\r\n * - Empty segments within the string (e.g. if there are two consecutive\r\n * separators) are not allowed.\r\n *\r\n * TODO(b/37244157): we should make this more strict. Right now, it allows\r\n * non-identifier path components, even if they aren't escaped.\r\n */\r\n static fromServerFormat(path) {\r\n const segments = [];\r\n let current = '';\r\n let i = 0;\r\n const addCurrentSegment = () => {\r\n if (current.length === 0) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, `Invalid field path (${path}). Paths must not be empty, begin ` +\r\n `with '.', end with '.', or contain '..'`);\r\n }\r\n segments.push(current);\r\n current = '';\r\n };\r\n let inBackticks = false;\r\n while (i < path.length) {\r\n const c = path[i];\r\n if (c === '\\\\') {\r\n if (i + 1 === path.length) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Path has trailing escape character: ' + path);\r\n }\r\n const next = path[i + 1];\r\n if (!(next === '\\\\' || next === '.' || next === '`')) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Path has invalid escape sequence: ' + path);\r\n }\r\n current += next;\r\n i += 2;\r\n }\r\n else if (c === '`') {\r\n inBackticks = !inBackticks;\r\n i++;\r\n }\r\n else if (c === '.' && !inBackticks) {\r\n addCurrentSegment();\r\n i++;\r\n }\r\n else {\r\n current += c;\r\n i++;\r\n }\r\n }\r\n addCurrentSegment();\r\n if (inBackticks) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Unterminated ` in path: ' + path);\r\n }\r\n return new FieldPath$1(segments);\r\n }\r\n static emptyPath() {\r\n return new FieldPath$1([]);\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst escapeChar = '\\u0001';\r\nconst encodedSeparatorChar = '\\u0001';\r\nconst encodedNul = '\\u0010';\r\nconst encodedEscape = '\\u0011';\r\n/**\r\n * Encodes a resource path into a IndexedDb-compatible string form.\r\n */\r\nfunction encodeResourcePath(path) {\r\n let result = '';\r\n for (let i = 0; i < path.length; i++) {\r\n if (result.length > 0) {\r\n result = encodeSeparator(result);\r\n }\r\n result = encodeSegment(path.get(i), result);\r\n }\r\n return encodeSeparator(result);\r\n}\r\n/** Encodes a single segment of a resource path into the given result */\r\nfunction encodeSegment(segment, resultBuf) {\r\n let result = resultBuf;\r\n const length = segment.length;\r\n for (let i = 0; i < length; i++) {\r\n const c = segment.charAt(i);\r\n switch (c) {\r\n case '\\0':\r\n result += escapeChar + encodedNul;\r\n break;\r\n case escapeChar:\r\n result += escapeChar + encodedEscape;\r\n break;\r\n default:\r\n result += c;\r\n }\r\n }\r\n return result;\r\n}\r\n/** Encodes a path separator into the given result */\r\nfunction encodeSeparator(result) {\r\n return result + escapeChar + encodedSeparatorChar;\r\n}\r\n/**\r\n * Decodes the given IndexedDb-compatible string form of a resource path into\r\n * a ResourcePath instance. Note that this method is not suitable for use with\r\n * decoding resource names from the server; those are One Platform format\r\n * strings.\r\n */\r\nfunction decodeResourcePath(path) {\r\n // Event the empty path must encode as a path of at least length 2. A path\r\n // with exactly 2 must be the empty path.\r\n const length = path.length;\r\n hardAssert(length >= 2);\r\n if (length === 2) {\r\n hardAssert(path.charAt(0) === escapeChar && path.charAt(1) === encodedSeparatorChar);\r\n return ResourcePath.emptyPath();\r\n }\r\n // Escape characters cannot exist past the second-to-last position in the\r\n // source value.\r\n const lastReasonableEscapeIndex = length - 2;\r\n const segments = [];\r\n let segmentBuilder = '';\r\n for (let start = 0; start < length;) {\r\n // The last two characters of a valid encoded path must be a separator, so\r\n // there must be an end to this segment.\r\n const end = path.indexOf(escapeChar, start);\r\n if (end < 0 || end > lastReasonableEscapeIndex) {\r\n fail();\r\n }\r\n const next = path.charAt(end + 1);\r\n switch (next) {\r\n case encodedSeparatorChar:\r\n const currentPiece = path.substring(start, end);\r\n let segment;\r\n if (segmentBuilder.length === 0) {\r\n // Avoid copying for the common case of a segment that excludes \\0\r\n // and \\001\r\n segment = currentPiece;\r\n }\r\n else {\r\n segmentBuilder += currentPiece;\r\n segment = segmentBuilder;\r\n segmentBuilder = '';\r\n }\r\n segments.push(segment);\r\n break;\r\n case encodedNul:\r\n segmentBuilder += path.substring(start, end);\r\n segmentBuilder += '\\0';\r\n break;\r\n case encodedEscape:\r\n // The escape character can be used in the output to encode itself.\r\n segmentBuilder += path.substring(start, end + 1);\r\n break;\r\n default:\r\n fail();\r\n }\r\n start = end + 2;\r\n }\r\n return new ResourcePath(segments);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Schema Version for the Web client:\r\n * 1. Initial version including Mutation Queue, Query Cache, and Remote\r\n * Document Cache\r\n * 2. Used to ensure a targetGlobal object exists and add targetCount to it. No\r\n * longer required because migration 3 unconditionally clears it.\r\n * 3. Dropped and re-created Query Cache to deal with cache corruption related\r\n * to limbo resolution. Addresses\r\n * https://github.com/firebase/firebase-ios-sdk/issues/1548\r\n * 4. Multi-Tab Support.\r\n * 5. Removal of held write acks.\r\n * 6. Create document global for tracking document cache size.\r\n * 7. Ensure every cached document has a sentinel row with a sequence number.\r\n * 8. Add collection-parent index for Collection Group queries.\r\n * 9. Change RemoteDocumentChanges store to be keyed by readTime rather than\r\n * an auto-incrementing ID. This is required for Index-Free queries.\r\n * 10. Rewrite the canonical IDs to the explicit Protobuf-based format.\r\n * 11. Add bundles and named_queries for bundle support.\r\n */\r\nconst SCHEMA_VERSION = 11;\r\n/**\r\n * Wrapper class to store timestamps (seconds and nanos) in IndexedDb objects.\r\n */\r\nclass DbTimestamp {\r\n constructor(seconds, nanoseconds) {\r\n this.seconds = seconds;\r\n this.nanoseconds = nanoseconds;\r\n }\r\n}\r\n/**\r\n * A singleton object to be stored in the 'owner' store in IndexedDb.\r\n *\r\n * A given database can have a single primary tab assigned at a given time. That\r\n * tab must validate that it is still holding the primary lease before every\r\n * operation that requires locked access. The primary tab should regularly\r\n * write an updated timestamp to this lease to prevent other tabs from\r\n * \"stealing\" the primary lease\r\n */\r\nclass DbPrimaryClient {\r\n constructor(ownerId, \r\n /** Whether to allow shared access from multiple tabs. */\r\n allowTabSynchronization, leaseTimestampMs) {\r\n this.ownerId = ownerId;\r\n this.allowTabSynchronization = allowTabSynchronization;\r\n this.leaseTimestampMs = leaseTimestampMs;\r\n }\r\n}\r\n/**\r\n * Name of the IndexedDb object store.\r\n *\r\n * Note that the name 'owner' is chosen to ensure backwards compatibility with\r\n * older clients that only supported single locked access to the persistence\r\n * layer.\r\n */\r\nDbPrimaryClient.store = 'owner';\r\n/**\r\n * The key string used for the single object that exists in the\r\n * DbPrimaryClient store.\r\n */\r\nDbPrimaryClient.key = 'owner';\r\n/**\r\n * An object to be stored in the 'mutationQueues' store in IndexedDb.\r\n *\r\n * Each user gets a single queue of MutationBatches to apply to the server.\r\n * DbMutationQueue tracks the metadata about the queue.\r\n */\r\nclass DbMutationQueue {\r\n constructor(\r\n /**\r\n * The normalized user ID to which this queue belongs.\r\n */\r\n userId, \r\n /**\r\n * An identifier for the highest numbered batch that has been acknowledged\r\n * by the server. All MutationBatches in this queue with batchIds less\r\n * than or equal to this value are considered to have been acknowledged by\r\n * the server.\r\n *\r\n * NOTE: this is deprecated and no longer used by the code.\r\n */\r\n lastAcknowledgedBatchId, \r\n /**\r\n * A stream token that was previously sent by the server.\r\n *\r\n * See StreamingWriteRequest in datastore.proto for more details about\r\n * usage.\r\n *\r\n * After sending this token, earlier tokens may not be used anymore so\r\n * only a single stream token is retained.\r\n *\r\n * NOTE: this is deprecated and no longer used by the code.\r\n */\r\n lastStreamToken) {\r\n this.userId = userId;\r\n this.lastAcknowledgedBatchId = lastAcknowledgedBatchId;\r\n this.lastStreamToken = lastStreamToken;\r\n }\r\n}\r\n/** Name of the IndexedDb object store. */\r\nDbMutationQueue.store = 'mutationQueues';\r\n/** Keys are automatically assigned via the userId property. */\r\nDbMutationQueue.keyPath = 'userId';\r\n/**\r\n * An object to be stored in the 'mutations' store in IndexedDb.\r\n *\r\n * Represents a batch of user-level mutations intended to be sent to the server\r\n * in a single write. Each user-level batch gets a separate DbMutationBatch\r\n * with a new batchId.\r\n */\r\nclass DbMutationBatch {\r\n constructor(\r\n /**\r\n * The normalized user ID to which this batch belongs.\r\n */\r\n userId, \r\n /**\r\n * An identifier for this batch, allocated using an auto-generated key.\r\n */\r\n batchId, \r\n /**\r\n * The local write time of the batch, stored as milliseconds since the\r\n * epoch.\r\n */\r\n localWriteTimeMs, \r\n /**\r\n * A list of \"mutations\" that represent a partial base state from when this\r\n * write batch was initially created. During local application of the write\r\n * batch, these baseMutations are applied prior to the real writes in order\r\n * to override certain document fields from the remote document cache. This\r\n * is necessary in the case of non-idempotent writes (e.g. `increment()`\r\n * transforms) to make sure that the local view of the modified documents\r\n * doesn't flicker if the remote document cache receives the result of the\r\n * non-idempotent write before the write is removed from the queue.\r\n *\r\n * These mutations are never sent to the backend.\r\n */\r\n baseMutations, \r\n /**\r\n * A list of mutations to apply. All mutations will be applied atomically.\r\n *\r\n * Mutations are serialized via toMutation().\r\n */\r\n mutations) {\r\n this.userId = userId;\r\n this.batchId = batchId;\r\n this.localWriteTimeMs = localWriteTimeMs;\r\n this.baseMutations = baseMutations;\r\n this.mutations = mutations;\r\n }\r\n}\r\n/** Name of the IndexedDb object store. */\r\nDbMutationBatch.store = 'mutations';\r\n/** Keys are automatically assigned via the userId, batchId properties. */\r\nDbMutationBatch.keyPath = 'batchId';\r\n/** The index name for lookup of mutations by user. */\r\nDbMutationBatch.userMutationsIndex = 'userMutationsIndex';\r\n/** The user mutations index is keyed by [userId, batchId] pairs. */\r\nDbMutationBatch.userMutationsKeyPath = ['userId', 'batchId'];\r\n/**\r\n * An object to be stored in the 'documentMutations' store in IndexedDb.\r\n *\r\n * A manually maintained index of all the mutation batches that affect a given\r\n * document key. The rows in this table are references based on the contents of\r\n * DbMutationBatch.mutations.\r\n */\r\nclass DbDocumentMutation {\r\n constructor() { }\r\n /**\r\n * Creates a [userId] key for use in the DbDocumentMutations index to iterate\r\n * over all of a user's document mutations.\r\n */\r\n static prefixForUser(userId) {\r\n return [userId];\r\n }\r\n /**\r\n * Creates a [userId, encodedPath] key for use in the DbDocumentMutations\r\n * index to iterate over all at document mutations for a given path or lower.\r\n */\r\n static prefixForPath(userId, path) {\r\n return [userId, encodeResourcePath(path)];\r\n }\r\n /**\r\n * Creates a full index key of [userId, encodedPath, batchId] for inserting\r\n * and deleting into the DbDocumentMutations index.\r\n */\r\n static key(userId, path, batchId) {\r\n return [userId, encodeResourcePath(path), batchId];\r\n }\r\n}\r\nDbDocumentMutation.store = 'documentMutations';\r\n/**\r\n * Because we store all the useful information for this store in the key,\r\n * there is no useful information to store as the value. The raw (unencoded)\r\n * path cannot be stored because IndexedDb doesn't store prototype\r\n * information.\r\n */\r\nDbDocumentMutation.PLACEHOLDER = new DbDocumentMutation();\r\n/**\r\n * Represents the known absence of a document at a particular version.\r\n * Stored in IndexedDb as part of a DbRemoteDocument object.\r\n */\r\nclass DbNoDocument {\r\n constructor(path, readTime) {\r\n this.path = path;\r\n this.readTime = readTime;\r\n }\r\n}\r\n/**\r\n * Represents a document that is known to exist but whose data is unknown.\r\n * Stored in IndexedDb as part of a DbRemoteDocument object.\r\n */\r\nclass DbUnknownDocument {\r\n constructor(path, version) {\r\n this.path = path;\r\n this.version = version;\r\n }\r\n}\r\n/**\r\n * An object to be stored in the 'remoteDocuments' store in IndexedDb.\r\n * It represents either:\r\n *\r\n * - A complete document.\r\n * - A \"no document\" representing a document that is known not to exist (at\r\n * some version).\r\n * - An \"unknown document\" representing a document that is known to exist (at\r\n * some version) but whose contents are unknown.\r\n *\r\n * Note: This is the persisted equivalent of a MaybeDocument and could perhaps\r\n * be made more general if necessary.\r\n */\r\nclass DbRemoteDocument {\r\n // TODO: We are currently storing full document keys almost three times\r\n // (once as part of the primary key, once - partly - as `parentPath` and once\r\n // inside the encoded documents). During our next migration, we should\r\n // rewrite the primary key as parentPath + document ID which would allow us\r\n // to drop one value.\r\n constructor(\r\n /**\r\n * Set to an instance of DbUnknownDocument if the data for a document is\r\n * not known, but it is known that a document exists at the specified\r\n * version (e.g. it had a successful update applied to it)\r\n */\r\n unknownDocument, \r\n /**\r\n * Set to an instance of a DbNoDocument if it is known that no document\r\n * exists.\r\n */\r\n noDocument, \r\n /**\r\n * Set to an instance of a Document if there's a cached version of the\r\n * document.\r\n */\r\n document, \r\n /**\r\n * Documents that were written to the remote document store based on\r\n * a write acknowledgment are marked with `hasCommittedMutations`. These\r\n * documents are potentially inconsistent with the backend's copy and use\r\n * the write's commit version as their document version.\r\n */\r\n hasCommittedMutations, \r\n /**\r\n * When the document was read from the backend. Undefined for data written\r\n * prior to schema version 9.\r\n */\r\n readTime, \r\n /**\r\n * The path of the collection this document is part of. Undefined for data\r\n * written prior to schema version 9.\r\n */\r\n parentPath) {\r\n this.unknownDocument = unknownDocument;\r\n this.noDocument = noDocument;\r\n this.document = document;\r\n this.hasCommittedMutations = hasCommittedMutations;\r\n this.readTime = readTime;\r\n this.parentPath = parentPath;\r\n }\r\n}\r\nDbRemoteDocument.store = 'remoteDocuments';\r\n/**\r\n * An index that provides access to all entries sorted by read time (which\r\n * corresponds to the last modification time of each row).\r\n *\r\n * This index is used to provide a changelog for Multi-Tab.\r\n */\r\nDbRemoteDocument.readTimeIndex = 'readTimeIndex';\r\nDbRemoteDocument.readTimeIndexPath = 'readTime';\r\n/**\r\n * An index that provides access to documents in a collection sorted by read\r\n * time.\r\n *\r\n * This index is used to allow the RemoteDocumentCache to fetch newly changed\r\n * documents in a collection.\r\n */\r\nDbRemoteDocument.collectionReadTimeIndex = 'collectionReadTimeIndex';\r\nDbRemoteDocument.collectionReadTimeIndexPath = ['parentPath', 'readTime'];\r\n/**\r\n * Contains a single entry that has metadata about the remote document cache.\r\n */\r\nclass DbRemoteDocumentGlobal {\r\n /**\r\n * @param byteSize - Approximately the total size in bytes of all the\r\n * documents in the document cache.\r\n */\r\n constructor(byteSize) {\r\n this.byteSize = byteSize;\r\n }\r\n}\r\nDbRemoteDocumentGlobal.store = 'remoteDocumentGlobal';\r\nDbRemoteDocumentGlobal.key = 'remoteDocumentGlobalKey';\r\n/**\r\n * An object to be stored in the 'targets' store in IndexedDb.\r\n *\r\n * This is based on and should be kept in sync with the proto used in the iOS\r\n * client.\r\n *\r\n * Each query the client listens to against the server is tracked on disk so\r\n * that the query can be efficiently resumed on restart.\r\n */\r\nclass DbTarget {\r\n constructor(\r\n /**\r\n * An auto-generated sequential numeric identifier for the query.\r\n *\r\n * Queries are stored using their canonicalId as the key, but these\r\n * canonicalIds can be quite long so we additionally assign a unique\r\n * queryId which can be used by referenced data structures (e.g.\r\n * indexes) to minimize the on-disk cost.\r\n */\r\n targetId, \r\n /**\r\n * The canonical string representing this query. This is not unique.\r\n */\r\n canonicalId, \r\n /**\r\n * The last readTime received from the Watch Service for this query.\r\n *\r\n * This is the same value as TargetChange.read_time in the protos.\r\n */\r\n readTime, \r\n /**\r\n * An opaque, server-assigned token that allows watching a query to be\r\n * resumed after disconnecting without retransmitting all the data\r\n * that matches the query. The resume token essentially identifies a\r\n * point in time from which the server should resume sending results.\r\n *\r\n * This is related to the snapshotVersion in that the resumeToken\r\n * effectively also encodes that value, but the resumeToken is opaque\r\n * and sometimes encodes additional information.\r\n *\r\n * A consequence of this is that the resumeToken should be used when\r\n * asking the server to reason about where this client is in the watch\r\n * stream, but the client should use the snapshotVersion for its own\r\n * purposes.\r\n *\r\n * This is the same value as TargetChange.resume_token in the protos.\r\n */\r\n resumeToken, \r\n /**\r\n * A sequence number representing the last time this query was\r\n * listened to, used for garbage collection purposes.\r\n *\r\n * Conventionally this would be a timestamp value, but device-local\r\n * clocks are unreliable and they must be able to create new listens\r\n * even while disconnected. Instead this should be a monotonically\r\n * increasing number that's incremented on each listen call.\r\n *\r\n * This is different from the queryId since the queryId is an\r\n * immutable identifier assigned to the Query on first use while\r\n * lastListenSequenceNumber is updated every time the query is\r\n * listened to.\r\n */\r\n lastListenSequenceNumber, \r\n /**\r\n * Denotes the maximum snapshot version at which the associated query view\r\n * contained no limbo documents. Undefined for data written prior to\r\n * schema version 9.\r\n */\r\n lastLimboFreeSnapshotVersion, \r\n /**\r\n * The query for this target.\r\n *\r\n * Because canonical ids are not unique we must store the actual query. We\r\n * use the proto to have an object we can persist without having to\r\n * duplicate translation logic to and from a `Query` object.\r\n */\r\n query) {\r\n this.targetId = targetId;\r\n this.canonicalId = canonicalId;\r\n this.readTime = readTime;\r\n this.resumeToken = resumeToken;\r\n this.lastListenSequenceNumber = lastListenSequenceNumber;\r\n this.lastLimboFreeSnapshotVersion = lastLimboFreeSnapshotVersion;\r\n this.query = query;\r\n }\r\n}\r\nDbTarget.store = 'targets';\r\n/** Keys are automatically assigned via the targetId property. */\r\nDbTarget.keyPath = 'targetId';\r\n/** The name of the queryTargets index. */\r\nDbTarget.queryTargetsIndexName = 'queryTargetsIndex';\r\n/**\r\n * The index of all canonicalIds to the targets that they match. This is not\r\n * a unique mapping because canonicalId does not promise a unique name for all\r\n * possible queries, so we append the targetId to make the mapping unique.\r\n */\r\nDbTarget.queryTargetsKeyPath = ['canonicalId', 'targetId'];\r\n/**\r\n * An object representing an association between a target and a document, or a\r\n * sentinel row marking the last sequence number at which a document was used.\r\n * Each document cached must have a corresponding sentinel row before lru\r\n * garbage collection is enabled.\r\n *\r\n * The target associations and sentinel rows are co-located so that orphaned\r\n * documents and their sequence numbers can be identified efficiently via a scan\r\n * of this store.\r\n */\r\nclass DbTargetDocument {\r\n constructor(\r\n /**\r\n * The targetId identifying a target or 0 for a sentinel row.\r\n */\r\n targetId, \r\n /**\r\n * The path to the document, as encoded in the key.\r\n */\r\n path, \r\n /**\r\n * If this is a sentinel row, this should be the sequence number of the last\r\n * time the document specified by `path` was used. Otherwise, it should be\r\n * `undefined`.\r\n */\r\n sequenceNumber) {\r\n this.targetId = targetId;\r\n this.path = path;\r\n this.sequenceNumber = sequenceNumber;\r\n }\r\n}\r\n/** Name of the IndexedDb object store. */\r\nDbTargetDocument.store = 'targetDocuments';\r\n/** Keys are automatically assigned via the targetId, path properties. */\r\nDbTargetDocument.keyPath = ['targetId', 'path'];\r\n/** The index name for the reverse index. */\r\nDbTargetDocument.documentTargetsIndex = 'documentTargetsIndex';\r\n/** We also need to create the reverse index for these properties. */\r\nDbTargetDocument.documentTargetsKeyPath = ['path', 'targetId'];\r\n/**\r\n * A record of global state tracked across all Targets, tracked separately\r\n * to avoid the need for extra indexes.\r\n *\r\n * This should be kept in-sync with the proto used in the iOS client.\r\n */\r\nclass DbTargetGlobal {\r\n constructor(\r\n /**\r\n * The highest numbered target id across all targets.\r\n *\r\n * See DbTarget.targetId.\r\n */\r\n highestTargetId, \r\n /**\r\n * The highest numbered lastListenSequenceNumber across all targets.\r\n *\r\n * See DbTarget.lastListenSequenceNumber.\r\n */\r\n highestListenSequenceNumber, \r\n /**\r\n * A global snapshot version representing the last consistent snapshot we\r\n * received from the backend. This is monotonically increasing and any\r\n * snapshots received from the backend prior to this version (e.g. for\r\n * targets resumed with a resumeToken) should be suppressed (buffered)\r\n * until the backend has caught up to this snapshot version again. This\r\n * prevents our cache from ever going backwards in time.\r\n */\r\n lastRemoteSnapshotVersion, \r\n /**\r\n * The number of targets persisted.\r\n */\r\n targetCount) {\r\n this.highestTargetId = highestTargetId;\r\n this.highestListenSequenceNumber = highestListenSequenceNumber;\r\n this.lastRemoteSnapshotVersion = lastRemoteSnapshotVersion;\r\n this.targetCount = targetCount;\r\n }\r\n}\r\n/**\r\n * The key string used for the single object that exists in the\r\n * DbTargetGlobal store.\r\n */\r\nDbTargetGlobal.key = 'targetGlobalKey';\r\nDbTargetGlobal.store = 'targetGlobal';\r\n/**\r\n * An object representing an association between a Collection id (e.g. 'messages')\r\n * to a parent path (e.g. '/chats/123') that contains it as a (sub)collection.\r\n * This is used to efficiently find all collections to query when performing\r\n * a Collection Group query.\r\n */\r\nclass DbCollectionParent {\r\n constructor(\r\n /**\r\n * The collectionId (e.g. 'messages')\r\n */\r\n collectionId, \r\n /**\r\n * The path to the parent (either a document location or an empty path for\r\n * a root-level collection).\r\n */\r\n parent) {\r\n this.collectionId = collectionId;\r\n this.parent = parent;\r\n }\r\n}\r\n/** Name of the IndexedDb object store. */\r\nDbCollectionParent.store = 'collectionParents';\r\n/** Keys are automatically assigned via the collectionId, parent properties. */\r\nDbCollectionParent.keyPath = ['collectionId', 'parent'];\r\n/**\r\n * A record of the metadata state of each client.\r\n *\r\n * PORTING NOTE: This is used to synchronize multi-tab state and does not need\r\n * to be ported to iOS or Android.\r\n */\r\nclass DbClientMetadata {\r\n constructor(\r\n // Note: Previous schema versions included a field\r\n // \"lastProcessedDocumentChangeId\". Don't use anymore.\r\n /** The auto-generated client id assigned at client startup. */\r\n clientId, \r\n /** The last time this state was updated. */\r\n updateTimeMs, \r\n /** Whether the client's network connection is enabled. */\r\n networkEnabled, \r\n /** Whether this client is running in a foreground tab. */\r\n inForeground) {\r\n this.clientId = clientId;\r\n this.updateTimeMs = updateTimeMs;\r\n this.networkEnabled = networkEnabled;\r\n this.inForeground = inForeground;\r\n }\r\n}\r\n/** Name of the IndexedDb object store. */\r\nDbClientMetadata.store = 'clientMetadata';\r\n/** Keys are automatically assigned via the clientId properties. */\r\nDbClientMetadata.keyPath = 'clientId';\r\n/**\r\n * A object representing a bundle loaded by the SDK.\r\n */\r\nclass DbBundle {\r\n constructor(\r\n /** The ID of the loaded bundle. */\r\n bundleId, \r\n /** The create time of the loaded bundle. */\r\n createTime, \r\n /** The schema version of the loaded bundle. */\r\n version) {\r\n this.bundleId = bundleId;\r\n this.createTime = createTime;\r\n this.version = version;\r\n }\r\n}\r\n/** Name of the IndexedDb object store. */\r\nDbBundle.store = 'bundles';\r\nDbBundle.keyPath = 'bundleId';\r\n/**\r\n * A object representing a named query loaded by the SDK via a bundle.\r\n */\r\nclass DbNamedQuery {\r\n constructor(\r\n /** The name of the query. */\r\n name, \r\n /** The read time of the results saved in the bundle from the named query. */\r\n readTime, \r\n /** The query saved in the bundle. */\r\n bundledQuery) {\r\n this.name = name;\r\n this.readTime = readTime;\r\n this.bundledQuery = bundledQuery;\r\n }\r\n}\r\n/** Name of the IndexedDb object store. */\r\nDbNamedQuery.store = 'namedQueries';\r\nDbNamedQuery.keyPath = 'name';\r\n// Visible for testing\r\nconst V1_STORES = [\r\n DbMutationQueue.store,\r\n DbMutationBatch.store,\r\n DbDocumentMutation.store,\r\n DbRemoteDocument.store,\r\n DbTarget.store,\r\n DbPrimaryClient.store,\r\n DbTargetGlobal.store,\r\n DbTargetDocument.store\r\n];\r\n// V2 is no longer usable (see comment at top of file)\r\n// Visible for testing\r\nconst V3_STORES = V1_STORES;\r\n// Visible for testing\r\n// Note: DbRemoteDocumentChanges is no longer used and dropped with v9.\r\nconst V4_STORES = [...V3_STORES, DbClientMetadata.store];\r\n// V5 does not change the set of stores.\r\nconst V6_STORES = [...V4_STORES, DbRemoteDocumentGlobal.store];\r\n// V7 does not change the set of stores.\r\nconst V8_STORES = [...V6_STORES, DbCollectionParent.store];\r\n// V9 does not change the set of stores.\r\n// V10 does not change the set of stores.\r\nconst V11_STORES = [...V8_STORES, DbBundle.store, DbNamedQuery.store];\r\n/**\r\n * The list of all default IndexedDB stores used throughout the SDK. This is\r\n * used when creating transactions so that access across all stores is done\r\n * atomically.\r\n */\r\nconst ALL_STORES = V11_STORES;\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst PRIMARY_LEASE_LOST_ERROR_MSG = 'The current tab is not in the required state to perform this operation. ' +\r\n 'It might be necessary to refresh the browser tab.';\r\n/**\r\n * A base class representing a persistence transaction, encapsulating both the\r\n * transaction's sequence numbers as well as a list of onCommitted listeners.\r\n *\r\n * When you call Persistence.runTransaction(), it will create a transaction and\r\n * pass it to your callback. You then pass it to any method that operates\r\n * on persistence.\r\n */\r\nclass PersistenceTransaction {\r\n constructor() {\r\n this.onCommittedListeners = [];\r\n }\r\n addOnCommittedListener(listener) {\r\n this.onCommittedListeners.push(listener);\r\n }\r\n raiseOnCommittedEvent() {\r\n this.onCommittedListeners.forEach(listener => listener());\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * PersistencePromise is essentially a re-implementation of Promise except\r\n * it has a .next() method instead of .then() and .next() and .catch() callbacks\r\n * are executed synchronously when a PersistencePromise resolves rather than\r\n * asynchronously (Promise implementations use setImmediate() or similar).\r\n *\r\n * This is necessary to interoperate with IndexedDB which will automatically\r\n * commit transactions if control is returned to the event loop without\r\n * synchronously initiating another operation on the transaction.\r\n *\r\n * NOTE: .then() and .catch() only allow a single consumer, unlike normal\r\n * Promises.\r\n */\r\nclass PersistencePromise {\r\n constructor(callback) {\r\n // NOTE: next/catchCallback will always point to our own wrapper functions,\r\n // not the user's raw next() or catch() callbacks.\r\n this.nextCallback = null;\r\n this.catchCallback = null;\r\n // When the operation resolves, we'll set result or error and mark isDone.\r\n this.result = undefined;\r\n this.error = undefined;\r\n this.isDone = false;\r\n // Set to true when .then() or .catch() are called and prevents additional\r\n // chaining.\r\n this.callbackAttached = false;\r\n callback(value => {\r\n this.isDone = true;\r\n this.result = value;\r\n if (this.nextCallback) {\r\n // value should be defined unless T is Void, but we can't express\r\n // that in the type system.\r\n this.nextCallback(value);\r\n }\r\n }, error => {\r\n this.isDone = true;\r\n this.error = error;\r\n if (this.catchCallback) {\r\n this.catchCallback(error);\r\n }\r\n });\r\n }\r\n catch(fn) {\r\n return this.next(undefined, fn);\r\n }\r\n next(nextFn, catchFn) {\r\n if (this.callbackAttached) {\r\n fail();\r\n }\r\n this.callbackAttached = true;\r\n if (this.isDone) {\r\n if (!this.error) {\r\n return this.wrapSuccess(nextFn, this.result);\r\n }\r\n else {\r\n return this.wrapFailure(catchFn, this.error);\r\n }\r\n }\r\n else {\r\n return new PersistencePromise((resolve, reject) => {\r\n this.nextCallback = (value) => {\r\n this.wrapSuccess(nextFn, value).next(resolve, reject);\r\n };\r\n this.catchCallback = (error) => {\r\n this.wrapFailure(catchFn, error).next(resolve, reject);\r\n };\r\n });\r\n }\r\n }\r\n toPromise() {\r\n return new Promise((resolve, reject) => {\r\n this.next(resolve, reject);\r\n });\r\n }\r\n wrapUserFunction(fn) {\r\n try {\r\n const result = fn();\r\n if (result instanceof PersistencePromise) {\r\n return result;\r\n }\r\n else {\r\n return PersistencePromise.resolve(result);\r\n }\r\n }\r\n catch (e) {\r\n return PersistencePromise.reject(e);\r\n }\r\n }\r\n wrapSuccess(nextFn, value) {\r\n if (nextFn) {\r\n return this.wrapUserFunction(() => nextFn(value));\r\n }\r\n else {\r\n // If there's no nextFn, then R must be the same as T\r\n return PersistencePromise.resolve(value);\r\n }\r\n }\r\n wrapFailure(catchFn, error) {\r\n if (catchFn) {\r\n return this.wrapUserFunction(() => catchFn(error));\r\n }\r\n else {\r\n return PersistencePromise.reject(error);\r\n }\r\n }\r\n static resolve(result) {\r\n return new PersistencePromise((resolve, reject) => {\r\n resolve(result);\r\n });\r\n }\r\n static reject(error) {\r\n return new PersistencePromise((resolve, reject) => {\r\n reject(error);\r\n });\r\n }\r\n static waitFor(\r\n // Accept all Promise types in waitFor().\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n all) {\r\n return new PersistencePromise((resolve, reject) => {\r\n let expectedCount = 0;\r\n let resolvedCount = 0;\r\n let done = false;\r\n all.forEach(element => {\r\n ++expectedCount;\r\n element.next(() => {\r\n ++resolvedCount;\r\n if (done && resolvedCount === expectedCount) {\r\n resolve();\r\n }\r\n }, err => reject(err));\r\n });\r\n done = true;\r\n if (resolvedCount === expectedCount) {\r\n resolve();\r\n }\r\n });\r\n }\r\n /**\r\n * Given an array of predicate functions that asynchronously evaluate to a\r\n * boolean, implements a short-circuiting `or` between the results. Predicates\r\n * will be evaluated until one of them returns `true`, then stop. The final\r\n * result will be whether any of them returned `true`.\r\n */\r\n static or(predicates) {\r\n let p = PersistencePromise.resolve(false);\r\n for (const predicate of predicates) {\r\n p = p.next(isTrue => {\r\n if (isTrue) {\r\n return PersistencePromise.resolve(isTrue);\r\n }\r\n else {\r\n return predicate();\r\n }\r\n });\r\n }\r\n return p;\r\n }\r\n static forEach(collection, f) {\r\n const promises = [];\r\n collection.forEach((r, s) => {\r\n promises.push(f.call(this, r, s));\r\n });\r\n return this.waitFor(promises);\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// References to `window` are guarded by SimpleDb.isAvailable()\r\n/* eslint-disable no-restricted-globals */\r\nconst LOG_TAG$g = 'SimpleDb';\r\n/**\r\n * The maximum number of retry attempts for an IndexedDb transaction that fails\r\n * with a DOMException.\r\n */\r\nconst TRANSACTION_RETRY_COUNT = 3;\r\n/**\r\n * Wraps an IDBTransaction and exposes a store() method to get a handle to a\r\n * specific object store.\r\n */\r\nclass SimpleDbTransaction {\r\n constructor(action, transaction) {\r\n this.action = action;\r\n this.transaction = transaction;\r\n this.aborted = false;\r\n /**\r\n * A `Promise` that resolves with the result of the IndexedDb transaction.\r\n */\r\n this.completionDeferred = new Deferred();\r\n this.transaction.oncomplete = () => {\r\n this.completionDeferred.resolve();\r\n };\r\n this.transaction.onabort = () => {\r\n if (transaction.error) {\r\n this.completionDeferred.reject(new IndexedDbTransactionError(action, transaction.error));\r\n }\r\n else {\r\n this.completionDeferred.resolve();\r\n }\r\n };\r\n this.transaction.onerror = (event) => {\r\n const error = checkForAndReportiOSError(event.target.error);\r\n this.completionDeferred.reject(new IndexedDbTransactionError(action, error));\r\n };\r\n }\r\n static open(db, action, mode, objectStoreNames) {\r\n try {\r\n return new SimpleDbTransaction(action, db.transaction(objectStoreNames, mode));\r\n }\r\n catch (e) {\r\n throw new IndexedDbTransactionError(action, e);\r\n }\r\n }\r\n get completionPromise() {\r\n return this.completionDeferred.promise;\r\n }\r\n abort(error) {\r\n if (error) {\r\n this.completionDeferred.reject(error);\r\n }\r\n if (!this.aborted) {\r\n logDebug(LOG_TAG$g, 'Aborting transaction:', error ? error.message : 'Client-initiated abort');\r\n this.aborted = true;\r\n this.transaction.abort();\r\n }\r\n }\r\n /**\r\n * Returns a SimpleDbStore<KeyType, ValueType> for the specified store. All\r\n * operations performed on the SimpleDbStore happen within the context of this\r\n * transaction and it cannot be used anymore once the transaction is\r\n * completed.\r\n *\r\n * Note that we can't actually enforce that the KeyType and ValueType are\r\n * correct, but they allow type safety through the rest of the consuming code.\r\n */\r\n store(storeName) {\r\n const store = this.transaction.objectStore(storeName);\r\n return new SimpleDbStore(store);\r\n }\r\n}\r\n/**\r\n * Provides a wrapper around IndexedDb with a simplified interface that uses\r\n * Promise-like return values to chain operations. Real promises cannot be used\r\n * since .then() continuations are executed asynchronously (e.g. via\r\n * .setImmediate), which would cause IndexedDB to end the transaction.\r\n * See PersistencePromise for more details.\r\n */\r\nclass SimpleDb {\r\n /*\r\n * Creates a new SimpleDb wrapper for IndexedDb database `name`.\r\n *\r\n * Note that `version` must not be a downgrade. IndexedDB does not support\r\n * downgrading the schema version. We currently do not support any way to do\r\n * versioning outside of IndexedDB's versioning mechanism, as only\r\n * version-upgrade transactions are allowed to do things like create\r\n * objectstores.\r\n */\r\n constructor(name, version, schemaConverter) {\r\n this.name = name;\r\n this.version = version;\r\n this.schemaConverter = schemaConverter;\r\n const iOSVersion = SimpleDb.getIOSVersion(getUA());\r\n // NOTE: According to https://bugs.webkit.org/show_bug.cgi?id=197050, the\r\n // bug we're checking for should exist in iOS >= 12.2 and < 13, but for\r\n // whatever reason it's much harder to hit after 12.2 so we only proactively\r\n // log on 12.2.\r\n if (iOSVersion === 12.2) {\r\n logError('Firestore persistence suffers from a bug in iOS 12.2 ' +\r\n 'Safari that may cause your app to stop working. See ' +\r\n 'https://stackoverflow.com/q/56496296/110915 for details ' +\r\n 'and a potential workaround.');\r\n }\r\n }\r\n /** Deletes the specified database. */\r\n static delete(name) {\r\n logDebug(LOG_TAG$g, 'Removing database:', name);\r\n return wrapRequest(window.indexedDB.deleteDatabase(name)).toPromise();\r\n }\r\n /** Returns true if IndexedDB is available in the current environment. */\r\n static isAvailable() {\r\n if (!isIndexedDBAvailable()) {\r\n return false;\r\n }\r\n if (SimpleDb.isMockPersistence()) {\r\n return true;\r\n }\r\n // We extensively use indexed array values and compound keys,\r\n // which IE and Edge do not support. However, they still have indexedDB\r\n // defined on the window, so we need to check for them here and make sure\r\n // to return that persistence is not enabled for those browsers.\r\n // For tracking support of this feature, see here:\r\n // https://developer.microsoft.com/en-us/microsoft-edge/platform/status/indexeddbarraysandmultientrysupport/\r\n // Check the UA string to find out the browser.\r\n const ua = getUA();\r\n // IE 10\r\n // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\r\n // IE 11\r\n // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\r\n // Edge\r\n // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML,\r\n // like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\r\n // iOS Safari: Disable for users running iOS version < 10.\r\n const iOSVersion = SimpleDb.getIOSVersion(ua);\r\n const isUnsupportedIOS = 0 < iOSVersion && iOSVersion < 10;\r\n // Android browser: Disable for userse running version < 4.5.\r\n const androidVersion = SimpleDb.getAndroidVersion(ua);\r\n const isUnsupportedAndroid = 0 < androidVersion && androidVersion < 4.5;\r\n if (ua.indexOf('MSIE ') > 0 ||\r\n ua.indexOf('Trident/') > 0 ||\r\n ua.indexOf('Edge/') > 0 ||\r\n isUnsupportedIOS ||\r\n isUnsupportedAndroid) {\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n }\r\n /**\r\n * Returns true if the backing IndexedDB store is the Node IndexedDBShim\r\n * (see https://github.com/axemclion/IndexedDBShim).\r\n */\r\n static isMockPersistence() {\r\n var _a;\r\n return (typeof process !== 'undefined' &&\r\n ((_a = process.env) === null || _a === void 0 ? void 0 : _a.USE_MOCK_PERSISTENCE) === 'YES');\r\n }\r\n /** Helper to get a typed SimpleDbStore from a transaction. */\r\n static getStore(txn, store) {\r\n return txn.store(store);\r\n }\r\n // visible for testing\r\n /** Parse User Agent to determine iOS version. Returns -1 if not found. */\r\n static getIOSVersion(ua) {\r\n const iOSVersionRegex = ua.match(/i(?:phone|pad|pod) os ([\\d_]+)/i);\r\n const version = iOSVersionRegex\r\n ? iOSVersionRegex[1].split('_').slice(0, 2).join('.')\r\n : '-1';\r\n return Number(version);\r\n }\r\n // visible for testing\r\n /** Parse User Agent to determine Android version. Returns -1 if not found. */\r\n static getAndroidVersion(ua) {\r\n const androidVersionRegex = ua.match(/Android ([\\d.]+)/i);\r\n const version = androidVersionRegex\r\n ? androidVersionRegex[1].split('.').slice(0, 2).join('.')\r\n : '-1';\r\n return Number(version);\r\n }\r\n /**\r\n * Opens the specified database, creating or upgrading it if necessary.\r\n */\r\n async ensureDb(action) {\r\n if (!this.db) {\r\n logDebug(LOG_TAG$g, 'Opening database:', this.name);\r\n this.db = await new Promise((resolve, reject) => {\r\n // TODO(mikelehen): Investigate browser compatibility.\r\n // https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB\r\n // suggests IE9 and older WebKit browsers handle upgrade\r\n // differently. They expect setVersion, as described here:\r\n // https://developer.mozilla.org/en-US/docs/Web/API/IDBVersionChangeRequest/setVersion\r\n const request = indexedDB.open(this.name, this.version);\r\n request.onsuccess = (event) => {\r\n const db = event.target.result;\r\n resolve(db);\r\n };\r\n request.onblocked = () => {\r\n reject(new IndexedDbTransactionError(action, 'Cannot upgrade IndexedDB schema while another tab is open. ' +\r\n 'Close all tabs that access Firestore and reload this page to proceed.'));\r\n };\r\n request.onerror = (event) => {\r\n const error = event.target.error;\r\n if (error.name === 'VersionError') {\r\n reject(new FirestoreError(Code.FAILED_PRECONDITION, 'A newer version of the Firestore SDK was previously used and so the persisted ' +\r\n 'data is not compatible with the version of the SDK you are now using. The SDK ' +\r\n 'will operate with persistence disabled. If you need persistence, please ' +\r\n 're-upgrade to a newer version of the SDK or else clear the persisted IndexedDB ' +\r\n 'data for your app to start fresh.'));\r\n }\r\n else if (error.name === 'InvalidStateError') {\r\n reject(new FirestoreError(Code.FAILED_PRECONDITION, 'Unable to open an IndexedDB connection. This could be due to running in a ' +\r\n 'private browsing session on a browser whose private browsing sessions do not ' +\r\n 'support IndexedDB: ' +\r\n error));\r\n }\r\n else {\r\n reject(new IndexedDbTransactionError(action, error));\r\n }\r\n };\r\n request.onupgradeneeded = (event) => {\r\n logDebug(LOG_TAG$g, 'Database \"' + this.name + '\" requires upgrade from version:', event.oldVersion);\r\n const db = event.target.result;\r\n this.schemaConverter\r\n .createOrUpgrade(db, request.transaction, event.oldVersion, this.version)\r\n .next(() => {\r\n logDebug(LOG_TAG$g, 'Database upgrade to version ' + this.version + ' complete');\r\n });\r\n };\r\n });\r\n }\r\n if (this.versionchangelistener) {\r\n this.db.onversionchange = event => this.versionchangelistener(event);\r\n }\r\n return this.db;\r\n }\r\n setVersionChangeListener(versionChangeListener) {\r\n this.versionchangelistener = versionChangeListener;\r\n if (this.db) {\r\n this.db.onversionchange = (event) => {\r\n return versionChangeListener(event);\r\n };\r\n }\r\n }\r\n async runTransaction(action, mode, objectStores, transactionFn) {\r\n const readonly = mode === 'readonly';\r\n let attemptNumber = 0;\r\n while (true) {\r\n ++attemptNumber;\r\n try {\r\n this.db = await this.ensureDb(action);\r\n const transaction = SimpleDbTransaction.open(this.db, action, readonly ? 'readonly' : 'readwrite', objectStores);\r\n const transactionFnResult = transactionFn(transaction)\r\n .catch(error => {\r\n // Abort the transaction if there was an error.\r\n transaction.abort(error);\r\n // We cannot actually recover, and calling `abort()` will cause the transaction's\r\n // completion promise to be rejected. This in turn means that we won't use\r\n // `transactionFnResult` below. We return a rejection here so that we don't add the\r\n // possibility of returning `void` to the type of `transactionFnResult`.\r\n return PersistencePromise.reject(error);\r\n })\r\n .toPromise();\r\n // As noted above, errors are propagated by aborting the transaction. So\r\n // we swallow any error here to avoid the browser logging it as unhandled.\r\n transactionFnResult.catch(() => { });\r\n // Wait for the transaction to complete (i.e. IndexedDb's onsuccess event to\r\n // fire), but still return the original transactionFnResult back to the\r\n // caller.\r\n await transaction.completionPromise;\r\n return transactionFnResult;\r\n }\r\n catch (error) {\r\n // TODO(schmidt-sebastian): We could probably be smarter about this and\r\n // not retry exceptions that are likely unrecoverable (such as quota\r\n // exceeded errors).\r\n // Note: We cannot use an instanceof check for FirestoreException, since the\r\n // exception is wrapped in a generic error by our async/await handling.\r\n const retryable = error.name !== 'FirebaseError' &&\r\n attemptNumber < TRANSACTION_RETRY_COUNT;\r\n logDebug(LOG_TAG$g, 'Transaction failed with error:', error.message, 'Retrying:', retryable);\r\n this.close();\r\n if (!retryable) {\r\n return Promise.reject(error);\r\n }\r\n }\r\n }\r\n }\r\n close() {\r\n if (this.db) {\r\n this.db.close();\r\n }\r\n this.db = undefined;\r\n }\r\n}\r\n/**\r\n * A controller for iterating over a key range or index. It allows an iterate\r\n * callback to delete the currently-referenced object, or jump to a new key\r\n * within the key range or index.\r\n */\r\nclass IterationController {\r\n constructor(dbCursor) {\r\n this.dbCursor = dbCursor;\r\n this.shouldStop = false;\r\n this.nextKey = null;\r\n }\r\n get isDone() {\r\n return this.shouldStop;\r\n }\r\n get skipToKey() {\r\n return this.nextKey;\r\n }\r\n set cursor(value) {\r\n this.dbCursor = value;\r\n }\r\n /**\r\n * This function can be called to stop iteration at any point.\r\n */\r\n done() {\r\n this.shouldStop = true;\r\n }\r\n /**\r\n * This function can be called to skip to that next key, which could be\r\n * an index or a primary key.\r\n */\r\n skip(key) {\r\n this.nextKey = key;\r\n }\r\n /**\r\n * Delete the current cursor value from the object store.\r\n *\r\n * NOTE: You CANNOT do this with a keysOnly query.\r\n */\r\n delete() {\r\n return wrapRequest(this.dbCursor.delete());\r\n }\r\n}\r\n/** An error that wraps exceptions that thrown during IndexedDB execution. */\r\nclass IndexedDbTransactionError extends FirestoreError {\r\n constructor(actionName, cause) {\r\n super(Code.UNAVAILABLE, `IndexedDB transaction '${actionName}' failed: ${cause}`);\r\n this.name = 'IndexedDbTransactionError';\r\n }\r\n}\r\n/** Verifies whether `e` is an IndexedDbTransactionError. */\r\nfunction isIndexedDbTransactionError(e) {\r\n // Use name equality, as instanceof checks on errors don't work with errors\r\n // that wrap other errors.\r\n return e.name === 'IndexedDbTransactionError';\r\n}\r\n/**\r\n * A wrapper around an IDBObjectStore providing an API that:\r\n *\r\n * 1) Has generic KeyType / ValueType parameters to provide strongly-typed\r\n * methods for acting against the object store.\r\n * 2) Deals with IndexedDB's onsuccess / onerror event callbacks, making every\r\n * method return a PersistencePromise instead.\r\n * 3) Provides a higher-level API to avoid needing to do excessive wrapping of\r\n * intermediate IndexedDB types (IDBCursorWithValue, etc.)\r\n */\r\nclass SimpleDbStore {\r\n constructor(store) {\r\n this.store = store;\r\n }\r\n put(keyOrValue, value) {\r\n let request;\r\n if (value !== undefined) {\r\n logDebug(LOG_TAG$g, 'PUT', this.store.name, keyOrValue, value);\r\n request = this.store.put(value, keyOrValue);\r\n }\r\n else {\r\n logDebug(LOG_TAG$g, 'PUT', this.store.name, '<auto-key>', keyOrValue);\r\n request = this.store.put(keyOrValue);\r\n }\r\n return wrapRequest(request);\r\n }\r\n /**\r\n * Adds a new value into an Object Store and returns the new key. Similar to\r\n * IndexedDb's `add()`, this method will fail on primary key collisions.\r\n *\r\n * @param value - The object to write.\r\n * @returns The key of the value to add.\r\n */\r\n add(value) {\r\n logDebug(LOG_TAG$g, 'ADD', this.store.name, value, value);\r\n const request = this.store.add(value);\r\n return wrapRequest(request);\r\n }\r\n /**\r\n * Gets the object with the specified key from the specified store, or null\r\n * if no object exists with the specified key.\r\n *\r\n * @key The key of the object to get.\r\n * @returns The object with the specified key or null if no object exists.\r\n */\r\n get(key) {\r\n const request = this.store.get(key);\r\n // We're doing an unsafe cast to ValueType.\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n return wrapRequest(request).next(result => {\r\n // Normalize nonexistence to null.\r\n if (result === undefined) {\r\n result = null;\r\n }\r\n logDebug(LOG_TAG$g, 'GET', this.store.name, key, result);\r\n return result;\r\n });\r\n }\r\n delete(key) {\r\n logDebug(LOG_TAG$g, 'DELETE', this.store.name, key);\r\n const request = this.store.delete(key);\r\n return wrapRequest(request);\r\n }\r\n /**\r\n * If we ever need more of the count variants, we can add overloads. For now,\r\n * all we need is to count everything in a store.\r\n *\r\n * Returns the number of rows in the store.\r\n */\r\n count() {\r\n logDebug(LOG_TAG$g, 'COUNT', this.store.name);\r\n const request = this.store.count();\r\n return wrapRequest(request);\r\n }\r\n loadAll(indexOrRange, range) {\r\n const cursor = this.cursor(this.options(indexOrRange, range));\r\n const results = [];\r\n return this.iterateCursor(cursor, (key, value) => {\r\n results.push(value);\r\n }).next(() => {\r\n return results;\r\n });\r\n }\r\n deleteAll(indexOrRange, range) {\r\n logDebug(LOG_TAG$g, 'DELETE ALL', this.store.name);\r\n const options = this.options(indexOrRange, range);\r\n options.keysOnly = false;\r\n const cursor = this.cursor(options);\r\n return this.iterateCursor(cursor, (key, value, control) => {\r\n // NOTE: Calling delete() on a cursor is documented as more efficient than\r\n // calling delete() on an object store with a single key\r\n // (https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/delete),\r\n // however, this requires us *not* to use a keysOnly cursor\r\n // (https://developer.mozilla.org/en-US/docs/Web/API/IDBCursor/delete). We\r\n // may want to compare the performance of each method.\r\n return control.delete();\r\n });\r\n }\r\n iterate(optionsOrCallback, callback) {\r\n let options;\r\n if (!callback) {\r\n options = {};\r\n callback = optionsOrCallback;\r\n }\r\n else {\r\n options = optionsOrCallback;\r\n }\r\n const cursor = this.cursor(options);\r\n return this.iterateCursor(cursor, callback);\r\n }\r\n /**\r\n * Iterates over a store, but waits for the given callback to complete for\r\n * each entry before iterating the next entry. This allows the callback to do\r\n * asynchronous work to determine if this iteration should continue.\r\n *\r\n * The provided callback should return `true` to continue iteration, and\r\n * `false` otherwise.\r\n */\r\n iterateSerial(callback) {\r\n const cursorRequest = this.cursor({});\r\n return new PersistencePromise((resolve, reject) => {\r\n cursorRequest.onerror = (event) => {\r\n const error = checkForAndReportiOSError(event.target.error);\r\n reject(error);\r\n };\r\n cursorRequest.onsuccess = (event) => {\r\n const cursor = event.target.result;\r\n if (!cursor) {\r\n resolve();\r\n return;\r\n }\r\n callback(cursor.primaryKey, cursor.value).next(shouldContinue => {\r\n if (shouldContinue) {\r\n cursor.continue();\r\n }\r\n else {\r\n resolve();\r\n }\r\n });\r\n };\r\n });\r\n }\r\n iterateCursor(cursorRequest, fn) {\r\n const results = [];\r\n return new PersistencePromise((resolve, reject) => {\r\n cursorRequest.onerror = (event) => {\r\n reject(event.target.error);\r\n };\r\n cursorRequest.onsuccess = (event) => {\r\n const cursor = event.target.result;\r\n if (!cursor) {\r\n resolve();\r\n return;\r\n }\r\n const controller = new IterationController(cursor);\r\n const userResult = fn(cursor.primaryKey, cursor.value, controller);\r\n if (userResult instanceof PersistencePromise) {\r\n const userPromise = userResult.catch(err => {\r\n controller.done();\r\n return PersistencePromise.reject(err);\r\n });\r\n results.push(userPromise);\r\n }\r\n if (controller.isDone) {\r\n resolve();\r\n }\r\n else if (controller.skipToKey === null) {\r\n cursor.continue();\r\n }\r\n else {\r\n cursor.continue(controller.skipToKey);\r\n }\r\n };\r\n }).next(() => {\r\n return PersistencePromise.waitFor(results);\r\n });\r\n }\r\n options(indexOrRange, range) {\r\n let indexName = undefined;\r\n if (indexOrRange !== undefined) {\r\n if (typeof indexOrRange === 'string') {\r\n indexName = indexOrRange;\r\n }\r\n else {\r\n range = indexOrRange;\r\n }\r\n }\r\n return { index: indexName, range };\r\n }\r\n cursor(options) {\r\n let direction = 'next';\r\n if (options.reverse) {\r\n direction = 'prev';\r\n }\r\n if (options.index) {\r\n const index = this.store.index(options.index);\r\n if (options.keysOnly) {\r\n return index.openKeyCursor(options.range, direction);\r\n }\r\n else {\r\n return index.openCursor(options.range, direction);\r\n }\r\n }\r\n else {\r\n return this.store.openCursor(options.range, direction);\r\n }\r\n }\r\n}\r\n/**\r\n * Wraps an IDBRequest in a PersistencePromise, using the onsuccess / onerror\r\n * handlers to resolve / reject the PersistencePromise as appropriate.\r\n */\r\nfunction wrapRequest(request) {\r\n return new PersistencePromise((resolve, reject) => {\r\n request.onsuccess = (event) => {\r\n const result = event.target.result;\r\n resolve(result);\r\n };\r\n request.onerror = (event) => {\r\n const error = checkForAndReportiOSError(event.target.error);\r\n reject(error);\r\n };\r\n });\r\n}\r\n// Guard so we only report the error once.\r\nlet reportedIOSError = false;\r\nfunction checkForAndReportiOSError(error) {\r\n const iOSVersion = SimpleDb.getIOSVersion(getUA());\r\n if (iOSVersion >= 12.2 && iOSVersion < 13) {\r\n const IOS_ERROR = 'An internal error was encountered in the Indexed Database server';\r\n if (error.message.indexOf(IOS_ERROR) >= 0) {\r\n // Wrap error in a more descriptive one.\r\n const newError = new FirestoreError('internal', `IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${IOS_ERROR}'. This is likely ` +\r\n `due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 ` +\r\n `for details and a potential workaround.`);\r\n if (!reportedIOSError) {\r\n reportedIOSError = true;\r\n // Throw a global exception outside of this promise chain, for the user to\r\n // potentially catch.\r\n setTimeout(() => {\r\n throw newError;\r\n }, 0);\r\n }\r\n return newError;\r\n }\r\n }\r\n return error;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nclass IndexedDbTransaction extends PersistenceTransaction {\r\n constructor(simpleDbTransaction, currentSequenceNumber) {\r\n super();\r\n this.simpleDbTransaction = simpleDbTransaction;\r\n this.currentSequenceNumber = currentSequenceNumber;\r\n }\r\n}\r\nfunction getStore(txn, store) {\r\n const indexedDbTransaction = debugCast(txn);\r\n return SimpleDb.getStore(indexedDbTransaction.simpleDbTransaction, store);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Generates `nBytes` of random bytes.\r\n *\r\n * If `nBytes < 0` , an error will be thrown.\r\n */\r\nfunction randomBytes(nBytes) {\r\n return randomBytes$1(nBytes);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nclass AutoId {\r\n static newId() {\r\n // Alphanumeric characters\r\n const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\r\n // The largest byte value that is a multiple of `char.length`.\r\n const maxMultiple = Math.floor(256 / chars.length) * chars.length;\r\n let autoId = '';\r\n const targetLength = 20;\r\n while (autoId.length < targetLength) {\r\n const bytes = randomBytes(40);\r\n for (let i = 0; i < bytes.length; ++i) {\r\n // Only accept values that are [0, maxMultiple), this ensures they can\r\n // be evenly mapped to indices of `chars` via a modulo operation.\r\n if (autoId.length < targetLength && bytes[i] < maxMultiple) {\r\n autoId += chars.charAt(bytes[i] % chars.length);\r\n }\r\n }\r\n }\r\n return autoId;\r\n }\r\n}\r\nfunction primitiveComparator(left, right) {\r\n if (left < right) {\r\n return -1;\r\n }\r\n if (left > right) {\r\n return 1;\r\n }\r\n return 0;\r\n}\r\n/** Helper to compare arrays using isEqual(). */\r\nfunction arrayEquals(left, right, comparator) {\r\n if (left.length !== right.length) {\r\n return false;\r\n }\r\n return left.every((value, index) => comparator(value, right[index]));\r\n}\r\n/**\r\n * Returns the immediate lexicographically-following string. This is useful to\r\n * construct an inclusive range for indexeddb iterators.\r\n */\r\nfunction immediateSuccessor(s) {\r\n // Return the input string, with an additional NUL byte appended.\r\n return s + '\\0';\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// The earliest date supported by Firestore timestamps (0001-01-01T00:00:00Z).\r\nconst MIN_SECONDS = -62135596800;\r\n// Number of nanoseconds in a millisecond.\r\nconst MS_TO_NANOS = 1e6;\r\n/**\r\n * A `Timestamp` represents a point in time independent of any time zone or\r\n * calendar, represented as seconds and fractions of seconds at nanosecond\r\n * resolution in UTC Epoch time.\r\n *\r\n * It is encoded using the Proleptic Gregorian Calendar which extends the\r\n * Gregorian calendar backwards to year one. It is encoded assuming all minutes\r\n * are 60 seconds long, i.e. leap seconds are \"smeared\" so that no leap second\r\n * table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to\r\n * 9999-12-31T23:59:59.999999999Z.\r\n *\r\n * For examples and further specifications, refer to the\r\n * {@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto | Timestamp definition}.\r\n */\r\nclass Timestamp {\r\n /**\r\n * Creates a new timestamp.\r\n *\r\n * @param seconds - The number of seconds of UTC time since Unix epoch\r\n * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\r\n * 9999-12-31T23:59:59Z inclusive.\r\n * @param nanoseconds - The non-negative fractions of a second at nanosecond\r\n * resolution. Negative second values with fractions must still have\r\n * non-negative nanoseconds values that count forward in time. Must be\r\n * from 0 to 999,999,999 inclusive.\r\n */\r\n constructor(\r\n /**\r\n * The number of seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z.\r\n */\r\n seconds, \r\n /**\r\n * The fractions of a second at nanosecond resolution.*\r\n */\r\n nanoseconds) {\r\n this.seconds = seconds;\r\n this.nanoseconds = nanoseconds;\r\n if (nanoseconds < 0) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Timestamp nanoseconds out of range: ' + nanoseconds);\r\n }\r\n if (nanoseconds >= 1e9) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Timestamp nanoseconds out of range: ' + nanoseconds);\r\n }\r\n if (seconds < MIN_SECONDS) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Timestamp seconds out of range: ' + seconds);\r\n }\r\n // This will break in the year 10,000.\r\n if (seconds >= 253402300800) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Timestamp seconds out of range: ' + seconds);\r\n }\r\n }\r\n /**\r\n * Creates a new timestamp with the current date, with millisecond precision.\r\n *\r\n * @returns a new timestamp representing the current date.\r\n */\r\n static now() {\r\n return Timestamp.fromMillis(Date.now());\r\n }\r\n /**\r\n * Creates a new timestamp from the given date.\r\n *\r\n * @param date - The date to initialize the `Timestamp` from.\r\n * @returns A new `Timestamp` representing the same point in time as the given\r\n * date.\r\n */\r\n static fromDate(date) {\r\n return Timestamp.fromMillis(date.getTime());\r\n }\r\n /**\r\n * Creates a new timestamp from the given number of milliseconds.\r\n *\r\n * @param milliseconds - Number of milliseconds since Unix epoch\r\n * 1970-01-01T00:00:00Z.\r\n * @returns A new `Timestamp` representing the same point in time as the given\r\n * number of milliseconds.\r\n */\r\n static fromMillis(milliseconds) {\r\n const seconds = Math.floor(milliseconds / 1000);\r\n const nanos = Math.floor((milliseconds - seconds * 1000) * MS_TO_NANOS);\r\n return new Timestamp(seconds, nanos);\r\n }\r\n /**\r\n * Converts a `Timestamp` to a JavaScript `Date` object. This conversion\r\n * causes a loss of precision since `Date` objects only support millisecond\r\n * precision.\r\n *\r\n * @returns JavaScript `Date` object representing the same point in time as\r\n * this `Timestamp`, with millisecond precision.\r\n */\r\n toDate() {\r\n return new Date(this.toMillis());\r\n }\r\n /**\r\n * Converts a `Timestamp` to a numeric timestamp (in milliseconds since\r\n * epoch). This operation causes a loss of precision.\r\n *\r\n * @returns The point in time corresponding to this timestamp, represented as\r\n * the number of milliseconds since Unix epoch 1970-01-01T00:00:00Z.\r\n */\r\n toMillis() {\r\n return this.seconds * 1000 + this.nanoseconds / MS_TO_NANOS;\r\n }\r\n _compareTo(other) {\r\n if (this.seconds === other.seconds) {\r\n return primitiveComparator(this.nanoseconds, other.nanoseconds);\r\n }\r\n return primitiveComparator(this.seconds, other.seconds);\r\n }\r\n /**\r\n * Returns true if this `Timestamp` is equal to the provided one.\r\n *\r\n * @param other - The `Timestamp` to compare against.\r\n * @returns true if this `Timestamp` is equal to the provided one.\r\n */\r\n isEqual(other) {\r\n return (other.seconds === this.seconds && other.nanoseconds === this.nanoseconds);\r\n }\r\n /** Returns a textual representation of this `Timestamp`. */\r\n toString() {\r\n return ('Timestamp(seconds=' +\r\n this.seconds +\r\n ', nanoseconds=' +\r\n this.nanoseconds +\r\n ')');\r\n }\r\n /** Returns a JSON-serializable representation of this `Timestamp`. */\r\n toJSON() {\r\n return { seconds: this.seconds, nanoseconds: this.nanoseconds };\r\n }\r\n /**\r\n * Converts this object to a primitive string, which allows `Timestamp` objects\r\n * to be compared using the `>`, `<=`, `>=` and `>` operators.\r\n */\r\n valueOf() {\r\n // This method returns a string of the form <seconds>.<nanoseconds> where\r\n // <seconds> is translated to have a non-negative value and both <seconds>\r\n // and <nanoseconds> are left-padded with zeroes to be a consistent length.\r\n // Strings with this format then have a lexiographical ordering that matches\r\n // the expected ordering. The <seconds> translation is done to avoid having\r\n // a leading negative sign (i.e. a leading '-' character) in its string\r\n // representation, which would affect its lexiographical ordering.\r\n const adjustedSeconds = this.seconds - MIN_SECONDS;\r\n // Note: Up to 12 decimal digits are required to represent all valid\r\n // 'seconds' values.\r\n const formattedSeconds = String(adjustedSeconds).padStart(12, '0');\r\n const formattedNanoseconds = String(this.nanoseconds).padStart(9, '0');\r\n return formattedSeconds + '.' + formattedNanoseconds;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A version of a document in Firestore. This corresponds to the version\r\n * timestamp, such as update_time or read_time.\r\n */\r\nclass SnapshotVersion {\r\n constructor(timestamp) {\r\n this.timestamp = timestamp;\r\n }\r\n static fromTimestamp(value) {\r\n return new SnapshotVersion(value);\r\n }\r\n static min() {\r\n return new SnapshotVersion(new Timestamp(0, 0));\r\n }\r\n compareTo(other) {\r\n return this.timestamp._compareTo(other.timestamp);\r\n }\r\n isEqual(other) {\r\n return this.timestamp.isEqual(other.timestamp);\r\n }\r\n /** Returns a number representation of the version for use in spec tests. */\r\n toMicroseconds() {\r\n // Convert to microseconds.\r\n return this.timestamp.seconds * 1e6 + this.timestamp.nanoseconds / 1000;\r\n }\r\n toString() {\r\n return 'SnapshotVersion(' + this.timestamp.toString() + ')';\r\n }\r\n toTimestamp() {\r\n return this.timestamp;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction objectSize(obj) {\r\n let count = 0;\r\n for (const key in obj) {\r\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\r\n count++;\r\n }\r\n }\r\n return count;\r\n}\r\nfunction forEach(obj, fn) {\r\n for (const key in obj) {\r\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\r\n fn(key, obj[key]);\r\n }\r\n }\r\n}\r\nfunction isEmpty(obj) {\r\n for (const key in obj) {\r\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Provides a set of fields that can be used to partially patch a document.\r\n * FieldMask is used in conjunction with ObjectValue.\r\n * Examples:\r\n * foo - Overwrites foo entirely with the provided value. If foo is not\r\n * present in the companion ObjectValue, the field is deleted.\r\n * foo.bar - Overwrites only the field bar of the object foo.\r\n * If foo is not an object, foo is replaced with an object\r\n * containing foo\r\n */\r\nclass FieldMask {\r\n constructor(fields) {\r\n this.fields = fields;\r\n // TODO(dimond): validation of FieldMask\r\n // Sort the field mask to support `FieldMask.isEqual()` and assert below.\r\n fields.sort(FieldPath$1.comparator);\r\n }\r\n /**\r\n * Verifies that `fieldPath` is included by at least one field in this field\r\n * mask.\r\n *\r\n * This is an O(n) operation, where `n` is the size of the field mask.\r\n */\r\n covers(fieldPath) {\r\n for (const fieldMaskPath of this.fields) {\r\n if (fieldMaskPath.isPrefixOf(fieldPath)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n isEqual(other) {\r\n return arrayEquals(this.fields, other.fields, (l, r) => l.isEqual(r));\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction decodeBase64(encoded) {\r\n // Node actually doesn't validate base64 strings.\r\n // A quick sanity check that is not a fool-proof validation\r\n if (/[^-A-Za-z0-9+/=]/.test(encoded)) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Not a valid Base64 string: ' + encoded);\r\n }\r\n return new Buffer(encoded, 'base64').toString('binary');\r\n}\r\n/** Converts a binary string to a Base64 encoded string. */\r\nfunction encodeBase64(raw) {\r\n return new Buffer(raw, 'binary').toString('base64');\r\n}\r\n/** True if and only if the Base64 conversion functions are available. */\r\nfunction isBase64Available() {\r\n return true;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Immutable class that represents a \"proto\" byte string.\r\n *\r\n * Proto byte strings can either be Base64-encoded strings or Uint8Arrays when\r\n * sent on the wire. This class abstracts away this differentiation by holding\r\n * the proto byte string in a common class that must be converted into a string\r\n * before being sent as a proto.\r\n * @internal\r\n */\r\nclass ByteString {\r\n constructor(binaryString) {\r\n this.binaryString = binaryString;\r\n }\r\n static fromBase64String(base64) {\r\n const binaryString = decodeBase64(base64);\r\n return new ByteString(binaryString);\r\n }\r\n static fromUint8Array(array) {\r\n const binaryString = binaryStringFromUint8Array(array);\r\n return new ByteString(binaryString);\r\n }\r\n toBase64() {\r\n return encodeBase64(this.binaryString);\r\n }\r\n toUint8Array() {\r\n return uint8ArrayFromBinaryString(this.binaryString);\r\n }\r\n approximateByteSize() {\r\n return this.binaryString.length * 2;\r\n }\r\n compareTo(other) {\r\n return primitiveComparator(this.binaryString, other.binaryString);\r\n }\r\n isEqual(other) {\r\n return this.binaryString === other.binaryString;\r\n }\r\n}\r\nByteString.EMPTY_BYTE_STRING = new ByteString('');\r\n/**\r\n * Helper function to convert an Uint8array to a binary string.\r\n */\r\nfunction binaryStringFromUint8Array(array) {\r\n let binaryString = '';\r\n for (let i = 0; i < array.length; ++i) {\r\n binaryString += String.fromCharCode(array[i]);\r\n }\r\n return binaryString;\r\n}\r\n/**\r\n * Helper function to convert a binary string to an Uint8Array.\r\n */\r\nfunction uint8ArrayFromBinaryString(binaryString) {\r\n const buffer = new Uint8Array(binaryString.length);\r\n for (let i = 0; i < binaryString.length; i++) {\r\n buffer[i] = binaryString.charCodeAt(i);\r\n }\r\n return buffer;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// A RegExp matching ISO 8601 UTC timestamps with optional fraction.\r\nconst ISO_TIMESTAMP_REG_EXP = new RegExp(/^\\d{4}-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\d(?:\\.(\\d+))?Z$/);\r\n/**\r\n * Converts the possible Proto values for a timestamp value into a \"seconds and\r\n * nanos\" representation.\r\n */\r\nfunction normalizeTimestamp(date) {\r\n hardAssert(!!date);\r\n // The json interface (for the browser) will return an iso timestamp string,\r\n // while the proto js library (for node) will return a\r\n // google.protobuf.Timestamp instance.\r\n if (typeof date === 'string') {\r\n // The date string can have higher precision (nanos) than the Date class\r\n // (millis), so we do some custom parsing here.\r\n // Parse the nanos right out of the string.\r\n let nanos = 0;\r\n const fraction = ISO_TIMESTAMP_REG_EXP.exec(date);\r\n hardAssert(!!fraction);\r\n if (fraction[1]) {\r\n // Pad the fraction out to 9 digits (nanos).\r\n let nanoStr = fraction[1];\r\n nanoStr = (nanoStr + '000000000').substr(0, 9);\r\n nanos = Number(nanoStr);\r\n }\r\n // Parse the date to get the seconds.\r\n const parsedDate = new Date(date);\r\n const seconds = Math.floor(parsedDate.getTime() / 1000);\r\n return { seconds, nanos };\r\n }\r\n else {\r\n // TODO(b/37282237): Use strings for Proto3 timestamps\r\n // assert(!this.options.useProto3Json,\r\n // 'The timestamp instance format requires Proto JS.');\r\n const seconds = normalizeNumber(date.seconds);\r\n const nanos = normalizeNumber(date.nanos);\r\n return { seconds, nanos };\r\n }\r\n}\r\n/**\r\n * Converts the possible Proto types for numbers into a JavaScript number.\r\n * Returns 0 if the value is not numeric.\r\n */\r\nfunction normalizeNumber(value) {\r\n // TODO(bjornick): Handle int64 greater than 53 bits.\r\n if (typeof value === 'number') {\r\n return value;\r\n }\r\n else if (typeof value === 'string') {\r\n return Number(value);\r\n }\r\n else {\r\n return 0;\r\n }\r\n}\r\n/** Converts the possible Proto types for Blobs into a ByteString. */\r\nfunction normalizeByteString(blob) {\r\n if (typeof blob === 'string') {\r\n return ByteString.fromBase64String(blob);\r\n }\r\n else {\r\n return ByteString.fromUint8Array(blob);\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Represents a locally-applied ServerTimestamp.\r\n *\r\n * Server Timestamps are backed by MapValues that contain an internal field\r\n * `__type__` with a value of `server_timestamp`. The previous value and local\r\n * write time are stored in its `__previous_value__` and `__local_write_time__`\r\n * fields respectively.\r\n *\r\n * Notes:\r\n * - ServerTimestampValue instances are created as the result of applying a\r\n * transform. They can only exist in the local view of a document. Therefore\r\n * they do not need to be parsed or serialized.\r\n * - When evaluated locally (e.g. for snapshot.data()), they by default\r\n * evaluate to `null`. This behavior can be configured by passing custom\r\n * FieldValueOptions to value().\r\n * - With respect to other ServerTimestampValues, they sort by their\r\n * localWriteTime.\r\n */\r\nconst SERVER_TIMESTAMP_SENTINEL = 'server_timestamp';\r\nconst TYPE_KEY = '__type__';\r\nconst PREVIOUS_VALUE_KEY = '__previous_value__';\r\nconst LOCAL_WRITE_TIME_KEY = '__local_write_time__';\r\nfunction isServerTimestamp(value) {\r\n var _a, _b;\r\n const type = (_b = (((_a = value === null || value === void 0 ? void 0 : value.mapValue) === null || _a === void 0 ? void 0 : _a.fields) || {})[TYPE_KEY]) === null || _b === void 0 ? void 0 : _b.stringValue;\r\n return type === SERVER_TIMESTAMP_SENTINEL;\r\n}\r\n/**\r\n * Creates a new ServerTimestamp proto value (using the internal format).\r\n */\r\nfunction serverTimestamp$1(localWriteTime, previousValue) {\r\n const mapValue = {\r\n fields: {\r\n [TYPE_KEY]: {\r\n stringValue: SERVER_TIMESTAMP_SENTINEL\r\n },\r\n [LOCAL_WRITE_TIME_KEY]: {\r\n timestampValue: {\r\n seconds: localWriteTime.seconds,\r\n nanos: localWriteTime.nanoseconds\r\n }\r\n }\r\n }\r\n };\r\n if (previousValue) {\r\n mapValue.fields[PREVIOUS_VALUE_KEY] = previousValue;\r\n }\r\n return { mapValue };\r\n}\r\n/**\r\n * Returns the value of the field before this ServerTimestamp was set.\r\n *\r\n * Preserving the previous values allows the user to display the last resoled\r\n * value until the backend responds with the timestamp.\r\n */\r\nfunction getPreviousValue(value) {\r\n const previousValue = value.mapValue.fields[PREVIOUS_VALUE_KEY];\r\n if (isServerTimestamp(previousValue)) {\r\n return getPreviousValue(previousValue);\r\n }\r\n return previousValue;\r\n}\r\n/**\r\n * Returns the local time at which this timestamp was first set.\r\n */\r\nfunction getLocalWriteTime(value) {\r\n const localWriteTime = normalizeTimestamp(value.mapValue.fields[LOCAL_WRITE_TIME_KEY].timestampValue);\r\n return new Timestamp(localWriteTime.seconds, localWriteTime.nanos);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/** Sentinel value that sorts before any Mutation Batch ID. */\r\nconst BATCHID_UNKNOWN = -1;\r\n/**\r\n * Returns whether a variable is either undefined or null.\r\n */\r\nfunction isNullOrUndefined(value) {\r\n return value === null || value === undefined;\r\n}\r\n/** Returns whether the value represents -0. */\r\nfunction isNegativeZero(value) {\r\n // Detect if the value is -0.0. Based on polyfill from\r\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\r\n return value === 0 && 1 / value === 1 / -0;\r\n}\r\n/**\r\n * Returns whether a value is an integer and in the safe integer range\r\n * @param value - The value to test for being an integer and in the safe range\r\n */\r\nfunction isSafeInteger(value) {\r\n return (typeof value === 'number' &&\r\n Number.isInteger(value) &&\r\n !isNegativeZero(value) &&\r\n value <= Number.MAX_SAFE_INTEGER &&\r\n value >= Number.MIN_SAFE_INTEGER);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @internal\r\n */\r\nclass DocumentKey {\r\n constructor(path) {\r\n this.path = path;\r\n }\r\n static fromPath(path) {\r\n return new DocumentKey(ResourcePath.fromString(path));\r\n }\r\n static fromName(name) {\r\n return new DocumentKey(ResourcePath.fromString(name).popFirst(5));\r\n }\r\n /** Returns true if the document is in the specified collectionId. */\r\n hasCollectionId(collectionId) {\r\n return (this.path.length >= 2 &&\r\n this.path.get(this.path.length - 2) === collectionId);\r\n }\r\n isEqual(other) {\r\n return (other !== null && ResourcePath.comparator(this.path, other.path) === 0);\r\n }\r\n toString() {\r\n return this.path.toString();\r\n }\r\n static comparator(k1, k2) {\r\n return ResourcePath.comparator(k1.path, k2.path);\r\n }\r\n static isDocumentKey(path) {\r\n return path.length % 2 === 0;\r\n }\r\n /**\r\n * Creates and returns a new document key with the given segments.\r\n *\r\n * @param segments - The segments of the path to the document\r\n * @returns A new instance of DocumentKey\r\n */\r\n static fromSegments(segments) {\r\n return new DocumentKey(new ResourcePath(segments.slice()));\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/** Extracts the backend's type order for the provided value. */\r\nfunction typeOrder(value) {\r\n if ('nullValue' in value) {\r\n return 0 /* NullValue */;\r\n }\r\n else if ('booleanValue' in value) {\r\n return 1 /* BooleanValue */;\r\n }\r\n else if ('integerValue' in value || 'doubleValue' in value) {\r\n return 2 /* NumberValue */;\r\n }\r\n else if ('timestampValue' in value) {\r\n return 3 /* TimestampValue */;\r\n }\r\n else if ('stringValue' in value) {\r\n return 5 /* StringValue */;\r\n }\r\n else if ('bytesValue' in value) {\r\n return 6 /* BlobValue */;\r\n }\r\n else if ('referenceValue' in value) {\r\n return 7 /* RefValue */;\r\n }\r\n else if ('geoPointValue' in value) {\r\n return 8 /* GeoPointValue */;\r\n }\r\n else if ('arrayValue' in value) {\r\n return 9 /* ArrayValue */;\r\n }\r\n else if ('mapValue' in value) {\r\n if (isServerTimestamp(value)) {\r\n return 4 /* ServerTimestampValue */;\r\n }\r\n return 10 /* ObjectValue */;\r\n }\r\n else {\r\n return fail();\r\n }\r\n}\r\n/** Tests `left` and `right` for equality based on the backend semantics. */\r\nfunction valueEquals(left, right) {\r\n const leftType = typeOrder(left);\r\n const rightType = typeOrder(right);\r\n if (leftType !== rightType) {\r\n return false;\r\n }\r\n switch (leftType) {\r\n case 0 /* NullValue */:\r\n return true;\r\n case 1 /* BooleanValue */:\r\n return left.booleanValue === right.booleanValue;\r\n case 4 /* ServerTimestampValue */:\r\n return getLocalWriteTime(left).isEqual(getLocalWriteTime(right));\r\n case 3 /* TimestampValue */:\r\n return timestampEquals(left, right);\r\n case 5 /* StringValue */:\r\n return left.stringValue === right.stringValue;\r\n case 6 /* BlobValue */:\r\n return blobEquals(left, right);\r\n case 7 /* RefValue */:\r\n return left.referenceValue === right.referenceValue;\r\n case 8 /* GeoPointValue */:\r\n return geoPointEquals(left, right);\r\n case 2 /* NumberValue */:\r\n return numberEquals(left, right);\r\n case 9 /* ArrayValue */:\r\n return arrayEquals(left.arrayValue.values || [], right.arrayValue.values || [], valueEquals);\r\n case 10 /* ObjectValue */:\r\n return objectEquals(left, right);\r\n default:\r\n return fail();\r\n }\r\n}\r\nfunction timestampEquals(left, right) {\r\n if (typeof left.timestampValue === 'string' &&\r\n typeof right.timestampValue === 'string' &&\r\n left.timestampValue.length === right.timestampValue.length) {\r\n // Use string equality for ISO 8601 timestamps\r\n return left.timestampValue === right.timestampValue;\r\n }\r\n const leftTimestamp = normalizeTimestamp(left.timestampValue);\r\n const rightTimestamp = normalizeTimestamp(right.timestampValue);\r\n return (leftTimestamp.seconds === rightTimestamp.seconds &&\r\n leftTimestamp.nanos === rightTimestamp.nanos);\r\n}\r\nfunction geoPointEquals(left, right) {\r\n return (normalizeNumber(left.geoPointValue.latitude) ===\r\n normalizeNumber(right.geoPointValue.latitude) &&\r\n normalizeNumber(left.geoPointValue.longitude) ===\r\n normalizeNumber(right.geoPointValue.longitude));\r\n}\r\nfunction blobEquals(left, right) {\r\n return normalizeByteString(left.bytesValue).isEqual(normalizeByteString(right.bytesValue));\r\n}\r\nfunction numberEquals(left, right) {\r\n if ('integerValue' in left && 'integerValue' in right) {\r\n return (normalizeNumber(left.integerValue) === normalizeNumber(right.integerValue));\r\n }\r\n else if ('doubleValue' in left && 'doubleValue' in right) {\r\n const n1 = normalizeNumber(left.doubleValue);\r\n const n2 = normalizeNumber(right.doubleValue);\r\n if (n1 === n2) {\r\n return isNegativeZero(n1) === isNegativeZero(n2);\r\n }\r\n else {\r\n return isNaN(n1) && isNaN(n2);\r\n }\r\n }\r\n return false;\r\n}\r\nfunction objectEquals(left, right) {\r\n const leftMap = left.mapValue.fields || {};\r\n const rightMap = right.mapValue.fields || {};\r\n if (objectSize(leftMap) !== objectSize(rightMap)) {\r\n return false;\r\n }\r\n for (const key in leftMap) {\r\n if (leftMap.hasOwnProperty(key)) {\r\n if (rightMap[key] === undefined ||\r\n !valueEquals(leftMap[key], rightMap[key])) {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n}\r\n/** Returns true if the ArrayValue contains the specified element. */\r\nfunction arrayValueContains(haystack, needle) {\r\n return ((haystack.values || []).find(v => valueEquals(v, needle)) !== undefined);\r\n}\r\nfunction valueCompare(left, right) {\r\n const leftType = typeOrder(left);\r\n const rightType = typeOrder(right);\r\n if (leftType !== rightType) {\r\n return primitiveComparator(leftType, rightType);\r\n }\r\n switch (leftType) {\r\n case 0 /* NullValue */:\r\n return 0;\r\n case 1 /* BooleanValue */:\r\n return primitiveComparator(left.booleanValue, right.booleanValue);\r\n case 2 /* NumberValue */:\r\n return compareNumbers(left, right);\r\n case 3 /* TimestampValue */:\r\n return compareTimestamps(left.timestampValue, right.timestampValue);\r\n case 4 /* ServerTimestampValue */:\r\n return compareTimestamps(getLocalWriteTime(left), getLocalWriteTime(right));\r\n case 5 /* StringValue */:\r\n return primitiveComparator(left.stringValue, right.stringValue);\r\n case 6 /* BlobValue */:\r\n return compareBlobs(left.bytesValue, right.bytesValue);\r\n case 7 /* RefValue */:\r\n return compareReferences(left.referenceValue, right.referenceValue);\r\n case 8 /* GeoPointValue */:\r\n return compareGeoPoints(left.geoPointValue, right.geoPointValue);\r\n case 9 /* ArrayValue */:\r\n return compareArrays(left.arrayValue, right.arrayValue);\r\n case 10 /* ObjectValue */:\r\n return compareMaps(left.mapValue, right.mapValue);\r\n default:\r\n throw fail();\r\n }\r\n}\r\nfunction compareNumbers(left, right) {\r\n const leftNumber = normalizeNumber(left.integerValue || left.doubleValue);\r\n const rightNumber = normalizeNumber(right.integerValue || right.doubleValue);\r\n if (leftNumber < rightNumber) {\r\n return -1;\r\n }\r\n else if (leftNumber > rightNumber) {\r\n return 1;\r\n }\r\n else if (leftNumber === rightNumber) {\r\n return 0;\r\n }\r\n else {\r\n // one or both are NaN.\r\n if (isNaN(leftNumber)) {\r\n return isNaN(rightNumber) ? 0 : -1;\r\n }\r\n else {\r\n return 1;\r\n }\r\n }\r\n}\r\nfunction compareTimestamps(left, right) {\r\n if (typeof left === 'string' &&\r\n typeof right === 'string' &&\r\n left.length === right.length) {\r\n return primitiveComparator(left, right);\r\n }\r\n const leftTimestamp = normalizeTimestamp(left);\r\n const rightTimestamp = normalizeTimestamp(right);\r\n const comparison = primitiveComparator(leftTimestamp.seconds, rightTimestamp.seconds);\r\n if (comparison !== 0) {\r\n return comparison;\r\n }\r\n return primitiveComparator(leftTimestamp.nanos, rightTimestamp.nanos);\r\n}\r\nfunction compareReferences(leftPath, rightPath) {\r\n const leftSegments = leftPath.split('/');\r\n const rightSegments = rightPath.split('/');\r\n for (let i = 0; i < leftSegments.length && i < rightSegments.length; i++) {\r\n const comparison = primitiveComparator(leftSegments[i], rightSegments[i]);\r\n if (comparison !== 0) {\r\n return comparison;\r\n }\r\n }\r\n return primitiveComparator(leftSegments.length, rightSegments.length);\r\n}\r\nfunction compareGeoPoints(left, right) {\r\n const comparison = primitiveComparator(normalizeNumber(left.latitude), normalizeNumber(right.latitude));\r\n if (comparison !== 0) {\r\n return comparison;\r\n }\r\n return primitiveComparator(normalizeNumber(left.longitude), normalizeNumber(right.longitude));\r\n}\r\nfunction compareBlobs(left, right) {\r\n const leftBytes = normalizeByteString(left);\r\n const rightBytes = normalizeByteString(right);\r\n return leftBytes.compareTo(rightBytes);\r\n}\r\nfunction compareArrays(left, right) {\r\n const leftArray = left.values || [];\r\n const rightArray = right.values || [];\r\n for (let i = 0; i < leftArray.length && i < rightArray.length; ++i) {\r\n const compare = valueCompare(leftArray[i], rightArray[i]);\r\n if (compare) {\r\n return compare;\r\n }\r\n }\r\n return primitiveComparator(leftArray.length, rightArray.length);\r\n}\r\nfunction compareMaps(left, right) {\r\n const leftMap = left.fields || {};\r\n const leftKeys = Object.keys(leftMap);\r\n const rightMap = right.fields || {};\r\n const rightKeys = Object.keys(rightMap);\r\n // Even though MapValues are likely sorted correctly based on their insertion\r\n // order (e.g. when received from the backend), local modifications can bring\r\n // elements out of order. We need to re-sort the elements to ensure that\r\n // canonical IDs are independent of insertion order.\r\n leftKeys.sort();\r\n rightKeys.sort();\r\n for (let i = 0; i < leftKeys.length && i < rightKeys.length; ++i) {\r\n const keyCompare = primitiveComparator(leftKeys[i], rightKeys[i]);\r\n if (keyCompare !== 0) {\r\n return keyCompare;\r\n }\r\n const compare = valueCompare(leftMap[leftKeys[i]], rightMap[rightKeys[i]]);\r\n if (compare !== 0) {\r\n return compare;\r\n }\r\n }\r\n return primitiveComparator(leftKeys.length, rightKeys.length);\r\n}\r\n/**\r\n * Generates the canonical ID for the provided field value (as used in Target\r\n * serialization).\r\n */\r\nfunction canonicalId(value) {\r\n return canonifyValue(value);\r\n}\r\nfunction canonifyValue(value) {\r\n if ('nullValue' in value) {\r\n return 'null';\r\n }\r\n else if ('booleanValue' in value) {\r\n return '' + value.booleanValue;\r\n }\r\n else if ('integerValue' in value) {\r\n return '' + value.integerValue;\r\n }\r\n else if ('doubleValue' in value) {\r\n return '' + value.doubleValue;\r\n }\r\n else if ('timestampValue' in value) {\r\n return canonifyTimestamp(value.timestampValue);\r\n }\r\n else if ('stringValue' in value) {\r\n return value.stringValue;\r\n }\r\n else if ('bytesValue' in value) {\r\n return canonifyByteString(value.bytesValue);\r\n }\r\n else if ('referenceValue' in value) {\r\n return canonifyReference(value.referenceValue);\r\n }\r\n else if ('geoPointValue' in value) {\r\n return canonifyGeoPoint(value.geoPointValue);\r\n }\r\n else if ('arrayValue' in value) {\r\n return canonifyArray(value.arrayValue);\r\n }\r\n else if ('mapValue' in value) {\r\n return canonifyMap(value.mapValue);\r\n }\r\n else {\r\n return fail();\r\n }\r\n}\r\nfunction canonifyByteString(byteString) {\r\n return normalizeByteString(byteString).toBase64();\r\n}\r\nfunction canonifyTimestamp(timestamp) {\r\n const normalizedTimestamp = normalizeTimestamp(timestamp);\r\n return `time(${normalizedTimestamp.seconds},${normalizedTimestamp.nanos})`;\r\n}\r\nfunction canonifyGeoPoint(geoPoint) {\r\n return `geo(${geoPoint.latitude},${geoPoint.longitude})`;\r\n}\r\nfunction canonifyReference(referenceValue) {\r\n return DocumentKey.fromName(referenceValue).toString();\r\n}\r\nfunction canonifyMap(mapValue) {\r\n // Iteration order in JavaScript is not guaranteed. To ensure that we generate\r\n // matching canonical IDs for identical maps, we need to sort the keys.\r\n const sortedKeys = Object.keys(mapValue.fields || {}).sort();\r\n let result = '{';\r\n let first = true;\r\n for (const key of sortedKeys) {\r\n if (!first) {\r\n result += ',';\r\n }\r\n else {\r\n first = false;\r\n }\r\n result += `${key}:${canonifyValue(mapValue.fields[key])}`;\r\n }\r\n return result + '}';\r\n}\r\nfunction canonifyArray(arrayValue) {\r\n let result = '[';\r\n let first = true;\r\n for (const value of arrayValue.values || []) {\r\n if (!first) {\r\n result += ',';\r\n }\r\n else {\r\n first = false;\r\n }\r\n result += canonifyValue(value);\r\n }\r\n return result + ']';\r\n}\r\n/** Returns a reference value for the provided database and key. */\r\nfunction refValue(databaseId, key) {\r\n return {\r\n referenceValue: `projects/${databaseId.projectId}/databases/${databaseId.database}/documents/${key.path.canonicalString()}`\r\n };\r\n}\r\n/** Returns true if `value` is an IntegerValue . */\r\nfunction isInteger(value) {\r\n return !!value && 'integerValue' in value;\r\n}\r\n/** Returns true if `value` is a DoubleValue. */\r\nfunction isDouble(value) {\r\n return !!value && 'doubleValue' in value;\r\n}\r\n/** Returns true if `value` is either an IntegerValue or a DoubleValue. */\r\nfunction isNumber(value) {\r\n return isInteger(value) || isDouble(value);\r\n}\r\n/** Returns true if `value` is an ArrayValue. */\r\nfunction isArray(value) {\r\n return !!value && 'arrayValue' in value;\r\n}\r\n/** Returns true if `value` is a NullValue. */\r\nfunction isNullValue(value) {\r\n return !!value && 'nullValue' in value;\r\n}\r\n/** Returns true if `value` is NaN. */\r\nfunction isNanValue(value) {\r\n return !!value && 'doubleValue' in value && isNaN(Number(value.doubleValue));\r\n}\r\n/** Returns true if `value` is a MapValue. */\r\nfunction isMapValue(value) {\r\n return !!value && 'mapValue' in value;\r\n}\r\n/** Creates a deep copy of `source`. */\r\nfunction deepClone(source) {\r\n if (source.geoPointValue) {\r\n return { geoPointValue: Object.assign({}, source.geoPointValue) };\r\n }\r\n else if (source.timestampValue &&\r\n typeof source.timestampValue === 'object') {\r\n return { timestampValue: Object.assign({}, source.timestampValue) };\r\n }\r\n else if (source.mapValue) {\r\n const target = { mapValue: { fields: {} } };\r\n forEach(source.mapValue.fields, (key, val) => (target.mapValue.fields[key] = deepClone(val)));\r\n return target;\r\n }\r\n else if (source.arrayValue) {\r\n const target = { arrayValue: { values: [] } };\r\n for (let i = 0; i < (source.arrayValue.values || []).length; ++i) {\r\n target.arrayValue.values[i] = deepClone(source.arrayValue.values[i]);\r\n }\r\n return target;\r\n }\r\n else {\r\n return Object.assign({}, source);\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * An ObjectValue represents a MapValue in the Firestore Proto and offers the\r\n * ability to add and remove fields (via the ObjectValueBuilder).\r\n */\r\nclass ObjectValue {\r\n constructor(value) {\r\n this.value = value;\r\n }\r\n static empty() {\r\n return new ObjectValue({ mapValue: {} });\r\n }\r\n /**\r\n * Returns the value at the given path or null.\r\n *\r\n * @param path - the path to search\r\n * @returns The value at the path or null if the path is not set.\r\n */\r\n field(path) {\r\n if (path.isEmpty()) {\r\n return this.value;\r\n }\r\n else {\r\n let currentLevel = this.value;\r\n for (let i = 0; i < path.length - 1; ++i) {\r\n currentLevel = (currentLevel.mapValue.fields || {})[path.get(i)];\r\n if (!isMapValue(currentLevel)) {\r\n return null;\r\n }\r\n }\r\n currentLevel = (currentLevel.mapValue.fields || {})[path.lastSegment()];\r\n return currentLevel || null;\r\n }\r\n }\r\n /**\r\n * Sets the field to the provided value.\r\n *\r\n * @param path - The field path to set.\r\n * @param value - The value to set.\r\n */\r\n set(path, value) {\r\n const fieldsMap = this.getFieldsMap(path.popLast());\r\n fieldsMap[path.lastSegment()] = deepClone(value);\r\n }\r\n /**\r\n * Sets the provided fields to the provided values.\r\n *\r\n * @param data - A map of fields to values (or null for deletes).\r\n */\r\n setAll(data) {\r\n let parent = FieldPath$1.emptyPath();\r\n let upserts = {};\r\n let deletes = [];\r\n data.forEach((value, path) => {\r\n if (!parent.isImmediateParentOf(path)) {\r\n // Insert the accumulated changes at this parent location\r\n const fieldsMap = this.getFieldsMap(parent);\r\n this.applyChanges(fieldsMap, upserts, deletes);\r\n upserts = {};\r\n deletes = [];\r\n parent = path.popLast();\r\n }\r\n if (value) {\r\n upserts[path.lastSegment()] = deepClone(value);\r\n }\r\n else {\r\n deletes.push(path.lastSegment());\r\n }\r\n });\r\n const fieldsMap = this.getFieldsMap(parent);\r\n this.applyChanges(fieldsMap, upserts, deletes);\r\n }\r\n /**\r\n * Removes the field at the specified path. If there is no field at the\r\n * specified path, nothing is changed.\r\n *\r\n * @param path - The field path to remove.\r\n */\r\n delete(path) {\r\n const nestedValue = this.field(path.popLast());\r\n if (isMapValue(nestedValue) && nestedValue.mapValue.fields) {\r\n delete nestedValue.mapValue.fields[path.lastSegment()];\r\n }\r\n }\r\n isEqual(other) {\r\n return valueEquals(this.value, other.value);\r\n }\r\n /**\r\n * Returns the map that contains the leaf element of `path`. If the parent\r\n * entry does not yet exist, or if it is not a map, a new map will be created.\r\n */\r\n getFieldsMap(path) {\r\n let current = this.value;\r\n if (!current.mapValue.fields) {\r\n current.mapValue = { fields: {} };\r\n }\r\n for (let i = 0; i < path.length; ++i) {\r\n let next = current.mapValue.fields[path.get(i)];\r\n if (!isMapValue(next) || !next.mapValue.fields) {\r\n next = { mapValue: { fields: {} } };\r\n current.mapValue.fields[path.get(i)] = next;\r\n }\r\n current = next;\r\n }\r\n return current.mapValue.fields;\r\n }\r\n /**\r\n * Modifies `fieldsMap` by adding, replacing or deleting the specified\r\n * entries.\r\n */\r\n applyChanges(fieldsMap, inserts, deletes) {\r\n forEach(inserts, (key, val) => (fieldsMap[key] = val));\r\n for (const field of deletes) {\r\n delete fieldsMap[field];\r\n }\r\n }\r\n clone() {\r\n return new ObjectValue(deepClone(this.value));\r\n }\r\n}\r\n/**\r\n * Returns a FieldMask built from all fields in a MapValue.\r\n */\r\nfunction extractFieldMask(value) {\r\n const fields = [];\r\n forEach(value.fields, (key, value) => {\r\n const currentPath = new FieldPath$1([key]);\r\n if (isMapValue(value)) {\r\n const nestedMask = extractFieldMask(value.mapValue);\r\n const nestedFields = nestedMask.fields;\r\n if (nestedFields.length === 0) {\r\n // Preserve the empty map by adding it to the FieldMask.\r\n fields.push(currentPath);\r\n }\r\n else {\r\n // For nested and non-empty ObjectValues, add the FieldPath of the\r\n // leaf nodes.\r\n for (const nestedPath of nestedFields) {\r\n fields.push(currentPath.child(nestedPath));\r\n }\r\n }\r\n }\r\n else {\r\n // For nested and non-empty ObjectValues, add the FieldPath of the leaf\r\n // nodes.\r\n fields.push(currentPath);\r\n }\r\n });\r\n return new FieldMask(fields);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Represents a document in Firestore with a key, version, data and whether it\r\n * has local mutations applied to it.\r\n *\r\n * Documents can transition between states via `convertToFoundDocument()`,\r\n * `convertToNoDocument()` and `convertToUnknownDocument()`. If a document does\r\n * not transition to one of these states even after all mutations have been\r\n * applied, `isValidDocument()` returns false and the document should be removed\r\n * from all views.\r\n */\r\nclass MutableDocument {\r\n constructor(key, documentType, version, data, documentState) {\r\n this.key = key;\r\n this.documentType = documentType;\r\n this.version = version;\r\n this.data = data;\r\n this.documentState = documentState;\r\n }\r\n /**\r\n * Creates a document with no known version or data, but which can serve as\r\n * base document for mutations.\r\n */\r\n static newInvalidDocument(documentKey) {\r\n return new MutableDocument(documentKey, 0 /* INVALID */, SnapshotVersion.min(), ObjectValue.empty(), 0 /* SYNCED */);\r\n }\r\n /**\r\n * Creates a new document that is known to exist with the given data at the\r\n * given version.\r\n */\r\n static newFoundDocument(documentKey, version, value) {\r\n return new MutableDocument(documentKey, 1 /* FOUND_DOCUMENT */, version, value, 0 /* SYNCED */);\r\n }\r\n /** Creates a new document that is known to not exist at the given version. */\r\n static newNoDocument(documentKey, version) {\r\n return new MutableDocument(documentKey, 2 /* NO_DOCUMENT */, version, ObjectValue.empty(), 0 /* SYNCED */);\r\n }\r\n /**\r\n * Creates a new document that is known to exist at the given version but\r\n * whose data is not known (e.g. a document that was updated without a known\r\n * base document).\r\n */\r\n static newUnknownDocument(documentKey, version) {\r\n return new MutableDocument(documentKey, 3 /* UNKNOWN_DOCUMENT */, version, ObjectValue.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);\r\n }\r\n /**\r\n * Changes the document type to indicate that it exists and that its version\r\n * and data are known.\r\n */\r\n convertToFoundDocument(version, value) {\r\n this.version = version;\r\n this.documentType = 1 /* FOUND_DOCUMENT */;\r\n this.data = value;\r\n this.documentState = 0 /* SYNCED */;\r\n return this;\r\n }\r\n /**\r\n * Changes the document type to indicate that it doesn't exist at the given\r\n * version.\r\n */\r\n convertToNoDocument(version) {\r\n this.version = version;\r\n this.documentType = 2 /* NO_DOCUMENT */;\r\n this.data = ObjectValue.empty();\r\n this.documentState = 0 /* SYNCED */;\r\n return this;\r\n }\r\n /**\r\n * Changes the document type to indicate that it exists at a given version but\r\n * that its data is not known (e.g. a document that was updated without a known\r\n * base document).\r\n */\r\n convertToUnknownDocument(version) {\r\n this.version = version;\r\n this.documentType = 3 /* UNKNOWN_DOCUMENT */;\r\n this.data = ObjectValue.empty();\r\n this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */;\r\n return this;\r\n }\r\n setHasCommittedMutations() {\r\n this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */;\r\n return this;\r\n }\r\n setHasLocalMutations() {\r\n this.documentState = 1 /* HAS_LOCAL_MUTATIONS */;\r\n return this;\r\n }\r\n get hasLocalMutations() {\r\n return this.documentState === 1 /* HAS_LOCAL_MUTATIONS */;\r\n }\r\n get hasCommittedMutations() {\r\n return this.documentState === 2 /* HAS_COMMITTED_MUTATIONS */;\r\n }\r\n get hasPendingWrites() {\r\n return this.hasLocalMutations || this.hasCommittedMutations;\r\n }\r\n isValidDocument() {\r\n return this.documentType !== 0 /* INVALID */;\r\n }\r\n isFoundDocument() {\r\n return this.documentType === 1 /* FOUND_DOCUMENT */;\r\n }\r\n isNoDocument() {\r\n return this.documentType === 2 /* NO_DOCUMENT */;\r\n }\r\n isUnknownDocument() {\r\n return this.documentType === 3 /* UNKNOWN_DOCUMENT */;\r\n }\r\n isEqual(other) {\r\n return (other instanceof MutableDocument &&\r\n this.key.isEqual(other.key) &&\r\n this.version.isEqual(other.version) &&\r\n this.documentType === other.documentType &&\r\n this.documentState === other.documentState &&\r\n this.data.isEqual(other.data));\r\n }\r\n clone() {\r\n return new MutableDocument(this.key, this.documentType, this.version, this.data.clone(), this.documentState);\r\n }\r\n toString() {\r\n return (`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, ` +\r\n `{documentType: ${this.documentType}}), ` +\r\n `{documentState: ${this.documentState}})`);\r\n }\r\n}\r\n/**\r\n * Compares the value for field `field` in the provided documents. Throws if\r\n * the field does not exist in both documents.\r\n */\r\nfunction compareDocumentsByField(field, d1, d2) {\r\n const v1 = d1.data.field(field);\r\n const v2 = d2.data.field(field);\r\n if (v1 !== null && v2 !== null) {\r\n return valueCompare(v1, v2);\r\n }\r\n else {\r\n return fail();\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// Visible for testing\r\nclass TargetImpl {\r\n constructor(path, collectionGroup = null, orderBy = [], filters = [], limit = null, startAt = null, endAt = null) {\r\n this.path = path;\r\n this.collectionGroup = collectionGroup;\r\n this.orderBy = orderBy;\r\n this.filters = filters;\r\n this.limit = limit;\r\n this.startAt = startAt;\r\n this.endAt = endAt;\r\n this.memoizedCanonicalId = null;\r\n }\r\n}\r\n/**\r\n * Initializes a Target with a path and optional additional query constraints.\r\n * Path must currently be empty if this is a collection group query.\r\n *\r\n * NOTE: you should always construct `Target` from `Query.toTarget` instead of\r\n * using this factory method, because `Query` provides an implicit `orderBy`\r\n * property.\r\n */\r\nfunction newTarget(path, collectionGroup = null, orderBy = [], filters = [], limit = null, startAt = null, endAt = null) {\r\n return new TargetImpl(path, collectionGroup, orderBy, filters, limit, startAt, endAt);\r\n}\r\nfunction canonifyTarget(target) {\r\n const targetImpl = debugCast(target);\r\n if (targetImpl.memoizedCanonicalId === null) {\r\n let canonicalId = targetImpl.path.canonicalString();\r\n if (targetImpl.collectionGroup !== null) {\r\n canonicalId += '|cg:' + targetImpl.collectionGroup;\r\n }\r\n canonicalId += '|f:';\r\n canonicalId += targetImpl.filters.map(f => canonifyFilter(f)).join(',');\r\n canonicalId += '|ob:';\r\n canonicalId += targetImpl.orderBy.map(o => canonifyOrderBy(o)).join(',');\r\n if (!isNullOrUndefined(targetImpl.limit)) {\r\n canonicalId += '|l:';\r\n canonicalId += targetImpl.limit;\r\n }\r\n if (targetImpl.startAt) {\r\n canonicalId += '|lb:';\r\n canonicalId += canonifyBound(targetImpl.startAt);\r\n }\r\n if (targetImpl.endAt) {\r\n canonicalId += '|ub:';\r\n canonicalId += canonifyBound(targetImpl.endAt);\r\n }\r\n targetImpl.memoizedCanonicalId = canonicalId;\r\n }\r\n return targetImpl.memoizedCanonicalId;\r\n}\r\nfunction stringifyTarget(target) {\r\n let str = target.path.canonicalString();\r\n if (target.collectionGroup !== null) {\r\n str += ' collectionGroup=' + target.collectionGroup;\r\n }\r\n if (target.filters.length > 0) {\r\n str += `, filters: [${target.filters\r\n .map(f => stringifyFilter(f))\r\n .join(', ')}]`;\r\n }\r\n if (!isNullOrUndefined(target.limit)) {\r\n str += ', limit: ' + target.limit;\r\n }\r\n if (target.orderBy.length > 0) {\r\n str += `, orderBy: [${target.orderBy\r\n .map(o => stringifyOrderBy(o))\r\n .join(', ')}]`;\r\n }\r\n if (target.startAt) {\r\n str += ', startAt: ' + canonifyBound(target.startAt);\r\n }\r\n if (target.endAt) {\r\n str += ', endAt: ' + canonifyBound(target.endAt);\r\n }\r\n return `Target(${str})`;\r\n}\r\nfunction targetEquals(left, right) {\r\n if (left.limit !== right.limit) {\r\n return false;\r\n }\r\n if (left.orderBy.length !== right.orderBy.length) {\r\n return false;\r\n }\r\n for (let i = 0; i < left.orderBy.length; i++) {\r\n if (!orderByEquals(left.orderBy[i], right.orderBy[i])) {\r\n return false;\r\n }\r\n }\r\n if (left.filters.length !== right.filters.length) {\r\n return false;\r\n }\r\n for (let i = 0; i < left.filters.length; i++) {\r\n if (!filterEquals(left.filters[i], right.filters[i])) {\r\n return false;\r\n }\r\n }\r\n if (left.collectionGroup !== right.collectionGroup) {\r\n return false;\r\n }\r\n if (!left.path.isEqual(right.path)) {\r\n return false;\r\n }\r\n if (!boundEquals(left.startAt, right.startAt)) {\r\n return false;\r\n }\r\n return boundEquals(left.endAt, right.endAt);\r\n}\r\nfunction isDocumentTarget(target) {\r\n return (DocumentKey.isDocumentKey(target.path) &&\r\n target.collectionGroup === null &&\r\n target.filters.length === 0);\r\n}\r\nclass Filter {\r\n}\r\nclass FieldFilter extends Filter {\r\n constructor(field, op, value) {\r\n super();\r\n this.field = field;\r\n this.op = op;\r\n this.value = value;\r\n }\r\n /**\r\n * Creates a filter based on the provided arguments.\r\n */\r\n static create(field, op, value) {\r\n if (field.isKeyField()) {\r\n if (op === \"in\" /* IN */ || op === \"not-in\" /* NOT_IN */) {\r\n return this.createKeyFieldInFilter(field, op, value);\r\n }\r\n else {\r\n return new KeyFieldFilter(field, op, value);\r\n }\r\n }\r\n else if (op === \"array-contains\" /* ARRAY_CONTAINS */) {\r\n return new ArrayContainsFilter(field, value);\r\n }\r\n else if (op === \"in\" /* IN */) {\r\n return new InFilter(field, value);\r\n }\r\n else if (op === \"not-in\" /* NOT_IN */) {\r\n return new NotInFilter(field, value);\r\n }\r\n else if (op === \"array-contains-any\" /* ARRAY_CONTAINS_ANY */) {\r\n return new ArrayContainsAnyFilter(field, value);\r\n }\r\n else {\r\n return new FieldFilter(field, op, value);\r\n }\r\n }\r\n static createKeyFieldInFilter(field, op, value) {\r\n return op === \"in\" /* IN */\r\n ? new KeyFieldInFilter(field, value)\r\n : new KeyFieldNotInFilter(field, value);\r\n }\r\n matches(doc) {\r\n const other = doc.data.field(this.field);\r\n // Types do not have to match in NOT_EQUAL filters.\r\n if (this.op === \"!=\" /* NOT_EQUAL */) {\r\n return (other !== null &&\r\n this.matchesComparison(valueCompare(other, this.value)));\r\n }\r\n // Only compare types with matching backend order (such as double and int).\r\n return (other !== null &&\r\n typeOrder(this.value) === typeOrder(other) &&\r\n this.matchesComparison(valueCompare(other, this.value)));\r\n }\r\n matchesComparison(comparison) {\r\n switch (this.op) {\r\n case \"<\" /* LESS_THAN */:\r\n return comparison < 0;\r\n case \"<=\" /* LESS_THAN_OR_EQUAL */:\r\n return comparison <= 0;\r\n case \"==\" /* EQUAL */:\r\n return comparison === 0;\r\n case \"!=\" /* NOT_EQUAL */:\r\n return comparison !== 0;\r\n case \">\" /* GREATER_THAN */:\r\n return comparison > 0;\r\n case \">=\" /* GREATER_THAN_OR_EQUAL */:\r\n return comparison >= 0;\r\n default:\r\n return fail();\r\n }\r\n }\r\n isInequality() {\r\n return ([\r\n \"<\" /* LESS_THAN */,\r\n \"<=\" /* LESS_THAN_OR_EQUAL */,\r\n \">\" /* GREATER_THAN */,\r\n \">=\" /* GREATER_THAN_OR_EQUAL */,\r\n \"!=\" /* NOT_EQUAL */,\r\n \"not-in\" /* NOT_IN */\r\n ].indexOf(this.op) >= 0);\r\n }\r\n}\r\nfunction canonifyFilter(filter) {\r\n // TODO(b/29183165): Technically, this won't be unique if two values have\r\n // the same description, such as the int 3 and the string \"3\". So we should\r\n // add the types in here somehow, too.\r\n return (filter.field.canonicalString() +\r\n filter.op.toString() +\r\n canonicalId(filter.value));\r\n}\r\nfunction filterEquals(f1, f2) {\r\n return (f1.op === f2.op &&\r\n f1.field.isEqual(f2.field) &&\r\n valueEquals(f1.value, f2.value));\r\n}\r\n/** Returns a debug description for `filter`. */\r\nfunction stringifyFilter(filter) {\r\n return `${filter.field.canonicalString()} ${filter.op} ${canonicalId(filter.value)}`;\r\n}\r\n/** Filter that matches on key fields (i.e. '__name__'). */\r\nclass KeyFieldFilter extends FieldFilter {\r\n constructor(field, op, value) {\r\n super(field, op, value);\r\n this.key = DocumentKey.fromName(value.referenceValue);\r\n }\r\n matches(doc) {\r\n const comparison = DocumentKey.comparator(doc.key, this.key);\r\n return this.matchesComparison(comparison);\r\n }\r\n}\r\n/** Filter that matches on key fields within an array. */\r\nclass KeyFieldInFilter extends FieldFilter {\r\n constructor(field, value) {\r\n super(field, \"in\" /* IN */, value);\r\n this.keys = extractDocumentKeysFromArrayValue(\"in\" /* IN */, value);\r\n }\r\n matches(doc) {\r\n return this.keys.some(key => key.isEqual(doc.key));\r\n }\r\n}\r\n/** Filter that matches on key fields not present within an array. */\r\nclass KeyFieldNotInFilter extends FieldFilter {\r\n constructor(field, value) {\r\n super(field, \"not-in\" /* NOT_IN */, value);\r\n this.keys = extractDocumentKeysFromArrayValue(\"not-in\" /* NOT_IN */, value);\r\n }\r\n matches(doc) {\r\n return !this.keys.some(key => key.isEqual(doc.key));\r\n }\r\n}\r\nfunction extractDocumentKeysFromArrayValue(op, value) {\r\n var _a;\r\n return (((_a = value.arrayValue) === null || _a === void 0 ? void 0 : _a.values) || []).map(v => {\r\n return DocumentKey.fromName(v.referenceValue);\r\n });\r\n}\r\n/** A Filter that implements the array-contains operator. */\r\nclass ArrayContainsFilter extends FieldFilter {\r\n constructor(field, value) {\r\n super(field, \"array-contains\" /* ARRAY_CONTAINS */, value);\r\n }\r\n matches(doc) {\r\n const other = doc.data.field(this.field);\r\n return isArray(other) && arrayValueContains(other.arrayValue, this.value);\r\n }\r\n}\r\n/** A Filter that implements the IN operator. */\r\nclass InFilter extends FieldFilter {\r\n constructor(field, value) {\r\n super(field, \"in\" /* IN */, value);\r\n }\r\n matches(doc) {\r\n const other = doc.data.field(this.field);\r\n return other !== null && arrayValueContains(this.value.arrayValue, other);\r\n }\r\n}\r\n/** A Filter that implements the not-in operator. */\r\nclass NotInFilter extends FieldFilter {\r\n constructor(field, value) {\r\n super(field, \"not-in\" /* NOT_IN */, value);\r\n }\r\n matches(doc) {\r\n if (arrayValueContains(this.value.arrayValue, { nullValue: 'NULL_VALUE' })) {\r\n return false;\r\n }\r\n const other = doc.data.field(this.field);\r\n return other !== null && !arrayValueContains(this.value.arrayValue, other);\r\n }\r\n}\r\n/** A Filter that implements the array-contains-any operator. */\r\nclass ArrayContainsAnyFilter extends FieldFilter {\r\n constructor(field, value) {\r\n super(field, \"array-contains-any\" /* ARRAY_CONTAINS_ANY */, value);\r\n }\r\n matches(doc) {\r\n const other = doc.data.field(this.field);\r\n if (!isArray(other) || !other.arrayValue.values) {\r\n return false;\r\n }\r\n return other.arrayValue.values.some(val => arrayValueContains(this.value.arrayValue, val));\r\n }\r\n}\r\n/**\r\n * Represents a bound of a query.\r\n *\r\n * The bound is specified with the given components representing a position and\r\n * whether it's just before or just after the position (relative to whatever the\r\n * query order is).\r\n *\r\n * The position represents a logical index position for a query. It's a prefix\r\n * of values for the (potentially implicit) order by clauses of a query.\r\n *\r\n * Bound provides a function to determine whether a document comes before or\r\n * after a bound. This is influenced by whether the position is just before or\r\n * just after the provided values.\r\n */\r\nclass Bound {\r\n constructor(position, before) {\r\n this.position = position;\r\n this.before = before;\r\n }\r\n}\r\nfunction canonifyBound(bound) {\r\n // TODO(b/29183165): Make this collision robust.\r\n return `${bound.before ? 'b' : 'a'}:${bound.position\r\n .map(p => canonicalId(p))\r\n .join(',')}`;\r\n}\r\n/**\r\n * An ordering on a field, in some Direction. Direction defaults to ASCENDING.\r\n */\r\nclass OrderBy {\r\n constructor(field, dir = \"asc\" /* ASCENDING */) {\r\n this.field = field;\r\n this.dir = dir;\r\n }\r\n}\r\nfunction canonifyOrderBy(orderBy) {\r\n // TODO(b/29183165): Make this collision robust.\r\n return orderBy.field.canonicalString() + orderBy.dir;\r\n}\r\nfunction stringifyOrderBy(orderBy) {\r\n return `${orderBy.field.canonicalString()} (${orderBy.dir})`;\r\n}\r\nfunction orderByEquals(left, right) {\r\n return left.dir === right.dir && left.field.isEqual(right.field);\r\n}\r\n/**\r\n * Returns true if a document sorts before a bound using the provided sort\r\n * order.\r\n */\r\nfunction sortsBeforeDocument(bound, orderBy, doc) {\r\n let comparison = 0;\r\n for (let i = 0; i < bound.position.length; i++) {\r\n const orderByComponent = orderBy[i];\r\n const component = bound.position[i];\r\n if (orderByComponent.field.isKeyField()) {\r\n comparison = DocumentKey.comparator(DocumentKey.fromName(component.referenceValue), doc.key);\r\n }\r\n else {\r\n const docValue = doc.data.field(orderByComponent.field);\r\n comparison = valueCompare(component, docValue);\r\n }\r\n if (orderByComponent.dir === \"desc\" /* DESCENDING */) {\r\n comparison = comparison * -1;\r\n }\r\n if (comparison !== 0) {\r\n break;\r\n }\r\n }\r\n return bound.before ? comparison <= 0 : comparison < 0;\r\n}\r\nfunction boundEquals(left, right) {\r\n if (left === null) {\r\n return right === null;\r\n }\r\n else if (right === null) {\r\n return false;\r\n }\r\n if (left.before !== right.before ||\r\n left.position.length !== right.position.length) {\r\n return false;\r\n }\r\n for (let i = 0; i < left.position.length; i++) {\r\n const leftPosition = left.position[i];\r\n const rightPosition = right.position[i];\r\n if (!valueEquals(leftPosition, rightPosition)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Query encapsulates all the query attributes we support in the SDK. It can\r\n * be run against the LocalStore, as well as be converted to a `Target` to\r\n * query the RemoteStore results.\r\n *\r\n * Visible for testing.\r\n */\r\nclass QueryImpl {\r\n /**\r\n * Initializes a Query with a path and optional additional query constraints.\r\n * Path must currently be empty if this is a collection group query.\r\n */\r\n constructor(path, collectionGroup = null, explicitOrderBy = [], filters = [], limit = null, limitType = \"F\" /* First */, startAt = null, endAt = null) {\r\n this.path = path;\r\n this.collectionGroup = collectionGroup;\r\n this.explicitOrderBy = explicitOrderBy;\r\n this.filters = filters;\r\n this.limit = limit;\r\n this.limitType = limitType;\r\n this.startAt = startAt;\r\n this.endAt = endAt;\r\n this.memoizedOrderBy = null;\r\n // The corresponding `Target` of this `Query` instance.\r\n this.memoizedTarget = null;\r\n if (this.startAt) ;\r\n if (this.endAt) ;\r\n }\r\n}\r\n/** Creates a new Query instance with the options provided. */\r\nfunction newQuery(path, collectionGroup, explicitOrderBy, filters, limit, limitType, startAt, endAt) {\r\n return new QueryImpl(path, collectionGroup, explicitOrderBy, filters, limit, limitType, startAt, endAt);\r\n}\r\n/** Creates a new Query for a query that matches all documents at `path` */\r\nfunction newQueryForPath(path) {\r\n return new QueryImpl(path);\r\n}\r\n/**\r\n * Helper to convert a collection group query into a collection query at a\r\n * specific path. This is used when executing collection group queries, since\r\n * we have to split the query into a set of collection queries at multiple\r\n * paths.\r\n */\r\nfunction asCollectionQueryAtPath(query, path) {\r\n return new QueryImpl(path, \r\n /*collectionGroup=*/ null, query.explicitOrderBy.slice(), query.filters.slice(), query.limit, query.limitType, query.startAt, query.endAt);\r\n}\r\n/**\r\n * Returns true if this query does not specify any query constraints that\r\n * could remove results.\r\n */\r\nfunction matchesAllDocuments(query) {\r\n return (query.filters.length === 0 &&\r\n query.limit === null &&\r\n query.startAt == null &&\r\n query.endAt == null &&\r\n (query.explicitOrderBy.length === 0 ||\r\n (query.explicitOrderBy.length === 1 &&\r\n query.explicitOrderBy[0].field.isKeyField())));\r\n}\r\nfunction hasLimitToFirst(query) {\r\n return !isNullOrUndefined(query.limit) && query.limitType === \"F\" /* First */;\r\n}\r\nfunction hasLimitToLast(query) {\r\n return !isNullOrUndefined(query.limit) && query.limitType === \"L\" /* Last */;\r\n}\r\nfunction getFirstOrderByField(query) {\r\n return query.explicitOrderBy.length > 0\r\n ? query.explicitOrderBy[0].field\r\n : null;\r\n}\r\nfunction getInequalityFilterField(query) {\r\n for (const filter of query.filters) {\r\n if (filter.isInequality()) {\r\n return filter.field;\r\n }\r\n }\r\n return null;\r\n}\r\n/**\r\n * Checks if any of the provided Operators are included in the query and\r\n * returns the first one that is, or null if none are.\r\n */\r\nfunction findFilterOperator(query, operators) {\r\n for (const filter of query.filters) {\r\n if (operators.indexOf(filter.op) >= 0) {\r\n return filter.op;\r\n }\r\n }\r\n return null;\r\n}\r\n/**\r\n * Creates a new Query for a collection group query that matches all documents\r\n * within the provided collection group.\r\n */\r\nfunction newQueryForCollectionGroup(collectionId) {\r\n return new QueryImpl(ResourcePath.emptyPath(), collectionId);\r\n}\r\n/**\r\n * Returns whether the query matches a single document by path (rather than a\r\n * collection).\r\n */\r\nfunction isDocumentQuery$1(query) {\r\n return (DocumentKey.isDocumentKey(query.path) &&\r\n query.collectionGroup === null &&\r\n query.filters.length === 0);\r\n}\r\n/**\r\n * Returns whether the query matches a collection group rather than a specific\r\n * collection.\r\n */\r\nfunction isCollectionGroupQuery(query) {\r\n return query.collectionGroup !== null;\r\n}\r\n/**\r\n * Returns the implicit order by constraint that is used to execute the Query,\r\n * which can be different from the order by constraints the user provided (e.g.\r\n * the SDK and backend always orders by `__name__`).\r\n */\r\nfunction queryOrderBy(query) {\r\n const queryImpl = debugCast(query);\r\n if (queryImpl.memoizedOrderBy === null) {\r\n queryImpl.memoizedOrderBy = [];\r\n const inequalityField = getInequalityFilterField(queryImpl);\r\n const firstOrderByField = getFirstOrderByField(queryImpl);\r\n if (inequalityField !== null && firstOrderByField === null) {\r\n // In order to implicitly add key ordering, we must also add the\r\n // inequality filter field for it to be a valid query.\r\n // Note that the default inequality field and key ordering is ascending.\r\n if (!inequalityField.isKeyField()) {\r\n queryImpl.memoizedOrderBy.push(new OrderBy(inequalityField));\r\n }\r\n queryImpl.memoizedOrderBy.push(new OrderBy(FieldPath$1.keyField(), \"asc\" /* ASCENDING */));\r\n }\r\n else {\r\n let foundKeyOrdering = false;\r\n for (const orderBy of queryImpl.explicitOrderBy) {\r\n queryImpl.memoizedOrderBy.push(orderBy);\r\n if (orderBy.field.isKeyField()) {\r\n foundKeyOrdering = true;\r\n }\r\n }\r\n if (!foundKeyOrdering) {\r\n // The order of the implicit key ordering always matches the last\r\n // explicit order by\r\n const lastDirection = queryImpl.explicitOrderBy.length > 0\r\n ? queryImpl.explicitOrderBy[queryImpl.explicitOrderBy.length - 1]\r\n .dir\r\n : \"asc\" /* ASCENDING */;\r\n queryImpl.memoizedOrderBy.push(new OrderBy(FieldPath$1.keyField(), lastDirection));\r\n }\r\n }\r\n }\r\n return queryImpl.memoizedOrderBy;\r\n}\r\n/**\r\n * Converts this `Query` instance to it's corresponding `Target` representation.\r\n */\r\nfunction queryToTarget(query) {\r\n const queryImpl = debugCast(query, QueryImpl);\r\n if (!queryImpl.memoizedTarget) {\r\n if (queryImpl.limitType === \"F\" /* First */) {\r\n queryImpl.memoizedTarget = newTarget(queryImpl.path, queryImpl.collectionGroup, queryOrderBy(queryImpl), queryImpl.filters, queryImpl.limit, queryImpl.startAt, queryImpl.endAt);\r\n }\r\n else {\r\n // Flip the orderBy directions since we want the last results\r\n const orderBys = [];\r\n for (const orderBy of queryOrderBy(queryImpl)) {\r\n const dir = orderBy.dir === \"desc\" /* DESCENDING */\r\n ? \"asc\" /* ASCENDING */\r\n : \"desc\" /* DESCENDING */;\r\n orderBys.push(new OrderBy(orderBy.field, dir));\r\n }\r\n // We need to swap the cursors to match the now-flipped query ordering.\r\n const startAt = queryImpl.endAt\r\n ? new Bound(queryImpl.endAt.position, !queryImpl.endAt.before)\r\n : null;\r\n const endAt = queryImpl.startAt\r\n ? new Bound(queryImpl.startAt.position, !queryImpl.startAt.before)\r\n : null;\r\n // Now return as a LimitType.First query.\r\n queryImpl.memoizedTarget = newTarget(queryImpl.path, queryImpl.collectionGroup, orderBys, queryImpl.filters, queryImpl.limit, startAt, endAt);\r\n }\r\n }\r\n return queryImpl.memoizedTarget;\r\n}\r\nfunction queryWithAddedFilter(query, filter) {\r\n const newFilters = query.filters.concat([filter]);\r\n return new QueryImpl(query.path, query.collectionGroup, query.explicitOrderBy.slice(), newFilters, query.limit, query.limitType, query.startAt, query.endAt);\r\n}\r\nfunction queryWithAddedOrderBy(query, orderBy) {\r\n // TODO(dimond): validate that orderBy does not list the same key twice.\r\n const newOrderBy = query.explicitOrderBy.concat([orderBy]);\r\n return new QueryImpl(query.path, query.collectionGroup, newOrderBy, query.filters.slice(), query.limit, query.limitType, query.startAt, query.endAt);\r\n}\r\nfunction queryWithLimit(query, limit, limitType) {\r\n return new QueryImpl(query.path, query.collectionGroup, query.explicitOrderBy.slice(), query.filters.slice(), limit, limitType, query.startAt, query.endAt);\r\n}\r\nfunction queryWithStartAt(query, bound) {\r\n return new QueryImpl(query.path, query.collectionGroup, query.explicitOrderBy.slice(), query.filters.slice(), query.limit, query.limitType, bound, query.endAt);\r\n}\r\nfunction queryWithEndAt(query, bound) {\r\n return new QueryImpl(query.path, query.collectionGroup, query.explicitOrderBy.slice(), query.filters.slice(), query.limit, query.limitType, query.startAt, bound);\r\n}\r\nfunction queryEquals(left, right) {\r\n return (targetEquals(queryToTarget(left), queryToTarget(right)) &&\r\n left.limitType === right.limitType);\r\n}\r\n// TODO(b/29183165): This is used to get a unique string from a query to, for\r\n// example, use as a dictionary key, but the implementation is subject to\r\n// collisions. Make it collision-free.\r\nfunction canonifyQuery(query) {\r\n return `${canonifyTarget(queryToTarget(query))}|lt:${query.limitType}`;\r\n}\r\nfunction stringifyQuery(query) {\r\n return `Query(target=${stringifyTarget(queryToTarget(query))}; limitType=${query.limitType})`;\r\n}\r\n/** Returns whether `doc` matches the constraints of `query`. */\r\nfunction queryMatches(query, doc) {\r\n return (doc.isFoundDocument() &&\r\n queryMatchesPathAndCollectionGroup(query, doc) &&\r\n queryMatchesOrderBy(query, doc) &&\r\n queryMatchesFilters(query, doc) &&\r\n queryMatchesBounds(query, doc));\r\n}\r\nfunction queryMatchesPathAndCollectionGroup(query, doc) {\r\n const docPath = doc.key.path;\r\n if (query.collectionGroup !== null) {\r\n // NOTE: this.path is currently always empty since we don't expose Collection\r\n // Group queries rooted at a document path yet.\r\n return (doc.key.hasCollectionId(query.collectionGroup) &&\r\n query.path.isPrefixOf(docPath));\r\n }\r\n else if (DocumentKey.isDocumentKey(query.path)) {\r\n // exact match for document queries\r\n return query.path.isEqual(docPath);\r\n }\r\n else {\r\n // shallow ancestor queries by default\r\n return query.path.isImmediateParentOf(docPath);\r\n }\r\n}\r\n/**\r\n * A document must have a value for every ordering clause in order to show up\r\n * in the results.\r\n */\r\nfunction queryMatchesOrderBy(query, doc) {\r\n for (const orderBy of query.explicitOrderBy) {\r\n // order by key always matches\r\n if (!orderBy.field.isKeyField() && doc.data.field(orderBy.field) === null) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\nfunction queryMatchesFilters(query, doc) {\r\n for (const filter of query.filters) {\r\n if (!filter.matches(doc)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\n/** Makes sure a document is within the bounds, if provided. */\r\nfunction queryMatchesBounds(query, doc) {\r\n if (query.startAt &&\r\n !sortsBeforeDocument(query.startAt, queryOrderBy(query), doc)) {\r\n return false;\r\n }\r\n if (query.endAt &&\r\n sortsBeforeDocument(query.endAt, queryOrderBy(query), doc)) {\r\n return false;\r\n }\r\n return true;\r\n}\r\n/**\r\n * Returns a new comparator function that can be used to compare two documents\r\n * based on the Query's ordering constraint.\r\n */\r\nfunction newQueryComparator(query) {\r\n return (d1, d2) => {\r\n let comparedOnKeyField = false;\r\n for (const orderBy of queryOrderBy(query)) {\r\n const comp = compareDocs(orderBy, d1, d2);\r\n if (comp !== 0) {\r\n return comp;\r\n }\r\n comparedOnKeyField = comparedOnKeyField || orderBy.field.isKeyField();\r\n }\r\n return 0;\r\n };\r\n}\r\nfunction compareDocs(orderBy, d1, d2) {\r\n const comparison = orderBy.field.isKeyField()\r\n ? DocumentKey.comparator(d1.key, d2.key)\r\n : compareDocumentsByField(orderBy.field, d1, d2);\r\n switch (orderBy.dir) {\r\n case \"asc\" /* ASCENDING */:\r\n return comparison;\r\n case \"desc\" /* DESCENDING */:\r\n return -1 * comparison;\r\n default:\r\n return fail();\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// An immutable sorted map implementation, based on a Left-leaning Red-Black\r\n// tree.\r\nclass SortedMap {\r\n constructor(comparator, root) {\r\n this.comparator = comparator;\r\n this.root = root ? root : LLRBNode.EMPTY;\r\n }\r\n // Returns a copy of the map, with the specified key/value added or replaced.\r\n insert(key, value) {\r\n return new SortedMap(this.comparator, this.root\r\n .insert(key, value, this.comparator)\r\n .copy(null, null, LLRBNode.BLACK, null, null));\r\n }\r\n // Returns a copy of the map, with the specified key removed.\r\n remove(key) {\r\n return new SortedMap(this.comparator, this.root\r\n .remove(key, this.comparator)\r\n .copy(null, null, LLRBNode.BLACK, null, null));\r\n }\r\n // Returns the value of the node with the given key, or null.\r\n get(key) {\r\n let node = this.root;\r\n while (!node.isEmpty()) {\r\n const cmp = this.comparator(key, node.key);\r\n if (cmp === 0) {\r\n return node.value;\r\n }\r\n else if (cmp < 0) {\r\n node = node.left;\r\n }\r\n else if (cmp > 0) {\r\n node = node.right;\r\n }\r\n }\r\n return null;\r\n }\r\n // Returns the index of the element in this sorted map, or -1 if it doesn't\r\n // exist.\r\n indexOf(key) {\r\n // Number of nodes that were pruned when descending right\r\n let prunedNodes = 0;\r\n let node = this.root;\r\n while (!node.isEmpty()) {\r\n const cmp = this.comparator(key, node.key);\r\n if (cmp === 0) {\r\n return prunedNodes + node.left.size;\r\n }\r\n else if (cmp < 0) {\r\n node = node.left;\r\n }\r\n else {\r\n // Count all nodes left of the node plus the node itself\r\n prunedNodes += node.left.size + 1;\r\n node = node.right;\r\n }\r\n }\r\n // Node not found\r\n return -1;\r\n }\r\n isEmpty() {\r\n return this.root.isEmpty();\r\n }\r\n // Returns the total number of nodes in the map.\r\n get size() {\r\n return this.root.size;\r\n }\r\n // Returns the minimum key in the map.\r\n minKey() {\r\n return this.root.minKey();\r\n }\r\n // Returns the maximum key in the map.\r\n maxKey() {\r\n return this.root.maxKey();\r\n }\r\n // Traverses the map in key order and calls the specified action function\r\n // for each key/value pair. If action returns true, traversal is aborted.\r\n // Returns the first truthy value returned by action, or the last falsey\r\n // value returned by action.\r\n inorderTraversal(action) {\r\n return this.root.inorderTraversal(action);\r\n }\r\n forEach(fn) {\r\n this.inorderTraversal((k, v) => {\r\n fn(k, v);\r\n return false;\r\n });\r\n }\r\n toString() {\r\n const descriptions = [];\r\n this.inorderTraversal((k, v) => {\r\n descriptions.push(`${k}:${v}`);\r\n return false;\r\n });\r\n return `{${descriptions.join(', ')}}`;\r\n }\r\n // Traverses the map in reverse key order and calls the specified action\r\n // function for each key/value pair. If action returns true, traversal is\r\n // aborted.\r\n // Returns the first truthy value returned by action, or the last falsey\r\n // value returned by action.\r\n reverseTraversal(action) {\r\n return this.root.reverseTraversal(action);\r\n }\r\n // Returns an iterator over the SortedMap.\r\n getIterator() {\r\n return new SortedMapIterator(this.root, null, this.comparator, false);\r\n }\r\n getIteratorFrom(key) {\r\n return new SortedMapIterator(this.root, key, this.comparator, false);\r\n }\r\n getReverseIterator() {\r\n return new SortedMapIterator(this.root, null, this.comparator, true);\r\n }\r\n getReverseIteratorFrom(key) {\r\n return new SortedMapIterator(this.root, key, this.comparator, true);\r\n }\r\n} // end SortedMap\r\n// An iterator over an LLRBNode.\r\nclass SortedMapIterator {\r\n constructor(node, startKey, comparator, isReverse) {\r\n this.isReverse = isReverse;\r\n this.nodeStack = [];\r\n let cmp = 1;\r\n while (!node.isEmpty()) {\r\n cmp = startKey ? comparator(node.key, startKey) : 1;\r\n // flip the comparison if we're going in reverse\r\n if (isReverse) {\r\n cmp *= -1;\r\n }\r\n if (cmp < 0) {\r\n // This node is less than our start key. ignore it\r\n if (this.isReverse) {\r\n node = node.left;\r\n }\r\n else {\r\n node = node.right;\r\n }\r\n }\r\n else if (cmp === 0) {\r\n // This node is exactly equal to our start key. Push it on the stack,\r\n // but stop iterating;\r\n this.nodeStack.push(node);\r\n break;\r\n }\r\n else {\r\n // This node is greater than our start key, add it to the stack and move\r\n // to the next one\r\n this.nodeStack.push(node);\r\n if (this.isReverse) {\r\n node = node.right;\r\n }\r\n else {\r\n node = node.left;\r\n }\r\n }\r\n }\r\n }\r\n getNext() {\r\n let node = this.nodeStack.pop();\r\n const result = { key: node.key, value: node.value };\r\n if (this.isReverse) {\r\n node = node.left;\r\n while (!node.isEmpty()) {\r\n this.nodeStack.push(node);\r\n node = node.right;\r\n }\r\n }\r\n else {\r\n node = node.right;\r\n while (!node.isEmpty()) {\r\n this.nodeStack.push(node);\r\n node = node.left;\r\n }\r\n }\r\n return result;\r\n }\r\n hasNext() {\r\n return this.nodeStack.length > 0;\r\n }\r\n peek() {\r\n if (this.nodeStack.length === 0) {\r\n return null;\r\n }\r\n const node = this.nodeStack[this.nodeStack.length - 1];\r\n return { key: node.key, value: node.value };\r\n }\r\n} // end SortedMapIterator\r\n// Represents a node in a Left-leaning Red-Black tree.\r\nclass LLRBNode {\r\n constructor(key, value, color, left, right) {\r\n this.key = key;\r\n this.value = value;\r\n this.color = color != null ? color : LLRBNode.RED;\r\n this.left = left != null ? left : LLRBNode.EMPTY;\r\n this.right = right != null ? right : LLRBNode.EMPTY;\r\n this.size = this.left.size + 1 + this.right.size;\r\n }\r\n // Returns a copy of the current node, optionally replacing pieces of it.\r\n copy(key, value, color, left, right) {\r\n return new LLRBNode(key != null ? key : this.key, value != null ? value : this.value, color != null ? color : this.color, left != null ? left : this.left, right != null ? right : this.right);\r\n }\r\n isEmpty() {\r\n return false;\r\n }\r\n // Traverses the tree in key order and calls the specified action function\r\n // for each node. If action returns true, traversal is aborted.\r\n // Returns the first truthy value returned by action, or the last falsey\r\n // value returned by action.\r\n inorderTraversal(action) {\r\n return (this.left.inorderTraversal(action) ||\r\n action(this.key, this.value) ||\r\n this.right.inorderTraversal(action));\r\n }\r\n // Traverses the tree in reverse key order and calls the specified action\r\n // function for each node. If action returns true, traversal is aborted.\r\n // Returns the first truthy value returned by action, or the last falsey\r\n // value returned by action.\r\n reverseTraversal(action) {\r\n return (this.right.reverseTraversal(action) ||\r\n action(this.key, this.value) ||\r\n this.left.reverseTraversal(action));\r\n }\r\n // Returns the minimum node in the tree.\r\n min() {\r\n if (this.left.isEmpty()) {\r\n return this;\r\n }\r\n else {\r\n return this.left.min();\r\n }\r\n }\r\n // Returns the maximum key in the tree.\r\n minKey() {\r\n return this.min().key;\r\n }\r\n // Returns the maximum key in the tree.\r\n maxKey() {\r\n if (this.right.isEmpty()) {\r\n return this.key;\r\n }\r\n else {\r\n return this.right.maxKey();\r\n }\r\n }\r\n // Returns new tree, with the key/value added.\r\n insert(key, value, comparator) {\r\n let n = this;\r\n const cmp = comparator(key, n.key);\r\n if (cmp < 0) {\r\n n = n.copy(null, null, null, n.left.insert(key, value, comparator), null);\r\n }\r\n else if (cmp === 0) {\r\n n = n.copy(null, value, null, null, null);\r\n }\r\n else {\r\n n = n.copy(null, null, null, null, n.right.insert(key, value, comparator));\r\n }\r\n return n.fixUp();\r\n }\r\n removeMin() {\r\n if (this.left.isEmpty()) {\r\n return LLRBNode.EMPTY;\r\n }\r\n let n = this;\r\n if (!n.left.isRed() && !n.left.left.isRed()) {\r\n n = n.moveRedLeft();\r\n }\r\n n = n.copy(null, null, null, n.left.removeMin(), null);\r\n return n.fixUp();\r\n }\r\n // Returns new tree, with the specified item removed.\r\n remove(key, comparator) {\r\n let smallest;\r\n let n = this;\r\n if (comparator(key, n.key) < 0) {\r\n if (!n.left.isEmpty() && !n.left.isRed() && !n.left.left.isRed()) {\r\n n = n.moveRedLeft();\r\n }\r\n n = n.copy(null, null, null, n.left.remove(key, comparator), null);\r\n }\r\n else {\r\n if (n.left.isRed()) {\r\n n = n.rotateRight();\r\n }\r\n if (!n.right.isEmpty() && !n.right.isRed() && !n.right.left.isRed()) {\r\n n = n.moveRedRight();\r\n }\r\n if (comparator(key, n.key) === 0) {\r\n if (n.right.isEmpty()) {\r\n return LLRBNode.EMPTY;\r\n }\r\n else {\r\n smallest = n.right.min();\r\n n = n.copy(smallest.key, smallest.value, null, null, n.right.removeMin());\r\n }\r\n }\r\n n = n.copy(null, null, null, null, n.right.remove(key, comparator));\r\n }\r\n return n.fixUp();\r\n }\r\n isRed() {\r\n return this.color;\r\n }\r\n // Returns new tree after performing any needed rotations.\r\n fixUp() {\r\n let n = this;\r\n if (n.right.isRed() && !n.left.isRed()) {\r\n n = n.rotateLeft();\r\n }\r\n if (n.left.isRed() && n.left.left.isRed()) {\r\n n = n.rotateRight();\r\n }\r\n if (n.left.isRed() && n.right.isRed()) {\r\n n = n.colorFlip();\r\n }\r\n return n;\r\n }\r\n moveRedLeft() {\r\n let n = this.colorFlip();\r\n if (n.right.left.isRed()) {\r\n n = n.copy(null, null, null, null, n.right.rotateRight());\r\n n = n.rotateLeft();\r\n n = n.colorFlip();\r\n }\r\n return n;\r\n }\r\n moveRedRight() {\r\n let n = this.colorFlip();\r\n if (n.left.left.isRed()) {\r\n n = n.rotateRight();\r\n n = n.colorFlip();\r\n }\r\n return n;\r\n }\r\n rotateLeft() {\r\n const nl = this.copy(null, null, LLRBNode.RED, null, this.right.left);\r\n return this.right.copy(null, null, this.color, nl, null);\r\n }\r\n rotateRight() {\r\n const nr = this.copy(null, null, LLRBNode.RED, this.left.right, null);\r\n return this.left.copy(null, null, this.color, null, nr);\r\n }\r\n colorFlip() {\r\n const left = this.left.copy(null, null, !this.left.color, null, null);\r\n const right = this.right.copy(null, null, !this.right.color, null, null);\r\n return this.copy(null, null, !this.color, left, right);\r\n }\r\n // For testing.\r\n checkMaxDepth() {\r\n const blackDepth = this.check();\r\n if (Math.pow(2.0, blackDepth) <= this.size + 1) {\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n // In a balanced RB tree, the black-depth (number of black nodes) from root to\r\n // leaves is equal on both sides. This function verifies that or asserts.\r\n check() {\r\n if (this.isRed() && this.left.isRed()) {\r\n throw fail();\r\n }\r\n if (this.right.isRed()) {\r\n throw fail();\r\n }\r\n const blackDepth = this.left.check();\r\n if (blackDepth !== this.right.check()) {\r\n throw fail();\r\n }\r\n else {\r\n return blackDepth + (this.isRed() ? 0 : 1);\r\n }\r\n }\r\n} // end LLRBNode\r\n// Empty node is shared between all LLRB trees.\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nLLRBNode.EMPTY = null;\r\nLLRBNode.RED = true;\r\nLLRBNode.BLACK = false;\r\n// Represents an empty node (a leaf node in the Red-Black Tree).\r\nclass LLRBEmptyNode {\r\n constructor() {\r\n this.size = 0;\r\n }\r\n get key() {\r\n throw fail();\r\n }\r\n get value() {\r\n throw fail();\r\n }\r\n get color() {\r\n throw fail();\r\n }\r\n get left() {\r\n throw fail();\r\n }\r\n get right() {\r\n throw fail();\r\n }\r\n // Returns a copy of the current node.\r\n copy(key, value, color, left, right) {\r\n return this;\r\n }\r\n // Returns a copy of the tree, with the specified key/value added.\r\n insert(key, value, comparator) {\r\n return new LLRBNode(key, value);\r\n }\r\n // Returns a copy of the tree, with the specified key removed.\r\n remove(key, comparator) {\r\n return this;\r\n }\r\n isEmpty() {\r\n return true;\r\n }\r\n inorderTraversal(action) {\r\n return false;\r\n }\r\n reverseTraversal(action) {\r\n return false;\r\n }\r\n minKey() {\r\n return null;\r\n }\r\n maxKey() {\r\n return null;\r\n }\r\n isRed() {\r\n return false;\r\n }\r\n // For testing.\r\n checkMaxDepth() {\r\n return true;\r\n }\r\n check() {\r\n return 0;\r\n }\r\n} // end LLRBEmptyNode\r\nLLRBNode.EMPTY = new LLRBEmptyNode();\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * SortedSet is an immutable (copy-on-write) collection that holds elements\r\n * in order specified by the provided comparator.\r\n *\r\n * NOTE: if provided comparator returns 0 for two elements, we consider them to\r\n * be equal!\r\n */\r\nclass SortedSet {\r\n constructor(comparator) {\r\n this.comparator = comparator;\r\n this.data = new SortedMap(this.comparator);\r\n }\r\n has(elem) {\r\n return this.data.get(elem) !== null;\r\n }\r\n first() {\r\n return this.data.minKey();\r\n }\r\n last() {\r\n return this.data.maxKey();\r\n }\r\n get size() {\r\n return this.data.size;\r\n }\r\n indexOf(elem) {\r\n return this.data.indexOf(elem);\r\n }\r\n /** Iterates elements in order defined by \"comparator\" */\r\n forEach(cb) {\r\n this.data.inorderTraversal((k, v) => {\r\n cb(k);\r\n return false;\r\n });\r\n }\r\n /** Iterates over `elem`s such that: range[0] &lt;= elem &lt; range[1]. */\r\n forEachInRange(range, cb) {\r\n const iter = this.data.getIteratorFrom(range[0]);\r\n while (iter.hasNext()) {\r\n const elem = iter.getNext();\r\n if (this.comparator(elem.key, range[1]) >= 0) {\r\n return;\r\n }\r\n cb(elem.key);\r\n }\r\n }\r\n /**\r\n * Iterates over `elem`s such that: start &lt;= elem until false is returned.\r\n */\r\n forEachWhile(cb, start) {\r\n let iter;\r\n if (start !== undefined) {\r\n iter = this.data.getIteratorFrom(start);\r\n }\r\n else {\r\n iter = this.data.getIterator();\r\n }\r\n while (iter.hasNext()) {\r\n const elem = iter.getNext();\r\n const result = cb(elem.key);\r\n if (!result) {\r\n return;\r\n }\r\n }\r\n }\r\n /** Finds the least element greater than or equal to `elem`. */\r\n firstAfterOrEqual(elem) {\r\n const iter = this.data.getIteratorFrom(elem);\r\n return iter.hasNext() ? iter.getNext().key : null;\r\n }\r\n getIterator() {\r\n return new SortedSetIterator(this.data.getIterator());\r\n }\r\n getIteratorFrom(key) {\r\n return new SortedSetIterator(this.data.getIteratorFrom(key));\r\n }\r\n /** Inserts or updates an element */\r\n add(elem) {\r\n return this.copy(this.data.remove(elem).insert(elem, true));\r\n }\r\n /** Deletes an element */\r\n delete(elem) {\r\n if (!this.has(elem)) {\r\n return this;\r\n }\r\n return this.copy(this.data.remove(elem));\r\n }\r\n isEmpty() {\r\n return this.data.isEmpty();\r\n }\r\n unionWith(other) {\r\n let result = this;\r\n // Make sure `result` always refers to the larger one of the two sets.\r\n if (result.size < other.size) {\r\n result = other;\r\n other = this;\r\n }\r\n other.forEach(elem => {\r\n result = result.add(elem);\r\n });\r\n return result;\r\n }\r\n isEqual(other) {\r\n if (!(other instanceof SortedSet)) {\r\n return false;\r\n }\r\n if (this.size !== other.size) {\r\n return false;\r\n }\r\n const thisIt = this.data.getIterator();\r\n const otherIt = other.data.getIterator();\r\n while (thisIt.hasNext()) {\r\n const thisElem = thisIt.getNext().key;\r\n const otherElem = otherIt.getNext().key;\r\n if (this.comparator(thisElem, otherElem) !== 0) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n toArray() {\r\n const res = [];\r\n this.forEach(targetId => {\r\n res.push(targetId);\r\n });\r\n return res;\r\n }\r\n toString() {\r\n const result = [];\r\n this.forEach(elem => result.push(elem));\r\n return 'SortedSet(' + result.toString() + ')';\r\n }\r\n copy(data) {\r\n const result = new SortedSet(this.comparator);\r\n result.data = data;\r\n return result;\r\n }\r\n}\r\nclass SortedSetIterator {\r\n constructor(iter) {\r\n this.iter = iter;\r\n }\r\n getNext() {\r\n return this.iter.getNext().key;\r\n }\r\n hasNext() {\r\n return this.iter.hasNext();\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst EMPTY_MUTABLE_DOCUMENT_MAP = new SortedMap(DocumentKey.comparator);\r\nfunction mutableDocumentMap() {\r\n return EMPTY_MUTABLE_DOCUMENT_MAP;\r\n}\r\nconst EMPTY_DOCUMENT_MAP = new SortedMap(DocumentKey.comparator);\r\nfunction documentMap() {\r\n return EMPTY_DOCUMENT_MAP;\r\n}\r\nconst EMPTY_DOCUMENT_VERSION_MAP = new SortedMap(DocumentKey.comparator);\r\nfunction documentVersionMap() {\r\n return EMPTY_DOCUMENT_VERSION_MAP;\r\n}\r\nconst EMPTY_DOCUMENT_KEY_SET = new SortedSet(DocumentKey.comparator);\r\nfunction documentKeySet(...keys) {\r\n let set = EMPTY_DOCUMENT_KEY_SET;\r\n for (const key of keys) {\r\n set = set.add(key);\r\n }\r\n return set;\r\n}\r\nconst EMPTY_TARGET_ID_SET = new SortedSet(primitiveComparator);\r\nfunction targetIdSet() {\r\n return EMPTY_TARGET_ID_SET;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Returns an DoubleValue for `value` that is encoded based the serializer's\r\n * `useProto3Json` setting.\r\n */\r\nfunction toDouble(serializer, value) {\r\n if (serializer.useProto3Json) {\r\n if (isNaN(value)) {\r\n return { doubleValue: 'NaN' };\r\n }\r\n else if (value === Infinity) {\r\n return { doubleValue: 'Infinity' };\r\n }\r\n else if (value === -Infinity) {\r\n return { doubleValue: '-Infinity' };\r\n }\r\n }\r\n return { doubleValue: isNegativeZero(value) ? '-0' : value };\r\n}\r\n/**\r\n * Returns an IntegerValue for `value`.\r\n */\r\nfunction toInteger(value) {\r\n return { integerValue: '' + value };\r\n}\r\n/**\r\n * Returns a value for a number that's appropriate to put into a proto.\r\n * The return value is an IntegerValue if it can safely represent the value,\r\n * otherwise a DoubleValue is returned.\r\n */\r\nfunction toNumber(serializer, value) {\r\n return isSafeInteger(value) ? toInteger(value) : toDouble(serializer, value);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2018 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/** Used to represent a field transform on a mutation. */\r\nclass TransformOperation {\r\n constructor() {\r\n // Make sure that the structural type of `TransformOperation` is unique.\r\n // See https://github.com/microsoft/TypeScript/issues/5451\r\n this._ = undefined;\r\n }\r\n}\r\n/**\r\n * Computes the local transform result against the provided `previousValue`,\r\n * optionally using the provided localWriteTime.\r\n */\r\nfunction applyTransformOperationToLocalView(transform, previousValue, localWriteTime) {\r\n if (transform instanceof ServerTimestampTransform) {\r\n return serverTimestamp$1(localWriteTime, previousValue);\r\n }\r\n else if (transform instanceof ArrayUnionTransformOperation) {\r\n return applyArrayUnionTransformOperation(transform, previousValue);\r\n }\r\n else if (transform instanceof ArrayRemoveTransformOperation) {\r\n return applyArrayRemoveTransformOperation(transform, previousValue);\r\n }\r\n else {\r\n return applyNumericIncrementTransformOperationToLocalView(transform, previousValue);\r\n }\r\n}\r\n/**\r\n * Computes a final transform result after the transform has been acknowledged\r\n * by the server, potentially using the server-provided transformResult.\r\n */\r\nfunction applyTransformOperationToRemoteDocument(transform, previousValue, transformResult) {\r\n // The server just sends null as the transform result for array operations,\r\n // so we have to calculate a result the same as we do for local\r\n // applications.\r\n if (transform instanceof ArrayUnionTransformOperation) {\r\n return applyArrayUnionTransformOperation(transform, previousValue);\r\n }\r\n else if (transform instanceof ArrayRemoveTransformOperation) {\r\n return applyArrayRemoveTransformOperation(transform, previousValue);\r\n }\r\n return transformResult;\r\n}\r\n/**\r\n * If this transform operation is not idempotent, returns the base value to\r\n * persist for this transform. If a base value is returned, the transform\r\n * operation is always applied to this base value, even if document has\r\n * already been updated.\r\n *\r\n * Base values provide consistent behavior for non-idempotent transforms and\r\n * allow us to return the same latency-compensated value even if the backend\r\n * has already applied the transform operation. The base value is null for\r\n * idempotent transforms, as they can be re-played even if the backend has\r\n * already applied them.\r\n *\r\n * @returns a base value to store along with the mutation, or null for\r\n * idempotent transforms.\r\n */\r\nfunction computeTransformOperationBaseValue(transform, previousValue) {\r\n if (transform instanceof NumericIncrementTransformOperation) {\r\n return isNumber(previousValue) ? previousValue : { integerValue: 0 };\r\n }\r\n return null;\r\n}\r\nfunction transformOperationEquals(left, right) {\r\n if (left instanceof ArrayUnionTransformOperation &&\r\n right instanceof ArrayUnionTransformOperation) {\r\n return arrayEquals(left.elements, right.elements, valueEquals);\r\n }\r\n else if (left instanceof ArrayRemoveTransformOperation &&\r\n right instanceof ArrayRemoveTransformOperation) {\r\n return arrayEquals(left.elements, right.elements, valueEquals);\r\n }\r\n else if (left instanceof NumericIncrementTransformOperation &&\r\n right instanceof NumericIncrementTransformOperation) {\r\n return valueEquals(left.operand, right.operand);\r\n }\r\n return (left instanceof ServerTimestampTransform &&\r\n right instanceof ServerTimestampTransform);\r\n}\r\n/** Transforms a value into a server-generated timestamp. */\r\nclass ServerTimestampTransform extends TransformOperation {\r\n}\r\n/** Transforms an array value via a union operation. */\r\nclass ArrayUnionTransformOperation extends TransformOperation {\r\n constructor(elements) {\r\n super();\r\n this.elements = elements;\r\n }\r\n}\r\nfunction applyArrayUnionTransformOperation(transform, previousValue) {\r\n const values = coercedFieldValuesArray(previousValue);\r\n for (const toUnion of transform.elements) {\r\n if (!values.some(element => valueEquals(element, toUnion))) {\r\n values.push(toUnion);\r\n }\r\n }\r\n return { arrayValue: { values } };\r\n}\r\n/** Transforms an array value via a remove operation. */\r\nclass ArrayRemoveTransformOperation extends TransformOperation {\r\n constructor(elements) {\r\n super();\r\n this.elements = elements;\r\n }\r\n}\r\nfunction applyArrayRemoveTransformOperation(transform, previousValue) {\r\n let values = coercedFieldValuesArray(previousValue);\r\n for (const toRemove of transform.elements) {\r\n values = values.filter(element => !valueEquals(element, toRemove));\r\n }\r\n return { arrayValue: { values } };\r\n}\r\n/**\r\n * Implements the backend semantics for locally computed NUMERIC_ADD (increment)\r\n * transforms. Converts all field values to integers or doubles, but unlike the\r\n * backend does not cap integer values at 2^63. Instead, JavaScript number\r\n * arithmetic is used and precision loss can occur for values greater than 2^53.\r\n */\r\nclass NumericIncrementTransformOperation extends TransformOperation {\r\n constructor(serializer, operand) {\r\n super();\r\n this.serializer = serializer;\r\n this.operand = operand;\r\n }\r\n}\r\nfunction applyNumericIncrementTransformOperationToLocalView(transform, previousValue) {\r\n // PORTING NOTE: Since JavaScript's integer arithmetic is limited to 53 bit\r\n // precision and resolves overflows by reducing precision, we do not\r\n // manually cap overflows at 2^63.\r\n const baseValue = computeTransformOperationBaseValue(transform, previousValue);\r\n const sum = asNumber(baseValue) + asNumber(transform.operand);\r\n if (isInteger(baseValue) && isInteger(transform.operand)) {\r\n return toInteger(sum);\r\n }\r\n else {\r\n return toDouble(transform.serializer, sum);\r\n }\r\n}\r\nfunction asNumber(value) {\r\n return normalizeNumber(value.integerValue || value.doubleValue);\r\n}\r\nfunction coercedFieldValuesArray(value) {\r\n return isArray(value) && value.arrayValue.values\r\n ? value.arrayValue.values.slice()\r\n : [];\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/** A field path and the TransformOperation to perform upon it. */\r\nclass FieldTransform {\r\n constructor(field, transform) {\r\n this.field = field;\r\n this.transform = transform;\r\n }\r\n}\r\nfunction fieldTransformEquals(left, right) {\r\n return (left.field.isEqual(right.field) &&\r\n transformOperationEquals(left.transform, right.transform));\r\n}\r\nfunction fieldTransformsAreEqual(left, right) {\r\n if (left === undefined && right === undefined) {\r\n return true;\r\n }\r\n if (left && right) {\r\n return arrayEquals(left, right, (l, r) => fieldTransformEquals(l, r));\r\n }\r\n return false;\r\n}\r\n/** The result of successfully applying a mutation to the backend. */\r\nclass MutationResult {\r\n constructor(\r\n /**\r\n * The version at which the mutation was committed:\r\n *\r\n * - For most operations, this is the updateTime in the WriteResult.\r\n * - For deletes, the commitTime of the WriteResponse (because deletes are\r\n * not stored and have no updateTime).\r\n *\r\n * Note that these versions can be different: No-op writes will not change\r\n * the updateTime even though the commitTime advances.\r\n */\r\n version, \r\n /**\r\n * The resulting fields returned from the backend after a mutation\r\n * containing field transforms has been committed. Contains one FieldValue\r\n * for each FieldTransform that was in the mutation.\r\n *\r\n * Will be empty if the mutation did not contain any field transforms.\r\n */\r\n transformResults) {\r\n this.version = version;\r\n this.transformResults = transformResults;\r\n }\r\n}\r\n/**\r\n * Encodes a precondition for a mutation. This follows the model that the\r\n * backend accepts with the special case of an explicit \"empty\" precondition\r\n * (meaning no precondition).\r\n */\r\nclass Precondition {\r\n constructor(updateTime, exists) {\r\n this.updateTime = updateTime;\r\n this.exists = exists;\r\n }\r\n /** Creates a new empty Precondition. */\r\n static none() {\r\n return new Precondition();\r\n }\r\n /** Creates a new Precondition with an exists flag. */\r\n static exists(exists) {\r\n return new Precondition(undefined, exists);\r\n }\r\n /** Creates a new Precondition based on a version a document exists at. */\r\n static updateTime(version) {\r\n return new Precondition(version);\r\n }\r\n /** Returns whether this Precondition is empty. */\r\n get isNone() {\r\n return this.updateTime === undefined && this.exists === undefined;\r\n }\r\n isEqual(other) {\r\n return (this.exists === other.exists &&\r\n (this.updateTime\r\n ? !!other.updateTime && this.updateTime.isEqual(other.updateTime)\r\n : !other.updateTime));\r\n }\r\n}\r\n/** Returns true if the preconditions is valid for the given document. */\r\nfunction preconditionIsValidForDocument(precondition, document) {\r\n if (precondition.updateTime !== undefined) {\r\n return (document.isFoundDocument() &&\r\n document.version.isEqual(precondition.updateTime));\r\n }\r\n else if (precondition.exists !== undefined) {\r\n return precondition.exists === document.isFoundDocument();\r\n }\r\n else {\r\n return true;\r\n }\r\n}\r\n/**\r\n * A mutation describes a self-contained change to a document. Mutations can\r\n * create, replace, delete, and update subsets of documents.\r\n *\r\n * Mutations not only act on the value of the document but also its version.\r\n *\r\n * For local mutations (mutations that haven't been committed yet), we preserve\r\n * the existing version for Set and Patch mutations. For Delete mutations, we\r\n * reset the version to 0.\r\n *\r\n * Here's the expected transition table.\r\n *\r\n * MUTATION APPLIED TO RESULTS IN\r\n *\r\n * SetMutation Document(v3) Document(v3)\r\n * SetMutation NoDocument(v3) Document(v0)\r\n * SetMutation InvalidDocument(v0) Document(v0)\r\n * PatchMutation Document(v3) Document(v3)\r\n * PatchMutation NoDocument(v3) NoDocument(v3)\r\n * PatchMutation InvalidDocument(v0) UnknownDocument(v3)\r\n * DeleteMutation Document(v3) NoDocument(v0)\r\n * DeleteMutation NoDocument(v3) NoDocument(v0)\r\n * DeleteMutation InvalidDocument(v0) NoDocument(v0)\r\n *\r\n * For acknowledged mutations, we use the updateTime of the WriteResponse as\r\n * the resulting version for Set and Patch mutations. As deletes have no\r\n * explicit update time, we use the commitTime of the WriteResponse for\r\n * Delete mutations.\r\n *\r\n * If a mutation is acknowledged by the backend but fails the precondition check\r\n * locally, we transition to an `UnknownDocument` and rely on Watch to send us\r\n * the updated version.\r\n *\r\n * Field transforms are used only with Patch and Set Mutations. We use the\r\n * `updateTransforms` message to store transforms, rather than the `transforms`s\r\n * messages.\r\n *\r\n * ## Subclassing Notes\r\n *\r\n * Every type of mutation needs to implement its own applyToRemoteDocument() and\r\n * applyToLocalView() to implement the actual behavior of applying the mutation\r\n * to some source document (see `setMutationApplyToRemoteDocument()` for an\r\n * example).\r\n */\r\nclass Mutation {\r\n}\r\n/**\r\n * Applies this mutation to the given document for the purposes of computing a\r\n * new remote document. If the input document doesn't match the expected state\r\n * (e.g. it is invalid or outdated), the document type may transition to\r\n * unknown.\r\n *\r\n * @param mutation - The mutation to apply.\r\n * @param document - The document to mutate. The input document can be an\r\n * invalid document if the client has no knowledge of the pre-mutation state\r\n * of the document.\r\n * @param mutationResult - The result of applying the mutation from the backend.\r\n */\r\nfunction mutationApplyToRemoteDocument(mutation, document, mutationResult) {\r\n if (mutation instanceof SetMutation) {\r\n setMutationApplyToRemoteDocument(mutation, document, mutationResult);\r\n }\r\n else if (mutation instanceof PatchMutation) {\r\n patchMutationApplyToRemoteDocument(mutation, document, mutationResult);\r\n }\r\n else {\r\n deleteMutationApplyToRemoteDocument(mutation, document, mutationResult);\r\n }\r\n}\r\n/**\r\n * Applies this mutation to the given document for the purposes of computing\r\n * the new local view of a document. If the input document doesn't match the\r\n * expected state, the document is not modified.\r\n *\r\n * @param mutation - The mutation to apply.\r\n * @param document - The document to mutate. The input document can be an\r\n * invalid document if the client has no knowledge of the pre-mutation state\r\n * of the document.\r\n * @param localWriteTime - A timestamp indicating the local write time of the\r\n * batch this mutation is a part of.\r\n */\r\nfunction mutationApplyToLocalView(mutation, document, localWriteTime) {\r\n if (mutation instanceof SetMutation) {\r\n setMutationApplyToLocalView(mutation, document, localWriteTime);\r\n }\r\n else if (mutation instanceof PatchMutation) {\r\n patchMutationApplyToLocalView(mutation, document, localWriteTime);\r\n }\r\n else {\r\n deleteMutationApplyToLocalView(mutation, document);\r\n }\r\n}\r\n/**\r\n * If this mutation is not idempotent, returns the base value to persist with\r\n * this mutation. If a base value is returned, the mutation is always applied\r\n * to this base value, even if document has already been updated.\r\n *\r\n * The base value is a sparse object that consists of only the document\r\n * fields for which this mutation contains a non-idempotent transformation\r\n * (e.g. a numeric increment). The provided value guarantees consistent\r\n * behavior for non-idempotent transforms and allow us to return the same\r\n * latency-compensated value even if the backend has already applied the\r\n * mutation. The base value is null for idempotent mutations, as they can be\r\n * re-played even if the backend has already applied them.\r\n *\r\n * @returns a base value to store along with the mutation, or null for\r\n * idempotent mutations.\r\n */\r\nfunction mutationExtractBaseValue(mutation, document) {\r\n let baseObject = null;\r\n for (const fieldTransform of mutation.fieldTransforms) {\r\n const existingValue = document.data.field(fieldTransform.field);\r\n const coercedValue = computeTransformOperationBaseValue(fieldTransform.transform, existingValue || null);\r\n if (coercedValue != null) {\r\n if (baseObject == null) {\r\n baseObject = ObjectValue.empty();\r\n }\r\n baseObject.set(fieldTransform.field, coercedValue);\r\n }\r\n }\r\n return baseObject ? baseObject : null;\r\n}\r\nfunction mutationEquals(left, right) {\r\n if (left.type !== right.type) {\r\n return false;\r\n }\r\n if (!left.key.isEqual(right.key)) {\r\n return false;\r\n }\r\n if (!left.precondition.isEqual(right.precondition)) {\r\n return false;\r\n }\r\n if (!fieldTransformsAreEqual(left.fieldTransforms, right.fieldTransforms)) {\r\n return false;\r\n }\r\n if (left.type === 0 /* Set */) {\r\n return left.value.isEqual(right.value);\r\n }\r\n if (left.type === 1 /* Patch */) {\r\n return (left.data.isEqual(right.data) &&\r\n left.fieldMask.isEqual(right.fieldMask));\r\n }\r\n return true;\r\n}\r\n/**\r\n * Returns the version from the given document for use as the result of a\r\n * mutation. Mutations are defined to return the version of the base document\r\n * only if it is an existing document. Deleted and unknown documents have a\r\n * post-mutation version of SnapshotVersion.min().\r\n */\r\nfunction getPostMutationVersion(document) {\r\n return document.isFoundDocument() ? document.version : SnapshotVersion.min();\r\n}\r\n/**\r\n * A mutation that creates or replaces the document at the given key with the\r\n * object value contents.\r\n */\r\nclass SetMutation extends Mutation {\r\n constructor(key, value, precondition, fieldTransforms = []) {\r\n super();\r\n this.key = key;\r\n this.value = value;\r\n this.precondition = precondition;\r\n this.fieldTransforms = fieldTransforms;\r\n this.type = 0 /* Set */;\r\n }\r\n}\r\nfunction setMutationApplyToRemoteDocument(mutation, document, mutationResult) {\r\n // Unlike setMutationApplyToLocalView, if we're applying a mutation to a\r\n // remote document the server has accepted the mutation so the precondition\r\n // must have held.\r\n const newData = mutation.value.clone();\r\n const transformResults = serverTransformResults(mutation.fieldTransforms, document, mutationResult.transformResults);\r\n newData.setAll(transformResults);\r\n document\r\n .convertToFoundDocument(mutationResult.version, newData)\r\n .setHasCommittedMutations();\r\n}\r\nfunction setMutationApplyToLocalView(mutation, document, localWriteTime) {\r\n if (!preconditionIsValidForDocument(mutation.precondition, document)) {\r\n // The mutation failed to apply (e.g. a document ID created with add()\r\n // caused a name collision).\r\n return;\r\n }\r\n const newData = mutation.value.clone();\r\n const transformResults = localTransformResults(mutation.fieldTransforms, localWriteTime, document);\r\n newData.setAll(transformResults);\r\n document\r\n .convertToFoundDocument(getPostMutationVersion(document), newData)\r\n .setHasLocalMutations();\r\n}\r\n/**\r\n * A mutation that modifies fields of the document at the given key with the\r\n * given values. The values are applied through a field mask:\r\n *\r\n * * When a field is in both the mask and the values, the corresponding field\r\n * is updated.\r\n * * When a field is in neither the mask nor the values, the corresponding\r\n * field is unmodified.\r\n * * When a field is in the mask but not in the values, the corresponding field\r\n * is deleted.\r\n * * When a field is not in the mask but is in the values, the values map is\r\n * ignored.\r\n */\r\nclass PatchMutation extends Mutation {\r\n constructor(key, data, fieldMask, precondition, fieldTransforms = []) {\r\n super();\r\n this.key = key;\r\n this.data = data;\r\n this.fieldMask = fieldMask;\r\n this.precondition = precondition;\r\n this.fieldTransforms = fieldTransforms;\r\n this.type = 1 /* Patch */;\r\n }\r\n}\r\nfunction patchMutationApplyToRemoteDocument(mutation, document, mutationResult) {\r\n if (!preconditionIsValidForDocument(mutation.precondition, document)) {\r\n // Since the mutation was not rejected, we know that the precondition\r\n // matched on the backend. We therefore must not have the expected version\r\n // of the document in our cache and convert to an UnknownDocument with a\r\n // known updateTime.\r\n document.convertToUnknownDocument(mutationResult.version);\r\n return;\r\n }\r\n const transformResults = serverTransformResults(mutation.fieldTransforms, document, mutationResult.transformResults);\r\n const newData = document.data;\r\n newData.setAll(getPatch(mutation));\r\n newData.setAll(transformResults);\r\n document\r\n .convertToFoundDocument(mutationResult.version, newData)\r\n .setHasCommittedMutations();\r\n}\r\nfunction patchMutationApplyToLocalView(mutation, document, localWriteTime) {\r\n if (!preconditionIsValidForDocument(mutation.precondition, document)) {\r\n return;\r\n }\r\n const transformResults = localTransformResults(mutation.fieldTransforms, localWriteTime, document);\r\n const newData = document.data;\r\n newData.setAll(getPatch(mutation));\r\n newData.setAll(transformResults);\r\n document\r\n .convertToFoundDocument(getPostMutationVersion(document), newData)\r\n .setHasLocalMutations();\r\n}\r\n/**\r\n * Returns a FieldPath/Value map with the content of the PatchMutation.\r\n */\r\nfunction getPatch(mutation) {\r\n const result = new Map();\r\n mutation.fieldMask.fields.forEach(fieldPath => {\r\n if (!fieldPath.isEmpty()) {\r\n const newValue = mutation.data.field(fieldPath);\r\n result.set(fieldPath, newValue);\r\n }\r\n });\r\n return result;\r\n}\r\n/**\r\n * Creates a list of \"transform results\" (a transform result is a field value\r\n * representing the result of applying a transform) for use after a mutation\r\n * containing transforms has been acknowledged by the server.\r\n *\r\n * @param fieldTransforms - The field transforms to apply the result to.\r\n * @param mutableDocument - The current state of the document after applying all\r\n * previous mutations.\r\n * @param serverTransformResults - The transform results received by the server.\r\n * @returns The transform results list.\r\n */\r\nfunction serverTransformResults(fieldTransforms, mutableDocument, serverTransformResults) {\r\n const transformResults = new Map();\r\n hardAssert(fieldTransforms.length === serverTransformResults.length);\r\n for (let i = 0; i < serverTransformResults.length; i++) {\r\n const fieldTransform = fieldTransforms[i];\r\n const transform = fieldTransform.transform;\r\n const previousValue = mutableDocument.data.field(fieldTransform.field);\r\n transformResults.set(fieldTransform.field, applyTransformOperationToRemoteDocument(transform, previousValue, serverTransformResults[i]));\r\n }\r\n return transformResults;\r\n}\r\n/**\r\n * Creates a list of \"transform results\" (a transform result is a field value\r\n * representing the result of applying a transform) for use when applying a\r\n * transform locally.\r\n *\r\n * @param fieldTransforms - The field transforms to apply the result to.\r\n * @param localWriteTime - The local time of the mutation (used to\r\n * generate ServerTimestampValues).\r\n * @param mutableDocument - The current state of the document after applying all\r\n * previous mutations.\r\n * @returns The transform results list.\r\n */\r\nfunction localTransformResults(fieldTransforms, localWriteTime, mutableDocument) {\r\n const transformResults = new Map();\r\n for (const fieldTransform of fieldTransforms) {\r\n const transform = fieldTransform.transform;\r\n const previousValue = mutableDocument.data.field(fieldTransform.field);\r\n transformResults.set(fieldTransform.field, applyTransformOperationToLocalView(transform, previousValue, localWriteTime));\r\n }\r\n return transformResults;\r\n}\r\n/** A mutation that deletes the document at the given key. */\r\nclass DeleteMutation extends Mutation {\r\n constructor(key, precondition) {\r\n super();\r\n this.key = key;\r\n this.precondition = precondition;\r\n this.type = 2 /* Delete */;\r\n this.fieldTransforms = [];\r\n }\r\n}\r\nfunction deleteMutationApplyToRemoteDocument(mutation, document, mutationResult) {\r\n // Unlike applyToLocalView, if we're applying a mutation to a remote\r\n // document the server has accepted the mutation so the precondition must\r\n // have held.\r\n document\r\n .convertToNoDocument(mutationResult.version)\r\n .setHasCommittedMutations();\r\n}\r\nfunction deleteMutationApplyToLocalView(mutation, document) {\r\n if (preconditionIsValidForDocument(mutation.precondition, document)) {\r\n // We don't call `setHasLocalMutations()` since we want to be backwards\r\n // compatible with the existing SDK behavior.\r\n document.convertToNoDocument(SnapshotVersion.min());\r\n }\r\n}\r\n/**\r\n * A mutation that verifies the existence of the document at the given key with\r\n * the provided precondition.\r\n *\r\n * The `verify` operation is only used in Transactions, and this class serves\r\n * primarily to facilitate serialization into protos.\r\n */\r\nclass VerifyMutation extends Mutation {\r\n constructor(key, precondition) {\r\n super();\r\n this.key = key;\r\n this.precondition = precondition;\r\n this.type = 3 /* Verify */;\r\n this.fieldTransforms = [];\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A batch of mutations that will be sent as one unit to the backend.\r\n */\r\nclass MutationBatch {\r\n /**\r\n * @param batchId - The unique ID of this mutation batch.\r\n * @param localWriteTime - The original write time of this mutation.\r\n * @param baseMutations - Mutations that are used to populate the base\r\n * values when this mutation is applied locally. This can be used to locally\r\n * overwrite values that are persisted in the remote document cache. Base\r\n * mutations are never sent to the backend.\r\n * @param mutations - The user-provided mutations in this mutation batch.\r\n * User-provided mutations are applied both locally and remotely on the\r\n * backend.\r\n */\r\n constructor(batchId, localWriteTime, baseMutations, mutations) {\r\n this.batchId = batchId;\r\n this.localWriteTime = localWriteTime;\r\n this.baseMutations = baseMutations;\r\n this.mutations = mutations;\r\n }\r\n /**\r\n * Applies all the mutations in this MutationBatch to the specified document\r\n * to compute the state of the remote document\r\n *\r\n * @param document - The document to apply mutations to.\r\n * @param batchResult - The result of applying the MutationBatch to the\r\n * backend.\r\n */\r\n applyToRemoteDocument(document, batchResult) {\r\n const mutationResults = batchResult.mutationResults;\r\n for (let i = 0; i < this.mutations.length; i++) {\r\n const mutation = this.mutations[i];\r\n if (mutation.key.isEqual(document.key)) {\r\n const mutationResult = mutationResults[i];\r\n mutationApplyToRemoteDocument(mutation, document, mutationResult);\r\n }\r\n }\r\n }\r\n /**\r\n * Computes the local view of a document given all the mutations in this\r\n * batch.\r\n *\r\n * @param document - The document to apply mutations to.\r\n */\r\n applyToLocalView(document) {\r\n // First, apply the base state. This allows us to apply non-idempotent\r\n // transform against a consistent set of values.\r\n for (const mutation of this.baseMutations) {\r\n if (mutation.key.isEqual(document.key)) {\r\n mutationApplyToLocalView(mutation, document, this.localWriteTime);\r\n }\r\n }\r\n // Second, apply all user-provided mutations.\r\n for (const mutation of this.mutations) {\r\n if (mutation.key.isEqual(document.key)) {\r\n mutationApplyToLocalView(mutation, document, this.localWriteTime);\r\n }\r\n }\r\n }\r\n /**\r\n * Computes the local view for all provided documents given the mutations in\r\n * this batch.\r\n */\r\n applyToLocalDocumentSet(documentMap) {\r\n // TODO(mrschmidt): This implementation is O(n^2). If we apply the mutations\r\n // directly (as done in `applyToLocalView()`), we can reduce the complexity\r\n // to O(n).\r\n this.mutations.forEach(m => {\r\n const document = documentMap.get(m.key);\r\n // TODO(mutabledocuments): This method should take a MutableDocumentMap\r\n // and we should remove this cast.\r\n const mutableDocument = document;\r\n this.applyToLocalView(mutableDocument);\r\n if (!document.isValidDocument()) {\r\n mutableDocument.convertToNoDocument(SnapshotVersion.min());\r\n }\r\n });\r\n }\r\n keys() {\r\n return this.mutations.reduce((keys, m) => keys.add(m.key), documentKeySet());\r\n }\r\n isEqual(other) {\r\n return (this.batchId === other.batchId &&\r\n arrayEquals(this.mutations, other.mutations, (l, r) => mutationEquals(l, r)) &&\r\n arrayEquals(this.baseMutations, other.baseMutations, (l, r) => mutationEquals(l, r)));\r\n }\r\n}\r\n/** The result of applying a mutation batch to the backend. */\r\nclass MutationBatchResult {\r\n constructor(batch, commitVersion, mutationResults, \r\n /**\r\n * A pre-computed mapping from each mutated document to the resulting\r\n * version.\r\n */\r\n docVersions) {\r\n this.batch = batch;\r\n this.commitVersion = commitVersion;\r\n this.mutationResults = mutationResults;\r\n this.docVersions = docVersions;\r\n }\r\n /**\r\n * Creates a new MutationBatchResult for the given batch and results. There\r\n * must be one result for each mutation in the batch. This static factory\r\n * caches a document=&gt;version mapping (docVersions).\r\n */\r\n static from(batch, commitVersion, results) {\r\n hardAssert(batch.mutations.length === results.length);\r\n let versionMap = documentVersionMap();\r\n const mutations = batch.mutations;\r\n for (let i = 0; i < mutations.length; i++) {\r\n versionMap = versionMap.insert(mutations[i].key, results[i].version);\r\n }\r\n return new MutationBatchResult(batch, commitVersion, results, versionMap);\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nclass ExistenceFilter {\r\n // TODO(b/33078163): just use simplest form of existence filter for now\r\n constructor(count) {\r\n this.count = count;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Error Codes describing the different ways GRPC can fail. These are copied\r\n * directly from GRPC's sources here:\r\n *\r\n * https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h\r\n *\r\n * Important! The names of these identifiers matter because the string forms\r\n * are used for reverse lookups from the webchannel stream. Do NOT change the\r\n * names of these identifiers or change this into a const enum.\r\n */\r\nvar RpcCode;\r\n(function (RpcCode) {\r\n RpcCode[RpcCode[\"OK\"] = 0] = \"OK\";\r\n RpcCode[RpcCode[\"CANCELLED\"] = 1] = \"CANCELLED\";\r\n RpcCode[RpcCode[\"UNKNOWN\"] = 2] = \"UNKNOWN\";\r\n RpcCode[RpcCode[\"INVALID_ARGUMENT\"] = 3] = \"INVALID_ARGUMENT\";\r\n RpcCode[RpcCode[\"DEADLINE_EXCEEDED\"] = 4] = \"DEADLINE_EXCEEDED\";\r\n RpcCode[RpcCode[\"NOT_FOUND\"] = 5] = \"NOT_FOUND\";\r\n RpcCode[RpcCode[\"ALREADY_EXISTS\"] = 6] = \"ALREADY_EXISTS\";\r\n RpcCode[RpcCode[\"PERMISSION_DENIED\"] = 7] = \"PERMISSION_DENIED\";\r\n RpcCode[RpcCode[\"UNAUTHENTICATED\"] = 16] = \"UNAUTHENTICATED\";\r\n RpcCode[RpcCode[\"RESOURCE_EXHAUSTED\"] = 8] = \"RESOURCE_EXHAUSTED\";\r\n RpcCode[RpcCode[\"FAILED_PRECONDITION\"] = 9] = \"FAILED_PRECONDITION\";\r\n RpcCode[RpcCode[\"ABORTED\"] = 10] = \"ABORTED\";\r\n RpcCode[RpcCode[\"OUT_OF_RANGE\"] = 11] = \"OUT_OF_RANGE\";\r\n RpcCode[RpcCode[\"UNIMPLEMENTED\"] = 12] = \"UNIMPLEMENTED\";\r\n RpcCode[RpcCode[\"INTERNAL\"] = 13] = \"INTERNAL\";\r\n RpcCode[RpcCode[\"UNAVAILABLE\"] = 14] = \"UNAVAILABLE\";\r\n RpcCode[RpcCode[\"DATA_LOSS\"] = 15] = \"DATA_LOSS\";\r\n})(RpcCode || (RpcCode = {}));\r\n/**\r\n * Determines whether an error code represents a permanent error when received\r\n * in response to a non-write operation.\r\n *\r\n * See isPermanentWriteError for classifying write errors.\r\n */\r\nfunction isPermanentError(code) {\r\n switch (code) {\r\n case Code.OK:\r\n return fail();\r\n case Code.CANCELLED:\r\n case Code.UNKNOWN:\r\n case Code.DEADLINE_EXCEEDED:\r\n case Code.RESOURCE_EXHAUSTED:\r\n case Code.INTERNAL:\r\n case Code.UNAVAILABLE:\r\n // Unauthenticated means something went wrong with our token and we need\r\n // to retry with new credentials which will happen automatically.\r\n case Code.UNAUTHENTICATED:\r\n return false;\r\n case Code.INVALID_ARGUMENT:\r\n case Code.NOT_FOUND:\r\n case Code.ALREADY_EXISTS:\r\n case Code.PERMISSION_DENIED:\r\n case Code.FAILED_PRECONDITION:\r\n // Aborted might be retried in some scenarios, but that is dependant on\r\n // the context and should handled individually by the calling code.\r\n // See https://cloud.google.com/apis/design/errors.\r\n case Code.ABORTED:\r\n case Code.OUT_OF_RANGE:\r\n case Code.UNIMPLEMENTED:\r\n case Code.DATA_LOSS:\r\n return true;\r\n default:\r\n return fail();\r\n }\r\n}\r\n/**\r\n * Determines whether an error code represents a permanent error when received\r\n * in response to a write operation.\r\n *\r\n * Write operations must be handled specially because as of b/119437764, ABORTED\r\n * errors on the write stream should be retried too (even though ABORTED errors\r\n * are not generally retryable).\r\n *\r\n * Note that during the initial handshake on the write stream an ABORTED error\r\n * signals that we should discard our stream token (i.e. it is permanent). This\r\n * means a handshake error should be classified with isPermanentError, above.\r\n */\r\nfunction isPermanentWriteError(code) {\r\n return isPermanentError(code) && code !== Code.ABORTED;\r\n}\r\n/**\r\n * Maps an error Code from GRPC status code number, like 0, 1, or 14. These\r\n * are not the same as HTTP status codes.\r\n *\r\n * @returns The Code equivalent to the given GRPC status code. Fails if there\r\n * is no match.\r\n */\r\nfunction mapCodeFromRpcCode(code) {\r\n if (code === undefined) {\r\n // This shouldn't normally happen, but in certain error cases (like trying\r\n // to send invalid proto messages) we may get an error with no GRPC code.\r\n logError('GRPC error has no .code');\r\n return Code.UNKNOWN;\r\n }\r\n switch (code) {\r\n case RpcCode.OK:\r\n return Code.OK;\r\n case RpcCode.CANCELLED:\r\n return Code.CANCELLED;\r\n case RpcCode.UNKNOWN:\r\n return Code.UNKNOWN;\r\n case RpcCode.DEADLINE_EXCEEDED:\r\n return Code.DEADLINE_EXCEEDED;\r\n case RpcCode.RESOURCE_EXHAUSTED:\r\n return Code.RESOURCE_EXHAUSTED;\r\n case RpcCode.INTERNAL:\r\n return Code.INTERNAL;\r\n case RpcCode.UNAVAILABLE:\r\n return Code.UNAVAILABLE;\r\n case RpcCode.UNAUTHENTICATED:\r\n return Code.UNAUTHENTICATED;\r\n case RpcCode.INVALID_ARGUMENT:\r\n return Code.INVALID_ARGUMENT;\r\n case RpcCode.NOT_FOUND:\r\n return Code.NOT_FOUND;\r\n case RpcCode.ALREADY_EXISTS:\r\n return Code.ALREADY_EXISTS;\r\n case RpcCode.PERMISSION_DENIED:\r\n return Code.PERMISSION_DENIED;\r\n case RpcCode.FAILED_PRECONDITION:\r\n return Code.FAILED_PRECONDITION;\r\n case RpcCode.ABORTED:\r\n return Code.ABORTED;\r\n case RpcCode.OUT_OF_RANGE:\r\n return Code.OUT_OF_RANGE;\r\n case RpcCode.UNIMPLEMENTED:\r\n return Code.UNIMPLEMENTED;\r\n case RpcCode.DATA_LOSS:\r\n return Code.DATA_LOSS;\r\n default:\r\n return fail();\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * An event from the RemoteStore. It is split into targetChanges (changes to the\r\n * state or the set of documents in our watched targets) and documentUpdates\r\n * (changes to the actual documents).\r\n */\r\nclass RemoteEvent {\r\n constructor(\r\n /**\r\n * The snapshot version this event brings us up to, or MIN if not set.\r\n */\r\n snapshotVersion, \r\n /**\r\n * A map from target to changes to the target. See TargetChange.\r\n */\r\n targetChanges, \r\n /**\r\n * A set of targets that is known to be inconsistent. Listens for these\r\n * targets should be re-established without resume tokens.\r\n */\r\n targetMismatches, \r\n /**\r\n * A set of which documents have changed or been deleted, along with the\r\n * doc's new values (if not deleted).\r\n */\r\n documentUpdates, \r\n /**\r\n * A set of which document updates are due only to limbo resolution targets.\r\n */\r\n resolvedLimboDocuments) {\r\n this.snapshotVersion = snapshotVersion;\r\n this.targetChanges = targetChanges;\r\n this.targetMismatches = targetMismatches;\r\n this.documentUpdates = documentUpdates;\r\n this.resolvedLimboDocuments = resolvedLimboDocuments;\r\n }\r\n /**\r\n * HACK: Views require RemoteEvents in order to determine whether the view is\r\n * CURRENT, but secondary tabs don't receive remote events. So this method is\r\n * used to create a synthesized RemoteEvent that can be used to apply a\r\n * CURRENT status change to a View, for queries executed in a different tab.\r\n */\r\n // PORTING NOTE: Multi-tab only\r\n static createSynthesizedRemoteEventForCurrentChange(targetId, current) {\r\n const targetChanges = new Map();\r\n targetChanges.set(targetId, TargetChange.createSynthesizedTargetChangeForCurrentChange(targetId, current));\r\n return new RemoteEvent(SnapshotVersion.min(), targetChanges, targetIdSet(), mutableDocumentMap(), documentKeySet());\r\n }\r\n}\r\n/**\r\n * A TargetChange specifies the set of changes for a specific target as part of\r\n * a RemoteEvent. These changes track which documents are added, modified or\r\n * removed, as well as the target's resume token and whether the target is\r\n * marked CURRENT.\r\n * The actual changes *to* documents are not part of the TargetChange since\r\n * documents may be part of multiple targets.\r\n */\r\nclass TargetChange {\r\n constructor(\r\n /**\r\n * An opaque, server-assigned token that allows watching a query to be resumed\r\n * after disconnecting without retransmitting all the data that matches the\r\n * query. The resume token essentially identifies a point in time from which\r\n * the server should resume sending results.\r\n */\r\n resumeToken, \r\n /**\r\n * The \"current\" (synced) status of this target. Note that \"current\"\r\n * has special meaning in the RPC protocol that implies that a target is\r\n * both up-to-date and consistent with the rest of the watch stream.\r\n */\r\n current, \r\n /**\r\n * The set of documents that were newly assigned to this target as part of\r\n * this remote event.\r\n */\r\n addedDocuments, \r\n /**\r\n * The set of documents that were already assigned to this target but received\r\n * an update during this remote event.\r\n */\r\n modifiedDocuments, \r\n /**\r\n * The set of documents that were removed from this target as part of this\r\n * remote event.\r\n */\r\n removedDocuments) {\r\n this.resumeToken = resumeToken;\r\n this.current = current;\r\n this.addedDocuments = addedDocuments;\r\n this.modifiedDocuments = modifiedDocuments;\r\n this.removedDocuments = removedDocuments;\r\n }\r\n /**\r\n * This method is used to create a synthesized TargetChanges that can be used to\r\n * apply a CURRENT status change to a View (for queries executed in a different\r\n * tab) or for new queries (to raise snapshots with correct CURRENT status).\r\n */\r\n static createSynthesizedTargetChangeForCurrentChange(targetId, current) {\r\n return new TargetChange(ByteString.EMPTY_BYTE_STRING, current, documentKeySet(), documentKeySet(), documentKeySet());\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Represents a changed document and a list of target ids to which this change\r\n * applies.\r\n *\r\n * If document has been deleted NoDocument will be provided.\r\n */\r\nclass DocumentWatchChange {\r\n constructor(\r\n /** The new document applies to all of these targets. */\r\n updatedTargetIds, \r\n /** The new document is removed from all of these targets. */\r\n removedTargetIds, \r\n /** The key of the document for this change. */\r\n key, \r\n /**\r\n * The new document or NoDocument if it was deleted. Is null if the\r\n * document went out of view without the server sending a new document.\r\n */\r\n newDoc) {\r\n this.updatedTargetIds = updatedTargetIds;\r\n this.removedTargetIds = removedTargetIds;\r\n this.key = key;\r\n this.newDoc = newDoc;\r\n }\r\n}\r\nclass ExistenceFilterChange {\r\n constructor(targetId, existenceFilter) {\r\n this.targetId = targetId;\r\n this.existenceFilter = existenceFilter;\r\n }\r\n}\r\nclass WatchTargetChange {\r\n constructor(\r\n /** What kind of change occurred to the watch target. */\r\n state, \r\n /** The target IDs that were added/removed/set. */\r\n targetIds, \r\n /**\r\n * An opaque, server-assigned token that allows watching a target to be\r\n * resumed after disconnecting without retransmitting all the data that\r\n * matches the target. The resume token essentially identifies a point in\r\n * time from which the server should resume sending results.\r\n */\r\n resumeToken = ByteString.EMPTY_BYTE_STRING, \r\n /** An RPC error indicating why the watch failed. */\r\n cause = null) {\r\n this.state = state;\r\n this.targetIds = targetIds;\r\n this.resumeToken = resumeToken;\r\n this.cause = cause;\r\n }\r\n}\r\n/** Tracks the internal state of a Watch target. */\r\nclass TargetState {\r\n constructor() {\r\n /**\r\n * The number of pending responses (adds or removes) that we are waiting on.\r\n * We only consider targets active that have no pending responses.\r\n */\r\n this.pendingResponses = 0;\r\n /**\r\n * Keeps track of the document changes since the last raised snapshot.\r\n *\r\n * These changes are continuously updated as we receive document updates and\r\n * always reflect the current set of changes against the last issued snapshot.\r\n */\r\n this.documentChanges = snapshotChangesMap();\r\n /** See public getters for explanations of these fields. */\r\n this._resumeToken = ByteString.EMPTY_BYTE_STRING;\r\n this._current = false;\r\n /**\r\n * Whether this target state should be included in the next snapshot. We\r\n * initialize to true so that newly-added targets are included in the next\r\n * RemoteEvent.\r\n */\r\n this._hasPendingChanges = true;\r\n }\r\n /**\r\n * Whether this target has been marked 'current'.\r\n *\r\n * 'Current' has special meaning in the RPC protocol: It implies that the\r\n * Watch backend has sent us all changes up to the point at which the target\r\n * was added and that the target is consistent with the rest of the watch\r\n * stream.\r\n */\r\n get current() {\r\n return this._current;\r\n }\r\n /** The last resume token sent to us for this target. */\r\n get resumeToken() {\r\n return this._resumeToken;\r\n }\r\n /** Whether this target has pending target adds or target removes. */\r\n get isPending() {\r\n return this.pendingResponses !== 0;\r\n }\r\n /** Whether we have modified any state that should trigger a snapshot. */\r\n get hasPendingChanges() {\r\n return this._hasPendingChanges;\r\n }\r\n /**\r\n * Applies the resume token to the TargetChange, but only when it has a new\r\n * value. Empty resumeTokens are discarded.\r\n */\r\n updateResumeToken(resumeToken) {\r\n if (resumeToken.approximateByteSize() > 0) {\r\n this._hasPendingChanges = true;\r\n this._resumeToken = resumeToken;\r\n }\r\n }\r\n /**\r\n * Creates a target change from the current set of changes.\r\n *\r\n * To reset the document changes after raising this snapshot, call\r\n * `clearPendingChanges()`.\r\n */\r\n toTargetChange() {\r\n let addedDocuments = documentKeySet();\r\n let modifiedDocuments = documentKeySet();\r\n let removedDocuments = documentKeySet();\r\n this.documentChanges.forEach((key, changeType) => {\r\n switch (changeType) {\r\n case 0 /* Added */:\r\n addedDocuments = addedDocuments.add(key);\r\n break;\r\n case 2 /* Modified */:\r\n modifiedDocuments = modifiedDocuments.add(key);\r\n break;\r\n case 1 /* Removed */:\r\n removedDocuments = removedDocuments.add(key);\r\n break;\r\n default:\r\n fail();\r\n }\r\n });\r\n return new TargetChange(this._resumeToken, this._current, addedDocuments, modifiedDocuments, removedDocuments);\r\n }\r\n /**\r\n * Resets the document changes and sets `hasPendingChanges` to false.\r\n */\r\n clearPendingChanges() {\r\n this._hasPendingChanges = false;\r\n this.documentChanges = snapshotChangesMap();\r\n }\r\n addDocumentChange(key, changeType) {\r\n this._hasPendingChanges = true;\r\n this.documentChanges = this.documentChanges.insert(key, changeType);\r\n }\r\n removeDocumentChange(key) {\r\n this._hasPendingChanges = true;\r\n this.documentChanges = this.documentChanges.remove(key);\r\n }\r\n recordPendingTargetRequest() {\r\n this.pendingResponses += 1;\r\n }\r\n recordTargetResponse() {\r\n this.pendingResponses -= 1;\r\n }\r\n markCurrent() {\r\n this._hasPendingChanges = true;\r\n this._current = true;\r\n }\r\n}\r\nconst LOG_TAG$f = 'WatchChangeAggregator';\r\n/**\r\n * A helper class to accumulate watch changes into a RemoteEvent.\r\n */\r\nclass WatchChangeAggregator {\r\n constructor(metadataProvider) {\r\n this.metadataProvider = metadataProvider;\r\n /** The internal state of all tracked targets. */\r\n this.targetStates = new Map();\r\n /** Keeps track of the documents to update since the last raised snapshot. */\r\n this.pendingDocumentUpdates = mutableDocumentMap();\r\n /** A mapping of document keys to their set of target IDs. */\r\n this.pendingDocumentTargetMapping = documentTargetMap();\r\n /**\r\n * A list of targets with existence filter mismatches. These targets are\r\n * known to be inconsistent and their listens needs to be re-established by\r\n * RemoteStore.\r\n */\r\n this.pendingTargetResets = new SortedSet(primitiveComparator);\r\n }\r\n /**\r\n * Processes and adds the DocumentWatchChange to the current set of changes.\r\n */\r\n handleDocumentChange(docChange) {\r\n for (const targetId of docChange.updatedTargetIds) {\r\n if (docChange.newDoc && docChange.newDoc.isFoundDocument()) {\r\n this.addDocumentToTarget(targetId, docChange.newDoc);\r\n }\r\n else {\r\n this.removeDocumentFromTarget(targetId, docChange.key, docChange.newDoc);\r\n }\r\n }\r\n for (const targetId of docChange.removedTargetIds) {\r\n this.removeDocumentFromTarget(targetId, docChange.key, docChange.newDoc);\r\n }\r\n }\r\n /** Processes and adds the WatchTargetChange to the current set of changes. */\r\n handleTargetChange(targetChange) {\r\n this.forEachTarget(targetChange, targetId => {\r\n const targetState = this.ensureTargetState(targetId);\r\n switch (targetChange.state) {\r\n case 0 /* NoChange */:\r\n if (this.isActiveTarget(targetId)) {\r\n targetState.updateResumeToken(targetChange.resumeToken);\r\n }\r\n break;\r\n case 1 /* Added */:\r\n // We need to decrement the number of pending acks needed from watch\r\n // for this targetId.\r\n targetState.recordTargetResponse();\r\n if (!targetState.isPending) {\r\n // We have a freshly added target, so we need to reset any state\r\n // that we had previously. This can happen e.g. when remove and add\r\n // back a target for existence filter mismatches.\r\n targetState.clearPendingChanges();\r\n }\r\n targetState.updateResumeToken(targetChange.resumeToken);\r\n break;\r\n case 2 /* Removed */:\r\n // We need to keep track of removed targets to we can post-filter and\r\n // remove any target changes.\r\n // We need to decrement the number of pending acks needed from watch\r\n // for this targetId.\r\n targetState.recordTargetResponse();\r\n if (!targetState.isPending) {\r\n this.removeTarget(targetId);\r\n }\r\n break;\r\n case 3 /* Current */:\r\n if (this.isActiveTarget(targetId)) {\r\n targetState.markCurrent();\r\n targetState.updateResumeToken(targetChange.resumeToken);\r\n }\r\n break;\r\n case 4 /* Reset */:\r\n if (this.isActiveTarget(targetId)) {\r\n // Reset the target and synthesizes removes for all existing\r\n // documents. The backend will re-add any documents that still\r\n // match the target before it sends the next global snapshot.\r\n this.resetTarget(targetId);\r\n targetState.updateResumeToken(targetChange.resumeToken);\r\n }\r\n break;\r\n default:\r\n fail();\r\n }\r\n });\r\n }\r\n /**\r\n * Iterates over all targetIds that the watch change applies to: either the\r\n * targetIds explicitly listed in the change or the targetIds of all currently\r\n * active targets.\r\n */\r\n forEachTarget(targetChange, fn) {\r\n if (targetChange.targetIds.length > 0) {\r\n targetChange.targetIds.forEach(fn);\r\n }\r\n else {\r\n this.targetStates.forEach((_, targetId) => {\r\n if (this.isActiveTarget(targetId)) {\r\n fn(targetId);\r\n }\r\n });\r\n }\r\n }\r\n /**\r\n * Handles existence filters and synthesizes deletes for filter mismatches.\r\n * Targets that are invalidated by filter mismatches are added to\r\n * `pendingTargetResets`.\r\n */\r\n handleExistenceFilter(watchChange) {\r\n const targetId = watchChange.targetId;\r\n const expectedCount = watchChange.existenceFilter.count;\r\n const targetData = this.targetDataForActiveTarget(targetId);\r\n if (targetData) {\r\n const target = targetData.target;\r\n if (isDocumentTarget(target)) {\r\n if (expectedCount === 0) {\r\n // The existence filter told us the document does not exist. We deduce\r\n // that this document does not exist and apply a deleted document to\r\n // our updates. Without applying this deleted document there might be\r\n // another query that will raise this document as part of a snapshot\r\n // until it is resolved, essentially exposing inconsistency between\r\n // queries.\r\n const key = new DocumentKey(target.path);\r\n this.removeDocumentFromTarget(targetId, key, MutableDocument.newNoDocument(key, SnapshotVersion.min()));\r\n }\r\n else {\r\n hardAssert(expectedCount === 1);\r\n }\r\n }\r\n else {\r\n const currentSize = this.getCurrentDocumentCountForTarget(targetId);\r\n if (currentSize !== expectedCount) {\r\n // Existence filter mismatch: We reset the mapping and raise a new\r\n // snapshot with `isFromCache:true`.\r\n this.resetTarget(targetId);\r\n this.pendingTargetResets = this.pendingTargetResets.add(targetId);\r\n }\r\n }\r\n }\r\n }\r\n /**\r\n * Converts the currently accumulated state into a remote event at the\r\n * provided snapshot version. Resets the accumulated changes before returning.\r\n */\r\n createRemoteEvent(snapshotVersion) {\r\n const targetChanges = new Map();\r\n this.targetStates.forEach((targetState, targetId) => {\r\n const targetData = this.targetDataForActiveTarget(targetId);\r\n if (targetData) {\r\n if (targetState.current && isDocumentTarget(targetData.target)) {\r\n // Document queries for document that don't exist can produce an empty\r\n // result set. To update our local cache, we synthesize a document\r\n // delete if we have not previously received the document. This\r\n // resolves the limbo state of the document, removing it from\r\n // limboDocumentRefs.\r\n //\r\n // TODO(dimond): Ideally we would have an explicit lookup target\r\n // instead resulting in an explicit delete message and we could\r\n // remove this special logic.\r\n const key = new DocumentKey(targetData.target.path);\r\n if (this.pendingDocumentUpdates.get(key) === null &&\r\n !this.targetContainsDocument(targetId, key)) {\r\n this.removeDocumentFromTarget(targetId, key, MutableDocument.newNoDocument(key, snapshotVersion));\r\n }\r\n }\r\n if (targetState.hasPendingChanges) {\r\n targetChanges.set(targetId, targetState.toTargetChange());\r\n targetState.clearPendingChanges();\r\n }\r\n }\r\n });\r\n let resolvedLimboDocuments = documentKeySet();\r\n // We extract the set of limbo-only document updates as the GC logic\r\n // special-cases documents that do not appear in the target cache.\r\n //\r\n // TODO(gsoltis): Expand on this comment once GC is available in the JS\r\n // client.\r\n this.pendingDocumentTargetMapping.forEach((key, targets) => {\r\n let isOnlyLimboTarget = true;\r\n targets.forEachWhile(targetId => {\r\n const targetData = this.targetDataForActiveTarget(targetId);\r\n if (targetData &&\r\n targetData.purpose !== 2 /* LimboResolution */) {\r\n isOnlyLimboTarget = false;\r\n return false;\r\n }\r\n return true;\r\n });\r\n if (isOnlyLimboTarget) {\r\n resolvedLimboDocuments = resolvedLimboDocuments.add(key);\r\n }\r\n });\r\n const remoteEvent = new RemoteEvent(snapshotVersion, targetChanges, this.pendingTargetResets, this.pendingDocumentUpdates, resolvedLimboDocuments);\r\n this.pendingDocumentUpdates = mutableDocumentMap();\r\n this.pendingDocumentTargetMapping = documentTargetMap();\r\n this.pendingTargetResets = new SortedSet(primitiveComparator);\r\n return remoteEvent;\r\n }\r\n /**\r\n * Adds the provided document to the internal list of document updates and\r\n * its document key to the given target's mapping.\r\n */\r\n // Visible for testing.\r\n addDocumentToTarget(targetId, document) {\r\n if (!this.isActiveTarget(targetId)) {\r\n return;\r\n }\r\n const changeType = this.targetContainsDocument(targetId, document.key)\r\n ? 2 /* Modified */\r\n : 0 /* Added */;\r\n const targetState = this.ensureTargetState(targetId);\r\n targetState.addDocumentChange(document.key, changeType);\r\n this.pendingDocumentUpdates = this.pendingDocumentUpdates.insert(document.key, document);\r\n this.pendingDocumentTargetMapping =\r\n this.pendingDocumentTargetMapping.insert(document.key, this.ensureDocumentTargetMapping(document.key).add(targetId));\r\n }\r\n /**\r\n * Removes the provided document from the target mapping. If the\r\n * document no longer matches the target, but the document's state is still\r\n * known (e.g. we know that the document was deleted or we received the change\r\n * that caused the filter mismatch), the new document can be provided\r\n * to update the remote document cache.\r\n */\r\n // Visible for testing.\r\n removeDocumentFromTarget(targetId, key, updatedDocument) {\r\n if (!this.isActiveTarget(targetId)) {\r\n return;\r\n }\r\n const targetState = this.ensureTargetState(targetId);\r\n if (this.targetContainsDocument(targetId, key)) {\r\n targetState.addDocumentChange(key, 1 /* Removed */);\r\n }\r\n else {\r\n // The document may have entered and left the target before we raised a\r\n // snapshot, so we can just ignore the change.\r\n targetState.removeDocumentChange(key);\r\n }\r\n this.pendingDocumentTargetMapping =\r\n this.pendingDocumentTargetMapping.insert(key, this.ensureDocumentTargetMapping(key).delete(targetId));\r\n if (updatedDocument) {\r\n this.pendingDocumentUpdates = this.pendingDocumentUpdates.insert(key, updatedDocument);\r\n }\r\n }\r\n removeTarget(targetId) {\r\n this.targetStates.delete(targetId);\r\n }\r\n /**\r\n * Returns the current count of documents in the target. This includes both\r\n * the number of documents that the LocalStore considers to be part of the\r\n * target as well as any accumulated changes.\r\n */\r\n getCurrentDocumentCountForTarget(targetId) {\r\n const targetState = this.ensureTargetState(targetId);\r\n const targetChange = targetState.toTargetChange();\r\n return (this.metadataProvider.getRemoteKeysForTarget(targetId).size +\r\n targetChange.addedDocuments.size -\r\n targetChange.removedDocuments.size);\r\n }\r\n /**\r\n * Increment the number of acks needed from watch before we can consider the\r\n * server to be 'in-sync' with the client's active targets.\r\n */\r\n recordPendingTargetRequest(targetId) {\r\n // For each request we get we need to record we need a response for it.\r\n const targetState = this.ensureTargetState(targetId);\r\n targetState.recordPendingTargetRequest();\r\n }\r\n ensureTargetState(targetId) {\r\n let result = this.targetStates.get(targetId);\r\n if (!result) {\r\n result = new TargetState();\r\n this.targetStates.set(targetId, result);\r\n }\r\n return result;\r\n }\r\n ensureDocumentTargetMapping(key) {\r\n let targetMapping = this.pendingDocumentTargetMapping.get(key);\r\n if (!targetMapping) {\r\n targetMapping = new SortedSet(primitiveComparator);\r\n this.pendingDocumentTargetMapping =\r\n this.pendingDocumentTargetMapping.insert(key, targetMapping);\r\n }\r\n return targetMapping;\r\n }\r\n /**\r\n * Verifies that the user is still interested in this target (by calling\r\n * `getTargetDataForTarget()`) and that we are not waiting for pending ADDs\r\n * from watch.\r\n */\r\n isActiveTarget(targetId) {\r\n const targetActive = this.targetDataForActiveTarget(targetId) !== null;\r\n if (!targetActive) {\r\n logDebug(LOG_TAG$f, 'Detected inactive target', targetId);\r\n }\r\n return targetActive;\r\n }\r\n /**\r\n * Returns the TargetData for an active target (i.e. a target that the user\r\n * is still interested in that has no outstanding target change requests).\r\n */\r\n targetDataForActiveTarget(targetId) {\r\n const targetState = this.targetStates.get(targetId);\r\n return targetState && targetState.isPending\r\n ? null\r\n : this.metadataProvider.getTargetDataForTarget(targetId);\r\n }\r\n /**\r\n * Resets the state of a Watch target to its initial state (e.g. sets\r\n * 'current' to false, clears the resume token and removes its target mapping\r\n * from all documents).\r\n */\r\n resetTarget(targetId) {\r\n this.targetStates.set(targetId, new TargetState());\r\n // Trigger removal for any documents currently mapped to this target.\r\n // These removals will be part of the initial snapshot if Watch does not\r\n // resend these documents.\r\n const existingKeys = this.metadataProvider.getRemoteKeysForTarget(targetId);\r\n existingKeys.forEach(key => {\r\n this.removeDocumentFromTarget(targetId, key, /*updatedDocument=*/ null);\r\n });\r\n }\r\n /**\r\n * Returns whether the LocalStore considers the document to be part of the\r\n * specified target.\r\n */\r\n targetContainsDocument(targetId, key) {\r\n const existingKeys = this.metadataProvider.getRemoteKeysForTarget(targetId);\r\n return existingKeys.has(key);\r\n }\r\n}\r\nfunction documentTargetMap() {\r\n return new SortedMap(DocumentKey.comparator);\r\n}\r\nfunction snapshotChangesMap() {\r\n return new SortedMap(DocumentKey.comparator);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst DIRECTIONS = (() => {\r\n const dirs = {};\r\n dirs[\"asc\" /* ASCENDING */] = 'ASCENDING';\r\n dirs[\"desc\" /* DESCENDING */] = 'DESCENDING';\r\n return dirs;\r\n})();\r\nconst OPERATORS = (() => {\r\n const ops = {};\r\n ops[\"<\" /* LESS_THAN */] = 'LESS_THAN';\r\n ops[\"<=\" /* LESS_THAN_OR_EQUAL */] = 'LESS_THAN_OR_EQUAL';\r\n ops[\">\" /* GREATER_THAN */] = 'GREATER_THAN';\r\n ops[\">=\" /* GREATER_THAN_OR_EQUAL */] = 'GREATER_THAN_OR_EQUAL';\r\n ops[\"==\" /* EQUAL */] = 'EQUAL';\r\n ops[\"!=\" /* NOT_EQUAL */] = 'NOT_EQUAL';\r\n ops[\"array-contains\" /* ARRAY_CONTAINS */] = 'ARRAY_CONTAINS';\r\n ops[\"in\" /* IN */] = 'IN';\r\n ops[\"not-in\" /* NOT_IN */] = 'NOT_IN';\r\n ops[\"array-contains-any\" /* ARRAY_CONTAINS_ANY */] = 'ARRAY_CONTAINS_ANY';\r\n return ops;\r\n})();\r\nfunction assertPresent(value, description) {\r\n}\r\n/**\r\n * This class generates JsonObject values for the Datastore API suitable for\r\n * sending to either GRPC stub methods or via the JSON/HTTP REST API.\r\n *\r\n * The serializer supports both Protobuf.js and Proto3 JSON formats. By\r\n * setting `useProto3Json` to true, the serializer will use the Proto3 JSON\r\n * format.\r\n *\r\n * For a description of the Proto3 JSON format check\r\n * https://developers.google.com/protocol-buffers/docs/proto3#json\r\n *\r\n * TODO(klimt): We can remove the databaseId argument if we keep the full\r\n * resource name in documents.\r\n */\r\nclass JsonProtoSerializer {\r\n constructor(databaseId, useProto3Json) {\r\n this.databaseId = databaseId;\r\n this.useProto3Json = useProto3Json;\r\n }\r\n}\r\nfunction fromRpcStatus(status) {\r\n const code = status.code === undefined ? Code.UNKNOWN : mapCodeFromRpcCode(status.code);\r\n return new FirestoreError(code, status.message || '');\r\n}\r\n/**\r\n * Returns a value for a number (or null) that's appropriate to put into\r\n * a google.protobuf.Int32Value proto.\r\n * DO NOT USE THIS FOR ANYTHING ELSE.\r\n * This method cheats. It's typed as returning \"number\" because that's what\r\n * our generated proto interfaces say Int32Value must be. But GRPC actually\r\n * expects a { value: <number> } struct.\r\n */\r\nfunction toInt32Proto(serializer, val) {\r\n if (serializer.useProto3Json || isNullOrUndefined(val)) {\r\n return val;\r\n }\r\n else {\r\n return { value: val };\r\n }\r\n}\r\n/**\r\n * Returns a number (or null) from a google.protobuf.Int32Value proto.\r\n */\r\nfunction fromInt32Proto(val) {\r\n let result;\r\n if (typeof val === 'object') {\r\n result = val.value;\r\n }\r\n else {\r\n result = val;\r\n }\r\n return isNullOrUndefined(result) ? null : result;\r\n}\r\n/**\r\n * Returns a value for a Date that's appropriate to put into a proto.\r\n */\r\nfunction toTimestamp(serializer, timestamp) {\r\n if (serializer.useProto3Json) {\r\n // Serialize to ISO-8601 date format, but with full nano resolution.\r\n // Since JS Date has only millis, let's only use it for the seconds and\r\n // then manually add the fractions to the end.\r\n const jsDateStr = new Date(timestamp.seconds * 1000).toISOString();\r\n // Remove .xxx frac part and Z in the end.\r\n const strUntilSeconds = jsDateStr.replace(/\\.\\d*/, '').replace('Z', '');\r\n // Pad the fraction out to 9 digits (nanos).\r\n const nanoStr = ('000000000' + timestamp.nanoseconds).slice(-9);\r\n return `${strUntilSeconds}.${nanoStr}Z`;\r\n }\r\n else {\r\n return {\r\n seconds: '' + timestamp.seconds,\r\n nanos: timestamp.nanoseconds\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n };\r\n }\r\n}\r\nfunction fromTimestamp(date) {\r\n const timestamp = normalizeTimestamp(date);\r\n return new Timestamp(timestamp.seconds, timestamp.nanos);\r\n}\r\n/**\r\n * Returns a value for bytes that's appropriate to put in a proto.\r\n *\r\n * Visible for testing.\r\n */\r\nfunction toBytes(serializer, bytes) {\r\n if (serializer.useProto3Json) {\r\n return bytes.toBase64();\r\n }\r\n else {\r\n return bytes.toUint8Array();\r\n }\r\n}\r\n/**\r\n * Returns a ByteString based on the proto string value.\r\n */\r\nfunction fromBytes(serializer, value) {\r\n if (serializer.useProto3Json) {\r\n hardAssert(value === undefined || typeof value === 'string');\r\n return ByteString.fromBase64String(value ? value : '');\r\n }\r\n else {\r\n hardAssert(value === undefined || value instanceof Uint8Array);\r\n return ByteString.fromUint8Array(value ? value : new Uint8Array());\r\n }\r\n}\r\nfunction toVersion(serializer, version) {\r\n return toTimestamp(serializer, version.toTimestamp());\r\n}\r\nfunction fromVersion(version) {\r\n hardAssert(!!version);\r\n return SnapshotVersion.fromTimestamp(fromTimestamp(version));\r\n}\r\nfunction toResourceName(databaseId, path) {\r\n return fullyQualifiedPrefixPath(databaseId)\r\n .child('documents')\r\n .child(path)\r\n .canonicalString();\r\n}\r\nfunction fromResourceName(name) {\r\n const resource = ResourcePath.fromString(name);\r\n hardAssert(isValidResourceName(resource));\r\n return resource;\r\n}\r\nfunction toName(serializer, key) {\r\n return toResourceName(serializer.databaseId, key.path);\r\n}\r\nfunction fromName(serializer, name) {\r\n const resource = fromResourceName(name);\r\n if (resource.get(1) !== serializer.databaseId.projectId) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Tried to deserialize key from different project: ' +\r\n resource.get(1) +\r\n ' vs ' +\r\n serializer.databaseId.projectId);\r\n }\r\n if (resource.get(3) !== serializer.databaseId.database) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Tried to deserialize key from different database: ' +\r\n resource.get(3) +\r\n ' vs ' +\r\n serializer.databaseId.database);\r\n }\r\n return new DocumentKey(extractLocalPathFromResourceName(resource));\r\n}\r\nfunction toQueryPath(serializer, path) {\r\n return toResourceName(serializer.databaseId, path);\r\n}\r\nfunction fromQueryPath(name) {\r\n const resourceName = fromResourceName(name);\r\n // In v1beta1 queries for collections at the root did not have a trailing\r\n // \"/documents\". In v1 all resource paths contain \"/documents\". Preserve the\r\n // ability to read the v1beta1 form for compatibility with queries persisted\r\n // in the local target cache.\r\n if (resourceName.length === 4) {\r\n return ResourcePath.emptyPath();\r\n }\r\n return extractLocalPathFromResourceName(resourceName);\r\n}\r\nfunction getEncodedDatabaseId(serializer) {\r\n const path = new ResourcePath([\r\n 'projects',\r\n serializer.databaseId.projectId,\r\n 'databases',\r\n serializer.databaseId.database\r\n ]);\r\n return path.canonicalString();\r\n}\r\nfunction fullyQualifiedPrefixPath(databaseId) {\r\n return new ResourcePath([\r\n 'projects',\r\n databaseId.projectId,\r\n 'databases',\r\n databaseId.database\r\n ]);\r\n}\r\nfunction extractLocalPathFromResourceName(resourceName) {\r\n hardAssert(resourceName.length > 4 && resourceName.get(4) === 'documents');\r\n return resourceName.popFirst(5);\r\n}\r\n/** Creates a Document proto from key and fields (but no create/update time) */\r\nfunction toMutationDocument(serializer, key, fields) {\r\n return {\r\n name: toName(serializer, key),\r\n fields: fields.value.mapValue.fields\r\n };\r\n}\r\nfunction toDocument(serializer, document) {\r\n return {\r\n name: toName(serializer, document.key),\r\n fields: document.data.value.mapValue.fields,\r\n updateTime: toTimestamp(serializer, document.version.toTimestamp())\r\n };\r\n}\r\nfunction fromDocument(serializer, document, hasCommittedMutations) {\r\n const key = fromName(serializer, document.name);\r\n const version = fromVersion(document.updateTime);\r\n const data = new ObjectValue({ mapValue: { fields: document.fields } });\r\n const result = MutableDocument.newFoundDocument(key, version, data);\r\n if (hasCommittedMutations) {\r\n result.setHasCommittedMutations();\r\n }\r\n return hasCommittedMutations ? result.setHasCommittedMutations() : result;\r\n}\r\nfunction fromFound(serializer, doc) {\r\n hardAssert(!!doc.found);\r\n assertPresent(doc.found.name);\r\n assertPresent(doc.found.updateTime);\r\n const key = fromName(serializer, doc.found.name);\r\n const version = fromVersion(doc.found.updateTime);\r\n const data = new ObjectValue({ mapValue: { fields: doc.found.fields } });\r\n return MutableDocument.newFoundDocument(key, version, data);\r\n}\r\nfunction fromMissing(serializer, result) {\r\n hardAssert(!!result.missing);\r\n hardAssert(!!result.readTime);\r\n const key = fromName(serializer, result.missing);\r\n const version = fromVersion(result.readTime);\r\n return MutableDocument.newNoDocument(key, version);\r\n}\r\nfunction fromBatchGetDocumentsResponse(serializer, result) {\r\n if ('found' in result) {\r\n return fromFound(serializer, result);\r\n }\r\n else if ('missing' in result) {\r\n return fromMissing(serializer, result);\r\n }\r\n return fail();\r\n}\r\nfunction fromWatchChange(serializer, change) {\r\n let watchChange;\r\n if ('targetChange' in change) {\r\n assertPresent(change.targetChange);\r\n // proto3 default value is unset in JSON (undefined), so use 'NO_CHANGE'\r\n // if unset\r\n const state = fromWatchTargetChangeState(change.targetChange.targetChangeType || 'NO_CHANGE');\r\n const targetIds = change.targetChange.targetIds || [];\r\n const resumeToken = fromBytes(serializer, change.targetChange.resumeToken);\r\n const causeProto = change.targetChange.cause;\r\n const cause = causeProto && fromRpcStatus(causeProto);\r\n watchChange = new WatchTargetChange(state, targetIds, resumeToken, cause || null);\r\n }\r\n else if ('documentChange' in change) {\r\n assertPresent(change.documentChange);\r\n const entityChange = change.documentChange;\r\n assertPresent(entityChange.document);\r\n assertPresent(entityChange.document.name);\r\n assertPresent(entityChange.document.updateTime);\r\n const key = fromName(serializer, entityChange.document.name);\r\n const version = fromVersion(entityChange.document.updateTime);\r\n const data = new ObjectValue({\r\n mapValue: { fields: entityChange.document.fields }\r\n });\r\n const doc = MutableDocument.newFoundDocument(key, version, data);\r\n const updatedTargetIds = entityChange.targetIds || [];\r\n const removedTargetIds = entityChange.removedTargetIds || [];\r\n watchChange = new DocumentWatchChange(updatedTargetIds, removedTargetIds, doc.key, doc);\r\n }\r\n else if ('documentDelete' in change) {\r\n assertPresent(change.documentDelete);\r\n const docDelete = change.documentDelete;\r\n assertPresent(docDelete.document);\r\n const key = fromName(serializer, docDelete.document);\r\n const version = docDelete.readTime\r\n ? fromVersion(docDelete.readTime)\r\n : SnapshotVersion.min();\r\n const doc = MutableDocument.newNoDocument(key, version);\r\n const removedTargetIds = docDelete.removedTargetIds || [];\r\n watchChange = new DocumentWatchChange([], removedTargetIds, doc.key, doc);\r\n }\r\n else if ('documentRemove' in change) {\r\n assertPresent(change.documentRemove);\r\n const docRemove = change.documentRemove;\r\n assertPresent(docRemove.document);\r\n const key = fromName(serializer, docRemove.document);\r\n const removedTargetIds = docRemove.removedTargetIds || [];\r\n watchChange = new DocumentWatchChange([], removedTargetIds, key, null);\r\n }\r\n else if ('filter' in change) {\r\n // TODO(dimond): implement existence filter parsing with strategy.\r\n assertPresent(change.filter);\r\n const filter = change.filter;\r\n assertPresent(filter.targetId);\r\n const count = filter.count || 0;\r\n const existenceFilter = new ExistenceFilter(count);\r\n const targetId = filter.targetId;\r\n watchChange = new ExistenceFilterChange(targetId, existenceFilter);\r\n }\r\n else {\r\n return fail();\r\n }\r\n return watchChange;\r\n}\r\nfunction fromWatchTargetChangeState(state) {\r\n if (state === 'NO_CHANGE') {\r\n return 0 /* NoChange */;\r\n }\r\n else if (state === 'ADD') {\r\n return 1 /* Added */;\r\n }\r\n else if (state === 'REMOVE') {\r\n return 2 /* Removed */;\r\n }\r\n else if (state === 'CURRENT') {\r\n return 3 /* Current */;\r\n }\r\n else if (state === 'RESET') {\r\n return 4 /* Reset */;\r\n }\r\n else {\r\n return fail();\r\n }\r\n}\r\nfunction versionFromListenResponse(change) {\r\n // We have only reached a consistent snapshot for the entire stream if there\r\n // is a read_time set and it applies to all targets (i.e. the list of\r\n // targets is empty). The backend is guaranteed to send such responses.\r\n if (!('targetChange' in change)) {\r\n return SnapshotVersion.min();\r\n }\r\n const targetChange = change.targetChange;\r\n if (targetChange.targetIds && targetChange.targetIds.length) {\r\n return SnapshotVersion.min();\r\n }\r\n if (!targetChange.readTime) {\r\n return SnapshotVersion.min();\r\n }\r\n return fromVersion(targetChange.readTime);\r\n}\r\nfunction toMutation(serializer, mutation) {\r\n let result;\r\n if (mutation instanceof SetMutation) {\r\n result = {\r\n update: toMutationDocument(serializer, mutation.key, mutation.value)\r\n };\r\n }\r\n else if (mutation instanceof DeleteMutation) {\r\n result = { delete: toName(serializer, mutation.key) };\r\n }\r\n else if (mutation instanceof PatchMutation) {\r\n result = {\r\n update: toMutationDocument(serializer, mutation.key, mutation.data),\r\n updateMask: toDocumentMask(mutation.fieldMask)\r\n };\r\n }\r\n else if (mutation instanceof VerifyMutation) {\r\n result = {\r\n verify: toName(serializer, mutation.key)\r\n };\r\n }\r\n else {\r\n return fail();\r\n }\r\n if (mutation.fieldTransforms.length > 0) {\r\n result.updateTransforms = mutation.fieldTransforms.map(transform => toFieldTransform(serializer, transform));\r\n }\r\n if (!mutation.precondition.isNone) {\r\n result.currentDocument = toPrecondition(serializer, mutation.precondition);\r\n }\r\n return result;\r\n}\r\nfunction fromMutation(serializer, proto) {\r\n const precondition = proto.currentDocument\r\n ? fromPrecondition(proto.currentDocument)\r\n : Precondition.none();\r\n const fieldTransforms = proto.updateTransforms\r\n ? proto.updateTransforms.map(transform => fromFieldTransform(serializer, transform))\r\n : [];\r\n if (proto.update) {\r\n assertPresent(proto.update.name);\r\n const key = fromName(serializer, proto.update.name);\r\n const value = new ObjectValue({\r\n mapValue: { fields: proto.update.fields }\r\n });\r\n if (proto.updateMask) {\r\n const fieldMask = fromDocumentMask(proto.updateMask);\r\n return new PatchMutation(key, value, fieldMask, precondition, fieldTransforms);\r\n }\r\n else {\r\n return new SetMutation(key, value, precondition, fieldTransforms);\r\n }\r\n }\r\n else if (proto.delete) {\r\n const key = fromName(serializer, proto.delete);\r\n return new DeleteMutation(key, precondition);\r\n }\r\n else if (proto.verify) {\r\n const key = fromName(serializer, proto.verify);\r\n return new VerifyMutation(key, precondition);\r\n }\r\n else {\r\n return fail();\r\n }\r\n}\r\nfunction toPrecondition(serializer, precondition) {\r\n if (precondition.updateTime !== undefined) {\r\n return {\r\n updateTime: toVersion(serializer, precondition.updateTime)\r\n };\r\n }\r\n else if (precondition.exists !== undefined) {\r\n return { exists: precondition.exists };\r\n }\r\n else {\r\n return fail();\r\n }\r\n}\r\nfunction fromPrecondition(precondition) {\r\n if (precondition.updateTime !== undefined) {\r\n return Precondition.updateTime(fromVersion(precondition.updateTime));\r\n }\r\n else if (precondition.exists !== undefined) {\r\n return Precondition.exists(precondition.exists);\r\n }\r\n else {\r\n return Precondition.none();\r\n }\r\n}\r\nfunction fromWriteResult(proto, commitTime) {\r\n // NOTE: Deletes don't have an updateTime.\r\n let version = proto.updateTime\r\n ? fromVersion(proto.updateTime)\r\n : fromVersion(commitTime);\r\n if (version.isEqual(SnapshotVersion.min())) {\r\n // The Firestore Emulator currently returns an update time of 0 for\r\n // deletes of non-existing documents (rather than null). This breaks the\r\n // test \"get deleted doc while offline with source=cache\" as NoDocuments\r\n // with version 0 are filtered by IndexedDb's RemoteDocumentCache.\r\n // TODO(#2149): Remove this when Emulator is fixed\r\n version = fromVersion(commitTime);\r\n }\r\n return new MutationResult(version, proto.transformResults || []);\r\n}\r\nfunction fromWriteResults(protos, commitTime) {\r\n if (protos && protos.length > 0) {\r\n hardAssert(commitTime !== undefined);\r\n return protos.map(proto => fromWriteResult(proto, commitTime));\r\n }\r\n else {\r\n return [];\r\n }\r\n}\r\nfunction toFieldTransform(serializer, fieldTransform) {\r\n const transform = fieldTransform.transform;\r\n if (transform instanceof ServerTimestampTransform) {\r\n return {\r\n fieldPath: fieldTransform.field.canonicalString(),\r\n setToServerValue: 'REQUEST_TIME'\r\n };\r\n }\r\n else if (transform instanceof ArrayUnionTransformOperation) {\r\n return {\r\n fieldPath: fieldTransform.field.canonicalString(),\r\n appendMissingElements: {\r\n values: transform.elements\r\n }\r\n };\r\n }\r\n else if (transform instanceof ArrayRemoveTransformOperation) {\r\n return {\r\n fieldPath: fieldTransform.field.canonicalString(),\r\n removeAllFromArray: {\r\n values: transform.elements\r\n }\r\n };\r\n }\r\n else if (transform instanceof NumericIncrementTransformOperation) {\r\n return {\r\n fieldPath: fieldTransform.field.canonicalString(),\r\n increment: transform.operand\r\n };\r\n }\r\n else {\r\n throw fail();\r\n }\r\n}\r\nfunction fromFieldTransform(serializer, proto) {\r\n let transform = null;\r\n if ('setToServerValue' in proto) {\r\n hardAssert(proto.setToServerValue === 'REQUEST_TIME');\r\n transform = new ServerTimestampTransform();\r\n }\r\n else if ('appendMissingElements' in proto) {\r\n const values = proto.appendMissingElements.values || [];\r\n transform = new ArrayUnionTransformOperation(values);\r\n }\r\n else if ('removeAllFromArray' in proto) {\r\n const values = proto.removeAllFromArray.values || [];\r\n transform = new ArrayRemoveTransformOperation(values);\r\n }\r\n else if ('increment' in proto) {\r\n transform = new NumericIncrementTransformOperation(serializer, proto.increment);\r\n }\r\n else {\r\n fail();\r\n }\r\n const fieldPath = FieldPath$1.fromServerFormat(proto.fieldPath);\r\n return new FieldTransform(fieldPath, transform);\r\n}\r\nfunction toDocumentsTarget(serializer, target) {\r\n return { documents: [toQueryPath(serializer, target.path)] };\r\n}\r\nfunction fromDocumentsTarget(documentsTarget) {\r\n const count = documentsTarget.documents.length;\r\n hardAssert(count === 1);\r\n const name = documentsTarget.documents[0];\r\n return queryToTarget(newQueryForPath(fromQueryPath(name)));\r\n}\r\nfunction toQueryTarget(serializer, target) {\r\n // Dissect the path into parent, collectionId, and optional key filter.\r\n const result = { structuredQuery: {} };\r\n const path = target.path;\r\n if (target.collectionGroup !== null) {\r\n result.parent = toQueryPath(serializer, path);\r\n result.structuredQuery.from = [\r\n {\r\n collectionId: target.collectionGroup,\r\n allDescendants: true\r\n }\r\n ];\r\n }\r\n else {\r\n result.parent = toQueryPath(serializer, path.popLast());\r\n result.structuredQuery.from = [{ collectionId: path.lastSegment() }];\r\n }\r\n const where = toFilter(target.filters);\r\n if (where) {\r\n result.structuredQuery.where = where;\r\n }\r\n const orderBy = toOrder(target.orderBy);\r\n if (orderBy) {\r\n result.structuredQuery.orderBy = orderBy;\r\n }\r\n const limit = toInt32Proto(serializer, target.limit);\r\n if (limit !== null) {\r\n result.structuredQuery.limit = limit;\r\n }\r\n if (target.startAt) {\r\n result.structuredQuery.startAt = toCursor(target.startAt);\r\n }\r\n if (target.endAt) {\r\n result.structuredQuery.endAt = toCursor(target.endAt);\r\n }\r\n return result;\r\n}\r\nfunction convertQueryTargetToQuery(target) {\r\n let path = fromQueryPath(target.parent);\r\n const query = target.structuredQuery;\r\n const fromCount = query.from ? query.from.length : 0;\r\n let collectionGroup = null;\r\n if (fromCount > 0) {\r\n hardAssert(fromCount === 1);\r\n const from = query.from[0];\r\n if (from.allDescendants) {\r\n collectionGroup = from.collectionId;\r\n }\r\n else {\r\n path = path.child(from.collectionId);\r\n }\r\n }\r\n let filterBy = [];\r\n if (query.where) {\r\n filterBy = fromFilter(query.where);\r\n }\r\n let orderBy = [];\r\n if (query.orderBy) {\r\n orderBy = fromOrder(query.orderBy);\r\n }\r\n let limit = null;\r\n if (query.limit) {\r\n limit = fromInt32Proto(query.limit);\r\n }\r\n let startAt = null;\r\n if (query.startAt) {\r\n startAt = fromCursor(query.startAt);\r\n }\r\n let endAt = null;\r\n if (query.endAt) {\r\n endAt = fromCursor(query.endAt);\r\n }\r\n return newQuery(path, collectionGroup, orderBy, filterBy, limit, \"F\" /* First */, startAt, endAt);\r\n}\r\nfunction fromQueryTarget(target) {\r\n return queryToTarget(convertQueryTargetToQuery(target));\r\n}\r\nfunction toListenRequestLabels(serializer, targetData) {\r\n const value = toLabel(serializer, targetData.purpose);\r\n if (value == null) {\r\n return null;\r\n }\r\n else {\r\n return {\r\n 'goog-listen-tags': value\r\n };\r\n }\r\n}\r\nfunction toLabel(serializer, purpose) {\r\n switch (purpose) {\r\n case 0 /* Listen */:\r\n return null;\r\n case 1 /* ExistenceFilterMismatch */:\r\n return 'existence-filter-mismatch';\r\n case 2 /* LimboResolution */:\r\n return 'limbo-document';\r\n default:\r\n return fail();\r\n }\r\n}\r\nfunction toTarget(serializer, targetData) {\r\n let result;\r\n const target = targetData.target;\r\n if (isDocumentTarget(target)) {\r\n result = { documents: toDocumentsTarget(serializer, target) };\r\n }\r\n else {\r\n result = { query: toQueryTarget(serializer, target) };\r\n }\r\n result.targetId = targetData.targetId;\r\n if (targetData.resumeToken.approximateByteSize() > 0) {\r\n result.resumeToken = toBytes(serializer, targetData.resumeToken);\r\n }\r\n else if (targetData.snapshotVersion.compareTo(SnapshotVersion.min()) > 0) {\r\n // TODO(wuandy): Consider removing above check because it is most likely true.\r\n // Right now, many tests depend on this behaviour though (leaving min() out\r\n // of serialization).\r\n result.readTime = toTimestamp(serializer, targetData.snapshotVersion.toTimestamp());\r\n }\r\n return result;\r\n}\r\nfunction toFilter(filters) {\r\n if (filters.length === 0) {\r\n return;\r\n }\r\n const protos = filters.map(filter => {\r\n return toUnaryOrFieldFilter(filter);\r\n });\r\n if (protos.length === 1) {\r\n return protos[0];\r\n }\r\n return { compositeFilter: { op: 'AND', filters: protos } };\r\n}\r\nfunction fromFilter(filter) {\r\n if (!filter) {\r\n return [];\r\n }\r\n else if (filter.unaryFilter !== undefined) {\r\n return [fromUnaryFilter(filter)];\r\n }\r\n else if (filter.fieldFilter !== undefined) {\r\n return [fromFieldFilter(filter)];\r\n }\r\n else if (filter.compositeFilter !== undefined) {\r\n return filter.compositeFilter\r\n .filters.map(f => fromFilter(f))\r\n .reduce((accum, current) => accum.concat(current));\r\n }\r\n else {\r\n return fail();\r\n }\r\n}\r\nfunction toOrder(orderBys) {\r\n if (orderBys.length === 0) {\r\n return;\r\n }\r\n return orderBys.map(order => toPropertyOrder(order));\r\n}\r\nfunction fromOrder(orderBys) {\r\n return orderBys.map(order => fromPropertyOrder(order));\r\n}\r\nfunction toCursor(cursor) {\r\n return {\r\n before: cursor.before,\r\n values: cursor.position\r\n };\r\n}\r\nfunction fromCursor(cursor) {\r\n const before = !!cursor.before;\r\n const position = cursor.values || [];\r\n return new Bound(position, before);\r\n}\r\n// visible for testing\r\nfunction toDirection(dir) {\r\n return DIRECTIONS[dir];\r\n}\r\n// visible for testing\r\nfunction fromDirection(dir) {\r\n switch (dir) {\r\n case 'ASCENDING':\r\n return \"asc\" /* ASCENDING */;\r\n case 'DESCENDING':\r\n return \"desc\" /* DESCENDING */;\r\n default:\r\n return undefined;\r\n }\r\n}\r\n// visible for testing\r\nfunction toOperatorName(op) {\r\n return OPERATORS[op];\r\n}\r\nfunction fromOperatorName(op) {\r\n switch (op) {\r\n case 'EQUAL':\r\n return \"==\" /* EQUAL */;\r\n case 'NOT_EQUAL':\r\n return \"!=\" /* NOT_EQUAL */;\r\n case 'GREATER_THAN':\r\n return \">\" /* GREATER_THAN */;\r\n case 'GREATER_THAN_OR_EQUAL':\r\n return \">=\" /* GREATER_THAN_OR_EQUAL */;\r\n case 'LESS_THAN':\r\n return \"<\" /* LESS_THAN */;\r\n case 'LESS_THAN_OR_EQUAL':\r\n return \"<=\" /* LESS_THAN_OR_EQUAL */;\r\n case 'ARRAY_CONTAINS':\r\n return \"array-contains\" /* ARRAY_CONTAINS */;\r\n case 'IN':\r\n return \"in\" /* IN */;\r\n case 'NOT_IN':\r\n return \"not-in\" /* NOT_IN */;\r\n case 'ARRAY_CONTAINS_ANY':\r\n return \"array-contains-any\" /* ARRAY_CONTAINS_ANY */;\r\n case 'OPERATOR_UNSPECIFIED':\r\n return fail();\r\n default:\r\n return fail();\r\n }\r\n}\r\nfunction toFieldPathReference(path) {\r\n return { fieldPath: path.canonicalString() };\r\n}\r\nfunction fromFieldPathReference(fieldReference) {\r\n return FieldPath$1.fromServerFormat(fieldReference.fieldPath);\r\n}\r\n// visible for testing\r\nfunction toPropertyOrder(orderBy) {\r\n return {\r\n field: toFieldPathReference(orderBy.field),\r\n direction: toDirection(orderBy.dir)\r\n };\r\n}\r\nfunction fromPropertyOrder(orderBy) {\r\n return new OrderBy(fromFieldPathReference(orderBy.field), fromDirection(orderBy.direction));\r\n}\r\nfunction fromFieldFilter(filter) {\r\n return FieldFilter.create(fromFieldPathReference(filter.fieldFilter.field), fromOperatorName(filter.fieldFilter.op), filter.fieldFilter.value);\r\n}\r\n// visible for testing\r\nfunction toUnaryOrFieldFilter(filter) {\r\n if (filter.op === \"==\" /* EQUAL */) {\r\n if (isNanValue(filter.value)) {\r\n return {\r\n unaryFilter: {\r\n field: toFieldPathReference(filter.field),\r\n op: 'IS_NAN'\r\n }\r\n };\r\n }\r\n else if (isNullValue(filter.value)) {\r\n return {\r\n unaryFilter: {\r\n field: toFieldPathReference(filter.field),\r\n op: 'IS_NULL'\r\n }\r\n };\r\n }\r\n }\r\n else if (filter.op === \"!=\" /* NOT_EQUAL */) {\r\n if (isNanValue(filter.value)) {\r\n return {\r\n unaryFilter: {\r\n field: toFieldPathReference(filter.field),\r\n op: 'IS_NOT_NAN'\r\n }\r\n };\r\n }\r\n else if (isNullValue(filter.value)) {\r\n return {\r\n unaryFilter: {\r\n field: toFieldPathReference(filter.field),\r\n op: 'IS_NOT_NULL'\r\n }\r\n };\r\n }\r\n }\r\n return {\r\n fieldFilter: {\r\n field: toFieldPathReference(filter.field),\r\n op: toOperatorName(filter.op),\r\n value: filter.value\r\n }\r\n };\r\n}\r\nfunction fromUnaryFilter(filter) {\r\n switch (filter.unaryFilter.op) {\r\n case 'IS_NAN':\r\n const nanField = fromFieldPathReference(filter.unaryFilter.field);\r\n return FieldFilter.create(nanField, \"==\" /* EQUAL */, {\r\n doubleValue: NaN\r\n });\r\n case 'IS_NULL':\r\n const nullField = fromFieldPathReference(filter.unaryFilter.field);\r\n return FieldFilter.create(nullField, \"==\" /* EQUAL */, {\r\n nullValue: 'NULL_VALUE'\r\n });\r\n case 'IS_NOT_NAN':\r\n const notNanField = fromFieldPathReference(filter.unaryFilter.field);\r\n return FieldFilter.create(notNanField, \"!=\" /* NOT_EQUAL */, {\r\n doubleValue: NaN\r\n });\r\n case 'IS_NOT_NULL':\r\n const notNullField = fromFieldPathReference(filter.unaryFilter.field);\r\n return FieldFilter.create(notNullField, \"!=\" /* NOT_EQUAL */, {\r\n nullValue: 'NULL_VALUE'\r\n });\r\n case 'OPERATOR_UNSPECIFIED':\r\n return fail();\r\n default:\r\n return fail();\r\n }\r\n}\r\nfunction toDocumentMask(fieldMask) {\r\n const canonicalFields = [];\r\n fieldMask.fields.forEach(field => canonicalFields.push(field.canonicalString()));\r\n return {\r\n fieldPaths: canonicalFields\r\n };\r\n}\r\nfunction fromDocumentMask(proto) {\r\n const paths = proto.fieldPaths || [];\r\n return new FieldMask(paths.map(path => FieldPath$1.fromServerFormat(path)));\r\n}\r\nfunction isValidResourceName(path) {\r\n // Resource names have at least 4 components (project ID, database ID)\r\n return (path.length >= 4 &&\r\n path.get(0) === 'projects' &&\r\n path.get(2) === 'databases');\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * An immutable set of metadata that the local store tracks for each target.\r\n */\r\nclass TargetData {\r\n constructor(\r\n /** The target being listened to. */\r\n target, \r\n /**\r\n * The target ID to which the target corresponds; Assigned by the\r\n * LocalStore for user listens and by the SyncEngine for limbo watches.\r\n */\r\n targetId, \r\n /** The purpose of the target. */\r\n purpose, \r\n /**\r\n * The sequence number of the last transaction during which this target data\r\n * was modified.\r\n */\r\n sequenceNumber, \r\n /** The latest snapshot version seen for this target. */\r\n snapshotVersion = SnapshotVersion.min(), \r\n /**\r\n * The maximum snapshot version at which the associated view\r\n * contained no limbo documents.\r\n */\r\n lastLimboFreeSnapshotVersion = SnapshotVersion.min(), \r\n /**\r\n * An opaque, server-assigned token that allows watching a target to be\r\n * resumed after disconnecting without retransmitting all the data that\r\n * matches the target. The resume token essentially identifies a point in\r\n * time from which the server should resume sending results.\r\n */\r\n resumeToken = ByteString.EMPTY_BYTE_STRING) {\r\n this.target = target;\r\n this.targetId = targetId;\r\n this.purpose = purpose;\r\n this.sequenceNumber = sequenceNumber;\r\n this.snapshotVersion = snapshotVersion;\r\n this.lastLimboFreeSnapshotVersion = lastLimboFreeSnapshotVersion;\r\n this.resumeToken = resumeToken;\r\n }\r\n /** Creates a new target data instance with an updated sequence number. */\r\n withSequenceNumber(sequenceNumber) {\r\n return new TargetData(this.target, this.targetId, this.purpose, sequenceNumber, this.snapshotVersion, this.lastLimboFreeSnapshotVersion, this.resumeToken);\r\n }\r\n /**\r\n * Creates a new target data instance with an updated resume token and\r\n * snapshot version.\r\n */\r\n withResumeToken(resumeToken, snapshotVersion) {\r\n return new TargetData(this.target, this.targetId, this.purpose, this.sequenceNumber, snapshotVersion, this.lastLimboFreeSnapshotVersion, resumeToken);\r\n }\r\n /**\r\n * Creates a new target data instance with an updated last limbo free\r\n * snapshot version number.\r\n */\r\n withLastLimboFreeSnapshotVersion(lastLimboFreeSnapshotVersion) {\r\n return new TargetData(this.target, this.targetId, this.purpose, this.sequenceNumber, this.snapshotVersion, lastLimboFreeSnapshotVersion, this.resumeToken);\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/** Serializer for values stored in the LocalStore. */\r\nclass LocalSerializer {\r\n constructor(remoteSerializer) {\r\n this.remoteSerializer = remoteSerializer;\r\n }\r\n}\r\n/** Decodes a remote document from storage locally to a Document. */\r\nfunction fromDbRemoteDocument(localSerializer, remoteDoc) {\r\n if (remoteDoc.document) {\r\n return fromDocument(localSerializer.remoteSerializer, remoteDoc.document, !!remoteDoc.hasCommittedMutations);\r\n }\r\n else if (remoteDoc.noDocument) {\r\n const key = DocumentKey.fromSegments(remoteDoc.noDocument.path);\r\n const version = fromDbTimestamp(remoteDoc.noDocument.readTime);\r\n const document = MutableDocument.newNoDocument(key, version);\r\n return remoteDoc.hasCommittedMutations\r\n ? document.setHasCommittedMutations()\r\n : document;\r\n }\r\n else if (remoteDoc.unknownDocument) {\r\n const key = DocumentKey.fromSegments(remoteDoc.unknownDocument.path);\r\n const version = fromDbTimestamp(remoteDoc.unknownDocument.version);\r\n return MutableDocument.newUnknownDocument(key, version);\r\n }\r\n else {\r\n return fail();\r\n }\r\n}\r\n/** Encodes a document for storage locally. */\r\nfunction toDbRemoteDocument(localSerializer, document, readTime) {\r\n const dbReadTime = toDbTimestampKey(readTime);\r\n const parentPath = document.key.path.popLast().toArray();\r\n if (document.isFoundDocument()) {\r\n const doc = toDocument(localSerializer.remoteSerializer, document);\r\n const hasCommittedMutations = document.hasCommittedMutations;\r\n return new DbRemoteDocument(\r\n /* unknownDocument= */ null, \r\n /* noDocument= */ null, doc, hasCommittedMutations, dbReadTime, parentPath);\r\n }\r\n else if (document.isNoDocument()) {\r\n const path = document.key.path.toArray();\r\n const readTime = toDbTimestamp(document.version);\r\n const hasCommittedMutations = document.hasCommittedMutations;\r\n return new DbRemoteDocument(\r\n /* unknownDocument= */ null, new DbNoDocument(path, readTime), \r\n /* document= */ null, hasCommittedMutations, dbReadTime, parentPath);\r\n }\r\n else if (document.isUnknownDocument()) {\r\n const path = document.key.path.toArray();\r\n const readTime = toDbTimestamp(document.version);\r\n return new DbRemoteDocument(new DbUnknownDocument(path, readTime), \r\n /* noDocument= */ null, \r\n /* document= */ null, \r\n /* hasCommittedMutations= */ true, dbReadTime, parentPath);\r\n }\r\n else {\r\n return fail();\r\n }\r\n}\r\nfunction toDbTimestampKey(snapshotVersion) {\r\n const timestamp = snapshotVersion.toTimestamp();\r\n return [timestamp.seconds, timestamp.nanoseconds];\r\n}\r\nfunction fromDbTimestampKey(dbTimestampKey) {\r\n const timestamp = new Timestamp(dbTimestampKey[0], dbTimestampKey[1]);\r\n return SnapshotVersion.fromTimestamp(timestamp);\r\n}\r\nfunction toDbTimestamp(snapshotVersion) {\r\n const timestamp = snapshotVersion.toTimestamp();\r\n return new DbTimestamp(timestamp.seconds, timestamp.nanoseconds);\r\n}\r\nfunction fromDbTimestamp(dbTimestamp) {\r\n const timestamp = new Timestamp(dbTimestamp.seconds, dbTimestamp.nanoseconds);\r\n return SnapshotVersion.fromTimestamp(timestamp);\r\n}\r\n/** Encodes a batch of mutations into a DbMutationBatch for local storage. */\r\nfunction toDbMutationBatch(localSerializer, userId, batch) {\r\n const serializedBaseMutations = batch.baseMutations.map(m => toMutation(localSerializer.remoteSerializer, m));\r\n const serializedMutations = batch.mutations.map(m => toMutation(localSerializer.remoteSerializer, m));\r\n return new DbMutationBatch(userId, batch.batchId, batch.localWriteTime.toMillis(), serializedBaseMutations, serializedMutations);\r\n}\r\n/** Decodes a DbMutationBatch into a MutationBatch */\r\nfunction fromDbMutationBatch(localSerializer, dbBatch) {\r\n const baseMutations = (dbBatch.baseMutations || []).map(m => fromMutation(localSerializer.remoteSerializer, m));\r\n // Squash old transform mutations into existing patch or set mutations.\r\n // The replacement of representing `transforms` with `update_transforms`\r\n // on the SDK means that old `transform` mutations stored in IndexedDB need\r\n // to be updated to `update_transforms`.\r\n // TODO(b/174608374): Remove this code once we perform a schema migration.\r\n for (let i = 0; i < dbBatch.mutations.length - 1; ++i) {\r\n const currentMutation = dbBatch.mutations[i];\r\n const hasTransform = i + 1 < dbBatch.mutations.length &&\r\n dbBatch.mutations[i + 1].transform !== undefined;\r\n if (hasTransform) {\r\n const transformMutation = dbBatch.mutations[i + 1];\r\n currentMutation.updateTransforms =\r\n transformMutation.transform.fieldTransforms;\r\n dbBatch.mutations.splice(i + 1, 1);\r\n ++i;\r\n }\r\n }\r\n const mutations = dbBatch.mutations.map(m => fromMutation(localSerializer.remoteSerializer, m));\r\n const timestamp = Timestamp.fromMillis(dbBatch.localWriteTimeMs);\r\n return new MutationBatch(dbBatch.batchId, timestamp, baseMutations, mutations);\r\n}\r\n/** Decodes a DbTarget into TargetData */\r\nfunction fromDbTarget(dbTarget) {\r\n const version = fromDbTimestamp(dbTarget.readTime);\r\n const lastLimboFreeSnapshotVersion = dbTarget.lastLimboFreeSnapshotVersion !== undefined\r\n ? fromDbTimestamp(dbTarget.lastLimboFreeSnapshotVersion)\r\n : SnapshotVersion.min();\r\n let target;\r\n if (isDocumentQuery(dbTarget.query)) {\r\n target = fromDocumentsTarget(dbTarget.query);\r\n }\r\n else {\r\n target = fromQueryTarget(dbTarget.query);\r\n }\r\n return new TargetData(target, dbTarget.targetId, 0 /* Listen */, dbTarget.lastListenSequenceNumber, version, lastLimboFreeSnapshotVersion, ByteString.fromBase64String(dbTarget.resumeToken));\r\n}\r\n/** Encodes TargetData into a DbTarget for storage locally. */\r\nfunction toDbTarget(localSerializer, targetData) {\r\n const dbTimestamp = toDbTimestamp(targetData.snapshotVersion);\r\n const dbLastLimboFreeTimestamp = toDbTimestamp(targetData.lastLimboFreeSnapshotVersion);\r\n let queryProto;\r\n if (isDocumentTarget(targetData.target)) {\r\n queryProto = toDocumentsTarget(localSerializer.remoteSerializer, targetData.target);\r\n }\r\n else {\r\n queryProto = toQueryTarget(localSerializer.remoteSerializer, targetData.target);\r\n }\r\n // We can't store the resumeToken as a ByteString in IndexedDb, so we\r\n // convert it to a base64 string for storage.\r\n const resumeToken = targetData.resumeToken.toBase64();\r\n // lastListenSequenceNumber is always 0 until we do real GC.\r\n return new DbTarget(targetData.targetId, canonifyTarget(targetData.target), dbTimestamp, resumeToken, targetData.sequenceNumber, dbLastLimboFreeTimestamp, queryProto);\r\n}\r\n/**\r\n * A helper function for figuring out what kind of query has been stored.\r\n */\r\nfunction isDocumentQuery(dbQuery) {\r\n return dbQuery.documents !== undefined;\r\n}\r\n/** Encodes a DbBundle to a BundleMetadata object. */\r\nfunction fromDbBundle(dbBundle) {\r\n return {\r\n id: dbBundle.bundleId,\r\n createTime: fromDbTimestamp(dbBundle.createTime),\r\n version: dbBundle.version\r\n };\r\n}\r\n/** Encodes a BundleMetadata to a DbBundle. */\r\nfunction toDbBundle(metadata) {\r\n return {\r\n bundleId: metadata.id,\r\n createTime: toDbTimestamp(fromVersion(metadata.createTime)),\r\n version: metadata.version\r\n };\r\n}\r\n/** Encodes a DbNamedQuery to a NamedQuery. */\r\nfunction fromDbNamedQuery(dbNamedQuery) {\r\n return {\r\n name: dbNamedQuery.name,\r\n query: fromBundledQuery(dbNamedQuery.bundledQuery),\r\n readTime: fromDbTimestamp(dbNamedQuery.readTime)\r\n };\r\n}\r\n/** Encodes a NamedQuery from a bundle proto to a DbNamedQuery. */\r\nfunction toDbNamedQuery(query) {\r\n return {\r\n name: query.name,\r\n readTime: toDbTimestamp(fromVersion(query.readTime)),\r\n bundledQuery: query.bundledQuery\r\n };\r\n}\r\n/**\r\n * Encodes a `BundledQuery` from bundle proto to a Query object.\r\n *\r\n * This reconstructs the original query used to build the bundle being loaded,\r\n * including features exists only in SDKs (for example: limit-to-last).\r\n */\r\nfunction fromBundledQuery(bundledQuery) {\r\n const query = convertQueryTargetToQuery({\r\n parent: bundledQuery.parent,\r\n structuredQuery: bundledQuery.structuredQuery\r\n });\r\n if (bundledQuery.limitType === 'LAST') {\r\n return queryWithLimit(query, query.limit, \"L\" /* Last */);\r\n }\r\n return query;\r\n}\r\n/** Encodes a NamedQuery proto object to a NamedQuery model object. */\r\nfunction fromProtoNamedQuery(namedQuery) {\r\n return {\r\n name: namedQuery.name,\r\n query: fromBundledQuery(namedQuery.bundledQuery),\r\n readTime: fromVersion(namedQuery.readTime)\r\n };\r\n}\r\n/** Decodes a BundleMetadata proto into a BundleMetadata object. */\r\nfunction fromBundleMetadata(metadata) {\r\n return {\r\n id: metadata.id,\r\n version: metadata.version,\r\n createTime: fromVersion(metadata.createTime)\r\n };\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nclass IndexedDbBundleCache {\r\n getBundleMetadata(transaction, bundleId) {\r\n return bundlesStore(transaction)\r\n .get(bundleId)\r\n .next(bundle => {\r\n if (bundle) {\r\n return fromDbBundle(bundle);\r\n }\r\n return undefined;\r\n });\r\n }\r\n saveBundleMetadata(transaction, bundleMetadata) {\r\n return bundlesStore(transaction).put(toDbBundle(bundleMetadata));\r\n }\r\n getNamedQuery(transaction, queryName) {\r\n return namedQueriesStore(transaction)\r\n .get(queryName)\r\n .next(query => {\r\n if (query) {\r\n return fromDbNamedQuery(query);\r\n }\r\n return undefined;\r\n });\r\n }\r\n saveNamedQuery(transaction, query) {\r\n return namedQueriesStore(transaction).put(toDbNamedQuery(query));\r\n }\r\n}\r\n/**\r\n * Helper to get a typed SimpleDbStore for the bundles object store.\r\n */\r\nfunction bundlesStore(txn) {\r\n return getStore(txn, DbBundle.store);\r\n}\r\n/**\r\n * Helper to get a typed SimpleDbStore for the namedQueries object store.\r\n */\r\nfunction namedQueriesStore(txn) {\r\n return getStore(txn, DbNamedQuery.store);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * An in-memory implementation of IndexManager.\r\n */\r\nclass MemoryIndexManager {\r\n constructor() {\r\n this.collectionParentIndex = new MemoryCollectionParentIndex();\r\n }\r\n addToCollectionParentIndex(transaction, collectionPath) {\r\n this.collectionParentIndex.add(collectionPath);\r\n return PersistencePromise.resolve();\r\n }\r\n getCollectionParents(transaction, collectionId) {\r\n return PersistencePromise.resolve(this.collectionParentIndex.getEntries(collectionId));\r\n }\r\n}\r\n/**\r\n * Internal implementation of the collection-parent index exposed by MemoryIndexManager.\r\n * Also used for in-memory caching by IndexedDbIndexManager and initial index population\r\n * in indexeddb_schema.ts\r\n */\r\nclass MemoryCollectionParentIndex {\r\n constructor() {\r\n this.index = {};\r\n }\r\n // Returns false if the entry already existed.\r\n add(collectionPath) {\r\n const collectionId = collectionPath.lastSegment();\r\n const parentPath = collectionPath.popLast();\r\n const existingParents = this.index[collectionId] ||\r\n new SortedSet(ResourcePath.comparator);\r\n const added = !existingParents.has(parentPath);\r\n this.index[collectionId] = existingParents.add(parentPath);\r\n return added;\r\n }\r\n has(collectionPath) {\r\n const collectionId = collectionPath.lastSegment();\r\n const parentPath = collectionPath.popLast();\r\n const existingParents = this.index[collectionId];\r\n return existingParents && existingParents.has(parentPath);\r\n }\r\n getEntries(collectionId) {\r\n const parentPaths = this.index[collectionId] ||\r\n new SortedSet(ResourcePath.comparator);\r\n return parentPaths.toArray();\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A persisted implementation of IndexManager.\r\n */\r\nclass IndexedDbIndexManager {\r\n constructor() {\r\n /**\r\n * An in-memory copy of the index entries we've already written since the SDK\r\n * launched. Used to avoid re-writing the same entry repeatedly.\r\n *\r\n * This is *NOT* a complete cache of what's in persistence and so can never be used to\r\n * satisfy reads.\r\n */\r\n this.collectionParentsCache = new MemoryCollectionParentIndex();\r\n }\r\n /**\r\n * Adds a new entry to the collection parent index.\r\n *\r\n * Repeated calls for the same collectionPath should be avoided within a\r\n * transaction as IndexedDbIndexManager only caches writes once a transaction\r\n * has been committed.\r\n */\r\n addToCollectionParentIndex(transaction, collectionPath) {\r\n if (!this.collectionParentsCache.has(collectionPath)) {\r\n const collectionId = collectionPath.lastSegment();\r\n const parentPath = collectionPath.popLast();\r\n transaction.addOnCommittedListener(() => {\r\n // Add the collection to the in memory cache only if the transaction was\r\n // successfully committed.\r\n this.collectionParentsCache.add(collectionPath);\r\n });\r\n const collectionParent = {\r\n collectionId,\r\n parent: encodeResourcePath(parentPath)\r\n };\r\n return collectionParentsStore(transaction).put(collectionParent);\r\n }\r\n return PersistencePromise.resolve();\r\n }\r\n getCollectionParents(transaction, collectionId) {\r\n const parentPaths = [];\r\n const range = IDBKeyRange.bound([collectionId, ''], [immediateSuccessor(collectionId), ''], \r\n /*lowerOpen=*/ false, \r\n /*upperOpen=*/ true);\r\n return collectionParentsStore(transaction)\r\n .loadAll(range)\r\n .next(entries => {\r\n for (const entry of entries) {\r\n // This collectionId guard shouldn't be necessary (and isn't as long\r\n // as we're running in a real browser), but there's a bug in\r\n // indexeddbshim that breaks our range in our tests running in node:\r\n // https://github.com/axemclion/IndexedDBShim/issues/334\r\n if (entry.collectionId !== collectionId) {\r\n break;\r\n }\r\n parentPaths.push(decodeResourcePath(entry.parent));\r\n }\r\n return parentPaths;\r\n });\r\n }\r\n}\r\n/**\r\n * Helper to get a typed SimpleDbStore for the collectionParents\r\n * document store.\r\n */\r\nfunction collectionParentsStore(txn) {\r\n return getStore(txn, DbCollectionParent.store);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Delete a mutation batch and the associated document mutations.\r\n * @returns A PersistencePromise of the document mutations that were removed.\r\n */\r\nfunction removeMutationBatch(txn, userId, batch) {\r\n const mutationStore = txn.store(DbMutationBatch.store);\r\n const indexTxn = txn.store(DbDocumentMutation.store);\r\n const promises = [];\r\n const range = IDBKeyRange.only(batch.batchId);\r\n let numDeleted = 0;\r\n const removePromise = mutationStore.iterate({ range }, (key, value, control) => {\r\n numDeleted++;\r\n return control.delete();\r\n });\r\n promises.push(removePromise.next(() => {\r\n hardAssert(numDeleted === 1);\r\n }));\r\n const removedDocuments = [];\r\n for (const mutation of batch.mutations) {\r\n const indexKey = DbDocumentMutation.key(userId, mutation.key.path, batch.batchId);\r\n promises.push(indexTxn.delete(indexKey));\r\n removedDocuments.push(mutation.key);\r\n }\r\n return PersistencePromise.waitFor(promises).next(() => removedDocuments);\r\n}\r\n/**\r\n * Returns an approximate size for the given document.\r\n */\r\nfunction dbDocumentSize(doc) {\r\n if (!doc) {\r\n return 0;\r\n }\r\n let value;\r\n if (doc.document) {\r\n value = doc.document;\r\n }\r\n else if (doc.unknownDocument) {\r\n value = doc.unknownDocument;\r\n }\r\n else if (doc.noDocument) {\r\n value = doc.noDocument;\r\n }\r\n else {\r\n throw fail();\r\n }\r\n return JSON.stringify(value).length;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/** A mutation queue for a specific user, backed by IndexedDB. */\r\nclass IndexedDbMutationQueue {\r\n constructor(\r\n /**\r\n * The normalized userId (e.g. null UID => \"\" userId) used to store /\r\n * retrieve mutations.\r\n */\r\n userId, serializer, indexManager, referenceDelegate) {\r\n this.userId = userId;\r\n this.serializer = serializer;\r\n this.indexManager = indexManager;\r\n this.referenceDelegate = referenceDelegate;\r\n /**\r\n * Caches the document keys for pending mutation batches. If the mutation\r\n * has been removed from IndexedDb, the cached value may continue to\r\n * be used to retrieve the batch's document keys. To remove a cached value\r\n * locally, `removeCachedMutationKeys()` should be invoked either directly\r\n * or through `removeMutationBatches()`.\r\n *\r\n * With multi-tab, when the primary client acknowledges or rejects a mutation,\r\n * this cache is used by secondary clients to invalidate the local\r\n * view of the documents that were previously affected by the mutation.\r\n */\r\n // PORTING NOTE: Multi-tab only.\r\n this.documentKeysByBatchId = {};\r\n }\r\n /**\r\n * Creates a new mutation queue for the given user.\r\n * @param user - The user for which to create a mutation queue.\r\n * @param serializer - The serializer to use when persisting to IndexedDb.\r\n */\r\n static forUser(user, serializer, indexManager, referenceDelegate) {\r\n // TODO(mcg): Figure out what constraints there are on userIDs\r\n // In particular, are there any reserved characters? are empty ids allowed?\r\n // For the moment store these together in the same mutations table assuming\r\n // that empty userIDs aren't allowed.\r\n hardAssert(user.uid !== '');\r\n const userId = user.isAuthenticated() ? user.uid : '';\r\n return new IndexedDbMutationQueue(userId, serializer, indexManager, referenceDelegate);\r\n }\r\n checkEmpty(transaction) {\r\n let empty = true;\r\n const range = IDBKeyRange.bound([this.userId, Number.NEGATIVE_INFINITY], [this.userId, Number.POSITIVE_INFINITY]);\r\n return mutationsStore(transaction)\r\n .iterate({ index: DbMutationBatch.userMutationsIndex, range }, (key, value, control) => {\r\n empty = false;\r\n control.done();\r\n })\r\n .next(() => empty);\r\n }\r\n addMutationBatch(transaction, localWriteTime, baseMutations, mutations) {\r\n const documentStore = documentMutationsStore(transaction);\r\n const mutationStore = mutationsStore(transaction);\r\n // The IndexedDb implementation in Chrome (and Firefox) does not handle\r\n // compound indices that include auto-generated keys correctly. To ensure\r\n // that the index entry is added correctly in all browsers, we perform two\r\n // writes: The first write is used to retrieve the next auto-generated Batch\r\n // ID, and the second write populates the index and stores the actual\r\n // mutation batch.\r\n // See: https://bugs.chromium.org/p/chromium/issues/detail?id=701972\r\n // We write an empty object to obtain key\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n return mutationStore.add({}).next(batchId => {\r\n hardAssert(typeof batchId === 'number');\r\n const batch = new MutationBatch(batchId, localWriteTime, baseMutations, mutations);\r\n const dbBatch = toDbMutationBatch(this.serializer, this.userId, batch);\r\n const promises = [];\r\n let collectionParents = new SortedSet((l, r) => primitiveComparator(l.canonicalString(), r.canonicalString()));\r\n for (const mutation of mutations) {\r\n const indexKey = DbDocumentMutation.key(this.userId, mutation.key.path, batchId);\r\n collectionParents = collectionParents.add(mutation.key.path.popLast());\r\n promises.push(mutationStore.put(dbBatch));\r\n promises.push(documentStore.put(indexKey, DbDocumentMutation.PLACEHOLDER));\r\n }\r\n collectionParents.forEach(parent => {\r\n promises.push(this.indexManager.addToCollectionParentIndex(transaction, parent));\r\n });\r\n transaction.addOnCommittedListener(() => {\r\n this.documentKeysByBatchId[batchId] = batch.keys();\r\n });\r\n return PersistencePromise.waitFor(promises).next(() => batch);\r\n });\r\n }\r\n lookupMutationBatch(transaction, batchId) {\r\n return mutationsStore(transaction)\r\n .get(batchId)\r\n .next(dbBatch => {\r\n if (dbBatch) {\r\n hardAssert(dbBatch.userId === this.userId);\r\n return fromDbMutationBatch(this.serializer, dbBatch);\r\n }\r\n return null;\r\n });\r\n }\r\n /**\r\n * Returns the document keys for the mutation batch with the given batchId.\r\n * For primary clients, this method returns `null` after\r\n * `removeMutationBatches()` has been called. Secondary clients return a\r\n * cached result until `removeCachedMutationKeys()` is invoked.\r\n */\r\n // PORTING NOTE: Multi-tab only.\r\n lookupMutationKeys(transaction, batchId) {\r\n if (this.documentKeysByBatchId[batchId]) {\r\n return PersistencePromise.resolve(this.documentKeysByBatchId[batchId]);\r\n }\r\n else {\r\n return this.lookupMutationBatch(transaction, batchId).next(batch => {\r\n if (batch) {\r\n const keys = batch.keys();\r\n this.documentKeysByBatchId[batchId] = keys;\r\n return keys;\r\n }\r\n else {\r\n return null;\r\n }\r\n });\r\n }\r\n }\r\n getNextMutationBatchAfterBatchId(transaction, batchId) {\r\n const nextBatchId = batchId + 1;\r\n const range = IDBKeyRange.lowerBound([this.userId, nextBatchId]);\r\n let foundBatch = null;\r\n return mutationsStore(transaction)\r\n .iterate({ index: DbMutationBatch.userMutationsIndex, range }, (key, dbBatch, control) => {\r\n if (dbBatch.userId === this.userId) {\r\n hardAssert(dbBatch.batchId >= nextBatchId);\r\n foundBatch = fromDbMutationBatch(this.serializer, dbBatch);\r\n }\r\n control.done();\r\n })\r\n .next(() => foundBatch);\r\n }\r\n getHighestUnacknowledgedBatchId(transaction) {\r\n const range = IDBKeyRange.upperBound([\r\n this.userId,\r\n Number.POSITIVE_INFINITY\r\n ]);\r\n let batchId = BATCHID_UNKNOWN;\r\n return mutationsStore(transaction)\r\n .iterate({ index: DbMutationBatch.userMutationsIndex, range, reverse: true }, (key, dbBatch, control) => {\r\n batchId = dbBatch.batchId;\r\n control.done();\r\n })\r\n .next(() => batchId);\r\n }\r\n getAllMutationBatches(transaction) {\r\n const range = IDBKeyRange.bound([this.userId, BATCHID_UNKNOWN], [this.userId, Number.POSITIVE_INFINITY]);\r\n return mutationsStore(transaction)\r\n .loadAll(DbMutationBatch.userMutationsIndex, range)\r\n .next(dbBatches => dbBatches.map(dbBatch => fromDbMutationBatch(this.serializer, dbBatch)));\r\n }\r\n getAllMutationBatchesAffectingDocumentKey(transaction, documentKey) {\r\n // Scan the document-mutation index starting with a prefix starting with\r\n // the given documentKey.\r\n const indexPrefix = DbDocumentMutation.prefixForPath(this.userId, documentKey.path);\r\n const indexStart = IDBKeyRange.lowerBound(indexPrefix);\r\n const results = [];\r\n return documentMutationsStore(transaction)\r\n .iterate({ range: indexStart }, (indexKey, _, control) => {\r\n const [userID, encodedPath, batchId] = indexKey;\r\n // Only consider rows matching exactly the specific key of\r\n // interest. Note that because we order by path first, and we\r\n // order terminators before path separators, we'll encounter all\r\n // the index rows for documentKey contiguously. In particular, all\r\n // the rows for documentKey will occur before any rows for\r\n // documents nested in a subcollection beneath documentKey so we\r\n // can stop as soon as we hit any such row.\r\n const path = decodeResourcePath(encodedPath);\r\n if (userID !== this.userId || !documentKey.path.isEqual(path)) {\r\n control.done();\r\n return;\r\n }\r\n // Look up the mutation batch in the store.\r\n return mutationsStore(transaction)\r\n .get(batchId)\r\n .next(mutation => {\r\n if (!mutation) {\r\n throw fail();\r\n }\r\n hardAssert(mutation.userId === this.userId);\r\n results.push(fromDbMutationBatch(this.serializer, mutation));\r\n });\r\n })\r\n .next(() => results);\r\n }\r\n getAllMutationBatchesAffectingDocumentKeys(transaction, documentKeys) {\r\n let uniqueBatchIDs = new SortedSet(primitiveComparator);\r\n const promises = [];\r\n documentKeys.forEach(documentKey => {\r\n const indexStart = DbDocumentMutation.prefixForPath(this.userId, documentKey.path);\r\n const range = IDBKeyRange.lowerBound(indexStart);\r\n const promise = documentMutationsStore(transaction).iterate({ range }, (indexKey, _, control) => {\r\n const [userID, encodedPath, batchID] = indexKey;\r\n // Only consider rows matching exactly the specific key of\r\n // interest. Note that because we order by path first, and we\r\n // order terminators before path separators, we'll encounter all\r\n // the index rows for documentKey contiguously. In particular, all\r\n // the rows for documentKey will occur before any rows for\r\n // documents nested in a subcollection beneath documentKey so we\r\n // can stop as soon as we hit any such row.\r\n const path = decodeResourcePath(encodedPath);\r\n if (userID !== this.userId || !documentKey.path.isEqual(path)) {\r\n control.done();\r\n return;\r\n }\r\n uniqueBatchIDs = uniqueBatchIDs.add(batchID);\r\n });\r\n promises.push(promise);\r\n });\r\n return PersistencePromise.waitFor(promises).next(() => this.lookupMutationBatches(transaction, uniqueBatchIDs));\r\n }\r\n getAllMutationBatchesAffectingQuery(transaction, query) {\r\n const queryPath = query.path;\r\n const immediateChildrenLength = queryPath.length + 1;\r\n // TODO(mcg): Actually implement a single-collection query\r\n //\r\n // This is actually executing an ancestor query, traversing the whole\r\n // subtree below the collection which can be horrifically inefficient for\r\n // some structures. The right way to solve this is to implement the full\r\n // value index, but that's not in the cards in the near future so this is\r\n // the best we can do for the moment.\r\n //\r\n // Since we don't yet index the actual properties in the mutations, our\r\n // current approach is to just return all mutation batches that affect\r\n // documents in the collection being queried.\r\n const indexPrefix = DbDocumentMutation.prefixForPath(this.userId, queryPath);\r\n const indexStart = IDBKeyRange.lowerBound(indexPrefix);\r\n // Collect up unique batchIDs encountered during a scan of the index. Use a\r\n // SortedSet to accumulate batch IDs so they can be traversed in order in a\r\n // scan of the main table.\r\n let uniqueBatchIDs = new SortedSet(primitiveComparator);\r\n return documentMutationsStore(transaction)\r\n .iterate({ range: indexStart }, (indexKey, _, control) => {\r\n const [userID, encodedPath, batchID] = indexKey;\r\n const path = decodeResourcePath(encodedPath);\r\n if (userID !== this.userId || !queryPath.isPrefixOf(path)) {\r\n control.done();\r\n return;\r\n }\r\n // Rows with document keys more than one segment longer than the\r\n // query path can't be matches. For example, a query on 'rooms'\r\n // can't match the document /rooms/abc/messages/xyx.\r\n // TODO(mcg): we'll need a different scanner when we implement\r\n // ancestor queries.\r\n if (path.length !== immediateChildrenLength) {\r\n return;\r\n }\r\n uniqueBatchIDs = uniqueBatchIDs.add(batchID);\r\n })\r\n .next(() => this.lookupMutationBatches(transaction, uniqueBatchIDs));\r\n }\r\n lookupMutationBatches(transaction, batchIDs) {\r\n const results = [];\r\n const promises = [];\r\n // TODO(rockwood): Implement this using iterate.\r\n batchIDs.forEach(batchId => {\r\n promises.push(mutationsStore(transaction)\r\n .get(batchId)\r\n .next(mutation => {\r\n if (mutation === null) {\r\n throw fail();\r\n }\r\n hardAssert(mutation.userId === this.userId);\r\n results.push(fromDbMutationBatch(this.serializer, mutation));\r\n }));\r\n });\r\n return PersistencePromise.waitFor(promises).next(() => results);\r\n }\r\n removeMutationBatch(transaction, batch) {\r\n return removeMutationBatch(transaction.simpleDbTransaction, this.userId, batch).next(removedDocuments => {\r\n transaction.addOnCommittedListener(() => {\r\n this.removeCachedMutationKeys(batch.batchId);\r\n });\r\n return PersistencePromise.forEach(removedDocuments, (key) => {\r\n return this.referenceDelegate.markPotentiallyOrphaned(transaction, key);\r\n });\r\n });\r\n }\r\n /**\r\n * Clears the cached keys for a mutation batch. This method should be\r\n * called by secondary clients after they process mutation updates.\r\n *\r\n * Note that this method does not have to be called from primary clients as\r\n * the corresponding cache entries are cleared when an acknowledged or\r\n * rejected batch is removed from the mutation queue.\r\n */\r\n // PORTING NOTE: Multi-tab only\r\n removeCachedMutationKeys(batchId) {\r\n delete this.documentKeysByBatchId[batchId];\r\n }\r\n performConsistencyCheck(txn) {\r\n return this.checkEmpty(txn).next(empty => {\r\n if (!empty) {\r\n return PersistencePromise.resolve();\r\n }\r\n // Verify that there are no entries in the documentMutations index if\r\n // the queue is empty.\r\n const startRange = IDBKeyRange.lowerBound(DbDocumentMutation.prefixForUser(this.userId));\r\n const danglingMutationReferences = [];\r\n return documentMutationsStore(txn)\r\n .iterate({ range: startRange }, (key, _, control) => {\r\n const userID = key[0];\r\n if (userID !== this.userId) {\r\n control.done();\r\n return;\r\n }\r\n else {\r\n const path = decodeResourcePath(key[1]);\r\n danglingMutationReferences.push(path);\r\n }\r\n })\r\n .next(() => {\r\n hardAssert(danglingMutationReferences.length === 0);\r\n });\r\n });\r\n }\r\n containsKey(txn, key) {\r\n return mutationQueueContainsKey(txn, this.userId, key);\r\n }\r\n // PORTING NOTE: Multi-tab only (state is held in memory in other clients).\r\n /** Returns the mutation queue's metadata from IndexedDb. */\r\n getMutationQueueMetadata(transaction) {\r\n return mutationQueuesStore(transaction)\r\n .get(this.userId)\r\n .next((metadata) => {\r\n return (metadata ||\r\n new DbMutationQueue(this.userId, BATCHID_UNKNOWN, \r\n /*lastStreamToken=*/ ''));\r\n });\r\n }\r\n}\r\n/**\r\n * @returns true if the mutation queue for the given user contains a pending\r\n * mutation for the given key.\r\n */\r\nfunction mutationQueueContainsKey(txn, userId, key) {\r\n const indexKey = DbDocumentMutation.prefixForPath(userId, key.path);\r\n const encodedPath = indexKey[1];\r\n const startRange = IDBKeyRange.lowerBound(indexKey);\r\n let containsKey = false;\r\n return documentMutationsStore(txn)\r\n .iterate({ range: startRange, keysOnly: true }, (key, value, control) => {\r\n const [userID, keyPath, /*batchID*/ _] = key;\r\n if (userID === userId && keyPath === encodedPath) {\r\n containsKey = true;\r\n }\r\n control.done();\r\n })\r\n .next(() => containsKey);\r\n}\r\n/** Returns true if any mutation queue contains the given document. */\r\nfunction mutationQueuesContainKey(txn, docKey) {\r\n let found = false;\r\n return mutationQueuesStore(txn)\r\n .iterateSerial(userId => {\r\n return mutationQueueContainsKey(txn, userId, docKey).next(containsKey => {\r\n if (containsKey) {\r\n found = true;\r\n }\r\n return PersistencePromise.resolve(!containsKey);\r\n });\r\n })\r\n .next(() => found);\r\n}\r\n/**\r\n * Helper to get a typed SimpleDbStore for the mutations object store.\r\n */\r\nfunction mutationsStore(txn) {\r\n return getStore(txn, DbMutationBatch.store);\r\n}\r\n/**\r\n * Helper to get a typed SimpleDbStore for the mutationQueues object store.\r\n */\r\nfunction documentMutationsStore(txn) {\r\n return getStore(txn, DbDocumentMutation.store);\r\n}\r\n/**\r\n * Helper to get a typed SimpleDbStore for the mutationQueues object store.\r\n */\r\nfunction mutationQueuesStore(txn) {\r\n return getStore(txn, DbMutationQueue.store);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/** Offset to ensure non-overlapping target ids. */\r\nconst OFFSET = 2;\r\n/**\r\n * Generates monotonically increasing target IDs for sending targets to the\r\n * watch stream.\r\n *\r\n * The client constructs two generators, one for the target cache, and one for\r\n * for the sync engine (to generate limbo documents targets). These\r\n * generators produce non-overlapping IDs (by using even and odd IDs\r\n * respectively).\r\n *\r\n * By separating the target ID space, the query cache can generate target IDs\r\n * that persist across client restarts, while sync engine can independently\r\n * generate in-memory target IDs that are transient and can be reused after a\r\n * restart.\r\n */\r\nclass TargetIdGenerator {\r\n constructor(lastId) {\r\n this.lastId = lastId;\r\n }\r\n next() {\r\n this.lastId += OFFSET;\r\n return this.lastId;\r\n }\r\n static forTargetCache() {\r\n // The target cache generator must return '2' in its first call to `next()`\r\n // as there is no differentiation in the protocol layer between an unset\r\n // number and the number '0'. If we were to sent a target with target ID\r\n // '0', the backend would consider it unset and replace it with its own ID.\r\n return new TargetIdGenerator(2 - OFFSET);\r\n }\r\n static forSyncEngine() {\r\n // Sync engine assigns target IDs for limbo document detection.\r\n return new TargetIdGenerator(1 - OFFSET);\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nclass IndexedDbTargetCache {\r\n constructor(referenceDelegate, serializer) {\r\n this.referenceDelegate = referenceDelegate;\r\n this.serializer = serializer;\r\n }\r\n // PORTING NOTE: We don't cache global metadata for the target cache, since\r\n // some of it (in particular `highestTargetId`) can be modified by secondary\r\n // tabs. We could perhaps be more granular (and e.g. still cache\r\n // `lastRemoteSnapshotVersion` in memory) but for simplicity we currently go\r\n // to IndexedDb whenever we need to read metadata. We can revisit if it turns\r\n // out to have a meaningful performance impact.\r\n allocateTargetId(transaction) {\r\n return this.retrieveMetadata(transaction).next(metadata => {\r\n const targetIdGenerator = new TargetIdGenerator(metadata.highestTargetId);\r\n metadata.highestTargetId = targetIdGenerator.next();\r\n return this.saveMetadata(transaction, metadata).next(() => metadata.highestTargetId);\r\n });\r\n }\r\n getLastRemoteSnapshotVersion(transaction) {\r\n return this.retrieveMetadata(transaction).next(metadata => {\r\n return SnapshotVersion.fromTimestamp(new Timestamp(metadata.lastRemoteSnapshotVersion.seconds, metadata.lastRemoteSnapshotVersion.nanoseconds));\r\n });\r\n }\r\n getHighestSequenceNumber(transaction) {\r\n return this.retrieveMetadata(transaction).next(targetGlobal => targetGlobal.highestListenSequenceNumber);\r\n }\r\n setTargetsMetadata(transaction, highestListenSequenceNumber, lastRemoteSnapshotVersion) {\r\n return this.retrieveMetadata(transaction).next(metadata => {\r\n metadata.highestListenSequenceNumber = highestListenSequenceNumber;\r\n if (lastRemoteSnapshotVersion) {\r\n metadata.lastRemoteSnapshotVersion =\r\n lastRemoteSnapshotVersion.toTimestamp();\r\n }\r\n if (highestListenSequenceNumber > metadata.highestListenSequenceNumber) {\r\n metadata.highestListenSequenceNumber = highestListenSequenceNumber;\r\n }\r\n return this.saveMetadata(transaction, metadata);\r\n });\r\n }\r\n addTargetData(transaction, targetData) {\r\n return this.saveTargetData(transaction, targetData).next(() => {\r\n return this.retrieveMetadata(transaction).next(metadata => {\r\n metadata.targetCount += 1;\r\n this.updateMetadataFromTargetData(targetData, metadata);\r\n return this.saveMetadata(transaction, metadata);\r\n });\r\n });\r\n }\r\n updateTargetData(transaction, targetData) {\r\n return this.saveTargetData(transaction, targetData);\r\n }\r\n removeTargetData(transaction, targetData) {\r\n return this.removeMatchingKeysForTargetId(transaction, targetData.targetId)\r\n .next(() => targetsStore(transaction).delete(targetData.targetId))\r\n .next(() => this.retrieveMetadata(transaction))\r\n .next(metadata => {\r\n hardAssert(metadata.targetCount > 0);\r\n metadata.targetCount -= 1;\r\n return this.saveMetadata(transaction, metadata);\r\n });\r\n }\r\n /**\r\n * Drops any targets with sequence number less than or equal to the upper bound, excepting those\r\n * present in `activeTargetIds`. Document associations for the removed targets are also removed.\r\n * Returns the number of targets removed.\r\n */\r\n removeTargets(txn, upperBound, activeTargetIds) {\r\n let count = 0;\r\n const promises = [];\r\n return targetsStore(txn)\r\n .iterate((key, value) => {\r\n const targetData = fromDbTarget(value);\r\n if (targetData.sequenceNumber <= upperBound &&\r\n activeTargetIds.get(targetData.targetId) === null) {\r\n count++;\r\n promises.push(this.removeTargetData(txn, targetData));\r\n }\r\n })\r\n .next(() => PersistencePromise.waitFor(promises))\r\n .next(() => count);\r\n }\r\n /**\r\n * Call provided function with each `TargetData` that we have cached.\r\n */\r\n forEachTarget(txn, f) {\r\n return targetsStore(txn).iterate((key, value) => {\r\n const targetData = fromDbTarget(value);\r\n f(targetData);\r\n });\r\n }\r\n retrieveMetadata(transaction) {\r\n return globalTargetStore(transaction)\r\n .get(DbTargetGlobal.key)\r\n .next(metadata => {\r\n hardAssert(metadata !== null);\r\n return metadata;\r\n });\r\n }\r\n saveMetadata(transaction, metadata) {\r\n return globalTargetStore(transaction).put(DbTargetGlobal.key, metadata);\r\n }\r\n saveTargetData(transaction, targetData) {\r\n return targetsStore(transaction).put(toDbTarget(this.serializer, targetData));\r\n }\r\n /**\r\n * In-place updates the provided metadata to account for values in the given\r\n * TargetData. Saving is done separately. Returns true if there were any\r\n * changes to the metadata.\r\n */\r\n updateMetadataFromTargetData(targetData, metadata) {\r\n let updated = false;\r\n if (targetData.targetId > metadata.highestTargetId) {\r\n metadata.highestTargetId = targetData.targetId;\r\n updated = true;\r\n }\r\n if (targetData.sequenceNumber > metadata.highestListenSequenceNumber) {\r\n metadata.highestListenSequenceNumber = targetData.sequenceNumber;\r\n updated = true;\r\n }\r\n return updated;\r\n }\r\n getTargetCount(transaction) {\r\n return this.retrieveMetadata(transaction).next(metadata => metadata.targetCount);\r\n }\r\n getTargetData(transaction, target) {\r\n // Iterating by the canonicalId may yield more than one result because\r\n // canonicalId values are not required to be unique per target. This query\r\n // depends on the queryTargets index to be efficient.\r\n const canonicalId = canonifyTarget(target);\r\n const range = IDBKeyRange.bound([canonicalId, Number.NEGATIVE_INFINITY], [canonicalId, Number.POSITIVE_INFINITY]);\r\n let result = null;\r\n return targetsStore(transaction)\r\n .iterate({ range, index: DbTarget.queryTargetsIndexName }, (key, value, control) => {\r\n const found = fromDbTarget(value);\r\n // After finding a potential match, check that the target is\r\n // actually equal to the requested target.\r\n if (targetEquals(target, found.target)) {\r\n result = found;\r\n control.done();\r\n }\r\n })\r\n .next(() => result);\r\n }\r\n addMatchingKeys(txn, keys, targetId) {\r\n // PORTING NOTE: The reverse index (documentsTargets) is maintained by\r\n // IndexedDb.\r\n const promises = [];\r\n const store = documentTargetStore(txn);\r\n keys.forEach(key => {\r\n const path = encodeResourcePath(key.path);\r\n promises.push(store.put(new DbTargetDocument(targetId, path)));\r\n promises.push(this.referenceDelegate.addReference(txn, targetId, key));\r\n });\r\n return PersistencePromise.waitFor(promises);\r\n }\r\n removeMatchingKeys(txn, keys, targetId) {\r\n // PORTING NOTE: The reverse index (documentsTargets) is maintained by\r\n // IndexedDb.\r\n const store = documentTargetStore(txn);\r\n return PersistencePromise.forEach(keys, (key) => {\r\n const path = encodeResourcePath(key.path);\r\n return PersistencePromise.waitFor([\r\n store.delete([targetId, path]),\r\n this.referenceDelegate.removeReference(txn, targetId, key)\r\n ]);\r\n });\r\n }\r\n removeMatchingKeysForTargetId(txn, targetId) {\r\n const store = documentTargetStore(txn);\r\n const range = IDBKeyRange.bound([targetId], [targetId + 1], \r\n /*lowerOpen=*/ false, \r\n /*upperOpen=*/ true);\r\n return store.delete(range);\r\n }\r\n getMatchingKeysForTargetId(txn, targetId) {\r\n const range = IDBKeyRange.bound([targetId], [targetId + 1], \r\n /*lowerOpen=*/ false, \r\n /*upperOpen=*/ true);\r\n const store = documentTargetStore(txn);\r\n let result = documentKeySet();\r\n return store\r\n .iterate({ range, keysOnly: true }, (key, _, control) => {\r\n const path = decodeResourcePath(key[1]);\r\n const docKey = new DocumentKey(path);\r\n result = result.add(docKey);\r\n })\r\n .next(() => result);\r\n }\r\n containsKey(txn, key) {\r\n const path = encodeResourcePath(key.path);\r\n const range = IDBKeyRange.bound([path], [immediateSuccessor(path)], \r\n /*lowerOpen=*/ false, \r\n /*upperOpen=*/ true);\r\n let count = 0;\r\n return documentTargetStore(txn)\r\n .iterate({\r\n index: DbTargetDocument.documentTargetsIndex,\r\n keysOnly: true,\r\n range\r\n }, ([targetId, path], _, control) => {\r\n // Having a sentinel row for a document does not count as containing that document;\r\n // For the target cache, containing the document means the document is part of some\r\n // target.\r\n if (targetId !== 0) {\r\n count++;\r\n control.done();\r\n }\r\n })\r\n .next(() => count > 0);\r\n }\r\n /**\r\n * Looks up a TargetData entry by target ID.\r\n *\r\n * @param targetId - The target ID of the TargetData entry to look up.\r\n * @returns The cached TargetData entry, or null if the cache has no entry for\r\n * the target.\r\n */\r\n // PORTING NOTE: Multi-tab only.\r\n getTargetDataForTarget(transaction, targetId) {\r\n return targetsStore(transaction)\r\n .get(targetId)\r\n .next(found => {\r\n if (found) {\r\n return fromDbTarget(found);\r\n }\r\n else {\r\n return null;\r\n }\r\n });\r\n }\r\n}\r\n/**\r\n * Helper to get a typed SimpleDbStore for the queries object store.\r\n */\r\nfunction targetsStore(txn) {\r\n return getStore(txn, DbTarget.store);\r\n}\r\n/**\r\n * Helper to get a typed SimpleDbStore for the target globals object store.\r\n */\r\nfunction globalTargetStore(txn) {\r\n return getStore(txn, DbTargetGlobal.store);\r\n}\r\n/**\r\n * Helper to get a typed SimpleDbStore for the document target object store.\r\n */\r\nfunction documentTargetStore(txn) {\r\n return getStore(txn, DbTargetDocument.store);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Verifies the error thrown by a LocalStore operation. If a LocalStore\r\n * operation fails because the primary lease has been taken by another client,\r\n * we ignore the error (the persistence layer will immediately call\r\n * `applyPrimaryLease` to propagate the primary state change). All other errors\r\n * are re-thrown.\r\n *\r\n * @param err - An error returned by a LocalStore operation.\r\n * @returns A Promise that resolves after we recovered, or the original error.\r\n */\r\nasync function ignoreIfPrimaryLeaseLoss(err) {\r\n if (err.code === Code.FAILED_PRECONDITION &&\r\n err.message === PRIMARY_LEASE_LOST_ERROR_MSG) {\r\n logDebug('LocalStore', 'Unexpectedly lost primary lease');\r\n }\r\n else {\r\n throw err;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2018 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst GC_DID_NOT_RUN = {\r\n didRun: false,\r\n sequenceNumbersCollected: 0,\r\n targetsRemoved: 0,\r\n documentsRemoved: 0\r\n};\r\nconst LRU_COLLECTION_DISABLED = -1;\r\nconst LRU_DEFAULT_CACHE_SIZE_BYTES = 40 * 1024 * 1024;\r\nclass LruParams {\r\n constructor(\r\n // When we attempt to collect, we will only do so if the cache size is greater than this\r\n // threshold. Passing `COLLECTION_DISABLED` here will cause collection to always be skipped.\r\n cacheSizeCollectionThreshold, \r\n // The percentage of sequence numbers that we will attempt to collect\r\n percentileToCollect, \r\n // A cap on the total number of sequence numbers that will be collected. This prevents\r\n // us from collecting a huge number of sequence numbers if the cache has grown very large.\r\n maximumSequenceNumbersToCollect) {\r\n this.cacheSizeCollectionThreshold = cacheSizeCollectionThreshold;\r\n this.percentileToCollect = percentileToCollect;\r\n this.maximumSequenceNumbersToCollect = maximumSequenceNumbersToCollect;\r\n }\r\n static withCacheSize(cacheSize) {\r\n return new LruParams(cacheSize, LruParams.DEFAULT_COLLECTION_PERCENTILE, LruParams.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT);\r\n }\r\n}\r\nLruParams.DEFAULT_COLLECTION_PERCENTILE = 10;\r\nLruParams.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT = 1000;\r\nLruParams.DEFAULT = new LruParams(LRU_DEFAULT_CACHE_SIZE_BYTES, LruParams.DEFAULT_COLLECTION_PERCENTILE, LruParams.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT);\r\nLruParams.DISABLED = new LruParams(LRU_COLLECTION_DISABLED, 0, 0);\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst LOG_TAG$e = 'LruGarbageCollector';\r\nconst LRU_MINIMUM_CACHE_SIZE_BYTES = 1 * 1024 * 1024;\r\n/** How long we wait to try running LRU GC after SDK initialization. */\r\nconst INITIAL_GC_DELAY_MS = 1 * 60 * 1000;\r\n/** Minimum amount of time between GC checks, after the first one. */\r\nconst REGULAR_GC_DELAY_MS = 5 * 60 * 1000;\r\nfunction bufferEntryComparator([aSequence, aIndex], [bSequence, bIndex]) {\r\n const seqCmp = primitiveComparator(aSequence, bSequence);\r\n if (seqCmp === 0) {\r\n // This order doesn't matter, but we can bias against churn by sorting\r\n // entries created earlier as less than newer entries.\r\n return primitiveComparator(aIndex, bIndex);\r\n }\r\n else {\r\n return seqCmp;\r\n }\r\n}\r\n/**\r\n * Used to calculate the nth sequence number. Keeps a rolling buffer of the\r\n * lowest n values passed to `addElement`, and finally reports the largest of\r\n * them in `maxValue`.\r\n */\r\nclass RollingSequenceNumberBuffer {\r\n constructor(maxElements) {\r\n this.maxElements = maxElements;\r\n this.buffer = new SortedSet(bufferEntryComparator);\r\n this.previousIndex = 0;\r\n }\r\n nextIndex() {\r\n return ++this.previousIndex;\r\n }\r\n addElement(sequenceNumber) {\r\n const entry = [sequenceNumber, this.nextIndex()];\r\n if (this.buffer.size < this.maxElements) {\r\n this.buffer = this.buffer.add(entry);\r\n }\r\n else {\r\n const highestValue = this.buffer.last();\r\n if (bufferEntryComparator(entry, highestValue) < 0) {\r\n this.buffer = this.buffer.delete(highestValue).add(entry);\r\n }\r\n }\r\n }\r\n get maxValue() {\r\n // Guaranteed to be non-empty. If we decide we are not collecting any\r\n // sequence numbers, nthSequenceNumber below short-circuits. If we have\r\n // decided that we are collecting n sequence numbers, it's because n is some\r\n // percentage of the existing sequence numbers. That means we should never\r\n // be in a situation where we are collecting sequence numbers but don't\r\n // actually have any.\r\n return this.buffer.last()[0];\r\n }\r\n}\r\n/**\r\n * This class is responsible for the scheduling of LRU garbage collection. It handles checking\r\n * whether or not GC is enabled, as well as which delay to use before the next run.\r\n */\r\nclass LruScheduler {\r\n constructor(garbageCollector, asyncQueue) {\r\n this.garbageCollector = garbageCollector;\r\n this.asyncQueue = asyncQueue;\r\n this.hasRun = false;\r\n this.gcTask = null;\r\n }\r\n start(localStore) {\r\n if (this.garbageCollector.params.cacheSizeCollectionThreshold !==\r\n LRU_COLLECTION_DISABLED) {\r\n this.scheduleGC(localStore);\r\n }\r\n }\r\n stop() {\r\n if (this.gcTask) {\r\n this.gcTask.cancel();\r\n this.gcTask = null;\r\n }\r\n }\r\n get started() {\r\n return this.gcTask !== null;\r\n }\r\n scheduleGC(localStore) {\r\n const delay = this.hasRun ? REGULAR_GC_DELAY_MS : INITIAL_GC_DELAY_MS;\r\n logDebug('LruGarbageCollector', `Garbage collection scheduled in ${delay}ms`);\r\n this.gcTask = this.asyncQueue.enqueueAfterDelay(\"lru_garbage_collection\" /* LruGarbageCollection */, delay, async () => {\r\n this.gcTask = null;\r\n this.hasRun = true;\r\n try {\r\n await localStore.collectGarbage(this.garbageCollector);\r\n }\r\n catch (e) {\r\n if (isIndexedDbTransactionError(e)) {\r\n logDebug(LOG_TAG$e, 'Ignoring IndexedDB error during garbage collection: ', e);\r\n }\r\n else {\r\n await ignoreIfPrimaryLeaseLoss(e);\r\n }\r\n }\r\n await this.scheduleGC(localStore);\r\n });\r\n }\r\n}\r\n/** Implements the steps for LRU garbage collection. */\r\nclass LruGarbageCollectorImpl {\r\n constructor(delegate, params) {\r\n this.delegate = delegate;\r\n this.params = params;\r\n }\r\n calculateTargetCount(txn, percentile) {\r\n return this.delegate.getSequenceNumberCount(txn).next(targetCount => {\r\n return Math.floor((percentile / 100.0) * targetCount);\r\n });\r\n }\r\n nthSequenceNumber(txn, n) {\r\n if (n === 0) {\r\n return PersistencePromise.resolve(ListenSequence.INVALID);\r\n }\r\n const buffer = new RollingSequenceNumberBuffer(n);\r\n return this.delegate\r\n .forEachTarget(txn, target => buffer.addElement(target.sequenceNumber))\r\n .next(() => {\r\n return this.delegate.forEachOrphanedDocumentSequenceNumber(txn, sequenceNumber => buffer.addElement(sequenceNumber));\r\n })\r\n .next(() => buffer.maxValue);\r\n }\r\n removeTargets(txn, upperBound, activeTargetIds) {\r\n return this.delegate.removeTargets(txn, upperBound, activeTargetIds);\r\n }\r\n removeOrphanedDocuments(txn, upperBound) {\r\n return this.delegate.removeOrphanedDocuments(txn, upperBound);\r\n }\r\n collect(txn, activeTargetIds) {\r\n if (this.params.cacheSizeCollectionThreshold === LRU_COLLECTION_DISABLED) {\r\n logDebug('LruGarbageCollector', 'Garbage collection skipped; disabled');\r\n return PersistencePromise.resolve(GC_DID_NOT_RUN);\r\n }\r\n return this.getCacheSize(txn).next(cacheSize => {\r\n if (cacheSize < this.params.cacheSizeCollectionThreshold) {\r\n logDebug('LruGarbageCollector', `Garbage collection skipped; Cache size ${cacheSize} ` +\r\n `is lower than threshold ${this.params.cacheSizeCollectionThreshold}`);\r\n return GC_DID_NOT_RUN;\r\n }\r\n else {\r\n return this.runGarbageCollection(txn, activeTargetIds);\r\n }\r\n });\r\n }\r\n getCacheSize(txn) {\r\n return this.delegate.getCacheSize(txn);\r\n }\r\n runGarbageCollection(txn, activeTargetIds) {\r\n let upperBoundSequenceNumber;\r\n let sequenceNumbersToCollect, targetsRemoved;\r\n // Timestamps for various pieces of the process\r\n let countedTargetsTs, foundUpperBoundTs, removedTargetsTs, removedDocumentsTs;\r\n const startTs = Date.now();\r\n return this.calculateTargetCount(txn, this.params.percentileToCollect)\r\n .next(sequenceNumbers => {\r\n // Cap at the configured max\r\n if (sequenceNumbers > this.params.maximumSequenceNumbersToCollect) {\r\n logDebug('LruGarbageCollector', 'Capping sequence numbers to collect down ' +\r\n `to the maximum of ${this.params.maximumSequenceNumbersToCollect} ` +\r\n `from ${sequenceNumbers}`);\r\n sequenceNumbersToCollect =\r\n this.params.maximumSequenceNumbersToCollect;\r\n }\r\n else {\r\n sequenceNumbersToCollect = sequenceNumbers;\r\n }\r\n countedTargetsTs = Date.now();\r\n return this.nthSequenceNumber(txn, sequenceNumbersToCollect);\r\n })\r\n .next(upperBound => {\r\n upperBoundSequenceNumber = upperBound;\r\n foundUpperBoundTs = Date.now();\r\n return this.removeTargets(txn, upperBoundSequenceNumber, activeTargetIds);\r\n })\r\n .next(numTargetsRemoved => {\r\n targetsRemoved = numTargetsRemoved;\r\n removedTargetsTs = Date.now();\r\n return this.removeOrphanedDocuments(txn, upperBoundSequenceNumber);\r\n })\r\n .next(documentsRemoved => {\r\n removedDocumentsTs = Date.now();\r\n if (getLogLevel() <= LogLevel.DEBUG) {\r\n const desc = 'LRU Garbage Collection\\n' +\r\n `\\tCounted targets in ${countedTargetsTs - startTs}ms\\n` +\r\n `\\tDetermined least recently used ${sequenceNumbersToCollect} in ` +\r\n `${foundUpperBoundTs - countedTargetsTs}ms\\n` +\r\n `\\tRemoved ${targetsRemoved} targets in ` +\r\n `${removedTargetsTs - foundUpperBoundTs}ms\\n` +\r\n `\\tRemoved ${documentsRemoved} documents in ` +\r\n `${removedDocumentsTs - removedTargetsTs}ms\\n` +\r\n `Total Duration: ${removedDocumentsTs - startTs}ms`;\r\n logDebug('LruGarbageCollector', desc);\r\n }\r\n return PersistencePromise.resolve({\r\n didRun: true,\r\n sequenceNumbersCollected: sequenceNumbersToCollect,\r\n targetsRemoved,\r\n documentsRemoved\r\n });\r\n });\r\n }\r\n}\r\nfunction newLruGarbageCollector(delegate, params) {\r\n return new LruGarbageCollectorImpl(delegate, params);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/** Provides LRU functionality for IndexedDB persistence. */\r\nclass IndexedDbLruDelegateImpl {\r\n constructor(db, params) {\r\n this.db = db;\r\n this.garbageCollector = newLruGarbageCollector(this, params);\r\n }\r\n getSequenceNumberCount(txn) {\r\n const docCountPromise = this.orphanedDocumentCount(txn);\r\n const targetCountPromise = this.db.getTargetCache().getTargetCount(txn);\r\n return targetCountPromise.next(targetCount => docCountPromise.next(docCount => targetCount + docCount));\r\n }\r\n orphanedDocumentCount(txn) {\r\n let orphanedCount = 0;\r\n return this.forEachOrphanedDocumentSequenceNumber(txn, _ => {\r\n orphanedCount++;\r\n }).next(() => orphanedCount);\r\n }\r\n forEachTarget(txn, f) {\r\n return this.db.getTargetCache().forEachTarget(txn, f);\r\n }\r\n forEachOrphanedDocumentSequenceNumber(txn, f) {\r\n return this.forEachOrphanedDocument(txn, (docKey, sequenceNumber) => f(sequenceNumber));\r\n }\r\n addReference(txn, targetId, key) {\r\n return writeSentinelKey(txn, key);\r\n }\r\n removeReference(txn, targetId, key) {\r\n return writeSentinelKey(txn, key);\r\n }\r\n removeTargets(txn, upperBound, activeTargetIds) {\r\n return this.db.getTargetCache().removeTargets(txn, upperBound, activeTargetIds);\r\n }\r\n markPotentiallyOrphaned(txn, key) {\r\n return writeSentinelKey(txn, key);\r\n }\r\n /**\r\n * Returns true if anything would prevent this document from being garbage\r\n * collected, given that the document in question is not present in any\r\n * targets and has a sequence number less than or equal to the upper bound for\r\n * the collection run.\r\n */\r\n isPinned(txn, docKey) {\r\n return mutationQueuesContainKey(txn, docKey);\r\n }\r\n removeOrphanedDocuments(txn, upperBound) {\r\n const documentCache = this.db.getRemoteDocumentCache();\r\n const changeBuffer = documentCache.newChangeBuffer();\r\n const promises = [];\r\n let documentCount = 0;\r\n const iteration = this.forEachOrphanedDocument(txn, (docKey, sequenceNumber) => {\r\n if (sequenceNumber <= upperBound) {\r\n const p = this.isPinned(txn, docKey).next(isPinned => {\r\n if (!isPinned) {\r\n documentCount++;\r\n // Our size accounting requires us to read all documents before\r\n // removing them.\r\n return changeBuffer.getEntry(txn, docKey).next(() => {\r\n changeBuffer.removeEntry(docKey);\r\n return documentTargetStore(txn).delete(sentinelKey$1(docKey));\r\n });\r\n }\r\n });\r\n promises.push(p);\r\n }\r\n });\r\n return iteration\r\n .next(() => PersistencePromise.waitFor(promises))\r\n .next(() => changeBuffer.apply(txn))\r\n .next(() => documentCount);\r\n }\r\n removeTarget(txn, targetData) {\r\n const updated = targetData.withSequenceNumber(txn.currentSequenceNumber);\r\n return this.db.getTargetCache().updateTargetData(txn, updated);\r\n }\r\n updateLimboDocument(txn, key) {\r\n return writeSentinelKey(txn, key);\r\n }\r\n /**\r\n * Call provided function for each document in the cache that is 'orphaned'. Orphaned\r\n * means not a part of any target, so the only entry in the target-document index for\r\n * that document will be the sentinel row (targetId 0), which will also have the sequence\r\n * number for the last time the document was accessed.\r\n */\r\n forEachOrphanedDocument(txn, f) {\r\n const store = documentTargetStore(txn);\r\n let nextToReport = ListenSequence.INVALID;\r\n let nextPath;\r\n return store\r\n .iterate({\r\n index: DbTargetDocument.documentTargetsIndex\r\n }, ([targetId, docKey], { path, sequenceNumber }) => {\r\n if (targetId === 0) {\r\n // if nextToReport is valid, report it, this is a new key so the\r\n // last one must not be a member of any targets.\r\n if (nextToReport !== ListenSequence.INVALID) {\r\n f(new DocumentKey(decodeResourcePath(nextPath)), nextToReport);\r\n }\r\n // set nextToReport to be this sequence number. It's the next one we\r\n // might report, if we don't find any targets for this document.\r\n // Note that the sequence number must be defined when the targetId\r\n // is 0.\r\n nextToReport = sequenceNumber;\r\n nextPath = path;\r\n }\r\n else {\r\n // set nextToReport to be invalid, we know we don't need to report\r\n // this one since we found a target for it.\r\n nextToReport = ListenSequence.INVALID;\r\n }\r\n })\r\n .next(() => {\r\n // Since we report sequence numbers after getting to the next key, we\r\n // need to check if the last key we iterated over was an orphaned\r\n // document and report it.\r\n if (nextToReport !== ListenSequence.INVALID) {\r\n f(new DocumentKey(decodeResourcePath(nextPath)), nextToReport);\r\n }\r\n });\r\n }\r\n getCacheSize(txn) {\r\n return this.db.getRemoteDocumentCache().getSize(txn);\r\n }\r\n}\r\nfunction sentinelKey$1(key) {\r\n return [0, encodeResourcePath(key.path)];\r\n}\r\n/**\r\n * @returns A value suitable for writing a sentinel row in the target-document\r\n * store.\r\n */\r\nfunction sentinelRow(key, sequenceNumber) {\r\n return new DbTargetDocument(0, encodeResourcePath(key.path), sequenceNumber);\r\n}\r\nfunction writeSentinelKey(txn, key) {\r\n return documentTargetStore(txn).put(sentinelRow(key, txn.currentSequenceNumber));\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A map implementation that uses objects as keys. Objects must have an\r\n * associated equals function and must be immutable. Entries in the map are\r\n * stored together with the key being produced from the mapKeyFn. This map\r\n * automatically handles collisions of keys.\r\n */\r\nclass ObjectMap {\r\n constructor(mapKeyFn, equalsFn) {\r\n this.mapKeyFn = mapKeyFn;\r\n this.equalsFn = equalsFn;\r\n /**\r\n * The inner map for a key/value pair. Due to the possibility of collisions we\r\n * keep a list of entries that we do a linear search through to find an actual\r\n * match. Note that collisions should be rare, so we still expect near\r\n * constant time lookups in practice.\r\n */\r\n this.inner = {};\r\n }\r\n /** Get a value for this key, or undefined if it does not exist. */\r\n get(key) {\r\n const id = this.mapKeyFn(key);\r\n const matches = this.inner[id];\r\n if (matches === undefined) {\r\n return undefined;\r\n }\r\n for (const [otherKey, value] of matches) {\r\n if (this.equalsFn(otherKey, key)) {\r\n return value;\r\n }\r\n }\r\n return undefined;\r\n }\r\n has(key) {\r\n return this.get(key) !== undefined;\r\n }\r\n /** Put this key and value in the map. */\r\n set(key, value) {\r\n const id = this.mapKeyFn(key);\r\n const matches = this.inner[id];\r\n if (matches === undefined) {\r\n this.inner[id] = [[key, value]];\r\n return;\r\n }\r\n for (let i = 0; i < matches.length; i++) {\r\n if (this.equalsFn(matches[i][0], key)) {\r\n matches[i] = [key, value];\r\n return;\r\n }\r\n }\r\n matches.push([key, value]);\r\n }\r\n /**\r\n * Remove this key from the map. Returns a boolean if anything was deleted.\r\n */\r\n delete(key) {\r\n const id = this.mapKeyFn(key);\r\n const matches = this.inner[id];\r\n if (matches === undefined) {\r\n return false;\r\n }\r\n for (let i = 0; i < matches.length; i++) {\r\n if (this.equalsFn(matches[i][0], key)) {\r\n if (matches.length === 1) {\r\n delete this.inner[id];\r\n }\r\n else {\r\n matches.splice(i, 1);\r\n }\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n forEach(fn) {\r\n forEach(this.inner, (_, entries) => {\r\n for (const [k, v] of entries) {\r\n fn(k, v);\r\n }\r\n });\r\n }\r\n isEmpty() {\r\n return isEmpty(this.inner);\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * An in-memory buffer of entries to be written to a RemoteDocumentCache.\r\n * It can be used to batch up a set of changes to be written to the cache, but\r\n * additionally supports reading entries back with the `getEntry()` method,\r\n * falling back to the underlying RemoteDocumentCache if no entry is\r\n * buffered.\r\n *\r\n * Entries added to the cache *must* be read first. This is to facilitate\r\n * calculating the size delta of the pending changes.\r\n *\r\n * PORTING NOTE: This class was implemented then removed from other platforms.\r\n * If byte-counting ends up being needed on the other platforms, consider\r\n * porting this class as part of that implementation work.\r\n */\r\nclass RemoteDocumentChangeBuffer {\r\n constructor() {\r\n // A mapping of document key to the new cache entry that should be written (or null if any\r\n // existing cache entry should be removed).\r\n this.changes = new ObjectMap(key => key.toString(), (l, r) => l.isEqual(r));\r\n this.changesApplied = false;\r\n }\r\n getReadTime(key) {\r\n const change = this.changes.get(key);\r\n if (change) {\r\n return change.readTime;\r\n }\r\n return SnapshotVersion.min();\r\n }\r\n /**\r\n * Buffers a `RemoteDocumentCache.addEntry()` call.\r\n *\r\n * You can only modify documents that have already been retrieved via\r\n * `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).\r\n */\r\n addEntry(document, readTime) {\r\n this.assertNotApplied();\r\n this.changes.set(document.key, { document, readTime });\r\n }\r\n /**\r\n * Buffers a `RemoteDocumentCache.removeEntry()` call.\r\n *\r\n * You can only remove documents that have already been retrieved via\r\n * `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).\r\n */\r\n removeEntry(key, readTime = null) {\r\n this.assertNotApplied();\r\n this.changes.set(key, {\r\n document: MutableDocument.newInvalidDocument(key),\r\n readTime\r\n });\r\n }\r\n /**\r\n * Looks up an entry in the cache. The buffered changes will first be checked,\r\n * and if no buffered change applies, this will forward to\r\n * `RemoteDocumentCache.getEntry()`.\r\n *\r\n * @param transaction - The transaction in which to perform any persistence\r\n * operations.\r\n * @param documentKey - The key of the entry to look up.\r\n * @returns The cached document or an invalid document if we have nothing\r\n * cached.\r\n */\r\n getEntry(transaction, documentKey) {\r\n this.assertNotApplied();\r\n const bufferedEntry = this.changes.get(documentKey);\r\n if (bufferedEntry !== undefined) {\r\n return PersistencePromise.resolve(bufferedEntry.document);\r\n }\r\n else {\r\n return this.getFromCache(transaction, documentKey);\r\n }\r\n }\r\n /**\r\n * Looks up several entries in the cache, forwarding to\r\n * `RemoteDocumentCache.getEntry()`.\r\n *\r\n * @param transaction - The transaction in which to perform any persistence\r\n * operations.\r\n * @param documentKeys - The keys of the entries to look up.\r\n * @returns A map of cached documents, indexed by key. If an entry cannot be\r\n * found, the corresponding key will be mapped to an invalid document.\r\n */\r\n getEntries(transaction, documentKeys) {\r\n return this.getAllFromCache(transaction, documentKeys);\r\n }\r\n /**\r\n * Applies buffered changes to the underlying RemoteDocumentCache, using\r\n * the provided transaction.\r\n */\r\n apply(transaction) {\r\n this.assertNotApplied();\r\n this.changesApplied = true;\r\n return this.applyChanges(transaction);\r\n }\r\n /** Helper to assert this.changes is not null */\r\n assertNotApplied() {\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * The RemoteDocumentCache for IndexedDb. To construct, invoke\r\n * `newIndexedDbRemoteDocumentCache()`.\r\n */\r\nclass IndexedDbRemoteDocumentCacheImpl {\r\n /**\r\n * @param serializer - The document serializer.\r\n * @param indexManager - The query indexes that need to be maintained.\r\n */\r\n constructor(serializer, indexManager) {\r\n this.serializer = serializer;\r\n this.indexManager = indexManager;\r\n }\r\n /**\r\n * Adds the supplied entries to the cache.\r\n *\r\n * All calls of `addEntry` are required to go through the RemoteDocumentChangeBuffer\r\n * returned by `newChangeBuffer()` to ensure proper accounting of metadata.\r\n */\r\n addEntry(transaction, key, doc) {\r\n const documentStore = remoteDocumentsStore(transaction);\r\n return documentStore.put(dbKey(key), doc);\r\n }\r\n /**\r\n * Removes a document from the cache.\r\n *\r\n * All calls of `removeEntry` are required to go through the RemoteDocumentChangeBuffer\r\n * returned by `newChangeBuffer()` to ensure proper accounting of metadata.\r\n */\r\n removeEntry(transaction, documentKey) {\r\n const store = remoteDocumentsStore(transaction);\r\n const key = dbKey(documentKey);\r\n return store.delete(key);\r\n }\r\n /**\r\n * Updates the current cache size.\r\n *\r\n * Callers to `addEntry()` and `removeEntry()` *must* call this afterwards to update the\r\n * cache's metadata.\r\n */\r\n updateMetadata(transaction, sizeDelta) {\r\n return this.getMetadata(transaction).next(metadata => {\r\n metadata.byteSize += sizeDelta;\r\n return this.setMetadata(transaction, metadata);\r\n });\r\n }\r\n getEntry(transaction, documentKey) {\r\n return remoteDocumentsStore(transaction)\r\n .get(dbKey(documentKey))\r\n .next(dbRemoteDoc => {\r\n return this.maybeDecodeDocument(documentKey, dbRemoteDoc);\r\n });\r\n }\r\n /**\r\n * Looks up an entry in the cache.\r\n *\r\n * @param documentKey - The key of the entry to look up.\r\n * @returns The cached document entry and its size.\r\n */\r\n getSizedEntry(transaction, documentKey) {\r\n return remoteDocumentsStore(transaction)\r\n .get(dbKey(documentKey))\r\n .next(dbRemoteDoc => {\r\n const doc = this.maybeDecodeDocument(documentKey, dbRemoteDoc);\r\n return {\r\n document: doc,\r\n size: dbDocumentSize(dbRemoteDoc)\r\n };\r\n });\r\n }\r\n getEntries(transaction, documentKeys) {\r\n let results = mutableDocumentMap();\r\n return this.forEachDbEntry(transaction, documentKeys, (key, dbRemoteDoc) => {\r\n const doc = this.maybeDecodeDocument(key, dbRemoteDoc);\r\n results = results.insert(key, doc);\r\n }).next(() => results);\r\n }\r\n /**\r\n * Looks up several entries in the cache.\r\n *\r\n * @param documentKeys - The set of keys entries to look up.\r\n * @returns A map of documents indexed by key and a map of sizes indexed by\r\n * key (zero if the document does not exist).\r\n */\r\n getSizedEntries(transaction, documentKeys) {\r\n let results = mutableDocumentMap();\r\n let sizeMap = new SortedMap(DocumentKey.comparator);\r\n return this.forEachDbEntry(transaction, documentKeys, (key, dbRemoteDoc) => {\r\n const doc = this.maybeDecodeDocument(key, dbRemoteDoc);\r\n results = results.insert(key, doc);\r\n sizeMap = sizeMap.insert(key, dbDocumentSize(dbRemoteDoc));\r\n }).next(() => {\r\n return { documents: results, sizeMap };\r\n });\r\n }\r\n forEachDbEntry(transaction, documentKeys, callback) {\r\n if (documentKeys.isEmpty()) {\r\n return PersistencePromise.resolve();\r\n }\r\n const range = IDBKeyRange.bound(documentKeys.first().path.toArray(), documentKeys.last().path.toArray());\r\n const keyIter = documentKeys.getIterator();\r\n let nextKey = keyIter.getNext();\r\n return remoteDocumentsStore(transaction)\r\n .iterate({ range }, (potentialKeyRaw, dbRemoteDoc, control) => {\r\n const potentialKey = DocumentKey.fromSegments(potentialKeyRaw);\r\n // Go through keys not found in cache.\r\n while (nextKey && DocumentKey.comparator(nextKey, potentialKey) < 0) {\r\n callback(nextKey, null);\r\n nextKey = keyIter.getNext();\r\n }\r\n if (nextKey && nextKey.isEqual(potentialKey)) {\r\n // Key found in cache.\r\n callback(nextKey, dbRemoteDoc);\r\n nextKey = keyIter.hasNext() ? keyIter.getNext() : null;\r\n }\r\n // Skip to the next key (if there is one).\r\n if (nextKey) {\r\n control.skip(nextKey.path.toArray());\r\n }\r\n else {\r\n control.done();\r\n }\r\n })\r\n .next(() => {\r\n // The rest of the keys are not in the cache. One case where `iterate`\r\n // above won't go through them is when the cache is empty.\r\n while (nextKey) {\r\n callback(nextKey, null);\r\n nextKey = keyIter.hasNext() ? keyIter.getNext() : null;\r\n }\r\n });\r\n }\r\n getDocumentsMatchingQuery(transaction, query, sinceReadTime) {\r\n let results = mutableDocumentMap();\r\n const immediateChildrenPathLength = query.path.length + 1;\r\n const iterationOptions = {};\r\n if (sinceReadTime.isEqual(SnapshotVersion.min())) {\r\n // Documents are ordered by key, so we can use a prefix scan to narrow\r\n // down the documents we need to match the query against.\r\n const startKey = query.path.toArray();\r\n iterationOptions.range = IDBKeyRange.lowerBound(startKey);\r\n }\r\n else {\r\n // Execute an index-free query and filter by read time. This is safe\r\n // since all document changes to queries that have a\r\n // lastLimboFreeSnapshotVersion (`sinceReadTime`) have a read time set.\r\n const collectionKey = query.path.toArray();\r\n const readTimeKey = toDbTimestampKey(sinceReadTime);\r\n iterationOptions.range = IDBKeyRange.lowerBound([collectionKey, readTimeKey], \r\n /* open= */ true);\r\n iterationOptions.index = DbRemoteDocument.collectionReadTimeIndex;\r\n }\r\n return remoteDocumentsStore(transaction)\r\n .iterate(iterationOptions, (key, dbRemoteDoc, control) => {\r\n // The query is actually returning any path that starts with the query\r\n // path prefix which may include documents in subcollections. For\r\n // example, a query on 'rooms' will return rooms/abc/messages/xyx but we\r\n // shouldn't match it. Fix this by discarding rows with document keys\r\n // more than one segment longer than the query path.\r\n if (key.length !== immediateChildrenPathLength) {\r\n return;\r\n }\r\n const document = fromDbRemoteDocument(this.serializer, dbRemoteDoc);\r\n if (!query.path.isPrefixOf(document.key.path)) {\r\n control.done();\r\n }\r\n else if (queryMatches(query, document)) {\r\n results = results.insert(document.key, document);\r\n }\r\n })\r\n .next(() => results);\r\n }\r\n newChangeBuffer(options) {\r\n return new IndexedDbRemoteDocumentChangeBuffer(this, !!options && options.trackRemovals);\r\n }\r\n getSize(txn) {\r\n return this.getMetadata(txn).next(metadata => metadata.byteSize);\r\n }\r\n getMetadata(txn) {\r\n return documentGlobalStore(txn)\r\n .get(DbRemoteDocumentGlobal.key)\r\n .next(metadata => {\r\n hardAssert(!!metadata);\r\n return metadata;\r\n });\r\n }\r\n setMetadata(txn, metadata) {\r\n return documentGlobalStore(txn).put(DbRemoteDocumentGlobal.key, metadata);\r\n }\r\n /**\r\n * Decodes `remoteDoc` and returns the document (or null, if the document\r\n * corresponds to the format used for sentinel deletes).\r\n */\r\n maybeDecodeDocument(documentKey, dbRemoteDoc) {\r\n if (dbRemoteDoc) {\r\n const doc = fromDbRemoteDocument(this.serializer, dbRemoteDoc);\r\n // Whether the document is a sentinel removal and should only be used in the\r\n // `getNewDocumentChanges()`\r\n const isSentinelRemoval = doc.isNoDocument() && doc.version.isEqual(SnapshotVersion.min());\r\n if (!isSentinelRemoval) {\r\n return doc;\r\n }\r\n }\r\n return MutableDocument.newInvalidDocument(documentKey);\r\n }\r\n}\r\n/**\r\n * Creates a new IndexedDbRemoteDocumentCache.\r\n *\r\n * @param serializer - The document serializer.\r\n * @param indexManager - The query indexes that need to be maintained.\r\n */\r\nfunction newIndexedDbRemoteDocumentCache(serializer, indexManager) {\r\n return new IndexedDbRemoteDocumentCacheImpl(serializer, indexManager);\r\n}\r\n/**\r\n * Returns the set of documents that have changed since the specified read\r\n * time.\r\n */\r\n// PORTING NOTE: This is only used for multi-tab synchronization.\r\nfunction remoteDocumentCacheGetNewDocumentChanges(remoteDocumentCache, transaction, sinceReadTime) {\r\n const remoteDocumentCacheImpl = debugCast(remoteDocumentCache);\r\n let changedDocs = mutableDocumentMap();\r\n let lastReadTime = toDbTimestampKey(sinceReadTime);\r\n const documentsStore = remoteDocumentsStore(transaction);\r\n const range = IDBKeyRange.lowerBound(lastReadTime, true);\r\n return documentsStore\r\n .iterate({ index: DbRemoteDocument.readTimeIndex, range }, (_, dbRemoteDoc) => {\r\n // Unlike `getEntry()` and others, `getNewDocumentChanges()` parses\r\n // the documents directly since we want to keep sentinel deletes.\r\n const doc = fromDbRemoteDocument(remoteDocumentCacheImpl.serializer, dbRemoteDoc);\r\n changedDocs = changedDocs.insert(doc.key, doc);\r\n lastReadTime = dbRemoteDoc.readTime;\r\n })\r\n .next(() => {\r\n return {\r\n changedDocs,\r\n readTime: fromDbTimestampKey(lastReadTime)\r\n };\r\n });\r\n}\r\n/**\r\n * Returns the read time of the most recently read document in the cache, or\r\n * SnapshotVersion.min() if not available.\r\n */\r\n// PORTING NOTE: This is only used for multi-tab synchronization.\r\nfunction remoteDocumentCacheGetLastReadTime(transaction) {\r\n const documentsStore = remoteDocumentsStore(transaction);\r\n // If there are no existing entries, we return SnapshotVersion.min().\r\n let readTime = SnapshotVersion.min();\r\n return documentsStore\r\n .iterate({ index: DbRemoteDocument.readTimeIndex, reverse: true }, (key, dbRemoteDoc, control) => {\r\n if (dbRemoteDoc.readTime) {\r\n readTime = fromDbTimestampKey(dbRemoteDoc.readTime);\r\n }\r\n control.done();\r\n })\r\n .next(() => readTime);\r\n}\r\n/**\r\n * Handles the details of adding and updating documents in the IndexedDbRemoteDocumentCache.\r\n *\r\n * Unlike the MemoryRemoteDocumentChangeBuffer, the IndexedDb implementation computes the size\r\n * delta for all submitted changes. This avoids having to re-read all documents from IndexedDb\r\n * when we apply the changes.\r\n */\r\nclass IndexedDbRemoteDocumentChangeBuffer extends RemoteDocumentChangeBuffer {\r\n /**\r\n * @param documentCache - The IndexedDbRemoteDocumentCache to apply the changes to.\r\n * @param trackRemovals - Whether to create sentinel deletes that can be tracked by\r\n * `getNewDocumentChanges()`.\r\n */\r\n constructor(documentCache, trackRemovals) {\r\n super();\r\n this.documentCache = documentCache;\r\n this.trackRemovals = trackRemovals;\r\n // A map of document sizes prior to applying the changes in this buffer.\r\n this.documentSizes = new ObjectMap(key => key.toString(), (l, r) => l.isEqual(r));\r\n }\r\n applyChanges(transaction) {\r\n const promises = [];\r\n let sizeDelta = 0;\r\n let collectionParents = new SortedSet((l, r) => primitiveComparator(l.canonicalString(), r.canonicalString()));\r\n this.changes.forEach((key, documentChange) => {\r\n const previousSize = this.documentSizes.get(key);\r\n if (documentChange.document.isValidDocument()) {\r\n const doc = toDbRemoteDocument(this.documentCache.serializer, documentChange.document, this.getReadTime(key));\r\n collectionParents = collectionParents.add(key.path.popLast());\r\n const size = dbDocumentSize(doc);\r\n sizeDelta += size - previousSize;\r\n promises.push(this.documentCache.addEntry(transaction, key, doc));\r\n }\r\n else {\r\n sizeDelta -= previousSize;\r\n if (this.trackRemovals) {\r\n // In order to track removals, we store a \"sentinel delete\" in the\r\n // RemoteDocumentCache. This entry is represented by a NoDocument\r\n // with a version of 0 and ignored by `maybeDecodeDocument()` but\r\n // preserved in `getNewDocumentChanges()`.\r\n const deletedDoc = toDbRemoteDocument(this.documentCache.serializer, MutableDocument.newNoDocument(key, SnapshotVersion.min()), this.getReadTime(key));\r\n promises.push(this.documentCache.addEntry(transaction, key, deletedDoc));\r\n }\r\n else {\r\n promises.push(this.documentCache.removeEntry(transaction, key));\r\n }\r\n }\r\n });\r\n collectionParents.forEach(parent => {\r\n promises.push(this.documentCache.indexManager.addToCollectionParentIndex(transaction, parent));\r\n });\r\n promises.push(this.documentCache.updateMetadata(transaction, sizeDelta));\r\n return PersistencePromise.waitFor(promises);\r\n }\r\n getFromCache(transaction, documentKey) {\r\n // Record the size of everything we load from the cache so we can compute a delta later.\r\n return this.documentCache\r\n .getSizedEntry(transaction, documentKey)\r\n .next(getResult => {\r\n this.documentSizes.set(documentKey, getResult.size);\r\n return getResult.document;\r\n });\r\n }\r\n getAllFromCache(transaction, documentKeys) {\r\n // Record the size of everything we load from the cache so we can compute\r\n // a delta later.\r\n return this.documentCache\r\n .getSizedEntries(transaction, documentKeys)\r\n .next(({ documents, sizeMap }) => {\r\n // Note: `getAllFromCache` returns two maps instead of a single map from\r\n // keys to `DocumentSizeEntry`s. This is to allow returning the\r\n // `MutableDocumentMap` directly, without a conversion.\r\n sizeMap.forEach((documentKey, size) => {\r\n this.documentSizes.set(documentKey, size);\r\n });\r\n return documents;\r\n });\r\n }\r\n}\r\nfunction documentGlobalStore(txn) {\r\n return getStore(txn, DbRemoteDocumentGlobal.store);\r\n}\r\n/**\r\n * Helper to get a typed SimpleDbStore for the remoteDocuments object store.\r\n */\r\nfunction remoteDocumentsStore(txn) {\r\n return getStore(txn, DbRemoteDocument.store);\r\n}\r\nfunction dbKey(docKey) {\r\n return docKey.path.toArray();\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/** Performs database creation and schema upgrades. */\r\nclass SchemaConverter {\r\n constructor(serializer) {\r\n this.serializer = serializer;\r\n }\r\n /**\r\n * Performs database creation and schema upgrades.\r\n *\r\n * Note that in production, this method is only ever used to upgrade the schema\r\n * to SCHEMA_VERSION. Different values of toVersion are only used for testing\r\n * and local feature development.\r\n */\r\n createOrUpgrade(db, txn, fromVersion, toVersion) {\r\n hardAssert(fromVersion < toVersion &&\r\n fromVersion >= 0 &&\r\n toVersion <= SCHEMA_VERSION);\r\n const simpleDbTransaction = new SimpleDbTransaction('createOrUpgrade', txn);\r\n if (fromVersion < 1 && toVersion >= 1) {\r\n createPrimaryClientStore(db);\r\n createMutationQueue(db);\r\n createQueryCache(db);\r\n createRemoteDocumentCache(db);\r\n }\r\n // Migration 2 to populate the targetGlobal object no longer needed since\r\n // migration 3 unconditionally clears it.\r\n let p = PersistencePromise.resolve();\r\n if (fromVersion < 3 && toVersion >= 3) {\r\n // Brand new clients don't need to drop and recreate--only clients that\r\n // potentially have corrupt data.\r\n if (fromVersion !== 0) {\r\n dropQueryCache(db);\r\n createQueryCache(db);\r\n }\r\n p = p.next(() => writeEmptyTargetGlobalEntry(simpleDbTransaction));\r\n }\r\n if (fromVersion < 4 && toVersion >= 4) {\r\n if (fromVersion !== 0) {\r\n // Schema version 3 uses auto-generated keys to generate globally unique\r\n // mutation batch IDs (this was previously ensured internally by the\r\n // client). To migrate to the new schema, we have to read all mutations\r\n // and write them back out. We preserve the existing batch IDs to guarantee\r\n // consistency with other object stores. Any further mutation batch IDs will\r\n // be auto-generated.\r\n p = p.next(() => upgradeMutationBatchSchemaAndMigrateData(db, simpleDbTransaction));\r\n }\r\n p = p.next(() => {\r\n createClientMetadataStore(db);\r\n });\r\n }\r\n if (fromVersion < 5 && toVersion >= 5) {\r\n p = p.next(() => this.removeAcknowledgedMutations(simpleDbTransaction));\r\n }\r\n if (fromVersion < 6 && toVersion >= 6) {\r\n p = p.next(() => {\r\n createDocumentGlobalStore(db);\r\n return this.addDocumentGlobal(simpleDbTransaction);\r\n });\r\n }\r\n if (fromVersion < 7 && toVersion >= 7) {\r\n p = p.next(() => this.ensureSequenceNumbers(simpleDbTransaction));\r\n }\r\n if (fromVersion < 8 && toVersion >= 8) {\r\n p = p.next(() => this.createCollectionParentIndex(db, simpleDbTransaction));\r\n }\r\n if (fromVersion < 9 && toVersion >= 9) {\r\n p = p.next(() => {\r\n // Multi-Tab used to manage its own changelog, but this has been moved\r\n // to the DbRemoteDocument object store itself. Since the previous change\r\n // log only contained transient data, we can drop its object store.\r\n dropRemoteDocumentChangesStore(db);\r\n createRemoteDocumentReadTimeIndex(txn);\r\n });\r\n }\r\n if (fromVersion < 10 && toVersion >= 10) {\r\n p = p.next(() => this.rewriteCanonicalIds(simpleDbTransaction));\r\n }\r\n if (fromVersion < 11 && toVersion >= 11) {\r\n p = p.next(() => {\r\n createBundlesStore(db);\r\n createNamedQueriesStore(db);\r\n });\r\n }\r\n return p;\r\n }\r\n addDocumentGlobal(txn) {\r\n let byteCount = 0;\r\n return txn\r\n .store(DbRemoteDocument.store)\r\n .iterate((_, doc) => {\r\n byteCount += dbDocumentSize(doc);\r\n })\r\n .next(() => {\r\n const metadata = new DbRemoteDocumentGlobal(byteCount);\r\n return txn\r\n .store(DbRemoteDocumentGlobal.store)\r\n .put(DbRemoteDocumentGlobal.key, metadata);\r\n });\r\n }\r\n removeAcknowledgedMutations(txn) {\r\n const queuesStore = txn.store(DbMutationQueue.store);\r\n const mutationsStore = txn.store(DbMutationBatch.store);\r\n return queuesStore.loadAll().next(queues => {\r\n return PersistencePromise.forEach(queues, (queue) => {\r\n const range = IDBKeyRange.bound([queue.userId, BATCHID_UNKNOWN], [queue.userId, queue.lastAcknowledgedBatchId]);\r\n return mutationsStore\r\n .loadAll(DbMutationBatch.userMutationsIndex, range)\r\n .next(dbBatches => {\r\n return PersistencePromise.forEach(dbBatches, (dbBatch) => {\r\n hardAssert(dbBatch.userId === queue.userId);\r\n const batch = fromDbMutationBatch(this.serializer, dbBatch);\r\n return removeMutationBatch(txn, queue.userId, batch).next(() => { });\r\n });\r\n });\r\n });\r\n });\r\n }\r\n /**\r\n * Ensures that every document in the remote document cache has a corresponding sentinel row\r\n * with a sequence number. Missing rows are given the most recently used sequence number.\r\n */\r\n ensureSequenceNumbers(txn) {\r\n const documentTargetStore = txn.store(DbTargetDocument.store);\r\n const documentsStore = txn.store(DbRemoteDocument.store);\r\n const globalTargetStore = txn.store(DbTargetGlobal.store);\r\n return globalTargetStore.get(DbTargetGlobal.key).next(metadata => {\r\n const writeSentinelKey = (path) => {\r\n return documentTargetStore.put(new DbTargetDocument(0, encodeResourcePath(path), metadata.highestListenSequenceNumber));\r\n };\r\n const promises = [];\r\n return documentsStore\r\n .iterate((key, doc) => {\r\n const path = new ResourcePath(key);\r\n const docSentinelKey = sentinelKey(path);\r\n promises.push(documentTargetStore.get(docSentinelKey).next(maybeSentinel => {\r\n if (!maybeSentinel) {\r\n return writeSentinelKey(path);\r\n }\r\n else {\r\n return PersistencePromise.resolve();\r\n }\r\n }));\r\n })\r\n .next(() => PersistencePromise.waitFor(promises));\r\n });\r\n }\r\n createCollectionParentIndex(db, txn) {\r\n // Create the index.\r\n db.createObjectStore(DbCollectionParent.store, {\r\n keyPath: DbCollectionParent.keyPath\r\n });\r\n const collectionParentsStore = txn.store(DbCollectionParent.store);\r\n // Helper to add an index entry iff we haven't already written it.\r\n const cache = new MemoryCollectionParentIndex();\r\n const addEntry = (collectionPath) => {\r\n if (cache.add(collectionPath)) {\r\n const collectionId = collectionPath.lastSegment();\r\n const parentPath = collectionPath.popLast();\r\n return collectionParentsStore.put({\r\n collectionId,\r\n parent: encodeResourcePath(parentPath)\r\n });\r\n }\r\n };\r\n // Index existing remote documents.\r\n return txn\r\n .store(DbRemoteDocument.store)\r\n .iterate({ keysOnly: true }, (pathSegments, _) => {\r\n const path = new ResourcePath(pathSegments);\r\n return addEntry(path.popLast());\r\n })\r\n .next(() => {\r\n // Index existing mutations.\r\n return txn\r\n .store(DbDocumentMutation.store)\r\n .iterate({ keysOnly: true }, ([userID, encodedPath, batchId], _) => {\r\n const path = decodeResourcePath(encodedPath);\r\n return addEntry(path.popLast());\r\n });\r\n });\r\n }\r\n rewriteCanonicalIds(txn) {\r\n const targetStore = txn.store(DbTarget.store);\r\n return targetStore.iterate((key, originalDbTarget) => {\r\n const originalTargetData = fromDbTarget(originalDbTarget);\r\n const updatedDbTarget = toDbTarget(this.serializer, originalTargetData);\r\n return targetStore.put(updatedDbTarget);\r\n });\r\n }\r\n}\r\nfunction sentinelKey(path) {\r\n return [0, encodeResourcePath(path)];\r\n}\r\nfunction createPrimaryClientStore(db) {\r\n db.createObjectStore(DbPrimaryClient.store);\r\n}\r\nfunction createMutationQueue(db) {\r\n db.createObjectStore(DbMutationQueue.store, {\r\n keyPath: DbMutationQueue.keyPath\r\n });\r\n const mutationBatchesStore = db.createObjectStore(DbMutationBatch.store, {\r\n keyPath: DbMutationBatch.keyPath,\r\n autoIncrement: true\r\n });\r\n mutationBatchesStore.createIndex(DbMutationBatch.userMutationsIndex, DbMutationBatch.userMutationsKeyPath, { unique: true });\r\n db.createObjectStore(DbDocumentMutation.store);\r\n}\r\n/**\r\n * Upgrade function to migrate the 'mutations' store from V1 to V3. Loads\r\n * and rewrites all data.\r\n */\r\nfunction upgradeMutationBatchSchemaAndMigrateData(db, txn) {\r\n const v1MutationsStore = txn.store(DbMutationBatch.store);\r\n return v1MutationsStore.loadAll().next(existingMutations => {\r\n db.deleteObjectStore(DbMutationBatch.store);\r\n const mutationsStore = db.createObjectStore(DbMutationBatch.store, {\r\n keyPath: DbMutationBatch.keyPath,\r\n autoIncrement: true\r\n });\r\n mutationsStore.createIndex(DbMutationBatch.userMutationsIndex, DbMutationBatch.userMutationsKeyPath, { unique: true });\r\n const v3MutationsStore = txn.store(DbMutationBatch.store);\r\n const writeAll = existingMutations.map(mutation => v3MutationsStore.put(mutation));\r\n return PersistencePromise.waitFor(writeAll);\r\n });\r\n}\r\nfunction createRemoteDocumentCache(db) {\r\n db.createObjectStore(DbRemoteDocument.store);\r\n}\r\nfunction createDocumentGlobalStore(db) {\r\n db.createObjectStore(DbRemoteDocumentGlobal.store);\r\n}\r\nfunction createQueryCache(db) {\r\n const targetDocumentsStore = db.createObjectStore(DbTargetDocument.store, {\r\n keyPath: DbTargetDocument.keyPath\r\n });\r\n targetDocumentsStore.createIndex(DbTargetDocument.documentTargetsIndex, DbTargetDocument.documentTargetsKeyPath, { unique: true });\r\n const targetStore = db.createObjectStore(DbTarget.store, {\r\n keyPath: DbTarget.keyPath\r\n });\r\n // NOTE: This is unique only because the TargetId is the suffix.\r\n targetStore.createIndex(DbTarget.queryTargetsIndexName, DbTarget.queryTargetsKeyPath, { unique: true });\r\n db.createObjectStore(DbTargetGlobal.store);\r\n}\r\nfunction dropQueryCache(db) {\r\n db.deleteObjectStore(DbTargetDocument.store);\r\n db.deleteObjectStore(DbTarget.store);\r\n db.deleteObjectStore(DbTargetGlobal.store);\r\n}\r\nfunction dropRemoteDocumentChangesStore(db) {\r\n if (db.objectStoreNames.contains('remoteDocumentChanges')) {\r\n db.deleteObjectStore('remoteDocumentChanges');\r\n }\r\n}\r\n/**\r\n * Creates the target global singleton row.\r\n *\r\n * @param txn - The version upgrade transaction for indexeddb\r\n */\r\nfunction writeEmptyTargetGlobalEntry(txn) {\r\n const globalStore = txn.store(DbTargetGlobal.store);\r\n const metadata = new DbTargetGlobal(\r\n /*highestTargetId=*/ 0, \r\n /*lastListenSequenceNumber=*/ 0, SnapshotVersion.min().toTimestamp(), \r\n /*targetCount=*/ 0);\r\n return globalStore.put(DbTargetGlobal.key, metadata);\r\n}\r\n/**\r\n * Creates indices on the RemoteDocuments store used for both multi-tab\r\n * and Index-Free queries.\r\n */\r\nfunction createRemoteDocumentReadTimeIndex(txn) {\r\n const remoteDocumentStore = txn.objectStore(DbRemoteDocument.store);\r\n remoteDocumentStore.createIndex(DbRemoteDocument.readTimeIndex, DbRemoteDocument.readTimeIndexPath, { unique: false });\r\n remoteDocumentStore.createIndex(DbRemoteDocument.collectionReadTimeIndex, DbRemoteDocument.collectionReadTimeIndexPath, { unique: false });\r\n}\r\nfunction createClientMetadataStore(db) {\r\n db.createObjectStore(DbClientMetadata.store, {\r\n keyPath: DbClientMetadata.keyPath\r\n });\r\n}\r\nfunction createBundlesStore(db) {\r\n db.createObjectStore(DbBundle.store, {\r\n keyPath: DbBundle.keyPath\r\n });\r\n}\r\nfunction createNamedQueriesStore(db) {\r\n db.createObjectStore(DbNamedQuery.store, {\r\n keyPath: DbNamedQuery.keyPath\r\n });\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst LOG_TAG$d = 'IndexedDbPersistence';\r\n/**\r\n * Oldest acceptable age in milliseconds for client metadata before the client\r\n * is considered inactive and its associated data is garbage collected.\r\n */\r\nconst MAX_CLIENT_AGE_MS = 30 * 60 * 1000; // 30 minutes\r\n/**\r\n * Oldest acceptable metadata age for clients that may participate in the\r\n * primary lease election. Clients that have not updated their client metadata\r\n * within 5 seconds are not eligible to receive a primary lease.\r\n */\r\nconst MAX_PRIMARY_ELIGIBLE_AGE_MS = 5000;\r\n/**\r\n * The interval at which clients will update their metadata, including\r\n * refreshing their primary lease if held or potentially trying to acquire it if\r\n * not held.\r\n *\r\n * Primary clients may opportunistically refresh their metadata earlier\r\n * if they're already performing an IndexedDB operation.\r\n */\r\nconst CLIENT_METADATA_REFRESH_INTERVAL_MS = 4000;\r\n/** User-facing error when the primary lease is required but not available. */\r\nconst PRIMARY_LEASE_EXCLUSIVE_ERROR_MSG = 'Failed to obtain exclusive access to the persistence layer. To allow ' +\r\n 'shared access, multi-tab synchronization has to be enabled in all tabs. ' +\r\n 'If you are using `experimentalForceOwningTab:true`, make sure that only ' +\r\n 'one tab has persistence enabled at any given time.';\r\nconst UNSUPPORTED_PLATFORM_ERROR_MSG = 'This platform is either missing IndexedDB or is known to have ' +\r\n 'an incomplete implementation. Offline persistence has been disabled.';\r\n// The format of the LocalStorage key that stores zombied client is:\r\n// firestore_zombie_<persistence_prefix>_<instance_key>\r\nconst ZOMBIED_CLIENTS_KEY_PREFIX = 'firestore_zombie';\r\n/**\r\n * The name of the main (and currently only) IndexedDB database. This name is\r\n * appended to the prefix provided to the IndexedDbPersistence constructor.\r\n */\r\nconst MAIN_DATABASE = 'main';\r\n/**\r\n * An IndexedDB-backed instance of Persistence. Data is stored persistently\r\n * across sessions.\r\n *\r\n * On Web only, the Firestore SDKs support shared access to its persistence\r\n * layer. This allows multiple browser tabs to read and write to IndexedDb and\r\n * to synchronize state even without network connectivity. Shared access is\r\n * currently optional and not enabled unless all clients invoke\r\n * `enablePersistence()` with `{synchronizeTabs:true}`.\r\n *\r\n * In multi-tab mode, if multiple clients are active at the same time, the SDK\r\n * will designate one client as the “primary client”. An effort is made to pick\r\n * a visible, network-connected and active client, and this client is\r\n * responsible for letting other clients know about its presence. The primary\r\n * client writes a unique client-generated identifier (the client ID) to\r\n * IndexedDb’s “owner” store every 4 seconds. If the primary client fails to\r\n * update this entry, another client can acquire the lease and take over as\r\n * primary.\r\n *\r\n * Some persistence operations in the SDK are designated as primary-client only\r\n * operations. This includes the acknowledgment of mutations and all updates of\r\n * remote documents. The effects of these operations are written to persistence\r\n * and then broadcast to other tabs via LocalStorage (see\r\n * `WebStorageSharedClientState`), which then refresh their state from\r\n * persistence.\r\n *\r\n * Similarly, the primary client listens to notifications sent by secondary\r\n * clients to discover persistence changes written by secondary clients, such as\r\n * the addition of new mutations and query targets.\r\n *\r\n * If multi-tab is not enabled and another tab already obtained the primary\r\n * lease, IndexedDbPersistence enters a failed state and all subsequent\r\n * operations will automatically fail.\r\n *\r\n * Additionally, there is an optimization so that when a tab is closed, the\r\n * primary lease is released immediately (this is especially important to make\r\n * sure that a refreshed tab is able to immediately re-acquire the primary\r\n * lease). Unfortunately, IndexedDB cannot be reliably used in window.unload\r\n * since it is an asynchronous API. So in addition to attempting to give up the\r\n * lease, the leaseholder writes its client ID to a \"zombiedClient\" entry in\r\n * LocalStorage which acts as an indicator that another tab should go ahead and\r\n * take the primary lease immediately regardless of the current lease timestamp.\r\n *\r\n * TODO(b/114226234): Remove `synchronizeTabs` section when multi-tab is no\r\n * longer optional.\r\n */\r\nclass IndexedDbPersistence {\r\n constructor(\r\n /**\r\n * Whether to synchronize the in-memory state of multiple tabs and share\r\n * access to local persistence.\r\n */\r\n allowTabSynchronization, persistenceKey, clientId, lruParams, queue, window, document, serializer, sequenceNumberSyncer, \r\n /**\r\n * If set to true, forcefully obtains database access. Existing tabs will\r\n * no longer be able to access IndexedDB.\r\n */\r\n forceOwningTab) {\r\n this.allowTabSynchronization = allowTabSynchronization;\r\n this.persistenceKey = persistenceKey;\r\n this.clientId = clientId;\r\n this.queue = queue;\r\n this.window = window;\r\n this.document = document;\r\n this.sequenceNumberSyncer = sequenceNumberSyncer;\r\n this.forceOwningTab = forceOwningTab;\r\n this.listenSequence = null;\r\n this._started = false;\r\n this.isPrimary = false;\r\n this.networkEnabled = true;\r\n /** Our window.unload handler, if registered. */\r\n this.windowUnloadHandler = null;\r\n this.inForeground = false;\r\n /** Our 'visibilitychange' listener if registered. */\r\n this.documentVisibilityHandler = null;\r\n /** The client metadata refresh task. */\r\n this.clientMetadataRefresher = null;\r\n /** The last time we garbage collected the client metadata object store. */\r\n this.lastGarbageCollectionTime = Number.NEGATIVE_INFINITY;\r\n /** A listener to notify on primary state changes. */\r\n this.primaryStateListener = _ => Promise.resolve();\r\n if (!IndexedDbPersistence.isAvailable()) {\r\n throw new FirestoreError(Code.UNIMPLEMENTED, UNSUPPORTED_PLATFORM_ERROR_MSG);\r\n }\r\n this.referenceDelegate = new IndexedDbLruDelegateImpl(this, lruParams);\r\n this.dbName = persistenceKey + MAIN_DATABASE;\r\n this.serializer = new LocalSerializer(serializer);\r\n this.simpleDb = new SimpleDb(this.dbName, SCHEMA_VERSION, new SchemaConverter(this.serializer));\r\n this.targetCache = new IndexedDbTargetCache(this.referenceDelegate, this.serializer);\r\n this.indexManager = new IndexedDbIndexManager();\r\n this.remoteDocumentCache = newIndexedDbRemoteDocumentCache(this.serializer, this.indexManager);\r\n this.bundleCache = new IndexedDbBundleCache();\r\n if (this.window && this.window.localStorage) {\r\n this.webStorage = this.window.localStorage;\r\n }\r\n else {\r\n this.webStorage = null;\r\n if (forceOwningTab === false) {\r\n logError(LOG_TAG$d, 'LocalStorage is unavailable. As a result, persistence may not work ' +\r\n 'reliably. In particular enablePersistence() could fail immediately ' +\r\n 'after refreshing the page.');\r\n }\r\n }\r\n }\r\n /**\r\n * Attempt to start IndexedDb persistence.\r\n *\r\n * @returns Whether persistence was enabled.\r\n */\r\n start() {\r\n // NOTE: This is expected to fail sometimes (in the case of another tab\r\n // already having the persistence lock), so it's the first thing we should\r\n // do.\r\n return this.updateClientMetadataAndTryBecomePrimary()\r\n .then(() => {\r\n if (!this.isPrimary && !this.allowTabSynchronization) {\r\n // Fail `start()` if `synchronizeTabs` is disabled and we cannot\r\n // obtain the primary lease.\r\n throw new FirestoreError(Code.FAILED_PRECONDITION, PRIMARY_LEASE_EXCLUSIVE_ERROR_MSG);\r\n }\r\n this.attachVisibilityHandler();\r\n this.attachWindowUnloadHook();\r\n this.scheduleClientMetadataAndPrimaryLeaseRefreshes();\r\n return this.runTransaction('getHighestListenSequenceNumber', 'readonly', txn => this.targetCache.getHighestSequenceNumber(txn));\r\n })\r\n .then(highestListenSequenceNumber => {\r\n this.listenSequence = new ListenSequence(highestListenSequenceNumber, this.sequenceNumberSyncer);\r\n })\r\n .then(() => {\r\n this._started = true;\r\n })\r\n .catch(reason => {\r\n this.simpleDb && this.simpleDb.close();\r\n return Promise.reject(reason);\r\n });\r\n }\r\n /**\r\n * Registers a listener that gets called when the primary state of the\r\n * instance changes. Upon registering, this listener is invoked immediately\r\n * with the current primary state.\r\n *\r\n * PORTING NOTE: This is only used for Web multi-tab.\r\n */\r\n setPrimaryStateListener(primaryStateListener) {\r\n this.primaryStateListener = async (primaryState) => {\r\n if (this.started) {\r\n return primaryStateListener(primaryState);\r\n }\r\n };\r\n return primaryStateListener(this.isPrimary);\r\n }\r\n /**\r\n * Registers a listener that gets called when the database receives a\r\n * version change event indicating that it has deleted.\r\n *\r\n * PORTING NOTE: This is only used for Web multi-tab.\r\n */\r\n setDatabaseDeletedListener(databaseDeletedListener) {\r\n this.simpleDb.setVersionChangeListener(async (event) => {\r\n // Check if an attempt is made to delete IndexedDB.\r\n if (event.newVersion === null) {\r\n await databaseDeletedListener();\r\n }\r\n });\r\n }\r\n /**\r\n * Adjusts the current network state in the client's metadata, potentially\r\n * affecting the primary lease.\r\n *\r\n * PORTING NOTE: This is only used for Web multi-tab.\r\n */\r\n setNetworkEnabled(networkEnabled) {\r\n if (this.networkEnabled !== networkEnabled) {\r\n this.networkEnabled = networkEnabled;\r\n // Schedule a primary lease refresh for immediate execution. The eventual\r\n // lease update will be propagated via `primaryStateListener`.\r\n this.queue.enqueueAndForget(async () => {\r\n if (this.started) {\r\n await this.updateClientMetadataAndTryBecomePrimary();\r\n }\r\n });\r\n }\r\n }\r\n /**\r\n * Updates the client metadata in IndexedDb and attempts to either obtain or\r\n * extend the primary lease for the local client. Asynchronously notifies the\r\n * primary state listener if the client either newly obtained or released its\r\n * primary lease.\r\n */\r\n updateClientMetadataAndTryBecomePrimary() {\r\n return this.runTransaction('updateClientMetadataAndTryBecomePrimary', 'readwrite', txn => {\r\n const metadataStore = clientMetadataStore(txn);\r\n return metadataStore\r\n .put(new DbClientMetadata(this.clientId, Date.now(), this.networkEnabled, this.inForeground))\r\n .next(() => {\r\n if (this.isPrimary) {\r\n return this.verifyPrimaryLease(txn).next(success => {\r\n if (!success) {\r\n this.isPrimary = false;\r\n this.queue.enqueueRetryable(() => this.primaryStateListener(false));\r\n }\r\n });\r\n }\r\n })\r\n .next(() => this.canActAsPrimary(txn))\r\n .next(canActAsPrimary => {\r\n if (this.isPrimary && !canActAsPrimary) {\r\n return this.releasePrimaryLeaseIfHeld(txn).next(() => false);\r\n }\r\n else if (canActAsPrimary) {\r\n return this.acquireOrExtendPrimaryLease(txn).next(() => true);\r\n }\r\n else {\r\n return /* canActAsPrimary= */ false;\r\n }\r\n });\r\n })\r\n .catch(e => {\r\n if (isIndexedDbTransactionError(e)) {\r\n logDebug(LOG_TAG$d, 'Failed to extend owner lease: ', e);\r\n // Proceed with the existing state. Any subsequent access to\r\n // IndexedDB will verify the lease.\r\n return this.isPrimary;\r\n }\r\n if (!this.allowTabSynchronization) {\r\n throw e;\r\n }\r\n logDebug(LOG_TAG$d, 'Releasing owner lease after error during lease refresh', e);\r\n return /* isPrimary= */ false;\r\n })\r\n .then(isPrimary => {\r\n if (this.isPrimary !== isPrimary) {\r\n this.queue.enqueueRetryable(() => this.primaryStateListener(isPrimary));\r\n }\r\n this.isPrimary = isPrimary;\r\n });\r\n }\r\n verifyPrimaryLease(txn) {\r\n const store = primaryClientStore(txn);\r\n return store.get(DbPrimaryClient.key).next(primaryClient => {\r\n return PersistencePromise.resolve(this.isLocalClient(primaryClient));\r\n });\r\n }\r\n removeClientMetadata(txn) {\r\n const metadataStore = clientMetadataStore(txn);\r\n return metadataStore.delete(this.clientId);\r\n }\r\n /**\r\n * If the garbage collection threshold has passed, prunes the\r\n * RemoteDocumentChanges and the ClientMetadata store based on the last update\r\n * time of all clients.\r\n */\r\n async maybeGarbageCollectMultiClientState() {\r\n if (this.isPrimary &&\r\n !this.isWithinAge(this.lastGarbageCollectionTime, MAX_CLIENT_AGE_MS)) {\r\n this.lastGarbageCollectionTime = Date.now();\r\n const inactiveClients = await this.runTransaction('maybeGarbageCollectMultiClientState', 'readwrite-primary', txn => {\r\n const metadataStore = getStore(txn, DbClientMetadata.store);\r\n return metadataStore.loadAll().next(existingClients => {\r\n const active = this.filterActiveClients(existingClients, MAX_CLIENT_AGE_MS);\r\n const inactive = existingClients.filter(client => active.indexOf(client) === -1);\r\n // Delete metadata for clients that are no longer considered active.\r\n return PersistencePromise.forEach(inactive, (inactiveClient) => metadataStore.delete(inactiveClient.clientId)).next(() => inactive);\r\n });\r\n }).catch(() => {\r\n // Ignore primary lease violations or any other type of error. The next\r\n // primary will run `maybeGarbageCollectMultiClientState()` again.\r\n // We don't use `ignoreIfPrimaryLeaseLoss()` since we don't want to depend\r\n // on LocalStore.\r\n return [];\r\n });\r\n // Delete potential leftover entries that may continue to mark the\r\n // inactive clients as zombied in LocalStorage.\r\n // Ideally we'd delete the IndexedDb and LocalStorage zombie entries for\r\n // the client atomically, but we can't. So we opt to delete the IndexedDb\r\n // entries first to avoid potentially reviving a zombied client.\r\n if (this.webStorage) {\r\n for (const inactiveClient of inactiveClients) {\r\n this.webStorage.removeItem(this.zombiedClientLocalStorageKey(inactiveClient.clientId));\r\n }\r\n }\r\n }\r\n }\r\n /**\r\n * Schedules a recurring timer to update the client metadata and to either\r\n * extend or acquire the primary lease if the client is eligible.\r\n */\r\n scheduleClientMetadataAndPrimaryLeaseRefreshes() {\r\n this.clientMetadataRefresher = this.queue.enqueueAfterDelay(\"client_metadata_refresh\" /* ClientMetadataRefresh */, CLIENT_METADATA_REFRESH_INTERVAL_MS, () => {\r\n return this.updateClientMetadataAndTryBecomePrimary()\r\n .then(() => this.maybeGarbageCollectMultiClientState())\r\n .then(() => this.scheduleClientMetadataAndPrimaryLeaseRefreshes());\r\n });\r\n }\r\n /** Checks whether `client` is the local client. */\r\n isLocalClient(client) {\r\n return client ? client.ownerId === this.clientId : false;\r\n }\r\n /**\r\n * Evaluate the state of all active clients and determine whether the local\r\n * client is or can act as the holder of the primary lease. Returns whether\r\n * the client is eligible for the lease, but does not actually acquire it.\r\n * May return 'false' even if there is no active leaseholder and another\r\n * (foreground) client should become leaseholder instead.\r\n */\r\n canActAsPrimary(txn) {\r\n if (this.forceOwningTab) {\r\n return PersistencePromise.resolve(true);\r\n }\r\n const store = primaryClientStore(txn);\r\n return store\r\n .get(DbPrimaryClient.key)\r\n .next(currentPrimary => {\r\n const currentLeaseIsValid = currentPrimary !== null &&\r\n this.isWithinAge(currentPrimary.leaseTimestampMs, MAX_PRIMARY_ELIGIBLE_AGE_MS) &&\r\n !this.isClientZombied(currentPrimary.ownerId);\r\n // A client is eligible for the primary lease if:\r\n // - its network is enabled and the client's tab is in the foreground.\r\n // - its network is enabled and no other client's tab is in the\r\n // foreground.\r\n // - every clients network is disabled and the client's tab is in the\r\n // foreground.\r\n // - every clients network is disabled and no other client's tab is in\r\n // the foreground.\r\n // - the `forceOwningTab` setting was passed in.\r\n if (currentLeaseIsValid) {\r\n if (this.isLocalClient(currentPrimary) && this.networkEnabled) {\r\n return true;\r\n }\r\n if (!this.isLocalClient(currentPrimary)) {\r\n if (!currentPrimary.allowTabSynchronization) {\r\n // Fail the `canActAsPrimary` check if the current leaseholder has\r\n // not opted into multi-tab synchronization. If this happens at\r\n // client startup, we reject the Promise returned by\r\n // `enablePersistence()` and the user can continue to use Firestore\r\n // with in-memory persistence.\r\n // If this fails during a lease refresh, we will instead block the\r\n // AsyncQueue from executing further operations. Note that this is\r\n // acceptable since mixing & matching different `synchronizeTabs`\r\n // settings is not supported.\r\n //\r\n // TODO(b/114226234): Remove this check when `synchronizeTabs` can\r\n // no longer be turned off.\r\n throw new FirestoreError(Code.FAILED_PRECONDITION, PRIMARY_LEASE_EXCLUSIVE_ERROR_MSG);\r\n }\r\n return false;\r\n }\r\n }\r\n if (this.networkEnabled && this.inForeground) {\r\n return true;\r\n }\r\n return clientMetadataStore(txn)\r\n .loadAll()\r\n .next(existingClients => {\r\n // Process all existing clients and determine whether at least one of\r\n // them is better suited to obtain the primary lease.\r\n const preferredCandidate = this.filterActiveClients(existingClients, MAX_PRIMARY_ELIGIBLE_AGE_MS).find(otherClient => {\r\n if (this.clientId !== otherClient.clientId) {\r\n const otherClientHasBetterNetworkState = !this.networkEnabled && otherClient.networkEnabled;\r\n const otherClientHasBetterVisibility = !this.inForeground && otherClient.inForeground;\r\n const otherClientHasSameNetworkState = this.networkEnabled === otherClient.networkEnabled;\r\n if (otherClientHasBetterNetworkState ||\r\n (otherClientHasBetterVisibility &&\r\n otherClientHasSameNetworkState)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n });\r\n return preferredCandidate === undefined;\r\n });\r\n })\r\n .next(canActAsPrimary => {\r\n if (this.isPrimary !== canActAsPrimary) {\r\n logDebug(LOG_TAG$d, `Client ${canActAsPrimary ? 'is' : 'is not'} eligible for a primary lease.`);\r\n }\r\n return canActAsPrimary;\r\n });\r\n }\r\n async shutdown() {\r\n // The shutdown() operations are idempotent and can be called even when\r\n // start() aborted (e.g. because it couldn't acquire the persistence lease).\r\n this._started = false;\r\n this.markClientZombied();\r\n if (this.clientMetadataRefresher) {\r\n this.clientMetadataRefresher.cancel();\r\n this.clientMetadataRefresher = null;\r\n }\r\n this.detachVisibilityHandler();\r\n this.detachWindowUnloadHook();\r\n // Use `SimpleDb.runTransaction` directly to avoid failing if another tab\r\n // has obtained the primary lease.\r\n await this.simpleDb.runTransaction('shutdown', 'readwrite', [DbPrimaryClient.store, DbClientMetadata.store], simpleDbTxn => {\r\n const persistenceTransaction = new IndexedDbTransaction(simpleDbTxn, ListenSequence.INVALID);\r\n return this.releasePrimaryLeaseIfHeld(persistenceTransaction).next(() => this.removeClientMetadata(persistenceTransaction));\r\n });\r\n this.simpleDb.close();\r\n // Remove the entry marking the client as zombied from LocalStorage since\r\n // we successfully deleted its metadata from IndexedDb.\r\n this.removeClientZombiedEntry();\r\n }\r\n /**\r\n * Returns clients that are not zombied and have an updateTime within the\r\n * provided threshold.\r\n */\r\n filterActiveClients(clients, activityThresholdMs) {\r\n return clients.filter(client => this.isWithinAge(client.updateTimeMs, activityThresholdMs) &&\r\n !this.isClientZombied(client.clientId));\r\n }\r\n /**\r\n * Returns the IDs of the clients that are currently active. If multi-tab\r\n * is not supported, returns an array that only contains the local client's\r\n * ID.\r\n *\r\n * PORTING NOTE: This is only used for Web multi-tab.\r\n */\r\n getActiveClients() {\r\n return this.runTransaction('getActiveClients', 'readonly', txn => {\r\n return clientMetadataStore(txn)\r\n .loadAll()\r\n .next(clients => this.filterActiveClients(clients, MAX_CLIENT_AGE_MS).map(clientMetadata => clientMetadata.clientId));\r\n });\r\n }\r\n get started() {\r\n return this._started;\r\n }\r\n getMutationQueue(user) {\r\n return IndexedDbMutationQueue.forUser(user, this.serializer, this.indexManager, this.referenceDelegate);\r\n }\r\n getTargetCache() {\r\n return this.targetCache;\r\n }\r\n getRemoteDocumentCache() {\r\n return this.remoteDocumentCache;\r\n }\r\n getIndexManager() {\r\n return this.indexManager;\r\n }\r\n getBundleCache() {\r\n return this.bundleCache;\r\n }\r\n runTransaction(action, mode, transactionOperation) {\r\n logDebug(LOG_TAG$d, 'Starting transaction:', action);\r\n const simpleDbMode = mode === 'readonly' ? 'readonly' : 'readwrite';\r\n let persistenceTransaction;\r\n // Do all transactions as readwrite against all object stores, since we\r\n // are the only reader/writer.\r\n return this.simpleDb\r\n .runTransaction(action, simpleDbMode, ALL_STORES, simpleDbTxn => {\r\n persistenceTransaction = new IndexedDbTransaction(simpleDbTxn, this.listenSequence\r\n ? this.listenSequence.next()\r\n : ListenSequence.INVALID);\r\n if (mode === 'readwrite-primary') {\r\n // While we merely verify that we have (or can acquire) the lease\r\n // immediately, we wait to extend the primary lease until after\r\n // executing transactionOperation(). This ensures that even if the\r\n // transactionOperation takes a long time, we'll use a recent\r\n // leaseTimestampMs in the extended (or newly acquired) lease.\r\n return this.verifyPrimaryLease(persistenceTransaction)\r\n .next(holdsPrimaryLease => {\r\n if (holdsPrimaryLease) {\r\n return /* holdsPrimaryLease= */ true;\r\n }\r\n return this.canActAsPrimary(persistenceTransaction);\r\n })\r\n .next(holdsPrimaryLease => {\r\n if (!holdsPrimaryLease) {\r\n logError(`Failed to obtain primary lease for action '${action}'.`);\r\n this.isPrimary = false;\r\n this.queue.enqueueRetryable(() => this.primaryStateListener(false));\r\n throw new FirestoreError(Code.FAILED_PRECONDITION, PRIMARY_LEASE_LOST_ERROR_MSG);\r\n }\r\n return transactionOperation(persistenceTransaction);\r\n })\r\n .next(result => {\r\n return this.acquireOrExtendPrimaryLease(persistenceTransaction).next(() => result);\r\n });\r\n }\r\n else {\r\n return this.verifyAllowTabSynchronization(persistenceTransaction).next(() => transactionOperation(persistenceTransaction));\r\n }\r\n })\r\n .then(result => {\r\n persistenceTransaction.raiseOnCommittedEvent();\r\n return result;\r\n });\r\n }\r\n /**\r\n * Verifies that the current tab is the primary leaseholder or alternatively\r\n * that the leaseholder has opted into multi-tab synchronization.\r\n */\r\n // TODO(b/114226234): Remove this check when `synchronizeTabs` can no longer\r\n // be turned off.\r\n verifyAllowTabSynchronization(txn) {\r\n const store = primaryClientStore(txn);\r\n return store.get(DbPrimaryClient.key).next(currentPrimary => {\r\n const currentLeaseIsValid = currentPrimary !== null &&\r\n this.isWithinAge(currentPrimary.leaseTimestampMs, MAX_PRIMARY_ELIGIBLE_AGE_MS) &&\r\n !this.isClientZombied(currentPrimary.ownerId);\r\n if (currentLeaseIsValid && !this.isLocalClient(currentPrimary)) {\r\n if (!this.forceOwningTab &&\r\n (!this.allowTabSynchronization ||\r\n !currentPrimary.allowTabSynchronization)) {\r\n throw new FirestoreError(Code.FAILED_PRECONDITION, PRIMARY_LEASE_EXCLUSIVE_ERROR_MSG);\r\n }\r\n }\r\n });\r\n }\r\n /**\r\n * Obtains or extends the new primary lease for the local client. This\r\n * method does not verify that the client is eligible for this lease.\r\n */\r\n acquireOrExtendPrimaryLease(txn) {\r\n const newPrimary = new DbPrimaryClient(this.clientId, this.allowTabSynchronization, Date.now());\r\n return primaryClientStore(txn).put(DbPrimaryClient.key, newPrimary);\r\n }\r\n static isAvailable() {\r\n return SimpleDb.isAvailable();\r\n }\r\n /** Checks the primary lease and removes it if we are the current primary. */\r\n releasePrimaryLeaseIfHeld(txn) {\r\n const store = primaryClientStore(txn);\r\n return store.get(DbPrimaryClient.key).next(primaryClient => {\r\n if (this.isLocalClient(primaryClient)) {\r\n logDebug(LOG_TAG$d, 'Releasing primary lease.');\r\n return store.delete(DbPrimaryClient.key);\r\n }\r\n else {\r\n return PersistencePromise.resolve();\r\n }\r\n });\r\n }\r\n /** Verifies that `updateTimeMs` is within `maxAgeMs`. */\r\n isWithinAge(updateTimeMs, maxAgeMs) {\r\n const now = Date.now();\r\n const minAcceptable = now - maxAgeMs;\r\n const maxAcceptable = now;\r\n if (updateTimeMs < minAcceptable) {\r\n return false;\r\n }\r\n else if (updateTimeMs > maxAcceptable) {\r\n logError(`Detected an update time that is in the future: ${updateTimeMs} > ${maxAcceptable}`);\r\n return false;\r\n }\r\n return true;\r\n }\r\n attachVisibilityHandler() {\r\n if (this.document !== null &&\r\n typeof this.document.addEventListener === 'function') {\r\n this.documentVisibilityHandler = () => {\r\n this.queue.enqueueAndForget(() => {\r\n this.inForeground = this.document.visibilityState === 'visible';\r\n return this.updateClientMetadataAndTryBecomePrimary();\r\n });\r\n };\r\n this.document.addEventListener('visibilitychange', this.documentVisibilityHandler);\r\n this.inForeground = this.document.visibilityState === 'visible';\r\n }\r\n }\r\n detachVisibilityHandler() {\r\n if (this.documentVisibilityHandler) {\r\n this.document.removeEventListener('visibilitychange', this.documentVisibilityHandler);\r\n this.documentVisibilityHandler = null;\r\n }\r\n }\r\n /**\r\n * Attaches a window.unload handler that will synchronously write our\r\n * clientId to a \"zombie client id\" location in LocalStorage. This can be used\r\n * by tabs trying to acquire the primary lease to determine that the lease\r\n * is no longer valid even if the timestamp is recent. This is particularly\r\n * important for the refresh case (so the tab correctly re-acquires the\r\n * primary lease). LocalStorage is used for this rather than IndexedDb because\r\n * it is a synchronous API and so can be used reliably from an unload\r\n * handler.\r\n */\r\n attachWindowUnloadHook() {\r\n var _a;\r\n if (typeof ((_a = this.window) === null || _a === void 0 ? void 0 : _a.addEventListener) === 'function') {\r\n this.windowUnloadHandler = () => {\r\n // Note: In theory, this should be scheduled on the AsyncQueue since it\r\n // accesses internal state. We execute this code directly during shutdown\r\n // to make sure it gets a chance to run.\r\n this.markClientZombied();\r\n if (isSafari() && navigator.appVersion.match(`Version/14`)) {\r\n // On Safari 14, we do not run any cleanup actions as it might trigger\r\n // a bug that prevents Safari from re-opening IndexedDB during the\r\n // next page load.\r\n // See https://bugs.webkit.org/show_bug.cgi?id=226547\r\n this.queue.enterRestrictedMode(/* purgeExistingTasks= */ true);\r\n }\r\n this.queue.enqueueAndForget(() => {\r\n // Attempt graceful shutdown (including releasing our primary lease),\r\n // but there's no guarantee it will complete.\r\n return this.shutdown();\r\n });\r\n };\r\n this.window.addEventListener('pagehide', this.windowUnloadHandler);\r\n }\r\n }\r\n detachWindowUnloadHook() {\r\n if (this.windowUnloadHandler) {\r\n this.window.removeEventListener('pagehide', this.windowUnloadHandler);\r\n this.windowUnloadHandler = null;\r\n }\r\n }\r\n /**\r\n * Returns whether a client is \"zombied\" based on its LocalStorage entry.\r\n * Clients become zombied when their tab closes without running all of the\r\n * cleanup logic in `shutdown()`.\r\n */\r\n isClientZombied(clientId) {\r\n var _a;\r\n try {\r\n const isZombied = ((_a = this.webStorage) === null || _a === void 0 ? void 0 : _a.getItem(this.zombiedClientLocalStorageKey(clientId))) !== null;\r\n logDebug(LOG_TAG$d, `Client '${clientId}' ${isZombied ? 'is' : 'is not'} zombied in LocalStorage`);\r\n return isZombied;\r\n }\r\n catch (e) {\r\n // Gracefully handle if LocalStorage isn't working.\r\n logError(LOG_TAG$d, 'Failed to get zombied client id.', e);\r\n return false;\r\n }\r\n }\r\n /**\r\n * Record client as zombied (a client that had its tab closed). Zombied\r\n * clients are ignored during primary tab selection.\r\n */\r\n markClientZombied() {\r\n if (!this.webStorage) {\r\n return;\r\n }\r\n try {\r\n this.webStorage.setItem(this.zombiedClientLocalStorageKey(this.clientId), String(Date.now()));\r\n }\r\n catch (e) {\r\n // Gracefully handle if LocalStorage isn't available / working.\r\n logError('Failed to set zombie client id.', e);\r\n }\r\n }\r\n /** Removes the zombied client entry if it exists. */\r\n removeClientZombiedEntry() {\r\n if (!this.webStorage) {\r\n return;\r\n }\r\n try {\r\n this.webStorage.removeItem(this.zombiedClientLocalStorageKey(this.clientId));\r\n }\r\n catch (e) {\r\n // Ignore\r\n }\r\n }\r\n zombiedClientLocalStorageKey(clientId) {\r\n return `${ZOMBIED_CLIENTS_KEY_PREFIX}_${this.persistenceKey}_${clientId}`;\r\n }\r\n}\r\n/**\r\n * Helper to get a typed SimpleDbStore for the primary client object store.\r\n */\r\nfunction primaryClientStore(txn) {\r\n return getStore(txn, DbPrimaryClient.store);\r\n}\r\n/**\r\n * Helper to get a typed SimpleDbStore for the client metadata object store.\r\n */\r\nfunction clientMetadataStore(txn) {\r\n return getStore(txn, DbClientMetadata.store);\r\n}\r\n/**\r\n * Generates a string used as a prefix when storing data in IndexedDB and\r\n * LocalStorage.\r\n */\r\nfunction indexedDbStoragePrefix(databaseId, persistenceKey) {\r\n // Use two different prefix formats:\r\n //\r\n // * firestore / persistenceKey / projectID . databaseID / ...\r\n // * firestore / persistenceKey / projectID / ...\r\n //\r\n // projectIDs are DNS-compatible names and cannot contain dots\r\n // so there's no danger of collisions.\r\n let database = databaseId.projectId;\r\n if (!databaseId.isDefaultDatabase) {\r\n database += '.' + databaseId.database;\r\n }\r\n return 'firestore/' + persistenceKey + '/' + database + '/';\r\n}\r\nasync function indexedDbClearPersistence(persistenceKey) {\r\n if (!SimpleDb.isAvailable()) {\r\n return Promise.resolve();\r\n }\r\n const dbName = persistenceKey + MAIN_DATABASE;\r\n await SimpleDb.delete(dbName);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A readonly view of the local state of all documents we're tracking (i.e. we\r\n * have a cached version in remoteDocumentCache or local mutations for the\r\n * document). The view is computed by applying the mutations in the\r\n * MutationQueue to the RemoteDocumentCache.\r\n */\r\nclass LocalDocumentsView {\r\n constructor(remoteDocumentCache, mutationQueue, indexManager) {\r\n this.remoteDocumentCache = remoteDocumentCache;\r\n this.mutationQueue = mutationQueue;\r\n this.indexManager = indexManager;\r\n }\r\n /**\r\n * Get the local view of the document identified by `key`.\r\n *\r\n * @returns Local view of the document or null if we don't have any cached\r\n * state for it.\r\n */\r\n getDocument(transaction, key) {\r\n return this.mutationQueue\r\n .getAllMutationBatchesAffectingDocumentKey(transaction, key)\r\n .next(batches => this.getDocumentInternal(transaction, key, batches));\r\n }\r\n /** Internal version of `getDocument` that allows reusing batches. */\r\n getDocumentInternal(transaction, key, inBatches) {\r\n return this.remoteDocumentCache.getEntry(transaction, key).next(doc => {\r\n for (const batch of inBatches) {\r\n batch.applyToLocalView(doc);\r\n }\r\n return doc;\r\n });\r\n }\r\n // Returns the view of the given `docs` as they would appear after applying\r\n // all mutations in the given `batches`.\r\n applyLocalMutationsToDocuments(docs, batches) {\r\n docs.forEach((key, localView) => {\r\n for (const batch of batches) {\r\n batch.applyToLocalView(localView);\r\n }\r\n });\r\n }\r\n /**\r\n * Gets the local view of the documents identified by `keys`.\r\n *\r\n * If we don't have cached state for a document in `keys`, a NoDocument will\r\n * be stored for that key in the resulting set.\r\n */\r\n getDocuments(transaction, keys) {\r\n return this.remoteDocumentCache\r\n .getEntries(transaction, keys)\r\n .next(docs => this.applyLocalViewToDocuments(transaction, docs).next(() => docs));\r\n }\r\n /**\r\n * Applies the local view the given `baseDocs` without retrieving documents\r\n * from the local store.\r\n */\r\n applyLocalViewToDocuments(transaction, baseDocs) {\r\n return this.mutationQueue\r\n .getAllMutationBatchesAffectingDocumentKeys(transaction, baseDocs)\r\n .next(batches => this.applyLocalMutationsToDocuments(baseDocs, batches));\r\n }\r\n /**\r\n * Performs a query against the local view of all documents.\r\n *\r\n * @param transaction - The persistence transaction.\r\n * @param query - The query to match documents against.\r\n * @param sinceReadTime - If not set to SnapshotVersion.min(), return only\r\n * documents that have been read since this snapshot version (exclusive).\r\n */\r\n getDocumentsMatchingQuery(transaction, query, sinceReadTime) {\r\n if (isDocumentQuery$1(query)) {\r\n return this.getDocumentsMatchingDocumentQuery(transaction, query.path);\r\n }\r\n else if (isCollectionGroupQuery(query)) {\r\n return this.getDocumentsMatchingCollectionGroupQuery(transaction, query, sinceReadTime);\r\n }\r\n else {\r\n return this.getDocumentsMatchingCollectionQuery(transaction, query, sinceReadTime);\r\n }\r\n }\r\n getDocumentsMatchingDocumentQuery(transaction, docPath) {\r\n // Just do a simple document lookup.\r\n return this.getDocument(transaction, new DocumentKey(docPath)).next(document => {\r\n let result = documentMap();\r\n if (document.isFoundDocument()) {\r\n result = result.insert(document.key, document);\r\n }\r\n return result;\r\n });\r\n }\r\n getDocumentsMatchingCollectionGroupQuery(transaction, query, sinceReadTime) {\r\n const collectionId = query.collectionGroup;\r\n let results = documentMap();\r\n return this.indexManager\r\n .getCollectionParents(transaction, collectionId)\r\n .next(parents => {\r\n // Perform a collection query against each parent that contains the\r\n // collectionId and aggregate the results.\r\n return PersistencePromise.forEach(parents, (parent) => {\r\n const collectionQuery = asCollectionQueryAtPath(query, parent.child(collectionId));\r\n return this.getDocumentsMatchingCollectionQuery(transaction, collectionQuery, sinceReadTime).next(r => {\r\n r.forEach((key, doc) => {\r\n results = results.insert(key, doc);\r\n });\r\n });\r\n }).next(() => results);\r\n });\r\n }\r\n getDocumentsMatchingCollectionQuery(transaction, query, sinceReadTime) {\r\n // Query the remote documents and overlay mutations.\r\n let results;\r\n let mutationBatches;\r\n return this.remoteDocumentCache\r\n .getDocumentsMatchingQuery(transaction, query, sinceReadTime)\r\n .next(queryResults => {\r\n results = queryResults;\r\n return this.mutationQueue.getAllMutationBatchesAffectingQuery(transaction, query);\r\n })\r\n .next(matchingMutationBatches => {\r\n mutationBatches = matchingMutationBatches;\r\n // It is possible that a PatchMutation can make a document match a query, even if\r\n // the version in the RemoteDocumentCache is not a match yet (waiting for server\r\n // to ack). To handle this, we find all document keys affected by the PatchMutations\r\n // that are not in `result` yet, and back fill them via `remoteDocumentCache.getEntries`,\r\n // otherwise those `PatchMutations` will be ignored because no base document can be found,\r\n // and lead to missing result for the query.\r\n return this.addMissingBaseDocuments(transaction, mutationBatches, results).next(mergedDocuments => {\r\n results = mergedDocuments;\r\n for (const batch of mutationBatches) {\r\n for (const mutation of batch.mutations) {\r\n const key = mutation.key;\r\n let document = results.get(key);\r\n if (document == null) {\r\n // Create invalid document to apply mutations on top of\r\n document = MutableDocument.newInvalidDocument(key);\r\n results = results.insert(key, document);\r\n }\r\n mutationApplyToLocalView(mutation, document, batch.localWriteTime);\r\n if (!document.isFoundDocument()) {\r\n results = results.remove(key);\r\n }\r\n }\r\n }\r\n });\r\n })\r\n .next(() => {\r\n // Finally, filter out any documents that don't actually match\r\n // the query.\r\n results.forEach((key, doc) => {\r\n if (!queryMatches(query, doc)) {\r\n results = results.remove(key);\r\n }\r\n });\r\n return results;\r\n });\r\n }\r\n addMissingBaseDocuments(transaction, matchingMutationBatches, existingDocuments) {\r\n let missingBaseDocEntriesForPatching = documentKeySet();\r\n for (const batch of matchingMutationBatches) {\r\n for (const mutation of batch.mutations) {\r\n if (mutation instanceof PatchMutation &&\r\n existingDocuments.get(mutation.key) === null) {\r\n missingBaseDocEntriesForPatching =\r\n missingBaseDocEntriesForPatching.add(mutation.key);\r\n }\r\n }\r\n }\r\n let mergedDocuments = existingDocuments;\r\n return this.remoteDocumentCache\r\n .getEntries(transaction, missingBaseDocEntriesForPatching)\r\n .next(missingBaseDocs => {\r\n missingBaseDocs.forEach((key, doc) => {\r\n if (doc.isFoundDocument()) {\r\n mergedDocuments = mergedDocuments.insert(key, doc);\r\n }\r\n });\r\n return mergedDocuments;\r\n });\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst LOG_TAG$c = 'LocalStore';\r\n/**\r\n * The maximum time to leave a resume token buffered without writing it out.\r\n * This value is arbitrary: it's long enough to avoid several writes\r\n * (possibly indefinitely if updates come more frequently than this) but\r\n * short enough that restarting after crashing will still have a pretty\r\n * recent resume token.\r\n */\r\nconst RESUME_TOKEN_MAX_AGE_MICROS = 5 * 60 * 1e6;\r\n/**\r\n * Implements `LocalStore` interface.\r\n *\r\n * Note: some field defined in this class might have public access level, but\r\n * the class is not exported so they are only accessible from this module.\r\n * This is useful to implement optional features (like bundles) in free\r\n * functions, such that they are tree-shakeable.\r\n */\r\nclass LocalStoreImpl {\r\n constructor(\r\n /** Manages our in-memory or durable persistence. */\r\n persistence, queryEngine, initialUser, serializer) {\r\n this.persistence = persistence;\r\n this.queryEngine = queryEngine;\r\n this.serializer = serializer;\r\n /**\r\n * Maps a targetID to data about its target.\r\n *\r\n * PORTING NOTE: We are using an immutable data structure on Web to make re-runs\r\n * of `applyRemoteEvent()` idempotent.\r\n */\r\n this.targetDataByTarget = new SortedMap(primitiveComparator);\r\n /** Maps a target to its targetID. */\r\n // TODO(wuandy): Evaluate if TargetId can be part of Target.\r\n this.targetIdByTarget = new ObjectMap(t => canonifyTarget(t), targetEquals);\r\n /**\r\n * The read time of the last entry processed by `getNewDocumentChanges()`.\r\n *\r\n * PORTING NOTE: This is only used for multi-tab synchronization.\r\n */\r\n this.lastDocumentChangeReadTime = SnapshotVersion.min();\r\n this.mutationQueue = persistence.getMutationQueue(initialUser);\r\n this.remoteDocuments = persistence.getRemoteDocumentCache();\r\n this.targetCache = persistence.getTargetCache();\r\n this.localDocuments = new LocalDocumentsView(this.remoteDocuments, this.mutationQueue, this.persistence.getIndexManager());\r\n this.bundleCache = persistence.getBundleCache();\r\n this.queryEngine.setLocalDocumentsView(this.localDocuments);\r\n }\r\n collectGarbage(garbageCollector) {\r\n return this.persistence.runTransaction('Collect garbage', 'readwrite-primary', txn => garbageCollector.collect(txn, this.targetDataByTarget));\r\n }\r\n}\r\nfunction newLocalStore(\r\n/** Manages our in-memory or durable persistence. */\r\npersistence, queryEngine, initialUser, serializer) {\r\n return new LocalStoreImpl(persistence, queryEngine, initialUser, serializer);\r\n}\r\n/**\r\n * Tells the LocalStore that the currently authenticated user has changed.\r\n *\r\n * In response the local store switches the mutation queue to the new user and\r\n * returns any resulting document changes.\r\n */\r\n// PORTING NOTE: Android and iOS only return the documents affected by the\r\n// change.\r\nasync function localStoreHandleUserChange(localStore, user) {\r\n const localStoreImpl = debugCast(localStore);\r\n let newMutationQueue = localStoreImpl.mutationQueue;\r\n let newLocalDocuments = localStoreImpl.localDocuments;\r\n const result = await localStoreImpl.persistence.runTransaction('Handle user change', 'readonly', txn => {\r\n // Swap out the mutation queue, grabbing the pending mutation batches\r\n // before and after.\r\n let oldBatches;\r\n return localStoreImpl.mutationQueue\r\n .getAllMutationBatches(txn)\r\n .next(promisedOldBatches => {\r\n oldBatches = promisedOldBatches;\r\n newMutationQueue = localStoreImpl.persistence.getMutationQueue(user);\r\n // Recreate our LocalDocumentsView using the new\r\n // MutationQueue.\r\n newLocalDocuments = new LocalDocumentsView(localStoreImpl.remoteDocuments, newMutationQueue, localStoreImpl.persistence.getIndexManager());\r\n return newMutationQueue.getAllMutationBatches(txn);\r\n })\r\n .next(newBatches => {\r\n const removedBatchIds = [];\r\n const addedBatchIds = [];\r\n // Union the old/new changed keys.\r\n let changedKeys = documentKeySet();\r\n for (const batch of oldBatches) {\r\n removedBatchIds.push(batch.batchId);\r\n for (const mutation of batch.mutations) {\r\n changedKeys = changedKeys.add(mutation.key);\r\n }\r\n }\r\n for (const batch of newBatches) {\r\n addedBatchIds.push(batch.batchId);\r\n for (const mutation of batch.mutations) {\r\n changedKeys = changedKeys.add(mutation.key);\r\n }\r\n }\r\n // Return the set of all (potentially) changed documents and the list\r\n // of mutation batch IDs that were affected by change.\r\n return newLocalDocuments\r\n .getDocuments(txn, changedKeys)\r\n .next(affectedDocuments => {\r\n return {\r\n affectedDocuments,\r\n removedBatchIds,\r\n addedBatchIds\r\n };\r\n });\r\n });\r\n });\r\n localStoreImpl.mutationQueue = newMutationQueue;\r\n localStoreImpl.localDocuments = newLocalDocuments;\r\n localStoreImpl.queryEngine.setLocalDocumentsView(localStoreImpl.localDocuments);\r\n return result;\r\n}\r\n/* Accepts locally generated Mutations and commit them to storage. */\r\nfunction localStoreWriteLocally(localStore, mutations) {\r\n const localStoreImpl = debugCast(localStore);\r\n const localWriteTime = Timestamp.now();\r\n const keys = mutations.reduce((keys, m) => keys.add(m.key), documentKeySet());\r\n let existingDocs;\r\n return localStoreImpl.persistence\r\n .runTransaction('Locally write mutations', 'readwrite', txn => {\r\n // Load and apply all existing mutations. This lets us compute the\r\n // current base state for all non-idempotent transforms before applying\r\n // any additional user-provided writes.\r\n return localStoreImpl.localDocuments\r\n .getDocuments(txn, keys)\r\n .next(docs => {\r\n existingDocs = docs;\r\n // For non-idempotent mutations (such as `FieldValue.increment()`),\r\n // we record the base state in a separate patch mutation. This is\r\n // later used to guarantee consistent values and prevents flicker\r\n // even if the backend sends us an update that already includes our\r\n // transform.\r\n const baseMutations = [];\r\n for (const mutation of mutations) {\r\n const baseValue = mutationExtractBaseValue(mutation, existingDocs.get(mutation.key));\r\n if (baseValue != null) {\r\n // NOTE: The base state should only be applied if there's some\r\n // existing document to override, so use a Precondition of\r\n // exists=true\r\n baseMutations.push(new PatchMutation(mutation.key, baseValue, extractFieldMask(baseValue.value.mapValue), Precondition.exists(true)));\r\n }\r\n }\r\n return localStoreImpl.mutationQueue.addMutationBatch(txn, localWriteTime, baseMutations, mutations);\r\n });\r\n })\r\n .then(batch => {\r\n batch.applyToLocalDocumentSet(existingDocs);\r\n return { batchId: batch.batchId, changes: existingDocs };\r\n });\r\n}\r\n/**\r\n * Acknowledges the given batch.\r\n *\r\n * On the happy path when a batch is acknowledged, the local store will\r\n *\r\n * + remove the batch from the mutation queue;\r\n * + apply the changes to the remote document cache;\r\n * + recalculate the latency compensated view implied by those changes (there\r\n * may be mutations in the queue that affect the documents but haven't been\r\n * acknowledged yet); and\r\n * + give the changed documents back the sync engine\r\n *\r\n * @returns The resulting (modified) documents.\r\n */\r\nfunction localStoreAcknowledgeBatch(localStore, batchResult) {\r\n const localStoreImpl = debugCast(localStore);\r\n return localStoreImpl.persistence.runTransaction('Acknowledge batch', 'readwrite-primary', txn => {\r\n const affected = batchResult.batch.keys();\r\n const documentBuffer = localStoreImpl.remoteDocuments.newChangeBuffer({\r\n trackRemovals: true // Make sure document removals show up in `getNewDocumentChanges()`\r\n });\r\n return applyWriteToRemoteDocuments(localStoreImpl, txn, batchResult, documentBuffer)\r\n .next(() => documentBuffer.apply(txn))\r\n .next(() => localStoreImpl.mutationQueue.performConsistencyCheck(txn))\r\n .next(() => localStoreImpl.localDocuments.getDocuments(txn, affected));\r\n });\r\n}\r\n/**\r\n * Removes mutations from the MutationQueue for the specified batch;\r\n * LocalDocuments will be recalculated.\r\n *\r\n * @returns The resulting modified documents.\r\n */\r\nfunction localStoreRejectBatch(localStore, batchId) {\r\n const localStoreImpl = debugCast(localStore);\r\n return localStoreImpl.persistence.runTransaction('Reject batch', 'readwrite-primary', txn => {\r\n let affectedKeys;\r\n return localStoreImpl.mutationQueue\r\n .lookupMutationBatch(txn, batchId)\r\n .next((batch) => {\r\n hardAssert(batch !== null);\r\n affectedKeys = batch.keys();\r\n return localStoreImpl.mutationQueue.removeMutationBatch(txn, batch);\r\n })\r\n .next(() => localStoreImpl.mutationQueue.performConsistencyCheck(txn))\r\n .next(() => localStoreImpl.localDocuments.getDocuments(txn, affectedKeys));\r\n });\r\n}\r\n/**\r\n * Returns the largest (latest) batch id in mutation queue that is pending\r\n * server response.\r\n *\r\n * Returns `BATCHID_UNKNOWN` if the queue is empty.\r\n */\r\nfunction localStoreGetHighestUnacknowledgedBatchId(localStore) {\r\n const localStoreImpl = debugCast(localStore);\r\n return localStoreImpl.persistence.runTransaction('Get highest unacknowledged batch id', 'readonly', txn => localStoreImpl.mutationQueue.getHighestUnacknowledgedBatchId(txn));\r\n}\r\n/**\r\n * Returns the last consistent snapshot processed (used by the RemoteStore to\r\n * determine whether to buffer incoming snapshots from the backend).\r\n */\r\nfunction localStoreGetLastRemoteSnapshotVersion(localStore) {\r\n const localStoreImpl = debugCast(localStore);\r\n return localStoreImpl.persistence.runTransaction('Get last remote snapshot version', 'readonly', txn => localStoreImpl.targetCache.getLastRemoteSnapshotVersion(txn));\r\n}\r\n/**\r\n * Updates the \"ground-state\" (remote) documents. We assume that the remote\r\n * event reflects any write batches that have been acknowledged or rejected\r\n * (i.e. we do not re-apply local mutations to updates from this event).\r\n *\r\n * LocalDocuments are re-calculated if there are remaining mutations in the\r\n * queue.\r\n */\r\nfunction localStoreApplyRemoteEventToLocalCache(localStore, remoteEvent) {\r\n const localStoreImpl = debugCast(localStore);\r\n const remoteVersion = remoteEvent.snapshotVersion;\r\n let newTargetDataByTargetMap = localStoreImpl.targetDataByTarget;\r\n return localStoreImpl.persistence\r\n .runTransaction('Apply remote event', 'readwrite-primary', txn => {\r\n const documentBuffer = localStoreImpl.remoteDocuments.newChangeBuffer({\r\n trackRemovals: true // Make sure document removals show up in `getNewDocumentChanges()`\r\n });\r\n // Reset newTargetDataByTargetMap in case this transaction gets re-run.\r\n newTargetDataByTargetMap = localStoreImpl.targetDataByTarget;\r\n const promises = [];\r\n remoteEvent.targetChanges.forEach((change, targetId) => {\r\n const oldTargetData = newTargetDataByTargetMap.get(targetId);\r\n if (!oldTargetData) {\r\n return;\r\n }\r\n // Only update the remote keys if the target is still active. This\r\n // ensures that we can persist the updated target data along with\r\n // the updated assignment.\r\n promises.push(localStoreImpl.targetCache\r\n .removeMatchingKeys(txn, change.removedDocuments, targetId)\r\n .next(() => {\r\n return localStoreImpl.targetCache.addMatchingKeys(txn, change.addedDocuments, targetId);\r\n }));\r\n const resumeToken = change.resumeToken;\r\n // Update the resume token if the change includes one.\r\n if (resumeToken.approximateByteSize() > 0) {\r\n const newTargetData = oldTargetData\r\n .withResumeToken(resumeToken, remoteVersion)\r\n .withSequenceNumber(txn.currentSequenceNumber);\r\n newTargetDataByTargetMap = newTargetDataByTargetMap.insert(targetId, newTargetData);\r\n // Update the target data if there are target changes (or if\r\n // sufficient time has passed since the last update).\r\n if (shouldPersistTargetData(oldTargetData, newTargetData, change)) {\r\n promises.push(localStoreImpl.targetCache.updateTargetData(txn, newTargetData));\r\n }\r\n }\r\n });\r\n let changedDocs = mutableDocumentMap();\r\n remoteEvent.documentUpdates.forEach((key, doc) => {\r\n if (remoteEvent.resolvedLimboDocuments.has(key)) {\r\n promises.push(localStoreImpl.persistence.referenceDelegate.updateLimboDocument(txn, key));\r\n }\r\n });\r\n // Each loop iteration only affects its \"own\" doc, so it's safe to get all the remote\r\n // documents in advance in a single call.\r\n promises.push(populateDocumentChangeBuffer(txn, documentBuffer, remoteEvent.documentUpdates, remoteVersion, undefined).next(result => {\r\n changedDocs = result;\r\n }));\r\n // HACK: The only reason we allow a null snapshot version is so that we\r\n // can synthesize remote events when we get permission denied errors while\r\n // trying to resolve the state of a locally cached document that is in\r\n // limbo.\r\n if (!remoteVersion.isEqual(SnapshotVersion.min())) {\r\n const updateRemoteVersion = localStoreImpl.targetCache\r\n .getLastRemoteSnapshotVersion(txn)\r\n .next(lastRemoteSnapshotVersion => {\r\n return localStoreImpl.targetCache.setTargetsMetadata(txn, txn.currentSequenceNumber, remoteVersion);\r\n });\r\n promises.push(updateRemoteVersion);\r\n }\r\n return PersistencePromise.waitFor(promises)\r\n .next(() => documentBuffer.apply(txn))\r\n .next(() => localStoreImpl.localDocuments.applyLocalViewToDocuments(txn, changedDocs))\r\n .next(() => changedDocs);\r\n })\r\n .then(changedDocs => {\r\n localStoreImpl.targetDataByTarget = newTargetDataByTargetMap;\r\n return changedDocs;\r\n });\r\n}\r\n/**\r\n * Populates document change buffer with documents from backend or a bundle.\r\n * Returns the document changes resulting from applying those documents.\r\n *\r\n * @param txn - Transaction to use to read existing documents from storage.\r\n * @param documentBuffer - Document buffer to collect the resulted changes to be\r\n * applied to storage.\r\n * @param documents - Documents to be applied.\r\n * @param globalVersion - A `SnapshotVersion` representing the read time if all\r\n * documents have the same read time.\r\n * @param documentVersions - A DocumentKey-to-SnapshotVersion map if documents\r\n * have their own read time.\r\n *\r\n * Note: this function will use `documentVersions` if it is defined;\r\n * when it is not defined, resorts to `globalVersion`.\r\n */\r\nfunction populateDocumentChangeBuffer(txn, documentBuffer, documents, globalVersion, \r\n// TODO(wuandy): We could add `readTime` to MaybeDocument instead to remove\r\n// this parameter.\r\ndocumentVersions) {\r\n let updatedKeys = documentKeySet();\r\n documents.forEach(k => (updatedKeys = updatedKeys.add(k)));\r\n return documentBuffer.getEntries(txn, updatedKeys).next(existingDocs => {\r\n let changedDocs = mutableDocumentMap();\r\n documents.forEach((key, doc) => {\r\n const existingDoc = existingDocs.get(key);\r\n const docReadTime = (documentVersions === null || documentVersions === void 0 ? void 0 : documentVersions.get(key)) || globalVersion;\r\n // Note: The order of the steps below is important, since we want\r\n // to ensure that rejected limbo resolutions (which fabricate\r\n // NoDocuments with SnapshotVersion.min()) never add documents to\r\n // cache.\r\n if (doc.isNoDocument() && doc.version.isEqual(SnapshotVersion.min())) {\r\n // NoDocuments with SnapshotVersion.min() are used in manufactured\r\n // events. We remove these documents from cache since we lost\r\n // access.\r\n documentBuffer.removeEntry(key, docReadTime);\r\n changedDocs = changedDocs.insert(key, doc);\r\n }\r\n else if (!existingDoc.isValidDocument() ||\r\n doc.version.compareTo(existingDoc.version) > 0 ||\r\n (doc.version.compareTo(existingDoc.version) === 0 &&\r\n existingDoc.hasPendingWrites)) {\r\n documentBuffer.addEntry(doc, docReadTime);\r\n changedDocs = changedDocs.insert(key, doc);\r\n }\r\n else {\r\n logDebug(LOG_TAG$c, 'Ignoring outdated watch update for ', key, '. Current version:', existingDoc.version, ' Watch version:', doc.version);\r\n }\r\n });\r\n return changedDocs;\r\n });\r\n}\r\n/**\r\n * Returns true if the newTargetData should be persisted during an update of\r\n * an active target. TargetData should always be persisted when a target is\r\n * being released and should not call this function.\r\n *\r\n * While the target is active, TargetData updates can be omitted when nothing\r\n * about the target has changed except metadata like the resume token or\r\n * snapshot version. Occasionally it's worth the extra write to prevent these\r\n * values from getting too stale after a crash, but this doesn't have to be\r\n * too frequent.\r\n */\r\nfunction shouldPersistTargetData(oldTargetData, newTargetData, change) {\r\n hardAssert(newTargetData.resumeToken.approximateByteSize() > 0);\r\n // Always persist target data if we don't already have a resume token.\r\n if (oldTargetData.resumeToken.approximateByteSize() === 0) {\r\n return true;\r\n }\r\n // Don't allow resume token changes to be buffered indefinitely. This\r\n // allows us to be reasonably up-to-date after a crash and avoids needing\r\n // to loop over all active queries on shutdown. Especially in the browser\r\n // we may not get time to do anything interesting while the current tab is\r\n // closing.\r\n const timeDelta = newTargetData.snapshotVersion.toMicroseconds() -\r\n oldTargetData.snapshotVersion.toMicroseconds();\r\n if (timeDelta >= RESUME_TOKEN_MAX_AGE_MICROS) {\r\n return true;\r\n }\r\n // Otherwise if the only thing that has changed about a target is its resume\r\n // token it's not worth persisting. Note that the RemoteStore keeps an\r\n // in-memory view of the currently active targets which includes the current\r\n // resume token, so stream failure or user changes will still use an\r\n // up-to-date resume token regardless of what we do here.\r\n const changes = change.addedDocuments.size +\r\n change.modifiedDocuments.size +\r\n change.removedDocuments.size;\r\n return changes > 0;\r\n}\r\n/**\r\n * Notifies local store of the changed views to locally pin documents.\r\n */\r\nasync function localStoreNotifyLocalViewChanges(localStore, viewChanges) {\r\n const localStoreImpl = debugCast(localStore);\r\n try {\r\n await localStoreImpl.persistence.runTransaction('notifyLocalViewChanges', 'readwrite', txn => {\r\n return PersistencePromise.forEach(viewChanges, (viewChange) => {\r\n return PersistencePromise.forEach(viewChange.addedKeys, (key) => localStoreImpl.persistence.referenceDelegate.addReference(txn, viewChange.targetId, key)).next(() => PersistencePromise.forEach(viewChange.removedKeys, (key) => localStoreImpl.persistence.referenceDelegate.removeReference(txn, viewChange.targetId, key)));\r\n });\r\n });\r\n }\r\n catch (e) {\r\n if (isIndexedDbTransactionError(e)) {\r\n // If `notifyLocalViewChanges` fails, we did not advance the sequence\r\n // number for the documents that were included in this transaction.\r\n // This might trigger them to be deleted earlier than they otherwise\r\n // would have, but it should not invalidate the integrity of the data.\r\n logDebug(LOG_TAG$c, 'Failed to update sequence numbers: ' + e);\r\n }\r\n else {\r\n throw e;\r\n }\r\n }\r\n for (const viewChange of viewChanges) {\r\n const targetId = viewChange.targetId;\r\n if (!viewChange.fromCache) {\r\n const targetData = localStoreImpl.targetDataByTarget.get(targetId);\r\n // Advance the last limbo free snapshot version\r\n const lastLimboFreeSnapshotVersion = targetData.snapshotVersion;\r\n const updatedTargetData = targetData.withLastLimboFreeSnapshotVersion(lastLimboFreeSnapshotVersion);\r\n localStoreImpl.targetDataByTarget =\r\n localStoreImpl.targetDataByTarget.insert(targetId, updatedTargetData);\r\n }\r\n }\r\n}\r\n/**\r\n * Gets the mutation batch after the passed in batchId in the mutation queue\r\n * or null if empty.\r\n * @param afterBatchId - If provided, the batch to search after.\r\n * @returns The next mutation or null if there wasn't one.\r\n */\r\nfunction localStoreGetNextMutationBatch(localStore, afterBatchId) {\r\n const localStoreImpl = debugCast(localStore);\r\n return localStoreImpl.persistence.runTransaction('Get next mutation batch', 'readonly', txn => {\r\n if (afterBatchId === undefined) {\r\n afterBatchId = BATCHID_UNKNOWN;\r\n }\r\n return localStoreImpl.mutationQueue.getNextMutationBatchAfterBatchId(txn, afterBatchId);\r\n });\r\n}\r\n/**\r\n * Reads the current value of a Document with a given key or null if not\r\n * found - used for testing.\r\n */\r\nfunction localStoreReadDocument(localStore, key) {\r\n const localStoreImpl = debugCast(localStore);\r\n return localStoreImpl.persistence.runTransaction('read document', 'readonly', txn => localStoreImpl.localDocuments.getDocument(txn, key));\r\n}\r\n/**\r\n * Assigns the given target an internal ID so that its results can be pinned so\r\n * they don't get GC'd. A target must be allocated in the local store before\r\n * the store can be used to manage its view.\r\n *\r\n * Allocating an already allocated `Target` will return the existing `TargetData`\r\n * for that `Target`.\r\n */\r\nfunction localStoreAllocateTarget(localStore, target) {\r\n const localStoreImpl = debugCast(localStore);\r\n return localStoreImpl.persistence\r\n .runTransaction('Allocate target', 'readwrite', txn => {\r\n let targetData;\r\n return localStoreImpl.targetCache\r\n .getTargetData(txn, target)\r\n .next((cached) => {\r\n if (cached) {\r\n // This target has been listened to previously, so reuse the\r\n // previous targetID.\r\n // TODO(mcg): freshen last accessed date?\r\n targetData = cached;\r\n return PersistencePromise.resolve(targetData);\r\n }\r\n else {\r\n return localStoreImpl.targetCache\r\n .allocateTargetId(txn)\r\n .next(targetId => {\r\n targetData = new TargetData(target, targetId, 0 /* Listen */, txn.currentSequenceNumber);\r\n return localStoreImpl.targetCache\r\n .addTargetData(txn, targetData)\r\n .next(() => targetData);\r\n });\r\n }\r\n });\r\n })\r\n .then(targetData => {\r\n // If Multi-Tab is enabled, the existing target data may be newer than\r\n // the in-memory data\r\n const cachedTargetData = localStoreImpl.targetDataByTarget.get(targetData.targetId);\r\n if (cachedTargetData === null ||\r\n targetData.snapshotVersion.compareTo(cachedTargetData.snapshotVersion) >\r\n 0) {\r\n localStoreImpl.targetDataByTarget =\r\n localStoreImpl.targetDataByTarget.insert(targetData.targetId, targetData);\r\n localStoreImpl.targetIdByTarget.set(target, targetData.targetId);\r\n }\r\n return targetData;\r\n });\r\n}\r\n/**\r\n * Returns the TargetData as seen by the LocalStore, including updates that may\r\n * have not yet been persisted to the TargetCache.\r\n */\r\n// Visible for testing.\r\nfunction localStoreGetTargetData(localStore, transaction, target) {\r\n const localStoreImpl = debugCast(localStore);\r\n const targetId = localStoreImpl.targetIdByTarget.get(target);\r\n if (targetId !== undefined) {\r\n return PersistencePromise.resolve(localStoreImpl.targetDataByTarget.get(targetId));\r\n }\r\n else {\r\n return localStoreImpl.targetCache.getTargetData(transaction, target);\r\n }\r\n}\r\n/**\r\n * Unpins all the documents associated with the given target. If\r\n * `keepPersistedTargetData` is set to false and Eager GC enabled, the method\r\n * directly removes the associated target data from the target cache.\r\n *\r\n * Releasing a non-existing `Target` is a no-op.\r\n */\r\n// PORTING NOTE: `keepPersistedTargetData` is multi-tab only.\r\nasync function localStoreReleaseTarget(localStore, targetId, keepPersistedTargetData) {\r\n const localStoreImpl = debugCast(localStore);\r\n const targetData = localStoreImpl.targetDataByTarget.get(targetId);\r\n const mode = keepPersistedTargetData ? 'readwrite' : 'readwrite-primary';\r\n try {\r\n if (!keepPersistedTargetData) {\r\n await localStoreImpl.persistence.runTransaction('Release target', mode, txn => {\r\n return localStoreImpl.persistence.referenceDelegate.removeTarget(txn, targetData);\r\n });\r\n }\r\n }\r\n catch (e) {\r\n if (isIndexedDbTransactionError(e)) {\r\n // All `releaseTarget` does is record the final metadata state for the\r\n // target, but we've been recording this periodically during target\r\n // activity. If we lose this write this could cause a very slight\r\n // difference in the order of target deletion during GC, but we\r\n // don't define exact LRU semantics so this is acceptable.\r\n logDebug(LOG_TAG$c, `Failed to update sequence numbers for target ${targetId}: ${e}`);\r\n }\r\n else {\r\n throw e;\r\n }\r\n }\r\n localStoreImpl.targetDataByTarget =\r\n localStoreImpl.targetDataByTarget.remove(targetId);\r\n localStoreImpl.targetIdByTarget.delete(targetData.target);\r\n}\r\n/**\r\n * Runs the specified query against the local store and returns the results,\r\n * potentially taking advantage of query data from previous executions (such\r\n * as the set of remote keys).\r\n *\r\n * @param usePreviousResults - Whether results from previous executions can\r\n * be used to optimize this query execution.\r\n */\r\nfunction localStoreExecuteQuery(localStore, query, usePreviousResults) {\r\n const localStoreImpl = debugCast(localStore);\r\n let lastLimboFreeSnapshotVersion = SnapshotVersion.min();\r\n let remoteKeys = documentKeySet();\r\n return localStoreImpl.persistence.runTransaction('Execute query', 'readonly', txn => {\r\n return localStoreGetTargetData(localStoreImpl, txn, queryToTarget(query))\r\n .next(targetData => {\r\n if (targetData) {\r\n lastLimboFreeSnapshotVersion =\r\n targetData.lastLimboFreeSnapshotVersion;\r\n return localStoreImpl.targetCache\r\n .getMatchingKeysForTargetId(txn, targetData.targetId)\r\n .next(result => {\r\n remoteKeys = result;\r\n });\r\n }\r\n })\r\n .next(() => localStoreImpl.queryEngine.getDocumentsMatchingQuery(txn, query, usePreviousResults\r\n ? lastLimboFreeSnapshotVersion\r\n : SnapshotVersion.min(), usePreviousResults ? remoteKeys : documentKeySet()))\r\n .next(documents => {\r\n return { documents, remoteKeys };\r\n });\r\n });\r\n}\r\nfunction applyWriteToRemoteDocuments(localStoreImpl, txn, batchResult, documentBuffer) {\r\n const batch = batchResult.batch;\r\n const docKeys = batch.keys();\r\n let promiseChain = PersistencePromise.resolve();\r\n docKeys.forEach(docKey => {\r\n promiseChain = promiseChain\r\n .next(() => documentBuffer.getEntry(txn, docKey))\r\n .next(doc => {\r\n const ackVersion = batchResult.docVersions.get(docKey);\r\n hardAssert(ackVersion !== null);\r\n if (doc.version.compareTo(ackVersion) < 0) {\r\n batch.applyToRemoteDocument(doc, batchResult);\r\n if (doc.isValidDocument()) {\r\n // We use the commitVersion as the readTime rather than the\r\n // document's updateTime since the updateTime is not advanced\r\n // for updates that do not modify the underlying document.\r\n documentBuffer.addEntry(doc, batchResult.commitVersion);\r\n }\r\n }\r\n });\r\n });\r\n return promiseChain.next(() => localStoreImpl.mutationQueue.removeMutationBatch(txn, batch));\r\n}\r\n/** Returns the local view of the documents affected by a mutation batch. */\r\n// PORTING NOTE: Multi-Tab only.\r\nfunction localStoreLookupMutationDocuments(localStore, batchId) {\r\n const localStoreImpl = debugCast(localStore);\r\n const mutationQueueImpl = debugCast(localStoreImpl.mutationQueue);\r\n return localStoreImpl.persistence.runTransaction('Lookup mutation documents', 'readonly', txn => {\r\n return mutationQueueImpl.lookupMutationKeys(txn, batchId).next(keys => {\r\n if (keys) {\r\n return localStoreImpl.localDocuments.getDocuments(txn, keys);\r\n }\r\n else {\r\n return PersistencePromise.resolve(null);\r\n }\r\n });\r\n });\r\n}\r\n// PORTING NOTE: Multi-Tab only.\r\nfunction localStoreRemoveCachedMutationBatchMetadata(localStore, batchId) {\r\n const mutationQueueImpl = debugCast(debugCast(localStore, LocalStoreImpl).mutationQueue);\r\n mutationQueueImpl.removeCachedMutationKeys(batchId);\r\n}\r\n// PORTING NOTE: Multi-Tab only.\r\nfunction localStoreGetActiveClients(localStore) {\r\n const persistenceImpl = debugCast(debugCast(localStore, LocalStoreImpl).persistence);\r\n return persistenceImpl.getActiveClients();\r\n}\r\n// PORTING NOTE: Multi-Tab only.\r\nfunction localStoreGetCachedTarget(localStore, targetId) {\r\n const localStoreImpl = debugCast(localStore);\r\n const targetCacheImpl = debugCast(localStoreImpl.targetCache);\r\n const cachedTargetData = localStoreImpl.targetDataByTarget.get(targetId);\r\n if (cachedTargetData) {\r\n return Promise.resolve(cachedTargetData.target);\r\n }\r\n else {\r\n return localStoreImpl.persistence.runTransaction('Get target data', 'readonly', txn => {\r\n return targetCacheImpl\r\n .getTargetDataForTarget(txn, targetId)\r\n .next(targetData => (targetData ? targetData.target : null));\r\n });\r\n }\r\n}\r\n/**\r\n * Returns the set of documents that have been updated since the last call.\r\n * If this is the first call, returns the set of changes since client\r\n * initialization. Further invocations will return document that have changed\r\n * since the prior call.\r\n */\r\n// PORTING NOTE: Multi-Tab only.\r\nfunction localStoreGetNewDocumentChanges(localStore) {\r\n const localStoreImpl = debugCast(localStore);\r\n return localStoreImpl.persistence\r\n .runTransaction('Get new document changes', 'readonly', txn => remoteDocumentCacheGetNewDocumentChanges(localStoreImpl.remoteDocuments, txn, localStoreImpl.lastDocumentChangeReadTime))\r\n .then(({ changedDocs, readTime }) => {\r\n localStoreImpl.lastDocumentChangeReadTime = readTime;\r\n return changedDocs;\r\n });\r\n}\r\n/**\r\n * Reads the newest document change from persistence and moves the internal\r\n * synchronization marker forward so that calls to `getNewDocumentChanges()`\r\n * only return changes that happened after client initialization.\r\n */\r\n// PORTING NOTE: Multi-Tab only.\r\nasync function localStoreSynchronizeLastDocumentChangeReadTime(localStore) {\r\n const localStoreImpl = debugCast(localStore);\r\n return localStoreImpl.persistence\r\n .runTransaction('Synchronize last document change read time', 'readonly', txn => remoteDocumentCacheGetLastReadTime(txn))\r\n .then(readTime => {\r\n localStoreImpl.lastDocumentChangeReadTime = readTime;\r\n });\r\n}\r\n/**\r\n * Creates a new target using the given bundle name, which will be used to\r\n * hold the keys of all documents from the bundle in query-document mappings.\r\n * This ensures that the loaded documents do not get garbage collected\r\n * right away.\r\n */\r\nfunction umbrellaTarget(bundleName) {\r\n // It is OK that the path used for the query is not valid, because this will\r\n // not be read and queried.\r\n return queryToTarget(newQueryForPath(ResourcePath.fromString(`__bundle__/docs/${bundleName}`)));\r\n}\r\n/**\r\n * Applies the documents from a bundle to the \"ground-state\" (remote)\r\n * documents.\r\n *\r\n * LocalDocuments are re-calculated if there are remaining mutations in the\r\n * queue.\r\n */\r\nasync function localStoreApplyBundledDocuments(localStore, bundleConverter, documents, bundleName) {\r\n const localStoreImpl = debugCast(localStore);\r\n let documentKeys = documentKeySet();\r\n let documentMap = mutableDocumentMap();\r\n let versionMap = documentVersionMap();\r\n for (const bundleDoc of documents) {\r\n const documentKey = bundleConverter.toDocumentKey(bundleDoc.metadata.name);\r\n if (bundleDoc.document) {\r\n documentKeys = documentKeys.add(documentKey);\r\n }\r\n documentMap = documentMap.insert(documentKey, bundleConverter.toMutableDocument(bundleDoc));\r\n versionMap = versionMap.insert(documentKey, bundleConverter.toSnapshotVersion(bundleDoc.metadata.readTime));\r\n }\r\n const documentBuffer = localStoreImpl.remoteDocuments.newChangeBuffer({\r\n trackRemovals: true // Make sure document removals show up in `getNewDocumentChanges()`\r\n });\r\n // Allocates a target to hold all document keys from the bundle, such that\r\n // they will not get garbage collected right away.\r\n const umbrellaTargetData = await localStoreAllocateTarget(localStoreImpl, umbrellaTarget(bundleName));\r\n return localStoreImpl.persistence.runTransaction('Apply bundle documents', 'readwrite', txn => {\r\n return populateDocumentChangeBuffer(txn, documentBuffer, documentMap, SnapshotVersion.min(), versionMap)\r\n .next(changedDocs => {\r\n documentBuffer.apply(txn);\r\n return changedDocs;\r\n })\r\n .next(changedDocs => {\r\n return localStoreImpl.targetCache\r\n .removeMatchingKeysForTargetId(txn, umbrellaTargetData.targetId)\r\n .next(() => localStoreImpl.targetCache.addMatchingKeys(txn, documentKeys, umbrellaTargetData.targetId))\r\n .next(() => localStoreImpl.localDocuments.applyLocalViewToDocuments(txn, changedDocs))\r\n .next(() => changedDocs);\r\n });\r\n });\r\n}\r\n/**\r\n * Returns a promise of a boolean to indicate if the given bundle has already\r\n * been loaded and the create time is newer than the current loading bundle.\r\n */\r\nfunction localStoreHasNewerBundle(localStore, bundleMetadata) {\r\n const localStoreImpl = debugCast(localStore);\r\n const currentReadTime = fromVersion(bundleMetadata.createTime);\r\n return localStoreImpl.persistence\r\n .runTransaction('hasNewerBundle', 'readonly', transaction => {\r\n return localStoreImpl.bundleCache.getBundleMetadata(transaction, bundleMetadata.id);\r\n })\r\n .then(cached => {\r\n return !!cached && cached.createTime.compareTo(currentReadTime) >= 0;\r\n });\r\n}\r\n/**\r\n * Saves the given `BundleMetadata` to local persistence.\r\n */\r\nfunction localStoreSaveBundle(localStore, bundleMetadata) {\r\n const localStoreImpl = debugCast(localStore);\r\n return localStoreImpl.persistence.runTransaction('Save bundle', 'readwrite', transaction => {\r\n return localStoreImpl.bundleCache.saveBundleMetadata(transaction, bundleMetadata);\r\n });\r\n}\r\n/**\r\n * Returns a promise of a `NamedQuery` associated with given query name. Promise\r\n * resolves to undefined if no persisted data can be found.\r\n */\r\nfunction localStoreGetNamedQuery(localStore, queryName) {\r\n const localStoreImpl = debugCast(localStore);\r\n return localStoreImpl.persistence.runTransaction('Get named query', 'readonly', transaction => localStoreImpl.bundleCache.getNamedQuery(transaction, queryName));\r\n}\r\n/**\r\n * Saves the given `NamedQuery` to local persistence.\r\n */\r\nasync function localStoreSaveNamedQuery(localStore, query, documents = documentKeySet()) {\r\n // Allocate a target for the named query such that it can be resumed\r\n // from associated read time if users use it to listen.\r\n // NOTE: this also means if no corresponding target exists, the new target\r\n // will remain active and will not get collected, unless users happen to\r\n // unlisten the query somehow.\r\n const allocated = await localStoreAllocateTarget(localStore, queryToTarget(fromBundledQuery(query.bundledQuery)));\r\n const localStoreImpl = debugCast(localStore);\r\n return localStoreImpl.persistence.runTransaction('Save named query', 'readwrite', transaction => {\r\n const readTime = fromVersion(query.readTime);\r\n // Simply save the query itself if it is older than what the SDK already\r\n // has.\r\n if (allocated.snapshotVersion.compareTo(readTime) >= 0) {\r\n return localStoreImpl.bundleCache.saveNamedQuery(transaction, query);\r\n }\r\n // Update existing target data because the query from the bundle is newer.\r\n const newTargetData = allocated.withResumeToken(ByteString.EMPTY_BYTE_STRING, readTime);\r\n localStoreImpl.targetDataByTarget =\r\n localStoreImpl.targetDataByTarget.insert(newTargetData.targetId, newTargetData);\r\n return localStoreImpl.targetCache\r\n .updateTargetData(transaction, newTargetData)\r\n .next(() => localStoreImpl.targetCache.removeMatchingKeysForTargetId(transaction, allocated.targetId))\r\n .next(() => localStoreImpl.targetCache.addMatchingKeys(transaction, documents, allocated.targetId))\r\n .next(() => localStoreImpl.bundleCache.saveNamedQuery(transaction, query));\r\n });\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nclass MemoryBundleCache {\r\n constructor(serializer) {\r\n this.serializer = serializer;\r\n this.bundles = new Map();\r\n this.namedQueries = new Map();\r\n }\r\n getBundleMetadata(transaction, bundleId) {\r\n return PersistencePromise.resolve(this.bundles.get(bundleId));\r\n }\r\n saveBundleMetadata(transaction, bundleMetadata) {\r\n this.bundles.set(bundleMetadata.id, fromBundleMetadata(bundleMetadata));\r\n return PersistencePromise.resolve();\r\n }\r\n getNamedQuery(transaction, queryName) {\r\n return PersistencePromise.resolve(this.namedQueries.get(queryName));\r\n }\r\n saveNamedQuery(transaction, query) {\r\n this.namedQueries.set(query.name, fromProtoNamedQuery(query));\r\n return PersistencePromise.resolve();\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A collection of references to a document from some kind of numbered entity\r\n * (either a target ID or batch ID). As references are added to or removed from\r\n * the set corresponding events are emitted to a registered garbage collector.\r\n *\r\n * Each reference is represented by a DocumentReference object. Each of them\r\n * contains enough information to uniquely identify the reference. They are all\r\n * stored primarily in a set sorted by key. A document is considered garbage if\r\n * there's no references in that set (this can be efficiently checked thanks to\r\n * sorting by key).\r\n *\r\n * ReferenceSet also keeps a secondary set that contains references sorted by\r\n * IDs. This one is used to efficiently implement removal of all references by\r\n * some target ID.\r\n */\r\nclass ReferenceSet {\r\n constructor() {\r\n // A set of outstanding references to a document sorted by key.\r\n this.refsByKey = new SortedSet(DocReference.compareByKey);\r\n // A set of outstanding references to a document sorted by target id.\r\n this.refsByTarget = new SortedSet(DocReference.compareByTargetId);\r\n }\r\n /** Returns true if the reference set contains no references. */\r\n isEmpty() {\r\n return this.refsByKey.isEmpty();\r\n }\r\n /** Adds a reference to the given document key for the given ID. */\r\n addReference(key, id) {\r\n const ref = new DocReference(key, id);\r\n this.refsByKey = this.refsByKey.add(ref);\r\n this.refsByTarget = this.refsByTarget.add(ref);\r\n }\r\n /** Add references to the given document keys for the given ID. */\r\n addReferences(keys, id) {\r\n keys.forEach(key => this.addReference(key, id));\r\n }\r\n /**\r\n * Removes a reference to the given document key for the given\r\n * ID.\r\n */\r\n removeReference(key, id) {\r\n this.removeRef(new DocReference(key, id));\r\n }\r\n removeReferences(keys, id) {\r\n keys.forEach(key => this.removeReference(key, id));\r\n }\r\n /**\r\n * Clears all references with a given ID. Calls removeRef() for each key\r\n * removed.\r\n */\r\n removeReferencesForId(id) {\r\n const emptyKey = new DocumentKey(new ResourcePath([]));\r\n const startRef = new DocReference(emptyKey, id);\r\n const endRef = new DocReference(emptyKey, id + 1);\r\n const keys = [];\r\n this.refsByTarget.forEachInRange([startRef, endRef], ref => {\r\n this.removeRef(ref);\r\n keys.push(ref.key);\r\n });\r\n return keys;\r\n }\r\n removeAllReferences() {\r\n this.refsByKey.forEach(ref => this.removeRef(ref));\r\n }\r\n removeRef(ref) {\r\n this.refsByKey = this.refsByKey.delete(ref);\r\n this.refsByTarget = this.refsByTarget.delete(ref);\r\n }\r\n referencesForId(id) {\r\n const emptyKey = new DocumentKey(new ResourcePath([]));\r\n const startRef = new DocReference(emptyKey, id);\r\n const endRef = new DocReference(emptyKey, id + 1);\r\n let keys = documentKeySet();\r\n this.refsByTarget.forEachInRange([startRef, endRef], ref => {\r\n keys = keys.add(ref.key);\r\n });\r\n return keys;\r\n }\r\n containsKey(key) {\r\n const ref = new DocReference(key, 0);\r\n const firstRef = this.refsByKey.firstAfterOrEqual(ref);\r\n return firstRef !== null && key.isEqual(firstRef.key);\r\n }\r\n}\r\nclass DocReference {\r\n constructor(key, targetOrBatchId) {\r\n this.key = key;\r\n this.targetOrBatchId = targetOrBatchId;\r\n }\r\n /** Compare by key then by ID */\r\n static compareByKey(left, right) {\r\n return (DocumentKey.comparator(left.key, right.key) ||\r\n primitiveComparator(left.targetOrBatchId, right.targetOrBatchId));\r\n }\r\n /** Compare by ID then by key */\r\n static compareByTargetId(left, right) {\r\n return (primitiveComparator(left.targetOrBatchId, right.targetOrBatchId) ||\r\n DocumentKey.comparator(left.key, right.key));\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nclass MemoryMutationQueue {\r\n constructor(indexManager, referenceDelegate) {\r\n this.indexManager = indexManager;\r\n this.referenceDelegate = referenceDelegate;\r\n /**\r\n * The set of all mutations that have been sent but not yet been applied to\r\n * the backend.\r\n */\r\n this.mutationQueue = [];\r\n /** Next value to use when assigning sequential IDs to each mutation batch. */\r\n this.nextBatchId = 1;\r\n /** An ordered mapping between documents and the mutations batch IDs. */\r\n this.batchesByDocumentKey = new SortedSet(DocReference.compareByKey);\r\n }\r\n checkEmpty(transaction) {\r\n return PersistencePromise.resolve(this.mutationQueue.length === 0);\r\n }\r\n addMutationBatch(transaction, localWriteTime, baseMutations, mutations) {\r\n const batchId = this.nextBatchId;\r\n this.nextBatchId++;\r\n if (this.mutationQueue.length > 0) {\r\n this.mutationQueue[this.mutationQueue.length - 1];\r\n }\r\n const batch = new MutationBatch(batchId, localWriteTime, baseMutations, mutations);\r\n this.mutationQueue.push(batch);\r\n // Track references by document key and index collection parents.\r\n for (const mutation of mutations) {\r\n this.batchesByDocumentKey = this.batchesByDocumentKey.add(new DocReference(mutation.key, batchId));\r\n this.indexManager.addToCollectionParentIndex(transaction, mutation.key.path.popLast());\r\n }\r\n return PersistencePromise.resolve(batch);\r\n }\r\n lookupMutationBatch(transaction, batchId) {\r\n return PersistencePromise.resolve(this.findMutationBatch(batchId));\r\n }\r\n getNextMutationBatchAfterBatchId(transaction, batchId) {\r\n const nextBatchId = batchId + 1;\r\n // The requested batchId may still be out of range so normalize it to the\r\n // start of the queue.\r\n const rawIndex = this.indexOfBatchId(nextBatchId);\r\n const index = rawIndex < 0 ? 0 : rawIndex;\r\n return PersistencePromise.resolve(this.mutationQueue.length > index ? this.mutationQueue[index] : null);\r\n }\r\n getHighestUnacknowledgedBatchId() {\r\n return PersistencePromise.resolve(this.mutationQueue.length === 0 ? BATCHID_UNKNOWN : this.nextBatchId - 1);\r\n }\r\n getAllMutationBatches(transaction) {\r\n return PersistencePromise.resolve(this.mutationQueue.slice());\r\n }\r\n getAllMutationBatchesAffectingDocumentKey(transaction, documentKey) {\r\n const start = new DocReference(documentKey, 0);\r\n const end = new DocReference(documentKey, Number.POSITIVE_INFINITY);\r\n const result = [];\r\n this.batchesByDocumentKey.forEachInRange([start, end], ref => {\r\n const batch = this.findMutationBatch(ref.targetOrBatchId);\r\n result.push(batch);\r\n });\r\n return PersistencePromise.resolve(result);\r\n }\r\n getAllMutationBatchesAffectingDocumentKeys(transaction, documentKeys) {\r\n let uniqueBatchIDs = new SortedSet(primitiveComparator);\r\n documentKeys.forEach(documentKey => {\r\n const start = new DocReference(documentKey, 0);\r\n const end = new DocReference(documentKey, Number.POSITIVE_INFINITY);\r\n this.batchesByDocumentKey.forEachInRange([start, end], ref => {\r\n uniqueBatchIDs = uniqueBatchIDs.add(ref.targetOrBatchId);\r\n });\r\n });\r\n return PersistencePromise.resolve(this.findMutationBatches(uniqueBatchIDs));\r\n }\r\n getAllMutationBatchesAffectingQuery(transaction, query) {\r\n // Use the query path as a prefix for testing if a document matches the\r\n // query.\r\n const prefix = query.path;\r\n const immediateChildrenPathLength = prefix.length + 1;\r\n // Construct a document reference for actually scanning the index. Unlike\r\n // the prefix the document key in this reference must have an even number of\r\n // segments. The empty segment can be used a suffix of the query path\r\n // because it precedes all other segments in an ordered traversal.\r\n let startPath = prefix;\r\n if (!DocumentKey.isDocumentKey(startPath)) {\r\n startPath = startPath.child('');\r\n }\r\n const start = new DocReference(new DocumentKey(startPath), 0);\r\n // Find unique batchIDs referenced by all documents potentially matching the\r\n // query.\r\n let uniqueBatchIDs = new SortedSet(primitiveComparator);\r\n this.batchesByDocumentKey.forEachWhile(ref => {\r\n const rowKeyPath = ref.key.path;\r\n if (!prefix.isPrefixOf(rowKeyPath)) {\r\n return false;\r\n }\r\n else {\r\n // Rows with document keys more than one segment longer than the query\r\n // path can't be matches. For example, a query on 'rooms' can't match\r\n // the document /rooms/abc/messages/xyx.\r\n // TODO(mcg): we'll need a different scanner when we implement\r\n // ancestor queries.\r\n if (rowKeyPath.length === immediateChildrenPathLength) {\r\n uniqueBatchIDs = uniqueBatchIDs.add(ref.targetOrBatchId);\r\n }\r\n return true;\r\n }\r\n }, start);\r\n return PersistencePromise.resolve(this.findMutationBatches(uniqueBatchIDs));\r\n }\r\n findMutationBatches(batchIDs) {\r\n // Construct an array of matching batches, sorted by batchID to ensure that\r\n // multiple mutations affecting the same document key are applied in order.\r\n const result = [];\r\n batchIDs.forEach(batchId => {\r\n const batch = this.findMutationBatch(batchId);\r\n if (batch !== null) {\r\n result.push(batch);\r\n }\r\n });\r\n return result;\r\n }\r\n removeMutationBatch(transaction, batch) {\r\n // Find the position of the first batch for removal.\r\n const batchIndex = this.indexOfExistingBatchId(batch.batchId, 'removed');\r\n hardAssert(batchIndex === 0);\r\n this.mutationQueue.shift();\r\n let references = this.batchesByDocumentKey;\r\n return PersistencePromise.forEach(batch.mutations, (mutation) => {\r\n const ref = new DocReference(mutation.key, batch.batchId);\r\n references = references.delete(ref);\r\n return this.referenceDelegate.markPotentiallyOrphaned(transaction, mutation.key);\r\n }).next(() => {\r\n this.batchesByDocumentKey = references;\r\n });\r\n }\r\n removeCachedMutationKeys(batchId) {\r\n // No-op since the memory mutation queue does not maintain a separate cache.\r\n }\r\n containsKey(txn, key) {\r\n const ref = new DocReference(key, 0);\r\n const firstRef = this.batchesByDocumentKey.firstAfterOrEqual(ref);\r\n return PersistencePromise.resolve(key.isEqual(firstRef && firstRef.key));\r\n }\r\n performConsistencyCheck(txn) {\r\n if (this.mutationQueue.length === 0) ;\r\n return PersistencePromise.resolve();\r\n }\r\n /**\r\n * Finds the index of the given batchId in the mutation queue and asserts that\r\n * the resulting index is within the bounds of the queue.\r\n *\r\n * @param batchId - The batchId to search for\r\n * @param action - A description of what the caller is doing, phrased in passive\r\n * form (e.g. \"acknowledged\" in a routine that acknowledges batches).\r\n */\r\n indexOfExistingBatchId(batchId, action) {\r\n const index = this.indexOfBatchId(batchId);\r\n return index;\r\n }\r\n /**\r\n * Finds the index of the given batchId in the mutation queue. This operation\r\n * is O(1).\r\n *\r\n * @returns The computed index of the batch with the given batchId, based on\r\n * the state of the queue. Note this index can be negative if the requested\r\n * batchId has already been remvoed from the queue or past the end of the\r\n * queue if the batchId is larger than the last added batch.\r\n */\r\n indexOfBatchId(batchId) {\r\n if (this.mutationQueue.length === 0) {\r\n // As an index this is past the end of the queue\r\n return 0;\r\n }\r\n // Examine the front of the queue to figure out the difference between the\r\n // batchId and indexes in the array. Note that since the queue is ordered\r\n // by batchId, if the first batch has a larger batchId then the requested\r\n // batchId doesn't exist in the queue.\r\n const firstBatchId = this.mutationQueue[0].batchId;\r\n return batchId - firstBatchId;\r\n }\r\n /**\r\n * A version of lookupMutationBatch that doesn't return a promise, this makes\r\n * other functions that uses this code easier to read and more efficent.\r\n */\r\n findMutationBatch(batchId) {\r\n const index = this.indexOfBatchId(batchId);\r\n if (index < 0 || index >= this.mutationQueue.length) {\r\n return null;\r\n }\r\n const batch = this.mutationQueue[index];\r\n return batch;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction documentEntryMap() {\r\n return new SortedMap(DocumentKey.comparator);\r\n}\r\n/**\r\n * The memory-only RemoteDocumentCache for IndexedDb. To construct, invoke\r\n * `newMemoryRemoteDocumentCache()`.\r\n */\r\nclass MemoryRemoteDocumentCacheImpl {\r\n /**\r\n * @param sizer - Used to assess the size of a document. For eager GC, this is\r\n * expected to just return 0 to avoid unnecessarily doing the work of\r\n * calculating the size.\r\n */\r\n constructor(indexManager, sizer) {\r\n this.indexManager = indexManager;\r\n this.sizer = sizer;\r\n /** Underlying cache of documents and their read times. */\r\n this.docs = documentEntryMap();\r\n /** Size of all cached documents. */\r\n this.size = 0;\r\n }\r\n /**\r\n * Adds the supplied entry to the cache and updates the cache size as appropriate.\r\n *\r\n * All calls of `addEntry` are required to go through the RemoteDocumentChangeBuffer\r\n * returned by `newChangeBuffer()`.\r\n */\r\n addEntry(transaction, doc, readTime) {\r\n const key = doc.key;\r\n const entry = this.docs.get(key);\r\n const previousSize = entry ? entry.size : 0;\r\n const currentSize = this.sizer(doc);\r\n this.docs = this.docs.insert(key, {\r\n document: doc.clone(),\r\n size: currentSize,\r\n readTime\r\n });\r\n this.size += currentSize - previousSize;\r\n return this.indexManager.addToCollectionParentIndex(transaction, key.path.popLast());\r\n }\r\n /**\r\n * Removes the specified entry from the cache and updates the cache size as appropriate.\r\n *\r\n * All calls of `removeEntry` are required to go through the RemoteDocumentChangeBuffer\r\n * returned by `newChangeBuffer()`.\r\n */\r\n removeEntry(documentKey) {\r\n const entry = this.docs.get(documentKey);\r\n if (entry) {\r\n this.docs = this.docs.remove(documentKey);\r\n this.size -= entry.size;\r\n }\r\n }\r\n getEntry(transaction, documentKey) {\r\n const entry = this.docs.get(documentKey);\r\n return PersistencePromise.resolve(entry\r\n ? entry.document.clone()\r\n : MutableDocument.newInvalidDocument(documentKey));\r\n }\r\n getEntries(transaction, documentKeys) {\r\n let results = mutableDocumentMap();\r\n documentKeys.forEach(documentKey => {\r\n const entry = this.docs.get(documentKey);\r\n results = results.insert(documentKey, entry\r\n ? entry.document.clone()\r\n : MutableDocument.newInvalidDocument(documentKey));\r\n });\r\n return PersistencePromise.resolve(results);\r\n }\r\n getDocumentsMatchingQuery(transaction, query, sinceReadTime) {\r\n let results = mutableDocumentMap();\r\n // Documents are ordered by key, so we can use a prefix scan to narrow down\r\n // the documents we need to match the query against.\r\n const prefix = new DocumentKey(query.path.child(''));\r\n const iterator = this.docs.getIteratorFrom(prefix);\r\n while (iterator.hasNext()) {\r\n const { key, value: { document, readTime } } = iterator.getNext();\r\n if (!query.path.isPrefixOf(key.path)) {\r\n break;\r\n }\r\n if (readTime.compareTo(sinceReadTime) <= 0) {\r\n continue;\r\n }\r\n if (!queryMatches(query, document)) {\r\n continue;\r\n }\r\n results = results.insert(document.key, document.clone());\r\n }\r\n return PersistencePromise.resolve(results);\r\n }\r\n forEachDocumentKey(transaction, f) {\r\n return PersistencePromise.forEach(this.docs, (key) => f(key));\r\n }\r\n newChangeBuffer(options) {\r\n // `trackRemovals` is ignores since the MemoryRemoteDocumentCache keeps\r\n // a separate changelog and does not need special handling for removals.\r\n return new MemoryRemoteDocumentChangeBuffer(this);\r\n }\r\n getSize(txn) {\r\n return PersistencePromise.resolve(this.size);\r\n }\r\n}\r\n/**\r\n * Creates a new memory-only RemoteDocumentCache.\r\n *\r\n * @param indexManager - A class that manages collection group indices.\r\n * @param sizer - Used to assess the size of a document. For eager GC, this is\r\n * expected to just return 0 to avoid unnecessarily doing the work of\r\n * calculating the size.\r\n */\r\nfunction newMemoryRemoteDocumentCache(indexManager, sizer) {\r\n return new MemoryRemoteDocumentCacheImpl(indexManager, sizer);\r\n}\r\n/**\r\n * Handles the details of adding and updating documents in the MemoryRemoteDocumentCache.\r\n */\r\nclass MemoryRemoteDocumentChangeBuffer extends RemoteDocumentChangeBuffer {\r\n constructor(documentCache) {\r\n super();\r\n this.documentCache = documentCache;\r\n }\r\n applyChanges(transaction) {\r\n const promises = [];\r\n this.changes.forEach((key, doc) => {\r\n if (doc.document.isValidDocument()) {\r\n promises.push(this.documentCache.addEntry(transaction, doc.document, this.getReadTime(key)));\r\n }\r\n else {\r\n this.documentCache.removeEntry(key);\r\n }\r\n });\r\n return PersistencePromise.waitFor(promises);\r\n }\r\n getFromCache(transaction, documentKey) {\r\n return this.documentCache.getEntry(transaction, documentKey);\r\n }\r\n getAllFromCache(transaction, documentKeys) {\r\n return this.documentCache.getEntries(transaction, documentKeys);\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nclass MemoryTargetCache {\r\n constructor(persistence) {\r\n this.persistence = persistence;\r\n /**\r\n * Maps a target to the data about that target\r\n */\r\n this.targets = new ObjectMap(t => canonifyTarget(t), targetEquals);\r\n /** The last received snapshot version. */\r\n this.lastRemoteSnapshotVersion = SnapshotVersion.min();\r\n /** The highest numbered target ID encountered. */\r\n this.highestTargetId = 0;\r\n /** The highest sequence number encountered. */\r\n this.highestSequenceNumber = 0;\r\n /**\r\n * A ordered bidirectional mapping between documents and the remote target\r\n * IDs.\r\n */\r\n this.references = new ReferenceSet();\r\n this.targetCount = 0;\r\n this.targetIdGenerator = TargetIdGenerator.forTargetCache();\r\n }\r\n forEachTarget(txn, f) {\r\n this.targets.forEach((_, targetData) => f(targetData));\r\n return PersistencePromise.resolve();\r\n }\r\n getLastRemoteSnapshotVersion(transaction) {\r\n return PersistencePromise.resolve(this.lastRemoteSnapshotVersion);\r\n }\r\n getHighestSequenceNumber(transaction) {\r\n return PersistencePromise.resolve(this.highestSequenceNumber);\r\n }\r\n allocateTargetId(transaction) {\r\n this.highestTargetId = this.targetIdGenerator.next();\r\n return PersistencePromise.resolve(this.highestTargetId);\r\n }\r\n setTargetsMetadata(transaction, highestListenSequenceNumber, lastRemoteSnapshotVersion) {\r\n if (lastRemoteSnapshotVersion) {\r\n this.lastRemoteSnapshotVersion = lastRemoteSnapshotVersion;\r\n }\r\n if (highestListenSequenceNumber > this.highestSequenceNumber) {\r\n this.highestSequenceNumber = highestListenSequenceNumber;\r\n }\r\n return PersistencePromise.resolve();\r\n }\r\n saveTargetData(targetData) {\r\n this.targets.set(targetData.target, targetData);\r\n const targetId = targetData.targetId;\r\n if (targetId > this.highestTargetId) {\r\n this.targetIdGenerator = new TargetIdGenerator(targetId);\r\n this.highestTargetId = targetId;\r\n }\r\n if (targetData.sequenceNumber > this.highestSequenceNumber) {\r\n this.highestSequenceNumber = targetData.sequenceNumber;\r\n }\r\n }\r\n addTargetData(transaction, targetData) {\r\n this.saveTargetData(targetData);\r\n this.targetCount += 1;\r\n return PersistencePromise.resolve();\r\n }\r\n updateTargetData(transaction, targetData) {\r\n this.saveTargetData(targetData);\r\n return PersistencePromise.resolve();\r\n }\r\n removeTargetData(transaction, targetData) {\r\n this.targets.delete(targetData.target);\r\n this.references.removeReferencesForId(targetData.targetId);\r\n this.targetCount -= 1;\r\n return PersistencePromise.resolve();\r\n }\r\n removeTargets(transaction, upperBound, activeTargetIds) {\r\n let count = 0;\r\n const removals = [];\r\n this.targets.forEach((key, targetData) => {\r\n if (targetData.sequenceNumber <= upperBound &&\r\n activeTargetIds.get(targetData.targetId) === null) {\r\n this.targets.delete(key);\r\n removals.push(this.removeMatchingKeysForTargetId(transaction, targetData.targetId));\r\n count++;\r\n }\r\n });\r\n return PersistencePromise.waitFor(removals).next(() => count);\r\n }\r\n getTargetCount(transaction) {\r\n return PersistencePromise.resolve(this.targetCount);\r\n }\r\n getTargetData(transaction, target) {\r\n const targetData = this.targets.get(target) || null;\r\n return PersistencePromise.resolve(targetData);\r\n }\r\n addMatchingKeys(txn, keys, targetId) {\r\n this.references.addReferences(keys, targetId);\r\n return PersistencePromise.resolve();\r\n }\r\n removeMatchingKeys(txn, keys, targetId) {\r\n this.references.removeReferences(keys, targetId);\r\n const referenceDelegate = this.persistence.referenceDelegate;\r\n const promises = [];\r\n if (referenceDelegate) {\r\n keys.forEach(key => {\r\n promises.push(referenceDelegate.markPotentiallyOrphaned(txn, key));\r\n });\r\n }\r\n return PersistencePromise.waitFor(promises);\r\n }\r\n removeMatchingKeysForTargetId(txn, targetId) {\r\n this.references.removeReferencesForId(targetId);\r\n return PersistencePromise.resolve();\r\n }\r\n getMatchingKeysForTargetId(txn, targetId) {\r\n const matchingKeys = this.references.referencesForId(targetId);\r\n return PersistencePromise.resolve(matchingKeys);\r\n }\r\n containsKey(txn, key) {\r\n return PersistencePromise.resolve(this.references.containsKey(key));\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst LOG_TAG$b = 'MemoryPersistence';\r\n/**\r\n * A memory-backed instance of Persistence. Data is stored only in RAM and\r\n * not persisted across sessions.\r\n */\r\nclass MemoryPersistence {\r\n /**\r\n * The constructor accepts a factory for creating a reference delegate. This\r\n * allows both the delegate and this instance to have strong references to\r\n * each other without having nullable fields that would then need to be\r\n * checked or asserted on every access.\r\n */\r\n constructor(referenceDelegateFactory, serializer) {\r\n this.mutationQueues = {};\r\n this.listenSequence = new ListenSequence(0);\r\n this._started = false;\r\n this._started = true;\r\n this.referenceDelegate = referenceDelegateFactory(this);\r\n this.targetCache = new MemoryTargetCache(this);\r\n const sizer = (doc) => this.referenceDelegate.documentSize(doc);\r\n this.indexManager = new MemoryIndexManager();\r\n this.remoteDocumentCache = newMemoryRemoteDocumentCache(this.indexManager, sizer);\r\n this.serializer = new LocalSerializer(serializer);\r\n this.bundleCache = new MemoryBundleCache(this.serializer);\r\n }\r\n start() {\r\n return Promise.resolve();\r\n }\r\n shutdown() {\r\n // No durable state to ensure is closed on shutdown.\r\n this._started = false;\r\n return Promise.resolve();\r\n }\r\n get started() {\r\n return this._started;\r\n }\r\n setDatabaseDeletedListener() {\r\n // No op.\r\n }\r\n setNetworkEnabled() {\r\n // No op.\r\n }\r\n getIndexManager() {\r\n return this.indexManager;\r\n }\r\n getMutationQueue(user) {\r\n let queue = this.mutationQueues[user.toKey()];\r\n if (!queue) {\r\n queue = new MemoryMutationQueue(this.indexManager, this.referenceDelegate);\r\n this.mutationQueues[user.toKey()] = queue;\r\n }\r\n return queue;\r\n }\r\n getTargetCache() {\r\n return this.targetCache;\r\n }\r\n getRemoteDocumentCache() {\r\n return this.remoteDocumentCache;\r\n }\r\n getBundleCache() {\r\n return this.bundleCache;\r\n }\r\n runTransaction(action, mode, transactionOperation) {\r\n logDebug(LOG_TAG$b, 'Starting transaction:', action);\r\n const txn = new MemoryTransaction(this.listenSequence.next());\r\n this.referenceDelegate.onTransactionStarted();\r\n return transactionOperation(txn)\r\n .next(result => {\r\n return this.referenceDelegate\r\n .onTransactionCommitted(txn)\r\n .next(() => result);\r\n })\r\n .toPromise()\r\n .then(result => {\r\n txn.raiseOnCommittedEvent();\r\n return result;\r\n });\r\n }\r\n mutationQueuesContainKey(transaction, key) {\r\n return PersistencePromise.or(Object.values(this.mutationQueues).map(queue => () => queue.containsKey(transaction, key)));\r\n }\r\n}\r\n/**\r\n * Memory persistence is not actually transactional, but future implementations\r\n * may have transaction-scoped state.\r\n */\r\nclass MemoryTransaction extends PersistenceTransaction {\r\n constructor(currentSequenceNumber) {\r\n super();\r\n this.currentSequenceNumber = currentSequenceNumber;\r\n }\r\n}\r\nclass MemoryEagerDelegate {\r\n constructor(persistence) {\r\n this.persistence = persistence;\r\n /** Tracks all documents that are active in Query views. */\r\n this.localViewReferences = new ReferenceSet();\r\n /** The list of documents that are potentially GCed after each transaction. */\r\n this._orphanedDocuments = null;\r\n }\r\n static factory(persistence) {\r\n return new MemoryEagerDelegate(persistence);\r\n }\r\n get orphanedDocuments() {\r\n if (!this._orphanedDocuments) {\r\n throw fail();\r\n }\r\n else {\r\n return this._orphanedDocuments;\r\n }\r\n }\r\n addReference(txn, targetId, key) {\r\n this.localViewReferences.addReference(key, targetId);\r\n this.orphanedDocuments.delete(key.toString());\r\n return PersistencePromise.resolve();\r\n }\r\n removeReference(txn, targetId, key) {\r\n this.localViewReferences.removeReference(key, targetId);\r\n this.orphanedDocuments.add(key.toString());\r\n return PersistencePromise.resolve();\r\n }\r\n markPotentiallyOrphaned(txn, key) {\r\n this.orphanedDocuments.add(key.toString());\r\n return PersistencePromise.resolve();\r\n }\r\n removeTarget(txn, targetData) {\r\n const orphaned = this.localViewReferences.removeReferencesForId(targetData.targetId);\r\n orphaned.forEach(key => this.orphanedDocuments.add(key.toString()));\r\n const cache = this.persistence.getTargetCache();\r\n return cache\r\n .getMatchingKeysForTargetId(txn, targetData.targetId)\r\n .next(keys => {\r\n keys.forEach(key => this.orphanedDocuments.add(key.toString()));\r\n })\r\n .next(() => cache.removeTargetData(txn, targetData));\r\n }\r\n onTransactionStarted() {\r\n this._orphanedDocuments = new Set();\r\n }\r\n onTransactionCommitted(txn) {\r\n // Remove newly orphaned documents.\r\n const cache = this.persistence.getRemoteDocumentCache();\r\n const changeBuffer = cache.newChangeBuffer();\r\n return PersistencePromise.forEach(this.orphanedDocuments, (path) => {\r\n const key = DocumentKey.fromPath(path);\r\n return this.isReferenced(txn, key).next(isReferenced => {\r\n if (!isReferenced) {\r\n changeBuffer.removeEntry(key);\r\n }\r\n });\r\n }).next(() => {\r\n this._orphanedDocuments = null;\r\n return changeBuffer.apply(txn);\r\n });\r\n }\r\n updateLimboDocument(txn, key) {\r\n return this.isReferenced(txn, key).next(isReferenced => {\r\n if (isReferenced) {\r\n this.orphanedDocuments.delete(key.toString());\r\n }\r\n else {\r\n this.orphanedDocuments.add(key.toString());\r\n }\r\n });\r\n }\r\n documentSize(doc) {\r\n // For eager GC, we don't care about the document size, there are no size thresholds.\r\n return 0;\r\n }\r\n isReferenced(txn, key) {\r\n return PersistencePromise.or([\r\n () => PersistencePromise.resolve(this.localViewReferences.containsKey(key)),\r\n () => this.persistence.getTargetCache().containsKey(txn, key),\r\n () => this.persistence.mutationQueuesContainKey(txn, key)\r\n ]);\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A query engine that takes advantage of the target document mapping in the\r\n * QueryCache. Query execution is optimized by only reading the documents that\r\n * previously matched a query plus any documents that were edited after the\r\n * query was last listened to.\r\n *\r\n * There are some cases when this optimization is not guaranteed to produce\r\n * the same results as full collection scans. In these cases, query\r\n * processing falls back to full scans. These cases are:\r\n *\r\n * - Limit queries where a document that matched the query previously no longer\r\n * matches the query.\r\n *\r\n * - Limit queries where a document edit may cause the document to sort below\r\n * another document that is in the local cache.\r\n *\r\n * - Queries that have never been CURRENT or free of limbo documents.\r\n */\r\nclass QueryEngine {\r\n /** Sets the document view to query against. */\r\n setLocalDocumentsView(localDocuments) {\r\n this.localDocumentsView = localDocuments;\r\n }\r\n /** Returns all local documents matching the specified query. */\r\n getDocumentsMatchingQuery(transaction, query, lastLimboFreeSnapshotVersion, remoteKeys) {\r\n // Queries that match all documents don't benefit from using\r\n // key-based lookups. It is more efficient to scan all documents in a\r\n // collection, rather than to perform individual lookups.\r\n if (matchesAllDocuments(query)) {\r\n return this.executeFullCollectionScan(transaction, query);\r\n }\r\n // Queries that have never seen a snapshot without limbo free documents\r\n // should also be run as a full collection scan.\r\n if (lastLimboFreeSnapshotVersion.isEqual(SnapshotVersion.min())) {\r\n return this.executeFullCollectionScan(transaction, query);\r\n }\r\n return this.localDocumentsView.getDocuments(transaction, remoteKeys).next(documents => {\r\n const previousResults = this.applyQuery(query, documents);\r\n if ((hasLimitToFirst(query) || hasLimitToLast(query)) &&\r\n this.needsRefill(query.limitType, previousResults, remoteKeys, lastLimboFreeSnapshotVersion)) {\r\n return this.executeFullCollectionScan(transaction, query);\r\n }\r\n if (getLogLevel() <= LogLevel.DEBUG) {\r\n logDebug('QueryEngine', 'Re-using previous result from %s to execute query: %s', lastLimboFreeSnapshotVersion.toString(), stringifyQuery(query));\r\n }\r\n // Retrieve all results for documents that were updated since the last\r\n // limbo-document free remote snapshot.\r\n return this.localDocumentsView.getDocumentsMatchingQuery(transaction, query, lastLimboFreeSnapshotVersion).next(updatedResults => {\r\n // We merge `previousResults` into `updateResults`, since\r\n // `updateResults` is already a DocumentMap. If a document is\r\n // contained in both lists, then its contents are the same.\r\n previousResults.forEach(doc => {\r\n updatedResults = updatedResults.insert(doc.key, doc);\r\n });\r\n return updatedResults;\r\n });\r\n });\r\n }\r\n /** Applies the query filter and sorting to the provided documents. */\r\n applyQuery(query, documents) {\r\n // Sort the documents and re-apply the query filter since previously\r\n // matching documents do not necessarily still match the query.\r\n let queryResults = new SortedSet(newQueryComparator(query));\r\n documents.forEach((_, maybeDoc) => {\r\n if (queryMatches(query, maybeDoc)) {\r\n queryResults = queryResults.add(maybeDoc);\r\n }\r\n });\r\n return queryResults;\r\n }\r\n /**\r\n * Determines if a limit query needs to be refilled from cache, making it\r\n * ineligible for index-free execution.\r\n *\r\n * @param sortedPreviousResults - The documents that matched the query when it\r\n * was last synchronized, sorted by the query's comparator.\r\n * @param remoteKeys - The document keys that matched the query at the last\r\n * snapshot.\r\n * @param limboFreeSnapshotVersion - The version of the snapshot when the\r\n * query was last synchronized.\r\n */\r\n needsRefill(limitType, sortedPreviousResults, remoteKeys, limboFreeSnapshotVersion) {\r\n // The query needs to be refilled if a previously matching document no\r\n // longer matches.\r\n if (remoteKeys.size !== sortedPreviousResults.size) {\r\n return true;\r\n }\r\n // Limit queries are not eligible for index-free query execution if there is\r\n // a potential that an older document from cache now sorts before a document\r\n // that was previously part of the limit. This, however, can only happen if\r\n // the document at the edge of the limit goes out of limit.\r\n // If a document that is not the limit boundary sorts differently,\r\n // the boundary of the limit itself did not change and documents from cache\r\n // will continue to be \"rejected\" by this boundary. Therefore, we can ignore\r\n // any modifications that don't affect the last document.\r\n const docAtLimitEdge = limitType === \"F\" /* First */\r\n ? sortedPreviousResults.last()\r\n : sortedPreviousResults.first();\r\n if (!docAtLimitEdge) {\r\n // We don't need to refill the query if there were already no documents.\r\n return false;\r\n }\r\n return (docAtLimitEdge.hasPendingWrites ||\r\n docAtLimitEdge.version.compareTo(limboFreeSnapshotVersion) > 0);\r\n }\r\n executeFullCollectionScan(transaction, query) {\r\n if (getLogLevel() <= LogLevel.DEBUG) {\r\n logDebug('QueryEngine', 'Using full collection scan to execute query:', stringifyQuery(query));\r\n }\r\n return this.localDocumentsView.getDocumentsMatchingQuery(transaction, query, SnapshotVersion.min());\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// The format of the LocalStorage key that stores the client state is:\r\n// firestore_clients_<persistence_prefix>_<instance_key>\r\nconst CLIENT_STATE_KEY_PREFIX = 'firestore_clients';\r\n/** Assembles the key for a client state in WebStorage */\r\nfunction createWebStorageClientStateKey(persistenceKey, clientId) {\r\n return `${CLIENT_STATE_KEY_PREFIX}_${persistenceKey}_${clientId}`;\r\n}\r\n// The format of the WebStorage key that stores the mutation state is:\r\n// firestore_mutations_<persistence_prefix>_<batch_id>\r\n// (for unauthenticated users)\r\n// or: firestore_mutations_<persistence_prefix>_<batch_id>_<user_uid>\r\n//\r\n// 'user_uid' is last to avoid needing to escape '_' characters that it might\r\n// contain.\r\nconst MUTATION_BATCH_KEY_PREFIX = 'firestore_mutations';\r\n/** Assembles the key for a mutation batch in WebStorage */\r\nfunction createWebStorageMutationBatchKey(persistenceKey, user, batchId) {\r\n let mutationKey = `${MUTATION_BATCH_KEY_PREFIX}_${persistenceKey}_${batchId}`;\r\n if (user.isAuthenticated()) {\r\n mutationKey += `_${user.uid}`;\r\n }\r\n return mutationKey;\r\n}\r\n// The format of the WebStorage key that stores a query target's metadata is:\r\n// firestore_targets_<persistence_prefix>_<target_id>\r\nconst QUERY_TARGET_KEY_PREFIX = 'firestore_targets';\r\n/** Assembles the key for a query state in WebStorage */\r\nfunction createWebStorageQueryTargetMetadataKey(persistenceKey, targetId) {\r\n return `${QUERY_TARGET_KEY_PREFIX}_${persistenceKey}_${targetId}`;\r\n}\r\n// The WebStorage prefix that stores the primary tab's online state. The\r\n// format of the key is:\r\n// firestore_online_state_<persistence_prefix>\r\nconst ONLINE_STATE_KEY_PREFIX = 'firestore_online_state';\r\n/** Assembles the key for the online state of the primary tab. */\r\nfunction createWebStorageOnlineStateKey(persistenceKey) {\r\n return `${ONLINE_STATE_KEY_PREFIX}_${persistenceKey}`;\r\n}\r\n// The WebStorage prefix that plays as a event to indicate the remote documents\r\n// might have changed due to some secondary tabs loading a bundle.\r\n// format of the key is:\r\n// firestore_bundle_loaded_<persistenceKey>\r\nconst BUNDLE_LOADED_KEY_PREFIX = 'firestore_bundle_loaded';\r\nfunction createBundleLoadedKey(persistenceKey) {\r\n return `${BUNDLE_LOADED_KEY_PREFIX}_${persistenceKey}`;\r\n}\r\n// The WebStorage key prefix for the key that stores the last sequence number allocated. The key\r\n// looks like 'firestore_sequence_number_<persistence_prefix>'.\r\nconst SEQUENCE_NUMBER_KEY_PREFIX = 'firestore_sequence_number';\r\n/** Assembles the key for the current sequence number. */\r\nfunction createWebStorageSequenceNumberKey(persistenceKey) {\r\n return `${SEQUENCE_NUMBER_KEY_PREFIX}_${persistenceKey}`;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2018 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst LOG_TAG$a = 'SharedClientState';\r\n/**\r\n * Holds the state of a mutation batch, including its user ID, batch ID and\r\n * whether the batch is 'pending', 'acknowledged' or 'rejected'.\r\n */\r\n// Visible for testing\r\nclass MutationMetadata {\r\n constructor(user, batchId, state, error) {\r\n this.user = user;\r\n this.batchId = batchId;\r\n this.state = state;\r\n this.error = error;\r\n }\r\n /**\r\n * Parses a MutationMetadata from its JSON representation in WebStorage.\r\n * Logs a warning and returns null if the format of the data is not valid.\r\n */\r\n static fromWebStorageEntry(user, batchId, value) {\r\n const mutationBatch = JSON.parse(value);\r\n let validData = typeof mutationBatch === 'object' &&\r\n ['pending', 'acknowledged', 'rejected'].indexOf(mutationBatch.state) !==\r\n -1 &&\r\n (mutationBatch.error === undefined ||\r\n typeof mutationBatch.error === 'object');\r\n let firestoreError = undefined;\r\n if (validData && mutationBatch.error) {\r\n validData =\r\n typeof mutationBatch.error.message === 'string' &&\r\n typeof mutationBatch.error.code === 'string';\r\n if (validData) {\r\n firestoreError = new FirestoreError(mutationBatch.error.code, mutationBatch.error.message);\r\n }\r\n }\r\n if (validData) {\r\n return new MutationMetadata(user, batchId, mutationBatch.state, firestoreError);\r\n }\r\n else {\r\n logError(LOG_TAG$a, `Failed to parse mutation state for ID '${batchId}': ${value}`);\r\n return null;\r\n }\r\n }\r\n toWebStorageJSON() {\r\n const batchMetadata = {\r\n state: this.state,\r\n updateTimeMs: Date.now() // Modify the existing value to trigger update.\r\n };\r\n if (this.error) {\r\n batchMetadata.error = {\r\n code: this.error.code,\r\n message: this.error.message\r\n };\r\n }\r\n return JSON.stringify(batchMetadata);\r\n }\r\n}\r\n/**\r\n * Holds the state of a query target, including its target ID and whether the\r\n * target is 'not-current', 'current' or 'rejected'.\r\n */\r\n// Visible for testing\r\nclass QueryTargetMetadata {\r\n constructor(targetId, state, error) {\r\n this.targetId = targetId;\r\n this.state = state;\r\n this.error = error;\r\n }\r\n /**\r\n * Parses a QueryTargetMetadata from its JSON representation in WebStorage.\r\n * Logs a warning and returns null if the format of the data is not valid.\r\n */\r\n static fromWebStorageEntry(targetId, value) {\r\n const targetState = JSON.parse(value);\r\n let validData = typeof targetState === 'object' &&\r\n ['not-current', 'current', 'rejected'].indexOf(targetState.state) !==\r\n -1 &&\r\n (targetState.error === undefined ||\r\n typeof targetState.error === 'object');\r\n let firestoreError = undefined;\r\n if (validData && targetState.error) {\r\n validData =\r\n typeof targetState.error.message === 'string' &&\r\n typeof targetState.error.code === 'string';\r\n if (validData) {\r\n firestoreError = new FirestoreError(targetState.error.code, targetState.error.message);\r\n }\r\n }\r\n if (validData) {\r\n return new QueryTargetMetadata(targetId, targetState.state, firestoreError);\r\n }\r\n else {\r\n logError(LOG_TAG$a, `Failed to parse target state for ID '${targetId}': ${value}`);\r\n return null;\r\n }\r\n }\r\n toWebStorageJSON() {\r\n const targetState = {\r\n state: this.state,\r\n updateTimeMs: Date.now() // Modify the existing value to trigger update.\r\n };\r\n if (this.error) {\r\n targetState.error = {\r\n code: this.error.code,\r\n message: this.error.message\r\n };\r\n }\r\n return JSON.stringify(targetState);\r\n }\r\n}\r\n/**\r\n * This class represents the immutable ClientState for a client read from\r\n * WebStorage, containing the list of active query targets.\r\n */\r\nclass RemoteClientState {\r\n constructor(clientId, activeTargetIds) {\r\n this.clientId = clientId;\r\n this.activeTargetIds = activeTargetIds;\r\n }\r\n /**\r\n * Parses a RemoteClientState from the JSON representation in WebStorage.\r\n * Logs a warning and returns null if the format of the data is not valid.\r\n */\r\n static fromWebStorageEntry(clientId, value) {\r\n const clientState = JSON.parse(value);\r\n let validData = typeof clientState === 'object' &&\r\n clientState.activeTargetIds instanceof Array;\r\n let activeTargetIdsSet = targetIdSet();\r\n for (let i = 0; validData && i < clientState.activeTargetIds.length; ++i) {\r\n validData = isSafeInteger(clientState.activeTargetIds[i]);\r\n activeTargetIdsSet = activeTargetIdsSet.add(clientState.activeTargetIds[i]);\r\n }\r\n if (validData) {\r\n return new RemoteClientState(clientId, activeTargetIdsSet);\r\n }\r\n else {\r\n logError(LOG_TAG$a, `Failed to parse client data for instance '${clientId}': ${value}`);\r\n return null;\r\n }\r\n }\r\n}\r\n/**\r\n * This class represents the online state for all clients participating in\r\n * multi-tab. The online state is only written to by the primary client, and\r\n * used in secondary clients to update their query views.\r\n */\r\nclass SharedOnlineState {\r\n constructor(clientId, onlineState) {\r\n this.clientId = clientId;\r\n this.onlineState = onlineState;\r\n }\r\n /**\r\n * Parses a SharedOnlineState from its JSON representation in WebStorage.\r\n * Logs a warning and returns null if the format of the data is not valid.\r\n */\r\n static fromWebStorageEntry(value) {\r\n const onlineState = JSON.parse(value);\r\n const validData = typeof onlineState === 'object' &&\r\n ['Unknown', 'Online', 'Offline'].indexOf(onlineState.onlineState) !==\r\n -1 &&\r\n typeof onlineState.clientId === 'string';\r\n if (validData) {\r\n return new SharedOnlineState(onlineState.clientId, onlineState.onlineState);\r\n }\r\n else {\r\n logError(LOG_TAG$a, `Failed to parse online state: ${value}`);\r\n return null;\r\n }\r\n }\r\n}\r\n/**\r\n * Metadata state of the local client. Unlike `RemoteClientState`, this class is\r\n * mutable and keeps track of all pending mutations, which allows us to\r\n * update the range of pending mutation batch IDs as new mutations are added or\r\n * removed.\r\n *\r\n * The data in `LocalClientState` is not read from WebStorage and instead\r\n * updated via its instance methods. The updated state can be serialized via\r\n * `toWebStorageJSON()`.\r\n */\r\n// Visible for testing.\r\nclass LocalClientState {\r\n constructor() {\r\n this.activeTargetIds = targetIdSet();\r\n }\r\n addQueryTarget(targetId) {\r\n this.activeTargetIds = this.activeTargetIds.add(targetId);\r\n }\r\n removeQueryTarget(targetId) {\r\n this.activeTargetIds = this.activeTargetIds.delete(targetId);\r\n }\r\n /**\r\n * Converts this entry into a JSON-encoded format we can use for WebStorage.\r\n * Does not encode `clientId` as it is part of the key in WebStorage.\r\n */\r\n toWebStorageJSON() {\r\n const data = {\r\n activeTargetIds: this.activeTargetIds.toArray(),\r\n updateTimeMs: Date.now() // Modify the existing value to trigger update.\r\n };\r\n return JSON.stringify(data);\r\n }\r\n}\r\n/**\r\n * `WebStorageSharedClientState` uses WebStorage (window.localStorage) as the\r\n * backing store for the SharedClientState. It keeps track of all active\r\n * clients and supports modifications of the local client's data.\r\n */\r\nclass WebStorageSharedClientState {\r\n constructor(window, queue, persistenceKey, localClientId, initialUser) {\r\n this.window = window;\r\n this.queue = queue;\r\n this.persistenceKey = persistenceKey;\r\n this.localClientId = localClientId;\r\n this.syncEngine = null;\r\n this.onlineStateHandler = null;\r\n this.sequenceNumberHandler = null;\r\n this.storageListener = this.handleWebStorageEvent.bind(this);\r\n this.activeClients = new SortedMap(primitiveComparator);\r\n this.started = false;\r\n /**\r\n * Captures WebStorage events that occur before `start()` is called. These\r\n * events are replayed once `WebStorageSharedClientState` is started.\r\n */\r\n this.earlyEvents = [];\r\n // Escape the special characters mentioned here:\r\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions\r\n const escapedPersistenceKey = persistenceKey.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\r\n this.storage = this.window.localStorage;\r\n this.currentUser = initialUser;\r\n this.localClientStorageKey = createWebStorageClientStateKey(this.persistenceKey, this.localClientId);\r\n this.sequenceNumberKey = createWebStorageSequenceNumberKey(this.persistenceKey);\r\n this.activeClients = this.activeClients.insert(this.localClientId, new LocalClientState());\r\n this.clientStateKeyRe = new RegExp(`^${CLIENT_STATE_KEY_PREFIX}_${escapedPersistenceKey}_([^_]*)$`);\r\n this.mutationBatchKeyRe = new RegExp(`^${MUTATION_BATCH_KEY_PREFIX}_${escapedPersistenceKey}_(\\\\d+)(?:_(.*))?$`);\r\n this.queryTargetKeyRe = new RegExp(`^${QUERY_TARGET_KEY_PREFIX}_${escapedPersistenceKey}_(\\\\d+)$`);\r\n this.onlineStateKey = createWebStorageOnlineStateKey(this.persistenceKey);\r\n this.bundleLoadedKey = createBundleLoadedKey(this.persistenceKey);\r\n // Rather than adding the storage observer during start(), we add the\r\n // storage observer during initialization. This ensures that we collect\r\n // events before other components populate their initial state (during their\r\n // respective start() calls). Otherwise, we might for example miss a\r\n // mutation that is added after LocalStore's start() processed the existing\r\n // mutations but before we observe WebStorage events.\r\n this.window.addEventListener('storage', this.storageListener);\r\n }\r\n /** Returns 'true' if WebStorage is available in the current environment. */\r\n static isAvailable(window) {\r\n return !!(window && window.localStorage);\r\n }\r\n async start() {\r\n // Retrieve the list of existing clients to backfill the data in\r\n // SharedClientState.\r\n const existingClients = await this.syncEngine.getActiveClients();\r\n for (const clientId of existingClients) {\r\n if (clientId === this.localClientId) {\r\n continue;\r\n }\r\n const storageItem = this.getItem(createWebStorageClientStateKey(this.persistenceKey, clientId));\r\n if (storageItem) {\r\n const clientState = RemoteClientState.fromWebStorageEntry(clientId, storageItem);\r\n if (clientState) {\r\n this.activeClients = this.activeClients.insert(clientState.clientId, clientState);\r\n }\r\n }\r\n }\r\n this.persistClientState();\r\n // Check if there is an existing online state and call the callback handler\r\n // if applicable.\r\n const onlineStateJSON = this.storage.getItem(this.onlineStateKey);\r\n if (onlineStateJSON) {\r\n const onlineState = this.fromWebStorageOnlineState(onlineStateJSON);\r\n if (onlineState) {\r\n this.handleOnlineStateEvent(onlineState);\r\n }\r\n }\r\n for (const event of this.earlyEvents) {\r\n this.handleWebStorageEvent(event);\r\n }\r\n this.earlyEvents = [];\r\n // Register a window unload hook to remove the client metadata entry from\r\n // WebStorage even if `shutdown()` was not called.\r\n this.window.addEventListener('pagehide', () => this.shutdown());\r\n this.started = true;\r\n }\r\n writeSequenceNumber(sequenceNumber) {\r\n this.setItem(this.sequenceNumberKey, JSON.stringify(sequenceNumber));\r\n }\r\n getAllActiveQueryTargets() {\r\n return this.extractActiveQueryTargets(this.activeClients);\r\n }\r\n isActiveQueryTarget(targetId) {\r\n let found = false;\r\n this.activeClients.forEach((key, value) => {\r\n if (value.activeTargetIds.has(targetId)) {\r\n found = true;\r\n }\r\n });\r\n return found;\r\n }\r\n addPendingMutation(batchId) {\r\n this.persistMutationState(batchId, 'pending');\r\n }\r\n updateMutationState(batchId, state, error) {\r\n this.persistMutationState(batchId, state, error);\r\n // Once a final mutation result is observed by other clients, they no longer\r\n // access the mutation's metadata entry. Since WebStorage replays events\r\n // in order, it is safe to delete the entry right after updating it.\r\n this.removeMutationState(batchId);\r\n }\r\n addLocalQueryTarget(targetId) {\r\n let queryState = 'not-current';\r\n // Lookup an existing query state if the target ID was already registered\r\n // by another tab\r\n if (this.isActiveQueryTarget(targetId)) {\r\n const storageItem = this.storage.getItem(createWebStorageQueryTargetMetadataKey(this.persistenceKey, targetId));\r\n if (storageItem) {\r\n const metadata = QueryTargetMetadata.fromWebStorageEntry(targetId, storageItem);\r\n if (metadata) {\r\n queryState = metadata.state;\r\n }\r\n }\r\n }\r\n this.localClientState.addQueryTarget(targetId);\r\n this.persistClientState();\r\n return queryState;\r\n }\r\n removeLocalQueryTarget(targetId) {\r\n this.localClientState.removeQueryTarget(targetId);\r\n this.persistClientState();\r\n }\r\n isLocalQueryTarget(targetId) {\r\n return this.localClientState.activeTargetIds.has(targetId);\r\n }\r\n clearQueryState(targetId) {\r\n this.removeItem(createWebStorageQueryTargetMetadataKey(this.persistenceKey, targetId));\r\n }\r\n updateQueryState(targetId, state, error) {\r\n this.persistQueryTargetState(targetId, state, error);\r\n }\r\n handleUserChange(user, removedBatchIds, addedBatchIds) {\r\n removedBatchIds.forEach(batchId => {\r\n this.removeMutationState(batchId);\r\n });\r\n this.currentUser = user;\r\n addedBatchIds.forEach(batchId => {\r\n this.addPendingMutation(batchId);\r\n });\r\n }\r\n setOnlineState(onlineState) {\r\n this.persistOnlineState(onlineState);\r\n }\r\n notifyBundleLoaded() {\r\n this.persistBundleLoadedState();\r\n }\r\n shutdown() {\r\n if (this.started) {\r\n this.window.removeEventListener('storage', this.storageListener);\r\n this.removeItem(this.localClientStorageKey);\r\n this.started = false;\r\n }\r\n }\r\n getItem(key) {\r\n const value = this.storage.getItem(key);\r\n logDebug(LOG_TAG$a, 'READ', key, value);\r\n return value;\r\n }\r\n setItem(key, value) {\r\n logDebug(LOG_TAG$a, 'SET', key, value);\r\n this.storage.setItem(key, value);\r\n }\r\n removeItem(key) {\r\n logDebug(LOG_TAG$a, 'REMOVE', key);\r\n this.storage.removeItem(key);\r\n }\r\n handleWebStorageEvent(event) {\r\n // Note: The function is typed to take Event to be interface-compatible with\r\n // `Window.addEventListener`.\r\n const storageEvent = event;\r\n if (storageEvent.storageArea === this.storage) {\r\n logDebug(LOG_TAG$a, 'EVENT', storageEvent.key, storageEvent.newValue);\r\n if (storageEvent.key === this.localClientStorageKey) {\r\n logError('Received WebStorage notification for local change. Another client might have ' +\r\n 'garbage-collected our state');\r\n return;\r\n }\r\n this.queue.enqueueRetryable(async () => {\r\n if (!this.started) {\r\n this.earlyEvents.push(storageEvent);\r\n return;\r\n }\r\n if (storageEvent.key === null) {\r\n return;\r\n }\r\n if (this.clientStateKeyRe.test(storageEvent.key)) {\r\n if (storageEvent.newValue != null) {\r\n const clientState = this.fromWebStorageClientState(storageEvent.key, storageEvent.newValue);\r\n if (clientState) {\r\n return this.handleClientStateEvent(clientState.clientId, clientState);\r\n }\r\n }\r\n else {\r\n const clientId = this.fromWebStorageClientStateKey(storageEvent.key);\r\n return this.handleClientStateEvent(clientId, null);\r\n }\r\n }\r\n else if (this.mutationBatchKeyRe.test(storageEvent.key)) {\r\n if (storageEvent.newValue !== null) {\r\n const mutationMetadata = this.fromWebStorageMutationMetadata(storageEvent.key, storageEvent.newValue);\r\n if (mutationMetadata) {\r\n return this.handleMutationBatchEvent(mutationMetadata);\r\n }\r\n }\r\n }\r\n else if (this.queryTargetKeyRe.test(storageEvent.key)) {\r\n if (storageEvent.newValue !== null) {\r\n const queryTargetMetadata = this.fromWebStorageQueryTargetMetadata(storageEvent.key, storageEvent.newValue);\r\n if (queryTargetMetadata) {\r\n return this.handleQueryTargetEvent(queryTargetMetadata);\r\n }\r\n }\r\n }\r\n else if (storageEvent.key === this.onlineStateKey) {\r\n if (storageEvent.newValue !== null) {\r\n const onlineState = this.fromWebStorageOnlineState(storageEvent.newValue);\r\n if (onlineState) {\r\n return this.handleOnlineStateEvent(onlineState);\r\n }\r\n }\r\n }\r\n else if (storageEvent.key === this.sequenceNumberKey) {\r\n const sequenceNumber = fromWebStorageSequenceNumber(storageEvent.newValue);\r\n if (sequenceNumber !== ListenSequence.INVALID) {\r\n this.sequenceNumberHandler(sequenceNumber);\r\n }\r\n }\r\n else if (storageEvent.key === this.bundleLoadedKey) {\r\n return this.syncEngine.synchronizeWithChangedDocuments();\r\n }\r\n });\r\n }\r\n }\r\n get localClientState() {\r\n return this.activeClients.get(this.localClientId);\r\n }\r\n persistClientState() {\r\n this.setItem(this.localClientStorageKey, this.localClientState.toWebStorageJSON());\r\n }\r\n persistMutationState(batchId, state, error) {\r\n const mutationState = new MutationMetadata(this.currentUser, batchId, state, error);\r\n const mutationKey = createWebStorageMutationBatchKey(this.persistenceKey, this.currentUser, batchId);\r\n this.setItem(mutationKey, mutationState.toWebStorageJSON());\r\n }\r\n removeMutationState(batchId) {\r\n const mutationKey = createWebStorageMutationBatchKey(this.persistenceKey, this.currentUser, batchId);\r\n this.removeItem(mutationKey);\r\n }\r\n persistOnlineState(onlineState) {\r\n const entry = {\r\n clientId: this.localClientId,\r\n onlineState\r\n };\r\n this.storage.setItem(this.onlineStateKey, JSON.stringify(entry));\r\n }\r\n persistQueryTargetState(targetId, state, error) {\r\n const targetKey = createWebStorageQueryTargetMetadataKey(this.persistenceKey, targetId);\r\n const targetMetadata = new QueryTargetMetadata(targetId, state, error);\r\n this.setItem(targetKey, targetMetadata.toWebStorageJSON());\r\n }\r\n persistBundleLoadedState() {\r\n this.setItem(this.bundleLoadedKey, 'value-not-used');\r\n }\r\n /**\r\n * Parses a client state key in WebStorage. Returns null if the key does not\r\n * match the expected key format.\r\n */\r\n fromWebStorageClientStateKey(key) {\r\n const match = this.clientStateKeyRe.exec(key);\r\n return match ? match[1] : null;\r\n }\r\n /**\r\n * Parses a client state in WebStorage. Returns 'null' if the value could not\r\n * be parsed.\r\n */\r\n fromWebStorageClientState(key, value) {\r\n const clientId = this.fromWebStorageClientStateKey(key);\r\n return RemoteClientState.fromWebStorageEntry(clientId, value);\r\n }\r\n /**\r\n * Parses a mutation batch state in WebStorage. Returns 'null' if the value\r\n * could not be parsed.\r\n */\r\n fromWebStorageMutationMetadata(key, value) {\r\n const match = this.mutationBatchKeyRe.exec(key);\r\n const batchId = Number(match[1]);\r\n const userId = match[2] !== undefined ? match[2] : null;\r\n return MutationMetadata.fromWebStorageEntry(new User(userId), batchId, value);\r\n }\r\n /**\r\n * Parses a query target state from WebStorage. Returns 'null' if the value\r\n * could not be parsed.\r\n */\r\n fromWebStorageQueryTargetMetadata(key, value) {\r\n const match = this.queryTargetKeyRe.exec(key);\r\n const targetId = Number(match[1]);\r\n return QueryTargetMetadata.fromWebStorageEntry(targetId, value);\r\n }\r\n /**\r\n * Parses an online state from WebStorage. Returns 'null' if the value\r\n * could not be parsed.\r\n */\r\n fromWebStorageOnlineState(value) {\r\n return SharedOnlineState.fromWebStorageEntry(value);\r\n }\r\n async handleMutationBatchEvent(mutationBatch) {\r\n if (mutationBatch.user.uid !== this.currentUser.uid) {\r\n logDebug(LOG_TAG$a, `Ignoring mutation for non-active user ${mutationBatch.user.uid}`);\r\n return;\r\n }\r\n return this.syncEngine.applyBatchState(mutationBatch.batchId, mutationBatch.state, mutationBatch.error);\r\n }\r\n handleQueryTargetEvent(targetMetadata) {\r\n return this.syncEngine.applyTargetState(targetMetadata.targetId, targetMetadata.state, targetMetadata.error);\r\n }\r\n handleClientStateEvent(clientId, clientState) {\r\n const updatedClients = clientState\r\n ? this.activeClients.insert(clientId, clientState)\r\n : this.activeClients.remove(clientId);\r\n const existingTargets = this.extractActiveQueryTargets(this.activeClients);\r\n const newTargets = this.extractActiveQueryTargets(updatedClients);\r\n const addedTargets = [];\r\n const removedTargets = [];\r\n newTargets.forEach(targetId => {\r\n if (!existingTargets.has(targetId)) {\r\n addedTargets.push(targetId);\r\n }\r\n });\r\n existingTargets.forEach(targetId => {\r\n if (!newTargets.has(targetId)) {\r\n removedTargets.push(targetId);\r\n }\r\n });\r\n return this.syncEngine.applyActiveTargetsChange(addedTargets, removedTargets).then(() => {\r\n this.activeClients = updatedClients;\r\n });\r\n }\r\n handleOnlineStateEvent(onlineState) {\r\n // We check whether the client that wrote this online state is still active\r\n // by comparing its client ID to the list of clients kept active in\r\n // IndexedDb. If a client does not update their IndexedDb client state\r\n // within 5 seconds, it is considered inactive and we don't emit an online\r\n // state event.\r\n if (this.activeClients.get(onlineState.clientId)) {\r\n this.onlineStateHandler(onlineState.onlineState);\r\n }\r\n }\r\n extractActiveQueryTargets(clients) {\r\n let activeTargets = targetIdSet();\r\n clients.forEach((kev, value) => {\r\n activeTargets = activeTargets.unionWith(value.activeTargetIds);\r\n });\r\n return activeTargets;\r\n }\r\n}\r\nfunction fromWebStorageSequenceNumber(seqString) {\r\n let sequenceNumber = ListenSequence.INVALID;\r\n if (seqString != null) {\r\n try {\r\n const parsed = JSON.parse(seqString);\r\n hardAssert(typeof parsed === 'number');\r\n sequenceNumber = parsed;\r\n }\r\n catch (e) {\r\n logError(LOG_TAG$a, 'Failed to read sequence number from WebStorage', e);\r\n }\r\n }\r\n return sequenceNumber;\r\n}\r\n/**\r\n * `MemorySharedClientState` is a simple implementation of SharedClientState for\r\n * clients using memory persistence. The state in this class remains fully\r\n * isolated and no synchronization is performed.\r\n */\r\nclass MemorySharedClientState {\r\n constructor() {\r\n this.localState = new LocalClientState();\r\n this.queryState = {};\r\n this.onlineStateHandler = null;\r\n this.sequenceNumberHandler = null;\r\n }\r\n addPendingMutation(batchId) {\r\n // No op.\r\n }\r\n updateMutationState(batchId, state, error) {\r\n // No op.\r\n }\r\n addLocalQueryTarget(targetId) {\r\n this.localState.addQueryTarget(targetId);\r\n return this.queryState[targetId] || 'not-current';\r\n }\r\n updateQueryState(targetId, state, error) {\r\n this.queryState[targetId] = state;\r\n }\r\n removeLocalQueryTarget(targetId) {\r\n this.localState.removeQueryTarget(targetId);\r\n }\r\n isLocalQueryTarget(targetId) {\r\n return this.localState.activeTargetIds.has(targetId);\r\n }\r\n clearQueryState(targetId) {\r\n delete this.queryState[targetId];\r\n }\r\n getAllActiveQueryTargets() {\r\n return this.localState.activeTargetIds;\r\n }\r\n isActiveQueryTarget(targetId) {\r\n return this.localState.activeTargetIds.has(targetId);\r\n }\r\n start() {\r\n this.localState = new LocalClientState();\r\n return Promise.resolve();\r\n }\r\n handleUserChange(user, removedBatchIds, addedBatchIds) {\r\n // No op.\r\n }\r\n setOnlineState(onlineState) {\r\n // No op.\r\n }\r\n shutdown() { }\r\n writeSequenceNumber(sequenceNumber) { }\r\n notifyBundleLoaded() {\r\n // No op.\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nclass NoopConnectivityMonitor {\r\n addCallback(callback) {\r\n // No-op.\r\n }\r\n shutdown() {\r\n // No-op.\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Provides a simple helper class that implements the Stream interface to\r\n * bridge to other implementations that are streams but do not implement the\r\n * interface. The stream callbacks are invoked with the callOn... methods.\r\n */\r\nclass StreamBridge {\r\n constructor(args) {\r\n this.sendFn = args.sendFn;\r\n this.closeFn = args.closeFn;\r\n }\r\n onOpen(callback) {\r\n this.wrappedOnOpen = callback;\r\n }\r\n onClose(callback) {\r\n this.wrappedOnClose = callback;\r\n }\r\n onMessage(callback) {\r\n this.wrappedOnMessage = callback;\r\n }\r\n close() {\r\n this.closeFn();\r\n }\r\n send(msg) {\r\n this.sendFn(msg);\r\n }\r\n callOnOpen() {\r\n this.wrappedOnOpen();\r\n }\r\n callOnClose(err) {\r\n this.wrappedOnClose(err);\r\n }\r\n callOnMessage(msg) {\r\n this.wrappedOnMessage(msg);\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/*\r\n * Utilities for dealing with node.js-style APIs. See nodePromise for more\r\n * details.\r\n */\r\n/**\r\n * Creates a node-style callback that resolves or rejects a new Promise. The\r\n * callback is passed to the given action which can then use the callback as\r\n * a parameter to a node-style function.\r\n *\r\n * The intent is to directly bridge a node-style function (which takes a\r\n * callback) into a Promise without manually converting between the node-style\r\n * callback and the promise at each call.\r\n *\r\n * In effect it allows you to convert:\r\n *\r\n * @example\r\n * new Promise((resolve: (value?: fs.Stats) => void,\r\n * reject: (error?: any) => void) => {\r\n * fs.stat(path, (error?: any, stat?: fs.Stats) => {\r\n * if (error) {\r\n * reject(error);\r\n * } else {\r\n * resolve(stat);\r\n * }\r\n * });\r\n * });\r\n *\r\n * Into\r\n * @example\r\n * nodePromise((callback: NodeCallback<fs.Stats>) => {\r\n * fs.stat(path, callback);\r\n * });\r\n *\r\n * @param action - a function that takes a node-style callback as an argument\r\n * and then uses that callback to invoke some node-style API.\r\n * @returns a new Promise which will be rejected if the callback is given the\r\n * first Error parameter or will resolve to the value given otherwise.\r\n */\r\nfunction nodePromise(action) {\r\n return new Promise((resolve, reject) => {\r\n action((error, value) => {\r\n if (error) {\r\n reject(error);\r\n }\r\n else {\r\n resolve(value);\r\n }\r\n });\r\n });\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// This is a hack fix for Node ES modules to use `require`.\r\n// @ts-ignore To avoid using `--module es2020` flag.\r\nconst require = module.createRequire(import.meta.url);\r\n// eslint-disable-next-line @typescript-eslint/no-require-imports\r\nconst { version: grpcVersion } = require('@grpc/grpc-js/package.json');\r\nconst LOG_TAG$9 = 'Connection';\r\nconst X_GOOG_API_CLIENT_VALUE = `gl-node/${process.versions.node} fire/${SDK_VERSION} grpc/${grpcVersion}`;\r\nfunction createMetadata(databasePath, token, appId) {\r\n hardAssert(token === null || token.type === 'OAuth');\r\n const metadata = new Metadata();\r\n if (token) {\r\n for (const header in token.authHeaders) {\r\n if (token.authHeaders.hasOwnProperty(header)) {\r\n metadata.set(header, token.authHeaders[header]);\r\n }\r\n }\r\n }\r\n if (appId) {\r\n metadata.set('X-Firebase-GMPID', appId);\r\n }\r\n metadata.set('X-Goog-Api-Client', X_GOOG_API_CLIENT_VALUE);\r\n // This header is used to improve routing and project isolation by the\r\n // backend.\r\n metadata.set('Google-Cloud-Resource-Prefix', databasePath);\r\n return metadata;\r\n}\r\n/**\r\n * A Connection implemented by GRPC-Node.\r\n */\r\nclass GrpcConnection {\r\n constructor(protos, databaseInfo) {\r\n this.databaseInfo = databaseInfo;\r\n // We cache stubs for the most-recently-used token.\r\n this.cachedStub = null;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n this.firestore = protos['google']['firestore']['v1'];\r\n this.databasePath = `projects/${databaseInfo.databaseId.projectId}/databases/${databaseInfo.databaseId.database}`;\r\n }\r\n ensureActiveStub() {\r\n if (!this.cachedStub) {\r\n logDebug(LOG_TAG$9, 'Creating Firestore stub.');\r\n const credentials$1 = this.databaseInfo.ssl\r\n ? credentials.createSsl()\r\n : credentials.createInsecure();\r\n this.cachedStub = new this.firestore.Firestore(this.databaseInfo.host, credentials$1);\r\n }\r\n return this.cachedStub;\r\n }\r\n invokeRPC(rpcName, path, request, token) {\r\n const stub = this.ensureActiveStub();\r\n const metadata = createMetadata(this.databasePath, token, this.databaseInfo.appId);\r\n const jsonRequest = Object.assign({ database: this.databasePath }, request);\r\n return nodePromise((callback) => {\r\n logDebug(LOG_TAG$9, `RPC '${rpcName}' invoked with request:`, request);\r\n return stub[rpcName](jsonRequest, metadata, (grpcError, value) => {\r\n if (grpcError) {\r\n logDebug(LOG_TAG$9, `RPC '${rpcName}' failed with error:`, grpcError);\r\n callback(new FirestoreError(mapCodeFromRpcCode(grpcError.code), grpcError.message));\r\n }\r\n else {\r\n logDebug(LOG_TAG$9, `RPC '${rpcName}' completed with response:`, value);\r\n callback(undefined, value);\r\n }\r\n });\r\n });\r\n }\r\n invokeStreamingRPC(rpcName, path, request, token) {\r\n const results = [];\r\n const responseDeferred = new Deferred();\r\n logDebug(LOG_TAG$9, `RPC '${rpcName}' invoked (streaming) with request:`, request);\r\n const stub = this.ensureActiveStub();\r\n const metadata = createMetadata(this.databasePath, token, this.databaseInfo.appId);\r\n const jsonRequest = Object.assign(Object.assign({}, request), { database: this.databasePath });\r\n const stream = stub[rpcName](jsonRequest, metadata);\r\n stream.on('data', (response) => {\r\n logDebug(LOG_TAG$9, `RPC ${rpcName} received result:`, response);\r\n results.push(response);\r\n });\r\n stream.on('end', () => {\r\n logDebug(LOG_TAG$9, `RPC '${rpcName}' completed.`);\r\n responseDeferred.resolve(results);\r\n });\r\n stream.on('error', (grpcError) => {\r\n logDebug(LOG_TAG$9, `RPC '${rpcName}' failed with error:`, grpcError);\r\n const code = mapCodeFromRpcCode(grpcError.code);\r\n responseDeferred.reject(new FirestoreError(code, grpcError.message));\r\n });\r\n return responseDeferred.promise;\r\n }\r\n // TODO(mikelehen): This \"method\" is a monster. Should be refactored.\r\n openStream(rpcName, token) {\r\n const stub = this.ensureActiveStub();\r\n const metadata = createMetadata(this.databasePath, token, this.databaseInfo.appId);\r\n const grpcStream = stub[rpcName](metadata);\r\n let closed = false;\r\n const close = (err) => {\r\n if (!closed) {\r\n closed = true;\r\n stream.callOnClose(err);\r\n grpcStream.end();\r\n }\r\n };\r\n const stream = new StreamBridge({\r\n sendFn: (msg) => {\r\n if (!closed) {\r\n logDebug(LOG_TAG$9, 'GRPC stream sending:', msg);\r\n try {\r\n grpcStream.write(msg);\r\n }\r\n catch (e) {\r\n // This probably means we didn't conform to the proto. Make sure to\r\n // log the message we sent.\r\n logError('Failure sending:', msg);\r\n logError('Error:', e);\r\n throw e;\r\n }\r\n }\r\n else {\r\n logDebug(LOG_TAG$9, 'Not sending because gRPC stream is closed:', msg);\r\n }\r\n },\r\n closeFn: () => {\r\n logDebug(LOG_TAG$9, 'GRPC stream closed locally via close().');\r\n close();\r\n }\r\n });\r\n grpcStream.on('data', (msg) => {\r\n if (!closed) {\r\n logDebug(LOG_TAG$9, 'GRPC stream received:', msg);\r\n stream.callOnMessage(msg);\r\n }\r\n });\r\n grpcStream.on('end', () => {\r\n logDebug(LOG_TAG$9, 'GRPC stream ended.');\r\n close();\r\n });\r\n grpcStream.on('error', (grpcError) => {\r\n if (!closed) {\r\n logWarn(LOG_TAG$9, 'GRPC stream error. Code:', grpcError.code, 'Message:', grpcError.message);\r\n const code = mapCodeFromRpcCode(grpcError.code);\r\n close(new FirestoreError(code, grpcError.message));\r\n }\r\n });\r\n logDebug(LOG_TAG$9, 'Opening GRPC stream');\r\n // TODO(dimond): Since grpc has no explicit open status (or does it?) we\r\n // simulate an onOpen in the next loop after the stream had it's listeners\r\n // registered\r\n setTimeout(() => {\r\n stream.callOnOpen();\r\n }, 0);\r\n return stream;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/** Used by tests so we can match @grpc/proto-loader behavior. */\r\nconst protoLoaderOptions = {\r\n longs: String,\r\n enums: String,\r\n defaults: true,\r\n oneofs: false\r\n};\r\n/**\r\n * Loads the protocol buffer definitions for Firestore.\r\n *\r\n * @returns The GrpcObject representing our protos.\r\n */\r\nfunction loadProtos() {\r\n const root = resolve(__dirname, \"src/protos\" );\r\n const firestoreProtoFile = join(root, 'google/firestore/v1/firestore.proto');\r\n const packageDefinition = loadSync(firestoreProtoFile, Object.assign(Object.assign({}, protoLoaderOptions), { includeDirs: [root] }));\r\n return loadPackageDefinition(packageDefinition);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/** Loads the GRPC stack */\r\nfunction newConnection(databaseInfo) {\r\n const protos = loadProtos();\r\n return new GrpcConnection(protos, databaseInfo);\r\n}\r\n/** Return the Platform-specific connectivity monitor. */\r\nfunction newConnectivityMonitor() {\r\n return new NoopConnectivityMonitor();\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/** The Platform's 'window' implementation or null if not available. */\r\nfunction getWindow() {\r\n if (process.env.USE_MOCK_PERSISTENCE === 'YES') {\r\n // eslint-disable-next-line no-restricted-globals\r\n return window;\r\n }\r\n return null;\r\n}\r\n/** The Platform's 'document' implementation or null if not available. */\r\nfunction getDocument() {\r\n return null;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction newSerializer(databaseId) {\r\n return new JsonProtoSerializer(databaseId, /* useProto3Json= */ false);\r\n}\r\n/**\r\n * An instance of the Platform's 'TextEncoder' implementation.\r\n */\r\nfunction newTextEncoder() {\r\n return new TextEncoder();\r\n}\r\n/**\r\n * An instance of the Platform's 'TextDecoder' implementation.\r\n */\r\nfunction newTextDecoder() {\r\n return new TextDecoder('utf-8');\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst LOG_TAG$8 = 'ExponentialBackoff';\r\n/**\r\n * Initial backoff time in milliseconds after an error.\r\n * Set to 1s according to https://cloud.google.com/apis/design/errors.\r\n */\r\nconst DEFAULT_BACKOFF_INITIAL_DELAY_MS = 1000;\r\nconst DEFAULT_BACKOFF_FACTOR = 1.5;\r\n/** Maximum backoff time in milliseconds */\r\nconst DEFAULT_BACKOFF_MAX_DELAY_MS = 60 * 1000;\r\n/**\r\n * A helper for running delayed tasks following an exponential backoff curve\r\n * between attempts.\r\n *\r\n * Each delay is made up of a \"base\" delay which follows the exponential\r\n * backoff curve, and a +/- 50% \"jitter\" that is calculated and added to the\r\n * base delay. This prevents clients from accidentally synchronizing their\r\n * delays causing spikes of load to the backend.\r\n */\r\nclass ExponentialBackoff {\r\n constructor(\r\n /**\r\n * The AsyncQueue to run backoff operations on.\r\n */\r\n queue, \r\n /**\r\n * The ID to use when scheduling backoff operations on the AsyncQueue.\r\n */\r\n timerId, \r\n /**\r\n * The initial delay (used as the base delay on the first retry attempt).\r\n * Note that jitter will still be applied, so the actual delay could be as\r\n * little as 0.5*initialDelayMs.\r\n */\r\n initialDelayMs = DEFAULT_BACKOFF_INITIAL_DELAY_MS, \r\n /**\r\n * The multiplier to use to determine the extended base delay after each\r\n * attempt.\r\n */\r\n backoffFactor = DEFAULT_BACKOFF_FACTOR, \r\n /**\r\n * The maximum base delay after which no further backoff is performed.\r\n * Note that jitter will still be applied, so the actual delay could be as\r\n * much as 1.5*maxDelayMs.\r\n */\r\n maxDelayMs = DEFAULT_BACKOFF_MAX_DELAY_MS) {\r\n this.queue = queue;\r\n this.timerId = timerId;\r\n this.initialDelayMs = initialDelayMs;\r\n this.backoffFactor = backoffFactor;\r\n this.maxDelayMs = maxDelayMs;\r\n this.currentBaseMs = 0;\r\n this.timerPromise = null;\r\n /** The last backoff attempt, as epoch milliseconds. */\r\n this.lastAttemptTime = Date.now();\r\n this.reset();\r\n }\r\n /**\r\n * Resets the backoff delay.\r\n *\r\n * The very next backoffAndWait() will have no delay. If it is called again\r\n * (i.e. due to an error), initialDelayMs (plus jitter) will be used, and\r\n * subsequent ones will increase according to the backoffFactor.\r\n */\r\n reset() {\r\n this.currentBaseMs = 0;\r\n }\r\n /**\r\n * Resets the backoff delay to the maximum delay (e.g. for use after a\r\n * RESOURCE_EXHAUSTED error).\r\n */\r\n resetToMax() {\r\n this.currentBaseMs = this.maxDelayMs;\r\n }\r\n /**\r\n * Returns a promise that resolves after currentDelayMs, and increases the\r\n * delay for any subsequent attempts. If there was a pending backoff operation\r\n * already, it will be canceled.\r\n */\r\n backoffAndRun(op) {\r\n // Cancel any pending backoff operation.\r\n this.cancel();\r\n // First schedule using the current base (which may be 0 and should be\r\n // honored as such).\r\n const desiredDelayWithJitterMs = Math.floor(this.currentBaseMs + this.jitterDelayMs());\r\n // Guard against lastAttemptTime being in the future due to a clock change.\r\n const delaySoFarMs = Math.max(0, Date.now() - this.lastAttemptTime);\r\n // Guard against the backoff delay already being past.\r\n const remainingDelayMs = Math.max(0, desiredDelayWithJitterMs - delaySoFarMs);\r\n if (remainingDelayMs > 0) {\r\n logDebug(LOG_TAG$8, `Backing off for ${remainingDelayMs} ms ` +\r\n `(base delay: ${this.currentBaseMs} ms, ` +\r\n `delay with jitter: ${desiredDelayWithJitterMs} ms, ` +\r\n `last attempt: ${delaySoFarMs} ms ago)`);\r\n }\r\n this.timerPromise = this.queue.enqueueAfterDelay(this.timerId, remainingDelayMs, () => {\r\n this.lastAttemptTime = Date.now();\r\n return op();\r\n });\r\n // Apply backoff factor to determine next delay and ensure it is within\r\n // bounds.\r\n this.currentBaseMs *= this.backoffFactor;\r\n if (this.currentBaseMs < this.initialDelayMs) {\r\n this.currentBaseMs = this.initialDelayMs;\r\n }\r\n if (this.currentBaseMs > this.maxDelayMs) {\r\n this.currentBaseMs = this.maxDelayMs;\r\n }\r\n }\r\n skipBackoff() {\r\n if (this.timerPromise !== null) {\r\n this.timerPromise.skipDelay();\r\n this.timerPromise = null;\r\n }\r\n }\r\n cancel() {\r\n if (this.timerPromise !== null) {\r\n this.timerPromise.cancel();\r\n this.timerPromise = null;\r\n }\r\n }\r\n /** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */\r\n jitterDelayMs() {\r\n return (Math.random() - 0.5) * this.currentBaseMs;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst LOG_TAG$7 = 'PersistentStream';\r\n/** The time a stream stays open after it is marked idle. */\r\nconst IDLE_TIMEOUT_MS = 60 * 1000;\r\n/** The time a stream stays open until we consider it healthy. */\r\nconst HEALTHY_TIMEOUT_MS = 10 * 1000;\r\n/**\r\n * A PersistentStream is an abstract base class that represents a streaming RPC\r\n * to the Firestore backend. It's built on top of the connections own support\r\n * for streaming RPCs, and adds several critical features for our clients:\r\n *\r\n * - Exponential backoff on failure\r\n * - Authentication via CredentialsProvider\r\n * - Dispatching all callbacks into the shared worker queue\r\n * - Closing idle streams after 60 seconds of inactivity\r\n *\r\n * Subclasses of PersistentStream implement serialization of models to and\r\n * from the JSON representation of the protocol buffers for a specific\r\n * streaming RPC.\r\n *\r\n * ## Starting and Stopping\r\n *\r\n * Streaming RPCs are stateful and need to be start()ed before messages can\r\n * be sent and received. The PersistentStream will call the onOpen() function\r\n * of the listener once the stream is ready to accept requests.\r\n *\r\n * Should a start() fail, PersistentStream will call the registered onClose()\r\n * listener with a FirestoreError indicating what went wrong.\r\n *\r\n * A PersistentStream can be started and stopped repeatedly.\r\n *\r\n * Generic types:\r\n * SendType: The type of the outgoing message of the underlying\r\n * connection stream\r\n * ReceiveType: The type of the incoming message of the underlying\r\n * connection stream\r\n * ListenerType: The type of the listener that will be used for callbacks\r\n */\r\nclass PersistentStream {\r\n constructor(queue, connectionTimerId, idleTimerId, healthTimerId, connection, credentialsProvider, listener) {\r\n this.queue = queue;\r\n this.idleTimerId = idleTimerId;\r\n this.healthTimerId = healthTimerId;\r\n this.connection = connection;\r\n this.credentialsProvider = credentialsProvider;\r\n this.listener = listener;\r\n this.state = 0 /* Initial */;\r\n /**\r\n * A close count that's incremented every time the stream is closed; used by\r\n * getCloseGuardedDispatcher() to invalidate callbacks that happen after\r\n * close.\r\n */\r\n this.closeCount = 0;\r\n this.idleTimer = null;\r\n this.healthCheck = null;\r\n this.stream = null;\r\n this.backoff = new ExponentialBackoff(queue, connectionTimerId);\r\n }\r\n /**\r\n * Returns true if start() has been called and no error has occurred. True\r\n * indicates the stream is open or in the process of opening (which\r\n * encompasses respecting backoff, getting auth tokens, and starting the\r\n * actual RPC). Use isOpen() to determine if the stream is open and ready for\r\n * outbound requests.\r\n */\r\n isStarted() {\r\n return (this.state === 1 /* Starting */ ||\r\n this.state === 5 /* Backoff */ ||\r\n this.isOpen());\r\n }\r\n /**\r\n * Returns true if the underlying RPC is open (the onOpen() listener has been\r\n * called) and the stream is ready for outbound requests.\r\n */\r\n isOpen() {\r\n return (this.state === 2 /* Open */ ||\r\n this.state === 3 /* Healthy */);\r\n }\r\n /**\r\n * Starts the RPC. Only allowed if isStarted() returns false. The stream is\r\n * not immediately ready for use: onOpen() will be invoked when the RPC is\r\n * ready for outbound requests, at which point isOpen() will return true.\r\n *\r\n * When start returns, isStarted() will return true.\r\n */\r\n start() {\r\n if (this.state === 4 /* Error */) {\r\n this.performBackoff();\r\n return;\r\n }\r\n this.auth();\r\n }\r\n /**\r\n * Stops the RPC. This call is idempotent and allowed regardless of the\r\n * current isStarted() state.\r\n *\r\n * When stop returns, isStarted() and isOpen() will both return false.\r\n */\r\n async stop() {\r\n if (this.isStarted()) {\r\n await this.close(0 /* Initial */);\r\n }\r\n }\r\n /**\r\n * After an error the stream will usually back off on the next attempt to\r\n * start it. If the error warrants an immediate restart of the stream, the\r\n * sender can use this to indicate that the receiver should not back off.\r\n *\r\n * Each error will call the onClose() listener. That function can decide to\r\n * inhibit backoff if required.\r\n */\r\n inhibitBackoff() {\r\n this.state = 0 /* Initial */;\r\n this.backoff.reset();\r\n }\r\n /**\r\n * Marks this stream as idle. If no further actions are performed on the\r\n * stream for one minute, the stream will automatically close itself and\r\n * notify the stream's onClose() handler with Status.OK. The stream will then\r\n * be in a !isStarted() state, requiring the caller to start the stream again\r\n * before further use.\r\n *\r\n * Only streams that are in state 'Open' can be marked idle, as all other\r\n * states imply pending network operations.\r\n */\r\n markIdle() {\r\n // Starts the idle time if we are in state 'Open' and are not yet already\r\n // running a timer (in which case the previous idle timeout still applies).\r\n if (this.isOpen() && this.idleTimer === null) {\r\n this.idleTimer = this.queue.enqueueAfterDelay(this.idleTimerId, IDLE_TIMEOUT_MS, () => this.handleIdleCloseTimer());\r\n }\r\n }\r\n /** Sends a message to the underlying stream. */\r\n sendRequest(msg) {\r\n this.cancelIdleCheck();\r\n this.stream.send(msg);\r\n }\r\n /** Called by the idle timer when the stream should close due to inactivity. */\r\n async handleIdleCloseTimer() {\r\n if (this.isOpen()) {\r\n // When timing out an idle stream there's no reason to force the stream into backoff when\r\n // it restarts so set the stream state to Initial instead of Error.\r\n return this.close(0 /* Initial */);\r\n }\r\n }\r\n /** Marks the stream as active again. */\r\n cancelIdleCheck() {\r\n if (this.idleTimer) {\r\n this.idleTimer.cancel();\r\n this.idleTimer = null;\r\n }\r\n }\r\n /** Cancels the health check delayed operation. */\r\n cancelHealthCheck() {\r\n if (this.healthCheck) {\r\n this.healthCheck.cancel();\r\n this.healthCheck = null;\r\n }\r\n }\r\n /**\r\n * Closes the stream and cleans up as necessary:\r\n *\r\n * * closes the underlying GRPC stream;\r\n * * calls the onClose handler with the given 'error';\r\n * * sets internal stream state to 'finalState';\r\n * * adjusts the backoff timer based on the error\r\n *\r\n * A new stream can be opened by calling start().\r\n *\r\n * @param finalState - the intended state of the stream after closing.\r\n * @param error - the error the connection was closed with.\r\n */\r\n async close(finalState, error) {\r\n // Cancel any outstanding timers (they're guaranteed not to execute).\r\n this.cancelIdleCheck();\r\n this.cancelHealthCheck();\r\n this.backoff.cancel();\r\n // Invalidates any stream-related callbacks (e.g. from auth or the\r\n // underlying stream), guaranteeing they won't execute.\r\n this.closeCount++;\r\n if (finalState !== 4 /* Error */) {\r\n // If this is an intentional close ensure we don't delay our next connection attempt.\r\n this.backoff.reset();\r\n }\r\n else if (error && error.code === Code.RESOURCE_EXHAUSTED) {\r\n // Log the error. (Probably either 'quota exceeded' or 'max queue length reached'.)\r\n logError(error.toString());\r\n logError('Using maximum backoff delay to prevent overloading the backend.');\r\n this.backoff.resetToMax();\r\n }\r\n else if (error &&\r\n error.code === Code.UNAUTHENTICATED &&\r\n this.state !== 3 /* Healthy */) {\r\n // \"unauthenticated\" error means the token was rejected. This should rarely\r\n // happen since both Auth and AppCheck ensure a sufficient TTL when we\r\n // request a token. If a user manually resets their system clock this can\r\n // fail, however. In this case, we should get a Code.UNAUTHENTICATED error\r\n // before we received the first message and we need to invalidate the token\r\n // to ensure that we fetch a new token.\r\n this.credentialsProvider.invalidateToken();\r\n }\r\n // Clean up the underlying stream because we are no longer interested in events.\r\n if (this.stream !== null) {\r\n this.tearDown();\r\n this.stream.close();\r\n this.stream = null;\r\n }\r\n // This state must be assigned before calling onClose() to allow the callback to\r\n // inhibit backoff or otherwise manipulate the state in its non-started state.\r\n this.state = finalState;\r\n // Notify the listener that the stream closed.\r\n await this.listener.onClose(error);\r\n }\r\n /**\r\n * Can be overridden to perform additional cleanup before the stream is closed.\r\n * Calling super.tearDown() is not required.\r\n */\r\n tearDown() { }\r\n auth() {\r\n this.state = 1 /* Starting */;\r\n const dispatchIfNotClosed = this.getCloseGuardedDispatcher(this.closeCount);\r\n // TODO(mikelehen): Just use dispatchIfNotClosed, but see TODO below.\r\n const closeCount = this.closeCount;\r\n this.credentialsProvider.getToken().then(token => {\r\n // Stream can be stopped while waiting for authentication.\r\n // TODO(mikelehen): We really should just use dispatchIfNotClosed\r\n // and let this dispatch onto the queue, but that opened a spec test can\r\n // of worms that I don't want to deal with in this PR.\r\n if (this.closeCount === closeCount) {\r\n // Normally we'd have to schedule the callback on the AsyncQueue.\r\n // However, the following calls are safe to be called outside the\r\n // AsyncQueue since they don't chain asynchronous calls\r\n this.startStream(token);\r\n }\r\n }, (error) => {\r\n dispatchIfNotClosed(() => {\r\n const rpcError = new FirestoreError(Code.UNKNOWN, 'Fetching auth token failed: ' + error.message);\r\n return this.handleStreamClose(rpcError);\r\n });\r\n });\r\n }\r\n startStream(token) {\r\n const dispatchIfNotClosed = this.getCloseGuardedDispatcher(this.closeCount);\r\n this.stream = this.startRpc(token);\r\n this.stream.onOpen(() => {\r\n dispatchIfNotClosed(() => {\r\n this.state = 2 /* Open */;\r\n this.healthCheck = this.queue.enqueueAfterDelay(this.healthTimerId, HEALTHY_TIMEOUT_MS, () => {\r\n if (this.isOpen()) {\r\n this.state = 3 /* Healthy */;\r\n }\r\n return Promise.resolve();\r\n });\r\n return this.listener.onOpen();\r\n });\r\n });\r\n this.stream.onClose((error) => {\r\n dispatchIfNotClosed(() => {\r\n return this.handleStreamClose(error);\r\n });\r\n });\r\n this.stream.onMessage((msg) => {\r\n dispatchIfNotClosed(() => {\r\n return this.onMessage(msg);\r\n });\r\n });\r\n }\r\n performBackoff() {\r\n this.state = 5 /* Backoff */;\r\n this.backoff.backoffAndRun(async () => {\r\n this.state = 0 /* Initial */;\r\n this.start();\r\n });\r\n }\r\n // Visible for tests\r\n handleStreamClose(error) {\r\n logDebug(LOG_TAG$7, `close with error: ${error}`);\r\n this.stream = null;\r\n // In theory the stream could close cleanly, however, in our current model\r\n // we never expect this to happen because if we stop a stream ourselves,\r\n // this callback will never be called. To prevent cases where we retry\r\n // without a backoff accidentally, we set the stream to error in all cases.\r\n return this.close(4 /* Error */, error);\r\n }\r\n /**\r\n * Returns a \"dispatcher\" function that dispatches operations onto the\r\n * AsyncQueue but only runs them if closeCount remains unchanged. This allows\r\n * us to turn auth / stream callbacks into no-ops if the stream is closed /\r\n * re-opened, etc.\r\n */\r\n getCloseGuardedDispatcher(startCloseCount) {\r\n return (fn) => {\r\n this.queue.enqueueAndForget(() => {\r\n if (this.closeCount === startCloseCount) {\r\n return fn();\r\n }\r\n else {\r\n logDebug(LOG_TAG$7, 'stream callback skipped by getCloseGuardedDispatcher.');\r\n return Promise.resolve();\r\n }\r\n });\r\n };\r\n }\r\n}\r\n/**\r\n * A PersistentStream that implements the Listen RPC.\r\n *\r\n * Once the Listen stream has called the onOpen() listener, any number of\r\n * listen() and unlisten() calls can be made to control what changes will be\r\n * sent from the server for ListenResponses.\r\n */\r\nclass PersistentListenStream extends PersistentStream {\r\n constructor(queue, connection, credentials, serializer, listener) {\r\n super(queue, \"listen_stream_connection_backoff\" /* ListenStreamConnectionBackoff */, \"listen_stream_idle\" /* ListenStreamIdle */, \"health_check_timeout\" /* HealthCheckTimeout */, connection, credentials, listener);\r\n this.serializer = serializer;\r\n }\r\n startRpc(token) {\r\n return this.connection.openStream('Listen', token);\r\n }\r\n onMessage(watchChangeProto) {\r\n // A successful response means the stream is healthy\r\n this.backoff.reset();\r\n const watchChange = fromWatchChange(this.serializer, watchChangeProto);\r\n const snapshot = versionFromListenResponse(watchChangeProto);\r\n return this.listener.onWatchChange(watchChange, snapshot);\r\n }\r\n /**\r\n * Registers interest in the results of the given target. If the target\r\n * includes a resumeToken it will be included in the request. Results that\r\n * affect the target will be streamed back as WatchChange messages that\r\n * reference the targetId.\r\n */\r\n watch(targetData) {\r\n const request = {};\r\n request.database = getEncodedDatabaseId(this.serializer);\r\n request.addTarget = toTarget(this.serializer, targetData);\r\n const labels = toListenRequestLabels(this.serializer, targetData);\r\n if (labels) {\r\n request.labels = labels;\r\n }\r\n this.sendRequest(request);\r\n }\r\n /**\r\n * Unregisters interest in the results of the target associated with the\r\n * given targetId.\r\n */\r\n unwatch(targetId) {\r\n const request = {};\r\n request.database = getEncodedDatabaseId(this.serializer);\r\n request.removeTarget = targetId;\r\n this.sendRequest(request);\r\n }\r\n}\r\n/**\r\n * A Stream that implements the Write RPC.\r\n *\r\n * The Write RPC requires the caller to maintain special streamToken\r\n * state in between calls, to help the server understand which responses the\r\n * client has processed by the time the next request is made. Every response\r\n * will contain a streamToken; this value must be passed to the next\r\n * request.\r\n *\r\n * After calling start() on this stream, the next request must be a handshake,\r\n * containing whatever streamToken is on hand. Once a response to this\r\n * request is received, all pending mutations may be submitted. When\r\n * submitting multiple batches of mutations at the same time, it's\r\n * okay to use the same streamToken for the calls to writeMutations.\r\n *\r\n * TODO(b/33271235): Use proto types\r\n */\r\nclass PersistentWriteStream extends PersistentStream {\r\n constructor(queue, connection, credentials, serializer, listener) {\r\n super(queue, \"write_stream_connection_backoff\" /* WriteStreamConnectionBackoff */, \"write_stream_idle\" /* WriteStreamIdle */, \"health_check_timeout\" /* HealthCheckTimeout */, connection, credentials, listener);\r\n this.serializer = serializer;\r\n this.handshakeComplete_ = false;\r\n }\r\n /**\r\n * Tracks whether or not a handshake has been successfully exchanged and\r\n * the stream is ready to accept mutations.\r\n */\r\n get handshakeComplete() {\r\n return this.handshakeComplete_;\r\n }\r\n // Override of PersistentStream.start\r\n start() {\r\n this.handshakeComplete_ = false;\r\n this.lastStreamToken = undefined;\r\n super.start();\r\n }\r\n tearDown() {\r\n if (this.handshakeComplete_) {\r\n this.writeMutations([]);\r\n }\r\n }\r\n startRpc(token) {\r\n return this.connection.openStream('Write', token);\r\n }\r\n onMessage(responseProto) {\r\n // Always capture the last stream token.\r\n hardAssert(!!responseProto.streamToken);\r\n this.lastStreamToken = responseProto.streamToken;\r\n if (!this.handshakeComplete_) {\r\n // The first response is always the handshake response\r\n hardAssert(!responseProto.writeResults || responseProto.writeResults.length === 0);\r\n this.handshakeComplete_ = true;\r\n return this.listener.onHandshakeComplete();\r\n }\r\n else {\r\n // A successful first write response means the stream is healthy,\r\n // Note, that we could consider a successful handshake healthy, however,\r\n // the write itself might be causing an error we want to back off from.\r\n this.backoff.reset();\r\n const results = fromWriteResults(responseProto.writeResults, responseProto.commitTime);\r\n const commitVersion = fromVersion(responseProto.commitTime);\r\n return this.listener.onMutationResult(commitVersion, results);\r\n }\r\n }\r\n /**\r\n * Sends an initial streamToken to the server, performing the handshake\r\n * required to make the StreamingWrite RPC work. Subsequent\r\n * calls should wait until onHandshakeComplete was called.\r\n */\r\n writeHandshake() {\r\n // TODO(dimond): Support stream resumption. We intentionally do not set the\r\n // stream token on the handshake, ignoring any stream token we might have.\r\n const request = {};\r\n request.database = getEncodedDatabaseId(this.serializer);\r\n this.sendRequest(request);\r\n }\r\n /** Sends a group of mutations to the Firestore backend to apply. */\r\n writeMutations(mutations) {\r\n const request = {\r\n streamToken: this.lastStreamToken,\r\n writes: mutations.map(mutation => toMutation(this.serializer, mutation))\r\n };\r\n this.sendRequest(request);\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Datastore and its related methods are a wrapper around the external Google\r\n * Cloud Datastore grpc API, which provides an interface that is more convenient\r\n * for the rest of the client SDK architecture to consume.\r\n */\r\nclass Datastore {\r\n}\r\n/**\r\n * An implementation of Datastore that exposes additional state for internal\r\n * consumption.\r\n */\r\nclass DatastoreImpl extends Datastore {\r\n constructor(credentials, connection, serializer) {\r\n super();\r\n this.credentials = credentials;\r\n this.connection = connection;\r\n this.serializer = serializer;\r\n this.terminated = false;\r\n }\r\n verifyInitialized() {\r\n if (this.terminated) {\r\n throw new FirestoreError(Code.FAILED_PRECONDITION, 'The client has already been terminated.');\r\n }\r\n }\r\n /** Gets an auth token and invokes the provided RPC. */\r\n invokeRPC(rpcName, path, request) {\r\n this.verifyInitialized();\r\n return this.credentials\r\n .getToken()\r\n .then(token => {\r\n return this.connection.invokeRPC(rpcName, path, request, token);\r\n })\r\n .catch((error) => {\r\n if (error.name === 'FirebaseError') {\r\n if (error.code === Code.UNAUTHENTICATED) {\r\n this.credentials.invalidateToken();\r\n }\r\n throw error;\r\n }\r\n else {\r\n throw new FirestoreError(Code.UNKNOWN, error.toString());\r\n }\r\n });\r\n }\r\n /** Gets an auth token and invokes the provided RPC with streamed results. */\r\n invokeStreamingRPC(rpcName, path, request) {\r\n this.verifyInitialized();\r\n return this.credentials\r\n .getToken()\r\n .then(token => {\r\n return this.connection.invokeStreamingRPC(rpcName, path, request, token);\r\n })\r\n .catch((error) => {\r\n if (error.name === 'FirebaseError') {\r\n if (error.code === Code.UNAUTHENTICATED) {\r\n this.credentials.invalidateToken();\r\n }\r\n throw error;\r\n }\r\n else {\r\n throw new FirestoreError(Code.UNKNOWN, error.toString());\r\n }\r\n });\r\n }\r\n terminate() {\r\n this.terminated = true;\r\n }\r\n}\r\n// TODO(firestorexp): Make sure there is only one Datastore instance per\r\n// firestore-exp client.\r\nfunction newDatastore(credentials, connection, serializer) {\r\n return new DatastoreImpl(credentials, connection, serializer);\r\n}\r\nasync function invokeCommitRpc(datastore, mutations) {\r\n const datastoreImpl = debugCast(datastore);\r\n const path = getEncodedDatabaseId(datastoreImpl.serializer) + '/documents';\r\n const request = {\r\n writes: mutations.map(m => toMutation(datastoreImpl.serializer, m))\r\n };\r\n await datastoreImpl.invokeRPC('Commit', path, request);\r\n}\r\nasync function invokeBatchGetDocumentsRpc(datastore, keys) {\r\n const datastoreImpl = debugCast(datastore);\r\n const path = getEncodedDatabaseId(datastoreImpl.serializer) + '/documents';\r\n const request = {\r\n documents: keys.map(k => toName(datastoreImpl.serializer, k))\r\n };\r\n const response = await datastoreImpl.invokeStreamingRPC('BatchGetDocuments', path, request);\r\n const docs = new Map();\r\n response.forEach(proto => {\r\n const doc = fromBatchGetDocumentsResponse(datastoreImpl.serializer, proto);\r\n docs.set(doc.key.toString(), doc);\r\n });\r\n const result = [];\r\n keys.forEach(key => {\r\n const doc = docs.get(key.toString());\r\n hardAssert(!!doc);\r\n result.push(doc);\r\n });\r\n return result;\r\n}\r\nfunction newPersistentWriteStream(datastore, queue, listener) {\r\n const datastoreImpl = debugCast(datastore);\r\n datastoreImpl.verifyInitialized();\r\n return new PersistentWriteStream(queue, datastoreImpl.connection, datastoreImpl.credentials, datastoreImpl.serializer, listener);\r\n}\r\nfunction newPersistentWatchStream(datastore, queue, listener) {\r\n const datastoreImpl = debugCast(datastore);\r\n datastoreImpl.verifyInitialized();\r\n return new PersistentListenStream(queue, datastoreImpl.connection, datastoreImpl.credentials, datastoreImpl.serializer, listener);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2018 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst LOG_TAG$6 = 'OnlineStateTracker';\r\n// To deal with transient failures, we allow multiple stream attempts before\r\n// giving up and transitioning from OnlineState.Unknown to Offline.\r\n// TODO(mikelehen): This used to be set to 2 as a mitigation for b/66228394.\r\n// @jdimond thinks that bug is sufficiently fixed so that we can set this back\r\n// to 1. If that works okay, we could potentially remove this logic entirely.\r\nconst MAX_WATCH_STREAM_FAILURES = 1;\r\n// To deal with stream attempts that don't succeed or fail in a timely manner,\r\n// we have a timeout for OnlineState to reach Online or Offline.\r\n// If the timeout is reached, we transition to Offline rather than waiting\r\n// indefinitely.\r\nconst ONLINE_STATE_TIMEOUT_MS = 10 * 1000;\r\n/**\r\n * A component used by the RemoteStore to track the OnlineState (that is,\r\n * whether or not the client as a whole should be considered to be online or\r\n * offline), implementing the appropriate heuristics.\r\n *\r\n * In particular, when the client is trying to connect to the backend, we\r\n * allow up to MAX_WATCH_STREAM_FAILURES within ONLINE_STATE_TIMEOUT_MS for\r\n * a connection to succeed. If we have too many failures or the timeout elapses,\r\n * then we set the OnlineState to Offline, and the client will behave as if\r\n * it is offline (get()s will return cached data, etc.).\r\n */\r\nclass OnlineStateTracker {\r\n constructor(asyncQueue, onlineStateHandler) {\r\n this.asyncQueue = asyncQueue;\r\n this.onlineStateHandler = onlineStateHandler;\r\n /** The current OnlineState. */\r\n this.state = \"Unknown\" /* Unknown */;\r\n /**\r\n * A count of consecutive failures to open the stream. If it reaches the\r\n * maximum defined by MAX_WATCH_STREAM_FAILURES, we'll set the OnlineState to\r\n * Offline.\r\n */\r\n this.watchStreamFailures = 0;\r\n /**\r\n * A timer that elapses after ONLINE_STATE_TIMEOUT_MS, at which point we\r\n * transition from OnlineState.Unknown to OnlineState.Offline without waiting\r\n * for the stream to actually fail (MAX_WATCH_STREAM_FAILURES times).\r\n */\r\n this.onlineStateTimer = null;\r\n /**\r\n * Whether the client should log a warning message if it fails to connect to\r\n * the backend (initially true, cleared after a successful stream, or if we've\r\n * logged the message already).\r\n */\r\n this.shouldWarnClientIsOffline = true;\r\n }\r\n /**\r\n * Called by RemoteStore when a watch stream is started (including on each\r\n * backoff attempt).\r\n *\r\n * If this is the first attempt, it sets the OnlineState to Unknown and starts\r\n * the onlineStateTimer.\r\n */\r\n handleWatchStreamStart() {\r\n if (this.watchStreamFailures === 0) {\r\n this.setAndBroadcast(\"Unknown\" /* Unknown */);\r\n this.onlineStateTimer = this.asyncQueue.enqueueAfterDelay(\"online_state_timeout\" /* OnlineStateTimeout */, ONLINE_STATE_TIMEOUT_MS, () => {\r\n this.onlineStateTimer = null;\r\n this.logClientOfflineWarningIfNecessary(`Backend didn't respond within ${ONLINE_STATE_TIMEOUT_MS / 1000} ` +\r\n `seconds.`);\r\n this.setAndBroadcast(\"Offline\" /* Offline */);\r\n // NOTE: handleWatchStreamFailure() will continue to increment\r\n // watchStreamFailures even though we are already marked Offline,\r\n // but this is non-harmful.\r\n return Promise.resolve();\r\n });\r\n }\r\n }\r\n /**\r\n * Updates our OnlineState as appropriate after the watch stream reports a\r\n * failure. The first failure moves us to the 'Unknown' state. We then may\r\n * allow multiple failures (based on MAX_WATCH_STREAM_FAILURES) before we\r\n * actually transition to the 'Offline' state.\r\n */\r\n handleWatchStreamFailure(error) {\r\n if (this.state === \"Online\" /* Online */) {\r\n this.setAndBroadcast(\"Unknown\" /* Unknown */);\r\n }\r\n else {\r\n this.watchStreamFailures++;\r\n if (this.watchStreamFailures >= MAX_WATCH_STREAM_FAILURES) {\r\n this.clearOnlineStateTimer();\r\n this.logClientOfflineWarningIfNecessary(`Connection failed ${MAX_WATCH_STREAM_FAILURES} ` +\r\n `times. Most recent error: ${error.toString()}`);\r\n this.setAndBroadcast(\"Offline\" /* Offline */);\r\n }\r\n }\r\n }\r\n /**\r\n * Explicitly sets the OnlineState to the specified state.\r\n *\r\n * Note that this resets our timers / failure counters, etc. used by our\r\n * Offline heuristics, so must not be used in place of\r\n * handleWatchStreamStart() and handleWatchStreamFailure().\r\n */\r\n set(newState) {\r\n this.clearOnlineStateTimer();\r\n this.watchStreamFailures = 0;\r\n if (newState === \"Online\" /* Online */) {\r\n // We've connected to watch at least once. Don't warn the developer\r\n // about being offline going forward.\r\n this.shouldWarnClientIsOffline = false;\r\n }\r\n this.setAndBroadcast(newState);\r\n }\r\n setAndBroadcast(newState) {\r\n if (newState !== this.state) {\r\n this.state = newState;\r\n this.onlineStateHandler(newState);\r\n }\r\n }\r\n logClientOfflineWarningIfNecessary(details) {\r\n const message = `Could not reach Cloud Firestore backend. ${details}\\n` +\r\n `This typically indicates that your device does not have a healthy ` +\r\n `Internet connection at the moment. The client will operate in offline ` +\r\n `mode until it is able to successfully connect to the backend.`;\r\n if (this.shouldWarnClientIsOffline) {\r\n logError(message);\r\n this.shouldWarnClientIsOffline = false;\r\n }\r\n else {\r\n logDebug(LOG_TAG$6, message);\r\n }\r\n }\r\n clearOnlineStateTimer() {\r\n if (this.onlineStateTimer !== null) {\r\n this.onlineStateTimer.cancel();\r\n this.onlineStateTimer = null;\r\n }\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst LOG_TAG$5 = 'RemoteStore';\r\n// TODO(b/35853402): Negotiate this with the stream.\r\nconst MAX_PENDING_WRITES = 10;\r\nclass RemoteStoreImpl {\r\n constructor(\r\n /**\r\n * The local store, used to fill the write pipeline with outbound mutations.\r\n */\r\n localStore, \r\n /** The client-side proxy for interacting with the backend. */\r\n datastore, asyncQueue, onlineStateHandler, connectivityMonitor) {\r\n this.localStore = localStore;\r\n this.datastore = datastore;\r\n this.asyncQueue = asyncQueue;\r\n this.remoteSyncer = {};\r\n /**\r\n * A list of up to MAX_PENDING_WRITES writes that we have fetched from the\r\n * LocalStore via fillWritePipeline() and have or will send to the write\r\n * stream.\r\n *\r\n * Whenever writePipeline.length > 0 the RemoteStore will attempt to start or\r\n * restart the write stream. When the stream is established the writes in the\r\n * pipeline will be sent in order.\r\n *\r\n * Writes remain in writePipeline until they are acknowledged by the backend\r\n * and thus will automatically be re-sent if the stream is interrupted /\r\n * restarted before they're acknowledged.\r\n *\r\n * Write responses from the backend are linked to their originating request\r\n * purely based on order, and so we can just shift() writes from the front of\r\n * the writePipeline as we receive responses.\r\n */\r\n this.writePipeline = [];\r\n /**\r\n * A mapping of watched targets that the client cares about tracking and the\r\n * user has explicitly called a 'listen' for this target.\r\n *\r\n * These targets may or may not have been sent to or acknowledged by the\r\n * server. On re-establishing the listen stream, these targets should be sent\r\n * to the server. The targets removed with unlistens are removed eagerly\r\n * without waiting for confirmation from the listen stream.\r\n */\r\n this.listenTargets = new Map();\r\n /**\r\n * A set of reasons for why the RemoteStore may be offline. If empty, the\r\n * RemoteStore may start its network connections.\r\n */\r\n this.offlineCauses = new Set();\r\n /**\r\n * Event handlers that get called when the network is disabled or enabled.\r\n *\r\n * PORTING NOTE: These functions are used on the Web client to create the\r\n * underlying streams (to support tree-shakeable streams). On Android and iOS,\r\n * the streams are created during construction of RemoteStore.\r\n */\r\n this.onNetworkStatusChange = [];\r\n this.connectivityMonitor = connectivityMonitor;\r\n this.connectivityMonitor.addCallback((_) => {\r\n asyncQueue.enqueueAndForget(async () => {\r\n // Porting Note: Unlike iOS, `restartNetwork()` is called even when the\r\n // network becomes unreachable as we don't have any other way to tear\r\n // down our streams.\r\n if (canUseNetwork(this)) {\r\n logDebug(LOG_TAG$5, 'Restarting streams for network reachability change.');\r\n await restartNetwork(this);\r\n }\r\n });\r\n });\r\n this.onlineStateTracker = new OnlineStateTracker(asyncQueue, onlineStateHandler);\r\n }\r\n}\r\nfunction newRemoteStore(localStore, datastore, asyncQueue, onlineStateHandler, connectivityMonitor) {\r\n return new RemoteStoreImpl(localStore, datastore, asyncQueue, onlineStateHandler, connectivityMonitor);\r\n}\r\n/** Re-enables the network. Idempotent. */\r\nfunction remoteStoreEnableNetwork(remoteStore) {\r\n const remoteStoreImpl = debugCast(remoteStore);\r\n remoteStoreImpl.offlineCauses.delete(0 /* UserDisabled */);\r\n return enableNetworkInternal(remoteStoreImpl);\r\n}\r\nasync function enableNetworkInternal(remoteStoreImpl) {\r\n if (canUseNetwork(remoteStoreImpl)) {\r\n for (const networkStatusHandler of remoteStoreImpl.onNetworkStatusChange) {\r\n await networkStatusHandler(/* enabled= */ true);\r\n }\r\n }\r\n}\r\n/**\r\n * Temporarily disables the network. The network can be re-enabled using\r\n * enableNetwork().\r\n */\r\nasync function remoteStoreDisableNetwork(remoteStore) {\r\n const remoteStoreImpl = debugCast(remoteStore);\r\n remoteStoreImpl.offlineCauses.add(0 /* UserDisabled */);\r\n await disableNetworkInternal(remoteStoreImpl);\r\n // Set the OnlineState to Offline so get()s return from cache, etc.\r\n remoteStoreImpl.onlineStateTracker.set(\"Offline\" /* Offline */);\r\n}\r\nasync function disableNetworkInternal(remoteStoreImpl) {\r\n for (const networkStatusHandler of remoteStoreImpl.onNetworkStatusChange) {\r\n await networkStatusHandler(/* enabled= */ false);\r\n }\r\n}\r\nasync function remoteStoreShutdown(remoteStore) {\r\n const remoteStoreImpl = debugCast(remoteStore);\r\n logDebug(LOG_TAG$5, 'RemoteStore shutting down.');\r\n remoteStoreImpl.offlineCauses.add(5 /* Shutdown */);\r\n await disableNetworkInternal(remoteStoreImpl);\r\n remoteStoreImpl.connectivityMonitor.shutdown();\r\n // Set the OnlineState to Unknown (rather than Offline) to avoid potentially\r\n // triggering spurious listener events with cached data, etc.\r\n remoteStoreImpl.onlineStateTracker.set(\"Unknown\" /* Unknown */);\r\n}\r\n/**\r\n * Starts new listen for the given target. Uses resume token if provided. It\r\n * is a no-op if the target of given `TargetData` is already being listened to.\r\n */\r\nfunction remoteStoreListen(remoteStore, targetData) {\r\n const remoteStoreImpl = debugCast(remoteStore);\r\n if (remoteStoreImpl.listenTargets.has(targetData.targetId)) {\r\n return;\r\n }\r\n // Mark this as something the client is currently listening for.\r\n remoteStoreImpl.listenTargets.set(targetData.targetId, targetData);\r\n if (shouldStartWatchStream(remoteStoreImpl)) {\r\n // The listen will be sent in onWatchStreamOpen\r\n startWatchStream(remoteStoreImpl);\r\n }\r\n else if (ensureWatchStream(remoteStoreImpl).isOpen()) {\r\n sendWatchRequest(remoteStoreImpl, targetData);\r\n }\r\n}\r\n/**\r\n * Removes the listen from server. It is a no-op if the given target id is\r\n * not being listened to.\r\n */\r\nfunction remoteStoreUnlisten(remoteStore, targetId) {\r\n const remoteStoreImpl = debugCast(remoteStore);\r\n const watchStream = ensureWatchStream(remoteStoreImpl);\r\n remoteStoreImpl.listenTargets.delete(targetId);\r\n if (watchStream.isOpen()) {\r\n sendUnwatchRequest(remoteStoreImpl, targetId);\r\n }\r\n if (remoteStoreImpl.listenTargets.size === 0) {\r\n if (watchStream.isOpen()) {\r\n watchStream.markIdle();\r\n }\r\n else if (canUseNetwork(remoteStoreImpl)) {\r\n // Revert to OnlineState.Unknown if the watch stream is not open and we\r\n // have no listeners, since without any listens to send we cannot\r\n // confirm if the stream is healthy and upgrade to OnlineState.Online.\r\n remoteStoreImpl.onlineStateTracker.set(\"Unknown\" /* Unknown */);\r\n }\r\n }\r\n}\r\n/**\r\n * We need to increment the the expected number of pending responses we're due\r\n * from watch so we wait for the ack to process any messages from this target.\r\n */\r\nfunction sendWatchRequest(remoteStoreImpl, targetData) {\r\n remoteStoreImpl.watchChangeAggregator.recordPendingTargetRequest(targetData.targetId);\r\n ensureWatchStream(remoteStoreImpl).watch(targetData);\r\n}\r\n/**\r\n * We need to increment the expected number of pending responses we're due\r\n * from watch so we wait for the removal on the server before we process any\r\n * messages from this target.\r\n */\r\nfunction sendUnwatchRequest(remoteStoreImpl, targetId) {\r\n remoteStoreImpl.watchChangeAggregator.recordPendingTargetRequest(targetId);\r\n ensureWatchStream(remoteStoreImpl).unwatch(targetId);\r\n}\r\nfunction startWatchStream(remoteStoreImpl) {\r\n remoteStoreImpl.watchChangeAggregator = new WatchChangeAggregator({\r\n getRemoteKeysForTarget: targetId => remoteStoreImpl.remoteSyncer.getRemoteKeysForTarget(targetId),\r\n getTargetDataForTarget: targetId => remoteStoreImpl.listenTargets.get(targetId) || null\r\n });\r\n ensureWatchStream(remoteStoreImpl).start();\r\n remoteStoreImpl.onlineStateTracker.handleWatchStreamStart();\r\n}\r\n/**\r\n * Returns whether the watch stream should be started because it's necessary\r\n * and has not yet been started.\r\n */\r\nfunction shouldStartWatchStream(remoteStoreImpl) {\r\n return (canUseNetwork(remoteStoreImpl) &&\r\n !ensureWatchStream(remoteStoreImpl).isStarted() &&\r\n remoteStoreImpl.listenTargets.size > 0);\r\n}\r\nfunction canUseNetwork(remoteStore) {\r\n const remoteStoreImpl = debugCast(remoteStore);\r\n return remoteStoreImpl.offlineCauses.size === 0;\r\n}\r\nfunction cleanUpWatchStreamState(remoteStoreImpl) {\r\n remoteStoreImpl.watchChangeAggregator = undefined;\r\n}\r\nasync function onWatchStreamOpen(remoteStoreImpl) {\r\n remoteStoreImpl.listenTargets.forEach((targetData, targetId) => {\r\n sendWatchRequest(remoteStoreImpl, targetData);\r\n });\r\n}\r\nasync function onWatchStreamClose(remoteStoreImpl, error) {\r\n cleanUpWatchStreamState(remoteStoreImpl);\r\n // If we still need the watch stream, retry the connection.\r\n if (shouldStartWatchStream(remoteStoreImpl)) {\r\n remoteStoreImpl.onlineStateTracker.handleWatchStreamFailure(error);\r\n startWatchStream(remoteStoreImpl);\r\n }\r\n else {\r\n // No need to restart watch stream because there are no active targets.\r\n // The online state is set to unknown because there is no active attempt\r\n // at establishing a connection\r\n remoteStoreImpl.onlineStateTracker.set(\"Unknown\" /* Unknown */);\r\n }\r\n}\r\nasync function onWatchStreamChange(remoteStoreImpl, watchChange, snapshotVersion) {\r\n // Mark the client as online since we got a message from the server\r\n remoteStoreImpl.onlineStateTracker.set(\"Online\" /* Online */);\r\n if (watchChange instanceof WatchTargetChange &&\r\n watchChange.state === 2 /* Removed */ &&\r\n watchChange.cause) {\r\n // There was an error on a target, don't wait for a consistent snapshot\r\n // to raise events\r\n try {\r\n await handleTargetError(remoteStoreImpl, watchChange);\r\n }\r\n catch (e) {\r\n logDebug(LOG_TAG$5, 'Failed to remove targets %s: %s ', watchChange.targetIds.join(','), e);\r\n await disableNetworkUntilRecovery(remoteStoreImpl, e);\r\n }\r\n return;\r\n }\r\n if (watchChange instanceof DocumentWatchChange) {\r\n remoteStoreImpl.watchChangeAggregator.handleDocumentChange(watchChange);\r\n }\r\n else if (watchChange instanceof ExistenceFilterChange) {\r\n remoteStoreImpl.watchChangeAggregator.handleExistenceFilter(watchChange);\r\n }\r\n else {\r\n remoteStoreImpl.watchChangeAggregator.handleTargetChange(watchChange);\r\n }\r\n if (!snapshotVersion.isEqual(SnapshotVersion.min())) {\r\n try {\r\n const lastRemoteSnapshotVersion = await localStoreGetLastRemoteSnapshotVersion(remoteStoreImpl.localStore);\r\n if (snapshotVersion.compareTo(lastRemoteSnapshotVersion) >= 0) {\r\n // We have received a target change with a global snapshot if the snapshot\r\n // version is not equal to SnapshotVersion.min().\r\n await raiseWatchSnapshot(remoteStoreImpl, snapshotVersion);\r\n }\r\n }\r\n catch (e) {\r\n logDebug(LOG_TAG$5, 'Failed to raise snapshot:', e);\r\n await disableNetworkUntilRecovery(remoteStoreImpl, e);\r\n }\r\n }\r\n}\r\n/**\r\n * Recovery logic for IndexedDB errors that takes the network offline until\r\n * `op` succeeds. Retries are scheduled with backoff using\r\n * `enqueueRetryable()`. If `op()` is not provided, IndexedDB access is\r\n * validated via a generic operation.\r\n *\r\n * The returned Promise is resolved once the network is disabled and before\r\n * any retry attempt.\r\n */\r\nasync function disableNetworkUntilRecovery(remoteStoreImpl, e, op) {\r\n if (isIndexedDbTransactionError(e)) {\r\n remoteStoreImpl.offlineCauses.add(1 /* IndexedDbFailed */);\r\n // Disable network and raise offline snapshots\r\n await disableNetworkInternal(remoteStoreImpl);\r\n remoteStoreImpl.onlineStateTracker.set(\"Offline\" /* Offline */);\r\n if (!op) {\r\n // Use a simple read operation to determine if IndexedDB recovered.\r\n // Ideally, we would expose a health check directly on SimpleDb, but\r\n // RemoteStore only has access to persistence through LocalStore.\r\n op = () => localStoreGetLastRemoteSnapshotVersion(remoteStoreImpl.localStore);\r\n }\r\n // Probe IndexedDB periodically and re-enable network\r\n remoteStoreImpl.asyncQueue.enqueueRetryable(async () => {\r\n logDebug(LOG_TAG$5, 'Retrying IndexedDB access');\r\n await op();\r\n remoteStoreImpl.offlineCauses.delete(1 /* IndexedDbFailed */);\r\n await enableNetworkInternal(remoteStoreImpl);\r\n });\r\n }\r\n else {\r\n throw e;\r\n }\r\n}\r\n/**\r\n * Executes `op`. If `op` fails, takes the network offline until `op`\r\n * succeeds. Returns after the first attempt.\r\n */\r\nfunction executeWithRecovery(remoteStoreImpl, op) {\r\n return op().catch(e => disableNetworkUntilRecovery(remoteStoreImpl, e, op));\r\n}\r\n/**\r\n * Takes a batch of changes from the Datastore, repackages them as a\r\n * RemoteEvent, and passes that on to the listener, which is typically the\r\n * SyncEngine.\r\n */\r\nfunction raiseWatchSnapshot(remoteStoreImpl, snapshotVersion) {\r\n const remoteEvent = remoteStoreImpl.watchChangeAggregator.createRemoteEvent(snapshotVersion);\r\n // Update in-memory resume tokens. LocalStore will update the\r\n // persistent view of these when applying the completed RemoteEvent.\r\n remoteEvent.targetChanges.forEach((change, targetId) => {\r\n if (change.resumeToken.approximateByteSize() > 0) {\r\n const targetData = remoteStoreImpl.listenTargets.get(targetId);\r\n // A watched target might have been removed already.\r\n if (targetData) {\r\n remoteStoreImpl.listenTargets.set(targetId, targetData.withResumeToken(change.resumeToken, snapshotVersion));\r\n }\r\n }\r\n });\r\n // Re-establish listens for the targets that have been invalidated by\r\n // existence filter mismatches.\r\n remoteEvent.targetMismatches.forEach(targetId => {\r\n const targetData = remoteStoreImpl.listenTargets.get(targetId);\r\n if (!targetData) {\r\n // A watched target might have been removed already.\r\n return;\r\n }\r\n // Clear the resume token for the target, since we're in a known mismatch\r\n // state.\r\n remoteStoreImpl.listenTargets.set(targetId, targetData.withResumeToken(ByteString.EMPTY_BYTE_STRING, targetData.snapshotVersion));\r\n // Cause a hard reset by unwatching and rewatching immediately, but\r\n // deliberately don't send a resume token so that we get a full update.\r\n sendUnwatchRequest(remoteStoreImpl, targetId);\r\n // Mark the target we send as being on behalf of an existence filter\r\n // mismatch, but don't actually retain that in listenTargets. This ensures\r\n // that we flag the first re-listen this way without impacting future\r\n // listens of this target (that might happen e.g. on reconnect).\r\n const requestTargetData = new TargetData(targetData.target, targetId, 1 /* ExistenceFilterMismatch */, targetData.sequenceNumber);\r\n sendWatchRequest(remoteStoreImpl, requestTargetData);\r\n });\r\n return remoteStoreImpl.remoteSyncer.applyRemoteEvent(remoteEvent);\r\n}\r\n/** Handles an error on a target */\r\nasync function handleTargetError(remoteStoreImpl, watchChange) {\r\n const error = watchChange.cause;\r\n for (const targetId of watchChange.targetIds) {\r\n // A watched target might have been removed already.\r\n if (remoteStoreImpl.listenTargets.has(targetId)) {\r\n await remoteStoreImpl.remoteSyncer.rejectListen(targetId, error);\r\n remoteStoreImpl.listenTargets.delete(targetId);\r\n remoteStoreImpl.watchChangeAggregator.removeTarget(targetId);\r\n }\r\n }\r\n}\r\n/**\r\n * Attempts to fill our write pipeline with writes from the LocalStore.\r\n *\r\n * Called internally to bootstrap or refill the write pipeline and by\r\n * SyncEngine whenever there are new mutations to process.\r\n *\r\n * Starts the write stream if necessary.\r\n */\r\nasync function fillWritePipeline(remoteStore) {\r\n const remoteStoreImpl = debugCast(remoteStore);\r\n const writeStream = ensureWriteStream(remoteStoreImpl);\r\n let lastBatchIdRetrieved = remoteStoreImpl.writePipeline.length > 0\r\n ? remoteStoreImpl.writePipeline[remoteStoreImpl.writePipeline.length - 1]\r\n .batchId\r\n : BATCHID_UNKNOWN;\r\n while (canAddToWritePipeline(remoteStoreImpl)) {\r\n try {\r\n const batch = await localStoreGetNextMutationBatch(remoteStoreImpl.localStore, lastBatchIdRetrieved);\r\n if (batch === null) {\r\n if (remoteStoreImpl.writePipeline.length === 0) {\r\n writeStream.markIdle();\r\n }\r\n break;\r\n }\r\n else {\r\n lastBatchIdRetrieved = batch.batchId;\r\n addToWritePipeline(remoteStoreImpl, batch);\r\n }\r\n }\r\n catch (e) {\r\n await disableNetworkUntilRecovery(remoteStoreImpl, e);\r\n }\r\n }\r\n if (shouldStartWriteStream(remoteStoreImpl)) {\r\n startWriteStream(remoteStoreImpl);\r\n }\r\n}\r\n/**\r\n * Returns true if we can add to the write pipeline (i.e. the network is\r\n * enabled and the write pipeline is not full).\r\n */\r\nfunction canAddToWritePipeline(remoteStoreImpl) {\r\n return (canUseNetwork(remoteStoreImpl) &&\r\n remoteStoreImpl.writePipeline.length < MAX_PENDING_WRITES);\r\n}\r\n/**\r\n * Queues additional writes to be sent to the write stream, sending them\r\n * immediately if the write stream is established.\r\n */\r\nfunction addToWritePipeline(remoteStoreImpl, batch) {\r\n remoteStoreImpl.writePipeline.push(batch);\r\n const writeStream = ensureWriteStream(remoteStoreImpl);\r\n if (writeStream.isOpen() && writeStream.handshakeComplete) {\r\n writeStream.writeMutations(batch.mutations);\r\n }\r\n}\r\nfunction shouldStartWriteStream(remoteStoreImpl) {\r\n return (canUseNetwork(remoteStoreImpl) &&\r\n !ensureWriteStream(remoteStoreImpl).isStarted() &&\r\n remoteStoreImpl.writePipeline.length > 0);\r\n}\r\nfunction startWriteStream(remoteStoreImpl) {\r\n ensureWriteStream(remoteStoreImpl).start();\r\n}\r\nasync function onWriteStreamOpen(remoteStoreImpl) {\r\n ensureWriteStream(remoteStoreImpl).writeHandshake();\r\n}\r\nasync function onWriteHandshakeComplete(remoteStoreImpl) {\r\n const writeStream = ensureWriteStream(remoteStoreImpl);\r\n // Send the write pipeline now that the stream is established.\r\n for (const batch of remoteStoreImpl.writePipeline) {\r\n writeStream.writeMutations(batch.mutations);\r\n }\r\n}\r\nasync function onMutationResult(remoteStoreImpl, commitVersion, results) {\r\n const batch = remoteStoreImpl.writePipeline.shift();\r\n const success = MutationBatchResult.from(batch, commitVersion, results);\r\n await executeWithRecovery(remoteStoreImpl, () => remoteStoreImpl.remoteSyncer.applySuccessfulWrite(success));\r\n // It's possible that with the completion of this mutation another\r\n // slot has freed up.\r\n await fillWritePipeline(remoteStoreImpl);\r\n}\r\nasync function onWriteStreamClose(remoteStoreImpl, error) {\r\n // If the write stream closed after the write handshake completes, a write\r\n // operation failed and we fail the pending operation.\r\n if (error && ensureWriteStream(remoteStoreImpl).handshakeComplete) {\r\n // This error affects the actual write.\r\n await handleWriteError(remoteStoreImpl, error);\r\n }\r\n // The write stream might have been started by refilling the write\r\n // pipeline for failed writes\r\n if (shouldStartWriteStream(remoteStoreImpl)) {\r\n startWriteStream(remoteStoreImpl);\r\n }\r\n}\r\nasync function handleWriteError(remoteStoreImpl, error) {\r\n // Only handle permanent errors here. If it's transient, just let the retry\r\n // logic kick in.\r\n if (isPermanentWriteError(error.code)) {\r\n // This was a permanent error, the request itself was the problem\r\n // so it's not going to succeed if we resend it.\r\n const batch = remoteStoreImpl.writePipeline.shift();\r\n // In this case it's also unlikely that the server itself is melting\r\n // down -- this was just a bad request so inhibit backoff on the next\r\n // restart.\r\n ensureWriteStream(remoteStoreImpl).inhibitBackoff();\r\n await executeWithRecovery(remoteStoreImpl, () => remoteStoreImpl.remoteSyncer.rejectFailedWrite(batch.batchId, error));\r\n // It's possible that with the completion of this mutation\r\n // another slot has freed up.\r\n await fillWritePipeline(remoteStoreImpl);\r\n }\r\n}\r\nasync function restartNetwork(remoteStore) {\r\n const remoteStoreImpl = debugCast(remoteStore);\r\n remoteStoreImpl.offlineCauses.add(4 /* ConnectivityChange */);\r\n await disableNetworkInternal(remoteStoreImpl);\r\n remoteStoreImpl.onlineStateTracker.set(\"Unknown\" /* Unknown */);\r\n remoteStoreImpl.offlineCauses.delete(4 /* ConnectivityChange */);\r\n await enableNetworkInternal(remoteStoreImpl);\r\n}\r\nasync function remoteStoreHandleCredentialChange(remoteStore, user) {\r\n const remoteStoreImpl = debugCast(remoteStore);\r\n remoteStoreImpl.asyncQueue.verifyOperationInProgress();\r\n logDebug(LOG_TAG$5, 'RemoteStore received new credentials');\r\n const usesNetwork = canUseNetwork(remoteStoreImpl);\r\n // Tear down and re-create our network streams. This will ensure we get a\r\n // fresh auth token for the new user and re-fill the write pipeline with\r\n // new mutations from the LocalStore (since mutations are per-user).\r\n remoteStoreImpl.offlineCauses.add(3 /* CredentialChange */);\r\n await disableNetworkInternal(remoteStoreImpl);\r\n if (usesNetwork) {\r\n // Don't set the network status to Unknown if we are offline.\r\n remoteStoreImpl.onlineStateTracker.set(\"Unknown\" /* Unknown */);\r\n }\r\n await remoteStoreImpl.remoteSyncer.handleCredentialChange(user);\r\n remoteStoreImpl.offlineCauses.delete(3 /* CredentialChange */);\r\n await enableNetworkInternal(remoteStoreImpl);\r\n}\r\n/**\r\n * Toggles the network state when the client gains or loses its primary lease.\r\n */\r\nasync function remoteStoreApplyPrimaryState(remoteStore, isPrimary) {\r\n const remoteStoreImpl = debugCast(remoteStore);\r\n if (isPrimary) {\r\n remoteStoreImpl.offlineCauses.delete(2 /* IsSecondary */);\r\n await enableNetworkInternal(remoteStoreImpl);\r\n }\r\n else if (!isPrimary) {\r\n remoteStoreImpl.offlineCauses.add(2 /* IsSecondary */);\r\n await disableNetworkInternal(remoteStoreImpl);\r\n remoteStoreImpl.onlineStateTracker.set(\"Unknown\" /* Unknown */);\r\n }\r\n}\r\n/**\r\n * If not yet initialized, registers the WatchStream and its network state\r\n * callback with `remoteStoreImpl`. Returns the existing stream if one is\r\n * already available.\r\n *\r\n * PORTING NOTE: On iOS and Android, the WatchStream gets registered on startup.\r\n * This is not done on Web to allow it to be tree-shaken.\r\n */\r\nfunction ensureWatchStream(remoteStoreImpl) {\r\n if (!remoteStoreImpl.watchStream) {\r\n // Create stream (but note that it is not started yet).\r\n remoteStoreImpl.watchStream = newPersistentWatchStream(remoteStoreImpl.datastore, remoteStoreImpl.asyncQueue, {\r\n onOpen: onWatchStreamOpen.bind(null, remoteStoreImpl),\r\n onClose: onWatchStreamClose.bind(null, remoteStoreImpl),\r\n onWatchChange: onWatchStreamChange.bind(null, remoteStoreImpl)\r\n });\r\n remoteStoreImpl.onNetworkStatusChange.push(async (enabled) => {\r\n if (enabled) {\r\n remoteStoreImpl.watchStream.inhibitBackoff();\r\n if (shouldStartWatchStream(remoteStoreImpl)) {\r\n startWatchStream(remoteStoreImpl);\r\n }\r\n else {\r\n remoteStoreImpl.onlineStateTracker.set(\"Unknown\" /* Unknown */);\r\n }\r\n }\r\n else {\r\n await remoteStoreImpl.watchStream.stop();\r\n cleanUpWatchStreamState(remoteStoreImpl);\r\n }\r\n });\r\n }\r\n return remoteStoreImpl.watchStream;\r\n}\r\n/**\r\n * If not yet initialized, registers the WriteStream and its network state\r\n * callback with `remoteStoreImpl`. Returns the existing stream if one is\r\n * already available.\r\n *\r\n * PORTING NOTE: On iOS and Android, the WriteStream gets registered on startup.\r\n * This is not done on Web to allow it to be tree-shaken.\r\n */\r\nfunction ensureWriteStream(remoteStoreImpl) {\r\n if (!remoteStoreImpl.writeStream) {\r\n // Create stream (but note that it is not started yet).\r\n remoteStoreImpl.writeStream = newPersistentWriteStream(remoteStoreImpl.datastore, remoteStoreImpl.asyncQueue, {\r\n onOpen: onWriteStreamOpen.bind(null, remoteStoreImpl),\r\n onClose: onWriteStreamClose.bind(null, remoteStoreImpl),\r\n onHandshakeComplete: onWriteHandshakeComplete.bind(null, remoteStoreImpl),\r\n onMutationResult: onMutationResult.bind(null, remoteStoreImpl)\r\n });\r\n remoteStoreImpl.onNetworkStatusChange.push(async (enabled) => {\r\n if (enabled) {\r\n remoteStoreImpl.writeStream.inhibitBackoff();\r\n // This will start the write stream if necessary.\r\n await fillWritePipeline(remoteStoreImpl);\r\n }\r\n else {\r\n await remoteStoreImpl.writeStream.stop();\r\n if (remoteStoreImpl.writePipeline.length > 0) {\r\n logDebug(LOG_TAG$5, `Stopping write stream with ${remoteStoreImpl.writePipeline.length} pending writes`);\r\n remoteStoreImpl.writePipeline = [];\r\n }\r\n }\r\n });\r\n }\r\n return remoteStoreImpl.writeStream;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst LOG_TAG$4 = 'AsyncQueue';\r\n/**\r\n * Represents an operation scheduled to be run in the future on an AsyncQueue.\r\n *\r\n * It is created via DelayedOperation.createAndSchedule().\r\n *\r\n * Supports cancellation (via cancel()) and early execution (via skipDelay()).\r\n *\r\n * Note: We implement `PromiseLike` instead of `Promise`, as the `Promise` type\r\n * in newer versions of TypeScript defines `finally`, which is not available in\r\n * IE.\r\n */\r\nclass DelayedOperation {\r\n constructor(asyncQueue, timerId, targetTimeMs, op, removalCallback) {\r\n this.asyncQueue = asyncQueue;\r\n this.timerId = timerId;\r\n this.targetTimeMs = targetTimeMs;\r\n this.op = op;\r\n this.removalCallback = removalCallback;\r\n this.deferred = new Deferred();\r\n this.then = this.deferred.promise.then.bind(this.deferred.promise);\r\n // It's normal for the deferred promise to be canceled (due to cancellation)\r\n // and so we attach a dummy catch callback to avoid\r\n // 'UnhandledPromiseRejectionWarning' log spam.\r\n this.deferred.promise.catch(err => { });\r\n }\r\n /**\r\n * Creates and returns a DelayedOperation that has been scheduled to be\r\n * executed on the provided asyncQueue after the provided delayMs.\r\n *\r\n * @param asyncQueue - The queue to schedule the operation on.\r\n * @param id - A Timer ID identifying the type of operation this is.\r\n * @param delayMs - The delay (ms) before the operation should be scheduled.\r\n * @param op - The operation to run.\r\n * @param removalCallback - A callback to be called synchronously once the\r\n * operation is executed or canceled, notifying the AsyncQueue to remove it\r\n * from its delayedOperations list.\r\n * PORTING NOTE: This exists to prevent making removeDelayedOperation() and\r\n * the DelayedOperation class public.\r\n */\r\n static createAndSchedule(asyncQueue, timerId, delayMs, op, removalCallback) {\r\n const targetTime = Date.now() + delayMs;\r\n const delayedOp = new DelayedOperation(asyncQueue, timerId, targetTime, op, removalCallback);\r\n delayedOp.start(delayMs);\r\n return delayedOp;\r\n }\r\n /**\r\n * Starts the timer. This is called immediately after construction by\r\n * createAndSchedule().\r\n */\r\n start(delayMs) {\r\n this.timerHandle = setTimeout(() => this.handleDelayElapsed(), delayMs);\r\n }\r\n /**\r\n * Queues the operation to run immediately (if it hasn't already been run or\r\n * canceled).\r\n */\r\n skipDelay() {\r\n return this.handleDelayElapsed();\r\n }\r\n /**\r\n * Cancels the operation if it hasn't already been executed or canceled. The\r\n * promise will be rejected.\r\n *\r\n * As long as the operation has not yet been run, calling cancel() provides a\r\n * guarantee that the operation will not be run.\r\n */\r\n cancel(reason) {\r\n if (this.timerHandle !== null) {\r\n this.clearTimeout();\r\n this.deferred.reject(new FirestoreError(Code.CANCELLED, 'Operation cancelled' + (reason ? ': ' + reason : '')));\r\n }\r\n }\r\n handleDelayElapsed() {\r\n this.asyncQueue.enqueueAndForget(() => {\r\n if (this.timerHandle !== null) {\r\n this.clearTimeout();\r\n return this.op().then(result => {\r\n return this.deferred.resolve(result);\r\n });\r\n }\r\n else {\r\n return Promise.resolve();\r\n }\r\n });\r\n }\r\n clearTimeout() {\r\n if (this.timerHandle !== null) {\r\n this.removalCallback(this);\r\n clearTimeout(this.timerHandle);\r\n this.timerHandle = null;\r\n }\r\n }\r\n}\r\n/**\r\n * Returns a FirestoreError that can be surfaced to the user if the provided\r\n * error is an IndexedDbTransactionError. Re-throws the error otherwise.\r\n */\r\nfunction wrapInUserErrorIfRecoverable(e, msg) {\r\n logError(LOG_TAG$4, `${msg}: ${e}`);\r\n if (isIndexedDbTransactionError(e)) {\r\n return new FirestoreError(Code.UNAVAILABLE, `${msg}: ${e}`);\r\n }\r\n else {\r\n throw e;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * DocumentSet is an immutable (copy-on-write) collection that holds documents\r\n * in order specified by the provided comparator. We always add a document key\r\n * comparator on top of what is provided to guarantee document equality based on\r\n * the key.\r\n */\r\nclass DocumentSet {\r\n /** The default ordering is by key if the comparator is omitted */\r\n constructor(comp) {\r\n // We are adding document key comparator to the end as it's the only\r\n // guaranteed unique property of a document.\r\n if (comp) {\r\n this.comparator = (d1, d2) => comp(d1, d2) || DocumentKey.comparator(d1.key, d2.key);\r\n }\r\n else {\r\n this.comparator = (d1, d2) => DocumentKey.comparator(d1.key, d2.key);\r\n }\r\n this.keyedMap = documentMap();\r\n this.sortedSet = new SortedMap(this.comparator);\r\n }\r\n /**\r\n * Returns an empty copy of the existing DocumentSet, using the same\r\n * comparator.\r\n */\r\n static emptySet(oldSet) {\r\n return new DocumentSet(oldSet.comparator);\r\n }\r\n has(key) {\r\n return this.keyedMap.get(key) != null;\r\n }\r\n get(key) {\r\n return this.keyedMap.get(key);\r\n }\r\n first() {\r\n return this.sortedSet.minKey();\r\n }\r\n last() {\r\n return this.sortedSet.maxKey();\r\n }\r\n isEmpty() {\r\n return this.sortedSet.isEmpty();\r\n }\r\n /**\r\n * Returns the index of the provided key in the document set, or -1 if the\r\n * document key is not present in the set;\r\n */\r\n indexOf(key) {\r\n const doc = this.keyedMap.get(key);\r\n return doc ? this.sortedSet.indexOf(doc) : -1;\r\n }\r\n get size() {\r\n return this.sortedSet.size;\r\n }\r\n /** Iterates documents in order defined by \"comparator\" */\r\n forEach(cb) {\r\n this.sortedSet.inorderTraversal((k, v) => {\r\n cb(k);\r\n return false;\r\n });\r\n }\r\n /** Inserts or updates a document with the same key */\r\n add(doc) {\r\n // First remove the element if we have it.\r\n const set = this.delete(doc.key);\r\n return set.copy(set.keyedMap.insert(doc.key, doc), set.sortedSet.insert(doc, null));\r\n }\r\n /** Deletes a document with a given key */\r\n delete(key) {\r\n const doc = this.get(key);\r\n if (!doc) {\r\n return this;\r\n }\r\n return this.copy(this.keyedMap.remove(key), this.sortedSet.remove(doc));\r\n }\r\n isEqual(other) {\r\n if (!(other instanceof DocumentSet)) {\r\n return false;\r\n }\r\n if (this.size !== other.size) {\r\n return false;\r\n }\r\n const thisIt = this.sortedSet.getIterator();\r\n const otherIt = other.sortedSet.getIterator();\r\n while (thisIt.hasNext()) {\r\n const thisDoc = thisIt.getNext().key;\r\n const otherDoc = otherIt.getNext().key;\r\n if (!thisDoc.isEqual(otherDoc)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n toString() {\r\n const docStrings = [];\r\n this.forEach(doc => {\r\n docStrings.push(doc.toString());\r\n });\r\n if (docStrings.length === 0) {\r\n return 'DocumentSet ()';\r\n }\r\n else {\r\n return 'DocumentSet (\\n ' + docStrings.join(' \\n') + '\\n)';\r\n }\r\n }\r\n copy(keyedMap, sortedSet) {\r\n const newSet = new DocumentSet();\r\n newSet.comparator = this.comparator;\r\n newSet.keyedMap = keyedMap;\r\n newSet.sortedSet = sortedSet;\r\n return newSet;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * DocumentChangeSet keeps track of a set of changes to docs in a query, merging\r\n * duplicate events for the same doc.\r\n */\r\nclass DocumentChangeSet {\r\n constructor() {\r\n this.changeMap = new SortedMap(DocumentKey.comparator);\r\n }\r\n track(change) {\r\n const key = change.doc.key;\r\n const oldChange = this.changeMap.get(key);\r\n if (!oldChange) {\r\n this.changeMap = this.changeMap.insert(key, change);\r\n return;\r\n }\r\n // Merge the new change with the existing change.\r\n if (change.type !== 0 /* Added */ &&\r\n oldChange.type === 3 /* Metadata */) {\r\n this.changeMap = this.changeMap.insert(key, change);\r\n }\r\n else if (change.type === 3 /* Metadata */ &&\r\n oldChange.type !== 1 /* Removed */) {\r\n this.changeMap = this.changeMap.insert(key, {\r\n type: oldChange.type,\r\n doc: change.doc\r\n });\r\n }\r\n else if (change.type === 2 /* Modified */ &&\r\n oldChange.type === 2 /* Modified */) {\r\n this.changeMap = this.changeMap.insert(key, {\r\n type: 2 /* Modified */,\r\n doc: change.doc\r\n });\r\n }\r\n else if (change.type === 2 /* Modified */ &&\r\n oldChange.type === 0 /* Added */) {\r\n this.changeMap = this.changeMap.insert(key, {\r\n type: 0 /* Added */,\r\n doc: change.doc\r\n });\r\n }\r\n else if (change.type === 1 /* Removed */ &&\r\n oldChange.type === 0 /* Added */) {\r\n this.changeMap = this.changeMap.remove(key);\r\n }\r\n else if (change.type === 1 /* Removed */ &&\r\n oldChange.type === 2 /* Modified */) {\r\n this.changeMap = this.changeMap.insert(key, {\r\n type: 1 /* Removed */,\r\n doc: oldChange.doc\r\n });\r\n }\r\n else if (change.type === 0 /* Added */ &&\r\n oldChange.type === 1 /* Removed */) {\r\n this.changeMap = this.changeMap.insert(key, {\r\n type: 2 /* Modified */,\r\n doc: change.doc\r\n });\r\n }\r\n else {\r\n // This includes these cases, which don't make sense:\r\n // Added->Added\r\n // Removed->Removed\r\n // Modified->Added\r\n // Removed->Modified\r\n // Metadata->Added\r\n // Removed->Metadata\r\n fail();\r\n }\r\n }\r\n getChanges() {\r\n const changes = [];\r\n this.changeMap.inorderTraversal((key, change) => {\r\n changes.push(change);\r\n });\r\n return changes;\r\n }\r\n}\r\nclass ViewSnapshot {\r\n constructor(query, docs, oldDocs, docChanges, mutatedKeys, fromCache, syncStateChanged, excludesMetadataChanges) {\r\n this.query = query;\r\n this.docs = docs;\r\n this.oldDocs = oldDocs;\r\n this.docChanges = docChanges;\r\n this.mutatedKeys = mutatedKeys;\r\n this.fromCache = fromCache;\r\n this.syncStateChanged = syncStateChanged;\r\n this.excludesMetadataChanges = excludesMetadataChanges;\r\n }\r\n /** Returns a view snapshot as if all documents in the snapshot were added. */\r\n static fromInitialDocuments(query, documents, mutatedKeys, fromCache) {\r\n const changes = [];\r\n documents.forEach(doc => {\r\n changes.push({ type: 0 /* Added */, doc });\r\n });\r\n return new ViewSnapshot(query, documents, DocumentSet.emptySet(documents), changes, mutatedKeys, fromCache, \r\n /* syncStateChanged= */ true, \r\n /* excludesMetadataChanges= */ false);\r\n }\r\n get hasPendingWrites() {\r\n return !this.mutatedKeys.isEmpty();\r\n }\r\n isEqual(other) {\r\n if (this.fromCache !== other.fromCache ||\r\n this.syncStateChanged !== other.syncStateChanged ||\r\n !this.mutatedKeys.isEqual(other.mutatedKeys) ||\r\n !queryEquals(this.query, other.query) ||\r\n !this.docs.isEqual(other.docs) ||\r\n !this.oldDocs.isEqual(other.oldDocs)) {\r\n return false;\r\n }\r\n const changes = this.docChanges;\r\n const otherChanges = other.docChanges;\r\n if (changes.length !== otherChanges.length) {\r\n return false;\r\n }\r\n for (let i = 0; i < changes.length; i++) {\r\n if (changes[i].type !== otherChanges[i].type ||\r\n !changes[i].doc.isEqual(otherChanges[i].doc)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Holds the listeners and the last received ViewSnapshot for a query being\r\n * tracked by EventManager.\r\n */\r\nclass QueryListenersInfo {\r\n constructor() {\r\n this.viewSnap = undefined;\r\n this.listeners = [];\r\n }\r\n}\r\nfunction newEventManager() {\r\n return new EventManagerImpl();\r\n}\r\nclass EventManagerImpl {\r\n constructor() {\r\n this.queries = new ObjectMap(q => canonifyQuery(q), queryEquals);\r\n this.onlineState = \"Unknown\" /* Unknown */;\r\n this.snapshotsInSyncListeners = new Set();\r\n }\r\n}\r\nasync function eventManagerListen(eventManager, listener) {\r\n const eventManagerImpl = debugCast(eventManager);\r\n const query = listener.query;\r\n let firstListen = false;\r\n let queryInfo = eventManagerImpl.queries.get(query);\r\n if (!queryInfo) {\r\n firstListen = true;\r\n queryInfo = new QueryListenersInfo();\r\n }\r\n if (firstListen) {\r\n try {\r\n queryInfo.viewSnap = await eventManagerImpl.onListen(query);\r\n }\r\n catch (e) {\r\n const firestoreError = wrapInUserErrorIfRecoverable(e, `Initialization of query '${stringifyQuery(listener.query)}' failed`);\r\n listener.onError(firestoreError);\r\n return;\r\n }\r\n }\r\n eventManagerImpl.queries.set(query, queryInfo);\r\n queryInfo.listeners.push(listener);\r\n // Run global snapshot listeners if a consistent snapshot has been emitted.\r\n listener.applyOnlineStateChange(eventManagerImpl.onlineState);\r\n if (queryInfo.viewSnap) {\r\n const raisedEvent = listener.onViewSnapshot(queryInfo.viewSnap);\r\n if (raisedEvent) {\r\n raiseSnapshotsInSyncEvent(eventManagerImpl);\r\n }\r\n }\r\n}\r\nasync function eventManagerUnlisten(eventManager, listener) {\r\n const eventManagerImpl = debugCast(eventManager);\r\n const query = listener.query;\r\n let lastListen = false;\r\n const queryInfo = eventManagerImpl.queries.get(query);\r\n if (queryInfo) {\r\n const i = queryInfo.listeners.indexOf(listener);\r\n if (i >= 0) {\r\n queryInfo.listeners.splice(i, 1);\r\n lastListen = queryInfo.listeners.length === 0;\r\n }\r\n }\r\n if (lastListen) {\r\n eventManagerImpl.queries.delete(query);\r\n return eventManagerImpl.onUnlisten(query);\r\n }\r\n}\r\nfunction eventManagerOnWatchChange(eventManager, viewSnaps) {\r\n const eventManagerImpl = debugCast(eventManager);\r\n let raisedEvent = false;\r\n for (const viewSnap of viewSnaps) {\r\n const query = viewSnap.query;\r\n const queryInfo = eventManagerImpl.queries.get(query);\r\n if (queryInfo) {\r\n for (const listener of queryInfo.listeners) {\r\n if (listener.onViewSnapshot(viewSnap)) {\r\n raisedEvent = true;\r\n }\r\n }\r\n queryInfo.viewSnap = viewSnap;\r\n }\r\n }\r\n if (raisedEvent) {\r\n raiseSnapshotsInSyncEvent(eventManagerImpl);\r\n }\r\n}\r\nfunction eventManagerOnWatchError(eventManager, query, error) {\r\n const eventManagerImpl = debugCast(eventManager);\r\n const queryInfo = eventManagerImpl.queries.get(query);\r\n if (queryInfo) {\r\n for (const listener of queryInfo.listeners) {\r\n listener.onError(error);\r\n }\r\n }\r\n // Remove all listeners. NOTE: We don't need to call syncEngine.unlisten()\r\n // after an error.\r\n eventManagerImpl.queries.delete(query);\r\n}\r\nfunction eventManagerOnOnlineStateChange(eventManager, onlineState) {\r\n const eventManagerImpl = debugCast(eventManager);\r\n eventManagerImpl.onlineState = onlineState;\r\n let raisedEvent = false;\r\n eventManagerImpl.queries.forEach((_, queryInfo) => {\r\n for (const listener of queryInfo.listeners) {\r\n // Run global snapshot listeners if a consistent snapshot has been emitted.\r\n if (listener.applyOnlineStateChange(onlineState)) {\r\n raisedEvent = true;\r\n }\r\n }\r\n });\r\n if (raisedEvent) {\r\n raiseSnapshotsInSyncEvent(eventManagerImpl);\r\n }\r\n}\r\nfunction addSnapshotsInSyncListener(eventManager, observer) {\r\n const eventManagerImpl = debugCast(eventManager);\r\n eventManagerImpl.snapshotsInSyncListeners.add(observer);\r\n // Immediately fire an initial event, indicating all existing listeners\r\n // are in-sync.\r\n observer.next();\r\n}\r\nfunction removeSnapshotsInSyncListener(eventManager, observer) {\r\n const eventManagerImpl = debugCast(eventManager);\r\n eventManagerImpl.snapshotsInSyncListeners.delete(observer);\r\n}\r\n// Call all global snapshot listeners that have been set.\r\nfunction raiseSnapshotsInSyncEvent(eventManagerImpl) {\r\n eventManagerImpl.snapshotsInSyncListeners.forEach(observer => {\r\n observer.next();\r\n });\r\n}\r\n/**\r\n * QueryListener takes a series of internal view snapshots and determines\r\n * when to raise the event.\r\n *\r\n * It uses an Observer to dispatch events.\r\n */\r\nclass QueryListener {\r\n constructor(query, queryObserver, options) {\r\n this.query = query;\r\n this.queryObserver = queryObserver;\r\n /**\r\n * Initial snapshots (e.g. from cache) may not be propagated to the wrapped\r\n * observer. This flag is set to true once we've actually raised an event.\r\n */\r\n this.raisedInitialEvent = false;\r\n this.snap = null;\r\n this.onlineState = \"Unknown\" /* Unknown */;\r\n this.options = options || {};\r\n }\r\n /**\r\n * Applies the new ViewSnapshot to this listener, raising a user-facing event\r\n * if applicable (depending on what changed, whether the user has opted into\r\n * metadata-only changes, etc.). Returns true if a user-facing event was\r\n * indeed raised.\r\n */\r\n onViewSnapshot(snap) {\r\n if (!this.options.includeMetadataChanges) {\r\n // Remove the metadata only changes.\r\n const docChanges = [];\r\n for (const docChange of snap.docChanges) {\r\n if (docChange.type !== 3 /* Metadata */) {\r\n docChanges.push(docChange);\r\n }\r\n }\r\n snap = new ViewSnapshot(snap.query, snap.docs, snap.oldDocs, docChanges, snap.mutatedKeys, snap.fromCache, snap.syncStateChanged, \r\n /* excludesMetadataChanges= */ true);\r\n }\r\n let raisedEvent = false;\r\n if (!this.raisedInitialEvent) {\r\n if (this.shouldRaiseInitialEvent(snap, this.onlineState)) {\r\n this.raiseInitialEvent(snap);\r\n raisedEvent = true;\r\n }\r\n }\r\n else if (this.shouldRaiseEvent(snap)) {\r\n this.queryObserver.next(snap);\r\n raisedEvent = true;\r\n }\r\n this.snap = snap;\r\n return raisedEvent;\r\n }\r\n onError(error) {\r\n this.queryObserver.error(error);\r\n }\r\n /** Returns whether a snapshot was raised. */\r\n applyOnlineStateChange(onlineState) {\r\n this.onlineState = onlineState;\r\n let raisedEvent = false;\r\n if (this.snap &&\r\n !this.raisedInitialEvent &&\r\n this.shouldRaiseInitialEvent(this.snap, onlineState)) {\r\n this.raiseInitialEvent(this.snap);\r\n raisedEvent = true;\r\n }\r\n return raisedEvent;\r\n }\r\n shouldRaiseInitialEvent(snap, onlineState) {\r\n // Always raise the first event when we're synced\r\n if (!snap.fromCache) {\r\n return true;\r\n }\r\n // NOTE: We consider OnlineState.Unknown as online (it should become Offline\r\n // or Online if we wait long enough).\r\n const maybeOnline = onlineState !== \"Offline\" /* Offline */;\r\n // Don't raise the event if we're online, aren't synced yet (checked\r\n // above) and are waiting for a sync.\r\n if (this.options.waitForSyncWhenOnline && maybeOnline) {\r\n return false;\r\n }\r\n // Raise data from cache if we have any documents or we are offline\r\n return !snap.docs.isEmpty() || onlineState === \"Offline\" /* Offline */;\r\n }\r\n shouldRaiseEvent(snap) {\r\n // We don't need to handle includeDocumentMetadataChanges here because\r\n // the Metadata only changes have already been stripped out if needed.\r\n // At this point the only changes we will see are the ones we should\r\n // propagate.\r\n if (snap.docChanges.length > 0) {\r\n return true;\r\n }\r\n const hasPendingWritesChanged = this.snap && this.snap.hasPendingWrites !== snap.hasPendingWrites;\r\n if (snap.syncStateChanged || hasPendingWritesChanged) {\r\n return this.options.includeMetadataChanges === true;\r\n }\r\n // Generally we should have hit one of the cases above, but it's possible\r\n // to get here if there were only metadata docChanges and they got\r\n // stripped out.\r\n return false;\r\n }\r\n raiseInitialEvent(snap) {\r\n snap = ViewSnapshot.fromInitialDocuments(snap.query, snap.docs, snap.mutatedKeys, snap.fromCache);\r\n this.raisedInitialEvent = true;\r\n this.queryObserver.next(snap);\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A set of changes to what documents are currently in view and out of view for\r\n * a given query. These changes are sent to the LocalStore by the View (via\r\n * the SyncEngine) and are used to pin / unpin documents as appropriate.\r\n */\r\nclass LocalViewChanges {\r\n constructor(targetId, fromCache, addedKeys, removedKeys) {\r\n this.targetId = targetId;\r\n this.fromCache = fromCache;\r\n this.addedKeys = addedKeys;\r\n this.removedKeys = removedKeys;\r\n }\r\n static fromSnapshot(targetId, viewSnapshot) {\r\n let addedKeys = documentKeySet();\r\n let removedKeys = documentKeySet();\r\n for (const docChange of viewSnapshot.docChanges) {\r\n switch (docChange.type) {\r\n case 0 /* Added */:\r\n addedKeys = addedKeys.add(docChange.doc.key);\r\n break;\r\n case 1 /* Removed */:\r\n removedKeys = removedKeys.add(docChange.doc.key);\r\n break;\r\n // do nothing\r\n }\r\n }\r\n return new LocalViewChanges(targetId, viewSnapshot.fromCache, addedKeys, removedKeys);\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nclass BundleLoadResult {\r\n constructor(progress, changedDocs) {\r\n this.progress = progress;\r\n this.changedDocs = changedDocs;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Helper to convert objects from bundles to model objects in the SDK.\r\n */\r\nclass BundleConverterImpl {\r\n constructor(serializer) {\r\n this.serializer = serializer;\r\n }\r\n toDocumentKey(name) {\r\n return fromName(this.serializer, name);\r\n }\r\n /**\r\n * Converts a BundleDocument to a MutableDocument.\r\n */\r\n toMutableDocument(bundledDoc) {\r\n if (bundledDoc.metadata.exists) {\r\n return fromDocument(this.serializer, bundledDoc.document, false);\r\n }\r\n else {\r\n return MutableDocument.newNoDocument(this.toDocumentKey(bundledDoc.metadata.name), this.toSnapshotVersion(bundledDoc.metadata.readTime));\r\n }\r\n }\r\n toSnapshotVersion(time) {\r\n return fromVersion(time);\r\n }\r\n}\r\n/**\r\n * A class to process the elements from a bundle, load them into local\r\n * storage and provide progress update while loading.\r\n */\r\nclass BundleLoader {\r\n constructor(bundleMetadata, localStore, serializer) {\r\n this.bundleMetadata = bundleMetadata;\r\n this.localStore = localStore;\r\n this.serializer = serializer;\r\n /** Batched queries to be saved into storage */\r\n this.queries = [];\r\n /** Batched documents to be saved into storage */\r\n this.documents = [];\r\n this.progress = bundleInitialProgress(bundleMetadata);\r\n }\r\n /**\r\n * Adds an element from the bundle to the loader.\r\n *\r\n * Returns a new progress if adding the element leads to a new progress,\r\n * otherwise returns null.\r\n */\r\n addSizedElement(element) {\r\n this.progress.bytesLoaded += element.byteLength;\r\n let documentsLoaded = this.progress.documentsLoaded;\r\n if (element.payload.namedQuery) {\r\n this.queries.push(element.payload.namedQuery);\r\n }\r\n else if (element.payload.documentMetadata) {\r\n this.documents.push({ metadata: element.payload.documentMetadata });\r\n if (!element.payload.documentMetadata.exists) {\r\n ++documentsLoaded;\r\n }\r\n }\r\n else if (element.payload.document) {\r\n this.documents[this.documents.length - 1].document =\r\n element.payload.document;\r\n ++documentsLoaded;\r\n }\r\n if (documentsLoaded !== this.progress.documentsLoaded) {\r\n this.progress.documentsLoaded = documentsLoaded;\r\n return Object.assign({}, this.progress);\r\n }\r\n return null;\r\n }\r\n getQueryDocumentMapping(documents) {\r\n const queryDocumentMap = new Map();\r\n const bundleConverter = new BundleConverterImpl(this.serializer);\r\n for (const bundleDoc of documents) {\r\n if (bundleDoc.metadata.queries) {\r\n const documentKey = bundleConverter.toDocumentKey(bundleDoc.metadata.name);\r\n for (const queryName of bundleDoc.metadata.queries) {\r\n const documentKeys = (queryDocumentMap.get(queryName) || documentKeySet()).add(documentKey);\r\n queryDocumentMap.set(queryName, documentKeys);\r\n }\r\n }\r\n }\r\n return queryDocumentMap;\r\n }\r\n /**\r\n * Update the progress to 'Success' and return the updated progress.\r\n */\r\n async complete() {\r\n const changedDocuments = await localStoreApplyBundledDocuments(this.localStore, new BundleConverterImpl(this.serializer), this.documents, this.bundleMetadata.id);\r\n const queryDocumentMap = this.getQueryDocumentMapping(this.documents);\r\n for (const q of this.queries) {\r\n await localStoreSaveNamedQuery(this.localStore, q, queryDocumentMap.get(q.name));\r\n }\r\n this.progress.taskState = 'Success';\r\n return new BundleLoadResult(Object.assign({}, this.progress), changedDocuments);\r\n }\r\n}\r\n/**\r\n * Returns a `LoadBundleTaskProgress` representing the initial progress of\r\n * loading a bundle.\r\n */\r\nfunction bundleInitialProgress(metadata) {\r\n return {\r\n taskState: 'Running',\r\n documentsLoaded: 0,\r\n bytesLoaded: 0,\r\n totalDocuments: metadata.totalDocuments,\r\n totalBytes: metadata.totalBytes\r\n };\r\n}\r\n/**\r\n * Returns a `LoadBundleTaskProgress` representing the progress that the loading\r\n * has succeeded.\r\n */\r\nfunction bundleSuccessProgress(metadata) {\r\n return {\r\n taskState: 'Success',\r\n documentsLoaded: metadata.totalDocuments,\r\n bytesLoaded: metadata.totalBytes,\r\n totalDocuments: metadata.totalDocuments,\r\n totalBytes: metadata.totalBytes\r\n };\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nclass AddedLimboDocument {\r\n constructor(key) {\r\n this.key = key;\r\n }\r\n}\r\nclass RemovedLimboDocument {\r\n constructor(key) {\r\n this.key = key;\r\n }\r\n}\r\n/**\r\n * View is responsible for computing the final merged truth of what docs are in\r\n * a query. It gets notified of local and remote changes to docs, and applies\r\n * the query filters and limits to determine the most correct possible results.\r\n */\r\nclass View {\r\n constructor(query, \r\n /** Documents included in the remote target */\r\n _syncedDocuments) {\r\n this.query = query;\r\n this._syncedDocuments = _syncedDocuments;\r\n this.syncState = null;\r\n /**\r\n * A flag whether the view is current with the backend. A view is considered\r\n * current after it has seen the current flag from the backend and did not\r\n * lose consistency within the watch stream (e.g. because of an existence\r\n * filter mismatch).\r\n */\r\n this.current = false;\r\n /** Documents in the view but not in the remote target */\r\n this.limboDocuments = documentKeySet();\r\n /** Document Keys that have local changes */\r\n this.mutatedKeys = documentKeySet();\r\n this.docComparator = newQueryComparator(query);\r\n this.documentSet = new DocumentSet(this.docComparator);\r\n }\r\n /**\r\n * The set of remote documents that the server has told us belongs to the target associated with\r\n * this view.\r\n */\r\n get syncedDocuments() {\r\n return this._syncedDocuments;\r\n }\r\n /**\r\n * Iterates over a set of doc changes, applies the query limit, and computes\r\n * what the new results should be, what the changes were, and whether we may\r\n * need to go back to the local cache for more results. Does not make any\r\n * changes to the view.\r\n * @param docChanges - The doc changes to apply to this view.\r\n * @param previousChanges - If this is being called with a refill, then start\r\n * with this set of docs and changes instead of the current view.\r\n * @returns a new set of docs, changes, and refill flag.\r\n */\r\n computeDocChanges(docChanges, previousChanges) {\r\n const changeSet = previousChanges\r\n ? previousChanges.changeSet\r\n : new DocumentChangeSet();\r\n const oldDocumentSet = previousChanges\r\n ? previousChanges.documentSet\r\n : this.documentSet;\r\n let newMutatedKeys = previousChanges\r\n ? previousChanges.mutatedKeys\r\n : this.mutatedKeys;\r\n let newDocumentSet = oldDocumentSet;\r\n let needsRefill = false;\r\n // Track the last doc in a (full) limit. This is necessary, because some\r\n // update (a delete, or an update moving a doc past the old limit) might\r\n // mean there is some other document in the local cache that either should\r\n // come (1) between the old last limit doc and the new last document, in the\r\n // case of updates, or (2) after the new last document, in the case of\r\n // deletes. So we keep this doc at the old limit to compare the updates to.\r\n //\r\n // Note that this should never get used in a refill (when previousChanges is\r\n // set), because there will only be adds -- no deletes or updates.\r\n const lastDocInLimit = hasLimitToFirst(this.query) && oldDocumentSet.size === this.query.limit\r\n ? oldDocumentSet.last()\r\n : null;\r\n const firstDocInLimit = hasLimitToLast(this.query) && oldDocumentSet.size === this.query.limit\r\n ? oldDocumentSet.first()\r\n : null;\r\n docChanges.inorderTraversal((key, entry) => {\r\n const oldDoc = oldDocumentSet.get(key);\r\n const newDoc = queryMatches(this.query, entry) ? entry : null;\r\n const oldDocHadPendingMutations = oldDoc\r\n ? this.mutatedKeys.has(oldDoc.key)\r\n : false;\r\n const newDocHasPendingMutations = newDoc\r\n ? newDoc.hasLocalMutations ||\r\n // We only consider committed mutations for documents that were\r\n // mutated during the lifetime of the view.\r\n (this.mutatedKeys.has(newDoc.key) && newDoc.hasCommittedMutations)\r\n : false;\r\n let changeApplied = false;\r\n // Calculate change\r\n if (oldDoc && newDoc) {\r\n const docsEqual = oldDoc.data.isEqual(newDoc.data);\r\n if (!docsEqual) {\r\n if (!this.shouldWaitForSyncedDocument(oldDoc, newDoc)) {\r\n changeSet.track({\r\n type: 2 /* Modified */,\r\n doc: newDoc\r\n });\r\n changeApplied = true;\r\n if ((lastDocInLimit &&\r\n this.docComparator(newDoc, lastDocInLimit) > 0) ||\r\n (firstDocInLimit &&\r\n this.docComparator(newDoc, firstDocInLimit) < 0)) {\r\n // This doc moved from inside the limit to outside the limit.\r\n // That means there may be some other doc in the local cache\r\n // that should be included instead.\r\n needsRefill = true;\r\n }\r\n }\r\n }\r\n else if (oldDocHadPendingMutations !== newDocHasPendingMutations) {\r\n changeSet.track({ type: 3 /* Metadata */, doc: newDoc });\r\n changeApplied = true;\r\n }\r\n }\r\n else if (!oldDoc && newDoc) {\r\n changeSet.track({ type: 0 /* Added */, doc: newDoc });\r\n changeApplied = true;\r\n }\r\n else if (oldDoc && !newDoc) {\r\n changeSet.track({ type: 1 /* Removed */, doc: oldDoc });\r\n changeApplied = true;\r\n if (lastDocInLimit || firstDocInLimit) {\r\n // A doc was removed from a full limit query. We'll need to\r\n // requery from the local cache to see if we know about some other\r\n // doc that should be in the results.\r\n needsRefill = true;\r\n }\r\n }\r\n if (changeApplied) {\r\n if (newDoc) {\r\n newDocumentSet = newDocumentSet.add(newDoc);\r\n if (newDocHasPendingMutations) {\r\n newMutatedKeys = newMutatedKeys.add(key);\r\n }\r\n else {\r\n newMutatedKeys = newMutatedKeys.delete(key);\r\n }\r\n }\r\n else {\r\n newDocumentSet = newDocumentSet.delete(key);\r\n newMutatedKeys = newMutatedKeys.delete(key);\r\n }\r\n }\r\n });\r\n // Drop documents out to meet limit/limitToLast requirement.\r\n if (hasLimitToFirst(this.query) || hasLimitToLast(this.query)) {\r\n while (newDocumentSet.size > this.query.limit) {\r\n const oldDoc = hasLimitToFirst(this.query)\r\n ? newDocumentSet.last()\r\n : newDocumentSet.first();\r\n newDocumentSet = newDocumentSet.delete(oldDoc.key);\r\n newMutatedKeys = newMutatedKeys.delete(oldDoc.key);\r\n changeSet.track({ type: 1 /* Removed */, doc: oldDoc });\r\n }\r\n }\r\n return {\r\n documentSet: newDocumentSet,\r\n changeSet,\r\n needsRefill,\r\n mutatedKeys: newMutatedKeys\r\n };\r\n }\r\n shouldWaitForSyncedDocument(oldDoc, newDoc) {\r\n // We suppress the initial change event for documents that were modified as\r\n // part of a write acknowledgment (e.g. when the value of a server transform\r\n // is applied) as Watch will send us the same document again.\r\n // By suppressing the event, we only raise two user visible events (one with\r\n // `hasPendingWrites` and the final state of the document) instead of three\r\n // (one with `hasPendingWrites`, the modified document with\r\n // `hasPendingWrites` and the final state of the document).\r\n return (oldDoc.hasLocalMutations &&\r\n newDoc.hasCommittedMutations &&\r\n !newDoc.hasLocalMutations);\r\n }\r\n /**\r\n * Updates the view with the given ViewDocumentChanges and optionally updates\r\n * limbo docs and sync state from the provided target change.\r\n * @param docChanges - The set of changes to make to the view's docs.\r\n * @param updateLimboDocuments - Whether to update limbo documents based on\r\n * this change.\r\n * @param targetChange - A target change to apply for computing limbo docs and\r\n * sync state.\r\n * @returns A new ViewChange with the given docs, changes, and sync state.\r\n */\r\n // PORTING NOTE: The iOS/Android clients always compute limbo document changes.\r\n applyChanges(docChanges, updateLimboDocuments, targetChange) {\r\n const oldDocs = this.documentSet;\r\n this.documentSet = docChanges.documentSet;\r\n this.mutatedKeys = docChanges.mutatedKeys;\r\n // Sort changes based on type and query comparator\r\n const changes = docChanges.changeSet.getChanges();\r\n changes.sort((c1, c2) => {\r\n return (compareChangeType(c1.type, c2.type) ||\r\n this.docComparator(c1.doc, c2.doc));\r\n });\r\n this.applyTargetChange(targetChange);\r\n const limboChanges = updateLimboDocuments\r\n ? this.updateLimboDocuments()\r\n : [];\r\n const synced = this.limboDocuments.size === 0 && this.current;\r\n const newSyncState = synced ? 1 /* Synced */ : 0 /* Local */;\r\n const syncStateChanged = newSyncState !== this.syncState;\r\n this.syncState = newSyncState;\r\n if (changes.length === 0 && !syncStateChanged) {\r\n // no changes\r\n return { limboChanges };\r\n }\r\n else {\r\n const snap = new ViewSnapshot(this.query, docChanges.documentSet, oldDocs, changes, docChanges.mutatedKeys, newSyncState === 0 /* Local */, syncStateChanged, \r\n /* excludesMetadataChanges= */ false);\r\n return {\r\n snapshot: snap,\r\n limboChanges\r\n };\r\n }\r\n }\r\n /**\r\n * Applies an OnlineState change to the view, potentially generating a\r\n * ViewChange if the view's syncState changes as a result.\r\n */\r\n applyOnlineStateChange(onlineState) {\r\n if (this.current && onlineState === \"Offline\" /* Offline */) {\r\n // If we're offline, set `current` to false and then call applyChanges()\r\n // to refresh our syncState and generate a ViewChange as appropriate. We\r\n // are guaranteed to get a new TargetChange that sets `current` back to\r\n // true once the client is back online.\r\n this.current = false;\r\n return this.applyChanges({\r\n documentSet: this.documentSet,\r\n changeSet: new DocumentChangeSet(),\r\n mutatedKeys: this.mutatedKeys,\r\n needsRefill: false\r\n }, \r\n /* updateLimboDocuments= */ false);\r\n }\r\n else {\r\n // No effect, just return a no-op ViewChange.\r\n return { limboChanges: [] };\r\n }\r\n }\r\n /**\r\n * Returns whether the doc for the given key should be in limbo.\r\n */\r\n shouldBeInLimbo(key) {\r\n // If the remote end says it's part of this query, it's not in limbo.\r\n if (this._syncedDocuments.has(key)) {\r\n return false;\r\n }\r\n // The local store doesn't think it's a result, so it shouldn't be in limbo.\r\n if (!this.documentSet.has(key)) {\r\n return false;\r\n }\r\n // If there are local changes to the doc, they might explain why the server\r\n // doesn't know that it's part of the query. So don't put it in limbo.\r\n // TODO(klimt): Ideally, we would only consider changes that might actually\r\n // affect this specific query.\r\n if (this.documentSet.get(key).hasLocalMutations) {\r\n return false;\r\n }\r\n // Everything else is in limbo.\r\n return true;\r\n }\r\n /**\r\n * Updates syncedDocuments, current, and limbo docs based on the given change.\r\n * Returns the list of changes to which docs are in limbo.\r\n */\r\n applyTargetChange(targetChange) {\r\n if (targetChange) {\r\n targetChange.addedDocuments.forEach(key => (this._syncedDocuments = this._syncedDocuments.add(key)));\r\n targetChange.modifiedDocuments.forEach(key => {\r\n });\r\n targetChange.removedDocuments.forEach(key => (this._syncedDocuments = this._syncedDocuments.delete(key)));\r\n this.current = targetChange.current;\r\n }\r\n }\r\n updateLimboDocuments() {\r\n // We can only determine limbo documents when we're in-sync with the server.\r\n if (!this.current) {\r\n return [];\r\n }\r\n // TODO(klimt): Do this incrementally so that it's not quadratic when\r\n // updating many documents.\r\n const oldLimboDocuments = this.limboDocuments;\r\n this.limboDocuments = documentKeySet();\r\n this.documentSet.forEach(doc => {\r\n if (this.shouldBeInLimbo(doc.key)) {\r\n this.limboDocuments = this.limboDocuments.add(doc.key);\r\n }\r\n });\r\n // Diff the new limbo docs with the old limbo docs.\r\n const changes = [];\r\n oldLimboDocuments.forEach(key => {\r\n if (!this.limboDocuments.has(key)) {\r\n changes.push(new RemovedLimboDocument(key));\r\n }\r\n });\r\n this.limboDocuments.forEach(key => {\r\n if (!oldLimboDocuments.has(key)) {\r\n changes.push(new AddedLimboDocument(key));\r\n }\r\n });\r\n return changes;\r\n }\r\n /**\r\n * Update the in-memory state of the current view with the state read from\r\n * persistence.\r\n *\r\n * We update the query view whenever a client's primary status changes:\r\n * - When a client transitions from primary to secondary, it can miss\r\n * LocalStorage updates and its query views may temporarily not be\r\n * synchronized with the state on disk.\r\n * - For secondary to primary transitions, the client needs to update the list\r\n * of `syncedDocuments` since secondary clients update their query views\r\n * based purely on synthesized RemoteEvents.\r\n *\r\n * @param queryResult.documents - The documents that match the query according\r\n * to the LocalStore.\r\n * @param queryResult.remoteKeys - The keys of the documents that match the\r\n * query according to the backend.\r\n *\r\n * @returns The ViewChange that resulted from this synchronization.\r\n */\r\n // PORTING NOTE: Multi-tab only.\r\n synchronizeWithPersistedState(queryResult) {\r\n this._syncedDocuments = queryResult.remoteKeys;\r\n this.limboDocuments = documentKeySet();\r\n const docChanges = this.computeDocChanges(queryResult.documents);\r\n return this.applyChanges(docChanges, /*updateLimboDocuments=*/ true);\r\n }\r\n /**\r\n * Returns a view snapshot as if this query was just listened to. Contains\r\n * a document add for every existing document and the `fromCache` and\r\n * `hasPendingWrites` status of the already established view.\r\n */\r\n // PORTING NOTE: Multi-tab only.\r\n computeInitialSnapshot() {\r\n return ViewSnapshot.fromInitialDocuments(this.query, this.documentSet, this.mutatedKeys, this.syncState === 0 /* Local */);\r\n }\r\n}\r\nfunction compareChangeType(c1, c2) {\r\n const order = (change) => {\r\n switch (change) {\r\n case 0 /* Added */:\r\n return 1;\r\n case 2 /* Modified */:\r\n return 2;\r\n case 3 /* Metadata */:\r\n // A metadata change is converted to a modified change at the public\r\n // api layer. Since we sort by document key and then change type,\r\n // metadata and modified changes must be sorted equivalently.\r\n return 2;\r\n case 1 /* Removed */:\r\n return 0;\r\n default:\r\n return fail();\r\n }\r\n };\r\n return order(c1) - order(c2);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst LOG_TAG$3 = 'SyncEngine';\r\n/**\r\n * QueryView contains all of the data that SyncEngine needs to keep track of for\r\n * a particular query.\r\n */\r\nclass QueryView {\r\n constructor(\r\n /**\r\n * The query itself.\r\n */\r\n query, \r\n /**\r\n * The target number created by the client that is used in the watch\r\n * stream to identify this query.\r\n */\r\n targetId, \r\n /**\r\n * The view is responsible for computing the final merged truth of what\r\n * docs are in the query. It gets notified of local and remote changes,\r\n * and applies the query filters and limits to determine the most correct\r\n * possible results.\r\n */\r\n view) {\r\n this.query = query;\r\n this.targetId = targetId;\r\n this.view = view;\r\n }\r\n}\r\n/** Tracks a limbo resolution. */\r\nclass LimboResolution {\r\n constructor(key) {\r\n this.key = key;\r\n /**\r\n * Set to true once we've received a document. This is used in\r\n * getRemoteKeysForTarget() and ultimately used by WatchChangeAggregator to\r\n * decide whether it needs to manufacture a delete event for the target once\r\n * the target is CURRENT.\r\n */\r\n this.receivedDocument = false;\r\n }\r\n}\r\n/**\r\n * An implementation of `SyncEngine` coordinating with other parts of SDK.\r\n *\r\n * The parts of SyncEngine that act as a callback to RemoteStore need to be\r\n * registered individually. This is done in `syncEngineWrite()` and\r\n * `syncEngineListen()` (as well as `applyPrimaryState()`) as these methods\r\n * serve as entry points to RemoteStore's functionality.\r\n *\r\n * Note: some field defined in this class might have public access level, but\r\n * the class is not exported so they are only accessible from this module.\r\n * This is useful to implement optional features (like bundles) in free\r\n * functions, such that they are tree-shakeable.\r\n */\r\nclass SyncEngineImpl {\r\n constructor(localStore, remoteStore, eventManager, \r\n // PORTING NOTE: Manages state synchronization in multi-tab environments.\r\n sharedClientState, currentUser, maxConcurrentLimboResolutions) {\r\n this.localStore = localStore;\r\n this.remoteStore = remoteStore;\r\n this.eventManager = eventManager;\r\n this.sharedClientState = sharedClientState;\r\n this.currentUser = currentUser;\r\n this.maxConcurrentLimboResolutions = maxConcurrentLimboResolutions;\r\n this.syncEngineListener = {};\r\n this.queryViewsByQuery = new ObjectMap(q => canonifyQuery(q), queryEquals);\r\n this.queriesByTarget = new Map();\r\n /**\r\n * The keys of documents that are in limbo for which we haven't yet started a\r\n * limbo resolution query. The strings in this set are the result of calling\r\n * `key.path.canonicalString()` where `key` is a `DocumentKey` object.\r\n *\r\n * The `Set` type was chosen because it provides efficient lookup and removal\r\n * of arbitrary elements and it also maintains insertion order, providing the\r\n * desired queue-like FIFO semantics.\r\n */\r\n this.enqueuedLimboResolutions = new Set();\r\n /**\r\n * Keeps track of the target ID for each document that is in limbo with an\r\n * active target.\r\n */\r\n this.activeLimboTargetsByKey = new SortedMap(DocumentKey.comparator);\r\n /**\r\n * Keeps track of the information about an active limbo resolution for each\r\n * active target ID that was started for the purpose of limbo resolution.\r\n */\r\n this.activeLimboResolutionsByTarget = new Map();\r\n this.limboDocumentRefs = new ReferenceSet();\r\n /** Stores user completion handlers, indexed by User and BatchId. */\r\n this.mutationUserCallbacks = {};\r\n /** Stores user callbacks waiting for all pending writes to be acknowledged. */\r\n this.pendingWritesCallbacks = new Map();\r\n this.limboTargetIdGenerator = TargetIdGenerator.forSyncEngine();\r\n this.onlineState = \"Unknown\" /* Unknown */;\r\n // The primary state is set to `true` or `false` immediately after Firestore\r\n // startup. In the interim, a client should only be considered primary if\r\n // `isPrimary` is true.\r\n this._isPrimaryClient = undefined;\r\n }\r\n get isPrimaryClient() {\r\n return this._isPrimaryClient === true;\r\n }\r\n}\r\nfunction newSyncEngine(localStore, remoteStore, eventManager, \r\n// PORTING NOTE: Manages state synchronization in multi-tab environments.\r\nsharedClientState, currentUser, maxConcurrentLimboResolutions, isPrimary) {\r\n const syncEngine = new SyncEngineImpl(localStore, remoteStore, eventManager, sharedClientState, currentUser, maxConcurrentLimboResolutions);\r\n if (isPrimary) {\r\n syncEngine._isPrimaryClient = true;\r\n }\r\n return syncEngine;\r\n}\r\n/**\r\n * Initiates the new listen, resolves promise when listen enqueued to the\r\n * server. All the subsequent view snapshots or errors are sent to the\r\n * subscribed handlers. Returns the initial snapshot.\r\n */\r\nasync function syncEngineListen(syncEngine, query) {\r\n const syncEngineImpl = ensureWatchCallbacks(syncEngine);\r\n let targetId;\r\n let viewSnapshot;\r\n const queryView = syncEngineImpl.queryViewsByQuery.get(query);\r\n if (queryView) {\r\n // PORTING NOTE: With Multi-Tab Web, it is possible that a query view\r\n // already exists when EventManager calls us for the first time. This\r\n // happens when the primary tab is already listening to this query on\r\n // behalf of another tab and the user of the primary also starts listening\r\n // to the query. EventManager will not have an assigned target ID in this\r\n // case and calls `listen` to obtain this ID.\r\n targetId = queryView.targetId;\r\n syncEngineImpl.sharedClientState.addLocalQueryTarget(targetId);\r\n viewSnapshot = queryView.view.computeInitialSnapshot();\r\n }\r\n else {\r\n const targetData = await localStoreAllocateTarget(syncEngineImpl.localStore, queryToTarget(query));\r\n const status = syncEngineImpl.sharedClientState.addLocalQueryTarget(targetData.targetId);\r\n targetId = targetData.targetId;\r\n viewSnapshot = await initializeViewAndComputeSnapshot(syncEngineImpl, query, targetId, status === 'current');\r\n if (syncEngineImpl.isPrimaryClient) {\r\n remoteStoreListen(syncEngineImpl.remoteStore, targetData);\r\n }\r\n }\r\n return viewSnapshot;\r\n}\r\n/**\r\n * Registers a view for a previously unknown query and computes its initial\r\n * snapshot.\r\n */\r\nasync function initializeViewAndComputeSnapshot(syncEngineImpl, query, targetId, current) {\r\n // PORTING NOTE: On Web only, we inject the code that registers new Limbo\r\n // targets based on view changes. This allows us to only depend on Limbo\r\n // changes when user code includes queries.\r\n syncEngineImpl.applyDocChanges = (queryView, changes, remoteEvent) => applyDocChanges(syncEngineImpl, queryView, changes, remoteEvent);\r\n const queryResult = await localStoreExecuteQuery(syncEngineImpl.localStore, query, \r\n /* usePreviousResults= */ true);\r\n const view = new View(query, queryResult.remoteKeys);\r\n const viewDocChanges = view.computeDocChanges(queryResult.documents);\r\n const synthesizedTargetChange = TargetChange.createSynthesizedTargetChangeForCurrentChange(targetId, current && syncEngineImpl.onlineState !== \"Offline\" /* Offline */);\r\n const viewChange = view.applyChanges(viewDocChanges, \r\n /* updateLimboDocuments= */ syncEngineImpl.isPrimaryClient, synthesizedTargetChange);\r\n updateTrackedLimbos(syncEngineImpl, targetId, viewChange.limboChanges);\r\n const data = new QueryView(query, targetId, view);\r\n syncEngineImpl.queryViewsByQuery.set(query, data);\r\n if (syncEngineImpl.queriesByTarget.has(targetId)) {\r\n syncEngineImpl.queriesByTarget.get(targetId).push(query);\r\n }\r\n else {\r\n syncEngineImpl.queriesByTarget.set(targetId, [query]);\r\n }\r\n return viewChange.snapshot;\r\n}\r\n/** Stops listening to the query. */\r\nasync function syncEngineUnlisten(syncEngine, query) {\r\n const syncEngineImpl = debugCast(syncEngine);\r\n const queryView = syncEngineImpl.queryViewsByQuery.get(query);\r\n // Only clean up the query view and target if this is the only query mapped\r\n // to the target.\r\n const queries = syncEngineImpl.queriesByTarget.get(queryView.targetId);\r\n if (queries.length > 1) {\r\n syncEngineImpl.queriesByTarget.set(queryView.targetId, queries.filter(q => !queryEquals(q, query)));\r\n syncEngineImpl.queryViewsByQuery.delete(query);\r\n return;\r\n }\r\n // No other queries are mapped to the target, clean up the query and the target.\r\n if (syncEngineImpl.isPrimaryClient) {\r\n // We need to remove the local query target first to allow us to verify\r\n // whether any other client is still interested in this target.\r\n syncEngineImpl.sharedClientState.removeLocalQueryTarget(queryView.targetId);\r\n const targetRemainsActive = syncEngineImpl.sharedClientState.isActiveQueryTarget(queryView.targetId);\r\n if (!targetRemainsActive) {\r\n await localStoreReleaseTarget(syncEngineImpl.localStore, queryView.targetId, \r\n /*keepPersistedTargetData=*/ false)\r\n .then(() => {\r\n syncEngineImpl.sharedClientState.clearQueryState(queryView.targetId);\r\n remoteStoreUnlisten(syncEngineImpl.remoteStore, queryView.targetId);\r\n removeAndCleanupTarget(syncEngineImpl, queryView.targetId);\r\n })\r\n .catch(ignoreIfPrimaryLeaseLoss);\r\n }\r\n }\r\n else {\r\n removeAndCleanupTarget(syncEngineImpl, queryView.targetId);\r\n await localStoreReleaseTarget(syncEngineImpl.localStore, queryView.targetId, \r\n /*keepPersistedTargetData=*/ true);\r\n }\r\n}\r\n/**\r\n * Initiates the write of local mutation batch which involves adding the\r\n * writes to the mutation queue, notifying the remote store about new\r\n * mutations and raising events for any changes this write caused.\r\n *\r\n * The promise returned by this call is resolved when the above steps\r\n * have completed, *not* when the write was acked by the backend. The\r\n * userCallback is resolved once the write was acked/rejected by the\r\n * backend (or failed locally for any other reason).\r\n */\r\nasync function syncEngineWrite(syncEngine, batch, userCallback) {\r\n const syncEngineImpl = syncEngineEnsureWriteCallbacks(syncEngine);\r\n try {\r\n const result = await localStoreWriteLocally(syncEngineImpl.localStore, batch);\r\n syncEngineImpl.sharedClientState.addPendingMutation(result.batchId);\r\n addMutationCallback(syncEngineImpl, result.batchId, userCallback);\r\n await syncEngineEmitNewSnapsAndNotifyLocalStore(syncEngineImpl, result.changes);\r\n await fillWritePipeline(syncEngineImpl.remoteStore);\r\n }\r\n catch (e) {\r\n // If we can't persist the mutation, we reject the user callback and\r\n // don't send the mutation. The user can then retry the write.\r\n const error = wrapInUserErrorIfRecoverable(e, `Failed to persist write`);\r\n userCallback.reject(error);\r\n }\r\n}\r\n/**\r\n * Applies one remote event to the sync engine, notifying any views of the\r\n * changes, and releasing any pending mutation batches that would become\r\n * visible because of the snapshot version the remote event contains.\r\n */\r\nasync function syncEngineApplyRemoteEvent(syncEngine, remoteEvent) {\r\n const syncEngineImpl = debugCast(syncEngine);\r\n try {\r\n const changes = await localStoreApplyRemoteEventToLocalCache(syncEngineImpl.localStore, remoteEvent);\r\n // Update `receivedDocument` as appropriate for any limbo targets.\r\n remoteEvent.targetChanges.forEach((targetChange, targetId) => {\r\n const limboResolution = syncEngineImpl.activeLimboResolutionsByTarget.get(targetId);\r\n if (limboResolution) {\r\n // Since this is a limbo resolution lookup, it's for a single document\r\n // and it could be added, modified, or removed, but not a combination.\r\n hardAssert(targetChange.addedDocuments.size +\r\n targetChange.modifiedDocuments.size +\r\n targetChange.removedDocuments.size <=\r\n 1);\r\n if (targetChange.addedDocuments.size > 0) {\r\n limboResolution.receivedDocument = true;\r\n }\r\n else if (targetChange.modifiedDocuments.size > 0) {\r\n hardAssert(limboResolution.receivedDocument);\r\n }\r\n else if (targetChange.removedDocuments.size > 0) {\r\n hardAssert(limboResolution.receivedDocument);\r\n limboResolution.receivedDocument = false;\r\n }\r\n else {\r\n // This was probably just a CURRENT targetChange or similar.\r\n }\r\n }\r\n });\r\n await syncEngineEmitNewSnapsAndNotifyLocalStore(syncEngineImpl, changes, remoteEvent);\r\n }\r\n catch (error) {\r\n await ignoreIfPrimaryLeaseLoss(error);\r\n }\r\n}\r\n/**\r\n * Applies an OnlineState change to the sync engine and notifies any views of\r\n * the change.\r\n */\r\nfunction syncEngineApplyOnlineStateChange(syncEngine, onlineState, source) {\r\n const syncEngineImpl = debugCast(syncEngine);\r\n // If we are the secondary client, we explicitly ignore the remote store's\r\n // online state (the local client may go offline, even though the primary\r\n // tab remains online) and only apply the primary tab's online state from\r\n // SharedClientState.\r\n if ((syncEngineImpl.isPrimaryClient &&\r\n source === 0 /* RemoteStore */) ||\r\n (!syncEngineImpl.isPrimaryClient &&\r\n source === 1 /* SharedClientState */)) {\r\n const newViewSnapshots = [];\r\n syncEngineImpl.queryViewsByQuery.forEach((query, queryView) => {\r\n const viewChange = queryView.view.applyOnlineStateChange(onlineState);\r\n if (viewChange.snapshot) {\r\n newViewSnapshots.push(viewChange.snapshot);\r\n }\r\n });\r\n eventManagerOnOnlineStateChange(syncEngineImpl.eventManager, onlineState);\r\n if (newViewSnapshots.length) {\r\n syncEngineImpl.syncEngineListener.onWatchChange(newViewSnapshots);\r\n }\r\n syncEngineImpl.onlineState = onlineState;\r\n if (syncEngineImpl.isPrimaryClient) {\r\n syncEngineImpl.sharedClientState.setOnlineState(onlineState);\r\n }\r\n }\r\n}\r\n/**\r\n * Rejects the listen for the given targetID. This can be triggered by the\r\n * backend for any active target.\r\n *\r\n * @param syncEngine - The sync engine implementation.\r\n * @param targetId - The targetID corresponds to one previously initiated by the\r\n * user as part of TargetData passed to listen() on RemoteStore.\r\n * @param err - A description of the condition that has forced the rejection.\r\n * Nearly always this will be an indication that the user is no longer\r\n * authorized to see the data matching the target.\r\n */\r\nasync function syncEngineRejectListen(syncEngine, targetId, err) {\r\n const syncEngineImpl = debugCast(syncEngine);\r\n // PORTING NOTE: Multi-tab only.\r\n syncEngineImpl.sharedClientState.updateQueryState(targetId, 'rejected', err);\r\n const limboResolution = syncEngineImpl.activeLimboResolutionsByTarget.get(targetId);\r\n const limboKey = limboResolution && limboResolution.key;\r\n if (limboKey) {\r\n // TODO(klimt): We really only should do the following on permission\r\n // denied errors, but we don't have the cause code here.\r\n // It's a limbo doc. Create a synthetic event saying it was deleted.\r\n // This is kind of a hack. Ideally, we would have a method in the local\r\n // store to purge a document. However, it would be tricky to keep all of\r\n // the local store's invariants with another method.\r\n let documentUpdates = new SortedMap(DocumentKey.comparator);\r\n documentUpdates = documentUpdates.insert(limboKey, MutableDocument.newNoDocument(limboKey, SnapshotVersion.min()));\r\n const resolvedLimboDocuments = documentKeySet().add(limboKey);\r\n const event = new RemoteEvent(SnapshotVersion.min(), \r\n /* targetChanges= */ new Map(), \r\n /* targetMismatches= */ new SortedSet(primitiveComparator), documentUpdates, resolvedLimboDocuments);\r\n await syncEngineApplyRemoteEvent(syncEngineImpl, event);\r\n // Since this query failed, we won't want to manually unlisten to it.\r\n // We only remove it from bookkeeping after we successfully applied the\r\n // RemoteEvent. If `applyRemoteEvent()` throws, we want to re-listen to\r\n // this query when the RemoteStore restarts the Watch stream, which should\r\n // re-trigger the target failure.\r\n syncEngineImpl.activeLimboTargetsByKey =\r\n syncEngineImpl.activeLimboTargetsByKey.remove(limboKey);\r\n syncEngineImpl.activeLimboResolutionsByTarget.delete(targetId);\r\n pumpEnqueuedLimboResolutions(syncEngineImpl);\r\n }\r\n else {\r\n await localStoreReleaseTarget(syncEngineImpl.localStore, targetId, \r\n /* keepPersistedTargetData */ false)\r\n .then(() => removeAndCleanupTarget(syncEngineImpl, targetId, err))\r\n .catch(ignoreIfPrimaryLeaseLoss);\r\n }\r\n}\r\nasync function syncEngineApplySuccessfulWrite(syncEngine, mutationBatchResult) {\r\n const syncEngineImpl = debugCast(syncEngine);\r\n const batchId = mutationBatchResult.batch.batchId;\r\n try {\r\n const changes = await localStoreAcknowledgeBatch(syncEngineImpl.localStore, mutationBatchResult);\r\n // The local store may or may not be able to apply the write result and\r\n // raise events immediately (depending on whether the watcher is caught\r\n // up), so we raise user callbacks first so that they consistently happen\r\n // before listen events.\r\n processUserCallback(syncEngineImpl, batchId, /*error=*/ null);\r\n triggerPendingWritesCallbacks(syncEngineImpl, batchId);\r\n syncEngineImpl.sharedClientState.updateMutationState(batchId, 'acknowledged');\r\n await syncEngineEmitNewSnapsAndNotifyLocalStore(syncEngineImpl, changes);\r\n }\r\n catch (error) {\r\n await ignoreIfPrimaryLeaseLoss(error);\r\n }\r\n}\r\nasync function syncEngineRejectFailedWrite(syncEngine, batchId, error) {\r\n const syncEngineImpl = debugCast(syncEngine);\r\n try {\r\n const changes = await localStoreRejectBatch(syncEngineImpl.localStore, batchId);\r\n // The local store may or may not be able to apply the write result and\r\n // raise events immediately (depending on whether the watcher is caught up),\r\n // so we raise user callbacks first so that they consistently happen before\r\n // listen events.\r\n processUserCallback(syncEngineImpl, batchId, error);\r\n triggerPendingWritesCallbacks(syncEngineImpl, batchId);\r\n syncEngineImpl.sharedClientState.updateMutationState(batchId, 'rejected', error);\r\n await syncEngineEmitNewSnapsAndNotifyLocalStore(syncEngineImpl, changes);\r\n }\r\n catch (error) {\r\n await ignoreIfPrimaryLeaseLoss(error);\r\n }\r\n}\r\n/**\r\n * Registers a user callback that resolves when all pending mutations at the moment of calling\r\n * are acknowledged .\r\n */\r\nasync function syncEngineRegisterPendingWritesCallback(syncEngine, callback) {\r\n const syncEngineImpl = debugCast(syncEngine);\r\n if (!canUseNetwork(syncEngineImpl.remoteStore)) {\r\n logDebug(LOG_TAG$3, 'The network is disabled. The task returned by ' +\r\n \"'awaitPendingWrites()' will not complete until the network is enabled.\");\r\n }\r\n try {\r\n const highestBatchId = await localStoreGetHighestUnacknowledgedBatchId(syncEngineImpl.localStore);\r\n if (highestBatchId === BATCHID_UNKNOWN) {\r\n // Trigger the callback right away if there is no pending writes at the moment.\r\n callback.resolve();\r\n return;\r\n }\r\n const callbacks = syncEngineImpl.pendingWritesCallbacks.get(highestBatchId) || [];\r\n callbacks.push(callback);\r\n syncEngineImpl.pendingWritesCallbacks.set(highestBatchId, callbacks);\r\n }\r\n catch (e) {\r\n const firestoreError = wrapInUserErrorIfRecoverable(e, 'Initialization of waitForPendingWrites() operation failed');\r\n callback.reject(firestoreError);\r\n }\r\n}\r\n/**\r\n * Triggers the callbacks that are waiting for this batch id to get acknowledged by server,\r\n * if there are any.\r\n */\r\nfunction triggerPendingWritesCallbacks(syncEngineImpl, batchId) {\r\n (syncEngineImpl.pendingWritesCallbacks.get(batchId) || []).forEach(callback => {\r\n callback.resolve();\r\n });\r\n syncEngineImpl.pendingWritesCallbacks.delete(batchId);\r\n}\r\n/** Reject all outstanding callbacks waiting for pending writes to complete. */\r\nfunction rejectOutstandingPendingWritesCallbacks(syncEngineImpl, errorMessage) {\r\n syncEngineImpl.pendingWritesCallbacks.forEach(callbacks => {\r\n callbacks.forEach(callback => {\r\n callback.reject(new FirestoreError(Code.CANCELLED, errorMessage));\r\n });\r\n });\r\n syncEngineImpl.pendingWritesCallbacks.clear();\r\n}\r\nfunction addMutationCallback(syncEngineImpl, batchId, callback) {\r\n let newCallbacks = syncEngineImpl.mutationUserCallbacks[syncEngineImpl.currentUser.toKey()];\r\n if (!newCallbacks) {\r\n newCallbacks = new SortedMap(primitiveComparator);\r\n }\r\n newCallbacks = newCallbacks.insert(batchId, callback);\r\n syncEngineImpl.mutationUserCallbacks[syncEngineImpl.currentUser.toKey()] =\r\n newCallbacks;\r\n}\r\n/**\r\n * Resolves or rejects the user callback for the given batch and then discards\r\n * it.\r\n */\r\nfunction processUserCallback(syncEngine, batchId, error) {\r\n const syncEngineImpl = debugCast(syncEngine);\r\n let newCallbacks = syncEngineImpl.mutationUserCallbacks[syncEngineImpl.currentUser.toKey()];\r\n // NOTE: Mutations restored from persistence won't have callbacks, so it's\r\n // okay for there to be no callback for this ID.\r\n if (newCallbacks) {\r\n const callback = newCallbacks.get(batchId);\r\n if (callback) {\r\n if (error) {\r\n callback.reject(error);\r\n }\r\n else {\r\n callback.resolve();\r\n }\r\n newCallbacks = newCallbacks.remove(batchId);\r\n }\r\n syncEngineImpl.mutationUserCallbacks[syncEngineImpl.currentUser.toKey()] =\r\n newCallbacks;\r\n }\r\n}\r\nfunction removeAndCleanupTarget(syncEngineImpl, targetId, error = null) {\r\n syncEngineImpl.sharedClientState.removeLocalQueryTarget(targetId);\r\n for (const query of syncEngineImpl.queriesByTarget.get(targetId)) {\r\n syncEngineImpl.queryViewsByQuery.delete(query);\r\n if (error) {\r\n syncEngineImpl.syncEngineListener.onWatchError(query, error);\r\n }\r\n }\r\n syncEngineImpl.queriesByTarget.delete(targetId);\r\n if (syncEngineImpl.isPrimaryClient) {\r\n const limboKeys = syncEngineImpl.limboDocumentRefs.removeReferencesForId(targetId);\r\n limboKeys.forEach(limboKey => {\r\n const isReferenced = syncEngineImpl.limboDocumentRefs.containsKey(limboKey);\r\n if (!isReferenced) {\r\n // We removed the last reference for this key\r\n removeLimboTarget(syncEngineImpl, limboKey);\r\n }\r\n });\r\n }\r\n}\r\nfunction removeLimboTarget(syncEngineImpl, key) {\r\n syncEngineImpl.enqueuedLimboResolutions.delete(key.path.canonicalString());\r\n // It's possible that the target already got removed because the query failed. In that case,\r\n // the key won't exist in `limboTargetsByKey`. Only do the cleanup if we still have the target.\r\n const limboTargetId = syncEngineImpl.activeLimboTargetsByKey.get(key);\r\n if (limboTargetId === null) {\r\n // This target already got removed, because the query failed.\r\n return;\r\n }\r\n remoteStoreUnlisten(syncEngineImpl.remoteStore, limboTargetId);\r\n syncEngineImpl.activeLimboTargetsByKey =\r\n syncEngineImpl.activeLimboTargetsByKey.remove(key);\r\n syncEngineImpl.activeLimboResolutionsByTarget.delete(limboTargetId);\r\n pumpEnqueuedLimboResolutions(syncEngineImpl);\r\n}\r\nfunction updateTrackedLimbos(syncEngineImpl, targetId, limboChanges) {\r\n for (const limboChange of limboChanges) {\r\n if (limboChange instanceof AddedLimboDocument) {\r\n syncEngineImpl.limboDocumentRefs.addReference(limboChange.key, targetId);\r\n trackLimboChange(syncEngineImpl, limboChange);\r\n }\r\n else if (limboChange instanceof RemovedLimboDocument) {\r\n logDebug(LOG_TAG$3, 'Document no longer in limbo: ' + limboChange.key);\r\n syncEngineImpl.limboDocumentRefs.removeReference(limboChange.key, targetId);\r\n const isReferenced = syncEngineImpl.limboDocumentRefs.containsKey(limboChange.key);\r\n if (!isReferenced) {\r\n // We removed the last reference for this key\r\n removeLimboTarget(syncEngineImpl, limboChange.key);\r\n }\r\n }\r\n else {\r\n fail();\r\n }\r\n }\r\n}\r\nfunction trackLimboChange(syncEngineImpl, limboChange) {\r\n const key = limboChange.key;\r\n const keyString = key.path.canonicalString();\r\n if (!syncEngineImpl.activeLimboTargetsByKey.get(key) &&\r\n !syncEngineImpl.enqueuedLimboResolutions.has(keyString)) {\r\n logDebug(LOG_TAG$3, 'New document in limbo: ' + key);\r\n syncEngineImpl.enqueuedLimboResolutions.add(keyString);\r\n pumpEnqueuedLimboResolutions(syncEngineImpl);\r\n }\r\n}\r\n/**\r\n * Starts listens for documents in limbo that are enqueued for resolution,\r\n * subject to a maximum number of concurrent resolutions.\r\n *\r\n * Without bounding the number of concurrent resolutions, the server can fail\r\n * with \"resource exhausted\" errors which can lead to pathological client\r\n * behavior as seen in https://github.com/firebase/firebase-js-sdk/issues/2683.\r\n */\r\nfunction pumpEnqueuedLimboResolutions(syncEngineImpl) {\r\n while (syncEngineImpl.enqueuedLimboResolutions.size > 0 &&\r\n syncEngineImpl.activeLimboTargetsByKey.size <\r\n syncEngineImpl.maxConcurrentLimboResolutions) {\r\n const keyString = syncEngineImpl.enqueuedLimboResolutions\r\n .values()\r\n .next().value;\r\n syncEngineImpl.enqueuedLimboResolutions.delete(keyString);\r\n const key = new DocumentKey(ResourcePath.fromString(keyString));\r\n const limboTargetId = syncEngineImpl.limboTargetIdGenerator.next();\r\n syncEngineImpl.activeLimboResolutionsByTarget.set(limboTargetId, new LimboResolution(key));\r\n syncEngineImpl.activeLimboTargetsByKey =\r\n syncEngineImpl.activeLimboTargetsByKey.insert(key, limboTargetId);\r\n remoteStoreListen(syncEngineImpl.remoteStore, new TargetData(queryToTarget(newQueryForPath(key.path)), limboTargetId, 2 /* LimboResolution */, ListenSequence.INVALID));\r\n }\r\n}\r\nasync function syncEngineEmitNewSnapsAndNotifyLocalStore(syncEngine, changes, remoteEvent) {\r\n const syncEngineImpl = debugCast(syncEngine);\r\n const newSnaps = [];\r\n const docChangesInAllViews = [];\r\n const queriesProcessed = [];\r\n if (syncEngineImpl.queryViewsByQuery.isEmpty()) {\r\n // Return early since `onWatchChange()` might not have been assigned yet.\r\n return;\r\n }\r\n syncEngineImpl.queryViewsByQuery.forEach((_, queryView) => {\r\n queriesProcessed.push(syncEngineImpl\r\n .applyDocChanges(queryView, changes, remoteEvent)\r\n .then(viewSnapshot => {\r\n if (viewSnapshot) {\r\n if (syncEngineImpl.isPrimaryClient) {\r\n syncEngineImpl.sharedClientState.updateQueryState(queryView.targetId, viewSnapshot.fromCache ? 'not-current' : 'current');\r\n }\r\n newSnaps.push(viewSnapshot);\r\n const docChanges = LocalViewChanges.fromSnapshot(queryView.targetId, viewSnapshot);\r\n docChangesInAllViews.push(docChanges);\r\n }\r\n }));\r\n });\r\n await Promise.all(queriesProcessed);\r\n syncEngineImpl.syncEngineListener.onWatchChange(newSnaps);\r\n await localStoreNotifyLocalViewChanges(syncEngineImpl.localStore, docChangesInAllViews);\r\n}\r\nasync function applyDocChanges(syncEngineImpl, queryView, changes, remoteEvent) {\r\n let viewDocChanges = queryView.view.computeDocChanges(changes);\r\n if (viewDocChanges.needsRefill) {\r\n // The query has a limit and some docs were removed, so we need\r\n // to re-run the query against the local store to make sure we\r\n // didn't lose any good docs that had been past the limit.\r\n viewDocChanges = await localStoreExecuteQuery(syncEngineImpl.localStore, queryView.query, \r\n /* usePreviousResults= */ false).then(({ documents }) => {\r\n return queryView.view.computeDocChanges(documents, viewDocChanges);\r\n });\r\n }\r\n const targetChange = remoteEvent && remoteEvent.targetChanges.get(queryView.targetId);\r\n const viewChange = queryView.view.applyChanges(viewDocChanges, \r\n /* updateLimboDocuments= */ syncEngineImpl.isPrimaryClient, targetChange);\r\n updateTrackedLimbos(syncEngineImpl, queryView.targetId, viewChange.limboChanges);\r\n return viewChange.snapshot;\r\n}\r\nasync function syncEngineHandleCredentialChange(syncEngine, user) {\r\n const syncEngineImpl = debugCast(syncEngine);\r\n const userChanged = !syncEngineImpl.currentUser.isEqual(user);\r\n if (userChanged) {\r\n logDebug(LOG_TAG$3, 'User change. New user:', user.toKey());\r\n const result = await localStoreHandleUserChange(syncEngineImpl.localStore, user);\r\n syncEngineImpl.currentUser = user;\r\n // Fails tasks waiting for pending writes requested by previous user.\r\n rejectOutstandingPendingWritesCallbacks(syncEngineImpl, \"'waitForPendingWrites' promise is rejected due to a user change.\");\r\n // TODO(b/114226417): Consider calling this only in the primary tab.\r\n syncEngineImpl.sharedClientState.handleUserChange(user, result.removedBatchIds, result.addedBatchIds);\r\n await syncEngineEmitNewSnapsAndNotifyLocalStore(syncEngineImpl, result.affectedDocuments);\r\n }\r\n}\r\nfunction syncEngineGetRemoteKeysForTarget(syncEngine, targetId) {\r\n const syncEngineImpl = debugCast(syncEngine);\r\n const limboResolution = syncEngineImpl.activeLimboResolutionsByTarget.get(targetId);\r\n if (limboResolution && limboResolution.receivedDocument) {\r\n return documentKeySet().add(limboResolution.key);\r\n }\r\n else {\r\n let keySet = documentKeySet();\r\n const queries = syncEngineImpl.queriesByTarget.get(targetId);\r\n if (!queries) {\r\n return keySet;\r\n }\r\n for (const query of queries) {\r\n const queryView = syncEngineImpl.queryViewsByQuery.get(query);\r\n keySet = keySet.unionWith(queryView.view.syncedDocuments);\r\n }\r\n return keySet;\r\n }\r\n}\r\n/**\r\n * Reconcile the list of synced documents in an existing view with those\r\n * from persistence.\r\n */\r\nasync function synchronizeViewAndComputeSnapshot(syncEngine, queryView) {\r\n const syncEngineImpl = debugCast(syncEngine);\r\n const queryResult = await localStoreExecuteQuery(syncEngineImpl.localStore, queryView.query, \r\n /* usePreviousResults= */ true);\r\n const viewSnapshot = queryView.view.synchronizeWithPersistedState(queryResult);\r\n if (syncEngineImpl.isPrimaryClient) {\r\n updateTrackedLimbos(syncEngineImpl, queryView.targetId, viewSnapshot.limboChanges);\r\n }\r\n return viewSnapshot;\r\n}\r\n/**\r\n * Retrieves newly changed documents from remote document cache and raises\r\n * snapshots if needed.\r\n */\r\n// PORTING NOTE: Multi-Tab only.\r\nasync function syncEngineSynchronizeWithChangedDocuments(syncEngine) {\r\n const syncEngineImpl = debugCast(syncEngine);\r\n return localStoreGetNewDocumentChanges(syncEngineImpl.localStore).then(changes => syncEngineEmitNewSnapsAndNotifyLocalStore(syncEngineImpl, changes));\r\n}\r\n/** Applies a mutation state to an existing batch. */\r\n// PORTING NOTE: Multi-Tab only.\r\nasync function syncEngineApplyBatchState(syncEngine, batchId, batchState, error) {\r\n const syncEngineImpl = debugCast(syncEngine);\r\n const documents = await localStoreLookupMutationDocuments(syncEngineImpl.localStore, batchId);\r\n if (documents === null) {\r\n // A throttled tab may not have seen the mutation before it was completed\r\n // and removed from the mutation queue, in which case we won't have cached\r\n // the affected documents. In this case we can safely ignore the update\r\n // since that means we didn't apply the mutation locally at all (if we\r\n // had, we would have cached the affected documents), and so we will just\r\n // see any resulting document changes via normal remote document updates\r\n // as applicable.\r\n logDebug(LOG_TAG$3, 'Cannot apply mutation batch with id: ' + batchId);\r\n return;\r\n }\r\n if (batchState === 'pending') {\r\n // If we are the primary client, we need to send this write to the\r\n // backend. Secondary clients will ignore these writes since their remote\r\n // connection is disabled.\r\n await fillWritePipeline(syncEngineImpl.remoteStore);\r\n }\r\n else if (batchState === 'acknowledged' || batchState === 'rejected') {\r\n // NOTE: Both these methods are no-ops for batches that originated from\r\n // other clients.\r\n processUserCallback(syncEngineImpl, batchId, error ? error : null);\r\n triggerPendingWritesCallbacks(syncEngineImpl, batchId);\r\n localStoreRemoveCachedMutationBatchMetadata(syncEngineImpl.localStore, batchId);\r\n }\r\n else {\r\n fail();\r\n }\r\n await syncEngineEmitNewSnapsAndNotifyLocalStore(syncEngineImpl, documents);\r\n}\r\n/** Applies a query target change from a different tab. */\r\n// PORTING NOTE: Multi-Tab only.\r\nasync function syncEngineApplyPrimaryState(syncEngine, isPrimary) {\r\n const syncEngineImpl = debugCast(syncEngine);\r\n ensureWatchCallbacks(syncEngineImpl);\r\n syncEngineEnsureWriteCallbacks(syncEngineImpl);\r\n if (isPrimary === true && syncEngineImpl._isPrimaryClient !== true) {\r\n // Secondary tabs only maintain Views for their local listeners and the\r\n // Views internal state may not be 100% populated (in particular\r\n // secondary tabs don't track syncedDocuments, the set of documents the\r\n // server considers to be in the target). So when a secondary becomes\r\n // primary, we need to need to make sure that all views for all targets\r\n // match the state on disk.\r\n const activeTargets = syncEngineImpl.sharedClientState.getAllActiveQueryTargets();\r\n const activeQueries = await synchronizeQueryViewsAndRaiseSnapshots(syncEngineImpl, activeTargets.toArray());\r\n syncEngineImpl._isPrimaryClient = true;\r\n await remoteStoreApplyPrimaryState(syncEngineImpl.remoteStore, true);\r\n for (const targetData of activeQueries) {\r\n remoteStoreListen(syncEngineImpl.remoteStore, targetData);\r\n }\r\n }\r\n else if (isPrimary === false && syncEngineImpl._isPrimaryClient !== false) {\r\n const activeTargets = [];\r\n let p = Promise.resolve();\r\n syncEngineImpl.queriesByTarget.forEach((_, targetId) => {\r\n if (syncEngineImpl.sharedClientState.isLocalQueryTarget(targetId)) {\r\n activeTargets.push(targetId);\r\n }\r\n else {\r\n p = p.then(() => {\r\n removeAndCleanupTarget(syncEngineImpl, targetId);\r\n return localStoreReleaseTarget(syncEngineImpl.localStore, targetId, \r\n /*keepPersistedTargetData=*/ true);\r\n });\r\n }\r\n remoteStoreUnlisten(syncEngineImpl.remoteStore, targetId);\r\n });\r\n await p;\r\n await synchronizeQueryViewsAndRaiseSnapshots(syncEngineImpl, activeTargets);\r\n resetLimboDocuments(syncEngineImpl);\r\n syncEngineImpl._isPrimaryClient = false;\r\n await remoteStoreApplyPrimaryState(syncEngineImpl.remoteStore, false);\r\n }\r\n}\r\n// PORTING NOTE: Multi-Tab only.\r\nfunction resetLimboDocuments(syncEngine) {\r\n const syncEngineImpl = debugCast(syncEngine);\r\n syncEngineImpl.activeLimboResolutionsByTarget.forEach((_, targetId) => {\r\n remoteStoreUnlisten(syncEngineImpl.remoteStore, targetId);\r\n });\r\n syncEngineImpl.limboDocumentRefs.removeAllReferences();\r\n syncEngineImpl.activeLimboResolutionsByTarget = new Map();\r\n syncEngineImpl.activeLimboTargetsByKey = new SortedMap(DocumentKey.comparator);\r\n}\r\n/**\r\n * Reconcile the query views of the provided query targets with the state from\r\n * persistence. Raises snapshots for any changes that affect the local\r\n * client and returns the updated state of all target's query data.\r\n *\r\n * @param syncEngine - The sync engine implementation\r\n * @param targets - the list of targets with views that need to be recomputed\r\n * @param transitionToPrimary - `true` iff the tab transitions from a secondary\r\n * tab to a primary tab\r\n */\r\n// PORTING NOTE: Multi-Tab only.\r\nasync function synchronizeQueryViewsAndRaiseSnapshots(syncEngine, targets, transitionToPrimary) {\r\n const syncEngineImpl = debugCast(syncEngine);\r\n const activeQueries = [];\r\n const newViewSnapshots = [];\r\n for (const targetId of targets) {\r\n let targetData;\r\n const queries = syncEngineImpl.queriesByTarget.get(targetId);\r\n if (queries && queries.length !== 0) {\r\n // For queries that have a local View, we fetch their current state\r\n // from LocalStore (as the resume token and the snapshot version\r\n // might have changed) and reconcile their views with the persisted\r\n // state (the list of syncedDocuments may have gotten out of sync).\r\n targetData = await localStoreAllocateTarget(syncEngineImpl.localStore, queryToTarget(queries[0]));\r\n for (const query of queries) {\r\n const queryView = syncEngineImpl.queryViewsByQuery.get(query);\r\n const viewChange = await synchronizeViewAndComputeSnapshot(syncEngineImpl, queryView);\r\n if (viewChange.snapshot) {\r\n newViewSnapshots.push(viewChange.snapshot);\r\n }\r\n }\r\n }\r\n else {\r\n // For queries that never executed on this client, we need to\r\n // allocate the target in LocalStore and initialize a new View.\r\n const target = await localStoreGetCachedTarget(syncEngineImpl.localStore, targetId);\r\n targetData = await localStoreAllocateTarget(syncEngineImpl.localStore, target);\r\n await initializeViewAndComputeSnapshot(syncEngineImpl, synthesizeTargetToQuery(target), targetId, \r\n /*current=*/ false);\r\n }\r\n activeQueries.push(targetData);\r\n }\r\n syncEngineImpl.syncEngineListener.onWatchChange(newViewSnapshots);\r\n return activeQueries;\r\n}\r\n/**\r\n * Creates a `Query` object from the specified `Target`. There is no way to\r\n * obtain the original `Query`, so we synthesize a `Query` from the `Target`\r\n * object.\r\n *\r\n * The synthesized result might be different from the original `Query`, but\r\n * since the synthesized `Query` should return the same results as the\r\n * original one (only the presentation of results might differ), the potential\r\n * difference will not cause issues.\r\n */\r\n// PORTING NOTE: Multi-Tab only.\r\nfunction synthesizeTargetToQuery(target) {\r\n return newQuery(target.path, target.collectionGroup, target.orderBy, target.filters, target.limit, \"F\" /* First */, target.startAt, target.endAt);\r\n}\r\n/** Returns the IDs of the clients that are currently active. */\r\n// PORTING NOTE: Multi-Tab only.\r\nfunction syncEngineGetActiveClients(syncEngine) {\r\n const syncEngineImpl = debugCast(syncEngine);\r\n return localStoreGetActiveClients(syncEngineImpl.localStore);\r\n}\r\n/** Applies a query target change from a different tab. */\r\n// PORTING NOTE: Multi-Tab only.\r\nasync function syncEngineApplyTargetState(syncEngine, targetId, state, error) {\r\n const syncEngineImpl = debugCast(syncEngine);\r\n if (syncEngineImpl._isPrimaryClient) {\r\n // If we receive a target state notification via WebStorage, we are\r\n // either already secondary or another tab has taken the primary lease.\r\n logDebug(LOG_TAG$3, 'Ignoring unexpected query state notification.');\r\n return;\r\n }\r\n if (syncEngineImpl.queriesByTarget.has(targetId)) {\r\n switch (state) {\r\n case 'current':\r\n case 'not-current': {\r\n const changes = await localStoreGetNewDocumentChanges(syncEngineImpl.localStore);\r\n const synthesizedRemoteEvent = RemoteEvent.createSynthesizedRemoteEventForCurrentChange(targetId, state === 'current');\r\n await syncEngineEmitNewSnapsAndNotifyLocalStore(syncEngineImpl, changes, synthesizedRemoteEvent);\r\n break;\r\n }\r\n case 'rejected': {\r\n await localStoreReleaseTarget(syncEngineImpl.localStore, targetId, \r\n /* keepPersistedTargetData */ true);\r\n removeAndCleanupTarget(syncEngineImpl, targetId, error);\r\n break;\r\n }\r\n default:\r\n fail();\r\n }\r\n }\r\n}\r\n/** Adds or removes Watch targets for queries from different tabs. */\r\nasync function syncEngineApplyActiveTargetsChange(syncEngine, added, removed) {\r\n const syncEngineImpl = ensureWatchCallbacks(syncEngine);\r\n if (!syncEngineImpl._isPrimaryClient) {\r\n return;\r\n }\r\n for (const targetId of added) {\r\n if (syncEngineImpl.queriesByTarget.has(targetId)) {\r\n // A target might have been added in a previous attempt\r\n logDebug(LOG_TAG$3, 'Adding an already active target ' + targetId);\r\n continue;\r\n }\r\n const target = await localStoreGetCachedTarget(syncEngineImpl.localStore, targetId);\r\n const targetData = await localStoreAllocateTarget(syncEngineImpl.localStore, target);\r\n await initializeViewAndComputeSnapshot(syncEngineImpl, synthesizeTargetToQuery(target), targetData.targetId, \r\n /*current=*/ false);\r\n remoteStoreListen(syncEngineImpl.remoteStore, targetData);\r\n }\r\n for (const targetId of removed) {\r\n // Check that the target is still active since the target might have been\r\n // removed if it has been rejected by the backend.\r\n if (!syncEngineImpl.queriesByTarget.has(targetId)) {\r\n continue;\r\n }\r\n // Release queries that are still active.\r\n await localStoreReleaseTarget(syncEngineImpl.localStore, targetId, \r\n /* keepPersistedTargetData */ false)\r\n .then(() => {\r\n remoteStoreUnlisten(syncEngineImpl.remoteStore, targetId);\r\n removeAndCleanupTarget(syncEngineImpl, targetId);\r\n })\r\n .catch(ignoreIfPrimaryLeaseLoss);\r\n }\r\n}\r\nfunction ensureWatchCallbacks(syncEngine) {\r\n const syncEngineImpl = debugCast(syncEngine);\r\n syncEngineImpl.remoteStore.remoteSyncer.applyRemoteEvent =\r\n syncEngineApplyRemoteEvent.bind(null, syncEngineImpl);\r\n syncEngineImpl.remoteStore.remoteSyncer.getRemoteKeysForTarget =\r\n syncEngineGetRemoteKeysForTarget.bind(null, syncEngineImpl);\r\n syncEngineImpl.remoteStore.remoteSyncer.rejectListen =\r\n syncEngineRejectListen.bind(null, syncEngineImpl);\r\n syncEngineImpl.syncEngineListener.onWatchChange =\r\n eventManagerOnWatchChange.bind(null, syncEngineImpl.eventManager);\r\n syncEngineImpl.syncEngineListener.onWatchError =\r\n eventManagerOnWatchError.bind(null, syncEngineImpl.eventManager);\r\n return syncEngineImpl;\r\n}\r\nfunction syncEngineEnsureWriteCallbacks(syncEngine) {\r\n const syncEngineImpl = debugCast(syncEngine);\r\n syncEngineImpl.remoteStore.remoteSyncer.applySuccessfulWrite =\r\n syncEngineApplySuccessfulWrite.bind(null, syncEngineImpl);\r\n syncEngineImpl.remoteStore.remoteSyncer.rejectFailedWrite =\r\n syncEngineRejectFailedWrite.bind(null, syncEngineImpl);\r\n return syncEngineImpl;\r\n}\r\n/**\r\n * Loads a Firestore bundle into the SDK. The returned promise resolves when\r\n * the bundle finished loading.\r\n *\r\n * @param syncEngine - SyncEngine to use.\r\n * @param bundleReader - Bundle to load into the SDK.\r\n * @param task - LoadBundleTask used to update the loading progress to public API.\r\n */\r\nfunction syncEngineLoadBundle(syncEngine, bundleReader, task) {\r\n const syncEngineImpl = debugCast(syncEngine);\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n loadBundleImpl(syncEngineImpl, bundleReader, task).then(() => {\r\n syncEngineImpl.sharedClientState.notifyBundleLoaded();\r\n });\r\n}\r\nasync function loadBundleImpl(syncEngine, reader, task) {\r\n try {\r\n const metadata = await reader.getMetadata();\r\n const skip = await localStoreHasNewerBundle(syncEngine.localStore, metadata);\r\n if (skip) {\r\n await reader.close();\r\n task._completeWith(bundleSuccessProgress(metadata));\r\n return;\r\n }\r\n task._updateProgress(bundleInitialProgress(metadata));\r\n const loader = new BundleLoader(metadata, syncEngine.localStore, reader.serializer);\r\n let element = await reader.nextElement();\r\n while (element) {\r\n ;\r\n const progress = await loader.addSizedElement(element);\r\n if (progress) {\r\n task._updateProgress(progress);\r\n }\r\n element = await reader.nextElement();\r\n }\r\n const result = await loader.complete();\r\n // TODO(b/160876443): This currently raises snapshots with\r\n // `fromCache=false` if users already listen to some queries and bundles\r\n // has newer version.\r\n await syncEngineEmitNewSnapsAndNotifyLocalStore(syncEngine, result.changedDocs, \r\n /* remoteEvent */ undefined);\r\n // Save metadata, so loading the same bundle will skip.\r\n await localStoreSaveBundle(syncEngine.localStore, metadata);\r\n task._completeWith(result.progress);\r\n }\r\n catch (e) {\r\n logWarn(LOG_TAG$3, `Loading bundle failed with ${e}`);\r\n task._failWith(e);\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Provides all components needed for Firestore with in-memory persistence.\r\n * Uses EagerGC garbage collection.\r\n */\r\nclass MemoryOfflineComponentProvider {\r\n constructor() {\r\n this.synchronizeTabs = false;\r\n }\r\n async initialize(cfg) {\r\n this.serializer = newSerializer(cfg.databaseInfo.databaseId);\r\n this.sharedClientState = this.createSharedClientState(cfg);\r\n this.persistence = this.createPersistence(cfg);\r\n await this.persistence.start();\r\n this.gcScheduler = this.createGarbageCollectionScheduler(cfg);\r\n this.localStore = this.createLocalStore(cfg);\r\n }\r\n createGarbageCollectionScheduler(cfg) {\r\n return null;\r\n }\r\n createLocalStore(cfg) {\r\n return newLocalStore(this.persistence, new QueryEngine(), cfg.initialUser, this.serializer);\r\n }\r\n createPersistence(cfg) {\r\n return new MemoryPersistence(MemoryEagerDelegate.factory, this.serializer);\r\n }\r\n createSharedClientState(cfg) {\r\n return new MemorySharedClientState();\r\n }\r\n async terminate() {\r\n if (this.gcScheduler) {\r\n this.gcScheduler.stop();\r\n }\r\n await this.sharedClientState.shutdown();\r\n await this.persistence.shutdown();\r\n }\r\n}\r\n/**\r\n * Provides all components needed for Firestore with IndexedDB persistence.\r\n */\r\nclass IndexedDbOfflineComponentProvider extends MemoryOfflineComponentProvider {\r\n constructor(onlineComponentProvider, cacheSizeBytes, forceOwnership) {\r\n super();\r\n this.onlineComponentProvider = onlineComponentProvider;\r\n this.cacheSizeBytes = cacheSizeBytes;\r\n this.forceOwnership = forceOwnership;\r\n this.synchronizeTabs = false;\r\n }\r\n async initialize(cfg) {\r\n await super.initialize(cfg);\r\n await localStoreSynchronizeLastDocumentChangeReadTime(this.localStore);\r\n await this.onlineComponentProvider.initialize(this, cfg);\r\n // Enqueue writes from a previous session\r\n await syncEngineEnsureWriteCallbacks(this.onlineComponentProvider.syncEngine);\r\n await fillWritePipeline(this.onlineComponentProvider.remoteStore);\r\n // NOTE: This will immediately call the listener, so we make sure to\r\n // set it after localStore / remoteStore are started.\r\n await this.persistence.setPrimaryStateListener(() => {\r\n if (this.gcScheduler && !this.gcScheduler.started) {\r\n this.gcScheduler.start(this.localStore);\r\n }\r\n return Promise.resolve();\r\n });\r\n }\r\n createLocalStore(cfg) {\r\n return newLocalStore(this.persistence, new QueryEngine(), cfg.initialUser, this.serializer);\r\n }\r\n createGarbageCollectionScheduler(cfg) {\r\n const garbageCollector = this.persistence.referenceDelegate.garbageCollector;\r\n return new LruScheduler(garbageCollector, cfg.asyncQueue);\r\n }\r\n createPersistence(cfg) {\r\n const persistenceKey = indexedDbStoragePrefix(cfg.databaseInfo.databaseId, cfg.databaseInfo.persistenceKey);\r\n const lruParams = this.cacheSizeBytes !== undefined\r\n ? LruParams.withCacheSize(this.cacheSizeBytes)\r\n : LruParams.DEFAULT;\r\n return new IndexedDbPersistence(this.synchronizeTabs, persistenceKey, cfg.clientId, lruParams, cfg.asyncQueue, getWindow(), getDocument(), this.serializer, this.sharedClientState, !!this.forceOwnership);\r\n }\r\n createSharedClientState(cfg) {\r\n return new MemorySharedClientState();\r\n }\r\n}\r\n/**\r\n * Provides all components needed for Firestore with multi-tab IndexedDB\r\n * persistence.\r\n *\r\n * In the legacy client, this provider is used to provide both multi-tab and\r\n * non-multi-tab persistence since we cannot tell at build time whether\r\n * `synchronizeTabs` will be enabled.\r\n */\r\nclass MultiTabOfflineComponentProvider extends IndexedDbOfflineComponentProvider {\r\n constructor(onlineComponentProvider, cacheSizeBytes) {\r\n super(onlineComponentProvider, cacheSizeBytes, /* forceOwnership= */ false);\r\n this.onlineComponentProvider = onlineComponentProvider;\r\n this.cacheSizeBytes = cacheSizeBytes;\r\n this.synchronizeTabs = true;\r\n }\r\n async initialize(cfg) {\r\n await super.initialize(cfg);\r\n const syncEngine = this.onlineComponentProvider.syncEngine;\r\n if (this.sharedClientState instanceof WebStorageSharedClientState) {\r\n this.sharedClientState.syncEngine = {\r\n applyBatchState: syncEngineApplyBatchState.bind(null, syncEngine),\r\n applyTargetState: syncEngineApplyTargetState.bind(null, syncEngine),\r\n applyActiveTargetsChange: syncEngineApplyActiveTargetsChange.bind(null, syncEngine),\r\n getActiveClients: syncEngineGetActiveClients.bind(null, syncEngine),\r\n synchronizeWithChangedDocuments: syncEngineSynchronizeWithChangedDocuments.bind(null, syncEngine)\r\n };\r\n await this.sharedClientState.start();\r\n }\r\n // NOTE: This will immediately call the listener, so we make sure to\r\n // set it after localStore / remoteStore are started.\r\n await this.persistence.setPrimaryStateListener(async (isPrimary) => {\r\n await syncEngineApplyPrimaryState(this.onlineComponentProvider.syncEngine, isPrimary);\r\n if (this.gcScheduler) {\r\n if (isPrimary && !this.gcScheduler.started) {\r\n this.gcScheduler.start(this.localStore);\r\n }\r\n else if (!isPrimary) {\r\n this.gcScheduler.stop();\r\n }\r\n }\r\n });\r\n }\r\n createSharedClientState(cfg) {\r\n const window = getWindow();\r\n if (!WebStorageSharedClientState.isAvailable(window)) {\r\n throw new FirestoreError(Code.UNIMPLEMENTED, 'IndexedDB persistence is only available on platforms that support LocalStorage.');\r\n }\r\n const persistenceKey = indexedDbStoragePrefix(cfg.databaseInfo.databaseId, cfg.databaseInfo.persistenceKey);\r\n return new WebStorageSharedClientState(window, cfg.asyncQueue, persistenceKey, cfg.clientId, cfg.initialUser);\r\n }\r\n}\r\n/**\r\n * Initializes and wires the components that are needed to interface with the\r\n * network.\r\n */\r\nclass OnlineComponentProvider {\r\n async initialize(offlineComponentProvider, cfg) {\r\n if (this.localStore) {\r\n // OnlineComponentProvider may get initialized multiple times if\r\n // multi-tab persistence is used.\r\n return;\r\n }\r\n this.localStore = offlineComponentProvider.localStore;\r\n this.sharedClientState = offlineComponentProvider.sharedClientState;\r\n this.datastore = this.createDatastore(cfg);\r\n this.remoteStore = this.createRemoteStore(cfg);\r\n this.eventManager = this.createEventManager(cfg);\r\n this.syncEngine = this.createSyncEngine(cfg, \r\n /* startAsPrimary=*/ !offlineComponentProvider.synchronizeTabs);\r\n this.sharedClientState.onlineStateHandler = onlineState => syncEngineApplyOnlineStateChange(this.syncEngine, onlineState, 1 /* SharedClientState */);\r\n this.remoteStore.remoteSyncer.handleCredentialChange =\r\n syncEngineHandleCredentialChange.bind(null, this.syncEngine);\r\n await remoteStoreApplyPrimaryState(this.remoteStore, this.syncEngine.isPrimaryClient);\r\n }\r\n createEventManager(cfg) {\r\n return newEventManager();\r\n }\r\n createDatastore(cfg) {\r\n const serializer = newSerializer(cfg.databaseInfo.databaseId);\r\n const connection = newConnection(cfg.databaseInfo);\r\n return newDatastore(cfg.credentials, connection, serializer);\r\n }\r\n createRemoteStore(cfg) {\r\n return newRemoteStore(this.localStore, this.datastore, cfg.asyncQueue, onlineState => syncEngineApplyOnlineStateChange(this.syncEngine, onlineState, 0 /* RemoteStore */), newConnectivityMonitor());\r\n }\r\n createSyncEngine(cfg, startAsPrimary) {\r\n return newSyncEngine(this.localStore, this.remoteStore, this.eventManager, this.sharedClientState, cfg.initialUser, cfg.maxConcurrentLimboResolutions, startAsPrimary);\r\n }\r\n terminate() {\r\n return remoteStoreShutdown(this.remoteStore);\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * How many bytes to read each time when `ReadableStreamReader.read()` is\r\n * called. Only applicable for byte streams that we control (e.g. those backed\r\n * by an UInt8Array).\r\n */\r\nconst DEFAULT_BYTES_PER_READ = 10240;\r\n/**\r\n * Builds a `ByteStreamReader` from a UInt8Array.\r\n * @param source - The data source to use.\r\n * @param bytesPerRead - How many bytes each `read()` from the returned reader\r\n * will read.\r\n */\r\nfunction toByteStreamReaderHelper(source, bytesPerRead = DEFAULT_BYTES_PER_READ) {\r\n let readFrom = 0;\r\n // The TypeScript definition for ReadableStreamReader changed. We use\r\n // `any` here to allow this code to compile with different versions.\r\n // See https://github.com/microsoft/TypeScript/issues/42970\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const reader = {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n async read() {\r\n if (readFrom < source.byteLength) {\r\n const result = {\r\n value: source.slice(readFrom, readFrom + bytesPerRead),\r\n done: false\r\n };\r\n readFrom += bytesPerRead;\r\n return result;\r\n }\r\n return { done: true };\r\n },\r\n async cancel() { },\r\n releaseLock() { },\r\n closed: Promise.reject('unimplemented')\r\n };\r\n return reader;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction validateNonEmptyArgument(functionName, argumentName, argument) {\r\n if (!argument) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, `Function ${functionName}() cannot be called with an empty ${argumentName}.`);\r\n }\r\n}\r\n/**\r\n * Validates that two boolean options are not set at the same time.\r\n * @internal\r\n */\r\nfunction validateIsNotUsedTogether(optionName1, argument1, optionName2, argument2) {\r\n if (argument1 === true && argument2 === true) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, `${optionName1} and ${optionName2} cannot be used together.`);\r\n }\r\n}\r\n/**\r\n * Validates that `path` refers to a document (indicated by the fact it contains\r\n * an even numbers of segments).\r\n */\r\nfunction validateDocumentPath(path) {\r\n if (!DocumentKey.isDocumentKey(path)) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, `Invalid document reference. Document references must have an even number of segments, but ${path} has ${path.length}.`);\r\n }\r\n}\r\n/**\r\n * Validates that `path` refers to a collection (indicated by the fact it\r\n * contains an odd numbers of segments).\r\n */\r\nfunction validateCollectionPath(path) {\r\n if (DocumentKey.isDocumentKey(path)) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, `Invalid collection reference. Collection references must have an odd number of segments, but ${path} has ${path.length}.`);\r\n }\r\n}\r\n/**\r\n * Returns true if it's a non-null object without a custom prototype\r\n * (i.e. excludes Array, Date, etc.).\r\n */\r\nfunction isPlainObject(input) {\r\n return (typeof input === 'object' &&\r\n input !== null &&\r\n (Object.getPrototypeOf(input) === Object.prototype ||\r\n Object.getPrototypeOf(input) === null));\r\n}\r\n/** Returns a string describing the type / value of the provided input. */\r\nfunction valueDescription(input) {\r\n if (input === undefined) {\r\n return 'undefined';\r\n }\r\n else if (input === null) {\r\n return 'null';\r\n }\r\n else if (typeof input === 'string') {\r\n if (input.length > 20) {\r\n input = `${input.substring(0, 20)}...`;\r\n }\r\n return JSON.stringify(input);\r\n }\r\n else if (typeof input === 'number' || typeof input === 'boolean') {\r\n return '' + input;\r\n }\r\n else if (typeof input === 'object') {\r\n if (input instanceof Array) {\r\n return 'an array';\r\n }\r\n else {\r\n const customObjectName = tryGetCustomObjectType(input);\r\n if (customObjectName) {\r\n return `a custom ${customObjectName} object`;\r\n }\r\n else {\r\n return 'an object';\r\n }\r\n }\r\n }\r\n else if (typeof input === 'function') {\r\n return 'a function';\r\n }\r\n else {\r\n return fail();\r\n }\r\n}\r\n/** try to get the constructor name for an object. */\r\nfunction tryGetCustomObjectType(input) {\r\n if (input.constructor) {\r\n return input.constructor.name;\r\n }\r\n return null;\r\n}\r\n/**\r\n * Casts `obj` to `T`, optionally unwrapping Compat types to expose the\r\n * underlying instance. Throws if `obj` is not an instance of `T`.\r\n *\r\n * This cast is used in the Lite and Full SDK to verify instance types for\r\n * arguments passed to the public API.\r\n * @internal\r\n */\r\nfunction cast(obj, \r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nconstructor) {\r\n if ('_delegate' in obj) {\r\n // Unwrap Compat types\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n obj = obj._delegate;\r\n }\r\n if (!(obj instanceof constructor)) {\r\n if (constructor.name === obj.constructor.name) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Type does not match the expected instance. Did you pass a ' +\r\n `reference from a different Firestore SDK?`);\r\n }\r\n else {\r\n const description = valueDescription(obj);\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, `Expected type '${constructor.name}', but it was: ${description}`);\r\n }\r\n }\r\n return obj;\r\n}\r\nfunction validatePositiveNumber(functionName, n) {\r\n if (n <= 0) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, `Function ${functionName}() requires a positive number, but it was: ${n}.`);\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * On Node, only supported data source is a `Uint8Array` for now.\r\n */\r\nfunction toByteStreamReader(source, bytesPerRead) {\r\n if (!(source instanceof Uint8Array)) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, `NodePlatform.toByteStreamReader expects source to be Uint8Array, got ${valueDescription(source)}`);\r\n }\r\n return toByteStreamReaderHelper(source, bytesPerRead);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/*\r\n * A wrapper implementation of Observer<T> that will dispatch events\r\n * asynchronously. To allow immediate silencing, a mute call is added which\r\n * causes events scheduled to no longer be raised.\r\n */\r\nclass AsyncObserver {\r\n constructor(observer) {\r\n this.observer = observer;\r\n /**\r\n * When set to true, will not raise future events. Necessary to deal with\r\n * async detachment of listener.\r\n */\r\n this.muted = false;\r\n }\r\n next(value) {\r\n if (this.observer.next) {\r\n this.scheduleEvent(this.observer.next, value);\r\n }\r\n }\r\n error(error) {\r\n if (this.observer.error) {\r\n this.scheduleEvent(this.observer.error, error);\r\n }\r\n else {\r\n console.error('Uncaught Error in snapshot listener:', error);\r\n }\r\n }\r\n mute() {\r\n this.muted = true;\r\n }\r\n scheduleEvent(eventHandler, event) {\r\n if (!this.muted) {\r\n setTimeout(() => {\r\n if (!this.muted) {\r\n eventHandler(event);\r\n }\r\n }, 0);\r\n }\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A complete element in the bundle stream, together with the byte length it\r\n * occupies in the stream.\r\n */\r\nclass SizedBundleElement {\r\n constructor(payload, \r\n // How many bytes this element takes to store in the bundle.\r\n byteLength) {\r\n this.payload = payload;\r\n this.byteLength = byteLength;\r\n }\r\n isBundleMetadata() {\r\n return 'metadata' in this.payload;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A class representing a bundle.\r\n *\r\n * Takes a bundle stream or buffer, and presents abstractions to read bundled\r\n * elements out of the underlying content.\r\n */\r\nclass BundleReaderImpl {\r\n constructor(\r\n /** The reader to read from underlying binary bundle data source. */\r\n reader, serializer) {\r\n this.reader = reader;\r\n this.serializer = serializer;\r\n /** Cached bundle metadata. */\r\n this.metadata = new Deferred();\r\n /**\r\n * Internal buffer to hold bundle content, accumulating incomplete element\r\n * content.\r\n */\r\n this.buffer = new Uint8Array();\r\n this.textDecoder = newTextDecoder();\r\n // Read the metadata (which is the first element).\r\n this.nextElementImpl().then(element => {\r\n if (element && element.isBundleMetadata()) {\r\n this.metadata.resolve(element.payload.metadata);\r\n }\r\n else {\r\n this.metadata.reject(new Error(`The first element of the bundle is not a metadata, it is\n ${JSON.stringify(element === null || element === void 0 ? void 0 : element.payload)}`));\r\n }\r\n }, error => this.metadata.reject(error));\r\n }\r\n close() {\r\n return this.reader.cancel();\r\n }\r\n async getMetadata() {\r\n return this.metadata.promise;\r\n }\r\n async nextElement() {\r\n // Makes sure metadata is read before proceeding.\r\n await this.getMetadata();\r\n return this.nextElementImpl();\r\n }\r\n /**\r\n * Reads from the head of internal buffer, and pulling more data from\r\n * underlying stream if a complete element cannot be found, until an\r\n * element(including the prefixed length and the JSON string) is found.\r\n *\r\n * Once a complete element is read, it is dropped from internal buffer.\r\n *\r\n * Returns either the bundled element, or null if we have reached the end of\r\n * the stream.\r\n */\r\n async nextElementImpl() {\r\n const lengthBuffer = await this.readLength();\r\n if (lengthBuffer === null) {\r\n return null;\r\n }\r\n const lengthString = this.textDecoder.decode(lengthBuffer);\r\n const length = Number(lengthString);\r\n if (isNaN(length)) {\r\n this.raiseError(`length string (${lengthString}) is not valid number`);\r\n }\r\n const jsonString = await this.readJsonString(length);\r\n return new SizedBundleElement(JSON.parse(jsonString), lengthBuffer.length + length);\r\n }\r\n /** First index of '{' from the underlying buffer. */\r\n indexOfOpenBracket() {\r\n return this.buffer.findIndex(v => v === '{'.charCodeAt(0));\r\n }\r\n /**\r\n * Reads from the beginning of the internal buffer, until the first '{', and\r\n * return the content.\r\n *\r\n * If reached end of the stream, returns a null.\r\n */\r\n async readLength() {\r\n while (this.indexOfOpenBracket() < 0) {\r\n const done = await this.pullMoreDataToBuffer();\r\n if (done) {\r\n break;\r\n }\r\n }\r\n // Broke out of the loop because underlying stream is closed, and there\r\n // happens to be no more data to process.\r\n if (this.buffer.length === 0) {\r\n return null;\r\n }\r\n const position = this.indexOfOpenBracket();\r\n // Broke out of the loop because underlying stream is closed, but still\r\n // cannot find an open bracket.\r\n if (position < 0) {\r\n this.raiseError('Reached the end of bundle when a length string is expected.');\r\n }\r\n const result = this.buffer.slice(0, position);\r\n // Update the internal buffer to drop the read length.\r\n this.buffer = this.buffer.slice(position);\r\n return result;\r\n }\r\n /**\r\n * Reads from a specified position from the internal buffer, for a specified\r\n * number of bytes, pulling more data from the underlying stream if needed.\r\n *\r\n * Returns a string decoded from the read bytes.\r\n */\r\n async readJsonString(length) {\r\n while (this.buffer.length < length) {\r\n const done = await this.pullMoreDataToBuffer();\r\n if (done) {\r\n this.raiseError('Reached the end of bundle when more is expected.');\r\n }\r\n }\r\n const result = this.textDecoder.decode(this.buffer.slice(0, length));\r\n // Update the internal buffer to drop the read json string.\r\n this.buffer = this.buffer.slice(length);\r\n return result;\r\n }\r\n raiseError(message) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.reader.cancel();\r\n throw new Error(`Invalid bundle format: ${message}`);\r\n }\r\n /**\r\n * Pulls more data from underlying stream to internal buffer.\r\n * Returns a boolean indicating whether the stream is finished.\r\n */\r\n async pullMoreDataToBuffer() {\r\n const result = await this.reader.read();\r\n if (!result.done) {\r\n const newBuffer = new Uint8Array(this.buffer.length + result.value.length);\r\n newBuffer.set(this.buffer);\r\n newBuffer.set(result.value, this.buffer.length);\r\n this.buffer = newBuffer;\r\n }\r\n return result.done;\r\n }\r\n}\r\nfunction newBundleReader(reader, serializer) {\r\n return new BundleReaderImpl(reader, serializer);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Internal transaction object responsible for accumulating the mutations to\r\n * perform and the base versions for any documents read.\r\n */\r\nclass Transaction$2 {\r\n constructor(datastore) {\r\n this.datastore = datastore;\r\n // The version of each document that was read during this transaction.\r\n this.readVersions = new Map();\r\n this.mutations = [];\r\n this.committed = false;\r\n /**\r\n * A deferred usage error that occurred previously in this transaction that\r\n * will cause the transaction to fail once it actually commits.\r\n */\r\n this.lastWriteError = null;\r\n /**\r\n * Set of documents that have been written in the transaction.\r\n *\r\n * When there's more than one write to the same key in a transaction, any\r\n * writes after the first are handled differently.\r\n */\r\n this.writtenDocs = new Set();\r\n }\r\n async lookup(keys) {\r\n this.ensureCommitNotCalled();\r\n if (this.mutations.length > 0) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Firestore transactions require all reads to be executed before all writes.');\r\n }\r\n const docs = await invokeBatchGetDocumentsRpc(this.datastore, keys);\r\n docs.forEach(doc => this.recordVersion(doc));\r\n return docs;\r\n }\r\n set(key, data) {\r\n this.write(data.toMutation(key, this.precondition(key)));\r\n this.writtenDocs.add(key.toString());\r\n }\r\n update(key, data) {\r\n try {\r\n this.write(data.toMutation(key, this.preconditionForUpdate(key)));\r\n }\r\n catch (e) {\r\n this.lastWriteError = e;\r\n }\r\n this.writtenDocs.add(key.toString());\r\n }\r\n delete(key) {\r\n this.write(new DeleteMutation(key, this.precondition(key)));\r\n this.writtenDocs.add(key.toString());\r\n }\r\n async commit() {\r\n this.ensureCommitNotCalled();\r\n if (this.lastWriteError) {\r\n throw this.lastWriteError;\r\n }\r\n const unwritten = this.readVersions;\r\n // For each mutation, note that the doc was written.\r\n this.mutations.forEach(mutation => {\r\n unwritten.delete(mutation.key.toString());\r\n });\r\n // For each document that was read but not written to, we want to perform\r\n // a `verify` operation.\r\n unwritten.forEach((_, path) => {\r\n const key = DocumentKey.fromPath(path);\r\n this.mutations.push(new VerifyMutation(key, this.precondition(key)));\r\n });\r\n await invokeCommitRpc(this.datastore, this.mutations);\r\n this.committed = true;\r\n }\r\n recordVersion(doc) {\r\n let docVersion;\r\n if (doc.isFoundDocument()) {\r\n docVersion = doc.version;\r\n }\r\n else if (doc.isNoDocument()) {\r\n // For deleted docs, we must use baseVersion 0 when we overwrite them.\r\n docVersion = SnapshotVersion.min();\r\n }\r\n else {\r\n throw fail();\r\n }\r\n const existingVersion = this.readVersions.get(doc.key.toString());\r\n if (existingVersion) {\r\n if (!docVersion.isEqual(existingVersion)) {\r\n // This transaction will fail no matter what.\r\n throw new FirestoreError(Code.ABORTED, 'Document version changed between two reads.');\r\n }\r\n }\r\n else {\r\n this.readVersions.set(doc.key.toString(), docVersion);\r\n }\r\n }\r\n /**\r\n * Returns the version of this document when it was read in this transaction,\r\n * as a precondition, or no precondition if it was not read.\r\n */\r\n precondition(key) {\r\n const version = this.readVersions.get(key.toString());\r\n if (!this.writtenDocs.has(key.toString()) && version) {\r\n return Precondition.updateTime(version);\r\n }\r\n else {\r\n return Precondition.none();\r\n }\r\n }\r\n /**\r\n * Returns the precondition for a document if the operation is an update.\r\n */\r\n preconditionForUpdate(key) {\r\n const version = this.readVersions.get(key.toString());\r\n // The first time a document is written, we want to take into account the\r\n // read time and existence\r\n if (!this.writtenDocs.has(key.toString()) && version) {\r\n if (version.isEqual(SnapshotVersion.min())) {\r\n // The document doesn't exist, so fail the transaction.\r\n // This has to be validated locally because you can't send a\r\n // precondition that a document does not exist without changing the\r\n // semantics of the backend write to be an insert. This is the reverse\r\n // of what we want, since we want to assert that the document doesn't\r\n // exist but then send the update and have it fail. Since we can't\r\n // express that to the backend, we have to validate locally.\r\n // Note: this can change once we can send separate verify writes in the\r\n // transaction.\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Can't update a document that doesn't exist.\");\r\n }\r\n // Document exists, base precondition on document update time.\r\n return Precondition.updateTime(version);\r\n }\r\n else {\r\n // Document was not read, so we just use the preconditions for a blind\r\n // update.\r\n return Precondition.exists(true);\r\n }\r\n }\r\n write(mutation) {\r\n this.ensureCommitNotCalled();\r\n this.mutations.push(mutation);\r\n }\r\n ensureCommitNotCalled() {\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst DEFAULT_MAX_ATTEMPTS_COUNT = 5;\r\n/**\r\n * TransactionRunner encapsulates the logic needed to run and retry transactions\r\n * with backoff.\r\n */\r\nclass TransactionRunner {\r\n constructor(asyncQueue, datastore, updateFunction, deferred) {\r\n this.asyncQueue = asyncQueue;\r\n this.datastore = datastore;\r\n this.updateFunction = updateFunction;\r\n this.deferred = deferred;\r\n this.attemptsRemaining = DEFAULT_MAX_ATTEMPTS_COUNT;\r\n this.backoff = new ExponentialBackoff(this.asyncQueue, \"transaction_retry\" /* TransactionRetry */);\r\n }\r\n /** Runs the transaction and sets the result on deferred. */\r\n run() {\r\n this.attemptsRemaining -= 1;\r\n this.runWithBackOff();\r\n }\r\n runWithBackOff() {\r\n this.backoff.backoffAndRun(async () => {\r\n const transaction = new Transaction$2(this.datastore);\r\n const userPromise = this.tryRunUpdateFunction(transaction);\r\n if (userPromise) {\r\n userPromise\r\n .then(result => {\r\n this.asyncQueue.enqueueAndForget(() => {\r\n return transaction\r\n .commit()\r\n .then(() => {\r\n this.deferred.resolve(result);\r\n })\r\n .catch(commitError => {\r\n this.handleTransactionError(commitError);\r\n });\r\n });\r\n })\r\n .catch(userPromiseError => {\r\n this.handleTransactionError(userPromiseError);\r\n });\r\n }\r\n });\r\n }\r\n tryRunUpdateFunction(transaction) {\r\n try {\r\n const userPromise = this.updateFunction(transaction);\r\n if (isNullOrUndefined(userPromise) ||\r\n !userPromise.catch ||\r\n !userPromise.then) {\r\n this.deferred.reject(Error('Transaction callback must return a Promise'));\r\n return null;\r\n }\r\n return userPromise;\r\n }\r\n catch (error) {\r\n // Do not retry errors thrown by user provided updateFunction.\r\n this.deferred.reject(error);\r\n return null;\r\n }\r\n }\r\n handleTransactionError(error) {\r\n if (this.attemptsRemaining > 0 && this.isRetryableTransactionError(error)) {\r\n this.attemptsRemaining -= 1;\r\n this.asyncQueue.enqueueAndForget(() => {\r\n this.runWithBackOff();\r\n return Promise.resolve();\r\n });\r\n }\r\n else {\r\n this.deferred.reject(error);\r\n }\r\n }\r\n isRetryableTransactionError(error) {\r\n if (error.name === 'FirebaseError') {\r\n // In transactions, the backend will fail outdated reads with FAILED_PRECONDITION and\r\n // non-matching document versions with ABORTED. These errors should be retried.\r\n const code = error.code;\r\n return (code === 'aborted' ||\r\n code === 'failed-precondition' ||\r\n !isPermanentError(code));\r\n }\r\n return false;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst LOG_TAG$2 = 'FirestoreClient';\r\nconst MAX_CONCURRENT_LIMBO_RESOLUTIONS = 100;\r\n/**\r\n * FirestoreClient is a top-level class that constructs and owns all of the\r\n * pieces of the client SDK architecture. It is responsible for creating the\r\n * async queue that is shared by all of the other components in the system.\r\n */\r\nclass FirestoreClient {\r\n constructor(credentials, \r\n /**\r\n * Asynchronous queue responsible for all of our internal processing. When\r\n * we get incoming work from the user (via public API) or the network\r\n * (incoming GRPC messages), we should always schedule onto this queue.\r\n * This ensures all of our work is properly serialized (e.g. we don't\r\n * start processing a new operation while the previous one is waiting for\r\n * an async I/O to complete).\r\n */\r\n asyncQueue, databaseInfo) {\r\n this.credentials = credentials;\r\n this.asyncQueue = asyncQueue;\r\n this.databaseInfo = databaseInfo;\r\n this.user = User.UNAUTHENTICATED;\r\n this.clientId = AutoId.newId();\r\n this.credentialListener = () => Promise.resolve();\r\n this.credentials.start(asyncQueue, async (user) => {\r\n logDebug(LOG_TAG$2, 'Received user=', user.uid);\r\n await this.credentialListener(user);\r\n this.user = user;\r\n });\r\n }\r\n async getConfiguration() {\r\n return {\r\n asyncQueue: this.asyncQueue,\r\n databaseInfo: this.databaseInfo,\r\n clientId: this.clientId,\r\n credentials: this.credentials,\r\n initialUser: this.user,\r\n maxConcurrentLimboResolutions: MAX_CONCURRENT_LIMBO_RESOLUTIONS\r\n };\r\n }\r\n setCredentialChangeListener(listener) {\r\n this.credentialListener = listener;\r\n }\r\n /**\r\n * Checks that the client has not been terminated. Ensures that other methods on\r\n * this class cannot be called after the client is terminated.\r\n */\r\n verifyNotTerminated() {\r\n if (this.asyncQueue.isShuttingDown) {\r\n throw new FirestoreError(Code.FAILED_PRECONDITION, 'The client has already been terminated.');\r\n }\r\n }\r\n terminate() {\r\n this.asyncQueue.enterRestrictedMode();\r\n const deferred = new Deferred();\r\n this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async () => {\r\n try {\r\n if (this.onlineComponents) {\r\n await this.onlineComponents.terminate();\r\n }\r\n if (this.offlineComponents) {\r\n await this.offlineComponents.terminate();\r\n }\r\n // The credentials provider must be terminated after shutting down the\r\n // RemoteStore as it will prevent the RemoteStore from retrieving auth\r\n // tokens.\r\n this.credentials.shutdown();\r\n deferred.resolve();\r\n }\r\n catch (e) {\r\n const firestoreError = wrapInUserErrorIfRecoverable(e, `Failed to shutdown persistence`);\r\n deferred.reject(firestoreError);\r\n }\r\n });\r\n return deferred.promise;\r\n }\r\n}\r\nasync function setOfflineComponentProvider(client, offlineComponentProvider) {\r\n client.asyncQueue.verifyOperationInProgress();\r\n logDebug(LOG_TAG$2, 'Initializing OfflineComponentProvider');\r\n const configuration = await client.getConfiguration();\r\n await offlineComponentProvider.initialize(configuration);\r\n let currentUser = configuration.initialUser;\r\n client.setCredentialChangeListener(async (user) => {\r\n if (!currentUser.isEqual(user)) {\r\n await localStoreHandleUserChange(offlineComponentProvider.localStore, user);\r\n currentUser = user;\r\n }\r\n });\r\n // When a user calls clearPersistence() in one client, all other clients\r\n // need to be terminated to allow the delete to succeed.\r\n offlineComponentProvider.persistence.setDatabaseDeletedListener(() => client.terminate());\r\n client.offlineComponents = offlineComponentProvider;\r\n}\r\nasync function setOnlineComponentProvider(client, onlineComponentProvider) {\r\n client.asyncQueue.verifyOperationInProgress();\r\n const offlineComponentProvider = await ensureOfflineComponents(client);\r\n logDebug(LOG_TAG$2, 'Initializing OnlineComponentProvider');\r\n const configuration = await client.getConfiguration();\r\n await onlineComponentProvider.initialize(offlineComponentProvider, configuration);\r\n // The CredentialChangeListener of the online component provider takes\r\n // precedence over the offline component provider.\r\n client.setCredentialChangeListener(user => remoteStoreHandleCredentialChange(onlineComponentProvider.remoteStore, user));\r\n client.onlineComponents = onlineComponentProvider;\r\n}\r\nasync function ensureOfflineComponents(client) {\r\n if (!client.offlineComponents) {\r\n logDebug(LOG_TAG$2, 'Using default OfflineComponentProvider');\r\n await setOfflineComponentProvider(client, new MemoryOfflineComponentProvider());\r\n }\r\n return client.offlineComponents;\r\n}\r\nasync function ensureOnlineComponents(client) {\r\n if (!client.onlineComponents) {\r\n logDebug(LOG_TAG$2, 'Using default OnlineComponentProvider');\r\n await setOnlineComponentProvider(client, new OnlineComponentProvider());\r\n }\r\n return client.onlineComponents;\r\n}\r\nfunction getPersistence(client) {\r\n return ensureOfflineComponents(client).then(c => c.persistence);\r\n}\r\nfunction getLocalStore(client) {\r\n return ensureOfflineComponents(client).then(c => c.localStore);\r\n}\r\nfunction getRemoteStore(client) {\r\n return ensureOnlineComponents(client).then(c => c.remoteStore);\r\n}\r\nfunction getSyncEngine(client) {\r\n return ensureOnlineComponents(client).then(c => c.syncEngine);\r\n}\r\nfunction getDatastore(client) {\r\n return ensureOnlineComponents(client).then(c => c.datastore);\r\n}\r\nasync function getEventManager(client) {\r\n const onlineComponentProvider = await ensureOnlineComponents(client);\r\n const eventManager = onlineComponentProvider.eventManager;\r\n eventManager.onListen = syncEngineListen.bind(null, onlineComponentProvider.syncEngine);\r\n eventManager.onUnlisten = syncEngineUnlisten.bind(null, onlineComponentProvider.syncEngine);\r\n return eventManager;\r\n}\r\n/** Enables the network connection and re-enqueues all pending operations. */\r\nfunction firestoreClientEnableNetwork(client) {\r\n return client.asyncQueue.enqueue(async () => {\r\n const persistence = await getPersistence(client);\r\n const remoteStore = await getRemoteStore(client);\r\n persistence.setNetworkEnabled(true);\r\n return remoteStoreEnableNetwork(remoteStore);\r\n });\r\n}\r\n/** Disables the network connection. Pending operations will not complete. */\r\nfunction firestoreClientDisableNetwork(client) {\r\n return client.asyncQueue.enqueue(async () => {\r\n const persistence = await getPersistence(client);\r\n const remoteStore = await getRemoteStore(client);\r\n persistence.setNetworkEnabled(false);\r\n return remoteStoreDisableNetwork(remoteStore);\r\n });\r\n}\r\n/**\r\n * Returns a Promise that resolves when all writes that were pending at the time\r\n * this method was called received server acknowledgement. An acknowledgement\r\n * can be either acceptance or rejection.\r\n */\r\nfunction firestoreClientWaitForPendingWrites(client) {\r\n const deferred = new Deferred();\r\n client.asyncQueue.enqueueAndForget(async () => {\r\n const syncEngine = await getSyncEngine(client);\r\n return syncEngineRegisterPendingWritesCallback(syncEngine, deferred);\r\n });\r\n return deferred.promise;\r\n}\r\nfunction firestoreClientListen(client, query, options, observer) {\r\n const wrappedObserver = new AsyncObserver(observer);\r\n const listener = new QueryListener(query, wrappedObserver, options);\r\n client.asyncQueue.enqueueAndForget(async () => {\r\n const eventManager = await getEventManager(client);\r\n return eventManagerListen(eventManager, listener);\r\n });\r\n return () => {\r\n wrappedObserver.mute();\r\n client.asyncQueue.enqueueAndForget(async () => {\r\n const eventManager = await getEventManager(client);\r\n return eventManagerUnlisten(eventManager, listener);\r\n });\r\n };\r\n}\r\nfunction firestoreClientGetDocumentFromLocalCache(client, docKey) {\r\n const deferred = new Deferred();\r\n client.asyncQueue.enqueueAndForget(async () => {\r\n const localStore = await getLocalStore(client);\r\n return readDocumentFromCache(localStore, docKey, deferred);\r\n });\r\n return deferred.promise;\r\n}\r\nfunction firestoreClientGetDocumentViaSnapshotListener(client, key, options = {}) {\r\n const deferred = new Deferred();\r\n client.asyncQueue.enqueueAndForget(async () => {\r\n const eventManager = await getEventManager(client);\r\n return readDocumentViaSnapshotListener(eventManager, client.asyncQueue, key, options, deferred);\r\n });\r\n return deferred.promise;\r\n}\r\nfunction firestoreClientGetDocumentsFromLocalCache(client, query) {\r\n const deferred = new Deferred();\r\n client.asyncQueue.enqueueAndForget(async () => {\r\n const localStore = await getLocalStore(client);\r\n return executeQueryFromCache(localStore, query, deferred);\r\n });\r\n return deferred.promise;\r\n}\r\nfunction firestoreClientGetDocumentsViaSnapshotListener(client, query, options = {}) {\r\n const deferred = new Deferred();\r\n client.asyncQueue.enqueueAndForget(async () => {\r\n const eventManager = await getEventManager(client);\r\n return executeQueryViaSnapshotListener(eventManager, client.asyncQueue, query, options, deferred);\r\n });\r\n return deferred.promise;\r\n}\r\nfunction firestoreClientWrite(client, mutations) {\r\n const deferred = new Deferred();\r\n client.asyncQueue.enqueueAndForget(async () => {\r\n const syncEngine = await getSyncEngine(client);\r\n return syncEngineWrite(syncEngine, mutations, deferred);\r\n });\r\n return deferred.promise;\r\n}\r\nfunction firestoreClientAddSnapshotsInSyncListener(client, observer) {\r\n const wrappedObserver = new AsyncObserver(observer);\r\n client.asyncQueue.enqueueAndForget(async () => {\r\n const eventManager = await getEventManager(client);\r\n return addSnapshotsInSyncListener(eventManager, wrappedObserver);\r\n });\r\n return () => {\r\n wrappedObserver.mute();\r\n client.asyncQueue.enqueueAndForget(async () => {\r\n const eventManager = await getEventManager(client);\r\n return removeSnapshotsInSyncListener(eventManager, wrappedObserver);\r\n });\r\n };\r\n}\r\n/**\r\n * Takes an updateFunction in which a set of reads and writes can be performed\r\n * atomically. In the updateFunction, the client can read and write values\r\n * using the supplied transaction object. After the updateFunction, all\r\n * changes will be committed. If a retryable error occurs (ex: some other\r\n * client has changed any of the data referenced), then the updateFunction\r\n * will be called again after a backoff. If the updateFunction still fails\r\n * after all retries, then the transaction will be rejected.\r\n *\r\n * The transaction object passed to the updateFunction contains methods for\r\n * accessing documents and collections. Unlike other datastore access, data\r\n * accessed with the transaction will not reflect local changes that have not\r\n * been committed. For this reason, it is required that all reads are\r\n * performed before any writes. Transactions must be performed while online.\r\n */\r\nfunction firestoreClientTransaction(client, updateFunction) {\r\n const deferred = new Deferred();\r\n client.asyncQueue.enqueueAndForget(async () => {\r\n const datastore = await getDatastore(client);\r\n new TransactionRunner(client.asyncQueue, datastore, updateFunction, deferred).run();\r\n });\r\n return deferred.promise;\r\n}\r\nasync function readDocumentFromCache(localStore, docKey, result) {\r\n try {\r\n const document = await localStoreReadDocument(localStore, docKey);\r\n if (document.isFoundDocument()) {\r\n result.resolve(document);\r\n }\r\n else if (document.isNoDocument()) {\r\n result.resolve(null);\r\n }\r\n else {\r\n result.reject(new FirestoreError(Code.UNAVAILABLE, 'Failed to get document from cache. (However, this document may ' +\r\n \"exist on the server. Run again without setting 'source' in \" +\r\n 'the GetOptions to attempt to retrieve the document from the ' +\r\n 'server.)'));\r\n }\r\n }\r\n catch (e) {\r\n const firestoreError = wrapInUserErrorIfRecoverable(e, `Failed to get document '${docKey} from cache`);\r\n result.reject(firestoreError);\r\n }\r\n}\r\n/**\r\n * Retrieves a latency-compensated document from the backend via a\r\n * SnapshotListener.\r\n */\r\nfunction readDocumentViaSnapshotListener(eventManager, asyncQueue, key, options, result) {\r\n const wrappedObserver = new AsyncObserver({\r\n next: (snap) => {\r\n // Remove query first before passing event to user to avoid\r\n // user actions affecting the now stale query.\r\n asyncQueue.enqueueAndForget(() => eventManagerUnlisten(eventManager, listener));\r\n const exists = snap.docs.has(key);\r\n if (!exists && snap.fromCache) {\r\n // TODO(dimond): If we're online and the document doesn't\r\n // exist then we resolve with a doc.exists set to false. If\r\n // we're offline however, we reject the Promise in this\r\n // case. Two options: 1) Cache the negative response from\r\n // the server so we can deliver that even when you're\r\n // offline 2) Actually reject the Promise in the online case\r\n // if the document doesn't exist.\r\n result.reject(new FirestoreError(Code.UNAVAILABLE, 'Failed to get document because the client is offline.'));\r\n }\r\n else if (exists &&\r\n snap.fromCache &&\r\n options &&\r\n options.source === 'server') {\r\n result.reject(new FirestoreError(Code.UNAVAILABLE, 'Failed to get document from server. (However, this ' +\r\n 'document does exist in the local cache. Run again ' +\r\n 'without setting source to \"server\" to ' +\r\n 'retrieve the cached document.)'));\r\n }\r\n else {\r\n result.resolve(snap);\r\n }\r\n },\r\n error: e => result.reject(e)\r\n });\r\n const listener = new QueryListener(newQueryForPath(key.path), wrappedObserver, {\r\n includeMetadataChanges: true,\r\n waitForSyncWhenOnline: true\r\n });\r\n return eventManagerListen(eventManager, listener);\r\n}\r\nasync function executeQueryFromCache(localStore, query, result) {\r\n try {\r\n const queryResult = await localStoreExecuteQuery(localStore, query, \r\n /* usePreviousResults= */ true);\r\n const view = new View(query, queryResult.remoteKeys);\r\n const viewDocChanges = view.computeDocChanges(queryResult.documents);\r\n const viewChange = view.applyChanges(viewDocChanges, \r\n /* updateLimboDocuments= */ false);\r\n result.resolve(viewChange.snapshot);\r\n }\r\n catch (e) {\r\n const firestoreError = wrapInUserErrorIfRecoverable(e, `Failed to execute query '${query} against cache`);\r\n result.reject(firestoreError);\r\n }\r\n}\r\n/**\r\n * Retrieves a latency-compensated query snapshot from the backend via a\r\n * SnapshotListener.\r\n */\r\nfunction executeQueryViaSnapshotListener(eventManager, asyncQueue, query, options, result) {\r\n const wrappedObserver = new AsyncObserver({\r\n next: snapshot => {\r\n // Remove query first before passing event to user to avoid\r\n // user actions affecting the now stale query.\r\n asyncQueue.enqueueAndForget(() => eventManagerUnlisten(eventManager, listener));\r\n if (snapshot.fromCache && options.source === 'server') {\r\n result.reject(new FirestoreError(Code.UNAVAILABLE, 'Failed to get documents from server. (However, these ' +\r\n 'documents may exist in the local cache. Run again ' +\r\n 'without setting source to \"server\" to ' +\r\n 'retrieve the cached documents.)'));\r\n }\r\n else {\r\n result.resolve(snapshot);\r\n }\r\n },\r\n error: e => result.reject(e)\r\n });\r\n const listener = new QueryListener(query, wrappedObserver, {\r\n includeMetadataChanges: true,\r\n waitForSyncWhenOnline: true\r\n });\r\n return eventManagerListen(eventManager, listener);\r\n}\r\nfunction firestoreClientLoadBundle(client, databaseId, data, resultTask) {\r\n const reader = createBundleReader(data, newSerializer(databaseId));\r\n client.asyncQueue.enqueueAndForget(async () => {\r\n syncEngineLoadBundle(await getSyncEngine(client), reader, resultTask);\r\n });\r\n}\r\nfunction firestoreClientGetNamedQuery(client, queryName) {\r\n return client.asyncQueue.enqueue(async () => localStoreGetNamedQuery(await getLocalStore(client), queryName));\r\n}\r\nfunction createBundleReader(data, serializer) {\r\n let content;\r\n if (typeof data === 'string') {\r\n content = newTextEncoder().encode(data);\r\n }\r\n else {\r\n content = data;\r\n }\r\n return newBundleReader(toByteStreamReader(content), serializer);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nclass DatabaseInfo {\r\n /**\r\n * Constructs a DatabaseInfo using the provided host, databaseId and\r\n * persistenceKey.\r\n *\r\n * @param databaseId - The database to use.\r\n * @param appId - The Firebase App Id.\r\n * @param persistenceKey - A unique identifier for this Firestore's local\r\n * storage (used in conjunction with the databaseId).\r\n * @param host - The Firestore backend host to connect to.\r\n * @param ssl - Whether to use SSL when connecting.\r\n * @param forceLongPolling - Whether to use the forceLongPolling option\r\n * when using WebChannel as the network transport.\r\n * @param autoDetectLongPolling - Whether to use the detectBufferingProxy\r\n * option when using WebChannel as the network transport.\r\n * @param useFetchStreams Whether to use the Fetch API instead of\r\n * XMLHTTPRequest\r\n */\r\n constructor(databaseId, appId, persistenceKey, host, ssl, forceLongPolling, autoDetectLongPolling, useFetchStreams) {\r\n this.databaseId = databaseId;\r\n this.appId = appId;\r\n this.persistenceKey = persistenceKey;\r\n this.host = host;\r\n this.ssl = ssl;\r\n this.forceLongPolling = forceLongPolling;\r\n this.autoDetectLongPolling = autoDetectLongPolling;\r\n this.useFetchStreams = useFetchStreams;\r\n }\r\n}\r\n/** The default database name for a project. */\r\nconst DEFAULT_DATABASE_NAME = '(default)';\r\n/**\r\n * Represents the database ID a Firestore client is associated with.\r\n * @internal\r\n */\r\nclass DatabaseId {\r\n constructor(projectId, database) {\r\n this.projectId = projectId;\r\n this.database = database ? database : DEFAULT_DATABASE_NAME;\r\n }\r\n get isDefaultDatabase() {\r\n return this.database === DEFAULT_DATABASE_NAME;\r\n }\r\n isEqual(other) {\r\n return (other instanceof DatabaseId &&\r\n other.projectId === this.projectId &&\r\n other.database === this.database);\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst LOG_TAG$1 = 'ComponentProvider';\r\n/**\r\n * An instance map that ensures only one Datastore exists per Firestore\r\n * instance.\r\n */\r\nconst datastoreInstances = new Map();\r\n/**\r\n * Removes all components associated with the provided instance. Must be called\r\n * when the `Firestore` instance is terminated.\r\n */\r\nfunction removeComponents(firestore) {\r\n const datastore = datastoreInstances.get(firestore);\r\n if (datastore) {\r\n logDebug(LOG_TAG$1, 'Removing Datastore');\r\n datastoreInstances.delete(firestore);\r\n datastore.terminate();\r\n }\r\n}\r\nfunction makeDatabaseInfo(databaseId, appId, persistenceKey, settings) {\r\n return new DatabaseInfo(databaseId, appId, persistenceKey, settings.host, settings.ssl, settings.experimentalForceLongPolling, settings.experimentalAutoDetectLongPolling, settings.useFetchStreams);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// settings() defaults:\r\nconst DEFAULT_HOST = 'firestore.googleapis.com';\r\nconst DEFAULT_SSL = true;\r\n/**\r\n * A concrete type describing all the values that can be applied via a\r\n * user-supplied `FirestoreSettings` object. This is a separate type so that\r\n * defaults can be supplied and the value can be checked for equality.\r\n */\r\nclass FirestoreSettingsImpl {\r\n constructor(settings) {\r\n var _a;\r\n if (settings.host === undefined) {\r\n if (settings.ssl !== undefined) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Can't provide ssl option if host option is not set\");\r\n }\r\n this.host = DEFAULT_HOST;\r\n this.ssl = DEFAULT_SSL;\r\n }\r\n else {\r\n this.host = settings.host;\r\n this.ssl = (_a = settings.ssl) !== null && _a !== void 0 ? _a : DEFAULT_SSL;\r\n }\r\n this.credentials = settings.credentials;\r\n this.ignoreUndefinedProperties = !!settings.ignoreUndefinedProperties;\r\n if (settings.cacheSizeBytes === undefined) {\r\n this.cacheSizeBytes = LRU_DEFAULT_CACHE_SIZE_BYTES;\r\n }\r\n else {\r\n if (settings.cacheSizeBytes !== LRU_COLLECTION_DISABLED &&\r\n settings.cacheSizeBytes < LRU_MINIMUM_CACHE_SIZE_BYTES) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, `cacheSizeBytes must be at least ${LRU_MINIMUM_CACHE_SIZE_BYTES}`);\r\n }\r\n else {\r\n this.cacheSizeBytes = settings.cacheSizeBytes;\r\n }\r\n }\r\n this.experimentalForceLongPolling = !!settings.experimentalForceLongPolling;\r\n this.experimentalAutoDetectLongPolling =\r\n !!settings.experimentalAutoDetectLongPolling;\r\n this.useFetchStreams = !!settings.useFetchStreams;\r\n validateIsNotUsedTogether('experimentalForceLongPolling', settings.experimentalForceLongPolling, 'experimentalAutoDetectLongPolling', settings.experimentalAutoDetectLongPolling);\r\n }\r\n isEqual(other) {\r\n return (this.host === other.host &&\r\n this.ssl === other.ssl &&\r\n this.credentials === other.credentials &&\r\n this.cacheSizeBytes === other.cacheSizeBytes &&\r\n this.experimentalForceLongPolling ===\r\n other.experimentalForceLongPolling &&\r\n this.experimentalAutoDetectLongPolling ===\r\n other.experimentalAutoDetectLongPolling &&\r\n this.ignoreUndefinedProperties === other.ignoreUndefinedProperties &&\r\n this.useFetchStreams === other.useFetchStreams);\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * The Cloud Firestore service interface.\r\n *\r\n * Do not call this constructor directly. Instead, use {@link getFirestore}.\r\n */\r\nclass Firestore$1 {\r\n /** @hideconstructor */\r\n constructor(databaseIdOrApp, _credentials) {\r\n this._credentials = _credentials;\r\n /**\r\n * Whether it's a Firestore or Firestore Lite instance.\r\n */\r\n this.type = 'firestore-lite';\r\n this._persistenceKey = '(lite)';\r\n this._settings = new FirestoreSettingsImpl({});\r\n this._settingsFrozen = false;\r\n if (databaseIdOrApp instanceof DatabaseId) {\r\n this._databaseId = databaseIdOrApp;\r\n }\r\n else {\r\n this._app = databaseIdOrApp;\r\n this._databaseId = databaseIdFromApp(databaseIdOrApp);\r\n }\r\n }\r\n /**\r\n * The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service\r\n * instance.\r\n */\r\n get app() {\r\n if (!this._app) {\r\n throw new FirestoreError(Code.FAILED_PRECONDITION, \"Firestore was not initialized using the Firebase SDK. 'app' is \" +\r\n 'not available');\r\n }\r\n return this._app;\r\n }\r\n get _initialized() {\r\n return this._settingsFrozen;\r\n }\r\n get _terminated() {\r\n return this._terminateTask !== undefined;\r\n }\r\n _setSettings(settings) {\r\n if (this._settingsFrozen) {\r\n throw new FirestoreError(Code.FAILED_PRECONDITION, 'Firestore has already been started and its settings can no longer ' +\r\n 'be changed. You can only modify settings before calling any other ' +\r\n 'methods on a Firestore object.');\r\n }\r\n this._settings = new FirestoreSettingsImpl(settings);\r\n if (settings.credentials !== undefined) {\r\n this._credentials = makeCredentialsProvider(settings.credentials);\r\n }\r\n }\r\n _getSettings() {\r\n return this._settings;\r\n }\r\n _freezeSettings() {\r\n this._settingsFrozen = true;\r\n return this._settings;\r\n }\r\n _delete() {\r\n if (!this._terminateTask) {\r\n this._terminateTask = this._terminate();\r\n }\r\n return this._terminateTask;\r\n }\r\n /** Returns a JSON-serializable representation of this `Firestore` instance. */\r\n toJSON() {\r\n return {\r\n app: this._app,\r\n databaseId: this._databaseId,\r\n settings: this._settings\r\n };\r\n }\r\n /**\r\n * Terminates all components used by this client. Subclasses can override\r\n * this method to clean up their own dependencies, but must also call this\r\n * method.\r\n *\r\n * Only ever called once.\r\n */\r\n _terminate() {\r\n removeComponents(this);\r\n return Promise.resolve();\r\n }\r\n}\r\nfunction databaseIdFromApp(app) {\r\n if (!Object.prototype.hasOwnProperty.apply(app.options, ['projectId'])) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, '\"projectId\" not provided in firebase.initializeApp.');\r\n }\r\n return new DatabaseId(app.options.projectId);\r\n}\r\n/**\r\n * Modify this instance to communicate with the Cloud Firestore emulator.\r\n *\r\n * Note: This must be called before this instance has been used to do any\r\n * operations.\r\n *\r\n * @param firestore - The `Firestore` instance to configure to connect to the\r\n * emulator.\r\n * @param host - the emulator host (ex: localhost).\r\n * @param port - the emulator port (ex: 9000).\r\n * @param options.mockUserToken - the mock auth token to use for unit testing\r\n * Security Rules.\r\n */\r\nfunction connectFirestoreEmulator(firestore, host, port, options = {}) {\r\n var _a;\r\n firestore = cast(firestore, Firestore$1);\r\n const settings = firestore._getSettings();\r\n if (settings.host !== DEFAULT_HOST && settings.host !== host) {\r\n logWarn('Host has been set in both settings() and useEmulator(), emulator host ' +\r\n 'will be used');\r\n }\r\n firestore._setSettings(Object.assign(Object.assign({}, settings), { host: `${host}:${port}`, ssl: false }));\r\n if (options.mockUserToken) {\r\n let token;\r\n let user;\r\n if (typeof options.mockUserToken === 'string') {\r\n token = options.mockUserToken;\r\n user = User.MOCK_USER;\r\n }\r\n else {\r\n // Let createMockUserToken validate first (catches common mistakes like\r\n // invalid field \"uid\" and missing field \"sub\" / \"user_id\".)\r\n token = createMockUserToken(options.mockUserToken, (_a = firestore._app) === null || _a === void 0 ? void 0 : _a.options.projectId);\r\n const uid = options.mockUserToken.sub || options.mockUserToken.user_id;\r\n if (!uid) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"mockUserToken must contain 'sub' or 'user_id' field!\");\r\n }\r\n user = new User(uid);\r\n }\r\n firestore._credentials = new EmulatorCredentialsProvider(new OAuthToken(token, user));\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A `DocumentReference` refers to a document location in a Firestore database\r\n * and can be used to write, read, or listen to the location. The document at\r\n * the referenced location may or may not exist.\r\n */\r\nclass DocumentReference {\r\n /** @hideconstructor */\r\n constructor(firestore, \r\n /**\r\n * If provided, the `FirestoreDataConverter` associated with this instance.\r\n */\r\n converter, _key) {\r\n this.converter = converter;\r\n this._key = _key;\r\n /** The type of this Firestore reference. */\r\n this.type = 'document';\r\n this.firestore = firestore;\r\n }\r\n get _path() {\r\n return this._key.path;\r\n }\r\n /**\r\n * The document's identifier within its collection.\r\n */\r\n get id() {\r\n return this._key.path.lastSegment();\r\n }\r\n /**\r\n * A string representing the path of the referenced document (relative\r\n * to the root of the database).\r\n */\r\n get path() {\r\n return this._key.path.canonicalString();\r\n }\r\n /**\r\n * The collection this `DocumentReference` belongs to.\r\n */\r\n get parent() {\r\n return new CollectionReference(this.firestore, this.converter, this._key.path.popLast());\r\n }\r\n withConverter(converter) {\r\n return new DocumentReference(this.firestore, converter, this._key);\r\n }\r\n}\r\n/**\r\n * A `Query` refers to a query which you can read or listen to. You can also\r\n * construct refined `Query` objects by adding filters and ordering.\r\n */\r\nclass Query {\r\n // This is the lite version of the Query class in the main SDK.\r\n /** @hideconstructor protected */\r\n constructor(firestore, \r\n /**\r\n * If provided, the `FirestoreDataConverter` associated with this instance.\r\n */\r\n converter, _query) {\r\n this.converter = converter;\r\n this._query = _query;\r\n /** The type of this Firestore reference. */\r\n this.type = 'query';\r\n this.firestore = firestore;\r\n }\r\n withConverter(converter) {\r\n return new Query(this.firestore, converter, this._query);\r\n }\r\n}\r\n/**\r\n * A `CollectionReference` object can be used for adding documents, getting\r\n * document references, and querying for documents (using {@link query}).\r\n */\r\nclass CollectionReference extends Query {\r\n /** @hideconstructor */\r\n constructor(firestore, converter, _path) {\r\n super(firestore, converter, newQueryForPath(_path));\r\n this._path = _path;\r\n /** The type of this Firestore reference. */\r\n this.type = 'collection';\r\n }\r\n /** The collection's identifier. */\r\n get id() {\r\n return this._query.path.lastSegment();\r\n }\r\n /**\r\n * A string representing the path of the referenced collection (relative\r\n * to the root of the database).\r\n */\r\n get path() {\r\n return this._query.path.canonicalString();\r\n }\r\n /**\r\n * A reference to the containing `DocumentReference` if this is a\r\n * subcollection. If this isn't a subcollection, the reference is null.\r\n */\r\n get parent() {\r\n const parentPath = this._path.popLast();\r\n if (parentPath.isEmpty()) {\r\n return null;\r\n }\r\n else {\r\n return new DocumentReference(this.firestore, \r\n /* converter= */ null, new DocumentKey(parentPath));\r\n }\r\n }\r\n withConverter(converter) {\r\n return new CollectionReference(this.firestore, converter, this._path);\r\n }\r\n}\r\nfunction collection(parent, path, ...pathSegments) {\r\n parent = getModularInstance(parent);\r\n validateNonEmptyArgument('collection', 'path', path);\r\n if (parent instanceof Firestore$1) {\r\n const absolutePath = ResourcePath.fromString(path, ...pathSegments);\r\n validateCollectionPath(absolutePath);\r\n return new CollectionReference(parent, /* converter= */ null, absolutePath);\r\n }\r\n else {\r\n if (!(parent instanceof DocumentReference) &&\r\n !(parent instanceof CollectionReference)) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Expected first argument to collection() to be a CollectionReference, ' +\r\n 'a DocumentReference or FirebaseFirestore');\r\n }\r\n const absolutePath = parent._path.child(ResourcePath.fromString(path, ...pathSegments));\r\n validateCollectionPath(absolutePath);\r\n return new CollectionReference(parent.firestore, \r\n /* converter= */ null, absolutePath);\r\n }\r\n}\r\n// TODO(firestorelite): Consider using ErrorFactory -\r\n// https://github.com/firebase/firebase-js-sdk/blob/0131e1f/packages/util/src/errors.ts#L106\r\n/**\r\n * Creates and returns a new `Query` instance that includes all documents in the\r\n * database that are contained in a collection or subcollection with the\r\n * given `collectionId`.\r\n *\r\n * @param firestore - A reference to the root `Firestore` instance.\r\n * @param collectionId - Identifies the collections to query over. Every\r\n * collection or subcollection with this ID as the last segment of its path\r\n * will be included. Cannot contain a slash.\r\n * @returns The created `Query`.\r\n */\r\nfunction collectionGroup(firestore, collectionId) {\r\n firestore = cast(firestore, Firestore$1);\r\n validateNonEmptyArgument('collectionGroup', 'collection id', collectionId);\r\n if (collectionId.indexOf('/') >= 0) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, `Invalid collection ID '${collectionId}' passed to function ` +\r\n `collectionGroup(). Collection IDs must not contain '/'.`);\r\n }\r\n return new Query(firestore, \r\n /* converter= */ null, newQueryForCollectionGroup(collectionId));\r\n}\r\nfunction doc(parent, path, ...pathSegments) {\r\n parent = getModularInstance(parent);\r\n // We allow omission of 'pathString' but explicitly prohibit passing in both\r\n // 'undefined' and 'null'.\r\n if (arguments.length === 1) {\r\n path = AutoId.newId();\r\n }\r\n validateNonEmptyArgument('doc', 'path', path);\r\n if (parent instanceof Firestore$1) {\r\n const absolutePath = ResourcePath.fromString(path, ...pathSegments);\r\n validateDocumentPath(absolutePath);\r\n return new DocumentReference(parent, \r\n /* converter= */ null, new DocumentKey(absolutePath));\r\n }\r\n else {\r\n if (!(parent instanceof DocumentReference) &&\r\n !(parent instanceof CollectionReference)) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Expected first argument to collection() to be a CollectionReference, ' +\r\n 'a DocumentReference or FirebaseFirestore');\r\n }\r\n const absolutePath = parent._path.child(ResourcePath.fromString(path, ...pathSegments));\r\n validateDocumentPath(absolutePath);\r\n return new DocumentReference(parent.firestore, parent instanceof CollectionReference ? parent.converter : null, new DocumentKey(absolutePath));\r\n }\r\n}\r\n/**\r\n * Returns true if the provided references are equal.\r\n *\r\n * @param left - A reference to compare.\r\n * @param right - A reference to compare.\r\n * @returns true if the references point to the same location in the same\r\n * Firestore database.\r\n */\r\nfunction refEqual(left, right) {\r\n left = getModularInstance(left);\r\n right = getModularInstance(right);\r\n if ((left instanceof DocumentReference ||\r\n left instanceof CollectionReference) &&\r\n (right instanceof DocumentReference || right instanceof CollectionReference)) {\r\n return (left.firestore === right.firestore &&\r\n left.path === right.path &&\r\n left.converter === right.converter);\r\n }\r\n return false;\r\n}\r\n/**\r\n * Returns true if the provided queries point to the same collection and apply\r\n * the same constraints.\r\n *\r\n * @param left - A `Query` to compare.\r\n * @param right - A `Query` to compare.\r\n * @returns true if the references point to the same location in the same\r\n * Firestore database.\r\n */\r\nfunction queryEqual(left, right) {\r\n left = getModularInstance(left);\r\n right = getModularInstance(right);\r\n if (left instanceof Query && right instanceof Query) {\r\n return (left.firestore === right.firestore &&\r\n queryEquals(left._query, right._query) &&\r\n left.converter === right.converter);\r\n }\r\n return false;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst LOG_TAG = 'AsyncQueue';\r\nclass AsyncQueueImpl {\r\n constructor() {\r\n // The last promise in the queue.\r\n this.tail = Promise.resolve();\r\n // A list of retryable operations. Retryable operations are run in order and\r\n // retried with backoff.\r\n this.retryableOps = [];\r\n // Is this AsyncQueue being shut down? Once it is set to true, it will not\r\n // be changed again.\r\n this._isShuttingDown = false;\r\n // Operations scheduled to be queued in the future. Operations are\r\n // automatically removed after they are run or canceled.\r\n this.delayedOperations = [];\r\n // visible for testing\r\n this.failure = null;\r\n // Flag set while there's an outstanding AsyncQueue operation, used for\r\n // assertion sanity-checks.\r\n this.operationInProgress = false;\r\n // Enabled during shutdown on Safari to prevent future access to IndexedDB.\r\n this.skipNonRestrictedTasks = false;\r\n // List of TimerIds to fast-forward delays for.\r\n this.timerIdsToSkip = [];\r\n // Backoff timer used to schedule retries for retryable operations\r\n this.backoff = new ExponentialBackoff(this, \"async_queue_retry\" /* AsyncQueueRetry */);\r\n // Visibility handler that triggers an immediate retry of all retryable\r\n // operations. Meant to speed up recovery when we regain file system access\r\n // after page comes into foreground.\r\n this.visibilityHandler = () => {\r\n this.backoff.skipBackoff();\r\n };\r\n }\r\n get isShuttingDown() {\r\n return this._isShuttingDown;\r\n }\r\n /**\r\n * Adds a new operation to the queue without waiting for it to complete (i.e.\r\n * we ignore the Promise result).\r\n */\r\n enqueueAndForget(op) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.enqueue(op);\r\n }\r\n enqueueAndForgetEvenWhileRestricted(op) {\r\n this.verifyNotFailed();\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.enqueueInternal(op);\r\n }\r\n enterRestrictedMode(purgeExistingTasks) {\r\n if (!this._isShuttingDown) {\r\n this._isShuttingDown = true;\r\n this.skipNonRestrictedTasks = purgeExistingTasks || false;\r\n }\r\n }\r\n enqueue(op) {\r\n this.verifyNotFailed();\r\n if (this._isShuttingDown) {\r\n // Return a Promise which never resolves.\r\n return new Promise(() => { });\r\n }\r\n // Create a deferred Promise that we can return to the callee. This\r\n // allows us to return a \"hanging Promise\" only to the callee and still\r\n // advance the queue even when the operation is not run.\r\n const task = new Deferred();\r\n return this.enqueueInternal(() => {\r\n if (this._isShuttingDown && this.skipNonRestrictedTasks) {\r\n // We do not resolve 'task'\r\n return Promise.resolve();\r\n }\r\n op().then(task.resolve, task.reject);\r\n return task.promise;\r\n }).then(() => task.promise);\r\n }\r\n enqueueRetryable(op) {\r\n this.enqueueAndForget(() => {\r\n this.retryableOps.push(op);\r\n return this.retryNextOp();\r\n });\r\n }\r\n /**\r\n * Runs the next operation from the retryable queue. If the operation fails,\r\n * reschedules with backoff.\r\n */\r\n async retryNextOp() {\r\n if (this.retryableOps.length === 0) {\r\n return;\r\n }\r\n try {\r\n await this.retryableOps[0]();\r\n this.retryableOps.shift();\r\n this.backoff.reset();\r\n }\r\n catch (e) {\r\n if (isIndexedDbTransactionError(e)) {\r\n logDebug(LOG_TAG, 'Operation failed with retryable error: ' + e);\r\n }\r\n else {\r\n throw e; // Failure will be handled by AsyncQueue\r\n }\r\n }\r\n if (this.retryableOps.length > 0) {\r\n // If there are additional operations, we re-schedule `retryNextOp()`.\r\n // This is necessary to run retryable operations that failed during\r\n // their initial attempt since we don't know whether they are already\r\n // enqueued. If, for example, `op1`, `op2`, `op3` are enqueued and `op1`\r\n // needs to be re-run, we will run `op1`, `op1`, `op2` using the\r\n // already enqueued calls to `retryNextOp()`. `op3()` will then run in the\r\n // call scheduled here.\r\n // Since `backoffAndRun()` cancels an existing backoff and schedules a\r\n // new backoff on every call, there is only ever a single additional\r\n // operation in the queue.\r\n this.backoff.backoffAndRun(() => this.retryNextOp());\r\n }\r\n }\r\n enqueueInternal(op) {\r\n const newTail = this.tail.then(() => {\r\n this.operationInProgress = true;\r\n return op()\r\n .catch((error) => {\r\n this.failure = error;\r\n this.operationInProgress = false;\r\n const message = getMessageOrStack(error);\r\n logError('INTERNAL UNHANDLED ERROR: ', message);\r\n // Re-throw the error so that this.tail becomes a rejected Promise and\r\n // all further attempts to chain (via .then) will just short-circuit\r\n // and return the rejected Promise.\r\n throw error;\r\n })\r\n .then(result => {\r\n this.operationInProgress = false;\r\n return result;\r\n });\r\n });\r\n this.tail = newTail;\r\n return newTail;\r\n }\r\n enqueueAfterDelay(timerId, delayMs, op) {\r\n this.verifyNotFailed();\r\n // Fast-forward delays for timerIds that have been overriden.\r\n if (this.timerIdsToSkip.indexOf(timerId) > -1) {\r\n delayMs = 0;\r\n }\r\n const delayedOp = DelayedOperation.createAndSchedule(this, timerId, delayMs, op, removedOp => this.removeDelayedOperation(removedOp));\r\n this.delayedOperations.push(delayedOp);\r\n return delayedOp;\r\n }\r\n verifyNotFailed() {\r\n if (this.failure) {\r\n fail();\r\n }\r\n }\r\n verifyOperationInProgress() {\r\n }\r\n /**\r\n * Waits until all currently queued tasks are finished executing. Delayed\r\n * operations are not run.\r\n */\r\n async drain() {\r\n // Operations in the queue prior to draining may have enqueued additional\r\n // operations. Keep draining the queue until the tail is no longer advanced,\r\n // which indicates that no more new operations were enqueued and that all\r\n // operations were executed.\r\n let currentTail;\r\n do {\r\n currentTail = this.tail;\r\n await currentTail;\r\n } while (currentTail !== this.tail);\r\n }\r\n /**\r\n * For Tests: Determine if a delayed operation with a particular TimerId\r\n * exists.\r\n */\r\n containsDelayedOperation(timerId) {\r\n for (const op of this.delayedOperations) {\r\n if (op.timerId === timerId) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n /**\r\n * For Tests: Runs some or all delayed operations early.\r\n *\r\n * @param lastTimerId - Delayed operations up to and including this TimerId\r\n * will be drained. Pass TimerId.All to run all delayed operations.\r\n * @returns a Promise that resolves once all operations have been run.\r\n */\r\n runAllDelayedOperationsUntil(lastTimerId) {\r\n // Note that draining may generate more delayed ops, so we do that first.\r\n return this.drain().then(() => {\r\n // Run ops in the same order they'd run if they ran naturally.\r\n this.delayedOperations.sort((a, b) => a.targetTimeMs - b.targetTimeMs);\r\n for (const op of this.delayedOperations) {\r\n op.skipDelay();\r\n if (lastTimerId !== \"all\" /* All */ && op.timerId === lastTimerId) {\r\n break;\r\n }\r\n }\r\n return this.drain();\r\n });\r\n }\r\n /**\r\n * For Tests: Skip all subsequent delays for a timer id.\r\n */\r\n skipDelaysForTimerId(timerId) {\r\n this.timerIdsToSkip.push(timerId);\r\n }\r\n /** Called once a DelayedOperation is run or canceled. */\r\n removeDelayedOperation(op) {\r\n // NOTE: indexOf / slice are O(n), but delayedOperations is expected to be small.\r\n const index = this.delayedOperations.indexOf(op);\r\n this.delayedOperations.splice(index, 1);\r\n }\r\n}\r\nfunction newAsyncQueue() {\r\n return new AsyncQueueImpl();\r\n}\r\n/**\r\n * Chrome includes Error.message in Error.stack. Other browsers do not.\r\n * This returns expected output of message + stack when available.\r\n * @param error - Error or FirestoreError\r\n */\r\nfunction getMessageOrStack(error) {\r\n let message = error.message || '';\r\n if (error.stack) {\r\n if (error.stack.includes(error.message)) {\r\n message = error.stack;\r\n }\r\n else {\r\n message = error.message + '\\n' + error.stack;\r\n }\r\n }\r\n return message;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Represents the task of loading a Firestore bundle. It provides progress of bundle\r\n * loading, as well as task completion and error events.\r\n *\r\n * The API is compatible with `Promise<LoadBundleTaskProgress>`.\r\n */\r\nclass LoadBundleTask {\r\n constructor() {\r\n this._progressObserver = {};\r\n this._taskCompletionResolver = new Deferred();\r\n this._lastProgress = {\r\n taskState: 'Running',\r\n totalBytes: 0,\r\n totalDocuments: 0,\r\n bytesLoaded: 0,\r\n documentsLoaded: 0\r\n };\r\n }\r\n /**\r\n * Registers functions to listen to bundle loading progress events.\r\n * @param next - Called when there is a progress update from bundle loading. Typically `next` calls occur\r\n * each time a Firestore document is loaded from the bundle.\r\n * @param error - Called when an error occurs during bundle loading. The task aborts after reporting the\r\n * error, and there should be no more updates after this.\r\n * @param complete - Called when the loading task is complete.\r\n */\r\n onProgress(next, error, complete) {\r\n this._progressObserver = {\r\n next,\r\n error,\r\n complete\r\n };\r\n }\r\n /**\r\n * Implements the `Promise<LoadBundleTaskProgress>.catch` interface.\r\n *\r\n * @param onRejected - Called when an error occurs during bundle loading.\r\n */\r\n catch(onRejected) {\r\n return this._taskCompletionResolver.promise.catch(onRejected);\r\n }\r\n /**\r\n * Implements the `Promise<LoadBundleTaskProgress>.then` interface.\r\n *\r\n * @param onFulfilled - Called on the completion of the loading task with a final `LoadBundleTaskProgress` update.\r\n * The update will always have its `taskState` set to `\"Success\"`.\r\n * @param onRejected - Called when an error occurs during bundle loading.\r\n */\r\n then(onFulfilled, onRejected) {\r\n return this._taskCompletionResolver.promise.then(onFulfilled, onRejected);\r\n }\r\n /**\r\n * Notifies all observers that bundle loading has completed, with a provided\r\n * `LoadBundleTaskProgress` object.\r\n *\r\n * @private\r\n */\r\n _completeWith(progress) {\r\n this._updateProgress(progress);\r\n if (this._progressObserver.complete) {\r\n this._progressObserver.complete();\r\n }\r\n this._taskCompletionResolver.resolve(progress);\r\n }\r\n /**\r\n * Notifies all observers that bundle loading has failed, with a provided\r\n * `Error` as the reason.\r\n *\r\n * @private\r\n */\r\n _failWith(error) {\r\n this._lastProgress.taskState = 'Error';\r\n if (this._progressObserver.next) {\r\n this._progressObserver.next(this._lastProgress);\r\n }\r\n if (this._progressObserver.error) {\r\n this._progressObserver.error(error);\r\n }\r\n this._taskCompletionResolver.reject(error);\r\n }\r\n /**\r\n * Notifies a progress update of loading a bundle.\r\n * @param progress - The new progress.\r\n *\r\n * @private\r\n */\r\n _updateProgress(progress) {\r\n this._lastProgress = progress;\r\n if (this._progressObserver.next) {\r\n this._progressObserver.next(progress);\r\n }\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/** DOMException error code constants. */\r\nconst DOM_EXCEPTION_INVALID_STATE = 11;\r\nconst DOM_EXCEPTION_ABORTED = 20;\r\nconst DOM_EXCEPTION_QUOTA_EXCEEDED = 22;\r\n/**\r\n * Constant used to indicate the LRU garbage collection should be disabled.\r\n * Set this value as the `cacheSizeBytes` on the settings passed to the\r\n * {@link Firestore} instance.\r\n */\r\nconst CACHE_SIZE_UNLIMITED = LRU_COLLECTION_DISABLED;\r\n/**\r\n * The Cloud Firestore service interface.\r\n *\r\n * Do not call this constructor directly. Instead, use {@link getFirestore}.\r\n */\r\nclass Firestore extends Firestore$1 {\r\n /** @hideconstructor */\r\n constructor(databaseIdOrApp, credentialsProvider) {\r\n super(databaseIdOrApp, credentialsProvider);\r\n /**\r\n * Whether it's a {@link Firestore} or Firestore Lite instance.\r\n */\r\n this.type = 'firestore';\r\n this._queue = newAsyncQueue();\r\n this._persistenceKey =\r\n 'name' in databaseIdOrApp ? databaseIdOrApp.name : '[DEFAULT]';\r\n }\r\n _terminate() {\r\n if (!this._firestoreClient) {\r\n // The client must be initialized to ensure that all subsequent API\r\n // usage throws an exception.\r\n configureFirestore(this);\r\n }\r\n return this._firestoreClient.terminate();\r\n }\r\n}\r\n/**\r\n * Initializes a new instance of {@link Firestore} with the provided settings.\r\n * Can only be called before any other function, including\r\n * {@link getFirestore}. If the custom settings are empty, this function is\r\n * equivalent to calling {@link getFirestore}.\r\n *\r\n * @param app - The {@link @firebase/app#FirebaseApp} with which the {@link Firestore} instance will\r\n * be associated.\r\n * @param settings - A settings object to configure the {@link Firestore} instance.\r\n * @returns A newly initialized {@link Firestore} instance.\r\n */\r\nfunction initializeFirestore(app, settings) {\r\n const provider = _getProvider(app, 'firestore');\r\n if (provider.isInitialized()) {\r\n const existingInstance = provider.getImmediate();\r\n const initialSettings = provider.getOptions();\r\n if (deepEqual(initialSettings, settings)) {\r\n return existingInstance;\r\n }\r\n else {\r\n throw new FirestoreError(Code.FAILED_PRECONDITION, 'initializeFirestore() has already been called with ' +\r\n 'different options. To avoid this error, call initializeFirestore() with the ' +\r\n 'same options as when it was originally called, or call getFirestore() to return the' +\r\n ' already initialized instance.');\r\n }\r\n }\r\n if (settings.cacheSizeBytes !== undefined &&\r\n settings.cacheSizeBytes !== CACHE_SIZE_UNLIMITED &&\r\n settings.cacheSizeBytes < LRU_MINIMUM_CACHE_SIZE_BYTES) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, `cacheSizeBytes must be at least ${LRU_MINIMUM_CACHE_SIZE_BYTES}`);\r\n }\r\n return provider.initialize({ options: settings });\r\n}\r\n/**\r\n * Returns the existing {@link Firestore} instance that is associated with the\r\n * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new\r\n * instance with default settings.\r\n *\r\n * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}\r\n * instance is associated with.\r\n * @returns The {@link Firestore} instance of the provided app.\r\n */\r\nfunction getFirestore(app = getApp()) {\r\n return _getProvider(app, 'firestore').getImmediate();\r\n}\r\n/**\r\n * @internal\r\n */\r\nfunction ensureFirestoreConfigured(firestore) {\r\n if (!firestore._firestoreClient) {\r\n configureFirestore(firestore);\r\n }\r\n firestore._firestoreClient.verifyNotTerminated();\r\n return firestore._firestoreClient;\r\n}\r\nfunction configureFirestore(firestore) {\r\n var _a;\r\n const settings = firestore._freezeSettings();\r\n const databaseInfo = makeDatabaseInfo(firestore._databaseId, ((_a = firestore._app) === null || _a === void 0 ? void 0 : _a.options.appId) || '', firestore._persistenceKey, settings);\r\n firestore._firestoreClient = new FirestoreClient(firestore._credentials, firestore._queue, databaseInfo);\r\n}\r\n/**\r\n * Attempts to enable persistent storage, if possible.\r\n *\r\n * Must be called before any other functions (other than\r\n * {@link initializeFirestore}, {@link getFirestore} or\r\n * {@link clearIndexedDbPersistence}.\r\n *\r\n * If this fails, `enableIndexedDbPersistence()` will reject the promise it\r\n * returns. Note that even after this failure, the {@link Firestore} instance will\r\n * remain usable, however offline persistence will be disabled.\r\n *\r\n * There are several reasons why this can fail, which can be identified by\r\n * the `code` on the error.\r\n *\r\n * * failed-precondition: The app is already open in another browser tab.\r\n * * unimplemented: The browser is incompatible with the offline\r\n * persistence implementation.\r\n *\r\n * @param firestore - The {@link Firestore} instance to enable persistence for.\r\n * @param persistenceSettings - Optional settings object to configure\r\n * persistence.\r\n * @returns A `Promise` that represents successfully enabling persistent storage.\r\n */\r\nfunction enableIndexedDbPersistence(firestore, persistenceSettings) {\r\n firestore = cast(firestore, Firestore);\r\n verifyNotInitialized(firestore);\r\n const client = ensureFirestoreConfigured(firestore);\r\n const settings = firestore._freezeSettings();\r\n const onlineComponentProvider = new OnlineComponentProvider();\r\n const offlineComponentProvider = new IndexedDbOfflineComponentProvider(onlineComponentProvider, settings.cacheSizeBytes, persistenceSettings === null || persistenceSettings === void 0 ? void 0 : persistenceSettings.forceOwnership);\r\n return setPersistenceProviders(client, onlineComponentProvider, offlineComponentProvider);\r\n}\r\n/**\r\n * Attempts to enable multi-tab persistent storage, if possible. If enabled\r\n * across all tabs, all operations share access to local persistence, including\r\n * shared execution of queries and latency-compensated local document updates\r\n * across all connected instances.\r\n *\r\n * If this fails, `enableMultiTabIndexedDbPersistence()` will reject the promise\r\n * it returns. Note that even after this failure, the {@link Firestore} instance will\r\n * remain usable, however offline persistence will be disabled.\r\n *\r\n * There are several reasons why this can fail, which can be identified by\r\n * the `code` on the error.\r\n *\r\n * * failed-precondition: The app is already open in another browser tab and\r\n * multi-tab is not enabled.\r\n * * unimplemented: The browser is incompatible with the offline\r\n * persistence implementation.\r\n *\r\n * @param firestore - The {@link Firestore} instance to enable persistence for.\r\n * @returns A `Promise` that represents successfully enabling persistent\r\n * storage.\r\n */\r\nfunction enableMultiTabIndexedDbPersistence(firestore) {\r\n firestore = cast(firestore, Firestore);\r\n verifyNotInitialized(firestore);\r\n const client = ensureFirestoreConfigured(firestore);\r\n const settings = firestore._freezeSettings();\r\n const onlineComponentProvider = new OnlineComponentProvider();\r\n const offlineComponentProvider = new MultiTabOfflineComponentProvider(onlineComponentProvider, settings.cacheSizeBytes);\r\n return setPersistenceProviders(client, onlineComponentProvider, offlineComponentProvider);\r\n}\r\n/**\r\n * Registers both the `OfflineComponentProvider` and `OnlineComponentProvider`.\r\n * If the operation fails with a recoverable error (see\r\n * `canRecoverFromIndexedDbError()` below), the returned Promise is rejected\r\n * but the client remains usable.\r\n */\r\nfunction setPersistenceProviders(client, onlineComponentProvider, offlineComponentProvider) {\r\n const persistenceResult = new Deferred();\r\n return client.asyncQueue\r\n .enqueue(async () => {\r\n try {\r\n await setOfflineComponentProvider(client, offlineComponentProvider);\r\n await setOnlineComponentProvider(client, onlineComponentProvider);\r\n persistenceResult.resolve();\r\n }\r\n catch (e) {\r\n if (!canFallbackFromIndexedDbError(e)) {\r\n throw e;\r\n }\r\n console.warn('Error enabling offline persistence. Falling back to ' +\r\n 'persistence disabled: ' +\r\n e);\r\n persistenceResult.reject(e);\r\n }\r\n })\r\n .then(() => persistenceResult.promise);\r\n}\r\n/**\r\n * Decides whether the provided error allows us to gracefully disable\r\n * persistence (as opposed to crashing the client).\r\n */\r\nfunction canFallbackFromIndexedDbError(error) {\r\n if (error.name === 'FirebaseError') {\r\n return (error.code === Code.FAILED_PRECONDITION ||\r\n error.code === Code.UNIMPLEMENTED);\r\n }\r\n else if (typeof DOMException !== 'undefined' &&\r\n error instanceof DOMException) {\r\n // There are a few known circumstances where we can open IndexedDb but\r\n // trying to read/write will fail (e.g. quota exceeded). For\r\n // well-understood cases, we attempt to detect these and then gracefully\r\n // fall back to memory persistence.\r\n // NOTE: Rather than continue to add to this list, we could decide to\r\n // always fall back, with the risk that we might accidentally hide errors\r\n // representing actual SDK bugs.\r\n return (\r\n // When the browser is out of quota we could get either quota exceeded\r\n // or an aborted error depending on whether the error happened during\r\n // schema migration.\r\n error.code === DOM_EXCEPTION_QUOTA_EXCEEDED ||\r\n error.code === DOM_EXCEPTION_ABORTED ||\r\n // Firefox Private Browsing mode disables IndexedDb and returns\r\n // INVALID_STATE for any usage.\r\n error.code === DOM_EXCEPTION_INVALID_STATE);\r\n }\r\n return true;\r\n}\r\n/**\r\n * Clears the persistent storage. This includes pending writes and cached\r\n * documents.\r\n *\r\n * Must be called while the {@link Firestore} instance is not started (after the app is\r\n * terminated or when the app is first initialized). On startup, this function\r\n * must be called before other functions (other than {@link\r\n * initializeFirestore} or {@link getFirestore})). If the {@link Firestore}\r\n * instance is still running, the promise will be rejected with the error code\r\n * of `failed-precondition`.\r\n *\r\n * Note: `clearIndexedDbPersistence()` is primarily intended to help write\r\n * reliable tests that use Cloud Firestore. It uses an efficient mechanism for\r\n * dropping existing data but does not attempt to securely overwrite or\r\n * otherwise make cached data unrecoverable. For applications that are sensitive\r\n * to the disclosure of cached data in between user sessions, we strongly\r\n * recommend not enabling persistence at all.\r\n *\r\n * @param firestore - The {@link Firestore} instance to clear persistence for.\r\n * @returns A `Promise` that is resolved when the persistent storage is\r\n * cleared. Otherwise, the promise is rejected with an error.\r\n */\r\nfunction clearIndexedDbPersistence(firestore) {\r\n if (firestore._initialized && !firestore._terminated) {\r\n throw new FirestoreError(Code.FAILED_PRECONDITION, 'Persistence can only be cleared before a Firestore instance is ' +\r\n 'initialized or after it is terminated.');\r\n }\r\n const deferred = new Deferred();\r\n firestore._queue.enqueueAndForgetEvenWhileRestricted(async () => {\r\n try {\r\n await indexedDbClearPersistence(indexedDbStoragePrefix(firestore._databaseId, firestore._persistenceKey));\r\n deferred.resolve();\r\n }\r\n catch (e) {\r\n deferred.reject(e);\r\n }\r\n });\r\n return deferred.promise;\r\n}\r\n/**\r\n * Waits until all currently pending writes for the active user have been\r\n * acknowledged by the backend.\r\n *\r\n * The returned promise resolves immediately if there are no outstanding writes.\r\n * Otherwise, the promise waits for all previously issued writes (including\r\n * those written in a previous app session), but it does not wait for writes\r\n * that were added after the function is called. If you want to wait for\r\n * additional writes, call `waitForPendingWrites()` again.\r\n *\r\n * Any outstanding `waitForPendingWrites()` promises are rejected during user\r\n * changes.\r\n *\r\n * @returns A `Promise` which resolves when all currently pending writes have been\r\n * acknowledged by the backend.\r\n */\r\nfunction waitForPendingWrites(firestore) {\r\n firestore = cast(firestore, Firestore);\r\n const client = ensureFirestoreConfigured(firestore);\r\n return firestoreClientWaitForPendingWrites(client);\r\n}\r\n/**\r\n * Re-enables use of the network for this {@link Firestore} instance after a prior\r\n * call to {@link disableNetwork}.\r\n *\r\n * @returns A `Promise` that is resolved once the network has been enabled.\r\n */\r\nfunction enableNetwork(firestore) {\r\n firestore = cast(firestore, Firestore);\r\n const client = ensureFirestoreConfigured(firestore);\r\n return firestoreClientEnableNetwork(client);\r\n}\r\n/**\r\n * Disables network usage for this instance. It can be re-enabled via {@link\r\n * enableNetwork}. While the network is disabled, any snapshot listeners,\r\n * `getDoc()` or `getDocs()` calls will return results from cache, and any write\r\n * operations will be queued until the network is restored.\r\n *\r\n * @returns A `Promise` that is resolved once the network has been disabled.\r\n */\r\nfunction disableNetwork(firestore) {\r\n firestore = cast(firestore, Firestore);\r\n const client = ensureFirestoreConfigured(firestore);\r\n return firestoreClientDisableNetwork(client);\r\n}\r\n/**\r\n * Terminates the provided {@link Firestore} instance.\r\n *\r\n * After calling `terminate()` only the `clearIndexedDbPersistence()` function\r\n * may be used. Any other function will throw a `FirestoreError`.\r\n *\r\n * To restart after termination, create a new instance of FirebaseFirestore with\r\n * {@link getFirestore}.\r\n *\r\n * Termination does not cancel any pending writes, and any promises that are\r\n * awaiting a response from the server will not be resolved. If you have\r\n * persistence enabled, the next time you start this instance, it will resume\r\n * sending these writes to the server.\r\n *\r\n * Note: Under normal circumstances, calling `terminate()` is not required. This\r\n * function is useful only when you want to force this instance to release all\r\n * of its resources or in combination with `clearIndexedDbPersistence()` to\r\n * ensure that all local state is destroyed between test runs.\r\n *\r\n * @returns A `Promise` that is resolved when the instance has been successfully\r\n * terminated.\r\n */\r\nfunction terminate(firestore) {\r\n _removeServiceInstance(firestore.app, 'firestore');\r\n return firestore._delete();\r\n}\r\n/**\r\n * Loads a Firestore bundle into the local cache.\r\n *\r\n * @param firestore - The {@link Firestore} instance to load bundles for for.\r\n * @param bundleData - An object representing the bundle to be loaded. Valid objects are\r\n * `ArrayBuffer`, `ReadableStream<Uint8Array>` or `string`.\r\n *\r\n * @returns\r\n * A `LoadBundleTask` object, which notifies callers with progress updates, and completion\r\n * or error events. It can be used as a `Promise<LoadBundleTaskProgress>`.\r\n */\r\nfunction loadBundle(firestore, bundleData) {\r\n firestore = cast(firestore, Firestore);\r\n const client = ensureFirestoreConfigured(firestore);\r\n const resultTask = new LoadBundleTask();\r\n firestoreClientLoadBundle(client, firestore._databaseId, bundleData, resultTask);\r\n return resultTask;\r\n}\r\n/**\r\n * Reads a Firestore {@link Query} from local cache, identified by the given name.\r\n *\r\n * The named queries are packaged into bundles on the server side (along\r\n * with resulting documents), and loaded to local cache using `loadBundle`. Once in local\r\n * cache, use this method to extract a {@link Query} by name.\r\n */\r\nfunction namedQuery(firestore, name) {\r\n firestore = cast(firestore, Firestore);\r\n const client = ensureFirestoreConfigured(firestore);\r\n return firestoreClientGetNamedQuery(client, name).then(namedQuery => {\r\n if (!namedQuery) {\r\n return null;\r\n }\r\n return new Query(firestore, null, namedQuery.query);\r\n });\r\n}\r\nfunction verifyNotInitialized(firestore) {\r\n if (firestore._initialized || firestore._terminated) {\r\n throw new FirestoreError(Code.FAILED_PRECONDITION, 'Firestore has already been started and persistence can no longer be ' +\r\n 'enabled. You can only enable persistence before calling any other ' +\r\n 'methods on a Firestore object.');\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction registerFirestore(variant, useFetchStreams = true) {\r\n setSDKVersion(SDK_VERSION$1);\r\n _registerComponent(new Component('firestore', (container, { options: settings }) => {\r\n const app = container.getProvider('app').getImmediate();\r\n const firestoreInstance = new Firestore(app, new FirebaseCredentialsProvider(container.getProvider('auth-internal')));\r\n settings = Object.assign({ useFetchStreams }, settings);\r\n firestoreInstance._setSettings(settings);\r\n return firestoreInstance;\r\n }, \"PUBLIC\" /* PUBLIC */));\r\n registerVersion(name, version$1, variant);\r\n // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation\r\n registerVersion(name, version$1, '__BUILD_TARGET__');\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A `FieldPath` refers to a field in a document. The path may consist of a\r\n * single field name (referring to a top-level field in the document), or a\r\n * list of field names (referring to a nested field in the document).\r\n *\r\n * Create a `FieldPath` by providing field names. If more than one field\r\n * name is provided, the path will point to a nested field in a document.\r\n */\r\nclass FieldPath {\r\n /**\r\n * Creates a `FieldPath` from the provided field names. If more than one field\r\n * name is provided, the path will point to a nested field in a document.\r\n *\r\n * @param fieldNames - A list of field names.\r\n */\r\n constructor(...fieldNames) {\r\n for (let i = 0; i < fieldNames.length; ++i) {\r\n if (fieldNames[i].length === 0) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, `Invalid field name at argument $(i + 1). ` +\r\n 'Field names must not be empty.');\r\n }\r\n }\r\n this._internalPath = new FieldPath$1(fieldNames);\r\n }\r\n /**\r\n * Returns true if this `FieldPath` is equal to the provided one.\r\n *\r\n * @param other - The `FieldPath` to compare against.\r\n * @returns true if this `FieldPath` is equal to the provided one.\r\n */\r\n isEqual(other) {\r\n return this._internalPath.isEqual(other._internalPath);\r\n }\r\n}\r\n/**\r\n * Returns a special sentinel `FieldPath` to refer to the ID of a document.\r\n * It can be used in queries to sort or filter by the document ID.\r\n */\r\nfunction documentId() {\r\n return new FieldPath(DOCUMENT_KEY_NAME);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * An immutable object representing an array of bytes.\r\n */\r\nclass Bytes {\r\n /** @hideconstructor */\r\n constructor(byteString) {\r\n this._byteString = byteString;\r\n }\r\n /**\r\n * Creates a new `Bytes` object from the given Base64 string, converting it to\r\n * bytes.\r\n *\r\n * @param base64 - The Base64 string used to create the `Bytes` object.\r\n */\r\n static fromBase64String(base64) {\r\n try {\r\n return new Bytes(ByteString.fromBase64String(base64));\r\n }\r\n catch (e) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Failed to construct data from Base64 string: ' + e);\r\n }\r\n }\r\n /**\r\n * Creates a new `Bytes` object from the given Uint8Array.\r\n *\r\n * @param array - The Uint8Array used to create the `Bytes` object.\r\n */\r\n static fromUint8Array(array) {\r\n return new Bytes(ByteString.fromUint8Array(array));\r\n }\r\n /**\r\n * Returns the underlying bytes as a Base64-encoded string.\r\n *\r\n * @returns The Base64-encoded string created from the `Bytes` object.\r\n */\r\n toBase64() {\r\n return this._byteString.toBase64();\r\n }\r\n /**\r\n * Returns the underlying bytes in a new `Uint8Array`.\r\n *\r\n * @returns The Uint8Array created from the `Bytes` object.\r\n */\r\n toUint8Array() {\r\n return this._byteString.toUint8Array();\r\n }\r\n /**\r\n * Returns a string representation of the `Bytes` object.\r\n *\r\n * @returns A string representation of the `Bytes` object.\r\n */\r\n toString() {\r\n return 'Bytes(base64: ' + this.toBase64() + ')';\r\n }\r\n /**\r\n * Returns true if this `Bytes` object is equal to the provided one.\r\n *\r\n * @param other - The `Bytes` object to compare against.\r\n * @returns true if this `Bytes` object is equal to the provided one.\r\n */\r\n isEqual(other) {\r\n return this._byteString.isEqual(other._byteString);\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Sentinel values that can be used when writing document fields with `set()`\r\n * or `update()`.\r\n */\r\nclass FieldValue {\r\n /**\r\n * @param _methodName - The public API endpoint that returns this class.\r\n * @hideconstructor\r\n */\r\n constructor(_methodName) {\r\n this._methodName = _methodName;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * An immutable object representing a geographic location in Firestore. The\r\n * location is represented as latitude/longitude pair.\r\n *\r\n * Latitude values are in the range of [-90, 90].\r\n * Longitude values are in the range of [-180, 180].\r\n */\r\nclass GeoPoint {\r\n /**\r\n * Creates a new immutable `GeoPoint` object with the provided latitude and\r\n * longitude values.\r\n * @param latitude - The latitude as number between -90 and 90.\r\n * @param longitude - The longitude as number between -180 and 180.\r\n */\r\n constructor(latitude, longitude) {\r\n if (!isFinite(latitude) || latitude < -90 || latitude > 90) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Latitude must be a number between -90 and 90, but was: ' + latitude);\r\n }\r\n if (!isFinite(longitude) || longitude < -180 || longitude > 180) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Longitude must be a number between -180 and 180, but was: ' + longitude);\r\n }\r\n this._lat = latitude;\r\n this._long = longitude;\r\n }\r\n /**\r\n * The latitude of this `GeoPoint` instance.\r\n */\r\n get latitude() {\r\n return this._lat;\r\n }\r\n /**\r\n * The longitude of this `GeoPoint` instance.\r\n */\r\n get longitude() {\r\n return this._long;\r\n }\r\n /**\r\n * Returns true if this `GeoPoint` is equal to the provided one.\r\n *\r\n * @param other - The `GeoPoint` to compare against.\r\n * @returns true if this `GeoPoint` is equal to the provided one.\r\n */\r\n isEqual(other) {\r\n return this._lat === other._lat && this._long === other._long;\r\n }\r\n /** Returns a JSON-serializable representation of this GeoPoint. */\r\n toJSON() {\r\n return { latitude: this._lat, longitude: this._long };\r\n }\r\n /**\r\n * Actually private to JS consumers of our API, so this function is prefixed\r\n * with an underscore.\r\n */\r\n _compareTo(other) {\r\n return (primitiveComparator(this._lat, other._lat) ||\r\n primitiveComparator(this._long, other._long));\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst RESERVED_FIELD_REGEX = /^__.*__$/;\r\n/** The result of parsing document data (e.g. for a setData call). */\r\nclass ParsedSetData {\r\n constructor(data, fieldMask, fieldTransforms) {\r\n this.data = data;\r\n this.fieldMask = fieldMask;\r\n this.fieldTransforms = fieldTransforms;\r\n }\r\n toMutation(key, precondition) {\r\n if (this.fieldMask !== null) {\r\n return new PatchMutation(key, this.data, this.fieldMask, precondition, this.fieldTransforms);\r\n }\r\n else {\r\n return new SetMutation(key, this.data, precondition, this.fieldTransforms);\r\n }\r\n }\r\n}\r\n/** The result of parsing \"update\" data (i.e. for an updateData call). */\r\nclass ParsedUpdateData {\r\n constructor(data, \r\n // The fieldMask does not include document transforms.\r\n fieldMask, fieldTransforms) {\r\n this.data = data;\r\n this.fieldMask = fieldMask;\r\n this.fieldTransforms = fieldTransforms;\r\n }\r\n toMutation(key, precondition) {\r\n return new PatchMutation(key, this.data, this.fieldMask, precondition, this.fieldTransforms);\r\n }\r\n}\r\nfunction isWrite(dataSource) {\r\n switch (dataSource) {\r\n case 0 /* Set */: // fall through\r\n case 2 /* MergeSet */: // fall through\r\n case 1 /* Update */:\r\n return true;\r\n case 3 /* Argument */:\r\n case 4 /* ArrayArgument */:\r\n return false;\r\n default:\r\n throw fail();\r\n }\r\n}\r\n/** A \"context\" object passed around while parsing user data. */\r\nclass ParseContextImpl {\r\n /**\r\n * Initializes a ParseContext with the given source and path.\r\n *\r\n * @param settings - The settings for the parser.\r\n * @param databaseId - The database ID of the Firestore instance.\r\n * @param serializer - The serializer to use to generate the Value proto.\r\n * @param ignoreUndefinedProperties - Whether to ignore undefined properties\r\n * rather than throw.\r\n * @param fieldTransforms - A mutable list of field transforms encountered\r\n * while parsing the data.\r\n * @param fieldMask - A mutable list of field paths encountered while parsing\r\n * the data.\r\n *\r\n * TODO(b/34871131): We don't support array paths right now, so path can be\r\n * null to indicate the context represents any location within an array (in\r\n * which case certain features will not work and errors will be somewhat\r\n * compromised).\r\n */\r\n constructor(settings, databaseId, serializer, ignoreUndefinedProperties, fieldTransforms, fieldMask) {\r\n this.settings = settings;\r\n this.databaseId = databaseId;\r\n this.serializer = serializer;\r\n this.ignoreUndefinedProperties = ignoreUndefinedProperties;\r\n // Minor hack: If fieldTransforms is undefined, we assume this is an\r\n // external call and we need to validate the entire path.\r\n if (fieldTransforms === undefined) {\r\n this.validatePath();\r\n }\r\n this.fieldTransforms = fieldTransforms || [];\r\n this.fieldMask = fieldMask || [];\r\n }\r\n get path() {\r\n return this.settings.path;\r\n }\r\n get dataSource() {\r\n return this.settings.dataSource;\r\n }\r\n /** Returns a new context with the specified settings overwritten. */\r\n contextWith(configuration) {\r\n return new ParseContextImpl(Object.assign(Object.assign({}, this.settings), configuration), this.databaseId, this.serializer, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask);\r\n }\r\n childContextForField(field) {\r\n var _a;\r\n const childPath = (_a = this.path) === null || _a === void 0 ? void 0 : _a.child(field);\r\n const context = this.contextWith({ path: childPath, arrayElement: false });\r\n context.validatePathSegment(field);\r\n return context;\r\n }\r\n childContextForFieldPath(field) {\r\n var _a;\r\n const childPath = (_a = this.path) === null || _a === void 0 ? void 0 : _a.child(field);\r\n const context = this.contextWith({ path: childPath, arrayElement: false });\r\n context.validatePath();\r\n return context;\r\n }\r\n childContextForArray(index) {\r\n // TODO(b/34871131): We don't support array paths right now; so make path\r\n // undefined.\r\n return this.contextWith({ path: undefined, arrayElement: true });\r\n }\r\n createError(reason) {\r\n return createError(reason, this.settings.methodName, this.settings.hasConverter || false, this.path, this.settings.targetDoc);\r\n }\r\n /** Returns 'true' if 'fieldPath' was traversed when creating this context. */\r\n contains(fieldPath) {\r\n return (this.fieldMask.find(field => fieldPath.isPrefixOf(field)) !== undefined ||\r\n this.fieldTransforms.find(transform => fieldPath.isPrefixOf(transform.field)) !== undefined);\r\n }\r\n validatePath() {\r\n // TODO(b/34871131): Remove null check once we have proper paths for fields\r\n // within arrays.\r\n if (!this.path) {\r\n return;\r\n }\r\n for (let i = 0; i < this.path.length; i++) {\r\n this.validatePathSegment(this.path.get(i));\r\n }\r\n }\r\n validatePathSegment(segment) {\r\n if (segment.length === 0) {\r\n throw this.createError('Document fields must not be empty');\r\n }\r\n if (isWrite(this.dataSource) && RESERVED_FIELD_REGEX.test(segment)) {\r\n throw this.createError('Document fields cannot begin and end with \"__\"');\r\n }\r\n }\r\n}\r\n/**\r\n * Helper for parsing raw user input (provided via the API) into internal model\r\n * classes.\r\n */\r\nclass UserDataReader {\r\n constructor(databaseId, ignoreUndefinedProperties, serializer) {\r\n this.databaseId = databaseId;\r\n this.ignoreUndefinedProperties = ignoreUndefinedProperties;\r\n this.serializer = serializer || newSerializer(databaseId);\r\n }\r\n /** Creates a new top-level parse context. */\r\n createContext(dataSource, methodName, targetDoc, hasConverter = false) {\r\n return new ParseContextImpl({\r\n dataSource,\r\n methodName,\r\n targetDoc,\r\n path: FieldPath$1.emptyPath(),\r\n arrayElement: false,\r\n hasConverter\r\n }, this.databaseId, this.serializer, this.ignoreUndefinedProperties);\r\n }\r\n}\r\nfunction newUserDataReader(firestore) {\r\n const settings = firestore._freezeSettings();\r\n const serializer = newSerializer(firestore._databaseId);\r\n return new UserDataReader(firestore._databaseId, !!settings.ignoreUndefinedProperties, serializer);\r\n}\r\n/** Parse document data from a set() call. */\r\nfunction parseSetData(userDataReader, methodName, targetDoc, input, hasConverter, options = {}) {\r\n const context = userDataReader.createContext(options.merge || options.mergeFields\r\n ? 2 /* MergeSet */\r\n : 0 /* Set */, methodName, targetDoc, hasConverter);\r\n validatePlainObject('Data must be an object, but it was:', context, input);\r\n const updateData = parseObject(input, context);\r\n let fieldMask;\r\n let fieldTransforms;\r\n if (options.merge) {\r\n fieldMask = new FieldMask(context.fieldMask);\r\n fieldTransforms = context.fieldTransforms;\r\n }\r\n else if (options.mergeFields) {\r\n const validatedFieldPaths = [];\r\n for (const stringOrFieldPath of options.mergeFields) {\r\n const fieldPath = fieldPathFromArgument$1(methodName, stringOrFieldPath, targetDoc);\r\n if (!context.contains(fieldPath)) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, `Field '${fieldPath}' is specified in your field mask but missing from your input data.`);\r\n }\r\n if (!fieldMaskContains(validatedFieldPaths, fieldPath)) {\r\n validatedFieldPaths.push(fieldPath);\r\n }\r\n }\r\n fieldMask = new FieldMask(validatedFieldPaths);\r\n fieldTransforms = context.fieldTransforms.filter(transform => fieldMask.covers(transform.field));\r\n }\r\n else {\r\n fieldMask = null;\r\n fieldTransforms = context.fieldTransforms;\r\n }\r\n return new ParsedSetData(new ObjectValue(updateData), fieldMask, fieldTransforms);\r\n}\r\nclass DeleteFieldValueImpl extends FieldValue {\r\n _toFieldTransform(context) {\r\n if (context.dataSource === 2 /* MergeSet */) {\r\n // No transform to add for a delete, but we need to add it to our\r\n // fieldMask so it gets deleted.\r\n context.fieldMask.push(context.path);\r\n }\r\n else if (context.dataSource === 1 /* Update */) {\r\n throw context.createError(`${this._methodName}() can only appear at the top level ` +\r\n 'of your update data');\r\n }\r\n else {\r\n // We shouldn't encounter delete sentinels for queries or non-merge set() calls.\r\n throw context.createError(`${this._methodName}() cannot be used with set() unless you pass ` +\r\n '{merge:true}');\r\n }\r\n return null;\r\n }\r\n isEqual(other) {\r\n return other instanceof DeleteFieldValueImpl;\r\n }\r\n}\r\n/**\r\n * Creates a child context for parsing SerializableFieldValues.\r\n *\r\n * This is different than calling `ParseContext.contextWith` because it keeps\r\n * the fieldTransforms and fieldMask separate.\r\n *\r\n * The created context has its `dataSource` set to `UserDataSource.Argument`.\r\n * Although these values are used with writes, any elements in these FieldValues\r\n * are not considered writes since they cannot contain any FieldValue sentinels,\r\n * etc.\r\n *\r\n * @param fieldValue - The sentinel FieldValue for which to create a child\r\n * context.\r\n * @param context - The parent context.\r\n * @param arrayElement - Whether or not the FieldValue has an array.\r\n */\r\nfunction createSentinelChildContext(fieldValue, context, arrayElement) {\r\n return new ParseContextImpl({\r\n dataSource: 3 /* Argument */,\r\n targetDoc: context.settings.targetDoc,\r\n methodName: fieldValue._methodName,\r\n arrayElement\r\n }, context.databaseId, context.serializer, context.ignoreUndefinedProperties);\r\n}\r\nclass ServerTimestampFieldValueImpl extends FieldValue {\r\n _toFieldTransform(context) {\r\n return new FieldTransform(context.path, new ServerTimestampTransform());\r\n }\r\n isEqual(other) {\r\n return other instanceof ServerTimestampFieldValueImpl;\r\n }\r\n}\r\nclass ArrayUnionFieldValueImpl extends FieldValue {\r\n constructor(methodName, _elements) {\r\n super(methodName);\r\n this._elements = _elements;\r\n }\r\n _toFieldTransform(context) {\r\n const parseContext = createSentinelChildContext(this, context, \r\n /*array=*/ true);\r\n const parsedElements = this._elements.map(element => parseData(element, parseContext));\r\n const arrayUnion = new ArrayUnionTransformOperation(parsedElements);\r\n return new FieldTransform(context.path, arrayUnion);\r\n }\r\n isEqual(other) {\r\n // TODO(mrschmidt): Implement isEquals\r\n return this === other;\r\n }\r\n}\r\nclass ArrayRemoveFieldValueImpl extends FieldValue {\r\n constructor(methodName, _elements) {\r\n super(methodName);\r\n this._elements = _elements;\r\n }\r\n _toFieldTransform(context) {\r\n const parseContext = createSentinelChildContext(this, context, \r\n /*array=*/ true);\r\n const parsedElements = this._elements.map(element => parseData(element, parseContext));\r\n const arrayUnion = new ArrayRemoveTransformOperation(parsedElements);\r\n return new FieldTransform(context.path, arrayUnion);\r\n }\r\n isEqual(other) {\r\n // TODO(mrschmidt): Implement isEquals\r\n return this === other;\r\n }\r\n}\r\nclass NumericIncrementFieldValueImpl extends FieldValue {\r\n constructor(methodName, _operand) {\r\n super(methodName);\r\n this._operand = _operand;\r\n }\r\n _toFieldTransform(context) {\r\n const numericIncrement = new NumericIncrementTransformOperation(context.serializer, toNumber(context.serializer, this._operand));\r\n return new FieldTransform(context.path, numericIncrement);\r\n }\r\n isEqual(other) {\r\n // TODO(mrschmidt): Implement isEquals\r\n return this === other;\r\n }\r\n}\r\n/** Parse update data from an update() call. */\r\nfunction parseUpdateData(userDataReader, methodName, targetDoc, input) {\r\n const context = userDataReader.createContext(1 /* Update */, methodName, targetDoc);\r\n validatePlainObject('Data must be an object, but it was:', context, input);\r\n const fieldMaskPaths = [];\r\n const updateData = ObjectValue.empty();\r\n forEach(input, (key, value) => {\r\n const path = fieldPathFromDotSeparatedString(methodName, key, targetDoc);\r\n // For Compat types, we have to \"extract\" the underlying types before\r\n // performing validation.\r\n value = getModularInstance(value);\r\n const childContext = context.childContextForFieldPath(path);\r\n if (value instanceof DeleteFieldValueImpl) {\r\n // Add it to the field mask, but don't add anything to updateData.\r\n fieldMaskPaths.push(path);\r\n }\r\n else {\r\n const parsedValue = parseData(value, childContext);\r\n if (parsedValue != null) {\r\n fieldMaskPaths.push(path);\r\n updateData.set(path, parsedValue);\r\n }\r\n }\r\n });\r\n const mask = new FieldMask(fieldMaskPaths);\r\n return new ParsedUpdateData(updateData, mask, context.fieldTransforms);\r\n}\r\n/** Parse update data from a list of field/value arguments. */\r\nfunction parseUpdateVarargs(userDataReader, methodName, targetDoc, field, value, moreFieldsAndValues) {\r\n const context = userDataReader.createContext(1 /* Update */, methodName, targetDoc);\r\n const keys = [fieldPathFromArgument$1(methodName, field, targetDoc)];\r\n const values = [value];\r\n if (moreFieldsAndValues.length % 2 !== 0) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, `Function ${methodName}() needs to be called with an even number ` +\r\n 'of arguments that alternate between field names and values.');\r\n }\r\n for (let i = 0; i < moreFieldsAndValues.length; i += 2) {\r\n keys.push(fieldPathFromArgument$1(methodName, moreFieldsAndValues[i]));\r\n values.push(moreFieldsAndValues[i + 1]);\r\n }\r\n const fieldMaskPaths = [];\r\n const updateData = ObjectValue.empty();\r\n // We iterate in reverse order to pick the last value for a field if the\r\n // user specified the field multiple times.\r\n for (let i = keys.length - 1; i >= 0; --i) {\r\n if (!fieldMaskContains(fieldMaskPaths, keys[i])) {\r\n const path = keys[i];\r\n let value = values[i];\r\n // For Compat types, we have to \"extract\" the underlying types before\r\n // performing validation.\r\n value = getModularInstance(value);\r\n const childContext = context.childContextForFieldPath(path);\r\n if (value instanceof DeleteFieldValueImpl) {\r\n // Add it to the field mask, but don't add anything to updateData.\r\n fieldMaskPaths.push(path);\r\n }\r\n else {\r\n const parsedValue = parseData(value, childContext);\r\n if (parsedValue != null) {\r\n fieldMaskPaths.push(path);\r\n updateData.set(path, parsedValue);\r\n }\r\n }\r\n }\r\n }\r\n const mask = new FieldMask(fieldMaskPaths);\r\n return new ParsedUpdateData(updateData, mask, context.fieldTransforms);\r\n}\r\n/**\r\n * Parse a \"query value\" (e.g. value in a where filter or a value in a cursor\r\n * bound).\r\n *\r\n * @param allowArrays - Whether the query value is an array that may directly\r\n * contain additional arrays (e.g. the operand of an `in` query).\r\n */\r\nfunction parseQueryValue(userDataReader, methodName, input, allowArrays = false) {\r\n const context = userDataReader.createContext(allowArrays ? 4 /* ArrayArgument */ : 3 /* Argument */, methodName);\r\n const parsed = parseData(input, context);\r\n return parsed;\r\n}\r\n/**\r\n * Parses user data to Protobuf Values.\r\n *\r\n * @param input - Data to be parsed.\r\n * @param context - A context object representing the current path being parsed,\r\n * the source of the data being parsed, etc.\r\n * @returns The parsed value, or null if the value was a FieldValue sentinel\r\n * that should not be included in the resulting parsed data.\r\n */\r\nfunction parseData(input, context) {\r\n // Unwrap the API type from the Compat SDK. This will return the API type\r\n // from firestore-exp.\r\n input = getModularInstance(input);\r\n if (looksLikeJsonObject(input)) {\r\n validatePlainObject('Unsupported field value:', context, input);\r\n return parseObject(input, context);\r\n }\r\n else if (input instanceof FieldValue) {\r\n // FieldValues usually parse into transforms (except FieldValue.delete())\r\n // in which case we do not want to include this field in our parsed data\r\n // (as doing so will overwrite the field directly prior to the transform\r\n // trying to transform it). So we don't add this location to\r\n // context.fieldMask and we return null as our parsing result.\r\n parseSentinelFieldValue(input, context);\r\n return null;\r\n }\r\n else if (input === undefined && context.ignoreUndefinedProperties) {\r\n // If the input is undefined it can never participate in the fieldMask, so\r\n // don't handle this below. If `ignoreUndefinedProperties` is false,\r\n // `parseScalarValue` will reject an undefined value.\r\n return null;\r\n }\r\n else {\r\n // If context.path is null we are inside an array and we don't support\r\n // field mask paths more granular than the top-level array.\r\n if (context.path) {\r\n context.fieldMask.push(context.path);\r\n }\r\n if (input instanceof Array) {\r\n // TODO(b/34871131): Include the path containing the array in the error\r\n // message.\r\n // In the case of IN queries, the parsed data is an array (representing\r\n // the set of values to be included for the IN query) that may directly\r\n // contain additional arrays (each representing an individual field\r\n // value), so we disable this validation.\r\n if (context.settings.arrayElement &&\r\n context.dataSource !== 4 /* ArrayArgument */) {\r\n throw context.createError('Nested arrays are not supported');\r\n }\r\n return parseArray(input, context);\r\n }\r\n else {\r\n return parseScalarValue(input, context);\r\n }\r\n }\r\n}\r\nfunction parseObject(obj, context) {\r\n const fields = {};\r\n if (isEmpty(obj)) {\r\n // If we encounter an empty object, we explicitly add it to the update\r\n // mask to ensure that the server creates a map entry.\r\n if (context.path && context.path.length > 0) {\r\n context.fieldMask.push(context.path);\r\n }\r\n }\r\n else {\r\n forEach(obj, (key, val) => {\r\n const parsedValue = parseData(val, context.childContextForField(key));\r\n if (parsedValue != null) {\r\n fields[key] = parsedValue;\r\n }\r\n });\r\n }\r\n return { mapValue: { fields } };\r\n}\r\nfunction parseArray(array, context) {\r\n const values = [];\r\n let entryIndex = 0;\r\n for (const entry of array) {\r\n let parsedEntry = parseData(entry, context.childContextForArray(entryIndex));\r\n if (parsedEntry == null) {\r\n // Just include nulls in the array for fields being replaced with a\r\n // sentinel.\r\n parsedEntry = { nullValue: 'NULL_VALUE' };\r\n }\r\n values.push(parsedEntry);\r\n entryIndex++;\r\n }\r\n return { arrayValue: { values } };\r\n}\r\n/**\r\n * \"Parses\" the provided FieldValueImpl, adding any necessary transforms to\r\n * context.fieldTransforms.\r\n */\r\nfunction parseSentinelFieldValue(value, context) {\r\n // Sentinels are only supported with writes, and not within arrays.\r\n if (!isWrite(context.dataSource)) {\r\n throw context.createError(`${value._methodName}() can only be used with update() and set()`);\r\n }\r\n if (!context.path) {\r\n throw context.createError(`${value._methodName}() is not currently supported inside arrays`);\r\n }\r\n const fieldTransform = value._toFieldTransform(context);\r\n if (fieldTransform) {\r\n context.fieldTransforms.push(fieldTransform);\r\n }\r\n}\r\n/**\r\n * Helper to parse a scalar value (i.e. not an Object, Array, or FieldValue)\r\n *\r\n * @returns The parsed value\r\n */\r\nfunction parseScalarValue(value, context) {\r\n value = getModularInstance(value);\r\n if (value === null) {\r\n return { nullValue: 'NULL_VALUE' };\r\n }\r\n else if (typeof value === 'number') {\r\n return toNumber(context.serializer, value);\r\n }\r\n else if (typeof value === 'boolean') {\r\n return { booleanValue: value };\r\n }\r\n else if (typeof value === 'string') {\r\n return { stringValue: value };\r\n }\r\n else if (value instanceof Date) {\r\n const timestamp = Timestamp.fromDate(value);\r\n return {\r\n timestampValue: toTimestamp(context.serializer, timestamp)\r\n };\r\n }\r\n else if (value instanceof Timestamp) {\r\n // Firestore backend truncates precision down to microseconds. To ensure\r\n // offline mode works the same with regards to truncation, perform the\r\n // truncation immediately without waiting for the backend to do that.\r\n const timestamp = new Timestamp(value.seconds, Math.floor(value.nanoseconds / 1000) * 1000);\r\n return {\r\n timestampValue: toTimestamp(context.serializer, timestamp)\r\n };\r\n }\r\n else if (value instanceof GeoPoint) {\r\n return {\r\n geoPointValue: {\r\n latitude: value.latitude,\r\n longitude: value.longitude\r\n }\r\n };\r\n }\r\n else if (value instanceof Bytes) {\r\n return { bytesValue: toBytes(context.serializer, value._byteString) };\r\n }\r\n else if (value instanceof DocumentReference) {\r\n const thisDb = context.databaseId;\r\n const otherDb = value.firestore._databaseId;\r\n if (!otherDb.isEqual(thisDb)) {\r\n throw context.createError('Document reference is for database ' +\r\n `${otherDb.projectId}/${otherDb.database} but should be ` +\r\n `for database ${thisDb.projectId}/${thisDb.database}`);\r\n }\r\n return {\r\n referenceValue: toResourceName(value.firestore._databaseId || context.databaseId, value._key.path)\r\n };\r\n }\r\n else {\r\n throw context.createError(`Unsupported field value: ${valueDescription(value)}`);\r\n }\r\n}\r\n/**\r\n * Checks whether an object looks like a JSON object that should be converted\r\n * into a struct. Normal class/prototype instances are considered to look like\r\n * JSON objects since they should be converted to a struct value. Arrays, Dates,\r\n * GeoPoints, etc. are not considered to look like JSON objects since they map\r\n * to specific FieldValue types other than ObjectValue.\r\n */\r\nfunction looksLikeJsonObject(input) {\r\n return (typeof input === 'object' &&\r\n input !== null &&\r\n !(input instanceof Array) &&\r\n !(input instanceof Date) &&\r\n !(input instanceof Timestamp) &&\r\n !(input instanceof GeoPoint) &&\r\n !(input instanceof Bytes) &&\r\n !(input instanceof DocumentReference) &&\r\n !(input instanceof FieldValue));\r\n}\r\nfunction validatePlainObject(message, context, input) {\r\n if (!looksLikeJsonObject(input) || !isPlainObject(input)) {\r\n const description = valueDescription(input);\r\n if (description === 'an object') {\r\n // Massage the error if it was an object.\r\n throw context.createError(message + ' a custom object');\r\n }\r\n else {\r\n throw context.createError(message + ' ' + description);\r\n }\r\n }\r\n}\r\n/**\r\n * Helper that calls fromDotSeparatedString() but wraps any error thrown.\r\n */\r\nfunction fieldPathFromArgument$1(methodName, path, targetDoc) {\r\n // If required, replace the FieldPath Compat class with with the firestore-exp\r\n // FieldPath.\r\n path = getModularInstance(path);\r\n if (path instanceof FieldPath) {\r\n return path._internalPath;\r\n }\r\n else if (typeof path === 'string') {\r\n return fieldPathFromDotSeparatedString(methodName, path);\r\n }\r\n else {\r\n const message = 'Field path arguments must be of type string or FieldPath.';\r\n throw createError(message, methodName, \r\n /* hasConverter= */ false, \r\n /* path= */ undefined, targetDoc);\r\n }\r\n}\r\n/**\r\n * Matches any characters in a field path string that are reserved.\r\n */\r\nconst FIELD_PATH_RESERVED = new RegExp('[~\\\\*/\\\\[\\\\]]');\r\n/**\r\n * Wraps fromDotSeparatedString with an error message about the method that\r\n * was thrown.\r\n * @param methodName - The publicly visible method name\r\n * @param path - The dot-separated string form of a field path which will be\r\n * split on dots.\r\n * @param targetDoc - The document against which the field path will be\r\n * evaluated.\r\n */\r\nfunction fieldPathFromDotSeparatedString(methodName, path, targetDoc) {\r\n const found = path.search(FIELD_PATH_RESERVED);\r\n if (found >= 0) {\r\n throw createError(`Invalid field path (${path}). Paths must not contain ` +\r\n `'~', '*', '/', '[', or ']'`, methodName, \r\n /* hasConverter= */ false, \r\n /* path= */ undefined, targetDoc);\r\n }\r\n try {\r\n return new FieldPath(...path.split('.'))._internalPath;\r\n }\r\n catch (e) {\r\n throw createError(`Invalid field path (${path}). Paths must not be empty, ` +\r\n `begin with '.', end with '.', or contain '..'`, methodName, \r\n /* hasConverter= */ false, \r\n /* path= */ undefined, targetDoc);\r\n }\r\n}\r\nfunction createError(reason, methodName, hasConverter, path, targetDoc) {\r\n const hasPath = path && !path.isEmpty();\r\n const hasDocument = targetDoc !== undefined;\r\n let message = `Function ${methodName}() called with invalid data`;\r\n if (hasConverter) {\r\n message += ' (via `toFirestore()`)';\r\n }\r\n message += '. ';\r\n let description = '';\r\n if (hasPath || hasDocument) {\r\n description += ' (found';\r\n if (hasPath) {\r\n description += ` in field ${path}`;\r\n }\r\n if (hasDocument) {\r\n description += ` in document ${targetDoc}`;\r\n }\r\n description += ')';\r\n }\r\n return new FirestoreError(Code.INVALID_ARGUMENT, message + reason + description);\r\n}\r\n/** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */\r\nfunction fieldMaskContains(haystack, needle) {\r\n return haystack.some(v => v.isEqual(needle));\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A `DocumentSnapshot` contains data read from a document in your Firestore\r\n * database. The data can be extracted with `.data()` or `.get(<field>)` to\r\n * get a specific field.\r\n *\r\n * For a `DocumentSnapshot` that points to a non-existing document, any data\r\n * access will return 'undefined'. You can use the `exists()` method to\r\n * explicitly verify a document's existence.\r\n */\r\nclass DocumentSnapshot$1 {\r\n // Note: This class is stripped down version of the DocumentSnapshot in\r\n // the legacy SDK. The changes are:\r\n // - No support for SnapshotMetadata.\r\n // - No support for SnapshotOptions.\r\n /** @hideconstructor protected */\r\n constructor(_firestore, _userDataWriter, _key, _document, _converter) {\r\n this._firestore = _firestore;\r\n this._userDataWriter = _userDataWriter;\r\n this._key = _key;\r\n this._document = _document;\r\n this._converter = _converter;\r\n }\r\n /** Property of the `DocumentSnapshot` that provides the document's ID. */\r\n get id() {\r\n return this._key.path.lastSegment();\r\n }\r\n /**\r\n * The `DocumentReference` for the document included in the `DocumentSnapshot`.\r\n */\r\n get ref() {\r\n return new DocumentReference(this._firestore, this._converter, this._key);\r\n }\r\n /**\r\n * Signals whether or not the document at the snapshot's location exists.\r\n *\r\n * @returns true if the document exists.\r\n */\r\n exists() {\r\n return this._document !== null;\r\n }\r\n /**\r\n * Retrieves all fields in the document as an `Object`. Returns `undefined` if\r\n * the document doesn't exist.\r\n *\r\n * @returns An `Object` containing all fields in the document or `undefined`\r\n * if the document doesn't exist.\r\n */\r\n data() {\r\n if (!this._document) {\r\n return undefined;\r\n }\r\n else if (this._converter) {\r\n // We only want to use the converter and create a new DocumentSnapshot\r\n // if a converter has been provided.\r\n const snapshot = new QueryDocumentSnapshot$1(this._firestore, this._userDataWriter, this._key, this._document, \r\n /* converter= */ null);\r\n return this._converter.fromFirestore(snapshot);\r\n }\r\n else {\r\n return this._userDataWriter.convertValue(this._document.data.value);\r\n }\r\n }\r\n /**\r\n * Retrieves the field specified by `fieldPath`. Returns `undefined` if the\r\n * document or field doesn't exist.\r\n *\r\n * @param fieldPath - The path (for example 'foo' or 'foo.bar') to a specific\r\n * field.\r\n * @returns The data at the specified field location or undefined if no such\r\n * field exists in the document.\r\n */\r\n // We are using `any` here to avoid an explicit cast by our users.\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n get(fieldPath) {\r\n if (this._document) {\r\n const value = this._document.data.field(fieldPathFromArgument('DocumentSnapshot.get', fieldPath));\r\n if (value !== null) {\r\n return this._userDataWriter.convertValue(value);\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\n/**\r\n * A `QueryDocumentSnapshot` contains data read from a document in your\r\n * Firestore database as part of a query. The document is guaranteed to exist\r\n * and its data can be extracted with `.data()` or `.get(<field>)` to get a\r\n * specific field.\r\n *\r\n * A `QueryDocumentSnapshot` offers the same API surface as a\r\n * `DocumentSnapshot`. Since query results contain only existing documents, the\r\n * `exists` property will always be true and `data()` will never return\r\n * 'undefined'.\r\n */\r\nclass QueryDocumentSnapshot$1 extends DocumentSnapshot$1 {\r\n /**\r\n * Retrieves all fields in the document as an `Object`.\r\n *\r\n * @override\r\n * @returns An `Object` containing all fields in the document.\r\n */\r\n data() {\r\n return super.data();\r\n }\r\n}\r\n/**\r\n * Helper that calls `fromDotSeparatedString()` but wraps any error thrown.\r\n */\r\nfunction fieldPathFromArgument(methodName, arg) {\r\n if (typeof arg === 'string') {\r\n return fieldPathFromDotSeparatedString(methodName, arg);\r\n }\r\n else if (arg instanceof FieldPath) {\r\n return arg._internalPath;\r\n }\r\n else {\r\n return arg._delegate._internalPath;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Metadata about a snapshot, describing the state of the snapshot.\r\n */\r\nclass SnapshotMetadata {\r\n /** @hideconstructor */\r\n constructor(hasPendingWrites, fromCache) {\r\n this.hasPendingWrites = hasPendingWrites;\r\n this.fromCache = fromCache;\r\n }\r\n /**\r\n * Returns true if this `SnapshotMetadata` is equal to the provided one.\r\n *\r\n * @param other - The `SnapshotMetadata` to compare against.\r\n * @returns true if this `SnapshotMetadata` is equal to the provided one.\r\n */\r\n isEqual(other) {\r\n return (this.hasPendingWrites === other.hasPendingWrites &&\r\n this.fromCache === other.fromCache);\r\n }\r\n}\r\n/**\r\n * A `DocumentSnapshot` contains data read from a document in your Firestore\r\n * database. The data can be extracted with `.data()` or `.get(<field>)` to\r\n * get a specific field.\r\n *\r\n * For a `DocumentSnapshot` that points to a non-existing document, any data\r\n * access will return 'undefined'. You can use the `exists()` method to\r\n * explicitly verify a document's existence.\r\n */\r\nclass DocumentSnapshot extends DocumentSnapshot$1 {\r\n /** @hideconstructor protected */\r\n constructor(_firestore, userDataWriter, key, document, metadata, converter) {\r\n super(_firestore, userDataWriter, key, document, converter);\r\n this._firestore = _firestore;\r\n this._firestoreImpl = _firestore;\r\n this.metadata = metadata;\r\n }\r\n /**\r\n * Property of the `DocumentSnapshot` that signals whether or not the data\r\n * exists. True if the document exists.\r\n */\r\n exists() {\r\n return super.exists();\r\n }\r\n /**\r\n * Retrieves all fields in the document as an `Object`. Returns `undefined` if\r\n * the document doesn't exist.\r\n *\r\n * By default, `FieldValue.serverTimestamp()` values that have not yet been\r\n * set to their final value will be returned as `null`. You can override\r\n * this by passing an options object.\r\n *\r\n * @param options - An options object to configure how data is retrieved from\r\n * the snapshot (for example the desired behavior for server timestamps that\r\n * have not yet been set to their final value).\r\n * @returns An `Object` containing all fields in the document or `undefined` if\r\n * the document doesn't exist.\r\n */\r\n data(options = {}) {\r\n if (!this._document) {\r\n return undefined;\r\n }\r\n else if (this._converter) {\r\n // We only want to use the converter and create a new DocumentSnapshot\r\n // if a converter has been provided.\r\n const snapshot = new QueryDocumentSnapshot(this._firestore, this._userDataWriter, this._key, this._document, this.metadata, \r\n /* converter= */ null);\r\n return this._converter.fromFirestore(snapshot, options);\r\n }\r\n else {\r\n return this._userDataWriter.convertValue(this._document.data.value, options.serverTimestamps);\r\n }\r\n }\r\n /**\r\n * Retrieves the field specified by `fieldPath`. Returns `undefined` if the\r\n * document or field doesn't exist.\r\n *\r\n * By default, a `FieldValue.serverTimestamp()` that has not yet been set to\r\n * its final value will be returned as `null`. You can override this by\r\n * passing an options object.\r\n *\r\n * @param fieldPath - The path (for example 'foo' or 'foo.bar') to a specific\r\n * field.\r\n * @param options - An options object to configure how the field is retrieved\r\n * from the snapshot (for example the desired behavior for server timestamps\r\n * that have not yet been set to their final value).\r\n * @returns The data at the specified field location or undefined if no such\r\n * field exists in the document.\r\n */\r\n // We are using `any` here to avoid an explicit cast by our users.\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n get(fieldPath, options = {}) {\r\n if (this._document) {\r\n const value = this._document.data.field(fieldPathFromArgument('DocumentSnapshot.get', fieldPath));\r\n if (value !== null) {\r\n return this._userDataWriter.convertValue(value, options.serverTimestamps);\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\n/**\r\n * A `QueryDocumentSnapshot` contains data read from a document in your\r\n * Firestore database as part of a query. The document is guaranteed to exist\r\n * and its data can be extracted with `.data()` or `.get(<field>)` to get a\r\n * specific field.\r\n *\r\n * A `QueryDocumentSnapshot` offers the same API surface as a\r\n * `DocumentSnapshot`. Since query results contain only existing documents, the\r\n * `exists` property will always be true and `data()` will never return\r\n * 'undefined'.\r\n */\r\nclass QueryDocumentSnapshot extends DocumentSnapshot {\r\n /**\r\n * Retrieves all fields in the document as an `Object`.\r\n *\r\n * By default, `FieldValue.serverTimestamp()` values that have not yet been\r\n * set to their final value will be returned as `null`. You can override\r\n * this by passing an options object.\r\n *\r\n * @override\r\n * @param options - An options object to configure how data is retrieved from\r\n * the snapshot (for example the desired behavior for server timestamps that\r\n * have not yet been set to their final value).\r\n * @returns An `Object` containing all fields in the document.\r\n */\r\n data(options = {}) {\r\n return super.data(options);\r\n }\r\n}\r\n/**\r\n * A `QuerySnapshot` contains zero or more `DocumentSnapshot` objects\r\n * representing the results of a query. The documents can be accessed as an\r\n * array via the `docs` property or enumerated using the `forEach` method. The\r\n * number of documents can be determined via the `empty` and `size`\r\n * properties.\r\n */\r\nclass QuerySnapshot {\r\n /** @hideconstructor */\r\n constructor(_firestore, _userDataWriter, query, _snapshot) {\r\n this._firestore = _firestore;\r\n this._userDataWriter = _userDataWriter;\r\n this._snapshot = _snapshot;\r\n this.metadata = new SnapshotMetadata(_snapshot.hasPendingWrites, _snapshot.fromCache);\r\n this.query = query;\r\n }\r\n /** An array of all the documents in the `QuerySnapshot`. */\r\n get docs() {\r\n const result = [];\r\n this.forEach(doc => result.push(doc));\r\n return result;\r\n }\r\n /** The number of documents in the `QuerySnapshot`. */\r\n get size() {\r\n return this._snapshot.docs.size;\r\n }\r\n /** True if there are no documents in the `QuerySnapshot`. */\r\n get empty() {\r\n return this.size === 0;\r\n }\r\n /**\r\n * Enumerates all of the documents in the `QuerySnapshot`.\r\n *\r\n * @param callback - A callback to be called with a `QueryDocumentSnapshot` for\r\n * each document in the snapshot.\r\n * @param thisArg - The `this` binding for the callback.\r\n */\r\n forEach(callback, thisArg) {\r\n this._snapshot.docs.forEach(doc => {\r\n callback.call(thisArg, new QueryDocumentSnapshot(this._firestore, this._userDataWriter, doc.key, doc, new SnapshotMetadata(this._snapshot.mutatedKeys.has(doc.key), this._snapshot.fromCache), this.query.converter));\r\n });\r\n }\r\n /**\r\n * Returns an array of the documents changes since the last snapshot. If this\r\n * is the first snapshot, all documents will be in the list as 'added'\r\n * changes.\r\n *\r\n * @param options - `SnapshotListenOptions` that control whether metadata-only\r\n * changes (i.e. only `DocumentSnapshot.metadata` changed) should trigger\r\n * snapshot events.\r\n */\r\n docChanges(options = {}) {\r\n const includeMetadataChanges = !!options.includeMetadataChanges;\r\n if (includeMetadataChanges && this._snapshot.excludesMetadataChanges) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'To include metadata changes with your document changes, you must ' +\r\n 'also pass { includeMetadataChanges:true } to onSnapshot().');\r\n }\r\n if (!this._cachedChanges ||\r\n this._cachedChangesIncludeMetadataChanges !== includeMetadataChanges) {\r\n this._cachedChanges = changesFromSnapshot(this, includeMetadataChanges);\r\n this._cachedChangesIncludeMetadataChanges = includeMetadataChanges;\r\n }\r\n return this._cachedChanges;\r\n }\r\n}\r\n/** Calculates the array of `DocumentChange`s for a given `ViewSnapshot`. */\r\nfunction changesFromSnapshot(querySnapshot, includeMetadataChanges) {\r\n if (querySnapshot._snapshot.oldDocs.isEmpty()) {\r\n let index = 0;\r\n return querySnapshot._snapshot.docChanges.map(change => {\r\n const doc = new QueryDocumentSnapshot(querySnapshot._firestore, querySnapshot._userDataWriter, change.doc.key, change.doc, new SnapshotMetadata(querySnapshot._snapshot.mutatedKeys.has(change.doc.key), querySnapshot._snapshot.fromCache), querySnapshot.query.converter);\r\n return {\r\n type: 'added',\r\n doc,\r\n oldIndex: -1,\r\n newIndex: index++\r\n };\r\n });\r\n }\r\n else {\r\n // A `DocumentSet` that is updated incrementally as changes are applied to use\r\n // to lookup the index of a document.\r\n let indexTracker = querySnapshot._snapshot.oldDocs;\r\n return querySnapshot._snapshot.docChanges\r\n .filter(change => includeMetadataChanges || change.type !== 3 /* Metadata */)\r\n .map(change => {\r\n const doc = new QueryDocumentSnapshot(querySnapshot._firestore, querySnapshot._userDataWriter, change.doc.key, change.doc, new SnapshotMetadata(querySnapshot._snapshot.mutatedKeys.has(change.doc.key), querySnapshot._snapshot.fromCache), querySnapshot.query.converter);\r\n let oldIndex = -1;\r\n let newIndex = -1;\r\n if (change.type !== 0 /* Added */) {\r\n oldIndex = indexTracker.indexOf(change.doc.key);\r\n indexTracker = indexTracker.delete(change.doc.key);\r\n }\r\n if (change.type !== 1 /* Removed */) {\r\n indexTracker = indexTracker.add(change.doc);\r\n newIndex = indexTracker.indexOf(change.doc.key);\r\n }\r\n return {\r\n type: resultChangeType(change.type),\r\n doc,\r\n oldIndex,\r\n newIndex\r\n };\r\n });\r\n }\r\n}\r\nfunction resultChangeType(type) {\r\n switch (type) {\r\n case 0 /* Added */:\r\n return 'added';\r\n case 2 /* Modified */:\r\n case 3 /* Metadata */:\r\n return 'modified';\r\n case 1 /* Removed */:\r\n return 'removed';\r\n default:\r\n return fail();\r\n }\r\n}\r\n// TODO(firestoreexp): Add tests for snapshotEqual with different snapshot\r\n// metadata\r\n/**\r\n * Returns true if the provided snapshots are equal.\r\n *\r\n * @param left - A snapshot to compare.\r\n * @param right - A snapshot to compare.\r\n * @returns true if the snapshots are equal.\r\n */\r\nfunction snapshotEqual(left, right) {\r\n if (left instanceof DocumentSnapshot && right instanceof DocumentSnapshot) {\r\n return (left._firestore === right._firestore &&\r\n left._key.isEqual(right._key) &&\r\n (left._document === null\r\n ? right._document === null\r\n : left._document.isEqual(right._document)) &&\r\n left._converter === right._converter);\r\n }\r\n else if (left instanceof QuerySnapshot && right instanceof QuerySnapshot) {\r\n return (left._firestore === right._firestore &&\r\n queryEqual(left.query, right.query) &&\r\n left.metadata.isEqual(right.metadata) &&\r\n left._snapshot.isEqual(right._snapshot));\r\n }\r\n return false;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction validateHasExplicitOrderByForLimitToLast(query) {\r\n if (hasLimitToLast(query) && query.explicitOrderBy.length === 0) {\r\n throw new FirestoreError(Code.UNIMPLEMENTED, 'limitToLast() queries require specifying at least one orderBy() clause');\r\n }\r\n}\r\n/**\r\n * A `QueryConstraint` is used to narrow the set of documents returned by a\r\n * Firestore query. `QueryConstraint`s are created by invoking {@link where},\r\n * {@link orderBy}, {@link (startAt:1)}, {@link (startAfter:1)}, {@link\r\n * endBefore:1}, {@link (endAt:1)}, {@link limit} or {@link limitToLast} and\r\n * can then be passed to {@link query} to create a new query instance that\r\n * also contains this `QueryConstraint`.\r\n */\r\nclass QueryConstraint {\r\n}\r\n/**\r\n * Creates a new immutable instance of {@link Query} that is extended to also include\r\n * additional query constraints.\r\n *\r\n * @param query - The {@link Query} instance to use as a base for the new constraints.\r\n * @param queryConstraints - The list of {@link QueryConstraint}s to apply.\r\n * @throws if any of the provided query constraints cannot be combined with the\r\n * existing or new constraints.\r\n */\r\nfunction query(query, ...queryConstraints) {\r\n for (const constraint of queryConstraints) {\r\n query = constraint._apply(query);\r\n }\r\n return query;\r\n}\r\nclass QueryFilterConstraint extends QueryConstraint {\r\n constructor(_field, _op, _value) {\r\n super();\r\n this._field = _field;\r\n this._op = _op;\r\n this._value = _value;\r\n this.type = 'where';\r\n }\r\n _apply(query) {\r\n const reader = newUserDataReader(query.firestore);\r\n const filter = newQueryFilter(query._query, 'where', reader, query.firestore._databaseId, this._field, this._op, this._value);\r\n return new Query(query.firestore, query.converter, queryWithAddedFilter(query._query, filter));\r\n }\r\n}\r\n/**\r\n * Creates a {@link QueryConstraint} that enforces that documents must contain the\r\n * specified field and that the value should satisfy the relation constraint\r\n * provided.\r\n *\r\n * @param fieldPath - The path to compare\r\n * @param opStr - The operation string (e.g \"&lt;\", \"&lt;=\", \"==\", \"&lt;\",\r\n * \"&lt;=\", \"!=\").\r\n * @param value - The value for comparison\r\n * @returns The created {@link Query}.\r\n */\r\nfunction where(fieldPath, opStr, value) {\r\n const op = opStr;\r\n const field = fieldPathFromArgument('where', fieldPath);\r\n return new QueryFilterConstraint(field, op, value);\r\n}\r\nclass QueryOrderByConstraint extends QueryConstraint {\r\n constructor(_field, _direction) {\r\n super();\r\n this._field = _field;\r\n this._direction = _direction;\r\n this.type = 'orderBy';\r\n }\r\n _apply(query) {\r\n const orderBy = newQueryOrderBy(query._query, this._field, this._direction);\r\n return new Query(query.firestore, query.converter, queryWithAddedOrderBy(query._query, orderBy));\r\n }\r\n}\r\n/**\r\n * Creates a {@link QueryConstraint} that sorts the query result by the\r\n * specified field, optionally in descending order instead of ascending.\r\n *\r\n * @param fieldPath - The field to sort by.\r\n * @param directionStr - Optional direction to sort by ('asc' or 'desc'). If\r\n * not specified, order will be ascending.\r\n * @returns The created {@link Query}.\r\n */\r\nfunction orderBy(fieldPath, directionStr = 'asc') {\r\n const direction = directionStr;\r\n const path = fieldPathFromArgument('orderBy', fieldPath);\r\n return new QueryOrderByConstraint(path, direction);\r\n}\r\nclass QueryLimitConstraint extends QueryConstraint {\r\n constructor(type, _limit, _limitType) {\r\n super();\r\n this.type = type;\r\n this._limit = _limit;\r\n this._limitType = _limitType;\r\n }\r\n _apply(query) {\r\n return new Query(query.firestore, query.converter, queryWithLimit(query._query, this._limit, this._limitType));\r\n }\r\n}\r\n/**\r\n * Creates a {@link QueryConstraint} that only returns the first matching documents.\r\n *\r\n * @param limit - The maximum number of items to return.\r\n * @returns The created {@link Query}.\r\n */\r\nfunction limit(limit) {\r\n validatePositiveNumber('limit', limit);\r\n return new QueryLimitConstraint('limit', limit, \"F\" /* First */);\r\n}\r\n/**\r\n * Creates a {@link QueryConstraint} that only returns the last matching documents.\r\n *\r\n * You must specify at least one `orderBy` clause for `limitToLast` queries,\r\n * otherwise an exception will be thrown during execution.\r\n *\r\n * @param limit - The maximum number of items to return.\r\n * @returns The created {@link Query}.\r\n */\r\nfunction limitToLast(limit) {\r\n validatePositiveNumber('limitToLast', limit);\r\n return new QueryLimitConstraint('limitToLast', limit, \"L\" /* Last */);\r\n}\r\nclass QueryStartAtConstraint extends QueryConstraint {\r\n constructor(type, _docOrFields, _before) {\r\n super();\r\n this.type = type;\r\n this._docOrFields = _docOrFields;\r\n this._before = _before;\r\n }\r\n _apply(query) {\r\n const bound = newQueryBoundFromDocOrFields(query, this.type, this._docOrFields, this._before);\r\n return new Query(query.firestore, query.converter, queryWithStartAt(query._query, bound));\r\n }\r\n}\r\nfunction startAt(...docOrFields) {\r\n return new QueryStartAtConstraint('startAt', docOrFields, /*before=*/ true);\r\n}\r\nfunction startAfter(...docOrFields) {\r\n return new QueryStartAtConstraint('startAfter', docOrFields, \r\n /*before=*/ false);\r\n}\r\nclass QueryEndAtConstraint extends QueryConstraint {\r\n constructor(type, _docOrFields, _before) {\r\n super();\r\n this.type = type;\r\n this._docOrFields = _docOrFields;\r\n this._before = _before;\r\n }\r\n _apply(query) {\r\n const bound = newQueryBoundFromDocOrFields(query, this.type, this._docOrFields, this._before);\r\n return new Query(query.firestore, query.converter, queryWithEndAt(query._query, bound));\r\n }\r\n}\r\nfunction endBefore(...docOrFields) {\r\n return new QueryEndAtConstraint('endBefore', docOrFields, /*before=*/ true);\r\n}\r\nfunction endAt(...docOrFields) {\r\n return new QueryEndAtConstraint('endAt', docOrFields, /*before=*/ false);\r\n}\r\n/** Helper function to create a bound from a document or fields */\r\nfunction newQueryBoundFromDocOrFields(query, methodName, docOrFields, before) {\r\n docOrFields[0] = getModularInstance(docOrFields[0]);\r\n if (docOrFields[0] instanceof DocumentSnapshot$1) {\r\n return newQueryBoundFromDocument(query._query, query.firestore._databaseId, methodName, docOrFields[0]._document, before);\r\n }\r\n else {\r\n const reader = newUserDataReader(query.firestore);\r\n return newQueryBoundFromFields(query._query, query.firestore._databaseId, reader, methodName, docOrFields, before);\r\n }\r\n}\r\nfunction newQueryFilter(query, methodName, dataReader, databaseId, fieldPath, op, value) {\r\n let fieldValue;\r\n if (fieldPath.isKeyField()) {\r\n if (op === \"array-contains\" /* ARRAY_CONTAINS */ || op === \"array-contains-any\" /* ARRAY_CONTAINS_ANY */) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, `Invalid Query. You can't perform '${op}' ` +\r\n 'queries on FieldPath.documentId().');\r\n }\r\n else if (op === \"in\" /* IN */ || op === \"not-in\" /* NOT_IN */) {\r\n validateDisjunctiveFilterElements(value, op);\r\n const referenceList = [];\r\n for (const arrayValue of value) {\r\n referenceList.push(parseDocumentIdValue(databaseId, query, arrayValue));\r\n }\r\n fieldValue = { arrayValue: { values: referenceList } };\r\n }\r\n else {\r\n fieldValue = parseDocumentIdValue(databaseId, query, value);\r\n }\r\n }\r\n else {\r\n if (op === \"in\" /* IN */ ||\r\n op === \"not-in\" /* NOT_IN */ ||\r\n op === \"array-contains-any\" /* ARRAY_CONTAINS_ANY */) {\r\n validateDisjunctiveFilterElements(value, op);\r\n }\r\n fieldValue = parseQueryValue(dataReader, methodName, value, \r\n /* allowArrays= */ op === \"in\" /* IN */ || op === \"not-in\" /* NOT_IN */);\r\n }\r\n const filter = FieldFilter.create(fieldPath, op, fieldValue);\r\n validateNewFilter(query, filter);\r\n return filter;\r\n}\r\nfunction newQueryOrderBy(query, fieldPath, direction) {\r\n if (query.startAt !== null) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Invalid query. You must not call startAt() or startAfter() before ' +\r\n 'calling orderBy().');\r\n }\r\n if (query.endAt !== null) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Invalid query. You must not call endAt() or endBefore() before ' +\r\n 'calling orderBy().');\r\n }\r\n const orderBy = new OrderBy(fieldPath, direction);\r\n validateNewOrderBy(query, orderBy);\r\n return orderBy;\r\n}\r\n/**\r\n * Create a `Bound` from a query and a document.\r\n *\r\n * Note that the `Bound` will always include the key of the document\r\n * and so only the provided document will compare equal to the returned\r\n * position.\r\n *\r\n * Will throw if the document does not contain all fields of the order by\r\n * of the query or if any of the fields in the order by are an uncommitted\r\n * server timestamp.\r\n */\r\nfunction newQueryBoundFromDocument(query, databaseId, methodName, doc, before) {\r\n if (!doc) {\r\n throw new FirestoreError(Code.NOT_FOUND, `Can't use a DocumentSnapshot that doesn't exist for ` +\r\n `${methodName}().`);\r\n }\r\n const components = [];\r\n // Because people expect to continue/end a query at the exact document\r\n // provided, we need to use the implicit sort order rather than the explicit\r\n // sort order, because it's guaranteed to contain the document key. That way\r\n // the position becomes unambiguous and the query continues/ends exactly at\r\n // the provided document. Without the key (by using the explicit sort\r\n // orders), multiple documents could match the position, yielding duplicate\r\n // results.\r\n for (const orderBy of queryOrderBy(query)) {\r\n if (orderBy.field.isKeyField()) {\r\n components.push(refValue(databaseId, doc.key));\r\n }\r\n else {\r\n const value = doc.data.field(orderBy.field);\r\n if (isServerTimestamp(value)) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Invalid query. You are trying to start or end a query using a ' +\r\n 'document for which the field \"' +\r\n orderBy.field +\r\n '\" is an uncommitted server timestamp. (Since the value of ' +\r\n 'this field is unknown, you cannot start/end a query with it.)');\r\n }\r\n else if (value !== null) {\r\n components.push(value);\r\n }\r\n else {\r\n const field = orderBy.field.canonicalString();\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, `Invalid query. You are trying to start or end a query using a ` +\r\n `document for which the field '${field}' (used as the ` +\r\n `orderBy) does not exist.`);\r\n }\r\n }\r\n }\r\n return new Bound(components, before);\r\n}\r\n/**\r\n * Converts a list of field values to a `Bound` for the given query.\r\n */\r\nfunction newQueryBoundFromFields(query, databaseId, dataReader, methodName, values, before) {\r\n // Use explicit order by's because it has to match the query the user made\r\n const orderBy = query.explicitOrderBy;\r\n if (values.length > orderBy.length) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, `Too many arguments provided to ${methodName}(). ` +\r\n `The number of arguments must be less than or equal to the ` +\r\n `number of orderBy() clauses`);\r\n }\r\n const components = [];\r\n for (let i = 0; i < values.length; i++) {\r\n const rawValue = values[i];\r\n const orderByComponent = orderBy[i];\r\n if (orderByComponent.field.isKeyField()) {\r\n if (typeof rawValue !== 'string') {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, `Invalid query. Expected a string for document ID in ` +\r\n `${methodName}(), but got a ${typeof rawValue}`);\r\n }\r\n if (!isCollectionGroupQuery(query) && rawValue.indexOf('/') !== -1) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, `Invalid query. When querying a collection and ordering by FieldPath.documentId(), ` +\r\n `the value passed to ${methodName}() must be a plain document ID, but ` +\r\n `'${rawValue}' contains a slash.`);\r\n }\r\n const path = query.path.child(ResourcePath.fromString(rawValue));\r\n if (!DocumentKey.isDocumentKey(path)) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, `Invalid query. When querying a collection group and ordering by ` +\r\n `FieldPath.documentId(), the value passed to ${methodName}() must result in a ` +\r\n `valid document path, but '${path}' is not because it contains an odd number ` +\r\n `of segments.`);\r\n }\r\n const key = new DocumentKey(path);\r\n components.push(refValue(databaseId, key));\r\n }\r\n else {\r\n const wrapped = parseQueryValue(dataReader, methodName, rawValue);\r\n components.push(wrapped);\r\n }\r\n }\r\n return new Bound(components, before);\r\n}\r\n/**\r\n * Parses the given `documentIdValue` into a `ReferenceValue`, throwing\r\n * appropriate errors if the value is anything other than a `DocumentReference`\r\n * or `string`, or if the string is malformed.\r\n */\r\nfunction parseDocumentIdValue(databaseId, query, documentIdValue) {\r\n documentIdValue = getModularInstance(documentIdValue);\r\n if (typeof documentIdValue === 'string') {\r\n if (documentIdValue === '') {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Invalid query. When querying with FieldPath.documentId(), you ' +\r\n 'must provide a valid document ID, but it was an empty string.');\r\n }\r\n if (!isCollectionGroupQuery(query) && documentIdValue.indexOf('/') !== -1) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, `Invalid query. When querying a collection by ` +\r\n `FieldPath.documentId(), you must provide a plain document ID, but ` +\r\n `'${documentIdValue}' contains a '/' character.`);\r\n }\r\n const path = query.path.child(ResourcePath.fromString(documentIdValue));\r\n if (!DocumentKey.isDocumentKey(path)) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, `Invalid query. When querying a collection group by ` +\r\n `FieldPath.documentId(), the value provided must result in a valid document path, ` +\r\n `but '${path}' is not because it has an odd number of segments (${path.length}).`);\r\n }\r\n return refValue(databaseId, new DocumentKey(path));\r\n }\r\n else if (documentIdValue instanceof DocumentReference) {\r\n return refValue(databaseId, documentIdValue._key);\r\n }\r\n else {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, `Invalid query. When querying with FieldPath.documentId(), you must provide a valid ` +\r\n `string or a DocumentReference, but it was: ` +\r\n `${valueDescription(documentIdValue)}.`);\r\n }\r\n}\r\n/**\r\n * Validates that the value passed into a disjunctive filter satisfies all\r\n * array requirements.\r\n */\r\nfunction validateDisjunctiveFilterElements(value, operator) {\r\n if (!Array.isArray(value) || value.length === 0) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Invalid Query. A non-empty array is required for ' +\r\n `'${operator.toString()}' filters.`);\r\n }\r\n if (value.length > 10) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, `Invalid Query. '${operator.toString()}' filters support a ` +\r\n 'maximum of 10 elements in the value array.');\r\n }\r\n}\r\n/**\r\n * Given an operator, returns the set of operators that cannot be used with it.\r\n *\r\n * Operators in a query must adhere to the following set of rules:\r\n * 1. Only one array operator is allowed.\r\n * 2. Only one disjunctive operator is allowed.\r\n * 3. `NOT_EQUAL` cannot be used with another `NOT_EQUAL` operator.\r\n * 4. `NOT_IN` cannot be used with array, disjunctive, or `NOT_EQUAL` operators.\r\n *\r\n * Array operators: `ARRAY_CONTAINS`, `ARRAY_CONTAINS_ANY`\r\n * Disjunctive operators: `IN`, `ARRAY_CONTAINS_ANY`, `NOT_IN`\r\n */\r\nfunction conflictingOps(op) {\r\n switch (op) {\r\n case \"!=\" /* NOT_EQUAL */:\r\n return [\"!=\" /* NOT_EQUAL */, \"not-in\" /* NOT_IN */];\r\n case \"array-contains\" /* ARRAY_CONTAINS */:\r\n return [\r\n \"array-contains\" /* ARRAY_CONTAINS */,\r\n \"array-contains-any\" /* ARRAY_CONTAINS_ANY */,\r\n \"not-in\" /* NOT_IN */\r\n ];\r\n case \"in\" /* IN */:\r\n return [\"array-contains-any\" /* ARRAY_CONTAINS_ANY */, \"in\" /* IN */, \"not-in\" /* NOT_IN */];\r\n case \"array-contains-any\" /* ARRAY_CONTAINS_ANY */:\r\n return [\r\n \"array-contains\" /* ARRAY_CONTAINS */,\r\n \"array-contains-any\" /* ARRAY_CONTAINS_ANY */,\r\n \"in\" /* IN */,\r\n \"not-in\" /* NOT_IN */\r\n ];\r\n case \"not-in\" /* NOT_IN */:\r\n return [\r\n \"array-contains\" /* ARRAY_CONTAINS */,\r\n \"array-contains-any\" /* ARRAY_CONTAINS_ANY */,\r\n \"in\" /* IN */,\r\n \"not-in\" /* NOT_IN */,\r\n \"!=\" /* NOT_EQUAL */\r\n ];\r\n default:\r\n return [];\r\n }\r\n}\r\nfunction validateNewFilter(query, filter) {\r\n if (filter.isInequality()) {\r\n const existingField = getInequalityFilterField(query);\r\n if (existingField !== null && !existingField.isEqual(filter.field)) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Invalid query. All where filters with an inequality' +\r\n ' (<, <=, !=, not-in, >, or >=) must be on the same field. But you have' +\r\n ` inequality filters on '${existingField.toString()}'` +\r\n ` and '${filter.field.toString()}'`);\r\n }\r\n const firstOrderByField = getFirstOrderByField(query);\r\n if (firstOrderByField !== null) {\r\n validateOrderByAndInequalityMatch(query, filter.field, firstOrderByField);\r\n }\r\n }\r\n const conflictingOp = findFilterOperator(query, conflictingOps(filter.op));\r\n if (conflictingOp !== null) {\r\n // Special case when it's a duplicate op to give a slightly clearer error message.\r\n if (conflictingOp === filter.op) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Invalid query. You cannot use more than one ' +\r\n `'${filter.op.toString()}' filter.`);\r\n }\r\n else {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, `Invalid query. You cannot use '${filter.op.toString()}' filters ` +\r\n `with '${conflictingOp.toString()}' filters.`);\r\n }\r\n }\r\n}\r\nfunction validateNewOrderBy(query, orderBy) {\r\n if (getFirstOrderByField(query) === null) {\r\n // This is the first order by. It must match any inequality.\r\n const inequalityField = getInequalityFilterField(query);\r\n if (inequalityField !== null) {\r\n validateOrderByAndInequalityMatch(query, inequalityField, orderBy.field);\r\n }\r\n }\r\n}\r\nfunction validateOrderByAndInequalityMatch(baseQuery, inequality, orderBy) {\r\n if (!orderBy.isEqual(inequality)) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, `Invalid query. You have a where filter with an inequality ` +\r\n `(<, <=, !=, not-in, >, or >=) on field '${inequality.toString()}' ` +\r\n `and so you must also use '${inequality.toString()}' ` +\r\n `as your first argument to orderBy(), but your first orderBy() ` +\r\n `is on field '${orderBy.toString()}' instead.`);\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Converts Firestore's internal types to the JavaScript types that we expose\r\n * to the user.\r\n *\r\n * @internal\r\n */\r\nclass AbstractUserDataWriter {\r\n convertValue(value, serverTimestampBehavior = 'none') {\r\n switch (typeOrder(value)) {\r\n case 0 /* NullValue */:\r\n return null;\r\n case 1 /* BooleanValue */:\r\n return value.booleanValue;\r\n case 2 /* NumberValue */:\r\n return normalizeNumber(value.integerValue || value.doubleValue);\r\n case 3 /* TimestampValue */:\r\n return this.convertTimestamp(value.timestampValue);\r\n case 4 /* ServerTimestampValue */:\r\n return this.convertServerTimestamp(value, serverTimestampBehavior);\r\n case 5 /* StringValue */:\r\n return value.stringValue;\r\n case 6 /* BlobValue */:\r\n return this.convertBytes(normalizeByteString(value.bytesValue));\r\n case 7 /* RefValue */:\r\n return this.convertReference(value.referenceValue);\r\n case 8 /* GeoPointValue */:\r\n return this.convertGeoPoint(value.geoPointValue);\r\n case 9 /* ArrayValue */:\r\n return this.convertArray(value.arrayValue, serverTimestampBehavior);\r\n case 10 /* ObjectValue */:\r\n return this.convertObject(value.mapValue, serverTimestampBehavior);\r\n default:\r\n throw fail();\r\n }\r\n }\r\n convertObject(mapValue, serverTimestampBehavior) {\r\n const result = {};\r\n forEach(mapValue.fields, (key, value) => {\r\n result[key] = this.convertValue(value, serverTimestampBehavior);\r\n });\r\n return result;\r\n }\r\n convertGeoPoint(value) {\r\n return new GeoPoint(normalizeNumber(value.latitude), normalizeNumber(value.longitude));\r\n }\r\n convertArray(arrayValue, serverTimestampBehavior) {\r\n return (arrayValue.values || []).map(value => this.convertValue(value, serverTimestampBehavior));\r\n }\r\n convertServerTimestamp(value, serverTimestampBehavior) {\r\n switch (serverTimestampBehavior) {\r\n case 'previous':\r\n const previousValue = getPreviousValue(value);\r\n if (previousValue == null) {\r\n return null;\r\n }\r\n return this.convertValue(previousValue, serverTimestampBehavior);\r\n case 'estimate':\r\n return this.convertTimestamp(getLocalWriteTime(value));\r\n default:\r\n return null;\r\n }\r\n }\r\n convertTimestamp(value) {\r\n const normalizedValue = normalizeTimestamp(value);\r\n return new Timestamp(normalizedValue.seconds, normalizedValue.nanos);\r\n }\r\n convertDocumentKey(name, expectedDatabaseId) {\r\n const resourcePath = ResourcePath.fromString(name);\r\n hardAssert(isValidResourceName(resourcePath));\r\n const databaseId = new DatabaseId(resourcePath.get(1), resourcePath.get(3));\r\n const key = new DocumentKey(resourcePath.popFirst(5));\r\n if (!databaseId.isEqual(expectedDatabaseId)) {\r\n // TODO(b/64130202): Somehow support foreign references.\r\n logError(`Document ${key} contains a document ` +\r\n `reference within a different database (` +\r\n `${databaseId.projectId}/${databaseId.database}) which is not ` +\r\n `supported. It will be treated as a reference in the current ` +\r\n `database (${expectedDatabaseId.projectId}/${expectedDatabaseId.database}) ` +\r\n `instead.`);\r\n }\r\n return key;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Converts custom model object of type T into `DocumentData` by applying the\r\n * converter if it exists.\r\n *\r\n * This function is used when converting user objects to `DocumentData`\r\n * because we want to provide the user with a more specific error message if\r\n * their `set()` or fails due to invalid data originating from a `toFirestore()`\r\n * call.\r\n */\r\nfunction applyFirestoreDataConverter(converter, value, options) {\r\n let convertedValue;\r\n if (converter) {\r\n if (options && (options.merge || options.mergeFields)) {\r\n // Cast to `any` in order to satisfy the union type constraint on\r\n // toFirestore().\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n convertedValue = converter.toFirestore(value, options);\r\n }\r\n else {\r\n convertedValue = converter.toFirestore(value);\r\n }\r\n }\r\n else {\r\n convertedValue = value;\r\n }\r\n return convertedValue;\r\n}\r\nclass LiteUserDataWriter extends AbstractUserDataWriter {\r\n constructor(firestore) {\r\n super();\r\n this.firestore = firestore;\r\n }\r\n convertBytes(bytes) {\r\n return new Bytes(bytes);\r\n }\r\n convertReference(name) {\r\n const key = this.convertDocumentKey(name, this.firestore._databaseId);\r\n return new DocumentReference(this.firestore, /* converter= */ null, key);\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A write batch, used to perform multiple writes as a single atomic unit.\r\n *\r\n * A `WriteBatch` object can be acquired by calling {@link writeBatch}. It\r\n * provides methods for adding writes to the write batch. None of the writes\r\n * will be committed (or visible locally) until {@link WriteBatch.commit} is\r\n * called.\r\n */\r\nclass WriteBatch {\r\n /** @hideconstructor */\r\n constructor(_firestore, _commitHandler) {\r\n this._firestore = _firestore;\r\n this._commitHandler = _commitHandler;\r\n this._mutations = [];\r\n this._committed = false;\r\n this._dataReader = newUserDataReader(_firestore);\r\n }\r\n set(documentRef, data, options) {\r\n this._verifyNotCommitted();\r\n const ref = validateReference(documentRef, this._firestore);\r\n const convertedValue = applyFirestoreDataConverter(ref.converter, data, options);\r\n const parsed = parseSetData(this._dataReader, 'WriteBatch.set', ref._key, convertedValue, ref.converter !== null, options);\r\n this._mutations.push(parsed.toMutation(ref._key, Precondition.none()));\r\n return this;\r\n }\r\n update(documentRef, fieldOrUpdateData, value, ...moreFieldsAndValues) {\r\n this._verifyNotCommitted();\r\n const ref = validateReference(documentRef, this._firestore);\r\n // For Compat types, we have to \"extract\" the underlying types before\r\n // performing validation.\r\n fieldOrUpdateData = getModularInstance(fieldOrUpdateData);\r\n let parsed;\r\n if (typeof fieldOrUpdateData === 'string' ||\r\n fieldOrUpdateData instanceof FieldPath) {\r\n parsed = parseUpdateVarargs(this._dataReader, 'WriteBatch.update', ref._key, fieldOrUpdateData, value, moreFieldsAndValues);\r\n }\r\n else {\r\n parsed = parseUpdateData(this._dataReader, 'WriteBatch.update', ref._key, fieldOrUpdateData);\r\n }\r\n this._mutations.push(parsed.toMutation(ref._key, Precondition.exists(true)));\r\n return this;\r\n }\r\n /**\r\n * Deletes the document referred to by the provided {@link DocumentReference}.\r\n *\r\n * @param documentRef - A reference to the document to be deleted.\r\n * @returns This `WriteBatch` instance. Used for chaining method calls.\r\n */\r\n delete(documentRef) {\r\n this._verifyNotCommitted();\r\n const ref = validateReference(documentRef, this._firestore);\r\n this._mutations = this._mutations.concat(new DeleteMutation(ref._key, Precondition.none()));\r\n return this;\r\n }\r\n /**\r\n * Commits all of the writes in this write batch as a single atomic unit.\r\n *\r\n * The result of these writes will only be reflected in document reads that\r\n * occur after the returned promise resolves. If the client is offline, the\r\n * write fails. If you would like to see local modifications or buffer writes\r\n * until the client is online, use the full Firestore SDK.\r\n *\r\n * @returns A `Promise` resolved once all of the writes in the batch have been\r\n * successfully written to the backend as an atomic unit (note that it won't\r\n * resolve while you're offline).\r\n */\r\n commit() {\r\n this._verifyNotCommitted();\r\n this._committed = true;\r\n if (this._mutations.length > 0) {\r\n return this._commitHandler(this._mutations);\r\n }\r\n return Promise.resolve();\r\n }\r\n _verifyNotCommitted() {\r\n if (this._committed) {\r\n throw new FirestoreError(Code.FAILED_PRECONDITION, 'A write batch can no longer be used after commit() ' +\r\n 'has been called.');\r\n }\r\n }\r\n}\r\nfunction validateReference(documentRef, firestore) {\r\n documentRef = getModularInstance(documentRef);\r\n if (documentRef.firestore !== firestore) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'Provided document reference is from a different Firestore instance.');\r\n }\r\n else {\r\n return documentRef;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n// TODO(mrschmidt) Consider using `BaseTransaction` as the base class in the\r\n// legacy SDK.\r\n/**\r\n * A reference to a transaction.\r\n *\r\n * The `Transaction` object passed to a transaction's `updateFunction` provides\r\n * the methods to read and write data within the transaction context. See\r\n * {@link runTransaction}.\r\n */\r\nclass Transaction$1 {\r\n /** @hideconstructor */\r\n constructor(_firestore, _transaction) {\r\n this._firestore = _firestore;\r\n this._transaction = _transaction;\r\n this._dataReader = newUserDataReader(_firestore);\r\n }\r\n /**\r\n * Reads the document referenced by the provided {@link DocumentReference}.\r\n *\r\n * @param documentRef - A reference to the document to be read.\r\n * @returns A `DocumentSnapshot` with the read data.\r\n */\r\n get(documentRef) {\r\n const ref = validateReference(documentRef, this._firestore);\r\n const userDataWriter = new LiteUserDataWriter(this._firestore);\r\n return this._transaction.lookup([ref._key]).then(docs => {\r\n if (!docs || docs.length !== 1) {\r\n return fail();\r\n }\r\n const doc = docs[0];\r\n if (doc.isFoundDocument()) {\r\n return new DocumentSnapshot$1(this._firestore, userDataWriter, doc.key, doc, ref.converter);\r\n }\r\n else if (doc.isNoDocument()) {\r\n return new DocumentSnapshot$1(this._firestore, userDataWriter, ref._key, null, ref.converter);\r\n }\r\n else {\r\n throw fail();\r\n }\r\n });\r\n }\r\n set(documentRef, value, options) {\r\n const ref = validateReference(documentRef, this._firestore);\r\n const convertedValue = applyFirestoreDataConverter(ref.converter, value, options);\r\n const parsed = parseSetData(this._dataReader, 'Transaction.set', ref._key, convertedValue, ref.converter !== null, options);\r\n this._transaction.set(ref._key, parsed);\r\n return this;\r\n }\r\n update(documentRef, fieldOrUpdateData, value, ...moreFieldsAndValues) {\r\n const ref = validateReference(documentRef, this._firestore);\r\n // For Compat types, we have to \"extract\" the underlying types before\r\n // performing validation.\r\n fieldOrUpdateData = getModularInstance(fieldOrUpdateData);\r\n let parsed;\r\n if (typeof fieldOrUpdateData === 'string' ||\r\n fieldOrUpdateData instanceof FieldPath) {\r\n parsed = parseUpdateVarargs(this._dataReader, 'Transaction.update', ref._key, fieldOrUpdateData, value, moreFieldsAndValues);\r\n }\r\n else {\r\n parsed = parseUpdateData(this._dataReader, 'Transaction.update', ref._key, fieldOrUpdateData);\r\n }\r\n this._transaction.update(ref._key, parsed);\r\n return this;\r\n }\r\n /**\r\n * Deletes the document referred to by the provided {@link DocumentReference}.\r\n *\r\n * @param documentRef - A reference to the document to be deleted.\r\n * @returns This `Transaction` instance. Used for chaining method calls.\r\n */\r\n delete(documentRef) {\r\n const ref = validateReference(documentRef, this._firestore);\r\n this._transaction.delete(ref._key);\r\n return this;\r\n }\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction isPartialObserver(obj) {\r\n return implementsAnyMethods(obj, ['next', 'error', 'complete']);\r\n}\r\n/**\r\n * Returns true if obj is an object and contains at least one of the specified\r\n * methods.\r\n */\r\nfunction implementsAnyMethods(obj, methods) {\r\n if (typeof obj !== 'object' || obj === null) {\r\n return false;\r\n }\r\n const object = obj;\r\n for (const method of methods) {\r\n if (method in object && typeof object[method] === 'function') {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Reads the document referred to by this `DocumentReference`.\r\n *\r\n * Note: `getDoc()` attempts to provide up-to-date data when possible by waiting\r\n * for data from the server, but it may return cached data or fail if you are\r\n * offline and the server cannot be reached. To specify this behavior, invoke\r\n * {@link getDocFromCache} or {@link getDocFromServer}.\r\n *\r\n * @param reference - The reference of the document to fetch.\r\n * @returns A Promise resolved with a `DocumentSnapshot` containing the\r\n * current document contents.\r\n */\r\nfunction getDoc(reference) {\r\n reference = cast(reference, DocumentReference);\r\n const firestore = cast(reference.firestore, Firestore);\r\n const client = ensureFirestoreConfigured(firestore);\r\n return firestoreClientGetDocumentViaSnapshotListener(client, reference._key).then(snapshot => convertToDocSnapshot(firestore, reference, snapshot));\r\n}\r\nclass ExpUserDataWriter extends AbstractUserDataWriter {\r\n constructor(firestore) {\r\n super();\r\n this.firestore = firestore;\r\n }\r\n convertBytes(bytes) {\r\n return new Bytes(bytes);\r\n }\r\n convertReference(name) {\r\n const key = this.convertDocumentKey(name, this.firestore._databaseId);\r\n return new DocumentReference(this.firestore, /* converter= */ null, key);\r\n }\r\n}\r\n/**\r\n * Reads the document referred to by this `DocumentReference` from cache.\r\n * Returns an error if the document is not currently cached.\r\n *\r\n * @returns A `Promise` resolved with a `DocumentSnapshot` containing the\r\n * current document contents.\r\n */\r\nfunction getDocFromCache(reference) {\r\n reference = cast(reference, DocumentReference);\r\n const firestore = cast(reference.firestore, Firestore);\r\n const client = ensureFirestoreConfigured(firestore);\r\n const userDataWriter = new ExpUserDataWriter(firestore);\r\n return firestoreClientGetDocumentFromLocalCache(client, reference._key).then(doc => new DocumentSnapshot(firestore, userDataWriter, reference._key, doc, new SnapshotMetadata(doc !== null && doc.hasLocalMutations, \r\n /* fromCache= */ true), reference.converter));\r\n}\r\n/**\r\n * Reads the document referred to by this `DocumentReference` from the server.\r\n * Returns an error if the network is not available.\r\n *\r\n * @returns A `Promise` resolved with a `DocumentSnapshot` containing the\r\n * current document contents.\r\n */\r\nfunction getDocFromServer(reference) {\r\n reference = cast(reference, DocumentReference);\r\n const firestore = cast(reference.firestore, Firestore);\r\n const client = ensureFirestoreConfigured(firestore);\r\n return firestoreClientGetDocumentViaSnapshotListener(client, reference._key, {\r\n source: 'server'\r\n }).then(snapshot => convertToDocSnapshot(firestore, reference, snapshot));\r\n}\r\n/**\r\n * Executes the query and returns the results as a `QuerySnapshot`.\r\n *\r\n * Note: `getDocs()` attempts to provide up-to-date data when possible by\r\n * waiting for data from the server, but it may return cached data or fail if\r\n * you are offline and the server cannot be reached. To specify this behavior,\r\n * invoke {@link getDocsFromCache} or {@link getDocsFromServer}.\r\n *\r\n * @returns A `Promise` that will be resolved with the results of the query.\r\n */\r\nfunction getDocs(query) {\r\n query = cast(query, Query);\r\n const firestore = cast(query.firestore, Firestore);\r\n const client = ensureFirestoreConfigured(firestore);\r\n const userDataWriter = new ExpUserDataWriter(firestore);\r\n validateHasExplicitOrderByForLimitToLast(query._query);\r\n return firestoreClientGetDocumentsViaSnapshotListener(client, query._query).then(snapshot => new QuerySnapshot(firestore, userDataWriter, query, snapshot));\r\n}\r\n/**\r\n * Executes the query and returns the results as a `QuerySnapshot` from cache.\r\n * Returns an error if the document is not currently cached.\r\n *\r\n * @returns A `Promise` that will be resolved with the results of the query.\r\n */\r\nfunction getDocsFromCache(query) {\r\n query = cast(query, Query);\r\n const firestore = cast(query.firestore, Firestore);\r\n const client = ensureFirestoreConfigured(firestore);\r\n const userDataWriter = new ExpUserDataWriter(firestore);\r\n return firestoreClientGetDocumentsFromLocalCache(client, query._query).then(snapshot => new QuerySnapshot(firestore, userDataWriter, query, snapshot));\r\n}\r\n/**\r\n * Executes the query and returns the results as a `QuerySnapshot` from the\r\n * server. Returns an error if the network is not available.\r\n *\r\n * @returns A `Promise` that will be resolved with the results of the query.\r\n */\r\nfunction getDocsFromServer(query) {\r\n query = cast(query, Query);\r\n const firestore = cast(query.firestore, Firestore);\r\n const client = ensureFirestoreConfigured(firestore);\r\n const userDataWriter = new ExpUserDataWriter(firestore);\r\n return firestoreClientGetDocumentsViaSnapshotListener(client, query._query, {\r\n source: 'server'\r\n }).then(snapshot => new QuerySnapshot(firestore, userDataWriter, query, snapshot));\r\n}\r\nfunction setDoc(reference, data, options) {\r\n reference = cast(reference, DocumentReference);\r\n const firestore = cast(reference.firestore, Firestore);\r\n const convertedValue = applyFirestoreDataConverter(reference.converter, data, options);\r\n const dataReader = newUserDataReader(firestore);\r\n const parsed = parseSetData(dataReader, 'setDoc', reference._key, convertedValue, reference.converter !== null, options);\r\n const mutation = parsed.toMutation(reference._key, Precondition.none());\r\n return executeWrite(firestore, [mutation]);\r\n}\r\nfunction updateDoc(reference, fieldOrUpdateData, value, ...moreFieldsAndValues) {\r\n reference = cast(reference, DocumentReference);\r\n const firestore = cast(reference.firestore, Firestore);\r\n const dataReader = newUserDataReader(firestore);\r\n // For Compat types, we have to \"extract\" the underlying types before\r\n // performing validation.\r\n fieldOrUpdateData = getModularInstance(fieldOrUpdateData);\r\n let parsed;\r\n if (typeof fieldOrUpdateData === 'string' ||\r\n fieldOrUpdateData instanceof FieldPath) {\r\n parsed = parseUpdateVarargs(dataReader, 'updateDoc', reference._key, fieldOrUpdateData, value, moreFieldsAndValues);\r\n }\r\n else {\r\n parsed = parseUpdateData(dataReader, 'updateDoc', reference._key, fieldOrUpdateData);\r\n }\r\n const mutation = parsed.toMutation(reference._key, Precondition.exists(true));\r\n return executeWrite(firestore, [mutation]);\r\n}\r\n/**\r\n * Deletes the document referred to by the specified `DocumentReference`.\r\n *\r\n * @param reference - A reference to the document to delete.\r\n * @returns A Promise resolved once the document has been successfully\r\n * deleted from the backend (note that it won't resolve while you're offline).\r\n */\r\nfunction deleteDoc(reference) {\r\n const firestore = cast(reference.firestore, Firestore);\r\n const mutations = [new DeleteMutation(reference._key, Precondition.none())];\r\n return executeWrite(firestore, mutations);\r\n}\r\n/**\r\n * Add a new document to specified `CollectionReference` with the given data,\r\n * assigning it a document ID automatically.\r\n *\r\n * @param reference - A reference to the collection to add this document to.\r\n * @param data - An Object containing the data for the new document.\r\n * @returns A `Promise` resolved with a `DocumentReference` pointing to the\r\n * newly created document after it has been written to the backend (Note that it\r\n * won't resolve while you're offline).\r\n */\r\nfunction addDoc(reference, data) {\r\n const firestore = cast(reference.firestore, Firestore);\r\n const docRef = doc(reference);\r\n const convertedValue = applyFirestoreDataConverter(reference.converter, data);\r\n const dataReader = newUserDataReader(reference.firestore);\r\n const parsed = parseSetData(dataReader, 'addDoc', docRef._key, convertedValue, reference.converter !== null, {});\r\n const mutation = parsed.toMutation(docRef._key, Precondition.exists(false));\r\n return executeWrite(firestore, [mutation]).then(() => docRef);\r\n}\r\nfunction onSnapshot(reference, ...args) {\r\n var _a, _b, _c;\r\n reference = getModularInstance(reference);\r\n let options = {\r\n includeMetadataChanges: false\r\n };\r\n let currArg = 0;\r\n if (typeof args[currArg] === 'object' && !isPartialObserver(args[currArg])) {\r\n options = args[currArg];\r\n currArg++;\r\n }\r\n const internalOptions = {\r\n includeMetadataChanges: options.includeMetadataChanges\r\n };\r\n if (isPartialObserver(args[currArg])) {\r\n const userObserver = args[currArg];\r\n args[currArg] = (_a = userObserver.next) === null || _a === void 0 ? void 0 : _a.bind(userObserver);\r\n args[currArg + 1] = (_b = userObserver.error) === null || _b === void 0 ? void 0 : _b.bind(userObserver);\r\n args[currArg + 2] = (_c = userObserver.complete) === null || _c === void 0 ? void 0 : _c.bind(userObserver);\r\n }\r\n let observer;\r\n let firestore;\r\n let internalQuery;\r\n if (reference instanceof DocumentReference) {\r\n firestore = cast(reference.firestore, Firestore);\r\n internalQuery = newQueryForPath(reference._key.path);\r\n observer = {\r\n next: snapshot => {\r\n if (args[currArg]) {\r\n args[currArg](convertToDocSnapshot(firestore, reference, snapshot));\r\n }\r\n },\r\n error: args[currArg + 1],\r\n complete: args[currArg + 2]\r\n };\r\n }\r\n else {\r\n const query = cast(reference, Query);\r\n firestore = cast(query.firestore, Firestore);\r\n internalQuery = query._query;\r\n const userDataWriter = new ExpUserDataWriter(firestore);\r\n observer = {\r\n next: snapshot => {\r\n if (args[currArg]) {\r\n args[currArg](new QuerySnapshot(firestore, userDataWriter, query, snapshot));\r\n }\r\n },\r\n error: args[currArg + 1],\r\n complete: args[currArg + 2]\r\n };\r\n validateHasExplicitOrderByForLimitToLast(reference._query);\r\n }\r\n const client = ensureFirestoreConfigured(firestore);\r\n return firestoreClientListen(client, internalQuery, internalOptions, observer);\r\n}\r\nfunction onSnapshotsInSync(firestore, arg) {\r\n firestore = cast(firestore, Firestore);\r\n const client = ensureFirestoreConfigured(firestore);\r\n const observer = isPartialObserver(arg)\r\n ? arg\r\n : {\r\n next: arg\r\n };\r\n return firestoreClientAddSnapshotsInSyncListener(client, observer);\r\n}\r\n/**\r\n * Locally writes `mutations` on the async queue.\r\n * @internal\r\n */\r\nfunction executeWrite(firestore, mutations) {\r\n const client = ensureFirestoreConfigured(firestore);\r\n return firestoreClientWrite(client, mutations);\r\n}\r\n/**\r\n * Converts a {@link ViewSnapshot} that contains the single document specified by `ref`\r\n * to a {@link DocumentSnapshot}.\r\n */\r\nfunction convertToDocSnapshot(firestore, ref, snapshot) {\r\n const doc = snapshot.docs.get(ref._key);\r\n const userDataWriter = new ExpUserDataWriter(firestore);\r\n return new DocumentSnapshot(firestore, userDataWriter, ref._key, doc, new SnapshotMetadata(snapshot.hasPendingWrites, snapshot.fromCache), ref.converter);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A reference to a transaction.\r\n *\r\n * The `Transaction` object passed to a transaction's `updateFunction` provides\r\n * the methods to read and write data within the transaction context. See\r\n * {@link runTransaction}.\r\n */\r\nclass Transaction extends Transaction$1 {\r\n // This class implements the same logic as the Transaction API in the Lite SDK\r\n // but is subclassed in order to return its own DocumentSnapshot types.\r\n /** @hideconstructor */\r\n constructor(_firestore, _transaction) {\r\n super(_firestore, _transaction);\r\n this._firestore = _firestore;\r\n }\r\n /**\r\n * Reads the document referenced by the provided {@link DocumentReference}.\r\n *\r\n * @param documentRef - A reference to the document to be read.\r\n * @returns A `DocumentSnapshot` with the read data.\r\n */\r\n get(documentRef) {\r\n const ref = validateReference(documentRef, this._firestore);\r\n const userDataWriter = new ExpUserDataWriter(this._firestore);\r\n return super\r\n .get(documentRef)\r\n .then(liteDocumentSnapshot => new DocumentSnapshot(this._firestore, userDataWriter, ref._key, liteDocumentSnapshot._document, new SnapshotMetadata(\r\n /* hasPendingWrites= */ false, \r\n /* fromCache= */ false), ref.converter));\r\n }\r\n}\r\n/**\r\n * Executes the given `updateFunction` and then attempts to commit the changes\r\n * applied within the transaction. If any document read within the transaction\r\n * has changed, Cloud Firestore retries the `updateFunction`. If it fails to\r\n * commit after 5 attempts, the transaction fails.\r\n *\r\n * The maximum number of writes allowed in a single transaction is 500.\r\n *\r\n * @param firestore - A reference to the Firestore database to run this\r\n * transaction against.\r\n * @param updateFunction - The function to execute within the transaction\r\n * context.\r\n * @returns If the transaction completed successfully or was explicitly aborted\r\n * (the `updateFunction` returned a failed promise), the promise returned by the\r\n * `updateFunction `is returned here. Otherwise, if the transaction failed, a\r\n * rejected promise with the corresponding failure error is returned.\r\n */\r\nfunction runTransaction(firestore, updateFunction) {\r\n firestore = cast(firestore, Firestore);\r\n const client = ensureFirestoreConfigured(firestore);\r\n return firestoreClientTransaction(client, internalTransaction => updateFunction(new Transaction(firestore, internalTransaction)));\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Returns a sentinel for use with {@link @firebase/firestore/lite#(updateDoc:1)} or\r\n * {@link @firebase/firestore/lite#(setDoc:1)} with `{merge: true}` to mark a field for deletion.\r\n */\r\nfunction deleteField() {\r\n return new DeleteFieldValueImpl('deleteField');\r\n}\r\n/**\r\n * Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to\r\n * include a server-generated timestamp in the written data.\r\n */\r\nfunction serverTimestamp() {\r\n return new ServerTimestampFieldValueImpl('serverTimestamp');\r\n}\r\n/**\r\n * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link\r\n * @firebase/firestore/lite#(updateDoc:1)} that tells the server to union the given elements with any array\r\n * value that already exists on the server. Each specified element that doesn't\r\n * already exist in the array will be added to the end. If the field being\r\n * modified is not already an array it will be overwritten with an array\r\n * containing exactly the specified elements.\r\n *\r\n * @param elements - The elements to union into the array.\r\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\r\n * `updateDoc()`.\r\n */\r\nfunction arrayUnion(...elements) {\r\n // NOTE: We don't actually parse the data until it's used in set() or\r\n // update() since we'd need the Firestore instance to do this.\r\n return new ArrayUnionFieldValueImpl('arrayUnion', elements);\r\n}\r\n/**\r\n * Returns a special value that can be used with {@link (setDoc:1)} or {@link\r\n * updateDoc:1} that tells the server to remove the given elements from any\r\n * array value that already exists on the server. All instances of each element\r\n * specified will be removed from the array. If the field being modified is not\r\n * already an array it will be overwritten with an empty array.\r\n *\r\n * @param elements - The elements to remove from the array.\r\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\r\n * `updateDoc()`\r\n */\r\nfunction arrayRemove(...elements) {\r\n // NOTE: We don't actually parse the data until it's used in set() or\r\n // update() since we'd need the Firestore instance to do this.\r\n return new ArrayRemoveFieldValueImpl('arrayRemove', elements);\r\n}\r\n/**\r\n * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link\r\n * @firebase/firestore/lite#(updateDoc:1)} that tells the server to increment the field's current value by\r\n * the given value.\r\n *\r\n * If either the operand or the current field value uses floating point\r\n * precision, all arithmetic follows IEEE 754 semantics. If both values are\r\n * integers, values outside of JavaScript's safe number range\r\n * (`Number.MIN_SAFE_INTEGER` to `Number.MAX_SAFE_INTEGER`) are also subject to\r\n * precision loss. Furthermore, once processed by the Firestore backend, all\r\n * integer operations are capped between -2^63 and 2^63-1.\r\n *\r\n * If the current field value is not of type `number`, or if the field does not\r\n * yet exist, the transformation sets the field to the given value.\r\n *\r\n * @param n - The value to increment by.\r\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\r\n * `updateDoc()`\r\n */\r\nfunction increment(n) {\r\n return new NumericIncrementFieldValueImpl('increment', n);\r\n}\n\n/**\r\n * @license\r\n * Copyright 2020 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Creates a write batch, used for performing multiple writes as a single\r\n * atomic operation. The maximum number of writes allowed in a single {@link WriteBatch}\r\n * is 500.\r\n *\r\n * Unlike transactions, write batches are persisted offline and therefore are\r\n * preferable when you don't need to condition your writes on read data.\r\n *\r\n * @returns A {@link WriteBatch} that can be used to atomically execute multiple\r\n * writes.\r\n */\r\nfunction writeBatch(firestore) {\r\n firestore = cast(firestore, Firestore);\r\n ensureFirestoreConfigured(firestore);\r\n return new WriteBatch(firestore, mutations => executeWrite(firestore, mutations));\r\n}\n\n/**\r\n * @license\r\n * Copyright 2021 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nregisterFirestore('node');\n\nexport { AbstractUserDataWriter, Bytes, CACHE_SIZE_UNLIMITED, CollectionReference, DocumentReference, DocumentSnapshot, FieldPath, FieldValue, Firestore, FirestoreError, GeoPoint, LoadBundleTask, Query, QueryConstraint, QueryDocumentSnapshot, QuerySnapshot, SnapshotMetadata, Timestamp, Transaction, WriteBatch, DatabaseId as _DatabaseId, DocumentKey as _DocumentKey, EmptyCredentialsProvider as _EmptyCredentialsProvider, FieldPath$1 as _FieldPath, cast as _cast, debugAssert as _debugAssert, isBase64Available as _isBase64Available, logWarn as _logWarn, validateIsNotUsedTogether as _validateIsNotUsedTogether, addDoc, arrayRemove, arrayUnion, clearIndexedDbPersistence, collection, collectionGroup, connectFirestoreEmulator, deleteDoc, deleteField, disableNetwork, doc, documentId, enableIndexedDbPersistence, enableMultiTabIndexedDbPersistence, enableNetwork, endAt, endBefore, ensureFirestoreConfigured, executeWrite, getDoc, getDocFromCache, getDocFromServer, getDocs, getDocsFromCache, getDocsFromServer, getFirestore, increment, initializeFirestore, limit, limitToLast, loadBundle, namedQuery, onSnapshot, onSnapshotsInSync, orderBy, query, queryEqual, refEqual, runTransaction, serverTimestamp, setDoc, setLogLevel, snapshotEqual, startAfter, startAt, terminate, updateDoc, waitForPendingWrites, where, writeBatch };\n//# sourceMappingURL=index.node.mjs.map\n"],"names":[],"mappings":";;;;;;;;;;;AAWA,MAAM,IAAI,GAAG,qBAAqB,CAAC;AACnC,MAAM,SAAS,GAAG,OAAO,CAAC;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,IAAI,CAAC;AACX,IAAI,WAAW,CAAC,GAAG,EAAE;AACrB,QAAQ,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;AACvB,KAAK;AACL,IAAI,eAAe,GAAG;AACtB,QAAQ,OAAO,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC;AAChC,KAAK;AACL;AACA;AACA;AACA;AACA,IAAI,KAAK,GAAG;AACZ,QAAQ,IAAI,IAAI,CAAC,eAAe,EAAE,EAAE;AACpC,YAAY,OAAO,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC;AACrC,SAAS;AACT,aAAa;AACb,YAAY,OAAO,gBAAgB,CAAC;AACpC,SAAS;AACT,KAAK;AACL,IAAI,OAAO,CAAC,SAAS,EAAE;AACvB,QAAQ,OAAO,SAAS,CAAC,GAAG,KAAK,IAAI,CAAC,GAAG,CAAC;AAC1C,KAAK;AACL,CAAC;AACD;AACA,IAAI,CAAC,eAAe,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;AACtC;AACA;AACA,IAAI,CAAC,kBAAkB,GAA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OAAO,IAAI,yBAAyB,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;AAClE,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,SAAS,CAAC,CAAC,EAAE;AACtB,IAAI,OAAO,IAAI,8BAA8B,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;AAC9D,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,UAAU,CAAC,SAAS,EAAE;AAC/B,IAAI,SAAS,GAAG,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;AAC3C,IAAI,yBAAyB,CAAC,SAAS,CAAC,CAAC;AACzC,IAAI,OAAO,IAAI,UAAU,CAAC,SAAS,EAAE,SAAS,IAAI,YAAY,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;AACtF,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,CAAC,MAAM,CAAC;;;;"}