@neetru/sdk 3.8.1 → 3.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +4 -1
  3. package/dist/ai.cjs +1 -1
  4. package/dist/ai.d.cts +1 -1
  5. package/dist/ai.d.ts +1 -1
  6. package/dist/ai.mjs +1 -1
  7. package/dist/auth.cjs +844 -803
  8. package/dist/auth.d.cts +1 -1
  9. package/dist/auth.d.ts +1 -1
  10. package/dist/auth.mjs +841 -800
  11. package/dist/catalog.cjs +1 -1
  12. package/dist/catalog.d.cts +1 -1
  13. package/dist/catalog.d.ts +1 -1
  14. package/dist/catalog.mjs +1 -1
  15. package/dist/checkout.cjs +62 -49
  16. package/dist/checkout.d.cts +1 -1
  17. package/dist/checkout.d.ts +1 -1
  18. package/dist/checkout.mjs +62 -49
  19. package/dist/db-react.d.cts +1 -1
  20. package/dist/db-react.d.ts +1 -1
  21. package/dist/db.cjs +200 -187
  22. package/dist/db.d.cts +1 -1
  23. package/dist/db.d.ts +1 -1
  24. package/dist/db.mjs +193 -180
  25. package/dist/entitlements.d.cts +1 -1
  26. package/dist/entitlements.d.ts +1 -1
  27. package/dist/firestore-compat.d.cts +1 -1
  28. package/dist/firestore-compat.d.ts +1 -1
  29. package/dist/index.cjs +880 -839
  30. package/dist/index.d.cts +2 -2
  31. package/dist/index.d.ts +2 -2
  32. package/dist/index.mjs +847 -806
  33. package/dist/mobile.cjs +328 -276
  34. package/dist/mobile.d.cts +12 -2
  35. package/dist/mobile.d.ts +12 -2
  36. package/dist/mobile.mjs +328 -276
  37. package/dist/mocks.cjs +5 -5
  38. package/dist/mocks.d.cts +2 -2
  39. package/dist/mocks.d.ts +2 -2
  40. package/dist/mocks.mjs +4 -4
  41. package/dist/notifications.cjs +1 -1
  42. package/dist/notifications.d.cts +1 -1
  43. package/dist/notifications.d.ts +1 -1
  44. package/dist/notifications.mjs +1 -1
  45. package/dist/react.cjs +119 -119
  46. package/dist/react.d.cts +8 -2
  47. package/dist/react.d.ts +8 -2
  48. package/dist/react.mjs +119 -119
  49. package/dist/support.cjs +1 -1
  50. package/dist/support.d.cts +1 -1
  51. package/dist/support.d.ts +1 -1
  52. package/dist/support.mjs +1 -1
  53. package/dist/telemetry.cjs +62 -49
  54. package/dist/telemetry.d.cts +1 -1
  55. package/dist/telemetry.d.ts +1 -1
  56. package/dist/telemetry.mjs +62 -49
  57. package/dist/{types-yv3EDKg2.d.cts → types-Bl_4HROd.d.cts} +62 -3
  58. package/dist/{types-BYPk_3HR.d.ts → types-Bqnsqvow.d.ts} +62 -3
  59. package/dist/usage.cjs +1 -1
  60. package/dist/usage.d.cts +1 -1
  61. package/dist/usage.d.ts +1 -1
  62. package/dist/usage.mjs +1 -1
  63. package/dist/webhooks.cjs +1 -1
  64. package/dist/webhooks.d.cts +1 -1
  65. package/dist/webhooks.d.ts +1 -1
  66. package/dist/webhooks.mjs +1 -1
  67. package/package.json +9 -1
