@wix/bookings 1.0.1757 → 1.0.1758
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-service/runtime.js +3 -3
- package/_sdk-exports/context-time-slots/runtime.js +3 -3
- package/build/cjs/context-service.js +318 -318
- package/build/cjs/context-service.js.map +1 -1
- package/build/cjs/context-time-slots.js +1180 -1102
- package/build/cjs/context-time-slots.js.map +1 -1
- package/build/es/context-service.mjs +318 -318
- package/build/es/context-service.mjs.map +1 -1
- package/build/es/context-time-slots.mjs +1180 -1102
- package/build/es/context-time-slots.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -20,11 +20,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// context-time-slots.ts
|
|
21
21
|
var context_time_slots_exports = {};
|
|
22
22
|
__export(context_time_slots_exports, {
|
|
23
|
-
TimeSlotsContextProvider: () =>
|
|
24
|
-
default: () =>
|
|
25
|
-
injectAccessTokenGetter: () =>
|
|
26
|
-
timeSlotsContext: () =>
|
|
27
|
-
useTimeSlotsContext: () =>
|
|
23
|
+
TimeSlotsContextProvider: () => Xl,
|
|
24
|
+
default: () => Xl,
|
|
25
|
+
injectAccessTokenGetter: () => eu,
|
|
26
|
+
timeSlotsContext: () => Gl,
|
|
27
|
+
useTimeSlotsContext: () => Kl
|
|
28
28
|
});
|
|
29
29
|
module.exports = __toCommonJS(context_time_slots_exports);
|
|
30
30
|
|
|
@@ -193,7 +193,7 @@ function me(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 = ge(s3.status, e5?.message ?? s3.statusText, e5?.details, { requestId: s3.headers.get(`X-Wix-Request-Id`), details: e5 }), n3 = N(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();
|
|
@@ -210,11 +210,11 @@ var he = class extends Error {
|
|
|
210
210
|
super(), this.response = e2.response, this.requestId = e2.requestId;
|
|
211
211
|
}
|
|
212
212
|
};
|
|
213
|
-
var
|
|
214
|
-
var
|
|
215
|
-
function
|
|
213
|
+
var ge = (e2, t2, n2, r2) => new he({ response: { data: { details: { ...!n2?.validationError && { applicationError: { description: t2, code: e2, data: r2 } }, ...n2 }, message: t2 }, status: e2 }, requestId: r2?.requestId });
|
|
214
|
+
var F = `.`;
|
|
215
|
+
function _e(e2, t2, n2) {
|
|
216
216
|
if (e2 == null) throw Error(`Cannot set value on null or undefined`);
|
|
217
|
-
let r2 =
|
|
217
|
+
let r2 = ve(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 ge(e2, t2, n2) {
|
|
|
226
226
|
}
|
|
227
227
|
return e2;
|
|
228
228
|
}
|
|
229
|
-
function _e(e2) {
|
|
230
|
-
return Array.isArray(e2) ? e2 : e2.split(I).map((e3) => ve(e3) ? Number(e3) : e3);
|
|
231
|
-
}
|
|
232
229
|
function ve(e2) {
|
|
233
|
-
return
|
|
230
|
+
return Array.isArray(e2) ? e2 : e2.split(F).map((e3) => ye(e3) ? Number(e3) : e3);
|
|
234
231
|
}
|
|
235
232
|
function ye(e2) {
|
|
233
|
+
return /^\d+$/.test(e2);
|
|
234
|
+
}
|
|
235
|
+
function be(e2) {
|
|
236
236
|
let t2 = {};
|
|
237
|
-
for (let [n2, r2] of Object.entries(e2))
|
|
237
|
+
for (let [n2, r2] of Object.entries(e2)) xe(n2) || _e(t2, ve(n2), r2);
|
|
238
238
|
return t2;
|
|
239
239
|
}
|
|
240
|
-
function
|
|
240
|
+
function xe(e2) {
|
|
241
241
|
return e2 === `__proto__` || e2 === `constructor` || e2 === `prototype`;
|
|
242
242
|
}
|
|
243
|
-
var
|
|
243
|
+
var Se = class {
|
|
244
244
|
BRACKET_PATTERN = /\[(\d+)\]/g;
|
|
245
245
|
NUMERIC_PATTERN = /^\d+$/;
|
|
246
246
|
ESCAPED_DOT_PATTERN = /\\\./g;
|
|
@@ -263,7 +263,7 @@ var xe = 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])), be(this.cleanedModifiedFields);
|
|
267
267
|
}
|
|
268
268
|
flatten(e2) {
|
|
269
269
|
let t2 = {};
|
|
@@ -288,7 +288,7 @@ var xe = class {
|
|
|
288
288
|
r2.push(i3), n2 = t3[i3];
|
|
289
289
|
return;
|
|
290
290
|
}
|
|
291
|
-
let a3 =
|
|
291
|
+
let a3 = Ee(e3);
|
|
292
292
|
if (a3 && a3 in t3) {
|
|
293
293
|
r2.push(a3), n2 = t3[a3];
|
|
294
294
|
return;
|
|
@@ -319,28 +319,28 @@ var xe = 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 Ce(e2, t2) {
|
|
323
323
|
let n2 = e2?.modifiedFields;
|
|
324
324
|
if (!n2) return null;
|
|
325
|
-
let r2 =
|
|
325
|
+
let r2 = we(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 = Te(s2, a2);
|
|
332
332
|
return c2 === null ? null : (o2.modifiedFields = c2, o2);
|
|
333
333
|
}
|
|
334
|
-
function
|
|
334
|
+
function we(e2) {
|
|
335
335
|
if (typeof e2 == `object` && e2 && !Array.isArray(e2)) try {
|
|
336
|
-
let t2 = new
|
|
336
|
+
let t2 = new Se(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 Te(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 we(e2, t2) {
|
|
|
348
348
|
}
|
|
349
349
|
return null;
|
|
350
350
|
}
|
|
351
|
-
function
|
|
351
|
+
function Ee(e2) {
|
|
352
352
|
return e2.replace(/[-_\s]+(.)?/g, (e3, t2) => t2 ? t2.toUpperCase() : ``).replace(/^./, (e3) => e3.toLowerCase());
|
|
353
353
|
}
|
|
354
|
-
function
|
|
354
|
+
function De() {
|
|
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 Ee() {
|
|
|
360
360
|
};
|
|
361
361
|
} };
|
|
362
362
|
}
|
|
363
|
-
var
|
|
364
|
-
function
|
|
363
|
+
var Oe = (e2) => e2.__type === `event-definition`;
|
|
364
|
+
function ke(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 Oe(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 = Ce(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 Ae(e2) {
|
|
382
|
+
let t2 = /* @__PURE__ */ new Map(), n2 = De();
|
|
383
383
|
return { initModule(e3) {
|
|
384
384
|
return (r2) => {
|
|
385
385
|
let i2 = t2.get(e3.type) ?? [];
|
|
@@ -389,7 +389,7 @@ function ke(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 }) => ke(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 ke(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 }) => ke(t3, n4, e3.payload, { instanceId: e3.instanceId, identity: e3.identity })));
|
|
412
412
|
}, apps: { AppInstalled: h(`AppInstalled`)(), AppRemoved: h(`AppRemoved`)() } } };
|
|
413
413
|
}
|
|
414
|
-
var
|
|
415
|
-
function
|
|
416
|
-
let t2 = /* @__PURE__ */ new Map(), n2 =
|
|
414
|
+
var je = (e2) => e2.__type === `service-plugin-definition`;
|
|
415
|
+
function Me(e2) {
|
|
416
|
+
let t2 = /* @__PURE__ */ new Map(), n2 = De();
|
|
417
417
|
return { initModule(e3) {
|
|
418
418
|
return (r2) => {
|
|
419
419
|
let i2 = t2.get(e3.componentType.toLowerCase()) ?? [];
|
|
@@ -454,33 +454,33 @@ function je(e2) {
|
|
|
454
454
|
return s2.transformations.toREST(await c2(s2.transformations.fromREST(e3)));
|
|
455
455
|
} } };
|
|
456
456
|
}
|
|
457
|
-
var
|
|
458
|
-
function
|
|
457
|
+
var Ne = `X-Wix-Consistent`;
|
|
458
|
+
function Pe(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`] ? { [Ne]: t2[Ne] } : {} }, 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 = Fe(e3);
|
|
466
|
+
return a3 && (t2[Ne] = 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 = Fe(e3);
|
|
473
|
+
return a3 && (t2[Ne] = 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 = C(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 } = Me(i2), { client: u2, initModule: d2 } = Ae(i2), f2 = async (n3, r3) => {
|
|
479
|
+
let i3 = o2(), s3 = await a2(), c3 = C(r3), l3 = await i3(n3, { ...r3, headers: { ...c3, ...t2, ...s3?.headers, ...r3?.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [Ne]: t2[Ne] } : {} } }), u3 = Fe(l3);
|
|
480
|
+
return u3 && (t2[Ne] = u3), l3;
|
|
481
481
|
}, p2 = (t3, n3) => {
|
|
482
|
-
if (
|
|
483
|
-
if (
|
|
482
|
+
if (Oe(t3)) return d2(t3);
|
|
483
|
+
if (je(t3)) return l2(t3);
|
|
484
484
|
if (T(t3) && e2.host) return ee(t3, e2.host);
|
|
485
485
|
if (typeof t3 == `function`) {
|
|
486
486
|
if (`__type` in t3 && t3.__type === `wix_spi_error`) return t3;
|
|
@@ -509,19 +509,19 @@ function Ne(e2) {
|
|
|
509
509
|
return { data: o3 ?? {}, errors: s3 };
|
|
510
510
|
}, webhooks: u2, servicePlugins: c2 };
|
|
511
511
|
}
|
|
512
|
-
function
|
|
512
|
+
function Fe(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 Ie = { _id: `id`, _createdDate: `createdDate`, _updatedDate: `updatedDate` };
|
|
516
|
+
var Le = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
|
|
517
|
+
function Re(e2, t2) {
|
|
518
518
|
return e2?.split(`.`).map((e3) => t2?.[e3] ?? e3).join(`.`);
|
|
519
519
|
}
|
|
520
|
-
var
|
|
521
|
-
function ze(e2, t2, n2) {
|
|
522
|
-
return (e2 === Re || e2.endsWith(`.${Re}`)) && typeof t2 == `string` ? Le(t2, n2) : t2;
|
|
523
|
-
}
|
|
520
|
+
var ze = `sort.fieldName`;
|
|
524
521
|
function Be(e2, t2, n2) {
|
|
522
|
+
return (e2 === ze || e2.endsWith(`.${ze}`)) && typeof t2 == `string` ? Re(t2, n2) : t2;
|
|
523
|
+
}
|
|
524
|
+
function Ve(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,147 +531,147 @@ function Be(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 = I(e4, t2);
|
|
535
|
+
s2 !== e4 && !(s2 in a2) && (a2[s2] = a2[e4], delete a2[e4]), a2[s2] = Be(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 I(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
|
|
546
|
-
return
|
|
545
|
+
function He(e2, t2 = []) {
|
|
546
|
+
return Ve(e2, Ie, t2);
|
|
547
547
|
}
|
|
548
|
-
function
|
|
549
|
-
return
|
|
548
|
+
function L(e2, t2 = []) {
|
|
549
|
+
return Ve(e2, Le, t2);
|
|
550
550
|
}
|
|
551
|
-
function
|
|
551
|
+
function Ue(e2) {
|
|
552
552
|
return e2?.toISOString();
|
|
553
553
|
}
|
|
554
|
-
function
|
|
554
|
+
function We(e2) {
|
|
555
555
|
return e2 ? new Date(e2) : void 0;
|
|
556
556
|
}
|
|
557
|
-
var
|
|
558
|
-
function
|
|
557
|
+
var Ge = /* @__PURE__ */ new WeakMap();
|
|
558
|
+
function Ke() {
|
|
559
559
|
return { leaves: void 0, fields: void 0, mapFields: void 0, anyField: void 0 };
|
|
560
560
|
}
|
|
561
|
-
function
|
|
561
|
+
function qe(e2, t2) {
|
|
562
562
|
let n2 = e2.get(t2);
|
|
563
|
-
return n2 || (n2 =
|
|
563
|
+
return n2 || (n2 = Ke(), e2.set(t2, n2)), n2;
|
|
564
564
|
}
|
|
565
|
-
function
|
|
566
|
-
return t2 === `*` ? (e2.anyField ??=
|
|
565
|
+
function Je(e2, t2) {
|
|
566
|
+
return t2 === `*` ? (e2.anyField ??= Ke(), e2.anyField) : t2.endsWith(`{}`) ? (e2.mapFields ??= /* @__PURE__ */ new Map(), qe(e2.mapFields, t2.slice(0, -2))) : (e2.fields ??= /* @__PURE__ */ new Map(), qe(e2.fields, t2));
|
|
567
567
|
}
|
|
568
|
-
function
|
|
569
|
-
let t2 =
|
|
568
|
+
function Ye(e2) {
|
|
569
|
+
let t2 = Ke();
|
|
570
570
|
for (let n2 of e2) {
|
|
571
|
-
let e3 = n2.path.split(`.`).reduce(
|
|
571
|
+
let e3 = n2.path.split(`.`).reduce(Je, t2);
|
|
572
572
|
e3.leaves ??= [], e3.leaves.push(n2);
|
|
573
573
|
}
|
|
574
574
|
return t2;
|
|
575
575
|
}
|
|
576
|
-
function
|
|
577
|
-
let t2 =
|
|
578
|
-
return t2 || (t2 =
|
|
576
|
+
function R(e2) {
|
|
577
|
+
let t2 = Ge.get(e2);
|
|
578
|
+
return t2 || (t2 = Ye(e2), Ge.set(e2, t2)), t2;
|
|
579
579
|
}
|
|
580
|
-
function
|
|
580
|
+
function Xe(e2) {
|
|
581
581
|
return typeof e2 == `object` && !!e2;
|
|
582
582
|
}
|
|
583
|
-
function
|
|
584
|
-
return t2 ? Array.isArray(e2) ? e2.map(r2) : e2 : n2 ?
|
|
585
|
-
}
|
|
586
|
-
function Ze(e2, t2, n2) {
|
|
587
|
-
Ye(e2) && et(e2, t2, n2);
|
|
583
|
+
function Ze(e2, { isRepeated: t2, isMap: n2 }, r2) {
|
|
584
|
+
return t2 ? Array.isArray(e2) ? e2.map(r2) : e2 : n2 ? Xe(e2) ? Object.fromEntries(Object.entries(e2).map(([e3, t3]) => [e3, r2(t3)])) : e2 : r2(e2);
|
|
588
585
|
}
|
|
589
586
|
function Qe(e2, t2, n2) {
|
|
587
|
+
Xe(e2) && tt(e2, t2, n2);
|
|
588
|
+
}
|
|
589
|
+
function $e(e2, t2, n2) {
|
|
590
590
|
for (let [r2, i2] of t2) {
|
|
591
591
|
if (!(r2 in e2)) continue;
|
|
592
|
-
if (i2.leaves) for (let t4 of i2.leaves) e2[r2] =
|
|
592
|
+
if (i2.leaves) for (let t4 of i2.leaves) e2[r2] = Ze(e2[r2], t4, n2);
|
|
593
593
|
let t3 = e2[r2];
|
|
594
|
-
Array.isArray(t3) ? t3.forEach((e3) =>
|
|
594
|
+
Array.isArray(t3) ? t3.forEach((e3) => Qe(e3, i2, n2)) : Qe(t3, i2, n2);
|
|
595
595
|
}
|
|
596
596
|
}
|
|
597
|
-
function
|
|
597
|
+
function et(e2, t2, n2) {
|
|
598
598
|
for (let [r2, i2] of t2) {
|
|
599
599
|
let t3 = e2[r2];
|
|
600
|
-
|
|
600
|
+
Xe(t3) && Object.values(t3).forEach((e3) => Qe(e3, i2, n2));
|
|
601
601
|
}
|
|
602
602
|
}
|
|
603
|
-
function
|
|
604
|
-
t2 &&
|
|
603
|
+
function tt(e2, { fields: t2, mapFields: n2, anyField: r2 }, i2) {
|
|
604
|
+
t2 && $e(e2, t2, i2), n2 && et(e2, n2, i2), r2 && Object.values(e2).forEach((e3) => Qe(e3, r2, i2));
|
|
605
605
|
}
|
|
606
|
-
function
|
|
607
|
-
if (!
|
|
608
|
-
for (let { paths: n2, transformFn: r2 } of t2)
|
|
606
|
+
function z(e2, t2) {
|
|
607
|
+
if (!Xe(e2)) return e2;
|
|
608
|
+
for (let { paths: n2, transformFn: r2 } of t2) tt(e2, R(n2), r2);
|
|
609
609
|
return e2;
|
|
610
610
|
}
|
|
611
|
-
function
|
|
612
|
-
return
|
|
611
|
+
function nt(e2) {
|
|
612
|
+
return st(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
|
|
613
613
|
}
|
|
614
|
-
var
|
|
615
|
-
var
|
|
616
|
-
var
|
|
617
|
-
var
|
|
618
|
-
function
|
|
614
|
+
var rt = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
615
|
+
var it = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
616
|
+
var at = `$1\0$2`;
|
|
617
|
+
var ot = /[^\p{L}\d]+/giu;
|
|
618
|
+
function st(e2) {
|
|
619
619
|
let t2 = e2.trim();
|
|
620
|
-
t2 = t2.replace(
|
|
620
|
+
t2 = t2.replace(rt, at).replace(it, at), t2 = t2.replace(ot, `\0`);
|
|
621
621
|
let n2 = 0, r2 = t2.length;
|
|
622
622
|
for (; t2.charAt(n2) === `\0`; ) n2++;
|
|
623
623
|
if (n2 === r2) return [];
|
|
624
624
|
for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
|
|
625
625
|
return t2.slice(n2, r2).split(/\0/g);
|
|
626
626
|
}
|
|
627
|
-
var
|
|
628
|
-
var
|
|
629
|
-
var
|
|
630
|
-
function
|
|
627
|
+
var ct = (e2) => `validationError` in (e2.response?.data?.details ?? {});
|
|
628
|
+
var B = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
|
|
629
|
+
var lt = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
|
|
630
|
+
function ut(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
|
|
631
631
|
if (typeof e2 != `object` || !e2) throw e2;
|
|
632
|
-
if (
|
|
633
|
-
if (
|
|
634
|
-
if (
|
|
635
|
-
let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code:
|
|
636
|
-
return
|
|
632
|
+
if (ct(e2)) return dt(e2, t2, n2);
|
|
633
|
+
if (B(e2)) return pt(e2);
|
|
634
|
+
if (lt(e2)) {
|
|
635
|
+
let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: nt(n3), data: {} }, requestId: e2.requestId };
|
|
636
|
+
return ft(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
|
|
637
637
|
}
|
|
638
|
-
return
|
|
638
|
+
return mt(e2);
|
|
639
639
|
}
|
|
640
|
-
var
|
|
641
|
-
let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 =
|
|
642
|
-
return
|
|
640
|
+
var dt = (e2, t2, n2) => {
|
|
641
|
+
let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = ht(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 };
|
|
642
|
+
return ft(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e2.response?.status, requestId: i2 } });
|
|
643
643
|
};
|
|
644
|
-
var
|
|
645
|
-
var
|
|
646
|
-
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 ??
|
|
647
|
-
return
|
|
644
|
+
var ft = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
|
|
645
|
+
var pt = (e2) => {
|
|
646
|
+
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 ?? nt(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 };
|
|
647
|
+
return ft(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e2.requestId } });
|
|
648
648
|
};
|
|
649
|
-
var
|
|
650
|
-
var
|
|
649
|
+
var mt = (e2) => ft(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: nt(e2.response?.statusText ?? `UNKNOWN`), ...!e2.response && { runtimeError: e2 } } });
|
|
650
|
+
var ht = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
|
|
651
651
|
let a2 = { ...e2, ...t2 }, o2 = Object.keys(a2);
|
|
652
652
|
return r2?.filter((e3) => !r2.some((t3) => t3.field.length > e3.field.length && t3.field.startsWith(e3.field) && o2.includes(t3.field))).map((e3) => {
|
|
653
653
|
let r3 = t2[e3.field];
|
|
654
|
-
if (r3) return { ...e3, field:
|
|
654
|
+
if (r3) return { ...e3, field: gt(r3, i2) };
|
|
655
655
|
let s2 = o2?.sort((e4, t3) => t3.length - e4.length)?.find((t3) => e3.field.startsWith(t3));
|
|
656
656
|
if (s2) {
|
|
657
657
|
let t3 = a2[s2];
|
|
658
|
-
if (t3) return { ...e3, field: e3.field.replace(s2,
|
|
658
|
+
if (t3) return { ...e3, field: e3.field.replace(s2, gt(t3, i2)) };
|
|
659
659
|
}
|
|
660
660
|
return n2 ? { ...e3, field: `${i2[0]}.${e3.field}` } : e3;
|
|
661
661
|
});
|
|
662
662
|
};
|
|
663
|
-
var
|
|
664
|
-
let n2 =
|
|
663
|
+
var gt = (e2, t2) => {
|
|
664
|
+
let n2 = _t(e2);
|
|
665
665
|
return n2 == null ? e2 : e2.replace(`$[${n2}]`, t2[n2]);
|
|
666
666
|
};
|
|
667
|
-
var
|
|
667
|
+
var _t = (e2) => {
|
|
668
668
|
let t2 = e2.match(/\$\[(?<argIndex>\d+)\]/);
|
|
669
669
|
return t2 && t2.groups && Number(t2.groups.argIndex);
|
|
670
670
|
};
|
|
671
|
-
function
|
|
671
|
+
function vt() {
|
|
672
672
|
let e2 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
673
673
|
if (e2) return { initWixModules(t3, n3) {
|
|
674
|
-
return
|
|
674
|
+
return yt(() => e2(t3, n3));
|
|
675
675
|
}, fetchWithAuth() {
|
|
676
676
|
throw Error(`fetchWithAuth is not available in this context`);
|
|
677
677
|
}, graphql() {
|
|
@@ -681,10 +681,10 @@ function _t() {
|
|
|
681
681
|
if (t2 || n2) return { initWixModules(e3, r2) {
|
|
682
682
|
if (r2) {
|
|
683
683
|
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`);
|
|
684
|
-
return
|
|
684
|
+
return yt(() => n2.use(e3));
|
|
685
685
|
}
|
|
686
686
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
687
|
-
return
|
|
687
|
+
return yt(() => t2.use(e3));
|
|
688
688
|
}, fetchWithAuth: (e3, n3) => {
|
|
689
689
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
690
690
|
return t2.fetchWithAuth(e3, n3);
|
|
@@ -696,7 +696,7 @@ function _t() {
|
|
|
696
696
|
return t2.graphql(e3, n3, r2);
|
|
697
697
|
} };
|
|
698
698
|
}
|
|
699
|
-
function
|
|
699
|
+
function yt(e2) {
|
|
700
700
|
let t2 = globalThis.__wix_context__, n2 = { client: m.client, elevatedClient: m.elevatedClient }, r2;
|
|
701
701
|
globalThis.__wix_context__ = void 0, m.client = void 0, m.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
702
702
|
try {
|
|
@@ -705,101 +705,101 @@ function vt(e2) {
|
|
|
705
705
|
globalThis.__wix_context__ = t2, m.client = n2.client, m.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
706
706
|
}
|
|
707
707
|
}
|
|
708
|
-
function
|
|
708
|
+
function bt(e2, t2) {
|
|
709
709
|
return (...n2) => {
|
|
710
|
-
let r2 =
|
|
710
|
+
let r2 = vt();
|
|
711
711
|
return r2 ? r2.initWixModules(e2, t2).apply(void 0, n2) : e2.apply(void 0, n2);
|
|
712
712
|
};
|
|
713
713
|
}
|
|
714
|
-
function
|
|
715
|
-
return
|
|
714
|
+
function xt(e2, t2 = false) {
|
|
715
|
+
return bt(e2, t2);
|
|
716
716
|
}
|
|
717
|
-
function
|
|
718
|
-
let n2 =
|
|
719
|
-
return t2 && r2 ? new URLSearchParams({ ".r":
|
|
717
|
+
function St(e2, t2) {
|
|
718
|
+
let n2 = Ct(e2), r2 = Object.entries(n2).some(([e3, t3]) => e3.includes(`.`) || Array.isArray(t3) && t3.some((e4) => typeof e4 == `object`));
|
|
719
|
+
return t2 && r2 ? new URLSearchParams({ ".r": Tt(JSON.stringify(e2)) }) : Object.entries(n2).reduce((e3, [t3, n3]) => ((Array.isArray(n3) ? n3 : [n3]).forEach((r3) => {
|
|
720
720
|
r3 == null || Array.isArray(n3) && typeof r3 == `object` || e3.append(t3, r3);
|
|
721
721
|
}), e3), new URLSearchParams());
|
|
722
722
|
}
|
|
723
|
-
function
|
|
724
|
-
let t2 =
|
|
725
|
-
return
|
|
723
|
+
function V(e2) {
|
|
724
|
+
let t2 = Rt(It(e2.host), e2.domainToMappings);
|
|
725
|
+
return H(Wt(e2.protoPath, e2.data || {}), t2);
|
|
726
726
|
}
|
|
727
|
-
function
|
|
727
|
+
function Ct(e2, t2 = ``) {
|
|
728
728
|
let n2 = {};
|
|
729
729
|
return Object.entries(e2).forEach(([e3, r2]) => {
|
|
730
|
-
let i2 = typeof r2 == `object` && !!r2 && !Array.isArray(r2), a2 =
|
|
730
|
+
let i2 = typeof r2 == `object` && !!r2 && !Array.isArray(r2), a2 = wt(t2, e3);
|
|
731
731
|
if (i2) {
|
|
732
|
-
let e4 =
|
|
732
|
+
let e4 = Ct(r2, a2);
|
|
733
733
|
Object.assign(n2, e4);
|
|
734
734
|
} else n2[a2] = r2;
|
|
735
735
|
}), n2;
|
|
736
736
|
}
|
|
737
|
-
function
|
|
737
|
+
function wt(e2, t2) {
|
|
738
738
|
return `${e2}${e2 ? `.` : ``}${t2}`;
|
|
739
739
|
}
|
|
740
|
-
var
|
|
740
|
+
var Tt = (e2) => {
|
|
741
741
|
let t2 = new TextEncoder().encode(e2);
|
|
742
742
|
return (typeof btoa < `u` ? btoa(String.fromCodePoint(...t2)) : Buffer.from(e2, `utf-8`).toString(`base64`)).replace(/=/g, ``).replace(/\+/g, `-`).replace(/\//g, `_`);
|
|
743
743
|
};
|
|
744
|
-
var
|
|
745
|
-
var
|
|
746
|
-
var
|
|
747
|
-
var
|
|
748
|
-
var
|
|
749
|
-
var
|
|
750
|
-
var
|
|
751
|
-
var
|
|
752
|
-
var
|
|
753
|
-
var
|
|
754
|
-
function Ft(e2) {
|
|
755
|
-
return It(e2).replace(Ot, `._base_domain_`).replace(Nt, `._api_base_domain_`).replace(Pt, `*.dev.wix-code.com`);
|
|
756
|
-
}
|
|
744
|
+
var Et = [`wix.com`, `editorx.com`];
|
|
745
|
+
var Dt = `_`;
|
|
746
|
+
var Ot = `*.`;
|
|
747
|
+
var kt = RegExp(`\\.(${Et.join(`|`)})$`);
|
|
748
|
+
var At = [`42.wixprod.net`, `uw2-edt-1.wixprod.net`, `virginia-edt.wixprod.net`];
|
|
749
|
+
var jt = { "payments.base44.com": `manage.wix.com`, "create.editorx.com": `editor.editorx.com` };
|
|
750
|
+
var Mt = `dev.wix-code.com`;
|
|
751
|
+
var Nt = /{(.*)}/;
|
|
752
|
+
var Pt = RegExp(`\\.(${At.join(`|`)})$`);
|
|
753
|
+
var Ft = RegExp(`.*\\.${Mt}$`);
|
|
757
754
|
function It(e2) {
|
|
758
|
-
return
|
|
755
|
+
return Lt(e2).replace(kt, `._base_domain_`).replace(Pt, `._api_base_domain_`).replace(Ft, `*.dev.wix-code.com`);
|
|
756
|
+
}
|
|
757
|
+
function Lt(e2) {
|
|
758
|
+
return jt[e2] ?? e2;
|
|
759
759
|
}
|
|
760
|
-
function
|
|
760
|
+
function Rt(e2, t2) {
|
|
761
761
|
let n2 = t2[e2];
|
|
762
762
|
if (n2) return n2;
|
|
763
|
-
let r2 =
|
|
763
|
+
let r2 = zt(e2, t2) ?? Bt(e2, t2);
|
|
764
764
|
if (!r2) {
|
|
765
|
-
if (
|
|
766
|
-
let e3 = t2[
|
|
765
|
+
if (Ht(e2)) {
|
|
766
|
+
let e3 = t2[Ut];
|
|
767
767
|
if (e3) return e3;
|
|
768
768
|
}
|
|
769
|
-
let n3 = t2[
|
|
769
|
+
let n3 = t2[Dt];
|
|
770
770
|
if (n3) return n3;
|
|
771
771
|
}
|
|
772
772
|
return r2 ?? [];
|
|
773
773
|
}
|
|
774
|
-
function
|
|
774
|
+
function zt(e2, t2) {
|
|
775
775
|
return Object.entries(t2).find(([t3]) => {
|
|
776
776
|
let [, ...n2] = e2.split(`.`);
|
|
777
777
|
return n2.join(`.`) === t3;
|
|
778
778
|
})?.[1];
|
|
779
779
|
}
|
|
780
|
-
function
|
|
781
|
-
let [n2] = Object.entries(t2).filter(([t3]) =>
|
|
780
|
+
function Bt(e2, t2) {
|
|
781
|
+
let [n2] = Object.entries(t2).filter(([t3]) => Vt(e2, t3)).sort(([e3], [t3]) => t3.length - e3.length);
|
|
782
782
|
if (!n2) return;
|
|
783
783
|
let [, r2] = n2;
|
|
784
784
|
return r2;
|
|
785
785
|
}
|
|
786
|
-
function
|
|
787
|
-
if (!t2.startsWith(
|
|
786
|
+
function Vt(e2, t2) {
|
|
787
|
+
if (!t2.startsWith(Ot)) return false;
|
|
788
788
|
let n2 = t2.slice(1);
|
|
789
789
|
return e2.length > n2.length && e2.endsWith(n2);
|
|
790
790
|
}
|
|
791
|
-
function
|
|
791
|
+
function Ht(e2) {
|
|
792
792
|
return !!e2.match(/\._base_domain_$/);
|
|
793
793
|
}
|
|
794
|
-
var
|
|
795
|
-
function Ut(e2, t2) {
|
|
796
|
-
return e2.split(`/`).map((e3) => Wt(e3, t2)).join(`/`);
|
|
797
|
-
}
|
|
794
|
+
var Ut = `www._base_domain_`;
|
|
798
795
|
function Wt(e2, t2) {
|
|
799
|
-
|
|
800
|
-
|
|
796
|
+
return e2.split(`/`).map((e3) => Gt(e3, t2)).join(`/`);
|
|
797
|
+
}
|
|
798
|
+
function Gt(e2, t2) {
|
|
799
|
+
let n2 = e2.match(Nt) || [], r2 = n2[1];
|
|
800
|
+
return r2 ? Kt(t2, r2, e2, e2.replace(n2[0], ``)) : e2;
|
|
801
801
|
}
|
|
802
|
-
function
|
|
802
|
+
function Kt(e2, t2, n2, r2) {
|
|
803
803
|
let i2 = e2;
|
|
804
804
|
for (let e3 of t2.split(`.`)) {
|
|
805
805
|
if (!i2) return n2;
|
|
@@ -807,37 +807,37 @@ function Gt(e2, t2, n2, r2) {
|
|
|
807
807
|
}
|
|
808
808
|
return `${i2}${r2}`;
|
|
809
809
|
}
|
|
810
|
-
function
|
|
810
|
+
function H(e2, t2) {
|
|
811
811
|
let n2 = t2?.find((t3) => e2.startsWith(t3.destPath));
|
|
812
812
|
return n2 ? n2.srcPath + e2.slice(n2.destPath.length) : e2;
|
|
813
813
|
}
|
|
814
|
-
function
|
|
814
|
+
function qt(e2) {
|
|
815
815
|
return e2 === `NaN` ? NaN : e2 === `Infinity` ? 1 / 0 : e2 === `-Infinity` ? -1 / 0 : e2;
|
|
816
816
|
}
|
|
817
|
-
var
|
|
818
|
-
var
|
|
819
|
-
var
|
|
820
|
-
var
|
|
821
|
-
let e2 =
|
|
822
|
-
if (e2) return { [
|
|
817
|
+
var Jt = `x-wix-linguist`;
|
|
818
|
+
var Yt = `00000000-0000-0000-0000-000000000000`;
|
|
819
|
+
var Xt = `false`;
|
|
820
|
+
var Zt = () => {
|
|
821
|
+
let e2 = en(`language`), t2 = en(`locale`);
|
|
822
|
+
if (e2) return { [Jt]: [e2, t2 || e2, Xt, Yt].join(`|`) };
|
|
823
823
|
};
|
|
824
|
-
function
|
|
824
|
+
function Qt() {
|
|
825
825
|
let e2 = null, t2 = null;
|
|
826
826
|
return { promise: new Promise((n2, r2) => {
|
|
827
827
|
e2 = n2, t2 = r2;
|
|
828
828
|
}), resolve: e2, reject: t2 };
|
|
829
829
|
}
|
|
830
|
-
var
|
|
831
|
-
var
|
|
832
|
-
var
|
|
833
|
-
let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e2(t2), o2 =
|
|
834
|
-
return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language:
|
|
835
|
-
return
|
|
830
|
+
var $t = () => (typeof window < `u` ? window.commonConfig : void 0) ?? globalThis.commonConfig;
|
|
831
|
+
var en = (e2) => $t()?.[e2];
|
|
832
|
+
var tn = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host: (t2) => {
|
|
833
|
+
let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e2(t2), o2 = rn();
|
|
834
|
+
return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language: en(`language`), locale: en(`locale`), get passThroughHeaders() {
|
|
835
|
+
return Zt();
|
|
836
836
|
} } };
|
|
837
837
|
}, auth: (e3) => {
|
|
838
838
|
let t2 = typeof window < `u` ? window.wixEmbedsAPI : void 0;
|
|
839
|
-
!e3 &&
|
|
840
|
-
let n2 = false, { resolve: r2, promise: i2 } =
|
|
839
|
+
!e3 && nn() && (e3 = t2?.getAccessTokenFunction?.());
|
|
840
|
+
let n2 = false, { resolve: r2, promise: i2 } = Qt();
|
|
841
841
|
return { getAuthHeaders: async () => {
|
|
842
842
|
if (!e3 && n2 && (e3 = await i2), !e3) throw Error(`Failed to resolve auth token`);
|
|
843
843
|
return { headers: { Authorization: await e3() } };
|
|
@@ -845,477 +845,477 @@ var en = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host:
|
|
|
845
845
|
r2(e4);
|
|
846
846
|
}) };
|
|
847
847
|
} });
|
|
848
|
-
function
|
|
848
|
+
function nn() {
|
|
849
849
|
return typeof document < `u` && document.currentScript?.tagName === `SCRIPT`;
|
|
850
850
|
}
|
|
851
|
-
function
|
|
851
|
+
function rn() {
|
|
852
852
|
let e2 = (typeof window < `u` ? window.wixEmbedsAPI : void 0)?.getExternalBaseUrl?.();
|
|
853
853
|
if (!e2) return;
|
|
854
854
|
let t2 = new URL(e2);
|
|
855
855
|
return t2?.pathname && t2.pathname !== `/` ? `${t2.hostname}${t2.pathname}` : t2.hostname;
|
|
856
856
|
}
|
|
857
|
-
var
|
|
857
|
+
var an = ({ clientSdk: e2, applicationId: t2 }) => ({ invoke: async ({ namespace: n2, method: r2, args: i2 }) => {
|
|
858
858
|
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`);
|
|
859
859
|
return e2.invoke({ namespace: n2, method: r2, args: i2, applicationId: t2, accessToken: `accessToken` });
|
|
860
860
|
}, getAccessToken: () => {
|
|
861
861
|
throw Error(`Not implemented`);
|
|
862
862
|
}, observeState: () => ({ disconnect: () => {
|
|
863
863
|
} }) });
|
|
864
|
-
var
|
|
864
|
+
var on = tn({ createHost: function(e2) {
|
|
865
865
|
let t2 = (typeof $wixContext < `u` ? $wixContext.clientSdk : void 0) ?? e2?.clientSdk ?? (typeof window < `u` ? window?.clientSdk : void 0), { applicationId: n2 } = e2 || {};
|
|
866
866
|
if (!n2) throw Error(`"createHost" was called without a required field "applicationId"`);
|
|
867
|
-
return { channel:
|
|
867
|
+
return { channel: an({ clientSdk: t2, applicationId: n2 }), close: () => {
|
|
868
868
|
} };
|
|
869
869
|
} });
|
|
870
|
-
var
|
|
871
|
-
let n2 =
|
|
872
|
-
return
|
|
873
|
-
};
|
|
874
|
-
var
|
|
875
|
-
var
|
|
876
|
-
var
|
|
877
|
-
var
|
|
878
|
-
var
|
|
879
|
-
var
|
|
880
|
-
var
|
|
881
|
-
var
|
|
882
|
-
var
|
|
870
|
+
var U = (e2, t2) => {
|
|
871
|
+
let n2 = on.host({ applicationId: e2, componentId: t2 }), r2 = on.auth();
|
|
872
|
+
return Pe({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
|
|
873
|
+
};
|
|
874
|
+
var sn = (e2) => U(`13d21c63-b5ec-5912-8397-c3a5ddb27a97`, e2);
|
|
875
|
+
var cn = [`ANY_FEMALE`, `ANY_MALE`];
|
|
876
|
+
var ln = `3.7.8`;
|
|
877
|
+
var un = ln;
|
|
878
|
+
var dn = typeof Buffer == `function`;
|
|
879
|
+
var fn = typeof TextDecoder == `function` ? new TextDecoder() : void 0;
|
|
880
|
+
var pn = typeof TextEncoder == `function` ? new TextEncoder() : void 0;
|
|
881
|
+
var mn = Array.prototype.slice.call(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`);
|
|
882
|
+
var hn = ((e2) => {
|
|
883
883
|
let t2 = {};
|
|
884
884
|
return e2.forEach((e3, n2) => t2[e3] = n2), t2;
|
|
885
|
-
})(
|
|
886
|
-
var
|
|
887
|
-
var
|
|
888
|
-
var
|
|
889
|
-
var
|
|
890
|
-
var
|
|
891
|
-
var
|
|
885
|
+
})(mn);
|
|
886
|
+
var gn = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
|
|
887
|
+
var W = String.fromCharCode.bind(String);
|
|
888
|
+
var _n = typeof Uint8Array.from == `function` ? Uint8Array.from.bind(Uint8Array) : (e2) => new Uint8Array(Array.prototype.slice.call(e2, 0));
|
|
889
|
+
var vn = (e2) => e2.replace(/=/g, ``).replace(/[+\/]/g, (e3) => e3 == `+` ? `-` : `_`);
|
|
890
|
+
var yn = (e2) => e2.replace(/[^A-Za-z0-9\+\/]/g, ``);
|
|
891
|
+
var bn = (e2) => {
|
|
892
892
|
let t2, n2, r2, i2, a2 = ``, o2 = e2.length % 3;
|
|
893
893
|
for (let o3 = 0; o3 < e2.length; ) {
|
|
894
894
|
if ((n2 = e2.charCodeAt(o3++)) > 255 || (r2 = e2.charCodeAt(o3++)) > 255 || (i2 = e2.charCodeAt(o3++)) > 255) throw TypeError(`invalid character found`);
|
|
895
|
-
t2 = n2 << 16 | r2 << 8 | i2, a2 +=
|
|
895
|
+
t2 = n2 << 16 | r2 << 8 | i2, a2 += mn[t2 >> 18 & 63] + mn[t2 >> 12 & 63] + mn[t2 >> 6 & 63] + mn[t2 & 63];
|
|
896
896
|
}
|
|
897
897
|
return o2 ? a2.slice(0, o2 - 3) + `===`.substring(o2) : a2;
|
|
898
898
|
};
|
|
899
|
-
var
|
|
900
|
-
var
|
|
899
|
+
var xn = typeof btoa == `function` ? (e2) => btoa(e2) : dn ? (e2) => Buffer.from(e2, `binary`).toString(`base64`) : bn;
|
|
900
|
+
var Sn = dn ? (e2) => Buffer.from(e2).toString(`base64`) : (e2) => {
|
|
901
901
|
let t2 = 4096, n2 = [];
|
|
902
|
-
for (let r2 = 0, i2 = e2.length; r2 < i2; r2 += t2) n2.push(
|
|
903
|
-
return
|
|
902
|
+
for (let r2 = 0, i2 = e2.length; r2 < i2; r2 += t2) n2.push(W.apply(null, e2.subarray(r2, r2 + t2)));
|
|
903
|
+
return xn(n2.join(``));
|
|
904
904
|
};
|
|
905
|
-
var
|
|
906
|
-
var
|
|
905
|
+
var Cn = (e2, t2 = false) => t2 ? vn(Sn(e2)) : Sn(e2);
|
|
906
|
+
var wn = (e2) => {
|
|
907
907
|
if (e2.length < 2) {
|
|
908
908
|
var t2 = e2.charCodeAt(0);
|
|
909
|
-
return t2 < 128 ? e2 : t2 < 2048 ?
|
|
909
|
+
return t2 < 128 ? e2 : t2 < 2048 ? W(192 | t2 >>> 6) + W(128 | t2 & 63) : W(224 | t2 >>> 12 & 15) + W(128 | t2 >>> 6 & 63) + W(128 | t2 & 63);
|
|
910
910
|
}
|
|
911
911
|
var t2 = 65536 + (e2.charCodeAt(0) - 55296) * 1024 + (e2.charCodeAt(1) - 56320);
|
|
912
|
-
return
|
|
913
|
-
};
|
|
914
|
-
var
|
|
915
|
-
var
|
|
916
|
-
var
|
|
917
|
-
var
|
|
918
|
-
var
|
|
919
|
-
var
|
|
920
|
-
var
|
|
912
|
+
return W(240 | t2 >>> 18 & 7) + W(128 | t2 >>> 12 & 63) + W(128 | t2 >>> 6 & 63) + W(128 | t2 & 63);
|
|
913
|
+
};
|
|
914
|
+
var Tn = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
|
|
915
|
+
var En = (e2) => e2.replace(Tn, wn);
|
|
916
|
+
var Dn = dn ? (e2) => Buffer.from(e2, `utf8`).toString(`base64`) : pn ? (e2) => Sn(pn.encode(e2)) : (e2) => xn(En(e2));
|
|
917
|
+
var On = (e2, t2 = false) => t2 ? vn(Dn(e2)) : Dn(e2);
|
|
918
|
+
var kn = (e2) => On(e2, true);
|
|
919
|
+
var An = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g;
|
|
920
|
+
var jn = (e2) => {
|
|
921
921
|
switch (e2.length) {
|
|
922
922
|
case 4:
|
|
923
923
|
var t2 = ((7 & e2.charCodeAt(0)) << 18 | (63 & e2.charCodeAt(1)) << 12 | (63 & e2.charCodeAt(2)) << 6 | 63 & e2.charCodeAt(3)) - 65536;
|
|
924
|
-
return
|
|
924
|
+
return W((t2 >>> 10) + 55296) + W((t2 & 1023) + 56320);
|
|
925
925
|
case 3:
|
|
926
|
-
return
|
|
926
|
+
return W((15 & e2.charCodeAt(0)) << 12 | (63 & e2.charCodeAt(1)) << 6 | 63 & e2.charCodeAt(2));
|
|
927
927
|
default:
|
|
928
|
-
return
|
|
928
|
+
return W((31 & e2.charCodeAt(0)) << 6 | 63 & e2.charCodeAt(1));
|
|
929
929
|
}
|
|
930
930
|
};
|
|
931
|
-
var
|
|
932
|
-
var
|
|
933
|
-
if (e2 = e2.replace(/\s+/g, ``), !
|
|
931
|
+
var Mn = (e2) => e2.replace(An, jn);
|
|
932
|
+
var G = (e2) => {
|
|
933
|
+
if (e2 = e2.replace(/\s+/g, ``), !gn.test(e2)) throw TypeError(`malformed base64.`);
|
|
934
934
|
e2 += `==`.slice(2 - (e2.length & 3));
|
|
935
935
|
let t2, n2, r2, i2 = [];
|
|
936
|
-
for (let a2 = 0; a2 < e2.length; ) t2 =
|
|
936
|
+
for (let a2 = 0; a2 < e2.length; ) t2 = hn[e2.charAt(a2++)] << 18 | hn[e2.charAt(a2++)] << 12 | (n2 = hn[e2.charAt(a2++)]) << 6 | (r2 = hn[e2.charAt(a2++)]), n2 === 64 ? i2.push(W(t2 >> 16 & 255)) : r2 === 64 ? i2.push(W(t2 >> 16 & 255, t2 >> 8 & 255)) : i2.push(W(t2 >> 16 & 255, t2 >> 8 & 255, t2 & 255));
|
|
937
937
|
return i2.join(``);
|
|
938
938
|
};
|
|
939
|
-
var
|
|
940
|
-
var
|
|
941
|
-
var
|
|
942
|
-
var
|
|
943
|
-
var
|
|
944
|
-
var
|
|
945
|
-
var
|
|
939
|
+
var Nn = typeof atob == `function` ? (e2) => atob(yn(e2)) : dn ? (e2) => Buffer.from(e2, `base64`).toString(`binary`) : G;
|
|
940
|
+
var Pn = dn ? (e2) => _n(Buffer.from(e2, `base64`)) : (e2) => _n(Nn(e2).split(``).map((e3) => e3.charCodeAt(0)));
|
|
941
|
+
var Fn = (e2) => Pn(Ln(e2));
|
|
942
|
+
var In = dn ? (e2) => Buffer.from(e2, `base64`).toString(`utf8`) : fn ? (e2) => fn.decode(Pn(e2)) : (e2) => Mn(Nn(e2));
|
|
943
|
+
var Ln = (e2) => yn(e2.replace(/[-_]/g, (e3) => e3 == `-` ? `+` : `/`));
|
|
944
|
+
var Rn = (e2) => In(Ln(e2));
|
|
945
|
+
var zn = (e2) => {
|
|
946
946
|
if (typeof e2 != `string`) return false;
|
|
947
947
|
let t2 = e2.replace(/\s+/g, ``).replace(/={0,2}$/, ``);
|
|
948
948
|
return !/[^\s0-9a-zA-Z\+/]/.test(t2) || !/[^\s0-9a-zA-Z\-_]/.test(t2);
|
|
949
949
|
};
|
|
950
|
-
var
|
|
951
|
-
var
|
|
952
|
-
let e2 = (e3, t2) => Object.defineProperty(String.prototype, e3,
|
|
950
|
+
var Bn = (e2) => ({ value: e2, enumerable: false, writable: true, configurable: true });
|
|
951
|
+
var Vn = function() {
|
|
952
|
+
let e2 = (e3, t2) => Object.defineProperty(String.prototype, e3, Bn(t2));
|
|
953
953
|
e2(`fromBase64`, function() {
|
|
954
|
-
return
|
|
954
|
+
return Rn(this);
|
|
955
955
|
}), e2(`toBase64`, function(e3) {
|
|
956
|
-
return
|
|
956
|
+
return On(this, e3);
|
|
957
957
|
}), e2(`toBase64URI`, function() {
|
|
958
|
-
return
|
|
958
|
+
return On(this, true);
|
|
959
959
|
}), e2(`toBase64URL`, function() {
|
|
960
|
-
return
|
|
960
|
+
return On(this, true);
|
|
961
961
|
}), e2(`toUint8Array`, function() {
|
|
962
|
-
return
|
|
962
|
+
return Fn(this);
|
|
963
963
|
});
|
|
964
964
|
};
|
|
965
|
-
var
|
|
966
|
-
let e2 = (e3, t2) => Object.defineProperty(Uint8Array.prototype, e3,
|
|
965
|
+
var Hn = function() {
|
|
966
|
+
let e2 = (e3, t2) => Object.defineProperty(Uint8Array.prototype, e3, Bn(t2));
|
|
967
967
|
e2(`toBase64`, function(e3) {
|
|
968
|
-
return
|
|
968
|
+
return Cn(this, e3);
|
|
969
969
|
}), e2(`toBase64URI`, function() {
|
|
970
|
-
return
|
|
970
|
+
return Cn(this, true);
|
|
971
971
|
}), e2(`toBase64URL`, function() {
|
|
972
|
-
return
|
|
972
|
+
return Cn(this, true);
|
|
973
973
|
});
|
|
974
974
|
};
|
|
975
|
-
var
|
|
976
|
-
|
|
975
|
+
var Un = { version: ln, VERSION: un, atob: Nn, atobPolyfill: G, btoa: xn, btoaPolyfill: bn, fromBase64: Rn, toBase64: On, encode: On, encodeURI: kn, encodeURL: kn, utob: En, btou: Mn, decode: Rn, isValid: zn, fromUint8Array: Cn, toUint8Array: Fn, extendString: Vn, extendUint8Array: Hn, extendBuiltins: () => {
|
|
976
|
+
Vn(), Hn();
|
|
977
977
|
} };
|
|
978
|
-
var
|
|
979
|
-
var
|
|
980
|
-
var
|
|
981
|
-
var
|
|
982
|
-
var
|
|
983
|
-
var
|
|
984
|
-
var
|
|
985
|
-
for (var n2 = new
|
|
986
|
-
for (var i2 = new
|
|
978
|
+
var K = Uint8Array;
|
|
979
|
+
var Wn = Uint16Array;
|
|
980
|
+
var Gn = Int32Array;
|
|
981
|
+
var Kn = new K([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0]);
|
|
982
|
+
var qn = new K([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0]);
|
|
983
|
+
var Jn = new K([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);
|
|
984
|
+
var Yn = function(e2, t2) {
|
|
985
|
+
for (var n2 = new Wn(31), r2 = 0; r2 < 31; ++r2) n2[r2] = t2 += 1 << e2[r2 - 1];
|
|
986
|
+
for (var i2 = new Gn(n2[30]), r2 = 1; r2 < 30; ++r2) for (var a2 = n2[r2]; a2 < n2[r2 + 1]; ++a2) i2[a2] = a2 - n2[r2] << 5 | r2;
|
|
987
987
|
return { b: n2, r: i2 };
|
|
988
988
|
};
|
|
989
|
-
var
|
|
990
|
-
var
|
|
991
|
-
var
|
|
992
|
-
|
|
993
|
-
var
|
|
994
|
-
var
|
|
995
|
-
|
|
996
|
-
for (
|
|
997
|
-
|
|
998
|
-
|
|
989
|
+
var Xn = Yn(Kn, 2);
|
|
990
|
+
var Zn = Xn.b;
|
|
991
|
+
var Qn = Xn.r;
|
|
992
|
+
Zn[28] = 258, Qn[258] = 28;
|
|
993
|
+
var $n = Yn(qn, 0);
|
|
994
|
+
var er = $n.b;
|
|
995
|
+
$n.r;
|
|
996
|
+
for (tr = new Wn(32768), q = 0; q < 32768; ++q) {
|
|
997
|
+
nr = (q & 43690) >> 1 | (q & 21845) << 1;
|
|
998
|
+
nr = (nr & 52428) >> 2 | (nr & 13107) << 2, nr = (nr & 61680) >> 4 | (nr & 3855) << 4, tr[q] = ((nr & 65280) >> 8 | (nr & 255) << 8) >> 1;
|
|
999
999
|
}
|
|
1000
|
+
var nr;
|
|
1000
1001
|
var tr;
|
|
1001
|
-
var
|
|
1002
|
-
|
|
1003
|
-
for (
|
|
1004
|
-
|
|
1005
|
-
var o2 = new Un(t2);
|
|
1002
|
+
var q;
|
|
1003
|
+
for (rr = function(e2, t2, n2) {
|
|
1004
|
+
for (var r2 = e2.length, i2 = 0, a2 = new Wn(t2); i2 < r2; ++i2) e2[i2] && ++a2[e2[i2] - 1];
|
|
1005
|
+
var o2 = new Wn(t2);
|
|
1006
1006
|
for (i2 = 1; i2 < t2; ++i2) o2[i2] = o2[i2 - 1] + a2[i2 - 1] << 1;
|
|
1007
1007
|
var s2;
|
|
1008
1008
|
if (n2) {
|
|
1009
|
-
s2 = new
|
|
1009
|
+
s2 = new Wn(1 << t2);
|
|
1010
1010
|
var c2 = 15 - t2;
|
|
1011
|
-
for (i2 = 0; i2 < r2; ++i2) if (e2[i2]) for (var l2 = i2 << 4 | e2[i2], u2 = t2 - e2[i2], d2 = o2[e2[i2] - 1]++ << u2, f2 = d2 | (1 << u2) - 1; d2 <= f2; ++d2) s2[
|
|
1012
|
-
} else for (s2 = new
|
|
1011
|
+
for (i2 = 0; i2 < r2; ++i2) if (e2[i2]) for (var l2 = i2 << 4 | e2[i2], u2 = t2 - e2[i2], d2 = o2[e2[i2] - 1]++ << u2, f2 = d2 | (1 << u2) - 1; d2 <= f2; ++d2) s2[tr[d2] >> c2] = l2;
|
|
1012
|
+
} else for (s2 = new Wn(r2), i2 = 0; i2 < r2; ++i2) e2[i2] && (s2[i2] = tr[o2[e2[i2] - 1]++] >> 15 - e2[i2]);
|
|
1013
1013
|
return s2;
|
|
1014
|
-
},
|
|
1015
|
-
var nr;
|
|
1014
|
+
}, ir = new K(288), q = 0; q < 144; ++q) ir[q] = 8;
|
|
1016
1015
|
var rr;
|
|
1017
|
-
var J;
|
|
1018
|
-
for (J = 144; J < 256; ++J) rr[J] = 9;
|
|
1019
|
-
var J;
|
|
1020
|
-
for (J = 256; J < 280; ++J) rr[J] = 7;
|
|
1021
|
-
var J;
|
|
1022
|
-
for (J = 280; J < 288; ++J) rr[J] = 8;
|
|
1023
|
-
var J;
|
|
1024
|
-
for (ir = new q(32), J = 0; J < 32; ++J) ir[J] = 5;
|
|
1025
1016
|
var ir;
|
|
1026
|
-
var
|
|
1027
|
-
|
|
1028
|
-
var
|
|
1029
|
-
|
|
1017
|
+
var q;
|
|
1018
|
+
for (q = 144; q < 256; ++q) ir[q] = 9;
|
|
1019
|
+
var q;
|
|
1020
|
+
for (q = 256; q < 280; ++q) ir[q] = 7;
|
|
1021
|
+
var q;
|
|
1022
|
+
for (q = 280; q < 288; ++q) ir[q] = 8;
|
|
1023
|
+
var q;
|
|
1024
|
+
for (ar = new K(32), q = 0; q < 32; ++q) ar[q] = 5;
|
|
1025
|
+
var ar;
|
|
1026
|
+
var q;
|
|
1027
|
+
var or = rr(ir, 9, 1);
|
|
1028
|
+
var sr = rr(ar, 5, 1);
|
|
1029
|
+
var cr = function(e2) {
|
|
1030
1030
|
for (var t2 = e2[0], n2 = 1; n2 < e2.length; ++n2) e2[n2] > t2 && (t2 = e2[n2]);
|
|
1031
1031
|
return t2;
|
|
1032
1032
|
};
|
|
1033
|
-
var
|
|
1033
|
+
var lr = function(e2, t2, n2) {
|
|
1034
1034
|
var r2 = t2 / 8 | 0;
|
|
1035
1035
|
return (e2[r2] | e2[r2 + 1] << 8) >> (t2 & 7) & n2;
|
|
1036
1036
|
};
|
|
1037
|
-
var
|
|
1037
|
+
var ur = function(e2, t2) {
|
|
1038
1038
|
var n2 = t2 / 8 | 0;
|
|
1039
1039
|
return (e2[n2] | e2[n2 + 1] << 8 | e2[n2 + 2] << 16) >> (t2 & 7);
|
|
1040
1040
|
};
|
|
1041
|
-
var
|
|
1041
|
+
var dr = function(e2) {
|
|
1042
1042
|
return (e2 + 7) / 8 | 0;
|
|
1043
1043
|
};
|
|
1044
|
-
var
|
|
1045
|
-
return (t2 == null || t2 < 0) && (t2 = 0), (n2 == null || n2 > e2.length) && (n2 = e2.length), new
|
|
1044
|
+
var fr = function(e2, t2, n2) {
|
|
1045
|
+
return (t2 == null || t2 < 0) && (t2 = 0), (n2 == null || n2 > e2.length) && (n2 = e2.length), new K(e2.subarray(t2, n2));
|
|
1046
1046
|
};
|
|
1047
|
-
var
|
|
1048
|
-
var
|
|
1049
|
-
var r2 = Error(t2 ||
|
|
1050
|
-
if (r2.code = e2, Error.captureStackTrace && Error.captureStackTrace(r2,
|
|
1047
|
+
var pr = [`unexpected EOF`, `invalid block type`, `invalid length/literal`, `invalid distance`, `stream finished`, `no stream handler`, , `no callback`, `invalid UTF-8 data`, `extra field too long`, `date not in range 1980-2099`, `filename too long`, `stream finishing`, `invalid zip data`];
|
|
1048
|
+
var mr = function(e2, t2, n2) {
|
|
1049
|
+
var r2 = Error(t2 || pr[e2]);
|
|
1050
|
+
if (r2.code = e2, Error.captureStackTrace && Error.captureStackTrace(r2, mr), !n2) throw r2;
|
|
1051
1051
|
return r2;
|
|
1052
1052
|
};
|
|
1053
|
-
var
|
|
1053
|
+
var hr = function(e2, t2, n2, r2) {
|
|
1054
1054
|
var i2 = e2.length, a2 = r2 ? r2.length : 0;
|
|
1055
|
-
if (!i2 || t2.f && !t2.l) return n2 || new
|
|
1055
|
+
if (!i2 || t2.f && !t2.l) return n2 || new K(0);
|
|
1056
1056
|
var o2 = !n2, s2 = o2 || t2.i != 2, c2 = t2.i;
|
|
1057
|
-
o2 && (n2 = new
|
|
1057
|
+
o2 && (n2 = new K(i2 * 3));
|
|
1058
1058
|
var l2 = function(e3) {
|
|
1059
1059
|
var t3 = n2.length;
|
|
1060
1060
|
if (e3 > t3) {
|
|
1061
|
-
var r3 = new
|
|
1061
|
+
var r3 = new K(Math.max(t3 * 2, e3));
|
|
1062
1062
|
r3.set(n2), n2 = r3;
|
|
1063
1063
|
}
|
|
1064
1064
|
}, u2 = t2.f || 0, d2 = t2.p || 0, f2 = t2.b || 0, p2 = t2.l, m2 = t2.d, h2 = t2.m, g2 = t2.n, _2 = i2 * 8;
|
|
1065
1065
|
do {
|
|
1066
1066
|
if (!p2) {
|
|
1067
|
-
u2 =
|
|
1068
|
-
var v2 =
|
|
1067
|
+
u2 = lr(e2, d2, 1);
|
|
1068
|
+
var v2 = lr(e2, d2 + 1, 3);
|
|
1069
1069
|
if (d2 += 3, !v2) {
|
|
1070
|
-
var y2 =
|
|
1070
|
+
var y2 = dr(d2) + 4, b2 = e2[y2 - 4] | e2[y2 - 3] << 8, x2 = y2 + b2;
|
|
1071
1071
|
if (x2 > i2) {
|
|
1072
|
-
c2 &&
|
|
1072
|
+
c2 && mr(0);
|
|
1073
1073
|
break;
|
|
1074
1074
|
}
|
|
1075
1075
|
s2 && l2(f2 + b2), n2.set(e2.subarray(y2, x2), f2), t2.b = f2 += b2, t2.p = d2 = x2 * 8, t2.f = u2;
|
|
1076
1076
|
continue;
|
|
1077
1077
|
}
|
|
1078
|
-
if (v2 == 1) p2 =
|
|
1078
|
+
if (v2 == 1) p2 = or, m2 = sr, h2 = 9, g2 = 5;
|
|
1079
1079
|
else if (v2 == 2) {
|
|
1080
|
-
var S2 =
|
|
1080
|
+
var S2 = lr(e2, d2, 31) + 257, C2 = lr(e2, d2 + 10, 15) + 4, w2 = S2 + lr(e2, d2 + 5, 31) + 1;
|
|
1081
1081
|
d2 += 14;
|
|
1082
|
-
for (var T2 = new
|
|
1082
|
+
for (var T2 = new K(w2), ee2 = new K(19), E2 = 0; E2 < C2; ++E2) ee2[Jn[E2]] = lr(e2, d2 + E2 * 3, 7);
|
|
1083
1083
|
d2 += C2 * 3;
|
|
1084
|
-
for (var D2 =
|
|
1085
|
-
var k2 = te2[
|
|
1084
|
+
for (var D2 = cr(ee2), O2 = (1 << D2) - 1, te2 = rr(ee2, D2, 1), E2 = 0; E2 < w2; ) {
|
|
1085
|
+
var k2 = te2[lr(e2, d2, O2)];
|
|
1086
1086
|
d2 += k2 & 15;
|
|
1087
1087
|
var y2 = k2 >> 4;
|
|
1088
1088
|
if (y2 < 16) T2[E2++] = y2;
|
|
1089
1089
|
else {
|
|
1090
1090
|
var A2 = 0, ne2 = 0;
|
|
1091
|
-
for (y2 == 16 ? (ne2 = 3 +
|
|
1091
|
+
for (y2 == 16 ? (ne2 = 3 + lr(e2, d2, 3), d2 += 2, A2 = T2[E2 - 1]) : y2 == 17 ? (ne2 = 3 + lr(e2, d2, 7), d2 += 3) : y2 == 18 && (ne2 = 11 + lr(e2, d2, 127), d2 += 7); ne2--; ) T2[E2++] = A2;
|
|
1092
1092
|
}
|
|
1093
1093
|
}
|
|
1094
1094
|
var re2 = T2.subarray(0, S2), j2 = T2.subarray(S2);
|
|
1095
|
-
h2 =
|
|
1096
|
-
} else
|
|
1095
|
+
h2 = cr(re2), g2 = cr(j2), p2 = rr(re2, h2, 1), m2 = rr(j2, g2, 1);
|
|
1096
|
+
} else mr(1);
|
|
1097
1097
|
if (d2 > _2) {
|
|
1098
|
-
c2 &&
|
|
1098
|
+
c2 && mr(0);
|
|
1099
1099
|
break;
|
|
1100
1100
|
}
|
|
1101
1101
|
}
|
|
1102
1102
|
s2 && l2(f2 + 131072);
|
|
1103
1103
|
for (var ie2 = (1 << h2) - 1, M2 = (1 << g2) - 1, ae2 = d2; ; ae2 = d2) {
|
|
1104
|
-
var A2 = p2[
|
|
1104
|
+
var A2 = p2[ur(e2, d2) & ie2], oe2 = A2 >> 4;
|
|
1105
1105
|
if (d2 += A2 & 15, d2 > _2) {
|
|
1106
|
-
c2 &&
|
|
1106
|
+
c2 && mr(0);
|
|
1107
1107
|
break;
|
|
1108
1108
|
}
|
|
1109
|
-
if (A2 ||
|
|
1109
|
+
if (A2 || mr(2), oe2 < 256) n2[f2++] = oe2;
|
|
1110
1110
|
else if (oe2 == 256) {
|
|
1111
1111
|
ae2 = d2, p2 = null;
|
|
1112
1112
|
break;
|
|
1113
1113
|
} else {
|
|
1114
1114
|
var se2 = oe2 - 254;
|
|
1115
1115
|
if (oe2 > 264) {
|
|
1116
|
-
var E2 = oe2 - 257, N2 =
|
|
1117
|
-
se2 =
|
|
1116
|
+
var E2 = oe2 - 257, N2 = Kn[E2];
|
|
1117
|
+
se2 = lr(e2, d2, (1 << N2) - 1) + Zn[E2], d2 += N2;
|
|
1118
1118
|
}
|
|
1119
|
-
var ce2 = m2[
|
|
1120
|
-
ce2 ||
|
|
1121
|
-
var j2 =
|
|
1119
|
+
var ce2 = m2[ur(e2, d2) & M2], le2 = ce2 >> 4;
|
|
1120
|
+
ce2 || mr(3), d2 += ce2 & 15;
|
|
1121
|
+
var j2 = er[le2];
|
|
1122
1122
|
if (le2 > 3) {
|
|
1123
|
-
var N2 =
|
|
1124
|
-
j2 +=
|
|
1123
|
+
var N2 = qn[le2];
|
|
1124
|
+
j2 += ur(e2, d2) & (1 << N2) - 1, d2 += N2;
|
|
1125
1125
|
}
|
|
1126
1126
|
if (d2 > _2) {
|
|
1127
|
-
c2 &&
|
|
1127
|
+
c2 && mr(0);
|
|
1128
1128
|
break;
|
|
1129
1129
|
}
|
|
1130
1130
|
s2 && l2(f2 + 131072);
|
|
1131
1131
|
var ue2 = f2 + se2;
|
|
1132
1132
|
if (f2 < j2) {
|
|
1133
1133
|
var de2 = a2 - j2, fe2 = Math.min(j2, ue2);
|
|
1134
|
-
for (de2 + f2 < 0 &&
|
|
1134
|
+
for (de2 + f2 < 0 && mr(3); f2 < fe2; ++f2) n2[f2] = r2[de2 + f2];
|
|
1135
1135
|
}
|
|
1136
1136
|
for (; f2 < ue2; ++f2) n2[f2] = n2[f2 - j2];
|
|
1137
1137
|
}
|
|
1138
1138
|
}
|
|
1139
1139
|
t2.l = p2, t2.p = ae2, t2.b = f2, t2.f = u2, p2 && (u2 = 1, t2.m = h2, t2.d = m2, t2.n = g2);
|
|
1140
1140
|
} while (!u2);
|
|
1141
|
-
return f2 != n2.length && o2 ?
|
|
1141
|
+
return f2 != n2.length && o2 ? fr(n2, 0, f2) : n2.subarray(0, f2);
|
|
1142
1142
|
};
|
|
1143
|
-
var
|
|
1144
|
-
var
|
|
1145
|
-
(e2[0] != 31 || e2[1] != 139 || e2[2] != 8) &&
|
|
1143
|
+
var gr = new K(0);
|
|
1144
|
+
var _r = function(e2) {
|
|
1145
|
+
(e2[0] != 31 || e2[1] != 139 || e2[2] != 8) && mr(6, `invalid gzip data`);
|
|
1146
1146
|
var t2 = e2[3], n2 = 10;
|
|
1147
1147
|
t2 & 4 && (n2 += (e2[10] | e2[11] << 8) + 2);
|
|
1148
1148
|
for (var r2 = (t2 >> 3 & 1) + (t2 >> 4 & 1); r2 > 0; r2 -= !e2[n2++]) ;
|
|
1149
1149
|
return n2 + (t2 & 2);
|
|
1150
1150
|
};
|
|
1151
|
-
var
|
|
1151
|
+
var vr = function(e2) {
|
|
1152
1152
|
var t2 = e2.length;
|
|
1153
1153
|
return (e2[t2 - 4] | e2[t2 - 3] << 8 | e2[t2 - 2] << 16 | e2[t2 - 1] << 24) >>> 0;
|
|
1154
1154
|
};
|
|
1155
|
-
function
|
|
1156
|
-
var n2 =
|
|
1157
|
-
return n2 + 8 > e2.length &&
|
|
1155
|
+
function yr(e2, t2) {
|
|
1156
|
+
var n2 = _r(e2);
|
|
1157
|
+
return n2 + 8 > e2.length && mr(6, `invalid gzip data`), hr(e2.subarray(n2, -8), { i: 2 }, t2 && t2.out || new K(vr(e2)), t2 && t2.dictionary);
|
|
1158
1158
|
}
|
|
1159
|
-
var
|
|
1159
|
+
var br = typeof TextDecoder < `u` && new TextDecoder();
|
|
1160
1160
|
try {
|
|
1161
|
-
|
|
1161
|
+
br.decode(gr, { stream: true });
|
|
1162
1162
|
} catch {
|
|
1163
1163
|
}
|
|
1164
|
-
var
|
|
1165
|
-
var
|
|
1166
|
-
function
|
|
1164
|
+
var xr = /* @__PURE__ */ new Set([`APPOINTMENT`, `CLASS`, `COURSE`]);
|
|
1165
|
+
var Sr = new Set(cn);
|
|
1166
|
+
function J(e2) {
|
|
1167
1167
|
return typeof e2 == `string` ? e2 : void 0;
|
|
1168
1168
|
}
|
|
1169
|
-
function
|
|
1169
|
+
function Cr(e2) {
|
|
1170
1170
|
return typeof e2 == `number` && Number.isFinite(e2) ? e2 : void 0;
|
|
1171
1171
|
}
|
|
1172
|
-
function
|
|
1172
|
+
function wr(e2) {
|
|
1173
1173
|
return typeof e2 == `boolean` ? e2 : void 0;
|
|
1174
1174
|
}
|
|
1175
|
-
function
|
|
1175
|
+
function Tr(e2) {
|
|
1176
1176
|
if (Array.isArray(e2)) return e2.filter((e3) => typeof e3 == `string`);
|
|
1177
1177
|
}
|
|
1178
|
-
function
|
|
1178
|
+
function Er(e2) {
|
|
1179
1179
|
return typeof e2 == `object` && !!e2;
|
|
1180
1180
|
}
|
|
1181
|
-
function
|
|
1182
|
-
if (!
|
|
1183
|
-
let t2 =
|
|
1181
|
+
function Dr(e2) {
|
|
1182
|
+
if (!Er(e2)) return null;
|
|
1183
|
+
let t2 = J(e2.t);
|
|
1184
1184
|
if (t2 === void 0) return null;
|
|
1185
|
-
let n2 = { type: t2, ids:
|
|
1185
|
+
let n2 = { type: t2, ids: Tr(e2.d) ?? [] }, r2 = wr(e2.n);
|
|
1186
1186
|
return r2 !== void 0 && (n2.anyResource = r2), n2;
|
|
1187
1187
|
}
|
|
1188
|
-
function
|
|
1189
|
-
if (!
|
|
1190
|
-
let t2 =
|
|
1188
|
+
function Or(e2) {
|
|
1189
|
+
if (!Er(e2)) return null;
|
|
1190
|
+
let t2 = Cr(e2.p), n2 = Tr(e2.h);
|
|
1191
1191
|
if (t2 === void 0 && n2 === void 0) return null;
|
|
1192
1192
|
let r2 = {};
|
|
1193
1193
|
return t2 !== void 0 && (r2.numberOfParticipants = t2), n2 !== void 0 && (r2.choices = n2), r2;
|
|
1194
1194
|
}
|
|
1195
|
-
function
|
|
1196
|
-
if (!
|
|
1197
|
-
let t2 =
|
|
1195
|
+
function kr(e2) {
|
|
1196
|
+
if (!Er(e2)) return null;
|
|
1197
|
+
let t2 = J(e2.i), n2 = Cr(e2.q);
|
|
1198
1198
|
return t2 === void 0 || n2 === void 0 ? null : { id: t2, quantity: n2 };
|
|
1199
1199
|
}
|
|
1200
|
-
function
|
|
1200
|
+
function Ar(e2, t2) {
|
|
1201
1201
|
if (!Array.isArray(e2)) return;
|
|
1202
1202
|
let n2 = e2.map(t2).filter((e3) => e3 !== null);
|
|
1203
1203
|
return n2.length ? n2 : void 0;
|
|
1204
1204
|
}
|
|
1205
|
-
function
|
|
1206
|
-
if (!
|
|
1207
|
-
let t2 =
|
|
1205
|
+
function jr(e2) {
|
|
1206
|
+
if (!Er(e2)) return null;
|
|
1207
|
+
let t2 = J(e2.i);
|
|
1208
1208
|
if (t2 === void 0) return null;
|
|
1209
|
-
let n2 = { serviceId: t2 }, r2 =
|
|
1209
|
+
let n2 = { serviceId: t2 }, r2 = J(e2.g);
|
|
1210
1210
|
r2 !== void 0 && (n2.slug = r2);
|
|
1211
1211
|
let i2 = function(e3) {
|
|
1212
|
-
let t3 =
|
|
1213
|
-
if (t3 !== void 0 &&
|
|
1212
|
+
let t3 = J(e3);
|
|
1213
|
+
if (t3 !== void 0 && xr.has(t3)) return t3;
|
|
1214
1214
|
}(e2.y);
|
|
1215
1215
|
i2 !== void 0 && (n2.serviceType = i2);
|
|
1216
|
-
let a2 =
|
|
1216
|
+
let a2 = J(e2.t0);
|
|
1217
1217
|
a2 !== void 0 && (n2.slotStart = a2);
|
|
1218
|
-
let o2 =
|
|
1218
|
+
let o2 = J(e2.t1);
|
|
1219
1219
|
o2 !== void 0 && (n2.slotEnd = o2);
|
|
1220
|
-
let s2 =
|
|
1220
|
+
let s2 = J(e2.e);
|
|
1221
1221
|
s2 !== void 0 && (n2.eventId = s2);
|
|
1222
|
-
let c2 =
|
|
1222
|
+
let c2 = J(e2.c);
|
|
1223
1223
|
c2 !== void 0 && (n2.scheduleId = c2);
|
|
1224
|
-
let l2 =
|
|
1224
|
+
let l2 = J(e2.k);
|
|
1225
1225
|
l2 !== void 0 && (n2.sessionId = l2);
|
|
1226
|
-
let u2 =
|
|
1226
|
+
let u2 = J(e2.l);
|
|
1227
1227
|
u2 !== void 0 && (n2.locationId = u2);
|
|
1228
|
-
let d2 =
|
|
1228
|
+
let d2 = J(e2.lt);
|
|
1229
1229
|
d2 !== `BUSINESS` && d2 !== `CUSTOM` && d2 !== `CUSTOMER` || (n2.locationType = d2);
|
|
1230
|
-
let f2 =
|
|
1230
|
+
let f2 = Ar(e2.r, Dr);
|
|
1231
1231
|
f2 && (n2.resources = f2);
|
|
1232
|
-
let p2 =
|
|
1232
|
+
let p2 = Ar(e2.x, Or);
|
|
1233
1233
|
p2 && (n2.selectedVariants = p2);
|
|
1234
|
-
let m2 =
|
|
1234
|
+
let m2 = Ar(e2.a, kr);
|
|
1235
1235
|
m2 && (n2.addOns = m2);
|
|
1236
|
-
let h2 =
|
|
1236
|
+
let h2 = J(e2.dc);
|
|
1237
1237
|
h2 && (n2.durationChoiceId = h2);
|
|
1238
|
-
let g2 =
|
|
1238
|
+
let g2 = Cr(e2.dm);
|
|
1239
1239
|
g2 !== void 0 && Number.isInteger(g2) && g2 > 0 && (n2.durationInMinutes = g2);
|
|
1240
|
-
let _2 =
|
|
1241
|
-
return _2 !== void 0 &&
|
|
1240
|
+
let _2 = J(e2.rg);
|
|
1241
|
+
return _2 !== void 0 && Sr.has(_2) && (n2.requestedGender = _2), n2;
|
|
1242
1242
|
}
|
|
1243
|
-
function
|
|
1244
|
-
if (!
|
|
1245
|
-
let t2 =
|
|
1243
|
+
function Mr(e2) {
|
|
1244
|
+
if (!Er(e2)) return null;
|
|
1245
|
+
let t2 = J(e2.m);
|
|
1246
1246
|
if (t2 !== `single` && t2 !== `multi` || !Array.isArray(e2.s)) return null;
|
|
1247
|
-
let n2 = { mode: t2, services: e2.s.map(
|
|
1248
|
-
return r2 !== void 0 && (n2.timezone = r2), true ===
|
|
1247
|
+
let n2 = { mode: t2, services: e2.s.map(jr).filter((e3) => e3 !== null) }, r2 = J(e2.z);
|
|
1248
|
+
return r2 !== void 0 && (n2.timezone = r2), true === wr(e2.cp) && (n2.wantsPromoCode = true), n2;
|
|
1249
1249
|
}
|
|
1250
1250
|
new TextEncoder();
|
|
1251
|
-
var
|
|
1252
|
-
function
|
|
1251
|
+
var Nr = new TextDecoder();
|
|
1252
|
+
function Pr(e2) {
|
|
1253
1253
|
if (!e2 || e2.length < 2) return null;
|
|
1254
1254
|
try {
|
|
1255
|
-
let t2 = e2[0], n2 =
|
|
1255
|
+
let t2 = e2[0], n2 = Un.toUint8Array(e2.slice(1)), r2;
|
|
1256
1256
|
if (t2 === `1`) r2 = n2;
|
|
1257
1257
|
else {
|
|
1258
1258
|
if (t2 !== `2`) return null;
|
|
1259
|
-
r2 =
|
|
1259
|
+
r2 = yr(n2);
|
|
1260
1260
|
}
|
|
1261
|
-
return
|
|
1261
|
+
return Mr(JSON.parse(Nr.decode(r2)));
|
|
1262
1262
|
} catch {
|
|
1263
1263
|
return null;
|
|
1264
1264
|
}
|
|
1265
1265
|
}
|
|
1266
|
-
function
|
|
1266
|
+
function Fr(e2) {
|
|
1267
1267
|
return e2;
|
|
1268
1268
|
}
|
|
1269
|
-
var
|
|
1270
|
-
var
|
|
1271
|
-
var
|
|
1272
|
-
var
|
|
1273
|
-
var
|
|
1274
|
-
var
|
|
1275
|
-
var
|
|
1276
|
-
var
|
|
1277
|
-
var
|
|
1278
|
-
var
|
|
1269
|
+
var Ir = Fr(`@wix/site-service-editor-context`);
|
|
1270
|
+
var Lr = Fr(`@wix/site-service-pages`);
|
|
1271
|
+
var Rr = Fr(`@wix/site-service-router`);
|
|
1272
|
+
var zr = Fr(`@wix/site-service-url`);
|
|
1273
|
+
var Br = Fr(`@wix/site-service-renderer-configuration`);
|
|
1274
|
+
var Vr = `13d21c63-b5ec-5912-8397-c3a5ddb27a97`;
|
|
1275
|
+
var Hr = `shopping_cart`;
|
|
1276
|
+
var Ur = `thank_you_page`;
|
|
1277
|
+
var Wr = `1cd44cf8-756f-41c3-bd90-3e2ffcaf1155`;
|
|
1278
|
+
var Gr = function(e2) {
|
|
1279
1279
|
return e2.BOOK_ONLINE = `bookingsBookOnline`, e2.SERVICE_PAGE = `bookingsServicePage`, e2.CALENDAR_PAGE = `bookingsCalendar`, e2.FORM_PAGE = `bookingsForm`, e2;
|
|
1280
1280
|
}({});
|
|
1281
|
-
var
|
|
1282
|
-
var
|
|
1283
|
-
var
|
|
1284
|
-
var
|
|
1281
|
+
var Kr = `{{(.*?)}}`;
|
|
1282
|
+
var qr = `[{{}}]`;
|
|
1283
|
+
var Jr = `([^/]+)`;
|
|
1284
|
+
var Yr;
|
|
1285
1285
|
(function(e2) {
|
|
1286
1286
|
e2.product_page = `product_page`, e2.blog = `blog`, e2.post = `post`, e2.forum = `forum`, e2.group = `group`, e2.bookings = `Booking Service Page`, e2.challenges = `challenge_page`;
|
|
1287
|
-
})(
|
|
1288
|
-
var
|
|
1287
|
+
})(Yr ||= {});
|
|
1288
|
+
var Y;
|
|
1289
1289
|
(function(e2) {
|
|
1290
1290
|
e2.PRODUCT_PAGE = `wix.stores.sub_pages.product`, e2.BLOG_POST = `wix.blog.sub_pages.post`, e2.BLOG_POST_EDIT = `wix.blog.sub_pages.post.edit`, e2.BLOG_POST_PREVIEW = `wix.blog.sub_pages.post.preview`, e2.BLOG_CATEGORY = `wix.blog.sub_pages.category`, e2.FORUM_CATEGORY = `wix.forum.sub_pages.category`, e2.FORUM_CATEGORY_PAGINATION = `wix.forum.sub_pages.category.pagination`, e2.FORUM_CATEGORY_CREATE_POST = `wix.forum.sub_pages.category.create-post`, e2.FORUM_CATEGORY_CREATE_QUESTION = `wix.forum.sub_pages.category.create-question`, e2.FORUM_POST = `wix.forum.sub_pages.post`, e2.FORUM_POST_EDIT = `wix.forum.sub_pages.post.edit`, e2.FORUM_POST_PAGINATION = `wix.forum.sub_pages.post.pagination`, e2.FORUM_POST_DEEP_LINK_DATA = `wix.forum.sub_pages.post.deep-link-data`, e2.FORUM_POST_PAGINATION_AND_DEEP_LINK_DATA = `wix.forum.sub_pages.post.pagination-and-deep-link-data`, e2.GROUP = `wix.groups.sub_pages.group`, e2.GROUP_POST = `wix.groups.sub_pages.post`, e2.BOOKINGS_SERVICE = `wix.bookings.sub_pages.service_page`, e2.CHALLENGES_PAGE = `wix.online_programs.sub_pages.online_program`;
|
|
1291
|
-
})(
|
|
1292
|
-
var
|
|
1293
|
-
var
|
|
1294
|
-
var
|
|
1295
|
-
var
|
|
1296
|
-
var
|
|
1297
|
-
var
|
|
1298
|
-
var
|
|
1299
|
-
var
|
|
1300
|
-
var
|
|
1301
|
-
var ii;
|
|
1291
|
+
})(Y ||= {});
|
|
1292
|
+
var Xr = {};
|
|
1293
|
+
var Zr = (Xr[Y.PRODUCT_PAGE] = { variables: [`slug`], required: [`slug`] }, Xr);
|
|
1294
|
+
var Qr = `{{main-mapping}}`;
|
|
1295
|
+
var $r = {};
|
|
1296
|
+
var ei;
|
|
1297
|
+
var ti = ($r[Y.BLOG_POST] = { variables: [`slug`], required: [`slug`], subMappings: (ei = {}, ei[Y.BLOG_POST_EDIT] = { defaultMapping: `${Qr}/edit` }, ei[Y.BLOG_POST_PREVIEW] = { required: [`instance`], defaultMapping: `${Qr}/preview/{{instance}}` }, ei) }, $r);
|
|
1298
|
+
var ni = {};
|
|
1299
|
+
var ri = (ni[Y.BLOG_CATEGORY] = { variables: [`slug`], required: [`slug`], defaultPrefix: `categories` }, ni);
|
|
1300
|
+
var ii = {};
|
|
1302
1301
|
var ai;
|
|
1303
|
-
var oi
|
|
1304
|
-
var si = {};
|
|
1305
|
-
var ci =
|
|
1306
|
-
var li = {};
|
|
1307
|
-
var ui =
|
|
1308
|
-
var di = {};
|
|
1309
|
-
var fi =
|
|
1310
|
-
var pi = {};
|
|
1311
|
-
var mi =
|
|
1312
|
-
var hi =
|
|
1313
|
-
|
|
1302
|
+
var oi;
|
|
1303
|
+
var si = (ii[Y.FORUM_POST] = { variables: [`categorySlug`, `postSlug`], required: [`categorySlug`, `postSlug`], subMappings: (ai = {}, ai[Y.FORUM_POST_EDIT] = { defaultMapping: `${Qr}/edit` }, ai[Y.FORUM_POST_PAGINATION] = { required: [`page`], defaultMapping: `${Qr}/p-{{page}}` }, ai[Y.FORUM_POST_DEEP_LINK_DATA] = { required: [`deepLinkData`], defaultMapping: `${Qr}/dl-{{deepLinkData}}` }, ai[Y.FORUM_POST_PAGINATION_AND_DEEP_LINK_DATA] = { required: [`page`, `deepLinkData`], defaultMapping: `${Qr}/p-{{page}}/dl-{{deepLinkData}}` }, ai) }, ii[Y.FORUM_CATEGORY] = { variables: [`slug`], required: [`slug`], subMappings: (oi = {}, oi[Y.FORUM_CATEGORY_CREATE_POST] = { defaultMapping: `${Qr}/create-post` }, oi[Y.FORUM_CATEGORY_CREATE_QUESTION] = { defaultMapping: `${Qr}/create-question` }, oi[Y.FORUM_CATEGORY_PAGINATION] = { required: [`page`], defaultMapping: `${Qr}/p-{{page}}` }, oi) }, ii);
|
|
1304
|
+
var ci = {};
|
|
1305
|
+
var li = (ci[Y.GROUP] = { variables: [`groupId`, `tabName`], required: [`groupId`, `tabName`] }, ci[Y.GROUP_POST] = { variables: [`groupId`, `tabName`, `postId`], required: [`groupId`, `tabName`, `postId`] }, ci);
|
|
1306
|
+
var ui = {};
|
|
1307
|
+
var di = (ui[Y.BOOKINGS_SERVICE] = { variables: [`slug`], required: [`slug`], defaultPrefix: `service-page` }, ui);
|
|
1308
|
+
var fi = {};
|
|
1309
|
+
var pi = (fi[Y.CHALLENGES_PAGE] = { variables: [`slug`], required: [`slug`], defaultPrefix: `challenge-page` }, fi);
|
|
1310
|
+
var mi = {};
|
|
1311
|
+
var hi = (mi[Yr.product_page] = Zr, mi[Yr.post] = ti, mi[Yr.blog] = ri, mi[Yr.forum] = si, mi[Yr.group] = li, mi[Yr.bookings] = di, mi[Yr.challenges] = pi, mi);
|
|
1312
|
+
var gi = function() {
|
|
1313
|
+
return gi = Object.assign || function(e2) {
|
|
1314
1314
|
for (var t2, n2 = 1, r2 = arguments.length; n2 < r2; n2++) for (var i2 in t2 = arguments[n2], t2) Object.prototype.hasOwnProperty.call(t2, i2) && (e2[i2] = t2[i2]);
|
|
1315
1315
|
return e2;
|
|
1316
|
-
},
|
|
1316
|
+
}, gi.apply(this, arguments);
|
|
1317
1317
|
};
|
|
1318
|
-
function
|
|
1318
|
+
function _i(e2) {
|
|
1319
1319
|
var t2 = typeof Symbol == `function` && Symbol.iterator, n2 = t2 && e2[t2], r2 = 0;
|
|
1320
1320
|
if (n2) return n2.call(e2);
|
|
1321
1321
|
if (e2 && typeof e2.length == `number`) return { next: function() {
|
|
@@ -1323,7 +1323,7 @@ function gi(e2) {
|
|
|
1323
1323
|
} };
|
|
1324
1324
|
throw TypeError(t2 ? `Object is not iterable.` : `Symbol.iterator is not defined.`);
|
|
1325
1325
|
}
|
|
1326
|
-
function
|
|
1326
|
+
function X(e2, t2) {
|
|
1327
1327
|
var n2 = typeof Symbol == `function` && e2[Symbol.iterator];
|
|
1328
1328
|
if (!n2) return e2;
|
|
1329
1329
|
var r2 = n2.call(e2), i2, a2 = [], o2;
|
|
@@ -1340,190 +1340,190 @@ function Z(e2, t2) {
|
|
|
1340
1340
|
}
|
|
1341
1341
|
return a2;
|
|
1342
1342
|
}
|
|
1343
|
-
function
|
|
1343
|
+
function vi(e2, t2, n2) {
|
|
1344
1344
|
if (n2 || arguments.length === 2) for (var r2 = 0, i2 = t2.length, a2; r2 < i2; r2++) (a2 || !(r2 in t2)) && (a2 ||= Array.prototype.slice.call(t2, 0, r2), a2[r2] = t2[r2]);
|
|
1345
1345
|
return e2.concat(a2 || Array.prototype.slice.call(t2));
|
|
1346
1346
|
}
|
|
1347
|
-
var
|
|
1348
|
-
return Object.values(
|
|
1347
|
+
var yi = function(e2) {
|
|
1348
|
+
return Object.values(bi()).some(function(t2) {
|
|
1349
1349
|
return !!t2?.subMappings?.[e2];
|
|
1350
1350
|
});
|
|
1351
1351
|
};
|
|
1352
|
-
var
|
|
1353
|
-
return Object.values(
|
|
1354
|
-
return
|
|
1352
|
+
var bi = function() {
|
|
1353
|
+
return Object.values(hi).reduce(function(e2, t2) {
|
|
1354
|
+
return gi(gi({}, e2), t2);
|
|
1355
1355
|
}, {}) || {};
|
|
1356
1356
|
};
|
|
1357
|
-
var bi = function(e2) {
|
|
1358
|
-
var t2 = yi()[e2];
|
|
1359
|
-
return !t2 && vi(e2) && console.warn(`You cannot get variables schema for subMappings key (${e2}).`), t2;
|
|
1360
|
-
};
|
|
1361
1357
|
var xi = function(e2) {
|
|
1362
|
-
|
|
1363
|
-
|
|
1358
|
+
var t2 = bi()[e2];
|
|
1359
|
+
return !t2 && yi(e2) && console.warn(`You cannot get variables schema for subMappings key (${e2}).`), t2;
|
|
1360
|
+
};
|
|
1361
|
+
var Si = function(e2) {
|
|
1362
|
+
return Object.entries(hi).filter(function(t2) {
|
|
1363
|
+
var n2 = X(t2, 2)[1];
|
|
1364
1364
|
return Object.keys(n2).includes(e2);
|
|
1365
1365
|
}).map(function(e3) {
|
|
1366
|
-
return
|
|
1366
|
+
return X(e3, 1)[0];
|
|
1367
1367
|
})[0];
|
|
1368
1368
|
};
|
|
1369
|
-
var
|
|
1370
|
-
return Object.entries(
|
|
1371
|
-
var n2 =
|
|
1369
|
+
var Ci = function(e2) {
|
|
1370
|
+
return Object.entries(bi()).find(function(t2) {
|
|
1371
|
+
var n2 = X(t2, 2);
|
|
1372
1372
|
return n2[0], !!n2[1]?.subMappings?.[e2];
|
|
1373
1373
|
});
|
|
1374
1374
|
};
|
|
1375
|
-
var
|
|
1375
|
+
var wi = function(e2) {
|
|
1376
1376
|
var t2 = [];
|
|
1377
|
-
if (
|
|
1378
|
-
var n2 =
|
|
1377
|
+
if (yi(e2)) {
|
|
1378
|
+
var n2 = X(Ci(e2), 2);
|
|
1379
1379
|
n2[0];
|
|
1380
1380
|
var r2 = n2[1];
|
|
1381
|
-
t2.push.apply(t2,
|
|
1382
|
-
} else t2.push.apply(t2,
|
|
1381
|
+
t2.push.apply(t2, vi(vi([], X(r2?.required || []), false), X(r2?.subMappings?.[e2]?.required || []), false));
|
|
1382
|
+
} else t2.push.apply(t2, vi([], X(xi(e2)?.required || []), false));
|
|
1383
1383
|
return t2;
|
|
1384
1384
|
};
|
|
1385
|
-
var
|
|
1385
|
+
var Ti = function(e2, t2) {
|
|
1386
1386
|
var n2;
|
|
1387
1387
|
return t2 === void 0 && (t2 = ``), (n2 = e2?.main)?.find?.call(n2, function(e3) {
|
|
1388
1388
|
return e3.key === t2;
|
|
1389
1389
|
});
|
|
1390
1390
|
};
|
|
1391
|
-
var
|
|
1391
|
+
var Ei = function(e2, t2) {
|
|
1392
1392
|
return Error(`Url Mappings Error - [${e2}]: ${t2}`);
|
|
1393
1393
|
};
|
|
1394
|
-
var
|
|
1395
|
-
var
|
|
1396
|
-
var
|
|
1397
|
-
if (typeof e2 != `string` || !
|
|
1394
|
+
var Di = Object.values(Y);
|
|
1395
|
+
var Oi = Ei(`key`, `must be one of: ${Di.toString()}`);
|
|
1396
|
+
var ki = function(e2) {
|
|
1397
|
+
if (typeof e2 != `string` || !Di.includes(e2)) return Oi;
|
|
1398
1398
|
};
|
|
1399
|
-
var
|
|
1400
|
-
var
|
|
1399
|
+
var Ai = Ei(`itemData`, `must be on object with string as value, for example: { "slug": "shoes" }`);
|
|
1400
|
+
var ji = function(e2) {
|
|
1401
1401
|
if (typeof e2 != `object` || !e2 || !Object.values(e2).every(function(e3) {
|
|
1402
1402
|
return typeof e3 == `string`;
|
|
1403
|
-
}) || Array.isArray(e2)) return
|
|
1403
|
+
}) || Array.isArray(e2)) return Ai;
|
|
1404
1404
|
};
|
|
1405
|
-
var
|
|
1406
|
-
var
|
|
1405
|
+
var Mi = Ei(`itemData`, `must have required variables, for example: { "slug": "shoes" }`);
|
|
1406
|
+
var Ni = function(e2, t2) {
|
|
1407
1407
|
try {
|
|
1408
|
-
var n2 =
|
|
1408
|
+
var n2 = wi(e2);
|
|
1409
1409
|
if (!n2.every(function(e3) {
|
|
1410
1410
|
return !!t2[e3];
|
|
1411
1411
|
}) || !n2.length) throw Error();
|
|
1412
1412
|
} catch {
|
|
1413
|
-
return
|
|
1413
|
+
return Mi;
|
|
1414
1414
|
}
|
|
1415
1415
|
};
|
|
1416
|
-
var
|
|
1416
|
+
var Pi = function(e2) {
|
|
1417
1417
|
var t2 = e2.key, n2 = e2.itemData;
|
|
1418
|
-
return [
|
|
1418
|
+
return [ki(t2), ji(n2), Ni(t2, n2)].find(Boolean);
|
|
1419
1419
|
};
|
|
1420
|
-
var
|
|
1420
|
+
var Fi = function(e2) {
|
|
1421
1421
|
return function(t2) {
|
|
1422
|
-
var n2 = new RegExp(
|
|
1422
|
+
var n2 = new RegExp(qr, `g`), r2 = t2.replace(n2, ``);
|
|
1423
1423
|
return e2?.[r2];
|
|
1424
1424
|
};
|
|
1425
1425
|
};
|
|
1426
|
-
var
|
|
1426
|
+
var Ii = function(e2, t2, n2, r2) {
|
|
1427
1427
|
e2 === void 0 && (e2 = { main: [] }), r2 === void 0 && (r2 = {});
|
|
1428
|
-
var i2 =
|
|
1428
|
+
var i2 = Pi({ key: t2, itemData: n2 });
|
|
1429
1429
|
if (i2) throw i2;
|
|
1430
|
-
var a2 = (
|
|
1430
|
+
var a2 = (Ti(e2, t2) || {}).mapping, o2 = (r2 || {}).baseUrl;
|
|
1431
1431
|
if (o2 ??= ``, o2 = o2.endsWith(`/`) ? o2?.slice(0, -1) : o2, a2 && typeof a2 == `string`) {
|
|
1432
|
-
var s2 = new RegExp(
|
|
1432
|
+
var s2 = new RegExp(Kr, `g`), c2 = a2.replace(s2, Fi(n2));
|
|
1433
1433
|
return o2.concat(`/${c2}`);
|
|
1434
1434
|
}
|
|
1435
1435
|
};
|
|
1436
|
-
var
|
|
1437
|
-
var
|
|
1438
|
-
var t2 = e2.replace(
|
|
1436
|
+
var Li = /[.*+?^$()|]/g;
|
|
1437
|
+
var Ri = function(e2) {
|
|
1438
|
+
var t2 = e2.replace(Li, `\\$&`).replace(new RegExp(Kr, `g`), Jr);
|
|
1439
1439
|
return RegExp(`^${t2}$`);
|
|
1440
1440
|
};
|
|
1441
|
-
var
|
|
1441
|
+
var zi = function(e2, t2) {
|
|
1442
1442
|
return e2 === void 0 && (e2 = []), e2.find(function(e3) {
|
|
1443
|
-
return
|
|
1443
|
+
return Ri(e3).test(t2);
|
|
1444
1444
|
});
|
|
1445
1445
|
};
|
|
1446
|
-
|
|
1447
|
-
var
|
|
1446
|
+
Ei(`url`, `Url must be a string`);
|
|
1447
|
+
var Bi = function(e2) {
|
|
1448
1448
|
return [` `, ` `, `
|
|
1449
1449
|
`].every(function(t2) {
|
|
1450
1450
|
return !e2?.includes?.call(e2, t2);
|
|
1451
1451
|
});
|
|
1452
1452
|
};
|
|
1453
|
-
var Bi = function(e2) {
|
|
1454
|
-
return e2?.length <= Qi.MAX_URL_MAPPING_LENGTH;
|
|
1455
|
-
};
|
|
1456
1453
|
var Vi = function(e2) {
|
|
1454
|
+
return e2?.length <= $i.MAX_URL_MAPPING_LENGTH;
|
|
1455
|
+
};
|
|
1456
|
+
var Hi = function(e2) {
|
|
1457
1457
|
return e2?.split(`/`).every(Boolean);
|
|
1458
1458
|
};
|
|
1459
|
-
var
|
|
1459
|
+
var Ui = function(e2, t2) {
|
|
1460
1460
|
var n2 = t2.urlMappingKey;
|
|
1461
|
-
return
|
|
1461
|
+
return wi(n2)?.every(function(t3) {
|
|
1462
1462
|
return e2?.includes(`{{${t3}}}`);
|
|
1463
1463
|
});
|
|
1464
1464
|
};
|
|
1465
|
-
var Ui = function(e2) {
|
|
1466
|
-
return (e2.match(new RegExp(Gr, `g`))?.length || 0) <= 1;
|
|
1467
|
-
};
|
|
1468
1465
|
var Wi = function(e2) {
|
|
1469
|
-
return e2
|
|
1466
|
+
return (e2.match(new RegExp(Kr, `g`))?.length || 0) <= 1;
|
|
1470
1467
|
};
|
|
1471
1468
|
var Gi = function(e2) {
|
|
1469
|
+
return e2?.split(`/`).every(Wi);
|
|
1470
|
+
};
|
|
1471
|
+
var Ki = function(e2) {
|
|
1472
1472
|
return [e2.publishedPrefix, e2.savedPrefix].filter(Boolean);
|
|
1473
1473
|
};
|
|
1474
|
-
var
|
|
1474
|
+
var qi = function(e2, t2) {
|
|
1475
1475
|
return t2 === void 0 && (t2 = []), function(n2, r2) {
|
|
1476
1476
|
var i2 = n2.split(`/`), a2 = n2 === r2;
|
|
1477
1477
|
if (i2.length < 1 || a2) return true;
|
|
1478
|
-
var o2 =
|
|
1478
|
+
var o2 = X(r2.split(`/`), 1)[0], s2 = X(i2, 1)[0];
|
|
1479
1479
|
return t2.includes(s2) ? true : e2.every(function(e3) {
|
|
1480
1480
|
return e3 === o2 || e3 !== s2;
|
|
1481
1481
|
});
|
|
1482
1482
|
};
|
|
1483
1483
|
};
|
|
1484
|
-
var
|
|
1484
|
+
var Ji = function(e2, t2) {
|
|
1485
1485
|
var n2 = t2.pathPrefixes;
|
|
1486
|
-
return
|
|
1486
|
+
return qi(Object.values(n2).map(function(e3) {
|
|
1487
1487
|
return e3.publishedPrefix;
|
|
1488
|
-
}).filter(Boolean),
|
|
1488
|
+
}).filter(Boolean), Ki(t2.pathPrefix))(e2, t2.defaultMapping.defaultPublished);
|
|
1489
1489
|
};
|
|
1490
|
-
var
|
|
1490
|
+
var Yi = function(e2, t2) {
|
|
1491
1491
|
var n2 = t2.urlMappingKey, r2 = t2.urlMappings;
|
|
1492
|
-
return !
|
|
1492
|
+
return !zi(r2.main?.filter(function(e3) {
|
|
1493
1493
|
return n2 !== e3.key;
|
|
1494
1494
|
}).map(function(e3) {
|
|
1495
1495
|
return e3.mapping;
|
|
1496
1496
|
}), e2);
|
|
1497
1497
|
};
|
|
1498
|
-
var
|
|
1499
|
-
e2 = e2.replace(new RegExp(
|
|
1498
|
+
var Xi = function(e2) {
|
|
1499
|
+
e2 = e2.replace(new RegExp(Kr, `ig`), ``);
|
|
1500
1500
|
var t2 = new RegExp(/[^\]_.~!*'();:@&=+$,<>\\#^%?`"]/, `g`), n2 = !/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|[\ud83c[\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|[\ud83c[\ude32-\ude3a]|[\ud83c[\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])/g.test(e2), r2 = !e2.replace(t2, ``);
|
|
1501
1501
|
return n2 && r2;
|
|
1502
1502
|
};
|
|
1503
|
-
var
|
|
1504
|
-
var t2 =
|
|
1503
|
+
var Zi = function(e2) {
|
|
1504
|
+
var t2 = X(e2, 1)[0], n2 = e2.slice(-1);
|
|
1505
1505
|
return t2 !== `/` && n2 !== `/`;
|
|
1506
1506
|
};
|
|
1507
|
-
var
|
|
1507
|
+
var Qi = function(e2, t2) {
|
|
1508
1508
|
var n2 = t2.pathPrefixes;
|
|
1509
|
-
return
|
|
1509
|
+
return qi(Object.values(n2).map(function(e3) {
|
|
1510
1510
|
return e3.savedPrefix;
|
|
1511
|
-
}).filter(Boolean),
|
|
1511
|
+
}).filter(Boolean), Ki(t2.pathPrefix))(e2, t2.defaultMapping.defaultSaved);
|
|
1512
1512
|
};
|
|
1513
|
-
var
|
|
1513
|
+
var Z;
|
|
1514
1514
|
(function(e2) {
|
|
1515
1515
|
e2.MAX_LENGTH_ERROR = `MAX_LENGTH_ERROR`, e2.NO_SPACES_ERROR = `NO_SPACES_ERROR`, e2.NO_EMPTY_SEGMENT_ERROR = `NO_EMPTY_SEGMENT_ERROR`, e2.CONTAIN_MAIN_VARIABLE_ERROR = `CONTAIN_MAIN_VARIABLE_ERROR`, e2.ONLY_ONE_VARIABLE_PER_SEGMENT_ERROR = `ONLY_ONE_VARIABLE_PER_SEGMENT_ERROR`, e2.ONLY_UNIQUE_PUBLISHED_URL_ERROR = `ONLY_UNIQUE_PUBLISHED_URL_ERROR`, e2.ONLY_UNIQUE_SAVED_URL_ERROR = `ONLY_UNIQUE_SAVED_URL_ERROR`, e2.ONLY_UNIQUE_MAPPING_ERROR = `ONLY_UNIQUE_MAPPING_ERROR`, e2.NO_INVALID_CHARACTERS_ERROR = `NO_INVALID_CHARACTERS_ERROR`, e2.NO_STARTING_OR_ENDING_SLASH_ERROR = `NO_STARTING_OR_ENDING_SLASH_ERROR`;
|
|
1516
|
-
})(
|
|
1517
|
-
var
|
|
1516
|
+
})(Z ||= {});
|
|
1517
|
+
var $i = function() {
|
|
1518
1518
|
function e2(e3) {
|
|
1519
1519
|
var t2 = e3.urlMappingKey, n2 = e3.pathPrefixes, r2 = e3.urlMappings, i2 = this;
|
|
1520
1520
|
this.initValidators = function() {
|
|
1521
|
-
i2.validators = [[
|
|
1522
|
-
}, this.urlMappings = r2, this.pathPrefixes = n2, this.urlMappingKey = t2, this.pathPrefix = this.getPathPrefix(), this.defaultMapping =
|
|
1521
|
+
i2.validators = [[Vi, Z.MAX_LENGTH_ERROR], [Bi, Z.NO_SPACES_ERROR], [Zi, Z.NO_STARTING_OR_ENDING_SLASH_ERROR], [Hi, Z.NO_EMPTY_SEGMENT_ERROR], [Xi, Z.NO_INVALID_CHARACTERS_ERROR], [Ui, Z.CONTAIN_MAIN_VARIABLE_ERROR], [Gi, Z.ONLY_ONE_VARIABLE_PER_SEGMENT_ERROR], [Ji, Z.ONLY_UNIQUE_PUBLISHED_URL_ERROR], [Qi, Z.ONLY_UNIQUE_SAVED_URL_ERROR], [Yi, Z.ONLY_UNIQUE_MAPPING_ERROR]];
|
|
1522
|
+
}, this.urlMappings = r2, this.pathPrefixes = n2, this.urlMappingKey = t2, this.pathPrefix = this.getPathPrefix(), this.defaultMapping = ea(t2, this.pathPrefix), this.initValidators();
|
|
1523
1523
|
}
|
|
1524
1524
|
return e2.prototype.getPathPrefix = function() {
|
|
1525
|
-
var t2 =
|
|
1526
|
-
if (!t2) throw
|
|
1525
|
+
var t2 = Si(this.urlMappingKey);
|
|
1526
|
+
if (!t2) throw yi(this.urlMappingKey) ? Error(`Url Mapper Validator Error: Validator does not support sub mapping, please use the main url mapping key`) : Error(`Url Mapper Validator Error: Url mapping key is not supported (${this.urlMappingKey})`);
|
|
1527
1527
|
return this.pathPrefixes[t2] || e2.FALLBACK_PATH_PREFIX;
|
|
1528
1528
|
}, Object.defineProperty(e2.prototype, "validatorProps", { get: function() {
|
|
1529
1529
|
var e3 = this;
|
|
@@ -1531,8 +1531,8 @@ var Qi = function() {
|
|
|
1531
1531
|
}, enumerable: false, configurable: true }), e2.prototype.validate = function(e3) {
|
|
1532
1532
|
var t2, n2;
|
|
1533
1533
|
try {
|
|
1534
|
-
for (var r2 =
|
|
1535
|
-
var a2 =
|
|
1534
|
+
for (var r2 = _i(this.validators), i2 = r2.next(); !i2.done; i2 = r2.next()) {
|
|
1535
|
+
var a2 = X(i2.value, 2), o2 = a2[0], s2 = a2[1], c2 = !!o2(e3, this.validatorProps);
|
|
1536
1536
|
if (!c2) return { isValid: c2, error: s2 };
|
|
1537
1537
|
}
|
|
1538
1538
|
} catch (e4) {
|
|
@@ -1545,251 +1545,254 @@ var Qi = function() {
|
|
|
1545
1545
|
}
|
|
1546
1546
|
}
|
|
1547
1547
|
return { isValid: true };
|
|
1548
|
-
}, e2.errorArray = Object.values(
|
|
1548
|
+
}, e2.errorArray = Object.values(Z), e2.MAX_URL_MAPPING_LENGTH = 1e3, e2.FALLBACK_PATH_PREFIX = `unknown`, e2;
|
|
1549
1549
|
}();
|
|
1550
|
-
var
|
|
1551
|
-
var n2 =
|
|
1552
|
-
return t2 && typeof t2 == `object` ? (a2.savedPrefix = t2.savedPrefix ?? ``, a2.publishedPrefix = t2.publishedPrefix ?? ``) : (a2.savedPrefix =
|
|
1550
|
+
var ea = function(e2, t2) {
|
|
1551
|
+
var n2 = bi()[e2] || { required: [`slug`] }, r2 = n2.required, i2 = n2.defaultPrefix, a2 = {};
|
|
1552
|
+
return t2 && typeof t2 == `object` ? (a2.savedPrefix = t2.savedPrefix ?? ``, a2.publishedPrefix = t2.publishedPrefix ?? ``) : (a2.savedPrefix = $i.FALLBACK_PATH_PREFIX, a2.publishedPrefix = $i.FALLBACK_PATH_PREFIX), { defaultSaved: vi([a2.savedPrefix, i2], X(r2?.map(function(e3) {
|
|
1553
1553
|
return `{{${e3}}}`;
|
|
1554
|
-
})), false).filter(Boolean).join(`/`), defaultPublished:
|
|
1554
|
+
})), false).filter(Boolean).join(`/`), defaultPublished: vi([a2.publishedPrefix, i2], X(r2?.map(function(e3) {
|
|
1555
1555
|
return `{{${e3}}}`;
|
|
1556
1556
|
})), false).filter(Boolean).join(`/`) };
|
|
1557
1557
|
};
|
|
1558
|
-
function
|
|
1559
|
-
return t2 ?
|
|
1558
|
+
function ta(e2, t2) {
|
|
1559
|
+
return t2 ? Ii(e2, Y.BOOKINGS_SERVICE, { slug: t2 }, { baseUrl: `` }) : void 0;
|
|
1560
1560
|
}
|
|
1561
|
-
var
|
|
1562
|
-
var
|
|
1563
|
-
function
|
|
1564
|
-
return
|
|
1561
|
+
var na = [{ path: `bookingPolicyViolations.earliestBookingDate` }];
|
|
1562
|
+
var ra = [{ path: `timeSlots.bookingPolicyViolations.earliestBookingDate` }];
|
|
1563
|
+
function ia(e2) {
|
|
1564
|
+
return V(Object.assign(e2, { domainToMappings: { "www.wixapis.com": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], "*.dev.wix-code.com": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], "manage._base_domain_": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }], "www._base_domain_": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], _: [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "editor._base_domain_": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "blocks._base_domain_": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "create.editorx": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "editor.wixapps.net": [{ srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }] } }));
|
|
1565
1565
|
}
|
|
1566
|
-
var
|
|
1567
|
-
function
|
|
1566
|
+
var aa = `@wix/auto_sdk_bookings_availability-time-slots`;
|
|
1567
|
+
function oa(e2) {
|
|
1568
1568
|
function t2({ host: t3 }) {
|
|
1569
|
-
let n2 =
|
|
1570
|
-
return { entityFqdn: `wix.bookings.availability.v2.time_slot`, method: `POST`, methodFqn: `com.wixpress.bookings.availability.v2.AvailabilityTimeSlots.ListAvailabilityTimeSlots`, packageName:
|
|
1569
|
+
let n2 = z(e2, [{ transformFn: Ue, paths: na }]);
|
|
1570
|
+
return { entityFqdn: `wix.bookings.availability.v2.time_slot`, method: `POST`, methodFqn: `com.wixpress.bookings.availability.v2.AvailabilityTimeSlots.ListAvailabilityTimeSlots`, packageName: aa, migrationOptions: { optInTransformResponse: true }, url: ia({ protoPath: `/v2/time-slots`, data: n2, host: t3 }), data: n2, transformResponse: (e3) => z(e3, [{ transformFn: We, paths: ra }]) };
|
|
1571
1571
|
}
|
|
1572
1572
|
return t2;
|
|
1573
1573
|
}
|
|
1574
|
-
async function
|
|
1575
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 =
|
|
1574
|
+
async function sa(e2) {
|
|
1575
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = oa(He({ serviceId: e2?.serviceId, fromLocalDate: e2?.fromLocalDate, toLocalDate: e2?.toLocalDate, timeZone: e2?.timeZone, locations: e2?.locations, includeResourceTypeIds: e2?.includeResourceTypeIds, bookable: e2?.bookable, bookingPolicyViolations: e2?.bookingPolicyViolations, timeSlotsPerDay: e2?.timeSlotsPerDay, cursorPaging: e2?.cursorPaging, customerChoices: e2?.customerChoices, resourceTypes: e2?.resourceTypes }));
|
|
1576
1576
|
n2?.onSiteCall?.();
|
|
1577
1577
|
try {
|
|
1578
1578
|
let e3 = await t2.request(r2);
|
|
1579
|
-
return n2?.onSuccess?.(e3),
|
|
1579
|
+
return n2?.onSuccess?.(e3), L(e3.data);
|
|
1580
1580
|
} catch (e3) {
|
|
1581
|
-
let t3 =
|
|
1581
|
+
let t3 = ut(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { serviceId: `$[0].serviceId`, fromLocalDate: `$[0].fromLocalDate`, toLocalDate: `$[0].toLocalDate`, timeZone: `$[0].timeZone`, locations: `$[0].locations`, includeResourceTypeIds: `$[0].includeResourceTypeIds`, bookable: `$[0].bookable`, bookingPolicyViolations: `$[0].bookingPolicyViolations`, timeSlotsPerDay: `$[0].timeSlotsPerDay`, cursorPaging: `$[0].cursorPaging`, customerChoices: `$[0].customerChoices`, resourceTypes: `$[0].resourceTypes` }, singleArgumentUnchanged: false }, [`options`]);
|
|
1582
1582
|
throw n2?.onError?.(e3), t3;
|
|
1583
1583
|
}
|
|
1584
1584
|
}
|
|
1585
|
-
function
|
|
1586
|
-
return (t2) =>
|
|
1585
|
+
function ca(e2) {
|
|
1586
|
+
return (t2) => sa(t2, { httpClient: e2 });
|
|
1587
1587
|
}
|
|
1588
|
-
var
|
|
1589
|
-
var
|
|
1590
|
-
var
|
|
1591
|
-
function
|
|
1592
|
-
return
|
|
1588
|
+
var la = xt(ca);
|
|
1589
|
+
var ua = [{ path: `bookingPolicyViolations.earliestBookingDate` }];
|
|
1590
|
+
var da = [{ path: `timeSlots.bookingPolicyViolations.earliestBookingDate` }, { path: `schedulesInfo.firstSessionStart` }, { path: `schedulesInfo.lastSessionEnd` }, { path: `schedulesInfo.enrollmentViolations.earliestBookingDate` }];
|
|
1591
|
+
function fa(e2) {
|
|
1592
|
+
return V(Object.assign(e2, { domainToMappings: { "www.wixapis.com": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], "*.dev.wix-code.com": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], "manage._base_domain_": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }], "www._base_domain_": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], _: [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "editor._base_domain_": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "blocks._base_domain_": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "create.editorx": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "editor.wixapps.net": [{ srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }] } }));
|
|
1593
1593
|
}
|
|
1594
|
-
var
|
|
1595
|
-
function
|
|
1594
|
+
var pa = `@wix/auto_sdk_bookings_event-time-slots`;
|
|
1595
|
+
function ma(e2) {
|
|
1596
1596
|
function t2({ host: t3 }) {
|
|
1597
|
-
let n2 =
|
|
1598
|
-
return { entityFqdn: `wix.bookings.availability.v2.time_slot`, method: `POST`, methodFqn: `com.wixpress.bookings.availability.v2.EventTimeSlots.ListEventTimeSlots`, packageName:
|
|
1597
|
+
let n2 = z(e2, [{ transformFn: Ue, paths: ua }]);
|
|
1598
|
+
return { entityFqdn: `wix.bookings.availability.v2.time_slot`, method: `POST`, methodFqn: `com.wixpress.bookings.availability.v2.EventTimeSlots.ListEventTimeSlots`, packageName: pa, migrationOptions: { optInTransformResponse: true }, url: fa({ protoPath: `/v2/time-slots/event`, data: n2, host: t3 }), data: n2, transformResponse: (e3) => z(e3, [{ transformFn: We, paths: da }]) };
|
|
1599
1599
|
}
|
|
1600
1600
|
return t2;
|
|
1601
1601
|
}
|
|
1602
|
-
async function
|
|
1603
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 =
|
|
1602
|
+
async function ha(e2) {
|
|
1603
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = ma(He({ fromLocalDate: e2?.fromLocalDate, toLocalDate: e2?.toLocalDate, timeZone: e2?.timeZone, serviceIds: e2?.serviceIds, includeNonBookable: e2?.includeNonBookable, minBookableCapacity: e2?.minBookableCapacity, eventFilter: e2?.eventFilter, maxSlotsPerDay: e2?.maxSlotsPerDay, cursorPaging: e2?.cursorPaging, bookingPolicyViolations: e2?.bookingPolicyViolations }));
|
|
1604
1604
|
n2?.onSiteCall?.();
|
|
1605
1605
|
try {
|
|
1606
1606
|
let e3 = await t2.request(r2);
|
|
1607
|
-
return n2?.onSuccess?.(e3),
|
|
1607
|
+
return n2?.onSuccess?.(e3), L(e3.data);
|
|
1608
1608
|
} catch (e3) {
|
|
1609
|
-
let t3 =
|
|
1609
|
+
let t3 = ut(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { fromLocalDate: `$[0].fromLocalDate`, toLocalDate: `$[0].toLocalDate`, timeZone: `$[0].timeZone`, serviceIds: `$[0].serviceIds`, includeNonBookable: `$[0].includeNonBookable`, minBookableCapacity: `$[0].minBookableCapacity`, eventFilter: `$[0].eventFilter`, maxSlotsPerDay: `$[0].maxSlotsPerDay`, cursorPaging: `$[0].cursorPaging`, bookingPolicyViolations: `$[0].bookingPolicyViolations` }, singleArgumentUnchanged: false }, [`options`]);
|
|
1610
1610
|
throw n2?.onError?.(e3), t3;
|
|
1611
1611
|
}
|
|
1612
1612
|
}
|
|
1613
|
-
function
|
|
1614
|
-
return (t2) =>
|
|
1613
|
+
function ga(e2) {
|
|
1614
|
+
return (t2) => ha(t2, { httpClient: e2 });
|
|
1615
1615
|
}
|
|
1616
|
-
var
|
|
1617
|
-
var
|
|
1618
|
-
var
|
|
1619
|
-
function
|
|
1620
|
-
return
|
|
1616
|
+
var _a = xt(ga);
|
|
1617
|
+
var va = [{ path: `bookingPolicyViolations.earliestBookingDate` }];
|
|
1618
|
+
var ya = [{ path: `timeSlots.bookingPolicyViolations.earliestBookingDate` }];
|
|
1619
|
+
function ba(e2) {
|
|
1620
|
+
return V(Object.assign(e2, { domainToMappings: { "www.wixapis.com": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], "*.dev.wix-code.com": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], "manage._base_domain_": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }], "www._base_domain_": [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }], _: [{ srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "editor._base_domain_": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "blocks._base_domain_": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "create.editorx": [{ srcPath: `/_api/service-availability/v2/multi-service-time-slots`, destPath: `/v2/multi-service-time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots`, destPath: `/v2/time-slots` }, { srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }], "editor.wixapps.net": [{ srcPath: `/_api/service-availability/v2/time-slots/event`, destPath: `/v2/time-slots/event` }] } }));
|
|
1621
1621
|
}
|
|
1622
|
-
var
|
|
1623
|
-
function
|
|
1622
|
+
var xa = `@wix/auto_sdk_bookings_multi-service-availability-time-slots`;
|
|
1623
|
+
function Sa(e2) {
|
|
1624
1624
|
function t2({ host: t3 }) {
|
|
1625
|
-
let n2 =
|
|
1626
|
-
return { entityFqdn: `wix.bookings.availability.v2.time_slot`, method: `POST`, methodFqn: `com.wixpress.bookings.availability.v2.MultiServiceAvailabilityTimeSlots.ListMultiServiceAvailabilityTimeSlots`, packageName:
|
|
1625
|
+
let n2 = z(e2, [{ transformFn: Ue, paths: va }]);
|
|
1626
|
+
return { entityFqdn: `wix.bookings.availability.v2.time_slot`, method: `POST`, methodFqn: `com.wixpress.bookings.availability.v2.MultiServiceAvailabilityTimeSlots.ListMultiServiceAvailabilityTimeSlots`, packageName: xa, migrationOptions: { optInTransformResponse: true }, url: ba({ protoPath: `/v2/multi-service-time-slots`, data: n2, host: t3 }), data: n2, transformResponse: (e3) => z(e3, [{ transformFn: We, paths: ya }]) };
|
|
1627
1627
|
}
|
|
1628
1628
|
return t2;
|
|
1629
1629
|
}
|
|
1630
|
-
async function
|
|
1631
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 =
|
|
1630
|
+
async function Ca(e2) {
|
|
1631
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = Sa(He({ services: e2?.services, fromLocalDate: e2?.fromLocalDate, toLocalDate: e2?.toLocalDate, timeZone: e2?.timeZone, location: e2?.location, bookable: e2?.bookable, bookingPolicyViolations: e2?.bookingPolicyViolations, timeSlotsPerDay: e2?.timeSlotsPerDay, cursorPaging: e2?.cursorPaging }));
|
|
1632
1632
|
n2?.onSiteCall?.();
|
|
1633
1633
|
try {
|
|
1634
1634
|
let e3 = await t2.request(r2);
|
|
1635
|
-
return n2?.onSuccess?.(e3),
|
|
1635
|
+
return n2?.onSuccess?.(e3), L(e3.data);
|
|
1636
1636
|
} catch (e3) {
|
|
1637
|
-
let t3 =
|
|
1637
|
+
let t3 = ut(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { services: `$[0].services`, fromLocalDate: `$[0].fromLocalDate`, toLocalDate: `$[0].toLocalDate`, timeZone: `$[0].timeZone`, location: `$[0].location`, bookable: `$[0].bookable`, bookingPolicyViolations: `$[0].bookingPolicyViolations`, timeSlotsPerDay: `$[0].timeSlotsPerDay`, cursorPaging: `$[0].cursorPaging` }, singleArgumentUnchanged: false }, [`options`]);
|
|
1638
1638
|
throw n2?.onError?.(e3), t3;
|
|
1639
1639
|
}
|
|
1640
1640
|
}
|
|
1641
|
-
function
|
|
1642
|
-
return (t2) =>
|
|
1643
|
-
}
|
|
1644
|
-
var wa = bt(Ca);
|
|
1645
|
-
var Ta = ((e2) => (e2.UNKNOWN = `UNKNOWN`, e2.CUSTOM = `CUSTOM`, e2.STAFF_MEMBER = `STAFF_MEMBER`, e2.DURATION = `DURATION`, e2.DATE_TIME = `DATE_TIME`, e2.NUMBER_OF_PARTICIPANTS = `NUMBER_OF_PARTICIPANTS`, e2.LOCATION = `LOCATION`, e2.DURATION_RANGE = `DURATION_RANGE`, e2))(Ta || {});
|
|
1646
|
-
var Ea = ((e2) => (e2.APPOINTMENT = `APPOINTMENT`, e2.CLASS = `CLASS`, e2.COURSE = `COURSE`, e2))(Ea || {});
|
|
1647
|
-
var Da = ((e2) => (e2.CUSTOM = `CUSTOM`, e2.BUSINESS = `BUSINESS`, e2.CUSTOMER = `CUSTOMER`, e2))(Da || {});
|
|
1648
|
-
var Oa = [{ path: `timeSlotsConfiguration.createdDate` }, { path: `timeSlotsConfiguration.updatedDate` }];
|
|
1649
|
-
function ka(e2) {
|
|
1650
|
-
return H(Object.assign(e2, { domainToMappings: { _: [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "manage._base_domain_": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "editor._base_domain_": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "blocks._base_domain_": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "create.editorx": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "apps._base_domain_": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "*.dev.wix-code.com": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/_api/time-slots-config`, destPath: `` }] } }));
|
|
1641
|
+
function wa(e2) {
|
|
1642
|
+
return (t2) => Ca(t2, { httpClient: e2 });
|
|
1651
1643
|
}
|
|
1652
|
-
var
|
|
1644
|
+
var Ta = xt(wa);
|
|
1645
|
+
var Ea = ((e2) => (e2.UNKNOWN = `UNKNOWN`, e2.CUSTOM = `CUSTOM`, e2.STAFF_MEMBER = `STAFF_MEMBER`, e2.DURATION = `DURATION`, e2.DATE_TIME = `DATE_TIME`, e2.NUMBER_OF_PARTICIPANTS = `NUMBER_OF_PARTICIPANTS`, e2.LOCATION = `LOCATION`, e2.DURATION_RANGE = `DURATION_RANGE`, e2))(Ea || {});
|
|
1646
|
+
var Da = ((e2) => (e2.APPOINTMENT = `APPOINTMENT`, e2.CLASS = `CLASS`, e2.COURSE = `COURSE`, e2))(Da || {});
|
|
1647
|
+
var Oa = ((e2) => (e2.FIXED = `FIXED`, e2.CUSTOM = `CUSTOM`, e2.VARIED = `VARIED`, e2.NO_FEE = `NO_FEE`, e2.SUBSCRIPTION = `SUBSCRIPTION`, e2))(Oa || {});
|
|
1648
|
+
var ka = ((e2) => (e2.CUSTOM = `CUSTOM`, e2.BUSINESS = `BUSINESS`, e2.CUSTOMER = `CUSTOMER`, e2))(ka || {});
|
|
1649
|
+
var Aa = [{ path: `timeSlotsConfiguration.createdDate` }, { path: `timeSlotsConfiguration.updatedDate` }];
|
|
1653
1650
|
function ja(e2) {
|
|
1651
|
+
return V(Object.assign(e2, { domainToMappings: { _: [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "manage._base_domain_": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "editor._base_domain_": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "blocks._base_domain_": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "create.editorx": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "apps._base_domain_": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "*.dev.wix-code.com": [{ srcPath: `/_api/time-slots-config`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/_api/time-slots-config`, destPath: `` }] } }));
|
|
1652
|
+
}
|
|
1653
|
+
var Ma = `@wix/auto_sdk_bookings_time-slots-configuration`;
|
|
1654
|
+
function Na(e2) {
|
|
1654
1655
|
function t2({ host: t3 }) {
|
|
1655
|
-
return { entityFqdn: `wix.bookings.timeslots_configuration.v1.time_slots_configuration`, method: `GET`, methodFqn: `wix.bookings.timeslots.configuration.v1.TimeSlotsConfigurationService.GetTimeSlotsConfigurationByAppId`, packageName:
|
|
1656
|
+
return { entityFqdn: `wix.bookings.timeslots_configuration.v1.time_slots_configuration`, method: `GET`, methodFqn: `wix.bookings.timeslots.configuration.v1.TimeSlotsConfigurationService.GetTimeSlotsConfigurationByAppId`, packageName: Ma, migrationOptions: { optInTransformResponse: true }, url: ja({ protoPath: `/v1/time-slots-configurations/app/{appId}`, data: e2, host: t3 }), params: St(e2), transformResponse: (e3) => z(e3, [{ transformFn: We, paths: Aa }]) };
|
|
1656
1657
|
}
|
|
1657
1658
|
return t2;
|
|
1658
1659
|
}
|
|
1659
|
-
async function
|
|
1660
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 =
|
|
1660
|
+
async function Pa(e2) {
|
|
1661
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = Na(He({ appId: e2 }));
|
|
1661
1662
|
n2?.onSiteCall?.();
|
|
1662
1663
|
try {
|
|
1663
1664
|
let e3 = await t2.request(r2);
|
|
1664
|
-
return n2?.onSuccess?.(e3),
|
|
1665
|
+
return n2?.onSuccess?.(e3), L(e3.data);
|
|
1665
1666
|
} catch (e3) {
|
|
1666
|
-
let t3 =
|
|
1667
|
+
let t3 = ut(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { appId: `$[0]` }, singleArgumentUnchanged: false }, [`appId`]);
|
|
1667
1668
|
throw n2?.onError?.(e3), t3;
|
|
1668
1669
|
}
|
|
1669
1670
|
}
|
|
1670
|
-
function
|
|
1671
|
-
return (t2) =>
|
|
1671
|
+
function Fa(e2) {
|
|
1672
|
+
return (t2) => Pa(t2, { httpClient: e2 });
|
|
1672
1673
|
}
|
|
1673
|
-
var
|
|
1674
|
-
var
|
|
1675
|
-
var
|
|
1676
|
-
function La(e2) {
|
|
1677
|
-
return H(Object.assign(e2, { domainToMappings: { "manage._base_domain_": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "dev._base_domain_": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "*.dev.wix-code.com": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], _: [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "api._api_base_domain_": [{ srcPath: `/bookings-settings`, destPath: `` }], "editor._base_domain_": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "blocks._base_domain_": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "create.editorx": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "editor.wixapps.net": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "www._base_domain_": [{ srcPath: `/_api/bookings-settings`, destPath: `` }] } }));
|
|
1678
|
-
}
|
|
1679
|
-
var Ra = `@wix/auto_sdk_bookings_bookings-settings`;
|
|
1674
|
+
var Ia = xt(Fa);
|
|
1675
|
+
var La = [{ path: `bookingsSettings.createdDate` }, { path: `bookingsSettings.updatedDate` }];
|
|
1676
|
+
var Ra = [{ path: `bookingsSettings.siteProperties.address.coordinates.latitude` }, { path: `bookingsSettings.siteProperties.address.coordinates.longitude` }];
|
|
1680
1677
|
function za(e2) {
|
|
1678
|
+
return V(Object.assign(e2, { domainToMappings: { "manage._base_domain_": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "dev._base_domain_": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "*.dev.wix-code.com": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], _: [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "api._api_base_domain_": [{ srcPath: `/bookings-settings`, destPath: `` }], "editor._base_domain_": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "blocks._base_domain_": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "create.editorx": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "editor.wixapps.net": [{ srcPath: `/_api/bookings-settings`, destPath: `` }], "www._base_domain_": [{ srcPath: `/_api/bookings-settings`, destPath: `` }] } }));
|
|
1679
|
+
}
|
|
1680
|
+
var Ba = `@wix/auto_sdk_bookings_bookings-settings`;
|
|
1681
|
+
function Va(e2) {
|
|
1681
1682
|
function t2({ host: t3 }) {
|
|
1682
|
-
return { entityFqdn: `wix.bookings.v2.bookings_settings`, method: `GET`, methodFqn: `wix.bookings.settings.v2.BookingsSettingsService.GetBookingsSettings`, packageName:
|
|
1683
|
+
return { entityFqdn: `wix.bookings.v2.bookings_settings`, method: `GET`, methodFqn: `wix.bookings.settings.v2.BookingsSettingsService.GetBookingsSettings`, packageName: Ba, migrationOptions: { optInTransformResponse: true }, url: za({ protoPath: `/v2/settings`, data: e2, host: t3 }), params: St(e2), transformResponse: (e3) => z(e3, [{ transformFn: We, paths: La }, { transformFn: qt, paths: Ra }]), fallback: [{ method: `GET`, url: za({ protoPath: `/v2/settings`, data: e2, host: t3 }), params: St(e2) }] };
|
|
1683
1684
|
}
|
|
1684
1685
|
return t2;
|
|
1685
1686
|
}
|
|
1686
|
-
var
|
|
1687
|
-
async function
|
|
1688
|
-
let { httpClient: e2, sideEffects: t2 } = arguments[0], n2 =
|
|
1687
|
+
var Ha = ((e2) => (e2.BUSINESS_TIME_ZONE = `BUSINESS_TIME_ZONE`, e2.CUSTOMER_TIME_ZONE = `CUSTOMER_TIME_ZONE`, e2))(Ha || {});
|
|
1688
|
+
async function Ua() {
|
|
1689
|
+
let { httpClient: e2, sideEffects: t2 } = arguments[0], n2 = Va(He({}));
|
|
1689
1690
|
t2?.onSiteCall?.();
|
|
1690
1691
|
try {
|
|
1691
1692
|
let r2 = await e2.request(n2);
|
|
1692
|
-
return t2?.onSuccess?.(r2),
|
|
1693
|
+
return t2?.onSuccess?.(r2), L(r2.data)?.bookingsSettings;
|
|
1693
1694
|
} catch (e3) {
|
|
1694
|
-
let n3 =
|
|
1695
|
+
let n3 = ut(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: {}, singleArgumentUnchanged: false }, []);
|
|
1695
1696
|
throw t2?.onError?.(e3), n3;
|
|
1696
1697
|
}
|
|
1697
1698
|
}
|
|
1698
|
-
function Ha(e2) {
|
|
1699
|
-
return () => Va({ httpClient: e2 });
|
|
1700
|
-
}
|
|
1701
|
-
var Ua = bt(Ha);
|
|
1702
1699
|
function Wa(e2) {
|
|
1700
|
+
return () => Ua({ httpClient: e2 });
|
|
1701
|
+
}
|
|
1702
|
+
var Ga = xt(Wa);
|
|
1703
|
+
function Ka(e2) {
|
|
1703
1704
|
return e2.business?._id ?? null;
|
|
1704
1705
|
}
|
|
1705
|
-
function
|
|
1706
|
+
function qa(e2) {
|
|
1706
1707
|
return e2.business?.name ?? null;
|
|
1707
1708
|
}
|
|
1708
|
-
function
|
|
1709
|
-
return (e2?.locations ?? []).filter((e3) => e3.type ===
|
|
1709
|
+
function Ja(e2) {
|
|
1710
|
+
return (e2?.locations ?? []).filter((e3) => e3.type === ka.BUSINESS).map((e3) => ({ id: Ka(e3) ?? ``, label: qa(e3) ?? `` })).filter((e3) => e3.id !== ``).sort((e3, t2) => e3.label.localeCompare(t2.label));
|
|
1710
1711
|
}
|
|
1711
|
-
var
|
|
1712
|
-
var
|
|
1713
|
-
var
|
|
1714
|
-
var
|
|
1715
|
-
|
|
1712
|
+
var Ya = (e2) => e2 === Da.APPOINTMENT;
|
|
1713
|
+
var Xa = (e2) => e2 === Da.CLASS;
|
|
1714
|
+
var Za = (e2) => e2 === Da.COURSE;
|
|
1715
|
+
var Qa = (e2) => e2.payment?.rateType === Oa.VARIED;
|
|
1716
|
+
var $a = (e2) => !!e2.addOnGroups?.some((e3) => e3.addOnIds?.length);
|
|
1717
|
+
var eo = { category: `category`, location: `location`, page: `page`, blob: `b`, resource: `resource`, referral: `referral`, timezone: `timezone`, bookingId: `bookingId`, token: `token`, rescheduleRedirectUrl: `rescheduleRedirectUrl` };
|
|
1718
|
+
function to(e2) {
|
|
1716
1719
|
if (!e2) return null;
|
|
1717
|
-
let t2 =
|
|
1720
|
+
let t2 = so(e2).map((e3) => e3.id), n2 = { ...e2.durationChoiceId ? { durationChoiceId: e2.durationChoiceId } : {}, ...e2.durationInMinutes ? { durationInMinutes: e2.durationInMinutes } : {}, ...t2.length ? { addOnIds: t2 } : {}, ...e2.requestedGender ? { requestedGender: { gender: e2.requestedGender } } : {} };
|
|
1718
1721
|
return Object.keys(n2).length ? n2 : null;
|
|
1719
1722
|
}
|
|
1720
|
-
function
|
|
1723
|
+
function no(e2) {
|
|
1721
1724
|
return (e2?.services.length ?? 0) > 1;
|
|
1722
1725
|
}
|
|
1723
|
-
var
|
|
1724
|
-
function
|
|
1726
|
+
var ro = (e2) => ({ valid: false, reason: e2 });
|
|
1727
|
+
function io(e2) {
|
|
1725
1728
|
let t2 = e2?.services ?? [];
|
|
1726
|
-
if (!
|
|
1727
|
-
if (t2.some((e3) => e3.serviceType && e3.serviceType !== `APPOINTMENT`)) return
|
|
1729
|
+
if (!no(e2) || t2.some((e3) => !e3.serviceId)) return ro(`too-few-services`);
|
|
1730
|
+
if (t2.some((e3) => e3.serviceType && e3.serviceType !== `APPOINTMENT`)) return ro(`not-appointment`);
|
|
1728
1731
|
let n2 = t2[0].locationType ?? `BUSINESS`, r2 = t2[0].locationId ?? null;
|
|
1729
|
-
if (t2.some((e3) => (e3.locationType ?? `BUSINESS`) !== n2 || (e3.locationId ?? null) !== r2)) return
|
|
1730
|
-
if (r2 && n2 !== `BUSINESS`) return
|
|
1731
|
-
let i2 = t2.map((e3) => ({ serviceId: e3.serviceId, staff:
|
|
1732
|
+
if (t2.some((e3) => (e3.locationType ?? `BUSINESS`) !== n2 || (e3.locationId ?? null) !== r2)) return ro(`location-mixed`);
|
|
1733
|
+
if (r2 && n2 !== `BUSINESS`) return ro(`location-id-not-business`);
|
|
1734
|
+
let i2 = t2.map((e3) => ({ serviceId: e3.serviceId, staff: oo(e3), customerChoices: to(e3) }));
|
|
1732
1735
|
return { valid: true, locationId: r2, locationType: n2, services: i2, requestKey: JSON.stringify([n2, r2, i2]) };
|
|
1733
1736
|
}
|
|
1734
|
-
var
|
|
1735
|
-
function
|
|
1736
|
-
let t2 = e2.resources?.find((e3) => e3.type ===
|
|
1737
|
+
var ao = `staff`;
|
|
1738
|
+
function oo(e2) {
|
|
1739
|
+
let t2 = e2.resources?.find((e3) => e3.type === ao);
|
|
1737
1740
|
if (!t2) return null;
|
|
1738
1741
|
let n2 = t2.ids[0];
|
|
1739
1742
|
return n2 ? { anyResource: false, staffMemberId: n2 } : t2.anyResource ? { anyResource: true } : null;
|
|
1740
1743
|
}
|
|
1741
|
-
function
|
|
1744
|
+
function so(e2) {
|
|
1742
1745
|
return e2.addOns ?? [];
|
|
1743
1746
|
}
|
|
1744
|
-
function
|
|
1747
|
+
function co(e2, t2) {
|
|
1745
1748
|
let n2 = e2(t2);
|
|
1746
1749
|
return n2 ? n2.replace(/\/$/, ``) || `/` : null;
|
|
1747
1750
|
}
|
|
1748
|
-
function
|
|
1751
|
+
function lo(e2, t2, n2) {
|
|
1749
1752
|
let r2 = e2(t2);
|
|
1750
1753
|
return !r2 || !n2 ? null : `${r2.replace(/\/$/, ``)}/${n2}`;
|
|
1751
1754
|
}
|
|
1752
|
-
function
|
|
1755
|
+
function uo(e2, t2) {
|
|
1753
1756
|
switch (e2) {
|
|
1754
1757
|
case `servicePage`:
|
|
1755
|
-
return (t2.slug ? t2.buildCustomServiceUrl(t2.slug) : void 0) ??
|
|
1758
|
+
return (t2.slug ? t2.buildCustomServiceUrl(t2.slug) : void 0) ?? lo(t2.appSectionUrl, Gr.SERVICE_PAGE, t2.slug);
|
|
1756
1759
|
case `bookingCalendar`:
|
|
1757
|
-
return t2.isMultiService ?
|
|
1760
|
+
return t2.isMultiService ? co(t2.appSectionUrl, Gr.CALENDAR_PAGE) : lo(t2.appSectionUrl, Gr.CALENDAR_PAGE, t2.slug);
|
|
1758
1761
|
case `bookingForm`:
|
|
1759
|
-
return t2.serviceId ?
|
|
1762
|
+
return t2.serviceId ? lo(t2.appSectionUrl, Gr.FORM_PAGE, t2.slug) : null;
|
|
1760
1763
|
default:
|
|
1761
1764
|
return null;
|
|
1762
1765
|
}
|
|
1763
1766
|
}
|
|
1764
|
-
var
|
|
1765
|
-
var
|
|
1766
|
-
var
|
|
1767
|
-
var
|
|
1768
|
-
var
|
|
1769
|
-
let { previewMode: e2 } = (0, import_services_manager_react.useService)(
|
|
1770
|
-
let r2 =
|
|
1767
|
+
var fo = (e2) => e2.target === `_blank`;
|
|
1768
|
+
var po = (e2, t2) => t2 === `/` ? e2 : new URL(`.${t2}`, `${e2}/`).href;
|
|
1769
|
+
var mo = (e2, t2, n2) => n2 ? `.${t2}` : ho(e2, t2);
|
|
1770
|
+
var ho = (e2, t2) => e2 ? po(e2, t2) : t2;
|
|
1771
|
+
var go = () => {
|
|
1772
|
+
let { previewMode: e2 } = (0, import_services_manager_react.useService)(Ir), t2 = (0, import_services_manager_react.useService)(zr), n2 = t2.siteUrl.replace(/\/$/, ``), { navigateTo: i2 } = (0, import_services_manager_react.useService)(Rr), a2 = (0, import_services_manager_react.useService)(Br), o2 = (0, import_services_manager_react.useGetService)(), s2 = (0, import_react.useCallback)(async (t3) => {
|
|
1773
|
+
let r2 = mo(n2, t3, e2);
|
|
1771
1774
|
await i2({ href: r2 });
|
|
1772
1775
|
}, [e2, n2, i2]), c2 = (0, import_react.useCallback)(async (e3) => {
|
|
1773
|
-
await i2(
|
|
1774
|
-
}, [i2]), l2 = (0, import_react.useCallback)((e3) =>
|
|
1776
|
+
await i2(fo(e3) ? { href: e3.href, type: `ExternalLink`, target: `_blank` } : { href: e3.href });
|
|
1777
|
+
}, [i2]), l2 = (0, import_react.useCallback)((e3) => ho(n2, e3), [n2]), u2 = (0, import_react.useCallback)((e3) => t2.appSectionRelativeUrl(Vr, e3), [t2]), p2 = (0, import_react.useCallback)((e3) => ta(a2.urlMappings, e3), [a2]), m2 = (0, import_react.useCallback)((e3, t3) => uo(e3, { ...t3, appSectionUrl: u2, buildCustomServiceUrl: p2 }), [u2, p2]), h2 = (0, import_react.useCallback)((e3, t3) => {
|
|
1775
1778
|
let r2 = m2(e3, t3);
|
|
1776
|
-
return r2 && n2 ?
|
|
1779
|
+
return r2 && n2 ? po(n2, r2) : null;
|
|
1777
1780
|
}, [m2, n2]), g2 = (0, import_react.useCallback)((e3, t3) => {
|
|
1778
1781
|
let n3 = m2(e3, t3);
|
|
1779
1782
|
n3 && s2(n3);
|
|
1780
|
-
}, [m2, s2]), _2 = (0, import_react.useCallback)(() => u2(
|
|
1781
|
-
return { navigate: s2, navigateToHref: c2, resolvePath: m2, toHref: l2, resolveAbsoluteUrl: h2, navigateTo: g2, getBookingFormPath: _2, getCartPagePath: (0, import_react.useCallback)(() => v2(
|
|
1782
|
-
let t3 = v2(
|
|
1783
|
+
}, [m2, s2]), _2 = (0, import_react.useCallback)(() => u2(Gr.FORM_PAGE) || void 0, [u2]), v2 = (0, import_react.useCallback)((e3) => Object.values(o2(Lr).pages).some((t3) => t3.appPageId === e3 && (!t3.appDefinitionId || t3.appDefinitionId === `1380b703-ce81-ff05-f115-39571d94dfcd`)) && t2.appSectionRelativeUrl(`1380b703-ce81-ff05-f115-39571d94dfcd`, e3) || void 0, [t2, o2]);
|
|
1784
|
+
return { navigate: s2, navigateToHref: c2, resolvePath: m2, toHref: l2, resolveAbsoluteUrl: h2, navigateTo: g2, getBookingFormPath: _2, getCartPagePath: (0, import_react.useCallback)(() => v2(Hr), [v2]), getThankYouPagePath: (0, import_react.useCallback)((e3) => {
|
|
1785
|
+
let t3 = v2(Ur);
|
|
1783
1786
|
return t3 ? `${t3}/${e3}?origin=bookings` : void 0;
|
|
1784
1787
|
}, [v2]) };
|
|
1785
1788
|
};
|
|
1786
|
-
function
|
|
1789
|
+
function _o(e2) {
|
|
1787
1790
|
return e2?.details?.applicationError?.code;
|
|
1788
1791
|
}
|
|
1789
|
-
function
|
|
1792
|
+
function vo() {
|
|
1790
1793
|
let e2 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
1791
1794
|
if (e2) return { initWixModules(t3, n3) {
|
|
1792
|
-
return
|
|
1795
|
+
return yo(() => e2(t3, n3));
|
|
1793
1796
|
}, fetchWithAuth() {
|
|
1794
1797
|
throw Error(`fetchWithAuth is not available in this context`);
|
|
1795
1798
|
}, graphql() {
|
|
@@ -1799,10 +1802,10 @@ function mo() {
|
|
|
1799
1802
|
if (t2 || n2) return { initWixModules(e3, r2) {
|
|
1800
1803
|
if (r2) {
|
|
1801
1804
|
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`);
|
|
1802
|
-
return
|
|
1805
|
+
return yo(() => n2.use(e3));
|
|
1803
1806
|
}
|
|
1804
1807
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
1805
|
-
return
|
|
1808
|
+
return yo(() => t2.use(e3));
|
|
1806
1809
|
}, fetchWithAuth: (e3, n3) => {
|
|
1807
1810
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
1808
1811
|
return t2.fetchWithAuth(e3, n3);
|
|
@@ -1814,7 +1817,7 @@ function mo() {
|
|
|
1814
1817
|
return t2.graphql(e3, n3, r2);
|
|
1815
1818
|
} };
|
|
1816
1819
|
}
|
|
1817
|
-
function
|
|
1820
|
+
function yo(e2) {
|
|
1818
1821
|
let t2 = globalThis.__wix_context__, n2 = { client: m.client, elevatedClient: m.elevatedClient }, r2;
|
|
1819
1822
|
globalThis.__wix_context__ = void 0, m.client = void 0, m.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
1820
1823
|
try {
|
|
@@ -1823,17 +1826,17 @@ function ho(e2) {
|
|
|
1823
1826
|
globalThis.__wix_context__ = t2, m.client = n2.client, m.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
1824
1827
|
}
|
|
1825
1828
|
}
|
|
1826
|
-
function
|
|
1829
|
+
function bo(e2, t2) {
|
|
1827
1830
|
return { ...e2, ...Object.fromEntries(t2.map((t3) => [t3, (...n2) => {
|
|
1828
|
-
let r2 =
|
|
1831
|
+
let r2 = vo();
|
|
1829
1832
|
if (!r2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
1830
1833
|
return r2.initWixModules(e2)[t3].apply(void 0, n2);
|
|
1831
1834
|
}])) };
|
|
1832
1835
|
}
|
|
1833
|
-
function
|
|
1834
|
-
return
|
|
1836
|
+
function xo(e2) {
|
|
1837
|
+
return bo({ __type: `host`, create: (t2) => Object.entries(e2).reduce((e3, [n2, r2]) => ({ ...e3, [n2]: r2(t2) }), {}) }, Object.keys(e2));
|
|
1835
1838
|
}
|
|
1836
|
-
var
|
|
1839
|
+
var So = class {
|
|
1837
1840
|
constructor(e2) {
|
|
1838
1841
|
this.message = e2, this.captureException = () => {
|
|
1839
1842
|
console.error(this.message);
|
|
@@ -1848,110 +1851,118 @@ var vo = class {
|
|
|
1848
1851
|
};
|
|
1849
1852
|
}
|
|
1850
1853
|
};
|
|
1851
|
-
var
|
|
1852
|
-
var
|
|
1853
|
-
var
|
|
1854
|
-
function
|
|
1854
|
+
var Co = (e2) => new So(e2);
|
|
1855
|
+
var wo = xo({ getMonitoringClient: (e2) => () => e2.getMonitoringClient ? e2.getMonitoringClient() : Co(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`) });
|
|
1856
|
+
var Q = { 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` };
|
|
1857
|
+
function To(e2) {
|
|
1855
1858
|
try {
|
|
1856
|
-
let t2 =
|
|
1859
|
+
let t2 = wo.getMonitoringClient?.();
|
|
1857
1860
|
return t2 && typeof t2[e2] == `function` ? t2 : null;
|
|
1858
1861
|
} catch {
|
|
1859
1862
|
return null;
|
|
1860
1863
|
}
|
|
1861
1864
|
}
|
|
1862
1865
|
function $(e2, { feature: t2, action: n2, level: r2 = `error`, contexts: i2 }) {
|
|
1863
|
-
let a2 =
|
|
1866
|
+
let a2 = To(`captureException`);
|
|
1864
1867
|
if (!a2) return;
|
|
1865
1868
|
let o2 = e2 instanceof Error ? e2 : Error(String(e2));
|
|
1866
1869
|
a2.captureException(o2, { level: r2, tags: { feature: t2, action: n2 }, ...i2 ? { contexts: i2 } : {} });
|
|
1867
1870
|
}
|
|
1868
|
-
|
|
1871
|
+
function Eo(e2, { feature: t2, action: n2, level: r2 = `info`, tags: i2 }) {
|
|
1872
|
+
let a2 = To(`captureMessage`);
|
|
1873
|
+
a2 && a2.captureMessage(e2, { level: r2, tags: { feature: t2, action: n2, ...i2 } });
|
|
1874
|
+
}
|
|
1875
|
+
function Do({ message: e2, category: t2, feature: n2, data: r2 }) {
|
|
1876
|
+
let i2 = To(`addBreadcrumb`);
|
|
1877
|
+
i2 && i2.addBreadcrumb({ message: e2, category: t2, level: `info`, data: { feature: n2, ...r2 } });
|
|
1878
|
+
}
|
|
1879
|
+
var Oo = (e2) => {
|
|
1869
1880
|
let t2 = (e3) => e3 < 10 ? `0${e3}` : `${e3}`;
|
|
1870
1881
|
return `${e2.getFullYear()}-${t2(e2.getMonth() + 1)}-${t2(e2.getDate())}`;
|
|
1871
1882
|
};
|
|
1872
|
-
var
|
|
1873
|
-
var
|
|
1874
|
-
var
|
|
1875
|
-
var
|
|
1876
|
-
function
|
|
1877
|
-
return `${
|
|
1883
|
+
var ko = (e2) => /* @__PURE__ */ new Date(`${e2}T00:00:00`);
|
|
1884
|
+
var Ao = (e2, t2) => new Intl.DateTimeFormat(`en-CA`, { year: `numeric`, month: `2-digit`, day: `2-digit`, ...t2 ? { timeZone: t2 } : {} }).format(e2);
|
|
1885
|
+
var jo = (e2) => `${Oo(e2)}T00:00:00`;
|
|
1886
|
+
var Mo = (e2) => `${Oo(e2)}T23:59:59`;
|
|
1887
|
+
function No(e2, t2) {
|
|
1888
|
+
return `${Ao(e2, t2)}T${new Intl.DateTimeFormat(`en-GB`, { timeZone: t2, hourCycle: `h23`, hour: `2-digit`, minute: `2-digit`, second: `2-digit` }).format(e2)}`;
|
|
1878
1889
|
}
|
|
1879
|
-
function
|
|
1880
|
-
let n2 =
|
|
1890
|
+
function Po(e2, t2) {
|
|
1891
|
+
let n2 = No(new Date(Date.now()), t2);
|
|
1881
1892
|
return n2.slice(0, 10) === e2 ? n2 : `${e2}T00:00:00`;
|
|
1882
1893
|
}
|
|
1883
|
-
var
|
|
1884
|
-
var
|
|
1885
|
-
function
|
|
1886
|
-
if (typeof e2 != `string` || !
|
|
1887
|
-
let t2 =
|
|
1888
|
-
return !Number.isNaN(t2.getTime()) &&
|
|
1894
|
+
var Fo = /^\d{4}-\d{2}-\d{2}$/;
|
|
1895
|
+
var Io = 864e5;
|
|
1896
|
+
function Lo(e2) {
|
|
1897
|
+
if (typeof e2 != `string` || !Fo.test(e2)) return false;
|
|
1898
|
+
let t2 = ko(e2);
|
|
1899
|
+
return !Number.isNaN(t2.getTime()) && Oo(t2) === e2;
|
|
1889
1900
|
}
|
|
1890
|
-
function
|
|
1901
|
+
function Ro(e2) {
|
|
1891
1902
|
if (!e2 || typeof e2 != `object`) return false;
|
|
1892
1903
|
let { startDate: t2, endDate: n2 } = e2;
|
|
1893
|
-
return
|
|
1904
|
+
return Lo(t2) && Lo(n2) && t2 <= n2;
|
|
1894
1905
|
}
|
|
1895
|
-
function
|
|
1896
|
-
let n2 =
|
|
1897
|
-
return n2.setDate(n2.getDate() + t2),
|
|
1906
|
+
function zo(e2, t2) {
|
|
1907
|
+
let n2 = ko(e2);
|
|
1908
|
+
return n2.setDate(n2.getDate() + t2), Oo(n2);
|
|
1898
1909
|
}
|
|
1899
|
-
function
|
|
1900
|
-
let n2 =
|
|
1901
|
-
return Math.round(n2 /
|
|
1910
|
+
function Bo({ startDate: e2, endDate: t2 }) {
|
|
1911
|
+
let n2 = ko(t2).getTime() - ko(e2).getTime();
|
|
1912
|
+
return Math.round(n2 / Io) + 1;
|
|
1902
1913
|
}
|
|
1903
|
-
function
|
|
1904
|
-
let t2 =
|
|
1905
|
-
return { startDate:
|
|
1914
|
+
function Vo(e2) {
|
|
1915
|
+
let t2 = ko(e2), n2 = new Date(t2.getFullYear(), t2.getMonth(), 1), r2 = new Date(t2.getFullYear(), t2.getMonth() + 1, 0);
|
|
1916
|
+
return { startDate: Oo(n2), endDate: Oo(r2) };
|
|
1906
1917
|
}
|
|
1907
|
-
function
|
|
1908
|
-
let t2 =
|
|
1918
|
+
function Ho(e2) {
|
|
1919
|
+
let t2 = Vo(e2.startDate);
|
|
1909
1920
|
return t2.startDate === e2.startDate && t2.endDate === e2.endDate;
|
|
1910
1921
|
}
|
|
1911
|
-
function
|
|
1912
|
-
if (
|
|
1913
|
-
let n3 =
|
|
1914
|
-
return
|
|
1922
|
+
function Uo(e2, t2) {
|
|
1923
|
+
if (Ho(e2)) {
|
|
1924
|
+
let n3 = ko(e2.startDate);
|
|
1925
|
+
return Vo(Oo(new Date(n3.getFullYear(), n3.getMonth() + t2, 1)));
|
|
1915
1926
|
}
|
|
1916
|
-
let n2 = t2 *
|
|
1917
|
-
return { startDate:
|
|
1927
|
+
let n2 = t2 * Bo(e2);
|
|
1928
|
+
return { startDate: zo(e2.startDate, n2), endDate: zo(e2.endDate, n2) };
|
|
1918
1929
|
}
|
|
1919
|
-
function
|
|
1930
|
+
function Wo(e2, t2) {
|
|
1920
1931
|
return e2 >= t2.startDate && e2 <= t2.endDate;
|
|
1921
1932
|
}
|
|
1922
|
-
function
|
|
1923
|
-
let t2 =
|
|
1924
|
-
return
|
|
1933
|
+
function Go(e2) {
|
|
1934
|
+
let t2 = ko(e2), n2 = new Date(t2.getFullYear(), t2.getMonth() + 2, 0).getDate(), r2 = Math.min(t2.getDate(), n2);
|
|
1935
|
+
return Oo(new Date(t2.getFullYear(), t2.getMonth() + 1, r2));
|
|
1925
1936
|
}
|
|
1926
|
-
function
|
|
1937
|
+
function Ko(e2) {
|
|
1927
1938
|
let t2 = [], n2 = e2.startDate;
|
|
1928
1939
|
for (; n2 <= e2.endDate; ) {
|
|
1929
|
-
let r2 =
|
|
1930
|
-
t2.push({ startDate: n2, endDate: i2 }), n2 =
|
|
1940
|
+
let r2 = zo(Go(n2), -1), i2 = r2 < e2.endDate ? r2 : e2.endDate;
|
|
1941
|
+
t2.push({ startDate: n2, endDate: i2 }), n2 = zo(i2, 1);
|
|
1931
1942
|
}
|
|
1932
1943
|
return t2;
|
|
1933
1944
|
}
|
|
1934
|
-
function
|
|
1945
|
+
function qo({ allowGenderSelection: e2, staffSelectionStrategy: t2 }) {
|
|
1935
1946
|
return e2 && t2 !== `CUSTOMER_CANNOT_CHOOSE`;
|
|
1936
1947
|
}
|
|
1937
|
-
async function
|
|
1938
|
-
let e2 = await
|
|
1948
|
+
async function Jo() {
|
|
1949
|
+
let e2 = await Ia(Vr);
|
|
1939
1950
|
return { businessTimeZone: e2.timeSlotsConfiguration?.displayTimeZone?.timeZone || null, staffSelectionStrategy: e2.timeSlotsConfiguration?.staffSelection?.strategy ?? null, allowGenderSelection: e2.timeSlotsConfiguration?.staffSelection?.allowGenderSelection ?? false };
|
|
1940
1951
|
}
|
|
1941
|
-
function
|
|
1952
|
+
function Yo(e2) {
|
|
1942
1953
|
let t2 = e2.location?._id || (e2.location?.locationType ? `${e2.location.locationType}:${e2.location.formattedAddress ?? ``}` : ``);
|
|
1943
1954
|
return `${e2.localStartDate ?? ``}|${e2.localEndDate ?? ``}|${t2}`;
|
|
1944
1955
|
}
|
|
1945
|
-
function
|
|
1956
|
+
function Xo(e2) {
|
|
1946
1957
|
return e2.availableResources?.[0]?.resources?.[0]?._id ?? null;
|
|
1947
1958
|
}
|
|
1948
|
-
function
|
|
1949
|
-
return `${
|
|
1959
|
+
function Zo(e2) {
|
|
1960
|
+
return `${Yo(e2)}|${Xo(e2) ?? ``}`;
|
|
1950
1961
|
}
|
|
1951
|
-
function
|
|
1962
|
+
function Qo(e2) {
|
|
1952
1963
|
let t2 = /* @__PURE__ */ new Map();
|
|
1953
1964
|
for (let n2 of e2) {
|
|
1954
|
-
let e3 =
|
|
1965
|
+
let e3 = Yo(n2), r2 = t2.get(e3);
|
|
1955
1966
|
r2 ? r2.push(n2) : t2.set(e3, [n2]);
|
|
1956
1967
|
}
|
|
1957
1968
|
return [...t2.values()].map((e3) => {
|
|
@@ -1960,116 +1971,132 @@ function qo(e2) {
|
|
|
1960
1971
|
return { ...n2[0], availableResources: n2.flatMap((e4) => e4.availableResources ?? []) };
|
|
1961
1972
|
});
|
|
1962
1973
|
}
|
|
1963
|
-
function
|
|
1974
|
+
function $o(e2) {
|
|
1964
1975
|
return e2 ? { locations: [{ _id: e2, locationType: `BUSINESS` }] } : {};
|
|
1965
1976
|
}
|
|
1966
|
-
function
|
|
1967
|
-
return e2 ? { resourceTypes: [{ resourceTypeId:
|
|
1977
|
+
function es(e2) {
|
|
1978
|
+
return e2 ? { resourceTypes: [{ resourceTypeId: Wr, resourceIds: [e2] }] } : {};
|
|
1968
1979
|
}
|
|
1969
|
-
function
|
|
1980
|
+
function ts(e2) {
|
|
1970
1981
|
let { requestedGender: t2, ...n2 } = e2;
|
|
1971
1982
|
return Object.keys(n2).length ? n2 : void 0;
|
|
1972
1983
|
}
|
|
1973
|
-
function
|
|
1984
|
+
function ns(e2, t2) {
|
|
1974
1985
|
if (!e2) return {};
|
|
1975
|
-
let n2 = t2 ?
|
|
1986
|
+
let n2 = t2 ? ts(e2) : e2;
|
|
1976
1987
|
return n2 ? { customerChoices: n2 } : {};
|
|
1977
1988
|
}
|
|
1978
|
-
var
|
|
1979
|
-
function
|
|
1980
|
-
return
|
|
1989
|
+
var rs = `REQUESTED_GENDER_NOT_ALLOWED`;
|
|
1990
|
+
function is(e2) {
|
|
1991
|
+
return _o(e2) === rs;
|
|
1981
1992
|
}
|
|
1982
|
-
var
|
|
1983
|
-
var
|
|
1984
|
-
function
|
|
1985
|
-
return
|
|
1993
|
+
var as = false;
|
|
1994
|
+
var os = /* @__PURE__ */ new Set();
|
|
1995
|
+
function ss() {
|
|
1996
|
+
return as;
|
|
1986
1997
|
}
|
|
1987
|
-
function
|
|
1988
|
-
return
|
|
1998
|
+
function cs(e2) {
|
|
1999
|
+
return os.add(e2), () => os.delete(e2);
|
|
1989
2000
|
}
|
|
1990
|
-
function
|
|
1991
|
-
|
|
2001
|
+
function ls() {
|
|
2002
|
+
as || (as = true, os.forEach((e2) => e2()));
|
|
1992
2003
|
}
|
|
1993
|
-
async function
|
|
2004
|
+
async function us(e2) {
|
|
1994
2005
|
let { customerChoices: t2, ...n2 } = e2, r2 = (e3) => {
|
|
1995
|
-
let t3 =
|
|
1996
|
-
return
|
|
2006
|
+
let t3 = ts(e3);
|
|
2007
|
+
return la({ ...n2, ...t3 ? { customerChoices: t3 } : {} });
|
|
1997
2008
|
};
|
|
1998
|
-
if (
|
|
2009
|
+
if (as && t2?.requestedGender) return r2(t2);
|
|
1999
2010
|
try {
|
|
2000
|
-
return await
|
|
2011
|
+
return await la(e2);
|
|
2001
2012
|
} catch (e3) {
|
|
2002
|
-
if (!t2?.requestedGender ||
|
|
2003
|
-
return $(e3, { feature:
|
|
2013
|
+
if (!t2?.requestedGender || !is(e3)) throw e3;
|
|
2014
|
+
return $(e3, { feature: Q.timeSlots, action: `requested-gender-rejected`, level: `warning` }), ls(), r2(t2);
|
|
2004
2015
|
}
|
|
2005
2016
|
}
|
|
2006
|
-
function
|
|
2017
|
+
function ds(e2, t2, n2) {
|
|
2007
2018
|
return { ...e2 ? { "location.id": e2 } : {}, ...t2 ? { "resources.id": { $hasSome: [t2] } } : {}, ...n2 ? { remainingCapacity: { $gte: n2 } } : {} };
|
|
2008
2019
|
}
|
|
2009
|
-
async function
|
|
2010
|
-
let t2 = await
|
|
2020
|
+
async function fs(e2) {
|
|
2021
|
+
let t2 = await _a(e2);
|
|
2011
2022
|
return { timeSlots: t2.timeSlots ?? [], timeZone: t2.timeZone ?? null, nextCursor: t2.pagingMetadata?.cursors?.next || null };
|
|
2012
2023
|
}
|
|
2013
|
-
function
|
|
2014
|
-
return
|
|
2024
|
+
function ps({ serviceId: e2, serviceType: t2, fromLocalDate: n2, toLocalDate: r2, timeZone: i2, locationId: a2, staffId: o2, onlyAvailableSlots: s2 = false, customerChoices: c2, minRemainingCapacity: l2, timeSlotsPerDay: u2, limit: d2, cursor: f2 }) {
|
|
2025
|
+
return Ya(t2) ? ms({ serviceId: e2, fromLocalDate: n2, toLocalDate: r2, timeZone: i2, locationId: a2, staffId: o2, onlyAvailableSlots: s2, customerChoices: c2, timeSlotsPerDay: u2, limit: d2, cursor: f2 }) : fs({ serviceIds: [e2], fromLocalDate: n2, ...r2 ? { toLocalDate: r2 } : {}, ...i2 ? { timeZone: i2 } : {}, includeNonBookable: !s2, eventFilter: { type: t2, ...ds(a2, o2, l2) }, cursorPaging: { limit: d2, ...f2 ? { cursor: f2 } : {} } });
|
|
2015
2026
|
}
|
|
2016
|
-
async function
|
|
2017
|
-
let d2 = await
|
|
2027
|
+
async function ms({ serviceId: e2, fromLocalDate: t2, toLocalDate: n2, timeZone: r2, locationId: i2, staffId: a2, onlyAvailableSlots: o2, customerChoices: s2, timeSlotsPerDay: c2, limit: l2, cursor: u2 }) {
|
|
2028
|
+
let d2 = await us({ serviceId: e2, fromLocalDate: t2, ...n2 ? { toLocalDate: n2 } : {}, ...r2 ? { timeZone: r2 } : {}, ...o2 ? { bookable: true } : {}, ...$o(i2), ...es(a2), ...ns(s2, a2), includeResourceTypeIds: [Wr], ...c2 == null ? {} : { timeSlotsPerDay: c2 }, cursorPaging: { limit: l2, ...u2 ? { cursor: u2 } : {} } });
|
|
2018
2029
|
return { timeSlots: d2.timeSlots ?? [], timeZone: d2.timeZone ?? null, nextCursor: d2.cursorPagingMetadata?.cursors?.next || null };
|
|
2019
2030
|
}
|
|
2020
|
-
var
|
|
2021
|
-
var
|
|
2022
|
-
function
|
|
2023
|
-
let t2 = e2 ?
|
|
2024
|
-
return { fromLocalDate:
|
|
2031
|
+
var hs = 6;
|
|
2032
|
+
var gs = 864e5;
|
|
2033
|
+
function _s(e2) {
|
|
2034
|
+
let t2 = e2 ? ko(e2) : new Date(Date.now()), n2 = new Date(t2.getFullYear(), t2.getMonth() + hs + 1, 1), r2 = new Date(n2.getTime() - gs);
|
|
2035
|
+
return { fromLocalDate: jo(t2), toLocalDate: Mo(r2) };
|
|
2025
2036
|
}
|
|
2026
|
-
async function
|
|
2027
|
-
let { fromLocalDate: u2, toLocalDate: d2 } =
|
|
2028
|
-
if (
|
|
2029
|
-
let a3 = { ...
|
|
2037
|
+
async function vs({ serviceId: e2, serviceType: t2, timeZone: n2, limit: r2, onlyAvailableSlots: i2 = true, fromDate: a2, locationId: o2, staffId: s2, customerChoices: c2, minRemainingCapacity: l2 }) {
|
|
2038
|
+
let { fromLocalDate: u2, toLocalDate: d2 } = _s(a2);
|
|
2039
|
+
if (Xa(t2) || Za(t2)) {
|
|
2040
|
+
let a3 = { ...Za(t2) ? { type: `COURSE` } : {}, ...ds(o2, s2, l2) }, c3 = await fs({ serviceIds: [e2], fromLocalDate: u2, toLocalDate: d2, ...n2 ? { timeZone: n2 } : {}, includeNonBookable: !i2, ...Object.keys(a3).length ? { eventFilter: a3 } : {}, ...r2 == null ? {} : { cursorPaging: { limit: r2 } } });
|
|
2030
2041
|
return { timeSlots: c3.timeSlots, timeZone: c3.timeZone };
|
|
2031
2042
|
}
|
|
2032
|
-
let f2 = await
|
|
2043
|
+
let f2 = await us({ serviceId: e2, fromLocalDate: u2, toLocalDate: d2, ...n2 ? { timeZone: n2 } : {}, ...i2 ? { bookable: true } : {}, ...$o(o2), ...es(s2), ...ns(c2, s2), includeResourceTypeIds: [Wr], ...r2 == null ? {} : { cursorPaging: { limit: r2 } } });
|
|
2033
2044
|
return { timeSlots: f2.timeSlots ?? [], timeZone: f2.timeZone ?? null };
|
|
2034
2045
|
}
|
|
2035
|
-
var
|
|
2036
|
-
async function
|
|
2037
|
-
let d2 = `${n2}T00:00:00`, f2 = `${n2}T23:59:59`, p2 =
|
|
2046
|
+
var ys = 1e3;
|
|
2047
|
+
async function bs({ serviceId: e2, serviceType: t2, date: n2, timeZone: r2, onlyAvailableSlots: i2, locationId: a2, staffId: o2, customerChoices: s2, minRemainingCapacity: c2, fromLocalDate: l2, toLocalDate: u2 }) {
|
|
2048
|
+
let d2 = `${n2}T00:00:00`, f2 = `${n2}T23:59:59`, p2 = Za(t2) ? `COURSE` : Xa(t2) ? `CLASS` : `APPOINTMENT`, m2 = [], h2 = null, g2;
|
|
2038
2049
|
do {
|
|
2039
|
-
let t3 = await
|
|
2050
|
+
let t3 = await ps({ serviceId: e2, serviceType: p2, fromLocalDate: l2 && l2 > d2 ? l2 : d2, toLocalDate: u2 && u2 < f2 ? u2 : f2, timeZone: r2, locationId: a2, staffId: o2, onlyAvailableSlots: i2, customerChoices: s2, minRemainingCapacity: c2, limit: ys, cursor: g2 });
|
|
2040
2051
|
m2.push(...t3.timeSlots), h2 = t3.timeZone ?? h2, g2 = t3.nextCursor ?? void 0;
|
|
2041
2052
|
} while (g2);
|
|
2042
2053
|
return { timeSlots: m2, timeZone: h2 };
|
|
2043
2054
|
}
|
|
2044
|
-
function
|
|
2055
|
+
function xs(e2) {
|
|
2045
2056
|
return { slotStart: e2.localStartDate, slotEnd: e2.localEndDate, eventId: e2.eventInfo?.eventId, scheduleId: e2.scheduleId ?? void 0, locationId: e2.location?._id ?? void 0, locationType: e2.location?.locationType ?? void 0 };
|
|
2046
2057
|
}
|
|
2047
|
-
function
|
|
2048
|
-
return e2?.options?.values?.[0]?.type ===
|
|
2058
|
+
function Ss(e2) {
|
|
2059
|
+
return e2?.options?.values?.[0]?.type === Ea.STAFF_MEMBER;
|
|
2049
2060
|
}
|
|
2050
|
-
function
|
|
2061
|
+
function Cs(e2) {
|
|
2051
2062
|
return e2.staffMemberDetails?.staffMembers ?? [];
|
|
2052
2063
|
}
|
|
2053
|
-
function
|
|
2064
|
+
function ws(e2, t2) {
|
|
2054
2065
|
let n2 = e2.workingHoursLocationCoverage;
|
|
2055
2066
|
return { staffMemberId: e2.staffMemberId ?? ``, name: e2.name ?? null, image: null, isSelected: t2 === e2.staffMemberId, ...n2 ? { locationCoverage: { availableAtAllLocations: n2.availableAtAllLocations ?? false, locationIds: n2.locationIds ?? [] } } : {} };
|
|
2056
2067
|
}
|
|
2057
|
-
function
|
|
2068
|
+
function Ts(e2, t2) {
|
|
2058
2069
|
let n2 = e2.locationCoverage;
|
|
2059
2070
|
return !n2 || n2.availableAtAllLocations || n2.locationIds.includes(t2);
|
|
2060
2071
|
}
|
|
2061
|
-
function
|
|
2062
|
-
return t2 ? e2.filter((e3) =>
|
|
2072
|
+
function Es(e2, t2) {
|
|
2073
|
+
return t2 ? e2.filter((e3) => Ts(e3, t2)) : e2;
|
|
2074
|
+
}
|
|
2075
|
+
function Ds(e2, t2) {
|
|
2076
|
+
let n2 = new Map(t2.map((e3) => [e3.staffMemberId, e3.locationCoverage]));
|
|
2077
|
+
return e2.choices.map((e3) => e3.choiceId).filter((e3) => e3 != null).map((e3) => ({ staffMemberId: e3, locationCoverage: n2.get(e3) }));
|
|
2078
|
+
}
|
|
2079
|
+
function Os(e2, t2, n2) {
|
|
2080
|
+
if (e2?.type !== `STAFF_MEMBER` || !n2) return;
|
|
2081
|
+
let r2 = Es(Ds(e2, t2), n2);
|
|
2082
|
+
return r2.length === 1 ? r2[0].staffMemberId : void 0;
|
|
2063
2083
|
}
|
|
2064
|
-
function
|
|
2084
|
+
function ks(e2, t2) {
|
|
2065
2085
|
if (t2.length === 0) return e2;
|
|
2066
|
-
let n2 = e2.filter((e3) =>
|
|
2086
|
+
let n2 = e2.filter((e3) => Es(t2, e3.id).length > 0);
|
|
2067
2087
|
return n2.length > 0 ? n2 : e2;
|
|
2068
2088
|
}
|
|
2069
|
-
function
|
|
2070
|
-
return
|
|
2089
|
+
function As(e2) {
|
|
2090
|
+
return Cs(e2).map((e3) => ws(e3, null));
|
|
2091
|
+
}
|
|
2092
|
+
function js(e2, t2, n2 = false) {
|
|
2093
|
+
let r2 = Ms(e2), i2 = r2.length === 1 ? r2[0].id : void 0, a2 = n2 || !i2 || r2.some((e3) => e3.id === t2);
|
|
2094
|
+
return t2 && a2 ? t2 : i2;
|
|
2095
|
+
}
|
|
2096
|
+
function Ms(e2) {
|
|
2097
|
+
return ks(Ja(e2), As(e2));
|
|
2071
2098
|
}
|
|
2072
|
-
function
|
|
2099
|
+
function Ns(e2) {
|
|
2073
2100
|
let t2 = e2;
|
|
2074
2101
|
if (t2.__state || (t2.__state = { status: `pending` }, t2.then((e3) => {
|
|
2075
2102
|
t2.__state = { status: `fulfilled`, value: e3 };
|
|
@@ -2078,33 +2105,33 @@ function ws(e2) {
|
|
|
2078
2105
|
})), t2.__state.status === `fulfilled`) return t2.__state.value;
|
|
2079
2106
|
throw t2.__state.status === `rejected` ? t2.__state.reason : t2;
|
|
2080
2107
|
}
|
|
2081
|
-
function
|
|
2108
|
+
function Ps(e2) {
|
|
2082
2109
|
let t2 = Promise.resolve(e2);
|
|
2083
2110
|
return t2.__state = { status: `fulfilled`, value: e2 }, t2;
|
|
2084
2111
|
}
|
|
2085
|
-
var
|
|
2086
|
-
function
|
|
2112
|
+
var Fs = Fr(`@wix/site-service-warmup-data`);
|
|
2113
|
+
function Is() {
|
|
2087
2114
|
try {
|
|
2088
2115
|
return (0, import_services_manager_react.useGetService)();
|
|
2089
2116
|
} catch {
|
|
2090
2117
|
return null;
|
|
2091
2118
|
}
|
|
2092
2119
|
}
|
|
2093
|
-
function
|
|
2120
|
+
function Ls(e2) {
|
|
2094
2121
|
try {
|
|
2095
|
-
return e2 ? e2(
|
|
2122
|
+
return e2 ? e2(Fs) : null;
|
|
2096
2123
|
} catch {
|
|
2097
2124
|
return null;
|
|
2098
2125
|
}
|
|
2099
2126
|
}
|
|
2100
|
-
function
|
|
2101
|
-
let e2 =
|
|
2127
|
+
function Rs() {
|
|
2128
|
+
let e2 = Ls(Is()), t2 = typeof window > `u`;
|
|
2102
2129
|
return { scope: e2 ?? void 0, get: async (n2) => {
|
|
2103
2130
|
if (t2 || !e2) return null;
|
|
2104
2131
|
try {
|
|
2105
2132
|
return await e2.get(n2);
|
|
2106
2133
|
} catch (e3) {
|
|
2107
|
-
return $(e3, { feature:
|
|
2134
|
+
return $(e3, { feature: Q.warmup, action: `read`, level: `warning`, contexts: { warmup: { key: n2 } } }), null;
|
|
2108
2135
|
}
|
|
2109
2136
|
}, set: (n2, r2) => {
|
|
2110
2137
|
if (t2 && e2) try {
|
|
@@ -2113,57 +2140,57 @@ function ks() {
|
|
|
2113
2140
|
}
|
|
2114
2141
|
} };
|
|
2115
2142
|
}
|
|
2116
|
-
var
|
|
2117
|
-
function
|
|
2118
|
-
return `${
|
|
2143
|
+
var zs = `bookings-uou`;
|
|
2144
|
+
function Bs() {
|
|
2145
|
+
return `${zs}:bookings-settings`;
|
|
2119
2146
|
}
|
|
2120
|
-
function
|
|
2121
|
-
return `${
|
|
2147
|
+
function Vs() {
|
|
2148
|
+
return `${zs}:time-slots-configuration`;
|
|
2122
2149
|
}
|
|
2123
|
-
var
|
|
2124
|
-
var
|
|
2125
|
-
var
|
|
2126
|
-
var
|
|
2127
|
-
function
|
|
2150
|
+
var Hs = 5e3;
|
|
2151
|
+
var Us = 100;
|
|
2152
|
+
var Ws = `wix-warmup-data`;
|
|
2153
|
+
var Gs = null;
|
|
2154
|
+
function Ks(e2) {
|
|
2128
2155
|
if (typeof document < `u`) try {
|
|
2129
|
-
let t2 = document.getElementById(
|
|
2130
|
-
return t2 ? (
|
|
2156
|
+
let t2 = document.getElementById(Ws)?.textContent;
|
|
2157
|
+
return t2 ? (Gs?.text !== t2 && (Gs = { text: t2, data: JSON.parse(t2).builderComponentsWarmupData ?? {} }), Gs.data[e2] ?? void 0) : void 0;
|
|
2131
2158
|
} catch {
|
|
2132
2159
|
return;
|
|
2133
2160
|
}
|
|
2134
2161
|
}
|
|
2135
|
-
var
|
|
2136
|
-
var
|
|
2137
|
-
var
|
|
2138
|
-
var
|
|
2139
|
-
function
|
|
2140
|
-
if (!e2) return
|
|
2141
|
-
let t2 =
|
|
2142
|
-
return t2 || (t2 =
|
|
2162
|
+
var qs = () => ({ promises: /* @__PURE__ */ new Map(), invalidatedWarmup: /* @__PURE__ */ new Set() });
|
|
2163
|
+
var Js = qs();
|
|
2164
|
+
var Ys = /* @__PURE__ */ new WeakMap();
|
|
2165
|
+
var Xs = /* @__PURE__ */ new WeakMap();
|
|
2166
|
+
function Zs(e2) {
|
|
2167
|
+
if (!e2) return Js;
|
|
2168
|
+
let t2 = Ys.get(e2);
|
|
2169
|
+
return t2 || (t2 = qs(), Ys.set(e2, t2)), t2;
|
|
2143
2170
|
}
|
|
2144
|
-
function
|
|
2171
|
+
function Qs({ key: e2, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
|
|
2145
2172
|
if (e2 === null) return n2();
|
|
2146
2173
|
if (typeof window > `u`) {
|
|
2147
2174
|
let r3 = () => n2().then((n3) => (t2.set(e2, n3), n3)), { scope: i3 } = t2;
|
|
2148
2175
|
if (!i3) return r3();
|
|
2149
|
-
let a3 =
|
|
2150
|
-
a3 || (a3 = /* @__PURE__ */ new Map(),
|
|
2176
|
+
let a3 = Xs.get(i3);
|
|
2177
|
+
a3 || (a3 = /* @__PURE__ */ new Map(), Xs.set(i3, a3));
|
|
2151
2178
|
let o3 = a3.get(e2);
|
|
2152
2179
|
if (o3) return o3;
|
|
2153
2180
|
let s3 = r3();
|
|
2154
2181
|
return a3.set(e2, s3), s3.catch(() => a3.delete(e2)), s3;
|
|
2155
2182
|
}
|
|
2156
|
-
let i2 =
|
|
2183
|
+
let i2 = Zs(t2.scope), a2 = Date.now();
|
|
2157
2184
|
for (let [e3, t3] of i2.promises) t3.expiresAt <= a2 && i2.promises.delete(e3);
|
|
2158
2185
|
let o2 = i2.promises.get(e2);
|
|
2159
2186
|
if (o2 && !r2) return o2.promise;
|
|
2160
2187
|
r2 && i2.invalidatedWarmup.add(e2);
|
|
2161
2188
|
let s2 = !i2.invalidatedWarmup.has(e2);
|
|
2162
2189
|
if (s2) {
|
|
2163
|
-
let t3 =
|
|
2190
|
+
let t3 = Ks(e2);
|
|
2164
2191
|
if (t3 !== void 0) {
|
|
2165
|
-
let n3 =
|
|
2166
|
-
return i2.promises.set(e2, { promise: n3, expiresAt: a2 +
|
|
2192
|
+
let n3 = Ps(t3);
|
|
2193
|
+
return i2.promises.set(e2, { promise: n3, expiresAt: a2 + Hs }), n3;
|
|
2167
2194
|
}
|
|
2168
2195
|
}
|
|
2169
2196
|
let c2 = (async () => {
|
|
@@ -2173,48 +2200,48 @@ function Us({ key: e2, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
|
|
|
2173
2200
|
}
|
|
2174
2201
|
return n2();
|
|
2175
2202
|
})();
|
|
2176
|
-
i2.promises.size >=
|
|
2203
|
+
i2.promises.size >= Us && i2.promises.delete(i2.promises.keys().next().value);
|
|
2177
2204
|
let l2 = { promise: c2, expiresAt: 1 / 0 };
|
|
2178
2205
|
return i2.promises.set(e2, l2), c2.then(() => {
|
|
2179
|
-
l2.expiresAt = Date.now() +
|
|
2206
|
+
l2.expiresAt = Date.now() + Hs;
|
|
2180
2207
|
}, () => {
|
|
2181
2208
|
i2.promises.get(e2) === l2 && i2.promises.delete(e2);
|
|
2182
2209
|
}), c2;
|
|
2183
2210
|
}
|
|
2184
|
-
var
|
|
2185
|
-
async function
|
|
2211
|
+
var $s = { displayTimeZonePolicy: { basedOn: Ha.BUSINESS_TIME_ZONE, customerCanChange: false }, multiServiceAppointmentsEnabled: false };
|
|
2212
|
+
async function ec() {
|
|
2186
2213
|
try {
|
|
2187
|
-
let e2 = await
|
|
2188
|
-
return { displayTimeZonePolicy: { basedOn: e2.displayTimeZone?.basedOn ??
|
|
2214
|
+
let e2 = await Ga();
|
|
2215
|
+
return { displayTimeZonePolicy: { basedOn: e2.displayTimeZone?.basedOn ?? Ha.BUSINESS_TIME_ZONE, customerCanChange: e2.displayTimeZone?.customerCanChange ?? false }, multiServiceAppointmentsEnabled: e2.multiServiceAppointments?.enabled ?? false };
|
|
2189
2216
|
} catch (e2) {
|
|
2190
|
-
return $(e2, { feature:
|
|
2217
|
+
return $(e2, { feature: Q.bookingsSettings, action: `fetch-bookings-settings`, level: `warning` }), $s;
|
|
2191
2218
|
}
|
|
2192
2219
|
}
|
|
2193
|
-
var
|
|
2194
|
-
var
|
|
2195
|
-
var
|
|
2196
|
-
function
|
|
2197
|
-
let e2 = (0, import_react.useContext)(
|
|
2198
|
-
if (!e2) throw Error(
|
|
2220
|
+
var tc = { isLoading: true };
|
|
2221
|
+
var nc = (0, import_react.createContext)(null);
|
|
2222
|
+
var rc = `useBookingsSettingsContext must be used within BookingsSettingsProvider`;
|
|
2223
|
+
function ic() {
|
|
2224
|
+
let e2 = (0, import_react.useContext)(nc);
|
|
2225
|
+
if (!e2) throw Error(rc);
|
|
2199
2226
|
return e2;
|
|
2200
2227
|
}
|
|
2201
|
-
function
|
|
2202
|
-
return e2.basedOn ===
|
|
2228
|
+
function ac(e2) {
|
|
2229
|
+
return e2.basedOn === Ha.CUSTOMER_TIME_ZONE ? Intl.DateTimeFormat().resolvedOptions().timeZone : void 0;
|
|
2203
2230
|
}
|
|
2204
|
-
function
|
|
2205
|
-
let e2 =
|
|
2206
|
-
return e2.isLoading ? void 0 :
|
|
2231
|
+
function oc() {
|
|
2232
|
+
let e2 = ic();
|
|
2233
|
+
return e2.isLoading ? void 0 : ac(e2.displayTimeZonePolicy);
|
|
2207
2234
|
}
|
|
2208
|
-
function
|
|
2209
|
-
let n2 =
|
|
2210
|
-
return (0, import_jsx_runtime.jsx)(
|
|
2235
|
+
function sc({ settingsPromise: e2, children: t2 }) {
|
|
2236
|
+
let n2 = Ns(e2), r2 = (0, import_react.useMemo)(() => ({ isLoading: false, ...n2 }), [n2]);
|
|
2237
|
+
return (0, import_jsx_runtime.jsx)(nc.Provider, { value: r2, children: t2 });
|
|
2211
2238
|
}
|
|
2212
|
-
function
|
|
2213
|
-
let r2 =
|
|
2214
|
-
return e2 ? (0, import_jsx_runtime.jsx)(
|
|
2239
|
+
function cc({ bookingsSettings: e2, children: n2 }) {
|
|
2240
|
+
let r2 = Rs(), [i2] = (0, import_react.useState)(() => e2 ? null : Qs({ key: Bs(), warmupData: r2, fetchData: ec }));
|
|
2241
|
+
return e2 ? (0, import_jsx_runtime.jsx)(nc.Provider, { value: { isLoading: false, ...e2 }, children: n2 }) : (0, import_jsx_runtime.jsx)(import_react.Suspense, { fallback: (0, import_jsx_runtime.jsx)(nc.Provider, { value: tc, children: n2 }), children: (0, import_jsx_runtime.jsx)(sc, { settingsPromise: i2, children: n2 }) });
|
|
2215
2242
|
}
|
|
2216
|
-
var
|
|
2217
|
-
var
|
|
2243
|
+
var lc = 1e3;
|
|
2244
|
+
var uc = class extends import_react.Component {
|
|
2218
2245
|
state = { hasError: false };
|
|
2219
2246
|
static getDerivedStateFromError() {
|
|
2220
2247
|
return { hasError: true };
|
|
@@ -2226,16 +2253,16 @@ var tc = class extends import_react.Component {
|
|
|
2226
2253
|
return this.state.hasError ? this.props.fallback : this.props.children;
|
|
2227
2254
|
}
|
|
2228
2255
|
};
|
|
2229
|
-
var
|
|
2230
|
-
function
|
|
2231
|
-
let t2 = e2.searchParams.get(
|
|
2256
|
+
var dc = `appSectionParams`;
|
|
2257
|
+
function fc(e2) {
|
|
2258
|
+
let t2 = e2.searchParams.get(dc);
|
|
2232
2259
|
if (t2 === null) return e2;
|
|
2233
2260
|
let n2 = new URL(e2);
|
|
2234
|
-
n2.searchParams.delete(
|
|
2235
|
-
for (let [e3, r2] of Object.entries(
|
|
2261
|
+
n2.searchParams.delete(dc);
|
|
2262
|
+
for (let [e3, r2] of Object.entries(pc(t2))) typeof r2 == `string` && !n2.searchParams.has(e3) && n2.searchParams.set(e3, r2);
|
|
2236
2263
|
return n2;
|
|
2237
2264
|
}
|
|
2238
|
-
function
|
|
2265
|
+
function pc(e2) {
|
|
2239
2266
|
try {
|
|
2240
2267
|
let t2 = JSON.parse(e2);
|
|
2241
2268
|
return t2 && typeof t2 == `object` && !Array.isArray(t2) ? t2 : {};
|
|
@@ -2243,16 +2270,16 @@ function ic(e2) {
|
|
|
2243
2270
|
return {};
|
|
2244
2271
|
}
|
|
2245
2272
|
}
|
|
2246
|
-
var
|
|
2247
|
-
var
|
|
2273
|
+
var mc = `bookings-uou:url-change`;
|
|
2274
|
+
var hc = (e2) => {
|
|
2248
2275
|
let t2 = new URL(e2);
|
|
2249
2276
|
return t2.searchParams.sort(), t2.href;
|
|
2250
2277
|
};
|
|
2251
|
-
function
|
|
2278
|
+
function gc(e2, { disableScrollToTop: t2, skipHistory: n2 } = {}) {
|
|
2252
2279
|
let r2 = globalThis.window;
|
|
2253
2280
|
if (!r2?.history) return;
|
|
2254
2281
|
let i2 = new URL(r2.location.href);
|
|
2255
|
-
if (
|
|
2282
|
+
if (hc(i2) === hc(e2)) return;
|
|
2256
2283
|
let a2 = { scrollY: r2.scrollY };
|
|
2257
2284
|
if (n2) r2.history.replaceState(a2, ``, e2.href);
|
|
2258
2285
|
else {
|
|
@@ -2263,82 +2290,86 @@ function sc(e2, { disableScrollToTop: t2, skipHistory: n2 } = {}) {
|
|
|
2263
2290
|
return;
|
|
2264
2291
|
}
|
|
2265
2292
|
}
|
|
2266
|
-
r2.dispatchEvent(new Event(
|
|
2293
|
+
r2.dispatchEvent(new Event(mc));
|
|
2267
2294
|
}
|
|
2268
|
-
function
|
|
2295
|
+
function _c(e2) {
|
|
2269
2296
|
let t2 = globalThis.window;
|
|
2270
|
-
return t2 ? (t2.addEventListener(
|
|
2271
|
-
t2.removeEventListener(
|
|
2297
|
+
return t2 ? (t2.addEventListener(mc, e2), t2.addEventListener(`popstate`, e2), () => {
|
|
2298
|
+
t2.removeEventListener(mc, e2), t2.removeEventListener(`popstate`, e2);
|
|
2272
2299
|
}) : () => {
|
|
2273
2300
|
};
|
|
2274
2301
|
}
|
|
2275
|
-
var
|
|
2302
|
+
var vc = (e2) => {
|
|
2276
2303
|
try {
|
|
2277
2304
|
return decodeURIComponent(e2);
|
|
2278
2305
|
} catch {
|
|
2279
2306
|
return e2;
|
|
2280
2307
|
}
|
|
2281
2308
|
};
|
|
2282
|
-
function
|
|
2309
|
+
function yc(e2, t2) {
|
|
2283
2310
|
let n2 = t2 ? new URL(t2).pathname : `/`;
|
|
2284
|
-
return `./${
|
|
2311
|
+
return `./${vc(new URL(e2).pathname.replace(n2, ``).replace(/^\/|\/$/g, ``))}`;
|
|
2285
2312
|
}
|
|
2286
|
-
function
|
|
2287
|
-
let e2 = (0, import_services_manager_react.useService)(
|
|
2288
|
-
return { pathname: i2.pathname, search: i2.search, searchParams: i2.searchParams, href: i2.href, getParsedUrl: () =>
|
|
2313
|
+
function bc() {
|
|
2314
|
+
let e2 = (0, import_services_manager_react.useService)(zr), t2 = (0, import_react.useCallback)(() => e2.currentUrl, [e2]), n2 = (0, import_react.useSyncExternalStore)(_c, t2, t2), i2 = (0, import_react.useMemo)(() => fc(new URL(n2)), [n2]), a2 = e2.siteUrl.replace(/\/$/, ``);
|
|
2315
|
+
return { pathname: i2.pathname, search: i2.search, searchParams: i2.searchParams, href: i2.href, getParsedUrl: () => fc(new URL(e2.currentUrl)), getRelativeUrl: () => yc(e2.currentUrl, a2), getExternalBaseUrl: () => a2, pushUrl: gc };
|
|
2289
2316
|
}
|
|
2290
|
-
var
|
|
2291
|
-
function
|
|
2317
|
+
var xc = Fr(`@wix/site-service-business-logger`);
|
|
2318
|
+
function Sc(e2) {
|
|
2292
2319
|
return { evid: 32, src: 16, endpoint: ``, params: e2 };
|
|
2293
2320
|
}
|
|
2294
|
-
function
|
|
2321
|
+
function Cc(e2) {
|
|
2295
2322
|
return { evid: 33, src: 16, endpoint: ``, params: e2 };
|
|
2296
2323
|
}
|
|
2297
|
-
function
|
|
2324
|
+
function wc(e2) {
|
|
2298
2325
|
return { evid: 34, src: 16, endpoint: ``, params: e2 };
|
|
2299
2326
|
}
|
|
2300
|
-
var
|
|
2301
|
-
|
|
2302
|
-
var
|
|
2303
|
-
var
|
|
2304
|
-
var
|
|
2305
|
-
var
|
|
2306
|
-
|
|
2327
|
+
var Tc = { 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` };
|
|
2328
|
+
Gr.BOOK_ONLINE;
|
|
2329
|
+
var Ec = `new_bookings_server`;
|
|
2330
|
+
var Dc = { LOAD: `load`, LOCATION_CHOSEN: `location chosen`, STAFF_CHOSEN: `staff chosen`, VARIANT_SELECTED: `variant selected`, ADD_ON_SELECTED: `add on selected`, ADD_ON_UNSELECTED: `add on unselected`, BACK: `back`, CLOSE: `close`, STAY: `stay`, ADD_SERVICE: `add service`, EDIT_BASKET_ITEM: `edit basket item`, EDIT_BASKET_ITEM_FROM_CALENDAR: `edit basket item from calendar`, CHANGE_STAFF_MEMBER: `change staff member`, REMOVE_BASKET_ITEM: `remove basket item`, SELECT_SERVICE: `select service`, SEARCH: `search`, CLEAR_SEARCH: `clear search` };
|
|
2331
|
+
var Oc = { TIMEZONE_PICKER: `timezone_picker`, TIME_PICKER: `time_picker`, BOOKING_DETAILS: `booking_details`, RESCHEDULE_DIALOG: `reschedule_dialog` };
|
|
2332
|
+
var kc = { DROPDOWN: `dropdown`, TIME_SLOT: `time_slot`, EXPAND: `expand`, COLLAPSE: `collapse` };
|
|
2333
|
+
var Ac = (e2) => {
|
|
2334
|
+
let { reportBi: t2 } = (0, import_services_manager_react.useService)(xc);
|
|
2307
2335
|
return (0, import_react.useCallback)((n2) => {
|
|
2308
|
-
t2({ widget_name: e2, bookingsPlatform:
|
|
2336
|
+
t2({ widget_name: e2, bookingsPlatform: Ec, is_over_editor: false, ...n2.params, src: n2.src, evid: n2.evid }, { endpoint: n2.endpoint });
|
|
2309
2337
|
}, [t2, e2]);
|
|
2310
2338
|
};
|
|
2311
|
-
var
|
|
2312
|
-
let n2 =
|
|
2339
|
+
var jc = (e2, t2 = true) => {
|
|
2340
|
+
let n2 = Ac(e2), { getParsedUrl: r2 } = bc(), i2 = (0, import_react.useRef)(false);
|
|
2313
2341
|
(0, import_react.useEffect)(() => {
|
|
2314
|
-
t2 && !i2.current && (i2.current = true, n2(
|
|
2342
|
+
t2 && !i2.current && (i2.current = true, n2(Sc({ referralInfo: r2().searchParams.get(eo.referral) ?? void 0 })));
|
|
2315
2343
|
}, [t2, n2, r2]);
|
|
2316
2344
|
};
|
|
2317
|
-
function
|
|
2345
|
+
function Mc(e2) {
|
|
2346
|
+
return { evid: 1177, src: 16, endpoint: `wixboost-ugc`, params: e2 };
|
|
2347
|
+
}
|
|
2348
|
+
function Nc(e2) {
|
|
2318
2349
|
return { evid: 596, src: 16, endpoint: `wixboost-ugc`, params: e2 };
|
|
2319
2350
|
}
|
|
2320
|
-
function
|
|
2351
|
+
function Pc(e2, t2) {
|
|
2321
2352
|
let n2 = new Intl.DateTimeFormat(`en-US`, { timeZone: t2, hourCycle: `h23`, year: `numeric`, month: `2-digit`, day: `2-digit`, hour: `2-digit`, minute: `2-digit`, second: `2-digit` }).formatToParts(new Date(e2)), r2 = {};
|
|
2322
2353
|
for (let e3 of n2) e3.type !== `literal` && (r2[e3.type] = Number(e3.value));
|
|
2323
2354
|
return Date.UTC(r2.year, r2.month - 1, r2.day, r2.hour, r2.minute, r2.second) - e2;
|
|
2324
2355
|
}
|
|
2325
|
-
function
|
|
2356
|
+
function Fc(e2, t2) {
|
|
2326
2357
|
let n2 = e2.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2}))?/);
|
|
2327
2358
|
if (!n2) return null;
|
|
2328
2359
|
let [, r2, i2, a2, o2, s2, c2] = n2, l2 = Date.UTC(Number(r2), Number(i2) - 1, Number(a2), Number(o2), Number(s2), c2 ? Number(c2) : 0);
|
|
2329
2360
|
if (Number.isNaN(l2)) return null;
|
|
2330
2361
|
try {
|
|
2331
|
-
let e3 = l2 -
|
|
2332
|
-
return new Date(l2 -
|
|
2362
|
+
let e3 = l2 - Pc(l2, t2);
|
|
2363
|
+
return new Date(l2 - Pc(e3, t2));
|
|
2333
2364
|
} catch {
|
|
2334
2365
|
return null;
|
|
2335
2366
|
}
|
|
2336
2367
|
}
|
|
2337
|
-
function
|
|
2338
|
-
let i2 = (e3) => e3 && n2 ?
|
|
2339
|
-
return
|
|
2368
|
+
function Ic({ start: e2, end: t2, timeZone: n2, ...r2 }) {
|
|
2369
|
+
let i2 = (e3) => e3 && n2 ? Fc(e3, n2)?.getTime() : void 0;
|
|
2370
|
+
return wc({ bookingsServiceId: r2.serviceId, serviceType: r2.serviceType, startTime: i2(e2), endTime: i2(t2), isEligibleForFlowCompletion: r2.isEligibleForFlowCompletion });
|
|
2340
2371
|
}
|
|
2341
|
-
function
|
|
2372
|
+
function Lc({ nextAvailableSlotsCount: e2, isLoading: t2, hasError: n2, children: r2 }) {
|
|
2342
2373
|
let i2 = n2 ? `loadFailed` : null, a2 = { selectedDate: null, daysAvailabilityRange: null, daysAvailability: [], daysAvailabilityLoading: false, daysAvailabilityHasError: false, timeSlotsLoading: t2, timeSlotsErrorCode: i2, selectDate: async () => {
|
|
2343
2374
|
}, setDaysAvailabilityRange: async () => {
|
|
2344
2375
|
}, nextDaysAvailabilityRange: async () => {
|
|
@@ -2354,107 +2385,107 @@ function Ec({ nextAvailableSlotsCount: e2, isLoading: t2, hasError: n2, children
|
|
|
2354
2385
|
}, navigateToBookingForm: () => {
|
|
2355
2386
|
}, timeSlotLimitPerDay: null, expandedDates: /* @__PURE__ */ new Set(), daysWithMore: /* @__PURE__ */ new Set(), loadingDate: null, loadAllTimeSlotsForDay: async () => {
|
|
2356
2387
|
} };
|
|
2357
|
-
return (0, import_jsx_runtime.jsx)(
|
|
2388
|
+
return (0, import_jsx_runtime.jsx)(Gl.Provider, { value: a2, children: r2 });
|
|
2358
2389
|
}
|
|
2359
|
-
function
|
|
2360
|
-
return (0, import_jsx_runtime.jsx)(
|
|
2390
|
+
function Rc({ nextAvailableSlotsCount: e2, children: t2 }) {
|
|
2391
|
+
return (0, import_jsx_runtime.jsx)(Lc, { nextAvailableSlotsCount: e2, isLoading: true, hasError: false, children: t2 });
|
|
2361
2392
|
}
|
|
2362
|
-
function
|
|
2363
|
-
return (0, import_jsx_runtime.jsx)(
|
|
2393
|
+
function zc({ nextAvailableSlotsCount: e2, children: t2 }) {
|
|
2394
|
+
return (0, import_jsx_runtime.jsx)(Lc, { nextAvailableSlotsCount: e2, isLoading: false, hasError: true, children: t2 });
|
|
2364
2395
|
}
|
|
2365
|
-
var
|
|
2366
|
-
function
|
|
2396
|
+
var Bc = 1e3;
|
|
2397
|
+
function Vc(e2, t2) {
|
|
2367
2398
|
let n2 = /* @__PURE__ */ new Map();
|
|
2368
2399
|
for (let e3 of t2) {
|
|
2369
2400
|
let t3 = e3.localStartDate?.slice(0, 10);
|
|
2370
2401
|
t3 && (e3.bookable ? n2.set(t3, `available`) : n2.has(t3) || n2.set(t3, `unavailable`));
|
|
2371
2402
|
}
|
|
2372
|
-
let r2 = [], i2 =
|
|
2403
|
+
let r2 = [], i2 = Bo(e2);
|
|
2373
2404
|
for (let t3 = 0; t3 < i2; t3 += 1) {
|
|
2374
|
-
let i3 =
|
|
2405
|
+
let i3 = zo(e2.startDate, t3);
|
|
2375
2406
|
r2.push({ date: i3, availability: n2.get(i3) ?? `none` });
|
|
2376
2407
|
}
|
|
2377
2408
|
return r2;
|
|
2378
2409
|
}
|
|
2379
|
-
function
|
|
2380
|
-
return { fromLocalDate:
|
|
2410
|
+
function Hc(e2, t2) {
|
|
2411
|
+
return { fromLocalDate: Po(e2.startDate, t2), toLocalDate: Mo(ko(e2.endDate)) };
|
|
2381
2412
|
}
|
|
2382
|
-
async function
|
|
2383
|
-
return (await
|
|
2413
|
+
async function Uc(e2, t2, n2, r2, i2, a2) {
|
|
2414
|
+
return (await us({ serviceId: e2, ...Hc(n2, t2), timeZone: t2, ...$o(r2), ...es(i2), ...ns(a2, i2), timeSlotsPerDay: 1, cursorPaging: { limit: Math.min(Bo(n2), Bc) } })).timeSlots ?? [];
|
|
2384
2415
|
}
|
|
2385
|
-
async function
|
|
2386
|
-
return (await
|
|
2416
|
+
async function Wc(e2, t2, n2, r2, i2, a2) {
|
|
2417
|
+
return (await fs({ serviceIds: [e2], ...Hc(n2, t2), timeZone: t2, includeNonBookable: true, eventFilter: { type: `CLASS`, ...ds(r2, i2, a2) }, maxSlotsPerDay: 1, cursorPaging: { limit: Math.min(Bo(n2), Bc) } })).timeSlots;
|
|
2387
2418
|
}
|
|
2388
|
-
async function
|
|
2389
|
-
if (
|
|
2390
|
-
let l2 = { startDate: n2.startDate < r2 ? r2 : n2.startDate, endDate: n2.endDate }, u2 =
|
|
2391
|
-
return
|
|
2419
|
+
async function Gc({ serviceId: e2, serviceType: t2, range: n2, fromDate: r2, timeZone: i2, locationId: a2, staffId: o2, customerChoices: s2, minRemainingCapacity: c2 }) {
|
|
2420
|
+
if (Za(t2) || n2.endDate < r2) return Vc(n2, []);
|
|
2421
|
+
let l2 = { startDate: n2.startDate < r2 ? r2 : n2.startDate, endDate: n2.endDate }, u2 = Xa(t2) ? Ko(l2) : [l2];
|
|
2422
|
+
return Vc(n2, (await Promise.all(u2.map((n3) => Xa(t2) ? Wc(e2, i2, n3, a2, o2, c2) : Uc(e2, i2, n3, a2, o2, s2)))).flat());
|
|
2392
2423
|
}
|
|
2393
|
-
function
|
|
2424
|
+
function Kc({ serviceId: e2, staff: t2, customerChoices: n2 }) {
|
|
2394
2425
|
let r2 = t2 && !t2.anyResource ? t2.staffMemberId : void 0;
|
|
2395
|
-
return { serviceId: e2, ...
|
|
2426
|
+
return { serviceId: e2, ...ns(n2, r2), ...t2?.anyResource ? {} : { includeResourceTypeIds: [Wr] }, ...r2 ? { resourceTypes: [{ resourceTypeId: Wr, resourceIds: [r2] }] } : {} };
|
|
2396
2427
|
}
|
|
2397
|
-
function
|
|
2398
|
-
return { services: e2.map(
|
|
2428
|
+
function qc({ services: e2, locationId: t2, locationType: n2, timeZone: r2 }) {
|
|
2429
|
+
return { services: e2.map(Kc), timeZone: r2, location: { ...t2 ? { _id: t2 } : {}, locationType: n2 } };
|
|
2399
2430
|
}
|
|
2400
|
-
function
|
|
2401
|
-
let { customerChoices: t2, ...n2 } = e2, r2 = t2 ?
|
|
2431
|
+
function Jc(e2) {
|
|
2432
|
+
let { customerChoices: t2, ...n2 } = e2, r2 = t2 ? ts(t2) : void 0;
|
|
2402
2433
|
return r2 ? { ...n2, customerChoices: r2 } : n2;
|
|
2403
2434
|
}
|
|
2404
|
-
async function
|
|
2405
|
-
let t2 = e2.services ?? [], n2 = () =>
|
|
2406
|
-
if (r2 &&
|
|
2435
|
+
async function Yc(e2) {
|
|
2436
|
+
let t2 = e2.services ?? [], n2 = () => Ta({ ...e2, services: t2.map(Jc) }), r2 = t2.some((e3) => e3.customerChoices?.requestedGender);
|
|
2437
|
+
if (r2 && ss()) return n2();
|
|
2407
2438
|
try {
|
|
2408
|
-
return await
|
|
2439
|
+
return await Ta(e2);
|
|
2409
2440
|
} catch (e3) {
|
|
2410
|
-
if (!r2 ||
|
|
2411
|
-
return $(e3, { feature:
|
|
2441
|
+
if (!r2 || !is(e3)) throw e3;
|
|
2442
|
+
return $(e3, { feature: Q.timeSlots, action: `requested-gender-rejected`, level: `warning` }), ls(), n2();
|
|
2412
2443
|
}
|
|
2413
2444
|
}
|
|
2414
|
-
var
|
|
2415
|
-
async function
|
|
2416
|
-
if (e2.endDate < t2) return
|
|
2445
|
+
var Xc = 1e3;
|
|
2446
|
+
async function Zc({ range: e2, fromDate: t2, ...n2 }) {
|
|
2447
|
+
if (e2.endDate < t2) return Vc(e2, []);
|
|
2417
2448
|
let r2 = { startDate: e2.startDate < t2 ? t2 : e2.startDate, endDate: e2.endDate };
|
|
2418
|
-
return
|
|
2449
|
+
return Vc(e2, (await Yc({ ...qc(n2), fromLocalDate: Po(r2.startDate, n2.timeZone), toLocalDate: Mo(ko(r2.endDate)), timeSlotsPerDay: 1, cursorPaging: { limit: Math.min(Bo(r2), Xc) } })).timeSlots ?? []);
|
|
2419
2450
|
}
|
|
2420
|
-
async function
|
|
2451
|
+
async function Qc({ date: e2, onlyAvailableSlots: t2, fromLocalDate: n2, ...r2 }) {
|
|
2421
2452
|
let i2 = `${e2}T00:00:00`, a2 = [], o2 = null, s2;
|
|
2422
2453
|
do {
|
|
2423
|
-
let c2 = await
|
|
2454
|
+
let c2 = await Yc({ ...qc(r2), fromLocalDate: n2 && n2 > i2 ? n2 : i2, toLocalDate: `${e2}T23:59:59`, ...t2 ? { bookable: true } : {}, cursorPaging: { limit: Xc, ...s2 ? { cursor: s2 } : {} } });
|
|
2424
2455
|
a2.push(...c2.timeSlots ?? []), o2 = c2.timeZone ?? o2, s2 = c2.cursorPagingMetadata?.cursors?.next || void 0;
|
|
2425
2456
|
} while (s2);
|
|
2426
2457
|
return { timeSlots: a2, timeZone: o2 };
|
|
2427
2458
|
}
|
|
2428
|
-
async function
|
|
2429
|
-
let n2 = await
|
|
2459
|
+
async function $c({ fromDate: e2, ...t2 }) {
|
|
2460
|
+
let n2 = await Yc({ ...qc(t2), ..._s(e2), bookable: true, cursorPaging: { limit: 1 } });
|
|
2430
2461
|
return { timeSlots: n2.timeSlots ?? [], timeZone: n2.timeZone ?? null };
|
|
2431
2462
|
}
|
|
2432
|
-
var
|
|
2433
|
-
function
|
|
2434
|
-
let [_2, v2] = (0, import_react.useState)(null), [y2, b2] = (0, import_react.useState)(p2), [x2, S2] = (0, import_react.useState)(
|
|
2463
|
+
var el = [];
|
|
2464
|
+
function tl({ enabled: e2, serviceId: t2, serviceType: n2, multiServiceRequest: i2, timeZone: l2, today: u2, locationId: d2, staffId: f2, loadInitially: p2, customerChoices: m2, minRemainingCapacity: h2, onlyAvailableSlots: g2 }) {
|
|
2465
|
+
let [_2, v2] = (0, import_react.useState)(null), [y2, b2] = (0, import_react.useState)(p2), [x2, S2] = (0, import_react.useState)(el), [C2, w2] = (0, import_react.useState)(false), [T2, ee2] = (0, import_react.useState)(false), E2 = (0, import_react.useRef)(0);
|
|
2435
2466
|
(0, import_react.useEffect)(() => {
|
|
2436
|
-
_2 === null && u2 && v2(
|
|
2467
|
+
_2 === null && u2 && v2(Vo(u2));
|
|
2437
2468
|
}, [_2, u2]), (0, import_react.useEffect)(() => {
|
|
2438
|
-
if (!y2 || !e2 || !(t2 || i2) || !l2 || !u2 || !_2 || !i2 &&
|
|
2469
|
+
if (!y2 || !e2 || !(t2 || i2) || !l2 || !u2 || !_2 || !i2 && Za(n2)) return;
|
|
2439
2470
|
let r2 = ++E2.current;
|
|
2440
|
-
return w2(true), (i2 ?
|
|
2471
|
+
return w2(true), (i2 ? Zc({ ...i2, range: _2, fromDate: u2, timeZone: l2 }) : Gc({ serviceId: t2, serviceType: n2, range: _2, fromDate: u2, timeZone: l2, locationId: d2 ?? void 0, staffId: f2 ?? void 0, customerChoices: m2, minRemainingCapacity: h2 })).then((e3) => {
|
|
2441
2472
|
r2 === E2.current && (S2(e3), ee2(false), w2(false));
|
|
2442
2473
|
}).catch((e3) => {
|
|
2443
|
-
r2 === E2.current && ($(e3, { feature:
|
|
2474
|
+
r2 === E2.current && ($(e3, { feature: Q.timeSlots, action: `fetch-days-availability`, level: `warning` }), ee2(true), w2(false));
|
|
2444
2475
|
}), () => {
|
|
2445
2476
|
r2 === E2.current && (E2.current += 1);
|
|
2446
2477
|
};
|
|
2447
2478
|
}, [y2, e2, t2, n2, i2, l2, u2, _2, d2, f2, m2, h2]);
|
|
2448
2479
|
let D2 = (0, import_react.useCallback)(async (e3) => {
|
|
2449
|
-
|
|
2480
|
+
Ro(e3) && (v2(e3), b2(true));
|
|
2450
2481
|
}, []), O2 = (0, import_react.useCallback)(async () => {
|
|
2451
|
-
v2((e3) => e3 &&
|
|
2482
|
+
v2((e3) => e3 && Uo(e3, 1)), b2(true);
|
|
2452
2483
|
}, []), te2 = (0, import_react.useCallback)(async () => {
|
|
2453
|
-
v2((e3) => e3 &&
|
|
2484
|
+
v2((e3) => e3 && Uo(e3, -1)), b2(true);
|
|
2454
2485
|
}, []);
|
|
2455
2486
|
return { range: _2, daysAvailability: (0, import_react.useMemo)(() => g2 ? x2.map((e3) => e3.availability === `unavailable` ? { ...e3, availability: `none` } : e3) : x2, [x2, g2]), isLoading: C2, hasError: T2, setRange: D2, nextRange: O2, previousRange: te2 };
|
|
2456
2487
|
}
|
|
2457
|
-
function
|
|
2488
|
+
function nl({ enabled: e2, serviceId: t2, serviceType: n2, multiServiceRequest: i2, timeZone: o2, today: l2, locationId: u2, staffId: d2, customerChoices: f2, minRemainingCapacity: p2, onlyAvailableSlots: m2, serviceLoading: h2 }) {
|
|
2458
2489
|
let [g2, _2] = (0, import_react.useState)(null), [v2, y2] = (0, import_react.useState)(0), [b2, x2] = (0, import_react.useState)(null), [S2, C2] = (0, import_react.useState)(null), [w2, T2] = (0, import_react.useState)(null), [ee2, E2] = (0, import_react.useState)(false), D2 = (0, import_react.useRef)(0), O2 = (0, import_react.useRef)(0), te2 = (0, import_react.useRef)(0), k2 = (0, import_react.useCallback)(() => {
|
|
2459
2490
|
O2.current += 1, E2(false);
|
|
2460
2491
|
}, []);
|
|
@@ -2475,99 +2506,147 @@ function Gc({ enabled: e2, serviceId: t2, serviceType: n2, multiServiceRequest:
|
|
|
2475
2506
|
_2(null);
|
|
2476
2507
|
return;
|
|
2477
2508
|
}
|
|
2478
|
-
if (!i2 &&
|
|
2509
|
+
if (!i2 && Za(n2)) {
|
|
2479
2510
|
_2(null);
|
|
2480
2511
|
return;
|
|
2481
2512
|
}
|
|
2482
|
-
let r2 =
|
|
2513
|
+
let r2 = No(new Date(Date.now()), o2), a2 = ++D2.current;
|
|
2483
2514
|
x2(null), C2(null), T2(null);
|
|
2484
2515
|
let s2 = r2.slice(0, 10) === g2.date ? r2 : void 0;
|
|
2485
|
-
return (i2 ?
|
|
2516
|
+
return (i2 ? Qc({ ...i2, date: g2.date, timeZone: o2, onlyAvailableSlots: m2, fromLocalDate: s2 }) : bs({ serviceId: t2, serviceType: n2, date: g2.date, timeZone: o2, onlyAvailableSlots: m2, locationId: u2 ?? void 0, staffId: d2 ?? void 0, customerChoices: f2, minRemainingCapacity: p2, fromLocalDate: s2 })).then((e3) => {
|
|
2486
2517
|
a2 === D2.current && x2({ timeSlots: e3.timeSlots, timeZone: e3.timeZone ?? o2 });
|
|
2487
2518
|
}).catch((e3) => {
|
|
2488
|
-
a2 === D2.current && ($(e3, { feature:
|
|
2519
|
+
a2 === D2.current && ($(e3, { feature: Q.timeSlots, action: `fetch-day-time-slots`, level: `warning` }), C2(`timeSlotsLoadFailed`));
|
|
2489
2520
|
}), () => {
|
|
2490
2521
|
a2 === D2.current && (D2.current += 1);
|
|
2491
2522
|
};
|
|
2492
2523
|
}, [g2, v2, e2, t2, h2, n2, i2, o2, l2, u2, d2, f2, p2, m2]);
|
|
2493
2524
|
let ne2 = (0, import_react.useCallback)(async (e3) => {
|
|
2494
|
-
!i2 &&
|
|
2525
|
+
!i2 && Za(n2) || !Lo(e3) || l2 && e3 < l2 || (k2(), y2((e4) => e4 + 1), _2({ kind: `day`, date: e3 }));
|
|
2495
2526
|
}, [n2, i2, l2, k2]), re2 = g2?.date ?? null, j2 = (0, import_react.useCallback)(async () => {
|
|
2496
2527
|
let r2 = !!(t2 || i2);
|
|
2497
|
-
if (!i2 &&
|
|
2528
|
+
if (!i2 && Za(n2) || !e2 || !r2 || !o2) return { outcome: `none` };
|
|
2498
2529
|
let a2 = D2.current, s2 = ++O2.current, c2 = ++te2.current, m3 = () => a2 === D2.current && s2 === O2.current;
|
|
2499
2530
|
E2(true), T2(null);
|
|
2500
2531
|
try {
|
|
2501
|
-
let e3 = re2 ?? l2 ?? void 0, r3 = i2 ? await
|
|
2532
|
+
let e3 = re2 ?? l2 ?? void 0, r3 = i2 ? await $c({ ...i2, timeZone: o2, fromDate: e3 }) : await vs({ serviceId: t2, serviceType: n2, timeZone: o2, limit: 1, onlyAvailableSlots: true, fromDate: e3, locationId: u2 ?? void 0, staffId: d2 ?? void 0, customerChoices: f2, minRemainingCapacity: p2 });
|
|
2502
2533
|
if (!m3()) return { outcome: `cancelled` };
|
|
2503
2534
|
let a3 = r3.timeSlots[0]?.localStartDate?.slice(0, 10) ?? null;
|
|
2504
2535
|
return a3 ? { outcome: `found`, date: a3 } : { outcome: `none` };
|
|
2505
2536
|
} catch (e3) {
|
|
2506
|
-
return m3() ? ($(e3, { feature:
|
|
2537
|
+
return m3() ? ($(e3, { feature: Q.timeSlots, action: `find-next-available-date`, level: `warning` }), T2(`timeSlotsLoadFailed`), { outcome: `error` }) : { outcome: `cancelled` };
|
|
2507
2538
|
} finally {
|
|
2508
2539
|
c2 === te2.current && E2(false);
|
|
2509
2540
|
}
|
|
2510
2541
|
}, [e2, t2, n2, i2, o2, l2, u2, d2, f2, p2, re2]), ie2 = w2 ?? S2;
|
|
2511
2542
|
return { query: g2, selectedDate: re2, timeSlots: b2?.timeSlots ?? null, timeZone: b2?.timeZone ?? null, isLoading: ee2 || g2 !== null && b2 === null && S2 === null, error: ie2, selectDate: ne2, findNextAvailableDate: j2 };
|
|
2512
2543
|
}
|
|
2513
|
-
|
|
2544
|
+
var rl = (e2) => e2?.type === `DATE_TIME`;
|
|
2545
|
+
function il(e2) {
|
|
2546
|
+
let t2 = e2.schedule?.availabilityConstraints?.durations;
|
|
2547
|
+
if (!Ya(e2.type) || !Array.isArray(t2)) return false;
|
|
2548
|
+
let n2 = t2.map((e3) => typeof e3 == `number` ? e3 : e3?.minutes);
|
|
2549
|
+
return new Set(n2).size > 1;
|
|
2550
|
+
}
|
|
2551
|
+
function al({ service: e2, multiServiceAppointmentsEnabled: t2, variants: n2, locationId: r2 }) {
|
|
2552
|
+
if (!Ya(e2.type)) return false;
|
|
2553
|
+
if (t2 || il(e2) || $a(e2)) return true;
|
|
2554
|
+
if (!Qa(e2) || rl(n2)) return false;
|
|
2555
|
+
let i2 = js(e2, r2);
|
|
2556
|
+
return r2 && i2 !== r2 ? true : !Os(n2, As(e2), i2);
|
|
2557
|
+
}
|
|
2558
|
+
function ol(e2, t2) {
|
|
2559
|
+
return !!Pr(e2)?.services.some((e3) => e3.serviceId === t2);
|
|
2560
|
+
}
|
|
2561
|
+
function sl({ blobParam: e2, ...t2 }) {
|
|
2562
|
+
return !t2.service._id || ol(e2, t2.service._id) ? false : al({ ...t2, multiServiceAppointmentsEnabled: false });
|
|
2563
|
+
}
|
|
2564
|
+
function cl(e2) {
|
|
2565
|
+
return !!e2?._id;
|
|
2566
|
+
}
|
|
2567
|
+
function ll() {
|
|
2568
|
+
try {
|
|
2569
|
+
return (0, import_services_manager_react.useGetService)();
|
|
2570
|
+
} catch {
|
|
2571
|
+
return null;
|
|
2572
|
+
}
|
|
2573
|
+
}
|
|
2574
|
+
function ul() {
|
|
2575
|
+
let e2 = ll();
|
|
2576
|
+
return (0, import_react.useCallback)((t2) => {
|
|
2577
|
+
if (!e2) return false;
|
|
2578
|
+
try {
|
|
2579
|
+
let n2 = e2(Lr).currentPage;
|
|
2580
|
+
return !n2.popup && (!n2.appDefinitionId || n2.appDefinitionId === `13d21c63-b5ec-5912-8397-c3a5ddb27a97`) && n2.appPageId === t2;
|
|
2581
|
+
} catch {
|
|
2582
|
+
return false;
|
|
2583
|
+
}
|
|
2584
|
+
}, [e2]);
|
|
2585
|
+
}
|
|
2586
|
+
function dl(e2) {
|
|
2587
|
+
let { service: t2, isLoading: n2, hasError: r2, bookingsSettingsLoading: i2, isLoadingServiceOptionsAndVariants: o2, pricingOption: c2, multiServiceAppointmentsEnabled: l2, isMultiServiceAppointment: d2, reschedule: f2, selection: p2, openPreferences: m2, editingSurface: h2 } = (0, import_service.useServiceContext)(), { searchParams: g2 } = bc(), _2 = ul(), v2 = Ac(Tc.PREFERENCES), y2 = (0, import_react.useRef)(false), b2 = e2 && !h2 && !n2 && !r2 && !i2 && !o2 && f2 == null && !d2 && cl(t2), x2 = p2.locationId ?? void 0, S2 = g2.get(eo.blob);
|
|
2588
|
+
(0, import_react.useEffect)(() => {
|
|
2589
|
+
!y2.current && b2 && (y2.current = true, _2(Gr.CALENDAR_PAGE) && sl({ service: t2, multiServiceAppointmentsEnabled: l2, variants: c2, locationId: x2, blobParam: S2 }) && (Do({ message: `Calendar opens the preferences modal`, category: `navigation`, feature: Q.timeSlots, data: { serviceId: t2._id ?? null, serviceType: t2.type ?? null } }), v2(Mc({ action: Dc.EDIT_BASKET_ITEM_FROM_CALENDAR, numberOfServices: 1, isMultiFlow: l2 })), m2().then(() => Eo(`Preferences modal opened`, { feature: Q.timeSlots, action: `auto-open-preferences`, tags: { serviceType: t2.type ?? `unknown` } }), (e3) => $(e3, { feature: Q.timeSlots, action: `open-preferences-lightbox` }))));
|
|
2590
|
+
}, [b2, t2, l2, c2, x2, S2, _2, v2, m2]);
|
|
2591
|
+
}
|
|
2592
|
+
function fl(e2, t2) {
|
|
2514
2593
|
return t2 === void 0 ? false : !e2 || new Date(e2).getTime() <= t2;
|
|
2515
2594
|
}
|
|
2516
|
-
function
|
|
2517
|
-
let d2 = { serviceId: e2, onlyAvailableSlots: a2, locationId: o2 ?? void 0, staffId: s2 ?? void 0, timeZone: r2, fromLocalDate:
|
|
2518
|
-
return
|
|
2595
|
+
function pl({ serviceId: e2, serviceType: t2, lastSessionEnd: n2, timeZone: r2, now: i2, onlyAvailableSlots: a2, locationId: o2, staffId: s2, timeSlotLimitPerDay: c2, customerChoices: l2, minRemainingCapacity: u2 }) {
|
|
2596
|
+
let d2 = { serviceId: e2, onlyAvailableSlots: a2, locationId: o2 ?? void 0, staffId: s2 ?? void 0, timeZone: r2, fromLocalDate: No(new Date(i2), r2) };
|
|
2597
|
+
return Xa(t2) ? { ...d2, serviceType: `CLASS`, minRemainingCapacity: u2 } : Za(t2) ? !n2 || fl(n2, i2) ? void 0 : { ...d2, serviceType: `COURSE`, toLocalDate: No(new Date(n2), r2) } : { ...d2, serviceType: `APPOINTMENT`, toLocalDate: _s().toLocalDate, timeSlotsPerDay: c2 + 1, customerChoices: l2 };
|
|
2519
2598
|
}
|
|
2520
|
-
function
|
|
2599
|
+
function ml({ isAppointment: e2, staffOnSlotCount: t2, hasStaffFilter: n2, hasRequestedGender: r2, hasStaffPricedVariants: i2, staffSelectionStrategy: a2 }) {
|
|
2521
2600
|
return e2 && t2 > 1 && !n2 && !i2 && (a2 !== `CUSTOMER_MUST_CHOOSE` || r2);
|
|
2522
2601
|
}
|
|
2523
|
-
function
|
|
2602
|
+
function hl(e2, t2) {
|
|
2524
2603
|
return e2.length ? e2.length === 1 ? { anyResource: false, staffMemberId: e2[0] } : t2 ? { anyResource: true } : null : null;
|
|
2525
2604
|
}
|
|
2526
|
-
function
|
|
2605
|
+
function gl(e2, t2, n2) {
|
|
2527
2606
|
return t2 && !t2.anyResource && e2.includes(t2.staffMemberId) ? { isComplete: true, resourceId: t2.staffMemberId } : t2?.anyResource && n2 ? { isComplete: true, resourceId: void 0 } : e2.length <= 1 ? { isComplete: true, resourceId: e2[0] } : { isComplete: n2, resourceId: void 0 };
|
|
2528
2607
|
}
|
|
2529
|
-
var
|
|
2530
|
-
function
|
|
2531
|
-
if (!e2) return
|
|
2532
|
-
let c2 = e2.locationId && s2.includes(e2.locationId) ? e2.locationId : null, l2 = t2 && !n2 ?
|
|
2533
|
-
if (!l2) return { ...
|
|
2534
|
-
if (!l2.anyResource) return o2.includes(l2.staffMemberId) ? { staff: l2, requestedGender: null, locationId: c2 } : { ...
|
|
2608
|
+
var _l = { staff: null, requestedGender: null, locationId: null };
|
|
2609
|
+
function vl({ entry: e2, appointmentLike: t2, staffChoiceHidden: n2, staffPriced: r2, staffSelectionStrategy: i2, genderAllowed: a2, staffMemberIds: o2, locationIds: s2 }) {
|
|
2610
|
+
if (!e2) return _l;
|
|
2611
|
+
let c2 = e2.locationId && s2.includes(e2.locationId) ? e2.locationId : null, l2 = t2 && !n2 ? oo(e2) : null;
|
|
2612
|
+
if (!l2) return { ..._l, locationId: c2 };
|
|
2613
|
+
if (!l2.anyResource) return o2.includes(l2.staffMemberId) ? { staff: l2, requestedGender: null, locationId: c2 } : { ..._l, locationId: c2 };
|
|
2535
2614
|
let u2 = a2 ? e2.requestedGender ?? null : null;
|
|
2536
|
-
return o2.length > 1 && !r2 && (i2 !== `CUSTOMER_MUST_CHOOSE` || u2 !== null) ? { staff: l2, requestedGender: u2, locationId: c2 } : { ...
|
|
2615
|
+
return o2.length > 1 && !r2 && (i2 !== `CUSTOMER_MUST_CHOOSE` || u2 !== null) ? { staff: l2, requestedGender: u2, locationId: c2 } : { ..._l, locationId: c2 };
|
|
2537
2616
|
}
|
|
2538
|
-
var
|
|
2539
|
-
function
|
|
2540
|
-
let s2 =
|
|
2541
|
-
return { rows: t2 ? c2 :
|
|
2617
|
+
var yl = [];
|
|
2618
|
+
function bl({ sessions: e2, dayQuery: t2, daySlots: n2, staffFilter: r2, appointmentLike: i2, limitPerDay: a2, expandedDates: o2 }) {
|
|
2619
|
+
let s2 = kl(Al(e2, r2)), c2 = n2 ? Al(i2 ? Qo(n2) : n2, r2) : yl;
|
|
2620
|
+
return { rows: t2 ? c2 : jl(s2, a2, o2), slotIdOf: t2 ? Yo : Zo, daysWithMore: Ol(s2, a2, o2) };
|
|
2542
2621
|
}
|
|
2543
|
-
function
|
|
2544
|
-
return [...e2.filter((e3) => t2(e3) === n2)].sort((e3, t3) =>
|
|
2622
|
+
function xl({ rows: e2, slotIdOf: t2 }, n2) {
|
|
2623
|
+
return [...e2.filter((e3) => t2(e3) === n2)].sort((e3, t3) => Dl(t3) - Dl(e3))[0] ?? null;
|
|
2545
2624
|
}
|
|
2546
|
-
function
|
|
2547
|
-
return { slotId: n2(e2), slotStartTime: e2.localStartDate ?? null, slotEndTime: e2.localEndDate ?? null, bookable: e2.bookable ?? false, totalCapacity: e2.totalCapacity ?? null, remainingCapacity: e2.remainingCapacity ?? null, bookableCapacity: e2.bookableCapacity ?? null, eventId: e2.eventInfo?.eventId ?? null, eventTitle: e2.eventInfo?.eventTitle ?? null, waitlistCapacity: e2.eventInfo?.waitingList?.remainingCapacity ?? null, locationId: e2.location?._id ?? null, locationName: e2.location?.name || e2.location?.formattedAddress || null, durationMinutes:
|
|
2625
|
+
function Sl(e2, t2, n2, r2) {
|
|
2626
|
+
return { slotId: n2(e2), slotStartTime: e2.localStartDate ?? null, slotEndTime: e2.localEndDate ?? null, bookable: e2.bookable ?? false, totalCapacity: e2.totalCapacity ?? null, remainingCapacity: e2.remainingCapacity ?? null, bookableCapacity: e2.bookableCapacity ?? null, eventId: e2.eventInfo?.eventId ?? null, eventTitle: e2.eventInfo?.eventTitle ?? null, waitlistCapacity: e2.eventInfo?.waitingList?.remainingCapacity ?? null, locationId: e2.location?._id ?? null, locationName: e2.location?.name || e2.location?.formattedAddress || null, durationMinutes: El(e2, t2), isAllDay: e2.allDay ?? false, staff: r2 ? [] : Cl(e2) };
|
|
2548
2627
|
}
|
|
2549
|
-
function
|
|
2628
|
+
function Cl(e2) {
|
|
2550
2629
|
let t2 = /* @__PURE__ */ new Map();
|
|
2551
2630
|
for (let n2 of e2.availableResources ?? []) if (n2.resourceTypeId === `1cd44cf8-756f-41c3-bd90-3e2ffcaf1155`) for (let e3 of n2.resources ?? []) e3._id && !t2.has(e3._id) && t2.set(e3._id, e3.name ?? ``);
|
|
2552
2631
|
return [...t2].map(([e3, t3]) => ({ staffMemberId: e3, name: t3 }));
|
|
2553
2632
|
}
|
|
2554
|
-
function
|
|
2555
|
-
let t2 =
|
|
2633
|
+
function wl(e2) {
|
|
2634
|
+
let t2 = Cl(e2);
|
|
2556
2635
|
if (t2.length) return t2.length === 1 ? t2[0].staffMemberId : null;
|
|
2557
2636
|
}
|
|
2558
|
-
function
|
|
2559
|
-
return
|
|
2637
|
+
function Tl(e2) {
|
|
2638
|
+
return Cl(e2).map((e3) => e3.staffMemberId);
|
|
2560
2639
|
}
|
|
2561
|
-
function
|
|
2640
|
+
function El(e2, t2) {
|
|
2562
2641
|
if (!e2.localStartDate || !e2.localEndDate) return null;
|
|
2563
|
-
let n2 = e2.allDay ? `UTC` : t2 ?? `UTC`, r2 =
|
|
2642
|
+
let n2 = e2.allDay ? `UTC` : t2 ?? `UTC`, r2 = Fc(e2.localStartDate, n2), i2 = Fc(e2.localEndDate, n2);
|
|
2564
2643
|
return !r2 || !i2 || i2 < r2 ? null : Math.round((i2.getTime() - r2.getTime()) / 6e4);
|
|
2565
2644
|
}
|
|
2566
|
-
function
|
|
2645
|
+
function Dl(e2) {
|
|
2567
2646
|
let t2 = e2.bookableCapacity ?? e2.remainingCapacity;
|
|
2568
2647
|
return (e2.eventInfo?.waitingList?.remainingCapacity ?? 0) > 0 && (t2 ?? 0) <= 0 ? 1 : e2.bookable ? 2 : 0;
|
|
2569
2648
|
}
|
|
2570
|
-
function
|
|
2649
|
+
function Ol(e2, t2, n2) {
|
|
2571
2650
|
let r2 = /* @__PURE__ */ new Map();
|
|
2572
2651
|
for (let t3 of e2) {
|
|
2573
2652
|
let e3 = (t3.localStartDate ?? ``).slice(0, 10);
|
|
@@ -2575,16 +2654,16 @@ function cl(e2, t2, n2) {
|
|
|
2575
2654
|
}
|
|
2576
2655
|
return new Set([...r2].filter(([e3, r3]) => r3 > t2 && !n2.has(e3)).map(([e3]) => e3));
|
|
2577
2656
|
}
|
|
2578
|
-
function
|
|
2657
|
+
function kl(e2) {
|
|
2579
2658
|
return e2.flatMap((e3) => {
|
|
2580
|
-
let t2 = e3.availableResources?.find((e4) => e4.resourceTypeId ===
|
|
2659
|
+
let t2 = e3.availableResources?.find((e4) => e4.resourceTypeId === Wr), n2 = t2?.resources ?? [];
|
|
2581
2660
|
return n2.length <= 1 ? [e3] : n2.map((n3) => ({ ...e3, availableResources: [{ ...t2, resources: [n3] }] }));
|
|
2582
2661
|
});
|
|
2583
2662
|
}
|
|
2584
|
-
function
|
|
2663
|
+
function Al(e2, t2) {
|
|
2585
2664
|
return t2 ? e2.map((e3) => ({ ...e3, availableResources: e3.availableResources?.map((e4) => e4.resourceTypeId === `1cd44cf8-756f-41c3-bd90-3e2ffcaf1155` ? { ...e4, resources: e4.resources?.filter((e5) => e5._id === t2) } : e4) })) : e2;
|
|
2586
2665
|
}
|
|
2587
|
-
function
|
|
2666
|
+
function jl(e2, t2, n2) {
|
|
2588
2667
|
let r2 = /* @__PURE__ */ new Map();
|
|
2589
2668
|
return e2.filter((e3) => {
|
|
2590
2669
|
let i2 = (e3.localStartDate ?? ``).slice(0, 10);
|
|
@@ -2593,21 +2672,21 @@ function dl(e2, t2, n2) {
|
|
|
2593
2672
|
return r2.set(i2, a2 + 1), a2 < t2;
|
|
2594
2673
|
});
|
|
2595
2674
|
}
|
|
2596
|
-
async function
|
|
2675
|
+
async function Ml() {
|
|
2597
2676
|
try {
|
|
2598
|
-
return await
|
|
2677
|
+
return await Jo();
|
|
2599
2678
|
} catch (e2) {
|
|
2600
|
-
return $(e2, { feature:
|
|
2679
|
+
return $(e2, { feature: Q.timeSlots, action: `fetch-business-time-zone`, level: `warning` }), { businessTimeZone: null, staffSelectionStrategy: void 0, allowGenderSelection: false };
|
|
2601
2680
|
}
|
|
2602
2681
|
}
|
|
2603
|
-
function
|
|
2604
|
-
return
|
|
2682
|
+
function Nl(e2) {
|
|
2683
|
+
return Qs({ key: Vs(), warmupData: e2, fetchData: Ml });
|
|
2605
2684
|
}
|
|
2606
|
-
function
|
|
2685
|
+
function Pl(e2) {
|
|
2607
2686
|
return (e2.localStartDate ?? ``).slice(0, 10);
|
|
2608
2687
|
}
|
|
2609
|
-
var
|
|
2610
|
-
function
|
|
2688
|
+
var Fl = [];
|
|
2689
|
+
function Il(e2, t2) {
|
|
2611
2690
|
let { serviceId: n2 = ``, serviceType: r2 = `CLASS`, fromLocalDate: i2 = ``, toLocalDate: o2, timeZone: l2, locationId: u2, staffId: d2, onlyAvailableSlots: f2 = false, customerChoices: p2, minRemainingCapacity: m2, timeSlotsPerDay: h2 } = t2 ?? {}, [g2, _2] = (0, import_react.useState)([]), [v2, y2] = (0, import_react.useState)([]), [b2, x2] = (0, import_react.useState)(1), [S2, C2] = (0, import_react.useState)(!!n2), [w2, T2] = (0, import_react.useState)(null), [ee2, E2] = (0, import_react.useState)(null), [D2, O2] = (0, import_react.useState)(/* @__PURE__ */ new Set()), [te2, k2] = (0, import_react.useState)(null), A2 = (0, import_react.useRef)(null), ne2 = (0, import_react.useRef)(null);
|
|
2612
2691
|
(0, import_react.useEffect)(() => {
|
|
2613
2692
|
if (_2([]), y2([]), x2(1), E2(null), T2(null), O2(/* @__PURE__ */ new Set()), k2(null), C2(!!n2), !n2) return;
|
|
@@ -2625,7 +2704,7 @@ function gl(e2, t2) {
|
|
|
2625
2704
|
let a3 = [], b3 = null, S3 = v4 ?? void 0, C3 = /* @__PURE__ */ new Set();
|
|
2626
2705
|
do {
|
|
2627
2706
|
S3 && C3.add(S3);
|
|
2628
|
-
let s3 = await
|
|
2707
|
+
let s3 = await ps({ serviceId: n2, serviceType: r2, fromLocalDate: i2, toLocalDate: o2, timeZone: l2, locationId: u2, staffId: d2, onlyAvailableSlots: f2, customerChoices: p2, minRemainingCapacity: m2, timeSlotsPerDay: h2, limit: e2, cursor: S3 });
|
|
2629
2708
|
if (t3) return;
|
|
2630
2709
|
if (a3.push(...s3.timeSlots), b3 = s3.nextCursor, b3 && C3.has(b3)) throw Error(`The session API repeated a page cursor`);
|
|
2631
2710
|
S3 = b3 ?? void 0, E2(s3.timeZone ?? l2 ?? null);
|
|
@@ -2633,7 +2712,7 @@ function gl(e2, t2) {
|
|
|
2633
2712
|
s2 = [...s2, a3], c2 = [...c2, b3], _2(s2), y2(c2), (g4 === 1 || a3.length > 0) && x2(g4);
|
|
2634
2713
|
} catch (e3) {
|
|
2635
2714
|
if (t3) return;
|
|
2636
|
-
$(e3, { feature:
|
|
2715
|
+
$(e3, { feature: Q.sessions, action: `fetch-page` }), T2(e3 instanceof Error ? e3.message : `Failed to load sessions`);
|
|
2637
2716
|
} finally {
|
|
2638
2717
|
a2 = false, t3 || C2(false);
|
|
2639
2718
|
}
|
|
@@ -2647,16 +2726,16 @@ function gl(e2, t2) {
|
|
|
2647
2726
|
}
|
|
2648
2727
|
a2 = true, k2(e3), T2(null);
|
|
2649
2728
|
try {
|
|
2650
|
-
let a3 = await
|
|
2729
|
+
let a3 = await bs({ serviceId: n2, serviceType: r2, date: e3, timeZone: l2, onlyAvailableSlots: f2, locationId: u2, staffId: d2, customerChoices: p2, minRemainingCapacity: m2, fromLocalDate: i2, toLocalDate: o2 });
|
|
2651
2730
|
if (t3) return;
|
|
2652
|
-
let c3 = a3.timeSlots.filter((t4) =>
|
|
2731
|
+
let c3 = a3.timeSlots.filter((t4) => Pl(t4) === e3), h3 = Math.max(0, s2.findIndex((t4) => t4.some((t5) => Pl(t5) === e3)));
|
|
2653
2732
|
s2 = s2.map((t4, n3) => {
|
|
2654
|
-
let r3 = t4.filter((t5) =>
|
|
2733
|
+
let r3 = t4.filter((t5) => Pl(t5) !== e3);
|
|
2655
2734
|
return n3 === h3 ? [...r3, ...c3] : r3;
|
|
2656
2735
|
}), _2(s2), O2((t4) => /* @__PURE__ */ new Set([...t4, e3]));
|
|
2657
2736
|
} catch (e4) {
|
|
2658
2737
|
if (t3) return;
|
|
2659
|
-
$(e4, { feature:
|
|
2738
|
+
$(e4, { feature: Q.sessions, action: `fetch-day` }), T2(e4 instanceof Error ? e4.message : `Failed to load sessions`);
|
|
2660
2739
|
} finally {
|
|
2661
2740
|
a2 = false, t3 || k2(null);
|
|
2662
2741
|
}
|
|
@@ -2666,7 +2745,7 @@ function gl(e2, t2) {
|
|
|
2666
2745
|
t3 = true, A2.current = null, ne2.current = null;
|
|
2667
2746
|
};
|
|
2668
2747
|
}, [n2, r2, i2, o2, l2, u2, d2, f2, p2, m2, h2, e2]);
|
|
2669
|
-
let re2 = [...g2[b2 - 1] ??
|
|
2748
|
+
let re2 = [...g2[b2 - 1] ?? Fl].sort((e3, t3) => (e3.localStartDate ?? ``).localeCompare(t3.localStartDate ?? ``)), j2 = g2[b2], ie2 = j2 ? j2.length > 0 : v2[b2 - 1] != null, M2 = b2 > 1;
|
|
2670
2749
|
async function ae2() {
|
|
2671
2750
|
ie2 && !S2 && await A2.current?.(b2 + 1);
|
|
2672
2751
|
}
|
|
@@ -2678,165 +2757,164 @@ function gl(e2, t2) {
|
|
|
2678
2757
|
}
|
|
2679
2758
|
return { isLoadingPage: S2, firstPageSettled: g2.length > 0 || w2 !== null, error: w2, timeZone: ee2, sessions: re2, pageSize: e2, currentPage: b2, hasNextPage: ie2, hasPreviousPage: M2, nextPage: ae2, previousPage: oe2, expandedDates: D2, loadingDate: te2, loadAllSessionsForDay: se2 };
|
|
2680
2759
|
}
|
|
2681
|
-
var
|
|
2682
|
-
function
|
|
2683
|
-
return !!e2?._id;
|
|
2684
|
-
}
|
|
2685
|
-
function yl(e2, t2) {
|
|
2760
|
+
var Ll = (e2) => e2?.onlineBooking?.enabled === true;
|
|
2761
|
+
function Rl(e2, t2) {
|
|
2686
2762
|
return e2 ? e2.anyResource ? t2 ?? `` : e2.staffMemberId : null;
|
|
2687
2763
|
}
|
|
2688
|
-
var
|
|
2689
|
-
var
|
|
2690
|
-
var
|
|
2691
|
-
var
|
|
2692
|
-
var
|
|
2764
|
+
var zl = [];
|
|
2765
|
+
var Bl = [];
|
|
2766
|
+
var Vl = cn.map((e2) => ({ id: e2, gender: e2 }));
|
|
2767
|
+
var Hl = { isSelectionValidated: false };
|
|
2768
|
+
var Ul = () => {
|
|
2693
2769
|
};
|
|
2694
|
-
var
|
|
2770
|
+
var Wl = async () => {
|
|
2695
2771
|
};
|
|
2696
|
-
var
|
|
2697
|
-
function
|
|
2698
|
-
let e2 = (0, import_react.useContext)(
|
|
2772
|
+
var Gl = (0, import_react.createContext)(null);
|
|
2773
|
+
function Kl() {
|
|
2774
|
+
let e2 = (0, import_react.useContext)(Gl);
|
|
2699
2775
|
if (!e2) throw Error(`useTimeSlotsContext must be used within TimeSlotsContextProvider`);
|
|
2700
2776
|
return e2;
|
|
2701
2777
|
}
|
|
2702
|
-
function
|
|
2778
|
+
function ql(e2, t2, n2) {
|
|
2703
2779
|
e2 ? t2() : n2();
|
|
2704
2780
|
}
|
|
2705
|
-
var
|
|
2706
|
-
function
|
|
2707
|
-
return Math.min(Math.max(e2, 1),
|
|
2781
|
+
var Jl = { loginRequired: `rescheduleLoginRequired`, notFound: `rescheduleNotFound`, accessDenied: `rescheduleAccessDenied`, failed: `rescheduleNotFound`, wrongService: `rescheduleNotFound`, notReschedulable: `rescheduleNotReschedulable` };
|
|
2782
|
+
function Yl(e2 = 3) {
|
|
2783
|
+
return Math.min(Math.max(e2, 1), lc);
|
|
2708
2784
|
}
|
|
2709
|
-
function
|
|
2785
|
+
function Xl(e2) {
|
|
2710
2786
|
let { isLoading: n2, bookingsSettingsLoading: r2 } = (0, import_service.useServiceContext)();
|
|
2711
|
-
|
|
2712
|
-
let i2 =
|
|
2713
|
-
return (0, import_jsx_runtime.jsx)(
|
|
2787
|
+
jc(Tc.TIME_SLOTS, !n2 && !r2);
|
|
2788
|
+
let i2 = Rs(), [a2] = (0, import_react.useState)(() => Nl(i2));
|
|
2789
|
+
return (0, import_jsx_runtime.jsx)(cc, { children: (0, import_jsx_runtime.jsx)(import_react.Suspense, { fallback: (0, import_jsx_runtime.jsx)(Rc, { nextAvailableSlotsCount: Yl(e2.nextAvailableSlotsCount), children: e2.children }), children: (0, import_jsx_runtime.jsx)(Ql, { ...e2, configurationPromise: a2 }) }) });
|
|
2714
2790
|
}
|
|
2715
|
-
function
|
|
2791
|
+
function Zl(e2) {
|
|
2716
2792
|
let [t2, n2] = (0, import_react.useState)({ serviceId: e2, key: 0 });
|
|
2717
2793
|
return e2 !== t2.serviceId && n2({ serviceId: e2, key: t2.serviceId ? t2.key + 1 : t2.key }), t2.key;
|
|
2718
2794
|
}
|
|
2719
|
-
function
|
|
2720
|
-
let s2 =
|
|
2795
|
+
function Ql({ onlyAvailableSlots: e2 = true, nextAvailableSlotsCount: t2 = 3, loadDaysAvailabilityInitially: n2 = false, timeSlotLimitPerDay: r2 = 100, configurationPromise: i2, children: o2 }) {
|
|
2796
|
+
let s2 = ic().isLoading, { searchParams: d2 } = bc(), { reschedule: f2 } = (0, import_service.useServiceContext)(), [m2] = (0, import_react.useState)(() => ({ locationId: d2.get(eo.location), staffId: d2.get(eo.resource), timeZone: (f2 ? void 0 : Pr(d2.get(eo.blob))?.timezone) ?? d2.get(eo.timezone) })), [h2, g2] = (0, import_react.useState)(m2.timeZone), _2 = Yl(t2), [v2, y2] = (0, import_react.useState)(false);
|
|
2721
2797
|
(0, import_react.useEffect)(() => y2(true), []);
|
|
2722
|
-
let b2 = v2 && !s2
|
|
2723
|
-
|
|
2724
|
-
}
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
})), []),
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
let
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
}, [
|
|
2749
|
-
|
|
2750
|
-
}, [
|
|
2798
|
+
let b2 = v2 && !s2;
|
|
2799
|
+
dl(b2);
|
|
2800
|
+
let x2 = Ns(i2), S2 = (0, import_react.useSyncExternalStore)(cs, ss, () => false), { serviceId: C2 } = (0, import_service.useServiceContext)(), w2 = Zl(C2), T2 = Number.isFinite(r2) ? Math.max(1, Math.floor(r2)) : 100;
|
|
2801
|
+
return (0, import_jsx_runtime.jsx)(uc, { fallback: (0, import_jsx_runtime.jsx)(zc, { nextAvailableSlotsCount: _2, children: o2 }), feature: Q.timeSlots, children: (0, import_jsx_runtime.jsx)($l, { onlyAvailableSlots: e2, selectedTimeZone: h2, setSelectedTimeZone: g2, enabled: b2, nextAvailableSlotsCount: _2, loadDaysAvailabilityInitially: n2, timeSlotLimitPerDay: T2, landingLocationId: m2.locationId, landingStaffId: m2.staffId, businessTimeZone: x2.businessTimeZone, staffSelectionStrategy: x2.staffSelectionStrategy, allowGenderSelection: x2.allowGenderSelection, requestedGenderRejected: S2, children: o2 }) }, w2);
|
|
2802
|
+
}
|
|
2803
|
+
function $l({ onlyAvailableSlots: e2, selectedTimeZone: t2, setSelectedTimeZone: n2, enabled: i2, nextAvailableSlotsCount: l2, loadDaysAvailabilityInitially: d2, timeSlotLimitPerDay: f2, landingLocationId: m2, landingStaffId: h2, businessTimeZone: g2, staffSelectionStrategy: _2, allowGenderSelection: v2, requestedGenderRejected: y2, children: b2 }) {
|
|
2804
|
+
let { service: x2, serviceId: S2, serviceType: C2, setSlot: w2, clearSlot: T2, setMultiServiceSlot: ee2, clearMultiServiceSlot: E2, draftRevision: D2, navigateToMultiServiceForm: O2, selection: te2, selectStaffMember: k2, clearSelection: A2, clearStaffMember: ne2, withSelectionParam: re2, staffMembers: j2, serviceOptionsAndVariants: ie2, isLoading: M2, hasError: ae2, multiServiceAppointmentServices: oe2 = Bl, reschedule: se2 } = (0, import_service.useServiceContext)(), N2 = se2 != null, ce2 = N2 && se2.status !== `ready`, le2 = N2 && se2.status === `loading`, ue2 = N2 ? Jl[se2.status] : void 0, de2 = ce2 ? null : se2?.booking ?? null, fe2 = de2 ? se2.validUntil : null, pe2 = cl(x2) && !Ll(x2), P2 = pe2 || ce2 ? null : S2, me2 = bc(), he2 = N2 ? null : me2.searchParams.get(eo.blob), ge2 = (0, import_react.useMemo)(() => io(Pr(he2)), [he2]), F2 = !S2 && !M2 && !ae2 && (ge2.valid || ge2.reason !== `too-few-services`), _e2 = F2 && ge2.valid && oe2.some((e3) => !Ll(e3) && ge2.services.some((t3) => t3.serviceId === e3._id)), ve2 = pe2 || _e2, ye2 = F2 && ge2.valid && !_e2 ? ge2.requestKey : null, be2 = (0, import_react.useMemo)(() => ye2 && ge2.valid ? { services: ge2.services, locationId: ge2.locationId, locationType: ge2.locationType } : null, [ye2]), xe2 = !!P2 || be2 !== null, Se2 = P2 || ye2, Ce2 = i2 && !M2 && !ae2 && !xe2 && !le2, we2 = oc(), Te2 = ic(), { navigate: Ee2, resolvePath: De2 } = go(), [Oe2, ke2] = (0, import_react.useState)(null), [Ae2, je2] = (0, import_react.useState)(false), Me2 = (0, import_react.useRef)([]), Ne2 = (0, import_react.useRef)(false), Pe2 = (0, import_react.useCallback)(() => (je2(true), Ne2.current ? Promise.resolve() : new Promise((e3) => {
|
|
2805
|
+
Me2.current.push(e3);
|
|
2806
|
+
})), []), Fe2 = i2 ? Intl.DateTimeFormat().resolvedOptions().timeZone : null, Ie2 = Ja(x2), Le2 = (0, import_react.useRef)(null), Re2 = oo(te2), ze2 = (0, import_react.useRef)(Re2);
|
|
2807
|
+
ze2.current = Re2;
|
|
2808
|
+
let Be2 = Re2 && !Re2.anyResource ? Re2.staffMemberId : null, Ve2 = te2.requestedGender ?? null, I2 = !Xa(C2) && !Za(C2), He2 = I2 && !F2 && Ss(ie2), L2 = F2 || I2 && _2 === `CUSTOMER_CANNOT_CHOOSE`, Ue2 = _2 !== void 0, We2 = qo({ allowGenderSelection: v2, staffSelectionStrategy: _2 ?? null }) && I2 && !F2 && !He2, Ge2 = We2 && !y2, Ke2 = (0, import_react.useMemo)(() => P2 ? Pr(he2)?.services.find((e3) => e3.serviceId === P2) ?? null : null, [he2, P2]), qe2 = (j2 ?? []).map((e3) => e3.staffMemberId).join(`,`), Je2 = Ie2.map((e3) => e3.id).join(`,`), Ye2 = (0, import_react.useMemo)(() => vl({ entry: Ke2, appointmentLike: I2, staffChoiceHidden: L2, staffPriced: He2, staffSelectionStrategy: _2, genderAllowed: Ge2, staffMemberIds: qe2.split(`,`), locationIds: Je2.split(`,`) }), [Ke2, I2, L2, He2, _2, Ge2, qe2, Je2]), R2 = Ye2.staff, Xe2 = Ye2.locationId, Ze2 = L2 || R2 !== null, [Qe2, $e2] = (0, import_react.useState)(null), [et2, tt2] = (0, import_react.useState)(m2 !== null || N2), z2 = (0, import_react.useMemo)(() => x2 ? As(x2) : [], [x2]), nt2 = R2 && !R2.anyResource ? R2.staffMemberId : null, rt2 = (0, import_react.useMemo)(() => {
|
|
2809
|
+
if (!nt2) return z2;
|
|
2810
|
+
let e3 = z2.find((e4) => e4.staffMemberId === nt2);
|
|
2811
|
+
return e3 ? [e3] : z2;
|
|
2812
|
+
}, [z2, nt2]), it2 = de2?.locationId ?? null, at2 = (0, import_react.useMemo)(() => {
|
|
2813
|
+
let e3 = ks(Ie2, rt2);
|
|
2814
|
+
return !it2 || e3.some((e4) => e4.id === it2) ? e3 : Ie2.filter((t3) => t3.id === it2 || e3.some((e4) => e4.id === t3.id));
|
|
2815
|
+
}, [x2, rt2, it2]), ot2 = (e3) => !!e3 && at2.some((t3) => t3.id === e3), st2 = Qe2 ?? (et2 ? ot2(it2) ? it2 : m2 : null), ct2 = Ie2.length > 1 && at2.length === 1 ? at2[0].id : null, B2 = Xe2 ?? (ot2(st2) ? st2 : ct2), lt2 = (0, import_react.useMemo)(() => Xe2 ? [] : at2.map((e3) => ({ id: e3.id, name: e3.label })), [at2, Xe2]), ut2 = (0, import_react.useMemo)(() => new Map(z2.map((e3) => [e3.staffMemberId, e3.locationCoverage])), [z2]), dt2 = (0, import_react.useCallback)((e3, t3) => Es([{ staffMemberId: e3, locationCoverage: ut2.get(e3) }], t3).length === 1, [ut2]), ft2 = (0, import_react.useMemo)(() => Ze2 ? [] : (j2 ?? []).filter((e3) => e3.name).map((e3) => ({ id: e3.staffMemberId, name: e3.name ?? ``, gender: null })), [j2, Ze2]), pt2 = (0, import_react.useMemo)(() => B2 ? ft2.filter((e3) => dt2(e3.id, B2)) : ft2, [ft2, B2, dt2]), mt2 = I2 && !Ue2 ? zl : pt2, ht2 = I2 && !Ue2 ? 0 : ft2.length, gt2 = Ge2 && ht2 > 1, _t2 = (0, import_react.useMemo)(() => gt2 ? [...Vl, ...mt2] : mt2, [gt2, mt2]), [vt2, yt2] = (0, import_react.useState)(null), [bt2, xt2] = (0, import_react.useState)(h2 !== null);
|
|
2816
|
+
bt2 && h2 !== null && B2 !== null && !dt2(h2, B2) && xt2(false);
|
|
2817
|
+
let St2 = vt2 ?? (bt2 ? h2 : null), V2 = R2 ? R2.anyResource ? null : R2.staffMemberId : St2 !== null && pt2.some((e3) => e3.id === St2) ? St2 : null, Ct2 = Re2?.anyResource ? Ve2 : null, [wt2, Tt2] = (0, import_react.useState)(Ct2), [Et2, Dt2] = (0, import_react.useState)(Ct2);
|
|
2818
|
+
!y2 && Re2?.anyResource && Ve2 !== Et2 && (Dt2(Ve2), Tt2(Ve2));
|
|
2819
|
+
let Ot2 = R2 ? Ye2.requestedGender : We2 && ht2 > 1 && V2 === null ? wt2 : null, kt2 = y2 ? null : Ot2, At2 = (0, import_react.useCallback)((e3) => {
|
|
2820
|
+
ze2.current = e3, e3 ? e3.anyResource ? A2(kt2 ?? void 0) : k2(e3.staffMemberId) : ne2();
|
|
2821
|
+
}, [ne2, A2, k2, kt2]), jt2 = (0, import_react.useCallback)((e3) => At2(e3 ? { anyResource: false, staffMemberId: e3 } : { anyResource: true }), [At2]), Mt2 = (de2?.addOnIds ?? []).filter((e3) => x2?.addOnGroups?.some((t3) => t3.addOnIds?.includes(e3))), Nt2 = de2 && Xa(C2) ? de2.participants : null, Pt2 = I2 ? to(te2) : null, { addOnIds: Ft2, ...It2 } = Pt2 ?? {}, Lt2 = I2 && de2 ? Mt2.length ? { ...It2, addOnIds: Mt2 } : It2 : Pt2, Rt2 = Lt2 ? ts(Lt2) : void 0, zt2 = JSON.stringify(Ot2 ? { ...Rt2, requestedGender: { gender: Ot2 } } : Rt2 ?? null), Bt2 = (0, import_react.useMemo)(() => JSON.parse(zt2), [zt2]), Vt2 = R2?.anyResource === true, Ht2 = (0, import_react.useCallback)((e3) => Vt2 || _2 !== void 0 && ml({ isAppointment: I2, staffOnSlotCount: e3, hasStaffFilter: V2 !== null, hasRequestedGender: kt2 !== null, hasStaffPricedVariants: He2, staffSelectionStrategy: _2 }), [Vt2, I2, _2, V2, kt2, He2]), Ut2 = (0, import_react.useCallback)((e3) => R2 ?? (L2 ? null : e3), [R2, L2]), Wt2 = (0, import_react.useCallback)((e3) => {
|
|
2822
|
+
let t3 = e3 === null ? null : _t2.find((t4) => t4.id === e3);
|
|
2823
|
+
t3 !== void 0 && (xt2(false), yt2(t3 && !t3.gender ? t3.id : null), Tt2(t3?.gender ?? null));
|
|
2824
|
+
}, [_t2]), Gt2 = (0, import_react.useCallback)((e3) => {
|
|
2825
|
+
(e3 === null || at2.some((t3) => t3.id === e3)) && (tt2(false), $e2(e3), St2 !== null && e3 !== null && !dt2(St2, e3) && (yt2(null), xt2(false)));
|
|
2826
|
+
}, [at2, St2, dt2]), Kt2 = !!(i2 && !Te2.isLoading && Te2.displayTimeZonePolicy.customerCanChange && g2 && Fe2 && g2 !== Fe2), H2 = i2 ? Kt2 && t2 && (t2 === g2 || t2 === Fe2) ? t2 : we2 ?? g2 ?? Fe2 : null, qt2 = (0, import_react.useCallback)((e3) => {
|
|
2827
|
+
Kt2 && (e3 === g2 || e3 === Fe2) && n2(e3);
|
|
2828
|
+
}, [Kt2, g2, Fe2, n2]), Jt2 = (0, import_react.useMemo)(() => i2 && !M2 && xe2 ? Date.now() : void 0, [i2, M2, P2, be2, H2]), Yt2 = Jt2 !== void 0 && H2 ? Ao(new Date(Jt2), H2) : null, { range: Xt2, daysAvailability: Zt2, isLoading: Qt2, hasError: $t2, setRange: en2, nextRange: tn2, previousRange: nn2 } = tl({ enabled: i2, serviceId: P2, serviceType: C2, multiServiceRequest: be2, timeZone: H2, today: Yt2, locationId: B2, staffId: V2, customerChoices: Bt2, minRemainingCapacity: Nt2, loadInitially: d2, onlyAvailableSlots: e2 }), rn2 = fe2?.slice(0, 10) ?? null, an2 = (0, import_react.useMemo)(() => rn2 ? Zt2.map((e3) => e3.date > rn2 ? { ...e3, availability: `none` } : e3) : Zt2, [Zt2, rn2]), on2 = fe2 && H2 ? No(new Date(fe2), H2) : null, { query: U2, selectedDate: sn2, timeSlots: cn2, isLoading: ln2, error: un2, selectDate: dn2, findNextAvailableDate: fn2 } = nl({ enabled: i2, serviceId: P2, serviceType: C2, multiServiceRequest: be2, timeZone: H2, today: Yt2, locationId: B2, staffId: V2, customerChoices: Bt2, minRemainingCapacity: Nt2, onlyAvailableSlots: e2, serviceLoading: M2 }), pn2 = (0, import_react.useRef)(true), mn2 = (0, import_react.useRef)(null);
|
|
2751
2829
|
(0, import_react.useEffect)(() => {
|
|
2752
|
-
if (
|
|
2753
|
-
|
|
2830
|
+
if (pn2.current) {
|
|
2831
|
+
pn2.current = false;
|
|
2754
2832
|
return;
|
|
2755
2833
|
}
|
|
2756
|
-
|
|
2757
|
-
}, [
|
|
2758
|
-
let
|
|
2759
|
-
let e3 = await
|
|
2760
|
-
return e3.outcome === `found` ?
|
|
2761
|
-
}, [
|
|
2762
|
-
|
|
2763
|
-
let e3 =
|
|
2764
|
-
return
|
|
2765
|
-
}, []),
|
|
2766
|
-
|
|
2767
|
-
}, [
|
|
2768
|
-
let t3 =
|
|
2769
|
-
|
|
2770
|
-
|
|
2834
|
+
ke2(null), Le2.current && ql(P2, T2, E2), Le2.current = null, mn2.current = null;
|
|
2835
|
+
}, [U2, be2, H2, B2, V2, Bt2, Nt2, e2, l2, f2, D2]);
|
|
2836
|
+
let hn2 = (0, import_react.useCallback)(async () => {
|
|
2837
|
+
let e3 = await fn2();
|
|
2838
|
+
return e3.outcome === `found` ? rn2 && e3.date > rn2 ? `none` : (await Promise.all([dn2(e3.date), Xt2 && Wo(e3.date, Xt2) ? Promise.resolve() : en2(Vo(e3.date))]), `found`) : e3.outcome;
|
|
2839
|
+
}, [fn2, rn2, dn2, Xt2, en2]), gn2 = !!(i2 && !M2 && xe2 && H2 && Yt2), W2 = i2 && !M2 && !xe2, [_n2, vn2] = (0, import_react.useState)(false), [yn2, bn2] = (0, import_react.useState)(0), xn2 = (0, import_react.useRef)(false), Sn2 = (0, import_react.useRef)([]), Cn2 = (0, import_react.useRef)(0), wn2 = (0, import_react.useCallback)(() => {
|
|
2840
|
+
vn2(false);
|
|
2841
|
+
let e3 = Sn2.current;
|
|
2842
|
+
return Sn2.current = [], e3;
|
|
2843
|
+
}, []), Tn2 = (0, import_react.useCallback)(() => {
|
|
2844
|
+
Cn2.current += 1, wn2().forEach((e3) => e3(`cancelled`));
|
|
2845
|
+
}, [wn2]), En2 = (0, import_react.useCallback)((e3) => (Tn2(), dn2(e3)), [Tn2, dn2]), Dn2 = (0, import_react.useCallback)((e3) => {
|
|
2846
|
+
let t3 = Cn2.current;
|
|
2847
|
+
xn2.current = true, hn2().then((n3) => {
|
|
2848
|
+
xn2.current = false, n3 === `cancelled` && t3 === Cn2.current ? (Sn2.current.unshift(...e3), vn2(true)) : e3.forEach((e4) => e4(n3)), bn2((e4) => e4 + 1);
|
|
2771
2849
|
});
|
|
2772
|
-
}, [
|
|
2773
|
-
if (
|
|
2774
|
-
|
|
2850
|
+
}, [hn2]), On2 = (0, import_react.useCallback)(() => W2 ? Promise.resolve(`none`) : new Promise((e3) => {
|
|
2851
|
+
if (gn2 && !xn2.current) {
|
|
2852
|
+
Dn2([...wn2(), e3]);
|
|
2775
2853
|
return;
|
|
2776
2854
|
}
|
|
2777
|
-
|
|
2778
|
-
}), [
|
|
2855
|
+
Sn2.current.push(e3), vn2(true);
|
|
2856
|
+
}), [W2, gn2, Dn2, wn2]);
|
|
2779
2857
|
(0, import_react.useEffect)(() => {
|
|
2780
|
-
if (
|
|
2781
|
-
if (
|
|
2782
|
-
|
|
2858
|
+
if (_n2 && !xn2.current) {
|
|
2859
|
+
if (W2) {
|
|
2860
|
+
wn2().forEach((e3) => e3(`none`));
|
|
2783
2861
|
return;
|
|
2784
2862
|
}
|
|
2785
|
-
|
|
2863
|
+
gn2 && Dn2(wn2());
|
|
2786
2864
|
}
|
|
2787
|
-
}, [
|
|
2788
|
-
let
|
|
2789
|
-
|
|
2790
|
-
if (!
|
|
2791
|
-
let e3 =
|
|
2792
|
-
|
|
2793
|
-
}, [
|
|
2794
|
-
let
|
|
2865
|
+
}, [_n2, yn2, gn2, W2, Dn2, wn2]);
|
|
2866
|
+
let kn2 = x2?.schedule?.lastSessionEnd, An2 = I2 || Xa(C2) || Za(C2) && !fl(kn2, Jt2), jn2 = !!(Ae2 && i2 && !M2 && P2 && H2 && Jt2 !== void 0), Mn2 = jn2 && P2 && H2 && Jt2 !== void 0 ? pl({ serviceId: P2, serviceType: C2, lastSessionEnd: kn2, timeZone: H2, now: Jt2, onlyAvailableSlots: e2, locationId: B2, staffId: V2, timeSlotLimitPerDay: f2, customerChoices: Bt2, minRemainingCapacity: Nt2 }) : void 0, G2 = Il(l2, Mn2), Nn2 = Ae2 && P2 && An2 && !(Ae2 && P2 && An2 && (!i2 || M2)) && !H2, Pn2 = ve2 ? `onlineBookingOff` : ue2 ?? (G2.error === null ? Nn2 ? `timeZoneMissing` : null : `upcomingSlotsLoadFailed`), Fn2 = U2 !== null, In2 = (0, import_react.useMemo)(() => bl({ sessions: G2.sessions, dayQuery: Fn2, daySlots: cn2, staffFilter: V2, appointmentLike: I2, limitPerDay: f2, expandedDates: G2.expandedDates }), [G2.sessions, Fn2, cn2, V2, I2, f2, G2.expandedDates]), { slotIdOf: Ln2 } = In2, Rn2 = Ae2 && (Mn2 ? G2.firstPageSettled : jn2 || i2 && !M2 && !P2 || Nn2);
|
|
2867
|
+
Ne2.current = Rn2, (0, import_react.useEffect)(() => {
|
|
2868
|
+
if (!Rn2) return;
|
|
2869
|
+
let e3 = Me2.current;
|
|
2870
|
+
Me2.current = [], e3.forEach((e4) => e4());
|
|
2871
|
+
}, [Rn2]);
|
|
2872
|
+
let zn2 = Ae2 && !Rn2 || G2.isLoadingPage, Bn2 = Pn2 !== null, Vn2 = U2 ? ln2 : zn2 || ln2 || !i2 || xe2 && !H2 || _n2 || le2, Hn2 = U2 ? un2 : un2 ?? Pn2, Un2 = U2 ? un2 !== null : Bn2 || un2 !== null, K2 = Ac(Tc.TIME_SLOTS), Wn2 = (0, import_react.useRef)(false), Gn2 = (0, import_react.useCallback)((e3, t3) => {
|
|
2795
2873
|
if (!t3.bookable) {
|
|
2796
|
-
|
|
2874
|
+
mn2.current = null;
|
|
2797
2875
|
return;
|
|
2798
2876
|
}
|
|
2799
|
-
if (e3 ===
|
|
2800
|
-
|
|
2877
|
+
if (e3 === mn2.current) return;
|
|
2878
|
+
mn2.current = e3;
|
|
2801
2879
|
let n3 = P2 ?? t3.serviceId ?? t3.nestedTimeSlots?.[0]?.serviceId ?? void 0, r2 = C2 ?? oe2.find((e4) => e4._id === n3)?.type ?? void 0;
|
|
2802
|
-
!
|
|
2803
|
-
}, [
|
|
2880
|
+
!Wn2.current && !N2 && K2(Cc({ bookingsServiceId: n3, serviceType: r2, isEligibleForFlowCompletion: true })), Wn2.current = true, K2(Nc({ component: Oc.TIME_PICKER, element: kc.TIME_SLOT, properties: JSON.stringify({ selectedTime: t3.localStartDate }) }));
|
|
2881
|
+
}, [K2, P2, C2, oe2, N2]), Kn2 = (0, import_react.useCallback)((e3) => {
|
|
2804
2882
|
if (e3 === null) {
|
|
2805
|
-
let e4 =
|
|
2806
|
-
|
|
2883
|
+
let e4 = Le2.current !== null;
|
|
2884
|
+
Le2.current = null, mn2.current = null, ke2(null), e4 && ql(P2, T2, E2);
|
|
2807
2885
|
return;
|
|
2808
2886
|
}
|
|
2809
|
-
let t3 =
|
|
2887
|
+
let t3 = xl(In2, e3);
|
|
2810
2888
|
if (!t3) return;
|
|
2811
|
-
if (
|
|
2812
|
-
if (!ee2(t3.nestedTimeSlots ?? [],
|
|
2813
|
-
|
|
2889
|
+
if (F2) {
|
|
2890
|
+
if (!ee2(t3.nestedTimeSlots ?? [], H2 ?? void 0)) return;
|
|
2891
|
+
Le2.current = t3, ke2(t3), Gn2(e3, t3);
|
|
2814
2892
|
return;
|
|
2815
2893
|
}
|
|
2816
|
-
|
|
2817
|
-
let n3 =
|
|
2818
|
-
if (w2(
|
|
2819
|
-
let r2 =
|
|
2820
|
-
i3 =
|
|
2821
|
-
}, [
|
|
2822
|
-
let e3 =
|
|
2894
|
+
Le2.current = t3, ke2(t3), Gn2(e3, t3);
|
|
2895
|
+
let n3 = Tl(t3);
|
|
2896
|
+
if (w2(xs(t3), { staffId: I2 ? void 0 : wl(t3), timezone: H2 ?? void 0, bookable: t3.bookable, staffChoiceRequired: I2 && Ue2 && !L2 && n3.length > 1 && !Ht2(n3.length), rescheduleStaffId: I2 && (_2 !== `CUSTOMER_MAY_CHOOSE` || !Ht2(n3.length)) ? n3[0] : void 0 }), !I2) return;
|
|
2897
|
+
let r2 = ze2.current, i3;
|
|
2898
|
+
i3 = R2 || (V2 && n3.includes(V2) ? { anyResource: false, staffMemberId: V2 } : kt2 !== null && Ht2(n3.length) ? { anyResource: true } : hl(n3, Ue2 && Ht2(n3.length))), Rl(i3, kt2) !== Rl(r2, Ve2) && At2(i3);
|
|
2899
|
+
}, [F2, P2, T2, E2, ee2, w2, In2, Gn2, H2, I2, Ue2, _2, Ht2, R2, V2, kt2, Ve2, At2]), qn2 = (0, import_react.useCallback)(() => {
|
|
2900
|
+
let e3 = Le2.current;
|
|
2823
2901
|
if (!e3 || N2) return;
|
|
2824
|
-
if (
|
|
2825
|
-
O2(
|
|
2902
|
+
if (F2) {
|
|
2903
|
+
O2(K2);
|
|
2826
2904
|
return;
|
|
2827
2905
|
}
|
|
2828
2906
|
if (!P2) return;
|
|
2829
2907
|
let t3;
|
|
2830
|
-
if (
|
|
2831
|
-
let n4 =
|
|
2908
|
+
if (I2) {
|
|
2909
|
+
let n4 = Tl(e3), r2 = gl(n4, Ut2(ze2.current), Ht2(n4.length));
|
|
2832
2910
|
t3 = (r2.isComplete ? r2.resourceId : n4[0]) ?? (n4.length ? null : void 0);
|
|
2833
2911
|
}
|
|
2834
|
-
let n3 =
|
|
2835
|
-
e3.bookable &&
|
|
2836
|
-
}, [
|
|
2837
|
-
return (0, import_jsx_runtime.jsx)(
|
|
2912
|
+
let n3 = De2(`bookingForm`, { slug: x2?.mainSlug?.name ?? null, serviceId: P2 });
|
|
2913
|
+
e3.bookable && K2(Ic({ serviceId: P2, serviceType: C2 ?? void 0, start: e3.localStartDate, end: e3.localEndDate, timeZone: H2 ?? void 0, isEligibleForFlowCompletion: !!n3 })), n3 && Ee2(re2(n3, { handoff: true, staffId: t3 }));
|
|
2914
|
+
}, [K2, F2, O2, H2, P2, C2, x2, I2, Ut2, Ht2, Ee2, De2, re2, N2]), Jn2 = Oe2 ? Tl(Oe2) : null, Yn2 = Jn2 ? F2 || !I2 || gl(Jn2, Ut2(Re2), Ht2(Jn2.length)).isComplete : false, Xn2 = Jn2 ? Ht2(Jn2.length) : false, Zn2 = (0, import_react.useMemo)(() => !Oe2 || Ze2 ? [] : Cl(Oe2).map((e3) => ({ staffMemberId: e3.staffMemberId, name: e3.name || null, image: null, isSelected: e3.staffMemberId === Be2 })), [Oe2, Ze2, Be2]), Qn2 = (0, import_react.useMemo)(() => ({ ...Hl, isMultiService: F2, hasValidSchedulingInput: xe2, availabilityRequestKey: Se2, needsServiceChoice: Ce2, isRescheduling: N2, rescheduleValidUntil: on2, businessTimeZone: g2, canChangeTimeZone: Kt2, setTimeZone: qt2, locationFilterOptions: lt2, selectedLocationFilter: B2, setLocationFilter: Gt2, staffFilterOptions: _t2, selectedStaffFilter: V2, setStaffFilter: Wt2, requestedGender: kt2, genderSelectionAllowed: Ge2, currentTimeSlotsPage: U2 ? 1 : G2.currentPage, hasNextTimeSlotsPage: !U2 && G2.hasNextPage, hasPreviousTimeSlotsPage: !U2 && G2.hasPreviousPage, nextTimeSlotsPage: U2 ? Wl : G2.nextPage, loadUpcomingTimeSlots: Pe2, upcomingTimeSlotsRequested: Ae2, previousTimeSlotsPage: U2 ? Ul : G2.previousPage, timeSlots: In2.rows.map((e3) => Sl(e3, H2, Ln2, L2)), isLoading: Vn2, hasError: Un2, errorCode: Hn2, selectedDate: sn2, daysAvailabilityRange: Xt2, daysAvailability: an2, daysAvailabilityLoading: Qt2, daysAvailabilityHasError: $t2, timeSlotsLoading: Vn2, timeSlotsErrorCode: Hn2, selectDate: En2, setDaysAvailabilityRange: en2, nextDaysAvailabilityRange: tn2, previousDaysAvailabilityRange: nn2, goToNextAvailableDate: On2, nextAvailableSlotsCount: l2, timeZone: H2, staffFromSlots: Zn2, selectedResourceId: Be2, setSelectedResource: jt2, canAutoAssignStaff: Xn2, isComplete: Yn2, selectedTimeSlot: Oe2 ? Sl(Oe2, H2, Ln2, L2) : null, selectTimeSlot: Kn2, navigateToBookingForm: qn2, timeSlotLimitPerDay: f2, expandedDates: G2.expandedDates, daysWithMore: In2.daysWithMore, loadingDate: G2.loadingDate, loadAllTimeSlotsForDay: G2.loadAllSessionsForDay }), [F2, xe2, Se2, Ce2, N2, on2, g2, H2, Kt2, qt2, G2, Pe2, Ae2, lt2, B2, Gt2, _t2, V2, Wt2, kt2, Ge2, U2, Vn2, Hn2, Un2, In2, sn2, Xt2, an2, Qt2, $t2, En2, en2, tn2, nn2, On2, l2, Zn2, Be2, jt2, Xn2, Yn2, Oe2, Kn2, qn2, f2, Ln2, L2]);
|
|
2915
|
+
return (0, import_jsx_runtime.jsx)(Gl.Provider, { value: Qn2, children: b2 });
|
|
2838
2916
|
}
|
|
2839
|
-
var
|
|
2917
|
+
var eu = sn(`4936242d-905c-48bf-80ce-5f56d075de4f`);
|
|
2840
2918
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2841
2919
|
0 && (module.exports = {
|
|
2842
2920
|
TimeSlotsContextProvider,
|