@wix/bookings 1.0.1749 → 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 +43 -43
- 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
|
@@ -17,19 +17,19 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
|
-
// context-locations
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
23
|
-
LOCATIONS_CONTEXT_MISSING_PROVIDER_ERROR: () =>
|
|
24
|
-
LocationsContextProvider: () =>
|
|
25
|
-
default: () =>
|
|
26
|
-
injectAccessTokenGetter: () =>
|
|
20
|
+
// context-locations.ts
|
|
21
|
+
var context_locations_exports = {};
|
|
22
|
+
__export(context_locations_exports, {
|
|
23
|
+
LOCATIONS_CONTEXT_MISSING_PROVIDER_ERROR: () => or,
|
|
24
|
+
LocationsContextProvider: () => fr,
|
|
25
|
+
default: () => fr,
|
|
26
|
+
injectAccessTokenGetter: () => pr,
|
|
27
27
|
locationsContext: () => $,
|
|
28
|
-
useLocationsContext: () =>
|
|
28
|
+
useLocationsContext: () => sr
|
|
29
29
|
});
|
|
30
|
-
module.exports = __toCommonJS(
|
|
30
|
+
module.exports = __toCommonJS(context_locations_exports);
|
|
31
31
|
|
|
32
|
-
// _sdk-exports/context-locations
|
|
32
|
+
// _sdk-exports/context-locations/runtime.js
|
|
33
33
|
var import_react = require("react");
|
|
34
34
|
var import_services_manager_react = require("@wix/services-manager-react");
|
|
35
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -96,20 +96,20 @@ var b = class extends Error {
|
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
98
|
var x = (e2, t2, n2, r2) => ({ details: { ...!n2?.validationError && { applicationError: { description: t2, code: e2, data: r2 } }, ...n2 }, message: t2, requestId: r2?.requestId });
|
|
99
|
-
var
|
|
100
|
-
var
|
|
101
|
-
var
|
|
102
|
-
function
|
|
99
|
+
var ee = (e2) => e2?.method && [`post`, `put`, `patch`].includes(e2.method.toLocaleLowerCase()) && e2.body ? { "Content-Type": `application/json` } : {};
|
|
100
|
+
var te = (e2) => e2 && typeof e2 == `object` && !Array.isArray(e2);
|
|
101
|
+
var ne = (e2) => e2.__type === `host`;
|
|
102
|
+
function re(e2, t2) {
|
|
103
103
|
return e2.create(t2);
|
|
104
104
|
}
|
|
105
|
-
var
|
|
106
|
-
function
|
|
107
|
-
return { [
|
|
105
|
+
var ie = `x-wix-bi-gateway`;
|
|
106
|
+
function ae(e2, t2, n2) {
|
|
107
|
+
return { [ie]: oe({ environment: `js-sdk${n2 ? `-${n2}` : ``}`, "package-name": e2.packageName ?? t2?.PACKAGE_NAME, "method-fqn": e2.methodFqn, entity: e2.entityFqdn }) };
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function oe(e2) {
|
|
110
110
|
return Object.entries(e2).filter(([e3, t2]) => !!t2).map(([e3, t2]) => `${e3}=${t2}`).join(`,`);
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function S(e2) {
|
|
113
113
|
let t2 = globalThis.__wix_context__, n2 = { client: p.client, elevatedClient: p.elevatedClient }, r2;
|
|
114
114
|
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);
|
|
115
115
|
try {
|
|
@@ -118,82 +118,82 @@ function C(e2) {
|
|
|
118
118
|
globalThis.__wix_context__ = t2, p.client = n2.client, p.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
var
|
|
122
|
-
function
|
|
123
|
-
return
|
|
121
|
+
var C = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
|
|
122
|
+
function w(e2) {
|
|
123
|
+
return de(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
|
|
124
124
|
}
|
|
125
|
-
var
|
|
126
|
-
var
|
|
127
|
-
var
|
|
128
|
-
var
|
|
129
|
-
function
|
|
125
|
+
var se = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
126
|
+
var ce = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
127
|
+
var le = `$1\0$2`;
|
|
128
|
+
var ue = /[^\p{L}\d]+/giu;
|
|
129
|
+
function de(e2) {
|
|
130
130
|
let t2 = e2.trim();
|
|
131
|
-
t2 = t2.replace(
|
|
131
|
+
t2 = t2.replace(se, le).replace(ce, le), t2 = t2.replace(ue, `\0`);
|
|
132
132
|
let n2 = 0, r2 = t2.length;
|
|
133
133
|
for (; t2.charAt(n2) === `\0`; ) n2++;
|
|
134
134
|
if (n2 === r2) return [];
|
|
135
135
|
for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
|
|
136
136
|
return t2.slice(n2, r2).split(/\0/g);
|
|
137
137
|
}
|
|
138
|
-
var
|
|
139
|
-
var
|
|
140
|
-
var
|
|
141
|
-
function
|
|
138
|
+
var fe = (e2) => `validationError` in (e2.response?.data?.details ?? {});
|
|
139
|
+
var pe = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
|
|
140
|
+
var me = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
|
|
141
|
+
function he(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
|
|
142
142
|
if (typeof e2 != `object` || !e2) throw e2;
|
|
143
|
-
if (
|
|
144
|
-
if (
|
|
145
|
-
if (
|
|
146
|
-
let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code:
|
|
147
|
-
return
|
|
143
|
+
if (fe(e2)) return ge(e2, t2, n2);
|
|
144
|
+
if (pe(e2)) return _e(e2);
|
|
145
|
+
if (me(e2)) {
|
|
146
|
+
let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: w(n3), data: {} }, requestId: e2.requestId };
|
|
147
|
+
return T(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
|
|
148
148
|
}
|
|
149
|
-
return
|
|
149
|
+
return ve(e2);
|
|
150
150
|
}
|
|
151
|
-
var
|
|
152
|
-
let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 =
|
|
153
|
-
return
|
|
151
|
+
var ge = (e2, t2, n2) => {
|
|
152
|
+
let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = ye(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 T(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
|
|
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 ??
|
|
158
|
-
return
|
|
155
|
+
var T = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
|
|
156
|
+
var _e = (e2) => {
|
|
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 ?? w(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 T(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 ve = (e2) => T(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: w(e2.response?.statusText ?? `UNKNOWN`), ...!e2.response && { runtimeError: e2 } } });
|
|
161
|
+
var ye = ({ 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: E(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, E(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 E = (e2, t2) => {
|
|
175
|
+
let n2 = be(e2);
|
|
176
176
|
return n2 == null ? e2 : e2.replace(`$[${n2}]`, t2[n2]);
|
|
177
177
|
};
|
|
178
|
-
var
|
|
178
|
+
var be = (e2) => {
|
|
179
179
|
let t2 = e2.match(/\$\[(?<argIndex>\d+)\]/);
|
|
180
180
|
return t2 && t2.groups && Number(t2.groups.argIndex);
|
|
181
181
|
};
|
|
182
|
-
function
|
|
183
|
-
return
|
|
182
|
+
function xe(e2, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
|
|
183
|
+
return S(() => 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]);
|
|
186
186
|
let o3 = s2?.HTTPHost ?? `www.wixapis.com`, u3 = `https://${l2 ? y : o3}${a3.url}`;
|
|
187
187
|
a3.params && a3.params.toString() && (u3 += `?${a3.params.toString()}`);
|
|
188
188
|
try {
|
|
189
|
-
let e4 =
|
|
189
|
+
let e4 = ae(i3, t2, c2), o4 = { method: a3.method, ...a3.data && { body: JSON.stringify(a3.data) }, headers: { ...e4 } }, s3 = await n2(u3, o4);
|
|
190
190
|
if (s3.status !== 200) {
|
|
191
191
|
let e5 = null;
|
|
192
192
|
try {
|
|
193
193
|
e5 = await s3.json();
|
|
194
194
|
} catch {
|
|
195
195
|
}
|
|
196
|
-
let t3 =
|
|
196
|
+
let t3 = Ce(s3.status, e5?.message ?? s3.statusText, e5?.details, { requestId: s3.headers.get(`X-Wix-Request-Id`), details: e5 }), n3 = he(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,18 +203,18 @@ function be(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 Se = 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
|
|
214
|
-
var
|
|
215
|
-
function
|
|
213
|
+
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 });
|
|
214
|
+
var we = `.`;
|
|
215
|
+
function Te(e2, t2, n2) {
|
|
216
216
|
if (e2 == null) throw Error(`Cannot set value on null or undefined`);
|
|
217
|
-
let r2 =
|
|
217
|
+
let r2 = Ee(t2), i2 = e2;
|
|
218
218
|
for (let e3 = 0; e3 < r2.length; e3++) {
|
|
219
219
|
let t3 = r2[e3];
|
|
220
220
|
if (e3 === r2.length - 1) {
|
|
@@ -226,21 +226,21 @@ function we(e2, t2, n2) {
|
|
|
226
226
|
}
|
|
227
227
|
return e2;
|
|
228
228
|
}
|
|
229
|
-
function Te(e2) {
|
|
230
|
-
return Array.isArray(e2) ? e2 : e2.split(Ce).map((e3) => Ee(e3) ? Number(e3) : e3);
|
|
231
|
-
}
|
|
232
229
|
function Ee(e2) {
|
|
233
|
-
return
|
|
230
|
+
return Array.isArray(e2) ? e2 : e2.split(we).map((e3) => De(e3) ? Number(e3) : e3);
|
|
234
231
|
}
|
|
235
232
|
function De(e2) {
|
|
233
|
+
return /^\d+$/.test(e2);
|
|
234
|
+
}
|
|
235
|
+
function Oe(e2) {
|
|
236
236
|
let t2 = {};
|
|
237
|
-
for (let [n2, r2] of Object.entries(e2))
|
|
237
|
+
for (let [n2, r2] of Object.entries(e2)) ke(n2) || Te(t2, Ee(n2), r2);
|
|
238
238
|
return t2;
|
|
239
239
|
}
|
|
240
|
-
function
|
|
240
|
+
function ke(e2) {
|
|
241
241
|
return e2 === `__proto__` || e2 === `constructor` || e2 === `prototype`;
|
|
242
242
|
}
|
|
243
|
-
var
|
|
243
|
+
var Ae = class {
|
|
244
244
|
BRACKET_PATTERN = /\[(\d+)\]/g;
|
|
245
245
|
NUMERIC_PATTERN = /^\d+$/;
|
|
246
246
|
ESCAPED_DOT_PATTERN = /\\\./g;
|
|
@@ -263,7 +263,7 @@ var ke = class {
|
|
|
263
263
|
return e2.replace(this.ESCAPED_DOT_PLACEHOLDER, `\\.`).replace(this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER, `\\]`).replace(this.ESCAPED_LEFT_BRACKET_PLACEHOLDER, `\\[`);
|
|
264
264
|
}
|
|
265
265
|
unflatten() {
|
|
266
|
-
return this.cleanedModifiedFields = Object.fromEntries(Object.entries(this.modifiedFields).map(([e2, t2]) => [this.replaceEscapedCharacters(this.bracketToDotNotation(e2)), t2])),
|
|
266
|
+
return this.cleanedModifiedFields = Object.fromEntries(Object.entries(this.modifiedFields).map(([e2, t2]) => [this.replaceEscapedCharacters(this.bracketToDotNotation(e2)), t2])), Oe(this.cleanedModifiedFields);
|
|
267
267
|
}
|
|
268
268
|
flatten(e2) {
|
|
269
269
|
let t2 = {};
|
|
@@ -283,12 +283,12 @@ var ke = class {
|
|
|
283
283
|
if (!Array.isArray(n2)) throw Error(`Expected array at path ${this.buildPathString(r2)}, but got ${typeof n2}`);
|
|
284
284
|
r2.push(`[${e3}]`), n2 = n2[parseInt(e3, 10)];
|
|
285
285
|
}, a2 = (e3, t3) => {
|
|
286
|
-
let i3 = e3 in
|
|
286
|
+
let i3 = e3 in C ? C[e3] : void 0;
|
|
287
287
|
if (i3 && i3 in t3) {
|
|
288
288
|
r2.push(i3), n2 = t3[i3];
|
|
289
289
|
return;
|
|
290
290
|
}
|
|
291
|
-
let a3 =
|
|
291
|
+
let a3 = Pe(e3);
|
|
292
292
|
if (a3 && a3 in t3) {
|
|
293
293
|
r2.push(a3), n2 = t3[a3];
|
|
294
294
|
return;
|
|
@@ -319,28 +319,28 @@ var ke = class {
|
|
|
319
319
|
return e2.replace(this.BRACKET_PATTERN, (t2, n2, r2) => r2 > 0 && e2[r2 - 1] === `\\` ? t2 : `.` + n2);
|
|
320
320
|
}
|
|
321
321
|
};
|
|
322
|
-
function
|
|
322
|
+
function je(e2, t2) {
|
|
323
323
|
let n2 = e2?.modifiedFields;
|
|
324
324
|
if (!n2) return null;
|
|
325
|
-
let r2 =
|
|
325
|
+
let r2 = Me(n2);
|
|
326
326
|
if (!r2) return null;
|
|
327
327
|
let { unflattenedModifiedFields: i2, modifiedFieldsManipulator: a2 } = r2;
|
|
328
328
|
e2 = { ...e2, modifiedFields: i2 };
|
|
329
329
|
let o2 = t2(e2), s2 = o2?.modifiedFields;
|
|
330
330
|
if (!s2) return null;
|
|
331
|
-
let c2 =
|
|
331
|
+
let c2 = Ne(s2, a2);
|
|
332
332
|
return c2 === null ? null : (o2.modifiedFields = c2, o2);
|
|
333
333
|
}
|
|
334
|
-
function
|
|
334
|
+
function Me(e2) {
|
|
335
335
|
if (typeof e2 == `object` && e2 && !Array.isArray(e2)) try {
|
|
336
|
-
let t2 = new
|
|
336
|
+
let t2 = new Ae(e2);
|
|
337
337
|
return { unflattenedModifiedFields: t2.unflatten(), modifiedFieldsManipulator: t2 };
|
|
338
338
|
} catch {
|
|
339
339
|
return null;
|
|
340
340
|
}
|
|
341
341
|
return null;
|
|
342
342
|
}
|
|
343
|
-
function
|
|
343
|
+
function Ne(e2, t2) {
|
|
344
344
|
if (typeof e2 == `object` && e2 && !Array.isArray(e2)) try {
|
|
345
345
|
return t2.flatten(e2);
|
|
346
346
|
} catch {
|
|
@@ -348,10 +348,10 @@ function Me(e2, t2) {
|
|
|
348
348
|
}
|
|
349
349
|
return null;
|
|
350
350
|
}
|
|
351
|
-
function
|
|
351
|
+
function Pe(e2) {
|
|
352
352
|
return e2.replace(/[-_\s]+(.)?/g, (e3, t2) => t2 ? t2.toUpperCase() : ``).replace(/^./, (e3) => e3.toLowerCase());
|
|
353
353
|
}
|
|
354
|
-
function
|
|
354
|
+
function Fe() {
|
|
355
355
|
return { emit(e2, ...t2) {
|
|
356
356
|
for (let n2 = 0, r2 = this.events[e2] || [], i2 = r2.length; n2 < i2; n2++) r2[n2](...t2);
|
|
357
357
|
}, events: {}, on(e2, t2) {
|
|
@@ -360,8 +360,8 @@ function Pe() {
|
|
|
360
360
|
};
|
|
361
361
|
} };
|
|
362
362
|
}
|
|
363
|
-
var
|
|
364
|
-
function
|
|
363
|
+
var Ie = (e2) => e2.__type === `event-definition`;
|
|
364
|
+
function Le(e2, t2, n2, r2) {
|
|
365
365
|
let i2;
|
|
366
366
|
if (e2.isDomainEvent) {
|
|
367
367
|
let { deletedEvent: e3, actionEvent: t3, createdEvent: a3, updatedEvent: o3, ...s3 } = n2, c2 = { ...r2, ...s3 };
|
|
@@ -372,14 +372,14 @@ function Ie(e2, t2, n2, r2) {
|
|
|
372
372
|
let e3 = s2.modifiedFields;
|
|
373
373
|
if (typeof e3 == `object` && e3 && !Array.isArray(e3)) {
|
|
374
374
|
o2 = structuredClone(i2);
|
|
375
|
-
let e4 =
|
|
375
|
+
let e4 = je(s2, a2);
|
|
376
376
|
if (e4) return t2(e4);
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
379
|
return t2(a2(o2));
|
|
380
380
|
}
|
|
381
|
-
function
|
|
382
|
-
let t2 = /* @__PURE__ */ new Map(), n2 =
|
|
381
|
+
function Re(e2) {
|
|
382
|
+
let t2 = /* @__PURE__ */ new Map(), n2 = Fe();
|
|
383
383
|
return { initModule(e3) {
|
|
384
384
|
return (r2) => {
|
|
385
385
|
let i2 = t2.get(e3.type) ?? [];
|
|
@@ -389,7 +389,7 @@ function Le(e2) {
|
|
|
389
389
|
let { eventType: r2, identity: i2, instanceId: a2, payload: o2, accountInfo: s2 } = await this.parseJWT(e3), c2 = [...n3.expectedEvents, ...Array.from(t2.keys()).map((e4) => ({ type: e4 }))];
|
|
390
390
|
if (c2.length > 0 && !c2.some(({ type: e4 }) => e4 === r2)) throw Error(`Unexpected event type: ${r2}. Expected one of: ${c2.map((e4) => e4.type).join(`, `)}`);
|
|
391
391
|
let l2 = t2.get(r2) ?? [];
|
|
392
|
-
return await Promise.all(l2.map(({ eventDefinition: e4, handler: t3 }) =>
|
|
392
|
+
return await Promise.all(l2.map(({ eventDefinition: e4, handler: t3 }) => Le(e4, t3, o2, { instanceId: a2, identity: i2, accountInfo: s2 }))), { instanceId: a2, eventType: r2, payload: o2, identity: i2, accountInfo: s2 };
|
|
393
393
|
}, async processRequest(e3, t3) {
|
|
394
394
|
let n3 = await e3.text();
|
|
395
395
|
return this.process(n3, t3);
|
|
@@ -408,12 +408,12 @@ function Le(e2) {
|
|
|
408
408
|
let n3 = Array.from(t2.keys()).map((e4) => ({ type: e4 }));
|
|
409
409
|
if (n3.length > 0 && !n3.some(({ type: t3 }) => t3 === e3.eventType)) throw Error(`Unexpected event type: ${e3.eventType}. Expected one of: ${n3.map((e4) => e4.type).join(`, `)}`);
|
|
410
410
|
let r2 = t2.get(e3.eventType) ?? [];
|
|
411
|
-
await Promise.all(r2.map(({ eventDefinition: t3, handler: n4 }) =>
|
|
411
|
+
await Promise.all(r2.map(({ eventDefinition: t3, handler: n4 }) => Le(t3, n4, e3.payload, { instanceId: e3.instanceId, identity: e3.identity })));
|
|
412
412
|
}, apps: { AppInstalled: m(`AppInstalled`)(), AppRemoved: m(`AppRemoved`)() } } };
|
|
413
413
|
}
|
|
414
|
-
var
|
|
415
|
-
function
|
|
416
|
-
let t2 = /* @__PURE__ */ new Map(), n2 =
|
|
414
|
+
var ze = (e2) => e2.__type === `service-plugin-definition`;
|
|
415
|
+
function Be(e2) {
|
|
416
|
+
let t2 = /* @__PURE__ */ new Map(), n2 = Fe();
|
|
417
417
|
return { initModule(e3) {
|
|
418
418
|
return (r2) => {
|
|
419
419
|
let i2 = t2.get(e3.componentType.toLowerCase()) ?? [];
|
|
@@ -454,43 +454,43 @@ function ze(e2) {
|
|
|
454
454
|
return s2.transformations.toREST(await c2(s2.transformations.fromREST(e3)));
|
|
455
455
|
} } };
|
|
456
456
|
}
|
|
457
|
-
var
|
|
458
|
-
function
|
|
457
|
+
var D = `X-Wix-Consistent`;
|
|
458
|
+
function Ve(e2) {
|
|
459
459
|
let t2 = e2.headers || { Authorization: `` }, n2 = { getAuthHeaders: (e3) => Promise.resolve({ headers: {} }) }, r2 = e2.auth, i2 = typeof r2 == `function` ? r2 : () => r2 ?? n2, a2 = () => i2().getAuthHeaders(e2.host), o2 = () => e2.fetch ?? fetch, s2 = async (n3, r3) => {
|
|
460
|
-
let i3 = o2(), s3 = await a2(), c3 = { ...r3?.headers ?? {}, ...s3.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [
|
|
460
|
+
let i3 = o2(), s3 = await a2(), c3 = { ...r3?.headers ?? {}, ...s3.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [D]: t2[D] } : {} }, l3 = e2.host?.getErrorHandler?.();
|
|
461
461
|
try {
|
|
462
462
|
if (typeof n3 == `string` || n3 instanceof URL) {
|
|
463
463
|
let e3 = await i3(n3, { ...r3, headers: c3 });
|
|
464
464
|
l3?.handleError(e3, { requestOptions: { url: n3.toString(), method: r3?.method } });
|
|
465
|
-
let a3 =
|
|
466
|
-
return a3 && (t2[
|
|
465
|
+
let a3 = O(e3);
|
|
466
|
+
return a3 && (t2[D] = a3), e3;
|
|
467
467
|
}
|
|
468
468
|
{
|
|
469
469
|
for (let [e4, t3] of Object.entries(c3)) typeof t3 == `string` && n3.headers.set(e4, t3);
|
|
470
470
|
let e3 = await i3(n3, r3);
|
|
471
471
|
l3?.handleError(e3, { requestOptions: { url: n3.url, method: r3?.method } });
|
|
472
|
-
let a3 =
|
|
473
|
-
return a3 && (t2[
|
|
472
|
+
let a3 = O(e3);
|
|
473
|
+
return a3 && (t2[D] = a3), e3;
|
|
474
474
|
}
|
|
475
475
|
} catch (e3) {
|
|
476
476
|
throw l3?.handleError(e3, { requestOptions: { url: typeof n3 == `string` || n3 instanceof URL ? n3.toString() : n3.url, method: r3?.method } }), e3;
|
|
477
477
|
}
|
|
478
|
-
}, { client: c2, initModule: l2 } =
|
|
479
|
-
let i3 = o2(), s3 = await a2(), c3 =
|
|
480
|
-
return u3 && (t2[
|
|
478
|
+
}, { client: c2, initModule: l2 } = Be(i2), { client: u2, initModule: d2 } = Re(i2), f2 = async (n3, r3) => {
|
|
479
|
+
let i3 = o2(), s3 = await a2(), c3 = ee(r3), l3 = await i3(n3, { ...r3, headers: { ...c3, ...t2, ...s3?.headers, ...r3?.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [D]: t2[D] } : {} } }), u3 = O(l3);
|
|
480
|
+
return u3 && (t2[D] = u3), l3;
|
|
481
481
|
}, m2 = (t3, n3) => {
|
|
482
|
-
if (
|
|
483
|
-
if (
|
|
484
|
-
if (
|
|
482
|
+
if (Ie(t3)) return d2(t3);
|
|
483
|
+
if (ze(t3)) return l2(t3);
|
|
484
|
+
if (ne(t3) && e2.host) return re(t3, e2.host);
|
|
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 xe(S(() => _(t3)) ? g(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);
|
|
492
492
|
}
|
|
493
|
-
return
|
|
493
|
+
return te(t3) ? Object.fromEntries(Object.entries(t3).map(([e3, n4]) => [e3, m2(n4, t3[v])])) : t3;
|
|
494
494
|
}, h2 = (e3) => {
|
|
495
495
|
for (let n3 in e3) t2[n3] = e3[n3];
|
|
496
496
|
};
|
|
@@ -509,19 +509,19 @@ function Be(e2) {
|
|
|
509
509
|
return { data: o3 ?? {}, errors: s3 };
|
|
510
510
|
}, webhooks: u2, servicePlugins: c2 };
|
|
511
511
|
}
|
|
512
|
-
function
|
|
512
|
+
function O(e2) {
|
|
513
513
|
return e2.headers?.get(`X-Wix-Consistent`) ?? e2.headers?.get(`x-wix-consistent`);
|
|
514
514
|
}
|
|
515
|
-
var
|
|
516
|
-
var
|
|
517
|
-
function
|
|
515
|
+
var He = { _id: `id`, _createdDate: `createdDate`, _updatedDate: `updatedDate` };
|
|
516
|
+
var Ue = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
|
|
517
|
+
function We(e2, t2) {
|
|
518
518
|
return e2?.split(`.`).map((e3) => t2?.[e3] ?? e3).join(`.`);
|
|
519
519
|
}
|
|
520
|
-
var
|
|
521
|
-
function
|
|
522
|
-
return (e2 ===
|
|
520
|
+
var k = `sort.fieldName`;
|
|
521
|
+
function Ge(e2, t2, n2) {
|
|
522
|
+
return (e2 === k || e2.endsWith(`.${k}`)) && typeof t2 == `string` ? We(t2, n2) : t2;
|
|
523
523
|
}
|
|
524
|
-
function
|
|
524
|
+
function A(e2, t2, n2) {
|
|
525
525
|
let r2 = (e3) => n2.includes(e3), i2 = (e3, n3) => {
|
|
526
526
|
if (Array.isArray(e3)) e3.forEach((e4) => {
|
|
527
527
|
i2(e4, n3);
|
|
@@ -531,144 +531,144 @@ function j(e2, t2, n2) {
|
|
|
531
531
|
Object.keys(a2).forEach((e4) => {
|
|
532
532
|
let o2 = n3 === `` ? e4 : `${n3}.${e4}`;
|
|
533
533
|
if (r2(o2)) return;
|
|
534
|
-
let s2 =
|
|
535
|
-
s2 !== e4 && !(s2 in a2) && (a2[s2] = a2[e4], delete a2[e4]), a2[s2] =
|
|
534
|
+
let s2 = Ke(e4, t2);
|
|
535
|
+
s2 !== e4 && !(s2 in a2) && (a2[s2] = a2[e4], delete a2[e4]), a2[s2] = Ge(o2, a2[s2], t2), i2(a2[s2], o2);
|
|
536
536
|
});
|
|
537
537
|
}
|
|
538
538
|
};
|
|
539
539
|
return i2(e2, ``), e2;
|
|
540
540
|
}
|
|
541
|
-
function
|
|
541
|
+
function Ke(e2, t2) {
|
|
542
542
|
let n2;
|
|
543
543
|
return n2 = e2.includes(`.`) ? e2.split(`.`).map((e3) => t2[e3] ?? e3).join(`.`) : t2[e2] ?? e2, n2;
|
|
544
544
|
}
|
|
545
|
-
function Ke(e2, t2 = []) {
|
|
546
|
-
return j(e2, Ve, t2);
|
|
547
|
-
}
|
|
548
545
|
function qe(e2, t2 = []) {
|
|
549
|
-
return
|
|
546
|
+
return A(e2, He, t2);
|
|
547
|
+
}
|
|
548
|
+
function Je(e2, t2 = []) {
|
|
549
|
+
return A(e2, Ue, t2);
|
|
550
550
|
}
|
|
551
|
-
var
|
|
552
|
-
function
|
|
551
|
+
var j = /* @__PURE__ */ new WeakMap();
|
|
552
|
+
function M() {
|
|
553
553
|
return { leaves: void 0, fields: void 0, mapFields: void 0, anyField: void 0 };
|
|
554
554
|
}
|
|
555
|
-
function
|
|
555
|
+
function Ye(e2, t2) {
|
|
556
556
|
let n2 = e2.get(t2);
|
|
557
|
-
return n2 || (n2 =
|
|
557
|
+
return n2 || (n2 = M(), e2.set(t2, n2)), n2;
|
|
558
558
|
}
|
|
559
|
-
function
|
|
560
|
-
return t2 === `*` ? (e2.anyField ??=
|
|
559
|
+
function Xe(e2, t2) {
|
|
560
|
+
return t2 === `*` ? (e2.anyField ??= M(), e2.anyField) : t2.endsWith(`{}`) ? (e2.mapFields ??= /* @__PURE__ */ new Map(), Ye(e2.mapFields, t2.slice(0, -2))) : (e2.fields ??= /* @__PURE__ */ new Map(), Ye(e2.fields, t2));
|
|
561
561
|
}
|
|
562
|
-
function
|
|
563
|
-
let t2 =
|
|
562
|
+
function Ze(e2) {
|
|
563
|
+
let t2 = M();
|
|
564
564
|
for (let n2 of e2) {
|
|
565
|
-
let e3 = n2.path.split(`.`).reduce(
|
|
565
|
+
let e3 = n2.path.split(`.`).reduce(Xe, t2);
|
|
566
566
|
e3.leaves ??= [], e3.leaves.push(n2);
|
|
567
567
|
}
|
|
568
568
|
return t2;
|
|
569
569
|
}
|
|
570
|
-
function
|
|
571
|
-
let t2 =
|
|
572
|
-
return t2 || (t2 =
|
|
570
|
+
function Qe(e2) {
|
|
571
|
+
let t2 = j.get(e2);
|
|
572
|
+
return t2 || (t2 = Ze(e2), j.set(e2, t2)), t2;
|
|
573
573
|
}
|
|
574
|
-
function
|
|
574
|
+
function N(e2) {
|
|
575
575
|
return typeof e2 == `object` && !!e2;
|
|
576
576
|
}
|
|
577
|
-
function
|
|
578
|
-
return t2 ? Array.isArray(e2) ? e2.map(r2) : e2 : n2 ?
|
|
577
|
+
function $e(e2, { isRepeated: t2, isMap: n2 }, r2) {
|
|
578
|
+
return t2 ? Array.isArray(e2) ? e2.map(r2) : e2 : n2 ? N(e2) ? Object.fromEntries(Object.entries(e2).map(([e3, t3]) => [e3, r2(t3)])) : e2 : r2(e2);
|
|
579
579
|
}
|
|
580
|
-
function
|
|
581
|
-
|
|
580
|
+
function P(e2, t2, n2) {
|
|
581
|
+
N(e2) && nt(e2, t2, n2);
|
|
582
582
|
}
|
|
583
|
-
function
|
|
583
|
+
function et(e2, t2, n2) {
|
|
584
584
|
for (let [r2, i2] of t2) {
|
|
585
585
|
if (!(r2 in e2)) continue;
|
|
586
|
-
if (i2.leaves) for (let t4 of i2.leaves) e2[r2] =
|
|
586
|
+
if (i2.leaves) for (let t4 of i2.leaves) e2[r2] = $e(e2[r2], t4, n2);
|
|
587
587
|
let t3 = e2[r2];
|
|
588
|
-
Array.isArray(t3) ? t3.forEach((e3) =>
|
|
588
|
+
Array.isArray(t3) ? t3.forEach((e3) => P(e3, i2, n2)) : P(t3, i2, n2);
|
|
589
589
|
}
|
|
590
590
|
}
|
|
591
|
-
function
|
|
591
|
+
function tt(e2, t2, n2) {
|
|
592
592
|
for (let [r2, i2] of t2) {
|
|
593
593
|
let t3 = e2[r2];
|
|
594
|
-
|
|
594
|
+
N(t3) && Object.values(t3).forEach((e3) => P(e3, i2, n2));
|
|
595
595
|
}
|
|
596
596
|
}
|
|
597
|
-
function
|
|
598
|
-
t2 &&
|
|
597
|
+
function nt(e2, { fields: t2, mapFields: n2, anyField: r2 }, i2) {
|
|
598
|
+
t2 && et(e2, t2, i2), n2 && tt(e2, n2, i2), r2 && Object.values(e2).forEach((e3) => P(e3, r2, i2));
|
|
599
599
|
}
|
|
600
|
-
function
|
|
601
|
-
if (!
|
|
602
|
-
for (let { paths: n2, transformFn: r2 } of t2)
|
|
600
|
+
function rt(e2, t2) {
|
|
601
|
+
if (!N(e2)) return e2;
|
|
602
|
+
for (let { paths: n2, transformFn: r2 } of t2) nt(e2, Qe(n2), r2);
|
|
603
603
|
return e2;
|
|
604
604
|
}
|
|
605
|
-
function
|
|
605
|
+
function it(e2) {
|
|
606
606
|
return Object.fromEntries(Object.entries(e2).filter(([, e3]) => e3 !== void 0));
|
|
607
607
|
}
|
|
608
|
-
function
|
|
609
|
-
return
|
|
608
|
+
function F(e2) {
|
|
609
|
+
return lt(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
|
|
610
610
|
}
|
|
611
|
-
var
|
|
612
|
-
var
|
|
613
|
-
var
|
|
614
|
-
var
|
|
615
|
-
function
|
|
611
|
+
var at = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
612
|
+
var ot = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
613
|
+
var st = `$1\0$2`;
|
|
614
|
+
var ct = /[^\p{L}\d]+/giu;
|
|
615
|
+
function lt(e2) {
|
|
616
616
|
let t2 = e2.trim();
|
|
617
|
-
t2 = t2.replace(
|
|
617
|
+
t2 = t2.replace(at, st).replace(ot, st), t2 = t2.replace(ct, `\0`);
|
|
618
618
|
let n2 = 0, r2 = t2.length;
|
|
619
619
|
for (; t2.charAt(n2) === `\0`; ) n2++;
|
|
620
620
|
if (n2 === r2) return [];
|
|
621
621
|
for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
|
|
622
622
|
return t2.slice(n2, r2).split(/\0/g);
|
|
623
623
|
}
|
|
624
|
-
var
|
|
625
|
-
var
|
|
626
|
-
var
|
|
627
|
-
function
|
|
624
|
+
var ut = (e2) => `validationError` in (e2.response?.data?.details ?? {});
|
|
625
|
+
var dt = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
|
|
626
|
+
var ft = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
|
|
627
|
+
function pt(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
|
|
628
628
|
if (typeof e2 != `object` || !e2) throw e2;
|
|
629
|
-
if (
|
|
630
|
-
if (
|
|
631
|
-
if (
|
|
632
|
-
let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code:
|
|
633
|
-
return
|
|
629
|
+
if (ut(e2)) return mt(e2, t2, n2);
|
|
630
|
+
if (dt(e2)) return ht(e2);
|
|
631
|
+
if (ft(e2)) {
|
|
632
|
+
let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: F(n3), data: {} }, requestId: e2.requestId };
|
|
633
|
+
return I(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
|
|
634
634
|
}
|
|
635
|
-
return
|
|
635
|
+
return gt(e2);
|
|
636
636
|
}
|
|
637
|
-
var
|
|
638
|
-
let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 =
|
|
639
|
-
return
|
|
637
|
+
var mt = (e2, t2, n2) => {
|
|
638
|
+
let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = _t(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 };
|
|
639
|
+
return I(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e2.response?.status, requestId: i2 } });
|
|
640
640
|
};
|
|
641
|
-
var
|
|
642
|
-
var
|
|
643
|
-
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 ??
|
|
644
|
-
return
|
|
641
|
+
var I = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
|
|
642
|
+
var ht = (e2) => {
|
|
643
|
+
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 ?? F(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 };
|
|
644
|
+
return I(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e2.requestId } });
|
|
645
645
|
};
|
|
646
|
-
var
|
|
647
|
-
var
|
|
646
|
+
var gt = (e2) => I(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: F(e2.response?.statusText ?? `UNKNOWN`), ...!e2.response && { runtimeError: e2 } } });
|
|
647
|
+
var _t = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
|
|
648
648
|
let a2 = { ...e2, ...t2 }, o2 = Object.keys(a2);
|
|
649
649
|
return r2?.filter((e3) => !r2.some((t3) => t3.field.length > e3.field.length && t3.field.startsWith(e3.field) && o2.includes(t3.field))).map((e3) => {
|
|
650
650
|
let r3 = t2[e3.field];
|
|
651
|
-
if (r3) return { ...e3, field:
|
|
651
|
+
if (r3) return { ...e3, field: L(r3, i2) };
|
|
652
652
|
let s2 = o2?.sort((e4, t3) => t3.length - e4.length)?.find((t3) => e3.field.startsWith(t3));
|
|
653
653
|
if (s2) {
|
|
654
654
|
let t3 = a2[s2];
|
|
655
|
-
if (t3) return { ...e3, field: e3.field.replace(s2,
|
|
655
|
+
if (t3) return { ...e3, field: e3.field.replace(s2, L(t3, i2)) };
|
|
656
656
|
}
|
|
657
657
|
return n2 ? { ...e3, field: `${i2[0]}.${e3.field}` } : e3;
|
|
658
658
|
});
|
|
659
659
|
};
|
|
660
|
-
var
|
|
661
|
-
let n2 =
|
|
660
|
+
var L = (e2, t2) => {
|
|
661
|
+
let n2 = vt(e2);
|
|
662
662
|
return n2 == null ? e2 : e2.replace(`$[${n2}]`, t2[n2]);
|
|
663
663
|
};
|
|
664
|
-
var
|
|
664
|
+
var vt = (e2) => {
|
|
665
665
|
let t2 = e2.match(/\$\[(?<argIndex>\d+)\]/);
|
|
666
666
|
return t2 && t2.groups && Number(t2.groups.argIndex);
|
|
667
667
|
};
|
|
668
|
-
function
|
|
668
|
+
function yt() {
|
|
669
669
|
let e2 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
670
670
|
if (e2) return { initWixModules(t3, n3) {
|
|
671
|
-
return
|
|
671
|
+
return R(() => e2(t3, n3));
|
|
672
672
|
}, fetchWithAuth() {
|
|
673
673
|
throw Error(`fetchWithAuth is not available in this context`);
|
|
674
674
|
}, graphql() {
|
|
@@ -678,10 +678,10 @@ function vt() {
|
|
|
678
678
|
if (t2 || n2) return { initWixModules(e3, r2) {
|
|
679
679
|
if (r2) {
|
|
680
680
|
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`);
|
|
681
|
-
return
|
|
681
|
+
return R(() => n2.use(e3));
|
|
682
682
|
}
|
|
683
683
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
684
|
-
return
|
|
684
|
+
return R(() => t2.use(e3));
|
|
685
685
|
}, fetchWithAuth: (e3, n3) => {
|
|
686
686
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
687
687
|
return t2.fetchWithAuth(e3, n3);
|
|
@@ -693,7 +693,7 @@ function vt() {
|
|
|
693
693
|
return t2.graphql(e3, n3, r2);
|
|
694
694
|
} };
|
|
695
695
|
}
|
|
696
|
-
function
|
|
696
|
+
function R(e2) {
|
|
697
697
|
let t2 = globalThis.__wix_context__, n2 = { client: p.client, elevatedClient: p.elevatedClient }, r2;
|
|
698
698
|
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);
|
|
699
699
|
try {
|
|
@@ -702,78 +702,78 @@ function z(e2) {
|
|
|
702
702
|
globalThis.__wix_context__ = t2, p.client = n2.client, p.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
703
703
|
}
|
|
704
704
|
}
|
|
705
|
-
function
|
|
705
|
+
function bt(e2, t2) {
|
|
706
706
|
return (...n2) => {
|
|
707
|
-
let r2 =
|
|
707
|
+
let r2 = yt();
|
|
708
708
|
return r2 ? r2.initWixModules(e2, t2).apply(void 0, n2) : e2.apply(void 0, n2);
|
|
709
709
|
};
|
|
710
710
|
}
|
|
711
|
-
function
|
|
712
|
-
return
|
|
713
|
-
}
|
|
714
|
-
function
|
|
715
|
-
let t2 =
|
|
716
|
-
return
|
|
717
|
-
}
|
|
718
|
-
var
|
|
719
|
-
var
|
|
720
|
-
var
|
|
721
|
-
var
|
|
722
|
-
var
|
|
723
|
-
var
|
|
724
|
-
var
|
|
725
|
-
var
|
|
726
|
-
var
|
|
727
|
-
var
|
|
728
|
-
function Mt(e2) {
|
|
729
|
-
return Nt(e2).replace(Tt, `._base_domain_`).replace(At, `._api_base_domain_`).replace(jt, `*.dev.wix-code.com`);
|
|
730
|
-
}
|
|
711
|
+
function xt(e2, t2 = false) {
|
|
712
|
+
return bt(e2, t2);
|
|
713
|
+
}
|
|
714
|
+
function St(e2) {
|
|
715
|
+
let t2 = Ft(Nt(e2.host), e2.domainToMappings);
|
|
716
|
+
return Wt(Vt(e2.protoPath, e2.data || {}), t2);
|
|
717
|
+
}
|
|
718
|
+
var Ct = [`wix.com`, `editorx.com`];
|
|
719
|
+
var wt = `_`;
|
|
720
|
+
var Tt = `*.`;
|
|
721
|
+
var Et = RegExp(`\\.(${Ct.join(`|`)})$`);
|
|
722
|
+
var Dt = [`42.wixprod.net`, `uw2-edt-1.wixprod.net`, `virginia-edt.wixprod.net`];
|
|
723
|
+
var Ot = { "payments.base44.com": `manage.wix.com`, "create.editorx.com": `editor.editorx.com` };
|
|
724
|
+
var kt = `dev.wix-code.com`;
|
|
725
|
+
var At = /{(.*)}/;
|
|
726
|
+
var jt = RegExp(`\\.(${Dt.join(`|`)})$`);
|
|
727
|
+
var Mt = RegExp(`.*\\.${kt}$`);
|
|
731
728
|
function Nt(e2) {
|
|
732
|
-
return
|
|
729
|
+
return Pt(e2).replace(Et, `._base_domain_`).replace(jt, `._api_base_domain_`).replace(Mt, `*.dev.wix-code.com`);
|
|
730
|
+
}
|
|
731
|
+
function Pt(e2) {
|
|
732
|
+
return Ot[e2] ?? e2;
|
|
733
733
|
}
|
|
734
|
-
function
|
|
734
|
+
function Ft(e2, t2) {
|
|
735
735
|
let n2 = t2[e2];
|
|
736
736
|
if (n2) return n2;
|
|
737
|
-
let r2 =
|
|
737
|
+
let r2 = It(e2, t2) ?? Lt(e2, t2);
|
|
738
738
|
if (!r2) {
|
|
739
|
-
if (
|
|
740
|
-
let e3 = t2[
|
|
739
|
+
if (zt(e2)) {
|
|
740
|
+
let e3 = t2[Bt];
|
|
741
741
|
if (e3) return e3;
|
|
742
742
|
}
|
|
743
|
-
let n3 = t2[
|
|
743
|
+
let n3 = t2[wt];
|
|
744
744
|
if (n3) return n3;
|
|
745
745
|
}
|
|
746
746
|
return r2 ?? [];
|
|
747
747
|
}
|
|
748
|
-
function
|
|
748
|
+
function It(e2, t2) {
|
|
749
749
|
return Object.entries(t2).find(([t3]) => {
|
|
750
750
|
let [, ...n2] = e2.split(`.`);
|
|
751
751
|
return n2.join(`.`) === t3;
|
|
752
752
|
})?.[1];
|
|
753
753
|
}
|
|
754
|
-
function
|
|
755
|
-
let [n2] = Object.entries(t2).filter(([t3]) =>
|
|
754
|
+
function Lt(e2, t2) {
|
|
755
|
+
let [n2] = Object.entries(t2).filter(([t3]) => Rt(e2, t3)).sort(([e3], [t3]) => t3.length - e3.length);
|
|
756
756
|
if (!n2) return;
|
|
757
757
|
let [, r2] = n2;
|
|
758
758
|
return r2;
|
|
759
759
|
}
|
|
760
|
-
function
|
|
761
|
-
if (!t2.startsWith(
|
|
760
|
+
function Rt(e2, t2) {
|
|
761
|
+
if (!t2.startsWith(Tt)) return false;
|
|
762
762
|
let n2 = t2.slice(1);
|
|
763
763
|
return e2.length > n2.length && e2.endsWith(n2);
|
|
764
764
|
}
|
|
765
|
-
function
|
|
765
|
+
function zt(e2) {
|
|
766
766
|
return !!e2.match(/\._base_domain_$/);
|
|
767
767
|
}
|
|
768
|
-
var
|
|
769
|
-
function Bt(e2, t2) {
|
|
770
|
-
return e2.split(`/`).map((e3) => Vt(e3, t2)).join(`/`);
|
|
771
|
-
}
|
|
768
|
+
var Bt = `www._base_domain_`;
|
|
772
769
|
function Vt(e2, t2) {
|
|
773
|
-
|
|
774
|
-
return r2 ? Ht(t2, r2, e2, e2.replace(n2[0], ``)) : e2;
|
|
770
|
+
return e2.split(`/`).map((e3) => Ht(e3, t2)).join(`/`);
|
|
775
771
|
}
|
|
776
|
-
function Ht(e2, t2
|
|
772
|
+
function Ht(e2, t2) {
|
|
773
|
+
let n2 = e2.match(At) || [], r2 = n2[1];
|
|
774
|
+
return r2 ? Ut(t2, r2, e2, e2.replace(n2[0], ``)) : e2;
|
|
775
|
+
}
|
|
776
|
+
function Ut(e2, t2, n2, r2) {
|
|
777
777
|
let i2 = e2;
|
|
778
778
|
for (let e3 of t2.split(`.`)) {
|
|
779
779
|
if (!i2) return n2;
|
|
@@ -781,39 +781,39 @@ function Ht(e2, t2, n2, r2) {
|
|
|
781
781
|
}
|
|
782
782
|
return `${i2}${r2}`;
|
|
783
783
|
}
|
|
784
|
-
function
|
|
784
|
+
function Wt(e2, t2) {
|
|
785
785
|
let n2 = t2?.find((t3) => e2.startsWith(t3.destPath));
|
|
786
786
|
return n2 ? n2.srcPath + e2.slice(n2.destPath.length) : e2;
|
|
787
787
|
}
|
|
788
|
-
function
|
|
788
|
+
function Gt(e2) {
|
|
789
789
|
return e2 === `NaN` ? NaN : e2 === `Infinity` ? 1 / 0 : e2 === `-Infinity` ? -1 / 0 : e2;
|
|
790
790
|
}
|
|
791
|
-
function
|
|
792
|
-
return e2 &&
|
|
793
|
-
}
|
|
794
|
-
var
|
|
795
|
-
var
|
|
796
|
-
var
|
|
797
|
-
var
|
|
798
|
-
let e2 =
|
|
799
|
-
if (e2) return { [
|
|
791
|
+
function Kt(e2) {
|
|
792
|
+
return e2 && it({ formatted: e2.formattedAddress, location: e2.geocode, addressLine1: e2.addressLine, addressLine2: e2.addressLine2, streetAddress: e2.streetAddress && { name: e2.streetAddress.name, number: e2.streetAddress.number, apt: e2.streetAddress.apt, formattedAddressLine: e2.streetAddress.formattedAddressLine }, hint: e2.hint, city: e2.city, subdivision: e2.subdivision, country: e2.country, postalCode: e2.postalCode, countryFullname: e2.countryFullname, subdivisionFullname: e2.subdivisionFullname });
|
|
793
|
+
}
|
|
794
|
+
var qt = `x-wix-linguist`;
|
|
795
|
+
var Jt = `00000000-0000-0000-0000-000000000000`;
|
|
796
|
+
var Yt = `false`;
|
|
797
|
+
var Xt = () => {
|
|
798
|
+
let e2 = z(`language`), t2 = z(`locale`);
|
|
799
|
+
if (e2) return { [qt]: [e2, t2 || e2, Yt, Jt].join(`|`) };
|
|
800
800
|
};
|
|
801
|
-
function
|
|
801
|
+
function Zt() {
|
|
802
802
|
let e2 = null, t2 = null;
|
|
803
803
|
return { promise: new Promise((n2, r2) => {
|
|
804
804
|
e2 = n2, t2 = r2;
|
|
805
805
|
}), resolve: e2, reject: t2 };
|
|
806
806
|
}
|
|
807
|
-
var
|
|
808
|
-
var
|
|
809
|
-
let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e2(t2), o2 =
|
|
810
|
-
return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language:
|
|
811
|
-
return
|
|
807
|
+
var z = (e2) => typeof window < `u` ? window.commonConfig?.[e2] : void 0;
|
|
808
|
+
var Qt = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host: (t2) => {
|
|
809
|
+
let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e2(t2), o2 = en();
|
|
810
|
+
return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language: z(`language`), locale: z(`locale`), get passThroughHeaders() {
|
|
811
|
+
return Xt();
|
|
812
812
|
} } };
|
|
813
813
|
}, auth: (e3) => {
|
|
814
814
|
let t2 = typeof window < `u` ? window.wixEmbedsAPI : void 0;
|
|
815
|
-
!e3 &&
|
|
816
|
-
let n2 = false, { resolve: r2, promise: i2 } =
|
|
815
|
+
!e3 && $t() && (e3 = t2?.getAccessTokenFunction?.());
|
|
816
|
+
let n2 = false, { resolve: r2, promise: i2 } = Zt();
|
|
817
817
|
return { getAuthHeaders: async () => {
|
|
818
818
|
if (!e3 && n2 && (e3 = await i2), !e3) throw Error(`Failed to resolve auth token`);
|
|
819
819
|
return { headers: { Authorization: await e3() } };
|
|
@@ -821,36 +821,36 @@ var Zt = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host:
|
|
|
821
821
|
r2(e4);
|
|
822
822
|
}) };
|
|
823
823
|
} });
|
|
824
|
-
function
|
|
824
|
+
function $t() {
|
|
825
825
|
return typeof document < `u` && document.currentScript?.tagName === `SCRIPT`;
|
|
826
826
|
}
|
|
827
|
-
function
|
|
827
|
+
function en() {
|
|
828
828
|
let e2 = (typeof window < `u` ? window.wixEmbedsAPI : void 0)?.getExternalBaseUrl?.();
|
|
829
829
|
if (!e2) return;
|
|
830
830
|
let t2 = new URL(e2);
|
|
831
831
|
return t2?.pathname && t2.pathname !== `/` ? `${t2.hostname}${t2.pathname}` : t2.hostname;
|
|
832
832
|
}
|
|
833
|
-
var
|
|
833
|
+
var tn = ({ clientSdk: e2, applicationId: t2 }) => ({ invoke: async ({ namespace: n2, method: r2, args: i2 }) => {
|
|
834
834
|
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`);
|
|
835
835
|
return e2.invoke({ namespace: n2, method: r2, args: i2, applicationId: t2, accessToken: `accessToken` });
|
|
836
836
|
}, getAccessToken: () => {
|
|
837
837
|
throw Error(`Not implemented`);
|
|
838
838
|
}, observeState: () => ({ disconnect: () => {
|
|
839
839
|
} }) });
|
|
840
|
-
var
|
|
840
|
+
var B = Qt({ createHost: function(e2) {
|
|
841
841
|
let t2 = (typeof $wixContext < `u` ? $wixContext.clientSdk : void 0) ?? e2?.clientSdk ?? (typeof window < `u` ? window?.clientSdk : void 0), { applicationId: n2 } = e2 || {};
|
|
842
842
|
if (!n2) throw Error(`"createHost" was called without a required field "applicationId"`);
|
|
843
|
-
return { channel:
|
|
843
|
+
return { channel: tn({ clientSdk: t2, applicationId: n2 }), close: () => {
|
|
844
844
|
} };
|
|
845
845
|
} });
|
|
846
|
-
var
|
|
847
|
-
let n2 =
|
|
848
|
-
return
|
|
846
|
+
var nn = ((e2, t2) => {
|
|
847
|
+
let n2 = B.host({ applicationId: e2, componentId: t2 }), r2 = B.auth();
|
|
848
|
+
return Ve({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
|
|
849
849
|
})(`13d21c63-b5ec-5912-8397-c3a5ddb27a97`);
|
|
850
|
-
function
|
|
850
|
+
function rn() {
|
|
851
851
|
let e2 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
852
852
|
if (e2) return { initWixModules(t3, n3) {
|
|
853
|
-
return
|
|
853
|
+
return V(() => e2(t3, n3));
|
|
854
854
|
}, fetchWithAuth() {
|
|
855
855
|
throw Error(`fetchWithAuth is not available in this context`);
|
|
856
856
|
}, graphql() {
|
|
@@ -860,10 +860,10 @@ function nn() {
|
|
|
860
860
|
if (t2 || n2) return { initWixModules(e3, r2) {
|
|
861
861
|
if (r2) {
|
|
862
862
|
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`);
|
|
863
|
-
return
|
|
863
|
+
return V(() => n2.use(e3));
|
|
864
864
|
}
|
|
865
865
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
866
|
-
return
|
|
866
|
+
return V(() => t2.use(e3));
|
|
867
867
|
}, fetchWithAuth: (e3, n3) => {
|
|
868
868
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
869
869
|
return t2.fetchWithAuth(e3, n3);
|
|
@@ -875,7 +875,7 @@ function nn() {
|
|
|
875
875
|
return t2.graphql(e3, n3, r2);
|
|
876
876
|
} };
|
|
877
877
|
}
|
|
878
|
-
function
|
|
878
|
+
function V(e2) {
|
|
879
879
|
let t2 = globalThis.__wix_context__, n2 = { client: p.client, elevatedClient: p.elevatedClient }, r2;
|
|
880
880
|
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);
|
|
881
881
|
try {
|
|
@@ -884,17 +884,17 @@ function H(e2) {
|
|
|
884
884
|
globalThis.__wix_context__ = t2, p.client = n2.client, p.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
885
885
|
}
|
|
886
886
|
}
|
|
887
|
-
function
|
|
887
|
+
function an(e2, t2) {
|
|
888
888
|
return { ...e2, ...Object.fromEntries(t2.map((t3) => [t3, (...n2) => {
|
|
889
|
-
let r2 =
|
|
889
|
+
let r2 = rn();
|
|
890
890
|
if (!r2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
891
891
|
return r2.initWixModules(e2)[t3].apply(void 0, n2);
|
|
892
892
|
}])) };
|
|
893
893
|
}
|
|
894
|
-
function
|
|
895
|
-
return
|
|
894
|
+
function on(e2) {
|
|
895
|
+
return an({ __type: `host`, create: (t2) => Object.entries(e2).reduce((e3, [n2, r2]) => ({ ...e3, [n2]: r2(t2) }), {}) }, Object.keys(e2));
|
|
896
896
|
}
|
|
897
|
-
var
|
|
897
|
+
var sn = class {
|
|
898
898
|
constructor(e2) {
|
|
899
899
|
this.message = e2, this.captureException = () => {
|
|
900
900
|
console.error(this.message);
|
|
@@ -909,42 +909,42 @@ var on = class {
|
|
|
909
909
|
};
|
|
910
910
|
}
|
|
911
911
|
};
|
|
912
|
-
var
|
|
913
|
-
var
|
|
914
|
-
var
|
|
915
|
-
function
|
|
912
|
+
var cn = (e2) => new sn(e2);
|
|
913
|
+
var ln = on({ getMonitoringClient: (e2) => () => e2.getMonitoringClient ? e2.getMonitoringClient() : cn(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`) });
|
|
914
|
+
var H = { 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` };
|
|
915
|
+
function U(e2) {
|
|
916
916
|
try {
|
|
917
|
-
let t2 =
|
|
917
|
+
let t2 = ln.getMonitoringClient?.();
|
|
918
918
|
return t2 && typeof t2[e2] == `function` ? t2 : null;
|
|
919
919
|
} catch {
|
|
920
920
|
return null;
|
|
921
921
|
}
|
|
922
922
|
}
|
|
923
|
-
function
|
|
924
|
-
let a2 =
|
|
923
|
+
function W(e2, { feature: t2, action: n2, level: r2 = `error`, contexts: i2 }) {
|
|
924
|
+
let a2 = U(`captureException`);
|
|
925
925
|
if (!a2) return;
|
|
926
926
|
let o2 = e2 instanceof Error ? e2 : Error(String(e2));
|
|
927
927
|
a2.captureException(o2, { level: r2, tags: { feature: t2, action: n2 }, ...i2 ? { contexts: i2 } : {} });
|
|
928
928
|
}
|
|
929
|
-
function
|
|
930
|
-
let i2 =
|
|
929
|
+
function un(e2, { feature: t2, tags: n2 }, r2) {
|
|
930
|
+
let i2 = U(`startSpanManual`);
|
|
931
931
|
if (!i2) return r2;
|
|
932
932
|
let a2 = i2.startSpanManual({ name: e2, tags: { feature: t2, ...n2 } });
|
|
933
933
|
return r2.then(() => a2.end(), (e3) => a2.fail(e3)), r2;
|
|
934
934
|
}
|
|
935
|
-
var
|
|
935
|
+
var dn = class extends import_react.Component {
|
|
936
936
|
state = { hasError: false };
|
|
937
937
|
static getDerivedStateFromError() {
|
|
938
938
|
return { hasError: true };
|
|
939
939
|
}
|
|
940
940
|
componentDidCatch(e2, t2) {
|
|
941
|
-
|
|
941
|
+
W(e2, { feature: this.props.feature ?? `service`, action: `render`, contexts: { react: { componentStack: t2.componentStack } } });
|
|
942
942
|
}
|
|
943
943
|
render() {
|
|
944
944
|
return this.state.hasError ? this.props.fallback : this.props.children;
|
|
945
945
|
}
|
|
946
946
|
};
|
|
947
|
-
function
|
|
947
|
+
function fn(e2) {
|
|
948
948
|
let t2 = e2;
|
|
949
949
|
if (t2.__state || (t2.__state = { status: `pending` }, t2.then((e3) => {
|
|
950
950
|
t2.__state = { status: `fulfilled`, value: e3 };
|
|
@@ -953,27 +953,27 @@ function dn(e2) {
|
|
|
953
953
|
})), t2.__state.status === `fulfilled`) return t2.__state.value;
|
|
954
954
|
throw t2.__state.status === `rejected` ? t2.__state.reason : t2;
|
|
955
955
|
}
|
|
956
|
-
function
|
|
956
|
+
function G(e2) {
|
|
957
957
|
let t2 = Promise.resolve(e2);
|
|
958
958
|
return t2.__state = { status: `fulfilled`, value: e2 }, t2;
|
|
959
959
|
}
|
|
960
|
-
var
|
|
961
|
-
function
|
|
962
|
-
let r2 =
|
|
963
|
-
r2 || (r2 = /* @__PURE__ */ new WeakMap(),
|
|
960
|
+
var pn = /* @__PURE__ */ new WeakMap();
|
|
961
|
+
function mn(e2, t2, n2) {
|
|
962
|
+
let r2 = pn.get(e2);
|
|
963
|
+
r2 || (r2 = /* @__PURE__ */ new WeakMap(), pn.set(e2, r2));
|
|
964
964
|
let i2 = r2.get(t2);
|
|
965
965
|
i2 || (i2 = /* @__PURE__ */ new WeakMap(), r2.set(t2, i2));
|
|
966
966
|
let a2 = i2.get(n2);
|
|
967
967
|
if (!a2) {
|
|
968
968
|
let r3 = e2;
|
|
969
|
-
a2 = r3.__state?.status === `fulfilled` ?
|
|
969
|
+
a2 = r3.__state?.status === `fulfilled` ? G(t2(r3.__state.value)) : r3.__state?.status === `rejected` ? G(n2(r3.__state.reason)) : e2.then(t2, n2), i2.set(n2, a2);
|
|
970
970
|
}
|
|
971
971
|
return a2;
|
|
972
972
|
}
|
|
973
|
-
function
|
|
973
|
+
function K(e2) {
|
|
974
974
|
return e2;
|
|
975
975
|
}
|
|
976
|
-
var hn =
|
|
976
|
+
var hn = K(`@wix/site-service-url`);
|
|
977
977
|
var gn = `appSectionParams`;
|
|
978
978
|
function _n(e2) {
|
|
979
979
|
let t2 = e2.searchParams.get(gn);
|
|
@@ -1036,32 +1036,29 @@ function J() {
|
|
|
1036
1036
|
return { pathname: i2.pathname, search: i2.search, searchParams: i2.searchParams, href: i2.href, getParsedUrl: () => _n(new URL(e2.currentUrl)), getRelativeUrl: () => Cn(e2.currentUrl, a2), getExternalBaseUrl: () => a2, pushUrl: bn };
|
|
1037
1037
|
}
|
|
1038
1038
|
var Y = { category: `category`, location: `location`, page: `page`, blob: `b`, resource: `resource`, referral: `referral`, timezone: `timezone`, bookingId: `bookingId`, token: `token`, rescheduleRedirectUrl: `rescheduleRedirectUrl` };
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
}
|
|
1042
|
-
var Tn = wn(`@wix/site-service-warmup-data`);
|
|
1043
|
-
function En() {
|
|
1039
|
+
var wn = K(`@wix/site-service-warmup-data`);
|
|
1040
|
+
function Tn() {
|
|
1044
1041
|
try {
|
|
1045
1042
|
return (0, import_services_manager_react.useGetService)();
|
|
1046
1043
|
} catch {
|
|
1047
1044
|
return null;
|
|
1048
1045
|
}
|
|
1049
1046
|
}
|
|
1050
|
-
function
|
|
1047
|
+
function En(e2) {
|
|
1051
1048
|
try {
|
|
1052
|
-
return e2 ? e2(
|
|
1049
|
+
return e2 ? e2(wn) : null;
|
|
1053
1050
|
} catch {
|
|
1054
1051
|
return null;
|
|
1055
1052
|
}
|
|
1056
1053
|
}
|
|
1057
|
-
function
|
|
1058
|
-
let e2 =
|
|
1054
|
+
function Dn() {
|
|
1055
|
+
let e2 = En(Tn()), t2 = typeof window > `u`;
|
|
1059
1056
|
return { scope: e2 ?? void 0, get: async (n2) => {
|
|
1060
1057
|
if (t2 || !e2) return null;
|
|
1061
1058
|
try {
|
|
1062
1059
|
return await e2.get(n2);
|
|
1063
1060
|
} catch (e3) {
|
|
1064
|
-
return
|
|
1061
|
+
return W(e3, { feature: H.warmup, action: `read`, level: `warning`, contexts: { warmup: { key: n2 } } }), null;
|
|
1065
1062
|
}
|
|
1066
1063
|
}, set: (n2, r2) => {
|
|
1067
1064
|
if (t2 && e2) try {
|
|
@@ -1070,54 +1067,54 @@ function On() {
|
|
|
1070
1067
|
}
|
|
1071
1068
|
} };
|
|
1072
1069
|
}
|
|
1073
|
-
var
|
|
1074
|
-
function
|
|
1075
|
-
return `${
|
|
1070
|
+
var On = `bookings-uou`;
|
|
1071
|
+
function kn() {
|
|
1072
|
+
return `${On}:locations:all`;
|
|
1076
1073
|
}
|
|
1077
|
-
var
|
|
1078
|
-
var
|
|
1079
|
-
var
|
|
1074
|
+
var An = 5e3;
|
|
1075
|
+
var jn = 100;
|
|
1076
|
+
var Mn = `wix-warmup-data`;
|
|
1080
1077
|
var X = null;
|
|
1081
|
-
function
|
|
1078
|
+
function Nn(e2) {
|
|
1082
1079
|
if (typeof document < `u`) try {
|
|
1083
|
-
let t2 = document.getElementById(
|
|
1080
|
+
let t2 = document.getElementById(Mn)?.textContent;
|
|
1084
1081
|
return t2 ? (X?.text !== t2 && (X = { text: t2, data: JSON.parse(t2).builderComponentsWarmupData ?? {} }), X.data[e2] ?? void 0) : void 0;
|
|
1085
1082
|
} catch {
|
|
1086
1083
|
return;
|
|
1087
1084
|
}
|
|
1088
1085
|
}
|
|
1089
|
-
var
|
|
1090
|
-
var
|
|
1086
|
+
var Pn = () => ({ promises: /* @__PURE__ */ new Map(), invalidatedWarmup: /* @__PURE__ */ new Set() });
|
|
1087
|
+
var Fn = Pn();
|
|
1088
|
+
var In = /* @__PURE__ */ new WeakMap();
|
|
1091
1089
|
var Ln = /* @__PURE__ */ new WeakMap();
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
return t2 || (t2 = Fn(), Ln.set(e2, t2)), t2;
|
|
1090
|
+
function Rn(e2) {
|
|
1091
|
+
if (!e2) return Fn;
|
|
1092
|
+
let t2 = In.get(e2);
|
|
1093
|
+
return t2 || (t2 = Pn(), In.set(e2, t2)), t2;
|
|
1097
1094
|
}
|
|
1098
|
-
function
|
|
1095
|
+
function zn({ key: e2, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
|
|
1099
1096
|
if (e2 === null) return n2();
|
|
1100
1097
|
if (typeof window > `u`) {
|
|
1101
1098
|
let r3 = () => n2().then((n3) => (t2.set(e2, n3), n3)), { scope: i3 } = t2;
|
|
1102
1099
|
if (!i3) return r3();
|
|
1103
|
-
let a3 =
|
|
1104
|
-
a3 || (a3 = /* @__PURE__ */ new Map(),
|
|
1100
|
+
let a3 = Ln.get(i3);
|
|
1101
|
+
a3 || (a3 = /* @__PURE__ */ new Map(), Ln.set(i3, a3));
|
|
1105
1102
|
let o3 = a3.get(e2);
|
|
1106
1103
|
if (o3) return o3;
|
|
1107
1104
|
let s3 = r3();
|
|
1108
1105
|
return a3.set(e2, s3), s3.catch(() => a3.delete(e2)), s3;
|
|
1109
1106
|
}
|
|
1110
|
-
let i2 =
|
|
1107
|
+
let i2 = Rn(t2.scope), a2 = Date.now();
|
|
1111
1108
|
for (let [e3, t3] of i2.promises) t3.expiresAt <= a2 && i2.promises.delete(e3);
|
|
1112
1109
|
let o2 = i2.promises.get(e2);
|
|
1113
1110
|
if (o2 && !r2) return o2.promise;
|
|
1114
1111
|
r2 && i2.invalidatedWarmup.add(e2);
|
|
1115
1112
|
let s2 = !i2.invalidatedWarmup.has(e2);
|
|
1116
1113
|
if (s2) {
|
|
1117
|
-
let t3 =
|
|
1114
|
+
let t3 = Nn(e2);
|
|
1118
1115
|
if (t3 !== void 0) {
|
|
1119
|
-
let n3 =
|
|
1120
|
-
return i2.promises.set(e2, { promise: n3, expiresAt: a2 +
|
|
1116
|
+
let n3 = G(t3);
|
|
1117
|
+
return i2.promises.set(e2, { promise: n3, expiresAt: a2 + An }), n3;
|
|
1121
1118
|
}
|
|
1122
1119
|
}
|
|
1123
1120
|
let c2 = (async () => {
|
|
@@ -1127,43 +1124,43 @@ function Bn({ key: e2, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
|
|
|
1127
1124
|
}
|
|
1128
1125
|
return n2();
|
|
1129
1126
|
})();
|
|
1130
|
-
i2.promises.size >=
|
|
1127
|
+
i2.promises.size >= jn && i2.promises.delete(i2.promises.keys().next().value);
|
|
1131
1128
|
let l2 = { promise: c2, expiresAt: 1 / 0 };
|
|
1132
1129
|
return i2.promises.set(e2, l2), c2.then(() => {
|
|
1133
|
-
l2.expiresAt = Date.now() +
|
|
1130
|
+
l2.expiresAt = Date.now() + An;
|
|
1134
1131
|
}, () => {
|
|
1135
1132
|
i2.promises.get(e2) === l2 && i2.promises.delete(e2);
|
|
1136
1133
|
}), c2;
|
|
1137
1134
|
}
|
|
1138
|
-
var
|
|
1139
|
-
function
|
|
1140
|
-
return
|
|
1135
|
+
var Bn = [{ path: `businessLocations.locations.business.address.geocode.latitude` }, { path: `businessLocations.locations.business.address.geocode.longitude` }, { path: `businessLocations.locations.custom.address.geocode.latitude` }, { path: `businessLocations.locations.custom.address.geocode.longitude` }, { path: `businessLocations.locations.calculatedAddress.geocode.latitude` }, { path: `businessLocations.locations.calculatedAddress.geocode.longitude` }];
|
|
1136
|
+
function Vn(e2) {
|
|
1137
|
+
return St(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: `` }] } }));
|
|
1141
1138
|
}
|
|
1142
|
-
var
|
|
1143
|
-
function
|
|
1139
|
+
var Hn = `@wix/auto_sdk_bookings_services`;
|
|
1140
|
+
function Un(e2) {
|
|
1144
1141
|
function t2({ host: t3 }) {
|
|
1145
|
-
return { entityFqdn: `wix.bookings.services.v2.service`, method: `POST`, methodFqn: `wix.bookings.services.v2.ServicesService.QueryLocations`, packageName:
|
|
1142
|
+
return { entityFqdn: `wix.bookings.services.v2.service`, method: `POST`, methodFqn: `wix.bookings.services.v2.ServicesService.QueryLocations`, packageName: Hn, migrationOptions: { optInTransformResponse: true }, url: Vn({ protoPath: `/v2/services/locations/query`, data: e2, host: t3 }), data: e2, transformResponse: (e3) => rt(e3, [{ transformFn: Gt, paths: Bn }]) };
|
|
1146
1143
|
}
|
|
1147
1144
|
return t2;
|
|
1148
1145
|
}
|
|
1149
|
-
var
|
|
1150
|
-
async function
|
|
1151
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 =
|
|
1146
|
+
var Wn = [{ path: `businessLocations.locations.calculatedAddress` }, { path: `businessLocations.locations.business.address` }, { path: `businessLocations.locations.custom.address` }];
|
|
1147
|
+
async function Gn(e2) {
|
|
1148
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = Un(qe({ filter: e2?.filter }));
|
|
1152
1149
|
n2?.onSiteCall?.();
|
|
1153
1150
|
try {
|
|
1154
1151
|
let e3 = await t2.request(r2);
|
|
1155
|
-
return n2?.onSuccess?.(e3),
|
|
1152
|
+
return n2?.onSuccess?.(e3), Je(rt(e3.data, [{ transformFn: Kt, paths: Wn }]));
|
|
1156
1153
|
} catch (e3) {
|
|
1157
|
-
let t3 =
|
|
1154
|
+
let t3 = pt(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { filter: `$[0].filter` }, singleArgumentUnchanged: false }, [`options`]);
|
|
1158
1155
|
throw n2?.onError?.(e3), t3;
|
|
1159
1156
|
}
|
|
1160
1157
|
}
|
|
1161
|
-
function
|
|
1162
|
-
return (t2) =>
|
|
1158
|
+
function Kn(e2) {
|
|
1159
|
+
return (t2) => Gn(t2, { httpClient: e2 });
|
|
1163
1160
|
}
|
|
1164
|
-
var
|
|
1165
|
-
var
|
|
1166
|
-
var
|
|
1161
|
+
var qn = xt(Kn);
|
|
1162
|
+
var Jn = `13d21c63-b5ec-5912-8397-c3a5ddb27a97`;
|
|
1163
|
+
var Yn = function(e2) {
|
|
1167
1164
|
return e2.BOOK_ONLINE = `bookingsBookOnline`, e2.SERVICE_PAGE = `bookingsServicePage`, e2.CALENDAR_PAGE = `bookingsCalendar`, e2.FORM_PAGE = `bookingsForm`, e2;
|
|
1168
1165
|
}({});
|
|
1169
1166
|
function Z(e2) {
|
|
@@ -1172,58 +1169,55 @@ function Z(e2) {
|
|
|
1172
1169
|
function Q(e2) {
|
|
1173
1170
|
return e2.business?.name ?? null;
|
|
1174
1171
|
}
|
|
1175
|
-
async function
|
|
1176
|
-
let e2 = await
|
|
1172
|
+
async function Xn() {
|
|
1173
|
+
let e2 = await qn({ filter: { services: { appId: Jn, hidden: false } } });
|
|
1177
1174
|
return { locations: [...e2.businessLocations?.locations ?? []].sort((e3, t2) => (Q(e3) ?? ``).localeCompare(Q(t2) ?? ``)), hasOtherLocations: !!(e2.customLocations?.exists || e2.customerLocations?.exists) };
|
|
1178
1175
|
}
|
|
1179
|
-
function
|
|
1176
|
+
function Zn({ isLoading: e2, hasError: t2, refetch: n2, children: r2 }) {
|
|
1180
1177
|
let { searchParams: i2 } = J(), a2 = { locations: [], locationItems: [], selectedLocationId: i2.get(Y.location), selectedLocationIndex: -1, selectedLocation: null, selectedLocationName: null, hasOtherLocations: false, hasMultipleLocations: false, isLoading: e2, hasError: t2, refetch: n2, selectLocation: () => {
|
|
1181
1178
|
} };
|
|
1182
1179
|
return (0, import_jsx_runtime.jsx)($.Provider, { value: a2, children: r2 });
|
|
1183
1180
|
}
|
|
1184
|
-
function
|
|
1185
|
-
return (0, import_jsx_runtime.jsx)(
|
|
1181
|
+
function Qn({ refetch: e2, children: t2 }) {
|
|
1182
|
+
return (0, import_jsx_runtime.jsx)(Zn, { isLoading: true, hasError: false, refetch: e2, children: t2 });
|
|
1186
1183
|
}
|
|
1187
|
-
function
|
|
1188
|
-
return (0, import_jsx_runtime.jsx)(
|
|
1184
|
+
function $n({ refetch: e2, children: t2 }) {
|
|
1185
|
+
return (0, import_jsx_runtime.jsx)(Zn, { isLoading: false, hasError: true, refetch: e2, children: t2 });
|
|
1189
1186
|
}
|
|
1187
|
+
var er = K(`@wix/site-service-business-logger`);
|
|
1190
1188
|
function tr(e2) {
|
|
1191
|
-
return e2;
|
|
1192
|
-
}
|
|
1193
|
-
var nr = tr(`@wix/viewer-service-business-logger`);
|
|
1194
|
-
function rr(e2) {
|
|
1195
1189
|
return { evid: 32, src: 16, endpoint: ``, params: e2 };
|
|
1196
1190
|
}
|
|
1197
|
-
var
|
|
1198
|
-
|
|
1199
|
-
var
|
|
1200
|
-
var
|
|
1201
|
-
let t2 = (0, import_services_manager_react.useService)(
|
|
1191
|
+
var nr = { 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` };
|
|
1192
|
+
Yn.BOOK_ONLINE;
|
|
1193
|
+
var rr = `new_bookings_server`;
|
|
1194
|
+
var ir = (e2) => {
|
|
1195
|
+
let { reportBi: t2 } = (0, import_services_manager_react.useService)(er);
|
|
1202
1196
|
return (0, import_react.useCallback)((n2) => {
|
|
1203
|
-
t2
|
|
1197
|
+
t2({ widget_name: e2, bookingsPlatform: rr, is_over_editor: false, ...n2.params, src: n2.src, evid: n2.evid }, { endpoint: n2.endpoint });
|
|
1204
1198
|
}, [t2, e2]);
|
|
1205
1199
|
};
|
|
1206
|
-
var
|
|
1207
|
-
let n2 =
|
|
1200
|
+
var ar = (e2, t2 = true) => {
|
|
1201
|
+
let n2 = ir(e2), { getParsedUrl: r2 } = J(), i2 = (0, import_react.useRef)(false);
|
|
1208
1202
|
(0, import_react.useEffect)(() => {
|
|
1209
|
-
t2 && !i2.current && (i2.current = true, n2(
|
|
1203
|
+
t2 && !i2.current && (i2.current = true, n2(tr({ referralInfo: r2().searchParams.get(Y.referral) ?? void 0 })));
|
|
1210
1204
|
}, [t2, n2, r2]);
|
|
1211
1205
|
};
|
|
1212
1206
|
var $ = (0, import_react.createContext)(null);
|
|
1213
|
-
var
|
|
1214
|
-
function
|
|
1207
|
+
var or = `useLocationsContext must be used within LocationsContextProvider`;
|
|
1208
|
+
function sr() {
|
|
1215
1209
|
let e2 = (0, import_react.useContext)($);
|
|
1216
|
-
if (!e2) throw Error(
|
|
1210
|
+
if (!e2) throw Error(or);
|
|
1217
1211
|
return e2;
|
|
1218
1212
|
}
|
|
1219
|
-
function
|
|
1213
|
+
function cr(e2, t2) {
|
|
1220
1214
|
let n2 = Z(e2);
|
|
1221
1215
|
return { locationId: n2, locationName: Q(e2), isSelected: n2 != null && n2 === t2 };
|
|
1222
1216
|
}
|
|
1223
|
-
var
|
|
1224
|
-
var
|
|
1225
|
-
function
|
|
1226
|
-
let { locations: c2, hasOtherLocations: l2, hasError: u2 } =
|
|
1217
|
+
var lr = (e2) => ({ ...e2, hasError: false });
|
|
1218
|
+
var ur = () => ({ locations: [], hasOtherLocations: false, hasError: true });
|
|
1219
|
+
function dr({ locationsPromise: e2, initialLocationId: t2, refetch: n2, children: i2 }) {
|
|
1220
|
+
let { locations: c2, hasOtherLocations: l2, hasError: u2 } = fn(e2), { pathname: d2, searchParams: p2, pushUrl: m2, getExternalBaseUrl: h2 } = J(), g2 = p2.get(Y.location), _2 = (0, import_react.useCallback)((e3) => {
|
|
1227
1221
|
let t3 = new URLSearchParams(p2);
|
|
1228
1222
|
e3 ? t3.set(Y.location, e3) : t3.delete(Y.location), t3.delete(Y.page);
|
|
1229
1223
|
let n3 = t3.toString(), r2 = n3 ? `${d2}?${n3}` : d2;
|
|
@@ -1232,15 +1226,15 @@ function pr({ locationsPromise: e2, initialLocationId: t2, refetch: n2, children
|
|
|
1232
1226
|
(0, import_react.useEffect)(() => {
|
|
1233
1227
|
v2.current || (v2.current = true, t2 && !p2.get(Y.location) && _2(t2));
|
|
1234
1228
|
}, [t2, p2, _2]);
|
|
1235
|
-
let y2 = c2.findIndex((e3) => Z(e3) === g2), b2 = c2.find((e3) => Z(e3) === g2) ?? null, x2 = c2.filter((e3) => Z(e3)).length + +!!l2,
|
|
1236
|
-
return (0, import_jsx_runtime.jsx)($.Provider, { value:
|
|
1229
|
+
let y2 = c2.findIndex((e3) => Z(e3) === g2), b2 = c2.find((e3) => Z(e3) === g2) ?? null, x2 = c2.filter((e3) => Z(e3)).length + +!!l2, ee2 = (0, import_react.useMemo)(() => ({ locations: c2, locationItems: c2.map((e3) => cr(e3, g2)), selectedLocationId: g2, selectedLocationIndex: y2, selectedLocation: b2, selectedLocationName: b2 ? Q(b2) : null, hasOtherLocations: l2, hasMultipleLocations: x2 > 1, isLoading: false, hasError: u2, refetch: n2, selectLocation: _2 }), [c2, g2, y2, b2, l2, u2, x2, n2, _2]);
|
|
1230
|
+
return (0, import_jsx_runtime.jsx)($.Provider, { value: ee2, children: i2 });
|
|
1237
1231
|
}
|
|
1238
|
-
function
|
|
1239
|
-
|
|
1240
|
-
let i2 =
|
|
1241
|
-
return (0, import_jsx_runtime.jsx)(
|
|
1232
|
+
function fr({ initialLocationId: e2, children: n2 }) {
|
|
1233
|
+
ar(nr.LOCATIONS);
|
|
1234
|
+
let i2 = Dn(), [a2, s2] = (0, import_react.useState)(0), l2 = (0, import_react.useMemo)(() => mn(zn({ key: kn(), refresh: a2 !== 0, warmupData: i2, fetchData: () => un(`locations-context-load`, { feature: H.locations }, Xn()) }), lr, ur), [a2]), u2 = (0, import_react.useCallback)(() => s2((e3) => e3 + 1), []);
|
|
1235
|
+
return (0, import_jsx_runtime.jsx)(dn, { fallback: (0, import_jsx_runtime.jsx)($n, { refetch: u2, children: n2 }), feature: H.locations, children: (0, import_jsx_runtime.jsx)(import_react.Suspense, { fallback: (0, import_jsx_runtime.jsx)(Qn, { refetch: u2, children: n2 }), children: (0, import_jsx_runtime.jsx)(dr, { locationsPromise: l2, initialLocationId: e2, refetch: u2, children: n2 }) }) });
|
|
1242
1236
|
}
|
|
1243
|
-
var
|
|
1237
|
+
var pr = nn;
|
|
1244
1238
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1245
1239
|
0 && (module.exports = {
|
|
1246
1240
|
LOCATIONS_CONTEXT_MISSING_PROVIDER_ERROR,
|
|
@@ -1249,4 +1243,4 @@ var hr = tn;
|
|
|
1249
1243
|
locationsContext,
|
|
1250
1244
|
useLocationsContext
|
|
1251
1245
|
});
|
|
1252
|
-
//# sourceMappingURL=context-locations
|
|
1246
|
+
//# sourceMappingURL=context-locations.js.map
|