@wix/stores 1.0.959 → 1.0.960

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 (121) hide show
  1. package/_sdk-exports/context-category-by-id-context-provider/runtime.d.ts +4026 -0
  2. package/_sdk-exports/context-category-by-id-context-provider/runtime.js +2 -0
  3. package/_sdk-exports/context-category-by-slug-context-provider/runtime.d.ts +4046 -0
  4. package/_sdk-exports/context-category-by-slug-context-provider/runtime.js +2 -0
  5. package/_sdk-exports/context-category-info-context-provider/runtime.d.ts +3530 -0
  6. package/_sdk-exports/context-category-info-context-provider/runtime.js +2 -0
  7. package/_sdk-exports/context-category-list-context-provider/runtime.d.ts +101 -0
  8. package/_sdk-exports/context-category-list-context-provider/runtime.js +2 -0
  9. package/_sdk-exports/context-product-by-id-context-provider/runtime.d.ts +4221 -0
  10. package/_sdk-exports/context-product-by-id-context-provider/runtime.js +2 -0
  11. package/_sdk-exports/context-product-by-slug-context-provider/runtime.d.ts +4217 -0
  12. package/_sdk-exports/context-product-by-slug-context-provider/runtime.js +2 -0
  13. package/_sdk-exports/context-product-context-provider/runtime.d.ts +4449 -0
  14. package/_sdk-exports/context-product-context-provider/runtime.js +2 -0
  15. package/_sdk-exports/context-product-item-context-provider/runtime.d.ts +4102 -0
  16. package/_sdk-exports/context-product-item-context-provider/runtime.js +2 -0
  17. package/_sdk-exports/context-product-list-context-provider/runtime.d.ts +3969 -0
  18. package/_sdk-exports/context-product-list-context-provider/runtime.js +2 -0
  19. package/_sdk-exports/context-promotion-item-context-provider/runtime.d.ts +85 -0
  20. package/_sdk-exports/context-promotion-item-context-provider/runtime.js +2 -0
  21. package/build/cjs/context-category-by-id-context-provider.d.ts +4026 -0
  22. package/build/cjs/context-category-by-id-context-provider.js +3572 -0
  23. package/build/cjs/context-category-by-id-context-provider.js.map +1 -0
  24. package/build/cjs/context-category-by-slug-context-provider.d.ts +4046 -0
  25. package/build/cjs/context-category-by-slug-context-provider.js +3674 -0
  26. package/build/cjs/context-category-by-slug-context-provider.js.map +1 -0
  27. package/build/cjs/context-category-info-context-provider.d.ts +3530 -0
  28. package/build/cjs/context-category-info-context-provider.js +1201 -0
  29. package/build/cjs/context-category-info-context-provider.js.map +1 -0
  30. package/build/cjs/context-category-list-context-provider.d.ts +101 -0
  31. package/build/cjs/context-category-list-context-provider.js +587 -0
  32. package/build/cjs/context-category-list-context-provider.js.map +1 -0
  33. package/build/cjs/context-product-by-id-context-provider.d.ts +4221 -0
  34. package/build/cjs/context-product-by-id-context-provider.js +3454 -0
  35. package/build/cjs/context-product-by-id-context-provider.js.map +1 -0
  36. package/build/cjs/context-product-by-slug-context-provider.d.ts +4217 -0
  37. package/build/cjs/context-product-by-slug-context-provider.js +3477 -0
  38. package/build/cjs/context-product-by-slug-context-provider.js.map +1 -0
  39. package/build/cjs/context-product-context-provider.d.ts +4449 -0
  40. package/build/cjs/context-product-context-provider.js +587 -0
  41. package/build/cjs/context-product-context-provider.js.map +1 -0
  42. package/build/cjs/context-product-item-context-provider.d.ts +4102 -0
  43. package/build/cjs/context-product-item-context-provider.js +4396 -0
  44. package/build/cjs/context-product-item-context-provider.js.map +1 -0
  45. package/build/cjs/context-product-list-context-provider.d.ts +3970 -0
  46. package/build/cjs/context-product-list-context-provider.js +587 -0
  47. package/build/cjs/context-product-list-context-provider.js.map +1 -0
  48. package/build/cjs/context-promotion-item-context-provider.d.ts +85 -0
  49. package/build/cjs/context-promotion-item-context-provider.js +592 -0
  50. package/build/cjs/context-promotion-item-context-provider.js.map +1 -0
  51. package/build/es/context-category-by-id-context-provider.d.mts +4026 -0
  52. package/build/es/context-category-by-id-context-provider.mjs +3532 -0
  53. package/build/es/context-category-by-id-context-provider.mjs.map +1 -0
  54. package/build/es/context-category-by-slug-context-provider.d.mts +4046 -0
  55. package/build/es/context-category-by-slug-context-provider.mjs +3634 -0
  56. package/build/es/context-category-by-slug-context-provider.mjs.map +1 -0
  57. package/build/es/context-category-info-context-provider.d.mts +3530 -0
  58. package/build/es/context-category-info-context-provider.mjs +1172 -0
  59. package/build/es/context-category-info-context-provider.mjs.map +1 -0
  60. package/build/es/context-category-list-context-provider.d.mts +101 -0
  61. package/build/es/context-category-list-context-provider.mjs +558 -0
  62. package/build/es/context-category-list-context-provider.mjs.map +1 -0
  63. package/build/es/context-product-by-id-context-provider.d.mts +4221 -0
  64. package/build/es/context-product-by-id-context-provider.mjs +3415 -0
  65. package/build/es/context-product-by-id-context-provider.mjs.map +1 -0
  66. package/build/es/context-product-by-slug-context-provider.d.mts +4217 -0
  67. package/build/es/context-product-by-slug-context-provider.mjs +3437 -0
  68. package/build/es/context-product-by-slug-context-provider.mjs.map +1 -0
  69. package/build/es/context-product-context-provider.d.mts +4449 -0
  70. package/build/es/context-product-context-provider.mjs +558 -0
  71. package/build/es/context-product-context-provider.mjs.map +1 -0
  72. package/build/es/context-product-item-context-provider.d.mts +4102 -0
  73. package/build/es/context-product-item-context-provider.mjs +4356 -0
  74. package/build/es/context-product-item-context-provider.mjs.map +1 -0
  75. package/build/es/context-product-list-context-provider.d.mts +3970 -0
  76. package/build/es/context-product-list-context-provider.mjs +558 -0
  77. package/build/es/context-product-list-context-provider.mjs.map +1 -0
  78. package/build/es/context-promotion-item-context-provider.d.mts +85 -0
  79. package/build/es/context-promotion-item-context-provider.mjs +563 -0
  80. package/build/es/context-promotion-item-context-provider.mjs.map +1 -0
  81. package/build/internal/cjs/context-category-by-id-context-provider.d.ts +4026 -0
  82. package/build/internal/cjs/context-category-by-slug-context-provider.d.ts +4046 -0
  83. package/build/internal/cjs/context-category-info-context-provider.d.ts +3530 -0
  84. package/build/internal/cjs/context-category-list-context-provider.d.ts +101 -0
  85. package/build/internal/cjs/context-product-by-id-context-provider.d.ts +4221 -0
  86. package/build/internal/cjs/context-product-by-slug-context-provider.d.ts +4217 -0
  87. package/build/internal/cjs/context-product-context-provider.d.ts +4449 -0
  88. package/build/internal/cjs/context-product-item-context-provider.d.ts +4102 -0
  89. package/build/internal/cjs/context-product-list-context-provider.d.ts +3970 -0
  90. package/build/internal/cjs/context-promotion-item-context-provider.d.ts +85 -0
  91. package/build/internal/es/context-category-by-id-context-provider.d.mts +4026 -0
  92. package/build/internal/es/context-category-by-slug-context-provider.d.mts +4046 -0
  93. package/build/internal/es/context-category-info-context-provider.d.mts +3530 -0
  94. package/build/internal/es/context-category-list-context-provider.d.mts +101 -0
  95. package/build/internal/es/context-product-by-id-context-provider.d.mts +4221 -0
  96. package/build/internal/es/context-product-by-slug-context-provider.d.mts +4217 -0
  97. package/build/internal/es/context-product-context-provider.d.mts +4449 -0
  98. package/build/internal/es/context-product-item-context-provider.d.mts +4102 -0
  99. package/build/internal/es/context-product-list-context-provider.d.mts +3970 -0
  100. package/build/internal/es/context-promotion-item-context-provider.d.mts +85 -0
  101. package/category-by-id-context-provider/package.json +3 -0
  102. package/category-by-slug-context-provider/package.json +3 -0
  103. package/category-info-context-provider/package.json +3 -0
  104. package/category-list-context-provider/package.json +3 -0
  105. package/context/category-by-id-context-provider/package.json +3 -0
  106. package/context/category-by-slug-context-provider/package.json +3 -0
  107. package/context/category-info-context-provider/package.json +3 -0
  108. package/context/category-list-context-provider/package.json +3 -0
  109. package/context/product-by-id-context-provider/package.json +3 -0
  110. package/context/product-by-slug-context-provider/package.json +3 -0
  111. package/context/product-context-provider/package.json +3 -0
  112. package/context/product-item-context-provider/package.json +3 -0
  113. package/context/product-list-context-provider/package.json +3 -0
  114. package/context/promotion-item-context-provider/package.json +3 -0
  115. package/package.json +159 -24
  116. package/product-by-id-context-provider/package.json +3 -0
  117. package/product-by-slug-context-provider/package.json +3 -0
  118. package/product-context-provider/package.json +3 -0
  119. package/product-item-context-provider/package.json +3 -0
  120. package/product-list-context-provider/package.json +3 -0
  121. package/promotion-item-context-provider/package.json +3 -0
