@burdenoff/microfe-store 2026.626.1 → 2026.626.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,14 @@
1
1
  import { useStore as e } from "../providers/StoreProvider.js";
2
2
  import { useStoreGraphQLWithContext as t } from "./useStoreGraphQLWithContext.js";
3
- import { BrowseStoreDocument as n, CategoriesDocument as r, CheckEntitlementDocument as i, CreateReviewDocument as a, DeleteReviewDocument as o, DeveloperEarningsDocument as s, FeaturedProductsDocument as c, FilterOptionsDocument as l, HomeGroupedProductsDocument as u, MarkReviewHelpfulDocument as d, MyEntitlementsDocument as f, MyPublishedProductsDocument as p, ProductReviewsDocument as m, SearchSuggestionsDocument as h, StoreProductDetailsDocument as g, TrendingSearchesDocument as _, UpdateReviewDocument as v, UserReviewForProductDocument as y, WorkspaceStoreOrdersDocument as b } from "../generated/global-operations.js";
4
- import { useCallback as x, useEffect as S, useMemo as C, useRef as w, useState as T } from "react";
5
- import { useApolloClient as E } from "@apollo/client/react";
3
+ import { BrowseStoreDocument as n, CategoriesDocument as r, CheckEntitlementDocument as i, CreateReviewDocument as a, DeleteReviewDocument as o, FeaturedProductsDocument as s, FilterOptionsDocument as c, HomeGroupedProductsDocument as l, MarkReviewHelpfulDocument as u, MyEntitlementsDocument as d, ProductReviewsDocument as f, SearchSuggestionsDocument as p, StoreProductDetailsDocument as m, TrendingSearchesDocument as h, UpdateReviewDocument as g, UserReviewForProductDocument as _, WorkspaceStoreOrdersDocument as v } from "../generated/global-operations.js";
4
+ import { useCallback as y, useEffect as b, useMemo as x, useRef as S, useState as C } from "react";
5
+ import { useApolloClient as w } from "@apollo/client/react";
6
6
  //#region src/hooks/useStoreGraphQL.ts
