@wix/bookings 1.0.1749 → 1.0.1751
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.
- package/_sdk-exports/context-booking-checkout/runtime.js +2 -0
- package/_sdk-exports/context-categories/runtime.js +1 -0
- package/_sdk-exports/context-locations/runtime.js +1 -0
- package/_sdk-exports/{context-service-context → context-service}/runtime.d.ts +1 -1
- package/_sdk-exports/{context-service-context → context-service}/runtime.js +2 -2
- package/_sdk-exports/context-service-addons/runtime.js +1 -0
- package/_sdk-exports/context-services/runtime.js +2 -0
- package/_sdk-exports/context-time-slots/runtime.js +2 -0
- package/build/cjs/{context-booking-checkout-context.js → context-booking-checkout.js} +909 -925
- package/build/cjs/context-booking-checkout.js.map +1 -0
- package/build/cjs/{context-categories-context.js → context-categories.js} +287 -293
- package/build/cjs/context-categories.js.map +1 -0
- package/build/cjs/{context-locations-context.js → context-locations.js} +362 -368
- package/build/cjs/context-locations.js.map +1 -0
- package/build/cjs/{context-service-addons-context.js → context-service-addons.js} +424 -430
- package/build/cjs/context-service-addons.js.map +1 -0
- package/build/cjs/{context-service-context.d.ts → context-service.d.ts} +1 -1
- package/build/cjs/{context-service-context.js → context-service.js} +964 -977
- package/build/cjs/context-service.js.map +1 -0
- package/build/cjs/{context-services-context.js → context-services.js} +600 -611
- package/build/cjs/context-services.js.map +1 -0
- package/build/cjs/{context-time-slots-context.js → context-time-slots.js} +1187 -1195
- package/build/cjs/context-time-slots.js.map +1 -0
- package/build/es/{context-booking-checkout-context.mjs → context-booking-checkout.mjs} +906 -922
- package/build/es/context-booking-checkout.mjs.map +1 -0
- package/build/es/{context-categories-context.mjs → context-categories.mjs} +283 -289
- package/build/es/context-categories.mjs.map +1 -0
- package/build/es/{context-locations-context.mjs → context-locations.mjs} +358 -364
- package/build/es/context-locations.mjs.map +1 -0
- package/build/es/{context-service-addons-context.mjs → context-service-addons.mjs} +417 -423
- package/build/es/context-service-addons.mjs.map +1 -0
- package/build/{internal/cjs/context-service-context.d.ts → es/context-service.d.mts} +1 -1
- package/build/es/{context-service-context.mjs → context-service.mjs} +960 -973
- package/build/es/context-service.mjs.map +1 -0
- package/build/es/{context-services-context.mjs → context-services.mjs} +596 -607
- package/build/es/context-services.mjs.map +1 -0
- package/build/es/{context-time-slots-context.mjs → context-time-slots.mjs} +1181 -1189
- package/build/es/context-time-slots.mjs.map +1 -0
- package/build/internal/{es/context-service-context.d.mts → cjs/context-service.d.ts} +1 -1
- package/build/{es/context-service-context.d.mts → internal/es/context-service.d.mts} +1 -1
- package/context/booking-checkout/package.json +3 -0
- package/context/categories/package.json +3 -0
- package/context/locations/package.json +3 -0
- package/context/service/package.json +3 -0
- package/context/service-addons/package.json +3 -0
- package/context/services/package.json +3 -0
- package/context/time-slots/package.json +3 -0
- package/package.json +43 -43
- package/_sdk-exports/context-booking-checkout-context/runtime.js +0 -2
- package/_sdk-exports/context-categories-context/runtime.js +0 -1
- package/_sdk-exports/context-locations-context/runtime.js +0 -1
- package/_sdk-exports/context-service-addons-context/runtime.js +0 -1
- package/_sdk-exports/context-services-context/runtime.js +0 -2
- package/_sdk-exports/context-time-slots-context/runtime.js +0 -2
- package/build/cjs/context-booking-checkout-context.js.map +0 -1
- package/build/cjs/context-categories-context.js.map +0 -1
- package/build/cjs/context-locations-context.js.map +0 -1
- package/build/cjs/context-service-addons-context.js.map +0 -1
- package/build/cjs/context-service-context.js.map +0 -1
- package/build/cjs/context-services-context.js.map +0 -1
- package/build/cjs/context-time-slots-context.js.map +0 -1
- package/build/es/context-booking-checkout-context.mjs.map +0 -1
- package/build/es/context-categories-context.mjs.map +0 -1
- package/build/es/context-locations-context.mjs.map +0 -1
- package/build/es/context-service-addons-context.mjs.map +0 -1
- package/build/es/context-service-context.mjs.map +0 -1
- package/build/es/context-services-context.mjs.map +0 -1
- package/build/es/context-time-slots-context.mjs.map +0 -1
- package/context/booking-checkout-context/package.json +0 -3
- package/context/categories-context/package.json +0 -3
- package/context/locations-context/package.json +0 -3
- package/context/service-addons-context/package.json +0 -3
- package/context/service-context/package.json +0 -3
- package/context/services-context/package.json +0 -3
- package/context/time-slots-context/package.json +0 -3
- /package/_sdk-exports/{context-booking-checkout-context → context-booking-checkout}/runtime.d.ts +0 -0
- /package/_sdk-exports/{context-categories-context → context-categories}/runtime.d.ts +0 -0
- /package/_sdk-exports/{context-locations-context → context-locations}/runtime.d.ts +0 -0
- /package/_sdk-exports/{context-service-addons-context → context-service-addons}/runtime.d.ts +0 -0
- /package/_sdk-exports/{context-services-context → context-services}/runtime.d.ts +0 -0
- /package/_sdk-exports/{context-time-slots-context → context-time-slots}/runtime.d.ts +0 -0
- /package/build/cjs/{context-booking-checkout-context.d.ts → context-booking-checkout.d.ts} +0 -0
- /package/build/cjs/{context-categories-context.d.ts → context-categories.d.ts} +0 -0
- /package/build/cjs/{context-locations-context.d.ts → context-locations.d.ts} +0 -0
- /package/build/cjs/{context-service-addons-context.d.ts → context-service-addons.d.ts} +0 -0
- /package/build/cjs/{context-services-context.d.ts → context-services.d.ts} +0 -0
- /package/build/cjs/{context-time-slots-context.d.ts → context-time-slots.d.ts} +0 -0
- /package/build/es/{context-booking-checkout-context.d.mts → context-booking-checkout.d.mts} +0 -0
- /package/build/es/{context-categories-context.d.mts → context-categories.d.mts} +0 -0
- /package/build/es/{context-locations-context.d.mts → context-locations.d.mts} +0 -0
- /package/build/es/{context-service-addons-context.d.mts → context-service-addons.d.mts} +0 -0
- /package/build/es/{context-services-context.d.mts → context-services.d.mts} +0 -0
- /package/build/es/{context-time-slots-context.d.mts → context-time-slots.d.mts} +0 -0
- /package/build/internal/cjs/{context-booking-checkout-context.d.ts → context-booking-checkout.d.ts} +0 -0
- /package/build/internal/cjs/{context-categories-context.d.ts → context-categories.d.ts} +0 -0
- /package/build/internal/cjs/{context-locations-context.d.ts → context-locations.d.ts} +0 -0
- /package/build/internal/cjs/{context-service-addons-context.d.ts → context-service-addons.d.ts} +0 -0
- /package/build/internal/cjs/{context-services-context.d.ts → context-services.d.ts} +0 -0
- /package/build/internal/cjs/{context-time-slots-context.d.ts → context-time-slots.d.ts} +0 -0
- /package/build/internal/es/{context-booking-checkout-context.d.mts → context-booking-checkout.d.mts} +0 -0
- /package/build/internal/es/{context-categories-context.d.mts → context-categories.d.mts} +0 -0
- /package/build/internal/es/{context-locations-context.d.mts → context-locations.d.mts} +0 -0
- /package/build/internal/es/{context-service-addons-context.d.mts → context-service-addons.d.mts} +0 -0
- /package/build/internal/es/{context-services-context.d.mts → context-services.d.mts} +0 -0
- /package/build/internal/es/{context-time-slots-context.d.mts → context-time-slots.d.mts} +0 -0
|
@@ -17,19 +17,19 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
|
-
// context-categories
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
23
|
-
CATEGORIES_CONTEXT_MISSING_PROVIDER_ERROR: () =>
|
|
24
|
-
CategoriesContextProvider: () =>
|
|
20
|
+
// context-categories.ts
|
|
21
|
+
var context_categories_exports = {};
|
|
22
|
+
__export(context_categories_exports, {
|
|
23
|
+
CATEGORIES_CONTEXT_MISSING_PROVIDER_ERROR: () => Vn,
|
|
24
|
+
CategoriesContextProvider: () => qn,
|
|
25
25
|
categoriesContext: () => $,
|
|
26
|
-
default: () =>
|
|
27
|
-
injectAccessTokenGetter: () =>
|
|
28
|
-
useCategoriesContext: () =>
|
|
26
|
+
default: () => qn,
|
|
27
|
+
injectAccessTokenGetter: () => Jn,
|
|
28
|
+
useCategoriesContext: () => Hn
|
|
29
29
|
});
|
|
30
|
-
module.exports = __toCommonJS(
|
|
30
|
+
module.exports = __toCommonJS(context_categories_exports);
|
|
31
31
|
|
|
32
|
-
// _sdk-exports/context-categories
|
|
32
|
+
// _sdk-exports/context-categories/runtime.js
|
|
33
33
|
var import_react = require("react");
|
|
34
34
|
var import_services_manager_react = require("@wix/services-manager-react");
|
|
35
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -162,24 +162,24 @@ var ve = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgu
|
|
|
162
162
|
let a2 = { ...e2, ...t2 }, o2 = Object.keys(a2);
|
|
163
163
|
return r2?.filter((e3) => !r2.some((t3) => t3.field.length > e3.field.length && t3.field.startsWith(e3.field) && o2.includes(t3.field))).map((e3) => {
|
|
164
164
|
let r3 = t2[e3.field];
|
|
165
|
-
if (r3) return { ...e3, field:
|
|
165
|
+
if (r3) return { ...e3, field: ye(r3, i2) };
|
|
166
166
|
let s2 = o2?.sort((e4, t3) => t3.length - e4.length)?.find((t3) => e3.field.startsWith(t3));
|
|
167
167
|
if (s2) {
|
|
168
168
|
let t3 = a2[s2];
|
|
169
|
-
if (t3) return { ...e3, field: e3.field.replace(s2,
|
|
169
|
+
if (t3) return { ...e3, field: e3.field.replace(s2, ye(t3, i2)) };
|
|
170
170
|
}
|
|
171
171
|
return n2 ? { ...e3, field: `${i2[0]}.${e3.field}` } : e3;
|
|
172
172
|
});
|
|
173
173
|
};
|
|
174
|
-
var
|
|
175
|
-
let n2 =
|
|
174
|
+
var ye = (e2, t2) => {
|
|
175
|
+
let n2 = be(e2);
|
|
176
176
|
return n2 == null ? e2 : e2.replace(`$[${n2}]`, t2[n2]);
|
|
177
177
|
};
|
|
178
|
-
var
|
|
178
|
+
var be = (e2) => {
|
|
179
179
|
let t2 = e2.match(/\$\[(?<argIndex>\d+)\]/);
|
|
180
180
|
return t2 && t2.groups && Number(t2.groups.argIndex);
|
|
181
181
|
};
|
|
182
|
-
function
|
|
182
|
+
function xe(e2, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
|
|
183
183
|
return ae(() => e2({ request: async (e3) => {
|
|
184
184
|
let i3 = e3({ host: s2?.HTTPHost || `www.wixapis.com` }), a3 = i3;
|
|
185
185
|
a3.method === `GET` && a3.fallback?.length && (a3.params?.toString().length ?? 0) > 4e3 && (a3 = i3.fallback[0]);
|
|
@@ -193,7 +193,7 @@ function be(e2, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
|
|
|
193
193
|
e5 = await s3.json();
|
|
194
194
|
} catch {
|
|
195
195
|
}
|
|
196
|
-
let t3 =
|
|
196
|
+
let t3 = Ce(s3.status, e5?.message ?? s3.statusText, e5?.details, { requestId: s3.headers.get(`X-Wix-Request-Id`), details: e5 }), n3 = me(t3);
|
|
197
197
|
throw r2?.handleError(n3, { requestOptions: { url: a3.url, method: a3.method, entityFqdn: i3.entityFqdn, methodFqn: i3.methodFqn } }), t3;
|
|
198
198
|
}
|
|
199
199
|
let l3 = await s3.json();
|
|
@@ -203,18 +203,18 @@ function be(e2, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
|
|
|
203
203
|
}
|
|
204
204
|
}, fetchWithAuth: n2, wixAPIFetch: i2, getActiveToken: a2, getAuthHeaders: o2 }, { validateRequestSchema: u2 }));
|
|
205
205
|
}
|
|
206
|
-
var
|
|
206
|
+
var Se = class extends Error {
|
|
207
207
|
response;
|
|
208
208
|
requestId;
|
|
209
209
|
constructor(e2) {
|
|
210
210
|
super(), this.response = e2.response, this.requestId = e2.requestId;
|
|
211
211
|
}
|
|
212
212
|
};
|
|
213
|
-
var
|
|
214
|
-
var
|
|
215
|
-
function
|
|
213
|
+
var Ce = (e2, t2, n2, r2) => new Se({ response: { data: { details: { ...!n2?.validationError && { applicationError: { description: t2, code: e2, data: r2 } }, ...n2 }, message: t2 }, status: e2 }, requestId: r2?.requestId });
|
|
214
|
+
var we = `.`;
|
|
215
|
+
function Te(e2, t2, n2) {
|
|
216
216
|
if (e2 == null) throw Error(`Cannot set value on null or undefined`);
|
|
217
|
-
let r2 =
|
|
217
|
+
let r2 = D(t2), i2 = e2;
|
|
218
218
|
for (let e3 = 0; e3 < r2.length; e3++) {
|
|
219
219
|
let t3 = r2[e3];
|
|
220
220
|
if (e3 === r2.length - 1) {
|
|
@@ -226,21 +226,21 @@ function we(e2, t2, n2) {
|
|
|
226
226
|
}
|
|
227
227
|
return e2;
|
|
228
228
|
}
|
|
229
|
-
function
|
|
230
|
-
return Array.isArray(e2) ? e2 : e2.split(
|
|
229
|
+
function D(e2) {
|
|
230
|
+
return Array.isArray(e2) ? e2 : e2.split(we).map((e3) => Ee(e3) ? Number(e3) : e3);
|
|
231
231
|
}
|
|
232
|
-
function
|
|
232
|
+
function Ee(e2) {
|
|
233
233
|
return /^\d+$/.test(e2);
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function De(e2) {
|
|
236
236
|
let t2 = {};
|
|
237
|
-
for (let [n2, r2] of Object.entries(e2))
|
|
237
|
+
for (let [n2, r2] of Object.entries(e2)) Oe(n2) || Te(t2, D(n2), r2);
|
|
238
238
|
return t2;
|
|
239
239
|
}
|
|
240
|
-
function
|
|
240
|
+
function Oe(e2) {
|
|
241
241
|
return e2 === `__proto__` || e2 === `constructor` || e2 === `prototype`;
|
|
242
242
|
}
|
|
243
|
-
var
|
|
243
|
+
var ke = class {
|
|
244
244
|
BRACKET_PATTERN = /\[(\d+)\]/g;
|
|
245
245
|
NUMERIC_PATTERN = /^\d+$/;
|
|
246
246
|
ESCAPED_DOT_PATTERN = /\\\./g;
|
|
@@ -263,7 +263,7 @@ var Oe = class {
|
|
|
263
263
|
return e2.replace(this.ESCAPED_DOT_PLACEHOLDER, `\\.`).replace(this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER, `\\]`).replace(this.ESCAPED_LEFT_BRACKET_PLACEHOLDER, `\\[`);
|
|
264
264
|
}
|
|
265
265
|
unflatten() {
|
|
266
|
-
return this.cleanedModifiedFields = Object.fromEntries(Object.entries(this.modifiedFields).map(([e2, t2]) => [this.replaceEscapedCharacters(this.bracketToDotNotation(e2)), t2])),
|
|
266
|
+
return this.cleanedModifiedFields = Object.fromEntries(Object.entries(this.modifiedFields).map(([e2, t2]) => [this.replaceEscapedCharacters(this.bracketToDotNotation(e2)), t2])), De(this.cleanedModifiedFields);
|
|
267
267
|
}
|
|
268
268
|
flatten(e2) {
|
|
269
269
|
let t2 = {};
|
|
@@ -288,7 +288,7 @@ var Oe = class {
|
|
|
288
288
|
r2.push(i3), n2 = t3[i3];
|
|
289
289
|
return;
|
|
290
290
|
}
|
|
291
|
-
let a3 =
|
|
291
|
+
let a3 = Ne(e3);
|
|
292
292
|
if (a3 && a3 in t3) {
|
|
293
293
|
r2.push(a3), n2 = t3[a3];
|
|
294
294
|
return;
|
|
@@ -319,28 +319,28 @@ var Oe = class {
|
|
|
319
319
|
return e2.replace(this.BRACKET_PATTERN, (t2, n2, r2) => r2 > 0 && e2[r2 - 1] === `\\` ? t2 : `.` + n2);
|
|
320
320
|
}
|
|
321
321
|
};
|
|
322
|
-
function
|
|
322
|
+
function Ae(e2, t2) {
|
|
323
323
|
let n2 = e2?.modifiedFields;
|
|
324
324
|
if (!n2) return null;
|
|
325
|
-
let r2 =
|
|
325
|
+
let r2 = je(n2);
|
|
326
326
|
if (!r2) return null;
|
|
327
327
|
let { unflattenedModifiedFields: i2, modifiedFieldsManipulator: a2 } = r2;
|
|
328
328
|
e2 = { ...e2, modifiedFields: i2 };
|
|
329
329
|
let o2 = t2(e2), s2 = o2?.modifiedFields;
|
|
330
330
|
if (!s2) return null;
|
|
331
|
-
let c2 =
|
|
331
|
+
let c2 = Me(s2, a2);
|
|
332
332
|
return c2 === null ? null : (o2.modifiedFields = c2, o2);
|
|
333
333
|
}
|
|
334
|
-
function
|
|
334
|
+
function je(e2) {
|
|
335
335
|
if (typeof e2 == `object` && e2 && !Array.isArray(e2)) try {
|
|
336
|
-
let t2 = new
|
|
336
|
+
let t2 = new ke(e2);
|
|
337
337
|
return { unflattenedModifiedFields: t2.unflatten(), modifiedFieldsManipulator: t2 };
|
|
338
338
|
} catch {
|
|
339
339
|
return null;
|
|
340
340
|
}
|
|
341
341
|
return null;
|
|
342
342
|
}
|
|
343
|
-
function
|
|
343
|
+
function Me(e2, t2) {
|
|
344
344
|
if (typeof e2 == `object` && e2 && !Array.isArray(e2)) try {
|
|
345
345
|
return t2.flatten(e2);
|
|
346
346
|
} catch {
|
|
@@ -348,10 +348,10 @@ function je(e2, t2) {
|
|
|
348
348
|
}
|
|
349
349
|
return null;
|
|
350
350
|
}
|
|
351
|
-
function
|
|
351
|
+
function Ne(e2) {
|
|
352
352
|
return e2.replace(/[-_\s]+(.)?/g, (e3, t2) => t2 ? t2.toUpperCase() : ``).replace(/^./, (e3) => e3.toLowerCase());
|
|
353
353
|
}
|
|
354
|
-
function
|
|
354
|
+
function O() {
|
|
355
355
|
return { emit(e2, ...t2) {
|
|
356
356
|
for (let n2 = 0, r2 = this.events[e2] || [], i2 = r2.length; n2 < i2; n2++) r2[n2](...t2);
|
|
357
357
|
}, events: {}, on(e2, t2) {
|
|
@@ -360,8 +360,8 @@ function k() {
|
|
|
360
360
|
};
|
|
361
361
|
} };
|
|
362
362
|
}
|
|
363
|
-
var
|
|
364
|
-
function
|
|
363
|
+
var Pe = (e2) => e2.__type === `event-definition`;
|
|
364
|
+
function Fe(e2, t2, n2, r2) {
|
|
365
365
|
let i2;
|
|
366
366
|
if (e2.isDomainEvent) {
|
|
367
367
|
let { deletedEvent: e3, actionEvent: t3, createdEvent: a3, updatedEvent: o3, ...s3 } = n2, c2 = { ...r2, ...s3 };
|
|
@@ -372,14 +372,14 @@ function Pe(e2, t2, n2, r2) {
|
|
|
372
372
|
let e3 = s2.modifiedFields;
|
|
373
373
|
if (typeof e3 == `object` && e3 && !Array.isArray(e3)) {
|
|
374
374
|
o2 = structuredClone(i2);
|
|
375
|
-
let e4 =
|
|
375
|
+
let e4 = Ae(s2, a2);
|
|
376
376
|
if (e4) return t2(e4);
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
379
|
return t2(a2(o2));
|
|
380
380
|
}
|
|
381
|
-
function
|
|
382
|
-
let t2 = /* @__PURE__ */ new Map(), n2 =
|
|
381
|
+
function Ie(e2) {
|
|
382
|
+
let t2 = /* @__PURE__ */ new Map(), n2 = O();
|
|
383
383
|
return { initModule(e3) {
|
|
384
384
|
return (r2) => {
|
|
385
385
|
let i2 = t2.get(e3.type) ?? [];
|
|
@@ -389,7 +389,7 @@ function Fe(e2) {
|
|
|
389
389
|
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 }))];
|
|
390
390
|
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(`, `)}`);
|
|
391
391
|
let l2 = t2.get(r2) ?? [];
|
|
392
|
-
return await Promise.all(l2.map(({ eventDefinition: e4, handler: t3 }) =>
|
|
392
|
+
return await Promise.all(l2.map(({ eventDefinition: e4, handler: t3 }) => Fe(e4, t3, o2, { instanceId: a2, identity: i2, accountInfo: s2 }))), { instanceId: a2, eventType: r2, payload: o2, identity: i2, accountInfo: s2 };
|
|
393
393
|
}, async processRequest(e3, t3) {
|
|
394
394
|
let n3 = await e3.text();
|
|
395
395
|
return this.process(n3, t3);
|
|
@@ -408,12 +408,12 @@ function Fe(e2) {
|
|
|
408
408
|
let n3 = Array.from(t2.keys()).map((e4) => ({ type: e4 }));
|
|
409
409
|
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(`, `)}`);
|
|
410
410
|
let r2 = t2.get(e3.eventType) ?? [];
|
|
411
|
-
await Promise.all(r2.map(({ eventDefinition: t3, handler: n4 }) =>
|
|
411
|
+
await Promise.all(r2.map(({ eventDefinition: t3, handler: n4 }) => Fe(t3, n4, e3.payload, { instanceId: e3.instanceId, identity: e3.identity })));
|
|
412
412
|
}, apps: { AppInstalled: m(`AppInstalled`)(), AppRemoved: m(`AppRemoved`)() } } };
|
|
413
413
|
}
|
|
414
|
-
var
|
|
415
|
-
function
|
|
416
|
-
let t2 = /* @__PURE__ */ new Map(), n2 =
|
|
414
|
+
var Le = (e2) => e2.__type === `service-plugin-definition`;
|
|
415
|
+
function Re(e2) {
|
|
416
|
+
let t2 = /* @__PURE__ */ new Map(), n2 = O();
|
|
417
417
|
return { initModule(e3) {
|
|
418
418
|
return (r2) => {
|
|
419
419
|
let i2 = t2.get(e3.componentType.toLowerCase()) ?? [];
|
|
@@ -454,38 +454,38 @@ function Le(e2) {
|
|
|
454
454
|
return s2.transformations.toREST(await c2(s2.transformations.fromREST(e3)));
|
|
455
455
|
} } };
|
|
456
456
|
}
|
|
457
|
-
var
|
|
458
|
-
function
|
|
457
|
+
var k = `X-Wix-Consistent`;
|
|
458
|
+
function ze(e2) {
|
|
459
459
|
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) => {
|
|
460
|
-
let i3 = o2(), s3 = await a2(), c3 = { ...r3?.headers ?? {}, ...s3.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [
|
|
460
|
+
let i3 = o2(), s3 = await a2(), c3 = { ...r3?.headers ?? {}, ...s3.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [k]: t2[k] } : {} }, l3 = e2.host?.getErrorHandler?.();
|
|
461
461
|
try {
|
|
462
462
|
if (typeof n3 == `string` || n3 instanceof URL) {
|
|
463
463
|
let e3 = await i3(n3, { ...r3, headers: c3 });
|
|
464
464
|
l3?.handleError(e3, { requestOptions: { url: n3.toString(), method: r3?.method } });
|
|
465
|
-
let a3 =
|
|
466
|
-
return a3 && (t2[
|
|
465
|
+
let a3 = A(e3);
|
|
466
|
+
return a3 && (t2[k] = a3), e3;
|
|
467
467
|
}
|
|
468
468
|
{
|
|
469
469
|
for (let [e4, t3] of Object.entries(c3)) typeof t3 == `string` && n3.headers.set(e4, t3);
|
|
470
470
|
let e3 = await i3(n3, r3);
|
|
471
471
|
l3?.handleError(e3, { requestOptions: { url: n3.url, method: r3?.method } });
|
|
472
|
-
let a3 =
|
|
473
|
-
return a3 && (t2[
|
|
472
|
+
let a3 = A(e3);
|
|
473
|
+
return a3 && (t2[k] = a3), e3;
|
|
474
474
|
}
|
|
475
475
|
} catch (e3) {
|
|
476
476
|
throw l3?.handleError(e3, { requestOptions: { url: typeof n3 == `string` || n3 instanceof URL ? n3.toString() : n3.url, method: r3?.method } }), e3;
|
|
477
477
|
}
|
|
478
|
-
}, { client: c2, initModule: l2 } =
|
|
479
|
-
let i3 = o2(), s3 = await a2(), c3 = S(r3), l3 = await i3(n3, { ...r3, headers: { ...c3, ...t2, ...s3?.headers, ...r3?.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [
|
|
480
|
-
return u3 && (t2[
|
|
478
|
+
}, { client: c2, initModule: l2 } = Re(i2), { client: u2, initModule: d2 } = Ie(i2), f2 = async (n3, r3) => {
|
|
479
|
+
let i3 = o2(), s3 = await a2(), c3 = S(r3), l3 = await i3(n3, { ...r3, headers: { ...c3, ...t2, ...s3?.headers, ...r3?.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [k]: t2[k] } : {} } }), u3 = A(l3);
|
|
480
|
+
return u3 && (t2[k] = u3), l3;
|
|
481
481
|
}, m2 = (t3, n3) => {
|
|
482
|
-
if (
|
|
483
|
-
if (
|
|
482
|
+
if (Pe(t3)) return d2(t3);
|
|
483
|
+
if (Le(t3)) return l2(t3);
|
|
484
484
|
if (ee(t3) && e2.host) return te(t3, e2.host);
|
|
485
485
|
if (typeof t3 == `function`) {
|
|
486
486
|
if (`__type` in t3 && t3.__type === `wix_spi_error`) return t3;
|
|
487
487
|
let r3 = e2.host?.apiBaseUrl ?? `www.wixapis.com`, o3 = e2.useCDN === void 0 ? i2().shouldUseCDN : e2.useCDN;
|
|
488
|
-
return
|
|
488
|
+
return xe(ae(() => _(t3)) ? g(t3) : t3, n3 ?? {}, f2, e2.host?.getErrorHandler?.(), (e3, t4) => {
|
|
489
489
|
let n4 = new URL(e3, `https://${r3}`);
|
|
490
490
|
return n4.host = r3, n4.protocol = `https`, f2(n4.toString(), t4);
|
|
491
491
|
}, i2().getActiveToken, async () => a2(), { HTTPHost: r3 }, e2.host?.name, o3, e2.validateRequestSchema);
|
|
@@ -509,19 +509,19 @@ function Re(e2) {
|
|
|
509
509
|
return { data: o3 ?? {}, errors: s3 };
|
|
510
510
|
}, webhooks: u2, servicePlugins: c2 };
|
|
511
511
|
}
|
|
512
|
-
function
|
|
512
|
+
function A(e2) {
|
|
513
513
|
return e2.headers?.get(`X-Wix-Consistent`) ?? e2.headers?.get(`x-wix-consistent`);
|
|
514
514
|
}
|
|
515
|
-
var
|
|
516
|
-
var
|
|
517
|
-
function
|
|
515
|
+
var Be = { _id: `id`, _createdDate: `createdDate`, _updatedDate: `updatedDate` };
|
|
516
|
+
var Ve = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
|
|
517
|
+
function He(e2, t2) {
|
|
518
518
|
return e2?.split(`.`).map((e3) => t2?.[e3] ?? e3).join(`.`);
|
|
519
519
|
}
|
|
520
|
-
var
|
|
521
|
-
function
|
|
522
|
-
return (e2 ===
|
|
520
|
+
var j = `sort.fieldName`;
|
|
521
|
+
function Ue(e2, t2, n2) {
|
|
522
|
+
return (e2 === j || e2.endsWith(`.${j}`)) && typeof t2 == `string` ? He(t2, n2) : t2;
|
|
523
523
|
}
|
|
524
|
-
function
|
|
524
|
+
function M(e2, t2, n2) {
|
|
525
525
|
let r2 = (e3) => n2.includes(e3), i2 = (e3, n3) => {
|
|
526
526
|
if (Array.isArray(e3)) e3.forEach((e4) => {
|
|
527
527
|
i2(e4, n3);
|
|
@@ -531,87 +531,87 @@ function N(e2, t2, n2) {
|
|
|
531
531
|
Object.keys(a2).forEach((e4) => {
|
|
532
532
|
let o2 = n3 === `` ? e4 : `${n3}.${e4}`;
|
|
533
533
|
if (r2(o2)) return;
|
|
534
|
-
let s2 =
|
|
535
|
-
s2 !== e4 && !(s2 in a2) && (a2[s2] = a2[e4], delete a2[e4]), a2[s2] =
|
|
534
|
+
let s2 = We(e4, t2);
|
|
535
|
+
s2 !== e4 && !(s2 in a2) && (a2[s2] = a2[e4], delete a2[e4]), a2[s2] = Ue(o2, a2[s2], t2), i2(a2[s2], o2);
|
|
536
536
|
});
|
|
537
537
|
}
|
|
538
538
|
};
|
|
539
539
|
return i2(e2, ``), e2;
|
|
540
540
|
}
|
|
541
|
-
function
|
|
541
|
+
function We(e2, t2) {
|
|
542
542
|
let n2;
|
|
543
543
|
return n2 = e2.includes(`.`) ? e2.split(`.`).map((e3) => t2[e3] ?? e3).join(`.`) : t2[e2] ?? e2, n2;
|
|
544
544
|
}
|
|
545
|
-
function We(e2, t2 = []) {
|
|
546
|
-
return N(e2, ze, t2);
|
|
547
|
-
}
|
|
548
545
|
function Ge(e2, t2 = []) {
|
|
549
|
-
return
|
|
546
|
+
return M(e2, Be, t2);
|
|
550
547
|
}
|
|
551
|
-
function
|
|
552
|
-
return
|
|
548
|
+
function Ke(e2, t2 = []) {
|
|
549
|
+
return M(e2, Ve, t2);
|
|
553
550
|
}
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
var
|
|
558
|
-
|
|
551
|
+
function N(e2) {
|
|
552
|
+
return Xe(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
|
|
553
|
+
}
|
|
554
|
+
var qe = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
555
|
+
var Je = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
556
|
+
var P = `$1\0$2`;
|
|
557
|
+
var Ye = /[^\p{L}\d]+/giu;
|
|
558
|
+
function Xe(e2) {
|
|
559
559
|
let t2 = e2.trim();
|
|
560
|
-
t2 = t2.replace(
|
|
560
|
+
t2 = t2.replace(qe, P).replace(Je, P), t2 = t2.replace(Ye, `\0`);
|
|
561
561
|
let n2 = 0, r2 = t2.length;
|
|
562
562
|
for (; t2.charAt(n2) === `\0`; ) n2++;
|
|
563
563
|
if (n2 === r2) return [];
|
|
564
564
|
for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
|
|
565
565
|
return t2.slice(n2, r2).split(/\0/g);
|
|
566
566
|
}
|
|
567
|
-
var
|
|
568
|
-
var
|
|
569
|
-
var
|
|
570
|
-
function
|
|
567
|
+
var Ze = (e2) => `validationError` in (e2.response?.data?.details ?? {});
|
|
568
|
+
var Qe = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
|
|
569
|
+
var $e = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
|
|
570
|
+
function et(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
|
|
571
571
|
if (typeof e2 != `object` || !e2) throw e2;
|
|
572
|
-
if (
|
|
573
|
-
if (
|
|
574
|
-
if (
|
|
575
|
-
let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code:
|
|
576
|
-
return
|
|
572
|
+
if (Ze(e2)) return tt(e2, t2, n2);
|
|
573
|
+
if (Qe(e2)) return nt(e2);
|
|
574
|
+
if ($e(e2)) {
|
|
575
|
+
let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: N(n3), data: {} }, requestId: e2.requestId };
|
|
576
|
+
return F(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
|
|
577
577
|
}
|
|
578
|
-
return
|
|
578
|
+
return rt(e2);
|
|
579
579
|
}
|
|
580
|
-
var
|
|
581
|
-
let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 =
|
|
582
|
-
return
|
|
580
|
+
var tt = (e2, t2, n2) => {
|
|
581
|
+
let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = it(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 };
|
|
582
|
+
return F(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e2.response?.status, requestId: i2 } });
|
|
583
583
|
};
|
|
584
|
-
var
|
|
585
|
-
var
|
|
586
|
-
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 ??
|
|
587
|
-
return
|
|
584
|
+
var F = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
|
|
585
|
+
var nt = (e2) => {
|
|
586
|
+
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 ?? N(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 };
|
|
587
|
+
return F(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e2.requestId } });
|
|
588
588
|
};
|
|
589
|
-
var
|
|
590
|
-
var
|
|
589
|
+
var rt = (e2) => F(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: N(e2.response?.statusText ?? `UNKNOWN`), ...!e2.response && { runtimeError: e2 } } });
|
|
590
|
+
var it = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
|
|
591
591
|
let a2 = { ...e2, ...t2 }, o2 = Object.keys(a2);
|
|
592
592
|
return r2?.filter((e3) => !r2.some((t3) => t3.field.length > e3.field.length && t3.field.startsWith(e3.field) && o2.includes(t3.field))).map((e3) => {
|
|
593
593
|
let r3 = t2[e3.field];
|
|
594
|
-
if (r3) return { ...e3, field:
|
|
594
|
+
if (r3) return { ...e3, field: at(r3, i2) };
|
|
595
595
|
let s2 = o2?.sort((e4, t3) => t3.length - e4.length)?.find((t3) => e3.field.startsWith(t3));
|
|
596
596
|
if (s2) {
|
|
597
597
|
let t3 = a2[s2];
|
|
598
|
-
if (t3) return { ...e3, field: e3.field.replace(s2,
|
|
598
|
+
if (t3) return { ...e3, field: e3.field.replace(s2, at(t3, i2)) };
|
|
599
599
|
}
|
|
600
600
|
return n2 ? { ...e3, field: `${i2[0]}.${e3.field}` } : e3;
|
|
601
601
|
});
|
|
602
602
|
};
|
|
603
|
-
var
|
|
604
|
-
let n2 =
|
|
603
|
+
var at = (e2, t2) => {
|
|
604
|
+
let n2 = ot(e2);
|
|
605
605
|
return n2 == null ? e2 : e2.replace(`$[${n2}]`, t2[n2]);
|
|
606
606
|
};
|
|
607
|
-
var
|
|
607
|
+
var ot = (e2) => {
|
|
608
608
|
let t2 = e2.match(/\$\[(?<argIndex>\d+)\]/);
|
|
609
609
|
return t2 && t2.groups && Number(t2.groups.argIndex);
|
|
610
610
|
};
|
|
611
|
-
function
|
|
611
|
+
function st() {
|
|
612
612
|
let e2 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
613
613
|
if (e2) return { initWixModules(t3, n3) {
|
|
614
|
-
return
|
|
614
|
+
return I(() => e2(t3, n3));
|
|
615
615
|
}, fetchWithAuth() {
|
|
616
616
|
throw Error(`fetchWithAuth is not available in this context`);
|
|
617
617
|
}, graphql() {
|
|
@@ -621,10 +621,10 @@ function ot() {
|
|
|
621
621
|
if (t2 || n2) return { initWixModules(e3, r2) {
|
|
622
622
|
if (r2) {
|
|
623
623
|
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`);
|
|
624
|
-
return
|
|
624
|
+
return I(() => n2.use(e3));
|
|
625
625
|
}
|
|
626
626
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
627
|
-
return
|
|
627
|
+
return I(() => t2.use(e3));
|
|
628
628
|
}, fetchWithAuth: (e3, n3) => {
|
|
629
629
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
630
630
|
return t2.fetchWithAuth(e3, n3);
|
|
@@ -636,7 +636,7 @@ function ot() {
|
|
|
636
636
|
return t2.graphql(e3, n3, r2);
|
|
637
637
|
} };
|
|
638
638
|
}
|
|
639
|
-
function
|
|
639
|
+
function I(e2) {
|
|
640
640
|
let t2 = globalThis.__wix_context__, n2 = { client: p.client, elevatedClient: p.elevatedClient }, r2;
|
|
641
641
|
globalThis.__wix_context__ = void 0, p.client = void 0, p.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
642
642
|
try {
|
|
@@ -645,78 +645,78 @@ function L(e2) {
|
|
|
645
645
|
globalThis.__wix_context__ = t2, p.client = n2.client, p.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
646
646
|
}
|
|
647
647
|
}
|
|
648
|
-
function
|
|
648
|
+
function ct(e2, t2) {
|
|
649
649
|
return (...n2) => {
|
|
650
|
-
let r2 =
|
|
650
|
+
let r2 = st();
|
|
651
651
|
return r2 ? r2.initWixModules(e2, t2).apply(void 0, n2) : e2.apply(void 0, n2);
|
|
652
652
|
};
|
|
653
653
|
}
|
|
654
|
-
function
|
|
655
|
-
return
|
|
656
|
-
}
|
|
657
|
-
function
|
|
658
|
-
let t2 =
|
|
659
|
-
return
|
|
660
|
-
}
|
|
661
|
-
var
|
|
662
|
-
var
|
|
663
|
-
var
|
|
664
|
-
var
|
|
665
|
-
var
|
|
666
|
-
var
|
|
667
|
-
var
|
|
668
|
-
var
|
|
669
|
-
var
|
|
670
|
-
var
|
|
671
|
-
function bt(e2) {
|
|
672
|
-
return xt(e2).replace(pt, `._base_domain_`).replace(vt, `._api_base_domain_`).replace(yt, `*.dev.wix-code.com`);
|
|
673
|
-
}
|
|
654
|
+
function lt(e2, t2 = false) {
|
|
655
|
+
return ct(e2, t2);
|
|
656
|
+
}
|
|
657
|
+
function ut(e2) {
|
|
658
|
+
let t2 = Ct(xt(e2.host), e2.domainToMappings);
|
|
659
|
+
return Mt(kt(e2.protoPath, e2.data || {}), t2);
|
|
660
|
+
}
|
|
661
|
+
var dt = [`wix.com`, `editorx.com`];
|
|
662
|
+
var ft = `_`;
|
|
663
|
+
var pt = `*.`;
|
|
664
|
+
var mt = RegExp(`\\.(${dt.join(`|`)})$`);
|
|
665
|
+
var ht = [`42.wixprod.net`, `uw2-edt-1.wixprod.net`, `virginia-edt.wixprod.net`];
|
|
666
|
+
var gt = { "payments.base44.com": `manage.wix.com`, "create.editorx.com": `editor.editorx.com` };
|
|
667
|
+
var _t = `dev.wix-code.com`;
|
|
668
|
+
var vt = /{(.*)}/;
|
|
669
|
+
var yt = RegExp(`\\.(${ht.join(`|`)})$`);
|
|
670
|
+
var bt = RegExp(`.*\\.${_t}$`);
|
|
674
671
|
function xt(e2) {
|
|
675
|
-
return
|
|
672
|
+
return St(e2).replace(mt, `._base_domain_`).replace(yt, `._api_base_domain_`).replace(bt, `*.dev.wix-code.com`);
|
|
676
673
|
}
|
|
677
|
-
function St(e2
|
|
674
|
+
function St(e2) {
|
|
675
|
+
return gt[e2] ?? e2;
|
|
676
|
+
}
|
|
677
|
+
function Ct(e2, t2) {
|
|
678
678
|
let n2 = t2[e2];
|
|
679
679
|
if (n2) return n2;
|
|
680
|
-
let r2 =
|
|
680
|
+
let r2 = wt(e2, t2) ?? Tt(e2, t2);
|
|
681
681
|
if (!r2) {
|
|
682
|
-
if (
|
|
683
|
-
let e3 = t2[
|
|
682
|
+
if (Dt(e2)) {
|
|
683
|
+
let e3 = t2[Ot];
|
|
684
684
|
if (e3) return e3;
|
|
685
685
|
}
|
|
686
|
-
let n3 = t2[
|
|
686
|
+
let n3 = t2[ft];
|
|
687
687
|
if (n3) return n3;
|
|
688
688
|
}
|
|
689
689
|
return r2 ?? [];
|
|
690
690
|
}
|
|
691
|
-
function
|
|
691
|
+
function wt(e2, t2) {
|
|
692
692
|
return Object.entries(t2).find(([t3]) => {
|
|
693
693
|
let [, ...n2] = e2.split(`.`);
|
|
694
694
|
return n2.join(`.`) === t3;
|
|
695
695
|
})?.[1];
|
|
696
696
|
}
|
|
697
|
-
function
|
|
698
|
-
let [n2] = Object.entries(t2).filter(([t3]) =>
|
|
697
|
+
function Tt(e2, t2) {
|
|
698
|
+
let [n2] = Object.entries(t2).filter(([t3]) => Et(e2, t3)).sort(([e3], [t3]) => t3.length - e3.length);
|
|
699
699
|
if (!n2) return;
|
|
700
700
|
let [, r2] = n2;
|
|
701
701
|
return r2;
|
|
702
702
|
}
|
|
703
|
-
function
|
|
704
|
-
if (!t2.startsWith(
|
|
703
|
+
function Et(e2, t2) {
|
|
704
|
+
if (!t2.startsWith(pt)) return false;
|
|
705
705
|
let n2 = t2.slice(1);
|
|
706
706
|
return e2.length > n2.length && e2.endsWith(n2);
|
|
707
707
|
}
|
|
708
|
-
function
|
|
708
|
+
function Dt(e2) {
|
|
709
709
|
return !!e2.match(/\._base_domain_$/);
|
|
710
710
|
}
|
|
711
|
-
var
|
|
712
|
-
function Ot(e2, t2) {
|
|
713
|
-
return e2.split(`/`).map((e3) => kt(e3, t2)).join(`/`);
|
|
714
|
-
}
|
|
711
|
+
var Ot = `www._base_domain_`;
|
|
715
712
|
function kt(e2, t2) {
|
|
716
|
-
|
|
717
|
-
|
|
713
|
+
return e2.split(`/`).map((e3) => At(e3, t2)).join(`/`);
|
|
714
|
+
}
|
|
715
|
+
function At(e2, t2) {
|
|
716
|
+
let n2 = e2.match(vt) || [], r2 = n2[1];
|
|
717
|
+
return r2 ? jt(t2, r2, e2, e2.replace(n2[0], ``)) : e2;
|
|
718
718
|
}
|
|
719
|
-
function
|
|
719
|
+
function jt(e2, t2, n2, r2) {
|
|
720
720
|
let i2 = e2;
|
|
721
721
|
for (let e3 of t2.split(`.`)) {
|
|
722
722
|
if (!i2) return n2;
|
|
@@ -724,33 +724,33 @@ function At(e2, t2, n2, r2) {
|
|
|
724
724
|
}
|
|
725
725
|
return `${i2}${r2}`;
|
|
726
726
|
}
|
|
727
|
-
function
|
|
727
|
+
function Mt(e2, t2) {
|
|
728
728
|
let n2 = t2?.find((t3) => e2.startsWith(t3.destPath));
|
|
729
729
|
return n2 ? n2.srcPath + e2.slice(n2.destPath.length) : e2;
|
|
730
730
|
}
|
|
731
|
-
var
|
|
732
|
-
var
|
|
733
|
-
var
|
|
734
|
-
var
|
|
735
|
-
let e2 =
|
|
736
|
-
if (e2) return { [
|
|
731
|
+
var Nt = `x-wix-linguist`;
|
|
732
|
+
var Pt = `00000000-0000-0000-0000-000000000000`;
|
|
733
|
+
var Ft = `false`;
|
|
734
|
+
var It = () => {
|
|
735
|
+
let e2 = L(`language`), t2 = L(`locale`);
|
|
736
|
+
if (e2) return { [Nt]: [e2, t2 || e2, Ft, Pt].join(`|`) };
|
|
737
737
|
};
|
|
738
|
-
function
|
|
738
|
+
function Lt() {
|
|
739
739
|
let e2 = null, t2 = null;
|
|
740
740
|
return { promise: new Promise((n2, r2) => {
|
|
741
741
|
e2 = n2, t2 = r2;
|
|
742
742
|
}), resolve: e2, reject: t2 };
|
|
743
743
|
}
|
|
744
|
-
var
|
|
745
|
-
var
|
|
746
|
-
let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e2(t2), o2 =
|
|
747
|
-
return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language:
|
|
748
|
-
return
|
|
744
|
+
var L = (e2) => typeof window < `u` ? window.commonConfig?.[e2] : void 0;
|
|
745
|
+
var Rt = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host: (t2) => {
|
|
746
|
+
let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e2(t2), o2 = Bt();
|
|
747
|
+
return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language: L(`language`), locale: L(`locale`), get passThroughHeaders() {
|
|
748
|
+
return It();
|
|
749
749
|
} } };
|
|
750
750
|
}, auth: (e3) => {
|
|
751
751
|
let t2 = typeof window < `u` ? window.wixEmbedsAPI : void 0;
|
|
752
|
-
!e3 &&
|
|
753
|
-
let n2 = false, { resolve: r2, promise: i2 } =
|
|
752
|
+
!e3 && zt() && (e3 = t2?.getAccessTokenFunction?.());
|
|
753
|
+
let n2 = false, { resolve: r2, promise: i2 } = Lt();
|
|
754
754
|
return { getAuthHeaders: async () => {
|
|
755
755
|
if (!e3 && n2 && (e3 = await i2), !e3) throw Error(`Failed to resolve auth token`);
|
|
756
756
|
return { headers: { Authorization: await e3() } };
|
|
@@ -758,36 +758,36 @@ var Lt = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host:
|
|
|
758
758
|
r2(e4);
|
|
759
759
|
}) };
|
|
760
760
|
} });
|
|
761
|
-
function
|
|
761
|
+
function zt() {
|
|
762
762
|
return typeof document < `u` && document.currentScript?.tagName === `SCRIPT`;
|
|
763
763
|
}
|
|
764
|
-
function
|
|
764
|
+
function Bt() {
|
|
765
765
|
let e2 = (typeof window < `u` ? window.wixEmbedsAPI : void 0)?.getExternalBaseUrl?.();
|
|
766
766
|
if (!e2) return;
|
|
767
767
|
let t2 = new URL(e2);
|
|
768
768
|
return t2?.pathname && t2.pathname !== `/` ? `${t2.hostname}${t2.pathname}` : t2.hostname;
|
|
769
769
|
}
|
|
770
|
-
var
|
|
770
|
+
var Vt = ({ clientSdk: e2, applicationId: t2 }) => ({ invoke: async ({ namespace: n2, method: r2, args: i2 }) => {
|
|
771
771
|
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`);
|
|
772
772
|
return e2.invoke({ namespace: n2, method: r2, args: i2, applicationId: t2, accessToken: `accessToken` });
|
|
773
773
|
}, getAccessToken: () => {
|
|
774
774
|
throw Error(`Not implemented`);
|
|
775
775
|
}, observeState: () => ({ disconnect: () => {
|
|
776
776
|
} }) });
|
|
777
|
-
var
|
|
777
|
+
var R = Rt({ createHost: function(e2) {
|
|
778
778
|
let t2 = (typeof $wixContext < `u` ? $wixContext.clientSdk : void 0) ?? e2?.clientSdk ?? (typeof window < `u` ? window?.clientSdk : void 0), { applicationId: n2 } = e2 || {};
|
|
779
779
|
if (!n2) throw Error(`"createHost" was called without a required field "applicationId"`);
|
|
780
|
-
return { channel:
|
|
780
|
+
return { channel: Vt({ clientSdk: t2, applicationId: n2 }), close: () => {
|
|
781
781
|
} };
|
|
782
782
|
} });
|
|
783
|
-
var
|
|
784
|
-
let n2 =
|
|
785
|
-
return
|
|
783
|
+
var Ht = ((e2, t2) => {
|
|
784
|
+
let n2 = R.host({ applicationId: e2, componentId: t2 }), r2 = R.auth();
|
|
785
|
+
return ze({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
|
|
786
786
|
})(`13d21c63-b5ec-5912-8397-c3a5ddb27a97`);
|
|
787
|
-
function
|
|
787
|
+
function Ut() {
|
|
788
788
|
let e2 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
789
789
|
if (e2) return { initWixModules(t3, n3) {
|
|
790
|
-
return
|
|
790
|
+
return z(() => e2(t3, n3));
|
|
791
791
|
}, fetchWithAuth() {
|
|
792
792
|
throw Error(`fetchWithAuth is not available in this context`);
|
|
793
793
|
}, graphql() {
|
|
@@ -797,10 +797,10 @@ function Ht() {
|
|
|
797
797
|
if (t2 || n2) return { initWixModules(e3, r2) {
|
|
798
798
|
if (r2) {
|
|
799
799
|
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`);
|
|
800
|
-
return
|
|
800
|
+
return z(() => n2.use(e3));
|
|
801
801
|
}
|
|
802
802
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
803
|
-
return
|
|
803
|
+
return z(() => t2.use(e3));
|
|
804
804
|
}, fetchWithAuth: (e3, n3) => {
|
|
805
805
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
806
806
|
return t2.fetchWithAuth(e3, n3);
|
|
@@ -812,7 +812,7 @@ function Ht() {
|
|
|
812
812
|
return t2.graphql(e3, n3, r2);
|
|
813
813
|
} };
|
|
814
814
|
}
|
|
815
|
-
function
|
|
815
|
+
function z(e2) {
|
|
816
816
|
let t2 = globalThis.__wix_context__, n2 = { client: p.client, elevatedClient: p.elevatedClient }, r2;
|
|
817
817
|
globalThis.__wix_context__ = void 0, p.client = void 0, p.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
818
818
|
try {
|
|
@@ -821,17 +821,17 @@ function B(e2) {
|
|
|
821
821
|
globalThis.__wix_context__ = t2, p.client = n2.client, p.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
822
822
|
}
|
|
823
823
|
}
|
|
824
|
-
function
|
|
824
|
+
function Wt(e2, t2) {
|
|
825
825
|
return { ...e2, ...Object.fromEntries(t2.map((t3) => [t3, (...n2) => {
|
|
826
|
-
let r2 =
|
|
826
|
+
let r2 = Ut();
|
|
827
827
|
if (!r2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
828
828
|
return r2.initWixModules(e2)[t3].apply(void 0, n2);
|
|
829
829
|
}])) };
|
|
830
830
|
}
|
|
831
|
-
function
|
|
832
|
-
return
|
|
831
|
+
function Gt(e2) {
|
|
832
|
+
return Wt({ __type: `host`, create: (t2) => Object.entries(e2).reduce((e3, [n2, r2]) => ({ ...e3, [n2]: r2(t2) }), {}) }, Object.keys(e2));
|
|
833
833
|
}
|
|
834
|
-
var
|
|
834
|
+
var Kt = class {
|
|
835
835
|
constructor(e2) {
|
|
836
836
|
this.message = e2, this.captureException = () => {
|
|
837
837
|
console.error(this.message);
|
|
@@ -846,42 +846,42 @@ var Gt = class {
|
|
|
846
846
|
};
|
|
847
847
|
}
|
|
848
848
|
};
|
|
849
|
-
var
|
|
850
|
-
var
|
|
851
|
-
var
|
|
852
|
-
function
|
|
849
|
+
var qt = (e2) => new Kt(e2);
|
|
850
|
+
var Jt = Gt({ getMonitoringClient: (e2) => () => e2.getMonitoringClient ? e2.getMonitoringClient() : qt(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`) });
|
|
851
|
+
var B = { service: `service`, services: `services`, categories: `categories`, locations: `locations`, sessions: `sessions`, timeSlots: `time-slots`, serviceAddOns: `service-addons`, bookingsSettings: `bookings-settings`, serviceCta: `service-cta`, preferences: `preferences`, bookingSummary: `booking-summary`, bookingCheckout: `booking-checkout`, formValues: `form-values`, paymentOptions: `payment-options`, seo: `seo`, warmup: `warmup`, reschedule: `reschedule` };
|
|
852
|
+
function V(e2) {
|
|
853
853
|
try {
|
|
854
|
-
let t2 =
|
|
854
|
+
let t2 = Jt.getMonitoringClient?.();
|
|
855
855
|
return t2 && typeof t2[e2] == `function` ? t2 : null;
|
|
856
856
|
} catch {
|
|
857
857
|
return null;
|
|
858
858
|
}
|
|
859
859
|
}
|
|
860
|
-
function
|
|
861
|
-
let a2 =
|
|
860
|
+
function H(e2, { feature: t2, action: n2, level: r2 = `error`, contexts: i2 }) {
|
|
861
|
+
let a2 = V(`captureException`);
|
|
862
862
|
if (!a2) return;
|
|
863
863
|
let o2 = e2 instanceof Error ? e2 : Error(String(e2));
|
|
864
864
|
a2.captureException(o2, { level: r2, tags: { feature: t2, action: n2 }, ...i2 ? { contexts: i2 } : {} });
|
|
865
865
|
}
|
|
866
|
-
function
|
|
867
|
-
let i2 =
|
|
866
|
+
function Yt(e2, { feature: t2, tags: n2 }, r2) {
|
|
867
|
+
let i2 = V(`startSpanManual`);
|
|
868
868
|
if (!i2) return r2;
|
|
869
869
|
let a2 = i2.startSpanManual({ name: e2, tags: { feature: t2, ...n2 } });
|
|
870
870
|
return r2.then(() => a2.end(), (e3) => a2.fail(e3)), r2;
|
|
871
871
|
}
|
|
872
|
-
var
|
|
872
|
+
var Xt = class extends import_react.Component {
|
|
873
873
|
state = { hasError: false };
|
|
874
874
|
static getDerivedStateFromError() {
|
|
875
875
|
return { hasError: true };
|
|
876
876
|
}
|
|
877
877
|
componentDidCatch(e2, t2) {
|
|
878
|
-
|
|
878
|
+
H(e2, { feature: this.props.feature ?? `service`, action: `render`, contexts: { react: { componentStack: t2.componentStack } } });
|
|
879
879
|
}
|
|
880
880
|
render() {
|
|
881
881
|
return this.state.hasError ? this.props.fallback : this.props.children;
|
|
882
882
|
}
|
|
883
883
|
};
|
|
884
|
-
function
|
|
884
|
+
function Zt(e2) {
|
|
885
885
|
let t2 = e2;
|
|
886
886
|
if (t2.__state || (t2.__state = { status: `pending` }, t2.then((e3) => {
|
|
887
887
|
t2.__state = { status: `fulfilled`, value: e3 };
|
|
@@ -890,27 +890,27 @@ function Xt(e2) {
|
|
|
890
890
|
})), t2.__state.status === `fulfilled`) return t2.__state.value;
|
|
891
891
|
throw t2.__state.status === `rejected` ? t2.__state.reason : t2;
|
|
892
892
|
}
|
|
893
|
-
function
|
|
893
|
+
function U(e2) {
|
|
894
894
|
let t2 = Promise.resolve(e2);
|
|
895
895
|
return t2.__state = { status: `fulfilled`, value: e2 }, t2;
|
|
896
896
|
}
|
|
897
|
-
var
|
|
898
|
-
function
|
|
899
|
-
let r2 =
|
|
900
|
-
r2 || (r2 = /* @__PURE__ */ new WeakMap(),
|
|
897
|
+
var W = /* @__PURE__ */ new WeakMap();
|
|
898
|
+
function Qt(e2, t2, n2) {
|
|
899
|
+
let r2 = W.get(e2);
|
|
900
|
+
r2 || (r2 = /* @__PURE__ */ new WeakMap(), W.set(e2, r2));
|
|
901
901
|
let i2 = r2.get(t2);
|
|
902
902
|
i2 || (i2 = /* @__PURE__ */ new WeakMap(), r2.set(t2, i2));
|
|
903
903
|
let a2 = i2.get(n2);
|
|
904
904
|
if (!a2) {
|
|
905
905
|
let r3 = e2;
|
|
906
|
-
a2 = r3.__state?.status === `fulfilled` ?
|
|
906
|
+
a2 = r3.__state?.status === `fulfilled` ? U(t2(r3.__state.value)) : r3.__state?.status === `rejected` ? U(n2(r3.__state.reason)) : e2.then(t2, n2), i2.set(n2, a2);
|
|
907
907
|
}
|
|
908
908
|
return a2;
|
|
909
909
|
}
|
|
910
|
-
function
|
|
910
|
+
function G(e2) {
|
|
911
911
|
return e2;
|
|
912
912
|
}
|
|
913
|
-
var $t =
|
|
913
|
+
var $t = G(`@wix/site-service-url`);
|
|
914
914
|
var K = `appSectionParams`;
|
|
915
915
|
function q(e2) {
|
|
916
916
|
let t2 = e2.searchParams.get(K);
|
|
@@ -973,32 +973,29 @@ function X() {
|
|
|
973
973
|
return { pathname: i2.pathname, search: i2.search, searchParams: i2.searchParams, href: i2.href, getParsedUrl: () => q(new URL(e2.currentUrl)), getRelativeUrl: () => an(e2.currentUrl, a2), getExternalBaseUrl: () => a2, pushUrl: tn };
|
|
974
974
|
}
|
|
975
975
|
var Z = { category: `category`, location: `location`, page: `page`, blob: `b`, resource: `resource`, referral: `referral`, timezone: `timezone`, bookingId: `bookingId`, token: `token`, rescheduleRedirectUrl: `rescheduleRedirectUrl` };
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
}
|
|
979
|
-
var sn = on(`@wix/site-service-warmup-data`);
|
|
980
|
-
function cn() {
|
|
976
|
+
var on = G(`@wix/site-service-warmup-data`);
|
|
977
|
+
function sn() {
|
|
981
978
|
try {
|
|
982
979
|
return (0, import_services_manager_react.useGetService)();
|
|
983
980
|
} catch {
|
|
984
981
|
return null;
|
|
985
982
|
}
|
|
986
983
|
}
|
|
987
|
-
function
|
|
984
|
+
function cn(e2) {
|
|
988
985
|
try {
|
|
989
|
-
return e2 ? e2(
|
|
986
|
+
return e2 ? e2(on) : null;
|
|
990
987
|
} catch {
|
|
991
988
|
return null;
|
|
992
989
|
}
|
|
993
990
|
}
|
|
994
|
-
function
|
|
995
|
-
let e2 =
|
|
991
|
+
function ln() {
|
|
992
|
+
let e2 = cn(sn()), t2 = typeof window > `u`;
|
|
996
993
|
return { scope: e2 ?? void 0, get: async (n2) => {
|
|
997
994
|
if (t2 || !e2) return null;
|
|
998
995
|
try {
|
|
999
996
|
return await e2.get(n2);
|
|
1000
997
|
} catch (e3) {
|
|
1001
|
-
return
|
|
998
|
+
return H(e3, { feature: B.warmup, action: `read`, level: `warning`, contexts: { warmup: { key: n2 } } }), null;
|
|
1002
999
|
}
|
|
1003
1000
|
}, set: (n2, r2) => {
|
|
1004
1001
|
if (t2 && e2) try {
|
|
@@ -1007,54 +1004,54 @@ function un() {
|
|
|
1007
1004
|
}
|
|
1008
1005
|
} };
|
|
1009
1006
|
}
|
|
1010
|
-
var
|
|
1011
|
-
function
|
|
1012
|
-
return `${
|
|
1007
|
+
var un = `bookings-uou`;
|
|
1008
|
+
function dn() {
|
|
1009
|
+
return `${un}:categories:all`;
|
|
1013
1010
|
}
|
|
1014
|
-
var
|
|
1015
|
-
var
|
|
1016
|
-
var
|
|
1011
|
+
var fn = 5e3;
|
|
1012
|
+
var pn = 100;
|
|
1013
|
+
var mn = `wix-warmup-data`;
|
|
1017
1014
|
var Q = null;
|
|
1018
|
-
function
|
|
1015
|
+
function hn(e2) {
|
|
1019
1016
|
if (typeof document < `u`) try {
|
|
1020
|
-
let t2 = document.getElementById(
|
|
1017
|
+
let t2 = document.getElementById(mn)?.textContent;
|
|
1021
1018
|
return t2 ? (Q?.text !== t2 && (Q = { text: t2, data: JSON.parse(t2).builderComponentsWarmupData ?? {} }), Q.data[e2] ?? void 0) : void 0;
|
|
1022
1019
|
} catch {
|
|
1023
1020
|
return;
|
|
1024
1021
|
}
|
|
1025
1022
|
}
|
|
1026
|
-
var
|
|
1027
|
-
var
|
|
1023
|
+
var gn = () => ({ promises: /* @__PURE__ */ new Map(), invalidatedWarmup: /* @__PURE__ */ new Set() });
|
|
1024
|
+
var _n = gn();
|
|
1025
|
+
var vn = /* @__PURE__ */ new WeakMap();
|
|
1028
1026
|
var yn = /* @__PURE__ */ new WeakMap();
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
return t2 || (t2 = _n(), yn.set(e2, t2)), t2;
|
|
1027
|
+
function bn(e2) {
|
|
1028
|
+
if (!e2) return _n;
|
|
1029
|
+
let t2 = vn.get(e2);
|
|
1030
|
+
return t2 || (t2 = gn(), vn.set(e2, t2)), t2;
|
|
1034
1031
|
}
|
|
1035
|
-
function
|
|
1032
|
+
function xn({ key: e2, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
|
|
1036
1033
|
if (e2 === null) return n2();
|
|
1037
1034
|
if (typeof window > `u`) {
|
|
1038
1035
|
let r3 = () => n2().then((n3) => (t2.set(e2, n3), n3)), { scope: i3 } = t2;
|
|
1039
1036
|
if (!i3) return r3();
|
|
1040
|
-
let a3 =
|
|
1041
|
-
a3 || (a3 = /* @__PURE__ */ new Map(),
|
|
1037
|
+
let a3 = yn.get(i3);
|
|
1038
|
+
a3 || (a3 = /* @__PURE__ */ new Map(), yn.set(i3, a3));
|
|
1042
1039
|
let o3 = a3.get(e2);
|
|
1043
1040
|
if (o3) return o3;
|
|
1044
1041
|
let s3 = r3();
|
|
1045
1042
|
return a3.set(e2, s3), s3.catch(() => a3.delete(e2)), s3;
|
|
1046
1043
|
}
|
|
1047
|
-
let i2 =
|
|
1044
|
+
let i2 = bn(t2.scope), a2 = Date.now();
|
|
1048
1045
|
for (let [e3, t3] of i2.promises) t3.expiresAt <= a2 && i2.promises.delete(e3);
|
|
1049
1046
|
let o2 = i2.promises.get(e2);
|
|
1050
1047
|
if (o2 && !r2) return o2.promise;
|
|
1051
1048
|
r2 && i2.invalidatedWarmup.add(e2);
|
|
1052
1049
|
let s2 = !i2.invalidatedWarmup.has(e2);
|
|
1053
1050
|
if (s2) {
|
|
1054
|
-
let t3 =
|
|
1051
|
+
let t3 = hn(e2);
|
|
1055
1052
|
if (t3 !== void 0) {
|
|
1056
|
-
let n3 =
|
|
1057
|
-
return i2.promises.set(e2, { promise: n3, expiresAt: a2 +
|
|
1053
|
+
let n3 = U(t3);
|
|
1054
|
+
return i2.promises.set(e2, { promise: n3, expiresAt: a2 + fn }), n3;
|
|
1058
1055
|
}
|
|
1059
1056
|
}
|
|
1060
1057
|
let c2 = (async () => {
|
|
@@ -1064,100 +1061,97 @@ function Sn({ key: e2, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
|
|
|
1064
1061
|
}
|
|
1065
1062
|
return n2();
|
|
1066
1063
|
})();
|
|
1067
|
-
i2.promises.size >=
|
|
1064
|
+
i2.promises.size >= pn && i2.promises.delete(i2.promises.keys().next().value);
|
|
1068
1065
|
let l2 = { promise: c2, expiresAt: 1 / 0 };
|
|
1069
1066
|
return i2.promises.set(e2, l2), c2.then(() => {
|
|
1070
|
-
l2.expiresAt = Date.now() +
|
|
1067
|
+
l2.expiresAt = Date.now() + fn;
|
|
1071
1068
|
}, () => {
|
|
1072
1069
|
i2.promises.get(e2) === l2 && i2.promises.delete(e2);
|
|
1073
1070
|
}), c2;
|
|
1074
1071
|
}
|
|
1075
|
-
function
|
|
1076
|
-
return
|
|
1072
|
+
function Sn(e2) {
|
|
1073
|
+
return ut(Object.assign(e2, { domainToMappings: { "*.dev.wix-code.com": [{ srcPath: `/_api/services-2`, destPath: `` }, { srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "www.wixapis.com": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }, { srcPath: `/bookings/services/v2/bulk/services`, destPath: `/v2/bulk/services` }], "manage._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], "editor._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], "blocks._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], "create.editorx": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], _: [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "www._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "bo._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "wixbo.ai": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "wix-bo.com": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "editor.wixapps.net": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "api._api_base_domain_": [{ srcPath: `/services-2`, destPath: `` }] } }));
|
|
1077
1074
|
}
|
|
1078
|
-
var
|
|
1079
|
-
function
|
|
1075
|
+
var Cn = `@wix/auto_sdk_bookings_services`;
|
|
1076
|
+
function wn(e2) {
|
|
1080
1077
|
function t2({ host: t3 }) {
|
|
1081
|
-
return { entityFqdn: `wix.bookings.services.v2.service`, method: `POST`, methodFqn: `wix.bookings.services.v2.ServicesService.QueryCategories`, packageName:
|
|
1078
|
+
return { entityFqdn: `wix.bookings.services.v2.service`, method: `POST`, methodFqn: `wix.bookings.services.v2.ServicesService.QueryCategories`, packageName: Cn, migrationOptions: { optInTransformResponse: true }, url: Sn({ protoPath: `/v2/services/categories/query`, data: e2, host: t3 }), data: e2 };
|
|
1082
1079
|
}
|
|
1083
1080
|
return t2;
|
|
1084
1081
|
}
|
|
1085
|
-
async function
|
|
1086
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 =
|
|
1082
|
+
async function Tn(e2) {
|
|
1083
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = wn(Ge({ filter: e2?.filter }));
|
|
1087
1084
|
n2?.onSiteCall?.();
|
|
1088
1085
|
try {
|
|
1089
1086
|
let e3 = await t2.request(r2);
|
|
1090
|
-
return n2?.onSuccess?.(e3),
|
|
1087
|
+
return n2?.onSuccess?.(e3), Ke(e3.data);
|
|
1091
1088
|
} catch (e3) {
|
|
1092
|
-
let t3 =
|
|
1089
|
+
let t3 = et(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { filter: `$[0].filter` }, singleArgumentUnchanged: false }, [`options`]);
|
|
1093
1090
|
throw n2?.onError?.(e3), t3;
|
|
1094
1091
|
}
|
|
1095
1092
|
}
|
|
1096
|
-
function
|
|
1097
|
-
return (t2) =>
|
|
1093
|
+
function En(e2) {
|
|
1094
|
+
return (t2) => Tn(t2, { httpClient: e2 });
|
|
1098
1095
|
}
|
|
1099
|
-
var
|
|
1100
|
-
async function
|
|
1101
|
-
return [...(await
|
|
1096
|
+
var Dn = lt(En);
|
|
1097
|
+
async function On() {
|
|
1098
|
+
return [...(await Dn({ filter: { services: {} } })).categories ?? []].sort((e2, t2) => (e2.sortOrder ?? 0) - (t2.sortOrder ?? 0));
|
|
1102
1099
|
}
|
|
1103
|
-
function
|
|
1100
|
+
function kn({ isLoading: e2, hasError: t2, refetch: n2, children: r2 }) {
|
|
1104
1101
|
let { searchParams: i2 } = X(), a2 = { categories: [], categoryItems: [], selectedCategoryId: i2.get(Z.category), selectedCategoryIndex: -1, selectedCategory: null, selectedCategoryName: null, hasMultipleCategories: false, isLoading: e2, hasError: t2, refetch: n2, selectCategory: () => {
|
|
1105
1102
|
} };
|
|
1106
1103
|
return (0, import_jsx_runtime.jsx)($.Provider, { value: a2, children: r2 });
|
|
1107
1104
|
}
|
|
1108
|
-
function
|
|
1109
|
-
return (0, import_jsx_runtime.jsx)(
|
|
1105
|
+
function An({ refetch: e2, children: t2 }) {
|
|
1106
|
+
return (0, import_jsx_runtime.jsx)(kn, { isLoading: true, hasError: false, refetch: e2, children: t2 });
|
|
1110
1107
|
}
|
|
1111
|
-
function
|
|
1112
|
-
return (0, import_jsx_runtime.jsx)(
|
|
1108
|
+
function jn({ refetch: e2, children: t2 }) {
|
|
1109
|
+
return (0, import_jsx_runtime.jsx)(kn, { isLoading: false, hasError: true, refetch: e2, children: t2 });
|
|
1113
1110
|
}
|
|
1114
|
-
function
|
|
1111
|
+
function Mn(e2) {
|
|
1115
1112
|
let t2 = e2?.$in ?? (e2?.$eq == null ? [] : [e2.$eq]);
|
|
1116
1113
|
return [...new Set(t2.filter((e3) => typeof e3 == `string` && e3 !== ``))].sort().join(`,`);
|
|
1117
1114
|
}
|
|
1118
|
-
function
|
|
1115
|
+
function Nn(e2) {
|
|
1119
1116
|
return e2 ? e2.split(`,`) : null;
|
|
1120
1117
|
}
|
|
1118
|
+
var Pn = G(`@wix/site-service-business-logger`);
|
|
1121
1119
|
function Fn(e2) {
|
|
1122
|
-
return e2;
|
|
1123
|
-
}
|
|
1124
|
-
var In = Fn(`@wix/viewer-service-business-logger`);
|
|
1125
|
-
function Ln(e2) {
|
|
1126
1120
|
return { evid: 32, src: 16, endpoint: ``, params: e2 };
|
|
1127
1121
|
}
|
|
1128
|
-
var
|
|
1122
|
+
var In = function(e2) {
|
|
1129
1123
|
return e2.BOOK_ONLINE = `bookingsBookOnline`, e2.SERVICE_PAGE = `bookingsServicePage`, e2.CALENDAR_PAGE = `bookingsCalendar`, e2.FORM_PAGE = `bookingsForm`, e2;
|
|
1130
1124
|
}({});
|
|
1131
|
-
var
|
|
1132
|
-
|
|
1133
|
-
var
|
|
1134
|
-
var
|
|
1135
|
-
let t2 = (0, import_services_manager_react.useService)(
|
|
1125
|
+
var Ln = { SERVICES: `services_context`, SERVICE: `service_context`, TIME_SLOTS: `time_slots_context`, BOOKING_CHECKOUT: `booking_checkout_context`, CATEGORIES: `categories_context`, LOCATIONS: `locations_context`, SERVICE_ADD_ONS: `service_addons_context`, PREFERENCES: `preferences_context` };
|
|
1126
|
+
In.BOOK_ONLINE;
|
|
1127
|
+
var Rn = `new_bookings_server`;
|
|
1128
|
+
var zn = (e2) => {
|
|
1129
|
+
let { reportBi: t2 } = (0, import_services_manager_react.useService)(Pn);
|
|
1136
1130
|
return (0, import_react.useCallback)((n2) => {
|
|
1137
|
-
t2
|
|
1131
|
+
t2({ widget_name: e2, bookingsPlatform: Rn, is_over_editor: false, ...n2.params, src: n2.src, evid: n2.evid }, { endpoint: n2.endpoint });
|
|
1138
1132
|
}, [t2, e2]);
|
|
1139
1133
|
};
|
|
1140
|
-
var
|
|
1141
|
-
let n2 =
|
|
1134
|
+
var Bn = (e2, t2 = true) => {
|
|
1135
|
+
let n2 = zn(e2), { getParsedUrl: r2 } = X(), i2 = (0, import_react.useRef)(false);
|
|
1142
1136
|
(0, import_react.useEffect)(() => {
|
|
1143
|
-
t2 && !i2.current && (i2.current = true, n2(
|
|
1137
|
+
t2 && !i2.current && (i2.current = true, n2(Fn({ referralInfo: r2().searchParams.get(Z.referral) ?? void 0 })));
|
|
1144
1138
|
}, [t2, n2, r2]);
|
|
1145
1139
|
};
|
|
1146
1140
|
var $ = (0, import_react.createContext)(null);
|
|
1147
|
-
var
|
|
1148
|
-
function
|
|
1141
|
+
var Vn = `useCategoriesContext must be used within CategoriesContextProvider`;
|
|
1142
|
+
function Hn() {
|
|
1149
1143
|
let e2 = (0, import_react.useContext)($);
|
|
1150
|
-
if (!e2) throw Error(
|
|
1144
|
+
if (!e2) throw Error(Vn);
|
|
1151
1145
|
return e2;
|
|
1152
1146
|
}
|
|
1153
|
-
function
|
|
1147
|
+
function Un(e2, t2) {
|
|
1154
1148
|
return { categoryId: e2._id ?? null, categoryName: e2.name ?? null, isSelected: e2._id != null && e2._id === t2 };
|
|
1155
1149
|
}
|
|
1156
|
-
var
|
|
1157
|
-
var
|
|
1158
|
-
function
|
|
1159
|
-
let { categories: l2, hasError: u2 } =
|
|
1160
|
-
let e3 =
|
|
1150
|
+
var Wn = (e2) => ({ categories: e2, hasError: false });
|
|
1151
|
+
var Gn = () => ({ categories: [], hasError: true });
|
|
1152
|
+
function Kn({ categoriesPromise: e2, initialCategoryId: t2, categoryIdsKey: n2, refetch: i2, children: c2 }) {
|
|
1153
|
+
let { categories: l2, hasError: u2 } = Zt(e2), d2 = (0, import_react.useMemo)(() => {
|
|
1154
|
+
let e3 = Nn(n2);
|
|
1161
1155
|
return e3 ? l2.filter((t3) => t3._id && e3.includes(t3._id)) : l2;
|
|
1162
1156
|
}, [l2, n2]), { pathname: p2, searchParams: m2, pushUrl: h2, getExternalBaseUrl: g2 } = X(), _2 = m2.get(Z.category), v2 = (0, import_react.useCallback)((e3) => {
|
|
1163
1157
|
let t3 = new URLSearchParams(m2);
|
|
@@ -1168,15 +1162,15 @@ function Jn({ categoriesPromise: e2, initialCategoryId: t2, categoryIdsKey: n2,
|
|
|
1168
1162
|
(0, import_react.useEffect)(() => {
|
|
1169
1163
|
y2.current || (y2.current = true, t2 && !m2.get(Z.category) && v2(t2));
|
|
1170
1164
|
}, [t2, m2, v2]);
|
|
1171
|
-
let b2 = d2.findIndex((e3) => e3._id === _2), x2 = d2.find((e3) => e3._id === _2) ?? null, S2 = d2.filter((e3) => e3._id).length > 1, C2 = (0, import_react.useMemo)(() => ({ categories: d2, categoryItems: d2.map((e3) =>
|
|
1165
|
+
let b2 = d2.findIndex((e3) => e3._id === _2), x2 = d2.find((e3) => e3._id === _2) ?? null, S2 = d2.filter((e3) => e3._id).length > 1, C2 = (0, import_react.useMemo)(() => ({ categories: d2, categoryItems: d2.map((e3) => Un(e3, _2)), selectedCategoryId: _2, selectedCategoryIndex: b2, selectedCategory: x2, selectedCategoryName: x2?.name ?? null, hasMultipleCategories: S2, isLoading: false, hasError: u2, refetch: i2, selectCategory: v2 }), [d2, _2, b2, x2, S2, u2, i2, v2]);
|
|
1172
1166
|
return (0, import_jsx_runtime.jsx)($.Provider, { value: C2, children: c2 });
|
|
1173
1167
|
}
|
|
1174
|
-
function
|
|
1175
|
-
|
|
1176
|
-
let s2 =
|
|
1177
|
-
return (0, import_jsx_runtime.jsx)(
|
|
1168
|
+
function qn({ initialCategoryId: e2, categoriesPicker: n2, refreshSignal: i2 = 0, children: a2 }) {
|
|
1169
|
+
Bn(Ln.CATEGORIES);
|
|
1170
|
+
let s2 = ln(), l2 = Mn(n2?.categoryId), [u2, d2] = (0, import_react.useState)(0), p2 = (0, import_react.useMemo)(() => Qt(xn({ key: dn(), refresh: u2 !== 0 || i2 !== 0, warmupData: s2, fetchData: () => Yt(`categories-context-load`, { feature: B.categories }, On()) }), Wn, Gn), [u2, i2]), m2 = (0, import_react.useCallback)(() => d2((e3) => e3 + 1), []);
|
|
1171
|
+
return (0, import_jsx_runtime.jsx)(Xt, { fallback: (0, import_jsx_runtime.jsx)(jn, { refetch: m2, children: a2 }), feature: B.categories, children: (0, import_jsx_runtime.jsx)(import_react.Suspense, { fallback: (0, import_jsx_runtime.jsx)(An, { refetch: m2, children: a2 }), children: (0, import_jsx_runtime.jsx)(Kn, { categoriesPromise: p2, initialCategoryId: e2, categoryIdsKey: l2, refetch: m2, children: a2 }) }) });
|
|
1178
1172
|
}
|
|
1179
|
-
var
|
|
1173
|
+
var Jn = Ht;
|
|
1180
1174
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1181
1175
|
0 && (module.exports = {
|
|
1182
1176
|
CATEGORIES_CONTEXT_MISSING_PROVIDER_ERROR,
|
|
@@ -1185,4 +1179,4 @@ var Xn = Vt;
|
|
|
1185
1179
|
injectAccessTokenGetter,
|
|
1186
1180
|
useCategoriesContext
|
|
1187
1181
|
});
|
|
1188
|
-
//# sourceMappingURL=context-categories
|
|
1182
|
+
//# sourceMappingURL=context-categories.js.map
|