@wix/stores 1.0.958 → 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,1172 @@
1
+ // _sdk-exports/context-category-info-context-provider/runtime.js
2
+ import { Suspense as e, createContext as t, useCallback as n, useContext as r, useMemo as i, useState as a } from "react";
3
+ import { useGetService as o, useService as s } from "@wix/services-manager-react";
4
+ import { jsx as c } from "react/jsx-runtime";
5
+ var l = {};
6
+ function u(e2, t2 = false, n2 = (e3) => e3) {
7
+ return () => ({ __type: `event-definition`, type: e2, isDomainEvent: t2, transformations: n2 });
8
+ }
9
+ var d = (e2) => {
10
+ switch (e2) {
11
+ case `get`:
12
+ case `GET`:
13
+ return `GET`;
14
+ case `post`:
15
+ case `POST`:
16
+ return `POST`;
17
+ case `put`:
18
+ case `PUT`:
19
+ return `PUT`;
20
+ case `delete`:
21
+ case `DELETE`:
22
+ return `DELETE`;
23
+ case `patch`:
24
+ case `PATCH`:
25
+ return `PATCH`;
26
+ case `head`:
27
+ case `HEAD`:
28
+ return `HEAD`;
29
+ case `options`:
30
+ case `OPTIONS`:
31
+ return `OPTIONS`;
32
+ default:
33
+ throw Error(`Unknown method: ${e2}`);
34
+ }
35
+ };
36
+ var ee = (e2) => (t2) => async (n2) => {
37
+ let r2, i2 = (t3) => {
38
+ 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.`);
39
+ let { method: i3, url: a2, params: o2 } = r2;
40
+ return { ...r2, method: d(i3), url: a2, data: r2.data, params: o2 };
41
+ };
42
+ try {
43
+ let e3 = await t2.request(i2);
44
+ if (r2 === void 0) throw Error(`Request options were not created for this request, please reach out to support channels for assistance.`);
45
+ let n3 = Array.isArray(r2.transformResponse) ? r2.transformResponse : [r2.transformResponse], a2 = e3.data;
46
+ return n3.forEach((t3) => {
47
+ t3 && (a2 = t3(e3.data, e3.headers));
48
+ }), a2;
49
+ } catch (e3) {
50
+ throw typeof e3 == `object` && e3 && `response` in e3 && typeof e3.response == `object` && e3.response !== null && `data` in e3.response ? e3.response.data : e3;
51
+ }
52
+ };
53
+ var te = (e2) => e2.__isAmbassador ? true : !!e2().__isAmbassador;
54
+ var ne = `__metadata`;
55
+ var re = `edge.wixapis.com`;
56
+ var ie = class extends Error {
57
+ message;
58
+ response;
59
+ constructor(e2, t2) {
60
+ super(e2), this.message = e2, this.response = t2;
61
+ }
62
+ async details() {
63
+ let e2 = await this.response.json();
64
+ return f(this.response.status, e2?.message, e2?.details, { requestId: this.response.headers.get(`X-Wix-Request-Id`), details: e2 });
65
+ }
66
+ };
67
+ var f = (e2, t2, n2, r2) => ({ details: { ...!n2?.validationError && { applicationError: { description: t2, code: e2, data: r2 } }, ...n2 }, message: t2, requestId: r2?.requestId });
68
+ var ae = (e2) => e2?.method && [`post`, `put`, `patch`].includes(e2.method.toLocaleLowerCase()) && e2.body ? { "Content-Type": `application/json` } : {};
69
+ var oe = (e2) => e2 && typeof e2 == `object` && !Array.isArray(e2);
70
+ var se = (e2) => e2.__type === `host`;
71
+ function ce(e2, t2) {
72
+ return e2.create(t2);
73
+ }
74
+ var p = `x-wix-bi-gateway`;
75
+ function m(e2, t2, n2) {
76
+ return { [p]: le({ environment: `js-sdk${n2 ? `-${n2}` : ``}`, "package-name": e2.packageName ?? t2?.PACKAGE_NAME, "method-fqn": e2.methodFqn, entity: e2.entityFqdn }) };
77
+ }
78
+ function le(e2) {
79
+ return Object.entries(e2).filter(([e3, t2]) => !!t2).map(([e3, t2]) => `${e3}=${t2}`).join(`,`);
80
+ }
81
+ function h(e2) {
82
+ let t2 = globalThis.__wix_context__, n2 = { client: l.client, elevatedClient: l.elevatedClient }, r2;
83
+ globalThis.__wix_context__ = void 0, l.client = void 0, l.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
84
+ try {
85
+ return e2();
86
+ } finally {
87
+ globalThis.__wix_context__ = t2, l.client = n2.client, l.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
88
+ }
89
+ }
90
+ var g = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
91
+ function _(e2) {
92
+ return pe(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
93
+ }
94
+ var ue = /([\p{Ll}\d])(\p{Lu})/gu;
95
+ var de = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
96
+ var v = `$1\0$2`;
97
+ var fe = /[^\p{L}\d]+/giu;
98
+ function pe(e2) {
99
+ let t2 = e2.trim();
100
+ t2 = t2.replace(ue, v).replace(de, v), t2 = t2.replace(fe, `\0`);
101
+ let n2 = 0, r2 = t2.length;
102
+ for (; t2.charAt(n2) === `\0`; ) n2++;
103
+ if (n2 === r2) return [];
104
+ for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
105
+ return t2.slice(n2, r2).split(/\0/g);
106
+ }
107
+ var me = (e2) => `validationError` in (e2.response?.data?.details ?? {});
108
+ var he = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
109
+ var ge = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
110
+ function _e(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
111
+ if (typeof e2 != `object` || !e2) throw e2;
112
+ if (me(e2)) return ve(e2, t2, n2);
113
+ if (he(e2)) return ye(e2);
114
+ if (ge(e2)) {
115
+ let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: _(n3), data: {} }, requestId: e2.requestId };
116
+ return y(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
117
+ }
118
+ return be(e2);
119
+ }
120
+ var ve = (e2, t2, n2) => {
121
+ 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 };
122
+ return y(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e2.response?.status, requestId: i2 } });
123
+ };
124
+ var y = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
125
+ var ye = (e2) => {
126
+ 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 ?? _(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 };
127
+ return y(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e2.requestId } });
128
+ };
129
+ var be = (e2) => y(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: _(e2.response?.statusText ?? `UNKNOWN`), ...!e2.response && { runtimeError: e2 } } });
130
+ var xe = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
131
+ let a2 = { ...e2, ...t2 }, o2 = Object.keys(a2);
132
+ return r2?.filter((e3) => !r2.some((t3) => t3.field.length > e3.field.length && t3.field.startsWith(e3.field) && o2.includes(t3.field))).map((e3) => {
133
+ let r3 = t2[e3.field];
134
+ if (r3) return { ...e3, field: b(r3, i2) };
135
+ let s2 = o2?.sort((e4, t3) => t3.length - e4.length)?.find((t3) => e3.field.startsWith(t3));
136
+ if (s2) {
137
+ let t3 = a2[s2];
138
+ if (t3) return { ...e3, field: e3.field.replace(s2, b(t3, i2)) };
139
+ }
140
+ return n2 ? { ...e3, field: `${i2[0]}.${e3.field}` } : e3;
141
+ });
142
+ };
143
+ var b = (e2, t2) => {
144
+ let n2 = Se(e2);
145
+ return n2 == null ? e2 : e2.replace(`$[${n2}]`, t2[n2]);
146
+ };
147
+ var Se = (e2) => {
148
+ let t2 = e2.match(/\$\[(?<argIndex>\d+)\]/);
149
+ return t2 && t2.groups && Number(t2.groups.argIndex);
150
+ };
151
+ function Ce(e2, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
152
+ return h(() => e2({ request: async (e3) => {
153
+ let i3 = e3({ host: s2?.HTTPHost || `www.wixapis.com` }), a3 = i3;
154
+ a3.method === `GET` && a3.fallback?.length && (a3.params?.toString().length ?? 0) > 4e3 && (a3 = i3.fallback[0]);
155
+ let o3 = s2?.HTTPHost ?? `www.wixapis.com`, u3 = `https://${l2 ? re : o3}${a3.url}`;
156
+ a3.params && a3.params.toString() && (u3 += `?${a3.params.toString()}`);
157
+ try {
158
+ let e4 = m(i3, t2, c2), o4 = { method: a3.method, ...a3.data && { body: JSON.stringify(a3.data) }, headers: { ...e4 } }, s3 = await n2(u3, o4);
159
+ if (s3.status !== 200) {
160
+ let e5 = null;
161
+ try {
162
+ e5 = await s3.json();
163
+ } catch {
164
+ }
165
+ let t3 = Te(s3.status, e5?.message ?? s3.statusText, e5?.details, { requestId: s3.headers.get(`X-Wix-Request-Id`), details: e5 }), n3 = _e(t3);
166
+ throw r2?.handleError(n3, { requestOptions: { url: a3.url, method: a3.method, entityFqdn: i3.entityFqdn, methodFqn: i3.methodFqn } }), t3;
167
+ }
168
+ let l3 = await s3.json();
169
+ 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 };
170
+ } catch (e4) {
171
+ throw e4.message?.includes(`fetch is not defined`) && console.error(`Node.js v18+ is required`), e4;
172
+ }
173
+ }, fetchWithAuth: n2, wixAPIFetch: i2, getActiveToken: a2, getAuthHeaders: o2 }, { validateRequestSchema: u2 }));
174
+ }
175
+ var we = class extends Error {
176
+ response;
177
+ requestId;
178
+ constructor(e2) {
179
+ super(), this.response = e2.response, this.requestId = e2.requestId;
180
+ }
181
+ };
182
+ var Te = (e2, t2, n2, r2) => new we({ response: { data: { details: { ...!n2?.validationError && { applicationError: { description: t2, code: e2, data: r2 } }, ...n2 }, message: t2 }, status: e2 }, requestId: r2?.requestId });
183
+ var Ee = `.`;
184
+ function De(e2, t2, n2) {
185
+ if (e2 == null) throw Error(`Cannot set value on null or undefined`);
186
+ let r2 = x(t2), i2 = e2;
187
+ for (let e3 = 0; e3 < r2.length; e3++) {
188
+ let t3 = r2[e3];
189
+ if (e3 === r2.length - 1) {
190
+ i2[t3] = n2;
191
+ break;
192
+ }
193
+ let a2 = r2[e3 + 1];
194
+ (!(t3 in i2) || i2[t3] == null || typeof i2[t3] != `object` || i2[t3] === null) && (i2[t3] = typeof a2 == `number` ? [] : {}), i2 = i2[t3];
195
+ }
196
+ return e2;
197
+ }
198
+ function x(e2) {
199
+ return Array.isArray(e2) ? e2 : e2.split(Ee).map((e3) => Oe(e3) ? Number(e3) : e3);
200
+ }
201
+ function Oe(e2) {
202
+ return /^\d+$/.test(e2);
203
+ }
204
+ function ke(e2) {
205
+ let t2 = {};
206
+ for (let [n2, r2] of Object.entries(e2)) Ae(n2) || De(t2, x(n2), r2);
207
+ return t2;
208
+ }
209
+ function Ae(e2) {
210
+ return e2 === `__proto__` || e2 === `constructor` || e2 === `prototype`;
211
+ }
212
+ var je = class {
213
+ BRACKET_PATTERN = /\[(\d+)\]/g;
214
+ NUMERIC_PATTERN = /^\d+$/;
215
+ ESCAPED_DOT_PATTERN = /\\\./g;
216
+ ESCAPED_LEFT_BRACKET_PATTERN = /\\\[/g;
217
+ ESCAPED_RIGHT_BRACKET_PATTERN = /\\\]/g;
218
+ SPLIT_PATTERN = /\.|\[(\d+)\]/g;
219
+ DOT_BEFORE_BRACKET_PATTERN = /\.\[/g;
220
+ ESCAPED_DOT_PLACEHOLDER = `__DOT__`;
221
+ ESCAPED_RIGHT_BRACKET_PLACEHOLDER = `__RB__`;
222
+ ESCAPED_LEFT_BRACKET_PLACEHOLDER = `__LB__`;
223
+ modifiedFields;
224
+ cleanedModifiedFields;
225
+ constructor(e2) {
226
+ this.modifiedFields = e2;
227
+ }
228
+ replaceEscapedCharacters(e2) {
229
+ 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);
230
+ }
231
+ restoreEscapedCharacters(e2) {
232
+ return e2.replace(this.ESCAPED_DOT_PLACEHOLDER, `\\.`).replace(this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER, `\\]`).replace(this.ESCAPED_LEFT_BRACKET_PLACEHOLDER, `\\[`);
233
+ }
234
+ unflatten() {
235
+ return this.cleanedModifiedFields = Object.fromEntries(Object.entries(this.modifiedFields).map(([e2, t2]) => [this.replaceEscapedCharacters(this.bracketToDotNotation(e2)), t2])), ke(this.cleanedModifiedFields);
236
+ }
237
+ flatten(e2) {
238
+ let t2 = {};
239
+ for (let n2 of Object.keys(this.cleanedModifiedFields)) {
240
+ let r2 = this.splitPath(n2), i2 = this.navigatePath(e2, r2);
241
+ t2 = { ...t2, ...i2 };
242
+ }
243
+ return Object.fromEntries(Object.entries(t2).map(([e3, t3]) => [this.restoreEscapedCharacters(e3), t3]));
244
+ }
245
+ splitPath(e2) {
246
+ let t2 = [], n2 = 0, r2 = Array.from(e2.matchAll(this.SPLIT_PATTERN));
247
+ 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;
248
+ return n2 < e2.length && t2.push(e2.substring(n2)), t2;
249
+ }
250
+ navigatePath(e2, t2) {
251
+ let n2 = e2, r2 = [], i2 = (e3) => {
252
+ if (!Array.isArray(n2)) throw Error(`Expected array at path ${this.buildPathString(r2)}, but got ${typeof n2}`);
253
+ r2.push(`[${e3}]`), n2 = n2[parseInt(e3, 10)];
254
+ }, a2 = (e3, t3) => {
255
+ let i3 = e3 in g ? g[e3] : void 0;
256
+ if (i3 && i3 in t3) {
257
+ r2.push(i3), n2 = t3[i3];
258
+ return;
259
+ }
260
+ let a3 = Fe(e3);
261
+ if (a3 && a3 in t3) {
262
+ r2.push(a3), n2 = t3[a3];
263
+ return;
264
+ }
265
+ throw Error(`Cannot find key '${e3}' or its transformations at path ${this.buildPathString(r2)}`);
266
+ }, o2 = (e3, t3) => {
267
+ r2.push(e3), n2 = t3[e3];
268
+ };
269
+ for (let e3 of t2) {
270
+ if (this.NUMERIC_PATTERN.test(e3)) {
271
+ i2(e3);
272
+ continue;
273
+ }
274
+ if (typeof n2 != `object` || !n2) throw Error(`Cannot access property '${e3}' on ${typeof n2} at path ${this.buildPathString(r2)}`);
275
+ let t3 = n2;
276
+ if (e3 in n2) {
277
+ o2(e3, t3);
278
+ continue;
279
+ }
280
+ a2(e3, t3);
281
+ }
282
+ return { [this.buildPathString(r2)]: n2 };
283
+ }
284
+ buildPathString(e2) {
285
+ return e2.join(`.`).replace(this.DOT_BEFORE_BRACKET_PATTERN, `[`);
286
+ }
287
+ bracketToDotNotation(e2) {
288
+ return e2.replace(this.BRACKET_PATTERN, (t2, n2, r2) => r2 > 0 && e2[r2 - 1] === `\\` ? t2 : `.` + n2);
289
+ }
290
+ };
291
+ function Me(e2, t2) {
292
+ let n2 = e2?.modifiedFields;
293
+ if (!n2) return null;
294
+ let r2 = Ne(n2);
295
+ if (!r2) return null;
296
+ let { unflattenedModifiedFields: i2, modifiedFieldsManipulator: a2 } = r2;
297
+ e2 = { ...e2, modifiedFields: i2 };
298
+ let o2 = t2(e2), s2 = o2?.modifiedFields;
299
+ if (!s2) return null;
300
+ let c2 = Pe(s2, a2);
301
+ return c2 === null ? null : (o2.modifiedFields = c2, o2);
302
+ }
303
+ function Ne(e2) {
304
+ if (typeof e2 == `object` && e2 && !Array.isArray(e2)) try {
305
+ let t2 = new je(e2);
306
+ return { unflattenedModifiedFields: t2.unflatten(), modifiedFieldsManipulator: t2 };
307
+ } catch {
308
+ return null;
309
+ }
310
+ return null;
311
+ }
312
+ function Pe(e2, t2) {
313
+ if (typeof e2 == `object` && e2 && !Array.isArray(e2)) try {
314
+ return t2.flatten(e2);
315
+ } catch {
316
+ return null;
317
+ }
318
+ return null;
319
+ }
320
+ function Fe(e2) {
321
+ return e2.replace(/[-_\s]+(.)?/g, (e3, t2) => t2 ? t2.toUpperCase() : ``).replace(/^./, (e3) => e3.toLowerCase());
322
+ }
323
+ function S() {
324
+ return { emit(e2, ...t2) {
325
+ for (let n2 = 0, r2 = this.events[e2] || [], i2 = r2.length; n2 < i2; n2++) r2[n2](...t2);
326
+ }, events: {}, on(e2, t2) {
327
+ return (this.events[e2] ||= []).push(t2), () => {
328
+ this.events[e2] = this.events[e2]?.filter((e3) => t2 !== e3);
329
+ };
330
+ } };
331
+ }
332
+ var Ie = (e2) => e2.__type === `event-definition`;
333
+ function C(e2, t2, n2, r2) {
334
+ let i2;
335
+ if (e2.isDomainEvent) {
336
+ let { deletedEvent: e3, actionEvent: t3, createdEvent: a3, updatedEvent: o3, ...s3 } = n2, c2 = { ...r2, ...s3 };
337
+ 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 };
338
+ } else i2 = { data: n2, metadata: r2 };
339
+ let a2 = e2.transformations ?? ((e3) => e3), o2 = i2, s2 = i2;
340
+ if (s2.modifiedFields) {
341
+ let e3 = s2.modifiedFields;
342
+ if (typeof e3 == `object` && e3 && !Array.isArray(e3)) {
343
+ o2 = structuredClone(i2);
344
+ let e4 = Me(s2, a2);
345
+ if (e4) return t2(e4);
346
+ }
347
+ }
348
+ return t2(a2(o2));
349
+ }
350
+ function Le(e2) {
351
+ let t2 = /* @__PURE__ */ new Map(), n2 = S();
352
+ return { initModule(e3) {
353
+ return (r2) => {
354
+ let i2 = t2.get(e3.type) ?? [];
355
+ i2.push({ eventDefinition: e3, handler: r2 }), t2.set(e3.type, i2), n2.emit(`registered`, e3);
356
+ };
357
+ }, client: { ...n2, getRegisteredEvents: () => t2, async process(e3, n3 = { expectedEvents: [] }) {
358
+ 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 }))];
359
+ 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(`, `)}`);
360
+ let l2 = t2.get(r2) ?? [];
361
+ return await Promise.all(l2.map(({ eventDefinition: e4, handler: t3 }) => C(e4, t3, o2, { instanceId: a2, identity: i2, accountInfo: s2 }))), { instanceId: a2, eventType: r2, payload: o2, identity: i2, accountInfo: s2 };
362
+ }, async processRequest(e3, t3) {
363
+ let n3 = await e3.text();
364
+ return this.process(n3, t3);
365
+ }, async parseJWT(t3) {
366
+ let n3 = e2();
367
+ if (!n3.decodeJWT) throw Error(`decodeJWT is not supported by the authentication strategy`);
368
+ let { decoded: r2, valid: i2 } = await n3.decodeJWT(t3);
369
+ if (!i2) throw Error(`JWT is not valid`);
370
+ if (typeof r2.data != `string`) throw Error(`Unexpected type of JWT data: expected string, got ${typeof r2.data}`);
371
+ let a2 = JSON.parse(r2.data), o2 = a2.eventType, s2 = a2.accountInfo, c2 = a2.instanceId, l2 = a2.identity ? JSON.parse(a2.identity) : void 0;
372
+ return { instanceId: c2, eventType: o2, payload: JSON.parse(a2.data), identity: l2, accountInfo: s2 };
373
+ }, async parseRequest(e3) {
374
+ let t3 = await e3.text();
375
+ return this.parseJWT(t3);
376
+ }, async executeHandlers(e3) {
377
+ let n3 = Array.from(t2.keys()).map((e4) => ({ type: e4 }));
378
+ 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(`, `)}`);
379
+ let r2 = t2.get(e3.eventType) ?? [];
380
+ await Promise.all(r2.map(({ eventDefinition: t3, handler: n4 }) => C(t3, n4, e3.payload, { instanceId: e3.instanceId, identity: e3.identity })));
381
+ }, apps: { AppInstalled: u(`AppInstalled`)(), AppRemoved: u(`AppRemoved`)() } } };
382
+ }
383
+ var Re = (e2) => e2.__type === `service-plugin-definition`;
384
+ function ze(e2) {
385
+ let t2 = /* @__PURE__ */ new Map(), n2 = S();
386
+ return { initModule(e3) {
387
+ return (r2) => {
388
+ let i2 = t2.get(e3.componentType.toLowerCase()) ?? [];
389
+ i2.push({ servicePluginDefinition: e3, implementation: r2 }), t2.set(e3.componentType.toLowerCase(), i2), n2.emit(`registered`, e3);
390
+ };
391
+ }, client: { ...n2, getRegisteredServicePlugins: () => t2, async parseJWT(t3) {
392
+ let n3 = e2();
393
+ if (!n3.decodeJWT) throw Error(`decodeJWT is not supported by the authentication strategy`);
394
+ let { decoded: r2, valid: i2 } = await n3.decodeJWT(t3, true);
395
+ if (!i2) throw Error(`JWT is not valid`);
396
+ 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`);
397
+ return r2.data;
398
+ }, async process(e3) {
399
+ let t3 = await this.parseJWT(e3.body);
400
+ return this.executeHandler(t3, e3.url);
401
+ }, async parseRequest(e3) {
402
+ let t3 = await e3.text();
403
+ return this.parseJWT(t3);
404
+ }, async processRequest(e3) {
405
+ let t3 = await this.parseRequest(e3);
406
+ return this.processParsedRequest(t3, e3.url);
407
+ }, async processParsedRequest(e3, t3) {
408
+ try {
409
+ let n3 = await this.executeHandler(e3, t3);
410
+ return Response.json(n3);
411
+ } catch (e4) {
412
+ if (e4.errorType === `SPI` && e4.applicationCode && e4.httpCode) return Response.json({ applicationError: { code: e4.applicationCode, data: e4.data } }, { status: e4.httpCode });
413
+ throw e4;
414
+ }
415
+ }, async executeHandler(e3, n3) {
416
+ let r2 = e3.metadata.appExtensionType.toLowerCase(), i2 = t2.get(r2) ?? [];
417
+ if (i2.length === 0) throw Error(`No service plugin implementations found for component type ${r2}`);
418
+ if (i2.length > 1) throw Error(`Multiple service plugin implementations found for component type ${r2}. This is currently not supported`);
419
+ let { implementation: a2, servicePluginDefinition: o2 } = i2[0], s2 = o2.methods.find((e4) => n3.endsWith(e4.primaryHttpMappingPath));
420
+ if (!s2) throw Error(`Unexpect request: request url did not match any method: ` + n3);
421
+ let c2 = a2[s2.name];
422
+ if (!c2) throw Error(`Got request for service plugin method ${s2.name} but no implementation was provided. Available methods: ${Object.keys(a2).join(`, `)}`);
423
+ return s2.transformations.toREST(await c2(s2.transformations.fromREST(e3)));
424
+ } } };
425
+ }
426
+ var w = `X-Wix-Consistent`;
427
+ function Be(e2) {
428
+ 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) => {
429
+ let i3 = o2(), s3 = await a2(), c3 = { ...r3?.headers ?? {}, ...s3.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [w]: t2[w] } : {} }, l2 = e2.host?.getErrorHandler?.();
430
+ try {
431
+ if (typeof n3 == `string` || n3 instanceof URL) {
432
+ let e3 = await i3(n3, { ...r3, headers: c3 });
433
+ l2?.handleError(e3, { requestOptions: { url: n3.toString(), method: r3?.method } });
434
+ let a3 = T(e3);
435
+ return a3 && (t2[w] = a3), e3;
436
+ }
437
+ {
438
+ for (let [e4, t3] of Object.entries(c3)) typeof t3 == `string` && n3.headers.set(e4, t3);
439
+ let e3 = await i3(n3, r3);
440
+ l2?.handleError(e3, { requestOptions: { url: n3.url, method: r3?.method } });
441
+ let a3 = T(e3);
442
+ return a3 && (t2[w] = a3), e3;
443
+ }
444
+ } catch (e3) {
445
+ throw l2?.handleError(e3, { requestOptions: { url: typeof n3 == `string` || n3 instanceof URL ? n3.toString() : n3.url, method: r3?.method } }), e3;
446
+ }
447
+ }, { client: c2, initModule: u2 } = ze(i2), { client: d2, initModule: re2 } = Le(i2), f2 = async (n3, r3) => {
448
+ let i3 = o2(), s3 = await a2(), c3 = ae(r3), l2 = await i3(n3, { ...r3, headers: { ...c3, ...t2, ...s3?.headers, ...r3?.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [w]: t2[w] } : {} } }), u3 = T(l2);
449
+ return u3 && (t2[w] = u3), l2;
450
+ }, p2 = (t3, n3) => {
451
+ if (Ie(t3)) return re2(t3);
452
+ if (Re(t3)) return u2(t3);
453
+ if (se(t3) && e2.host) return ce(t3, e2.host);
454
+ if (typeof t3 == `function`) {
455
+ if (`__type` in t3 && t3.__type === `wix_spi_error`) return t3;
456
+ let r3 = e2.host?.apiBaseUrl ?? `www.wixapis.com`, o3 = e2.useCDN === void 0 ? i2().shouldUseCDN : e2.useCDN;
457
+ return Ce(h(() => te(t3)) ? ee(t3) : t3, n3 ?? {}, f2, e2.host?.getErrorHandler?.(), (e3, t4) => {
458
+ let n4 = new URL(e3, `https://${r3}`);
459
+ return n4.host = r3, n4.protocol = `https`, f2(n4.toString(), t4);
460
+ }, i2().getActiveToken, async () => a2(), { HTTPHost: r3 }, e2.host?.name, o3, e2.validateRequestSchema);
461
+ }
462
+ return oe(t3) ? Object.fromEntries(Object.entries(t3).map(([e3, n4]) => [e3, p2(n4, t3[ne])])) : t3;
463
+ }, m2 = (e3) => {
464
+ for (let n3 in e3) t2[n3] = e3[n3];
465
+ };
466
+ return { ...e2.modules ? p2(e2.modules) : {}, get auth() {
467
+ let t3 = i2();
468
+ return t3.getAuthHeaders = t3.getAuthHeaders.bind(void 0, e2.host), t3;
469
+ }, setHeaders: m2, use: p2, enableContext(e3, t3 = { elevated: false }) {
470
+ 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 ? l.elevatedClient = this : l.client = this;
471
+ }, fetch: (t3, n3) => {
472
+ let r3 = e2.host?.apiBaseUrl ?? `www.wixapis.com`, i3 = new URL(t3, `https://${r3}`);
473
+ return i3.host = r3, i3.protocol = `https`, f2(i3.toString(), n3);
474
+ }, fetchWithAuth: s2, async graphql(t3, n3, r3 = { apiVersion: `alpha` }) {
475
+ 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 }) });
476
+ if (a3.status !== 200) throw new ie(`GraphQL request failed with status ${a3.status}`, a3);
477
+ let { data: o3, errors: s3 } = await a3.json();
478
+ return { data: o3 ?? {}, errors: s3 };
479
+ }, webhooks: d2, servicePlugins: c2 };
480
+ }
481
+ function T(e2) {
482
+ return e2.headers?.get(`X-Wix-Consistent`) ?? e2.headers?.get(`x-wix-consistent`);
483
+ }
484
+ var E = { _id: `id`, _createdDate: `createdDate`, _updatedDate: `updatedDate` };
485
+ var Ve = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
486
+ var He = E;
487
+ function Ue(e2, t2) {
488
+ return e2?.split(`.`).map((e3) => t2?.[e3] ?? e3).join(`.`);
489
+ }
490
+ function D(e2, { transformSystemFields: t2 = true } = {}) {
491
+ return t2 ? Ue(e2, He) : e2;
492
+ }
493
+ var We = `sort.fieldName`;
494
+ function Ge(e2, t2, n2) {
495
+ return (e2 === We || e2.endsWith(`.${We}`)) && typeof t2 == `string` ? Ue(t2, n2) : t2;
496
+ }
497
+ function O(e2, t2, n2) {
498
+ let r2 = (e3) => n2.includes(e3), i2 = (e3, n3) => {
499
+ if (Array.isArray(e3)) e3.forEach((e4) => {
500
+ i2(e4, n3);
501
+ });
502
+ else if (typeof e3 == `object` && e3) {
503
+ let a2 = e3;
504
+ Object.keys(a2).forEach((e4) => {
505
+ let o2 = n3 === `` ? e4 : `${n3}.${e4}`;
506
+ if (r2(o2)) return;
507
+ let s2 = Ke(e4, t2);
508
+ s2 !== e4 && !(s2 in a2) && (a2[s2] = a2[e4], delete a2[e4]), a2[s2] = Ge(o2, a2[s2], t2), i2(a2[s2], o2);
509
+ });
510
+ }
511
+ };
512
+ return i2(e2, ``), e2;
513
+ }
514
+ function Ke(e2, t2) {
515
+ let n2;
516
+ return n2 = e2.includes(`.`) ? e2.split(`.`).map((e3) => t2[e3] ?? e3).join(`.`) : t2[e2] ?? e2, n2;
517
+ }
518
+ function qe(e2, t2 = []) {
519
+ return O(e2, E, t2);
520
+ }
521
+ function k(e2, t2 = []) {
522
+ return O(e2, Ve, t2);
523
+ }
524
+ function A(e2) {
525
+ return e2 ? new Date(e2) : void 0;
526
+ }
527
+ var j = /* @__PURE__ */ new WeakMap();
528
+ function M() {
529
+ return { leaves: void 0, fields: void 0, mapFields: void 0, anyField: void 0 };
530
+ }
531
+ function N(e2, t2) {
532
+ let n2 = e2.get(t2);
533
+ return n2 || (n2 = M(), e2.set(t2, n2)), n2;
534
+ }
535
+ function Je(e2, t2) {
536
+ return t2 === `*` ? (e2.anyField ??= M(), e2.anyField) : t2.endsWith(`{}`) ? (e2.mapFields ??= /* @__PURE__ */ new Map(), N(e2.mapFields, t2.slice(0, -2))) : (e2.fields ??= /* @__PURE__ */ new Map(), N(e2.fields, t2));
537
+ }
538
+ function Ye(e2) {
539
+ let t2 = M();
540
+ for (let n2 of e2) {
541
+ let e3 = n2.path.split(`.`).reduce(Je, t2);
542
+ e3.leaves ??= [], e3.leaves.push(n2);
543
+ }
544
+ return t2;
545
+ }
546
+ function Xe(e2) {
547
+ let t2 = j.get(e2);
548
+ return t2 || (t2 = Ye(e2), j.set(e2, t2)), t2;
549
+ }
550
+ function P(e2) {
551
+ return typeof e2 == `object` && !!e2;
552
+ }
553
+ function Ze(e2, { isRepeated: t2, isMap: n2 }, r2) {
554
+ return t2 ? Array.isArray(e2) ? e2.map(r2) : e2 : n2 ? P(e2) ? Object.fromEntries(Object.entries(e2).map(([e3, t3]) => [e3, r2(t3)])) : e2 : r2(e2);
555
+ }
556
+ function F(e2, t2, n2) {
557
+ P(e2) && I(e2, t2, n2);
558
+ }
559
+ function Qe(e2, t2, n2) {
560
+ for (let [r2, i2] of t2) {
561
+ if (!(r2 in e2)) continue;
562
+ if (i2.leaves) for (let t4 of i2.leaves) e2[r2] = Ze(e2[r2], t4, n2);
563
+ let t3 = e2[r2];
564
+ Array.isArray(t3) ? t3.forEach((e3) => F(e3, i2, n2)) : F(t3, i2, n2);
565
+ }
566
+ }
567
+ function $e(e2, t2, n2) {
568
+ for (let [r2, i2] of t2) {
569
+ let t3 = e2[r2];
570
+ P(t3) && Object.values(t3).forEach((e3) => F(e3, i2, n2));
571
+ }
572
+ }
573
+ function I(e2, { fields: t2, mapFields: n2, anyField: r2 }, i2) {
574
+ t2 && Qe(e2, t2, i2), n2 && $e(e2, n2, i2), r2 && Object.values(e2).forEach((e3) => F(e3, r2, i2));
575
+ }
576
+ function L(e2, t2) {
577
+ if (!P(e2)) return e2;
578
+ for (let { paths: n2, transformFn: r2 } of t2) I(e2, Xe(n2), r2);
579
+ return e2;
580
+ }
581
+ function R(e2) {
582
+ return rt(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
583
+ }
584
+ var et = /([\p{Ll}\d])(\p{Lu})/gu;
585
+ var tt = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
586
+ var z = `$1\0$2`;
587
+ var nt = /[^\p{L}\d]+/giu;
588
+ function rt(e2) {
589
+ let t2 = e2.trim();
590
+ t2 = t2.replace(et, z).replace(tt, z), t2 = t2.replace(nt, `\0`);
591
+ let n2 = 0, r2 = t2.length;
592
+ for (; t2.charAt(n2) === `\0`; ) n2++;
593
+ if (n2 === r2) return [];
594
+ for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
595
+ return t2.slice(n2, r2).split(/\0/g);
596
+ }
597
+ var it = (e2) => `validationError` in (e2.response?.data?.details ?? {});
598
+ var at = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
599
+ var ot = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
600
+ function st(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
601
+ if (typeof e2 != `object` || !e2) throw e2;
602
+ if (it(e2)) return ct(e2, t2, n2);
603
+ if (at(e2)) return lt(e2);
604
+ if (ot(e2)) {
605
+ let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: R(n3), data: {} }, requestId: e2.requestId };
606
+ return B(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
607
+ }
608
+ return ut(e2);
609
+ }
610
+ var ct = (e2, t2, n2) => {
611
+ let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = dt(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 };
612
+ return B(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e2.response?.status, requestId: i2 } });
613
+ };
614
+ var B = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
615
+ var lt = (e2) => {
616
+ 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 ?? R(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 };
617
+ return B(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e2.requestId } });
618
+ };
619
+ var ut = (e2) => B(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: R(e2.response?.statusText ?? `UNKNOWN`), ...!e2.response && { runtimeError: e2 } } });
620
+ var dt = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
621
+ let a2 = { ...e2, ...t2 }, o2 = Object.keys(a2);
622
+ return r2?.filter((e3) => !r2.some((t3) => t3.field.length > e3.field.length && t3.field.startsWith(e3.field) && o2.includes(t3.field))).map((e3) => {
623
+ let r3 = t2[e3.field];
624
+ if (r3) return { ...e3, field: V(r3, i2) };
625
+ let s2 = o2?.sort((e4, t3) => t3.length - e4.length)?.find((t3) => e3.field.startsWith(t3));
626
+ if (s2) {
627
+ let t3 = a2[s2];
628
+ if (t3) return { ...e3, field: e3.field.replace(s2, V(t3, i2)) };
629
+ }
630
+ return n2 ? { ...e3, field: `${i2[0]}.${e3.field}` } : e3;
631
+ });
632
+ };
633
+ var V = (e2, t2) => {
634
+ let n2 = ft(e2);
635
+ return n2 == null ? e2 : e2.replace(`$[${n2}]`, t2[n2]);
636
+ };
637
+ var ft = (e2) => {
638
+ let t2 = e2.match(/\$\[(?<argIndex>\d+)\]/);
639
+ return t2 && t2.groups && Number(t2.groups.argIndex);
640
+ };
641
+ function H() {
642
+ let e2 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
643
+ if (e2) return { initWixModules(t3, n3) {
644
+ return U(() => e2(t3, n3));
645
+ }, fetchWithAuth() {
646
+ throw Error(`fetchWithAuth is not available in this context`);
647
+ }, graphql() {
648
+ throw Error(`graphql is not available in this context`);
649
+ } };
650
+ let t2 = typeof $wixContext < `u` ? $wixContext.client : l.client === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.client : l.client, n2 = typeof $wixContext < `u` ? $wixContext.elevatedClient : l.elevatedClient === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.elevatedClient : l.elevatedClient;
651
+ if (t2 || n2) return { initWixModules(e3, r2) {
652
+ if (r2) {
653
+ 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`);
654
+ return U(() => n2.use(e3));
655
+ }
656
+ if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
657
+ return U(() => t2.use(e3));
658
+ }, fetchWithAuth: (e3, n3) => {
659
+ if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
660
+ return t2.fetchWithAuth(e3, n3);
661
+ }, getAuth() {
662
+ if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
663
+ return t2.auth;
664
+ }, async graphql(e3, n3, r2) {
665
+ if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
666
+ return t2.graphql(e3, n3, r2);
667
+ } };
668
+ }
669
+ function U(e2) {
670
+ let t2 = globalThis.__wix_context__, n2 = { client: l.client, elevatedClient: l.elevatedClient }, r2;
671
+ globalThis.__wix_context__ = void 0, l.client = void 0, l.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
672
+ try {
673
+ return e2();
674
+ } finally {
675
+ globalThis.__wix_context__ = t2, l.client = n2.client, l.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
676
+ }
677
+ }
678
+ function pt(e2, t2) {
679
+ return (...n2) => {
680
+ let r2 = H();
681
+ return r2 ? r2.initWixModules(e2, t2).apply(void 0, n2) : e2.apply(void 0, n2);
682
+ };
683
+ }
684
+ function mt(e2) {
685
+ let t2 = (...t3) => {
686
+ let n2 = H();
687
+ return n2 ? n2.initWixModules(e2).apply(void 0, t3) : () => ({ slug: e2.type });
688
+ };
689
+ return t2.__type = e2.__type, t2.type = e2.type, t2.isDomainEvent = e2.isDomainEvent, t2.transformations = e2.transformations, t2;
690
+ }
691
+ function ht(e2, t2 = false) {
692
+ return pt(e2, t2);
693
+ }
694
+ function gt(e2, t2) {
695
+ let n2 = W(e2), r2 = Object.entries(n2).some(([e3, t3]) => e3.includes(`.`) || Array.isArray(t3) && t3.some((e4) => typeof e4 == `object`));
696
+ return t2 && r2 ? new URLSearchParams({ ".r": yt(JSON.stringify(e2)) }) : Object.entries(n2).reduce((e3, [t3, n3]) => ((Array.isArray(n3) ? n3 : [n3]).forEach((r3) => {
697
+ r3 == null || Array.isArray(n3) && typeof r3 == `object` || e3.append(t3, r3);
698
+ }), e3), new URLSearchParams());
699
+ }
700
+ function _t(e2) {
701
+ let t2 = Mt(At(e2.host), e2.domainToMappings);
702
+ return Vt(Rt(e2.protoPath, e2.data || {}), t2);
703
+ }
704
+ function W(e2, t2 = ``) {
705
+ let n2 = {};
706
+ return Object.entries(e2).forEach(([e3, r2]) => {
707
+ let i2 = typeof r2 == `object` && !!r2 && !Array.isArray(r2), a2 = vt(t2, e3);
708
+ if (i2) {
709
+ let e4 = W(r2, a2);
710
+ Object.assign(n2, e4);
711
+ } else n2[a2] = r2;
712
+ }), n2;
713
+ }
714
+ function vt(e2, t2) {
715
+ return `${e2}${e2 ? `.` : ``}${t2}`;
716
+ }
717
+ var yt = (e2) => {
718
+ let t2 = new TextEncoder().encode(e2);
719
+ return (typeof btoa < `u` ? btoa(String.fromCodePoint(...t2)) : Buffer.from(e2, `utf-8`).toString(`base64`)).replace(/=/g, ``).replace(/\+/g, `-`).replace(/\//g, `_`);
720
+ };
721
+ var bt = [`wix.com`, `editorx.com`];
722
+ var xt = `_`;
723
+ var St = `*.`;
724
+ var Ct = RegExp(`\\.(${bt.join(`|`)})$`);
725
+ var wt = [`42.wixprod.net`, `uw2-edt-1.wixprod.net`, `virginia-edt.wixprod.net`];
726
+ var Tt = { "payments.base44.com": `manage.wix.com`, "create.editorx.com": `editor.editorx.com` };
727
+ var Et = `dev.wix-code.com`;
728
+ var Dt = /{(.*)}/;
729
+ var Ot = RegExp(`\\.(${wt.join(`|`)})$`);
730
+ var kt = RegExp(`.*\\.${Et}$`);
731
+ function At(e2) {
732
+ return jt(e2).replace(Ct, `._base_domain_`).replace(Ot, `._api_base_domain_`).replace(kt, `*.dev.wix-code.com`);
733
+ }
734
+ function jt(e2) {
735
+ return Tt[e2] ?? e2;
736
+ }
737
+ function Mt(e2, t2) {
738
+ let n2 = t2[e2];
739
+ if (n2) return n2;
740
+ let r2 = Nt(e2, t2) ?? Pt(e2, t2);
741
+ if (!r2) {
742
+ if (It(e2)) {
743
+ let e3 = t2[Lt];
744
+ if (e3) return e3;
745
+ }
746
+ let n3 = t2[xt];
747
+ if (n3) return n3;
748
+ }
749
+ return r2 ?? [];
750
+ }
751
+ function Nt(e2, t2) {
752
+ return Object.entries(t2).find(([t3]) => {
753
+ let [, ...n2] = e2.split(`.`);
754
+ return n2.join(`.`) === t3;
755
+ })?.[1];
756
+ }
757
+ function Pt(e2, t2) {
758
+ let [n2] = Object.entries(t2).filter(([t3]) => Ft(e2, t3)).sort(([e3], [t3]) => t3.length - e3.length);
759
+ if (!n2) return;
760
+ let [, r2] = n2;
761
+ return r2;
762
+ }
763
+ function Ft(e2, t2) {
764
+ if (!t2.startsWith(St)) return false;
765
+ let n2 = t2.slice(1);
766
+ return e2.length > n2.length && e2.endsWith(n2);
767
+ }
768
+ function It(e2) {
769
+ return !!e2.match(/\._base_domain_$/);
770
+ }
771
+ var Lt = `www._base_domain_`;
772
+ function Rt(e2, t2) {
773
+ return e2.split(`/`).map((e3) => zt(e3, t2)).join(`/`);
774
+ }
775
+ function zt(e2, t2) {
776
+ let n2 = e2.match(Dt) || [], r2 = n2[1];
777
+ return r2 ? Bt(t2, r2, e2, e2.replace(n2[0], ``)) : e2;
778
+ }
779
+ function Bt(e2, t2, n2, r2) {
780
+ let i2 = e2;
781
+ for (let e3 of t2.split(`.`)) {
782
+ if (!i2) return n2;
783
+ i2 = i2[e3];
784
+ }
785
+ return `${i2}${r2}`;
786
+ }
787
+ function Vt(e2, t2) {
788
+ let n2 = t2?.find((t3) => e2.startsWith(t3.destPath));
789
+ return n2 ? n2.srcPath + e2.slice(n2.destPath.length) : e2;
790
+ }
791
+ function G(e2) {
792
+ return mt(e2);
793
+ }
794
+ function K(e2) {
795
+ return e2 === `NaN` ? NaN : e2 === `Infinity` ? 1 / 0 : e2 === `-Infinity` ? -1 / 0 : e2;
796
+ }
797
+ var Ht = `x-wix-linguist`;
798
+ var Ut = `00000000-0000-0000-0000-000000000000`;
799
+ var Wt = `false`;
800
+ var Gt = () => {
801
+ let e2 = q(`language`), t2 = q(`locale`);
802
+ if (e2) return { [Ht]: [e2, t2 || e2, Wt, Ut].join(`|`) };
803
+ };
804
+ function Kt() {
805
+ let e2 = null, t2 = null;
806
+ return { promise: new Promise((n2, r2) => {
807
+ e2 = n2, t2 = r2;
808
+ }), resolve: e2, reject: t2 };
809
+ }
810
+ var qt = () => (typeof window < `u` ? window.commonConfig : void 0) ?? globalThis.commonConfig;
811
+ var q = (e2) => qt()?.[e2];
812
+ var Jt = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host: (t2) => {
813
+ let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e2(t2), o2 = Xt();
814
+ return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language: q(`language`), locale: q(`locale`), get passThroughHeaders() {
815
+ return Gt();
816
+ } } };
817
+ }, auth: (e3) => {
818
+ let t2 = typeof window < `u` ? window.wixEmbedsAPI : void 0;
819
+ !e3 && Yt() && (e3 = t2?.getAccessTokenFunction?.());
820
+ let n2 = false, { resolve: r2, promise: i2 } = Kt();
821
+ return { getAuthHeaders: async () => {
822
+ if (!e3 && n2 && (e3 = await i2), !e3) throw Error(`Failed to resolve auth token`);
823
+ return { headers: { Authorization: await e3() } };
824
+ }, getAccessTokenInjector: () => (n2 = true, (e4) => {
825
+ r2(e4);
826
+ }) };
827
+ } });
828
+ function Yt() {
829
+ return typeof document < `u` && document.currentScript?.tagName === `SCRIPT`;
830
+ }
831
+ function Xt() {
832
+ let e2 = (typeof window < `u` ? window.wixEmbedsAPI : void 0)?.getExternalBaseUrl?.();
833
+ if (!e2) return;
834
+ let t2 = new URL(e2);
835
+ return t2?.pathname && t2.pathname !== `/` ? `${t2.hostname}${t2.pathname}` : t2.hostname;
836
+ }
837
+ var Zt = ({ clientSdk: e2, applicationId: t2 }) => ({ invoke: async ({ namespace: n2, method: r2, args: i2 }) => {
838
+ 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`);
839
+ return e2.invoke({ namespace: n2, method: r2, args: i2, applicationId: t2, accessToken: `accessToken` });
840
+ }, getAccessToken: () => {
841
+ throw Error(`Not implemented`);
842
+ }, observeState: () => ({ disconnect: () => {
843
+ } }) });
844
+ var J = Jt({ createHost: function(e2) {
845
+ let t2 = (typeof $wixContext < `u` ? $wixContext.clientSdk : void 0) ?? e2?.clientSdk ?? (typeof window < `u` ? window?.clientSdk : void 0), { applicationId: n2 } = e2 || {};
846
+ if (!n2) throw Error(`"createHost" was called without a required field "applicationId"`);
847
+ return { channel: Zt({ clientSdk: t2, applicationId: n2 }), close: () => {
848
+ } };
849
+ } });
850
+ var Qt = (e2, t2) => {
851
+ let n2 = J.host({ applicationId: e2, componentId: t2 }), r2 = J.auth();
852
+ return Be({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
853
+ };
854
+ var $t = (e2) => Qt(`215238eb-22a5-4c36-9e7b-e7c08025e04e`, e2);
855
+ function en(e2) {
856
+ if (e2.status === `fulfilled`) return e2.value;
857
+ throw e2.status === `rejected` ? e2.reason : e2.status === `pending` ? e2 : (e2.status = `pending`, e2.then((t2) => {
858
+ e2.status = `fulfilled`, e2.value = t2;
859
+ }, (t2) => {
860
+ e2.status = `rejected`, e2.reason = t2;
861
+ }), e2);
862
+ }
863
+ function Y(e2) {
864
+ return e2;
865
+ }
866
+ var tn = Y(`@wix/site-service-warmup-data`);
867
+ async function nn(e2, t2, n2) {
868
+ let r2 = typeof window > `u`;
869
+ if (!r2 && e2) try {
870
+ let n3 = await e2.get(t2);
871
+ if (n3 !== null) return n3;
872
+ } catch {
873
+ }
874
+ let i2 = await n2();
875
+ if (r2 && e2) try {
876
+ e2.set(t2, i2);
877
+ } catch {
878
+ }
879
+ return i2;
880
+ }
881
+ function rn(e2, t2) {
882
+ let n2 = o(), [r2] = a(() => {
883
+ let r3;
884
+ try {
885
+ r3 = n2(tn);
886
+ } catch {
887
+ r3 = null;
888
+ }
889
+ return nn(r3, e2, t2);
890
+ });
891
+ return r2;
892
+ }
893
+ function X(e2) {
894
+ if (!e2) return;
895
+ let t2 = ``;
896
+ 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;
897
+ }
898
+ function an(e2, t2, n2 = {}) {
899
+ let r2 = (r3, i3) => an(e2, t2, { ...n2, [r3]: i3 }), i2 = () => Object.keys(n2).length === 0 ? {} : { [D(e2, t2)]: n2 };
900
+ return { get filter() {
901
+ return i2();
902
+ }, 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) };
903
+ }
904
+ function on(e2) {
905
+ return Object.assign((t2) => an(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 } }) });
906
+ }
907
+ function sn(e2) {
908
+ return (t2) => ({ asc: () => ({ sort: { fieldName: D(t2, e2), order: `ASC` } }), desc: () => ({ sort: { fieldName: D(t2, e2), order: `DESC` } }) });
909
+ }
910
+ function cn(e2) {
911
+ return () => {
912
+ let t2 = {}, n2 = { withFilter(e3) {
913
+ return t2 = { ...t2, filter: e3.filter }, n2;
914
+ }, withFields(...r2) {
915
+ return t2 = { ...t2, fields: r2.map((t3) => D(t3, e2)) }, n2;
916
+ }, withSorting(...e3) {
917
+ return t2 = { ...t2, sort: e3.map((e4) => e4.sort) }, n2;
918
+ }, withPaging(e3) {
919
+ return t2 = { ...t2, paging: e3 }, n2;
920
+ }, build() {
921
+ return t2;
922
+ } };
923
+ return n2;
924
+ };
925
+ }
926
+ function ln(e2) {
927
+ return { QueryBuilder: cn(e2), Filter: on(e2), Sort: sn(e2) };
928
+ }
929
+ function un(e2) {
930
+ let t2 = {}, n2 = { get search() {
931
+ return t2;
932
+ }, expression(e3) {
933
+ return t2 = { ...t2, expression: e3 }, n2;
934
+ }, mode(e3) {
935
+ return t2 = { ...t2, mode: e3 }, n2;
936
+ }, fields(r2) {
937
+ return t2 = { ...t2, fields: r2.map((t3) => D(t3, e2)) }, n2;
938
+ }, fuzzy(e3 = true) {
939
+ return t2 = { ...t2, fuzzy: e3 }, n2;
940
+ } };
941
+ return n2;
942
+ }
943
+ function dn(e2) {
944
+ return (t2) => {
945
+ let n2 = un(e2);
946
+ return t2 === void 0 ? n2 : n2.expression(t2);
947
+ };
948
+ }
949
+ function fn(e2) {
950
+ let t2 = { ...e2, type: `VALUE`, value: { ...e2.value } }, n2 = { get aggregation() {
951
+ return t2;
952
+ }, sortBy(e3, r2) {
953
+ return t2 = { ...t2, value: { ...t2.value, sortType: e3, sortDirection: r2 } }, n2;
954
+ }, limit(e3) {
955
+ return t2 = { ...t2, value: { ...t2.value, limit: e3 } }, n2;
956
+ }, excludeMissingValues() {
957
+ return t2 = { ...t2, value: { ...t2.value, missingValues: `EXCLUDE` } }, n2;
958
+ }, includeMissingValues() {
959
+ return t2 = { ...t2, value: { ...t2.value, missingValues: `INCLUDE` } }, n2;
960
+ }, includeValues(e3) {
961
+ return t2 = { ...t2, value: { ...t2.value, includeOptions: { addToBucket: e3 } } }, n2;
962
+ } };
963
+ return n2;
964
+ }
965
+ function pn(e2) {
966
+ let t2 = { ...e2, type: `RANGE`, range: { buckets: [] } }, n2 = { get aggregation() {
967
+ return t2;
968
+ }, withBuckets(...e3) {
969
+ return t2 = { ...t2, range: { buckets: e3 } }, n2;
970
+ } };
971
+ return n2;
972
+ }
973
+ function mn(e2) {
974
+ let t2 = { ...e2, type: `DATE_HISTOGRAM`, dateHistogram: {} }, n2 = { get aggregation() {
975
+ return t2;
976
+ }, interval(e3) {
977
+ return t2 = { ...t2, dateHistogram: { interval: e3 } }, n2;
978
+ } };
979
+ return n2;
980
+ }
981
+ function hn(e2) {
982
+ let t2 = { ...e2, type: `SCALAR`, scalar: {} }, n2 = { get aggregation() {
983
+ return t2;
984
+ }, type(e3) {
985
+ return t2 = { ...t2, scalar: { type: e3 } }, n2;
986
+ } };
987
+ return n2;
988
+ }
989
+ function gn(e2) {
990
+ let t2 = { ...e2, type: `NESTED`, nested: { nestedAggregations: [] } }, n2 = { get aggregation() {
991
+ return t2;
992
+ }, addNestedAggregation(e3) {
993
+ let r2 = e3.aggregation, i2 = [...t2.nested?.nestedAggregations ?? [], r2];
994
+ return t2 = { ...t2, nested: { nestedAggregations: i2 } }, n2;
995
+ } };
996
+ return n2;
997
+ }
998
+ function _n(e2, t2) {
999
+ let n2 = { name: e2 }, r2 = { get aggregation() {
1000
+ return n2;
1001
+ }, ofType(e3) {
1002
+ return n2 = { ...n2, type: e3 }, r2;
1003
+ }, onField(e3) {
1004
+ return n2 = { ...n2, fieldPath: D(e3, t2) }, r2;
1005
+ }, asValueAggregation() {
1006
+ return fn(n2);
1007
+ }, asRangeAggregation() {
1008
+ return pn(n2);
1009
+ }, asDateHistogramAggregation() {
1010
+ return mn(n2);
1011
+ }, asScalarAggregation() {
1012
+ return hn(n2);
1013
+ }, asNestedAggregation() {
1014
+ return gn(n2);
1015
+ } };
1016
+ return r2;
1017
+ }
1018
+ function vn(e2) {
1019
+ return (t2) => _n(t2, e2);
1020
+ }
1021
+ function yn() {
1022
+ return () => {
1023
+ let e2 = {}, t2 = { withFilter(n2) {
1024
+ return e2 = { ...e2, filter: n2.filter }, t2;
1025
+ }, withSearchClause(n2) {
1026
+ return e2 = { ...e2, search: n2.search }, t2;
1027
+ }, withSorting(...n2) {
1028
+ return e2 = { ...e2, sort: n2.map((e3) => e3.sort) }, t2;
1029
+ }, withAggregation(...n2) {
1030
+ return e2 = { ...e2, aggregations: n2.map((e3) => e3.aggregation) }, t2;
1031
+ }, withPaging(n2) {
1032
+ return e2 = { ...e2, paging: n2 }, t2;
1033
+ }, withTimeZone(n2) {
1034
+ return e2 = { ...e2, timeZone: n2 }, t2;
1035
+ }, build() {
1036
+ return e2;
1037
+ } };
1038
+ return t2;
1039
+ };
1040
+ }
1041
+ function bn(e2) {
1042
+ return { SearchBuilder: yn(), Filter: on(e2), Sort: sn(e2), SearchParams: dn(e2), Aggregation: vn(e2) };
1043
+ }
1044
+ function xn(e2) {
1045
+ return _t(Object.assign(e2, { domainToMappings: { "*.dev.wix-code.com": [{ srcPath: `/_api/categories`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/categories/v1/bulk/categories`, destPath: `/v1/bulk/categories` }, { srcPath: `/categories/v1/categories`, destPath: `/v1/categories` }], "manage._base_domain_": [{ srcPath: `/_api/categories`, destPath: `` }], "editor._base_domain_": [{ srcPath: `/_api/categories-service`, destPath: `` }], "blocks._base_domain_": [{ srcPath: `/_api/categories-service`, destPath: `` }], "create.editorx": [{ srcPath: `/_api/categories-service`, destPath: `` }], _: [{ srcPath: `/categories/v1/bulk/categories`, destPath: `/v1/bulk/categories` }, { srcPath: `/categories/v1/categories`, destPath: `/v1/categories` }] } }));
1046
+ }
1047
+ var Sn = `@wix/auto_sdk_categories_categories`;
1048
+ function Cn(e2) {
1049
+ function t2({ host: t3 }) {
1050
+ return { entityFqdn: `wix.categories.v1.category`, method: `GET`, methodFqn: `com.wix.categories.api.v1.CategoriesService.GetCategory`, packageName: Sn, migrationOptions: { optInTransformResponse: true }, url: xn({ protoPath: `/v1/categories/{categoryId}`, data: e2, host: t3 }), params: gt(e2), transformResponse: (e3) => L(e3, [{ transformFn: A, paths: [{ path: `category.createdDate` }, { path: `category.updatedDate` }, { path: `category.image.urlExpirationDate` }, { path: `category.richContentDescription.metadata.createdTimestamp` }, { path: `category.richContentDescription.metadata.updatedTimestamp` }] }, { transformFn: K, paths: [{ path: `category.richContentDescription.nodes.buttonData.styles.background.gradient.centerX` }, { path: `category.richContentDescription.nodes.buttonData.styles.background.gradient.centerY` }, { path: `category.richContentDescription.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `category.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `category.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `category.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `category.richContentDescription.nodes.galleryData.items.image.media.duration` }, { path: `category.richContentDescription.nodes.galleryData.items.video.media.duration` }, { path: `category.richContentDescription.nodes.galleryData.items.video.thumbnail.duration` }, { path: `category.richContentDescription.nodes.galleryData.options.item.ratio` }, { path: `category.richContentDescription.nodes.imageData.image.duration` }, { path: `category.richContentDescription.nodes.imageData.crop.x` }, { path: `category.richContentDescription.nodes.imageData.crop.y` }, { path: `category.richContentDescription.nodes.imageData.crop.width` }, { path: `category.richContentDescription.nodes.imageData.crop.height` }, { path: `category.richContentDescription.nodes.mapData.mapSettings.lat` }, { path: `category.richContentDescription.nodes.mapData.mapSettings.lng` }, { path: `category.richContentDescription.nodes.pollData.poll.image.duration` }, { path: `category.richContentDescription.nodes.pollData.poll.options.image.duration` }, { path: `category.richContentDescription.nodes.pollData.design.poll.background.image.duration` }, { path: `category.richContentDescription.nodes.appEmbedData.image.duration` }, { path: `category.richContentDescription.nodes.videoData.video.duration` }, { path: `category.richContentDescription.nodes.videoData.thumbnail.duration` }, { path: `category.richContentDescription.nodes.audioData.audio.duration` }, { path: `category.richContentDescription.nodes.audioData.coverImage.duration` }, { path: `category.richContentDescription.nodes.layoutData.backgroundImage.media.duration` }, { path: `category.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `category.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `category.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `category.richContentDescription.nodes.layoutData.backdropImage.media.duration` }, { path: `category.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `category.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `category.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `category.richContentDescription.nodes.layoutData.background.gradient.centerX` }, { path: `category.richContentDescription.nodes.layoutData.background.gradient.centerY` }, { path: `category.richContentDescription.nodes.layoutData.background.gradient.stops.position` }, { path: `category.richContentDescription.nodes.layoutData.backdrop.gradient.centerX` }, { path: `category.richContentDescription.nodes.layoutData.backdrop.gradient.centerY` }, { path: `category.richContentDescription.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `category.richContentDescription.nodes.shapeData.shape.duration` }, { path: `category.richContentDescription.nodes.cardData.background.gradient.centerX` }, { path: `category.richContentDescription.nodes.cardData.background.gradient.centerY` }, { path: `category.richContentDescription.nodes.cardData.background.gradient.stops.position` }, { path: `category.richContentDescription.nodes.cardData.backgroundImage.media.duration` }, { path: `category.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `category.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `category.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `category.richContentDescription.nodes.tocData.fontSize` }, { path: `category.richContentDescription.nodes.tocData.itemSpacing` }, { path: `category.richContentDescription.nodes.smartBlockCellData.shape.duration` }] }]) };
1051
+ }
1052
+ return t2;
1053
+ }
1054
+ var Z = ((e2) => (e2.BREADCRUMBS_INFO = `BREADCRUMBS_INFO`, e2.DESCRIPTION = `DESCRIPTION`, e2.RICH_CONTENT_DESCRIPTION = `RICH_CONTENT_DESCRIPTION`, e2))(Z || {});
1055
+ async function wn(e2, t2, n2) {
1056
+ let { httpClient: r2, sideEffects: i2 } = arguments[3], a2 = Cn(qe({ categoryId: e2, treeReference: t2, fields: n2?.fields }, []));
1057
+ i2?.onSiteCall?.();
1058
+ try {
1059
+ let e3 = await r2.request(a2);
1060
+ return i2?.onSuccess?.(e3), k(L(e3.data, [{ transformFn: X, paths: [{ path: `category.image` }] }]), [`category.richContentDescription`])?.category;
1061
+ } catch (e3) {
1062
+ let t3 = st(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { categoryId: `$[0]`, treeReference: `$[1]`, fields: `$[2].fields` }, singleArgumentUnchanged: false }, [`categoryId`, `treeReference`, `options`]);
1063
+ throw i2?.onError?.(e3), t3;
1064
+ }
1065
+ }
1066
+ ({ ...ln() }, { ...bn() });
1067
+ function Tn(e2) {
1068
+ return (t2, n2, r2) => wn(t2, n2, r2, { httpClient: e2 });
1069
+ }
1070
+ var En = u(`wix.categories.v1.category_category_moved`, true, (e2) => k(L(e2, [{ transformFn: A, paths: [{ path: `metadata.eventTime` }] }])))();
1071
+ var Dn = u(`wix.categories.v1.category_created`, true, (e2) => k(L(e2, [{ transformFn: A, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `entity.richContentDescription.metadata.createdTimestamp` }, { path: `entity.richContentDescription.metadata.updatedTimestamp` }, { path: `metadata.eventTime` }] }, { transformFn: X, paths: [{ path: `entity.image` }] }, { transformFn: K, paths: [{ path: `entity.richContentDescription.nodes.buttonData.styles.background.gradient.centerX` }, { path: `entity.richContentDescription.nodes.buttonData.styles.background.gradient.centerY` }, { path: `entity.richContentDescription.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `entity.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `entity.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.galleryData.items.image.media.duration` }, { path: `entity.richContentDescription.nodes.galleryData.items.video.media.duration` }, { path: `entity.richContentDescription.nodes.galleryData.items.video.thumbnail.duration` }, { path: `entity.richContentDescription.nodes.galleryData.options.item.ratio` }, { path: `entity.richContentDescription.nodes.imageData.image.duration` }, { path: `entity.richContentDescription.nodes.imageData.crop.x` }, { path: `entity.richContentDescription.nodes.imageData.crop.y` }, { path: `entity.richContentDescription.nodes.imageData.crop.width` }, { path: `entity.richContentDescription.nodes.imageData.crop.height` }, { path: `entity.richContentDescription.nodes.mapData.mapSettings.lat` }, { path: `entity.richContentDescription.nodes.mapData.mapSettings.lng` }, { path: `entity.richContentDescription.nodes.pollData.poll.image.duration` }, { path: `entity.richContentDescription.nodes.pollData.poll.options.image.duration` }, { path: `entity.richContentDescription.nodes.pollData.design.poll.background.image.duration` }, { path: `entity.richContentDescription.nodes.appEmbedData.image.duration` }, { path: `entity.richContentDescription.nodes.videoData.video.duration` }, { path: `entity.richContentDescription.nodes.videoData.thumbnail.duration` }, { path: `entity.richContentDescription.nodes.audioData.audio.duration` }, { path: `entity.richContentDescription.nodes.audioData.coverImage.duration` }, { path: `entity.richContentDescription.nodes.layoutData.backgroundImage.media.duration` }, { path: `entity.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.layoutData.backdropImage.media.duration` }, { path: `entity.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `entity.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `entity.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.layoutData.background.gradient.centerX` }, { path: `entity.richContentDescription.nodes.layoutData.background.gradient.centerY` }, { path: `entity.richContentDescription.nodes.layoutData.background.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.layoutData.backdrop.gradient.centerX` }, { path: `entity.richContentDescription.nodes.layoutData.backdrop.gradient.centerY` }, { path: `entity.richContentDescription.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.shapeData.shape.duration` }, { path: `entity.richContentDescription.nodes.cardData.background.gradient.centerX` }, { path: `entity.richContentDescription.nodes.cardData.background.gradient.centerY` }, { path: `entity.richContentDescription.nodes.cardData.background.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.cardData.backgroundImage.media.duration` }, { path: `entity.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.tocData.fontSize` }, { path: `entity.richContentDescription.nodes.tocData.itemSpacing` }, { path: `entity.richContentDescription.nodes.smartBlockCellData.shape.duration` }] }])))();
1072
+ var On = u(`wix.categories.v1.category_deleted`, true, (e2) => k(L(e2, [{ transformFn: A, paths: [{ path: `undefined.createdDate` }, { path: `undefined.updatedDate` }, { path: `undefined.richContentDescription.metadata.createdTimestamp` }, { path: `undefined.richContentDescription.metadata.updatedTimestamp` }, { path: `metadata.eventTime` }] }, { transformFn: X, paths: [{ path: `undefined.image` }] }, { transformFn: K, paths: [{ path: `undefined.richContentDescription.nodes.buttonData.styles.background.gradient.centerX` }, { path: `undefined.richContentDescription.nodes.buttonData.styles.background.gradient.centerY` }, { path: `undefined.richContentDescription.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `undefined.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `undefined.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `undefined.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `undefined.richContentDescription.nodes.galleryData.items.image.media.duration` }, { path: `undefined.richContentDescription.nodes.galleryData.items.video.media.duration` }, { path: `undefined.richContentDescription.nodes.galleryData.items.video.thumbnail.duration` }, { path: `undefined.richContentDescription.nodes.galleryData.options.item.ratio` }, { path: `undefined.richContentDescription.nodes.imageData.image.duration` }, { path: `undefined.richContentDescription.nodes.imageData.crop.x` }, { path: `undefined.richContentDescription.nodes.imageData.crop.y` }, { path: `undefined.richContentDescription.nodes.imageData.crop.width` }, { path: `undefined.richContentDescription.nodes.imageData.crop.height` }, { path: `undefined.richContentDescription.nodes.mapData.mapSettings.lat` }, { path: `undefined.richContentDescription.nodes.mapData.mapSettings.lng` }, { path: `undefined.richContentDescription.nodes.pollData.poll.image.duration` }, { path: `undefined.richContentDescription.nodes.pollData.poll.options.image.duration` }, { path: `undefined.richContentDescription.nodes.pollData.design.poll.background.image.duration` }, { path: `undefined.richContentDescription.nodes.appEmbedData.image.duration` }, { path: `undefined.richContentDescription.nodes.videoData.video.duration` }, { path: `undefined.richContentDescription.nodes.videoData.thumbnail.duration` }, { path: `undefined.richContentDescription.nodes.audioData.audio.duration` }, { path: `undefined.richContentDescription.nodes.audioData.coverImage.duration` }, { path: `undefined.richContentDescription.nodes.layoutData.backgroundImage.media.duration` }, { path: `undefined.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `undefined.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `undefined.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `undefined.richContentDescription.nodes.layoutData.backdropImage.media.duration` }, { path: `undefined.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `undefined.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `undefined.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `undefined.richContentDescription.nodes.layoutData.background.gradient.centerX` }, { path: `undefined.richContentDescription.nodes.layoutData.background.gradient.centerY` }, { path: `undefined.richContentDescription.nodes.layoutData.background.gradient.stops.position` }, { path: `undefined.richContentDescription.nodes.layoutData.backdrop.gradient.centerX` }, { path: `undefined.richContentDescription.nodes.layoutData.backdrop.gradient.centerY` }, { path: `undefined.richContentDescription.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `undefined.richContentDescription.nodes.shapeData.shape.duration` }, { path: `undefined.richContentDescription.nodes.cardData.background.gradient.centerX` }, { path: `undefined.richContentDescription.nodes.cardData.background.gradient.centerY` }, { path: `undefined.richContentDescription.nodes.cardData.background.gradient.stops.position` }, { path: `undefined.richContentDescription.nodes.cardData.backgroundImage.media.duration` }, { path: `undefined.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `undefined.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `undefined.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `undefined.richContentDescription.nodes.tocData.fontSize` }, { path: `undefined.richContentDescription.nodes.tocData.itemSpacing` }, { path: `undefined.richContentDescription.nodes.smartBlockCellData.shape.duration` }] }])))();
1073
+ var kn = u(`wix.categories.v1.category_item_added_to_category`, true, (e2) => k(L(e2, [{ transformFn: A, paths: [{ path: `metadata.eventTime` }] }])))();
1074
+ var An = u(`wix.categories.v1.category_item_removed_from_category`, true, (e2) => k(L(e2, [{ transformFn: A, paths: [{ path: `metadata.eventTime` }] }])))();
1075
+ var jn = u(`wix.categories.v1.category_items_arranged_in_category`, true, (e2) => k(L(e2, [{ transformFn: A, paths: [{ path: `metadata.eventTime` }] }])))();
1076
+ var Mn = u(`wix.categories.v1.category_updated`, true, (e2) => k(L(e2, [{ transformFn: A, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `entity.richContentDescription.metadata.createdTimestamp` }, { path: `entity.richContentDescription.metadata.updatedTimestamp` }, { path: `metadata.eventTime` }, { path: `modifiedFields.createdDate` }, { path: `modifiedFields.updatedDate` }, { path: `modifiedFields.richContentDescription.metadata.createdTimestamp` }, { path: `modifiedFields.richContentDescription.metadata.updatedTimestamp` }] }, { transformFn: X, paths: [{ path: `entity.image` }, { path: `modifiedFields.image` }] }, { transformFn: K, paths: [{ path: `entity.richContentDescription.nodes.buttonData.styles.background.gradient.centerX` }, { path: `entity.richContentDescription.nodes.buttonData.styles.background.gradient.centerY` }, { path: `entity.richContentDescription.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `entity.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `entity.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.galleryData.items.image.media.duration` }, { path: `entity.richContentDescription.nodes.galleryData.items.video.media.duration` }, { path: `entity.richContentDescription.nodes.galleryData.items.video.thumbnail.duration` }, { path: `entity.richContentDescription.nodes.galleryData.options.item.ratio` }, { path: `entity.richContentDescription.nodes.imageData.image.duration` }, { path: `entity.richContentDescription.nodes.imageData.crop.x` }, { path: `entity.richContentDescription.nodes.imageData.crop.y` }, { path: `entity.richContentDescription.nodes.imageData.crop.width` }, { path: `entity.richContentDescription.nodes.imageData.crop.height` }, { path: `entity.richContentDescription.nodes.mapData.mapSettings.lat` }, { path: `entity.richContentDescription.nodes.mapData.mapSettings.lng` }, { path: `entity.richContentDescription.nodes.pollData.poll.image.duration` }, { path: `entity.richContentDescription.nodes.pollData.poll.options.image.duration` }, { path: `entity.richContentDescription.nodes.pollData.design.poll.background.image.duration` }, { path: `entity.richContentDescription.nodes.appEmbedData.image.duration` }, { path: `entity.richContentDescription.nodes.videoData.video.duration` }, { path: `entity.richContentDescription.nodes.videoData.thumbnail.duration` }, { path: `entity.richContentDescription.nodes.audioData.audio.duration` }, { path: `entity.richContentDescription.nodes.audioData.coverImage.duration` }, { path: `entity.richContentDescription.nodes.layoutData.backgroundImage.media.duration` }, { path: `entity.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.layoutData.backdropImage.media.duration` }, { path: `entity.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `entity.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `entity.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.layoutData.background.gradient.centerX` }, { path: `entity.richContentDescription.nodes.layoutData.background.gradient.centerY` }, { path: `entity.richContentDescription.nodes.layoutData.background.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.layoutData.backdrop.gradient.centerX` }, { path: `entity.richContentDescription.nodes.layoutData.backdrop.gradient.centerY` }, { path: `entity.richContentDescription.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.shapeData.shape.duration` }, { path: `entity.richContentDescription.nodes.cardData.background.gradient.centerX` }, { path: `entity.richContentDescription.nodes.cardData.background.gradient.centerY` }, { path: `entity.richContentDescription.nodes.cardData.background.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.cardData.backgroundImage.media.duration` }, { path: `entity.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.tocData.fontSize` }, { path: `entity.richContentDescription.nodes.tocData.itemSpacing` }, { path: `entity.richContentDescription.nodes.smartBlockCellData.shape.duration` }, { path: `modifiedFields.richContentDescription.nodes.buttonData.styles.background.gradient.centerX` }, { path: `modifiedFields.richContentDescription.nodes.buttonData.styles.background.gradient.centerY` }, { path: `modifiedFields.richContentDescription.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `modifiedFields.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `modifiedFields.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `modifiedFields.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `modifiedFields.richContentDescription.nodes.galleryData.items.image.media.duration` }, { path: `modifiedFields.richContentDescription.nodes.galleryData.items.video.media.duration` }, { path: `modifiedFields.richContentDescription.nodes.galleryData.items.video.thumbnail.duration` }, { path: `modifiedFields.richContentDescription.nodes.galleryData.options.item.ratio` }, { path: `modifiedFields.richContentDescription.nodes.imageData.image.duration` }, { path: `modifiedFields.richContentDescription.nodes.imageData.crop.x` }, { path: `modifiedFields.richContentDescription.nodes.imageData.crop.y` }, { path: `modifiedFields.richContentDescription.nodes.imageData.crop.width` }, { path: `modifiedFields.richContentDescription.nodes.imageData.crop.height` }, { path: `modifiedFields.richContentDescription.nodes.mapData.mapSettings.lat` }, { path: `modifiedFields.richContentDescription.nodes.mapData.mapSettings.lng` }, { path: `modifiedFields.richContentDescription.nodes.pollData.poll.image.duration` }, { path: `modifiedFields.richContentDescription.nodes.pollData.poll.options.image.duration` }, { path: `modifiedFields.richContentDescription.nodes.pollData.design.poll.background.image.duration` }, { path: `modifiedFields.richContentDescription.nodes.appEmbedData.image.duration` }, { path: `modifiedFields.richContentDescription.nodes.videoData.video.duration` }, { path: `modifiedFields.richContentDescription.nodes.videoData.thumbnail.duration` }, { path: `modifiedFields.richContentDescription.nodes.audioData.audio.duration` }, { path: `modifiedFields.richContentDescription.nodes.audioData.coverImage.duration` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backgroundImage.media.duration` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backdropImage.media.duration` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.background.gradient.centerX` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.background.gradient.centerY` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.background.gradient.stops.position` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backdrop.gradient.centerX` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backdrop.gradient.centerY` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `modifiedFields.richContentDescription.nodes.shapeData.shape.duration` }, { path: `modifiedFields.richContentDescription.nodes.cardData.background.gradient.centerX` }, { path: `modifiedFields.richContentDescription.nodes.cardData.background.gradient.centerY` }, { path: `modifiedFields.richContentDescription.nodes.cardData.background.gradient.stops.position` }, { path: `modifiedFields.richContentDescription.nodes.cardData.backgroundImage.media.duration` }, { path: `modifiedFields.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `modifiedFields.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `modifiedFields.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `modifiedFields.richContentDescription.nodes.tocData.fontSize` }, { path: `modifiedFields.richContentDescription.nodes.tocData.itemSpacing` }, { path: `modifiedFields.richContentDescription.nodes.smartBlockCellData.shape.duration` }] }])))();
1077
+ var Nn = ht(Tn);
1078
+ G(En), G(Dn), G(On), G(kn), G(An), G(jn), G(Mn);
1079
+ function Pn(e2) {
1080
+ if (!e2) return null;
1081
+ let t2 = e2.match(/image:\/\/v1\/([^/#]+)/);
1082
+ return t2?.[1] ? t2[1] : e2.match(/\/media\/([^/]+)/)?.[1] ?? null;
1083
+ }
1084
+ function Fn(e2) {
1085
+ if (!e2) return null;
1086
+ let t2 = e2.match(/#originWidth=(\d+)&originHeight=(\d+)/);
1087
+ return t2 ? { width: parseInt(t2[1], 10), height: parseInt(t2[2], 10) } : null;
1088
+ }
1089
+ var In = (e2) => `/category/${e2}`;
1090
+ var Ln = (e2) => ({ ...e2, nodes: e2.nodes ?? [] });
1091
+ var Rn = (e2) => {
1092
+ if (!e2) return;
1093
+ let t2 = Fn(e2);
1094
+ return { uri: Pn(e2) ?? void 0, url: e2, width: t2?.width, height: t2?.height };
1095
+ };
1096
+ var zn = (e2) => e2.filter((e3) => e3.categoryId).map((e3) => {
1097
+ let t2 = e3.categorySlug ?? ``;
1098
+ return { id: e3.categoryId ?? ``, name: e3.categoryName ?? ``, slug: t2, href: In(t2) };
1099
+ });
1100
+ var Bn = (e2) => ({ type: e2.type, props: e2.props ?? void 0, meta: e2.meta ?? void 0, children: e2.children, custom: e2.custom, disabled: e2.disabled });
1101
+ var Vn = (e2) => {
1102
+ if (e2) return { preventAutoRedirect: e2.preventAutoRedirect, keywords: e2.keywords?.map((e3) => ({ term: e3.term, isMain: e3.isMain, origin: e3.origin ?? void 0 })) };
1103
+ };
1104
+ var Hn = (e2) => {
1105
+ if (e2) return { tags: e2.tags?.map(Bn), settings: Vn(e2.settings) };
1106
+ };
1107
+ function Un(e2) {
1108
+ return { id: e2._id ?? ``, name: e2.name ?? ``, slug: e2.slug ?? ``, description: e2.description ?? void 0, itemCounter: e2.itemCounter, parentCategoryId: e2.parentCategory?._id ?? void 0, seoData: Hn(e2.seoData), richContentDescription: e2.richContentDescription ? Ln(e2.richContentDescription) : void 0, image: Rn(e2.image), breadcrumbs: zn(e2.breadcrumbsInfo?.breadcrumbs ?? []) };
1109
+ }
1110
+ var Wn = { appNamespace: `@wix/stores`, treeKey: null };
1111
+ var Gn = [Z.BREADCRUMBS_INFO, Z.DESCRIPTION, Z.RICH_CONTENT_DESCRIPTION];
1112
+ var Kn = (e2, t2) => {
1113
+ if (!e2?._id || e2.visible === false) throw Error(t2);
1114
+ return Un(e2);
1115
+ };
1116
+ async function qn(e2) {
1117
+ return Kn(await Nn(e2, Wn, { fields: Gn }), `Category not found for id: ${e2}`);
1118
+ }
1119
+ var Jn = `wixstores-storefront-builder:category-info-context-data`;
1120
+ function Yn(e2) {
1121
+ return rn(`${Jn}:${e2}`, () => qn(e2));
1122
+ }
1123
+ var Xn = Y(`@wix/site-service-url`);
1124
+ var Q = `215238eb-22a5-4c36-9e7b-e7c08025e04e`;
1125
+ `${Q}`, `${Q}`;
1126
+ var Zn = function(e2) {
1127
+ 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;
1128
+ }({});
1129
+ var Qn = () => {
1130
+ let e2 = s(Xn), t2 = n((t3, n2) => {
1131
+ let r2 = e2.appSectionRelativeUrl(Q, t3, true);
1132
+ if (r2) return `./${r2.replace(/^\//, ``).replace(/\/$/, ``)}/${encodeURIComponent(n2)}`;
1133
+ }, [e2]);
1134
+ return { getPageRelativeUrl: t2, getPageAbsoluteUrl: n((n2, r2) => {
1135
+ let i2 = t2(n2, r2);
1136
+ if (i2) return new URL(i2, `${e2.siteUrl.replace(/\/$/, ``)}/`).href;
1137
+ }, [t2, e2]) };
1138
+ };
1139
+ function $n(e2) {
1140
+ let { getPageAbsoluteUrl: t2 } = Qn(), n2 = i(() => {
1141
+ if (!e2.slug) return;
1142
+ let n3 = t2(Zn.CATEGORY_PAGE, e2.slug);
1143
+ return n3 ? { href: n3 } : void 0;
1144
+ }, [e2.slug, t2]);
1145
+ return i(() => ({ id: e2.id, name: e2.name, slug: e2.slug, link: n2, description: e2.description, richContentDescription: e2.richContentDescription, image: e2.image, breadcrumbs: e2.breadcrumbs }), [e2, n2]);
1146
+ }
1147
+ var $ = t(null);
1148
+ $.displayName = `CategoryInfoContext`;
1149
+ function er() {
1150
+ let e2 = r($);
1151
+ if (!e2) throw Error(`useCategoryInfoContext must be used within a category info context provider`);
1152
+ return e2;
1153
+ }
1154
+ function tr({ categoryPromise: e2, children: t2 }) {
1155
+ let n2 = $n(en(e2));
1156
+ return c($.Provider, { value: n2, children: t2 });
1157
+ }
1158
+ function nr({ categoryId: t2, children: n2 }) {
1159
+ let r2 = Yn(t2);
1160
+ return c(e, { fallback: null, children: c(tr, { categoryPromise: r2, children: n2 }) });
1161
+ }
1162
+ function rr({ children: e2, value: t2, categoryId: n2 }) {
1163
+ return t2 === void 0 ? n2 ? c(nr, { categoryId: n2, children: e2 }, n2) : null : c($.Provider, { value: t2, children: e2 });
1164
+ }
1165
+ var ir = $t(`0d8869b2-7691-4ee2-9d0b-90d72f34edd0`);
1166
+ export {
1167
+ rr as CategoryInfoContextProvider,
1168
+ rr as default,
1169
+ ir as injectAccessTokenGetter,
1170
+ er as useCategoryInfoContext
1171
+ };
1172
+ //# sourceMappingURL=context-category-info-context-provider.mjs.map