package/dist/react.mjs CHANGED
@@ -23,13 +23,13 @@ var E = class e extends Error {
23
23
  * `undefined` em erros que acontecem antes de qualquer requisição.
24
24
  */
25
25
  correlationId;
26
- constructor(t, i, n, s, c, o) {
27
- super(i), this.name = "NeetruError", this.code = t, this.status = n, this.requestId = s, this.reason = c, this.correlationId = o, Object.setPrototypeOf(this, e.prototype);
26
+ constructor(t, i, n, a, c, o) {
27
+ super(i), this.name = "NeetruError", this.code = t, this.status = n, this.requestId = a, this.reason = c, this.correlationId = o, Object.setPrototypeOf(this, e.prototype);
28
28
  }
29
29
  };
30
30
 
31
31
  // src/types.ts
32
- var O = "https://api.neetru.com";
32
+ var F = "https://api.neetru.com";
33
33
 
34
34
  // src/end-user-token.ts
35
35
  var ee = /* @__PURE__ */ new WeakMap();
@@ -59,9 +59,9 @@ var y = l.createElement, ne = {
59
59
  async function W(e) {
60
60
  let t = await M(e);
61
61
  if (!t) return null;
62
- let i = e.config, n = (i.baseUrl ?? O).replace(/\/+$/, ""), s = i.fetch ?? globalThis.fetch, c = `${n}/api/sdk/v1/account/bar`;
62
+ let i = e.config, n = (i.baseUrl ?? F).replace(/\/+$/, ""), a = i.fetch ?? globalThis.fetch, c = `${n}/api/sdk/v1/account/bar`;
63
63
  try {
64
- let o = await s(c, {
64
+ let o = await a(c, {
65
65
  headers: { authorization: `Bearer ${t}`, accept: "application/json" }
66
66
  });
67
67
  if (!o.ok) return null;
@@ -96,17 +96,17 @@ var h = {
96
96
  borderSoft: "#e5e5e5"
97
97
  }, H = 0;
98
98
  function re({ size: e = 18, color: t = h.fg }) {
99
- let i = [0, 1, 2].flatMap((c) => [0, 1, 2].map((o) => ({ r: c, c: o }))), n = e / 3, s = Math.max(2, e / 7);
99
+ let i = [0, 1, 2].flatMap((c) => [0, 1, 2].map((o) => ({ r: c, c: o }))), n = e / 3, a = Math.max(2, e / 7);
100
100
  return y(
101
101
  "svg",
102
102
  { width: e, height: e, viewBox: `0 0 ${e} ${e}`, "aria-hidden": true, style: { display: "block" } },
103
103
  i.map(
104
104
  ({ r: c, c: o }) => y("rect", {
105
105
  key: `${c}-${o}`,
106
- x: o * n + (n - s) / 2,
107
- y: c * n + (n - s) / 2,
108
- width: s,
109
- height: s,
106
+ x: o * n + (n - a) / 2,
107
+ y: c * n + (n - a) / 2,
108
+ width: a,
109
+ height: a,
110
110
  fill: t
111
111
  })
112
112
  )
@@ -124,63 +124,63 @@ function oe({
124
124
  currentProductSlug: t,
125
125
  settingsUrl: i,
126
126
  onSignOut: n,
127
- fetchBar: s,
127
+ fetchBar: a,
128
128
  labels: c,
129
129
  className: o
130
130
  }) {
131
131
  let r = { ...ne, ...c }, b = l.useMemo(() => {
132
132
  try {
133
- let a = e.auth.getUser();
134
- return a ? {
135
- displayName: a.displayName || a.email || "",
136
- email: a.email || "",
137
- photoUrl: a.photoURL ?? null
133
+ let s = e.auth.getUser();
134
+ return s ? {
135
+ displayName: s.displayName || s.email || "",
136
+ email: s.email || "",
137
+ photoUrl: s.photoURL ?? null
138
138
  } : null;
139
139
  } catch {
140
140
  return null;
141
141
  }
142
- }, [e]), [u, f] = l.useState(null), [m, w] = l.useState(null), [T, R] = l.useState(false), p = l.useRef(null), d = l.useRef(null), g = l.useRef(null), C = l.useRef(null);
142
+ }, [e]), [u, f] = l.useState(null), [m, x] = l.useState(null), [T, R] = l.useState(false), p = l.useRef(null), d = l.useRef(null), g = l.useRef(null), S = l.useRef(null);
143
143
  l.useEffect(() => {
144
- let a = false, k = s ?? W;
145
- return Promise.resolve(k(e)).then((S) => {
146
- !a && S && f(S);
144
+ let s = false, k = a ?? W;
145
+ return Promise.resolve(k(e)).then((C) => {
146
+ !s && C && f(C);
147
147
  }).catch(() => {
148
148
  }), () => {
149
- a = true;
149
+ s = true;
150
150
  };
151
- }, [e, s]);
152
- let v = u?.account ?? b, G = u?.accountUrl ?? "https://minhaconta.neetru.com", A = u?.products ?? [], L = l.useCallback((a) => {
153
- w(null), (a === "apps" ? g.current : d.current)?.focus();
151
+ }, [e, a]);
152
+ let v = u?.account ?? b, G = u?.accountUrl ?? "https://minhaconta.neetru.com", A = u?.products ?? [], L = l.useCallback((s) => {
153
+ x(null), (s === "apps" ? g.current : d.current)?.focus();
154
154
  }, []);
155
155
  l.useEffect(() => {
156
156
  if (!m) return;
157
- Q(C.current)[0]?.focus();
158
- let k = (S) => {
159
- p.current && !p.current.contains(S.target) && w(null);
157
+ Q(S.current)[0]?.focus();
158
+ let k = (C) => {
159
+ p.current && !p.current.contains(C.target) && x(null);
160
160
  };
161
161
  return document.addEventListener("mousedown", k), () => document.removeEventListener("mousedown", k);
162
162
  }, [m]);
163
163
  let P = l.useCallback(
164
- (a) => {
165
- if (a.key === "Escape") {
166
- a.stopPropagation(), L(m);
164
+ (s) => {
165
+ if (s.key === "Escape") {
166
+ s.stopPropagation(), L(m);
167
167
  return;
168
168
  }
169
- let k = Q(C.current);
169
+ let k = Q(S.current);
170
170
  if (k.length === 0) return;
171
- let S = k.indexOf(document.activeElement);
172
- a.key === "Tab" ? a.shiftKey && S <= 0 ? (a.preventDefault(), k[k.length - 1].focus()) : !a.shiftKey && S === k.length - 1 && (a.preventDefault(), k[0].focus()) : a.key === "ArrowDown" ? (a.preventDefault(), k[(S + 1) % k.length].focus()) : a.key === "ArrowUp" && (a.preventDefault(), k[(S - 1 + k.length) % k.length].focus());
171
+ let C = k.indexOf(document.activeElement);
172
+ s.key === "Tab" ? s.shiftKey && C <= 0 ? (s.preventDefault(), k[k.length - 1].focus()) : !s.shiftKey && C === k.length - 1 && (s.preventDefault(), k[0].focus()) : s.key === "ArrowDown" ? (s.preventDefault(), k[(C + 1) % k.length].focus()) : s.key === "ArrowUp" && (s.preventDefault(), k[(C - 1 + k.length) % k.length].focus());
173
173
  },
174
174
  [m, L]
175
175
  ), K = l.useCallback(async () => {
176
- if (!T) {
177
- R(true);
178
- try {
179
- await e.auth.signOut();
180
- } catch {
181
- } finally {
182
- R(false), w(null), n?.();
183
- }
176
+ if (T) return;
177
+ R(true);
178
+ let s;
179
+ try {
180
+ s = await e.auth.signOut();
181
+ } catch {
182
+ } finally {
183
+ R(false), x(null), n?.(s);
184
184
  }
185
185
  }, [e, T, n]);
186
186
  if (!v) return null;
@@ -208,7 +208,7 @@ function oe({
208
208
  }
209
209
  },
210
210
  I
211
- ), B = (a) => ({
211
+ ), B = (s) => ({
212
212
  display: "inline-flex",
213
213
  alignItems: "center",
214
214
  justifyContent: "center",
@@ -216,8 +216,8 @@ function oe({
216
216
  height: 36,
217
217
  padding: 0,
218
218
  borderRadius: H,
219
- border: `1px solid ${a ? h.border : h.borderSoft}`,
220
- backgroundColor: a ? h.bgHover : h.bg,
219
+ border: `1px solid ${s ? h.border : h.borderSoft}`,
220
+ backgroundColor: s ? h.bgHover : h.bg,
221
221
  color: h.fg,
222
222
  cursor: "pointer",
223
223
  boxSizing: "border-box",
@@ -232,7 +232,7 @@ function oe({
232
232
  "aria-haspopup": "menu",
233
233
  "aria-expanded": m === "apps",
234
234
  "data-neetru-appswitcher-button": "true",
235
- onClick: () => w((a) => a === "apps" ? null : "apps"),
235
+ onClick: () => x((s) => s === "apps" ? null : "apps"),
236
236
  style: B(m === "apps")
237
237
  },
238
238
  y(re, {})
@@ -245,11 +245,11 @@ function oe({
245
245
  "aria-haspopup": "menu",
246
246
  "aria-expanded": m === "account",
247
247
  "data-neetru-account-button": "true",
248
- onClick: () => w((a) => a === "account" ? null : "account"),
248
+ onClick: () => x((s) => s === "account" ? null : "account"),
249
249
  style: { ...B(m === "account"), width: 36, height: 36 }
250
250
  },
251
251
  V
252
- ), F = {
252
+ ), O = {
253
253
  position: "absolute",
254
254
  top: "calc(100% + 6px)",
255
255
  right: 0,
@@ -280,21 +280,21 @@ function oe({
280
280
  boxSizing: "border-box",
281
281
  fontFamily: "inherit"
282
282
  }, _ = {
283
- onMouseEnter: (a) => {
284
- a.currentTarget.style.backgroundColor = h.bgHover;
283
+ onMouseEnter: (s) => {
284
+ s.currentTarget.style.backgroundColor = h.bgHover;
285
285
  },
286
- onMouseLeave: (a) => {
287
- a.currentTarget.style.backgroundColor = "transparent";
286
+ onMouseLeave: (s) => {
287
+ s.currentTarget.style.backgroundColor = "transparent";
288
288
  }
289
289
  }, Y = m === "account" ? y(
290
290
  "div",
291
291
  {
292
- ref: C,
292
+ ref: S,
293
293
  role: "menu",
294
294
  "aria-label": r.accountButton,
295
295
  "data-neetru-account-menu": "true",
296
296
  onKeyDown: P,
297
- style: F
297
+ style: O
298
298
  },
299
299
  // Header identidade
300
300
  y(
@@ -393,12 +393,12 @@ function oe({
393
393
  ) : null, Z = m === "apps" ? y(
394
394
  "div",
395
395
  {
396
- ref: C,
396
+ ref: S,
397
397
  role: "menu",
398
398
  "aria-label": r.appsTitle,
399
399
  "data-neetru-appswitcher-menu": "true",
400
400
  onKeyDown: P,
401
- style: { ...F, minWidth: 280 }
401
+ style: { ...O, minWidth: 280 }
402
402
  },
403
403
  y(
404
404
  "div",
@@ -429,18 +429,18 @@ function oe({
429
429
  backgroundColor: h.borderSoft
430
430
  }
431
431
  },
432
- A.map((a) => {
433
- let k = !!t && a.slug === t;
432
+ A.map((s) => {
433
+ let k = !!t && s.slug === t;
434
434
  return y(
435
435
  "a",
436
436
  {
437
- key: a.slug,
437
+ key: s.slug,
438
438
  role: "menuitem",
439
- href: a.url,
439
+ href: s.url,
440
440
  "aria-current": k ? "true" : void 0,
441
- "data-neetru-product": a.slug,
441
+ "data-neetru-product": s.slug,
442
442
  "data-current": k ? "true" : void 0,
443
- title: a.name,
443
+ title: s.name,
444
444
  style: {
445
445
  display: "flex",
446
446
  flexDirection: "column",
@@ -453,16 +453,16 @@ function oe({
453
453
  cursor: "pointer",
454
454
  boxSizing: "border-box"
455
455
  },
456
- onMouseEnter: (S) => {
457
- S.currentTarget.style.backgroundColor = h.bgHover;
456
+ onMouseEnter: (C) => {
457
+ C.currentTarget.style.backgroundColor = h.bgHover;
458
458
  },
459
- onMouseLeave: (S) => {
460
- S.currentTarget.style.backgroundColor = k ? h.bgHover : h.bg;
459
+ onMouseLeave: (C) => {
460
+ C.currentTarget.style.backgroundColor = k ? h.bgHover : h.bg;
461
461
  }
462
462
  },
463
463
  // Tile/ícone
464
- a.iconUrl ? y("img", {
465
- src: a.iconUrl,
464
+ s.iconUrl ? y("img", {
465
+ src: s.iconUrl,
466
466
  alt: "",
467
467
  width: 32,
468
468
  height: 32,
@@ -483,7 +483,7 @@ function oe({
483
483
  fontWeight: 700
484
484
  }
485
485
  },
486
- N(a.name)
486
+ N(s.name)
487
487
  ),
488
488
  y(
489
489
  "span",
@@ -500,7 +500,7 @@ function oe({
500
500
  width: "100%"
501
501
  }
502
502
  },
503
- a.name
503
+ s.name
504
504
  ),
505
505
  k ? y(
506
506
  "span",
@@ -553,8 +553,8 @@ function U(e) {
553
553
  let o = c;
554
554
  i = { field: o.field, direction: o.direction };
555
555
  } else c.__constraint === "limit" && (n = c.value);
556
- let s = {};
557
- return t.length > 0 && (s.where = t), i && (s.orderBy = i), n !== void 0 && (s.limit = n), s;
556
+ let a = {};
557
+ return t.length > 0 && (a.where = t), i && (a.orderBy = i), n !== void 0 && (a.limit = n), a;
558
558
  }
559
559
 
560
560
  // src/react.ts
@@ -578,18 +578,18 @@ async function ie(e, t) {
578
578
  i.status
579
579
  );
580
580
  }
581
- let s = n?.intent ?? n ?? {}, c = n?.redirectUrl ?? s.redirectUrl;
581
+ let a = n?.intent ?? n ?? {}, c = n?.redirectUrl ?? a.redirectUrl;
582
582
  if (!c || typeof c != "string")
583
583
  throw new E(
584
584
  "invalid_response",
585
585
  "Resposta do route BFF de checkout sem `redirectUrl`."
586
586
  );
587
587
  return {
588
- intentId: String(n?.intentId ?? s.intentId ?? ""),
588
+ intentId: String(n?.intentId ?? a.intentId ?? ""),
589
589
  redirectUrl: c,
590
- status: n?.status ?? s.status ?? "pending",
591
- expiresAt: typeof n?.expiresAt == "string" ? n.expiresAt : typeof s.expiresAt == "string" ? s.expiresAt : "",
592
- requiresKyc: n?.requiresKyc === true || s.requiresKyc === true
590
+ status: n?.status ?? a.status ?? "pending",
591
+ expiresAt: typeof n?.expiresAt == "string" ? n.expiresAt : typeof a.expiresAt == "string" ? a.expiresAt : "",
592
+ requiresKyc: n?.requiresKyc === true || a.requiresKyc === true
593
593
  };
594
594
  }
595
595
  function se(e) {
@@ -601,7 +601,7 @@ function Ee({
601
601
  startPath: t,
602
602
  productId: i,
603
603
  planId: n,
604
- callbackUrl: s,
604
+ callbackUrl: a,
605
605
  tenantType: c,
606
606
  tenantId: o,
607
607
  children: r,
@@ -610,16 +610,16 @@ function Ee({
610
610
  noAutoRedirect: f,
611
611
  ...m
612
612
  }) {
613
- let [w, T] = l.useState(false), R = e?.checkout, p = l.useCallback(
613
+ let [x, T] = l.useState(false), R = e?.checkout, p = l.useCallback(
614
614
  async (d) => {
615
- if (d.preventDefault(), !w) {
615
+ if (d.preventDefault(), !x) {
616
616
  if (t) {
617
617
  T(true);
618
618
  try {
619
619
  let g = await ie(t, {
620
620
  productId: i,
621
621
  planId: n,
622
- callbackUrl: s,
622
+ callbackUrl: a,
623
623
  tenantType: c,
624
624
  tenantId: o
625
625
  });
@@ -644,7 +644,7 @@ function Ee({
644
644
  let g = await R.start({
645
645
  productId: i,
646
646
  planId: n,
647
- callbackUrl: s,
647
+ callbackUrl: a,
648
648
  tenantType: c,
649
649
  tenantId: o,
650
650
  autoRedirect: !f
@@ -657,7 +657,7 @@ function Ee({
657
657
  }
658
658
  }
659
659
  },
660
- [w, R, t, i, n, s, c, o, f, b, u]
660
+ [x, R, t, i, n, a, c, o, f, b, u]
661
661
  );
662
662
  return l.createElement(
663
663
  "a",
@@ -665,7 +665,7 @@ function Ee({
665
665
  ...m,
666
666
  href: m.href ?? "#",
667
667
  onClick: p,
668
- "aria-busy": w || void 0,
668
+ "aria-busy": x || void 0,
669
669
  "data-neetru-checkout-link": "true"
670
670
  },
671
671
  r
@@ -699,14 +699,14 @@ function De({
699
699
  redirectUri: t,
700
700
  scope: i,
701
701
  postLoginRedirect: n,
702
- theme: s = "dark",
702
+ theme: a = "dark",
703
703
  label: c = "Entrar com Neetru",
704
704
  onError: o,
705
705
  style: r,
706
706
  disabled: b,
707
707
  ...u
708
708
  }) {
709
- let [f, m] = l.useState(false), [w, T] = l.useState(false), R = de[s], p = !!b || f;
709
+ let [f, m] = l.useState(false), [x, T] = l.useState(false), R = de[a], p = !!b || f;
710
710
  l.useEffect(() => {
711
711
  ge();
712
712
  }, []);
@@ -745,7 +745,7 @@ function De({
745
745
  padding: "0 20px",
746
746
  borderRadius: 0,
747
747
  border: `1px solid ${R.border}`,
748
- backgroundColor: w && !p ? R.bgHover : R.bg,
748
+ backgroundColor: x && !p ? R.bgHover : R.bg,
749
749
  color: R.fg,
750
750
  fontSize: "14px",
751
751
  fontWeight: 700,
@@ -778,7 +778,7 @@ function Ne({
778
778
  feature: t,
779
779
  productSlug: i,
780
780
  mode: n = "block",
781
- fallback: s,
781
+ fallback: a,
782
782
  loading: c,
783
783
  children: o
784
784
  }) {
@@ -791,16 +791,16 @@ function Ne({
791
791
  try {
792
792
  let d, g = e.usage;
793
793
  if (g && typeof g.check == "function" && f) {
794
- let C = await g.check(t, {
794
+ let S = await g.check(t, {
795
795
  productId: u,
796
796
  tenantId: f
797
797
  });
798
798
  d = {
799
- allowed: C.allowed === !0,
800
- reason: C.reason,
801
- limit: C.limit,
802
- currentUsage: C.currentUsage,
803
- behavior: C.behavior
799
+ allowed: S.allowed === !0,
800
+ reason: S.reason,
801
+ limit: S.limit,
802
+ currentUsage: S.currentUsage,
803
+ behavior: S.behavior
804
804
  };
805
805
  } else
806
806
  typeof console < "u" && console.warn(
@@ -815,8 +815,8 @@ function Ne({
815
815
  };
816
816
  }, [e, t, u, f]), r.status === "loading")
817
817
  return l.createElement(l.Fragment, null, c ?? null);
818
- let m = r.result, w = m?.allowed === true, T = !w && (n === "readonly" || m?.behavior === "readonly");
819
- return !w && n === "block" && !T ? l.createElement(l.Fragment, null, s ?? null) : l.createElement(
818
+ let m = r.result, x = m?.allowed === true, T = !x && (n === "readonly" || m?.behavior === "readonly");
819
+ return !x && n === "block" && !T ? l.createElement(l.Fragment, null, a ?? null) : l.createElement(
820
820
  $.Provider,
821
821
  {
822
822
  value: {
@@ -842,22 +842,22 @@ function fe(e) {
842
842
  }
843
843
  function me(e) {
844
844
  return e.docs.map((t) => {
845
- let i = t.data, { id: n, ...s } = i;
846
- return { ...s, id: t.id };
845
+ let i = t.data, { id: n, ...a } = i;
846
+ return { ...a, id: t.id };
847
847
  });
848
848
  }
849
849
  function ye(e, t) {
850
850
  let i = e?.docs[0];
851
851
  if (!i) return null;
852
- let n = i.data, { id: s, ...c } = n;
852
+ let n = i.data, { id: a, ...c } = n;
853
853
  return { ...c, id: t };
854
854
  }
855
855
  function Ue(e, t) {
856
- let i = t?.intervalMs ?? q, n = t?.poll ?? false, s = fe(
856
+ let i = t?.intervalMs ?? q, n = t?.poll ?? false, a = fe(
857
857
  e
858
858
  ), [c, o] = l.useState({
859
859
  data: null,
860
- isLoading: s !== null,
860
+ isLoading: a !== null,
861
861
  error: null,
862
862
  isStale: false,
863
863
  lastUpdated: null
@@ -865,12 +865,12 @@ function Ue(e, t) {
865
865
  return b.current = e, l.useEffect(() => {
866
866
  r.current = true;
867
867
  let u = b.current;
868
- if (!u || s === null)
868
+ if (!u || a === null)
869
869
  return o({ data: null, isLoading: false, error: null, isStale: false, lastUpdated: null }), () => {
870
870
  r.current = false;
871
871
  };
872
872
  o((d) => ({ ...d, isLoading: d.data === null }));
873
- let f = u.__kind === "query" ? u.collection : u.id, m = u.__kind === "query" ? U(u.constraints) : void 0, w = u.db.collection(f), T = (d) => {
873
+ let f = u.__kind === "query" ? u.collection : u.id, m = u.__kind === "query" ? U(u.constraints) : void 0, x = u.db.collection(f), T = (d) => {
874
874
  r.current && o({
875
875
  data: me(d),
876
876
  isLoading: false,
@@ -891,33 +891,33 @@ function Ue(e, t) {
891
891
  let d = false, g = async () => {
892
892
  if (!(d || z()))
893
893
  try {
894
- let v = await w.list(m);
894
+ let v = await x.list(m);
895
895
  d || T(v);
896
896
  } catch (v) {
897
897
  d || R(v);
898
898
  }
899
899
  };
900
900
  g();
901
- let C = setInterval(g, i);
901
+ let S = setInterval(g, i);
902
902
  return () => {
903
- d = true, clearInterval(C), r.current = false;
903
+ d = true, clearInterval(S), r.current = false;
904
904
  };
905
905
  }
906
906
  let p;
907
907
  try {
908
- p = w.onSnapshot(m, T);
908
+ p = x.onSnapshot(m, T);
909
909
  } catch (d) {
910
910
  R(d);
911
911
  }
912
912
  return () => {
913
913
  r.current = false, p?.();
914
914
  };
915
- }, [s, i, n]), c;
915
+ }, [a, i, n]), c;
916
916
  }
917
917
  function Ae(e, t) {
918
- let i = t?.intervalMs ?? q, n = t?.poll ?? false, s = e && e.id ? `${e.collection}/${e.id}` : null, [c, o] = l.useState({
918
+ let i = t?.intervalMs ?? q, n = t?.poll ?? false, a = e && e.id ? `${e.collection}/${e.id}` : null, [c, o] = l.useState({
919
919
  data: null,
920
- isLoading: s !== null,
920
+ isLoading: a !== null,
921
921
  error: null,
922
922
  isStale: false,
923
923
  lastUpdated: null
@@ -925,12 +925,12 @@ function Ae(e, t) {
925
925
  return b.current = e, l.useEffect(() => {
926
926
  r.current = true;
927
927
  let u = b.current;
928
- if (!u || s === null)
928
+ if (!u || a === null)
929
929
  return o({ data: null, isLoading: false, error: null, isStale: false, lastUpdated: null }), () => {
930
930
  r.current = false;
931
931
  };
932
932
  o((p) => ({ ...p, isLoading: p.data === null }));
933
- let f = u.db.collection(u.collection).doc(u.id), m = u.id, w = (p) => {
933
+ let f = u.db.collection(u.collection).doc(u.id), m = u.id, x = (p) => {
934
934
  r.current && o({
935
935
  data: ye(p, m),
936
936
  isLoading: false,
@@ -950,10 +950,10 @@ function Ae(e, t) {
950
950
  let p = false, d = async () => {
951
951
  if (!(p || z()))
952
952
  try {
953
- let C = await f.get();
954
- p || w(C);
955
- } catch (C) {
956
- p || T(C);
953
+ let S = await f.get();
954
+ p || x(S);
955
+ } catch (S) {
956
+ p || T(S);
957
957
  }
958
958
  };
959
959
  d();
@@ -964,21 +964,21 @@ function Ae(e, t) {
964
964
  }
965
965
  let R;
966
966
  try {
967
- R = f.onSnapshot(w);
967
+ R = f.onSnapshot(x);
968
968
  } catch (p) {
969
969
  T(p);
970
970
  }
971
971
  return () => {
972
972
  r.current = false, R?.();
973
973
  };
974
- }, [s, i, n]), c;
974
+ }, [a, i, n]), c;
975
975
  }
976
976
  function he(e) {
977
977
  let t = e;
978
978
  return t.auth && typeof t.auth.onAuthStateChanged == "function" ? t.auth : e;
979
979
  }
980
980
  function Le(e, t) {
981
- let i = t?.timeoutMs ?? 8e3, n = he(e), [s, c] = l.useState(() => {
981
+ let i = t?.timeoutMs ?? 8e3, n = he(e), [a, c] = l.useState(() => {
982
982
  let r = null;
983
983
  try {
984
984
  r = n.getUser();
@@ -1006,7 +1006,7 @@ function Le(e, t) {
1006
1006
  return () => {
1007
1007
  o.current = false, clearTimeout(b), u?.();
1008
1008
  };
1009
- }, [n, i]), s;
1009
+ }, [n, i]), a;
1010
1010
  }
1011
1011
 
1012
1012
  export { Ee as CheckoutLink, Ne as EntitlementGate, oe as NeetruAccountBar, De as NeetruLoginButton, W as fetchNeetruAccountBar, N as initialsFrom, Ue as useCollection, Ae as useDoc, _e as useEntitlementContext, Le as useUser };
package/dist/support.cjs CHANGED
@@ -112,7 +112,7 @@ function Q(e, t) {
112
112
  }
113
113
  function $() {
114
114
  try {
115
- return "3.8.1";
115
+ return "3.9.0";
116
116
  } catch {
117
117
  return;
118
118
  }
@@ -1,4 +1,4 @@
1
- import { ah as ResolvedConfig, am as SupportNamespace } from './types-yv3EDKg2.cjs';
1
+ import { ai as ResolvedConfig, ao as SupportNamespace } from './types-Bl_4HROd.cjs';
2
2
  import 'drizzle-orm/node-postgres';
3
3
  import './errors.cjs';
4
4
 
package/dist/support.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ah as ResolvedConfig, am as SupportNamespace } from './types-BYPk_3HR.js';
1
+ import { ai as ResolvedConfig, ao as SupportNamespace } from './types-Bqnsqvow.js';
2
2
  import 'drizzle-orm/node-postgres';
3
3
  import './errors.js';
4
4
 
package/dist/support.mjs CHANGED
@@ -110,7 +110,7 @@ function Q(e, t) {
110
110
  }
111
111
  function $() {
112
112
  try {
113
- return "3.8.1";
113
+ return "3.9.0";
114
114
  } catch {
115
115
  return;
116
116
  }