@burdenoff/microfe-healthybowl 2026.1017.3 → 2026.1018.2
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/healthybowl/offline/OfflineSyncProvider.js +1 -1
- package/dist/healthybowl/offline/store.js +162 -154
- package/dist/healthybowl/pages/distribution/PickupManifestPage.js +149 -149
- package/dist/healthybowl/pages/field-capture/OfflineSettingsPage.js +2 -3
- package/dist/healthybowl/pages/livestock/LivestockFeedCard.js +91 -89
- package/dist/healthybowl/pages/livestock/LivestockGrowthCard.js +91 -89
- package/package.json +1 -1
|
@@ -32,56 +32,56 @@ function p(e) {
|
|
|
32
32
|
updatedAt: Date.now()
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function m(e, t) {
|
|
36
36
|
return typeof e != "string" || e === "" || typeof t != "string" || t === "" ? null : {
|
|
37
37
|
workspaceId: e,
|
|
38
38
|
actorId: t
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function h(e) {
|
|
42
42
|
return !!e && typeof e.workspaceId == "string" && e.workspaceId !== "" && typeof e.actorId == "string" && e.actorId !== "";
|
|
43
43
|
}
|
|
44
|
-
function h(e, t) {
|
|
45
|
-
return m(t) && e.workspaceId === t.workspaceId && e.actorId === t.actorId;
|
|
46
|
-
}
|
|
47
44
|
function g(e, t) {
|
|
48
|
-
return
|
|
45
|
+
return h(t) && e.workspaceId === t.workspaceId && e.actorId === t.actorId;
|
|
46
|
+
}
|
|
47
|
+
function _(e, t) {
|
|
48
|
+
return h(t) && !e.actorId && e.workspaceId === t.workspaceId;
|
|
49
49
|
}
|
|
50
|
-
var
|
|
50
|
+
var ee = new Set([
|
|
51
51
|
"QUEUED",
|
|
52
52
|
"UPLOADING",
|
|
53
53
|
"FAILED",
|
|
54
54
|
"CONFLICT"
|
|
55
55
|
]);
|
|
56
|
-
function
|
|
57
|
-
return
|
|
56
|
+
function v(e, t) {
|
|
57
|
+
return _(e, t) && ee.has(e.status);
|
|
58
58
|
}
|
|
59
|
-
var
|
|
59
|
+
var y = class extends Error {
|
|
60
60
|
constructor(e) {
|
|
61
61
|
super(e), this.name = "OfflineOwnershipError";
|
|
62
62
|
}
|
|
63
|
-
},
|
|
63
|
+
}, te = {
|
|
64
64
|
[r]: "clientId",
|
|
65
65
|
[i]: "id",
|
|
66
66
|
[a]: "id",
|
|
67
67
|
[s]: "clientId",
|
|
68
68
|
[c]: "actorId"
|
|
69
|
-
},
|
|
70
|
-
function
|
|
71
|
-
if (
|
|
72
|
-
|
|
73
|
-
for (let t of
|
|
69
|
+
}, b = null, x = !1, S = /* @__PURE__ */ new Set();
|
|
70
|
+
function C(e) {
|
|
71
|
+
if (x !== e) {
|
|
72
|
+
x = e;
|
|
73
|
+
for (let t of S) t(e);
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
function
|
|
77
|
-
return
|
|
76
|
+
function ne() {
|
|
77
|
+
return x;
|
|
78
78
|
}
|
|
79
|
-
function
|
|
80
|
-
return
|
|
81
|
-
|
|
79
|
+
function w(e) {
|
|
80
|
+
return S.add(e), () => {
|
|
81
|
+
S.delete(e);
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
|
-
var
|
|
84
|
+
var T = {
|
|
85
85
|
[r]: /* @__PURE__ */ new Map(),
|
|
86
86
|
[i]: /* @__PURE__ */ new Map(),
|
|
87
87
|
[a]: /* @__PURE__ */ new Map(),
|
|
@@ -89,15 +89,15 @@ var C = {
|
|
|
89
89
|
[s]: /* @__PURE__ */ new Map(),
|
|
90
90
|
[c]: /* @__PURE__ */ new Map()
|
|
91
91
|
};
|
|
92
|
-
function
|
|
92
|
+
function E() {
|
|
93
93
|
try {
|
|
94
94
|
return typeof indexedDB < "u" && indexedDB !== null;
|
|
95
95
|
} catch {
|
|
96
96
|
return !1;
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
function
|
|
100
|
-
return
|
|
99
|
+
function D() {
|
|
100
|
+
return b || (b = new Promise((e, l) => {
|
|
101
101
|
let u = indexedDB.open(t, n);
|
|
102
102
|
u.onupgradeneeded = (e) => {
|
|
103
103
|
let t = u.result;
|
|
@@ -114,80 +114,80 @@ function T() {
|
|
|
114
114
|
n !== t.value && t.update(n), t.continue();
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
|
-
}, u.onblocked = () =>
|
|
118
|
-
|
|
117
|
+
}, u.onblocked = () => C(!0), u.onsuccess = () => {
|
|
118
|
+
C(!1);
|
|
119
119
|
let t = u.result;
|
|
120
120
|
t.onversionchange = () => {
|
|
121
|
-
t.close(),
|
|
121
|
+
t.close(), b = null;
|
|
122
122
|
}, e(t);
|
|
123
123
|
}, u.onerror = () => {
|
|
124
|
-
|
|
124
|
+
C(!1), b = null, l(u.error);
|
|
125
125
|
};
|
|
126
|
-
}),
|
|
126
|
+
}), b);
|
|
127
127
|
}
|
|
128
|
-
function
|
|
129
|
-
return
|
|
128
|
+
function O(e, t, n) {
|
|
129
|
+
return D().then((r) => new Promise((i, a) => {
|
|
130
130
|
let o = n(r.transaction(e, t).objectStore(e));
|
|
131
131
|
o.onsuccess = () => i(o.result), o.onerror = () => a(o.error);
|
|
132
132
|
}));
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function k(e, t, n) {
|
|
135
135
|
if (n !== void 0) return String(n);
|
|
136
|
-
let r = e === o ? void 0 :
|
|
136
|
+
let r = e === o ? void 0 : te[e], i = r && f(t) ? t[r] : void 0;
|
|
137
137
|
if (typeof i != "string" || i === "") throw Error(`Offline ${e} row has no ${r ?? "key"}`);
|
|
138
138
|
return i;
|
|
139
139
|
}
|
|
140
|
-
async function
|
|
141
|
-
if (!
|
|
142
|
-
|
|
140
|
+
async function A(e, t, n) {
|
|
141
|
+
if (!E()) {
|
|
142
|
+
T[e].set(k(e, t, n), t);
|
|
143
143
|
return;
|
|
144
144
|
}
|
|
145
|
-
await
|
|
145
|
+
await O(e, "readwrite", (e) => n === void 0 ? e.put(t) : e.put(t, n));
|
|
146
146
|
}
|
|
147
|
-
async function
|
|
148
|
-
return
|
|
147
|
+
async function j(e, t) {
|
|
148
|
+
return E() ? O(e, "readonly", (e) => e.get(t)) : T[e].get(String(t));
|
|
149
149
|
}
|
|
150
|
-
async function
|
|
151
|
-
return
|
|
150
|
+
async function M(e) {
|
|
151
|
+
return E() ? O(e, "readonly", (e) => e.getAll()) : Array.from(T[e].values());
|
|
152
152
|
}
|
|
153
|
-
async function
|
|
154
|
-
return
|
|
153
|
+
async function re(e) {
|
|
154
|
+
return E() ? O(e, "readonly", (e) => e.getAllKeys()) : Array.from(T[e].keys());
|
|
155
155
|
}
|
|
156
|
-
async function
|
|
157
|
-
if (!
|
|
158
|
-
|
|
156
|
+
async function N(e, t) {
|
|
157
|
+
if (!E()) {
|
|
158
|
+
T[e].delete(String(t));
|
|
159
159
|
return;
|
|
160
160
|
}
|
|
161
|
-
await
|
|
161
|
+
await O(e, "readwrite", (e) => e.delete(t));
|
|
162
162
|
}
|
|
163
|
-
async function
|
|
164
|
-
if (!
|
|
165
|
-
|
|
163
|
+
async function ie(e) {
|
|
164
|
+
if (!E()) {
|
|
165
|
+
T[e].clear();
|
|
166
166
|
return;
|
|
167
167
|
}
|
|
168
|
-
await
|
|
168
|
+
await O(e, "readwrite", (e) => e.clear());
|
|
169
169
|
}
|
|
170
|
-
function
|
|
171
|
-
if (typeof t.workspaceId != "string" || t.workspaceId === "") throw new
|
|
172
|
-
if (typeof t.actorId != "string" || t.actorId === "") throw new
|
|
170
|
+
function P(e, t) {
|
|
171
|
+
if (typeof t.workspaceId != "string" || t.workspaceId === "") throw new y("An offline record must carry the workspace it was captured in.");
|
|
172
|
+
if (typeof t.actorId != "string" || t.actorId === "") throw new y("An offline record must carry the user who captured it.");
|
|
173
173
|
if (f(e)) {
|
|
174
|
-
if (typeof e.workspaceId == "string" && e.workspaceId !== "" && e.workspaceId !== t.workspaceId) throw new
|
|
175
|
-
if (typeof e.actorId == "string" && e.actorId !== "" && e.actorId !== t.actorId) throw new
|
|
174
|
+
if (typeof e.workspaceId == "string" && e.workspaceId !== "" && e.workspaceId !== t.workspaceId) throw new y("An offline record cannot move to another workspace.");
|
|
175
|
+
if (typeof e.actorId == "string" && e.actorId !== "" && e.actorId !== t.actorId) throw new y("An offline record cannot change owner.");
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
|
-
async function
|
|
179
|
-
let r =
|
|
180
|
-
if (!
|
|
181
|
-
let i =
|
|
182
|
-
return n.mustExist && i === void 0 ? !1 : (
|
|
178
|
+
async function F(e, t, n = {}) {
|
|
179
|
+
let r = k(e, t);
|
|
180
|
+
if (!E()) {
|
|
181
|
+
let i = T[e].get(r);
|
|
182
|
+
return n.mustExist && i === void 0 ? !1 : (P(i, t), T[e].set(r, t), !0);
|
|
183
183
|
}
|
|
184
|
-
let i = await
|
|
184
|
+
let i = await D();
|
|
185
185
|
return new Promise((a, o) => {
|
|
186
186
|
let s = i.transaction(e, "readwrite"), c = s.objectStore(e), l = null, u = !1, d = c.get(r);
|
|
187
187
|
d.onsuccess = () => {
|
|
188
188
|
if (!(n.mustExist && d.result === void 0)) {
|
|
189
189
|
try {
|
|
190
|
-
|
|
190
|
+
P(d.result, t);
|
|
191
191
|
} catch (e) {
|
|
192
192
|
l = e, s.abort();
|
|
193
193
|
return;
|
|
@@ -197,86 +197,86 @@ async function P(e, t, n = {}) {
|
|
|
197
197
|
}, s.oncomplete = () => a(u), s.onabort = () => o(l ?? s.error ?? /* @__PURE__ */ Error(`Offline ${e} write aborted`));
|
|
198
198
|
});
|
|
199
199
|
}
|
|
200
|
+
async function ae(e) {
|
|
201
|
+
return F(r, e, { mustExist: !0 });
|
|
202
|
+
}
|
|
200
203
|
async function oe(e) {
|
|
201
|
-
return
|
|
204
|
+
return F(i, e, { mustExist: !0 });
|
|
202
205
|
}
|
|
203
206
|
async function se(e) {
|
|
204
|
-
return
|
|
205
|
-
}
|
|
206
|
-
async function ce(e) {
|
|
207
|
-
return P(s, e, { mustExist: !0 });
|
|
207
|
+
return F(s, e, { mustExist: !0 });
|
|
208
208
|
}
|
|
209
|
-
var
|
|
210
|
-
async function
|
|
211
|
-
typeof e != "string" || e === "" || (
|
|
209
|
+
var I = /* @__PURE__ */ new Set();
|
|
210
|
+
async function L(e) {
|
|
211
|
+
typeof e != "string" || e === "" || (I.add(e), await A(c, {
|
|
212
212
|
actorId: e,
|
|
213
213
|
lockedAt: Date.now()
|
|
214
214
|
}));
|
|
215
215
|
}
|
|
216
|
-
async function L(e) {
|
|
217
|
-
typeof e != "string" || e === "" || (F.delete(e), await j(c, e));
|
|
218
|
-
}
|
|
219
|
-
async function le(e) {
|
|
220
|
-
return F.has(e) ? !0 : await k(c, e) !== void 0;
|
|
221
|
-
}
|
|
222
216
|
async function R(e) {
|
|
223
|
-
|
|
217
|
+
typeof e != "string" || e === "" || (I.delete(e), await N(c, e));
|
|
224
218
|
}
|
|
225
|
-
function
|
|
226
|
-
return
|
|
219
|
+
async function ce(e) {
|
|
220
|
+
return I.has(e) ? !0 : await j(c, e) !== void 0;
|
|
221
|
+
}
|
|
222
|
+
async function z(e) {
|
|
223
|
+
return h(e) ? !await ce(e.actorId) : !1;
|
|
227
224
|
}
|
|
228
|
-
|
|
229
|
-
return
|
|
225
|
+
function le(e) {
|
|
226
|
+
return I.has(e);
|
|
230
227
|
}
|
|
231
228
|
async function B(e, t) {
|
|
232
|
-
return await
|
|
229
|
+
return await z(t) ? (await M(e)).filter((e) => g(e, t)) : [];
|
|
233
230
|
}
|
|
234
|
-
async function V(e, t
|
|
235
|
-
|
|
236
|
-
let r = await k(e, n);
|
|
237
|
-
return r && h(r, t) ? r : void 0;
|
|
231
|
+
async function V(e, t) {
|
|
232
|
+
return await z(t) ? (await M(e)).filter((e) => v(e, t)) : [];
|
|
238
233
|
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
await
|
|
234
|
+
async function H(e, t, n) {
|
|
235
|
+
if (!await z(t)) return;
|
|
236
|
+
let r = await j(e, n);
|
|
237
|
+
return r && g(r, t) ? r : void 0;
|
|
242
238
|
}
|
|
243
|
-
|
|
244
|
-
|
|
239
|
+
var U = (e, t) => t.createdAt - e.createdAt;
|
|
240
|
+
async function ue(e) {
|
|
241
|
+
await F(r, e);
|
|
245
242
|
}
|
|
246
|
-
async function W(e) {
|
|
247
|
-
return (
|
|
243
|
+
async function W(e, t) {
|
|
244
|
+
return H(r, e, t);
|
|
248
245
|
}
|
|
249
246
|
async function G(e) {
|
|
250
|
-
return (await B(r, e)).sort(
|
|
247
|
+
return (await B(r, e)).sort(U);
|
|
248
|
+
}
|
|
249
|
+
async function de(e) {
|
|
250
|
+
return (await V(r, e)).sort(U);
|
|
251
251
|
}
|
|
252
252
|
async function K(e) {
|
|
253
253
|
for (let t of e.photoLocalIds) {
|
|
254
|
-
let n = await
|
|
255
|
-
n && Y(n, e) && await
|
|
254
|
+
let n = await j(i, t);
|
|
255
|
+
n && Y(n, e) && await N(i, t);
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
258
|
async function fe(e, t) {
|
|
259
|
-
let n = await
|
|
260
|
-
return n ? (await K(n), await
|
|
259
|
+
let n = await W(e, t);
|
|
260
|
+
return n ? (await K(n), await N(r, t), !0) : !1;
|
|
261
261
|
}
|
|
262
262
|
async function pe(e, t) {
|
|
263
|
-
if (!
|
|
264
|
-
let n = await
|
|
265
|
-
if (!n || !
|
|
263
|
+
if (!h(e) || !await z(e)) return null;
|
|
264
|
+
let n = await j(r, t);
|
|
265
|
+
if (!n || !v(n, e)) return null;
|
|
266
266
|
let a = {
|
|
267
267
|
...n,
|
|
268
268
|
actorId: e.actorId,
|
|
269
269
|
updatedAt: Date.now()
|
|
270
270
|
};
|
|
271
271
|
try {
|
|
272
|
-
if (!await
|
|
272
|
+
if (!await F(r, a, { mustExist: !0 })) return null;
|
|
273
273
|
} catch (e) {
|
|
274
|
-
if (e instanceof
|
|
274
|
+
if (e instanceof y) return null;
|
|
275
275
|
throw e;
|
|
276
276
|
}
|
|
277
277
|
for (let n of a.photoLocalIds) {
|
|
278
|
-
let r = await
|
|
279
|
-
r && r.clientId === t && !r.actorId && await
|
|
278
|
+
let r = await j(i, n);
|
|
279
|
+
r && r.clientId === t && !r.actorId && await F(i, {
|
|
280
280
|
...r,
|
|
281
281
|
workspaceId: e.workspaceId,
|
|
282
282
|
actorId: e.actorId
|
|
@@ -285,66 +285,66 @@ async function pe(e, t) {
|
|
|
285
285
|
return a;
|
|
286
286
|
}
|
|
287
287
|
async function me(e, t) {
|
|
288
|
-
if (!await
|
|
289
|
-
let n = await
|
|
290
|
-
return !n || !
|
|
288
|
+
if (!await z(e)) return !1;
|
|
289
|
+
let n = await j(r, t);
|
|
290
|
+
return !n || !v(n, e) ? !1 : (await K(n), await N(r, t), !0);
|
|
291
291
|
}
|
|
292
292
|
async function he(e) {
|
|
293
|
-
await
|
|
293
|
+
await F(s, e);
|
|
294
294
|
}
|
|
295
295
|
async function q(e, t) {
|
|
296
|
-
return
|
|
296
|
+
return H(s, e, t);
|
|
297
297
|
}
|
|
298
298
|
async function J(e) {
|
|
299
|
-
return (await
|
|
299
|
+
return (await B(s, e)).sort(U);
|
|
300
300
|
}
|
|
301
301
|
async function ge(e) {
|
|
302
|
-
return (await
|
|
302
|
+
return (await V(s, e)).sort(U);
|
|
303
303
|
}
|
|
304
304
|
async function _e(e, t) {
|
|
305
|
-
return await q(e, t) ? (await
|
|
305
|
+
return await q(e, t) ? (await N(s, t), !0) : !1;
|
|
306
306
|
}
|
|
307
307
|
async function ve(e, t) {
|
|
308
|
-
if (!
|
|
309
|
-
let n = await
|
|
310
|
-
if (!n || !
|
|
308
|
+
if (!h(e) || !await z(e)) return null;
|
|
309
|
+
let n = await j(s, t);
|
|
310
|
+
if (!n || !v(n, e)) return null;
|
|
311
311
|
let r = {
|
|
312
312
|
...n,
|
|
313
313
|
actorId: e.actorId,
|
|
314
314
|
updatedAt: Date.now()
|
|
315
315
|
};
|
|
316
316
|
try {
|
|
317
|
-
if (!await
|
|
317
|
+
if (!await F(s, r, { mustExist: !0 })) return null;
|
|
318
318
|
} catch (e) {
|
|
319
|
-
if (e instanceof
|
|
319
|
+
if (e instanceof y) return null;
|
|
320
320
|
throw e;
|
|
321
321
|
}
|
|
322
322
|
return r;
|
|
323
323
|
}
|
|
324
324
|
async function ye(e, t) {
|
|
325
|
-
if (!await
|
|
326
|
-
let n = await
|
|
327
|
-
return !n || !
|
|
325
|
+
if (!await z(e)) return !1;
|
|
326
|
+
let n = await j(s, t);
|
|
327
|
+
return !n || !v(n, e) ? !1 : (await N(s, t), !0);
|
|
328
328
|
}
|
|
329
329
|
function Y(e, t) {
|
|
330
330
|
return !(e.clientId !== t.clientId || e.workspaceId && e.workspaceId !== t.workspaceId || e.actorId && e.actorId !== t.actorId);
|
|
331
331
|
}
|
|
332
332
|
async function be(e) {
|
|
333
|
-
await
|
|
333
|
+
await F(i, e);
|
|
334
334
|
}
|
|
335
335
|
async function X(e, t) {
|
|
336
|
-
let n = await
|
|
336
|
+
let n = await W(e, t);
|
|
337
337
|
if (!n) return [];
|
|
338
338
|
let r = [];
|
|
339
339
|
for (let e of n.photoLocalIds) {
|
|
340
|
-
let t = await
|
|
340
|
+
let t = await j(i, e);
|
|
341
341
|
t && Y(t, n) && r.push(t);
|
|
342
342
|
}
|
|
343
343
|
return r;
|
|
344
344
|
}
|
|
345
345
|
var Z = (e) => e === "QUEUED" || e === "UPLOADING" || e === "FAILED";
|
|
346
346
|
async function xe(e) {
|
|
347
|
-
let [t, n] = await Promise.all([
|
|
347
|
+
let [t, n] = await Promise.all([G(e), J(e)]), r = 0, i = 0;
|
|
348
348
|
for (let n of t) for (let t of await X(e, n.clientId)) r += t.blob?.size ?? 0, i += 1;
|
|
349
349
|
let a = t.filter((e) => Z(e.status)).length + n.filter((e) => Z(e.status)).length;
|
|
350
350
|
return {
|
|
@@ -354,45 +354,49 @@ async function xe(e) {
|
|
|
354
354
|
};
|
|
355
355
|
}
|
|
356
356
|
function Q(e, t) {
|
|
357
|
-
return
|
|
357
|
+
return _(e, t) && e.status === "SYNCED";
|
|
358
358
|
}
|
|
359
359
|
async function Se(e) {
|
|
360
|
-
if (!(!
|
|
361
|
-
for (let t of await
|
|
362
|
-
for (let t of await
|
|
363
|
-
for (let t of await
|
|
360
|
+
if (!(!h(e) || !await z(e))) {
|
|
361
|
+
for (let t of await G(e)) if (t.status === "SYNCED") for (let n of await X(e, t.clientId)) n.fileId && await N(i, n.id);
|
|
362
|
+
for (let t of await M(r)) Q(t, e) && (await K(t), await N(r, t.clientId));
|
|
363
|
+
for (let t of await M(s)) Q(t, e) && await N(s, t.clientId);
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
366
|
async function Ce(e) {
|
|
367
|
-
if (!e.workspaceId || !e.actorId) throw new
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
367
|
+
if (!e.workspaceId || !e.actorId) throw new y("A sync history entry must carry the session it describes.");
|
|
368
|
+
let t = {
|
|
369
|
+
workspaceId: e.workspaceId,
|
|
370
|
+
actorId: e.actorId
|
|
371
|
+
};
|
|
372
|
+
await A(a, e);
|
|
373
|
+
let n = (await M(a)).filter((e) => g(e, t));
|
|
374
|
+
if (n.length > 200) {
|
|
375
|
+
let e = n.sort((e, t) => e.at - t.at).slice(0, n.length - 200);
|
|
376
|
+
for (let t of e) await N(a, t.id);
|
|
373
377
|
}
|
|
374
378
|
}
|
|
375
379
|
async function we(e) {
|
|
376
|
-
return (await
|
|
380
|
+
return (await B(a, e)).sort((e, t) => t.at - e.at);
|
|
377
381
|
}
|
|
378
382
|
async function Te() {
|
|
379
|
-
let t = await
|
|
383
|
+
let t = await j(o, l);
|
|
380
384
|
return {
|
|
381
385
|
...e,
|
|
382
386
|
...t ?? {}
|
|
383
387
|
};
|
|
384
388
|
}
|
|
385
389
|
async function Ee(e) {
|
|
386
|
-
await
|
|
390
|
+
await A(o, e, l);
|
|
387
391
|
}
|
|
388
392
|
function $(e, t) {
|
|
389
393
|
return `${u}${t}:${encodeURIComponent(e.workspaceId)}:${encodeURIComponent(e.actorId)}`;
|
|
390
394
|
}
|
|
391
395
|
async function De(e, t) {
|
|
392
|
-
if (!(!
|
|
396
|
+
if (!(!h(e) || !await z(e))) return j(o, $(e, t));
|
|
393
397
|
}
|
|
394
398
|
async function Oe(e, t, n) {
|
|
395
|
-
|
|
399
|
+
h(e) && await A(o, n, $(e, t));
|
|
396
400
|
}
|
|
397
401
|
async function ke(e) {
|
|
398
402
|
if ("allSessions" in e) {
|
|
@@ -404,21 +408,25 @@ async function ke(e) {
|
|
|
404
408
|
o,
|
|
405
409
|
s,
|
|
406
410
|
c
|
|
407
|
-
]) await
|
|
408
|
-
|
|
411
|
+
]) await ie(e);
|
|
412
|
+
I.clear();
|
|
409
413
|
return;
|
|
410
414
|
}
|
|
411
415
|
let { actorId: t } = e;
|
|
412
416
|
if (typeof t != "string" || t === "") return;
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
417
|
+
try {
|
|
418
|
+
await L(t);
|
|
419
|
+
} catch {
|
|
420
|
+
console.warn("[HealthyBowl offline] Persisted purge lock unavailable; continuing with an in-tab lock only.");
|
|
421
|
+
}
|
|
422
|
+
let n = (await M(r)).filter((e) => e.actorId === t);
|
|
423
|
+
for (let e of n) await K(e), await N(r, e.clientId);
|
|
424
|
+
for (let e of await M(i)) e.actorId === t && await N(i, e.id);
|
|
425
|
+
for (let e of await M(s)) e.actorId === t && await N(s, e.clientId);
|
|
426
|
+
for (let e of await M(a)) e.actorId === t && await N(a, e.id);
|
|
419
427
|
let l = `:${encodeURIComponent(t)}`;
|
|
420
|
-
for (let e of await
|
|
421
|
-
await
|
|
428
|
+
for (let e of await re(o)) typeof e == "string" && e.startsWith(u) && e.endsWith(l) && await N(o, e);
|
|
429
|
+
await R(t);
|
|
422
430
|
}
|
|
423
431
|
//#endregion
|
|
424
|
-
export { Ce as addHistoryEntry, pe as claimUnattributedObservation, ve as claimUnattributedPendingMutation, Se as clearSyncedCache, fe as deleteObservation, _e as deletePendingMutation, me as discardUnattributedObservation, ye as discardUnattributedPendingMutation, xe as estimateLocalUsage,
|
|
432
|
+
export { Ce as addHistoryEntry, pe as claimUnattributedObservation, ve as claimUnattributedPendingMutation, Se as clearSyncedCache, fe as deleteObservation, _e as deletePendingMutation, me as discardUnattributedObservation, ye as discardUnattributedPendingMutation, xe as estimateLocalUsage, G as getAllObservations, J as getAllPendingMutations, we as getHistory, W as getObservation, q as getPendingMutation, X as getPhotosFor, De as getScopedMeta, de as getUnattributedObservations, ge as getUnattributedPendingMutations, le as isOfflineActorLockedInThisTab, z as isOfflineScopeOpen, ne as isOfflineStoreBlocked, Te as loadSettings, L as lockOfflineActor, ke as purgeOfflineData, ue as saveObservation, he as savePendingMutation, be as savePhoto, Ee as saveSettings, Oe as setScopedMeta, w as subscribeOfflineStoreBlocked, m as toOfflineScope, R as unlockOfflineActor, ae as updateObservation, se as updatePendingMutation, oe as updatePhoto };
|