@wix/bookings 1.0.1776 → 1.0.1778

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/build/cjs/context-booking-checkout.d.ts +243 -108
  2. package/build/cjs/context-booking-checkout.js +177 -183
  3. package/build/cjs/context-booking-checkout.js.map +1 -1
  4. package/build/cjs/context-categories.d.ts +16 -143
  5. package/build/cjs/context-categories.js +412 -412
  6. package/build/cjs/context-categories.js.map +1 -1
  7. package/build/cjs/context-locations.d.ts +16 -287
  8. package/build/cjs/context-locations.js +336 -336
  9. package/build/cjs/context-locations.js.map +1 -1
  10. package/build/cjs/context-service-addons.d.ts +2 -2
  11. package/build/cjs/context-service-addons.js +1 -1
  12. package/build/cjs/context-service-addons.js.map +1 -1
  13. package/build/cjs/context-service.d.ts +71 -33
  14. package/build/cjs/context-service.js +98 -96
  15. package/build/cjs/context-service.js.map +1 -1
  16. package/build/cjs/context-services.js +1 -1
  17. package/build/cjs/context-services.js.map +1 -1
  18. package/build/cjs/context-time-slots.d.ts +10 -0
  19. package/build/cjs/context-time-slots.js +2 -2
  20. package/build/cjs/context-time-slots.js.map +1 -1
  21. package/build/es/context-booking-checkout.d.mts +243 -108
  22. package/build/es/context-booking-checkout.mjs +177 -180
  23. package/build/es/context-booking-checkout.mjs.map +1 -1
  24. package/build/es/context-categories.d.mts +16 -143
  25. package/build/es/context-categories.mjs +412 -412
  26. package/build/es/context-categories.mjs.map +1 -1
  27. package/build/es/context-locations.d.mts +16 -287
  28. package/build/es/context-locations.mjs +336 -336
  29. package/build/es/context-locations.mjs.map +1 -1
  30. package/build/es/context-service-addons.d.mts +2 -2
  31. package/build/es/context-service-addons.mjs +1 -1
  32. package/build/es/context-service-addons.mjs.map +1 -1
  33. package/build/es/context-service.d.mts +71 -33
  34. package/build/es/context-service.mjs +98 -96
  35. package/build/es/context-service.mjs.map +1 -1
  36. package/build/es/context-services.mjs +1 -1
  37. package/build/es/context-services.mjs.map +1 -1
  38. package/build/es/context-time-slots.d.mts +10 -0
  39. package/build/es/context-time-slots.mjs +2 -2
  40. package/build/es/context-time-slots.mjs.map +1 -1
  41. package/build/internal/cjs/context-booking-checkout.d.ts +243 -108
  42. package/build/internal/cjs/context-categories.d.ts +16 -143
  43. package/build/internal/cjs/context-locations.d.ts +16 -287
  44. package/build/internal/cjs/context-service-addons.d.ts +2 -2
  45. package/build/internal/cjs/context-service.d.ts +71 -33
  46. package/build/internal/cjs/context-time-slots.d.ts +10 -0
  47. package/build/internal/es/context-booking-checkout.d.mts +243 -108
  48. package/build/internal/es/context-categories.d.mts +16 -143
  49. package/build/internal/es/context-locations.d.mts +16 -287
  50. package/build/internal/es/context-service-addons.d.mts +2 -2
  51. package/build/internal/es/context-service.d.mts +71 -33
  52. package/build/internal/es/context-time-slots.d.mts +10 -0
  53. package/{_sdk-exports → context-runtime}/context-booking-checkout/runtime.d.ts +243 -108
  54. package/context-runtime/context-booking-checkout/runtime.js +3 -0
  55. package/{_sdk-exports → context-runtime}/context-categories/runtime.d.ts +16 -143
  56. package/context-runtime/context-categories/runtime.js +2 -0
  57. package/context-runtime/context-locations/runtime.d.ts +195 -0
  58. package/context-runtime/context-locations/runtime.js +2 -0
  59. package/{_sdk-exports → context-runtime}/context-service/runtime.d.ts +71 -33
  60. package/{_sdk-exports → context-runtime}/context-service/runtime.js +3 -3
  61. package/{_sdk-exports → context-runtime}/context-service-addons/runtime.d.ts +2 -2
  62. package/{_sdk-exports → context-runtime}/context-time-slots/runtime.d.ts +10 -0
  63. package/{_sdk-exports → context-runtime}/context-time-slots/runtime.js +2 -2
  64. package/package.json +8 -8
  65. package/_sdk-exports/context-booking-checkout/runtime.js +0 -3
  66. package/_sdk-exports/context-categories/runtime.js +0 -2
  67. package/_sdk-exports/context-locations/runtime.d.ts +0 -466
  68. package/_sdk-exports/context-locations/runtime.js +0 -2
  69. /package/{_sdk-exports → context-runtime}/context-service-addons/runtime.js +0 -0
  70. /package/{_sdk-exports → context-runtime}/context-services/runtime.d.ts +0 -0
  71. /package/{_sdk-exports → context-runtime}/context-services/runtime.js +0 -0
