@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,4396 @@
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-product-item-context-provider.ts
31
+ var context_product_item_context_provider_exports = {};
32
+ __export(context_product_item_context_provider_exports, {
33
+ ProductItemContextProvider: () => vu,
34
+ default: () => vu,
35
+ injectAccessTokenGetter: () => yu,
36
+ useProductItemContext: () => hu,
37
+ useProductItemContextValue: () => gu
38
+ });
39
+ module.exports = __toCommonJS(context_product_item_context_provider_exports);
40
+
41
+ // _sdk-exports/context-product-item-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_context_provider = __toESM(require("@wix/stores/product-context-provider"));
46
+ var import_services_manager_react = require("@wix/services-manager-react");
47
+ var u = Object.create;
48
+ var d = Object.defineProperty;
49
+ var f = Object.getOwnPropertyDescriptor;
50
+ var p = Object.getOwnPropertyNames;
51
+ var m = Object.getPrototypeOf;
52
+ var h = Object.prototype.hasOwnProperty;
53
+ var g = (e2, t2) => () => (t2 || (e2((t2 = { exports: {} }).exports, t2), e2 = null), t2.exports);
54
+ var _ = (e2, t2, n2, r2) => {
55
+ if (t2 && typeof t2 == `object` || typeof t2 == `function`) for (var i2 = p(t2), a2 = 0, o2 = i2.length, s2; a2 < o2; a2++) s2 = i2[a2], !h.call(e2, s2) && s2 !== n2 && d(e2, s2, { get: ((e3) => t2[e3]).bind(null, s2), enumerable: !(r2 = f(t2, s2)) || r2.enumerable });
56
+ return e2;
57
+ };
58
+ var v = (e2, t2, n2) => (n2 = e2 == null ? {} : u(m(e2)), _(t2 || !e2 || !e2.__esModule || !h.call(e2, `default`) ? d(n2, `default`, { value: e2, enumerable: true }) : n2, e2));
59
+ var y = {};
60
+ function b(e2, t2 = false, n2 = (e3) => e3) {
61
+ return () => ({ __type: `event-definition`, type: e2, isDomainEvent: t2, transformations: n2 });
62
+ }
63
+ var x = (e2) => {
64
+ switch (e2) {
65
+ case `get`:
66
+ case `GET`:
67
+ return `GET`;
68
+ case `post`:
69
+ case `POST`:
70
+ return `POST`;
71
+ case `put`:
72
+ case `PUT`:
73
+ return `PUT`;
74
+ case `delete`:
75
+ case `DELETE`:
76
+ return `DELETE`;
77
+ case `patch`:
78
+ case `PATCH`:
79
+ return `PATCH`;
80
+ case `head`:
81
+ case `HEAD`:
82
+ return `HEAD`;
83
+ case `options`:
84
+ case `OPTIONS`:
85
+ return `OPTIONS`;
86
+ default:
87
+ throw Error(`Unknown method: ${e2}`);
88
+ }
89
+ };
90
+ var S = (e2) => (t2) => async (n2) => {
91
+ let r2, i2 = (t3) => {
92
+ 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.`);
93
+ let { method: i3, url: a2, params: o2 } = r2;
94
+ return { ...r2, method: x(i3), url: a2, data: r2.data, params: o2 };
95
+ };
96
+ try {
97
+ let e3 = await t2.request(i2);
98
+ if (r2 === void 0) throw Error(`Request options were not created for this request, please reach out to support channels for assistance.`);
99
+ let n3 = Array.isArray(r2.transformResponse) ? r2.transformResponse : [r2.transformResponse], a2 = e3.data;
100
+ return n3.forEach((t3) => {
101
+ t3 && (a2 = t3(e3.data, e3.headers));
102
+ }), a2;
103
+ } catch (e3) {
104
+ throw typeof e3 == `object` && e3 && `response` in e3 && typeof e3.response == `object` && e3.response !== null && `data` in e3.response ? e3.response.data : e3;
105
+ }
106
+ };
107
+ var C = (e2) => e2.__isAmbassador ? true : !!e2().__isAmbassador;
108
+ var w = `__metadata`;
109
+ var T = `edge.wixapis.com`;
110
+ var E = class extends Error {
111
+ message;
112
+ response;
113
+ constructor(e2, t2) {
114
+ super(e2), this.message = e2, this.response = t2;
115
+ }
116
+ async details() {
117
+ let e2 = await this.response.json();
118
+ return D(this.response.status, e2?.message, e2?.details, { requestId: this.response.headers.get(`X-Wix-Request-Id`), details: e2 });
119
+ }
120
+ };
121
+ var D = (e2, t2, n2, r2) => ({ details: { ...!n2?.validationError && { applicationError: { description: t2, code: e2, data: r2 } }, ...n2 }, message: t2, requestId: r2?.requestId });
122
+ var O = (e2) => e2?.method && [`post`, `put`, `patch`].includes(e2.method.toLocaleLowerCase()) && e2.body ? { "Content-Type": `application/json` } : {};
123
+ var k = (e2) => e2 && typeof e2 == `object` && !Array.isArray(e2);
124
+ var ee = (e2) => e2.__type === `host`;
125
+ function te(e2, t2) {
126
+ return e2.create(t2);
127
+ }
128
+ var ne = `x-wix-bi-gateway`;
129
+ function re(e2, t2, n2) {
130
+ return { [ne]: ie({ environment: `js-sdk${n2 ? `-${n2}` : ``}`, "package-name": e2.packageName ?? t2?.PACKAGE_NAME, "method-fqn": e2.methodFqn, entity: e2.entityFqdn }) };
131
+ }
132
+ function ie(e2) {
133
+ return Object.entries(e2).filter(([e3, t2]) => !!t2).map(([e3, t2]) => `${e3}=${t2}`).join(`,`);
134
+ }
135
+ function ae(e2) {
136
+ let t2 = globalThis.__wix_context__, n2 = { client: y.client, elevatedClient: y.elevatedClient }, r2;
137
+ globalThis.__wix_context__ = void 0, y.client = void 0, y.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
138
+ try {
139
+ return e2();
140
+ } finally {
141
+ globalThis.__wix_context__ = t2, y.client = n2.client, y.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
142
+ }
143
+ }
144
+ var oe = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
145
+ function se(e2) {
146
+ return fe(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
147
+ }
148
+ var ce = /([\p{Ll}\d])(\p{Lu})/gu;
149
+ var le = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
150
+ var ue = `$1\0$2`;
151
+ var de = /[^\p{L}\d]+/giu;
152
+ function fe(e2) {
153
+ let t2 = e2.trim();
154
+ t2 = t2.replace(ce, ue).replace(le, ue), t2 = t2.replace(de, `\0`);
155
+ let n2 = 0, r2 = t2.length;
156
+ for (; t2.charAt(n2) === `\0`; ) n2++;
157
+ if (n2 === r2) return [];
158
+ for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
159
+ return t2.slice(n2, r2).split(/\0/g);
160
+ }
161
+ var pe = (e2) => `validationError` in (e2.response?.data?.details ?? {});
162
+ var me = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
163
+ var he = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
164
+ function ge(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
165
+ if (typeof e2 != `object` || !e2) throw e2;
166
+ if (pe(e2)) return _e(e2, t2, n2);
167
+ if (me(e2)) return ye(e2);
168
+ if (he(e2)) {
169
+ let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: se(n3), data: {} }, requestId: e2.requestId };
170
+ return ve(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
171
+ }
172
+ return be(e2);
173
+ }
174
+ var _e = (e2, t2, n2) => {
175
+ let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = xe(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 };
176
+ return ve(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e2.response?.status, requestId: i2 } });
177
+ };
178
+ var ve = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
179
+ var ye = (e2) => {
180
+ 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 ?? se(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 };
181
+ return ve(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e2.requestId } });
182
+ };
183
+ var be = (e2) => ve(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: se(e2.response?.statusText ?? `UNKNOWN`), ...!e2.response && { runtimeError: e2 } } });
184
+ var xe = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
185
+ let a2 = { ...e2, ...t2 }, o2 = Object.keys(a2);
186
+ return r2?.filter((e3) => !r2.some((t3) => t3.field.length > e3.field.length && t3.field.startsWith(e3.field) && o2.includes(t3.field))).map((e3) => {
187
+ let r3 = t2[e3.field];
188
+ if (r3) return { ...e3, field: Se(r3, i2) };
189
+ let s2 = o2?.sort((e4, t3) => t3.length - e4.length)?.find((t3) => e3.field.startsWith(t3));
190
+ if (s2) {
191
+ let t3 = a2[s2];
192
+ if (t3) return { ...e3, field: e3.field.replace(s2, Se(t3, i2)) };
193
+ }
194
+ return n2 ? { ...e3, field: `${i2[0]}.${e3.field}` } : e3;
195
+ });
196
+ };
197
+ var Se = (e2, t2) => {
198
+ let n2 = Ce(e2);
199
+ return n2 == null ? e2 : e2.replace(`$[${n2}]`, t2[n2]);
200
+ };
201
+ var Ce = (e2) => {
202
+ let t2 = e2.match(/\$\[(?<argIndex>\d+)\]/);
203
+ return t2 && t2.groups && Number(t2.groups.argIndex);
204
+ };
205
+ function we(e2, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
206
+ return ae(() => e2({ request: async (e3) => {
207
+ let i3 = e3({ host: s2?.HTTPHost || `www.wixapis.com` }), a3 = i3;
208
+ a3.method === `GET` && a3.fallback?.length && (a3.params?.toString().length ?? 0) > 4e3 && (a3 = i3.fallback[0]);
209
+ let o3 = s2?.HTTPHost ?? `www.wixapis.com`, u3 = `https://${l2 ? T : o3}${a3.url}`;
210
+ a3.params && a3.params.toString() && (u3 += `?${a3.params.toString()}`);
211
+ try {
212
+ let e4 = re(i3, t2, c2), o4 = { method: a3.method, ...a3.data && { body: JSON.stringify(a3.data) }, headers: { ...e4 } }, s3 = await n2(u3, o4);
213
+ if (s3.status !== 200) {
214
+ let e5 = null;
215
+ try {
216
+ e5 = await s3.json();
217
+ } catch {
218
+ }
219
+ let t3 = Ee(s3.status, e5?.message ?? s3.statusText, e5?.details, { requestId: s3.headers.get(`X-Wix-Request-Id`), details: e5 }), n3 = ge(t3);
220
+ throw r2?.handleError(n3, { requestOptions: { url: a3.url, method: a3.method, entityFqdn: i3.entityFqdn, methodFqn: i3.methodFqn } }), t3;
221
+ }
222
+ let l3 = await s3.json();
223
+ 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 };
224
+ } catch (e4) {
225
+ throw e4.message?.includes(`fetch is not defined`) && console.error(`Node.js v18+ is required`), e4;
226
+ }
227
+ }, fetchWithAuth: n2, wixAPIFetch: i2, getActiveToken: a2, getAuthHeaders: o2 }, { validateRequestSchema: u2 }));
228
+ }
229
+ var Te = class extends Error {
230
+ response;
231
+ requestId;
232
+ constructor(e2) {
233
+ super(), this.response = e2.response, this.requestId = e2.requestId;
234
+ }
235
+ };
236
+ var Ee = (e2, t2, n2, r2) => new Te({ response: { data: { details: { ...!n2?.validationError && { applicationError: { description: t2, code: e2, data: r2 } }, ...n2 }, message: t2 }, status: e2 }, requestId: r2?.requestId });
237
+ var De = `.`;
238
+ function Oe(e2, t2, n2) {
239
+ if (e2 == null) throw Error(`Cannot set value on null or undefined`);
240
+ let r2 = ke(t2), i2 = e2;
241
+ for (let e3 = 0; e3 < r2.length; e3++) {
242
+ let t3 = r2[e3];
243
+ if (e3 === r2.length - 1) {
244
+ i2[t3] = n2;
245
+ break;
246
+ }
247
+ let a2 = r2[e3 + 1];
248
+ (!(t3 in i2) || i2[t3] == null || typeof i2[t3] != `object` || i2[t3] === null) && (i2[t3] = typeof a2 == `number` ? [] : {}), i2 = i2[t3];
249
+ }
250
+ return e2;
251
+ }
252
+ function ke(e2) {
253
+ return Array.isArray(e2) ? e2 : e2.split(De).map((e3) => Ae(e3) ? Number(e3) : e3);
254
+ }
255
+ function Ae(e2) {
256
+ return /^\d+$/.test(e2);
257
+ }
258
+ function je(e2) {
259
+ let t2 = {};
260
+ for (let [n2, r2] of Object.entries(e2)) Me(n2) || Oe(t2, ke(n2), r2);
261
+ return t2;
262
+ }
263
+ function Me(e2) {
264
+ return e2 === `__proto__` || e2 === `constructor` || e2 === `prototype`;
265
+ }
266
+ var Ne = class {
267
+ BRACKET_PATTERN = /\[(\d+)\]/g;
268
+ NUMERIC_PATTERN = /^\d+$/;
269
+ ESCAPED_DOT_PATTERN = /\\\./g;
270
+ ESCAPED_LEFT_BRACKET_PATTERN = /\\\[/g;
271
+ ESCAPED_RIGHT_BRACKET_PATTERN = /\\\]/g;
272
+ SPLIT_PATTERN = /\.|\[(\d+)\]/g;
273
+ DOT_BEFORE_BRACKET_PATTERN = /\.\[/g;
274
+ ESCAPED_DOT_PLACEHOLDER = `__DOT__`;
275
+ ESCAPED_RIGHT_BRACKET_PLACEHOLDER = `__RB__`;
276
+ ESCAPED_LEFT_BRACKET_PLACEHOLDER = `__LB__`;
277
+ modifiedFields;
278
+ cleanedModifiedFields;
279
+ constructor(e2) {
280
+ this.modifiedFields = e2;
281
+ }
282
+ replaceEscapedCharacters(e2) {
283
+ 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);
284
+ }
285
+ restoreEscapedCharacters(e2) {
286
+ return e2.replace(this.ESCAPED_DOT_PLACEHOLDER, `\\.`).replace(this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER, `\\]`).replace(this.ESCAPED_LEFT_BRACKET_PLACEHOLDER, `\\[`);
287
+ }
288
+ unflatten() {
289
+ return this.cleanedModifiedFields = Object.fromEntries(Object.entries(this.modifiedFields).map(([e2, t2]) => [this.replaceEscapedCharacters(this.bracketToDotNotation(e2)), t2])), je(this.cleanedModifiedFields);
290
+ }
291
+ flatten(e2) {
292
+ let t2 = {};
293
+ for (let n2 of Object.keys(this.cleanedModifiedFields)) {
294
+ let r2 = this.splitPath(n2), i2 = this.navigatePath(e2, r2);
295
+ t2 = { ...t2, ...i2 };
296
+ }
297
+ return Object.fromEntries(Object.entries(t2).map(([e3, t3]) => [this.restoreEscapedCharacters(e3), t3]));
298
+ }
299
+ splitPath(e2) {
300
+ let t2 = [], n2 = 0, r2 = Array.from(e2.matchAll(this.SPLIT_PATTERN));
301
+ 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;
302
+ return n2 < e2.length && t2.push(e2.substring(n2)), t2;
303
+ }
304
+ navigatePath(e2, t2) {
305
+ let n2 = e2, r2 = [], i2 = (e3) => {
306
+ if (!Array.isArray(n2)) throw Error(`Expected array at path ${this.buildPathString(r2)}, but got ${typeof n2}`);
307
+ r2.push(`[${e3}]`), n2 = n2[parseInt(e3, 10)];
308
+ }, a2 = (e3, t3) => {
309
+ let i3 = e3 in oe ? oe[e3] : void 0;
310
+ if (i3 && i3 in t3) {
311
+ r2.push(i3), n2 = t3[i3];
312
+ return;
313
+ }
314
+ let a3 = Le(e3);
315
+ if (a3 && a3 in t3) {
316
+ r2.push(a3), n2 = t3[a3];
317
+ return;
318
+ }
319
+ throw Error(`Cannot find key '${e3}' or its transformations at path ${this.buildPathString(r2)}`);
320
+ }, o2 = (e3, t3) => {
321
+ r2.push(e3), n2 = t3[e3];
322
+ };
323
+ for (let e3 of t2) {
324
+ if (this.NUMERIC_PATTERN.test(e3)) {
325
+ i2(e3);
326
+ continue;
327
+ }
328
+ if (typeof n2 != `object` || !n2) throw Error(`Cannot access property '${e3}' on ${typeof n2} at path ${this.buildPathString(r2)}`);
329
+ let t3 = n2;
330
+ if (e3 in n2) {
331
+ o2(e3, t3);
332
+ continue;
333
+ }
334
+ a2(e3, t3);
335
+ }
336
+ return { [this.buildPathString(r2)]: n2 };
337
+ }
338
+ buildPathString(e2) {
339
+ return e2.join(`.`).replace(this.DOT_BEFORE_BRACKET_PATTERN, `[`);
340
+ }
341
+ bracketToDotNotation(e2) {
342
+ return e2.replace(this.BRACKET_PATTERN, (t2, n2, r2) => r2 > 0 && e2[r2 - 1] === `\\` ? t2 : `.` + n2);
343
+ }
344
+ };
345
+ function Pe(e2, t2) {
346
+ let n2 = e2?.modifiedFields;
347
+ if (!n2) return null;
348
+ let r2 = Fe(n2);
349
+ if (!r2) return null;
350
+ let { unflattenedModifiedFields: i2, modifiedFieldsManipulator: a2 } = r2;
351
+ e2 = { ...e2, modifiedFields: i2 };
352
+ let o2 = t2(e2), s2 = o2?.modifiedFields;
353
+ if (!s2) return null;
354
+ let c2 = Ie(s2, a2);
355
+ return c2 === null ? null : (o2.modifiedFields = c2, o2);
356
+ }
357
+ function Fe(e2) {
358
+ if (typeof e2 == `object` && e2 && !Array.isArray(e2)) try {
359
+ let t2 = new Ne(e2);
360
+ return { unflattenedModifiedFields: t2.unflatten(), modifiedFieldsManipulator: t2 };
361
+ } catch {
362
+ return null;
363
+ }
364
+ return null;
365
+ }
366
+ function Ie(e2, t2) {
367
+ if (typeof e2 == `object` && e2 && !Array.isArray(e2)) try {
368
+ return t2.flatten(e2);
369
+ } catch {
370
+ return null;
371
+ }
372
+ return null;
373
+ }
374
+ function Le(e2) {
375
+ return e2.replace(/[-_\s]+(.)?/g, (e3, t2) => t2 ? t2.toUpperCase() : ``).replace(/^./, (e3) => e3.toLowerCase());
376
+ }
377
+ function Re() {
378
+ return { emit(e2, ...t2) {
379
+ for (let n2 = 0, r2 = this.events[e2] || [], i2 = r2.length; n2 < i2; n2++) r2[n2](...t2);
380
+ }, events: {}, on(e2, t2) {
381
+ return (this.events[e2] ||= []).push(t2), () => {
382
+ this.events[e2] = this.events[e2]?.filter((e3) => t2 !== e3);
383
+ };
384
+ } };
385
+ }
386
+ var ze = (e2) => e2.__type === `event-definition`;
387
+ function Be(e2, t2, n2, r2) {
388
+ let i2;
389
+ if (e2.isDomainEvent) {
390
+ let { deletedEvent: e3, actionEvent: t3, createdEvent: a3, updatedEvent: o3, ...s3 } = n2, c2 = { ...r2, ...s3 };
391
+ 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 };
392
+ } else i2 = { data: n2, metadata: r2 };
393
+ let a2 = e2.transformations ?? ((e3) => e3), o2 = i2, s2 = i2;
394
+ if (s2.modifiedFields) {
395
+ let e3 = s2.modifiedFields;
396
+ if (typeof e3 == `object` && e3 && !Array.isArray(e3)) {
397
+ o2 = structuredClone(i2);
398
+ let e4 = Pe(s2, a2);
399
+ if (e4) return t2(e4);
400
+ }
401
+ }
402
+ return t2(a2(o2));
403
+ }
404
+ function Ve(e2) {
405
+ let t2 = /* @__PURE__ */ new Map(), n2 = Re();
406
+ return { initModule(e3) {
407
+ return (r2) => {
408
+ let i2 = t2.get(e3.type) ?? [];
409
+ i2.push({ eventDefinition: e3, handler: r2 }), t2.set(e3.type, i2), n2.emit(`registered`, e3);
410
+ };
411
+ }, client: { ...n2, getRegisteredEvents: () => t2, async process(e3, n3 = { expectedEvents: [] }) {
412
+ 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 }))];
413
+ 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(`, `)}`);
414
+ let l2 = t2.get(r2) ?? [];
415
+ return await Promise.all(l2.map(({ eventDefinition: e4, handler: t3 }) => Be(e4, t3, o2, { instanceId: a2, identity: i2, accountInfo: s2 }))), { instanceId: a2, eventType: r2, payload: o2, identity: i2, accountInfo: s2 };
416
+ }, async processRequest(e3, t3) {
417
+ let n3 = await e3.text();
418
+ return this.process(n3, t3);
419
+ }, async parseJWT(t3) {
420
+ let n3 = e2();
421
+ if (!n3.decodeJWT) throw Error(`decodeJWT is not supported by the authentication strategy`);
422
+ let { decoded: r2, valid: i2 } = await n3.decodeJWT(t3);
423
+ if (!i2) throw Error(`JWT is not valid`);
424
+ if (typeof r2.data != `string`) throw Error(`Unexpected type of JWT data: expected string, got ${typeof r2.data}`);
425
+ let a2 = JSON.parse(r2.data), o2 = a2.eventType, s2 = a2.accountInfo, c2 = a2.instanceId, l2 = a2.identity ? JSON.parse(a2.identity) : void 0;
426
+ return { instanceId: c2, eventType: o2, payload: JSON.parse(a2.data), identity: l2, accountInfo: s2 };
427
+ }, async parseRequest(e3) {
428
+ let t3 = await e3.text();
429
+ return this.parseJWT(t3);
430
+ }, async executeHandlers(e3) {
431
+ let n3 = Array.from(t2.keys()).map((e4) => ({ type: e4 }));
432
+ 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(`, `)}`);
433
+ let r2 = t2.get(e3.eventType) ?? [];
434
+ await Promise.all(r2.map(({ eventDefinition: t3, handler: n4 }) => Be(t3, n4, e3.payload, { instanceId: e3.instanceId, identity: e3.identity })));
435
+ }, apps: { AppInstalled: b(`AppInstalled`)(), AppRemoved: b(`AppRemoved`)() } } };
436
+ }
437
+ var He = (e2) => e2.__type === `service-plugin-definition`;
438
+ function Ue(e2) {
439
+ let t2 = /* @__PURE__ */ new Map(), n2 = Re();
440
+ return { initModule(e3) {
441
+ return (r2) => {
442
+ let i2 = t2.get(e3.componentType.toLowerCase()) ?? [];
443
+ i2.push({ servicePluginDefinition: e3, implementation: r2 }), t2.set(e3.componentType.toLowerCase(), i2), n2.emit(`registered`, e3);
444
+ };
445
+ }, client: { ...n2, getRegisteredServicePlugins: () => t2, async parseJWT(t3) {
446
+ let n3 = e2();
447
+ if (!n3.decodeJWT) throw Error(`decodeJWT is not supported by the authentication strategy`);
448
+ let { decoded: r2, valid: i2 } = await n3.decodeJWT(t3, true);
449
+ if (!i2) throw Error(`JWT is not valid`);
450
+ 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`);
451
+ return r2.data;
452
+ }, async process(e3) {
453
+ let t3 = await this.parseJWT(e3.body);
454
+ return this.executeHandler(t3, e3.url);
455
+ }, async parseRequest(e3) {
456
+ let t3 = await e3.text();
457
+ return this.parseJWT(t3);
458
+ }, async processRequest(e3) {
459
+ let t3 = await this.parseRequest(e3);
460
+ return this.processParsedRequest(t3, e3.url);
461
+ }, async processParsedRequest(e3, t3) {
462
+ try {
463
+ let n3 = await this.executeHandler(e3, t3);
464
+ return Response.json(n3);
465
+ } catch (e4) {
466
+ if (e4.errorType === `SPI` && e4.applicationCode && e4.httpCode) return Response.json({ applicationError: { code: e4.applicationCode, data: e4.data } }, { status: e4.httpCode });
467
+ throw e4;
468
+ }
469
+ }, async executeHandler(e3, n3) {
470
+ let r2 = e3.metadata.appExtensionType.toLowerCase(), i2 = t2.get(r2) ?? [];
471
+ if (i2.length === 0) throw Error(`No service plugin implementations found for component type ${r2}`);
472
+ if (i2.length > 1) throw Error(`Multiple service plugin implementations found for component type ${r2}. This is currently not supported`);
473
+ let { implementation: a2, servicePluginDefinition: o2 } = i2[0], s2 = o2.methods.find((e4) => n3.endsWith(e4.primaryHttpMappingPath));
474
+ if (!s2) throw Error(`Unexpect request: request url did not match any method: ` + n3);
475
+ let c2 = a2[s2.name];
476
+ if (!c2) throw Error(`Got request for service plugin method ${s2.name} but no implementation was provided. Available methods: ${Object.keys(a2).join(`, `)}`);
477
+ return s2.transformations.toREST(await c2(s2.transformations.fromREST(e3)));
478
+ } } };
479
+ }
480
+ var A = `X-Wix-Consistent`;
481
+ function We(e2) {
482
+ 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) => {
483
+ let i3 = o2(), s3 = await a2(), c3 = { ...r3?.headers ?? {}, ...s3.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [A]: t2[A] } : {} }, l3 = e2.host?.getErrorHandler?.();
484
+ try {
485
+ if (typeof n3 == `string` || n3 instanceof URL) {
486
+ let e3 = await i3(n3, { ...r3, headers: c3 });
487
+ l3?.handleError(e3, { requestOptions: { url: n3.toString(), method: r3?.method } });
488
+ let a3 = Ge(e3);
489
+ return a3 && (t2[A] = a3), e3;
490
+ }
491
+ {
492
+ for (let [e4, t3] of Object.entries(c3)) typeof t3 == `string` && n3.headers.set(e4, t3);
493
+ let e3 = await i3(n3, r3);
494
+ l3?.handleError(e3, { requestOptions: { url: n3.url, method: r3?.method } });
495
+ let a3 = Ge(e3);
496
+ return a3 && (t2[A] = a3), e3;
497
+ }
498
+ } catch (e3) {
499
+ throw l3?.handleError(e3, { requestOptions: { url: typeof n3 == `string` || n3 instanceof URL ? n3.toString() : n3.url, method: r3?.method } }), e3;
500
+ }
501
+ }, { client: c2, initModule: l2 } = Ue(i2), { client: u2, initModule: d2 } = Ve(i2), f2 = async (n3, r3) => {
502
+ let i3 = o2(), s3 = await a2(), c3 = O(r3), l3 = await i3(n3, { ...r3, headers: { ...c3, ...t2, ...s3?.headers, ...r3?.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [A]: t2[A] } : {} } }), u3 = Ge(l3);
503
+ return u3 && (t2[A] = u3), l3;
504
+ }, p2 = (t3, n3) => {
505
+ if (ze(t3)) return d2(t3);
506
+ if (He(t3)) return l2(t3);
507
+ if (ee(t3) && e2.host) return te(t3, e2.host);
508
+ if (typeof t3 == `function`) {
509
+ if (`__type` in t3 && t3.__type === `wix_spi_error`) return t3;
510
+ let r3 = e2.host?.apiBaseUrl ?? `www.wixapis.com`, o3 = e2.useCDN === void 0 ? i2().shouldUseCDN : e2.useCDN;
511
+ return we(ae(() => C(t3)) ? S(t3) : t3, n3 ?? {}, f2, e2.host?.getErrorHandler?.(), (e3, t4) => {
512
+ let n4 = new URL(e3, `https://${r3}`);
513
+ return n4.host = r3, n4.protocol = `https`, f2(n4.toString(), t4);
514
+ }, i2().getActiveToken, async () => a2(), { HTTPHost: r3 }, e2.host?.name, o3, e2.validateRequestSchema);
515
+ }
516
+ return k(t3) ? Object.fromEntries(Object.entries(t3).map(([e3, n4]) => [e3, p2(n4, t3[w])])) : t3;
517
+ }, m2 = (e3) => {
518
+ for (let n3 in e3) t2[n3] = e3[n3];
519
+ };
520
+ return { ...e2.modules ? p2(e2.modules) : {}, get auth() {
521
+ let t3 = i2();
522
+ return t3.getAuthHeaders = t3.getAuthHeaders.bind(void 0, e2.host), t3;
523
+ }, setHeaders: m2, use: p2, enableContext(e3, t3 = { elevated: false }) {
524
+ 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 ? y.elevatedClient = this : y.client = this;
525
+ }, fetch: (t3, n3) => {
526
+ let r3 = e2.host?.apiBaseUrl ?? `www.wixapis.com`, i3 = new URL(t3, `https://${r3}`);
527
+ return i3.host = r3, i3.protocol = `https`, f2(i3.toString(), n3);
528
+ }, fetchWithAuth: s2, async graphql(t3, n3, r3 = { apiVersion: `alpha` }) {
529
+ 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 }) });
530
+ if (a3.status !== 200) throw new E(`GraphQL request failed with status ${a3.status}`, a3);
531
+ let { data: o3, errors: s3 } = await a3.json();
532
+ return { data: o3 ?? {}, errors: s3 };
533
+ }, webhooks: u2, servicePlugins: c2 };
534
+ }
535
+ function Ge(e2) {
536
+ return e2.headers?.get(`X-Wix-Consistent`) ?? e2.headers?.get(`x-wix-consistent`);
537
+ }
538
+ var Ke = `wix:`;
539
+ var qe = { _id: `id`, _createdDate: `createdDate`, _updatedDate: `updatedDate` };
540
+ var Je = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
541
+ var Ye = `items`;
542
+ var Xe = `pagingMetadata`;
543
+ var Ze = qe;
544
+ function Qe(e2, t2) {
545
+ return e2?.split(`.`).map((e3) => t2?.[e3] ?? e3).join(`.`);
546
+ }
547
+ function $e(e2, { transformSystemFields: t2 = true } = {}) {
548
+ return t2 ? Qe(e2, Ze) : e2;
549
+ }
550
+ var et = `sort.fieldName`;
551
+ function tt(e2, t2, n2) {
552
+ return (e2 === et || e2.endsWith(`.${et}`)) && typeof t2 == `string` ? Qe(t2, n2) : t2;
553
+ }
554
+ function nt(e2, t2, n2) {
555
+ let r2 = (e3) => n2.includes(e3), i2 = (e3, n3) => {
556
+ if (Array.isArray(e3)) e3.forEach((e4) => {
557
+ i2(e4, n3);
558
+ });
559
+ else if (typeof e3 == `object` && e3) {
560
+ let a2 = e3;
561
+ Object.keys(a2).forEach((e4) => {
562
+ let o2 = n3 === `` ? e4 : `${n3}.${e4}`;
563
+ if (r2(o2)) return;
564
+ let s2 = rt(e4, t2);
565
+ s2 !== e4 && !(s2 in a2) && (a2[s2] = a2[e4], delete a2[e4]), a2[s2] = tt(o2, a2[s2], t2), i2(a2[s2], o2);
566
+ });
567
+ }
568
+ };
569
+ return i2(e2, ``), e2;
570
+ }
571
+ function rt(e2, t2) {
572
+ let n2;
573
+ return n2 = e2.includes(`.`) ? e2.split(`.`).map((e3) => t2[e3] ?? e3).join(`.`) : t2[e2] ?? e2, n2;
574
+ }
575
+ function j(e2, t2 = []) {
576
+ return nt(e2, qe, t2);
577
+ }
578
+ function M(e2, t2 = []) {
579
+ return nt(e2, Je, t2);
580
+ }
581
+ function it(e2) {
582
+ return e2?.toISOString();
583
+ }
584
+ function N(e2) {
585
+ return e2 ? new Date(e2) : void 0;
586
+ }
587
+ var at = /* @__PURE__ */ new WeakMap();
588
+ function ot() {
589
+ return { leaves: void 0, fields: void 0, mapFields: void 0, anyField: void 0 };
590
+ }
591
+ function st(e2, t2) {
592
+ let n2 = e2.get(t2);
593
+ return n2 || (n2 = ot(), e2.set(t2, n2)), n2;
594
+ }
595
+ function ct(e2, t2) {
596
+ return t2 === `*` ? (e2.anyField ??= ot(), e2.anyField) : t2.endsWith(`{}`) ? (e2.mapFields ??= /* @__PURE__ */ new Map(), st(e2.mapFields, t2.slice(0, -2))) : (e2.fields ??= /* @__PURE__ */ new Map(), st(e2.fields, t2));
597
+ }
598
+ function lt(e2) {
599
+ let t2 = ot();
600
+ for (let n2 of e2) {
601
+ let e3 = n2.path.split(`.`).reduce(ct, t2);
602
+ e3.leaves ??= [], e3.leaves.push(n2);
603
+ }
604
+ return t2;
605
+ }
606
+ function ut(e2) {
607
+ let t2 = at.get(e2);
608
+ return t2 || (t2 = lt(e2), at.set(e2, t2)), t2;
609
+ }
610
+ function dt(e2) {
611
+ return typeof e2 == `object` && !!e2;
612
+ }
613
+ function ft(e2, { isRepeated: t2, isMap: n2 }, r2) {
614
+ return t2 ? Array.isArray(e2) ? e2.map(r2) : e2 : n2 ? dt(e2) ? Object.fromEntries(Object.entries(e2).map(([e3, t3]) => [e3, r2(t3)])) : e2 : r2(e2);
615
+ }
616
+ function pt(e2, t2, n2) {
617
+ dt(e2) && gt(e2, t2, n2);
618
+ }
619
+ function mt(e2, t2, n2) {
620
+ for (let [r2, i2] of t2) {
621
+ if (!(r2 in e2)) continue;
622
+ if (i2.leaves) for (let t4 of i2.leaves) e2[r2] = ft(e2[r2], t4, n2);
623
+ let t3 = e2[r2];
624
+ Array.isArray(t3) ? t3.forEach((e3) => pt(e3, i2, n2)) : pt(t3, i2, n2);
625
+ }
626
+ }
627
+ function ht(e2, t2, n2) {
628
+ for (let [r2, i2] of t2) {
629
+ let t3 = e2[r2];
630
+ dt(t3) && Object.values(t3).forEach((e3) => pt(e3, i2, n2));
631
+ }
632
+ }
633
+ function gt(e2, { fields: t2, mapFields: n2, anyField: r2 }, i2) {
634
+ t2 && mt(e2, t2, i2), n2 && ht(e2, n2, i2), r2 && Object.values(e2).forEach((e3) => pt(e3, r2, i2));
635
+ }
636
+ function P(e2, t2) {
637
+ if (!dt(e2)) return e2;
638
+ for (let { paths: n2, transformFn: r2 } of t2) gt(e2, ut(n2), r2);
639
+ return e2;
640
+ }
641
+ function _t(e2, t2) {
642
+ let { protocol: n2 } = new URL(e2);
643
+ return n2 === `${t2}:` ? `${Ke}${e2}` : e2;
644
+ }
645
+ function vt(e2) {
646
+ return Object.fromEntries(Object.entries(e2).filter(([, e3]) => e3 !== void 0));
647
+ }
648
+ function yt(e2) {
649
+ return wt(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
650
+ }
651
+ var bt = /([\p{Ll}\d])(\p{Lu})/gu;
652
+ var xt = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
653
+ var St = `$1\0$2`;
654
+ var Ct = /[^\p{L}\d]+/giu;
655
+ function wt(e2) {
656
+ let t2 = e2.trim();
657
+ t2 = t2.replace(bt, St).replace(xt, St), t2 = t2.replace(Ct, `\0`);
658
+ let n2 = 0, r2 = t2.length;
659
+ for (; t2.charAt(n2) === `\0`; ) n2++;
660
+ if (n2 === r2) return [];
661
+ for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
662
+ return t2.slice(n2, r2).split(/\0/g);
663
+ }
664
+ var Tt = (e2) => `validationError` in (e2.response?.data?.details ?? {});
665
+ var Et = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
666
+ var Dt = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
667
+ function F(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
668
+ if (typeof e2 != `object` || !e2) throw e2;
669
+ if (Tt(e2)) return Ot(e2, t2, n2);
670
+ if (Et(e2)) return At(e2);
671
+ if (Dt(e2)) {
672
+ let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: yt(n3), data: {} }, requestId: e2.requestId };
673
+ return kt(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
674
+ }
675
+ return jt(e2);
676
+ }
677
+ var Ot = (e2, t2, n2) => {
678
+ let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = Mt(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 };
679
+ return kt(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e2.response?.status, requestId: i2 } });
680
+ };
681
+ var kt = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
682
+ var At = (e2) => {
683
+ 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 ?? yt(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 };
684
+ return kt(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e2.requestId } });
685
+ };
686
+ var jt = (e2) => kt(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: yt(e2.response?.statusText ?? `UNKNOWN`), ...!e2.response && { runtimeError: e2 } } });
687
+ var Mt = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
688
+ let a2 = { ...e2, ...t2 }, o2 = Object.keys(a2);
689
+ return r2?.filter((e3) => !r2.some((t3) => t3.field.length > e3.field.length && t3.field.startsWith(e3.field) && o2.includes(t3.field))).map((e3) => {
690
+ let r3 = t2[e3.field];
691
+ if (r3) return { ...e3, field: Nt(r3, i2) };
692
+ let s2 = o2?.sort((e4, t3) => t3.length - e4.length)?.find((t3) => e3.field.startsWith(t3));
693
+ if (s2) {
694
+ let t3 = a2[s2];
695
+ if (t3) return { ...e3, field: e3.field.replace(s2, Nt(t3, i2)) };
696
+ }
697
+ return n2 ? { ...e3, field: `${i2[0]}.${e3.field}` } : e3;
698
+ });
699
+ };
700
+ var Nt = (e2, t2) => {
701
+ let n2 = Pt(e2);
702
+ return n2 == null ? e2 : e2.replace(`$[${n2}]`, t2[n2]);
703
+ };
704
+ var Pt = (e2) => {
705
+ let t2 = e2.match(/\$\[(?<argIndex>\d+)\]/);
706
+ return t2 && t2.groups && Number(t2.groups.argIndex);
707
+ };
708
+ function Ft() {
709
+ let e2 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
710
+ if (e2) return { initWixModules(t3, n3) {
711
+ return It(() => e2(t3, n3));
712
+ }, fetchWithAuth() {
713
+ throw Error(`fetchWithAuth is not available in this context`);
714
+ }, graphql() {
715
+ throw Error(`graphql is not available in this context`);
716
+ } };
717
+ let t2 = typeof $wixContext < `u` ? $wixContext.client : y.client === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.client : y.client, n2 = typeof $wixContext < `u` ? $wixContext.elevatedClient : y.elevatedClient === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.elevatedClient : y.elevatedClient;
718
+ if (t2 || n2) return { initWixModules(e3, r2) {
719
+ if (r2) {
720
+ 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`);
721
+ return It(() => n2.use(e3));
722
+ }
723
+ if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
724
+ return It(() => t2.use(e3));
725
+ }, fetchWithAuth: (e3, n3) => {
726
+ if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
727
+ return t2.fetchWithAuth(e3, n3);
728
+ }, getAuth() {
729
+ if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
730
+ return t2.auth;
731
+ }, async graphql(e3, n3, r2) {
732
+ if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
733
+ return t2.graphql(e3, n3, r2);
734
+ } };
735
+ }
736
+ function It(e2) {
737
+ let t2 = globalThis.__wix_context__, n2 = { client: y.client, elevatedClient: y.elevatedClient }, r2;
738
+ globalThis.__wix_context__ = void 0, y.client = void 0, y.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
739
+ try {
740
+ return e2();
741
+ } finally {
742
+ globalThis.__wix_context__ = t2, y.client = n2.client, y.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
743
+ }
744
+ }
745
+ function Lt(e2, t2) {
746
+ return (...n2) => {
747
+ let r2 = Ft();
748
+ return r2 ? r2.initWixModules(e2, t2).apply(void 0, n2) : e2.apply(void 0, n2);
749
+ };
750
+ }
751
+ function Rt(e2) {
752
+ let t2 = (...t3) => {
753
+ let n2 = Ft();
754
+ return n2 ? n2.initWixModules(e2).apply(void 0, t3) : () => ({ slug: e2.type });
755
+ };
756
+ return t2.__type = e2.__type, t2.type = e2.type, t2.isDomainEvent = e2.isDomainEvent, t2.transformations = e2.transformations, t2;
757
+ }
758
+ function zt(e2, t2 = false) {
759
+ return Lt(e2, t2);
760
+ }
761
+ function Bt(e2, t2) {
762
+ let n2 = Ht(e2), r2 = Object.entries(n2).some(([e3, t3]) => e3.includes(`.`) || Array.isArray(t3) && t3.some((e4) => typeof e4 == `object`));
763
+ return t2 && r2 ? new URLSearchParams({ ".r": Wt(JSON.stringify(e2)) }) : Object.entries(n2).reduce((e3, [t3, n3]) => ((Array.isArray(n3) ? n3 : [n3]).forEach((r3) => {
764
+ r3 == null || Array.isArray(n3) && typeof r3 == `object` || e3.append(t3, r3);
765
+ }), e3), new URLSearchParams());
766
+ }
767
+ function Vt(e2) {
768
+ let t2 = rn(tn(e2.host), e2.domainToMappings);
769
+ return pn(un(e2.protoPath, e2.data || {}), t2);
770
+ }
771
+ function Ht(e2, t2 = ``) {
772
+ let n2 = {};
773
+ return Object.entries(e2).forEach(([e3, r2]) => {
774
+ let i2 = typeof r2 == `object` && !!r2 && !Array.isArray(r2), a2 = Ut(t2, e3);
775
+ if (i2) {
776
+ let e4 = Ht(r2, a2);
777
+ Object.assign(n2, e4);
778
+ } else n2[a2] = r2;
779
+ }), n2;
780
+ }
781
+ function Ut(e2, t2) {
782
+ return `${e2}${e2 ? `.` : ``}${t2}`;
783
+ }
784
+ var Wt = (e2) => {
785
+ let t2 = new TextEncoder().encode(e2);
786
+ return (typeof btoa < `u` ? btoa(String.fromCodePoint(...t2)) : Buffer.from(e2, `utf-8`).toString(`base64`)).replace(/=/g, ``).replace(/\+/g, `-`).replace(/\//g, `_`);
787
+ };
788
+ var Gt = [`wix.com`, `editorx.com`];
789
+ var Kt = `_`;
790
+ var qt = `*.`;
791
+ var Jt = RegExp(`\\.(${Gt.join(`|`)})$`);
792
+ var Yt = [`42.wixprod.net`, `uw2-edt-1.wixprod.net`, `virginia-edt.wixprod.net`];
793
+ var Xt = { "payments.base44.com": `manage.wix.com`, "create.editorx.com": `editor.editorx.com` };
794
+ var Zt = `dev.wix-code.com`;
795
+ var Qt = /{(.*)}/;
796
+ var $t = RegExp(`\\.(${Yt.join(`|`)})$`);
797
+ var en = RegExp(`.*\\.${Zt}$`);
798
+ function tn(e2) {
799
+ return nn(e2).replace(Jt, `._base_domain_`).replace($t, `._api_base_domain_`).replace(en, `*.dev.wix-code.com`);
800
+ }
801
+ function nn(e2) {
802
+ return Xt[e2] ?? e2;
803
+ }
804
+ function rn(e2, t2) {
805
+ let n2 = t2[e2];
806
+ if (n2) return n2;
807
+ let r2 = an(e2, t2) ?? on(e2, t2);
808
+ if (!r2) {
809
+ if (cn(e2)) {
810
+ let e3 = t2[ln];
811
+ if (e3) return e3;
812
+ }
813
+ let n3 = t2[Kt];
814
+ if (n3) return n3;
815
+ }
816
+ return r2 ?? [];
817
+ }
818
+ function an(e2, t2) {
819
+ return Object.entries(t2).find(([t3]) => {
820
+ let [, ...n2] = e2.split(`.`);
821
+ return n2.join(`.`) === t3;
822
+ })?.[1];
823
+ }
824
+ function on(e2, t2) {
825
+ let [n2] = Object.entries(t2).filter(([t3]) => sn(e2, t3)).sort(([e3], [t3]) => t3.length - e3.length);
826
+ if (!n2) return;
827
+ let [, r2] = n2;
828
+ return r2;
829
+ }
830
+ function sn(e2, t2) {
831
+ if (!t2.startsWith(qt)) return false;
832
+ let n2 = t2.slice(1);
833
+ return e2.length > n2.length && e2.endsWith(n2);
834
+ }
835
+ function cn(e2) {
836
+ return !!e2.match(/\._base_domain_$/);
837
+ }
838
+ var ln = `www._base_domain_`;
839
+ function un(e2, t2) {
840
+ return e2.split(`/`).map((e3) => dn(e3, t2)).join(`/`);
841
+ }
842
+ function dn(e2, t2) {
843
+ let n2 = e2.match(Qt) || [], r2 = n2[1];
844
+ return r2 ? fn(t2, r2, e2, e2.replace(n2[0], ``)) : e2;
845
+ }
846
+ function fn(e2, t2, n2, r2) {
847
+ let i2 = e2;
848
+ for (let e3 of t2.split(`.`)) {
849
+ if (!i2) return n2;
850
+ i2 = i2[e3];
851
+ }
852
+ return `${i2}${r2}`;
853
+ }
854
+ function pn(e2, t2) {
855
+ let n2 = t2?.find((t3) => e2.startsWith(t3.destPath));
856
+ return n2 ? n2.srcPath + e2.slice(n2.destPath.length) : e2;
857
+ }
858
+ function I(e2) {
859
+ return Rt(e2);
860
+ }
861
+ function mn(e2) {
862
+ return isFinite(e2) ? e2 : e2.toString();
863
+ }
864
+ function hn(e2) {
865
+ return e2 === `NaN` ? NaN : e2 === `Infinity` ? 1 / 0 : e2 === `-Infinity` ? -1 / 0 : e2;
866
+ }
867
+ function gn(e2) {
868
+ return e2 && vt({ city: e2.city, hint: e2.hint, subdivision: e2.subdivision, country: e2.country, postalCode: e2.postalCode, formattedAddress: e2.formatted, geocode: e2.location, addressLine: e2.addressLine1, addressLine2: e2.addressLine2, streetAddress: e2.streetAddress && { name: e2.streetAddress.name, number: e2.streetAddress.number, apt: e2.streetAddress.apt, formattedAddressLine: e2.streetAddress.formattedAddressLine } });
869
+ }
870
+ function _n(e2) {
871
+ return e2 && vt({ formatted: e2.formattedAddress, location: e2.geocode, addressLine1: e2.addressLine, addressLine2: e2.addressLine2, streetAddress: e2.streetAddress && { name: e2.streetAddress.name, number: e2.streetAddress.number, apt: e2.streetAddress.apt, formattedAddressLine: e2.streetAddress.formattedAddressLine }, hint: e2.hint, city: e2.city, subdivision: e2.subdivision, country: e2.country, postalCode: e2.postalCode, countryFullname: e2.countryFullname, subdivisionFullname: e2.subdivisionFullname });
872
+ }
873
+ var vn = `x-wix-linguist`;
874
+ var yn = `00000000-0000-0000-0000-000000000000`;
875
+ var bn = `false`;
876
+ var xn = () => {
877
+ let e2 = wn(`language`), t2 = wn(`locale`);
878
+ if (e2) return { [vn]: [e2, t2 || e2, bn, yn].join(`|`) };
879
+ };
880
+ function Sn() {
881
+ let e2 = null, t2 = null;
882
+ return { promise: new Promise((n2, r2) => {
883
+ e2 = n2, t2 = r2;
884
+ }), resolve: e2, reject: t2 };
885
+ }
886
+ var Cn = () => (typeof window < `u` ? window.commonConfig : void 0) ?? globalThis.commonConfig;
887
+ var wn = (e2) => Cn()?.[e2];
888
+ var Tn = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host: (t2) => {
889
+ let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e2(t2), o2 = Dn();
890
+ return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language: wn(`language`), locale: wn(`locale`), get passThroughHeaders() {
891
+ return xn();
892
+ } } };
893
+ }, auth: (e3) => {
894
+ let t2 = typeof window < `u` ? window.wixEmbedsAPI : void 0;
895
+ !e3 && En() && (e3 = t2?.getAccessTokenFunction?.());
896
+ let n2 = false, { resolve: r2, promise: i2 } = Sn();
897
+ return { getAuthHeaders: async () => {
898
+ if (!e3 && n2 && (e3 = await i2), !e3) throw Error(`Failed to resolve auth token`);
899
+ return { headers: { Authorization: await e3() } };
900
+ }, getAccessTokenInjector: () => (n2 = true, (e4) => {
901
+ r2(e4);
902
+ }) };
903
+ } });
904
+ function En() {
905
+ return typeof document < `u` && document.currentScript?.tagName === `SCRIPT`;
906
+ }
907
+ function Dn() {
908
+ let e2 = (typeof window < `u` ? window.wixEmbedsAPI : void 0)?.getExternalBaseUrl?.();
909
+ if (!e2) return;
910
+ let t2 = new URL(e2);
911
+ return t2?.pathname && t2.pathname !== `/` ? `${t2.hostname}${t2.pathname}` : t2.hostname;
912
+ }
913
+ var On = ({ clientSdk: e2, applicationId: t2 }) => ({ invoke: async ({ namespace: n2, method: r2, args: i2 }) => {
914
+ 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`);
915
+ return e2.invoke({ namespace: n2, method: r2, args: i2, applicationId: t2, accessToken: `accessToken` });
916
+ }, getAccessToken: () => {
917
+ throw Error(`Not implemented`);
918
+ }, observeState: () => ({ disconnect: () => {
919
+ } }) });
920
+ var kn = Tn({ createHost: function(e2) {
921
+ let t2 = (typeof $wixContext < `u` ? $wixContext.clientSdk : void 0) ?? e2?.clientSdk ?? (typeof window < `u` ? window?.clientSdk : void 0), { applicationId: n2 } = e2 || {};
922
+ if (!n2) throw Error(`"createHost" was called without a required field "applicationId"`);
923
+ return { channel: On({ clientSdk: t2, applicationId: n2 }), close: () => {
924
+ } };
925
+ } });
926
+ var An = (e2, t2) => {
927
+ let n2 = kn.host({ applicationId: e2, componentId: t2 }), r2 = kn.auth();
928
+ return We({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
929
+ };
930
+ var jn = (e2) => An(`215238eb-22a5-4c36-9e7b-e7c08025e04e`, e2);
931
+ var Mn = class {
932
+ constructor() {
933
+ this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
934
+ }
935
+ subscribe(e2) {
936
+ return this.listeners.add(e2), this.onSubscribe(), () => {
937
+ this.listeners.delete(e2), this.onUnsubscribe();
938
+ };
939
+ }
940
+ hasListeners() {
941
+ return this.listeners.size > 0;
942
+ }
943
+ onSubscribe() {
944
+ }
945
+ onUnsubscribe() {
946
+ }
947
+ };
948
+ var Nn = new class extends Mn {
949
+ #e;
950
+ #t;
951
+ #n;
952
+ constructor() {
953
+ super(), this.#n = (e2) => {
954
+ if (typeof window < `u` && window.addEventListener) {
955
+ let t2 = () => e2();
956
+ return window.addEventListener(`visibilitychange`, t2, false), () => {
957
+ window.removeEventListener(`visibilitychange`, t2);
958
+ };
959
+ }
960
+ };
961
+ }
962
+ onSubscribe() {
963
+ this.#t || this.setEventListener(this.#n);
964
+ }
965
+ onUnsubscribe() {
966
+ this.hasListeners() || (this.#t?.(), this.#t = void 0);
967
+ }
968
+ setEventListener(e2) {
969
+ this.#n = e2, this.#t?.(), this.#t = e2((e3) => {
970
+ typeof e3 == `boolean` ? this.setFocused(e3) : this.onFocus();
971
+ });
972
+ }
973
+ setFocused(e2) {
974
+ this.#e !== e2 && (this.#e = e2, this.onFocus());
975
+ }
976
+ onFocus() {
977
+ let e2 = this.isFocused();
978
+ this.listeners.forEach((t2) => {
979
+ t2(e2);
980
+ });
981
+ }
982
+ isFocused() {
983
+ return typeof this.#e == `boolean` ? this.#e : globalThis.document?.visibilityState !== `hidden`;
984
+ }
985
+ }();
986
+ var Pn = { setTimeout: (e2, t2) => setTimeout(e2, t2), clearTimeout: (e2) => clearTimeout(e2), setInterval: (e2, t2) => setInterval(e2, t2), clearInterval: (e2) => clearInterval(e2) };
987
+ var L = new class {
988
+ #e = Pn;
989
+ setTimeoutProvider(e2) {
990
+ this.#e = e2;
991
+ }
992
+ setTimeout(e2, t2) {
993
+ return this.#e.setTimeout(e2, t2);
994
+ }
995
+ clearTimeout(e2) {
996
+ this.#e.clearTimeout(e2);
997
+ }
998
+ setInterval(e2, t2) {
999
+ return this.#e.setInterval(e2, t2);
1000
+ }
1001
+ clearInterval(e2) {
1002
+ this.#e.clearInterval(e2);
1003
+ }
1004
+ }();
1005
+ function Fn(e2) {
1006
+ setTimeout(e2, 0);
1007
+ }
1008
+ var In = typeof window > `u` || `Deno` in globalThis;
1009
+ function R() {
1010
+ }
1011
+ function Ln(e2, t2) {
1012
+ return typeof e2 == `function` ? e2(t2) : e2;
1013
+ }
1014
+ function Rn(e2) {
1015
+ return typeof e2 == `number` && e2 >= 0 && e2 !== 1 / 0;
1016
+ }
1017
+ function zn(e2, t2) {
1018
+ return Math.max(e2 + (t2 || 0) - Date.now(), 0);
1019
+ }
1020
+ function z(e2, t2) {
1021
+ return typeof e2 == `function` ? e2(t2) : e2;
1022
+ }
1023
+ function B(e2, t2) {
1024
+ return typeof e2 == `function` ? e2(t2) : e2;
1025
+ }
1026
+ function Bn(e2, t2) {
1027
+ let { type: n2 = `all`, exact: r2, fetchStatus: i2, predicate: a2, queryKey: o2, stale: s2 } = e2;
1028
+ if (o2) {
1029
+ if (r2) {
1030
+ if (t2.queryHash !== Hn(o2, t2.options)) return false;
1031
+ } else if (!Wn(t2.queryKey, o2)) return false;
1032
+ }
1033
+ if (n2 !== `all`) {
1034
+ let e3 = t2.isActive();
1035
+ if (n2 === `active` && !e3 || n2 === `inactive` && e3) return false;
1036
+ }
1037
+ return !(typeof s2 == `boolean` && t2.isStale() !== s2 || i2 && i2 !== t2.state.fetchStatus || a2 && !a2(t2));
1038
+ }
1039
+ function Vn(e2, t2) {
1040
+ let { exact: n2, status: r2, predicate: i2, mutationKey: a2 } = e2;
1041
+ if (a2) {
1042
+ if (!t2.options.mutationKey) return false;
1043
+ if (n2) {
1044
+ if (Un(t2.options.mutationKey) !== Un(a2)) return false;
1045
+ } else if (!Wn(t2.options.mutationKey, a2)) return false;
1046
+ }
1047
+ return !(r2 && t2.state.status !== r2 || i2 && !i2(t2));
1048
+ }
1049
+ function Hn(e2, t2) {
1050
+ return (t2?.queryKeyHashFn || Un)(e2);
1051
+ }
1052
+ function Un(e2) {
1053
+ return JSON.stringify(e2, (e3, t2) => Yn(t2) ? Object.keys(t2).sort().reduce((e4, n2) => (e4[n2] = t2[n2], e4), {}) : t2);
1054
+ }
1055
+ function Wn(e2, t2) {
1056
+ return e2 === t2 ? true : typeof e2 == typeof t2 && e2 && t2 && typeof e2 == `object` && typeof t2 == `object` ? Object.keys(t2).every((n2) => Wn(e2[n2], t2[n2])) : false;
1057
+ }
1058
+ var Gn = Object.prototype.hasOwnProperty;
1059
+ function Kn(e2, t2, n2 = 0) {
1060
+ if (e2 === t2) return e2;
1061
+ if (n2 > 500) return t2;
1062
+ let r2 = Jn(e2) && Jn(t2);
1063
+ if (!r2 && !(Yn(e2) && Yn(t2))) return t2;
1064
+ let i2 = (r2 ? e2 : Object.keys(e2)).length, a2 = r2 ? t2 : Object.keys(t2), o2 = a2.length, s2 = r2 ? Array(o2) : {}, c2 = 0;
1065
+ for (let l2 = 0; l2 < o2; l2++) {
1066
+ let o3 = r2 ? l2 : a2[l2], u2 = e2[o3], d2 = t2[o3];
1067
+ if (u2 === d2) {
1068
+ s2[o3] = u2, (r2 ? l2 < i2 : Gn.call(e2, o3)) && c2++;
1069
+ continue;
1070
+ }
1071
+ if (u2 === null || d2 === null || typeof u2 != `object` || typeof d2 != `object`) {
1072
+ s2[o3] = d2;
1073
+ continue;
1074
+ }
1075
+ let f2 = Kn(u2, d2, n2 + 1);
1076
+ s2[o3] = f2, f2 === u2 && c2++;
1077
+ }
1078
+ return i2 === o2 && c2 === i2 ? e2 : s2;
1079
+ }
1080
+ function qn(e2, t2) {
1081
+ if (!t2 || Object.keys(e2).length !== Object.keys(t2).length) return false;
1082
+ for (let n2 in e2) if (e2[n2] !== t2[n2]) return false;
1083
+ return true;
1084
+ }
1085
+ function Jn(e2) {
1086
+ return Array.isArray(e2) && e2.length === Object.keys(e2).length;
1087
+ }
1088
+ function Yn(e2) {
1089
+ if (!Xn(e2)) return false;
1090
+ let t2 = e2.constructor;
1091
+ if (t2 === void 0) return true;
1092
+ let n2 = t2.prototype;
1093
+ return !(!Xn(n2) || !n2.hasOwnProperty(`isPrototypeOf`) || Object.getPrototypeOf(e2) !== Object.prototype);
1094
+ }
1095
+ function Xn(e2) {
1096
+ return Object.prototype.toString.call(e2) === `[object Object]`;
1097
+ }
1098
+ function Zn(e2) {
1099
+ return new Promise((t2) => {
1100
+ L.setTimeout(t2, e2);
1101
+ });
1102
+ }
1103
+ function Qn(e2, t2, n2) {
1104
+ return typeof n2.structuralSharing == `function` ? n2.structuralSharing(e2, t2) : n2.structuralSharing === false ? t2 : Kn(e2, t2);
1105
+ }
1106
+ function $n(e2, t2, n2 = 0) {
1107
+ let r2 = [...e2, t2];
1108
+ return n2 && r2.length > n2 ? r2.slice(1) : r2;
1109
+ }
1110
+ function er(e2, t2, n2 = 0) {
1111
+ let r2 = [t2, ...e2];
1112
+ return n2 && r2.length > n2 ? r2.slice(0, -1) : r2;
1113
+ }
1114
+ var tr = Symbol();
1115
+ function nr(e2, t2) {
1116
+ return !e2.queryFn && t2?.initialPromise ? () => t2.initialPromise : !e2.queryFn || e2.queryFn === tr ? () => Promise.reject(Error(`Missing queryFn: '${e2.queryHash}'`)) : e2.queryFn;
1117
+ }
1118
+ function rr(e2, t2) {
1119
+ return typeof e2 == `function` ? e2(...t2) : !!e2;
1120
+ }
1121
+ function ir(e2, t2, n2) {
1122
+ let r2 = false, i2;
1123
+ 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;
1124
+ }
1125
+ var ar = /* @__PURE__ */ (() => {
1126
+ let e2 = () => In;
1127
+ return { isServer() {
1128
+ return e2();
1129
+ }, setIsServer(t2) {
1130
+ e2 = t2;
1131
+ } };
1132
+ })();
1133
+ function or() {
1134
+ let e2, t2, n2 = new Promise((n3, r3) => {
1135
+ e2 = n3, t2 = r3;
1136
+ });
1137
+ n2.status = `pending`, n2.catch(() => {
1138
+ });
1139
+ function r2(e3) {
1140
+ Object.assign(n2, e3), delete n2.resolve, delete n2.reject;
1141
+ }
1142
+ return n2.resolve = (t3) => {
1143
+ r2({ status: `fulfilled`, value: t3 }), e2(t3);
1144
+ }, n2.reject = (e3) => {
1145
+ r2({ status: `rejected`, reason: e3 }), t2(e3);
1146
+ }, n2;
1147
+ }
1148
+ var sr = Fn;
1149
+ function cr() {
1150
+ let e2 = [], t2 = 0, n2 = (e3) => {
1151
+ e3();
1152
+ }, r2 = (e3) => {
1153
+ e3();
1154
+ }, i2 = sr, a2 = (r3) => {
1155
+ t2 ? e2.push(r3) : i2(() => {
1156
+ n2(r3);
1157
+ });
1158
+ }, o2 = () => {
1159
+ let t3 = e2;
1160
+ e2 = [], t3.length && i2(() => {
1161
+ r2(() => {
1162
+ t3.forEach((e3) => {
1163
+ n2(e3);
1164
+ });
1165
+ });
1166
+ });
1167
+ };
1168
+ return { batch: (e3) => {
1169
+ let n3;
1170
+ t2++;
1171
+ try {
1172
+ n3 = e3();
1173
+ } finally {
1174
+ t2--, t2 || o2();
1175
+ }
1176
+ return n3;
1177
+ }, batchCalls: (e3) => (...t3) => {
1178
+ a2(() => {
1179
+ e3(...t3);
1180
+ });
1181
+ }, schedule: a2, setNotifyFunction: (e3) => {
1182
+ n2 = e3;
1183
+ }, setBatchNotifyFunction: (e3) => {
1184
+ r2 = e3;
1185
+ }, setScheduler: (e3) => {
1186
+ i2 = e3;
1187
+ } };
1188
+ }
1189
+ var V = cr();
1190
+ var lr = new class extends Mn {
1191
+ #e = true;
1192
+ #t;
1193
+ #n;
1194
+ constructor() {
1195
+ super(), this.#n = (e2) => {
1196
+ if (typeof window < `u` && window.addEventListener) {
1197
+ let t2 = () => e2(true), n2 = () => e2(false);
1198
+ return window.addEventListener(`online`, t2, false), window.addEventListener(`offline`, n2, false), () => {
1199
+ window.removeEventListener(`online`, t2), window.removeEventListener(`offline`, n2);
1200
+ };
1201
+ }
1202
+ };
1203
+ }
1204
+ onSubscribe() {
1205
+ this.#t || this.setEventListener(this.#n);
1206
+ }
1207
+ onUnsubscribe() {
1208
+ this.hasListeners() || (this.#t?.(), this.#t = void 0);
1209
+ }
1210
+ setEventListener(e2) {
1211
+ this.#n = e2, this.#t?.(), this.#t = e2(this.setOnline.bind(this));
1212
+ }
1213
+ setOnline(e2) {
1214
+ this.#e !== e2 && (this.#e = e2, this.listeners.forEach((t2) => {
1215
+ t2(e2);
1216
+ }));
1217
+ }
1218
+ isOnline() {
1219
+ return this.#e;
1220
+ }
1221
+ }();
1222
+ function ur(e2) {
1223
+ return Math.min(1e3 * 2 ** e2, 3e4);
1224
+ }
1225
+ function dr(e2) {
1226
+ return (e2 ?? `online`) !== `online` || lr.isOnline();
1227
+ }
1228
+ var fr = class extends Error {
1229
+ constructor(e2) {
1230
+ super(`CancelledError`), this.revert = e2?.revert, this.silent = e2?.silent;
1231
+ }
1232
+ };
1233
+ function pr(e2) {
1234
+ let t2 = false, n2 = 0, r2, i2 = or(), a2 = () => i2.status !== `pending`, o2 = (t3) => {
1235
+ if (!a2()) {
1236
+ let n3 = new fr(t3);
1237
+ f2(n3), e2.onCancel?.(n3);
1238
+ }
1239
+ }, s2 = () => {
1240
+ t2 = true;
1241
+ }, c2 = () => {
1242
+ t2 = false;
1243
+ }, l2 = () => Nn.isFocused() && (e2.networkMode === `always` || lr.isOnline()) && e2.canRun(), u2 = () => dr(e2.networkMode) && e2.canRun(), d2 = (e3) => {
1244
+ a2() || (r2?.(), i2.resolve(e3));
1245
+ }, f2 = (e3) => {
1246
+ a2() || (r2?.(), i2.reject(e3));
1247
+ }, p2 = () => new Promise((t3) => {
1248
+ r2 = (e3) => {
1249
+ (a2() || l2()) && t3(e3);
1250
+ }, e2.onPause?.();
1251
+ }).then(() => {
1252
+ r2 = void 0, a2() || e2.onContinue?.();
1253
+ }), m2 = () => {
1254
+ if (a2()) return;
1255
+ let r3, i3 = n2 === 0 ? e2.initialPromise : void 0;
1256
+ try {
1257
+ r3 = i3 ?? e2.fn();
1258
+ } catch (e3) {
1259
+ r3 = Promise.reject(e3);
1260
+ }
1261
+ Promise.resolve(r3).then(d2).catch((r4) => {
1262
+ if (a2()) return;
1263
+ let i4 = e2.retry ?? (ar.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);
1264
+ if (t2 || !c3) {
1265
+ f2(r4);
1266
+ return;
1267
+ }
1268
+ n2++, e2.onFail?.(n2, r4), Zn(s3).then(() => l2() ? void 0 : p2()).then(() => {
1269
+ t2 ? f2(r4) : m2();
1270
+ });
1271
+ });
1272
+ };
1273
+ return { promise: i2, status: () => i2.status, cancel: o2, continue: () => (r2?.(), i2), cancelRetry: s2, continueRetry: c2, canStart: u2, start: () => (u2() ? m2() : p2().then(m2), i2) };
1274
+ }
1275
+ var mr = class {
1276
+ #e;
1277
+ destroy() {
1278
+ this.clearGcTimeout();
1279
+ }
1280
+ scheduleGc() {
1281
+ this.clearGcTimeout(), Rn(this.gcTime) && (this.#e = L.setTimeout(() => {
1282
+ this.optionalRemove();
1283
+ }, this.gcTime));
1284
+ }
1285
+ updateGcTime(e2) {
1286
+ this.gcTime = Math.max(this.gcTime || 0, e2 ?? (ar.isServer() ? 1 / 0 : 3e5));
1287
+ }
1288
+ clearGcTimeout() {
1289
+ this.#e !== void 0 && (L.clearTimeout(this.#e), this.#e = void 0);
1290
+ }
1291
+ };
1292
+ function hr(e2) {
1293
+ return { onFetch: (t2, n2) => {
1294
+ 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 () => {
1295
+ let n3 = false, l3 = (e3) => {
1296
+ ir(e3, () => t2.signal, () => n3 = true);
1297
+ }, u2 = nr(t2.options, t2.fetchOptions), d2 = async (e3, r3, i3) => {
1298
+ if (n3) return Promise.reject(t2.signal.reason);
1299
+ if (r3 == null && e3.pages.length) return Promise.resolve(e3);
1300
+ let a3 = (() => {
1301
+ let e4 = { client: t2.client, queryKey: t2.queryKey, pageParam: r3, direction: i3 ? `backward` : `forward`, meta: t2.options.meta };
1302
+ return l3(e4), e4;
1303
+ })(), o3 = await u2(a3), { maxPages: s3 } = t2.options, c3 = i3 ? er : $n;
1304
+ return { pages: c3(e3.pages, o3, s3), pageParams: c3(e3.pageParams, r3, s3) };
1305
+ };
1306
+ if (i2 && a2.length) {
1307
+ let e3 = i2 === `backward`, t3 = e3 ? _r : gr, n4 = { pages: a2, pageParams: o2 };
1308
+ s2 = await d2(n4, t3(r2, n4), e3);
1309
+ } else {
1310
+ let t3 = e2 ?? a2.length;
1311
+ do {
1312
+ let e3 = c2 === 0 ? o2[0] ?? r2.initialPageParam : gr(r2, s2);
1313
+ if (c2 > 0 && e3 == null) break;
1314
+ s2 = await d2(s2, e3), c2++;
1315
+ } while (c2 < t3);
1316
+ }
1317
+ return s2;
1318
+ };
1319
+ t2.fetchFn = t2.options.persister ? () => t2.options.persister?.(l2, { client: t2.client, queryKey: t2.queryKey, meta: t2.options.meta, signal: t2.signal }, n2) : l2;
1320
+ } };
1321
+ }
1322
+ function gr(e2, { pages: t2, pageParams: n2 }) {
1323
+ let r2 = t2.length - 1;
1324
+ return t2.length > 0 ? e2.getNextPageParam(t2[r2], t2, n2[r2], n2) : void 0;
1325
+ }
1326
+ function _r(e2, { pages: t2, pageParams: n2 }) {
1327
+ return t2.length > 0 ? e2.getPreviousPageParam?.(t2[0], t2, n2[0], n2) : void 0;
1328
+ }
1329
+ var vr = class extends mr {
1330
+ #e;
1331
+ #t;
1332
+ #n;
1333
+ #r;
1334
+ #i;
1335
+ #a;
1336
+ #o;
1337
+ #s;
1338
+ constructor(e2) {
1339
+ 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 = xr(this.options), this.state = e2.state ?? this.#t, this.scheduleGc();
1340
+ }
1341
+ get meta() {
1342
+ return this.options.meta;
1343
+ }
1344
+ get queryType() {
1345
+ return this.#e;
1346
+ }
1347
+ get promise() {
1348
+ return this.#a?.promise;
1349
+ }
1350
+ setOptions(e2) {
1351
+ if (this.options = { ...this.#o, ...e2 }, e2?._type && (this.#e = e2._type), this.updateGcTime(this.options.gcTime), this.state && this.state.data === void 0) {
1352
+ let e3 = xr(this.options);
1353
+ e3.data !== void 0 && (this.setState(br(e3.data, e3.dataUpdatedAt)), this.#t = e3);
1354
+ }
1355
+ }
1356
+ optionalRemove() {
1357
+ !this.observers.length && this.state.fetchStatus === `idle` && this.#r.remove(this);
1358
+ }
1359
+ setData(e2, t2) {
1360
+ let n2 = Qn(this.state.data, e2, this.options);
1361
+ return this.#l({ data: n2, type: `success`, dataUpdatedAt: t2?.updatedAt, manual: t2?.manual }), n2;
1362
+ }
1363
+ setState(e2) {
1364
+ this.#l({ type: `setState`, state: e2 });
1365
+ }
1366
+ cancel(e2) {
1367
+ let t2 = this.#a?.promise;
1368
+ return this.#a?.cancel(e2), t2 ? t2.then(R).catch(R) : Promise.resolve();
1369
+ }
1370
+ destroy() {
1371
+ super.destroy(), this.cancel({ silent: true });
1372
+ }
1373
+ get resetState() {
1374
+ return this.#t;
1375
+ }
1376
+ reset() {
1377
+ this.destroy(), this.setState(this.resetState);
1378
+ }
1379
+ isActive() {
1380
+ return this.observers.some((e2) => B(e2.options.enabled, this) !== false);
1381
+ }
1382
+ isDisabled() {
1383
+ return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === tr || !this.isFetched();
1384
+ }
1385
+ isFetched() {
1386
+ return this.state.dataUpdateCount + this.state.errorUpdateCount > 0;
1387
+ }
1388
+ isStatic() {
1389
+ return this.getObserversCount() > 0 && this.observers.some((e2) => z(e2.options.staleTime, this) === `static`);
1390
+ }
1391
+ isStale() {
1392
+ return this.getObserversCount() > 0 ? this.observers.some((e2) => e2.getCurrentResult().isStale) : this.state.data === void 0 || this.state.isInvalidated;
1393
+ }
1394
+ isStaleByTime(e2 = 0) {
1395
+ return this.state.data === void 0 ? true : e2 === `static` ? false : this.state.isInvalidated ? true : !zn(this.state.dataUpdatedAt, e2);
1396
+ }
1397
+ onFocus() {
1398
+ this.observers.find((e2) => e2.shouldFetchOnWindowFocus())?.refetch({ cancelRefetch: false }), this.#a?.continue();
1399
+ }
1400
+ onOnline() {
1401
+ this.observers.find((e2) => e2.shouldFetchOnReconnect())?.refetch({ cancelRefetch: false }), this.#a?.continue();
1402
+ }
1403
+ addObserver(e2) {
1404
+ this.observers.includes(e2) || (this.observers.push(e2), this.clearGcTimeout(), this.#r.notify({ type: `observerAdded`, query: this, observer: e2 }));
1405
+ }
1406
+ removeObserver(e2) {
1407
+ 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 }));
1408
+ }
1409
+ getObserversCount() {
1410
+ return this.observers.length;
1411
+ }
1412
+ #c() {
1413
+ return this.state.fetchStatus === `paused` && this.state.status === `pending`;
1414
+ }
1415
+ invalidate() {
1416
+ this.state.isInvalidated || this.#l({ type: `invalidate` });
1417
+ }
1418
+ async fetch(e2, t2) {
1419
+ if (this.state.fetchStatus !== `idle` && this.#a?.status() !== `rejected`) {
1420
+ if (this.state.data !== void 0 && t2?.cancelRefetch) this.cancel({ silent: true });
1421
+ else if (this.#a) return this.#a.continueRetry(), this.#a.promise;
1422
+ }
1423
+ if (e2 && this.setOptions(e2), !this.options.queryFn) {
1424
+ let e3 = this.observers.find((e4) => e4.options.queryFn);
1425
+ e3 && this.setOptions(e3.options);
1426
+ }
1427
+ let n2 = new AbortController(), r2 = (e3) => {
1428
+ Object.defineProperty(e3, "signal", { enumerable: true, get: () => (this.#s = true, n2.signal) });
1429
+ }, i2 = () => {
1430
+ let e3 = nr(this.options, t2), n3 = (() => {
1431
+ let e4 = { client: this.#i, queryKey: this.queryKey, meta: this.meta };
1432
+ return r2(e4), e4;
1433
+ })();
1434
+ return this.#s = false, this.options.persister ? this.options.persister(e3, n3, this) : e3(n3);
1435
+ }, a2 = (() => {
1436
+ let e3 = { fetchOptions: t2, options: this.options, queryKey: this.queryKey, client: this.#i, state: this.state, fetchFn: i2 };
1437
+ return r2(e3), e3;
1438
+ })();
1439
+ (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) => {
1440
+ e3 instanceof fr && e3.revert && this.setState({ ...this.#n, fetchStatus: `idle` }), n2.abort();
1441
+ }, onFail: (e3, t3) => {
1442
+ this.#l({ type: `failed`, failureCount: e3, error: t3 });
1443
+ }, onPause: () => {
1444
+ this.#l({ type: `pause` });
1445
+ }, onContinue: () => {
1446
+ this.#l({ type: `continue` });
1447
+ }, retry: a2.options.retry, retryDelay: a2.options.retryDelay, networkMode: a2.options.networkMode, canRun: () => true });
1448
+ try {
1449
+ let e3 = await this.#a.start();
1450
+ if (e3 === void 0) throw Error(`${this.queryHash} data is undefined`);
1451
+ return this.setData(e3), this.#r.config.onSuccess?.(e3, this), this.#r.config.onSettled?.(e3, this.state.error, this), e3;
1452
+ } catch (e3) {
1453
+ if (e3 instanceof fr) {
1454
+ if (e3.silent) return this.#a.promise;
1455
+ if (e3.revert) {
1456
+ if (this.state.data === void 0) throw e3;
1457
+ return this.state.data;
1458
+ }
1459
+ }
1460
+ throw this.#l({ type: `error`, error: e3 }), this.#r.config.onError?.(e3, this), this.#r.config.onSettled?.(this.state.data, e3, this), e3;
1461
+ } finally {
1462
+ this.scheduleGc();
1463
+ }
1464
+ }
1465
+ #l(e2) {
1466
+ let t2 = (t3) => {
1467
+ switch (e2.type) {
1468
+ case `failed`:
1469
+ return { ...t3, fetchFailureCount: e2.failureCount, fetchFailureReason: e2.error };
1470
+ case `pause`:
1471
+ return { ...t3, fetchStatus: `paused` };
1472
+ case `continue`:
1473
+ return { ...t3, fetchStatus: `fetching` };
1474
+ case `fetch`:
1475
+ return { ...t3, ...yr(t3.data, this.options), fetchMeta: e2.meta ?? null };
1476
+ case `success`:
1477
+ let n2 = { ...t3, ...br(e2.data, e2.dataUpdatedAt), dataUpdateCount: t3.dataUpdateCount + 1, ...!e2.manual && { fetchStatus: `idle`, fetchFailureCount: 0, fetchFailureReason: null } };
1478
+ return this.#n = e2.manual ? n2 : void 0, n2;
1479
+ case `error`:
1480
+ let r2 = e2.error;
1481
+ return { ...t3, error: r2, errorUpdateCount: t3.errorUpdateCount + 1, errorUpdatedAt: Date.now(), fetchFailureCount: t3.fetchFailureCount + 1, fetchFailureReason: r2, fetchStatus: `idle`, status: `error`, isInvalidated: true };
1482
+ case `invalidate`:
1483
+ return { ...t3, isInvalidated: true };
1484
+ case `setState`:
1485
+ return { ...t3, ...e2.state };
1486
+ }
1487
+ };
1488
+ this.state = t2(this.state), V.batch(() => {
1489
+ this.observers.forEach((e3) => {
1490
+ e3.onQueryUpdate();
1491
+ }), this.#r.notify({ query: this, type: `updated`, action: e2 });
1492
+ });
1493
+ }
1494
+ };
1495
+ function yr(e2, t2) {
1496
+ return { fetchFailureCount: 0, fetchFailureReason: null, fetchStatus: dr(t2.networkMode) ? `fetching` : `paused`, ...e2 === void 0 && { error: null, status: `pending` } };
1497
+ }
1498
+ function br(e2, t2) {
1499
+ return { data: e2, dataUpdatedAt: t2 ?? Date.now(), error: null, isInvalidated: false, status: `success` };
1500
+ }
1501
+ function xr(e2) {
1502
+ 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;
1503
+ 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` };
1504
+ }
1505
+ var Sr = class extends Mn {
1506
+ constructor(e2, t2) {
1507
+ super(), this.options = t2, this.#e = e2, this.#s = null, this.#o = or(), this.bindMethods(), this.setOptions(t2);
1508
+ }
1509
+ #e;
1510
+ #t = void 0;
1511
+ #n = void 0;
1512
+ #r = void 0;
1513
+ #i;
1514
+ #a;
1515
+ #o;
1516
+ #s;
1517
+ #c;
1518
+ #l;
1519
+ #u;
1520
+ #d;
1521
+ #f;
1522
+ #p;
1523
+ #m = /* @__PURE__ */ new Set();
1524
+ bindMethods() {
1525
+ this.refetch = this.refetch.bind(this);
1526
+ }
1527
+ onSubscribe() {
1528
+ this.listeners.size === 1 && (this.#t.addObserver(this), wr(this.#t, this.options) ? this.#h() : this.updateResult(), this.#y());
1529
+ }
1530
+ onUnsubscribe() {
1531
+ this.hasListeners() || this.destroy();
1532
+ }
1533
+ shouldFetchOnReconnect() {
1534
+ return Tr(this.#t, this.options, this.options.refetchOnReconnect);
1535
+ }
1536
+ shouldFetchOnWindowFocus() {
1537
+ return Tr(this.#t, this.options, this.options.refetchOnWindowFocus);
1538
+ }
1539
+ destroy() {
1540
+ this.listeners = /* @__PURE__ */ new Set(), this.#b(), this.#x(), this.#t.removeObserver(this);
1541
+ }
1542
+ setOptions(e2) {
1543
+ let t2 = this.options, n2 = this.#t;
1544
+ if (this.options = this.#e.defaultQueryOptions(e2), this.options.enabled !== void 0 && typeof this.options.enabled != `boolean` && typeof this.options.enabled != `function` && typeof B(this.options.enabled, this.#t) != `boolean`) throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);
1545
+ this.#S(), this.#t.setOptions(this.options), t2._defaulted && !qn(this.options, t2) && this.#e.getQueryCache().notify({ type: `observerOptionsUpdated`, query: this.#t, observer: this });
1546
+ let r2 = this.hasListeners();
1547
+ r2 && Er(this.#t, n2, this.options, t2) && this.#h(), this.updateResult(), r2 && (this.#t !== n2 || B(this.options.enabled, this.#t) !== B(t2.enabled, this.#t) || z(this.options.staleTime, this.#t) !== z(t2.staleTime, this.#t)) && this.#g();
1548
+ let i2 = this.#_();
1549
+ r2 && (this.#t !== n2 || B(this.options.enabled, this.#t) !== B(t2.enabled, this.#t) || i2 !== this.#p) && this.#v(i2);
1550
+ }
1551
+ getOptimisticResult(e2) {
1552
+ let t2 = this.#e.getQueryCache().build(this.#e, e2), n2 = this.createResult(t2, e2);
1553
+ return Or(this, n2) && (this.#r = n2, this.#a = this.options, this.#i = this.#t.state), n2;
1554
+ }
1555
+ getCurrentResult() {
1556
+ return this.#r;
1557
+ }
1558
+ trackResult(e2, t2) {
1559
+ 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)) });
1560
+ }
1561
+ trackProp(e2) {
1562
+ this.#m.add(e2);
1563
+ }
1564
+ getCurrentQuery() {
1565
+ return this.#t;
1566
+ }
1567
+ refetch({ ...e2 } = {}) {
1568
+ return this.fetch({ ...e2 });
1569
+ }
1570
+ fetchOptimistic(e2) {
1571
+ let t2 = this.#e.defaultQueryOptions(e2), n2 = this.#e.getQueryCache().build(this.#e, t2);
1572
+ return n2.fetch().then(() => this.createResult(n2, t2));
1573
+ }
1574
+ fetch(e2) {
1575
+ return this.#h({ ...e2, cancelRefetch: e2.cancelRefetch ?? true }).then(() => (this.updateResult(), this.#r));
1576
+ }
1577
+ #h(e2) {
1578
+ this.#S();
1579
+ let t2 = this.#t.fetch(this.options, e2);
1580
+ return e2?.throwOnError || (t2 = t2.catch(R)), t2;
1581
+ }
1582
+ #g() {
1583
+ this.#b();
1584
+ let e2 = z(this.options.staleTime, this.#t);
1585
+ if (ar.isServer() || this.#r.isStale || !Rn(e2)) return;
1586
+ let t2 = zn(this.#r.dataUpdatedAt, e2) + 1;
1587
+ this.#d = L.setTimeout(() => {
1588
+ this.#r.isStale || this.updateResult();
1589
+ }, t2);
1590
+ }
1591
+ #_() {
1592
+ return (typeof this.options.refetchInterval == `function` ? this.options.refetchInterval(this.#t) : this.options.refetchInterval) ?? false;
1593
+ }
1594
+ #v(e2) {
1595
+ this.#x(), this.#p = e2, !ar.isServer() && B(this.options.enabled, this.#t) !== false && Rn(this.#p) && this.#p !== 0 && (this.#f = L.setInterval(() => {
1596
+ (this.options.refetchIntervalInBackground || Nn.isFocused()) && this.#h();
1597
+ }, this.#p));
1598
+ }
1599
+ #y() {
1600
+ this.#g(), this.#v(this.#_());
1601
+ }
1602
+ #b() {
1603
+ this.#d !== void 0 && (L.clearTimeout(this.#d), this.#d = void 0);
1604
+ }
1605
+ #x() {
1606
+ this.#f !== void 0 && (L.clearInterval(this.#f), this.#f = void 0);
1607
+ }
1608
+ createResult(e2, t2) {
1609
+ 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;
1610
+ if (t2._optimisticResults) {
1611
+ let i3 = this.hasListeners(), a3 = !i3 && wr(e2, t2), o3 = i3 && Er(e2, n2, t2, r2);
1612
+ (a3 || o3) && (l2 = { ...l2, ...yr(c2.data, e2.options) }), t2._optimisticResults === `isRestoring` && (l2.fetchStatus = `idle`);
1613
+ }
1614
+ let { error: f2, errorUpdatedAt: p2, status: m2 } = l2;
1615
+ d2 = l2.data;
1616
+ let h2 = false;
1617
+ if (t2.placeholderData !== void 0 && d2 === void 0 && m2 === `pending`) {
1618
+ let e3;
1619
+ i2?.isPlaceholderData && t2.placeholderData === o2?.placeholderData ? (e3 = i2.data, h2 = 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);
1620
+ }
1621
+ if (t2.select && d2 !== void 0 && !h2) {
1622
+ if (i2 && d2 === a2?.data && t2.select === this.#c) d2 = this.#l;
1623
+ else try {
1624
+ this.#c = t2.select, d2 = t2.select(d2), d2 = Qn(i2?.data, d2, t2), this.#l = d2, this.#s = null;
1625
+ } catch (e3) {
1626
+ this.#s = e3;
1627
+ }
1628
+ }
1629
+ this.#s && (f2 = this.#s, d2 = this.#l, p2 = Date.now(), m2 = `error`);
1630
+ let g2 = l2.fetchStatus === `fetching`, _2 = m2 === `pending`, v2 = m2 === `error`, y2 = _2 && g2, b2 = d2 !== void 0, x2 = { status: m2, fetchStatus: l2.fetchStatus, isPending: _2, isSuccess: m2 === `success`, isError: v2, isInitialLoading: y2, isLoading: y2, 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: g2, isRefetching: g2 && !_2, isLoadingError: v2 && !b2, isPaused: l2.fetchStatus === `paused`, isPlaceholderData: u2, isRefetchError: v2 && b2, isStale: Dr(e2, t2), refetch: this.refetch, promise: this.#o, isEnabled: B(t2.enabled, e2) !== false };
1631
+ if (this.options.experimental_prefetchInRender) {
1632
+ let t3 = x2.data !== void 0, r3 = x2.status === `error` && !t3, i3 = (e3) => {
1633
+ r3 ? e3.reject(x2.error) : t3 && e3.resolve(x2.data);
1634
+ }, a3 = () => {
1635
+ let e3 = this.#o = x2.promise = or();
1636
+ i3(e3);
1637
+ }, o3 = this.#o;
1638
+ switch (o3.status) {
1639
+ case `pending`:
1640
+ e2.queryHash === n2.queryHash && i3(o3);
1641
+ break;
1642
+ case `fulfilled`:
1643
+ (r3 || x2.data !== o3.value) && a3();
1644
+ break;
1645
+ case `rejected`:
1646
+ (!r3 || x2.error !== o3.reason) && a3();
1647
+ }
1648
+ }
1649
+ return x2;
1650
+ }
1651
+ updateResult() {
1652
+ let e2 = this.#r, t2 = this.createResult(this.#t, this.options);
1653
+ 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: (() => {
1654
+ if (!e2) return true;
1655
+ let { notifyOnChangeProps: t3 } = this.options, n2 = typeof t3 == `function` ? t3() : t3;
1656
+ if (n2 === `all` || !n2 && !this.#m.size) return true;
1657
+ let r2 = new Set(n2 ?? this.#m);
1658
+ return this.options.throwOnError && r2.add(`error`), Object.keys(this.#r).some((t4) => {
1659
+ let n3 = t4;
1660
+ return this.#r[n3] !== e2[n3] && r2.has(n3);
1661
+ });
1662
+ })() }));
1663
+ }
1664
+ #S() {
1665
+ let e2 = this.#e.getQueryCache().build(this.#e, this.options);
1666
+ if (e2 === this.#t) return;
1667
+ let t2 = this.#t;
1668
+ this.#t = e2, this.#n = e2.state, this.hasListeners() && (t2?.removeObserver(this), e2.addObserver(this));
1669
+ }
1670
+ onQueryUpdate() {
1671
+ this.updateResult(), this.hasListeners() && this.#y();
1672
+ }
1673
+ #C(e2) {
1674
+ V.batch(() => {
1675
+ e2.listeners && this.listeners.forEach((e3) => {
1676
+ e3(this.#r);
1677
+ }), this.#e.getQueryCache().notify({ query: this.#t, type: `observerResultsUpdated` });
1678
+ });
1679
+ }
1680
+ };
1681
+ function Cr(e2, t2) {
1682
+ return B(t2.enabled, e2) !== false && e2.state.data === void 0 && (e2.state.status !== `error` || B(t2.retryOnMount, e2) !== false);
1683
+ }
1684
+ function wr(e2, t2) {
1685
+ return Cr(e2, t2) || e2.state.data !== void 0 && Tr(e2, t2, t2.refetchOnMount);
1686
+ }
1687
+ function Tr(e2, t2, n2) {
1688
+ if (B(t2.enabled, e2) !== false && z(t2.staleTime, e2) !== `static`) {
1689
+ let r2 = typeof n2 == `function` ? n2(e2) : n2;
1690
+ return r2 === `always` || r2 !== false && Dr(e2, t2);
1691
+ }
1692
+ return false;
1693
+ }
1694
+ function Er(e2, t2, n2, r2) {
1695
+ return (e2 !== t2 || B(r2.enabled, e2) === false) && (!n2.suspense || e2.state.status !== `error`) && Dr(e2, n2);
1696
+ }
1697
+ function Dr(e2, t2) {
1698
+ return B(t2.enabled, e2) !== false && e2.isStaleByTime(z(t2.staleTime, e2));
1699
+ }
1700
+ function Or(e2, t2) {
1701
+ return !qn(e2.getCurrentResult(), t2);
1702
+ }
1703
+ var kr = class extends mr {
1704
+ #e;
1705
+ #t;
1706
+ #n;
1707
+ #r;
1708
+ constructor(e2) {
1709
+ super(), this.#e = e2.client, this.mutationId = e2.mutationId, this.#n = e2.mutationCache, this.#t = [], this.state = e2.state || Ar(), this.setOptions(e2.options), this.scheduleGc();
1710
+ }
1711
+ setOptions(e2) {
1712
+ this.options = e2, this.updateGcTime(this.options.gcTime);
1713
+ }
1714
+ get meta() {
1715
+ return this.options.meta;
1716
+ }
1717
+ addObserver(e2) {
1718
+ this.#t.includes(e2) || (this.#t.push(e2), this.clearGcTimeout(), this.#n.notify({ type: `observerAdded`, mutation: this, observer: e2 }));
1719
+ }
1720
+ removeObserver(e2) {
1721
+ this.#t = this.#t.filter((t2) => t2 !== e2), this.scheduleGc(), this.#n.notify({ type: `observerRemoved`, mutation: this, observer: e2 });
1722
+ }
1723
+ optionalRemove() {
1724
+ this.#t.length || (this.state.status === `pending` ? this.scheduleGc() : this.#n.remove(this));
1725
+ }
1726
+ continue() {
1727
+ return this.#r?.continue() ?? this.execute(this.state.variables);
1728
+ }
1729
+ async execute(e2) {
1730
+ let t2 = () => {
1731
+ this.#i({ type: `continue` });
1732
+ }, n2 = { client: this.#e, meta: this.options.meta, mutationKey: this.options.mutationKey };
1733
+ this.#r = pr({ fn: () => this.options.mutationFn ? this.options.mutationFn(e2, n2) : Promise.reject(Error(`No mutationFn found`)), onFail: (e3, t3) => {
1734
+ this.#i({ type: `failed`, failureCount: e3, error: t3 });
1735
+ }, onPause: () => {
1736
+ this.#i({ type: `pause` });
1737
+ }, onContinue: t2, retry: this.options.retry ?? 0, retryDelay: this.options.retryDelay, networkMode: this.options.networkMode, canRun: () => this.#n.canRun(this) });
1738
+ let r2 = this.state.status === `pending`, i2 = !this.#r.canStart();
1739
+ try {
1740
+ if (r2) t2();
1741
+ else {
1742
+ this.#i({ type: `pending`, variables: e2, isPaused: i2 }), this.#n.config.onMutate && await this.#n.config.onMutate(e2, this, n2);
1743
+ let t3 = await this.options.onMutate?.(e2, n2);
1744
+ t3 !== this.state.context && this.#i({ type: `pending`, context: t3, variables: e2, isPaused: i2 });
1745
+ }
1746
+ let a2 = await this.#r.start();
1747
+ 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;
1748
+ } catch (t3) {
1749
+ try {
1750
+ await this.#n.config.onError?.(t3, e2, this.state.context, this, n2);
1751
+ } catch (e3) {
1752
+ Promise.reject(e3);
1753
+ }
1754
+ try {
1755
+ await this.options.onError?.(t3, e2, this.state.context, n2);
1756
+ } catch (e3) {
1757
+ Promise.reject(e3);
1758
+ }
1759
+ try {
1760
+ await this.#n.config.onSettled?.(void 0, t3, this.state.variables, this.state.context, this, n2);
1761
+ } catch (e3) {
1762
+ Promise.reject(e3);
1763
+ }
1764
+ try {
1765
+ await this.options.onSettled?.(void 0, t3, e2, this.state.context, n2);
1766
+ } catch (e3) {
1767
+ Promise.reject(e3);
1768
+ }
1769
+ throw this.#i({ type: `error`, error: t3 }), t3;
1770
+ } finally {
1771
+ this.#n.runNext(this);
1772
+ }
1773
+ }
1774
+ #i(e2) {
1775
+ let t2 = (t3) => {
1776
+ switch (e2.type) {
1777
+ case `failed`:
1778
+ return { ...t3, failureCount: e2.failureCount, failureReason: e2.error };
1779
+ case `pause`:
1780
+ return { ...t3, isPaused: true };
1781
+ case `continue`:
1782
+ return { ...t3, isPaused: false };
1783
+ case `pending`:
1784
+ 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() };
1785
+ case `success`:
1786
+ return { ...t3, data: e2.data, failureCount: 0, failureReason: null, error: null, status: `success`, isPaused: false };
1787
+ case `error`:
1788
+ return { ...t3, data: void 0, error: e2.error, failureCount: t3.failureCount + 1, failureReason: e2.error, isPaused: false, status: `error` };
1789
+ }
1790
+ };
1791
+ this.state = t2(this.state), V.batch(() => {
1792
+ this.#t.forEach((t3) => {
1793
+ t3.onMutationUpdate(e2);
1794
+ }), this.#n.notify({ mutation: this, type: `updated`, action: e2 });
1795
+ });
1796
+ }
1797
+ };
1798
+ function Ar() {
1799
+ return { context: void 0, data: void 0, error: null, failureCount: 0, failureReason: null, isPaused: false, status: `idle`, variables: void 0, submittedAt: 0 };
1800
+ }
1801
+ var jr = class extends Mn {
1802
+ constructor(e2 = {}) {
1803
+ super(), this.config = e2, this.#e = /* @__PURE__ */ new Set(), this.#t = /* @__PURE__ */ new Map(), this.#n = 0;
1804
+ }
1805
+ #e;
1806
+ #t;
1807
+ #n;
1808
+ build(e2, t2, n2) {
1809
+ let r2 = new kr({ client: e2, mutationCache: this, mutationId: ++this.#n, options: e2.defaultMutationOptions(t2), state: n2 });
1810
+ return this.add(r2), r2;
1811
+ }
1812
+ add(e2) {
1813
+ this.#e.add(e2);
1814
+ let t2 = Mr(e2);
1815
+ if (typeof t2 == `string`) {
1816
+ let n2 = this.#t.get(t2);
1817
+ n2 ? n2.push(e2) : this.#t.set(t2, [e2]);
1818
+ }
1819
+ this.notify({ type: `added`, mutation: e2 });
1820
+ }
1821
+ remove(e2) {
1822
+ if (this.#e.delete(e2)) {
1823
+ let t2 = Mr(e2);
1824
+ if (typeof t2 == `string`) {
1825
+ let n2 = this.#t.get(t2);
1826
+ if (n2) {
1827
+ if (n2.length > 1) {
1828
+ let t3 = n2.indexOf(e2);
1829
+ t3 !== -1 && n2.splice(t3, 1);
1830
+ } else n2[0] === e2 && this.#t.delete(t2);
1831
+ }
1832
+ }
1833
+ }
1834
+ this.notify({ type: `removed`, mutation: e2 });
1835
+ }
1836
+ canRun(e2) {
1837
+ let t2 = Mr(e2);
1838
+ if (typeof t2 == `string`) {
1839
+ let n2 = this.#t.get(t2)?.find((e3) => e3.state.status === `pending`);
1840
+ return !n2 || n2 === e2;
1841
+ }
1842
+ return true;
1843
+ }
1844
+ runNext(e2) {
1845
+ let t2 = Mr(e2);
1846
+ return typeof t2 == `string` ? this.#t.get(t2)?.find((t3) => t3 !== e2 && t3.state.isPaused)?.continue() ?? Promise.resolve() : Promise.resolve();
1847
+ }
1848
+ clear() {
1849
+ V.batch(() => {
1850
+ this.#e.forEach((e2) => {
1851
+ this.notify({ type: `removed`, mutation: e2 });
1852
+ }), this.#e.clear(), this.#t.clear();
1853
+ });
1854
+ }
1855
+ getAll() {
1856
+ return Array.from(this.#e);
1857
+ }
1858
+ find(e2) {
1859
+ let t2 = { exact: true, ...e2 };
1860
+ return this.getAll().find((e3) => Vn(t2, e3));
1861
+ }
1862
+ findAll(e2 = {}) {
1863
+ return this.getAll().filter((t2) => Vn(e2, t2));
1864
+ }
1865
+ notify(e2) {
1866
+ V.batch(() => {
1867
+ this.listeners.forEach((t2) => {
1868
+ t2(e2);
1869
+ });
1870
+ });
1871
+ }
1872
+ resumePausedMutations() {
1873
+ let e2 = this.getAll().filter((e3) => e3.state.isPaused);
1874
+ return V.batch(() => Promise.all(e2.map((e3) => e3.continue().catch(R))));
1875
+ }
1876
+ };
1877
+ function Mr(e2) {
1878
+ return e2.options.scope?.id;
1879
+ }
1880
+ var Nr = class extends Mn {
1881
+ constructor(e2 = {}) {
1882
+ super(), this.config = e2, this.#e = /* @__PURE__ */ new Map();
1883
+ }
1884
+ #e;
1885
+ build(e2, t2, n2) {
1886
+ let r2 = t2.queryKey, i2 = t2.queryHash ?? Hn(r2, t2), a2 = this.get(i2);
1887
+ return a2 || (a2 = new vr({ client: e2, queryKey: r2, queryHash: i2, options: e2.defaultQueryOptions(t2), state: n2, defaultOptions: e2.getQueryDefaults(r2) }), this.add(a2)), a2;
1888
+ }
1889
+ add(e2) {
1890
+ this.#e.has(e2.queryHash) || (this.#e.set(e2.queryHash, e2), this.notify({ type: `added`, query: e2 }));
1891
+ }
1892
+ remove(e2) {
1893
+ let t2 = this.#e.get(e2.queryHash);
1894
+ t2 && (e2.destroy(), t2 === e2 && this.#e.delete(e2.queryHash), this.notify({ type: `removed`, query: e2 }));
1895
+ }
1896
+ clear() {
1897
+ V.batch(() => {
1898
+ this.getAll().forEach((e2) => {
1899
+ this.remove(e2);
1900
+ });
1901
+ });
1902
+ }
1903
+ get(e2) {
1904
+ return this.#e.get(e2);
1905
+ }
1906
+ getAll() {
1907
+ return [...this.#e.values()];
1908
+ }
1909
+ find(e2) {
1910
+ let t2 = { exact: true, ...e2 };
1911
+ return this.getAll().find((e3) => Bn(t2, e3));
1912
+ }
1913
+ findAll(e2 = {}) {
1914
+ let t2 = this.getAll();
1915
+ return Object.keys(e2).length > 0 ? t2.filter((t3) => Bn(e2, t3)) : t2;
1916
+ }
1917
+ notify(e2) {
1918
+ V.batch(() => {
1919
+ this.listeners.forEach((t2) => {
1920
+ t2(e2);
1921
+ });
1922
+ });
1923
+ }
1924
+ onFocus() {
1925
+ V.batch(() => {
1926
+ this.getAll().forEach((e2) => {
1927
+ e2.onFocus();
1928
+ });
1929
+ });
1930
+ }
1931
+ onOnline() {
1932
+ V.batch(() => {
1933
+ this.getAll().forEach((e2) => {
1934
+ e2.onOnline();
1935
+ });
1936
+ });
1937
+ }
1938
+ };
1939
+ var Pr = class {
1940
+ #e;
1941
+ #t;
1942
+ #n;
1943
+ #r;
1944
+ #i;
1945
+ #a;
1946
+ #o;
1947
+ #s;
1948
+ constructor(e2 = {}) {
1949
+ this.#e = e2.queryCache || new Nr(), this.#t = e2.mutationCache || new jr(), this.#n = e2.defaultOptions || {}, this.#r = /* @__PURE__ */ new Map(), this.#i = /* @__PURE__ */ new Map(), this.#a = 0;
1950
+ }
1951
+ mount() {
1952
+ this.#a++, this.#a === 1 && (this.#o = Nn.subscribe(async (e2) => {
1953
+ e2 && (await this.resumePausedMutations(), this.#e.onFocus());
1954
+ }), this.#s = lr.subscribe(async (e2) => {
1955
+ e2 && (await this.resumePausedMutations(), this.#e.onOnline());
1956
+ }));
1957
+ }
1958
+ unmount() {
1959
+ this.#a--, this.#a === 0 && (this.#o?.(), this.#o = void 0, this.#s?.(), this.#s = void 0);
1960
+ }
1961
+ isFetching(e2) {
1962
+ return this.#e.findAll({ ...e2, fetchStatus: `fetching` }).length;
1963
+ }
1964
+ isMutating(e2) {
1965
+ return this.#t.findAll({ ...e2, status: `pending` }).length;
1966
+ }
1967
+ getQueryData(e2) {
1968
+ let t2 = this.defaultQueryOptions({ queryKey: e2 });
1969
+ return this.#e.get(t2.queryHash)?.state.data;
1970
+ }
1971
+ ensureQueryData(e2) {
1972
+ let t2 = this.defaultQueryOptions(e2), n2 = this.#e.build(this, t2), r2 = n2.state.data;
1973
+ return r2 === void 0 ? this.fetchQuery(e2) : (e2.revalidateIfStale && n2.isStaleByTime(z(t2.staleTime, n2)) && this.prefetchQuery(t2), Promise.resolve(r2));
1974
+ }
1975
+ getQueriesData(e2) {
1976
+ return this.#e.findAll(e2).map(({ queryKey: e3, state: t2 }) => [e3, t2.data]);
1977
+ }
1978
+ setQueryData(e2, t2, n2) {
1979
+ let r2 = this.defaultQueryOptions({ queryKey: e2 }), i2 = this.#e.get(r2.queryHash)?.state.data, a2 = Ln(t2, i2);
1980
+ if (a2 !== void 0) return this.#e.build(this, r2).setData(a2, { ...n2, manual: true });
1981
+ }
1982
+ setQueriesData(e2, t2, n2) {
1983
+ return V.batch(() => this.#e.findAll(e2).map(({ queryKey: e3 }) => [e3, this.setQueryData(e3, t2, n2)]));
1984
+ }
1985
+ getQueryState(e2) {
1986
+ let t2 = this.defaultQueryOptions({ queryKey: e2 });
1987
+ return this.#e.get(t2.queryHash)?.state;
1988
+ }
1989
+ removeQueries(e2) {
1990
+ let t2 = this.#e;
1991
+ V.batch(() => {
1992
+ t2.findAll(e2).forEach((e3) => {
1993
+ t2.remove(e3);
1994
+ });
1995
+ });
1996
+ }
1997
+ resetQueries(e2, t2) {
1998
+ let n2 = this.#e;
1999
+ return V.batch(() => (n2.findAll(e2).forEach((e3) => {
2000
+ e3.reset();
2001
+ }), this.refetchQueries({ type: `active`, ...e2 }, t2)));
2002
+ }
2003
+ cancelQueries(e2, t2 = {}) {
2004
+ let n2 = { revert: true, ...t2 }, r2 = V.batch(() => this.#e.findAll(e2).map((e3) => e3.cancel(n2)));
2005
+ return Promise.all(r2).then(R).catch(R);
2006
+ }
2007
+ invalidateQueries(e2, t2 = {}) {
2008
+ return V.batch(() => (this.#e.findAll(e2).forEach((e3) => {
2009
+ e3.invalidate();
2010
+ }), e2?.refetchType === `none` ? Promise.resolve() : this.refetchQueries({ ...e2, type: e2?.refetchType ?? e2?.type ?? `active` }, t2)));
2011
+ }
2012
+ refetchQueries(e2, t2 = {}) {
2013
+ let n2 = { ...t2, cancelRefetch: t2.cancelRefetch ?? true }, r2 = V.batch(() => this.#e.findAll(e2).filter((e3) => !e3.isDisabled() && !e3.isStatic()).map((e3) => {
2014
+ let t3 = e3.fetch(void 0, n2);
2015
+ return n2.throwOnError || (t3 = t3.catch(R)), e3.state.fetchStatus === `paused` ? Promise.resolve() : t3;
2016
+ }));
2017
+ return Promise.all(r2).then(R);
2018
+ }
2019
+ fetchQuery(e2) {
2020
+ let t2 = this.defaultQueryOptions(e2);
2021
+ t2.retry === void 0 && (t2.retry = false);
2022
+ let n2 = this.#e.build(this, t2);
2023
+ return n2.isStaleByTime(z(t2.staleTime, n2)) ? n2.fetch(t2) : Promise.resolve(n2.state.data);
2024
+ }
2025
+ prefetchQuery(e2) {
2026
+ return this.fetchQuery(e2).then(R).catch(R);
2027
+ }
2028
+ fetchInfiniteQuery(e2) {
2029
+ return e2._type = `infinite`, this.fetchQuery(e2);
2030
+ }
2031
+ prefetchInfiniteQuery(e2) {
2032
+ return this.fetchInfiniteQuery(e2).then(R).catch(R);
2033
+ }
2034
+ ensureInfiniteQueryData(e2) {
2035
+ return e2._type = `infinite`, this.ensureQueryData(e2);
2036
+ }
2037
+ resumePausedMutations() {
2038
+ return lr.isOnline() ? this.#t.resumePausedMutations() : Promise.resolve();
2039
+ }
2040
+ getQueryCache() {
2041
+ return this.#e;
2042
+ }
2043
+ getMutationCache() {
2044
+ return this.#t;
2045
+ }
2046
+ getDefaultOptions() {
2047
+ return this.#n;
2048
+ }
2049
+ setDefaultOptions(e2) {
2050
+ this.#n = e2;
2051
+ }
2052
+ setQueryDefaults(e2, t2) {
2053
+ this.#r.set(Un(e2), { queryKey: e2, defaultOptions: t2 });
2054
+ }
2055
+ getQueryDefaults(e2) {
2056
+ let t2 = [...this.#r.values()], n2 = {};
2057
+ return t2.forEach((t3) => {
2058
+ Wn(e2, t3.queryKey) && Object.assign(n2, t3.defaultOptions);
2059
+ }), n2;
2060
+ }
2061
+ setMutationDefaults(e2, t2) {
2062
+ this.#i.set(Un(e2), { mutationKey: e2, defaultOptions: t2 });
2063
+ }
2064
+ getMutationDefaults(e2) {
2065
+ let t2 = [...this.#i.values()], n2 = {};
2066
+ return t2.forEach((t3) => {
2067
+ Wn(e2, t3.mutationKey) && Object.assign(n2, t3.defaultOptions);
2068
+ }), n2;
2069
+ }
2070
+ defaultQueryOptions(e2) {
2071
+ if (e2._defaulted) return e2;
2072
+ let t2 = { ...this.#n.queries, ...this.getQueryDefaults(e2.queryKey), ...e2, _defaulted: true };
2073
+ return t2.queryHash ||= Hn(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 === tr && (t2.enabled = false), t2;
2074
+ }
2075
+ defaultMutationOptions(e2) {
2076
+ return e2?._defaulted ? e2 : { ...this.#n.mutations, ...e2?.mutationKey && this.getMutationDefaults(e2.mutationKey), ...e2, _defaulted: true };
2077
+ }
2078
+ clear() {
2079
+ this.#e.clear(), this.#t.clear();
2080
+ }
2081
+ };
2082
+ var Fr = e.createContext(void 0);
2083
+ var Ir = (t2) => {
2084
+ let n2 = e.useContext(Fr);
2085
+ if (t2) return t2;
2086
+ if (!n2) throw Error(`No QueryClient set, use QueryClientProvider to set one`);
2087
+ return n2;
2088
+ };
2089
+ var Lr = ({ client: t2, children: n2 }) => (e.useEffect(() => (t2.mount(), () => {
2090
+ t2.unmount();
2091
+ }), [t2]), (0, import_jsx_runtime.jsx)(Fr.Provider, { value: t2, children: n2 }));
2092
+ var Rr = e.createContext(false);
2093
+ var zr = () => e.useContext(Rr);
2094
+ Rr.Provider;
2095
+ function Br() {
2096
+ let e2 = false;
2097
+ return { clearReset: () => {
2098
+ e2 = false;
2099
+ }, reset: () => {
2100
+ e2 = true;
2101
+ }, isReset: () => e2 };
2102
+ }
2103
+ var Vr = e.createContext(Br());
2104
+ var Hr = () => e.useContext(Vr);
2105
+ var Ur = (e2, t2, n2) => {
2106
+ let r2 = n2?.state.error && typeof e2.throwOnError == `function` ? rr(e2.throwOnError, [n2.state.error, n2]) : e2.throwOnError;
2107
+ (e2.suspense || e2.experimental_prefetchInRender || r2) && (t2.isReset() || (e2.retryOnMount = false));
2108
+ };
2109
+ var Wr = (t2) => {
2110
+ e.useEffect(() => {
2111
+ t2.clearReset();
2112
+ }, [t2]);
2113
+ };
2114
+ var Gr = ({ result: e2, errorResetBoundary: t2, throwOnError: n2, query: r2, suspense: i2 }) => e2.isError && !t2.isReset() && !e2.isFetching && r2 && (i2 && e2.data === void 0 || rr(n2, [e2.error, r2]));
2115
+ var Kr = (e2) => {
2116
+ if (e2.suspense) {
2117
+ let t2 = 1e3, n2 = (e3) => e3 === `static` ? e3 : Math.max(e3 ?? t2, t2), r2 = e2.staleTime;
2118
+ e2.staleTime = typeof r2 == `function` ? (...e3) => n2(r2(...e3)) : n2(r2), typeof e2.gcTime == `number` && (e2.gcTime = Math.max(e2.gcTime, t2));
2119
+ }
2120
+ };
2121
+ var qr = (e2, t2) => e2.isLoading && e2.isFetching && !t2;
2122
+ var Jr = (e2, t2) => e2?.suspense && t2.isPending;
2123
+ var Yr = (e2, t2, n2) => t2.fetchOptimistic(e2).catch(() => {
2124
+ n2.clearReset();
2125
+ });
2126
+ function Xr(t2, n2, r2) {
2127
+ let i2 = zr(), a2 = Hr(), o2 = Ir(r2), s2 = o2.defaultQueryOptions(t2);
2128
+ o2.getDefaultOptions().queries?._experimental_beforeQuery?.(s2);
2129
+ let c2 = o2.getQueryCache().get(s2.queryHash), l2 = t2.subscribed !== false;
2130
+ s2._optimisticResults = i2 ? `isRestoring` : l2 ? `optimistic` : void 0, Kr(s2), Ur(s2, a2, c2), Wr(a2);
2131
+ let u2 = !o2.getQueryCache().get(s2.queryHash), [d2] = e.useState(() => new n2(o2, s2)), f2 = d2.getOptimisticResult(s2), p2 = !i2 && l2;
2132
+ if (e.useSyncExternalStore(e.useCallback((e2) => {
2133
+ let t3 = p2 ? d2.subscribe(V.batchCalls(e2)) : R;
2134
+ return d2.updateResult(), t3;
2135
+ }, [d2, p2]), () => d2.getCurrentResult(), () => d2.getCurrentResult()), e.useEffect(() => {
2136
+ d2.setOptions(s2);
2137
+ }, [s2, d2]), Jr(s2, f2)) throw Yr(s2, d2, a2);
2138
+ if (Gr({ result: f2, errorResetBoundary: a2, throwOnError: s2.throwOnError, query: c2, suspense: s2.suspense })) throw f2.error;
2139
+ return o2.getDefaultOptions().queries?._experimental_afterQuery?.(s2, f2), s2.experimental_prefetchInRender && !ar.isServer() && qr(f2, i2) && (u2 ? Yr(s2, d2, a2) : c2?.promise)?.catch(R).finally(() => {
2140
+ d2.updateResult();
2141
+ }), s2.notifyOnChangeProps ? f2 : d2.trackResult(f2);
2142
+ }
2143
+ function Zr(e2, t2) {
2144
+ return Xr(e2, Sr, t2);
2145
+ }
2146
+ function H(e2) {
2147
+ return e2;
2148
+ }
2149
+ var Qr = H(`@wix/site-service-url`);
2150
+ var $r = `215238eb-22a5-4c36-9e7b-e7c08025e04e`;
2151
+ var ei = `1380b703-ce81-ff05-f115-39571d94dfcd`;
2152
+ `${$r}`, `${$r}`;
2153
+ var U = function(e2) {
2154
+ 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;
2155
+ }({});
2156
+ var ti = () => {
2157
+ let e2 = (0, import_services_manager_react.useService)(Qr), n2 = (0, import_react.useCallback)((t2, n3) => {
2158
+ let r2 = e2.appSectionRelativeUrl($r, t2, true);
2159
+ if (r2) return `./${r2.replace(/^\//, ``).replace(/\/$/, ``)}/${encodeURIComponent(n3)}`;
2160
+ }, [e2]);
2161
+ return { getPageRelativeUrl: n2, getPageAbsoluteUrl: (0, import_react.useCallback)((t2, r2) => {
2162
+ let i2 = n2(t2, r2);
2163
+ if (i2) return new URL(i2, `${e2.siteUrl.replace(/\/$/, ``)}/`).href;
2164
+ }, [n2, e2]) };
2165
+ };
2166
+ var ni = g((e2, t2) => {
2167
+ t2.exports = typeof window == `object` && window && window.Object === Object && window;
2168
+ });
2169
+ var W = g((e2, t2) => {
2170
+ var n2 = ni(), r2 = typeof self == `object` && self && self.Object === Object && self;
2171
+ t2.exports = n2 || r2 || Function(`return this`)();
2172
+ });
2173
+ var ri = g((e2, t2) => {
2174
+ t2.exports = W().Symbol;
2175
+ });
2176
+ var ii = g((e2, t2) => {
2177
+ var n2 = ri(), r2 = Object.prototype, i2 = r2.hasOwnProperty, a2 = r2.toString, o2 = n2 ? n2.toStringTag : void 0;
2178
+ function s2(e3) {
2179
+ var t3 = i2.call(e3, o2), n3 = e3[o2];
2180
+ try {
2181
+ e3[o2] = void 0;
2182
+ var r3 = true;
2183
+ } catch {
2184
+ }
2185
+ var s3 = a2.call(e3);
2186
+ return r3 && (t3 ? e3[o2] = n3 : delete e3[o2]), s3;
2187
+ }
2188
+ t2.exports = s2;
2189
+ });
2190
+ var ai = g((e2, t2) => {
2191
+ var n2 = Object.prototype.toString;
2192
+ function r2(e3) {
2193
+ return n2.call(e3);
2194
+ }
2195
+ t2.exports = r2;
2196
+ });
2197
+ var oi = g((e2, t2) => {
2198
+ var n2 = ri(), r2 = ii(), i2 = ai(), a2 = `[object Null]`, o2 = `[object Undefined]`, s2 = n2 ? n2.toStringTag : void 0;
2199
+ function c2(e3) {
2200
+ return e3 == null ? e3 === void 0 ? o2 : a2 : s2 && s2 in Object(e3) ? r2(e3) : i2(e3);
2201
+ }
2202
+ t2.exports = c2;
2203
+ });
2204
+ var si = g((e2, t2) => {
2205
+ function n2(e3) {
2206
+ return typeof e3 == `object` && !!e3;
2207
+ }
2208
+ t2.exports = n2;
2209
+ });
2210
+ var ci = g((e2, t2) => {
2211
+ var n2 = oi(), r2 = si(), i2 = `[object Symbol]`;
2212
+ function a2(e3) {
2213
+ return typeof e3 == `symbol` || r2(e3) && n2(e3) == i2;
2214
+ }
2215
+ t2.exports = a2;
2216
+ });
2217
+ var li = g((e2, t2) => {
2218
+ var n2 = ci();
2219
+ function r2(e3, t3, r3) {
2220
+ for (var i2 = -1, a2 = e3.length; ++i2 < a2; ) {
2221
+ var o2 = e3[i2], s2 = t3(o2);
2222
+ if (s2 != null && (c2 === void 0 ? s2 === s2 && !n2(s2) : r3(s2, c2))) var c2 = s2, l2 = o2;
2223
+ }
2224
+ return l2;
2225
+ }
2226
+ t2.exports = r2;
2227
+ });
2228
+ var ui = g((e2, t2) => {
2229
+ function n2(e3, t3) {
2230
+ return e3 > t3;
2231
+ }
2232
+ t2.exports = n2;
2233
+ });
2234
+ var di = g((e2, t2) => {
2235
+ function n2(e3) {
2236
+ return e3;
2237
+ }
2238
+ t2.exports = n2;
2239
+ });
2240
+ var fi = g((e2, t2) => {
2241
+ var n2 = li(), r2 = ui(), i2 = di();
2242
+ function a2(e3) {
2243
+ return e3 && e3.length ? n2(e3, i2, r2) : void 0;
2244
+ }
2245
+ t2.exports = a2;
2246
+ });
2247
+ var pi = g((e2, t2) => {
2248
+ function n2() {
2249
+ this.__data__ = [], this.size = 0;
2250
+ }
2251
+ t2.exports = n2;
2252
+ });
2253
+ var mi = g((e2, t2) => {
2254
+ function n2(e3, t3) {
2255
+ return e3 === t3 || e3 !== e3 && t3 !== t3;
2256
+ }
2257
+ t2.exports = n2;
2258
+ });
2259
+ var hi = g((e2, t2) => {
2260
+ var n2 = mi();
2261
+ function r2(e3, t3) {
2262
+ for (var r3 = e3.length; r3--; ) if (n2(e3[r3][0], t3)) return r3;
2263
+ return -1;
2264
+ }
2265
+ t2.exports = r2;
2266
+ });
2267
+ var gi = g((e2, t2) => {
2268
+ var n2 = hi(), r2 = Array.prototype.splice;
2269
+ function i2(e3) {
2270
+ var t3 = this.__data__, i3 = n2(t3, e3);
2271
+ return i3 < 0 ? false : (i3 == t3.length - 1 ? t3.pop() : r2.call(t3, i3, 1), --this.size, true);
2272
+ }
2273
+ t2.exports = i2;
2274
+ });
2275
+ var _i = g((e2, t2) => {
2276
+ var n2 = hi();
2277
+ function r2(e3) {
2278
+ var t3 = this.__data__, r3 = n2(t3, e3);
2279
+ return r3 < 0 ? void 0 : t3[r3][1];
2280
+ }
2281
+ t2.exports = r2;
2282
+ });
2283
+ var vi = g((e2, t2) => {
2284
+ var n2 = hi();
2285
+ function r2(e3) {
2286
+ return n2(this.__data__, e3) > -1;
2287
+ }
2288
+ t2.exports = r2;
2289
+ });
2290
+ var yi = g((e2, t2) => {
2291
+ var n2 = hi();
2292
+ function r2(e3, t3) {
2293
+ var r3 = this.__data__, i2 = n2(r3, e3);
2294
+ return i2 < 0 ? (++this.size, r3.push([e3, t3])) : r3[i2][1] = t3, this;
2295
+ }
2296
+ t2.exports = r2;
2297
+ });
2298
+ var bi = g((e2, t2) => {
2299
+ var n2 = pi(), r2 = gi(), i2 = _i(), a2 = vi(), o2 = yi();
2300
+ function s2(e3) {
2301
+ var t3 = -1, n3 = e3 == null ? 0 : e3.length;
2302
+ for (this.clear(); ++t3 < n3; ) {
2303
+ var r3 = e3[t3];
2304
+ this.set(r3[0], r3[1]);
2305
+ }
2306
+ }
2307
+ s2.prototype.clear = n2, s2.prototype.delete = r2, s2.prototype.get = i2, s2.prototype.has = a2, s2.prototype.set = o2, t2.exports = s2;
2308
+ });
2309
+ var xi = g((e2, t2) => {
2310
+ var n2 = bi();
2311
+ function r2() {
2312
+ this.__data__ = new n2(), this.size = 0;
2313
+ }
2314
+ t2.exports = r2;
2315
+ });
2316
+ var Si = g((e2, t2) => {
2317
+ function n2(e3) {
2318
+ var t3 = this.__data__, n3 = t3.delete(e3);
2319
+ return this.size = t3.size, n3;
2320
+ }
2321
+ t2.exports = n2;
2322
+ });
2323
+ var Ci = g((e2, t2) => {
2324
+ function n2(e3) {
2325
+ return this.__data__.get(e3);
2326
+ }
2327
+ t2.exports = n2;
2328
+ });
2329
+ var wi = g((e2, t2) => {
2330
+ function n2(e3) {
2331
+ return this.__data__.has(e3);
2332
+ }
2333
+ t2.exports = n2;
2334
+ });
2335
+ var Ti = g((e2, t2) => {
2336
+ function n2(e3) {
2337
+ var t3 = typeof e3;
2338
+ return e3 != null && (t3 == `object` || t3 == `function`);
2339
+ }
2340
+ t2.exports = n2;
2341
+ });
2342
+ var Ei = g((e2, t2) => {
2343
+ var n2 = oi(), r2 = Ti(), i2 = `[object AsyncFunction]`, a2 = `[object Function]`, o2 = `[object GeneratorFunction]`, s2 = `[object Proxy]`;
2344
+ function c2(e3) {
2345
+ if (!r2(e3)) return false;
2346
+ var t3 = n2(e3);
2347
+ return t3 == a2 || t3 == o2 || t3 == i2 || t3 == s2;
2348
+ }
2349
+ t2.exports = c2;
2350
+ });
2351
+ var Di = g((e2, t2) => {
2352
+ t2.exports = W()[`__core-js_shared__`];
2353
+ });
2354
+ var Oi = g((e2, t2) => {
2355
+ var n2 = Di(), r2 = function() {
2356
+ var e3 = /[^.]+$/.exec(n2 && n2.keys && n2.keys.IE_PROTO || ``);
2357
+ return e3 ? `Symbol(src)_1.` + e3 : ``;
2358
+ }();
2359
+ function i2(e3) {
2360
+ return !!r2 && r2 in e3;
2361
+ }
2362
+ t2.exports = i2;
2363
+ });
2364
+ var ki = g((e2, t2) => {
2365
+ var n2 = Function.prototype.toString;
2366
+ function r2(e3) {
2367
+ if (e3 != null) {
2368
+ try {
2369
+ return n2.call(e3);
2370
+ } catch {
2371
+ }
2372
+ try {
2373
+ return e3 + ``;
2374
+ } catch {
2375
+ }
2376
+ }
2377
+ return ``;
2378
+ }
2379
+ t2.exports = r2;
2380
+ });
2381
+ var Ai = g((e2, t2) => {
2382
+ var n2 = Ei(), r2 = Oi(), i2 = Ti(), a2 = ki(), o2 = /[\\^$.*+?()[\]{}|]/g, s2 = /^\[object .+?Constructor\]$/, c2 = Function.prototype, l2 = Object.prototype, u2 = c2.toString, d2 = l2.hasOwnProperty, f2 = RegExp(`^` + u2.call(d2).replace(o2, `\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, `$1.*?`) + `$`);
2383
+ function p2(e3) {
2384
+ return !i2(e3) || r2(e3) ? false : (n2(e3) ? f2 : s2).test(a2(e3));
2385
+ }
2386
+ t2.exports = p2;
2387
+ });
2388
+ var ji = g((e2, t2) => {
2389
+ function n2(e3, t3) {
2390
+ return e3?.[t3];
2391
+ }
2392
+ t2.exports = n2;
2393
+ });
2394
+ var G = g((e2, t2) => {
2395
+ var n2 = Ai(), r2 = ji();
2396
+ function i2(e3, t3) {
2397
+ var i3 = r2(e3, t3);
2398
+ return n2(i3) ? i3 : void 0;
2399
+ }
2400
+ t2.exports = i2;
2401
+ });
2402
+ var Mi = g((e2, t2) => {
2403
+ t2.exports = G()(W(), `Map`);
2404
+ });
2405
+ var Ni = g((e2, t2) => {
2406
+ t2.exports = G()(Object, `create`);
2407
+ });
2408
+ var Pi = g((e2, t2) => {
2409
+ var n2 = Ni();
2410
+ function r2() {
2411
+ this.__data__ = n2 ? n2(null) : {}, this.size = 0;
2412
+ }
2413
+ t2.exports = r2;
2414
+ });
2415
+ var Fi = g((e2, t2) => {
2416
+ function n2(e3) {
2417
+ var t3 = this.has(e3) && delete this.__data__[e3];
2418
+ return this.size -= +!!t3, t3;
2419
+ }
2420
+ t2.exports = n2;
2421
+ });
2422
+ var Ii = g((e2, t2) => {
2423
+ var n2 = Ni(), r2 = `__lodash_hash_undefined__`, i2 = Object.prototype.hasOwnProperty;
2424
+ function a2(e3) {
2425
+ var t3 = this.__data__;
2426
+ if (n2) {
2427
+ var a3 = t3[e3];
2428
+ return a3 === r2 ? void 0 : a3;
2429
+ }
2430
+ return i2.call(t3, e3) ? t3[e3] : void 0;
2431
+ }
2432
+ t2.exports = a2;
2433
+ });
2434
+ var Li = g((e2, t2) => {
2435
+ var n2 = Ni(), r2 = Object.prototype.hasOwnProperty;
2436
+ function i2(e3) {
2437
+ var t3 = this.__data__;
2438
+ return n2 ? t3[e3] !== void 0 : r2.call(t3, e3);
2439
+ }
2440
+ t2.exports = i2;
2441
+ });
2442
+ var Ri = g((e2, t2) => {
2443
+ var n2 = Ni(), r2 = `__lodash_hash_undefined__`;
2444
+ function i2(e3, t3) {
2445
+ var i3 = this.__data__;
2446
+ return this.size += +!this.has(e3), i3[e3] = n2 && t3 === void 0 ? r2 : t3, this;
2447
+ }
2448
+ t2.exports = i2;
2449
+ });
2450
+ var zi = g((e2, t2) => {
2451
+ var n2 = Pi(), r2 = Fi(), i2 = Ii(), a2 = Li(), o2 = Ri();
2452
+ function s2(e3) {
2453
+ var t3 = -1, n3 = e3 == null ? 0 : e3.length;
2454
+ for (this.clear(); ++t3 < n3; ) {
2455
+ var r3 = e3[t3];
2456
+ this.set(r3[0], r3[1]);
2457
+ }
2458
+ }
2459
+ s2.prototype.clear = n2, s2.prototype.delete = r2, s2.prototype.get = i2, s2.prototype.has = a2, s2.prototype.set = o2, t2.exports = s2;
2460
+ });
2461
+ var Bi = g((e2, t2) => {
2462
+ var n2 = zi(), r2 = bi(), i2 = Mi();
2463
+ function a2() {
2464
+ this.size = 0, this.__data__ = { hash: new n2(), map: new (i2 || r2)(), string: new n2() };
2465
+ }
2466
+ t2.exports = a2;
2467
+ });
2468
+ var Vi = g((e2, t2) => {
2469
+ function n2(e3) {
2470
+ var t3 = typeof e3;
2471
+ return t3 == `string` || t3 == `number` || t3 == `symbol` || t3 == `boolean` ? e3 !== `__proto__` : e3 === null;
2472
+ }
2473
+ t2.exports = n2;
2474
+ });
2475
+ var Hi = g((e2, t2) => {
2476
+ var n2 = Vi();
2477
+ function r2(e3, t3) {
2478
+ var r3 = e3.__data__;
2479
+ return n2(t3) ? r3[typeof t3 == `string` ? `string` : `hash`] : r3.map;
2480
+ }
2481
+ t2.exports = r2;
2482
+ });
2483
+ var Ui = g((e2, t2) => {
2484
+ var n2 = Hi();
2485
+ function r2(e3) {
2486
+ var t3 = n2(this, e3).delete(e3);
2487
+ return this.size -= +!!t3, t3;
2488
+ }
2489
+ t2.exports = r2;
2490
+ });
2491
+ var Wi = g((e2, t2) => {
2492
+ var n2 = Hi();
2493
+ function r2(e3) {
2494
+ return n2(this, e3).get(e3);
2495
+ }
2496
+ t2.exports = r2;
2497
+ });
2498
+ var Gi = g((e2, t2) => {
2499
+ var n2 = Hi();
2500
+ function r2(e3) {
2501
+ return n2(this, e3).has(e3);
2502
+ }
2503
+ t2.exports = r2;
2504
+ });
2505
+ var Ki = g((e2, t2) => {
2506
+ var n2 = Hi();
2507
+ function r2(e3, t3) {
2508
+ var r3 = n2(this, e3), i2 = r3.size;
2509
+ return r3.set(e3, t3), this.size += r3.size == i2 ? 0 : 1, this;
2510
+ }
2511
+ t2.exports = r2;
2512
+ });
2513
+ var qi = g((e2, t2) => {
2514
+ var n2 = Bi(), r2 = Ui(), i2 = Wi(), a2 = Gi(), o2 = Ki();
2515
+ function s2(e3) {
2516
+ var t3 = -1, n3 = e3 == null ? 0 : e3.length;
2517
+ for (this.clear(); ++t3 < n3; ) {
2518
+ var r3 = e3[t3];
2519
+ this.set(r3[0], r3[1]);
2520
+ }
2521
+ }
2522
+ s2.prototype.clear = n2, s2.prototype.delete = r2, s2.prototype.get = i2, s2.prototype.has = a2, s2.prototype.set = o2, t2.exports = s2;
2523
+ });
2524
+ var Ji = g((e2, t2) => {
2525
+ var n2 = bi(), r2 = Mi(), i2 = qi(), a2 = 200;
2526
+ function o2(e3, t3) {
2527
+ var o3 = this.__data__;
2528
+ if (o3 instanceof n2) {
2529
+ var s2 = o3.__data__;
2530
+ if (!r2 || s2.length < a2 - 1) return s2.push([e3, t3]), this.size = ++o3.size, this;
2531
+ o3 = this.__data__ = new i2(s2);
2532
+ }
2533
+ return o3.set(e3, t3), this.size = o3.size, this;
2534
+ }
2535
+ t2.exports = o2;
2536
+ });
2537
+ var Yi = g((e2, t2) => {
2538
+ var n2 = bi(), r2 = xi(), i2 = Si(), a2 = Ci(), o2 = wi(), s2 = Ji();
2539
+ function c2(e3) {
2540
+ var t3 = this.__data__ = new n2(e3);
2541
+ this.size = t3.size;
2542
+ }
2543
+ c2.prototype.clear = r2, c2.prototype.delete = i2, c2.prototype.get = a2, c2.prototype.has = o2, c2.prototype.set = s2, t2.exports = c2;
2544
+ });
2545
+ var Xi = g((e2, t2) => {
2546
+ function n2(e3) {
2547
+ return this.__data__.set(e3, `__lodash_hash_undefined__`), this;
2548
+ }
2549
+ t2.exports = n2;
2550
+ });
2551
+ var Zi = g((e2, t2) => {
2552
+ function n2(e3) {
2553
+ return this.__data__.has(e3);
2554
+ }
2555
+ t2.exports = n2;
2556
+ });
2557
+ var Qi = g((e2, t2) => {
2558
+ var n2 = qi(), r2 = Xi(), i2 = Zi();
2559
+ function a2(e3) {
2560
+ var t3 = -1, r3 = e3 == null ? 0 : e3.length;
2561
+ for (this.__data__ = new n2(); ++t3 < r3; ) this.add(e3[t3]);
2562
+ }
2563
+ a2.prototype.add = a2.prototype.push = r2, a2.prototype.has = i2, t2.exports = a2;
2564
+ });
2565
+ var $i = g((e2, t2) => {
2566
+ function n2(e3, t3) {
2567
+ for (var n3 = -1, r2 = e3 == null ? 0 : e3.length; ++n3 < r2; ) if (t3(e3[n3], n3, e3)) return true;
2568
+ return false;
2569
+ }
2570
+ t2.exports = n2;
2571
+ });
2572
+ var ea = g((e2, t2) => {
2573
+ function n2(e3, t3) {
2574
+ return e3.has(t3);
2575
+ }
2576
+ t2.exports = n2;
2577
+ });
2578
+ var ta = g((e2, t2) => {
2579
+ var n2 = Qi(), r2 = $i(), i2 = ea(), a2 = 1, o2 = 2;
2580
+ function s2(e3, t3, s3, c2, l2, u2) {
2581
+ var d2 = s3 & a2, f2 = e3.length, p2 = t3.length;
2582
+ if (f2 != p2 && !(d2 && p2 > f2)) return false;
2583
+ var m2 = u2.get(e3), h2 = u2.get(t3);
2584
+ if (m2 && h2) return m2 == t3 && h2 == e3;
2585
+ var g2 = -1, _2 = true, v2 = s3 & o2 ? new n2() : void 0;
2586
+ for (u2.set(e3, t3), u2.set(t3, e3); ++g2 < f2; ) {
2587
+ var y2 = e3[g2], b2 = t3[g2];
2588
+ if (c2) var x2 = d2 ? c2(b2, y2, g2, t3, e3, u2) : c2(y2, b2, g2, e3, t3, u2);
2589
+ if (x2 !== void 0) {
2590
+ if (x2) continue;
2591
+ _2 = false;
2592
+ break;
2593
+ }
2594
+ if (v2) {
2595
+ if (!r2(t3, function(e4, t4) {
2596
+ if (!i2(v2, t4) && (y2 === e4 || l2(y2, e4, s3, c2, u2))) return v2.push(t4);
2597
+ })) {
2598
+ _2 = false;
2599
+ break;
2600
+ }
2601
+ } else if (!(y2 === b2 || l2(y2, b2, s3, c2, u2))) {
2602
+ _2 = false;
2603
+ break;
2604
+ }
2605
+ }
2606
+ return u2.delete(e3), u2.delete(t3), _2;
2607
+ }
2608
+ t2.exports = s2;
2609
+ });
2610
+ var na = g((e2, t2) => {
2611
+ t2.exports = W().Uint8Array;
2612
+ });
2613
+ var ra = g((e2, t2) => {
2614
+ function n2(e3) {
2615
+ var t3 = -1, n3 = Array(e3.size);
2616
+ return e3.forEach(function(e4, r2) {
2617
+ n3[++t3] = [r2, e4];
2618
+ }), n3;
2619
+ }
2620
+ t2.exports = n2;
2621
+ });
2622
+ var ia = g((e2, t2) => {
2623
+ function n2(e3) {
2624
+ var t3 = -1, n3 = Array(e3.size);
2625
+ return e3.forEach(function(e4) {
2626
+ n3[++t3] = e4;
2627
+ }), n3;
2628
+ }
2629
+ t2.exports = n2;
2630
+ });
2631
+ var aa = g((e2, t2) => {
2632
+ var n2 = ri(), r2 = na(), i2 = mi(), a2 = ta(), o2 = ra(), s2 = ia(), c2 = 1, l2 = 2, u2 = `[object Boolean]`, d2 = `[object Date]`, f2 = `[object Error]`, p2 = `[object Map]`, m2 = `[object Number]`, h2 = `[object RegExp]`, g2 = `[object Set]`, _2 = `[object String]`, v2 = `[object Symbol]`, y2 = `[object ArrayBuffer]`, b2 = `[object DataView]`, x2 = n2 ? n2.prototype : void 0, S2 = x2 ? x2.valueOf : void 0;
2633
+ function C2(e3, t3, n3, x3, C3, w2, T2) {
2634
+ switch (n3) {
2635
+ case b2:
2636
+ if (e3.byteLength != t3.byteLength || e3.byteOffset != t3.byteOffset) return false;
2637
+ e3 = e3.buffer, t3 = t3.buffer;
2638
+ case y2:
2639
+ return !(e3.byteLength != t3.byteLength || !w2(new r2(e3), new r2(t3)));
2640
+ case u2:
2641
+ case d2:
2642
+ case m2:
2643
+ return i2(+e3, +t3);
2644
+ case f2:
2645
+ return e3.name == t3.name && e3.message == t3.message;
2646
+ case h2:
2647
+ case _2:
2648
+ return e3 == t3 + ``;
2649
+ case p2:
2650
+ var E2 = o2;
2651
+ case g2:
2652
+ var D2 = x3 & c2;
2653
+ if (E2 ||= s2, e3.size != t3.size && !D2) return false;
2654
+ var O2 = T2.get(e3);
2655
+ if (O2) return O2 == t3;
2656
+ x3 |= l2, T2.set(e3, t3);
2657
+ var k2 = a2(E2(e3), E2(t3), x3, C3, w2, T2);
2658
+ return T2.delete(e3), k2;
2659
+ case v2:
2660
+ if (S2) return S2.call(e3) == S2.call(t3);
2661
+ }
2662
+ return false;
2663
+ }
2664
+ t2.exports = C2;
2665
+ });
2666
+ var oa = g((e2, t2) => {
2667
+ function n2(e3, t3) {
2668
+ for (var n3 = -1, r2 = t3.length, i2 = e3.length; ++n3 < r2; ) e3[i2 + n3] = t3[n3];
2669
+ return e3;
2670
+ }
2671
+ t2.exports = n2;
2672
+ });
2673
+ var K = g((e2, t2) => {
2674
+ t2.exports = Array.isArray;
2675
+ });
2676
+ var sa = g((e2, t2) => {
2677
+ var n2 = oa(), r2 = K();
2678
+ function i2(e3, t3, i3) {
2679
+ var a2 = t3(e3);
2680
+ return r2(e3) ? a2 : n2(a2, i3(e3));
2681
+ }
2682
+ t2.exports = i2;
2683
+ });
2684
+ var ca = g((e2, t2) => {
2685
+ function n2(e3, t3) {
2686
+ for (var n3 = -1, r2 = e3 == null ? 0 : e3.length, i2 = 0, a2 = []; ++n3 < r2; ) {
2687
+ var o2 = e3[n3];
2688
+ t3(o2, n3, e3) && (a2[i2++] = o2);
2689
+ }
2690
+ return a2;
2691
+ }
2692
+ t2.exports = n2;
2693
+ });
2694
+ var la = g((e2, t2) => {
2695
+ function n2() {
2696
+ return [];
2697
+ }
2698
+ t2.exports = n2;
2699
+ });
2700
+ var ua = g((e2, t2) => {
2701
+ var n2 = ca(), r2 = la(), i2 = Object.prototype.propertyIsEnumerable, a2 = Object.getOwnPropertySymbols;
2702
+ t2.exports = a2 ? function(e3) {
2703
+ return e3 == null ? [] : (e3 = Object(e3), n2(a2(e3), function(t3) {
2704
+ return i2.call(e3, t3);
2705
+ }));
2706
+ } : r2;
2707
+ });
2708
+ var da = g((e2, t2) => {
2709
+ function n2(e3, t3) {
2710
+ for (var n3 = -1, r2 = Array(e3); ++n3 < e3; ) r2[n3] = t3(n3);
2711
+ return r2;
2712
+ }
2713
+ t2.exports = n2;
2714
+ });
2715
+ var fa = g((e2, t2) => {
2716
+ var n2 = oi(), r2 = si(), i2 = `[object Arguments]`;
2717
+ function a2(e3) {
2718
+ return r2(e3) && n2(e3) == i2;
2719
+ }
2720
+ t2.exports = a2;
2721
+ });
2722
+ var pa = g((e2, t2) => {
2723
+ var n2 = fa(), r2 = si(), i2 = Object.prototype, a2 = i2.hasOwnProperty, o2 = i2.propertyIsEnumerable;
2724
+ t2.exports = n2(/* @__PURE__ */ function() {
2725
+ return arguments;
2726
+ }()) ? n2 : function(e3) {
2727
+ return r2(e3) && a2.call(e3, `callee`) && !o2.call(e3, `callee`);
2728
+ };
2729
+ });
2730
+ var ma = g((e2, t2) => {
2731
+ function n2() {
2732
+ return false;
2733
+ }
2734
+ t2.exports = n2;
2735
+ });
2736
+ var ha = g((e2, t2) => {
2737
+ var n2 = W(), r2 = ma(), i2 = typeof e2 == `object` && e2 && !e2.nodeType && e2, a2 = i2 && typeof t2 == `object` && t2 && !t2.nodeType && t2, o2 = a2 && a2.exports === i2 ? n2.Buffer : void 0;
2738
+ t2.exports = (o2 ? o2.isBuffer : void 0) || r2;
2739
+ });
2740
+ var ga = g((e2, t2) => {
2741
+ var n2 = /^(?:0|[1-9]\d*)$/;
2742
+ function r2(e3, t3) {
2743
+ var r3 = typeof e3;
2744
+ return t3 ??= 9007199254740991, !!t3 && (r3 == `number` || r3 != `symbol` && n2.test(e3)) && e3 > -1 && e3 % 1 == 0 && e3 < t3;
2745
+ }
2746
+ t2.exports = r2;
2747
+ });
2748
+ var _a = g((e2, t2) => {
2749
+ function n2(e3) {
2750
+ return typeof e3 == `number` && e3 > -1 && e3 % 1 == 0 && e3 <= 9007199254740991;
2751
+ }
2752
+ t2.exports = n2;
2753
+ });
2754
+ var va = g((e2, t2) => {
2755
+ var n2 = oi(), r2 = _a(), i2 = si(), a2 = `[object Arguments]`, o2 = `[object Array]`, s2 = `[object Boolean]`, c2 = `[object Date]`, l2 = `[object Error]`, u2 = `[object Function]`, d2 = `[object Map]`, f2 = `[object Number]`, p2 = `[object Object]`, m2 = `[object RegExp]`, h2 = `[object Set]`, g2 = `[object String]`, _2 = `[object WeakMap]`, v2 = `[object ArrayBuffer]`, y2 = `[object DataView]`, b2 = `[object Float32Array]`, x2 = `[object Float64Array]`, S2 = `[object Int8Array]`, C2 = `[object Int16Array]`, w2 = `[object Int32Array]`, T2 = `[object Uint8Array]`, E2 = `[object Uint8ClampedArray]`, D2 = `[object Uint16Array]`, O2 = `[object Uint32Array]`, k2 = {};
2756
+ k2[b2] = k2[x2] = k2[S2] = k2[C2] = k2[w2] = k2[T2] = k2[E2] = k2[D2] = k2[O2] = true, k2[a2] = k2[o2] = k2[v2] = k2[s2] = k2[y2] = k2[c2] = k2[l2] = k2[u2] = k2[d2] = k2[f2] = k2[p2] = k2[m2] = k2[h2] = k2[g2] = k2[_2] = false;
2757
+ function ee2(e3) {
2758
+ return i2(e3) && r2(e3.length) && !!k2[n2(e3)];
2759
+ }
2760
+ t2.exports = ee2;
2761
+ });
2762
+ var ya = g((e2, t2) => {
2763
+ function n2(e3) {
2764
+ return function(t3) {
2765
+ return e3(t3);
2766
+ };
2767
+ }
2768
+ t2.exports = n2;
2769
+ });
2770
+ var ba = g((e2, t2) => {
2771
+ var n2 = ni(), r2 = typeof e2 == `object` && e2 && !e2.nodeType && e2, i2 = r2 && typeof t2 == `object` && t2 && !t2.nodeType && t2, a2 = i2 && i2.exports === r2 && n2.process;
2772
+ t2.exports = function() {
2773
+ try {
2774
+ return i2 && i2.require && i2.require(`util`).types || a2 && a2.binding && a2.binding(`util`);
2775
+ } catch {
2776
+ }
2777
+ }();
2778
+ });
2779
+ var xa = g((e2, t2) => {
2780
+ var n2 = va(), r2 = ya(), i2 = ba(), a2 = i2 && i2.isTypedArray;
2781
+ t2.exports = a2 ? r2(a2) : n2;
2782
+ });
2783
+ var Sa = g((e2, t2) => {
2784
+ var n2 = da(), r2 = pa(), i2 = K(), a2 = ha(), o2 = ga(), s2 = xa(), c2 = Object.prototype.hasOwnProperty;
2785
+ function l2(e3, t3) {
2786
+ var l3 = i2(e3), u2 = !l3 && r2(e3), d2 = !l3 && !u2 && a2(e3), f2 = !l3 && !u2 && !d2 && s2(e3), p2 = l3 || u2 || d2 || f2, m2 = p2 ? n2(e3.length, String) : [], h2 = m2.length;
2787
+ for (var g2 in e3) (t3 || c2.call(e3, g2)) && !(p2 && (g2 == `length` || d2 && (g2 == `offset` || g2 == `parent`) || f2 && (g2 == `buffer` || g2 == `byteLength` || g2 == `byteOffset`) || o2(g2, h2))) && m2.push(g2);
2788
+ return m2;
2789
+ }
2790
+ t2.exports = l2;
2791
+ });
2792
+ var Ca = g((e2, t2) => {
2793
+ var n2 = Object.prototype;
2794
+ function r2(e3) {
2795
+ var t3 = e3 && e3.constructor;
2796
+ return e3 === (typeof t3 == `function` && t3.prototype || n2);
2797
+ }
2798
+ t2.exports = r2;
2799
+ });
2800
+ var wa = g((e2, t2) => {
2801
+ function n2(e3, t3) {
2802
+ return function(n3) {
2803
+ return e3(t3(n3));
2804
+ };
2805
+ }
2806
+ t2.exports = n2;
2807
+ });
2808
+ var Ta = g((e2, t2) => {
2809
+ t2.exports = wa()(Object.keys, Object);
2810
+ });
2811
+ var Ea = g((e2, t2) => {
2812
+ var n2 = Ca(), r2 = Ta(), i2 = Object.prototype.hasOwnProperty;
2813
+ function a2(e3) {
2814
+ if (!n2(e3)) return r2(e3);
2815
+ var t3 = [];
2816
+ for (var a3 in Object(e3)) i2.call(e3, a3) && a3 != `constructor` && t3.push(a3);
2817
+ return t3;
2818
+ }
2819
+ t2.exports = a2;
2820
+ });
2821
+ var Da = g((e2, t2) => {
2822
+ var n2 = Ei(), r2 = _a();
2823
+ function i2(e3) {
2824
+ return e3 != null && r2(e3.length) && !n2(e3);
2825
+ }
2826
+ t2.exports = i2;
2827
+ });
2828
+ var Oa = g((e2, t2) => {
2829
+ var n2 = Sa(), r2 = Ea(), i2 = Da();
2830
+ function a2(e3) {
2831
+ return i2(e3) ? n2(e3) : r2(e3);
2832
+ }
2833
+ t2.exports = a2;
2834
+ });
2835
+ var ka = g((e2, t2) => {
2836
+ var n2 = sa(), r2 = ua(), i2 = Oa();
2837
+ function a2(e3) {
2838
+ return n2(e3, i2, r2);
2839
+ }
2840
+ t2.exports = a2;
2841
+ });
2842
+ var Aa = g((e2, t2) => {
2843
+ var n2 = ka(), r2 = 1, i2 = Object.prototype.hasOwnProperty;
2844
+ function a2(e3, t3, a3, o2, s2, c2) {
2845
+ var l2 = a3 & r2, u2 = n2(e3), d2 = u2.length;
2846
+ if (d2 != n2(t3).length && !l2) return false;
2847
+ for (var f2 = d2; f2--; ) {
2848
+ var p2 = u2[f2];
2849
+ if (!(l2 ? p2 in t3 : i2.call(t3, p2))) return false;
2850
+ }
2851
+ var m2 = c2.get(e3), h2 = c2.get(t3);
2852
+ if (m2 && h2) return m2 == t3 && h2 == e3;
2853
+ var g2 = true;
2854
+ c2.set(e3, t3), c2.set(t3, e3);
2855
+ for (var _2 = l2; ++f2 < d2; ) {
2856
+ p2 = u2[f2];
2857
+ var v2 = e3[p2], y2 = t3[p2];
2858
+ if (o2) var b2 = l2 ? o2(y2, v2, p2, t3, e3, c2) : o2(v2, y2, p2, e3, t3, c2);
2859
+ if (!(b2 === void 0 ? v2 === y2 || s2(v2, y2, a3, o2, c2) : b2)) {
2860
+ g2 = false;
2861
+ break;
2862
+ }
2863
+ _2 ||= p2 == `constructor`;
2864
+ }
2865
+ if (g2 && !_2) {
2866
+ var x2 = e3.constructor, S2 = t3.constructor;
2867
+ x2 != S2 && `constructor` in e3 && `constructor` in t3 && !(typeof x2 == `function` && x2 instanceof x2 && typeof S2 == `function` && S2 instanceof S2) && (g2 = false);
2868
+ }
2869
+ return c2.delete(e3), c2.delete(t3), g2;
2870
+ }
2871
+ t2.exports = a2;
2872
+ });
2873
+ var ja = g((e2, t2) => {
2874
+ t2.exports = G()(W(), `DataView`);
2875
+ });
2876
+ var Ma = g((e2, t2) => {
2877
+ t2.exports = G()(W(), `Promise`);
2878
+ });
2879
+ var Na = g((e2, t2) => {
2880
+ t2.exports = G()(W(), `Set`);
2881
+ });
2882
+ var Pa = g((e2, t2) => {
2883
+ t2.exports = G()(W(), `WeakMap`);
2884
+ });
2885
+ var Fa = g((e2, t2) => {
2886
+ var n2 = ja(), r2 = Mi(), i2 = Ma(), a2 = Na(), o2 = Pa(), s2 = oi(), c2 = ki(), l2 = `[object Map]`, u2 = `[object Object]`, d2 = `[object Promise]`, f2 = `[object Set]`, p2 = `[object WeakMap]`, m2 = `[object DataView]`, h2 = c2(n2), g2 = c2(r2), _2 = c2(i2), v2 = c2(a2), y2 = c2(o2), b2 = s2;
2887
+ (n2 && b2(new n2(new ArrayBuffer(1))) != m2 || r2 && b2(new r2()) != l2 || i2 && b2(i2.resolve()) != d2 || a2 && b2(new a2()) != f2 || o2 && b2(new o2()) != p2) && (b2 = function(e3) {
2888
+ var t3 = s2(e3), n3 = t3 == u2 ? e3.constructor : void 0, r3 = n3 ? c2(n3) : ``;
2889
+ if (r3) switch (r3) {
2890
+ case h2:
2891
+ return m2;
2892
+ case g2:
2893
+ return l2;
2894
+ case _2:
2895
+ return d2;
2896
+ case v2:
2897
+ return f2;
2898
+ case y2:
2899
+ return p2;
2900
+ }
2901
+ return t3;
2902
+ }), t2.exports = b2;
2903
+ });
2904
+ var Ia = g((e2, t2) => {
2905
+ var n2 = Yi(), r2 = ta(), i2 = aa(), a2 = Aa(), o2 = Fa(), s2 = K(), c2 = ha(), l2 = xa(), u2 = 1, d2 = `[object Arguments]`, f2 = `[object Array]`, p2 = `[object Object]`, m2 = Object.prototype.hasOwnProperty;
2906
+ function h2(e3, t3, h3, g2, _2, v2) {
2907
+ var y2 = s2(e3), b2 = s2(t3), x2 = y2 ? f2 : o2(e3), S2 = b2 ? f2 : o2(t3);
2908
+ x2 = x2 == d2 ? p2 : x2, S2 = S2 == d2 ? p2 : S2;
2909
+ var C2 = x2 == p2, w2 = S2 == p2, T2 = x2 == S2;
2910
+ if (T2 && c2(e3)) {
2911
+ if (!c2(t3)) return false;
2912
+ y2 = true, C2 = false;
2913
+ }
2914
+ if (T2 && !C2) return v2 ||= new n2(), y2 || l2(e3) ? r2(e3, t3, h3, g2, _2, v2) : i2(e3, t3, x2, h3, g2, _2, v2);
2915
+ if (!(h3 & u2)) {
2916
+ var E2 = C2 && m2.call(e3, `__wrapped__`), D2 = w2 && m2.call(t3, `__wrapped__`);
2917
+ if (E2 || D2) {
2918
+ var O2 = E2 ? e3.value() : e3, k2 = D2 ? t3.value() : t3;
2919
+ return v2 ||= new n2(), _2(O2, k2, h3, g2, v2);
2920
+ }
2921
+ }
2922
+ return T2 ? (v2 ||= new n2(), a2(e3, t3, h3, g2, _2, v2)) : false;
2923
+ }
2924
+ t2.exports = h2;
2925
+ });
2926
+ var La = g((e2, t2) => {
2927
+ var n2 = Ia(), r2 = si();
2928
+ function i2(e3, t3, a2, o2, s2) {
2929
+ return e3 === t3 ? true : e3 == null || t3 == null || !r2(e3) && !r2(t3) ? e3 !== e3 && t3 !== t3 : n2(e3, t3, a2, o2, i2, s2);
2930
+ }
2931
+ t2.exports = i2;
2932
+ });
2933
+ var Ra = g((e2, t2) => {
2934
+ var n2 = Yi(), r2 = La(), i2 = 1, a2 = 2;
2935
+ function o2(e3, t3, o3, s2) {
2936
+ var c2 = o3.length, l2 = c2, u2 = !s2;
2937
+ if (e3 == null) return !l2;
2938
+ for (e3 = Object(e3); c2--; ) {
2939
+ var d2 = o3[c2];
2940
+ if (u2 && d2[2] ? d2[1] !== e3[d2[0]] : !(d2[0] in e3)) return false;
2941
+ }
2942
+ for (; ++c2 < l2; ) {
2943
+ d2 = o3[c2];
2944
+ var f2 = d2[0], p2 = e3[f2], m2 = d2[1];
2945
+ if (u2 && d2[2]) {
2946
+ if (p2 === void 0 && !(f2 in e3)) return false;
2947
+ } else {
2948
+ var h2 = new n2();
2949
+ if (s2) var g2 = s2(p2, m2, f2, e3, t3, h2);
2950
+ if (!(g2 === void 0 ? r2(m2, p2, i2 | a2, s2, h2) : g2)) return false;
2951
+ }
2952
+ }
2953
+ return true;
2954
+ }
2955
+ t2.exports = o2;
2956
+ });
2957
+ var za = g((e2, t2) => {
2958
+ var n2 = Ti();
2959
+ function r2(e3) {
2960
+ return e3 === e3 && !n2(e3);
2961
+ }
2962
+ t2.exports = r2;
2963
+ });
2964
+ var Ba = g((e2, t2) => {
2965
+ var n2 = za(), r2 = Oa();
2966
+ function i2(e3) {
2967
+ for (var t3 = r2(e3), i3 = t3.length; i3--; ) {
2968
+ var a2 = t3[i3], o2 = e3[a2];
2969
+ t3[i3] = [a2, o2, n2(o2)];
2970
+ }
2971
+ return t3;
2972
+ }
2973
+ t2.exports = i2;
2974
+ });
2975
+ var Va = g((e2, t2) => {
2976
+ function n2(e3, t3) {
2977
+ return function(n3) {
2978
+ return n3 != null && n3[e3] === t3 && (t3 !== void 0 || e3 in Object(n3));
2979
+ };
2980
+ }
2981
+ t2.exports = n2;
2982
+ });
2983
+ var Ha = g((e2, t2) => {
2984
+ var n2 = Ra(), r2 = Ba(), i2 = Va();
2985
+ function a2(e3) {
2986
+ var t3 = r2(e3);
2987
+ return t3.length == 1 && t3[0][2] ? i2(t3[0][0], t3[0][1]) : function(r3) {
2988
+ return r3 === e3 || n2(r3, e3, t3);
2989
+ };
2990
+ }
2991
+ t2.exports = a2;
2992
+ });
2993
+ var Ua = g((e2, t2) => {
2994
+ var n2 = K(), r2 = ci(), i2 = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, a2 = /^\w*$/;
2995
+ function o2(e3, t3) {
2996
+ if (n2(e3)) return false;
2997
+ var o3 = typeof e3;
2998
+ return o3 == `number` || o3 == `symbol` || o3 == `boolean` || e3 == null || r2(e3) ? true : a2.test(e3) || !i2.test(e3) || t3 != null && e3 in Object(t3);
2999
+ }
3000
+ t2.exports = o2;
3001
+ });
3002
+ var Wa = g((e2, t2) => {
3003
+ var n2 = qi(), r2 = `Expected a function`;
3004
+ function i2(e3, t3) {
3005
+ if (typeof e3 != `function` || t3 != null && typeof t3 != `function`) throw TypeError(r2);
3006
+ var a2 = function() {
3007
+ var n3 = arguments, r3 = t3 ? t3.apply(this, n3) : n3[0], i3 = a2.cache;
3008
+ if (i3.has(r3)) return i3.get(r3);
3009
+ var o2 = e3.apply(this, n3);
3010
+ return a2.cache = i3.set(r3, o2) || i3, o2;
3011
+ };
3012
+ return a2.cache = new (i2.Cache || n2)(), a2;
3013
+ }
3014
+ i2.Cache = n2, t2.exports = i2;
3015
+ });
3016
+ var Ga = g((e2, t2) => {
3017
+ var n2 = Wa(), r2 = 500;
3018
+ function i2(e3) {
3019
+ var t3 = n2(e3, function(e4) {
3020
+ return i3.size === r2 && i3.clear(), e4;
3021
+ }), i3 = t3.cache;
3022
+ return t3;
3023
+ }
3024
+ t2.exports = i2;
3025
+ });
3026
+ var Ka = g((e2, t2) => {
3027
+ var n2 = Ga(), r2 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, i2 = /\\(\\)?/g;
3028
+ t2.exports = n2(function(e3) {
3029
+ var t3 = [];
3030
+ return e3.charCodeAt(0) === 46 && t3.push(``), e3.replace(r2, function(e4, n3, r3, a2) {
3031
+ t3.push(r3 ? a2.replace(i2, `$1`) : n3 || e4);
3032
+ }), t3;
3033
+ });
3034
+ });
3035
+ var qa = g((e2, t2) => {
3036
+ function n2(e3, t3) {
3037
+ for (var n3 = -1, r2 = e3 == null ? 0 : e3.length, i2 = Array(r2); ++n3 < r2; ) i2[n3] = t3(e3[n3], n3, e3);
3038
+ return i2;
3039
+ }
3040
+ t2.exports = n2;
3041
+ });
3042
+ var Ja = g((e2, t2) => {
3043
+ var n2 = ri(), r2 = qa(), i2 = K(), a2 = ci(), o2 = 1 / 0, s2 = n2 ? n2.prototype : void 0, c2 = s2 ? s2.toString : void 0;
3044
+ function l2(e3) {
3045
+ if (typeof e3 == `string`) return e3;
3046
+ if (i2(e3)) return r2(e3, l2) + ``;
3047
+ if (a2(e3)) return c2 ? c2.call(e3) : ``;
3048
+ var t3 = e3 + ``;
3049
+ return t3 == `0` && 1 / e3 == -o2 ? `-0` : t3;
3050
+ }
3051
+ t2.exports = l2;
3052
+ });
3053
+ var Ya = g((e2, t2) => {
3054
+ var n2 = Ja();
3055
+ function r2(e3) {
3056
+ return e3 == null ? `` : n2(e3);
3057
+ }
3058
+ t2.exports = r2;
3059
+ });
3060
+ var Xa = g((e2, t2) => {
3061
+ var n2 = K(), r2 = Ua(), i2 = Ka(), a2 = Ya();
3062
+ function o2(e3, t3) {
3063
+ return n2(e3) ? e3 : r2(e3, t3) ? [e3] : i2(a2(e3));
3064
+ }
3065
+ t2.exports = o2;
3066
+ });
3067
+ var Za = g((e2, t2) => {
3068
+ var n2 = ci(), r2 = 1 / 0;
3069
+ function i2(e3) {
3070
+ if (typeof e3 == `string` || n2(e3)) return e3;
3071
+ var t3 = e3 + ``;
3072
+ return t3 == `0` && 1 / e3 == -r2 ? `-0` : t3;
3073
+ }
3074
+ t2.exports = i2;
3075
+ });
3076
+ var Qa = g((e2, t2) => {
3077
+ var n2 = Xa(), r2 = Za();
3078
+ function i2(e3, t3) {
3079
+ t3 = n2(t3, e3);
3080
+ for (var i3 = 0, a2 = t3.length; e3 != null && i3 < a2; ) e3 = e3[r2(t3[i3++])];
3081
+ return i3 && i3 == a2 ? e3 : void 0;
3082
+ }
3083
+ t2.exports = i2;
3084
+ });
3085
+ var $a = g((e2, t2) => {
3086
+ var n2 = Qa();
3087
+ function r2(e3, t3, r3) {
3088
+ var i2 = e3 == null ? void 0 : n2(e3, t3);
3089
+ return i2 === void 0 ? r3 : i2;
3090
+ }
3091
+ t2.exports = r2;
3092
+ });
3093
+ var eo = g((e2, t2) => {
3094
+ function n2(e3, t3) {
3095
+ return e3 != null && t3 in Object(e3);
3096
+ }
3097
+ t2.exports = n2;
3098
+ });
3099
+ var to = g((e2, t2) => {
3100
+ var n2 = Xa(), r2 = pa(), i2 = K(), a2 = ga(), o2 = _a(), s2 = Za();
3101
+ function c2(e3, t3, c3) {
3102
+ t3 = n2(t3, e3);
3103
+ for (var l2 = -1, u2 = t3.length, d2 = false; ++l2 < u2; ) {
3104
+ var f2 = s2(t3[l2]);
3105
+ if (!(d2 = e3 != null && c3(e3, f2))) break;
3106
+ e3 = e3[f2];
3107
+ }
3108
+ return d2 || ++l2 != u2 ? d2 : (u2 = e3 == null ? 0 : e3.length, !!u2 && o2(u2) && a2(f2, u2) && (i2(e3) || r2(e3)));
3109
+ }
3110
+ t2.exports = c2;
3111
+ });
3112
+ var no = g((e2, t2) => {
3113
+ var n2 = eo(), r2 = to();
3114
+ function i2(e3, t3) {
3115
+ return e3 != null && r2(e3, t3, n2);
3116
+ }
3117
+ t2.exports = i2;
3118
+ });
3119
+ var ro = g((e2, t2) => {
3120
+ var n2 = La(), r2 = $a(), i2 = no(), a2 = Ua(), o2 = za(), s2 = Va(), c2 = Za(), l2 = 1, u2 = 2;
3121
+ function d2(e3, t3) {
3122
+ return a2(e3) && o2(t3) ? s2(c2(e3), t3) : function(a3) {
3123
+ var o3 = r2(a3, e3);
3124
+ return o3 === void 0 && o3 === t3 ? i2(a3, e3) : n2(t3, o3, l2 | u2);
3125
+ };
3126
+ }
3127
+ t2.exports = d2;
3128
+ });
3129
+ var io = g((e2, t2) => {
3130
+ function n2(e3) {
3131
+ return function(t3) {
3132
+ return t3?.[e3];
3133
+ };
3134
+ }
3135
+ t2.exports = n2;
3136
+ });
3137
+ var ao = g((e2, t2) => {
3138
+ var n2 = Qa();
3139
+ function r2(e3) {
3140
+ return function(t3) {
3141
+ return n2(t3, e3);
3142
+ };
3143
+ }
3144
+ t2.exports = r2;
3145
+ });
3146
+ var oo = g((e2, t2) => {
3147
+ var n2 = io(), r2 = ao(), i2 = Ua(), a2 = Za();
3148
+ function o2(e3) {
3149
+ return i2(e3) ? n2(a2(e3)) : r2(e3);
3150
+ }
3151
+ t2.exports = o2;
3152
+ });
3153
+ var so = g((e2, t2) => {
3154
+ var n2 = Ha(), r2 = ro(), i2 = di(), a2 = K(), o2 = oo();
3155
+ function s2(e3) {
3156
+ return typeof e3 == `function` ? e3 : e3 == null ? i2 : typeof e3 == `object` ? a2(e3) ? r2(e3[0], e3[1]) : n2(e3) : o2(e3);
3157
+ }
3158
+ t2.exports = s2;
3159
+ });
3160
+ var co = g((e2, t2) => {
3161
+ var n2 = li(), r2 = ui(), i2 = so();
3162
+ function a2(e3, t3) {
3163
+ return e3 && e3.length ? n2(e3, i2(t3, 2), r2) : void 0;
3164
+ }
3165
+ t2.exports = a2;
3166
+ });
3167
+ var lo = g((e2, t2) => {
3168
+ function n2(e3, t3) {
3169
+ return e3 < t3;
3170
+ }
3171
+ t2.exports = n2;
3172
+ });
3173
+ var uo = g((e2, t2) => {
3174
+ var n2 = li(), r2 = lo(), i2 = di();
3175
+ function a2(e3) {
3176
+ return e3 && e3.length ? n2(e3, i2, r2) : void 0;
3177
+ }
3178
+ t2.exports = a2;
3179
+ });
3180
+ var fo = g((e2, t2) => {
3181
+ var n2 = li(), r2 = so(), i2 = lo();
3182
+ function a2(e3, t3) {
3183
+ return e3 && e3.length ? n2(e3, r2(t3, 2), i2) : void 0;
3184
+ }
3185
+ t2.exports = a2;
3186
+ });
3187
+ var po = v(fi(), 1);
3188
+ var mo = v(co(), 1);
3189
+ var ho = v(uo(), 1);
3190
+ var go = v(fo(), 1);
3191
+ var _o = ({ price: e2 }) => e2.actualPrice;
3192
+ function vo(e2) {
3193
+ return e2.priceAfterDiscount === void 0 ? { currentSellingPrice: e2.actualPrice, priceBeforeDiscount: e2.compareAtPrice, pricePerUnit: e2.pricePerUnit } : { currentSellingPrice: e2.priceAfterDiscount, priceBeforeDiscount: e2.actualPrice, pricePerUnit: e2.pricePerUnit };
3194
+ }
3195
+ function yo(e2, t2) {
3196
+ let n2 = e2.subscriptionPrices.find((e3) => e3.subscriptionId === t2);
3197
+ if (!n2) throw Error(`Missing subscription price for plan ${t2} on variant ${e2.id}`);
3198
+ let r2 = n2.price;
3199
+ return { currentSellingPrice: r2, priceBeforeDiscount: r2 < e2.price.actualPrice ? e2.price.actualPrice : void 0 };
3200
+ }
3201
+ function bo(e2) {
3202
+ let t2 = (0, go.default)(e2, _o), n2 = (0, mo.default)(e2, _o), r2 = e2.map(({ price: e3 }) => vo(e3)), i2 = vo(t2.price), a2 = vo(n2.price), o2 = r2.flatMap(({ priceBeforeDiscount: e3 }) => e3 === void 0 ? [] : [e3]);
3203
+ return { minCurrentSellingPrice: i2.currentSellingPrice, maxCurrentSellingPrice: a2.currentSellingPrice, minPriceBeforeDiscount: (0, ho.default)(o2), maxPriceBeforeDiscount: (0, po.default)(o2), minPricePerUnit: i2.pricePerUnit, maxPricePerUnit: a2.pricePerUnit };
3204
+ }
3205
+ function xo(e2, t2) {
3206
+ return e2.subscriptionDetails.subscriptions.map((e3) => ({ subscription: e3, price: yo(t2, e3.id) }));
3207
+ }
3208
+ function So(e2) {
3209
+ return { productPrice: { currentSellingPrice: void 0 }, subscriptionPlanPrices: e2.subscriptionDetails.subscriptions.map((e3) => ({ subscription: e3, price: { currentSellingPrice: void 0 } })), productPriceRange: { minCurrentSellingPrice: void 0, maxCurrentSellingPrice: void 0 } };
3210
+ }
3211
+ function Co(e2) {
3212
+ if (!e2.minPriceVariant) return So(e2);
3213
+ let t2 = vo(e2.minPriceVariant.price), n2 = e2.minPriceVariant.price.priceAfterDiscount !== void 0;
3214
+ return { productPrice: t2, subscriptionPlanPrices: e2.subscriptionDetails.subscriptions.map((e3) => ({ subscription: e3, price: {} })), productPriceRange: { minCurrentSellingPrice: t2.currentSellingPrice, maxCurrentSellingPrice: n2 ? void 0 : e2.priceRange.maxActualPrice, minPriceBeforeDiscount: t2.priceBeforeDiscount, maxPriceBeforeDiscount: n2 ? e2.priceRange.maxActualPrice : e2.priceRange.maxCompareAtPrice, minPricePerUnit: t2.pricePerUnit } };
3215
+ }
3216
+ function wo(e2, t2, n2) {
3217
+ if (!n2) return Co(e2);
3218
+ let r2 = (0, go.default)(e2.variants, _o), i2 = t2 ?? r2;
3219
+ return i2 ? { productPrice: vo(i2.price), subscriptionPlanPrices: xo(e2, i2), productPriceRange: bo(e2.variants) } : So(e2);
3220
+ }
3221
+ function To(e2, t2) {
3222
+ let n2 = e2.subscriptionPlanPrices.find(({ subscription: e3 }) => e3.id === t2);
3223
+ return n2 ? { currentSellingPrice: n2.price.currentSellingPrice, priceBeforeDiscount: n2.price.priceBeforeDiscount, pricePerUnit: e2.productPrice.pricePerUnit } : e2.productPrice;
3224
+ }
3225
+ function Eo(e2) {
3226
+ return vo(e2.price).currentSellingPrice;
3227
+ }
3228
+ function Do(e2) {
3229
+ return Object.keys(e2).length === 1 && `$and` in e2 && Array.isArray(e2.$and);
3230
+ }
3231
+ function Oo(e2) {
3232
+ return Object.keys(e2).length === 1 && `$or` in e2 && Array.isArray(e2.$or);
3233
+ }
3234
+ function ko(e2) {
3235
+ return Object.keys(e2).length === 1 && `$not` in e2 && typeof e2.$not == `object`;
3236
+ }
3237
+ function q(e2, t2) {
3238
+ return e2 === void 0 || Object.keys(e2).length === 0 ? t2 : t2 === void 0 || Object.keys(t2).length === 0 ? e2 : { $and: [...Do(e2) ? e2.$and : [e2], ...Do(t2) ? t2.$and : [t2]] };
3239
+ }
3240
+ function Ao(e2, t2) {
3241
+ return e2 === void 0 || Object.keys(e2).length === 0 ? t2 : t2 === void 0 || Object.keys(t2).length === 0 ? e2 : { $or: [...Oo(e2) ? e2.$or : [e2], ...Oo(t2) ? t2.$or : [t2]] };
3242
+ }
3243
+ function jo(e2) {
3244
+ if (e2 !== void 0 && Object.keys(e2).length !== 0) return ko(e2) ? e2.$not : { $not: e2 };
3245
+ }
3246
+ var Mo = class {
3247
+ _items;
3248
+ _fetchNextPage;
3249
+ _fetchPrevPage;
3250
+ _originQuery;
3251
+ _limit;
3252
+ constructor({ items: e2, originQuery: t2, fetchNextPage: n2, fetchPrevPage: r2, limit: i2 }) {
3253
+ this._items = e2, this._fetchNextPage = n2, this._fetchPrevPage = r2, this._originQuery = t2, this._limit = i2;
3254
+ }
3255
+ get items() {
3256
+ return this._items;
3257
+ }
3258
+ get length() {
3259
+ return this._items.length;
3260
+ }
3261
+ get pageSize() {
3262
+ return this._limit;
3263
+ }
3264
+ get query() {
3265
+ return this._originQuery;
3266
+ }
3267
+ async next() {
3268
+ if (!this.hasNext()) throw Error(`No next page to fetch`);
3269
+ return await this._fetchNextPage();
3270
+ }
3271
+ async prev() {
3272
+ if (!this.hasPrev()) throw Error(`No previous page to fetch`);
3273
+ return await this._fetchPrevPage();
3274
+ }
3275
+ };
3276
+ var No = class extends Mo {
3277
+ _nextCursor;
3278
+ _prevCursor;
3279
+ cursors;
3280
+ constructor({ items: e2, originQuery: t2, fetchNextPage: n2, fetchPrevPage: r2, limit: i2, nextCursor: a2, prevCursor: o2 }) {
3281
+ super({ items: e2, originQuery: t2, fetchNextPage: n2, fetchPrevPage: r2, limit: i2 }), this._nextCursor = a2, this._prevCursor = o2, this.cursors = { next: a2, prev: o2 };
3282
+ }
3283
+ hasNext() {
3284
+ return !!this._nextCursor;
3285
+ }
3286
+ hasPrev() {
3287
+ return !!this._prevCursor;
3288
+ }
3289
+ };
3290
+ var Po = class extends Mo {
3291
+ _totalCount;
3292
+ _offset;
3293
+ _tooManyToCount;
3294
+ constructor({ items: e2, fetchNextPage: t2, fetchPrevPage: n2, offset: r2, originQuery: i2, limit: a2, totalCount: o2, tooManyToCount: s2 }) {
3295
+ super({ items: e2, fetchNextPage: t2, fetchPrevPage: n2, originQuery: i2, limit: a2 }), this._totalCount = o2, this._offset = r2, this._tooManyToCount = s2;
3296
+ }
3297
+ get currentPage() {
3298
+ return this._limit === 0 ? void 0 : Math.floor(this._offset / this._limit);
3299
+ }
3300
+ get totalPages() {
3301
+ return this._tooManyToCount || this._limit === 0 ? void 0 : Math.ceil(this._totalCount / this._limit);
3302
+ }
3303
+ get totalCount() {
3304
+ return this._tooManyToCount ? void 0 : this._totalCount;
3305
+ }
3306
+ hasNext() {
3307
+ return this._limit !== 0 && this.currentPage !== void 0 && this.totalPages !== void 0 && this.currentPage < this.totalPages - 1;
3308
+ }
3309
+ hasPrev() {
3310
+ return !!(this._limit !== 0 && this.currentPage && this.currentPage > 0);
3311
+ }
3312
+ };
3313
+ function Fo(e2) {
3314
+ let t2 = (n2) => ({ query: n2, async find() {
3315
+ try {
3316
+ let r2 = e2.requestTransformer(e2.pagingMethod === `CURSOR` && n2.cursorPaging.cursor ? { cursorPaging: n2.cursorPaging } : n2), i2 = await e2.func(r2), { [Ye]: a2, [Xe]: o2 } = e2.responseTransformer(i2);
3317
+ if (e2.pagingMethod === `OFFSET`) {
3318
+ let e3 = n2;
3319
+ return new Po({ 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 });
3320
+ }
3321
+ let s2 = n2.cursorPaging;
3322
+ return new No({ 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 });
3323
+ } catch (t3) {
3324
+ throw e2.errorTransformer(t3);
3325
+ }
3326
+ }, skipTo(e3) {
3327
+ return t2({ ...n2, cursorPaging: { cursor: e3, limit: n2.cursorPaging.limit } });
3328
+ }, eq(r2, i2) {
3329
+ let a2 = i2 === void 0 ? null : i2, o2 = { [J(e2.transformationPaths, r2)]: a2 };
3330
+ return t2({ ...n2, filter: q(n2.filter, o2) });
3331
+ }, ne(r2, i2) {
3332
+ let a2 = i2 === void 0 ? null : i2, o2 = { [J(e2.transformationPaths, r2)]: { $ne: a2 } };
3333
+ return t2({ ...n2, filter: q(n2.filter, o2) });
3334
+ }, ge(r2, i2) {
3335
+ let a2 = { [J(e2.transformationPaths, r2)]: { $gte: i2 } };
3336
+ return t2({ ...n2, filter: q(n2.filter, a2) });
3337
+ }, gt(r2, i2) {
3338
+ let a2 = { [J(e2.transformationPaths, r2)]: { $gt: i2 } };
3339
+ return t2({ ...n2, filter: q(n2.filter, a2) });
3340
+ }, le(r2, i2) {
3341
+ let a2 = { [J(e2.transformationPaths, r2)]: { $lte: i2 } };
3342
+ return t2({ ...n2, filter: q(n2.filter, a2) });
3343
+ }, lt(r2, i2) {
3344
+ let a2 = { [J(e2.transformationPaths, r2)]: { $lt: i2 } };
3345
+ return t2({ ...n2, filter: q(n2.filter, a2) });
3346
+ }, isNotEmpty(e3) {
3347
+ return this.ne(e3, null);
3348
+ }, isEmpty(e3) {
3349
+ return this.eq(e3, null);
3350
+ }, startsWith(r2, i2) {
3351
+ let a2 = { [J(e2.transformationPaths, r2)]: { $startsWith: i2 } };
3352
+ return t2({ ...n2, filter: q(n2.filter, a2) });
3353
+ }, endsWith(r2, i2) {
3354
+ let a2 = { [J(e2.transformationPaths, r2)]: { $endsWith: i2 } };
3355
+ return t2({ ...n2, filter: q(n2.filter, a2) });
3356
+ }, contains(r2, i2) {
3357
+ let a2 = { [J(e2.transformationPaths, r2)]: { $contains: i2 } };
3358
+ return t2({ ...n2, filter: q(n2.filter, a2) });
3359
+ }, hasSome(r2, ...i2) {
3360
+ let a2 = { [J(e2.transformationPaths, r2)]: { $hasSome: Array.isArray(i2[0]) ? i2[0] : i2 } };
3361
+ return t2({ ...n2, filter: q(n2.filter, a2) });
3362
+ }, hasAll(r2, ...i2) {
3363
+ let a2 = { [J(e2.transformationPaths, r2)]: { $hasAll: Array.isArray(i2[0]) ? i2[0] : i2 } };
3364
+ return t2({ ...n2, filter: q(n2.filter, a2) });
3365
+ }, between(e3, t3, n3) {
3366
+ return this.ge(e3, t3).lt(e3, n3);
3367
+ }, in(r2, i2) {
3368
+ let a2 = { [J(e2.transformationPaths, r2)]: { $in: i2 } };
3369
+ return t2({ ...n2, filter: q(n2.filter, a2) });
3370
+ }, exists(r2, i2 = true) {
3371
+ let a2 = { [J(e2.transformationPaths, r2)]: { $exists: i2 } };
3372
+ return t2({ ...n2, filter: q(n2.filter, a2) });
3373
+ }, or(e3) {
3374
+ return t2({ ...n2, filter: Ao(n2.filter, e3.query.filter) });
3375
+ }, and(e3) {
3376
+ return t2({ ...n2, filter: q(n2.filter, e3.query.filter) });
3377
+ }, not(e3) {
3378
+ return t2({ ...n2, filter: jo(e3.query.filter) });
3379
+ }, ascending(...r2) {
3380
+ return t2({ ...n2, sort: [...n2.sort ?? [], ...r2.map((t3) => ({ fieldName: J(e2.transformationPaths, t3), order: `ASC` }))] });
3381
+ }, descending(...r2) {
3382
+ return t2({ ...n2, sort: [...n2.sort ?? [], ...r2.map((t3) => ({ fieldName: J(e2.transformationPaths, t3), order: `DESC` }))] });
3383
+ }, skip(e3) {
3384
+ return t2({ ...n2, paging: { offset: e3, limit: `limit` in n2.paging ? n2.paging.limit : 50 } });
3385
+ }, limit(r2) {
3386
+ if (e2.pagingMethod === `CURSOR`) {
3387
+ let e3 = n2;
3388
+ return t2({ ...n2, cursorPaging: { limit: r2, cursor: `cursor` in e3.cursorPaging ? e3.cursorPaging.cursor : void 0 } });
3389
+ }
3390
+ let i2 = n2;
3391
+ return t2({ ...n2, paging: { limit: r2, offset: `offset` in i2.paging ? i2.paging.offset : 0 } });
3392
+ } });
3393
+ return t2({ filter: {}, ...e2.pagingMethod === `OFFSET` ? { paging: { offset: 0, limit: 50 } } : { cursorPaging: { limit: 50 } } });
3394
+ }
3395
+ function J(e2, t2) {
3396
+ let n2 = Object.entries(e2).find(([e3]) => e3 === t2 || t2.startsWith(`${e3}.`))?.[0];
3397
+ return n2 ? t2.replace(n2, e2[n2]) : Qe(t2, { ...e2, ...Ze });
3398
+ }
3399
+ function Io(e2, t2, n2 = {}) {
3400
+ let r2 = (r3, i3) => Io(e2, t2, { ...n2, [r3]: i3 }), i2 = () => Object.keys(n2).length === 0 ? {} : { [$e(e2, t2)]: n2 };
3401
+ return { get filter() {
3402
+ return i2();
3403
+ }, 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) };
3404
+ }
3405
+ function Lo(e2) {
3406
+ return Object.assign((t2) => Io(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 } }) });
3407
+ }
3408
+ function Ro(e2) {
3409
+ return (t2) => ({ asc: () => ({ sort: { fieldName: $e(t2, e2), order: `ASC` } }), desc: () => ({ sort: { fieldName: $e(t2, e2), order: `DESC` } }) });
3410
+ }
3411
+ function zo(e2) {
3412
+ return () => {
3413
+ let t2 = {}, n2 = { withFilter(e3) {
3414
+ return t2 = { ...t2, filter: e3.filter }, n2;
3415
+ }, withFields(...r2) {
3416
+ return t2 = { ...t2, fields: r2.map((t3) => $e(t3, e2)) }, n2;
3417
+ }, withSorting(...e3) {
3418
+ return t2 = { ...t2, sort: e3.map((e4) => e4.sort) }, n2;
3419
+ }, withPaging(e3) {
3420
+ return t2 = { ...t2, paging: e3 }, n2;
3421
+ }, build() {
3422
+ return t2;
3423
+ } };
3424
+ return n2;
3425
+ };
3426
+ }
3427
+ function Bo(e2) {
3428
+ return { QueryBuilder: zo(e2), Filter: Lo(e2), Sort: Ro(e2) };
3429
+ }
3430
+ var Vo = `filter`;
3431
+ var Ho = `sort`;
3432
+ var Uo = `cursorPaging`;
3433
+ var Wo = `paging`;
3434
+ var Go = [Vo, Ho, Uo];
3435
+ var Ko = [Vo, Ho, Wo];
3436
+ function qo(e2, t2) {
3437
+ return !e2 || typeof e2 != `object` ? false : t2.some((t3) => e2.hasOwnProperty(t3));
3438
+ }
3439
+ function Jo(e2) {
3440
+ return qo(e2, Go);
3441
+ }
3442
+ function Yo(e2) {
3443
+ return qo(e2, Ko);
3444
+ }
3445
+ function Xo(e2) {
3446
+ let { hasOptionsParameter: t2 } = e2;
3447
+ return function(...n2) {
3448
+ return t2 ? Qo(n2, e2) : Zo(n2, e2);
3449
+ };
3450
+ }
3451
+ function Zo(e2, t2) {
3452
+ return e2.length === 0 ? t2.builderQueryFunction() : t2.typedQueryFunction(e2[0]);
3453
+ }
3454
+ function Qo(e2, t2) {
3455
+ switch (e2.length) {
3456
+ case 0:
3457
+ return t2.builderQueryFunction();
3458
+ case 1:
3459
+ return Jo(e2[0]) || Yo(e2[0]) ? t2.typedQueryFunction(e2[0]) : t2.builderQueryFunction(e2[0]);
3460
+ default:
3461
+ return t2.typedQueryFunction(e2[0], e2[1]);
3462
+ }
3463
+ }
3464
+ function $o(e2) {
3465
+ if (!e2) return;
3466
+ let t2 = _t(e2, `image`), { protocol: n2, hash: r2, pathname: i2 } = new URL(t2), a2 = new URLSearchParams(r2.replace(`#`, ``)), o2 = a2.get(`originHeight`), s2 = a2.get(`originWidth`), [c2, l2] = i2.replace(`image://v1/`, ``).split(`/`), u2 = decodeURIComponent(l2);
3467
+ if (n2 === `wix:`) {
3468
+ let t3 = { id: c2, height: Number(o2), width: Number(s2) };
3469
+ return u2 ? { ...t3, altText: u2, filename: u2, url: e2 } : t3;
3470
+ }
3471
+ return { url: e2 };
3472
+ }
3473
+ function Y(e2) {
3474
+ if (!e2) return;
3475
+ let t2 = ``;
3476
+ 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;
3477
+ }
3478
+ function es(e2) {
3479
+ let t2 = {}, n2 = { get search() {
3480
+ return t2;
3481
+ }, expression(e3) {
3482
+ return t2 = { ...t2, expression: e3 }, n2;
3483
+ }, mode(e3) {
3484
+ return t2 = { ...t2, mode: e3 }, n2;
3485
+ }, fields(r2) {
3486
+ return t2 = { ...t2, fields: r2.map((t3) => $e(t3, e2)) }, n2;
3487
+ }, fuzzy(e3 = true) {
3488
+ return t2 = { ...t2, fuzzy: e3 }, n2;
3489
+ } };
3490
+ return n2;
3491
+ }
3492
+ function ts(e2) {
3493
+ return (t2) => {
3494
+ let n2 = es(e2);
3495
+ return t2 === void 0 ? n2 : n2.expression(t2);
3496
+ };
3497
+ }
3498
+ function ns(e2) {
3499
+ let t2 = { ...e2, type: `VALUE`, value: { ...e2.value } }, n2 = { get aggregation() {
3500
+ return t2;
3501
+ }, sortBy(e3, r2) {
3502
+ return t2 = { ...t2, value: { ...t2.value, sortType: e3, sortDirection: r2 } }, n2;
3503
+ }, limit(e3) {
3504
+ return t2 = { ...t2, value: { ...t2.value, limit: e3 } }, n2;
3505
+ }, excludeMissingValues() {
3506
+ return t2 = { ...t2, value: { ...t2.value, missingValues: `EXCLUDE` } }, n2;
3507
+ }, includeMissingValues() {
3508
+ return t2 = { ...t2, value: { ...t2.value, missingValues: `INCLUDE` } }, n2;
3509
+ }, includeValues(e3) {
3510
+ return t2 = { ...t2, value: { ...t2.value, includeOptions: { addToBucket: e3 } } }, n2;
3511
+ } };
3512
+ return n2;
3513
+ }
3514
+ function rs(e2) {
3515
+ let t2 = { ...e2, type: `RANGE`, range: { buckets: [] } }, n2 = { get aggregation() {
3516
+ return t2;
3517
+ }, withBuckets(...e3) {
3518
+ return t2 = { ...t2, range: { buckets: e3 } }, n2;
3519
+ } };
3520
+ return n2;
3521
+ }
3522
+ function is(e2) {
3523
+ let t2 = { ...e2, type: `DATE_HISTOGRAM`, dateHistogram: {} }, n2 = { get aggregation() {
3524
+ return t2;
3525
+ }, interval(e3) {
3526
+ return t2 = { ...t2, dateHistogram: { interval: e3 } }, n2;
3527
+ } };
3528
+ return n2;
3529
+ }
3530
+ function as(e2) {
3531
+ let t2 = { ...e2, type: `SCALAR`, scalar: {} }, n2 = { get aggregation() {
3532
+ return t2;
3533
+ }, type(e3) {
3534
+ return t2 = { ...t2, scalar: { type: e3 } }, n2;
3535
+ } };
3536
+ return n2;
3537
+ }
3538
+ function os(e2) {
3539
+ let t2 = { ...e2, type: `NESTED`, nested: { nestedAggregations: [] } }, n2 = { get aggregation() {
3540
+ return t2;
3541
+ }, addNestedAggregation(e3) {
3542
+ let r2 = e3.aggregation, i2 = [...t2.nested?.nestedAggregations ?? [], r2];
3543
+ return t2 = { ...t2, nested: { nestedAggregations: i2 } }, n2;
3544
+ } };
3545
+ return n2;
3546
+ }
3547
+ function ss(e2, t2) {
3548
+ let n2 = { name: e2 }, r2 = { get aggregation() {
3549
+ return n2;
3550
+ }, ofType(e3) {
3551
+ return n2 = { ...n2, type: e3 }, r2;
3552
+ }, onField(e3) {
3553
+ return n2 = { ...n2, fieldPath: $e(e3, t2) }, r2;
3554
+ }, asValueAggregation() {
3555
+ return ns(n2);
3556
+ }, asRangeAggregation() {
3557
+ return rs(n2);
3558
+ }, asDateHistogramAggregation() {
3559
+ return is(n2);
3560
+ }, asScalarAggregation() {
3561
+ return as(n2);
3562
+ }, asNestedAggregation() {
3563
+ return os(n2);
3564
+ } };
3565
+ return r2;
3566
+ }
3567
+ function cs(e2) {
3568
+ return (t2) => ss(t2, e2);
3569
+ }
3570
+ function ls() {
3571
+ return () => {
3572
+ let e2 = {}, t2 = { withFilter(n2) {
3573
+ return e2 = { ...e2, filter: n2.filter }, t2;
3574
+ }, withSearchClause(n2) {
3575
+ return e2 = { ...e2, search: n2.search }, t2;
3576
+ }, withSorting(...n2) {
3577
+ return e2 = { ...e2, sort: n2.map((e3) => e3.sort) }, t2;
3578
+ }, withAggregation(...n2) {
3579
+ return e2 = { ...e2, aggregations: n2.map((e3) => e3.aggregation) }, t2;
3580
+ }, withPaging(n2) {
3581
+ return e2 = { ...e2, paging: n2 }, t2;
3582
+ }, withTimeZone(n2) {
3583
+ return e2 = { ...e2, timeZone: n2 }, t2;
3584
+ }, build() {
3585
+ return e2;
3586
+ } };
3587
+ return t2;
3588
+ };
3589
+ }
3590
+ function us(e2) {
3591
+ return { SearchBuilder: ls(), Filter: Lo(e2), Sort: Ro(e2), SearchParams: ts(e2), Aggregation: cs(e2) };
3592
+ }
3593
+ function ds(e2) {
3594
+ return Vt(Object.assign(e2, { domainToMappings: { "bo._base_domain_": [{ srcPath: `/back-in-stock-service`, destPath: `` }], "wixbo.ai": [{ srcPath: `/back-in-stock-service`, destPath: `` }], "wix-bo.com": [{ srcPath: `/back-in-stock-service`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/back-in-stock-service`, destPath: `` }], _: [{ srcPath: `/v1/back-in-stock-notification-requests`, destPath: `/v1/back-in-stock-notification-requests` }], "*.dev.wix-code.com": [{ srcPath: `/v1/back-in-stock-notification-requests`, destPath: `/v1/back-in-stock-notification-requests` }] } }));
3595
+ }
3596
+ var fs = `@wix/auto_sdk_ecom_back-in-stock-notifications`;
3597
+ function ps(e2) {
3598
+ function t2({ host: t3 }) {
3599
+ let n2 = P(e2, [{ transformFn: it, paths: [{ path: `request.createdDate` }, { path: `itemDetails.image.urlExpirationDate` }] }, { transformFn: mn, paths: [{ path: `itemDetails.image.focalPoint.x` }, { path: `itemDetails.image.focalPoint.y` }] }]);
3600
+ return { entityFqdn: `wix.ecom.v1.back_in_stock_notification_request`, method: `POST`, methodFqn: `com.wixpress.ecom.back.in.stock.BackInStockNotificationRequestService.CreateBackInStockNotificationRequest`, packageName: fs, migrationOptions: { optInTransformResponse: true }, url: ds({ protoPath: `/v1/back-in-stock-notification-requests`, data: n2, host: t3 }), data: n2, transformResponse: (e3) => P(e3, [{ transformFn: N, paths: [{ path: `request.createdDate` }] }]) };
3601
+ }
3602
+ return t2;
3603
+ }
3604
+ async function ms(e2, t2) {
3605
+ let { httpClient: n2, sideEffects: r2 } = arguments[2], i2 = ps(P(j({ request: e2, itemDetails: t2 }), [{ transformFn: $o, paths: [{ path: `itemDetails.image` }] }]));
3606
+ r2?.onSiteCall?.();
3607
+ try {
3608
+ let e3 = await n2.request(i2);
3609
+ return r2?.onSuccess?.(e3), M(e3.data)?.request;
3610
+ } catch (e3) {
3611
+ let t3 = F(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { request: `$[0]`, itemDetails: `$[1]` }, singleArgumentUnchanged: false }, [`request`, `itemDetails`]);
3612
+ throw r2?.onError?.(e3), t3;
3613
+ }
3614
+ }
3615
+ ({ ...Bo() });
3616
+ function hs(e2) {
3617
+ return (t2, n2) => ms(t2, n2, { httpClient: e2 });
3618
+ }
3619
+ var gs = b(`wix.ecom.v1.back_in_stock_notification_request_created`, true, (e2) => M(P(e2, [{ transformFn: N, paths: [{ path: `entity.createdDate` }, { path: `metadata.eventTime` }] }])))();
3620
+ var _s = b(`wix.ecom.v1.back_in_stock_notification_request_deleted`, true, (e2) => M(P(e2, [{ transformFn: N, paths: [{ path: `undefined.createdDate` }, { path: `metadata.eventTime` }] }])))();
3621
+ var vs = b(`wix.ecom.v1.back_in_stock_notification_request_updated`, true, (e2) => M(P(e2, [{ transformFn: N, paths: [{ path: `entity.createdDate` }, { path: `metadata.eventTime` }] }])))();
3622
+ var ys = zt(hs);
3623
+ I(gs), I(_s), I(vs);
3624
+ function bs(e2) {
3625
+ if (!e2) return;
3626
+ let { pathname: t2 } = new URL(e2);
3627
+ return { relativePath: t2, url: e2 };
3628
+ }
3629
+ function X(e2) {
3630
+ if (e2) return e2.url;
3631
+ }
3632
+ function xs(e2) {
3633
+ return Vt(Object.assign(e2, { domainToMappings: { "api._api_base_domain_": [{ srcPath: `/cart-v2`, destPath: `` }], _: [{ srcPath: `/_api/cart-v2`, destPath: `` }], "*.dev.wix-code.com": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "www._base_domain_": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "editor._base_domain_": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "blocks._base_domain_": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "create.editorx": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "apps._base_domain_": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "manage._base_domain_": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "bo._base_domain_": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "wixbo.ai": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "wix-bo.com": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/ecom/v2/carts`, destPath: `/v2/carts` }], "editor.wixapps.net": [{ srcPath: `/_api/cart-v2`, destPath: `` }] } }));
3634
+ }
3635
+ var Ss = `@wix/auto_sdk_ecom_cart-v-2`;
3636
+ function Cs(e2) {
3637
+ function t2({ host: t3 }) {
3638
+ let n2 = P(e2, [{ transformFn: it, paths: [{ path: `cart.createdDate` }, { path: `cart.updatedDate` }, { path: `cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate` }, { path: `cart.lineItems.attributes.image.urlExpirationDate` }, { path: `cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate` }, { path: `cart.lineItems.attributes.serviceProperties.scheduledDate` }, { path: `cart.lineItems.attributes.serviceProperties.endDate` }, { path: `catalogItems.catalogOverrideFields.image.urlExpirationDate` }, { path: `customItems.attributes.image.urlExpirationDate` }, { path: `customItems.attributes.serviceProperties.scheduledDate` }, { path: `customItems.attributes.serviceProperties.endDate` }, { path: `customItems.attributes.subscriptionInfo.subscriptionSettings.startDate` }] }, { transformFn: mn, paths: [{ path: `cart.lineItems.source.catalogOverrideFields.physicalProperties.weight` }, { path: `cart.lineItems.attributes.physicalProperties.weight` }, { path: `cart.deliveryInfo.address.geocode.latitude` }, { path: `cart.deliveryInfo.address.geocode.longitude` }, { path: `cart.paymentInfo.billingAddress.geocode.latitude` }, { path: `cart.paymentInfo.billingAddress.geocode.longitude` }, { path: `cart.legacyFields.discounts.merchantDiscount.percentage` }, { path: `cart.tcAppliedDiscounts.merchantDiscount.percentage` }, { path: `catalogItems.catalogOverrideFields.physicalProperties.weight` }, { path: `customItems.attributes.physicalProperties.weight` }] }]);
3639
+ return { entityFqdn: `wix.ecom.v2.cart`, method: `POST`, methodFqn: `wix.ecom.cart.v2.CartService.CreateCart`, packageName: Ss, migrationOptions: { optInTransformResponse: true }, url: xs({ protoPath: `/v2/carts`, data: n2, host: t3 }), data: n2, transformResponse: (e3) => P(e3, [{ transformFn: N, paths: [{ path: `cart.createdDate` }, { path: `cart.updatedDate` }, { path: `cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate` }, { path: `cart.lineItems.attributes.image.urlExpirationDate` }, { path: `cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate` }, { path: `cart.lineItems.attributes.serviceProperties.scheduledDate` }, { path: `cart.lineItems.attributes.serviceProperties.endDate` }] }, { transformFn: hn, paths: [{ path: `cart.lineItems.source.catalogOverrideFields.physicalProperties.weight` }, { path: `cart.lineItems.attributes.physicalProperties.weight` }, { path: `cart.deliveryInfo.address.geocode.latitude` }, { path: `cart.deliveryInfo.address.geocode.longitude` }, { path: `cart.paymentInfo.billingAddress.geocode.latitude` }, { path: `cart.paymentInfo.billingAddress.geocode.longitude` }, { path: `cart.legacyFields.discounts.merchantDiscount.percentage` }, { path: `cart.tcAppliedDiscounts.merchantDiscount.percentage` }] }]) };
3640
+ }
3641
+ return t2;
3642
+ }
3643
+ var ws = ((e2) => (e2.UNSPECIFIED = `UNSPECIFIED`, e2.WEB = `WEB`, e2.POS = `POS`, e2.EBAY = `EBAY`, e2.AMAZON = `AMAZON`, e2.OTHER_PLATFORM = `OTHER_PLATFORM`, e2.WIX_APP_STORE = `WIX_APP_STORE`, e2.WIX_INVOICES = `WIX_INVOICES`, e2.BACKOFFICE_MERCHANT = `BACKOFFICE_MERCHANT`, e2.WISH = `WISH`, e2.CLASS_PASS = `CLASS_PASS`, e2.GLOBAL_E = `GLOBAL_E`, e2.FACEBOOK = `FACEBOOK`, e2.ETSY = `ETSY`, e2.TIKTOK = `TIKTOK`, e2.FAIRE_COM = `FAIRE_COM`, e2.PAYPAL_AGENTIC_CHECKOUT = `PAYPAL_AGENTIC_CHECKOUT`, e2.STRIPE_AGENTIC_CHECKOUT = `STRIPE_AGENTIC_CHECKOUT`, e2.WIX_INVOICES_PLATFORM = `WIX_INVOICES_PLATFORM`, e2.UCP_AGENTIC_CHECKOUT = `UCP_AGENTIC_CHECKOUT`, e2))(ws || {});
3644
+ async function Ts(e2) {
3645
+ let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = Cs(P(j({ cart: e2?.cart, catalogItems: e2?.catalogItems, customItems: e2?.customItems, coupons: e2?.coupons, deliveryMethod: e2?.deliveryMethod, giftCards: e2?.giftCards }), [{ transformFn: $o, paths: [{ path: `cart.lineItems.source.catalogOverrideFields.image` }, { path: `cart.lineItems.attributes.image` }, { path: `catalogItems.catalogOverrideFields.image` }, { path: `customItems.attributes.image` }] }, { transformFn: bs, paths: [{ path: `cart.lineItems.attributes.url` }, { path: `customItems.attributes.url` }] }, { transformFn: gn, paths: [{ path: `cart.deliveryInfo.address` }, { path: `cart.paymentInfo.billingAddress` }] }]));
3646
+ n2?.onSiteCall?.();
3647
+ try {
3648
+ let e3 = await t2.request(r2);
3649
+ return n2?.onSuccess?.(e3), M(P(e3.data, [{ transformFn: Y, paths: [{ path: `cart.lineItems.source.catalogOverrideFields.image` }, { path: `cart.lineItems.attributes.image` }] }, { transformFn: X, paths: [{ path: `cart.lineItems.attributes.url` }] }, { transformFn: _n, paths: [{ path: `cart.deliveryInfo.address` }, { path: `cart.paymentInfo.billingAddress` }] }]))?.cart;
3650
+ } catch (e3) {
3651
+ let t3 = F(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { cart: `$[0].cart`, catalogItems: `$[0].catalogItems`, customItems: `$[0].customItems`, coupons: `$[0].coupons`, deliveryMethod: `$[0].deliveryMethod`, giftCards: `$[0].giftCards` }, singleArgumentUnchanged: false }, [`options`]);
3652
+ throw n2?.onError?.(e3), t3;
3653
+ }
3654
+ }
3655
+ function Es(e2) {
3656
+ return (t2) => Ts(t2, { httpClient: e2 });
3657
+ }
3658
+ var Ds = zt(Es);
3659
+ function Os(e2) {
3660
+ return Vt(Object.assign(e2, { domainToMappings: { "api._api_base_domain_": [{ srcPath: `/cart-v2`, destPath: `` }], _: [{ srcPath: `/_api/cart-v2`, destPath: `` }], "*.dev.wix-code.com": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "www._base_domain_": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "editor._base_domain_": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "blocks._base_domain_": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "create.editorx": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "apps._base_domain_": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "manage._base_domain_": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "bo._base_domain_": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "wixbo.ai": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "wix-bo.com": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/ecom/v2/carts`, destPath: `/v2/carts` }], "editor.wixapps.net": [{ srcPath: `/_api/cart-v2`, destPath: `` }] } }));
3661
+ }
3662
+ var ks = `@wix/auto_sdk_ecom_current-cart-v-2`;
3663
+ function As(e2) {
3664
+ function t2({ host: t3 }) {
3665
+ let n2 = P(e2, [{ transformFn: mn, paths: [{ path: `catalogItems.catalogOverrideFields.physicalProperties.weight` }, { path: `customItems.attributes.physicalProperties.weight` }] }, { transformFn: it, paths: [{ path: `catalogItems.catalogOverrideFields.image.urlExpirationDate` }, { path: `customItems.attributes.image.urlExpirationDate` }, { path: `customItems.attributes.serviceProperties.scheduledDate` }, { path: `customItems.attributes.serviceProperties.endDate` }, { path: `customItems.attributes.subscriptionInfo.subscriptionSettings.startDate` }] }]);
3666
+ return { entityFqdn: `wix.ecom.v2.cart`, method: `POST`, methodFqn: `wix.ecom.cart.v2.CurrentCartService.AddLineItemsToCurrentCart`, packageName: ks, migrationOptions: { optInTransformResponse: true }, url: Os({ protoPath: `/v2/carts/current/add-line-items`, data: n2, host: t3 }), data: n2, transformResponse: (e3) => P(e3, [{ transformFn: N, paths: [{ path: `cart.createdDate` }, { path: `cart.updatedDate` }, { path: `cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate` }, { path: `cart.lineItems.attributes.image.urlExpirationDate` }, { path: `cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate` }, { path: `cart.lineItems.attributes.serviceProperties.scheduledDate` }, { path: `cart.lineItems.attributes.serviceProperties.endDate` }] }, { transformFn: hn, paths: [{ path: `cart.lineItems.source.catalogOverrideFields.physicalProperties.weight` }, { path: `cart.lineItems.attributes.physicalProperties.weight` }, { path: `cart.deliveryInfo.address.geocode.latitude` }, { path: `cart.deliveryInfo.address.geocode.longitude` }, { path: `cart.paymentInfo.billingAddress.geocode.latitude` }, { path: `cart.paymentInfo.billingAddress.geocode.longitude` }, { path: `cart.legacyFields.discounts.merchantDiscount.percentage` }, { path: `cart.tcAppliedDiscounts.merchantDiscount.percentage` }] }]) };
3667
+ }
3668
+ return t2;
3669
+ }
3670
+ async function js(e2) {
3671
+ let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = As(P(j({ catalogItems: e2?.catalogItems, customItems: e2?.customItems }), [{ transformFn: $o, paths: [{ path: `catalogItems.catalogOverrideFields.image` }, { path: `customItems.attributes.image` }] }, { transformFn: bs, paths: [{ path: `customItems.attributes.url` }] }]));
3672
+ n2?.onSiteCall?.();
3673
+ try {
3674
+ let e3 = await t2.request(r2);
3675
+ return n2?.onSuccess?.(e3), M(P(e3.data, [{ transformFn: Y, paths: [{ path: `cart.lineItems.source.catalogOverrideFields.image` }, { path: `cart.lineItems.attributes.image` }] }, { transformFn: X, paths: [{ path: `cart.lineItems.attributes.url` }] }, { transformFn: _n, paths: [{ path: `cart.deliveryInfo.address` }, { path: `cart.paymentInfo.billingAddress` }] }]));
3676
+ } catch (e3) {
3677
+ let t3 = F(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { catalogItems: `$[0].catalogItems`, customItems: `$[0].customItems` }, singleArgumentUnchanged: false }, [`options`]);
3678
+ throw n2?.onError?.(e3), t3;
3679
+ }
3680
+ }
3681
+ function Ms(e2) {
3682
+ return (t2) => js(t2, { httpClient: e2 });
3683
+ }
3684
+ var Ns = zt(Ms);
3685
+ var Ps = `BACK_IN_STOCK_NOTIFICATION_REQUEST_ALREADY_EXISTS`;
3686
+ function Fs(e2) {
3687
+ return e2?.details?.applicationError?.code ?? `UNKNOWN`;
3688
+ }
3689
+ function Is(e2) {
3690
+ return { code: Fs(e2), message: e2?.message };
3691
+ }
3692
+ async function Ls(e2) {
3693
+ let { productId: t2, variantId: n2, email: r2, name: i2, price: a2, imageUrl: o2 } = e2;
3694
+ try {
3695
+ return await ys({ catalogReference: { catalogItemId: t2, appId: $r, ...n2 ? { options: { variantId: n2 } } : {} }, email: r2 }, { name: i2, price: String(a2), ...o2 ? { image: o2 } : {} }), `created`;
3696
+ } catch (e3) {
3697
+ if (Fs(e3) === Ps) return `already-subscribed`;
3698
+ throw Is(e3);
3699
+ }
3700
+ }
3701
+ var Rs = `https://static.wixstatic.com/media`;
3702
+ var zs = /image:\/\/v1\/([^/#]+)/;
3703
+ function Bs(e2) {
3704
+ return e2 ? e2.match(zs)?.[1] ?? null : null;
3705
+ }
3706
+ function Vs(e2) {
3707
+ if (!e2) return;
3708
+ if (/^https?:\/\//i.test(e2)) return e2;
3709
+ let t2 = Bs(e2);
3710
+ return t2 ? `${Rs}/${t2}` : void 0;
3711
+ }
3712
+ var Hs = (e2) => e2.media.type === `image`;
3713
+ function Us(e2, t2) {
3714
+ let n2 = t2.choices[e2.id];
3715
+ return e2.choices.find((e3) => e3.choiceId === n2);
3716
+ }
3717
+ function Ws(e2, t2) {
3718
+ let n2 = e2.options.map((e3) => Us(e3, t2)?.mediaIds).filter((e3) => !!(e3 && e3.length > 0));
3719
+ if (n2.length === 0) return;
3720
+ let r2 = n2.reduce((e3, t3) => e3.filter((e4) => t3.includes(e4))), i2 = r2.length > 0 ? r2 : n2.flat(), a2 = /* @__PURE__ */ new Map();
3721
+ for (let t3 of e2.media ?? []) Hs(t3) && a2.set(t3.id, t3);
3722
+ for (let e3 of i2) {
3723
+ let t3 = a2.get(e3)?.media.src;
3724
+ if (t3) return t3;
3725
+ }
3726
+ }
3727
+ function Gs(e2, t2) {
3728
+ let n2 = [t2 ? Ws(e2, t2) : void 0, e2.media?.find(Hs)?.media.src];
3729
+ for (let e3 of n2) {
3730
+ let t3 = Vs(e3);
3731
+ if (t3) return t3;
3732
+ }
3733
+ }
3734
+ function Ks(e2, r2) {
3735
+ let i2 = (0, import_react.useCallback)((t2) => r2 ? Ls({ productId: e2.id, variantId: r2.id, email: t2, name: e2.name ?? ``, price: Eo(r2), imageUrl: Gs(e2, r2) }) : Promise.reject(Error(`Cannot create a back-in-stock notification without a selected variant`)), [e2, r2]);
3736
+ return (0, import_react.useMemo)(() => ({ handleNotifyMe: i2 }), [i2]);
3737
+ }
3738
+ function qs(e2, t2) {
3739
+ return (0, import_react.useMemo)(() => ({ id: e2.id, name: e2.name, description: e2.description, ribbons: e2.ribbons, breadcrumbs: e2.breadcrumbs, mainCategoryId: e2.mainCategoryId, categories: e2.categories, infoSections: e2.infoSections, sku: t2?.sku, discountRules: e2.discountRuleNames?.map((e3) => ({ name: e3 })) }), [e2, t2]);
3740
+ }
3741
+ function Js(e2) {
3742
+ if (!e2) return;
3743
+ let t2 = ``;
3744
+ e2?.filename && (t2 = `/${encodeURIComponent(e2.filename)}`);
3745
+ let n2 = ``;
3746
+ if (e2.posters?.length) {
3747
+ let [t3, r2] = e2.posters, i2 = r2 || t3, a2 = i2.id || ``;
3748
+ if (!a2 && i2.url) {
3749
+ let e3 = i2.url.lastIndexOf(`/`);
3750
+ e3 !== -1 && (a2 = i2.url.substring(e3 + 1));
3751
+ }
3752
+ a2 && (n2 = `#posterUri=${a2}&posterWidth=${i2.width}&posterHeight=${i2.height}`);
3753
+ }
3754
+ return e2.id ? `wix:video://v1/${e2.id}${t2}${n2}` : e2.url;
3755
+ }
3756
+ function Ys(e2) {
3757
+ return Vt(Object.assign(e2, { domainToMappings: { "manage._base_domain_": [{ srcPath: `/inventory`, destPath: `` }], "api._api_base_domain_": [{ srcPath: `/inventory`, destPath: `` }], _: [{ srcPath: `/_api/inventory`, destPath: `` }], "editor._base_domain_": [{ srcPath: `/_api/inventory`, destPath: `` }], "blocks._base_domain_": [{ srcPath: `/_api/inventory`, destPath: `` }], "create.editorx": [{ srcPath: `/_api/inventory`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/stores/v3/inventory-items`, destPath: `/v3/inventory-items` }, { srcPath: `/stores/v3/bulk/inventory-items`, destPath: `/v3/bulk/inventory-items` }], "*.dev.wix-code.com": [{ srcPath: `/_api/inventory`, destPath: `` }], "editor.wixapps.net": [{ srcPath: `/_api/inventory`, destPath: `` }] } }));
3758
+ }
3759
+ var Xs = `@wix/auto_sdk_stores_inventory-items-v-3`;
3760
+ function Zs(e2) {
3761
+ function t2({ host: t3 }) {
3762
+ return { entityFqdn: `wix.stores.catalog.v3.inventory_item`, method: `GET`, methodFqn: `com.wix.stores.catalog.inventory.api.v3.InventoryService.QueryInventoryItems`, packageName: Xs, migrationOptions: { optInTransformResponse: true }, url: Ys({ protoPath: `/v3/inventory-items/query`, data: e2, host: t3 }), params: Bt(e2, true), transformResponse: (e3) => P(e3, [{ transformFn: N, paths: [{ path: `inventoryItems.createdDate` }, { path: `inventoryItems.updatedDate` }] }]), fallback: [{ method: `POST`, url: Ys({ protoPath: `/v3/inventory-items/query`, data: e2, host: t3 }), data: e2 }] };
3763
+ }
3764
+ return t2;
3765
+ }
3766
+ var Z = ((e2) => (e2.OUT_OF_STOCK = `OUT_OF_STOCK`, e2.IN_STOCK = `IN_STOCK`, e2.PREORDER = `PREORDER`, e2))(Z || {});
3767
+ function Qs() {
3768
+ let { httpClient: e2, sideEffects: t2 } = arguments[0];
3769
+ return Fo({ func: async (n2) => {
3770
+ let r2 = Zs(n2);
3771
+ t2?.onSiteCall?.();
3772
+ try {
3773
+ let n3 = await e2.request(r2);
3774
+ return t2?.onSuccess?.(n3), n3;
3775
+ } catch (e3) {
3776
+ throw t2?.onError?.(e3), e3;
3777
+ }
3778
+ }, requestTransformer: (e3) => {
3779
+ let t3 = [e3, {}];
3780
+ return j({ ...t3?.[1], query: t3?.[0] });
3781
+ }, responseTransformer: ({ data: e3 }) => {
3782
+ let t3 = M(P(e3, []));
3783
+ return { items: t3?.inventoryItems, pagingMetadata: t3?.pagingMetadata };
3784
+ }, errorTransformer: (e3) => {
3785
+ throw F(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { query: `$[0]` }, singleArgumentUnchanged: false });
3786
+ }, pagingMethod: `CURSOR`, transformationPaths: {} });
3787
+ }
3788
+ async function $s(e2) {
3789
+ let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = Zs(j({ query: e2 }));
3790
+ n2?.onSiteCall?.();
3791
+ try {
3792
+ let e3 = await t2.request(r2);
3793
+ return n2?.onSuccess?.(e3), M(e3.data);
3794
+ } catch (e3) {
3795
+ let t3 = F(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { query: `$[0]` }, singleArgumentUnchanged: false }, [`query`]);
3796
+ throw n2?.onError?.(e3), t3;
3797
+ }
3798
+ }
3799
+ ({ ...Bo() }, { ...us() });
3800
+ function ec(e2) {
3801
+ return () => Qs({ httpClient: e2 });
3802
+ }
3803
+ function tc(e2) {
3804
+ return (t2) => $s(t2, { httpClient: e2 });
3805
+ }
3806
+ var nc = b(`wix.stores.catalog.v3.inventory_item_created`, true, (e2) => M(P(e2, [{ transformFn: N, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `metadata.eventTime` }] }])))();
3807
+ var rc = b(`wix.stores.catalog.v3.inventory_item_deleted`, true, (e2) => M(P(e2, [{ transformFn: N, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `metadata.eventTime` }] }])))();
3808
+ var ic = b(`wix.stores.catalog.v3.inventory_item_stock_status_updated`, true, (e2) => M(P(e2, [{ transformFn: N, paths: [{ path: `metadata.eventTime` }] }])))();
3809
+ var ac = b(`wix.stores.catalog.v3.inventory_item_updated`, true, (e2) => M(P(e2, [{ transformFn: N, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `metadata.eventTime` }, { path: `modifiedFields.createdDate` }, { path: `modifiedFields.updatedDate` }] }])))();
3810
+ var oc = b(`wix.stores.catalog.v3.inventory_item_updated_with_reason`, true, (e2) => M(P(e2, [{ transformFn: N, paths: [{ path: `data.currentEntity.createdDate` }, { path: `data.currentEntity.updatedDate` }, { path: `metadata.eventTime` }] }])))();
3811
+ function sc(e2) {
3812
+ let t2 = Xo({ builderQueryFunction: () => ec(e2)(), typedQueryFunction: (t3) => tc(e2)(t3), hasOptionsParameter: false });
3813
+ function n2(e3) {
3814
+ return t2(...arguments);
3815
+ }
3816
+ return n2;
3817
+ }
3818
+ var cc = zt(sc);
3819
+ I(nc), I(rc), I(ic), I(ac), I(oc);
3820
+ function lc(e2) {
3821
+ return Vt(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: `` }] } }));
3822
+ }
3823
+ var uc = `@wix/auto_sdk_stores_products-v-3`;
3824
+ function dc(e2) {
3825
+ function t2({ host: t3 }) {
3826
+ return { entityFqdn: `wix.stores.catalog.v3.product`, method: `GET`, methodFqn: `wix.stores.catalog.v3.CatalogApi.GetProduct`, packageName: uc, migrationOptions: { optInTransformResponse: true }, url: lc({ protoPath: `/v3/products/{productId}`, data: e2, host: t3 }), params: Bt(e2), transformResponse: (e3) => P(e3, [{ transformFn: N, paths: [{ path: `product.createdDate` }, { path: `product.updatedDate` }, { path: `product.description.metadata.createdTimestamp` }, { path: `product.description.metadata.updatedTimestamp` }, { path: `product.media.main.image.urlExpirationDate` }, { path: `product.media.main.video.urlExpirationDate` }, { path: `product.media.main.video.resolutions.urlExpirationDate` }, { path: `product.media.main.video.resolutions.poster.urlExpirationDate` }, { path: `product.media.main.video.posters.urlExpirationDate` }, { path: `product.media.itemsInfo.items.image.urlExpirationDate` }, { path: `product.media.itemsInfo.items.video.urlExpirationDate` }, { path: `product.media.itemsInfo.items.video.resolutions.urlExpirationDate` }, { path: `product.media.itemsInfo.items.video.resolutions.poster.urlExpirationDate` }, { path: `product.media.itemsInfo.items.video.posters.urlExpirationDate` }, { path: `product.options.choicesSettings.choices.image.urlExpirationDate` }, { path: `product.options.choicesSettings.choices.linkedMedia.image.urlExpirationDate` }, { path: `product.options.choicesSettings.choices.linkedMedia.video.urlExpirationDate` }, { path: `product.options.choicesSettings.choices.linkedMedia.video.resolutions.urlExpirationDate` }, { path: `product.options.choicesSettings.choices.linkedMedia.video.resolutions.poster.urlExpirationDate` }, { path: `product.options.choicesSettings.choices.linkedMedia.video.posters.urlExpirationDate` }, { path: `product.options.choicesSettings.choices.displayImage.urlExpirationDate` }, { path: `product.modifiers.choicesSettings.choices.image.urlExpirationDate` }, { path: `product.modifiers.choicesSettings.choices.linkedMedia.image.urlExpirationDate` }, { path: `product.modifiers.choicesSettings.choices.linkedMedia.video.urlExpirationDate` }, { path: `product.modifiers.choicesSettings.choices.linkedMedia.video.resolutions.urlExpirationDate` }, { path: `product.modifiers.choicesSettings.choices.linkedMedia.video.resolutions.poster.urlExpirationDate` }, { path: `product.modifiers.choicesSettings.choices.linkedMedia.video.posters.urlExpirationDate` }, { path: `product.modifiers.choicesSettings.choices.displayImage.urlExpirationDate` }, { path: `product.infoSections.description.metadata.createdTimestamp` }, { path: `product.infoSections.description.metadata.updatedTimestamp` }, { path: `product.variantsInfo.variants.media.image.urlExpirationDate` }, { path: `product.variantsInfo.variants.media.video.urlExpirationDate` }, { path: `product.variantsInfo.variants.media.video.resolutions.urlExpirationDate` }, { path: `product.variantsInfo.variants.media.video.resolutions.poster.urlExpirationDate` }, { path: `product.variantsInfo.variants.media.video.posters.urlExpirationDate` }, { path: `product.variantSummary.minPriceVariant.media.image.urlExpirationDate` }, { path: `product.variantSummary.minPriceVariant.media.video.urlExpirationDate` }, { path: `product.variantSummary.minPriceVariant.media.video.resolutions.urlExpirationDate` }, { path: `product.variantSummary.minPriceVariant.media.video.resolutions.poster.urlExpirationDate` }, { path: `product.variantSummary.minPriceVariant.media.video.posters.urlExpirationDate` }] }, { transformFn: hn, paths: [{ path: `product.physicalProperties.pricePerUnit.quantity` }, { path: `product.physicalProperties.shippingWeightRange.minValue` }, { path: `product.physicalProperties.shippingWeightRange.maxValue` }, { path: `product.variantsInfo.variants.physicalProperties.pricePerUnit.settings.quantity` }, { path: `product.variantsInfo.variants.revenueDetails.profitMargin` }, { path: `product.subscriptionDetails.subscriptions.discount.percentOff` }, { path: `product.variantSummary.minPriceVariant.physicalProperties.pricePerUnit.settings.quantity` }, { path: `product.variantSummary.minPriceVariant.revenueDetails.profitMargin` }, { path: `product.minVariantPriceInfo.pricePerUnitData.settings.quantity` }, { path: `product.minVariantPriceInfo.revenueDetails.profitMargin` }, { path: `product.description.nodes.buttonData.styles.background.gradient.centerX` }, { path: `product.description.nodes.buttonData.styles.background.gradient.centerY` }, { path: `product.description.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `product.description.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `product.description.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `product.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `product.description.nodes.galleryData.items.image.media.duration` }, { path: `product.description.nodes.galleryData.items.video.media.duration` }, { path: `product.description.nodes.galleryData.items.video.thumbnail.duration` }, { path: `product.description.nodes.galleryData.options.item.ratio` }, { path: `product.description.nodes.imageData.image.duration` }, { path: `product.description.nodes.imageData.crop.x` }, { path: `product.description.nodes.imageData.crop.y` }, { path: `product.description.nodes.imageData.crop.width` }, { path: `product.description.nodes.imageData.crop.height` }, { path: `product.description.nodes.mapData.mapSettings.lat` }, { path: `product.description.nodes.mapData.mapSettings.lng` }, { path: `product.description.nodes.pollData.poll.image.duration` }, { path: `product.description.nodes.pollData.poll.options.image.duration` }, { path: `product.description.nodes.pollData.design.poll.background.image.duration` }, { path: `product.description.nodes.appEmbedData.image.duration` }, { path: `product.description.nodes.videoData.video.duration` }, { path: `product.description.nodes.videoData.thumbnail.duration` }, { path: `product.description.nodes.audioData.audio.duration` }, { path: `product.description.nodes.audioData.coverImage.duration` }, { path: `product.description.nodes.layoutData.backgroundImage.media.duration` }, { path: `product.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `product.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `product.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `product.description.nodes.layoutData.backdropImage.media.duration` }, { path: `product.description.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `product.description.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `product.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `product.description.nodes.layoutData.background.gradient.centerX` }, { path: `product.description.nodes.layoutData.background.gradient.centerY` }, { path: `product.description.nodes.layoutData.background.gradient.stops.position` }, { path: `product.description.nodes.layoutData.backdrop.gradient.centerX` }, { path: `product.description.nodes.layoutData.backdrop.gradient.centerY` }, { path: `product.description.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `product.description.nodes.shapeData.shape.duration` }, { path: `product.description.nodes.cardData.background.gradient.centerX` }, { path: `product.description.nodes.cardData.background.gradient.centerY` }, { path: `product.description.nodes.cardData.background.gradient.stops.position` }, { path: `product.description.nodes.cardData.backgroundImage.media.duration` }, { path: `product.description.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `product.description.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `product.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `product.description.nodes.tocData.fontSize` }, { path: `product.description.nodes.tocData.itemSpacing` }, { path: `product.description.nodes.smartBlockCellData.shape.duration` }, { path: `product.infoSections.description.nodes.buttonData.styles.background.gradient.centerX` }, { path: `product.infoSections.description.nodes.buttonData.styles.background.gradient.centerY` }, { path: `product.infoSections.description.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `product.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `product.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `product.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `product.infoSections.description.nodes.galleryData.items.image.media.duration` }, { path: `product.infoSections.description.nodes.galleryData.items.video.media.duration` }, { path: `product.infoSections.description.nodes.galleryData.items.video.thumbnail.duration` }, { path: `product.infoSections.description.nodes.galleryData.options.item.ratio` }, { path: `product.infoSections.description.nodes.imageData.image.duration` }, { path: `product.infoSections.description.nodes.imageData.crop.x` }, { path: `product.infoSections.description.nodes.imageData.crop.y` }, { path: `product.infoSections.description.nodes.imageData.crop.width` }, { path: `product.infoSections.description.nodes.imageData.crop.height` }, { path: `product.infoSections.description.nodes.mapData.mapSettings.lat` }, { path: `product.infoSections.description.nodes.mapData.mapSettings.lng` }, { path: `product.infoSections.description.nodes.pollData.poll.image.duration` }, { path: `product.infoSections.description.nodes.pollData.poll.options.image.duration` }, { path: `product.infoSections.description.nodes.pollData.design.poll.background.image.duration` }, { path: `product.infoSections.description.nodes.appEmbedData.image.duration` }, { path: `product.infoSections.description.nodes.videoData.video.duration` }, { path: `product.infoSections.description.nodes.videoData.thumbnail.duration` }, { path: `product.infoSections.description.nodes.audioData.audio.duration` }, { path: `product.infoSections.description.nodes.audioData.coverImage.duration` }, { path: `product.infoSections.description.nodes.layoutData.backgroundImage.media.duration` }, { path: `product.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `product.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `product.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `product.infoSections.description.nodes.layoutData.backdropImage.media.duration` }, { path: `product.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `product.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `product.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `product.infoSections.description.nodes.layoutData.background.gradient.centerX` }, { path: `product.infoSections.description.nodes.layoutData.background.gradient.centerY` }, { path: `product.infoSections.description.nodes.layoutData.background.gradient.stops.position` }, { path: `product.infoSections.description.nodes.layoutData.backdrop.gradient.centerX` }, { path: `product.infoSections.description.nodes.layoutData.backdrop.gradient.centerY` }, { path: `product.infoSections.description.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `product.infoSections.description.nodes.shapeData.shape.duration` }, { path: `product.infoSections.description.nodes.cardData.background.gradient.centerX` }, { path: `product.infoSections.description.nodes.cardData.background.gradient.centerY` }, { path: `product.infoSections.description.nodes.cardData.background.gradient.stops.position` }, { path: `product.infoSections.description.nodes.cardData.backgroundImage.media.duration` }, { path: `product.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `product.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `product.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `product.infoSections.description.nodes.tocData.fontSize` }, { path: `product.infoSections.description.nodes.tocData.itemSpacing` }, { path: `product.infoSections.description.nodes.smartBlockCellData.shape.duration` }, { path: `product.variantsInfo.variants.physicalProperties.weight` }, { path: `product.variantSummary.minPriceVariant.physicalProperties.weight` }, { path: `product.minVariantPriceInfo.weight` }] }]) };
3827
+ }
3828
+ return t2;
3829
+ }
3830
+ var fc = ((e2) => (e2.FREE_TEXT = `FREE_TEXT`, e2.TEXT_CHOICES = `TEXT_CHOICES`, e2.SWATCH_CHOICES = `SWATCH_CHOICES`, e2))(fc || {});
3831
+ var pc = ((e2) => (e2.IN_STOCK = `IN_STOCK`, e2.OUT_OF_STOCK = `OUT_OF_STOCK`, e2.PARTIALLY_OUT_OF_STOCK = `PARTIALLY_OUT_OF_STOCK`, e2))(pc || {});
3832
+ var mc = ((e2) => (e2.ALL_VARIANTS = `ALL_VARIANTS`, e2.NO_VARIANTS = `NO_VARIANTS`, e2.SOME_VARIANTS = `SOME_VARIANTS`, e2))(mc || {});
3833
+ var hc = ((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))(hc || {});
3834
+ async function gc(e2, t2) {
3835
+ let { httpClient: n2, sideEffects: r2 } = arguments[2], i2 = dc(j({ productId: e2, fields: t2?.fields }, []));
3836
+ r2?.onSiteCall?.();
3837
+ try {
3838
+ let e3 = await n2.request(i2);
3839
+ return r2?.onSuccess?.(e3), M(P(e3.data, [{ transformFn: X, paths: [{ path: `product.url` }] }, { transformFn: Y, paths: [{ path: `product.media.main.image` }, { path: `product.media.itemsInfo.items.image` }, { path: `product.options.choicesSettings.choices.image` }, { path: `product.options.choicesSettings.choices.displayImage` }, { path: `product.options.choicesSettings.choices.linkedMedia.image` }, { path: `product.modifiers.choicesSettings.choices.image` }, { path: `product.modifiers.choicesSettings.choices.displayImage` }, { path: `product.modifiers.choicesSettings.choices.linkedMedia.image` }, { path: `product.variantsInfo.variants.media.image` }, { path: `product.variantSummary.minPriceVariant.media.image` }] }, { transformFn: Js, paths: [{ path: `product.media.main.video` }, { path: `product.media.itemsInfo.items.video` }, { path: `product.options.choicesSettings.choices.linkedMedia.video` }, { path: `product.modifiers.choicesSettings.choices.linkedMedia.video` }, { path: `product.variantsInfo.variants.media.video` }, { path: `product.variantSummary.minPriceVariant.media.video` }] }]), [`product.description`, `product.infoSections.description`])?.product;
3840
+ } catch (e3) {
3841
+ let t3 = F(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { productId: `$[0]`, fields: `$[1].fields` }, singleArgumentUnchanged: false }, [`productId`, `options`]);
3842
+ throw r2?.onError?.(e3), t3;
3843
+ }
3844
+ }
3845
+ ({ ...us() }, { ...Bo() });
3846
+ function _c(e2) {
3847
+ return (t2, n2) => gc(t2, n2, { httpClient: e2 });
3848
+ }
3849
+ var vc = b(`wix.stores.catalog.v3.product_created`, true, (e2) => M(P(e2, [{ transformFn: N, 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: X, paths: [{ path: `entity.url` }] }, { transformFn: hn, 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: Y, 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: Js, 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` }] }])))();
3850
+ var yc = b(`wix.stores.catalog.v3.product_deleted`, true, (e2) => M(P(e2, [{ transformFn: N, 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: X, paths: [{ path: `entity.url` }] }, { transformFn: hn, 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: Y, 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: Js, 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` }] }])))();
3851
+ var bc = b(`wix.stores.catalog.v3.product_updated`, true, (e2) => M(P(e2, [{ transformFn: N, 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: X, paths: [{ path: `entity.url` }, { path: `modifiedFields.url` }] }, { transformFn: hn, 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: Y, 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: Js, 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` }] }])))();
3852
+ var xc = zt(_c);
3853
+ I(vc), I(yc), I(bc);
3854
+ function Sc(e2) {
3855
+ return wc(e2) ?? 99999;
3856
+ }
3857
+ function Cc(e2, t2) {
3858
+ return Math.min(e2, Math.max(t2, 1));
3859
+ }
3860
+ function wc(e2) {
3861
+ if (!e2 || !e2.trackQuantity) return;
3862
+ let { availabilityStatus: t2, inventoryQuantity: n2, preorderInfo: r2 } = e2, i2 = t2 === `PREORDER` ? r2?.quantity : n2;
3863
+ if (i2 != null) return Math.max(0, i2);
3864
+ }
3865
+ function Tc(e2) {
3866
+ let { availabilityStatus: t2, preorderAvailability: n2 } = e2 ?? {}, r2 = t2 !== pc.OUT_OF_STOCK;
3867
+ return { isInStock: r2, isPreOrderState: n2 === mc.ALL_VARIANTS || n2 === mc.SOME_VARIANTS && !r2 };
3868
+ }
3869
+ function Ec(e2, t2) {
3870
+ return t2 ? { isInStock: t2.availabilityStatus === Z.IN_STOCK, isPreOrderState: t2.availabilityStatus === Z.PREORDER } : Tc(e2.inventory);
3871
+ }
3872
+ function Dc(e2, t2) {
3873
+ return (0, import_react.useMemo)(() => {
3874
+ let { isInStock: n2, isPreOrderState: r2 } = Ec(e2, t2);
3875
+ return { isInStock: n2, isPreOrderState: r2, preOrderMessage: r2 ? t2?.preorderInfo?.message : void 0, remainingItemCount: wc(t2) };
3876
+ }, [e2.inventory, t2]);
3877
+ }
3878
+ function Oc(e2) {
3879
+ return { type: `image`, src: e2.url, width: e2.width, height: e2.height, ...e2.name === void 0 ? {} : { title: e2.name }, ...e2.alt === void 0 ? {} : { parameters: { alt: e2.alt } } };
3880
+ }
3881
+ var kc = `11062b_7b9f1e3756b64285ad5cf5e244b4ae77~mv2.png`;
3882
+ var Ac = { uri: kc, url: `https://static.wixstatic.com/media/${kc}`, width: 460, height: 460 };
3883
+ var jc = [Oc(Ac)];
3884
+ function Mc(e2, t2, n2) {
3885
+ let r2 = Fc(e2, Nc(e2, t2, n2));
3886
+ return r2.length > 0 ? r2 : e2.media ?? [];
3887
+ }
3888
+ function Nc(e2, t2, n2) {
3889
+ let r2 = e2.options.flatMap((e3) => Pc(e3.choices, t2[e3.id])), i2 = Object.values(e2.modifiers).flatMap((e3) => Pc(e3.choices, n2[e3.id]));
3890
+ return [.../* @__PURE__ */ new Set([...r2, ...i2])];
3891
+ }
3892
+ function Pc(e2, t2) {
3893
+ return e2?.find((e3) => e3.choiceId === t2)?.mediaIds ?? [];
3894
+ }
3895
+ function Fc(e2, t2) {
3896
+ let n2 = new Map((e2.media ?? []).map((e3) => [e3.id, e3]));
3897
+ return t2.flatMap((e3) => {
3898
+ let t3 = n2.get(e3);
3899
+ return t3 ? [t3] : [];
3900
+ });
3901
+ }
3902
+ function Ic(e2) {
3903
+ return e2.map((e3) => e3.id).join(`|`);
3904
+ }
3905
+ function Lc(e2) {
3906
+ return e2.length > 0 ? e2.map((e3) => e3.media) : jc;
3907
+ }
3908
+ function Rc({ product: e2, selectedOptions: i2, selectedModifiers: a2 }) {
3909
+ let o2 = (0, import_react.useMemo)(() => Lc(e2.media ?? []), [e2.media]), s2 = e2.mainMedia ?? Ac, c2 = (0, import_react.useMemo)(() => Mc(e2, i2, a2), [e2, i2, a2]), l2 = (0, import_react.useMemo)(() => Lc(c2), [c2]), u2 = Ic(c2), [d2, f2] = (0, import_react.useState)(u2), [p2, m2] = (0, import_react.useState)(0);
3910
+ d2 !== u2 && (f2(u2), m2(0));
3911
+ let h2 = (0, import_react.useCallback)((e3) => m2(e3), []);
3912
+ return (0, import_react.useMemo)(() => ({ allMedia: o2, mainMedia: s2, media: l2, selectedMediaIndex: p2, selectMedia: h2 }), [o2, s2, l2, p2, h2]);
3913
+ }
3914
+ function zc(e2) {
3915
+ return Object.entries(e2).map(([e3, t2]) => ({ optionId: e3, choiceId: t2 }));
3916
+ }
3917
+ function Bc(e2) {
3918
+ return Object.entries(e2).map(([e3, t2]) => ({ modifierId: e3, value: t2 }));
3919
+ }
3920
+ function Vc(e2, t2, r2, i2 = false) {
3921
+ let { selectedVariant: a2 } = t2, o2 = qs(e2, a2), s2 = Dc(e2, a2), c2 = Rc({ product: e2, selectedOptions: t2.selectedOptions, selectedModifiers: t2.selectedModifiers }), l2 = Ks(e2, a2), { getPageAbsoluteUrl: u2 } = ti(), d2 = (0, import_react.useMemo)(() => {
3922
+ if (!e2.slug) return;
3923
+ let t3 = u2(U.PRODUCT_PAGE, e2.slug);
3924
+ return t3 ? { href: t3 } : void 0;
3925
+ }, [e2.slug, u2]);
3926
+ return (0, import_react.useMemo)(() => {
3927
+ let { selectedVariant: e3, setHasAttemptedSubmit: n2, isSelectionValid: a3, selectedOptions: u3, selectedModifiers: f2, selectedSubscriptionPlanId: p2, quantity: m2, ...h2 } = t2;
3928
+ return { ...o2, link: d2, ...r2, ...h2, buyerSelections: { options: zc(u3), modifiers: Bc(f2), subscriptionPlanId: p2, quantity: m2 }, ...s2, ...c2, ...l2, isBackInStockEnabled: i2 };
3929
+ }, [o2, d2, r2, t2, s2, c2, l2, i2]);
3930
+ }
3931
+ var Hc = `one-time`;
3932
+ var Uc = H(`@wix/viewer-service-environment`);
3933
+ function Wc() {
3934
+ return (0, import_services_manager_react.useService)(Uc).language;
3935
+ }
3936
+ var Gc = (e2) => {
3937
+ let t2 = e2?.maximumFractionDigits ?? 2;
3938
+ return (e3) => e3?.toFixed(t2);
3939
+ };
3940
+ var Kc = (e2, t2, n2) => {
3941
+ let r2 = new Intl.NumberFormat(t2, { style: `currency`, currency: e2, ...n2 });
3942
+ return (e3) => {
3943
+ if (e3 != null) return r2.format(e3);
3944
+ };
3945
+ };
3946
+ function qc(e2, t2, n2) {
3947
+ return e2 ? Kc(e2, t2, n2) : Gc(n2);
3948
+ }
3949
+ function Jc(e2, t2) {
3950
+ let r2 = Wc();
3951
+ return (0, import_react.useMemo)(() => qc(e2, r2, t2), [e2, r2, t2]);
3952
+ }
3953
+ function Q(e2, t2) {
3954
+ return e2 === void 0 ? void 0 : { amount: e2, formattedAmount: t2(e2) };
3955
+ }
3956
+ function Yc(e2, t2, n2) {
3957
+ return { id: e2.id, name: e2.name, isOneTimePurchase: false, description: e2.description, currentPrice: Q(t2.currentSellingPrice, n2), originalPrice: Q(t2.priceBeforeDiscount, n2), frequency: e2.frequency, interval: e2.interval, duration: e2.billingCycles };
3958
+ }
3959
+ function Xc(e2) {
3960
+ return e2 === void 0 ? void 0 : { description: e2.description };
3961
+ }
3962
+ function Zc(e2, t2) {
3963
+ return { currentSellingPrice: Q(e2.currentSellingPrice, t2), priceBeforeDiscount: Q(e2.priceBeforeDiscount, t2), pricePerUnit: Xc(e2.pricePerUnit) };
3964
+ }
3965
+ function Qc(e2, t2) {
3966
+ return { minCurrentSellingPrice: Q(e2.minCurrentSellingPrice, t2), maxCurrentSellingPrice: Q(e2.maxCurrentSellingPrice, t2), minPriceBeforeDiscount: Q(e2.minPriceBeforeDiscount, t2), maxPriceBeforeDiscount: Q(e2.maxPriceBeforeDiscount, t2), minPricePerUnit: Xc(e2.minPricePerUnit), maxPricePerUnit: Xc(e2.maxPricePerUnit) };
3967
+ }
3968
+ function $c(e2, t2, n2, r2) {
3969
+ if (e2.length === 0) return [];
3970
+ let i2 = e2.map(({ subscription: e3, price: t3 }) => Yc(e3, t3, r2));
3971
+ return t2 ? [{ id: Hc, name: `One-time purchase`, isOneTimePurchase: true, currentPrice: Q(n2.currentSellingPrice, r2) }, ...i2] : i2;
3972
+ }
3973
+ function el({ product: e2, userInputs: t2, hasLoadedVariants: r2 }) {
3974
+ let { selectedVariant: i2, selectedSubscriptionPlanId: a2 } = t2, o2 = Jc(e2.currency);
3975
+ return (0, import_react.useMemo)(() => {
3976
+ let t3 = wo(e2, i2, r2), n2 = { ...Zc(To(t3, a2), o2), ...Qc(t3.productPriceRange, o2) }, s2 = $c(t3.subscriptionPlanPrices, e2.subscriptionDetails.allowOneTimePurchases, t3.productPrice, o2);
3977
+ return { currency: e2.currency, pricing: n2, subscriptionPlans: s2 };
3978
+ }, [e2, i2, a2, r2, o2]);
3979
+ }
3980
+ var tl = function(e2) {
3981
+ return e2.PRODUCT_BY_SLUG = `product-by-slug`, e2.PRODUCT_BY_ID = `product-by-id`, e2.PRODUCT_ITEM = `product-item`, e2;
3982
+ }({});
3983
+ function nl(e2) {
3984
+ let { isInStock: t2, isPreOrderState: n2 } = Tc(e2);
3985
+ return n2 ? Z.PREORDER : t2 ? Z.IN_STOCK : Z.OUT_OF_STOCK;
3986
+ }
3987
+ function rl(e2) {
3988
+ let { minPriceVariant: t2 } = e2, n2 = e2.options.length === 0;
3989
+ return !t2 || !n2 ? { variants: [], inventoryItems: [] } : { variants: [t2], inventoryItems: [{ variantId: t2.id, availabilityStatus: nl(e2.inventory), trackQuantity: false }] };
3990
+ }
3991
+ var il = (e2) => Number.parseFloat(e2?.amount);
3992
+ var al = (e2) => e2?.amount == null ? void 0 : il(e2);
3993
+ function ol(e2) {
3994
+ return e2.filter((e3) => e3.visible !== false).map(sl);
3995
+ }
3996
+ var sl = (e2) => {
3997
+ let t2 = Object.fromEntries((e2.choices ?? []).map((e3) => {
3998
+ let t3 = e3.optionChoiceIds;
3999
+ return [t3?.optionId, t3?.choiceId];
4000
+ }));
4001
+ return { id: e2._id, sku: e2.sku ?? void 0, choices: t2, price: ll(e2), subscriptionPrices: ul(e2) };
4002
+ };
4003
+ function cl(e2) {
4004
+ return e2?.description == null ? void 0 : { description: e2.description };
4005
+ }
4006
+ var ll = (e2) => {
4007
+ let t2 = e2.price;
4008
+ return { actualPrice: il(t2?.actualPrice), compareAtPrice: al(t2?.compareAtPrice), priceAfterDiscount: al(t2?.priceAfterDiscount), pricePerUnit: cl(e2.physicalProperties?.pricePerUnit) };
4009
+ };
4010
+ var ul = (e2) => (e2.subscriptionPricesInfo?.subscriptionPrices ?? []).map((e3) => ({ subscriptionId: e3.subscriptionId, price: il(e3.price) }));
4011
+ function dl(e2) {
4012
+ return e2.map((e3) => ({ variantId: e3.variantId ?? ``, availabilityStatus: e3.availabilityStatus, quantity: e3.quantity ?? void 0, trackQuantity: e3.trackQuantity ?? false, preorderInfo: e3.preorderInfo ? { message: e3.preorderInfo.message ?? void 0, quantity: e3.preorderInfo.quantity ?? void 0 } : void 0 }));
4013
+ }
4014
+ async function fl(e2, t2) {
4015
+ return dl((await cc().eq(`productId`, e2).eq(`locationId`, t2).find()).items ?? []);
4016
+ }
4017
+ var pl = [hc.SUBSCRIPTION_PRICES_INFO, hc.DISCOUNT_INFO];
4018
+ async function ml(e2, t2) {
4019
+ let [n2, r2] = await Promise.all([xc(e2, { fields: pl }), fl(e2, t2)]);
4020
+ return { variants: ol(n2.variantsInfo?.variants ?? []), inventoryItems: r2 };
4021
+ }
4022
+ function hl(e2, n2) {
4023
+ let [i2, a2] = (0, import_react.useState)(false), { data: o2, isFetching: s2 } = Zr({ queryKey: [`product-variants`, e2, n2], queryFn: () => ml(e2, n2), enabled: i2, staleTime: 1 / 0, retry: false });
4024
+ return { variantsData: o2, isLoadingVariants: s2, requestVariants: (0, import_react.useCallback)(() => {
4025
+ a2(true);
4026
+ }, []) };
4027
+ }
4028
+ function gl(e2, t2) {
4029
+ let { variantsData: r2, isLoadingVariants: i2, requestVariants: a2 } = hl(e2.id, t2), { variants: o2, inventoryItems: s2 } = (0, import_react.useMemo)(() => r2 ?? rl(e2), [r2, e2]);
4030
+ return { product: (0, import_react.useMemo)(() => ({ ...e2, variants: o2 }), [e2, o2]), inventoryItems: s2, hasLoadedVariants: (0, import_react.useMemo)(() => r2 !== void 0, [r2]), isLoadingVariants: i2, requestVariants: a2 };
4031
+ }
4032
+ var _l = { type: `invalid-purchase`, message: `This item can't be purchased.` };
4033
+ function vl(e2) {
4034
+ let t2 = e2;
4035
+ return { type: `cart`, message: t2?.message, details: t2?.details };
4036
+ }
4037
+ var yl = H(`@wix/viewer-service-router`);
4038
+ var bl = H(`@wix/site-service-editor-context`);
4039
+ var xl = H(`@wix/site-service-pages`);
4040
+ var Sl = (e2) => {
4041
+ if (!e2) return ``;
4042
+ let t2 = new URLSearchParams(e2).toString();
4043
+ return t2 ? `?${t2}` : ``;
4044
+ };
4045
+ var Cl = (e2, t2, n2) => {
4046
+ let r2 = `./${e2.replace(/^\//, ``)}`;
4047
+ return n2 ? r2 : new URL(r2, `${t2.replace(/\/$/, ``)}/`).href;
4048
+ };
4049
+ var wl = () => {
4050
+ let e2 = (0, import_services_manager_react.useService)(yl), n2 = (0, import_services_manager_react.useService)(Qr), r2 = (0, import_services_manager_react.useService)(bl), i2 = (0, import_services_manager_react.useService)(xl), { getPageRelativeUrl: a2, getPageAbsoluteUrl: o2 } = ti();
4051
+ return { navigateToPage: (0, import_react.useCallback)(async (t2, i3) => {
4052
+ try {
4053
+ let a3 = n2.appSectionRelativeUrl(ei, t2);
4054
+ if (!a3) return false;
4055
+ let o3 = `${a3}${Sl(i3)}`;
4056
+ return await e2.navigateTo({ href: Cl(o3, n2.siteUrl, r2.previewMode) }), true;
4057
+ } catch {
4058
+ return false;
4059
+ }
4060
+ }, [e2, n2, r2]), navigateToProductPage: (0, import_react.useCallback)(async (t2) => {
4061
+ try {
4062
+ let n3 = r2.previewMode ? a2(U.PRODUCT_PAGE, t2) : o2(U.PRODUCT_PAGE, t2);
4063
+ if (!n3) throw Error(`Failed to resolve app section relative URL for the product page`);
4064
+ await e2.navigateTo({ href: n3 });
4065
+ } catch (e3) {
4066
+ console.error(`navigateToProductPage: failed to navigate to product "${t2}"`, e3);
4067
+ }
4068
+ }, [e2, r2, a2, o2]), openLightbox: (0, import_react.useCallback)(async (t2) => {
4069
+ try {
4070
+ let n3 = Object.entries(i2.pages).find(([, e3]) => e3.popup && e3.appPageId === t2)?.[0];
4071
+ return n3 ? (await e2.navigateTo({ linkPopupId: n3 }), true) : false;
4072
+ } catch {
4073
+ return false;
4074
+ }
4075
+ }, [e2, i2]) };
4076
+ };
4077
+ async function Tl(e2) {
4078
+ await Ns({ catalogItems: [e2] });
4079
+ }
4080
+ var El = H(`@wix/site-service-public-api-caller`);
4081
+ var Dl = () => {
4082
+ let e2 = (0, import_services_manager_react.useGetService)();
4083
+ return { reloadCart: (0, import_react.useCallback)(async () => {
4084
+ if (typeof window < `u`) try {
4085
+ await e2(El).callPublicApi(ei, `cart.reloadCart`, []);
4086
+ } catch {
4087
+ }
4088
+ }, [e2]) };
4089
+ };
4090
+ var Ol = function(e2) {
4091
+ return e2.IDLE = `idle`, e2.IN_PROGRESS = `in-progress`, e2.SUCCESS = `success`, e2;
4092
+ }({});
4093
+ var kl = function(e2) {
4094
+ return e2.NONE = `none`, e2.NAVIGATE_TO_CART = `navigate-to-cart`, e2.OPEN_SIDE_CART = `open-side-cart`, e2;
4095
+ }({});
4096
+ var Al = () => {
4097
+ let [e2, n2] = (0, import_react.useState)(Ol.IDLE), { navigateToPage: i2, openLightbox: a2 } = wl(), { reloadCart: o2 } = Dl(), s2 = (0, import_react.useCallback)(async (e3) => {
4098
+ switch (e3) {
4099
+ case kl.NAVIGATE_TO_CART:
4100
+ await i2(U.CART);
4101
+ return;
4102
+ case kl.OPEN_SIDE_CART:
4103
+ await a2(U.SIDE_CART);
4104
+ return;
4105
+ case kl.NONE:
4106
+ default:
4107
+ return;
4108
+ }
4109
+ }, [i2, a2]);
4110
+ return { addToCart: (0, import_react.useCallback)(async (e3, t2) => {
4111
+ n2(Ol.IN_PROGRESS);
4112
+ try {
4113
+ await Tl(e3);
4114
+ } catch (e4) {
4115
+ return n2(Ol.IDLE), { ok: false, error: vl(e4) };
4116
+ }
4117
+ try {
4118
+ await o2(), n2(Ol.SUCCESS), await s2(t2), setTimeout(() => n2(Ol.IDLE), 2e3);
4119
+ } catch {
4120
+ n2(Ol.IDLE);
4121
+ }
4122
+ return { ok: true };
4123
+ }, [o2, s2]), addToCartState: e2, reloadCart: o2 };
4124
+ };
4125
+ async function jl(e2) {
4126
+ let t2 = await Ds({ cart: { source: { channelType: ws.WEB } }, catalogItems: [e2] });
4127
+ if (!t2._id) throw Error(`missing checkout id`);
4128
+ return t2._id;
4129
+ }
4130
+ var Ml = function(e2) {
4131
+ return e2.IDLE = `idle`, e2.IN_PROGRESS = `in-progress`, e2;
4132
+ }({});
4133
+ var Nl = () => {
4134
+ let { navigateToPage: e2 } = wl(), [n2, i2] = (0, import_react.useState)(Ml.IDLE);
4135
+ return { buyNowState: n2, buyNow: (0, import_react.useCallback)(async (t2) => {
4136
+ i2(Ml.IN_PROGRESS);
4137
+ try {
4138
+ let n3 = await jl(t2);
4139
+ return await e2(U.CHECKOUT, { checkoutId: n3 }) ? { ok: true } : { ok: false, error: vl(Error(`Failed to navigate to checkout`)) };
4140
+ } catch (e3) {
4141
+ return { ok: false, error: vl(e3) };
4142
+ } finally {
4143
+ i2(Ml.IDLE);
4144
+ }
4145
+ }, [e2]) };
4146
+ };
4147
+ function Pl(e2) {
4148
+ let { product: t2, selectedVariant: n2, userSelections: r2, isPreOrder: i2 } = e2;
4149
+ return { catalogReference: { appId: $r, catalogItemId: t2.id, options: Fl({ product: t2, selectedVariant: n2, userSelections: r2, isPreOrder: i2 }) }, quantity: r2.quantity };
4150
+ }
4151
+ var Fl = ({ product: e2, selectedVariant: t2, userSelections: n2, isPreOrder: r2 }) => {
4152
+ let i2 = Il(e2, t2.choices), { choiceBasedModifiers: a2, customTextFields: o2 } = Ll(e2, n2.selectedModifiers), s2 = { ...i2, ...a2 }, { selectedSubscriptionPlanId: c2 } = n2, l2 = { variantId: t2.id, options: s2 };
4153
+ return Object.keys(o2).length > 0 && (l2.customTextFields = o2), Rl(c2) && (l2.subscriptionOptionId = c2), r2 && (l2.preOrderRequested = true), l2;
4154
+ };
4155
+ var Il = (e2, t2) => {
4156
+ let n2 = {};
4157
+ for (let [r2, i2] of Object.entries(t2)) {
4158
+ let t3 = e2.options.find((e3) => e3.id === r2), a2 = t3?.choices.find((e3) => e3.choiceId === i2);
4159
+ t3 && a2 && (n2[t3.key] = a2.key);
4160
+ }
4161
+ return n2;
4162
+ };
4163
+ var Ll = (e2, t2) => {
4164
+ let n2 = {}, r2 = {};
4165
+ for (let i2 of Object.values(e2.modifiers)) if (i2.modifierRenderType === fc.FREE_TEXT) {
4166
+ let e3 = i2.freeTextSettings?.key;
4167
+ e3 && (r2[e3] = t2[i2.id] ?? ``);
4168
+ } else {
4169
+ let e3 = t2[i2.id], r3 = i2.choices?.find((t3) => t3.choiceId === e3);
4170
+ r3 && (n2[i2.key] = r3.key);
4171
+ }
4172
+ return { choiceBasedModifiers: n2, customTextFields: r2 };
4173
+ };
4174
+ var Rl = (e2) => e2 !== void 0 && e2 !== `one-time`;
4175
+ function zl(e2, r2, i2) {
4176
+ let { selectedVariant: a2, selectedModifiers: o2, selectedSubscriptionPlanId: s2, quantity: c2, isSelectionValid: l2, setHasAttemptedSubmit: u2 } = r2, { addToCart: d2, addToCartState: f2 } = Al(), { buyNow: p2, buyNowState: m2 } = Nl(), h2 = i2.isPreOrderState || i2.isInStock, g2 = (0, import_react.useCallback)(async (t2) => !h2 || (u2(true), !l2 || !a2) ? { ok: false, error: _l } : d2(Pl({ product: e2, selectedVariant: a2, userSelections: { selectedModifiers: o2, selectedSubscriptionPlanId: s2, quantity: c2 }, isPreOrder: i2.isPreOrderState }), t2 ?? kl.NONE), [h2, i2.isPreOrderState, l2, u2, e2, a2, o2, s2, c2, d2]), _2 = (0, import_react.useCallback)(async () => !h2 || (u2(true), !l2 || !a2) ? { ok: false, error: _l } : p2(Pl({ product: e2, selectedVariant: a2, userSelections: { selectedModifiers: o2, selectedSubscriptionPlanId: s2, quantity: c2 }, isPreOrder: i2.isPreOrderState })), [h2, i2.isPreOrderState, l2, u2, e2, a2, o2, s2, c2, p2]);
4177
+ return (0, import_react.useMemo)(() => ({ addToCartState: f2, buyNowState: m2, handleAddToCart: g2, handleBuyNow: _2 }), [f2, m2, g2, _2]);
4178
+ }
4179
+ var Bl = (e2, t2) => e2.every((e3) => !e3.mandatory || Vl(e3, t2[e3.id]));
4180
+ var Vl = (e2, t2) => e2.modifierRenderType === fc.FREE_TEXT ? !!t2 : e2.choices?.some((e3) => e3.choiceId === t2);
4181
+ var Hl = function(e2) {
4182
+ return e2.DIRECT_ADD = `direct-add`, e2.NAVIGATE_TO_PRODUCT_PAGE = `navigate-to-product-page`, e2;
4183
+ }({});
4184
+ function Ul(e2, t2) {
4185
+ return Wl(e2, t2) ? Hl.NAVIGATE_TO_PRODUCT_PAGE : Hl.DIRECT_ADD;
4186
+ }
4187
+ var Wl = (e2, t2) => e2.subscriptionDetails.subscriptions.length > 0 || !Gl(e2, t2);
4188
+ var Gl = (e2, t2) => e2.options.length === 0 && Object.keys(e2.modifiers).length === 0 || t2.selectedVariant !== null && Bl(Object.values(t2.modifiers), t2.selectedModifiers);
4189
+ function Kl(e2, r2) {
4190
+ let { navigateToProductPage: i2 } = wl(), { addToCartState: a2, buyNowState: o2, handleAddToCart: s2, handleBuyNow: c2 } = zl(e2, r2, Dc(e2, r2.selectedVariant)), l2 = Ul(e2, r2), u2 = (0, import_react.useCallback)(async () => e2.slug ? (await i2(e2.slug), { ok: true }) : { ok: false, error: _l }, [e2.slug, i2]), d2 = (0, import_react.useCallback)((e3) => {
4191
+ switch (l2) {
4192
+ case Hl.DIRECT_ADD:
4193
+ return s2(e3);
4194
+ case Hl.NAVIGATE_TO_PRODUCT_PAGE:
4195
+ return u2();
4196
+ }
4197
+ }, [l2, s2, u2]), f2 = (0, import_react.useCallback)(() => {
4198
+ switch (l2) {
4199
+ case Hl.DIRECT_ADD:
4200
+ return c2();
4201
+ case Hl.NAVIGATE_TO_PRODUCT_PAGE:
4202
+ return u2();
4203
+ }
4204
+ }, [l2, c2, u2]);
4205
+ return (0, import_react.useMemo)(() => ({ addToCartState: a2, buyNowState: o2, handleAddToCart: d2, handleBuyNow: f2 }), [a2, o2, d2, f2]);
4206
+ }
4207
+ function ql(e2) {
4208
+ return Object.values(e2).toSorted().join(`_`);
4209
+ }
4210
+ function Jl(e2) {
4211
+ let t2 = /* @__PURE__ */ new Map();
4212
+ for (let n2 of e2) t2.set(ql(n2.choices), n2);
4213
+ return t2;
4214
+ }
4215
+ function Yl(e2, t2, n2) {
4216
+ let r2 = Object.keys(n2).length > 0, i2 = {};
4217
+ for (let a2 of e2) {
4218
+ i2[a2.id] = {};
4219
+ for (let e3 of a2.choices) {
4220
+ if (!r2) {
4221
+ i2[a2.id][e3.choiceId] = { isInStock: e3.inStock ?? true, isVisible: e3.visible ?? true };
4222
+ continue;
4223
+ }
4224
+ if (e3.inStock === false && e3.visible === false) {
4225
+ i2[a2.id][e3.choiceId] = { isInStock: false, isVisible: false };
4226
+ continue;
4227
+ }
4228
+ let { isInStock: o2, isVisible: s2 } = Xl({ ...n2, [a2.id]: e3.choiceId }, t2);
4229
+ i2[a2.id][e3.choiceId] = { isInStock: o2, isVisible: s2 };
4230
+ }
4231
+ }
4232
+ return i2;
4233
+ }
4234
+ function Xl(e2, t2) {
4235
+ let n2 = false, r2 = false;
4236
+ for (let i2 of t2.values()) if (Object.entries(e2).every(([e3, t3]) => i2.choices[e3] === t3) && (r2 = true, (i2.availabilityStatus === Z.IN_STOCK || i2.availabilityStatus === Z.PREORDER) && (n2 = true), n2)) break;
4237
+ return { isInStock: n2, isVisible: r2 };
4238
+ }
4239
+ function Zl(e2, t2) {
4240
+ let n2 = /* @__PURE__ */ new Map();
4241
+ for (let e3 of t2) n2.set(e3.variantId, e3);
4242
+ return e2.map((e3) => {
4243
+ let t3 = n2.get(e3.id);
4244
+ return { ...e3, availabilityStatus: t3?.availabilityStatus, preorderInfo: t3?.preorderInfo, inventoryQuantity: t3?.quantity, trackQuantity: t3?.trackQuantity };
4245
+ });
4246
+ }
4247
+ function Ql({ product: e2, selections: t2, selectedVariant: n2 }) {
4248
+ let r2 = { options: $l(e2.options, t2.selectedOptions, n2), modifiers: tu(e2.modifiers, t2.selectedModifiers), quantity: eu(t2.quantity, n2), subscriptionPlanId: nu(e2.subscriptionDetails, t2.selectedSubscriptionPlanId) };
4249
+ return { valid: Object.values(r2.options).length === 0 && Object.values(r2.modifiers).length === 0 && !r2.quantity && !r2.subscriptionPlanId, fields: r2 };
4250
+ }
4251
+ function $l(e2, t2, n2) {
4252
+ if (n2 !== null) return {};
4253
+ let r2 = {};
4254
+ for (let n3 of e2) t2[n3.id] || (r2[n3.id] = `missing`);
4255
+ return r2;
4256
+ }
4257
+ function eu(e2, t2) {
4258
+ if (e2 < 1) return `below-min`;
4259
+ if (e2 > Sc(t2)) return `above-max`;
4260
+ }
4261
+ function tu(e2, t2) {
4262
+ let n2 = Object.values(e2).filter((e3) => e3.mandatory && !Vl(e3, t2[e3.id]));
4263
+ return Object.fromEntries(n2.map((e3) => [e3.id, `missing`]));
4264
+ }
4265
+ function nu(e2, t2) {
4266
+ if (e2.subscriptions.length !== 0) return t2 ? t2 === `one-time` ? e2.allowOneTimePurchases ? void 0 : `missing` : ru(e2, t2) ? void 0 : `missing` : `missing`;
4267
+ }
4268
+ function ru(e2, t2) {
4269
+ return e2.subscriptions.some((e3) => e3.id === t2);
4270
+ }
4271
+ var $ = function(e2) {
4272
+ return e2.PRODUCT_OPTION = `PRODUCT_OPTION`, e2.MODIFIER = `MODIFIER`, e2;
4273
+ }({});
4274
+ function iu(e2, t2) {
4275
+ if (!t2) return;
4276
+ let n2 = t2.members.find((t3) => t3.productId === e2.id);
4277
+ if (!n2) return;
4278
+ let r2 = { groupingCustomizationId: t2.groupingCustomizationId, currentProductChoiceId: n2.choice.choiceId, members: t2.members };
4279
+ if (t2.customizationType === $.PRODUCT_OPTION) return e2.options.find(({ id: e3 }) => e3 === t2.groupingCustomizationId) ? { ...r2, customizationType: $.PRODUCT_OPTION } : void 0;
4280
+ if (e2.modifiers[t2.groupingCustomizationId]) return { ...r2, customizationType: $.MODIFIER };
4281
+ }
4282
+ function au(e2, t2) {
4283
+ return e2.members.find((e3) => e3.choice.choiceId === t2);
4284
+ }
4285
+ function ou(e2, t2, n2) {
4286
+ return !!e2 && t2 === e2.groupingCustomizationId && n2 !== e2.currentProductChoiceId;
4287
+ }
4288
+ function su(e2, t2) {
4289
+ if (!t2) return;
4290
+ if (t2.customizationType === $.PRODUCT_OPTION) {
4291
+ let n3 = e2.options.find(({ id: e3 }) => e3 === t2.groupingCustomizationId);
4292
+ if (!n3) return;
4293
+ let r3 = cu(n3, t2);
4294
+ return { options: e2.options.map((e3) => e3.id === n3.id ? r3 : e3) };
4295
+ }
4296
+ let n2 = e2.modifiers[t2.groupingCustomizationId];
4297
+ if (!n2) return;
4298
+ let r2 = lu(n2, t2);
4299
+ return { modifiers: { ...e2.modifiers, [t2.groupingCustomizationId]: r2 } };
4300
+ }
4301
+ function cu(e2, t2) {
4302
+ return { ...e2, isGroupedOption: true, choices: t2.members.map((e3) => ({ ...e3.choice, inStock: e3.inventoryAvailabilityStatus !== `OUT_OF_STOCK` })) };
4303
+ }
4304
+ function lu(e2, t2) {
4305
+ return { ...e2, choices: t2.members.map(({ choice: e3 }) => e3) };
4306
+ }
4307
+ function uu(e2, t2) {
4308
+ if (!t2 || t2.customizationType !== $.PRODUCT_OPTION) return e2;
4309
+ let n2 = Object.fromEntries(t2.members.map((e3) => [e3.choice.choiceId, { isInStock: e3.inventoryAvailabilityStatus !== `OUT_OF_STOCK`, isVisible: true }]));
4310
+ return { ...e2, [t2.groupingCustomizationId]: { ...n2, ...e2[t2.groupingCustomizationId] } };
4311
+ }
4312
+ function du(e2, r2) {
4313
+ let { navigateToProductPage: i2 } = wl(), a2 = (0, import_react.useMemo)(() => iu(e2, r2), [e2, r2]);
4314
+ return { productGrouping: a2, selectGroupSiblingChoice: (0, import_react.useCallback)((e3) => {
4315
+ if (!a2) return;
4316
+ let t2 = au(a2, e3);
4317
+ t2 && i2(t2.slug);
4318
+ }, [a2, i2]), productCustomizations: (0, import_react.useMemo)(() => su(e2, a2), [e2, a2]), addGroupChoicesAvailability: (0, import_react.useCallback)((e3) => uu(e3, a2), [a2]), initialSelection: (0, import_react.useMemo)(() => {
4319
+ if (!a2) return { options: {}, modifiers: {} };
4320
+ let { customizationType: t2, groupingCustomizationId: n2, currentProductChoiceId: r3 } = a2;
4321
+ if (t2 === $.MODIFIER && e2.modifiers[n2].mandatory === false) return { options: {}, modifiers: {} };
4322
+ let i3 = { [n2]: r3 };
4323
+ return t2 === $.PRODUCT_OPTION ? { options: i3, modifiers: {} } : { options: {}, modifiers: i3 };
4324
+ }, [a2, e2.modifiers]) };
4325
+ }
4326
+ function fu(e2, i2, a2) {
4327
+ let o2 = du(e2, a2), { productGrouping: s2, selectGroupSiblingChoice: c2, addGroupChoicesAvailability: l2 } = o2, [u2, d2] = (0, import_react.useState)(() => o2.initialSelection.options), [f2, p2] = (0, import_react.useState)(() => o2.initialSelection.modifiers), [m2, h2] = (0, import_react.useState)(void 0), [g2, _2] = (0, import_react.useState)(1), [v2, y2] = (0, import_react.useState)(false), b2 = (0, import_react.useMemo)(() => Jl(Zl(e2.variants, i2)), [e2.variants, i2]), x2 = (0, import_react.useMemo)(() => {
4328
+ let t2 = /* @__PURE__ */ new Map();
4329
+ return (n2) => {
4330
+ let r2 = ql(n2), i3 = t2.get(r2);
4331
+ if (i3) return i3;
4332
+ let a3 = l2(Yl(e2.options, b2, n2));
4333
+ return t2.set(r2, a3), a3;
4334
+ };
4335
+ }, [b2, e2.options, l2]), S2 = (0, import_react.useMemo)(() => x2(u2), [x2, u2]), C2 = (0, import_react.useMemo)(() => Object.keys(u2).length === e2.options.length ? b2.get(ql(u2)) ?? null : null, [b2, u2, e2.options.length]), w2 = (0, import_react.useCallback)((e3, t2) => {
4336
+ if (u2[e3] !== t2) {
4337
+ if (ou(s2, e3, t2)) {
4338
+ c2(t2);
4339
+ return;
4340
+ }
4341
+ d2((n2) => ({ ...n2, [e3]: t2 })), _2(1);
4342
+ }
4343
+ }, [u2, s2, c2]), T2 = (0, import_react.useCallback)((e3, t2) => {
4344
+ if (ou(s2, e3, t2)) {
4345
+ c2(t2);
4346
+ return;
4347
+ }
4348
+ p2((n2) => n2[e3] === t2 ? n2 : { ...n2, [e3]: t2 });
4349
+ }, [s2, c2]), E2 = (0, import_react.useCallback)((e3) => {
4350
+ p2((t2) => {
4351
+ if (!(e3 in t2)) return t2;
4352
+ let { [e3]: n2, ...r2 } = t2;
4353
+ return r2;
4354
+ });
4355
+ }, []), D2 = (0, import_react.useCallback)((e3) => {
4356
+ h2(e3);
4357
+ }, []), O2 = (0, import_react.useMemo)(() => Sc(C2), [C2]), k2 = (0, import_react.useMemo)(() => Cc(g2, O2), [g2, O2]), ee2 = (0, import_react.useCallback)((e3) => {
4358
+ _2(e3);
4359
+ }, []), te2 = (0, import_react.useMemo)(() => Ql({ product: e2, selections: { selectedOptions: u2, selectedModifiers: f2, selectedSubscriptionPlanId: m2, quantity: k2 }, selectedVariant: C2 }), [e2, u2, f2, m2, k2, C2]), ne2 = o2.productCustomizations?.options ?? e2.options, re2 = o2.productCustomizations?.modifiers ?? e2.modifiers;
4360
+ return (0, import_react.useMemo)(() => ({ options: ne2, modifiers: re2, quantity: k2, selectedOptions: u2, selectedModifiers: f2, selectedSubscriptionPlanId: m2, selectedVariant: C2, selectedVariantId: C2?.id ?? null, selectionsAvailability: S2, maxPurchasableQuantity: O2, isSelectionValid: te2.valid, selectionValidationErrors: te2.fields, hasAttemptedSubmit: v2, setHasAttemptedSubmit: y2, selectOption: w2, selectModifier: T2, clearModifierSelection: E2, selectSubscriptionPlan: D2, selectQuantity: ee2 }), [ne2, re2, k2, u2, f2, m2, C2, S2, O2, te2, v2, w2, T2, E2, D2, ee2]);
4361
+ }
4362
+ function pu({ product: e2, inventoryItems: r2, hasLoadedVariants: i2, requestVariants: a2 }) {
4363
+ let o2 = fu(e2, r2), { selectOption: s2, selectModifier: c2, selectSubscriptionPlan: l2, selectQuantity: u2, selectionsAvailability: d2, ...f2 } = o2, p2 = (0, import_react.useCallback)((e3, t2) => {
4364
+ a2(), s2(e3, t2);
4365
+ }, [a2, s2]), m2 = (0, import_react.useCallback)((e3, t2) => {
4366
+ a2(), c2(e3, t2);
4367
+ }, [a2, c2]), h2 = (0, import_react.useCallback)((e3) => {
4368
+ a2(), u2(e3);
4369
+ }, [a2, u2]), g2 = (0, import_react.useMemo)(() => i2 ? d2 : Yl(e2.options, /* @__PURE__ */ new Map(), {}), [i2, d2, e2.options]);
4370
+ return (0, import_react.useMemo)(() => ({ ...f2, selectOption: p2, selectModifier: m2, selectSubscriptionPlan: l2, selectQuantity: h2, selectionsAvailability: g2 }), [o2, p2, m2, l2, h2, g2]);
4371
+ }
4372
+ var mu = { subscriptionPlans: null, description: null, infoSections: null };
4373
+ function hu() {
4374
+ return (0, import_product_context_provider.useProductContext)();
4375
+ }
4376
+ function gu({ product: e2, defaultLocationId: t2 }) {
4377
+ let r2 = gl(e2, t2), i2 = pu(r2), a2 = Kl(r2.product, i2), o2 = el({ product: r2.product, userInputs: i2, hasLoadedVariants: r2.hasLoadedVariants }), s2 = Vc(r2.product, i2, o2);
4378
+ return (0, import_react.useMemo)(() => ({ source: tl.PRODUCT_ITEM, ...s2, ...a2, ...mu }), [s2, a2]);
4379
+ }
4380
+ function _u({ productItem: e2, children: t2 }) {
4381
+ let n2 = gu(e2);
4382
+ return (0, import_jsx_runtime.jsx)(import_product_context_provider.default, { value: n2, children: t2 });
4383
+ }
4384
+ function vu({ productItem: e2, children: t2 }) {
4385
+ let [n2] = (0, import_react.useState)(() => new Pr());
4386
+ return e2 === void 0 ? (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: t2 }) : (0, import_jsx_runtime.jsx)(Lr, { client: n2, children: (0, import_jsx_runtime.jsx)(_u, { productItem: e2, children: t2 }, e2.product.id) });
4387
+ }
4388
+ var yu = jn(`890cc5ff-b951-47bc-86ed-4dc139f4ff0d`);
4389
+ // Annotate the CommonJS export names for ESM import in node:
4390
+ 0 && (module.exports = {
4391
+ ProductItemContextProvider,
4392
+ injectAccessTokenGetter,
4393
+ useProductItemContext,
4394
+ useProductItemContextValue
4395
+ });
4396
+ //# sourceMappingURL=context-product-item-context-provider.js.map