@wix/bookings 1.0.1756 → 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.
@@ -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: () => jl,
24
- default: () => jl,
25
- injectAccessTokenGetter: () => Fl,
26
- timeSlotsContext: () => El,
27
- useTimeSlotsContext: () => Dl
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 = F(s3.status, e5?.message ?? s3.statusText, e5?.details, { requestId: s3.headers.get(`X-Wix-Request-Id`), details: e5 }), n3 = N(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 F = (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 I = `.`;
215
- function ge(e2, t2, n2) {
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 = _e(t2), i2 = e2;
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 /^\d+$/.test(e2);
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)) be(n2) || ge(t2, _e(n2), r2);
237
+ for (let [n2, r2] of Object.entries(e2)) xe(n2) || _e(t2, ve(n2), r2);
238
238
  return t2;
239
239
  }
240
- function be(e2) {
240
+ function xe(e2) {
241
241
  return e2 === `__proto__` || e2 === `constructor` || e2 === `prototype`;
242
242
  }
243
- var xe = class {
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])), ye(this.cleanedModifiedFields);
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 = Te(e3);
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 Se(e2, t2) {
322
+ function Ce(e2, t2) {
323
323
  let n2 = e2?.modifiedFields;
324
324
  if (!n2) return null;
325
- let r2 = Ce(n2);
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 = we(s2, a2);
331
+ let c2 = Te(s2, a2);
332
332
  return c2 === null ? null : (o2.modifiedFields = c2, o2);
333
333
  }
334
- function Ce(e2) {
334
+ function we(e2) {
335
335
  if (typeof e2 == `object` && e2 && !Array.isArray(e2)) try {
336
- let t2 = new xe(e2);
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 we(e2, t2) {
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 Te(e2) {
351
+ function Ee(e2) {
352
352
  return e2.replace(/[-_\s]+(.)?/g, (e3, t2) => t2 ? t2.toUpperCase() : ``).replace(/^./, (e3) => e3.toLowerCase());
353
353
  }
354
- function Ee() {
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 De = (e2) => e2.__type === `event-definition`;
364
- function Oe(e2, t2, n2, r2) {
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 = Se(s2, a2);
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 ke(e2) {
382
- let t2 = /* @__PURE__ */ new Map(), n2 = Ee();
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 }) => Oe(e4, t3, o2, { instanceId: a2, identity: i2, accountInfo: s2 }))), { instanceId: a2, eventType: r2, payload: o2, identity: i2, accountInfo: s2 };
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 }) => Oe(t3, n4, e3.payload, { instanceId: e3.instanceId, identity: e3.identity })));
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 Ae = (e2) => e2.__type === `service-plugin-definition`;
415
- function je(e2) {
416
- let t2 = /* @__PURE__ */ new Map(), n2 = Ee();
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 Me = `X-Wix-Consistent`;
458
- function Ne(e2) {
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`] ? { [Me]: t2[Me] } : {} }, l3 = e2.host?.getErrorHandler?.();
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 = Pe(e3);
466
- return a3 && (t2[Me] = a3), e3;
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 = Pe(e3);
473
- return a3 && (t2[Me] = a3), e3;
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 } = je(i2), { client: u2, initModule: d2 } = ke(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`] ? { [Me]: t2[Me] } : {} } }), u3 = Pe(l3);
480
- return u3 && (t2[Me] = u3), l3;
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 (De(t3)) return d2(t3);
483
- if (Ae(t3)) return l2(t3);
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 Pe(e2) {
512
+ function Fe(e2) {
513
513
  return e2.headers?.get(`X-Wix-Consistent`) ?? e2.headers?.get(`x-wix-consistent`);
514
514
  }
515
- var Fe = { _id: `id`, _createdDate: `createdDate`, _updatedDate: `updatedDate` };
516
- var Ie = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
517
- function Le(e2, t2) {
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 Re = `sort.fieldName`;
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 = L(e4, t2);
535
- s2 !== e4 && !(s2 in a2) && (a2[s2] = a2[e4], delete a2[e4]), a2[s2] = ze(o2, a2[s2], t2), i2(a2[s2], o2);
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 L(e2, t2) {
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 Ve(e2, t2 = []) {
546
- return Be(e2, Fe, t2);
545
+ function He(e2, t2 = []) {
546
+ return Ve(e2, Ie, t2);
547
547
  }
548
- function R(e2, t2 = []) {
549
- return Be(e2, Ie, t2);
548
+ function L(e2, t2 = []) {
549
+ return Ve(e2, Le, t2);
550
550
  }
551
- function He(e2) {
551
+ function Ue(e2) {
552
552
  return e2?.toISOString();
553
553
  }
554
- function Ue(e2) {
554
+ function We(e2) {
555
555
  return e2 ? new Date(e2) : void 0;
556
556
  }
557
- var We = /* @__PURE__ */ new WeakMap();
558
- function Ge() {
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 Ke(e2, t2) {
561
+ function qe(e2, t2) {
562
562
  let n2 = e2.get(t2);
563
- return n2 || (n2 = Ge(), e2.set(t2, n2)), n2;
563
+ return n2 || (n2 = Ke(), e2.set(t2, n2)), n2;
564
564
  }
565
- function qe(e2, t2) {
566
- return t2 === `*` ? (e2.anyField ??= Ge(), e2.anyField) : t2.endsWith(`{}`) ? (e2.mapFields ??= /* @__PURE__ */ new Map(), Ke(e2.mapFields, t2.slice(0, -2))) : (e2.fields ??= /* @__PURE__ */ new Map(), Ke(e2.fields, t2));
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 Je(e2) {
569
- let t2 = Ge();
568
+ function Ye(e2) {
569
+ let t2 = Ke();
570
570
  for (let n2 of e2) {
571
- let e3 = n2.path.split(`.`).reduce(qe, t2);
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 z(e2) {
577
- let t2 = We.get(e2);
578
- return t2 || (t2 = Je(e2), We.set(e2, 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 Ye(e2) {
580
+ function Xe(e2) {
581
581
  return typeof e2 == `object` && !!e2;
582
582
  }
583
- function Xe(e2, { isRepeated: t2, isMap: n2 }, r2) {
584
- return t2 ? Array.isArray(e2) ? e2.map(r2) : e2 : n2 ? Ye(e2) ? Object.fromEntries(Object.entries(e2).map(([e3, t3]) => [e3, r2(t3)])) : e2 : r2(e2);
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] = Xe(e2[r2], t4, n2);
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) => Ze(e3, i2, n2)) : Ze(t3, i2, n2);
594
+ Array.isArray(t3) ? t3.forEach((e3) => Qe(e3, i2, n2)) : Qe(t3, i2, n2);
595
595
  }
596
596
  }
597
- function $e(e2, t2, n2) {
597
+ function et(e2, t2, n2) {
598
598
  for (let [r2, i2] of t2) {
599
599
  let t3 = e2[r2];
600
- Ye(t3) && Object.values(t3).forEach((e3) => Ze(e3, i2, n2));
600
+ Xe(t3) && Object.values(t3).forEach((e3) => Qe(e3, i2, n2));
601
601
  }
602
602
  }
603
- function et(e2, { fields: t2, mapFields: n2, anyField: r2 }, i2) {
604
- t2 && Qe(e2, t2, i2), n2 && $e(e2, n2, i2), r2 && Object.values(e2).forEach((e3) => Ze(e3, r2, i2));
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 B(e2, t2) {
607
- if (!Ye(e2)) return e2;
608
- for (let { paths: n2, transformFn: r2 } of t2) et(e2, z(n2), r2);
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 tt(e2) {
612
- return ot(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
611
+ function nt(e2) {
612
+ return st(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
613
613
  }
614
- var nt = /([\p{Ll}\d])(\p{Lu})/gu;
615
- var rt = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
616
- var it = `$1\0$2`;
617
- var at = /[^\p{L}\d]+/giu;
618
- function ot(e2) {
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(nt, it).replace(rt, it), t2 = t2.replace(at, `\0`);
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 st = (e2) => `validationError` in (e2.response?.data?.details ?? {});
628
- var V = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
629
- var ct = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
630
- function lt(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
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 (st(e2)) return ut(e2, t2, n2);
633
- if (V(e2)) return ft(e2);
634
- if (ct(e2)) {
635
- let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: tt(n3), data: {} }, requestId: e2.requestId };
636
- return dt(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
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 pt(e2);
638
+ return mt(e2);
639
639
  }
640
- var ut = (e2, t2, n2) => {
641
- let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = mt(t2, a2, n2)?.sort((e3, t3) => e3.field < t3.field ? -1 : 1), s2 = `INVALID_ARGUMENT: ${o2?.map(({ field: e3, description: t3 }) => `"${e3}" ${t3}`)?.join(`, `)}`, c2 = { validationError: { fieldViolations: o2 }, requestId: i2 };
642
- return dt(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e2.response?.status, requestId: i2 } });
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 dt = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
645
- var ft = (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 ?? tt(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 dt(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e2.requestId } });
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 pt = (e2) => dt(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: tt(e2.response?.statusText ?? `UNKNOWN`), ...!e2.response && { runtimeError: e2 } } });
650
- var mt = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
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: ht(r3, i2) };
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, ht(t3, i2)) };
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 ht = (e2, t2) => {
664
- let n2 = gt(e2);
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 gt = (e2) => {
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 _t() {
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 vt(() => e2(t3, n3));
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 vt(() => n2.use(e3));
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 vt(() => t2.use(e3));
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 vt(e2) {
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 yt(e2, t2) {
708
+ function bt(e2, t2) {
709
709
  return (...n2) => {
710
- let r2 = _t();
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 bt(e2, t2 = false) {
715
- return yt(e2, t2);
714
+ function xt(e2, t2 = false) {
715
+ return bt(e2, t2);
716
716
  }
717
- function xt(e2, t2) {
718
- let n2 = St(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": wt(JSON.stringify(e2)) }) : Object.entries(n2).reduce((e3, [t3, n3]) => ((Array.isArray(n3) ? n3 : [n3]).forEach((r3) => {
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 H(e2) {
724
- let t2 = Lt(Ft(e2.host), e2.domainToMappings);
725
- return U(Ut(e2.protoPath, e2.data || {}), t2);
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 St(e2, t2 = ``) {
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 = Ct(t2, e3);
730
+ let i2 = typeof r2 == `object` && !!r2 && !Array.isArray(r2), a2 = wt(t2, e3);
731
731
  if (i2) {
732
- let e4 = St(r2, a2);
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 Ct(e2, t2) {
737
+ function wt(e2, t2) {
738
738
  return `${e2}${e2 ? `.` : ``}${t2}`;
739
739
  }
740
- var wt = (e2) => {
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 Tt = [`wix.com`, `editorx.com`];
745
- var Et = `_`;
746
- var Dt = `*.`;
747
- var Ot = RegExp(`\\.(${Tt.join(`|`)})$`);
748
- var kt = [`42.wixprod.net`, `uw2-edt-1.wixprod.net`, `virginia-edt.wixprod.net`];
749
- var At = { "payments.base44.com": `manage.wix.com`, "create.editorx.com": `editor.editorx.com` };
750
- var jt = `dev.wix-code.com`;
751
- var Mt = /{(.*)}/;
752
- var Nt = RegExp(`\\.(${kt.join(`|`)})$`);
753
- var Pt = RegExp(`.*\\.${jt}$`);
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 At[e2] ?? e2;
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 Lt(e2, t2) {
760
+ function Rt(e2, t2) {
761
761
  let n2 = t2[e2];
762
762
  if (n2) return n2;
763
- let r2 = Rt(e2, t2) ?? zt(e2, t2);
763
+ let r2 = zt(e2, t2) ?? Bt(e2, t2);
764
764
  if (!r2) {
765
- if (Vt(e2)) {
766
- let e3 = t2[Ht];
765
+ if (Ht(e2)) {
766
+ let e3 = t2[Ut];
767
767
  if (e3) return e3;
768
768
  }
769
- let n3 = t2[Et];
769
+ let n3 = t2[Dt];
770
770
  if (n3) return n3;
771
771
  }
772
772
  return r2 ?? [];
773
773
  }
774
- function Rt(e2, t2) {
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 zt(e2, t2) {
781
- let [n2] = Object.entries(t2).filter(([t3]) => Bt(e2, t3)).sort(([e3], [t3]) => t3.length - e3.length);
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 Bt(e2, t2) {
787
- if (!t2.startsWith(Dt)) return false;
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 Vt(e2) {
791
+ function Ht(e2) {
792
792
  return !!e2.match(/\._base_domain_$/);
793
793
  }
794
- var Ht = `www._base_domain_`;
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
- let n2 = e2.match(Mt) || [], r2 = n2[1];
800
- return r2 ? Gt(t2, r2, e2, e2.replace(n2[0], ``)) : e2;
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 Gt(e2, t2, n2, r2) {
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 U(e2, t2) {
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 Kt(e2) {
814
+ function qt(e2) {
815
815
  return e2 === `NaN` ? NaN : e2 === `Infinity` ? 1 / 0 : e2 === `-Infinity` ? -1 / 0 : e2;
816
816
  }
817
- var qt = `x-wix-linguist`;
818
- var Jt = `00000000-0000-0000-0000-000000000000`;
819
- var Yt = `false`;
820
- var Xt = () => {
821
- let e2 = $t(`language`), t2 = $t(`locale`);
822
- if (e2) return { [qt]: [e2, t2 || e2, Yt, Jt].join(`|`) };
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 Zt() {
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 Qt = () => (typeof window < `u` ? window.commonConfig : void 0) ?? globalThis.commonConfig;
831
- var $t = (e2) => Qt()?.[e2];
832
- var en = ({ 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 = nn();
834
- return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language: $t(`language`), locale: $t(`locale`), get passThroughHeaders() {
835
- return Xt();
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 && tn() && (e3 = t2?.getAccessTokenFunction?.());
840
- let n2 = false, { resolve: r2, promise: i2 } = Zt();
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 tn() {
848
+ function nn() {
849
849
  return typeof document < `u` && document.currentScript?.tagName === `SCRIPT`;
850
850
  }
851
- function nn() {
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 rn = ({ clientSdk: e2, applicationId: t2 }) => ({ invoke: async ({ namespace: n2, method: r2, args: i2 }) => {
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 an = en({ createHost: function(e2) {
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: rn({ clientSdk: t2, applicationId: n2 }), close: () => {
867
+ return { channel: an({ clientSdk: t2, applicationId: n2 }), close: () => {
868
868
  } };
869
869
  } });
870
- var W = (e2, t2) => {
871
- let n2 = an.host({ applicationId: e2, componentId: t2 }), r2 = an.auth();
872
- return Ne({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
873
- };
874
- var on = (e2) => W(`13d21c63-b5ec-5912-8397-c3a5ddb27a97`, e2);
875
- var sn = [`ANY_FEMALE`, `ANY_MALE`];
876
- var cn = `3.7.8`;
877
- var ln = cn;
878
- var un = typeof Buffer == `function`;
879
- var dn = typeof TextDecoder == `function` ? new TextDecoder() : void 0;
880
- var fn = typeof TextEncoder == `function` ? new TextEncoder() : void 0;
881
- var pn = Array.prototype.slice.call(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`);
882
- var mn = ((e2) => {
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
- })(pn);
886
- var hn = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
887
- var G = String.fromCharCode.bind(String);
888
- var gn = typeof Uint8Array.from == `function` ? Uint8Array.from.bind(Uint8Array) : (e2) => new Uint8Array(Array.prototype.slice.call(e2, 0));
889
- var _n = (e2) => e2.replace(/=/g, ``).replace(/[+\/]/g, (e3) => e3 == `+` ? `-` : `_`);
890
- var vn = (e2) => e2.replace(/[^A-Za-z0-9\+\/]/g, ``);
891
- var yn = (e2) => {
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 += pn[t2 >> 18 & 63] + pn[t2 >> 12 & 63] + pn[t2 >> 6 & 63] + pn[t2 & 63];
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 bn = typeof btoa == `function` ? (e2) => btoa(e2) : un ? (e2) => Buffer.from(e2, `binary`).toString(`base64`) : yn;
900
- var xn = un ? (e2) => Buffer.from(e2).toString(`base64`) : (e2) => {
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(G.apply(null, e2.subarray(r2, r2 + t2)));
903
- return bn(n2.join(``));
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 Sn = (e2, t2 = false) => t2 ? _n(xn(e2)) : xn(e2);
906
- var Cn = (e2) => {
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 ? G(192 | t2 >>> 6) + G(128 | t2 & 63) : G(224 | t2 >>> 12 & 15) + G(128 | t2 >>> 6 & 63) + G(128 | t2 & 63);
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 G(240 | t2 >>> 18 & 7) + G(128 | t2 >>> 12 & 63) + G(128 | t2 >>> 6 & 63) + G(128 | t2 & 63);
913
- };
914
- var wn = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
915
- var Tn = (e2) => e2.replace(wn, Cn);
916
- var En = un ? (e2) => Buffer.from(e2, `utf8`).toString(`base64`) : fn ? (e2) => xn(fn.encode(e2)) : (e2) => bn(Tn(e2));
917
- var Dn = (e2, t2 = false) => t2 ? _n(En(e2)) : En(e2);
918
- var On = (e2) => Dn(e2, true);
919
- var kn = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g;
920
- var An = (e2) => {
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 G((t2 >>> 10) + 55296) + G((t2 & 1023) + 56320);
924
+ return W((t2 >>> 10) + 55296) + W((t2 & 1023) + 56320);
925
925
  case 3:
926
- return G((15 & e2.charCodeAt(0)) << 12 | (63 & e2.charCodeAt(1)) << 6 | 63 & e2.charCodeAt(2));
926
+ return W((15 & e2.charCodeAt(0)) << 12 | (63 & e2.charCodeAt(1)) << 6 | 63 & e2.charCodeAt(2));
927
927
  default:
928
- return G((31 & e2.charCodeAt(0)) << 6 | 63 & e2.charCodeAt(1));
928
+ return W((31 & e2.charCodeAt(0)) << 6 | 63 & e2.charCodeAt(1));
929
929
  }
930
930
  };
931
- var jn = (e2) => e2.replace(kn, An);
932
- var K = (e2) => {
933
- if (e2 = e2.replace(/\s+/g, ``), !hn.test(e2)) throw TypeError(`malformed base64.`);
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 = mn[e2.charAt(a2++)] << 18 | mn[e2.charAt(a2++)] << 12 | (n2 = mn[e2.charAt(a2++)]) << 6 | (r2 = mn[e2.charAt(a2++)]), n2 === 64 ? i2.push(G(t2 >> 16 & 255)) : r2 === 64 ? i2.push(G(t2 >> 16 & 255, t2 >> 8 & 255)) : i2.push(G(t2 >> 16 & 255, t2 >> 8 & 255, t2 & 255));
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 Mn = typeof atob == `function` ? (e2) => atob(vn(e2)) : un ? (e2) => Buffer.from(e2, `base64`).toString(`binary`) : K;
940
- var Nn = un ? (e2) => gn(Buffer.from(e2, `base64`)) : (e2) => gn(Mn(e2).split(``).map((e3) => e3.charCodeAt(0)));
941
- var Pn = (e2) => Nn(In(e2));
942
- var Fn = un ? (e2) => Buffer.from(e2, `base64`).toString(`utf8`) : dn ? (e2) => dn.decode(Nn(e2)) : (e2) => jn(Mn(e2));
943
- var In = (e2) => vn(e2.replace(/[-_]/g, (e3) => e3 == `-` ? `+` : `/`));
944
- var Ln = (e2) => Fn(In(e2));
945
- var Rn = (e2) => {
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 zn = (e2) => ({ value: e2, enumerable: false, writable: true, configurable: true });
951
- var Bn = function() {
952
- let e2 = (e3, t2) => Object.defineProperty(String.prototype, e3, zn(t2));
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 Ln(this);
954
+ return Rn(this);
955
955
  }), e2(`toBase64`, function(e3) {
956
- return Dn(this, e3);
956
+ return On(this, e3);
957
957
  }), e2(`toBase64URI`, function() {
958
- return Dn(this, true);
958
+ return On(this, true);
959
959
  }), e2(`toBase64URL`, function() {
960
- return Dn(this, true);
960
+ return On(this, true);
961
961
  }), e2(`toUint8Array`, function() {
962
- return Pn(this);
962
+ return Fn(this);
963
963
  });
964
964
  };
965
- var Vn = function() {
966
- let e2 = (e3, t2) => Object.defineProperty(Uint8Array.prototype, e3, zn(t2));
965
+ var Hn = function() {
966
+ let e2 = (e3, t2) => Object.defineProperty(Uint8Array.prototype, e3, Bn(t2));
967
967
  e2(`toBase64`, function(e3) {
968
- return Sn(this, e3);
968
+ return Cn(this, e3);
969
969
  }), e2(`toBase64URI`, function() {
970
- return Sn(this, true);
970
+ return Cn(this, true);
971
971
  }), e2(`toBase64URL`, function() {
972
- return Sn(this, true);
972
+ return Cn(this, true);
973
973
  });
974
974
  };
975
- var Hn = { version: cn, VERSION: ln, atob: Mn, atobPolyfill: K, btoa: bn, btoaPolyfill: yn, fromBase64: Ln, toBase64: Dn, encode: Dn, encodeURI: On, encodeURL: On, utob: Tn, btou: jn, decode: Ln, isValid: Rn, fromUint8Array: Sn, toUint8Array: Pn, extendString: Bn, extendUint8Array: Vn, extendBuiltins: () => {
976
- Bn(), Vn();
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 q = Uint8Array;
979
- var Un = Uint16Array;
980
- var Wn = Int32Array;
981
- var Gn = new q([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 Kn = new q([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 qn = new q([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);
984
- var Jn = function(e2, t2) {
985
- for (var n2 = new Un(31), r2 = 0; r2 < 31; ++r2) n2[r2] = t2 += 1 << e2[r2 - 1];
986
- for (var i2 = new Wn(n2[30]), r2 = 1; r2 < 30; ++r2) for (var a2 = n2[r2]; a2 < n2[r2 + 1]; ++a2) i2[a2] = a2 - n2[r2] << 5 | r2;
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 Yn = Jn(Gn, 2);
990
- var Xn = Yn.b;
991
- var Zn = Yn.r;
992
- Xn[28] = 258, Zn[258] = 28;
993
- var Qn = Jn(Kn, 0);
994
- var $n = Qn.b;
995
- Qn.r;
996
- for (er = new Un(32768), J = 0; J < 32768; ++J) {
997
- tr = (J & 43690) >> 1 | (J & 21845) << 1;
998
- tr = (tr & 52428) >> 2 | (tr & 13107) << 2, tr = (tr & 61680) >> 4 | (tr & 3855) << 4, er[J] = ((tr & 65280) >> 8 | (tr & 255) << 8) >> 1;
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 er;
1002
- var J;
1003
- for (nr = function(e2, t2, n2) {
1004
- for (var r2 = e2.length, i2 = 0, a2 = new Un(t2); i2 < r2; ++i2) e2[i2] && ++a2[e2[i2] - 1];
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 Un(1 << t2);
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[er[d2] >> c2] = l2;
1012
- } else for (s2 = new Un(r2), i2 = 0; i2 < r2; ++i2) e2[i2] && (s2[i2] = er[o2[e2[i2] - 1]++] >> 15 - e2[i2]);
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
- }, rr = new q(288), J = 0; J < 144; ++J) rr[J] = 8;
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 J;
1027
- var ar = nr(rr, 9, 1);
1028
- var or = nr(ir, 5, 1);
1029
- var sr = function(e2) {
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 cr = function(e2, t2, n2) {
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 lr = function(e2, t2) {
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 ur = function(e2) {
1041
+ var dr = function(e2) {
1042
1042
  return (e2 + 7) / 8 | 0;
1043
1043
  };
1044
- var dr = function(e2, t2, n2) {
1045
- return (t2 == null || t2 < 0) && (t2 = 0), (n2 == null || n2 > e2.length) && (n2 = e2.length), new q(e2.subarray(t2, n2));
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 fr = [`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 pr = function(e2, t2, n2) {
1049
- var r2 = Error(t2 || fr[e2]);
1050
- if (r2.code = e2, Error.captureStackTrace && Error.captureStackTrace(r2, pr), !n2) throw 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 mr = function(e2, t2, n2, r2) {
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 q(0);
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 q(i2 * 3));
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 q(Math.max(t3 * 2, e3));
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 = cr(e2, d2, 1);
1068
- var v2 = cr(e2, d2 + 1, 3);
1067
+ u2 = lr(e2, d2, 1);
1068
+ var v2 = lr(e2, d2 + 1, 3);
1069
1069
  if (d2 += 3, !v2) {
1070
- var y2 = ur(d2) + 4, b2 = e2[y2 - 4] | e2[y2 - 3] << 8, x2 = y2 + b2;
1070
+ var y2 = dr(d2) + 4, b2 = e2[y2 - 4] | e2[y2 - 3] << 8, x2 = y2 + b2;
1071
1071
  if (x2 > i2) {
1072
- c2 && pr(0);
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 = ar, m2 = or, h2 = 9, g2 = 5;
1078
+ if (v2 == 1) p2 = or, m2 = sr, h2 = 9, g2 = 5;
1079
1079
  else if (v2 == 2) {
1080
- var S2 = cr(e2, d2, 31) + 257, C2 = cr(e2, d2 + 10, 15) + 4, w2 = S2 + cr(e2, d2 + 5, 31) + 1;
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 q(w2), ee2 = new q(19), E2 = 0; E2 < C2; ++E2) ee2[qn[E2]] = cr(e2, d2 + E2 * 3, 7);
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 = sr(ee2), O2 = (1 << D2) - 1, te2 = nr(ee2, D2, 1), E2 = 0; E2 < w2; ) {
1085
- var k2 = te2[cr(e2, d2, O2)];
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 + cr(e2, d2, 3), d2 += 2, A2 = T2[E2 - 1]) : y2 == 17 ? (ne2 = 3 + cr(e2, d2, 7), d2 += 3) : y2 == 18 && (ne2 = 11 + cr(e2, d2, 127), d2 += 7); ne2--; ) T2[E2++] = A2;
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 = sr(re2), g2 = sr(j2), p2 = nr(re2, h2, 1), m2 = nr(j2, g2, 1);
1096
- } else pr(1);
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 && pr(0);
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[lr(e2, d2) & ie2], oe2 = A2 >> 4;
1104
+ var A2 = p2[ur(e2, d2) & ie2], oe2 = A2 >> 4;
1105
1105
  if (d2 += A2 & 15, d2 > _2) {
1106
- c2 && pr(0);
1106
+ c2 && mr(0);
1107
1107
  break;
1108
1108
  }
1109
- if (A2 || pr(2), oe2 < 256) n2[f2++] = oe2;
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 = Gn[E2];
1117
- se2 = cr(e2, d2, (1 << N2) - 1) + Xn[E2], d2 += N2;
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[lr(e2, d2) & M2], le2 = ce2 >> 4;
1120
- ce2 || pr(3), d2 += ce2 & 15;
1121
- var j2 = $n[le2];
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 = Kn[le2];
1124
- j2 += lr(e2, d2) & (1 << N2) - 1, d2 += N2;
1123
+ var N2 = qn[le2];
1124
+ j2 += ur(e2, d2) & (1 << N2) - 1, d2 += N2;
1125
1125
  }
1126
1126
  if (d2 > _2) {
1127
- c2 && pr(0);
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 && pr(3); f2 < fe2; ++f2) n2[f2] = r2[de2 + f2];
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 ? dr(n2, 0, f2) : n2.subarray(0, f2);
1141
+ return f2 != n2.length && o2 ? fr(n2, 0, f2) : n2.subarray(0, f2);
1142
1142
  };
1143
- var hr = new q(0);
1144
- var gr = function(e2) {
1145
- (e2[0] != 31 || e2[1] != 139 || e2[2] != 8) && pr(6, `invalid gzip data`);
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 _r = function(e2) {
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 vr(e2, t2) {
1156
- var n2 = gr(e2);
1157
- return n2 + 8 > e2.length && pr(6, `invalid gzip data`), mr(e2.subarray(n2, -8), { i: 2 }, t2 && t2.out || new q(_r(e2)), t2 && t2.dictionary);
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 yr = typeof TextDecoder < `u` && new TextDecoder();
1159
+ var br = typeof TextDecoder < `u` && new TextDecoder();
1160
1160
  try {
1161
- yr.decode(hr, { stream: true });
1161
+ br.decode(gr, { stream: true });
1162
1162
  } catch {
1163
1163
  }
1164
- var br = /* @__PURE__ */ new Set([`APPOINTMENT`, `CLASS`, `COURSE`]);
1165
- var xr = new Set(sn);
1166
- function Y(e2) {
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 Sr(e2) {
1169
+ function Cr(e2) {
1170
1170
  return typeof e2 == `number` && Number.isFinite(e2) ? e2 : void 0;
1171
1171
  }
1172
- function Cr(e2) {
1172
+ function wr(e2) {
1173
1173
  return typeof e2 == `boolean` ? e2 : void 0;
1174
1174
  }
1175
- function wr(e2) {
1175
+ function Tr(e2) {
1176
1176
  if (Array.isArray(e2)) return e2.filter((e3) => typeof e3 == `string`);
1177
1177
  }
1178
- function Tr(e2) {
1178
+ function Er(e2) {
1179
1179
  return typeof e2 == `object` && !!e2;
1180
1180
  }
1181
- function Er(e2) {
1182
- if (!Tr(e2)) return null;
1183
- let t2 = Y(e2.t);
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: wr(e2.d) ?? [] }, r2 = Cr(e2.n);
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 Dr(e2) {
1189
- if (!Tr(e2)) return null;
1190
- let t2 = Sr(e2.p), n2 = wr(e2.h);
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 Or(e2) {
1196
- if (!Tr(e2)) return null;
1197
- let t2 = Y(e2.i), n2 = Sr(e2.q);
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 kr(e2, t2) {
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 Ar(e2) {
1206
- if (!Tr(e2)) return null;
1207
- let t2 = Y(e2.i);
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 = Y(e2.g);
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 = Y(e3);
1213
- if (t3 !== void 0 && br.has(t3)) return t3;
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 = Y(e2.t0);
1216
+ let a2 = J(e2.t0);
1217
1217
  a2 !== void 0 && (n2.slotStart = a2);
1218
- let o2 = Y(e2.t1);
1218
+ let o2 = J(e2.t1);
1219
1219
  o2 !== void 0 && (n2.slotEnd = o2);
1220
- let s2 = Y(e2.e);
1220
+ let s2 = J(e2.e);
1221
1221
  s2 !== void 0 && (n2.eventId = s2);
1222
- let c2 = Y(e2.c);
1222
+ let c2 = J(e2.c);
1223
1223
  c2 !== void 0 && (n2.scheduleId = c2);
1224
- let l2 = Y(e2.k);
1224
+ let l2 = J(e2.k);
1225
1225
  l2 !== void 0 && (n2.sessionId = l2);
1226
- let u2 = Y(e2.l);
1226
+ let u2 = J(e2.l);
1227
1227
  u2 !== void 0 && (n2.locationId = u2);
1228
- let d2 = Y(e2.lt);
1228
+ let d2 = J(e2.lt);
1229
1229
  d2 !== `BUSINESS` && d2 !== `CUSTOM` && d2 !== `CUSTOMER` || (n2.locationType = d2);
1230
- let f2 = kr(e2.r, Er);
1230
+ let f2 = Ar(e2.r, Dr);
1231
1231
  f2 && (n2.resources = f2);
1232
- let p2 = kr(e2.x, Dr);
1232
+ let p2 = Ar(e2.x, Or);
1233
1233
  p2 && (n2.selectedVariants = p2);
1234
- let m2 = kr(e2.a, Or);
1234
+ let m2 = Ar(e2.a, kr);
1235
1235
  m2 && (n2.addOns = m2);
1236
- let h2 = Y(e2.dc);
1236
+ let h2 = J(e2.dc);
1237
1237
  h2 && (n2.durationChoiceId = h2);
1238
- let g2 = Sr(e2.dm);
1238
+ let g2 = Cr(e2.dm);
1239
1239
  g2 !== void 0 && Number.isInteger(g2) && g2 > 0 && (n2.durationInMinutes = g2);
1240
- let _2 = Y(e2.rg);
1241
- return _2 !== void 0 && xr.has(_2) && (n2.requestedGender = _2), n2;
1240
+ let _2 = J(e2.rg);
1241
+ return _2 !== void 0 && Sr.has(_2) && (n2.requestedGender = _2), n2;
1242
1242
  }
1243
- function jr(e2) {
1244
- if (!Tr(e2)) return null;
1245
- let t2 = Y(e2.m);
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(Ar).filter((e3) => e3 !== null) }, r2 = Y(e2.z);
1248
- return r2 !== void 0 && (n2.timezone = r2), true === Cr(e2.cp) && (n2.wantsPromoCode = true), n2;
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 Mr = new TextDecoder();
1252
- function Nr(e2) {
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 = Hn.toUint8Array(e2.slice(1)), r2;
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 = vr(n2);
1259
+ r2 = yr(n2);
1260
1260
  }
1261
- return jr(JSON.parse(Mr.decode(r2)));
1261
+ return Mr(JSON.parse(Nr.decode(r2)));
1262
1262
  } catch {
1263
1263
  return null;
1264
1264
  }
1265
1265
  }
1266
- function Pr(e2) {
1266
+ function Fr(e2) {
1267
1267
  return e2;
1268
1268
  }
1269
- var Fr = Pr(`@wix/site-service-editor-context`);
1270
- var Ir = Pr(`@wix/site-service-pages`);
1271
- var Lr = Pr(`@wix/site-service-router`);
1272
- var Rr = Pr(`@wix/site-service-url`);
1273
- var zr = Pr(`@wix/site-service-renderer-configuration`);
1274
- var Br = `13d21c63-b5ec-5912-8397-c3a5ddb27a97`;
1275
- var Vr = `shopping_cart`;
1276
- var Hr = `thank_you_page`;
1277
- var Ur = `1cd44cf8-756f-41c3-bd90-3e2ffcaf1155`;
1278
- var Wr = function(e2) {
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 Gr = `{{(.*?)}}`;
1282
- var Kr = `[{{}}]`;
1283
- var qr = `([^/]+)`;
1284
- var Jr;
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
- })(Jr ||= {});
1288
- var X;
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
- })(X ||= {});
1292
- var Yr = {};
1293
- var Xr = (Yr[X.PRODUCT_PAGE] = { variables: [`slug`], required: [`slug`] }, Yr);
1294
- var Zr = `{{main-mapping}}`;
1295
- var Qr = {};
1296
- var $r;
1297
- var ei = (Qr[X.BLOG_POST] = { variables: [`slug`], required: [`slug`], subMappings: ($r = {}, $r[X.BLOG_POST_EDIT] = { defaultMapping: `${Zr}/edit` }, $r[X.BLOG_POST_PREVIEW] = { required: [`instance`], defaultMapping: `${Zr}/preview/{{instance}}` }, $r) }, Qr);
1298
- var ti = {};
1299
- var ni = (ti[X.BLOG_CATEGORY] = { variables: [`slug`], required: [`slug`], defaultPrefix: `categories` }, ti);
1300
- var ri = {};
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 = (ri[X.FORUM_POST] = { variables: [`categorySlug`, `postSlug`], required: [`categorySlug`, `postSlug`], subMappings: (ii = {}, ii[X.FORUM_POST_EDIT] = { defaultMapping: `${Zr}/edit` }, ii[X.FORUM_POST_PAGINATION] = { required: [`page`], defaultMapping: `${Zr}/p-{{page}}` }, ii[X.FORUM_POST_DEEP_LINK_DATA] = { required: [`deepLinkData`], defaultMapping: `${Zr}/dl-{{deepLinkData}}` }, ii[X.FORUM_POST_PAGINATION_AND_DEEP_LINK_DATA] = { required: [`page`, `deepLinkData`], defaultMapping: `${Zr}/p-{{page}}/dl-{{deepLinkData}}` }, ii) }, ri[X.FORUM_CATEGORY] = { variables: [`slug`], required: [`slug`], subMappings: (ai = {}, ai[X.FORUM_CATEGORY_CREATE_POST] = { defaultMapping: `${Zr}/create-post` }, ai[X.FORUM_CATEGORY_CREATE_QUESTION] = { defaultMapping: `${Zr}/create-question` }, ai[X.FORUM_CATEGORY_PAGINATION] = { required: [`page`], defaultMapping: `${Zr}/p-{{page}}` }, ai) }, ri);
1304
- var si = {};
1305
- var ci = (si[X.GROUP] = { variables: [`groupId`, `tabName`], required: [`groupId`, `tabName`] }, si[X.GROUP_POST] = { variables: [`groupId`, `tabName`, `postId`], required: [`groupId`, `tabName`, `postId`] }, si);
1306
- var li = {};
1307
- var ui = (li[X.BOOKINGS_SERVICE] = { variables: [`slug`], required: [`slug`], defaultPrefix: `service-page` }, li);
1308
- var di = {};
1309
- var fi = (di[X.CHALLENGES_PAGE] = { variables: [`slug`], required: [`slug`], defaultPrefix: `challenge-page` }, di);
1310
- var pi = {};
1311
- var mi = (pi[Jr.product_page] = Xr, pi[Jr.post] = ei, pi[Jr.blog] = ni, pi[Jr.forum] = oi, pi[Jr.group] = ci, pi[Jr.bookings] = ui, pi[Jr.challenges] = fi, pi);
1312
- var hi = function() {
1313
- return hi = Object.assign || function(e2) {
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
- }, hi.apply(this, arguments);
1316
+ }, gi.apply(this, arguments);
1317
1317
  };
1318
- function gi(e2) {
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 Z(e2, t2) {
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 _i(e2, t2, n2) {
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 vi = function(e2) {
1348
- return Object.values(yi()).some(function(t2) {
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 yi = function() {
1353
- return Object.values(mi).reduce(function(e2, t2) {
1354
- return hi(hi({}, e2), t2);
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
- return Object.entries(mi).filter(function(t2) {
1363
- var n2 = Z(t2, 2)[1];
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 Z(e3, 1)[0];
1366
+ return X(e3, 1)[0];
1367
1367
  })[0];
1368
1368
  };
1369
- var Si = function(e2) {
1370
- return Object.entries(yi()).find(function(t2) {
1371
- var n2 = Z(t2, 2);
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 Ci = function(e2) {
1375
+ var wi = function(e2) {
1376
1376
  var t2 = [];
1377
- if (vi(e2)) {
1378
- var n2 = Z(Si(e2), 2);
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, _i(_i([], Z(r2?.required || []), false), Z(r2?.subMappings?.[e2]?.required || []), false));
1382
- } else t2.push.apply(t2, _i([], Z(bi(e2)?.required || []), false));
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 wi = function(e2, t2) {
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 Ti = function(e2, t2) {
1391
+ var Ei = function(e2, t2) {
1392
1392
  return Error(`Url Mappings Error - [${e2}]: ${t2}`);
1393
1393
  };
1394
- var Ei = Object.values(X);
1395
- var Di = Ti(`key`, `must be one of: ${Ei.toString()}`);
1396
- var Oi = function(e2) {
1397
- if (typeof e2 != `string` || !Ei.includes(e2)) return Di;
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 ki = Ti(`itemData`, `must be on object with string as value, for example: { "slug": "shoes" }`);
1400
- var Ai = function(e2) {
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 ki;
1403
+ }) || Array.isArray(e2)) return Ai;
1404
1404
  };
1405
- var ji = Ti(`itemData`, `must have required variables, for example: { "slug": "shoes" }`);
1406
- var Mi = function(e2, t2) {
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 = Ci(e2);
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 ji;
1413
+ return Mi;
1414
1414
  }
1415
1415
  };
1416
- var Ni = function(e2) {
1416
+ var Pi = function(e2) {
1417
1417
  var t2 = e2.key, n2 = e2.itemData;
1418
- return [Oi(t2), Ai(n2), Mi(t2, n2)].find(Boolean);
1418
+ return [ki(t2), ji(n2), Ni(t2, n2)].find(Boolean);
1419
1419
  };
1420
- var Pi = function(e2) {
1420
+ var Fi = function(e2) {
1421
1421
  return function(t2) {
1422
- var n2 = new RegExp(Kr, `g`), r2 = t2.replace(n2, ``);
1422
+ var n2 = new RegExp(qr, `g`), r2 = t2.replace(n2, ``);
1423
1423
  return e2?.[r2];
1424
1424
  };
1425
1425
  };
1426
- var Fi = function(e2, t2, n2, r2) {
1426
+ var Ii = function(e2, t2, n2, r2) {
1427
1427
  e2 === void 0 && (e2 = { main: [] }), r2 === void 0 && (r2 = {});
1428
- var i2 = Ni({ key: t2, itemData: n2 });
1428
+ var i2 = Pi({ key: t2, itemData: n2 });
1429
1429
  if (i2) throw i2;
1430
- var a2 = (wi(e2, t2) || {}).mapping, o2 = (r2 || {}).baseUrl;
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(Gr, `g`), c2 = a2.replace(s2, Pi(n2));
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 Ii = /[.*+?^$()|]/g;
1437
- var Li = function(e2) {
1438
- var t2 = e2.replace(Ii, `\\$&`).replace(new RegExp(Gr, `g`), qr);
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 Ri = function(e2, t2) {
1441
+ var zi = function(e2, t2) {
1442
1442
  return e2 === void 0 && (e2 = []), e2.find(function(e3) {
1443
- return Li(e3).test(t2);
1443
+ return Ri(e3).test(t2);
1444
1444
  });
1445
1445
  };
1446
- Ti(`url`, `Url must be a string`);
1447
- var zi = function(e2) {
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 Hi = function(e2, t2) {
1459
+ var Ui = function(e2, t2) {
1460
1460
  var n2 = t2.urlMappingKey;
1461
- return Ci(n2)?.every(function(t3) {
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?.split(`/`).every(Ui);
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 Ki = function(e2, t2) {
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 = Z(r2.split(`/`), 1)[0], s2 = Z(i2, 1)[0];
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 qi = function(e2, t2) {
1484
+ var Ji = function(e2, t2) {
1485
1485
  var n2 = t2.pathPrefixes;
1486
- return Ki(Object.values(n2).map(function(e3) {
1486
+ return qi(Object.values(n2).map(function(e3) {
1487
1487
  return e3.publishedPrefix;
1488
- }).filter(Boolean), Gi(t2.pathPrefix))(e2, t2.defaultMapping.defaultPublished);
1488
+ }).filter(Boolean), Ki(t2.pathPrefix))(e2, t2.defaultMapping.defaultPublished);
1489
1489
  };
1490
- var Ji = function(e2, t2) {
1490
+ var Yi = function(e2, t2) {
1491
1491
  var n2 = t2.urlMappingKey, r2 = t2.urlMappings;
1492
- return !Ri(r2.main?.filter(function(e3) {
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 Yi = function(e2) {
1499
- e2 = e2.replace(new RegExp(Gr, `ig`), ``);
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 Xi = function(e2) {
1504
- var t2 = Z(e2, 1)[0], n2 = e2.slice(-1);
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 Zi = function(e2, t2) {
1507
+ var Qi = function(e2, t2) {
1508
1508
  var n2 = t2.pathPrefixes;
1509
- return Ki(Object.values(n2).map(function(e3) {
1509
+ return qi(Object.values(n2).map(function(e3) {
1510
1510
  return e3.savedPrefix;
1511
- }).filter(Boolean), Gi(t2.pathPrefix))(e2, t2.defaultMapping.defaultSaved);
1511
+ }).filter(Boolean), Ki(t2.pathPrefix))(e2, t2.defaultMapping.defaultSaved);
1512
1512
  };
1513
- var Q;
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
- })(Q ||= {});
1517
- var Qi = function() {
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 = [[Bi, Q.MAX_LENGTH_ERROR], [zi, Q.NO_SPACES_ERROR], [Xi, Q.NO_STARTING_OR_ENDING_SLASH_ERROR], [Vi, Q.NO_EMPTY_SEGMENT_ERROR], [Yi, Q.NO_INVALID_CHARACTERS_ERROR], [Hi, Q.CONTAIN_MAIN_VARIABLE_ERROR], [Wi, Q.ONLY_ONE_VARIABLE_PER_SEGMENT_ERROR], [qi, Q.ONLY_UNIQUE_PUBLISHED_URL_ERROR], [Zi, Q.ONLY_UNIQUE_SAVED_URL_ERROR], [Ji, Q.ONLY_UNIQUE_MAPPING_ERROR]];
1522
- }, this.urlMappings = r2, this.pathPrefixes = n2, this.urlMappingKey = t2, this.pathPrefix = this.getPathPrefix(), this.defaultMapping = $i(t2, this.pathPrefix), this.initValidators();
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 = xi(this.urlMappingKey);
1526
- if (!t2) throw vi(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})`);
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 = gi(this.validators), i2 = r2.next(); !i2.done; i2 = r2.next()) {
1535
- var a2 = Z(i2.value, 2), o2 = a2[0], s2 = a2[1], c2 = !!o2(e3, this.validatorProps);
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(Q), e2.MAX_URL_MAPPING_LENGTH = 1e3, e2.FALLBACK_PATH_PREFIX = `unknown`, e2;
1548
+ }, e2.errorArray = Object.values(Z), e2.MAX_URL_MAPPING_LENGTH = 1e3, e2.FALLBACK_PATH_PREFIX = `unknown`, e2;
1549
1549
  }();
1550
- var $i = function(e2, t2) {
1551
- var n2 = yi()[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 = Qi.FALLBACK_PATH_PREFIX, a2.publishedPrefix = Qi.FALLBACK_PATH_PREFIX), { defaultSaved: _i([a2.savedPrefix, i2], Z(r2?.map(function(e3) {
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: _i([a2.publishedPrefix, i2], Z(r2?.map(function(e3) {
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 ea(e2, t2) {
1559
- return t2 ? Fi(e2, X.BOOKINGS_SERVICE, { slug: t2 }, { baseUrl: `` }) : void 0;
1558
+ function ta(e2, t2) {
1559
+ return t2 ? Ii(e2, Y.BOOKINGS_SERVICE, { slug: t2 }, { baseUrl: `` }) : void 0;
1560
1560
  }
1561
- var ta = [{ path: `bookingPolicyViolations.earliestBookingDate` }];
1562
- var na = [{ path: `timeSlots.bookingPolicyViolations.earliestBookingDate` }];
1563
- function ra(e2) {
1564
- return H(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` }] } }));
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 ia = `@wix/auto_sdk_bookings_availability-time-slots`;
1567
- function aa(e2) {
1566
+ var aa = `@wix/auto_sdk_bookings_availability-time-slots`;
1567
+ function oa(e2) {
1568
1568
  function t2({ host: t3 }) {
1569
- let n2 = B(e2, [{ transformFn: He, paths: ta }]);
1570
- return { entityFqdn: `wix.bookings.availability.v2.time_slot`, method: `POST`, methodFqn: `com.wixpress.bookings.availability.v2.AvailabilityTimeSlots.ListAvailabilityTimeSlots`, packageName: ia, migrationOptions: { optInTransformResponse: true }, url: ra({ protoPath: `/v2/time-slots`, data: n2, host: t3 }), data: n2, transformResponse: (e3) => B(e3, [{ transformFn: Ue, paths: na }]) };
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 oa(e2) {
1575
- let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = aa(Ve({ 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 }));
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), R(e3.data);
1579
+ return n2?.onSuccess?.(e3), L(e3.data);
1580
1580
  } catch (e3) {
1581
- let t3 = lt(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`]);
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 sa(e2) {
1586
- return (t2) => oa(t2, { httpClient: e2 });
1585
+ function ca(e2) {
1586
+ return (t2) => sa(t2, { httpClient: e2 });
1587
1587
  }
1588
- var ca = bt(sa);
1589
- var la = [{ path: `bookingPolicyViolations.earliestBookingDate` }];
1590
- var ua = [{ path: `timeSlots.bookingPolicyViolations.earliestBookingDate` }, { path: `schedulesInfo.firstSessionStart` }, { path: `schedulesInfo.lastSessionEnd` }, { path: `schedulesInfo.enrollmentViolations.earliestBookingDate` }];
1591
- function da(e2) {
1592
- return H(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` }] } }));
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 fa = `@wix/auto_sdk_bookings_event-time-slots`;
1595
- function pa(e2) {
1594
+ var pa = `@wix/auto_sdk_bookings_event-time-slots`;
1595
+ function ma(e2) {
1596
1596
  function t2({ host: t3 }) {
1597
- let n2 = B(e2, [{ transformFn: He, paths: la }]);
1598
- return { entityFqdn: `wix.bookings.availability.v2.time_slot`, method: `POST`, methodFqn: `com.wixpress.bookings.availability.v2.EventTimeSlots.ListEventTimeSlots`, packageName: fa, migrationOptions: { optInTransformResponse: true }, url: da({ protoPath: `/v2/time-slots/event`, data: n2, host: t3 }), data: n2, transformResponse: (e3) => B(e3, [{ transformFn: Ue, paths: ua }]) };
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 ma(e2) {
1603
- let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = pa(Ve({ 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 }));
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), R(e3.data);
1607
+ return n2?.onSuccess?.(e3), L(e3.data);
1608
1608
  } catch (e3) {
1609
- let t3 = lt(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`]);
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 ha(e2) {
1614
- return (t2) => ma(t2, { httpClient: e2 });
1613
+ function ga(e2) {
1614
+ return (t2) => ha(t2, { httpClient: e2 });
1615
1615
  }
1616
- var ga = bt(ha);
1617
- var _a = [{ path: `bookingPolicyViolations.earliestBookingDate` }];
1618
- var va = [{ path: `timeSlots.bookingPolicyViolations.earliestBookingDate` }];
1619
- function ya(e2) {
1620
- return H(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` }] } }));
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 ba = `@wix/auto_sdk_bookings_multi-service-availability-time-slots`;
1623
- function xa(e2) {
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 = B(e2, [{ transformFn: He, paths: _a }]);
1626
- return { entityFqdn: `wix.bookings.availability.v2.time_slot`, method: `POST`, methodFqn: `com.wixpress.bookings.availability.v2.MultiServiceAvailabilityTimeSlots.ListMultiServiceAvailabilityTimeSlots`, packageName: ba, migrationOptions: { optInTransformResponse: true }, url: ya({ protoPath: `/v2/multi-service-time-slots`, data: n2, host: t3 }), data: n2, transformResponse: (e3) => B(e3, [{ transformFn: Ue, paths: va }]) };
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 Sa(e2) {
1631
- let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = xa(Ve({ 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 }));
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), R(e3.data);
1635
+ return n2?.onSuccess?.(e3), L(e3.data);
1636
1636
  } catch (e3) {
1637
- let t3 = lt(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`]);
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 Ca(e2) {
1642
- return (t2) => Sa(t2, { httpClient: e2 });
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 Aa = `@wix/auto_sdk_bookings_time-slots-configuration`;
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: Aa, migrationOptions: { optInTransformResponse: true }, url: ka({ protoPath: `/v1/time-slots-configurations/app/{appId}`, data: e2, host: t3 }), params: xt(e2), transformResponse: (e3) => B(e3, [{ transformFn: Ue, paths: Oa }]) };
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 Ma(e2) {
1660
- let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = ja(Ve({ appId: e2 }));
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), R(e3.data);
1665
+ return n2?.onSuccess?.(e3), L(e3.data);
1665
1666
  } catch (e3) {
1666
- let t3 = lt(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { appId: `$[0]` }, singleArgumentUnchanged: false }, [`appId`]);
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 Na(e2) {
1671
- return (t2) => Ma(t2, { httpClient: e2 });
1671
+ function Fa(e2) {
1672
+ return (t2) => Pa(t2, { httpClient: e2 });
1672
1673
  }
1673
- var Pa = bt(Na);
1674
- var Fa = [{ path: `bookingsSettings.createdDate` }, { path: `bookingsSettings.updatedDate` }];
1675
- var Ia = [{ path: `bookingsSettings.siteProperties.address.coordinates.latitude` }, { path: `bookingsSettings.siteProperties.address.coordinates.longitude` }];
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: Ra, migrationOptions: { optInTransformResponse: true }, url: La({ protoPath: `/v2/settings`, data: e2, host: t3 }), params: xt(e2), transformResponse: (e3) => B(e3, [{ transformFn: Ue, paths: Fa }, { transformFn: Kt, paths: Ia }]), fallback: [{ method: `GET`, url: La({ protoPath: `/v2/settings`, data: e2, host: t3 }), params: xt(e2) }] };
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 Ba = ((e2) => (e2.BUSINESS_TIME_ZONE = `BUSINESS_TIME_ZONE`, e2.CUSTOMER_TIME_ZONE = `CUSTOMER_TIME_ZONE`, e2))(Ba || {});
1687
- async function Va() {
1688
- let { httpClient: e2, sideEffects: t2 } = arguments[0], n2 = za(Ve({}));
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), R(r2.data)?.bookingsSettings;
1693
+ return t2?.onSuccess?.(r2), L(r2.data)?.bookingsSettings;
1693
1694
  } catch (e3) {
1694
- let n3 = lt(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: {}, singleArgumentUnchanged: false }, []);
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 Ga(e2) {
1706
+ function qa(e2) {
1706
1707
  return e2.business?.name ?? null;
1707
1708
  }
1708
- function Ka(e2) {
1709
- return (e2?.locations ?? []).filter((e3) => e3.type === Da.BUSINESS).map((e3) => ({ id: Wa(e3) ?? ``, label: Ga(e3) ?? `` })).filter((e3) => e3.id !== ``).sort((e3, t2) => e3.label.localeCompare(t2.label));
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 qa = (e2) => e2 === Ea.APPOINTMENT;
1712
- var Ja = (e2) => e2 === Ea.CLASS;
1713
- var Ya = (e2) => e2 === Ea.COURSE;
1714
- var Xa = { category: `category`, location: `location`, page: `page`, blob: `b`, resource: `resource`, referral: `referral`, timezone: `timezone`, bookingId: `bookingId`, token: `token`, rescheduleRedirectUrl: `rescheduleRedirectUrl` };
1715
- function Za(e2) {
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 = ro(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 } } : {} };
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 Qa(e2) {
1723
+ function no(e2) {
1721
1724
  return (e2?.services.length ?? 0) > 1;
1722
1725
  }
1723
- var $a = (e2) => ({ valid: false, reason: e2 });
1724
- function eo(e2) {
1726
+ var ro = (e2) => ({ valid: false, reason: e2 });
1727
+ function io(e2) {
1725
1728
  let t2 = e2?.services ?? [];
1726
- if (!Qa(e2) || t2.some((e3) => !e3.serviceId)) return $a(`too-few-services`);
1727
- if (t2.some((e3) => e3.serviceType && e3.serviceType !== `APPOINTMENT`)) return $a(`not-appointment`);
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 $a(`location-mixed`);
1730
- if (r2 && n2 !== `BUSINESS`) return $a(`location-id-not-business`);
1731
- let i2 = t2.map((e3) => ({ serviceId: e3.serviceId, staff: no(e3), customerChoices: Za(e3) }));
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 to = `staff`;
1735
- function no(e2) {
1736
- let t2 = e2.resources?.find((e3) => e3.type === to);
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 ro(e2) {
1744
+ function so(e2) {
1742
1745
  return e2.addOns ?? [];
1743
1746
  }
1744
- function io(e2, t2) {
1747
+ function co(e2, t2) {
1745
1748
  let n2 = e2(t2);
1746
1749
  return n2 ? n2.replace(/\/$/, ``) || `/` : null;
1747
1750
  }
1748
- function ao(e2, t2, n2) {
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 oo(e2, t2) {
1755
+ function uo(e2, t2) {
1753
1756
  switch (e2) {
1754
1757
  case `servicePage`:
1755
- return (t2.slug ? t2.buildCustomServiceUrl(t2.slug) : void 0) ?? ao(t2.appSectionUrl, Wr.SERVICE_PAGE, t2.slug);
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 ? io(t2.appSectionUrl, Wr.CALENDAR_PAGE) : ao(t2.appSectionUrl, Wr.CALENDAR_PAGE, t2.slug);
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 ? ao(t2.appSectionUrl, Wr.FORM_PAGE, t2.slug) : null;
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 so = (e2) => e2.target === `_blank`;
1765
- var co = (e2, t2) => t2 === `/` ? e2 : new URL(`.${t2}`, `${e2}/`).href;
1766
- var lo = (e2, t2, n2) => n2 ? `.${t2}` : uo(e2, t2);
1767
- var uo = (e2, t2) => e2 ? co(e2, t2) : t2;
1768
- var fo = () => {
1769
- let { previewMode: e2 } = (0, import_services_manager_react.useService)(Fr), t2 = (0, import_services_manager_react.useService)(Rr), n2 = t2.siteUrl.replace(/\/$/, ``), { navigateTo: i2 } = (0, import_services_manager_react.useService)(Lr), a2 = (0, import_services_manager_react.useService)(zr), o2 = (0, import_services_manager_react.useGetService)(), s2 = (0, import_react.useCallback)(async (t3) => {
1770
- let r2 = lo(n2, t3, e2);
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(so(e3) ? { href: e3.href, type: `ExternalLink`, target: `_blank` } : { href: e3.href });
1774
- }, [i2]), l2 = (0, import_react.useCallback)((e3) => uo(n2, e3), [n2]), u2 = (0, import_react.useCallback)((e3) => t2.appSectionRelativeUrl(Br, e3), [t2]), p2 = (0, import_react.useCallback)((e3) => ea(a2.urlMappings, e3), [a2]), m2 = (0, import_react.useCallback)((e3, t3) => oo(e3, { ...t3, appSectionUrl: u2, buildCustomServiceUrl: p2 }), [u2, p2]), h2 = (0, import_react.useCallback)((e3, t3) => {
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 ? co(n2, r2) : null;
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(Wr.FORM_PAGE) || void 0, [u2]), v2 = (0, import_react.useCallback)((e3) => Object.values(o2(Ir).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]);
1781
- return { navigate: s2, navigateToHref: c2, resolvePath: m2, toHref: l2, resolveAbsoluteUrl: h2, navigateTo: g2, getBookingFormPath: _2, getCartPagePath: (0, import_react.useCallback)(() => v2(Vr), [v2]), getThankYouPagePath: (0, import_react.useCallback)((e3) => {
1782
- let t3 = v2(Hr);
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 po(e2) {
1789
+ function _o(e2) {
1787
1790
  return e2?.details?.applicationError?.code;
1788
1791
  }
1789
- function mo() {
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 ho(() => e2(t3, n3));
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 ho(() => n2.use(e3));
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 ho(() => t2.use(e3));
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 ho(e2) {
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 go(e2, t2) {
1829
+ function bo(e2, t2) {
1827
1830
  return { ...e2, ...Object.fromEntries(t2.map((t3) => [t3, (...n2) => {
1828
- let r2 = mo();
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 _o(e2) {
1834
- return go({ __type: `host`, create: (t2) => Object.entries(e2).reduce((e3, [n2, r2]) => ({ ...e3, [n2]: r2(t2) }), {}) }, Object.keys(e2));
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 vo = class {
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 yo = (e2) => new vo(e2);
1852
- var bo = _o({ getMonitoringClient: (e2) => () => e2.getMonitoringClient ? e2.getMonitoringClient() : yo(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`) });
1853
- var xo = { 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` };
1854
- function So(e2) {
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 = bo.getMonitoringClient?.();
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 = So(`captureException`);
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
- var Co = (e2) => {
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 wo = (e2) => /* @__PURE__ */ new Date(`${e2}T00:00:00`);
1873
- var To = (e2, t2) => new Intl.DateTimeFormat(`en-CA`, { year: `numeric`, month: `2-digit`, day: `2-digit`, ...t2 ? { timeZone: t2 } : {} }).format(e2);
1874
- var Eo = (e2) => `${Co(e2)}T00:00:00`;
1875
- var Do = (e2) => `${Co(e2)}T23:59:59`;
1876
- function Oo(e2, t2) {
1877
- return `${To(e2, t2)}T${new Intl.DateTimeFormat(`en-GB`, { timeZone: t2, hourCycle: `h23`, hour: `2-digit`, minute: `2-digit`, second: `2-digit` }).format(e2)}`;
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 ko(e2, t2) {
1880
- let n2 = Oo(new Date(Date.now()), t2);
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 Ao = /^\d{4}-\d{2}-\d{2}$/;
1884
- var jo = 864e5;
1885
- function Mo(e2) {
1886
- if (typeof e2 != `string` || !Ao.test(e2)) return false;
1887
- let t2 = wo(e2);
1888
- return !Number.isNaN(t2.getTime()) && Co(t2) === e2;
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 No(e2) {
1901
+ function Ro(e2) {
1891
1902
  if (!e2 || typeof e2 != `object`) return false;
1892
1903
  let { startDate: t2, endDate: n2 } = e2;
1893
- return Mo(t2) && Mo(n2) && t2 <= n2;
1904
+ return Lo(t2) && Lo(n2) && t2 <= n2;
1894
1905
  }
1895
- function Po(e2, t2) {
1896
- let n2 = wo(e2);
1897
- return n2.setDate(n2.getDate() + t2), Co(n2);
1906
+ function zo(e2, t2) {
1907
+ let n2 = ko(e2);
1908
+ return n2.setDate(n2.getDate() + t2), Oo(n2);
1898
1909
  }
1899
- function Fo({ startDate: e2, endDate: t2 }) {
1900
- let n2 = wo(t2).getTime() - wo(e2).getTime();
1901
- return Math.round(n2 / jo) + 1;
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 Io(e2) {
1904
- let t2 = wo(e2), n2 = new Date(t2.getFullYear(), t2.getMonth(), 1), r2 = new Date(t2.getFullYear(), t2.getMonth() + 1, 0);
1905
- return { startDate: Co(n2), endDate: Co(r2) };
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 Lo(e2) {
1908
- let t2 = Io(e2.startDate);
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 Ro(e2, t2) {
1912
- if (Lo(e2)) {
1913
- let n3 = wo(e2.startDate);
1914
- return Io(Co(new Date(n3.getFullYear(), n3.getMonth() + t2, 1)));
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 * Fo(e2);
1917
- return { startDate: Po(e2.startDate, n2), endDate: Po(e2.endDate, n2) };
1927
+ let n2 = t2 * Bo(e2);
1928
+ return { startDate: zo(e2.startDate, n2), endDate: zo(e2.endDate, n2) };
1918
1929
  }
1919
- function zo(e2, t2) {
1930
+ function Wo(e2, t2) {
1920
1931
  return e2 >= t2.startDate && e2 <= t2.endDate;
1921
1932
  }
1922
- function Bo(e2) {
1923
- let t2 = wo(e2), n2 = new Date(t2.getFullYear(), t2.getMonth() + 2, 0).getDate(), r2 = Math.min(t2.getDate(), n2);
1924
- return Co(new Date(t2.getFullYear(), t2.getMonth() + 1, r2));
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 Vo(e2) {
1937
+ function Ko(e2) {
1927
1938
  let t2 = [], n2 = e2.startDate;
1928
1939
  for (; n2 <= e2.endDate; ) {
1929
- let r2 = Po(Bo(n2), -1), i2 = r2 < e2.endDate ? r2 : e2.endDate;
1930
- t2.push({ startDate: n2, endDate: i2 }), n2 = Po(i2, 1);
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 Ho({ allowGenderSelection: e2, staffSelectionStrategy: t2 }) {
1945
+ function qo({ allowGenderSelection: e2, staffSelectionStrategy: t2 }) {
1935
1946
  return e2 && t2 !== `CUSTOMER_CANNOT_CHOOSE`;
1936
1947
  }
1937
- async function Uo() {
1938
- let e2 = await Pa(Br);
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 Wo(e2) {
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 Go(e2) {
1956
+ function Xo(e2) {
1946
1957
  return e2.availableResources?.[0]?.resources?.[0]?._id ?? null;
1947
1958
  }
1948
- function Ko(e2) {
1949
- return `${Wo(e2)}|${Go(e2) ?? ``}`;
1959
+ function Zo(e2) {
1960
+ return `${Yo(e2)}|${Xo(e2) ?? ``}`;
1950
1961
  }
1951
- function qo(e2) {
1962
+ function Qo(e2) {
1952
1963
  let t2 = /* @__PURE__ */ new Map();
1953
1964
  for (let n2 of e2) {
1954
- let e3 = Wo(n2), r2 = t2.get(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 Jo(e2) {
1974
+ function $o(e2) {
1964
1975
  return e2 ? { locations: [{ _id: e2, locationType: `BUSINESS` }] } : {};
1965
1976
  }
1966
- function Yo(e2) {
1967
- return e2 ? { resourceTypes: [{ resourceTypeId: Ur, resourceIds: [e2] }] } : {};
1977
+ function es(e2) {
1978
+ return e2 ? { resourceTypes: [{ resourceTypeId: Wr, resourceIds: [e2] }] } : {};
1968
1979
  }
1969
- function Xo(e2) {
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 Zo(e2, t2) {
1984
+ function ns(e2, t2) {
1974
1985
  if (!e2) return {};
1975
- let n2 = t2 ? Xo(e2) : e2;
1986
+ let n2 = t2 ? ts(e2) : e2;
1976
1987
  return n2 ? { customerChoices: n2 } : {};
1977
1988
  }
1978
- var Qo = `REQUESTED_GENDER_NOT_ALLOWED`;
1979
- function $o(e2) {
1980
- return po(e2) === Qo;
1989
+ var rs = `REQUESTED_GENDER_NOT_ALLOWED`;
1990
+ function is(e2) {
1991
+ return _o(e2) === rs;
1981
1992
  }
1982
- var es = false;
1983
- var ts = /* @__PURE__ */ new Set();
1984
- function ns() {
1985
- return es;
1993
+ var as = false;
1994
+ var os = /* @__PURE__ */ new Set();
1995
+ function ss() {
1996
+ return as;
1986
1997
  }
1987
- function rs(e2) {
1988
- return ts.add(e2), () => ts.delete(e2);
1998
+ function cs(e2) {
1999
+ return os.add(e2), () => os.delete(e2);
1989
2000
  }
1990
- function is() {
1991
- es || (es = true, ts.forEach((e2) => e2()));
2001
+ function ls() {
2002
+ as || (as = true, os.forEach((e2) => e2()));
1992
2003
  }
1993
- async function as(e2) {
2004
+ async function us(e2) {
1994
2005
  let { customerChoices: t2, ...n2 } = e2, r2 = (e3) => {
1995
- let t3 = Xo(e3);
1996
- return ca({ ...n2, ...t3 ? { customerChoices: t3 } : {} });
2006
+ let t3 = ts(e3);
2007
+ return la({ ...n2, ...t3 ? { customerChoices: t3 } : {} });
1997
2008
  };
1998
- if (es && t2?.requestedGender) return r2(t2);
2009
+ if (as && t2?.requestedGender) return r2(t2);
1999
2010
  try {
2000
- return await ca(e2);
2011
+ return await la(e2);
2001
2012
  } catch (e3) {
2002
- if (!t2?.requestedGender || !$o(e3)) throw e3;
2003
- return $(e3, { feature: xo.timeSlots, action: `requested-gender-rejected`, level: `warning` }), is(), r2(t2);
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 os(e2, t2, n2) {
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 ss(e2) {
2010
- let t2 = await ga(e2);
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 cs({ 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 }) {
2014
- return qa(t2) ? ls({ serviceId: e2, fromLocalDate: n2, toLocalDate: r2, timeZone: i2, locationId: a2, staffId: o2, onlyAvailableSlots: s2, customerChoices: c2, timeSlotsPerDay: u2, limit: d2, cursor: f2 }) : ss({ serviceIds: [e2], fromLocalDate: n2, ...r2 ? { toLocalDate: r2 } : {}, ...i2 ? { timeZone: i2 } : {}, includeNonBookable: !s2, eventFilter: { type: t2, ...os(a2, o2, l2) }, cursorPaging: { limit: d2, ...f2 ? { cursor: f2 } : {} } });
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 ls({ serviceId: e2, fromLocalDate: t2, toLocalDate: n2, timeZone: r2, locationId: i2, staffId: a2, onlyAvailableSlots: o2, customerChoices: s2, timeSlotsPerDay: c2, limit: l2, cursor: u2 }) {
2017
- let d2 = await as({ serviceId: e2, fromLocalDate: t2, ...n2 ? { toLocalDate: n2 } : {}, ...r2 ? { timeZone: r2 } : {}, ...o2 ? { bookable: true } : {}, ...Jo(i2), ...Yo(a2), ...Zo(s2, a2), includeResourceTypeIds: [Ur], ...c2 == null ? {} : { timeSlotsPerDay: c2 }, cursorPaging: { limit: l2, ...u2 ? { cursor: u2 } : {} } });
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 us = 6;
2021
- var ds = 864e5;
2022
- function fs(e2) {
2023
- let t2 = e2 ? wo(e2) : new Date(Date.now()), n2 = new Date(t2.getFullYear(), t2.getMonth() + us + 1, 1), r2 = new Date(n2.getTime() - ds);
2024
- return { fromLocalDate: Eo(t2), toLocalDate: Do(r2) };
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 ps({ serviceId: e2, serviceType: t2, timeZone: n2, limit: r2, onlyAvailableSlots: i2 = true, fromDate: a2, locationId: o2, staffId: s2, customerChoices: c2, minRemainingCapacity: l2 }) {
2027
- let { fromLocalDate: u2, toLocalDate: d2 } = fs(a2);
2028
- if (Ja(t2) || Ya(t2)) {
2029
- let a3 = { ...Ya(t2) ? { type: `COURSE` } : {}, ...os(o2, s2, l2) }, c3 = await ss({ serviceIds: [e2], fromLocalDate: u2, toLocalDate: d2, ...n2 ? { timeZone: n2 } : {}, includeNonBookable: !i2, ...Object.keys(a3).length ? { eventFilter: a3 } : {}, ...r2 == null ? {} : { cursorPaging: { limit: r2 } } });
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 as({ serviceId: e2, fromLocalDate: u2, toLocalDate: d2, ...n2 ? { timeZone: n2 } : {}, ...i2 ? { bookable: true } : {}, ...Jo(o2), ...Yo(s2), ...Zo(c2, s2), includeResourceTypeIds: [Ur], ...r2 == null ? {} : { cursorPaging: { limit: r2 } } });
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 ms = 1e3;
2036
- async function hs({ serviceId: e2, serviceType: t2, date: n2, timeZone: r2, onlyAvailableSlots: i2, locationId: a2, staffId: o2, customerChoices: s2, minRemainingCapacity: c2, fromLocalDate: l2, toLocalDate: u2 }) {
2037
- let d2 = `${n2}T00:00:00`, f2 = `${n2}T23:59:59`, p2 = Ya(t2) ? `COURSE` : Ja(t2) ? `CLASS` : `APPOINTMENT`, m2 = [], h2 = null, g2;
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 cs({ 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: ms, cursor: g2 });
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 gs(e2) {
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 _s(e2) {
2048
- return e2?.options?.values?.[0]?.type === Ta.STAFF_MEMBER;
2058
+ function Ss(e2) {
2059
+ return e2?.options?.values?.[0]?.type === Ea.STAFF_MEMBER;
2049
2060
  }
2050
- function vs(e2) {
2061
+ function Cs(e2) {
2051
2062
  return e2.staffMemberDetails?.staffMembers ?? [];
2052
2063
  }
2053
- function ys(e2, t2) {
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 bs(e2, t2) {
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 xs(e2, t2) {
2062
- return t2 ? e2.filter((e3) => bs(e3, t2)) : e2;
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 Ss(e2, t2) {
2084
+ function ks(e2, t2) {
2065
2085
  if (t2.length === 0) return e2;
2066
- let n2 = e2.filter((e3) => xs(t2, e3.id).length > 0);
2086
+ let n2 = e2.filter((e3) => Es(t2, e3.id).length > 0);
2067
2087
  return n2.length > 0 ? n2 : e2;
2068
2088
  }
2069
- function Cs(e2) {
2070
- return vs(e2).map((e3) => ys(e3, null));
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 ws(e2) {
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 Ts(e2) {
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 Es = Pr(`@wix/site-service-warmup-data`);
2086
- function Ds() {
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 Os(e2) {
2120
+ function Ls(e2) {
2094
2121
  try {
2095
- return e2 ? e2(Es) : null;
2122
+ return e2 ? e2(Fs) : null;
2096
2123
  } catch {
2097
2124
  return null;
2098
2125
  }
2099
2126
  }
2100
- function ks() {
2101
- let e2 = Os(Ds()), t2 = typeof window > `u`;
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: xo.warmup, action: `read`, level: `warning`, contexts: { warmup: { key: n2 } } }), null;
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 As = `bookings-uou`;
2117
- function js() {
2118
- return `${As}:bookings-settings`;
2143
+ var zs = `bookings-uou`;
2144
+ function Bs() {
2145
+ return `${zs}:bookings-settings`;
2119
2146
  }
2120
- function Ms() {
2121
- return `${As}:time-slots-configuration`;
2147
+ function Vs() {
2148
+ return `${zs}:time-slots-configuration`;
2122
2149
  }
2123
- var Ns = 5e3;
2124
- var Ps = 100;
2125
- var Fs = `wix-warmup-data`;
2126
- var Is = null;
2127
- function Ls(e2) {
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(Fs)?.textContent;
2130
- return t2 ? (Is?.text !== t2 && (Is = { text: t2, data: JSON.parse(t2).builderComponentsWarmupData ?? {} }), Is.data[e2] ?? void 0) : void 0;
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 Rs = () => ({ promises: /* @__PURE__ */ new Map(), invalidatedWarmup: /* @__PURE__ */ new Set() });
2136
- var zs = Rs();
2137
- var Bs = /* @__PURE__ */ new WeakMap();
2138
- var Vs = /* @__PURE__ */ new WeakMap();
2139
- function Hs(e2) {
2140
- if (!e2) return zs;
2141
- let t2 = Bs.get(e2);
2142
- return t2 || (t2 = Rs(), Bs.set(e2, 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 Us({ key: e2, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
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 = Vs.get(i3);
2150
- a3 || (a3 = /* @__PURE__ */ new Map(), Vs.set(i3, a3));
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 = Hs(t2.scope), a2 = Date.now();
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 = Ls(e2);
2190
+ let t3 = Ks(e2);
2164
2191
  if (t3 !== void 0) {
2165
- let n3 = Ts(t3);
2166
- return i2.promises.set(e2, { promise: n3, expiresAt: a2 + Ns }), n3;
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 >= Ps && i2.promises.delete(i2.promises.keys().next().value);
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() + Ns;
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 Ws = { displayTimeZonePolicy: { basedOn: Ba.BUSINESS_TIME_ZONE, customerCanChange: false }, multiServiceAppointmentsEnabled: false };
2185
- async function Gs() {
2211
+ var $s = { displayTimeZonePolicy: { basedOn: Ha.BUSINESS_TIME_ZONE, customerCanChange: false }, multiServiceAppointmentsEnabled: false };
2212
+ async function ec() {
2186
2213
  try {
2187
- let e2 = await Ua();
2188
- return { displayTimeZonePolicy: { basedOn: e2.displayTimeZone?.basedOn ?? Ba.BUSINESS_TIME_ZONE, customerCanChange: e2.displayTimeZone?.customerCanChange ?? false }, multiServiceAppointmentsEnabled: e2.multiServiceAppointments?.enabled ?? false };
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: xo.bookingsSettings, action: `fetch-bookings-settings`, level: `warning` }), Ws;
2217
+ return $(e2, { feature: Q.bookingsSettings, action: `fetch-bookings-settings`, level: `warning` }), $s;
2191
2218
  }
2192
2219
  }
2193
- var Ks = { isLoading: true };
2194
- var qs = (0, import_react.createContext)(null);
2195
- var Js = `useBookingsSettingsContext must be used within BookingsSettingsProvider`;
2196
- function Ys() {
2197
- let e2 = (0, import_react.useContext)(qs);
2198
- if (!e2) throw Error(Js);
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 Xs(e2) {
2202
- return e2.basedOn === Ba.CUSTOMER_TIME_ZONE ? Intl.DateTimeFormat().resolvedOptions().timeZone : void 0;
2228
+ function ac(e2) {
2229
+ return e2.basedOn === Ha.CUSTOMER_TIME_ZONE ? Intl.DateTimeFormat().resolvedOptions().timeZone : void 0;
2203
2230
  }
2204
- function Zs() {
2205
- let e2 = Ys();
2206
- return e2.isLoading ? void 0 : Xs(e2.displayTimeZonePolicy);
2231
+ function oc() {
2232
+ let e2 = ic();
2233
+ return e2.isLoading ? void 0 : ac(e2.displayTimeZonePolicy);
2207
2234
  }
2208
- function Qs({ settingsPromise: e2, children: t2 }) {
2209
- let n2 = ws(e2), r2 = (0, import_react.useMemo)(() => ({ isLoading: false, ...n2 }), [n2]);
2210
- return (0, import_jsx_runtime.jsx)(qs.Provider, { value: r2, children: t2 });
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 $s({ bookingsSettings: e2, children: n2 }) {
2213
- let r2 = ks(), [i2] = (0, import_react.useState)(() => e2 ? null : Us({ key: js(), warmupData: r2, fetchData: Gs }));
2214
- return e2 ? (0, import_jsx_runtime.jsx)(qs.Provider, { value: { isLoading: false, ...e2 }, children: n2 }) : (0, import_jsx_runtime.jsx)(import_react.Suspense, { fallback: (0, import_jsx_runtime.jsx)(qs.Provider, { value: Ks, children: n2 }), children: (0, import_jsx_runtime.jsx)(Qs, { settingsPromise: i2, children: n2 }) });
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 ec = 1e3;
2217
- var tc = class extends import_react.Component {
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 nc = `appSectionParams`;
2230
- function rc(e2) {
2231
- let t2 = e2.searchParams.get(nc);
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(nc);
2235
- for (let [e3, r2] of Object.entries(ic(t2))) typeof r2 == `string` && !n2.searchParams.has(e3) && n2.searchParams.set(e3, r2);
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 ic(e2) {
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 ac = `bookings-uou:url-change`;
2247
- var oc = (e2) => {
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 sc(e2, { disableScrollToTop: t2, skipHistory: n2 } = {}) {
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 (oc(i2) === oc(e2)) return;
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(ac));
2293
+ r2.dispatchEvent(new Event(mc));
2267
2294
  }
2268
- function cc(e2) {
2295
+ function _c(e2) {
2269
2296
  let t2 = globalThis.window;
2270
- return t2 ? (t2.addEventListener(ac, e2), t2.addEventListener(`popstate`, e2), () => {
2271
- t2.removeEventListener(ac, e2), t2.removeEventListener(`popstate`, e2);
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 lc = (e2) => {
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 uc(e2, t2) {
2309
+ function yc(e2, t2) {
2283
2310
  let n2 = t2 ? new URL(t2).pathname : `/`;
2284
- return `./${lc(new URL(e2).pathname.replace(n2, ``).replace(/^\/|\/$/g, ``))}`;
2311
+ return `./${vc(new URL(e2).pathname.replace(n2, ``).replace(/^\/|\/$/g, ``))}`;
2285
2312
  }
2286
- function dc() {
2287
- let e2 = (0, import_services_manager_react.useService)(Rr), t2 = (0, import_react.useCallback)(() => e2.currentUrl, [e2]), n2 = (0, import_react.useSyncExternalStore)(cc, t2, t2), i2 = (0, import_react.useMemo)(() => rc(new URL(n2)), [n2]), a2 = e2.siteUrl.replace(/\/$/, ``);
2288
- return { pathname: i2.pathname, search: i2.search, searchParams: i2.searchParams, href: i2.href, getParsedUrl: () => rc(new URL(e2.currentUrl)), getRelativeUrl: () => uc(e2.currentUrl, a2), getExternalBaseUrl: () => a2, pushUrl: sc };
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 fc = Pr(`@wix/site-service-business-logger`);
2291
- function pc(e2) {
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 mc(e2) {
2321
+ function Cc(e2) {
2295
2322
  return { evid: 33, src: 16, endpoint: ``, params: e2 };
2296
2323
  }
2297
- function hc(e2) {
2324
+ function wc(e2) {
2298
2325
  return { evid: 34, src: 16, endpoint: ``, params: e2 };
2299
2326
  }
2300
- var gc = { 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` };
2301
- Wr.BOOK_ONLINE;
2302
- var _c = `new_bookings_server`;
2303
- var vc = { TIMEZONE_PICKER: `timezone_picker`, TIME_PICKER: `time_picker`, BOOKING_DETAILS: `booking_details`, RESCHEDULE_DIALOG: `reschedule_dialog` };
2304
- var yc = { DROPDOWN: `dropdown`, TIME_SLOT: `time_slot`, EXPAND: `expand`, COLLAPSE: `collapse` };
2305
- var bc = (e2) => {
2306
- let { reportBi: t2 } = (0, import_services_manager_react.useService)(fc);
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: _c, is_over_editor: false, ...n2.params, src: n2.src, evid: n2.evid }, { endpoint: n2.endpoint });
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 xc = (e2, t2 = true) => {
2312
- let n2 = bc(e2), { getParsedUrl: r2 } = dc(), i2 = (0, import_react.useRef)(false);
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(pc({ referralInfo: r2().searchParams.get(Xa.referral) ?? void 0 })));
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 Sc(e2) {
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 Cc(e2, t2) {
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 wc(e2, t2) {
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 - Cc(l2, t2);
2332
- return new Date(l2 - Cc(e3, t2));
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 Tc({ start: e2, end: t2, timeZone: n2, ...r2 }) {
2338
- let i2 = (e3) => e3 && n2 ? wc(e3, n2)?.getTime() : void 0;
2339
- return hc({ bookingsServiceId: r2.serviceId, serviceType: r2.serviceType, startTime: i2(e2), endTime: i2(t2), isEligibleForFlowCompletion: r2.isEligibleForFlowCompletion });
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 Ec({ nextAvailableSlotsCount: e2, isLoading: t2, hasError: n2, children: r2 }) {
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)(El.Provider, { value: a2, children: r2 });
2388
+ return (0, import_jsx_runtime.jsx)(Gl.Provider, { value: a2, children: r2 });
2358
2389
  }
2359
- function Dc({ nextAvailableSlotsCount: e2, children: t2 }) {
2360
- return (0, import_jsx_runtime.jsx)(Ec, { nextAvailableSlotsCount: e2, isLoading: true, hasError: false, children: t2 });
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 Oc({ nextAvailableSlotsCount: e2, children: t2 }) {
2363
- return (0, import_jsx_runtime.jsx)(Ec, { nextAvailableSlotsCount: e2, isLoading: false, hasError: true, children: t2 });
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 kc = 1e3;
2366
- function Ac(e2, t2) {
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 = Fo(e2);
2403
+ let r2 = [], i2 = Bo(e2);
2373
2404
  for (let t3 = 0; t3 < i2; t3 += 1) {
2374
- let i3 = Po(e2.startDate, t3);
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 jc(e2, t2) {
2380
- return { fromLocalDate: ko(e2.startDate, t2), toLocalDate: Do(wo(e2.endDate)) };
2410
+ function Hc(e2, t2) {
2411
+ return { fromLocalDate: Po(e2.startDate, t2), toLocalDate: Mo(ko(e2.endDate)) };
2381
2412
  }
2382
- async function Mc(e2, t2, n2, r2, i2, a2) {
2383
- return (await as({ serviceId: e2, ...jc(n2, t2), timeZone: t2, ...Jo(r2), ...Yo(i2), ...Zo(a2, i2), timeSlotsPerDay: 1, cursorPaging: { limit: Math.min(Fo(n2), kc) } })).timeSlots ?? [];
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 Nc(e2, t2, n2, r2, i2, a2) {
2386
- return (await ss({ serviceIds: [e2], ...jc(n2, t2), timeZone: t2, includeNonBookable: true, eventFilter: { type: `CLASS`, ...os(r2, i2, a2) }, maxSlotsPerDay: 1, cursorPaging: { limit: Math.min(Fo(n2), kc) } })).timeSlots;
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 Pc({ serviceId: e2, serviceType: t2, range: n2, fromDate: r2, timeZone: i2, locationId: a2, staffId: o2, customerChoices: s2, minRemainingCapacity: c2 }) {
2389
- if (Ya(t2) || n2.endDate < r2) return Ac(n2, []);
2390
- let l2 = { startDate: n2.startDate < r2 ? r2 : n2.startDate, endDate: n2.endDate }, u2 = Ja(t2) ? Vo(l2) : [l2];
2391
- return Ac(n2, (await Promise.all(u2.map((n3) => Ja(t2) ? Nc(e2, i2, n3, a2, o2, c2) : Mc(e2, i2, n3, a2, o2, s2)))).flat());
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 Fc({ serviceId: e2, staff: t2, customerChoices: n2 }) {
2424
+ function Kc({ serviceId: e2, staff: t2, customerChoices: n2 }) {
2394
2425
  let r2 = t2 && !t2.anyResource ? t2.staffMemberId : void 0;
2395
- return { serviceId: e2, ...Zo(n2, r2), ...t2?.anyResource ? {} : { includeResourceTypeIds: [Ur] }, ...r2 ? { resourceTypes: [{ resourceTypeId: Ur, resourceIds: [r2] }] } : {} };
2426
+ return { serviceId: e2, ...ns(n2, r2), ...t2?.anyResource ? {} : { includeResourceTypeIds: [Wr] }, ...r2 ? { resourceTypes: [{ resourceTypeId: Wr, resourceIds: [r2] }] } : {} };
2396
2427
  }
2397
- function Ic({ services: e2, locationId: t2, locationType: n2, timeZone: r2 }) {
2398
- return { services: e2.map(Fc), timeZone: r2, location: { ...t2 ? { _id: t2 } : {}, locationType: n2 } };
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 Lc(e2) {
2401
- let { customerChoices: t2, ...n2 } = e2, r2 = t2 ? Xo(t2) : void 0;
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 Rc(e2) {
2405
- let t2 = e2.services ?? [], n2 = () => wa({ ...e2, services: t2.map(Lc) }), r2 = t2.some((e3) => e3.customerChoices?.requestedGender);
2406
- if (r2 && ns()) return n2();
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 wa(e2);
2439
+ return await Ta(e2);
2409
2440
  } catch (e3) {
2410
- if (!r2 || !$o(e3)) throw e3;
2411
- return $(e3, { feature: xo.timeSlots, action: `requested-gender-rejected`, level: `warning` }), is(), n2();
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 zc = 1e3;
2415
- async function Bc({ range: e2, fromDate: t2, ...n2 }) {
2416
- if (e2.endDate < t2) return Ac(e2, []);
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 Ac(e2, (await Rc({ ...Ic(n2), fromLocalDate: ko(r2.startDate, n2.timeZone), toLocalDate: Do(wo(r2.endDate)), timeSlotsPerDay: 1, cursorPaging: { limit: Math.min(Fo(r2), zc) } })).timeSlots ?? []);
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 Vc({ date: e2, onlyAvailableSlots: t2, fromLocalDate: n2, ...r2 }) {
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 Rc({ ...Ic(r2), fromLocalDate: n2 && n2 > i2 ? n2 : i2, toLocalDate: `${e2}T23:59:59`, ...t2 ? { bookable: true } : {}, cursorPaging: { limit: zc, ...s2 ? { cursor: s2 } : {} } });
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 Hc({ fromDate: e2, ...t2 }) {
2429
- let n2 = await Rc({ ...Ic(t2), ...fs(e2), bookable: true, cursorPaging: { limit: 1 } });
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 Uc = [];
2433
- function Wc({ enabled: e2, serviceId: t2, serviceType: n2, multiServiceRequest: i2, timeZone: l2, today: u2, locationId: d2, staffId: f2, loadInitially: p2, customerChoices: m2, minRemainingCapacity: h2, onlyAvailableSlots: g2 }) {
2434
- let [_2, v2] = (0, import_react.useState)(null), [y2, b2] = (0, import_react.useState)(p2), [x2, S2] = (0, import_react.useState)(Uc), [C2, w2] = (0, import_react.useState)(false), [T2, ee2] = (0, import_react.useState)(false), E2 = (0, import_react.useRef)(0);
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(Io(u2));
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 && Ya(n2)) return;
2469
+ if (!y2 || !e2 || !(t2 || i2) || !l2 || !u2 || !_2 || !i2 && Za(n2)) return;
2439
2470
  let r2 = ++E2.current;
2440
- return w2(true), (i2 ? Bc({ ...i2, range: _2, fromDate: u2, timeZone: l2 }) : Pc({ serviceId: t2, serviceType: n2, range: _2, fromDate: u2, timeZone: l2, locationId: d2 ?? void 0, staffId: f2 ?? void 0, customerChoices: m2, minRemainingCapacity: h2 })).then((e3) => {
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: xo.timeSlots, action: `fetch-days-availability`, level: `warning` }), ee2(true), w2(false));
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
- No(e3) && (v2(e3), b2(true));
2480
+ Ro(e3) && (v2(e3), b2(true));
2450
2481
  }, []), O2 = (0, import_react.useCallback)(async () => {
2451
- v2((e3) => e3 && Ro(e3, 1)), b2(true);
2482
+ v2((e3) => e3 && Uo(e3, 1)), b2(true);
2452
2483
  }, []), te2 = (0, import_react.useCallback)(async () => {
2453
- v2((e3) => e3 && Ro(e3, -1)), b2(true);
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 Gc({ enabled: e2, serviceId: t2, serviceType: n2, multiServiceRequest: i2, timeZone: o2, today: l2, locationId: u2, staffId: d2, customerChoices: f2, minRemainingCapacity: p2, onlyAvailableSlots: m2, serviceLoading: h2 }) {
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 && Ya(n2)) {
2509
+ if (!i2 && Za(n2)) {
2479
2510
  _2(null);
2480
2511
  return;
2481
2512
  }
2482
- let r2 = Oo(new Date(Date.now()), o2), a2 = ++D2.current;
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 ? Vc({ ...i2, date: g2.date, timeZone: o2, onlyAvailableSlots: m2, fromLocalDate: s2 }) : hs({ 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) => {
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: xo.timeSlots, action: `fetch-day-time-slots`, level: `warning` }), C2(`timeSlotsLoadFailed`));
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 && Ya(n2) || !Mo(e3) || l2 && e3 < l2 || (k2(), y2((e4) => e4 + 1), _2({ kind: `day`, date: e3 }));
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 && Ya(n2) || !e2 || !r2 || !o2) return { outcome: `none` };
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 Hc({ ...i2, timeZone: o2, fromDate: e3 }) : await ps({ serviceId: t2, serviceType: n2, timeZone: o2, limit: 1, onlyAvailableSlots: true, fromDate: e3, locationId: u2 ?? void 0, staffId: d2 ?? void 0, customerChoices: f2, minRemainingCapacity: p2 });
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: xo.timeSlots, action: `find-next-available-date`, level: `warning` }), T2(`timeSlotsLoadFailed`), { outcome: `error` }) : { outcome: `cancelled` };
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
- function Kc(e2, t2) {
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 qc({ serviceId: e2, serviceType: t2, lastSessionEnd: n2, timeZone: r2, now: i2, onlyAvailableSlots: a2, locationId: o2, staffId: s2, timeSlotLimitPerDay: c2, customerChoices: l2, minRemainingCapacity: u2 }) {
2517
- let d2 = { serviceId: e2, onlyAvailableSlots: a2, locationId: o2 ?? void 0, staffId: s2 ?? void 0, timeZone: r2, fromLocalDate: Oo(new Date(i2), r2) };
2518
- return Ja(t2) ? { ...d2, serviceType: `CLASS`, minRemainingCapacity: u2 } : Ya(t2) ? !n2 || Kc(n2, i2) ? void 0 : { ...d2, serviceType: `COURSE`, toLocalDate: Oo(new Date(n2), r2) } : { ...d2, serviceType: `APPOINTMENT`, toLocalDate: fs().toLocalDate, timeSlotsPerDay: c2 + 1, customerChoices: l2 };
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 Jc({ isAppointment: e2, staffOnSlotCount: t2, hasStaffFilter: n2, hasRequestedGender: r2, hasStaffPricedVariants: i2, staffSelectionStrategy: a2 }) {
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 Yc(e2, t2) {
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 Xc(e2, t2, n2) {
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 Zc = { staff: null, requestedGender: null, locationId: null };
2530
- function Qc({ entry: e2, appointmentLike: t2, staffChoiceHidden: n2, staffPriced: r2, staffSelectionStrategy: i2, genderAllowed: a2, staffMemberIds: o2, locationIds: s2 }) {
2531
- if (!e2) return Zc;
2532
- let c2 = e2.locationId && s2.includes(e2.locationId) ? e2.locationId : null, l2 = t2 && !n2 ? no(e2) : null;
2533
- if (!l2) return { ...Zc, locationId: c2 };
2534
- if (!l2.anyResource) return o2.includes(l2.staffMemberId) ? { staff: l2, requestedGender: null, locationId: c2 } : { ...Zc, 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 } : { ...Zc, 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 $c = [];
2539
- function el({ sessions: e2, dayQuery: t2, daySlots: n2, staffFilter: r2, appointmentLike: i2, limitPerDay: a2, expandedDates: o2 }) {
2540
- let s2 = ll(ul(e2, r2)), c2 = n2 ? ul(i2 ? qo(n2) : n2, r2) : $c;
2541
- return { rows: t2 ? c2 : dl(s2, a2, o2), slotIdOf: t2 ? Wo : Ko, daysWithMore: cl(s2, a2, o2) };
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 tl({ rows: e2, slotIdOf: t2 }, n2) {
2544
- return [...e2.filter((e3) => t2(e3) === n2)].sort((e3, t3) => sl(t3) - sl(e3))[0] ?? null;
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 nl(e2, t2, n2, r2) {
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: ol(e2, t2), isAllDay: e2.allDay ?? false, staff: r2 ? [] : rl(e2) };
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 rl(e2) {
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 il(e2) {
2555
- let t2 = rl(e2);
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 al(e2) {
2559
- return rl(e2).map((e3) => e3.staffMemberId);
2637
+ function Tl(e2) {
2638
+ return Cl(e2).map((e3) => e3.staffMemberId);
2560
2639
  }
2561
- function ol(e2, t2) {
2640
+ function El(e2, t2) {
2562
2641
  if (!e2.localStartDate || !e2.localEndDate) return null;
2563
- let n2 = e2.allDay ? `UTC` : t2 ?? `UTC`, r2 = wc(e2.localStartDate, n2), i2 = wc(e2.localEndDate, n2);
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 sl(e2) {
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 cl(e2, t2, n2) {
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 ll(e2) {
2657
+ function kl(e2) {
2579
2658
  return e2.flatMap((e3) => {
2580
- let t2 = e3.availableResources?.find((e4) => e4.resourceTypeId === Ur), n2 = t2?.resources ?? [];
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 ul(e2, t2) {
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 dl(e2, t2, n2) {
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 fl() {
2675
+ async function Ml() {
2597
2676
  try {
2598
- return await Uo();
2677
+ return await Jo();
2599
2678
  } catch (e2) {
2600
- return $(e2, { feature: xo.timeSlots, action: `fetch-business-time-zone`, level: `warning` }), { businessTimeZone: null, staffSelectionStrategy: void 0, allowGenderSelection: false };
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 pl(e2) {
2604
- return Us({ key: Ms(), warmupData: e2, fetchData: fl });
2682
+ function Nl(e2) {
2683
+ return Qs({ key: Vs(), warmupData: e2, fetchData: Ml });
2605
2684
  }
2606
- function ml(e2) {
2685
+ function Pl(e2) {
2607
2686
  return (e2.localStartDate ?? ``).slice(0, 10);
2608
2687
  }
2609
- var hl = [];
2610
- function gl(e2, t2) {
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 cs({ 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 });
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: xo.sessions, action: `fetch-page` }), T2(e3 instanceof Error ? e3.message : `Failed to load sessions`);
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 hs({ serviceId: n2, serviceType: r2, date: e3, timeZone: l2, onlyAvailableSlots: f2, locationId: u2, staffId: d2, customerChoices: p2, minRemainingCapacity: m2, fromLocalDate: i2, toLocalDate: o2 });
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) => ml(t4) === e3), h3 = Math.max(0, s2.findIndex((t4) => t4.some((t5) => ml(t5) === e3)));
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) => ml(t5) !== e3);
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: xo.sessions, action: `fetch-day` }), T2(e4 instanceof Error ? e4.message : `Failed to load sessions`);
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] ?? hl].sort((e3, t3) => (e3.localStartDate ?? ``).localeCompare(t3.localStartDate ?? ``)), j2 = g2[b2], ie2 = j2 ? j2.length > 0 : v2[b2 - 1] != null, M2 = 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 _l = (e2) => e2?.onlineBooking?.enabled === true;
2682
- function vl(e2) {
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 bl = [];
2689
- var xl = [];
2690
- var Sl = sn.map((e2) => ({ id: e2, gender: e2 }));
2691
- var Cl = { isSelectionValidated: false };
2692
- var wl = () => {
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 Tl = async () => {
2770
+ var Wl = async () => {
2695
2771
  };
2696
- var El = (0, import_react.createContext)(null);
2697
- function Dl() {
2698
- let e2 = (0, import_react.useContext)(El);
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 Ol(e2, t2, n2) {
2778
+ function ql(e2, t2, n2) {
2703
2779
  e2 ? t2() : n2();
2704
2780
  }
2705
- var kl = { loginRequired: `rescheduleLoginRequired`, notFound: `rescheduleNotFound`, accessDenied: `rescheduleAccessDenied`, failed: `rescheduleNotFound`, wrongService: `rescheduleNotFound`, notReschedulable: `rescheduleNotReschedulable` };
2706
- function Al(e2 = 3) {
2707
- return Math.min(Math.max(e2, 1), ec);
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 jl(e2) {
2785
+ function Xl(e2) {
2710
2786
  let { isLoading: n2, bookingsSettingsLoading: r2 } = (0, import_service.useServiceContext)();
2711
- xc(gc.TIME_SLOTS, !n2 && !r2);
2712
- let i2 = ks(), [a2] = (0, import_react.useState)(() => pl(i2));
2713
- return (0, import_jsx_runtime.jsx)($s, { children: (0, import_jsx_runtime.jsx)(import_react.Suspense, { fallback: (0, import_jsx_runtime.jsx)(Dc, { nextAvailableSlotsCount: Al(e2.nextAvailableSlotsCount), children: e2.children }), children: (0, import_jsx_runtime.jsx)(Nl, { ...e2, configurationPromise: a2 }) }) });
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 Ml(e2) {
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 Nl({ onlyAvailableSlots: e2 = true, nextAvailableSlotsCount: t2 = 3, loadDaysAvailabilityInitially: n2 = false, timeSlotLimitPerDay: r2 = 100, configurationPromise: i2, children: o2 }) {
2720
- let s2 = Ys().isLoading, { searchParams: d2 } = dc(), { reschedule: f2 } = (0, import_service.useServiceContext)(), [m2] = (0, import_react.useState)(() => ({ locationId: d2.get(Xa.location), staffId: d2.get(Xa.resource), timeZone: (f2 ? void 0 : Nr(d2.get(Xa.blob))?.timezone) ?? d2.get(Xa.timezone) })), [h2, g2] = (0, import_react.useState)(m2.timeZone), _2 = Al(t2), [v2, y2] = (0, import_react.useState)(false);
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, x2 = ws(i2), S2 = (0, import_react.useSyncExternalStore)(rs, ns, () => false), { serviceId: C2 } = (0, import_service.useServiceContext)(), w2 = Ml(C2), T2 = Number.isFinite(r2) ? Math.max(1, Math.floor(r2)) : 100;
2723
- return (0, import_jsx_runtime.jsx)(tc, { fallback: (0, import_jsx_runtime.jsx)(Oc, { nextAvailableSlotsCount: _2, children: o2 }), feature: xo.timeSlots, children: (0, import_jsx_runtime.jsx)(Pl, { 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);
2724
- }
2725
- function Pl({ 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 }) {
2726
- 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 = xl, reschedule: se2 } = (0, import_service.useServiceContext)(), N2 = se2 != null, ce2 = N2 && se2.status !== `ready`, le2 = N2 && se2.status === `loading`, ue2 = N2 ? kl[se2.status] : void 0, de2 = ce2 ? null : se2?.booking ?? null, fe2 = de2 ? se2.validUntil : null, pe2 = vl(x2) && !_l(x2), P2 = pe2 || ce2 ? null : S2, me2 = dc(), he2 = N2 ? null : me2.searchParams.get(Xa.blob), F2 = (0, import_react.useMemo)(() => eo(Nr(he2)), [he2]), I2 = !S2 && !M2 && !ae2 && (F2.valid || F2.reason !== `too-few-services`), ge2 = I2 && F2.valid && oe2.some((e3) => !_l(e3) && F2.services.some((t3) => t3.serviceId === e3._id)), _e2 = pe2 || ge2, ve2 = I2 && F2.valid && !ge2 ? F2.requestKey : null, ye2 = (0, import_react.useMemo)(() => ve2 && F2.valid ? { services: F2.services, locationId: F2.locationId, locationType: F2.locationType } : null, [ve2]), be2 = !!P2 || ye2 !== null, xe2 = P2 || ve2, Se2 = i2 && !M2 && !ae2 && !be2 && !le2, Ce2 = Zs(), we2 = Ys(), { navigate: Te2, resolvePath: Ee2 } = fo(), [De2, Oe2] = (0, import_react.useState)(null), [ke2, Ae2] = (0, import_react.useState)(false), je2 = (0, import_react.useRef)([]), Me2 = (0, import_react.useRef)(false), Ne2 = (0, import_react.useCallback)(() => (Ae2(true), Me2.current ? Promise.resolve() : new Promise((e3) => {
2727
- je2.current.push(e3);
2728
- })), []), Pe2 = i2 ? Intl.DateTimeFormat().resolvedOptions().timeZone : null, Fe2 = Ka(x2), Ie2 = (0, import_react.useRef)(null), Le2 = no(te2), Re2 = (0, import_react.useRef)(Le2);
2729
- Re2.current = Le2;
2730
- let ze2 = Le2 && !Le2.anyResource ? Le2.staffMemberId : null, Be2 = te2.requestedGender ?? null, L2 = !Ja(C2) && !Ya(C2), Ve2 = L2 && !I2 && _s(ie2), R2 = I2 || L2 && _2 === `CUSTOMER_CANNOT_CHOOSE`, He2 = _2 !== void 0, Ue2 = Ho({ allowGenderSelection: v2, staffSelectionStrategy: _2 ?? null }) && L2 && !I2 && !Ve2, We2 = Ue2 && !y2, Ge2 = (0, import_react.useMemo)(() => P2 ? Nr(he2)?.services.find((e3) => e3.serviceId === P2) ?? null : null, [he2, P2]), Ke2 = (j2 ?? []).map((e3) => e3.staffMemberId).join(`,`), qe2 = Fe2.map((e3) => e3.id).join(`,`), Je2 = (0, import_react.useMemo)(() => Qc({ entry: Ge2, appointmentLike: L2, staffChoiceHidden: R2, staffPriced: Ve2, staffSelectionStrategy: _2, genderAllowed: We2, staffMemberIds: Ke2.split(`,`), locationIds: qe2.split(`,`) }), [Ge2, L2, R2, Ve2, _2, We2, Ke2, qe2]), z2 = Je2.staff, Ye2 = Je2.locationId, Xe2 = R2 || z2 !== null, [Ze2, Qe2] = (0, import_react.useState)(null), [$e2, et2] = (0, import_react.useState)(m2 !== null || N2), B2 = (0, import_react.useMemo)(() => x2 ? Cs(x2) : [], [x2]), tt2 = z2 && !z2.anyResource ? z2.staffMemberId : null, nt2 = (0, import_react.useMemo)(() => {
2731
- if (!tt2) return B2;
2732
- let e3 = B2.find((e4) => e4.staffMemberId === tt2);
2733
- return e3 ? [e3] : B2;
2734
- }, [B2, tt2]), rt2 = de2?.locationId ?? null, it2 = (0, import_react.useMemo)(() => {
2735
- let e3 = Ss(Fe2, nt2);
2736
- return !rt2 || e3.some((e4) => e4.id === rt2) ? e3 : Fe2.filter((t3) => t3.id === rt2 || e3.some((e4) => e4.id === t3.id));
2737
- }, [x2, nt2, rt2]), at2 = (e3) => !!e3 && it2.some((t3) => t3.id === e3), ot2 = Ze2 ?? ($e2 ? at2(rt2) ? rt2 : m2 : null), st2 = Fe2.length > 1 && it2.length === 1 ? it2[0].id : null, V2 = Ye2 ?? (at2(ot2) ? ot2 : st2), ct2 = (0, import_react.useMemo)(() => Ye2 ? [] : it2.map((e3) => ({ id: e3.id, name: e3.label })), [it2, Ye2]), lt2 = (0, import_react.useMemo)(() => new Map(B2.map((e3) => [e3.staffMemberId, e3.locationCoverage])), [B2]), ut2 = (0, import_react.useCallback)((e3, t3) => xs([{ staffMemberId: e3, locationCoverage: lt2.get(e3) }], t3).length === 1, [lt2]), dt2 = (0, import_react.useMemo)(() => Xe2 ? [] : (j2 ?? []).filter((e3) => e3.name).map((e3) => ({ id: e3.staffMemberId, name: e3.name ?? ``, gender: null })), [j2, Xe2]), ft2 = (0, import_react.useMemo)(() => V2 ? dt2.filter((e3) => ut2(e3.id, V2)) : dt2, [dt2, V2, ut2]), pt2 = L2 && !He2 ? bl : ft2, mt2 = L2 && !He2 ? 0 : dt2.length, ht2 = We2 && mt2 > 1, gt2 = (0, import_react.useMemo)(() => ht2 ? [...Sl, ...pt2] : pt2, [ht2, pt2]), [_t2, vt2] = (0, import_react.useState)(null), [yt2, bt2] = (0, import_react.useState)(h2 !== null);
2738
- yt2 && h2 !== null && V2 !== null && !ut2(h2, V2) && bt2(false);
2739
- let xt2 = _t2 ?? (yt2 ? h2 : null), H2 = z2 ? z2.anyResource ? null : z2.staffMemberId : xt2 !== null && ft2.some((e3) => e3.id === xt2) ? xt2 : null, St2 = Le2?.anyResource ? Be2 : null, [Ct2, wt2] = (0, import_react.useState)(St2), [Tt2, Et2] = (0, import_react.useState)(St2);
2740
- !y2 && Le2?.anyResource && Be2 !== Tt2 && (Et2(Be2), wt2(Be2));
2741
- let Dt2 = z2 ? Je2.requestedGender : Ue2 && mt2 > 1 && H2 === null ? Ct2 : null, Ot2 = y2 ? null : Dt2, kt2 = (0, import_react.useCallback)((e3) => {
2742
- Re2.current = e3, e3 ? e3.anyResource ? A2(Ot2 ?? void 0) : k2(e3.staffMemberId) : ne2();
2743
- }, [ne2, A2, k2, Ot2]), At2 = (0, import_react.useCallback)((e3) => kt2(e3 ? { anyResource: false, staffMemberId: e3 } : { anyResource: true }), [kt2]), jt2 = (de2?.addOnIds ?? []).filter((e3) => x2?.addOnGroups?.some((t3) => t3.addOnIds?.includes(e3))), Mt2 = de2 && Ja(C2) ? de2.participants : null, Nt2 = L2 ? Za(te2) : null, { addOnIds: Pt2, ...Ft2 } = Nt2 ?? {}, It2 = L2 && de2 ? jt2.length ? { ...Ft2, addOnIds: jt2 } : Ft2 : Nt2, Lt2 = It2 ? Xo(It2) : void 0, Rt2 = JSON.stringify(Dt2 ? { ...Lt2, requestedGender: { gender: Dt2 } } : Lt2 ?? null), zt2 = (0, import_react.useMemo)(() => JSON.parse(Rt2), [Rt2]), Bt2 = z2?.anyResource === true, Vt2 = (0, import_react.useCallback)((e3) => Bt2 || _2 !== void 0 && Jc({ isAppointment: L2, staffOnSlotCount: e3, hasStaffFilter: H2 !== null, hasRequestedGender: Ot2 !== null, hasStaffPricedVariants: Ve2, staffSelectionStrategy: _2 }), [Bt2, L2, _2, H2, Ot2, Ve2]), Ht2 = (0, import_react.useCallback)((e3) => z2 ?? (R2 ? null : e3), [z2, R2]), Ut2 = (0, import_react.useCallback)((e3) => {
2744
- let t3 = e3 === null ? null : gt2.find((t4) => t4.id === e3);
2745
- t3 !== void 0 && (bt2(false), vt2(t3 && !t3.gender ? t3.id : null), wt2(t3?.gender ?? null));
2746
- }, [gt2]), Wt2 = (0, import_react.useCallback)((e3) => {
2747
- (e3 === null || it2.some((t3) => t3.id === e3)) && (et2(false), Qe2(e3), xt2 !== null && e3 !== null && !ut2(xt2, e3) && (vt2(null), bt2(false)));
2748
- }, [it2, xt2, ut2]), Gt2 = !!(i2 && !we2.isLoading && we2.displayTimeZonePolicy.customerCanChange && g2 && Pe2 && g2 !== Pe2), U2 = i2 ? Gt2 && t2 && (t2 === g2 || t2 === Pe2) ? t2 : Ce2 ?? g2 ?? Pe2 : null, Kt2 = (0, import_react.useCallback)((e3) => {
2749
- Gt2 && (e3 === g2 || e3 === Pe2) && n2(e3);
2750
- }, [Gt2, g2, Pe2, n2]), qt2 = (0, import_react.useMemo)(() => i2 && !M2 && be2 ? Date.now() : void 0, [i2, M2, P2, ye2, U2]), Jt2 = qt2 !== void 0 && U2 ? To(new Date(qt2), U2) : null, { range: Yt2, daysAvailability: Xt2, isLoading: Zt2, hasError: Qt2, setRange: $t2, nextRange: en2, previousRange: tn2 } = Wc({ enabled: i2, serviceId: P2, serviceType: C2, multiServiceRequest: ye2, timeZone: U2, today: Jt2, locationId: V2, staffId: H2, customerChoices: zt2, minRemainingCapacity: Mt2, loadInitially: d2, onlyAvailableSlots: e2 }), nn2 = fe2?.slice(0, 10) ?? null, rn2 = (0, import_react.useMemo)(() => nn2 ? Xt2.map((e3) => e3.date > nn2 ? { ...e3, availability: `none` } : e3) : Xt2, [Xt2, nn2]), an2 = fe2 && U2 ? Oo(new Date(fe2), U2) : null, { query: W2, selectedDate: on2, timeSlots: sn2, isLoading: cn2, error: ln2, selectDate: un2, findNextAvailableDate: dn2 } = Gc({ enabled: i2, serviceId: P2, serviceType: C2, multiServiceRequest: ye2, timeZone: U2, today: Jt2, locationId: V2, staffId: H2, customerChoices: zt2, minRemainingCapacity: Mt2, onlyAvailableSlots: e2, serviceLoading: M2 }), fn2 = (0, import_react.useRef)(true), pn2 = (0, import_react.useRef)(null);
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 (fn2.current) {
2753
- fn2.current = false;
2830
+ if (pn2.current) {
2831
+ pn2.current = false;
2754
2832
  return;
2755
2833
  }
2756
- Oe2(null), Ie2.current && Ol(P2, T2, E2), Ie2.current = null, pn2.current = null;
2757
- }, [W2, ye2, U2, V2, H2, zt2, Mt2, e2, l2, f2, D2]);
2758
- let mn2 = (0, import_react.useCallback)(async () => {
2759
- let e3 = await dn2();
2760
- return e3.outcome === `found` ? nn2 && e3.date > nn2 ? `none` : (await Promise.all([un2(e3.date), Yt2 && zo(e3.date, Yt2) ? Promise.resolve() : $t2(Io(e3.date))]), `found`) : e3.outcome;
2761
- }, [dn2, nn2, un2, Yt2, $t2]), hn2 = !!(i2 && !M2 && be2 && U2 && Jt2), G2 = i2 && !M2 && !be2, [gn2, _n2] = (0, import_react.useState)(false), [vn2, yn2] = (0, import_react.useState)(0), bn2 = (0, import_react.useRef)(false), xn2 = (0, import_react.useRef)([]), Sn2 = (0, import_react.useRef)(0), Cn2 = (0, import_react.useCallback)(() => {
2762
- _n2(false);
2763
- let e3 = xn2.current;
2764
- return xn2.current = [], e3;
2765
- }, []), wn2 = (0, import_react.useCallback)(() => {
2766
- Sn2.current += 1, Cn2().forEach((e3) => e3(`cancelled`));
2767
- }, [Cn2]), Tn2 = (0, import_react.useCallback)((e3) => (wn2(), un2(e3)), [wn2, un2]), En2 = (0, import_react.useCallback)((e3) => {
2768
- let t3 = Sn2.current;
2769
- bn2.current = true, mn2().then((n3) => {
2770
- bn2.current = false, n3 === `cancelled` && t3 === Sn2.current ? (xn2.current.unshift(...e3), _n2(true)) : e3.forEach((e4) => e4(n3)), yn2((e4) => e4 + 1);
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
- }, [mn2]), Dn2 = (0, import_react.useCallback)(() => G2 ? Promise.resolve(`none`) : new Promise((e3) => {
2773
- if (hn2 && !bn2.current) {
2774
- En2([...Cn2(), e3]);
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
- xn2.current.push(e3), _n2(true);
2778
- }), [G2, hn2, En2, Cn2]);
2855
+ Sn2.current.push(e3), vn2(true);
2856
+ }), [W2, gn2, Dn2, wn2]);
2779
2857
  (0, import_react.useEffect)(() => {
2780
- if (gn2 && !bn2.current) {
2781
- if (G2) {
2782
- Cn2().forEach((e3) => e3(`none`));
2858
+ if (_n2 && !xn2.current) {
2859
+ if (W2) {
2860
+ wn2().forEach((e3) => e3(`none`));
2783
2861
  return;
2784
2862
  }
2785
- hn2 && En2(Cn2());
2863
+ gn2 && Dn2(wn2());
2786
2864
  }
2787
- }, [gn2, vn2, hn2, G2, En2, Cn2]);
2788
- let On2 = x2?.schedule?.lastSessionEnd, kn2 = L2 || Ja(C2) || Ya(C2) && !Kc(On2, qt2), An2 = !!(ke2 && i2 && !M2 && P2 && U2 && qt2 !== void 0), jn2 = An2 && P2 && U2 && qt2 !== void 0 ? qc({ serviceId: P2, serviceType: C2, lastSessionEnd: On2, timeZone: U2, now: qt2, onlyAvailableSlots: e2, locationId: V2, staffId: H2, timeSlotLimitPerDay: f2, customerChoices: zt2, minRemainingCapacity: Mt2 }) : void 0, K2 = gl(l2, jn2), Mn2 = ke2 && P2 && kn2 && !(ke2 && P2 && kn2 && (!i2 || M2)) && !U2, Nn2 = _e2 ? `onlineBookingOff` : ue2 ?? (K2.error === null ? Mn2 ? `timeZoneMissing` : null : `upcomingSlotsLoadFailed`), Pn2 = W2 !== null, Fn2 = (0, import_react.useMemo)(() => el({ sessions: K2.sessions, dayQuery: Pn2, daySlots: sn2, staffFilter: H2, appointmentLike: L2, limitPerDay: f2, expandedDates: K2.expandedDates }), [K2.sessions, Pn2, sn2, H2, L2, f2, K2.expandedDates]), { slotIdOf: In2 } = Fn2, Ln2 = ke2 && (jn2 ? K2.firstPageSettled : An2 || i2 && !M2 && !P2 || Mn2);
2789
- Me2.current = Ln2, (0, import_react.useEffect)(() => {
2790
- if (!Ln2) return;
2791
- let e3 = je2.current;
2792
- je2.current = [], e3.forEach((e4) => e4());
2793
- }, [Ln2]);
2794
- let Rn2 = ke2 && !Ln2 || K2.isLoadingPage, zn2 = Nn2 !== null, Bn2 = W2 ? cn2 : Rn2 || cn2 || !i2 || be2 && !U2 || gn2 || le2, Vn2 = W2 ? ln2 : ln2 ?? Nn2, Hn2 = W2 ? ln2 !== null : zn2 || ln2 !== null, q2 = bc(gc.TIME_SLOTS), Un2 = (0, import_react.useRef)(false), Wn2 = (0, import_react.useCallback)((e3, t3) => {
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
- pn2.current = null;
2874
+ mn2.current = null;
2797
2875
  return;
2798
2876
  }
2799
- if (e3 === pn2.current) return;
2800
- pn2.current = e3;
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
- !Un2.current && !N2 && q2(mc({ bookingsServiceId: n3, serviceType: r2, isEligibleForFlowCompletion: true })), Un2.current = true, q2(Sc({ component: vc.TIME_PICKER, element: yc.TIME_SLOT, properties: JSON.stringify({ selectedTime: t3.localStartDate }) }));
2803
- }, [q2, P2, C2, oe2, N2]), Gn2 = (0, import_react.useCallback)((e3) => {
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 = Ie2.current !== null;
2806
- Ie2.current = null, pn2.current = null, Oe2(null), e4 && Ol(P2, T2, E2);
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 = tl(Fn2, e3);
2887
+ let t3 = xl(In2, e3);
2810
2888
  if (!t3) return;
2811
- if (I2) {
2812
- if (!ee2(t3.nestedTimeSlots ?? [], U2 ?? void 0)) return;
2813
- Ie2.current = t3, Oe2(t3), Wn2(e3, t3);
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
- Ie2.current = t3, Oe2(t3), Wn2(e3, t3);
2817
- let n3 = al(t3);
2818
- if (w2(gs(t3), { staffId: L2 ? void 0 : il(t3), timezone: U2 ?? void 0, bookable: t3.bookable, staffChoiceRequired: L2 && He2 && !R2 && n3.length > 1 && !Vt2(n3.length), rescheduleStaffId: L2 && (_2 !== `CUSTOMER_MAY_CHOOSE` || !Vt2(n3.length)) ? n3[0] : void 0 }), !L2) return;
2819
- let r2 = Re2.current, i3;
2820
- i3 = z2 || (H2 && n3.includes(H2) ? { anyResource: false, staffMemberId: H2 } : Ot2 !== null && Vt2(n3.length) ? { anyResource: true } : Yc(n3, He2 && Vt2(n3.length))), yl(i3, Ot2) !== yl(r2, Be2) && kt2(i3);
2821
- }, [I2, P2, T2, E2, ee2, w2, Fn2, Wn2, U2, L2, He2, _2, Vt2, z2, H2, Ot2, Be2, kt2]), Kn2 = (0, import_react.useCallback)(() => {
2822
- let e3 = Ie2.current;
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 (I2) {
2825
- O2(q2);
2902
+ if (F2) {
2903
+ O2(K2);
2826
2904
  return;
2827
2905
  }
2828
2906
  if (!P2) return;
2829
2907
  let t3;
2830
- if (L2) {
2831
- let n4 = al(e3), r2 = Xc(n4, Ht2(Re2.current), Vt2(n4.length));
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 = Ee2(`bookingForm`, { slug: x2?.mainSlug?.name ?? null, serviceId: P2 });
2835
- e3.bookable && q2(Tc({ serviceId: P2, serviceType: C2 ?? void 0, start: e3.localStartDate, end: e3.localEndDate, timeZone: U2 ?? void 0, isEligibleForFlowCompletion: !!n3 })), n3 && Te2(re2(n3, { handoff: true, staffId: t3 }));
2836
- }, [q2, I2, O2, U2, P2, C2, x2, L2, Ht2, Vt2, Te2, Ee2, re2, N2]), qn2 = De2 ? al(De2) : null, Jn2 = qn2 ? I2 || !L2 || Xc(qn2, Ht2(Le2), Vt2(qn2.length)).isComplete : false, Yn2 = qn2 ? Vt2(qn2.length) : false, Xn2 = (0, import_react.useMemo)(() => !De2 || Xe2 ? [] : rl(De2).map((e3) => ({ staffMemberId: e3.staffMemberId, name: e3.name || null, image: null, isSelected: e3.staffMemberId === ze2 })), [De2, Xe2, ze2]), Zn2 = (0, import_react.useMemo)(() => ({ ...Cl, isMultiService: I2, hasValidSchedulingInput: be2, availabilityRequestKey: xe2, needsServiceChoice: Se2, isRescheduling: N2, rescheduleValidUntil: an2, businessTimeZone: g2, canChangeTimeZone: Gt2, setTimeZone: Kt2, locationFilterOptions: ct2, selectedLocationFilter: V2, setLocationFilter: Wt2, staffFilterOptions: gt2, selectedStaffFilter: H2, setStaffFilter: Ut2, requestedGender: Ot2, genderSelectionAllowed: We2, currentTimeSlotsPage: W2 ? 1 : K2.currentPage, hasNextTimeSlotsPage: !W2 && K2.hasNextPage, hasPreviousTimeSlotsPage: !W2 && K2.hasPreviousPage, nextTimeSlotsPage: W2 ? Tl : K2.nextPage, loadUpcomingTimeSlots: Ne2, upcomingTimeSlotsRequested: ke2, previousTimeSlotsPage: W2 ? wl : K2.previousPage, timeSlots: Fn2.rows.map((e3) => nl(e3, U2, In2, R2)), isLoading: Bn2, hasError: Hn2, errorCode: Vn2, selectedDate: on2, daysAvailabilityRange: Yt2, daysAvailability: rn2, daysAvailabilityLoading: Zt2, daysAvailabilityHasError: Qt2, timeSlotsLoading: Bn2, timeSlotsErrorCode: Vn2, selectDate: Tn2, setDaysAvailabilityRange: $t2, nextDaysAvailabilityRange: en2, previousDaysAvailabilityRange: tn2, goToNextAvailableDate: Dn2, nextAvailableSlotsCount: l2, timeZone: U2, staffFromSlots: Xn2, selectedResourceId: ze2, setSelectedResource: At2, canAutoAssignStaff: Yn2, isComplete: Jn2, selectedTimeSlot: De2 ? nl(De2, U2, In2, R2) : null, selectTimeSlot: Gn2, navigateToBookingForm: Kn2, timeSlotLimitPerDay: f2, expandedDates: K2.expandedDates, daysWithMore: Fn2.daysWithMore, loadingDate: K2.loadingDate, loadAllTimeSlotsForDay: K2.loadAllSessionsForDay }), [I2, be2, xe2, Se2, N2, an2, g2, U2, Gt2, Kt2, K2, Ne2, ke2, ct2, V2, Wt2, gt2, H2, Ut2, Ot2, We2, W2, Bn2, Vn2, Hn2, Fn2, on2, Yt2, rn2, Zt2, Qt2, Tn2, $t2, en2, tn2, Dn2, l2, Xn2, ze2, At2, Yn2, Jn2, De2, Gn2, Kn2, f2, In2, R2]);
2837
- return (0, import_jsx_runtime.jsx)(El.Provider, { value: Zn2, children: b2 });
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 Fl = on(`4936242d-905c-48bf-80ce-5f56d075de4f`);
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,