@rebasepro/server 0.25.0 → 0.26.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.
- package/dist/{GCSStorageController-C7ARrDAp.js → GCSStorageController-40FyFeSx.js} +8 -4
- package/dist/GCSStorageController-40FyFeSx.js.map +1 -0
- package/dist/{S3StorageController-qevJ0pVE.js → S3StorageController-Bl5shp94.js} +8 -4
- package/dist/S3StorageController-Bl5shp94.js.map +1 -0
- package/dist/access-BFAUvsSs.js +1897 -0
- package/dist/access-BFAUvsSs.js.map +1 -0
- package/dist/api/branch-routes.d.ts +25 -0
- package/dist/api/closed-database.d.ts +25 -0
- package/dist/api/live-schema-routes.d.ts +10 -0
- package/dist/api/rest/api-generator.d.ts +9 -1
- package/dist/api/rest/idempotency.d.ts +15 -1
- package/dist/api/root-error-handler.d.ts +6 -5
- package/dist/api/types.d.ts +12 -0
- package/dist/{ast-schema-editor-mCeSC03x.js → ast-schema-editor-madTa9Hh.js} +2 -2
- package/dist/{ast-schema-editor-mCeSC03x.js.map → ast-schema-editor-madTa9Hh.js.map} +1 -1
- package/dist/auth/access.d.ts +10 -0
- package/dist/auth/adapter-middleware.d.ts +2 -1
- package/dist/auth/adapter-service-key.d.ts +24 -0
- package/dist/auth/api-keys/api-key-middleware.d.ts +21 -1
- package/dist/auth/api-keys/api-key-store.d.ts +8 -1
- package/dist/auth/api-keys/key-grant.d.ts +18 -1
- package/dist/auth/expired-token-sweep.d.ts +5 -0
- package/dist/auth/impersonation.d.ts +3 -1
- package/dist/auth/jwt.d.ts +8 -2
- package/dist/auth/oauth-signin-policy.d.ts +21 -35
- package/dist/auth/rls-scope.d.ts +17 -7
- package/dist/auth/rls-simulator-routes.d.ts +51 -0
- package/dist/auth/simulation-read-only.d.ts +28 -0
- package/dist/auth/simulation.d.ts +141 -0
- package/dist/auth/sql-rate-limit-store.d.ts +15 -1
- package/dist/{auth-CteGWxsL.js → auth-izI7AEzC.js} +391 -1893
- package/dist/auth-izI7AEzC.js.map +1 -0
- package/dist/auth_adapter-B7RUMk6e.js +89 -0
- package/dist/auth_adapter-B7RUMk6e.js.map +1 -0
- package/dist/backend/boot-announcements.d.ts +13 -0
- package/dist/backend/create-backend.d.ts +10 -0
- package/dist/backend/options.d.ts +9 -4
- package/dist/{backend-DTAOsLQc.js → backend-CaG_Jyso.js} +9 -2
- package/dist/backend-CaG_Jyso.js.map +1 -0
- package/dist/{backup-Dq0lyJ_D.js → backup-BVbHoKo8.js} +8 -8
- package/dist/{backup-Dq0lyJ_D.js.map → backup-BVbHoKo8.js.map} +1 -1
- package/dist/boot/boot.d.ts +2 -15
- package/dist/boot/ddl-bootstrap.d.ts +34 -0
- package/dist/boot/env.d.ts +6 -0
- package/dist/boot/fetch-bundle.d.ts +5 -1
- package/dist/boot/provision-only.d.ts +23 -0
- package/dist/boot/provision.d.ts +53 -2
- package/dist/boot/role.d.ts +2 -0
- package/dist/boot/schema-change-recorder.d.ts +45 -0
- package/dist/boot/security-headers.d.ts +22 -0
- package/dist/branch-routes-B2vvEx53.js +84 -0
- package/dist/branch-routes-B2vvEx53.js.map +1 -0
- package/dist/{contract-routes-DiFwiLg2.js → contract-routes-CU2A3JnF.js} +3 -3
- package/dist/{contract-routes-DiFwiLg2.js.map → contract-routes-CU2A3JnF.js.map} +1 -1
- package/dist/cron/cron-store.d.ts +8 -1
- package/dist/{cron-loader-NHqRfKF0.js → cron-loader-mMhqbVsl.js} +3 -3
- package/dist/{cron-loader-NHqRfKF0.js.map → cron-loader-mMhqbVsl.js.map} +1 -1
- package/dist/{cron-routes-Dhf82HzT.js → cron-routes-Cs33j_Kr.js} +5 -5
- package/dist/{cron-routes-Dhf82HzT.js.map → cron-routes-Cs33j_Kr.js.map} +1 -1
- package/dist/{cron-scheduler-D1DT0nw5.js → cron-scheduler-Be7CNghL.js} +3 -3
- package/dist/{cron-scheduler-D1DT0nw5.js.map → cron-scheduler-Be7CNghL.js.map} +1 -1
- package/dist/{cron-store-DEpVstUU.js → cron-store-DLn11M8H.js} +11 -10
- package/dist/cron-store-DLn11M8H.js.map +1 -0
- package/dist/{strings.es-BeZWAodn.js → data_driver-D0mg1Y_x.js} +2 -90
- package/dist/data_driver-D0mg1Y_x.js.map +1 -0
- package/dist/{ddl-bootstrap-BNqi2NZe.js → ddl-bootstrap-CjRrn12l.js} +92 -3
- package/dist/ddl-bootstrap-CjRrn12l.js.map +1 -0
- package/dist/deploy/pod-contract.d.ts +1 -1
- package/dist/email/dev-sink.d.ts +6 -0
- package/dist/email/index.d.ts +1 -1
- package/dist/{errors-_ytoGi8A.js → errors-OMWkKSH-.js} +66 -5
- package/dist/errors-OMWkKSH-.js.map +1 -0
- package/dist/{soft-delete-params-BAgpmBvp.js → field-access-DYsvjI_P.js} +27 -57
- package/dist/field-access-DYsvjI_P.js.map +1 -0
- package/dist/{filter-dialect-O1HK6Nvr.js → filter-dialect-TrKFWLqT.js} +3 -3
- package/dist/{filter-dialect-O1HK6Nvr.js.map → filter-dialect-TrKFWLqT.js.map} +1 -1
- package/dist/{function-loader-DbCSoNJj.js → function-loader-B8YzXEsQ.js} +22 -15
- package/dist/function-loader-B8YzXEsQ.js.map +1 -0
- package/dist/{function-routes-DNV4RUF0.js → function-routes-RxrCHNuM.js} +2 -2
- package/dist/{function-routes-DNV4RUF0.js.map → function-routes-RxrCHNuM.js.map} +1 -1
- package/dist/functions/hono-like.d.ts +12 -0
- package/dist/functions/index.js +37 -2
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/request-timeout.d.ts +3 -3
- package/dist/history/history-routes.d.ts +6 -0
- package/dist/history/retention-sweep.d.ts +5 -0
- package/dist/{history-recorder-RZ1Ow4YY.js → history-recorder-Bsau7h4X.js} +7 -7
- package/dist/history-recorder-Bsau7h4X.js.map +1 -0
- package/dist/{history-store-DPofGVDp.js → history-store-BQz5YCkW.js} +26 -2
- package/dist/history-store-BQz5YCkW.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.es.js +3003 -681
- package/dist/index.es.js.map +1 -1
- package/dist/init/process-safety.d.ts +4 -3
- package/dist/init/shutdown.d.ts +8 -0
- package/dist/init.d.ts +6 -1
- package/dist/jobs/job-store.d.ts +8 -1
- package/dist/{jobs-8G-_agld.js → jobs-Co6Ni5HP.js} +7 -7
- package/dist/jobs-Co6Ni5HP.js.map +1 -0
- package/dist/{jwt-YhciR93H.js → jwt-rDS0884_.js} +5 -4
- package/dist/{jwt-YhciR93H.js.map → jwt-rDS0884_.js.map} +1 -1
- package/dist/{keys-COzQ2aE8.js → keys-BXcdRNhJ.js} +2 -2
- package/dist/{keys-COzQ2aE8.js.map → keys-BXcdRNhJ.js.map} +1 -1
- package/dist/{logger-Bt32sHFw.js → logger-CW8pmTS6.js} +35 -3
- package/dist/logger-CW8pmTS6.js.map +1 -0
- package/dist/{logs-routes-CelTiS7C.js → logs-routes-CBt7mMIL.js} +3 -3
- package/dist/{logs-routes-CelTiS7C.js.map → logs-routes-CBt7mMIL.js.map} +1 -1
- package/dist/mcp/consent-page.d.ts +38 -1
- package/dist/mcp/mcp-routes.d.ts +9 -0
- package/dist/mcp/mcp-tools.d.ts +7 -1
- package/dist/mcp/oauth-store.d.ts +12 -5
- package/dist/metrics/history-recorder.d.ts +4 -1
- package/dist/metrics/history-store.d.ts +8 -0
- package/dist/{offline-BrqCRgih-BtDB1ecy.js → offline-AvuEcg7u-DFHL98OT.js} +127 -40
- package/dist/offline-AvuEcg7u-DFHL98OT.js.map +1 -0
- package/dist/{offline-store-BhYXViha-BW5j1We_.js → offline-store-BhYXViha-YTmjBpo2.js} +5 -5
- package/dist/{offline-store-BhYXViha-BW5j1We_.js.map → offline-store-BhYXViha-YTmjBpo2.js.map} +1 -1
- package/dist/{openapi-generator-BamY6-ga.js → openapi-generator-CyxEtYEX.js} +61 -22
- package/dist/openapi-generator-CyxEtYEX.js.map +1 -0
- package/dist/{proxy-BEKbsil6.js → proxy-BYir8tWK.js} +5 -7
- package/dist/proxy-BYir8tWK.js.map +1 -0
- package/dist/{query-parser-CGohjyWI.js → query-parser-CDXWf2hH.js} +7 -6
- package/dist/{query-parser-CGohjyWI.js.map → query-parser-CDXWf2hH.js.map} +1 -1
- package/dist/{request-timeout-CRny5KD0.js → request-timeout-DVjo-c_8.js} +6 -6
- package/dist/request-timeout-DVjo-c_8.js.map +1 -0
- package/dist/rls-simulator-routes-bEY7-5-u.js +190 -0
- package/dist/rls-simulator-routes-bEY7-5-u.js.map +1 -0
- package/dist/schema-edit/deployed-schema-guard.d.ts +47 -0
- package/dist/{schema-editor-routes-CnNGCayU.js → schema-editor-routes-Dc3DU_jm.js} +4 -4
- package/dist/{schema-editor-routes-CnNGCayU.js.map → schema-editor-routes-Dc3DU_jm.js.map} +1 -1
- package/dist/soft-delete-params-BRONCOA2.js +59 -0
- package/dist/soft-delete-params-BRONCOA2.js.map +1 -0
- package/dist/{sql-export-routes-BgTJ7K3S.js → sql-export-routes-QycX8W8S.js} +40 -6
- package/dist/sql-export-routes-QycX8W8S.js.map +1 -0
- package/dist/{src-D5Y3N-S4.js → src-Bh9LRPb9.js} +21 -2
- package/dist/{src-D5Y3N-S4.js.map → src-Bh9LRPb9.js.map} +1 -1
- package/dist/storage/GCSStorageController.d.ts +2 -0
- package/dist/storage/LocalStorageController.d.ts +8 -3
- package/dist/storage/S3StorageController.d.ts +2 -0
- package/dist/storage/maintenance-keys.d.ts +17 -0
- package/dist/storage/maintenance-routes.d.ts +28 -5
- package/dist/storage/maintenance.d.ts +136 -4
- package/dist/storage/orphan-scans.d.ts +120 -0
- package/dist/storage/types.d.ts +11 -0
- package/dist/strings.es-B7QLnHh2.js +96 -0
- package/dist/strings.es-B7QLnHh2.js.map +1 -0
- package/dist/{upload-validation-I9cCUBIW.js → upload-validation-Bgo626uY.js} +2 -2
- package/dist/upload-validation-Bgo626uY.js.map +1 -0
- package/dist/utils/dev-dependency-command.d.ts +15 -0
- package/dist/utils/dev-port.d.ts +8 -0
- package/dist/utils/logger.d.ts +24 -0
- package/package.json +5 -5
- package/dist/GCSStorageController-C7ARrDAp.js.map +0 -1
- package/dist/S3StorageController-qevJ0pVE.js.map +0 -1
- package/dist/auth-CteGWxsL.js.map +0 -1
- package/dist/auth_adapter-CIItCTc8.js +0 -21
- package/dist/auth_adapter-CIItCTc8.js.map +0 -1
- package/dist/backend-DTAOsLQc.js.map +0 -1
- package/dist/cron-store-DEpVstUU.js.map +0 -1
- package/dist/ddl-bootstrap-BNqi2NZe.js.map +0 -1
- package/dist/errors-_ytoGi8A.js.map +0 -1
- package/dist/function-loader-DbCSoNJj.js.map +0 -1
- package/dist/history-recorder-RZ1Ow4YY.js.map +0 -1
- package/dist/history-store-DPofGVDp.js.map +0 -1
- package/dist/jobs-8G-_agld.js.map +0 -1
- package/dist/logger-Bt32sHFw.js.map +0 -1
- package/dist/offline-BrqCRgih-BtDB1ecy.js.map +0 -1
- package/dist/openapi-generator-BamY6-ga.js.map +0 -1
- package/dist/proxy-BEKbsil6.js.map +0 -1
- package/dist/request-timeout-CRny5KD0.js.map +0 -1
- package/dist/soft-delete-params-BAgpmBvp.js.map +0 -1
- package/dist/sql-export-routes-BgTJ7K3S.js.map +0 -1
- package/dist/strings.es-BeZWAodn.js.map +0 -1
- package/dist/upload-validation-I9cCUBIW.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"offline-AvuEcg7u-DFHL98OT.js","names":["RebaseApiError$1","RebaseClientError$1"],"sources":["../../client/dist/offline-AvuEcg7u.js"],"sourcesContent":["import { a as byIdRead, c as invalidBulkBody, d as RebaseApiError$1, f as buildQueryString, g as rebaseReviver, l as SDKQueryBuilder, n as MemoryOfflineStore, r as createMutationId, s as etagOf, t as IndexedDBOfflineStore, u as RebaseClientError$1 } from \"./offline-store-BhYXViha.js\";\nimport { EntityReference, EntityRelation, GeoPoint, Vector, hasFieldOperation, isUnsupported, parseRelationAggregateSort, toCanonicalOp } from \"@rebasepro/types\";\nimport { collectAllPages, normalizeOrderBy, paginateFind, resolveFindWindow, withETag } from \"@rebasepro/common\";\nimport { splitSearchTerms, unref } from \"@rebasepro/utils\";\n//#region src/offline-codec.ts\n/**\n* Lossless round-tripping of rows through the offline store.\n*\n* Both persistence backends move values by structured clone, which keeps\n* `Date` but flattens every class instance to a plain object. For\n* `EntityReference`/`EntityRelation` that is harmless — they carry their own\n* `__type` discriminator, so the JSON reviver can rebuild them — but\n* `GeoPoint` and `Vector` do not, and would come back out of the cache as\n* anonymous `{ latitude, longitude }` / `{ value }` bags. A row read from the\n* cache must be indistinguishable from the same row read from the network, so\n* those two are tagged on the way in and revived on the way out.\n*\n* Type tests here are structural rather than `instanceof`, because a structured\n* clone can arrive from another realm — an iframe, a worker, or the polyfill\n* the tests run against — where the constructor identity differs but the value\n* is the real thing. Only *plain* objects are walked; anything else is passed\n* through whole, so a class instance is never quietly reduced to `{}`.\n*/\nfunction isDate(value) {\n\treturn Object.prototype.toString.call(value) === \"[object Date]\";\n}\n/** An object literal — not a Date, RegExp, Map, or any class instance. */\nfunction isPlainObject$1(value) {\n\tif (value === null || typeof value !== \"object\" || Array.isArray(value)) return false;\n\tconst proto = Object.getPrototypeOf(value);\n\tif (proto === null || proto === Object.prototype) return true;\n\treturn proto.constructor?.name === \"Object\";\n}\n/**\n* `out[key] = value`, as an own property whatever the key. Assigned, a key\n* read from stored data that is literally `__proto__` (which `JSON.parse`\n* creates as an own property) set the new object's prototype instead, and the\n* column was gone from the row.\n*/\nfunction setOwn(out, key, value) {\n\tObject.defineProperty(out, key, {\n\t\tvalue,\n\t\tenumerable: true,\n\t\twritable: true,\n\t\tconfigurable: true\n\t});\n}\nfunction dehydrateValue(value) {\n\tif (value === null || value === void 0) return value;\n\tif (value instanceof GeoPoint) return {\n\t\t__type: \"GeoPoint\",\n\t\tlatitude: value.latitude,\n\t\tlongitude: value.longitude\n\t};\n\tif (value instanceof Vector) return {\n\t\t__type: \"Vector\",\n\t\tvalue: [...value.value]\n\t};\n\tif (value instanceof EntityReference || value instanceof EntityRelation) return value;\n\tif (Array.isArray(value)) return value.map(dehydrateValue);\n\tif (isPlainObject$1(value)) {\n\t\tconst out = {};\n\t\tfor (const [key, inner] of Object.entries(value)) setOwn(out, key, dehydrateValue(inner));\n\t\treturn out;\n\t}\n\treturn value;\n}\nfunction hydrateValue(value) {\n\tif (value === null || value === void 0 || isDate(value)) return value;\n\tif (Array.isArray(value)) return value.map(hydrateValue);\n\tif (typeof value === \"object\") {\n\t\tconst revived = rebaseReviver(\"\", value);\n\t\tif (revived !== value) return revived;\n\t\tif (!isPlainObject$1(value)) return value;\n\t\tconst out = {};\n\t\tfor (const [key, inner] of Object.entries(value)) setOwn(out, key, hydrateValue(inner));\n\t\treturn out;\n\t}\n\treturn value;\n}\n/** Prepare a row for the store. */\nfunction dehydrateRow(row) {\n\treturn dehydrateValue(row);\n}\n/** Restore a row read back from the store. */\nfunction hydrateRow(row) {\n\treturn hydrateValue(row);\n}\n/**\n* A queued write as the store keeps it, and back. Its payloads are rows, and\n* a row read back from the queue has to be the row that was queued: stored\n* raw, a pending `GeoPoint` came back after a reload as a bare\n* `{ latitude, longitude }`, was overlaid onto the server's rows, and was\n* written back to the cache that way.\n*/\nfunction mapMutation(op, map) {\n\tconst rows = (value) => value === void 0 ? value : map(value);\n\treturn {\n\t\t...op,\n\t\t...op.data !== void 0 ? { data: rows(op.data) } : {},\n\t\t...op.parts ? { parts: op.parts.map((part) => map(part)) } : {},\n\t\t...op.updates ? { updates: op.updates.map((u) => ({\n\t\t\tid: u.id,\n\t\t\tdata: map(u.data)\n\t\t})) } : {},\n\t\t...op.rollback ? { rollback: { rows: Object.fromEntries(Object.entries(op.rollback.rows).map(([id, row]) => [id, row === null ? null : map(row)])) } } : {},\n\t\t...op.sent?.data !== void 0 ? { sent: {\n\t\t\t...op.sent,\n\t\t\tdata: rows(op.sent.data)\n\t\t} } : {}\n\t};\n}\n/** Prepare a queued write for the store. */\nfunction dehydrateMutation(op) {\n\treturn mapMutation(op, dehydrateValue);\n}\n/** Restore a queued write read back from the store. */\nfunction hydrateMutation(op) {\n\treturn mapMutation(op, hydrateValue);\n}\n//#endregion\n//#region src/offline-connectivity.ts\n/**\n* Whether the network is worth trying, and when to try again after it wasn't.\n*\n* `navigator.onLine` is necessary but not sufficient: it reports the state of\n* the network interface, so it stays `true` behind a captive portal, on a\n* connection that resolves DNS but reaches nothing, and while the API itself\n* is down. This tracks what actually happened to requests as well, so the\n* first failure is the only one an app pays for — everything after it inside\n* the backoff window skips the doomed round trip and answers from the local\n* store immediately, which is the difference between an app that freezes when\n* the wifi drops and one that does not.\n*/\n/**\n* The request never reached the server, so nothing was decided by it.\n*\n* One question, one answer: `status === 0` is how a transport spells \"there\n* was no response at all\", and the transport now wraps every `fetch` rejection\n* into a `RebaseApiError` carrying it. This used to also sniff for the shapes\n* a raw `fetch` rejects with — a `TypeError` in a browser, an `AbortError`, a\n* `TimeoutError` — which is a list that has to be kept in step with three\n* runtimes and was wrong in both directions: it missed anything they add, and\n* it claimed a `TypeError` thrown by application code inside a callback was a\n* network failure, which quietly served a cached answer in its place.\n*/\nfunction isNetworkError(error) {\n\treturn error instanceof RebaseApiError$1 && error.status === 0;\n}\n/**\n* Statuses that mean \"not now\" rather than \"not ever\": a queued write that\n* gets one of these is worth replaying, while a 400 or a 403 never will be.\n* 500 is deliberately absent — an unhandled server error is far more often a\n* bug the same payload will hit again than a blip, and retrying it forever\n* jams every write behind it.\n*/\nvar RETRYABLE_STATUSES = /* @__PURE__ */ new Set([\n\t408,\n\t425,\n\t429,\n\t502,\n\t503,\n\t504\n]);\n/**\n* The server holds this key for a request it has not answered yet.\n*\n* It is a 409 like a duplicate row is a 409, and nothing but the code separates\n* them — one means \"your write is already there\", the other means \"your write\n* may not have happened at all, ask again\".\n*/\nvar IDEMPOTENCY_IN_PROGRESS = \"IDEMPOTENCY_KEY_IN_PROGRESS\";\n/**\n* Is the server still answering an earlier attempt of this same write?\n*\n* The only correct response is to ask again — which is exactly what the\n* server's own message says, and exactly what this SDK used not to do.\n*/\nfunction isIdempotencyInProgressError(error) {\n\treturn error instanceof RebaseApiError$1 && error.status === 409 && error.code === IDEMPOTENCY_IN_PROGRESS;\n}\n/**\n* Is this key held for a different request than the one just sent with it?\n*\n* For a create the queue already sent once, that is an answer rather than a\n* failure: the key is live only because the first attempt got through and\n* committed, and only its response went missing.\n*/\nfunction isIdempotencyKeyReusedError(error) {\n\treturn error instanceof RebaseApiError$1 && error.status === 422 && error.code === \"IDEMPOTENCY_KEY_REUSED\";\n}\n/** Is this failure worth another attempt later? */\nfunction isRetryableError(error) {\n\tif (isNetworkError(error)) return true;\n\tif (!(error instanceof RebaseApiError$1)) return false;\n\tif (isIdempotencyInProgressError(error)) return true;\n\treturn error.status !== void 0 && RETRYABLE_STATUSES.has(error.status);\n}\n/**\n* Did this write fail because the row is already there?\n*\n* Matched on the SQLSTATE the server passes through (`23505`, unique_violation)\n* and on 409, never on the message — a duplicate-key message names the\n* constraint and the values, so it is neither stable nor safe to parse.\n*\n* The queue uses this to recognise its own earlier attempt. A create whose\n* response was lost is replayed, and for a row carrying an id the SDK generated\n* the server can only be rejecting it because the first attempt actually landed.\n*\n* Which is why the status alone cannot decide it: `IDEMPOTENCY_KEY_IN_PROGRESS`\n* is a 409 that means the opposite — the row may not exist at all. Read as a\n* duplicate, the queue looked for a row that was never written, found nothing,\n* concluded there was nothing left to do and deleted the write from the queue.\n*/\nfunction isDuplicateKeyError(error) {\n\tif (!(error instanceof RebaseApiError$1)) return false;\n\tif (error.code === \"23505\") return true;\n\treturn error.status === 409 && !isIdempotencyInProgressError(error);\n}\n/**\n* The longest delay `setTimeout` holds. Past it the delay overflows a signed\n* 32-bit integer and the timer fires after 1 ms — so a `syncIntervalMs` of a\n* month retried continuously instead of almost never.\n*/\nvar MAX_TIMER_DELAY_MS = 2147483647;\nvar ConnectivityMonitor = class {\n\tstate = \"online\";\n\tbackoffMs;\n\tinitialBackoffMs;\n\tmaxBackoffMs;\n\tretryAt = 0;\n\ttimer;\n\tlisteners = /* @__PURE__ */ new Set();\n\trespectBackoff;\n\tnow;\n\tsetTimer;\n\tclearTimer;\n\t/** Called when the backoff window expires, to drive an automatic retry. */\n\tonRetryDue;\n\t/**\n\t* Called when the browser says the connection is back. Its own hook rather\n\t* than {@link onRetryDue}: a client with automatic retries off sets no retry\n\t* callback, and the `online` event has to wake it all the same.\n\t*/\n\tonOnline;\n\thandleOnline = () => {\n\t\tthis.retryAt = 0;\n\t\tthis.backoffMs = this.initialBackoffMs;\n\t\tthis.clearPendingTimer();\n\t\tthis.setState(\"online\");\n\t\t(this.onOnline ?? this.onRetryDue)?.();\n\t};\n\thandleOffline = () => {\n\t\tthis.setState(\"offline\");\n\t};\n\tconstructor(options = {}) {\n\t\tthis.initialBackoffMs = options.initialBackoffMs ?? 1e3;\n\t\tthis.maxBackoffMs = Math.max(this.initialBackoffMs, options.maxBackoffMs ?? 6e4);\n\t\tthis.backoffMs = this.initialBackoffMs;\n\t\tthis.respectBackoff = options.respectBackoff ?? true;\n\t\tthis.now = options.now ?? (() => Date.now());\n\t\tthis.setTimer = options.setTimer ?? ((fn, ms) => setTimeout(fn, ms));\n\t\tthis.clearTimer = options.clearTimer ?? ((handle) => clearTimeout(handle));\n\t\tif (typeof window !== \"undefined\" && typeof window.addEventListener === \"function\") {\n\t\t\twindow.addEventListener(\"online\", this.handleOnline);\n\t\t\twindow.addEventListener(\"offline\", this.handleOffline);\n\t\t}\n\t\tif (typeof navigator !== \"undefined\" && navigator.onLine === false) this.state = \"offline\";\n\t}\n\t/** What the app should be told: are we connected? */\n\tisOnline() {\n\t\tif (typeof navigator !== \"undefined\" && navigator.onLine === false) return false;\n\t\treturn this.state === \"online\";\n\t}\n\t/**\n\t* Should this request even be sent? False means \"answer from the local\n\t* store instead\" — the request would only burn a timeout to reach the same\n\t* conclusion the last one already did.\n\t*/\n\tshouldAttempt() {\n\t\tif (typeof navigator !== \"undefined\" && navigator.onLine === false) return false;\n\t\tif (this.state === \"online\" || !this.respectBackoff) return true;\n\t\treturn this.now() >= this.retryAt;\n\t}\n\t/** A request reached the server. */\n\tmarkSuccess() {\n\t\tthis.backoffMs = this.initialBackoffMs;\n\t\tthis.retryAt = 0;\n\t\tthis.clearPendingTimer();\n\t\tthis.setState(\"online\");\n\t}\n\t/** A request did not reach the server: we are offline until proven otherwise. */\n\tmarkFailure() {\n\t\tthis.deferRetry();\n\t\tthis.setState(\"offline\");\n\t}\n\t/**\n\t* Back off and try again later without claiming the connection is gone.\n\t* This is what a 429 or a 503 deserves — the server answered, so the app\n\t* is demonstrably online; it just should not hammer.\n\t*/\n\tdeferRetry() {\n\t\tconst jitter = .8 + Math.random() * .4;\n\t\tthis.retryAt = this.now() + this.backoffMs * jitter;\n\t\tconst delay = Math.max(0, this.retryAt - this.now());\n\t\tthis.backoffMs = Math.min(this.maxBackoffMs, this.backoffMs * 2);\n\t\tthis.scheduleRetry(delay);\n\t}\n\t/** Milliseconds until the next attempt is allowed; 0 when one is allowed now. */\n\tmsUntilRetry() {\n\t\tif (this.state === \"online\") return 0;\n\t\treturn Math.max(0, this.retryAt - this.now());\n\t}\n\tonChange(listener) {\n\t\tthis.listeners.add(listener);\n\t\treturn () => this.listeners.delete(listener);\n\t}\n\tdispose() {\n\t\tif (typeof window !== \"undefined\" && typeof window.removeEventListener === \"function\") {\n\t\t\twindow.removeEventListener(\"online\", this.handleOnline);\n\t\t\twindow.removeEventListener(\"offline\", this.handleOffline);\n\t\t}\n\t\tthis.clearPendingTimer();\n\t\tthis.listeners.clear();\n\t\tthis.onRetryDue = void 0;\n\t\tthis.onOnline = void 0;\n\t}\n\tscheduleRetry(delay) {\n\t\tthis.clearPendingTimer();\n\t\tif (!this.onRetryDue) return;\n\t\tthis.timer = this.setTimer(() => {\n\t\t\tthis.timer = void 0;\n\t\t\tthis.onRetryDue?.();\n\t\t}, Math.min(delay, MAX_TIMER_DELAY_MS));\n\t\tunref(this.timer);\n\t}\n\tclearPendingTimer() {\n\t\tif (this.timer !== void 0) {\n\t\t\tthis.clearTimer(this.timer);\n\t\t\tthis.timer = void 0;\n\t\t}\n\t}\n\tsetState(next) {\n\t\tif (this.state === next) return;\n\t\tthis.state = next;\n\t\tconst online = this.isOnline();\n\t\tfor (const listener of this.listeners) listener(online);\n\t}\n};\n//#endregion\n//#region src/offline-query.ts\n/**\n* A local evaluator for `FindParams`, so cached rows can answer a query the\n* client has never sent to the server — and so a row written offline shows up\n* in every filtered list it belongs to, not just in unfiltered ones.\n*\n* This mirrors the Postgres driver's semantics rather than JavaScript's:\n*\n* - Comparing against NULL is *unknown*, not false-or-true. `status != \"done\"`\n* excludes rows where `status` is null, exactly as SQL does — a JS `!==`\n* would have included them.\n* - `ORDER BY` puts nulls last ascending and first descending, which is the\n* Postgres default.\n* - A filter value may arrive as a string (off a URL, say), so a string is\n* compared numerically against a number and as an instant against a date.\n* `[\"==\", \"3\"]` matches the number `3`, as it does server-side. Two strings\n* compare as text: `\"01234\"` is not `\"1234\"`.\n*\n* Two things it deliberately approximates, both flagged by\n* {@link isExactlyEvaluable}: `searchString` becomes a case-insensitive\n* substring scan over the row's string fields (the server runs real full-text\n* search over the collection's configured columns), and `include` cannot be\n* evaluated at all, because the related rows live in collections this query\n* knows nothing about.\n*/\nvar collator = typeof Intl !== \"undefined\" && typeof Intl.Collator === \"function\" ? new Intl.Collator(void 0, {\n\tnumeric: false,\n\tsensitivity: \"variant\"\n}) : void 0;\nfunction isNullish(value) {\n\treturn value === null || value === void 0;\n}\n/**\n* Reduce a value to something comparable. Relations compare by the id they\n* point at — the column holds a foreign key, so that is what the server\n* compares too.\n*/\nfunction toComparable(value) {\n\tif (value instanceof Date) return value.getTime();\n\tif (value instanceof EntityRelation) return value.id;\n\tif (value && typeof value === \"object\") {\n\t\tconst record = value;\n\t\tif (typeof record.__type === \"string\" && \"id\" in record) return record.id;\n\t}\n\treturn value;\n}\n/**\n* Three-way compare with SQL's type coercion but not its collation. Returns\n* `undefined` when the two values are not ordered relative to each other,\n* which is how NULL propagates through a comparison.\n*/\nfunction compareValues(a, b) {\n\tconst left = toComparable(a);\n\tconst right = toComparable(b);\n\tif (isNullish(left) || isNullish(right)) return void 0;\n\tif (typeof left === \"boolean\" || typeof right === \"boolean\") return (left === true || left === \"true\" || left === 1 ? 1 : 0) - (right === true || right === \"true\" || right === 1 ? 1 : 0);\n\tif (isNumeric(left) || isNumeric(right)) {\n\t\tconst leftNum = numericOrNaN(left);\n\t\tconst rightNum = numericOrNaN(right);\n\t\tif (!Number.isNaN(leftNum) && !Number.isNaN(rightNum)) return leftNum < rightNum ? -1 : leftNum > rightNum ? 1 : 0;\n\t}\n\tif (typeof left === \"number\" || typeof right === \"number\") {\n\t\tconst leftTime = toTime(left);\n\t\tconst rightTime = toTime(right);\n\t\tif (leftTime !== void 0 && rightTime !== void 0) return leftTime < rightTime ? -1 : leftTime > rightTime ? 1 : 0;\n\t}\n\tconst leftStr = String(left);\n\tconst rightStr = String(right);\n\tif (collator) return collator.compare(leftStr, rightStr);\n\treturn leftStr < rightStr ? -1 : leftStr > rightStr ? 1 : 0;\n}\nfunction isNumeric(value) {\n\treturn typeof value === \"number\" || typeof value === \"bigint\";\n}\nfunction numericOrNaN(value) {\n\tif (typeof value === \"number\") return value;\n\tif (typeof value === \"string\" && value.trim() !== \"\") {\n\t\tconst n = Number(value);\n\t\treturn Number.isNaN(n) ? NaN : n;\n\t}\n\tif (typeof value === \"bigint\") return Number(value);\n\treturn NaN;\n}\nfunction toTime(value) {\n\tif (typeof value === \"number\") return value;\n\tif (typeof value === \"string\") {\n\t\tconst t = Date.parse(value);\n\t\treturn Number.isNaN(t) ? void 0 : t;\n\t}\n}\n/**\n* Equality with a string filter value allowed to name a number, a boolean or\n* an instant, but never across NULL. Two strings are equal only when they are\n* the same string, as text is in Postgres.\n*/\nfunction looseEquals(a, b) {\n\tconst left = toComparable(a);\n\tconst right = toComparable(b);\n\tif (isNullish(left) || isNullish(right)) return isNullish(left) && isNullish(right);\n\tif (left === right) return true;\n\tif (typeof left === \"string\" && typeof right === \"string\") return false;\n\treturn compareValues(left, right) === 0;\n}\n/**\n* Translate a SQL `LIKE` pattern to an anchored regular expression.\n* `%` matches any run of characters, `_` exactly one, and a backslash escapes\n* either of them.\n*/\nfunction likeToRegExp(pattern, caseInsensitive) {\n\tlet source = \"^\";\n\tlet lastWasWildcard = false;\n\tfor (let i = 0; i < pattern.length; i++) {\n\t\tconst char = pattern[i];\n\t\tif (char === \"\\\\\" && i + 1 < pattern.length) {\n\t\t\tsource += pattern[i + 1].replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n\t\t\ti++;\n\t\t\tlastWasWildcard = false;\n\t\t} else if (char === \"%\") {\n\t\t\tif (!lastWasWildcard) source += \"[\\\\s\\\\S]*\";\n\t\t\tlastWasWildcard = true;\n\t\t} else if (char === \"_\") {\n\t\t\tsource += \"[\\\\s\\\\S]\";\n\t\t\tlastWasWildcard = false;\n\t\t} else {\n\t\t\tsource += char.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n\t\t\tlastWasWildcard = false;\n\t\t}\n\t}\n\treturn new RegExp(source + \"$\", caseInsensitive ? \"i\" : \"\");\n}\nfunction asArray(value) {\n\tif (Array.isArray(value)) return value;\n\tif (value === void 0) return [];\n\treturn [value];\n}\n/** Evaluate one canonical operator against one row value. */\nfunction matchesOperator(rowValue, op, filterValue) {\n\tswitch (op) {\n\t\tcase \"is-null\": return isNullish(rowValue);\n\t\tcase \"is-not-null\": return !isNullish(rowValue);\n\t\tcase \"==\": return looseEquals(rowValue, filterValue);\n\t\tcase \"!=\":\n\t\t\tif (isNullish(rowValue)) return false;\n\t\t\treturn !looseEquals(rowValue, filterValue);\n\t\tcase \"<\":\n\t\tcase \"<=\":\n\t\tcase \">\":\n\t\tcase \">=\": {\n\t\t\tconst cmp = compareValues(rowValue, filterValue);\n\t\t\tif (cmp === void 0) return false;\n\t\t\tif (op === \"<\") return cmp < 0;\n\t\t\tif (op === \"<=\") return cmp <= 0;\n\t\t\tif (op === \">\") return cmp > 0;\n\t\t\treturn cmp >= 0;\n\t\t}\n\t\tcase \"in\":\n\t\t\tif (isNullish(rowValue)) return false;\n\t\t\treturn asArray(filterValue).some((v) => looseEquals(rowValue, v));\n\t\tcase \"not-in\":\n\t\t\tif (isNullish(rowValue)) return false;\n\t\t\treturn !asArray(filterValue).some((v) => looseEquals(rowValue, v));\n\t\tcase \"array-contains\":\n\t\t\tif (!Array.isArray(rowValue)) return false;\n\t\t\treturn rowValue.some((v) => looseEquals(v, filterValue));\n\t\tcase \"array-contains-any\": {\n\t\t\tif (!Array.isArray(rowValue)) return false;\n\t\t\tconst wanted = asArray(filterValue);\n\t\t\treturn rowValue.some((v) => wanted.some((w) => looseEquals(v, w)));\n\t\t}\n\t\tcase \"like\":\n\t\tcase \"not-like\":\n\t\tcase \"ilike\":\n\t\tcase \"not-ilike\": {\n\t\t\tif (isNullish(rowValue)) return false;\n\t\t\tconst insensitive = op === \"ilike\" || op === \"not-ilike\";\n\t\t\tconst negated = op === \"not-like\" || op === \"not-ilike\";\n\t\t\tconst matched = likeToRegExp(String(filterValue), insensitive).test(String(rowValue));\n\t\t\treturn negated ? !matched : matched;\n\t\t}\n\t\tdefault: return true;\n\t}\n}\nfunction isTuple(value) {\n\treturn Array.isArray(value) && value.length === 2 && typeof value[0] === \"string\" && toCanonicalOp(value[0]) !== void 0;\n}\n/**\n* One field's condition, as the tuples this evaluator can read.\n*\n* The single reading of a condition, for {@link matchesWhere} and\n* {@link isExactlyEvaluable} both. Each used to have its own, and only the\n* first was hardened: `{ status: undefined }` (a skipped filter) and the bare\n* wire string `\"eq.active\"` both reached `.filter` on a non-array in the\n* second and threw.\n*\n* `unreadable` is set when the condition is there but yields nothing this\n* build understands — a wire string, an operator from a newer server. Such a\n* condition filters nothing locally while the server does filter on it, so an\n* answer that ignored it would be wider than the server's.\n*/\nfunction conditionTuples(condition) {\n\tif (condition === void 0) return {\n\t\ttuples: [],\n\t\tunreadable: false\n\t};\n\tif (isTuple(condition)) return {\n\t\ttuples: [condition],\n\t\tunreadable: false\n\t};\n\tif (!Array.isArray(condition)) return {\n\t\ttuples: [],\n\t\tunreadable: true\n\t};\n\tconst tuples = condition.filter(isTuple);\n\treturn {\n\t\ttuples,\n\t\tunreadable: tuples.length !== condition.length || tuples.length === 0\n\t};\n}\n/** Evaluate a `where` clause: every field, and every tuple on a field, AND-ed. */\nfunction matchesWhere(row, where) {\n\tif (!where) return true;\n\tfor (const [field, condition] of Object.entries(where)) {\n\t\tconst { tuples } = conditionTuples(condition);\n\t\tfor (const [rawOp, value] of tuples) {\n\t\t\tconst op = toCanonicalOp(rawOp) ?? rawOp;\n\t\t\tif (!matchesOperator(row[field], op, value)) return false;\n\t\t}\n\t}\n\treturn true;\n}\n/** Evaluate a nested and/or tree. */\nfunction matchesLogical(row, condition) {\n\tif (!condition) return true;\n\tif (\"type\" in condition) {\n\t\tconst children = condition.conditions ?? [];\n\t\tif (children.length === 0) return true;\n\t\treturn condition.type === \"or\" ? children.some((c) => matchesLogical(row, c)) : children.every((c) => matchesLogical(row, c));\n\t}\n\tconst op = toCanonicalOp(condition.operator) ?? condition.operator;\n\treturn matchesOperator(row[condition.column], op, condition.value);\n}\n/**\n* Approximate the server's full-text search with a case-insensitive substring\n* scan over the row's own string fields. Narrower than the real thing (no\n* stemming, no configured search columns), and it never matches a field the\n* cached row does not carry — a local list may therefore be missing rows the\n* server would have returned, which is why {@link isExactlyEvaluable} refuses\n* to call a search query exact.\n*\n* Every term has to match, but they may match different fields — the same rule\n* both drivers apply, and the one that finds `sebastian melendez` on a row that\n* keeps the two halves of a name in separate fields. Matching the typed string\n* as a whole found neither that row nor, because the space was part of the\n* needle, anything at all for `sebastian `.\n*/\nfunction matchesSearch(row, searchString) {\n\tif (!searchString) return true;\n\tconst terms = splitSearchTerms(searchString).map((term) => term.toLowerCase());\n\tif (terms.length === 0) return true;\n\tconst values = Object.values(row);\n\treturn terms.every((term) => values.some((value) => {\n\t\tif (typeof value === \"string\") return value.toLowerCase().includes(term);\n\t\tif (typeof value === \"number\") return String(value).includes(term);\n\t\treturn false;\n\t}));\n}\n/** Does this row belong in the result set for `params`, ignoring pagination? */\nfunction matchesParams(row, params) {\n\tif (!params) return true;\n\treturn matchesWhere(row, params.where) && matchesLogical(row, params.logical) && matchesSearch(row, params.searchString);\n}\n/**\n* Sort in place, Postgres-style: nulls last ascending, first descending, with\n* the row id as a tiebreak so paging through an unsorted-but-equal run does\n* not shuffle rows between pages.\n*\n* The tiebreak runs *descending*, which is not a taste: every server-side sort\n* ends on `id DESC` — `FetchService.buildOrderExpressions` appends it to make\n* the ordering total, and the keyset cursor is built to match. This ran\n* ascending, so two rows sharing a sort value came back from the local overlay\n* in the opposite order to the server's, and {@link isLocallySortable} called\n* that page exactly reproducible while it was not.\n*/\nfunction sortRows(rows, orderBy) {\n\tconst keys = normalizeOrderBy(orderBy);\n\tif (!keys) return rows;\n\treturn rows.sort((a, b) => {\n\t\tfor (const [field, direction = \"asc\"] of keys) {\n\t\t\tconst cmp = compareOnKey(a, b, field, direction);\n\t\t\tif (cmp !== 0) return cmp;\n\t\t}\n\t\treturn tiebreak(a, b);\n\t});\n}\n/** One key's verdict: negative, positive, or 0 for \"these two are equal here\". */\nfunction compareOnKey(a, b, field, direction) {\n\tconst av = a[field];\n\tconst bv = b[field];\n\tconst aNull = isNullish(toComparable(av));\n\tconst bNull = isNullish(toComparable(bv));\n\tif (aNull || bNull) {\n\t\tif (aNull && bNull) return 0;\n\t\treturn (aNull ? 1 : -1) * (direction === \"desc\" ? -1 : 1);\n\t}\n\tconst cmp = compareValues(av, bv);\n\tif (cmp === void 0 || cmp === 0) return 0;\n\treturn cmp * (direction === \"desc\" ? -1 : 1);\n}\n/** The last word, and the server's: `id DESC`. */\nfunction tiebreak(a, b) {\n\tconst cmp = compareValues(a.id, b.id);\n\treturn cmp === void 0 ? 0 : -cmp;\n}\n/**\n* Resolve `page`/`offset`/`limit` the way the server does.\n*\n* It did not: this defaulted an absent limit to 20 while `/api/data` pages by\n* 50, so the same `observe()` answered with 20 rows from the local database and\n* 50 from the network — a list that changed length depending on which side\n* answered, with `page` striding differently on each. Delegated now, so the\n* sentence above is true by construction rather than by agreement.\n*/\nfunction resolvePagination(params) {\n\tconst { limit, offset } = resolveFindWindow(params);\n\treturn {\n\t\tlimit,\n\t\toffset\n\t};\n}\n/** `<`, `<=`, `>`, `>=` — the operators whose answer depends on a collation. */\nvar ORDERING_OPS = /* @__PURE__ */ new Set([\n\t\"<\",\n\t\"<=\",\n\t\">\",\n\t\">=\"\n]);\n/**\n* Does any condition in this `where` clause order its operands — or say\n* something this evaluator cannot read at all? Either way the local answer is\n* not the server's.\n*/\nfunction whereNotExact(where) {\n\tif (!where) return false;\n\tfor (const condition of Object.values(where)) {\n\t\tconst { tuples, unreadable } = conditionTuples(condition);\n\t\tif (unreadable) return true;\n\t\tif (tuples.some(([op]) => ORDERING_OPS.has(toCanonicalOp(op) ?? op))) return true;\n\t}\n\treturn false;\n}\n/** The same question, through an `and(...)`/`or(...)` tree. */\nfunction logicalOrders(condition, depth = 0) {\n\tif (!condition || depth > 32) return false;\n\tif (\"type\" in condition) return (condition.conditions ?? []).some((c) => logicalOrders(c, depth + 1));\n\treturn ORDERING_OPS.has(condition.operator);\n}\n/**\n* Can a locally evaluated answer to `params` be trusted to match the server's,\n* assuming the cache holds every row of the collection?\n*\n* `include` pulls in rows from other collections that this evaluator never\n* sees, and `searchString` is only approximated — both make the local answer a\n* best effort rather than an equivalent one.\n*\n* **Ordering comparisons are refused, and that is the interesting one.**\n* `compareValues` falls back to an `Intl.Collator` for operands it cannot read\n* as numbers or instants. PostgreSQL orders text by the *database's* collation,\n* which is a property of the server this process has never been told: under the\n* C collation `'apple' < 'Banana'` is false, under `en_US.UTF-8` it is true,\n* and the collator says true. So `[\"<\", \"Banana\"]` selects a different set here\n* than it does there — silently, and in whichever direction the deployment\n* happens to have been created.\n*\n* The refusal covers *every* ordering comparison rather than only the ones with\n* a string operand, because the operand type does not settle it: a numeric\n* bound against a text column (`[\"<\", 10]` on a `varchar`) also reaches the\n* collator, and nothing in `params` says what the column holds. Conservative on\n* purpose — the cost is that a query combining an ordering filter with\n* *unsynced local writes* stops placing those writes optimistically, which is a\n* degraded answer rather than a wrong one. Claiming exactness we do not have is\n* the other way round.\n*\n* This says nothing about ordering *results*; that is a separate claim with a\n* separate answer, because a sort changes which rows come first and not which\n* rows match. See {@link isLocallySortable}.\n*/\n/**\n* Whether an `include` asks for anything, in any of its spellings.\n*\n* `include` is a list of names, a list of dotted paths, or a tree — and only\n* the first two have a `length`. A `.length > 0` test read the tree form as\n* \"no relations\", which is the answer that makes the local cache claim it can\n* evaluate a relational query exactly.\n*/\nfunction hasAnyInclude(include) {\n\tif (!include) return false;\n\tif (Array.isArray(include)) return include.length > 0;\n\treturn Object.keys(include).length > 0;\n}\nfunction isExactlyEvaluable(params) {\n\tif (!params) return true;\n\tif (hasAnyInclude(params.include)) return false;\n\tif (params.searchString) return false;\n\tif (params.vectorSearch) return false;\n\tif (whereNotExact(params.where)) return false;\n\tif (logicalOrders(params.logical)) return false;\n\tif (whereReachesThroughRelation(params.where)) return false;\n\tif (logicalReachesThroughRelation(params.logical)) return false;\n\treturn true;\n}\n/** Does any filter key reach outside this row — `applications.status`? */\nfunction whereReachesThroughRelation(where) {\n\treturn where ? Object.keys(where).some((field) => field.includes(\".\")) : false;\n}\n/** The same question, through an `and(...)`/`or(...)` tree. */\nfunction logicalReachesThroughRelation(condition, depth = 0) {\n\tif (!condition || depth > 32) return false;\n\tif (\"type\" in condition) return (condition.conditions ?? []).some((c) => logicalReachesThroughRelation(c, depth + 1));\n\treturn typeof condition.column === \"string\" && condition.column.includes(\".\");\n}\n/**\n* Would sorting `rows` locally reproduce the order the server would have sent?\n*\n* Asked of the rows rather than of the query, because unlike a filter this one\n* *is* decidable from the data in hand: {@link compareValues} reaches the\n* collator only when neither operand is a number, and `toComparable` has\n* already turned dates and relations into numbers and ids by then. If every\n* value on the sort column normalises to a number, the collator is unreachable\n* and the local order is the server's order.\n*\n* A text column is therefore refused — see {@link isExactlyEvaluable} for why\n* the two cannot be made to agree — including one holding only digits, which\n* Postgres orders as text (\"10\", \"100\", \"9\").\n*\n* Nulls are fine either way: they are ordered by an explicit rule (last\n* ascending, first descending) that matches Postgres and never reaches the\n* comparator.\n*/\nfunction isLocallySortable(rows, orderBy) {\n\tconst keys = normalizeOrderBy(orderBy);\n\tif (!keys) return true;\n\tif (keys.some(([field]) => parseRelationAggregateSort(field))) return false;\n\treturn keys.every(([field]) => rows.every((row) => {\n\t\tconst value = toComparable(row[field]);\n\t\tif (isNullish(value)) return true;\n\t\tif (typeof value === \"number\" || typeof value === \"boolean\") return true;\n\t\tif (typeof value === \"bigint\") return true;\n\t\treturn false;\n\t}));\n}\n/** Run a full query — filter, sort, paginate — over a set of rows. */\nfunction runLocalQuery(rows, params) {\n\tconst matched = rows.filter((row) => matchesParams(row, params));\n\tsortRows(matched, params?.orderBy);\n\tconst { limit, offset } = resolvePagination(params);\n\tconst page = matched.slice(offset, offset + limit);\n\treturn {\n\t\tdata: page,\n\t\tmeta: {\n\t\t\ttotal: matched.length,\n\t\t\tlimit,\n\t\t\toffset,\n\t\t\thasMore: offset + page.length < matched.length\n\t\t}\n\t};\n}\n//#endregion\n//#region src/offline.ts\nfunction offlineError(message) {\n\treturn new RebaseApiError$1(message, {\n\t\tstatus: 0,\n\t\tcode: \"OFFLINE\"\n\t});\n}\n/**\n* What a write discarded because an earlier write it depends on was refused is\n* reported with. It was never sent; the refusal that doomed it is its `cause`.\n*/\nfunction dependencyRejected(refused, error) {\n\treturn new RebaseApiError$1(`Not sent: an earlier queued write to the same row was refused (${error.message}).`, {\n\t\tstatus: error instanceof RebaseApiError$1 ? error.status : void 0,\n\t\tcode: \"DEPENDENCY_REJECTED\",\n\t\tdetails: { rejectedMutationId: refused.mutationId },\n\t\tcause: error\n\t});\n}\n/**\n* A refusal about what a write contains — a field the collection no longer\n* has, one the caller may not write, a value a constraint refuses — rather\n* than about the row or the caller as a whole.\n*/\nfunction isFieldRefusal(error) {\n\tif (!(error instanceof RebaseApiError$1)) return false;\n\treturn error.status === 400 || error.status === 403 || error.status === 422;\n}\n/**\n* `value` with every occurrence of `from` replaced by `to`, walking plain\n* objects and arrays — and whether anything was replaced.\n*\n* Only ever called with an id the SDK minted for an offline create (a UUID, or\n* a negative number from the clock), which nothing but a reference to that row\n* can equal. That is what makes replacing by value sound without knowing which\n* columns are references.\n*/\nfunction replaceMintedId(value, from, to) {\n\tif (value === from) return {\n\t\tvalue: to,\n\t\tchanged: true\n\t};\n\tif (Array.isArray(value)) {\n\t\tlet changed = false;\n\t\tconst out = value.map((item) => {\n\t\t\tconst replaced = replaceMintedId(item, from, to);\n\t\t\tchanged ||= replaced.changed;\n\t\t\treturn replaced.value;\n\t\t});\n\t\treturn changed ? {\n\t\t\tvalue: out,\n\t\t\tchanged\n\t\t} : {\n\t\t\tvalue,\n\t\t\tchanged\n\t\t};\n\t}\n\tif (isPlainObject(value)) {\n\t\tlet changed = false;\n\t\tconst out = {};\n\t\tfor (const [key, item] of Object.entries(value)) {\n\t\t\tconst replaced = replaceMintedId(item, from, to);\n\t\t\tchanged ||= replaced.changed;\n\t\t\tsetOwn(out, key, replaced.value);\n\t\t}\n\t\treturn changed ? {\n\t\t\tvalue: out,\n\t\t\tchanged\n\t\t} : {\n\t\t\tvalue,\n\t\t\tchanged\n\t\t};\n\t}\n\treturn {\n\t\tvalue,\n\t\tchanged: false\n\t};\n}\n/**\n* A plain object from any realm — a queued payload read back from the store is\n* a structured clone, whose `Object.prototype` need not be this one. A class\n* instance (a `GeoPoint`, a `Date`) is not walked.\n*/\nfunction isPlainObject(value) {\n\tif (value === null || typeof value !== \"object\") return false;\n\tconst proto = Object.getPrototypeOf(value);\n\treturn proto === null || Object.getPrototypeOf(proto) === null;\n}\n/**\n* The key a folded run is sent under: its first and last member and its\n* length, which fixes its composition.\n*/\nfunction runKey(run) {\n\treturn `${run[0].mutationId}..${run[run.length - 1].mutationId}:${run.length}`;\n}\n/** Whether a queued write's payload mentions `id` anywhere — see {@link replaceMintedId}. */\nfunction mentionsMintedId(op, id) {\n\treturn [op.data, ...(op.updates ?? []).map((u) => u.data)].some((payload) => replaceMintedId(payload, id, \"\").changed);\n}\n/**\n* A page that local rows were added to, cut back to the `limit` it was asked\n* with — as a refetch would return it.\n*\n* Sorted, the page is cut where the order puts it. Unsorted, the rows created\n* here (the last `added`) stand where they were placed, and the server's rows\n* make room from the end of the page.\n*/\nfunction fitToLimit(rows, limit, added, sorted) {\n\tif (!(limit > 0) || rows.length <= limit) return rows;\n\tif (sorted || added === 0) return rows.slice(0, limit);\n\tconst local = rows.slice(rows.length - added);\n\treturn [...rows.slice(0, rows.length - added).slice(0, Math.max(0, limit - local.length)), ...local].slice(0, limit);\n}\n/**\n* Call the app back without letting it break the engine.\n*\n* A status badge that throws while rendering used to abort a replay half way\n* (and skip every listener registered after it); the replay's own failure\n* handling then had an error that was never about the replay. The app's error\n* is still reported, on the console, where an uncaught one would have gone.\n*/\nfunction callSafely(callback) {\n\ttry {\n\t\tcallback();\n\t} catch (error) {\n\t\tconsole.error(\"[rebase offline] A listener threw:\", error);\n\t}\n}\n/** The server has no such row — deleted by someone else, or never visible to this user. */\n/** A `412`: the row is no longer the version an `If-Match` named. */\nfunction isPreconditionFailed(error) {\n\treturn error instanceof RebaseApiError$1 && error.status === 412;\n}\nfunction isNotFoundError(error) {\n\treturn error instanceof RebaseApiError$1 && error.status === 404;\n}\nfunction generateOfflineStringId() {\n\tif (typeof crypto !== \"undefined\" && typeof crypto.randomUUID === \"function\") return crypto.randomUUID();\n\treturn `off-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;\n}\n/**\n* The last temporary numeric id minted, so the next one is smaller.\n*\n* Module-scoped and strictly decreasing: two temporary ids in the same session\n* must not collide, and neither must one minted a millisecond after another.\n*/\nvar lastOfflineNumericId = 0;\n/**\n* A temporary id for a collection whose ids are numbers.\n*\n* **Negative**, which is the convention every local-first engine settles on for\n* the same reason: a real key is a positive integer or an identity sequence, so\n* the sign alone says \"this one is not the server's yet\" — and it stays a\n* number, which is what matters. A UUID string was minted for every collection,\n* so a `create` while offline handed back `{ id: \"526e2faf-…\" }` on a row the\n* generated types declare `id: number`. Anything that put that in a URL, a\n* foreign key or an `id.toFixed()` was wrong or threw until the replay\n* reconciled it — and the SDK's own types said it could not happen.\n*/\nfunction generateOfflineNumericId() {\n\tconst candidate = -Date.now();\n\tlastOfflineNumericId = lastOfflineNumericId === 0 ? candidate : Math.min(candidate, lastOfflineNumericId - 1);\n\treturn lastOfflineNumericId;\n}\n/**\n* The row an optimistic write puts in the cache before the server has seen it.\n*\n* It is NOT an `M`, and saying so is the point of collecting this in one place.\n* `M` is the row as the database has it — every server default, every generated\n* column, every `afterRead` transform. What an optimistic write has is the\n* fields the caller supplied (plus, on an update, whatever was already cached)\n* and an id, which may itself be a locally-minted placeholder.\n*\n* The two are reconciled when the queued write drains and the server's row\n* replaces this one. Until then the SDK hands the caller this, under `M`,\n* because that is what the offline API's return type promises — and there is\n* nothing in this file that can make that promise true.\n*\n* So: one deliberate assertion, named, rather than five spread across the\n* create / createMany / update / upsert paths, each free to assemble the fields\n* differently. Fixing it properly means the offline surface saying what it\n* actually returns, which is a change to its public types.\n*/\nfunction optimisticRow(fields, id) {\n\treturn {\n\t\t...fields,\n\t\tid\n\t};\n}\n/**\n* Whether a query answers with something narrower than whole rows: `fields`\n* returns only the columns it names (and the key), and `distinct` collapses\n* rows into their distinct projections. Either way what comes back is not a\n* row of the collection, and must not be stored as one.\n*/\nfunction isProjection(params) {\n\treturn (params?.fields?.length ?? 0) > 0 || params?.distinct === true;\n}\n/** `row` narrowed to `keys`: a local row in the shape a projection has. */\nfunction pick(row, keys) {\n\tconst out = {};\n\tfor (const key of keys) if (Object.hasOwn(row, key)) setOwn(out, key, row[key]);\n\treturn out;\n}\n/** A snapshot as read back from the store, its projected rows revived. */\nfunction readSnapshot(value) {\n\tconst snapshot = value;\n\treturn snapshot.rows ? {\n\t\t...snapshot,\n\t\trows: snapshot.rows.map((row) => hydrateRow(row))\n\t} : snapshot;\n}\nvar MISSING = \"\\0missing\";\n/**\n* Replays to spend on a mutation whose idempotency key the server is still\n* holding, when the app has not asked for more.\n*\n* Retries double from a second and cap at the sync interval, so the default\n* budget of five covers about half a minute — less than the lease a server\n* gives a claim nobody came back for. This many outlast it with room for a slow\n* batch, and the count is what stops a server that never releases the key from\n* blocking the queue behind it indefinitely.\n*/\nvar IN_PROGRESS_MIN_RETRIES = 12;\n/** The scope of whatever is cached and queued while nobody is signed in. */\nvar SIGNED_OUT_SCOPE = \"anon\";\n/** The most rows one folded replay sends: the server's default bulk limit. */\nvar MAX_REPLAY_BATCH = 1e3;\n/**\n* Where {@link OfflineConfig.keepLastUser} keeps the last signed-in user's id.\n* In the cache area but under no user's scope, so clearing one user's data\n* leaves it alone.\n*/\nvar LAST_USER_KEY = \"rebase-offline:last-user\";\nvar OfflineManager = class {\n\tstore;\n\tmaxCachedQueries;\n\tmaxCachedRows;\n\tmaxRetries;\n\tonSyncError;\n\tonConflict;\n\tcreateInner;\n\tinners = /* @__PURE__ */ new Map();\n\tconnectivity;\n\tkeepLastUser;\n\treplayBatchSize;\n\tscope = SIGNED_OUT_SCOPE;\n\t/**\n\t* The scope is the last signed-in user's, taken without a confirmed\n\t* session ({@link resumeLastUser}). Nothing replays while it is set: the\n\t* queue is sent under the credentials of whoever is signed in, and nobody\n\t* is yet.\n\t*/\n\tunverified = false;\n\t/**\n\t* Set while the manager does not know whose data it holds: from\n\t* {@link holdScope} until the next {@link setScope}. `scope` is not\n\t* consulted meanwhile — no operation gets a {@link ScopeTicket}, and\n\t* nothing reads or writes the store.\n\t*/\n\tscopeHold;\n\t/**\n\t* Bumped by every change of user, and by `clear()`.\n\t*\n\t* The load paths always re-checked the scope after their awaits; the write\n\t* paths did not. A `find` sent for user A that answered after B had signed\n\t* in wrote A's RLS-filtered rows into B's local database, under B's keys,\n\t* and showed them to B's observers; a replay acknowledged after the switch\n\t* dequeued a key under B's scope that did not exist, so A's write stayed\n\t* queued and was sent again when A came back. Every write now carries the\n\t* {@link ScopeTicket} its operation started under, and one that is stale\n\t* touches nothing that belongs to the new user.\n\t*/\n\tscopeEpoch = 0;\n\t/** The local database: normalized rows and query snapshots per collection. */\n\tcollections = /* @__PURE__ */ new Map();\n\t/** In-memory mirror of the current scope's queue, in replay order. */\n\tqueueEntries = [];\n\tget queue() {\n\t\treturn this.queueEntries;\n\t}\n\tset queue(next) {\n\t\tthis.queueEntries = next;\n\t\tthis.pendingIndex = void 0;\n\t}\n\t/**\n\t* Per collection, the row ids the queue writes to and the ones it creates\n\t* — {@link hasPending} and {@link isLocallyCreated}, which answering a\n\t* page asks once or twice per row. Each used to scan the whole queue: a\n\t* 500-row page against 200 queued writes read 80,000 queue entries, on\n\t* every emit. Built on first use after the queue changes; whatever changes\n\t* it in place calls {@link queueChangedInPlace}.\n\t*/\n\tpendingIndex;\n\t/**\n\t* The mutations currently on the wire: one, or the members of a folded\n\t* run (`replayBatchSize`).\n\t*\n\t* `flush` awaits `replay(op)` with `op` still at the head of `queue`, so for\n\t* the whole duration of that request the in-flight op is also the queue's\n\t* *tail* whenever it is the only entry. Both shortcuts in `enqueue` reach\n\t* for the tail, and neither may touch an op the server is already reading:\n\t*\n\t* - Coalescing an update into it mutates a payload that has already been\n\t* serialized and sent, and `drop` then removes the whole entry on ACK —\n\t* so the second edit is neither sent nor kept. A silently lost write.\n\t* - Cancelling it out against a delete assumes the server never saw the\n\t* create. It is seeing it right now, so the row would be created and the\n\t* delete never queued — an orphan row nothing will ever remove.\n\t*\n\t* Guarding on ids rather than on a boolean is what keeps this correct\n\t* when a folded run sends several at once, its last member the tail.\n\t*/\n\tinFlight = /* @__PURE__ */ new Set();\n\tqueueLoad;\n\t/** Serializes enqueues so concurrent writes keep the order the app made them. */\n\tenqueueChain = Promise.resolve();\n\tflushPromise;\n\tqueueListeners = /* @__PURE__ */ new Set();\n\tstatusListeners = /* @__PURE__ */ new Set();\n\tobservers = /* @__PURE__ */ new Map();\n\trefreshPending = /* @__PURE__ */ new Set();\n\trevCounter = 0;\n\tdisposed = false;\n\t/** Whether {@link requestPersistence} has asked. */\n\tpersistenceRequested = false;\n\tcurrentStatus = {\n\t\tonline: true,\n\t\tsyncing: false,\n\t\tpending: 0\n\t};\n\tchannel;\n\ttabId = createMutationId();\n\tapi;\n\tconstructor(config, createInner) {\n\t\tthis.store = config.store ?? (typeof indexedDB !== \"undefined\" ? new IndexedDBOfflineStore() : new MemoryOfflineStore());\n\t\tthis.maxCachedQueries = config.maxCachedQueriesPerCollection ?? 50;\n\t\tthis.maxCachedRows = config.maxCachedRowsPerCollection ?? 5e3;\n\t\tthis.maxRetries = config.maxRetries ?? 5;\n\t\tthis.onSyncError = config.onSyncError;\n\t\tthis.onConflict = config.onConflict;\n\t\tthis.keepLastUser = config.keepLastUser === true;\n\t\tconst batch = Math.floor(config.replayBatchSize ?? 1);\n\t\tthis.replayBatchSize = Number.isFinite(batch) ? Math.min(Math.max(batch, 1), MAX_REPLAY_BATCH) : 1;\n\t\tthis.createInner = createInner;\n\t\tconst maxBackoffMs = config.syncIntervalMs ?? 6e4;\n\t\tthis.connectivity = new ConnectivityMonitor({\n\t\t\tmaxBackoffMs: Math.max(1e3, maxBackoffMs),\n\t\t\trespectBackoff: maxBackoffMs > 0\n\t\t});\n\t\tif (maxBackoffMs > 0) this.connectivity.onRetryDue = () => {\n\t\t\tthis.sync().catch(() => void 0);\n\t\t};\n\t\tthis.connectivity.onOnline = () => {\n\t\t\tthis.sync().catch(() => void 0);\n\t\t};\n\t\tthis.connectivity.onChange((online) => {\n\t\t\tthis.patchStatus({ online });\n\t\t\tif (online) this.revalidateAll();\n\t\t});\n\t\tthis.currentStatus.online = this.connectivity.isOnline();\n\t\tif ((config.crossTab ?? this.store instanceof IndexedDBOfflineStore) && typeof BroadcastChannel !== \"undefined\") try {\n\t\t\tthis.channel = new BroadcastChannel(\"rebase-offline\");\n\t\t\tthis.channel.onmessage = (event) => this.onBroadcast(event.data);\n\t\t\tunref(this.channel);\n\t\t} catch {}\n\t\tthis.api = {\n\t\t\tsync: () => this.sync(),\n\t\t\tpending: async (options) => {\n\t\t\t\tif (options?.orphaned) {\n\t\t\t\t\tawait this.scopeKnown();\n\t\t\t\t\tif (this.scope === SIGNED_OUT_SCOPE) return [];\n\t\t\t\t\treturn await this.readQueue(`${SIGNED_OUT_SCOPE}|`);\n\t\t\t\t}\n\t\t\t\tawait this.ensureQueueLoaded();\n\t\t\t\treturn this.queue.map((m) => hydrateMutation(structuredClone(dehydrateMutation(m))));\n\t\t\t},\n\t\t\tstatus: () => ({ ...this.currentStatus }),\n\t\t\tonStatusChange: (listener) => {\n\t\t\t\tthis.statusListeners.add(listener);\n\t\t\t\treturn () => this.statusListeners.delete(listener);\n\t\t\t},\n\t\t\tclear: async (options) => {\n\t\t\t\tawait this.scopeKnown();\n\t\t\t\tif (options?.orphaned) {\n\t\t\t\t\tif (this.scope === SIGNED_OUT_SCOPE) return;\n\t\t\t\t\tawait this.store.clear(`${SIGNED_OUT_SCOPE}|`);\n\t\t\t\t\tthis.broadcast({ type: \"queue\" }, SIGNED_OUT_SCOPE);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.scopeEpoch++;\n\t\t\t\tawait this.store.clear(`${this.scope}|`);\n\t\t\t\tthis.queue = [];\n\t\t\t\tthis.resetCollections();\n\t\t\t\tthis.patchStatus({\n\t\t\t\t\tpending: 0,\n\t\t\t\t\tlastError: void 0\n\t\t\t\t});\n\t\t\t\tthis.notifyQueue();\n\t\t\t\tfor (const slug of this.observers.keys()) this.notifyCollection(slug, false);\n\t\t\t},\n\t\t\tonQueueChange: (listener) => {\n\t\t\t\tthis.queueListeners.add(listener);\n\t\t\t\treturn () => this.queueListeners.delete(listener);\n\t\t\t}\n\t\t};\n\t}\n\t/**\n\t* Cache and queue are partitioned per signed-in user: cached rows are\n\t* RLS-filtered for the user who fetched them, and queued writes must\n\t* replay under the credentials that made them — so neither may ever leak\n\t* across a sign-out/sign-in on a shared browser.\n\t*/\n\tsetScope(uid, options) {\n\t\tconst next = uid || SIGNED_OUT_SCOPE;\n\t\tconst unverified = next !== SIGNED_OUT_SCOPE && options?.unverified === true;\n\t\tif (!unverified) this.rememberUser(uid);\n\t\tconst hold = this.scopeHold;\n\t\tif (!hold && next === this.scope) {\n\t\t\tif (this.unverified && !unverified) {\n\t\t\t\tthis.unverified = false;\n\t\t\t\tthis.patchStatus({ unverifiedUser: void 0 });\n\t\t\t\tthis.sync().catch(() => void 0);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tthis.scope = next;\n\t\tthis.unverified = unverified;\n\t\tthis.scopeHold = void 0;\n\t\tthis.leaveScope();\n\t\tthis.patchStatus({ unverifiedUser: unverified || void 0 });\n\t\thold?.release();\n\t\tthis.revalidateAll();\n\t\tthis.sync().catch(() => void 0);\n\t}\n\t/** Whether the manager was created with {@link OfflineConfig.keepLastUser}. */\n\tget keepsLastUser() {\n\t\treturn this.keepLastUser;\n\t}\n\t/**\n\t* Take the scope of the last user who signed in on this device, without a\n\t* session — for a load whose session restore could not reach the server.\n\t* See {@link OfflineConfig.keepLastUser}. With no user remembered (or the\n\t* option off) this is the signed-out scope, as it would have been anyway.\n\t*\n\t* Only while the scope is still held: an auth event that settled it while\n\t* the id was being read is newer news.\n\t*/\n\tasync resumeLastUser() {\n\t\tlet uid;\n\t\tif (this.keepLastUser) try {\n\t\t\tconst entry = await this.store.getCache(LAST_USER_KEY);\n\t\t\tif (typeof entry?.value === \"string\" && entry.value) uid = entry.value;\n\t\t} catch {}\n\t\tif (!this.scopeHold) return;\n\t\tthis.setScope(uid, { unverified: uid !== void 0 });\n\t}\n\t/**\n\t* Keep the signed-in user's id for {@link resumeLastUser}, or forget it at\n\t* sign-out. Forgetting does not depend on the option, so turning it off\n\t* does not leave the last id behind for good.\n\t*/\n\trememberUser(uid) {\n\t\t(uid ? this.keepLastUser ? this.store.setCache(LAST_USER_KEY, {\n\t\t\tvalue: uid,\n\t\t\tcachedAt: Date.now()\n\t\t}) : void 0 : this.store.deleteCache([LAST_USER_KEY]))?.catch(() => void 0);\n\t}\n\t/**\n\t* Forget whose data this is until the next {@link setScope}.\n\t*\n\t* For the time before the client knows who is signed in — a session being\n\t* restored on load. Taking that time for \"signed out\" would put the user's\n\t* own writes in the signed-out queue, which no sign-in replays, and show\n\t* them the signed-out local database instead of theirs.\n\t*\n\t* Meanwhile the manager has no scope at all. Every operation — a read, a\n\t* write, a replay, `pending()`, `clear()` — waits for one and then runs\n\t* for whoever it turns out to be, and nothing reads or writes the store.\n\t* A realtime frame arriving in between is handed on as the server sent it\n\t* and kept nowhere.\n\t*/\n\tholdScope() {\n\t\tif (this.scopeHold) return;\n\t\tlet release;\n\t\tconst known = new Promise((resolve) => {\n\t\t\trelease = resolve;\n\t\t});\n\t\tthis.scopeHold = {\n\t\t\tknown,\n\t\t\trelease\n\t\t};\n\t\tthis.leaveScope();\n\t}\n\t/** Let go of the current user's rows and queue: in memory, and on screen. */\n\tleaveScope() {\n\t\tthis.scopeEpoch++;\n\t\tthis.queueLoad = void 0;\n\t\tthis.queue = [];\n\t\tthis.resetCollections();\n\t\tthis.patchStatus({\n\t\t\tpending: 0,\n\t\t\tlastError: void 0\n\t\t});\n\t\tthis.notifyQueue();\n\t\tfor (const slug of this.observers.keys()) this.notifyCollection(slug, false);\n\t}\n\t/** Settles once the manager knows whose data it holds — see {@link holdScope}. */\n\tasync scopeKnown() {\n\t\twhile (this.scopeHold) await this.scopeHold.known;\n\t}\n\t/**\n\t* The user an operation is running for — see {@link scopeEpoch} — or\n\t* nothing while that is not known ({@link holdScope}). An operation takes\n\t* it as `this.ticket() ?? await this.nextTicket()`, before its first await.\n\t*/\n\tticket() {\n\t\tif (this.scopeHold) return void 0;\n\t\treturn this.currentTicket();\n\t}\n\t/** The ticket of whoever the held scope turns out to be. */\n\tasync nextTicket() {\n\t\tawait this.scopeKnown();\n\t\treturn this.currentTicket();\n\t}\n\tcurrentTicket() {\n\t\treturn this.unverified ? {\n\t\t\tscope: this.scope,\n\t\t\tepoch: this.scopeEpoch,\n\t\t\tunverified: true\n\t\t} : {\n\t\t\tscope: this.scope,\n\t\t\tepoch: this.scopeEpoch\n\t\t};\n\t}\n\t/**\n\t* Whether a write may go to the server now. Not while the scope is the last\n\t* user's, unconfirmed: it would go out with no credentials, as nobody. It\n\t* queues for its author instead, as it does offline.\n\t*/\n\tsendsWrites() {\n\t\treturn this.connectivity.shouldAttempt() && !this.unverified;\n\t}\n\treachedUnconfirmedListeners = /* @__PURE__ */ new Set();\n\t/**\n\t* `listener` runs when a request made while the scope is unconfirmed\n\t* reached the server: the connection is back, so the session can be asked\n\t* about. The client wires it to the same confirmation the status listener\n\t* runs — the status may never have said the connection was gone.\n\t*/\n\tonReachedUnconfirmed(listener) {\n\t\tthis.reachedUnconfirmedListeners.add(listener);\n\t\treturn () => this.reachedUnconfirmedListeners.delete(listener);\n\t}\n\treachedUnconfirmed() {\n\t\tfor (const listener of this.reachedUnconfirmedListeners) callSafely(listener);\n\t}\n\t/** Whether an operation's user is still the signed-in one. */\n\tisCurrent(ticket) {\n\t\treturn ticket.epoch === this.scopeEpoch;\n\t}\n\t/**\n\t* Throw away every local row, for a scope change or an explicit clear.\n\t*\n\t* The state objects are replaced rather than emptied, so a load still in\n\t* flight for the previous user fails its identity check and discards what\n\t* it read instead of grafting it onto the new one. The replacements are\n\t* marked ready: nothing needs loading until something asks, and observers\n\t* have to be told *now* that the rows they are showing are gone.\n\t*/\n\tresetCollections() {\n\t\tconst slugs = [...this.collections.keys()];\n\t\tthis.collections = /* @__PURE__ */ new Map();\n\t\tfor (const slug of slugs) this.collections.set(slug, {\n\t\t\trows: /* @__PURE__ */ new Map(),\n\t\t\tsnapshots: /* @__PURE__ */ new Map(),\n\t\t\tfresh: /* @__PURE__ */ new Set(),\n\t\t\tfreshRows: /* @__PURE__ */ new Set(),\n\t\t\tabsent: /* @__PURE__ */ new Set(),\n\t\t\tready: true\n\t\t});\n\t}\n\t/** Release listeners, timers and the cross-tab channel (client.close()). */\n\tdispose() {\n\t\tthis.disposed = true;\n\t\tthis.connectivity.dispose();\n\t\ttry {\n\t\t\tthis.channel?.close();\n\t\t} catch {}\n\t\tthis.observers.clear();\n\t\tthis.queueListeners.clear();\n\t\tthis.statusListeners.clear();\n\t}\n\twrap(slug, inner) {\n\t\tthis.inners.set(slug, inner);\n\t\t/**\n\t\t* `find`, and the page reader of `iterate()` / `findAll()` when `walk`\n\t\t* is set.\n\t\t*\n\t\t* A walk reads `meta.hasMore` as the server's word on whether to go\n\t\t* on. A page the server never answered here is evaluated over whatever\n\t\t* rows happen to be cached, and its `hasMore` is about those rows — so\n\t\t* offline, `findAll()` stopped at the first such page and returned a\n\t\t* fraction of the collection as the whole of it, with nothing to tell\n\t\t* the two apart. A walk refuses that page instead.\n\t\t*/\n\t\tconst findPage = async (params, walk) => {\n\t\t\tconst ticket = this.ticket() ?? await this.nextTicket();\n\t\t\tconst state = await this.ensureCollection(slug);\n\t\t\tif (this.connectivity.shouldAttempt()) try {\n\t\t\t\tconst res = await inner.find(params);\n\t\t\t\tthis.connectivity.markSuccess();\n\t\t\t\tif (!this.isCurrent(ticket)) return res;\n\t\t\t\tif (ticket.unverified) this.reachedUnconfirmed();\n\t\t\t\telse {\n\t\t\t\t\tawait this.ingest(slug, res.data ?? [], ticket, isProjection(params));\n\t\t\t\t\tif (!this.isCurrent(ticket)) return res;\n\t\t\t\t\tconst snapshot = this.recordSnapshot(slug, params, res, ticket);\n\t\t\t\t\tconst answer = this.answer(slug, params, snapshot);\n\t\t\t\t\tthis.notifyCollection(slug, false);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdata: answer.data,\n\t\t\t\t\t\tmeta: answer.meta\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tif (!isNetworkError(error)) {\n\t\t\t\t\tif (isRetryableError(error) && this.hasLocalAnswer(state, slug, params) && !(walk && !this.snapshotFor(slug, params))) {\n\t\t\t\t\t\tconst answer = this.answer(slug, params, this.snapshotFor(slug, params));\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tdata: answer.data,\n\t\t\t\t\t\t\tmeta: answer.meta\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t\tthis.connectivity.markFailure();\n\t\t\t}\n\t\t\tif (walk && !this.snapshotFor(slug, params)) throw unwalkable();\n\t\t\tconst answer = this.localFind(slug, params);\n\t\t\tthis.notifyCollection(slug, false);\n\t\t\treturn {\n\t\t\t\tdata: answer.data,\n\t\t\t\tmeta: answer.meta\n\t\t\t};\n\t\t};\n\t\tconst unwalkable = () => offlineError(`Offline: a page of \"${slug}\" the server has not answered on this device is needed to read the collection to the end, and the local database cannot say what is on it.`);\n\t\tconst wrapped = {\n\t\t\tfind: (params) => findPage(params, false),\n\t\t\titerate: (params) => paginateFind((p) => findPage(p, true), params, slug),\n\t\t\tfindAll: (params) => collectAllPages((p) => findPage(p, true), params, slug),\n\t\t\tfindById: async (id, options) => {\n\t\t\t\tconst ticket = this.ticket() ?? await this.nextTicket();\n\t\t\t\tawait this.ensureCollection(slug);\n\t\t\t\tif (this.connectivity.shouldAttempt()) try {\n\t\t\t\t\tconst row = await inner.findById(id, options);\n\t\t\t\t\tthis.connectivity.markSuccess();\n\t\t\t\t\tif (!this.isCurrent(ticket)) return row;\n\t\t\t\t\tif (ticket.unverified) {\n\t\t\t\t\t\tthis.reachedUnconfirmed();\n\t\t\t\t\t\treturn this.localRow(slug, id);\n\t\t\t\t\t}\n\t\t\t\t\tif (row !== void 0) await this.ingest(slug, [row], ticket);\n\t\t\t\t\telse if (!this.hasPending(slug, id)) this.removeLocalRow(slug, id, ticket, true);\n\t\t\t\t\tthis.notifyCollection(slug, false);\n\t\t\t\t\tconst local = this.localRow(slug, id);\n\t\t\t\t\tconst etag = etagOf(row);\n\t\t\t\t\treturn etag && local !== void 0 && !this.hasPending(slug, id) ? withETag({ ...local }, etag) : local;\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (!isNetworkError(error)) throw error;\n\t\t\t\t\tthis.connectivity.markFailure();\n\t\t\t\t}\n\t\t\t\tconst local = this.localRow(slug, id);\n\t\t\t\tif (local !== void 0 || this.hasPending(slug, id)) return local;\n\t\t\t\tif (this.collections.get(slug)?.absent.has(String(id))) return void 0;\n\t\t\t\tthrow offlineError(`Offline: \"${slug}\" row ${String(id)} is not in the local database.`);\n\t\t\t},\n\t\t\tget: async (id) => {\n\t\t\t\tconst row = await wrapped.findById(id);\n\t\t\t\tif (row === void 0) throw new RebaseApiError$1(`No record with id ${JSON.stringify(String(id))} in \"${slug}\".`, {\n\t\t\t\t\tstatus: 404,\n\t\t\t\t\tcode: \"NOT_FOUND\"\n\t\t\t\t});\n\t\t\t\treturn row;\n\t\t\t},\n\t\t\tcreate: async (data, id, options) => {\n\t\t\t\tconst ticket = this.ticket() ?? await this.nextTicket();\n\t\t\t\tawait this.ensureCollection(slug);\n\t\t\t\tconst idempotencyKey = options?.idempotencyKey ?? createMutationId();\n\t\t\t\tlet sent = false;\n\t\t\t\tif (this.sendsWrites()) try {\n\t\t\t\t\tconst row = await inner.create(data, id, {\n\t\t\t\t\t\t...options,\n\t\t\t\t\t\tidempotencyKey\n\t\t\t\t\t});\n\t\t\t\t\tthis.connectivity.markSuccess();\n\t\t\t\t\tawait this.ingest(slug, [row], ticket);\n\t\t\t\t\tthis.notifyCollection(slug);\n\t\t\t\t\tthis.scheduleRefresh(slug);\n\t\t\t\t\treturn row;\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (!isNetworkError(error)) throw error;\n\t\t\t\t\tthis.connectivity.markFailure();\n\t\t\t\t\tsent = true;\n\t\t\t\t}\n\t\t\t\tconst providedId = id ?? data.id;\n\t\t\t\tconst rowId = providedId ?? this.mintOfflineId(slug);\n\t\t\t\tconst row = optimisticRow(data, rowId);\n\t\t\t\tawait this.enqueue({\n\t\t\t\t\tcollection: slug,\n\t\t\t\t\ttype: \"create\",\n\t\t\t\t\tid: rowId,\n\t\t\t\t\tdata: row,\n\t\t\t\t\tgeneratedId: providedId === void 0,\n\t\t\t\t\t...sent ? { sent: {\n\t\t\t\t\t\tidempotencyKey,\n\t\t\t\t\t\tdata: { ...data },\n\t\t\t\t\t\tid\n\t\t\t\t\t} } : {},\n\t\t\t\t\trollback: { rows: { [String(rowId)]: this.rawLocalRow(slug, rowId) ?? null } }\n\t\t\t\t}, ticket);\n\t\t\t\tthis.setLocalRow(slug, rowId, row, ticket);\n\t\t\t\tthis.notifyCollection(slug);\n\t\t\t\treturn row;\n\t\t\t},\n\t\t\tcreateMany: async (data, options) => {\n\t\t\t\tconst ticket = this.ticket() ?? await this.nextTicket();\n\t\t\t\tawait this.ensureCollection(slug);\n\t\t\t\tif (!Array.isArray(data)) throw invalidBulkBody(\"createMany expects an array of records.\");\n\t\t\t\tif (data.length === 0) return [];\n\t\t\t\tconst idempotencyKey = options?.idempotencyKey ?? createMutationId();\n\t\t\t\tlet sent = false;\n\t\t\t\tif (this.sendsWrites()) try {\n\t\t\t\t\tconst rows = await inner.createMany(data, {\n\t\t\t\t\t\t...options,\n\t\t\t\t\t\tidempotencyKey\n\t\t\t\t\t});\n\t\t\t\t\tthis.connectivity.markSuccess();\n\t\t\t\t\tawait this.ingest(slug, rows, ticket);\n\t\t\t\t\tthis.notifyCollection(slug);\n\t\t\t\t\tthis.scheduleRefresh(slug);\n\t\t\t\t\treturn rows;\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (!isNetworkError(error)) throw error;\n\t\t\t\t\tthis.connectivity.markFailure();\n\t\t\t\t\tsent = true;\n\t\t\t\t}\n\t\t\t\tif (!sent && options?.onConflict?.length) throw new RebaseClientError$1(`Cannot upsert into \"${slug}\" while offline: the rows it would replace can only be found by the server. Upserting on the primary key, with the key in each row, is queued; upserting on a natural key is not.`, { code: \"OFFLINE_UPSERT_UNSUPPORTED\" });\n\t\t\t\tconst rows = data.map((r) => optimisticRow(r, r.id ?? this.mintOfflineId(slug)));\n\t\t\t\tconst rollback = {};\n\t\t\t\tfor (const row of rows) {\n\t\t\t\t\tconst key = String(row.id);\n\t\t\t\t\trollback[key] = this.rawLocalRow(slug, row.id) ?? null;\n\t\t\t\t}\n\t\t\t\tawait this.enqueue({\n\t\t\t\t\tcollection: slug,\n\t\t\t\t\ttype: \"createMany\",\n\t\t\t\t\tdata: rows,\n\t\t\t\t\tupsert: options?.upsert,\n\t\t\t\t\t...sent ? { sent: {\n\t\t\t\t\t\tidempotencyKey,\n\t\t\t\t\t\tdata: data.map((r) => ({ ...r })),\n\t\t\t\t\t\t...options?.onConflict?.length ? { onConflict: [...options.onConflict] } : {}\n\t\t\t\t\t} } : {},\n\t\t\t\t\trollback: { rows: rollback }\n\t\t\t\t}, ticket);\n\t\t\t\tfor (const row of rows) this.setLocalRow(slug, row.id, row, ticket);\n\t\t\t\tthis.notifyCollection(slug);\n\t\t\t\treturn rows;\n\t\t\t},\n\t\t\t/**\n\t\t\t* Upsert, with the one case that cannot be resolved without the\n\t\t\t* server refused rather than guessed.\n\t\t\t*\n\t\t\t* On the primary key an upsert is create-or-replace, which the\n\t\t\t* local store can do and the queue already carries (`createMany`\n\t\t\t* with `upsert`). On a natural key it is not: deciding whether a\n\t\t\t* row with that email exists means an index this store does not\n\t\t\t* keep, and inventing an id would insert a duplicate the moment the\n\t\t\t* queue drains — the exact outcome upsert exists to prevent.\n\t\t\t*/\n\t\t\tupsert: async (data, options) => {\n\t\t\t\tconst ticket = this.ticket() ?? await this.nextTicket();\n\t\t\t\tawait this.ensureCollection(slug);\n\t\t\t\tif (this.sendsWrites()) try {\n\t\t\t\t\tconst row = await inner.upsert(data, options);\n\t\t\t\t\tthis.connectivity.markSuccess();\n\t\t\t\t\tawait this.ingest(slug, [row], ticket);\n\t\t\t\t\tthis.notifyCollection(slug);\n\t\t\t\t\tthis.scheduleRefresh(slug);\n\t\t\t\t\treturn row;\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (!isNetworkError(error)) throw error;\n\t\t\t\t\tthis.connectivity.markFailure();\n\t\t\t\t}\n\t\t\t\tconst rowId = data.id;\n\t\t\t\tif (options?.onConflict?.length || rowId === void 0) throw new RebaseClientError$1(`Cannot upsert into \"${slug}\" while offline: the row it would replace can only be found by the server. Upserting on the primary key, with the key in the row, is queued; upserting on a natural key is not.`, { code: \"OFFLINE_UPSERT_UNSUPPORTED\" });\n\t\t\t\tconst row = optimisticRow(data, rowId);\n\t\t\t\tawait this.enqueue({\n\t\t\t\t\tcollection: slug,\n\t\t\t\t\ttype: \"createMany\",\n\t\t\t\t\tdata: [row],\n\t\t\t\t\tupsert: true,\n\t\t\t\t\trollback: { rows: { [String(rowId)]: this.rawLocalRow(slug, rowId) ?? null } }\n\t\t\t\t}, ticket);\n\t\t\t\tthis.setLocalRow(slug, rowId, row, ticket);\n\t\t\t\tthis.notifyCollection(slug);\n\t\t\t\treturn row;\n\t\t\t},\n\t\t\tupdateMany: async (updates, options) => {\n\t\t\t\tconst ticket = this.ticket() ?? await this.nextTicket();\n\t\t\t\tawait this.ensureCollection(slug);\n\t\t\t\tif (!Array.isArray(updates)) throw invalidBulkBody(\"updateMany expects an array of { id, data } entries.\");\n\t\t\t\tif (updates.length === 0) return [];\n\t\t\t\tconst anyPending = updates.some((u) => this.hasPending(slug, u.id));\n\t\t\t\tif (this.sendsWrites() && !anyPending) try {\n\t\t\t\t\tconst rows = await inner.updateMany(updates, options);\n\t\t\t\t\tthis.connectivity.markSuccess();\n\t\t\t\t\tawait this.ingest(slug, rows, ticket);\n\t\t\t\t\tthis.notifyCollection(slug);\n\t\t\t\t\treturn rows;\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (!isNetworkError(error)) throw error;\n\t\t\t\t\tthis.connectivity.markFailure();\n\t\t\t\t}\n\t\t\t\tconst rollback = {};\n\t\t\t\tconst optimistic = [];\n\t\t\t\tfor (const { id, data } of updates) {\n\t\t\t\t\tconst base = this.rawLocalRow(slug, id);\n\t\t\t\t\trollback[String(id)] = base ?? null;\n\t\t\t\t\toptimistic.push(optimisticRow({\n\t\t\t\t\t\t...base ?? {},\n\t\t\t\t\t\t...data\n\t\t\t\t\t}, id));\n\t\t\t\t}\n\t\t\t\tawait this.enqueue({\n\t\t\t\t\tcollection: slug,\n\t\t\t\t\ttype: \"updateMany\",\n\t\t\t\t\tupdates: updates.map((u) => ({\n\t\t\t\t\t\tid: u.id,\n\t\t\t\t\t\tdata: u.data\n\t\t\t\t\t})),\n\t\t\t\t\trollback: { rows: rollback }\n\t\t\t\t}, ticket);\n\t\t\t\tfor (const row of optimistic) this.setLocalRow(slug, row.id, row, ticket);\n\t\t\t\tthis.notifyCollection(slug);\n\t\t\t\treturn optimistic;\n\t\t\t},\n\t\t\tdeleteMany: async (ids, options) => {\n\t\t\t\tconst ticket = this.ticket() ?? await this.nextTicket();\n\t\t\t\tawait this.ensureCollection(slug);\n\t\t\t\tif (!Array.isArray(ids)) throw invalidBulkBody(\"deleteMany expects an array of ids.\");\n\t\t\t\tif (ids.length === 0) return;\n\t\t\t\tconst anyPending = ids.some((id) => this.hasPending(slug, id));\n\t\t\t\tif (this.sendsWrites() && !anyPending) try {\n\t\t\t\t\tawait inner.deleteMany(ids, options);\n\t\t\t\t\tthis.connectivity.markSuccess();\n\t\t\t\t\tfor (const id of ids) this.removeLocalRow(slug, id, ticket, true);\n\t\t\t\t\tthis.notifyCollection(slug);\n\t\t\t\t\tthis.scheduleRefresh(slug);\n\t\t\t\t\treturn;\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (!isNetworkError(error)) throw error;\n\t\t\t\t\tthis.connectivity.markFailure();\n\t\t\t\t}\n\t\t\t\tconst rollback = {};\n\t\t\t\tfor (const id of ids) rollback[String(id)] = this.rawLocalRow(slug, id) ?? null;\n\t\t\t\tawait this.enqueue({\n\t\t\t\t\tcollection: slug,\n\t\t\t\t\ttype: \"deleteMany\",\n\t\t\t\t\tids,\n\t\t\t\t\trollback: { rows: rollback }\n\t\t\t\t}, ticket);\n\t\t\t\tfor (const id of ids) this.removeLocalRow(slug, id, ticket, false);\n\t\t\t\tthis.notifyCollection(slug);\n\t\t\t},\n\t\t\tupdate: async (id, data, options) => {\n\t\t\t\tconst ticket = this.ticket() ?? await this.nextTicket();\n\t\t\t\tawait this.ensureCollection(slug);\n\t\t\t\tconst idempotencyKey = options?.idempotencyKey ?? createMutationId();\n\t\t\t\tlet sent = false;\n\t\t\t\tlet sendFailure;\n\t\t\t\tif (this.sendsWrites() && !this.hasPending(slug, id)) try {\n\t\t\t\t\tconst row = await inner.update(id, data, {\n\t\t\t\t\t\t...options,\n\t\t\t\t\t\tidempotencyKey\n\t\t\t\t\t});\n\t\t\t\t\tthis.connectivity.markSuccess();\n\t\t\t\t\tawait this.ingest(slug, [row], ticket);\n\t\t\t\t\tthis.notifyCollection(slug);\n\t\t\t\t\treturn row;\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (!isNetworkError(error)) throw error;\n\t\t\t\t\tthis.connectivity.markFailure();\n\t\t\t\t\tsent = true;\n\t\t\t\t\tsendFailure = error;\n\t\t\t\t}\n\t\t\t\tif (hasFieldOperation(data)) {\n\t\t\t\t\tif (sent) throw new RebaseApiError$1(`The connection failed after a field operation on \"${slug}\" was sent, so it may or may not have been applied. Retry it with the idempotencyKey in \\`details\\` to apply it at most once.`, {\n\t\t\t\t\t\tstatus: 0,\n\t\t\t\t\t\tcode: \"NETWORK_ERROR\",\n\t\t\t\t\t\tdetails: { idempotencyKey },\n\t\t\t\t\t\tcause: sendFailure\n\t\t\t\t\t});\n\t\t\t\t\tthrow new RebaseClientError$1(`Cannot apply a field operation to \"${slug}\" while offline: it is evaluated against the stored value, which this device does not have a current copy of. Send the value itself, or retry when the connection is back.`, { code: \"OFFLINE_FIELD_OP_UNSUPPORTED\" });\n\t\t\t\t}\n\t\t\t\tconst base = this.rawLocalRow(slug, id);\n\t\t\t\tconst ifMatch = options?.ifMatch ?? (this.onConflict && !this.hasPending(slug, id) ? this.etagFor(slug, id) : void 0);\n\t\t\t\tawait this.enqueue({\n\t\t\t\t\tcollection: slug,\n\t\t\t\t\ttype: \"update\",\n\t\t\t\t\tid,\n\t\t\t\t\tdata,\n\t\t\t\t\t...sent ? { sent: { idempotencyKey } } : {},\n\t\t\t\t\t...ifMatch ? { ifMatch } : {},\n\t\t\t\t\trollback: { rows: { [String(id)]: base ?? null } }\n\t\t\t\t}, ticket);\n\t\t\t\tconst optimistic = optimisticRow({\n\t\t\t\t\t...base ?? {},\n\t\t\t\t\t...data\n\t\t\t\t}, id);\n\t\t\t\tthis.setLocalRow(slug, id, optimistic, ticket);\n\t\t\t\tthis.notifyCollection(slug);\n\t\t\t\treturn optimistic;\n\t\t\t},\n\t\t\tdelete: async (id, options) => {\n\t\t\t\tconst ticket = this.ticket() ?? await this.nextTicket();\n\t\t\t\tawait this.ensureCollection(slug);\n\t\t\t\tconst idempotencyKey = options?.idempotencyKey ?? createMutationId();\n\t\t\t\tlet sent = false;\n\t\t\t\tif (this.sendsWrites() && !this.hasPending(slug, id)) try {\n\t\t\t\t\tawait inner.delete(id, {\n\t\t\t\t\t\t...options,\n\t\t\t\t\t\tidempotencyKey\n\t\t\t\t\t});\n\t\t\t\t\tthis.connectivity.markSuccess();\n\t\t\t\t\tthis.removeLocalRow(slug, id, ticket, true);\n\t\t\t\t\tthis.notifyCollection(slug);\n\t\t\t\t\tthis.scheduleRefresh(slug);\n\t\t\t\t\treturn;\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (!isNetworkError(error)) throw error;\n\t\t\t\t\tthis.connectivity.markFailure();\n\t\t\t\t\tsent = true;\n\t\t\t\t}\n\t\t\t\tawait this.enqueue({\n\t\t\t\t\tcollection: slug,\n\t\t\t\t\ttype: \"delete\",\n\t\t\t\t\tid,\n\t\t\t\t\t...sent ? { sent: { idempotencyKey } } : {},\n\t\t\t\t\t...options?.ifMatch ? { ifMatch: options.ifMatch } : {},\n\t\t\t\t\trollback: { rows: { [String(id)]: this.rawLocalRow(slug, id) ?? null } }\n\t\t\t\t}, ticket);\n\t\t\t\tthis.removeLocalRow(slug, id, ticket);\n\t\t\t\tthis.notifyCollection(slug);\n\t\t\t},\n\t\t\tcount: async (params) => {\n\t\t\t\tconst ticket = this.ticket() ?? await this.nextTicket();\n\t\t\t\tawait this.ensureCollection(slug);\n\t\t\t\tif (this.connectivity.shouldAttempt()) try {\n\t\t\t\t\tconst n = await inner.count(params);\n\t\t\t\t\tthis.connectivity.markSuccess();\n\t\t\t\t\tif (!this.isCurrent(ticket)) return n;\n\t\t\t\t\tif (ticket.unverified) {\n\t\t\t\t\t\tthis.reachedUnconfirmed();\n\t\t\t\t\t\tconst cached = await this.readCache(this.countKey(slug, params));\n\t\t\t\t\t\tif (cached !== void 0) return Math.max(0, cached + this.pendingDelta(slug, params));\n\t\t\t\t\t\tthrow offlineError(`No count of \"${slug}\" for the last user is cached, and their session is not confirmed yet.`);\n\t\t\t\t\t}\n\t\t\t\t\tthis.writeCache(this.countKey(slug, params), n);\n\t\t\t\t\treturn Math.max(0, n + this.pendingDelta(slug, params));\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (!isNetworkError(error)) throw error;\n\t\t\t\t\tthis.connectivity.markFailure();\n\t\t\t\t}\n\t\t\t\tconst cached = await this.readCache(this.countKey(slug, params));\n\t\t\t\tif (cached !== void 0) return Math.max(0, cached + this.pendingDelta(slug, params));\n\t\t\t\tthrow offlineError(`Offline: no cached count for \"${slug}\".`);\n\t\t\t},\n\t\t\tobserve: (params, onResult, onError, options) => this.observe(slug, wrapped, inner, params, onResult, onError, options),\n\t\t\tobserveById: (id, onResult, onError, options) => this.observeById(slug, wrapped, inner, id, onResult, onError, options),\n\t\t\twhere(columnOrCondition, operator, value) {\n\t\t\t\tconst builder = new SDKQueryBuilder(wrapped);\n\t\t\t\tif (typeof columnOrCondition === \"object\") return builder.where(columnOrCondition);\n\t\t\t\treturn builder.where(columnOrCondition, operator, value);\n\t\t\t},\n\t\t\torderBy: (column, direction, nulls) => new SDKQueryBuilder(wrapped).orderBy(column, direction, nulls),\n\t\t\tlimit: (count) => new SDKQueryBuilder(wrapped).limit(count),\n\t\t\toffset: (count) => new SDKQueryBuilder(wrapped).offset(count),\n\t\t\tsearch: (searchString, options) => new SDKQueryBuilder(wrapped).search(searchString, options),\n\t\t\tvectorSearch: (property, vector, options) => new SDKQueryBuilder(wrapped).vectorSearch(property, vector, options),\n\t\t\tinclude: (...relations) => new SDKQueryBuilder(wrapped).include(...relations),\n\t\t\tfields: (...columns) => new SDKQueryBuilder(wrapped).fields(...columns),\n\t\t\tdistinct: (enabled) => new SDKQueryBuilder(wrapped).distinct(enabled),\n\t\t\tafter: (cursor) => new SDKQueryBuilder(wrapped).after(cursor),\n\t\t\ttrash: this.wrapTrash(slug, inner),\n\t\t\taggregate: inner.aggregate,\n\t\t\tlisten: inner.listen,\n\t\t\tlistenById: inner.listenById,\n\t\t\tlistenCount: inner.listenCount\n\t\t};\n\t\tif (!isUnsupported(inner.listen)) wrapped.listen = (params, onUpdate, onError) => inner.listen(params, (response) => {\n\t\t\tconst ticket = this.ticket();\n\t\t\tif (!ticket) {\n\t\t\t\tonUpdate(response);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (ticket.unverified) {\n\t\t\t\tconst answer = this.localFind(slug, params);\n\t\t\t\tonUpdate({\n\t\t\t\t\t...response,\n\t\t\t\t\tdata: answer.data,\n\t\t\t\t\tmeta: answer.meta\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.ingest(slug, response.data ?? [], ticket, isProjection(params)).then(() => {\n\t\t\t\tif (!this.isCurrent(ticket)) return;\n\t\t\t\tconst snapshot = this.recordSnapshot(slug, params, response, ticket);\n\t\t\t\tconst answer = this.answer(slug, params, snapshot);\n\t\t\t\tthis.notifyCollection(slug, false);\n\t\t\t\tonUpdate({\n\t\t\t\t\t...response,\n\t\t\t\t\tdata: answer.data,\n\t\t\t\t\tmeta: answer.meta\n\t\t\t\t});\n\t\t\t});\n\t\t}, onError);\n\t\tif (!isUnsupported(inner.listenById)) wrapped.listenById = (id, onUpdate, onError, options) => inner.listenById(id, (row) => {\n\t\t\tconst ticket = this.ticket();\n\t\t\tif (!ticket) {\n\t\t\t\tonUpdate(row);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (ticket.unverified) {\n\t\t\t\tonUpdate(this.localRow(slug, id));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!row) {\n\t\t\t\tif (!this.hasPending(slug, id)) this.removeLocalRow(slug, id, ticket, true);\n\t\t\t\tthis.notifyCollection(slug, false);\n\t\t\t\tonUpdate(row);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.ingest(slug, [row], ticket).then(() => {\n\t\t\t\tif (!this.isCurrent(ticket)) return;\n\t\t\t\tthis.notifyCollection(slug, false);\n\t\t\t\tonUpdate(this.localRow(slug, id) ?? row);\n\t\t\t});\n\t\t}, onError, options);\n\t\treturn wrapped;\n\t}\n\t/**\n\t* `client.data.<slug>.trash` on an offline client: every call goes to the\n\t* server, and none is cached or queued.\n\t*\n\t* The local database holds live rows only — a trashed row read into it\n\t* would show up in every live query that matches it — so it cannot answer\n\t* a trash read, and a restore or a purge queued offline would act on a row\n\t* this device has never seen. Each of them rejects with `OFFLINE` instead.\n\t*\n\t* What the server answers does reach the local database: a restored row\n\t* is live again and joins it, and a purged row leaves it. A row with a\n\t* write still queued is synced first, so a purge never overtakes the\n\t* queued delete it follows; if the queue cannot drain, the call is refused.\n\t*/\n\twrapTrash(slug, inner) {\n\t\tconst online = async (what, call) => {\n\t\t\tconst message = `Offline: ${what} on the trash of \"${slug}\" needs the server; the trash is never cached on this device.`;\n\t\t\tif (!this.sendsWrites()) throw offlineError(message);\n\t\t\ttry {\n\t\t\t\tconst result = await call();\n\t\t\t\tthis.connectivity.markSuccess();\n\t\t\t\treturn result;\n\t\t\t} catch (error) {\n\t\t\t\tif (!isNetworkError(error)) throw error;\n\t\t\t\tthis.connectivity.markFailure();\n\t\t\t\tthrow new RebaseApiError$1(message, {\n\t\t\t\t\tstatus: 0,\n\t\t\t\t\tcode: \"OFFLINE\",\n\t\t\t\t\tcause: error\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\t\tconst settleQueued = async (what, ids) => {\n\t\t\tif (!ids.some((id) => this.hasPending(slug, id))) return;\n\t\t\tawait this.sync().catch(() => void 0);\n\t\t\tconst stuck = ids.find((id) => this.hasPending(slug, id));\n\t\t\tif (stuck === void 0) return;\n\t\t\tthrow new RebaseClientError$1(`Cannot ${what} \"${slug}\" row ${String(stuck)} yet: a write to it is still queued, and the trash acts on the server's copy. Retry once \\`client.offline.sync()\\` has sent it.`, {\n\t\t\t\tcode: \"TRASH_PENDING_WRITE\",\n\t\t\t\tdetails: { id: stuck }\n\t\t\t});\n\t\t};\n\t\tconst restored = async (rows, ticket) => {\n\t\t\tawait this.ingest(slug, rows.filter((row) => row && typeof row === \"object\"), ticket);\n\t\t\tthis.notifyCollection(slug);\n\t\t\tthis.scheduleRefresh(slug);\n\t\t};\n\t\tconst purged = (ids, ticket) => {\n\t\t\tfor (const id of ids) this.removeLocalRow(slug, id, ticket, true);\n\t\t\tthis.notifyCollection(slug);\n\t\t\tthis.scheduleRefresh(slug);\n\t\t};\n\t\treturn {\n\t\t\tfind: (params) => online(\"find()\", () => inner.trash.find(params)),\n\t\t\tcount: (params) => online(\"count()\", () => inner.trash.count(params)),\n\t\t\trestore: async (id, options) => {\n\t\t\t\tconst ticket = this.ticket() ?? await this.nextTicket();\n\t\t\t\tawait this.ensureCollection(slug);\n\t\t\t\tawait settleQueued(\"restore\", [id]);\n\t\t\t\tconst row = await online(\"restore()\", () => inner.trash.restore(id, options));\n\t\t\t\tawait restored(row ? [row] : [], ticket);\n\t\t\t\treturn row;\n\t\t\t},\n\t\t\trestoreMany: async (ids, options) => {\n\t\t\t\tconst ticket = this.ticket() ?? await this.nextTicket();\n\t\t\t\tawait this.ensureCollection(slug);\n\t\t\t\tif (!Array.isArray(ids)) throw invalidBulkBody(\"trash.restoreMany expects an array of ids.\");\n\t\t\t\tawait settleQueued(\"restore\", ids);\n\t\t\t\tconst rows = await online(\"restoreMany()\", () => inner.trash.restoreMany(ids, options));\n\t\t\t\tawait restored(rows, ticket);\n\t\t\t\treturn rows;\n\t\t\t},\n\t\t\tpurge: async (id, options) => {\n\t\t\t\tconst ticket = this.ticket() ?? await this.nextTicket();\n\t\t\t\tawait this.ensureCollection(slug);\n\t\t\t\tawait settleQueued(\"purge\", [id]);\n\t\t\t\tawait online(\"purge()\", () => inner.trash.purge(id, options));\n\t\t\t\tpurged([id], ticket);\n\t\t\t},\n\t\t\tpurgeMany: async (ids, options) => {\n\t\t\t\tconst ticket = this.ticket() ?? await this.nextTicket();\n\t\t\t\tawait this.ensureCollection(slug);\n\t\t\t\tif (!Array.isArray(ids)) throw invalidBulkBody(\"trash.purgeMany expects an array of ids.\");\n\t\t\t\tif (ids.length === 0) return;\n\t\t\t\tawait settleQueued(\"purge\", ids);\n\t\t\t\tawait online(\"purgeMany()\", () => inner.trash.purgeMany(ids, options));\n\t\t\t\tpurged(ids, ticket);\n\t\t\t}\n\t\t};\n\t}\n\tobserve(slug, wrapped, inner, params, onResult, onError, options) {\n\t\tlet closed = false;\n\t\tlet unlisten;\n\t\tconst observer = {\n\t\t\tslug,\n\t\t\tparams,\n\t\t\tsettled: false,\n\t\t\trefresh: () => wrapped.find(params).catch(() => void 0),\n\t\t\temit: () => {\n\t\t\t\tif (closed || !this.collections.get(slug)?.ready) return;\n\t\t\t\tconst result = this.answer(slug, params, this.snapshotFor(slug, params));\n\t\t\t\tconst signature = `${result.fromCache ? \"c\" : \"s\"}${result.hasPendingWrites ? \"p\" : \"-\"}` + this.signature(slug, result.data, result.meta.total);\n\t\t\t\tif (observer.settled && signature === observer.signature) return;\n\t\t\t\tobserver.signature = signature;\n\t\t\t\tobserver.settled = true;\n\t\t\t\tonResult(observer.error ? {\n\t\t\t\t\t...result,\n\t\t\t\t\terror: observer.error\n\t\t\t\t} : result);\n\t\t\t}\n\t\t};\n\t\tthis.observersFor(slug).add(observer);\n\t\t(async () => {\n\t\t\tawait this.ensureCollection(slug);\n\t\t\tif (closed) return;\n\t\t\tif (this.hasLocalAnswer(this.collections.get(slug), slug, params)) observer.emit();\n\t\t\ttry {\n\t\t\t\tawait wrapped.find(params);\n\t\t\t\tobserver.error = void 0;\n\t\t\t} catch (error) {\n\t\t\t\tobserver.error = error;\n\t\t\t\tif (closed) return;\n\t\t\t\tif (!observer.settled) {\n\t\t\t\t\tonError?.(error);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!closed) observer.emit();\n\t\t})();\n\t\tif (options?.realtime !== false && !isUnsupported(inner.listen)) unlisten = inner.listen(params, (response) => {\n\t\t\tconst ticket = this.ticket();\n\t\t\tif (!ticket || ticket.unverified) return;\n\t\t\tthis.ingest(slug, response.data ?? [], ticket, isProjection(params)).then(() => {\n\t\t\t\tthis.recordSnapshot(slug, params, response, ticket);\n\t\t\t\tthis.notifyCollection(slug, false);\n\t\t\t});\n\t\t}, onError);\n\t\treturn () => {\n\t\t\tclosed = true;\n\t\t\tthis.observersFor(slug).delete(observer);\n\t\t\tunlisten?.();\n\t\t};\n\t}\n\tobserveById(slug, wrapped, inner, id, onResult, onError, options) {\n\t\tconst read = byIdRead(options);\n\t\tlet closed = false;\n\t\tlet unlisten;\n\t\tconst observer = {\n\t\t\tslug,\n\t\t\tid,\n\t\t\tsettled: false,\n\t\t\trefresh: () => wrapped.findById(id, read).catch(() => void 0),\n\t\t\temit: () => {\n\t\t\t\tif (closed || !this.collections.get(slug)?.ready) return;\n\t\t\t\tconst row = this.localRow(slug, id);\n\t\t\t\tconst entry = this.collections.get(slug)?.rows.get(String(id));\n\t\t\t\tconst fromCache = !this.collections.get(slug)?.freshRows.has(String(id));\n\t\t\t\tconst hasPendingWrites = this.hasPending(slug, id);\n\t\t\t\tconst signature = `${fromCache ? \"c\" : \"s\"}${hasPendingWrites ? \"p\" : \"-\"}|` + (row === void 0 ? MISSING : `${String(id)}:${entry?.rev ?? 0}`);\n\t\t\t\tif (observer.settled && signature === observer.signature) return;\n\t\t\t\tobserver.signature = signature;\n\t\t\t\tobserver.settled = true;\n\t\t\t\tonResult(row, {\n\t\t\t\t\tfromCache,\n\t\t\t\t\thasPendingWrites\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\t\tthis.observersFor(slug).add(observer);\n\t\t(async () => {\n\t\t\tawait this.ensureCollection(slug);\n\t\t\tif (closed) return;\n\t\t\tif (this.localRow(slug, id) !== void 0) observer.emit();\n\t\t\ttry {\n\t\t\t\tawait wrapped.findById(id, read);\n\t\t\t} catch (error) {\n\t\t\t\tif (closed) return;\n\t\t\t\tif (!observer.settled) {\n\t\t\t\t\tonError?.(error);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!closed) observer.emit();\n\t\t})();\n\t\tif (options?.realtime !== false && !isUnsupported(inner.listenById)) unlisten = inner.listenById(id, (row) => {\n\t\t\tconst ticket = this.ticket();\n\t\t\tif (!ticket || ticket.unverified) return;\n\t\t\tif (!row) {\n\t\t\t\tif (!this.hasPending(slug, id)) this.removeLocalRow(slug, id, ticket, true);\n\t\t\t\tthis.notifyCollection(slug, false);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.ingest(slug, [row], ticket).then(() => this.notifyCollection(slug, false));\n\t\t}, onError, read);\n\t\treturn () => {\n\t\t\tclosed = true;\n\t\t\tthis.observersFor(slug).delete(observer);\n\t\t\tunlisten?.();\n\t\t};\n\t}\n\tobserversFor(slug) {\n\t\tlet set = this.observers.get(slug);\n\t\tif (!set) {\n\t\t\tset = /* @__PURE__ */ new Set();\n\t\t\tthis.observers.set(slug, set);\n\t\t}\n\t\treturn set;\n\t}\n\t/** Cheap change detection: which rows, in what order, at which revision. */\n\tsignature(slug, rows, total) {\n\t\tconst state = this.collections.get(slug);\n\t\treturn `${total}|${rows.map((row) => {\n\t\t\tconst key = String(row.id);\n\t\t\tconst entry = state?.rows.get(key);\n\t\t\treturn entry?.row === row ? `${key}:${entry.rev}` : `${key}=${JSON.stringify(row)}`;\n\t\t}).join(\",\")}`;\n\t}\n\tnotifyCollection(slug, broadcast = true) {\n\t\tconst set = this.observers.get(slug);\n\t\tif (set) for (const observer of [...set]) callSafely(() => observer.emit());\n\t\tif (broadcast) this.broadcast({\n\t\t\ttype: \"rows\",\n\t\t\tslugs: [slug]\n\t\t});\n\t}\n\t/** Connectivity came back (or the user changed): re-read everything live. */\n\trevalidateAll() {\n\t\tfor (const slug of this.observers.keys()) {\n\t\t\tthis.notifyCollection(slug, false);\n\t\t\tthis.scheduleRefresh(slug);\n\t\t}\n\t}\n\tcollectionState(slug) {\n\t\tlet state = this.collections.get(slug);\n\t\tif (!state) {\n\t\t\tstate = {\n\t\t\t\trows: /* @__PURE__ */ new Map(),\n\t\t\t\tsnapshots: /* @__PURE__ */ new Map(),\n\t\t\t\tfresh: /* @__PURE__ */ new Set(),\n\t\t\t\tfreshRows: /* @__PURE__ */ new Set(),\n\t\t\t\tabsent: /* @__PURE__ */ new Set(),\n\t\t\t\tready: false\n\t\t\t};\n\t\t\tthis.collections.set(slug, state);\n\t\t}\n\t\treturn state;\n\t}\n\tensureCollection(slug) {\n\t\tif (this.scopeHold) return this.scopeKnown().then(() => this.ensureCollection(slug));\n\t\tconst state = this.collectionState(slug);\n\t\tif (!state.loaded) {\n\t\t\tconst scope = this.scope;\n\t\t\tstate.loaded = (async () => {\n\t\t\t\tawait this.ensureQueueLoaded();\n\t\t\t\tconst [rows, snapshots, absent] = await Promise.all([\n\t\t\t\t\tthis.store.listCacheEntries(`${scope}|row|${slug}|`).catch(() => []),\n\t\t\t\t\tthis.store.listCacheEntries(`${scope}|q|${slug}|`).catch(() => []),\n\t\t\t\t\tthis.store.listCache(`${scope}|abs|${slug}|`).catch(() => [])\n\t\t\t\t]);\n\t\t\t\tif (this.scope !== scope || this.collections.get(slug) !== state) return;\n\t\t\t\tfor (const entry of rows) {\n\t\t\t\t\tconst row = entry.value;\n\t\t\t\t\tif (!row || row.id === void 0 || row.id === null) continue;\n\t\t\t\t\tstate.rows.set(String(row.id), {\n\t\t\t\t\t\trow: hydrateRow(row),\n\t\t\t\t\t\tcachedAt: entry.cachedAt,\n\t\t\t\t\t\trev: ++this.revCounter\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tfor (const entry of snapshots) {\n\t\t\t\t\tconst key = entry.key.slice(`${scope}|q|${slug}|`.length);\n\t\t\t\t\tif (entry.value) state.snapshots.set(key, readSnapshot(entry.value));\n\t\t\t\t}\n\t\t\t\tfor (const entry of absent) state.absent.add(entry.key.slice(`${scope}|abs|${slug}|`.length));\n\t\t\t})().catch(() => void 0).finally(() => {\n\t\t\t\tstate.ready = true;\n\t\t\t});\n\t\t}\n\t\treturn state.loaded.then(() => state);\n\t}\n\tsnapshotFor(slug, params) {\n\t\treturn this.collections.get(slug)?.snapshots.get(buildQueryString(params));\n\t}\n\thasLocalAnswer(state, slug, params) {\n\t\tif (!state) return false;\n\t\treturn state.snapshots.has(buildQueryString(params)) || state.rows.size > 0;\n\t}\n\t/**\n\t* Answer a query from the local database.\n\t*\n\t* With a snapshot, the server's own page — its ids, order and total — is\n\t* the skeleton, and the local rows fill it in: rows deleted locally drop\n\t* out, rows edited locally show the edit, and rows *created* locally join\n\t* the first page if they match. Without one, the query is evaluated\n\t* outright over every cached row, which is the best that can be done for a\n\t* query the server has never answered here.\n\t*/\n\tanswer(slug, params, snapshot) {\n\t\tconst state = this.collections.get(slug);\n\t\tconst exact = isExactlyEvaluable(params);\n\t\tconst fromCache = !state?.fresh.has(buildQueryString(params));\n\t\tif (!state) return {\n\t\t\tdata: [],\n\t\t\tmeta: {\n\t\t\t\t...resolvePagination(params),\n\t\t\t\ttotal: 0,\n\t\t\t\thasMore: false\n\t\t\t},\n\t\t\tfromCache: true,\n\t\t\thasPendingWrites: false,\n\t\t\tpartial: true\n\t\t};\n\t\tif (!snapshot) {\n\t\t\tconst local = runLocalQuery([...state.rows.values()].map((e) => e.row), params);\n\t\t\treturn {\n\t\t\t\t...local,\n\t\t\t\tfromCache,\n\t\t\t\thasPendingWrites: local.data.some((row) => this.hasPending(slug, row.id)),\n\t\t\t\tpartial: true\n\t\t\t};\n\t\t}\n\t\tif (snapshot.rows) return this.projectedAnswer(slug, params, snapshot, snapshot.rows, fromCache);\n\t\tconst rows = [];\n\t\tconst seen = /* @__PURE__ */ new Set();\n\t\t/** Rows the server counted that we know are no longer in the result. */\n\t\tlet removed = 0;\n\t\tfor (const id of snapshot.ids) {\n\t\t\tconst key = String(id);\n\t\t\tconst entry = state.rows.get(key);\n\t\t\tif (!entry) {\n\t\t\t\tif (state.absent.has(key) || this.hasPending(slug, key)) removed++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (exact && this.hasPending(slug, key) && !matchesParams(entry.row, params)) {\n\t\t\t\tremoved++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\trows.push(entry.row);\n\t\t\tseen.add(key);\n\t\t}\n\t\tlet added = 0;\n\t\tconst offset = snapshot.offset ?? 0;\n\t\tif (exact && offset === 0) for (const [key, entry] of state.rows) {\n\t\t\tif (seen.has(key) || !this.hasPending(slug, key)) continue;\n\t\t\tif (!this.isLocallyCreated(slug, key) && !this.movedIntoFilter(slug, key, params)) continue;\n\t\t\tif (!matchesParams(entry.row, params)) continue;\n\t\t\trows.push(entry.row);\n\t\t\tadded++;\n\t\t}\n\t\tconst orderIsLocal = isLocallySortable(rows, params?.orderBy);\n\t\tconst sorted = Boolean(params?.orderBy && orderIsLocal);\n\t\tif (sorted) sortRows(rows, params.orderBy);\n\t\tconst total = Math.max(rows.length, snapshot.total - removed + added);\n\t\tconst page = fitToLimit(rows, snapshot.limit, added, sorted);\n\t\treturn {\n\t\t\tdata: page,\n\t\t\tmeta: {\n\t\t\t\ttotal,\n\t\t\t\tlimit: snapshot.limit,\n\t\t\t\toffset,\n\t\t\t\thasMore: snapshot.hasMore || page.length < rows.length\n\t\t\t},\n\t\t\tfromCache,\n\t\t\thasPendingWrites: rows.some((row) => this.hasPending(slug, row.id)),\n\t\t\tpartial: !exact || !orderIsLocal\n\t\t};\n\t}\n\t/**\n\t* Answer a projected query (`fields`, `distinct`) from the server's own\n\t* answer to it.\n\t*\n\t* The server's rows are the answer. The local database contributes only\n\t* what it knows better: a row with unsynced writes shows them, narrowed to\n\t* the columns the server sent, or drops out if it was deleted here or\n\t* edited out of a filter this side can evaluate; and rows created here\n\t* join the first page when there is somewhere to put them. A distinct\n\t* query, or an order on a column the projection does not carry, leaves\n\t* them out, and the result says it is partial.\n\t*/\n\tprojectedAnswer(slug, params, snapshot, served, fromCache) {\n\t\tconst state = this.collectionState(slug);\n\t\tconst exact = isExactlyEvaluable(params);\n\t\tconst rows = [];\n\t\tconst seen = /* @__PURE__ */ new Set();\n\t\tlet removed = 0;\n\t\tfor (const row of served) {\n\t\t\tconst key = row.id === void 0 || row.id === null ? void 0 : String(row.id);\n\t\t\tif (key !== void 0) seen.add(key);\n\t\t\tif (key === void 0 || !this.hasPending(slug, key)) {\n\t\t\t\trows.push(row);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst local = state.rows.get(key)?.row;\n\t\t\tif (!local || exact && !matchesParams(local, params)) {\n\t\t\t\tremoved++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\trows.push(pick(local, Object.keys(row)));\n\t\t}\n\t\tlet added = 0;\n\t\tlet unplaced = false;\n\t\tconst offset = snapshot.offset ?? 0;\n\t\tif (exact && offset === 0) {\n\t\t\tconst shape = served.length > 0 ? Object.keys(served[0]) : [\"id\", ...params?.fields ?? []];\n\t\t\tconst placeable = !params?.distinct && (normalizeOrderBy(params?.orderBy) ?? []).every(([field]) => shape.includes(field));\n\t\t\tfor (const [key, entry] of state.rows) {\n\t\t\t\tif (seen.has(key) || !this.hasPending(slug, key)) continue;\n\t\t\t\tif (!this.isLocallyCreated(slug, key) && !this.movedIntoFilter(slug, key, params)) continue;\n\t\t\t\tif (!matchesParams(entry.row, params)) continue;\n\t\t\t\tif (!placeable) {\n\t\t\t\t\tunplaced = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\trows.push(pick(entry.row, shape));\n\t\t\t\tadded++;\n\t\t\t}\n\t\t}\n\t\tconst orderIsLocal = added === 0 || isLocallySortable(rows, params?.orderBy);\n\t\tconst sorted = Boolean(added > 0 && params?.orderBy && orderIsLocal);\n\t\tif (sorted) sortRows(rows, params.orderBy);\n\t\tconst page = fitToLimit(rows, snapshot.limit, added, sorted);\n\t\treturn {\n\t\t\tdata: page,\n\t\t\tmeta: {\n\t\t\t\ttotal: Math.max(rows.length, snapshot.total - removed + added),\n\t\t\t\tlimit: snapshot.limit,\n\t\t\t\toffset,\n\t\t\t\thasMore: snapshot.hasMore || page.length < rows.length\n\t\t\t},\n\t\t\tfromCache,\n\t\t\thasPendingWrites: rows.some((row) => row.id !== void 0 && row.id !== null && this.hasPending(slug, row.id)),\n\t\t\tpartial: !exact || !orderIsLocal || unplaced\n\t\t};\n\t}\n\tlocalFind(slug, params) {\n\t\tconst state = this.collections.get(slug);\n\t\tconst snapshot = this.snapshotFor(slug, params);\n\t\tstate?.fresh.delete(buildQueryString(params));\n\t\tif (!snapshot && (!state || state.rows.size === 0)) throw offlineError(`Offline: no cached data for \"${slug}\".`);\n\t\tconst answer = this.answer(slug, params, snapshot);\n\t\treturn snapshot ? answer : {\n\t\t\t...answer,\n\t\t\tpartial: true\n\t\t};\n\t}\n\t/**\n\t* A temporary id of the type this collection's ids actually have.\n\t*\n\t* There is no schema here to read it off — the generated `Database` types\n\t* are erased at compile time, and the whole point of this path is that the\n\t* server is unreachable. So it is read off the rows the local database\n\t* already holds: a collection whose cached ids are numbers gets a negative\n\t* number, and everything else gets a UUID.\n\t*\n\t* A collection with nothing cached falls back to a UUID, which is the same\n\t* guess as before — but that is a first write on a device that has never\n\t* read the collection, which is also the case where nothing local can tell\n\t* the difference. Reading one row first is enough to fix it.\n\t*/\n\tmintOfflineId(slug) {\n\t\tfor (const entry of this.collections.get(slug)?.rows.values() ?? []) {\n\t\t\tconst id = entry.row.id;\n\t\t\tif (typeof id === \"number\") return generateOfflineNumericId();\n\t\t\tif (typeof id === \"string\") break;\n\t\t}\n\t\treturn generateOfflineStringId();\n\t}\n\t/**\n\t* Keep the version a server row came with, or forget the one held when it\n\t* came with none: a row from a list carries no version, and may be newer\n\t* than the one held. Only with `onConflict`, the one reader of it.\n\t*/\n\tnoteETag(state, key, row) {\n\t\tif (!this.onConflict) return;\n\t\tconst etag = etagOf(row);\n\t\tif (etag) (state.etags ??= /* @__PURE__ */ new Map()).set(key, etag);\n\t\telse state.etags?.delete(key);\n\t}\n\tetagFor(slug, id) {\n\t\treturn this.collections.get(slug)?.etags?.get(String(id));\n\t}\n\trawLocalRow(slug, id) {\n\t\tconst entry = this.collections.get(slug)?.rows.get(String(id));\n\t\treturn entry ? { ...entry.row } : void 0;\n\t}\n\tlocalRow(slug, id) {\n\t\treturn this.collections.get(slug)?.rows.get(String(id))?.row;\n\t}\n\tsetLocalRow(slug, id, row, ticket) {\n\t\tif (!this.isCurrent(ticket)) return;\n\t\tconst state = this.collectionState(slug);\n\t\tconst key = String(id);\n\t\tconst cachedAt = Date.now();\n\t\tstate.rows.set(key, {\n\t\t\trow: { ...row },\n\t\t\tcachedAt,\n\t\t\trev: ++this.revCounter\n\t\t});\n\t\tstate.freshRows.delete(key);\n\t\tthis.forgetTombstone(slug, key);\n\t\tthis.writeCache(this.rowKey(slug, key), dehydrateRow(row), cachedAt);\n\t\tthis.evictRows(slug);\n\t}\n\t/**\n\t* Drop a row and, when the server is the one saying it is gone, remember\n\t* that. \"I looked it up and it does not exist\" is real knowledge: without\n\t* it, opening a deleted row while offline would report a missing local\n\t* database instead of a missing row.\n\t*/\n\tremoveLocalRow(slug, id, ticket, known = false) {\n\t\tif (!this.isCurrent(ticket)) return;\n\t\tif (known && ticket.unverified) return;\n\t\tconst state = this.collectionState(slug);\n\t\tconst key = String(id);\n\t\tconst existed = state.rows.delete(key);\n\t\tstate.etags?.delete(key);\n\t\tif (known) {\n\t\t\tstate.absent.add(key);\n\t\t\tstate.freshRows.add(key);\n\t\t\tthis.writeCache(this.absentKey(slug, key), true);\n\t\t\tthis.capTombstones(slug);\n\t\t} else state.freshRows.delete(key);\n\t\tif (existed) this.deleteCache([this.rowKey(slug, key)]);\n\t}\n\tforgetTombstone(slug, key) {\n\t\tif (!this.collectionState(slug).absent.delete(key)) return;\n\t\tthis.deleteCache([this.absentKey(slug, key)]);\n\t}\n\t/**\n\t* Merge server rows into the local database. A row with unsynced local\n\t* writes keeps them: the server's copy is the base the queued mutations\n\t* are re-applied to, not a replacement for what the user did.\n\t*\n\t* Rows that came back unchanged keep their identity and revision, so a\n\t* refetch that changed nothing does not re-render every live query that\n\t* touches them — or rewrite them all to disk.\n\t*\n\t* A `projection` (see {@link isProjection}) only refreshes the columns it\n\t* carries on rows already held, and never creates one. It is not a row:\n\t* stored as one, it replaced the full row every other query reads and\n\t* wrote the narrowed copy to disk, so a list lost its columns because a\n\t* dropdown elsewhere asked for titles.\n\t*/\n\tasync ingest(slug, rows, ticket, projection = false) {\n\t\tif (rows.length === 0 || !this.isCurrent(ticket) || ticket.unverified) return;\n\t\tconst state = await this.ensureCollection(slug);\n\t\tif (!this.isCurrent(ticket)) return;\n\t\tconst cachedAt = Date.now();\n\t\tconst writes = [];\n\t\tconst deletes = [];\n\t\tfor (const raw of rows) {\n\t\t\tif (!raw || raw.id === void 0 || raw.id === null) continue;\n\t\t\tconst key = String(raw.id);\n\t\t\tthis.noteETag(state, key, raw);\n\t\t\tconst existing = state.rows.get(key);\n\t\t\tif (projection && !existing) continue;\n\t\t\tconst base = projection && existing ? {\n\t\t\t\t...existing.row,\n\t\t\t\t...raw\n\t\t\t} : { ...raw };\n\t\t\tconst merged = this.hasPending(slug, key) ? this.applyPendingToRow(slug, key, base) : base;\n\t\t\tif (merged === void 0) {\n\t\t\t\tstate.rows.delete(key);\n\t\t\t\tdeletes.push(this.rowKey(slug, key));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthis.forgetTombstone(slug, key);\n\t\t\tif (!projection) state.freshRows.add(key);\n\t\t\tif (existing && JSON.stringify(existing.row) === JSON.stringify(merged)) {\n\t\t\t\texisting.cachedAt = cachedAt;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tstate.rows.set(key, {\n\t\t\t\trow: merged,\n\t\t\t\tcachedAt,\n\t\t\t\trev: ++this.revCounter\n\t\t\t});\n\t\t\twrites.push({\n\t\t\t\tkey: this.rowKey(slug, key),\n\t\t\t\tentry: {\n\t\t\t\t\tvalue: dehydrateRow(merged),\n\t\t\t\t\tcachedAt\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tif (writes.length > 0) this.store.setCacheMany(writes).catch(() => void 0);\n\t\tif (deletes.length > 0) this.deleteCache(deletes);\n\t\tthis.evictRows(slug);\n\t}\n\t/**\n\t* Fold the queued mutations for one row over a base, newest last.\n\t* `afterMutationId` skips everything up to and including that mutation,\n\t* which is how a just-replayed write avoids being applied on top of the\n\t* server's response to it.\n\t*/\n\tapplyPendingToRow(slug, idKey, base, afterMutationId) {\n\t\tlet row = base;\n\t\tlet skipping = afterMutationId !== void 0;\n\t\tfor (const op of this.queue) {\n\t\t\tif (skipping) {\n\t\t\t\tif (op.mutationId === afterMutationId) skipping = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (op.collection !== slug) continue;\n\t\t\tif (op.type === \"createMany\") {\n\t\t\t\tconst match = op.data?.find((r) => String(r.id) === idKey);\n\t\t\t\tif (match) row = { ...match };\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (op.type === \"updateMany\") {\n\t\t\t\tconst update = op.updates?.find((u) => String(u.id) === idKey);\n\t\t\t\tif (update) row = {\n\t\t\t\t\t...row ?? {},\n\t\t\t\t\t...update.data,\n\t\t\t\t\tid: update.id\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (op.type === \"deleteMany\") {\n\t\t\t\tif (op.ids?.some((id) => String(id) === idKey)) row = void 0;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (op.id === void 0 || String(op.id) !== idKey) continue;\n\t\t\tif (op.type === \"create\") row = { ...op.data };\n\t\t\telse if (op.type === \"update\") row = {\n\t\t\t\t...row ?? {},\n\t\t\t\t...op.data,\n\t\t\t\tid: op.id\n\t\t\t};\n\t\t\telse if (op.type === \"delete\") row = void 0;\n\t\t}\n\t\treturn row;\n\t}\n\trecordSnapshot(slug, params, result, ticket) {\n\t\tconst window = resolvePagination(params);\n\t\tconst meta = result.meta ?? {\n\t\t\ttotal: result.data?.length ?? 0,\n\t\t\t...window,\n\t\t\thasMore: false\n\t\t};\n\t\tconst snapshot = {\n\t\t\tids: (result.data ?? []).map((row) => row.id).filter((id) => id !== void 0),\n\t\t\ttotal: meta.total ?? result.data?.length ?? 0,\n\t\t\tlimit: meta.limit ?? window.limit,\n\t\t\toffset: meta.offset ?? window.offset,\n\t\t\thasMore: meta.hasMore ?? false,\n\t\t\t...isProjection(params) ? { rows: (result.data ?? []).map((row) => ({ ...row })) } : {}\n\t\t};\n\t\tif (!this.isCurrent(ticket) || ticket.unverified) return snapshot;\n\t\tconst state = this.collectionState(slug);\n\t\tconst key = buildQueryString(params);\n\t\tstate.snapshots.set(key, snapshot);\n\t\tstate.fresh.add(key);\n\t\tthis.writeCache(`${this.scope}|q|${slug}|${key}`, snapshot.rows ? {\n\t\t\t...snapshot,\n\t\t\trows: snapshot.rows.map((row) => dehydrateRow(row))\n\t\t} : snapshot);\n\t\tthis.evictSnapshots(slug);\n\t\treturn snapshot;\n\t}\n\t/**\n\t* A write changed which rows belong in a list, and only the server can say\n\t* how — a row it generated is in no cached page, and the totals moved.\n\t* Re-run every live query on the collection; queries nobody is watching\n\t* are corrected by their next `find`.\n\t*\n\t* Coalesced per microtask so a burst of writes costs one round trip, and\n\t* skipped entirely while offline, where the local database is already the\n\t* best answer available.\n\t*/\n\tscheduleRefresh(slug) {\n\t\tif (this.refreshPending.has(slug)) return;\n\t\tconst observers = this.observers.get(slug);\n\t\tif (!observers || observers.size === 0) return;\n\t\tthis.refreshPending.add(slug);\n\t\tPromise.resolve().then(() => {\n\t\t\tthis.refreshPending.delete(slug);\n\t\t\tif (this.disposed || !this.connectivity.shouldAttempt()) return;\n\t\t\tfor (const observer of [...this.observers.get(slug) ?? []]) observer.refresh();\n\t\t});\n\t}\n\tevictRows(slug) {\n\t\tconst state = this.collections.get(slug);\n\t\tif (!state || state.rows.size <= this.maxCachedRows) return;\n\t\tconst evictable = [...state.rows.entries()].filter(([key]) => !this.hasPending(slug, key)).sort((a, b) => a[1].cachedAt - b[1].cachedAt);\n\t\tconst excess = state.rows.size - this.maxCachedRows;\n\t\tconst doomed = evictable.slice(0, excess);\n\t\tfor (const [key] of doomed) {\n\t\t\tstate.rows.delete(key);\n\t\t\tstate.etags?.delete(key);\n\t\t}\n\t\tif (doomed.length > 0) this.deleteCache(doomed.map(([key]) => this.rowKey(slug, key)));\n\t}\n\t/**\n\t* Tombstones are tiny but unbounded — every row the app ever asked for and\n\t* did not find leaves one. Capped against the row budget, oldest first,\n\t* whenever one is added: the cap used to sit behind the row cache's own\n\t* early return, so it only applied once the rows were over theirs, and\n\t* looking up missing ids grew the set without limit.\n\t*/\n\tcapTombstones(slug) {\n\t\tconst state = this.collections.get(slug);\n\t\tif (!state || state.absent.size <= this.maxCachedRows) return;\n\t\tconst stale = [...state.absent].slice(0, state.absent.size - this.maxCachedRows);\n\t\tfor (const key of stale) state.absent.delete(key);\n\t\tthis.deleteCache(stale.map((key) => this.absentKey(slug, key)));\n\t}\n\tevictSnapshots(slug) {\n\t\tconst state = this.collections.get(slug);\n\t\tif (!state || state.snapshots.size <= this.maxCachedQueries) return;\n\t\tconst excess = state.snapshots.size - this.maxCachedQueries;\n\t\tconst doomed = [...state.snapshots.keys()].slice(0, excess);\n\t\tfor (const key of doomed) {\n\t\t\tstate.snapshots.delete(key);\n\t\t\tstate.fresh.delete(key);\n\t\t}\n\t\tthis.deleteCache(doomed.map((key) => `${this.scope}|q|${slug}|${key}`));\n\t}\n\tensureQueueLoaded() {\n\t\tif (this.scopeHold) return this.scopeKnown().then(() => this.ensureQueueLoaded());\n\t\tif (!this.queueLoad) {\n\t\t\tconst scope = this.scope;\n\t\t\tthis.queueLoad = this.readQueue(`${scope}|`).then((queue) => {\n\t\t\t\tif (this.scope !== scope) return;\n\t\t\t\tthis.queue = queue;\n\t\t\t\tthis.patchStatus({ pending: queue.length });\n\t\t\t\tthis.notifyQueue();\n\t\t\t}).catch(() => void 0);\n\t\t}\n\t\treturn this.queueLoad;\n\t}\n\tenqueue(mutation, ticket) {\n\t\tconst result = this.enqueueChain.then(async () => {\n\t\t\tawait this.ensureQueueLoaded();\n\t\t\tif (!this.isCurrent(ticket)) {\n\t\t\t\tconst orphan = {\n\t\t\t\t\t...mutation,\n\t\t\t\t\tmutationId: createMutationId(),\n\t\t\t\t\tqueuedAt: Date.now(),\n\t\t\t\t\tschemaVersion: 1\n\t\t\t\t};\n\t\t\t\tawait this.persistMutation(`${ticket.scope}|${orphan.mutationId}`, orphan);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (mutation.type === \"update\") {\n\t\t\t\tconst tail = this.queue[this.queue.length - 1];\n\t\t\t\tif (tail && !this.inFlight.has(tail.mutationId) && tail.sent === void 0 && (tail.schemaVersion ?? 1) <= 1 && tail.collection === mutation.collection && (tail.type === \"create\" || tail.type === \"update\") && tail.id === mutation.id && (mutation.ifMatch === void 0 || mutation.ifMatch === tail.ifMatch)) {\n\t\t\t\t\tif (tail.type === \"update\") tail.parts = [...tail.parts ?? [{ ...tail.data }], { ...mutation.data }];\n\t\t\t\t\ttail.data = {\n\t\t\t\t\t\t...tail.data,\n\t\t\t\t\t\t...mutation.data,\n\t\t\t\t\t\tid: tail.id\n\t\t\t\t\t};\n\t\t\t\t\tawait this.persistMutation(this.queueKey(tail), tail);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (mutation.type === \"delete\") {\n\t\t\t\tif (this.queue.some((m) => m.collection === mutation.collection && m.type === \"create\" && m.id === mutation.id && m.generatedId === true && m.sent === void 0 && !this.inFlight.has(m.mutationId))) {\n\t\t\t\t\tconst doomed = this.queue.filter((m) => m.collection === mutation.collection && m.id === mutation.id && (m.type === \"create\" || m.type === \"update\") && !this.inFlight.has(m.mutationId));\n\t\t\t\t\tfor (const op of doomed) await this.store.dequeue(this.queueKey(op));\n\t\t\t\t\tthis.queue = this.queue.filter((m) => !doomed.includes(m));\n\t\t\t\t\tthis.afterQueueChange();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst full = {\n\t\t\t\t...mutation,\n\t\t\t\tmutationId: createMutationId(),\n\t\t\t\tqueuedAt: Date.now(),\n\t\t\t\tschemaVersion: 1\n\t\t\t};\n\t\t\tawait this.persistMutation(this.queueKey(full), full);\n\t\t\tthis.queue.push(full);\n\t\t\tthis.queueChangedInPlace();\n\t\t\tthis.afterQueueChange();\n\t\t\tthis.requestPersistence();\n\t\t});\n\t\tthis.enqueueChain = result.catch(() => void 0);\n\t\treturn result;\n\t}\n\t/**\n\t* Ask the browser to keep the offline database, once, when there is first\n\t* something in it worth keeping. Without it IndexedDB is best-effort\n\t* storage, evicted under pressure (and by Safari after seven days without\n\t* a visit) with the unsent writes in it.\n\t*/\n\trequestPersistence() {\n\t\tif (this.persistenceRequested || !(this.store instanceof IndexedDBOfflineStore)) return;\n\t\tthis.persistenceRequested = true;\n\t\tconst storage = globalThis.navigator?.storage;\n\t\tif (typeof storage?.persist !== \"function\") return;\n\t\tstorage.persist().then((persisted) => this.patchStatus({ persisted }), () => void 0);\n\t}\n\t/** The queue's row ids for one collection — see {@link pendingIndex}. */\n\tpendingIds(slug) {\n\t\tif (!this.pendingIndex) {\n\t\t\tconst index = /* @__PURE__ */ new Map();\n\t\t\tconst note = (entry, key, op) => {\n\t\t\t\tentry.writes.add(key);\n\t\t\t\tif (!entry.first.has(key)) entry.first.set(key, op);\n\t\t\t};\n\t\t\tfor (const op of this.queue) {\n\t\t\t\tlet entry = index.get(op.collection);\n\t\t\t\tif (!entry) index.set(op.collection, entry = {\n\t\t\t\t\twrites: /* @__PURE__ */ new Set(),\n\t\t\t\t\tcreates: /* @__PURE__ */ new Set(),\n\t\t\t\t\tfirst: /* @__PURE__ */ new Map()\n\t\t\t\t});\n\t\t\t\tif (op.type === \"createMany\") for (const row of op.data ?? []) {\n\t\t\t\t\tnote(entry, String(row.id), op);\n\t\t\t\t\tentry.creates.add(String(row.id));\n\t\t\t\t}\n\t\t\t\telse if (op.type === \"updateMany\") for (const update of op.updates ?? []) note(entry, String(update.id), op);\n\t\t\t\telse if (op.type === \"deleteMany\") for (const id of op.ids ?? []) note(entry, String(id), op);\n\t\t\t\telse if (op.id !== void 0) {\n\t\t\t\t\tnote(entry, String(op.id), op);\n\t\t\t\t\tif (op.type === \"create\") entry.creates.add(String(op.id));\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.pendingIndex = index;\n\t\t}\n\t\treturn this.pendingIndex.get(slug);\n\t}\n\t/**\n\t* Did the queued writes to this row bring it into the query's filter? The\n\t* row as it was before the first of them is that write's rollback; one\n\t* that did not match then is in no server page of the query, so only\n\t* this side can put it on screen.\n\t*/\n\tmovedIntoFilter(slug, idKey, params) {\n\t\tconst before = this.pendingIds(slug)?.first.get(idKey)?.rollback?.rows?.[idKey];\n\t\treturn before !== void 0 && before !== null && !matchesParams(before, params);\n\t}\n\t/** The queue's entries were changed without replacing the array. */\n\tqueueChangedInPlace() {\n\t\tthis.pendingIndex = void 0;\n\t}\n\thasPending(slug, id) {\n\t\treturn this.pendingIds(slug)?.writes.has(String(id)) ?? false;\n\t}\n\t/** Is this row one the server has never been told about? */\n\tisLocallyCreated(slug, idKey) {\n\t\treturn this.pendingIds(slug)?.creates.has(idKey) ?? false;\n\t}\n\t/** How many rows the queue adds to (or removes from) a server-side count. */\n\tpendingDelta(slug, params) {\n\t\tif (!isExactlyEvaluable(params)) return 0;\n\t\tconst counts = (row) => row && matchesParams(row, params) ? 1 : 0;\n\t\tconst before = (op, id) => id === void 0 ? void 0 : op.rollback?.rows?.[String(id)];\n\t\tlet delta = 0;\n\t\tfor (const op of this.queue) {\n\t\t\tif (op.collection !== slug) continue;\n\t\t\tif (op.type === \"create\" || op.type === \"createMany\") {\n\t\t\t\tconst rows = op.type === \"create\" ? [op.data] : op.data ?? [];\n\t\t\t\tfor (const row of rows) delta += counts(row) - counts(before(op, row?.id));\n\t\t\t} else if (op.type === \"update\") {\n\t\t\t\tconst was = before(op, op.id);\n\t\t\t\tif (was) delta += counts({\n\t\t\t\t\t...was,\n\t\t\t\t\t...op.data\n\t\t\t\t}) - counts(was);\n\t\t\t} else if (op.type === \"updateMany\") for (const update of op.updates ?? []) {\n\t\t\t\tconst was = before(op, update.id);\n\t\t\t\tif (was) delta += counts({\n\t\t\t\t\t...was,\n\t\t\t\t\t...update.data\n\t\t\t\t}) - counts(was);\n\t\t\t}\n\t\t\telse if (op.type === \"delete\") delta -= counts(before(op, op.id));\n\t\t\telse if (op.type === \"deleteMany\") for (const id of op.ids ?? []) delta -= counts(before(op, id));\n\t\t}\n\t\treturn delta;\n\t}\n\tsync() {\n\t\tif (this.flushPromise) return this.flushPromise;\n\t\tconst run = () => this.withLock(() => this.flush());\n\t\tthis.flushPromise = (this.scopeHold ? this.scopeKnown().then(run) : run()).finally(() => {\n\t\t\tthis.flushPromise = void 0;\n\t\t});\n\t\treturn this.flushPromise;\n\t}\n\tasync flush() {\n\t\tconst ticket = this.ticket() ?? await this.nextTicket();\n\t\tawait this.ensureQueueLoaded();\n\t\tawait this.reloadQueue();\n\t\tif (this.queue.length === 0) return {\n\t\t\tflushed: 0,\n\t\t\tremaining: 0\n\t\t};\n\t\tif (this.unverified) return {\n\t\t\tflushed: 0,\n\t\t\tremaining: this.queue.length\n\t\t};\n\t\tthis.patchStatus({ syncing: true });\n\t\tconst touched = /* @__PURE__ */ new Set();\n\t\tconst queuedAtStart = this.queue.length;\n\t\tlet flushed = 0;\n\t\tconst unbatched = /* @__PURE__ */ new Set();\n\t\ttry {\n\t\t\twhile (this.queue.length > 0 && !this.disposed && this.isCurrent(ticket)) {\n\t\t\t\tconst op = this.queue[0];\n\t\t\t\tif ((op.schemaVersion ?? 1) > 1) {\n\t\t\t\t\tthis.patchStatus({ lastError: `A queued write was saved by a newer version of the SDK (layout ${String(op.schemaVersion)}); it is kept, and replays once this page runs that version.` });\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\ttouched.add(op.collection);\n\t\t\t\tconst run = this.foldableRun(unbatched);\n\t\t\t\tif (run.length > 1) {\n\t\t\t\t\tconst outcome = await this.replayRun(run, ticket);\n\t\t\t\t\tif (outcome === \"offline\") break;\n\t\t\t\t\tif (outcome === \"unbatch\") {\n\t\t\t\t\t\tfor (const member of run) unbatched.add(member.mutationId);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tflushed += run.length;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tthis.inFlight.add(op.mutationId);\n\t\t\t\ttry {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait this.replay(op, ticket);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tif (isNetworkError(error)) {\n\t\t\t\t\t\t\tthis.connectivity.markFailure();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ((op.type === \"update\" || op.type === \"delete\") && op.ifMatch && this.onConflict && isPreconditionFailed(error)) {\n\t\t\t\t\t\t\tthis.connectivity.markSuccess();\n\t\t\t\t\t\t\tawait this.resolveConflict(op, error, ticket);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\top.attempts = (op.attempts ?? 0) + 1;\n\t\t\t\t\t\top.lastError = error?.message ?? String(error);\n\t\t\t\t\t\tconst limit = isIdempotencyInProgressError(error) ? Math.max(this.maxRetries, IN_PROGRESS_MIN_RETRIES) : this.maxRetries;\n\t\t\t\t\t\tif (isRetryableError(error) && op.attempts < limit) {\n\t\t\t\t\t\t\tawait this.persistMutation(`${ticket.scope}|${op.mutationId}`, op).catch(() => void 0);\n\t\t\t\t\t\t\tthis.connectivity.deferRetry();\n\t\t\t\t\t\t\tthis.patchStatus({ lastError: op.lastError });\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (op.type === \"delete\" && isNotFoundError(error)) {\n\t\t\t\t\t\t\tthis.connectivity.markSuccess();\n\t\t\t\t\t\t\tthis.removeLocalRow(op.collection, op.id, ticket, true);\n\t\t\t\t\t\t\tawait this.drop(op, ticket);\n\t\t\t\t\t\t\tflushed++;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (isFieldRefusal(error) && (op.parts?.length ?? 0) > 1) {\n\t\t\t\t\t\t\tawait this.splitCoalesced(op, ticket);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tawait this.rejectMutation(op, error, ticket);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tthis.connectivity.markSuccess();\n\t\t\t\t\tawait this.drop(op, ticket);\n\t\t\t\t\tflushed++;\n\t\t\t\t} finally {\n\t\t\t\t\tthis.inFlight.delete(op.mutationId);\n\t\t\t\t}\n\t\t\t}\n\t\t} finally {\n\t\t\tthis.patchStatus({ syncing: false });\n\t\t}\n\t\tif (!this.isCurrent(ticket)) return {\n\t\t\tflushed,\n\t\t\tremaining: this.queue.length\n\t\t};\n\t\tif (this.queue.length !== queuedAtStart) {\n\t\t\tfor (const slug of touched) {\n\t\t\t\tthis.notifyCollection(slug);\n\t\t\t\tthis.scheduleRefresh(slug);\n\t\t\t}\n\t\t\tthis.broadcast({ type: \"queue\" });\n\t\t}\n\t\tif (this.queue.length === 0) this.patchStatus({ lastSyncedAt: Date.now() });\n\t\treturn {\n\t\t\tflushed,\n\t\t\tremaining: this.queue.length\n\t\t};\n\t}\n\t/**\n\t* The creates at the head of the queue that may replay as one request —\n\t* see {@link OfflineConfig.replayBatchSize}. Fewer than two means the head\n\t* replays on its own.\n\t*\n\t* Consecutive, so the queue's order holds; one collection, since a bulk\n\t* write is one collection's. Each is a create never sent (so its request\n\t* is still its own to choose) with an id the SDK minted as a string — a\n\t* lost answer then cannot duplicate it, because the server refuses that\n\t* id the second time and the single replay recognises the row as its\n\t* own. A create whose values name another member's minted id waits: the\n\t* server may give that row a different id, which only a replay one at a\n\t* time can carry over.\n\t*/\n\tfoldableRun(unbatched) {\n\t\tif (this.replayBatchSize < 2) return [];\n\t\tconst head = this.queue[0];\n\t\tconst resent = head?.sent?.run;\n\t\tconst foldable = (op, collection) => op !== void 0 && op.type === \"create\" && op.generatedId === true && typeof op.id === \"string\" && (resent === void 0 ? op.sent === void 0 : op.sent?.run === resent) && !op.upsert && (op.schemaVersion ?? 1) <= 1 && !unbatched.has(op.mutationId) && (collection === void 0 || op.collection === collection);\n\t\tif (!foldable(head)) return [];\n\t\tconst run = [head];\n\t\tfor (let i = 1; i < this.queue.length && (resent !== void 0 || run.length < this.replayBatchSize); i++) {\n\t\t\tconst next = this.queue[i];\n\t\t\tif (!foldable(next, head.collection)) break;\n\t\t\tif (run.some((member) => mentionsMintedId(next, member.id))) break;\n\t\t\trun.push(next);\n\t\t}\n\t\tif (resent !== void 0 && runKey(run) !== resent) return [];\n\t\treturn run;\n\t}\n\t/**\n\t* Replay a {@link foldableRun} as one `createMany`.\n\t*\n\t* - `\"done\"`: every member is acknowledged, adopted and dropped.\n\t* - `\"offline\"`: the connection failed; the members stay queued, as one\n\t* write would.\n\t* - `\"unbatch\"`: anything else — a refusal, a busy server. Nothing was\n\t* written (a bulk write is one transaction), and the caller replays the\n\t* members one at a time, where each refusal, retry budget and recovery\n\t* applies to its own write.\n\t*\n\t* The key names the run by its first and last member and its length,\n\t* which fixes its composition: a run re-sent after a lost answer is the\n\t* same request under the same key, and is answered from the server's\n\t* record of it.\n\t*/\n\tasync replayRun(run, ticket) {\n\t\tconst inner = this.innerFor(run[0].collection);\n\t\tconst idempotencyKey = runKey(run);\n\t\tfor (const member of run) this.inFlight.add(member.mutationId);\n\t\ttry {\n\t\t\tfor (const member of run) await this.markCreateSent(member, ticket, idempotencyKey);\n\t\t\tlet rows;\n\t\t\ttry {\n\t\t\t\trows = await inner.createMany(run.map((member) => member.data), { idempotencyKey });\n\t\t\t} catch (error) {\n\t\t\t\tif (!isNetworkError(error)) return \"unbatch\";\n\t\t\t\tthis.connectivity.markFailure();\n\t\t\t\treturn \"offline\";\n\t\t\t}\n\t\t\tthis.connectivity.markSuccess();\n\t\t\tfor (let i = 0; i < run.length; i++) {\n\t\t\t\tawait this.adoptServerRow(run[i], run[i].id, rows[i], ticket);\n\t\t\t\tawait this.drop(run[i], ticket);\n\t\t\t}\n\t\t\treturn \"done\";\n\t\t} finally {\n\t\t\tfor (const member of run) this.inFlight.delete(member.mutationId);\n\t\t}\n\t}\n\tasync replay(op, ticket) {\n\t\tconst inner = this.innerFor(op.collection);\n\t\tif (op.type === \"create\") {\n\t\t\tawait this.markCreateSent(op, ticket);\n\t\t\tlet row;\n\t\t\ttry {\n\t\t\t\trow = await this.sendQueuedWrite(op, (idempotencyKey) => inner.create(op.data, void 0, { idempotencyKey }), (sent) => inner.create(sent.data, sent.id, { idempotencyKey: sent.idempotencyKey }));\n\t\t\t} catch (error) {\n\t\t\t\tif (!(op.generatedId === true && isDuplicateKeyError(error))) throw error;\n\t\t\t\trow = await inner.findById(op.id);\n\t\t\t\tif (!row) throw error;\n\t\t\t}\n\t\t\tawait this.adoptServerRow(op, op.id, row, ticket);\n\t\t} else if (op.type === \"createMany\") {\n\t\t\tconst queued = op.data ?? [];\n\t\t\tconst asSent = (sent) => inner.createMany(sent.data, {\n\t\t\t\t...op.upsert ? { upsert: true } : {},\n\t\t\t\t...sent.onConflict?.length ? { onConflict: sent.onConflict } : {},\n\t\t\t\tidempotencyKey: sent.idempotencyKey\n\t\t\t});\n\t\t\tconst rows = op.sent?.onConflict?.length ? await asSent(op.sent) : await this.sendQueuedWrite(op, (idempotencyKey) => inner.createMany(queued, {\n\t\t\t\t...op.upsert ? { upsert: true } : {},\n\t\t\t\tidempotencyKey\n\t\t\t}), asSent);\n\t\t\tfor (let i = 0; i < rows.length; i++) await this.adoptServerRow(op, queued[i]?.id, rows[i], ticket);\n\t\t} else if (op.type === \"updateMany\") {\n\t\t\tconst queued = op.updates ?? [];\n\t\t\tconst rows = await inner.updateMany(queued.map((u) => ({\n\t\t\t\tid: u.id,\n\t\t\t\tdata: u.data\n\t\t\t})), { idempotencyKey: op.mutationId });\n\t\t\tfor (let i = 0; i < rows.length; i++) await this.ingestReplaced(op, queued[i].id, rows[i], ticket);\n\t\t} else if (op.type === \"update\") {\n\t\t\tif (!op.sent) {\n\t\t\t\top.sent = { idempotencyKey: op.mutationId };\n\t\t\t\tawait this.persistMutation(`${ticket.scope}|${op.mutationId}`, op).catch(() => void 0);\n\t\t\t}\n\t\t\tconst row = await inner.update(op.id, op.data, {\n\t\t\t\tidempotencyKey: op.sent.idempotencyKey,\n\t\t\t\t...op.ifMatch ? { ifMatch: op.ifMatch } : {}\n\t\t\t});\n\t\t\tawait this.ingestReplaced(op, op.id, row, ticket);\n\t\t} else if (op.type === \"deleteMany\") {\n\t\t\tconst ids = op.ids ?? [];\n\t\t\ttry {\n\t\t\t\tawait inner.deleteMany(ids, { idempotencyKey: op.mutationId });\n\t\t\t} catch (error) {\n\t\t\t\tif (!isNotFoundError(error)) throw error;\n\t\t\t\tfor (const id of ids) try {\n\t\t\t\t\tawait inner.delete(id, { idempotencyKey: `${op.mutationId}:${String(id)}` });\n\t\t\t\t} catch (rowError) {\n\t\t\t\t\tif (!isNotFoundError(rowError)) throw rowError;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const id of ids) this.removeLocalRow(op.collection, id, ticket, true);\n\t\t} else if (op.type === \"delete\") {\n\t\t\tawait inner.delete(op.id, {\n\t\t\t\tidempotencyKey: op.sent?.idempotencyKey ?? op.mutationId,\n\t\t\t\t...op.ifMatch ? { ifMatch: op.ifMatch } : {}\n\t\t\t});\n\t\t\tthis.removeLocalRow(op.collection, op.id, ticket, true);\n\t\t}\n\t}\n\t/**\n\t* Record a queued create as sent, with the request about to go out, and\n\t* persist it — before the request, so a lost answer cannot leave it\n\t* unmarked. One already marked (sent online before it was queued, or by\n\t* an earlier replay) keeps what it holds: that is the request the server\n\t* may have stored.\n\t*/\n\tasync markCreateSent(op, ticket, run) {\n\t\tif (op.sent) return;\n\t\top.sent = {\n\t\t\tidempotencyKey: op.mutationId,\n\t\t\tdata: { ...op.data },\n\t\t\t...run ? { run } : {}\n\t\t};\n\t\tawait this.persistMutation(`${ticket.scope}|${op.mutationId}`, op).catch(() => void 0);\n\t}\n\t/**\n\t* Send a queued write under its key.\n\t*\n\t* A write the queue sent once already, before it was queued, carries that\n\t* attempt's key and is sent under it again, as queued. If the server holds\n\t* the key for a different request, the difference is the ids minted here\n\t* — so the first attempt committed and only its answer was lost, and\n\t* sending that request again returns the stored answer instead of a\n\t* second copy of the rows.\n\t*/\n\tasync sendQueuedWrite(op, asQueued, asSent) {\n\t\ttry {\n\t\t\treturn await asQueued(op.sent?.idempotencyKey ?? op.mutationId);\n\t\t} catch (error) {\n\t\t\tif (!op.sent || !isIdempotencyKeyReusedError(error)) throw error;\n\t\t\treturn asSent(op.sent);\n\t\t}\n\t}\n\t/**\n\t* Take the server's version of a row the client created offline.\n\t*\n\t* The server may have assigned a different id — a serial column ignores\n\t* the id we invented — in which case every local trace of the temporary id\n\t* has to move with it, including queued writes that were made against it\n\t* before it was ever sent.\n\t*/\n\tasync adoptServerRow(op, localId, row, ticket) {\n\t\tif (!row) return;\n\t\tconst slug = op.collection;\n\t\tconst serverId = row.id;\n\t\tif (localId !== void 0 && serverId !== void 0 && String(serverId) !== String(localId)) {\n\t\t\tconst oldKey = String(localId);\n\t\t\tthis.removeLocalRow(slug, localId, ticket);\n\t\t\tconst queue = this.isCurrent(ticket) ? this.queue : await this.readQueue(`${ticket.scope}|`).catch(() => []);\n\t\t\tconst minted = op.type === \"create\" && op.generatedId === true;\n\t\t\tfor (const queued of queue) {\n\t\t\t\tlet dirty = false;\n\t\t\t\tif (minted && queued !== op) {\n\t\t\t\t\tconst data = replaceMintedId(queued.data, localId, serverId);\n\t\t\t\t\tif (data.changed) {\n\t\t\t\t\t\tqueued.data = data.value;\n\t\t\t\t\t\tdirty = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (queued.updates) {\n\t\t\t\t\t\tconst updates = replaceMintedId(queued.updates.map((u) => u.data), localId, serverId);\n\t\t\t\t\t\tif (updates.changed) {\n\t\t\t\t\t\t\tconst values = updates.value;\n\t\t\t\t\t\t\tqueued.updates = queued.updates.map((u, i) => ({\n\t\t\t\t\t\t\t\tid: u.id,\n\t\t\t\t\t\t\t\tdata: values[i]\n\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t\tdirty = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (queued.collection !== slug) {\n\t\t\t\t\tif (dirty) await this.persistMutation(`${ticket.scope}|${queued.mutationId}`, queued).catch(() => void 0);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (queued.id !== void 0 && String(queued.id) === oldKey) {\n\t\t\t\t\tqueued.id = serverId;\n\t\t\t\t\tthis.queueChangedInPlace();\n\t\t\t\t\tif (queued.data && !Array.isArray(queued.data)) queued.data.id = serverId;\n\t\t\t\t\tdirty = true;\n\t\t\t\t}\n\t\t\t\tconst rollbackRows = queued.rollback?.rows;\n\t\t\t\tif (rollbackRows && oldKey in rollbackRows) {\n\t\t\t\t\trollbackRows[String(serverId)] = rollbackRows[oldKey];\n\t\t\t\t\tdelete rollbackRows[oldKey];\n\t\t\t\t\tdirty = true;\n\t\t\t\t}\n\t\t\t\tif (dirty) await this.persistMutation(`${ticket.scope}|${queued.mutationId}`, queued).catch(() => void 0);\n\t\t\t}\n\t\t}\n\t\tawait this.ingestReplaced(op, serverId ?? localId, row, ticket);\n\t}\n\t/**\n\t* Write a server row over the local one, ignoring the mutation that just\n\t* produced it — re-applying that would put the pre-server values back on\n\t* top of the server's answer — but keeping every write queued *after* it.\n\t* Those are still unsent, and dropping them here would make the row snap\n\t* back to the server's version in front of the user, only to change again\n\t* when they replay a moment later.\n\t*/\n\tasync ingestReplaced(op, id, row, ticket) {\n\t\tif (!this.isCurrent(ticket)) return;\n\t\tconst slug = op.collection;\n\t\tconst state = await this.ensureCollection(slug);\n\t\tif (!this.isCurrent(ticket)) return;\n\t\tconst key = String(id);\n\t\tthis.noteETag(state, key, row);\n\t\tconst merged = this.applyPendingToRow(slug, key, { ...row }, op.mutationId);\n\t\tif (merged === void 0) {\n\t\t\tthis.removeLocalRow(slug, key, ticket);\n\t\t\treturn;\n\t\t}\n\t\tconst cachedAt = Date.now();\n\t\tstate.rows.set(key, {\n\t\t\trow: merged,\n\t\t\tcachedAt,\n\t\t\trev: ++this.revCounter\n\t\t});\n\t\tif (this.applyPendingToRow(slug, key, void 0, op.mutationId) === void 0) state.freshRows.add(key);\n\t\tthis.writeCache(this.rowKey(slug, key), dehydrateRow(merged), cachedAt);\n\t}\n\t/**\n\t* The server refused a mutation. Put back what it changed, and discard the\n\t* queued writes that were built on top of it: an edit to a row whose\n\t* creation was rejected can only fail the same way, and applying it would\n\t* leave the local database claiming a row the server does not have.\n\t*\n\t* The cascade stops the moment a later write stops *depending* on the\n\t* rejected one. An `update` reads the row it edits, so it is doomed with\n\t* it; a `create` overwrites the row outright and a `delete` needs nothing\n\t* of it, so both stand on their own and are kept — dropping them would\n\t* silently lose writes the server would have accepted.\n\t*/\n\tasync rejectMutation(op, error, ticket, report = true) {\n\t\tif (!this.isCurrent(ticket)) return;\n\t\tconst ids = new Set(Object.keys(op.rollback?.rows ?? {}));\n\t\tif (op.id !== void 0) ids.add(String(op.id));\n\t\tconst doomed = [op];\n\t\tconst orphaned = new Set(ids);\n\t\tconst neverCreated = op.type === \"create\" && op.generatedId === true && op.id !== void 0 ? [op.id] : [];\n\t\tconst position = this.queue.indexOf(op);\n\t\tfor (const later of this.queue.slice(position + 1)) {\n\t\t\tif (neverCreated.some((id) => mentionsMintedId(later, id))) {\n\t\t\t\tdoomed.push(later);\n\t\t\t\tif (later.type === \"create\" && later.generatedId === true && later.id !== void 0) neverCreated.push(later.id);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (later.collection !== op.collection) continue;\n\t\t\tconst hit = this.idsOf(later).filter((id) => orphaned.has(id));\n\t\t\tif (hit.length === 0) continue;\n\t\t\tif (later.type === \"update\") doomed.push(later);\n\t\t\telse for (const id of hit) orphaned.delete(id);\n\t\t}\n\t\tfor (const dropped of doomed) await this.drop(dropped, ticket);\n\t\tif (!this.isCurrent(ticket)) return;\n\t\tconst touched = /* @__PURE__ */ new Set([op.collection]);\n\t\tfor (const dropped of doomed) {\n\t\t\tif (dropped === op || !neverCreated.length || dropped.collection === op.collection && dropped.type === \"update\") continue;\n\t\t\ttouched.add(dropped.collection);\n\t\t\tfor (const [idKey, previous] of Object.entries(dropped.rollback?.rows ?? {})) {\n\t\t\t\tconst restored = this.applyPendingToRow(dropped.collection, idKey, previous ?? void 0);\n\t\t\t\tif (restored === void 0) this.removeLocalRow(dropped.collection, idKey, ticket);\n\t\t\t\telse this.setLocalRow(dropped.collection, idKey, restored, ticket);\n\t\t\t}\n\t\t}\n\t\tconst goneKey = op.type === \"update\" && isNotFoundError(error) ? String(op.id) : void 0;\n\t\tfor (const [idKey, previous] of Object.entries(op.rollback?.rows ?? {})) {\n\t\t\tconst gone = idKey === goneKey;\n\t\t\tconst restored = this.applyPendingToRow(op.collection, idKey, gone ? void 0 : previous ?? void 0);\n\t\t\tif (restored === void 0) this.removeLocalRow(op.collection, idKey, ticket, gone);\n\t\t\telse this.setLocalRow(op.collection, idKey, restored, ticket);\n\t\t}\n\t\tthis.patchStatus({ lastError: error.message });\n\t\tfor (const slug of touched) {\n\t\t\tthis.notifyCollection(slug);\n\t\t\tthis.scheduleRefresh(slug);\n\t\t}\n\t\tfor (const dropped of doomed) {\n\t\t\tif (dropped === op && !report) continue;\n\t\t\tcallSafely(() => this.onSyncError?.(dropped === op ? error : dependencyRejected(op, error), dropped));\n\t\t}\n\t}\n\t/**\n\t* An edit replayed with `If-Match` and refused with a 412: ask\n\t* {@link OfflineConfig.onConflict}, and do what it says. A callback that\n\t* throws, or none, is \"overwrite\" — what replay did before it knew of\n\t* conflicts.\n\t*/\n\tasync resolveConflict(op, error, ticket) {\n\t\tlet resolution = \"overwrite\";\n\t\tif (this.onConflict) try {\n\t\t\tresolution = await this.onConflict(error, op) === \"discard\" ? \"discard\" : \"overwrite\";\n\t\t} catch (callbackError) {\n\t\t\tconsole.error(\"Error in offline onConflict:\", callbackError);\n\t\t}\n\t\tif (resolution === \"overwrite\") {\n\t\t\tdelete op.ifMatch;\n\t\t\tawait this.persistMutation(`${ticket.scope}|${op.mutationId}`, op).catch(() => void 0);\n\t\t\treturn resolution;\n\t\t}\n\t\tawait this.rejectMutation(op, error, ticket, false);\n\t\tconst slug = op.collection;\n\t\tconst id = op.id;\n\t\ttry {\n\t\t\tconst row = await this.innerFor(slug).findById(id);\n\t\t\tif (this.isCurrent(ticket)) {\n\t\t\t\tif (row) await this.ingest(slug, [row], ticket);\n\t\t\t\telse if (!this.hasPending(slug, id)) this.removeLocalRow(slug, id, ticket, true);\n\t\t\t\tthis.notifyCollection(slug);\n\t\t\t}\n\t\t} catch {}\n\t\treturn resolution;\n\t}\n\t/**\n\t* Put the separate edits a coalesced `update` was made of back in the\n\t* queue, in its place and in their order, each with the row as it stood\n\t* before it as its rollback — so a refusal undoes that edit alone.\n\t*\n\t* Their ids extend the merged op's, which sorts them after it and before\n\t* whatever was queued next, so the queue's order survives a reload.\n\t*/\n\tasync splitCoalesced(op, ticket) {\n\t\tconst parts = op.parts ?? [];\n\t\tconst idKey = String(op.id);\n\t\tlet before = op.rollback?.rows?.[idKey] ?? null;\n\t\tconst pieces = parts.map((part, index) => {\n\t\t\tconst piece = {\n\t\t\t\tmutationId: `${op.mutationId}:${index}`,\n\t\t\t\tcollection: op.collection,\n\t\t\t\ttype: \"update\",\n\t\t\t\tid: op.id,\n\t\t\t\tdata: { ...part },\n\t\t\t\tqueuedAt: op.queuedAt,\n\t\t\t\t...index === 0 && op.ifMatch ? { ifMatch: op.ifMatch } : {},\n\t\t\t\trollback: { rows: { [idKey]: before === null ? null : { ...before } } }\n\t\t\t};\n\t\t\tif (before !== null) before = {\n\t\t\t\t...before,\n\t\t\t\t...part\n\t\t\t};\n\t\t\treturn piece;\n\t\t});\n\t\tfor (const piece of pieces) await this.persistMutation(`${ticket.scope}|${piece.mutationId}`, piece).catch(() => void 0);\n\t\tawait this.store.dequeue(`${ticket.scope}|${op.mutationId}`).catch(() => void 0);\n\t\tif (!this.isCurrent(ticket)) return;\n\t\tconst position = this.queue.indexOf(op);\n\t\tthis.queue.splice(position < 0 ? 0 : position, position < 0 ? 0 : 1, ...pieces);\n\t\tthis.queueChangedInPlace();\n\t\tthis.afterQueueChange(false);\n\t}\n\t/** Every row id a mutation writes to. */\n\tidsOf(op) {\n\t\tif (op.type === \"createMany\") return (op.data ?? []).map((r) => String(r.id));\n\t\tif (op.type === \"updateMany\") return (op.updates ?? []).map((u) => String(u.id));\n\t\tif (op.type === \"deleteMany\") return (op.ids ?? []).map((id) => String(id));\n\t\treturn op.id === void 0 ? [] : [String(op.id)];\n\t}\n\tasync drop(op, ticket) {\n\t\tawait this.store.dequeue(`${ticket.scope}|${op.mutationId}`).catch(() => void 0);\n\t\tif (!this.isCurrent(ticket)) return;\n\t\tthis.queue = this.queue.filter((m) => m.mutationId !== op.mutationId);\n\t\tthis.afterQueueChange(false);\n\t}\n\t/** Replay uses unwrapped clients: a failure must never re-enqueue itself. */\n\tinnerFor(slug) {\n\t\tlet inner = this.inners.get(slug);\n\t\tif (!inner) {\n\t\t\tinner = this.createInner(slug);\n\t\t\tthis.inners.set(slug, inner);\n\t\t}\n\t\treturn inner;\n\t}\n\tasync withLock(fn) {\n\t\tconst locks = globalThis.navigator?.locks;\n\t\tif (!locks?.request) return fn();\n\t\tlet started = false;\n\t\ttry {\n\t\t\treturn await locks.request(`rebase-offline-sync:${this.scope}`, () => {\n\t\t\t\tstarted = true;\n\t\t\t\treturn fn();\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tif (started) throw error;\n\t\t\treturn fn();\n\t\t}\n\t}\n\tbroadcast(message, scope = this.scope) {\n\t\tif (!this.channel) return;\n\t\ttry {\n\t\t\tthis.channel.postMessage({\n\t\t\t\t...message,\n\t\t\t\tscope,\n\t\t\t\tsender: this.tabId\n\t\t\t});\n\t\t} catch {}\n\t}\n\tonBroadcast(message) {\n\t\tif (this.disposed || !message || typeof message !== \"object\") return;\n\t\tconst msg = message;\n\t\tif (this.scopeHold || msg.sender === this.tabId || msg.scope !== this.scope) return;\n\t\tif (msg.type === \"rows\") for (const slug of msg.slugs ?? []) this.reloadCollection(slug);\n\t\telse if (msg.type === \"queue\") this.reloadQueue();\n\t}\n\t/** Re-read one collection from the store, replacing what is in memory. */\n\tasync reloadCollection(slug) {\n\t\tconst state = this.collections.get(slug);\n\t\tif (!state?.loaded || this.scopeHold) return;\n\t\tawait this.reloadQueue();\n\t\tconst scope = this.scope;\n\t\tconst [rows, snapshots, absent] = await Promise.all([\n\t\t\tthis.store.listCacheEntries(`${scope}|row|${slug}|`).catch(() => []),\n\t\t\tthis.store.listCacheEntries(`${scope}|q|${slug}|`).catch(() => []),\n\t\t\tthis.store.listCache(`${scope}|abs|${slug}|`).catch(() => [])\n\t\t]);\n\t\tif (this.scope !== scope || this.collections.get(slug) !== state) return;\n\t\tconst next = /* @__PURE__ */ new Map();\n\t\tfor (const entry of rows) {\n\t\t\tconst row = entry.value;\n\t\t\tif (!row || row.id === void 0 || row.id === null) continue;\n\t\t\tconst key = String(row.id);\n\t\t\tconst existing = state.rows.get(key);\n\t\t\tconst hydrated = hydrateRow(row);\n\t\t\tconst unchanged = existing && JSON.stringify(existing.row) === JSON.stringify(hydrated);\n\t\t\tnext.set(key, {\n\t\t\t\trow: hydrated,\n\t\t\t\tcachedAt: entry.cachedAt,\n\t\t\t\trev: unchanged ? existing.rev : ++this.revCounter\n\t\t\t});\n\t\t}\n\t\tstate.rows = next;\n\t\tstate.snapshots = /* @__PURE__ */ new Map();\n\t\tfor (const entry of snapshots) {\n\t\t\tconst key = entry.key.slice(`${scope}|q|${slug}|`.length);\n\t\t\tif (entry.value) state.snapshots.set(key, readSnapshot(entry.value));\n\t\t}\n\t\tstate.absent = new Set(absent.map((entry) => entry.key.slice(`${scope}|abs|${slug}|`.length)));\n\t\tthis.notifyCollection(slug, false);\n\t}\n\tasync reloadQueue() {\n\t\tif (this.scopeHold) return;\n\t\tconst scope = this.scope;\n\t\tconst queue = await this.readQueue(`${scope}|`).catch(() => void 0);\n\t\tif (!queue || this.scope !== scope) return;\n\t\tthis.queue = queue;\n\t\tthis.afterQueueChange(false);\n\t}\n\tafterQueueChange(broadcast = true) {\n\t\tthis.patchStatus({ pending: this.queue.length });\n\t\tthis.notifyQueue();\n\t\tif (broadcast) this.broadcast({ type: \"queue\" });\n\t}\n\tnotifyQueue() {\n\t\tfor (const listener of this.queueListeners) callSafely(() => listener(this.queue.length));\n\t}\n\tpatchStatus(patch) {\n\t\tlet changed = false;\n\t\tfor (const [key, value] of Object.entries(patch)) if (this.currentStatus[key] !== value) {\n\t\t\tthis.currentStatus[key] = value;\n\t\t\tchanged = true;\n\t\t}\n\t\tif (!changed) return;\n\t\tconst snapshot = { ...this.currentStatus };\n\t\tfor (const listener of this.statusListeners) callSafely(() => listener(snapshot));\n\t}\n\tcountKey(slug, params) {\n\t\treturn `${this.scope}|count|${slug}|${buildQueryString(params)}`;\n\t}\n\trowKey(slug, id) {\n\t\treturn `${this.scope}|row|${slug}|${String(id)}`;\n\t}\n\tabsentKey(slug, id) {\n\t\treturn `${this.scope}|abs|${slug}|${String(id)}`;\n\t}\n\tqueueKey(mutation) {\n\t\treturn `${this.scope}|${mutation.mutationId}`;\n\t}\n\t/** Queue a write in the store, its rows encoded as the cache's are. */\n\tpersistMutation(key, op) {\n\t\treturn this.store.enqueue(key, dehydrateMutation(op));\n\t}\n\t/** The store's queue under `prefix`, its rows revived. */\n\tasync readQueue(prefix) {\n\t\treturn (await this.store.listQueue(prefix)).map(hydrateMutation);\n\t}\n\tasync readCache(key) {\n\t\ttry {\n\t\t\treturn (await this.store.getCache(key))?.value;\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\t}\n\tasync writeCache(key, value, cachedAt = Date.now()) {\n\t\ttry {\n\t\t\tawait this.store.setCache(key, {\n\t\t\t\tvalue,\n\t\t\t\tcachedAt\n\t\t\t});\n\t\t} catch {}\n\t}\n\tasync deleteCache(keys) {\n\t\ttry {\n\t\t\tawait this.store.deleteCache(keys);\n\t\t} catch {}\n\t}\n};\n//#endregion\nexport { OfflineManager };\n\n//# sourceMappingURL=offline-AvuEcg7u.js.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,SAAS,OAAO,OAAO;CACtB,OAAO,OAAO,UAAU,SAAS,KAAK,KAAK,MAAM;AAClD;;AAEA,SAAS,gBAAgB,OAAO;CAC/B,IAAI,UAAU,QAAQ,OAAO,UAAU,YAAY,MAAM,QAAQ,KAAK,GAAG,OAAO;CAChF,MAAM,QAAQ,OAAO,eAAe,KAAK;CACzC,IAAI,UAAU,QAAQ,UAAU,OAAO,WAAW,OAAO;CACzD,OAAO,MAAM,aAAa,SAAS;AACpC;;;;;;;AAOA,SAAS,OAAO,KAAK,KAAK,OAAO;CAChC,OAAO,eAAe,KAAK,KAAK;EAC/B;EACA,YAAY;EAC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YAAY,KAAK,iBAAiB,iBAAiB,SAAS,QAAQ,CAAC;CACjF;CACA,SAAS,MAAM,QAAQ;EACtB,OAAO,GAAG,KAAK,MAAM,SAAS,KAAK,GAAG,iBAAiB,MAAM;CAC9D;CACA,OAAO,MAAM,IAAI;EAChB,OAAO,GAAG,KAAK,MAAM,OAAO,KAAK,GAAG,OAAO,EAAE;CAC9C;CACA,UAAU,MAAM,IAAI;EACnB,OAAO,GAAG,KAAK,MAAM,OAAO,KAAK,GAAG,OAAO,EAAE;CAC9C;CACA,SAAS,UAAU;EAClB,OAAO,GAAG,KAAK,MAAM,GAAG,SAAS;CAClC;;CAEA,gBAAgB,KAAK,IAAI;EACxB,OAAO,KAAK,MAAM,QAAQ,KAAK,kBAAkB,EAAE,CAAC;CACrD;;CAEA,MAAM,UAAU,QAAQ;EACvB,QAAQ,MAAM,KAAK,MAAM,UAAU,MAAM,EAAA,CAAG,IAAI,eAAe;CAChE;CACA,MAAM,UAAU,KAAK;EACpB,IAAI;GACH,QAAQ,MAAM,KAAK,MAAM,SAAS,GAAG,EAAA,EAAI;EAC1C,QAAQ;GACP;EACD;CACD;CACA,MAAM,WAAW,KAAK,OAAO,WAAW,KAAK,IAAI,GAAG;EACnD,IAAI;GACH,MAAM,KAAK,MAAM,SAAS,KAAK;IAC9B;IACA;GACD,CAAC;EACF,QAAQ,CAAC;CACV;CACA,MAAM,YAAY,MAAM;EACvB,IAAI;GACH,MAAM,KAAK,MAAM,YAAY,IAAI;EAClC,QAAQ,CAAC;CACV;AACD"}
|
|
@@ -2,10 +2,10 @@ import { createRequire as __rebaseCreateRequire } from "module";
|
|
|
2
2
|
import __rebaseProcess from "process";
|
|
3
3
|
globalThis.process ??= __rebaseProcess;
|
|
4
4
|
__rebaseCreateRequire(import.meta.url);
|
|
5
|
-
import {
|
|
6
|
-
import { D as Vector, E as GeoPoint, T as EntityRelation, _ as normalizeOrderBy, a as serializeFilter, c as collectAllPages, h as serializeInclude, l as paginateFind, o as serializeLogicalCondition, p as mergeIncludeSpecs, t as RESERVED_QUERY_KEYS, u as resolveFindWindow, v as serializeOrderBy, w as EntityReference } from "./filter-dialect-
|
|
7
|
-
import {
|
|
8
|
-
import { t as IMPERSONATE_HEADER } from "./auth_adapter-
|
|
5
|
+
import { a as RebaseClientError, i as RebaseApiError, o as isUnsupported, s as unsupportedMethod } from "./data_driver-D0mg1Y_x.js";
|
|
6
|
+
import { D as Vector, E as GeoPoint, T as EntityRelation, _ as normalizeOrderBy, a as serializeFilter, c as collectAllPages, h as serializeInclude, l as paginateFind, o as serializeLogicalCondition, p as mergeIncludeSpecs, t as RESERVED_QUERY_KEYS, u as resolveFindWindow, v as serializeOrderBy, w as EntityReference } from "./filter-dialect-TrKFWLqT.js";
|
|
7
|
+
import { tt as sortKeyToString } from "./src-Bh9LRPb9.js";
|
|
8
|
+
import { t as IMPERSONATE_HEADER } from "./auth_adapter-B7RUMk6e.js";
|
|
9
9
|
import { t as SCHEMA_VERSION_HEADER } from "./project_manifest-R6y_KHms.js";
|
|
10
10
|
//#region ../utils/dist/unref.es.js
|
|
11
11
|
/**
|
|
@@ -1917,4 +1917,4 @@ var IndexedDBOfflineStore = class {
|
|
|
1917
1917
|
//#endregion
|
|
1918
1918
|
export { byIdRead as a, createTransport as c, parseRebaseJson as d, rebaseReviver as f, unref as h, buildQueryString as i, defaultCodeForStatus as l, withETag as m, MemoryOfflineStore as n, createCollectionClient as o, etagOf as p, SDKQueryBuilder as r, createMutationId as s, IndexedDBOfflineStore as t, invalidBulkBody as u };
|
|
1919
1919
|
|
|
1920
|
-
//# sourceMappingURL=offline-store-BhYXViha-
|
|
1920
|
+
//# sourceMappingURL=offline-store-BhYXViha-YTmjBpo2.js.map
|