@wix/bookings 1.0.1740 → 1.0.1742

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 (78) hide show
  1. package/_sdk-exports/context-booking-checkout-context/runtime.d.ts +2784 -0
  2. package/_sdk-exports/context-booking-checkout-context/runtime.js +2 -0
  3. package/_sdk-exports/context-categories-context/runtime.d.ts +144 -0
  4. package/_sdk-exports/context-categories-context/runtime.js +1 -0
  5. package/_sdk-exports/context-locations-context/runtime.d.ts +282 -0
  6. package/_sdk-exports/context-locations-context/runtime.js +1 -0
  7. package/_sdk-exports/context-service-addons-context/runtime.d.ts +264 -0
  8. package/_sdk-exports/context-service-addons-context/runtime.js +1 -0
  9. package/_sdk-exports/context-service-context/runtime.d.ts +3667 -0
  10. package/_sdk-exports/context-service-context/runtime.js +2 -0
  11. package/_sdk-exports/context-services-context/runtime.d.ts +2863 -0
  12. package/_sdk-exports/context-services-context/runtime.js +2 -0
  13. package/_sdk-exports/context-time-slots-context/runtime.d.ts +660 -0
  14. package/_sdk-exports/context-time-slots-context/runtime.js +2 -0
  15. package/build/cjs/context-booking-checkout-context.d.ts +2784 -0
  16. package/build/cjs/context-booking-checkout-context.js +3940 -0
  17. package/build/cjs/context-booking-checkout-context.js.map +1 -0
  18. package/build/cjs/context-categories-context.d.ts +144 -0
  19. package/build/cjs/context-categories-context.js +1188 -0
  20. package/build/cjs/context-categories-context.js.map +1 -0
  21. package/build/cjs/context-locations-context.d.ts +282 -0
  22. package/build/cjs/context-locations-context.js +1252 -0
  23. package/build/cjs/context-locations-context.js.map +1 -0
  24. package/build/cjs/context-service-addons-context.d.ts +264 -0
  25. package/build/cjs/context-service-addons-context.js +1324 -0
  26. package/build/cjs/context-service-addons-context.js.map +1 -0
  27. package/build/cjs/context-service-context.d.ts +3667 -0
  28. package/build/cjs/context-service-context.js +5330 -0
  29. package/build/cjs/context-service-context.js.map +1 -0
  30. package/build/cjs/context-services-context.d.ts +2863 -0
  31. package/build/cjs/context-services-context.js +2203 -0
  32. package/build/cjs/context-services-context.js.map +1 -0
  33. package/build/cjs/context-time-slots-context.d.ts +660 -0
  34. package/build/cjs/context-time-slots-context.js +2822 -0
  35. package/build/cjs/context-time-slots-context.js.map +1 -0
  36. package/build/es/context-booking-checkout-context.d.mts +2784 -0
  37. package/build/es/context-booking-checkout-context.mjs +3898 -0
  38. package/build/es/context-booking-checkout-context.mjs.map +1 -0
  39. package/build/es/context-categories-context.d.mts +144 -0
  40. package/build/es/context-categories-context.mjs +1157 -0
  41. package/build/es/context-categories-context.mjs.map +1 -0
  42. package/build/es/context-locations-context.d.mts +282 -0
  43. package/build/es/context-locations-context.mjs +1221 -0
  44. package/build/es/context-locations-context.mjs.map +1 -0
  45. package/build/es/context-service-addons-context.d.mts +264 -0
  46. package/build/es/context-service-addons-context.mjs +1294 -0
  47. package/build/es/context-service-addons-context.mjs.map +1 -0
  48. package/build/es/context-service-context.d.mts +3667 -0
  49. package/build/es/context-service-context.mjs +5298 -0
  50. package/build/es/context-service-context.mjs.map +1 -0
  51. package/build/es/context-services-context.d.mts +2863 -0
  52. package/build/es/context-services-context.mjs +2172 -0
  53. package/build/es/context-services-context.mjs.map +1 -0
  54. package/build/es/context-time-slots-context.d.mts +660 -0
  55. package/build/es/context-time-slots-context.mjs +2792 -0
  56. package/build/es/context-time-slots-context.mjs.map +1 -0
  57. package/build/internal/cjs/context-booking-checkout-context.d.ts +2784 -0
  58. package/build/internal/cjs/context-categories-context.d.ts +144 -0
  59. package/build/internal/cjs/context-locations-context.d.ts +282 -0
  60. package/build/internal/cjs/context-service-addons-context.d.ts +264 -0
  61. package/build/internal/cjs/context-service-context.d.ts +3667 -0
  62. package/build/internal/cjs/context-services-context.d.ts +2863 -0
  63. package/build/internal/cjs/context-time-slots-context.d.ts +660 -0
  64. package/build/internal/es/context-booking-checkout-context.d.mts +2784 -0
  65. package/build/internal/es/context-categories-context.d.mts +144 -0
  66. package/build/internal/es/context-locations-context.d.mts +282 -0
  67. package/build/internal/es/context-service-addons-context.d.mts +264 -0
  68. package/build/internal/es/context-service-context.d.mts +3667 -0
  69. package/build/internal/es/context-services-context.d.mts +2863 -0
  70. package/build/internal/es/context-time-slots-context.d.mts +660 -0
  71. package/context/booking-checkout-context/package.json +3 -0
  72. package/context/categories-context/package.json +3 -0
  73. package/context/locations-context/package.json +3 -0
  74. package/context/service-addons-context/package.json +3 -0
  75. package/context/service-context/package.json +3 -0
  76. package/context/services-context/package.json +3 -0
  77. package/context/time-slots-context/package.json +3 -0
  78. package/package.json +69 -8