@@ -2696,62 +2696,94 @@ declare const SERVICE_CTA_STATES: {
2696
2696
  type ServiceCtaState = (typeof SERVICE_CTA_STATES)[keyof typeof SERVICE_CTA_STATES];
2697
2697
  //#endregion
2698
2698
  //#region ../bookings-flow-data/dist/types.d.ts
2699
- /** Whether the Booking Preferences hold one service or a Multi-Service Appointment. Derived,
2700
- * not chosen: the bookings-uou writer sets it from the service count on every encode (2+
2701
- * services is `multi`). Readers should count `services` rather than read it. */
2702
- type BookingMode = 'single' | 'multi';
2703
- /** A committed resource selection for one resource *type* (staff, room, equipment…).
2704
- * Carried as ids — the server accepts ids via `resourceSelections`, so the full resource
2705
- * object (name, schedule) is never needed in the contract.
2699
+ /**
2700
+ * Whether the selection holds 1 service or several services booked together. Supported values:
2701
+ * - `'single'`: 1 service.
2702
+ * - `'multi'`: 2 or more services, booked together as a multi-service appointment.
2706
2703
  *
2707
- * Not `bookings.ResourceSelection` (API shape is `resourceTypeId` + `selectionMethod`). */
2704
+ * It follows the number of entries in `services`, so count those instead of reading it.
2705
+ */
2706
+ type BookingMode = 'single' | 'multi';
2707
+ /** Resources the visitor chose for 1 resource type, such as a staff member or a room. */
2708
2708
  interface ResourceSelection {
2709
+ /** ID of the resource type, such as the staff member resource type. */
2709
2710
  type: string;
2711
+ /** IDs of the chosen resources of this type. */
2710
2712
  ids: string[];
2711
- /** The user picked "any available" rather than a specific resource of this type. */
2713
+ /** Whether the visitor chose any available resource of this type, instead of a specific one. */
2712
2714
  anyResource?: boolean;
2713
2715
  }
2714
- /** A chosen service variant (dynamic pricing): participant count and/or option choices. */
2716
+ /** A variant the visitor chose for a service with variants: a number of participants, option choices, or both. */
2715
2717
  type SelectedVariant = Pick<ServiceChoices, 'numberOfParticipants'> & {
2716
- /** Selected option values (wire carries string ids / custom values, not full `ServiceChoice` objects). */choices?: string[];
2718
+ /** The chosen option values: a choice ID, or the text of a custom choice. */choices?: string[];
2717
2719
  };
2718
2720
  /** Genders a visitor can narrow "any staff member" to, in display order. Same literals as the
2719
2721
  * availability API's `requestedGender.gender`, single- and multi-service alike. */
2720
2722
  declare const REQUESTED_GENDERS: readonly ["ANY_FEMALE", "ANY_MALE"];
2721
2723
  type RequestedGender = (typeof REQUESTED_GENDERS)[number];
2722
- /** A chosen add-on with its quantity — maps SDK `BookedAddOn` fields to flow names (`id` ↔ `_id`). */
2724
+ /** An add-on the visitor chose, with its quantity. */
2723
2725
  type AddOn = {
2724
- id: NonNullable<BookedAddOn['_id']>;
2726
+ /** ID of the add-on. */id: NonNullable<BookedAddOn['_id']>; /** Number of the add-on to book. */
2725
2727
  quantity: NonNullable<BookedAddOn['quantity']>;
2726
2728
  };
2727
- /** One service's committed selections. Slot/schedule fields align with `bookings.V2Slot`. */
2729
+ /** What the visitor chose for 1 service: the service, its time slot, and their choices. */
2728
2730
  type ServicePreference = {
2729
- serviceId: NonNullable<V2Slot['serviceId']>;
2731
+ /** ID of the service. */serviceId: NonNullable<V2Slot['serviceId']>; /** Slug of the service, as in its page URL. */
2730
2732
  slug?: NonNullable<Slug['name']>;
2731
- serviceType?: Service['type']; /** ISO local datetimes — per service (services in a bundle can start at different times). */
2732
- slotStart?: V2Slot['startDate'];
2733
- slotEnd?: V2Slot['endDate'];
2734
- eventId?: V2Slot['eventId'];
2735
- scheduleId?: V2Slot['scheduleId']; /** Needed to rehydrate class sessions in the OOI form. */
2736
- sessionId?: V2Slot['sessionId']; /** Id only — maps to `SlotLocation._id` / location refetch at the destination. */
2737
- locationId?: NonNullable<SlotLocation['_id']>; /** Availability naming (`BUSINESS` | `CUSTOM` | `CUSTOMER`); the booking step translates it to the bookings enum. */
2738
- locationType?: 'BUSINESS' | 'CUSTOM' | 'CUSTOMER';
2739
- resources?: ResourceSelection[];
2740
- selectedVariants?: SelectedVariant[];
2741
- addOns?: AddOn[]; /** The duration variant choice's id, sent to availability as `customerChoices.durationChoiceId`. */
2742
- durationChoiceId?: string;
2743
- /** A chosen duration in minutes, sent as `customerChoices.durationInMinutes`. With add-ons the
2744
- * API requires it to equal the service duration plus theirs, so writers usually omit it. */
2745
- durationInMinutes?: number; /** Narrows "any staff member" to a gender, sent as `customerChoices.requestedGender`. */
2733
+ /**
2734
+ * Type of the service. Supported values:
2735
+ * - `'APPOINTMENT'`: An appointment, booked by time slot.
2736
+ * - `'CLASS'`: A class session.
2737
+ * - `'COURSE'`: A course, booked as a whole by its schedule.
2738
+ */
2739
+ serviceType?: Service['type'];
2740
+ /**
2741
+ * Start of the time slot, as a local date and time without an offset, such as
2742
+ * `'2026-10-08T10:00:00'`. It's in the selection's `timezone`. Each service has its own, because
2743
+ * services booked together can start at different times. Absent for a course.
2744
+ */
2745
+ slotStart?: V2Slot['startDate']; /** End of the time slot, in the same format as `slotStart`. Absent for a course. */
2746
+ slotEnd?: V2Slot['endDate']; /** ID of the calendar event of a class session. */
2747
+ eventId?: V2Slot['eventId']; /** ID of the schedule the slot belongs to. For a course, the course's schedule. */
2748
+ scheduleId?: V2Slot['scheduleId']; /** ID of the class session. */
2749
+ sessionId?: V2Slot['sessionId']; /** ID of the business location of the slot. */
2750
+ locationId?: NonNullable<SlotLocation['_id']>;
2751
+ /**
2752
+ * Where the service takes place. Supported values:
2753
+ * - `'BUSINESS'`: At one of the business's locations, in `locationId`.
2754
+ * - `'CUSTOM'`: At an address the business set for the service.
2755
+ * - `'CUSTOMER'`: At the customer's address.
2756
+ */
2757
+ locationType?: 'BUSINESS' | 'CUSTOM' | 'CUSTOMER'; /** Resources the visitor chose, such as a staff member, by resource type. */
2758
+ resources?: ResourceSelection[]; /** Variants the visitor chose, for a service with variants. */
2759
+ selectedVariants?: SelectedVariant[]; /** Add-ons the visitor chose. */
2760
+ addOns?: AddOn[]; /** ID of the duration choice the visitor chose, for a service with a choice of durations. */
2761
+ durationChoiceId?: string; /** Duration the visitor chose, in minutes. */
2762
+ durationInMinutes?: number;
2763
+ /**
2764
+ * Gender the visitor asked for when they chose any available staff member. Supported values:
2765
+ * `'ANY_FEMALE'`, `'ANY_MALE'`.
2766
+ */
2746
2767
  requestedGender?: RequestedGender;
2747
2768
  };
2748
- /** One accumulating object; each destination builder projects the slice it needs. */
2769
+ /** What the visitor selected to book: the services, their time slots, and their choices. */
2749
2770
  interface BookingPreferences {
2771
+ /** Whether the selection holds 1 service or several. Count `services` instead of reading it. */
2750
2772
  mode: BookingMode;
2773
+ /**
2774
+ * Time zone of the slots' local dates and times, as an IANA name such as `'Europe/London'`.
2775
+ * Can be absent when the selection has no time slot, such as a course.
2776
+ */
2751
2777
  timezone?: V2Slot['timezone'];
2778
+ /** The selected services, in booking order. */
2752
2779
  services: ServicePreference[];
2753
- /** The visitor ticked "I have a coupon" in the Booking Summary, so checkout must not be skipped.
2754
- * Absent means unticked; writers omit `false`. */
2780
+ /**
2781
+ * Whether the visitor asked to enter a promo code, in the booking summary. When it's `true`, a
2782
+ * priced booking paid in person goes through the checkout page, where the visitor enters the
2783
+ * code.
2784
+ *
2785
+ * Default: `false`
2786
+ */
2755
2787
  wantsPromoCode?: boolean;
2756
2788
  }
2757
2789
  //#endregion
@@ -3943,6 +3975,12 @@ interface Reschedule {
3943
3975
  * couldn't be read.
3944
3976
  */
3945
3977
  validUntil: string | null;
3978
+ /**
3979
+ * Name of the plan that the booking was paid with, in the site's language when it's translated.
3980
+ *
3981
+ * `null` when the booking wasn't paid with a plan, or the plan couldn't be read.
3982
+ */
3983
+ planName: string | null;
3946
3984
  }
3947
3985
  //#endregion
3948
3986
  //#region src/api/adapters/booking/reschedule-booking.d.ts
@@ -1,4 +1,4 @@
1
- // _sdk-exports/context-service/runtime.js
1
+ // context-runtime/context-service/runtime.js
2
2
  import { Component as e, Suspense as t, createContext as n, startTransition as r, useCallback as i, useContext as a, useEffect as o, useMemo as s, useRef as c, useState as l, useSyncExternalStore as u } from "react";
3
3
  import { useGetService as d, useService as f } from "@wix/services-manager-react";
4
4
  import { jsx as p } from "react/jsx-runtime";
@@ -4720,7 +4720,7 @@ function Xh(e5) {
4720
4720
  }
4721
4721
  function Zh(e5) {
4722
4722
  let t2 = e5(Kh);
4723
- return { open: ({ slug: e6 }, n2) => t2.open({ slug: e6, context: n2 }), close: () => t2.close(), getContext: () => t2.getContext() };
4723
+ return { open: ({ slug: e6 }, n2) => t2.open({ slug: e6, payload: n2 }), close: () => t2.close(), getContext: () => t2.getPayload() };
4724
4724
  }
4725
4725
  function Qh() {
4726
4726
  let e5 = ds();
@@ -6002,7 +6002,7 @@ function ex({ bookingsSettings: e5, children: n2 }) {
6002
6002
  return e5 ? p(Kb.Provider, { value: { isLoading: false, ...e5 }, children: n2 }) : p(t, { fallback: p(Kb.Provider, { value: Gb, children: n2 }), children: p($b, { settingsPromise: i2, children: n2 }) });
6003
6003
  }
6004
6004
  function tx({ isLoading: e5, hasError: t2, bookingsSettingsLoading: n2, rescheduleRequest: r2 = null, editingSurface: i2 = false, children: a2 }) {
6005
- let o2 = r2 ? { status: `loading`, booking: null, validUntil: null } : null, s2 = { service: null, serviceName: null, serviceDescription: null, serviceTagLine: null, serviceDefaultDuration: null, serviceImage: null, serviceSlug: null, servicePageLink: null, serviceId: null, serviceType: null, servicePrice: Lh, isVariedService: false, serviceOptionsAndVariants: null, pricingOption: null, isLoadingServiceOptionsAndVariants: e5, hasAddOns: false, isConferenceEnabled: false, offeredDays: [], courseAvailability: null, courseStartDate: null, courseEndDate: null, staffMembers: [], coverImage: void 0, gallery: [], serviceLocations: [], policyDescription: null, serviceBookability: { state: vh.AVAILABLE, isAvailableForBooking: false, bookingOpensAt: null }, displayTimeZone: `UTC`, isAvailableForBooking: () => false, hasPolicyDescription: () => false, hasCoverImage: () => false, hasGalleryImages: () => false, isVariantDuration: () => false, isLoading: e5, hasError: t2, locale: `en-US`, selectStaffMember: () => {
6005
+ let o2 = r2 ? { status: `loading`, booking: null, validUntil: null, planName: null } : null, s2 = { service: null, serviceName: null, serviceDescription: null, serviceTagLine: null, serviceDefaultDuration: null, serviceImage: null, serviceSlug: null, servicePageLink: null, serviceId: null, serviceType: null, servicePrice: Lh, isVariedService: false, serviceOptionsAndVariants: null, pricingOption: null, isLoadingServiceOptionsAndVariants: e5, hasAddOns: false, isConferenceEnabled: false, offeredDays: [], courseAvailability: null, courseStartDate: null, courseEndDate: null, staffMembers: [], coverImage: void 0, gallery: [], serviceLocations: [], policyDescription: null, serviceBookability: { state: vh.AVAILABLE, isAvailableForBooking: false, bookingOpensAt: null }, displayTimeZone: `UTC`, isAvailableForBooking: () => false, hasPolicyDescription: () => false, hasCoverImage: () => false, hasGalleryImages: () => false, isVariantDuration: () => false, isLoading: e5, hasError: t2, locale: `en-US`, selectStaffMember: () => {
6006
6006
  }, clearSelection: () => {
6007
6007
  }, clearStaffMember: () => {
6008
6008
  }, selection: cv(``), selectionTimezone: void 0, setVariant: () => {
@@ -6017,7 +6017,7 @@ function tx({ isLoading: e5, hasError: t2, bookingsSettingsLoading: n2, reschedu
6017
6017
  }, navigateToMultiServiceForm: () => {
6018
6018
  }, resolveNextPageHref: () => null, isNavigating: false, editingSurface: i2, openPreferences: () => Promise.resolve(), multiServiceAppointmentsEnabled: false, isMultiServiceAppointment: false, multiServiceAppointmentServices: [], multiServiceAppointmentSelections: [], multiServiceAppointmentOptionsAndVariants: {}, multiServiceAppointmentVariantsStatus: `ready`, bookingsSettingsLoading: n2, reschedule: o2, rescheduleBooking: async () => ({ outcome: `failed` }), goHomeAfterReschedule: () => {
6019
6019
  }, canRescheduleToPick: false };
6020
- return p(Px.Provider, { value: s2, children: a2 });
6020
+ return p(Ix.Provider, { value: s2, children: a2 });
6021
6021
  }
6022
6022
  function nx({ rescheduleRequest: e5, editingSurface: t2, children: n2 }) {
6023
6023
  return p(Xb, { children: p(tx, { isLoading: true, hasError: false, bookingsSettingsLoading: true, rescheduleRequest: e5, editingSurface: t2, children: n2 }) });
@@ -6091,15 +6091,16 @@ function yx(e5) {
6091
6091
  async function bx({ booking: e5, slot: t2, token: n2 }) {
6092
6092
  return yx(n2 ? (await qf(n2, t2, { revision: e5.revision || `1` })).booking : (await Yf(e5.bookingId, t2, { revision: e5.revision ?? `` })).booking);
6093
6093
  }
6094
- async function xx(e5) {
6094
+ var xx = { validUntil: null, planName: null };
6095
+ async function Sx(e5) {
6095
6096
  try {
6096
- let t2 = (await Sc({ filter: { _id: e5 }, cursorPaging: { limit: 1 } }, { withEcomTransactions: true })).extendedBookings?.[0]?.transactions?.chargedMembershipPaymentDetails?.expirationDate;
6097
- return t2 ? new Date(t2).toISOString() : null;
6097
+ let t2 = (await Sc({ filter: { _id: e5 }, cursorPaging: { limit: 1 } }, { withEcomTransactions: true })).extendedBookings?.[0]?.transactions?.chargedMembershipPaymentDetails;
6098
+ return t2 ? { validUntil: t2.expirationDate ? new Date(t2.expirationDate).toISOString() : null, planName: t2.name?.translated || t2.name?.original || null } : xx;
6098
6099
  } catch (e6) {
6099
- return Jo(e6, { feature: Ko.reschedule, action: `fetch-plan-valid-until`, level: `warning` }), null;
6100
+ return Jo(e6, { feature: Ko.reschedule, action: `fetch-plan-valid-until`, level: `warning` }), xx;
6100
6101
  }
6101
6102
  }
6102
- function Sx() {
6103
+ function Cx() {
6103
6104
  let e5 = ds();
6104
6105
  return i(() => {
6105
6106
  if (!e5) return null;
@@ -6110,25 +6111,25 @@ function Sx() {
6110
6111
  }
6111
6112
  }, [e5]);
6112
6113
  }
6113
- var Cx = Zo(`@wix/viewer-service-site-members`);
6114
- function wx() {
6114
+ var wx = Zo(`@wix/viewer-service-site-members`);
6115
+ function Tx() {
6115
6116
  try {
6116
6117
  return d();
6117
6118
  } catch {
6118
6119
  return null;
6119
6120
  }
6120
6121
  }
6121
- function Tx(e5) {
6122
+ function Ex(e5) {
6122
6123
  try {
6123
- return e5 ? e5(Cx) : null;
6124
+ return e5 ? e5(wx) : null;
6124
6125
  } catch {
6125
6126
  return null;
6126
6127
  }
6127
6128
  }
6128
- function Ex() {
6129
- return Tx(wx());
6129
+ function Dx() {
6130
+ return Ex(Tx());
6130
6131
  }
6131
- function Dx(e5) {
6132
+ function Ox(e5) {
6132
6133
  if (!e5) return null;
6133
6134
  try {
6134
6135
  let t2 = new URL(e5);
@@ -6137,94 +6138,95 @@ function Dx(e5) {
6137
6138
  return null;
6138
6139
  }
6139
6140
  }
6140
- function Ox(e5, { bookable: t2, staffChoiceRequired: n2, timezone: r2, validUntil: i2 }) {
6141
+ function kx(e5, { bookable: t2, staffChoiceRequired: n2, timezone: r2, validUntil: i2 }) {
6141
6142
  if (!Nv(e5) || !t2) return false;
6142
6143
  let a2 = vv(e5);
6143
6144
  if (n2 && (!a2 || a2.anyResource)) return false;
6144
6145
  let o2 = e5.slotStart ? em(e5.slotStart, r2) : null;
6145
6146
  return !i2 || !o2 || o2.getTime() <= Date.parse(i2);
6146
6147
  }
6147
- var kx = { status: `loading`, booking: null, validUntil: null };
6148
- async function Ax(e5) {
6148
+ var Ax = { validUntil: null, planName: null };
6149
+ var jx = { status: `loading`, booking: null, ...Ax };
6150
+ async function Mx(e5) {
6149
6151
  return e5.getMemberDetails ? !!await e5.getMemberDetails().catch(() => null) : !!e5.isInitiallyLoggedIn;
6150
6152
  }
6151
- async function jx(e5, t2) {
6153
+ async function Nx(e5, t2) {
6152
6154
  let { bookingId: n2, token: r2 } = e5;
6153
- if (!r2 && !(t2 && await Ax(t2)) && !(t2 && await t2.promptLogin({ mode: `login` }).then(() => true, () => false))) return { status: `loginRequired`, booking: null, validUntil: null };
6155
+ if (!r2 && !(t2 && await Mx(t2)) && !(t2 && await t2.promptLogin({ mode: `login` }).then(() => true, () => false))) return { status: `loginRequired`, booking: null, ...Ax };
6154
6156
  try {
6155
- let [t3, i2] = await Promise.all([vx(e5), n2 && !r2 ? xx(n2) : null]);
6156
- return { status: `ready`, booking: t3, validUntil: i2 };
6157
+ let [t3, i2] = await Promise.all([vx(e5), n2 && !r2 ? Sx(n2) : Ax]);
6158
+ return { status: `ready`, booking: t3, validUntil: i2.validUntil, planName: i2.planName };
6157
6159
  } catch (e6) {
6158
- return Jo(e6, { feature: Ko.reschedule, action: `fetch-booking` }), { status: e6 instanceof fx ? e6.reason : `failed`, booking: null, validUntil: null };
6160
+ return Jo(e6, { feature: Ko.reschedule, action: `fetch-booking` }), { status: e6 instanceof fx ? e6.reason : `failed`, booking: null, ...Ax };
6159
6161
  }
6160
6162
  }
6161
- var Mx = /* @__PURE__ */ new Map();
6162
- function Nx(e5, t2, n2) {
6163
- let r2 = `${e5.bookingId ?? ``}|${e5.token ?? ``}`, i2 = Mx.get(r2) ?? { load: jx(e5, t2), users: 0 };
6164
- return i2.users += 1, Mx.set(r2, i2), i2.load.then(n2), () => {
6165
- --i2.users, i2.users === 0 && Mx.get(r2) === i2 && Mx.delete(r2);
6163
+ var Px = /* @__PURE__ */ new Map();
6164
+ function Fx(e5, t2, n2) {
6165
+ let r2 = `${e5.bookingId ?? ``}|${e5.token ?? ``}`, i2 = Px.get(r2) ?? { load: Nx(e5, t2), users: 0 };
6166
+ return i2.users += 1, Px.set(r2, i2), i2.load.then(n2), () => {
6167
+ --i2.users, i2.users === 0 && Px.get(r2) === i2 && Px.delete(r2);
6166
6168
  };
6167
6169
  }
6168
- var Px = n(null);
6169
- var Fx = `useServiceContext must be used within ServiceContextProvider`;
6170
- function Ix(e5 = false) {
6171
- let t2 = a(Px);
6172
- if (!t2 && !e5) throw Error(Fx);
6170
+ var Ix = n(null);
6171
+ var Lx = `useServiceContext must be used within ServiceContextProvider`;
6172
+ function Rx(e5 = false) {
6173
+ let t2 = a(Ix);
6174
+ if (!t2 && !e5) throw Error(Lx);
6173
6175
  return t2;
6174
6176
  }
6175
- function Lx(e5, t2, n2) {
6177
+ function zx(e5, t2, n2) {
6176
6178
  if (e5) return { by: `slug`, value: e5 };
6177
6179
  let r2 = t2?.services ?? [];
6178
6180
  return iv(t2) ? { by: `multi`, serviceIds: r2.map(({ serviceId: e6 }) => e6) } : r2.length === 1 ? { by: `id`, value: r2[0].serviceId } : n2 ? { by: `id`, value: n2 } : { by: `none` };
6179
6181
  }
6180
- var Rx = (e5) => void 0;
6181
- var zx = (e5, t2) => rv(t2.get(Rp.blob))?.services.find((t3) => t3.serviceId === e5);
6182
- var Bx = (e5, t2) => {
6183
- let n2 = zx(e5, t2) ?? cv(e5), r2 = Rx(e5);
6182
+ var Bx = (e5) => void 0;
6183
+ var Vx = (e5, t2) => rv(t2.get(Rp.blob))?.services.find((t3) => t3.serviceId === e5);
6184
+ var Hx = (e5, t2) => {
6185
+ let n2 = Vx(e5, t2) ?? cv(e5), r2 = Bx(e5);
6184
6186
  return r2 === void 0 ? n2 : yv(n2, r2);
6185
6187
  };
6186
- var Vx = (e5, t2) => {
6187
- let n2 = Bx(e5, t2), r2 = t2.get(Rp.resource), i2 = Rx(e5) !== void 0 || !!zx(e5, t2);
6188
+ var Ux = (e5, t2) => {
6189
+ let n2 = Hx(e5, t2), r2 = t2.get(Rp.resource), i2 = Bx(e5) !== void 0 || !!Vx(e5, t2);
6188
6190
  return r2 && !i2 ? yv(n2, r2) : n2;
6189
6191
  };
6190
- function Hx(e5, t2) {
6192
+ function Wx(e5, t2) {
6191
6193
  return !e5 || !t2 || !e5.services.every(Nv) ? null : fv(t2, e5);
6192
6194
  }
6193
- var Ux = [];
6194
- function Wx(e5) {
6195
+ var Gx = [];
6196
+ function Kx(e5) {
6195
6197
  return { min: 1, max: e5?.bookingPolicy?.participantsPolicy?.maxParticipantsPerBooking || 1 };
6196
6198
  }
6197
- function Gx(e5, { previous: t2, others: n2 }, { min: r2, max: i2 }) {
6199
+ function qx(e5, { previous: t2, others: n2 }, { min: r2, max: i2 }) {
6198
6200
  let a2 = Math.max(0, Math.floor(e5)), o2 = Math.max(t2, i2 - n2), s2 = Math.min(a2, o2);
6199
6201
  return s2 > 0 && n2 + s2 < r2 ? Math.min(r2 - n2, o2) : s2;
6200
6202
  }
6201
- function Kx({ serviceCtaState: e5, courseAvailability: t2, serviceBookability: n2 }) {
6203
+ function Jx({ serviceCtaState: e5, courseAvailability: t2, serviceBookability: n2 }) {
6202
6204
  return `${e5}|${t2?.totalCapacity ?? `-`}|${t2?.remainingCapacity ?? `-`}|${t2 === null}|${n2.state}|${n2.isAvailableForBooking}`;
6203
6205
  }
6204
- var qx = (e5) => ({ service: e5, hasError: false });
6205
- var Jx = () => ({ service: null, hasError: true });
6206
- var Yx = { service: null, hasError: false };
6207
- var Xx = (e5) => ({ ...Yx, isMultiServiceAppointment: true, multiServiceAppointmentServices: e5 });
6208
- var Zx = () => ({ ...Jx(), isMultiServiceAppointment: true });
6209
- var Qx = [];
6210
- var $x = [];
6211
- var eS = {};
6212
- function tS({ servicePromise: e5, refreshSignal: n2, injected: r2, rescheduleRequest: i2 = null, editingSurface: a2 = false, bookingsSettings: o2, children: s2 }) {
6213
- return p(t, { fallback: p(nx, { rescheduleRequest: i2, editingSurface: a2, children: s2 }), children: p(ex, { bookingsSettings: o2, children: p(Xo, { fallback: p(rx, { rescheduleRequest: i2, editingSurface: a2, children: s2 }), feature: Ko.service, children: p(aS, { servicePromise: e5, refreshSignal: n2, injected: r2, rescheduleRequest: i2, editingSurface: a2, children: s2 }) }) }) });
6214
- }
6215
- var nS = (e5) => e5 ?? void 0;
6216
- var rS = () => void 0;
6217
- function iS(e5, t2) {
6206
+ var Yx = (e5) => ({ service: e5, hasError: false });
6207
+ var Xx = () => ({ service: null, hasError: true });
6208
+ var Zx = { service: null, hasError: false };
6209
+ var Qx = (e5) => ({ ...Zx, isMultiServiceAppointment: true, multiServiceAppointmentServices: e5 });
6210
+ var $x = () => ({ ...Xx(), isMultiServiceAppointment: true });
6211
+ var eS = [];
6212
+ var tS = [];
6213
+ var nS = {};
6214
+ function rS({ servicePromise: e5, refreshSignal: n2, injected: r2, rescheduleRequest: i2 = null, editingSurface: a2 = false, bookingsSettings: o2, children: s2 }) {
6215
+ return p(t, { fallback: p(nx, { rescheduleRequest: i2, editingSurface: a2, children: s2 }), children: p(ex, { bookingsSettings: o2, children: p(Xo, { fallback: p(rx, { rescheduleRequest: i2, editingSurface: a2, children: s2 }), feature: Ko.service, children: p(sS, { servicePromise: e5, refreshSignal: n2, injected: r2, rescheduleRequest: i2, editingSurface: a2, children: s2 }) }) }) });
6216
+ }
6217
+ var iS = (e5) => e5 ?? void 0;
6218
+ var aS = () => void 0;
6219
+ function oS(e5, t2) {
6218
6220
  Jo(e5, { feature: Ko.service, action: `fetch-service-variants`, level: `warning`, contexts: { service: { serviceId: t2 } } });
6219
6221
  }
6220
- function aS({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, rescheduleRequest: a2 = null, editingSurface: u2 = false, children: d2 }) {
6221
- let f2 = n2 ? null : e5 ? ms(e5) : null, m2 = n2?.service ?? f2?.service ?? null, h2 = f2?.hasError ?? false, g2 = f2?.isMultiServiceAppointment ?? false, _2 = f2?.multiServiceAppointmentServices ?? Qx, v2 = Jv(), y2 = Xv(), { navigate: b2, navigateToHref: x2, resolvePath: ee2, toHref: S2, getBookingFormPath: C2 } = Bb(), w2 = Sx(), T2 = Jp(zp.SERVICE), { getParsedUrl: E2, pushUrl: te2, searchParams: ne2 } = cs(), D2 = c(E2);
6222
+ function sS({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, rescheduleRequest: a2 = null, editingSurface: u2 = false, children: d2 }) {
6223
+ let f2 = n2 ? null : e5 ? ms(e5) : null, m2 = n2?.service ?? f2?.service ?? null, h2 = f2?.hasError ?? false, g2 = f2?.isMultiServiceAppointment ?? false, _2 = f2?.multiServiceAppointmentServices ?? eS, v2 = Jv(), y2 = Xv(), { navigate: b2, navigateToHref: x2, resolvePath: ee2, toHref: S2, getBookingFormPath: C2 } = Bb(), w2 = Cx(), T2 = Jp(zp.SERVICE), { getParsedUrl: E2, pushUrl: te2, searchParams: ne2 } = cs(), D2 = c(E2);
6222
6224
  D2.current = E2;
6223
6225
  let re2 = c(te2);
6224
6226
  re2.current = te2;
6225
6227
  let O2 = ey(), k2 = c(O2);
6226
6228
  k2.current = O2;
6227
- let [A2, ie2] = l(kx), ae2 = Ex(), oe2 = (e6, t3) => a2 ? cv(e6) : Bx(e6, t3), se2 = c(oe2);
6229
+ let [A2, ie2] = l(jx), ae2 = Dx(), oe2 = (e6, t3) => a2 ? cv(e6) : Hx(e6, t3), se2 = c(oe2);
6228
6230
  se2.current = oe2;
6229
6231
  let [ce2, le2] = l(() => oe2(m2?._id ?? ``, E2().searchParams)), j2 = c(ce2), ue2 = c(void 0), de2 = c(true), fe2 = c(false), pe2 = c(null), [me2, he2] = l(null), ge2 = c(me2), [_e2, ve2] = l(0), M2 = m2?._id ?? null, ye2 = s(() => {
6230
6232
  if (!a2) return null;
@@ -6236,25 +6238,25 @@ function aS({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, reschedul
6236
6238
  if (!m2) return null;
6237
6239
  let e6 = ee2(`servicePage`, { slug: m2.mainSlug?.name ?? null, serviceId: m2._id ?? null });
6238
6240
  return e6 ? { href: S2(e6), target: `_self` } : null;
6239
- }, [m2, ee2, S2]), [Ce2, we2] = l(Ux), Te2 = n2 ? n2.masterEvents : Ce2, Ee2 = Qb(), De2 = Jb(), Oe2 = De2.isLoading, ke2 = !De2.isLoading && De2.multiServiceAppointmentsEnabled;
6241
+ }, [m2, ee2, S2]), [Ce2, we2] = l(Gx), Te2 = n2 ? n2.masterEvents : Ce2, Ee2 = Qb(), De2 = Jb(), Oe2 = De2.isLoading, ke2 = !De2.isLoading && De2.multiServiceAppointmentsEnabled;
6240
6242
  o(() => {
6241
6243
  if (!a2 || Oe2) return;
6242
- let e6 = false, t3 = Nx(a2, ae2, (t4) => {
6244
+ let e6 = false, t3 = Fx(a2, ae2, (t4) => {
6243
6245
  e6 || ie2(t4);
6244
6246
  });
6245
6247
  return () => {
6246
6248
  e6 = true, t3();
6247
6249
  };
6248
6250
  }, [a2, Oe2, ae2]);
6249
- let Ae2 = !n2 && !!m2 && _p(m2), je2 = Ae2 && M2 ? ay(y2, M2, t2) : null, Me2 = (typeof window > `u` && je2 && M2 && O2.scope && !Oe2 ? ms(_s(vy({ key: je2, warmupData: O2, fetchData: () => ym(M2).catch((e6) => (iS(e6, M2), null)) }), nS, rS)) : void 0) ?? (je2 ? fy(je2) : void 0), [Ne2, Pe2] = l(() => Me2 ?? null), [Fe2, Ie2] = l(() => Me2 ? je2 : null), Le2 = je2 !== null && Fe2 !== je2, Re2 = n2 ? n2.serviceOptionsAndVariants : Ae2 ? Ne2 : null;
6251
+ let Ae2 = !n2 && !!m2 && _p(m2), je2 = Ae2 && M2 ? ay(y2, M2, t2) : null, Me2 = (typeof window > `u` && je2 && M2 && O2.scope && !Oe2 ? ms(_s(vy({ key: je2, warmupData: O2, fetchData: () => ym(M2).catch((e6) => (oS(e6, M2), null)) }), iS, aS)) : void 0) ?? (je2 ? fy(je2) : void 0), [Ne2, Pe2] = l(() => Me2 ?? null), [Fe2, Ie2] = l(() => Me2 ? je2 : null), Le2 = je2 !== null && Fe2 !== je2, Re2 = n2 ? n2.serviceOptionsAndVariants : Ae2 ? Ne2 : null;
6250
6252
  o(() => {
6251
6253
  if (n2) return;
6252
6254
  let e6 = be2 && !mp(xe2) ? be2 : null;
6253
- if ((!e6 || Oe2) && we2((e7) => e7.length === 0 ? e7 : Ux), Oe2) return;
6255
+ if ((!e6 || Oe2) && we2((e7) => e7.length === 0 ? e7 : Gx), Oe2) return;
6254
6256
  let i2 = Ae2 ? M2 : null;
6255
6257
  if (!e6 && !i2) return;
6256
- let a3 = false, o2 = e6 ? _m([e6], Ee2).catch(() => Ux) : Promise.resolve(Ux), s2 = i2 ? vy({ key: ay(y2, i2, t2), warmupData: k2.current, fetchData: () => ym(i2) }).catch((e7) => {
6257
- iS(e7, i2);
6258
+ let a3 = false, o2 = e6 ? _m([e6], Ee2).catch(() => Gx) : Promise.resolve(Gx), s2 = i2 ? vy({ key: ay(y2, i2, t2), warmupData: k2.current, fetchData: () => ym(i2) }).catch((e7) => {
6259
+ oS(e7, i2);
6258
6260
  }) : Promise.resolve(void 0);
6259
6261
  return Promise.all([o2, s2]).then(([e7, t3]) => {
6260
6262
  a3 || r(() => {
@@ -6267,7 +6269,7 @@ function aS({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, reschedul
6267
6269
  let ze2 = a2 ? null : ne2.get(Rp.blob), Be2 = s(() => JSON.stringify([...new Set((rv(ze2)?.services ?? []).filter((e6) => Sv(e6).length > 0).map(({ serviceId: e6 }) => e6))].sort()), [ze2]), Ve2 = s(() => {
6268
6270
  let e6 = new Set(JSON.parse(Be2));
6269
6271
  return [...new Set(_2.filter(_p).flatMap(({ _id: t3 }) => t3 && e6.has(t3) ? [t3] : []))];
6270
- }, [_2, Be2]), He2 = s(() => ({ serviceIds: Ve2, refreshSignal: t2, language: y2 }), [Ve2, t2, y2]), [Ue2, We2] = l(null), N2 = Ue2?.request === He2 ? Ue2 : null, P2 = N2?.data ?? eS, F2 = Ve2.length === 0 ? `ready` : Oe2 || !N2 ? `loading` : N2.data && Ve2.every((e6) => N2.data?.[e6]) ? `ready` : `error`;
6272
+ }, [_2, Be2]), He2 = s(() => ({ serviceIds: Ve2, refreshSignal: t2, language: y2 }), [Ve2, t2, y2]), [Ue2, We2] = l(null), N2 = Ue2?.request === He2 ? Ue2 : null, P2 = N2?.data ?? nS, F2 = Ve2.length === 0 ? `ready` : Oe2 || !N2 ? `loading` : N2.data && Ve2.every((e6) => N2.data?.[e6]) ? `ready` : `error`;
6271
6273
  o(() => {
6272
6274
  let { serviceIds: e6, refreshSignal: t3, language: n3 } = He2;
6273
6275
  if (Oe2 || e6.length === 0) return;
@@ -6278,7 +6280,7 @@ function aS({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, reschedul
6278
6280
  i2 = true;
6279
6281
  };
6280
6282
  }, [Oe2, He2]);
6281
- let Ge2 = Hh({ service: m2, masterEvents: Te2, locale: v2, timeZone: Ee2, now: ty() }), Ke2 = Kx(Ge2), qe2 = s(() => Ge2, [m2, Te2, v2, Ee2, Ke2]), Je2 = c(null);
6283
+ let Ge2 = Hh({ service: m2, masterEvents: Te2, locale: v2, timeZone: Ee2, now: ty() }), Ke2 = Jx(Ge2), qe2 = s(() => Ge2, [m2, Te2, v2, Ee2, Ke2]), Je2 = c(null);
6282
6284
  o(() => {
6283
6285
  if (Je2.current !== null) {
6284
6286
  let e6 = se2.current(m2?._id ?? ``, D2.current().searchParams);
@@ -6300,20 +6302,20 @@ function aS({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, reschedul
6300
6302
  j2.current = t3, le2(t3);
6301
6303
  }, []), $e2 = i((e6) => {
6302
6304
  Qe2(e6);
6303
- let t3 = D2.current(), n3 = e6(Bx(M2 ?? ``, t3.searchParams)), r2 = ov(`${t3.pathname}${t3.search}${t3.hash}`, { currentUrl: t3, entries: [_v(n3, Xe2.current)], policy: `inPlace` }), i2 = new URL(r2, t3);
6305
+ let t3 = D2.current(), n3 = e6(Hx(M2 ?? ``, t3.searchParams)), r2 = ov(`${t3.pathname}${t3.search}${t3.hash}`, { currentUrl: t3, entries: [_v(n3, Xe2.current)], policy: `inPlace` }), i2 = new URL(r2, t3);
6304
6306
  Ye2.current = i2.searchParams.get(Rp.blob), re2.current(i2, { disableScrollToTop: true, skipHistory: true });
6305
6307
  }, [Qe2, M2]), et2 = rv(ze2)?.wantsPromoCode === true, I2 = i((e6) => {
6306
6308
  let t3 = D2.current(), n3 = rv(t3.searchParams.get(Rp.blob));
6307
6309
  if (!n3) return;
6308
6310
  let r2 = new URL(fv(`${t3.pathname}${t3.search}${t3.hash}`, hv(n3, e6)), t3);
6309
6311
  Ye2.current = r2.searchParams.get(Rp.blob), re2.current(r2, { disableScrollToTop: true, skipHistory: true });
6310
- }, []), L2 = Om(Re2), tt2 = i((e6, t3) => L2 ? Cv(e6, t3 ? [t3] : []) : e6, [L2]), R2 = i((e6) => Qe2((t3) => tt2(yv(t3, e6), e6)), [Qe2, tt2]), nt2 = i(() => Qe2((e6) => tt2(xv(e6), null)), [Qe2, tt2]), rt2 = i((e6) => Qe2((t3) => tt2(bv(t3, e6), null)), [Qe2, tt2]), it2 = i((e6) => $e2((t3) => Cv(t3, e6)), [$e2]), at2 = s(() => Wx(m2), [m2]), ot2 = s(() => km(Re2, { locale: v2, staffMembers: m2 ? Am(m2) : [], businessLocations: fp(m2) }), [Re2, v2, m2]), st2 = s(() => new Set(km(Re2, { locale: v2 })?.choices.flatMap((e6) => e6.choiceId ? [e6.choiceId] : []) ?? []), [Re2, v2]), ct2 = i((e6) => {
6312
+ }, []), L2 = Om(Re2), tt2 = i((e6, t3) => L2 ? Cv(e6, t3 ? [t3] : []) : e6, [L2]), R2 = i((e6) => Qe2((t3) => tt2(yv(t3, e6), e6)), [Qe2, tt2]), nt2 = i(() => Qe2((e6) => tt2(xv(e6), null)), [Qe2, tt2]), rt2 = i((e6) => Qe2((t3) => tt2(bv(t3, e6), null)), [Qe2, tt2]), it2 = i((e6) => $e2((t3) => Cv(t3, e6)), [$e2]), at2 = s(() => Kx(m2), [m2]), ot2 = s(() => km(Re2, { locale: v2, staffMembers: m2 ? Am(m2) : [], businessLocations: fp(m2) }), [Re2, v2, m2]), st2 = s(() => new Set(km(Re2, { locale: v2 })?.choices.flatMap((e6) => e6.choiceId ? [e6.choiceId] : []) ?? []), [Re2, v2]), ct2 = i((e6) => {
6311
6313
  let t3 = Object.entries(e6).filter(([e7, t4]) => st2.has(e7) && Number.isFinite(t4));
6312
6314
  if (!t3.length) return;
6313
6315
  let n3 = (e7) => {
6314
6316
  let n4 = Dv(e7, st2), r2 = ([e8, t4]) => t4 <= wv(n4, e8), i2 = [...t3.filter(r2), ...t3.filter((e8) => !r2(e8))];
6315
6317
  for (let [e8, t4] of i2) {
6316
- let r3 = wv(n4, e8), i3 = Gx(t4, { previous: r3, others: Tv(n4) - r3 }, at2);
6318
+ let r3 = wv(n4, e8), i3 = qx(t4, { previous: r3, others: Tv(n4) - r3 }, at2);
6317
6319
  i3 !== r3 && (n4 = Ev(n4, e8, i3));
6318
6320
  }
6319
6321
  return n4;
@@ -6338,7 +6340,7 @@ function aS({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, reschedul
6338
6340
  return n3 ? (ge2.current = n3, he2(n3), true) : false;
6339
6341
  }, []), mt2 = i((e6, t3) => pt2((n3) => Lv(n3, e6, t3, jp())), [pt2]), ht2 = i(() => {
6340
6342
  pt2(zv);
6341
- }, [pt2]), gt2 = qe2.serviceCtaState, _t2 = s(() => g2 ? (me2 ?? rv(ze2))?.services ?? $x : $x, [g2, me2, ze2]), vt2 = s(() => g2 ? Hx(me2 ?? rv(ze2), C2()) : null, [g2, me2, ze2, C2]), yt2 = i((e6) => {
6343
+ }, [pt2]), gt2 = qe2.serviceCtaState, _t2 = s(() => g2 ? (me2 ?? rv(ze2))?.services ?? tS : tS, [g2, me2, ze2]), vt2 = s(() => g2 ? Wx(me2 ?? rv(ze2), C2()) : null, [g2, me2, ze2, C2]), yt2 = i((e6) => {
6342
6344
  if (g2) return vt2 ? S2(vt2) : null;
6343
6345
  let t3 = jb({ actionState: gt2, serviceType: m2?.type ?? null, config: e6 ?? Ab });
6344
6346
  if (Mb(t3, m2?.type ?? null, ce2)) return null;
@@ -6356,9 +6358,9 @@ function aS({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, reschedul
6356
6358
  }, (e7) => {
6357
6359
  Jo(e7, { feature: Ko.serviceCta, action: `navigateToNextPage` }), wt2();
6358
6360
  });
6359
- }, [b2, wt2, S2]), Et2 = i(() => bt2.open(Jh(Hv({ service: m2, pricingOption: ot2 ?? void 0, selection: Vx(M2 ?? ``, D2.current().searchParams), multiServiceAppointmentsEnabled: ke2 }))), [bt2, m2, ot2, M2, ke2]), Dt2 = i((e6) => {
6361
+ }, [b2, wt2, S2]), Et2 = i(() => bt2.open(Jh(Hv({ service: m2, pricingOption: ot2 ?? void 0, selection: Ux(M2 ?? ``, D2.current().searchParams), multiServiceAppointmentsEnabled: ke2 }))), [bt2, m2, ot2, M2, ke2]), Dt2 = i((e6) => {
6360
6362
  if (Ct2.current) return;
6361
- let t3 = ge2.current ?? rv(D2.current().searchParams.get(Rp.blob)), n3 = Hx(t3, C2());
6363
+ let t3 = ge2.current ?? rv(D2.current().searchParams.get(Rp.blob)), n3 = Wx(t3, C2());
6362
6364
  if (n3) {
6363
6365
  for (let n4 of t3?.services ?? []) e6(tm({ serviceId: n4.serviceId, serviceType: n4.serviceType ?? _2.find(({ _id: e7 }) => e7 === n4.serviceId)?.type ?? void 0, start: n4.slotStart, end: n4.slotEnd, timeZone: t3?.timezone ?? void 0, isEligibleForFlowCompletion: true }));
6364
6366
  Tt2(n3);
@@ -6384,7 +6386,7 @@ function aS({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, reschedul
6384
6386
  At2.current = kt2;
6385
6387
  let jt2 = i(async () => {
6386
6388
  let e6 = ye2?.status === `ready` ? ye2.booking : null;
6387
- if (!ye2 || !a2 || !e6 || !Ox(j2.current, At2.current())) return { outcome: `failed` };
6389
+ if (!ye2 || !a2 || !e6 || !kx(j2.current, At2.current())) return { outcome: `failed` };
6388
6390
  T2(Qp({ component: Gp.RESCHEDULE_DIALOG, element: Kp.CONFIRM_BUTTON })), T2(Lp({ action: Wp, pageName: Kp.CONFIRM_BUTTON, referralInfo: D2.current().searchParams.get(Rp.referral) ?? void 0 }));
6389
6391
  let t3 = _v(j2.current, Xe2.current), n3;
6390
6392
  try {
@@ -6395,38 +6397,38 @@ function aS({ servicePromise: e5, refreshSignal: t2 = 0, injected: n2, reschedul
6395
6397
  T2(Zp({ bookingId: e6.bookingId }));
6396
6398
  let r2 = { outcome: `succeeded`, ...n3 };
6397
6399
  if (a2.fromManageBookingPage) return r2;
6398
- let i2 = Dx(a2.redirectUrl), o2 = i2 ? null : w2();
6400
+ let i2 = Ox(a2.redirectUrl), o2 = i2 ? null : w2();
6399
6401
  if (!i2 && !o2) return r2;
6400
6402
  try {
6401
6403
  return i2 ? await x2({ href: i2 }) : o2 && await b2(o2), { outcome: `navigated` };
6402
6404
  } catch (e7) {
6403
6405
  return Jo(e7, { feature: Ko.reschedule, action: `return-after-reschedule` }), r2;
6404
6406
  }
6405
- }, [ye2, a2, w2, b2, x2, T2]), Mt2 = Ox(ce2, kt2()), Nt2 = i(() => {
6407
+ }, [ye2, a2, w2, b2, x2, T2]), Mt2 = kx(ce2, kt2()), Nt2 = i(() => {
6406
6408
  T2(Lp({ component: Kp.GO_TO_HOMEPAGE_BUTTON, action: Wp, pageName: qp })), b2(`/`).catch((e6) => Jo(e6, { feature: Ko.reschedule, action: `go-home` }));
6407
6409
  }, [b2, T2]), { serviceBookability: Pt2, policyDescription: Ft2, coverImage: It2 } = qe2, Lt2 = i(() => Pt2.isAvailableForBooking, [Pt2]), Rt2 = i(() => !!Ft2, [Ft2]), zt2 = i(() => !!It2, [It2]), Bt2 = i(() => fh(m2), [m2]), Vt2 = i(() => !!m2 && Gh(m2), [m2]), Ht2 = s(() => ({ ...qe2, service: m2, servicePageLink: Se2, serviceOptionsAndVariants: Re2, pricingOption: ot2, isLoadingServiceOptionsAndVariants: Le2, isAvailableForBooking: Lt2, hasPolicyDescription: Rt2, hasCoverImage: zt2, hasGalleryImages: Bt2, isVariantDuration: Vt2, isLoading: false, hasError: h2, locale: v2, selectStaffMember: R2, clearSelection: rt2, clearStaffMember: nt2, selection: ce2, selectionTimezone: ue2.current ?? Ee2, setVariant: it2, setVariantCounts: ct2, maxParticipantsPerBooking: at2.max, toggleAddOn: lt2, setAddOnQuantity: ut2, setSlot: dt2, clearSlot: ft2, setMultiServiceSlot: mt2, clearMultiServiceSlot: ht2, draftRevision: _e2, wantsPromoCode: et2, setWantsPromoCode: I2, withSelectionParam: Ze2, navigateToNextPage: Ot2, navigateToMultiServiceForm: Dt2, resolveNextPageHref: yt2, isNavigating: xt2, editingSurface: u2, openPreferences: Et2, multiServiceAppointmentsEnabled: ke2, isMultiServiceAppointment: g2, multiServiceAppointmentServices: _2, multiServiceAppointmentSelections: _t2, multiServiceAppointmentOptionsAndVariants: P2, multiServiceAppointmentVariantsStatus: F2, bookingsSettingsLoading: Oe2, reschedule: ye2, rescheduleBooking: jt2, goHomeAfterReschedule: Nt2, canRescheduleToPick: Mt2 }), [qe2, m2, Se2, Re2, ot2, Le2, Lt2, Rt2, zt2, Bt2, Vt2, h2, v2, R2, rt2, nt2, ce2, Ee2, it2, ct2, at2.max, lt2, ut2, dt2, ft2, mt2, ht2, _e2, et2, I2, Ze2, Ot2, Dt2, yt2, xt2, u2, Et2, ke2, g2, _2, _t2, P2, F2, Oe2, ye2, jt2, Nt2, Mt2]);
6408
- return p(Px.Provider, { value: Ht2, children: d2 });
6410
+ return p(Ix.Provider, { value: Ht2, children: d2 });
6409
6411
  }
6410
- function oS({ routerSlug: e5, initialServiceId: t2, refreshSignal: n2, editingSurface: r2, children: i2 }) {
6412
+ function cS({ routerSlug: e5, initialServiceId: t2, refreshSignal: n2, editingSurface: r2, children: i2 }) {
6411
6413
  Yp(zp.SERVICE);
6412
6414
  let a2 = ey(), o2 = Xv(), { getParsedUrl: s2 } = cs(), [c2] = l(() => r2 ? null : ux(s2().searchParams)), [u2] = l(() => {
6413
- let r3 = Lx(e5, c2 ? null : Hb(s2().searchParams), t2);
6414
- return r3.by === `none` ? hs(Yx) : r3.by === `multi` ? _s(vy({ key: iy(o2, r3.serviceIds), refresh: n2 !== 0, warmupData: a2, fetchData: () => Yo(`service-context-load-multi-service`, { feature: Ko.service }, wp(r3.serviceIds)) }), Xx, Zx) : _s(vy({ key: ry(o2, r3.by, r3.value), refresh: n2 !== 0, warmupData: a2, fetchData: () => Yo(`service-context-load`, { feature: Ko.service }, r3.by === `slug` ? Sp(r3.value) : Cp(r3.value)) }), qx, Jx);
6415
+ let r3 = zx(e5, c2 ? null : Hb(s2().searchParams), t2);
6416
+ return r3.by === `none` ? hs(Zx) : r3.by === `multi` ? _s(vy({ key: iy(o2, r3.serviceIds), refresh: n2 !== 0, warmupData: a2, fetchData: () => Yo(`service-context-load-multi-service`, { feature: Ko.service }, wp(r3.serviceIds)) }), Qx, $x) : _s(vy({ key: ry(o2, r3.by, r3.value), refresh: n2 !== 0, warmupData: a2, fetchData: () => Yo(`service-context-load`, { feature: Ko.service }, r3.by === `slug` ? Sp(r3.value) : Cp(r3.value)) }), Yx, Xx);
6415
6417
  });
6416
- return p(tS, { servicePromise: u2, refreshSignal: n2, rescheduleRequest: c2, editingSurface: r2, children: i2 });
6418
+ return p(rS, { servicePromise: u2, refreshSignal: n2, rescheduleRequest: c2, editingSurface: r2, children: i2 });
6417
6419
  }
6418
- function sS({ serviceData: e5, servicePicker: t2, refreshSignal: n2 = 0, editingSurface: r2 = false, children: i2 }) {
6419
- let { pathname: a2 } = cs(), o2 = ps(), c2 = Xv(), l2 = t2?.serviceId?.$eq, u2 = e5?.service ?? null, d2 = s(() => u2 ? { service: u2, masterEvents: e5?.masterEvents ?? Ux, serviceOptionsAndVariants: e5?.serviceOptionsAndVariants ?? null, bookingsSettings: e5?.bookingsSettings } : null, [u2, e5?.masterEvents, e5?.serviceOptionsAndVariants, e5?.bookingsSettings]);
6420
- return d2 ? p(tS, { injected: d2, bookingsSettings: d2.bookingsSettings, editingSurface: r2, children: i2 }, `injected:${n2}`) : e5 ? p(tS, { bookingsSettings: e5.bookingsSettings, editingSurface: r2, children: i2 }) : p(oS, { routerSlug: o2, initialServiceId: l2, refreshSignal: n2, editingSurface: r2, children: i2 }, `fetch:${a2}:${o2 ?? ``}:${l2 ?? ``}:${n2}:${r2}:${c2}`);
6420
+ function lS({ serviceData: e5, servicePicker: t2, refreshSignal: n2 = 0, editingSurface: r2 = false, children: i2 }) {
6421
+ let { pathname: a2 } = cs(), o2 = ps(), c2 = Xv(), l2 = t2?.serviceId?.$eq, u2 = e5?.service ?? null, d2 = s(() => u2 ? { service: u2, masterEvents: e5?.masterEvents ?? Gx, serviceOptionsAndVariants: e5?.serviceOptionsAndVariants ?? null, bookingsSettings: e5?.bookingsSettings } : null, [u2, e5?.masterEvents, e5?.serviceOptionsAndVariants, e5?.bookingsSettings]);
6422
+ return d2 ? p(rS, { injected: d2, bookingsSettings: d2.bookingsSettings, editingSurface: r2, children: i2 }, `injected:${n2}`) : e5 ? p(rS, { bookingsSettings: e5.bookingsSettings, editingSurface: r2, children: i2 }) : p(cS, { routerSlug: o2, initialServiceId: l2, refreshSignal: n2, editingSurface: r2, children: i2 }, `fetch:${a2}:${o2 ?? ``}:${l2 ?? ``}:${n2}:${r2}:${c2}`);
6421
6423
  }
6422
- var cS = ma(`426941a1-1d08-4cf4-ae61-e433e800cde5`);
6424
+ var uS = ma(`426941a1-1d08-4cf4-ae61-e433e800cde5`);
6423
6425
  export {
6424
- Fx as SERVICE_CONTEXT_MISSING_PROVIDER_ERROR,
6425
- sS as ServiceContextProvider,
6426
- sS as default,
6427
- cS as injectAccessTokenGetter,
6428
- Lx as resolveServiceTarget,
6429
- Px as serviceContext,
6430
- Ix as useServiceContext
6426
+ Lx as SERVICE_CONTEXT_MISSING_PROVIDER_ERROR,
6427
+ lS as ServiceContextProvider,
6428
+ lS as default,
6429
+ uS as injectAccessTokenGetter,
6430
+ zx as resolveServiceTarget,
6431
+ Ix as serviceContext,
6432
+ Rx as useServiceContext
6431
6433
  };
6432
6434
  //# sourceMappingURL=context-service.mjs.map