@wix/bookings 1.0.1776 → 1.0.1778
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/context-booking-checkout.d.ts +243 -108
- package/build/cjs/context-booking-checkout.js +177 -183
- package/build/cjs/context-booking-checkout.js.map +1 -1
- package/build/cjs/context-categories.d.ts +16 -143
- package/build/cjs/context-categories.js +412 -412
- package/build/cjs/context-categories.js.map +1 -1
- package/build/cjs/context-locations.d.ts +16 -287
- package/build/cjs/context-locations.js +336 -336
- package/build/cjs/context-locations.js.map +1 -1
- package/build/cjs/context-service-addons.d.ts +2 -2
- package/build/cjs/context-service-addons.js +1 -1
- package/build/cjs/context-service-addons.js.map +1 -1
- package/build/cjs/context-service.d.ts +71 -33
- package/build/cjs/context-service.js +98 -96
- package/build/cjs/context-service.js.map +1 -1
- package/build/cjs/context-services.js +1 -1
- package/build/cjs/context-services.js.map +1 -1
- package/build/cjs/context-time-slots.d.ts +10 -0
- package/build/cjs/context-time-slots.js +2 -2
- package/build/cjs/context-time-slots.js.map +1 -1
- package/build/es/context-booking-checkout.d.mts +243 -108
- package/build/es/context-booking-checkout.mjs +177 -180
- package/build/es/context-booking-checkout.mjs.map +1 -1
- package/build/es/context-categories.d.mts +16 -143
- package/build/es/context-categories.mjs +412 -412
- package/build/es/context-categories.mjs.map +1 -1
- package/build/es/context-locations.d.mts +16 -287
- package/build/es/context-locations.mjs +336 -336
- package/build/es/context-locations.mjs.map +1 -1
- package/build/es/context-service-addons.d.mts +2 -2
- package/build/es/context-service-addons.mjs +1 -1
- package/build/es/context-service-addons.mjs.map +1 -1
- package/build/es/context-service.d.mts +71 -33
- package/build/es/context-service.mjs +98 -96
- package/build/es/context-service.mjs.map +1 -1
- package/build/es/context-services.mjs +1 -1
- package/build/es/context-services.mjs.map +1 -1
- package/build/es/context-time-slots.d.mts +10 -0
- package/build/es/context-time-slots.mjs +2 -2
- package/build/es/context-time-slots.mjs.map +1 -1
- package/build/internal/cjs/context-booking-checkout.d.ts +243 -108
- package/build/internal/cjs/context-categories.d.ts +16 -143
- package/build/internal/cjs/context-locations.d.ts +16 -287
- package/build/internal/cjs/context-service-addons.d.ts +2 -2
- package/build/internal/cjs/context-service.d.ts +71 -33
- package/build/internal/cjs/context-time-slots.d.ts +10 -0
- package/build/internal/es/context-booking-checkout.d.mts +243 -108
- package/build/internal/es/context-categories.d.mts +16 -143
- package/build/internal/es/context-locations.d.mts +16 -287
- package/build/internal/es/context-service-addons.d.mts +2 -2
- package/build/internal/es/context-service.d.mts +71 -33
- package/build/internal/es/context-time-slots.d.mts +10 -0
- package/{_sdk-exports → context-runtime}/context-booking-checkout/runtime.d.ts +243 -108
- package/context-runtime/context-booking-checkout/runtime.js +3 -0
- package/{_sdk-exports → context-runtime}/context-categories/runtime.d.ts +16 -143
- package/context-runtime/context-categories/runtime.js +2 -0
- package/context-runtime/context-locations/runtime.d.ts +195 -0
- package/context-runtime/context-locations/runtime.js +2 -0
- package/{_sdk-exports → context-runtime}/context-service/runtime.d.ts +71 -33
- package/{_sdk-exports → context-runtime}/context-service/runtime.js +3 -3
- package/{_sdk-exports → context-runtime}/context-service-addons/runtime.d.ts +2 -2
- package/{_sdk-exports → context-runtime}/context-time-slots/runtime.d.ts +10 -0
- package/{_sdk-exports → context-runtime}/context-time-slots/runtime.js +2 -2
- package/package.json +8 -8
- package/_sdk-exports/context-booking-checkout/runtime.js +0 -3
- package/_sdk-exports/context-categories/runtime.js +0 -2
- package/_sdk-exports/context-locations/runtime.d.ts +0 -466
- package/_sdk-exports/context-locations/runtime.js +0 -2
- /package/{_sdk-exports → context-runtime}/context-service-addons/runtime.js +0 -0
- /package/{_sdk-exports → context-runtime}/context-services/runtime.d.ts +0 -0
- /package/{_sdk-exports → context-runtime}/context-services/runtime.js +0 -0
|
@@ -29,7 +29,7 @@ __export(context_categories_exports, {
|
|
|
29
29
|
});
|
|
30
30
|
module.exports = __toCommonJS(context_categories_exports);
|
|
31
31
|
|
|
32
|
-
//
|
|
32
|
+
// context-runtime/context-categories/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 = (e5, t2, n2, r2) => ({ details: { ...!n2?.validationError && { applicationError: { description: t2, code: e5, data: r2 } }, ...n2 }, message: t2, requestId: r2?.requestId });
|
|
99
|
-
var
|
|
100
|
-
var
|
|
101
|
-
var
|
|
102
|
-
function
|
|
99
|
+
var ee = (e5) => e5?.method && [`post`, `put`, `patch`].includes(e5.method.toLocaleLowerCase()) && e5.body ? { "Content-Type": `application/json` } : {};
|
|
100
|
+
var te = (e5) => e5 && typeof e5 == `object` && !Array.isArray(e5);
|
|
101
|
+
var S = (e5) => e5.__type === `host`;
|
|
102
|
+
function C(e5, t2) {
|
|
103
103
|
return e5.create(t2);
|
|
104
104
|
}
|
|
105
|
-
var
|
|
106
|
-
function
|
|
107
|
-
return { [
|
|
105
|
+
var w = `x-wix-bi-gateway`;
|
|
106
|
+
function ne(e5, t2, n2) {
|
|
107
|
+
return { [w]: re({ environment: `js-sdk${n2 ? `-${n2}` : ``}`, "package-name": e5.packageName ?? t2?.PACKAGE_NAME, "method-fqn": e5.methodFqn, entity: e5.entityFqdn }) };
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function re(e5) {
|
|
110
110
|
return Object.entries(e5).filter(([e6, t2]) => !!t2).map(([e6, t2]) => `${e6}=${t2}`).join(`,`);
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function ie(e5) {
|
|
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 re(e5) {
|
|
|
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 ae = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
|
|
122
|
+
function oe(e5) {
|
|
123
|
+
return de(e5).map((e6) => e6.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(e5) {
|
|
130
130
|
let t2 = e5.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 = (e5) => `validationError` in (e5.response?.data?.details ?? {});
|
|
139
|
+
var pe = (e5) => `applicationError` in (e5.response?.data?.details ?? {});
|
|
140
|
+
var me = (e5) => (e5.response?.status ?? -1) >= 400 && (e5.response?.status ?? -1) < 500;
|
|
141
|
+
function he(e5, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
|
|
142
142
|
if (typeof e5 != `object` || !e5) throw e5;
|
|
143
|
-
if (
|
|
144
|
-
if (
|
|
145
|
-
if (
|
|
146
|
-
let t3 = e5.response?.status, n3 = e5.response?.statusText ?? `UNKNOWN`, r2 = e5.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code:
|
|
147
|
-
return
|
|
143
|
+
if (fe(e5)) return ge(e5, t2, n2);
|
|
144
|
+
if (pe(e5)) return _e(e5);
|
|
145
|
+
if (me(e5)) {
|
|
146
|
+
let t3 = e5.response?.status, n3 = e5.response?.statusText ?? `UNKNOWN`, r2 = e5.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: oe(n3), data: {} }, requestId: e5.requestId };
|
|
147
|
+
return T(e5, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
|
|
148
148
|
}
|
|
149
|
-
return
|
|
149
|
+
return ve(e5);
|
|
150
150
|
}
|
|
151
|
-
var
|
|
152
|
-
let r2 = e5.response?.data, i2 = e5.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 =
|
|
153
|
-
return
|
|
151
|
+
var ge = (e5, t2, n2) => {
|
|
152
|
+
let r2 = e5.response?.data, i2 = e5.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = ye(t2, a2, n2)?.sort((e6, t3) => e6.field < t3.field ? -1 : 1), s2 = `INVALID_ARGUMENT: ${o2?.map(({ field: e6, description: t3 }) => `"${e6}" ${t3}`)?.join(`, `)}`, c2 = { validationError: { fieldViolations: o2 }, requestId: i2 };
|
|
153
|
+
return T(e5, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e5.response?.status, requestId: i2 } });
|
|
154
154
|
};
|
|
155
|
-
var
|
|
156
|
-
var
|
|
157
|
-
let t2 = e5.response?.status, n2 = e5.response?.statusText ?? `UNKNOWN`, r2 = e5.response?.data?.message ?? n2, i2 = e5.response?.data?.details?.applicationError?.description ?? n2, a2 = e5.response?.data?.details?.applicationError?.code ??
|
|
158
|
-
return
|
|
155
|
+
var T = (e5, { message: t2, extraProperties: n2 }) => Object.assign(e5, { ...n2, message: t2 });
|
|
156
|
+
var _e = (e5) => {
|
|
157
|
+
let t2 = e5.response?.status, n2 = e5.response?.statusText ?? `UNKNOWN`, r2 = e5.response?.data?.message ?? n2, i2 = e5.response?.data?.details?.applicationError?.description ?? n2, a2 = e5.response?.data?.details?.applicationError?.code ?? oe(n2), o2 = e5.response?.data?.details?.applicationError?.data ?? {}, s2 = r2 === i2 ? r2 : `${r2}: ${i2}`, c2 = { applicationError: { description: i2, code: a2, data: o2 }, requestId: e5.requestId };
|
|
158
|
+
return T(e5, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e5.requestId } });
|
|
159
159
|
};
|
|
160
|
-
var
|
|
161
|
-
var
|
|
160
|
+
var ve = (e5) => T(e5, { message: e5.requestId ? `System error occurred, request-id: ${e5.requestId}` : `System error occurred: ${JSON.stringify(e5)}`, extraProperties: { requestId: e5.requestId, status: e5.response?.status, code: oe(e5.response?.statusText ?? `UNKNOWN`), ...!e5.response && { runtimeError: e5 } } });
|
|
161
|
+
var ye = ({ spreadPathsToArguments: e5, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
|
|
162
162
|
let a2 = { ...e5, ...t2 }, o2 = Object.keys(a2);
|
|
163
163
|
return r2?.filter((e6) => !r2.some((t3) => t3.field.length > e6.field.length && t3.field.startsWith(e6.field) && o2.includes(t3.field))).map((e6) => {
|
|
164
164
|
let r3 = t2[e6.field];
|
|
165
|
-
if (r3) return { ...e6, field:
|
|
165
|
+
if (r3) return { ...e6, field: be(r3, i2) };
|
|
166
166
|
let s2 = o2?.sort((e7, t3) => t3.length - e7.length)?.find((t3) => e6.field.startsWith(t3));
|
|
167
167
|
if (s2) {
|
|
168
168
|
let t3 = a2[s2];
|
|
169
|
-
if (t3) return { ...e6, field: e6.field.replace(s2,
|
|
169
|
+
if (t3) return { ...e6, field: e6.field.replace(s2, be(t3, i2)) };
|
|
170
170
|
}
|
|
171
171
|
return n2 ? { ...e6, field: `${i2[0]}.${e6.field}` } : e6;
|
|
172
172
|
});
|
|
173
173
|
};
|
|
174
|
-
var
|
|
175
|
-
let n2 =
|
|
174
|
+
var be = (e5, t2) => {
|
|
175
|
+
let n2 = xe(e5);
|
|
176
176
|
return n2 == null ? e5 : e5.replace(`$[${n2}]`, t2[n2]);
|
|
177
177
|
};
|
|
178
|
-
var
|
|
178
|
+
var xe = (e5) => {
|
|
179
179
|
let t2 = e5.match(/\$\[(?<argIndex>\d+)\]/);
|
|
180
180
|
return t2 && t2.groups && Number(t2.groups.argIndex);
|
|
181
181
|
};
|
|
182
|
-
function
|
|
183
|
-
return
|
|
182
|
+
function Se(e5, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
|
|
183
|
+
return ie(() => e5({ request: async (e6) => {
|
|
184
184
|
let i3 = e6({ 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 e7 =
|
|
189
|
+
let e7 = ne(i3, t2, c2), o4 = { method: a3.method, ...a3.data && { body: JSON.stringify(a3.data) }, headers: { ...e7 } }, s3 = await n2(u3, o4);
|
|
190
190
|
if (s3.status !== 200) {
|
|
191
191
|
let e8 = null;
|
|
192
192
|
try {
|
|
193
193
|
e8 = await s3.json();
|
|
194
194
|
} catch {
|
|
195
195
|
}
|
|
196
|
-
let t3 =
|
|
196
|
+
let t3 = we(s3.status, e8?.message ?? s3.statusText, e8?.details, { requestId: s3.headers.get(`X-Wix-Request-Id`), details: e8 }), 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(e5, 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 Ce = class extends Error {
|
|
207
207
|
response;
|
|
208
208
|
requestId;
|
|
209
209
|
constructor(e5) {
|
|
210
210
|
super(), this.response = e5.response, this.requestId = e5.requestId;
|
|
211
211
|
}
|
|
212
212
|
};
|
|
213
|
-
var
|
|
214
|
-
var
|
|
215
|
-
function
|
|
213
|
+
var we = (e5, t2, n2, r2) => new Ce({ response: { data: { details: { ...!n2?.validationError && { applicationError: { description: t2, code: e5, data: r2 } }, ...n2 }, message: t2 }, status: e5 }, requestId: r2?.requestId });
|
|
214
|
+
var Te = `.`;
|
|
215
|
+
function Ee(e5, t2, n2) {
|
|
216
216
|
if (e5 == null) throw Error(`Cannot set value on null or undefined`);
|
|
217
|
-
let r2 =
|
|
217
|
+
let r2 = De(t2), i2 = e5;
|
|
218
218
|
for (let e6 = 0; e6 < r2.length; e6++) {
|
|
219
219
|
let t3 = r2[e6];
|
|
220
220
|
if (e6 === r2.length - 1) {
|
|
@@ -226,21 +226,21 @@ function we(e5, t2, n2) {
|
|
|
226
226
|
}
|
|
227
227
|
return e5;
|
|
228
228
|
}
|
|
229
|
-
function
|
|
230
|
-
return Array.isArray(e5) ? e5 : e5.split(
|
|
229
|
+
function De(e5) {
|
|
230
|
+
return Array.isArray(e5) ? e5 : e5.split(Te).map((e6) => Oe(e6) ? Number(e6) : e6);
|
|
231
231
|
}
|
|
232
|
-
function
|
|
232
|
+
function Oe(e5) {
|
|
233
233
|
return /^\d+$/.test(e5);
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function ke(e5) {
|
|
236
236
|
let t2 = {};
|
|
237
|
-
for (let [n2, r2] of Object.entries(e5))
|
|
237
|
+
for (let [n2, r2] of Object.entries(e5)) Ae(n2) || Ee(t2, De(n2), r2);
|
|
238
238
|
return t2;
|
|
239
239
|
}
|
|
240
|
-
function
|
|
240
|
+
function Ae(e5) {
|
|
241
241
|
return e5 === `__proto__` || e5 === `constructor` || e5 === `prototype`;
|
|
242
242
|
}
|
|
243
|
-
var
|
|
243
|
+
var je = 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 e5.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(([e5, t2]) => [this.replaceEscapedCharacters(this.bracketToDotNotation(e5)), t2])),
|
|
266
|
+
return this.cleanedModifiedFields = Object.fromEntries(Object.entries(this.modifiedFields).map(([e5, t2]) => [this.replaceEscapedCharacters(this.bracketToDotNotation(e5)), t2])), ke(this.cleanedModifiedFields);
|
|
267
267
|
}
|
|
268
268
|
flatten(e5) {
|
|
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(`[${e6}]`), n2 = n2[parseInt(e6, 10)];
|
|
285
285
|
}, a2 = (e6, t3) => {
|
|
286
|
-
let i3 = e6 in
|
|
286
|
+
let i3 = e6 in ae ? ae[e6] : 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 = Fe(e6);
|
|
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 e5.replace(this.BRACKET_PATTERN, (t2, n2, r2) => r2 > 0 && e5[r2 - 1] === `\\` ? t2 : `.` + n2);
|
|
320
320
|
}
|
|
321
321
|
};
|
|
322
|
-
function
|
|
322
|
+
function Me(e5, t2) {
|
|
323
323
|
let n2 = e5?.modifiedFields;
|
|
324
324
|
if (!n2) return null;
|
|
325
|
-
let r2 =
|
|
325
|
+
let r2 = Ne(n2);
|
|
326
326
|
if (!r2) return null;
|
|
327
327
|
let { unflattenedModifiedFields: i2, modifiedFieldsManipulator: a2 } = r2;
|
|
328
328
|
e5 = { ...e5, modifiedFields: i2 };
|
|
329
329
|
let o2 = t2(e5), s2 = o2?.modifiedFields;
|
|
330
330
|
if (!s2) return null;
|
|
331
|
-
let c2 =
|
|
331
|
+
let c2 = Pe(s2, a2);
|
|
332
332
|
return c2 === null ? null : (o2.modifiedFields = c2, o2);
|
|
333
333
|
}
|
|
334
|
-
function
|
|
334
|
+
function Ne(e5) {
|
|
335
335
|
if (typeof e5 == `object` && e5 && !Array.isArray(e5)) try {
|
|
336
|
-
let t2 = new
|
|
336
|
+
let t2 = new je(e5);
|
|
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 Pe(e5, t2) {
|
|
344
344
|
if (typeof e5 == `object` && e5 && !Array.isArray(e5)) try {
|
|
345
345
|
return t2.flatten(e5);
|
|
346
346
|
} catch {
|
|
@@ -348,10 +348,10 @@ function Me(e5, t2) {
|
|
|
348
348
|
}
|
|
349
349
|
return null;
|
|
350
350
|
}
|
|
351
|
-
function
|
|
351
|
+
function Fe(e5) {
|
|
352
352
|
return e5.replace(/[-_\s]+(.)?/g, (e6, t2) => t2 ? t2.toUpperCase() : ``).replace(/^./, (e6) => e6.toLowerCase());
|
|
353
353
|
}
|
|
354
|
-
function
|
|
354
|
+
function Ie() {
|
|
355
355
|
return { emit(e5, ...t2) {
|
|
356
356
|
for (let n2 = 0, r2 = this.events[e5] || [], i2 = r2.length; n2 < i2; n2++) r2[n2](...t2);
|
|
357
357
|
}, events: {}, on(e5, t2) {
|
|
@@ -360,8 +360,8 @@ function Pe() {
|
|
|
360
360
|
};
|
|
361
361
|
} };
|
|
362
362
|
}
|
|
363
|
-
var
|
|
364
|
-
function
|
|
363
|
+
var Le = (e5) => e5.__type === `event-definition`;
|
|
364
|
+
function Re(e5, t2, n2, r2) {
|
|
365
365
|
let i2;
|
|
366
366
|
if (e5.isDomainEvent) {
|
|
367
367
|
let { deletedEvent: e6, actionEvent: t3, createdEvent: a3, updatedEvent: o3, ...s3 } = n2, c2 = { ...r2, ...s3 };
|
|
@@ -372,14 +372,14 @@ function Ie(e5, t2, n2, r2) {
|
|
|
372
372
|
let e6 = s2.modifiedFields;
|
|
373
373
|
if (typeof e6 == `object` && e6 && !Array.isArray(e6)) {
|
|
374
374
|
o2 = structuredClone(i2);
|
|
375
|
-
let e7 =
|
|
375
|
+
let e7 = Me(s2, a2);
|
|
376
376
|
if (e7) return t2(e7);
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
379
|
return t2(a2(o2));
|
|
380
380
|
}
|
|
381
|
-
function
|
|
382
|
-
let t2 = /* @__PURE__ */ new Map(), n2 =
|
|
381
|
+
function ze(e5) {
|
|
382
|
+
let t2 = /* @__PURE__ */ new Map(), n2 = Ie();
|
|
383
383
|
return { initModule(e6) {
|
|
384
384
|
return (r2) => {
|
|
385
385
|
let i2 = t2.get(e6.type) ?? [];
|
|
@@ -389,7 +389,7 @@ function Le(e5) {
|
|
|
389
389
|
let { eventType: r2, identity: i2, instanceId: a2, payload: o2, accountInfo: s2 } = await this.parseJWT(e6), c2 = [...n3.expectedEvents, ...Array.from(t2.keys()).map((e7) => ({ type: e7 }))];
|
|
390
390
|
if (c2.length > 0 && !c2.some(({ type: e7 }) => e7 === r2)) throw Error(`Unexpected event type: ${r2}. Expected one of: ${c2.map((e7) => e7.type).join(`, `)}`);
|
|
391
391
|
let l2 = t2.get(r2) ?? [];
|
|
392
|
-
return await Promise.all(l2.map(({ eventDefinition: e7, handler: t3 }) =>
|
|
392
|
+
return await Promise.all(l2.map(({ eventDefinition: e7, handler: t3 }) => Re(e7, t3, o2, { instanceId: a2, identity: i2, accountInfo: s2 }))), { instanceId: a2, eventType: r2, payload: o2, identity: i2, accountInfo: s2 };
|
|
393
393
|
}, async processRequest(e6, t3) {
|
|
394
394
|
let n3 = await e6.text();
|
|
395
395
|
return this.process(n3, t3);
|
|
@@ -408,12 +408,12 @@ function Le(e5) {
|
|
|
408
408
|
let n3 = Array.from(t2.keys()).map((e7) => ({ type: e7 }));
|
|
409
409
|
if (n3.length > 0 && !n3.some(({ type: t3 }) => t3 === e6.eventType)) throw Error(`Unexpected event type: ${e6.eventType}. Expected one of: ${n3.map((e7) => e7.type).join(`, `)}`);
|
|
410
410
|
let r2 = t2.get(e6.eventType) ?? [];
|
|
411
|
-
await Promise.all(r2.map(({ eventDefinition: t3, handler: n4 }) =>
|
|
411
|
+
await Promise.all(r2.map(({ eventDefinition: t3, handler: n4 }) => Re(t3, n4, e6.payload, { instanceId: e6.instanceId, identity: e6.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 Be = (e5) => e5.__type === `service-plugin-definition`;
|
|
415
|
+
function Ve(e5) {
|
|
416
|
+
let t2 = /* @__PURE__ */ new Map(), n2 = Ie();
|
|
417
417
|
return { initModule(e6) {
|
|
418
418
|
return (r2) => {
|
|
419
419
|
let i2 = t2.get(e6.componentType.toLowerCase()) ?? [];
|
|
@@ -454,43 +454,43 @@ function ze(e5) {
|
|
|
454
454
|
return s2.transformations.toREST(await c2(s2.transformations.fromREST(e6)));
|
|
455
455
|
} } };
|
|
456
456
|
}
|
|
457
|
-
var
|
|
458
|
-
function
|
|
457
|
+
var E = `X-Wix-Consistent`;
|
|
458
|
+
function He(e5) {
|
|
459
459
|
let t2 = e5.headers || { Authorization: `` }, n2 = { getAuthHeaders: (e6) => Promise.resolve({ headers: {} }) }, r2 = e5.auth, i2 = typeof r2 == `function` ? r2 : () => r2 ?? n2, a2 = () => i2().getAuthHeaders(e5.host), o2 = () => e5.fetch ?? fetch, s2 = async (n3, r3) => {
|
|
460
|
-
let i3 = o2(), s3 = await a2(), c3 = { ...r3?.headers ?? {}, ...s3.headers, ...e5.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [
|
|
460
|
+
let i3 = o2(), s3 = await a2(), c3 = { ...r3?.headers ?? {}, ...s3.headers, ...e5.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [E]: t2[E] } : {} }, l3 = e5.host?.getErrorHandler?.();
|
|
461
461
|
try {
|
|
462
462
|
if (typeof n3 == `string` || n3 instanceof URL) {
|
|
463
463
|
let e6 = await i3(n3, { ...r3, headers: c3 });
|
|
464
464
|
l3?.handleError(e6, { requestOptions: { url: n3.toString(), method: r3?.method } });
|
|
465
|
-
let a3 =
|
|
466
|
-
return a3 && (t2[
|
|
465
|
+
let a3 = D(e6);
|
|
466
|
+
return a3 && (t2[E] = a3), e6;
|
|
467
467
|
}
|
|
468
468
|
{
|
|
469
469
|
for (let [e7, t3] of Object.entries(c3)) typeof t3 == `string` && n3.headers.set(e7, t3);
|
|
470
470
|
let e6 = await i3(n3, r3);
|
|
471
471
|
l3?.handleError(e6, { requestOptions: { url: n3.url, method: r3?.method } });
|
|
472
|
-
let a3 =
|
|
473
|
-
return a3 && (t2[
|
|
472
|
+
let a3 = D(e6);
|
|
473
|
+
return a3 && (t2[E] = a3), e6;
|
|
474
474
|
}
|
|
475
475
|
} catch (e6) {
|
|
476
476
|
throw l3?.handleError(e6, { requestOptions: { url: typeof n3 == `string` || n3 instanceof URL ? n3.toString() : n3.url, method: r3?.method } }), e6;
|
|
477
477
|
}
|
|
478
|
-
}, { client: c2, initModule: l2 } =
|
|
479
|
-
let i3 = o2(), s3 = await a2(), c3 =
|
|
480
|
-
return u3 && (t2[
|
|
478
|
+
}, { client: c2, initModule: l2 } = Ve(i2), { client: u2, initModule: d2 } = ze(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, ...e5.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [E]: t2[E] } : {} } }), u3 = D(l3);
|
|
480
|
+
return u3 && (t2[E] = u3), l3;
|
|
481
481
|
}, m2 = (t3, n3) => {
|
|
482
|
-
if (
|
|
483
|
-
if (
|
|
484
|
-
if (
|
|
482
|
+
if (Le(t3)) return d2(t3);
|
|
483
|
+
if (Be(t3)) return l2(t3);
|
|
484
|
+
if (S(t3) && e5.host) return C(t3, e5.host);
|
|
485
485
|
if (typeof t3 == `function`) {
|
|
486
486
|
if (`__type` in t3 && t3.__type === `wix_spi_error`) return t3;
|
|
487
487
|
let r3 = e5.host?.apiBaseUrl ?? `www.wixapis.com`, o3 = e5.useCDN === void 0 ? i2().shouldUseCDN : e5.useCDN;
|
|
488
|
-
return
|
|
488
|
+
return Se(ie(() => _(t3)) ? g(t3) : t3, n3 ?? {}, f2, e5.host?.getErrorHandler?.(), (e6, t4) => {
|
|
489
489
|
let n4 = new URL(e6, `https://${r3}`);
|
|
490
490
|
return n4.host = r3, n4.protocol = `https`, f2(n4.toString(), t4);
|
|
491
491
|
}, i2().getActiveToken, async () => a2(), { HTTPHost: r3 }, e5.host?.name, o3, e5.validateRequestSchema);
|
|
492
492
|
}
|
|
493
|
-
return
|
|
493
|
+
return te(t3) ? Object.fromEntries(Object.entries(t3).map(([e6, n4]) => [e6, m2(n4, t3[v])])) : t3;
|
|
494
494
|
}, h2 = (e6) => {
|
|
495
495
|
for (let n3 in e6) t2[n3] = e6[n3];
|
|
496
496
|
};
|
|
@@ -509,19 +509,19 @@ function Be(e5) {
|
|
|
509
509
|
return { data: o3 ?? {}, errors: s3 };
|
|
510
510
|
}, webhooks: u2, servicePlugins: c2 };
|
|
511
511
|
}
|
|
512
|
-
function
|
|
512
|
+
function D(e5) {
|
|
513
513
|
return e5.headers?.get(`X-Wix-Consistent`) ?? e5.headers?.get(`x-wix-consistent`);
|
|
514
514
|
}
|
|
515
|
-
var
|
|
516
|
-
var
|
|
517
|
-
function
|
|
515
|
+
var Ue = { _id: `id`, _createdDate: `createdDate`, _updatedDate: `updatedDate` };
|
|
516
|
+
var We = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
|
|
517
|
+
function Ge(e5, t2) {
|
|
518
518
|
return e5?.split(`.`).map((e6) => t2?.[e6] ?? e6).join(`.`);
|
|
519
519
|
}
|
|
520
|
-
var
|
|
521
|
-
function
|
|
522
|
-
return (e5 ===
|
|
520
|
+
var Ke = `sort.fieldName`;
|
|
521
|
+
function qe(e5, t2, n2) {
|
|
522
|
+
return (e5 === Ke || e5.endsWith(`.${Ke}`)) && typeof t2 == `string` ? Ge(t2, n2) : t2;
|
|
523
523
|
}
|
|
524
|
-
function
|
|
524
|
+
function Je(e5, t2, n2) {
|
|
525
525
|
let r2 = (e6) => n2.includes(e6), i2 = (e6, n3) => {
|
|
526
526
|
if (Array.isArray(e6)) e6.forEach((e7) => {
|
|
527
527
|
i2(e7, n3);
|
|
@@ -531,87 +531,87 @@ function Ke(e5, t2, n2) {
|
|
|
531
531
|
Object.keys(a2).forEach((e7) => {
|
|
532
532
|
let o2 = n3 === `` ? e7 : `${n3}.${e7}`;
|
|
533
533
|
if (r2(o2)) return;
|
|
534
|
-
let s2 =
|
|
535
|
-
s2 !== e7 && !(s2 in a2) && (a2[s2] = a2[e7], delete a2[e7]), a2[s2] =
|
|
534
|
+
let s2 = Ye(e7, t2);
|
|
535
|
+
s2 !== e7 && !(s2 in a2) && (a2[s2] = a2[e7], delete a2[e7]), a2[s2] = qe(o2, a2[s2], t2), i2(a2[s2], o2);
|
|
536
536
|
});
|
|
537
537
|
}
|
|
538
538
|
};
|
|
539
539
|
return i2(e5, ``), e5;
|
|
540
540
|
}
|
|
541
|
-
function
|
|
541
|
+
function Ye(e5, t2) {
|
|
542
542
|
let n2;
|
|
543
543
|
return n2 = e5.includes(`.`) ? e5.split(`.`).map((e6) => t2[e6] ?? e6).join(`.`) : t2[e5] ?? e5, n2;
|
|
544
544
|
}
|
|
545
|
-
function
|
|
546
|
-
return
|
|
545
|
+
function Xe(e5, t2 = []) {
|
|
546
|
+
return Je(e5, Ue, t2);
|
|
547
547
|
}
|
|
548
|
-
function
|
|
549
|
-
return
|
|
548
|
+
function Ze(e5, t2 = []) {
|
|
549
|
+
return Je(e5, We, t2);
|
|
550
550
|
}
|
|
551
|
-
function
|
|
552
|
-
return
|
|
551
|
+
function O(e5) {
|
|
552
|
+
return nt(e5).map((e6) => e6.toLocaleUpperCase()).join(`_`);
|
|
553
553
|
}
|
|
554
|
-
var
|
|
555
|
-
var
|
|
556
|
-
var
|
|
557
|
-
var
|
|
558
|
-
function
|
|
554
|
+
var Qe = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
555
|
+
var $e = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
556
|
+
var et = `$1\0$2`;
|
|
557
|
+
var tt = /[^\p{L}\d]+/giu;
|
|
558
|
+
function nt(e5) {
|
|
559
559
|
let t2 = e5.trim();
|
|
560
|
-
t2 = t2.replace(
|
|
560
|
+
t2 = t2.replace(Qe, et).replace($e, et), t2 = t2.replace(tt, `\0`);
|
|
561
561
|
let n2 = 0, r2 = t2.length;
|
|
562
562
|
for (; t2.charAt(n2) === `\0`; ) n2++;
|
|
563
563
|
if (n2 === r2) return [];
|
|
564
564
|
for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
|
|
565
565
|
return t2.slice(n2, r2).split(/\0/g);
|
|
566
566
|
}
|
|
567
|
-
var
|
|
568
|
-
var
|
|
569
|
-
var
|
|
570
|
-
function
|
|
567
|
+
var rt = (e5) => `validationError` in (e5.response?.data?.details ?? {});
|
|
568
|
+
var it = (e5) => `applicationError` in (e5.response?.data?.details ?? {});
|
|
569
|
+
var at = (e5) => (e5.response?.status ?? -1) >= 400 && (e5.response?.status ?? -1) < 500;
|
|
570
|
+
function ot(e5, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
|
|
571
571
|
if (typeof e5 != `object` || !e5) throw e5;
|
|
572
|
-
if (
|
|
573
|
-
if (
|
|
574
|
-
if (
|
|
575
|
-
let t3 = e5.response?.status, n3 = e5.response?.statusText ?? `UNKNOWN`, r2 = e5.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code:
|
|
576
|
-
return
|
|
572
|
+
if (rt(e5)) return st(e5, t2, n2);
|
|
573
|
+
if (it(e5)) return ct(e5);
|
|
574
|
+
if (at(e5)) {
|
|
575
|
+
let t3 = e5.response?.status, n3 = e5.response?.statusText ?? `UNKNOWN`, r2 = e5.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: O(n3), data: {} }, requestId: e5.requestId };
|
|
576
|
+
return k(e5, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
|
|
577
577
|
}
|
|
578
|
-
return
|
|
578
|
+
return lt(e5);
|
|
579
579
|
}
|
|
580
|
-
var
|
|
581
|
-
let r2 = e5.response?.data, i2 = e5.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 =
|
|
582
|
-
return
|
|
580
|
+
var st = (e5, t2, n2) => {
|
|
581
|
+
let r2 = e5.response?.data, i2 = e5.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = ut(t2, a2, n2)?.sort((e6, t3) => e6.field < t3.field ? -1 : 1), s2 = `INVALID_ARGUMENT: ${o2?.map(({ field: e6, description: t3 }) => `"${e6}" ${t3}`)?.join(`, `)}`, c2 = { validationError: { fieldViolations: o2 }, requestId: i2 };
|
|
582
|
+
return k(e5, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e5.response?.status, requestId: i2 } });
|
|
583
583
|
};
|
|
584
|
-
var
|
|
585
|
-
var
|
|
586
|
-
let t2 = e5.response?.status, n2 = e5.response?.statusText ?? `UNKNOWN`, r2 = e5.response?.data?.message ?? n2, i2 = e5.response?.data?.details?.applicationError?.description ?? n2, a2 = e5.response?.data?.details?.applicationError?.code ??
|
|
587
|
-
return
|
|
584
|
+
var k = (e5, { message: t2, extraProperties: n2 }) => Object.assign(e5, { ...n2, message: t2 });
|
|
585
|
+
var ct = (e5) => {
|
|
586
|
+
let t2 = e5.response?.status, n2 = e5.response?.statusText ?? `UNKNOWN`, r2 = e5.response?.data?.message ?? n2, i2 = e5.response?.data?.details?.applicationError?.description ?? n2, a2 = e5.response?.data?.details?.applicationError?.code ?? O(n2), o2 = e5.response?.data?.details?.applicationError?.data ?? {}, s2 = r2 === i2 ? r2 : `${r2}: ${i2}`, c2 = { applicationError: { description: i2, code: a2, data: o2 }, requestId: e5.requestId };
|
|
587
|
+
return k(e5, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e5.requestId } });
|
|
588
588
|
};
|
|
589
|
-
var
|
|
590
|
-
var
|
|
589
|
+
var lt = (e5) => k(e5, { message: e5.requestId ? `System error occurred, request-id: ${e5.requestId}` : `System error occurred: ${JSON.stringify(e5)}`, extraProperties: { requestId: e5.requestId, status: e5.response?.status, code: O(e5.response?.statusText ?? `UNKNOWN`), ...!e5.response && { runtimeError: e5 } } });
|
|
590
|
+
var ut = ({ spreadPathsToArguments: e5, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
|
|
591
591
|
let a2 = { ...e5, ...t2 }, o2 = Object.keys(a2);
|
|
592
592
|
return r2?.filter((e6) => !r2.some((t3) => t3.field.length > e6.field.length && t3.field.startsWith(e6.field) && o2.includes(t3.field))).map((e6) => {
|
|
593
593
|
let r3 = t2[e6.field];
|
|
594
|
-
if (r3) return { ...e6, field:
|
|
594
|
+
if (r3) return { ...e6, field: dt(r3, i2) };
|
|
595
595
|
let s2 = o2?.sort((e7, t3) => t3.length - e7.length)?.find((t3) => e6.field.startsWith(t3));
|
|
596
596
|
if (s2) {
|
|
597
597
|
let t3 = a2[s2];
|
|
598
|
-
if (t3) return { ...e6, field: e6.field.replace(s2,
|
|
598
|
+
if (t3) return { ...e6, field: e6.field.replace(s2, dt(t3, i2)) };
|
|
599
599
|
}
|
|
600
600
|
return n2 ? { ...e6, field: `${i2[0]}.${e6.field}` } : e6;
|
|
601
601
|
});
|
|
602
602
|
};
|
|
603
|
-
var
|
|
604
|
-
let n2 =
|
|
603
|
+
var dt = (e5, t2) => {
|
|
604
|
+
let n2 = ft(e5);
|
|
605
605
|
return n2 == null ? e5 : e5.replace(`$[${n2}]`, t2[n2]);
|
|
606
606
|
};
|
|
607
|
-
var
|
|
607
|
+
var ft = (e5) => {
|
|
608
608
|
let t2 = e5.match(/\$\[(?<argIndex>\d+)\]/);
|
|
609
609
|
return t2 && t2.groups && Number(t2.groups.argIndex);
|
|
610
610
|
};
|
|
611
|
-
function
|
|
611
|
+
function pt() {
|
|
612
612
|
let e5 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
613
613
|
if (e5) return { initWixModules(t3, n3) {
|
|
614
|
-
return
|
|
614
|
+
return A(() => e5(t3, n3));
|
|
615
615
|
}, fetchWithAuth() {
|
|
616
616
|
throw Error(`fetchWithAuth is not available in this context`);
|
|
617
617
|
}, graphql() {
|
|
@@ -621,10 +621,10 @@ function ft() {
|
|
|
621
621
|
if (t2 || n2) return { initWixModules(e6, r2) {
|
|
622
622
|
if (r2) {
|
|
623
623
|
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`);
|
|
624
|
-
return
|
|
624
|
+
return A(() => n2.use(e6));
|
|
625
625
|
}
|
|
626
626
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
627
|
-
return
|
|
627
|
+
return A(() => t2.use(e6));
|
|
628
628
|
}, fetchWithAuth: (e6, n3) => {
|
|
629
629
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
630
630
|
return t2.fetchWithAuth(e6, n3);
|
|
@@ -636,7 +636,7 @@ function ft() {
|
|
|
636
636
|
return t2.graphql(e6, n3, r2);
|
|
637
637
|
} };
|
|
638
638
|
}
|
|
639
|
-
function
|
|
639
|
+
function A(e5) {
|
|
640
640
|
let t2 = globalThis.__wix_context__, n2 = { client: p.client, elevatedClient: p.elevatedClient }, r2;
|
|
641
641
|
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);
|
|
642
642
|
try {
|
|
@@ -645,78 +645,78 @@ function j(e5) {
|
|
|
645
645
|
globalThis.__wix_context__ = t2, p.client = n2.client, p.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
646
646
|
}
|
|
647
647
|
}
|
|
648
|
-
function
|
|
648
|
+
function mt(e5, t2) {
|
|
649
649
|
return (...n2) => {
|
|
650
|
-
let r2 =
|
|
650
|
+
let r2 = pt();
|
|
651
651
|
return r2 ? r2.initWixModules(e5, t2).apply(void 0, n2) : e5.apply(void 0, n2);
|
|
652
652
|
};
|
|
653
653
|
}
|
|
654
|
-
function
|
|
655
|
-
return
|
|
656
|
-
}
|
|
657
|
-
function
|
|
658
|
-
let t2 =
|
|
659
|
-
return
|
|
660
|
-
}
|
|
661
|
-
var
|
|
662
|
-
var
|
|
663
|
-
var
|
|
664
|
-
var
|
|
665
|
-
var
|
|
666
|
-
var
|
|
667
|
-
var
|
|
668
|
-
var
|
|
669
|
-
var
|
|
670
|
-
var
|
|
671
|
-
function Et(e5) {
|
|
672
|
-
return Dt(e5).replace(yt, `._base_domain_`).replace(wt, `._api_base_domain_`).replace(Tt, `*.dev.wix-code.com`);
|
|
673
|
-
}
|
|
654
|
+
function ht(e5, t2 = false) {
|
|
655
|
+
return mt(e5, t2);
|
|
656
|
+
}
|
|
657
|
+
function gt(e5) {
|
|
658
|
+
let t2 = kt(Dt(e5.host), e5.domainToMappings);
|
|
659
|
+
return Rt(Ft(e5.protoPath, e5.data || {}), t2);
|
|
660
|
+
}
|
|
661
|
+
var _t = [`wix.com`, `editorx.com`];
|
|
662
|
+
var vt = `_`;
|
|
663
|
+
var yt = `*.`;
|
|
664
|
+
var bt = RegExp(`\\.(${_t.join(`|`)})$`);
|
|
665
|
+
var xt = [`42.wixprod.net`, `uw2-edt-1.wixprod.net`, `virginia-edt.wixprod.net`];
|
|
666
|
+
var St = { "payments.base44.com": `manage.wix.com`, "create.editorx.com": `editor.editorx.com` };
|
|
667
|
+
var Ct = `dev.wix-code.com`;
|
|
668
|
+
var wt = /{(.*)}/;
|
|
669
|
+
var Tt = RegExp(`\\.(${xt.join(`|`)})$`);
|
|
670
|
+
var Et = RegExp(`.*\\.${Ct}$`);
|
|
674
671
|
function Dt(e5) {
|
|
675
|
-
return
|
|
672
|
+
return Ot(e5).replace(bt, `._base_domain_`).replace(Tt, `._api_base_domain_`).replace(Et, `*.dev.wix-code.com`);
|
|
676
673
|
}
|
|
677
|
-
function Ot(e5
|
|
674
|
+
function Ot(e5) {
|
|
675
|
+
return St[e5] ?? e5;
|
|
676
|
+
}
|
|
677
|
+
function kt(e5, t2) {
|
|
678
678
|
let n2 = t2[e5];
|
|
679
679
|
if (n2) return n2;
|
|
680
|
-
let r2 =
|
|
680
|
+
let r2 = At(e5, t2) ?? jt(e5, t2);
|
|
681
681
|
if (!r2) {
|
|
682
|
-
if (
|
|
683
|
-
let e6 = t2[
|
|
682
|
+
if (Nt(e5)) {
|
|
683
|
+
let e6 = t2[Pt];
|
|
684
684
|
if (e6) return e6;
|
|
685
685
|
}
|
|
686
|
-
let n3 = t2[
|
|
686
|
+
let n3 = t2[vt];
|
|
687
687
|
if (n3) return n3;
|
|
688
688
|
}
|
|
689
689
|
return r2 ?? [];
|
|
690
690
|
}
|
|
691
|
-
function
|
|
691
|
+
function At(e5, t2) {
|
|
692
692
|
return Object.entries(t2).find(([t3]) => {
|
|
693
693
|
let [, ...n2] = e5.split(`.`);
|
|
694
694
|
return n2.join(`.`) === t3;
|
|
695
695
|
})?.[1];
|
|
696
696
|
}
|
|
697
|
-
function
|
|
698
|
-
let [n2] = Object.entries(t2).filter(([t3]) =>
|
|
697
|
+
function jt(e5, t2) {
|
|
698
|
+
let [n2] = Object.entries(t2).filter(([t3]) => Mt(e5, t3)).sort(([e6], [t3]) => t3.length - e6.length);
|
|
699
699
|
if (!n2) return;
|
|
700
700
|
let [, r2] = n2;
|
|
701
701
|
return r2;
|
|
702
702
|
}
|
|
703
|
-
function
|
|
704
|
-
if (!t2.startsWith(
|
|
703
|
+
function Mt(e5, t2) {
|
|
704
|
+
if (!t2.startsWith(yt)) return false;
|
|
705
705
|
let n2 = t2.slice(1);
|
|
706
706
|
return e5.length > n2.length && e5.endsWith(n2);
|
|
707
707
|
}
|
|
708
|
-
function
|
|
708
|
+
function Nt(e5) {
|
|
709
709
|
return !!e5.match(/\._base_domain_$/);
|
|
710
710
|
}
|
|
711
|
-
var
|
|
712
|
-
function Pt(e5, t2) {
|
|
713
|
-
return e5.split(`/`).map((e6) => Ft(e6, t2)).join(`/`);
|
|
714
|
-
}
|
|
711
|
+
var Pt = `www._base_domain_`;
|
|
715
712
|
function Ft(e5, t2) {
|
|
716
|
-
|
|
717
|
-
|
|
713
|
+
return e5.split(`/`).map((e6) => It(e6, t2)).join(`/`);
|
|
714
|
+
}
|
|
715
|
+
function It(e5, t2) {
|
|
716
|
+
let n2 = e5.match(wt) || [], r2 = n2[1];
|
|
717
|
+
return r2 ? Lt(t2, r2, e5, e5.replace(n2[0], ``)) : e5;
|
|
718
718
|
}
|
|
719
|
-
function
|
|
719
|
+
function Lt(e5, t2, n2, r2) {
|
|
720
720
|
let i2 = e5;
|
|
721
721
|
for (let e6 of t2.split(`.`)) {
|
|
722
722
|
if (!i2) return n2;
|
|
@@ -724,31 +724,31 @@ function It(e5, t2, n2, r2) {
|
|
|
724
724
|
}
|
|
725
725
|
return `${i2}${r2}`;
|
|
726
726
|
}
|
|
727
|
-
function
|
|
727
|
+
function Rt(e5, t2) {
|
|
728
728
|
let n2 = t2?.find((t3) => e5.startsWith(t3.destPath));
|
|
729
729
|
return n2 ? n2.srcPath + e5.slice(n2.destPath.length) : e5;
|
|
730
730
|
}
|
|
731
|
-
var
|
|
731
|
+
var j;
|
|
732
732
|
(function(e5) {
|
|
733
733
|
e5.QUERY_PARAM = `QUERY_PARAM`, e5.SUBDOMAIN = `SUBDOMAIN`, e5.SUBDIRECTORY = `SUBDIRECTORY`;
|
|
734
|
-
})(
|
|
735
|
-
var
|
|
736
|
-
var
|
|
734
|
+
})(j ||= {});
|
|
735
|
+
var zt = { cs: `\u010Ce\u0161tina`, da: `Dansk`, de: `Deutsch`, en: `English`, es: `Espa\xF1ol`, fr: `Fran\xE7ais`, hi: `\u0939\u093F\u0928\u094D\u0926\u0940`, id: `Bahasa Indonesia`, it: `Italiano`, ja: `\u65E5\u672C\u8A9E`, ko: `\uD55C\uAD6D\uC5B4`, nl: `Nederlands`, no: `Norsk`, pl: `Polski`, pt: `Portugu\xEAs`, ru: `\u0420\u0443\u0441\u0441\u043A\u0438\u0439`, sv: `Svenska`, th: `\u0E44\u0E17\u0E22`, tr: `T\xFCrk\xE7e`, uk: `\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430`, vi: `Ti\u1EBFng Vi\u1EC7t`, zh: `\u7E41\u9AD4\u4E2D\u6587`, sq: `Shqip`, am: `\u12A0\u121B\u122D\u129B`, ar: `\u0627\u0644\u0639\u0631\u0628\u064A\u0629`, hy: `\u0540\u0561\u0575\u0565\u0580\u0565\u0576`, az: `Az\u0259rbaycan dili`, eu: `Euskara`, be: `\u0411\u0435\u043B\u0430\u0440\u0443\u0441\u043A\u0430\u044F`, bn: `\u09AC\u09BE\u0982\u09B2\u09BE`, bs: `Bosanski`, bg: `\u0411\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438`, ca: `Catal\xE0`, ny: `ChiChe\u0175a`, co: `Corsu`, hr: `Hrvatski`, et: `Eesti`, fj: `Vosa Vakaviti`, fi: `Suomi`, ga: `Gaeilge`, gl: `Galego`, ka: `\u10E5\u10D0\u10E0\u10D7\u10E3\u10DA\u10D8`, el: `\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC`, gu: `\u0A97\u0AC1\u0A9C\u0AB0\u0ABE\u0AA4\u0AC0`, ht: `Krey\xF2l Ayisyen`, ha: `Hausa`, he: `\u05E2\u05D1\u05E8\u05D9\u05EA`, hu: `Magyar`, is: `\xCDslenska`, ig: `Igbo`, kn: `\u0C95\u0CA8\u0CCD\u0CA8\u0CA1`, kk: `\u049A\u0430\u0437\u0430\u049B \u0442\u0456\u043B\u0456`, km: `\u1797\u17B6\u179F\u17B6\u1781\u17D2\u1798\u17C2\u179A`, ku: `Kurd\xEE`, ky: `\u041A\u044B\u0440\u0433\u044B\u0437\u0447\u0430`, lb: `L\xEBtzebuergesch`, lo: `\u0EA5\u0EB2\u0EA7`, la: `Latina`, lv: `Latvie\u0161u`, lt: `Lietuvi\u0173`, mk: `\u041C\u0430\u043A\u0435\u0434\u043E\u043D\u0441\u043A\u0438`, mg: `Malagasy`, ms: `Bahasa Melayu`, ml: `\u0D2E\u0D32\u0D2F\u0D3E\u0D33\u0D02`, mt: `Malti`, mn: `\u041C\u043E\u043D\u0433\u043E\u043B`, ne: `\u0928\u0947\u092A\u093E\u0932\u0940`, ps: `\u067E\u069A\u062A\u0648`, fa: `\u0641\u0627\u0631\u0633\u06CC`, ro: `Rom\xE2n\u0103`, sm: `Gagana Samoa`, sr: `\u0421\u0440\u043F\u0441\u043A\u0438`, sn: `Shona`, sd: `\u0633\u0646\u068C\u064A`, si: `\u0DC3\u0DD2\u0D82\u0DC4\u0DBD`, sk: `Sloven\u010Dina`, sl: `Sloven\u0161\u010Dina`, so: `Soomaaliga`, su: `Basa Sunda`, sw: `Kiswahili`, tl: `Filipino`, tg: `\u0422\u043E\u04B7\u0438\u043A\u04E3`, ta: `\u0BA4\u0BAE\u0BBF\u0BB4\u0BCD`, te: `\u0C24\u0C46\u0C32\u0C41\u0C17\u0C41`, tk: `T\xFCrkmen`, ur: `\u0627\u0631\u062F\u0648`, uz: `O'zbek`, cy: `Cymraeg`, xh: `isiXhosa`, yi: `\u05D9\u05D9\u05B4\u05D3\u05D9\u05E9`, yo: `Yor\xF9b\xE1`, zu: `isiZulu`, kl: `Kalaallisut`, fo: `F\xF8royskt`, ln: `Ling\xE1la`, mi: `M\u0101ori`, mr: `\u092E\u0930\u093E\u0920\u0940`, my: `\u1019\u103C\u1014\u103A\u1019\u102C`, se: `S\xE1megiella`, ug: `\u0626\u06C7\u064A\u063A\u06C7\u0631\u0686\u06D5`, qu: `Runa Simi`, aa: `Afar`, ab: `\u0410\u04A7\u0441\u0443\u0430`, ae: `Avestan`, ak: `Akan`, an: `Aragon\xE9s`, as: `\u0985\u09B8\u09AE\u09C0\u09AF\u09BC\u09BE`, av: `\u0410\u0432\u0430\u0440`, ay: `Aymar aru`, ba: `\u0411\u0430\u0448\u04A1\u043E\u0440\u0442\u0441\u0430`, bh: `\u092D\u094B\u091C\u092A\u0941\u0930\u0940`, bi: `Bislama`, bm: `Bamanankan`, bo: `\u0F56\u0F7C\u0F51\u0F0B\u0F66\u0F90\u0F51\u0F0B`, br: `Brezhoneg`, ce: `\u041D\u043E\u0445\u0447\u0438\u0439\u043D`, ch: `Chamoru`, cr: `\u14C0\u1426\u1403\u152D\u140D\u140F\u1423`, cu: `\u0426\u0440\u044C\u043A\u044A\u0432\u044C\u043D\u043E\u0441\u043B\u043E\u0432\u0463\u043D\u044C\u0441\u043A\u044A`, cv: `\u0427\u04D1\u0432\u0430\u0448\u043B\u0430`, dv: `\u078B\u07A8\u0788\u07AC\u0780\u07A8\u0784\u07A6\u0790\u07B0`, dz: `\u0F62\u0FAB\u0F7C\u0F44\u0F0B\u0F41`, ee: `E\u028Begbe`, eo: `Esperanto`, ff: `Fulah`, fy: `Frysk`, gd: `G\xE0idhlig`, gn: `Ava\xF1e'\u1EBD`, gv: `Gaelg`, ho: `Hiri Motu`, hz: `Otjiherero`, ia: `Interlingua`, ie: `Interlingue`, ii: `\uA188\uA320\uA259`, ik: `I\xF1upiaq`, io: `Ido`, iu: `\u1403\u14C4\u1483\u144E\u1450\u1466`, jv: `Basa Jawa`, ki: `Gikuyu`, kr: `Kanuri`, ks: `\u06A9\u0672\u0634\u064F\u0631`, kw: `Kernewek`, lg: `Luganda`, li: `Limburgs`, lu: `Tshiluba`, mh: `Kajin M\u0327aje\u013C`, na: `Dorerin Naoero`, nb: `Norsk Bokm\xE5l`, nd: `isiNdebele`, ng: `Oshiwambo`, nn: `Norsk Nynorsk`, nr: `isiNdebele (South)`, nv: `Din\xE9 Bizaad`, oc: `Occitan`, oj: `Anishinaabemowin`, om: `Afaan Oromoo`, or: `\u0B13\u0B21\u0B3C\u0B3F\u0B06`, os: `\u0418\u0440\u043E\u043D`, pa: `\u0A2A\u0A70\u0A1C\u0A3E\u0A2C\u0A40`, pi: `\u{11005}\u{1102F}\u{11022}`, rm: `Rumantsch`, rn: `Ikirundi`, rw: `Kinyarwanda`, sa: `\u0938\u0902\u0938\u094D\u0915\u0943\u0924\u092E\u094D`, sc: `Sardu`, sg: `S\xE4ng\xF6`, ss: `SiSwati`, st: `Sesotho`, ti: `\u1275\u130D\u122D\u129B`, tn: `Setswana`, to: `Faka Tonga`, ts: `Xitsonga`, tt: `\u0422\u0430\u0442\u0430\u0440\u0447\u0430`, tw: `Twi`, ty: `Reo Tahiti`, ve: `Tshiven\u1E13a`, vo: `Volap\xFCk`, wa: `Walon`, wo: `Wolof`, za: `Sa\u026F cue\u014B\u0185` };
|
|
736
|
+
var Bt = (e5, t2) => {
|
|
737
737
|
e5.searchParams.set(`lang`, t2);
|
|
738
738
|
};
|
|
739
|
-
var
|
|
739
|
+
var Vt = (e5, t2) => {
|
|
740
740
|
let n2 = e5.hostname.split(`.`);
|
|
741
741
|
n2[0] === `www` && (n2 = n2.slice(1)), n2 = [t2, ...n2], e5.hostname = n2.join(`.`);
|
|
742
742
|
};
|
|
743
|
-
var
|
|
743
|
+
var Ht = (e5, t2) => {
|
|
744
744
|
e5.pathname = `/${t2}${e5.pathname}`;
|
|
745
745
|
};
|
|
746
|
-
var
|
|
746
|
+
var Ut = (e5, t2) => {
|
|
747
747
|
if (!t2.languageCode || !t2?.resolutionMethod) return e5;
|
|
748
748
|
let n2 = new URL(e5);
|
|
749
|
-
return (t2?.resolutionMethod === `QUERY_PARAM` ?
|
|
749
|
+
return (t2?.resolutionMethod === `QUERY_PARAM` ? Bt : t2?.resolutionMethod === `SUBDOMAIN` ? Vt : Ht)(n2, t2.languageCode), n2.href;
|
|
750
750
|
};
|
|
751
|
-
var
|
|
751
|
+
var Wt = (e5, t2) => {
|
|
752
752
|
if (!e5?.length) return e5;
|
|
753
753
|
let n2;
|
|
754
754
|
try {
|
|
@@ -769,91 +769,91 @@ var Ut = (e5, t2) => {
|
|
|
769
769
|
}
|
|
770
770
|
return n2.href;
|
|
771
771
|
};
|
|
772
|
-
function Wt() {
|
|
773
|
-
let e5 = Gt();
|
|
774
|
-
return e5 ? Kt(e5) : [];
|
|
775
|
-
}
|
|
776
772
|
function Gt() {
|
|
773
|
+
let e5 = Kt();
|
|
774
|
+
return e5 ? qt(e5) : [];
|
|
775
|
+
}
|
|
776
|
+
function Kt() {
|
|
777
777
|
let e5 = typeof globals < `u` ? globals?.$ns?.[`wix-window`]?.multilingual : void 0, t2 = typeof window < `u` ? window?.essentials?.multilingual : void 0;
|
|
778
778
|
return e5 ?? t2 ?? globalThis?.__wix_site_metadata__?.multilingual;
|
|
779
779
|
}
|
|
780
|
-
function
|
|
780
|
+
function qt(e5) {
|
|
781
781
|
try {
|
|
782
782
|
if (e5?.supportedLanguages?.length) {
|
|
783
|
-
let t2 = e5.supportedLanguages, n2 = t2.map((e6) => e6.languageCode).filter(Boolean), r2 = e5.cleanUrl ??
|
|
784
|
-
return t2.map((e6) => ({ id: e6.languageCode, displayName:
|
|
783
|
+
let t2 = e5.supportedLanguages, n2 = t2.map((e6) => e6.languageCode).filter(Boolean), r2 = e5.cleanUrl ?? Zt(n2);
|
|
784
|
+
return t2.map((e6) => ({ id: e6.languageCode, displayName: Jt(e6), regionalFormat: [e6.locale?.languageCode, e6.locale?.country].filter(Boolean).join(`-`), url: Yt(e6, r2), primary: e6.isPrimary, resolutionMethod: e6.resolutionMethod }));
|
|
785
785
|
}
|
|
786
786
|
if (e5?.siteLanguages?.length) {
|
|
787
|
-
let t2 = e5.siteLanguages, n2 =
|
|
788
|
-
return t2.map((e6) => ({ id: e6.languageCode, displayName:
|
|
787
|
+
let t2 = e5.siteLanguages, n2 = Zt(t2.map((e6) => e6.languageCode).filter(Boolean));
|
|
788
|
+
return t2.map((e6) => ({ id: e6.languageCode, displayName: Jt(e6), regionalFormat: e6.locale, url: Yt(e6, n2), primary: e6.isPrimaryLanguage, resolutionMethod: e6.resolutionMethod ? Xt(e6.resolutionMethod) : void 0 }));
|
|
789
789
|
}
|
|
790
790
|
} catch (e6) {
|
|
791
791
|
return console.warn(`[Multilingual Manager] listSupportedLanguages failed`, e6), [];
|
|
792
792
|
}
|
|
793
793
|
return console.warn(`[Multilingual Manager] listSupportedLanguages is not available`), [];
|
|
794
794
|
}
|
|
795
|
-
function
|
|
796
|
-
let t2 =
|
|
795
|
+
function Jt(e5) {
|
|
796
|
+
let t2 = zt[e5.languageCode];
|
|
797
797
|
if (t2) return t2;
|
|
798
798
|
let n2 = e5.name ?? e5.countryCode;
|
|
799
799
|
if (n2) return n2;
|
|
800
800
|
}
|
|
801
|
-
function
|
|
801
|
+
function Yt(e5, t2) {
|
|
802
802
|
if (e5.url || !t2 || !e5.resolutionMethod) return e5.url;
|
|
803
803
|
if (e5.languageCode) try {
|
|
804
|
-
return
|
|
804
|
+
return Ut(t2, { languageCode: e5.languageCode, countryCode: e5.countryCode, resolutionMethod: Xt(e5.resolutionMethod), locale: { languageCode: e5.languageCode, country: e5.countryCode } });
|
|
805
805
|
} catch (e6) {
|
|
806
806
|
console.warn(`[Multilingual Manager] buildUrlForLanguage failed`, e6);
|
|
807
807
|
return;
|
|
808
808
|
}
|
|
809
809
|
}
|
|
810
|
-
function
|
|
810
|
+
function Xt(e5) {
|
|
811
811
|
switch (e5) {
|
|
812
812
|
case `QUERY_PARAM`:
|
|
813
813
|
case `QueryParam`:
|
|
814
|
-
return
|
|
814
|
+
return j.QUERY_PARAM;
|
|
815
815
|
case `SUBDOMAIN`:
|
|
816
816
|
case `Subdomain`:
|
|
817
|
-
return
|
|
817
|
+
return j.SUBDOMAIN;
|
|
818
818
|
case `SUBDIRECTORY`:
|
|
819
819
|
case `Subdirectory`:
|
|
820
|
-
return
|
|
820
|
+
return j.SUBDIRECTORY;
|
|
821
821
|
default:
|
|
822
822
|
return;
|
|
823
823
|
}
|
|
824
824
|
}
|
|
825
|
-
function
|
|
825
|
+
function Zt(e5) {
|
|
826
826
|
let t2 = typeof window < `u` && window.location?.href ? window.location.href : ``;
|
|
827
827
|
try {
|
|
828
|
-
return
|
|
828
|
+
return Wt(t2, e5);
|
|
829
829
|
} catch (e6) {
|
|
830
830
|
return console.warn(`[Multilingual Manager] cleanCurrentUrl failed`, e6), t2;
|
|
831
831
|
}
|
|
832
832
|
}
|
|
833
|
-
var
|
|
834
|
-
var
|
|
835
|
-
var
|
|
836
|
-
var
|
|
837
|
-
let e5 =
|
|
838
|
-
if (e5) return { [
|
|
833
|
+
var Qt = `x-wix-linguist`;
|
|
834
|
+
var $t = `00000000-0000-0000-0000-000000000000`;
|
|
835
|
+
var en = `false`;
|
|
836
|
+
var tn = () => {
|
|
837
|
+
let e5 = M(`language`), t2 = M(`locale`);
|
|
838
|
+
if (e5) return { [Qt]: [e5, t2 || e5, en, $t].join(`|`) };
|
|
839
839
|
};
|
|
840
|
-
function
|
|
840
|
+
function nn() {
|
|
841
841
|
let e5 = null, t2 = null;
|
|
842
842
|
return { promise: new Promise((n2, r2) => {
|
|
843
843
|
e5 = n2, t2 = r2;
|
|
844
844
|
}), resolve: e5, reject: t2 };
|
|
845
845
|
}
|
|
846
|
-
var
|
|
847
|
-
var
|
|
848
|
-
var
|
|
849
|
-
let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e5(t2), o2 =
|
|
850
|
-
return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language:
|
|
851
|
-
return
|
|
846
|
+
var rn = () => (typeof window < `u` ? window.commonConfig : void 0) ?? globalThis.commonConfig;
|
|
847
|
+
var M = (e5) => rn()?.[e5];
|
|
848
|
+
var an = ({ createHost: e5 }) => ({ __type: `host`, create: (e6) => ({}), host: (t2) => {
|
|
849
|
+
let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e5(t2), o2 = sn();
|
|
850
|
+
return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language: M(`language`), locale: M(`locale`), get passThroughHeaders() {
|
|
851
|
+
return tn();
|
|
852
852
|
} } };
|
|
853
853
|
}, auth: (e6) => {
|
|
854
854
|
let t2 = typeof window < `u` ? window.wixEmbedsAPI : void 0;
|
|
855
|
-
!e6 &&
|
|
856
|
-
let n2 = false, { resolve: r2, promise: i2 } =
|
|
855
|
+
!e6 && on() && (e6 = t2?.getAccessTokenFunction?.());
|
|
856
|
+
let n2 = false, { resolve: r2, promise: i2 } = nn();
|
|
857
857
|
return { getAuthHeaders: async () => {
|
|
858
858
|
if (!e6 && n2 && (e6 = await i2), !e6) throw Error(`Failed to resolve auth token`);
|
|
859
859
|
return { headers: { Authorization: await e6() } };
|
|
@@ -861,37 +861,37 @@ var rn = ({ createHost: e5 }) => ({ __type: `host`, create: (e6) => ({}), host:
|
|
|
861
861
|
r2(e7);
|
|
862
862
|
}) };
|
|
863
863
|
} });
|
|
864
|
-
function
|
|
864
|
+
function on() {
|
|
865
865
|
return typeof document < `u` && document.currentScript?.tagName === `SCRIPT`;
|
|
866
866
|
}
|
|
867
|
-
function
|
|
867
|
+
function sn() {
|
|
868
868
|
let e5 = (typeof window < `u` ? window.wixEmbedsAPI : void 0)?.getExternalBaseUrl?.();
|
|
869
869
|
if (!e5) return;
|
|
870
870
|
let t2 = new URL(e5);
|
|
871
871
|
return t2?.pathname && t2.pathname !== `/` ? `${t2.hostname}${t2.pathname}` : t2.hostname;
|
|
872
872
|
}
|
|
873
|
-
var
|
|
873
|
+
var cn = ({ clientSdk: e5, applicationId: t2 }) => ({ invoke: async ({ namespace: n2, method: r2, args: i2 }) => {
|
|
874
874
|
if (!e5) throw Error(`Wix Site SDK only works in a Wix site environment. Learn more: https://dev.wix.com/docs/sdk/host-modules/site/introduction`);
|
|
875
875
|
return e5.invoke({ namespace: n2, method: r2, args: i2, applicationId: t2, accessToken: `accessToken` });
|
|
876
876
|
}, getAccessToken: () => {
|
|
877
877
|
throw Error(`Not implemented`);
|
|
878
878
|
}, observeState: () => ({ disconnect: () => {
|
|
879
879
|
} }) });
|
|
880
|
-
var
|
|
880
|
+
var ln = an({ createHost: function(e5) {
|
|
881
881
|
let t2 = (typeof $wixContext < `u` ? $wixContext.clientSdk : void 0) ?? e5?.clientSdk ?? (typeof window < `u` ? window?.clientSdk : void 0), { applicationId: n2 } = e5 || {};
|
|
882
882
|
if (!n2) throw Error(`"createHost" was called without a required field "applicationId"`);
|
|
883
|
-
return { channel:
|
|
883
|
+
return { channel: cn({ clientSdk: t2, applicationId: n2 }), close: () => {
|
|
884
884
|
} };
|
|
885
885
|
} });
|
|
886
|
-
var
|
|
887
|
-
let n2 =
|
|
888
|
-
return
|
|
886
|
+
var un = (e5, t2) => {
|
|
887
|
+
let n2 = ln.host({ applicationId: e5, componentId: t2 }), r2 = ln.auth();
|
|
888
|
+
return He({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
|
|
889
889
|
};
|
|
890
|
-
var
|
|
891
|
-
function
|
|
890
|
+
var dn = (e5) => un(`13d21c63-b5ec-5912-8397-c3a5ddb27a97`, e5);
|
|
891
|
+
function fn() {
|
|
892
892
|
let e5 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
893
893
|
if (e5) return { initWixModules(t3, n3) {
|
|
894
|
-
return
|
|
894
|
+
return N(() => e5(t3, n3));
|
|
895
895
|
}, fetchWithAuth() {
|
|
896
896
|
throw Error(`fetchWithAuth is not available in this context`);
|
|
897
897
|
}, graphql() {
|
|
@@ -901,10 +901,10 @@ function dn() {
|
|
|
901
901
|
if (t2 || n2) return { initWixModules(e6, r2) {
|
|
902
902
|
if (r2) {
|
|
903
903
|
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`);
|
|
904
|
-
return
|
|
904
|
+
return N(() => n2.use(e6));
|
|
905
905
|
}
|
|
906
906
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
907
|
-
return
|
|
907
|
+
return N(() => t2.use(e6));
|
|
908
908
|
}, fetchWithAuth: (e6, n3) => {
|
|
909
909
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
910
910
|
return t2.fetchWithAuth(e6, n3);
|
|
@@ -916,7 +916,7 @@ function dn() {
|
|
|
916
916
|
return t2.graphql(e6, n3, r2);
|
|
917
917
|
} };
|
|
918
918
|
}
|
|
919
|
-
function
|
|
919
|
+
function N(e5) {
|
|
920
920
|
let t2 = globalThis.__wix_context__, n2 = { client: p.client, elevatedClient: p.elevatedClient }, r2;
|
|
921
921
|
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);
|
|
922
922
|
try {
|
|
@@ -925,71 +925,71 @@ function P(e5) {
|
|
|
925
925
|
globalThis.__wix_context__ = t2, p.client = n2.client, p.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
926
926
|
}
|
|
927
927
|
}
|
|
928
|
-
function
|
|
928
|
+
function pn(e5, t2) {
|
|
929
929
|
return { ...e5, ...Object.fromEntries(t2.map((t3) => [t3, (...n2) => {
|
|
930
|
-
let r2 =
|
|
930
|
+
let r2 = fn();
|
|
931
931
|
if (!r2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
932
932
|
return r2.initWixModules(e5)[t3].apply(void 0, n2);
|
|
933
933
|
}])) };
|
|
934
934
|
}
|
|
935
|
-
function
|
|
936
|
-
return
|
|
935
|
+
function mn(e5) {
|
|
936
|
+
return pn({ __type: `host`, create: (t2) => Object.entries(e5).reduce((e6, [n2, r2]) => ({ ...e6, [n2]: r2(t2) }), {}) }, Object.keys(e5));
|
|
937
937
|
}
|
|
938
|
-
var
|
|
939
|
-
var
|
|
938
|
+
var P = (e5) => typeof e5 == `string`;
|
|
939
|
+
var F = () => {
|
|
940
940
|
let e5, t2, n2 = new Promise((n3, r2) => {
|
|
941
941
|
e5 = n3, t2 = r2;
|
|
942
942
|
});
|
|
943
943
|
return n2.resolve = e5, n2.reject = t2, n2;
|
|
944
944
|
};
|
|
945
|
-
var
|
|
946
|
-
var
|
|
945
|
+
var hn = (e5) => e5 == null ? `` : `` + e5;
|
|
946
|
+
var gn = (e5, t2, n2) => {
|
|
947
947
|
e5.forEach((e6) => {
|
|
948
948
|
t2[e6] && (n2[e6] = t2[e6]);
|
|
949
949
|
});
|
|
950
950
|
};
|
|
951
|
-
var
|
|
952
|
-
var
|
|
953
|
-
var
|
|
954
|
-
var
|
|
955
|
-
let r2 =
|
|
951
|
+
var _n = /###/g;
|
|
952
|
+
var vn = (e5) => e5 && e5.indexOf(`###`) > -1 ? e5.replace(_n, `.`) : e5;
|
|
953
|
+
var yn = (e5) => !e5 || P(e5);
|
|
954
|
+
var I = (e5, t2, n2) => {
|
|
955
|
+
let r2 = P(t2) ? t2.split(`.`) : t2, i2 = 0;
|
|
956
956
|
for (; i2 < r2.length - 1; ) {
|
|
957
|
-
if (
|
|
958
|
-
let t3 =
|
|
957
|
+
if (yn(e5)) return {};
|
|
958
|
+
let t3 = vn(r2[i2]);
|
|
959
959
|
!e5[t3] && n2 && (e5[t3] = new n2()), e5 = Object.prototype.hasOwnProperty.call(e5, t3) ? e5[t3] : {}, ++i2;
|
|
960
960
|
}
|
|
961
|
-
return
|
|
961
|
+
return yn(e5) ? {} : { obj: e5, k: vn(r2[i2]) };
|
|
962
962
|
};
|
|
963
|
-
var
|
|
964
|
-
let { obj: r2, k: i2 } =
|
|
963
|
+
var bn = (e5, t2, n2) => {
|
|
964
|
+
let { obj: r2, k: i2 } = I(e5, t2, Object);
|
|
965
965
|
if (r2 !== void 0 || t2.length === 1) {
|
|
966
966
|
r2[i2] = n2;
|
|
967
967
|
return;
|
|
968
968
|
}
|
|
969
|
-
let a2 = t2[t2.length - 1], o2 = t2.slice(0, t2.length - 1), s2 =
|
|
970
|
-
for (; s2.obj === void 0 && o2.length; ) a2 = `${o2[o2.length - 1]}.${a2}`, o2 = o2.slice(0, o2.length - 1), s2 =
|
|
969
|
+
let a2 = t2[t2.length - 1], o2 = t2.slice(0, t2.length - 1), s2 = I(e5, o2, Object);
|
|
970
|
+
for (; s2.obj === void 0 && o2.length; ) a2 = `${o2[o2.length - 1]}.${a2}`, o2 = o2.slice(0, o2.length - 1), s2 = I(e5, o2, Object), s2?.obj && s2.obj[`${s2.k}.${a2}`] !== void 0 && (s2.obj = void 0);
|
|
971
971
|
s2.obj[`${s2.k}.${a2}`] = n2;
|
|
972
972
|
};
|
|
973
|
-
var
|
|
974
|
-
let { obj: i2, k: a2 } =
|
|
973
|
+
var xn = (e5, t2, n2, r2) => {
|
|
974
|
+
let { obj: i2, k: a2 } = I(e5, t2, Object);
|
|
975
975
|
i2[a2] = i2[a2] || [], i2[a2].push(n2);
|
|
976
976
|
};
|
|
977
|
-
var
|
|
978
|
-
let { obj: n2, k: r2 } =
|
|
977
|
+
var L = (e5, t2) => {
|
|
978
|
+
let { obj: n2, k: r2 } = I(e5, t2);
|
|
979
979
|
if (n2 && Object.prototype.hasOwnProperty.call(n2, r2)) return n2[r2];
|
|
980
980
|
};
|
|
981
|
-
var xn = (e5, t2, n2) => {
|
|
982
|
-
let r2 = R(e5, n2);
|
|
983
|
-
return r2 === void 0 ? R(t2, n2) : r2;
|
|
984
|
-
};
|
|
985
981
|
var Sn = (e5, t2, n2) => {
|
|
986
|
-
|
|
982
|
+
let r2 = L(e5, n2);
|
|
983
|
+
return r2 === void 0 ? L(t2, n2) : r2;
|
|
984
|
+
};
|
|
985
|
+
var Cn = (e5, t2, n2) => {
|
|
986
|
+
for (let r2 in t2) r2 !== `__proto__` && r2 !== `constructor` && (r2 in e5 ? P(e5[r2]) || e5[r2] instanceof String || P(t2[r2]) || t2[r2] instanceof String ? n2 && (e5[r2] = t2[r2]) : Cn(e5[r2], t2[r2], n2) : e5[r2] = t2[r2]);
|
|
987
987
|
return e5;
|
|
988
988
|
};
|
|
989
|
-
var
|
|
990
|
-
var
|
|
991
|
-
var
|
|
992
|
-
var
|
|
989
|
+
var R = (e5) => e5.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, `\\$&`);
|
|
990
|
+
var wn = { "&": `&`, "<": `<`, ">": `>`, '"': `"`, "'": `'`, "/": `/` };
|
|
991
|
+
var Tn = (e5) => P(e5) ? e5.replace(/[&<>"'\/]/g, (e6) => wn[e6]) : e5;
|
|
992
|
+
var En = class {
|
|
993
993
|
constructor(e5) {
|
|
994
994
|
this.capacity = e5, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
|
|
995
995
|
}
|
|
@@ -1000,20 +1000,20 @@ var Tn = class {
|
|
|
1000
1000
|
return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e5, n2), this.regExpQueue.push(e5), n2;
|
|
1001
1001
|
}
|
|
1002
1002
|
};
|
|
1003
|
-
var
|
|
1004
|
-
var
|
|
1005
|
-
var
|
|
1003
|
+
var Dn = [` `, `,`, `?`, `!`, `;`];
|
|
1004
|
+
var On = new En(20);
|
|
1005
|
+
var kn = (e5, t2, n2) => {
|
|
1006
1006
|
t2 ||= ``, n2 ||= ``;
|
|
1007
|
-
let r2 =
|
|
1007
|
+
let r2 = Dn.filter((e6) => t2.indexOf(e6) < 0 && n2.indexOf(e6) < 0);
|
|
1008
1008
|
if (r2.length === 0) return true;
|
|
1009
|
-
let i2 =
|
|
1009
|
+
let i2 = On.getRegExp(`(${r2.map((e6) => e6 === `?` ? `\\?` : e6).join(`|`)})`), a2 = !i2.test(e5);
|
|
1010
1010
|
if (!a2) {
|
|
1011
1011
|
let t3 = e5.indexOf(n2);
|
|
1012
1012
|
t3 > 0 && !i2.test(e5.substring(0, t3)) && (a2 = true);
|
|
1013
1013
|
}
|
|
1014
1014
|
return a2;
|
|
1015
1015
|
};
|
|
1016
|
-
var
|
|
1016
|
+
var z = (e5, t2, n2 = `.`) => {
|
|
1017
1017
|
if (!e5) return;
|
|
1018
1018
|
if (e5[t2]) return Object.prototype.hasOwnProperty.call(e5, t2) ? e5[t2] : void 0;
|
|
1019
1019
|
let r2 = t2.split(n2), i2 = e5;
|
|
@@ -1029,8 +1029,8 @@ var B = (e5, t2, n2 = `.`) => {
|
|
|
1029
1029
|
}
|
|
1030
1030
|
return i2;
|
|
1031
1031
|
};
|
|
1032
|
-
var
|
|
1033
|
-
var
|
|
1032
|
+
var B = (e5) => e5?.replace(/_/g, `-`);
|
|
1033
|
+
var An = { type: `logger`, log(e5) {
|
|
1034
1034
|
this.output(`log`, e5);
|
|
1035
1035
|
}, warn(e5) {
|
|
1036
1036
|
this.output(`warn`, e5);
|
|
@@ -1039,12 +1039,12 @@ var kn = { type: `logger`, log(e5) {
|
|
|
1039
1039
|
}, output(e5, t2) {
|
|
1040
1040
|
console?.[e5]?.apply?.(console, t2);
|
|
1041
1041
|
} };
|
|
1042
|
-
var
|
|
1042
|
+
var V = new class e2 {
|
|
1043
1043
|
constructor(e5, t2 = {}) {
|
|
1044
1044
|
this.init(e5, t2);
|
|
1045
1045
|
}
|
|
1046
1046
|
init(e5, t2 = {}) {
|
|
1047
|
-
this.prefix = t2.prefix || `i18next:`, this.logger = e5 ||
|
|
1047
|
+
this.prefix = t2.prefix || `i18next:`, this.logger = e5 || An, this.options = t2, this.debug = t2.debug;
|
|
1048
1048
|
}
|
|
1049
1049
|
log(...e5) {
|
|
1050
1050
|
return this.forward(e5, `log`, ``, true);
|
|
@@ -1059,7 +1059,7 @@ var H = new class e2 {
|
|
|
1059
1059
|
return this.forward(e5, `warn`, `WARNING DEPRECATED: `, true);
|
|
1060
1060
|
}
|
|
1061
1061
|
forward(e5, t2, n2, r2) {
|
|
1062
|
-
return r2 && !this.debug ? null : (
|
|
1062
|
+
return r2 && !this.debug ? null : (P(e5[0]) && (e5[0] = `${n2}${this.prefix} ${e5[0]}`), this.logger[t2](e5));
|
|
1063
1063
|
}
|
|
1064
1064
|
create(t2) {
|
|
1065
1065
|
return new e2(this.logger, { prefix: `${this.prefix}:${t2}:`, ...this.options });
|
|
@@ -1068,7 +1068,7 @@ var H = new class e2 {
|
|
|
1068
1068
|
return t2 ||= this.options, t2.prefix = t2.prefix || this.prefix, new e2(this.logger, t2);
|
|
1069
1069
|
}
|
|
1070
1070
|
}();
|
|
1071
|
-
var
|
|
1071
|
+
var H = class {
|
|
1072
1072
|
constructor() {
|
|
1073
1073
|
this.observers = {};
|
|
1074
1074
|
}
|
|
@@ -1096,7 +1096,7 @@ var U = class {
|
|
|
1096
1096
|
});
|
|
1097
1097
|
}
|
|
1098
1098
|
};
|
|
1099
|
-
var
|
|
1099
|
+
var jn = class extends H {
|
|
1100
1100
|
constructor(e5, t2 = { ns: [`translation`], defaultNS: `translation` }) {
|
|
1101
1101
|
super(), this.data = e5 || {}, this.options = t2, this.options.keySeparator === void 0 && (this.options.keySeparator = `.`), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = true);
|
|
1102
1102
|
}
|
|
@@ -1109,23 +1109,23 @@ var An = class extends U {
|
|
|
1109
1109
|
}
|
|
1110
1110
|
getResource(e5, t2, n2, r2 = {}) {
|
|
1111
1111
|
let i2 = r2.keySeparator === void 0 ? this.options.keySeparator : r2.keySeparator, a2 = r2.ignoreJSONStructure === void 0 ? this.options.ignoreJSONStructure : r2.ignoreJSONStructure, o2;
|
|
1112
|
-
e5.indexOf(`.`) > -1 ? o2 = e5.split(`.`) : (o2 = [e5, t2], n2 && (Array.isArray(n2) ? o2.push(...n2) :
|
|
1113
|
-
let s2 =
|
|
1114
|
-
return !s2 && !t2 && !n2 && e5.indexOf(`.`) > -1 && (e5 = o2[0], t2 = o2[1], n2 = o2.slice(2).join(`.`)), s2 || !a2 || !
|
|
1112
|
+
e5.indexOf(`.`) > -1 ? o2 = e5.split(`.`) : (o2 = [e5, t2], n2 && (Array.isArray(n2) ? o2.push(...n2) : P(n2) && i2 ? o2.push(...n2.split(i2)) : o2.push(n2)));
|
|
1113
|
+
let s2 = L(this.data, o2);
|
|
1114
|
+
return !s2 && !t2 && !n2 && e5.indexOf(`.`) > -1 && (e5 = o2[0], t2 = o2[1], n2 = o2.slice(2).join(`.`)), s2 || !a2 || !P(n2) ? s2 : z(this.data?.[e5]?.[t2], n2, i2);
|
|
1115
1115
|
}
|
|
1116
1116
|
addResource(e5, t2, n2, r2, i2 = { silent: false }) {
|
|
1117
1117
|
let a2 = i2.keySeparator === void 0 ? this.options.keySeparator : i2.keySeparator, o2 = [e5, t2];
|
|
1118
|
-
n2 && (o2 = o2.concat(a2 ? n2.split(a2) : n2)), e5.indexOf(`.`) > -1 && (o2 = e5.split(`.`), r2 = t2, t2 = o2[1]), this.addNamespaces(t2),
|
|
1118
|
+
n2 && (o2 = o2.concat(a2 ? n2.split(a2) : n2)), e5.indexOf(`.`) > -1 && (o2 = e5.split(`.`), r2 = t2, t2 = o2[1]), this.addNamespaces(t2), bn(this.data, o2, r2), i2.silent || this.emit(`added`, e5, t2, n2, r2);
|
|
1119
1119
|
}
|
|
1120
1120
|
addResources(e5, t2, n2, r2 = { silent: false }) {
|
|
1121
|
-
for (let r3 in n2) (
|
|
1121
|
+
for (let r3 in n2) (P(n2[r3]) || Array.isArray(n2[r3])) && this.addResource(e5, t2, r3, n2[r3], { silent: true });
|
|
1122
1122
|
r2.silent || this.emit(`added`, e5, t2, n2);
|
|
1123
1123
|
}
|
|
1124
1124
|
addResourceBundle(e5, t2, n2, r2, i2, a2 = { silent: false, skipCopy: false }) {
|
|
1125
1125
|
let o2 = [e5, t2];
|
|
1126
1126
|
e5.indexOf(`.`) > -1 && (o2 = e5.split(`.`), r2 = n2, n2 = t2, t2 = o2[1]), this.addNamespaces(t2);
|
|
1127
|
-
let s2 =
|
|
1128
|
-
a2.skipCopy || (n2 = JSON.parse(JSON.stringify(n2))), r2 ?
|
|
1127
|
+
let s2 = L(this.data, o2) || {};
|
|
1128
|
+
a2.skipCopy || (n2 = JSON.parse(JSON.stringify(n2))), r2 ? Cn(s2, n2, i2) : s2 = { ...s2, ...n2 }, bn(this.data, o2, s2), a2.silent || this.emit(`added`, e5, t2, n2);
|
|
1129
1129
|
}
|
|
1130
1130
|
removeResourceBundle(e5, t2) {
|
|
1131
1131
|
this.hasResourceBundle(e5, t2) && delete this.data[e5][t2], this.removeNamespaces(t2), this.emit(`removed`, e5, t2);
|
|
@@ -1147,31 +1147,31 @@ var An = class extends U {
|
|
|
1147
1147
|
return this.data;
|
|
1148
1148
|
}
|
|
1149
1149
|
};
|
|
1150
|
-
var
|
|
1150
|
+
var Mn = { processors: {}, addPostProcessor(e5) {
|
|
1151
1151
|
this.processors[e5.name] = e5;
|
|
1152
1152
|
}, handle(e5, t2, n2, r2, i2) {
|
|
1153
1153
|
return e5.forEach((e6) => {
|
|
1154
1154
|
t2 = this.processors[e6]?.process(t2, n2, r2, i2) ?? t2;
|
|
1155
1155
|
}), t2;
|
|
1156
1156
|
} };
|
|
1157
|
-
var
|
|
1158
|
-
function
|
|
1157
|
+
var Nn = Symbol(`i18next/PATH_KEY`);
|
|
1158
|
+
function Pn() {
|
|
1159
1159
|
let e5 = [], t2 = /* @__PURE__ */ Object.create(null), n2;
|
|
1160
|
-
return t2.get = (r2, i2) => (n2?.revoke?.(), i2 ===
|
|
1160
|
+
return t2.get = (r2, i2) => (n2?.revoke?.(), i2 === Nn ? e5 : (e5.push(i2), n2 = Proxy.revocable(r2, t2), n2.proxy)), Proxy.revocable(/* @__PURE__ */ Object.create(null), t2).proxy;
|
|
1161
1161
|
}
|
|
1162
|
-
function
|
|
1163
|
-
let { [
|
|
1162
|
+
function U(e5, t2) {
|
|
1163
|
+
let { [Nn]: n2 } = e5(Pn()), r2 = t2?.keySeparator ?? `.`, i2 = t2?.nsSeparator ?? `:`;
|
|
1164
1164
|
if (n2.length > 1 && i2) {
|
|
1165
1165
|
let e6 = t2?.ns, a2 = Array.isArray(e6) ? e6 : null;
|
|
1166
1166
|
if (a2 && a2.length > 1 && a2.slice(1).includes(n2[0])) return `${n2[0]}${i2}${n2.slice(1).join(r2)}`;
|
|
1167
1167
|
}
|
|
1168
1168
|
return n2.join(r2);
|
|
1169
1169
|
}
|
|
1170
|
-
var
|
|
1171
|
-
var
|
|
1172
|
-
var In = class e3 extends
|
|
1170
|
+
var Fn = {};
|
|
1171
|
+
var W = (e5) => !P(e5) && typeof e5 != `boolean` && typeof e5 != `number`;
|
|
1172
|
+
var In = class e3 extends H {
|
|
1173
1173
|
constructor(e5, t2 = {}) {
|
|
1174
|
-
super(),
|
|
1174
|
+
super(), gn([`resourceStore`, `languageUtils`, `pluralResolver`, `interpolator`, `backendConnector`, `i18nFormat`, `utils`], e5, this), this.options = t2, this.options.keySeparator === void 0 && (this.options.keySeparator = `.`), this.logger = V.create(`translator`);
|
|
1175
1175
|
}
|
|
1176
1176
|
changeLanguage(e5) {
|
|
1177
1177
|
e5 && (this.language = e5);
|
|
@@ -1181,53 +1181,53 @@ var In = class e3 extends U {
|
|
|
1181
1181
|
if (e5 == null) return false;
|
|
1182
1182
|
let r2 = this.resolve(e5, n2);
|
|
1183
1183
|
if (r2?.res === void 0) return false;
|
|
1184
|
-
let i2 =
|
|
1184
|
+
let i2 = W(r2.res);
|
|
1185
1185
|
return !(n2.returnObjects === false && i2);
|
|
1186
1186
|
}
|
|
1187
1187
|
extractFromKey(e5, t2) {
|
|
1188
1188
|
let n2 = t2.nsSeparator === void 0 ? this.options.nsSeparator : t2.nsSeparator;
|
|
1189
1189
|
n2 === void 0 && (n2 = `:`);
|
|
1190
|
-
let r2 = t2.keySeparator === void 0 ? this.options.keySeparator : t2.keySeparator, i2 = t2.ns || this.options.defaultNS || [], a2 = n2 && e5.indexOf(n2) > -1, o2 = !this.options.userDefinedKeySeparator && !t2.keySeparator && !this.options.userDefinedNsSeparator && !t2.nsSeparator && !
|
|
1190
|
+
let r2 = t2.keySeparator === void 0 ? this.options.keySeparator : t2.keySeparator, i2 = t2.ns || this.options.defaultNS || [], a2 = n2 && e5.indexOf(n2) > -1, o2 = !this.options.userDefinedKeySeparator && !t2.keySeparator && !this.options.userDefinedNsSeparator && !t2.nsSeparator && !kn(e5, n2, r2);
|
|
1191
1191
|
if (a2 && !o2) {
|
|
1192
1192
|
let t3 = e5.match(this.interpolator.nestingRegexp);
|
|
1193
|
-
if (t3 && t3.length > 0) return { key: e5, namespaces:
|
|
1193
|
+
if (t3 && t3.length > 0) return { key: e5, namespaces: P(i2) ? [i2] : i2 };
|
|
1194
1194
|
let a3 = e5.split(n2);
|
|
1195
1195
|
(n2 !== r2 || n2 === r2 && this.options.ns.indexOf(a3[0]) > -1) && (i2 = a3.shift()), e5 = a3.join(r2);
|
|
1196
1196
|
}
|
|
1197
|
-
return { key: e5, namespaces:
|
|
1197
|
+
return { key: e5, namespaces: P(i2) ? [i2] : i2 };
|
|
1198
1198
|
}
|
|
1199
1199
|
translate(t2, n2, r2) {
|
|
1200
1200
|
let i2 = typeof n2 == `object` ? { ...n2 } : n2;
|
|
1201
1201
|
if (typeof i2 != `object` && this.options.overloadTranslationOptionHandler && (i2 = this.options.overloadTranslationOptionHandler(arguments)), typeof i2 == `object` && (i2 = { ...i2 }), i2 ||= {}, t2 == null) return ``;
|
|
1202
|
-
typeof t2 == `function` && (t2 =
|
|
1202
|
+
typeof t2 == `function` && (t2 = U(t2, { ...this.options, ...i2 })), Array.isArray(t2) || (t2 = [String(t2)]), t2 = t2.map((e5) => typeof e5 == `function` ? U(e5, { ...this.options, ...i2 }) : String(e5));
|
|
1203
1203
|
let a2 = i2.returnDetails === void 0 ? this.options.returnDetails : i2.returnDetails, o2 = i2.keySeparator === void 0 ? this.options.keySeparator : i2.keySeparator, { key: s2, namespaces: c2 } = this.extractFromKey(t2[t2.length - 1], i2), l2 = c2[c2.length - 1], u2 = i2.nsSeparator === void 0 ? this.options.nsSeparator : i2.nsSeparator;
|
|
1204
1204
|
u2 === void 0 && (u2 = `:`);
|
|
1205
1205
|
let d2 = i2.lng || this.language, f2 = i2.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
|
|
1206
1206
|
if (d2?.toLowerCase() === `cimode`) return f2 ? a2 ? { res: `${l2}${u2}${s2}`, usedKey: s2, exactUsedKey: s2, usedLng: d2, usedNS: l2, usedParams: this.getUsedParamsDetails(i2) } : `${l2}${u2}${s2}` : a2 ? { res: s2, usedKey: s2, exactUsedKey: s2, usedLng: d2, usedNS: l2, usedParams: this.getUsedParamsDetails(i2) } : s2;
|
|
1207
|
-
let p2 = this.resolve(t2, i2), m2 = p2?.res, h2 = p2?.usedKey || s2, g2 = p2?.exactUsedKey || s2, _2 = [`[object Number]`, `[object Function]`, `[object RegExp]`], v2 = i2.joinArrays === void 0 ? this.options.joinArrays : i2.joinArrays, y2 = !this.i18nFormat || this.i18nFormat.handleAsObject, b2 = i2.count !== void 0 && !
|
|
1208
|
-
y2 && !m2 && x2 && (
|
|
1209
|
-
let
|
|
1210
|
-
if (y2 &&
|
|
1207
|
+
let p2 = this.resolve(t2, i2), m2 = p2?.res, h2 = p2?.usedKey || s2, g2 = p2?.exactUsedKey || s2, _2 = [`[object Number]`, `[object Function]`, `[object RegExp]`], v2 = i2.joinArrays === void 0 ? this.options.joinArrays : i2.joinArrays, y2 = !this.i18nFormat || this.i18nFormat.handleAsObject, b2 = i2.count !== void 0 && !P(i2.count), x2 = e3.hasDefaultValue(i2), ee2 = b2 ? this.pluralResolver.getSuffix(d2, i2.count, i2) : ``, te2 = i2.ordinal && b2 ? this.pluralResolver.getSuffix(d2, i2.count, { ordinal: false }) : ``, S2 = b2 && !i2.ordinal && i2.count === 0, C2 = S2 && i2[`defaultValue${this.options.pluralSeparator}zero`] || i2[`defaultValue${ee2}`] || i2[`defaultValue${te2}`] || i2.defaultValue, w2 = m2;
|
|
1208
|
+
y2 && !m2 && x2 && (w2 = C2);
|
|
1209
|
+
let ne2 = W(w2), re2 = Object.prototype.toString.apply(w2);
|
|
1210
|
+
if (y2 && w2 && ne2 && _2.indexOf(re2) < 0 && !(P(v2) && Array.isArray(w2))) {
|
|
1211
1211
|
if (!i2.returnObjects && !this.options.returnObjects) {
|
|
1212
1212
|
this.options.returnedObjectHandler || this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);
|
|
1213
|
-
let e5 = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(h2,
|
|
1213
|
+
let e5 = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(h2, w2, { ...i2, ns: c2 }) : `key '${s2} (${this.language})' returned an object instead of string.`;
|
|
1214
1214
|
return a2 ? (p2.res = e5, p2.usedParams = this.getUsedParamsDetails(i2), p2) : e5;
|
|
1215
1215
|
}
|
|
1216
1216
|
if (o2) {
|
|
1217
|
-
let e5 = Array.isArray(
|
|
1218
|
-
for (let e6 in
|
|
1217
|
+
let e5 = Array.isArray(w2), t3 = e5 ? [] : {}, n3 = e5 ? g2 : h2;
|
|
1218
|
+
for (let e6 in w2) if (Object.prototype.hasOwnProperty.call(w2, e6)) {
|
|
1219
1219
|
let r3 = `${n3}${o2}${e6}`;
|
|
1220
|
-
t3[e6] = x2 && !m2 ? this.translate(r3, { ...i2, defaultValue:
|
|
1220
|
+
t3[e6] = x2 && !m2 ? this.translate(r3, { ...i2, defaultValue: W(C2) ? C2[e6] : void 0, joinArrays: false, ns: c2 }) : this.translate(r3, { ...i2, joinArrays: false, ns: c2 }), t3[e6] === r3 && (t3[e6] = w2[e6]);
|
|
1221
1221
|
}
|
|
1222
1222
|
m2 = t3;
|
|
1223
1223
|
}
|
|
1224
|
-
} else if (y2 &&
|
|
1224
|
+
} else if (y2 && P(v2) && Array.isArray(m2)) m2 = m2.join(v2), m2 &&= this.extendTranslation(m2, t2, i2, r2);
|
|
1225
1225
|
else {
|
|
1226
1226
|
let e5 = false, n3 = false;
|
|
1227
|
-
!this.isValidLookup(m2) && x2 && (e5 = true, m2 =
|
|
1228
|
-
let a3 = (i2.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && n3 ? void 0 : m2, c3 = x2 &&
|
|
1227
|
+
!this.isValidLookup(m2) && x2 && (e5 = true, m2 = C2), this.isValidLookup(m2) || (n3 = true, m2 = s2);
|
|
1228
|
+
let a3 = (i2.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && n3 ? void 0 : m2, c3 = x2 && C2 !== m2 && this.options.updateMissing;
|
|
1229
1229
|
if (n3 || e5 || c3) {
|
|
1230
|
-
if (this.logger.log(c3 ? `updateKey` : `missingKey`, d2, l2, s2, c3 ?
|
|
1230
|
+
if (this.logger.log(c3 ? `updateKey` : `missingKey`, d2, l2, s2, c3 ? C2 : m2), o2) {
|
|
1231
1231
|
let e7 = this.resolve(s2, { ...i2, keySeparator: false });
|
|
1232
1232
|
e7 && e7.res && this.logger.warn(`Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.`);
|
|
1233
1233
|
}
|
|
@@ -1240,10 +1240,10 @@ var In = class e3 extends U {
|
|
|
1240
1240
|
};
|
|
1241
1241
|
this.options.saveMissing && (this.options.saveMissingPlurals && b2 ? e6.forEach((e7) => {
|
|
1242
1242
|
let t4 = this.pluralResolver.getSuffixes(e7, i2);
|
|
1243
|
-
|
|
1244
|
-
n4([e7], s2 + t5, i2[`defaultValue${t5}`] ||
|
|
1243
|
+
S2 && i2[`defaultValue${this.options.pluralSeparator}zero`] && t4.indexOf(`${this.options.pluralSeparator}zero`) < 0 && t4.push(`${this.options.pluralSeparator}zero`), t4.forEach((t5) => {
|
|
1244
|
+
n4([e7], s2 + t5, i2[`defaultValue${t5}`] || C2);
|
|
1245
1245
|
});
|
|
1246
|
-
}) : n4(e6, s2,
|
|
1246
|
+
}) : n4(e6, s2, C2));
|
|
1247
1247
|
}
|
|
1248
1248
|
m2 = this.extendTranslation(m2, t2, i2, p2, r2), n3 && m2 === s2 && this.options.appendNamespaceToMissingKey && (m2 = `${l2}${u2}${s2}`), (n3 || e5) && this.options.parseMissingKeyHandler && (m2 = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${l2}${u2}${s2}` : s2, e5 ? m2 : void 0, i2));
|
|
1249
1249
|
}
|
|
@@ -1253,32 +1253,32 @@ var In = class e3 extends U {
|
|
|
1253
1253
|
if (this.i18nFormat?.parse) e5 = this.i18nFormat.parse(e5, { ...this.options.interpolation.defaultVariables, ...n2 }, n2.lng || this.language || r2.usedLng, r2.usedNS, r2.usedKey, { resolved: r2 });
|
|
1254
1254
|
else if (!n2.skipInterpolation) {
|
|
1255
1255
|
n2.interpolation && this.interpolator.init({ ...n2, interpolation: { ...this.options.interpolation, ...n2.interpolation } });
|
|
1256
|
-
let a3 =
|
|
1256
|
+
let a3 = P(e5) && (n2?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : n2.interpolation.skipOnVariables), o3;
|
|
1257
1257
|
if (a3) {
|
|
1258
1258
|
let t3 = e5.match(this.interpolator.nestingRegexp);
|
|
1259
1259
|
o3 = t3 && t3.length;
|
|
1260
1260
|
}
|
|
1261
|
-
let s2 = n2.replace && !
|
|
1261
|
+
let s2 = n2.replace && !P(n2.replace) ? n2.replace : n2;
|
|
1262
1262
|
if (this.options.interpolation.defaultVariables && (s2 = { ...this.options.interpolation.defaultVariables, ...s2 }), e5 = this.interpolator.interpolate(e5, s2, n2.lng || this.language || r2.usedLng, n2), a3) {
|
|
1263
1263
|
let t3 = e5.match(this.interpolator.nestingRegexp), r3 = t3 && t3.length;
|
|
1264
1264
|
o3 < r3 && (n2.nest = false);
|
|
1265
1265
|
}
|
|
1266
1266
|
!n2.lng && r2 && r2.res && (n2.lng = this.language || r2.usedLng), n2.nest !== false && (e5 = this.interpolator.nest(e5, (...e6) => i2?.[0] === e6[0] && !n2.context ? (this.logger.warn(`It seems you are nesting recursively key: ${e6[0]} in key: ${t2[0]}`), null) : this.translate(...e6, t2), n2)), n2.interpolation && this.interpolator.reset();
|
|
1267
1267
|
}
|
|
1268
|
-
let a2 = n2.postProcess || this.options.postProcess, o2 =
|
|
1269
|
-
return e5 != null && o2?.length && n2.applyPostProcessor !== false && (e5 =
|
|
1268
|
+
let a2 = n2.postProcess || this.options.postProcess, o2 = P(a2) ? [a2] : a2;
|
|
1269
|
+
return e5 != null && o2?.length && n2.applyPostProcessor !== false && (e5 = Mn.handle(o2, e5, t2, this.options && this.options.postProcessPassResolved ? { i18nResolved: { ...r2, usedParams: this.getUsedParamsDetails(n2) }, ...n2 } : n2, this)), e5;
|
|
1270
1270
|
}
|
|
1271
1271
|
resolve(e5, t2 = {}) {
|
|
1272
1272
|
let n2, r2, i2, a2, o2;
|
|
1273
|
-
return
|
|
1273
|
+
return P(e5) && (e5 = [e5]), Array.isArray(e5) && (e5 = e5.map((e6) => typeof e6 == `function` ? U(e6, { ...this.options, ...t2 }) : e6)), e5.forEach((e6) => {
|
|
1274
1274
|
if (this.isValidLookup(n2)) return;
|
|
1275
1275
|
let s2 = this.extractFromKey(e6, t2), c2 = s2.key;
|
|
1276
1276
|
r2 = c2;
|
|
1277
1277
|
let l2 = s2.namespaces;
|
|
1278
1278
|
this.options.fallbackNS && (l2 = l2.concat(this.options.fallbackNS));
|
|
1279
|
-
let u2 = t2.count !== void 0 && !
|
|
1279
|
+
let u2 = t2.count !== void 0 && !P(t2.count), d2 = u2 && !t2.ordinal && t2.count === 0, f2 = t2.context !== void 0 && (P(t2.context) || typeof t2.context == `number`) && t2.context !== ``, p2 = t2.lngs ? t2.lngs : this.languageUtils.toResolveHierarchy(t2.lng || this.language, t2.fallbackLng);
|
|
1280
1280
|
l2.forEach((e7) => {
|
|
1281
|
-
this.isValidLookup(n2) || (o2 = e7, !
|
|
1281
|
+
this.isValidLookup(n2) || (o2 = e7, !Fn[`${p2[0]}-${e7}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(o2) && (Fn[`${p2[0]}-${e7}`] = true, this.logger.warn(`key "${r2}" for languages "${p2.join(`, `)}" won't get resolved as namespace "${o2}" was not yet loaded`, `This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)), p2.forEach((r3) => {
|
|
1282
1282
|
if (this.isValidLookup(n2)) return;
|
|
1283
1283
|
a2 = r3;
|
|
1284
1284
|
let o3 = [c2];
|
|
@@ -1305,7 +1305,7 @@ var In = class e3 extends U {
|
|
|
1305
1305
|
return this.i18nFormat?.getResource ? this.i18nFormat.getResource(e5, t2, n2, r2) : this.resourceStore.getResource(e5, t2, n2, r2);
|
|
1306
1306
|
}
|
|
1307
1307
|
getUsedParamsDetails(e5 = {}) {
|
|
1308
|
-
let t2 = [`defaultValue`, `ordinal`, `context`, `replace`, `lng`, `lngs`, `fallbackLng`, `ns`, `keySeparator`, `nsSeparator`, `returnObjects`, `returnDetails`, `joinArrays`, `postProcess`, `interpolation`], n2 = e5.replace && !
|
|
1308
|
+
let t2 = [`defaultValue`, `ordinal`, `context`, `replace`, `lng`, `lngs`, `fallbackLng`, `ns`, `keySeparator`, `nsSeparator`, `returnObjects`, `returnDetails`, `joinArrays`, `postProcess`, `interpolation`], n2 = e5.replace && !P(e5.replace), r2 = n2 ? e5.replace : e5;
|
|
1309
1309
|
if (n2 && e5.count !== void 0 && (r2.count = e5.count), this.options.interpolation.defaultVariables && (r2 = { ...this.options.interpolation.defaultVariables, ...r2 }), !n2) {
|
|
1310
1310
|
r2 = { ...r2 };
|
|
1311
1311
|
for (let e6 of t2) delete r2[e6];
|
|
@@ -1319,20 +1319,20 @@ var In = class e3 extends U {
|
|
|
1319
1319
|
};
|
|
1320
1320
|
var Ln = class {
|
|
1321
1321
|
constructor(e5) {
|
|
1322
|
-
this.options = e5, this.supportedLngs = this.options.supportedLngs || false, this.logger =
|
|
1322
|
+
this.options = e5, this.supportedLngs = this.options.supportedLngs || false, this.logger = V.create(`languageUtils`);
|
|
1323
1323
|
}
|
|
1324
1324
|
getScriptPartFromCode(e5) {
|
|
1325
|
-
if (e5 =
|
|
1325
|
+
if (e5 = B(e5), !e5 || e5.indexOf(`-`) < 0) return null;
|
|
1326
1326
|
let t2 = e5.split(`-`);
|
|
1327
1327
|
return t2.length === 2 || (t2.pop(), t2[t2.length - 1].toLowerCase() === `x`) ? null : this.formatLanguageCode(t2.join(`-`));
|
|
1328
1328
|
}
|
|
1329
1329
|
getLanguagePartFromCode(e5) {
|
|
1330
|
-
if (e5 =
|
|
1330
|
+
if (e5 = B(e5), !e5 || e5.indexOf(`-`) < 0) return e5;
|
|
1331
1331
|
let t2 = e5.split(`-`);
|
|
1332
1332
|
return this.formatLanguageCode(t2[0]);
|
|
1333
1333
|
}
|
|
1334
1334
|
formatLanguageCode(e5) {
|
|
1335
|
-
if (
|
|
1335
|
+
if (P(e5) && e5.indexOf(`-`) > -1) {
|
|
1336
1336
|
let t2;
|
|
1337
1337
|
try {
|
|
1338
1338
|
t2 = Intl.getCanonicalLocales(e5)[0];
|
|
@@ -1365,7 +1365,7 @@ var Ln = class {
|
|
|
1365
1365
|
}
|
|
1366
1366
|
getFallbackCodes(e5, t2) {
|
|
1367
1367
|
if (!e5) return [];
|
|
1368
|
-
if (typeof e5 == `function` && (e5 = e5(t2)),
|
|
1368
|
+
if (typeof e5 == `function` && (e5 = e5(t2)), P(e5) && (e5 = [e5]), Array.isArray(e5)) return e5;
|
|
1369
1369
|
if (!t2) return e5.default || [];
|
|
1370
1370
|
let n2 = e5[t2];
|
|
1371
1371
|
return n2 ||= e5[this.getScriptPartFromCode(t2)], n2 ||= e5[this.formatLanguageCode(t2)], n2 ||= e5[this.getLanguagePartFromCode(t2)], n2 ||= e5.default, n2 || [];
|
|
@@ -1374,7 +1374,7 @@ var Ln = class {
|
|
|
1374
1374
|
let n2 = this.getFallbackCodes((t2 === false ? [] : t2) || this.options.fallbackLng || [], e5), r2 = [], i2 = (e6) => {
|
|
1375
1375
|
e6 && (this.isSupportedCode(e6) ? r2.push(e6) : this.logger.warn(`rejecting language code not found in supportedLngs: ${e6}`));
|
|
1376
1376
|
};
|
|
1377
|
-
return
|
|
1377
|
+
return P(e5) && (e5.indexOf(`-`) > -1 || e5.indexOf(`_`) > -1) ? (this.options.load !== `languageOnly` && i2(this.formatLanguageCode(e5)), this.options.load !== `languageOnly` && this.options.load !== `currentOnly` && i2(this.getScriptPartFromCode(e5)), this.options.load !== `currentOnly` && i2(this.getLanguagePartFromCode(e5))) : P(e5) && i2(this.formatLanguageCode(e5)), n2.forEach((e6) => {
|
|
1378
1378
|
r2.indexOf(e6) < 0 && i2(this.formatLanguageCode(e6));
|
|
1379
1379
|
}), r2;
|
|
1380
1380
|
}
|
|
@@ -1383,13 +1383,13 @@ var Rn = { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 };
|
|
|
1383
1383
|
var zn = { select: (e5) => e5 === 1 ? `one` : `other`, resolvedOptions: () => ({ pluralCategories: [`one`, `other`] }) };
|
|
1384
1384
|
var Bn = class {
|
|
1385
1385
|
constructor(e5, t2 = {}) {
|
|
1386
|
-
this.languageUtils = e5, this.options = t2, this.logger =
|
|
1386
|
+
this.languageUtils = e5, this.options = t2, this.logger = V.create(`pluralResolver`), this.pluralRulesCache = {};
|
|
1387
1387
|
}
|
|
1388
1388
|
clearCache() {
|
|
1389
1389
|
this.pluralRulesCache = {};
|
|
1390
1390
|
}
|
|
1391
1391
|
getRule(e5, t2 = {}) {
|
|
1392
|
-
let n2 =
|
|
1392
|
+
let n2 = B(e5 === `dev` ? `en` : e5), r2 = t2.ordinal ? `ordinal` : `cardinal`, i2 = JSON.stringify({ cleanedCode: n2, type: r2 });
|
|
1393
1393
|
if (i2 in this.pluralRulesCache) return this.pluralRulesCache[i2];
|
|
1394
1394
|
let a2;
|
|
1395
1395
|
try {
|
|
@@ -1419,18 +1419,18 @@ var Bn = class {
|
|
|
1419
1419
|
}
|
|
1420
1420
|
};
|
|
1421
1421
|
var Vn = (e5, t2, n2, r2 = `.`, i2 = true) => {
|
|
1422
|
-
let a2 =
|
|
1423
|
-
return !a2 && i2 &&
|
|
1422
|
+
let a2 = Sn(e5, t2, n2);
|
|
1423
|
+
return !a2 && i2 && P(n2) && (a2 = z(e5, n2, r2), a2 === void 0 && (a2 = z(t2, n2, r2))), a2;
|
|
1424
1424
|
};
|
|
1425
1425
|
var G = (e5) => e5.replace(/\$/g, `$$$$`);
|
|
1426
1426
|
var Hn = class {
|
|
1427
1427
|
constructor(e5 = {}) {
|
|
1428
|
-
this.logger =
|
|
1428
|
+
this.logger = V.create(`interpolator`), this.options = e5, this.format = e5?.interpolation?.format || ((e6) => e6), this.init(e5);
|
|
1429
1429
|
}
|
|
1430
1430
|
init(e5 = {}) {
|
|
1431
1431
|
e5.interpolation ||= { escapeValue: true };
|
|
1432
1432
|
let { escape: t2, escapeValue: n2, useRawValueToEscape: r2, prefix: i2, prefixEscaped: a2, suffix: o2, suffixEscaped: s2, formatSeparator: c2, unescapeSuffix: l2, unescapePrefix: u2, nestingPrefix: d2, nestingPrefixEscaped: f2, nestingSuffix: p2, nestingSuffixEscaped: m2, nestingOptionsSeparator: h2, maxReplaces: g2, alwaysFormat: _2 } = e5.interpolation;
|
|
1433
|
-
this.escape = t2 === void 0 ?
|
|
1433
|
+
this.escape = t2 === void 0 ? Tn : t2, this.escapeValue = n2 === void 0 || n2, this.useRawValueToEscape = r2 !== void 0 && r2, this.prefix = i2 ? R(i2) : a2 || `{{`, this.suffix = o2 ? R(o2) : s2 || `}}`, this.formatSeparator = c2 || `,`, this.unescapePrefix = l2 ? `` : u2 || `-`, this.unescapeSuffix = this.unescapePrefix ? `` : l2 || ``, this.nestingPrefix = d2 ? R(d2) : f2 || R(`$t(`), this.nestingSuffix = p2 ? R(p2) : m2 || R(`)`), this.nestingOptionsSeparator = h2 || `,`, this.maxReplaces = g2 || 1e3, this.alwaysFormat = _2 !== void 0 && _2, this.resetRegExp();
|
|
1434
1434
|
}
|
|
1435
1435
|
reset() {
|
|
1436
1436
|
this.options && this.init(this.options);
|
|
@@ -1456,13 +1456,13 @@ var Hn = class {
|
|
|
1456
1456
|
if (a2 = c2(n3), a2 === void 0) {
|
|
1457
1457
|
if (typeof l2 == `function`) {
|
|
1458
1458
|
let t4 = l2(e5, i2, r2);
|
|
1459
|
-
a2 =
|
|
1459
|
+
a2 = P(t4) ? t4 : ``;
|
|
1460
1460
|
} else if (r2 && Object.prototype.hasOwnProperty.call(r2, n3)) a2 = ``;
|
|
1461
1461
|
else if (u2) {
|
|
1462
1462
|
a2 = i2[0];
|
|
1463
1463
|
continue;
|
|
1464
1464
|
} else this.logger.warn(`missed to pass in variable ${n3} for interpolating ${e5}`), a2 = ``;
|
|
1465
|
-
} else !
|
|
1465
|
+
} else !P(a2) && !this.useRawValueToEscape && (a2 = hn(a2));
|
|
1466
1466
|
let s3 = t3.safeValue(a2);
|
|
1467
1467
|
if (e5 = e5.replace(i2[0], s3), u2 ? (t3.regex.lastIndex += a2.length, t3.regex.lastIndex -= i2[0].length) : t3.regex.lastIndex = 0, o2++, o2 >= this.maxReplaces) break;
|
|
1468
1468
|
}
|
|
@@ -1472,7 +1472,7 @@ var Hn = class {
|
|
|
1472
1472
|
let r2, i2, a2, o2 = (e6, t3) => {
|
|
1473
1473
|
let n3 = this.nestingOptionsSeparator;
|
|
1474
1474
|
if (e6.indexOf(n3) < 0) return e6;
|
|
1475
|
-
let r3 = e6.split(RegExp(`${
|
|
1475
|
+
let r3 = e6.split(RegExp(`${R(n3)}[ ]*{`)), i3 = `{${r3[1]}`;
|
|
1476
1476
|
e6 = r3[0], i3 = this.interpolate(i3, a2);
|
|
1477
1477
|
let o3 = i3.match(/'/g), s2 = i3.match(/"/g);
|
|
1478
1478
|
((o3?.length ?? 0) % 2 == 0 && !s2 || (s2?.length ?? 0) % 2 != 0) && (i3 = i3.replace(/'/g, `"`));
|
|
@@ -1485,10 +1485,10 @@ var Hn = class {
|
|
|
1485
1485
|
};
|
|
1486
1486
|
for (; r2 = this.nestingRegexp.exec(e5); ) {
|
|
1487
1487
|
let s2 = [];
|
|
1488
|
-
a2 = { ...n2 }, a2 = a2.replace && !
|
|
1488
|
+
a2 = { ...n2 }, a2 = a2.replace && !P(a2.replace) ? a2.replace : a2, a2.applyPostProcessor = false, delete a2.defaultValue;
|
|
1489
1489
|
let c2 = /{.*}/.test(r2[1]) ? r2[1].lastIndexOf(`}`) + 1 : r2[1].indexOf(this.formatSeparator);
|
|
1490
|
-
if (c2 !== -1 && (s2 = r2[1].slice(c2).split(this.formatSeparator).map((e6) => e6.trim()).filter(Boolean), r2[1] = r2[1].slice(0, c2)), i2 = t2(o2.call(this, r2[1].trim(), a2), a2), i2 && r2[0] === e5 && !
|
|
1491
|
-
|
|
1490
|
+
if (c2 !== -1 && (s2 = r2[1].slice(c2).split(this.formatSeparator).map((e6) => e6.trim()).filter(Boolean), r2[1] = r2[1].slice(0, c2)), i2 = t2(o2.call(this, r2[1].trim(), a2), a2), i2 && r2[0] === e5 && !P(i2)) return i2;
|
|
1491
|
+
P(i2) || (i2 = hn(i2)), i2 ||= (this.logger.warn(`missed to resolve ${r2[1]} for nesting ${e5}`), ``), s2.length && (i2 = s2.reduce((e6, t3) => this.format(e6, t3, n2.lng, { ...n2, interpolationkey: r2[1].trim() }), i2.trim())), e5 = e5.replace(r2[0], i2), this.regexp.lastIndex = 0;
|
|
1492
1492
|
}
|
|
1493
1493
|
return e5;
|
|
1494
1494
|
}
|
|
@@ -1514,13 +1514,13 @@ var Wn = (e5) => {
|
|
|
1514
1514
|
let a2 = i2;
|
|
1515
1515
|
i2 && i2.interpolationkey && i2.formatParams && i2.formatParams[i2.interpolationkey] && i2[i2.interpolationkey] && (a2 = { ...a2, [i2.interpolationkey]: void 0 });
|
|
1516
1516
|
let o2 = r2 + JSON.stringify(a2), s2 = t2[o2];
|
|
1517
|
-
return s2 || (s2 = e5(
|
|
1517
|
+
return s2 || (s2 = e5(B(r2), i2), t2[o2] = s2), s2(n2);
|
|
1518
1518
|
};
|
|
1519
1519
|
};
|
|
1520
|
-
var Gn = (e5) => (t2, n2, r2) => e5(
|
|
1520
|
+
var Gn = (e5) => (t2, n2, r2) => e5(B(n2), r2)(t2);
|
|
1521
1521
|
var Kn = class {
|
|
1522
1522
|
constructor(e5 = {}) {
|
|
1523
|
-
this.logger =
|
|
1523
|
+
this.logger = V.create(`formatter`), this.options = e5, this.init(e5);
|
|
1524
1524
|
}
|
|
1525
1525
|
init(e5, t2 = { interpolation: {} }) {
|
|
1526
1526
|
this.formatSeparator = t2.interpolation.formatSeparator || `,`;
|
|
@@ -1573,9 +1573,9 @@ var Kn = class {
|
|
|
1573
1573
|
var qn = (e5, t2) => {
|
|
1574
1574
|
e5.pending[t2] !== void 0 && (delete e5.pending[t2], e5.pendingCount--);
|
|
1575
1575
|
};
|
|
1576
|
-
var Jn = class extends
|
|
1576
|
+
var Jn = class extends H {
|
|
1577
1577
|
constructor(e5, t2, n2, r2 = {}) {
|
|
1578
|
-
super(), this.backend = e5, this.store = t2, this.services = n2, this.languageUtils = n2.languageUtils, this.options = r2, this.logger =
|
|
1578
|
+
super(), this.backend = e5, this.store = t2, this.services = n2, this.languageUtils = n2.languageUtils, this.options = r2, this.logger = V.create(`backendConnector`), this.waitingReads = [], this.maxParallelReads = r2.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = r2.maxRetries >= 0 ? r2.maxRetries : 5, this.retryTimeout = r2.retryTimeout >= 1 ? r2.retryTimeout : 350, this.state = {}, this.queue = [], this.backend?.init?.(n2, r2.backend, r2);
|
|
1579
1579
|
}
|
|
1580
1580
|
queueLoad(e5, t2, n2, r2) {
|
|
1581
1581
|
let i2 = {}, a2 = {}, o2 = {}, s2 = {};
|
|
@@ -1592,7 +1592,7 @@ var Jn = class extends U {
|
|
|
1592
1592
|
t2 && this.emit(`failedLoading`, i2, a2, t2), !t2 && n2 && this.store.addResourceBundle(i2, a2, n2, void 0, void 0, { skipCopy: true }), this.state[e5] = t2 ? -1 : 2, t2 && n2 && (this.state[e5] = 0);
|
|
1593
1593
|
let o2 = {};
|
|
1594
1594
|
this.queue.forEach((n3) => {
|
|
1595
|
-
|
|
1595
|
+
xn(n3.loaded, [i2], a2), qn(n3, e5), t2 && n3.errors.push(t2), n3.pendingCount === 0 && !n3.done && (Object.keys(n3.loaded).forEach((e6) => {
|
|
1596
1596
|
o2[e6] || (o2[e6] = {});
|
|
1597
1597
|
let t3 = n3.loaded[e6];
|
|
1598
1598
|
t3.length && t3.forEach((t4) => {
|
|
@@ -1634,7 +1634,7 @@ var Jn = class extends U {
|
|
|
1634
1634
|
}
|
|
1635
1635
|
prepareLoading(e5, t2, n2 = {}, r2) {
|
|
1636
1636
|
if (!this.backend) return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`), r2 && r2();
|
|
1637
|
-
|
|
1637
|
+
P(e5) && (e5 = this.languageUtils.toResolveHierarchy(e5)), P(t2) && (t2 = [t2]);
|
|
1638
1638
|
let i2 = this.queueLoad(e5, t2, n2, r2);
|
|
1639
1639
|
if (!i2.toLoad.length) return i2.pending.length || r2(), null;
|
|
1640
1640
|
i2.toLoad.forEach((e6) => {
|
|
@@ -1676,7 +1676,7 @@ var Jn = class extends U {
|
|
|
1676
1676
|
};
|
|
1677
1677
|
var K = () => ({ debug: false, initAsync: true, ns: [`translation`], defaultNS: [`translation`], fallbackLng: [`dev`], fallbackNS: false, supportedLngs: false, nonExplicitSupportedLngs: false, load: `all`, preload: false, simplifyPluralSuffix: true, keySeparator: `.`, nsSeparator: `:`, pluralSeparator: `_`, contextSeparator: `_`, partialBundledLanguages: false, saveMissing: false, updateMissing: false, saveMissingTo: `fallback`, saveMissingPlurals: true, missingKeyHandler: false, missingInterpolationHandler: false, postProcess: false, postProcessPassResolved: false, returnNull: false, returnEmptyString: true, returnObjects: false, joinArrays: false, returnedObjectHandler: false, parseMissingKeyHandler: false, appendNamespaceToMissingKey: false, appendNamespaceToCIMode: false, overloadTranslationOptionHandler: (e5) => {
|
|
1678
1678
|
let t2 = {};
|
|
1679
|
-
if (typeof e5[1] == `object` && (t2 = e5[1]),
|
|
1679
|
+
if (typeof e5[1] == `object` && (t2 = e5[1]), P(e5[1]) && (t2.defaultValue = e5[1]), P(e5[2]) && (t2.tDescription = e5[2]), typeof e5[2] == `object` || typeof e5[3] == `object`) {
|
|
1680
1680
|
let n2 = e5[3] || e5[2];
|
|
1681
1681
|
Object.keys(n2).forEach((e6) => {
|
|
1682
1682
|
t2[e6] = n2[e6];
|
|
@@ -1684,7 +1684,7 @@ var K = () => ({ debug: false, initAsync: true, ns: [`translation`], defaultNS:
|
|
|
1684
1684
|
}
|
|
1685
1685
|
return t2;
|
|
1686
1686
|
}, interpolation: { escapeValue: true, format: (e5) => e5, prefix: `{{`, suffix: `}}`, formatSeparator: `,`, unescapePrefix: `-`, nestingPrefix: `$t(`, nestingSuffix: `)`, nestingOptionsSeparator: `,`, maxReplaces: 1e3, skipOnVariables: true }, cacheInBuiltFormats: true });
|
|
1687
|
-
var Yn = (e5) => (
|
|
1687
|
+
var Yn = (e5) => (P(e5.ns) && (e5.ns = [e5.ns]), P(e5.fallbackLng) && (e5.fallbackLng = [e5.fallbackLng]), P(e5.fallbackNS) && (e5.fallbackNS = [e5.fallbackNS]), e5.supportedLngs?.indexOf?.(`cimode`) < 0 && (e5.supportedLngs = e5.supportedLngs.concat([`cimode`])), typeof e5.initImmediate == `boolean` && (e5.initAsync = e5.initImmediate), e5);
|
|
1688
1688
|
var q = () => {
|
|
1689
1689
|
};
|
|
1690
1690
|
var Xn = (e5) => {
|
|
@@ -1698,9 +1698,9 @@ var $n = () => {
|
|
|
1698
1698
|
typeof globalThis < `u` && (globalThis[Zn] = true);
|
|
1699
1699
|
};
|
|
1700
1700
|
var er = (e5) => !!(e5?.modules?.backend?.name?.indexOf(`Locize`) > 0 || e5?.modules?.backend?.constructor?.name?.indexOf(`Locize`) > 0 || e5?.options?.backend?.backends && e5.options.backend.backends.some((e6) => e6?.name?.indexOf(`Locize`) > 0 || e6?.constructor?.name?.indexOf(`Locize`) > 0) || e5?.options?.backend?.projectId || e5?.options?.backend?.backendOptions && e5.options.backend.backendOptions.some((e6) => e6?.projectId));
|
|
1701
|
-
var J = class e4 extends
|
|
1701
|
+
var J = class e4 extends H {
|
|
1702
1702
|
constructor(e5 = {}, t2) {
|
|
1703
|
-
if (super(), this.options = Yn(e5), this.services = {}, this.logger =
|
|
1703
|
+
if (super(), this.options = Yn(e5), this.services = {}, this.logger = V, this.modules = { external: [] }, Xn(this), t2 && !this.isInitialized && !e5.isClone) {
|
|
1704
1704
|
if (!this.options.initAsync) return this.init(e5, t2), this;
|
|
1705
1705
|
setTimeout(() => {
|
|
1706
1706
|
this.init(e5, t2);
|
|
@@ -1708,18 +1708,18 @@ var J = class e4 extends U {
|
|
|
1708
1708
|
}
|
|
1709
1709
|
}
|
|
1710
1710
|
init(e5 = {}, t2) {
|
|
1711
|
-
this.isInitializing = true, typeof e5 == `function` && (t2 = e5, e5 = {}), e5.defaultNS == null && e5.ns && (
|
|
1711
|
+
this.isInitializing = true, typeof e5 == `function` && (t2 = e5, e5 = {}), e5.defaultNS == null && e5.ns && (P(e5.ns) ? e5.defaultNS = e5.ns : e5.ns.indexOf(`translation`) < 0 && (e5.defaultNS = e5.ns[0]));
|
|
1712
1712
|
let n2 = K();
|
|
1713
1713
|
this.options = { ...n2, ...this.options, ...Yn(e5) }, this.options.interpolation = { ...n2.interpolation, ...this.options.interpolation }, e5.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = e5.keySeparator), e5.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = e5.nsSeparator), typeof this.options.overloadTranslationOptionHandler != `function` && (this.options.overloadTranslationOptionHandler = n2.overloadTranslationOptionHandler), this.options.showSupportNotice !== false && !er(this) && !Qn() && (typeof console < `u` && console.info !== void 0 && console.info(`\u{1F310} i18next is made possible by our own product, Locize \u2014 consider powering your project with managed localization (AI, CDN, integrations): https://locize.com \u{1F499}`), $n());
|
|
1714
1714
|
let r2 = (e6) => e6 ? typeof e6 == `function` ? new e6() : e6 : null;
|
|
1715
1715
|
if (!this.options.isClone) {
|
|
1716
|
-
this.modules.logger ?
|
|
1716
|
+
this.modules.logger ? V.init(r2(this.modules.logger), this.options) : V.init(null, this.options);
|
|
1717
1717
|
let e6;
|
|
1718
1718
|
e6 = this.modules.formatter ? this.modules.formatter : Kn;
|
|
1719
1719
|
let t3 = new Ln(this.options);
|
|
1720
|
-
this.store = new
|
|
1720
|
+
this.store = new jn(this.options.resources, this.options);
|
|
1721
1721
|
let i3 = this.services;
|
|
1722
|
-
i3.logger =
|
|
1722
|
+
i3.logger = V, i3.resourceStore = this.store, i3.languageUtils = t3, i3.pluralResolver = new Bn(t3, { prepend: this.options.pluralSeparator, simplifyPluralSuffix: this.options.simplifyPluralSuffix }), this.options.interpolation.format && this.options.interpolation.format !== n2.interpolation.format && this.logger.deprecate(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`), e6 && (!this.options.interpolation.format || this.options.interpolation.format === n2.interpolation.format) && (i3.formatter = r2(e6), i3.formatter.init && i3.formatter.init(i3, this.options), this.options.interpolation.format = i3.formatter.format.bind(i3.formatter)), i3.interpolator = new Hn(this.options), i3.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }, i3.backendConnector = new Jn(r2(this.modules.backend), i3.resourceStore, i3, this.options), i3.backendConnector.on(`*`, (e7, ...t4) => {
|
|
1723
1723
|
this.emit(e7, ...t4);
|
|
1724
1724
|
}), this.modules.languageDetector && (i3.languageDetector = r2(this.modules.languageDetector), i3.languageDetector.init && i3.languageDetector.init(i3, this.options.detection, this.options)), this.modules.i18nFormat && (i3.i18nFormat = r2(this.modules.i18nFormat), i3.i18nFormat.init && i3.i18nFormat.init(this)), this.translator = new In(this.services, this.options), this.translator.on(`*`, (e7, ...t4) => {
|
|
1725
1725
|
this.emit(e7, ...t4);
|
|
@@ -1736,7 +1736,7 @@ var J = class e4 extends U {
|
|
|
1736
1736
|
}), [`addResource`, `addResources`, `addResourceBundle`, `removeResourceBundle`].forEach((e6) => {
|
|
1737
1737
|
this[e6] = (...t3) => (this.store[e6](...t3), this);
|
|
1738
1738
|
});
|
|
1739
|
-
let i2 =
|
|
1739
|
+
let i2 = F(), a2 = () => {
|
|
1740
1740
|
let e6 = (e7, n3) => {
|
|
1741
1741
|
this.isInitializing = false, this.isInitialized && !this.initializedStoreOnce && this.logger.warn(`init: i18next is already initialized. You should call init just once!`), this.isInitialized = true, this.options.isClone || this.logger.log(`initialized`, this.options), this.emit(`initialized`, this.options), i2.resolve(n3), t2(e7, n3);
|
|
1742
1742
|
};
|
|
@@ -1746,7 +1746,7 @@ var J = class e4 extends U {
|
|
|
1746
1746
|
return this.options.resources || !this.options.initAsync ? a2() : setTimeout(a2, 0), i2;
|
|
1747
1747
|
}
|
|
1748
1748
|
loadResources(e5, t2 = q) {
|
|
1749
|
-
let n2 = t2, r2 =
|
|
1749
|
+
let n2 = t2, r2 = P(e5) ? e5 : this.language;
|
|
1750
1750
|
if (typeof e5 == `function` && (n2 = e5), !this.options.resources || this.options.partialBundledLanguages) {
|
|
1751
1751
|
if (r2?.toLowerCase() === `cimode` && (!this.options.preload || this.options.preload.length === 0)) return n2();
|
|
1752
1752
|
let e6 = [], t3 = (t4) => {
|
|
@@ -1760,7 +1760,7 @@ var J = class e4 extends U {
|
|
|
1760
1760
|
} else n2(null);
|
|
1761
1761
|
}
|
|
1762
1762
|
reloadResources(e5, t2, n2) {
|
|
1763
|
-
let r2 =
|
|
1763
|
+
let r2 = F();
|
|
1764
1764
|
return typeof e5 == `function` && (n2 = e5, e5 = void 0), typeof t2 == `function` && (n2 = t2, t2 = void 0), e5 ||= this.languages, t2 ||= this.options.ns, n2 ||= q, this.services.backendConnector.reload(e5, t2, (e6) => {
|
|
1765
1765
|
r2.resolve(), n2(e6);
|
|
1766
1766
|
}), r2;
|
|
@@ -1768,7 +1768,7 @@ var J = class e4 extends U {
|
|
|
1768
1768
|
use(e5) {
|
|
1769
1769
|
if (!e5) throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);
|
|
1770
1770
|
if (!e5.type) throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);
|
|
1771
|
-
return e5.type === `backend` && (this.modules.backend = e5), (e5.type === `logger` || e5.log && e5.warn && e5.error) && (this.modules.logger = e5), e5.type === `languageDetector` && (this.modules.languageDetector = e5), e5.type === `i18nFormat` && (this.modules.i18nFormat = e5), e5.type === `postProcessor` &&
|
|
1771
|
+
return e5.type === `backend` && (this.modules.backend = e5), (e5.type === `logger` || e5.log && e5.warn && e5.error) && (this.modules.logger = e5), e5.type === `languageDetector` && (this.modules.languageDetector = e5), e5.type === `i18nFormat` && (this.modules.i18nFormat = e5), e5.type === `postProcessor` && Mn.addPostProcessor(e5), e5.type === `formatter` && (this.modules.formatter = e5), e5.type === `3rdParty` && this.modules.external.push(e5), this;
|
|
1772
1772
|
}
|
|
1773
1773
|
setResolvedLanguage(e5) {
|
|
1774
1774
|
if (e5 && this.languages && !([`cimode`, `dev`].indexOf(e5) > -1)) {
|
|
@@ -1784,7 +1784,7 @@ var J = class e4 extends U {
|
|
|
1784
1784
|
}
|
|
1785
1785
|
changeLanguage(e5, t2) {
|
|
1786
1786
|
this.isLanguageChangingTo = e5;
|
|
1787
|
-
let n2 =
|
|
1787
|
+
let n2 = F();
|
|
1788
1788
|
this.emit(`languageChanging`, e5);
|
|
1789
1789
|
let r2 = (e6) => {
|
|
1790
1790
|
this.language = e6, this.languages = this.services.languageUtils.toResolveHierarchy(e6), this.resolvedLanguage = void 0, this.setResolvedLanguage(e6);
|
|
@@ -1792,7 +1792,7 @@ var J = class e4 extends U {
|
|
|
1792
1792
|
a3 ? this.isLanguageChangingTo === e5 && (r2(a3), this.translator.changeLanguage(a3), this.isLanguageChangingTo = void 0, this.emit(`languageChanged`, a3), this.logger.log(`languageChanged`, a3)) : this.isLanguageChangingTo = void 0, n2.resolve((...e6) => this.t(...e6)), t2 && t2(i3, (...e6) => this.t(...e6));
|
|
1793
1793
|
}, a2 = (t3) => {
|
|
1794
1794
|
!e5 && !t3 && this.services.languageDetector && (t3 = []);
|
|
1795
|
-
let n3 =
|
|
1795
|
+
let n3 = P(t3) ? t3 : t3 && t3[0], a3 = this.store.hasLanguageSomeTranslations(n3) ? n3 : this.services.languageUtils.getBestMatchFromCodes(P(t3) ? [t3] : t3);
|
|
1796
1796
|
a3 && (this.language || r2(a3), this.translator.language || this.translator.changeLanguage(a3), this.services.languageDetector?.cacheUserLanguage?.(a3)), this.loadResources(a3, (e6) => {
|
|
1797
1797
|
i2(e6, a3);
|
|
1798
1798
|
});
|
|
@@ -1804,11 +1804,11 @@ var J = class e4 extends U {
|
|
|
1804
1804
|
let a2;
|
|
1805
1805
|
a2 = typeof t3 == `object` ? { ...t3 } : this.options.overloadTranslationOptionHandler([e6, t3].concat(i2)), a2.lng = a2.lng || r2.lng, a2.lngs = a2.lngs || r2.lngs, a2.ns = a2.ns || r2.ns, a2.keyPrefix !== `` && (a2.keyPrefix = a2.keyPrefix || n2 || r2.keyPrefix);
|
|
1806
1806
|
let o2 = { ...this.options, ...a2 };
|
|
1807
|
-
typeof a2.keyPrefix == `function` && (a2.keyPrefix =
|
|
1807
|
+
typeof a2.keyPrefix == `function` && (a2.keyPrefix = U(a2.keyPrefix, o2));
|
|
1808
1808
|
let s2 = this.options.keySeparator || `.`, c2;
|
|
1809
|
-
return a2.keyPrefix && Array.isArray(e6) ? c2 = e6.map((e7) => (typeof e7 == `function` && (e7 =
|
|
1809
|
+
return a2.keyPrefix && Array.isArray(e6) ? c2 = e6.map((e7) => (typeof e7 == `function` && (e7 = U(e7, o2)), `${a2.keyPrefix}${s2}${e7}`)) : (typeof e6 == `function` && (e6 = U(e6, o2)), c2 = a2.keyPrefix ? `${a2.keyPrefix}${s2}${e6}` : e6), this.t(c2, a2);
|
|
1810
1810
|
};
|
|
1811
|
-
return
|
|
1811
|
+
return P(e5) ? r2.lng = e5 : r2.lngs = e5, r2.ns = t2, r2.keyPrefix = n2, r2;
|
|
1812
1812
|
}
|
|
1813
1813
|
t(...e5) {
|
|
1814
1814
|
return this.translator?.translate(...e5);
|
|
@@ -1835,16 +1835,16 @@ var J = class e4 extends U {
|
|
|
1835
1835
|
return !!(this.hasResourceBundle(n2, e5) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a2(n2, e5) && (!r2 || a2(i2, e5)));
|
|
1836
1836
|
}
|
|
1837
1837
|
loadNamespaces(e5, t2) {
|
|
1838
|
-
let n2 =
|
|
1839
|
-
return this.options.ns ? (
|
|
1838
|
+
let n2 = F();
|
|
1839
|
+
return this.options.ns ? (P(e5) && (e5 = [e5]), e5.forEach((e6) => {
|
|
1840
1840
|
this.options.ns.indexOf(e6) < 0 && this.options.ns.push(e6);
|
|
1841
1841
|
}), this.loadResources((e6) => {
|
|
1842
1842
|
n2.resolve(), t2 && t2(e6);
|
|
1843
1843
|
}), n2) : (t2 && t2(), Promise.resolve());
|
|
1844
1844
|
}
|
|
1845
1845
|
loadLanguages(e5, t2) {
|
|
1846
|
-
let n2 =
|
|
1847
|
-
|
|
1846
|
+
let n2 = F();
|
|
1847
|
+
P(e5) && (e5 = [e5]);
|
|
1848
1848
|
let r2 = this.options.preload || [], i2 = e5.filter((e6) => r2.indexOf(e6) < 0 && this.services.languageUtils.isSupportedCode(e6));
|
|
1849
1849
|
return i2.length ? (this.options.preload = r2.concat(i2), this.loadResources((e6) => {
|
|
1850
1850
|
n2.resolve(), t2 && t2(e6);
|
|
@@ -1873,7 +1873,7 @@ var J = class e4 extends U {
|
|
|
1873
1873
|
let i2 = { ...this.options, ...t2, isClone: true }, a2 = new e4(i2);
|
|
1874
1874
|
if ((t2.debug !== void 0 || t2.prefix !== void 0) && (a2.logger = a2.logger.clone(t2)), [`store`, `services`, `language`].forEach((e5) => {
|
|
1875
1875
|
a2[e5] = this[e5];
|
|
1876
|
-
}), a2.services = { ...this.services }, a2.services.utils = { hasLoadedNamespace: a2.hasLoadedNamespace.bind(a2) }, r2 && (a2.store = new
|
|
1876
|
+
}), a2.services = { ...this.services }, a2.services.utils = { hasLoadedNamespace: a2.hasLoadedNamespace.bind(a2) }, r2 && (a2.store = new jn(Object.keys(this.store.data).reduce((e5, t3) => (e5[t3] = { ...this.store.data[t3] }, e5[t3] = Object.keys(e5[t3]).reduce((n3, r3) => (n3[r3] = { ...e5[t3][r3] }, n3), e5[t3]), e5), {}), i2), a2.services.resourceStore = a2.store), t2.interpolation) {
|
|
1877
1877
|
let e5 = { ...K().interpolation, ...this.options.interpolation, ...t2.interpolation }, n3 = { ...i2, interpolation: e5 };
|
|
1878
1878
|
a2.services.interpolator = new Hn(n3);
|
|
1879
1879
|
}
|
|
@@ -1925,14 +1925,14 @@ function mr(e5, { value: t2, currency: n2 }, r2 = {}) {
|
|
|
1925
1925
|
return ur(t2), fr(e5, n2, r2).formatToParts(t2);
|
|
1926
1926
|
}
|
|
1927
1927
|
function hr(e5) {
|
|
1928
|
-
return
|
|
1928
|
+
return Gt().find((e6) => e6.primary)?.id ?? e5;
|
|
1929
1929
|
}
|
|
1930
1930
|
function gr(e5, t2) {
|
|
1931
1931
|
let { locale: n2, ...r2 } = t2 ?? {}, i2 = n2 ?? e5.essentials?.locale;
|
|
1932
1932
|
if (!i2) throw Error(`Host locale is not available on the current host. Make sure to use an updated version of the host initialization package.`);
|
|
1933
1933
|
return { locale: i2, formatOptions: r2 };
|
|
1934
1934
|
}
|
|
1935
|
-
var _r =
|
|
1935
|
+
var _r = mn({ getLanguage: (e5) => () => {
|
|
1936
1936
|
let t2 = e5.essentials?.language;
|
|
1937
1937
|
if (!t2) throw Error(`Host language is not available on the current host. Make sure to use an updated version of the host initialization package.`);
|
|
1938
1938
|
return t2;
|
|
@@ -1970,7 +1970,7 @@ var vr = class {
|
|
|
1970
1970
|
}
|
|
1971
1971
|
};
|
|
1972
1972
|
var yr = (e5) => new vr(e5);
|
|
1973
|
-
var br =
|
|
1973
|
+
var br = mn({ getMonitoringClient: (e5) => () => e5.getMonitoringClient ? e5.getMonitoringClient() : yr(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`) });
|
|
1974
1974
|
var xr = { 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` };
|
|
1975
1975
|
function Sr(e5) {
|
|
1976
1976
|
try {
|
|
@@ -2214,7 +2214,7 @@ function li({ key: e5, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
|
|
|
2214
2214
|
}), c2;
|
|
2215
2215
|
}
|
|
2216
2216
|
function ui(e5) {
|
|
2217
|
-
return
|
|
2217
|
+
return gt(Object.assign(e5, { 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: `` }] } }));
|
|
2218
2218
|
}
|
|
2219
2219
|
var di = `@wix/auto_sdk_bookings_services`;
|
|
2220
2220
|
function fi(e5) {
|
|
@@ -2224,27 +2224,27 @@ function fi(e5) {
|
|
|
2224
2224
|
return t2;
|
|
2225
2225
|
}
|
|
2226
2226
|
async function pi(e5) {
|
|
2227
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = fi(
|
|
2227
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = fi(Xe({ filter: e5?.filter }));
|
|
2228
2228
|
n2?.onSiteCall?.();
|
|
2229
2229
|
try {
|
|
2230
2230
|
let e6 = await t2.request(r2);
|
|
2231
|
-
return n2?.onSuccess?.(e6),
|
|
2231
|
+
return n2?.onSuccess?.(e6), Ze(e6.data);
|
|
2232
2232
|
} catch (e6) {
|
|
2233
|
-
let t3 =
|
|
2233
|
+
let t3 = ot(e6, { spreadPathsToArguments: {}, explicitPathsToArguments: { filter: `$[0].filter` }, singleArgumentUnchanged: false }, [`options`]);
|
|
2234
2234
|
throw n2?.onError?.(e6), t3;
|
|
2235
2235
|
}
|
|
2236
2236
|
}
|
|
2237
2237
|
function mi(e5) {
|
|
2238
2238
|
return (t2) => pi(t2, { httpClient: e5 });
|
|
2239
2239
|
}
|
|
2240
|
-
var hi =
|
|
2240
|
+
var hi = ht(mi);
|
|
2241
2241
|
async function gi() {
|
|
2242
2242
|
return [...(await hi({ filter: { services: {} } })).categories ?? []].sort((e5, t2) => (e5.sortOrder ?? 0) - (t2.sortOrder ?? 0));
|
|
2243
2243
|
}
|
|
2244
2244
|
function _i({ isLoading: e5, hasError: t2, refetch: n2, children: r2 }) {
|
|
2245
|
-
let
|
|
2245
|
+
let i2 = { categoryItems: [], hasMultipleCategories: false, isLoading: e5, hasError: t2, refetch: n2, selectCategory: () => {
|
|
2246
2246
|
} };
|
|
2247
|
-
return (0, import_jsx_runtime.jsx)($.Provider, { value:
|
|
2247
|
+
return (0, import_jsx_runtime.jsx)($.Provider, { value: i2, children: r2 });
|
|
2248
2248
|
}
|
|
2249
2249
|
function vi({ refetch: e5, children: t2 }) {
|
|
2250
2250
|
return (0, import_jsx_runtime.jsx)(_i, { isLoading: true, hasError: false, refetch: e5, children: t2 });
|
|
@@ -2293,28 +2293,28 @@ function ji(e5, t2) {
|
|
|
2293
2293
|
}
|
|
2294
2294
|
var Mi = (e5) => ({ categories: e5, hasError: false });
|
|
2295
2295
|
var Ni = () => ({ categories: [], hasError: true });
|
|
2296
|
-
function Pi({ categoriesPromise: e5,
|
|
2297
|
-
let { categories:
|
|
2298
|
-
let e6 = xi(
|
|
2299
|
-
return e6 ?
|
|
2300
|
-
}, [
|
|
2301
|
-
let
|
|
2302
|
-
e6 ?
|
|
2303
|
-
let
|
|
2304
|
-
|
|
2305
|
-
}, [
|
|
2296
|
+
function Pi({ categoriesPromise: e5, categoryIdsKey: t2, refetch: n2, children: i2 }) {
|
|
2297
|
+
let { categories: s2, hasError: c2 } = Er(e5), l2 = (0, import_react.useMemo)(() => {
|
|
2298
|
+
let e6 = xi(t2);
|
|
2299
|
+
return e6 ? s2.filter((t3) => t3._id && e6.includes(t3._id)) : s2;
|
|
2300
|
+
}, [s2, t2]), { pathname: u2, searchParams: d2, pushUrl: p2, getExternalBaseUrl: m2 } = Br(), h2 = d2.get(Q.category), g2 = (0, import_react.useCallback)((e6, t3) => {
|
|
2301
|
+
let n3 = new URLSearchParams(d2);
|
|
2302
|
+
e6 ? n3.set(Q.category, e6) : n3.delete(Q.category), n3.delete(Q.page);
|
|
2303
|
+
let r2 = n3.toString(), i3 = r2 ? `${u2}?${r2}` : u2;
|
|
2304
|
+
p2(new URL(i3, `${m2()}/`), { disableScrollToTop: true, skipHistory: t3 });
|
|
2305
|
+
}, [u2, d2, p2, m2]), _2 = (0, import_react.useCallback)((e6) => g2(e6, false), [g2]), v2 = h2 != null && !c2 && !s2.some((e6) => e6._id === h2);
|
|
2306
2306
|
(0, import_react.useEffect)(() => {
|
|
2307
|
-
|
|
2308
|
-
}, [
|
|
2309
|
-
let
|
|
2310
|
-
return (0, import_jsx_runtime.jsx)($.Provider, { value:
|
|
2307
|
+
v2 && g2(null, true);
|
|
2308
|
+
}, [v2, g2]);
|
|
2309
|
+
let y2 = l2.filter((e6) => e6._id).length > 1, b2 = (0, import_react.useMemo)(() => ({ categoryItems: l2.map((e6) => ji(e6, h2)), hasMultipleCategories: y2, isLoading: false, hasError: c2, refetch: n2, selectCategory: _2 }), [l2, h2, y2, c2, n2, _2]);
|
|
2310
|
+
return (0, import_jsx_runtime.jsx)($.Provider, { value: b2, children: i2 });
|
|
2311
2311
|
}
|
|
2312
|
-
function Fi({
|
|
2312
|
+
function Fi({ categoriesPicker: e5, refreshSignal: n2 = 0, children: i2 }) {
|
|
2313
2313
|
Oi(Ti.CATEGORIES);
|
|
2314
|
-
let
|
|
2315
|
-
return (0, import_jsx_runtime.jsx)(Tr, { fallback: (0, import_jsx_runtime.jsx)(yi, { refetch:
|
|
2314
|
+
let a2 = Wr(), s2 = Xr(), l2 = bi(e5?.categoryId), [u2, d2] = (0, import_react.useState)(0), p2 = (0, import_react.useMemo)(() => kr(li({ key: Qr(s2), refresh: u2 !== 0 || n2 !== 0, warmupData: a2, fetchData: () => wr(`categories-context-load`, { feature: xr.categories }, gi()) }), Mi, Ni), [u2, n2, s2]), m2 = (0, import_react.useCallback)(() => d2((e6) => e6 + 1), []);
|
|
2315
|
+
return (0, import_jsx_runtime.jsx)(Tr, { fallback: (0, import_jsx_runtime.jsx)(yi, { refetch: m2, children: i2 }), feature: xr.categories, children: (0, import_jsx_runtime.jsx)(import_react.Suspense, { fallback: (0, import_jsx_runtime.jsx)(vi, { refetch: m2, children: i2 }), children: (0, import_jsx_runtime.jsx)(Pi, { categoriesPromise: p2, categoryIdsKey: l2, refetch: m2, children: i2 }) }) });
|
|
2316
2316
|
}
|
|
2317
|
-
var Ii =
|
|
2317
|
+
var Ii = dn(`73a358c8-c2c8-4342-bf64-9079e92178fc`);
|
|
2318
2318
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2319
2319
|
0 && (module.exports = {
|
|
2320
2320
|
CATEGORIES_CONTEXT_MISSING_PROVIDER_ERROR,
|