@@ -0,0 +1,660 @@
1
+ import React, { ReactNode } from "react";
2
+
3
+ //#region ../../node_modules/type-fest/source/observable-like.d.ts
4
+ declare global {
5
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
6
+ interface SymbolConstructor {
7
+ readonly observable: symbol;
8
+ }
9
+ }
10
+ /**
11
+ @remarks
12
+ The TC39 observable proposal defines a `closed` property, but some implementations (such as xstream) do not as of 10/08/2021.
13
+ As well, some guidance on making an `Observable` to not include `closed` property.
14
+ @see https://github.com/tc39/proposal-observable/blob/master/src/Observable.js#L129-L130
15
+ @see https://github.com/staltz/xstream/blob/6c22580c1d84d69773ee4b0905df44ad464955b3/src/index.ts#L79-L85
16
+ @see https://github.com/benlesh/symbol-observable#making-an-object-observable
17
+
18
+ @category Observable
19
+ */
20
+ //#endregion
21
+ //#region ../../node_modules/@wix/sdk-types/internal/build/index.d.ts
22
+ declare global {
23
+ interface ContextualClient {}
24
+ }
25
+ /**
26
+ * Creates concrete types from SDK descriptors when a contextual client is
27
+ * available.
28
+ *
29
+ * For a REST descriptor the built (bound) API is intersected with the original
30
+ * descriptor, matching what `contextualizeRESTModuleV2` returns at runtime — a
31
+ * value callable as the bound API and still usable as a descriptor. Keeping the
32
+ * descriptor half lets contextual modules be passed to descriptor-constrained
33
+ * helpers such as `elevate` from `@wix/sdk/context` (FEDINF-14092).
34
+ *
35
+ * The `& T` is scoped to REST descriptors — the only shape codegen wraps in
36
+ * `MaybeContext` — so `BuildDescriptors` (used by `createClient().use`) is left
37
+ * unchanged and stays bound-only. The fix lives here rather than in `elevate`,
38
+ * which is kept strict on purpose (see #941) so it still rejects bound-only
39
+ * functions that are unsafe through `createRESTModule`.
40
+ */
41
+ declare global {
42
+ /**
43
+ * A global interface to set the exposure toggle for the SDK.
44
+ * @example
45
+ * ```ts
46
+ * declare global {
47
+ * interface SDKExposureToggle {
48
+ * alpha: true;
49
+ * }
50
+ * }
51
+ */
52
+ interface SDKExposureToggle {}
53
+ }
54
+ declare global {
55
+ /**
56
+ * A global interface to set the type mode for the SDK.
57
+ * @example
58
+ * ```ts
59
+ * declare global {
60
+ * interface SDKTypeMode {
61
+ * strict: true;
62
+ * }
63
+ * }
64
+ */
65
+ interface SDKTypeMode {}
66
+ }
67
+ //#endregion
68
+ //#region ../../node_modules/@wix/auto_sdk_bookings_availability-time-slots/build/es/index.typings.d.mts
69
+ /**
70
+ * A time slot represents a specific time period when a service is available for booking.
71
+ * It provides all the information needed to display availability to customers, including whether customers can actually book it, the remaining capacity, and which staff members or resources are available.
72
+ * Available time slots may not always be bookable due to service booking policies. When this occurs, the time slot includes information about the specific booking restrictions.
73
+ *
74
+ * For multi-service bookings, the top-level time slot acts as a container spanning the entire service sequence (from the start of the first service to the end of the last service). Individual service details are provided in nested time slots.
75
+ */
76
+ interface TimeSlot$1 {
77
+ /**
78
+ * [Service ID] (https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/introduction).
79
+ *
80
+ * Available only for single-service bookings. For multi-service bookings, this field is empty and individual service IDs are provided in `nestedTimeSlots`.
81
+ * @format GUID
82
+ */
83
+ serviceId?: string | null;
84
+ /**
85
+ * Local start date of the time slot in `YYYY-MM-DDThh:mm:ss` [ISO-8601 format](https://en.wikipedia.org/wiki/ISO_8601).
86
+ * For example, `2026-01-30T13:30:00`.
87
+ *
88
+ * For multi-service bookings, this represents the start time of the first service in the sequence.
89
+ *
90
+ * In `ListAvailabilityTimeSlotEndOptions`, this is identical on every entry and equals the request's `localStartDate`.
91
+ * @format LOCAL_DATE_TIME
92
+ */
93
+ localStartDate?: string | null;
94
+ /**
95
+ * Local end date of the time slot in `YYYY-MM-DDThh:mm:ss` [ISO-8601 format](https://en.wikipedia.org/wiki/ISO_8601).
96
+ * For example, `2026-01-30T14:00:00`.
97
+ *
98
+ * For multi-service bookings, this represents the end time of the last service in the sequence.
99
+ * @format LOCAL_DATE_TIME
100
+ */
101
+ localEndDate?: string | null;
102
+ /**
103
+ * Whether customers can book the slot according to the service's [booking policies](https://dev.wix.com/docs/api-reference/business-solutions/bookings/policies/booking-policies/introduction).
104
+ *
105
+ * For multi-service bookings, this is `true` only when all services in the sequence comply with their respective booking policies.
106
+ */
107
+ bookable?: boolean | null;
108
+ /**
109
+ * Information about where the business provides the service to the customer.
110
+ *
111
+ * In `ListAvailabilityTimeSlotEndOptions`, this is the requested location, identical on every entry.
112
+ */
113
+ location?: Location;
114
+ /**
115
+ * Information about the [event](https://dev.wix.com/docs/api-reference/business-management/calendar/events-v3/introduction) related to the slot.
116
+ * Available only for classes. Not available for appointment-based services and courses.
117
+ */
118
+ eventInfo?: EventInfo;
119
+ /**
120
+ * Total number of spots for the slot.
121
+ *
122
+ * For multi-service bookings, this is always `1` because customers book the entire service sequence as a single unit.
123
+ *
124
+ * In `ListAvailabilityTimeSlotEndOptions`, capacity reflects whether at least one resource can cover `[localStartDate, localEndDate]`; the specific resource is selected later via `GetAvailabilityTimeSlot`.
125
+ * @min 1
126
+ * @max 1000
127
+ */
128
+ totalCapacity?: number | null;
129
+ /**
130
+ * Remaining number of spots for the slot.
131
+ * - For appointment bookings: Either `1` (available) or `0` (unavailable).
132
+ * - For classes: Total capacity minus booked spots. Doesn't account for waitlist reservations. For classes with waitlists, use `bookableCapacity` to get the actual number of spots customers can book.
133
+ * - For courses: Total capacity minus booked spots. Courses don't currently support waitlists.
134
+ *
135
+ * In `ListAvailabilityTimeSlotEndOptions`, capacity reflects whether at least one resource can cover `[localStartDate, localEndDate]`; the specific resource is selected later via `GetAvailabilityTimeSlot`.
136
+ * @max 1000
137
+ */
138
+ remainingCapacity?: number | null;
139
+ /**
140
+ * Number of spots that customers can book for the slot.
141
+ * Calculated as the remaining capacity minus the spots reserved for the waitlist.
142
+ * If the service has no waitlist, identical to `remainingCapacity`.
143
+ *
144
+ * For multi-service bookings, this is either `1` (sequence can be booked) or `0` (sequence can't be booked).
145
+ *
146
+ * In `ListAvailabilityTimeSlotEndOptions`, capacity reflects whether at least one resource can cover `[localStartDate, localEndDate]`; the specific resource is selected later via `GetAvailabilityTimeSlot`.
147
+ */
148
+ bookableCapacity?: number | null;
149
+ /**
150
+ * Information about booking policy violations for the slot.
151
+ *
152
+ * For multi-service bookings, this aggregates violations from all services in the sequence.
153
+ */
154
+ bookingPolicyViolations?: BookingPolicyViolations;
155
+ /**
156
+ * List of [resources](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction) available during the time slot.
157
+ *
158
+ * Available only for single-service bookings. For multi-service bookings, resource information is provided in `nestedTimeSlots`.
159
+ *
160
+ * __Note__: Behavior varies by method:
161
+ * - For [List Availability Time Slots](https://dev.wix.com/docs/api-reference/business-solutions/bookings/time-slots/time-slots-v2/list-availability-time-slots), this list is empty by default. To include resource details, specify `includeResourceTypeIds` or `resourceIds` in the request.
162
+ * - For [Get Availability Time Slot](https://dev.wix.com/docs/api-reference/business-solutions/bookings/time-slots/time-slots-v2/get-availability-time-slot), all resources are returned by default.
163
+ * - **End options** (`ListAvailabilityTimeSlotEndOptions`): Always empty. The response does not surface resource lists for end options. If the customer hasn't already picked a resource earlier in the flow, call `GetAvailabilityTimeSlot` with the picked `localEndDate` to retrieve candidate resources before booking; if a resource is already chosen, pass it through to booking directly.
164
+ */
165
+ availableResources?: AvailableResources[];
166
+ /**
167
+ * Nested time slots for multi-service bookings.
168
+ * Each nested slot represents 1 service in the sequence, ordered according to the service sequence specified in the request.
169
+ *
170
+ * Available only for multi-service bookings. Empty for single-service bookings.
171
+ * @maxSize 40
172
+ */
173
+ nestedTimeSlots?: NestedTimeSlot[];
174
+ /** Information about why customers can't book the time slot. */
175
+ nonBookableReasons?: NonBookableReasons;
176
+ /**
177
+ * Schedule ID associated with this time slot.
178
+ * Same as the service's schedule ID.
179
+ * @format GUID
180
+ */
181
+ scheduleId?: string | null;
182
+ /**
183
+ * Whether this time slot spans one or more full days.
184
+ * When `true`, `localStartDate` is `00:00:00` of the first day and `localEndDate` is `00:00:00` of the day after the last day (exclusive).
185
+ * Midnight boundaries are interpreted in the event's `timeZone`.
186
+ * The time component should be ignored for display purposes.
187
+ *
188
+ * Default: `false`
189
+ */
190
+ allDay?: boolean | null;
191
+ }
192
+ interface Location {
193
+ /**
194
+ * [Location ID](https://dev.wix.com/docs/api-reference/business-management/locations/introduction).
195
+ * Available only for business locations.
196
+ * @format GUID
197
+ */
198
+ _id?: string | null;
199
+ /** Location name. */
200
+ name?: string | null;
201
+ /** Formatted location address. */
202
+ formattedAddress?: string | null;
203
+ /** Location type. */
204
+ locationType?: LocationTypeWithLiterals;
205
+ }
206
+ /**
207
+ * Location type.
208
+ *
209
+ * __Note__: These values differ from the `locationType` values used in the [Bookings Writer V2](https://dev.wix.com/docs/api-reference/business-solutions/bookings/bookings/bookings-writer-v2/introduction) API. When passing location data from a time slot to [Reschedule Booking](https://dev.wix.com/docs/api-reference/business-solutions/bookings/bookings/bookings-writer-v2/reschedule-booking) or [Create Booking](https://dev.wix.com/docs/api-reference/business-solutions/bookings/bookings/bookings-writer-v2/create-booking), map as follows: `BUSINESS` to `OWNER_BUSINESS`, `CUSTOM` to `OWNER_CUSTOM`.
210
+ */
211
+ declare enum LocationType {
212
+ /** A business location, either the default business address, or locations defined for the business by the Business Info. */
213
+ BUSINESS = "BUSINESS",
214
+ /** The location is unique to this service and isn't defined as 1 of the business locations. */
215
+ CUSTOM = "CUSTOM",
216
+ /** The location can be determined by the customer and isn't set up beforehand. */
217
+ CUSTOMER = "CUSTOMER"
218
+ }
219
+ /** @enumType */
220
+ type LocationTypeWithLiterals = LocationType | 'BUSINESS' | 'CUSTOM' | 'CUSTOMER';
221
+ /** Available for event based slots, and not for availability based slots */
222
+ interface EventInfo {
223
+ /**
224
+ * Event ID.
225
+ * @minLength 36
226
+ * @maxLength 250
227
+ */
228
+ eventId?: string | null;
229
+ /** Information about the event's waitlist. Available only if the service has a waitlist. */
230
+ waitingList?: WaitingList;
231
+ /**
232
+ * Event title.
233
+ * @minLength 1
234
+ * @maxLength 200
235
+ */
236
+ eventTitle?: string | null;
237
+ }
238
+ interface WaitingList {
239
+ /**
240
+ * Total number of spots in the waitlist.
241
+ * @min 1
242
+ */
243
+ totalCapacity?: number | null;
244
+ /**
245
+ * Number of remaining spots in the waitlist.
246
+ * For example, an event with a waitlist for 10 people and 3 registrants, results in a remaining capacity of `7`.
247
+ */
248
+ remainingCapacity?: number | null;
249
+ }
250
+ interface BookingPolicyViolations {
251
+ /**
252
+ * Whether it's too early for customers to book the slot.
253
+ *
254
+ * By default, all slots are returned. Specifying `{"tooEarlyToBook": false}` returns only those that customers can already book, while specifying `{"tooEarlyToBook": true}` returns only those that can't be booked yet.
255
+ */
256
+ tooEarlyToBook?: boolean | null;
257
+ /**
258
+ * Earliest time for booking the slot in `YYYY-MM-DDThh:mm:ss.sssZ` format.
259
+ *
260
+ * *In responses**: Contains a value when `tooEarlyToBook` is `true`, indicating the earliest time customers can book the slot.
261
+ *
262
+ * *In requests**: Don't specify a value for this field. Use `tooEarlyToBook` to filter slots that can't be booked yet due to minimum advance booking time restrictions.
263
+ */
264
+ earliestBookingDate?: Date | null;
265
+ /**
266
+ * Whether it's too late for customers to book the slot.
267
+ *
268
+ * By default, all slots are returned. Specifying `{"tooLateToBook": false}` returns only those that customers can still book, while specifying `{"tooLateToBook": true}` returns only those that can no longer be booked.
269
+ */
270
+ tooLateToBook?: boolean | null;
271
+ /**
272
+ * Whether customers can book the service online.
273
+ *
274
+ * By default, both services with online booking enabled and disabled are returned. Providing the boolean set to `true` or `false` returns only matching slots.
275
+ */
276
+ bookOnlineDisabled?: boolean | null;
277
+ }
278
+ interface AvailableResources {
279
+ /**
280
+ * [Resource type ID](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction).
281
+ * @format GUID
282
+ */
283
+ resourceTypeId?: string | null;
284
+ /**
285
+ * Details about resources available during the time slot.
286
+ *
287
+ * Behavior varies by method:
288
+ *
289
+ * List methods (List Availability Time Slots and List Multi Service Availability Time Slots):
290
+ * - Empty by default.
291
+ * - Up to 10 resources when specifying `includeResourceTypeIds` or `resourceIds` in the request.
292
+ *
293
+ * Get methods (Get Availability Time Slots and Get Multi Service Availability Time Slots):
294
+ * - All resources by default.
295
+ * - Filtered resources when specifying `includeResourceTypeIds` or `resourceIds` in the request.
296
+ */
297
+ resources?: Resource[];
298
+ /**
299
+ * Whether there are more available resources for the slot than those listed in `resources`.
300
+ * @readonly
301
+ */
302
+ hasMoreAvailableResources?: boolean | null;
303
+ }
304
+ interface Resource {
305
+ /**
306
+ * Resource ID.
307
+ * @format GUID
308
+ */
309
+ _id?: string;
310
+ /**
311
+ * Resource name.
312
+ * @minLength 1
313
+ */
314
+ name?: string | null;
315
+ }
316
+ interface NestedTimeSlot {
317
+ /**
318
+ * Service ID of the nested time slot.
319
+ * @format GUID
320
+ */
321
+ serviceId?: string;
322
+ /**
323
+ * Local start date of the nested time slot in `YYYY-MM-DDThh:mm:ss` [ISO-8601 format](https://en.wikipedia.org/wiki/ISO_8601).
324
+ * For example, `2026-01-30T13:30:00`.
325
+ * @format LOCAL_DATE_TIME
326
+ */
327
+ localStartDate?: string;
328
+ /**
329
+ * Local end date of the nested time slot in `YYYY-MM-DDThh:mm:ss` [ISO-8601 format](https://en.wikipedia.org/wiki/ISO_8601).
330
+ * For example, `2026-01-30T13:30:00`.
331
+ * @format LOCAL_DATE_TIME
332
+ */
333
+ localEndDate?: string;
334
+ /**
335
+ * List of [resources](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction) available during the nested time slot.
336
+ * @maxSize 10
337
+ */
338
+ availableResources?: AvailableResources[];
339
+ /**
340
+ * The schedule ID associated with this nested time slot.
341
+ * Same as the service's schedule ID.
342
+ * @format GUID
343
+ */
344
+ scheduleId?: string | null;
345
+ }
346
+ interface NonBookableReasons {
347
+ /** Whether the slot is fully booked with no remaining capacity. */
348
+ noRemainingCapacity?: boolean | null;
349
+ /** Whether booking the slot violates any of the service's booking policies. */
350
+ violatesBookingPolicy?: boolean | null;
351
+ /** Whether the slot is reserved for the waitlist. A new customer can't book the reserved slot. */
352
+ reservedForWaitingList?: boolean | null;
353
+ /** Whether the related event is cancelled. */
354
+ eventCancelled?: boolean | null;
355
+ }
356
+ //#endregion
357
+ //#region ../bookings-flow-data/dist/types.d.ts
358
+ /** Genders a visitor can narrow "any staff member" to, in display order. Same literals as the
359
+ * availability API's `requestedGender.gender`, single- and multi-service alike. */
360
+ declare const REQUESTED_GENDERS: readonly ["ANY_FEMALE", "ANY_MALE"];
361
+ type RequestedGender = (typeof REQUESTED_GENDERS)[number];
362
+ //#endregion
363
+ //#region ../../node_modules/@wix/editor-react-types/dist/image.d.ts
364
+ type Point = {
365
+ x: number;
366
+ y: number;
367
+ };
368
+ type Crop = Point & {
369
+ width: number;
370
+ height: number;
371
+ };
372
+ /**
373
+ * An image from Wix Media.
374
+ *
375
+ * @example
376
+ * ```tsx
377
+ * import type { Image } from '@wix/editor-react-types';
378
+ *
379
+ * interface MyComponentProps {
380
+ * image?: Image;
381
+ * }
382
+ *
383
+ * const MyComponent = ({ image }: MyComponentProps) => (
384
+ * <img src={image?.url} alt={image?.alt} />
385
+ * );
386
+ * ```
387
+ */
388
+ type Image = {
389
+ /** The image URI. */uri?: string; /** The image URL. */
390
+ url: string; /** The image file name. */
391
+ name?: string; /** The image height in pixels. */
392
+ height?: number; /** The image width in pixels. */
393
+ width?: number; /** Whether the image is animated (e.g. GIF). */
394
+ animated?: boolean; /** The crop region applied to the image. */
395
+ crop?: Crop; /** The image quality, as a percentage from 0 to 100. */
396
+ quality?: number; /** The image alt text for accessibility. */
397
+ alt?: string;
398
+ };
399
+ //#endregion
400
+ //#region src/api/adapters/staff-member/staff-member.d.ts
401
+ interface StaffMemberItem {
402
+ staffMemberId: string;
403
+ name: string | null;
404
+ image: Image | null;
405
+ isSelected: boolean;
406
+ }
407
+ //#endregion
408
+ //#region src/mappers/date-time.d.ts
409
+ /** Inclusive. */
410
+ interface LocalDateRange {
411
+ readonly startDate: string;
412
+ readonly endDate: string;
413
+ }
414
+ //#endregion
415
+ //#region src/api/adapters/time-slots/days-availability.d.ts
416
+ /** `unavailable`: has slots, none bookable. */
417
+ type DayAvailability = 'none' | 'unavailable' | 'available';
418
+ interface DayAvailabilityItem {
419
+ readonly date: string;
420
+ readonly availability: DayAvailability;
421
+ }
422
+ //#endregion
423
+ //#region src/extensions/contexts/time-slots-context/time-slots-context.types.d.ts
424
+ /** A local date in `YYYY-MM-DD` format. */
425
+ type LocalDate = string;
426
+ /**
427
+ * `found`: selected the first bookable date (maybe the selected one). `none`: no bookable slot,
428
+ * or nothing to search (no service, a course). `error`: see `timeSlotsErrorCode`. `cancelled`:
429
+ * superseded by a newer slot action or input change.
430
+ */
431
+ type NextAvailableDateOutcome = 'found' | 'none' | 'error' | 'cancelled';
432
+ /** Raw SDK slot, kept private for booking. */
433
+ type TimeSlot = TimeSlot$1;
434
+ /** Builder-safe slot. */
435
+ interface TimeSlotItem {
436
+ readonly slotId: string;
437
+ /** Local date-time. */
438
+ readonly slotStartTime: string | null;
439
+ /** Local date-time. */
440
+ readonly slotEndTime: string | null;
441
+ readonly bookable: boolean;
442
+ readonly totalCapacity: number | null;
443
+ readonly remainingCapacity: number | null;
444
+ /** What the visitor can book under current policy. */
445
+ readonly bookableCapacity: number | null;
446
+ /** Class slots only. */
447
+ readonly eventId: string | null;
448
+ /** Class slots only. */
449
+ readonly eventTitle: string | null;
450
+ /** Remaining waitlist spots; class slots only. */
451
+ readonly waitlistCapacity: number | null;
452
+ readonly locationId: string | null;
453
+ readonly locationName: string | null;
454
+ /** Minutes, in the slot's timezone. */
455
+ readonly durationMinutes: number | null;
456
+ readonly isAllDay: boolean;
457
+ /** Empty when staff choice is hidden (CUSTOMER_CANNOT_CHOOSE, no staff-priced variant). */
458
+ readonly staff: ReadonlyArray<TimeSlotStaffMember>;
459
+ }
460
+ interface TimeSlotStaffMember {
461
+ readonly staffMemberId: string;
462
+ readonly name: string;
463
+ }
464
+ /** A selectable staff member or location. */
465
+ interface SelectionOption {
466
+ readonly id: string;
467
+ readonly name: string;
468
+ }
469
+ /** A staff member to filter by. */
470
+ interface StaffMemberFilterOption extends SelectionOption {
471
+ readonly gender: null;
472
+ }
473
+ /** "Any female/male staff member". It has no name: label it in your own words by `gender`. */
474
+ interface StaffGenderFilterOption {
475
+ /** The same literal as `gender`. */
476
+ readonly id: RequestedGender;
477
+ readonly gender: RequestedGender;
478
+ }
479
+ /** A staff member, or "any female/male staff member" (`gender` set). */
480
+ type StaffFilterOption = StaffMemberFilterOption | StaffGenderFilterOption;
481
+ /**
482
+ * Why the time slots can't be shown. Untranslated: word each code in your own text.
483
+ * - `onlineBookingOff`: the service can't be booked online.
484
+ * - `rescheduleLoginRequired`: the visitor must log in to reschedule the booking.
485
+ * - `rescheduleNotFound`: the booking to reschedule wasn't found or didn't load, or it isn't for this service.
486
+ * - `rescheduleAccessDenied`: the visitor isn't allowed to view the booking to reschedule.
487
+ * - `rescheduleNotReschedulable`: the booking can't be rescheduled online.
488
+ * - `timeZoneMissing`: session times can't be shown because the time zone is unknown.
489
+ * - `upcomingSlotsLoadFailed`: the upcoming time slots (with no date picked) failed to load.
490
+ * - `timeSlotsLoadFailed`: the time slots failed to load.
491
+ * - `loadFailed`: the time slots context failed to load.
492
+ */
493
+ type TimeSlotsErrorCode = 'onlineBookingOff' | 'rescheduleLoginRequired' | 'rescheduleNotFound' | 'rescheduleAccessDenied' | 'rescheduleNotReschedulable' | 'timeZoneMissing' | 'upcomingSlotsLoadFailed' | 'timeSlotsLoadFailed' | 'loadFailed';
494
+ interface NextAvailability {
495
+ readonly timeSlots: ReadonlyArray<TimeSlot>;
496
+ readonly timeZone: string | null;
497
+ readonly hasError: boolean;
498
+ }
499
+ /** The availability of the current service or multi-service appointment: its time slots, day availability, upcoming slots, filters, and the actions to browse and pick them. */
500
+ interface TimeSlotsContextValue extends TimeSlotsContextFields {
501
+ readonly timeSlots: ReadonlyArray<TimeSlotItem>;
502
+ readonly isLoading: boolean;
503
+ readonly hasError: boolean;
504
+ /** The most relevant availability error; null without one. */
505
+ readonly errorCode: TimeSlotsErrorCode | null;
506
+ /** The default, and one of the visitor's zone options. */
507
+ readonly businessTimeZone: string | null;
508
+ /** Only when the booking policy allows. */
509
+ readonly setTimeZone: (timeZone: string) => void;
510
+ /** One-based. */
511
+ readonly currentTimeSlotsPage: number;
512
+ readonly hasNextTimeSlotsPage: boolean;
513
+ readonly hasPreviousTimeSlotsPage: boolean;
514
+ readonly nextTimeSlotsPage: () => Promise<void>;
515
+ /**
516
+ * Idempotent: callers share one query, which refetches on input change. Resolves when page 1
517
+ * lands or fails, or at once when there is nothing to list.
518
+ */
519
+ readonly loadUpcomingTimeSlots: () => Promise<void>;
520
+ readonly upcomingTimeSlotsRequested: boolean;
521
+ /** Shows the previous cached page. */
522
+ readonly previousTimeSlotsPage: () => void;
523
+ readonly nextAvailableSlotsCount: number;
524
+ readonly timeZone: string | null;
525
+ /** On the selected slot. Empty when the business hides the staff choice. */
526
+ readonly staffFromSlots: ReadonlyArray<StaffMemberItem>;
527
+ /**
528
+ * From service-context's `b=` (entry, else `?resource=`, else the preferences modal). Null is
529
+ * "Any available" or no choice yet.
530
+ */
531
+ readonly selectedResourceId: string | null;
532
+ /** Writes the staff choice to the blob; null is an explicit "Any available". */
533
+ readonly setSelectedResource: (id: string | null) => void;
534
+ /** "Any available" is bookable on the selected slot (OOI canAutoAssignStaff). */
535
+ readonly canAutoAssignStaff: boolean;
536
+ readonly selectedTimeSlot: TimeSlotItem | null;
537
+ readonly navigateToBookingForm: () => void;
538
+ /** Rows per day before "load all"; null when uncapped. */
539
+ readonly timeSlotLimitPerDay: number | null;
540
+ readonly expandedDates: ReadonlySet<LocalDate>;
541
+ /** Exact, not guessed. */
542
+ readonly daysWithMore: ReadonlySet<LocalDate>;
543
+ /** The date whose full schedule is loading. */
544
+ readonly loadingDate: LocalDate | null;
545
+ readonly loadAllTimeSlotsForDay: (date: LocalDate) => Promise<void>;
546
+ }
547
+ interface TimeSlotsContextFields {
548
+ /** Non-null exactly when `timeSlots` holds that day's slots. */
549
+ readonly selectedDate: LocalDate | null;
550
+ /** Inclusive; null until today is known. */
551
+ readonly daysAvailabilityRange: LocalDateRange | null;
552
+ /** Empty until first loaded. With `onlyAvailableSlots`, a day with only full slots is `none`. */
553
+ readonly daysAvailability: ReadonlyArray<DayAvailabilityItem>;
554
+ readonly daysAvailabilityLoading: boolean;
555
+ /** The day availability failed to load. */
556
+ readonly daysAvailabilityHasError: boolean;
557
+ readonly timeSlotsLoading: boolean;
558
+ /** The same as `errorCode`. */
559
+ readonly timeSlotsErrorCode: TimeSlotsErrorCode | null;
560
+ /**
561
+ * Replaces `timeSlots` with that day's slots. Ignores past or malformed dates; reselecting
562
+ * refreshes. Resolves once stored (watch `timeSlotsLoading`). Before the service is known it
563
+ * waits, then drops for a course or no service.
564
+ */
565
+ readonly selectDate: (date: LocalDate) => Promise<void>;
566
+ /** An inverted or malformed range is ignored. */
567
+ readonly setDaysAvailabilityRange: (range: LocalDateRange) => Promise<void>;
568
+ /** A calendar month moves by month; any other range by its length. */
569
+ readonly nextDaysAvailabilityRange: () => Promise<void>;
570
+ /** A calendar month moves by month; any other range by its length. */
571
+ readonly previousDaysAvailabilityRange: () => Promise<void>;
572
+ /**
573
+ * Selects the first bookable date on or after the selected date (or today), moving the range
574
+ * if needed. Reports via `timeSlotsLoading`/`timeSlotsErrorCode`. Held until service, zone and
575
+ * today are known (no service resolves `none`); a `selectDate` meanwhile cancels it.
576
+ */
577
+ readonly goToNextAvailableDate: () => Promise<NextAvailableDateOutcome>;
578
+ readonly canChangeTimeZone: boolean;
579
+ /**
580
+ * Multi-Service Appointment calendar: no service, service-context settled without error, and
581
+ * 2+ services in the Booking Preferences (valid or not).
582
+ */
583
+ readonly isMultiService: boolean;
584
+ readonly hasValidSchedulingInput: boolean;
585
+ /**
586
+ * Changes with the request target (service, or MSA services/staff/choices/location), not with
587
+ * a picked time. Null with no valid input. An MSA changes in place without a remount, so
588
+ * builders that remember a search outcome key on this.
589
+ */
590
+ readonly availabilityRequestKey: string | null;
591
+ /**
592
+ * Invalid or missing Booking Preferences, or a service with online booking off (nothing
593
+ * loading, no service-context error); nothing is requested. The editor keeps its placeholders,
594
+ * so builders gate it.
595
+ */
596
+ readonly needsServiceChoice: boolean;
597
+ /**
598
+ * Independent of the location filter. Empty when the business hides the staff choice. The two
599
+ * gender options lead when the business allows gender selection and 2+ staff members are offered.
600
+ */
601
+ readonly staffFilterOptions: ReadonlyArray<StaffFilterOption>;
602
+ readonly locationFilterOptions: ReadonlyArray<SelectionOption>;
603
+ /** The picked staff member's id; null under a gender (see `requestedGender`) or "any". */
604
+ readonly selectedStaffFilter: string | null;
605
+ readonly selectedLocationFilter: string | null;
606
+ /**
607
+ * Takes an option's id; a staff member and a gender replace each other. Only narrows the
608
+ * requests; a slot picked under a staff member writes them to the blob.
609
+ */
610
+ readonly setStaffFilter: (id: string | null) => void;
611
+ /** The picked gender option's id, which the requests narrow by; null under a named staff member. */
612
+ readonly requestedGender: RequestedGender | null;
613
+ /**
614
+ * The business offers 'any female/male staff member' here (settings on, not rejected, an
615
+ * appointment). Ignores the staff count; the editor's Staff Filter sample uses it.
616
+ */
617
+ readonly genderSelectionAllowed: boolean;
618
+ readonly setLocationFilter: (id: string | null) => void;
619
+ /** Writes the slot and its location to the blob. Null drops the pick. */
620
+ readonly selectTimeSlot: (slotId: string | null) => void;
621
+ /**
622
+ * A slot is selected and, for an appointment, staff is chosen, auto-assign is allowed, or the
623
+ * slot has at most one staff member. On the MSA calendar a slot is enough.
624
+ */
625
+ readonly isComplete: boolean;
626
+ /** The selection still exists in availability. */
627
+ readonly isSelectionValidated: boolean;
628
+ /** The calendar moves an existing booking (`bookingId` or `token` in its URL). */
629
+ readonly isRescheduling: boolean;
630
+ /**
631
+ * While rescheduling a booking paid with a pricing plan: the plan's last moment, as a local
632
+ * date-time in `timeZone`. Later days are unavailable. Null otherwise.
633
+ */
634
+ readonly rescheduleValidUntil: string | null;
635
+ }
636
+ /** Props accepted by {@link TimeSlotsContextProvider}. */
637
+ interface TimeSlotsContextProviderProps {
638
+ /** Excludes nonbookable slots; defaults to true like the manifest. */
639
+ readonly onlyAvailableSlots?: boolean;
640
+ /** Per page; Next Availability shows the first of them. */
641
+ readonly nextAvailableSlotsCount?: number;
642
+ /** Fetch days availability once inputs are ready, not only after a range action. */
643
+ readonly loadDaysAvailabilityInitially?: boolean;
644
+ /** Schedule rows shown per day before "load all". */
645
+ readonly timeSlotLimitPerDay?: number;
646
+ readonly children: ReactNode;
647
+ }
648
+ /** Deferred authoring props. */
649
+ interface TimeSlotsContextAuthoringProps {
650
+ readonly loadNextAvailabilityInitially?: boolean;
651
+ }
652
+ //#endregion
653
+ //#region src/extensions/contexts/time-slots-context/time-slots-context.d.ts
654
+ declare const timeSlotsContext: React.Context<TimeSlotsContextValue | null>;
655
+ /** Reads the time slots state; throws when no TimeSlotsContextProvider is above. */
656
+ declare function useTimeSlotsContext(): TimeSlotsContextValue;
657
+ /** Loads the availability of the service in the surrounding ServiceContextProvider, or of the multi-service appointment in the page URL, and holds the visitor's date, time zone, staff, location and slot choices. */
658
+ declare function TimeSlotsContextProvider(props: TimeSlotsContextProviderProps): React.JSX.Element;
659
+ //#endregion
660
+ export { type DayAvailability, type DayAvailabilityItem, type LocalDate, type LocalDateRange, type NextAvailability, type NextAvailableDateOutcome, type RequestedGender, type SelectionOption, type StaffFilterOption, type StaffGenderFilterOption, type StaffMemberFilterOption, type TimeSlot, type TimeSlotItem, type TimeSlotsContextAuthoringProps, type TimeSlotsContextFields, type TimeSlotsContextProviderProps, type TimeSlotsContextValue, type TimeSlotsErrorCode, TimeSlotsContextProvider as default, timeSlotsContext, useTimeSlotsContext };