@mobx-query/core 0.2.4 → 0.2.6
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/client/MQClient.d.ts +3 -2
- package/dist/client/MQClientAccessor.d.ts +3 -2
- package/dist/core.js +540 -546
- package/dist/entity/Entity.d.ts +1 -3
- package/dist/index.d.ts +39 -6
- package/dist/mutations/BatchMutationBase.d.ts +2 -1
- package/dist/mutations/BatchUpdateMutation.d.ts +1 -1
- package/dist/mutations/CreateMutation.d.ts +1 -1
- package/dist/mutations/DeleteMutation.d.ts +1 -1
- package/dist/mutations/EntityMutationBase.d.ts +1 -1
- package/dist/mutations/MutationBase.d.ts +2 -2
- package/dist/mutations/OptimisticMutationStrategy.d.ts +2 -2
- package/dist/mutations/UpdateMutation.d.ts +1 -1
- package/dist/mutations/types.d.ts +1 -1
- package/dist/queries/QueryBase.d.ts +3 -2
- package/dist/queries/QueryFragmentMany.d.ts +1 -1
- package/dist/queries/QueryFragmentOne.d.ts +1 -1
- package/dist/queries/QueryMany.d.ts +1 -1
- package/dist/queries/QueryManyBase.d.ts +4 -2
- package/dist/queries/QueryOne.d.ts +1 -1
- package/dist/queries/QueryOneBase.d.ts +4 -2
- package/dist/queries/types.d.ts +2 -2
- package/dist/react/createReactContext.d.ts +1 -1
- package/dist/utils/generateEntityId.d.ts +1 -1
- package/dist/utils/types.d.ts +2 -1
- package/package.json +1 -6
- package/dist/client/index.d.ts +0 -5
- package/dist/entity/index.d.ts +0 -6
- package/dist/mutations/index.d.ts +0 -11
- package/dist/queries/index.d.ts +0 -10
- package/dist/react/index.d.ts +0 -2
- package/dist/utils/index.d.ts +0 -5
package/dist/core.js
CHANGED
|
@@ -3,281 +3,52 @@ var Mt = (n) => {
|
|
|
3
3
|
throw TypeError(n);
|
|
4
4
|
};
|
|
5
5
|
var ue = (n, t, e) => t in n ? ae(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
6
|
-
var V = (n, t, e) => ue(n, typeof t != "symbol" ? t + "" : t, e),
|
|
7
|
-
var J = (n, t, e) => (
|
|
8
|
-
import {
|
|
9
|
-
import { useMutation as vt, hashKey as
|
|
6
|
+
var V = (n, t, e) => ue(n, typeof t != "symbol" ? t + "" : t, e), It = (n, t, e) => t.has(n) || Mt("Cannot " + e);
|
|
7
|
+
var J = (n, t, e) => (It(n, t, "read from private field"), e ? e.call(n) : t.get(n)), X = (n, t, e) => t.has(n) ? Mt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, e), Z = (n, t, e, r) => (It(n, t, "write to private field"), r ? r.call(n, e) : t.set(n, e), e);
|
|
8
|
+
import { observable as tt, computed as yt, action as z, observe as ce, toJS as le, isObservableArray as ye, isObservableMap as he } from "mobx";
|
|
9
|
+
import { useMutation as vt, hashKey as ht, useIsFetching as fe, useQuery as Et, useSuspenseQuery as pt } from "@tanstack/react-query";
|
|
10
10
|
import de, { useDeferredValue as Gt, createContext as pe, useContext as me } from "react";
|
|
11
|
-
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
return It.set(n.name, t), `${ge}_${n.name}_${t}`;
|
|
15
|
-
}
|
|
16
|
-
function bt(n, t, e) {
|
|
17
|
-
const r = t.get(n);
|
|
18
|
-
r ? (r.invalidate(), r.isActive() && r.fetch()) : e?.(n);
|
|
19
|
-
}
|
|
20
|
-
const pt = {
|
|
21
|
-
PENDING: "pending",
|
|
22
|
-
CONFIRMED: "confirmed",
|
|
23
|
-
FAILED: "failed"
|
|
24
|
-
};
|
|
25
|
-
let ve, xt, wt;
|
|
26
|
-
function Ee(n, t, e, r, i, h) {
|
|
27
|
-
function b(a, y, f) {
|
|
28
|
-
return function(c, l) {
|
|
29
|
-
return f && f(c), a[y].call(c, l);
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
function B(a, y) {
|
|
33
|
-
for (var f = 0; f < a.length; f++) a[f].call(y);
|
|
34
|
-
return y;
|
|
35
|
-
}
|
|
36
|
-
function Q(a, y, f, c) {
|
|
37
|
-
if (typeof a != "function" && (c || a !== void 0)) throw new TypeError(y + " must " + (f || "be") + " a function" + (c ? "" : " or undefined"));
|
|
38
|
-
return a;
|
|
39
|
-
}
|
|
40
|
-
function Y(a, y, f, c, l, A, D, j, N, O, E, g, v) {
|
|
41
|
-
function T(u) {
|
|
42
|
-
if (!v(u)) throw new TypeError("Attempted to access private element on non-instance");
|
|
43
|
-
}
|
|
44
|
-
var d, M = y[0], R = y[3], w = !j;
|
|
45
|
-
if (!w) {
|
|
46
|
-
f || Array.isArray(M) || (M = [M]);
|
|
47
|
-
var s = {}, q = [], m = l === 3 ? "get" : l === 4 || g ? "set" : "value";
|
|
48
|
-
O ? (E || g ? s = { get: Qt(function() {
|
|
49
|
-
return R(this);
|
|
50
|
-
}, c, "get"), set: function(u) {
|
|
51
|
-
y[4](this, u);
|
|
52
|
-
} } : s[m] = R, E || Qt(s[m], c, l === 2 ? "" : m)) : E || (s = Object.getOwnPropertyDescriptor(a, c));
|
|
53
|
-
}
|
|
54
|
-
for (var p = a, o = M.length - 1; o >= 0; o -= f ? 2 : 1) {
|
|
55
|
-
var _ = M[o], I = f ? M[o - 1] : void 0, F = {}, x = { kind: ["field", "accessor", "method", "getter", "setter", "class"][l], name: c, metadata: A, addInitializer: (function(u, S) {
|
|
56
|
-
if (u.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
57
|
-
Q(S, "An initializer", "be", !0), D.push(S);
|
|
58
|
-
}).bind(null, F) };
|
|
59
|
-
try {
|
|
60
|
-
if (w) (d = Q(_.call(I, p, x), "class decorators", "return")) && (p = d);
|
|
61
|
-
else {
|
|
62
|
-
var C, k;
|
|
63
|
-
x.static = N, x.private = O, O ? l === 2 ? C = function(u) {
|
|
64
|
-
return T(u), s.value;
|
|
65
|
-
} : (l < 4 && (C = b(s, "get", T)), l !== 3 && (k = b(s, "set", T))) : (C = function(u) {
|
|
66
|
-
return u[c];
|
|
67
|
-
}, (l < 2 || l === 4) && (k = function(u, S) {
|
|
68
|
-
u[c] = S;
|
|
69
|
-
}));
|
|
70
|
-
var $ = x.access = { has: O ? v.bind() : function(u) {
|
|
71
|
-
return c in u;
|
|
72
|
-
} };
|
|
73
|
-
if (C && ($.get = C), k && ($.set = k), p = _.call(I, g ? { get: s.get, set: s.set } : s[m], x), g) {
|
|
74
|
-
if (typeof p == "object" && p) (d = Q(p.get, "accessor.get")) && (s.get = d), (d = Q(p.set, "accessor.set")) && (s.set = d), (d = Q(p.init, "accessor.init")) && q.push(d);
|
|
75
|
-
else if (p !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
76
|
-
} else Q(p, (E ? "field" : "method") + " decorators", "return") && (E ? q.push(p) : s[m] = p);
|
|
77
|
-
}
|
|
78
|
-
} finally {
|
|
79
|
-
F.v = !0;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
return (E || g) && j.push(function(u, S) {
|
|
83
|
-
for (var P = q.length - 1; P >= 0; P--) S = q[P].call(u, S);
|
|
84
|
-
return S;
|
|
85
|
-
}), E || w || (O ? g ? j.push(b(s, "get"), b(s, "set")) : j.push(l === 2 ? s[m] : b.call.bind(s[m])) : Object.defineProperty(a, c, s)), p;
|
|
86
|
-
}
|
|
87
|
-
function L(a, y) {
|
|
88
|
-
return Object.defineProperty(a, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: y });
|
|
89
|
-
}
|
|
90
|
-
if (arguments.length >= 6) var H = h[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
91
|
-
var K = Object.create(H ?? null), U = (function(a, y, f, c) {
|
|
92
|
-
var l, A, D = [], j = function(m) {
|
|
93
|
-
return Se(m) === a;
|
|
94
|
-
}, N = /* @__PURE__ */ new Map();
|
|
95
|
-
function O(m) {
|
|
96
|
-
m && D.push(B.bind(null, m));
|
|
97
|
-
}
|
|
98
|
-
for (var E = 0; E < y.length; E++) {
|
|
99
|
-
var g = y[E];
|
|
100
|
-
if (Array.isArray(g)) {
|
|
101
|
-
var v = g[1], T = g[2], d = g.length > 3, M = 16 & v, R = !!(8 & v), w = (v &= 7) == 0, s = T + "/" + R;
|
|
102
|
-
if (!w && !d) {
|
|
103
|
-
var q = N.get(s);
|
|
104
|
-
if (q === !0 || q === 3 && v !== 4 || q === 4 && v !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + T);
|
|
105
|
-
N.set(s, !(v > 2) || v);
|
|
106
|
-
}
|
|
107
|
-
Y(R ? a : a.prototype, g, M, d ? "#" + T : be(T), v, c, R ? A = A || [] : l = l || [], D, R, d, w, v === 1, R && d ? j : f);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
return O(l), O(A), D;
|
|
111
|
-
})(n, t, i, K);
|
|
112
|
-
return e.length || L(n, K), { e: U, get c() {
|
|
113
|
-
var a = [];
|
|
114
|
-
return e.length && [L(Y(n, [e], r, n.name, 5, K, a), K), B.bind(null, a, n)];
|
|
115
|
-
} };
|
|
116
|
-
}
|
|
117
|
-
function be(n) {
|
|
118
|
-
var t = _e(n, "string");
|
|
119
|
-
return typeof t == "symbol" ? t : t + "";
|
|
120
|
-
}
|
|
121
|
-
function _e(n, t) {
|
|
122
|
-
if (typeof n != "object" || !n) return n;
|
|
123
|
-
var e = n[Symbol.toPrimitive];
|
|
124
|
-
if (e !== void 0) {
|
|
125
|
-
var r = e.call(n, t);
|
|
126
|
-
if (typeof r != "object") return r;
|
|
127
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
128
|
-
}
|
|
129
|
-
return String(n);
|
|
130
|
-
}
|
|
131
|
-
function Qt(n, t, e) {
|
|
132
|
-
typeof t == "symbol" && (t = (t = t.description) ? "[" + t + "]" : "");
|
|
133
|
-
try {
|
|
134
|
-
Object.defineProperty(n, "name", { configurable: !0, value: e ? e + " " + t : t });
|
|
135
|
-
} catch {
|
|
136
|
-
}
|
|
137
|
-
return n;
|
|
138
|
-
}
|
|
139
|
-
function Se(n) {
|
|
140
|
-
if (Object(n) !== n) throw TypeError("right-hand side of 'in' should be an object, got " + (n !== null ? typeof n : "null"));
|
|
141
|
-
return n;
|
|
142
|
-
}
|
|
143
|
-
const Te = ["isDirty", "state"];
|
|
144
|
-
var at, ut;
|
|
145
|
-
const Rt = class Rt extends et {
|
|
146
|
-
constructor() {
|
|
147
|
-
super(...arguments);
|
|
148
|
-
V(this, "queryHashes", /* @__PURE__ */ new Set());
|
|
149
|
-
V(this, "events");
|
|
150
|
-
X(this, at, xt(this, pt.CONFIRMED));
|
|
151
|
-
X(this, ut, wt(this, !1));
|
|
152
|
-
V(this, "initValuesSnapshot", /* @__PURE__ */ new Map());
|
|
153
|
-
V(this, "isHydrated", !1);
|
|
154
|
-
}
|
|
155
|
-
get state() {
|
|
156
|
-
return J(this, at);
|
|
157
|
-
}
|
|
158
|
-
set state(e) {
|
|
159
|
-
Z(this, at, e);
|
|
160
|
-
}
|
|
161
|
-
get isDirty() {
|
|
162
|
-
return J(this, ut);
|
|
163
|
-
}
|
|
164
|
-
set isDirty(e) {
|
|
165
|
-
Z(this, ut, e);
|
|
166
|
-
}
|
|
167
|
-
_init(e, r) {
|
|
168
|
-
this.events = r;
|
|
169
|
-
for (const i of e)
|
|
170
|
-
this.queryHashes.add(i);
|
|
171
|
-
ce(this, (i) => this.onObservableChange(i));
|
|
172
|
-
}
|
|
173
|
-
// @computed get isDirty() {
|
|
174
|
-
// return this._isDirty
|
|
175
|
-
// }
|
|
176
|
-
_removeQueryHashes(e) {
|
|
177
|
-
for (const r of e)
|
|
178
|
-
this.queryHashes.delete(r);
|
|
179
|
-
this.queryHashes.size === 0 && this.events.onAllQueryHashesRemoved(this.id);
|
|
180
|
-
}
|
|
181
|
-
_markAsHydrated() {
|
|
182
|
-
this.isHydrated = !0;
|
|
183
|
-
}
|
|
184
|
-
onObservableChange(e) {
|
|
185
|
-
e.type === "update" && this.isHydrated && (Te.includes(e.name) || (this.initValuesSnapshot.has(e.name) || this.initValuesSnapshot.set(e.name, this.deepCloneValue(e.oldValue)), this.isDirty === !1 && (this.isDirty = !0)));
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Deep clones a value to ensure we store a snapshot, not a reference.
|
|
189
|
-
* Handles primitives, objects, arrays, and MobX observables.
|
|
190
|
-
*/
|
|
191
|
-
deepCloneValue(e) {
|
|
192
|
-
if (e == null)
|
|
193
|
-
return e;
|
|
194
|
-
const r = typeof e;
|
|
195
|
-
if (r === "string" || r === "number" || r === "boolean" || r === "symbol" || r === "bigint" || r === "function")
|
|
196
|
-
return e;
|
|
197
|
-
if (e instanceof Date)
|
|
198
|
-
return new Date(e.getTime());
|
|
199
|
-
if (e instanceof RegExp)
|
|
200
|
-
return new RegExp(e);
|
|
201
|
-
if (e instanceof Set)
|
|
202
|
-
return new Set(Array.from(e).map((i) => this.deepCloneValue(i)));
|
|
203
|
-
if (e instanceof Map) {
|
|
204
|
-
const i = /* @__PURE__ */ new Map();
|
|
205
|
-
for (const [h, b] of e.entries())
|
|
206
|
-
i.set(this.deepCloneValue(h), this.deepCloneValue(b));
|
|
207
|
-
return i;
|
|
208
|
-
}
|
|
209
|
-
try {
|
|
210
|
-
return le(e);
|
|
211
|
-
} catch (i) {
|
|
212
|
-
return console.warn("Failed to deep clone value for property, using reference:", i), e;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
reset() {
|
|
216
|
-
for (const [e, r] of this.initValuesSnapshot.entries()) {
|
|
217
|
-
const i = this.deepCloneValue(r), h = this[e];
|
|
218
|
-
ye(h) ? h.replace(i) : he(h) ? (h.clear(), h.merge(i)) : this[e] = i;
|
|
219
|
-
}
|
|
220
|
-
this._clearDirty();
|
|
221
|
-
}
|
|
222
|
-
_clearDirty() {
|
|
223
|
-
this.isDirty = !1, this.initValuesSnapshot.clear();
|
|
224
|
-
}
|
|
225
|
-
// isDirtyField(field: EntityValueKeys<this>) {
|
|
226
|
-
// return this.initValuesSnapshot.has(field)
|
|
227
|
-
// }
|
|
228
|
-
// getOriginalValue<K extends EntityValueKeys<this>>(
|
|
229
|
-
// field: K,
|
|
230
|
-
// ): this[K] | undefined {
|
|
231
|
-
// return this.initValuesSnapshot.get(field) as this[K] | undefined
|
|
232
|
-
// }
|
|
233
|
-
invalidateRelatedQueries() {
|
|
234
|
-
const e = this.queryClient.getQueryCache();
|
|
235
|
-
for (const r of this.queryHashes)
|
|
236
|
-
bt(r, e, () => this._removeQueryHashes([r]));
|
|
237
|
-
}
|
|
238
|
-
};
|
|
239
|
-
at = new WeakMap(), ut = new WeakMap(), [xt, wt, ve] = Ee(Rt, [[tt, 1, "state"], [tt, 1, "isDirty"], [z, 2, "onObservableChange"], [z, 2, "reset"], [z, 2, "_clearDirty"]], [], 0, void 0, et).e;
|
|
240
|
-
let jt = Rt, At, Dt, Ft, Kt;
|
|
241
|
-
function Re(n, t, e, r, i, h) {
|
|
242
|
-
function b(a, y, f) {
|
|
11
|
+
let Ct, xt, wt, Qt;
|
|
12
|
+
function ge(n, t, e, r, i, f) {
|
|
13
|
+
function b(a, y, h) {
|
|
243
14
|
return function(c, l) {
|
|
244
|
-
return
|
|
15
|
+
return h && h(c), a[y].call(c, l);
|
|
245
16
|
};
|
|
246
17
|
}
|
|
247
18
|
function B(a, y) {
|
|
248
|
-
for (var
|
|
19
|
+
for (var h = 0; h < a.length; h++) a[h].call(y);
|
|
249
20
|
return y;
|
|
250
21
|
}
|
|
251
|
-
function Q(a, y,
|
|
252
|
-
if (typeof a != "function" && (c || a !== void 0)) throw new TypeError(y + " must " + (
|
|
22
|
+
function Q(a, y, h, c) {
|
|
23
|
+
if (typeof a != "function" && (c || a !== void 0)) throw new TypeError(y + " must " + (h || "be") + " a function" + (c ? "" : " or undefined"));
|
|
253
24
|
return a;
|
|
254
25
|
}
|
|
255
|
-
function Y(a, y,
|
|
26
|
+
function Y(a, y, h, c, l, A, D, j, N, O, E, g, v) {
|
|
256
27
|
function T(u) {
|
|
257
28
|
if (!v(u)) throw new TypeError("Attempted to access private element on non-instance");
|
|
258
29
|
}
|
|
259
30
|
var d, M = y[0], R = y[3], w = !j;
|
|
260
31
|
if (!w) {
|
|
261
|
-
|
|
32
|
+
h || Array.isArray(M) || (M = [M]);
|
|
262
33
|
var s = {}, q = [], m = l === 3 ? "get" : l === 4 || g ? "set" : "value";
|
|
263
|
-
O ? (E || g ? s = { get:
|
|
34
|
+
O ? (E || g ? s = { get: jt(function() {
|
|
264
35
|
return R(this);
|
|
265
36
|
}, c, "get"), set: function(u) {
|
|
266
37
|
y[4](this, u);
|
|
267
|
-
} } : s[m] = R, E ||
|
|
38
|
+
} } : s[m] = R, E || jt(s[m], c, l === 2 ? "" : m)) : E || (s = Object.getOwnPropertyDescriptor(a, c));
|
|
268
39
|
}
|
|
269
|
-
for (var p = a, o = M.length - 1; o >= 0; o -=
|
|
270
|
-
var _ = M[o],
|
|
40
|
+
for (var p = a, o = M.length - 1; o >= 0; o -= h ? 2 : 1) {
|
|
41
|
+
var _ = M[o], C = h ? M[o - 1] : void 0, F = {}, x = { kind: ["field", "accessor", "method", "getter", "setter", "class"][l], name: c, metadata: A, addInitializer: (function(u, S) {
|
|
271
42
|
if (u.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
272
43
|
Q(S, "An initializer", "be", !0), D.push(S);
|
|
273
44
|
}).bind(null, F) };
|
|
274
45
|
try {
|
|
275
|
-
if (w) (d = Q(_.call(
|
|
46
|
+
if (w) (d = Q(_.call(C, p, x), "class decorators", "return")) && (p = d);
|
|
276
47
|
else {
|
|
277
|
-
var
|
|
278
|
-
x.static = N, x.private = O, O ? l === 2 ?
|
|
48
|
+
var I, k;
|
|
49
|
+
x.static = N, x.private = O, O ? l === 2 ? I = function(u) {
|
|
279
50
|
return T(u), s.value;
|
|
280
|
-
} : (l < 4 && (
|
|
51
|
+
} : (l < 4 && (I = b(s, "get", T)), l !== 3 && (k = b(s, "set", T))) : (I = function(u) {
|
|
281
52
|
return u[c];
|
|
282
53
|
}, (l < 2 || l === 4) && (k = function(u, S) {
|
|
283
54
|
u[c] = S;
|
|
@@ -285,7 +56,7 @@ function Re(n, t, e, r, i, h) {
|
|
|
285
56
|
var $ = x.access = { has: O ? v.bind() : function(u) {
|
|
286
57
|
return c in u;
|
|
287
58
|
} };
|
|
288
|
-
if (
|
|
59
|
+
if (I && ($.get = I), k && ($.set = k), p = _.call(C, g ? { get: s.get, set: s.set } : s[m], x), g) {
|
|
289
60
|
if (typeof p == "object" && p) (d = Q(p.get, "accessor.get")) && (s.get = d), (d = Q(p.set, "accessor.set")) && (s.set = d), (d = Q(p.init, "accessor.init")) && q.push(d);
|
|
290
61
|
else if (p !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
291
62
|
} else Q(p, (E ? "field" : "method") + " decorators", "return") && (E ? q.push(p) : s[m] = p);
|
|
@@ -302,10 +73,10 @@ function Re(n, t, e, r, i, h) {
|
|
|
302
73
|
function L(a, y) {
|
|
303
74
|
return Object.defineProperty(a, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: y });
|
|
304
75
|
}
|
|
305
|
-
if (arguments.length >= 6) var H =
|
|
306
|
-
var K = Object.create(H ?? null), U = (function(a, y,
|
|
76
|
+
if (arguments.length >= 6) var H = f[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
77
|
+
var K = Object.create(H ?? null), U = (function(a, y, h, c) {
|
|
307
78
|
var l, A, D = [], j = function(m) {
|
|
308
|
-
return
|
|
79
|
+
return be(m) === a;
|
|
309
80
|
}, N = /* @__PURE__ */ new Map();
|
|
310
81
|
function O(m) {
|
|
311
82
|
m && D.push(B.bind(null, m));
|
|
@@ -319,7 +90,7 @@ function Re(n, t, e, r, i, h) {
|
|
|
319
90
|
if (q === !0 || q === 3 && v !== 4 || q === 4 && v !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + T);
|
|
320
91
|
N.set(s, !(v > 2) || v);
|
|
321
92
|
}
|
|
322
|
-
Y(R ? a : a.prototype, g, M, d ? "#" + T :
|
|
93
|
+
Y(R ? a : a.prototype, g, M, d ? "#" + T : ve(T), v, c, R ? A = A || [] : l = l || [], D, R, d, w, v === 1, R && d ? j : h);
|
|
323
94
|
}
|
|
324
95
|
}
|
|
325
96
|
return O(l), O(A), D;
|
|
@@ -329,11 +100,11 @@ function Re(n, t, e, r, i, h) {
|
|
|
329
100
|
return e.length && [L(Y(n, [e], r, n.name, 5, K, a), K), B.bind(null, a, n)];
|
|
330
101
|
} };
|
|
331
102
|
}
|
|
332
|
-
function
|
|
333
|
-
var t =
|
|
103
|
+
function ve(n) {
|
|
104
|
+
var t = Ee(n, "string");
|
|
334
105
|
return typeof t == "symbol" ? t : t + "";
|
|
335
106
|
}
|
|
336
|
-
function
|
|
107
|
+
function Ee(n, t) {
|
|
337
108
|
if (typeof n != "object" || !n) return n;
|
|
338
109
|
var e = n[Symbol.toPrimitive];
|
|
339
110
|
if (e !== void 0) {
|
|
@@ -343,7 +114,7 @@ function Oe(n, t) {
|
|
|
343
114
|
}
|
|
344
115
|
return String(n);
|
|
345
116
|
}
|
|
346
|
-
function
|
|
117
|
+
function jt(n, t, e) {
|
|
347
118
|
typeof t == "symbol" && (t = (t = t.description) ? "[" + t + "]" : "");
|
|
348
119
|
try {
|
|
349
120
|
Object.defineProperty(n, "name", { configurable: !0, value: e ? e + " " + t : t });
|
|
@@ -351,35 +122,35 @@ function kt(n, t, e) {
|
|
|
351
122
|
}
|
|
352
123
|
return n;
|
|
353
124
|
}
|
|
354
|
-
function
|
|
125
|
+
function be(n) {
|
|
355
126
|
if (Object(n) !== n) throw TypeError("right-hand side of 'in' should be an object, got " + (n !== null ? typeof n : "null"));
|
|
356
127
|
return n;
|
|
357
128
|
}
|
|
358
|
-
var
|
|
359
|
-
const
|
|
129
|
+
var st, at, ut;
|
|
130
|
+
const Rt = class Rt {
|
|
360
131
|
constructor(t, e) {
|
|
361
|
-
X(this,
|
|
362
|
-
X(this,
|
|
363
|
-
X(this,
|
|
132
|
+
X(this, st, (Ct(this), xt(this, /* @__PURE__ */ new Map())));
|
|
133
|
+
X(this, at, wt(this, /* @__PURE__ */ new Set()));
|
|
134
|
+
X(this, ut, Qt(this, /* @__PURE__ */ new Set()));
|
|
364
135
|
this.entityConstructor = t, this.queryClient = e, this.initQueryClientCacheListener();
|
|
365
136
|
}
|
|
366
137
|
get collection() {
|
|
367
|
-
return J(this,
|
|
138
|
+
return J(this, st);
|
|
368
139
|
}
|
|
369
140
|
set collection(t) {
|
|
370
|
-
Z(this,
|
|
141
|
+
Z(this, st, t);
|
|
371
142
|
}
|
|
372
143
|
get deletedRecordIds() {
|
|
373
|
-
return J(this,
|
|
144
|
+
return J(this, at);
|
|
374
145
|
}
|
|
375
146
|
set deletedRecordIds(t) {
|
|
376
|
-
Z(this,
|
|
147
|
+
Z(this, at, t);
|
|
377
148
|
}
|
|
378
149
|
get clientOnlyEntityIds() {
|
|
379
|
-
return J(this,
|
|
150
|
+
return J(this, ut);
|
|
380
151
|
}
|
|
381
152
|
set clientOnlyEntityIds(t) {
|
|
382
|
-
Z(this,
|
|
153
|
+
Z(this, ut, t);
|
|
383
154
|
}
|
|
384
155
|
get size() {
|
|
385
156
|
return this.collection.size;
|
|
@@ -409,14 +180,14 @@ const qt = class qt {
|
|
|
409
180
|
setEntity(t, e) {
|
|
410
181
|
const r = new this.entityConstructor();
|
|
411
182
|
r.hydrate(t), r._markAsHydrated();
|
|
412
|
-
const i = this.collection.get(r.id),
|
|
183
|
+
const i = this.collection.get(r.id), f = i ? [...i.queryHashes, ...e || []] : [...e || []];
|
|
413
184
|
if (i) {
|
|
414
185
|
if (e)
|
|
415
186
|
for (const b of e)
|
|
416
187
|
i.queryHashes.add(b);
|
|
417
188
|
return i.hydrate(t), i._clearDirty(), i;
|
|
418
189
|
}
|
|
419
|
-
return r._init(
|
|
190
|
+
return r._init(f, {
|
|
420
191
|
onAllQueryHashesRemoved: (b) => this.deleteEntity(b)
|
|
421
192
|
}), this.collection.set(r.id, r), r;
|
|
422
193
|
}
|
|
@@ -425,8 +196,8 @@ const qt = class qt {
|
|
|
425
196
|
if (!Array.isArray(t))
|
|
426
197
|
throw new Error("setEntities: entityData must be an array");
|
|
427
198
|
e && this.removeQueryHashesFromAllEntities(e);
|
|
428
|
-
for (const
|
|
429
|
-
const b = this.setEntity(
|
|
199
|
+
for (const f of t) {
|
|
200
|
+
const b = this.setEntity(f, e);
|
|
430
201
|
r.push(b), i.push(b.id);
|
|
431
202
|
}
|
|
432
203
|
return [r, i];
|
|
@@ -508,58 +279,334 @@ const qt = class qt {
|
|
|
508
279
|
e._removeQueryHashes(t);
|
|
509
280
|
}
|
|
510
281
|
};
|
|
511
|
-
|
|
512
|
-
let
|
|
282
|
+
st = new WeakMap(), at = new WeakMap(), ut = new WeakMap(), [xt, wt, Qt, Ct] = ge(Rt, [[tt, 1, "collection"], [tt, 1, "deletedRecordIds"], [tt, 1, "clientOnlyEntityIds"], [yt, 3, "size"], [yt, 3, "entities"], [yt, 3, "clientOnlyEntitiesMap"], [yt, 3, "clientOnlyEntities"], [z, 2, "setEntity"], [z, 2, "setEntities"], [z, 2, "deleteEntity"]], []).e;
|
|
283
|
+
let bt = Rt;
|
|
513
284
|
const G = {
|
|
514
285
|
ALL_QUERIES: "all-queries",
|
|
515
286
|
ALL_ENTITY_QUERIES: "all-entity-queries",
|
|
516
287
|
REFERENCED_QUERIES: "referenced-queries",
|
|
517
288
|
NONE: "none"
|
|
518
|
-
},
|
|
289
|
+
}, ot = {
|
|
519
290
|
ROLLBACK: "rollback",
|
|
520
291
|
KEEP: "keep"
|
|
292
|
+
}, W = {
|
|
293
|
+
state: /* @__PURE__ */ new Map(),
|
|
294
|
+
context: null,
|
|
295
|
+
options: {
|
|
296
|
+
invalidationStrategy: G.REFERENCED_QUERIES,
|
|
297
|
+
errorStrategy: ot.ROLLBACK,
|
|
298
|
+
invalidateOnError: !0
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
class Ve {
|
|
302
|
+
rootStore;
|
|
303
|
+
constructor(t) {
|
|
304
|
+
W.context = t.context;
|
|
305
|
+
for (const e of t.entities)
|
|
306
|
+
W.state.set(e.name, new bt(e, t.context.queryClient));
|
|
307
|
+
W.options.invalidationStrategy = t.invalidationStrategy ?? G.REFERENCED_QUERIES, W.options.errorStrategy = t.errorStrategy ?? ot.ROLLBACK, W.options.invalidateOnError = t.invalidateOnError ?? !0, this.rootStore = t.rootStore();
|
|
308
|
+
}
|
|
309
|
+
getEntityCollection(t) {
|
|
310
|
+
const e = W.state.get(t.name);
|
|
311
|
+
if (!e)
|
|
312
|
+
throw new Error(`Entity collection not found for entity ${t.name}`);
|
|
313
|
+
return e;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
class mt {
|
|
317
|
+
queryClient;
|
|
318
|
+
context;
|
|
319
|
+
globalState;
|
|
320
|
+
constructor() {
|
|
321
|
+
if (!W)
|
|
322
|
+
throw new Error("Client not found");
|
|
323
|
+
if (!W.context)
|
|
324
|
+
throw new Error("MQClientContext is required");
|
|
325
|
+
this.queryClient = W.context.queryClient, this.globalState = W.state, this.context = W.context;
|
|
326
|
+
}
|
|
327
|
+
getEntityCollection(t) {
|
|
328
|
+
const e = this.globalState.get(t.name);
|
|
329
|
+
if (!e)
|
|
330
|
+
throw new Error(`Entity collection not found for entity ${t.name}`);
|
|
331
|
+
return e;
|
|
332
|
+
}
|
|
333
|
+
runSyncMutation(t, e, r) {
|
|
334
|
+
this.queryClient.getMutationCache().build(this.queryClient, {
|
|
335
|
+
mutationFn: (i) => e(i, this.context),
|
|
336
|
+
onError: r?.onError,
|
|
337
|
+
onMutate: r?.onMutate,
|
|
338
|
+
onSuccess: r?.onSuccess,
|
|
339
|
+
onSettled: r?.onSettled,
|
|
340
|
+
gcTime: r?.gcTime,
|
|
341
|
+
meta: r?.meta,
|
|
342
|
+
networkMode: r?.networkMode,
|
|
343
|
+
retry: r?.retry,
|
|
344
|
+
retryDelay: r?.retryDelay,
|
|
345
|
+
scope: r?.scope,
|
|
346
|
+
mutationKey: r?.mutationKey
|
|
347
|
+
}).execute(t).catch((i) => console.log("runSyncMutation error", i));
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
const dt = {
|
|
351
|
+
PENDING: "pending",
|
|
352
|
+
CONFIRMED: "confirmed",
|
|
353
|
+
FAILED: "failed"
|
|
354
|
+
};
|
|
355
|
+
let _e, At, Dt;
|
|
356
|
+
function Se(n, t, e, r, i, f) {
|
|
357
|
+
function b(a, y, h) {
|
|
358
|
+
return function(c, l) {
|
|
359
|
+
return h && h(c), a[y].call(c, l);
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
function B(a, y) {
|
|
363
|
+
for (var h = 0; h < a.length; h++) a[h].call(y);
|
|
364
|
+
return y;
|
|
365
|
+
}
|
|
366
|
+
function Q(a, y, h, c) {
|
|
367
|
+
if (typeof a != "function" && (c || a !== void 0)) throw new TypeError(y + " must " + (h || "be") + " a function" + (c ? "" : " or undefined"));
|
|
368
|
+
return a;
|
|
369
|
+
}
|
|
370
|
+
function Y(a, y, h, c, l, A, D, j, N, O, E, g, v) {
|
|
371
|
+
function T(u) {
|
|
372
|
+
if (!v(u)) throw new TypeError("Attempted to access private element on non-instance");
|
|
373
|
+
}
|
|
374
|
+
var d, M = y[0], R = y[3], w = !j;
|
|
375
|
+
if (!w) {
|
|
376
|
+
h || Array.isArray(M) || (M = [M]);
|
|
377
|
+
var s = {}, q = [], m = l === 3 ? "get" : l === 4 || g ? "set" : "value";
|
|
378
|
+
O ? (E || g ? s = { get: Ft(function() {
|
|
379
|
+
return R(this);
|
|
380
|
+
}, c, "get"), set: function(u) {
|
|
381
|
+
y[4](this, u);
|
|
382
|
+
} } : s[m] = R, E || Ft(s[m], c, l === 2 ? "" : m)) : E || (s = Object.getOwnPropertyDescriptor(a, c));
|
|
383
|
+
}
|
|
384
|
+
for (var p = a, o = M.length - 1; o >= 0; o -= h ? 2 : 1) {
|
|
385
|
+
var _ = M[o], C = h ? M[o - 1] : void 0, F = {}, x = { kind: ["field", "accessor", "method", "getter", "setter", "class"][l], name: c, metadata: A, addInitializer: (function(u, S) {
|
|
386
|
+
if (u.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
387
|
+
Q(S, "An initializer", "be", !0), D.push(S);
|
|
388
|
+
}).bind(null, F) };
|
|
389
|
+
try {
|
|
390
|
+
if (w) (d = Q(_.call(C, p, x), "class decorators", "return")) && (p = d);
|
|
391
|
+
else {
|
|
392
|
+
var I, k;
|
|
393
|
+
x.static = N, x.private = O, O ? l === 2 ? I = function(u) {
|
|
394
|
+
return T(u), s.value;
|
|
395
|
+
} : (l < 4 && (I = b(s, "get", T)), l !== 3 && (k = b(s, "set", T))) : (I = function(u) {
|
|
396
|
+
return u[c];
|
|
397
|
+
}, (l < 2 || l === 4) && (k = function(u, S) {
|
|
398
|
+
u[c] = S;
|
|
399
|
+
}));
|
|
400
|
+
var $ = x.access = { has: O ? v.bind() : function(u) {
|
|
401
|
+
return c in u;
|
|
402
|
+
} };
|
|
403
|
+
if (I && ($.get = I), k && ($.set = k), p = _.call(C, g ? { get: s.get, set: s.set } : s[m], x), g) {
|
|
404
|
+
if (typeof p == "object" && p) (d = Q(p.get, "accessor.get")) && (s.get = d), (d = Q(p.set, "accessor.set")) && (s.set = d), (d = Q(p.init, "accessor.init")) && q.push(d);
|
|
405
|
+
else if (p !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
406
|
+
} else Q(p, (E ? "field" : "method") + " decorators", "return") && (E ? q.push(p) : s[m] = p);
|
|
407
|
+
}
|
|
408
|
+
} finally {
|
|
409
|
+
F.v = !0;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
return (E || g) && j.push(function(u, S) {
|
|
413
|
+
for (var P = q.length - 1; P >= 0; P--) S = q[P].call(u, S);
|
|
414
|
+
return S;
|
|
415
|
+
}), E || w || (O ? g ? j.push(b(s, "get"), b(s, "set")) : j.push(l === 2 ? s[m] : b.call.bind(s[m])) : Object.defineProperty(a, c, s)), p;
|
|
416
|
+
}
|
|
417
|
+
function L(a, y) {
|
|
418
|
+
return Object.defineProperty(a, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: y });
|
|
419
|
+
}
|
|
420
|
+
if (arguments.length >= 6) var H = f[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
421
|
+
var K = Object.create(H ?? null), U = (function(a, y, h, c) {
|
|
422
|
+
var l, A, D = [], j = function(m) {
|
|
423
|
+
return qe(m) === a;
|
|
424
|
+
}, N = /* @__PURE__ */ new Map();
|
|
425
|
+
function O(m) {
|
|
426
|
+
m && D.push(B.bind(null, m));
|
|
427
|
+
}
|
|
428
|
+
for (var E = 0; E < y.length; E++) {
|
|
429
|
+
var g = y[E];
|
|
430
|
+
if (Array.isArray(g)) {
|
|
431
|
+
var v = g[1], T = g[2], d = g.length > 3, M = 16 & v, R = !!(8 & v), w = (v &= 7) == 0, s = T + "/" + R;
|
|
432
|
+
if (!w && !d) {
|
|
433
|
+
var q = N.get(s);
|
|
434
|
+
if (q === !0 || q === 3 && v !== 4 || q === 4 && v !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + T);
|
|
435
|
+
N.set(s, !(v > 2) || v);
|
|
436
|
+
}
|
|
437
|
+
Y(R ? a : a.prototype, g, M, d ? "#" + T : Te(T), v, c, R ? A = A || [] : l = l || [], D, R, d, w, v === 1, R && d ? j : h);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
return O(l), O(A), D;
|
|
441
|
+
})(n, t, i, K);
|
|
442
|
+
return e.length || L(n, K), { e: U, get c() {
|
|
443
|
+
var a = [];
|
|
444
|
+
return e.length && [L(Y(n, [e], r, n.name, 5, K, a), K), B.bind(null, a, n)];
|
|
445
|
+
} };
|
|
446
|
+
}
|
|
447
|
+
function Te(n) {
|
|
448
|
+
var t = Re(n, "string");
|
|
449
|
+
return typeof t == "symbol" ? t : t + "";
|
|
450
|
+
}
|
|
451
|
+
function Re(n, t) {
|
|
452
|
+
if (typeof n != "object" || !n) return n;
|
|
453
|
+
var e = n[Symbol.toPrimitive];
|
|
454
|
+
if (e !== void 0) {
|
|
455
|
+
var r = e.call(n, t);
|
|
456
|
+
if (typeof r != "object") return r;
|
|
457
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
458
|
+
}
|
|
459
|
+
return String(n);
|
|
460
|
+
}
|
|
461
|
+
function Ft(n, t, e) {
|
|
462
|
+
typeof t == "symbol" && (t = (t = t.description) ? "[" + t + "]" : "");
|
|
463
|
+
try {
|
|
464
|
+
Object.defineProperty(n, "name", { configurable: !0, value: e ? e + " " + t : t });
|
|
465
|
+
} catch {
|
|
466
|
+
}
|
|
467
|
+
return n;
|
|
468
|
+
}
|
|
469
|
+
function qe(n) {
|
|
470
|
+
if (Object(n) !== n) throw TypeError("right-hand side of 'in' should be an object, got " + (n !== null ? typeof n : "null"));
|
|
471
|
+
return n;
|
|
472
|
+
}
|
|
473
|
+
const Oe = ["isDirty", "state"];
|
|
474
|
+
var ct, lt;
|
|
475
|
+
const qt = class qt {
|
|
476
|
+
constructor() {
|
|
477
|
+
V(this, "queryHashes", /* @__PURE__ */ new Set());
|
|
478
|
+
V(this, "events");
|
|
479
|
+
X(this, ct, At(this, dt.CONFIRMED));
|
|
480
|
+
X(this, lt, Dt(this, !1));
|
|
481
|
+
V(this, "initValuesSnapshot", /* @__PURE__ */ new Map());
|
|
482
|
+
V(this, "isHydrated", !1);
|
|
483
|
+
}
|
|
484
|
+
get state() {
|
|
485
|
+
return J(this, ct);
|
|
486
|
+
}
|
|
487
|
+
set state(t) {
|
|
488
|
+
Z(this, ct, t);
|
|
489
|
+
}
|
|
490
|
+
get isDirty() {
|
|
491
|
+
return J(this, lt);
|
|
492
|
+
}
|
|
493
|
+
set isDirty(t) {
|
|
494
|
+
Z(this, lt, t);
|
|
495
|
+
}
|
|
496
|
+
_init(t, e) {
|
|
497
|
+
this.events = e;
|
|
498
|
+
for (const r of t)
|
|
499
|
+
this.queryHashes.add(r);
|
|
500
|
+
ce(this, (r) => this.onObservableChange(r));
|
|
501
|
+
}
|
|
502
|
+
// @computed get isDirty() {
|
|
503
|
+
// return this._isDirty
|
|
504
|
+
// }
|
|
505
|
+
_removeQueryHashes(t) {
|
|
506
|
+
for (const e of t)
|
|
507
|
+
this.queryHashes.delete(e);
|
|
508
|
+
this.queryHashes.size === 0 && this.events.onAllQueryHashesRemoved(this.id);
|
|
509
|
+
}
|
|
510
|
+
_markAsHydrated() {
|
|
511
|
+
this.isHydrated = !0;
|
|
512
|
+
}
|
|
513
|
+
onObservableChange(t) {
|
|
514
|
+
t.type === "update" && this.isHydrated && (Oe.includes(t.name) || (this.initValuesSnapshot.has(t.name) || this.initValuesSnapshot.set(t.name, this.deepCloneValue(t.oldValue)), this.isDirty === !1 && (this.isDirty = !0)));
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* Deep clones a value to ensure we store a snapshot, not a reference.
|
|
518
|
+
* Handles primitives, objects, arrays, and MobX observables.
|
|
519
|
+
*/
|
|
520
|
+
deepCloneValue(t) {
|
|
521
|
+
if (t == null)
|
|
522
|
+
return t;
|
|
523
|
+
const e = typeof t;
|
|
524
|
+
if (e === "string" || e === "number" || e === "boolean" || e === "symbol" || e === "bigint" || e === "function")
|
|
525
|
+
return t;
|
|
526
|
+
if (t instanceof Date)
|
|
527
|
+
return new Date(t.getTime());
|
|
528
|
+
if (t instanceof RegExp)
|
|
529
|
+
return new RegExp(t);
|
|
530
|
+
if (t instanceof Set)
|
|
531
|
+
return new Set(Array.from(t).map((r) => this.deepCloneValue(r)));
|
|
532
|
+
if (t instanceof Map) {
|
|
533
|
+
const r = /* @__PURE__ */ new Map();
|
|
534
|
+
for (const [i, f] of t.entries())
|
|
535
|
+
r.set(this.deepCloneValue(i), this.deepCloneValue(f));
|
|
536
|
+
return r;
|
|
537
|
+
}
|
|
538
|
+
try {
|
|
539
|
+
return le(t);
|
|
540
|
+
} catch (r) {
|
|
541
|
+
return console.warn("Failed to deep clone value for property, using reference:", r), t;
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
reset() {
|
|
545
|
+
for (const [t, e] of this.initValuesSnapshot.entries()) {
|
|
546
|
+
const r = this.deepCloneValue(e), i = this[t];
|
|
547
|
+
ye(i) ? i.replace(r) : he(i) ? (i.clear(), i.merge(r)) : this[t] = r;
|
|
548
|
+
}
|
|
549
|
+
this._clearDirty();
|
|
550
|
+
}
|
|
551
|
+
_clearDirty() {
|
|
552
|
+
this.isDirty = !1, this.initValuesSnapshot.clear();
|
|
553
|
+
}
|
|
554
|
+
// isDirtyField(field: EntityValueKeys<this>) {
|
|
555
|
+
// return this.initValuesSnapshot.has(field)
|
|
556
|
+
// }
|
|
557
|
+
// getOriginalValue<K extends EntityValueKeys<this>>(
|
|
558
|
+
// field: K,
|
|
559
|
+
// ): this[K] | undefined {
|
|
560
|
+
// return this.initValuesSnapshot.get(field) as this[K] | undefined
|
|
561
|
+
// }
|
|
521
562
|
};
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
563
|
+
ct = new WeakMap(), lt = new WeakMap(), [At, Dt, _e] = Se(qt, [[tt, 1, "state"], [tt, 1, "isDirty"], [z, 2, "onObservableChange"], [z, 2, "reset"], [z, 2, "_clearDirty"]], []).e;
|
|
564
|
+
let Kt = qt;
|
|
565
|
+
function Tt(n, t, e) {
|
|
566
|
+
const r = t.get(n);
|
|
567
|
+
r ? (r.invalidate(), r.isActive() && r.fetch()) : e?.(n);
|
|
568
|
+
}
|
|
569
|
+
let kt;
|
|
570
|
+
function Me(n, t, e, r, i, f) {
|
|
571
|
+
function b(a, y, h) {
|
|
525
572
|
return function(c, l) {
|
|
526
|
-
return
|
|
573
|
+
return h && h(c), a[y].call(c, l);
|
|
527
574
|
};
|
|
528
575
|
}
|
|
529
576
|
function B(a, y) {
|
|
530
|
-
for (var
|
|
577
|
+
for (var h = 0; h < a.length; h++) a[h].call(y);
|
|
531
578
|
return y;
|
|
532
579
|
}
|
|
533
|
-
function Q(a, y,
|
|
534
|
-
if (typeof a != "function" && (c || a !== void 0)) throw new TypeError(y + " must " + (
|
|
580
|
+
function Q(a, y, h, c) {
|
|
581
|
+
if (typeof a != "function" && (c || a !== void 0)) throw new TypeError(y + " must " + (h || "be") + " a function" + (c ? "" : " or undefined"));
|
|
535
582
|
return a;
|
|
536
583
|
}
|
|
537
|
-
function Y(a, y,
|
|
584
|
+
function Y(a, y, h, c, l, A, D, j, N, O, E, g, v) {
|
|
538
585
|
function T(u) {
|
|
539
586
|
if (!v(u)) throw new TypeError("Attempted to access private element on non-instance");
|
|
540
587
|
}
|
|
541
588
|
var d, M = y[0], R = y[3], w = !j;
|
|
542
589
|
if (!w) {
|
|
543
|
-
|
|
590
|
+
h || Array.isArray(M) || (M = [M]);
|
|
544
591
|
var s = {}, q = [], m = l === 3 ? "get" : l === 4 || g ? "set" : "value";
|
|
545
|
-
O ? (E || g ? s = { get:
|
|
592
|
+
O ? (E || g ? s = { get: Nt(function() {
|
|
546
593
|
return R(this);
|
|
547
594
|
}, c, "get"), set: function(u) {
|
|
548
595
|
y[4](this, u);
|
|
549
|
-
} } : s[m] = R, E ||
|
|
596
|
+
} } : s[m] = R, E || Nt(s[m], c, l === 2 ? "" : m)) : E || (s = Object.getOwnPropertyDescriptor(a, c));
|
|
550
597
|
}
|
|
551
|
-
for (var p = a, o = M.length - 1; o >= 0; o -=
|
|
552
|
-
var _ = M[o],
|
|
598
|
+
for (var p = a, o = M.length - 1; o >= 0; o -= h ? 2 : 1) {
|
|
599
|
+
var _ = M[o], C = h ? M[o - 1] : void 0, F = {}, x = { kind: ["field", "accessor", "method", "getter", "setter", "class"][l], name: c, metadata: A, addInitializer: (function(u, S) {
|
|
553
600
|
if (u.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
554
601
|
Q(S, "An initializer", "be", !0), D.push(S);
|
|
555
602
|
}).bind(null, F) };
|
|
556
603
|
try {
|
|
557
|
-
if (w) (d = Q(_.call(
|
|
604
|
+
if (w) (d = Q(_.call(C, p, x), "class decorators", "return")) && (p = d);
|
|
558
605
|
else {
|
|
559
|
-
var
|
|
560
|
-
x.static = N, x.private = O, O ? l === 2 ?
|
|
606
|
+
var I, k;
|
|
607
|
+
x.static = N, x.private = O, O ? l === 2 ? I = function(u) {
|
|
561
608
|
return T(u), s.value;
|
|
562
|
-
} : (l < 4 && (
|
|
609
|
+
} : (l < 4 && (I = b(s, "get", T)), l !== 3 && (k = b(s, "set", T))) : (I = function(u) {
|
|
563
610
|
return u[c];
|
|
564
611
|
}, (l < 2 || l === 4) && (k = function(u, S) {
|
|
565
612
|
u[c] = S;
|
|
@@ -567,7 +614,7 @@ function Ce(n, t, e, r, i, h) {
|
|
|
567
614
|
var $ = x.access = { has: O ? v.bind() : function(u) {
|
|
568
615
|
return c in u;
|
|
569
616
|
} };
|
|
570
|
-
if (
|
|
617
|
+
if (I && ($.get = I), k && ($.set = k), p = _.call(C, g ? { get: s.get, set: s.set } : s[m], x), g) {
|
|
571
618
|
if (typeof p == "object" && p) (d = Q(p.get, "accessor.get")) && (s.get = d), (d = Q(p.set, "accessor.set")) && (s.set = d), (d = Q(p.init, "accessor.init")) && q.push(d);
|
|
572
619
|
else if (p !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
573
620
|
} else Q(p, (E ? "field" : "method") + " decorators", "return") && (E ? q.push(p) : s[m] = p);
|
|
@@ -584,10 +631,10 @@ function Ce(n, t, e, r, i, h) {
|
|
|
584
631
|
function L(a, y) {
|
|
585
632
|
return Object.defineProperty(a, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: y });
|
|
586
633
|
}
|
|
587
|
-
if (arguments.length >= 6) var H =
|
|
588
|
-
var K = Object.create(H ?? null), U = (function(a, y,
|
|
634
|
+
if (arguments.length >= 6) var H = f[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
635
|
+
var K = Object.create(H ?? null), U = (function(a, y, h, c) {
|
|
589
636
|
var l, A, D = [], j = function(m) {
|
|
590
|
-
return
|
|
637
|
+
return xe(m) === a;
|
|
591
638
|
}, N = /* @__PURE__ */ new Map();
|
|
592
639
|
function O(m) {
|
|
593
640
|
m && D.push(B.bind(null, m));
|
|
@@ -601,7 +648,7 @@ function Ce(n, t, e, r, i, h) {
|
|
|
601
648
|
if (q === !0 || q === 3 && v !== 4 || q === 4 && v !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + T);
|
|
602
649
|
N.set(s, !(v > 2) || v);
|
|
603
650
|
}
|
|
604
|
-
Y(R ? a : a.prototype, g, M, d ? "#" + T : Ie(T), v, c, R ? A = A || [] : l = l || [], D, R, d, w, v === 1, R && d ? j :
|
|
651
|
+
Y(R ? a : a.prototype, g, M, d ? "#" + T : Ie(T), v, c, R ? A = A || [] : l = l || [], D, R, d, w, v === 1, R && d ? j : h);
|
|
605
652
|
}
|
|
606
653
|
}
|
|
607
654
|
return O(l), O(A), D;
|
|
@@ -612,10 +659,10 @@ function Ce(n, t, e, r, i, h) {
|
|
|
612
659
|
} };
|
|
613
660
|
}
|
|
614
661
|
function Ie(n) {
|
|
615
|
-
var t =
|
|
662
|
+
var t = Ce(n, "string");
|
|
616
663
|
return typeof t == "symbol" ? t : t + "";
|
|
617
664
|
}
|
|
618
|
-
function
|
|
665
|
+
function Ce(n, t) {
|
|
619
666
|
if (typeof n != "object" || !n) return n;
|
|
620
667
|
var e = n[Symbol.toPrimitive];
|
|
621
668
|
if (e !== void 0) {
|
|
@@ -625,7 +672,7 @@ function xe(n, t) {
|
|
|
625
672
|
}
|
|
626
673
|
return String(n);
|
|
627
674
|
}
|
|
628
|
-
function
|
|
675
|
+
function Nt(n, t, e) {
|
|
629
676
|
typeof t == "symbol" && (t = (t = t.description) ? "[" + t + "]" : "");
|
|
630
677
|
try {
|
|
631
678
|
Object.defineProperty(n, "name", { configurable: !0, value: e ? e + " " + t : t });
|
|
@@ -633,14 +680,14 @@ function Pt(n, t, e) {
|
|
|
633
680
|
}
|
|
634
681
|
return n;
|
|
635
682
|
}
|
|
636
|
-
function
|
|
683
|
+
function xe(n) {
|
|
637
684
|
if (Object(n) !== n) throw TypeError("right-hand side of 'in' should be an object, got " + (n !== null ? typeof n : "null"));
|
|
638
685
|
return n;
|
|
639
686
|
}
|
|
640
|
-
const Ot = class Ot extends
|
|
687
|
+
const Ot = class Ot extends mt {
|
|
641
688
|
constructor(t, e, r) {
|
|
642
|
-
var i = (...
|
|
643
|
-
|
|
689
|
+
var i = (...f) => (super(...f), this.entityConstructor = t, this.entities = e, this.options = r, this);
|
|
690
|
+
kt(i());
|
|
644
691
|
}
|
|
645
692
|
get invalidationStrategy() {
|
|
646
693
|
return this.options?.invalidationStrategy ?? W.options.invalidationStrategy;
|
|
@@ -656,16 +703,16 @@ const Ot = class Ot extends et {
|
|
|
656
703
|
queryKey: [this.entityConstructor.name]
|
|
657
704
|
});
|
|
658
705
|
for (const t of this.entities)
|
|
659
|
-
t.state =
|
|
706
|
+
t.state = dt.PENDING;
|
|
660
707
|
}
|
|
661
708
|
onSuccess() {
|
|
662
709
|
for (const t of this.entities)
|
|
663
|
-
t.state =
|
|
710
|
+
t.state = dt.CONFIRMED;
|
|
664
711
|
this.runInvalidationStrategy();
|
|
665
712
|
}
|
|
666
713
|
onError(t = !1) {
|
|
667
714
|
for (const e of this.entities)
|
|
668
|
-
e.state =
|
|
715
|
+
e.state = dt.FAILED, this.mutationErrorStrategy === ot.ROLLBACK && !t && e.reset();
|
|
669
716
|
this.invalidateOnError && this.runInvalidationStrategy();
|
|
670
717
|
}
|
|
671
718
|
runInvalidationStrategy() {
|
|
@@ -692,15 +739,15 @@ const Ot = class Ot extends et {
|
|
|
692
739
|
for (const i of r.queryHashes)
|
|
693
740
|
e[i] || (e[i] = []), e[i].push(r);
|
|
694
741
|
for (const [r, i] of Object.entries(e))
|
|
695
|
-
|
|
696
|
-
for (const
|
|
697
|
-
|
|
742
|
+
Tt(r, t, () => {
|
|
743
|
+
for (const f of i)
|
|
744
|
+
f._removeQueryHashes([r]);
|
|
698
745
|
});
|
|
699
746
|
}
|
|
700
747
|
};
|
|
701
|
-
[
|
|
702
|
-
let
|
|
703
|
-
class gt extends
|
|
748
|
+
[kt] = Me(Ot, [[z, 2, "onMutate"], [z, 2, "onSuccess"], [z, 2, "onError"]], [], 0, void 0, mt).e;
|
|
749
|
+
let _t = Ot;
|
|
750
|
+
class gt extends mt {
|
|
704
751
|
constructor(t, e) {
|
|
705
752
|
super(), this.mutationPrefix = t, this.entity = e, this.collection = this.getEntityCollection(e);
|
|
706
753
|
}
|
|
@@ -709,14 +756,14 @@ class gt extends et {
|
|
|
709
756
|
return [this.entity.name, this.mutationPrefix];
|
|
710
757
|
}
|
|
711
758
|
createMutationStrategy(t, e) {
|
|
712
|
-
return new
|
|
759
|
+
return new _t(this.entity, t, {
|
|
713
760
|
invalidationStrategy: e.invalidationStrategy,
|
|
714
761
|
errorStrategy: e.errorStrategy,
|
|
715
762
|
invalidateOnError: e.invalidateOnError
|
|
716
763
|
});
|
|
717
764
|
}
|
|
718
765
|
}
|
|
719
|
-
class
|
|
766
|
+
class we extends gt {
|
|
720
767
|
constructor(t, e) {
|
|
721
768
|
super(t, e.entity), this.options = e, this.collection = this.getEntityCollection(e.entity);
|
|
722
769
|
}
|
|
@@ -752,7 +799,7 @@ class Qe extends gt {
|
|
|
752
799
|
};
|
|
753
800
|
}
|
|
754
801
|
}
|
|
755
|
-
class Jt extends
|
|
802
|
+
class Jt extends we {
|
|
756
803
|
static mutationPrefix = "__mutation__batch__update__";
|
|
757
804
|
constructor(t) {
|
|
758
805
|
super(Jt.mutationPrefix, t);
|
|
@@ -761,56 +808,56 @@ class Jt extends Qe {
|
|
|
761
808
|
const t = vt({
|
|
762
809
|
mutationFn: (e) => this.options.mutationFn(e.entities, this.context),
|
|
763
810
|
onMutate: (e, r) => this.onMutateBase(e, r),
|
|
764
|
-
onSuccess: (e, r, i,
|
|
765
|
-
onError: (e, r, i,
|
|
766
|
-
onSettled: (e, r, i,
|
|
811
|
+
onSuccess: (e, r, i, f) => this.onSuccessBase(r, i, f),
|
|
812
|
+
onError: (e, r, i, f) => this.onErrorBase(e, r, i, f),
|
|
813
|
+
onSettled: (e, r, i, f, b) => this.onSettledBase(r, i, f, b)
|
|
767
814
|
});
|
|
768
815
|
return (e) => {
|
|
769
816
|
t.mutate(this.createInternalInput(e));
|
|
770
817
|
};
|
|
771
818
|
}
|
|
772
819
|
}
|
|
773
|
-
let
|
|
774
|
-
function
|
|
775
|
-
function b(a, y,
|
|
820
|
+
let Pt;
|
|
821
|
+
function Qe(n, t, e, r, i, f) {
|
|
822
|
+
function b(a, y, h) {
|
|
776
823
|
return function(c, l) {
|
|
777
|
-
return
|
|
824
|
+
return h && h(c), a[y].call(c, l);
|
|
778
825
|
};
|
|
779
826
|
}
|
|
780
827
|
function B(a, y) {
|
|
781
|
-
for (var
|
|
828
|
+
for (var h = 0; h < a.length; h++) a[h].call(y);
|
|
782
829
|
return y;
|
|
783
830
|
}
|
|
784
|
-
function Q(a, y,
|
|
785
|
-
if (typeof a != "function" && (c || a !== void 0)) throw new TypeError(y + " must " + (
|
|
831
|
+
function Q(a, y, h, c) {
|
|
832
|
+
if (typeof a != "function" && (c || a !== void 0)) throw new TypeError(y + " must " + (h || "be") + " a function" + (c ? "" : " or undefined"));
|
|
786
833
|
return a;
|
|
787
834
|
}
|
|
788
|
-
function Y(a, y,
|
|
835
|
+
function Y(a, y, h, c, l, A, D, j, N, O, E, g, v) {
|
|
789
836
|
function T(u) {
|
|
790
837
|
if (!v(u)) throw new TypeError("Attempted to access private element on non-instance");
|
|
791
838
|
}
|
|
792
839
|
var d, M = y[0], R = y[3], w = !j;
|
|
793
840
|
if (!w) {
|
|
794
|
-
|
|
841
|
+
h || Array.isArray(M) || (M = [M]);
|
|
795
842
|
var s = {}, q = [], m = l === 3 ? "get" : l === 4 || g ? "set" : "value";
|
|
796
|
-
O ? (E || g ? s = { get:
|
|
843
|
+
O ? (E || g ? s = { get: Bt(function() {
|
|
797
844
|
return R(this);
|
|
798
845
|
}, c, "get"), set: function(u) {
|
|
799
846
|
y[4](this, u);
|
|
800
|
-
} } : s[m] = R, E ||
|
|
847
|
+
} } : s[m] = R, E || Bt(s[m], c, l === 2 ? "" : m)) : E || (s = Object.getOwnPropertyDescriptor(a, c));
|
|
801
848
|
}
|
|
802
|
-
for (var p = a, o = M.length - 1; o >= 0; o -=
|
|
803
|
-
var _ = M[o],
|
|
849
|
+
for (var p = a, o = M.length - 1; o >= 0; o -= h ? 2 : 1) {
|
|
850
|
+
var _ = M[o], C = h ? M[o - 1] : void 0, F = {}, x = { kind: ["field", "accessor", "method", "getter", "setter", "class"][l], name: c, metadata: A, addInitializer: (function(u, S) {
|
|
804
851
|
if (u.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
805
852
|
Q(S, "An initializer", "be", !0), D.push(S);
|
|
806
853
|
}).bind(null, F) };
|
|
807
854
|
try {
|
|
808
|
-
if (w) (d = Q(_.call(
|
|
855
|
+
if (w) (d = Q(_.call(C, p, x), "class decorators", "return")) && (p = d);
|
|
809
856
|
else {
|
|
810
|
-
var
|
|
811
|
-
x.static = N, x.private = O, O ? l === 2 ?
|
|
857
|
+
var I, k;
|
|
858
|
+
x.static = N, x.private = O, O ? l === 2 ? I = function(u) {
|
|
812
859
|
return T(u), s.value;
|
|
813
|
-
} : (l < 4 && (
|
|
860
|
+
} : (l < 4 && (I = b(s, "get", T)), l !== 3 && (k = b(s, "set", T))) : (I = function(u) {
|
|
814
861
|
return u[c];
|
|
815
862
|
}, (l < 2 || l === 4) && (k = function(u, S) {
|
|
816
863
|
u[c] = S;
|
|
@@ -818,7 +865,7 @@ function je(n, t, e, r, i, h) {
|
|
|
818
865
|
var $ = x.access = { has: O ? v.bind() : function(u) {
|
|
819
866
|
return c in u;
|
|
820
867
|
} };
|
|
821
|
-
if (
|
|
868
|
+
if (I && ($.get = I), k && ($.set = k), p = _.call(C, g ? { get: s.get, set: s.set } : s[m], x), g) {
|
|
822
869
|
if (typeof p == "object" && p) (d = Q(p.get, "accessor.get")) && (s.get = d), (d = Q(p.set, "accessor.set")) && (s.set = d), (d = Q(p.init, "accessor.init")) && q.push(d);
|
|
823
870
|
else if (p !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
824
871
|
} else Q(p, (E ? "field" : "method") + " decorators", "return") && (E ? q.push(p) : s[m] = p);
|
|
@@ -835,10 +882,10 @@ function je(n, t, e, r, i, h) {
|
|
|
835
882
|
function L(a, y) {
|
|
836
883
|
return Object.defineProperty(a, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: y });
|
|
837
884
|
}
|
|
838
|
-
if (arguments.length >= 6) var H =
|
|
839
|
-
var K = Object.create(H ?? null), U = (function(a, y,
|
|
885
|
+
if (arguments.length >= 6) var H = f[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
886
|
+
var K = Object.create(H ?? null), U = (function(a, y, h, c) {
|
|
840
887
|
var l, A, D = [], j = function(m) {
|
|
841
|
-
return
|
|
888
|
+
return De(m) === a;
|
|
842
889
|
}, N = /* @__PURE__ */ new Map();
|
|
843
890
|
function O(m) {
|
|
844
891
|
m && D.push(B.bind(null, m));
|
|
@@ -852,7 +899,7 @@ function je(n, t, e, r, i, h) {
|
|
|
852
899
|
if (q === !0 || q === 3 && v !== 4 || q === 4 && v !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + T);
|
|
853
900
|
N.set(s, !(v > 2) || v);
|
|
854
901
|
}
|
|
855
|
-
Y(R ? a : a.prototype, g, M, d ? "#" + T :
|
|
902
|
+
Y(R ? a : a.prototype, g, M, d ? "#" + T : je(T), v, c, R ? A = A || [] : l = l || [], D, R, d, w, v === 1, R && d ? j : h);
|
|
856
903
|
}
|
|
857
904
|
}
|
|
858
905
|
return O(l), O(A), D;
|
|
@@ -862,11 +909,11 @@ function je(n, t, e, r, i, h) {
|
|
|
862
909
|
return e.length && [L(Y(n, [e], r, n.name, 5, K, a), K), B.bind(null, a, n)];
|
|
863
910
|
} };
|
|
864
911
|
}
|
|
865
|
-
function
|
|
866
|
-
var t =
|
|
912
|
+
function je(n) {
|
|
913
|
+
var t = Ae(n, "string");
|
|
867
914
|
return typeof t == "symbol" ? t : t + "";
|
|
868
915
|
}
|
|
869
|
-
function
|
|
916
|
+
function Ae(n, t) {
|
|
870
917
|
if (typeof n != "object" || !n) return n;
|
|
871
918
|
var e = n[Symbol.toPrimitive];
|
|
872
919
|
if (e !== void 0) {
|
|
@@ -876,7 +923,7 @@ function De(n, t) {
|
|
|
876
923
|
}
|
|
877
924
|
return String(n);
|
|
878
925
|
}
|
|
879
|
-
function
|
|
926
|
+
function Bt(n, t, e) {
|
|
880
927
|
typeof t == "symbol" && (t = (t = t.description) ? "[" + t + "]" : "");
|
|
881
928
|
try {
|
|
882
929
|
Object.defineProperty(n, "name", { configurable: !0, value: e ? e + " " + t : t });
|
|
@@ -884,22 +931,22 @@ function $t(n, t, e) {
|
|
|
884
931
|
}
|
|
885
932
|
return n;
|
|
886
933
|
}
|
|
887
|
-
function
|
|
934
|
+
function De(n) {
|
|
888
935
|
if (Object(n) !== n) throw TypeError("right-hand side of 'in' should be an object, got " + (n !== null ? typeof n : "null"));
|
|
889
936
|
return n;
|
|
890
937
|
}
|
|
891
|
-
const
|
|
938
|
+
const nt = class nt extends gt {
|
|
892
939
|
constructor(t) {
|
|
893
940
|
var e = (...r) => (super(...r), this.options = t, this);
|
|
894
|
-
|
|
941
|
+
Pt(e(nt.mutationPrefix, t.entity));
|
|
895
942
|
}
|
|
896
943
|
useMutation() {
|
|
897
944
|
const t = vt({
|
|
898
945
|
mutationFn: (e) => this.options.mutationFn(e.input, e.entity, this.context),
|
|
899
946
|
onMutate: (e, r) => this.onMutate(e, r),
|
|
900
|
-
onSuccess: (e, r, i,
|
|
901
|
-
onError: (e, r, i,
|
|
902
|
-
onSettled: (e, r, i,
|
|
947
|
+
onSuccess: (e, r, i, f) => this.onSuccess(r, i, f),
|
|
948
|
+
onError: (e, r, i, f) => this.onError(e, r, i, f),
|
|
949
|
+
onSettled: (e, r, i, f, b) => this.onSettled(i, r, f, b),
|
|
903
950
|
gcTime: this.options.gcTime,
|
|
904
951
|
meta: this.options.meta,
|
|
905
952
|
networkMode: this.options.networkMode,
|
|
@@ -925,8 +972,8 @@ const it = class it extends gt {
|
|
|
925
972
|
t.mutationStrategy.onSuccess(), this.options.onSuccess?.(t.input, t.entity, e, r);
|
|
926
973
|
}
|
|
927
974
|
onError(t, e, r, i) {
|
|
928
|
-
const
|
|
929
|
-
e.mutationStrategy.onError(!0),
|
|
975
|
+
const f = e.mutationStrategy?.mutationErrorStrategy ?? ot.ROLLBACK;
|
|
976
|
+
e.mutationStrategy.onError(!0), f === ot.ROLLBACK && this.collection.deleteEntity(e.entity.id), this.options.onError?.(t, e.input, e.entity, r, i);
|
|
930
977
|
}
|
|
931
978
|
onSettled(t, e, r, i) {
|
|
932
979
|
this.options.onSettled?.(t.input, t.entity, e, r, i);
|
|
@@ -941,9 +988,9 @@ const it = class it extends gt {
|
|
|
941
988
|
});
|
|
942
989
|
}
|
|
943
990
|
};
|
|
944
|
-
[
|
|
945
|
-
let
|
|
946
|
-
class
|
|
991
|
+
[Pt] = Qe(nt, [[z, 2, "onMutate"], [z, 2, "onSuccess"], [z, 2, "onError"], [z, 2, "onSettled"]], [], 0, void 0, gt).e, V(nt, "mutationPrefix", "__mutation__create__");
|
|
992
|
+
let $t = nt;
|
|
993
|
+
class St extends gt {
|
|
947
994
|
constructor(t, e) {
|
|
948
995
|
super(t, e.entity), this.options = e, this.mutationStrategy = this.createMutationStrategy([e.instance], {
|
|
949
996
|
invalidationStrategy: e.invalidationStrategy,
|
|
@@ -970,9 +1017,9 @@ class Tt extends gt {
|
|
|
970
1017
|
mutateBase(t, e) {
|
|
971
1018
|
this.runSyncMutation(t, (r, i) => this.options.mutationFn(void 0, i), {
|
|
972
1019
|
onMutate: async (r, i) => e.onMutate?.(this.options.instance, i),
|
|
973
|
-
onSuccess: (r, i,
|
|
974
|
-
onError: (r, i,
|
|
975
|
-
onSettled: (r, i,
|
|
1020
|
+
onSuccess: (r, i, f, b) => e.onSuccess?.(this.options.instance, f, b),
|
|
1021
|
+
onError: (r, i, f, b) => e.onError?.(r, this.options.instance, f, b),
|
|
1022
|
+
onSettled: (r, i, f, b, B) => e.onSettled?.(this.options.instance, i, b, B),
|
|
976
1023
|
gcTime: this.options.gcTime,
|
|
977
1024
|
meta: this.options.meta,
|
|
978
1025
|
networkMode: this.options.networkMode,
|
|
@@ -983,47 +1030,47 @@ class Tt extends gt {
|
|
|
983
1030
|
});
|
|
984
1031
|
}
|
|
985
1032
|
}
|
|
986
|
-
let
|
|
987
|
-
function
|
|
988
|
-
function b(a, y,
|
|
1033
|
+
let Lt;
|
|
1034
|
+
function Fe(n, t, e, r, i, f) {
|
|
1035
|
+
function b(a, y, h) {
|
|
989
1036
|
return function(c, l) {
|
|
990
|
-
return
|
|
1037
|
+
return h && h(c), a[y].call(c, l);
|
|
991
1038
|
};
|
|
992
1039
|
}
|
|
993
1040
|
function B(a, y) {
|
|
994
|
-
for (var
|
|
1041
|
+
for (var h = 0; h < a.length; h++) a[h].call(y);
|
|
995
1042
|
return y;
|
|
996
1043
|
}
|
|
997
|
-
function Q(a, y,
|
|
998
|
-
if (typeof a != "function" && (c || a !== void 0)) throw new TypeError(y + " must " + (
|
|
1044
|
+
function Q(a, y, h, c) {
|
|
1045
|
+
if (typeof a != "function" && (c || a !== void 0)) throw new TypeError(y + " must " + (h || "be") + " a function" + (c ? "" : " or undefined"));
|
|
999
1046
|
return a;
|
|
1000
1047
|
}
|
|
1001
|
-
function Y(a, y,
|
|
1048
|
+
function Y(a, y, h, c, l, A, D, j, N, O, E, g, v) {
|
|
1002
1049
|
function T(u) {
|
|
1003
1050
|
if (!v(u)) throw new TypeError("Attempted to access private element on non-instance");
|
|
1004
1051
|
}
|
|
1005
1052
|
var d, M = y[0], R = y[3], w = !j;
|
|
1006
1053
|
if (!w) {
|
|
1007
|
-
|
|
1054
|
+
h || Array.isArray(M) || (M = [M]);
|
|
1008
1055
|
var s = {}, q = [], m = l === 3 ? "get" : l === 4 || g ? "set" : "value";
|
|
1009
|
-
O ? (E || g ? s = { get:
|
|
1056
|
+
O ? (E || g ? s = { get: Ht(function() {
|
|
1010
1057
|
return R(this);
|
|
1011
1058
|
}, c, "get"), set: function(u) {
|
|
1012
1059
|
y[4](this, u);
|
|
1013
|
-
} } : s[m] = R, E ||
|
|
1060
|
+
} } : s[m] = R, E || Ht(s[m], c, l === 2 ? "" : m)) : E || (s = Object.getOwnPropertyDescriptor(a, c));
|
|
1014
1061
|
}
|
|
1015
|
-
for (var p = a, o = M.length - 1; o >= 0; o -=
|
|
1016
|
-
var _ = M[o],
|
|
1062
|
+
for (var p = a, o = M.length - 1; o >= 0; o -= h ? 2 : 1) {
|
|
1063
|
+
var _ = M[o], C = h ? M[o - 1] : void 0, F = {}, x = { kind: ["field", "accessor", "method", "getter", "setter", "class"][l], name: c, metadata: A, addInitializer: (function(u, S) {
|
|
1017
1064
|
if (u.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
1018
1065
|
Q(S, "An initializer", "be", !0), D.push(S);
|
|
1019
1066
|
}).bind(null, F) };
|
|
1020
1067
|
try {
|
|
1021
|
-
if (w) (d = Q(_.call(
|
|
1068
|
+
if (w) (d = Q(_.call(C, p, x), "class decorators", "return")) && (p = d);
|
|
1022
1069
|
else {
|
|
1023
|
-
var
|
|
1024
|
-
x.static = N, x.private = O, O ? l === 2 ?
|
|
1070
|
+
var I, k;
|
|
1071
|
+
x.static = N, x.private = O, O ? l === 2 ? I = function(u) {
|
|
1025
1072
|
return T(u), s.value;
|
|
1026
|
-
} : (l < 4 && (
|
|
1073
|
+
} : (l < 4 && (I = b(s, "get", T)), l !== 3 && (k = b(s, "set", T))) : (I = function(u) {
|
|
1027
1074
|
return u[c];
|
|
1028
1075
|
}, (l < 2 || l === 4) && (k = function(u, S) {
|
|
1029
1076
|
u[c] = S;
|
|
@@ -1031,7 +1078,7 @@ function Ke(n, t, e, r, i, h) {
|
|
|
1031
1078
|
var $ = x.access = { has: O ? v.bind() : function(u) {
|
|
1032
1079
|
return c in u;
|
|
1033
1080
|
} };
|
|
1034
|
-
if (
|
|
1081
|
+
if (I && ($.get = I), k && ($.set = k), p = _.call(C, g ? { get: s.get, set: s.set } : s[m], x), g) {
|
|
1035
1082
|
if (typeof p == "object" && p) (d = Q(p.get, "accessor.get")) && (s.get = d), (d = Q(p.set, "accessor.set")) && (s.set = d), (d = Q(p.init, "accessor.init")) && q.push(d);
|
|
1036
1083
|
else if (p !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
1037
1084
|
} else Q(p, (E ? "field" : "method") + " decorators", "return") && (E ? q.push(p) : s[m] = p);
|
|
@@ -1048,10 +1095,10 @@ function Ke(n, t, e, r, i, h) {
|
|
|
1048
1095
|
function L(a, y) {
|
|
1049
1096
|
return Object.defineProperty(a, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: y });
|
|
1050
1097
|
}
|
|
1051
|
-
if (arguments.length >= 6) var H =
|
|
1052
|
-
var K = Object.create(H ?? null), U = (function(a, y,
|
|
1098
|
+
if (arguments.length >= 6) var H = f[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
1099
|
+
var K = Object.create(H ?? null), U = (function(a, y, h, c) {
|
|
1053
1100
|
var l, A, D = [], j = function(m) {
|
|
1054
|
-
return
|
|
1101
|
+
return Ne(m) === a;
|
|
1055
1102
|
}, N = /* @__PURE__ */ new Map();
|
|
1056
1103
|
function O(m) {
|
|
1057
1104
|
m && D.push(B.bind(null, m));
|
|
@@ -1065,7 +1112,7 @@ function Ke(n, t, e, r, i, h) {
|
|
|
1065
1112
|
if (q === !0 || q === 3 && v !== 4 || q === 4 && v !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + T);
|
|
1066
1113
|
N.set(s, !(v > 2) || v);
|
|
1067
1114
|
}
|
|
1068
|
-
Y(R ? a : a.prototype, g, M, d ? "#" + T :
|
|
1115
|
+
Y(R ? a : a.prototype, g, M, d ? "#" + T : Ke(T), v, c, R ? A = A || [] : l = l || [], D, R, d, w, v === 1, R && d ? j : h);
|
|
1069
1116
|
}
|
|
1070
1117
|
}
|
|
1071
1118
|
return O(l), O(A), D;
|
|
@@ -1075,11 +1122,11 @@ function Ke(n, t, e, r, i, h) {
|
|
|
1075
1122
|
return e.length && [L(Y(n, [e], r, n.name, 5, K, a), K), B.bind(null, a, n)];
|
|
1076
1123
|
} };
|
|
1077
1124
|
}
|
|
1078
|
-
function
|
|
1079
|
-
var t =
|
|
1125
|
+
function Ke(n) {
|
|
1126
|
+
var t = ke(n, "string");
|
|
1080
1127
|
return typeof t == "symbol" ? t : t + "";
|
|
1081
1128
|
}
|
|
1082
|
-
function
|
|
1129
|
+
function ke(n, t) {
|
|
1083
1130
|
if (typeof n != "object" || !n) return n;
|
|
1084
1131
|
var e = n[Symbol.toPrimitive];
|
|
1085
1132
|
if (e !== void 0) {
|
|
@@ -1089,7 +1136,7 @@ function Ne(n, t) {
|
|
|
1089
1136
|
}
|
|
1090
1137
|
return String(n);
|
|
1091
1138
|
}
|
|
1092
|
-
function
|
|
1139
|
+
function Ht(n, t, e) {
|
|
1093
1140
|
typeof t == "symbol" && (t = (t = t.description) ? "[" + t + "]" : "");
|
|
1094
1141
|
try {
|
|
1095
1142
|
Object.defineProperty(n, "name", { configurable: !0, value: e ? e + " " + t : t });
|
|
@@ -1097,21 +1144,21 @@ function Yt(n, t, e) {
|
|
|
1097
1144
|
}
|
|
1098
1145
|
return n;
|
|
1099
1146
|
}
|
|
1100
|
-
function
|
|
1147
|
+
function Ne(n) {
|
|
1101
1148
|
if (Object(n) !== n) throw TypeError("right-hand side of 'in' should be an object, got " + (n !== null ? typeof n : "null"));
|
|
1102
1149
|
return n;
|
|
1103
1150
|
}
|
|
1104
|
-
const
|
|
1151
|
+
const it = class it extends St {
|
|
1105
1152
|
constructor(t) {
|
|
1106
|
-
|
|
1153
|
+
Lt(super(it.mutationPrefix, t));
|
|
1107
1154
|
}
|
|
1108
1155
|
useMutation() {
|
|
1109
1156
|
const t = vt({
|
|
1110
1157
|
mutationFn: () => this.options.mutationFn(void 0, this.context),
|
|
1111
1158
|
onMutate: (e, r) => this.onMutate(r),
|
|
1112
|
-
onSuccess: (e, r, i,
|
|
1113
|
-
onError: (e, r, i,
|
|
1114
|
-
onSettled: (e, r, i,
|
|
1159
|
+
onSuccess: (e, r, i, f) => this.onSuccess(i, f),
|
|
1160
|
+
onError: (e, r, i, f) => this.onError(e, i, f),
|
|
1161
|
+
onSettled: (e, r, i, f, b) => this.onSettled(r, f, b),
|
|
1115
1162
|
gcTime: this.options.gcTime,
|
|
1116
1163
|
meta: this.options.meta,
|
|
1117
1164
|
networkMode: this.options.networkMode,
|
|
@@ -1140,14 +1187,14 @@ const ot = class ot extends Tt {
|
|
|
1140
1187
|
this.mutateBase(t, {
|
|
1141
1188
|
onMutate: (e, r) => this.onMutate(r),
|
|
1142
1189
|
onSuccess: (e, r, i) => this.onSuccess(r, i),
|
|
1143
|
-
onError: (e, r, i,
|
|
1144
|
-
onSettled: (e, r, i,
|
|
1190
|
+
onError: (e, r, i, f) => this.onError(e, i, f),
|
|
1191
|
+
onSettled: (e, r, i, f) => this.onSettled(r, i, f)
|
|
1145
1192
|
});
|
|
1146
1193
|
}
|
|
1147
1194
|
};
|
|
1148
|
-
[
|
|
1149
|
-
let
|
|
1150
|
-
class Xt extends
|
|
1195
|
+
[Lt] = Fe(it, [[z, 2, "onMutate"], [z, 2, "onSuccess"], [z, 2, "onError"]], [], 0, void 0, St).e, V(it, "mutationPrefix", "__mutation__delete__");
|
|
1196
|
+
let Yt = it;
|
|
1197
|
+
class Xt extends St {
|
|
1151
1198
|
static mutationPrefix = "__mutation__update__";
|
|
1152
1199
|
constructor(t) {
|
|
1153
1200
|
super(Xt.mutationPrefix, t);
|
|
@@ -1156,9 +1203,9 @@ class Xt extends Tt {
|
|
|
1156
1203
|
const t = vt({
|
|
1157
1204
|
mutationFn: () => this.options.mutationFn(void 0, this.context),
|
|
1158
1205
|
onMutate: async (e, r) => this.onMutateBase(r),
|
|
1159
|
-
onSuccess: (e, r, i,
|
|
1160
|
-
onError: (e, r, i,
|
|
1161
|
-
onSettled: (e, r, i,
|
|
1206
|
+
onSuccess: (e, r, i, f) => this.onSuccessBase(i, f),
|
|
1207
|
+
onError: (e, r, i, f) => this.onErrorBase(e, i, f),
|
|
1208
|
+
onSettled: (e, r, i, f, b) => this.onSettledBase(r, f, b),
|
|
1162
1209
|
gcTime: this.options.gcTime,
|
|
1163
1210
|
meta: this.options.meta,
|
|
1164
1211
|
networkMode: this.options.networkMode,
|
|
@@ -1180,70 +1227,12 @@ class Xt extends Tt {
|
|
|
1180
1227
|
this.mutateBase(t, {
|
|
1181
1228
|
onMutate: (e, r) => this.onMutateBase(r),
|
|
1182
1229
|
onSuccess: (e, r, i) => this.onSuccessBase(r, i),
|
|
1183
|
-
onError: (e, r, i,
|
|
1184
|
-
onSettled: (e, r, i,
|
|
1230
|
+
onError: (e, r, i, f) => this.onErrorBase(e, i, f),
|
|
1231
|
+
onSettled: (e, r, i, f) => this.onSettledBase(r, i, f)
|
|
1185
1232
|
});
|
|
1186
1233
|
}
|
|
1187
1234
|
}
|
|
1188
|
-
|
|
1189
|
-
state: /* @__PURE__ */ new Map(),
|
|
1190
|
-
context: null,
|
|
1191
|
-
options: {
|
|
1192
|
-
invalidationStrategy: G.REFERENCED_QUERIES,
|
|
1193
|
-
errorStrategy: st.ROLLBACK,
|
|
1194
|
-
invalidateOnError: !0
|
|
1195
|
-
}
|
|
1196
|
-
};
|
|
1197
|
-
class Ge {
|
|
1198
|
-
rootStore;
|
|
1199
|
-
constructor(t) {
|
|
1200
|
-
W.context = t.context;
|
|
1201
|
-
for (const e of t.entities)
|
|
1202
|
-
W.state.set(e.name, new _t(e, t.context.queryClient));
|
|
1203
|
-
W.options.invalidationStrategy = t.invalidationStrategy ?? G.REFERENCED_QUERIES, W.options.errorStrategy = t.errorStrategy ?? st.ROLLBACK, W.options.invalidateOnError = t.invalidateOnError ?? !0, this.rootStore = t.rootStore();
|
|
1204
|
-
}
|
|
1205
|
-
getEntityCollection(t) {
|
|
1206
|
-
const e = W.state.get(t.name);
|
|
1207
|
-
if (!e)
|
|
1208
|
-
throw new Error(`Entity collection not found for entity ${t.name}`);
|
|
1209
|
-
return e;
|
|
1210
|
-
}
|
|
1211
|
-
}
|
|
1212
|
-
class et {
|
|
1213
|
-
queryClient;
|
|
1214
|
-
context;
|
|
1215
|
-
globalState;
|
|
1216
|
-
constructor() {
|
|
1217
|
-
if (!W)
|
|
1218
|
-
throw new Error("Client not found");
|
|
1219
|
-
if (!W.context)
|
|
1220
|
-
throw new Error("MQClientContext is required");
|
|
1221
|
-
this.queryClient = W.context.queryClient, this.globalState = W.state, this.context = W.context;
|
|
1222
|
-
}
|
|
1223
|
-
getEntityCollection(t) {
|
|
1224
|
-
const e = this.globalState.get(t.name);
|
|
1225
|
-
if (!e)
|
|
1226
|
-
throw new Error(`Entity collection not found for entity ${t.name}`);
|
|
1227
|
-
return e;
|
|
1228
|
-
}
|
|
1229
|
-
runSyncMutation(t, e, r) {
|
|
1230
|
-
this.queryClient.getMutationCache().build(this.queryClient, {
|
|
1231
|
-
mutationFn: (i) => e(i, this.context),
|
|
1232
|
-
onError: r?.onError,
|
|
1233
|
-
onMutate: r?.onMutate,
|
|
1234
|
-
onSuccess: r?.onSuccess,
|
|
1235
|
-
onSettled: r?.onSettled,
|
|
1236
|
-
gcTime: r?.gcTime,
|
|
1237
|
-
meta: r?.meta,
|
|
1238
|
-
networkMode: r?.networkMode,
|
|
1239
|
-
retry: r?.retry,
|
|
1240
|
-
retryDelay: r?.retryDelay,
|
|
1241
|
-
scope: r?.scope,
|
|
1242
|
-
mutationKey: r?.mutationKey
|
|
1243
|
-
}).execute(t).catch((i) => console.log("runSyncMutation error", i));
|
|
1244
|
-
}
|
|
1245
|
-
}
|
|
1246
|
-
class Zt extends et {
|
|
1235
|
+
class Zt extends mt {
|
|
1247
1236
|
constructor(t, e) {
|
|
1248
1237
|
super(), this.entityConstructors = t, this.baseQueryKeysRest = e;
|
|
1249
1238
|
}
|
|
@@ -1251,13 +1240,13 @@ class Zt extends et {
|
|
|
1251
1240
|
return [this.entityConstructors.map((t) => t.name).join("_"), ...this.baseQueryKeysRest()];
|
|
1252
1241
|
}
|
|
1253
1242
|
get baseQueryHash() {
|
|
1254
|
-
return
|
|
1243
|
+
return ht(this.baseQueryKey);
|
|
1255
1244
|
}
|
|
1256
1245
|
createQueryKey(t) {
|
|
1257
1246
|
return [...this.baseQueryKey, t];
|
|
1258
1247
|
}
|
|
1259
1248
|
createQueryHash(t) {
|
|
1260
|
-
return
|
|
1249
|
+
return ht(this.createQueryKey(t));
|
|
1261
1250
|
}
|
|
1262
1251
|
useIsFetching(t) {
|
|
1263
1252
|
return fe({
|
|
@@ -1265,12 +1254,12 @@ class Zt extends et {
|
|
|
1265
1254
|
});
|
|
1266
1255
|
}
|
|
1267
1256
|
setOneEntity(t, e, r) {
|
|
1268
|
-
return this.getEntityCollection(r).setEntity(t, [
|
|
1257
|
+
return this.getEntityCollection(r).setEntity(t, [ht(e)]);
|
|
1269
1258
|
}
|
|
1270
1259
|
setManyEntities(t, e, r) {
|
|
1271
1260
|
if (typeof t != "object" || !Array.isArray(t))
|
|
1272
1261
|
throw new Error(`Query function for ${r.name} must return an array of entities`);
|
|
1273
|
-
return this.getEntityCollection(r).setEntities(t, [
|
|
1262
|
+
return this.getEntityCollection(r).setEntities(t, [ht(e)]);
|
|
1274
1263
|
}
|
|
1275
1264
|
}
|
|
1276
1265
|
class te extends Zt {
|
|
@@ -1293,11 +1282,11 @@ class te extends Zt {
|
|
|
1293
1282
|
});
|
|
1294
1283
|
}
|
|
1295
1284
|
invalidate(t) {
|
|
1296
|
-
|
|
1285
|
+
Tt(this.createQueryHash(t), this.queryClient.getQueryCache());
|
|
1297
1286
|
}
|
|
1298
1287
|
setQueryData(t, e) {
|
|
1299
|
-
const r = this.createQueryKey(e), [i,
|
|
1300
|
-
this.queryClient.setQueryData(r,
|
|
1288
|
+
const r = this.createQueryKey(e), [i, f] = this.setManyEntities(t, r, this.options.entity);
|
|
1289
|
+
this.queryClient.setQueryData(r, f);
|
|
1301
1290
|
}
|
|
1302
1291
|
/**
|
|
1303
1292
|
* Returns the current entity ID array stored in the TanStack query cache
|
|
@@ -1336,8 +1325,8 @@ class te extends Zt {
|
|
|
1336
1325
|
run: async () => {
|
|
1337
1326
|
if (!this.options.queryFn)
|
|
1338
1327
|
throw new Error("Query function is not defined");
|
|
1339
|
-
const r = await this.options.queryFn(t, this.context), [i,
|
|
1340
|
-
return
|
|
1328
|
+
const r = await this.options.queryFn(t, this.context), [i, f] = this.setManyEntities(r, e, this.options.entity);
|
|
1329
|
+
return f;
|
|
1341
1330
|
},
|
|
1342
1331
|
queryKey: e
|
|
1343
1332
|
};
|
|
@@ -1378,7 +1367,7 @@ class re extends Zt {
|
|
|
1378
1367
|
});
|
|
1379
1368
|
}
|
|
1380
1369
|
invalidate(t) {
|
|
1381
|
-
|
|
1370
|
+
Tt(this.createQueryHash(t), this.queryClient.getQueryCache());
|
|
1382
1371
|
}
|
|
1383
1372
|
setQueryData(t, e) {
|
|
1384
1373
|
const r = this.createQueryKey(e), i = this.setOneEntity(t, r, this.options.entity);
|
|
@@ -1421,7 +1410,7 @@ class ie extends te {
|
|
|
1421
1410
|
super(ie.queryPrefix, t);
|
|
1422
1411
|
}
|
|
1423
1412
|
useSuspenseQuery(t) {
|
|
1424
|
-
const e = this.queryFnWrapper(t), r =
|
|
1413
|
+
const e = this.queryFnWrapper(t), r = pt({
|
|
1425
1414
|
queryKey: e.queryKey,
|
|
1426
1415
|
queryFn: () => e.run(),
|
|
1427
1416
|
...this.options.staleTime !== void 0 ? {
|
|
@@ -1434,7 +1423,7 @@ class ie extends te {
|
|
|
1434
1423
|
return this.getEntities(r.data);
|
|
1435
1424
|
}
|
|
1436
1425
|
useDeferredQuery(t) {
|
|
1437
|
-
const e = Gt(t), r = this.queryFnWrapper(e), i =
|
|
1426
|
+
const e = Gt(t), r = this.queryFnWrapper(e), i = pt({
|
|
1438
1427
|
queryKey: r.queryKey,
|
|
1439
1428
|
queryFn: () => r.run(),
|
|
1440
1429
|
...this.options.staleTime !== void 0 ? {
|
|
@@ -1467,7 +1456,7 @@ class oe extends re {
|
|
|
1467
1456
|
super(oe.queryPrefix, t);
|
|
1468
1457
|
}
|
|
1469
1458
|
useSuspenseQuery(t) {
|
|
1470
|
-
const e = this.queryFnWrapper(t), r =
|
|
1459
|
+
const e = this.queryFnWrapper(t), r = pt({
|
|
1471
1460
|
queryKey: e.queryKey,
|
|
1472
1461
|
queryFn: () => e.run(),
|
|
1473
1462
|
...this.options.staleTime !== void 0 ? {
|
|
@@ -1480,7 +1469,7 @@ class oe extends re {
|
|
|
1480
1469
|
return this.getEntity(r.data);
|
|
1481
1470
|
}
|
|
1482
1471
|
useDeferredQuery(t) {
|
|
1483
|
-
const e = Gt(t), r = this.queryFnWrapper(e), i =
|
|
1472
|
+
const e = Gt(t), r = this.queryFnWrapper(e), i = pt({
|
|
1484
1473
|
queryKey: r.queryKey,
|
|
1485
1474
|
queryFn: () => r.run(),
|
|
1486
1475
|
...this.options.staleTime !== void 0 ? {
|
|
@@ -1507,7 +1496,7 @@ class oe extends re {
|
|
|
1507
1496
|
return i.data ? this.getEntity(i.data) : null;
|
|
1508
1497
|
}
|
|
1509
1498
|
}
|
|
1510
|
-
var
|
|
1499
|
+
var ft = { exports: {} }, et = {};
|
|
1511
1500
|
/**
|
|
1512
1501
|
* @license React
|
|
1513
1502
|
* react-jsx-runtime.production.js
|
|
@@ -1517,29 +1506,29 @@ var dt = { exports: {} }, rt = {};
|
|
|
1517
1506
|
* This source code is licensed under the MIT license found in the
|
|
1518
1507
|
* LICENSE file in the root directory of this source tree.
|
|
1519
1508
|
*/
|
|
1520
|
-
var
|
|
1521
|
-
function
|
|
1522
|
-
if (
|
|
1523
|
-
|
|
1509
|
+
var zt;
|
|
1510
|
+
function Pe() {
|
|
1511
|
+
if (zt) return et;
|
|
1512
|
+
zt = 1;
|
|
1524
1513
|
var n = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
|
|
1525
|
-
function e(r, i,
|
|
1514
|
+
function e(r, i, f) {
|
|
1526
1515
|
var b = null;
|
|
1527
|
-
if (
|
|
1528
|
-
|
|
1516
|
+
if (f !== void 0 && (b = "" + f), i.key !== void 0 && (b = "" + i.key), "key" in i) {
|
|
1517
|
+
f = {};
|
|
1529
1518
|
for (var B in i)
|
|
1530
|
-
B !== "key" && (
|
|
1531
|
-
} else
|
|
1532
|
-
return i =
|
|
1519
|
+
B !== "key" && (f[B] = i[B]);
|
|
1520
|
+
} else f = i;
|
|
1521
|
+
return i = f.ref, {
|
|
1533
1522
|
$$typeof: n,
|
|
1534
1523
|
type: r,
|
|
1535
1524
|
key: b,
|
|
1536
1525
|
ref: i !== void 0 ? i : null,
|
|
1537
|
-
props:
|
|
1526
|
+
props: f
|
|
1538
1527
|
};
|
|
1539
1528
|
}
|
|
1540
|
-
return
|
|
1529
|
+
return et.Fragment = t, et.jsx = e, et.jsxs = e, et;
|
|
1541
1530
|
}
|
|
1542
|
-
var
|
|
1531
|
+
var rt = {};
|
|
1543
1532
|
/**
|
|
1544
1533
|
* @license React
|
|
1545
1534
|
* react-jsx-runtime.development.js
|
|
@@ -1549,9 +1538,9 @@ var nt = {};
|
|
|
1549
1538
|
* This source code is licensed under the MIT license found in the
|
|
1550
1539
|
* LICENSE file in the root directory of this source tree.
|
|
1551
1540
|
*/
|
|
1552
|
-
var
|
|
1553
|
-
function
|
|
1554
|
-
return
|
|
1541
|
+
var Wt;
|
|
1542
|
+
function Be() {
|
|
1543
|
+
return Wt || (Wt = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
1555
1544
|
function n(o) {
|
|
1556
1545
|
if (o == null) return null;
|
|
1557
1546
|
if (typeof o == "function")
|
|
@@ -1562,7 +1551,7 @@ function $e() {
|
|
|
1562
1551
|
return "Fragment";
|
|
1563
1552
|
case c:
|
|
1564
1553
|
return "Profiler";
|
|
1565
|
-
case
|
|
1554
|
+
case h:
|
|
1566
1555
|
return "StrictMode";
|
|
1567
1556
|
case j:
|
|
1568
1557
|
return "Suspense";
|
|
@@ -1607,8 +1596,8 @@ function $e() {
|
|
|
1607
1596
|
}
|
|
1608
1597
|
if (_) {
|
|
1609
1598
|
_ = console;
|
|
1610
|
-
var
|
|
1611
|
-
return
|
|
1599
|
+
var C = _.error, F = typeof Symbol == "function" && Symbol.toStringTag && o[Symbol.toStringTag] || o.constructor.name || "Object";
|
|
1600
|
+
return C.call(
|
|
1612
1601
|
_,
|
|
1613
1602
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
1614
1603
|
F
|
|
@@ -1630,7 +1619,7 @@ function $e() {
|
|
|
1630
1619
|
var o = T.A;
|
|
1631
1620
|
return o === null ? null : o.getOwner();
|
|
1632
1621
|
}
|
|
1633
|
-
function
|
|
1622
|
+
function f() {
|
|
1634
1623
|
return Error("react-stack-top-frame");
|
|
1635
1624
|
}
|
|
1636
1625
|
function b(o) {
|
|
@@ -1641,14 +1630,14 @@ function $e() {
|
|
|
1641
1630
|
return o.key !== void 0;
|
|
1642
1631
|
}
|
|
1643
1632
|
function B(o, _) {
|
|
1644
|
-
function
|
|
1633
|
+
function C() {
|
|
1645
1634
|
w || (w = !0, console.error(
|
|
1646
1635
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
1647
1636
|
_
|
|
1648
1637
|
));
|
|
1649
1638
|
}
|
|
1650
|
-
|
|
1651
|
-
get:
|
|
1639
|
+
C.isReactWarning = !0, Object.defineProperty(o, "key", {
|
|
1640
|
+
get: C,
|
|
1652
1641
|
configurable: !0
|
|
1653
1642
|
});
|
|
1654
1643
|
}
|
|
@@ -1658,14 +1647,14 @@ function $e() {
|
|
|
1658
1647
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
1659
1648
|
)), o = this.props.ref, o !== void 0 ? o : null;
|
|
1660
1649
|
}
|
|
1661
|
-
function Y(o, _,
|
|
1662
|
-
return
|
|
1650
|
+
function Y(o, _, C, F, x, I, k, $) {
|
|
1651
|
+
return C = I.ref, o = {
|
|
1663
1652
|
$$typeof: U,
|
|
1664
1653
|
type: o,
|
|
1665
1654
|
key: _,
|
|
1666
|
-
props:
|
|
1655
|
+
props: I,
|
|
1667
1656
|
_owner: x
|
|
1668
|
-
}, (
|
|
1657
|
+
}, (C !== void 0 ? C : null) !== null ? Object.defineProperty(o, "ref", {
|
|
1669
1658
|
enumerable: !1,
|
|
1670
1659
|
get: Q
|
|
1671
1660
|
}) : Object.defineProperty(o, "ref", { enumerable: !1, value: null }), o._store = {}, Object.defineProperty(o._store, "validated", {
|
|
@@ -1690,7 +1679,7 @@ function $e() {
|
|
|
1690
1679
|
value: $
|
|
1691
1680
|
}), Object.freeze && (Object.freeze(o.props), Object.freeze(o)), o;
|
|
1692
1681
|
}
|
|
1693
|
-
function L(o, _,
|
|
1682
|
+
function L(o, _, C, F, x, I, k, $) {
|
|
1694
1683
|
var u = _.children;
|
|
1695
1684
|
if (u !== void 0)
|
|
1696
1685
|
if (F)
|
|
@@ -1721,21 +1710,21 @@ React keys must be passed directly to JSX without using spread:
|
|
|
1721
1710
|
u
|
|
1722
1711
|
), p[u + F] = !0);
|
|
1723
1712
|
}
|
|
1724
|
-
if (u = null,
|
|
1725
|
-
|
|
1713
|
+
if (u = null, C !== void 0 && (e(C), u = "" + C), b(_) && (e(_.key), u = "" + _.key), "key" in _) {
|
|
1714
|
+
C = {};
|
|
1726
1715
|
for (var P in _)
|
|
1727
|
-
P !== "key" && (
|
|
1728
|
-
} else
|
|
1716
|
+
P !== "key" && (C[P] = _[P]);
|
|
1717
|
+
} else C = _;
|
|
1729
1718
|
return u && B(
|
|
1730
|
-
|
|
1719
|
+
C,
|
|
1731
1720
|
typeof o == "function" ? o.displayName || o.name || "Unknown" : o
|
|
1732
1721
|
), Y(
|
|
1733
1722
|
o,
|
|
1734
1723
|
u,
|
|
1735
|
-
|
|
1724
|
+
I,
|
|
1736
1725
|
x,
|
|
1737
1726
|
i(),
|
|
1738
|
-
|
|
1727
|
+
C,
|
|
1739
1728
|
k,
|
|
1740
1729
|
$
|
|
1741
1730
|
);
|
|
@@ -1743,7 +1732,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
1743
1732
|
function H(o) {
|
|
1744
1733
|
typeof o == "object" && o !== null && o.$$typeof === U && o._store && (o._store.validated = 1);
|
|
1745
1734
|
}
|
|
1746
|
-
var K = de, U = Symbol.for("react.transitional.element"), a = Symbol.for("react.portal"), y = Symbol.for("react.fragment"),
|
|
1735
|
+
var K = de, U = Symbol.for("react.transitional.element"), a = Symbol.for("react.portal"), y = Symbol.for("react.fragment"), h = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), l = Symbol.for("react.consumer"), A = Symbol.for("react.context"), D = Symbol.for("react.forward_ref"), j = Symbol.for("react.suspense"), N = Symbol.for("react.suspense_list"), O = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), g = Symbol.for("react.activity"), v = Symbol.for("react.client.reference"), T = K.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, d = Object.prototype.hasOwnProperty, M = Array.isArray, R = console.createTask ? console.createTask : function() {
|
|
1747
1736
|
return null;
|
|
1748
1737
|
};
|
|
1749
1738
|
K = {
|
|
@@ -1753,47 +1742,47 @@ React keys must be passed directly to JSX without using spread:
|
|
|
1753
1742
|
};
|
|
1754
1743
|
var w, s = {}, q = K.react_stack_bottom_frame.bind(
|
|
1755
1744
|
K,
|
|
1756
|
-
|
|
1757
|
-
)(), m = R(r(
|
|
1758
|
-
|
|
1759
|
-
var
|
|
1745
|
+
f
|
|
1746
|
+
)(), m = R(r(f)), p = {};
|
|
1747
|
+
rt.Fragment = y, rt.jsx = function(o, _, C, F, x) {
|
|
1748
|
+
var I = 1e4 > T.recentlyCreatedOwnerStacks++;
|
|
1760
1749
|
return L(
|
|
1761
1750
|
o,
|
|
1762
1751
|
_,
|
|
1763
|
-
|
|
1752
|
+
C,
|
|
1764
1753
|
!1,
|
|
1765
1754
|
F,
|
|
1766
1755
|
x,
|
|
1767
|
-
|
|
1768
|
-
|
|
1756
|
+
I ? Error("react-stack-top-frame") : q,
|
|
1757
|
+
I ? R(r(o)) : m
|
|
1769
1758
|
);
|
|
1770
|
-
},
|
|
1771
|
-
var
|
|
1759
|
+
}, rt.jsxs = function(o, _, C, F, x) {
|
|
1760
|
+
var I = 1e4 > T.recentlyCreatedOwnerStacks++;
|
|
1772
1761
|
return L(
|
|
1773
1762
|
o,
|
|
1774
1763
|
_,
|
|
1775
|
-
|
|
1764
|
+
C,
|
|
1776
1765
|
!0,
|
|
1777
1766
|
F,
|
|
1778
1767
|
x,
|
|
1779
|
-
|
|
1780
|
-
|
|
1768
|
+
I ? Error("react-stack-top-frame") : q,
|
|
1769
|
+
I ? R(r(o)) : m
|
|
1781
1770
|
);
|
|
1782
1771
|
};
|
|
1783
|
-
})()),
|
|
1772
|
+
})()), rt;
|
|
1784
1773
|
}
|
|
1785
|
-
var
|
|
1786
|
-
function
|
|
1787
|
-
return
|
|
1774
|
+
var Ut;
|
|
1775
|
+
function $e() {
|
|
1776
|
+
return Ut || (Ut = 1, process.env.NODE_ENV === "production" ? ft.exports = Pe() : ft.exports = Be()), ft.exports;
|
|
1788
1777
|
}
|
|
1789
|
-
var
|
|
1790
|
-
function
|
|
1778
|
+
var Le = $e();
|
|
1779
|
+
function Ge() {
|
|
1791
1780
|
const n = pe(null);
|
|
1792
1781
|
return {
|
|
1793
1782
|
Provider: ({
|
|
1794
1783
|
children: t,
|
|
1795
1784
|
client: e
|
|
1796
|
-
}) => /* @__PURE__ */
|
|
1785
|
+
}) => /* @__PURE__ */ Le.jsx(n.Provider, { value: e, children: t }),
|
|
1797
1786
|
useContext: () => {
|
|
1798
1787
|
const t = me(n);
|
|
1799
1788
|
if (!t)
|
|
@@ -1802,19 +1791,24 @@ function Je() {
|
|
|
1802
1791
|
}
|
|
1803
1792
|
};
|
|
1804
1793
|
}
|
|
1794
|
+
const Vt = /* @__PURE__ */ new Map(), He = "entityClientOnlyId";
|
|
1795
|
+
function Je(n) {
|
|
1796
|
+
const t = (Vt.get(n.name) ?? 0) + 1;
|
|
1797
|
+
return Vt.set(n.name, t), `${He}_${n.name}_${t}`;
|
|
1798
|
+
}
|
|
1805
1799
|
export {
|
|
1806
|
-
|
|
1800
|
+
we as BatchMutationBase,
|
|
1807
1801
|
Jt as BatchUpdateMutation,
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1802
|
+
$t as CreateMutation,
|
|
1803
|
+
Yt as DeleteMutation,
|
|
1804
|
+
Kt as Entity,
|
|
1805
|
+
bt as EntityCollection,
|
|
1806
|
+
St as EntityMutationBase,
|
|
1807
|
+
dt as EntityState,
|
|
1808
|
+
Ve as MQClient,
|
|
1809
|
+
mt as MQClientAccessor,
|
|
1816
1810
|
gt as MutationBase,
|
|
1817
|
-
|
|
1811
|
+
ot as OptimisticMutationErrorStrategy,
|
|
1818
1812
|
G as OptimisticMutationInvalidationStrategy,
|
|
1819
1813
|
Zt as QueryBase,
|
|
1820
1814
|
ee as QueryFragmentMany,
|
|
@@ -1824,7 +1818,7 @@ export {
|
|
|
1824
1818
|
oe as QueryOne,
|
|
1825
1819
|
re as QueryOneBase,
|
|
1826
1820
|
Xt as UpdateMutation,
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1821
|
+
Ge as createReactContext,
|
|
1822
|
+
Je as generateEntityId,
|
|
1823
|
+
Tt as invalidateQueryByHash
|
|
1830
1824
|
};
|