@statezero/core 0.2.51 → 0.2.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/dist/adaptors/vue/components/StateZeroDebugPanel.js +495 -476
  2. package/dist/adaptors/vue/reactivity.d.ts +1 -0
  3. package/dist/adaptors/vue/reactivity.js +17 -5
  4. package/dist/cli/commands/syncActions.js +33 -1
  5. package/dist/cli/commands/syncModels.js +44 -3
  6. package/dist/filtering/localFiltering.js +3 -2
  7. package/dist/flavours/django/errors.d.ts +12 -0
  8. package/dist/flavours/django/errors.js +20 -0
  9. package/dist/flavours/django/f.js +16 -15
  10. package/dist/index.d.ts +2 -1
  11. package/dist/index.js +2 -2
  12. package/dist/models/backend1/django_app/author.d.ts +284 -0
  13. package/dist/models/backend1/django_app/author.js +69 -0
  14. package/dist/models/backend1/django_app/author.schema.json +281 -0
  15. package/dist/models/backend1/django_app/book.d.ts +262 -0
  16. package/dist/models/backend1/django_app/book.js +71 -0
  17. package/dist/models/backend1/django_app/book.schema.json +254 -0
  18. package/dist/models/backend1/django_app/composeditem.d.ts +140 -0
  19. package/dist/models/backend1/django_app/composeditem.js +69 -0
  20. package/dist/models/backend1/django_app/composeditem.schema.json +122 -0
  21. package/dist/models/backend1/django_app/comprehensivemodel.schema.json +3 -3
  22. package/dist/models/backend1/django_app/dailyrate.schema.json +7 -7
  23. package/dist/models/backend1/django_app/deepmodellevel1.schema.json +1 -1
  24. package/dist/models/backend1/django_app/dummymodel.schema.json +3 -3
  25. package/dist/models/backend1/django_app/errortestcompoundunique.d.ts +124 -0
  26. package/dist/models/backend1/django_app/errortestcompoundunique.js +69 -0
  27. package/dist/models/backend1/django_app/errortestcompoundunique.schema.json +106 -0
  28. package/dist/models/backend1/django_app/errortestonetoonemodel.d.ts +118 -0
  29. package/dist/models/backend1/django_app/errortestonetoonemodel.js +71 -0
  30. package/dist/models/backend1/django_app/errortestonetoonemodel.schema.json +90 -0
  31. package/dist/models/backend1/django_app/errortestparent.d.ts +92 -0
  32. package/dist/models/backend1/django_app/errortestparent.js +69 -0
  33. package/dist/models/backend1/django_app/errortestparent.schema.json +70 -0
  34. package/dist/models/backend1/django_app/errortestprotectedchild.d.ts +118 -0
  35. package/dist/models/backend1/django_app/errortestprotectedchild.js +71 -0
  36. package/dist/models/backend1/django_app/errortestprotectedchild.schema.json +94 -0
  37. package/dist/models/backend1/django_app/errortestuniquemodel.d.ts +108 -0
  38. package/dist/models/backend1/django_app/errortestuniquemodel.js +69 -0
  39. package/dist/models/backend1/django_app/errortestuniquemodel.schema.json +88 -0
  40. package/dist/models/backend1/django_app/excludeditem.d.ts +124 -0
  41. package/dist/models/backend1/django_app/excludeditem.js +69 -0
  42. package/dist/models/backend1/django_app/excludeditem.schema.json +105 -0
  43. package/dist/models/backend1/django_app/hfchild.d.ts +118 -0
  44. package/dist/models/backend1/django_app/hfchild.js +71 -0
  45. package/dist/models/backend1/django_app/hfchild.schema.json +94 -0
  46. package/dist/models/backend1/django_app/hfparent.d.ts +124 -0
  47. package/dist/models/backend1/django_app/hfparent.js +69 -0
  48. package/dist/models/backend1/django_app/hfparent.schema.json +105 -0
  49. package/dist/models/backend1/django_app/index.js +19 -0
  50. package/dist/models/backend1/django_app/m2mdepthtestlevel1.schema.json +3 -3
  51. package/dist/models/backend1/django_app/m2mdepthtestlevel2.schema.json +3 -3
  52. package/dist/models/backend1/django_app/m2mdepthtestlevel3.schema.json +5 -5
  53. package/dist/models/backend1/django_app/modelwithrestrictedfields.schema.json +2 -2
  54. package/dist/models/backend1/django_app/nodeleteitem.d.ts +124 -0
  55. package/dist/models/backend1/django_app/nodeleteitem.js +69 -0
  56. package/dist/models/backend1/django_app/nodeleteitem.schema.json +105 -0
  57. package/dist/models/backend1/django_app/objectlevelitem.d.ts +124 -0
  58. package/dist/models/backend1/django_app/objectlevelitem.js +69 -0
  59. package/dist/models/backend1/django_app/objectlevelitem.schema.json +105 -0
  60. package/dist/models/backend1/django_app/order.schema.json +7 -7
  61. package/dist/models/backend1/django_app/orderitem.schema.json +5 -5
  62. package/dist/models/backend1/django_app/product.schema.json +11 -11
  63. package/dist/models/backend1/django_app/productcategory.schema.json +2 -2
  64. package/dist/models/backend1/django_app/rateplan.schema.json +2 -2
  65. package/dist/models/backend1/django_app/readonlyitem.d.ts +124 -0
  66. package/dist/models/backend1/django_app/readonlyitem.js +69 -0
  67. package/dist/models/backend1/django_app/readonlyitem.schema.json +105 -0
  68. package/dist/models/backend1/django_app/restrictedcreateitem.d.ts +124 -0
  69. package/dist/models/backend1/django_app/restrictedcreateitem.js +69 -0
  70. package/dist/models/backend1/django_app/restrictedcreateitem.schema.json +105 -0
  71. package/dist/models/backend1/django_app/restrictededititem.d.ts +124 -0
  72. package/dist/models/backend1/django_app/restrictededititem.js +69 -0
  73. package/dist/models/backend1/django_app/restrictededititem.schema.json +105 -0
  74. package/dist/models/backend1/django_app/restrictedfieldrelatedmodel.schema.json +1 -1
  75. package/dist/models/backend1/django_app/rowfiltereditem.d.ts +124 -0
  76. package/dist/models/backend1/django_app/rowfiltereditem.js +69 -0
  77. package/dist/models/backend1/django_app/rowfiltereditem.schema.json +105 -0
  78. package/dist/models/backend1/django_app/tag.d.ts +554 -0
  79. package/dist/models/backend1/django_app/tag.js +71 -0
  80. package/dist/models/backend1/django_app/tag.schema.json +541 -0
  81. package/dist/models/backend1/django_app/updateonlyitem.d.ts +108 -0
  82. package/dist/models/backend1/django_app/updateonlyitem.js +69 -0
  83. package/dist/models/backend1/django_app/updateonlyitem.schema.json +88 -0
  84. package/dist/models/default/django_app/author.d.ts +284 -0
  85. package/dist/models/default/django_app/author.js +69 -0
  86. package/dist/models/default/django_app/author.schema.json +281 -0
  87. package/dist/models/default/django_app/book.d.ts +262 -0
  88. package/dist/models/default/django_app/book.js +71 -0
  89. package/dist/models/default/django_app/book.schema.json +254 -0
  90. package/dist/models/default/django_app/composeditem.d.ts +140 -0
  91. package/dist/models/default/django_app/composeditem.js +69 -0
  92. package/dist/models/default/django_app/composeditem.schema.json +122 -0
  93. package/dist/models/default/django_app/comprehensivemodel.schema.json +3 -3
  94. package/dist/models/default/django_app/dailyrate.schema.json +7 -7
  95. package/dist/models/default/django_app/deepmodellevel1.d.ts +1 -13
  96. package/dist/models/default/django_app/deepmodellevel1.schema.json +2 -14
  97. package/dist/models/default/django_app/deepmodellevel2.d.ts +1 -13
  98. package/dist/models/default/django_app/deepmodellevel2.schema.json +1 -13
  99. package/dist/models/default/django_app/deepmodellevel3.d.ts +1 -13
  100. package/dist/models/default/django_app/deepmodellevel3.schema.json +1 -13
  101. package/dist/models/default/django_app/dummymodel.d.ts +1 -13
  102. package/dist/models/default/django_app/dummymodel.schema.json +4 -16
  103. package/dist/models/default/django_app/dummyrelatedmodel.d.ts +1 -13
  104. package/dist/models/default/django_app/dummyrelatedmodel.schema.json +1 -13
  105. package/dist/models/default/django_app/errortestcompoundunique.d.ts +124 -0
  106. package/dist/models/default/django_app/errortestcompoundunique.js +69 -0
  107. package/dist/models/default/django_app/errortestcompoundunique.schema.json +106 -0
  108. package/dist/models/default/django_app/errortestonetoonemodel.d.ts +118 -0
  109. package/dist/models/default/django_app/errortestonetoonemodel.js +71 -0
  110. package/dist/models/default/django_app/errortestonetoonemodel.schema.json +90 -0
  111. package/dist/models/default/django_app/errortestparent.d.ts +92 -0
  112. package/dist/models/default/django_app/errortestparent.js +69 -0
  113. package/dist/models/default/django_app/errortestparent.schema.json +70 -0
  114. package/dist/models/default/django_app/errortestprotectedchild.d.ts +118 -0
  115. package/dist/models/default/django_app/errortestprotectedchild.js +71 -0
  116. package/dist/models/default/django_app/errortestprotectedchild.schema.json +94 -0
  117. package/dist/models/default/django_app/errortestuniquemodel.d.ts +108 -0
  118. package/dist/models/default/django_app/errortestuniquemodel.js +69 -0
  119. package/dist/models/default/django_app/errortestuniquemodel.schema.json +88 -0
  120. package/dist/models/default/django_app/excludeditem.d.ts +124 -0
  121. package/dist/models/default/django_app/excludeditem.js +69 -0
  122. package/dist/models/default/django_app/excludeditem.schema.json +105 -0
  123. package/dist/models/default/django_app/filetest.d.ts +1 -13
  124. package/dist/models/default/django_app/filetest.schema.json +1 -13
  125. package/dist/models/default/django_app/hfchild.d.ts +118 -0
  126. package/dist/models/default/django_app/hfchild.js +71 -0
  127. package/dist/models/default/django_app/hfchild.schema.json +94 -0
  128. package/dist/models/default/django_app/hfparent.d.ts +124 -0
  129. package/dist/models/default/django_app/hfparent.js +69 -0
  130. package/dist/models/default/django_app/hfparent.schema.json +105 -0
  131. package/dist/models/default/django_app/index.js +19 -0
  132. package/dist/models/default/django_app/m2mdepthtestlevel1.schema.json +3 -3
  133. package/dist/models/default/django_app/m2mdepthtestlevel2.schema.json +3 -3
  134. package/dist/models/default/django_app/m2mdepthtestlevel3.schema.json +5 -5
  135. package/dist/models/default/django_app/modelwithrestrictedfields.schema.json +2 -2
  136. package/dist/models/default/django_app/nodeleteitem.d.ts +124 -0
  137. package/dist/models/default/django_app/nodeleteitem.js +69 -0
  138. package/dist/models/default/django_app/nodeleteitem.schema.json +105 -0
  139. package/dist/models/default/django_app/objectlevelitem.d.ts +124 -0
  140. package/dist/models/default/django_app/objectlevelitem.js +69 -0
  141. package/dist/models/default/django_app/objectlevelitem.schema.json +105 -0
  142. package/dist/models/default/django_app/order.schema.json +7 -7
  143. package/dist/models/default/django_app/orderitem.schema.json +5 -5
  144. package/dist/models/default/django_app/product.schema.json +11 -11
  145. package/dist/models/default/django_app/productcategory.schema.json +2 -2
  146. package/dist/models/default/django_app/rateplan.schema.json +2 -2
  147. package/dist/models/default/django_app/readonlyitem.d.ts +124 -0
  148. package/dist/models/default/django_app/readonlyitem.js +69 -0
  149. package/dist/models/default/django_app/readonlyitem.schema.json +105 -0
  150. package/dist/models/default/django_app/restrictedcreateitem.d.ts +124 -0
  151. package/dist/models/default/django_app/restrictedcreateitem.js +69 -0
  152. package/dist/models/default/django_app/restrictedcreateitem.schema.json +105 -0
  153. package/dist/models/default/django_app/restrictededititem.d.ts +124 -0
  154. package/dist/models/default/django_app/restrictededititem.js +69 -0
  155. package/dist/models/default/django_app/restrictededititem.schema.json +105 -0
  156. package/dist/models/default/django_app/restrictedfieldrelatedmodel.schema.json +1 -1
  157. package/dist/models/default/django_app/rowfiltereditem.d.ts +124 -0
  158. package/dist/models/default/django_app/rowfiltereditem.js +69 -0
  159. package/dist/models/default/django_app/rowfiltereditem.schema.json +105 -0
  160. package/dist/models/default/django_app/tag.d.ts +554 -0
  161. package/dist/models/default/django_app/tag.js +71 -0
  162. package/dist/models/default/django_app/tag.schema.json +541 -0
  163. package/dist/models/default/django_app/updateonlyitem.d.ts +108 -0
  164. package/dist/models/default/django_app/updateonlyitem.js +69 -0
  165. package/dist/models/default/django_app/updateonlyitem.schema.json +88 -0
  166. package/dist/schemaIntegrity.d.ts +14 -0
  167. package/dist/schemaIntegrity.js +29 -0
  168. package/dist/setup.js +6 -0
  169. package/dist/syncEngine/stores/operationEventHandlers.js +10 -8
  170. package/dist/syncEngine/stores/querysetStore.js +9 -0
  171. package/package.json +1 -1
@@ -1,31 +1,31 @@
1
- import { ref as J, computed as R, onMounted as us, onBeforeUnmount as hs, watch as it, createElementBlock as $, openBlock as A, createElementVNode as h, createVNode as Tt, toDisplayString as S, createCommentVNode as V, Fragment as W, renderList as ce, normalizeClass as Mt, normalizeStyle as at, withDirectives as Ue, createTextVNode as Qe, vModelCheckbox as $t, vModelSelect as At, Transition as Ot, withCtx as Pt } from "vue";
1
+ import { ref as J, computed as R, onMounted as hs, onBeforeUnmount as fs, watch as it, createElementBlock as $, openBlock as A, createElementVNode as h, createVNode as Tt, toDisplayString as S, createCommentVNode as V, Fragment as W, renderList as ce, normalizeClass as Mt, normalizeStyle as at, withDirectives as Qe, createTextVNode as Ve, vModelCheckbox as $t, vModelSelect as At, Transition as Ot, withCtx as Pt } from "vue";
2
2
  import { v7 as G } from "uuid";
3
- import { isNil as E, isEmpty as Ce, trim as dt, isEqual as qe } from "lodash-es";
3
+ import { isNil as E, isEmpty as ve, trim as dt, isEqual as qe } from "lodash-es";
4
4
  import Ae from "mitt";
5
- import Ft from "handlebars";
6
- import Dt from "superjson";
7
- import fs from "p-queue";
8
- import ps from "axios";
5
+ import It from "handlebars";
6
+ import Ft from "superjson";
7
+ import ps from "p-queue";
8
+ import ms from "axios";
9
9
  import { z as P } from "zod";
10
- import ms from "pusher-js";
11
- import Wt, { createEqualsOperation as ee } from "sift";
12
- import { DateTime as ge } from "luxon";
13
- import { parse as ys, format as gs } from "date-fns";
14
- import { Graph as It } from "graphlib";
10
+ import ys from "pusher-js";
11
+ import Zt, { createEqualsOperation as ee } from "sift";
12
+ import { DateTime as _e } from "luxon";
13
+ import { parse as gs, format as _s } from "date-fns";
14
+ import { Graph as Dt } from "graphlib";
15
15
  import Le from "object-hash";
16
- import * as Zt from "mathjs";
17
- import _s from "rfdc";
16
+ import * as Yt from "mathjs";
17
+ import ws from "rfdc";
18
18
  const se = /* @__PURE__ */ new Map(), ut = /* @__PURE__ */ new Set();
19
- function ws(n) {
19
+ function Cs(n) {
20
20
  return ut.add(n), () => ut.delete(n);
21
21
  }
22
22
  function Je(n) {
23
23
  return typeof n == "string" && /\{\{\s*TempPK_[^}\s]+\s*\}\}/.test(n);
24
24
  }
