@wix/bookings 1.0.1754 → 1.0.1756
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_sdk-exports/context-booking-checkout/runtime.d.ts +791 -143
- package/_sdk-exports/context-booking-checkout/runtime.js +3 -2
- package/_sdk-exports/context-categories/runtime.d.ts +164 -2
- package/_sdk-exports/context-categories/runtime.js +2 -1
- package/_sdk-exports/context-locations/runtime.d.ts +186 -2
- package/_sdk-exports/context-locations/runtime.js +2 -1
- package/_sdk-exports/context-service/runtime.d.ts +1540 -144
- package/_sdk-exports/context-service/runtime.js +3 -2
- package/_sdk-exports/context-service-addons/runtime.d.ts +215 -13
- package/_sdk-exports/context-service-addons/runtime.js +2 -1
- package/_sdk-exports/context-services/runtime.d.ts +371 -77
- package/_sdk-exports/context-services/runtime.js +3 -2
- package/_sdk-exports/context-time-slots/runtime.d.ts +854 -72
- package/_sdk-exports/context-time-slots/runtime.js +3 -2
- package/build/cjs/context-booking-checkout.d.ts +791 -143
- package/build/cjs/context-booking-checkout.js +1759 -1640
- package/build/cjs/context-booking-checkout.js.map +1 -1
- package/build/cjs/context-categories.d.ts +164 -2
- package/build/cjs/context-categories.js +116 -114
- package/build/cjs/context-categories.js.map +1 -1
- package/build/cjs/context-locations.d.ts +186 -2
- package/build/cjs/context-locations.js +126 -124
- package/build/cjs/context-locations.js.map +1 -1
- package/build/cjs/context-service-addons.d.ts +215 -13
- package/build/cjs/context-service-addons.js +323 -321
- package/build/cjs/context-service-addons.js.map +1 -1
- package/build/cjs/context-service.d.ts +1540 -144
- package/build/cjs/context-service.js +1622 -1616
- package/build/cjs/context-service.js.map +1 -1
- package/build/cjs/context-services.d.ts +371 -77
- package/build/cjs/context-services.js +460 -458
- package/build/cjs/context-services.js.map +1 -1
- package/build/cjs/context-time-slots.d.ts +854 -72
- package/build/cjs/context-time-slots.js +1033 -1000
- package/build/cjs/context-time-slots.js.map +1 -1
- package/build/es/context-booking-checkout.d.mts +791 -143
- package/build/es/context-booking-checkout.mjs +1778 -1650
- package/build/es/context-booking-checkout.mjs.map +1 -1
- package/build/es/context-categories.d.mts +164 -2
- package/build/es/context-categories.mjs +116 -114
- package/build/es/context-categories.mjs.map +1 -1
- package/build/es/context-locations.d.mts +186 -2
- package/build/es/context-locations.mjs +126 -124
- package/build/es/context-locations.mjs.map +1 -1
- package/build/es/context-service-addons.d.mts +215 -13
- package/build/es/context-service-addons.mjs +323 -321
- package/build/es/context-service-addons.mjs.map +1 -1
- package/build/es/context-service.d.mts +1540 -144
- package/build/es/context-service.mjs +1622 -1616
- package/build/es/context-service.mjs.map +1 -1
- package/build/es/context-services.d.mts +371 -77
- package/build/es/context-services.mjs +460 -458
- package/build/es/context-services.mjs.map +1 -1
- package/build/es/context-time-slots.d.mts +854 -72
- package/build/es/context-time-slots.mjs +1033 -1000
- package/build/es/context-time-slots.mjs.map +1 -1
- package/build/internal/cjs/context-booking-checkout.d.ts +791 -143
- package/build/internal/cjs/context-categories.d.ts +164 -2
- package/build/internal/cjs/context-locations.d.ts +186 -2
- package/build/internal/cjs/context-service-addons.d.ts +215 -13
- package/build/internal/cjs/context-service.d.ts +1540 -144
- package/build/internal/cjs/context-services.d.ts +371 -77
- package/build/internal/cjs/context-time-slots.d.ts +854 -72
- package/build/internal/es/context-booking-checkout.d.mts +791 -143
- package/build/internal/es/context-categories.d.mts +164 -2
- package/build/internal/es/context-locations.d.mts +186 -2
- package/build/internal/es/context-service-addons.d.mts +215 -13
- package/build/internal/es/context-service.d.mts +1540 -144
- package/build/internal/es/context-services.d.mts +371 -77
- package/build/internal/es/context-time-slots.d.mts +854 -72
- package/package.json +5 -5
|
@@ -20,11 +20,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// context-time-slots.ts
|
|
21
21
|
var context_time_slots_exports = {};
|
|
22
22
|
__export(context_time_slots_exports, {
|
|
23
|
-
TimeSlotsContextProvider: () =>
|
|
24
|
-
default: () =>
|
|
25
|
-
injectAccessTokenGetter: () =>
|
|
26
|
-
timeSlotsContext: () =>
|
|
27
|
-
useTimeSlotsContext: () =>
|
|
23
|
+
TimeSlotsContextProvider: () => jl,
|
|
24
|
+
default: () => jl,
|
|
25
|
+
injectAccessTokenGetter: () => Fl,
|
|
26
|
+
timeSlotsContext: () => El,
|
|
27
|
+
useTimeSlotsContext: () => Dl
|
|
28
28
|
});
|
|
29
29
|
module.exports = __toCommonJS(context_time_slots_exports);
|
|
30
30
|
|
|
@@ -136,50 +136,50 @@ function M(e2) {
|
|
|
136
136
|
return t2.slice(n2, r2).split(/\0/g);
|
|
137
137
|
}
|
|
138
138
|
var ae = (e2) => `validationError` in (e2.response?.data?.details ?? {});
|
|
139
|
-
var
|
|
140
|
-
var
|
|
141
|
-
function
|
|
139
|
+
var oe = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
|
|
140
|
+
var se = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
|
|
141
|
+
function N(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
|
|
142
142
|
if (typeof e2 != `object` || !e2) throw e2;
|
|
143
|
-
if (ae(e2)) return
|
|
144
|
-
if (
|
|
145
|
-
if (
|
|
143
|
+
if (ae(e2)) return ce(e2, t2, n2);
|
|
144
|
+
if (oe(e2)) return ue(e2);
|
|
145
|
+
if (se(e2)) {
|
|
146
146
|
let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: A(n3), data: {} }, requestId: e2.requestId };
|
|
147
|
-
return
|
|
147
|
+
return le(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
|
|
148
148
|
}
|
|
149
|
-
return
|
|
149
|
+
return de(e2);
|
|
150
150
|
}
|
|
151
|
-
var
|
|
152
|
-
let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 =
|
|
153
|
-
return
|
|
151
|
+
var ce = (e2, t2, n2) => {
|
|
152
|
+
let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = fe(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 };
|
|
153
|
+
return le(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e2.response?.status, requestId: i2 } });
|
|
154
154
|
};
|
|
155
|
-
var
|
|
156
|
-
var
|
|
155
|
+
var le = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
|
|
156
|
+
var ue = (e2) => {
|
|
157
157
|
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 ?? A(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 };
|
|
158
|
-
return
|
|
158
|
+
return le(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e2.requestId } });
|
|
159
159
|
};
|
|
160
|
-
var
|
|
161
|
-
var
|
|
160
|
+
var de = (e2) => le(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: A(e2.response?.statusText ?? `UNKNOWN`), ...!e2.response && { runtimeError: e2 } } });
|
|
161
|
+
var fe = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
|
|
162
162
|
let a2 = { ...e2, ...t2 }, o2 = Object.keys(a2);
|
|
163
163
|
return r2?.filter((e3) => !r2.some((t3) => t3.field.length > e3.field.length && t3.field.startsWith(e3.field) && o2.includes(t3.field))).map((e3) => {
|
|
164
164
|
let r3 = t2[e3.field];
|
|
165
|
-
if (r3) return { ...e3, field:
|
|
165
|
+
if (r3) return { ...e3, field: pe(r3, i2) };
|
|
166
166
|
let s2 = o2?.sort((e4, t3) => t3.length - e4.length)?.find((t3) => e3.field.startsWith(t3));
|
|
167
167
|
if (s2) {
|
|
168
168
|
let t3 = a2[s2];
|
|
169
|
-
if (t3) return { ...e3, field: e3.field.replace(s2,
|
|
169
|
+
if (t3) return { ...e3, field: e3.field.replace(s2, pe(t3, i2)) };
|
|
170
170
|
}
|
|
171
171
|
return n2 ? { ...e3, field: `${i2[0]}.${e3.field}` } : e3;
|
|
172
172
|
});
|
|
173
173
|
};
|
|
174
|
-
var
|
|
175
|
-
let n2 =
|
|
174
|
+
var pe = (e2, t2) => {
|
|
175
|
+
let n2 = P(e2);
|
|
176
176
|
return n2 == null ? e2 : e2.replace(`$[${n2}]`, t2[n2]);
|
|
177
177
|
};
|
|
178
|
-
var
|
|
178
|
+
var P = (e2) => {
|
|
179
179
|
let t2 = e2.match(/\$\[(?<argIndex>\d+)\]/);
|
|
180
180
|
return t2 && t2.groups && Number(t2.groups.argIndex);
|
|
181
181
|
};
|
|
182
|
-
function
|
|
182
|
+
function me(e2, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
|
|
183
183
|
return te(() => e2({ request: async (e3) => {
|
|
184
184
|
let i3 = e3({ host: s2?.HTTPHost || `www.wixapis.com` }), a3 = i3;
|
|
185
185
|
a3.method === `GET` && a3.fallback?.length && (a3.params?.toString().length ?? 0) > 4e3 && (a3 = i3.fallback[0]);
|
|
@@ -193,7 +193,7 @@ function pe(e2, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
|
|
|
193
193
|
e5 = await s3.json();
|
|
194
194
|
} catch {
|
|
195
195
|
}
|
|
196
|
-
let t3 =
|
|
196
|
+
let t3 = F(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();
|
|
@@ -203,14 +203,14 @@ function pe(e2, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
|
|
|
203
203
|
}
|
|
204
204
|
}, fetchWithAuth: n2, wixAPIFetch: i2, getActiveToken: a2, getAuthHeaders: o2 }, { validateRequestSchema: u2 }));
|
|
205
205
|
}
|
|
206
|
-
var
|
|
206
|
+
var he = class extends Error {
|
|
207
207
|
response;
|
|
208
208
|
requestId;
|
|
209
209
|
constructor(e2) {
|
|
210
210
|
super(), this.response = e2.response, this.requestId = e2.requestId;
|
|
211
211
|
}
|
|
212
212
|
};
|
|
213
|
-
var
|
|
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
214
|
var I = `.`;
|
|
215
215
|
function ge(e2, t2, n2) {
|
|
216
216
|
if (e2 == null) throw Error(`Cannot set value on null or undefined`);
|
|
@@ -485,7 +485,7 @@ function Ne(e2) {
|
|
|
485
485
|
if (typeof t3 == `function`) {
|
|
486
486
|
if (`__type` in t3 && t3.__type === `wix_spi_error`) return t3;
|
|
487
487
|
let r3 = e2.host?.apiBaseUrl ?? `www.wixapis.com`, o3 = e2.useCDN === void 0 ? i2().shouldUseCDN : e2.useCDN;
|
|
488
|
-
return
|
|
488
|
+
return me(te(() => v(t3)) ? _(t3) : t3, n3 ?? {}, f2, e2.host?.getErrorHandler?.(), (e3, t4) => {
|
|
489
489
|
let n4 = new URL(e3, `https://${r3}`);
|
|
490
490
|
return n4.host = r3, n4.protocol = `https`, f2(n4.toString(), t4);
|
|
491
491
|
}, i2().getActiveToken, async () => a2(), { HTTPHost: r3 }, e2.host?.name, o3, e2.validateRequestSchema);
|
|
@@ -603,75 +603,75 @@ function $e(e2, t2, n2) {
|
|
|
603
603
|
function et(e2, { fields: t2, mapFields: n2, anyField: r2 }, i2) {
|
|
604
604
|
t2 && Qe(e2, t2, i2), n2 && $e(e2, n2, i2), r2 && Object.values(e2).forEach((e3) => Ze(e3, r2, i2));
|
|
605
605
|
}
|
|
606
|
-
function
|
|
606
|
+
function B(e2, t2) {
|
|
607
607
|
if (!Ye(e2)) return e2;
|
|
608
608
|
for (let { paths: n2, transformFn: r2 } of t2) et(e2, z(n2), r2);
|
|
609
609
|
return e2;
|
|
610
610
|
}
|
|
611
|
-
function
|
|
612
|
-
return
|
|
611
|
+
function tt(e2) {
|
|
612
|
+
return ot(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
|
|
613
613
|
}
|
|
614
|
-
var
|
|
615
|
-
var
|
|
616
|
-
var
|
|
617
|
-
var
|
|
618
|
-
function
|
|
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) {
|
|
619
619
|
let t2 = e2.trim();
|
|
620
|
-
t2 = t2.replace(
|
|
620
|
+
t2 = t2.replace(nt, it).replace(rt, it), t2 = t2.replace(at, `\0`);
|
|
621
621
|
let n2 = 0, r2 = t2.length;
|
|
622
622
|
for (; t2.charAt(n2) === `\0`; ) n2++;
|
|
623
623
|
if (n2 === r2) return [];
|
|
624
624
|
for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
|
|
625
625
|
return t2.slice(n2, r2).split(/\0/g);
|
|
626
626
|
}
|
|
627
|
-
var
|
|
628
|
-
var
|
|
629
|
-
var
|
|
630
|
-
function
|
|
627
|
+
var 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 = []) {
|
|
631
631
|
if (typeof e2 != `object` || !e2) throw e2;
|
|
632
|
-
if (
|
|
633
|
-
if (
|
|
634
|
-
if (
|
|
635
|
-
let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code:
|
|
636
|
-
return
|
|
632
|
+
if (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 } });
|
|
637
637
|
}
|
|
638
|
-
return
|
|
638
|
+
return pt(e2);
|
|
639
639
|
}
|
|
640
|
-
var
|
|
641
|
-
let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 =
|
|
642
|
-
return
|
|
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 } });
|
|
643
643
|
};
|
|
644
|
-
var
|
|
645
|
-
var
|
|
646
|
-
let t2 = e2.response?.status, n2 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n2, i2 = e2.response?.data?.details?.applicationError?.description ?? n2, a2 = e2.response?.data?.details?.applicationError?.code ??
|
|
647
|
-
return
|
|
644
|
+
var 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 } });
|
|
648
648
|
};
|
|
649
|
-
var
|
|
650
|
-
var
|
|
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) => {
|
|
651
651
|
let a2 = { ...e2, ...t2 }, o2 = Object.keys(a2);
|
|
652
652
|
return r2?.filter((e3) => !r2.some((t3) => t3.field.length > e3.field.length && t3.field.startsWith(e3.field) && o2.includes(t3.field))).map((e3) => {
|
|
653
653
|
let r3 = t2[e3.field];
|
|
654
|
-
if (r3) return { ...e3, field:
|
|
654
|
+
if (r3) return { ...e3, field: ht(r3, i2) };
|
|
655
655
|
let s2 = o2?.sort((e4, t3) => t3.length - e4.length)?.find((t3) => e3.field.startsWith(t3));
|
|
656
656
|
if (s2) {
|
|
657
657
|
let t3 = a2[s2];
|
|
658
|
-
if (t3) return { ...e3, field: e3.field.replace(s2,
|
|
658
|
+
if (t3) return { ...e3, field: e3.field.replace(s2, ht(t3, i2)) };
|
|
659
659
|
}
|
|
660
660
|
return n2 ? { ...e3, field: `${i2[0]}.${e3.field}` } : e3;
|
|
661
661
|
});
|
|
662
662
|
};
|
|
663
|
-
var
|
|
664
|
-
let n2 =
|
|
663
|
+
var ht = (e2, t2) => {
|
|
664
|
+
let n2 = gt(e2);
|
|
665
665
|
return n2 == null ? e2 : e2.replace(`$[${n2}]`, t2[n2]);
|
|
666
666
|
};
|
|
667
|
-
var
|
|
667
|
+
var gt = (e2) => {
|
|
668
668
|
let t2 = e2.match(/\$\[(?<argIndex>\d+)\]/);
|
|
669
669
|
return t2 && t2.groups && Number(t2.groups.argIndex);
|
|
670
670
|
};
|
|
671
|
-
function
|
|
671
|
+
function _t() {
|
|
672
672
|
let e2 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
673
673
|
if (e2) return { initWixModules(t3, n3) {
|
|
674
|
-
return
|
|
674
|
+
return vt(() => 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 vt() {
|
|
|
681
681
|
if (t2 || n2) return { initWixModules(e3, r2) {
|
|
682
682
|
if (r2) {
|
|
683
683
|
if (!n2) throw Error(`An elevated client is required to use elevated modules. Make sure to initialize the Wix context with an elevated client before using elevated SDK modules`);
|
|
684
|
-
return
|
|
684
|
+
return vt(() => n2.use(e3));
|
|
685
685
|
}
|
|
686
686
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
687
|
-
return
|
|
687
|
+
return vt(() => 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 vt() {
|
|
|
696
696
|
return t2.graphql(e3, n3, r2);
|
|
697
697
|
} };
|
|
698
698
|
}
|
|
699
|
-
function
|
|
699
|
+
function vt(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,59 +705,59 @@ function yt(e2) {
|
|
|
705
705
|
globalThis.__wix_context__ = t2, m.client = n2.client, m.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
706
706
|
}
|
|
707
707
|
}
|
|
708
|
-
function
|
|
708
|
+
function yt(e2, t2) {
|
|
709
709
|
return (...n2) => {
|
|
710
|
-
let r2 =
|
|
710
|
+
let r2 = _t();
|
|
711
711
|
return r2 ? r2.initWixModules(e2, t2).apply(void 0, n2) : e2.apply(void 0, n2);
|
|
712
712
|
};
|
|
713
713
|
}
|
|
714
|
-
function
|
|
715
|
-
return
|
|
714
|
+
function bt(e2, t2 = false) {
|
|
715
|
+
return yt(e2, t2);
|
|
716
716
|
}
|
|
717
717
|
function xt(e2, t2) {
|
|
718
|
-
let n2 =
|
|
719
|
-
return t2 && r2 ? new URLSearchParams({ ".r":
|
|
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) => {
|
|
720
720
|
r3 == null || Array.isArray(n3) && typeof r3 == `object` || e3.append(t3, r3);
|
|
721
721
|
}), e3), new URLSearchParams());
|
|
722
722
|
}
|
|
723
|
-
function
|
|
724
|
-
let t2 =
|
|
725
|
-
return
|
|
723
|
+
function H(e2) {
|
|
724
|
+
let t2 = Lt(Ft(e2.host), e2.domainToMappings);
|
|
725
|
+
return U(Ut(e2.protoPath, e2.data || {}), t2);
|
|
726
726
|
}
|
|
727
|
-
function
|
|
727
|
+
function St(e2, t2 = ``) {
|
|
728
728
|
let n2 = {};
|
|
729
729
|
return Object.entries(e2).forEach(([e3, r2]) => {
|
|
730
|
-
let i2 = typeof r2 == `object` && !!r2 && !Array.isArray(r2), a2 =
|
|
730
|
+
let i2 = typeof r2 == `object` && !!r2 && !Array.isArray(r2), a2 = Ct(t2, e3);
|
|
731
731
|
if (i2) {
|
|
732
|
-
let e4 =
|
|
732
|
+
let e4 = St(r2, a2);
|
|
733
733
|
Object.assign(n2, e4);
|
|
734
734
|
} else n2[a2] = r2;
|
|
735
735
|
}), n2;
|
|
736
736
|
}
|
|
737
|
-
function
|
|
737
|
+
function Ct(e2, t2) {
|
|
738
738
|
return `${e2}${e2 ? `.` : ``}${t2}`;
|
|
739
739
|
}
|
|
740
|
-
var
|
|
740
|
+
var wt = (e2) => {
|
|
741
741
|
let t2 = new TextEncoder().encode(e2);
|
|
742
742
|
return (typeof btoa < `u` ? btoa(String.fromCodePoint(...t2)) : Buffer.from(e2, `utf-8`).toString(`base64`)).replace(/=/g, ``).replace(/\+/g, `-`).replace(/\//g, `_`);
|
|
743
743
|
};
|
|
744
|
-
var
|
|
745
|
-
var
|
|
746
|
-
var
|
|
747
|
-
var
|
|
748
|
-
var
|
|
749
|
-
var
|
|
750
|
-
var
|
|
751
|
-
var
|
|
752
|
-
var
|
|
753
|
-
var
|
|
754
|
-
function
|
|
755
|
-
return
|
|
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
756
|
}
|
|
757
|
-
function
|
|
758
|
-
return
|
|
757
|
+
function It(e2) {
|
|
758
|
+
return At[e2] ?? e2;
|
|
759
759
|
}
|
|
760
|
-
function
|
|
760
|
+
function Lt(e2, t2) {
|
|
761
761
|
let n2 = t2[e2];
|
|
762
762
|
if (n2) return n2;
|
|
763
763
|
let r2 = Rt(e2, t2) ?? zt(e2, t2);
|
|
@@ -766,7 +766,7 @@ function H(e2, t2) {
|
|
|
766
766
|
let e3 = t2[Ht];
|
|
767
767
|
if (e3) return e3;
|
|
768
768
|
}
|
|
769
|
-
let n3 = t2[
|
|
769
|
+
let n3 = t2[Et];
|
|
770
770
|
if (n3) return n3;
|
|
771
771
|
}
|
|
772
772
|
return r2 ?? [];
|
|
@@ -784,7 +784,7 @@ function zt(e2, t2) {
|
|
|
784
784
|
return r2;
|
|
785
785
|
}
|
|
786
786
|
function Bt(e2, t2) {
|
|
787
|
-
if (!t2.startsWith(
|
|
787
|
+
if (!t2.startsWith(Dt)) return false;
|
|
788
788
|
let n2 = t2.slice(1);
|
|
789
789
|
return e2.length > n2.length && e2.endsWith(n2);
|
|
790
790
|
}
|
|
@@ -796,7 +796,7 @@ function Ut(e2, t2) {
|
|
|
796
796
|
return e2.split(`/`).map((e3) => Wt(e3, t2)).join(`/`);
|
|
797
797
|
}
|
|
798
798
|
function Wt(e2, t2) {
|
|
799
|
-
let n2 = e2.match(
|
|
799
|
+
let n2 = e2.match(Mt) || [], r2 = n2[1];
|
|
800
800
|
return r2 ? Gt(t2, r2, e2, e2.replace(n2[0], ``)) : e2;
|
|
801
801
|
}
|
|
802
802
|
function Gt(e2, t2, n2, r2) {
|
|
@@ -807,19 +807,19 @@ function Gt(e2, t2, n2, r2) {
|
|
|
807
807
|
}
|
|
808
808
|
return `${i2}${r2}`;
|
|
809
809
|
}
|
|
810
|
-
function
|
|
810
|
+
function U(e2, t2) {
|
|
811
811
|
let n2 = t2?.find((t3) => e2.startsWith(t3.destPath));
|
|
812
812
|
return n2 ? n2.srcPath + e2.slice(n2.destPath.length) : e2;
|
|
813
813
|
}
|
|
814
|
-
function
|
|
814
|
+
function Kt(e2) {
|
|
815
815
|
return e2 === `NaN` ? NaN : e2 === `Infinity` ? 1 / 0 : e2 === `-Infinity` ? -1 / 0 : e2;
|
|
816
816
|
}
|
|
817
|
-
var
|
|
818
|
-
var
|
|
819
|
-
var
|
|
820
|
-
var
|
|
821
|
-
let e2 =
|
|
822
|
-
if (e2) return { [
|
|
817
|
+
var 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(`|`) };
|
|
823
823
|
};
|
|
824
824
|
function Zt() {
|
|
825
825
|
let e2 = null, t2 = null;
|
|
@@ -827,15 +827,16 @@ function Zt() {
|
|
|
827
827
|
e2 = n2, t2 = r2;
|
|
828
828
|
}), resolve: e2, reject: t2 };
|
|
829
829
|
}
|
|
830
|
-
var Qt = (
|
|
831
|
-
var $t = (
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
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();
|
|
835
836
|
} } };
|
|
836
837
|
}, auth: (e3) => {
|
|
837
838
|
let t2 = typeof window < `u` ? window.wixEmbedsAPI : void 0;
|
|
838
|
-
!e3 &&
|
|
839
|
+
!e3 && tn() && (e3 = t2?.getAccessTokenFunction?.());
|
|
839
840
|
let n2 = false, { resolve: r2, promise: i2 } = Zt();
|
|
840
841
|
return { getAuthHeaders: async () => {
|
|
841
842
|
if (!e3 && n2 && (e3 = await i2), !e3) throw Error(`Failed to resolve auth token`);
|
|
@@ -844,476 +845,477 @@ var $t = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host:
|
|
|
844
845
|
r2(e4);
|
|
845
846
|
}) };
|
|
846
847
|
} });
|
|
847
|
-
function
|
|
848
|
+
function tn() {
|
|
848
849
|
return typeof document < `u` && document.currentScript?.tagName === `SCRIPT`;
|
|
849
850
|
}
|
|
850
|
-
function
|
|
851
|
+
function nn() {
|
|
851
852
|
let e2 = (typeof window < `u` ? window.wixEmbedsAPI : void 0)?.getExternalBaseUrl?.();
|
|
852
853
|
if (!e2) return;
|
|
853
854
|
let t2 = new URL(e2);
|
|
854
855
|
return t2?.pathname && t2.pathname !== `/` ? `${t2.hostname}${t2.pathname}` : t2.hostname;
|
|
855
856
|
}
|
|
856
|
-
var
|
|
857
|
+
var rn = ({ clientSdk: e2, applicationId: t2 }) => ({ invoke: async ({ namespace: n2, method: r2, args: i2 }) => {
|
|
857
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`);
|
|
858
859
|
return e2.invoke({ namespace: n2, method: r2, args: i2, applicationId: t2, accessToken: `accessToken` });
|
|
859
860
|
}, getAccessToken: () => {
|
|
860
861
|
throw Error(`Not implemented`);
|
|
861
862
|
}, observeState: () => ({ disconnect: () => {
|
|
862
863
|
} }) });
|
|
863
|
-
var
|
|
864
|
+
var an = en({ createHost: function(e2) {
|
|
864
865
|
let t2 = (typeof $wixContext < `u` ? $wixContext.clientSdk : void 0) ?? e2?.clientSdk ?? (typeof window < `u` ? window?.clientSdk : void 0), { applicationId: n2 } = e2 || {};
|
|
865
866
|
if (!n2) throw Error(`"createHost" was called without a required field "applicationId"`);
|
|
866
|
-
return { channel:
|
|
867
|
+
return { channel: rn({ clientSdk: t2, applicationId: n2 }), close: () => {
|
|
867
868
|
} };
|
|
868
869
|
} });
|
|
869
|
-
var
|
|
870
|
-
let n2 =
|
|
870
|
+
var W = (e2, t2) => {
|
|
871
|
+
let n2 = an.host({ applicationId: e2, componentId: t2 }), r2 = an.auth();
|
|
871
872
|
return Ne({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
|
|
872
|
-
}
|
|
873
|
-
var on =
|
|
874
|
-
var sn = `
|
|
875
|
-
var cn =
|
|
876
|
-
var ln =
|
|
877
|
-
var un = typeof
|
|
878
|
-
var dn = typeof
|
|
879
|
-
var fn =
|
|
880
|
-
var pn = (
|
|
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) => {
|
|
881
883
|
let t2 = {};
|
|
882
884
|
return e2.forEach((e3, n2) => t2[e3] = n2), t2;
|
|
883
|
-
})(
|
|
884
|
-
var
|
|
885
|
-
var
|
|
886
|
-
var
|
|
887
|
-
var
|
|
888
|
-
var
|
|
889
|
-
var
|
|
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) => {
|
|
890
892
|
let t2, n2, r2, i2, a2 = ``, o2 = e2.length % 3;
|
|
891
893
|
for (let o3 = 0; o3 < e2.length; ) {
|
|
892
894
|
if ((n2 = e2.charCodeAt(o3++)) > 255 || (r2 = e2.charCodeAt(o3++)) > 255 || (i2 = e2.charCodeAt(o3++)) > 255) throw TypeError(`invalid character found`);
|
|
893
|
-
t2 = n2 << 16 | r2 << 8 | i2, a2 +=
|
|
895
|
+
t2 = n2 << 16 | r2 << 8 | i2, a2 += pn[t2 >> 18 & 63] + pn[t2 >> 12 & 63] + pn[t2 >> 6 & 63] + pn[t2 & 63];
|
|
894
896
|
}
|
|
895
897
|
return o2 ? a2.slice(0, o2 - 3) + `===`.substring(o2) : a2;
|
|
896
898
|
};
|
|
897
|
-
var
|
|
898
|
-
var
|
|
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
901
|
let t2 = 4096, n2 = [];
|
|
900
|
-
for (let r2 = 0, i2 = e2.length; r2 < i2; r2 += t2) n2.push(
|
|
901
|
-
return
|
|
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
904
|
};
|
|
903
|
-
var
|
|
904
|
-
var
|
|
905
|
+
var Sn = (e2, t2 = false) => t2 ? _n(xn(e2)) : xn(e2);
|
|
906
|
+
var Cn = (e2) => {
|
|
905
907
|
if (e2.length < 2) {
|
|
906
908
|
var t2 = e2.charCodeAt(0);
|
|
907
|
-
return t2 < 128 ? e2 : t2 < 2048 ?
|
|
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);
|
|
908
910
|
}
|
|
909
911
|
var t2 = 65536 + (e2.charCodeAt(0) - 55296) * 1024 + (e2.charCodeAt(1) - 56320);
|
|
910
|
-
return
|
|
911
|
-
};
|
|
912
|
-
var
|
|
913
|
-
var
|
|
914
|
-
var
|
|
915
|
-
var
|
|
916
|
-
var
|
|
917
|
-
var
|
|
918
|
-
var
|
|
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) => {
|
|
919
921
|
switch (e2.length) {
|
|
920
922
|
case 4:
|
|
921
923
|
var t2 = ((7 & e2.charCodeAt(0)) << 18 | (63 & e2.charCodeAt(1)) << 12 | (63 & e2.charCodeAt(2)) << 6 | 63 & e2.charCodeAt(3)) - 65536;
|
|
922
|
-
return
|
|
924
|
+
return G((t2 >>> 10) + 55296) + G((t2 & 1023) + 56320);
|
|
923
925
|
case 3:
|
|
924
|
-
return
|
|
926
|
+
return G((15 & e2.charCodeAt(0)) << 12 | (63 & e2.charCodeAt(1)) << 6 | 63 & e2.charCodeAt(2));
|
|
925
927
|
default:
|
|
926
|
-
return
|
|
928
|
+
return G((31 & e2.charCodeAt(0)) << 6 | 63 & e2.charCodeAt(1));
|
|
927
929
|
}
|
|
928
930
|
};
|
|
929
|
-
var
|
|
930
|
-
var
|
|
931
|
-
if (e2 = e2.replace(/\s+/g, ``), !
|
|
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.`);
|
|
932
934
|
e2 += `==`.slice(2 - (e2.length & 3));
|
|
933
935
|
let t2, n2, r2, i2 = [];
|
|
934
|
-
for (let a2 = 0; a2 < e2.length; ) t2 =
|
|
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));
|
|
935
937
|
return i2.join(``);
|
|
936
938
|
};
|
|
937
|
-
var
|
|
938
|
-
var
|
|
939
|
-
var
|
|
940
|
-
var
|
|
941
|
-
var
|
|
942
|
-
var
|
|
943
|
-
var
|
|
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) => {
|
|
944
946
|
if (typeof e2 != `string`) return false;
|
|
945
947
|
let t2 = e2.replace(/\s+/g, ``).replace(/={0,2}$/, ``);
|
|
946
948
|
return !/[^\s0-9a-zA-Z\+/]/.test(t2) || !/[^\s0-9a-zA-Z\-_]/.test(t2);
|
|
947
949
|
};
|
|
948
|
-
var
|
|
949
|
-
var
|
|
950
|
-
let e2 = (e3, t2) => Object.defineProperty(String.prototype, e3,
|
|
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));
|
|
951
953
|
e2(`fromBase64`, function() {
|
|
952
|
-
return
|
|
954
|
+
return Ln(this);
|
|
953
955
|
}), e2(`toBase64`, function(e3) {
|
|
954
|
-
return
|
|
956
|
+
return Dn(this, e3);
|
|
955
957
|
}), e2(`toBase64URI`, function() {
|
|
956
|
-
return
|
|
958
|
+
return Dn(this, true);
|
|
957
959
|
}), e2(`toBase64URL`, function() {
|
|
958
|
-
return
|
|
960
|
+
return Dn(this, true);
|
|
959
961
|
}), e2(`toUint8Array`, function() {
|
|
960
|
-
return
|
|
962
|
+
return Pn(this);
|
|
961
963
|
});
|
|
962
964
|
};
|
|
963
|
-
var
|
|
964
|
-
let e2 = (e3, t2) => Object.defineProperty(Uint8Array.prototype, e3,
|
|
965
|
+
var Vn = function() {
|
|
966
|
+
let e2 = (e3, t2) => Object.defineProperty(Uint8Array.prototype, e3, zn(t2));
|
|
965
967
|
e2(`toBase64`, function(e3) {
|
|
966
|
-
return
|
|
968
|
+
return Sn(this, e3);
|
|
967
969
|
}), e2(`toBase64URI`, function() {
|
|
968
|
-
return
|
|
970
|
+
return Sn(this, true);
|
|
969
971
|
}), e2(`toBase64URL`, function() {
|
|
970
|
-
return
|
|
972
|
+
return Sn(this, true);
|
|
971
973
|
});
|
|
972
974
|
};
|
|
973
|
-
var
|
|
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
977
|
} };
|
|
976
|
-
var
|
|
977
|
-
var
|
|
978
|
-
var
|
|
979
|
-
var
|
|
980
|
-
var
|
|
981
|
-
var
|
|
982
|
-
var
|
|
983
|
-
for (var n2 = new
|
|
984
|
-
for (var i2 = new
|
|
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;
|
|
985
987
|
return { b: n2, r: i2 };
|
|
986
988
|
};
|
|
987
|
-
var
|
|
988
|
-
var
|
|
989
|
-
var
|
|
990
|
-
|
|
991
|
-
var
|
|
992
|
-
var
|
|
993
|
-
|
|
994
|
-
for (
|
|
995
|
-
|
|
996
|
-
|
|
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;
|
|
997
999
|
}
|
|
1000
|
+
var tr;
|
|
998
1001
|
var er;
|
|
999
|
-
var
|
|
1000
|
-
|
|
1001
|
-
for (
|
|
1002
|
-
|
|
1003
|
-
var o2 = new Hn(t2);
|
|
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);
|
|
1004
1006
|
for (i2 = 1; i2 < t2; ++i2) o2[i2] = o2[i2 - 1] + a2[i2 - 1] << 1;
|
|
1005
1007
|
var s2;
|
|
1006
1008
|
if (n2) {
|
|
1007
|
-
s2 = new
|
|
1009
|
+
s2 = new Un(1 << t2);
|
|
1008
1010
|
var c2 = 15 - t2;
|
|
1009
|
-
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[
|
|
1010
|
-
} else for (s2 = new
|
|
1011
|
+
for (i2 = 0; i2 < r2; ++i2) if (e2[i2]) for (var l2 = i2 << 4 | e2[i2], u2 = t2 - e2[i2], d2 = o2[e2[i2] - 1]++ << u2, f2 = d2 | (1 << u2) - 1; d2 <= f2; ++d2) s2[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
1013
|
return s2;
|
|
1012
|
-
},
|
|
1013
|
-
var tr;
|
|
1014
|
+
}, rr = new q(288), J = 0; J < 144; ++J) rr[J] = 8;
|
|
1014
1015
|
var nr;
|
|
1015
|
-
var q;
|
|
1016
|
-
for (q = 144; q < 256; ++q) nr[q] = 9;
|
|
1017
|
-
var q;
|
|
1018
|
-
for (q = 256; q < 280; ++q) nr[q] = 7;
|
|
1019
|
-
var q;
|
|
1020
|
-
for (q = 280; q < 288; ++q) nr[q] = 8;
|
|
1021
|
-
var q;
|
|
1022
|
-
for (rr = new K(32), q = 0; q < 32; ++q) rr[q] = 5;
|
|
1023
1016
|
var rr;
|
|
1024
|
-
var
|
|
1025
|
-
|
|
1026
|
-
var
|
|
1027
|
-
|
|
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
|
+
var ir;
|
|
1026
|
+
var J;
|
|
1027
|
+
var ar = nr(rr, 9, 1);
|
|
1028
|
+
var or = nr(ir, 5, 1);
|
|
1029
|
+
var sr = function(e2) {
|
|
1028
1030
|
for (var t2 = e2[0], n2 = 1; n2 < e2.length; ++n2) e2[n2] > t2 && (t2 = e2[n2]);
|
|
1029
1031
|
return t2;
|
|
1030
1032
|
};
|
|
1031
|
-
var
|
|
1033
|
+
var cr = function(e2, t2, n2) {
|
|
1032
1034
|
var r2 = t2 / 8 | 0;
|
|
1033
1035
|
return (e2[r2] | e2[r2 + 1] << 8) >> (t2 & 7) & n2;
|
|
1034
1036
|
};
|
|
1035
|
-
var
|
|
1037
|
+
var lr = function(e2, t2) {
|
|
1036
1038
|
var n2 = t2 / 8 | 0;
|
|
1037
1039
|
return (e2[n2] | e2[n2 + 1] << 8 | e2[n2 + 2] << 16) >> (t2 & 7);
|
|
1038
1040
|
};
|
|
1039
|
-
var
|
|
1041
|
+
var ur = function(e2) {
|
|
1040
1042
|
return (e2 + 7) / 8 | 0;
|
|
1041
1043
|
};
|
|
1042
|
-
var
|
|
1043
|
-
return (t2 == null || t2 < 0) && (t2 = 0), (n2 == null || n2 > e2.length) && (n2 = e2.length), new
|
|
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
1046
|
};
|
|
1045
|
-
var
|
|
1046
|
-
var
|
|
1047
|
-
var r2 = Error(t2 ||
|
|
1048
|
-
if (r2.code = e2, Error.captureStackTrace && Error.captureStackTrace(r2,
|
|
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;
|
|
1049
1051
|
return r2;
|
|
1050
1052
|
};
|
|
1051
|
-
var
|
|
1053
|
+
var mr = function(e2, t2, n2, r2) {
|
|
1052
1054
|
var i2 = e2.length, a2 = r2 ? r2.length : 0;
|
|
1053
|
-
if (!i2 || t2.f && !t2.l) return n2 || new
|
|
1055
|
+
if (!i2 || t2.f && !t2.l) return n2 || new q(0);
|
|
1054
1056
|
var o2 = !n2, s2 = o2 || t2.i != 2, c2 = t2.i;
|
|
1055
|
-
o2 && (n2 = new
|
|
1057
|
+
o2 && (n2 = new q(i2 * 3));
|
|
1056
1058
|
var l2 = function(e3) {
|
|
1057
1059
|
var t3 = n2.length;
|
|
1058
1060
|
if (e3 > t3) {
|
|
1059
|
-
var r3 = new
|
|
1061
|
+
var r3 = new q(Math.max(t3 * 2, e3));
|
|
1060
1062
|
r3.set(n2), n2 = r3;
|
|
1061
1063
|
}
|
|
1062
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;
|
|
1063
1065
|
do {
|
|
1064
1066
|
if (!p2) {
|
|
1065
|
-
u2 =
|
|
1066
|
-
var v2 =
|
|
1067
|
+
u2 = cr(e2, d2, 1);
|
|
1068
|
+
var v2 = cr(e2, d2 + 1, 3);
|
|
1067
1069
|
if (d2 += 3, !v2) {
|
|
1068
|
-
var y2 =
|
|
1070
|
+
var y2 = ur(d2) + 4, b2 = e2[y2 - 4] | e2[y2 - 3] << 8, x2 = y2 + b2;
|
|
1069
1071
|
if (x2 > i2) {
|
|
1070
|
-
c2 &&
|
|
1072
|
+
c2 && pr(0);
|
|
1071
1073
|
break;
|
|
1072
1074
|
}
|
|
1073
1075
|
s2 && l2(f2 + b2), n2.set(e2.subarray(y2, x2), f2), t2.b = f2 += b2, t2.p = d2 = x2 * 8, t2.f = u2;
|
|
1074
1076
|
continue;
|
|
1075
1077
|
}
|
|
1076
|
-
if (v2 == 1) p2 =
|
|
1078
|
+
if (v2 == 1) p2 = ar, m2 = or, h2 = 9, g2 = 5;
|
|
1077
1079
|
else if (v2 == 2) {
|
|
1078
|
-
var S2 =
|
|
1080
|
+
var S2 = cr(e2, d2, 31) + 257, C2 = cr(e2, d2 + 10, 15) + 4, w2 = S2 + cr(e2, d2 + 5, 31) + 1;
|
|
1079
1081
|
d2 += 14;
|
|
1080
|
-
for (var T2 = new
|
|
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);
|
|
1081
1083
|
d2 += C2 * 3;
|
|
1082
|
-
for (var D2 =
|
|
1083
|
-
var k2 = te2[
|
|
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
1086
|
d2 += k2 & 15;
|
|
1085
1087
|
var y2 = k2 >> 4;
|
|
1086
1088
|
if (y2 < 16) T2[E2++] = y2;
|
|
1087
1089
|
else {
|
|
1088
1090
|
var A2 = 0, ne2 = 0;
|
|
1089
|
-
for (y2 == 16 ? (ne2 = 3 +
|
|
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;
|
|
1090
1092
|
}
|
|
1091
1093
|
}
|
|
1092
1094
|
var re2 = T2.subarray(0, S2), j2 = T2.subarray(S2);
|
|
1093
|
-
h2 =
|
|
1094
|
-
} else
|
|
1095
|
+
h2 = sr(re2), g2 = sr(j2), p2 = nr(re2, h2, 1), m2 = nr(j2, g2, 1);
|
|
1096
|
+
} else pr(1);
|
|
1095
1097
|
if (d2 > _2) {
|
|
1096
|
-
c2 &&
|
|
1098
|
+
c2 && pr(0);
|
|
1097
1099
|
break;
|
|
1098
1100
|
}
|
|
1099
1101
|
}
|
|
1100
1102
|
s2 && l2(f2 + 131072);
|
|
1101
1103
|
for (var ie2 = (1 << h2) - 1, M2 = (1 << g2) - 1, ae2 = d2; ; ae2 = d2) {
|
|
1102
|
-
var A2 = p2[
|
|
1104
|
+
var A2 = p2[lr(e2, d2) & ie2], oe2 = A2 >> 4;
|
|
1103
1105
|
if (d2 += A2 & 15, d2 > _2) {
|
|
1104
|
-
c2 &&
|
|
1106
|
+
c2 && pr(0);
|
|
1105
1107
|
break;
|
|
1106
1108
|
}
|
|
1107
|
-
if (A2 ||
|
|
1108
|
-
else if (
|
|
1109
|
+
if (A2 || pr(2), oe2 < 256) n2[f2++] = oe2;
|
|
1110
|
+
else if (oe2 == 256) {
|
|
1109
1111
|
ae2 = d2, p2 = null;
|
|
1110
1112
|
break;
|
|
1111
1113
|
} else {
|
|
1112
|
-
var
|
|
1113
|
-
if (
|
|
1114
|
-
var E2 =
|
|
1115
|
-
|
|
1114
|
+
var se2 = oe2 - 254;
|
|
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
1118
|
}
|
|
1117
|
-
var
|
|
1118
|
-
|
|
1119
|
-
var j2 =
|
|
1120
|
-
if (
|
|
1121
|
-
var
|
|
1122
|
-
j2 +=
|
|
1119
|
+
var ce2 = m2[lr(e2, d2) & M2], le2 = ce2 >> 4;
|
|
1120
|
+
ce2 || pr(3), d2 += ce2 & 15;
|
|
1121
|
+
var j2 = $n[le2];
|
|
1122
|
+
if (le2 > 3) {
|
|
1123
|
+
var N2 = Kn[le2];
|
|
1124
|
+
j2 += lr(e2, d2) & (1 << N2) - 1, d2 += N2;
|
|
1123
1125
|
}
|
|
1124
1126
|
if (d2 > _2) {
|
|
1125
|
-
c2 &&
|
|
1127
|
+
c2 && pr(0);
|
|
1126
1128
|
break;
|
|
1127
1129
|
}
|
|
1128
1130
|
s2 && l2(f2 + 131072);
|
|
1129
|
-
var
|
|
1131
|
+
var ue2 = f2 + se2;
|
|
1130
1132
|
if (f2 < j2) {
|
|
1131
|
-
var
|
|
1132
|
-
for (
|
|
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];
|
|
1133
1135
|
}
|
|
1134
|
-
for (; f2 <
|
|
1136
|
+
for (; f2 < ue2; ++f2) n2[f2] = n2[f2 - j2];
|
|
1135
1137
|
}
|
|
1136
1138
|
}
|
|
1137
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);
|
|
1138
1140
|
} while (!u2);
|
|
1139
|
-
return f2 != n2.length && o2 ?
|
|
1141
|
+
return f2 != n2.length && o2 ? dr(n2, 0, f2) : n2.subarray(0, f2);
|
|
1140
1142
|
};
|
|
1141
|
-
var
|
|
1142
|
-
var
|
|
1143
|
-
(e2[0] != 31 || e2[1] != 139 || e2[2] != 8) &&
|
|
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`);
|
|
1144
1146
|
var t2 = e2[3], n2 = 10;
|
|
1145
1147
|
t2 & 4 && (n2 += (e2[10] | e2[11] << 8) + 2);
|
|
1146
1148
|
for (var r2 = (t2 >> 3 & 1) + (t2 >> 4 & 1); r2 > 0; r2 -= !e2[n2++]) ;
|
|
1147
1149
|
return n2 + (t2 & 2);
|
|
1148
1150
|
};
|
|
1149
|
-
var
|
|
1151
|
+
var _r = function(e2) {
|
|
1150
1152
|
var t2 = e2.length;
|
|
1151
1153
|
return (e2[t2 - 4] | e2[t2 - 3] << 8 | e2[t2 - 2] << 16 | e2[t2 - 1] << 24) >>> 0;
|
|
1152
1154
|
};
|
|
1153
|
-
function
|
|
1154
|
-
var n2 =
|
|
1155
|
-
return n2 + 8 > e2.length &&
|
|
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);
|
|
1156
1158
|
}
|
|
1157
|
-
var
|
|
1159
|
+
var yr = typeof TextDecoder < `u` && new TextDecoder();
|
|
1158
1160
|
try {
|
|
1159
|
-
|
|
1161
|
+
yr.decode(hr, { stream: true });
|
|
1160
1162
|
} catch {
|
|
1161
1163
|
}
|
|
1162
|
-
var
|
|
1163
|
-
var
|
|
1164
|
-
function
|
|
1164
|
+
var br = /* @__PURE__ */ new Set([`APPOINTMENT`, `CLASS`, `COURSE`]);
|
|
1165
|
+
var xr = new Set(sn);
|
|
1166
|
+
function Y(e2) {
|
|
1165
1167
|
return typeof e2 == `string` ? e2 : void 0;
|
|
1166
1168
|
}
|
|
1167
|
-
function
|
|
1169
|
+
function Sr(e2) {
|
|
1168
1170
|
return typeof e2 == `number` && Number.isFinite(e2) ? e2 : void 0;
|
|
1169
1171
|
}
|
|
1170
|
-
function
|
|
1172
|
+
function Cr(e2) {
|
|
1171
1173
|
return typeof e2 == `boolean` ? e2 : void 0;
|
|
1172
1174
|
}
|
|
1173
|
-
function
|
|
1175
|
+
function wr(e2) {
|
|
1174
1176
|
if (Array.isArray(e2)) return e2.filter((e3) => typeof e3 == `string`);
|
|
1175
1177
|
}
|
|
1176
|
-
function
|
|
1178
|
+
function Tr(e2) {
|
|
1177
1179
|
return typeof e2 == `object` && !!e2;
|
|
1178
1180
|
}
|
|
1179
|
-
function
|
|
1180
|
-
if (!
|
|
1181
|
-
let t2 =
|
|
1181
|
+
function Er(e2) {
|
|
1182
|
+
if (!Tr(e2)) return null;
|
|
1183
|
+
let t2 = Y(e2.t);
|
|
1182
1184
|
if (t2 === void 0) return null;
|
|
1183
|
-
let n2 = { type: t2, ids:
|
|
1185
|
+
let n2 = { type: t2, ids: wr(e2.d) ?? [] }, r2 = Cr(e2.n);
|
|
1184
1186
|
return r2 !== void 0 && (n2.anyResource = r2), n2;
|
|
1185
1187
|
}
|
|
1186
|
-
function
|
|
1187
|
-
if (!
|
|
1188
|
-
let t2 =
|
|
1188
|
+
function Dr(e2) {
|
|
1189
|
+
if (!Tr(e2)) return null;
|
|
1190
|
+
let t2 = Sr(e2.p), n2 = wr(e2.h);
|
|
1189
1191
|
if (t2 === void 0 && n2 === void 0) return null;
|
|
1190
1192
|
let r2 = {};
|
|
1191
1193
|
return t2 !== void 0 && (r2.numberOfParticipants = t2), n2 !== void 0 && (r2.choices = n2), r2;
|
|
1192
1194
|
}
|
|
1193
|
-
function
|
|
1194
|
-
if (!
|
|
1195
|
-
let t2 =
|
|
1195
|
+
function Or(e2) {
|
|
1196
|
+
if (!Tr(e2)) return null;
|
|
1197
|
+
let t2 = Y(e2.i), n2 = Sr(e2.q);
|
|
1196
1198
|
return t2 === void 0 || n2 === void 0 ? null : { id: t2, quantity: n2 };
|
|
1197
1199
|
}
|
|
1198
|
-
function
|
|
1200
|
+
function kr(e2, t2) {
|
|
1199
1201
|
if (!Array.isArray(e2)) return;
|
|
1200
1202
|
let n2 = e2.map(t2).filter((e3) => e3 !== null);
|
|
1201
1203
|
return n2.length ? n2 : void 0;
|
|
1202
1204
|
}
|
|
1203
|
-
function
|
|
1204
|
-
if (!
|
|
1205
|
-
let t2 =
|
|
1205
|
+
function Ar(e2) {
|
|
1206
|
+
if (!Tr(e2)) return null;
|
|
1207
|
+
let t2 = Y(e2.i);
|
|
1206
1208
|
if (t2 === void 0) return null;
|
|
1207
|
-
let n2 = { serviceId: t2 }, r2 =
|
|
1209
|
+
let n2 = { serviceId: t2 }, r2 = Y(e2.g);
|
|
1208
1210
|
r2 !== void 0 && (n2.slug = r2);
|
|
1209
1211
|
let i2 = function(e3) {
|
|
1210
|
-
let t3 =
|
|
1211
|
-
if (t3 !== void 0 &&
|
|
1212
|
+
let t3 = Y(e3);
|
|
1213
|
+
if (t3 !== void 0 && br.has(t3)) return t3;
|
|
1212
1214
|
}(e2.y);
|
|
1213
1215
|
i2 !== void 0 && (n2.serviceType = i2);
|
|
1214
|
-
let a2 =
|
|
1216
|
+
let a2 = Y(e2.t0);
|
|
1215
1217
|
a2 !== void 0 && (n2.slotStart = a2);
|
|
1216
|
-
let o2 =
|
|
1218
|
+
let o2 = Y(e2.t1);
|
|
1217
1219
|
o2 !== void 0 && (n2.slotEnd = o2);
|
|
1218
|
-
let s2 =
|
|
1220
|
+
let s2 = Y(e2.e);
|
|
1219
1221
|
s2 !== void 0 && (n2.eventId = s2);
|
|
1220
|
-
let c2 =
|
|
1222
|
+
let c2 = Y(e2.c);
|
|
1221
1223
|
c2 !== void 0 && (n2.scheduleId = c2);
|
|
1222
|
-
let l2 =
|
|
1224
|
+
let l2 = Y(e2.k);
|
|
1223
1225
|
l2 !== void 0 && (n2.sessionId = l2);
|
|
1224
|
-
let u2 =
|
|
1226
|
+
let u2 = Y(e2.l);
|
|
1225
1227
|
u2 !== void 0 && (n2.locationId = u2);
|
|
1226
|
-
let d2 =
|
|
1228
|
+
let d2 = Y(e2.lt);
|
|
1227
1229
|
d2 !== `BUSINESS` && d2 !== `CUSTOM` && d2 !== `CUSTOMER` || (n2.locationType = d2);
|
|
1228
|
-
let f2 =
|
|
1230
|
+
let f2 = kr(e2.r, Er);
|
|
1229
1231
|
f2 && (n2.resources = f2);
|
|
1230
|
-
let p2 =
|
|
1232
|
+
let p2 = kr(e2.x, Dr);
|
|
1231
1233
|
p2 && (n2.selectedVariants = p2);
|
|
1232
|
-
let m2 =
|
|
1234
|
+
let m2 = kr(e2.a, Or);
|
|
1233
1235
|
m2 && (n2.addOns = m2);
|
|
1234
|
-
let h2 =
|
|
1236
|
+
let h2 = Y(e2.dc);
|
|
1235
1237
|
h2 && (n2.durationChoiceId = h2);
|
|
1236
|
-
let g2 =
|
|
1238
|
+
let g2 = Sr(e2.dm);
|
|
1237
1239
|
g2 !== void 0 && Number.isInteger(g2) && g2 > 0 && (n2.durationInMinutes = g2);
|
|
1238
|
-
let _2 =
|
|
1239
|
-
return _2 !== void 0 &&
|
|
1240
|
+
let _2 = Y(e2.rg);
|
|
1241
|
+
return _2 !== void 0 && xr.has(_2) && (n2.requestedGender = _2), n2;
|
|
1240
1242
|
}
|
|
1241
|
-
function
|
|
1242
|
-
if (!
|
|
1243
|
-
let t2 =
|
|
1243
|
+
function jr(e2) {
|
|
1244
|
+
if (!Tr(e2)) return null;
|
|
1245
|
+
let t2 = Y(e2.m);
|
|
1244
1246
|
if (t2 !== `single` && t2 !== `multi` || !Array.isArray(e2.s)) return null;
|
|
1245
|
-
let n2 = { mode: t2, services: e2.s.map(
|
|
1246
|
-
return r2 !== void 0 && (n2.timezone = r2), true ===
|
|
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
1249
|
}
|
|
1248
1250
|
new TextEncoder();
|
|
1249
|
-
var
|
|
1250
|
-
function
|
|
1251
|
+
var Mr = new TextDecoder();
|
|
1252
|
+
function Nr(e2) {
|
|
1251
1253
|
if (!e2 || e2.length < 2) return null;
|
|
1252
1254
|
try {
|
|
1253
|
-
let t2 = e2[0], n2 =
|
|
1255
|
+
let t2 = e2[0], n2 = Hn.toUint8Array(e2.slice(1)), r2;
|
|
1254
1256
|
if (t2 === `1`) r2 = n2;
|
|
1255
1257
|
else {
|
|
1256
1258
|
if (t2 !== `2`) return null;
|
|
1257
|
-
r2 =
|
|
1259
|
+
r2 = vr(n2);
|
|
1258
1260
|
}
|
|
1259
|
-
return
|
|
1261
|
+
return jr(JSON.parse(Mr.decode(r2)));
|
|
1260
1262
|
} catch {
|
|
1261
1263
|
return null;
|
|
1262
1264
|
}
|
|
1263
1265
|
}
|
|
1264
|
-
function
|
|
1266
|
+
function Pr(e2) {
|
|
1265
1267
|
return e2;
|
|
1266
1268
|
}
|
|
1267
|
-
var
|
|
1268
|
-
var
|
|
1269
|
-
var
|
|
1270
|
-
var
|
|
1271
|
-
var
|
|
1272
|
-
var
|
|
1273
|
-
var
|
|
1274
|
-
var
|
|
1275
|
-
var
|
|
1276
|
-
var
|
|
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) {
|
|
1277
1279
|
return e2.BOOK_ONLINE = `bookingsBookOnline`, e2.SERVICE_PAGE = `bookingsServicePage`, e2.CALENDAR_PAGE = `bookingsCalendar`, e2.FORM_PAGE = `bookingsForm`, e2;
|
|
1278
1280
|
}({});
|
|
1279
|
-
var
|
|
1280
|
-
var
|
|
1281
|
-
var
|
|
1282
|
-
var
|
|
1281
|
+
var Gr = `{{(.*?)}}`;
|
|
1282
|
+
var Kr = `[{{}}]`;
|
|
1283
|
+
var qr = `([^/]+)`;
|
|
1284
|
+
var Jr;
|
|
1283
1285
|
(function(e2) {
|
|
1284
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`;
|
|
1285
|
-
})(
|
|
1286
|
-
var
|
|
1287
|
+
})(Jr ||= {});
|
|
1288
|
+
var X;
|
|
1287
1289
|
(function(e2) {
|
|
1288
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`;
|
|
1289
|
-
})(
|
|
1290
|
-
var Kr = {};
|
|
1291
|
-
var qr = (Kr[Z.PRODUCT_PAGE] = { variables: [`slug`], required: [`slug`] }, Kr);
|
|
1292
|
-
var Jr = `{{main-mapping}}`;
|
|
1291
|
+
})(X ||= {});
|
|
1293
1292
|
var Yr = {};
|
|
1294
|
-
var Xr;
|
|
1295
|
-
var Zr =
|
|
1293
|
+
var Xr = (Yr[X.PRODUCT_PAGE] = { variables: [`slug`], required: [`slug`] }, Yr);
|
|
1294
|
+
var Zr = `{{main-mapping}}`;
|
|
1296
1295
|
var Qr = {};
|
|
1297
|
-
var $r
|
|
1298
|
-
var ei = {};
|
|
1299
|
-
var ti;
|
|
1300
|
-
var ni;
|
|
1301
|
-
var ri =
|
|
1302
|
-
var ii
|
|
1303
|
-
var ai
|
|
1304
|
-
var oi = {};
|
|
1305
|
-
var si =
|
|
1306
|
-
var ci = {};
|
|
1307
|
-
var li =
|
|
1308
|
-
var ui = {};
|
|
1309
|
-
var di =
|
|
1310
|
-
var fi =
|
|
1311
|
-
|
|
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;
|
|
1302
|
+
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) {
|
|
1312
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]);
|
|
1313
1315
|
return e2;
|
|
1314
|
-
},
|
|
1316
|
+
}, hi.apply(this, arguments);
|
|
1315
1317
|
};
|
|
1316
|
-
function
|
|
1318
|
+
function gi(e2) {
|
|
1317
1319
|
var t2 = typeof Symbol == `function` && Symbol.iterator, n2 = t2 && e2[t2], r2 = 0;
|
|
1318
1320
|
if (n2) return n2.call(e2);
|
|
1319
1321
|
if (e2 && typeof e2.length == `number`) return { next: function() {
|
|
@@ -1321,7 +1323,7 @@ function pi(e2) {
|
|
|
1321
1323
|
} };
|
|
1322
1324
|
throw TypeError(t2 ? `Object is not iterable.` : `Symbol.iterator is not defined.`);
|
|
1323
1325
|
}
|
|
1324
|
-
function
|
|
1326
|
+
function Z(e2, t2) {
|
|
1325
1327
|
var n2 = typeof Symbol == `function` && e2[Symbol.iterator];
|
|
1326
1328
|
if (!n2) return e2;
|
|
1327
1329
|
var r2 = n2.call(e2), i2, a2 = [], o2;
|
|
@@ -1338,190 +1340,190 @@ function Q(e2, t2) {
|
|
|
1338
1340
|
}
|
|
1339
1341
|
return a2;
|
|
1340
1342
|
}
|
|
1341
|
-
function
|
|
1343
|
+
function _i(e2, t2, n2) {
|
|
1342
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]);
|
|
1343
1345
|
return e2.concat(a2 || Array.prototype.slice.call(t2));
|
|
1344
1346
|
}
|
|
1345
|
-
var
|
|
1346
|
-
return Object.values(
|
|
1347
|
+
var vi = function(e2) {
|
|
1348
|
+
return Object.values(yi()).some(function(t2) {
|
|
1347
1349
|
return !!t2?.subMappings?.[e2];
|
|
1348
1350
|
});
|
|
1349
1351
|
};
|
|
1350
|
-
var
|
|
1351
|
-
return Object.values(
|
|
1352
|
-
return
|
|
1352
|
+
var yi = function() {
|
|
1353
|
+
return Object.values(mi).reduce(function(e2, t2) {
|
|
1354
|
+
return hi(hi({}, e2), t2);
|
|
1353
1355
|
}, {}) || {};
|
|
1354
1356
|
};
|
|
1355
|
-
var
|
|
1356
|
-
var t2 =
|
|
1357
|
-
return !t2 &&
|
|
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;
|
|
1358
1360
|
};
|
|
1359
|
-
var
|
|
1360
|
-
return Object.entries(
|
|
1361
|
-
var n2 =
|
|
1361
|
+
var xi = function(e2) {
|
|
1362
|
+
return Object.entries(mi).filter(function(t2) {
|
|
1363
|
+
var n2 = Z(t2, 2)[1];
|
|
1362
1364
|
return Object.keys(n2).includes(e2);
|
|
1363
1365
|
}).map(function(e3) {
|
|
1364
|
-
return
|
|
1366
|
+
return Z(e3, 1)[0];
|
|
1365
1367
|
})[0];
|
|
1366
1368
|
};
|
|
1367
|
-
var
|
|
1368
|
-
return Object.entries(
|
|
1369
|
-
var n2 =
|
|
1369
|
+
var Si = function(e2) {
|
|
1370
|
+
return Object.entries(yi()).find(function(t2) {
|
|
1371
|
+
var n2 = Z(t2, 2);
|
|
1370
1372
|
return n2[0], !!n2[1]?.subMappings?.[e2];
|
|
1371
1373
|
});
|
|
1372
1374
|
};
|
|
1373
|
-
var
|
|
1375
|
+
var Ci = function(e2) {
|
|
1374
1376
|
var t2 = [];
|
|
1375
|
-
if (
|
|
1376
|
-
var n2 =
|
|
1377
|
+
if (vi(e2)) {
|
|
1378
|
+
var n2 = Z(Si(e2), 2);
|
|
1377
1379
|
n2[0];
|
|
1378
1380
|
var r2 = n2[1];
|
|
1379
|
-
t2.push.apply(t2,
|
|
1380
|
-
} else t2.push.apply(t2,
|
|
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
1383
|
return t2;
|
|
1382
1384
|
};
|
|
1383
|
-
var
|
|
1385
|
+
var wi = function(e2, t2) {
|
|
1384
1386
|
var n2;
|
|
1385
1387
|
return t2 === void 0 && (t2 = ``), (n2 = e2?.main)?.find?.call(n2, function(e3) {
|
|
1386
1388
|
return e3.key === t2;
|
|
1387
1389
|
});
|
|
1388
1390
|
};
|
|
1389
|
-
var
|
|
1391
|
+
var Ti = function(e2, t2) {
|
|
1390
1392
|
return Error(`Url Mappings Error - [${e2}]: ${t2}`);
|
|
1391
1393
|
};
|
|
1392
|
-
var
|
|
1393
|
-
var
|
|
1394
|
-
var
|
|
1395
|
-
if (typeof e2 != `string` || !
|
|
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;
|
|
1396
1398
|
};
|
|
1397
|
-
var
|
|
1398
|
-
var
|
|
1399
|
+
var ki = Ti(`itemData`, `must be on object with string as value, for example: { "slug": "shoes" }`);
|
|
1400
|
+
var Ai = function(e2) {
|
|
1399
1401
|
if (typeof e2 != `object` || !e2 || !Object.values(e2).every(function(e3) {
|
|
1400
1402
|
return typeof e3 == `string`;
|
|
1401
|
-
}) || Array.isArray(e2)) return
|
|
1403
|
+
}) || Array.isArray(e2)) return ki;
|
|
1402
1404
|
};
|
|
1403
|
-
var
|
|
1404
|
-
var
|
|
1405
|
+
var ji = Ti(`itemData`, `must have required variables, for example: { "slug": "shoes" }`);
|
|
1406
|
+
var Mi = function(e2, t2) {
|
|
1405
1407
|
try {
|
|
1406
|
-
var n2 =
|
|
1408
|
+
var n2 = Ci(e2);
|
|
1407
1409
|
if (!n2.every(function(e3) {
|
|
1408
1410
|
return !!t2[e3];
|
|
1409
1411
|
}) || !n2.length) throw Error();
|
|
1410
1412
|
} catch {
|
|
1411
|
-
return
|
|
1413
|
+
return ji;
|
|
1412
1414
|
}
|
|
1413
1415
|
};
|
|
1414
|
-
var
|
|
1416
|
+
var Ni = function(e2) {
|
|
1415
1417
|
var t2 = e2.key, n2 = e2.itemData;
|
|
1416
|
-
return [
|
|
1418
|
+
return [Oi(t2), Ai(n2), Mi(t2, n2)].find(Boolean);
|
|
1417
1419
|
};
|
|
1418
|
-
var
|
|
1420
|
+
var Pi = function(e2) {
|
|
1419
1421
|
return function(t2) {
|
|
1420
|
-
var n2 = new RegExp(
|
|
1422
|
+
var n2 = new RegExp(Kr, `g`), r2 = t2.replace(n2, ``);
|
|
1421
1423
|
return e2?.[r2];
|
|
1422
1424
|
};
|
|
1423
1425
|
};
|
|
1424
|
-
var
|
|
1426
|
+
var Fi = function(e2, t2, n2, r2) {
|
|
1425
1427
|
e2 === void 0 && (e2 = { main: [] }), r2 === void 0 && (r2 = {});
|
|
1426
|
-
var i2 =
|
|
1428
|
+
var i2 = Ni({ key: t2, itemData: n2 });
|
|
1427
1429
|
if (i2) throw i2;
|
|
1428
|
-
var a2 = (
|
|
1430
|
+
var a2 = (wi(e2, t2) || {}).mapping, o2 = (r2 || {}).baseUrl;
|
|
1429
1431
|
if (o2 ??= ``, o2 = o2.endsWith(`/`) ? o2?.slice(0, -1) : o2, a2 && typeof a2 == `string`) {
|
|
1430
|
-
var s2 = new RegExp(
|
|
1432
|
+
var s2 = new RegExp(Gr, `g`), c2 = a2.replace(s2, Pi(n2));
|
|
1431
1433
|
return o2.concat(`/${c2}`);
|
|
1432
1434
|
}
|
|
1433
1435
|
};
|
|
1434
|
-
var
|
|
1435
|
-
var
|
|
1436
|
-
var t2 = e2.replace(
|
|
1436
|
+
var Ii = /[.*+?^$()|]/g;
|
|
1437
|
+
var Li = function(e2) {
|
|
1438
|
+
var t2 = e2.replace(Ii, `\\$&`).replace(new RegExp(Gr, `g`), qr);
|
|
1437
1439
|
return RegExp(`^${t2}$`);
|
|
1438
1440
|
};
|
|
1439
|
-
var
|
|
1441
|
+
var Ri = function(e2, t2) {
|
|
1440
1442
|
return e2 === void 0 && (e2 = []), e2.find(function(e3) {
|
|
1441
|
-
return
|
|
1443
|
+
return Li(e3).test(t2);
|
|
1442
1444
|
});
|
|
1443
1445
|
};
|
|
1444
|
-
|
|
1445
|
-
var
|
|
1446
|
+
Ti(`url`, `Url must be a string`);
|
|
1447
|
+
var zi = function(e2) {
|
|
1446
1448
|
return [` `, ` `, `
|
|
1447
1449
|
`].every(function(t2) {
|
|
1448
1450
|
return !e2?.includes?.call(e2, t2);
|
|
1449
1451
|
});
|
|
1450
1452
|
};
|
|
1451
|
-
var
|
|
1452
|
-
return e2?.length <=
|
|
1453
|
+
var Bi = function(e2) {
|
|
1454
|
+
return e2?.length <= Qi.MAX_URL_MAPPING_LENGTH;
|
|
1453
1455
|
};
|
|
1454
|
-
var
|
|
1456
|
+
var Vi = function(e2) {
|
|
1455
1457
|
return e2?.split(`/`).every(Boolean);
|
|
1456
1458
|
};
|
|
1457
|
-
var
|
|
1459
|
+
var Hi = function(e2, t2) {
|
|
1458
1460
|
var n2 = t2.urlMappingKey;
|
|
1459
|
-
return
|
|
1461
|
+
return Ci(n2)?.every(function(t3) {
|
|
1460
1462
|
return e2?.includes(`{{${t3}}}`);
|
|
1461
1463
|
});
|
|
1462
1464
|
};
|
|
1463
|
-
var
|
|
1464
|
-
return (e2.match(new RegExp(
|
|
1465
|
+
var Ui = function(e2) {
|
|
1466
|
+
return (e2.match(new RegExp(Gr, `g`))?.length || 0) <= 1;
|
|
1465
1467
|
};
|
|
1466
|
-
var
|
|
1467
|
-
return e2?.split(`/`).every(
|
|
1468
|
+
var Wi = function(e2) {
|
|
1469
|
+
return e2?.split(`/`).every(Ui);
|
|
1468
1470
|
};
|
|
1469
|
-
var
|
|
1471
|
+
var Gi = function(e2) {
|
|
1470
1472
|
return [e2.publishedPrefix, e2.savedPrefix].filter(Boolean);
|
|
1471
1473
|
};
|
|
1472
|
-
var
|
|
1474
|
+
var Ki = function(e2, t2) {
|
|
1473
1475
|
return t2 === void 0 && (t2 = []), function(n2, r2) {
|
|
1474
1476
|
var i2 = n2.split(`/`), a2 = n2 === r2;
|
|
1475
1477
|
if (i2.length < 1 || a2) return true;
|
|
1476
|
-
var o2 =
|
|
1478
|
+
var o2 = Z(r2.split(`/`), 1)[0], s2 = Z(i2, 1)[0];
|
|
1477
1479
|
return t2.includes(s2) ? true : e2.every(function(e3) {
|
|
1478
1480
|
return e3 === o2 || e3 !== s2;
|
|
1479
1481
|
});
|
|
1480
1482
|
};
|
|
1481
1483
|
};
|
|
1482
|
-
var
|
|
1484
|
+
var qi = function(e2, t2) {
|
|
1483
1485
|
var n2 = t2.pathPrefixes;
|
|
1484
|
-
return
|
|
1486
|
+
return Ki(Object.values(n2).map(function(e3) {
|
|
1485
1487
|
return e3.publishedPrefix;
|
|
1486
|
-
}).filter(Boolean),
|
|
1488
|
+
}).filter(Boolean), Gi(t2.pathPrefix))(e2, t2.defaultMapping.defaultPublished);
|
|
1487
1489
|
};
|
|
1488
|
-
var
|
|
1490
|
+
var Ji = function(e2, t2) {
|
|
1489
1491
|
var n2 = t2.urlMappingKey, r2 = t2.urlMappings;
|
|
1490
|
-
return !
|
|
1492
|
+
return !Ri(r2.main?.filter(function(e3) {
|
|
1491
1493
|
return n2 !== e3.key;
|
|
1492
1494
|
}).map(function(e3) {
|
|
1493
1495
|
return e3.mapping;
|
|
1494
1496
|
}), e2);
|
|
1495
1497
|
};
|
|
1496
|
-
var
|
|
1497
|
-
e2 = e2.replace(new RegExp(
|
|
1498
|
+
var Yi = function(e2) {
|
|
1499
|
+
e2 = e2.replace(new RegExp(Gr, `ig`), ``);
|
|
1498
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, ``);
|
|
1499
1501
|
return n2 && r2;
|
|
1500
1502
|
};
|
|
1501
|
-
var
|
|
1502
|
-
var t2 =
|
|
1503
|
+
var Xi = function(e2) {
|
|
1504
|
+
var t2 = Z(e2, 1)[0], n2 = e2.slice(-1);
|
|
1503
1505
|
return t2 !== `/` && n2 !== `/`;
|
|
1504
1506
|
};
|
|
1505
|
-
var
|
|
1507
|
+
var Zi = function(e2, t2) {
|
|
1506
1508
|
var n2 = t2.pathPrefixes;
|
|
1507
|
-
return
|
|
1509
|
+
return Ki(Object.values(n2).map(function(e3) {
|
|
1508
1510
|
return e3.savedPrefix;
|
|
1509
|
-
}).filter(Boolean),
|
|
1511
|
+
}).filter(Boolean), Gi(t2.pathPrefix))(e2, t2.defaultMapping.defaultSaved);
|
|
1510
1512
|
};
|
|
1511
|
-
var
|
|
1513
|
+
var Q;
|
|
1512
1514
|
(function(e2) {
|
|
1513
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`;
|
|
1514
|
-
})(
|
|
1515
|
-
var
|
|
1516
|
+
})(Q ||= {});
|
|
1517
|
+
var Qi = function() {
|
|
1516
1518
|
function e2(e3) {
|
|
1517
1519
|
var t2 = e3.urlMappingKey, n2 = e3.pathPrefixes, r2 = e3.urlMappings, i2 = this;
|
|
1518
1520
|
this.initValidators = function() {
|
|
1519
|
-
i2.validators = [[
|
|
1520
|
-
}, this.urlMappings = r2, this.pathPrefixes = n2, this.urlMappingKey = t2, this.pathPrefix = this.getPathPrefix(), this.defaultMapping =
|
|
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
1523
|
}
|
|
1522
1524
|
return e2.prototype.getPathPrefix = function() {
|
|
1523
|
-
var t2 =
|
|
1524
|
-
if (!t2) throw
|
|
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
1527
|
return this.pathPrefixes[t2] || e2.FALLBACK_PATH_PREFIX;
|
|
1526
1528
|
}, Object.defineProperty(e2.prototype, "validatorProps", { get: function() {
|
|
1527
1529
|
var e3 = this;
|
|
@@ -1529,8 +1531,8 @@ var Yi = function() {
|
|
|
1529
1531
|
}, enumerable: false, configurable: true }), e2.prototype.validate = function(e3) {
|
|
1530
1532
|
var t2, n2;
|
|
1531
1533
|
try {
|
|
1532
|
-
for (var r2 =
|
|
1533
|
-
var a2 =
|
|
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
1536
|
if (!c2) return { isValid: c2, error: s2 };
|
|
1535
1537
|
}
|
|
1536
1538
|
} catch (e4) {
|
|
@@ -1543,251 +1545,251 @@ var Yi = function() {
|
|
|
1543
1545
|
}
|
|
1544
1546
|
}
|
|
1545
1547
|
return { isValid: true };
|
|
1546
|
-
}, e2.errorArray = Object.values(
|
|
1548
|
+
}, e2.errorArray = Object.values(Q), e2.MAX_URL_MAPPING_LENGTH = 1e3, e2.FALLBACK_PATH_PREFIX = `unknown`, e2;
|
|
1547
1549
|
}();
|
|
1548
|
-
var
|
|
1549
|
-
var n2 =
|
|
1550
|
-
return t2 && typeof t2 == `object` ? (a2.savedPrefix = t2.savedPrefix ?? ``, a2.publishedPrefix = t2.publishedPrefix ?? ``) : (a2.savedPrefix =
|
|
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) {
|
|
1551
1553
|
return `{{${e3}}}`;
|
|
1552
|
-
})), false).filter(Boolean).join(`/`), defaultPublished:
|
|
1554
|
+
})), false).filter(Boolean).join(`/`), defaultPublished: _i([a2.publishedPrefix, i2], Z(r2?.map(function(e3) {
|
|
1553
1555
|
return `{{${e3}}}`;
|
|
1554
1556
|
})), false).filter(Boolean).join(`/`) };
|
|
1555
1557
|
};
|
|
1556
|
-
function
|
|
1557
|
-
return t2 ?
|
|
1558
|
+
function ea(e2, t2) {
|
|
1559
|
+
return t2 ? Fi(e2, X.BOOKINGS_SERVICE, { slug: t2 }, { baseUrl: `` }) : void 0;
|
|
1558
1560
|
}
|
|
1559
|
-
var
|
|
1560
|
-
var
|
|
1561
|
-
function
|
|
1562
|
-
return
|
|
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` }] } }));
|
|
1563
1565
|
}
|
|
1564
|
-
var
|
|
1565
|
-
function
|
|
1566
|
+
var ia = `@wix/auto_sdk_bookings_availability-time-slots`;
|
|
1567
|
+
function aa(e2) {
|
|
1566
1568
|
function t2({ host: t3 }) {
|
|
1567
|
-
let n2 =
|
|
1568
|
-
return { entityFqdn: `wix.bookings.availability.v2.time_slot`, method: `POST`, methodFqn: `com.wixpress.bookings.availability.v2.AvailabilityTimeSlots.ListAvailabilityTimeSlots`, packageName:
|
|
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
1571
|
}
|
|
1570
1572
|
return t2;
|
|
1571
1573
|
}
|
|
1572
|
-
async function
|
|
1573
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 =
|
|
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
1576
|
n2?.onSiteCall?.();
|
|
1575
1577
|
try {
|
|
1576
1578
|
let e3 = await t2.request(r2);
|
|
1577
1579
|
return n2?.onSuccess?.(e3), R(e3.data);
|
|
1578
1580
|
} catch (e3) {
|
|
1579
|
-
let t3 =
|
|
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`]);
|
|
1580
1582
|
throw n2?.onError?.(e3), t3;
|
|
1581
1583
|
}
|
|
1582
1584
|
}
|
|
1583
|
-
function
|
|
1584
|
-
return (t2) =>
|
|
1585
|
+
function sa(e2) {
|
|
1586
|
+
return (t2) => oa(t2, { httpClient: e2 });
|
|
1585
1587
|
}
|
|
1586
|
-
var
|
|
1587
|
-
var
|
|
1588
|
-
var
|
|
1589
|
-
function
|
|
1590
|
-
return
|
|
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` }] } }));
|
|
1591
1593
|
}
|
|
1592
|
-
var
|
|
1593
|
-
function
|
|
1594
|
+
var fa = `@wix/auto_sdk_bookings_event-time-slots`;
|
|
1595
|
+
function pa(e2) {
|
|
1594
1596
|
function t2({ host: t3 }) {
|
|
1595
|
-
let n2 =
|
|
1596
|
-
return { entityFqdn: `wix.bookings.availability.v2.time_slot`, method: `POST`, methodFqn: `com.wixpress.bookings.availability.v2.EventTimeSlots.ListEventTimeSlots`, packageName:
|
|
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
1599
|
}
|
|
1598
1600
|
return t2;
|
|
1599
1601
|
}
|
|
1600
|
-
async function
|
|
1601
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 =
|
|
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
1604
|
n2?.onSiteCall?.();
|
|
1603
1605
|
try {
|
|
1604
1606
|
let e3 = await t2.request(r2);
|
|
1605
1607
|
return n2?.onSuccess?.(e3), R(e3.data);
|
|
1606
1608
|
} catch (e3) {
|
|
1607
|
-
let t3 =
|
|
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`]);
|
|
1608
1610
|
throw n2?.onError?.(e3), t3;
|
|
1609
1611
|
}
|
|
1610
1612
|
}
|
|
1611
|
-
function
|
|
1612
|
-
return (t2) =>
|
|
1613
|
+
function ha(e2) {
|
|
1614
|
+
return (t2) => ma(t2, { httpClient: e2 });
|
|
1613
1615
|
}
|
|
1614
|
-
var
|
|
1615
|
-
var
|
|
1616
|
-
var
|
|
1617
|
-
function
|
|
1618
|
-
return
|
|
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` }] } }));
|
|
1619
1621
|
}
|
|
1620
|
-
var
|
|
1621
|
-
function
|
|
1622
|
+
var ba = `@wix/auto_sdk_bookings_multi-service-availability-time-slots`;
|
|
1623
|
+
function xa(e2) {
|
|
1622
1624
|
function t2({ host: t3 }) {
|
|
1623
|
-
let n2 =
|
|
1624
|
-
return { entityFqdn: `wix.bookings.availability.v2.time_slot`, method: `POST`, methodFqn: `com.wixpress.bookings.availability.v2.MultiServiceAvailabilityTimeSlots.ListMultiServiceAvailabilityTimeSlots`, packageName:
|
|
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
1627
|
}
|
|
1626
1628
|
return t2;
|
|
1627
1629
|
}
|
|
1628
|
-
async function
|
|
1629
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 =
|
|
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
1632
|
n2?.onSiteCall?.();
|
|
1631
1633
|
try {
|
|
1632
1634
|
let e3 = await t2.request(r2);
|
|
1633
1635
|
return n2?.onSuccess?.(e3), R(e3.data);
|
|
1634
1636
|
} catch (e3) {
|
|
1635
|
-
let t3 =
|
|
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`]);
|
|
1636
1638
|
throw n2?.onError?.(e3), t3;
|
|
1637
1639
|
}
|
|
1638
1640
|
}
|
|
1639
|
-
function
|
|
1640
|
-
return (t2) =>
|
|
1641
|
+
function Ca(e2) {
|
|
1642
|
+
return (t2) => Sa(t2, { httpClient: e2 });
|
|
1641
1643
|
}
|
|
1642
|
-
var
|
|
1643
|
-
var
|
|
1644
|
-
var
|
|
1645
|
-
var
|
|
1646
|
-
var
|
|
1647
|
-
function
|
|
1648
|
-
return
|
|
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: `` }] } }));
|
|
1649
1651
|
}
|
|
1650
|
-
var
|
|
1651
|
-
function
|
|
1652
|
+
var Aa = `@wix/auto_sdk_bookings_time-slots-configuration`;
|
|
1653
|
+
function ja(e2) {
|
|
1652
1654
|
function t2({ host: t3 }) {
|
|
1653
|
-
return { entityFqdn: `wix.bookings.timeslots_configuration.v1.time_slots_configuration`, method: `GET`, methodFqn: `wix.bookings.timeslots.configuration.v1.TimeSlotsConfigurationService.GetTimeSlotsConfigurationByAppId`, packageName:
|
|
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 }]) };
|
|
1654
1656
|
}
|
|
1655
1657
|
return t2;
|
|
1656
1658
|
}
|
|
1657
|
-
async function
|
|
1658
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 =
|
|
1659
|
+
async function Ma(e2) {
|
|
1660
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = ja(Ve({ appId: e2 }));
|
|
1659
1661
|
n2?.onSiteCall?.();
|
|
1660
1662
|
try {
|
|
1661
1663
|
let e3 = await t2.request(r2);
|
|
1662
1664
|
return n2?.onSuccess?.(e3), R(e3.data);
|
|
1663
1665
|
} catch (e3) {
|
|
1664
|
-
let t3 =
|
|
1666
|
+
let t3 = lt(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { appId: `$[0]` }, singleArgumentUnchanged: false }, [`appId`]);
|
|
1665
1667
|
throw n2?.onError?.(e3), t3;
|
|
1666
1668
|
}
|
|
1667
1669
|
}
|
|
1668
|
-
function
|
|
1669
|
-
return (t2) =>
|
|
1670
|
+
function Na(e2) {
|
|
1671
|
+
return (t2) => Ma(t2, { httpClient: e2 });
|
|
1670
1672
|
}
|
|
1671
|
-
var
|
|
1672
|
-
var
|
|
1673
|
-
var
|
|
1674
|
-
function
|
|
1675
|
-
return
|
|
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: `` }] } }));
|
|
1676
1678
|
}
|
|
1677
|
-
var
|
|
1678
|
-
function
|
|
1679
|
+
var Ra = `@wix/auto_sdk_bookings_bookings-settings`;
|
|
1680
|
+
function za(e2) {
|
|
1679
1681
|
function t2({ host: t3 }) {
|
|
1680
|
-
return { entityFqdn: `wix.bookings.v2.bookings_settings`, method: `GET`, methodFqn: `wix.bookings.settings.v2.BookingsSettingsService.GetBookingsSettings`, packageName:
|
|
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) }] };
|
|
1681
1683
|
}
|
|
1682
1684
|
return t2;
|
|
1683
1685
|
}
|
|
1684
|
-
var
|
|
1685
|
-
async function
|
|
1686
|
-
let { httpClient: e2, sideEffects: t2 } = arguments[0], n2 =
|
|
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
1689
|
t2?.onSiteCall?.();
|
|
1688
1690
|
try {
|
|
1689
1691
|
let r2 = await e2.request(n2);
|
|
1690
1692
|
return t2?.onSuccess?.(r2), R(r2.data)?.bookingsSettings;
|
|
1691
1693
|
} catch (e3) {
|
|
1692
|
-
let n3 =
|
|
1694
|
+
let n3 = lt(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: {}, singleArgumentUnchanged: false }, []);
|
|
1693
1695
|
throw t2?.onError?.(e3), n3;
|
|
1694
1696
|
}
|
|
1695
1697
|
}
|
|
1696
|
-
function
|
|
1697
|
-
return () =>
|
|
1698
|
+
function Ha(e2) {
|
|
1699
|
+
return () => Va({ httpClient: e2 });
|
|
1698
1700
|
}
|
|
1699
|
-
var
|
|
1700
|
-
function
|
|
1701
|
+
var Ua = bt(Ha);
|
|
1702
|
+
function Wa(e2) {
|
|
1701
1703
|
return e2.business?._id ?? null;
|
|
1702
1704
|
}
|
|
1703
|
-
function
|
|
1705
|
+
function Ga(e2) {
|
|
1704
1706
|
return e2.business?.name ?? null;
|
|
1705
1707
|
}
|
|
1706
|
-
function
|
|
1707
|
-
return (e2?.locations ?? []).filter((e3) => e3.type ===
|
|
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));
|
|
1708
1710
|
}
|
|
1709
|
-
var
|
|
1710
|
-
var
|
|
1711
|
-
var
|
|
1712
|
-
var
|
|
1713
|
-
function
|
|
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) {
|
|
1714
1716
|
if (!e2) return null;
|
|
1715
|
-
let t2 =
|
|
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 } } : {} };
|
|
1716
1718
|
return Object.keys(n2).length ? n2 : null;
|
|
1717
1719
|
}
|
|
1718
|
-
function
|
|
1720
|
+
function Qa(e2) {
|
|
1719
1721
|
return (e2?.services.length ?? 0) > 1;
|
|
1720
1722
|
}
|
|
1721
|
-
var
|
|
1722
|
-
function
|
|
1723
|
+
var $a = (e2) => ({ valid: false, reason: e2 });
|
|
1724
|
+
function eo(e2) {
|
|
1723
1725
|
let t2 = e2?.services ?? [];
|
|
1724
|
-
if (!
|
|
1725
|
-
if (t2.some((e3) => e3.serviceType && e3.serviceType !== `APPOINTMENT`)) return
|
|
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`);
|
|
1726
1728
|
let n2 = t2[0].locationType ?? `BUSINESS`, r2 = t2[0].locationId ?? null;
|
|
1727
|
-
if (t2.some((e3) => (e3.locationType ?? `BUSINESS`) !== n2 || (e3.locationId ?? null) !== r2)) return
|
|
1728
|
-
if (r2 && n2 !== `BUSINESS`) return
|
|
1729
|
-
let i2 = t2.map((e3) => ({ serviceId: e3.serviceId, staff:
|
|
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) }));
|
|
1730
1732
|
return { valid: true, locationId: r2, locationType: n2, services: i2, requestKey: JSON.stringify([n2, r2, i2]) };
|
|
1731
1733
|
}
|
|
1732
|
-
var
|
|
1733
|
-
function
|
|
1734
|
-
let t2 = e2.resources?.find((e3) => e3.type ===
|
|
1734
|
+
var to = `staff`;
|
|
1735
|
+
function no(e2) {
|
|
1736
|
+
let t2 = e2.resources?.find((e3) => e3.type === to);
|
|
1735
1737
|
if (!t2) return null;
|
|
1736
1738
|
let n2 = t2.ids[0];
|
|
1737
1739
|
return n2 ? { anyResource: false, staffMemberId: n2 } : t2.anyResource ? { anyResource: true } : null;
|
|
1738
1740
|
}
|
|
1739
|
-
function
|
|
1741
|
+
function ro(e2) {
|
|
1740
1742
|
return e2.addOns ?? [];
|
|
1741
1743
|
}
|
|
1742
|
-
function
|
|
1744
|
+
function io(e2, t2) {
|
|
1743
1745
|
let n2 = e2(t2);
|
|
1744
1746
|
return n2 ? n2.replace(/\/$/, ``) || `/` : null;
|
|
1745
1747
|
}
|
|
1746
|
-
function
|
|
1748
|
+
function ao(e2, t2, n2) {
|
|
1747
1749
|
let r2 = e2(t2);
|
|
1748
1750
|
return !r2 || !n2 ? null : `${r2.replace(/\/$/, ``)}/${n2}`;
|
|
1749
1751
|
}
|
|
1750
|
-
function
|
|
1752
|
+
function oo(e2, t2) {
|
|
1751
1753
|
switch (e2) {
|
|
1752
1754
|
case `servicePage`:
|
|
1753
|
-
return (t2.slug ? t2.buildCustomServiceUrl(t2.slug) : void 0) ??
|
|
1755
|
+
return (t2.slug ? t2.buildCustomServiceUrl(t2.slug) : void 0) ?? ao(t2.appSectionUrl, Wr.SERVICE_PAGE, t2.slug);
|
|
1754
1756
|
case `bookingCalendar`:
|
|
1755
|
-
return t2.isMultiService ?
|
|
1757
|
+
return t2.isMultiService ? io(t2.appSectionUrl, Wr.CALENDAR_PAGE) : ao(t2.appSectionUrl, Wr.CALENDAR_PAGE, t2.slug);
|
|
1756
1758
|
case `bookingForm`:
|
|
1757
|
-
return t2.serviceId ?
|
|
1759
|
+
return t2.serviceId ? ao(t2.appSectionUrl, Wr.FORM_PAGE, t2.slug) : null;
|
|
1758
1760
|
default:
|
|
1759
1761
|
return null;
|
|
1760
1762
|
}
|
|
1761
1763
|
}
|
|
1762
|
-
var
|
|
1763
|
-
var
|
|
1764
|
-
var
|
|
1765
|
-
var
|
|
1766
|
-
var
|
|
1767
|
-
let { previewMode: e2 } = (0, import_services_manager_react.useService)(
|
|
1768
|
-
let r2 =
|
|
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);
|
|
1769
1771
|
await i2({ href: r2 });
|
|
1770
1772
|
}, [e2, n2, i2]), c2 = (0, import_react.useCallback)(async (e3) => {
|
|
1771
|
-
await i2(
|
|
1772
|
-
}, [i2]), l2 = (0, import_react.useCallback)((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) => {
|
|
1773
1775
|
let r2 = m2(e3, t3);
|
|
1774
|
-
return r2 && n2 ?
|
|
1776
|
+
return r2 && n2 ? co(n2, r2) : null;
|
|
1775
1777
|
}, [m2, n2]), g2 = (0, import_react.useCallback)((e3, t3) => {
|
|
1776
1778
|
let n3 = m2(e3, t3);
|
|
1777
1779
|
n3 && s2(n3);
|
|
1778
|
-
}, [m2, s2]), _2 = (0, import_react.useCallback)(() => u2(
|
|
1779
|
-
return { navigate: s2, navigateToHref: c2, resolvePath: m2, toHref: l2, resolveAbsoluteUrl: h2, navigateTo: g2, getBookingFormPath: _2, getCartPagePath: (0, import_react.useCallback)(() => v2(
|
|
1780
|
-
let t3 = v2(
|
|
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);
|
|
1781
1783
|
return t3 ? `${t3}/${e3}?origin=bookings` : void 0;
|
|
1782
1784
|
}, [v2]) };
|
|
1783
1785
|
};
|
|
1784
|
-
function
|
|
1786
|
+
function po(e2) {
|
|
1785
1787
|
return e2?.details?.applicationError?.code;
|
|
1786
1788
|
}
|
|
1787
|
-
function
|
|
1789
|
+
function mo() {
|
|
1788
1790
|
let e2 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
1789
1791
|
if (e2) return { initWixModules(t3, n3) {
|
|
1790
|
-
return
|
|
1792
|
+
return ho(() => e2(t3, n3));
|
|
1791
1793
|
}, fetchWithAuth() {
|
|
1792
1794
|
throw Error(`fetchWithAuth is not available in this context`);
|
|
1793
1795
|
}, graphql() {
|
|
@@ -1797,10 +1799,10 @@ function uo() {
|
|
|
1797
1799
|
if (t2 || n2) return { initWixModules(e3, r2) {
|
|
1798
1800
|
if (r2) {
|
|
1799
1801
|
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`);
|
|
1800
|
-
return
|
|
1802
|
+
return ho(() => n2.use(e3));
|
|
1801
1803
|
}
|
|
1802
1804
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
1803
|
-
return
|
|
1805
|
+
return ho(() => t2.use(e3));
|
|
1804
1806
|
}, fetchWithAuth: (e3, n3) => {
|
|
1805
1807
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
1806
1808
|
return t2.fetchWithAuth(e3, n3);
|
|
@@ -1812,7 +1814,7 @@ function uo() {
|
|
|
1812
1814
|
return t2.graphql(e3, n3, r2);
|
|
1813
1815
|
} };
|
|
1814
1816
|
}
|
|
1815
|
-
function
|
|
1817
|
+
function ho(e2) {
|
|
1816
1818
|
let t2 = globalThis.__wix_context__, n2 = { client: m.client, elevatedClient: m.elevatedClient }, r2;
|
|
1817
1819
|
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);
|
|
1818
1820
|
try {
|
|
@@ -1821,17 +1823,17 @@ function fo(e2) {
|
|
|
1821
1823
|
globalThis.__wix_context__ = t2, m.client = n2.client, m.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
1822
1824
|
}
|
|
1823
1825
|
}
|
|
1824
|
-
function
|
|
1826
|
+
function go(e2, t2) {
|
|
1825
1827
|
return { ...e2, ...Object.fromEntries(t2.map((t3) => [t3, (...n2) => {
|
|
1826
|
-
let r2 =
|
|
1828
|
+
let r2 = mo();
|
|
1827
1829
|
if (!r2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
1828
1830
|
return r2.initWixModules(e2)[t3].apply(void 0, n2);
|
|
1829
1831
|
}])) };
|
|
1830
1832
|
}
|
|
1831
|
-
function
|
|
1832
|
-
return
|
|
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));
|
|
1833
1835
|
}
|
|
1834
|
-
var
|
|
1836
|
+
var vo = class {
|
|
1835
1837
|
constructor(e2) {
|
|
1836
1838
|
this.message = e2, this.captureException = () => {
|
|
1837
1839
|
console.error(this.message);
|
|
@@ -1846,110 +1848,110 @@ var ho = class {
|
|
|
1846
1848
|
};
|
|
1847
1849
|
}
|
|
1848
1850
|
};
|
|
1849
|
-
var
|
|
1850
|
-
var
|
|
1851
|
-
var
|
|
1852
|
-
function
|
|
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) {
|
|
1853
1855
|
try {
|
|
1854
|
-
let t2 =
|
|
1856
|
+
let t2 = bo.getMonitoringClient?.();
|
|
1855
1857
|
return t2 && typeof t2[e2] == `function` ? t2 : null;
|
|
1856
1858
|
} catch {
|
|
1857
1859
|
return null;
|
|
1858
1860
|
}
|
|
1859
1861
|
}
|
|
1860
|
-
function
|
|
1861
|
-
let a2 =
|
|
1862
|
+
function $(e2, { feature: t2, action: n2, level: r2 = `error`, contexts: i2 }) {
|
|
1863
|
+
let a2 = So(`captureException`);
|
|
1862
1864
|
if (!a2) return;
|
|
1863
1865
|
let o2 = e2 instanceof Error ? e2 : Error(String(e2));
|
|
1864
1866
|
a2.captureException(o2, { level: r2, tags: { feature: t2, action: n2 }, ...i2 ? { contexts: i2 } : {} });
|
|
1865
1867
|
}
|
|
1866
|
-
var
|
|
1868
|
+
var Co = (e2) => {
|
|
1867
1869
|
let t2 = (e3) => e3 < 10 ? `0${e3}` : `${e3}`;
|
|
1868
1870
|
return `${e2.getFullYear()}-${t2(e2.getMonth() + 1)}-${t2(e2.getDate())}`;
|
|
1869
1871
|
};
|
|
1870
|
-
var
|
|
1871
|
-
var
|
|
1872
|
-
var
|
|
1873
|
-
var
|
|
1874
|
-
function
|
|
1875
|
-
return `${
|
|
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)}`;
|
|
1876
1878
|
}
|
|
1877
|
-
function
|
|
1878
|
-
let n2 =
|
|
1879
|
+
function ko(e2, t2) {
|
|
1880
|
+
let n2 = Oo(new Date(Date.now()), t2);
|
|
1879
1881
|
return n2.slice(0, 10) === e2 ? n2 : `${e2}T00:00:00`;
|
|
1880
1882
|
}
|
|
1881
|
-
var
|
|
1882
|
-
var
|
|
1883
|
-
function
|
|
1884
|
-
if (typeof e2 != `string` || !
|
|
1885
|
-
let t2 =
|
|
1886
|
-
return !Number.isNaN(t2.getTime()) &&
|
|
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;
|
|
1887
1889
|
}
|
|
1888
|
-
function
|
|
1890
|
+
function No(e2) {
|
|
1889
1891
|
if (!e2 || typeof e2 != `object`) return false;
|
|
1890
1892
|
let { startDate: t2, endDate: n2 } = e2;
|
|
1891
|
-
return
|
|
1893
|
+
return Mo(t2) && Mo(n2) && t2 <= n2;
|
|
1892
1894
|
}
|
|
1893
|
-
function
|
|
1894
|
-
let n2 =
|
|
1895
|
-
return n2.setDate(n2.getDate() + t2),
|
|
1895
|
+
function Po(e2, t2) {
|
|
1896
|
+
let n2 = wo(e2);
|
|
1897
|
+
return n2.setDate(n2.getDate() + t2), Co(n2);
|
|
1896
1898
|
}
|
|
1897
|
-
function
|
|
1898
|
-
let n2 =
|
|
1899
|
-
return Math.round(n2 /
|
|
1899
|
+
function Fo({ startDate: e2, endDate: t2 }) {
|
|
1900
|
+
let n2 = wo(t2).getTime() - wo(e2).getTime();
|
|
1901
|
+
return Math.round(n2 / jo) + 1;
|
|
1900
1902
|
}
|
|
1901
|
-
function
|
|
1902
|
-
let t2 =
|
|
1903
|
-
return { startDate:
|
|
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) };
|
|
1904
1906
|
}
|
|
1905
|
-
function
|
|
1906
|
-
let t2 =
|
|
1907
|
+
function Lo(e2) {
|
|
1908
|
+
let t2 = Io(e2.startDate);
|
|
1907
1909
|
return t2.startDate === e2.startDate && t2.endDate === e2.endDate;
|
|
1908
1910
|
}
|
|
1909
|
-
function
|
|
1910
|
-
if (
|
|
1911
|
-
let n3 =
|
|
1912
|
-
return
|
|
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)));
|
|
1913
1915
|
}
|
|
1914
|
-
let n2 = t2 *
|
|
1915
|
-
return { startDate:
|
|
1916
|
+
let n2 = t2 * Fo(e2);
|
|
1917
|
+
return { startDate: Po(e2.startDate, n2), endDate: Po(e2.endDate, n2) };
|
|
1916
1918
|
}
|
|
1917
|
-
function
|
|
1919
|
+
function zo(e2, t2) {
|
|
1918
1920
|
return e2 >= t2.startDate && e2 <= t2.endDate;
|
|
1919
1921
|
}
|
|
1920
|
-
function
|
|
1921
|
-
let t2 =
|
|
1922
|
-
return
|
|
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));
|
|
1923
1925
|
}
|
|
1924
|
-
function
|
|
1926
|
+
function Vo(e2) {
|
|
1925
1927
|
let t2 = [], n2 = e2.startDate;
|
|
1926
1928
|
for (; n2 <= e2.endDate; ) {
|
|
1927
|
-
let r2 =
|
|
1928
|
-
t2.push({ startDate: n2, endDate: i2 }), n2 =
|
|
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);
|
|
1929
1931
|
}
|
|
1930
1932
|
return t2;
|
|
1931
1933
|
}
|
|
1932
|
-
function
|
|
1934
|
+
function Ho({ allowGenderSelection: e2, staffSelectionStrategy: t2 }) {
|
|
1933
1935
|
return e2 && t2 !== `CUSTOMER_CANNOT_CHOOSE`;
|
|
1934
1936
|
}
|
|
1935
|
-
async function
|
|
1936
|
-
let e2 = await
|
|
1937
|
+
async function Uo() {
|
|
1938
|
+
let e2 = await Pa(Br);
|
|
1937
1939
|
return { businessTimeZone: e2.timeSlotsConfiguration?.displayTimeZone?.timeZone || null, staffSelectionStrategy: e2.timeSlotsConfiguration?.staffSelection?.strategy ?? null, allowGenderSelection: e2.timeSlotsConfiguration?.staffSelection?.allowGenderSelection ?? false };
|
|
1938
1940
|
}
|
|
1939
|
-
function
|
|
1941
|
+
function Wo(e2) {
|
|
1940
1942
|
let t2 = e2.location?._id || (e2.location?.locationType ? `${e2.location.locationType}:${e2.location.formattedAddress ?? ``}` : ``);
|
|
1941
1943
|
return `${e2.localStartDate ?? ``}|${e2.localEndDate ?? ``}|${t2}`;
|
|
1942
1944
|
}
|
|
1943
|
-
function
|
|
1945
|
+
function Go(e2) {
|
|
1944
1946
|
return e2.availableResources?.[0]?.resources?.[0]?._id ?? null;
|
|
1945
1947
|
}
|
|
1946
|
-
function
|
|
1947
|
-
return `${
|
|
1948
|
+
function Ko(e2) {
|
|
1949
|
+
return `${Wo(e2)}|${Go(e2) ?? ``}`;
|
|
1948
1950
|
}
|
|
1949
|
-
function
|
|
1951
|
+
function qo(e2) {
|
|
1950
1952
|
let t2 = /* @__PURE__ */ new Map();
|
|
1951
1953
|
for (let n2 of e2) {
|
|
1952
|
-
let e3 =
|
|
1954
|
+
let e3 = Wo(n2), r2 = t2.get(e3);
|
|
1953
1955
|
r2 ? r2.push(n2) : t2.set(e3, [n2]);
|
|
1954
1956
|
}
|
|
1955
1957
|
return [...t2.values()].map((e3) => {
|
|
@@ -1958,94 +1960,116 @@ function Go(e2) {
|
|
|
1958
1960
|
return { ...n2[0], availableResources: n2.flatMap((e4) => e4.availableResources ?? []) };
|
|
1959
1961
|
});
|
|
1960
1962
|
}
|
|
1961
|
-
function
|
|
1963
|
+
function Jo(e2) {
|
|
1962
1964
|
return e2 ? { locations: [{ _id: e2, locationType: `BUSINESS` }] } : {};
|
|
1963
1965
|
}
|
|
1964
|
-
function
|
|
1965
|
-
return e2 ? { resourceTypes: [{ resourceTypeId:
|
|
1966
|
+
function Yo(e2) {
|
|
1967
|
+
return e2 ? { resourceTypes: [{ resourceTypeId: Ur, resourceIds: [e2] }] } : {};
|
|
1966
1968
|
}
|
|
1967
|
-
function
|
|
1969
|
+
function Xo(e2) {
|
|
1968
1970
|
let { requestedGender: t2, ...n2 } = e2;
|
|
1969
1971
|
return Object.keys(n2).length ? n2 : void 0;
|
|
1970
1972
|
}
|
|
1971
|
-
function
|
|
1973
|
+
function Zo(e2, t2) {
|
|
1972
1974
|
if (!e2) return {};
|
|
1973
|
-
let n2 = t2 ?
|
|
1975
|
+
let n2 = t2 ? Xo(e2) : e2;
|
|
1974
1976
|
return n2 ? { customerChoices: n2 } : {};
|
|
1975
1977
|
}
|
|
1976
|
-
var
|
|
1977
|
-
function
|
|
1978
|
-
return
|
|
1978
|
+
var Qo = `REQUESTED_GENDER_NOT_ALLOWED`;
|
|
1979
|
+
function $o(e2) {
|
|
1980
|
+
return po(e2) === Qo;
|
|
1979
1981
|
}
|
|
1980
|
-
var
|
|
1981
|
-
var
|
|
1982
|
-
function
|
|
1983
|
-
return
|
|
1982
|
+
var es = false;
|
|
1983
|
+
var ts = /* @__PURE__ */ new Set();
|
|
1984
|
+
function ns() {
|
|
1985
|
+
return es;
|
|
1984
1986
|
}
|
|
1985
|
-
function
|
|
1986
|
-
return
|
|
1987
|
+
function rs(e2) {
|
|
1988
|
+
return ts.add(e2), () => ts.delete(e2);
|
|
1987
1989
|
}
|
|
1988
|
-
function
|
|
1989
|
-
|
|
1990
|
+
function is() {
|
|
1991
|
+
es || (es = true, ts.forEach((e2) => e2()));
|
|
1990
1992
|
}
|
|
1991
|
-
async function
|
|
1993
|
+
async function as(e2) {
|
|
1992
1994
|
let { customerChoices: t2, ...n2 } = e2, r2 = (e3) => {
|
|
1993
|
-
let t3 =
|
|
1994
|
-
return
|
|
1995
|
+
let t3 = Xo(e3);
|
|
1996
|
+
return ca({ ...n2, ...t3 ? { customerChoices: t3 } : {} });
|
|
1995
1997
|
};
|
|
1996
|
-
if (
|
|
1998
|
+
if (es && t2?.requestedGender) return r2(t2);
|
|
1997
1999
|
try {
|
|
1998
|
-
return await
|
|
2000
|
+
return await ca(e2);
|
|
1999
2001
|
} catch (e3) {
|
|
2000
|
-
if (!t2?.requestedGender ||
|
|
2001
|
-
return
|
|
2002
|
+
if (!t2?.requestedGender || !$o(e3)) throw e3;
|
|
2003
|
+
return $(e3, { feature: xo.timeSlots, action: `requested-gender-rejected`, level: `warning` }), is(), r2(t2);
|
|
2002
2004
|
}
|
|
2003
2005
|
}
|
|
2004
|
-
function
|
|
2006
|
+
function os(e2, t2, n2) {
|
|
2005
2007
|
return { ...e2 ? { "location.id": e2 } : {}, ...t2 ? { "resources.id": { $hasSome: [t2] } } : {}, ...n2 ? { remainingCapacity: { $gte: n2 } } : {} };
|
|
2006
2008
|
}
|
|
2007
|
-
async function
|
|
2008
|
-
let t2 = await
|
|
2009
|
+
async function ss(e2) {
|
|
2010
|
+
let t2 = await ga(e2);
|
|
2009
2011
|
return { timeSlots: t2.timeSlots ?? [], timeZone: t2.timeZone ?? null, nextCursor: t2.pagingMetadata?.cursors?.next || null };
|
|
2010
2012
|
}
|
|
2011
|
-
function
|
|
2012
|
-
return
|
|
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 } : {} } });
|
|
2013
2015
|
}
|
|
2014
|
-
async function
|
|
2015
|
-
let d2 = await
|
|
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 } : {} } });
|
|
2016
2018
|
return { timeSlots: d2.timeSlots ?? [], timeZone: d2.timeZone ?? null, nextCursor: d2.cursorPagingMetadata?.cursors?.next || null };
|
|
2017
2019
|
}
|
|
2018
|
-
var
|
|
2019
|
-
var
|
|
2020
|
-
function
|
|
2021
|
-
let t2 = e2 ?
|
|
2022
|
-
return { fromLocalDate:
|
|
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) };
|
|
2023
2025
|
}
|
|
2024
|
-
async function
|
|
2025
|
-
let { fromLocalDate: u2, toLocalDate: d2 } =
|
|
2026
|
-
if (
|
|
2027
|
-
let a3 = { ...
|
|
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 } } });
|
|
2028
2030
|
return { timeSlots: c3.timeSlots, timeZone: c3.timeZone };
|
|
2029
2031
|
}
|
|
2030
|
-
let f2 = await
|
|
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 } } });
|
|
2031
2033
|
return { timeSlots: f2.timeSlots ?? [], timeZone: f2.timeZone ?? null };
|
|
2032
2034
|
}
|
|
2033
|
-
var
|
|
2034
|
-
async function
|
|
2035
|
-
let d2 = `${n2}T00:00:00`, f2 = `${n2}T23:59:59`, p2 =
|
|
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;
|
|
2036
2038
|
do {
|
|
2037
|
-
let t3 = await
|
|
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 });
|
|
2038
2040
|
m2.push(...t3.timeSlots), h2 = t3.timeZone ?? h2, g2 = t3.nextCursor ?? void 0;
|
|
2039
2041
|
} while (g2);
|
|
2040
2042
|
return { timeSlots: m2, timeZone: h2 };
|
|
2041
2043
|
}
|
|
2042
|
-
function
|
|
2044
|
+
function gs(e2) {
|
|
2043
2045
|
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 };
|
|
2044
2046
|
}
|
|
2045
|
-
function
|
|
2046
|
-
return e2?.options?.values?.[0]?.type ===
|
|
2047
|
+
function _s(e2) {
|
|
2048
|
+
return e2?.options?.values?.[0]?.type === Ta.STAFF_MEMBER;
|
|
2049
|
+
}
|
|
2050
|
+
function vs(e2) {
|
|
2051
|
+
return e2.staffMemberDetails?.staffMembers ?? [];
|
|
2047
2052
|
}
|
|
2048
|
-
function
|
|
2053
|
+
function ys(e2, t2) {
|
|
2054
|
+
let n2 = e2.workingHoursLocationCoverage;
|
|
2055
|
+
return { staffMemberId: e2.staffMemberId ?? ``, name: e2.name ?? null, image: null, isSelected: t2 === e2.staffMemberId, ...n2 ? { locationCoverage: { availableAtAllLocations: n2.availableAtAllLocations ?? false, locationIds: n2.locationIds ?? [] } } : {} };
|
|
2056
|
+
}
|
|
2057
|
+
function bs(e2, t2) {
|
|
2058
|
+
let n2 = e2.locationCoverage;
|
|
2059
|
+
return !n2 || n2.availableAtAllLocations || n2.locationIds.includes(t2);
|
|
2060
|
+
}
|
|
2061
|
+
function xs(e2, t2) {
|
|
2062
|
+
return t2 ? e2.filter((e3) => bs(e3, t2)) : e2;
|
|
2063
|
+
}
|
|
2064
|
+
function Ss(e2, t2) {
|
|
2065
|
+
if (t2.length === 0) return e2;
|
|
2066
|
+
let n2 = e2.filter((e3) => xs(t2, e3.id).length > 0);
|
|
2067
|
+
return n2.length > 0 ? n2 : e2;
|
|
2068
|
+
}
|
|
2069
|
+
function Cs(e2) {
|
|
2070
|
+
return vs(e2).map((e3) => ys(e3, null));
|
|
2071
|
+
}
|
|
2072
|
+
function ws(e2) {
|
|
2049
2073
|
let t2 = e2;
|
|
2050
2074
|
if (t2.__state || (t2.__state = { status: `pending` }, t2.then((e3) => {
|
|
2051
2075
|
t2.__state = { status: `fulfilled`, value: e3 };
|
|
@@ -2054,33 +2078,33 @@ function gs(e2) {
|
|
|
2054
2078
|
})), t2.__state.status === `fulfilled`) return t2.__state.value;
|
|
2055
2079
|
throw t2.__state.status === `rejected` ? t2.__state.reason : t2;
|
|
2056
2080
|
}
|
|
2057
|
-
function
|
|
2081
|
+
function Ts(e2) {
|
|
2058
2082
|
let t2 = Promise.resolve(e2);
|
|
2059
2083
|
return t2.__state = { status: `fulfilled`, value: e2 }, t2;
|
|
2060
2084
|
}
|
|
2061
|
-
var
|
|
2062
|
-
function
|
|
2085
|
+
var Es = Pr(`@wix/site-service-warmup-data`);
|
|
2086
|
+
function Ds() {
|
|
2063
2087
|
try {
|
|
2064
2088
|
return (0, import_services_manager_react.useGetService)();
|
|
2065
2089
|
} catch {
|
|
2066
2090
|
return null;
|
|
2067
2091
|
}
|
|
2068
2092
|
}
|
|
2069
|
-
function
|
|
2093
|
+
function Os(e2) {
|
|
2070
2094
|
try {
|
|
2071
|
-
return e2 ? e2(
|
|
2095
|
+
return e2 ? e2(Es) : null;
|
|
2072
2096
|
} catch {
|
|
2073
2097
|
return null;
|
|
2074
2098
|
}
|
|
2075
2099
|
}
|
|
2076
|
-
function
|
|
2077
|
-
let e2 =
|
|
2100
|
+
function ks() {
|
|
2101
|
+
let e2 = Os(Ds()), t2 = typeof window > `u`;
|
|
2078
2102
|
return { scope: e2 ?? void 0, get: async (n2) => {
|
|
2079
2103
|
if (t2 || !e2) return null;
|
|
2080
2104
|
try {
|
|
2081
2105
|
return await e2.get(n2);
|
|
2082
2106
|
} catch (e3) {
|
|
2083
|
-
return
|
|
2107
|
+
return $(e3, { feature: xo.warmup, action: `read`, level: `warning`, contexts: { warmup: { key: n2 } } }), null;
|
|
2084
2108
|
}
|
|
2085
2109
|
}, set: (n2, r2) => {
|
|
2086
2110
|
if (t2 && e2) try {
|
|
@@ -2089,57 +2113,57 @@ function xs() {
|
|
|
2089
2113
|
}
|
|
2090
2114
|
} };
|
|
2091
2115
|
}
|
|
2092
|
-
var
|
|
2093
|
-
function
|
|
2094
|
-
return `${
|
|
2116
|
+
var As = `bookings-uou`;
|
|
2117
|
+
function js() {
|
|
2118
|
+
return `${As}:bookings-settings`;
|
|
2095
2119
|
}
|
|
2096
|
-
function
|
|
2097
|
-
return `${
|
|
2120
|
+
function Ms() {
|
|
2121
|
+
return `${As}:time-slots-configuration`;
|
|
2098
2122
|
}
|
|
2099
|
-
var
|
|
2100
|
-
var
|
|
2101
|
-
var
|
|
2102
|
-
var
|
|
2103
|
-
function
|
|
2123
|
+
var Ns = 5e3;
|
|
2124
|
+
var Ps = 100;
|
|
2125
|
+
var Fs = `wix-warmup-data`;
|
|
2126
|
+
var Is = null;
|
|
2127
|
+
function Ls(e2) {
|
|
2104
2128
|
if (typeof document < `u`) try {
|
|
2105
|
-
let t2 = document.getElementById(
|
|
2106
|
-
return t2 ? (
|
|
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;
|
|
2107
2131
|
} catch {
|
|
2108
2132
|
return;
|
|
2109
2133
|
}
|
|
2110
2134
|
}
|
|
2111
|
-
var
|
|
2112
|
-
var
|
|
2113
|
-
var
|
|
2114
|
-
var
|
|
2115
|
-
function
|
|
2116
|
-
if (!e2) return
|
|
2117
|
-
let t2 =
|
|
2118
|
-
return t2 || (t2 =
|
|
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;
|
|
2119
2143
|
}
|
|
2120
|
-
function
|
|
2144
|
+
function Us({ key: e2, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
|
|
2121
2145
|
if (e2 === null) return n2();
|
|
2122
2146
|
if (typeof window > `u`) {
|
|
2123
2147
|
let r3 = () => n2().then((n3) => (t2.set(e2, n3), n3)), { scope: i3 } = t2;
|
|
2124
2148
|
if (!i3) return r3();
|
|
2125
|
-
let a3 =
|
|
2126
|
-
a3 || (a3 = /* @__PURE__ */ new Map(),
|
|
2149
|
+
let a3 = Vs.get(i3);
|
|
2150
|
+
a3 || (a3 = /* @__PURE__ */ new Map(), Vs.set(i3, a3));
|
|
2127
2151
|
let o3 = a3.get(e2);
|
|
2128
2152
|
if (o3) return o3;
|
|
2129
2153
|
let s3 = r3();
|
|
2130
2154
|
return a3.set(e2, s3), s3.catch(() => a3.delete(e2)), s3;
|
|
2131
2155
|
}
|
|
2132
|
-
let i2 =
|
|
2156
|
+
let i2 = Hs(t2.scope), a2 = Date.now();
|
|
2133
2157
|
for (let [e3, t3] of i2.promises) t3.expiresAt <= a2 && i2.promises.delete(e3);
|
|
2134
2158
|
let o2 = i2.promises.get(e2);
|
|
2135
2159
|
if (o2 && !r2) return o2.promise;
|
|
2136
2160
|
r2 && i2.invalidatedWarmup.add(e2);
|
|
2137
2161
|
let s2 = !i2.invalidatedWarmup.has(e2);
|
|
2138
2162
|
if (s2) {
|
|
2139
|
-
let t3 =
|
|
2163
|
+
let t3 = Ls(e2);
|
|
2140
2164
|
if (t3 !== void 0) {
|
|
2141
|
-
let n3 =
|
|
2142
|
-
return i2.promises.set(e2, { promise: n3, expiresAt: a2 +
|
|
2165
|
+
let n3 = Ts(t3);
|
|
2166
|
+
return i2.promises.set(e2, { promise: n3, expiresAt: a2 + Ns }), n3;
|
|
2143
2167
|
}
|
|
2144
2168
|
}
|
|
2145
2169
|
let c2 = (async () => {
|
|
@@ -2149,69 +2173,69 @@ function Fs({ key: e2, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
|
|
|
2149
2173
|
}
|
|
2150
2174
|
return n2();
|
|
2151
2175
|
})();
|
|
2152
|
-
i2.promises.size >=
|
|
2176
|
+
i2.promises.size >= Ps && i2.promises.delete(i2.promises.keys().next().value);
|
|
2153
2177
|
let l2 = { promise: c2, expiresAt: 1 / 0 };
|
|
2154
2178
|
return i2.promises.set(e2, l2), c2.then(() => {
|
|
2155
|
-
l2.expiresAt = Date.now() +
|
|
2179
|
+
l2.expiresAt = Date.now() + Ns;
|
|
2156
2180
|
}, () => {
|
|
2157
2181
|
i2.promises.get(e2) === l2 && i2.promises.delete(e2);
|
|
2158
2182
|
}), c2;
|
|
2159
2183
|
}
|
|
2160
|
-
var
|
|
2161
|
-
async function
|
|
2184
|
+
var Ws = { displayTimeZonePolicy: { basedOn: Ba.BUSINESS_TIME_ZONE, customerCanChange: false }, multiServiceAppointmentsEnabled: false };
|
|
2185
|
+
async function Gs() {
|
|
2162
2186
|
try {
|
|
2163
|
-
let e2 = await
|
|
2164
|
-
return { displayTimeZonePolicy: { basedOn: e2.displayTimeZone?.basedOn ??
|
|
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 };
|
|
2165
2189
|
} catch (e2) {
|
|
2166
|
-
return
|
|
2190
|
+
return $(e2, { feature: xo.bookingsSettings, action: `fetch-bookings-settings`, level: `warning` }), Ws;
|
|
2167
2191
|
}
|
|
2168
2192
|
}
|
|
2169
|
-
var
|
|
2170
|
-
var
|
|
2171
|
-
var
|
|
2172
|
-
function
|
|
2173
|
-
let e2 = (0, import_react.useContext)(
|
|
2174
|
-
if (!e2) throw Error(
|
|
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);
|
|
2175
2199
|
return e2;
|
|
2176
2200
|
}
|
|
2177
|
-
function
|
|
2178
|
-
return e2.basedOn ===
|
|
2201
|
+
function Xs(e2) {
|
|
2202
|
+
return e2.basedOn === Ba.CUSTOMER_TIME_ZONE ? Intl.DateTimeFormat().resolvedOptions().timeZone : void 0;
|
|
2179
2203
|
}
|
|
2180
|
-
function
|
|
2181
|
-
let e2 =
|
|
2182
|
-
return e2.isLoading ? void 0 :
|
|
2204
|
+
function Zs() {
|
|
2205
|
+
let e2 = Ys();
|
|
2206
|
+
return e2.isLoading ? void 0 : Xs(e2.displayTimeZonePolicy);
|
|
2183
2207
|
}
|
|
2184
|
-
function
|
|
2185
|
-
let n2 =
|
|
2186
|
-
return (0, import_jsx_runtime.jsx)(
|
|
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 });
|
|
2187
2211
|
}
|
|
2188
|
-
function
|
|
2189
|
-
let r2 =
|
|
2190
|
-
return e2 ? (0, import_jsx_runtime.jsx)(
|
|
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 }) });
|
|
2191
2215
|
}
|
|
2192
|
-
var
|
|
2193
|
-
var
|
|
2216
|
+
var ec = 1e3;
|
|
2217
|
+
var tc = class extends import_react.Component {
|
|
2194
2218
|
state = { hasError: false };
|
|
2195
2219
|
static getDerivedStateFromError() {
|
|
2196
2220
|
return { hasError: true };
|
|
2197
2221
|
}
|
|
2198
2222
|
componentDidCatch(e2, t2) {
|
|
2199
|
-
|
|
2223
|
+
$(e2, { feature: this.props.feature ?? `service`, action: `render`, contexts: { react: { componentStack: t2.componentStack } } });
|
|
2200
2224
|
}
|
|
2201
2225
|
render() {
|
|
2202
2226
|
return this.state.hasError ? this.props.fallback : this.props.children;
|
|
2203
2227
|
}
|
|
2204
2228
|
};
|
|
2205
|
-
var
|
|
2206
|
-
function
|
|
2207
|
-
let t2 = e2.searchParams.get(
|
|
2229
|
+
var nc = `appSectionParams`;
|
|
2230
|
+
function rc(e2) {
|
|
2231
|
+
let t2 = e2.searchParams.get(nc);
|
|
2208
2232
|
if (t2 === null) return e2;
|
|
2209
2233
|
let n2 = new URL(e2);
|
|
2210
|
-
n2.searchParams.delete(
|
|
2211
|
-
for (let [e3, r2] of Object.entries(
|
|
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);
|
|
2212
2236
|
return n2;
|
|
2213
2237
|
}
|
|
2214
|
-
function
|
|
2238
|
+
function ic(e2) {
|
|
2215
2239
|
try {
|
|
2216
2240
|
let t2 = JSON.parse(e2);
|
|
2217
2241
|
return t2 && typeof t2 == `object` && !Array.isArray(t2) ? t2 : {};
|
|
@@ -2219,16 +2243,16 @@ function Xs(e2) {
|
|
|
2219
2243
|
return {};
|
|
2220
2244
|
}
|
|
2221
2245
|
}
|
|
2222
|
-
var
|
|
2223
|
-
var
|
|
2246
|
+
var ac = `bookings-uou:url-change`;
|
|
2247
|
+
var oc = (e2) => {
|
|
2224
2248
|
let t2 = new URL(e2);
|
|
2225
2249
|
return t2.searchParams.sort(), t2.href;
|
|
2226
2250
|
};
|
|
2227
|
-
function
|
|
2251
|
+
function sc(e2, { disableScrollToTop: t2, skipHistory: n2 } = {}) {
|
|
2228
2252
|
let r2 = globalThis.window;
|
|
2229
2253
|
if (!r2?.history) return;
|
|
2230
2254
|
let i2 = new URL(r2.location.href);
|
|
2231
|
-
if (
|
|
2255
|
+
if (oc(i2) === oc(e2)) return;
|
|
2232
2256
|
let a2 = { scrollY: r2.scrollY };
|
|
2233
2257
|
if (n2) r2.history.replaceState(a2, ``, e2.href);
|
|
2234
2258
|
else {
|
|
@@ -2239,82 +2263,82 @@ function $s(e2, { disableScrollToTop: t2, skipHistory: n2 } = {}) {
|
|
|
2239
2263
|
return;
|
|
2240
2264
|
}
|
|
2241
2265
|
}
|
|
2242
|
-
r2.dispatchEvent(new Event(
|
|
2266
|
+
r2.dispatchEvent(new Event(ac));
|
|
2243
2267
|
}
|
|
2244
|
-
function
|
|
2268
|
+
function cc(e2) {
|
|
2245
2269
|
let t2 = globalThis.window;
|
|
2246
|
-
return t2 ? (t2.addEventListener(
|
|
2247
|
-
t2.removeEventListener(
|
|
2270
|
+
return t2 ? (t2.addEventListener(ac, e2), t2.addEventListener(`popstate`, e2), () => {
|
|
2271
|
+
t2.removeEventListener(ac, e2), t2.removeEventListener(`popstate`, e2);
|
|
2248
2272
|
}) : () => {
|
|
2249
2273
|
};
|
|
2250
2274
|
}
|
|
2251
|
-
var
|
|
2275
|
+
var lc = (e2) => {
|
|
2252
2276
|
try {
|
|
2253
2277
|
return decodeURIComponent(e2);
|
|
2254
2278
|
} catch {
|
|
2255
2279
|
return e2;
|
|
2256
2280
|
}
|
|
2257
2281
|
};
|
|
2258
|
-
function
|
|
2282
|
+
function uc(e2, t2) {
|
|
2259
2283
|
let n2 = t2 ? new URL(t2).pathname : `/`;
|
|
2260
|
-
return `./${
|
|
2284
|
+
return `./${lc(new URL(e2).pathname.replace(n2, ``).replace(/^\/|\/$/g, ``))}`;
|
|
2261
2285
|
}
|
|
2262
|
-
function
|
|
2263
|
-
let e2 = (0, import_services_manager_react.useService)(
|
|
2264
|
-
return { pathname: i2.pathname, search: i2.search, searchParams: i2.searchParams, href: i2.href, getParsedUrl: () =>
|
|
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 };
|
|
2265
2289
|
}
|
|
2266
|
-
var
|
|
2267
|
-
function
|
|
2290
|
+
var fc = Pr(`@wix/site-service-business-logger`);
|
|
2291
|
+
function pc(e2) {
|
|
2268
2292
|
return { evid: 32, src: 16, endpoint: ``, params: e2 };
|
|
2269
2293
|
}
|
|
2270
|
-
function
|
|
2294
|
+
function mc(e2) {
|
|
2271
2295
|
return { evid: 33, src: 16, endpoint: ``, params: e2 };
|
|
2272
2296
|
}
|
|
2273
|
-
function
|
|
2297
|
+
function hc(e2) {
|
|
2274
2298
|
return { evid: 34, src: 16, endpoint: ``, params: e2 };
|
|
2275
2299
|
}
|
|
2276
|
-
var
|
|
2277
|
-
|
|
2278
|
-
var
|
|
2279
|
-
var
|
|
2280
|
-
var
|
|
2281
|
-
var
|
|
2282
|
-
let { reportBi: t2 } = (0, import_services_manager_react.useService)(
|
|
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);
|
|
2283
2307
|
return (0, import_react.useCallback)((n2) => {
|
|
2284
|
-
t2({ widget_name: e2, bookingsPlatform:
|
|
2308
|
+
t2({ widget_name: e2, bookingsPlatform: _c, is_over_editor: false, ...n2.params, src: n2.src, evid: n2.evid }, { endpoint: n2.endpoint });
|
|
2285
2309
|
}, [t2, e2]);
|
|
2286
2310
|
};
|
|
2287
|
-
var
|
|
2288
|
-
let n2 =
|
|
2311
|
+
var xc = (e2, t2 = true) => {
|
|
2312
|
+
let n2 = bc(e2), { getParsedUrl: r2 } = dc(), i2 = (0, import_react.useRef)(false);
|
|
2289
2313
|
(0, import_react.useEffect)(() => {
|
|
2290
|
-
t2 && !i2.current && (i2.current = true, n2(
|
|
2314
|
+
t2 && !i2.current && (i2.current = true, n2(pc({ referralInfo: r2().searchParams.get(Xa.referral) ?? void 0 })));
|
|
2291
2315
|
}, [t2, n2, r2]);
|
|
2292
2316
|
};
|
|
2293
|
-
function
|
|
2317
|
+
function Sc(e2) {
|
|
2294
2318
|
return { evid: 596, src: 16, endpoint: `wixboost-ugc`, params: e2 };
|
|
2295
2319
|
}
|
|
2296
|
-
function
|
|
2320
|
+
function Cc(e2, t2) {
|
|
2297
2321
|
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 = {};
|
|
2298
2322
|
for (let e3 of n2) e3.type !== `literal` && (r2[e3.type] = Number(e3.value));
|
|
2299
2323
|
return Date.UTC(r2.year, r2.month - 1, r2.day, r2.hour, r2.minute, r2.second) - e2;
|
|
2300
2324
|
}
|
|
2301
|
-
function
|
|
2325
|
+
function wc(e2, t2) {
|
|
2302
2326
|
let n2 = e2.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2}))?/);
|
|
2303
2327
|
if (!n2) return null;
|
|
2304
2328
|
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);
|
|
2305
2329
|
if (Number.isNaN(l2)) return null;
|
|
2306
2330
|
try {
|
|
2307
|
-
let e3 = l2 -
|
|
2308
|
-
return new Date(l2 -
|
|
2331
|
+
let e3 = l2 - Cc(l2, t2);
|
|
2332
|
+
return new Date(l2 - Cc(e3, t2));
|
|
2309
2333
|
} catch {
|
|
2310
2334
|
return null;
|
|
2311
2335
|
}
|
|
2312
2336
|
}
|
|
2313
|
-
function
|
|
2314
|
-
let i2 = (e3) => e3 && n2 ?
|
|
2315
|
-
return
|
|
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 });
|
|
2316
2340
|
}
|
|
2317
|
-
function
|
|
2341
|
+
function Ec({ nextAvailableSlotsCount: e2, isLoading: t2, hasError: n2, children: r2 }) {
|
|
2318
2342
|
let i2 = n2 ? `loadFailed` : null, a2 = { selectedDate: null, daysAvailabilityRange: null, daysAvailability: [], daysAvailabilityLoading: false, daysAvailabilityHasError: false, timeSlotsLoading: t2, timeSlotsErrorCode: i2, selectDate: async () => {
|
|
2319
2343
|
}, setDaysAvailabilityRange: async () => {
|
|
2320
2344
|
}, nextDaysAvailabilityRange: async () => {
|
|
@@ -2330,107 +2354,107 @@ function vc({ nextAvailableSlotsCount: e2, isLoading: t2, hasError: n2, children
|
|
|
2330
2354
|
}, navigateToBookingForm: () => {
|
|
2331
2355
|
}, timeSlotLimitPerDay: null, expandedDates: /* @__PURE__ */ new Set(), daysWithMore: /* @__PURE__ */ new Set(), loadingDate: null, loadAllTimeSlotsForDay: async () => {
|
|
2332
2356
|
} };
|
|
2333
|
-
return (0, import_jsx_runtime.jsx)(
|
|
2357
|
+
return (0, import_jsx_runtime.jsx)(El.Provider, { value: a2, children: r2 });
|
|
2334
2358
|
}
|
|
2335
|
-
function
|
|
2336
|
-
return (0, import_jsx_runtime.jsx)(
|
|
2359
|
+
function Dc({ nextAvailableSlotsCount: e2, children: t2 }) {
|
|
2360
|
+
return (0, import_jsx_runtime.jsx)(Ec, { nextAvailableSlotsCount: e2, isLoading: true, hasError: false, children: t2 });
|
|
2337
2361
|
}
|
|
2338
|
-
function
|
|
2339
|
-
return (0, import_jsx_runtime.jsx)(
|
|
2362
|
+
function Oc({ nextAvailableSlotsCount: e2, children: t2 }) {
|
|
2363
|
+
return (0, import_jsx_runtime.jsx)(Ec, { nextAvailableSlotsCount: e2, isLoading: false, hasError: true, children: t2 });
|
|
2340
2364
|
}
|
|
2341
|
-
var
|
|
2342
|
-
function
|
|
2365
|
+
var kc = 1e3;
|
|
2366
|
+
function Ac(e2, t2) {
|
|
2343
2367
|
let n2 = /* @__PURE__ */ new Map();
|
|
2344
2368
|
for (let e3 of t2) {
|
|
2345
2369
|
let t3 = e3.localStartDate?.slice(0, 10);
|
|
2346
2370
|
t3 && (e3.bookable ? n2.set(t3, `available`) : n2.has(t3) || n2.set(t3, `unavailable`));
|
|
2347
2371
|
}
|
|
2348
|
-
let r2 = [], i2 =
|
|
2372
|
+
let r2 = [], i2 = Fo(e2);
|
|
2349
2373
|
for (let t3 = 0; t3 < i2; t3 += 1) {
|
|
2350
|
-
let i3 =
|
|
2374
|
+
let i3 = Po(e2.startDate, t3);
|
|
2351
2375
|
r2.push({ date: i3, availability: n2.get(i3) ?? `none` });
|
|
2352
2376
|
}
|
|
2353
2377
|
return r2;
|
|
2354
2378
|
}
|
|
2355
|
-
function
|
|
2356
|
-
return { fromLocalDate:
|
|
2379
|
+
function jc(e2, t2) {
|
|
2380
|
+
return { fromLocalDate: ko(e2.startDate, t2), toLocalDate: Do(wo(e2.endDate)) };
|
|
2357
2381
|
}
|
|
2358
|
-
async function
|
|
2359
|
-
return (await
|
|
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 ?? [];
|
|
2360
2384
|
}
|
|
2361
|
-
async function
|
|
2362
|
-
return (await
|
|
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;
|
|
2363
2387
|
}
|
|
2364
|
-
async function
|
|
2365
|
-
if (
|
|
2366
|
-
let l2 = { startDate: n2.startDate < r2 ? r2 : n2.startDate, endDate: n2.endDate }, u2 =
|
|
2367
|
-
return
|
|
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());
|
|
2368
2392
|
}
|
|
2369
|
-
function
|
|
2393
|
+
function Fc({ serviceId: e2, staff: t2, customerChoices: n2 }) {
|
|
2370
2394
|
let r2 = t2 && !t2.anyResource ? t2.staffMemberId : void 0;
|
|
2371
|
-
return { serviceId: e2, ...
|
|
2395
|
+
return { serviceId: e2, ...Zo(n2, r2), ...t2?.anyResource ? {} : { includeResourceTypeIds: [Ur] }, ...r2 ? { resourceTypes: [{ resourceTypeId: Ur, resourceIds: [r2] }] } : {} };
|
|
2372
2396
|
}
|
|
2373
|
-
function
|
|
2374
|
-
return { services: e2.map(
|
|
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 } };
|
|
2375
2399
|
}
|
|
2376
|
-
function
|
|
2377
|
-
let { customerChoices: t2, ...n2 } = e2, r2 = t2 ?
|
|
2400
|
+
function Lc(e2) {
|
|
2401
|
+
let { customerChoices: t2, ...n2 } = e2, r2 = t2 ? Xo(t2) : void 0;
|
|
2378
2402
|
return r2 ? { ...n2, customerChoices: r2 } : n2;
|
|
2379
2403
|
}
|
|
2380
|
-
async function
|
|
2381
|
-
let t2 = e2.services ?? [], n2 = () =>
|
|
2382
|
-
if (r2 &&
|
|
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();
|
|
2383
2407
|
try {
|
|
2384
|
-
return await
|
|
2408
|
+
return await wa(e2);
|
|
2385
2409
|
} catch (e3) {
|
|
2386
|
-
if (!r2 ||
|
|
2387
|
-
return
|
|
2410
|
+
if (!r2 || !$o(e3)) throw e3;
|
|
2411
|
+
return $(e3, { feature: xo.timeSlots, action: `requested-gender-rejected`, level: `warning` }), is(), n2();
|
|
2388
2412
|
}
|
|
2389
2413
|
}
|
|
2390
|
-
var
|
|
2391
|
-
async function
|
|
2392
|
-
if (e2.endDate < t2) return
|
|
2414
|
+
var zc = 1e3;
|
|
2415
|
+
async function Bc({ range: e2, fromDate: t2, ...n2 }) {
|
|
2416
|
+
if (e2.endDate < t2) return Ac(e2, []);
|
|
2393
2417
|
let r2 = { startDate: e2.startDate < t2 ? t2 : e2.startDate, endDate: e2.endDate };
|
|
2394
|
-
return
|
|
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 ?? []);
|
|
2395
2419
|
}
|
|
2396
|
-
async function
|
|
2420
|
+
async function Vc({ date: e2, onlyAvailableSlots: t2, fromLocalDate: n2, ...r2 }) {
|
|
2397
2421
|
let i2 = `${e2}T00:00:00`, a2 = [], o2 = null, s2;
|
|
2398
2422
|
do {
|
|
2399
|
-
let c2 = await
|
|
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 } : {} } });
|
|
2400
2424
|
a2.push(...c2.timeSlots ?? []), o2 = c2.timeZone ?? o2, s2 = c2.cursorPagingMetadata?.cursors?.next || void 0;
|
|
2401
2425
|
} while (s2);
|
|
2402
2426
|
return { timeSlots: a2, timeZone: o2 };
|
|
2403
2427
|
}
|
|
2404
|
-
async function
|
|
2405
|
-
let n2 = await
|
|
2428
|
+
async function Hc({ fromDate: e2, ...t2 }) {
|
|
2429
|
+
let n2 = await Rc({ ...Ic(t2), ...fs(e2), bookable: true, cursorPaging: { limit: 1 } });
|
|
2406
2430
|
return { timeSlots: n2.timeSlots ?? [], timeZone: n2.timeZone ?? null };
|
|
2407
2431
|
}
|
|
2408
|
-
var
|
|
2409
|
-
function
|
|
2410
|
-
let [_2, v2] = (0, import_react.useState)(null), [y2, b2] = (0, import_react.useState)(p2), [x2, S2] = (0, import_react.useState)(
|
|
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);
|
|
2411
2435
|
(0, import_react.useEffect)(() => {
|
|
2412
|
-
_2 === null && u2 && v2(
|
|
2436
|
+
_2 === null && u2 && v2(Io(u2));
|
|
2413
2437
|
}, [_2, u2]), (0, import_react.useEffect)(() => {
|
|
2414
|
-
if (!y2 || !e2 || !(t2 || i2) || !l2 || !u2 || !_2 || !i2 &&
|
|
2438
|
+
if (!y2 || !e2 || !(t2 || i2) || !l2 || !u2 || !_2 || !i2 && Ya(n2)) return;
|
|
2415
2439
|
let r2 = ++E2.current;
|
|
2416
|
-
return w2(true), (i2 ?
|
|
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) => {
|
|
2417
2441
|
r2 === E2.current && (S2(e3), ee2(false), w2(false));
|
|
2418
2442
|
}).catch((e3) => {
|
|
2419
|
-
r2 === E2.current && (
|
|
2443
|
+
r2 === E2.current && ($(e3, { feature: xo.timeSlots, action: `fetch-days-availability`, level: `warning` }), ee2(true), w2(false));
|
|
2420
2444
|
}), () => {
|
|
2421
2445
|
r2 === E2.current && (E2.current += 1);
|
|
2422
2446
|
};
|
|
2423
2447
|
}, [y2, e2, t2, n2, i2, l2, u2, _2, d2, f2, m2, h2]);
|
|
2424
2448
|
let D2 = (0, import_react.useCallback)(async (e3) => {
|
|
2425
|
-
|
|
2449
|
+
No(e3) && (v2(e3), b2(true));
|
|
2426
2450
|
}, []), O2 = (0, import_react.useCallback)(async () => {
|
|
2427
|
-
v2((e3) => e3 &&
|
|
2451
|
+
v2((e3) => e3 && Ro(e3, 1)), b2(true);
|
|
2428
2452
|
}, []), te2 = (0, import_react.useCallback)(async () => {
|
|
2429
|
-
v2((e3) => e3 &&
|
|
2453
|
+
v2((e3) => e3 && Ro(e3, -1)), b2(true);
|
|
2430
2454
|
}, []);
|
|
2431
2455
|
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 };
|
|
2432
2456
|
}
|
|
2433
|
-
function
|
|
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 }) {
|
|
2434
2458
|
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)(() => {
|
|
2435
2459
|
O2.current += 1, E2(false);
|
|
2436
2460
|
}, []);
|
|
@@ -2451,99 +2475,99 @@ function Lc({ enabled: e2, serviceId: t2, serviceType: n2, multiServiceRequest:
|
|
|
2451
2475
|
_2(null);
|
|
2452
2476
|
return;
|
|
2453
2477
|
}
|
|
2454
|
-
if (!i2 &&
|
|
2478
|
+
if (!i2 && Ya(n2)) {
|
|
2455
2479
|
_2(null);
|
|
2456
2480
|
return;
|
|
2457
2481
|
}
|
|
2458
|
-
let r2 =
|
|
2482
|
+
let r2 = Oo(new Date(Date.now()), o2), a2 = ++D2.current;
|
|
2459
2483
|
x2(null), C2(null), T2(null);
|
|
2460
2484
|
let s2 = r2.slice(0, 10) === g2.date ? r2 : void 0;
|
|
2461
|
-
return (i2 ?
|
|
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) => {
|
|
2462
2486
|
a2 === D2.current && x2({ timeSlots: e3.timeSlots, timeZone: e3.timeZone ?? o2 });
|
|
2463
2487
|
}).catch((e3) => {
|
|
2464
|
-
a2 === D2.current && (
|
|
2488
|
+
a2 === D2.current && ($(e3, { feature: xo.timeSlots, action: `fetch-day-time-slots`, level: `warning` }), C2(`timeSlotsLoadFailed`));
|
|
2465
2489
|
}), () => {
|
|
2466
2490
|
a2 === D2.current && (D2.current += 1);
|
|
2467
2491
|
};
|
|
2468
2492
|
}, [g2, v2, e2, t2, h2, n2, i2, o2, l2, u2, d2, f2, p2, m2]);
|
|
2469
2493
|
let ne2 = (0, import_react.useCallback)(async (e3) => {
|
|
2470
|
-
!i2 &&
|
|
2494
|
+
!i2 && Ya(n2) || !Mo(e3) || l2 && e3 < l2 || (k2(), y2((e4) => e4 + 1), _2({ kind: `day`, date: e3 }));
|
|
2471
2495
|
}, [n2, i2, l2, k2]), re2 = g2?.date ?? null, j2 = (0, import_react.useCallback)(async () => {
|
|
2472
2496
|
let r2 = !!(t2 || i2);
|
|
2473
|
-
if (!i2 &&
|
|
2497
|
+
if (!i2 && Ya(n2) || !e2 || !r2 || !o2) return { outcome: `none` };
|
|
2474
2498
|
let a2 = D2.current, s2 = ++O2.current, c2 = ++te2.current, m3 = () => a2 === D2.current && s2 === O2.current;
|
|
2475
2499
|
E2(true), T2(null);
|
|
2476
2500
|
try {
|
|
2477
|
-
let e3 = re2 ?? l2 ?? void 0, r3 = i2 ? await
|
|
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 });
|
|
2478
2502
|
if (!m3()) return { outcome: `cancelled` };
|
|
2479
2503
|
let a3 = r3.timeSlots[0]?.localStartDate?.slice(0, 10) ?? null;
|
|
2480
2504
|
return a3 ? { outcome: `found`, date: a3 } : { outcome: `none` };
|
|
2481
2505
|
} catch (e3) {
|
|
2482
|
-
return m3() ? (
|
|
2506
|
+
return m3() ? ($(e3, { feature: xo.timeSlots, action: `find-next-available-date`, level: `warning` }), T2(`timeSlotsLoadFailed`), { outcome: `error` }) : { outcome: `cancelled` };
|
|
2483
2507
|
} finally {
|
|
2484
2508
|
c2 === te2.current && E2(false);
|
|
2485
2509
|
}
|
|
2486
2510
|
}, [e2, t2, n2, i2, o2, l2, u2, d2, f2, p2, re2]), ie2 = w2 ?? S2;
|
|
2487
2511
|
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 };
|
|
2488
2512
|
}
|
|
2489
|
-
function
|
|
2513
|
+
function Kc(e2, t2) {
|
|
2490
2514
|
return t2 === void 0 ? false : !e2 || new Date(e2).getTime() <= t2;
|
|
2491
2515
|
}
|
|
2492
|
-
function
|
|
2493
|
-
let d2 = { serviceId: e2, onlyAvailableSlots: a2, locationId: o2 ?? void 0, staffId: s2 ?? void 0, timeZone: r2, fromLocalDate:
|
|
2494
|
-
return
|
|
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 };
|
|
2495
2519
|
}
|
|
2496
|
-
function
|
|
2520
|
+
function Jc({ isAppointment: e2, staffOnSlotCount: t2, hasStaffFilter: n2, hasRequestedGender: r2, hasStaffPricedVariants: i2, staffSelectionStrategy: a2 }) {
|
|
2497
2521
|
return e2 && t2 > 1 && !n2 && !i2 && (a2 !== `CUSTOMER_MUST_CHOOSE` || r2);
|
|
2498
2522
|
}
|
|
2499
|
-
function
|
|
2523
|
+
function Yc(e2, t2) {
|
|
2500
2524
|
return e2.length ? e2.length === 1 ? { anyResource: false, staffMemberId: e2[0] } : t2 ? { anyResource: true } : null : null;
|
|
2501
2525
|
}
|
|
2502
|
-
function
|
|
2526
|
+
function Xc(e2, t2, n2) {
|
|
2503
2527
|
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 };
|
|
2504
2528
|
}
|
|
2505
|
-
var
|
|
2506
|
-
function
|
|
2507
|
-
if (!e2) return
|
|
2508
|
-
let c2 = e2.locationId && s2.includes(e2.locationId) ? e2.locationId : null, l2 = t2 && !n2 ?
|
|
2509
|
-
if (!l2) return { ...
|
|
2510
|
-
if (!l2.anyResource) return o2.includes(l2.staffMemberId) ? { staff: l2, requestedGender: null, locationId: c2 } : { ...
|
|
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 };
|
|
2511
2535
|
let u2 = a2 ? e2.requestedGender ?? null : null;
|
|
2512
|
-
return o2.length > 1 && !r2 && (i2 !== `CUSTOMER_MUST_CHOOSE` || u2 !== null) ? { staff: l2, requestedGender: u2, locationId: c2 } : { ...
|
|
2536
|
+
return o2.length > 1 && !r2 && (i2 !== `CUSTOMER_MUST_CHOOSE` || u2 !== null) ? { staff: l2, requestedGender: u2, locationId: c2 } : { ...Zc, locationId: c2 };
|
|
2513
2537
|
}
|
|
2514
|
-
var
|
|
2515
|
-
function
|
|
2516
|
-
let s2 =
|
|
2517
|
-
return { rows: t2 ? c2 :
|
|
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) };
|
|
2518
2542
|
}
|
|
2519
|
-
function
|
|
2520
|
-
return [...e2.filter((e3) => t2(e3) === n2)].sort((e3, t3) =>
|
|
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;
|
|
2521
2545
|
}
|
|
2522
|
-
function
|
|
2523
|
-
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:
|
|
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) };
|
|
2524
2548
|
}
|
|
2525
|
-
function
|
|
2549
|
+
function rl(e2) {
|
|
2526
2550
|
let t2 = /* @__PURE__ */ new Map();
|
|
2527
2551
|
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 ?? ``);
|
|
2528
2552
|
return [...t2].map(([e3, t3]) => ({ staffMemberId: e3, name: t3 }));
|
|
2529
2553
|
}
|
|
2530
|
-
function
|
|
2531
|
-
let t2 =
|
|
2554
|
+
function il(e2) {
|
|
2555
|
+
let t2 = rl(e2);
|
|
2532
2556
|
if (t2.length) return t2.length === 1 ? t2[0].staffMemberId : null;
|
|
2533
2557
|
}
|
|
2534
|
-
function
|
|
2535
|
-
return
|
|
2558
|
+
function al(e2) {
|
|
2559
|
+
return rl(e2).map((e3) => e3.staffMemberId);
|
|
2536
2560
|
}
|
|
2537
|
-
function
|
|
2561
|
+
function ol(e2, t2) {
|
|
2538
2562
|
if (!e2.localStartDate || !e2.localEndDate) return null;
|
|
2539
|
-
let n2 = e2.allDay ? `UTC` : t2 ?? `UTC`, r2 =
|
|
2563
|
+
let n2 = e2.allDay ? `UTC` : t2 ?? `UTC`, r2 = wc(e2.localStartDate, n2), i2 = wc(e2.localEndDate, n2);
|
|
2540
2564
|
return !r2 || !i2 || i2 < r2 ? null : Math.round((i2.getTime() - r2.getTime()) / 6e4);
|
|
2541
2565
|
}
|
|
2542
|
-
function
|
|
2566
|
+
function sl(e2) {
|
|
2543
2567
|
let t2 = e2.bookableCapacity ?? e2.remainingCapacity;
|
|
2544
2568
|
return (e2.eventInfo?.waitingList?.remainingCapacity ?? 0) > 0 && (t2 ?? 0) <= 0 ? 1 : e2.bookable ? 2 : 0;
|
|
2545
2569
|
}
|
|
2546
|
-
function
|
|
2570
|
+
function cl(e2, t2, n2) {
|
|
2547
2571
|
let r2 = /* @__PURE__ */ new Map();
|
|
2548
2572
|
for (let t3 of e2) {
|
|
2549
2573
|
let e3 = (t3.localStartDate ?? ``).slice(0, 10);
|
|
@@ -2551,16 +2575,16 @@ function el(e2, t2, n2) {
|
|
|
2551
2575
|
}
|
|
2552
2576
|
return new Set([...r2].filter(([e3, r3]) => r3 > t2 && !n2.has(e3)).map(([e3]) => e3));
|
|
2553
2577
|
}
|
|
2554
|
-
function
|
|
2578
|
+
function ll(e2) {
|
|
2555
2579
|
return e2.flatMap((e3) => {
|
|
2556
|
-
let t2 = e3.availableResources?.find((e4) => e4.resourceTypeId ===
|
|
2580
|
+
let t2 = e3.availableResources?.find((e4) => e4.resourceTypeId === Ur), n2 = t2?.resources ?? [];
|
|
2557
2581
|
return n2.length <= 1 ? [e3] : n2.map((n3) => ({ ...e3, availableResources: [{ ...t2, resources: [n3] }] }));
|
|
2558
2582
|
});
|
|
2559
2583
|
}
|
|
2560
|
-
function
|
|
2584
|
+
function ul(e2, t2) {
|
|
2561
2585
|
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;
|
|
2562
2586
|
}
|
|
2563
|
-
function
|
|
2587
|
+
function dl(e2, t2, n2) {
|
|
2564
2588
|
let r2 = /* @__PURE__ */ new Map();
|
|
2565
2589
|
return e2.filter((e3) => {
|
|
2566
2590
|
let i2 = (e3.localStartDate ?? ``).slice(0, 10);
|
|
@@ -2569,21 +2593,21 @@ function rl(e2, t2, n2) {
|
|
|
2569
2593
|
return r2.set(i2, a2 + 1), a2 < t2;
|
|
2570
2594
|
});
|
|
2571
2595
|
}
|
|
2572
|
-
async function
|
|
2596
|
+
async function fl() {
|
|
2573
2597
|
try {
|
|
2574
|
-
return await
|
|
2598
|
+
return await Uo();
|
|
2575
2599
|
} catch (e2) {
|
|
2576
|
-
return
|
|
2600
|
+
return $(e2, { feature: xo.timeSlots, action: `fetch-business-time-zone`, level: `warning` }), { businessTimeZone: null, staffSelectionStrategy: void 0, allowGenderSelection: false };
|
|
2577
2601
|
}
|
|
2578
2602
|
}
|
|
2579
|
-
function
|
|
2580
|
-
return
|
|
2603
|
+
function pl(e2) {
|
|
2604
|
+
return Us({ key: Ms(), warmupData: e2, fetchData: fl });
|
|
2581
2605
|
}
|
|
2582
|
-
function
|
|
2606
|
+
function ml(e2) {
|
|
2583
2607
|
return (e2.localStartDate ?? ``).slice(0, 10);
|
|
2584
2608
|
}
|
|
2585
|
-
var
|
|
2586
|
-
function
|
|
2609
|
+
var hl = [];
|
|
2610
|
+
function gl(e2, t2) {
|
|
2587
2611
|
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);
|
|
2588
2612
|
(0, import_react.useEffect)(() => {
|
|
2589
2613
|
if (_2([]), y2([]), x2(1), E2(null), T2(null), O2(/* @__PURE__ */ new Set()), k2(null), C2(!!n2), !n2) return;
|
|
@@ -2601,7 +2625,7 @@ function cl(e2, t2) {
|
|
|
2601
2625
|
let a3 = [], b3 = null, S3 = v4 ?? void 0, C3 = /* @__PURE__ */ new Set();
|
|
2602
2626
|
do {
|
|
2603
2627
|
S3 && C3.add(S3);
|
|
2604
|
-
let s3 = await
|
|
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 });
|
|
2605
2629
|
if (t3) return;
|
|
2606
2630
|
if (a3.push(...s3.timeSlots), b3 = s3.nextCursor, b3 && C3.has(b3)) throw Error(`The session API repeated a page cursor`);
|
|
2607
2631
|
S3 = b3 ?? void 0, E2(s3.timeZone ?? l2 ?? null);
|
|
@@ -2609,7 +2633,7 @@ function cl(e2, t2) {
|
|
|
2609
2633
|
s2 = [...s2, a3], c2 = [...c2, b3], _2(s2), y2(c2), (g4 === 1 || a3.length > 0) && x2(g4);
|
|
2610
2634
|
} catch (e3) {
|
|
2611
2635
|
if (t3) return;
|
|
2612
|
-
|
|
2636
|
+
$(e3, { feature: xo.sessions, action: `fetch-page` }), T2(e3 instanceof Error ? e3.message : `Failed to load sessions`);
|
|
2613
2637
|
} finally {
|
|
2614
2638
|
a2 = false, t3 || C2(false);
|
|
2615
2639
|
}
|
|
@@ -2623,16 +2647,16 @@ function cl(e2, t2) {
|
|
|
2623
2647
|
}
|
|
2624
2648
|
a2 = true, k2(e3), T2(null);
|
|
2625
2649
|
try {
|
|
2626
|
-
let a3 = await
|
|
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 });
|
|
2627
2651
|
if (t3) return;
|
|
2628
|
-
let c3 = a3.timeSlots.filter((t4) =>
|
|
2652
|
+
let c3 = a3.timeSlots.filter((t4) => ml(t4) === e3), h3 = Math.max(0, s2.findIndex((t4) => t4.some((t5) => ml(t5) === e3)));
|
|
2629
2653
|
s2 = s2.map((t4, n3) => {
|
|
2630
|
-
let r3 = t4.filter((t5) =>
|
|
2654
|
+
let r3 = t4.filter((t5) => ml(t5) !== e3);
|
|
2631
2655
|
return n3 === h3 ? [...r3, ...c3] : r3;
|
|
2632
2656
|
}), _2(s2), O2((t4) => /* @__PURE__ */ new Set([...t4, e3]));
|
|
2633
2657
|
} catch (e4) {
|
|
2634
2658
|
if (t3) return;
|
|
2635
|
-
|
|
2659
|
+
$(e4, { feature: xo.sessions, action: `fetch-day` }), T2(e4 instanceof Error ? e4.message : `Failed to load sessions`);
|
|
2636
2660
|
} finally {
|
|
2637
2661
|
a2 = false, t3 || k2(null);
|
|
2638
2662
|
}
|
|
@@ -2642,168 +2666,177 @@ function cl(e2, t2) {
|
|
|
2642
2666
|
t3 = true, A2.current = null, ne2.current = null;
|
|
2643
2667
|
};
|
|
2644
2668
|
}, [n2, r2, i2, o2, l2, u2, d2, f2, p2, m2, h2, e2]);
|
|
2645
|
-
let re2 = [...g2[b2 - 1] ??
|
|
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;
|
|
2646
2670
|
async function ae2() {
|
|
2647
2671
|
ie2 && !S2 && await A2.current?.(b2 + 1);
|
|
2648
2672
|
}
|
|
2649
|
-
function
|
|
2673
|
+
function oe2() {
|
|
2650
2674
|
M2 && !S2 && A2.current?.(b2 - 1);
|
|
2651
2675
|
}
|
|
2652
|
-
async function
|
|
2676
|
+
async function se2(e3) {
|
|
2653
2677
|
S2 || te2 !== null || D2.has(e3) || await ne2.current?.(e3);
|
|
2654
2678
|
}
|
|
2655
|
-
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:
|
|
2679
|
+
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 };
|
|
2656
2680
|
}
|
|
2657
|
-
var
|
|
2658
|
-
function
|
|
2681
|
+
var _l = (e2) => e2?.onlineBooking?.enabled === true;
|
|
2682
|
+
function vl(e2) {
|
|
2659
2683
|
return !!e2?._id;
|
|
2660
2684
|
}
|
|
2661
|
-
function
|
|
2685
|
+
function yl(e2, t2) {
|
|
2662
2686
|
return e2 ? e2.anyResource ? t2 ?? `` : e2.staffMemberId : null;
|
|
2663
2687
|
}
|
|
2664
|
-
var
|
|
2665
|
-
var
|
|
2666
|
-
var
|
|
2667
|
-
var
|
|
2668
|
-
var
|
|
2688
|
+
var bl = [];
|
|
2689
|
+
var xl = [];
|
|
2690
|
+
var Sl = sn.map((e2) => ({ id: e2, gender: e2 }));
|
|
2691
|
+
var Cl = { isSelectionValidated: false };
|
|
2692
|
+
var wl = () => {
|
|
2669
2693
|
};
|
|
2670
|
-
var
|
|
2694
|
+
var Tl = async () => {
|
|
2671
2695
|
};
|
|
2672
|
-
var
|
|
2673
|
-
function
|
|
2674
|
-
let e2 = (0, import_react.useContext)(
|
|
2696
|
+
var El = (0, import_react.createContext)(null);
|
|
2697
|
+
function Dl() {
|
|
2698
|
+
let e2 = (0, import_react.useContext)(El);
|
|
2675
2699
|
if (!e2) throw Error(`useTimeSlotsContext must be used within TimeSlotsContextProvider`);
|
|
2676
2700
|
return e2;
|
|
2677
2701
|
}
|
|
2678
|
-
function
|
|
2702
|
+
function Ol(e2, t2, n2) {
|
|
2679
2703
|
e2 ? t2() : n2();
|
|
2680
2704
|
}
|
|
2681
|
-
var
|
|
2682
|
-
function
|
|
2683
|
-
return Math.min(Math.max(e2, 1),
|
|
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);
|
|
2684
2708
|
}
|
|
2685
|
-
function
|
|
2709
|
+
function jl(e2) {
|
|
2686
2710
|
let { isLoading: n2, bookingsSettingsLoading: r2 } = (0, import_service.useServiceContext)();
|
|
2687
|
-
|
|
2688
|
-
let i2 =
|
|
2689
|
-
return (0, import_jsx_runtime.jsx)(
|
|
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 }) }) });
|
|
2690
2714
|
}
|
|
2691
|
-
function
|
|
2715
|
+
function Ml(e2) {
|
|
2692
2716
|
let [t2, n2] = (0, import_react.useState)({ serviceId: e2, key: 0 });
|
|
2693
2717
|
return e2 !== t2.serviceId && n2({ serviceId: e2, key: t2.serviceId ? t2.key + 1 : t2.key }), t2.key;
|
|
2694
2718
|
}
|
|
2695
|
-
function
|
|
2696
|
-
let s2 =
|
|
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);
|
|
2697
2721
|
(0, import_react.useEffect)(() => y2(true), []);
|
|
2698
|
-
let b2 = v2 && !s2, x2 =
|
|
2699
|
-
return (0, import_jsx_runtime.jsx)(
|
|
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);
|
|
2700
2724
|
}
|
|
2701
|
-
function
|
|
2702
|
-
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:
|
|
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) => {
|
|
2703
2727
|
je2.current.push(e3);
|
|
2704
|
-
})), []), Pe2 = i2 ? Intl.DateTimeFormat().resolvedOptions().timeZone : null, Fe2 =
|
|
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);
|
|
2705
2729
|
Re2.current = Le2;
|
|
2706
|
-
let ze2 = Le2 && !Le2.anyResource ? Le2.staffMemberId : null, Be2 = te2.requestedGender ?? null, L2 = !
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
}, [
|
|
2711
|
-
let
|
|
2712
|
-
|
|
2713
|
-
}, [lt2]),
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
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);
|
|
2718
2751
|
(0, import_react.useEffect)(() => {
|
|
2719
|
-
if (
|
|
2720
|
-
|
|
2752
|
+
if (fn2.current) {
|
|
2753
|
+
fn2.current = false;
|
|
2721
2754
|
return;
|
|
2722
2755
|
}
|
|
2723
|
-
Oe2(null), Ie2.current &&
|
|
2724
|
-
}, [
|
|
2725
|
-
let
|
|
2726
|
-
let e3 = await
|
|
2727
|
-
return e3.outcome === `found` ?
|
|
2728
|
-
}, [
|
|
2729
|
-
|
|
2730
|
-
let e3 =
|
|
2731
|
-
return
|
|
2732
|
-
}, []),
|
|
2733
|
-
|
|
2734
|
-
}, [
|
|
2735
|
-
let t3 =
|
|
2736
|
-
|
|
2737
|
-
|
|
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);
|
|
2738
2771
|
});
|
|
2739
|
-
}, [
|
|
2740
|
-
if (
|
|
2741
|
-
|
|
2772
|
+
}, [mn2]), Dn2 = (0, import_react.useCallback)(() => G2 ? Promise.resolve(`none`) : new Promise((e3) => {
|
|
2773
|
+
if (hn2 && !bn2.current) {
|
|
2774
|
+
En2([...Cn2(), e3]);
|
|
2742
2775
|
return;
|
|
2743
2776
|
}
|
|
2744
|
-
|
|
2745
|
-
}), [
|
|
2777
|
+
xn2.current.push(e3), _n2(true);
|
|
2778
|
+
}), [G2, hn2, En2, Cn2]);
|
|
2746
2779
|
(0, import_react.useEffect)(() => {
|
|
2747
|
-
if (
|
|
2748
|
-
if (
|
|
2749
|
-
|
|
2780
|
+
if (gn2 && !bn2.current) {
|
|
2781
|
+
if (G2) {
|
|
2782
|
+
Cn2().forEach((e3) => e3(`none`));
|
|
2750
2783
|
return;
|
|
2751
2784
|
}
|
|
2752
|
-
|
|
2785
|
+
hn2 && En2(Cn2());
|
|
2753
2786
|
}
|
|
2754
|
-
}, [
|
|
2755
|
-
let
|
|
2756
|
-
Me2.current =
|
|
2757
|
-
if (!
|
|
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;
|
|
2758
2791
|
let e3 = je2.current;
|
|
2759
2792
|
je2.current = [], e3.forEach((e4) => e4());
|
|
2760
|
-
}, [
|
|
2761
|
-
let
|
|
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) => {
|
|
2762
2795
|
if (!t3.bookable) {
|
|
2763
|
-
|
|
2796
|
+
pn2.current = null;
|
|
2764
2797
|
return;
|
|
2765
2798
|
}
|
|
2766
|
-
if (e3 ===
|
|
2767
|
-
|
|
2768
|
-
let n3 =
|
|
2769
|
-
!
|
|
2770
|
-
}, [
|
|
2799
|
+
if (e3 === pn2.current) return;
|
|
2800
|
+
pn2.current = e3;
|
|
2801
|
+
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) => {
|
|
2771
2804
|
if (e3 === null) {
|
|
2772
2805
|
let e4 = Ie2.current !== null;
|
|
2773
|
-
Ie2.current = null,
|
|
2806
|
+
Ie2.current = null, pn2.current = null, Oe2(null), e4 && Ol(P2, T2, E2);
|
|
2774
2807
|
return;
|
|
2775
2808
|
}
|
|
2776
|
-
let t3 =
|
|
2809
|
+
let t3 = tl(Fn2, e3);
|
|
2777
2810
|
if (!t3) return;
|
|
2778
2811
|
if (I2) {
|
|
2779
|
-
if (!ee2(t3.nestedTimeSlots ?? [],
|
|
2780
|
-
Ie2.current = t3, Oe2(t3),
|
|
2812
|
+
if (!ee2(t3.nestedTimeSlots ?? [], U2 ?? void 0)) return;
|
|
2813
|
+
Ie2.current = t3, Oe2(t3), Wn2(e3, t3);
|
|
2781
2814
|
return;
|
|
2782
2815
|
}
|
|
2783
|
-
Ie2.current = t3, Oe2(t3),
|
|
2784
|
-
let n3 =
|
|
2785
|
-
if (w2(
|
|
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;
|
|
2786
2819
|
let r2 = Re2.current, i3;
|
|
2787
|
-
i3 = z2 || (
|
|
2788
|
-
}, [I2,
|
|
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)(() => {
|
|
2789
2822
|
let e3 = Ie2.current;
|
|
2790
|
-
if (!e3 ||
|
|
2823
|
+
if (!e3 || N2) return;
|
|
2791
2824
|
if (I2) {
|
|
2792
|
-
O2(
|
|
2825
|
+
O2(q2);
|
|
2793
2826
|
return;
|
|
2794
2827
|
}
|
|
2795
|
-
if (!
|
|
2828
|
+
if (!P2) return;
|
|
2796
2829
|
let t3;
|
|
2797
2830
|
if (L2) {
|
|
2798
|
-
let n4 =
|
|
2831
|
+
let n4 = al(e3), r2 = Xc(n4, Ht2(Re2.current), Vt2(n4.length));
|
|
2799
2832
|
t3 = (r2.isComplete ? r2.resourceId : n4[0]) ?? (n4.length ? null : void 0);
|
|
2800
2833
|
}
|
|
2801
|
-
let n3 = Ee2(`bookingForm`, { slug: x2?.mainSlug?.name ?? null, serviceId:
|
|
2802
|
-
e3.bookable &&
|
|
2803
|
-
}, [
|
|
2804
|
-
return (0, import_jsx_runtime.jsx)(
|
|
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 });
|
|
2805
2838
|
}
|
|
2806
|
-
var
|
|
2839
|
+
var Fl = on(`4936242d-905c-48bf-80ce-5f56d075de4f`);
|
|
2807
2840
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2808
2841
|
0 && (module.exports = {
|
|
2809
2842
|
TimeSlotsContextProvider,
|