dexie-cloud-addon 4.2.3 → 4.2.5
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/dexie-cloud-import.json +2 -1
- package/dist/modern/dexie-cloud-addon.js +146 -168
- package/dist/modern/dexie-cloud-addon.js.map +1 -1
- package/dist/modern/dexie-cloud-addon.min.js +1 -1
- package/dist/modern/dexie-cloud-addon.min.js.map +1 -1
- package/dist/modern/service-worker.js +146 -168
- package/dist/modern/service-worker.js.map +1 -1
- package/dist/modern/service-worker.min.js +1 -1
- package/dist/modern/service-worker.min.js.map +1 -1
- package/dist/umd/dexie-cloud-addon.js +1623 -2458
- package/dist/umd/dexie-cloud-addon.js.map +1 -1
- package/dist/umd/dexie-cloud-addon.min.js +1 -1
- package/dist/umd/dexie-cloud-addon.min.js.map +1 -1
- package/dist/umd/service-worker.js +2003 -2838
- package/dist/umd/service-worker.js.map +1 -1
- package/dist/umd/service-worker.min.js +1 -1
- package/dist/umd/service-worker.min.js.map +1 -1
- package/package.json +14 -11
- package/dist/umd/DISABLE_SERVICEWORKER_STRATEGY.d.ts +0 -1
- package/dist/umd/DXCWebSocketStatus.d.ts +0 -1
- package/dist/umd/DexieCloudAPI.d.ts +0 -75
- package/dist/umd/DexieCloudOptions.d.ts +0 -27
- package/dist/umd/DexieCloudSyncOptions.d.ts +0 -4
- package/dist/umd/DexieCloudTable.d.ts +0 -18
- package/dist/umd/InvalidLicenseError.d.ts +0 -5
- package/dist/umd/Invite.d.ts +0 -8
- package/dist/umd/PermissionChecker.d.ts +0 -15
- package/dist/umd/TSON.d.ts +0 -17
- package/dist/umd/WSObservable.d.ts +0 -72
- package/dist/umd/associate.d.ts +0 -1
- package/dist/umd/authentication/AuthPersistedContext.d.ts +0 -9
- package/dist/umd/authentication/TokenErrorResponseError.d.ts +0 -10
- package/dist/umd/authentication/TokenExpiredError.d.ts +0 -3
- package/dist/umd/authentication/UNAUTHORIZED_USER.d.ts +0 -2
- package/dist/umd/authentication/authenticate.d.ts +0 -13
- package/dist/umd/authentication/currentUserObservable.d.ts +0 -1
- package/dist/umd/authentication/interactWithUser.d.ts +0 -21
- package/dist/umd/authentication/login.d.ts +0 -3
- package/dist/umd/authentication/logout.d.ts +0 -5
- package/dist/umd/authentication/otpFetchTokenCallback.d.ts +0 -3
- package/dist/umd/authentication/setCurrentUser.d.ts +0 -14
- package/dist/umd/authentication/waitUntil.d.ts +0 -3
- package/dist/umd/computeSyncState.d.ts +0 -4
- package/dist/umd/createSharedValueObservable.d.ts +0 -3
- package/dist/umd/currentUserEmitter.d.ts +0 -3
- package/dist/umd/db/DexieCloudDB.d.ts +0 -61
- package/dist/umd/db/entities/BaseRevisionMapEntry.d.ts +0 -5
- package/dist/umd/db/entities/EntityCommon.d.ts +0 -5
- package/dist/umd/db/entities/GuardedJob.d.ts +0 -5
- package/dist/umd/db/entities/Member.d.ts +0 -19
- package/dist/umd/db/entities/PersistedSyncState.d.ts +0 -22
- package/dist/umd/db/entities/Realm.d.ts +0 -14
- package/dist/umd/db/entities/Role.d.ts +0 -11
- package/dist/umd/db/entities/UserLogin.d.ts +0 -23
- package/dist/umd/default-ui/Dialog.d.ts +0 -5
- package/dist/umd/default-ui/LoginDialog.d.ts +0 -3
- package/dist/umd/default-ui/Styles.d.ts +0 -3
- package/dist/umd/default-ui/index.d.ts +0 -24
- package/dist/umd/define-ydoc-trigger.d.ts +0 -3
- package/dist/umd/dexie-cloud-addon.d.ts +0 -3
- package/dist/umd/dexie-cloud-client.d.ts +0 -23
- package/dist/umd/errors/HttpError.d.ts +0 -5
- package/dist/umd/extend-dexie-interface.d.ts +0 -23
- package/dist/umd/getGlobalRolesObservable.d.ts +0 -5
- package/dist/umd/getInternalAccessControlObservable.d.ts +0 -12
- package/dist/umd/getInvitesObservable.d.ts +0 -23
- package/dist/umd/getPermissionsLookupObservable.d.ts +0 -16
- package/dist/umd/getTiedRealmId.d.ts +0 -2
- package/dist/umd/helpers/BroadcastedAndLocalEvent.d.ts +0 -8
- package/dist/umd/helpers/CancelToken.d.ts +0 -4
- package/dist/umd/helpers/IS_SERVICE_WORKER.d.ts +0 -1
- package/dist/umd/helpers/SWBroadcastChannel.d.ts +0 -12
- package/dist/umd/helpers/allSettled.d.ts +0 -1
- package/dist/umd/helpers/bulkUpdate.d.ts +0 -4
- package/dist/umd/helpers/computeRealmSetHash.d.ts +0 -2
- package/dist/umd/helpers/date-constants.d.ts +0 -5
- package/dist/umd/helpers/flatten.d.ts +0 -1
- package/dist/umd/helpers/getMutationTable.d.ts +0 -1
- package/dist/umd/helpers/getSyncableTables.d.ts +0 -4
- package/dist/umd/helpers/getTableFromMutationTable.d.ts +0 -1
- package/dist/umd/helpers/makeArray.d.ts +0 -1
- package/dist/umd/helpers/randomString.d.ts +0 -1
- package/dist/umd/helpers/resolveText.d.ts +0 -16
- package/dist/umd/helpers/throwVersionIncrementNeeded.d.ts +0 -1
- package/dist/umd/helpers/visibilityState.d.ts +0 -1
- package/dist/umd/isEagerSyncDisabled.d.ts +0 -2
- package/dist/umd/isFirefox.d.ts +0 -1
- package/dist/umd/isSafari.d.ts +0 -2
- package/dist/umd/mapValueObservable.d.ts +0 -5
- package/dist/umd/mergePermissions.d.ts +0 -2
- package/dist/umd/middleware-helpers/guardedTable.d.ts +0 -11
- package/dist/umd/middleware-helpers/idGenerationHelpers.d.ts +0 -18
- package/dist/umd/middlewares/createIdGenerationMiddleware.d.ts +0 -3
- package/dist/umd/middlewares/createImplicitPropSetterMiddleware.d.ts +0 -3
- package/dist/umd/middlewares/createMutationTrackingMiddleware.d.ts +0 -17
- package/dist/umd/middlewares/outstandingTransaction.d.ts +0 -4
- package/dist/umd/overrideParseStoresSpec.d.ts +0 -4
- package/dist/umd/performInitialSync.d.ts +0 -4
- package/dist/umd/permissions.d.ts +0 -9
- package/dist/umd/prodLog.d.ts +0 -9
- package/dist/umd/service-worker.d.ts +0 -1
- package/dist/umd/sync/DEXIE_CLOUD_SYNCER_ID.d.ts +0 -1
- package/dist/umd/sync/LocalSyncWorker.d.ts +0 -7
- package/dist/umd/sync/SyncRequiredError.d.ts +0 -3
- package/dist/umd/sync/applyServerChanges.d.ts +0 -3
- package/dist/umd/sync/connectWebSocket.d.ts +0 -2
- package/dist/umd/sync/encodeIdsForServer.d.ts +0 -4
- package/dist/umd/sync/extractRealm.d.ts +0 -2
- package/dist/umd/sync/getLatestRevisionsPerTable.d.ts +0 -6
- package/dist/umd/sync/getTablesToSyncify.d.ts +0 -3
- package/dist/umd/sync/isOnline.d.ts +0 -1
- package/dist/umd/sync/isSyncNeeded.d.ts +0 -2
- package/dist/umd/sync/listClientChanges.d.ts +0 -9
- package/dist/umd/sync/listSyncifiedChanges.d.ts +0 -5
- package/dist/umd/sync/messageConsumerIsReady.d.ts +0 -2
- package/dist/umd/sync/messagesFromServerQueue.d.ts +0 -8
- package/dist/umd/sync/modifyLocalObjectsWithNewUserId.d.ts +0 -4
- package/dist/umd/sync/myId.d.ts +0 -1
- package/dist/umd/sync/numUnsyncedMutations.d.ts +0 -2
- package/dist/umd/sync/old_startSyncingClientChanges.d.ts +0 -39
- package/dist/umd/sync/performGuardedJob.d.ts +0 -2
- package/dist/umd/sync/ratelimit.d.ts +0 -3
- package/dist/umd/sync/registerSyncEvent.d.ts +0 -3
- package/dist/umd/sync/sync.d.ts +0 -15
- package/dist/umd/sync/syncIfPossible.d.ts +0 -5
- package/dist/umd/sync/syncWithServer.d.ts +0 -6
- package/dist/umd/sync/triggerSync.d.ts +0 -2
- package/dist/umd/sync/updateBaseRevs.d.ts +0 -5
- package/dist/umd/types/DXCAlert.d.ts +0 -25
- package/dist/umd/types/DXCInputField.d.ts +0 -11
- package/dist/umd/types/DXCUserInteraction.d.ts +0 -93
- package/dist/umd/types/NewIdOptions.d.ts +0 -3
- package/dist/umd/types/SWMessageEvent.d.ts +0 -3
- package/dist/umd/types/SWSyncEvent.d.ts +0 -4
- package/dist/umd/types/SyncState.d.ts +0 -9
- package/dist/umd/types/TXExpandos.d.ts +0 -11
- package/dist/umd/updateSchemaFromOptions.d.ts +0 -3
- package/dist/umd/userIsActive.d.ts +0 -7
- package/dist/umd/verifyConfig.d.ts +0 -2
- package/dist/umd/verifySchema.d.ts +0 -2
- package/dist/umd/yjs/YDexieCloudSyncState.d.ts +0 -3
- package/dist/umd/yjs/YTable.d.ts +0 -3
- package/dist/umd/yjs/applyYMessages.d.ts +0 -9
- package/dist/umd/yjs/awareness.d.ts +0 -3
- package/dist/umd/yjs/createYClientUpdateObservable.d.ts +0 -4
- package/dist/umd/yjs/createYHandler.d.ts +0 -2
- package/dist/umd/yjs/downloadYDocsFromServer.d.ts +0 -3
- package/dist/umd/yjs/getUpdatesTable.d.ts +0 -3
- package/dist/umd/yjs/listUpdatesSince.d.ts +0 -3
- package/dist/umd/yjs/listYClientMessagesAndStateVector.d.ts +0 -26
- package/dist/umd/yjs/reopenDocSignal.d.ts +0 -10
- package/dist/umd/yjs/updateYSyncStates.d.ts +0 -6
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* ==========================================================================
|
|
10
10
|
*
|
|
11
|
-
* Version 4.2.
|
|
11
|
+
* Version 4.2.5, Sat Dec 20 2025
|
|
12
12
|
*
|
|
13
13
|
* https://dexie.org
|
|
14
14
|
*
|
|
@@ -39,7 +39,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
39
39
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
40
40
|
PERFORMANCE OF THIS SOFTWARE.
|
|
41
41
|
***************************************************************************** */
|
|
42
|
-
/* global Reflect, Promise */
|
|
42
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
function __rest(s, e) {
|
|
@@ -83,8 +83,9 @@ function __await(v) {
|
|
|
83
83
|
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
84
84
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
85
85
|
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
86
|
-
return i =
|
|
87
|
-
function
|
|
86
|
+
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
87
|
+
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
|
|
88
|
+
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
|
|
88
89
|
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
89
90
|
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
90
91
|
function fulfill(value) { resume("next", value); }
|
|
@@ -98,7 +99,12 @@ function __asyncValues(o) {
|
|
|
98
99
|
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
99
100
|
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
100
101
|
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
101
|
-
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
105
|
+
var e = new Error(message);
|
|
106
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
107
|
+
};
|
|
102
108
|
|
|
103
109
|
const UNAUTHORIZED_USER = {
|
|
104
110
|
userId: "unauthorized",
|
|
@@ -475,10 +481,17 @@ function removeRedundantUpdateOps(muts) {
|
|
|
475
481
|
return true;
|
|
476
482
|
if (mut.keys.length !== 1 || mut.changeSpecs.length !== 1)
|
|
477
483
|
return true;
|
|
484
|
+
// Check if this has PropModifications - if so, skip optimization
|
|
485
|
+
const changeSpecs = mut.changeSpecs[0];
|
|
486
|
+
if (Object.values(changeSpecs).some(v => typeof v === "object" && v && "@@propmod" in v)) {
|
|
487
|
+
return true; // Cannot optimize if any PropModification is present
|
|
488
|
+
}
|
|
478
489
|
// Keep track of properties that aren't overlapped by later transactions
|
|
479
490
|
const unoverlappedProps = new Set(Object.keys(mut.changeSpecs[0]));
|
|
480
491
|
const strKey = '' + mut.keys[0];
|
|
481
492
|
const keyCoverage = updateCoverage.get(strKey);
|
|
493
|
+
if (!keyCoverage)
|
|
494
|
+
return true; // No coverage info - cannot optimize
|
|
482
495
|
for (let i = keyCoverage.length - 1; i >= 0; --i) {
|
|
483
496
|
const { txid, updateSpec } = keyCoverage[i];
|
|
484
497
|
if (txid === mut.txid)
|
|
@@ -711,13 +724,12 @@ function applyOperations(target, ops) {
|
|
|
711
724
|
function subtractChanges(target, // Server change set
|
|
712
725
|
changesToSubtract // additional mutations on client during syncWithServer()
|
|
713
726
|
) {
|
|
714
|
-
var _a, _b, _c;
|
|
715
727
|
for (const [table, mutationSet] of Object.entries(changesToSubtract)) {
|
|
716
728
|
for (const [key, mut] of Object.entries(mutationSet)) {
|
|
717
729
|
switch (mut.type) {
|
|
718
730
|
case 'ups':
|
|
719
731
|
{
|
|
720
|
-
const targetMut =
|
|
732
|
+
const targetMut = target[table]?.[key];
|
|
721
733
|
if (targetMut) {
|
|
722
734
|
switch (targetMut.type) {
|
|
723
735
|
case 'ups':
|
|
@@ -735,10 +747,10 @@ changesToSubtract // additional mutations on client during syncWithServer()
|
|
|
735
747
|
}
|
|
736
748
|
break;
|
|
737
749
|
case 'del':
|
|
738
|
-
|
|
750
|
+
delete target[table]?.[key];
|
|
739
751
|
break;
|
|
740
752
|
case 'upd': {
|
|
741
|
-
const targetMut =
|
|
753
|
+
const targetMut = target[table]?.[key];
|
|
742
754
|
if (targetMut) {
|
|
743
755
|
switch (targetMut.type) {
|
|
744
756
|
case 'ups':
|
|
@@ -771,17 +783,14 @@ changesToSubtract // additional mutations on client during syncWithServer()
|
|
|
771
783
|
* @param inSet
|
|
772
784
|
* @returns DBOperationsSet representing inSet
|
|
773
785
|
*/
|
|
774
|
-
function toDBOperationSet(inSet, txid
|
|
775
|
-
// Fictive transaction:
|
|
776
|
-
if (!txid)
|
|
777
|
-
txid = randomString(16);
|
|
786
|
+
function toDBOperationSet(inSet, txid) {
|
|
778
787
|
// Convert data into a temporary map to collect mutations of same table and type
|
|
779
788
|
const map = {};
|
|
780
789
|
for (const [table, ops] of Object.entries(inSet)) {
|
|
781
790
|
for (const [key, op] of Object.entries(ops)) {
|
|
782
791
|
const mapEntry = map[table] || (map[table] = {});
|
|
783
792
|
const ops = mapEntry[op.type] || (mapEntry[op.type] = []);
|
|
784
|
-
ops.push(
|
|
793
|
+
ops.push({ key, ...op }); // DBKeyMutation doesn't contain key, so we need to bring it in.
|
|
785
794
|
}
|
|
786
795
|
}
|
|
787
796
|
// Start computing the resulting format:
|
|
@@ -959,142 +968,111 @@ function decodeYMessage(a) {
|
|
|
959
968
|
}
|
|
960
969
|
|
|
961
970
|
async function asyncIterablePipeline(source, ...stages) {
|
|
962
|
-
var _a, e_1, _b, _c;
|
|
963
971
|
// Chain generators by sending outdata from one to another
|
|
964
972
|
let result = source(); // Start with the source generator
|
|
965
973
|
for (let i = 0; i < stages.length; i++) {
|
|
966
974
|
result = stages[i](result); // Pass on the result to next generator
|
|
967
975
|
}
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
let state = 0;
|
|
990
|
-
let sizeBuf = new Uint8Array(4);
|
|
991
|
-
let sizeBufPos = 0;
|
|
992
|
-
let bufs = [];
|
|
993
|
-
let len = 0;
|
|
994
|
-
try {
|
|
995
|
-
for (var _d = true, source_1 = __asyncValues(source), source_1_1; source_1_1 = yield __await(source_1.next()), _a = source_1_1.done, !_a; _d = true) {
|
|
996
|
-
_c = source_1_1.value;
|
|
997
|
-
_d = false;
|
|
998
|
-
const chunk = _c;
|
|
999
|
-
const dw = new DataView(chunk.buffer, chunk.byteOffset, chunk.byteLength);
|
|
1000
|
-
let pos = 0;
|
|
1001
|
-
while (pos < chunk.byteLength) {
|
|
1002
|
-
switch (state) {
|
|
1003
|
-
case 0:
|
|
1004
|
-
// Beginning of a size header
|
|
1005
|
-
if (pos + 4 > chunk.byteLength) {
|
|
1006
|
-
for (const b of chunk.slice(pos)) {
|
|
1007
|
-
if (sizeBufPos === 4)
|
|
1008
|
-
break;
|
|
1009
|
-
sizeBuf[sizeBufPos++] = b;
|
|
1010
|
-
++pos;
|
|
1011
|
-
}
|
|
1012
|
-
if (sizeBufPos < 4) {
|
|
1013
|
-
// Need more bytes in order to read length.
|
|
1014
|
-
// Will go out from while loop as well because pos is defenitely = chunk.byteLength here.
|
|
1015
|
-
break;
|
|
1016
|
-
}
|
|
1017
|
-
}
|
|
1018
|
-
else if (sizeBufPos > 0 && sizeBufPos < 4) {
|
|
1019
|
-
for (const b of chunk.slice(pos, pos + 4 - sizeBufPos)) {
|
|
1020
|
-
sizeBuf[sizeBufPos++] = b;
|
|
1021
|
-
++pos;
|
|
1022
|
-
}
|
|
1023
|
-
}
|
|
1024
|
-
// Intentional fall-through...
|
|
1025
|
-
case 1:
|
|
1026
|
-
len =
|
|
1027
|
-
sizeBufPos === 4
|
|
1028
|
-
? new DataView(sizeBuf.buffer, 0, 4).getUint32(0, false)
|
|
1029
|
-
: dw.getUint32(pos, false);
|
|
1030
|
-
if (sizeBufPos)
|
|
1031
|
-
sizeBufPos = 0; // in this case pos is already forwarded
|
|
1032
|
-
else
|
|
1033
|
-
pos += 4; // else pos is not yet forwarded - that's why we do it now
|
|
1034
|
-
// Intentional fall-through...
|
|
1035
|
-
case 2:
|
|
1036
|
-
// Eat the chunk
|
|
1037
|
-
if (pos >= chunk.byteLength) {
|
|
1038
|
-
state = 2;
|
|
976
|
+
// Start running the machine. If the last stage is a sink, it will consume the data and never emit anything
|
|
977
|
+
// to us here...
|
|
978
|
+
for await (const chunk of result) { }
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
async function* consumeChunkedBinaryStream(source) {
|
|
982
|
+
let state = 0;
|
|
983
|
+
let sizeBuf = new Uint8Array(4);
|
|
984
|
+
let sizeBufPos = 0;
|
|
985
|
+
let bufs = [];
|
|
986
|
+
let len = 0;
|
|
987
|
+
for await (const chunk of source) {
|
|
988
|
+
const dw = new DataView(chunk.buffer, chunk.byteOffset, chunk.byteLength);
|
|
989
|
+
let pos = 0;
|
|
990
|
+
while (pos < chunk.byteLength) {
|
|
991
|
+
switch (state) {
|
|
992
|
+
case 0:
|
|
993
|
+
// Beginning of a size header
|
|
994
|
+
if (pos + 4 > chunk.byteLength) {
|
|
995
|
+
for (const b of chunk.slice(pos)) {
|
|
996
|
+
if (sizeBufPos === 4)
|
|
1039
997
|
break;
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
}
|
|
1047
|
-
else {
|
|
1048
|
-
if (bufs.length > 0) {
|
|
1049
|
-
const concats = new Uint8Array(bufs.reduce((p, c) => p + c.byteLength, len));
|
|
1050
|
-
let p = 0;
|
|
1051
|
-
for (const buf of bufs) {
|
|
1052
|
-
concats.set(buf, p);
|
|
1053
|
-
p += buf.byteLength;
|
|
1054
|
-
}
|
|
1055
|
-
concats.set(chunk.slice(pos, pos + len), p);
|
|
1056
|
-
bufs = [];
|
|
1057
|
-
yield yield __await(concats);
|
|
1058
|
-
}
|
|
1059
|
-
else {
|
|
1060
|
-
yield yield __await(chunk.slice(pos, pos + len));
|
|
1061
|
-
}
|
|
1062
|
-
pos += len;
|
|
1063
|
-
state = 0;
|
|
1064
|
-
}
|
|
998
|
+
sizeBuf[sizeBufPos++] = b;
|
|
999
|
+
++pos;
|
|
1000
|
+
}
|
|
1001
|
+
if (sizeBufPos < 4) {
|
|
1002
|
+
// Need more bytes in order to read length.
|
|
1003
|
+
// Will go out from while loop as well because pos is defenitely = chunk.byteLength here.
|
|
1065
1004
|
break;
|
|
1005
|
+
}
|
|
1066
1006
|
}
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1007
|
+
else if (sizeBufPos > 0 && sizeBufPos < 4) {
|
|
1008
|
+
for (const b of chunk.slice(pos, pos + 4 - sizeBufPos)) {
|
|
1009
|
+
sizeBuf[sizeBufPos++] = b;
|
|
1010
|
+
++pos;
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
// Intentional fall-through...
|
|
1014
|
+
case 1:
|
|
1015
|
+
len =
|
|
1016
|
+
sizeBufPos === 4
|
|
1017
|
+
? new DataView(sizeBuf.buffer, 0, 4).getUint32(0, false)
|
|
1018
|
+
: dw.getUint32(pos, false);
|
|
1019
|
+
if (sizeBufPos)
|
|
1020
|
+
sizeBufPos = 0; // in this case pos is already forwarded
|
|
1021
|
+
else
|
|
1022
|
+
pos += 4; // else pos is not yet forwarded - that's why we do it now
|
|
1023
|
+
// Intentional fall-through...
|
|
1024
|
+
case 2:
|
|
1025
|
+
// Eat the chunk
|
|
1026
|
+
if (pos >= chunk.byteLength) {
|
|
1027
|
+
state = 2;
|
|
1028
|
+
break;
|
|
1029
|
+
}
|
|
1030
|
+
if (pos + len > chunk.byteLength) {
|
|
1031
|
+
bufs.push(chunk.slice(pos));
|
|
1032
|
+
len -= (chunk.byteLength - pos);
|
|
1033
|
+
state = 2;
|
|
1034
|
+
pos = chunk.byteLength; // will break while loop.
|
|
1035
|
+
}
|
|
1036
|
+
else {
|
|
1037
|
+
if (bufs.length > 0) {
|
|
1038
|
+
const concats = new Uint8Array(bufs.reduce((p, c) => p + c.byteLength, len));
|
|
1039
|
+
let p = 0;
|
|
1040
|
+
for (const buf of bufs) {
|
|
1041
|
+
concats.set(buf, p);
|
|
1042
|
+
p += buf.byteLength;
|
|
1043
|
+
}
|
|
1044
|
+
concats.set(chunk.slice(pos, pos + len), p);
|
|
1045
|
+
bufs = [];
|
|
1046
|
+
yield concats;
|
|
1047
|
+
}
|
|
1048
|
+
else {
|
|
1049
|
+
yield chunk.slice(pos, pos + len);
|
|
1050
|
+
}
|
|
1051
|
+
pos += len;
|
|
1052
|
+
state = 0;
|
|
1053
|
+
}
|
|
1054
|
+
break;
|
|
1074
1055
|
}
|
|
1075
|
-
finally { if (e_1) throw e_1.error; }
|
|
1076
1056
|
}
|
|
1077
|
-
}
|
|
1057
|
+
}
|
|
1078
1058
|
}
|
|
1079
1059
|
|
|
1080
1060
|
function getFetchResponseBodyGenerator(res) {
|
|
1081
|
-
return function () {
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
yield yield __await(value);
|
|
1092
|
-
}
|
|
1093
|
-
}
|
|
1094
|
-
finally {
|
|
1095
|
-
reader.releaseLock();
|
|
1061
|
+
return async function* () {
|
|
1062
|
+
if (!res.body)
|
|
1063
|
+
throw new Error("Response body is not readable");
|
|
1064
|
+
const reader = res.body.getReader();
|
|
1065
|
+
try {
|
|
1066
|
+
while (true) {
|
|
1067
|
+
const { done, value } = await reader.read();
|
|
1068
|
+
if (done)
|
|
1069
|
+
return;
|
|
1070
|
+
yield value;
|
|
1096
1071
|
}
|
|
1097
|
-
}
|
|
1072
|
+
}
|
|
1073
|
+
finally {
|
|
1074
|
+
reader.releaseLock();
|
|
1075
|
+
}
|
|
1098
1076
|
};
|
|
1099
1077
|
}
|
|
1100
1078
|
|
|
@@ -2071,7 +2049,8 @@ const defs = Object.assign(Object.assign(Object.assign(Object.assign({}, undefin
|
|
|
2071
2049
|
return Object.assign({ $t: 'PropModification' }, propModification['@@propmod']);
|
|
2072
2050
|
},
|
|
2073
2051
|
revive: (_a) => {
|
|
2074
|
-
var
|
|
2052
|
+
var { $t } = _a, // strip '$t'
|
|
2053
|
+
propModSpec = __rest(_a, ["$t"]) // keep the rest
|
|
2075
2054
|
;
|
|
2076
2055
|
return new PropModification(propModSpec);
|
|
2077
2056
|
},
|
|
@@ -4494,7 +4473,8 @@ function overrideParseStoresSpec(origFunc, dexie) {
|
|
|
4494
4473
|
const cloudSchema = dexie.cloud.schema || (dexie.cloud.schema = {});
|
|
4495
4474
|
const allPrefixes = new Set();
|
|
4496
4475
|
Object.keys(storesClone).forEach(tableName => {
|
|
4497
|
-
|
|
4476
|
+
var _a;
|
|
4477
|
+
const schemaSrc = (_a = storesClone[tableName]) === null || _a === void 0 ? void 0 : _a.trim();
|
|
4498
4478
|
const cloudTableSchema = cloudSchema[tableName] || (cloudSchema[tableName] = {});
|
|
4499
4479
|
if (schemaSrc != null) {
|
|
4500
4480
|
if (/^\@/.test(schemaSrc)) {
|
|
@@ -4535,7 +4515,8 @@ function performGuardedJob(db, jobName, job) {
|
|
|
4535
4515
|
// No support for guarding jobs. IE11, node.js, etc.
|
|
4536
4516
|
return job();
|
|
4537
4517
|
}
|
|
4538
|
-
|
|
4518
|
+
// @ts-expect-error - LockManager callback type inference issue with generics
|
|
4519
|
+
return navigator.locks.request(db.name + '|' + jobName, job);
|
|
4539
4520
|
}
|
|
4540
4521
|
|
|
4541
4522
|
function performInitialSync(db, cloudOptions, cloudSchema) {
|
|
@@ -5290,12 +5271,9 @@ function verifySchema(db) {
|
|
|
5290
5271
|
}
|
|
5291
5272
|
}
|
|
5292
5273
|
|
|
5293
|
-
var n,l$1,u$1,t$1,o$1,f$1={},e$1=[],c$1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function s$1(n,l){for(var u in l)n[u]=l[u];return n}function a$1(n){var l=n.parentNode;l&&l.removeChild(n);}function h(l,u,i){var t,o,r,f={};for(r in u)"key"==r?t=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return v$1(l,f,t,o,null)}function v$1(n,i,t,o,r){var f={type:n,props:i,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++u$1:r};return null==r&&null!=l$1.vnode&&l$1.vnode(f),f}function p$1(n){return n.children}function d$1(n,l){this.props=n,this.context=l;}function _$1(n,l){if(null==l)return n.__?_$1(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?_$1(n):null}function k$1(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return k$1(n)}}function b$1(n){(!n.__d&&(n.__d=!0)&&t$1.push(n)&&!g$1.__r++||o$1!==l$1.debounceRendering)&&((o$1=l$1.debounceRendering)||setTimeout)(g$1);}function g$1(){for(var n;g$1.__r=t$1.length;)n=t$1.sort(function(n,l){return n.__v.__b-l.__v.__b}),t$1=[],n.some(function(n){var l,u,i,t,o,r;n.__d&&(o=(t=(l=n).__v).__e,(r=l.__P)&&(u=[],(i=s$1({},t)).__v=t.__v+1,j$1(r,t,i,l.__n,void 0!==r.ownerSVGElement,null!=t.__h?[o]:null,u,null==o?_$1(t):o,t.__h),z$1(u,t),t.__e!=o&&k$1(t)));});}function w$1(n,l,u,i,t,o,r,c,s,a){var h,y,d,k,b,g,w,x=i&&i.__k||e$1,C=x.length;for(u.__k=[],h=0;h<l.length;h++)if(null!=(k=u.__k[h]=null==(k=l[h])||"boolean"==typeof k?null:"string"==typeof k||"number"==typeof k||"bigint"==typeof k?v$1(null,k,null,null,k):Array.isArray(k)?v$1(p$1,{children:k},null,null,null):k.__b>0?v$1(k.type,k.props,k.key,null,k.__v):k)){if(k.__=u,k.__b=u.__b+1,null===(d=x[h])||d&&k.key==d.key&&k.type===d.type)x[h]=void 0;else for(y=0;y<C;y++){if((d=x[y])&&k.key==d.key&&k.type===d.type){x[y]=void 0;break}d=null;}j$1(n,k,d=d||f$1,t,o,r,c,s,a),b=k.__e,(y=k.ref)&&d.ref!=y&&(w||(w=[]),d.ref&&w.push(d.ref,null,k),w.push(y,k.__c||b,k)),null!=b?(null==g&&(g=b),"function"==typeof k.type&&k.__k===d.__k?k.__d=s=m$1(k,s,n):s=A(n,k,d,x,b,s),"function"==typeof u.type&&(u.__d=s)):s&&d.__e==s&&s.parentNode!=n&&(s=_$1(d));}for(u.__e=g,h=C;h--;)null!=x[h]&&("function"==typeof u.type&&null!=x[h].__e&&x[h].__e==u.__d&&(u.__d=_$1(i,h+1)),N(x[h],x[h]));if(w)for(h=0;h<w.length;h++)M(w[h],w[++h],w[++h]);}function m$1(n,l,u){for(var i,t=n.__k,o=0;t&&o<t.length;o++)(i=t[o])&&(i.__=n,l="function"==typeof i.type?m$1(i,l,u):A(u,i,i,t,i.__e,l));return l}function A(n,l,u,i,t,o){var r,f,e;if(void 0!==l.__d)r=l.__d,l.__d=void 0;else if(null==u||t!=o||null==t.parentNode)n:if(null==o||o.parentNode!==n)n.appendChild(t),r=null;else {for(f=o,e=0;(f=f.nextSibling)&&e<i.length;e+=2)if(f==t)break n;n.insertBefore(t,o),r=o;}return void 0!==r?r:t.nextSibling}function C(n,l,u,i,t){var o;for(o in u)"children"===o||"key"===o||o in l||H(n,o,null,u[o],i);for(o in l)t&&"function"!=typeof l[o]||"children"===o||"key"===o||"value"===o||"checked"===o||u[o]===l[o]||H(n,o,l[o],u[o],i);}function $(n,l,u){"-"===l[0]?n.setProperty(l,u):n[l]=null==u?"":"number"!=typeof u||c$1.test(l)?u:u+"px";}function H(n,l,u,i,t){var o;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof i&&(n.style.cssText=i=""),i)for(l in i)u&&l in u||$(n.style,l,"");if(u)for(l in u)i&&u[l]===i[l]||$(n.style,l,u[l]);}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/Capture$/,"")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?i||n.addEventListener(l,o?T:I,o):n.removeEventListener(l,o?T:I,o);else if("dangerouslySetInnerHTML"!==l){if(t)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null!=u&&(!1!==u||"a"===l[0]&&"r"===l[1])?n.setAttribute(l,u):n.removeAttribute(l));}}function I(n){this.l[n.type+!1](l$1.event?l$1.event(n):n);}function T(n){this.l[n.type+!0](l$1.event?l$1.event(n):n);}function j$1(n,u,i,t,o,r,f,e,c){var a,h,v,y,_,k,b,g,m,x,A,C,$,H=u.type;if(void 0!==u.constructor)return null;null!=i.__h&&(c=i.__h,e=u.__e=i.__e,u.__h=null,r=[e]),(a=l$1.__b)&&a(u);try{n:if("function"==typeof H){if(g=u.props,m=(a=H.contextType)&&t[a.__c],x=a?m?m.props.value:a.__:t,i.__c?b=(h=u.__c=i.__c).__=h.__E:("prototype"in H&&H.prototype.render?u.__c=h=new H(g,x):(u.__c=h=new d$1(g,x),h.constructor=H,h.render=O),m&&m.sub(h),h.props=g,h.state||(h.state={}),h.context=x,h.__n=t,v=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=H.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=s$1({},h.__s)),s$1(h.__s,H.getDerivedStateFromProps(g,h.__s))),y=h.props,_=h.state,v)null==H.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else {if(null==H.getDerivedStateFromProps&&g!==y&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(g,x),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(g,h.__s,x)||u.__v===i.__v){h.props=g,h.state=h.__s,u.__v!==i.__v&&(h.__d=!1),h.__v=u,u.__e=i.__e,u.__k=i.__k,u.__k.forEach(function(n){n&&(n.__=u);}),h.__h.length&&f.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(g,h.__s,x),null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(y,_,k);});}if(h.context=x,h.props=g,h.__v=u,h.__P=n,A=l$1.__r,C=0,"prototype"in H&&H.prototype.render)h.state=h.__s,h.__d=!1,A&&A(u),a=h.render(h.props,h.state,h.context);else do{h.__d=!1,A&&A(u),a=h.render(h.props,h.state,h.context),h.state=h.__s;}while(h.__d&&++C<25);h.state=h.__s,null!=h.getChildContext&&(t=s$1(s$1({},t),h.getChildContext())),v||null==h.getSnapshotBeforeUpdate||(k=h.getSnapshotBeforeUpdate(y,_)),$=null!=a&&a.type===p$1&&null==a.key?a.props.children:a,w$1(n,Array.isArray($)?$:[$],u,i,t,o,r,f,e,c),h.base=u.__e,u.__h=null,h.__h.length&&f.push(h),b&&(h.__E=h.__=null),h.__e=!1;}else null==r&&u.__v===i.__v?(u.__k=i.__k,u.__e=i.__e):u.__e=L(i.__e,u,i,t,o,r,f,c);(a=l$1.diffed)&&a(u);}catch(n){u.__v=null,(c||null!=r)&&(u.__e=e,u.__h=!!c,r[r.indexOf(e)]=null),l$1.__e(n,u,i);}}function z$1(n,u){l$1.__c&&l$1.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l$1.__e(n,u.__v);}});}function L(l,u,i,t,o,r,e,c){var s,h,v,y=i.props,p=u.props,d=u.type,k=0;if("svg"===d&&(o=!0),null!=r)for(;k<r.length;k++)if((s=r[k])&&"setAttribute"in s==!!d&&(d?s.localName===d:3===s.nodeType)){l=s,r[k]=null;break}if(null==l){if(null===d)return document.createTextNode(p);l=o?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d,p.is&&p),r=null,c=!1;}if(null===d)y===p||c&&l.data===p||(l.data=p);else {if(r=r&&n.call(l.childNodes),h=(y=i.props||f$1).dangerouslySetInnerHTML,v=p.dangerouslySetInnerHTML,!c){if(null!=r)for(y={},k=0;k<l.attributes.length;k++)y[l.attributes[k].name]=l.attributes[k].value;(v||h)&&(v&&(h&&v.__html==h.__html||v.__html===l.innerHTML)||(l.innerHTML=v&&v.__html||""));}if(C(l,p,y,o,c),v)u.__k=[];else if(k=u.props.children,w$1(l,Array.isArray(k)?k:[k],u,i,t,o&&"foreignObject"!==d,r,e,r?r[0]:i.__k&&_$1(i,0),c),null!=r)for(k=r.length;k--;)null!=r[k]&&a$1(r[k]);c||("value"in p&&void 0!==(k=p.value)&&(k!==l.value||"progress"===d&&!k||"option"===d&&k!==y.value)&&H(l,"value",k,y.value,!1),"checked"in p&&void 0!==(k=p.checked)&&k!==l.checked&&H(l,"checked",k,y.checked,!1));}return l}function M(n,u,i){try{"function"==typeof n?n(u):n.current=u;}catch(n){l$1.__e(n,i);}}function N(n,u,i){var t,o;if(l$1.unmount&&l$1.unmount(n),(t=n.ref)&&(t.current&&t.current!==n.__e||M(t,null,u)),null!=(t=n.__c)){if(t.componentWillUnmount)try{t.componentWillUnmount();}catch(n){l$1.__e(n,u);}t.base=t.__P=null;}if(t=n.__k)for(o=0;o<t.length;o++)t[o]&&N(t[o],u,"function"!=typeof n.type);i||null==n.__e||a$1(n.__e),n.__e=n.__d=void 0;}function O(n,l,u){return this.constructor(n,u)}function P(u,i,t){var o,r,e;l$1.__&&l$1.__(u,i),r=(o="function"==typeof t)?null:t&&t.__k||i.__k,e=[],j$1(i,u=(!o&&t||i).__k=h(p$1,null,[u]),r||f$1,f$1,void 0!==i.ownerSVGElement,!o&&t?[t]:r?null:i.firstChild?n.call(i.childNodes):null,e,!o&&t?t:r?r.__e:i.firstChild,o),z$1(e,u);}n=e$1.slice,l$1={__e:function(n,l,u,i){for(var t,o,r;l=l.__;)if((t=l.__c)&&!t.__)try{if((o=t.constructor)&&null!=o.getDerivedStateFromError&&(t.setState(o.getDerivedStateFromError(n)),r=t.__d),null!=t.componentDidCatch&&(t.componentDidCatch(n,i||{}),r=t.__d),r)return t.__E=t}catch(l){n=l;}throw n}},u$1=0,d$1.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=s$1({},this.state),"function"==typeof n&&(n=n(s$1({},u),this.props)),n&&s$1(u,n),null!=n&&this.__v&&(l&&this.__h.push(l),b$1(this));},d$1.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),b$1(this));},d$1.prototype.render=p$1,t$1=[],g$1.__r=0;
|
|
5274
|
+
var n,l$1,u$1,i$1,r$1,o$1,e$1,f$1,c$1,s$1,a$1,p$1={},v$1=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,w$1=Array.isArray;function d$1(n,l){for(var u in l)n[u]=l[u];return n}function g(n){n&&n.parentNode&&n.parentNode.removeChild(n);}function _$1(l,u,t){var i,r,o,e={};for(o in u)"key"==o?i=u[o]:"ref"==o?r=u[o]:e[o]=u[o];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(o in l.defaultProps) void 0===e[o]&&(e[o]=l.defaultProps[o]);return m$1(l,e,i,r,null)}function m$1(n,t,i,r,o){var e={type:n,props:t,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++u$1:o,__i:-1,__u:0};return null==o&&null!=l$1.vnode&&l$1.vnode(e),e}function k$1(n){return n.children}function x(n,l){this.props=n,this.context=l;}function S(n,l){if(null==l)return n.__?S(n.__,n.__i+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?S(n):null}function C$1(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return C$1(n)}}function M(n){(!n.__d&&(n.__d=true)&&i$1.push(n)&&!$.__r++||r$1!=l$1.debounceRendering)&&((r$1=l$1.debounceRendering)||o$1)($);}function $(){for(var n,u,t,r,o,f,c,s=1;i$1.length;)i$1.length>s&&i$1.sort(e$1),n=i$1.shift(),s=i$1.length,n.__d&&(t=void 0,r=void 0,o=(r=(u=n).__v).__e,f=[],c=[],u.__P&&((t=d$1({},r)).__v=r.__v+1,l$1.vnode&&l$1.vnode(t),O(u.__P,t,r,u.__n,u.__P.namespaceURI,32&r.__u?[o]:null,f,null==o?S(r):o,!!(32&r.__u),c),t.__v=r.__v,t.__.__k[t.__i]=t,N(f,t,c),r.__e=r.__=null,t.__e!=o&&C$1(t)));$.__r=0;}function I(n,l,u,t,i,r,o,e,f,c,s){var a,h,y,w,d,g,_,m=t&&t.__k||v$1,b=l.length;for(f=P(u,l,m,f,b),a=0;a<b;a++)null!=(y=u.__k[a])&&(h=-1==y.__i?p$1:m[y.__i]||p$1,y.__i=a,g=O(n,y,h,i,r,o,e,f,c,s),w=y.__e,y.ref&&h.ref!=y.ref&&(h.ref&&B$1(h.ref,null,y),s.push(y.ref,y.__c||w,y)),null==d&&null!=w&&(d=w),(_=!!(4&y.__u))||h.__k===y.__k?f=A$1(y,f,n,_):"function"==typeof y.type&&void 0!==g?f=g:w&&(f=w.nextSibling),y.__u&=-7);return u.__e=d,f}function P(n,l,u,t,i){var r,o,e,f,c,s=u.length,a=s,h=0;for(n.__k=new Array(i),r=0;r<i;r++)null!=(o=l[r])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=n.__k[r]=m$1(null,o,null,null,null):w$1(o)?o=n.__k[r]=m$1(k$1,{children:o},null,null,null):null==o.constructor&&o.__b>0?o=n.__k[r]=m$1(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):n.__k[r]=o,f=r+h,o.__=n,o.__b=n.__b+1,-1!=(c=o.__i=L(o,u,f,a))&&(a--,(e=u[c])&&(e.__u|=2)),null==e||null==e.__v?(-1==c&&(i>s?h--:i<s&&h++),"function"!=typeof o.type&&(o.__u|=4)):c!=f&&(c==f-1?h--:c==f+1?h++:(c>f?h--:h++,o.__u|=4))):n.__k[r]=null;if(a)for(r=0;r<s;r++)null!=(e=u[r])&&0==(2&e.__u)&&(e.__e==t&&(t=S(e)),D$1(e,e));return t}function A$1(n,l,u,t){var i,r;if("function"==typeof n.type){for(i=n.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=n,l=A$1(i[r],l,u,t));return l}n.__e!=l&&(t&&(l&&n.type&&!l.parentNode&&(l=S(n)),u.insertBefore(n.__e,l||null)),l=n.__e);do{l=l&&l.nextSibling;}while(null!=l&&8==l.nodeType);return l}function L(n,l,u,t){var i,r,o,e=n.key,f=n.type,c=l[u],s=null!=c&&0==(2&c.__u);if(null===c&&null==e||s&&e==c.key&&f==c.type)return u;if(t>(s?1:0))for(i=u-1,r=u+1;i>=0||r<l.length;)if(null!=(c=l[o=i>=0?i--:r++])&&0==(2&c.__u)&&e==c.key&&f==c.type)return o;return -1}function T$1(n,l,u){"-"==l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||y.test(l)?u:u+"px";}function j$1(n,l,u,t,i){var r,o;n:if("style"==l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof t&&(n.style.cssText=t=""),t)for(l in t)u&&l in u||T$1(n.style,l,"");if(u)for(l in u)t&&u[l]==t[l]||T$1(n.style,l,u[l]);}else if("o"==l[0]&&"n"==l[1])r=l!=(l=l.replace(f$1,"$1")),o=l.toLowerCase(),l=o in n||"onFocusOut"==l||"onFocusIn"==l?o.slice(2):l.slice(2),n.l||(n.l={}),n.l[l+r]=u,u?t?u.u=t.u:(u.u=c$1,n.addEventListener(l,r?a$1:s$1,r)):n.removeEventListener(l,r?a$1:s$1,r);else {if("http://www.w3.org/2000/svg"==i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=l&&"height"!=l&&"href"!=l&&"list"!=l&&"form"!=l&&"tabIndex"!=l&&"download"!=l&&"rowSpan"!=l&&"colSpan"!=l&&"role"!=l&&"popover"!=l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||false===u&&"-"!=l[4]?n.removeAttribute(l):n.setAttribute(l,"popover"==l&&1==u?"":u));}}function F(n){return function(u){if(this.l){var t=this.l[u.type+n];if(null==u.t)u.t=c$1++;else if(u.t<t.u)return;return t(l$1.event?l$1.event(u):u)}}}function O(n,u,t,i,r,o,e,f,c,s){var a,h,p,v,y,_,m,b,S,C,M,$,P,A,H,L,T,j=u.type;if(null!=u.constructor)return null;128&t.__u&&(c=!!(32&t.__u),o=[f=u.__e=t.__e]),(a=l$1.__b)&&a(u);n:if("function"==typeof j)try{if(b=u.props,S="prototype"in j&&j.prototype.render,C=(a=j.contextType)&&i[a.__c],M=a?C?C.props.value:a.__:i,t.__c?m=(h=u.__c=t.__c).__=h.__E:(S?u.__c=h=new j(b,M):(u.__c=h=new x(b,M),h.constructor=j,h.render=E),C&&C.sub(h),h.state||(h.state={}),h.__n=i,p=h.__d=!0,h.__h=[],h._sb=[]),S&&null==h.__s&&(h.__s=h.state),S&&null!=j.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=d$1({},h.__s)),d$1(h.__s,j.getDerivedStateFromProps(b,h.__s))),v=h.props,y=h.state,h.__v=u,p)S&&null==j.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),S&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else {if(S&&null==j.getDerivedStateFromProps&&b!==v&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(b,M),u.__v==t.__v||!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(b,h.__s,M)){for(u.__v!=t.__v&&(h.props=b,h.state=h.__s,h.__d=!1),u.__e=t.__e,u.__k=t.__k,u.__k.some(function(n){n&&(n.__=u);}),$=0;$<h._sb.length;$++)h.__h.push(h._sb[$]);h._sb=[],h.__h.length&&e.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(b,h.__s,M),S&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(v,y,_);});}if(h.context=M,h.props=b,h.__P=n,h.__e=!1,P=l$1.__r,A=0,S){for(h.state=h.__s,h.__d=!1,P&&P(u),a=h.render(h.props,h.state,h.context),H=0;H<h._sb.length;H++)h.__h.push(h._sb[H]);h._sb=[];}else do{h.__d=!1,P&&P(u),a=h.render(h.props,h.state,h.context),h.state=h.__s;}while(h.__d&&++A<25);h.state=h.__s,null!=h.getChildContext&&(i=d$1(d$1({},i),h.getChildContext())),S&&!p&&null!=h.getSnapshotBeforeUpdate&&(_=h.getSnapshotBeforeUpdate(v,y)),L=a,null!=a&&a.type===k$1&&null==a.key&&(L=V(a.props.children)),f=I(n,w$1(L)?L:[L],u,t,i,r,o,e,f,c,s),h.base=u.__e,u.__u&=-161,h.__h.length&&e.push(h),m&&(h.__E=h.__=null);}catch(n){if(u.__v=null,c||null!=o)if(n.then){for(u.__u|=c?160:128;f&&8==f.nodeType&&f.nextSibling;)f=f.nextSibling;o[o.indexOf(f)]=null,u.__e=f;}else {for(T=o.length;T--;)g(o[T]);z$1(u);}else u.__e=t.__e,u.__k=t.__k,n.then||z$1(u);l$1.__e(n,u,t);}else null==o&&u.__v==t.__v?(u.__k=t.__k,u.__e=t.__e):f=u.__e=q(t.__e,u,t,i,r,o,e,c,s);return (a=l$1.diffed)&&a(u),128&u.__u?void 0:f}function z$1(n){n&&n.__c&&(n.__c.__e=true),n&&n.__k&&n.__k.forEach(z$1);}function N(n,u,t){for(var i=0;i<t.length;i++)B$1(t[i],t[++i],t[++i]);l$1.__c&&l$1.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l$1.__e(n,u.__v);}});}function V(n){return "object"!=typeof n||null==n||n.__b&&n.__b>0?n:w$1(n)?n.map(V):d$1({},n)}function q(u,t,i,r,o,e,f,c,s){var a,h,v,y,d,_,m,b=i.props||p$1,k=t.props,x=t.type;if("svg"==x?o="http://www.w3.org/2000/svg":"math"==x?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=e)for(a=0;a<e.length;a++)if((d=e[a])&&"setAttribute"in d==!!x&&(x?d.localName==x:3==d.nodeType)){u=d,e[a]=null;break}if(null==u){if(null==x)return document.createTextNode(k);u=document.createElementNS(o,x,k.is&&k),c&&(l$1.__m&&l$1.__m(t,e),c=false),e=null;}if(null==x)b===k||c&&u.data==k||(u.data=k);else {if(e=e&&n.call(u.childNodes),!c&&null!=e)for(b={},a=0;a<u.attributes.length;a++)b[(d=u.attributes[a]).name]=d.value;for(a in b)if(d=b[a],"children"==a);else if("dangerouslySetInnerHTML"==a)v=d;else if(!(a in k)){if("value"==a&&"defaultValue"in k||"checked"==a&&"defaultChecked"in k)continue;j$1(u,a,null,d,o);}for(a in k)d=k[a],"children"==a?y=d:"dangerouslySetInnerHTML"==a?h=d:"value"==a?_=d:"checked"==a?m=d:c&&"function"!=typeof d||b[a]===d||j$1(u,a,d,b[a],o);if(h)c||v&&(h.__html==v.__html||h.__html==u.innerHTML)||(u.innerHTML=h.__html),t.__k=[];else if(v&&(u.innerHTML=""),I("template"==t.type?u.content:u,w$1(y)?y:[y],t,i,r,"foreignObject"==x?"http://www.w3.org/1999/xhtml":o,e,f,e?e[0]:i.__k&&S(i,0),c,s),null!=e)for(a=e.length;a--;)g(e[a]);c||(a="value","progress"==x&&null==_?u.removeAttribute("value"):null!=_&&(_!==u[a]||"progress"==x&&!_||"option"==x&&_!=b[a])&&j$1(u,a,_,b[a],o),a="checked",null!=m&&m!=u[a]&&j$1(u,a,m,b[a],o));}return u}function B$1(n,u,t){try{if("function"==typeof n){var i="function"==typeof n.__u;i&&n.__u(),i&&null==u||(n.__u=n(u));}else n.current=u;}catch(n){l$1.__e(n,t);}}function D$1(n,u,t){var i,r;if(l$1.unmount&&l$1.unmount(n),(i=n.ref)&&(i.current&&i.current!=n.__e||B$1(i,null,u)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount();}catch(n){l$1.__e(n,u);}i.base=i.__P=null;}if(i=n.__k)for(r=0;r<i.length;r++)i[r]&&D$1(i[r],u,t||"function"!=typeof n.type);t||g(n.__e),n.__c=n.__=n.__e=void 0;}function E(n,l,u){return this.constructor(n,u)}function G(u,t,i){var r,o,e,f;t==document&&(t=document.documentElement),l$1.__&&l$1.__(u,t),o=(r="function"=="undefined")?null:t.__k,e=[],f=[],O(t,u=(t).__k=_$1(k$1,null,[u]),o||p$1,p$1,t.namespaceURI,o?null:t.firstChild?n.call(t.childNodes):null,e,o?o.__e:t.firstChild,r,f),N(e,u,f);}n=v$1.slice,l$1={__e:function(n,l,u,t){for(var i,r,o;l=l.__;)if((i=l.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(n)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),o=i.__d),o)return i.__E=i}catch(l){n=l;}throw n}},u$1=0,x.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=d$1({},this.state),"function"==typeof n&&(n=n(d$1({},u),this.props)),n&&d$1(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),M(this));},x.prototype.forceUpdate=function(n){this.__v&&(this.__e=true,n&&this.__h.push(n),M(this));},x.prototype.render=k$1,i$1=[],o$1="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e$1=function(n,l){return n.__v.__b-l.__v.__b},$.__r=0,f$1=/(PointerCapture)$|Capture$/i,c$1=0,s$1=F(false),a$1=F(true);
|
|
5294
5275
|
|
|
5295
5276
|
const Styles = {
|
|
5296
|
-
Error: {
|
|
5297
|
-
color: "red",
|
|
5298
|
-
},
|
|
5299
5277
|
Alert: {
|
|
5300
5278
|
error: {
|
|
5301
5279
|
color: "red",
|
|
@@ -5414,13 +5392,13 @@ const Styles = {
|
|
|
5414
5392
|
};
|
|
5415
5393
|
|
|
5416
5394
|
function Dialog({ children, className }) {
|
|
5417
|
-
return (
|
|
5418
|
-
|
|
5419
|
-
|
|
5420
|
-
|
|
5395
|
+
return (_$1("div", { className: `dexie-dialog ${className || ''}` },
|
|
5396
|
+
_$1("div", { style: Styles.Darken }),
|
|
5397
|
+
_$1("div", { style: Styles.DialogOuter },
|
|
5398
|
+
_$1("div", { style: Styles.DialogInner }, children))));
|
|
5421
5399
|
}
|
|
5422
5400
|
|
|
5423
|
-
var t,r,u,i,o=0,
|
|
5401
|
+
var t,r,u,i,o=0,f=[],c=l$1,e=c.__b,a=c.__r,v=c.diffed,l=c.__c,m=c.unmount,s=c.__;function p(n,t){c.__h&&c.__h(r,n,o||t),o=0;var u=r.__H||(r.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({}),u.__[n]}function d(n){return o=1,h(D,n)}function h(n,u,i){var o=p(t++,2);if(o.t=n,!o.__c&&(o.__=[D(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}));}],o.__c=r,!r.__f)){var f=function(n,t,r){if(!o.__c.__H)return true;var u=o.__c.__H.__.filter(function(n){return !!n.__c});if(u.every(function(n){return !n.__N}))return !c||c.call(this,n,t,r);var i=o.__c.props!==n;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=true);}}),c&&c.call(this,n,t,r)||i};r.__f=true;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u;}e&&e.call(this,n,t,r);},r.shouldComponentUpdate=f;}return o.__N||o.__}function _(n,u){var i=p(t++,4);!c.__s&&C(i.__H,u)&&(i.__=n,i.u=u,r.__h.push(i));}function A(n){return o=5,T(function(){return {current:n}},[])}function T(n,r){var u=p(t++,7);return C(u.__H,r)&&(u.__=n(),u.__H=r,u.__h=n),u.__}function j(){for(var n;n=f.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(z),n.__H.__h.forEach(B),n.__H.__h=[];}catch(t){n.__H.__h=[],c.__e(t,n.__v);}}c.__b=function(n){r=null,e&&e(n);},c.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),s&&s(n,t);},c.__r=function(n){a&&a(n),t=0;var i=(r=n.__c).__H;i&&(u===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0;})):(i.__h.forEach(z),i.__h.forEach(B),i.__h=[],t=0)),u=r;},c.diffed=function(n){v&&v(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==f.push(t)&&i===c.requestAnimationFrame||((i=c.requestAnimationFrame)||w)(j)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0;})),u=r=null;},c.__c=function(n,t){t.some(function(n){try{n.__h.forEach(z),n.__h=n.__h.filter(function(n){return !n.__||B(n)});}catch(r){t.some(function(n){n.__h&&(n.__h=[]);}),t=[],c.__e(r,n.__v);}}),l&&l(n,t);},c.unmount=function(n){m&&m(n);var t,r=n.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{z(n);}catch(n){t=n;}}),r.__H=void 0,t&&c.__e(t,r.__v));};var k="function"==typeof requestAnimationFrame;function w(n){var t,r=function(){clearTimeout(u),k&&cancelAnimationFrame(t),setTimeout(n);},u=setTimeout(r,35);k&&(t=requestAnimationFrame(r));}function z(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t;}function B(n){var t=r;n.__c=n.__(),r=t;}function C(n,t){return !n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function D(n,t){return "function"==typeof t?t(n):t}
|
|
5424
5402
|
|
|
5425
5403
|
/** Resolve a message template with parameters.
|
|
5426
5404
|
*
|
|
@@ -5442,19 +5420,19 @@ function resolveText({ message, messageCode, messageParams }) {
|
|
|
5442
5420
|
|
|
5443
5421
|
const OTP_LENGTH = 8;
|
|
5444
5422
|
function LoginDialog({ title, type, alerts, fields, submitLabel, cancelLabel, onCancel, onSubmit, }) {
|
|
5445
|
-
const [params, setParams] =
|
|
5446
|
-
const firstFieldRef =
|
|
5447
|
-
|
|
5448
|
-
return (
|
|
5449
|
-
|
|
5450
|
-
|
|
5451
|
-
alerts.map((alert) => (
|
|
5452
|
-
|
|
5423
|
+
const [params, setParams] = d({});
|
|
5424
|
+
const firstFieldRef = A(null);
|
|
5425
|
+
_(() => { var _a; return (_a = firstFieldRef.current) === null || _a === void 0 ? void 0 : _a.focus(); }, []);
|
|
5426
|
+
return (_$1(Dialog, { className: "dxc-login-dlg" },
|
|
5427
|
+
_$1(k$1, null,
|
|
5428
|
+
_$1("h3", { style: Styles.WindowHeader }, title),
|
|
5429
|
+
alerts.map((alert) => (_$1("p", { style: Styles.Alert[alert.type] }, resolveText(alert)))),
|
|
5430
|
+
_$1("form", { onSubmit: (ev) => {
|
|
5453
5431
|
ev.preventDefault();
|
|
5454
5432
|
onSubmit(params);
|
|
5455
|
-
} }, Object.entries(fields).map(([fieldName, { type, label, placeholder }], idx) => (
|
|
5433
|
+
} }, Object.entries(fields).map(([fieldName, { type, label, placeholder }], idx) => (_$1("label", { style: Styles.Label, key: idx },
|
|
5456
5434
|
label ? `${label}: ` : '',
|
|
5457
|
-
|
|
5435
|
+
_$1("input", { ref: idx === 0 ? firstFieldRef : undefined, type: type, name: fieldName, autoComplete: "on", style: Styles.Input, autoFocus: true, placeholder: placeholder, value: params[fieldName] || '', onInput: (ev) => {
|
|
5458
5436
|
var _a;
|
|
5459
5437
|
const value = valueTransformer(type, (_a = ev.target) === null || _a === void 0 ? void 0 : _a['value']);
|
|
5460
5438
|
let updatedParams = Object.assign(Object.assign({}, params), { [fieldName]: value });
|
|
@@ -5464,10 +5442,10 @@ function LoginDialog({ title, type, alerts, fields, submitLabel, cancelLabel, on
|
|
|
5464
5442
|
onSubmit(updatedParams);
|
|
5465
5443
|
}
|
|
5466
5444
|
} })))))),
|
|
5467
|
-
|
|
5468
|
-
|
|
5469
|
-
|
|
5470
|
-
cancelLabel && (
|
|
5445
|
+
_$1("div", { style: Styles.ButtonsDiv },
|
|
5446
|
+
_$1(k$1, null,
|
|
5447
|
+
_$1("button", { type: "submit", style: Styles.PrimaryButton, onClick: () => onSubmit(params) }, submitLabel),
|
|
5448
|
+
cancelLabel && (_$1("button", { style: Styles.Button, onClick: onCancel }, cancelLabel))))));
|
|
5471
5449
|
}
|
|
5472
5450
|
function valueTransformer(type, value) {
|
|
5473
5451
|
switch (type) {
|
|
@@ -5480,7 +5458,7 @@ function valueTransformer(type, value) {
|
|
|
5480
5458
|
}
|
|
5481
5459
|
}
|
|
5482
5460
|
|
|
5483
|
-
class LoginGui extends
|
|
5461
|
+
class LoginGui extends x {
|
|
5484
5462
|
constructor(props) {
|
|
5485
5463
|
super(props);
|
|
5486
5464
|
this.observer = (userInteraction) => this.setState({ userInteraction });
|
|
@@ -5499,7 +5477,7 @@ class LoginGui extends d$1 {
|
|
|
5499
5477
|
if (!userInteraction)
|
|
5500
5478
|
return null;
|
|
5501
5479
|
//if (props.db.cloud.userInteraction.observers.length > 1) return null; // Someone else subscribes.
|
|
5502
|
-
return
|
|
5480
|
+
return _$1(LoginDialog, Object.assign({}, userInteraction));
|
|
5503
5481
|
}
|
|
5504
5482
|
}
|
|
5505
5483
|
function setupDefaultGUI(db) {
|
|
@@ -5507,13 +5485,13 @@ function setupDefaultGUI(db) {
|
|
|
5507
5485
|
const el = document.createElement('div');
|
|
5508
5486
|
if (document.body) {
|
|
5509
5487
|
document.body.appendChild(el);
|
|
5510
|
-
|
|
5488
|
+
G(_$1(LoginGui, { db: db.vip }), el);
|
|
5511
5489
|
}
|
|
5512
5490
|
else {
|
|
5513
5491
|
addEventListener('DOMContentLoaded', () => {
|
|
5514
5492
|
if (!closed) {
|
|
5515
5493
|
document.body.appendChild(el);
|
|
5516
|
-
|
|
5494
|
+
G(_$1(LoginGui, { db: db.vip }), el);
|
|
5517
5495
|
}
|
|
5518
5496
|
});
|
|
5519
5497
|
}
|
|
@@ -6097,7 +6075,7 @@ function dexieCloud(dexie) {
|
|
|
6097
6075
|
const syncComplete = new Subject();
|
|
6098
6076
|
dexie.cloud = {
|
|
6099
6077
|
// @ts-ignore
|
|
6100
|
-
version: "4.2.
|
|
6078
|
+
version: "4.2.5",
|
|
6101
6079
|
options: Object.assign({}, DEFAULT_OPTIONS),
|
|
6102
6080
|
schema: null,
|
|
6103
6081
|
get currentUserId() {
|
|
@@ -6414,7 +6392,7 @@ function dexieCloud(dexie) {
|
|
|
6414
6392
|
}
|
|
6415
6393
|
}
|
|
6416
6394
|
// @ts-ignore
|
|
6417
|
-
dexieCloud.version = "4.2.
|
|
6395
|
+
dexieCloud.version = "4.2.5";
|
|
6418
6396
|
Dexie.Cloud = dexieCloud;
|
|
6419
6397
|
|
|
6420
6398
|
// In case the SW lives for a while, let it reuse already opened connections:
|