7
- function D() {
8
- return E();
7
+ function T() {
8
+ return w();
9
9
  }
10
- function O(e = {}) {
11
- let t = D(), [r, i] = T([]), [a, o] = T(0), [s, c] = T(!1), [l, u] = T(void 0), [d, f] = T(!0), [p, m] = T(null), h = JSON.stringify(e), g = x(async () => {
10
+ function E(e = {}) {
11
+ let t = T(), [r, i] = C([]), [a, o] = C(0), [s, c] = C(!1), [l, u] = C(void 0), [d, f] = C(!0), [p, m] = C(null), h = JSON.stringify(e), g = y(async () => {
12
12
  f(!0), m(null);
13
13
  try {
14
14
  let e = await t.query({
@@ -23,7 +23,7 @@ function O(e = {}) {
23
23
  f(!1);
24
24
  }
25
25
  }, [t, h]);
26
- return S(() => {
26
+ return b(() => {
27
27
  g();
28
28
  }, [g]), {
29
29
  products: r,
@@ -35,20 +35,20 @@ function O(e = {}) {
35
35
  refetch: g
36
36
  };
37
37
  }
38
- function k(r = {}, i) {
39
- let { query: a, hasOrganizationContext: o } = t(), s = E(), { defaultCompatibleWith: c } = e(), [l, u] = T([]), [d, f] = T(0), [p, m] = T(!1), [h, g] = T(void 0), [_, v] = T(!i?.skip), [y, b] = T(null), [D, O] = T(r.pagination?.offset ?? 0), k = i?.skip, A = C(() => {
38
+ function D(r = {}, i) {
39
+ let { query: a, hasOrganizationContext: o } = t(), s = w(), { defaultCompatibleWith: c } = e(), [l, u] = C([]), [d, f] = C(0), [p, m] = C(!1), [h, g] = C(void 0), [_, v] = C(!i?.skip), [T, E] = C(null), [D, O] = C(r.pagination?.offset ?? 0), k = i?.skip, A = x(() => {
40
40
  if (!c) return r;
41
41
  let e = { ...r };
42
42
  return e.filter ? (e.filter = { ...e.filter }, e.filter.compatibleWith || (e.filter.compatibleWith = c)) : e.filter = { compatibleWith: c }, e;
43
- }, [r, c]), j = C(() => {
43
+ }, [r, c]), j = x(() => {
44
44
  let { pagination: e, ...t } = A;
45
45
  return JSON.stringify(t);
46
- }, [A]), M = r.pagination?.limit ?? 30, N = x(async (e, t) => {
46
+ }, [A]), M = r.pagination?.limit ?? 30, N = y(async (e, t) => {
47
47
  if (k) {
48
48
  v(!1);
49
49
  return;
50
50
  }
51
- v(!0), b(null);
51
+ v(!0), E(null);
52
52
  try {
53
53
  let r = {
54
54
  ...JSON.parse(j),
@@ -70,7 +70,7 @@ function k(r = {}, i) {
70
70
  let c = i.data?.browseStore?.products ?? [];
71
71
  u(t ? (e) => [...e, ...c] : c), f(i.data?.browseStore?.totalCount ?? 0), m(i.data?.browseStore?.hasMore ?? !1), g(i.data?.browseStore?.facets), O(e + c.length);
72
72
  } catch (e) {
73
- b(e);
73
+ E(e);
74
74
  } finally {
75
75
  v(!1);
76
76
  }
@@ -82,10 +82,10 @@ function k(r = {}, i) {
82
82
  k,
83
83
  M,
84
84
  A.pagination
85
- ]), P = w(N);
85
+ ]), P = S(N);
86
86
  P.current = N;
87
- let F = w(r.pagination?.offset ?? 0);
88
- return F.current = r.pagination?.offset ?? 0, S(() => {
87
+ let F = S(r.pagination?.offset ?? 0);
88
+ return F.current = r.pagination?.offset ?? 0, b(() => {
89
89
  P.current(F.current, !1);
90
90
  }, [j, k]), {
91
91
  products: l,
@@ -93,9 +93,9 @@ function k(r = {}, i) {
93
93
  hasMore: p,
94
94
  facets: h,
95
95
  loading: _,
96
- error: y,
96
+ error: T,
97
97
  refetch: () => N(r.pagination?.offset ?? 0, !1),
98
- loadMore: x(() => {
98
+ loadMore: y(() => {
99
99
  !p || _ || N(D, !0);
100
100
  }, [
101
101
  N,
@@ -105,10 +105,10 @@ function k(r = {}, i) {
105
105
  ])
106
106
  };
107
107
  }
108
- function A() {
109
- let e = D(), [t, r] = T([]), [i, a] = T(0), [o, s] = T(!1), [c, l] = T(void 0), [u, d] = T(!1), [f, p] = T(null);
108
+ function O() {
109
+ let e = T(), [t, r] = C([]), [i, a] = C(0), [o, s] = C(!1), [c, l] = C(void 0), [u, d] = C(!1), [f, p] = C(null);
110
110
  return {
111
- browseStore: x(async (t = {}) => {
111
+ browseStore: y(async (t = {}) => {
112
112
  d(!0), p(null);
113
113
  try {
114
114
  let i = (await e.query({
@@ -131,8 +131,8 @@ function A() {
131
131
  error: f
132
132
  };
133
133
  }
134
- function j(e) {
135
- let { query: n, hasOrganizationContext: r } = t(), i = E(), [a, o] = T(null), [s, c] = T(!0), [l, u] = T(null), d = !e.id && !e.slug, f = JSON.stringify(e), p = w(null), m = x(async () => {
134
+ function k(e) {
135
+ let { query: n, hasOrganizationContext: r } = t(), i = w(), [a, o] = C(null), [s, c] = C(!0), [l, u] = C(null), d = !e.id && !e.slug, f = JSON.stringify(e), p = S(null), h = y(async () => {
136
136
  if (d) {
137
137
  c(!1);
138
138
  return;
@@ -141,11 +141,11 @@ function j(e) {
141
141
  p.current = f, c(!0), u(null);
142
142
  try {
143
143
  o((r ? await n({
144
- query: g,
144
+ query: m,
145
145
  variables: { input: JSON.parse(f) },
146
146
  fetchPolicy: "network-only"
147
147
  }) : await i.query({
148
- query: g,
148
+ query: m,
149
149
  variables: { input: JSON.parse(f) },
150
150
  fetchPolicy: "network-only"
151
151
  })).data?.storeProductDetails ?? null);
@@ -162,26 +162,26 @@ function j(e) {
162
162
  n,
163
163
  d
164
164
  ]);
165
- return S(() => {
166
- m();
167
- }, [m]), {
165
+ return b(() => {
166
+ h();
167
+ }, [h]), {
168
168
  data: a,
169
169
  loading: s,
170
170
  error: l,
171
- refetch: () => (p.current = null, m())
171
+ refetch: () => (p.current = null, h())
172
172
  };
173
173
  }
174
- function M() {
175
- let { query: e, hasOrganizationContext: n } = t(), r = E(), [i, a] = T(null), [o, s] = T(!1), [c, l] = T(null);
174
+ function A() {
175
+ let { query: e, hasOrganizationContext: n } = t(), r = w(), [i, a] = C(null), [o, s] = C(!1), [c, l] = C(null);
176
176
  return {
177
- getProductDetails: x(async (t) => {
177
+ getProductDetails: y(async (t) => {
178
178
  s(!0), l(null);
179
179
  try {
180
180
  let i = (n ? await e({
181
- query: g,
181
+ query: m,
182
182
  variables: { input: t }
183
183
  }) : await r.query({
184
- query: g,
184
+ query: m,
185
185
  variables: { input: t }
186
186
  })).data?.storeProductDetails ?? null;
187
187
  return a(i), i;
@@ -200,21 +200,21 @@ function M() {
200
200
  error: c
201
201
  };
202
202
  }
203
- function N(t) {
204
- let n = D(), { defaultCompatibleWith: r } = e(), [i, a] = T(null), [o, s] = T(!t?.skip), [c, l] = T(null), d = t?.skip, f = x(async () => {
203
+ function j(t) {
204
+ let n = T(), { defaultCompatibleWith: r } = e(), [i, a] = C(null), [o, s] = C(!t?.skip), [c, u] = C(null), d = t?.skip, f = y(async () => {
205
205
  if (d) {
206
206
  s(!1);
207
207
  return;
208
208
  }
209
- s(!0), l(null);
209
+ s(!0), u(null);
210
210
  try {
211
211
  a((await n.query({
212
- query: u,
212
+ query: l,
213
213
  variables: { compatibleWith: r ?? null },
214
214
  fetchPolicy: "cache-first"
215
215
  })).data?.homeGroupedProducts ?? null);
216
216
  } catch (e) {
217
- l(e);
217
+ u(e);
218
218
  } finally {
219
219
  s(!1);
220
220
  }
@@ -223,7 +223,7 @@ function N(t) {
223
223
  r,
224
224
  d
225
225
  ]);
226
- return S(() => {
226
+ return b(() => {
227
227
  f();
228
228
  }, [f]), {
229
229
  data: i,
@@ -236,22 +236,22 @@ function N(t) {
236
236
  refetch: f
237
237
  };
238
238
  }
239
- function P(e) {
240
- let t = D(), [n, r] = T([]), [i, a] = T(!0), [o, s] = T(null), l = x(async () => {
241
- a(!0), s(null);
239
+ function M(e) {
240
+ let t = T(), [n, r] = C([]), [i, a] = C(!0), [o, c] = C(null), l = y(async () => {
241
+ a(!0), c(null);
242
242
  try {
243
243
  r((await t.query({
244
- query: c,
244
+ query: s,
245
245
  variables: { limit: e },
246
246
  fetchPolicy: "cache-first"
247
247
  })).data?.featuredProducts ?? []);
248
248
  } catch (e) {
249
- s(e);
249
+ c(e);
250
250
  } finally {
251
251
  a(!1);
252
252
  }
253
253
  }, [t, e]);
254
- return S(() => {
254
+ return b(() => {
255
255
  l();
256
256
  }, [l]), {
257
257
  products: n,
@@ -260,8 +260,8 @@ function P(e) {
260
260
  refetch: l
261
261
  };
262
262
  }
263
- function F(e, t) {
264
- let n = D(), [r, i] = T([]), [a, o] = T(!1), [s, c] = T(null), l = e.length < 2, u = x(async () => {
263
+ function N(e, t) {
264
+ let n = T(), [r, i] = C([]), [a, o] = C(!1), [s, c] = C(null), l = e.length < 2, u = y(async () => {
265
265
  if (l) {
266
266
  i([]);
267
267
  return;
@@ -269,7 +269,7 @@ function F(e, t) {
269
269
  o(!0), c(null);
270
270
  try {
271
271
  i((await n.query({
272
- query: h,
272
+ query: p,
273
273
  variables: {
274
274
  query: e,
275
275
  limit: t?.limit,
@@ -289,7 +289,7 @@ function F(e, t) {
289
289
  t?.types,
290
290
  l
291
291
  ]);
292
- return S(() => {
292
+ return b(() => {
293
293
  u();
294
294
  }, [u]), {
295
295
  suggestions: r,
@@ -298,15 +298,15 @@ function F(e, t) {
298
298
  refetch: u
299
299
  };
300
300
  }
301
- function I() {
302
- let e = D(), [t, n] = T([]), [r, i] = T(!1), [a, o] = T(null);
301
+ function P() {
302
+ let e = T(), [t, n] = C([]), [r, i] = C(!1), [a, o] = C(null);
303
303
  return {
304
- getSuggestions: x(async (t, r) => {
304
+ getSuggestions: y(async (t, r) => {
305
305
  if (t.length < 2) return n([]), [];
306
306
  i(!0), o(null);
307
307
  try {
308
308
  let i = (await e.query({
309
- query: h,
309
+ query: p,
310
310
  variables: {
311
311
  query: t,
312
312
  limit: r?.limit,
@@ -326,12 +326,12 @@ function I() {
326
326
  error: a
327
327
  };
328
328
  }
329
- function L(e) {
330
- let t = D(), [n, r] = T([]), [i, a] = T(!0), [o, s] = T(null), c = x(async () => {
329
+ function F(e) {
330
+ let t = T(), [n, r] = C([]), [i, a] = C(!0), [o, s] = C(null), c = y(async () => {
331
331
  a(!0), s(null);
332
332
  try {
333
333
  r((await t.query({
334
- query: _,
334
+ query: h,
335
335
  variables: {
336
336
  limit: e?.limit,
337
337
  type: e?.type
@@ -348,7 +348,7 @@ function L(e) {
348
348
  e?.limit,
349
349
  e?.type
350
350
  ]);
351
- return S(() => {
351
+ return b(() => {
352
352
  c();
353
353
  }, [c]), {
354
354
  terms: n,
@@ -357,12 +357,12 @@ function L(e) {
357
357
  refetch: c
358
358
  };
359
359
  }
360
- function R(e) {
361
- let t = D(), [n, r] = T(null), [i, a] = T(!0), [o, s] = T(null), c = x(async () => {
360
+ function I(e) {
361
+ let t = T(), [n, r] = C(null), [i, a] = C(!0), [o, s] = C(null), l = y(async () => {
362
362
  a(!0), s(null);
363
363
  try {
364
364
  r((await t.query({
365
- query: l,
365
+ query: c,
366
366
  variables: {
367
367
  type: e?.type,
368
368
  withProducts: e?.withProducts
@@ -379,17 +379,17 @@ function R(e) {
379
379
  e?.type,
380
380
  e?.withProducts
381
381
  ]);
382
- return S(() => {
383
- c();
384
- }, [c]), {
382
+ return b(() => {
383
+ l();
384
+ }, [l]), {
385
385
  filterOptions: n,
386
386
  loading: i,
387
387
  error: o,
388
- refetch: c
388
+ refetch: l
389
389
  };
390
390
  }
391
- function z() {
392
- let e = D(), [t, n] = T([]), [i, a] = T(!0), [o, s] = T(null), c = x(async () => {
391
+ function L() {
392
+ let e = T(), [t, n] = C([]), [i, a] = C(!0), [o, s] = C(null), c = y(async () => {
393
393
  a(!0), s(null);
394
394
  try {
395
395
  n((await e.query({
@@ -402,7 +402,7 @@ function z() {
402
402
  a(!1);
403
403
  }
404
404
  }, [e]);
405
- return S(() => {
405
+ return b(() => {
406
406
  c();
407
407
  }, [c]), {
408
408
  categories: t,
@@ -411,8 +411,8 @@ function z() {
411
411
  refetch: c
412
412
  };
413
413
  }
414
- function B(e, t) {
415
- let n = D(), [r, i] = T([]), [a, o] = T(!0), [s, c] = T(null), l = x(async () => {
414
+ function R(e, t) {
415
+ let n = T(), [r, i] = C([]), [a, o] = C(!0), [s, c] = C(null), l = y(async () => {
416
416
  if (!e) {
417
417
  o(!1);
418
418
  return;
@@ -420,7 +420,7 @@ function B(e, t) {
420
420
  o(!0), c(null);
421
421
  try {
422
422
  i((await n.query({
423
- query: m,
423
+ query: f,
424
424
  variables: {
425
425
  productId: e,
426
426
  status: t?.status
@@ -437,7 +437,7 @@ function B(e, t) {
437
437
  e,
438
438
  t?.status
439
439
  ]);
440
- return S(() => {
440
+ return b(() => {
441
441
  l();
442
442
  }, [l]), {
443
443
  reviews: r,
@@ -446,8 +446,8 @@ function B(e, t) {
446
446
  refetch: l
447
447
  };
448
448
  }
449
- function V(e) {
450
- let t = D(), [n, r] = T(null), [i, a] = T(!0), [o, s] = T(null), c = x(async () => {
449
+ function z(e) {
450
+ let t = T(), [n, r] = C(null), [i, a] = C(!0), [o, s] = C(null), c = y(async () => {
451
451
  if (!e) {
452
452
  a(!1);
453
453
  return;
@@ -455,7 +455,7 @@ function V(e) {
455
455
  a(!0), s(null);
456
456
  try {
457
457
  r((await t.query({
458
- query: y,
458
+ query: _,
459
459
  variables: { productId: e },
460
460
  fetchPolicy: "network-only"
461
461
  })).data?.userReviewForProduct ?? null);
@@ -465,7 +465,7 @@ function V(e) {
465
465
  a(!1);
466
466
  }
467
467
  }, [t, e]);
468
- return S(() => {
468
+ return b(() => {
469
469
  c();
470
470
  }, [c]), {
471
471
  review: n,
@@ -474,10 +474,10 @@ function V(e) {
474
474
  refetch: c
475
475
  };
476
476
  }
477
- function H() {
478
- let e = D(), [t, n] = T(null), [r, i] = T(!1), [o, s] = T(null);
477
+ function B() {
478
+ let e = T(), [t, n] = C(null), [r, i] = C(!1), [o, s] = C(null);
479
479
  return {
480
- createReview: x(async (t) => {
480
+ createReview: y(async (t) => {
481
481
  i(!0), s(null);
482
482
  try {
483
483
  let r = (await e.mutate({
@@ -496,14 +496,14 @@ function H() {
496
496
  error: o
497
497
  };
498
498
  }
499
- function U() {
500
- let e = D(), [t, n] = T(null), [r, i] = T(!1), [a, o] = T(null);
499
+ function V() {
500
+ let e = T(), [t, n] = C(null), [r, i] = C(!1), [a, o] = C(null);
501
501
  return {
502
- updateReview: x(async (t, r) => {
502
+ updateReview: y(async (t, r) => {
503
503
  i(!0), o(null);
504
504
  try {
505
505
  let i = (await e.mutate({
506
- mutation: v,
506
+ mutation: g,
507
507
  variables: {
508
508
  id: t,
509
509
  input: r
@@ -521,10 +521,10 @@ function U() {
521
521
  error: a
522
522
  };
523
523
  }
524
- function W() {
525
- let e = D(), [t, n] = T(!1), [r, i] = T(null);
524
+ function H() {
525
+ let e = T(), [t, n] = C(!1), [r, i] = C(null);
526
526
  return {
527
- deleteReview: x(async (t) => {
527
+ deleteReview: y(async (t) => {
528
528
  n(!0), i(null);
529
529
  try {
530
530
  return (await e.mutate({
@@ -541,14 +541,14 @@ function W() {
541
541
  error: r
542
542
  };
543
543
  }
544
- function G() {
545
- let e = D(), [t, n] = T(!1), [r, i] = T(null);
544
+ function U() {
545
+ let e = T(), [t, n] = C(!1), [r, i] = C(null);
546
546
  return {
547
- markHelpful: x(async (t) => {
547
+ markHelpful: y(async (t) => {
548
548
  n(!0), i(null);
549
549
  try {
550
550
  return (await e.mutate({
551
- mutation: d,
551
+ mutation: u,
552
552
  variables: { id: t }
553
553
  })).data?.markReviewHelpful ?? null;
554
554
  } catch (e) {
@@ -561,19 +561,19 @@ function G() {
561
561
  error: r
562
562
  };
563
563
  }
564
- function K() {
565
- let { query: e, hasOrganizationContext: n } = t(), r = E(), [i, a] = T([]), [o, s] = T(!1), [c, l] = T(0), [u, d] = T(!0), [p, m] = T(null), h = x(async (t = 0, i = !1) => {
566
- d(!0), m(null);
564
+ function W() {
565
+ let { query: e, hasOrganizationContext: n } = t(), r = w(), [i, a] = C([]), [o, s] = C(!1), [c, l] = C(0), [u, f] = C(!0), [p, m] = C(null), h = y(async (t = 0, i = !1) => {
566
+ f(!0), m(null);
567
567
  try {
568
568
  let o = {
569
569
  limit: 20,
570
570
  offset: t
571
571
  }, c = (n ? await e({
572
- query: f,
572
+ query: d,
573
573
  variables: o,
574
574
  fetchPolicy: "network-only"
575
575
  }) : await r.query({
576
- query: f,
576
+ query: d,
577
577
  variables: o,
578
578
  fetchPolicy: "network-only"
579
579
  })).data?.myEntitlements ?? [];
@@ -581,14 +581,14 @@ function K() {
581
581
  } catch (e) {
582
582
  m(e);
583
583
  } finally {
584
- d(!1);
584
+ f(!1);
585
585
  }
586
586
  }, [
587
587
  r,
588
588
  n,
589
589
  e
590
590
  ]);
591
- return S(() => {
591
+ return b(() => {
592
592
  h(0);
593
593
  }, [h]), {
594
594
  entitlements: i,
@@ -596,7 +596,7 @@ function K() {
596
596
  loading: u,
597
597
  error: p,
598
598
  refetch: () => h(0),
599
- loadMore: x(() => {
599
+ loadMore: y(() => {
600
600
  !o || u || h(c + 20, !0);
601
601
  }, [
602
602
  h,
@@ -606,8 +606,8 @@ function K() {
606
606
  ])
607
607
  };
608
608
  }
609
- function q(e) {
610
- let t = D(), [n, r] = T(null), [a, o] = T(!0), [s, c] = T(null), l = x(async () => {
609
+ function G(e) {
610
+ let t = T(), [n, r] = C(null), [a, o] = C(!0), [s, c] = C(null), l = y(async () => {
611
611
  if (!e) {
612
612
  o(!1);
613
613
  return;
@@ -625,7 +625,7 @@ function q(e) {
625
625
  o(!1);
626
626
  }
627
627
  }, [t, e]);
628
- return S(() => {
628
+ return b(() => {
629
629
  l();
630
630
  }, [l]), {
631
631
  entitlement: n,
@@ -634,8 +634,8 @@ function q(e) {
634
634
  refetch: l
635
635
  };
636
636
  }
637
- function J(e, t, n, r) {
638
- let i = D(), [a, o] = T([]), [s, c] = T(0), [l, u] = T(!0), [d, f] = T(null), p = x(async () => {
637
+ function K(e, t, n, r) {
638
+ let i = T(), [a, o] = C([]), [s, c] = C(0), [l, u] = C(!0), [d, f] = C(null), p = y(async () => {
639
639
  if (!e) {
640
640
  u(!1);
641
641
  return;
@@ -643,7 +643,7 @@ function J(e, t, n, r) {
643
643
  u(!0), f(null);
644
644
  try {
645
645
  let a = await i.query({
646
- query: b,
646
+ query: v,
647
647
  variables: {
648
648
  billingAccountId: e,
649
649
  page: t,
@@ -667,7 +667,7 @@ function J(e, t, n, r) {
667
667
  r?.status,
668
668
  r?.search
669
669
  ]);
670
- return S(() => {
670
+ return b(() => {
671
671
  p();
672
672
  }, [p]), {
673
673
  orders: a,
@@ -677,77 +677,7 @@ function J(e, t, n, r) {
677
677
  refetch: p
678
678
  };
679
679
  }
680
- function Y() {
681
- let e = D(), [t, n] = T([]), [r, i] = T(!1), [a, o] = T(0), [s, c] = T(!0), [l, u] = T(null), d = x(async (t = 0, r = !1) => {
682
- c(!0), u(null);
683
- try {
684
- let a = (await e.query({
685
- query: p,
686
- variables: {
687
- limit: 20,
688
- offset: t
689
- },
690
- fetchPolicy: "network-only"
691
- })).data?.publishedProducts ?? [];
692
- n(r ? (e) => [...e, ...a] : a), i(a.length === 20), o(t + a.length);
693
- } catch (e) {
694
- u(e);
695
- } finally {
696
- c(!1);
697
- }
698
- }, [e]), f = x(() => {
699
- !r || s || d(a, !0);
700
- }, [
701
- d,
702
- r,
703
- s,
704
- a
705
- ]);
706
- return S(() => {
707
- d(0, !1);
708
- }, [d]), {
709
- products: t,
710
- hasMore: r,
711
- loading: s,
712
- error: l,
713
- refetch: () => d(0, !1),
714
- loadMore: f
715
- };
716
- }
717
- function X(e) {
718
- let { query: n, hasOrganizationContext: r } = t(), i = E(), [a, o] = T(null), [c, l] = T(!0), [u, d] = T(null), f = x(async () => {
719
- l(!0), d(null);
720
- try {
721
- o((r ? await n({
722
- query: s,
723
- variables: { input: e },
724
- fetchPolicy: "network-only"
725
- }) : await i.query({
726
- query: s,
727
- variables: { input: e },
728
- fetchPolicy: "network-only"
729
- })).data?.developerEarnings ?? null);
730
- } catch (e) {
731
- d(e);
732
- } finally {
733
- l(!1);
734
- }
735
- }, [
736
- i,
737
- r,
738
- e,
739
- n
740
- ]);
741
- return S(() => {
742
- f();
743
- }, [f]), {
744
- earnings: a,
745
- loading: c,
746
- error: u,
747
- refetch: f
748
- };
749
- }
750
680
  //#endregion
751
- export { O as useBrowseStore, k as useBrowseStoreWithContext, z as useCategories, q as useCheckEntitlement, H as useCreateReview, W as useDeleteReview, X as useDeveloperEarnings, P as useFeaturedProducts, R as useFilterOptions, N as useHomeGroupedProducts, A as useLazyBrowseStore, I as useLazySearchSuggestions, M as useLazyStoreProductDetails, G as useMarkReviewHelpful, K as useMyEntitlements, Y as useMyPublishedProducts, B as useProductReviews, F as useSearchSuggestions, j as useStoreProductDetails, L as useTrendingSearches, U as useUpdateReview, V as useUserReviewForProduct, J as useWorkspaceStoreOrders };
681
+ export { E as useBrowseStore, D as useBrowseStoreWithContext, L as useCategories, G as useCheckEntitlement, B as useCreateReview, H as useDeleteReview, M as useFeaturedProducts, I as useFilterOptions, j as useHomeGroupedProducts, O as useLazyBrowseStore, P as useLazySearchSuggestions, A as useLazyStoreProductDetails, U as useMarkReviewHelpful, W as useMyEntitlements, R as useProductReviews, N as useSearchSuggestions, k as useStoreProductDetails, F as useTrendingSearches, V as useUpdateReview, z as useUserReviewForProduct, K as useWorkspaceStoreOrders };
752
682
 
753
683
  //# sourceMappingURL=useStoreGraphQL.js.map