@@ -0,0 +1,3674 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to2, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to2, key) && key !== except)
16
+ __defProp(to2, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to2;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // context-category-by-slug-context-provider.ts
31
+ var context_category_by_slug_context_provider_exports = {};
32
+ __export(context_category_by_slug_context_provider_exports, {
33
+ CategoryBySlugContextProvider: () => Pl,
34
+ CategoryBySlugContextValues: () => Ml,
35
+ default: () => Pl,
36
+ injectAccessTokenGetter: () => Fl,
37
+ useCategoryBySlugContext: () => jl
38
+ });
39
+ module.exports = __toCommonJS(context_category_by_slug_context_provider_exports);
40
+
41
+ // _sdk-exports/context-category-by-slug-context-provider/runtime.js
42
+ var e = __toESM(require("react"));
43
+ var import_react = require("react");
44
+ var import_jsx_runtime = require("react/jsx-runtime");
45
+ var import_product_list_context_provider = __toESM(require("@wix/stores/product-list-context-provider"));
46
+ var import_category_info_context_provider = __toESM(require("@wix/stores/category-info-context-provider"));
47
+ var import_category_list_context_provider = __toESM(require("@wix/stores/category-list-context-provider"));
48
+ var import_services_manager_react = require("@wix/services-manager-react");
49
+ var p = Object.create;
50
+ var m = Object.defineProperty;
51
+ var ee = Object.getOwnPropertyDescriptor;
52
+ var te = Object.getOwnPropertyNames;
53
+ var ne = Object.getPrototypeOf;
54
+ var h = Object.prototype.hasOwnProperty;
55
+ var g = (e2, t2) => () => (t2 || (e2((t2 = { exports: {} }).exports, t2), e2 = null), t2.exports);
56
+ var re = (e2, t2, n2, r2) => {
57
+ if (t2 && typeof t2 == `object` || typeof t2 == `function`) for (var i2 = te(t2), a2 = 0, o2 = i2.length, s2; a2 < o2; a2++) s2 = i2[a2], !h.call(e2, s2) && s2 !== n2 && m(e2, s2, { get: ((e3) => t2[e3]).bind(null, s2), enumerable: !(r2 = ee(t2, s2)) || r2.enumerable });
58
+ return e2;
59
+ };
60
+ var _ = (e2, t2, n2) => (n2 = e2 == null ? {} : p(ne(e2)), re(t2 || !e2 || !e2.__esModule || !h.call(e2, `default`) ? m(n2, `default`, { value: e2, enumerable: true }) : n2, e2));
61
+ var v = {};
62
+ function y(e2, t2 = false, n2 = (e3) => e3) {
63
+ return () => ({ __type: `event-definition`, type: e2, isDomainEvent: t2, transformations: n2 });
64
+ }
65
+ var ie = (e2) => {
66
+ switch (e2) {
67
+ case `get`:
68
+ case `GET`:
69
+ return `GET`;
70
+ case `post`:
71
+ case `POST`:
72
+ return `POST`;
73
+ case `put`:
74
+ case `PUT`:
75
+ return `PUT`;
76
+ case `delete`:
77
+ case `DELETE`:
78
+ return `DELETE`;
79
+ case `patch`:
80
+ case `PATCH`:
81
+ return `PATCH`;
82
+ case `head`:
83
+ case `HEAD`:
84
+ return `HEAD`;
85
+ case `options`:
86
+ case `OPTIONS`:
87
+ return `OPTIONS`;
88
+ default:
89
+ throw Error(`Unknown method: ${e2}`);
90
+ }
91
+ };
92
+ var ae = (e2) => (t2) => async (n2) => {
93
+ let r2, i2 = (t3) => {
94
+ if (r2 = e2(n2)(t3), r2.url === void 0) throw Error(`Url was not successfully created for this request, please reach out to support channels for assistance.`);
95
+ let { method: i3, url: a2, params: o2 } = r2;
96
+ return { ...r2, method: ie(i3), url: a2, data: r2.data, params: o2 };
97
+ };
98
+ try {
99
+ let e3 = await t2.request(i2);
100
+ if (r2 === void 0) throw Error(`Request options were not created for this request, please reach out to support channels for assistance.`);
101
+ let n3 = Array.isArray(r2.transformResponse) ? r2.transformResponse : [r2.transformResponse], a2 = e3.data;
102
+ return n3.forEach((t3) => {
103
+ t3 && (a2 = t3(e3.data, e3.headers));
104
+ }), a2;
105
+ } catch (e3) {
106
+ throw typeof e3 == `object` && e3 && `response` in e3 && typeof e3.response == `object` && e3.response !== null && `data` in e3.response ? e3.response.data : e3;
107
+ }
108
+ };
109
+ var oe = (e2) => e2.__isAmbassador ? true : !!e2().__isAmbassador;
110
+ var se = `__metadata`;
111
+ var ce = `edge.wixapis.com`;
112
+ var le = class extends Error {
113
+ message;
114
+ response;
115
+ constructor(e2, t2) {
116
+ super(e2), this.message = e2, this.response = t2;
117
+ }
118
+ async details() {
119
+ let e2 = await this.response.json();
120
+ return ue(this.response.status, e2?.message, e2?.details, { requestId: this.response.headers.get(`X-Wix-Request-Id`), details: e2 });
121
+ }
122
+ };
123
+ var ue = (e2, t2, n2, r2) => ({ details: { ...!n2?.validationError && { applicationError: { description: t2, code: e2, data: r2 } }, ...n2 }, message: t2, requestId: r2?.requestId });
124
+ var de = (e2) => e2?.method && [`post`, `put`, `patch`].includes(e2.method.toLocaleLowerCase()) && e2.body ? { "Content-Type": `application/json` } : {};
125
+ var fe = (e2) => e2 && typeof e2 == `object` && !Array.isArray(e2);
126
+ var pe = (e2) => e2.__type === `host`;
127
+ function me(e2, t2) {
128
+ return e2.create(t2);
129
+ }
130
+ var he = `x-wix-bi-gateway`;
131
+ function ge(e2, t2, n2) {
132
+ return { [he]: _e({ environment: `js-sdk${n2 ? `-${n2}` : ``}`, "package-name": e2.packageName ?? t2?.PACKAGE_NAME, "method-fqn": e2.methodFqn, entity: e2.entityFqdn }) };
133
+ }
134
+ function _e(e2) {
135
+ return Object.entries(e2).filter(([e3, t2]) => !!t2).map(([e3, t2]) => `${e3}=${t2}`).join(`,`);
136
+ }
137
+ function ve(e2) {
138
+ let t2 = globalThis.__wix_context__, n2 = { client: v.client, elevatedClient: v.elevatedClient }, r2;
139
+ globalThis.__wix_context__ = void 0, v.client = void 0, v.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
140
+ try {
141
+ return e2();
142
+ } finally {
143
+ globalThis.__wix_context__ = t2, v.client = n2.client, v.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
144
+ }
145
+ }
146
+ var ye = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
147
+ function be(e2) {
148
+ return Te(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
149
+ }
150
+ var xe = /([\p{Ll}\d])(\p{Lu})/gu;
151
+ var Se = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
152
+ var Ce = `$1\0$2`;
153
+ var we = /[^\p{L}\d]+/giu;
154
+ function Te(e2) {
155
+ let t2 = e2.trim();
156
+ t2 = t2.replace(xe, Ce).replace(Se, Ce), t2 = t2.replace(we, `\0`);
157
+ let n2 = 0, r2 = t2.length;
158
+ for (; t2.charAt(n2) === `\0`; ) n2++;
159
+ if (n2 === r2) return [];
160
+ for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
161
+ return t2.slice(n2, r2).split(/\0/g);
162
+ }
163
+ var Ee = (e2) => `validationError` in (e2.response?.data?.details ?? {});
164
+ var De = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
165
+ var Oe = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
166
+ function ke(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
167
+ if (typeof e2 != `object` || !e2) throw e2;
168
+ if (Ee(e2)) return Ae(e2, t2, n2);
169
+ if (De(e2)) return Me(e2);
170
+ if (Oe(e2)) {
171
+ let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: be(n3), data: {} }, requestId: e2.requestId };
172
+ return je(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
173
+ }
174
+ return Ne(e2);
175
+ }
176
+ var Ae = (e2, t2, n2) => {
177
+ let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = Pe(t2, a2, n2)?.sort((e3, t3) => e3.field < t3.field ? -1 : 1), s2 = `INVALID_ARGUMENT: ${o2?.map(({ field: e3, description: t3 }) => `"${e3}" ${t3}`)?.join(`, `)}`, c2 = { validationError: { fieldViolations: o2 }, requestId: i2 };
178
+ return je(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e2.response?.status, requestId: i2 } });
179
+ };
180
+ var je = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
181
+ var Me = (e2) => {
182
+ let t2 = e2.response?.status, n2 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n2, i2 = e2.response?.data?.details?.applicationError?.description ?? n2, a2 = e2.response?.data?.details?.applicationError?.code ?? be(n2), o2 = e2.response?.data?.details?.applicationError?.data ?? {}, s2 = r2 === i2 ? r2 : `${r2}: ${i2}`, c2 = { applicationError: { description: i2, code: a2, data: o2 }, requestId: e2.requestId };
183
+ return je(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e2.requestId } });
184
+ };
185
+ var Ne = (e2) => je(e2, { message: e2.requestId ? `System error occurred, request-id: ${e2.requestId}` : `System error occurred: ${JSON.stringify(e2)}`, extraProperties: { requestId: e2.requestId, status: e2.response?.status, code: be(e2.response?.statusText ?? `UNKNOWN`), ...!e2.response && { runtimeError: e2 } } });
186
+ var Pe = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
187
+ let a2 = { ...e2, ...t2 }, o2 = Object.keys(a2);
188
+ return r2?.filter((e3) => !r2.some((t3) => t3.field.length > e3.field.length && t3.field.startsWith(e3.field) && o2.includes(t3.field))).map((e3) => {
189
+ let r3 = t2[e3.field];
190
+ if (r3) return { ...e3, field: Fe(r3, i2) };
191
+ let s2 = o2?.sort((e4, t3) => t3.length - e4.length)?.find((t3) => e3.field.startsWith(t3));
192
+ if (s2) {
193
+ let t3 = a2[s2];
194
+ if (t3) return { ...e3, field: e3.field.replace(s2, Fe(t3, i2)) };
195
+ }
196
+ return n2 ? { ...e3, field: `${i2[0]}.${e3.field}` } : e3;
197
+ });
198
+ };
199
+ var Fe = (e2, t2) => {
200
+ let n2 = Ie(e2);
201
+ return n2 == null ? e2 : e2.replace(`$[${n2}]`, t2[n2]);
202
+ };
203
+ var Ie = (e2) => {
204
+ let t2 = e2.match(/\$\[(?<argIndex>\d+)\]/);
205
+ return t2 && t2.groups && Number(t2.groups.argIndex);
206
+ };
207
+ function Le(e2, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
208
+ return ve(() => e2({ request: async (e3) => {
209
+ let i3 = e3({ host: s2?.HTTPHost || `www.wixapis.com` }), a3 = i3;
210
+ a3.method === `GET` && a3.fallback?.length && (a3.params?.toString().length ?? 0) > 4e3 && (a3 = i3.fallback[0]);
211
+ let o3 = s2?.HTTPHost ?? `www.wixapis.com`, u3 = `https://${l2 ? ce : o3}${a3.url}`;
212
+ a3.params && a3.params.toString() && (u3 += `?${a3.params.toString()}`);
213
+ try {
214
+ let e4 = ge(i3, t2, c2), o4 = { method: a3.method, ...a3.data && { body: JSON.stringify(a3.data) }, headers: { ...e4 } }, s3 = await n2(u3, o4);
215
+ if (s3.status !== 200) {
216
+ let e5 = null;
217
+ try {
218
+ e5 = await s3.json();
219
+ } catch {
220
+ }
221
+ let t3 = ze(s3.status, e5?.message ?? s3.statusText, e5?.details, { requestId: s3.headers.get(`X-Wix-Request-Id`), details: e5 }), n3 = ke(t3);
222
+ throw r2?.handleError(n3, { requestOptions: { url: a3.url, method: a3.method, entityFqdn: i3.entityFqdn, methodFqn: i3.methodFqn } }), t3;
223
+ }
224
+ let l3 = await s3.json();
225
+ return { data: a3.migrationOptions?.optInTransformResponse && a3.transformResponse ? Array.isArray(a3.transformResponse) ? a3.transformResponse[0](l3) : a3.transformResponse(l3) : l3, headers: s3.headers, status: s3.status, statusText: s3.statusText };
226
+ } catch (e4) {
227
+ throw e4.message?.includes(`fetch is not defined`) && console.error(`Node.js v18+ is required`), e4;
228
+ }
229
+ }, fetchWithAuth: n2, wixAPIFetch: i2, getActiveToken: a2, getAuthHeaders: o2 }, { validateRequestSchema: u2 }));
230
+ }
231
+ var Re = class extends Error {
232
+ response;
233
+ requestId;
234
+ constructor(e2) {
235
+ super(), this.response = e2.response, this.requestId = e2.requestId;
236
+ }
237
+ };
238
+ var ze = (e2, t2, n2, r2) => new Re({ response: { data: { details: { ...!n2?.validationError && { applicationError: { description: t2, code: e2, data: r2 } }, ...n2 }, message: t2 }, status: e2 }, requestId: r2?.requestId });
239
+ var Be = `.`;
240
+ function Ve(e2, t2, n2) {
241
+ if (e2 == null) throw Error(`Cannot set value on null or undefined`);
242
+ let r2 = He(t2), i2 = e2;
243
+ for (let e3 = 0; e3 < r2.length; e3++) {
244
+ let t3 = r2[e3];
245
+ if (e3 === r2.length - 1) {
246
+ i2[t3] = n2;
247
+ break;
248
+ }
249
+ let a2 = r2[e3 + 1];
250
+ (!(t3 in i2) || i2[t3] == null || typeof i2[t3] != `object` || i2[t3] === null) && (i2[t3] = typeof a2 == `number` ? [] : {}), i2 = i2[t3];
251
+ }
252
+ return e2;
253
+ }
254
+ function He(e2) {
255
+ return Array.isArray(e2) ? e2 : e2.split(Be).map((e3) => Ue(e3) ? Number(e3) : e3);
256
+ }
257
+ function Ue(e2) {
258
+ return /^\d+$/.test(e2);
259
+ }
260
+ function We(e2) {
261
+ let t2 = {};
262
+ for (let [n2, r2] of Object.entries(e2)) Ge(n2) || Ve(t2, He(n2), r2);
263
+ return t2;
264
+ }
265
+ function Ge(e2) {
266
+ return e2 === `__proto__` || e2 === `constructor` || e2 === `prototype`;
267
+ }
268
+ var Ke = class {
269
+ BRACKET_PATTERN = /\[(\d+)\]/g;
270
+ NUMERIC_PATTERN = /^\d+$/;
271
+ ESCAPED_DOT_PATTERN = /\\\./g;
272
+ ESCAPED_LEFT_BRACKET_PATTERN = /\\\[/g;
273
+ ESCAPED_RIGHT_BRACKET_PATTERN = /\\\]/g;
274
+ SPLIT_PATTERN = /\.|\[(\d+)\]/g;
275
+ DOT_BEFORE_BRACKET_PATTERN = /\.\[/g;
276
+ ESCAPED_DOT_PLACEHOLDER = `__DOT__`;
277
+ ESCAPED_RIGHT_BRACKET_PLACEHOLDER = `__RB__`;
278
+ ESCAPED_LEFT_BRACKET_PLACEHOLDER = `__LB__`;
279
+ modifiedFields;
280
+ cleanedModifiedFields;
281
+ constructor(e2) {
282
+ this.modifiedFields = e2;
283
+ }
284
+ replaceEscapedCharacters(e2) {
285
+ return e2.replace(this.ESCAPED_DOT_PATTERN, this.ESCAPED_DOT_PLACEHOLDER).replace(this.ESCAPED_LEFT_BRACKET_PATTERN, this.ESCAPED_LEFT_BRACKET_PLACEHOLDER).replace(this.ESCAPED_RIGHT_BRACKET_PATTERN, this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER);
286
+ }
287
+ restoreEscapedCharacters(e2) {
288
+ return e2.replace(this.ESCAPED_DOT_PLACEHOLDER, `\\.`).replace(this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER, `\\]`).replace(this.ESCAPED_LEFT_BRACKET_PLACEHOLDER, `\\[`);
289
+ }
290
+ unflatten() {
291
+ return this.cleanedModifiedFields = Object.fromEntries(Object.entries(this.modifiedFields).map(([e2, t2]) => [this.replaceEscapedCharacters(this.bracketToDotNotation(e2)), t2])), We(this.cleanedModifiedFields);
292
+ }
293
+ flatten(e2) {
294
+ let t2 = {};
295
+ for (let n2 of Object.keys(this.cleanedModifiedFields)) {
296
+ let r2 = this.splitPath(n2), i2 = this.navigatePath(e2, r2);
297
+ t2 = { ...t2, ...i2 };
298
+ }
299
+ return Object.fromEntries(Object.entries(t2).map(([e3, t3]) => [this.restoreEscapedCharacters(e3), t3]));
300
+ }
301
+ splitPath(e2) {
302
+ let t2 = [], n2 = 0, r2 = Array.from(e2.matchAll(this.SPLIT_PATTERN));
303
+ for (let i2 of r2) i2.index > n2 && t2.push(e2.substring(n2, i2.index)), i2[1] && t2.push(i2[1]), n2 = i2.index + i2[0].length;
304
+ return n2 < e2.length && t2.push(e2.substring(n2)), t2;
305
+ }
306
+ navigatePath(e2, t2) {
307
+ let n2 = e2, r2 = [], i2 = (e3) => {
308
+ if (!Array.isArray(n2)) throw Error(`Expected array at path ${this.buildPathString(r2)}, but got ${typeof n2}`);
309
+ r2.push(`[${e3}]`), n2 = n2[parseInt(e3, 10)];
310
+ }, a2 = (e3, t3) => {
311
+ let i3 = e3 in ye ? ye[e3] : void 0;
312
+ if (i3 && i3 in t3) {
313
+ r2.push(i3), n2 = t3[i3];
314
+ return;
315
+ }
316
+ let a3 = Xe(e3);
317
+ if (a3 && a3 in t3) {
318
+ r2.push(a3), n2 = t3[a3];
319
+ return;
320
+ }
321
+ throw Error(`Cannot find key '${e3}' or its transformations at path ${this.buildPathString(r2)}`);
322
+ }, o2 = (e3, t3) => {
323
+ r2.push(e3), n2 = t3[e3];
324
+ };
325
+ for (let e3 of t2) {
326
+ if (this.NUMERIC_PATTERN.test(e3)) {
327
+ i2(e3);
328
+ continue;
329
+ }
330
+ if (typeof n2 != `object` || !n2) throw Error(`Cannot access property '${e3}' on ${typeof n2} at path ${this.buildPathString(r2)}`);
331
+ let t3 = n2;
332
+ if (e3 in n2) {
333
+ o2(e3, t3);
334
+ continue;
335
+ }
336
+ a2(e3, t3);
337
+ }
338
+ return { [this.buildPathString(r2)]: n2 };
339
+ }
340
+ buildPathString(e2) {
341
+ return e2.join(`.`).replace(this.DOT_BEFORE_BRACKET_PATTERN, `[`);
342
+ }
343
+ bracketToDotNotation(e2) {
344
+ return e2.replace(this.BRACKET_PATTERN, (t2, n2, r2) => r2 > 0 && e2[r2 - 1] === `\\` ? t2 : `.` + n2);
345
+ }
346
+ };
347
+ function qe(e2, t2) {
348
+ let n2 = e2?.modifiedFields;
349
+ if (!n2) return null;
350
+ let r2 = Je(n2);
351
+ if (!r2) return null;
352
+ let { unflattenedModifiedFields: i2, modifiedFieldsManipulator: a2 } = r2;
353
+ e2 = { ...e2, modifiedFields: i2 };
354
+ let o2 = t2(e2), s2 = o2?.modifiedFields;
355
+ if (!s2) return null;
356
+ let c2 = Ye(s2, a2);
357
+ return c2 === null ? null : (o2.modifiedFields = c2, o2);
358
+ }
359
+ function Je(e2) {
360
+ if (typeof e2 == `object` && e2 && !Array.isArray(e2)) try {
361
+ let t2 = new Ke(e2);
362
+ return { unflattenedModifiedFields: t2.unflatten(), modifiedFieldsManipulator: t2 };
363
+ } catch {
364
+ return null;
365
+ }
366
+ return null;
367
+ }
368
+ function Ye(e2, t2) {
369
+ if (typeof e2 == `object` && e2 && !Array.isArray(e2)) try {
370
+ return t2.flatten(e2);
371
+ } catch {
372
+ return null;
373
+ }
374
+ return null;
375
+ }
376
+ function Xe(e2) {
377
+ return e2.replace(/[-_\s]+(.)?/g, (e3, t2) => t2 ? t2.toUpperCase() : ``).replace(/^./, (e3) => e3.toLowerCase());
378
+ }
379
+ function Ze() {
380
+ return { emit(e2, ...t2) {
381
+ for (let n2 = 0, r2 = this.events[e2] || [], i2 = r2.length; n2 < i2; n2++) r2[n2](...t2);
382
+ }, events: {}, on(e2, t2) {
383
+ return (this.events[e2] ||= []).push(t2), () => {
384
+ this.events[e2] = this.events[e2]?.filter((e3) => t2 !== e3);
385
+ };
386
+ } };
387
+ }
388
+ var Qe = (e2) => e2.__type === `event-definition`;
389
+ function $e(e2, t2, n2, r2) {
390
+ let i2;
391
+ if (e2.isDomainEvent) {
392
+ let { deletedEvent: e3, actionEvent: t3, createdEvent: a3, updatedEvent: o3, ...s3 } = n2, c2 = { ...r2, ...s3 };
393
+ i2 = e3 ? e3?.deletedEntity ? { entity: e3?.deletedEntity, metadata: c2 } : { metadata: c2 } : t3 ? { data: t3.body, metadata: c2 } : o3 ? { entity: o3.currentEntity, metadata: c2, ...o3.modifiedFields ? { modifiedFields: o3.modifiedFields } : {} } : { entity: a3?.entity, metadata: c2 };
394
+ } else i2 = { data: n2, metadata: r2 };
395
+ let a2 = e2.transformations ?? ((e3) => e3), o2 = i2, s2 = i2;
396
+ if (s2.modifiedFields) {
397
+ let e3 = s2.modifiedFields;
398
+ if (typeof e3 == `object` && e3 && !Array.isArray(e3)) {
399
+ o2 = structuredClone(i2);
400
+ let e4 = qe(s2, a2);
401
+ if (e4) return t2(e4);
402
+ }
403
+ }
404
+ return t2(a2(o2));
405
+ }
406
+ function et(e2) {
407
+ let t2 = /* @__PURE__ */ new Map(), n2 = Ze();
408
+ return { initModule(e3) {
409
+ return (r2) => {
410
+ let i2 = t2.get(e3.type) ?? [];
411
+ i2.push({ eventDefinition: e3, handler: r2 }), t2.set(e3.type, i2), n2.emit(`registered`, e3);
412
+ };
413
+ }, client: { ...n2, getRegisteredEvents: () => t2, async process(e3, n3 = { expectedEvents: [] }) {
414
+ let { eventType: r2, identity: i2, instanceId: a2, payload: o2, accountInfo: s2 } = await this.parseJWT(e3), c2 = [...n3.expectedEvents, ...Array.from(t2.keys()).map((e4) => ({ type: e4 }))];
415
+ if (c2.length > 0 && !c2.some(({ type: e4 }) => e4 === r2)) throw Error(`Unexpected event type: ${r2}. Expected one of: ${c2.map((e4) => e4.type).join(`, `)}`);
416
+ let l2 = t2.get(r2) ?? [];
417
+ return await Promise.all(l2.map(({ eventDefinition: e4, handler: t3 }) => $e(e4, t3, o2, { instanceId: a2, identity: i2, accountInfo: s2 }))), { instanceId: a2, eventType: r2, payload: o2, identity: i2, accountInfo: s2 };
418
+ }, async processRequest(e3, t3) {
419
+ let n3 = await e3.text();
420
+ return this.process(n3, t3);
421
+ }, async parseJWT(t3) {
422
+ let n3 = e2();
423
+ if (!n3.decodeJWT) throw Error(`decodeJWT is not supported by the authentication strategy`);
424
+ let { decoded: r2, valid: i2 } = await n3.decodeJWT(t3);
425
+ if (!i2) throw Error(`JWT is not valid`);
426
+ if (typeof r2.data != `string`) throw Error(`Unexpected type of JWT data: expected string, got ${typeof r2.data}`);
427
+ let a2 = JSON.parse(r2.data), o2 = a2.eventType, s2 = a2.accountInfo, c2 = a2.instanceId, l2 = a2.identity ? JSON.parse(a2.identity) : void 0;
428
+ return { instanceId: c2, eventType: o2, payload: JSON.parse(a2.data), identity: l2, accountInfo: s2 };
429
+ }, async parseRequest(e3) {
430
+ let t3 = await e3.text();
431
+ return this.parseJWT(t3);
432
+ }, async executeHandlers(e3) {
433
+ let n3 = Array.from(t2.keys()).map((e4) => ({ type: e4 }));
434
+ if (n3.length > 0 && !n3.some(({ type: t3 }) => t3 === e3.eventType)) throw Error(`Unexpected event type: ${e3.eventType}. Expected one of: ${n3.map((e4) => e4.type).join(`, `)}`);
435
+ let r2 = t2.get(e3.eventType) ?? [];
436
+ await Promise.all(r2.map(({ eventDefinition: t3, handler: n4 }) => $e(t3, n4, e3.payload, { instanceId: e3.instanceId, identity: e3.identity })));
437
+ }, apps: { AppInstalled: y(`AppInstalled`)(), AppRemoved: y(`AppRemoved`)() } } };
438
+ }
439
+ var tt = (e2) => e2.__type === `service-plugin-definition`;
440
+ function nt(e2) {
441
+ let t2 = /* @__PURE__ */ new Map(), n2 = Ze();
442
+ return { initModule(e3) {
443
+ return (r2) => {
444
+ let i2 = t2.get(e3.componentType.toLowerCase()) ?? [];
445
+ i2.push({ servicePluginDefinition: e3, implementation: r2 }), t2.set(e3.componentType.toLowerCase(), i2), n2.emit(`registered`, e3);
446
+ };
447
+ }, client: { ...n2, getRegisteredServicePlugins: () => t2, async parseJWT(t3) {
448
+ let n3 = e2();
449
+ if (!n3.decodeJWT) throw Error(`decodeJWT is not supported by the authentication strategy`);
450
+ let { decoded: r2, valid: i2 } = await n3.decodeJWT(t3, true);
451
+ if (!i2) throw Error(`JWT is not valid`);
452
+ if (typeof r2.data != `object` || r2.data === null || !(`metadata` in r2.data) || typeof r2.data.metadata != `object` || r2.data.metadata === null || !(`appExtensionType` in r2.data.metadata) || typeof r2.data.metadata.appExtensionType != `string`) throw Error(`Unexpected JWT data: expected object with metadata.appExtensionType string`);
453
+ return r2.data;
454
+ }, async process(e3) {
455
+ let t3 = await this.parseJWT(e3.body);
456
+ return this.executeHandler(t3, e3.url);
457
+ }, async parseRequest(e3) {
458
+ let t3 = await e3.text();
459
+ return this.parseJWT(t3);
460
+ }, async processRequest(e3) {
461
+ let t3 = await this.parseRequest(e3);
462
+ return this.processParsedRequest(t3, e3.url);
463
+ }, async processParsedRequest(e3, t3) {
464
+ try {
465
+ let n3 = await this.executeHandler(e3, t3);
466
+ return Response.json(n3);
467
+ } catch (e4) {
468
+ if (e4.errorType === `SPI` && e4.applicationCode && e4.httpCode) return Response.json({ applicationError: { code: e4.applicationCode, data: e4.data } }, { status: e4.httpCode });
469
+ throw e4;
470
+ }
471
+ }, async executeHandler(e3, n3) {
472
+ let r2 = e3.metadata.appExtensionType.toLowerCase(), i2 = t2.get(r2) ?? [];
473
+ if (i2.length === 0) throw Error(`No service plugin implementations found for component type ${r2}`);
474
+ if (i2.length > 1) throw Error(`Multiple service plugin implementations found for component type ${r2}. This is currently not supported`);
475
+ let { implementation: a2, servicePluginDefinition: o2 } = i2[0], s2 = o2.methods.find((e4) => n3.endsWith(e4.primaryHttpMappingPath));
476
+ if (!s2) throw Error(`Unexpect request: request url did not match any method: ` + n3);
477
+ let c2 = a2[s2.name];
478
+ if (!c2) throw Error(`Got request for service plugin method ${s2.name} but no implementation was provided. Available methods: ${Object.keys(a2).join(`, `)}`);
479
+ return s2.transformations.toREST(await c2(s2.transformations.fromREST(e3)));
480
+ } } };
481
+ }
482
+ var b = `X-Wix-Consistent`;
483
+ function rt(e2) {
484
+ let t2 = e2.headers || { Authorization: `` }, n2 = { getAuthHeaders: (e3) => Promise.resolve({ headers: {} }) }, r2 = e2.auth, i2 = typeof r2 == `function` ? r2 : () => r2 ?? n2, a2 = () => i2().getAuthHeaders(e2.host), o2 = () => e2.fetch ?? fetch, s2 = async (n3, r3) => {
485
+ let i3 = o2(), s3 = await a2(), c3 = { ...r3?.headers ?? {}, ...s3.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [b]: t2[b] } : {} }, l3 = e2.host?.getErrorHandler?.();
486
+ try {
487
+ if (typeof n3 == `string` || n3 instanceof URL) {
488
+ let e3 = await i3(n3, { ...r3, headers: c3 });
489
+ l3?.handleError(e3, { requestOptions: { url: n3.toString(), method: r3?.method } });
490
+ let a3 = it(e3);
491
+ return a3 && (t2[b] = a3), e3;
492
+ }
493
+ {
494
+ for (let [e4, t3] of Object.entries(c3)) typeof t3 == `string` && n3.headers.set(e4, t3);
495
+ let e3 = await i3(n3, r3);
496
+ l3?.handleError(e3, { requestOptions: { url: n3.url, method: r3?.method } });
497
+ let a3 = it(e3);
498
+ return a3 && (t2[b] = a3), e3;
499
+ }
500
+ } catch (e3) {
501
+ throw l3?.handleError(e3, { requestOptions: { url: typeof n3 == `string` || n3 instanceof URL ? n3.toString() : n3.url, method: r3?.method } }), e3;
502
+ }
503
+ }, { client: c2, initModule: l2 } = nt(i2), { client: u2, initModule: d2 } = et(i2), f2 = async (n3, r3) => {
504
+ let i3 = o2(), s3 = await a2(), c3 = de(r3), l3 = await i3(n3, { ...r3, headers: { ...c3, ...t2, ...s3?.headers, ...r3?.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [b]: t2[b] } : {} } }), u3 = it(l3);
505
+ return u3 && (t2[b] = u3), l3;
506
+ }, p2 = (t3, n3) => {
507
+ if (Qe(t3)) return d2(t3);
508
+ if (tt(t3)) return l2(t3);
509
+ if (pe(t3) && e2.host) return me(t3, e2.host);
510
+ if (typeof t3 == `function`) {
511
+ if (`__type` in t3 && t3.__type === `wix_spi_error`) return t3;
512
+ let r3 = e2.host?.apiBaseUrl ?? `www.wixapis.com`, o3 = e2.useCDN === void 0 ? i2().shouldUseCDN : e2.useCDN;
513
+ return Le(ve(() => oe(t3)) ? ae(t3) : t3, n3 ?? {}, f2, e2.host?.getErrorHandler?.(), (e3, t4) => {
514
+ let n4 = new URL(e3, `https://${r3}`);
515
+ return n4.host = r3, n4.protocol = `https`, f2(n4.toString(), t4);
516
+ }, i2().getActiveToken, async () => a2(), { HTTPHost: r3 }, e2.host?.name, o3, e2.validateRequestSchema);
517
+ }
518
+ return fe(t3) ? Object.fromEntries(Object.entries(t3).map(([e3, n4]) => [e3, p2(n4, t3[se])])) : t3;
519
+ }, m2 = (e3) => {
520
+ for (let n3 in e3) t2[n3] = e3[n3];
521
+ };
522
+ return { ...e2.modules ? p2(e2.modules) : {}, get auth() {
523
+ let t3 = i2();
524
+ return t3.getAuthHeaders = t3.getAuthHeaders.bind(void 0, e2.host), t3;
525
+ }, setHeaders: m2, use: p2, enableContext(e3, t3 = { elevated: false }) {
526
+ e3 === `global` ? globalThis.__wix_context__ == null ? t3.elevated ? globalThis.__wix_context__ = { elevatedClient: this } : globalThis.__wix_context__ = { client: this } : t3.elevated ? globalThis.__wix_context__.elevatedClient = this : globalThis.__wix_context__.client = this : t3.elevated ? v.elevatedClient = this : v.client = this;
527
+ }, fetch: (t3, n3) => {
528
+ let r3 = e2.host?.apiBaseUrl ?? `www.wixapis.com`, i3 = new URL(t3, `https://${r3}`);
529
+ return i3.host = r3, i3.protocol = `https`, f2(i3.toString(), n3);
530
+ }, fetchWithAuth: s2, async graphql(t3, n3, r3 = { apiVersion: `alpha` }) {
531
+ let i3 = e2?.host?.apiBaseUrl ?? `www.wixapis.com`, a3 = await f2(`https://${i3}/graphql/${r3.apiVersion}`, { method: `POST`, headers: { "Content-Type": `application/json` }, body: JSON.stringify({ query: t3, variables: n3 }) });
532
+ if (a3.status !== 200) throw new le(`GraphQL request failed with status ${a3.status}`, a3);
533
+ let { data: o3, errors: s3 } = await a3.json();
534
+ return { data: o3 ?? {}, errors: s3 };
535
+ }, webhooks: u2, servicePlugins: c2 };
536
+ }
537
+ function it(e2) {
538
+ return e2.headers?.get(`X-Wix-Consistent`) ?? e2.headers?.get(`x-wix-consistent`);
539
+ }
540
+ var at = { _id: `id`, _createdDate: `createdDate`, _updatedDate: `updatedDate` };
541
+ var ot = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
542
+ var st = `items`;
543
+ var ct = `pagingMetadata`;
544
+ var lt = at;
545
+ function ut(e2, t2) {
546
+ return e2?.split(`.`).map((e3) => t2?.[e3] ?? e3).join(`.`);
547
+ }
548
+ function x(e2, { transformSystemFields: t2 = true } = {}) {
549
+ return t2 ? ut(e2, lt) : e2;
550
+ }
551
+ var dt = `sort.fieldName`;
552
+ function ft(e2, t2, n2) {
553
+ return (e2 === dt || e2.endsWith(`.${dt}`)) && typeof t2 == `string` ? ut(t2, n2) : t2;
554
+ }
555
+ function pt(e2, t2, n2) {
556
+ let r2 = (e3) => n2.includes(e3), i2 = (e3, n3) => {
557
+ if (Array.isArray(e3)) e3.forEach((e4) => {
558
+ i2(e4, n3);
559
+ });
560
+ else if (typeof e3 == `object` && e3) {
561
+ let a2 = e3;
562
+ Object.keys(a2).forEach((e4) => {
563
+ let o2 = n3 === `` ? e4 : `${n3}.${e4}`;
564
+ if (r2(o2)) return;
565
+ let s2 = mt(e4, t2);
566
+ s2 !== e4 && !(s2 in a2) && (a2[s2] = a2[e4], delete a2[e4]), a2[s2] = ft(o2, a2[s2], t2), i2(a2[s2], o2);
567
+ });
568
+ }
569
+ };
570
+ return i2(e2, ``), e2;
571
+ }
572
+ function mt(e2, t2) {
573
+ let n2;
574
+ return n2 = e2.includes(`.`) ? e2.split(`.`).map((e3) => t2[e3] ?? e3).join(`.`) : t2[e2] ?? e2, n2;
575
+ }
576
+ function S(e2, t2 = []) {
577
+ return pt(e2, at, t2);
578
+ }
579
+ function C(e2, t2 = []) {
580
+ return pt(e2, ot, t2);
581
+ }
582
+ function w(e2) {
583
+ return e2 ? new Date(e2) : void 0;
584
+ }
585
+ var ht = /* @__PURE__ */ new WeakMap();
586
+ function gt() {
587
+ return { leaves: void 0, fields: void 0, mapFields: void 0, anyField: void 0 };
588
+ }
589
+ function _t(e2, t2) {
590
+ let n2 = e2.get(t2);
591
+ return n2 || (n2 = gt(), e2.set(t2, n2)), n2;
592
+ }
593
+ function vt(e2, t2) {
594
+ return t2 === `*` ? (e2.anyField ??= gt(), e2.anyField) : t2.endsWith(`{}`) ? (e2.mapFields ??= /* @__PURE__ */ new Map(), _t(e2.mapFields, t2.slice(0, -2))) : (e2.fields ??= /* @__PURE__ */ new Map(), _t(e2.fields, t2));
595
+ }
596
+ function yt(e2) {
597
+ let t2 = gt();
598
+ for (let n2 of e2) {
599
+ let e3 = n2.path.split(`.`).reduce(vt, t2);
600
+ e3.leaves ??= [], e3.leaves.push(n2);
601
+ }
602
+ return t2;
603
+ }
604
+ function bt(e2) {
605
+ let t2 = ht.get(e2);
606
+ return t2 || (t2 = yt(e2), ht.set(e2, t2)), t2;
607
+ }
608
+ function xt(e2) {
609
+ return typeof e2 == `object` && !!e2;
610
+ }
611
+ function St(e2, { isRepeated: t2, isMap: n2 }, r2) {
612
+ return t2 ? Array.isArray(e2) ? e2.map(r2) : e2 : n2 ? xt(e2) ? Object.fromEntries(Object.entries(e2).map(([e3, t3]) => [e3, r2(t3)])) : e2 : r2(e2);
613
+ }
614
+ function Ct(e2, t2, n2) {
615
+ xt(e2) && Et(e2, t2, n2);
616
+ }
617
+ function wt(e2, t2, n2) {
618
+ for (let [r2, i2] of t2) {
619
+ if (!(r2 in e2)) continue;
620
+ if (i2.leaves) for (let t4 of i2.leaves) e2[r2] = St(e2[r2], t4, n2);
621
+ let t3 = e2[r2];
622
+ Array.isArray(t3) ? t3.forEach((e3) => Ct(e3, i2, n2)) : Ct(t3, i2, n2);
623
+ }
624
+ }
625
+ function Tt(e2, t2, n2) {
626
+ for (let [r2, i2] of t2) {
627
+ let t3 = e2[r2];
628
+ xt(t3) && Object.values(t3).forEach((e3) => Ct(e3, i2, n2));
629
+ }
630
+ }
631
+ function Et(e2, { fields: t2, mapFields: n2, anyField: r2 }, i2) {
632
+ t2 && wt(e2, t2, i2), n2 && Tt(e2, n2, i2), r2 && Object.values(e2).forEach((e3) => Ct(e3, r2, i2));
633
+ }
634
+ function T(e2, t2) {
635
+ if (!xt(e2)) return e2;
636
+ for (let { paths: n2, transformFn: r2 } of t2) Et(e2, bt(n2), r2);
637
+ return e2;
638
+ }
639
+ function Dt(e2) {
640
+ return Mt(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
641
+ }
642
+ var Ot = /([\p{Ll}\d])(\p{Lu})/gu;
643
+ var kt = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
644
+ var At = `$1\0$2`;
645
+ var jt = /[^\p{L}\d]+/giu;
646
+ function Mt(e2) {
647
+ let t2 = e2.trim();
648
+ t2 = t2.replace(Ot, At).replace(kt, At), t2 = t2.replace(jt, `\0`);
649
+ let n2 = 0, r2 = t2.length;
650
+ for (; t2.charAt(n2) === `\0`; ) n2++;
651
+ if (n2 === r2) return [];
652
+ for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
653
+ return t2.slice(n2, r2).split(/\0/g);
654
+ }
655
+ var Nt = (e2) => `validationError` in (e2.response?.data?.details ?? {});
656
+ var Pt = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
657
+ var Ft = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
658
+ function E(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
659
+ if (typeof e2 != `object` || !e2) throw e2;
660
+ if (Nt(e2)) return It(e2, t2, n2);
661
+ if (Pt(e2)) return Rt(e2);
662
+ if (Ft(e2)) {
663
+ let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: Dt(n3), data: {} }, requestId: e2.requestId };
664
+ return Lt(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
665
+ }
666
+ return zt(e2);
667
+ }
668
+ var It = (e2, t2, n2) => {
669
+ let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = Bt(t2, a2, n2)?.sort((e3, t3) => e3.field < t3.field ? -1 : 1), s2 = `INVALID_ARGUMENT: ${o2?.map(({ field: e3, description: t3 }) => `"${e3}" ${t3}`)?.join(`, `)}`, c2 = { validationError: { fieldViolations: o2 }, requestId: i2 };
670
+ return Lt(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e2.response?.status, requestId: i2 } });
671
+ };
672
+ var Lt = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
673
+ var Rt = (e2) => {
674
+ let t2 = e2.response?.status, n2 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n2, i2 = e2.response?.data?.details?.applicationError?.description ?? n2, a2 = e2.response?.data?.details?.applicationError?.code ?? Dt(n2), o2 = e2.response?.data?.details?.applicationError?.data ?? {}, s2 = r2 === i2 ? r2 : `${r2}: ${i2}`, c2 = { applicationError: { description: i2, code: a2, data: o2 }, requestId: e2.requestId };
675
+ return Lt(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e2.requestId } });
676
+ };
677
+ var zt = (e2) => Lt(e2, { message: e2.requestId ? `System error occurred, request-id: ${e2.requestId}` : `System error occurred: ${JSON.stringify(e2)}`, extraProperties: { requestId: e2.requestId, status: e2.response?.status, code: Dt(e2.response?.statusText ?? `UNKNOWN`), ...!e2.response && { runtimeError: e2 } } });
678
+ var Bt = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
679
+ let a2 = { ...e2, ...t2 }, o2 = Object.keys(a2);
680
+ return r2?.filter((e3) => !r2.some((t3) => t3.field.length > e3.field.length && t3.field.startsWith(e3.field) && o2.includes(t3.field))).map((e3) => {
681
+ let r3 = t2[e3.field];
682
+ if (r3) return { ...e3, field: Vt(r3, i2) };
683
+ let s2 = o2?.sort((e4, t3) => t3.length - e4.length)?.find((t3) => e3.field.startsWith(t3));
684
+ if (s2) {
685
+ let t3 = a2[s2];
686
+ if (t3) return { ...e3, field: e3.field.replace(s2, Vt(t3, i2)) };
687
+ }
688
+ return n2 ? { ...e3, field: `${i2[0]}.${e3.field}` } : e3;
689
+ });
690
+ };
691
+ var Vt = (e2, t2) => {
692
+ let n2 = Ht(e2);
693
+ return n2 == null ? e2 : e2.replace(`$[${n2}]`, t2[n2]);
694
+ };
695
+ var Ht = (e2) => {
696
+ let t2 = e2.match(/\$\[(?<argIndex>\d+)\]/);
697
+ return t2 && t2.groups && Number(t2.groups.argIndex);
698
+ };
699
+ function Ut() {
700
+ let e2 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
701
+ if (e2) return { initWixModules(t3, n3) {
702
+ return Wt(() => e2(t3, n3));
703
+ }, fetchWithAuth() {
704
+ throw Error(`fetchWithAuth is not available in this context`);
705
+ }, graphql() {
706
+ throw Error(`graphql is not available in this context`);
707
+ } };
708
+ let t2 = typeof $wixContext < `u` ? $wixContext.client : v.client === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.client : v.client, n2 = typeof $wixContext < `u` ? $wixContext.elevatedClient : v.elevatedClient === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.elevatedClient : v.elevatedClient;
709
+ if (t2 || n2) return { initWixModules(e3, r2) {
710
+ if (r2) {
711
+ if (!n2) throw Error(`An elevated client is required to use elevated modules. Make sure to initialize the Wix context with an elevated client before using elevated SDK modules`);
712
+ return Wt(() => n2.use(e3));
713
+ }
714
+ if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
715
+ return Wt(() => t2.use(e3));
716
+ }, fetchWithAuth: (e3, n3) => {
717
+ if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
718
+ return t2.fetchWithAuth(e3, n3);
719
+ }, getAuth() {
720
+ if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
721
+ return t2.auth;
722
+ }, async graphql(e3, n3, r2) {
723
+ if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
724
+ return t2.graphql(e3, n3, r2);
725
+ } };
726
+ }
727
+ function Wt(e2) {
728
+ let t2 = globalThis.__wix_context__, n2 = { client: v.client, elevatedClient: v.elevatedClient }, r2;
729
+ globalThis.__wix_context__ = void 0, v.client = void 0, v.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
730
+ try {
731
+ return e2();
732
+ } finally {
733
+ globalThis.__wix_context__ = t2, v.client = n2.client, v.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
734
+ }
735
+ }
736
+ function Gt(e2, t2) {
737
+ return (...n2) => {
738
+ let r2 = Ut();
739
+ return r2 ? r2.initWixModules(e2, t2).apply(void 0, n2) : e2.apply(void 0, n2);
740
+ };
741
+ }
742
+ function Kt(e2) {
743
+ let t2 = (...t3) => {
744
+ let n2 = Ut();
745
+ return n2 ? n2.initWixModules(e2).apply(void 0, t3) : () => ({ slug: e2.type });
746
+ };
747
+ return t2.__type = e2.__type, t2.type = e2.type, t2.isDomainEvent = e2.isDomainEvent, t2.transformations = e2.transformations, t2;
748
+ }
749
+ function D(e2, t2 = false) {
750
+ return Gt(e2, t2);
751
+ }
752
+ function O(e2, t2) {
753
+ let n2 = qt(e2), r2 = Object.entries(n2).some(([e3, t3]) => e3.includes(`.`) || Array.isArray(t3) && t3.some((e4) => typeof e4 == `object`));
754
+ return t2 && r2 ? new URLSearchParams({ ".r": Yt(JSON.stringify(e2)) }) : Object.entries(n2).reduce((e3, [t3, n3]) => ((Array.isArray(n3) ? n3 : [n3]).forEach((r3) => {
755
+ r3 == null || Array.isArray(n3) && typeof r3 == `object` || e3.append(t3, r3);
756
+ }), e3), new URLSearchParams());
757
+ }
758
+ function k(e2) {
759
+ let t2 = ln(sn(e2.host), e2.domainToMappings);
760
+ return vn(hn(e2.protoPath, e2.data || {}), t2);
761
+ }
762
+ function qt(e2, t2 = ``) {
763
+ let n2 = {};
764
+ return Object.entries(e2).forEach(([e3, r2]) => {
765
+ let i2 = typeof r2 == `object` && !!r2 && !Array.isArray(r2), a2 = Jt(t2, e3);
766
+ if (i2) {
767
+ let e4 = qt(r2, a2);
768
+ Object.assign(n2, e4);
769
+ } else n2[a2] = r2;
770
+ }), n2;
771
+ }
772
+ function Jt(e2, t2) {
773
+ return `${e2}${e2 ? `.` : ``}${t2}`;
774
+ }
775
+ var Yt = (e2) => {
776
+ let t2 = new TextEncoder().encode(e2);
777
+ return (typeof btoa < `u` ? btoa(String.fromCodePoint(...t2)) : Buffer.from(e2, `utf-8`).toString(`base64`)).replace(/=/g, ``).replace(/\+/g, `-`).replace(/\//g, `_`);
778
+ };
779
+ var Xt = [`wix.com`, `editorx.com`];
780
+ var Zt = `_`;
781
+ var Qt = `*.`;
782
+ var $t = RegExp(`\\.(${Xt.join(`|`)})$`);
783
+ var en = [`42.wixprod.net`, `uw2-edt-1.wixprod.net`, `virginia-edt.wixprod.net`];
784
+ var tn = { "payments.base44.com": `manage.wix.com`, "create.editorx.com": `editor.editorx.com` };
785
+ var nn = `dev.wix-code.com`;
786
+ var rn = /{(.*)}/;
787
+ var an = RegExp(`\\.(${en.join(`|`)})$`);
788
+ var on = RegExp(`.*\\.${nn}$`);
789
+ function sn(e2) {
790
+ return cn(e2).replace($t, `._base_domain_`).replace(an, `._api_base_domain_`).replace(on, `*.dev.wix-code.com`);
791
+ }
792
+ function cn(e2) {
793
+ return tn[e2] ?? e2;
794
+ }
795
+ function ln(e2, t2) {
796
+ let n2 = t2[e2];
797
+ if (n2) return n2;
798
+ let r2 = un(e2, t2) ?? dn(e2, t2);
799
+ if (!r2) {
800
+ if (pn(e2)) {
801
+ let e3 = t2[mn];
802
+ if (e3) return e3;
803
+ }
804
+ let n3 = t2[Zt];
805
+ if (n3) return n3;
806
+ }
807
+ return r2 ?? [];
808
+ }
809
+ function un(e2, t2) {
810
+ return Object.entries(t2).find(([t3]) => {
811
+ let [, ...n2] = e2.split(`.`);
812
+ return n2.join(`.`) === t3;
813
+ })?.[1];
814
+ }
815
+ function dn(e2, t2) {
816
+ let [n2] = Object.entries(t2).filter(([t3]) => fn(e2, t3)).sort(([e3], [t3]) => t3.length - e3.length);
817
+ if (!n2) return;
818
+ let [, r2] = n2;
819
+ return r2;
820
+ }
821
+ function fn(e2, t2) {
822
+ if (!t2.startsWith(Qt)) return false;
823
+ let n2 = t2.slice(1);
824
+ return e2.length > n2.length && e2.endsWith(n2);
825
+ }
826
+ function pn(e2) {
827
+ return !!e2.match(/\._base_domain_$/);
828
+ }
829
+ var mn = `www._base_domain_`;
830
+ function hn(e2, t2) {
831
+ return e2.split(`/`).map((e3) => gn(e3, t2)).join(`/`);
832
+ }
833
+ function gn(e2, t2) {
834
+ let n2 = e2.match(rn) || [], r2 = n2[1];
835
+ return r2 ? _n(t2, r2, e2, e2.replace(n2[0], ``)) : e2;
836
+ }
837
+ function _n(e2, t2, n2, r2) {
838
+ let i2 = e2;
839
+ for (let e3 of t2.split(`.`)) {
840
+ if (!i2) return n2;
841
+ i2 = i2[e3];
842
+ }
843
+ return `${i2}${r2}`;
844
+ }
845
+ function vn(e2, t2) {
846
+ let n2 = t2?.find((t3) => e2.startsWith(t3.destPath));
847
+ return n2 ? n2.srcPath + e2.slice(n2.destPath.length) : e2;
848
+ }
849
+ function A(e2) {
850
+ return Kt(e2);
851
+ }
852
+ function yn(e2) {
853
+ return isFinite(e2) ? e2 : e2.toString();
854
+ }
855
+ function j(e2) {
856
+ return e2 === `NaN` ? NaN : e2 === `Infinity` ? 1 / 0 : e2 === `-Infinity` ? -1 / 0 : e2;
857
+ }
858
+ var bn = `x-wix-linguist`;
859
+ var xn = `00000000-0000-0000-0000-000000000000`;
860
+ var Sn = `false`;
861
+ var Cn = () => {
862
+ let e2 = En(`language`), t2 = En(`locale`);
863
+ if (e2) return { [bn]: [e2, t2 || e2, Sn, xn].join(`|`) };
864
+ };
865
+ function wn() {
866
+ let e2 = null, t2 = null;
867
+ return { promise: new Promise((n2, r2) => {
868
+ e2 = n2, t2 = r2;
869
+ }), resolve: e2, reject: t2 };
870
+ }
871
+ var Tn = () => (typeof window < `u` ? window.commonConfig : void 0) ?? globalThis.commonConfig;
872
+ var En = (e2) => Tn()?.[e2];
873
+ var Dn = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host: (t2) => {
874
+ let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e2(t2), o2 = kn();
875
+ return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language: En(`language`), locale: En(`locale`), get passThroughHeaders() {
876
+ return Cn();
877
+ } } };
878
+ }, auth: (e3) => {
879
+ let t2 = typeof window < `u` ? window.wixEmbedsAPI : void 0;
880
+ !e3 && On() && (e3 = t2?.getAccessTokenFunction?.());
881
+ let n2 = false, { resolve: r2, promise: i2 } = wn();
882
+ return { getAuthHeaders: async () => {
883
+ if (!e3 && n2 && (e3 = await i2), !e3) throw Error(`Failed to resolve auth token`);
884
+ return { headers: { Authorization: await e3() } };
885
+ }, getAccessTokenInjector: () => (n2 = true, (e4) => {
886
+ r2(e4);
887
+ }) };
888
+ } });
889
+ function On() {
890
+ return typeof document < `u` && document.currentScript?.tagName === `SCRIPT`;
891
+ }
892
+ function kn() {
893
+ let e2 = (typeof window < `u` ? window.wixEmbedsAPI : void 0)?.getExternalBaseUrl?.();
894
+ if (!e2) return;
895
+ let t2 = new URL(e2);
896
+ return t2?.pathname && t2.pathname !== `/` ? `${t2.hostname}${t2.pathname}` : t2.hostname;
897
+ }
898
+ var An = ({ clientSdk: e2, applicationId: t2 }) => ({ invoke: async ({ namespace: n2, method: r2, args: i2 }) => {
899
+ if (!e2) throw Error(`Wix Site SDK only works in a Wix site environment. Learn more: https://dev.wix.com/docs/sdk/host-modules/site/introduction`);
900
+ return e2.invoke({ namespace: n2, method: r2, args: i2, applicationId: t2, accessToken: `accessToken` });
901
+ }, getAccessToken: () => {
902
+ throw Error(`Not implemented`);
903
+ }, observeState: () => ({ disconnect: () => {
904
+ } }) });
905
+ var jn = Dn({ createHost: function(e2) {
906
+ let t2 = (typeof $wixContext < `u` ? $wixContext.clientSdk : void 0) ?? e2?.clientSdk ?? (typeof window < `u` ? window?.clientSdk : void 0), { applicationId: n2 } = e2 || {};
907
+ if (!n2) throw Error(`"createHost" was called without a required field "applicationId"`);
908
+ return { channel: An({ clientSdk: t2, applicationId: n2 }), close: () => {
909
+ } };
910
+ } });
911
+ var Mn = (e2, t2) => {
912
+ let n2 = jn.host({ applicationId: e2, componentId: t2 }), r2 = jn.auth();
913
+ return rt({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
914
+ };
915
+ var Nn = (e2) => Mn(`215238eb-22a5-4c36-9e7b-e7c08025e04e`, e2);
916
+ var Pn = class {
917
+ constructor() {
918
+ this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
919
+ }
920
+ subscribe(e2) {
921
+ return this.listeners.add(e2), this.onSubscribe(), () => {
922
+ this.listeners.delete(e2), this.onUnsubscribe();
923
+ };
924
+ }
925
+ hasListeners() {
926
+ return this.listeners.size > 0;
927
+ }
928
+ onSubscribe() {
929
+ }
930
+ onUnsubscribe() {
931
+ }
932
+ };
933
+ var Fn = new class extends Pn {
934
+ #e;
935
+ #t;
936
+ #n;
937
+ constructor() {
938
+ super(), this.#n = (e2) => {
939
+ if (typeof window < `u` && window.addEventListener) {
940
+ let t2 = () => e2();
941
+ return window.addEventListener(`visibilitychange`, t2, false), () => {
942
+ window.removeEventListener(`visibilitychange`, t2);
943
+ };
944
+ }
945
+ };
946
+ }
947
+ onSubscribe() {
948
+ this.#t || this.setEventListener(this.#n);
949
+ }
950
+ onUnsubscribe() {
951
+ this.hasListeners() || (this.#t?.(), this.#t = void 0);
952
+ }
953
+ setEventListener(e2) {
954
+ this.#n = e2, this.#t?.(), this.#t = e2((e3) => {
955
+ typeof e3 == `boolean` ? this.setFocused(e3) : this.onFocus();
956
+ });
957
+ }
958
+ setFocused(e2) {
959
+ this.#e !== e2 && (this.#e = e2, this.onFocus());
960
+ }
961
+ onFocus() {
962
+ let e2 = this.isFocused();
963
+ this.listeners.forEach((t2) => {
964
+ t2(e2);
965
+ });
966
+ }
967
+ isFocused() {
968
+ return typeof this.#e == `boolean` ? this.#e : globalThis.document?.visibilityState !== `hidden`;
969
+ }
970
+ }();
971
+ var In = { setTimeout: (e2, t2) => setTimeout(e2, t2), clearTimeout: (e2) => clearTimeout(e2), setInterval: (e2, t2) => setInterval(e2, t2), clearInterval: (e2) => clearInterval(e2) };
972
+ var M = new class {
973
+ #e = In;
974
+ setTimeoutProvider(e2) {
975
+ this.#e = e2;
976
+ }
977
+ setTimeout(e2, t2) {
978
+ return this.#e.setTimeout(e2, t2);
979
+ }
980
+ clearTimeout(e2) {
981
+ this.#e.clearTimeout(e2);
982
+ }
983
+ setInterval(e2, t2) {
984
+ return this.#e.setInterval(e2, t2);
985
+ }
986
+ clearInterval(e2) {
987
+ this.#e.clearInterval(e2);
988
+ }
989
+ }();
990
+ function Ln(e2) {
991
+ setTimeout(e2, 0);
992
+ }
993
+ var Rn = typeof window > `u` || `Deno` in globalThis;
994
+ function N() {
995
+ }
996
+ function zn(e2, t2) {
997
+ return typeof e2 == `function` ? e2(t2) : e2;
998
+ }
999
+ function Bn(e2) {
1000
+ return typeof e2 == `number` && e2 >= 0 && e2 !== 1 / 0;
1001
+ }
1002
+ function Vn(e2, t2) {
1003
+ return Math.max(e2 + (t2 || 0) - Date.now(), 0);
1004
+ }
1005
+ function P(e2, t2) {
1006
+ return typeof e2 == `function` ? e2(t2) : e2;
1007
+ }
1008
+ function F(e2, t2) {
1009
+ return typeof e2 == `function` ? e2(t2) : e2;
1010
+ }
1011
+ function Hn(e2, t2) {
1012
+ let { type: n2 = `all`, exact: r2, fetchStatus: i2, predicate: a2, queryKey: o2, stale: s2 } = e2;
1013
+ if (o2) {
1014
+ if (r2) {
1015
+ if (t2.queryHash !== Wn(o2, t2.options)) return false;
1016
+ } else if (!L(t2.queryKey, o2)) return false;
1017
+ }
1018
+ if (n2 !== `all`) {
1019
+ let e3 = t2.isActive();
1020
+ if (n2 === `active` && !e3 || n2 === `inactive` && e3) return false;
1021
+ }
1022
+ return !(typeof s2 == `boolean` && t2.isStale() !== s2 || i2 && i2 !== t2.state.fetchStatus || a2 && !a2(t2));
1023
+ }
1024
+ function Un(e2, t2) {
1025
+ let { exact: n2, status: r2, predicate: i2, mutationKey: a2 } = e2;
1026
+ if (a2) {
1027
+ if (!t2.options.mutationKey) return false;
1028
+ if (n2) {
1029
+ if (I(t2.options.mutationKey) !== I(a2)) return false;
1030
+ } else if (!L(t2.options.mutationKey, a2)) return false;
1031
+ }
1032
+ return !(r2 && t2.state.status !== r2 || i2 && !i2(t2));
1033
+ }
1034
+ function Wn(e2, t2) {
1035
+ return (t2?.queryKeyHashFn || I)(e2);
1036
+ }
1037
+ function I(e2) {
1038
+ return JSON.stringify(e2, (e3, t2) => Yn(t2) ? Object.keys(t2).sort().reduce((e4, n2) => (e4[n2] = t2[n2], e4), {}) : t2);
1039
+ }
1040
+ function L(e2, t2) {
1041
+ return e2 === t2 ? true : typeof e2 == typeof t2 && e2 && t2 && typeof e2 == `object` && typeof t2 == `object` ? Object.keys(t2).every((n2) => L(e2[n2], t2[n2])) : false;
1042
+ }
1043
+ var Gn = Object.prototype.hasOwnProperty;
1044
+ function Kn(e2, t2, n2 = 0) {
1045
+ if (e2 === t2) return e2;
1046
+ if (n2 > 500) return t2;
1047
+ let r2 = Jn(e2) && Jn(t2);
1048
+ if (!r2 && !(Yn(e2) && Yn(t2))) return t2;
1049
+ let i2 = (r2 ? e2 : Object.keys(e2)).length, a2 = r2 ? t2 : Object.keys(t2), o2 = a2.length, s2 = r2 ? Array(o2) : {}, c2 = 0;
1050
+ for (let l2 = 0; l2 < o2; l2++) {
1051
+ let o3 = r2 ? l2 : a2[l2], u2 = e2[o3], d2 = t2[o3];
1052
+ if (u2 === d2) {
1053
+ s2[o3] = u2, (r2 ? l2 < i2 : Gn.call(e2, o3)) && c2++;
1054
+ continue;
1055
+ }
1056
+ if (u2 === null || d2 === null || typeof u2 != `object` || typeof d2 != `object`) {
1057
+ s2[o3] = d2;
1058
+ continue;
1059
+ }
1060
+ let f2 = Kn(u2, d2, n2 + 1);
1061
+ s2[o3] = f2, f2 === u2 && c2++;
1062
+ }
1063
+ return i2 === o2 && c2 === i2 ? e2 : s2;
1064
+ }
1065
+ function qn(e2, t2) {
1066
+ if (!t2 || Object.keys(e2).length !== Object.keys(t2).length) return false;
1067
+ for (let n2 in e2) if (e2[n2] !== t2[n2]) return false;
1068
+ return true;
1069
+ }
1070
+ function Jn(e2) {
1071
+ return Array.isArray(e2) && e2.length === Object.keys(e2).length;
1072
+ }
1073
+ function Yn(e2) {
1074
+ if (!Xn(e2)) return false;
1075
+ let t2 = e2.constructor;
1076
+ if (t2 === void 0) return true;
1077
+ let n2 = t2.prototype;
1078
+ return !(!Xn(n2) || !n2.hasOwnProperty(`isPrototypeOf`) || Object.getPrototypeOf(e2) !== Object.prototype);
1079
+ }
1080
+ function Xn(e2) {
1081
+ return Object.prototype.toString.call(e2) === `[object Object]`;
1082
+ }
1083
+ function Zn(e2) {
1084
+ return new Promise((t2) => {
1085
+ M.setTimeout(t2, e2);
1086
+ });
1087
+ }
1088
+ function Qn(e2, t2, n2) {
1089
+ return typeof n2.structuralSharing == `function` ? n2.structuralSharing(e2, t2) : n2.structuralSharing === false ? t2 : Kn(e2, t2);
1090
+ }
1091
+ function $n(e2) {
1092
+ return e2;
1093
+ }
1094
+ function er(e2, t2, n2 = 0) {
1095
+ let r2 = [...e2, t2];
1096
+ return n2 && r2.length > n2 ? r2.slice(1) : r2;
1097
+ }
1098
+ function tr(e2, t2, n2 = 0) {
1099
+ let r2 = [t2, ...e2];
1100
+ return n2 && r2.length > n2 ? r2.slice(0, -1) : r2;
1101
+ }
1102
+ var nr = Symbol();
1103
+ function rr(e2, t2) {
1104
+ return !e2.queryFn && t2?.initialPromise ? () => t2.initialPromise : !e2.queryFn || e2.queryFn === nr ? () => Promise.reject(Error(`Missing queryFn: '${e2.queryHash}'`)) : e2.queryFn;
1105
+ }
1106
+ function ir(e2, t2) {
1107
+ return typeof e2 == `function` ? e2(...t2) : !!e2;
1108
+ }
1109
+ function ar(e2, t2, n2) {
1110
+ let r2 = false, i2;
1111
+ return Object.defineProperty(e2, "signal", { enumerable: true, get: () => (i2 ??= t2(), r2 ? i2 : (r2 = true, i2.aborted ? n2() : i2.addEventListener(`abort`, n2, { once: true }), i2)) }), e2;
1112
+ }
1113
+ var R = /* @__PURE__ */ (() => {
1114
+ let e2 = () => Rn;
1115
+ return { isServer() {
1116
+ return e2();
1117
+ }, setIsServer(t2) {
1118
+ e2 = t2;
1119
+ } };
1120
+ })();
1121
+ function or() {
1122
+ let e2, t2, n2 = new Promise((n3, r3) => {
1123
+ e2 = n3, t2 = r3;
1124
+ });
1125
+ n2.status = `pending`, n2.catch(() => {
1126
+ });
1127
+ function r2(e3) {
1128
+ Object.assign(n2, e3), delete n2.resolve, delete n2.reject;
1129
+ }
1130
+ return n2.resolve = (t3) => {
1131
+ r2({ status: `fulfilled`, value: t3 }), e2(t3);
1132
+ }, n2.reject = (e3) => {
1133
+ r2({ status: `rejected`, reason: e3 }), t2(e3);
1134
+ }, n2;
1135
+ }
1136
+ var sr = Ln;
1137
+ function cr() {
1138
+ let e2 = [], t2 = 0, n2 = (e3) => {
1139
+ e3();
1140
+ }, r2 = (e3) => {
1141
+ e3();
1142
+ }, i2 = sr, a2 = (r3) => {
1143
+ t2 ? e2.push(r3) : i2(() => {
1144
+ n2(r3);
1145
+ });
1146
+ }, o2 = () => {
1147
+ let t3 = e2;
1148
+ e2 = [], t3.length && i2(() => {
1149
+ r2(() => {
1150
+ t3.forEach((e3) => {
1151
+ n2(e3);
1152
+ });
1153
+ });
1154
+ });
1155
+ };
1156
+ return { batch: (e3) => {
1157
+ let n3;
1158
+ t2++;
1159
+ try {
1160
+ n3 = e3();
1161
+ } finally {
1162
+ t2--, t2 || o2();
1163
+ }
1164
+ return n3;
1165
+ }, batchCalls: (e3) => (...t3) => {
1166
+ a2(() => {
1167
+ e3(...t3);
1168
+ });
1169
+ }, schedule: a2, setNotifyFunction: (e3) => {
1170
+ n2 = e3;
1171
+ }, setBatchNotifyFunction: (e3) => {
1172
+ r2 = e3;
1173
+ }, setScheduler: (e3) => {
1174
+ i2 = e3;
1175
+ } };
1176
+ }
1177
+ var z = cr();
1178
+ var lr = new class extends Pn {
1179
+ #e = true;
1180
+ #t;
1181
+ #n;
1182
+ constructor() {
1183
+ super(), this.#n = (e2) => {
1184
+ if (typeof window < `u` && window.addEventListener) {
1185
+ let t2 = () => e2(true), n2 = () => e2(false);
1186
+ return window.addEventListener(`online`, t2, false), window.addEventListener(`offline`, n2, false), () => {
1187
+ window.removeEventListener(`online`, t2), window.removeEventListener(`offline`, n2);
1188
+ };
1189
+ }
1190
+ };
1191
+ }
1192
+ onSubscribe() {
1193
+ this.#t || this.setEventListener(this.#n);
1194
+ }
1195
+ onUnsubscribe() {
1196
+ this.hasListeners() || (this.#t?.(), this.#t = void 0);
1197
+ }
1198
+ setEventListener(e2) {
1199
+ this.#n = e2, this.#t?.(), this.#t = e2(this.setOnline.bind(this));
1200
+ }
1201
+ setOnline(e2) {
1202
+ this.#e !== e2 && (this.#e = e2, this.listeners.forEach((t2) => {
1203
+ t2(e2);
1204
+ }));
1205
+ }
1206
+ isOnline() {
1207
+ return this.#e;
1208
+ }
1209
+ }();
1210
+ function ur(e2) {
1211
+ return Math.min(1e3 * 2 ** e2, 3e4);
1212
+ }
1213
+ function dr(e2) {
1214
+ return (e2 ?? `online`) !== `online` || lr.isOnline();
1215
+ }
1216
+ var fr = class extends Error {
1217
+ constructor(e2) {
1218
+ super(`CancelledError`), this.revert = e2?.revert, this.silent = e2?.silent;
1219
+ }
1220
+ };
1221
+ function pr(e2) {
1222
+ let t2 = false, n2 = 0, r2, i2 = or(), a2 = () => i2.status !== `pending`, o2 = (t3) => {
1223
+ if (!a2()) {
1224
+ let n3 = new fr(t3);
1225
+ f2(n3), e2.onCancel?.(n3);
1226
+ }
1227
+ }, s2 = () => {
1228
+ t2 = true;
1229
+ }, c2 = () => {
1230
+ t2 = false;
1231
+ }, l2 = () => Fn.isFocused() && (e2.networkMode === `always` || lr.isOnline()) && e2.canRun(), u2 = () => dr(e2.networkMode) && e2.canRun(), d2 = (e3) => {
1232
+ a2() || (r2?.(), i2.resolve(e3));
1233
+ }, f2 = (e3) => {
1234
+ a2() || (r2?.(), i2.reject(e3));
1235
+ }, p2 = () => new Promise((t3) => {
1236
+ r2 = (e3) => {
1237
+ (a2() || l2()) && t3(e3);
1238
+ }, e2.onPause?.();
1239
+ }).then(() => {
1240
+ r2 = void 0, a2() || e2.onContinue?.();
1241
+ }), m2 = () => {
1242
+ if (a2()) return;
1243
+ let r3, i3 = n2 === 0 ? e2.initialPromise : void 0;
1244
+ try {
1245
+ r3 = i3 ?? e2.fn();
1246
+ } catch (e3) {
1247
+ r3 = Promise.reject(e3);
1248
+ }
1249
+ Promise.resolve(r3).then(d2).catch((r4) => {
1250
+ if (a2()) return;
1251
+ let i4 = e2.retry ?? (R.isServer() ? 0 : 3), o3 = e2.retryDelay ?? ur, s3 = typeof o3 == `function` ? o3(n2, r4) : o3, c3 = i4 === true || typeof i4 == `number` && n2 < i4 || typeof i4 == `function` && i4(n2, r4);
1252
+ if (t2 || !c3) {
1253
+ f2(r4);
1254
+ return;
1255
+ }
1256
+ n2++, e2.onFail?.(n2, r4), Zn(s3).then(() => l2() ? void 0 : p2()).then(() => {
1257
+ t2 ? f2(r4) : m2();
1258
+ });
1259
+ });
1260
+ };
1261
+ return { promise: i2, status: () => i2.status, cancel: o2, continue: () => (r2?.(), i2), cancelRetry: s2, continueRetry: c2, canStart: u2, start: () => (u2() ? m2() : p2().then(m2), i2) };
1262
+ }
1263
+ var mr = class {
1264
+ #e;
1265
+ destroy() {
1266
+ this.clearGcTimeout();
1267
+ }
1268
+ scheduleGc() {
1269
+ this.clearGcTimeout(), Bn(this.gcTime) && (this.#e = M.setTimeout(() => {
1270
+ this.optionalRemove();
1271
+ }, this.gcTime));
1272
+ }
1273
+ updateGcTime(e2) {
1274
+ this.gcTime = Math.max(this.gcTime || 0, e2 ?? (R.isServer() ? 1 / 0 : 3e5));
1275
+ }
1276
+ clearGcTimeout() {
1277
+ this.#e !== void 0 && (M.clearTimeout(this.#e), this.#e = void 0);
1278
+ }
1279
+ };
1280
+ function hr(e2) {
1281
+ return { onFetch: (t2, n2) => {
1282
+ let r2 = t2.options, i2 = t2.fetchOptions?.meta?.fetchMore?.direction, a2 = t2.state.data?.pages || [], o2 = t2.state.data?.pageParams || [], s2 = { pages: [], pageParams: [] }, c2 = 0, l2 = async () => {
1283
+ let n3 = false, l3 = (e3) => {
1284
+ ar(e3, () => t2.signal, () => n3 = true);
1285
+ }, u2 = rr(t2.options, t2.fetchOptions), d2 = async (e3, r3, i3) => {
1286
+ if (n3) return Promise.reject(t2.signal.reason);
1287
+ if (r3 == null && e3.pages.length) return Promise.resolve(e3);
1288
+ let a3 = (() => {
1289
+ let e4 = { client: t2.client, queryKey: t2.queryKey, pageParam: r3, direction: i3 ? `backward` : `forward`, meta: t2.options.meta };
1290
+ return l3(e4), e4;
1291
+ })(), o3 = await u2(a3), { maxPages: s3 } = t2.options, c3 = i3 ? tr : er;
1292
+ return { pages: c3(e3.pages, o3, s3), pageParams: c3(e3.pageParams, r3, s3) };
1293
+ };
1294
+ if (i2 && a2.length) {
1295
+ let e3 = i2 === `backward`, t3 = e3 ? _r : gr, n4 = { pages: a2, pageParams: o2 };
1296
+ s2 = await d2(n4, t3(r2, n4), e3);
1297
+ } else {
1298
+ let t3 = e2 ?? a2.length;
1299
+ do {
1300
+ let e3 = c2 === 0 ? o2[0] ?? r2.initialPageParam : gr(r2, s2);
1301
+ if (c2 > 0 && e3 == null) break;
1302
+ s2 = await d2(s2, e3), c2++;
1303
+ } while (c2 < t3);
1304
+ }
1305
+ return s2;
1306
+ };
1307
+ t2.fetchFn = t2.options.persister ? () => t2.options.persister?.(l2, { client: t2.client, queryKey: t2.queryKey, meta: t2.options.meta, signal: t2.signal }, n2) : l2;
1308
+ } };
1309
+ }
1310
+ function gr(e2, { pages: t2, pageParams: n2 }) {
1311
+ let r2 = t2.length - 1;
1312
+ return t2.length > 0 ? e2.getNextPageParam(t2[r2], t2, n2[r2], n2) : void 0;
1313
+ }
1314
+ function _r(e2, { pages: t2, pageParams: n2 }) {
1315
+ return t2.length > 0 ? e2.getPreviousPageParam?.(t2[0], t2, n2[0], n2) : void 0;
1316
+ }
1317
+ function vr(e2, t2) {
1318
+ return t2 ? gr(e2, t2) != null : false;
1319
+ }
1320
+ function yr(e2, t2) {
1321
+ return !t2 || !e2.getPreviousPageParam ? false : _r(e2, t2) != null;
1322
+ }
1323
+ var br = class extends mr {
1324
+ #e;
1325
+ #t;
1326
+ #n;
1327
+ #r;
1328
+ #i;
1329
+ #a;
1330
+ #o;
1331
+ #s;
1332
+ constructor(e2) {
1333
+ super(), this.#s = false, this.#o = e2.defaultOptions, this.setOptions(e2.options), this.observers = [], this.#i = e2.client, this.#r = this.#i.getQueryCache(), this.queryKey = e2.queryKey, this.queryHash = e2.queryHash, this.#t = Cr(this.options), this.state = e2.state ?? this.#t, this.scheduleGc();
1334
+ }
1335
+ get meta() {
1336
+ return this.options.meta;
1337
+ }
1338
+ get queryType() {
1339
+ return this.#e;
1340
+ }
1341
+ get promise() {
1342
+ return this.#a?.promise;
1343
+ }
1344
+ setOptions(e2) {
1345
+ if (this.options = { ...this.#o, ...e2 }, e2?._type && (this.#e = e2._type), this.updateGcTime(this.options.gcTime), this.state && this.state.data === void 0) {
1346
+ let e3 = Cr(this.options);
1347
+ e3.data !== void 0 && (this.setState(Sr(e3.data, e3.dataUpdatedAt)), this.#t = e3);
1348
+ }
1349
+ }
1350
+ optionalRemove() {
1351
+ !this.observers.length && this.state.fetchStatus === `idle` && this.#r.remove(this);
1352
+ }
1353
+ setData(e2, t2) {
1354
+ let n2 = Qn(this.state.data, e2, this.options);
1355
+ return this.#l({ data: n2, type: `success`, dataUpdatedAt: t2?.updatedAt, manual: t2?.manual }), n2;
1356
+ }
1357
+ setState(e2) {
1358
+ this.#l({ type: `setState`, state: e2 });
1359
+ }
1360
+ cancel(e2) {
1361
+ let t2 = this.#a?.promise;
1362
+ return this.#a?.cancel(e2), t2 ? t2.then(N).catch(N) : Promise.resolve();
1363
+ }
1364
+ destroy() {
1365
+ super.destroy(), this.cancel({ silent: true });
1366
+ }
1367
+ get resetState() {
1368
+ return this.#t;
1369
+ }
1370
+ reset() {
1371
+ this.destroy(), this.setState(this.resetState);
1372
+ }
1373
+ isActive() {
1374
+ return this.observers.some((e2) => F(e2.options.enabled, this) !== false);
1375
+ }
1376
+ isDisabled() {
1377
+ return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === nr || !this.isFetched();
1378
+ }
1379
+ isFetched() {
1380
+ return this.state.dataUpdateCount + this.state.errorUpdateCount > 0;
1381
+ }
1382
+ isStatic() {
1383
+ return this.getObserversCount() > 0 && this.observers.some((e2) => P(e2.options.staleTime, this) === `static`);
1384
+ }
1385
+ isStale() {
1386
+ return this.getObserversCount() > 0 ? this.observers.some((e2) => e2.getCurrentResult().isStale) : this.state.data === void 0 || this.state.isInvalidated;
1387
+ }
1388
+ isStaleByTime(e2 = 0) {
1389
+ return this.state.data === void 0 ? true : e2 === `static` ? false : this.state.isInvalidated ? true : !Vn(this.state.dataUpdatedAt, e2);
1390
+ }
1391
+ onFocus() {
1392
+ this.observers.find((e2) => e2.shouldFetchOnWindowFocus())?.refetch({ cancelRefetch: false }), this.#a?.continue();
1393
+ }
1394
+ onOnline() {
1395
+ this.observers.find((e2) => e2.shouldFetchOnReconnect())?.refetch({ cancelRefetch: false }), this.#a?.continue();
1396
+ }
1397
+ addObserver(e2) {
1398
+ this.observers.includes(e2) || (this.observers.push(e2), this.clearGcTimeout(), this.#r.notify({ type: `observerAdded`, query: this, observer: e2 }));
1399
+ }
1400
+ removeObserver(e2) {
1401
+ this.observers.includes(e2) && (this.observers = this.observers.filter((t2) => t2 !== e2), this.observers.length || (this.#a && (this.#s || this.#c() ? this.#a.cancel({ revert: true }) : this.#a.cancelRetry()), this.scheduleGc()), this.#r.notify({ type: `observerRemoved`, query: this, observer: e2 }));
1402
+ }
1403
+ getObserversCount() {
1404
+ return this.observers.length;
1405
+ }
1406
+ #c() {
1407
+ return this.state.fetchStatus === `paused` && this.state.status === `pending`;
1408
+ }
1409
+ invalidate() {
1410
+ this.state.isInvalidated || this.#l({ type: `invalidate` });
1411
+ }
1412
+ async fetch(e2, t2) {
1413
+ if (this.state.fetchStatus !== `idle` && this.#a?.status() !== `rejected`) {
1414
+ if (this.state.data !== void 0 && t2?.cancelRefetch) this.cancel({ silent: true });
1415
+ else if (this.#a) return this.#a.continueRetry(), this.#a.promise;
1416
+ }
1417
+ if (e2 && this.setOptions(e2), !this.options.queryFn) {
1418
+ let e3 = this.observers.find((e4) => e4.options.queryFn);
1419
+ e3 && this.setOptions(e3.options);
1420
+ }
1421
+ let n2 = new AbortController(), r2 = (e3) => {
1422
+ Object.defineProperty(e3, "signal", { enumerable: true, get: () => (this.#s = true, n2.signal) });
1423
+ }, i2 = () => {
1424
+ let e3 = rr(this.options, t2), n3 = (() => {
1425
+ let e4 = { client: this.#i, queryKey: this.queryKey, meta: this.meta };
1426
+ return r2(e4), e4;
1427
+ })();
1428
+ return this.#s = false, this.options.persister ? this.options.persister(e3, n3, this) : e3(n3);
1429
+ }, a2 = (() => {
1430
+ let e3 = { fetchOptions: t2, options: this.options, queryKey: this.queryKey, client: this.#i, state: this.state, fetchFn: i2 };
1431
+ return r2(e3), e3;
1432
+ })();
1433
+ (this.#e === `infinite` ? hr(this.options.pages) : this.options.behavior)?.onFetch(a2, this), this.#n = this.state, (this.state.fetchStatus === `idle` || this.state.fetchMeta !== a2.fetchOptions?.meta) && this.#l({ type: `fetch`, meta: a2.fetchOptions?.meta }), this.#a = pr({ initialPromise: t2?.initialPromise, fn: a2.fetchFn, onCancel: (e3) => {
1434
+ e3 instanceof fr && e3.revert && this.setState({ ...this.#n, fetchStatus: `idle` }), n2.abort();
1435
+ }, onFail: (e3, t3) => {
1436
+ this.#l({ type: `failed`, failureCount: e3, error: t3 });
1437
+ }, onPause: () => {
1438
+ this.#l({ type: `pause` });
1439
+ }, onContinue: () => {
1440
+ this.#l({ type: `continue` });
1441
+ }, retry: a2.options.retry, retryDelay: a2.options.retryDelay, networkMode: a2.options.networkMode, canRun: () => true });
1442
+ try {
1443
+ let e3 = await this.#a.start();
1444
+ if (e3 === void 0) throw Error(`${this.queryHash} data is undefined`);
1445
+ return this.setData(e3), this.#r.config.onSuccess?.(e3, this), this.#r.config.onSettled?.(e3, this.state.error, this), e3;
1446
+ } catch (e3) {
1447
+ if (e3 instanceof fr) {
1448
+ if (e3.silent) return this.#a.promise;
1449
+ if (e3.revert) {
1450
+ if (this.state.data === void 0) throw e3;
1451
+ return this.state.data;
1452
+ }
1453
+ }
1454
+ throw this.#l({ type: `error`, error: e3 }), this.#r.config.onError?.(e3, this), this.#r.config.onSettled?.(this.state.data, e3, this), e3;
1455
+ } finally {
1456
+ this.scheduleGc();
1457
+ }
1458
+ }
1459
+ #l(e2) {
1460
+ let t2 = (t3) => {
1461
+ switch (e2.type) {
1462
+ case `failed`:
1463
+ return { ...t3, fetchFailureCount: e2.failureCount, fetchFailureReason: e2.error };
1464
+ case `pause`:
1465
+ return { ...t3, fetchStatus: `paused` };
1466
+ case `continue`:
1467
+ return { ...t3, fetchStatus: `fetching` };
1468
+ case `fetch`:
1469
+ return { ...t3, ...xr(t3.data, this.options), fetchMeta: e2.meta ?? null };
1470
+ case `success`:
1471
+ let n2 = { ...t3, ...Sr(e2.data, e2.dataUpdatedAt), dataUpdateCount: t3.dataUpdateCount + 1, ...!e2.manual && { fetchStatus: `idle`, fetchFailureCount: 0, fetchFailureReason: null } };
1472
+ return this.#n = e2.manual ? n2 : void 0, n2;
1473
+ case `error`:
1474
+ let r2 = e2.error;
1475
+ return { ...t3, error: r2, errorUpdateCount: t3.errorUpdateCount + 1, errorUpdatedAt: Date.now(), fetchFailureCount: t3.fetchFailureCount + 1, fetchFailureReason: r2, fetchStatus: `idle`, status: `error`, isInvalidated: true };
1476
+ case `invalidate`:
1477
+ return { ...t3, isInvalidated: true };
1478
+ case `setState`:
1479
+ return { ...t3, ...e2.state };
1480
+ }
1481
+ };
1482
+ this.state = t2(this.state), z.batch(() => {
1483
+ this.observers.forEach((e3) => {
1484
+ e3.onQueryUpdate();
1485
+ }), this.#r.notify({ query: this, type: `updated`, action: e2 });
1486
+ });
1487
+ }
1488
+ };
1489
+ function xr(e2, t2) {
1490
+ return { fetchFailureCount: 0, fetchFailureReason: null, fetchStatus: dr(t2.networkMode) ? `fetching` : `paused`, ...e2 === void 0 && { error: null, status: `pending` } };
1491
+ }
1492
+ function Sr(e2, t2) {
1493
+ return { data: e2, dataUpdatedAt: t2 ?? Date.now(), error: null, isInvalidated: false, status: `success` };
1494
+ }
1495
+ function Cr(e2) {
1496
+ let t2 = typeof e2.initialData == `function` ? e2.initialData() : e2.initialData, n2 = t2 !== void 0, r2 = n2 ? typeof e2.initialDataUpdatedAt == `function` ? e2.initialDataUpdatedAt() : e2.initialDataUpdatedAt : 0;
1497
+ return { data: t2, dataUpdateCount: 0, dataUpdatedAt: n2 ? r2 ?? Date.now() : 0, error: null, errorUpdateCount: 0, errorUpdatedAt: 0, fetchFailureCount: 0, fetchFailureReason: null, fetchMeta: null, isInvalidated: false, status: n2 ? `success` : `pending`, fetchStatus: `idle` };
1498
+ }
1499
+ var wr = class extends Pn {
1500
+ constructor(e2, t2) {
1501
+ super(), this.options = t2, this.#e = e2, this.#s = null, this.#o = or(), this.bindMethods(), this.setOptions(t2);
1502
+ }
1503
+ #e;
1504
+ #t = void 0;
1505
+ #n = void 0;
1506
+ #r = void 0;
1507
+ #i;
1508
+ #a;
1509
+ #o;
1510
+ #s;
1511
+ #c;
1512
+ #l;
1513
+ #u;
1514
+ #d;
1515
+ #f;
1516
+ #p;
1517
+ #m = /* @__PURE__ */ new Set();
1518
+ bindMethods() {
1519
+ this.refetch = this.refetch.bind(this);
1520
+ }
1521
+ onSubscribe() {
1522
+ this.listeners.size === 1 && (this.#t.addObserver(this), Er(this.#t, this.options) ? this.#h() : this.updateResult(), this.#y());
1523
+ }
1524
+ onUnsubscribe() {
1525
+ this.hasListeners() || this.destroy();
1526
+ }
1527
+ shouldFetchOnReconnect() {
1528
+ return Dr(this.#t, this.options, this.options.refetchOnReconnect);
1529
+ }
1530
+ shouldFetchOnWindowFocus() {
1531
+ return Dr(this.#t, this.options, this.options.refetchOnWindowFocus);
1532
+ }
1533
+ destroy() {
1534
+ this.listeners = /* @__PURE__ */ new Set(), this.#b(), this.#x(), this.#t.removeObserver(this);
1535
+ }
1536
+ setOptions(e2) {
1537
+ let t2 = this.options, n2 = this.#t;
1538
+ if (this.options = this.#e.defaultQueryOptions(e2), this.options.enabled !== void 0 && typeof this.options.enabled != `boolean` && typeof this.options.enabled != `function` && typeof F(this.options.enabled, this.#t) != `boolean`) throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);
1539
+ this.#S(), this.#t.setOptions(this.options), t2._defaulted && !qn(this.options, t2) && this.#e.getQueryCache().notify({ type: `observerOptionsUpdated`, query: this.#t, observer: this });
1540
+ let r2 = this.hasListeners();
1541
+ r2 && Or(this.#t, n2, this.options, t2) && this.#h(), this.updateResult(), r2 && (this.#t !== n2 || F(this.options.enabled, this.#t) !== F(t2.enabled, this.#t) || P(this.options.staleTime, this.#t) !== P(t2.staleTime, this.#t)) && this.#g();
1542
+ let i2 = this.#_();
1543
+ r2 && (this.#t !== n2 || F(this.options.enabled, this.#t) !== F(t2.enabled, this.#t) || i2 !== this.#p) && this.#v(i2);
1544
+ }
1545
+ getOptimisticResult(e2) {
1546
+ let t2 = this.#e.getQueryCache().build(this.#e, e2), n2 = this.createResult(t2, e2);
1547
+ return Ar(this, n2) && (this.#r = n2, this.#a = this.options, this.#i = this.#t.state), n2;
1548
+ }
1549
+ getCurrentResult() {
1550
+ return this.#r;
1551
+ }
1552
+ trackResult(e2, t2) {
1553
+ return new Proxy(e2, { get: (e3, n2) => (this.trackProp(n2), t2?.(n2), n2 === `promise` && (this.trackProp(`data`), !this.options.experimental_prefetchInRender && this.#o.status === `pending` && this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))), Reflect.get(e3, n2)) });
1554
+ }
1555
+ trackProp(e2) {
1556
+ this.#m.add(e2);
1557
+ }
1558
+ getCurrentQuery() {
1559
+ return this.#t;
1560
+ }
1561
+ refetch({ ...e2 } = {}) {
1562
+ return this.fetch({ ...e2 });
1563
+ }
1564
+ fetchOptimistic(e2) {
1565
+ let t2 = this.#e.defaultQueryOptions(e2), n2 = this.#e.getQueryCache().build(this.#e, t2);
1566
+ return n2.fetch().then(() => this.createResult(n2, t2));
1567
+ }
1568
+ fetch(e2) {
1569
+ return this.#h({ ...e2, cancelRefetch: e2.cancelRefetch ?? true }).then(() => (this.updateResult(), this.#r));
1570
+ }
1571
+ #h(e2) {
1572
+ this.#S();
1573
+ let t2 = this.#t.fetch(this.options, e2);
1574
+ return e2?.throwOnError || (t2 = t2.catch(N)), t2;
1575
+ }
1576
+ #g() {
1577
+ this.#b();
1578
+ let e2 = P(this.options.staleTime, this.#t);
1579
+ if (R.isServer() || this.#r.isStale || !Bn(e2)) return;
1580
+ let t2 = Vn(this.#r.dataUpdatedAt, e2) + 1;
1581
+ this.#d = M.setTimeout(() => {
1582
+ this.#r.isStale || this.updateResult();
1583
+ }, t2);
1584
+ }
1585
+ #_() {
1586
+ return (typeof this.options.refetchInterval == `function` ? this.options.refetchInterval(this.#t) : this.options.refetchInterval) ?? false;
1587
+ }
1588
+ #v(e2) {
1589
+ this.#x(), this.#p = e2, !R.isServer() && F(this.options.enabled, this.#t) !== false && Bn(this.#p) && this.#p !== 0 && (this.#f = M.setInterval(() => {
1590
+ (this.options.refetchIntervalInBackground || Fn.isFocused()) && this.#h();
1591
+ }, this.#p));
1592
+ }
1593
+ #y() {
1594
+ this.#g(), this.#v(this.#_());
1595
+ }
1596
+ #b() {
1597
+ this.#d !== void 0 && (M.clearTimeout(this.#d), this.#d = void 0);
1598
+ }
1599
+ #x() {
1600
+ this.#f !== void 0 && (M.clearInterval(this.#f), this.#f = void 0);
1601
+ }
1602
+ createResult(e2, t2) {
1603
+ let n2 = this.#t, r2 = this.options, i2 = this.#r, a2 = this.#i, o2 = this.#a, s2 = e2 === n2 ? this.#n : e2.state, { state: c2 } = e2, l2 = { ...c2 }, u2 = false, d2;
1604
+ if (t2._optimisticResults) {
1605
+ let i3 = this.hasListeners(), a3 = !i3 && Er(e2, t2), o3 = i3 && Or(e2, n2, t2, r2);
1606
+ (a3 || o3) && (l2 = { ...l2, ...xr(c2.data, e2.options) }), t2._optimisticResults === `isRestoring` && (l2.fetchStatus = `idle`);
1607
+ }
1608
+ let { error: f2, errorUpdatedAt: p2, status: m2 } = l2;
1609
+ d2 = l2.data;
1610
+ let ee2 = false;
1611
+ if (t2.placeholderData !== void 0 && d2 === void 0 && m2 === `pending`) {
1612
+ let e3;
1613
+ i2?.isPlaceholderData && t2.placeholderData === o2?.placeholderData ? (e3 = i2.data, ee2 = true) : e3 = typeof t2.placeholderData == `function` ? t2.placeholderData(this.#u?.state.data, this.#u) : t2.placeholderData, e3 !== void 0 && (m2 = `success`, d2 = Qn(i2?.data, e3, t2), u2 = true);
1614
+ }
1615
+ if (t2.select && d2 !== void 0 && !ee2) {
1616
+ if (i2 && d2 === a2?.data && t2.select === this.#c) d2 = this.#l;
1617
+ else try {
1618
+ this.#c = t2.select, d2 = t2.select(d2), d2 = Qn(i2?.data, d2, t2), this.#l = d2, this.#s = null;
1619
+ } catch (e3) {
1620
+ this.#s = e3;
1621
+ }
1622
+ }
1623
+ this.#s && (f2 = this.#s, d2 = this.#l, p2 = Date.now(), m2 = `error`);
1624
+ let te2 = l2.fetchStatus === `fetching`, ne2 = m2 === `pending`, h2 = m2 === `error`, g2 = ne2 && te2, re2 = d2 !== void 0, _2 = { status: m2, fetchStatus: l2.fetchStatus, isPending: ne2, isSuccess: m2 === `success`, isError: h2, isInitialLoading: g2, isLoading: g2, data: d2, dataUpdatedAt: l2.dataUpdatedAt, error: f2, errorUpdatedAt: p2, failureCount: l2.fetchFailureCount, failureReason: l2.fetchFailureReason, errorUpdateCount: l2.errorUpdateCount, isFetched: e2.isFetched(), isFetchedAfterMount: l2.dataUpdateCount > s2.dataUpdateCount || l2.errorUpdateCount > s2.errorUpdateCount, isFetching: te2, isRefetching: te2 && !ne2, isLoadingError: h2 && !re2, isPaused: l2.fetchStatus === `paused`, isPlaceholderData: u2, isRefetchError: h2 && re2, isStale: kr(e2, t2), refetch: this.refetch, promise: this.#o, isEnabled: F(t2.enabled, e2) !== false };
1625
+ if (this.options.experimental_prefetchInRender) {
1626
+ let t3 = _2.data !== void 0, r3 = _2.status === `error` && !t3, i3 = (e3) => {
1627
+ r3 ? e3.reject(_2.error) : t3 && e3.resolve(_2.data);
1628
+ }, a3 = () => {
1629
+ let e3 = this.#o = _2.promise = or();
1630
+ i3(e3);
1631
+ }, o3 = this.#o;
1632
+ switch (o3.status) {
1633
+ case `pending`:
1634
+ e2.queryHash === n2.queryHash && i3(o3);
1635
+ break;
1636
+ case `fulfilled`:
1637
+ (r3 || _2.data !== o3.value) && a3();
1638
+ break;
1639
+ case `rejected`:
1640
+ (!r3 || _2.error !== o3.reason) && a3();
1641
+ }
1642
+ }
1643
+ return _2;
1644
+ }
1645
+ updateResult() {
1646
+ let e2 = this.#r, t2 = this.createResult(this.#t, this.options);
1647
+ this.#i = this.#t.state, this.#a = this.options, this.#i.data !== void 0 && (this.#u = this.#t), !qn(t2, e2) && (this.#r = t2, this.#C({ listeners: (() => {
1648
+ if (!e2) return true;
1649
+ let { notifyOnChangeProps: t3 } = this.options, n2 = typeof t3 == `function` ? t3() : t3;
1650
+ if (n2 === `all` || !n2 && !this.#m.size) return true;
1651
+ let r2 = new Set(n2 ?? this.#m);
1652
+ return this.options.throwOnError && r2.add(`error`), Object.keys(this.#r).some((t4) => {
1653
+ let n3 = t4;
1654
+ return this.#r[n3] !== e2[n3] && r2.has(n3);
1655
+ });
1656
+ })() }));
1657
+ }
1658
+ #S() {
1659
+ let e2 = this.#e.getQueryCache().build(this.#e, this.options);
1660
+ if (e2 === this.#t) return;
1661
+ let t2 = this.#t;
1662
+ this.#t = e2, this.#n = e2.state, this.hasListeners() && (t2?.removeObserver(this), e2.addObserver(this));
1663
+ }
1664
+ onQueryUpdate() {
1665
+ this.updateResult(), this.hasListeners() && this.#y();
1666
+ }
1667
+ #C(e2) {
1668
+ z.batch(() => {
1669
+ e2.listeners && this.listeners.forEach((e3) => {
1670
+ e3(this.#r);
1671
+ }), this.#e.getQueryCache().notify({ query: this.#t, type: `observerResultsUpdated` });
1672
+ });
1673
+ }
1674
+ };
1675
+ function Tr(e2, t2) {
1676
+ return F(t2.enabled, e2) !== false && e2.state.data === void 0 && (e2.state.status !== `error` || F(t2.retryOnMount, e2) !== false);
1677
+ }
1678
+ function Er(e2, t2) {
1679
+ return Tr(e2, t2) || e2.state.data !== void 0 && Dr(e2, t2, t2.refetchOnMount);
1680
+ }
1681
+ function Dr(e2, t2, n2) {
1682
+ if (F(t2.enabled, e2) !== false && P(t2.staleTime, e2) !== `static`) {
1683
+ let r2 = typeof n2 == `function` ? n2(e2) : n2;
1684
+ return r2 === `always` || r2 !== false && kr(e2, t2);
1685
+ }
1686
+ return false;
1687
+ }
1688
+ function Or(e2, t2, n2, r2) {
1689
+ return (e2 !== t2 || F(r2.enabled, e2) === false) && (!n2.suspense || e2.state.status !== `error`) && kr(e2, n2);
1690
+ }
1691
+ function kr(e2, t2) {
1692
+ return F(t2.enabled, e2) !== false && e2.isStaleByTime(P(t2.staleTime, e2));
1693
+ }
1694
+ function Ar(e2, t2) {
1695
+ return !qn(e2.getCurrentResult(), t2);
1696
+ }
1697
+ var jr = class extends wr {
1698
+ constructor(e2, t2) {
1699
+ super(e2, t2);
1700
+ }
1701
+ bindMethods() {
1702
+ super.bindMethods(), this.fetchNextPage = this.fetchNextPage.bind(this), this.fetchPreviousPage = this.fetchPreviousPage.bind(this);
1703
+ }
1704
+ setOptions(e2) {
1705
+ e2._type = `infinite`, super.setOptions(e2);
1706
+ }
1707
+ getOptimisticResult(e2) {
1708
+ return e2._type = `infinite`, super.getOptimisticResult(e2);
1709
+ }
1710
+ fetchNextPage(e2) {
1711
+ return this.fetch({ ...e2, meta: { fetchMore: { direction: `forward` } } });
1712
+ }
1713
+ fetchPreviousPage(e2) {
1714
+ return this.fetch({ ...e2, meta: { fetchMore: { direction: `backward` } } });
1715
+ }
1716
+ createResult(e2, t2) {
1717
+ let { state: n2 } = e2, r2 = super.createResult(e2, t2), { isFetching: i2, isRefetching: a2, isError: o2, isRefetchError: s2 } = r2, c2 = n2.fetchMeta?.fetchMore?.direction, l2 = o2 && c2 === `forward`, u2 = i2 && c2 === `forward`, d2 = o2 && c2 === `backward`, f2 = i2 && c2 === `backward`;
1718
+ return { ...r2, fetchNextPage: this.fetchNextPage, fetchPreviousPage: this.fetchPreviousPage, hasNextPage: vr(t2, n2.data), hasPreviousPage: yr(t2, n2.data), isFetchNextPageError: l2, isFetchingNextPage: u2, isFetchPreviousPageError: d2, isFetchingPreviousPage: f2, isRefetchError: s2 && !l2 && !d2, isRefetching: a2 && !u2 && !f2 };
1719
+ }
1720
+ };
1721
+ var Mr = class extends mr {
1722
+ #e;
1723
+ #t;
1724
+ #n;
1725
+ #r;
1726
+ constructor(e2) {
1727
+ super(), this.#e = e2.client, this.mutationId = e2.mutationId, this.#n = e2.mutationCache, this.#t = [], this.state = e2.state || Nr(), this.setOptions(e2.options), this.scheduleGc();
1728
+ }
1729
+ setOptions(e2) {
1730
+ this.options = e2, this.updateGcTime(this.options.gcTime);
1731
+ }
1732
+ get meta() {
1733
+ return this.options.meta;
1734
+ }
1735
+ addObserver(e2) {
1736
+ this.#t.includes(e2) || (this.#t.push(e2), this.clearGcTimeout(), this.#n.notify({ type: `observerAdded`, mutation: this, observer: e2 }));
1737
+ }
1738
+ removeObserver(e2) {
1739
+ this.#t = this.#t.filter((t2) => t2 !== e2), this.scheduleGc(), this.#n.notify({ type: `observerRemoved`, mutation: this, observer: e2 });
1740
+ }
1741
+ optionalRemove() {
1742
+ this.#t.length || (this.state.status === `pending` ? this.scheduleGc() : this.#n.remove(this));
1743
+ }
1744
+ continue() {
1745
+ return this.#r?.continue() ?? this.execute(this.state.variables);
1746
+ }
1747
+ async execute(e2) {
1748
+ let t2 = () => {
1749
+ this.#i({ type: `continue` });
1750
+ }, n2 = { client: this.#e, meta: this.options.meta, mutationKey: this.options.mutationKey };
1751
+ this.#r = pr({ fn: () => this.options.mutationFn ? this.options.mutationFn(e2, n2) : Promise.reject(Error(`No mutationFn found`)), onFail: (e3, t3) => {
1752
+ this.#i({ type: `failed`, failureCount: e3, error: t3 });
1753
+ }, onPause: () => {
1754
+ this.#i({ type: `pause` });
1755
+ }, onContinue: t2, retry: this.options.retry ?? 0, retryDelay: this.options.retryDelay, networkMode: this.options.networkMode, canRun: () => this.#n.canRun(this) });
1756
+ let r2 = this.state.status === `pending`, i2 = !this.#r.canStart();
1757
+ try {
1758
+ if (r2) t2();
1759
+ else {
1760
+ this.#i({ type: `pending`, variables: e2, isPaused: i2 }), this.#n.config.onMutate && await this.#n.config.onMutate(e2, this, n2);
1761
+ let t3 = await this.options.onMutate?.(e2, n2);
1762
+ t3 !== this.state.context && this.#i({ type: `pending`, context: t3, variables: e2, isPaused: i2 });
1763
+ }
1764
+ let a2 = await this.#r.start();
1765
+ return await this.#n.config.onSuccess?.(a2, e2, this.state.context, this, n2), await this.options.onSuccess?.(a2, e2, this.state.context, n2), await this.#n.config.onSettled?.(a2, null, this.state.variables, this.state.context, this, n2), await this.options.onSettled?.(a2, null, e2, this.state.context, n2), this.#i({ type: `success`, data: a2 }), a2;
1766
+ } catch (t3) {
1767
+ try {
1768
+ await this.#n.config.onError?.(t3, e2, this.state.context, this, n2);
1769
+ } catch (e3) {
1770
+ Promise.reject(e3);
1771
+ }
1772
+ try {
1773
+ await this.options.onError?.(t3, e2, this.state.context, n2);
1774
+ } catch (e3) {
1775
+ Promise.reject(e3);
1776
+ }
1777
+ try {
1778
+ await this.#n.config.onSettled?.(void 0, t3, this.state.variables, this.state.context, this, n2);
1779
+ } catch (e3) {
1780
+ Promise.reject(e3);
1781
+ }
1782
+ try {
1783
+ await this.options.onSettled?.(void 0, t3, e2, this.state.context, n2);
1784
+ } catch (e3) {
1785
+ Promise.reject(e3);
1786
+ }
1787
+ throw this.#i({ type: `error`, error: t3 }), t3;
1788
+ } finally {
1789
+ this.#n.runNext(this);
1790
+ }
1791
+ }
1792
+ #i(e2) {
1793
+ let t2 = (t3) => {
1794
+ switch (e2.type) {
1795
+ case `failed`:
1796
+ return { ...t3, failureCount: e2.failureCount, failureReason: e2.error };
1797
+ case `pause`:
1798
+ return { ...t3, isPaused: true };
1799
+ case `continue`:
1800
+ return { ...t3, isPaused: false };
1801
+ case `pending`:
1802
+ return { ...t3, context: e2.context, data: void 0, failureCount: 0, failureReason: null, error: null, isPaused: e2.isPaused, status: `pending`, variables: e2.variables, submittedAt: Date.now() };
1803
+ case `success`:
1804
+ return { ...t3, data: e2.data, failureCount: 0, failureReason: null, error: null, status: `success`, isPaused: false };
1805
+ case `error`:
1806
+ return { ...t3, data: void 0, error: e2.error, failureCount: t3.failureCount + 1, failureReason: e2.error, isPaused: false, status: `error` };
1807
+ }
1808
+ };
1809
+ this.state = t2(this.state), z.batch(() => {
1810
+ this.#t.forEach((t3) => {
1811
+ t3.onMutationUpdate(e2);
1812
+ }), this.#n.notify({ mutation: this, type: `updated`, action: e2 });
1813
+ });
1814
+ }
1815
+ };
1816
+ function Nr() {
1817
+ return { context: void 0, data: void 0, error: null, failureCount: 0, failureReason: null, isPaused: false, status: `idle`, variables: void 0, submittedAt: 0 };
1818
+ }
1819
+ var Pr = class extends Pn {
1820
+ constructor(e2 = {}) {
1821
+ super(), this.config = e2, this.#e = /* @__PURE__ */ new Set(), this.#t = /* @__PURE__ */ new Map(), this.#n = 0;
1822
+ }
1823
+ #e;
1824
+ #t;
1825
+ #n;
1826
+ build(e2, t2, n2) {
1827
+ let r2 = new Mr({ client: e2, mutationCache: this, mutationId: ++this.#n, options: e2.defaultMutationOptions(t2), state: n2 });
1828
+ return this.add(r2), r2;
1829
+ }
1830
+ add(e2) {
1831
+ this.#e.add(e2);
1832
+ let t2 = Fr(e2);
1833
+ if (typeof t2 == `string`) {
1834
+ let n2 = this.#t.get(t2);
1835
+ n2 ? n2.push(e2) : this.#t.set(t2, [e2]);
1836
+ }
1837
+ this.notify({ type: `added`, mutation: e2 });
1838
+ }
1839
+ remove(e2) {
1840
+ if (this.#e.delete(e2)) {
1841
+ let t2 = Fr(e2);
1842
+ if (typeof t2 == `string`) {
1843
+ let n2 = this.#t.get(t2);
1844
+ if (n2) {
1845
+ if (n2.length > 1) {
1846
+ let t3 = n2.indexOf(e2);
1847
+ t3 !== -1 && n2.splice(t3, 1);
1848
+ } else n2[0] === e2 && this.#t.delete(t2);
1849
+ }
1850
+ }
1851
+ }
1852
+ this.notify({ type: `removed`, mutation: e2 });
1853
+ }
1854
+ canRun(e2) {
1855
+ let t2 = Fr(e2);
1856
+ if (typeof t2 == `string`) {
1857
+ let n2 = this.#t.get(t2)?.find((e3) => e3.state.status === `pending`);
1858
+ return !n2 || n2 === e2;
1859
+ }
1860
+ return true;
1861
+ }
1862
+ runNext(e2) {
1863
+ let t2 = Fr(e2);
1864
+ return typeof t2 == `string` ? this.#t.get(t2)?.find((t3) => t3 !== e2 && t3.state.isPaused)?.continue() ?? Promise.resolve() : Promise.resolve();
1865
+ }
1866
+ clear() {
1867
+ z.batch(() => {
1868
+ this.#e.forEach((e2) => {
1869
+ this.notify({ type: `removed`, mutation: e2 });
1870
+ }), this.#e.clear(), this.#t.clear();
1871
+ });
1872
+ }
1873
+ getAll() {
1874
+ return Array.from(this.#e);
1875
+ }
1876
+ find(e2) {
1877
+ let t2 = { exact: true, ...e2 };
1878
+ return this.getAll().find((e3) => Un(t2, e3));
1879
+ }
1880
+ findAll(e2 = {}) {
1881
+ return this.getAll().filter((t2) => Un(e2, t2));
1882
+ }
1883
+ notify(e2) {
1884
+ z.batch(() => {
1885
+ this.listeners.forEach((t2) => {
1886
+ t2(e2);
1887
+ });
1888
+ });
1889
+ }
1890
+ resumePausedMutations() {
1891
+ let e2 = this.getAll().filter((e3) => e3.state.isPaused);
1892
+ return z.batch(() => Promise.all(e2.map((e3) => e3.continue().catch(N))));
1893
+ }
1894
+ };
1895
+ function Fr(e2) {
1896
+ return e2.options.scope?.id;
1897
+ }
1898
+ var Ir = class extends Pn {
1899
+ constructor(e2 = {}) {
1900
+ super(), this.config = e2, this.#e = /* @__PURE__ */ new Map();
1901
+ }
1902
+ #e;
1903
+ build(e2, t2, n2) {
1904
+ let r2 = t2.queryKey, i2 = t2.queryHash ?? Wn(r2, t2), a2 = this.get(i2);
1905
+ return a2 || (a2 = new br({ client: e2, queryKey: r2, queryHash: i2, options: e2.defaultQueryOptions(t2), state: n2, defaultOptions: e2.getQueryDefaults(r2) }), this.add(a2)), a2;
1906
+ }
1907
+ add(e2) {
1908
+ this.#e.has(e2.queryHash) || (this.#e.set(e2.queryHash, e2), this.notify({ type: `added`, query: e2 }));
1909
+ }
1910
+ remove(e2) {
1911
+ let t2 = this.#e.get(e2.queryHash);
1912
+ t2 && (e2.destroy(), t2 === e2 && this.#e.delete(e2.queryHash), this.notify({ type: `removed`, query: e2 }));
1913
+ }
1914
+ clear() {
1915
+ z.batch(() => {
1916
+ this.getAll().forEach((e2) => {
1917
+ this.remove(e2);
1918
+ });
1919
+ });
1920
+ }
1921
+ get(e2) {
1922
+ return this.#e.get(e2);
1923
+ }
1924
+ getAll() {
1925
+ return [...this.#e.values()];
1926
+ }
1927
+ find(e2) {
1928
+ let t2 = { exact: true, ...e2 };
1929
+ return this.getAll().find((e3) => Hn(t2, e3));
1930
+ }
1931
+ findAll(e2 = {}) {
1932
+ let t2 = this.getAll();
1933
+ return Object.keys(e2).length > 0 ? t2.filter((t3) => Hn(e2, t3)) : t2;
1934
+ }
1935
+ notify(e2) {
1936
+ z.batch(() => {
1937
+ this.listeners.forEach((t2) => {
1938
+ t2(e2);
1939
+ });
1940
+ });
1941
+ }
1942
+ onFocus() {
1943
+ z.batch(() => {
1944
+ this.getAll().forEach((e2) => {
1945
+ e2.onFocus();
1946
+ });
1947
+ });
1948
+ }
1949
+ onOnline() {
1950
+ z.batch(() => {
1951
+ this.getAll().forEach((e2) => {
1952
+ e2.onOnline();
1953
+ });
1954
+ });
1955
+ }
1956
+ };
1957
+ var Lr = class {
1958
+ #e;
1959
+ #t;
1960
+ #n;
1961
+ #r;
1962
+ #i;
1963
+ #a;
1964
+ #o;
1965
+ #s;
1966
+ constructor(e2 = {}) {
1967
+ this.#e = e2.queryCache || new Ir(), this.#t = e2.mutationCache || new Pr(), this.#n = e2.defaultOptions || {}, this.#r = /* @__PURE__ */ new Map(), this.#i = /* @__PURE__ */ new Map(), this.#a = 0;
1968
+ }
1969
+ mount() {
1970
+ this.#a++, this.#a === 1 && (this.#o = Fn.subscribe(async (e2) => {
1971
+ e2 && (await this.resumePausedMutations(), this.#e.onFocus());
1972
+ }), this.#s = lr.subscribe(async (e2) => {
1973
+ e2 && (await this.resumePausedMutations(), this.#e.onOnline());
1974
+ }));
1975
+ }
1976
+ unmount() {
1977
+ this.#a--, this.#a === 0 && (this.#o?.(), this.#o = void 0, this.#s?.(), this.#s = void 0);
1978
+ }
1979
+ isFetching(e2) {
1980
+ return this.#e.findAll({ ...e2, fetchStatus: `fetching` }).length;
1981
+ }
1982
+ isMutating(e2) {
1983
+ return this.#t.findAll({ ...e2, status: `pending` }).length;
1984
+ }
1985
+ getQueryData(e2) {
1986
+ let t2 = this.defaultQueryOptions({ queryKey: e2 });
1987
+ return this.#e.get(t2.queryHash)?.state.data;
1988
+ }
1989
+ ensureQueryData(e2) {
1990
+ let t2 = this.defaultQueryOptions(e2), n2 = this.#e.build(this, t2), r2 = n2.state.data;
1991
+ return r2 === void 0 ? this.fetchQuery(e2) : (e2.revalidateIfStale && n2.isStaleByTime(P(t2.staleTime, n2)) && this.prefetchQuery(t2), Promise.resolve(r2));
1992
+ }
1993
+ getQueriesData(e2) {
1994
+ return this.#e.findAll(e2).map(({ queryKey: e3, state: t2 }) => [e3, t2.data]);
1995
+ }
1996
+ setQueryData(e2, t2, n2) {
1997
+ let r2 = this.defaultQueryOptions({ queryKey: e2 }), i2 = this.#e.get(r2.queryHash)?.state.data, a2 = zn(t2, i2);
1998
+ if (a2 !== void 0) return this.#e.build(this, r2).setData(a2, { ...n2, manual: true });
1999
+ }
2000
+ setQueriesData(e2, t2, n2) {
2001
+ return z.batch(() => this.#e.findAll(e2).map(({ queryKey: e3 }) => [e3, this.setQueryData(e3, t2, n2)]));
2002
+ }
2003
+ getQueryState(e2) {
2004
+ let t2 = this.defaultQueryOptions({ queryKey: e2 });
2005
+ return this.#e.get(t2.queryHash)?.state;
2006
+ }
2007
+ removeQueries(e2) {
2008
+ let t2 = this.#e;
2009
+ z.batch(() => {
2010
+ t2.findAll(e2).forEach((e3) => {
2011
+ t2.remove(e3);
2012
+ });
2013
+ });
2014
+ }
2015
+ resetQueries(e2, t2) {
2016
+ let n2 = this.#e;
2017
+ return z.batch(() => (n2.findAll(e2).forEach((e3) => {
2018
+ e3.reset();
2019
+ }), this.refetchQueries({ type: `active`, ...e2 }, t2)));
2020
+ }
2021
+ cancelQueries(e2, t2 = {}) {
2022
+ let n2 = { revert: true, ...t2 }, r2 = z.batch(() => this.#e.findAll(e2).map((e3) => e3.cancel(n2)));
2023
+ return Promise.all(r2).then(N).catch(N);
2024
+ }
2025
+ invalidateQueries(e2, t2 = {}) {
2026
+ return z.batch(() => (this.#e.findAll(e2).forEach((e3) => {
2027
+ e3.invalidate();
2028
+ }), e2?.refetchType === `none` ? Promise.resolve() : this.refetchQueries({ ...e2, type: e2?.refetchType ?? e2?.type ?? `active` }, t2)));
2029
+ }
2030
+ refetchQueries(e2, t2 = {}) {
2031
+ let n2 = { ...t2, cancelRefetch: t2.cancelRefetch ?? true }, r2 = z.batch(() => this.#e.findAll(e2).filter((e3) => !e3.isDisabled() && !e3.isStatic()).map((e3) => {
2032
+ let t3 = e3.fetch(void 0, n2);
2033
+ return n2.throwOnError || (t3 = t3.catch(N)), e3.state.fetchStatus === `paused` ? Promise.resolve() : t3;
2034
+ }));
2035
+ return Promise.all(r2).then(N);
2036
+ }
2037
+ fetchQuery(e2) {
2038
+ let t2 = this.defaultQueryOptions(e2);
2039
+ t2.retry === void 0 && (t2.retry = false);
2040
+ let n2 = this.#e.build(this, t2);
2041
+ return n2.isStaleByTime(P(t2.staleTime, n2)) ? n2.fetch(t2) : Promise.resolve(n2.state.data);
2042
+ }
2043
+ prefetchQuery(e2) {
2044
+ return this.fetchQuery(e2).then(N).catch(N);
2045
+ }
2046
+ fetchInfiniteQuery(e2) {
2047
+ return e2._type = `infinite`, this.fetchQuery(e2);
2048
+ }
2049
+ prefetchInfiniteQuery(e2) {
2050
+ return this.fetchInfiniteQuery(e2).then(N).catch(N);
2051
+ }
2052
+ ensureInfiniteQueryData(e2) {
2053
+ return e2._type = `infinite`, this.ensureQueryData(e2);
2054
+ }
2055
+ resumePausedMutations() {
2056
+ return lr.isOnline() ? this.#t.resumePausedMutations() : Promise.resolve();
2057
+ }
2058
+ getQueryCache() {
2059
+ return this.#e;
2060
+ }
2061
+ getMutationCache() {
2062
+ return this.#t;
2063
+ }
2064
+ getDefaultOptions() {
2065
+ return this.#n;
2066
+ }
2067
+ setDefaultOptions(e2) {
2068
+ this.#n = e2;
2069
+ }
2070
+ setQueryDefaults(e2, t2) {
2071
+ this.#r.set(I(e2), { queryKey: e2, defaultOptions: t2 });
2072
+ }
2073
+ getQueryDefaults(e2) {
2074
+ let t2 = [...this.#r.values()], n2 = {};
2075
+ return t2.forEach((t3) => {
2076
+ L(e2, t3.queryKey) && Object.assign(n2, t3.defaultOptions);
2077
+ }), n2;
2078
+ }
2079
+ setMutationDefaults(e2, t2) {
2080
+ this.#i.set(I(e2), { mutationKey: e2, defaultOptions: t2 });
2081
+ }
2082
+ getMutationDefaults(e2) {
2083
+ let t2 = [...this.#i.values()], n2 = {};
2084
+ return t2.forEach((t3) => {
2085
+ L(e2, t3.mutationKey) && Object.assign(n2, t3.defaultOptions);
2086
+ }), n2;
2087
+ }
2088
+ defaultQueryOptions(e2) {
2089
+ if (e2._defaulted) return e2;
2090
+ let t2 = { ...this.#n.queries, ...this.getQueryDefaults(e2.queryKey), ...e2, _defaulted: true };
2091
+ return t2.queryHash ||= Wn(t2.queryKey, t2), t2.refetchOnReconnect === void 0 && (t2.refetchOnReconnect = t2.networkMode !== `always`), t2.throwOnError === void 0 && (t2.throwOnError = !!t2.suspense), !t2.networkMode && t2.persister && (t2.networkMode = `offlineFirst`), t2.queryFn === nr && (t2.enabled = false), t2;
2092
+ }
2093
+ defaultMutationOptions(e2) {
2094
+ return e2?._defaulted ? e2 : { ...this.#n.mutations, ...e2?.mutationKey && this.getMutationDefaults(e2.mutationKey), ...e2, _defaulted: true };
2095
+ }
2096
+ clear() {
2097
+ this.#e.clear(), this.#t.clear();
2098
+ }
2099
+ };
2100
+ var Rr = e.createContext(void 0);
2101
+ var zr = (t2) => {
2102
+ let n2 = e.useContext(Rr);
2103
+ if (t2) return t2;
2104
+ if (!n2) throw Error(`No QueryClient set, use QueryClientProvider to set one`);
2105
+ return n2;
2106
+ };
2107
+ var Br = ({ client: t2, children: n2 }) => (e.useEffect(() => (t2.mount(), () => {
2108
+ t2.unmount();
2109
+ }), [t2]), (0, import_jsx_runtime.jsx)(Rr.Provider, { value: t2, children: n2 }));
2110
+ var Vr = e.createContext(false);
2111
+ var Hr = () => e.useContext(Vr);
2112
+ Vr.Provider;
2113
+ function Ur() {
2114
+ let e2 = false;
2115
+ return { clearReset: () => {
2116
+ e2 = false;
2117
+ }, reset: () => {
2118
+ e2 = true;
2119
+ }, isReset: () => e2 };
2120
+ }
2121
+ var Wr = e.createContext(Ur());
2122
+ var Gr = () => e.useContext(Wr);
2123
+ var Kr = (e2, t2, n2) => {
2124
+ let r2 = n2?.state.error && typeof e2.throwOnError == `function` ? ir(e2.throwOnError, [n2.state.error, n2]) : e2.throwOnError;
2125
+ (e2.suspense || e2.experimental_prefetchInRender || r2) && (t2.isReset() || (e2.retryOnMount = false));
2126
+ };
2127
+ var qr = (t2) => {
2128
+ e.useEffect(() => {
2129
+ t2.clearReset();
2130
+ }, [t2]);
2131
+ };
2132
+ var Jr = ({ result: e2, errorResetBoundary: t2, throwOnError: n2, query: r2, suspense: i2 }) => e2.isError && !t2.isReset() && !e2.isFetching && r2 && (i2 && e2.data === void 0 || ir(n2, [e2.error, r2]));
2133
+ var Yr = (e2) => {
2134
+ if (e2.suspense) {
2135
+ let t2 = 1e3, n2 = (e3) => e3 === `static` ? e3 : Math.max(e3 ?? t2, t2), r2 = e2.staleTime;
2136
+ e2.staleTime = typeof r2 == `function` ? (...e3) => n2(r2(...e3)) : n2(r2), typeof e2.gcTime == `number` && (e2.gcTime = Math.max(e2.gcTime, t2));
2137
+ }
2138
+ };
2139
+ var Xr = (e2, t2) => e2.isLoading && e2.isFetching && !t2;
2140
+ var Zr = (e2, t2) => e2?.suspense && t2.isPending;
2141
+ var Qr = (e2, t2, n2) => t2.fetchOptimistic(e2).catch(() => {
2142
+ n2.clearReset();
2143
+ });
2144
+ function $r(t2, n2, r2) {
2145
+ let i2 = Hr(), a2 = Gr(), o2 = zr(r2), s2 = o2.defaultQueryOptions(t2);
2146
+ o2.getDefaultOptions().queries?._experimental_beforeQuery?.(s2);
2147
+ let c2 = o2.getQueryCache().get(s2.queryHash), l2 = t2.subscribed !== false;
2148
+ s2._optimisticResults = i2 ? `isRestoring` : l2 ? `optimistic` : void 0, Yr(s2), Kr(s2, a2, c2), qr(a2);
2149
+ let u2 = !o2.getQueryCache().get(s2.queryHash), [d2] = e.useState(() => new n2(o2, s2)), f2 = d2.getOptimisticResult(s2), p2 = !i2 && l2;
2150
+ if (e.useSyncExternalStore(e.useCallback((e2) => {
2151
+ let t3 = p2 ? d2.subscribe(z.batchCalls(e2)) : N;
2152
+ return d2.updateResult(), t3;
2153
+ }, [d2, p2]), () => d2.getCurrentResult(), () => d2.getCurrentResult()), e.useEffect(() => {
2154
+ d2.setOptions(s2);
2155
+ }, [s2, d2]), Zr(s2, f2)) throw Qr(s2, d2, a2);
2156
+ if (Jr({ result: f2, errorResetBoundary: a2, throwOnError: s2.throwOnError, query: c2, suspense: s2.suspense })) throw f2.error;
2157
+ return o2.getDefaultOptions().queries?._experimental_afterQuery?.(s2, f2), s2.experimental_prefetchInRender && !R.isServer() && Xr(f2, i2) && (u2 ? Qr(s2, d2, a2) : c2?.promise)?.catch(N).finally(() => {
2158
+ d2.updateResult();
2159
+ }), s2.notifyOnChangeProps ? f2 : d2.trackResult(f2);
2160
+ }
2161
+ function ei(e2, t2) {
2162
+ return $r(e2, jr, t2);
2163
+ }
2164
+ function ti(e2) {
2165
+ return e2;
2166
+ }
2167
+ var ni = ti(`@wix/site-service-url`);
2168
+ var ri = `215238eb-22a5-4c36-9e7b-e7c08025e04e`;
2169
+ `${ri}`, `${ri}`;
2170
+ var ii = function(e2) {
2171
+ return e2.SIDE_CART = `ecom_side_cart`, e2.CART = `shopping_cart`, e2.CHECKOUT = `checkout`, e2.PRODUCT_PAGE = `product-page-builder`, e2.CATEGORY_PAGE = `category-page-builder`, e2;
2172
+ }({});
2173
+ var ai = () => {
2174
+ let e2 = (0, import_services_manager_react.useService)(ni), t2 = (0, import_react.useCallback)((t3, n2) => {
2175
+ let r2 = e2.appSectionRelativeUrl(ri, t3, true);
2176
+ if (r2) return `./${r2.replace(/^\//, ``).replace(/\/$/, ``)}/${encodeURIComponent(n2)}`;
2177
+ }, [e2]);
2178
+ return { getPageRelativeUrl: t2, getPageAbsoluteUrl: (0, import_react.useCallback)((n2, r2) => {
2179
+ let i2 = t2(n2, r2);
2180
+ if (i2) return new URL(i2, `${e2.siteUrl.replace(/\/$/, ``)}/`).href;
2181
+ }, [t2, e2]) };
2182
+ };
2183
+ function oi(e2) {
2184
+ let { getPageAbsoluteUrl: t2 } = ai(), n2 = (0, import_react.useMemo)(() => {
2185
+ if (!e2.slug) return;
2186
+ let n3 = t2(ii.CATEGORY_PAGE, e2.slug);
2187
+ return n3 ? { href: n3 } : void 0;
2188
+ }, [e2.slug, t2]);
2189
+ return (0, import_react.useMemo)(() => ({ id: e2.id, name: e2.name, slug: e2.slug, link: n2, description: e2.description, richContentDescription: e2.richContentDescription, image: e2.image, breadcrumbs: e2.breadcrumbs }), [e2, n2]);
2190
+ }
2191
+ function si(e2) {
2192
+ let { category: t2 } = e2;
2193
+ return oi(t2);
2194
+ }
2195
+ function ci(e2, t2) {
2196
+ return (0, import_react.useMemo)(() => ({ categories: e2, currentCategoryId: t2 }), [e2, t2]);
2197
+ }
2198
+ var li = ti(`seo/seo-service`);
2199
+ var ui = ti(`@wix/viewer-service-environment`);
2200
+ function di(e2) {
2201
+ return e2.breadcrumbs.map(({ id: e3, name: t2, slug: n2 }) => ({ categoryId: e3, categoryName: t2, categorySlug: n2 }));
2202
+ }
2203
+ function fi(e2) {
2204
+ return e2 ? { id: e2 } : void 0;
2205
+ }
2206
+ function pi(e2) {
2207
+ return { itemType: e2.parentCategoryId ? `STORES_SUB_CATEGORY` : `STORES_CATEGORY`, itemData: { category: { id: e2.id, name: e2.name, slug: e2.slug, description: e2.description, itemCounter: e2.itemCounter, image: e2.image, parentCategory: fi(e2.parentCategoryId), breadcrumbsInfo: { breadcrumbs: di(e2) } } }, ...e2.seoData ? { seoData: e2.seoData } : {} };
2208
+ }
2209
+ function mi(e2) {
2210
+ let t2 = (0, import_services_manager_react.useService)(li), n2 = (0, import_services_manager_react.useService)(ui), r2 = (0, import_react.useRef)(false);
2211
+ !r2.current && e2.id && n2.isSSR() && (r2.current = true, t2.setSeoEntity(pi(e2)).catch(() => {
2212
+ }));
2213
+ }
2214
+ function hi(e2) {
2215
+ if (e2.status === `fulfilled`) return e2.value;
2216
+ throw e2.status === `rejected` ? e2.reason : e2.status === `pending` ? e2 : (e2.status = `pending`, e2.then((t2) => {
2217
+ e2.status = `fulfilled`, e2.value = t2;
2218
+ }, (t2) => {
2219
+ e2.status = `rejected`, e2.reason = t2;
2220
+ }), e2);
2221
+ }
2222
+ var gi = /* @__PURE__ */ new Set();
2223
+ function _i(e2) {
2224
+ return gi.add(e2), () => {
2225
+ gi.delete(e2);
2226
+ };
2227
+ }
2228
+ function vi(e2) {
2229
+ let t2 = globalThis.window;
2230
+ if (!t2?.history) return;
2231
+ let n2 = t2.location.href;
2232
+ t2.history.replaceState({ scrollY: t2.scrollY }, ``, e2.href), t2.location.href !== n2 && gi.forEach((e3) => e3());
2233
+ }
2234
+ function yi() {
2235
+ let e2 = (0, import_services_manager_react.useService)(ni), t2 = (0, import_react.useCallback)(() => e2.currentUrl, [e2]), i2 = (0, import_react.useSyncExternalStore)(_i, t2, t2), a2 = (0, import_react.useMemo)(() => new URL(i2), [i2]), s2 = (0, import_react.useCallback)((t3) => {
2236
+ let n2 = new URL(e2.currentUrl);
2237
+ n2.search = t3, vi(n2);
2238
+ }, [e2]);
2239
+ return { url: a2, siteUrl: e2.siteUrl.replace(/\/$/, ``), search: a2.search, pushSearch: s2 };
2240
+ }
2241
+ function bi(e2) {
2242
+ return e2.priceMin === void 0 && e2.priceMax === void 0 && Object.values(e2.customizationIdToChoiceIds ?? {}).every((e3) => e3.length === 0);
2243
+ }
2244
+ function xi(e2, t2, n2) {
2245
+ let r2 = e2.customizationIdToChoiceIds ?? {}, i2 = r2[t2] ?? [];
2246
+ return i2.includes(n2) ? e2 : { ...e2, customizationIdToChoiceIds: { ...r2, [t2]: [...i2, n2] } };
2247
+ }
2248
+ function Si(e2, t2, n2) {
2249
+ let r2 = e2.customizationIdToChoiceIds ?? {}, i2 = r2[t2] ?? [];
2250
+ return i2.includes(n2) ? { ...e2, customizationIdToChoiceIds: { ...r2, [t2]: i2.filter((e3) => e3 !== n2) } } : e2;
2251
+ }
2252
+ function Ci(e2, t2, n2) {
2253
+ return e2.priceMin === t2 && e2.priceMax === n2 ? e2 : { ...e2, priceMin: t2, priceMax: n2 };
2254
+ }
2255
+ function wi(e2) {
2256
+ return e2.priceMin === void 0 && e2.priceMax === void 0 ? e2 : { ...e2, priceMin: void 0, priceMax: void 0 };
2257
+ }
2258
+ function Ti(e2) {
2259
+ return Object.keys(e2).length === 1 && `$and` in e2 && Array.isArray(e2.$and);
2260
+ }
2261
+ function Ei(e2) {
2262
+ return Object.keys(e2).length === 1 && `$or` in e2 && Array.isArray(e2.$or);
2263
+ }
2264
+ function Di(e2) {
2265
+ return Object.keys(e2).length === 1 && `$not` in e2 && typeof e2.$not == `object`;
2266
+ }
2267
+ function B(e2, t2) {
2268
+ return e2 === void 0 || Object.keys(e2).length === 0 ? t2 : t2 === void 0 || Object.keys(t2).length === 0 ? e2 : { $and: [...Ti(e2) ? e2.$and : [e2], ...Ti(t2) ? t2.$and : [t2]] };
2269
+ }
2270
+ function Oi(e2, t2) {
2271
+ return e2 === void 0 || Object.keys(e2).length === 0 ? t2 : t2 === void 0 || Object.keys(t2).length === 0 ? e2 : { $or: [...Ei(e2) ? e2.$or : [e2], ...Ei(t2) ? t2.$or : [t2]] };
2272
+ }
2273
+ function ki(e2) {
2274
+ if (e2 !== void 0 && Object.keys(e2).length !== 0) return Di(e2) ? e2.$not : { $not: e2 };
2275
+ }
2276
+ var Ai = class {
2277
+ _items;
2278
+ _fetchNextPage;
2279
+ _fetchPrevPage;
2280
+ _originQuery;
2281
+ _limit;
2282
+ constructor({ items: e2, originQuery: t2, fetchNextPage: n2, fetchPrevPage: r2, limit: i2 }) {
2283
+ this._items = e2, this._fetchNextPage = n2, this._fetchPrevPage = r2, this._originQuery = t2, this._limit = i2;
2284
+ }
2285
+ get items() {
2286
+ return this._items;
2287
+ }
2288
+ get length() {
2289
+ return this._items.length;
2290
+ }
2291
+ get pageSize() {
2292
+ return this._limit;
2293
+ }
2294
+ get query() {
2295
+ return this._originQuery;
2296
+ }
2297
+ async next() {
2298
+ if (!this.hasNext()) throw Error(`No next page to fetch`);
2299
+ return await this._fetchNextPage();
2300
+ }
2301
+ async prev() {
2302
+ if (!this.hasPrev()) throw Error(`No previous page to fetch`);
2303
+ return await this._fetchPrevPage();
2304
+ }
2305
+ };
2306
+ var ji = class extends Ai {
2307
+ _nextCursor;
2308
+ _prevCursor;
2309
+ cursors;
2310
+ constructor({ items: e2, originQuery: t2, fetchNextPage: n2, fetchPrevPage: r2, limit: i2, nextCursor: a2, prevCursor: o2 }) {
2311
+ super({ items: e2, originQuery: t2, fetchNextPage: n2, fetchPrevPage: r2, limit: i2 }), this._nextCursor = a2, this._prevCursor = o2, this.cursors = { next: a2, prev: o2 };
2312
+ }
2313
+ hasNext() {
2314
+ return !!this._nextCursor;
2315
+ }
2316
+ hasPrev() {
2317
+ return !!this._prevCursor;
2318
+ }
2319
+ };
2320
+ var Mi = class extends Ai {
2321
+ _totalCount;
2322
+ _offset;
2323
+ _tooManyToCount;
2324
+ constructor({ items: e2, fetchNextPage: t2, fetchPrevPage: n2, offset: r2, originQuery: i2, limit: a2, totalCount: o2, tooManyToCount: s2 }) {
2325
+ super({ items: e2, fetchNextPage: t2, fetchPrevPage: n2, originQuery: i2, limit: a2 }), this._totalCount = o2, this._offset = r2, this._tooManyToCount = s2;
2326
+ }
2327
+ get currentPage() {
2328
+ return this._limit === 0 ? void 0 : Math.floor(this._offset / this._limit);
2329
+ }
2330
+ get totalPages() {
2331
+ return this._tooManyToCount || this._limit === 0 ? void 0 : Math.ceil(this._totalCount / this._limit);
2332
+ }
2333
+ get totalCount() {
2334
+ return this._tooManyToCount ? void 0 : this._totalCount;
2335
+ }
2336
+ hasNext() {
2337
+ return this._limit !== 0 && this.currentPage !== void 0 && this.totalPages !== void 0 && this.currentPage < this.totalPages - 1;
2338
+ }
2339
+ hasPrev() {
2340
+ return !!(this._limit !== 0 && this.currentPage && this.currentPage > 0);
2341
+ }
2342
+ };
2343
+ function Ni(e2) {
2344
+ let t2 = (n2) => ({ query: n2, async find() {
2345
+ try {
2346
+ let r2 = e2.requestTransformer(e2.pagingMethod === `CURSOR` && n2.cursorPaging.cursor ? { cursorPaging: n2.cursorPaging } : n2), i2 = await e2.func(r2), { [st]: a2, [ct]: o2 } = e2.responseTransformer(i2);
2347
+ if (e2.pagingMethod === `OFFSET`) {
2348
+ let e3 = n2;
2349
+ return new Mi({ items: a2 ?? [], fetchNextPage: () => t2({ ...e3, paging: { offset: e3.paging.offset + e3.paging.limit, limit: e3.paging.limit } }).find(), fetchPrevPage: () => t2({ ...n2, paging: { offset: Math.max(e3.paging.offset - e3.paging.limit, 0), limit: e3.paging.limit } }).find(), offset: e3.paging.offset, limit: e3.paging.limit, totalCount: o2?.total, tooManyToCount: o2?.tooManyToCount, originQuery: this });
2350
+ }
2351
+ let s2 = n2.cursorPaging;
2352
+ return new ji({ items: a2 ?? [], limit: s2.limit, originQuery: this, fetchNextPage: () => t2({ ...n2, cursorPaging: { cursor: o2?.cursors?.next ?? void 0, limit: s2.limit } }).find(), fetchPrevPage: () => t2({ ...n2, cursorPaging: { cursor: o2?.cursors?.prev ?? void 0, limit: s2.limit } }).find(), prevCursor: o2?.cursors?.prev ?? void 0, nextCursor: o2?.cursors?.next ?? void 0 });
2353
+ } catch (t3) {
2354
+ throw e2.errorTransformer(t3);
2355
+ }
2356
+ }, skipTo(e3) {
2357
+ return t2({ ...n2, cursorPaging: { cursor: e3, limit: n2.cursorPaging.limit } });
2358
+ }, eq(r2, i2) {
2359
+ let a2 = i2 === void 0 ? null : i2, o2 = { [V(e2.transformationPaths, r2)]: a2 };
2360
+ return t2({ ...n2, filter: B(n2.filter, o2) });
2361
+ }, ne(r2, i2) {
2362
+ let a2 = i2 === void 0 ? null : i2, o2 = { [V(e2.transformationPaths, r2)]: { $ne: a2 } };
2363
+ return t2({ ...n2, filter: B(n2.filter, o2) });
2364
+ }, ge(r2, i2) {
2365
+ let a2 = { [V(e2.transformationPaths, r2)]: { $gte: i2 } };
2366
+ return t2({ ...n2, filter: B(n2.filter, a2) });
2367
+ }, gt(r2, i2) {
2368
+ let a2 = { [V(e2.transformationPaths, r2)]: { $gt: i2 } };
2369
+ return t2({ ...n2, filter: B(n2.filter, a2) });
2370
+ }, le(r2, i2) {
2371
+ let a2 = { [V(e2.transformationPaths, r2)]: { $lte: i2 } };
2372
+ return t2({ ...n2, filter: B(n2.filter, a2) });
2373
+ }, lt(r2, i2) {
2374
+ let a2 = { [V(e2.transformationPaths, r2)]: { $lt: i2 } };
2375
+ return t2({ ...n2, filter: B(n2.filter, a2) });
2376
+ }, isNotEmpty(e3) {
2377
+ return this.ne(e3, null);
2378
+ }, isEmpty(e3) {
2379
+ return this.eq(e3, null);
2380
+ }, startsWith(r2, i2) {
2381
+ let a2 = { [V(e2.transformationPaths, r2)]: { $startsWith: i2 } };
2382
+ return t2({ ...n2, filter: B(n2.filter, a2) });
2383
+ }, endsWith(r2, i2) {
2384
+ let a2 = { [V(e2.transformationPaths, r2)]: { $endsWith: i2 } };
2385
+ return t2({ ...n2, filter: B(n2.filter, a2) });
2386
+ }, contains(r2, i2) {
2387
+ let a2 = { [V(e2.transformationPaths, r2)]: { $contains: i2 } };
2388
+ return t2({ ...n2, filter: B(n2.filter, a2) });
2389
+ }, hasSome(r2, ...i2) {
2390
+ let a2 = { [V(e2.transformationPaths, r2)]: { $hasSome: Array.isArray(i2[0]) ? i2[0] : i2 } };
2391
+ return t2({ ...n2, filter: B(n2.filter, a2) });
2392
+ }, hasAll(r2, ...i2) {
2393
+ let a2 = { [V(e2.transformationPaths, r2)]: { $hasAll: Array.isArray(i2[0]) ? i2[0] : i2 } };
2394
+ return t2({ ...n2, filter: B(n2.filter, a2) });
2395
+ }, between(e3, t3, n3) {
2396
+ return this.ge(e3, t3).lt(e3, n3);
2397
+ }, in(r2, i2) {
2398
+ let a2 = { [V(e2.transformationPaths, r2)]: { $in: i2 } };
2399
+ return t2({ ...n2, filter: B(n2.filter, a2) });
2400
+ }, exists(r2, i2 = true) {
2401
+ let a2 = { [V(e2.transformationPaths, r2)]: { $exists: i2 } };
2402
+ return t2({ ...n2, filter: B(n2.filter, a2) });
2403
+ }, or(e3) {
2404
+ return t2({ ...n2, filter: Oi(n2.filter, e3.query.filter) });
2405
+ }, and(e3) {
2406
+ return t2({ ...n2, filter: B(n2.filter, e3.query.filter) });
2407
+ }, not(e3) {
2408
+ return t2({ ...n2, filter: ki(e3.query.filter) });
2409
+ }, ascending(...r2) {
2410
+ return t2({ ...n2, sort: [...n2.sort ?? [], ...r2.map((t3) => ({ fieldName: V(e2.transformationPaths, t3), order: `ASC` }))] });
2411
+ }, descending(...r2) {
2412
+ return t2({ ...n2, sort: [...n2.sort ?? [], ...r2.map((t3) => ({ fieldName: V(e2.transformationPaths, t3), order: `DESC` }))] });
2413
+ }, skip(e3) {
2414
+ return t2({ ...n2, paging: { offset: e3, limit: `limit` in n2.paging ? n2.paging.limit : 50 } });
2415
+ }, limit(r2) {
2416
+ if (e2.pagingMethod === `CURSOR`) {
2417
+ let e3 = n2;
2418
+ return t2({ ...n2, cursorPaging: { limit: r2, cursor: `cursor` in e3.cursorPaging ? e3.cursorPaging.cursor : void 0 } });
2419
+ }
2420
+ let i2 = n2;
2421
+ return t2({ ...n2, paging: { limit: r2, offset: `offset` in i2.paging ? i2.paging.offset : 0 } });
2422
+ } });
2423
+ return t2({ filter: {}, ...e2.pagingMethod === `OFFSET` ? { paging: { offset: 0, limit: 50 } } : { cursorPaging: { limit: 50 } } });
2424
+ }
2425
+ function V(e2, t2) {
2426
+ let n2 = Object.entries(e2).find(([e3]) => e3 === t2 || t2.startsWith(`${e3}.`))?.[0];
2427
+ return n2 ? t2.replace(n2, e2[n2]) : ut(t2, { ...e2, ...lt });
2428
+ }
2429
+ function Pi(e2, t2, n2 = {}) {
2430
+ let r2 = (r3, i3) => Pi(e2, t2, { ...n2, [r3]: i3 }), i2 = () => Object.keys(n2).length === 0 ? {} : { [x(e2, t2)]: n2 };
2431
+ return { get filter() {
2432
+ return i2();
2433
+ }, eq: (e3) => r2(`$eq`, e3), ne: (e3) => r2(`$ne`, e3), gt: (e3) => r2(`$gt`, e3), gte: (e3) => r2(`$gte`, e3), lt: (e3) => r2(`$lt`, e3), lte: (e3) => r2(`$lte`, e3), startsWith: (e3) => r2(`$startsWith`, e3), endsWith: (e3) => r2(`$endsWith`, e3), contains: (e3) => r2(`$contains`, e3), in: (e3) => r2(`$in`, e3), nin: (e3) => r2(`$nin`, e3), hasSome: (e3) => r2(`$hasSome`, e3), hasAll: (e3) => r2(`$hasAll`, e3), exists: (e3 = true) => r2(`$exists`, e3), isEmpty: (e3 = true) => r2(`$isEmpty`, e3), isNotEmpty: () => r2(`$ne`, null) };
2434
+ }
2435
+ function Fi(e2) {
2436
+ return Object.assign((t2) => Pi(t2, e2), { and: (...e3) => ({ filter: { $and: e3.map((e4) => e4.filter) } }), or: (...e3) => ({ filter: { $or: e3.map((e4) => e4.filter) } }), not: (e3) => ({ filter: { $not: e3.filter } }) });
2437
+ }
2438
+ function Ii(e2) {
2439
+ return (t2) => ({ asc: () => ({ sort: { fieldName: x(t2, e2), order: `ASC` } }), desc: () => ({ sort: { fieldName: x(t2, e2), order: `DESC` } }) });
2440
+ }
2441
+ function Li(e2) {
2442
+ return () => {
2443
+ let t2 = {}, n2 = { withFilter(e3) {
2444
+ return t2 = { ...t2, filter: e3.filter }, n2;
2445
+ }, withFields(...r2) {
2446
+ return t2 = { ...t2, fields: r2.map((t3) => x(t3, e2)) }, n2;
2447
+ }, withSorting(...e3) {
2448
+ return t2 = { ...t2, sort: e3.map((e4) => e4.sort) }, n2;
2449
+ }, withPaging(e3) {
2450
+ return t2 = { ...t2, paging: e3 }, n2;
2451
+ }, build() {
2452
+ return t2;
2453
+ } };
2454
+ return n2;
2455
+ };
2456
+ }
2457
+ function H(e2) {
2458
+ return { QueryBuilder: Li(e2), Filter: Fi(e2), Sort: Ii(e2) };
2459
+ }
2460
+ var Ri = `filter`;
2461
+ var zi = `sort`;
2462
+ var Bi = `cursorPaging`;
2463
+ var Vi = `paging`;
2464
+ var Hi = [Ri, zi, Bi];
2465
+ var Ui = [Ri, zi, Vi];
2466
+ function Wi(e2, t2) {
2467
+ return !e2 || typeof e2 != `object` ? false : t2.some((t3) => e2.hasOwnProperty(t3));
2468
+ }
2469
+ function Gi(e2) {
2470
+ return Wi(e2, Hi);
2471
+ }
2472
+ function Ki(e2) {
2473
+ return Wi(e2, Ui);
2474
+ }
2475
+ function qi(e2) {
2476
+ let { hasOptionsParameter: t2 } = e2;
2477
+ return function(...n2) {
2478
+ return t2 ? Yi(n2, e2) : Ji(n2, e2);
2479
+ };
2480
+ }
2481
+ function Ji(e2, t2) {
2482
+ return e2.length === 0 ? t2.builderQueryFunction() : t2.typedQueryFunction(e2[0]);
2483
+ }
2484
+ function Yi(e2, t2) {
2485
+ switch (e2.length) {
2486
+ case 0:
2487
+ return t2.builderQueryFunction();
2488
+ case 1:
2489
+ return Gi(e2[0]) || Ki(e2[0]) ? t2.typedQueryFunction(e2[0]) : t2.builderQueryFunction(e2[0]);
2490
+ default:
2491
+ return t2.typedQueryFunction(e2[0], e2[1]);
2492
+ }
2493
+ }
2494
+ function U(e2) {
2495
+ if (!e2) return;
2496
+ let t2 = ``;
2497
+ return (e2.filename || e2.altText) && (t2 = `/${encodeURIComponent(e2.filename || e2.altText)}`), e2.id ? `wix:image://v1/${e2.id}${t2}#originWidth=${e2.width}&originHeight=${e2.height}` : e2.url;
2498
+ }
2499
+ function Xi(e2) {
2500
+ if (!e2) return;
2501
+ let t2 = ``;
2502
+ e2?.filename && (t2 = `/${encodeURIComponent(e2.filename)}`);
2503
+ let n2 = ``;
2504
+ if (e2.posters?.length) {
2505
+ let [t3, r2] = e2.posters, i2 = r2 || t3, a2 = i2.id || ``;
2506
+ if (!a2 && i2.url) {
2507
+ let e3 = i2.url.lastIndexOf(`/`);
2508
+ e3 !== -1 && (a2 = i2.url.substring(e3 + 1));
2509
+ }
2510
+ a2 && (n2 = `#posterUri=${a2}&posterWidth=${i2.width}&posterHeight=${i2.height}`);
2511
+ }
2512
+ return e2.id ? `wix:video://v1/${e2.id}${t2}${n2}` : e2.url;
2513
+ }
2514
+ function Zi(e2) {
2515
+ return k(Object.assign(e2, { domainToMappings: { "manage._base_domain_": [{ srcPath: `/customization`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/stores/v3/customizations`, destPath: `/v3/customizations` }, { srcPath: `/stores/v3/bulk/customizations`, destPath: `/v3/bulk/customizations` }], "editor._base_domain_": [{ srcPath: `/_api/customization`, destPath: `` }], "blocks._base_domain_": [{ srcPath: `/_api/customization`, destPath: `` }], "create.editorx": [{ srcPath: `/_api/customization`, destPath: `` }], _: [{ srcPath: `/_api/customization`, destPath: `` }], "*.dev.wix-code.com": [{ srcPath: `/_api/customization`, destPath: `` }] } }));
2516
+ }
2517
+ var Qi = `@wix/auto_sdk_stores_customizations-v-3`;
2518
+ function $i(e2) {
2519
+ function t2({ host: t3 }) {
2520
+ return { entityFqdn: `wix.stores.catalog.v3.customization`, method: `GET`, methodFqn: `wix.stores.catalog.customization.v3.CustomizationService.QueryCustomizations`, packageName: Qi, migrationOptions: { optInTransformResponse: true }, url: Zi({ protoPath: `/v3/customizations/query`, data: e2, host: t3 }), params: O(e2, true), transformResponse: (e3) => T(e3, [{ transformFn: w, paths: [{ path: `customizations.createdDate` }, { path: `customizations.updatedDate` }, { path: `customizations.choicesSettings.choices.image.urlExpirationDate` }, { path: `customizations.choicesSettings.choices.displayImage.urlExpirationDate` }] }, { transformFn: j, paths: [{ path: `customizations.choicesSettings.choices.image.focalPoint.x` }, { path: `customizations.choicesSettings.choices.image.focalPoint.y` }] }]), fallback: [{ method: `POST`, url: Zi({ protoPath: `/v3/customizations/query`, data: e2, host: t3 }), data: e2 }] };
2521
+ }
2522
+ return t2;
2523
+ }
2524
+ var ea = ((e2) => (e2.PRODUCT_OPTION = `PRODUCT_OPTION`, e2.MODIFIER = `MODIFIER`, e2))(ea || {});
2525
+ var W = ((e2) => (e2.FREE_TEXT = `FREE_TEXT`, e2.TEXT_CHOICES = `TEXT_CHOICES`, e2.SWATCH_CHOICES = `SWATCH_CHOICES`, e2))(W || {});
2526
+ var G = ((e2) => (e2.DEFAULT = `DEFAULT`, e2.BY_NAME = `BY_NAME`, e2.BY_PRODUCT_COUNT = `BY_PRODUCT_COUNT`, e2.MANUAL = `MANUAL`, e2))(G || {});
2527
+ var ta = ((e2) => (e2.ASSIGNED_PRODUCTS_COUNT = `ASSIGNED_PRODUCTS_COUNT`, e2.CHOICE_DISPLAY_IMAGE = `CHOICE_DISPLAY_IMAGE`, e2))(ta || {});
2528
+ function na(e2) {
2529
+ let { httpClient: t2, sideEffects: n2 } = arguments[1];
2530
+ return Ni({ func: async (r2) => {
2531
+ let i2 = $i({ ...r2, ...e2 ?? {} });
2532
+ n2?.onSiteCall?.();
2533
+ try {
2534
+ let e3 = await t2.request(i2);
2535
+ return n2?.onSuccess?.(e3), e3;
2536
+ } catch (e3) {
2537
+ throw n2?.onError?.(e3), e3;
2538
+ }
2539
+ }, requestTransformer: (t3) => {
2540
+ let n3 = [t3, e2];
2541
+ return S({ ...n3?.[1], query: n3?.[0] });
2542
+ }, responseTransformer: ({ data: e3 }) => {
2543
+ let t3 = C(T(e3, [{ transformFn: U, paths: [{ path: `customizations.choicesSettings.choices.image` }, { path: `customizations.choicesSettings.choices.displayImage` }] }]));
2544
+ return { items: t3?.customizations, pagingMetadata: t3?.pagingMetadata };
2545
+ }, errorTransformer: (e3) => {
2546
+ throw E(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { query: `$[0]` }, singleArgumentUnchanged: false });
2547
+ }, pagingMethod: `CURSOR`, transformationPaths: {} });
2548
+ }
2549
+ async function ra(e2, t2) {
2550
+ let { httpClient: n2, sideEffects: r2 } = arguments[2], i2 = $i(S({ query: e2, ...t2 }));
2551
+ r2?.onSiteCall?.();
2552
+ try {
2553
+ let e3 = await n2.request(i2);
2554
+ return r2?.onSuccess?.(e3), C(T(e3.data, [{ transformFn: U, paths: [{ path: `customizations.choicesSettings.choices.image` }, { path: `customizations.choicesSettings.choices.displayImage` }] }]));
2555
+ } catch (e3) {
2556
+ let t3 = E(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { query: `$[0]` }, singleArgumentUnchanged: false }, [`query`, `options`]);
2557
+ throw r2?.onError?.(e3), t3;
2558
+ }
2559
+ }
2560
+ ({ ...H() });
2561
+ function ia(e2) {
2562
+ return (t2) => na(t2, { httpClient: e2 });
2563
+ }
2564
+ function aa(e2) {
2565
+ return (t2, n2) => ra(t2, n2, { httpClient: e2 });
2566
+ }
2567
+ var oa = y(`wix.stores.catalog.v3.customization_created`, true, (e2) => C(T(e2, [{ transformFn: w, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `metadata.eventTime` }] }, { transformFn: U, paths: [{ path: `entity.choicesSettings.choices.image` }, { path: `entity.choicesSettings.choices.displayImage` }] }])))();
2568
+ var sa = y(`wix.stores.catalog.v3.customization_deleted`, true, (e2) => C(T(e2, [{ transformFn: w, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `metadata.eventTime` }] }, { transformFn: U, paths: [{ path: `entity.choicesSettings.choices.image` }, { path: `entity.choicesSettings.choices.displayImage` }] }])))();
2569
+ var ca = y(`wix.stores.catalog.v3.customization_updated`, true, (e2) => C(T(e2, [{ transformFn: w, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `metadata.eventTime` }, { path: `modifiedFields.createdDate` }, { path: `modifiedFields.updatedDate` }] }, { transformFn: U, paths: [{ path: `entity.choicesSettings.choices.image` }, { path: `entity.choicesSettings.choices.displayImage` }, { path: `modifiedFields.choicesSettings.choices.image` }, { path: `modifiedFields.choicesSettings.choices.displayImage` }] }])))();
2570
+ function la(e2) {
2571
+ let t2 = qi({ builderQueryFunction: (t3) => ia(e2)(t3), typedQueryFunction: (t3, n3) => aa(e2)(t3, n3), hasOptionsParameter: true });
2572
+ function n2(e3, n3) {
2573
+ return t2(...arguments);
2574
+ }
2575
+ return n2;
2576
+ }
2577
+ var ua = D(la);
2578
+ A(oa), A(sa), A(ca);
2579
+ function da(e2) {
2580
+ let t2 = {}, n2 = { get search() {
2581
+ return t2;
2582
+ }, expression(e3) {
2583
+ return t2 = { ...t2, expression: e3 }, n2;
2584
+ }, mode(e3) {
2585
+ return t2 = { ...t2, mode: e3 }, n2;
2586
+ }, fields(r2) {
2587
+ return t2 = { ...t2, fields: r2.map((t3) => x(t3, e2)) }, n2;
2588
+ }, fuzzy(e3 = true) {
2589
+ return t2 = { ...t2, fuzzy: e3 }, n2;
2590
+ } };
2591
+ return n2;
2592
+ }
2593
+ function fa(e2) {
2594
+ return (t2) => {
2595
+ let n2 = da(e2);
2596
+ return t2 === void 0 ? n2 : n2.expression(t2);
2597
+ };
2598
+ }
2599
+ function pa(e2) {
2600
+ let t2 = { ...e2, type: `VALUE`, value: { ...e2.value } }, n2 = { get aggregation() {
2601
+ return t2;
2602
+ }, sortBy(e3, r2) {
2603
+ return t2 = { ...t2, value: { ...t2.value, sortType: e3, sortDirection: r2 } }, n2;
2604
+ }, limit(e3) {
2605
+ return t2 = { ...t2, value: { ...t2.value, limit: e3 } }, n2;
2606
+ }, excludeMissingValues() {
2607
+ return t2 = { ...t2, value: { ...t2.value, missingValues: `EXCLUDE` } }, n2;
2608
+ }, includeMissingValues() {
2609
+ return t2 = { ...t2, value: { ...t2.value, missingValues: `INCLUDE` } }, n2;
2610
+ }, includeValues(e3) {
2611
+ return t2 = { ...t2, value: { ...t2.value, includeOptions: { addToBucket: e3 } } }, n2;
2612
+ } };
2613
+ return n2;
2614
+ }
2615
+ function ma(e2) {
2616
+ let t2 = { ...e2, type: `RANGE`, range: { buckets: [] } }, n2 = { get aggregation() {
2617
+ return t2;
2618
+ }, withBuckets(...e3) {
2619
+ return t2 = { ...t2, range: { buckets: e3 } }, n2;
2620
+ } };
2621
+ return n2;
2622
+ }
2623
+ function ha(e2) {
2624
+ let t2 = { ...e2, type: `DATE_HISTOGRAM`, dateHistogram: {} }, n2 = { get aggregation() {
2625
+ return t2;
2626
+ }, interval(e3) {
2627
+ return t2 = { ...t2, dateHistogram: { interval: e3 } }, n2;
2628
+ } };
2629
+ return n2;
2630
+ }
2631
+ function ga(e2) {
2632
+ let t2 = { ...e2, type: `SCALAR`, scalar: {} }, n2 = { get aggregation() {
2633
+ return t2;
2634
+ }, type(e3) {
2635
+ return t2 = { ...t2, scalar: { type: e3 } }, n2;
2636
+ } };
2637
+ return n2;
2638
+ }
2639
+ function _a(e2) {
2640
+ let t2 = { ...e2, type: `NESTED`, nested: { nestedAggregations: [] } }, n2 = { get aggregation() {
2641
+ return t2;
2642
+ }, addNestedAggregation(e3) {
2643
+ let r2 = e3.aggregation, i2 = [...t2.nested?.nestedAggregations ?? [], r2];
2644
+ return t2 = { ...t2, nested: { nestedAggregations: i2 } }, n2;
2645
+ } };
2646
+ return n2;
2647
+ }
2648
+ function va(e2, t2) {
2649
+ let n2 = { name: e2 }, r2 = { get aggregation() {
2650
+ return n2;
2651
+ }, ofType(e3) {
2652
+ return n2 = { ...n2, type: e3 }, r2;
2653
+ }, onField(e3) {
2654
+ return n2 = { ...n2, fieldPath: x(e3, t2) }, r2;
2655
+ }, asValueAggregation() {
2656
+ return pa(n2);
2657
+ }, asRangeAggregation() {
2658
+ return ma(n2);
2659
+ }, asDateHistogramAggregation() {
2660
+ return ha(n2);
2661
+ }, asScalarAggregation() {
2662
+ return ga(n2);
2663
+ }, asNestedAggregation() {
2664
+ return _a(n2);
2665
+ } };
2666
+ return r2;
2667
+ }
2668
+ function ya(e2) {
2669
+ return (t2) => va(t2, e2);
2670
+ }
2671
+ function ba() {
2672
+ return () => {
2673
+ let e2 = {}, t2 = { withFilter(n2) {
2674
+ return e2 = { ...e2, filter: n2.filter }, t2;
2675
+ }, withSearchClause(n2) {
2676
+ return e2 = { ...e2, search: n2.search }, t2;
2677
+ }, withSorting(...n2) {
2678
+ return e2 = { ...e2, sort: n2.map((e3) => e3.sort) }, t2;
2679
+ }, withAggregation(...n2) {
2680
+ return e2 = { ...e2, aggregations: n2.map((e3) => e3.aggregation) }, t2;
2681
+ }, withPaging(n2) {
2682
+ return e2 = { ...e2, paging: n2 }, t2;
2683
+ }, withTimeZone(n2) {
2684
+ return e2 = { ...e2, timeZone: n2 }, t2;
2685
+ }, build() {
2686
+ return e2;
2687
+ } };
2688
+ return t2;
2689
+ };
2690
+ }
2691
+ function xa(e2) {
2692
+ return { SearchBuilder: ba(), Filter: Fi(e2), Sort: Ii(e2), SearchParams: fa(e2), Aggregation: ya(e2) };
2693
+ }
2694
+ function Sa(e2) {
2695
+ if (e2) return e2.url;
2696
+ }
2697
+ function Ca(e2) {
2698
+ return k(Object.assign(e2, { domainToMappings: { "api._api_base_domain_": [{ srcPath: `/stores-catalog-orchestrator`, destPath: `` }], "manage._base_domain_": [{ srcPath: `/stores`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/stores/v3/products`, destPath: `/v3/products` }, { srcPath: `/stores/v3/bulk/products`, destPath: `/v3/bulk/products` }, { srcPath: `/stores/v3/products-with-inventory`, destPath: `/v3/products-with-inventory` }, { srcPath: `/stores/v3/bulk/products-with-inventory`, destPath: `/v3/bulk/products-with-inventory` }, { srcPath: `/stores/v3/all-products-category`, destPath: `/v3/all-products-category` }], "www._base_domain_": [{ srcPath: `/_api/stores-catalog-orchestrator`, destPath: `` }], "editor._base_domain_": [{ srcPath: `/_api/stores-catalog-orchestrator`, destPath: `` }], "blocks._base_domain_": [{ srcPath: `/_api/stores-catalog-orchestrator`, destPath: `` }], "create.editorx": [{ srcPath: `/_api/stores-catalog-orchestrator`, destPath: `` }], "editor.wixapps.net": [{ srcPath: `/_api/stores-catalog-orchestrator`, destPath: `` }], "*.dev.wix-code.com": [{ srcPath: `/_api/stores-catalog-orchestrator`, destPath: `` }], _: [{ srcPath: `/_api/stores-catalog-orchestrator`, destPath: `` }] } }));
2699
+ }
2700
+ var wa = `@wix/auto_sdk_stores_products-v-3`;
2701
+ function Ta(e2) {
2702
+ function t2({ host: t3 }) {
2703
+ let n2 = T(e2, [{ transformFn: yn, paths: [{ path: `search.aggregations.range.buckets.from` }, { path: `search.aggregations.range.buckets.to` }, { path: `search.aggregations.nested.nestedAggregations.range.buckets.from` }, { path: `search.aggregations.nested.nestedAggregations.range.buckets.to` }] }]);
2704
+ return { entityFqdn: `wix.stores.catalog.v3.product`, method: `GET`, methodFqn: `wix.stores.catalog.v3.CatalogApi.SearchProducts`, packageName: wa, migrationOptions: { optInTransformResponse: true }, url: Ca({ protoPath: `/v3/products/search`, data: n2, host: t3 }), params: O(n2, true), transformResponse: (e3) => T(e3, [{ transformFn: w, paths: [{ path: `products.createdDate` }, { path: `products.updatedDate` }, { path: `products.description.metadata.createdTimestamp` }, { path: `products.description.metadata.updatedTimestamp` }, { path: `products.media.main.image.urlExpirationDate` }, { path: `products.media.main.video.urlExpirationDate` }, { path: `products.media.main.video.resolutions.urlExpirationDate` }, { path: `products.media.main.video.resolutions.poster.urlExpirationDate` }, { path: `products.media.main.video.posters.urlExpirationDate` }, { path: `products.media.itemsInfo.items.image.urlExpirationDate` }, { path: `products.media.itemsInfo.items.video.urlExpirationDate` }, { path: `products.media.itemsInfo.items.video.resolutions.urlExpirationDate` }, { path: `products.media.itemsInfo.items.video.resolutions.poster.urlExpirationDate` }, { path: `products.media.itemsInfo.items.video.posters.urlExpirationDate` }, { path: `products.options.choicesSettings.choices.image.urlExpirationDate` }, { path: `products.options.choicesSettings.choices.linkedMedia.image.urlExpirationDate` }, { path: `products.options.choicesSettings.choices.linkedMedia.video.urlExpirationDate` }, { path: `products.options.choicesSettings.choices.linkedMedia.video.resolutions.urlExpirationDate` }, { path: `products.options.choicesSettings.choices.linkedMedia.video.resolutions.poster.urlExpirationDate` }, { path: `products.options.choicesSettings.choices.linkedMedia.video.posters.urlExpirationDate` }, { path: `products.options.choicesSettings.choices.displayImage.urlExpirationDate` }, { path: `products.modifiers.choicesSettings.choices.image.urlExpirationDate` }, { path: `products.modifiers.choicesSettings.choices.linkedMedia.image.urlExpirationDate` }, { path: `products.modifiers.choicesSettings.choices.linkedMedia.video.urlExpirationDate` }, { path: `products.modifiers.choicesSettings.choices.linkedMedia.video.resolutions.urlExpirationDate` }, { path: `products.modifiers.choicesSettings.choices.linkedMedia.video.resolutions.poster.urlExpirationDate` }, { path: `products.modifiers.choicesSettings.choices.linkedMedia.video.posters.urlExpirationDate` }, { path: `products.modifiers.choicesSettings.choices.displayImage.urlExpirationDate` }, { path: `products.infoSections.description.metadata.createdTimestamp` }, { path: `products.infoSections.description.metadata.updatedTimestamp` }, { path: `products.variantsInfo.variants.media.image.urlExpirationDate` }, { path: `products.variantsInfo.variants.media.video.urlExpirationDate` }, { path: `products.variantsInfo.variants.media.video.resolutions.urlExpirationDate` }, { path: `products.variantsInfo.variants.media.video.resolutions.poster.urlExpirationDate` }, { path: `products.variantsInfo.variants.media.video.posters.urlExpirationDate` }, { path: `products.variantSummary.minPriceVariant.media.image.urlExpirationDate` }, { path: `products.variantSummary.minPriceVariant.media.video.urlExpirationDate` }, { path: `products.variantSummary.minPriceVariant.media.video.resolutions.urlExpirationDate` }, { path: `products.variantSummary.minPriceVariant.media.video.resolutions.poster.urlExpirationDate` }, { path: `products.variantSummary.minPriceVariant.media.video.posters.urlExpirationDate` }] }, { transformFn: j, paths: [{ path: `products.physicalProperties.pricePerUnit.quantity` }, { path: `products.physicalProperties.shippingWeightRange.minValue` }, { path: `products.physicalProperties.shippingWeightRange.maxValue` }, { path: `products.variantsInfo.variants.physicalProperties.pricePerUnit.settings.quantity` }, { path: `products.variantsInfo.variants.revenueDetails.profitMargin` }, { path: `products.subscriptionDetails.subscriptions.discount.percentOff` }, { path: `products.variantSummary.minPriceVariant.physicalProperties.pricePerUnit.settings.quantity` }, { path: `products.variantSummary.minPriceVariant.revenueDetails.profitMargin` }, { path: `products.minVariantPriceInfo.pricePerUnitData.settings.quantity` }, { path: `products.minVariantPriceInfo.revenueDetails.profitMargin` }, { path: `aggregationData.results.scalar.value` }, { path: `aggregationData.results.groupedByValue.results.nestedResults.scalar.value` }, { path: `aggregationData.results.nested.results.results.*.scalar.value` }, { path: `products.description.nodes.buttonData.styles.background.gradient.centerX` }, { path: `products.description.nodes.buttonData.styles.background.gradient.centerY` }, { path: `products.description.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `products.description.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `products.description.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `products.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `products.description.nodes.galleryData.items.image.media.duration` }, { path: `products.description.nodes.galleryData.items.video.media.duration` }, { path: `products.description.nodes.galleryData.items.video.thumbnail.duration` }, { path: `products.description.nodes.galleryData.options.item.ratio` }, { path: `products.description.nodes.imageData.image.duration` }, { path: `products.description.nodes.imageData.crop.x` }, { path: `products.description.nodes.imageData.crop.y` }, { path: `products.description.nodes.imageData.crop.width` }, { path: `products.description.nodes.imageData.crop.height` }, { path: `products.description.nodes.mapData.mapSettings.lat` }, { path: `products.description.nodes.mapData.mapSettings.lng` }, { path: `products.description.nodes.pollData.poll.image.duration` }, { path: `products.description.nodes.pollData.poll.options.image.duration` }, { path: `products.description.nodes.pollData.design.poll.background.image.duration` }, { path: `products.description.nodes.appEmbedData.image.duration` }, { path: `products.description.nodes.videoData.video.duration` }, { path: `products.description.nodes.videoData.thumbnail.duration` }, { path: `products.description.nodes.audioData.audio.duration` }, { path: `products.description.nodes.audioData.coverImage.duration` }, { path: `products.description.nodes.layoutData.backgroundImage.media.duration` }, { path: `products.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `products.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `products.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `products.description.nodes.layoutData.backdropImage.media.duration` }, { path: `products.description.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `products.description.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `products.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `products.description.nodes.layoutData.background.gradient.centerX` }, { path: `products.description.nodes.layoutData.background.gradient.centerY` }, { path: `products.description.nodes.layoutData.background.gradient.stops.position` }, { path: `products.description.nodes.layoutData.backdrop.gradient.centerX` }, { path: `products.description.nodes.layoutData.backdrop.gradient.centerY` }, { path: `products.description.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `products.description.nodes.shapeData.shape.duration` }, { path: `products.description.nodes.cardData.background.gradient.centerX` }, { path: `products.description.nodes.cardData.background.gradient.centerY` }, { path: `products.description.nodes.cardData.background.gradient.stops.position` }, { path: `products.description.nodes.cardData.backgroundImage.media.duration` }, { path: `products.description.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `products.description.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `products.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `products.description.nodes.tocData.fontSize` }, { path: `products.description.nodes.tocData.itemSpacing` }, { path: `products.description.nodes.smartBlockCellData.shape.duration` }, { path: `products.infoSections.description.nodes.buttonData.styles.background.gradient.centerX` }, { path: `products.infoSections.description.nodes.buttonData.styles.background.gradient.centerY` }, { path: `products.infoSections.description.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `products.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `products.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `products.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `products.infoSections.description.nodes.galleryData.items.image.media.duration` }, { path: `products.infoSections.description.nodes.galleryData.items.video.media.duration` }, { path: `products.infoSections.description.nodes.galleryData.items.video.thumbnail.duration` }, { path: `products.infoSections.description.nodes.galleryData.options.item.ratio` }, { path: `products.infoSections.description.nodes.imageData.image.duration` }, { path: `products.infoSections.description.nodes.imageData.crop.x` }, { path: `products.infoSections.description.nodes.imageData.crop.y` }, { path: `products.infoSections.description.nodes.imageData.crop.width` }, { path: `products.infoSections.description.nodes.imageData.crop.height` }, { path: `products.infoSections.description.nodes.mapData.mapSettings.lat` }, { path: `products.infoSections.description.nodes.mapData.mapSettings.lng` }, { path: `products.infoSections.description.nodes.pollData.poll.image.duration` }, { path: `products.infoSections.description.nodes.pollData.poll.options.image.duration` }, { path: `products.infoSections.description.nodes.pollData.design.poll.background.image.duration` }, { path: `products.infoSections.description.nodes.appEmbedData.image.duration` }, { path: `products.infoSections.description.nodes.videoData.video.duration` }, { path: `products.infoSections.description.nodes.videoData.thumbnail.duration` }, { path: `products.infoSections.description.nodes.audioData.audio.duration` }, { path: `products.infoSections.description.nodes.audioData.coverImage.duration` }, { path: `products.infoSections.description.nodes.layoutData.backgroundImage.media.duration` }, { path: `products.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `products.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `products.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `products.infoSections.description.nodes.layoutData.backdropImage.media.duration` }, { path: `products.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `products.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `products.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `products.infoSections.description.nodes.layoutData.background.gradient.centerX` }, { path: `products.infoSections.description.nodes.layoutData.background.gradient.centerY` }, { path: `products.infoSections.description.nodes.layoutData.background.gradient.stops.position` }, { path: `products.infoSections.description.nodes.layoutData.backdrop.gradient.centerX` }, { path: `products.infoSections.description.nodes.layoutData.backdrop.gradient.centerY` }, { path: `products.infoSections.description.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `products.infoSections.description.nodes.shapeData.shape.duration` }, { path: `products.infoSections.description.nodes.cardData.background.gradient.centerX` }, { path: `products.infoSections.description.nodes.cardData.background.gradient.centerY` }, { path: `products.infoSections.description.nodes.cardData.background.gradient.stops.position` }, { path: `products.infoSections.description.nodes.cardData.backgroundImage.media.duration` }, { path: `products.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `products.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `products.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `products.infoSections.description.nodes.tocData.fontSize` }, { path: `products.infoSections.description.nodes.tocData.itemSpacing` }, { path: `products.infoSections.description.nodes.smartBlockCellData.shape.duration` }, { path: `products.variantsInfo.variants.physicalProperties.weight` }, { path: `products.variantSummary.minPriceVariant.physicalProperties.weight` }, { path: `products.minVariantPriceInfo.weight` }, { path: `aggregationData.results.ranges.results.from` }, { path: `aggregationData.results.ranges.results.to` }, { path: `aggregationData.results.groupedByValue.results.nestedResults.ranges.results.from` }, { path: `aggregationData.results.groupedByValue.results.nestedResults.ranges.results.to` }, { path: `aggregationData.results.nested.results.results.*.range.from` }, { path: `aggregationData.results.nested.results.results.*.range.to` }] }]), fallback: [{ method: `POST`, url: Ca({ protoPath: `/v3/products/search`, data: n2, host: t3 }), data: n2 }] };
2705
+ }
2706
+ return t2;
2707
+ }
2708
+ function Ea(e2) {
2709
+ function t2({ host: t3 }) {
2710
+ return { entityFqdn: `wix.stores.catalog.v3.product`, method: `GET`, methodFqn: `wix.stores.catalog.v3.CatalogApi.CountProducts`, packageName: wa, migrationOptions: { optInTransformResponse: true }, url: Ca({ protoPath: `/v3/products/count`, data: e2, host: t3 }), params: O(e2, true), fallback: [{ method: `POST`, url: Ca({ protoPath: `/v3/products/count`, data: e2, host: t3 }), data: e2 }] };
2711
+ }
2712
+ return t2;
2713
+ }
2714
+ var Da = ((e2) => (e2.FREE_TEXT = `FREE_TEXT`, e2.TEXT_CHOICES = `TEXT_CHOICES`, e2.SWATCH_CHOICES = `SWATCH_CHOICES`, e2))(Da || {});
2715
+ var K = ((e2) => (e2.ASC = `ASC`, e2.DESC = `DESC`, e2))(K || {});
2716
+ var Oa = ((e2) => (e2.COUNT = `COUNT`, e2.VALUE = `VALUE`, e2))(Oa || {});
2717
+ var ka = ((e2) => (e2.DESC = `DESC`, e2.ASC = `ASC`, e2))(ka || {});
2718
+ var Aa = ((e2) => (e2.COUNT_DISTINCT = `COUNT_DISTINCT`, e2.MIN = `MIN`, e2.MAX = `MAX`, e2))(Aa || {});
2719
+ var ja = ((e2) => (e2.VALUE = `VALUE`, e2.RANGE = `RANGE`, e2.SCALAR = `SCALAR`, e2.DATE_HISTOGRAM = `DATE_HISTOGRAM`, e2.NESTED = `NESTED`, e2))(ja || {});
2720
+ var q = ((e2) => (e2.URL = `URL`, e2.CURRENCY = `CURRENCY`, e2.INFO_SECTION = `INFO_SECTION`, e2.MERCHANT_DATA = `MERCHANT_DATA`, e2.PLAIN_DESCRIPTION = `PLAIN_DESCRIPTION`, e2.INFO_SECTION_PLAIN_DESCRIPTION = `INFO_SECTION_PLAIN_DESCRIPTION`, e2.SUBSCRIPTION_PRICES_INFO = `SUBSCRIPTION_PRICES_INFO`, e2.BREADCRUMBS_INFO = `BREADCRUMBS_INFO`, e2.WEIGHT_MEASUREMENT_UNIT_INFO = `WEIGHT_MEASUREMENT_UNIT_INFO`, e2.VARIANT_OPTION_CHOICE_NAMES = `VARIANT_OPTION_CHOICE_NAMES`, e2.MEDIA_ITEMS_INFO = `MEDIA_ITEMS_INFO`, e2.DESCRIPTION = `DESCRIPTION`, e2.DIRECT_CATEGORIES_INFO = `DIRECT_CATEGORIES_INFO`, e2.ALL_CATEGORIES_INFO = `ALL_CATEGORIES_INFO`, e2.INFO_SECTION_DESCRIPTION = `INFO_SECTION_DESCRIPTION`, e2.THUMBNAIL = `THUMBNAIL`, e2.PRODUCT_CHOICES_MEDIA_REFERENCES = `PRODUCT_CHOICES_MEDIA_REFERENCES`, e2.PRODUCT_CHOICES_DISPLAY_IMAGE = `PRODUCT_CHOICES_DISPLAY_IMAGE`, e2.MIN_PRICE_VARIANT = `MIN_PRICE_VARIANT`, e2.DISCOUNT_INFO = `DISCOUNT_INFO`, e2))(q || {});
2721
+ async function Ma(e2, t2) {
2722
+ let { httpClient: n2, sideEffects: r2 } = arguments[2], i2 = Ta(S({ search: e2, fields: t2?.fields }, []));
2723
+ r2?.onSiteCall?.();
2724
+ try {
2725
+ let e3 = await n2.request(i2);
2726
+ return r2?.onSuccess?.(e3), C(T(e3.data, [{ transformFn: Sa, paths: [{ path: `products.url` }] }, { transformFn: U, paths: [{ path: `products.media.main.image` }, { path: `products.media.itemsInfo.items.image` }, { path: `products.options.choicesSettings.choices.image` }, { path: `products.options.choicesSettings.choices.displayImage` }, { path: `products.options.choicesSettings.choices.linkedMedia.image` }, { path: `products.modifiers.choicesSettings.choices.image` }, { path: `products.modifiers.choicesSettings.choices.displayImage` }, { path: `products.modifiers.choicesSettings.choices.linkedMedia.image` }, { path: `products.variantsInfo.variants.media.image` }, { path: `products.variantSummary.minPriceVariant.media.image` }] }, { transformFn: Xi, paths: [{ path: `products.media.main.video` }, { path: `products.media.itemsInfo.items.video` }, { path: `products.options.choicesSettings.choices.linkedMedia.video` }, { path: `products.modifiers.choicesSettings.choices.linkedMedia.video` }, { path: `products.variantsInfo.variants.media.video` }, { path: `products.variantSummary.minPriceVariant.media.video` }] }]), [`products.description`, `products.infoSections.description`]);
2727
+ } catch (e3) {
2728
+ let t3 = E(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { search: `$[0]`, fields: `$[1].fields` }, singleArgumentUnchanged: false }, [`search`, `options`]);
2729
+ throw r2?.onError?.(e3), t3;
2730
+ }
2731
+ }
2732
+ ({ ...xa() }, { ...H() });
2733
+ async function Na(e2) {
2734
+ let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = Ea(S({ filter: e2?.filter, search: e2?.search, returnNonVisibleProducts: e2?.returnNonVisibleProducts }, []));
2735
+ n2?.onSiteCall?.();
2736
+ try {
2737
+ let e3 = await t2.request(r2);
2738
+ return n2?.onSuccess?.(e3), C(e3.data, []);
2739
+ } catch (e3) {
2740
+ let t3 = E(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { filter: `$[0].filter`, search: `$[0].search`, returnNonVisibleProducts: `$[0].returnNonVisibleProducts` }, singleArgumentUnchanged: false }, [`options`]);
2741
+ throw n2?.onError?.(e3), t3;
2742
+ }
2743
+ }
2744
+ function Pa(e2) {
2745
+ return (t2, n2) => Ma(t2, n2, { httpClient: e2 });
2746
+ }
2747
+ function Fa(e2) {
2748
+ return (t2) => Na(t2, { httpClient: e2 });
2749
+ }
2750
+ var Ia = y(`wix.stores.catalog.v3.product_created`, true, (e2) => C(T(e2, [{ transformFn: w, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `entity.description.metadata.createdTimestamp` }, { path: `entity.description.metadata.updatedTimestamp` }, { path: `entity.infoSections.description.metadata.createdTimestamp` }, { path: `entity.infoSections.description.metadata.updatedTimestamp` }, { path: `metadata.eventTime` }] }, { transformFn: Sa, paths: [{ path: `entity.url` }] }, { transformFn: j, paths: [{ path: `entity.physicalProperties.pricePerUnit.quantity` }, { path: `entity.physicalProperties.shippingWeightRange.minValue` }, { path: `entity.physicalProperties.shippingWeightRange.maxValue` }, { path: `entity.variantsInfo.variants.physicalProperties.pricePerUnit.settings.quantity` }, { path: `entity.variantsInfo.variants.revenueDetails.profitMargin` }, { path: `entity.subscriptionDetails.subscriptions.discount.percentOff` }, { path: `entity.variantSummary.minPriceVariant.physicalProperties.pricePerUnit.settings.quantity` }, { path: `entity.variantSummary.minPriceVariant.revenueDetails.profitMargin` }, { path: `entity.minVariantPriceInfo.pricePerUnitData.settings.quantity` }, { path: `entity.minVariantPriceInfo.revenueDetails.profitMargin` }, { path: `entity.description.nodes.buttonData.styles.background.gradient.centerX` }, { path: `entity.description.nodes.buttonData.styles.background.gradient.centerY` }, { path: `entity.description.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `entity.description.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `entity.description.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `entity.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `entity.description.nodes.galleryData.items.image.media.duration` }, { path: `entity.description.nodes.galleryData.items.video.media.duration` }, { path: `entity.description.nodes.galleryData.items.video.thumbnail.duration` }, { path: `entity.description.nodes.galleryData.options.item.ratio` }, { path: `entity.description.nodes.imageData.image.duration` }, { path: `entity.description.nodes.imageData.crop.x` }, { path: `entity.description.nodes.imageData.crop.y` }, { path: `entity.description.nodes.imageData.crop.width` }, { path: `entity.description.nodes.imageData.crop.height` }, { path: `entity.description.nodes.mapData.mapSettings.lat` }, { path: `entity.description.nodes.mapData.mapSettings.lng` }, { path: `entity.description.nodes.pollData.poll.image.duration` }, { path: `entity.description.nodes.pollData.poll.options.image.duration` }, { path: `entity.description.nodes.pollData.design.poll.background.image.duration` }, { path: `entity.description.nodes.appEmbedData.image.duration` }, { path: `entity.description.nodes.videoData.video.duration` }, { path: `entity.description.nodes.videoData.thumbnail.duration` }, { path: `entity.description.nodes.audioData.audio.duration` }, { path: `entity.description.nodes.audioData.coverImage.duration` }, { path: `entity.description.nodes.layoutData.backgroundImage.media.duration` }, { path: `entity.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.description.nodes.layoutData.backdropImage.media.duration` }, { path: `entity.description.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `entity.description.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `entity.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `entity.description.nodes.layoutData.background.gradient.centerX` }, { path: `entity.description.nodes.layoutData.background.gradient.centerY` }, { path: `entity.description.nodes.layoutData.background.gradient.stops.position` }, { path: `entity.description.nodes.layoutData.backdrop.gradient.centerX` }, { path: `entity.description.nodes.layoutData.backdrop.gradient.centerY` }, { path: `entity.description.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `entity.description.nodes.shapeData.shape.duration` }, { path: `entity.description.nodes.cardData.background.gradient.centerX` }, { path: `entity.description.nodes.cardData.background.gradient.centerY` }, { path: `entity.description.nodes.cardData.background.gradient.stops.position` }, { path: `entity.description.nodes.cardData.backgroundImage.media.duration` }, { path: `entity.description.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.description.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.description.nodes.tocData.fontSize` }, { path: `entity.description.nodes.tocData.itemSpacing` }, { path: `entity.description.nodes.smartBlockCellData.shape.duration` }, { path: `entity.infoSections.description.nodes.buttonData.styles.background.gradient.centerX` }, { path: `entity.infoSections.description.nodes.buttonData.styles.background.gradient.centerY` }, { path: `entity.infoSections.description.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.galleryData.items.image.media.duration` }, { path: `entity.infoSections.description.nodes.galleryData.items.video.media.duration` }, { path: `entity.infoSections.description.nodes.galleryData.items.video.thumbnail.duration` }, { path: `entity.infoSections.description.nodes.galleryData.options.item.ratio` }, { path: `entity.infoSections.description.nodes.imageData.image.duration` }, { path: `entity.infoSections.description.nodes.imageData.crop.x` }, { path: `entity.infoSections.description.nodes.imageData.crop.y` }, { path: `entity.infoSections.description.nodes.imageData.crop.width` }, { path: `entity.infoSections.description.nodes.imageData.crop.height` }, { path: `entity.infoSections.description.nodes.mapData.mapSettings.lat` }, { path: `entity.infoSections.description.nodes.mapData.mapSettings.lng` }, { path: `entity.infoSections.description.nodes.pollData.poll.image.duration` }, { path: `entity.infoSections.description.nodes.pollData.poll.options.image.duration` }, { path: `entity.infoSections.description.nodes.pollData.design.poll.background.image.duration` }, { path: `entity.infoSections.description.nodes.appEmbedData.image.duration` }, { path: `entity.infoSections.description.nodes.videoData.video.duration` }, { path: `entity.infoSections.description.nodes.videoData.thumbnail.duration` }, { path: `entity.infoSections.description.nodes.audioData.audio.duration` }, { path: `entity.infoSections.description.nodes.audioData.coverImage.duration` }, { path: `entity.infoSections.description.nodes.layoutData.backgroundImage.media.duration` }, { path: `entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.layoutData.backdropImage.media.duration` }, { path: `entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.layoutData.background.gradient.centerX` }, { path: `entity.infoSections.description.nodes.layoutData.background.gradient.centerY` }, { path: `entity.infoSections.description.nodes.layoutData.background.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.layoutData.backdrop.gradient.centerX` }, { path: `entity.infoSections.description.nodes.layoutData.backdrop.gradient.centerY` }, { path: `entity.infoSections.description.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.shapeData.shape.duration` }, { path: `entity.infoSections.description.nodes.cardData.background.gradient.centerX` }, { path: `entity.infoSections.description.nodes.cardData.background.gradient.centerY` }, { path: `entity.infoSections.description.nodes.cardData.background.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.cardData.backgroundImage.media.duration` }, { path: `entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.tocData.fontSize` }, { path: `entity.infoSections.description.nodes.tocData.itemSpacing` }, { path: `entity.infoSections.description.nodes.smartBlockCellData.shape.duration` }, { path: `entity.variantsInfo.variants.physicalProperties.weight` }, { path: `entity.variantSummary.minPriceVariant.physicalProperties.weight` }, { path: `entity.minVariantPriceInfo.weight` }] }, { transformFn: U, paths: [{ path: `entity.media.main.image` }, { path: `entity.media.itemsInfo.items.image` }, { path: `entity.options.choicesSettings.choices.image` }, { path: `entity.options.choicesSettings.choices.displayImage` }, { path: `entity.options.choicesSettings.choices.linkedMedia.image` }, { path: `entity.modifiers.choicesSettings.choices.image` }, { path: `entity.modifiers.choicesSettings.choices.displayImage` }, { path: `entity.modifiers.choicesSettings.choices.linkedMedia.image` }, { path: `entity.variantsInfo.variants.media.image` }, { path: `entity.variantSummary.minPriceVariant.media.image` }] }, { transformFn: Xi, paths: [{ path: `entity.media.main.video` }, { path: `entity.media.itemsInfo.items.video` }, { path: `entity.options.choicesSettings.choices.linkedMedia.video` }, { path: `entity.modifiers.choicesSettings.choices.linkedMedia.video` }, { path: `entity.variantsInfo.variants.media.video` }, { path: `entity.variantSummary.minPriceVariant.media.video` }] }])))();
2751
+ var La = y(`wix.stores.catalog.v3.product_deleted`, true, (e2) => C(T(e2, [{ transformFn: w, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `entity.description.metadata.createdTimestamp` }, { path: `entity.description.metadata.updatedTimestamp` }, { path: `entity.infoSections.description.metadata.createdTimestamp` }, { path: `entity.infoSections.description.metadata.updatedTimestamp` }, { path: `metadata.eventTime` }] }, { transformFn: Sa, paths: [{ path: `entity.url` }] }, { transformFn: j, paths: [{ path: `entity.physicalProperties.pricePerUnit.quantity` }, { path: `entity.physicalProperties.shippingWeightRange.minValue` }, { path: `entity.physicalProperties.shippingWeightRange.maxValue` }, { path: `entity.variantsInfo.variants.physicalProperties.pricePerUnit.settings.quantity` }, { path: `entity.variantsInfo.variants.revenueDetails.profitMargin` }, { path: `entity.subscriptionDetails.subscriptions.discount.percentOff` }, { path: `entity.variantSummary.minPriceVariant.physicalProperties.pricePerUnit.settings.quantity` }, { path: `entity.variantSummary.minPriceVariant.revenueDetails.profitMargin` }, { path: `entity.minVariantPriceInfo.pricePerUnitData.settings.quantity` }, { path: `entity.minVariantPriceInfo.revenueDetails.profitMargin` }, { path: `entity.description.nodes.buttonData.styles.background.gradient.centerX` }, { path: `entity.description.nodes.buttonData.styles.background.gradient.centerY` }, { path: `entity.description.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `entity.description.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `entity.description.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `entity.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `entity.description.nodes.galleryData.items.image.media.duration` }, { path: `entity.description.nodes.galleryData.items.video.media.duration` }, { path: `entity.description.nodes.galleryData.items.video.thumbnail.duration` }, { path: `entity.description.nodes.galleryData.options.item.ratio` }, { path: `entity.description.nodes.imageData.image.duration` }, { path: `entity.description.nodes.imageData.crop.x` }, { path: `entity.description.nodes.imageData.crop.y` }, { path: `entity.description.nodes.imageData.crop.width` }, { path: `entity.description.nodes.imageData.crop.height` }, { path: `entity.description.nodes.mapData.mapSettings.lat` }, { path: `entity.description.nodes.mapData.mapSettings.lng` }, { path: `entity.description.nodes.pollData.poll.image.duration` }, { path: `entity.description.nodes.pollData.poll.options.image.duration` }, { path: `entity.description.nodes.pollData.design.poll.background.image.duration` }, { path: `entity.description.nodes.appEmbedData.image.duration` }, { path: `entity.description.nodes.videoData.video.duration` }, { path: `entity.description.nodes.videoData.thumbnail.duration` }, { path: `entity.description.nodes.audioData.audio.duration` }, { path: `entity.description.nodes.audioData.coverImage.duration` }, { path: `entity.description.nodes.layoutData.backgroundImage.media.duration` }, { path: `entity.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.description.nodes.layoutData.backdropImage.media.duration` }, { path: `entity.description.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `entity.description.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `entity.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `entity.description.nodes.layoutData.background.gradient.centerX` }, { path: `entity.description.nodes.layoutData.background.gradient.centerY` }, { path: `entity.description.nodes.layoutData.background.gradient.stops.position` }, { path: `entity.description.nodes.layoutData.backdrop.gradient.centerX` }, { path: `entity.description.nodes.layoutData.backdrop.gradient.centerY` }, { path: `entity.description.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `entity.description.nodes.shapeData.shape.duration` }, { path: `entity.description.nodes.cardData.background.gradient.centerX` }, { path: `entity.description.nodes.cardData.background.gradient.centerY` }, { path: `entity.description.nodes.cardData.background.gradient.stops.position` }, { path: `entity.description.nodes.cardData.backgroundImage.media.duration` }, { path: `entity.description.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.description.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.description.nodes.tocData.fontSize` }, { path: `entity.description.nodes.tocData.itemSpacing` }, { path: `entity.description.nodes.smartBlockCellData.shape.duration` }, { path: `entity.infoSections.description.nodes.buttonData.styles.background.gradient.centerX` }, { path: `entity.infoSections.description.nodes.buttonData.styles.background.gradient.centerY` }, { path: `entity.infoSections.description.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.galleryData.items.image.media.duration` }, { path: `entity.infoSections.description.nodes.galleryData.items.video.media.duration` }, { path: `entity.infoSections.description.nodes.galleryData.items.video.thumbnail.duration` }, { path: `entity.infoSections.description.nodes.galleryData.options.item.ratio` }, { path: `entity.infoSections.description.nodes.imageData.image.duration` }, { path: `entity.infoSections.description.nodes.imageData.crop.x` }, { path: `entity.infoSections.description.nodes.imageData.crop.y` }, { path: `entity.infoSections.description.nodes.imageData.crop.width` }, { path: `entity.infoSections.description.nodes.imageData.crop.height` }, { path: `entity.infoSections.description.nodes.mapData.mapSettings.lat` }, { path: `entity.infoSections.description.nodes.mapData.mapSettings.lng` }, { path: `entity.infoSections.description.nodes.pollData.poll.image.duration` }, { path: `entity.infoSections.description.nodes.pollData.poll.options.image.duration` }, { path: `entity.infoSections.description.nodes.pollData.design.poll.background.image.duration` }, { path: `entity.infoSections.description.nodes.appEmbedData.image.duration` }, { path: `entity.infoSections.description.nodes.videoData.video.duration` }, { path: `entity.infoSections.description.nodes.videoData.thumbnail.duration` }, { path: `entity.infoSections.description.nodes.audioData.audio.duration` }, { path: `entity.infoSections.description.nodes.audioData.coverImage.duration` }, { path: `entity.infoSections.description.nodes.layoutData.backgroundImage.media.duration` }, { path: `entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.layoutData.backdropImage.media.duration` }, { path: `entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.layoutData.background.gradient.centerX` }, { path: `entity.infoSections.description.nodes.layoutData.background.gradient.centerY` }, { path: `entity.infoSections.description.nodes.layoutData.background.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.layoutData.backdrop.gradient.centerX` }, { path: `entity.infoSections.description.nodes.layoutData.backdrop.gradient.centerY` }, { path: `entity.infoSections.description.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.shapeData.shape.duration` }, { path: `entity.infoSections.description.nodes.cardData.background.gradient.centerX` }, { path: `entity.infoSections.description.nodes.cardData.background.gradient.centerY` }, { path: `entity.infoSections.description.nodes.cardData.background.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.cardData.backgroundImage.media.duration` }, { path: `entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.tocData.fontSize` }, { path: `entity.infoSections.description.nodes.tocData.itemSpacing` }, { path: `entity.infoSections.description.nodes.smartBlockCellData.shape.duration` }, { path: `entity.variantsInfo.variants.physicalProperties.weight` }, { path: `entity.variantSummary.minPriceVariant.physicalProperties.weight` }, { path: `entity.minVariantPriceInfo.weight` }] }, { transformFn: U, paths: [{ path: `entity.media.main.image` }, { path: `entity.media.itemsInfo.items.image` }, { path: `entity.options.choicesSettings.choices.image` }, { path: `entity.options.choicesSettings.choices.displayImage` }, { path: `entity.options.choicesSettings.choices.linkedMedia.image` }, { path: `entity.modifiers.choicesSettings.choices.image` }, { path: `entity.modifiers.choicesSettings.choices.displayImage` }, { path: `entity.modifiers.choicesSettings.choices.linkedMedia.image` }, { path: `entity.variantsInfo.variants.media.image` }, { path: `entity.variantSummary.minPriceVariant.media.image` }] }, { transformFn: Xi, paths: [{ path: `entity.media.main.video` }, { path: `entity.media.itemsInfo.items.video` }, { path: `entity.options.choicesSettings.choices.linkedMedia.video` }, { path: `entity.modifiers.choicesSettings.choices.linkedMedia.video` }, { path: `entity.variantsInfo.variants.media.video` }, { path: `entity.variantSummary.minPriceVariant.media.video` }] }])))();
2752
+ var Ra = y(`wix.stores.catalog.v3.product_updated`, true, (e2) => C(T(e2, [{ transformFn: w, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `entity.description.metadata.createdTimestamp` }, { path: `entity.description.metadata.updatedTimestamp` }, { path: `entity.infoSections.description.metadata.createdTimestamp` }, { path: `entity.infoSections.description.metadata.updatedTimestamp` }, { path: `metadata.eventTime` }, { path: `modifiedFields.createdDate` }, { path: `modifiedFields.updatedDate` }, { path: `modifiedFields.description.metadata.createdTimestamp` }, { path: `modifiedFields.description.metadata.updatedTimestamp` }, { path: `modifiedFields.infoSections.description.metadata.createdTimestamp` }, { path: `modifiedFields.infoSections.description.metadata.updatedTimestamp` }] }, { transformFn: Sa, paths: [{ path: `entity.url` }, { path: `modifiedFields.url` }] }, { transformFn: j, paths: [{ path: `entity.physicalProperties.pricePerUnit.quantity` }, { path: `entity.physicalProperties.shippingWeightRange.minValue` }, { path: `entity.physicalProperties.shippingWeightRange.maxValue` }, { path: `entity.variantsInfo.variants.physicalProperties.pricePerUnit.settings.quantity` }, { path: `entity.variantsInfo.variants.revenueDetails.profitMargin` }, { path: `entity.subscriptionDetails.subscriptions.discount.percentOff` }, { path: `entity.variantSummary.minPriceVariant.physicalProperties.pricePerUnit.settings.quantity` }, { path: `entity.variantSummary.minPriceVariant.revenueDetails.profitMargin` }, { path: `entity.minVariantPriceInfo.pricePerUnitData.settings.quantity` }, { path: `entity.minVariantPriceInfo.revenueDetails.profitMargin` }, { path: `entity.description.nodes.buttonData.styles.background.gradient.centerX` }, { path: `entity.description.nodes.buttonData.styles.background.gradient.centerY` }, { path: `entity.description.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `entity.description.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `entity.description.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `entity.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `entity.description.nodes.galleryData.items.image.media.duration` }, { path: `entity.description.nodes.galleryData.items.video.media.duration` }, { path: `entity.description.nodes.galleryData.items.video.thumbnail.duration` }, { path: `entity.description.nodes.galleryData.options.item.ratio` }, { path: `entity.description.nodes.imageData.image.duration` }, { path: `entity.description.nodes.imageData.crop.x` }, { path: `entity.description.nodes.imageData.crop.y` }, { path: `entity.description.nodes.imageData.crop.width` }, { path: `entity.description.nodes.imageData.crop.height` }, { path: `entity.description.nodes.mapData.mapSettings.lat` }, { path: `entity.description.nodes.mapData.mapSettings.lng` }, { path: `entity.description.nodes.pollData.poll.image.duration` }, { path: `entity.description.nodes.pollData.poll.options.image.duration` }, { path: `entity.description.nodes.pollData.design.poll.background.image.duration` }, { path: `entity.description.nodes.appEmbedData.image.duration` }, { path: `entity.description.nodes.videoData.video.duration` }, { path: `entity.description.nodes.videoData.thumbnail.duration` }, { path: `entity.description.nodes.audioData.audio.duration` }, { path: `entity.description.nodes.audioData.coverImage.duration` }, { path: `entity.description.nodes.layoutData.backgroundImage.media.duration` }, { path: `entity.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.description.nodes.layoutData.backdropImage.media.duration` }, { path: `entity.description.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `entity.description.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `entity.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `entity.description.nodes.layoutData.background.gradient.centerX` }, { path: `entity.description.nodes.layoutData.background.gradient.centerY` }, { path: `entity.description.nodes.layoutData.background.gradient.stops.position` }, { path: `entity.description.nodes.layoutData.backdrop.gradient.centerX` }, { path: `entity.description.nodes.layoutData.backdrop.gradient.centerY` }, { path: `entity.description.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `entity.description.nodes.shapeData.shape.duration` }, { path: `entity.description.nodes.cardData.background.gradient.centerX` }, { path: `entity.description.nodes.cardData.background.gradient.centerY` }, { path: `entity.description.nodes.cardData.background.gradient.stops.position` }, { path: `entity.description.nodes.cardData.backgroundImage.media.duration` }, { path: `entity.description.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.description.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.description.nodes.tocData.fontSize` }, { path: `entity.description.nodes.tocData.itemSpacing` }, { path: `entity.description.nodes.smartBlockCellData.shape.duration` }, { path: `entity.infoSections.description.nodes.buttonData.styles.background.gradient.centerX` }, { path: `entity.infoSections.description.nodes.buttonData.styles.background.gradient.centerY` }, { path: `entity.infoSections.description.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.galleryData.items.image.media.duration` }, { path: `entity.infoSections.description.nodes.galleryData.items.video.media.duration` }, { path: `entity.infoSections.description.nodes.galleryData.items.video.thumbnail.duration` }, { path: `entity.infoSections.description.nodes.galleryData.options.item.ratio` }, { path: `entity.infoSections.description.nodes.imageData.image.duration` }, { path: `entity.infoSections.description.nodes.imageData.crop.x` }, { path: `entity.infoSections.description.nodes.imageData.crop.y` }, { path: `entity.infoSections.description.nodes.imageData.crop.width` }, { path: `entity.infoSections.description.nodes.imageData.crop.height` }, { path: `entity.infoSections.description.nodes.mapData.mapSettings.lat` }, { path: `entity.infoSections.description.nodes.mapData.mapSettings.lng` }, { path: `entity.infoSections.description.nodes.pollData.poll.image.duration` }, { path: `entity.infoSections.description.nodes.pollData.poll.options.image.duration` }, { path: `entity.infoSections.description.nodes.pollData.design.poll.background.image.duration` }, { path: `entity.infoSections.description.nodes.appEmbedData.image.duration` }, { path: `entity.infoSections.description.nodes.videoData.video.duration` }, { path: `entity.infoSections.description.nodes.videoData.thumbnail.duration` }, { path: `entity.infoSections.description.nodes.audioData.audio.duration` }, { path: `entity.infoSections.description.nodes.audioData.coverImage.duration` }, { path: `entity.infoSections.description.nodes.layoutData.backgroundImage.media.duration` }, { path: `entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.layoutData.backdropImage.media.duration` }, { path: `entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.layoutData.background.gradient.centerX` }, { path: `entity.infoSections.description.nodes.layoutData.background.gradient.centerY` }, { path: `entity.infoSections.description.nodes.layoutData.background.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.layoutData.backdrop.gradient.centerX` }, { path: `entity.infoSections.description.nodes.layoutData.backdrop.gradient.centerY` }, { path: `entity.infoSections.description.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.shapeData.shape.duration` }, { path: `entity.infoSections.description.nodes.cardData.background.gradient.centerX` }, { path: `entity.infoSections.description.nodes.cardData.background.gradient.centerY` }, { path: `entity.infoSections.description.nodes.cardData.background.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.cardData.backgroundImage.media.duration` }, { path: `entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.tocData.fontSize` }, { path: `entity.infoSections.description.nodes.tocData.itemSpacing` }, { path: `entity.infoSections.description.nodes.smartBlockCellData.shape.duration` }, { path: `entity.variantsInfo.variants.physicalProperties.weight` }, { path: `entity.variantSummary.minPriceVariant.physicalProperties.weight` }, { path: `entity.minVariantPriceInfo.weight` }, { path: `modifiedFields.physicalProperties.pricePerUnit.quantity` }, { path: `modifiedFields.physicalProperties.shippingWeightRange.minValue` }, { path: `modifiedFields.physicalProperties.shippingWeightRange.maxValue` }, { path: `modifiedFields.variantsInfo.variants.physicalProperties.pricePerUnit.settings.quantity` }, { path: `modifiedFields.variantsInfo.variants.revenueDetails.profitMargin` }, { path: `modifiedFields.subscriptionDetails.subscriptions.discount.percentOff` }, { path: `modifiedFields.variantSummary.minPriceVariant.physicalProperties.pricePerUnit.settings.quantity` }, { path: `modifiedFields.variantSummary.minPriceVariant.revenueDetails.profitMargin` }, { path: `modifiedFields.minVariantPriceInfo.pricePerUnitData.settings.quantity` }, { path: `modifiedFields.minVariantPriceInfo.revenueDetails.profitMargin` }, { path: `modifiedFields.description.nodes.buttonData.styles.background.gradient.centerX` }, { path: `modifiedFields.description.nodes.buttonData.styles.background.gradient.centerY` }, { path: `modifiedFields.description.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `modifiedFields.description.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `modifiedFields.description.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `modifiedFields.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `modifiedFields.description.nodes.galleryData.items.image.media.duration` }, { path: `modifiedFields.description.nodes.galleryData.items.video.media.duration` }, { path: `modifiedFields.description.nodes.galleryData.items.video.thumbnail.duration` }, { path: `modifiedFields.description.nodes.galleryData.options.item.ratio` }, { path: `modifiedFields.description.nodes.imageData.image.duration` }, { path: `modifiedFields.description.nodes.imageData.crop.x` }, { path: `modifiedFields.description.nodes.imageData.crop.y` }, { path: `modifiedFields.description.nodes.imageData.crop.width` }, { path: `modifiedFields.description.nodes.imageData.crop.height` }, { path: `modifiedFields.description.nodes.mapData.mapSettings.lat` }, { path: `modifiedFields.description.nodes.mapData.mapSettings.lng` }, { path: `modifiedFields.description.nodes.pollData.poll.image.duration` }, { path: `modifiedFields.description.nodes.pollData.poll.options.image.duration` }, { path: `modifiedFields.description.nodes.pollData.design.poll.background.image.duration` }, { path: `modifiedFields.description.nodes.appEmbedData.image.duration` }, { path: `modifiedFields.description.nodes.videoData.video.duration` }, { path: `modifiedFields.description.nodes.videoData.thumbnail.duration` }, { path: `modifiedFields.description.nodes.audioData.audio.duration` }, { path: `modifiedFields.description.nodes.audioData.coverImage.duration` }, { path: `modifiedFields.description.nodes.layoutData.backgroundImage.media.duration` }, { path: `modifiedFields.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `modifiedFields.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `modifiedFields.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `modifiedFields.description.nodes.layoutData.backdropImage.media.duration` }, { path: `modifiedFields.description.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `modifiedFields.description.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `modifiedFields.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `modifiedFields.description.nodes.layoutData.background.gradient.centerX` }, { path: `modifiedFields.description.nodes.layoutData.background.gradient.centerY` }, { path: `modifiedFields.description.nodes.layoutData.background.gradient.stops.position` }, { path: `modifiedFields.description.nodes.layoutData.backdrop.gradient.centerX` }, { path: `modifiedFields.description.nodes.layoutData.backdrop.gradient.centerY` }, { path: `modifiedFields.description.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `modifiedFields.description.nodes.shapeData.shape.duration` }, { path: `modifiedFields.description.nodes.cardData.background.gradient.centerX` }, { path: `modifiedFields.description.nodes.cardData.background.gradient.centerY` }, { path: `modifiedFields.description.nodes.cardData.background.gradient.stops.position` }, { path: `modifiedFields.description.nodes.cardData.backgroundImage.media.duration` }, { path: `modifiedFields.description.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `modifiedFields.description.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `modifiedFields.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `modifiedFields.description.nodes.tocData.fontSize` }, { path: `modifiedFields.description.nodes.tocData.itemSpacing` }, { path: `modifiedFields.description.nodes.smartBlockCellData.shape.duration` }, { path: `modifiedFields.infoSections.description.nodes.buttonData.styles.background.gradient.centerX` }, { path: `modifiedFields.infoSections.description.nodes.buttonData.styles.background.gradient.centerY` }, { path: `modifiedFields.infoSections.description.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `modifiedFields.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `modifiedFields.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `modifiedFields.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `modifiedFields.infoSections.description.nodes.galleryData.items.image.media.duration` }, { path: `modifiedFields.infoSections.description.nodes.galleryData.items.video.media.duration` }, { path: `modifiedFields.infoSections.description.nodes.galleryData.items.video.thumbnail.duration` }, { path: `modifiedFields.infoSections.description.nodes.galleryData.options.item.ratio` }, { path: `modifiedFields.infoSections.description.nodes.imageData.image.duration` }, { path: `modifiedFields.infoSections.description.nodes.imageData.crop.x` }, { path: `modifiedFields.infoSections.description.nodes.imageData.crop.y` }, { path: `modifiedFields.infoSections.description.nodes.imageData.crop.width` }, { path: `modifiedFields.infoSections.description.nodes.imageData.crop.height` }, { path: `modifiedFields.infoSections.description.nodes.mapData.mapSettings.lat` }, { path: `modifiedFields.infoSections.description.nodes.mapData.mapSettings.lng` }, { path: `modifiedFields.infoSections.description.nodes.pollData.poll.image.duration` }, { path: `modifiedFields.infoSections.description.nodes.pollData.poll.options.image.duration` }, { path: `modifiedFields.infoSections.description.nodes.pollData.design.poll.background.image.duration` }, { path: `modifiedFields.infoSections.description.nodes.appEmbedData.image.duration` }, { path: `modifiedFields.infoSections.description.nodes.videoData.video.duration` }, { path: `modifiedFields.infoSections.description.nodes.videoData.thumbnail.duration` }, { path: `modifiedFields.infoSections.description.nodes.audioData.audio.duration` }, { path: `modifiedFields.infoSections.description.nodes.audioData.coverImage.duration` }, { path: `modifiedFields.infoSections.description.nodes.layoutData.backgroundImage.media.duration` }, { path: `modifiedFields.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `modifiedFields.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `modifiedFields.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `modifiedFields.infoSections.description.nodes.layoutData.backdropImage.media.duration` }, { path: `modifiedFields.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `modifiedFields.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `modifiedFields.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `modifiedFields.infoSections.description.nodes.layoutData.background.gradient.centerX` }, { path: `modifiedFields.infoSections.description.nodes.layoutData.background.gradient.centerY` }, { path: `modifiedFields.infoSections.description.nodes.layoutData.background.gradient.stops.position` }, { path: `modifiedFields.infoSections.description.nodes.layoutData.backdrop.gradient.centerX` }, { path: `modifiedFields.infoSections.description.nodes.layoutData.backdrop.gradient.centerY` }, { path: `modifiedFields.infoSections.description.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `modifiedFields.infoSections.description.nodes.shapeData.shape.duration` }, { path: `modifiedFields.infoSections.description.nodes.cardData.background.gradient.centerX` }, { path: `modifiedFields.infoSections.description.nodes.cardData.background.gradient.centerY` }, { path: `modifiedFields.infoSections.description.nodes.cardData.background.gradient.stops.position` }, { path: `modifiedFields.infoSections.description.nodes.cardData.backgroundImage.media.duration` }, { path: `modifiedFields.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `modifiedFields.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `modifiedFields.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `modifiedFields.infoSections.description.nodes.tocData.fontSize` }, { path: `modifiedFields.infoSections.description.nodes.tocData.itemSpacing` }, { path: `modifiedFields.infoSections.description.nodes.smartBlockCellData.shape.duration` }, { path: `modifiedFields.variantsInfo.variants.physicalProperties.weight` }, { path: `modifiedFields.variantSummary.minPriceVariant.physicalProperties.weight` }, { path: `modifiedFields.minVariantPriceInfo.weight` }] }, { transformFn: U, paths: [{ path: `entity.media.main.image` }, { path: `entity.media.itemsInfo.items.image` }, { path: `entity.options.choicesSettings.choices.image` }, { path: `entity.options.choicesSettings.choices.displayImage` }, { path: `entity.options.choicesSettings.choices.linkedMedia.image` }, { path: `entity.modifiers.choicesSettings.choices.image` }, { path: `entity.modifiers.choicesSettings.choices.displayImage` }, { path: `entity.modifiers.choicesSettings.choices.linkedMedia.image` }, { path: `entity.variantsInfo.variants.media.image` }, { path: `entity.variantSummary.minPriceVariant.media.image` }, { path: `modifiedFields.media.main.image` }, { path: `modifiedFields.media.itemsInfo.items.image` }, { path: `modifiedFields.options.choicesSettings.choices.image` }, { path: `modifiedFields.options.choicesSettings.choices.displayImage` }, { path: `modifiedFields.options.choicesSettings.choices.linkedMedia.image` }, { path: `modifiedFields.modifiers.choicesSettings.choices.image` }, { path: `modifiedFields.modifiers.choicesSettings.choices.displayImage` }, { path: `modifiedFields.modifiers.choicesSettings.choices.linkedMedia.image` }, { path: `modifiedFields.variantsInfo.variants.media.image` }, { path: `modifiedFields.variantSummary.minPriceVariant.media.image` }] }, { transformFn: Xi, paths: [{ path: `entity.media.main.video` }, { path: `entity.media.itemsInfo.items.video` }, { path: `entity.options.choicesSettings.choices.linkedMedia.video` }, { path: `entity.modifiers.choicesSettings.choices.linkedMedia.video` }, { path: `entity.variantsInfo.variants.media.video` }, { path: `entity.variantSummary.minPriceVariant.media.video` }, { path: `modifiedFields.media.main.video` }, { path: `modifiedFields.media.itemsInfo.items.video` }, { path: `modifiedFields.options.choicesSettings.choices.linkedMedia.video` }, { path: `modifiedFields.modifiers.choicesSettings.choices.linkedMedia.video` }, { path: `modifiedFields.variantsInfo.variants.media.video` }, { path: `modifiedFields.variantSummary.minPriceVariant.media.video` }] }])))();
2753
+ var za = D(Pa);
2754
+ var Ba = D(Fa);
2755
+ A(Ia), A(La), A(Ra);
2756
+ function Va(e2) {
2757
+ return k(Object.assign(e2, { domainToMappings: { "manage._base_domain_": [{ srcPath: `/_api/location`, destPath: `` }], _: [{ srcPath: `/_api/location`, destPath: `` }], "*.dev.wix-code.com": [{ srcPath: `/_api/location`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/stores/v3/locations`, destPath: `/v3/locations` }] } }));
2758
+ }
2759
+ var Ha = `@wix/auto_sdk_stores_stores-locations-v-3`;
2760
+ function Ua(e2) {
2761
+ function t2({ host: t3 }) {
2762
+ return { entityFqdn: `wix.stores.catalog.v3.stores_location`, method: `POST`, methodFqn: `wix.stores.catalog.location.v3.StoresLocationService.QueryStoresLocations`, packageName: Ha, migrationOptions: { optInTransformResponse: true }, url: Va({ protoPath: `/v3/locations/query`, data: e2, host: t3 }), data: e2, transformResponse: (e3) => T(e3, [{ transformFn: w, paths: [{ path: `storesLocations.createdDate` }, { path: `storesLocations.updatedDate` }] }]) };
2763
+ }
2764
+ return t2;
2765
+ }
2766
+ function Wa() {
2767
+ let { httpClient: e2, sideEffects: t2 } = arguments[0];
2768
+ return Ni({ func: async (n2) => {
2769
+ let r2 = Ua(n2);
2770
+ t2?.onSiteCall?.();
2771
+ try {
2772
+ let n3 = await e2.request(r2);
2773
+ return t2?.onSuccess?.(n3), n3;
2774
+ } catch (e3) {
2775
+ throw t2?.onError?.(e3), e3;
2776
+ }
2777
+ }, requestTransformer: (e3) => {
2778
+ let t3 = [e3, {}];
2779
+ return S({ ...t3?.[1], query: t3?.[0] });
2780
+ }, responseTransformer: ({ data: e3 }) => {
2781
+ let t3 = C(T(e3, []));
2782
+ return { items: t3?.storesLocations, pagingMetadata: t3?.pagingMetadata };
2783
+ }, errorTransformer: (e3) => {
2784
+ throw E(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { query: `$[0]` }, singleArgumentUnchanged: false });
2785
+ }, pagingMethod: `CURSOR`, transformationPaths: {} });
2786
+ }
2787
+ async function Ga(e2) {
2788
+ let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = Ua(S({ query: e2 }));
2789
+ n2?.onSiteCall?.();
2790
+ try {
2791
+ let e3 = await t2.request(r2);
2792
+ return n2?.onSuccess?.(e3), C(e3.data);
2793
+ } catch (e3) {
2794
+ let t3 = E(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { query: `$[0]` }, singleArgumentUnchanged: false }, [`query`]);
2795
+ throw n2?.onError?.(e3), t3;
2796
+ }
2797
+ }
2798
+ ({ ...H() });
2799
+ function Ka(e2) {
2800
+ return () => Wa({ httpClient: e2 });
2801
+ }
2802
+ function qa(e2) {
2803
+ return (t2) => Ga(t2, { httpClient: e2 });
2804
+ }
2805
+ function Ja(e2) {
2806
+ let t2 = qi({ builderQueryFunction: () => Ka(e2)(), typedQueryFunction: (t3) => qa(e2)(t3), hasOptionsParameter: false });
2807
+ function n2(e3) {
2808
+ return t2(...arguments);
2809
+ }
2810
+ return n2;
2811
+ }
2812
+ var Ya = D(Ja);
2813
+ function Xa(e2) {
2814
+ return k(Object.assign(e2, { domainToMappings: { "manage._base_domain_": [{ srcPath: `/_api/promotion`, destPath: `` }], "editor._base_domain_": [{ srcPath: `/_api/promotion`, destPath: `` }], "blocks._base_domain_": [{ srcPath: `/_api/promotion`, destPath: `` }], "create.editorx": [{ srcPath: `/_api/promotion`, destPath: `` }], _: [{ srcPath: `/_api/promotion`, destPath: `` }], "api._api_base_domain_": [{ srcPath: `/promotion`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/stores/v3/promotions`, destPath: `/v3/promotions` }, { srcPath: `/stores/v3/bulk/promotions`, destPath: `/v3/bulk/promotions` }], "*.dev.wix-code.com": [{ srcPath: `/_api/promotion`, destPath: `` }] } }));
2815
+ }
2816
+ var Za = `@wix/auto_sdk_stores_promotions-v-3`;
2817
+ function Qa(e2) {
2818
+ function t2({ host: t3 }) {
2819
+ return { entityFqdn: `wix.stores.catalog.v3.promotion`, method: `GET`, methodFqn: `wix.stores.catalog.promotion.v3.PromotionsService.ResolvePromotions`, packageName: Za, migrationOptions: { optInTransformResponse: true }, url: Xa({ protoPath: `/v3/promotions/resolve`, data: e2, host: t3 }), params: O(e2), transformResponse: (e3) => T(e3, [{ transformFn: w, paths: [{ path: `promotions.promotion.createdDate` }, { path: `promotions.promotion.updatedDate` }, { path: `promotions.promotion.media.image.urlExpirationDate` }] }]) };
2820
+ }
2821
+ return t2;
2822
+ }
2823
+ ({ ...H() }, { ...xa() });
2824
+ async function $a(e2) {
2825
+ let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = Qa(S({ categoryId: e2 }));
2826
+ n2?.onSiteCall?.();
2827
+ try {
2828
+ let e3 = await t2.request(r2);
2829
+ return n2?.onSuccess?.(e3), C(T(e3.data, [{ transformFn: U, paths: [{ path: `promotions.promotion.media.image` }] }]));
2830
+ } catch (e3) {
2831
+ let t3 = E(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { categoryId: `$[0]` }, singleArgumentUnchanged: false }, [`categoryId`]);
2832
+ throw n2?.onError?.(e3), t3;
2833
+ }
2834
+ }
2835
+ function eo(e2) {
2836
+ return (t2) => $a(t2, { httpClient: e2 });
2837
+ }
2838
+ var to = y(`wix.stores.catalog.v3.promotion_created`, true, (e2) => C(T(e2, [{ transformFn: w, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `metadata.eventTime` }] }, { transformFn: U, paths: [{ path: `entity.media.image` }] }])))();
2839
+ var no = y(`wix.stores.catalog.v3.promotion_deleted`, true, (e2) => C(T(e2, [{ transformFn: w, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `metadata.eventTime` }] }, { transformFn: U, paths: [{ path: `entity.media.image` }] }])))();
2840
+ var ro = y(`wix.stores.catalog.v3.promotion_tags_modified`, true, (e2) => C(T(e2, [{ transformFn: w, paths: [{ path: `data.promotion.createdDate` }, { path: `data.promotion.updatedDate` }, { path: `metadata.eventTime` }] }, { transformFn: U, paths: [{ path: `data.promotion.media.image` }] }])))();
2841
+ var io = y(`wix.stores.catalog.v3.promotion_updated`, true, (e2) => C(T(e2, [{ transformFn: w, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `metadata.eventTime` }, { path: `modifiedFields.createdDate` }, { path: `modifiedFields.updatedDate` }] }, { transformFn: U, paths: [{ path: `entity.media.image` }, { path: `modifiedFields.media.image` }] }])))();
2842
+ var ao = D(eo);
2843
+ A(to), A(no), A(ro), A(io);
2844
+ var J = function(e2) {
2845
+ return e2.PRICE = `PRICE`, e2.TEXT_CHOICES = `${W.TEXT_CHOICES}`, e2.SWATCH_CHOICES = `${W.SWATCH_CHOICES}`, e2;
2846
+ }({});
2847
+ var oo = function(e2) {
2848
+ return e2.TEXT_CHOICES = `Text Choices`, e2.SWATCH_CHOICES = `Swatch Choices`, e2.PRICE = `Price`, e2;
2849
+ }({});
2850
+ var so = `minPrice`;
2851
+ var co = `maxPrice`;
2852
+ var lo = (e2, t2) => {
2853
+ let n2 = new Map(e2.values.map((e3) => [e3.name, e3.id]));
2854
+ return t2.map((e3) => n2.get(e3)).filter((e3) => e3 !== void 0);
2855
+ };
2856
+ var uo = (e2) => {
2857
+ if (e2 === null || e2.trim() === ``) return;
2858
+ let t2 = Number(e2);
2859
+ return Number.isFinite(t2) ? t2 : void 0;
2860
+ };
2861
+ var fo = (e2, t2) => {
2862
+ let n2 = {};
2863
+ for (let r2 of t2) {
2864
+ let t3 = e2.get(r2.name), i2 = lo(r2, t3 ? t3.split(`,`).filter(Boolean) : []);
2865
+ i2.length > 0 && (n2[r2.id] = i2);
2866
+ }
2867
+ return n2;
2868
+ };
2869
+ function po(e2, t2) {
2870
+ let n2 = new URLSearchParams(e2);
2871
+ return { customizationIdToChoiceIds: fo(n2, t2.filter((e3) => e3.type === J.TEXT_CHOICES || e3.type === J.SWATCH_CHOICES)), priceMin: uo(n2.get(so)), priceMax: uo(n2.get(co)) };
2872
+ }
2873
+ var mo = (e2, t2) => {
2874
+ let n2 = new Map(e2.values.map((e3) => [e3.id, e3.name]));
2875
+ return t2.map((e3) => n2.get(e3)).filter((e3) => e3 !== void 0);
2876
+ };
2877
+ var ho = (e2, t2) => {
2878
+ t2.forEach((t3) => {
2879
+ e2.delete(t3.name);
2880
+ }), e2.delete(so), e2.delete(co);
2881
+ };
2882
+ var go = (e2) => e2.map(encodeURIComponent).join(`,`);
2883
+ var _o = (e2, t2) => {
2884
+ let n2 = new Map(e2.map((e3) => [e3.id, e3]));
2885
+ return Object.entries(t2 ?? {}).flatMap(([e3, t3]) => {
2886
+ let r2 = n2.get(e3);
2887
+ if (!r2) return [];
2888
+ let i2 = mo(r2, t3);
2889
+ return i2.length === 0 ? [] : [`${encodeURIComponent(r2.name)}=${go(i2)}`];
2890
+ });
2891
+ };
2892
+ var vo = (e2, t2, n2) => {
2893
+ t2.priceMin !== void 0 && t2.priceMin !== n2?.minPrice && e2.set(so, String(t2.priceMin)), t2.priceMax !== void 0 && t2.priceMax !== n2?.maxPrice && e2.set(co, String(t2.priceMax));
2894
+ };
2895
+ function yo(e2, t2, n2) {
2896
+ let r2 = new URLSearchParams(e2), i2 = n2.filter((e3) => e3.type === J.TEXT_CHOICES || e3.type === J.SWATCH_CHOICES), a2 = n2.find((e3) => e3.type === J.PRICE);
2897
+ ho(r2, i2), vo(r2, t2, a2);
2898
+ let o2 = _o(i2, t2.customizationIdToChoiceIds), s2 = [r2.toString(), ...o2].filter(Boolean).join(`&`);
2899
+ return s2 ? `?${s2}` : ``;
2900
+ }
2901
+ function bo(e2) {
2902
+ let { search: t2, pushSearch: n2 } = yi(), i2 = (0, import_react.useMemo)(() => po(t2, e2), [t2, e2]), a2 = (r2) => {
2903
+ r2 !== i2 && n2(yo(t2, r2, e2));
2904
+ };
2905
+ return { filterSelection: i2, selectFilterChoice: (e3, t3) => {
2906
+ a2(xi(i2, e3, t3));
2907
+ }, deselectFilterChoice: (e3, t3) => {
2908
+ a2(Si(i2, e3, t3));
2909
+ }, setPriceRange: (e3, t3) => {
2910
+ a2(Ci(i2, e3, t3));
2911
+ }, clearPriceRange: () => {
2912
+ a2(wi(i2));
2913
+ }, clearAllFilters: () => {
2914
+ bi(i2) || a2({});
2915
+ } };
2916
+ }
2917
+ var xo = function(e2) {
2918
+ return e2.createdDate = `createdDate`, e2.actualPriceRangeMinValueAmount = `actualPriceRange.minValue.amount`, e2.name = `name`, e2;
2919
+ }({});
2920
+ var Y = function(e2) {
2921
+ return e2.recommended = `recommended`, e2.newest = `newest`, e2.price_ascending = `price_ascending`, e2.price_descending = `price_descending`, e2.name_ascending = `name_ascending`, e2.name_descending = `name_descending`, e2;
2922
+ }({});
2923
+ var So = [{ type: Y.recommended }, { type: Y.newest, fieldName: xo.createdDate, order: K.DESC }, { type: Y.price_ascending, fieldName: xo.actualPriceRangeMinValueAmount, order: K.ASC }, { type: Y.price_descending, fieldName: xo.actualPriceRangeMinValueAmount, order: K.DESC }, { type: Y.name_ascending, fieldName: xo.name, order: K.ASC }, { type: Y.name_descending, fieldName: xo.name, order: K.DESC }];
2924
+ function Co(e2) {
2925
+ return So.find((t2) => t2.type === e2);
2926
+ }
2927
+ var wo = Y.recommended;
2928
+ var To = So.map(({ type: e2 }) => e2);
2929
+ var Eo = `sort`;
2930
+ function Do(e2) {
2931
+ let t2 = Co(new URLSearchParams(e2).get(Eo));
2932
+ return t2 ? t2.type : wo;
2933
+ }
2934
+ function Oo(e2, t2) {
2935
+ let n2 = new URLSearchParams(e2);
2936
+ return t2 === wo ? n2.delete(Eo) : n2.set(Eo, t2), n2.toString();
2937
+ }
2938
+ function ko() {
2939
+ let { search: e2, pushSearch: t2 } = yi(), n2 = (0, import_react.useMemo)(() => Do(e2), [e2]);
2940
+ return { sortTypes: To, selectedSortType: n2, selectSortType: (r2) => {
2941
+ r2 !== n2 && t2(Oo(e2, r2));
2942
+ } };
2943
+ }
2944
+ var Ao = `https://static.wixstatic.com/media`;
2945
+ var jo = `https://video.wixstatic.com/video`;
2946
+ var Mo = /image:\/\/v1\/([^/#]+)/;
2947
+ var No = /^(?:wix:)?video:\/\/v1\/([^/#]+)(?:\/[^#]*)?(?:#(.*))?$/;
2948
+ function Po(e2) {
2949
+ let t2 = e2?.match(No);
2950
+ if (!t2) return null;
2951
+ let [, n2, r2] = t2, i2 = new URLSearchParams(r2 ?? ``), a2 = i2.get(`posterUri`);
2952
+ return { id: n2, url: `${jo}/${n2}/file`, ...a2 ? { poster: { uri: a2, url: `${Ao}/${a2}`, width: Number(i2.get(`posterWidth`)) || 0, height: Number(i2.get(`posterHeight`)) || 0 } } : {} };
2953
+ }
2954
+ function Fo(e2) {
2955
+ return e2 ? e2.match(Mo)?.[1] ?? null : null;
2956
+ }
2957
+ function Io(e2) {
2958
+ if (!e2) return null;
2959
+ let t2 = e2.match(/#originWidth=(\d+)&originHeight=(\d+)/);
2960
+ return t2 ? { width: parseInt(t2[1], 10), height: parseInt(t2[2], 10) } : null;
2961
+ }
2962
+ function Lo(e2) {
2963
+ return e2.map((e3) => ({ id: e3._id, key: e3.key, name: e3.name ?? void 0, optionRenderType: e3.optionRenderType, choices: (e3.choicesSettings?.choices ?? []).map((e4) => {
2964
+ let t2 = Fo(e4.displayImage) ?? void 0;
2965
+ return { choiceId: e4.choiceId, key: e4.key, name: e4.name ?? void 0, colorCode: e4.colorCode, ...t2 ? { displayImageUri: t2 } : {}, inStock: e4.inStock, visible: e4.visible ?? void 0, mediaIds: Ro(e4.media) };
2966
+ }) }));
2967
+ }
2968
+ var Ro = (e2) => {
2969
+ let t2 = (e2?.items ?? []).map((e3) => e3.mediaId);
2970
+ return t2.length > 0 ? t2 : void 0;
2971
+ };
2972
+ function zo(e2) {
2973
+ let t2 = e2.map((e3) => {
2974
+ let t3 = e3._id, n2 = e3.modifierRenderType === Da.FREE_TEXT;
2975
+ return [t3, { id: t3, key: e3.key, name: e3.name ?? void 0, mandatory: e3.mandatory !== false, modifierRenderType: e3.modifierRenderType, freeTextSettings: n2 ? e3.freeTextSettings : void 0, choices: n2 ? void 0 : (e3.choicesSettings?.choices ?? []).map((e4) => {
2976
+ let t4 = Fo(e4.displayImage) ?? void 0;
2977
+ return { choiceId: e4.choiceId, key: e4.key, name: e4.name ?? void 0, colorCode: e4.colorCode, ...t4 ? { displayImageUri: t4 } : {}, mediaIds: Ro(e4.media) };
2978
+ }) }];
2979
+ });
2980
+ return Object.fromEntries(t2);
2981
+ }
2982
+ function Bo(e2) {
2983
+ return e2.filter((e3) => e3.visible !== false).map(Vo);
2984
+ }
2985
+ var Vo = (e2) => {
2986
+ let t2 = Object.fromEntries((e2.choices ?? []).map((e3) => {
2987
+ let t3 = e3.optionChoiceIds;
2988
+ return [t3?.optionId, t3?.choiceId];
2989
+ }));
2990
+ return { id: e2._id, sku: e2.sku ?? void 0, choices: t2, price: Uo(e2), subscriptionPrices: Wo(e2) };
2991
+ };
2992
+ function Ho(e2) {
2993
+ return e2?.description == null ? void 0 : { description: e2.description };
2994
+ }
2995
+ var Uo = (e2) => {
2996
+ let t2 = e2.price;
2997
+ return { actualPrice: cs(t2?.actualPrice), compareAtPrice: X(t2?.compareAtPrice), priceAfterDiscount: X(t2?.priceAfterDiscount), pricePerUnit: Ho(e2.physicalProperties?.pricePerUnit) };
2998
+ };
2999
+ var Wo = (e2) => (e2.subscriptionPricesInfo?.subscriptionPrices ?? []).map((e3) => ({ subscriptionId: e3.subscriptionId, price: cs(e3.price) }));
3000
+ var Go = { nodes: [] };
3001
+ var Ko = `@stores/product-groups`;
3002
+ function qo(e2) {
3003
+ let t2 = Lo(e2.options ?? []), n2 = zo(e2.modifiers ?? []), r2 = Zo(e2.subscriptionDetails?.subscriptions ?? []), i2 = Bo(e2.variantsInfo?.variants ?? []), a2 = { subscriptions: r2, allowOneTimePurchases: e2.subscriptionDetails?.allowOneTimePurchases ?? false }, o2 = e2.additionalRibbons ?? [], s2 = { primary: e2.ribbon?.name ?? void 0, additional: o2.map((e3) => e3.name ?? void 0).filter((e3) => !!e3) }, c2 = e2.description ? Qo(e2.description) : Go, l2 = e2.discountInfo?.discountRuleNames, u2 = Yo(e2);
3004
+ return { id: e2._id, slug: e2.slug ?? void 0, url: e2.url ? { href: e2.url } : void 0, name: e2.name, description: c2, media: ss(e2), mainMedia: os(e2.media?.main), ribbons: s2, breadcrumbs: $o(e2), mainCategoryId: e2.mainCategoryId ?? void 0, categories: es(e2), infoSections: Jo(e2), currency: e2.currency, options: t2, modifiers: n2, variants: i2, minPriceVariant: is(e2), priceRange: as(e2), subscriptionDetails: a2, inventory: { availabilityStatus: e2.inventory?.availabilityStatus, preorderAvailability: e2.inventory?.preorderAvailability }, discountRuleNames: l2, productGroupId: u2 };
3005
+ }
3006
+ function Jo(e2) {
3007
+ return (e2.infoSections ?? []).map((e3) => ({ _id: e3.uniqueName ?? e3._id, name: e3.title, body: e3.description ? Qo(e3.description) : void 0 }));
3008
+ }
3009
+ function Yo(e2) {
3010
+ let t2 = e2.extendedFields?.namespaces?.[Ko]?.productGroupId;
3011
+ return typeof t2 == `string` ? t2 : void 0;
3012
+ }
3013
+ function Xo(e2) {
3014
+ return e2 === `WEEK` || e2 === `MONTH` || e2 === `YEAR` ? e2 : void 0;
3015
+ }
3016
+ function Zo(e2) {
3017
+ return e2.filter((e3) => e3.visible !== false).map((e3) => ({ id: e3._id, name: e3.title, description: e3.description ?? void 0, frequency: Xo(e3.frequency), interval: e3.interval, billingCycles: e3.billingCycles ?? void 0 }));
3018
+ }
3019
+ function Qo(e2) {
3020
+ return { ...e2, nodes: e2.nodes ?? [] };
3021
+ }
3022
+ function $o(e2) {
3023
+ return (e2.breadcrumbsInfo?.breadcrumbs ?? []).map((e3) => ({ id: e3.categoryId, name: e3.categoryName, slug: e3.categorySlug }));
3024
+ }
3025
+ function es(e2) {
3026
+ return (e2.directCategoriesInfo?.categories ?? []).flatMap((e3) => e3._id ? [{ id: e3._id }] : []);
3027
+ }
3028
+ function ts(e2) {
3029
+ return { ...e2.displayName ? { title: e2.displayName } : {}, ...e2.altText ? { alt: e2.altText } : {} };
3030
+ }
3031
+ function ns(e2, t2) {
3032
+ let n2 = e2.image ?? e2.url;
3033
+ if (!n2) return;
3034
+ let r2 = Io(e2.image), { title: i2, alt: a2 } = ts(e2);
3035
+ return { id: Fo(e2.image) ?? e2._id ?? t2, media: { type: `image`, src: n2, ...r2 ? { width: r2.width, height: r2.height } : {}, ...i2 ? { title: i2 } : {}, ...a2 ? { parameters: { alt: a2 } } : {} } };
3036
+ }
3037
+ function rs(e2, t2) {
3038
+ let n2 = Po(e2.video), r2 = n2?.url ?? e2.url;
3039
+ if (!r2) return;
3040
+ let i2 = n2?.poster?.url, a2 = n2?.poster?.width, o2 = n2?.poster?.height, { title: s2, alt: c2 } = ts(e2);
3041
+ return { id: n2?.id ?? e2._id ?? t2, media: { type: `video`, src: r2, ...a2 === void 0 ? {} : { width: a2 }, ...o2 === void 0 ? {} : { height: o2 }, ...s2 ? { title: s2 } : {}, ...c2 || i2 ? { parameters: { ...c2 ? { alt: c2 } : {}, ...i2 ? { thumbnail: i2 } : {} } } : {} } };
3042
+ }
3043
+ function is(e2) {
3044
+ let t2 = e2.variantSummary?.minPriceVariant;
3045
+ return t2 ? Bo([t2])[0] : void 0;
3046
+ }
3047
+ function as(e2) {
3048
+ return { minActualPrice: X(e2.actualPriceRange?.minValue), maxActualPrice: X(e2.actualPriceRange?.maxValue), minCompareAtPrice: X(e2.compareAtPriceRange?.minValue), maxCompareAtPrice: X(e2.compareAtPriceRange?.maxValue) };
3049
+ }
3050
+ function os(e2) {
3051
+ if (!e2) return;
3052
+ let { title: t2, alt: n2 } = ts(e2);
3053
+ if (e2.mediaType === `VIDEO`) {
3054
+ let r3 = Po(e2.video)?.poster;
3055
+ return r3 ? { ...r3, name: t2, alt: n2 } : void 0;
3056
+ }
3057
+ let r2 = e2.image ?? e2.url;
3058
+ if (!r2) return;
3059
+ let i2 = Io(e2.image);
3060
+ return { uri: Fo(e2.image) ?? void 0, url: r2, width: i2?.width, height: i2?.height, name: t2, alt: n2 };
3061
+ }
3062
+ function ss(e2) {
3063
+ return (e2.media?.itemsInfo?.items ?? (e2.media?.main ? [e2.media.main] : [])).flatMap((e3, t2) => {
3064
+ let n2 = e3.mediaType === `VIDEO` ? rs(e3, String(t2)) : ns(e3, String(t2));
3065
+ return n2 ? [n2] : [];
3066
+ });
3067
+ }
3068
+ var cs = (e2) => Number.parseFloat(e2?.amount);
3069
+ var X = (e2) => e2?.amount == null ? void 0 : cs(e2);
3070
+ var Z = function(e2) {
3071
+ return e2.PRICE = `PRICE`, e2.OPTIONS = `OPTIONS`, e2.MODIFIERS = `MODIFIERS`, e2;
3072
+ }({});
3073
+ var ls = `allCategoriesInfo.categories`;
3074
+ var Q = { minPrice: `min_price`, maxPrice: `max_price`, optionsWithChoice: `options_with_choice`, modifiersWithChoice: `modifiers_with_choice`, options: `options`, modifiers: `modifiers` };
3075
+ var $ = { minPrice: `actualPriceRange.minValue.amount`, maxPrice: `actualPriceRange.maxValue.amount`, option: `options.id`, optionChoice: `options.choicesSettings.choices.choiceId`, modifier: `modifiers.id`, modifierChoice: `modifiers.choicesSettings.choices.choiceId` };
3076
+ var us = { options: 1e3, modifiers: 1e3, choices: 2e4 };
3077
+ var ds = ({ priceMin: e2, priceMax: t2 }) => {
3078
+ let n2 = [];
3079
+ return e2 !== void 0 && n2.push({ [$.minPrice]: { $gte: e2 } }), t2 !== void 0 && n2.push({ [$.maxPrice]: { $lte: t2 } }), n2;
3080
+ };
3081
+ var fs = (e2, t2) => {
3082
+ let n2 = new Map(e2.values.map((e3) => [e3.id, e3]));
3083
+ return t2.flatMap((e3) => {
3084
+ let t3 = n2.get(e3);
3085
+ return t3 ? [t3.id, ...t3.childIds ?? []] : [e3];
3086
+ });
3087
+ };
3088
+ var ps = (e2, t2) => ({ [e2.customizationType === ea.MODIFIER ? $.modifierChoice : $.optionChoice]: { $hasSome: fs(e2, t2) } });
3089
+ var ms = (e2, t2) => {
3090
+ let n2 = new Map(e2.filter((e3) => e3.type === J.TEXT_CHOICES || e3.type === J.SWATCH_CHOICES).map((e3) => [e3.id, e3]));
3091
+ return Object.entries(t2.customizationIdToChoiceIds ?? {}).flatMap(([e3, t3]) => {
3092
+ let r2 = n2.get(e3);
3093
+ return !r2 || t3.length === 0 ? [] : [ps(r2, t3)];
3094
+ });
3095
+ };
3096
+ function hs(e2, t2, n2) {
3097
+ let r2 = [{ [ls]: { $matchItems: [{ id: e2 }] } }, ...ds(n2), ...ms(t2, n2)];
3098
+ return r2.length === 1 ? r2[0] : { $and: r2 };
3099
+ }
3100
+ function gs(e2) {
3101
+ let t2 = Co(e2);
3102
+ if (t2?.fieldName) return [{ fieldName: t2.fieldName, order: t2.order }];
3103
+ }
3104
+ var _s = [q.URL, q.CURRENCY, q.MEDIA_ITEMS_INFO, q.MIN_PRICE_VARIANT, q.DISCOUNT_INFO, q.PRODUCT_CHOICES_MEDIA_REFERENCES, q.BREADCRUMBS_INFO];
3105
+ var vs = async (e2, t2) => {
3106
+ let n2 = await za({ cursorPaging: { limit: t2, cursor: e2 } }, { fields: _s });
3107
+ return { products: (n2.products ?? []).map(qo), nextCursor: n2.pagingMetadata?.cursors?.next ?? void 0, hasNext: n2.pagingMetadata?.hasNext ?? false };
3108
+ };
3109
+ async function ys({ categoryId: e2, filters: t2, filterSelection: n2, sortType: r2, productsPerPage: i2, cursor: a2 }) {
3110
+ if (a2 !== void 0) return vs(a2, i2);
3111
+ let o2 = hs(e2, t2, n2), s2 = gs(r2), c2 = { filter: o2, cursorPaging: { limit: i2 }, ...s2 && { sort: s2 } }, [l2, u2] = await Promise.all([za(c2, { fields: _s }), Ba({ filter: o2 })]);
3112
+ return { products: (l2.products ?? []).map(qo), productCount: u2?.count ?? 0, nextCursor: l2.pagingMetadata?.cursors?.next ?? void 0, hasNext: l2.pagingMetadata?.hasNext ?? false };
3113
+ }
3114
+ var bs = (e2, t2) => `${e2}:${[...t2].toSorted().join(`,`)}`;
3115
+ function xs(e2) {
3116
+ if (bi(e2)) return ``;
3117
+ let t2 = Object.entries(e2.customizationIdToChoiceIds ?? {}).filter(([, e3]) => e3.length > 0).map(([e3, t3]) => bs(e3, t3)).toSorted().join(`;`), n2 = [];
3118
+ return e2.priceMin !== void 0 && n2.push(`min:${e2.priceMin}`), e2.priceMax !== void 0 && n2.push(`max:${e2.priceMax}`), t2 && n2.push(t2), n2.join(`&`);
3119
+ }
3120
+ function Ss(e2, t2, i2, a2, o2, s2) {
3121
+ let c2 = xs(i2), l2 = c2 === s2.filterSelectionKey && a2 === s2.sortType && o2 === s2.productsPerPage ? { pages: [s2.page], pageParams: [void 0] } : void 0, { data: u2, isFetching: d2, isError: f2, hasNextPage: p2, fetchNextPage: m2 } = ei({ queryKey: [`category-products`, e2, c2, a2, o2], queryFn: ({ pageParam: n2 }) => ys({ categoryId: e2, filters: t2, filterSelection: i2, sortType: a2, productsPerPage: o2, cursor: n2 }), initialPageParam: void 0, getNextPageParam: (e3) => e3.hasNext ? e3.nextCursor : void 0, initialData: l2, staleTime: 1 / 0, placeholderData: $n, retry: false }), ee2 = (0, import_react.useCallback)(async () => {
3122
+ await m2({ cancelRefetch: false });
3123
+ }, [m2]);
3124
+ return { products: (0, import_react.useMemo)(() => (u2?.pages ?? []).flatMap((e3) => e3.products), [u2]), productCount: u2?.pages[0]?.productCount ?? 0, isLoadingProducts: d2, hasProductsError: f2, hasMoreProducts: p2, loadMoreProducts: ee2 };
3125
+ }
3126
+ function Cs(e2, t2) {
3127
+ let { category: n2, filters: i2, currency: a2, promotions: o2, initialProductList: s2, defaultLocationId: c2 } = e2, l2 = bo(i2), u2 = ko(), { products: d2, ...f2 } = Ss(n2.id, i2, l2.filterSelection, u2.selectedSortType, t2, s2);
3128
+ return { filters: i2, currency: a2, productItems: (0, import_react.useMemo)(() => d2.map((e3) => ({ product: e3, defaultLocationId: c2 })), [d2, c2]), promotionItems: (0, import_react.useMemo)(() => o2.map((e3) => ({ promotion: e3 })), [o2]), ...l2, ...u2, ...f2 };
3129
+ }
3130
+ var ws = ti(`@wix/site-service-warmup-data`);
3131
+ async function Ts(e2, t2, n2) {
3132
+ let r2 = typeof window > `u`;
3133
+ if (!r2 && e2) try {
3134
+ let n3 = await e2.get(t2);
3135
+ if (n3 !== null) return n3;
3136
+ } catch {
3137
+ }
3138
+ let i2 = await n2();
3139
+ if (r2 && e2) try {
3140
+ e2.set(t2, i2);
3141
+ } catch {
3142
+ }
3143
+ return i2;
3144
+ }
3145
+ function Es(e2, t2) {
3146
+ let n2 = (0, import_services_manager_react.useGetService)(), [r2] = (0, import_react.useState)(() => {
3147
+ let r3;
3148
+ try {
3149
+ r3 = n2(ws);
3150
+ } catch {
3151
+ r3 = null;
3152
+ }
3153
+ return Ts(r3, e2, t2);
3154
+ });
3155
+ return r2;
3156
+ }
3157
+ var Ds = (e2) => {
3158
+ let t2 = e2.pathname.split(`/`).filter(Boolean).at(-1);
3159
+ return t2 ? decodeURIComponent(t2) : void 0;
3160
+ };
3161
+ function Os() {
3162
+ let { url: e2 } = yi();
3163
+ return Ds(e2);
3164
+ }
3165
+ function ks(e2) {
3166
+ return k(Object.assign(e2, { domainToMappings: { "*.dev.wix-code.com": [{ srcPath: `/_api/categories`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/categories/v1/bulk/categories`, destPath: `/v1/bulk/categories` }, { srcPath: `/categories/v1/categories`, destPath: `/v1/categories` }], "manage._base_domain_": [{ srcPath: `/_api/categories`, destPath: `` }], "editor._base_domain_": [{ srcPath: `/_api/categories-service`, destPath: `` }], "blocks._base_domain_": [{ srcPath: `/_api/categories-service`, destPath: `` }], "create.editorx": [{ srcPath: `/_api/categories-service`, destPath: `` }], _: [{ srcPath: `/categories/v1/bulk/categories`, destPath: `/v1/bulk/categories` }, { srcPath: `/categories/v1/categories`, destPath: `/v1/categories` }] } }));
3167
+ }
3168
+ var As = `@wix/auto_sdk_categories_categories`;
3169
+ function js(e2) {
3170
+ function t2({ host: t3 }) {
3171
+ return { entityFqdn: `wix.categories.v1.category`, method: `GET`, methodFqn: `com.wix.categories.api.v1.CategoriesService.GetCategoryBySlug`, packageName: As, migrationOptions: { optInTransformResponse: true }, url: ks({ protoPath: `/v1/categories/slug/{slug}`, data: e2, host: t3 }), params: O(e2), transformResponse: (e3) => T(e3, [{ transformFn: w, paths: [{ path: `category.createdDate` }, { path: `category.updatedDate` }, { path: `category.image.urlExpirationDate` }, { path: `category.richContentDescription.metadata.createdTimestamp` }, { path: `category.richContentDescription.metadata.updatedTimestamp` }] }, { transformFn: j, paths: [{ path: `category.richContentDescription.nodes.buttonData.styles.background.gradient.centerX` }, { path: `category.richContentDescription.nodes.buttonData.styles.background.gradient.centerY` }, { path: `category.richContentDescription.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `category.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `category.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `category.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `category.richContentDescription.nodes.galleryData.items.image.media.duration` }, { path: `category.richContentDescription.nodes.galleryData.items.video.media.duration` }, { path: `category.richContentDescription.nodes.galleryData.items.video.thumbnail.duration` }, { path: `category.richContentDescription.nodes.galleryData.options.item.ratio` }, { path: `category.richContentDescription.nodes.imageData.image.duration` }, { path: `category.richContentDescription.nodes.imageData.crop.x` }, { path: `category.richContentDescription.nodes.imageData.crop.y` }, { path: `category.richContentDescription.nodes.imageData.crop.width` }, { path: `category.richContentDescription.nodes.imageData.crop.height` }, { path: `category.richContentDescription.nodes.mapData.mapSettings.lat` }, { path: `category.richContentDescription.nodes.mapData.mapSettings.lng` }, { path: `category.richContentDescription.nodes.pollData.poll.image.duration` }, { path: `category.richContentDescription.nodes.pollData.poll.options.image.duration` }, { path: `category.richContentDescription.nodes.pollData.design.poll.background.image.duration` }, { path: `category.richContentDescription.nodes.appEmbedData.image.duration` }, { path: `category.richContentDescription.nodes.videoData.video.duration` }, { path: `category.richContentDescription.nodes.videoData.thumbnail.duration` }, { path: `category.richContentDescription.nodes.audioData.audio.duration` }, { path: `category.richContentDescription.nodes.audioData.coverImage.duration` }, { path: `category.richContentDescription.nodes.layoutData.backgroundImage.media.duration` }, { path: `category.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `category.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `category.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `category.richContentDescription.nodes.layoutData.backdropImage.media.duration` }, { path: `category.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `category.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `category.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `category.richContentDescription.nodes.layoutData.background.gradient.centerX` }, { path: `category.richContentDescription.nodes.layoutData.background.gradient.centerY` }, { path: `category.richContentDescription.nodes.layoutData.background.gradient.stops.position` }, { path: `category.richContentDescription.nodes.layoutData.backdrop.gradient.centerX` }, { path: `category.richContentDescription.nodes.layoutData.backdrop.gradient.centerY` }, { path: `category.richContentDescription.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `category.richContentDescription.nodes.shapeData.shape.duration` }, { path: `category.richContentDescription.nodes.cardData.background.gradient.centerX` }, { path: `category.richContentDescription.nodes.cardData.background.gradient.centerY` }, { path: `category.richContentDescription.nodes.cardData.background.gradient.stops.position` }, { path: `category.richContentDescription.nodes.cardData.backgroundImage.media.duration` }, { path: `category.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `category.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `category.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `category.richContentDescription.nodes.tocData.fontSize` }, { path: `category.richContentDescription.nodes.tocData.itemSpacing` }, { path: `category.richContentDescription.nodes.smartBlockCellData.shape.duration` }] }]) };
3172
+ }
3173
+ return t2;
3174
+ }
3175
+ function Ms(e2) {
3176
+ function t2({ host: t3 }) {
3177
+ return { entityFqdn: `wix.categories.v1.category`, method: `POST`, methodFqn: `com.wix.categories.api.v1.CategoriesService.QueryCategories`, packageName: As, migrationOptions: { optInTransformResponse: true }, url: ks({ protoPath: `/v1/categories/query`, data: e2, host: t3 }), data: e2, transformResponse: (e3) => T(e3, [{ transformFn: w, paths: [{ path: `categories.createdDate` }, { path: `categories.updatedDate` }, { path: `categories.image.urlExpirationDate` }, { path: `categories.richContentDescription.metadata.createdTimestamp` }, { path: `categories.richContentDescription.metadata.updatedTimestamp` }] }, { transformFn: j, paths: [{ path: `categories.richContentDescription.nodes.buttonData.styles.background.gradient.centerX` }, { path: `categories.richContentDescription.nodes.buttonData.styles.background.gradient.centerY` }, { path: `categories.richContentDescription.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `categories.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `categories.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `categories.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `categories.richContentDescription.nodes.galleryData.items.image.media.duration` }, { path: `categories.richContentDescription.nodes.galleryData.items.video.media.duration` }, { path: `categories.richContentDescription.nodes.galleryData.items.video.thumbnail.duration` }, { path: `categories.richContentDescription.nodes.galleryData.options.item.ratio` }, { path: `categories.richContentDescription.nodes.imageData.image.duration` }, { path: `categories.richContentDescription.nodes.imageData.crop.x` }, { path: `categories.richContentDescription.nodes.imageData.crop.y` }, { path: `categories.richContentDescription.nodes.imageData.crop.width` }, { path: `categories.richContentDescription.nodes.imageData.crop.height` }, { path: `categories.richContentDescription.nodes.mapData.mapSettings.lat` }, { path: `categories.richContentDescription.nodes.mapData.mapSettings.lng` }, { path: `categories.richContentDescription.nodes.pollData.poll.image.duration` }, { path: `categories.richContentDescription.nodes.pollData.poll.options.image.duration` }, { path: `categories.richContentDescription.nodes.pollData.design.poll.background.image.duration` }, { path: `categories.richContentDescription.nodes.appEmbedData.image.duration` }, { path: `categories.richContentDescription.nodes.videoData.video.duration` }, { path: `categories.richContentDescription.nodes.videoData.thumbnail.duration` }, { path: `categories.richContentDescription.nodes.audioData.audio.duration` }, { path: `categories.richContentDescription.nodes.audioData.coverImage.duration` }, { path: `categories.richContentDescription.nodes.layoutData.backgroundImage.media.duration` }, { path: `categories.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `categories.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `categories.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `categories.richContentDescription.nodes.layoutData.backdropImage.media.duration` }, { path: `categories.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `categories.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `categories.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `categories.richContentDescription.nodes.layoutData.background.gradient.centerX` }, { path: `categories.richContentDescription.nodes.layoutData.background.gradient.centerY` }, { path: `categories.richContentDescription.nodes.layoutData.background.gradient.stops.position` }, { path: `categories.richContentDescription.nodes.layoutData.backdrop.gradient.centerX` }, { path: `categories.richContentDescription.nodes.layoutData.backdrop.gradient.centerY` }, { path: `categories.richContentDescription.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `categories.richContentDescription.nodes.shapeData.shape.duration` }, { path: `categories.richContentDescription.nodes.cardData.background.gradient.centerX` }, { path: `categories.richContentDescription.nodes.cardData.background.gradient.centerY` }, { path: `categories.richContentDescription.nodes.cardData.background.gradient.stops.position` }, { path: `categories.richContentDescription.nodes.cardData.backgroundImage.media.duration` }, { path: `categories.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `categories.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `categories.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `categories.richContentDescription.nodes.tocData.fontSize` }, { path: `categories.richContentDescription.nodes.tocData.itemSpacing` }, { path: `categories.richContentDescription.nodes.smartBlockCellData.shape.duration` }] }]) };
3178
+ }
3179
+ return t2;
3180
+ }
3181
+ var Ns = ((e2) => (e2.BREADCRUMBS_INFO = `BREADCRUMBS_INFO`, e2.DESCRIPTION = `DESCRIPTION`, e2.RICH_CONTENT_DESCRIPTION = `RICH_CONTENT_DESCRIPTION`, e2))(Ns || {});
3182
+ async function Ps(e2, t2, n2) {
3183
+ let { httpClient: r2, sideEffects: i2 } = arguments[3], a2 = js(S({ slug: e2, treeReference: t2, fields: n2?.fields }, []));
3184
+ i2?.onSiteCall?.();
3185
+ try {
3186
+ let e3 = await r2.request(a2);
3187
+ return i2?.onSuccess?.(e3), C(T(e3.data, [{ transformFn: U, paths: [{ path: `category.image` }] }]), [`category.richContentDescription`]);
3188
+ } catch (e3) {
3189
+ let t3 = E(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { slug: `$[0]`, treeReference: `$[1]`, fields: `$[2].fields` }, singleArgumentUnchanged: false }, [`slug`, `treeReference`, `options`]);
3190
+ throw i2?.onError?.(e3), t3;
3191
+ }
3192
+ }
3193
+ function Fs(e2) {
3194
+ let { httpClient: t2, sideEffects: n2 } = arguments[1];
3195
+ return Ni({ func: async (r2) => {
3196
+ let i2 = Ms({ ...r2, ...e2 });
3197
+ n2?.onSiteCall?.();
3198
+ try {
3199
+ let e3 = await t2.request(i2);
3200
+ return n2?.onSuccess?.(e3), e3;
3201
+ } catch (e3) {
3202
+ throw n2?.onError?.(e3), e3;
3203
+ }
3204
+ }, requestTransformer: (t3) => {
3205
+ let n3 = [t3, e2];
3206
+ return S({ ...n3?.[1], query: n3?.[0] }, []);
3207
+ }, responseTransformer: ({ data: e3 }) => {
3208
+ let t3 = C(T(e3, [{ transformFn: U, paths: [{ path: `categories.image` }] }]), [`categories.richContentDescription`]);
3209
+ return { items: t3?.categories, pagingMetadata: t3?.pagingMetadata };
3210
+ }, errorTransformer: (e3) => {
3211
+ throw E(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { query: `$[0]` }, singleArgumentUnchanged: false });
3212
+ }, pagingMethod: `CURSOR`, transformationPaths: {} });
3213
+ }
3214
+ async function Is(e2, t2) {
3215
+ let { httpClient: n2, sideEffects: r2 } = arguments[2], i2 = Ms(S({ query: e2, ...t2 }, []));
3216
+ r2?.onSiteCall?.();
3217
+ try {
3218
+ let e3 = await n2.request(i2);
3219
+ return r2?.onSuccess?.(e3), C(T(e3.data, [{ transformFn: U, paths: [{ path: `categories.image` }] }]), [`categories.richContentDescription`]);
3220
+ } catch (e3) {
3221
+ let t3 = E(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { query: `$[0]` }, singleArgumentUnchanged: false }, [`query`, `options`]);
3222
+ throw r2?.onError?.(e3), t3;
3223
+ }
3224
+ }
3225
+ ({ ...H() }, { ...xa() });
3226
+ function Ls(e2) {
3227
+ return (t2, n2, r2) => Ps(t2, n2, r2, { httpClient: e2 });
3228
+ }
3229
+ function Rs(e2) {
3230
+ return (t2) => Fs(t2, { httpClient: e2 });
3231
+ }
3232
+ function zs(e2) {
3233
+ return (t2, n2) => Is(t2, n2, { httpClient: e2 });
3234
+ }
3235
+ var Bs = y(`wix.categories.v1.category_category_moved`, true, (e2) => C(T(e2, [{ transformFn: w, paths: [{ path: `metadata.eventTime` }] }])))();
3236
+ var Vs = y(`wix.categories.v1.category_created`, true, (e2) => C(T(e2, [{ transformFn: w, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `entity.richContentDescription.metadata.createdTimestamp` }, { path: `entity.richContentDescription.metadata.updatedTimestamp` }, { path: `metadata.eventTime` }] }, { transformFn: U, paths: [{ path: `entity.image` }] }, { transformFn: j, paths: [{ path: `entity.richContentDescription.nodes.buttonData.styles.background.gradient.centerX` }, { path: `entity.richContentDescription.nodes.buttonData.styles.background.gradient.centerY` }, { path: `entity.richContentDescription.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `entity.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `entity.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.galleryData.items.image.media.duration` }, { path: `entity.richContentDescription.nodes.galleryData.items.video.media.duration` }, { path: `entity.richContentDescription.nodes.galleryData.items.video.thumbnail.duration` }, { path: `entity.richContentDescription.nodes.galleryData.options.item.ratio` }, { path: `entity.richContentDescription.nodes.imageData.image.duration` }, { path: `entity.richContentDescription.nodes.imageData.crop.x` }, { path: `entity.richContentDescription.nodes.imageData.crop.y` }, { path: `entity.richContentDescription.nodes.imageData.crop.width` }, { path: `entity.richContentDescription.nodes.imageData.crop.height` }, { path: `entity.richContentDescription.nodes.mapData.mapSettings.lat` }, { path: `entity.richContentDescription.nodes.mapData.mapSettings.lng` }, { path: `entity.richContentDescription.nodes.pollData.poll.image.duration` }, { path: `entity.richContentDescription.nodes.pollData.poll.options.image.duration` }, { path: `entity.richContentDescription.nodes.pollData.design.poll.background.image.duration` }, { path: `entity.richContentDescription.nodes.appEmbedData.image.duration` }, { path: `entity.richContentDescription.nodes.videoData.video.duration` }, { path: `entity.richContentDescription.nodes.videoData.thumbnail.duration` }, { path: `entity.richContentDescription.nodes.audioData.audio.duration` }, { path: `entity.richContentDescription.nodes.audioData.coverImage.duration` }, { path: `entity.richContentDescription.nodes.layoutData.backgroundImage.media.duration` }, { path: `entity.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.layoutData.backdropImage.media.duration` }, { path: `entity.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `entity.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `entity.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.layoutData.background.gradient.centerX` }, { path: `entity.richContentDescription.nodes.layoutData.background.gradient.centerY` }, { path: `entity.richContentDescription.nodes.layoutData.background.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.layoutData.backdrop.gradient.centerX` }, { path: `entity.richContentDescription.nodes.layoutData.backdrop.gradient.centerY` }, { path: `entity.richContentDescription.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.shapeData.shape.duration` }, { path: `entity.richContentDescription.nodes.cardData.background.gradient.centerX` }, { path: `entity.richContentDescription.nodes.cardData.background.gradient.centerY` }, { path: `entity.richContentDescription.nodes.cardData.background.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.cardData.backgroundImage.media.duration` }, { path: `entity.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.tocData.fontSize` }, { path: `entity.richContentDescription.nodes.tocData.itemSpacing` }, { path: `entity.richContentDescription.nodes.smartBlockCellData.shape.duration` }] }])))();
3237
+ var Hs = y(`wix.categories.v1.category_deleted`, true, (e2) => C(T(e2, [{ transformFn: w, paths: [{ path: `undefined.createdDate` }, { path: `undefined.updatedDate` }, { path: `undefined.richContentDescription.metadata.createdTimestamp` }, { path: `undefined.richContentDescription.metadata.updatedTimestamp` }, { path: `metadata.eventTime` }] }, { transformFn: U, paths: [{ path: `undefined.image` }] }, { transformFn: j, paths: [{ path: `undefined.richContentDescription.nodes.buttonData.styles.background.gradient.centerX` }, { path: `undefined.richContentDescription.nodes.buttonData.styles.background.gradient.centerY` }, { path: `undefined.richContentDescription.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `undefined.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `undefined.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `undefined.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `undefined.richContentDescription.nodes.galleryData.items.image.media.duration` }, { path: `undefined.richContentDescription.nodes.galleryData.items.video.media.duration` }, { path: `undefined.richContentDescription.nodes.galleryData.items.video.thumbnail.duration` }, { path: `undefined.richContentDescription.nodes.galleryData.options.item.ratio` }, { path: `undefined.richContentDescription.nodes.imageData.image.duration` }, { path: `undefined.richContentDescription.nodes.imageData.crop.x` }, { path: `undefined.richContentDescription.nodes.imageData.crop.y` }, { path: `undefined.richContentDescription.nodes.imageData.crop.width` }, { path: `undefined.richContentDescription.nodes.imageData.crop.height` }, { path: `undefined.richContentDescription.nodes.mapData.mapSettings.lat` }, { path: `undefined.richContentDescription.nodes.mapData.mapSettings.lng` }, { path: `undefined.richContentDescription.nodes.pollData.poll.image.duration` }, { path: `undefined.richContentDescription.nodes.pollData.poll.options.image.duration` }, { path: `undefined.richContentDescription.nodes.pollData.design.poll.background.image.duration` }, { path: `undefined.richContentDescription.nodes.appEmbedData.image.duration` }, { path: `undefined.richContentDescription.nodes.videoData.video.duration` }, { path: `undefined.richContentDescription.nodes.videoData.thumbnail.duration` }, { path: `undefined.richContentDescription.nodes.audioData.audio.duration` }, { path: `undefined.richContentDescription.nodes.audioData.coverImage.duration` }, { path: `undefined.richContentDescription.nodes.layoutData.backgroundImage.media.duration` }, { path: `undefined.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `undefined.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `undefined.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `undefined.richContentDescription.nodes.layoutData.backdropImage.media.duration` }, { path: `undefined.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `undefined.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `undefined.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `undefined.richContentDescription.nodes.layoutData.background.gradient.centerX` }, { path: `undefined.richContentDescription.nodes.layoutData.background.gradient.centerY` }, { path: `undefined.richContentDescription.nodes.layoutData.background.gradient.stops.position` }, { path: `undefined.richContentDescription.nodes.layoutData.backdrop.gradient.centerX` }, { path: `undefined.richContentDescription.nodes.layoutData.backdrop.gradient.centerY` }, { path: `undefined.richContentDescription.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `undefined.richContentDescription.nodes.shapeData.shape.duration` }, { path: `undefined.richContentDescription.nodes.cardData.background.gradient.centerX` }, { path: `undefined.richContentDescription.nodes.cardData.background.gradient.centerY` }, { path: `undefined.richContentDescription.nodes.cardData.background.gradient.stops.position` }, { path: `undefined.richContentDescription.nodes.cardData.backgroundImage.media.duration` }, { path: `undefined.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `undefined.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `undefined.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `undefined.richContentDescription.nodes.tocData.fontSize` }, { path: `undefined.richContentDescription.nodes.tocData.itemSpacing` }, { path: `undefined.richContentDescription.nodes.smartBlockCellData.shape.duration` }] }])))();
3238
+ var Us = y(`wix.categories.v1.category_item_added_to_category`, true, (e2) => C(T(e2, [{ transformFn: w, paths: [{ path: `metadata.eventTime` }] }])))();
3239
+ var Ws = y(`wix.categories.v1.category_item_removed_from_category`, true, (e2) => C(T(e2, [{ transformFn: w, paths: [{ path: `metadata.eventTime` }] }])))();
3240
+ var Gs = y(`wix.categories.v1.category_items_arranged_in_category`, true, (e2) => C(T(e2, [{ transformFn: w, paths: [{ path: `metadata.eventTime` }] }])))();
3241
+ var Ks = y(`wix.categories.v1.category_updated`, true, (e2) => C(T(e2, [{ transformFn: w, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `entity.richContentDescription.metadata.createdTimestamp` }, { path: `entity.richContentDescription.metadata.updatedTimestamp` }, { path: `metadata.eventTime` }, { path: `modifiedFields.createdDate` }, { path: `modifiedFields.updatedDate` }, { path: `modifiedFields.richContentDescription.metadata.createdTimestamp` }, { path: `modifiedFields.richContentDescription.metadata.updatedTimestamp` }] }, { transformFn: U, paths: [{ path: `entity.image` }, { path: `modifiedFields.image` }] }, { transformFn: j, paths: [{ path: `entity.richContentDescription.nodes.buttonData.styles.background.gradient.centerX` }, { path: `entity.richContentDescription.nodes.buttonData.styles.background.gradient.centerY` }, { path: `entity.richContentDescription.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `entity.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `entity.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.galleryData.items.image.media.duration` }, { path: `entity.richContentDescription.nodes.galleryData.items.video.media.duration` }, { path: `entity.richContentDescription.nodes.galleryData.items.video.thumbnail.duration` }, { path: `entity.richContentDescription.nodes.galleryData.options.item.ratio` }, { path: `entity.richContentDescription.nodes.imageData.image.duration` }, { path: `entity.richContentDescription.nodes.imageData.crop.x` }, { path: `entity.richContentDescription.nodes.imageData.crop.y` }, { path: `entity.richContentDescription.nodes.imageData.crop.width` }, { path: `entity.richContentDescription.nodes.imageData.crop.height` }, { path: `entity.richContentDescription.nodes.mapData.mapSettings.lat` }, { path: `entity.richContentDescription.nodes.mapData.mapSettings.lng` }, { path: `entity.richContentDescription.nodes.pollData.poll.image.duration` }, { path: `entity.richContentDescription.nodes.pollData.poll.options.image.duration` }, { path: `entity.richContentDescription.nodes.pollData.design.poll.background.image.duration` }, { path: `entity.richContentDescription.nodes.appEmbedData.image.duration` }, { path: `entity.richContentDescription.nodes.videoData.video.duration` }, { path: `entity.richContentDescription.nodes.videoData.thumbnail.duration` }, { path: `entity.richContentDescription.nodes.audioData.audio.duration` }, { path: `entity.richContentDescription.nodes.audioData.coverImage.duration` }, { path: `entity.richContentDescription.nodes.layoutData.backgroundImage.media.duration` }, { path: `entity.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.layoutData.backdropImage.media.duration` }, { path: `entity.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `entity.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `entity.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.layoutData.background.gradient.centerX` }, { path: `entity.richContentDescription.nodes.layoutData.background.gradient.centerY` }, { path: `entity.richContentDescription.nodes.layoutData.background.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.layoutData.backdrop.gradient.centerX` }, { path: `entity.richContentDescription.nodes.layoutData.backdrop.gradient.centerY` }, { path: `entity.richContentDescription.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.shapeData.shape.duration` }, { path: `entity.richContentDescription.nodes.cardData.background.gradient.centerX` }, { path: `entity.richContentDescription.nodes.cardData.background.gradient.centerY` }, { path: `entity.richContentDescription.nodes.cardData.background.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.cardData.backgroundImage.media.duration` }, { path: `entity.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.tocData.fontSize` }, { path: `entity.richContentDescription.nodes.tocData.itemSpacing` }, { path: `entity.richContentDescription.nodes.smartBlockCellData.shape.duration` }, { path: `modifiedFields.richContentDescription.nodes.buttonData.styles.background.gradient.centerX` }, { path: `modifiedFields.richContentDescription.nodes.buttonData.styles.background.gradient.centerY` }, { path: `modifiedFields.richContentDescription.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `modifiedFields.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `modifiedFields.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `modifiedFields.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `modifiedFields.richContentDescription.nodes.galleryData.items.image.media.duration` }, { path: `modifiedFields.richContentDescription.nodes.galleryData.items.video.media.duration` }, { path: `modifiedFields.richContentDescription.nodes.galleryData.items.video.thumbnail.duration` }, { path: `modifiedFields.richContentDescription.nodes.galleryData.options.item.ratio` }, { path: `modifiedFields.richContentDescription.nodes.imageData.image.duration` }, { path: `modifiedFields.richContentDescription.nodes.imageData.crop.x` }, { path: `modifiedFields.richContentDescription.nodes.imageData.crop.y` }, { path: `modifiedFields.richContentDescription.nodes.imageData.crop.width` }, { path: `modifiedFields.richContentDescription.nodes.imageData.crop.height` }, { path: `modifiedFields.richContentDescription.nodes.mapData.mapSettings.lat` }, { path: `modifiedFields.richContentDescription.nodes.mapData.mapSettings.lng` }, { path: `modifiedFields.richContentDescription.nodes.pollData.poll.image.duration` }, { path: `modifiedFields.richContentDescription.nodes.pollData.poll.options.image.duration` }, { path: `modifiedFields.richContentDescription.nodes.pollData.design.poll.background.image.duration` }, { path: `modifiedFields.richContentDescription.nodes.appEmbedData.image.duration` }, { path: `modifiedFields.richContentDescription.nodes.videoData.video.duration` }, { path: `modifiedFields.richContentDescription.nodes.videoData.thumbnail.duration` }, { path: `modifiedFields.richContentDescription.nodes.audioData.audio.duration` }, { path: `modifiedFields.richContentDescription.nodes.audioData.coverImage.duration` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backgroundImage.media.duration` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backdropImage.media.duration` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.background.gradient.centerX` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.background.gradient.centerY` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.background.gradient.stops.position` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backdrop.gradient.centerX` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backdrop.gradient.centerY` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `modifiedFields.richContentDescription.nodes.shapeData.shape.duration` }, { path: `modifiedFields.richContentDescription.nodes.cardData.background.gradient.centerX` }, { path: `modifiedFields.richContentDescription.nodes.cardData.background.gradient.centerY` }, { path: `modifiedFields.richContentDescription.nodes.cardData.background.gradient.stops.position` }, { path: `modifiedFields.richContentDescription.nodes.cardData.backgroundImage.media.duration` }, { path: `modifiedFields.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `modifiedFields.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `modifiedFields.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `modifiedFields.richContentDescription.nodes.tocData.fontSize` }, { path: `modifiedFields.richContentDescription.nodes.tocData.itemSpacing` }, { path: `modifiedFields.richContentDescription.nodes.smartBlockCellData.shape.duration` }] }])))();
3242
+ function qs(e2) {
3243
+ let t2 = qi({ builderQueryFunction: (t3) => Rs(e2)(t3), typedQueryFunction: (t3, n3) => zs(e2)(t3, n3), hasOptionsParameter: true });
3244
+ function n2(e3, n3) {
3245
+ return t2(...arguments);
3246
+ }
3247
+ return n2;
3248
+ }
3249
+ var Js = D(Ls);
3250
+ var Ys = D(qs);
3251
+ A(Bs), A(Vs), A(Hs), A(Us), A(Ws), A(Gs), A(Ks);
3252
+ function Xs(e2) {
3253
+ if (!e2) return null;
3254
+ let t2 = e2.match(/image:\/\/v1\/([^/#]+)/);
3255
+ return t2?.[1] ? t2[1] : e2.match(/\/media\/([^/]+)/)?.[1] ?? null;
3256
+ }
3257
+ function Zs(e2) {
3258
+ return `https://static.wixstatic.com/media/${e2}`;
3259
+ }
3260
+ function Qs(e2) {
3261
+ if (!e2) return null;
3262
+ let t2 = e2.match(/#originWidth=(\d+)&originHeight=(\d+)/);
3263
+ return t2 ? { width: parseInt(t2[1], 10), height: parseInt(t2[2], 10) } : null;
3264
+ }
3265
+ var $s = (e2) => `/category/${e2}`;
3266
+ var ec = (e2) => ({ ...e2, nodes: e2.nodes ?? [] });
3267
+ var tc = (e2) => {
3268
+ if (!e2) return;
3269
+ let t2 = Qs(e2);
3270
+ return { uri: Xs(e2) ?? void 0, url: e2, width: t2?.width, height: t2?.height };
3271
+ };
3272
+ var nc = (e2) => e2.filter((e3) => e3.categoryId).map((e3) => {
3273
+ let t2 = e3.categorySlug ?? ``;
3274
+ return { id: e3.categoryId ?? ``, name: e3.categoryName ?? ``, slug: t2, href: $s(t2) };
3275
+ });
3276
+ var rc = (e2) => ({ type: e2.type, props: e2.props ?? void 0, meta: e2.meta ?? void 0, children: e2.children, custom: e2.custom, disabled: e2.disabled });
3277
+ var ic = (e2) => {
3278
+ if (e2) return { preventAutoRedirect: e2.preventAutoRedirect, keywords: e2.keywords?.map((e3) => ({ term: e3.term, isMain: e3.isMain, origin: e3.origin ?? void 0 })) };
3279
+ };
3280
+ var ac = (e2) => {
3281
+ if (e2) return { tags: e2.tags?.map(rc), settings: ic(e2.settings) };
3282
+ };
3283
+ function oc(e2) {
3284
+ return { id: e2._id ?? ``, name: e2.name ?? ``, slug: e2.slug ?? ``, description: e2.description ?? void 0, itemCounter: e2.itemCounter, parentCategoryId: e2.parentCategory?._id ?? void 0, seoData: ac(e2.seoData), richContentDescription: e2.richContentDescription ? ec(e2.richContentDescription) : void 0, image: tc(e2.image), breadcrumbs: nc(e2.breadcrumbsInfo?.breadcrumbs ?? []) };
3285
+ }
3286
+ var sc = { appNamespace: `@wix/stores`, treeKey: null };
3287
+ var cc = [Ns.BREADCRUMBS_INFO, Ns.DESCRIPTION, Ns.RICH_CONTENT_DESCRIPTION];
3288
+ var lc = `No category slug is available for the category context`;
3289
+ var uc = (e2, t2) => {
3290
+ if (!e2?._id || e2.visible === false) throw Error(t2);
3291
+ return oc(e2);
3292
+ };
3293
+ async function dc(e2) {
3294
+ if (!e2) throw Error(lc);
3295
+ let { category: t2 } = await Js(e2, sc, { fields: cc });
3296
+ return uc(t2, `Category not found for slug: ${e2}`);
3297
+ }
3298
+ async function fc() {
3299
+ return (await Ya().eq(`defaultLocation`, true).find()).items?.[0]?._id ?? void 0;
3300
+ }
3301
+ var pc = (e2, t2, n2) => {
3302
+ let r2 = [];
3303
+ for (let i2 of e2.keys()) if (!t2.has(i2)) {
3304
+ let e3 = n2.find((e4) => e4._id === i2);
3305
+ e3 && r2.push(Cc(e3, 0));
3306
+ }
3307
+ return r2;
3308
+ };
3309
+ var mc = (e2) => {
3310
+ let t2 = /* @__PURE__ */ new Map();
3311
+ for (let { _id: n2, primaryChoiceIds: r2 } of e2) if (n2) for (let e3 of r2 ?? []) {
3312
+ let r3 = t2.get(e3) ?? [];
3313
+ t2.set(e3, [...r3, n2]);
3314
+ }
3315
+ return t2;
3316
+ };
3317
+ var hc = (e2, t2, n2) => {
3318
+ let r2 = pc(t2, new Set(e2.map((e3) => e3.id)), n2), i2 = [...e2, ...r2], a2 = new Map(i2.map((e3) => [e3.id, e3])), o2 = new Set([...t2.values()].flat());
3319
+ return i2.flatMap((e3) => {
3320
+ if (o2.has(e3.id)) return [];
3321
+ let n3 = t2.get(e3.id);
3322
+ if (!n3) return [e3];
3323
+ let r3 = n3.filter((e4) => a2.has(e4));
3324
+ if (r3.length === 0 && e3.count === 0) return [];
3325
+ let i3 = r3.reduce((e4, t3) => e4 + (a2.get(t3)?.count ?? 0), 0);
3326
+ return [{ ...e3, count: e3.count + i3, linkedChoiceIds: r3 }];
3327
+ });
3328
+ };
3329
+ function gc(e2, t2) {
3330
+ return hc(e2, mc(t2), t2);
3331
+ }
3332
+ var _c = (e2) => {
3333
+ let t2 = e2.trim();
3334
+ if (t2 === ``) return null;
3335
+ let n2 = Number(t2);
3336
+ return Number.isFinite(n2) ? n2 : null;
3337
+ };
3338
+ var vc = (e2, t2) => {
3339
+ let n2 = t2.choicesSettings?.choices ?? [], r2 = new Map(n2.map((e3, t3) => [e3._id ?? ``, t3])), i2 = (e3) => r2.get(e3.id) ?? 2 ** 53 - 1;
3340
+ return e2.toSorted((e3, t3) => i2(e3) - i2(t3));
3341
+ };
3342
+ var yc = (e2, t2, n2) => t2 === W.TEXT_CHOICES ? xc(e2, (e3) => e3.name) : n2 ? bc(e2, (e3) => e3.count) : [...e2];
3343
+ var bc = (e2, t2) => e2.toSorted((e3, n2) => t2(n2) - t2(e3));
3344
+ var xc = (e2, t2) => e2.toSorted((e3, n2) => {
3345
+ let r2 = _c(t2(e3)), i2 = _c(t2(n2));
3346
+ return r2 !== null && i2 !== null ? r2 - i2 : r2 === null ? i2 === null ? t2(e3).toLowerCase().localeCompare(t2(n2).toLowerCase()) : 1 : -1;
3347
+ });
3348
+ function Sc(e2, t2, n2) {
3349
+ switch (t2.choicesSettings?.sortOrder) {
3350
+ case G.BY_NAME:
3351
+ return xc(e2, (e3) => e3.name);
3352
+ case G.BY_PRODUCT_COUNT:
3353
+ return bc(e2, (e3) => e3.count);
3354
+ case G.MANUAL:
3355
+ return vc(e2, t2);
3356
+ case G.DEFAULT:
3357
+ default:
3358
+ return yc(e2, t2.customizationRenderType, n2);
3359
+ }
3360
+ }
3361
+ var Cc = (e2, t2) => ({ id: e2._id ?? ``, name: e2.name ?? ``, type: e2.choiceType, values: e2.colorCode === void 0 ? [] : [e2.colorCode], count: t2, linkedChoiceIds: [], displayImage: e2.displayImage });
3362
+ function wc(e2, t2) {
3363
+ let n2 = e2.choicesSettings?.choices ?? [], r2 = new Map(n2.map((e3) => [e3._id, e3])), i2 = [...t2].flatMap(([e3, t3]) => {
3364
+ let n3 = r2.get(e3);
3365
+ return n3 ? [Cc(n3, t3)] : [];
3366
+ }), a2 = n2.some((e3) => (e3.primaryChoiceIds?.length ?? 0) > 0);
3367
+ return Sc(a2 ? gc(i2, n2) : i2, e2, a2);
3368
+ }
3369
+ var Tc = (e2) => {
3370
+ let t2 = Xs(e2);
3371
+ if (!t2) return;
3372
+ let n2 = Qs(e2);
3373
+ return { id: t2, url: Zs(t2), ...n2 ? { width: n2.width, height: n2.height } : {} };
3374
+ };
3375
+ var Ec = (e2) => {
3376
+ let t2 = e2.displayImage === void 0 ? void 0 : Tc(e2.displayImage);
3377
+ return { ...Oc(e2), ...e2.values[0] === void 0 ? {} : { colorHexCode: e2.values[0] }, ...t2 ? { displayImage: t2 } : {} };
3378
+ };
3379
+ var Dc = (e2) => ({ type: J.SWATCH_CHOICES, id: e2.id, customizationType: e2.type, name: e2.name, values: e2.choices.map(Ec) });
3380
+ var Oc = (e2) => ({ id: e2.id, name: e2.name, ...e2.linkedChoiceIds.length > 0 ? { childIds: e2.linkedChoiceIds } : {} });
3381
+ var kc = (e2) => ({ type: J.TEXT_CHOICES, id: e2.id, customizationType: e2.type, name: e2.name, values: e2.choices.map(Oc) });
3382
+ var Ac = (e2, t2, n2, r2) => {
3383
+ let i2 = new Map(t2.map((e3) => [e3._id, e3]));
3384
+ return n2.flatMap((t3) => {
3385
+ let n3 = i2.get(t3);
3386
+ return n3 ? [{ id: t3, name: n3.name ?? ``, renderType: n3.customizationRenderType, type: e2, choices: wc(n3, r2) }] : [];
3387
+ });
3388
+ };
3389
+ var jc = (e2) => xc(e2.filter((e3) => e3.renderType === W.SWATCH_CHOICES).map(Dc), (e3) => e3.name);
3390
+ var Mc = (e2) => xc(e2.filter((e3) => e3.renderType === W.TEXT_CHOICES).map(kc), (e3) => e3.name);
3391
+ function Nc(e2, t2, n2, r2) {
3392
+ if (n2.length === 0) return [];
3393
+ let i2 = Ac(e2, t2, n2, r2);
3394
+ return [...jc(i2), ...Mc(i2)];
3395
+ }
3396
+ function Pc(e2, t2) {
3397
+ if (!(e2 === void 0 || t2 === void 0 || e2 >= t2)) return { type: J.PRICE, name: oo.PRICE, minPrice: e2, maxPrice: t2 };
3398
+ }
3399
+ var Fc = g((e2, t2) => {
3400
+ function n2(e3, t3, n3) {
3401
+ var r2 = -1, i2 = e3.length;
3402
+ t3 < 0 && (t3 = -t3 > i2 ? 0 : i2 + t3), n3 = n3 > i2 ? i2 : n3, n3 < 0 && (n3 += i2), i2 = t3 > n3 ? 0 : n3 - t3 >>> 0, t3 >>>= 0;
3403
+ for (var a2 = Array(i2); ++r2 < i2; ) a2[r2] = e3[r2 + t3];
3404
+ return a2;
3405
+ }
3406
+ t2.exports = n2;
3407
+ });
3408
+ var Ic = g((e2, t2) => {
3409
+ function n2(e3, t3) {
3410
+ return e3 === t3 || e3 !== e3 && t3 !== t3;
3411
+ }
3412
+ t2.exports = n2;
3413
+ });
3414
+ var Lc = g((e2, t2) => {
3415
+ t2.exports = typeof window == `object` && window && window.Object === Object && window;
3416
+ });
3417
+ var Rc = g((e2, t2) => {
3418
+ var n2 = Lc(), r2 = typeof self == `object` && self && self.Object === Object && self;
3419
+ t2.exports = n2 || r2 || Function(`return this`)();
3420
+ });
3421
+ var zc = g((e2, t2) => {
3422
+ t2.exports = Rc().Symbol;
3423
+ });
3424
+ var Bc = g((e2, t2) => {
3425
+ var n2 = zc(), r2 = Object.prototype, i2 = r2.hasOwnProperty, a2 = r2.toString, o2 = n2 ? n2.toStringTag : void 0;
3426
+ function s2(e3) {
3427
+ var t3 = i2.call(e3, o2), n3 = e3[o2];
3428
+ try {
3429
+ e3[o2] = void 0;
3430
+ var r3 = true;
3431
+ } catch {
3432
+ }
3433
+ var s3 = a2.call(e3);
3434
+ return r3 && (t3 ? e3[o2] = n3 : delete e3[o2]), s3;
3435
+ }
3436
+ t2.exports = s2;
3437
+ });
3438
+ var Vc = g((e2, t2) => {
3439
+ var n2 = Object.prototype.toString;
3440
+ function r2(e3) {
3441
+ return n2.call(e3);
3442
+ }
3443
+ t2.exports = r2;
3444
+ });
3445
+ var Hc = g((e2, t2) => {
3446
+ var n2 = zc(), r2 = Bc(), i2 = Vc(), a2 = `[object Null]`, o2 = `[object Undefined]`, s2 = n2 ? n2.toStringTag : void 0;
3447
+ function c2(e3) {
3448
+ return e3 == null ? e3 === void 0 ? o2 : a2 : s2 && s2 in Object(e3) ? r2(e3) : i2(e3);
3449
+ }
3450
+ t2.exports = c2;
3451
+ });
3452
+ var Uc = g((e2, t2) => {
3453
+ function n2(e3) {
3454
+ var t3 = typeof e3;
3455
+ return e3 != null && (t3 == `object` || t3 == `function`);
3456
+ }
3457
+ t2.exports = n2;
3458
+ });
3459
+ var Wc = g((e2, t2) => {
3460
+ var n2 = Hc(), r2 = Uc(), i2 = `[object AsyncFunction]`, a2 = `[object Function]`, o2 = `[object GeneratorFunction]`, s2 = `[object Proxy]`;
3461
+ function c2(e3) {
3462
+ if (!r2(e3)) return false;
3463
+ var t3 = n2(e3);
3464
+ return t3 == a2 || t3 == o2 || t3 == i2 || t3 == s2;
3465
+ }
3466
+ t2.exports = c2;
3467
+ });
3468
+ var Gc = g((e2, t2) => {
3469
+ function n2(e3) {
3470
+ return typeof e3 == `number` && e3 > -1 && e3 % 1 == 0 && e3 <= 9007199254740991;
3471
+ }
3472
+ t2.exports = n2;
3473
+ });
3474
+ var Kc = g((e2, t2) => {
3475
+ var n2 = Wc(), r2 = Gc();
3476
+ function i2(e3) {
3477
+ return e3 != null && r2(e3.length) && !n2(e3);
3478
+ }
3479
+ t2.exports = i2;
3480
+ });
3481
+ var qc = g((e2, t2) => {
3482
+ var n2 = /^(?:0|[1-9]\d*)$/;
3483
+ function r2(e3, t3) {
3484
+ var r3 = typeof e3;
3485
+ return t3 ??= 9007199254740991, !!t3 && (r3 == `number` || r3 != `symbol` && n2.test(e3)) && e3 > -1 && e3 % 1 == 0 && e3 < t3;
3486
+ }
3487
+ t2.exports = r2;
3488
+ });
3489
+ var Jc = g((e2, t2) => {
3490
+ var n2 = Ic(), r2 = Kc(), i2 = qc(), a2 = Uc();
3491
+ function o2(e3, t3, o3) {
3492
+ if (!a2(o3)) return false;
3493
+ var s2 = typeof t3;
3494
+ return (s2 == `number` ? r2(o3) && i2(t3, o3.length) : s2 == `string` && t3 in o3) ? n2(o3[t3], e3) : false;
3495
+ }
3496
+ t2.exports = o2;
3497
+ });
3498
+ var Yc = g((e2, t2) => {
3499
+ var n2 = /\s/;
3500
+ function r2(e3) {
3501
+ for (var t3 = e3.length; t3-- && n2.test(e3.charAt(t3)); ) ;
3502
+ return t3;
3503
+ }
3504
+ t2.exports = r2;
3505
+ });
3506
+ var Xc = g((e2, t2) => {
3507
+ var n2 = Yc(), r2 = /^\s+/;
3508
+ function i2(e3) {
3509
+ return e3 && e3.slice(0, n2(e3) + 1).replace(r2, ``);
3510
+ }
3511
+ t2.exports = i2;
3512
+ });
3513
+ var Zc = g((e2, t2) => {
3514
+ function n2(e3) {
3515
+ return typeof e3 == `object` && !!e3;
3516
+ }
3517
+ t2.exports = n2;
3518
+ });
3519
+ var Qc = g((e2, t2) => {
3520
+ var n2 = Hc(), r2 = Zc(), i2 = `[object Symbol]`;
3521
+ function a2(e3) {
3522
+ return typeof e3 == `symbol` || r2(e3) && n2(e3) == i2;
3523
+ }
3524
+ t2.exports = a2;
3525
+ });
3526
+ var $c = g((e2, t2) => {
3527
+ var n2 = Xc(), r2 = Uc(), i2 = Qc(), a2 = NaN, o2 = /^[-+]0x[0-9a-f]+$/i, s2 = /^0b[01]+$/i, c2 = /^0o[0-7]+$/i, l2 = parseInt;
3528
+ function u2(e3) {
3529
+ if (typeof e3 == `number`) return e3;
3530
+ if (i2(e3)) return a2;
3531
+ if (r2(e3)) {
3532
+ var t3 = typeof e3.valueOf == `function` ? e3.valueOf() : e3;
3533
+ e3 = r2(t3) ? t3 + `` : t3;
3534
+ }
3535
+ if (typeof e3 != `string`) return e3 === 0 ? e3 : +e3;
3536
+ e3 = n2(e3);
3537
+ var u3 = s2.test(e3);
3538
+ return u3 || c2.test(e3) ? l2(e3.slice(2), u3 ? 2 : 8) : o2.test(e3) ? a2 : +e3;
3539
+ }
3540
+ t2.exports = u2;
3541
+ });
3542
+ var el = g((e2, t2) => {
3543
+ var n2 = $c(), r2 = 1 / 0, i2 = 17976931348623157e292;
3544
+ function a2(e3) {
3545
+ return e3 ? (e3 = n2(e3), e3 === r2 || e3 === -r2 ? (e3 < 0 ? -1 : 1) * i2 : e3 === e3 ? e3 : 0) : e3 === 0 ? e3 : 0;
3546
+ }
3547
+ t2.exports = a2;
3548
+ });
3549
+ var tl = g((e2, t2) => {
3550
+ var n2 = el();
3551
+ function r2(e3) {
3552
+ var t3 = n2(e3), r3 = t3 % 1;
3553
+ return t3 === t3 ? r3 ? t3 - r3 : t3 : 0;
3554
+ }
3555
+ t2.exports = r2;
3556
+ });
3557
+ var nl = _(g((e2, t2) => {
3558
+ var n2 = Fc(), r2 = Jc(), i2 = tl(), a2 = Math.ceil, o2 = Math.max;
3559
+ function s2(e3, t3, s3) {
3560
+ t3 = (s3 ? r2(e3, t3, s3) : t3 === void 0) ? 1 : o2(i2(t3), 0);
3561
+ var c2 = e3 == null ? 0 : e3.length;
3562
+ if (!c2 || t3 < 1) return [];
3563
+ for (var l2 = 0, u2 = 0, d2 = Array(a2(c2 / t3)); l2 < c2; ) d2[u2++] = n2(e3, l2, l2 += t3);
3564
+ return d2;
3565
+ }
3566
+ t2.exports = s2;
3567
+ })(), 1);
3568
+ var rl = [ta.CHOICE_DISPLAY_IMAGE];
3569
+ var il = `customizationRenderType`;
3570
+ async function al(e2) {
3571
+ let t2 = (0, nl.default)(e2, 100);
3572
+ return (await Promise.all(t2.map(ol))).flat();
3573
+ }
3574
+ var ol = async (e2) => (await ua({ fields: rl }).hasSome(`_id`, e2).ne(il, W.FREE_TEXT).limit(100).find()).items;
3575
+ var sl = (e2, t2, n2) => ({ name: e2, type: ja.SCALAR, fieldPath: t2, scalar: { type: n2 } });
3576
+ var cl = (e2, t2, n2) => ({ name: e2, type: ja.VALUE, fieldPath: t2, value: { limit: n2, sortType: Oa.COUNT, sortDirection: ka.DESC } });
3577
+ function ll(e2) {
3578
+ let t2 = [];
3579
+ return e2.includes(Z.PRICE) && t2.push(sl(Q.minPrice, $.minPrice, Aa.MIN), sl(Q.maxPrice, $.maxPrice, Aa.MAX)), e2.includes(Z.OPTIONS) && t2.push(cl(Q.options, $.option, us.options), cl(Q.optionsWithChoice, $.optionChoice, us.choices)), e2.includes(Z.MODIFIERS) && t2.push(cl(Q.modifiers, $.modifier, us.modifiers), cl(Q.modifiersWithChoice, $.modifierChoice, us.choices)), t2;
3580
+ }
3581
+ var ul = (e2) => {
3582
+ let t2 = e2?.values?.results ?? [], n2 = /* @__PURE__ */ new Map();
3583
+ for (let e3 of t2) e3.value !== void 0 && e3.count !== void 0 && n2.set(e3.value, e3.count);
3584
+ return n2;
3585
+ };
3586
+ var dl = (e2) => (e2?.values?.results ?? []).flatMap((e3) => e3.value === void 0 ? [] : [e3.value]);
3587
+ var fl = (e2) => {
3588
+ let t2 = /* @__PURE__ */ new Map();
3589
+ for (let n2 of e2) n2.name !== void 0 && t2.set(n2.name, n2);
3590
+ return t2;
3591
+ };
3592
+ async function pl(e2, t2) {
3593
+ let n2 = await za({ filter: { [ls]: { $matchItems: [{ id: e2 }] } }, cursorPaging: { limit: 1 }, aggregations: ll(t2) }, { fields: [q.CURRENCY] }), r2 = fl(n2.aggregationData?.results ?? []);
3594
+ return { minPrice: r2.get(Q.minPrice)?.scalar?.value, maxPrice: r2.get(Q.maxPrice)?.scalar?.value, optionIds: dl(r2.get(Q.options)), optionChoiceIdToCount: ul(r2.get(Q.optionsWithChoice)), modifierIds: dl(r2.get(Q.modifiers)), modifierChoiceIdToCount: ul(r2.get(Q.modifiersWithChoice)), currency: n2.products?.[0]?.currency ?? void 0 };
3595
+ }
3596
+ var ml = [Z.PRICE, Z.OPTIONS, Z.MODIFIERS];
3597
+ async function hl(e2, t2 = ml) {
3598
+ let n2 = await pl(e2, t2), r2 = await al([...n2.optionIds, ...n2.modifierIds]);
3599
+ return { filters: [Pc(n2.minPrice, n2.maxPrice), ...Nc(ea.PRODUCT_OPTION, r2, n2.optionIds, n2.optionChoiceIdToCount), ...Nc(ea.MODIFIER, r2, n2.modifierIds, n2.modifierChoiceIdToCount)].filter((e3) => e3 !== void 0), currency: n2.currency };
3600
+ }
3601
+ var gl = (e2) => {
3602
+ let t2 = Xs(e2 ?? void 0);
3603
+ if (!t2) return;
3604
+ let n2 = Qs(e2);
3605
+ return { id: t2, url: Zs(t2), ...n2 ? { width: n2.width, height: n2.height } : {} };
3606
+ };
3607
+ var _l = ({ promotion: e2, position: t2 }) => {
3608
+ if (e2?._id && t2 !== void 0) return { id: e2._id, name: e2.name, destinationUrl: e2.destinationUrl ? { href: e2.destinationUrl } : void 0, image: gl(e2.media?.image), altText: e2.media?.altText ?? void 0, position: t2 };
3609
+ };
3610
+ async function vl(e2) {
3611
+ return ((await ao(e2)).promotions ?? []).map(_l).filter((e3) => e3 !== void 0);
3612
+ }
3613
+ var yl = async (e2, t2, n2, r2) => {
3614
+ let i2 = [...new URLSearchParams(n2).keys()].length > 0 ? (await t2).filters : [], a2 = po(n2, i2), o2 = Do(n2);
3615
+ return { page: await ys({ categoryId: e2, filters: i2, filterSelection: a2, sortType: o2, productsPerPage: r2 }), filterSelectionKey: xs(a2), sortType: o2, productsPerPage: r2 };
3616
+ };
3617
+ async function bl(e2, t2, n2) {
3618
+ let r2 = hl(e2), [i2, a2, o2] = await Promise.all([yl(e2, r2, t2, n2), r2, vl(e2)]), { filters: s2, currency: c2 } = a2;
3619
+ return { filters: s2, currency: c2, promotions: o2, initialProductList: i2 };
3620
+ }
3621
+ var xl = async (e2, t2, n2) => {
3622
+ let [r2, i2] = await Promise.all([dc(e2), fc()]);
3623
+ return { category: r2, defaultLocationId: i2, ...await bl(r2.id, t2, n2) };
3624
+ };
3625
+ var Sl = (e2, t2, n2) => `wixstores-storefront-builder:category-by-slug-context-data:${e2}:${n2}:${t2}`;
3626
+ function Cl(e2) {
3627
+ let { search: t2 } = yi(), n2 = Os();
3628
+ return Es(Sl(n2, t2, e2), () => xl(n2, t2, e2));
3629
+ }
3630
+ function wl(e2) {
3631
+ return { id: e2._id, name: e2.name, slug: e2.slug, href: e2.slug ? `/category/${e2.slug}` : ``, parentCategoryId: e2.parentCategory?._id, sortIndex: e2.parentCategory?.index, childCategoryIds: [] };
3632
+ }
3633
+ function Tl(e2) {
3634
+ let t2 = {};
3635
+ for (let n2 of e2) {
3636
+ if (n2.visible === false || !n2._id) continue;
3637
+ let e3 = wl(n2);
3638
+ t2[e3.id ?? ``] = e3;
3639
+ }
3640
+ for (let e3 of Object.values(t2)) e3?.parentCategoryId && t2[e3.parentCategoryId]?.childCategoryIds.push(e3.id ?? ``);
3641
+ return t2;
3642
+ }
3643
+ var El = { appNamespace: `@wix/stores`, treeKey: null };
3644
+ var Dl = 1e3;
3645
+ async function Ol() {
3646
+ return Tl((await Ys({ treeReference: El }).eq(`visible`, true).limit(Dl).find()).items);
3647
+ }
3648
+ var kl = `wixstores-storefront-builder:category-list-context-data`;
3649
+ function Al() {
3650
+ return Es(kl, () => Ol());
3651
+ }
3652
+ function jl() {
3653
+ throw Error(`useCategoryBySlugContext must not be used directly`);
3654
+ }
3655
+ function Ml({ categoryValue: e2, categoryListValue: t2, productListValue: n2, children: r2 }) {
3656
+ return (0, import_jsx_runtime.jsx)(import_category_list_context_provider.default, { value: t2, children: (0, import_jsx_runtime.jsx)(import_category_info_context_provider.default, { value: e2, children: (0, import_jsx_runtime.jsx)(import_product_list_context_provider.default, { value: n2, children: r2 }) }) });
3657
+ }
3658
+ var Nl = ({ children: e2, dataPromise: t2, categoryListPromise: n2, productsPerPage: r2 }) => {
3659
+ let i2 = hi(t2), a2 = hi(n2), o2 = si(i2), c2 = ci(a2, i2.category.id), l2 = Cs(i2, r2);
3660
+ return mi(i2.category), (0, import_jsx_runtime.jsx)(Ml, { categoryValue: o2, categoryListValue: c2, productListValue: l2, children: e2 });
3661
+ };
3662
+ function Pl({ children: e2, productsPerPage: n2 = 20 }) {
3663
+ let [r2] = (0, import_react.useState)(() => new Lr()), i2 = Cl(n2), o2 = Al();
3664
+ return (0, import_jsx_runtime.jsx)(Br, { client: r2, children: (0, import_jsx_runtime.jsx)(import_react.Suspense, { fallback: null, children: (0, import_jsx_runtime.jsx)(Nl, { dataPromise: i2, categoryListPromise: o2, productsPerPage: n2, children: e2 }) }) });
3665
+ }
3666
+ var Fl = Nn(`404b3ed8-9b27-4342-9451-17ae43ebdebb`);
3667
+ // Annotate the CommonJS export names for ESM import in node:
3668
+ 0 && (module.exports = {
3669
+ CategoryBySlugContextProvider,
3670
+ CategoryBySlugContextValues,
3671
+ injectAccessTokenGetter,
3672
+ useCategoryBySlugContext
3673
+ });
3674
+ //# sourceMappingURL=context-category-by-slug-context-provider.js.map