25
- function Kt(n) {
25
+ function zt(n) {
26
26
  return `{{TempPK_${n}}}`;
27
27
  }
28
- function zt(n, e) {
28
+ function Kt(n, e) {
29
29
  const t = `{{TempPK_${n}}}`, s = `"TempPK_${n}"`, r = typeof e == "string" ? `"${e}"` : String(e);
30
30
  se.set(s, r);
31
31
  for (const o of ut)
@@ -35,7 +35,7 @@ function zt(n, e) {
35
35
  console.warn("[tempPk] onResolve callback error:", i);
36
36
  }
37
37
  }
38
- function Cs(n) {
38
+ function vs(n) {
39
39
  if (!Je(String(n))) return n;
40
40
  const e = String(n).match(/\{\{\s*TempPK_([^}\s]+)\s*\}\}/);
41
41
  if (!e) return n;
@@ -47,15 +47,15 @@ function We(n) {
47
47
  const e = Object.fromEntries(se);
48
48
  try {
49
49
  if (typeof n == "string")
50
- return Ft.compile(n, { noEscape: !0 })(e);
51
- const t = Dt.stringify(n), r = Ft.compile(t, { noEscape: !0 })(e);
52
- return Dt.parse(r);
50
+ return It.compile(n, { noEscape: !0 })(e);
51
+ const t = Ft.stringify(n), r = It.compile(t, { noEscape: !0 })(e);
52
+ return Ft.parse(r);
53
53
  } catch {
54
54
  return n;
55
55
  }
56
56
  }
57
- const vs = Ae(), Es = Ae(), Rt = Ae();
58
- class bs {
57
+ const Es = Ae(), bs = Ae(), Rt = Ae();
58
+ class ks {
59
59
  constructor(e, t = {}) {
60
60
  this.dbName = e, this.storeName = t.storeName || "keyval-store", this.batchDelay = t.batchDelay || 50, this.version = t.version || 5, this.resetOnErrors = t.resetOnErrors || [
61
61
  "VersionError",
@@ -238,7 +238,7 @@ class bs {
238
238
  }
239
239
  class vt {
240
240
  constructor(e, t = {}, s = null) {
241
- this.store = new bs(e, t), this.localMap = /* @__PURE__ */ new Map(), this.hydrate().then((r) => {
241
+ this.store = new ks(e, t), this.localMap = /* @__PURE__ */ new Map(), this.hydrate().then((r) => {
242
242
  typeof s == "function" && s(r);
243
243
  }).catch((r) => {
244
244
  console.error(`Cache hydration failed for "${e}":`, r);
@@ -285,7 +285,7 @@ class vt {
285
285
  });
286
286
  }
287
287
  }
288
- const ye = (n, e) => {
288
+ const ge = (n, e) => {
289
289
  if (!e || !e.pks || e.pks.length === 0) return;
290
290
  const t = e.pks.map((r) => n._lastRenderedData.get(r) ?? null), s = n.render(e.pks, !0, !1);
291
291
  if (!qe(s, t)) {
@@ -294,7 +294,7 @@ const ye = (n, e) => {
294
294
  o && o[r] != null && n._lastRenderedData.set(o[r], o);
295
295
  for (const o of e.pks)
296
296
  s.some((i) => i && i[r] === o) || n._lastRenderedData.set(o, null);
297
- vs.emit(
297
+ Es.emit(
298
298
  `${n.modelClass.configKey}::${n.modelClass.modelName}::render`,
299
299
  e
300
300
  ), n.renderCallbacks.forEach((o) => {
@@ -340,14 +340,14 @@ class Y {
340
340
  return r.size > 0 ? new Y(t, Array.from(r)) : null;
341
341
  }
342
342
  }
343
- class ks {
343
+ class Ss {
344
344
  modelClass;
345
345
  fetchFn;
346
346
  groundTruthArray;
347
347
  operationsMap;
348
348
  isSyncing;
349
349
  constructor(e, t, s = null, r = null, o = {}) {
350
- this.modelClass = e, this.fetchFn = t, this.isSyncing = !1, this.pruneThreshold = o.pruneThreshold || 10, this.groundTruthArray = s || [], this.operationsMap = /* @__PURE__ */ new Map(), r && r.length > 0 && this._loadOperations(r), this.modelCache = new vt("model-cache", {}, this.onHydrated.bind(this)), this._lastRenderedData = /* @__PURE__ */ new Map(), this.renderCallbacks = /* @__PURE__ */ new Set(), this._unsubscribeTempPk = ws((i, l) => {
350
+ this.modelClass = e, this.fetchFn = t, this.isSyncing = !1, this.pruneThreshold = o.pruneThreshold || 10, this.groundTruthArray = s || [], this.operationsMap = /* @__PURE__ */ new Map(), r && r.length > 0 && this._loadOperations(r), this.modelCache = new vt("model-cache", {}, this.onHydrated.bind(this)), this._lastRenderedData = /* @__PURE__ */ new Map(), this.renderCallbacks = /* @__PURE__ */ new Set(), this._unsubscribeTempPk = Cs((i, l) => {
351
351
  if (this._lastRenderedData.has(i)) {
352
352
  const a = this._lastRenderedData.get(i);
353
353
  a && typeof a == "object" && (a[this.pkField] = l), this._lastRenderedData.set(l, a), this._lastRenderedData.delete(i);
@@ -363,7 +363,7 @@ class ks {
363
363
  */
364
364
  _loadOperations(e) {
365
365
  e.forEach((t) => {
366
- const s = Oe.get(t.operationId);
366
+ const s = Pe.get(t.operationId);
367
367
  s ? this.operationsMap.set(s.operationId, s) : this.operationsMap.set(t.operationId, new q(t, !0));
368
368
  });
369
369
  }
@@ -374,7 +374,7 @@ class ks {
374
374
  onHydrated() {
375
375
  if (this.groundTruthArray.length === 0 && this.operationsMap.size === 0) {
376
376
  let e = this.modelCache.get(this.cacheKey);
377
- !E(e) && !Ce(e) && this.setGroundTruth(e);
377
+ !E(e) && !ve(e) && this.setGroundTruth(e);
378
378
  }
379
379
  }
380
380
  setCache(e) {
@@ -382,7 +382,7 @@ class ks {
382
382
  let s = [];
383
383
  e.forEach((r) => {
384
384
  let o = r[t];
385
- if (!(typeof o == "string" && Je(o) && (o = We(r[t]), E(o) || Ce(dt(o)))))
385
+ if (!(typeof o == "string" && Je(o) && (o = We(r[t]), E(o) || ve(dt(o)))))
386
386
  if (r && typeof r.serialize == "function") {
387
387
  const i = r.serialize(!0);
388
388
  i[t] = o, s.push(i);
@@ -398,7 +398,7 @@ class ks {
398
398
  let r = [];
399
399
  if (e.forEach((c) => {
400
400
  let f = c[s];
401
- typeof f == "string" && Je(f) && (f = We(c[s]), E(f) || Ce(dt(f))) || (c[s] = f, r.push(c));
401
+ typeof f == "string" && Je(f) && (f = We(c[s]), E(f) || ve(dt(f))) || (c[s] = f, r.push(c));
402
402
  }), t === null) {
403
403
  this.setCache(r);
404
404
  return;
@@ -422,16 +422,16 @@ class ks {
422
422
  }
423
423
  // Commit optimistic updates
424
424
  addOperation(e) {
425
- this.operationsMap.set(e.operationId, e), this.operationsMap.size > this.pruneThreshold && this.prune(), ye(this, Y.fromOperation(e));
425
+ this.operationsMap.set(e.operationId, e), this.operationsMap.size > this.pruneThreshold && this.prune(), ge(this, Y.fromOperation(e));
426
426
  }
427
427
  updateOperation(e) {
428
- return this.operationsMap.has(e.operationId) ? (this.operationsMap.set(e.operationId, e), ye(this, Y.fromOperation(e)), !0) : !1;
428
+ return this.operationsMap.has(e.operationId) ? (this.operationsMap.set(e.operationId, e), ge(this, Y.fromOperation(e)), !0) : !1;
429
429
  }
430
430
  confirm(e) {
431
- this.operationsMap.has(e.operationId) && (this.operationsMap.set(e.operationId, e), ye(this, Y.fromOperation(e)));
431
+ this.operationsMap.has(e.operationId) && (this.operationsMap.set(e.operationId, e), ge(this, Y.fromOperation(e)));
432
432
  }
433
433
  reject(e) {
434
- this.operationsMap.has(e.operationId) && (this.operationsMap.set(e.operationId, e), ye(this, Y.fromOperation(e)));
434
+ this.operationsMap.has(e.operationId) && (this.operationsMap.set(e.operationId, e), ge(this, Y.fromOperation(e)));
435
435
  }
436
436
  setOperations(e = []) {
437
437
  const t = this.operations;
@@ -439,14 +439,14 @@ class ks {
439
439
  this.operationsMap.set(r.operationId, r);
440
440
  });
441
441
  const s = [...t, ...this.operations];
442
- ye(this, Y.fromOperations(s));
442
+ ge(this, Y.fromOperations(s));
443
443
  }
444
444
  // Ground truth data methods
445
445
  setGroundTruth(e) {
446
446
  let t = this.groundTruthArray;
447
447
  this.groundTruthArray = Array.isArray(e) ? e : [];
448
448
  const s = [...t, ...this.groundTruthArray];
449
- ye(this, Y.fromInstances(s, this.modelClass));
449
+ ge(this, Y.fromInstances(s, this.modelClass));
450
450
  }
451
451
  getGroundTruth() {
452
452
  return this.groundTruthArray;
@@ -491,7 +491,7 @@ class ks {
491
491
  l
492
492
  );
493
493
  }
494
- ye(
494
+ ge(
495
495
  this,
496
496
  Y.fromInstances(
497
497
  [...i, ...Array.from(s.values())],
@@ -600,7 +600,7 @@ class ks {
600
600
  // Render methods
601
601
  render(e = null, t = !0, s = !0) {
602
602
  if (s && e !== null) {
603
- const o = (Array.isArray(e) ? e : [e]).map((a) => Cs(a)), i = [];
603
+ const o = (Array.isArray(e) ? e : [e]).map((a) => vs(a)), i = [];
604
604
  for (const a of o)
605
605
  this._lastRenderedData.has(a) || i.push(a);
606
606
  if (i.length === 0)
@@ -688,7 +688,7 @@ class Ge {
688
688
  const t = async ({ pks: s, modelClass: r }) => await r.objects.filter({
689
689
  [`${r.primaryKeyField}__in`]: s
690
690
  }).fetch().serialize();
691
- this._stores.set(e, new ks(e, t, null, null)), this.syncManager.followModel(this, e);
691
+ this._stores.set(e, new Ss(e, t, null, null)), this.syncManager.followModel(this, e);
692
692
  }
693
693
  return this._stores.get(e);
694
694
  }
@@ -751,7 +751,7 @@ class q {
751
751
  throw new Error(`All operation instances must be objects with the '${o}' field`);
752
752
  this.#e = r;
753
753
  const i = r.map((a) => a[o]);
754
- Q.getStore(s).render(i, !0, !1), this.#t = r.map((a) => s.fromPk(a[o]).serialize()), this.timestamp = e.timestamp || Date.now(), !t && (Oe.register(this), ie.emit(C.CREATED, this));
754
+ Q.getStore(s).render(i, !0, !1), this.#t = r.map((a) => s.fromPk(a[o]).serialize()), this.timestamp = e.timestamp || Date.now(), !t && (Pe.register(this), ie.emit(C.CREATED, this));
755
755
  }
756
756
  /**
757
757
  * Getter for instances that replaces any temporary PKs with real PKs
@@ -818,7 +818,7 @@ class q {
818
818
  return e.instances && !Array.isArray(e.instances) && (e.instances = [e.instances]), Object.assign(this, e), this.timestamp = Date.now(), ie.emit(C.MUTATED, this), this;
819
819
  }
820
820
  }
821
- class Ss {
821
+ class Ts {
822
822
  constructor() {
823
823
  this._operations = /* @__PURE__ */ new Map(), this._querysetStates = /* @__PURE__ */ new Map();
824
824
  }
@@ -903,11 +903,11 @@ class Ss {
903
903
  return t.length > 0 ? t[t.length - 1] : void 0;
904
904
  }
905
905
  }
906
- const Oe = new Ss(), Ts = Ae();
907
- function Ms(n) {
908
- Ts.emit("error", n);
906
+ const Pe = new Ts(), Ms = Ae();
907
+ function $s(n) {
908
+ Ms.emit("error", n);
909
909
  }
910
- class ve extends Error {
910
+ class fe extends Error {
911
911
  /**
912
912
  * Creates a new StateZeroError.
913
913
  *
@@ -917,7 +917,7 @@ class ve extends Error {
917
917
  * @param {number} status - The HTTP status code.
918
918
  */
919
919
  constructor(e, t, s, r) {
920
- super(e), this.name = "StateZeroError", this.code = t, this.detail = s, this.status = r, Object.setPrototypeOf(this, new.target.prototype), Ms(this);
920
+ super(e), this.name = "StateZeroError", this.code = t, this.detail = s, this.status = r, Object.setPrototypeOf(this, new.target.prototype), $s(this);
921
921
  }
922
922
  /**
923
923
  * Returns a full error message including the detail.
@@ -939,7 +939,7 @@ class ve extends Error {
939
939
  return this.message;
940
940
  }
941
941
  }
942
- class Ve extends ve {
942
+ class Oe extends fe {
943
943
  /**
944
944
  * Creates a new ValidationError.
945
945
  *
@@ -950,7 +950,7 @@ class Ve extends ve {
950
950
  super("Validation error", "validation_error", e, t), this.name = "ValidationError";
951
951
  }
952
952
  }
953
- class Nt extends ve {
953
+ class Nt extends fe {
954
954
  /**
955
955
  * Creates a new DoesNotExist error.
956
956
  *
@@ -961,7 +961,7 @@ class Nt extends ve {
961
961
  super("DoesNotExist", "does_not_exist", e, t), this.name = "DoesNotExist";
962
962
  }
963
963
  }
964
- class lt extends ve {
964
+ class lt extends fe {
965
965
  /**
966
966
  * Creates a new PermissionDenied error.
967
967
  *
@@ -972,7 +972,7 @@ class lt extends ve {
972
972
  super("Permission denied", "permission_denied", e, t), this.name = "PermissionDenied";
973
973
  }
974
974
  }
975
- class $s extends ve {
975
+ class As extends fe {
976
976
  /**
977
977
  * Creates a new MultipleObjectsReturned error.
978
978
  *
@@ -983,7 +983,18 @@ class $s extends ve {
983
983
  super("Multiple objects returned", "multiple_objects_returned", e, t), this.name = "MultipleObjectsReturned";
984
984
  }
985
985
  }
986
- class As extends ve {
986
+ class xt extends fe {
987
+ /**
988
+ * Creates a new ConflictError.
989
+ *
990
+ * @param {IErrorDetail|Object|string} [detail="A database conflict occurred."] - The error details.
991
+ * @param {number} [status=409] - The HTTP status code.
992
+ */
993
+ constructor(e = "A database conflict occurred.", t = 409) {
994
+ super("Conflict", "conflict", e, t), this.name = "ConflictError";
995
+ }
996
+ }
997
+ class Os extends fe {
987
998
  /**
988
999
  * Creates a new ASTValidationError.
989
1000
  *
@@ -994,7 +1005,7 @@ class As extends ve {
994
1005
  super("Query syntax error", "ast_validation_error", e, t), this.name = "ASTValidationError";
995
1006
  }
996
1007
  }
997
- class x extends ve {
1008
+ class x extends fe {
998
1009
  /**
999
1010
  * Creates a new ConfigError.
1000
1011
  *
@@ -1005,34 +1016,36 @@ class x extends ve {
1005
1016
  super("Configuration error", "config_error", e, t), this.name = "ConfigError";
1006
1017
  }
1007
1018
  }
1008
- function Os(n) {
1019
+ function Ps(n) {
1009
1020
  const { status: e, type: t, detail: s } = n;
1010
1021
  if (t === void 0 && s === "Invalid token.")
1011
1022
  return new lt(s, 403);
1012
1023
  switch (t) {
1013
1024
  // Direct mappings
1014
1025
  case "ValidationError":
1015
- return new Ve(s, e);
1026
+ return new Oe(s, e);
1016
1027
  case "NotFound":
1017
1028
  return new Nt(s, e);
1018
1029
  case "MultipleObjectsReturned":
1019
- return new $s(s, e);
1030
+ return new As(s, e);
1020
1031
  case "PermissionDenied":
1021
1032
  return new lt(s, e);
1033
+ case "ConflictError":
1034
+ return new xt(s, e);
1022
1035
  case "ASTValidationError":
1023
- return new As(s, e);
1036
+ return new Os(s, e);
1024
1037
  case "ConfigError":
1025
1038
  return new x(s, e);
1026
1039
  // Django error types that map to our error classes
1027
1040
  case "FieldError":
1028
- return new Ve(s, e);
1041
+ return new Oe(s, e);
1029
1042
  case "ValueError":
1030
- return new Ve(s, e);
1043
+ return new Oe(s, e);
1031
1044
  default:
1032
- return e === 400 ? new Ve(s, e) : e === 403 ? new lt(s, e) : e === 404 ? new Nt(s, e) : new ve("Unknown error", "unknown", s, e);
1045
+ return e === 400 ? new Oe(s, e) : e === 403 ? new lt(s, e) : e === 404 ? new Nt(s, e) : e === 409 ? new xt(s, e) : new fe("Unknown error", "unknown", s, e);
1033
1046
  }
1034
1047
  }
1035
- const xt = {
1048
+ const jt = {
1036
1049
  CREATE: "create",
1037
1050
  UPDATE: "update",
1038
1051
  DELETE: "delete",
@@ -1040,7 +1053,7 @@ const xt = {
1040
1053
  BULK_UPDATE: "bulk_update",
1041
1054
  BULK_DELETE: "bulk_delete"
1042
1055
  };
1043
- class Ps {
1056
+ class Is {
1044
1057
  /**
1045
1058
  * @param {PusherReceiverOptions} options
1046
1059
  * @param {string} configKey - The backend configuration key
@@ -1050,7 +1063,7 @@ class Ps {
1050
1063
  this.configKey = t, this.connectionTimeoutId = null, s.appKey && /^\d+$/.test(s.appKey) && s.appKey.length < 15 && console.warn(
1051
1064
  `%c[Pusher Warning] The provided appKey ("${s.appKey}") looks like a numeric app_id. Pusher requires the alphanumeric key, not the ID. Please verify your configuration for backend: "${this.configKey}".`,
1052
1065
  "color: orange; font-weight: bold; font-size: 14px;"
1053
- ), this.pusherClient = new ms(s.appKey, {
1066
+ ), this.pusherClient = new ys(s.appKey, {
1054
1067
  cluster: s.cluster,
1055
1068
  forceTLS: s.forceTLS ?? !0,
1056
1069
  authEndpoint: s.authEndpoint,
@@ -1130,7 +1143,7 @@ Common causes:
1130
1143
  `%cAuthentication failed for channel ${t}. Check your authEndpoint and server-side permissions.`,
1131
1144
  "color: orange; font-weight: bold;"
1132
1145
  );
1133
- }), Object.values(xt).forEach((r) => {
1146
+ }), Object.values(jt).forEach((r) => {
1134
1147
  s.bind(r, (o) => {
1135
1148
  const i = {
1136
1149
  ...o,
@@ -1145,7 +1158,7 @@ Common causes:
1145
1158
  unsubscribe(e) {
1146
1159
  const t = this.channels.get(e);
1147
1160
  if (!t) return;
1148
- Object.values(xt).forEach((r) => {
1161
+ Object.values(jt).forEach((r) => {
1149
1162
  t.unbind(r);
1150
1163
  });
1151
1164
  const s = e.startsWith("private-") ? e : this.formatChannelName(e);
@@ -1192,16 +1205,16 @@ function Fs(n, e) {
1192
1205
  const t = Ze.get(n);
1193
1206
  t && t.disconnect(), Ze.set(n, e), e.connect();
1194
1207
  }
1195
- function jt(n = "default") {
1208
+ function Ut(n = "default") {
1196
1209
  return Ze.get(n);
1197
1210
  }
1198
1211
  function Ds() {
1199
1212
  return Ze;
1200
1213
  }
1201
- let Ut = {
1214
+ let Qt = {
1202
1215
  backendConfigs: {}
1203
1216
  };
1204
- const Is = P.object({
1217
+ const zs = P.object({
1205
1218
  clientOptions: P.object({
1206
1219
  appKey: P.string({ required_error: "Pusher appKey is required" }),
1207
1220
  cluster: P.string({ required_error: "Pusher cluster is required" }),
@@ -1215,7 +1228,7 @@ const Is = P.object({
1215
1228
  }), Ks = P.object({
1216
1229
  type: P.enum(["websocket", "pusher", "none"]),
1217
1230
  websocketUrl: P.string().url().optional(),
1218
- pusher: Is.optional(),
1231
+ pusher: zs.optional(),
1219
1232
  hotpaths: P.array(P.string()).default(["default"])
1220
1233
  }).superRefine((n, e) => {
1221
1234
  n.type === "websocket" && (n.websocketUrl || e.addIssue({
@@ -1246,7 +1259,7 @@ const Is = P.object({
1246
1259
  "eventInterceptor must be a function if provided"
1247
1260
  ),
1248
1261
  events: P.lazy(() => Ks.optional())
1249
- }), zs = P.object({
1262
+ }), Rs = P.object({
1250
1263
  backendConfigs: P.record(P.string(), Be).refine(
1251
1264
  (n) => {
1252
1265
  for (const [e, t] of Object.entries(n))
@@ -1269,9 +1282,9 @@ const Is = P.object({
1269
1282
  periodicSyncIntervalSeconds: P.number().min(5).nullable().optional().default(null)
1270
1283
  });
1271
1284
  let ht = null;
1272
- function Rs(n) {
1273
- Ut = n;
1274
- const e = zs.safeParse(Ut);
1285
+ function Ns(n) {
1286
+ Qt = n;
1287
+ const e = Rs.safeParse(Qt);
1275
1288
  if (!e.success) {
1276
1289
  const t = e.error.errors.map((s) => s.message);
1277
1290
  throw new x(`Error setting configuration: ${t.join(", ")}`);
@@ -1283,7 +1296,7 @@ function he() {
1283
1296
  throw new x("Configuration not set. Please call setConfig() with a valid configuration.");
1284
1297
  return ht;
1285
1298
  }
1286
- function Ns(n, e) {
1299
+ function xs(n, e) {
1287
1300
  try {
1288
1301
  const t = he();
1289
1302
  if (!t.backendConfigs[n])
@@ -1298,7 +1311,7 @@ function Ns(n, e) {
1298
1311
  throw t instanceof x ? t : new x(t.message || "Invalid backend configuration");
1299
1312
  }
1300
1313
  }
1301
- function Yt(n = "default") {
1314
+ function Xt(n = "default") {
1302
1315
  try {
1303
1316
  const e = he();
1304
1317
  if (!e.backendConfigs[n])
@@ -1320,7 +1333,7 @@ function Yt(n = "default") {
1320
1333
  ...t.events.pusher.clientOptions,
1321
1334
  getAuthHeaders: i
1322
1335
  };
1323
- s = new Ps({ clientOptions: l }, n);
1336
+ s = new Is({ clientOptions: l }, n);
1324
1337
  break;
1325
1338
  case "none":
1326
1339
  return null;
@@ -1332,12 +1345,12 @@ function Yt(n = "default") {
1332
1345
  throw e instanceof x ? e : new x(`Failed to initialize event receiver: ${e.message}`);
1333
1346
  }
1334
1347
  }
1335
- function xs() {
1348
+ function js() {
1336
1349
  try {
1337
1350
  const n = he(), e = {};
1338
1351
  return Object.keys(n.backendConfigs).forEach((t) => {
1339
1352
  try {
1340
- e[t] = Yt(t);
1353
+ e[t] = Xt(t);
1341
1354
  } catch (s) {
1342
1355
  console.warn(`Failed to initialize event receiver for backend "${t}": ${s.message}`);
1343
1356
  }
@@ -1347,12 +1360,12 @@ function xs() {
1347
1360
  }
1348
1361
  }
1349
1362
  let ft = null;
1350
- function js(n) {
1363
+ function Us(n) {
1351
1364
  if (typeof n != "function")
1352
1365
  throw new x("Provided model getter must be a function.");
1353
1366
  ft = n;
1354
1367
  }
1355
- function Us(n, e = "default") {
1368
+ function Qs(n, e = "default") {
1356
1369
  if (n && n.startsWith("http"))
1357
1370
  return n;
1358
1371
  const s = he().backendConfigs[e];
@@ -1360,20 +1373,20 @@ function Us(n, e = "default") {
1360
1373
  throw new x(`Backend "${e}" not found in configuration.`);
1361
1374
  return s.fileRootURL ? s.fileRootURL.replace(/\/$/, "") + n : n;
1362
1375
  }
1363
- function Xt(n, e) {
1376
+ function es(n, e) {
1364
1377
  if (!ft)
1365
1378
  throw new x("Model registry not registered. Please call registerModelGetter() with the function from model-registry.js during app initialization.");
1366
1379
  return ft(n, e);
1367
1380
  }
1368
1381
  const Fe = {
1369
- setConfig: Rs,
1382
+ setConfig: Ns,
1370
1383
  getConfig: he,
1371
- setBackendConfig: Ns,
1372
- initializeEventReceiver: Yt,
1373
- registerModelGetter: js,
1374
- getModelClass: Xt,
1375
- buildFileUrl: Us
1376
- }, es = "__STATEZERO_DEBUG__", X = globalThis[es] || {
1384
+ setBackendConfig: xs,
1385
+ initializeEventReceiver: Xt,
1386
+ registerModelGetter: Us,
1387
+ getModelClass: es,
1388
+ buildFileUrl: Qs
1389
+ }, ts = "__STATEZERO_DEBUG__", X = globalThis[ts] || {
1377
1390
  emitter: Ae(),
1378
1391
  buffer: [],
1379
1392
  enabled: !0,
@@ -1381,7 +1394,7 @@ const Fe = {
1381
1394
  maxEntries: 500,
1382
1395
  nextId: 1
1383
1396
  };
1384
- globalThis[es] = X;
1397
+ globalThis[ts] = X;
1385
1398
  const Me = X.emitter, ue = X.buffer;
1386
1399
  function Te(n) {
1387
1400
  if (!X.enabled) return;
@@ -1395,23 +1408,23 @@ function Te(n) {
1395
1408
  function B(n) {
1396
1409
  Te(n);
1397
1410
  }
1398
- function Qs(n) {
1411
+ function Vs(n) {
1399
1412
  return Me.on("record", n), () => Me.off("record", n);
1400
1413
  }
1401
- function Vs(n) {
1414
+ function Ls(n) {
1402
1415
  return Me.on("clear", n), () => Me.off("clear", n);
1403
1416
  }
1404
- function Qt() {
1417
+ function Vt() {
1405
1418
  return ue.slice();
1406
1419
  }
1407
- function Ls() {
1420
+ function Gs() {
1408
1421
  ue.length = 0, Me.emit("clear");
1409
1422
  }
1410
- function Vt(n) {
1423
+ function Lt(n) {
1411
1424
  const e = Number(n);
1412
1425
  !Number.isFinite(e) || e <= 0 || (X.maxEntries = Math.floor(e), ue.length > X.maxEntries && ue.splice(0, ue.length - X.maxEntries));
1413
1426
  }
1414
- function Gs() {
1427
+ function Bs() {
1415
1428
  X.started || (X.started = !0, ie.on(C.CREATED, (n) => {
1416
1429
  Te({
1417
1430
  type: "operation",
@@ -1465,10 +1478,10 @@ function Gs() {
1465
1478
  }));
1466
1479
  }
1467
1480
  const ct = /* @__PURE__ */ new Map();
1468
- function Bs(n = "default") {
1469
- return ct.has(n) || ct.set(n, new fs({ concurrency: 1 })), ct.get(n);
1481
+ function Hs(n = "default") {
1482
+ return ct.has(n) || ct.set(n, new ps({ concurrency: 1 })), ct.get(n);
1470
1483
  }
1471
- function Hs(n, e = 3e4) {
1484
+ function qs(n, e = 3e4) {
1472
1485
  return Promise.race([
1473
1486
  n,
1474
1487
  new Promise(
@@ -1476,7 +1489,7 @@ function Hs(n, e = 3e4) {
1476
1489
  )
1477
1490
  ]);
1478
1491
  }
1479
- function _e(n, e, t, s = null) {
1492
+ function we(n, e, t, s = null) {
1480
1493
  if (!e) return;
1481
1494
  const r = t.configKey;
1482
1495
  let o = null;
@@ -1535,7 +1548,7 @@ async function L(n, e, t = {}, s, r = null, o = null, i = {}) {
1535
1548
  "delete_instance",
1536
1549
  "get_or_create",
1537
1550
  "update_or_create"
1538
- ].includes(e), U = `${p.API_URL.replace(/\/+$/, "")}/${c.modelName}/`, N = p.getAuthHeaders ? p.getAuthHeaders() : {}, F = n.semanticKey;
1551
+ ].includes(e), U = `${p.API_URL.replace(/\/+$/, "")}/${c.modelName}/`, N = p.getAuthHeaders ? p.getAuthHeaders() : {}, I = n.semanticKey;
1539
1552
  s && (N["X-Operation-ID"] = s), o && (N["X-Canonical-ID"] = o);
1540
1553
  const re = async () => {
1541
1554
  try {
@@ -1543,7 +1556,7 @@ async function L(n, e, t = {}, s, r = null, o = null, i = {}) {
1543
1556
  type: "request",
1544
1557
  modelName: c.modelName,
1545
1558
  configKey: c.configKey,
1546
- semanticKey: F,
1559
+ semanticKey: I,
1547
1560
  operationType: e,
1548
1561
  operationId: s,
1549
1562
  canonicalId: o,
@@ -1551,63 +1564,63 @@ async function L(n, e, t = {}, s, r = null, o = null, i = {}) {
1551
1564
  payload: w,
1552
1565
  namespace: l
1553
1566
  });
1554
- let I = await ps.post(U, We(w), { headers: N });
1555
- typeof r == "function" && I?.data && await r(I.data);
1556
- const D = I?.data?.data, z = I?.data?.included, pe = Array.isArray(D) ? D.length : D != null ? 1 : 0, Ye = z ? Object.keys(z).length : 0, me = 100, Ke = Array.isArray(D) && D.length > me ? D.slice(0, me) : D, Xe = Array.isArray(D) && D.length > me;
1557
- let ze = z, Ee = !1;
1558
- if (z && typeof z == "object") {
1559
- const Re = {};
1567
+ let D = await ms.post(U, We(w), { headers: N });
1568
+ typeof r == "function" && D?.data && await r(D.data);
1569
+ const F = D?.data?.data, K = D?.data?.included, me = Array.isArray(F) ? F.length : F != null ? 1 : 0, Ye = K ? Object.keys(K).length : 0, ye = 100, Ke = Array.isArray(F) && F.length > ye ? F.slice(0, ye) : F, Xe = Array.isArray(F) && F.length > ye;
1570
+ let Re = K, Ee = !1;
1571
+ if (K && typeof K == "object") {
1572
+ const Ne = {};
1560
1573
  let ne = 0;
1561
- for (const [Ne, xe] of Object.entries(z))
1562
- if (Re[Ne] = xe, ne += 1, ne >= me) {
1574
+ for (const [xe, je] of Object.entries(K))
1575
+ if (Ne[xe] = je, ne += 1, ne >= ye) {
1563
1576
  Ee = !0;
1564
1577
  break;
1565
1578
  }
1566
- ze = Ee ? Re : z;
1579
+ Re = Ee ? Ne : K;
1567
1580
  }
1568
1581
  return B({
1569
1582
  type: "response",
1570
1583
  modelName: c.modelName,
1571
1584
  configKey: c.configKey,
1572
- semanticKey: F,
1585
+ semanticKey: I,
1573
1586
  operationType: e,
1574
1587
  operationId: s,
1575
1588
  canonicalId: o,
1576
1589
  url: U,
1577
- status: I.status,
1578
- dataCount: pe,
1590
+ status: D.status,
1591
+ dataCount: me,
1579
1592
  includedCount: Ye,
1580
1593
  data: Ke,
1581
- included: ze,
1594
+ included: Re,
1582
1595
  dataTruncated: Xe,
1583
1596
  includedTruncated: Ee
1584
- }), I.data;
1585
- } catch (I) {
1597
+ }), D.data;
1598
+ } catch (D) {
1586
1599
  if (B({
1587
1600
  type: "error",
1588
1601
  modelName: c.modelName,
1589
1602
  configKey: c.configKey,
1590
- semanticKey: F,
1603
+ semanticKey: I,
1591
1604
  operationType: e,
1592
1605
  operationId: s,
1593
1606
  canonicalId: o,
1594
1607
  url: U,
1595
- status: I?.response?.status,
1596
- message: I?.message
1597
- }), I?.code === "ECONNREFUSED") {
1598
- const D = "Connection refused. If you're running tests, start the test server with `python manage.py statezero_testserver`.";
1599
- throw new Error(`${D} (${U})`);
1608
+ status: D?.response?.status,
1609
+ message: D?.message
1610
+ }), D?.code === "ECONNREFUSED") {
1611
+ const F = "Connection refused. If you're running tests, start the test server with `python manage.py statezero_testserver`.";
1612
+ throw new Error(`${F} (${U})`);
1600
1613
  }
1601
- if (I.response && I.response.data) {
1602
- const D = Os(I.response.data);
1603
- throw Error.captureStackTrace && Error.captureStackTrace(D, L), D;
1614
+ if (D.response && D.response.data) {
1615
+ const F = Ps(D.response.data);
1616
+ throw Error.captureStackTrace && Error.captureStackTrace(F, L), F;
1604
1617
  }
1605
- throw new Error(`API call failed: ${I.message}`);
1618
+ throw new Error(`API call failed: ${D.message}`);
1606
1619
  }
1607
- }, fe = Bs(l), ae = b ? fe.add(re) : re();
1608
- return a ? Hs(ae, a) : ae;
1620
+ }, pe = Hs(l), ae = b ? pe.add(re) : re();
1621
+ return a ? qs(ae, a) : ae;
1609
1622
  }
1610
- class Lt {
1623
+ class Gt {
1611
1624
  // Supported Django strftime formats and their date-fns equivalents
1612
1625
  static SUPPORTED_FORMATS = {
1613
1626
  "iso-8601": null,
@@ -1657,11 +1670,11 @@ class Lt {
1657
1670
  );
1658
1671
  try {
1659
1672
  if (!l || l === "iso-8601") {
1660
- const c = ge.fromISO(e, { zone: r });
1673
+ const c = _e.fromISO(e, { zone: r });
1661
1674
  return c.isValid ? c.toJSDate() : (console.error(`Failed to parse ISO date "${e}":`, c.invalidReason), null);
1662
1675
  }
1663
1676
  const a = this.SUPPORTED_FORMATS[l];
1664
- return ys(e, a, /* @__PURE__ */ new Date());
1677
+ return gs(e, a, /* @__PURE__ */ new Date());
1665
1678
  } catch (a) {
1666
1679
  return console.error(`Failed to parse date "${e}" with format "${l}"`, a), null;
1667
1680
  }
@@ -1693,19 +1706,19 @@ class Lt {
1693
1706
  if (!i || i === "iso-8601")
1694
1707
  return r === "date" ? e.toISOString().slice(0, 10) : e.toISOString();
1695
1708
  const l = this.SUPPORTED_FORMATS[i];
1696
- return gs(e, l);
1709
+ return _s(e, l);
1697
1710
  } catch (l) {
1698
1711
  return console.error(`Failed to format date with format "${i}"`, l), e.toISOString();
1699
1712
  }
1700
1713
  }
1701
1714
  }
1702
- function qs(n) {
1715
+ function Js(n) {
1703
1716
  if (!n || !n.configKey)
1704
1717
  return "UTC";
1705
1718
  const e = Fe.getConfig();
1706
1719
  return (e.backendConfigs[n.configKey] || e.backendConfigs.default).BACKEND_TZ || "UTC";
1707
1720
  }
1708
- const Gt = {
1721
+ const Bt = {
1709
1722
  // Store backend snake_case format internally for consistency with API
1710
1723
  toInternal: (n, e = {}) => {
1711
1724
  if (typeof n == "string")
@@ -1742,14 +1755,14 @@ const Gt = {
1742
1755
  mimeType: n.mime_type
1743
1756
  };
1744
1757
  }
1745
- }, Bt = {
1758
+ }, Ht = {
1746
1759
  toInternal: (n, e = {}) => {
1747
1760
  if (E(n) || typeof n == "string") return n;
1748
1761
  if (n instanceof Date) {
1749
1762
  const { model: t, field: s, fieldSchema: r } = e, o = t?.schema || r?.format && {
1750
1763
  properties: { [s]: { format: r.format } }
1751
1764
  };
1752
- return o ? Lt.serializeDate(n, s, o) : n.toISOString();
1765
+ return o ? Gt.serializeDate(n, s, o) : n.toISOString();
1753
1766
  }
1754
1767
  throw new Error(`expected string or Date, got ${typeof n}`);
1755
1768
  },
@@ -1757,8 +1770,8 @@ const Gt = {
1757
1770
  if (E(n) || typeof n != "string") return n;
1758
1771
  const { model: t, field: s } = e;
1759
1772
  if (t?.schema) {
1760
- const r = qs(t);
1761
- return Lt.parseDate(n, s, t.schema, r);
1773
+ const r = Js(t);
1774
+ return Gt.parseDate(n, s, t.schema, r);
1762
1775
  }
1763
1776
  try {
1764
1777
  return new Date(n);
@@ -1781,7 +1794,7 @@ const Gt = {
1781
1794
  const { model: t, field: s } = e;
1782
1795
  return t.relationshipFields.has(s) && n ? t.relationshipFields.get(s).ModelClass().fromPk(n) : n;
1783
1796
  }
1784
- }, Js = {
1797
+ }, Ws = {
1785
1798
  toInternal: (n, e = {}) => {
1786
1799
  if (E(n)) return n;
1787
1800
  if (!Array.isArray(n)) throw new Error(`expected array, got ${typeof n}`);
@@ -1809,10 +1822,10 @@ const Gt = {
1809
1822
  }
1810
1823
  }, Se = {
1811
1824
  string: {
1812
- "file-path": Gt,
1813
- "image-path": Gt,
1814
- date: Bt,
1815
- "date-time": Bt,
1825
+ "file-path": Bt,
1826
+ "image-path": Bt,
1827
+ date: Ht,
1828
+ "date-time": Ht,
1816
1829
  "foreign-key": ke,
1817
1830
  "one-to-one": ke
1818
1831
  },
@@ -1826,10 +1839,10 @@ const Gt = {
1826
1839
  "one-to-one": ke
1827
1840
  },
1828
1841
  array: {
1829
- "many-to-many": Js
1842
+ "many-to-many": Ws
1830
1843
  }
1831
1844
  };
1832
- class ts {
1845
+ class ss {
1833
1846
  constructor(e) {
1834
1847
  this.modelClass = e;
1835
1848
  }
@@ -1884,15 +1897,15 @@ class ts {
1884
1897
  return t;
1885
1898
  }
1886
1899
  }
1887
- function Ws(n) {
1900
+ function Zs(n) {
1888
1901
  if (!n || !n.configKey)
1889
1902
  return "UTC";
1890
1903
  const e = Fe.getConfig();
1891
1904
  return (e.backendConfigs[n.configKey] || e.backendConfigs.default).BACKEND_TZ || "UTC";
1892
1905
  }
1893
- function Zs(n, e, t) {
1906
+ function Ys(n, e, t) {
1894
1907
  if (!t?.schema || !n) return e;
1895
- const s = new ts(t);
1908
+ const s = new ss(t);
1896
1909
  return Array.isArray(e) ? e.map((r) => s.toLiveField(n, r)) : s.toLiveField(n, e);
1897
1910
  }
1898
1911
  function De(n, e, t, s = {}) {
@@ -1911,8 +1924,6 @@ function De(n, e, t, s = {}) {
1911
1924
  "lt",
1912
1925
  "lte",
1913
1926
  "isnull",
1914
- "regex",
1915
- "iregex",
1916
1927
  "year",
1917
1928
  "month",
1918
1929
  "day",
@@ -1936,63 +1947,63 @@ function De(n, e, t, s = {}) {
1936
1947
  k === "pk" && p && (k = p.primaryKeyField);
1937
1948
  const U = b === c.length - 1;
1938
1949
  if (p && p.relationshipFields && p.relationshipFields instanceof Map && p.relationshipFields.has(k)) {
1939
- const N = p.relationshipFields.get(k), F = N.ModelClass(), re = N.relationshipType;
1950
+ const N = p.relationshipFields.get(k), I = N.ModelClass(), re = N.relationshipType;
1940
1951
  if (!U && re === "many-to-many") {
1941
1952
  let ae = c.slice(b + 1).join("__");
1942
1953
  a.length > 0 ? ae += "__" + a.join("__") : f && (ae += "__" + f);
1943
- const I = De(ae, e, F, s), D = m.length > 0 ? m.join(".") + "." + k : k, z = I.requiredPath || I.field, pe = `${D}.${z}`;
1954
+ const D = De(ae, e, I, s), F = m.length > 0 ? m.join(".") + "." + k : k, K = D.requiredPath || D.field, me = `${F}.${K}`;
1944
1955
  return {
1945
- field: D,
1946
- operator: { $elemMatch: { [I.field]: I.operator } },
1956
+ field: F,
1957
+ operator: { $elemMatch: { [D.field]: D.operator } },
1947
1958
  isM2M: !0,
1948
- requiredPath: pe
1959
+ requiredPath: me
1949
1960
  // Full path for data picking
1950
1961
  };
1951
1962
  }
1952
1963
  if (m.push(k), !U)
1953
- p = F;
1964
+ p = I;
1954
1965
  else {
1955
1966
  if (y = !0, re === "many-to-many")
1956
1967
  _ = !0, w = k;
1957
1968
  else {
1958
- const fe = F.primaryKeyField || "id";
1959
- m.push(fe), w = fe;
1969
+ const pe = I.primaryKeyField || "id";
1970
+ m.push(pe), w = pe;
1960
1971
  }
1961
- p = F;
1972
+ p = I;
1962
1973
  }
1963
1974
  } else if (p && p.fields && p.fields.includes(k)) {
1964
1975
  if (m.push(k), w = k, U)
1965
1976
  break;
1966
1977
  const N = p.schema?.properties?.[k];
1967
1978
  if (N && N.format === "json") {
1968
- const F = c.slice(b + 1);
1969
- m.push(...F);
1979
+ const I = c.slice(b + 1);
1980
+ m.push(...I);
1970
1981
  break;
1971
1982
  }
1972
1983
  throw new Error(`Field '${k}' in '${n}' is not a relationship field and cannot be traversed.`);
1973
1984
  } else
1974
1985
  throw new Error(`Field '${k}' in '${n}' not found in model ${p.modelName}.`);
1975
1986
  }
1976
- const v = m.join("."), T = i.includes(f) || a.length === 2 && i.includes(a[0]) ? e : Zs(w, e, p);
1987
+ const v = m.join("."), T = i.includes(f) || a.length === 2 && i.includes(a[0]) ? e : Ys(w, e, p);
1977
1988
  if (a.length === 2) {
1978
1989
  const [b, k] = a;
1979
- return Ys(v, b, k, T, y);
1990
+ return Xs(v, b, k, T, y);
1980
1991
  }
1981
1992
  if (f)
1982
- return Xs(v, f, T, y, p, w, _);
1993
+ return er(v, f, T, y, p, w, _);
1983
1994
  if (y) {
1984
1995
  let b = T;
1985
1996
  return T && typeof T == "object" && "pk" in T && (b = T.pk), _ ? { field: v, operator: { $elemMatch: { pk: { $eq: b } } }, isM2M: !0 } : { field: v, operator: { $eq: b } };
1986
1997
  }
1987
1998
  return { field: v, operator: { $eq: T } };
1988
1999
  }
1989
- function Ys(n, e, t, s, r) {
2000
+ function Xs(n, e, t, s, r) {
1990
2001
  return r ? (console.warn(`Date part comparison on relationship fields may not work as expected: ${n}`), { field: n, operator: { $eq: s } }) : {
1991
2002
  field: n,
1992
2003
  operator: { [`$${e}_${t}`]: s }
1993
2004
  };
1994
2005
  }
1995
- function Xs(n, e, t, s, r, o, i = !1) {
2006
+ function er(n, e, t, s, r, o, i = !1) {
1996
2007
  function l(a) {
1997
2008
  return a.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1998
2009
  }
@@ -2047,12 +2058,12 @@ function Xs(n, e, t, s, r, o, i = !1) {
2047
2058
  operator: { $regex: new RegExp(`${l(t)}$`, "i") }
2048
2059
  } : e === "in" ? { field: n, operator: { $in: t } } : e === "gt" ? { field: n, operator: { $nin: [null, void 0], $gt: t } } : e === "gte" ? { field: n, operator: { $nin: [null, void 0], $gte: t } } : e === "lt" ? { field: n, operator: { $nin: [null, void 0], $lt: t } } : e === "lte" ? { field: n, operator: { $nin: [null, void 0], $lte: t } } : { field: n, operator: { $eq: t } };
2049
2060
  }
2050
- function er(n = "UTC", e = null) {
2051
- const t = e ? new ts(e) : null, s = (a, c = null) => a ? a instanceof Date ? a : t && c && typeof a == "string" ? t.toLiveField(c, a) : (console.warn("Date conversion without serializer context:", a), null) : null, r = (a, c, f = null) => {
2061
+ function tr(n = "UTC", e = null) {
2062
+ const t = e ? new ss(e) : null, s = (a, c = null) => a ? a instanceof Date ? a : t && c && typeof a == "string" ? t.toLiveField(c, a) : (console.warn("Date conversion without serializer context:", a), null) : null, r = (a, c, f = null) => {
2052
2063
  const p = s(a, f);
2053
2064
  if (!p || !(p instanceof Date) || isNaN(p.getTime()))
2054
2065
  return null;
2055
- const m = ge.fromJSDate(p).setZone(n);
2066
+ const m = _e.fromJSDate(p).setZone(n);
2056
2067
  return c(m);
2057
2068
  }, o = {
2058
2069
  // Year - same in both
@@ -2148,7 +2159,7 @@ function er(n = "UTC", e = null) {
2148
2159
  return !1;
2149
2160
  const _ = s(a, m);
2150
2161
  if (!_ || isNaN(_.getTime())) return !1;
2151
- const w = ge.fromJSDate(y).setZone(n), v = ge.fromJSDate(_).setZone(n);
2162
+ const w = _e.fromJSDate(y).setZone(n), v = _e.fromJSDate(_).setZone(n);
2152
2163
  return w.year === v.year && w.month === v.month && w.day === v.day;
2153
2164
  },
2154
2165
  c,
@@ -2162,7 +2173,7 @@ function er(n = "UTC", e = null) {
2162
2173
  const y = s(p, m);
2163
2174
  if (!y || !(y instanceof Date) || isNaN(y.getTime()))
2164
2175
  return !1;
2165
- const _ = ge.fromJSDate(y).setZone(n);
2176
+ const _ = _e.fromJSDate(y).setZone(n);
2166
2177
  let w, v, O;
2167
2178
  if (typeof a == "string") {
2168
2179
  const T = a.split(":");
@@ -2170,7 +2181,7 @@ function er(n = "UTC", e = null) {
2170
2181
  } else {
2171
2182
  const T = s(a, m);
2172
2183
  if (!T) return !1;
2173
- const b = ge.fromJSDate(T).setZone(n);
2184
+ const b = _e.fromJSDate(T).setZone(n);
2174
2185
  w = b.hour, v = b.minute, O = b.second;
2175
2186
  }
2176
2187
  return _.hour === w && _.minute === v && _.second === O;
@@ -2200,7 +2211,7 @@ function er(n = "UTC", e = null) {
2200
2211
  const v = s(_, w);
2201
2212
  if (!v || !(v instanceof Date) || isNaN(v.getTime()))
2202
2213
  return !1;
2203
- const O = ge.fromJSDate(v).setZone(n), T = c(O), b = a === "date" ? p : typeof p == "string" ? Number(p) : p;
2214
+ const O = _e.fromJSDate(v).setZone(n), T = c(O), b = a === "date" ? p : typeof p == "string" ? Number(p) : p;
2204
2215
  switch (f) {
2205
2216
  case "gt":
2206
2217
  return T > b;
@@ -2222,10 +2233,10 @@ function er(n = "UTC", e = null) {
2222
2233
  });
2223
2234
  }), o;
2224
2235
  }
2225
- function tr(n, e) {
2226
- const t = Ws(e);
2227
- return Wt(n, {
2228
- operations: er(t, e)
2236
+ function sr(n, e) {
2237
+ const t = Zs(e);
2238
+ return Zt(n, {
2239
+ operations: tr(t, e)
2229
2240
  });
2230
2241
  }
2231
2242
  function pt(n, e) {
@@ -2235,7 +2246,7 @@ function pt(n, e) {
2235
2246
  const l = De(o, i, e), { field: a, operator: c, isDatePart: f, isM2M: p } = l;
2236
2247
  f ? (s.has(a) || s.set(a, []), s.get(a).push({ [a]: c })) : p && c.$elemMatch ? (r.has(a) || r.set(a, []), r.get(a).push(c.$elemMatch)) : t[a] ? t[a] = { ...t[a], ...c } : t[a] = c;
2237
2248
  } catch (l) {
2238
- throw new Error(`Failed to process field '${o}': ${l.message}`);
2249
+ throw new Oe(`Failed to process field '${o}': ${l.message}`);
2239
2250
  }
2240
2251
  for (const [o, i] of r.entries())
2241
2252
  i.length === 1 ? t[o] = { $elemMatch: i[0] } : t[o] = { $elemMatch: { $and: i } };
@@ -2256,7 +2267,7 @@ function pt(n, e) {
2256
2267
  }
2257
2268
  return t;
2258
2269
  }
2259
- function sr(n, e) {
2270
+ function rr(n, e) {
2260
2271
  return !n || !n.length ? null : {
2261
2272
  $or: n.map((t) => "operator" in t && "conditions" in t ? { [t.operator === "AND" ? "$and" : "$or"]: t.conditions.map((r) => pt(r, e)) } : pt(t, e))
2262
2273
  };
@@ -2267,7 +2278,7 @@ function He(n, e) {
2267
2278
  const { conditions: t, Q: s } = n;
2268
2279
  let r = {};
2269
2280
  if (t && Object.keys(t).length > 0 && (r = pt(t, e)), s && s.length > 0) {
2270
- const o = sr(s, e);
2281
+ const o = rr(s, e);
2271
2282
  if (o)
2272
2283
  return Object.keys(r).length > 0 ? { $and: [r, o] } : o;
2273
2284
  }
@@ -2287,7 +2298,7 @@ function He(n, e) {
2287
2298
  }
2288
2299
  return null;
2289
2300
  }
2290
- function rr(n, e, t) {
2301
+ function nr(n, e, t) {
2291
2302
  if (!e || !e.searchQuery) return n;
2292
2303
  const s = e.searchFields || (n[0] ? Object.keys(n[0]).filter((i) => typeof n[0][i] == "string") : []);
2293
2304
  if (!s.length) return n;
@@ -2310,9 +2321,9 @@ function rr(n, e, t) {
2310
2321
  };
2311
2322
  }
2312
2323
  });
2313
- return n.filter(Wt({ $or: o }));
2324
+ return n.filter(Zt({ $or: o }));
2314
2325
  }
2315
- function Ht(n, e) {
2326
+ function qt(n, e) {
2316
2327
  const t = e.split(".");
2317
2328
  let s = n;
2318
2329
  for (const r of t) {
@@ -2322,7 +2333,7 @@ function Ht(n, e) {
2322
2333
  }
2323
2334
  return s;
2324
2335
  }
2325
- function nr(n, e) {
2336
+ function or(n, e) {
2326
2337
  return n.map((t) => {
2327
2338
  const s = t.startsWith("-"), r = s ? t.substring(1) : t;
2328
2339
  try {
@@ -2339,12 +2350,12 @@ function nr(n, e) {
2339
2350
  }
2340
2351
  });
2341
2352
  }
2342
- function or(n, e, t) {
2353
+ function ir(n, e, t) {
2343
2354
  if (!e || !e.length) return [...n];
2344
- const s = nr(e, t);
2355
+ const s = or(e, t);
2345
2356
  return [...n].sort((r, o) => {
2346
2357
  for (const { field: i, desc: l } of s) {
2347
- const a = Ht(r, i), c = Ht(o, i);
2358
+ const a = qt(r, i), c = qt(o, i);
2348
2359
  if (a !== c) {
2349
2360
  if (a === null && c !== null) return l ? -1 : 1;
2350
2361
  if (a !== null && c === null) return l ? 1 : -1;
@@ -2366,9 +2377,9 @@ function mt(n, e, t) {
2366
2377
  let r = [...n];
2367
2378
  if (e.filter) {
2368
2379
  const o = He(e.filter, t);
2369
- o && Object.keys(o).length && (r = r.filter(tr(o, t)));
2380
+ o && Object.keys(o).length && (r = r.filter(sr(o, t)));
2370
2381
  }
2371
- return e.search && e.search.searchQuery && (r = rr(r, e.search, t)), Array.isArray(e.orderBy) && e.orderBy.length && (r = or(r, e.orderBy, t)), r.map((o) => o[s]);
2382
+ return e.search && e.search.searchQuery && (r = nr(r, e.search, t)), Array.isArray(e.orderBy) && e.orderBy.length && (r = ir(r, e.orderBy, t)), r.map((o) => o[s]);
2372
2383
  }
2373
2384
  function yt(n, e) {
2374
2385
  const t = /* @__PURE__ */ new Set(), s = e.primaryKeyField;
@@ -2432,7 +2443,7 @@ function wt(n, e, t, s = !1) {
2432
2443
  }
2433
2444
  return l;
2434
2445
  }
2435
- class ir {
2446
+ class ar {
2436
2447
  modelClass;
2437
2448
  fetchFn;
2438
2449
  queryset;
@@ -2443,7 +2454,7 @@ class ir {
2443
2454
  constructor(e, t, s, r = null, o = null, i = {}) {
2444
2455
  if (this.modelClass = e, this.fetchFn = t, this.queryset = s, this.isSyncing = !1, this.lastSync = null, this.isTemp = i.isTemp || !1, this.pruneThreshold = i.pruneThreshold || 10, this.groundTruthPks = r || [], this.operationsMap = /* @__PURE__ */ new Map(), this.includedPks = /* @__PURE__ */ new Map(), Array.isArray(o))
2445
2456
  for (const l of o) {
2446
- const c = Oe.get(l.operationId) || new q(l, !0);
2457
+ const c = Pe.get(l.operationId) || new q(l, !0);
2447
2458
  this.operationsMap.set(c.operationId, c);
2448
2459
  }
2449
2460
  if (this.qsCache = new vt("queryset-cache", {}, this.onHydrated.bind(this)), this._lastRenderedPks = null, this.renderCallbacks = /* @__PURE__ */ new Set(), !this.isTemp) {
@@ -2460,13 +2471,13 @@ class ir {
2460
2471
  onHydrated(e) {
2461
2472
  if (this.groundTruthPks.length === 0 && this.operationsMap.size === 0) {
2462
2473
  const t = this.qsCache.get(this.cacheKey);
2463
- !E(t) && !Ce(t) && this.setGroundTruth(t);
2474
+ !E(t) && !ve(t) && this.setGroundTruth(t);
2464
2475
  }
2465
2476
  }
2466
2477
  setCache(e) {
2467
2478
  let t = [];
2468
2479
  e.forEach((s) => {
2469
- typeof s == "string" && Je(s) && (s = We(s), E(s) || Ce(dt(s))) || t.push(s);
2480
+ typeof s == "string" && Je(s) && (s = We(s), E(s) || ve(dt(s))) || t.push(s);
2470
2481
  }), this.qsCache.set(this.cacheKey, t);
2471
2482
  }
2472
2483
  clearCache() {
@@ -2490,7 +2501,7 @@ class ir {
2490
2501
  } catch (s) {
2491
2502
  console.warn("Error in render callback:", s);
2492
2503
  }
2493
- }), qe(e, this._lastRenderedPks) || (this._lastRenderedPks = e, Es.emit(
2504
+ }), qe(e, this._lastRenderedPks) || (this._lastRenderedPks = e, bs.emit(
2494
2505
  `${this.modelClass.configKey}::${this.modelClass.modelName}::queryset::render`,
2495
2506
  { ast: this.queryset.build(), ModelClass: this.modelClass }
2496
2507
  ));
@@ -2509,7 +2520,13 @@ class ir {
2509
2520
  this.operationsMap.has(e.operationId) && (this.operationsMap.set(e.operationId, e), this._emitRenderEvent());
2510
2521
  }
2511
2522
  async setGroundTruth(e) {
2512
- this.groundTruthPks = Array.isArray(e) ? e : [], this.lastSync = Date.now(), this._emitRenderEvent();
2523
+ if (this.groundTruthPks = Array.isArray(e) ? e : [], this.groundTruthPks.length > 500) {
2524
+ const t = this.queryset?._serializerOptions?.limit;
2525
+ console.warn(
2526
+ `[statezero] ⚠️ ${this.modelClass.modelName} (${this.queryset.semanticKey}) received ${this.groundTruthPks.length} items${t ? ` (limit: ${t})` : " with NO limit"}. Live querysets re-render on every change — at this size, this WILL cause UI freezes on mobile. Add .fetch({ limit }) or use narrower filters.`
2527
+ );
2528
+ }
2529
+ this.lastSync = Date.now(), this._emitRenderEvent();
2513
2530
  }
2514
2531
  async setOperations(e) {
2515
2532
  if (this.operationsMap.clear(), Array.isArray(e))
@@ -2619,8 +2636,10 @@ class ir {
2619
2636
  t.add(o);
2620
2637
  break;
2621
2638
  case M.CHECKPOINT:
2639
+ break;
2622
2640
  case M.UPDATE:
2623
2641
  case M.UPDATE_INSTANCE:
2642
+ t.add(o);
2624
2643
  break;
2625
2644
  case M.DELETE:
2626
2645
  case M.DELETE_INSTANCE:
@@ -2658,7 +2677,7 @@ class ir {
2658
2677
  modelClass: this.modelClass,
2659
2678
  canonical_id: e
2660
2679
  }), { data: r, included: o } = s;
2661
- E(r) || (this.includedPks.clear(), _e(Q, o, this.modelClass, this.queryset), this.setGroundTruth(r)), this.setOperations(this.getInflightOperations()), this.lastSync = Date.now(), B({
2680
+ E(r) || (this.includedPks.clear(), we(Q, o, this.modelClass, this.queryset), this.setGroundTruth(r)), this.setOperations(this.getInflightOperations()), this.lastSync = Date.now(), B({
2662
2681
  type: "sync",
2663
2682
  phase: "success",
2664
2683
  semanticKey: this.queryset.semanticKey,
@@ -2683,9 +2702,9 @@ class ir {
2683
2702
  }
2684
2703
  }
2685
2704
  }
2686
- class ar {
2705
+ class lr {
2687
2706
  constructor() {
2688
- this.graph = new It({ directed: !0 }), this.processedQuerysets = /* @__PURE__ */ new Set();
2707
+ this.graph = new Dt({ directed: !0 }), this.processedQuerysets = /* @__PURE__ */ new Set();
2689
2708
  }
2690
2709
  /**
2691
2710
  * Add a queryset and its parent relationship to the graph
@@ -2771,10 +2790,10 @@ class ar {
2771
2790
  return !e && !t ? !0 : !e || !t || e.length !== t.length ? !1 : e.every((s, r) => s === t[r]);
2772
2791
  }
2773
2792
  clear() {
2774
- this.graph = new It({ directed: !0 }), this.processedQuerysets = /* @__PURE__ */ new Set();
2793
+ this.graph = new Dt({ directed: !0 }), this.processedQuerysets = /* @__PURE__ */ new Set();
2775
2794
  }
2776
2795
  }
2777
- class lr {
2796
+ class cr {
2778
2797
  #e;
2779
2798
  #t;
2780
2799
  #s;
@@ -2814,11 +2833,11 @@ class lr {
2814
2833
  return j.getStore(this.#e).render().map((r) => (this.#t.primaryKeyField, this.#t.fromPk(r, this.#e)));
2815
2834
  }
2816
2835
  }
2817
- class we {
2836
+ class Ce {
2818
2837
  constructor() {
2819
2838
  this._stores = /* @__PURE__ */ new Map(), this._tempStores = /* @__PURE__ */ new WeakMap(), this.followingQuerysets = /* @__PURE__ */ new Map(), this.syncManager = () => {
2820
2839
  console.warn("SyncManager not set for QuerysetStoreRegistry");
2821
- }, this.querysetStoreGraph = new ar(), this._groupSyncCache = /* @__PURE__ */ new Map();
2840
+ }, this.querysetStoreGraph = new lr(), this._groupSyncCache = /* @__PURE__ */ new Map();
2822
2841
  }
2823
2842
  clear() {
2824
2843
  this._stores.forEach((e) => {
@@ -2866,7 +2885,7 @@ class we {
2866
2885
  { namespace: "sync", timeout: 3e4 }
2867
2886
  // Sync ops on separate queue
2868
2887
  )).data;
2869
- }, o = new ir(
2888
+ }, o = new ar(
2870
2889
  e.ModelClass,
2871
2890
  r,
2872
2891
  e,
@@ -2890,7 +2909,7 @@ class we {
2890
2909
  this.addFollowingQueryset(s, e);
2891
2910
  let r;
2892
2911
  this._tempStores.has(e) ? (r = this._tempStores.get(e), r.isTemp = !1, r.registerWithModelStore(), this._stores.set(s, r), this.syncManager.followModel(this, e.ModelClass)) : this._stores.has(s) ? r = this._stores.get(s) : (r = this.getStore(e), r.isTemp = !1, r.registerWithModelStore(), this._stores.set(s, r), this.syncManager.followModel(this, e.ModelClass));
2893
- const o = new lr(e);
2912
+ const o = new cr(e);
2894
2913
  return t && r.sync(), o;
2895
2914
  }
2896
2915
  /**
@@ -3008,8 +3027,8 @@ class we {
3008
3027
  }
3009
3028
  }
3010
3029
  }
3011
- const j = new we();
3012
- class Ie {
3030
+ const j = new Ce();
3031
+ class ze {
3013
3032
  /**
3014
3033
  * Calculate metric based on ground truth and operations
3015
3034
  */
@@ -3054,7 +3073,7 @@ class Ie {
3054
3073
  return isNaN(r) ? 0 : r;
3055
3074
  }
3056
3075
  }
3057
- class cr extends Ie {
3076
+ class dr extends ze {
3058
3077
  reduceOperation(e, t, s) {
3059
3078
  if (t.status === C.REJECTED)
3060
3079
  return e;
@@ -3062,7 +3081,7 @@ class cr extends Ie {
3062
3081
  return r === M.CREATE ? e + 1 : [M.DELETE, M.DELETE_INSTANCE].includes(r) ? Math.max(0, e - 1) : e;
3063
3082
  }
3064
3083
  }
3065
- class dr extends Ie {
3084
+ class ur extends ze {
3066
3085
  reduceOperation(e, t, s) {
3067
3086
  if (t.status === C.REJECTED)
3068
3087
  return e;
@@ -3087,7 +3106,7 @@ class dr extends Ie {
3087
3106
  }
3088
3107
  }
3089
3108
  }
3090
- class ur extends Ie {
3109
+ class hr extends ze {
3091
3110
  getInitialValue() {
3092
3111
  return 1 / 0;
3093
3112
  }
@@ -3110,7 +3129,7 @@ class ur extends Ie {
3110
3129
  return e;
3111
3130
  }
3112
3131
  }
3113
- class hr extends Ie {
3132
+ class fr extends ze {
3114
3133
  getInitialValue() {
3115
3134
  return -1 / 0;
3116
3135
  }
@@ -3133,15 +3152,15 @@ class hr extends Ie {
3133
3152
  return e;
3134
3153
  }
3135
3154
  }
3136
- class fr {
3155
+ class pr {
3137
3156
  // Collection of custom strategy overrides
3138
3157
  static #e = /* @__PURE__ */ new Map();
3139
3158
  // Default strategy map
3140
3159
  static #t = /* @__PURE__ */ new Map([
3141
- ["count", () => new cr()],
3142
- ["sum", () => new dr()],
3143
- ["min", () => new ur()],
3144
- ["max", () => new hr()]
3160
+ ["count", () => new dr()],
3161
+ ["sum", () => new ur()],
3162
+ ["min", () => new hr()],
3163
+ ["max", () => new fr()]
3145
3164
  ]);
3146
3165
  /**
3147
3166
  * Clear all custom strategy overrides
@@ -3168,7 +3187,7 @@ class fr {
3168
3187
  static overrideStrategy(e, t, s) {
3169
3188
  if (!e || !s)
3170
3189
  throw new Error("overrideStrategy requires metricType and strategy");
3171
- if (!(s instanceof Ie))
3190
+ if (!(s instanceof ze))
3172
3191
  throw new Error("strategy must be an instance of MetricCalculationStrategy");
3173
3192
  let r;
3174
3193
  t ? r = this.#s(e, t) : r = `${e}::*::*`, this.#e.set(r, s);
@@ -3187,9 +3206,9 @@ class fr {
3187
3206
  return this.#e.has(o) ? this.#e.get(o) : (this.#t.get(s) || this.#t.get("count"))();
3188
3207
  }
3189
3208
  }
3190
- class pr {
3209
+ class mr {
3191
3210
  constructor(e, t, s, r = null, o = null, i) {
3192
- this.metricType = e, this.modelClass = t, this.queryset = s, this.field = r, this.ast = o, this.fetchFn = i, this.groundTruthValue = null, this.isSyncing = !1, this.strategy = fr.getStrategy(e, t), this.operations = [], this.confirmedOps = /* @__PURE__ */ new Set(), this.metricCache = new vt(
3211
+ this.metricType = e, this.modelClass = t, this.queryset = s, this.field = r, this.ast = o, this.fetchFn = i, this.groundTruthValue = null, this.isSyncing = !1, this.strategy = pr.getStrategy(e, t), this.operations = [], this.confirmedOps = /* @__PURE__ */ new Set(), this.metricCache = new vt(
3193
3212
  "metric-store-cache",
3194
3213
  {},
3195
3214
  this.onHydrated.bind(this)
@@ -3249,7 +3268,7 @@ class pr {
3249
3268
  onHydrated() {
3250
3269
  if (this.groundTruthValue === null) {
3251
3270
  const e = this.metricCache.get(this.cacheKey);
3252
- !E(e) && !Ce(e) && this.setGroundTruth(e?.value);
3271
+ !E(e) && !ve(e) && this.setGroundTruth(e?.value);
3253
3272
  }
3254
3273
  }
3255
3274
  setCache() {
@@ -3329,13 +3348,13 @@ function te(n, e) {
3329
3348
  function Z(n) {
3330
3349
  return delete n.isOptimistic, delete n.then, delete n.catch, n;
3331
3350
  }
3332
- _s();
3333
- Zt.create();
3334
- function mr(n, e) {
3351
+ ws();
3352
+ Yt.create();
3353
+ function yr(n, e) {
3335
3354
  if (!n || !n.__f_expr)
3336
3355
  return n;
3337
3356
  try {
3338
- return Zt.evaluate(n.original_expr, e);
3357
+ return Yt.evaluate(n.original_expr, e);
3339
3358
  } catch (t) {
3340
3359
  return console.warn(`Error evaluating F expression: ${t.message}`), null;
3341
3360
  }
@@ -3349,7 +3368,7 @@ class de {
3349
3368
  * @returns {Operation} The created operation
3350
3369
  */
3351
3370
  static createCreateOperation(e, t = {}, s = null) {
3352
- const o = e.ModelClass.primaryKeyField, i = s || `${G()}`, l = Kt(i);
3371
+ const o = e.ModelClass.primaryKeyField, i = s || `${G()}`, l = zt(i);
3353
3372
  return new q({
3354
3373
  operationId: i,
3355
3374
  type: M.CREATE,
@@ -3368,7 +3387,7 @@ class de {
3368
3387
  */
3369
3388
  static createBulkCreateOperation(e, t = [], s = null) {
3370
3389
  const o = e.ModelClass.primaryKeyField, i = s || `${G()}`, l = t.map((a, c) => {
3371
- const f = Kt(`${i}_${c}`);
3390
+ const f = zt(`${i}_${c}`);
3372
3391
  return { ...a, [o]: f };
3373
3392
  });
3374
3393
  return new q({
@@ -3394,7 +3413,7 @@ class de {
3394
3413
  y[i] = p;
3395
3414
  for (const [_, w] of Object.entries(t))
3396
3415
  if (w && typeof w == "object" && w.__f_expr) {
3397
- const v = mr(w, m);
3416
+ const v = yr(w, m);
3398
3417
  v !== null ? y[_] = v : y[_] = m[_];
3399
3418
  } else
3400
3419
  y[_] = w;
@@ -3509,7 +3528,7 @@ class de {
3509
3528
  });
3510
3529
  }
3511
3530
  }
3512
- class qt extends Array {
3531
+ class Jt extends Array {
3513
3532
  /**
3514
3533
  * Creates a new ResultTuple.
3515
3534
  *
@@ -3520,7 +3539,7 @@ class qt extends Array {
3520
3539
  super(2), this[0] = e, this[1] = t, this.instance = e, this.created = t;
3521
3540
  }
3522
3541
  }
3523
- class yr {
3542
+ class gr {
3524
3543
  /**
3525
3544
  * Executes a get operation (get, first, last) with the QuerySet.
3526
3545
  *
@@ -3535,7 +3554,7 @@ class yr {
3535
3554
  const { data: p, included: m, model_name: y } = f.data;
3536
3555
  if (E(p) || Array.isArray(p) && p.length === 0)
3537
3556
  return null;
3538
- _e(Q, m, r, e);
3557
+ we(Q, m, r, e);
3539
3558
  const _ = Array.isArray(p) ? p[0] : p;
3540
3559
  return a.pk = _, Z(a), a;
3541
3560
  }
@@ -3560,7 +3579,7 @@ class yr {
3560
3579
  static executeList(e, t = "list", s = {}) {
3561
3580
  const r = j.getEntity(e), o = L(e, t, s).then((i) => {
3562
3581
  const { data: l, included: a } = i.data;
3563
- _e(Q, a, e.ModelClass, e);
3582
+ we(Q, a, e.ModelClass, e);
3564
3583
  const c = Array.isArray(l) ? l : [];
3565
3584
  return j.setEntity(e, c), Z(r), r;
3566
3585
  });
@@ -3579,7 +3598,7 @@ class yr {
3579
3598
  lookup: s.lookup || {},
3580
3599
  defaults: s.defaults || {}
3581
3600
  }, l = t === "get_or_create" ? de.createGetOrCreateOperation(e, i.lookup, i.defaults) : de.createUpdateOrCreateOperation(e, i.lookup, i.defaults), a = l.type === "create", c = r.fromPk(l.instances[0][o], e);
3582
- let f = new qt(c, a);
3601
+ let f = new Jt(c, a);
3583
3602
  if (l.localOnly)
3584
3603
  return l.updateStatus(C.CONFIRMED, l.instances), f;
3585
3604
  const p = L(
@@ -3589,14 +3608,14 @@ class yr {
3589
3608
  l.operationId
3590
3609
  ).then((m) => {
3591
3610
  const { data: y, included: _, model_name: w } = m.data, v = m.metadata.created;
3592
- _e(Q, _, r, e);
3611
+ we(Q, _, r, e);
3593
3612
  const O = Array.isArray(y) ? y[0] : y;
3594
3613
  a && (c.pk = O);
3595
3614
  const b = (_[w] || {})[O];
3596
3615
  return b && l.mutate({
3597
3616
  instances: [b],
3598
3617
  status: C.CONFIRMED
3599
- }), f = new qt(c, v), Z(f), f;
3618
+ }), f = new Jt(c, v), Z(f), f;
3600
3619
  }).catch((m) => {
3601
3620
  throw l.updateStatus(C.REJECTED), m;
3602
3621
  });
@@ -3616,7 +3635,7 @@ class yr {
3616
3635
  throw new Error(
3617
3636
  `Field parameter is required for ${t} operation`
3618
3637
  );
3619
- const i = Pe.getEntity(t, e, o), l = {};
3638
+ const i = Ie.getEntity(t, e, o), l = {};
3620
3639
  t !== "exists" && (l.field = o);
3621
3640
  const a = L(
3622
3641
  e,
@@ -3624,7 +3643,7 @@ class yr {
3624
3643
  l
3625
3644
  ).then((c) => {
3626
3645
  const f = c.data, p = j.getEntity(e);
3627
- return Pe.setEntity(t, e, o, f, p), Z(i), f;
3646
+ return Ie.setEntity(t, e, o, f, p), Z(i), f;
3628
3647
  });
3629
3648
  return te(i, a);
3630
3649
  }
@@ -3726,11 +3745,11 @@ class yr {
3726
3745
  o,
3727
3746
  async (p) => {
3728
3747
  const { data: m } = p.data, y = Array.isArray(m) ? m[0] : m;
3729
- zt(o, y);
3748
+ Kt(o, y);
3730
3749
  }
3731
3750
  ).then((p) => {
3732
3751
  const { data: m, included: y, model_name: _ } = p.data;
3733
- _e(Q, y, r, e);
3752
+ we(Q, y, r, e);
3734
3753
  const w = Array.isArray(m) ? m[0] : m;
3735
3754
  c.pk = w;
3736
3755
  const O = (y[_] || {})[w];
@@ -3776,12 +3795,12 @@ class yr {
3776
3795
  const { data: m } = p.data;
3777
3796
  (Array.isArray(m) ? m : []).forEach((_, w) => {
3778
3797
  const v = `${o}_${w}`;
3779
- zt(v, _);
3798
+ Kt(v, _);
3780
3799
  });
3781
3800
  }
3782
3801
  ).then((p) => {
3783
3802
  const { data: m, included: y, model_name: _ } = p.data;
3784
- _e(Q, y, r, e);
3803
+ we(Q, y, r, e);
3785
3804
  const w = Array.isArray(m) ? m : [];
3786
3805
  w.forEach((T, b) => {
3787
3806
  c[b] && (c[b].pk = T);
@@ -3817,7 +3836,7 @@ class yr {
3817
3836
  a.operationId
3818
3837
  ).then((m) => {
3819
3838
  const { data: y, included: _, model_name: w } = m.data;
3820
- _e(Q, _, r, e);
3839
+ we(Q, _, r, e);
3821
3840
  const v = Array.isArray(y) ? y[0] : y;
3822
3841
  f.pk = v;
3823
3842
  const T = (_[w] || {})[v];
@@ -3918,7 +3937,7 @@ class yr {
3918
3937
  return L(e, t, s);
3919
3938
  }
3920
3939
  }
3921
- class gr {
3940
+ class _r {
3922
3941
  constructor(e, t, s = null) {
3923
3942
  this.queryset = e, this.metricType = t, this.field = s;
3924
3943
  }
@@ -3930,7 +3949,7 @@ class gr {
3930
3949
  * Delegates to the underlying store's sync method
3931
3950
  */
3932
3951
  refreshFromDb() {
3933
- return Pe.getStore(
3952
+ return Ie.getStore(
3934
3953
  this.metricType,
3935
3954
  this.queryset,
3936
3955
  this.field
@@ -3940,7 +3959,7 @@ class gr {
3940
3959
  * Getter that always returns the current value from the store
3941
3960
  */
3942
3961
  get value() {
3943
- const e = Pe.getStore(
3962
+ const e = Ie.getStore(
3944
3963
  this.metricType,
3945
3964
  this.queryset,
3946
3965
  this.field
@@ -3989,8 +4008,8 @@ class Ct {
3989
4008
  if (!this._stores.has(i)) {
3990
4009
  const l = async ({ metricType: c, modelClass: f, field: p, ast: m }) => {
3991
4010
  const y = t.clone();
3992
- return await yr.executeAgg(y, c, { field: p });
3993
- }, a = new pr(
4011
+ return await gr.executeAgg(y, c, { field: p });
4012
+ }, a = new mr(
3994
4013
  e,
3995
4014
  r,
3996
4015
  t,
@@ -4013,7 +4032,7 @@ class Ct {
4013
4032
  if (E(e) || E(t) || E(t.ModelClass))
4014
4033
  return null;
4015
4034
  this.getStore(e, t, s);
4016
- const r = new gr(t, e, s);
4035
+ const r = new _r(t, e, s);
4017
4036
  return r;
4018
4037
  }
4019
4038
  /**
@@ -4023,7 +4042,7 @@ class Ct {
4023
4042
  if (E(e) || E(t) || E(t.ModelClass))
4024
4043
  return null;
4025
4044
  const o = this.getStore(e, t, s);
4026
- return o ? ((!E(o.groundTruthValue) || !Ce(o.operations)) && o.reset(), o.setGroundTruth(r), r) : null;
4045
+ return o ? ((!E(o.groundTruthValue) || !ve(o.operations)) && o.reset(), o.setGroundTruth(r), r) : null;
4027
4046
  }
4028
4047
  /**
4029
4048
  * Sync a specific metric with the server
@@ -4040,8 +4059,8 @@ class Ct {
4040
4059
  return this._stores.has(e) ? this._stores.get(e).queryset : null;
4041
4060
  }
4042
4061
  }
4043
- const Pe = new Ct();
4044
- class _r {
4062
+ const Ie = new Ct();
4063
+ class wr {
4045
4064
  constructor(e) {
4046
4065
  this.event = e.event, this.model = e.model, this.operation_id = e.operation_id, this.pk_field_name = e.pk_field_name, this.configKey = e.configKey, this.canonical_id = e.canonical_id || null, this.server_ts_ms = e.server_ts_ms || null, this.instances = e.instances?.map((t) => t && this.pk_field_name && t[this.pk_field_name] != null ? {
4047
4066
  ...t,
@@ -4049,7 +4068,7 @@ class _r {
4049
4068
  } : t) || e.instances, this._cachedInstances = null;
4050
4069
  }
4051
4070
  get modelClass() {
4052
- return Xt(this.model, this.configKey);
4071
+ return es(this.model, this.configKey);
4053
4072
  }
4054
4073
  async getFullInstances() {
4055
4074
  if (this.event === "delete")
@@ -4063,7 +4082,7 @@ class _r {
4063
4082
  }).fetch()), this._cachedInstances;
4064
4083
  }
4065
4084
  }
4066
- class wr {
4085
+ class Cr {
4067
4086
  constructor() {
4068
4087
  this.registries = /* @__PURE__ */ new Map(), this.followedModels = /* @__PURE__ */ new Map(), this.followAllQuerysets = !0, this.followedQuerysets = /* @__PURE__ */ new Map(), this.periodicSyncTimer = null, this.eventBatch = /* @__PURE__ */ new Map(), this.debounceTimer = null, this.maxWaitTimer = null, this.debounceMs = 100, this.maxWaitMs = 2e3, this.batchStartTime = null;
4069
4088
  }
@@ -4086,7 +4105,7 @@ class wr {
4086
4105
  * Initialize event handlers for all event receivers
4087
4106
  */
4088
4107
  initialize() {
4089
- xs(), Ds().forEach((t, s) => {
4108
+ js(), Ds().forEach((t, s) => {
4090
4109
  t && t.addModelEventHandler(this.handleEvent.bind(this));
4091
4110
  }), this.startPeriodicSync();
4092
4111
  }
@@ -4104,7 +4123,7 @@ class wr {
4104
4123
  }
4105
4124
  }
4106
4125
  async syncStaleQuerysets() {
4107
- const e = this.registries.get(we);
4126
+ const e = this.registries.get(Ce);
4108
4127
  if (!e) return;
4109
4128
  const t = `periodic-sync-${G()}`, s = new Set(
4110
4129
  [...this.followedQuerysets].map((o) => o.semanticKey).filter((o) => e._stores.has(o))
@@ -4120,7 +4139,7 @@ class wr {
4120
4139
  ), this.pruneUnreferencedModels();
4121
4140
  }
4122
4141
  pruneUnreferencedModels() {
4123
- const e = this.registries.get(Ge), t = this.registries.get(we);
4142
+ const e = this.registries.get(Ge), t = this.registries.get(Ce);
4124
4143
  if (!(!e || !t))
4125
4144
  for (const [s, r] of e._stores.entries())
4126
4145
  r.pruneUnreferencedInstances(t);
@@ -4138,7 +4157,7 @@ class wr {
4138
4157
  const r = [...this.followedModels.values()].some(
4139
4158
  (o) => o.has(t)
4140
4159
  );
4141
- s.add(t), r || jt(t.configKey)?.subscribe(
4160
+ s.add(t), r || Ut(t.configKey)?.subscribe(
4142
4161
  t.modelName,
4143
4162
  this.handleEvent
4144
4163
  );
@@ -4148,7 +4167,7 @@ class wr {
4148
4167
  if (!s) return;
4149
4168
  s.delete(t), [...this.followedModels.values()].some(
4150
4169
  (o) => o.has(t)
4151
- ) || jt(t.configKey)?.unsubscribe(
4170
+ ) || Ut(t.configKey)?.unsubscribe(
4152
4171
  t.modelName,
4153
4172
  this.handleEvent
4154
4173
  );
@@ -4165,9 +4184,9 @@ class wr {
4165
4184
  * Checks the `verify` flag on membership state to determine which querysets need syncing.
4166
4185
  */
4167
4186
  syncQuerysetsNeedingVerification(e) {
4168
- const t = Oe.getQuerysetStates(e);
4187
+ const t = Pe.getQuerysetStates(e);
4169
4188
  if (!t) return;
4170
- const s = this.registries.get(we);
4189
+ const s = this.registries.get(Ce);
4171
4190
  if (!s) return;
4172
4191
  const r = [];
4173
4192
  for (const [l, a] of t.entries())
@@ -4196,7 +4215,7 @@ class wr {
4196
4215
  operationId: e.operation_id,
4197
4216
  socketId: e.socket_id
4198
4217
  });
4199
- let t = new _r(e), s = Oe.has(t.operation_id);
4218
+ let t = new wr(e), s = Pe.has(t.operation_id);
4200
4219
  if (this.registries.has(Ct) && this.processMetrics(t), s) {
4201
4220
  this.syncQuerysetsNeedingVerification(t.operation_id);
4202
4221
  return;
@@ -4224,7 +4243,7 @@ class wr {
4224
4243
  s.has(o) || s.set(o, []), s.get(o).push(r);
4225
4244
  }), s.forEach((r, o) => {
4226
4245
  const i = r[0];
4227
- this.registries.has(we) && this.processQuerysetsBatch(i, r), this.registries.has(Ge) && this.processModels(i);
4246
+ this.registries.has(Ce) && this.processQuerysetsBatch(i, r), this.registries.has(Ge) && this.processModels(i);
4228
4247
  });
4229
4248
  }
4230
4249
  isQuerysetFollowed(e) {
@@ -4240,7 +4259,7 @@ class wr {
4240
4259
  return !1;
4241
4260
  }
4242
4261
  processQuerysetsBatch(e, t) {
4243
- const s = this.registries.get(we), r = [];
4262
+ const s = this.registries.get(Ce), r = [];
4244
4263
  for (const [c, f] of s._stores.entries())
4245
4264
  if (f.modelClass.modelName === e.model && f.modelClass.configKey === e.configKey) {
4246
4265
  if (this.followAllQuerysets) {
@@ -4283,7 +4302,7 @@ class wr {
4283
4302
  (e.instances || []).filter((c) => c && c[e.pk_field_name] != null).map((c) => c[e.pk_field_name])
4284
4303
  );
4285
4304
  if (r.size === 0) return;
4286
- const o = new Set(s.groundTruthPks), i = this.registries.get(we), l = /* @__PURE__ */ new Set();
4305
+ const o = new Set(s.groundTruthPks), i = this.registries.get(Ce), l = /* @__PURE__ */ new Set();
4287
4306
  if (i)
4288
4307
  for (const [c, f] of i._stores.entries())
4289
4308
  f.modelClass.modelName === e.model && f.modelClass.configKey === e.configKey && f.groundTruthPks.forEach((p) => l.add(p));
@@ -4293,97 +4312,97 @@ class wr {
4293
4312
  }), a.length > 0 && s.sync(a);
4294
4313
  }
4295
4314
  }
4296
- const $e = new wr();
4315
+ const $e = new Cr();
4297
4316
  $e.manageRegistry(j);
4298
4317
  $e.manageRegistry(Q);
4299
- $e.manageRegistry(Pe);
4300
- const Cr = /* @__PURE__ */ new Set();
4301
- function vr(n) {
4302
- typeof n == "function" && Cr.add(n);
4318
+ $e.manageRegistry(Ie);
4319
+ const vr = /* @__PURE__ */ new Set();
4320
+ function Er(n) {
4321
+ typeof n == "function" && vr.add(n);
4303
4322
  }
4304
4323
  $e.followAllQuerysets = !1;
4305
- const ss = /* @__PURE__ */ new Map();
4306
- vr(() => {
4307
- ss.clear(), $e.followAllQuerysets = !0, $e.followedQuerysets.clear();
4324
+ const rs = /* @__PURE__ */ new Map();
4325
+ Er(() => {
4326
+ rs.clear(), $e.followAllQuerysets = !0, $e.followedQuerysets.clear();
4308
4327
  });
4309
- const Er = (n, e) => {
4328
+ const br = (n, e) => {
4310
4329
  const t = n.__vccOpts || n;
4311
4330
  for (const [s, r] of e)
4312
4331
  t[s] = r;
4313
4332
  return t;
4314
- }, br = { class: "szd" }, kr = { class: "szd-header" }, Sr = { class: "szd-header__top" }, Tr = { class: "szd-header__left" }, Mr = {
4333
+ }, kr = { class: "szd" }, Sr = { class: "szd-header" }, Tr = { class: "szd-header__top" }, Mr = { class: "szd-header__left" }, $r = {
4315
4334
  key: 0,
4316
4335
  class: "szd-header__model"
4317
- }, $r = {
4336
+ }, Ar = {
4318
4337
  key: 1,
4319
4338
  class: "szd-header__model szd-header__model--empty"
4320
- }, Ar = { class: "szd-header__right" }, Or = {
4339
+ }, Or = { class: "szd-header__right" }, Pr = {
4321
4340
  key: 0,
4322
4341
  class: "szd-header__badge szd-header__badge--syncing"
4323
- }, Pr = {
4342
+ }, Ir = {
4324
4343
  key: 1,
4325
4344
  class: "szd-header__badge"
4326
- }, Fr = { class: "szd-header__badge" }, Dr = { class: "szd-tabs" }, Ir = ["onClick"], Kr = { class: "szd-content" }, zr = {
4345
+ }, Fr = { class: "szd-header__badge" }, Dr = { class: "szd-tabs" }, zr = ["onClick"], Kr = { class: "szd-content" }, Rr = {
4327
4346
  key: 0,
4328
4347
  class: "szd-panel"
4329
- }, Rr = { class: "szd-panel__section" }, Nr = { class: "szd-kv" }, xr = { class: "szd-kv__row" }, jr = { class: "szd-kv__value" }, Ur = { class: "szd-kv__row" }, Qr = { class: "szd-kv__value" }, Vr = { class: "szd-kv__row" }, Lr = { class: "szd-kv__value" }, Gr = { class: "szd-kv__row" }, Br = { class: "szd-kv__value" }, Hr = { class: "szd-panel__section" }, qr = { class: "szd-stats" }, Jr = { class: "szd-stat" }, Wr = { class: "szd-stat__value" }, Zr = { class: "szd-stat" }, Yr = { class: "szd-stat__value" }, Xr = { class: "szd-stat" }, en = { class: "szd-stat__value" }, tn = { class: "szd-stat" }, sn = { class: "szd-stat__value" }, rn = {
4348
+ }, Nr = { class: "szd-panel__section" }, xr = { class: "szd-kv" }, jr = { class: "szd-kv__row" }, Ur = { class: "szd-kv__value" }, Qr = { class: "szd-kv__row" }, Vr = { class: "szd-kv__value" }, Lr = { class: "szd-kv__row" }, Gr = { class: "szd-kv__value" }, Br = { class: "szd-kv__row" }, Hr = { class: "szd-kv__value" }, qr = { class: "szd-panel__section" }, Jr = { class: "szd-stats" }, Wr = { class: "szd-stat" }, Zr = { class: "szd-stat__value" }, Yr = { class: "szd-stat" }, Xr = { class: "szd-stat__value" }, en = { class: "szd-stat" }, tn = { class: "szd-stat__value" }, sn = { class: "szd-stat" }, rn = { class: "szd-stat__value" }, nn = {
4330
4349
  class: "szd-kv",
4331
4350
  style: { "margin-top": "12px" }
4332
- }, nn = { class: "szd-kv__row" }, on = { class: "szd-kv__value" }, an = {
4351
+ }, on = { class: "szd-kv__row" }, an = { class: "szd-kv__value" }, ln = {
4333
4352
  key: 0,
4334
4353
  class: "szd-panel__section"
4335
- }, ln = { class: "szd-event-preview__text" }, cn = { class: "szd-event-preview__time" }, dn = {
4354
+ }, cn = { class: "szd-event-preview__text" }, dn = { class: "szd-event-preview__time" }, un = {
4336
4355
  key: 1,
4337
4356
  class: "szd-panel"
4338
- }, un = { class: "szd-timeline-filters" }, hn = ["onUpdate:modelValue"], fn = { class: "szd-timeline" }, pn = ["onClick"], mn = { class: "szd-timeline__time" }, yn = { class: "szd-timeline__text" }, gn = {
4357
+ }, hn = { class: "szd-timeline-filters" }, fn = ["onUpdate:modelValue"], pn = { class: "szd-timeline" }, mn = ["onClick"], yn = { class: "szd-timeline__time" }, gn = { class: "szd-timeline__text" }, _n = {
4339
4358
  key: 0,
4340
4359
  class: "szd-empty"
4341
- }, _n = {
4360
+ }, wn = {
4342
4361
  key: 2,
4343
4362
  class: "szd-panel"
4344
- }, wn = { class: "szd-pipeline" }, Cn = ["onClick"], vn = { class: "szd-pipeline__label" }, En = { class: "szd-pipeline__count" }, bn = {
4363
+ }, Cn = { class: "szd-pipeline" }, vn = ["onClick"], En = { class: "szd-pipeline__label" }, bn = { class: "szd-pipeline__count" }, kn = {
4345
4364
  key: 0,
4346
4365
  class: "szd-pipeline__arrow"
4347
- }, kn = {
4366
+ }, Sn = {
4348
4367
  class: "szd-panel__section",
4349
4368
  style: { "margin-top": "20px" }
4350
- }, Sn = { class: "szd-preview-header" }, Tn = ["value"], Mn = {
4369
+ }, Tn = { class: "szd-preview-header" }, Mn = ["value"], $n = {
4351
4370
  key: 0,
4352
4371
  class: "szd-data-grid"
4353
- }, $n = { class: "szd-data-card__header" }, An = {
4372
+ }, An = { class: "szd-data-card__header" }, On = {
4354
4373
  key: 0,
4355
4374
  class: "szd-data-card__badge"
4356
- }, On = {
4375
+ }, Pn = {
4357
4376
  key: 1,
4358
4377
  class: "szd-data-card__badge szd-data-card__badge--absent"
4359
- }, Pn = { class: "szd-data-card__content" }, Fn = {
4378
+ }, In = { class: "szd-data-card__content" }, Fn = {
4360
4379
  key: 1,
4361
4380
  class: "szd-empty"
4362
4381
  }, Dn = {
4363
4382
  key: 3,
4364
4383
  class: "szd-panel"
4365
- }, In = {
4384
+ }, zn = {
4366
4385
  class: "szd-kv",
4367
4386
  style: { "margin-bottom": "16px" }
4368
- }, Kn = { class: "szd-kv__row" }, zn = { class: "szd-kv__value szd-kv__value--mono" }, Rn = { class: "szd-ast" }, Nn = {
4387
+ }, Kn = { class: "szd-kv__row" }, Rn = { class: "szd-kv__value szd-kv__value--mono" }, Nn = { class: "szd-ast" }, xn = {
4369
4388
  key: 0,
4370
4389
  class: "szd-detail"
4371
- }, xn = { class: "szd-detail__panel szd-detail__panel--sm" }, jn = { class: "szd-detail__header" }, Un = { class: "szd-detail__body" }, Qn = { class: "szd-settings-section" }, Vn = ["value"], Ln = {
4390
+ }, jn = { class: "szd-detail__panel szd-detail__panel--sm" }, Un = { class: "szd-detail__header" }, Qn = { class: "szd-detail__body" }, Vn = { class: "szd-settings-section" }, Ln = ["value"], Gn = {
4372
4391
  key: 0,
4373
4392
  class: "szd-settings-section"
4374
- }, Gn = { class: "szd-settings-row" }, Bn = { class: "szd-settings-code" }, Hn = { class: "szd-settings-section" }, qn = { class: "szd-settings-actions" }, Jn = ["disabled"], Wn = { class: "szd-settings-section" }, Zn = { class: "szd-toggle" }, Yn = {
4393
+ }, Bn = { class: "szd-settings-row" }, Hn = { class: "szd-settings-code" }, qn = { class: "szd-settings-section" }, Jn = { class: "szd-settings-actions" }, Wn = ["disabled"], Zn = { class: "szd-settings-section" }, Yn = { class: "szd-toggle" }, Xn = {
4375
4394
  key: 1,
4376
4395
  class: "szd-settings-section"
4377
- }, Xn = { class: "szd-kv" }, eo = { class: "szd-kv__row" }, to = { class: "szd-kv__value" }, so = { class: "szd-kv__row" }, ro = { class: "szd-kv__value" }, no = { class: "szd-kv__row" }, oo = { class: "szd-kv__value" }, io = { class: "szd-kv__row" }, ao = { class: "szd-kv__value" }, lo = { class: "szd-kv__row" }, co = { class: "szd-kv__value" }, uo = {
4396
+ }, eo = { class: "szd-kv" }, to = { class: "szd-kv__row" }, so = { class: "szd-kv__value" }, ro = { class: "szd-kv__row" }, no = { class: "szd-kv__value" }, oo = { class: "szd-kv__row" }, io = { class: "szd-kv__value" }, ao = { class: "szd-kv__row" }, lo = { class: "szd-kv__value" }, co = { class: "szd-kv__row" }, uo = { class: "szd-kv__value" }, ho = {
4378
4397
  key: 0,
4379
4398
  class: "szd-detail"
4380
- }, ho = { class: "szd-detail__panel" }, fo = { class: "szd-detail__header" }, po = { class: "szd-detail__title" }, mo = { class: "szd-detail__body" }, yo = { class: "szd-kv" }, go = { class: "szd-kv__key" }, _o = { class: "szd-kv__value" }, wo = { class: "szd-ast" }, Co = {
4399
+ }, fo = { class: "szd-detail__panel" }, po = { class: "szd-detail__header" }, mo = { class: "szd-detail__title" }, yo = { class: "szd-detail__body" }, go = { class: "szd-kv" }, _o = { class: "szd-kv__key" }, wo = { class: "szd-kv__value" }, Co = { class: "szd-ast" }, vo = {
4381
4400
  class: "szd-kv",
4382
4401
  style: { "margin-bottom": "16px" }
4383
- }, vo = { class: "szd-kv__row" }, Eo = { class: "szd-kv__value" }, bo = { class: "szd-kv__row" }, ko = { class: "szd-kv__value" }, So = {
4402
+ }, Eo = { class: "szd-kv__row" }, bo = { class: "szd-kv__value" }, ko = { class: "szd-kv__row" }, So = { class: "szd-kv__value" }, To = {
4384
4403
  key: 0,
4385
4404
  class: "szd-kv__note"
4386
- }, To = { class: "szd-ast" }, Jt = 100, Mo = {
4405
+ }, Mo = { class: "szd-ast" }, Wt = 100, $o = {
4387
4406
  __name: "StateZeroDebugPanel",
4388
4407
  props: {
4389
4408
  queryset: { type: [Object, String], default: null },
@@ -4397,7 +4416,7 @@ const Er = (n, e) => {
4397
4416
  { id: "timeline", label: "Timeline" },
4398
4417
  { id: "data", label: "Data" },
4399
4418
  { id: "ast", label: "AST" }
4400
- ], r = J(""), o = J(e.useQueryset), i = J(!0), l = J(Qt()), a = J(0), c = J(!1), f = J(null), p = J(!1), m = J(null), y = J({
4419
+ ], r = J(""), o = J(e.useQueryset), i = J(!0), l = J(Vt()), a = J(0), c = J(!1), f = J(null), p = J(!1), m = J(null), y = J({
4401
4420
  request: !0,
4402
4421
  response: !0,
4403
4422
  render: !0,
@@ -4418,7 +4437,7 @@ const Er = (n, e) => {
4418
4437
  ), v = R(() => {
4419
4438
  a.value;
4420
4439
  const u = [];
4421
- return ss.forEach((d) => {
4440
+ return rs.forEach((d) => {
4422
4441
  d?.semanticKey && u.push({
4423
4442
  semanticKey: d.semanticKey,
4424
4443
  modelName: d.ModelClass?.modelName,
@@ -4453,21 +4472,21 @@ const Er = (n, e) => {
4453
4472
  return null;
4454
4473
  }
4455
4474
  return k.value && j._stores.get(k.value) || null;
4456
- }), F = R(() => {
4475
+ }), I = R(() => {
4457
4476
  a.value;
4458
- const u = N.value, d = U.value, g = u?.modelClass?.modelName || d?.ModelClass?.modelName, K = u?.modelClass?.configKey || d?.ModelClass?.configKey, H = u?.groundTruthPks?.length ?? 0, oe = u?.operationsMap?.size ?? 0, le = u?.getInflightOperations?.() || [], be = u?.isSyncing ?? !1, je = u?.lastSync ? new Date(u.lastSync).toLocaleString() : "—", ot = u && Array.isArray(u._lastRenderedPks) ? u._lastRenderedPks.length : null, ls = u?.groundTruthPks?.length ?? 0, cs = u ? u.lastSync === null ? "model store" : "ground truth" : "—", ds = be ? "Sync in progress — results may change." : oe > 0 ? "Optimistic operations are applied to results." : u?.lastSync === null ? "No ground truth yet — rendering from model store." : "Using ground truth + local filters.";
4477
+ const u = N.value, d = U.value, g = u?.modelClass?.modelName || d?.ModelClass?.modelName, z = u?.modelClass?.configKey || d?.ModelClass?.configKey, H = u?.groundTruthPks?.length ?? 0, oe = u?.operationsMap?.size ?? 0, le = u?.getInflightOperations?.() || [], be = u?.isSyncing ?? !1, Ue = u?.lastSync ? new Date(u.lastSync).toLocaleString() : "—", ot = u && Array.isArray(u._lastRenderedPks) ? u._lastRenderedPks.length : null, cs = u?.groundTruthPks?.length ?? 0, ds = u ? u.lastSync === null ? "model store" : "ground truth" : "—", us = be ? "Sync in progress — results may change." : oe > 0 ? "Optimistic operations are applied to results." : u?.lastSync === null ? "No ground truth yet — rendering from model store." : "Using ground truth + local filters.";
4459
4478
  return {
4460
4479
  modelName: g,
4461
- configKey: K,
4480
+ configKey: z,
4462
4481
  groundTruthCount: H,
4463
4482
  opsCount: oe,
4464
4483
  inFlightCount: le.length,
4465
4484
  isSyncing: be,
4466
- lastSync: je,
4485
+ lastSync: Ue,
4467
4486
  optimisticCount: ot,
4468
- confirmedCount: ls,
4469
- source: cs,
4470
- reason: ds
4487
+ confirmedCount: cs,
4488
+ source: ds,
4489
+ reason: us
4471
4490
  };
4472
4491
  }), re = R(() => {
4473
4492
  a.value;
@@ -4477,27 +4496,27 @@ const Er = (n, e) => {
4477
4496
  return { error: u?.message || "Failed to build AST" };
4478
4497
  }
4479
4498
  });
4480
- function fe(u) {
4499
+ function pe(u) {
4481
4500
  if (!u?.filter?.conditions) return "—";
4482
4501
  const d = u.filter.conditions;
4483
- return typeof d != "object" ? String(d) : Object.entries(d).map(([K, H]) => H === null ? `${K}: null` : typeof H == "object" ? `${K}: ${JSON.stringify(H)}` : `${K}: ${H}`).join(", ");
4502
+ return typeof d != "object" ? String(d) : Object.entries(d).map(([z, H]) => H === null ? `${z}: null` : typeof H == "object" ? `${z}: ${JSON.stringify(H)}` : `${z}: ${H}`).join(", ");
4484
4503
  }
4485
4504
  function ae(u) {
4486
4505
  const d = u?.orderBy;
4487
4506
  return !d || Array.isArray(d) && d.length === 0 ? "—" : Array.isArray(d) ? d.join(", ") : String(d);
4488
4507
  }
4489
- const I = R(() => {
4508
+ const D = R(() => {
4490
4509
  const u = re.value;
4491
4510
  return {
4492
- filter: fe(u),
4511
+ filter: pe(u),
4493
4512
  orderBy: ae(u),
4494
4513
  limit: u?.serializerOptions?.limit ?? "—"
4495
4514
  };
4496
4515
  });
4497
- function D(u, d, g, K) {
4516
+ function F(u, d, g, z) {
4498
4517
  if (!u || !Array.isArray(g)) return [];
4499
4518
  const H = [];
4500
- for (const oe of g.slice(0, K))
4519
+ for (const oe of g.slice(0, z))
4501
4520
  try {
4502
4521
  const le = u.fromPk(oe, d);
4503
4522
  le && H.push(le.serialize());
@@ -4505,7 +4524,7 @@ const Er = (n, e) => {
4505
4524
  }
4506
4525
  return H;
4507
4526
  }
4508
- const z = R(() => {
4527
+ const K = R(() => {
4509
4528
  a.value;
4510
4529
  const u = N.value, d = U.value;
4511
4530
  if (!u || !d)
@@ -4522,7 +4541,7 @@ const Er = (n, e) => {
4522
4541
  finalSample: [],
4523
4542
  limit: null
4524
4543
  };
4525
- const g = Array.isArray(u.groundTruthPks) ? [...u.groundTruthPks] : [], K = u.renderFromData(!0), H = u.renderFromData(!1), oe = u._getValidatedAndFilteredPks(K), le = u.lastSync === null ? u.renderFromModelStore() : [], be = d.build()?.serializerOptions?.limit ?? null, je = be ? oe.slice(0, be) : oe, ot = le.length > 0 ? D(
4544
+ const g = Array.isArray(u.groundTruthPks) ? [...u.groundTruthPks] : [], z = u.renderFromData(!0), H = u.renderFromData(!1), oe = u._getValidatedAndFilteredPks(z), le = u.lastSync === null ? u.renderFromModelStore() : [], be = d.build()?.serializerOptions?.limit ?? null, Ue = be ? oe.slice(0, be) : oe, ot = le.length > 0 ? F(
4526
4545
  u.modelClass,
4527
4546
  d,
4528
4547
  le,
@@ -4531,66 +4550,66 @@ const Er = (n, e) => {
4531
4550
  return {
4532
4551
  modelStoreFiltered: le,
4533
4552
  groundTruth: g,
4534
- optimistic: K,
4553
+ optimistic: z,
4535
4554
  filtered: oe,
4536
- final: je,
4555
+ final: Ue,
4537
4556
  modelStoreSample: ot,
4538
- groundTruthSample: D(
4557
+ groundTruthSample: F(
4539
4558
  u.modelClass,
4540
4559
  d,
4541
4560
  g,
4542
4561
  e.sampleSize
4543
4562
  ),
4544
- optimisticSample: D(
4563
+ optimisticSample: F(
4545
4564
  u.modelClass,
4546
4565
  d,
4547
- K,
4566
+ z,
4548
4567
  e.sampleSize
4549
4568
  ),
4550
- filteredSample: D(
4569
+ filteredSample: F(
4551
4570
  u.modelClass,
4552
4571
  d,
4553
4572
  oe,
4554
4573
  e.sampleSize
4555
4574
  ),
4556
- finalSample: D(
4575
+ finalSample: F(
4557
4576
  u.modelClass,
4558
4577
  d,
4559
- je,
4578
+ Ue,
4560
4579
  e.sampleSize
4561
4580
  ),
4562
4581
  limit: be,
4563
4582
  confirmed: H
4564
4583
  };
4565
- }), pe = R(() => [
4566
- { id: "model-store", label: "Model Store", count: z.value.modelStoreFiltered.length, pks: z.value.modelStoreFiltered },
4567
- { id: "ground-truth", label: "Ground Truth", count: z.value.groundTruth.length, pks: z.value.groundTruth },
4568
- { id: "optimistic", label: "Optimistic", count: z.value.optimistic.length, pks: z.value.optimistic },
4569
- { id: "filtered", label: "Filtered", count: z.value.filtered.length, pks: z.value.filtered },
4570
- { id: "final", label: "Final", count: z.value.final.length, pks: z.value.final }
4571
- ]), Ye = R(() => z.value.final || []);
4572
- function me(u) {
4584
+ }), me = R(() => [
4585
+ { id: "model-store", label: "Model Store", count: K.value.modelStoreFiltered.length, pks: K.value.modelStoreFiltered },
4586
+ { id: "ground-truth", label: "Ground Truth", count: K.value.groundTruth.length, pks: K.value.groundTruth },
4587
+ { id: "optimistic", label: "Optimistic", count: K.value.optimistic.length, pks: K.value.optimistic },
4588
+ { id: "filtered", label: "Filtered", count: K.value.filtered.length, pks: K.value.filtered },
4589
+ { id: "final", label: "Final", count: K.value.final.length, pks: K.value.final }
4590
+ ]), Ye = R(() => K.value.final || []);
4591
+ function ye(u) {
4573
4592
  const d = N.value, g = U.value;
4574
4593
  if (!d || !g || u == null) return null;
4575
4594
  try {
4576
- const K = d.modelClass.fromPk(u, g);
4577
- return K ? K.serialize() : null;
4595
+ const z = d.modelClass.fromPk(u, g);
4596
+ return z ? z.serialize() : null;
4578
4597
  } catch {
4579
4598
  return null;
4580
4599
  }
4581
4600
  }
4582
- R(() => m.value == null ? null : me(m.value));
4601
+ R(() => m.value == null ? null : ye(m.value));
4583
4602
  const Ke = R(() => {
4584
4603
  if (!f.value || f.value.type !== "snapshot") return [];
4585
4604
  const u = f.value.data, d = N.value, g = U.value;
4586
- return !d || !g || !u.pks ? [] : D(d.modelClass, g, u.pks, Jt);
4587
- }), Xe = R(() => !f.value || f.value.type !== "snapshot" ? !1 : f.value.data.count > Jt), ze = R(() => {
4605
+ return !d || !g || !u.pks ? [] : F(d.modelClass, g, u.pks, Wt);
4606
+ }), Xe = R(() => !f.value || f.value.type !== "snapshot" ? !1 : f.value.data.count > Wt), Re = R(() => {
4588
4607
  if (!k.value) return l.value;
4589
4608
  const u = N.value;
4590
4609
  return l.value.filter((d) => d.semanticKey === k.value ? !0 : u ? d.modelName === u.modelClass?.modelName && d.configKey === u.modelClass?.configKey : !1);
4591
- }), Ee = R(() => ze.value.filter((u) => y.value[u.type])), Re = R(() => l.value.length), ne = R(
4610
+ }), Ee = R(() => Re.value.filter((u) => y.value[u.type])), Ne = R(() => l.value.length), ne = R(
4592
4611
  () => l.value.length ? l.value[l.value.length - 1] : null
4593
- ), Ne = [
4612
+ ), xe = [
4594
4613
  { id: "request", label: "Requests", color: "#3b82f6" },
4595
4614
  { id: "response", label: "Responses", color: "#22c55e" },
4596
4615
  { id: "render", label: "Renders", color: "#a855f7" },
@@ -4601,8 +4620,8 @@ const Er = (n, e) => {
4601
4620
  { id: "groupSync", label: "Group Sync", color: "#8b5cf6" },
4602
4621
  { id: "error", label: "Errors", color: "#ef4444" }
4603
4622
  ];
4604
- function xe(u) {
4605
- return Ne.find((d) => d.id === u)?.color || "#6b7280";
4623
+ function je(u) {
4624
+ return xe.find((d) => d.id === u)?.color || "#6b7280";
4606
4625
  }
4607
4626
  function et(u) {
4608
4627
  if (!u) return "";
@@ -4637,7 +4656,7 @@ const Er = (n, e) => {
4637
4656
  return u.type;
4638
4657
  }
4639
4658
  }
4640
- function rs(u) {
4659
+ function ns(u) {
4641
4660
  if (!u) return null;
4642
4661
  const d = {
4643
4662
  type: u.type,
@@ -4669,13 +4688,13 @@ const Er = (n, e) => {
4669
4688
  return d;
4670
4689
  }
4671
4690
  }
4672
- function ns() {
4673
- Ls(), l.value = [];
4674
- }
4675
4691
  function os() {
4692
+ Gs(), l.value = [];
4693
+ }
4694
+ function is() {
4676
4695
  !k.value || !navigator?.clipboard || navigator.clipboard.writeText(k.value);
4677
4696
  }
4678
- async function is() {
4697
+ async function as() {
4679
4698
  if (!(!N.value || c.value)) {
4680
4699
  c.value = !0;
4681
4700
  try {
@@ -4689,7 +4708,7 @@ const Er = (n, e) => {
4689
4708
  function bt(u) {
4690
4709
  f.value = { type: "entry", data: u };
4691
4710
  }
4692
- function as(u) {
4711
+ function ls(u) {
4693
4712
  f.value = { type: "snapshot", data: u };
4694
4713
  }
4695
4714
  function kt() {
@@ -4701,21 +4720,21 @@ const Er = (n, e) => {
4701
4720
  });
4702
4721
  }
4703
4722
  let tt = null, st = null, rt = null, nt = null;
4704
- return us(() => {
4705
- Gs(), Vt(e.maxEntries), tt = Qs((u) => {
4723
+ return hs(() => {
4724
+ Bs(), Lt(e.maxEntries), tt = Vs((u) => {
4706
4725
  i.value && (l.value = [...l.value, u], l.value.length > e.maxEntries && (l.value = l.value.slice(-e.maxEntries)));
4707
- }), st = Vs(() => {
4726
+ }), st = Ls(() => {
4708
4727
  l.value = [];
4709
4728
  }), rt = setInterval(() => {
4710
4729
  a.value += 1;
4711
4730
  }, 2e3), nt = setInterval(() => {
4712
- l.value = Qt();
4731
+ l.value = Vt();
4713
4732
  }, 1e3);
4714
- }), hs(() => {
4733
+ }), fs(() => {
4715
4734
  tt && tt(), st && st(), rt && clearInterval(rt), nt && clearInterval(nt);
4716
4735
  }), it(
4717
4736
  () => e.maxEntries,
4718
- (u) => Vt(u)
4737
+ (u) => Lt(u)
4719
4738
  ), it(
4720
4739
  () => e.useQueryset,
4721
4740
  (u) => {
@@ -4723,17 +4742,17 @@ const Er = (n, e) => {
4723
4742
  }
4724
4743
  ), it(k, () => {
4725
4744
  m.value = null;
4726
- }), (u, d) => (A(), $("section", br, [
4727
- h("header", kr, [
4728
- h("div", Sr, [
4729
- h("div", Tr, [
4745
+ }), (u, d) => (A(), $("section", kr, [
4746
+ h("header", Sr, [
4747
+ h("div", Tr, [
4748
+ h("div", Mr, [
4730
4749
  d[9] || (d[9] = h("div", { class: "szd-header__title" }, "StateZero", -1)),
4731
- k.value ? (A(), $("span", Mr, S(F.value.modelName || "?"), 1)) : (A(), $("span", $r, "No queryset"))
4750
+ k.value ? (A(), $("span", $r, S(I.value.modelName || "?"), 1)) : (A(), $("span", Ar, "No queryset"))
4732
4751
  ]),
4733
- h("div", Ar, [
4734
- F.value.isSyncing ? (A(), $("span", Or, "Syncing")) : V("", !0),
4735
- F.value.opsCount > 0 ? (A(), $("span", Pr, S(F.value.opsCount) + " ops", 1)) : V("", !0),
4736
- h("span", Fr, S(Re.value) + " events", 1),
4752
+ h("div", Or, [
4753
+ I.value.isSyncing ? (A(), $("span", Pr, "Syncing")) : V("", !0),
4754
+ I.value.opsCount > 0 ? (A(), $("span", Ir, S(I.value.opsCount) + " ops", 1)) : V("", !0),
4755
+ h("span", Fr, S(Ne.value) + " events", 1),
4737
4756
  h("button", {
4738
4757
  class: "szd-btn szd-btn--icon",
4739
4758
  onClick: d[0] || (d[0] = (g) => p.value = !0),
@@ -4761,61 +4780,61 @@ const Er = (n, e) => {
4761
4780
  (A(), $(W, null, ce(s, (g) => h("button", {
4762
4781
  key: g.id,
4763
4782
  class: Mt(["szd-tabs__tab", { "szd-tabs__tab--active": t.value === g.id }]),
4764
- onClick: (K) => t.value = g.id
4765
- }, S(g.label), 11, Ir)), 64))
4783
+ onClick: (z) => t.value = g.id
4784
+ }, S(g.label), 11, zr)), 64))
4766
4785
  ])
4767
4786
  ]),
4768
4787
  h("main", Kr, [
4769
- t.value === "overview" ? (A(), $("div", zr, [
4770
- h("div", Rr, [
4788
+ t.value === "overview" ? (A(), $("div", Rr, [
4789
+ h("div", Nr, [
4771
4790
  d[15] || (d[15] = h("h3", { class: "szd-panel__heading" }, "Why This View?", -1)),
4772
- h("div", Nr, [
4773
- h("div", xr, [
4791
+ h("div", xr, [
4792
+ h("div", jr, [
4774
4793
  d[11] || (d[11] = h("span", { class: "szd-kv__key" }, "Filter:", -1)),
4775
- h("span", jr, S(I.value.filter), 1)
4794
+ h("span", Ur, S(D.value.filter), 1)
4776
4795
  ]),
4777
- h("div", Ur, [
4796
+ h("div", Qr, [
4778
4797
  d[12] || (d[12] = h("span", { class: "szd-kv__key" }, "Order:", -1)),
4779
- h("span", Qr, S(I.value.orderBy), 1)
4798
+ h("span", Vr, S(D.value.orderBy), 1)
4780
4799
  ]),
4781
- h("div", Vr, [
4800
+ h("div", Lr, [
4782
4801
  d[13] || (d[13] = h("span", { class: "szd-kv__key" }, "Limit:", -1)),
4783
- h("span", Lr, S(I.value.limit), 1)
4802
+ h("span", Gr, S(D.value.limit), 1)
4784
4803
  ]),
4785
- h("div", Gr, [
4804
+ h("div", Br, [
4786
4805
  d[14] || (d[14] = h("span", { class: "szd-kv__key" }, "Reason:", -1)),
4787
- h("span", Br, S(F.value.reason), 1)
4806
+ h("span", Hr, S(I.value.reason), 1)
4788
4807
  ])
4789
4808
  ])
4790
4809
  ]),
4791
- h("div", Hr, [
4810
+ h("div", qr, [
4792
4811
  d[21] || (d[21] = h("h3", { class: "szd-panel__heading" }, "Current State", -1)),
4793
- h("div", qr, [
4794
- h("div", Jr, [
4795
- h("div", Wr, S(F.value.optimisticCount ?? "—"), 1),
4812
+ h("div", Jr, [
4813
+ h("div", Wr, [
4814
+ h("div", Zr, S(I.value.optimisticCount ?? "—"), 1),
4796
4815
  d[16] || (d[16] = h("div", { class: "szd-stat__label" }, "Optimistic", -1))
4797
4816
  ]),
4798
- h("div", Zr, [
4799
- h("div", Yr, S(F.value.confirmedCount), 1),
4817
+ h("div", Yr, [
4818
+ h("div", Xr, S(I.value.confirmedCount), 1),
4800
4819
  d[17] || (d[17] = h("div", { class: "szd-stat__label" }, "Confirmed", -1))
4801
4820
  ]),
4802
- h("div", Xr, [
4803
- h("div", en, S(F.value.groundTruthCount), 1),
4821
+ h("div", en, [
4822
+ h("div", tn, S(I.value.groundTruthCount), 1),
4804
4823
  d[18] || (d[18] = h("div", { class: "szd-stat__label" }, "Ground Truth", -1))
4805
4824
  ]),
4806
- h("div", tn, [
4807
- h("div", sn, S(F.value.inFlightCount), 1),
4825
+ h("div", sn, [
4826
+ h("div", rn, S(I.value.inFlightCount), 1),
4808
4827
  d[19] || (d[19] = h("div", { class: "szd-stat__label" }, "In-Flight", -1))
4809
4828
  ])
4810
4829
  ]),
4811
- h("div", rn, [
4812
- h("div", nn, [
4830
+ h("div", nn, [
4831
+ h("div", on, [
4813
4832
  d[20] || (d[20] = h("span", { class: "szd-kv__key" }, "Last Sync:", -1)),
4814
- h("span", on, S(F.value.lastSync), 1)
4833
+ h("span", an, S(I.value.lastSync), 1)
4815
4834
  ])
4816
4835
  ])
4817
4836
  ]),
4818
- ne.value ? (A(), $("div", an, [
4837
+ ne.value ? (A(), $("div", ln, [
4819
4838
  d[22] || (d[22] = h("h3", { class: "szd-panel__heading" }, "Last Event", -1)),
4820
4839
  h("button", {
4821
4840
  class: "szd-event-preview",
@@ -4823,15 +4842,15 @@ const Er = (n, e) => {
4823
4842
  }, [
4824
4843
  h("span", {
4825
4844
  class: "szd-event-preview__badge",
4826
- style: at({ background: xe(ne.value.type) })
4845
+ style: at({ background: je(ne.value.type) })
4827
4846
  }, S(ne.value.type), 5),
4828
- h("span", ln, S(Et(ne.value)), 1),
4829
- h("span", cn, S(et(ne.value.ts)), 1)
4847
+ h("span", cn, S(Et(ne.value)), 1),
4848
+ h("span", dn, S(et(ne.value.ts)), 1)
4830
4849
  ])
4831
4850
  ])) : V("", !0)
4832
4851
  ])) : V("", !0),
4833
- t.value === "timeline" ? (A(), $("div", dn, [
4834
- h("div", un, [
4852
+ t.value === "timeline" ? (A(), $("div", un, [
4853
+ h("div", hn, [
4835
4854
  h("button", {
4836
4855
  class: "szd-btn szd-btn--sm",
4837
4856
  onClick: d[2] || (d[2] = (g) => St(!0))
@@ -4840,57 +4859,57 @@ const Er = (n, e) => {
4840
4859
  class: "szd-btn szd-btn--sm",
4841
4860
  onClick: d[3] || (d[3] = (g) => St(!1))
4842
4861
  }, "None"),
4843
- (A(), $(W, null, ce(Ne, (g) => h("label", {
4862
+ (A(), $(W, null, ce(xe, (g) => h("label", {
4844
4863
  key: g.id,
4845
4864
  class: Mt(["szd-filter-chip", { "szd-filter-chip--active": y.value[g.id] }]),
4846
4865
  style: at(y.value[g.id] ? { background: g.color, borderColor: g.color } : {})
4847
4866
  }, [
4848
- Ue(h("input", {
4867
+ Qe(h("input", {
4849
4868
  type: "checkbox",
4850
- "onUpdate:modelValue": (K) => y.value[g.id] = K,
4869
+ "onUpdate:modelValue": (z) => y.value[g.id] = z,
4851
4870
  class: "szd-filter-chip__input"
4852
- }, null, 8, hn), [
4871
+ }, null, 8, fn), [
4853
4872
  [$t, y.value[g.id]]
4854
4873
  ]),
4855
- Qe(" " + S(g.label), 1)
4874
+ Ve(" " + S(g.label), 1)
4856
4875
  ], 6)), 64))
4857
4876
  ]),
4858
- h("div", fn, [
4877
+ h("div", pn, [
4859
4878
  (A(!0), $(W, null, ce(Ee.value, (g) => (A(), $("div", {
4860
4879
  key: g.id,
4861
4880
  class: "szd-timeline__item",
4862
- onClick: (K) => bt(g)
4881
+ onClick: (z) => bt(g)
4863
4882
  }, [
4864
- h("span", mn, S(et(g.ts)), 1),
4883
+ h("span", yn, S(et(g.ts)), 1),
4865
4884
  h("span", {
4866
4885
  class: "szd-timeline__badge",
4867
- style: at({ background: xe(g.type) })
4886
+ style: at({ background: je(g.type) })
4868
4887
  }, S(g.type), 5),
4869
- h("span", yn, S(Et(g)), 1)
4870
- ], 8, pn))), 128)),
4871
- Ee.value.length ? V("", !0) : (A(), $("div", gn, " No events match current filters "))
4888
+ h("span", gn, S(Et(g)), 1)
4889
+ ], 8, mn))), 128)),
4890
+ Ee.value.length ? V("", !0) : (A(), $("div", _n, " No events match current filters "))
4872
4891
  ])
4873
4892
  ])) : V("", !0),
4874
- t.value === "data" ? (A(), $("div", _n, [
4893
+ t.value === "data" ? (A(), $("div", wn, [
4875
4894
  d[25] || (d[25] = h("h3", { class: "szd-panel__heading" }, "Data Pipeline", -1)),
4876
- h("div", wn, [
4877
- (A(!0), $(W, null, ce(pe.value, (g, K) => (A(), $(W, {
4895
+ h("div", Cn, [
4896
+ (A(!0), $(W, null, ce(me.value, (g, z) => (A(), $(W, {
4878
4897
  key: g.id
4879
4898
  }, [
4880
4899
  h("div", {
4881
4900
  class: "szd-pipeline__stage",
4882
- onClick: (H) => as(g)
4901
+ onClick: (H) => ls(g)
4883
4902
  }, [
4884
- h("div", vn, S(g.label), 1),
4885
- h("div", En, S(g.count), 1)
4886
- ], 8, Cn),
4887
- K < pe.value.length - 1 ? (A(), $("div", bn, "→")) : V("", !0)
4903
+ h("div", En, S(g.label), 1),
4904
+ h("div", bn, S(g.count), 1)
4905
+ ], 8, vn),
4906
+ z < me.value.length - 1 ? (A(), $("div", kn, "→")) : V("", !0)
4888
4907
  ], 64))), 128))
4889
4908
  ]),
4890
- h("div", kn, [
4891
- h("div", Sn, [
4909
+ h("div", Sn, [
4910
+ h("div", Tn, [
4892
4911
  d[24] || (d[24] = h("h3", { class: "szd-panel__heading" }, "Instance Preview", -1)),
4893
- Ue(h("select", {
4912
+ Qe(h("select", {
4894
4913
  "onUpdate:modelValue": d[4] || (d[4] = (g) => m.value = g),
4895
4914
  class: "szd-select"
4896
4915
  }, [
@@ -4898,55 +4917,55 @@ const Er = (n, e) => {
4898
4917
  (A(!0), $(W, null, ce(Ye.value, (g) => (A(), $("option", {
4899
4918
  key: g,
4900
4919
  value: g
4901
- }, S(g), 9, Tn))), 128))
4920
+ }, S(g), 9, Mn))), 128))
4902
4921
  ], 512), [
4903
4922
  [At, m.value]
4904
4923
  ])
4905
4924
  ]),
4906
- m.value != null ? (A(), $("div", Mn, [
4907
- (A(!0), $(W, null, ce(pe.value, (g) => (A(), $("div", {
4925
+ m.value != null ? (A(), $("div", $n, [
4926
+ (A(!0), $(W, null, ce(me.value, (g) => (A(), $("div", {
4908
4927
  key: g.id,
4909
4928
  class: "szd-data-card"
4910
4929
  }, [
4911
- h("div", $n, [
4912
- Qe(S(g.label) + " ", 1),
4913
- g.pks.includes(m.value) ? (A(), $("span", An, "Present")) : (A(), $("span", On, "Absent"))
4930
+ h("div", An, [
4931
+ Ve(S(g.label) + " ", 1),
4932
+ g.pks.includes(m.value) ? (A(), $("span", On, "Present")) : (A(), $("span", Pn, "Absent"))
4914
4933
  ]),
4915
- h("pre", Pn, S(g.pks.includes(m.value) ? JSON.stringify(me(m.value), null, 2) : "—"), 1)
4934
+ h("pre", In, S(g.pks.includes(m.value) ? JSON.stringify(ye(m.value), null, 2) : "—"), 1)
4916
4935
  ]))), 128))
4917
4936
  ])) : (A(), $("div", Fn, "Select an instance to preview"))
4918
4937
  ])
4919
4938
  ])) : V("", !0),
4920
4939
  t.value === "ast" ? (A(), $("div", Dn, [
4921
4940
  d[27] || (d[27] = h("h3", { class: "szd-panel__heading" }, "Query AST", -1)),
4922
- h("div", In, [
4941
+ h("div", zn, [
4923
4942
  h("div", Kn, [
4924
4943
  d[26] || (d[26] = h("span", { class: "szd-kv__key" }, "Semantic Key:", -1)),
4925
- h("code", zn, S(k.value || "—"), 1)
4944
+ h("code", Rn, S(k.value || "—"), 1)
4926
4945
  ])
4927
4946
  ]),
4928
- h("pre", Rn, S(re.value ? JSON.stringify(re.value, null, 2) : "Select a queryset to view AST"), 1)
4947
+ h("pre", Nn, S(re.value ? JSON.stringify(re.value, null, 2) : "Select a queryset to view AST"), 1)
4929
4948
  ])) : V("", !0)
4930
4949
  ]),
4931
4950
  Tt(Ot, { name: "szd-slide" }, {
4932
4951
  default: Pt(() => [
4933
- p.value ? (A(), $("div", Nn, [
4952
+ p.value ? (A(), $("div", xn, [
4934
4953
  h("div", {
4935
4954
  class: "szd-detail__backdrop",
4936
4955
  onClick: d[5] || (d[5] = (g) => p.value = !1)
4937
4956
  }),
4938
- h("div", xn, [
4939
- h("div", jn, [
4957
+ h("div", jn, [
4958
+ h("div", Un, [
4940
4959
  d[28] || (d[28] = h("h3", { class: "szd-detail__title" }, "Debug Settings", -1)),
4941
4960
  h("button", {
4942
4961
  class: "szd-btn",
4943
4962
  onClick: d[6] || (d[6] = (g) => p.value = !1)
4944
4963
  }, "Close")
4945
4964
  ]),
4946
- h("div", Un, [
4947
- h("div", Qn, [
4965
+ h("div", Qn, [
4966
+ h("div", Vn, [
4948
4967
  d[30] || (d[30] = h("label", { class: "szd-settings-label" }, "Queryset", -1)),
4949
- Ue(h("select", {
4968
+ Qe(h("select", {
4950
4969
  "onUpdate:modelValue": d[7] || (d[7] = (g) => r.value = g),
4951
4970
  class: "szd-select szd-select--full"
4952
4971
  }, [
@@ -4954,69 +4973,69 @@ const Er = (n, e) => {
4954
4973
  (A(!0), $(W, null, ce(b.value, (g) => (A(), $("option", {
4955
4974
  key: g.semanticKey,
4956
4975
  value: g.semanticKey
4957
- }, S(g.modelName || "?") + " · " + S(g.semanticKey), 9, Vn))), 128))
4976
+ }, S(g.modelName || "?") + " · " + S(g.semanticKey), 9, Ln))), 128))
4958
4977
  ], 512), [
4959
4978
  [At, r.value]
4960
4979
  ])
4961
4980
  ]),
4962
- k.value ? (A(), $("div", Ln, [
4981
+ k.value ? (A(), $("div", Gn, [
4963
4982
  d[31] || (d[31] = h("label", { class: "szd-settings-label" }, "Semantic Key", -1)),
4964
- h("div", Gn, [
4965
- h("code", Bn, S(k.value), 1),
4983
+ h("div", Bn, [
4984
+ h("code", Hn, S(k.value), 1),
4966
4985
  h("button", {
4967
4986
  class: "szd-btn szd-btn--sm",
4968
- onClick: os
4987
+ onClick: is
4969
4988
  }, "Copy")
4970
4989
  ])
4971
4990
  ])) : V("", !0),
4972
- h("div", Hn, [
4991
+ h("div", qn, [
4973
4992
  d[32] || (d[32] = h("label", { class: "szd-settings-label" }, "Actions", -1)),
4974
- h("div", qn, [
4993
+ h("div", Jn, [
4975
4994
  h("button", {
4976
4995
  class: "szd-btn",
4977
- onClick: is,
4996
+ onClick: as,
4978
4997
  disabled: !N.value || c.value
4979
- }, S(c.value ? "Syncing..." : "Sync Now"), 9, Jn),
4998
+ }, S(c.value ? "Syncing..." : "Sync Now"), 9, Wn),
4980
4999
  h("button", {
4981
5000
  class: "szd-btn",
4982
- onClick: ns
5001
+ onClick: os
4983
5002
  }, "Clear Events")
4984
5003
  ])
4985
5004
  ]),
4986
- h("div", Wn, [
5005
+ h("div", Zn, [
4987
5006
  d[34] || (d[34] = h("label", { class: "szd-settings-label" }, "Options", -1)),
4988
- h("label", Zn, [
4989
- Ue(h("input", {
5007
+ h("label", Yn, [
5008
+ Qe(h("input", {
4990
5009
  type: "checkbox",
4991
5010
  "onUpdate:modelValue": d[8] || (d[8] = (g) => i.value = g)
4992
5011
  }, null, 512), [
4993
5012
  [$t, i.value]
4994
5013
  ]),
4995
- d[33] || (d[33] = Qe(" Live updates ", -1))
5014
+ d[33] || (d[33] = Ve(" Live updates ", -1))
4996
5015
  ])
4997
5016
  ]),
4998
- k.value ? (A(), $("div", Yn, [
5017
+ k.value ? (A(), $("div", Xn, [
4999
5018
  d[40] || (d[40] = h("label", { class: "szd-settings-label" }, "Current State", -1)),
5000
- h("div", Xn, [
5001
- h("div", eo, [
5019
+ h("div", eo, [
5020
+ h("div", to, [
5002
5021
  d[35] || (d[35] = h("span", { class: "szd-kv__key" }, "Model:", -1)),
5003
- h("span", to, S(F.value.modelName || "—"), 1)
5022
+ h("span", so, S(I.value.modelName || "—"), 1)
5004
5023
  ]),
5005
- h("div", so, [
5024
+ h("div", ro, [
5006
5025
  d[36] || (d[36] = h("span", { class: "szd-kv__key" }, "Source:", -1)),
5007
- h("span", ro, S(F.value.source), 1)
5026
+ h("span", no, S(I.value.source), 1)
5008
5027
  ]),
5009
- h("div", no, [
5028
+ h("div", oo, [
5010
5029
  d[37] || (d[37] = h("span", { class: "szd-kv__key" }, "Syncing:", -1)),
5011
- h("span", oo, S(F.value.isSyncing ? "Yes" : "No"), 1)
5030
+ h("span", io, S(I.value.isSyncing ? "Yes" : "No"), 1)
5012
5031
  ]),
5013
- h("div", io, [
5032
+ h("div", ao, [
5014
5033
  d[38] || (d[38] = h("span", { class: "szd-kv__key" }, "Operations:", -1)),
5015
- h("span", ao, S(F.value.opsCount), 1)
5034
+ h("span", lo, S(I.value.opsCount), 1)
5016
5035
  ]),
5017
- h("div", lo, [
5036
+ h("div", co, [
5018
5037
  d[39] || (d[39] = h("span", { class: "szd-kv__key" }, "Last Sync:", -1)),
5019
- h("span", co, S(F.value.lastSync), 1)
5038
+ h("span", uo, S(I.value.lastSync), 1)
5020
5039
  ])
5021
5040
  ])
5022
5041
  ])) : V("", !0)
@@ -5028,48 +5047,48 @@ const Er = (n, e) => {
5028
5047
  }),
5029
5048
  Tt(Ot, { name: "szd-slide" }, {
5030
5049
  default: Pt(() => [
5031
- f.value ? (A(), $("div", uo, [
5050
+ f.value ? (A(), $("div", ho, [
5032
5051
  h("div", {
5033
5052
  class: "szd-detail__backdrop",
5034
5053
  onClick: kt
5035
5054
  }),
5036
- h("div", ho, [
5037
- h("div", fo, [
5038
- h("h3", po, S(f.value.type === "entry" ? "Event Detail" : "Snapshot: " + f.value.data.label), 1),
5055
+ h("div", fo, [
5056
+ h("div", po, [
5057
+ h("h3", mo, S(f.value.type === "entry" ? "Event Detail" : "Snapshot: " + f.value.data.label), 1),
5039
5058
  h("button", {
5040
5059
  class: "szd-btn",
5041
5060
  onClick: kt
5042
5061
  }, "Close")
5043
5062
  ]),
5044
- h("div", mo, [
5063
+ h("div", yo, [
5045
5064
  f.value.type === "entry" ? (A(), $(W, { key: 0 }, [
5046
- h("div", yo, [
5047
- (A(!0), $(W, null, ce(rs(f.value.data), (g, K) => (A(), $("div", {
5048
- key: K,
5065
+ h("div", go, [
5066
+ (A(!0), $(W, null, ce(ns(f.value.data), (g, z) => (A(), $("div", {
5067
+ key: z,
5049
5068
  class: "szd-kv__row"
5050
5069
  }, [
5051
- h("span", go, S(K) + ":", 1),
5052
- h("span", _o, S(g ?? "—"), 1)
5070
+ h("span", _o, S(z) + ":", 1),
5071
+ h("span", wo, S(g ?? "—"), 1)
5053
5072
  ]))), 128))
5054
5073
  ]),
5055
5074
  d[41] || (d[41] = h("h4", { style: { margin: "16px 0 8px" } }, "Raw JSON", -1)),
5056
- h("pre", wo, S(JSON.stringify(f.value.data, null, 2)), 1)
5075
+ h("pre", Co, S(JSON.stringify(f.value.data, null, 2)), 1)
5057
5076
  ], 64)) : (A(), $(W, { key: 1 }, [
5058
- h("div", Co, [
5059
- h("div", vo, [
5077
+ h("div", vo, [
5078
+ h("div", Eo, [
5060
5079
  d[42] || (d[42] = h("span", { class: "szd-kv__key" }, "Total Count:", -1)),
5061
- h("span", Eo, S(f.value.data.count), 1)
5080
+ h("span", bo, S(f.value.data.count), 1)
5062
5081
  ]),
5063
- h("div", bo, [
5082
+ h("div", ko, [
5064
5083
  d[43] || (d[43] = h("span", { class: "szd-kv__key" }, "Showing:", -1)),
5065
- h("span", ko, [
5066
- Qe(S(Ke.value.length) + " items ", 1),
5067
- Xe.value ? (A(), $("span", So, "(limited to first 100)")) : V("", !0)
5084
+ h("span", So, [
5085
+ Ve(S(Ke.value.length) + " items ", 1),
5086
+ Xe.value ? (A(), $("span", To, "(limited to first 100)")) : V("", !0)
5068
5087
  ])
5069
5088
  ])
5070
5089
  ]),
5071
5090
  d[44] || (d[44] = h("h4", { style: { margin: "0 0 8px" } }, "Data", -1)),
5072
- h("pre", To, S(JSON.stringify(Ke.value, null, 2)), 1)
5091
+ h("pre", Mo, S(JSON.stringify(Ke.value, null, 2)), 1)
5073
5092
  ], 64))
5074
5093
  ])
5075
5094
  ])
@@ -5079,7 +5098,7 @@ const Er = (n, e) => {
5079
5098
  })
5080
5099
  ]));
5081
5100
  }
5082
- }, Lo = /* @__PURE__ */ Er(Mo, [["__scopeId", "data-v-6d80920c"]]);
5101
+ }, Go = /* @__PURE__ */ br($o, [["__scopeId", "data-v-6d80920c"]]);
5083
5102
  export {
5084
- Lo as default
5103
+ Go as default
5085
5104
  };