@wix/bookings 1.0.1750 → 1.0.1751
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.js +2 -0
- package/_sdk-exports/context-categories/runtime.js +1 -0
- package/_sdk-exports/context-locations/runtime.js +1 -0
- package/_sdk-exports/{context-service-context → context-service}/runtime.d.ts +1 -1
- package/_sdk-exports/{context-service-context → context-service}/runtime.js +2 -2
- package/_sdk-exports/context-service-addons/runtime.js +1 -0
- package/_sdk-exports/context-services/runtime.js +2 -0
- package/_sdk-exports/context-time-slots/runtime.js +2 -0
- package/build/cjs/{context-booking-checkout-context.js → context-booking-checkout.js} +909 -925
- package/build/cjs/context-booking-checkout.js.map +1 -0
- package/build/cjs/{context-categories-context.js → context-categories.js} +287 -293
- package/build/cjs/context-categories.js.map +1 -0
- package/build/cjs/{context-locations-context.js → context-locations.js} +362 -368
- package/build/cjs/context-locations.js.map +1 -0
- package/build/cjs/{context-service-addons-context.js → context-service-addons.js} +424 -430
- package/build/cjs/context-service-addons.js.map +1 -0
- package/build/cjs/{context-service-context.d.ts → context-service.d.ts} +1 -1
- package/build/cjs/{context-service-context.js → context-service.js} +964 -977
- package/build/cjs/context-service.js.map +1 -0
- package/build/cjs/{context-services-context.js → context-services.js} +600 -611
- package/build/cjs/context-services.js.map +1 -0
- package/build/cjs/{context-time-slots-context.js → context-time-slots.js} +1187 -1195
- package/build/cjs/context-time-slots.js.map +1 -0
- package/build/es/{context-booking-checkout-context.mjs → context-booking-checkout.mjs} +906 -922
- package/build/es/context-booking-checkout.mjs.map +1 -0
- package/build/es/{context-categories-context.mjs → context-categories.mjs} +283 -289
- package/build/es/context-categories.mjs.map +1 -0
- package/build/es/{context-locations-context.mjs → context-locations.mjs} +358 -364
- package/build/es/context-locations.mjs.map +1 -0
- package/build/es/{context-service-addons-context.mjs → context-service-addons.mjs} +417 -423
- package/build/es/context-service-addons.mjs.map +1 -0
- package/build/{internal/cjs/context-service-context.d.ts → es/context-service.d.mts} +1 -1
- package/build/es/{context-service-context.mjs → context-service.mjs} +960 -973
- package/build/es/context-service.mjs.map +1 -0
- package/build/es/{context-services-context.mjs → context-services.mjs} +596 -607
- package/build/es/context-services.mjs.map +1 -0
- package/build/es/{context-time-slots-context.mjs → context-time-slots.mjs} +1181 -1189
- package/build/es/context-time-slots.mjs.map +1 -0
- package/build/internal/{es/context-service-context.d.mts → cjs/context-service.d.ts} +1 -1
- package/build/{es/context-service-context.d.mts → internal/es/context-service.d.mts} +1 -1
- package/context/booking-checkout/package.json +3 -0
- package/context/categories/package.json +3 -0
- package/context/locations/package.json +3 -0
- package/context/service/package.json +3 -0
- package/context/service-addons/package.json +3 -0
- package/context/services/package.json +3 -0
- package/context/time-slots/package.json +3 -0
- package/package.json +37 -37
- package/_sdk-exports/context-booking-checkout-context/runtime.js +0 -2
- package/_sdk-exports/context-categories-context/runtime.js +0 -1
- package/_sdk-exports/context-locations-context/runtime.js +0 -1
- package/_sdk-exports/context-service-addons-context/runtime.js +0 -1
- package/_sdk-exports/context-services-context/runtime.js +0 -2
- package/_sdk-exports/context-time-slots-context/runtime.js +0 -2
- package/build/cjs/context-booking-checkout-context.js.map +0 -1
- package/build/cjs/context-categories-context.js.map +0 -1
- package/build/cjs/context-locations-context.js.map +0 -1
- package/build/cjs/context-service-addons-context.js.map +0 -1
- package/build/cjs/context-service-context.js.map +0 -1
- package/build/cjs/context-services-context.js.map +0 -1
- package/build/cjs/context-time-slots-context.js.map +0 -1
- package/build/es/context-booking-checkout-context.mjs.map +0 -1
- package/build/es/context-categories-context.mjs.map +0 -1
- package/build/es/context-locations-context.mjs.map +0 -1
- package/build/es/context-service-addons-context.mjs.map +0 -1
- package/build/es/context-service-context.mjs.map +0 -1
- package/build/es/context-services-context.mjs.map +0 -1
- package/build/es/context-time-slots-context.mjs.map +0 -1
- package/context/booking-checkout-context/package.json +0 -3
- package/context/categories-context/package.json +0 -3
- package/context/locations-context/package.json +0 -3
- package/context/service-addons-context/package.json +0 -3
- package/context/service-context/package.json +0 -3
- package/context/services-context/package.json +0 -3
- package/context/time-slots-context/package.json +0 -3
- /package/_sdk-exports/{context-booking-checkout-context → context-booking-checkout}/runtime.d.ts +0 -0
- /package/_sdk-exports/{context-categories-context → context-categories}/runtime.d.ts +0 -0
- /package/_sdk-exports/{context-locations-context → context-locations}/runtime.d.ts +0 -0
- /package/_sdk-exports/{context-service-addons-context → context-service-addons}/runtime.d.ts +0 -0
- /package/_sdk-exports/{context-services-context → context-services}/runtime.d.ts +0 -0
- /package/_sdk-exports/{context-time-slots-context → context-time-slots}/runtime.d.ts +0 -0
- /package/build/cjs/{context-booking-checkout-context.d.ts → context-booking-checkout.d.ts} +0 -0
- /package/build/cjs/{context-categories-context.d.ts → context-categories.d.ts} +0 -0
- /package/build/cjs/{context-locations-context.d.ts → context-locations.d.ts} +0 -0
- /package/build/cjs/{context-service-addons-context.d.ts → context-service-addons.d.ts} +0 -0
- /package/build/cjs/{context-services-context.d.ts → context-services.d.ts} +0 -0
- /package/build/cjs/{context-time-slots-context.d.ts → context-time-slots.d.ts} +0 -0
- /package/build/es/{context-booking-checkout-context.d.mts → context-booking-checkout.d.mts} +0 -0
- /package/build/es/{context-categories-context.d.mts → context-categories.d.mts} +0 -0
- /package/build/es/{context-locations-context.d.mts → context-locations.d.mts} +0 -0
- /package/build/es/{context-service-addons-context.d.mts → context-service-addons.d.mts} +0 -0
- /package/build/es/{context-services-context.d.mts → context-services.d.mts} +0 -0
- /package/build/es/{context-time-slots-context.d.mts → context-time-slots.d.mts} +0 -0
- /package/build/internal/cjs/{context-booking-checkout-context.d.ts → context-booking-checkout.d.ts} +0 -0
- /package/build/internal/cjs/{context-categories-context.d.ts → context-categories.d.ts} +0 -0
- /package/build/internal/cjs/{context-locations-context.d.ts → context-locations.d.ts} +0 -0
- /package/build/internal/cjs/{context-service-addons-context.d.ts → context-service-addons.d.ts} +0 -0
- /package/build/internal/cjs/{context-services-context.d.ts → context-services.d.ts} +0 -0
- /package/build/internal/cjs/{context-time-slots-context.d.ts → context-time-slots.d.ts} +0 -0
- /package/build/internal/es/{context-booking-checkout-context.d.mts → context-booking-checkout.d.mts} +0 -0
- /package/build/internal/es/{context-categories-context.d.mts → context-categories.d.mts} +0 -0
- /package/build/internal/es/{context-locations-context.d.mts → context-locations.d.mts} +0 -0
- /package/build/internal/es/{context-service-addons-context.d.mts → context-service-addons.d.mts} +0 -0
- /package/build/internal/es/{context-services-context.d.mts → context-services.d.mts} +0 -0
- /package/build/internal/es/{context-time-slots-context.d.mts → context-time-slots.d.mts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// _sdk-exports/context-categories
|
|
1
|
+
// _sdk-exports/context-categories/runtime.js
|
|
2
2
|
import { Component as e, Suspense as t, createContext as n, useCallback as r, useContext as i, useEffect as a, useMemo as o, useRef as s, useState as c, useSyncExternalStore as l } from "react";
|
|
3
3
|
import { useGetService as u, useService as d } from "@wix/services-manager-react";
|
|
4
4
|
import { jsx as f } from "react/jsx-runtime";
|
|
@@ -131,24 +131,24 @@ var ve = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgu
|
|
|
131
131
|
let a2 = { ...e2, ...t2 }, o2 = Object.keys(a2);
|
|
132
132
|
return r2?.filter((e3) => !r2.some((t3) => t3.field.length > e3.field.length && t3.field.startsWith(e3.field) && o2.includes(t3.field))).map((e3) => {
|
|
133
133
|
let r3 = t2[e3.field];
|
|
134
|
-
if (r3) return { ...e3, field:
|
|
134
|
+
if (r3) return { ...e3, field: ye(r3, i2) };
|
|
135
135
|
let s2 = o2?.sort((e4, t3) => t3.length - e4.length)?.find((t3) => e3.field.startsWith(t3));
|
|
136
136
|
if (s2) {
|
|
137
137
|
let t3 = a2[s2];
|
|
138
|
-
if (t3) return { ...e3, field: e3.field.replace(s2,
|
|
138
|
+
if (t3) return { ...e3, field: e3.field.replace(s2, ye(t3, i2)) };
|
|
139
139
|
}
|
|
140
140
|
return n2 ? { ...e3, field: `${i2[0]}.${e3.field}` } : e3;
|
|
141
141
|
});
|
|
142
142
|
};
|
|
143
|
-
var
|
|
144
|
-
let n2 =
|
|
143
|
+
var ye = (e2, t2) => {
|
|
144
|
+
let n2 = be(e2);
|
|
145
145
|
return n2 == null ? e2 : e2.replace(`$[${n2}]`, t2[n2]);
|
|
146
146
|
};
|
|
147
|
-
var
|
|
147
|
+
var be = (e2) => {
|
|
148
148
|
let t2 = e2.match(/\$\[(?<argIndex>\d+)\]/);
|
|
149
149
|
return t2 && t2.groups && Number(t2.groups.argIndex);
|
|
150
150
|
};
|
|
151
|
-
function
|
|
151
|
+
function xe(e2, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
|
|
152
152
|
return ae(() => e2({ request: async (e3) => {
|
|
153
153
|
let i3 = e3({ host: s2?.HTTPHost || `www.wixapis.com` }), a3 = i3;
|
|
154
154
|
a3.method === `GET` && a3.fallback?.length && (a3.params?.toString().length ?? 0) > 4e3 && (a3 = i3.fallback[0]);
|
|
@@ -162,7 +162,7 @@ function be(e2, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
|
|
|
162
162
|
e5 = await s3.json();
|
|
163
163
|
} catch {
|
|
164
164
|
}
|
|
165
|
-
let t3 =
|
|
165
|
+
let t3 = Ce(s3.status, e5?.message ?? s3.statusText, e5?.details, { requestId: s3.headers.get(`X-Wix-Request-Id`), details: e5 }), n3 = me(t3);
|
|
166
166
|
throw r2?.handleError(n3, { requestOptions: { url: a3.url, method: a3.method, entityFqdn: i3.entityFqdn, methodFqn: i3.methodFqn } }), t3;
|
|
167
167
|
}
|
|
168
168
|
let l3 = await s3.json();
|
|
@@ -172,18 +172,18 @@ function be(e2, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
|
|
|
172
172
|
}
|
|
173
173
|
}, fetchWithAuth: n2, wixAPIFetch: i2, getActiveToken: a2, getAuthHeaders: o2 }, { validateRequestSchema: u2 }));
|
|
174
174
|
}
|
|
175
|
-
var
|
|
175
|
+
var Se = class extends Error {
|
|
176
176
|
response;
|
|
177
177
|
requestId;
|
|
178
178
|
constructor(e2) {
|
|
179
179
|
super(), this.response = e2.response, this.requestId = e2.requestId;
|
|
180
180
|
}
|
|
181
181
|
};
|
|
182
|
-
var
|
|
183
|
-
var
|
|
184
|
-
function
|
|
182
|
+
var Ce = (e2, t2, n2, r2) => new Se({ response: { data: { details: { ...!n2?.validationError && { applicationError: { description: t2, code: e2, data: r2 } }, ...n2 }, message: t2 }, status: e2 }, requestId: r2?.requestId });
|
|
183
|
+
var we = `.`;
|
|
184
|
+
function Te(e2, t2, n2) {
|
|
185
185
|
if (e2 == null) throw Error(`Cannot set value on null or undefined`);
|
|
186
|
-
let r2 =
|
|
186
|
+
let r2 = D(t2), i2 = e2;
|
|
187
187
|
for (let e3 = 0; e3 < r2.length; e3++) {
|
|
188
188
|
let t3 = r2[e3];
|
|
189
189
|
if (e3 === r2.length - 1) {
|
|
@@ -195,21 +195,21 @@ function we(e2, t2, n2) {
|
|
|
195
195
|
}
|
|
196
196
|
return e2;
|
|
197
197
|
}
|
|
198
|
-
function
|
|
199
|
-
return Array.isArray(e2) ? e2 : e2.split(
|
|
198
|
+
function D(e2) {
|
|
199
|
+
return Array.isArray(e2) ? e2 : e2.split(we).map((e3) => Ee(e3) ? Number(e3) : e3);
|
|
200
200
|
}
|
|
201
|
-
function
|
|
201
|
+
function Ee(e2) {
|
|
202
202
|
return /^\d+$/.test(e2);
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function De(e2) {
|
|
205
205
|
let t2 = {};
|
|
206
|
-
for (let [n2, r2] of Object.entries(e2))
|
|
206
|
+
for (let [n2, r2] of Object.entries(e2)) Oe(n2) || Te(t2, D(n2), r2);
|
|
207
207
|
return t2;
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function Oe(e2) {
|
|
210
210
|
return e2 === `__proto__` || e2 === `constructor` || e2 === `prototype`;
|
|
211
211
|
}
|
|
212
|
-
var
|
|
212
|
+
var ke = class {
|
|
213
213
|
BRACKET_PATTERN = /\[(\d+)\]/g;
|
|
214
214
|
NUMERIC_PATTERN = /^\d+$/;
|
|
215
215
|
ESCAPED_DOT_PATTERN = /\\\./g;
|
|
@@ -232,7 +232,7 @@ var Oe = class {
|
|
|
232
232
|
return e2.replace(this.ESCAPED_DOT_PLACEHOLDER, `\\.`).replace(this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER, `\\]`).replace(this.ESCAPED_LEFT_BRACKET_PLACEHOLDER, `\\[`);
|
|
233
233
|
}
|
|
234
234
|
unflatten() {
|
|
235
|
-
return this.cleanedModifiedFields = Object.fromEntries(Object.entries(this.modifiedFields).map(([e2, t2]) => [this.replaceEscapedCharacters(this.bracketToDotNotation(e2)), t2])),
|
|
235
|
+
return this.cleanedModifiedFields = Object.fromEntries(Object.entries(this.modifiedFields).map(([e2, t2]) => [this.replaceEscapedCharacters(this.bracketToDotNotation(e2)), t2])), De(this.cleanedModifiedFields);
|
|
236
236
|
}
|
|
237
237
|
flatten(e2) {
|
|
238
238
|
let t2 = {};
|
|
@@ -257,7 +257,7 @@ var Oe = class {
|
|
|
257
257
|
r2.push(i3), n2 = t3[i3];
|
|
258
258
|
return;
|
|
259
259
|
}
|
|
260
|
-
let a3 =
|
|
260
|
+
let a3 = Ne(e3);
|
|
261
261
|
if (a3 && a3 in t3) {
|
|
262
262
|
r2.push(a3), n2 = t3[a3];
|
|
263
263
|
return;
|
|
@@ -288,28 +288,28 @@ var Oe = class {
|
|
|
288
288
|
return e2.replace(this.BRACKET_PATTERN, (t2, n2, r2) => r2 > 0 && e2[r2 - 1] === `\\` ? t2 : `.` + n2);
|
|
289
289
|
}
|
|
290
290
|
};
|
|
291
|
-
function
|
|
291
|
+
function Ae(e2, t2) {
|
|
292
292
|
let n2 = e2?.modifiedFields;
|
|
293
293
|
if (!n2) return null;
|
|
294
|
-
let r2 =
|
|
294
|
+
let r2 = je(n2);
|
|
295
295
|
if (!r2) return null;
|
|
296
296
|
let { unflattenedModifiedFields: i2, modifiedFieldsManipulator: a2 } = r2;
|
|
297
297
|
e2 = { ...e2, modifiedFields: i2 };
|
|
298
298
|
let o2 = t2(e2), s2 = o2?.modifiedFields;
|
|
299
299
|
if (!s2) return null;
|
|
300
|
-
let c2 =
|
|
300
|
+
let c2 = Me(s2, a2);
|
|
301
301
|
return c2 === null ? null : (o2.modifiedFields = c2, o2);
|
|
302
302
|
}
|
|
303
|
-
function
|
|
303
|
+
function je(e2) {
|
|
304
304
|
if (typeof e2 == `object` && e2 && !Array.isArray(e2)) try {
|
|
305
|
-
let t2 = new
|
|
305
|
+
let t2 = new ke(e2);
|
|
306
306
|
return { unflattenedModifiedFields: t2.unflatten(), modifiedFieldsManipulator: t2 };
|
|
307
307
|
} catch {
|
|
308
308
|
return null;
|
|
309
309
|
}
|
|
310
310
|
return null;
|
|
311
311
|
}
|
|
312
|
-
function
|
|
312
|
+
function Me(e2, t2) {
|
|
313
313
|
if (typeof e2 == `object` && e2 && !Array.isArray(e2)) try {
|
|
314
314
|
return t2.flatten(e2);
|
|
315
315
|
} catch {
|
|
@@ -317,10 +317,10 @@ function je(e2, t2) {
|
|
|
317
317
|
}
|
|
318
318
|
return null;
|
|
319
319
|
}
|
|
320
|
-
function
|
|
320
|
+
function Ne(e2) {
|
|
321
321
|
return e2.replace(/[-_\s]+(.)?/g, (e3, t2) => t2 ? t2.toUpperCase() : ``).replace(/^./, (e3) => e3.toLowerCase());
|
|
322
322
|
}
|
|
323
|
-
function
|
|
323
|
+
function O() {
|
|
324
324
|
return { emit(e2, ...t2) {
|
|
325
325
|
for (let n2 = 0, r2 = this.events[e2] || [], i2 = r2.length; n2 < i2; n2++) r2[n2](...t2);
|
|
326
326
|
}, events: {}, on(e2, t2) {
|
|
@@ -329,8 +329,8 @@ function k() {
|
|
|
329
329
|
};
|
|
330
330
|
} };
|
|
331
331
|
}
|
|
332
|
-
var
|
|
333
|
-
function
|
|
332
|
+
var Pe = (e2) => e2.__type === `event-definition`;
|
|
333
|
+
function Fe(e2, t2, n2, r2) {
|
|
334
334
|
let i2;
|
|
335
335
|
if (e2.isDomainEvent) {
|
|
336
336
|
let { deletedEvent: e3, actionEvent: t3, createdEvent: a3, updatedEvent: o3, ...s3 } = n2, c2 = { ...r2, ...s3 };
|
|
@@ -341,14 +341,14 @@ function Pe(e2, t2, n2, r2) {
|
|
|
341
341
|
let e3 = s2.modifiedFields;
|
|
342
342
|
if (typeof e3 == `object` && e3 && !Array.isArray(e3)) {
|
|
343
343
|
o2 = structuredClone(i2);
|
|
344
|
-
let e4 =
|
|
344
|
+
let e4 = Ae(s2, a2);
|
|
345
345
|
if (e4) return t2(e4);
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
348
|
return t2(a2(o2));
|
|
349
349
|
}
|
|
350
|
-
function
|
|
351
|
-
let t2 = /* @__PURE__ */ new Map(), n2 =
|
|
350
|
+
function Ie(e2) {
|
|
351
|
+
let t2 = /* @__PURE__ */ new Map(), n2 = O();
|
|
352
352
|
return { initModule(e3) {
|
|
353
353
|
return (r2) => {
|
|
354
354
|
let i2 = t2.get(e3.type) ?? [];
|
|
@@ -358,7 +358,7 @@ function Fe(e2) {
|
|
|
358
358
|
let { eventType: r2, identity: i2, instanceId: a2, payload: o2, accountInfo: s2 } = await this.parseJWT(e3), c2 = [...n3.expectedEvents, ...Array.from(t2.keys()).map((e4) => ({ type: e4 }))];
|
|
359
359
|
if (c2.length > 0 && !c2.some(({ type: e4 }) => e4 === r2)) throw Error(`Unexpected event type: ${r2}. Expected one of: ${c2.map((e4) => e4.type).join(`, `)}`);
|
|
360
360
|
let l2 = t2.get(r2) ?? [];
|
|
361
|
-
return await Promise.all(l2.map(({ eventDefinition: e4, handler: t3 }) =>
|
|
361
|
+
return await Promise.all(l2.map(({ eventDefinition: e4, handler: t3 }) => Fe(e4, t3, o2, { instanceId: a2, identity: i2, accountInfo: s2 }))), { instanceId: a2, eventType: r2, payload: o2, identity: i2, accountInfo: s2 };
|
|
362
362
|
}, async processRequest(e3, t3) {
|
|
363
363
|
let n3 = await e3.text();
|
|
364
364
|
return this.process(n3, t3);
|
|
@@ -377,12 +377,12 @@ function Fe(e2) {
|
|
|
377
377
|
let n3 = Array.from(t2.keys()).map((e4) => ({ type: e4 }));
|
|
378
378
|
if (n3.length > 0 && !n3.some(({ type: t3 }) => t3 === e3.eventType)) throw Error(`Unexpected event type: ${e3.eventType}. Expected one of: ${n3.map((e4) => e4.type).join(`, `)}`);
|
|
379
379
|
let r2 = t2.get(e3.eventType) ?? [];
|
|
380
|
-
await Promise.all(r2.map(({ eventDefinition: t3, handler: n4 }) =>
|
|
380
|
+
await Promise.all(r2.map(({ eventDefinition: t3, handler: n4 }) => Fe(t3, n4, e3.payload, { instanceId: e3.instanceId, identity: e3.identity })));
|
|
381
381
|
}, apps: { AppInstalled: m(`AppInstalled`)(), AppRemoved: m(`AppRemoved`)() } } };
|
|
382
382
|
}
|
|
383
|
-
var
|
|
384
|
-
function
|
|
385
|
-
let t2 = /* @__PURE__ */ new Map(), n2 =
|
|
383
|
+
var Le = (e2) => e2.__type === `service-plugin-definition`;
|
|
384
|
+
function Re(e2) {
|
|
385
|
+
let t2 = /* @__PURE__ */ new Map(), n2 = O();
|
|
386
386
|
return { initModule(e3) {
|
|
387
387
|
return (r2) => {
|
|
388
388
|
let i2 = t2.get(e3.componentType.toLowerCase()) ?? [];
|
|
@@ -423,38 +423,38 @@ function Le(e2) {
|
|
|
423
423
|
return s2.transformations.toREST(await c2(s2.transformations.fromREST(e3)));
|
|
424
424
|
} } };
|
|
425
425
|
}
|
|
426
|
-
var
|
|
427
|
-
function
|
|
426
|
+
var k = `X-Wix-Consistent`;
|
|
427
|
+
function ze(e2) {
|
|
428
428
|
let t2 = e2.headers || { Authorization: `` }, n2 = { getAuthHeaders: (e3) => Promise.resolve({ headers: {} }) }, r2 = e2.auth, i2 = typeof r2 == `function` ? r2 : () => r2 ?? n2, a2 = () => i2().getAuthHeaders(e2.host), o2 = () => e2.fetch ?? fetch, s2 = async (n3, r3) => {
|
|
429
|
-
let i3 = o2(), s3 = await a2(), c3 = { ...r3?.headers ?? {}, ...s3.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [
|
|
429
|
+
let i3 = o2(), s3 = await a2(), c3 = { ...r3?.headers ?? {}, ...s3.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [k]: t2[k] } : {} }, l3 = e2.host?.getErrorHandler?.();
|
|
430
430
|
try {
|
|
431
431
|
if (typeof n3 == `string` || n3 instanceof URL) {
|
|
432
432
|
let e3 = await i3(n3, { ...r3, headers: c3 });
|
|
433
433
|
l3?.handleError(e3, { requestOptions: { url: n3.toString(), method: r3?.method } });
|
|
434
|
-
let a3 =
|
|
435
|
-
return a3 && (t2[
|
|
434
|
+
let a3 = A(e3);
|
|
435
|
+
return a3 && (t2[k] = a3), e3;
|
|
436
436
|
}
|
|
437
437
|
{
|
|
438
438
|
for (let [e4, t3] of Object.entries(c3)) typeof t3 == `string` && n3.headers.set(e4, t3);
|
|
439
439
|
let e3 = await i3(n3, r3);
|
|
440
440
|
l3?.handleError(e3, { requestOptions: { url: n3.url, method: r3?.method } });
|
|
441
|
-
let a3 =
|
|
442
|
-
return a3 && (t2[
|
|
441
|
+
let a3 = A(e3);
|
|
442
|
+
return a3 && (t2[k] = a3), e3;
|
|
443
443
|
}
|
|
444
444
|
} catch (e3) {
|
|
445
445
|
throw l3?.handleError(e3, { requestOptions: { url: typeof n3 == `string` || n3 instanceof URL ? n3.toString() : n3.url, method: r3?.method } }), e3;
|
|
446
446
|
}
|
|
447
|
-
}, { client: c2, initModule: l2 } =
|
|
448
|
-
let i3 = o2(), s3 = await a2(), c3 = S(r3), l3 = await i3(n3, { ...r3, headers: { ...c3, ...t2, ...s3?.headers, ...r3?.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [
|
|
449
|
-
return u3 && (t2[
|
|
447
|
+
}, { client: c2, initModule: l2 } = Re(i2), { client: u2, initModule: d2 } = Ie(i2), f2 = async (n3, r3) => {
|
|
448
|
+
let i3 = o2(), s3 = await a2(), c3 = S(r3), l3 = await i3(n3, { ...r3, headers: { ...c3, ...t2, ...s3?.headers, ...r3?.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [k]: t2[k] } : {} } }), u3 = A(l3);
|
|
449
|
+
return u3 && (t2[k] = u3), l3;
|
|
450
450
|
}, m2 = (t3, n3) => {
|
|
451
|
-
if (
|
|
452
|
-
if (
|
|
451
|
+
if (Pe(t3)) return d2(t3);
|
|
452
|
+
if (Le(t3)) return l2(t3);
|
|
453
453
|
if (ee(t3) && e2.host) return te(t3, e2.host);
|
|
454
454
|
if (typeof t3 == `function`) {
|
|
455
455
|
if (`__type` in t3 && t3.__type === `wix_spi_error`) return t3;
|
|
456
456
|
let r3 = e2.host?.apiBaseUrl ?? `www.wixapis.com`, o3 = e2.useCDN === void 0 ? i2().shouldUseCDN : e2.useCDN;
|
|
457
|
-
return
|
|
457
|
+
return xe(ae(() => _(t3)) ? g(t3) : t3, n3 ?? {}, f2, e2.host?.getErrorHandler?.(), (e3, t4) => {
|
|
458
458
|
let n4 = new URL(e3, `https://${r3}`);
|
|
459
459
|
return n4.host = r3, n4.protocol = `https`, f2(n4.toString(), t4);
|
|
460
460
|
}, i2().getActiveToken, async () => a2(), { HTTPHost: r3 }, e2.host?.name, o3, e2.validateRequestSchema);
|
|
@@ -478,19 +478,19 @@ function Re(e2) {
|
|
|
478
478
|
return { data: o3 ?? {}, errors: s3 };
|
|
479
479
|
}, webhooks: u2, servicePlugins: c2 };
|
|
480
480
|
}
|
|
481
|
-
function
|
|
481
|
+
function A(e2) {
|
|
482
482
|
return e2.headers?.get(`X-Wix-Consistent`) ?? e2.headers?.get(`x-wix-consistent`);
|
|
483
483
|
}
|
|
484
|
-
var
|
|
485
|
-
var
|
|
486
|
-
function
|
|
484
|
+
var Be = { _id: `id`, _createdDate: `createdDate`, _updatedDate: `updatedDate` };
|
|
485
|
+
var Ve = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
|
|
486
|
+
function He(e2, t2) {
|
|
487
487
|
return e2?.split(`.`).map((e3) => t2?.[e3] ?? e3).join(`.`);
|
|
488
488
|
}
|
|
489
|
-
var
|
|
490
|
-
function
|
|
491
|
-
return (e2 ===
|
|
489
|
+
var j = `sort.fieldName`;
|
|
490
|
+
function Ue(e2, t2, n2) {
|
|
491
|
+
return (e2 === j || e2.endsWith(`.${j}`)) && typeof t2 == `string` ? He(t2, n2) : t2;
|
|
492
492
|
}
|
|
493
|
-
function
|
|
493
|
+
function M(e2, t2, n2) {
|
|
494
494
|
let r2 = (e3) => n2.includes(e3), i2 = (e3, n3) => {
|
|
495
495
|
if (Array.isArray(e3)) e3.forEach((e4) => {
|
|
496
496
|
i2(e4, n3);
|
|
@@ -500,87 +500,87 @@ function N(e2, t2, n2) {
|
|
|
500
500
|
Object.keys(a2).forEach((e4) => {
|
|
501
501
|
let o2 = n3 === `` ? e4 : `${n3}.${e4}`;
|
|
502
502
|
if (r2(o2)) return;
|
|
503
|
-
let s2 =
|
|
504
|
-
s2 !== e4 && !(s2 in a2) && (a2[s2] = a2[e4], delete a2[e4]), a2[s2] =
|
|
503
|
+
let s2 = We(e4, t2);
|
|
504
|
+
s2 !== e4 && !(s2 in a2) && (a2[s2] = a2[e4], delete a2[e4]), a2[s2] = Ue(o2, a2[s2], t2), i2(a2[s2], o2);
|
|
505
505
|
});
|
|
506
506
|
}
|
|
507
507
|
};
|
|
508
508
|
return i2(e2, ``), e2;
|
|
509
509
|
}
|
|
510
|
-
function
|
|
510
|
+
function We(e2, t2) {
|
|
511
511
|
let n2;
|
|
512
512
|
return n2 = e2.includes(`.`) ? e2.split(`.`).map((e3) => t2[e3] ?? e3).join(`.`) : t2[e2] ?? e2, n2;
|
|
513
513
|
}
|
|
514
|
-
function We(e2, t2 = []) {
|
|
515
|
-
return N(e2, ze, t2);
|
|
516
|
-
}
|
|
517
514
|
function Ge(e2, t2 = []) {
|
|
518
|
-
return
|
|
515
|
+
return M(e2, Be, t2);
|
|
519
516
|
}
|
|
520
|
-
function
|
|
521
|
-
return
|
|
517
|
+
function Ke(e2, t2 = []) {
|
|
518
|
+
return M(e2, Ve, t2);
|
|
522
519
|
}
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
var
|
|
527
|
-
|
|
520
|
+
function N(e2) {
|
|
521
|
+
return Xe(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
|
|
522
|
+
}
|
|
523
|
+
var qe = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
524
|
+
var Je = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
525
|
+
var P = `$1\0$2`;
|
|
526
|
+
var Ye = /[^\p{L}\d]+/giu;
|
|
527
|
+
function Xe(e2) {
|
|
528
528
|
let t2 = e2.trim();
|
|
529
|
-
t2 = t2.replace(
|
|
529
|
+
t2 = t2.replace(qe, P).replace(Je, P), t2 = t2.replace(Ye, `\0`);
|
|
530
530
|
let n2 = 0, r2 = t2.length;
|
|
531
531
|
for (; t2.charAt(n2) === `\0`; ) n2++;
|
|
532
532
|
if (n2 === r2) return [];
|
|
533
533
|
for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
|
|
534
534
|
return t2.slice(n2, r2).split(/\0/g);
|
|
535
535
|
}
|
|
536
|
-
var
|
|
537
|
-
var
|
|
538
|
-
var
|
|
539
|
-
function
|
|
536
|
+
var Ze = (e2) => `validationError` in (e2.response?.data?.details ?? {});
|
|
537
|
+
var Qe = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
|
|
538
|
+
var $e = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
|
|
539
|
+
function et(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
|
|
540
540
|
if (typeof e2 != `object` || !e2) throw e2;
|
|
541
|
-
if (
|
|
542
|
-
if (
|
|
543
|
-
if (
|
|
544
|
-
let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code:
|
|
545
|
-
return
|
|
541
|
+
if (Ze(e2)) return tt(e2, t2, n2);
|
|
542
|
+
if (Qe(e2)) return nt(e2);
|
|
543
|
+
if ($e(e2)) {
|
|
544
|
+
let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: N(n3), data: {} }, requestId: e2.requestId };
|
|
545
|
+
return F(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
|
|
546
546
|
}
|
|
547
|
-
return
|
|
547
|
+
return rt(e2);
|
|
548
548
|
}
|
|
549
|
-
var
|
|
550
|
-
let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 =
|
|
551
|
-
return
|
|
549
|
+
var tt = (e2, t2, n2) => {
|
|
550
|
+
let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = it(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 };
|
|
551
|
+
return F(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e2.response?.status, requestId: i2 } });
|
|
552
552
|
};
|
|
553
|
-
var
|
|
554
|
-
var
|
|
555
|
-
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 ??
|
|
556
|
-
return
|
|
553
|
+
var F = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
|
|
554
|
+
var nt = (e2) => {
|
|
555
|
+
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 ?? N(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 };
|
|
556
|
+
return F(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e2.requestId } });
|
|
557
557
|
};
|
|
558
|
-
var
|
|
559
|
-
var
|
|
558
|
+
var rt = (e2) => F(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: N(e2.response?.statusText ?? `UNKNOWN`), ...!e2.response && { runtimeError: e2 } } });
|
|
559
|
+
var it = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
|
|
560
560
|
let a2 = { ...e2, ...t2 }, o2 = Object.keys(a2);
|
|
561
561
|
return r2?.filter((e3) => !r2.some((t3) => t3.field.length > e3.field.length && t3.field.startsWith(e3.field) && o2.includes(t3.field))).map((e3) => {
|
|
562
562
|
let r3 = t2[e3.field];
|
|
563
|
-
if (r3) return { ...e3, field:
|
|
563
|
+
if (r3) return { ...e3, field: at(r3, i2) };
|
|
564
564
|
let s2 = o2?.sort((e4, t3) => t3.length - e4.length)?.find((t3) => e3.field.startsWith(t3));
|
|
565
565
|
if (s2) {
|
|
566
566
|
let t3 = a2[s2];
|
|
567
|
-
if (t3) return { ...e3, field: e3.field.replace(s2,
|
|
567
|
+
if (t3) return { ...e3, field: e3.field.replace(s2, at(t3, i2)) };
|
|
568
568
|
}
|
|
569
569
|
return n2 ? { ...e3, field: `${i2[0]}.${e3.field}` } : e3;
|
|
570
570
|
});
|
|
571
571
|
};
|
|
572
|
-
var
|
|
573
|
-
let n2 =
|
|
572
|
+
var at = (e2, t2) => {
|
|
573
|
+
let n2 = ot(e2);
|
|
574
574
|
return n2 == null ? e2 : e2.replace(`$[${n2}]`, t2[n2]);
|
|
575
575
|
};
|
|
576
|
-
var
|
|
576
|
+
var ot = (e2) => {
|
|
577
577
|
let t2 = e2.match(/\$\[(?<argIndex>\d+)\]/);
|
|
578
578
|
return t2 && t2.groups && Number(t2.groups.argIndex);
|
|
579
579
|
};
|
|
580
|
-
function
|
|
580
|
+
function st() {
|
|
581
581
|
let e2 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
582
582
|
if (e2) return { initWixModules(t3, n3) {
|
|
583
|
-
return
|
|
583
|
+
return I(() => e2(t3, n3));
|
|
584
584
|
}, fetchWithAuth() {
|
|
585
585
|
throw Error(`fetchWithAuth is not available in this context`);
|
|
586
586
|
}, graphql() {
|
|
@@ -590,10 +590,10 @@ function ot() {
|
|
|
590
590
|
if (t2 || n2) return { initWixModules(e3, r2) {
|
|
591
591
|
if (r2) {
|
|
592
592
|
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`);
|
|
593
|
-
return
|
|
593
|
+
return I(() => n2.use(e3));
|
|
594
594
|
}
|
|
595
595
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
596
|
-
return
|
|
596
|
+
return I(() => t2.use(e3));
|
|
597
597
|
}, fetchWithAuth: (e3, n3) => {
|
|
598
598
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
599
599
|
return t2.fetchWithAuth(e3, n3);
|
|
@@ -605,7 +605,7 @@ function ot() {
|
|
|
605
605
|
return t2.graphql(e3, n3, r2);
|
|
606
606
|
} };
|
|
607
607
|
}
|
|
608
|
-
function
|
|
608
|
+
function I(e2) {
|
|
609
609
|
let t2 = globalThis.__wix_context__, n2 = { client: p.client, elevatedClient: p.elevatedClient }, r2;
|
|
610
610
|
globalThis.__wix_context__ = void 0, p.client = void 0, p.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
611
611
|
try {
|
|
@@ -614,78 +614,78 @@ function L(e2) {
|
|
|
614
614
|
globalThis.__wix_context__ = t2, p.client = n2.client, p.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
615
615
|
}
|
|
616
616
|
}
|
|
617
|
-
function
|
|
617
|
+
function ct(e2, t2) {
|
|
618
618
|
return (...n2) => {
|
|
619
|
-
let r2 =
|
|
619
|
+
let r2 = st();
|
|
620
620
|
return r2 ? r2.initWixModules(e2, t2).apply(void 0, n2) : e2.apply(void 0, n2);
|
|
621
621
|
};
|
|
622
622
|
}
|
|
623
|
-
function
|
|
624
|
-
return
|
|
625
|
-
}
|
|
626
|
-
function
|
|
627
|
-
let t2 =
|
|
628
|
-
return
|
|
629
|
-
}
|
|
630
|
-
var
|
|
631
|
-
var
|
|
632
|
-
var
|
|
633
|
-
var
|
|
634
|
-
var
|
|
635
|
-
var
|
|
636
|
-
var
|
|
637
|
-
var
|
|
638
|
-
var
|
|
639
|
-
var
|
|
640
|
-
function bt(e2) {
|
|
641
|
-
return xt(e2).replace(pt, `._base_domain_`).replace(vt, `._api_base_domain_`).replace(yt, `*.dev.wix-code.com`);
|
|
642
|
-
}
|
|
623
|
+
function lt(e2, t2 = false) {
|
|
624
|
+
return ct(e2, t2);
|
|
625
|
+
}
|
|
626
|
+
function ut(e2) {
|
|
627
|
+
let t2 = Ct(xt(e2.host), e2.domainToMappings);
|
|
628
|
+
return Mt(kt(e2.protoPath, e2.data || {}), t2);
|
|
629
|
+
}
|
|
630
|
+
var dt = [`wix.com`, `editorx.com`];
|
|
631
|
+
var ft = `_`;
|
|
632
|
+
var pt = `*.`;
|
|
633
|
+
var mt = RegExp(`\\.(${dt.join(`|`)})$`);
|
|
634
|
+
var ht = [`42.wixprod.net`, `uw2-edt-1.wixprod.net`, `virginia-edt.wixprod.net`];
|
|
635
|
+
var gt = { "payments.base44.com": `manage.wix.com`, "create.editorx.com": `editor.editorx.com` };
|
|
636
|
+
var _t = `dev.wix-code.com`;
|
|
637
|
+
var vt = /{(.*)}/;
|
|
638
|
+
var yt = RegExp(`\\.(${ht.join(`|`)})$`);
|
|
639
|
+
var bt = RegExp(`.*\\.${_t}$`);
|
|
643
640
|
function xt(e2) {
|
|
644
|
-
return
|
|
641
|
+
return St(e2).replace(mt, `._base_domain_`).replace(yt, `._api_base_domain_`).replace(bt, `*.dev.wix-code.com`);
|
|
645
642
|
}
|
|
646
|
-
function St(e2
|
|
643
|
+
function St(e2) {
|
|
644
|
+
return gt[e2] ?? e2;
|
|
645
|
+
}
|
|
646
|
+
function Ct(e2, t2) {
|
|
647
647
|
let n2 = t2[e2];
|
|
648
648
|
if (n2) return n2;
|
|
649
|
-
let r2 =
|
|
649
|
+
let r2 = wt(e2, t2) ?? Tt(e2, t2);
|
|
650
650
|
if (!r2) {
|
|
651
|
-
if (
|
|
652
|
-
let e3 = t2[
|
|
651
|
+
if (Dt(e2)) {
|
|
652
|
+
let e3 = t2[Ot];
|
|
653
653
|
if (e3) return e3;
|
|
654
654
|
}
|
|
655
|
-
let n3 = t2[
|
|
655
|
+
let n3 = t2[ft];
|
|
656
656
|
if (n3) return n3;
|
|
657
657
|
}
|
|
658
658
|
return r2 ?? [];
|
|
659
659
|
}
|
|
660
|
-
function
|
|
660
|
+
function wt(e2, t2) {
|
|
661
661
|
return Object.entries(t2).find(([t3]) => {
|
|
662
662
|
let [, ...n2] = e2.split(`.`);
|
|
663
663
|
return n2.join(`.`) === t3;
|
|
664
664
|
})?.[1];
|
|
665
665
|
}
|
|
666
|
-
function
|
|
667
|
-
let [n2] = Object.entries(t2).filter(([t3]) =>
|
|
666
|
+
function Tt(e2, t2) {
|
|
667
|
+
let [n2] = Object.entries(t2).filter(([t3]) => Et(e2, t3)).sort(([e3], [t3]) => t3.length - e3.length);
|
|
668
668
|
if (!n2) return;
|
|
669
669
|
let [, r2] = n2;
|
|
670
670
|
return r2;
|
|
671
671
|
}
|
|
672
|
-
function
|
|
673
|
-
if (!t2.startsWith(
|
|
672
|
+
function Et(e2, t2) {
|
|
673
|
+
if (!t2.startsWith(pt)) return false;
|
|
674
674
|
let n2 = t2.slice(1);
|
|
675
675
|
return e2.length > n2.length && e2.endsWith(n2);
|
|
676
676
|
}
|
|
677
|
-
function
|
|
677
|
+
function Dt(e2) {
|
|
678
678
|
return !!e2.match(/\._base_domain_$/);
|
|
679
679
|
}
|
|
680
|
-
var
|
|
681
|
-
function Ot(e2, t2) {
|
|
682
|
-
return e2.split(`/`).map((e3) => kt(e3, t2)).join(`/`);
|
|
683
|
-
}
|
|
680
|
+
var Ot = `www._base_domain_`;
|
|
684
681
|
function kt(e2, t2) {
|
|
685
|
-
|
|
686
|
-
|
|
682
|
+
return e2.split(`/`).map((e3) => At(e3, t2)).join(`/`);
|
|
683
|
+
}
|
|
684
|
+
function At(e2, t2) {
|
|
685
|
+
let n2 = e2.match(vt) || [], r2 = n2[1];
|
|
686
|
+
return r2 ? jt(t2, r2, e2, e2.replace(n2[0], ``)) : e2;
|
|
687
687
|
}
|
|
688
|
-
function
|
|
688
|
+
function jt(e2, t2, n2, r2) {
|
|
689
689
|
let i2 = e2;
|
|
690
690
|
for (let e3 of t2.split(`.`)) {
|
|
691
691
|
if (!i2) return n2;
|
|
@@ -693,33 +693,33 @@ function At(e2, t2, n2, r2) {
|
|
|
693
693
|
}
|
|
694
694
|
return `${i2}${r2}`;
|
|
695
695
|
}
|
|
696
|
-
function
|
|
696
|
+
function Mt(e2, t2) {
|
|
697
697
|
let n2 = t2?.find((t3) => e2.startsWith(t3.destPath));
|
|
698
698
|
return n2 ? n2.srcPath + e2.slice(n2.destPath.length) : e2;
|
|
699
699
|
}
|
|
700
|
-
var
|
|
701
|
-
var
|
|
702
|
-
var
|
|
703
|
-
var
|
|
704
|
-
let e2 =
|
|
705
|
-
if (e2) return { [
|
|
700
|
+
var Nt = `x-wix-linguist`;
|
|
701
|
+
var Pt = `00000000-0000-0000-0000-000000000000`;
|
|
702
|
+
var Ft = `false`;
|
|
703
|
+
var It = () => {
|
|
704
|
+
let e2 = L(`language`), t2 = L(`locale`);
|
|
705
|
+
if (e2) return { [Nt]: [e2, t2 || e2, Ft, Pt].join(`|`) };
|
|
706
706
|
};
|
|
707
|
-
function
|
|
707
|
+
function Lt() {
|
|
708
708
|
let e2 = null, t2 = null;
|
|
709
709
|
return { promise: new Promise((n2, r2) => {
|
|
710
710
|
e2 = n2, t2 = r2;
|
|
711
711
|
}), resolve: e2, reject: t2 };
|
|
712
712
|
}
|
|
713
|
-
var
|
|
714
|
-
var
|
|
715
|
-
let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e2(t2), o2 =
|
|
716
|
-
return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language:
|
|
717
|
-
return
|
|
713
|
+
var L = (e2) => typeof window < `u` ? window.commonConfig?.[e2] : void 0;
|
|
714
|
+
var Rt = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host: (t2) => {
|
|
715
|
+
let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e2(t2), o2 = Bt();
|
|
716
|
+
return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language: L(`language`), locale: L(`locale`), get passThroughHeaders() {
|
|
717
|
+
return It();
|
|
718
718
|
} } };
|
|
719
719
|
}, auth: (e3) => {
|
|
720
720
|
let t2 = typeof window < `u` ? window.wixEmbedsAPI : void 0;
|
|
721
|
-
!e3 &&
|
|
722
|
-
let n2 = false, { resolve: r2, promise: i2 } =
|
|
721
|
+
!e3 && zt() && (e3 = t2?.getAccessTokenFunction?.());
|
|
722
|
+
let n2 = false, { resolve: r2, promise: i2 } = Lt();
|
|
723
723
|
return { getAuthHeaders: async () => {
|
|
724
724
|
if (!e3 && n2 && (e3 = await i2), !e3) throw Error(`Failed to resolve auth token`);
|
|
725
725
|
return { headers: { Authorization: await e3() } };
|
|
@@ -727,36 +727,36 @@ var Lt = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host:
|
|
|
727
727
|
r2(e4);
|
|
728
728
|
}) };
|
|
729
729
|
} });
|
|
730
|
-
function
|
|
730
|
+
function zt() {
|
|
731
731
|
return typeof document < `u` && document.currentScript?.tagName === `SCRIPT`;
|
|
732
732
|
}
|
|
733
|
-
function
|
|
733
|
+
function Bt() {
|
|
734
734
|
let e2 = (typeof window < `u` ? window.wixEmbedsAPI : void 0)?.getExternalBaseUrl?.();
|
|
735
735
|
if (!e2) return;
|
|
736
736
|
let t2 = new URL(e2);
|
|
737
737
|
return t2?.pathname && t2.pathname !== `/` ? `${t2.hostname}${t2.pathname}` : t2.hostname;
|
|
738
738
|
}
|
|
739
|
-
var
|
|
739
|
+
var Vt = ({ clientSdk: e2, applicationId: t2 }) => ({ invoke: async ({ namespace: n2, method: r2, args: i2 }) => {
|
|
740
740
|
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`);
|
|
741
741
|
return e2.invoke({ namespace: n2, method: r2, args: i2, applicationId: t2, accessToken: `accessToken` });
|
|
742
742
|
}, getAccessToken: () => {
|
|
743
743
|
throw Error(`Not implemented`);
|
|
744
744
|
}, observeState: () => ({ disconnect: () => {
|
|
745
745
|
} }) });
|
|
746
|
-
var
|
|
746
|
+
var R = Rt({ createHost: function(e2) {
|
|
747
747
|
let t2 = (typeof $wixContext < `u` ? $wixContext.clientSdk : void 0) ?? e2?.clientSdk ?? (typeof window < `u` ? window?.clientSdk : void 0), { applicationId: n2 } = e2 || {};
|
|
748
748
|
if (!n2) throw Error(`"createHost" was called without a required field "applicationId"`);
|
|
749
|
-
return { channel:
|
|
749
|
+
return { channel: Vt({ clientSdk: t2, applicationId: n2 }), close: () => {
|
|
750
750
|
} };
|
|
751
751
|
} });
|
|
752
|
-
var
|
|
753
|
-
let n2 =
|
|
754
|
-
return
|
|
752
|
+
var Ht = ((e2, t2) => {
|
|
753
|
+
let n2 = R.host({ applicationId: e2, componentId: t2 }), r2 = R.auth();
|
|
754
|
+
return ze({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
|
|
755
755
|
})(`13d21c63-b5ec-5912-8397-c3a5ddb27a97`);
|
|
756
|
-
function
|
|
756
|
+
function Ut() {
|
|
757
757
|
let e2 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
758
758
|
if (e2) return { initWixModules(t3, n3) {
|
|
759
|
-
return
|
|
759
|
+
return z(() => e2(t3, n3));
|
|
760
760
|
}, fetchWithAuth() {
|
|
761
761
|
throw Error(`fetchWithAuth is not available in this context`);
|
|
762
762
|
}, graphql() {
|
|
@@ -766,10 +766,10 @@ function Ht() {
|
|
|
766
766
|
if (t2 || n2) return { initWixModules(e3, r2) {
|
|
767
767
|
if (r2) {
|
|
768
768
|
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`);
|
|
769
|
-
return
|
|
769
|
+
return z(() => n2.use(e3));
|
|
770
770
|
}
|
|
771
771
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
772
|
-
return
|
|
772
|
+
return z(() => t2.use(e3));
|
|
773
773
|
}, fetchWithAuth: (e3, n3) => {
|
|
774
774
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
775
775
|
return t2.fetchWithAuth(e3, n3);
|
|
@@ -781,7 +781,7 @@ function Ht() {
|
|
|
781
781
|
return t2.graphql(e3, n3, r2);
|
|
782
782
|
} };
|
|
783
783
|
}
|
|
784
|
-
function
|
|
784
|
+
function z(e2) {
|
|
785
785
|
let t2 = globalThis.__wix_context__, n2 = { client: p.client, elevatedClient: p.elevatedClient }, r2;
|
|
786
786
|
globalThis.__wix_context__ = void 0, p.client = void 0, p.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
787
787
|
try {
|
|
@@ -790,17 +790,17 @@ function B(e2) {
|
|
|
790
790
|
globalThis.__wix_context__ = t2, p.client = n2.client, p.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
791
791
|
}
|
|
792
792
|
}
|
|
793
|
-
function
|
|
793
|
+
function Wt(e2, t2) {
|
|
794
794
|
return { ...e2, ...Object.fromEntries(t2.map((t3) => [t3, (...n2) => {
|
|
795
|
-
let r2 =
|
|
795
|
+
let r2 = Ut();
|
|
796
796
|
if (!r2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
797
797
|
return r2.initWixModules(e2)[t3].apply(void 0, n2);
|
|
798
798
|
}])) };
|
|
799
799
|
}
|
|
800
|
-
function
|
|
801
|
-
return
|
|
800
|
+
function Gt(e2) {
|
|
801
|
+
return Wt({ __type: `host`, create: (t2) => Object.entries(e2).reduce((e3, [n2, r2]) => ({ ...e3, [n2]: r2(t2) }), {}) }, Object.keys(e2));
|
|
802
802
|
}
|
|
803
|
-
var
|
|
803
|
+
var Kt = class {
|
|
804
804
|
constructor(e2) {
|
|
805
805
|
this.message = e2, this.captureException = () => {
|
|
806
806
|
console.error(this.message);
|
|
@@ -815,42 +815,42 @@ var Gt = class {
|
|
|
815
815
|
};
|
|
816
816
|
}
|
|
817
817
|
};
|
|
818
|
-
var
|
|
819
|
-
var
|
|
820
|
-
var
|
|
821
|
-
function
|
|
818
|
+
var qt = (e2) => new Kt(e2);
|
|
819
|
+
var Jt = Gt({ getMonitoringClient: (e2) => () => e2.getMonitoringClient ? e2.getMonitoringClient() : qt(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`) });
|
|
820
|
+
var B = { 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` };
|
|
821
|
+
function V(e2) {
|
|
822
822
|
try {
|
|
823
|
-
let t2 =
|
|
823
|
+
let t2 = Jt.getMonitoringClient?.();
|
|
824
824
|
return t2 && typeof t2[e2] == `function` ? t2 : null;
|
|
825
825
|
} catch {
|
|
826
826
|
return null;
|
|
827
827
|
}
|
|
828
828
|
}
|
|
829
|
-
function
|
|
830
|
-
let a2 =
|
|
829
|
+
function H(e2, { feature: t2, action: n2, level: r2 = `error`, contexts: i2 }) {
|
|
830
|
+
let a2 = V(`captureException`);
|
|
831
831
|
if (!a2) return;
|
|
832
832
|
let o2 = e2 instanceof Error ? e2 : Error(String(e2));
|
|
833
833
|
a2.captureException(o2, { level: r2, tags: { feature: t2, action: n2 }, ...i2 ? { contexts: i2 } : {} });
|
|
834
834
|
}
|
|
835
|
-
function
|
|
836
|
-
let i2 =
|
|
835
|
+
function Yt(e2, { feature: t2, tags: n2 }, r2) {
|
|
836
|
+
let i2 = V(`startSpanManual`);
|
|
837
837
|
if (!i2) return r2;
|
|
838
838
|
let a2 = i2.startSpanManual({ name: e2, tags: { feature: t2, ...n2 } });
|
|
839
839
|
return r2.then(() => a2.end(), (e3) => a2.fail(e3)), r2;
|
|
840
840
|
}
|
|
841
|
-
var
|
|
841
|
+
var Xt = class extends e {
|
|
842
842
|
state = { hasError: false };
|
|
843
843
|
static getDerivedStateFromError() {
|
|
844
844
|
return { hasError: true };
|
|
845
845
|
}
|
|
846
846
|
componentDidCatch(e2, t2) {
|
|
847
|
-
|
|
847
|
+
H(e2, { feature: this.props.feature ?? `service`, action: `render`, contexts: { react: { componentStack: t2.componentStack } } });
|
|
848
848
|
}
|
|
849
849
|
render() {
|
|
850
850
|
return this.state.hasError ? this.props.fallback : this.props.children;
|
|
851
851
|
}
|
|
852
852
|
};
|
|
853
|
-
function
|
|
853
|
+
function Zt(e2) {
|
|
854
854
|
let t2 = e2;
|
|
855
855
|
if (t2.__state || (t2.__state = { status: `pending` }, t2.then((e3) => {
|
|
856
856
|
t2.__state = { status: `fulfilled`, value: e3 };
|
|
@@ -859,27 +859,27 @@ function Xt(e2) {
|
|
|
859
859
|
})), t2.__state.status === `fulfilled`) return t2.__state.value;
|
|
860
860
|
throw t2.__state.status === `rejected` ? t2.__state.reason : t2;
|
|
861
861
|
}
|
|
862
|
-
function
|
|
862
|
+
function U(e2) {
|
|
863
863
|
let t2 = Promise.resolve(e2);
|
|
864
864
|
return t2.__state = { status: `fulfilled`, value: e2 }, t2;
|
|
865
865
|
}
|
|
866
|
-
var
|
|
867
|
-
function
|
|
868
|
-
let r2 =
|
|
869
|
-
r2 || (r2 = /* @__PURE__ */ new WeakMap(),
|
|
866
|
+
var W = /* @__PURE__ */ new WeakMap();
|
|
867
|
+
function Qt(e2, t2, n2) {
|
|
868
|
+
let r2 = W.get(e2);
|
|
869
|
+
r2 || (r2 = /* @__PURE__ */ new WeakMap(), W.set(e2, r2));
|
|
870
870
|
let i2 = r2.get(t2);
|
|
871
871
|
i2 || (i2 = /* @__PURE__ */ new WeakMap(), r2.set(t2, i2));
|
|
872
872
|
let a2 = i2.get(n2);
|
|
873
873
|
if (!a2) {
|
|
874
874
|
let r3 = e2;
|
|
875
|
-
a2 = r3.__state?.status === `fulfilled` ?
|
|
875
|
+
a2 = r3.__state?.status === `fulfilled` ? U(t2(r3.__state.value)) : r3.__state?.status === `rejected` ? U(n2(r3.__state.reason)) : e2.then(t2, n2), i2.set(n2, a2);
|
|
876
876
|
}
|
|
877
877
|
return a2;
|
|
878
878
|
}
|
|
879
|
-
function
|
|
879
|
+
function G(e2) {
|
|
880
880
|
return e2;
|
|
881
881
|
}
|
|
882
|
-
var $t =
|
|
882
|
+
var $t = G(`@wix/site-service-url`);
|
|
883
883
|
var K = `appSectionParams`;
|
|
884
884
|
function q(e2) {
|
|
885
885
|
let t2 = e2.searchParams.get(K);
|
|
@@ -942,32 +942,29 @@ function X() {
|
|
|
942
942
|
return { pathname: i2.pathname, search: i2.search, searchParams: i2.searchParams, href: i2.href, getParsedUrl: () => q(new URL(e2.currentUrl)), getRelativeUrl: () => an(e2.currentUrl, a2), getExternalBaseUrl: () => a2, pushUrl: tn };
|
|
943
943
|
}
|
|
944
944
|
var Z = { category: `category`, location: `location`, page: `page`, blob: `b`, resource: `resource`, referral: `referral`, timezone: `timezone`, bookingId: `bookingId`, token: `token`, rescheduleRedirectUrl: `rescheduleRedirectUrl` };
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
}
|
|
948
|
-
var sn = on(`@wix/site-service-warmup-data`);
|
|
949
|
-
function cn() {
|
|
945
|
+
var on = G(`@wix/site-service-warmup-data`);
|
|
946
|
+
function sn() {
|
|
950
947
|
try {
|
|
951
948
|
return u();
|
|
952
949
|
} catch {
|
|
953
950
|
return null;
|
|
954
951
|
}
|
|
955
952
|
}
|
|
956
|
-
function
|
|
953
|
+
function cn(e2) {
|
|
957
954
|
try {
|
|
958
|
-
return e2 ? e2(
|
|
955
|
+
return e2 ? e2(on) : null;
|
|
959
956
|
} catch {
|
|
960
957
|
return null;
|
|
961
958
|
}
|
|
962
959
|
}
|
|
963
|
-
function
|
|
964
|
-
let e2 =
|
|
960
|
+
function ln() {
|
|
961
|
+
let e2 = cn(sn()), t2 = typeof window > `u`;
|
|
965
962
|
return { scope: e2 ?? void 0, get: async (n2) => {
|
|
966
963
|
if (t2 || !e2) return null;
|
|
967
964
|
try {
|
|
968
965
|
return await e2.get(n2);
|
|
969
966
|
} catch (e3) {
|
|
970
|
-
return
|
|
967
|
+
return H(e3, { feature: B.warmup, action: `read`, level: `warning`, contexts: { warmup: { key: n2 } } }), null;
|
|
971
968
|
}
|
|
972
969
|
}, set: (n2, r2) => {
|
|
973
970
|
if (t2 && e2) try {
|
|
@@ -976,54 +973,54 @@ function un() {
|
|
|
976
973
|
}
|
|
977
974
|
} };
|
|
978
975
|
}
|
|
979
|
-
var
|
|
980
|
-
function
|
|
981
|
-
return `${
|
|
976
|
+
var un = `bookings-uou`;
|
|
977
|
+
function dn() {
|
|
978
|
+
return `${un}:categories:all`;
|
|
982
979
|
}
|
|
983
|
-
var
|
|
984
|
-
var
|
|
985
|
-
var
|
|
980
|
+
var fn = 5e3;
|
|
981
|
+
var pn = 100;
|
|
982
|
+
var mn = `wix-warmup-data`;
|
|
986
983
|
var Q = null;
|
|
987
|
-
function
|
|
984
|
+
function hn(e2) {
|
|
988
985
|
if (typeof document < `u`) try {
|
|
989
|
-
let t2 = document.getElementById(
|
|
986
|
+
let t2 = document.getElementById(mn)?.textContent;
|
|
990
987
|
return t2 ? (Q?.text !== t2 && (Q = { text: t2, data: JSON.parse(t2).builderComponentsWarmupData ?? {} }), Q.data[e2] ?? void 0) : void 0;
|
|
991
988
|
} catch {
|
|
992
989
|
return;
|
|
993
990
|
}
|
|
994
991
|
}
|
|
995
|
-
var
|
|
996
|
-
var
|
|
992
|
+
var gn = () => ({ promises: /* @__PURE__ */ new Map(), invalidatedWarmup: /* @__PURE__ */ new Set() });
|
|
993
|
+
var _n = gn();
|
|
994
|
+
var vn = /* @__PURE__ */ new WeakMap();
|
|
997
995
|
var yn = /* @__PURE__ */ new WeakMap();
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
return t2 || (t2 = _n(), yn.set(e2, t2)), t2;
|
|
996
|
+
function bn(e2) {
|
|
997
|
+
if (!e2) return _n;
|
|
998
|
+
let t2 = vn.get(e2);
|
|
999
|
+
return t2 || (t2 = gn(), vn.set(e2, t2)), t2;
|
|
1003
1000
|
}
|
|
1004
|
-
function
|
|
1001
|
+
function xn({ key: e2, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
|
|
1005
1002
|
if (e2 === null) return n2();
|
|
1006
1003
|
if (typeof window > `u`) {
|
|
1007
1004
|
let r3 = () => n2().then((n3) => (t2.set(e2, n3), n3)), { scope: i3 } = t2;
|
|
1008
1005
|
if (!i3) return r3();
|
|
1009
|
-
let a3 =
|
|
1010
|
-
a3 || (a3 = /* @__PURE__ */ new Map(),
|
|
1006
|
+
let a3 = yn.get(i3);
|
|
1007
|
+
a3 || (a3 = /* @__PURE__ */ new Map(), yn.set(i3, a3));
|
|
1011
1008
|
let o3 = a3.get(e2);
|
|
1012
1009
|
if (o3) return o3;
|
|
1013
1010
|
let s3 = r3();
|
|
1014
1011
|
return a3.set(e2, s3), s3.catch(() => a3.delete(e2)), s3;
|
|
1015
1012
|
}
|
|
1016
|
-
let i2 =
|
|
1013
|
+
let i2 = bn(t2.scope), a2 = Date.now();
|
|
1017
1014
|
for (let [e3, t3] of i2.promises) t3.expiresAt <= a2 && i2.promises.delete(e3);
|
|
1018
1015
|
let o2 = i2.promises.get(e2);
|
|
1019
1016
|
if (o2 && !r2) return o2.promise;
|
|
1020
1017
|
r2 && i2.invalidatedWarmup.add(e2);
|
|
1021
1018
|
let s2 = !i2.invalidatedWarmup.has(e2);
|
|
1022
1019
|
if (s2) {
|
|
1023
|
-
let t3 =
|
|
1020
|
+
let t3 = hn(e2);
|
|
1024
1021
|
if (t3 !== void 0) {
|
|
1025
|
-
let n3 =
|
|
1026
|
-
return i2.promises.set(e2, { promise: n3, expiresAt: a2 +
|
|
1022
|
+
let n3 = U(t3);
|
|
1023
|
+
return i2.promises.set(e2, { promise: n3, expiresAt: a2 + fn }), n3;
|
|
1027
1024
|
}
|
|
1028
1025
|
}
|
|
1029
1026
|
let c2 = (async () => {
|
|
@@ -1033,100 +1030,97 @@ function Sn({ key: e2, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
|
|
|
1033
1030
|
}
|
|
1034
1031
|
return n2();
|
|
1035
1032
|
})();
|
|
1036
|
-
i2.promises.size >=
|
|
1033
|
+
i2.promises.size >= pn && i2.promises.delete(i2.promises.keys().next().value);
|
|
1037
1034
|
let l2 = { promise: c2, expiresAt: 1 / 0 };
|
|
1038
1035
|
return i2.promises.set(e2, l2), c2.then(() => {
|
|
1039
|
-
l2.expiresAt = Date.now() +
|
|
1036
|
+
l2.expiresAt = Date.now() + fn;
|
|
1040
1037
|
}, () => {
|
|
1041
1038
|
i2.promises.get(e2) === l2 && i2.promises.delete(e2);
|
|
1042
1039
|
}), c2;
|
|
1043
1040
|
}
|
|
1044
|
-
function
|
|
1045
|
-
return
|
|
1041
|
+
function Sn(e2) {
|
|
1042
|
+
return ut(Object.assign(e2, { domainToMappings: { "*.dev.wix-code.com": [{ srcPath: `/_api/services-2`, destPath: `` }, { srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "www.wixapis.com": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }, { srcPath: `/bookings/services/v2/bulk/services`, destPath: `/v2/bulk/services` }], "manage._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], "editor._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], "blocks._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], "create.editorx": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], _: [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "www._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "bo._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "wixbo.ai": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "wix-bo.com": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "editor.wixapps.net": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "api._api_base_domain_": [{ srcPath: `/services-2`, destPath: `` }] } }));
|
|
1046
1043
|
}
|
|
1047
|
-
var
|
|
1048
|
-
function
|
|
1044
|
+
var Cn = `@wix/auto_sdk_bookings_services`;
|
|
1045
|
+
function wn(e2) {
|
|
1049
1046
|
function t2({ host: t3 }) {
|
|
1050
|
-
return { entityFqdn: `wix.bookings.services.v2.service`, method: `POST`, methodFqn: `wix.bookings.services.v2.ServicesService.QueryCategories`, packageName:
|
|
1047
|
+
return { entityFqdn: `wix.bookings.services.v2.service`, method: `POST`, methodFqn: `wix.bookings.services.v2.ServicesService.QueryCategories`, packageName: Cn, migrationOptions: { optInTransformResponse: true }, url: Sn({ protoPath: `/v2/services/categories/query`, data: e2, host: t3 }), data: e2 };
|
|
1051
1048
|
}
|
|
1052
1049
|
return t2;
|
|
1053
1050
|
}
|
|
1054
|
-
async function
|
|
1055
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 =
|
|
1051
|
+
async function Tn(e2) {
|
|
1052
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = wn(Ge({ filter: e2?.filter }));
|
|
1056
1053
|
n2?.onSiteCall?.();
|
|
1057
1054
|
try {
|
|
1058
1055
|
let e3 = await t2.request(r2);
|
|
1059
|
-
return n2?.onSuccess?.(e3),
|
|
1056
|
+
return n2?.onSuccess?.(e3), Ke(e3.data);
|
|
1060
1057
|
} catch (e3) {
|
|
1061
|
-
let t3 =
|
|
1058
|
+
let t3 = et(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { filter: `$[0].filter` }, singleArgumentUnchanged: false }, [`options`]);
|
|
1062
1059
|
throw n2?.onError?.(e3), t3;
|
|
1063
1060
|
}
|
|
1064
1061
|
}
|
|
1065
|
-
function
|
|
1066
|
-
return (t2) =>
|
|
1062
|
+
function En(e2) {
|
|
1063
|
+
return (t2) => Tn(t2, { httpClient: e2 });
|
|
1067
1064
|
}
|
|
1068
|
-
var
|
|
1069
|
-
async function
|
|
1070
|
-
return [...(await
|
|
1065
|
+
var Dn = lt(En);
|
|
1066
|
+
async function On() {
|
|
1067
|
+
return [...(await Dn({ filter: { services: {} } })).categories ?? []].sort((e2, t2) => (e2.sortOrder ?? 0) - (t2.sortOrder ?? 0));
|
|
1071
1068
|
}
|
|
1072
|
-
function
|
|
1069
|
+
function kn({ isLoading: e2, hasError: t2, refetch: n2, children: r2 }) {
|
|
1073
1070
|
let { searchParams: i2 } = X(), a2 = { categories: [], categoryItems: [], selectedCategoryId: i2.get(Z.category), selectedCategoryIndex: -1, selectedCategory: null, selectedCategoryName: null, hasMultipleCategories: false, isLoading: e2, hasError: t2, refetch: n2, selectCategory: () => {
|
|
1074
1071
|
} };
|
|
1075
1072
|
return f($.Provider, { value: a2, children: r2 });
|
|
1076
1073
|
}
|
|
1077
|
-
function
|
|
1078
|
-
return f(
|
|
1074
|
+
function An({ refetch: e2, children: t2 }) {
|
|
1075
|
+
return f(kn, { isLoading: true, hasError: false, refetch: e2, children: t2 });
|
|
1079
1076
|
}
|
|
1080
|
-
function
|
|
1081
|
-
return f(
|
|
1077
|
+
function jn({ refetch: e2, children: t2 }) {
|
|
1078
|
+
return f(kn, { isLoading: false, hasError: true, refetch: e2, children: t2 });
|
|
1082
1079
|
}
|
|
1083
|
-
function
|
|
1080
|
+
function Mn(e2) {
|
|
1084
1081
|
let t2 = e2?.$in ?? (e2?.$eq == null ? [] : [e2.$eq]);
|
|
1085
1082
|
return [...new Set(t2.filter((e3) => typeof e3 == `string` && e3 !== ``))].sort().join(`,`);
|
|
1086
1083
|
}
|
|
1087
|
-
function
|
|
1084
|
+
function Nn(e2) {
|
|
1088
1085
|
return e2 ? e2.split(`,`) : null;
|
|
1089
1086
|
}
|
|
1087
|
+
var Pn = G(`@wix/site-service-business-logger`);
|
|
1090
1088
|
function Fn(e2) {
|
|
1091
|
-
return e2;
|
|
1092
|
-
}
|
|
1093
|
-
var In = Fn(`@wix/viewer-service-business-logger`);
|
|
1094
|
-
function Ln(e2) {
|
|
1095
1089
|
return { evid: 32, src: 16, endpoint: ``, params: e2 };
|
|
1096
1090
|
}
|
|
1097
|
-
var
|
|
1091
|
+
var In = function(e2) {
|
|
1098
1092
|
return e2.BOOK_ONLINE = `bookingsBookOnline`, e2.SERVICE_PAGE = `bookingsServicePage`, e2.CALENDAR_PAGE = `bookingsCalendar`, e2.FORM_PAGE = `bookingsForm`, e2;
|
|
1099
1093
|
}({});
|
|
1100
|
-
var
|
|
1101
|
-
|
|
1102
|
-
var
|
|
1103
|
-
var
|
|
1104
|
-
let t2 = d(
|
|
1094
|
+
var Ln = { 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` };
|
|
1095
|
+
In.BOOK_ONLINE;
|
|
1096
|
+
var Rn = `new_bookings_server`;
|
|
1097
|
+
var zn = (e2) => {
|
|
1098
|
+
let { reportBi: t2 } = d(Pn);
|
|
1105
1099
|
return r((n2) => {
|
|
1106
|
-
t2
|
|
1100
|
+
t2({ widget_name: e2, bookingsPlatform: Rn, is_over_editor: false, ...n2.params, src: n2.src, evid: n2.evid }, { endpoint: n2.endpoint });
|
|
1107
1101
|
}, [t2, e2]);
|
|
1108
1102
|
};
|
|
1109
|
-
var
|
|
1110
|
-
let n2 =
|
|
1103
|
+
var Bn = (e2, t2 = true) => {
|
|
1104
|
+
let n2 = zn(e2), { getParsedUrl: r2 } = X(), i2 = s(false);
|
|
1111
1105
|
a(() => {
|
|
1112
|
-
t2 && !i2.current && (i2.current = true, n2(
|
|
1106
|
+
t2 && !i2.current && (i2.current = true, n2(Fn({ referralInfo: r2().searchParams.get(Z.referral) ?? void 0 })));
|
|
1113
1107
|
}, [t2, n2, r2]);
|
|
1114
1108
|
};
|
|
1115
1109
|
var $ = n(null);
|
|
1116
|
-
var
|
|
1117
|
-
function
|
|
1110
|
+
var Vn = `useCategoriesContext must be used within CategoriesContextProvider`;
|
|
1111
|
+
function Hn() {
|
|
1118
1112
|
let e2 = i($);
|
|
1119
|
-
if (!e2) throw Error(
|
|
1113
|
+
if (!e2) throw Error(Vn);
|
|
1120
1114
|
return e2;
|
|
1121
1115
|
}
|
|
1122
|
-
function
|
|
1116
|
+
function Un(e2, t2) {
|
|
1123
1117
|
return { categoryId: e2._id ?? null, categoryName: e2.name ?? null, isSelected: e2._id != null && e2._id === t2 };
|
|
1124
1118
|
}
|
|
1125
|
-
var
|
|
1126
|
-
var
|
|
1127
|
-
function
|
|
1128
|
-
let { categories: l2, hasError: u2 } =
|
|
1129
|
-
let e3 =
|
|
1119
|
+
var Wn = (e2) => ({ categories: e2, hasError: false });
|
|
1120
|
+
var Gn = () => ({ categories: [], hasError: true });
|
|
1121
|
+
function Kn({ categoriesPromise: e2, initialCategoryId: t2, categoryIdsKey: n2, refetch: i2, children: c2 }) {
|
|
1122
|
+
let { categories: l2, hasError: u2 } = Zt(e2), d2 = o(() => {
|
|
1123
|
+
let e3 = Nn(n2);
|
|
1130
1124
|
return e3 ? l2.filter((t3) => t3._id && e3.includes(t3._id)) : l2;
|
|
1131
1125
|
}, [l2, n2]), { pathname: p2, searchParams: m2, pushUrl: h2, getExternalBaseUrl: g2 } = X(), _2 = m2.get(Z.category), v2 = r((e3) => {
|
|
1132
1126
|
let t3 = new URLSearchParams(m2);
|
|
@@ -1137,21 +1131,21 @@ function Jn({ categoriesPromise: e2, initialCategoryId: t2, categoryIdsKey: n2,
|
|
|
1137
1131
|
a(() => {
|
|
1138
1132
|
y2.current || (y2.current = true, t2 && !m2.get(Z.category) && v2(t2));
|
|
1139
1133
|
}, [t2, m2, v2]);
|
|
1140
|
-
let b2 = d2.findIndex((e3) => e3._id === _2), x2 = d2.find((e3) => e3._id === _2) ?? null, S2 = d2.filter((e3) => e3._id).length > 1, C2 = o(() => ({ categories: d2, categoryItems: d2.map((e3) =>
|
|
1134
|
+
let b2 = d2.findIndex((e3) => e3._id === _2), x2 = d2.find((e3) => e3._id === _2) ?? null, S2 = d2.filter((e3) => e3._id).length > 1, C2 = o(() => ({ categories: d2, categoryItems: d2.map((e3) => Un(e3, _2)), selectedCategoryId: _2, selectedCategoryIndex: b2, selectedCategory: x2, selectedCategoryName: x2?.name ?? null, hasMultipleCategories: S2, isLoading: false, hasError: u2, refetch: i2, selectCategory: v2 }), [d2, _2, b2, x2, S2, u2, i2, v2]);
|
|
1141
1135
|
return f($.Provider, { value: C2, children: c2 });
|
|
1142
1136
|
}
|
|
1143
|
-
function
|
|
1144
|
-
|
|
1145
|
-
let s2 =
|
|
1146
|
-
return f(
|
|
1137
|
+
function qn({ initialCategoryId: e2, categoriesPicker: n2, refreshSignal: i2 = 0, children: a2 }) {
|
|
1138
|
+
Bn(Ln.CATEGORIES);
|
|
1139
|
+
let s2 = ln(), l2 = Mn(n2?.categoryId), [u2, d2] = c(0), p2 = o(() => Qt(xn({ key: dn(), refresh: u2 !== 0 || i2 !== 0, warmupData: s2, fetchData: () => Yt(`categories-context-load`, { feature: B.categories }, On()) }), Wn, Gn), [u2, i2]), m2 = r(() => d2((e3) => e3 + 1), []);
|
|
1140
|
+
return f(Xt, { fallback: f(jn, { refetch: m2, children: a2 }), feature: B.categories, children: f(t, { fallback: f(An, { refetch: m2, children: a2 }), children: f(Kn, { categoriesPromise: p2, initialCategoryId: e2, categoryIdsKey: l2, refetch: m2, children: a2 }) }) });
|
|
1147
1141
|
}
|
|
1148
|
-
var
|
|
1142
|
+
var Jn = Ht;
|
|
1149
1143
|
export {
|
|
1150
|
-
|
|
1151
|
-
|
|
1144
|
+
Vn as CATEGORIES_CONTEXT_MISSING_PROVIDER_ERROR,
|
|
1145
|
+
qn as CategoriesContextProvider,
|
|
1152
1146
|
$ as categoriesContext,
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1147
|
+
qn as default,
|
|
1148
|
+
Jn as injectAccessTokenGetter,
|
|
1149
|
+
Hn as useCategoriesContext
|
|
1156
1150
|
};
|
|
1157
|
-
//# sourceMappingURL=context-categories
|
|
1151
|
+
//# sourceMappingURL=context-categories.mjs.map
|