@wix/blog 1.0.708 → 1.0.710
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_sdk-exports/context-blog-feed/runtime.js +4 -4
- package/_sdk-exports/context-post/runtime.d.ts +36 -1
- package/_sdk-exports/context-post-by-id/runtime.js +4 -4
- package/_sdk-exports/context-post-by-slug/runtime.js +4 -4
- package/_sdk-exports/context-post-list-item/runtime.js +4 -4
- package/_sdk-exports/context-related-posts/runtime.js +4 -4
- package/build/cjs/context-blog-feed.js +1422 -1366
- package/build/cjs/context-blog-feed.js.map +1 -1
- package/build/cjs/context-post-by-id.js +750 -694
- package/build/cjs/context-post-by-id.js.map +1 -1
- package/build/cjs/context-post-by-slug.js +1345 -1289
- package/build/cjs/context-post-by-slug.js.map +1 -1
- package/build/cjs/context-post-list-item.js +265 -237
- package/build/cjs/context-post-list-item.js.map +1 -1
- package/build/cjs/context-post.d.ts +36 -1
- package/build/cjs/context-related-posts.js +1075 -1019
- package/build/cjs/context-related-posts.js.map +1 -1
- package/build/es/context-blog-feed.mjs +1422 -1366
- package/build/es/context-blog-feed.mjs.map +1 -1
- package/build/es/context-post-by-id.mjs +750 -694
- package/build/es/context-post-by-id.mjs.map +1 -1
- package/build/es/context-post-by-slug.mjs +1345 -1289
- package/build/es/context-post-by-slug.mjs.map +1 -1
- package/build/es/context-post-list-item.mjs +265 -237
- package/build/es/context-post-list-item.mjs.map +1 -1
- package/build/es/context-post.d.mts +36 -1
- package/build/es/context-related-posts.mjs +1075 -1019
- package/build/es/context-related-posts.mjs.map +1 -1
- package/build/internal/cjs/context-post.d.ts +36 -1
- package/build/internal/es/context-post.d.mts +36 -1
- package/package.json +2 -2
|
@@ -4,16 +4,17 @@ import { Component as n, Suspense as r, createContext as i, createElement as a,
|
|
|
4
4
|
import { useGetService as p, useService as m } from "@wix/services-manager-react";
|
|
5
5
|
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
6
6
|
var _ = Object.defineProperty;
|
|
7
|
-
var v = (e6, t2) => {
|
|
7
|
+
var v = (e6, t2) => () => (t2 || (e6((t2 = { exports: {} }).exports, t2, t2.exports), e6 = null), t2.exports);
|
|
8
|
+
var y = (e6, t2) => {
|
|
8
9
|
let n2 = {};
|
|
9
10
|
for (var r2 in e6) _(n2, r2, { get: e6[r2], enumerable: true });
|
|
10
11
|
return t2 || _(n2, Symbol.toStringTag, { value: `Module` }), n2;
|
|
11
12
|
};
|
|
12
|
-
var
|
|
13
|
-
function
|
|
13
|
+
var b = {};
|
|
14
|
+
function x(e6, t2 = false, n2 = (e7) => e7) {
|
|
14
15
|
return () => ({ __type: `event-definition`, type: e6, isDomainEvent: t2, transformations: n2 });
|
|
15
16
|
}
|
|
16
|
-
var
|
|
17
|
+
var S = (e6) => {
|
|
17
18
|
switch (e6) {
|
|
18
19
|
case `get`:
|
|
19
20
|
case `GET`:
|
|
@@ -40,11 +41,11 @@ var x = (e6) => {
|
|
|
40
41
|
throw Error(`Unknown method: ${e6}`);
|
|
41
42
|
}
|
|
42
43
|
};
|
|
43
|
-
var
|
|
44
|
+
var C = (e6) => (t2) => async (n2) => {
|
|
44
45
|
let r2, i2 = (t3) => {
|
|
45
46
|
if (r2 = e6(n2)(t3), r2.url === void 0) throw Error(`Url was not successfully created for this request, please reach out to support channels for assistance.`);
|
|
46
47
|
let { method: i3, url: a2, params: o2 } = r2;
|
|
47
|
-
return { ...r2, method:
|
|
48
|
+
return { ...r2, method: S(i3), url: a2, data: r2.data, params: o2 };
|
|
48
49
|
};
|
|
49
50
|
try {
|
|
50
51
|
let e7 = await t2.request(i2);
|
|
@@ -57,10 +58,10 @@ var S = (e6) => (t2) => async (n2) => {
|
|
|
57
58
|
throw typeof e7 == `object` && e7 && `response` in e7 && typeof e7.response == `object` && e7.response !== null && `data` in e7.response ? e7.response.data : e7;
|
|
58
59
|
}
|
|
59
60
|
};
|
|
60
|
-
var
|
|
61
|
-
var
|
|
62
|
-
var
|
|
63
|
-
var
|
|
61
|
+
var ee = (e6) => e6.__isAmbassador ? true : !!e6().__isAmbassador;
|
|
62
|
+
var w = `__metadata`;
|
|
63
|
+
var T = `edge.wixapis.com`;
|
|
64
|
+
var te = class extends Error {
|
|
64
65
|
message;
|
|
65
66
|
response;
|
|
66
67
|
constructor(e6, t2) {
|
|
@@ -68,108 +69,108 @@ var T = class extends Error {
|
|
|
68
69
|
}
|
|
69
70
|
async details() {
|
|
70
71
|
let e6 = await this.response.json();
|
|
71
|
-
return
|
|
72
|
+
return ne(this.response.status, e6?.message, e6?.details, { requestId: this.response.headers.get(`X-Wix-Request-Id`), details: e6 });
|
|
72
73
|
}
|
|
73
74
|
};
|
|
74
|
-
var
|
|
75
|
-
var
|
|
76
|
-
var
|
|
77
|
-
var
|
|
78
|
-
function
|
|
75
|
+
var ne = (e6, t2, n2, r2) => ({ details: { ...!n2?.validationError && { applicationError: { description: t2, code: e6, data: r2 } }, ...n2 }, message: t2, requestId: r2?.requestId });
|
|
76
|
+
var re = (e6) => e6?.method && [`post`, `put`, `patch`].includes(e6.method.toLocaleLowerCase()) && e6.body ? { "Content-Type": `application/json` } : {};
|
|
77
|
+
var ie = (e6) => e6 && typeof e6 == `object` && !Array.isArray(e6);
|
|
78
|
+
var ae = (e6) => e6.__type === `host`;
|
|
79
|
+
function oe(e6, t2) {
|
|
79
80
|
return e6.create(t2);
|
|
80
81
|
}
|
|
81
|
-
var
|
|
82
|
-
function
|
|
83
|
-
return { [
|
|
82
|
+
var se = `x-wix-bi-gateway`;
|
|
83
|
+
function ce(e6, t2, n2) {
|
|
84
|
+
return { [se]: le({ environment: `js-sdk${n2 ? `-${n2}` : ``}`, "package-name": e6.packageName ?? t2?.PACKAGE_NAME, "method-fqn": e6.methodFqn, entity: e6.entityFqdn }) };
|
|
84
85
|
}
|
|
85
|
-
function
|
|
86
|
+
function le(e6) {
|
|
86
87
|
return Object.entries(e6).filter(([e7, t2]) => !!t2).map(([e7, t2]) => `${e7}=${t2}`).join(`,`);
|
|
87
88
|
}
|
|
88
|
-
function
|
|
89
|
-
let t2 = globalThis.__wix_context__, n2 = { client:
|
|
90
|
-
globalThis.__wix_context__ = void 0,
|
|
89
|
+
function ue(e6) {
|
|
90
|
+
let t2 = globalThis.__wix_context__, n2 = { client: b.client, elevatedClient: b.elevatedClient }, r2;
|
|
91
|
+
globalThis.__wix_context__ = void 0, b.client = void 0, b.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
91
92
|
try {
|
|
92
93
|
return e6();
|
|
93
94
|
} finally {
|
|
94
|
-
globalThis.__wix_context__ = t2,
|
|
95
|
+
globalThis.__wix_context__ = t2, b.client = n2.client, b.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
95
96
|
}
|
|
96
97
|
}
|
|
97
|
-
var
|
|
98
|
-
function
|
|
99
|
-
return
|
|
98
|
+
var de = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
|
|
99
|
+
function fe(e6) {
|
|
100
|
+
return _e(e6).map((e7) => e7.toLocaleUpperCase()).join(`_`);
|
|
100
101
|
}
|
|
101
|
-
var
|
|
102
|
-
var
|
|
103
|
-
var
|
|
104
|
-
var
|
|
105
|
-
function
|
|
102
|
+
var pe = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
103
|
+
var me = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
104
|
+
var he = `$1\0$2`;
|
|
105
|
+
var ge = /[^\p{L}\d]+/giu;
|
|
106
|
+
function _e(e6) {
|
|
106
107
|
let t2 = e6.trim();
|
|
107
|
-
t2 = t2.replace(
|
|
108
|
+
t2 = t2.replace(pe, he).replace(me, he), t2 = t2.replace(ge, `\0`);
|
|
108
109
|
let n2 = 0, r2 = t2.length;
|
|
109
110
|
for (; t2.charAt(n2) === `\0`; ) n2++;
|
|
110
111
|
if (n2 === r2) return [];
|
|
111
112
|
for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
|
|
112
113
|
return t2.slice(n2, r2).split(/\0/g);
|
|
113
114
|
}
|
|
114
|
-
var
|
|
115
|
-
var
|
|
116
|
-
var
|
|
117
|
-
function
|
|
115
|
+
var ve = (e6) => `validationError` in (e6.response?.data?.details ?? {});
|
|
116
|
+
var ye = (e6) => `applicationError` in (e6.response?.data?.details ?? {});
|
|
117
|
+
var be = (e6) => (e6.response?.status ?? -1) >= 400 && (e6.response?.status ?? -1) < 500;
|
|
118
|
+
function xe(e6, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
|
|
118
119
|
if (typeof e6 != `object` || !e6) throw e6;
|
|
119
|
-
if (
|
|
120
|
-
if (
|
|
121
|
-
if (
|
|
122
|
-
let t3 = e6.response?.status, n3 = e6.response?.statusText ?? `UNKNOWN`, r2 = e6.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code:
|
|
123
|
-
return
|
|
120
|
+
if (ve(e6)) return Se(e6, t2, n2);
|
|
121
|
+
if (ye(e6)) return we(e6);
|
|
122
|
+
if (be(e6)) {
|
|
123
|
+
let t3 = e6.response?.status, n3 = e6.response?.statusText ?? `UNKNOWN`, r2 = e6.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: fe(n3), data: {} }, requestId: e6.requestId };
|
|
124
|
+
return Ce(e6, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
|
|
124
125
|
}
|
|
125
|
-
return
|
|
126
|
+
return Te(e6);
|
|
126
127
|
}
|
|
127
|
-
var
|
|
128
|
-
let r2 = e6.response?.data, i2 = e6.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 =
|
|
129
|
-
return
|
|
128
|
+
var Se = (e6, t2, n2) => {
|
|
129
|
+
let r2 = e6.response?.data, i2 = e6.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = Ee(t2, a2, n2)?.sort((e7, t3) => e7.field < t3.field ? -1 : 1), s2 = `INVALID_ARGUMENT: ${o2?.map(({ field: e7, description: t3 }) => `"${e7}" ${t3}`)?.join(`, `)}`, c2 = { validationError: { fieldViolations: o2 }, requestId: i2 };
|
|
130
|
+
return Ce(e6, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e6.response?.status, requestId: i2 } });
|
|
130
131
|
};
|
|
131
|
-
var
|
|
132
|
-
var
|
|
133
|
-
let t2 = e6.response?.status, n2 = e6.response?.statusText ?? `UNKNOWN`, r2 = e6.response?.data?.message ?? n2, i2 = e6.response?.data?.details?.applicationError?.description ?? n2, a2 = e6.response?.data?.details?.applicationError?.code ??
|
|
134
|
-
return
|
|
132
|
+
var Ce = (e6, { message: t2, extraProperties: n2 }) => Object.assign(e6, { ...n2, message: t2 });
|
|
133
|
+
var we = (e6) => {
|
|
134
|
+
let t2 = e6.response?.status, n2 = e6.response?.statusText ?? `UNKNOWN`, r2 = e6.response?.data?.message ?? n2, i2 = e6.response?.data?.details?.applicationError?.description ?? n2, a2 = e6.response?.data?.details?.applicationError?.code ?? fe(n2), o2 = e6.response?.data?.details?.applicationError?.data ?? {}, s2 = r2 === i2 ? r2 : `${r2}: ${i2}`, c2 = { applicationError: { description: i2, code: a2, data: o2 }, requestId: e6.requestId };
|
|
135
|
+
return Ce(e6, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e6.requestId } });
|
|
135
136
|
};
|
|
136
|
-
var
|
|
137
|
-
var
|
|
137
|
+
var Te = (e6) => Ce(e6, { message: e6.requestId ? `System error occurred, request-id: ${e6.requestId}` : `System error occurred: ${JSON.stringify(e6)}`, extraProperties: { requestId: e6.requestId, status: e6.response?.status, code: fe(e6.response?.statusText ?? `UNKNOWN`), ...!e6.response && { runtimeError: e6 } } });
|
|
138
|
+
var Ee = ({ spreadPathsToArguments: e6, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
|
|
138
139
|
let a2 = { ...e6, ...t2 }, o2 = Object.keys(a2);
|
|
139
140
|
return r2?.filter((e7) => !r2.some((t3) => t3.field.length > e7.field.length && t3.field.startsWith(e7.field) && o2.includes(t3.field))).map((e7) => {
|
|
140
141
|
let r3 = t2[e7.field];
|
|
141
|
-
if (r3) return { ...e7, field:
|
|
142
|
+
if (r3) return { ...e7, field: De(r3, i2) };
|
|
142
143
|
let s2 = o2?.sort((e8, t3) => t3.length - e8.length)?.find((t3) => e7.field.startsWith(t3));
|
|
143
144
|
if (s2) {
|
|
144
145
|
let t3 = a2[s2];
|
|
145
|
-
if (t3) return { ...e7, field: e7.field.replace(s2,
|
|
146
|
+
if (t3) return { ...e7, field: e7.field.replace(s2, De(t3, i2)) };
|
|
146
147
|
}
|
|
147
148
|
return n2 ? { ...e7, field: `${i2[0]}.${e7.field}` } : e7;
|
|
148
149
|
});
|
|
149
150
|
};
|
|
150
|
-
var
|
|
151
|
-
let n2 =
|
|
151
|
+
var De = (e6, t2) => {
|
|
152
|
+
let n2 = Oe(e6);
|
|
152
153
|
return n2 == null ? e6 : e6.replace(`$[${n2}]`, t2[n2]);
|
|
153
154
|
};
|
|
154
|
-
var
|
|
155
|
+
var Oe = (e6) => {
|
|
155
156
|
let t2 = e6.match(/\$\[(?<argIndex>\d+)\]/);
|
|
156
157
|
return t2 && t2.groups && Number(t2.groups.argIndex);
|
|
157
158
|
};
|
|
158
|
-
function
|
|
159
|
-
return
|
|
159
|
+
function ke(e6, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
|
|
160
|
+
return ue(() => e6({ request: async (e7) => {
|
|
160
161
|
let i3 = e7({ host: s2?.HTTPHost || `www.wixapis.com` }), a3 = i3;
|
|
161
162
|
a3.method === `GET` && a3.fallback?.length && (a3.params?.toString().length ?? 0) > 4e3 && (a3 = i3.fallback[0]);
|
|
162
|
-
let o3 = s2?.HTTPHost ?? `www.wixapis.com`, u3 = `https://${l2 ?
|
|
163
|
+
let o3 = s2?.HTTPHost ?? `www.wixapis.com`, u3 = `https://${l2 ? T : o3}${a3.url}`;
|
|
163
164
|
a3.params && a3.params.toString() && (u3 += `?${a3.params.toString()}`);
|
|
164
165
|
try {
|
|
165
|
-
let e8 =
|
|
166
|
+
let e8 = ce(i3, t2, c2), o4 = { method: a3.method, ...a3.data && { body: JSON.stringify(a3.data) }, headers: { ...e8 } }, s3 = await n2(u3, o4);
|
|
166
167
|
if (s3.status !== 200) {
|
|
167
168
|
let e9 = null;
|
|
168
169
|
try {
|
|
169
170
|
e9 = await s3.json();
|
|
170
171
|
} catch {
|
|
171
172
|
}
|
|
172
|
-
let t3 =
|
|
173
|
+
let t3 = je(s3.status, e9?.message ?? s3.statusText, e9?.details, { requestId: s3.headers.get(`X-Wix-Request-Id`), details: e9 }), n3 = xe(t3);
|
|
173
174
|
throw r2?.handleError(n3, { requestOptions: { url: a3.url, method: a3.method, entityFqdn: i3.entityFqdn, methodFqn: i3.methodFqn } }), t3;
|
|
174
175
|
}
|
|
175
176
|
let l3 = await s3.json();
|
|
@@ -179,18 +180,18 @@ function Oe(e6, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
|
|
|
179
180
|
}
|
|
180
181
|
}, fetchWithAuth: n2, wixAPIFetch: i2, getActiveToken: a2, getAuthHeaders: o2 }, { validateRequestSchema: u2 }));
|
|
181
182
|
}
|
|
182
|
-
var
|
|
183
|
+
var Ae = class extends Error {
|
|
183
184
|
response;
|
|
184
185
|
requestId;
|
|
185
186
|
constructor(e6) {
|
|
186
187
|
super(), this.response = e6.response, this.requestId = e6.requestId;
|
|
187
188
|
}
|
|
188
189
|
};
|
|
189
|
-
var
|
|
190
|
-
var
|
|
191
|
-
function
|
|
190
|
+
var je = (e6, t2, n2, r2) => new Ae({ response: { data: { details: { ...!n2?.validationError && { applicationError: { description: t2, code: e6, data: r2 } }, ...n2 }, message: t2 }, status: e6 }, requestId: r2?.requestId });
|
|
191
|
+
var Me = `.`;
|
|
192
|
+
function Ne(e6, t2, n2) {
|
|
192
193
|
if (e6 == null) throw Error(`Cannot set value on null or undefined`);
|
|
193
|
-
let r2 =
|
|
194
|
+
let r2 = Pe(t2), i2 = e6;
|
|
194
195
|
for (let e7 = 0; e7 < r2.length; e7++) {
|
|
195
196
|
let t3 = r2[e7];
|
|
196
197
|
if (e7 === r2.length - 1) {
|
|
@@ -202,21 +203,21 @@ function Me(e6, t2, n2) {
|
|
|
202
203
|
}
|
|
203
204
|
return e6;
|
|
204
205
|
}
|
|
205
|
-
function Ne(e6) {
|
|
206
|
-
return Array.isArray(e6) ? e6 : e6.split(je).map((e7) => Pe(e7) ? Number(e7) : e7);
|
|
207
|
-
}
|
|
208
206
|
function Pe(e6) {
|
|
209
|
-
return
|
|
207
|
+
return Array.isArray(e6) ? e6 : e6.split(Me).map((e7) => Fe(e7) ? Number(e7) : e7);
|
|
210
208
|
}
|
|
211
209
|
function Fe(e6) {
|
|
210
|
+
return /^\d+$/.test(e6);
|
|
211
|
+
}
|
|
212
|
+
function Ie(e6) {
|
|
212
213
|
let t2 = {};
|
|
213
|
-
for (let [n2, r2] of Object.entries(e6))
|
|
214
|
+
for (let [n2, r2] of Object.entries(e6)) Le(n2) || Ne(t2, Pe(n2), r2);
|
|
214
215
|
return t2;
|
|
215
216
|
}
|
|
216
|
-
function
|
|
217
|
+
function Le(e6) {
|
|
217
218
|
return e6 === `__proto__` || e6 === `constructor` || e6 === `prototype`;
|
|
218
219
|
}
|
|
219
|
-
var
|
|
220
|
+
var Re = class {
|
|
220
221
|
BRACKET_PATTERN = /\[(\d+)\]/g;
|
|
221
222
|
NUMERIC_PATTERN = /^\d+$/;
|
|
222
223
|
ESCAPED_DOT_PATTERN = /\\\./g;
|
|
@@ -239,7 +240,7 @@ var Le = class {
|
|
|
239
240
|
return e6.replace(this.ESCAPED_DOT_PLACEHOLDER, `\\.`).replace(this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER, `\\]`).replace(this.ESCAPED_LEFT_BRACKET_PLACEHOLDER, `\\[`);
|
|
240
241
|
}
|
|
241
242
|
unflatten() {
|
|
242
|
-
return this.cleanedModifiedFields = Object.fromEntries(Object.entries(this.modifiedFields).map(([e6, t2]) => [this.replaceEscapedCharacters(this.bracketToDotNotation(e6)), t2])),
|
|
243
|
+
return this.cleanedModifiedFields = Object.fromEntries(Object.entries(this.modifiedFields).map(([e6, t2]) => [this.replaceEscapedCharacters(this.bracketToDotNotation(e6)), t2])), Ie(this.cleanedModifiedFields);
|
|
243
244
|
}
|
|
244
245
|
flatten(e6) {
|
|
245
246
|
let t2 = {};
|
|
@@ -259,12 +260,12 @@ var Le = class {
|
|
|
259
260
|
if (!Array.isArray(n2)) throw Error(`Expected array at path ${this.buildPathString(r2)}, but got ${typeof n2}`);
|
|
260
261
|
r2.push(`[${e7}]`), n2 = n2[parseInt(e7, 10)];
|
|
261
262
|
}, a2 = (e7, t3) => {
|
|
262
|
-
let i3 = e7 in
|
|
263
|
+
let i3 = e7 in de ? de[e7] : void 0;
|
|
263
264
|
if (i3 && i3 in t3) {
|
|
264
265
|
r2.push(i3), n2 = t3[i3];
|
|
265
266
|
return;
|
|
266
267
|
}
|
|
267
|
-
let a3 =
|
|
268
|
+
let a3 = He(e7);
|
|
268
269
|
if (a3 && a3 in t3) r2.push(a3), n2 = t3[a3];
|
|
269
270
|
else throw Error(`Cannot find key '${e7}' or its transformations at path ${this.buildPathString(r2)}`);
|
|
270
271
|
}, o2 = (e7, t3) => {
|
|
@@ -288,28 +289,28 @@ var Le = class {
|
|
|
288
289
|
return e6.replace(this.BRACKET_PATTERN, (t2, n2, r2) => r2 > 0 && e6[r2 - 1] === `\\` ? t2 : `.` + n2);
|
|
289
290
|
}
|
|
290
291
|
};
|
|
291
|
-
function
|
|
292
|
+
function ze(e6, t2) {
|
|
292
293
|
let n2 = e6?.modifiedFields;
|
|
293
294
|
if (!n2) return null;
|
|
294
|
-
let r2 =
|
|
295
|
+
let r2 = Be(n2);
|
|
295
296
|
if (!r2) return null;
|
|
296
297
|
let { unflattenedModifiedFields: i2, modifiedFieldsManipulator: a2 } = r2;
|
|
297
298
|
e6 = { ...e6, modifiedFields: i2 };
|
|
298
299
|
let o2 = t2(e6), s2 = o2?.modifiedFields;
|
|
299
300
|
if (!s2) return null;
|
|
300
|
-
let c2 =
|
|
301
|
+
let c2 = Ve(s2, a2);
|
|
301
302
|
return c2 === null ? null : (o2.modifiedFields = c2, o2);
|
|
302
303
|
}
|
|
303
|
-
function
|
|
304
|
+
function Be(e6) {
|
|
304
305
|
if (typeof e6 == `object` && e6 && !Array.isArray(e6)) try {
|
|
305
|
-
let t2 = new
|
|
306
|
+
let t2 = new Re(e6);
|
|
306
307
|
return { unflattenedModifiedFields: t2.unflatten(), modifiedFieldsManipulator: t2 };
|
|
307
308
|
} catch {
|
|
308
309
|
return null;
|
|
309
310
|
}
|
|
310
311
|
return null;
|
|
311
312
|
}
|
|
312
|
-
function
|
|
313
|
+
function Ve(e6, t2) {
|
|
313
314
|
if (typeof e6 == `object` && e6 && !Array.isArray(e6)) try {
|
|
314
315
|
return t2.flatten(e6);
|
|
315
316
|
} catch {
|
|
@@ -317,10 +318,10 @@ function Be(e6, t2) {
|
|
|
317
318
|
}
|
|
318
319
|
return null;
|
|
319
320
|
}
|
|
320
|
-
function
|
|
321
|
+
function He(e6) {
|
|
321
322
|
return e6.replace(/[-_\s]+(.)?/g, (e7, t2) => t2 ? t2.toUpperCase() : ``).replace(/^./, (e7) => e7.toLowerCase());
|
|
322
323
|
}
|
|
323
|
-
function
|
|
324
|
+
function Ue() {
|
|
324
325
|
return { emit(e6, ...t2) {
|
|
325
326
|
for (let n2 = 0, r2 = this.events[e6] || [], i2 = r2.length; n2 < i2; n2++) r2[n2](...t2);
|
|
326
327
|
}, events: {}, on(e6, t2) {
|
|
@@ -329,8 +330,8 @@ function He() {
|
|
|
329
330
|
};
|
|
330
331
|
} };
|
|
331
332
|
}
|
|
332
|
-
var
|
|
333
|
-
function
|
|
333
|
+
var We = (e6) => e6.__type === `event-definition`;
|
|
334
|
+
function Ge(e6, t2, n2, r2) {
|
|
334
335
|
let i2;
|
|
335
336
|
if (e6.isDomainEvent) {
|
|
336
337
|
let { deletedEvent: e7, actionEvent: t3, createdEvent: a3, updatedEvent: o3, ...s3 } = n2, c2 = { ...r2, ...s3 };
|
|
@@ -341,14 +342,14 @@ function We(e6, t2, n2, r2) {
|
|
|
341
342
|
let e7 = s2.modifiedFields;
|
|
342
343
|
if (typeof e7 == `object` && e7 && !Array.isArray(e7)) {
|
|
343
344
|
o2 = structuredClone(i2);
|
|
344
|
-
let e8 =
|
|
345
|
+
let e8 = ze(s2, a2);
|
|
345
346
|
if (e8) return t2(e8);
|
|
346
347
|
}
|
|
347
348
|
}
|
|
348
349
|
return t2(a2(o2));
|
|
349
350
|
}
|
|
350
|
-
function
|
|
351
|
-
let t2 = /* @__PURE__ */ new Map(), n2 =
|
|
351
|
+
function Ke(e6) {
|
|
352
|
+
let t2 = /* @__PURE__ */ new Map(), n2 = Ue();
|
|
352
353
|
return { initModule(e7) {
|
|
353
354
|
return (r2) => {
|
|
354
355
|
let i2 = t2.get(e7.type) ?? [];
|
|
@@ -358,7 +359,7 @@ function Ge(e6) {
|
|
|
358
359
|
let { eventType: r2, identity: i2, instanceId: a2, payload: o2, accountInfo: s2 } = await this.parseJWT(e7), c2 = [...n3.expectedEvents, ...Array.from(t2.keys()).map((e8) => ({ type: e8 }))];
|
|
359
360
|
if (c2.length > 0 && !c2.some(({ type: e8 }) => e8 === r2)) throw Error(`Unexpected event type: ${r2}. Expected one of: ${c2.map((e8) => e8.type).join(`, `)}`);
|
|
360
361
|
let l2 = t2.get(r2) ?? [];
|
|
361
|
-
return await Promise.all(l2.map(({ eventDefinition: e8, handler: t3 }) =>
|
|
362
|
+
return await Promise.all(l2.map(({ eventDefinition: e8, handler: t3 }) => Ge(e8, t3, o2, { instanceId: a2, identity: i2, accountInfo: s2 }))), { instanceId: a2, eventType: r2, payload: o2, identity: i2, accountInfo: s2 };
|
|
362
363
|
}, async processRequest(e7, t3) {
|
|
363
364
|
let n3 = await e7.text();
|
|
364
365
|
return this.process(n3, t3);
|
|
@@ -377,12 +378,12 @@ function Ge(e6) {
|
|
|
377
378
|
let n3 = Array.from(t2.keys()).map((e8) => ({ type: e8 }));
|
|
378
379
|
if (n3.length > 0 && !n3.some(({ type: t3 }) => t3 === e7.eventType)) throw Error(`Unexpected event type: ${e7.eventType}. Expected one of: ${n3.map((e8) => e8.type).join(`, `)}`);
|
|
379
380
|
let r2 = t2.get(e7.eventType) ?? [];
|
|
380
|
-
await Promise.all(r2.map(({ eventDefinition: t3, handler: n4 }) =>
|
|
381
|
-
}, apps: { AppInstalled:
|
|
381
|
+
await Promise.all(r2.map(({ eventDefinition: t3, handler: n4 }) => Ge(t3, n4, e7.payload, { instanceId: e7.instanceId, identity: e7.identity })));
|
|
382
|
+
}, apps: { AppInstalled: x(`AppInstalled`)(), AppRemoved: x(`AppRemoved`)() } } };
|
|
382
383
|
}
|
|
383
|
-
var
|
|
384
|
-
function
|
|
385
|
-
let t2 = /* @__PURE__ */ new Map(), n2 =
|
|
384
|
+
var qe = (e6) => e6.__type === `service-plugin-definition`;
|
|
385
|
+
function Je(e6) {
|
|
386
|
+
let t2 = /* @__PURE__ */ new Map(), n2 = Ue();
|
|
386
387
|
return { initModule(e7) {
|
|
387
388
|
return (r2) => {
|
|
388
389
|
let i2 = t2.get(e7.componentType.toLowerCase()) ?? [];
|
|
@@ -424,42 +425,42 @@ function qe(e6) {
|
|
|
424
425
|
} } };
|
|
425
426
|
}
|
|
426
427
|
var E = `X-Wix-Consistent`;
|
|
427
|
-
function
|
|
428
|
+
function Ye(e6) {
|
|
428
429
|
let t2 = e6.headers || { Authorization: `` }, n2 = { getAuthHeaders: (e7) => Promise.resolve({ headers: {} }) }, r2 = e6.auth, i2 = typeof r2 == `function` ? r2 : () => r2 ?? n2, a2 = () => i2().getAuthHeaders(e6.host), o2 = () => e6.fetch ?? fetch, s2 = async (n3, r3) => {
|
|
429
430
|
let i3 = o2(), s3 = await a2(), c3 = { ...r3?.headers ?? {}, ...s3.headers, ...e6.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [E]: t2[E] } : {} }, l3 = e6.host?.getErrorHandler?.();
|
|
430
431
|
try {
|
|
431
432
|
if (typeof n3 == `string` || n3 instanceof URL) {
|
|
432
433
|
let e7 = await i3(n3, { ...r3, headers: c3 });
|
|
433
434
|
l3?.handleError(e7, { requestOptions: { url: n3.toString(), method: r3?.method } });
|
|
434
|
-
let a3 =
|
|
435
|
+
let a3 = Xe(e7);
|
|
435
436
|
return a3 && (t2[E] = a3), e7;
|
|
436
437
|
}
|
|
437
438
|
{
|
|
438
439
|
for (let [e8, t3] of Object.entries(c3)) typeof t3 == `string` && n3.headers.set(e8, t3);
|
|
439
440
|
let e7 = await i3(n3, r3);
|
|
440
441
|
l3?.handleError(e7, { requestOptions: { url: n3.url, method: r3?.method } });
|
|
441
|
-
let a3 =
|
|
442
|
+
let a3 = Xe(e7);
|
|
442
443
|
return a3 && (t2[E] = a3), e7;
|
|
443
444
|
}
|
|
444
445
|
} catch (e7) {
|
|
445
446
|
throw l3?.handleError(e7, { requestOptions: { url: typeof n3 == `string` || n3 instanceof URL ? n3.toString() : n3.url, method: r3?.method } }), e7;
|
|
446
447
|
}
|
|
447
|
-
}, { client: c2, initModule: l2 } =
|
|
448
|
-
let i3 = o2(), s3 = await a2(), c3 =
|
|
448
|
+
}, { client: c2, initModule: l2 } = Je(i2), { client: u2, initModule: d2 } = Ke(i2), f2 = async (n3, r3) => {
|
|
449
|
+
let i3 = o2(), s3 = await a2(), c3 = re(r3), l3 = await i3(n3, { ...r3, headers: { ...c3, ...t2, ...s3?.headers, ...r3?.headers, ...e6.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [E]: t2[E] } : {} } }), u3 = Xe(l3);
|
|
449
450
|
return u3 && (t2[E] = u3), l3;
|
|
450
451
|
}, p2 = (t3, n3) => {
|
|
451
|
-
if (
|
|
452
|
-
if (
|
|
453
|
-
if (
|
|
452
|
+
if (We(t3)) return d2(t3);
|
|
453
|
+
if (qe(t3)) return l2(t3);
|
|
454
|
+
if (ae(t3) && e6.host) return oe(t3, e6.host);
|
|
454
455
|
if (typeof t3 == `function`) {
|
|
455
456
|
if (`__type` in t3 && t3.__type === `wix_spi_error`) return t3;
|
|
456
457
|
let r3 = e6.host?.apiBaseUrl ?? `www.wixapis.com`, o3 = e6.useCDN === void 0 ? i2().shouldUseCDN : e6.useCDN;
|
|
457
|
-
return
|
|
458
|
+
return ke(ue(() => ee(t3)) ? C(t3) : t3, n3 ?? {}, f2, e6.host?.getErrorHandler?.(), (e7, t4) => {
|
|
458
459
|
let n4 = new URL(e7, `https://${r3}`);
|
|
459
460
|
return n4.host = r3, n4.protocol = `https`, f2(n4.toString(), t4);
|
|
460
461
|
}, i2().getActiveToken, async () => a2(), { HTTPHost: r3 }, e6.host?.name, o3, e6.validateRequestSchema);
|
|
461
462
|
}
|
|
462
|
-
return
|
|
463
|
+
return ie(t3) ? Object.fromEntries(Object.entries(t3).map(([e7, n4]) => [e7, p2(n4, t3[w])])) : t3;
|
|
463
464
|
}, m2 = (e7) => {
|
|
464
465
|
for (let n3 in e7) t2[n3] = e7[n3];
|
|
465
466
|
};
|
|
@@ -467,33 +468,33 @@ function Je(e6) {
|
|
|
467
468
|
let t3 = i2();
|
|
468
469
|
return t3.getAuthHeaders = t3.getAuthHeaders.bind(void 0, e6.host), t3;
|
|
469
470
|
}, setHeaders: m2, use: p2, enableContext(e7, t3 = { elevated: false }) {
|
|
470
|
-
e7 === `global` ? globalThis.__wix_context__ == null ? t3.elevated ? globalThis.__wix_context__ = { elevatedClient: this } : globalThis.__wix_context__ = { client: this } : t3.elevated ? globalThis.__wix_context__.elevatedClient = this : globalThis.__wix_context__.client = this : t3.elevated ?
|
|
471
|
+
e7 === `global` ? globalThis.__wix_context__ == null ? t3.elevated ? globalThis.__wix_context__ = { elevatedClient: this } : globalThis.__wix_context__ = { client: this } : t3.elevated ? globalThis.__wix_context__.elevatedClient = this : globalThis.__wix_context__.client = this : t3.elevated ? b.elevatedClient = this : b.client = this;
|
|
471
472
|
}, fetch: (t3, n3) => {
|
|
472
473
|
let r3 = e6.host?.apiBaseUrl ?? `www.wixapis.com`, i3 = new URL(t3, `https://${r3}`);
|
|
473
474
|
return i3.host = r3, i3.protocol = `https`, f2(i3.toString(), n3);
|
|
474
475
|
}, fetchWithAuth: s2, async graphql(t3, n3, r3 = { apiVersion: `alpha` }) {
|
|
475
476
|
let i3 = e6?.host?.apiBaseUrl ?? `www.wixapis.com`, a3 = await f2(`https://${i3}/graphql/${r3.apiVersion}`, { method: `POST`, headers: { "Content-Type": `application/json` }, body: JSON.stringify({ query: t3, variables: n3 }) });
|
|
476
|
-
if (a3.status !== 200) throw new
|
|
477
|
+
if (a3.status !== 200) throw new te(`GraphQL request failed with status ${a3.status}`, a3);
|
|
477
478
|
let { data: o3, errors: s3 } = await a3.json();
|
|
478
479
|
return { data: o3 ?? {}, errors: s3 };
|
|
479
480
|
}, webhooks: u2, servicePlugins: c2 };
|
|
480
481
|
}
|
|
481
|
-
function
|
|
482
|
+
function Xe(e6) {
|
|
482
483
|
return e6.headers?.get(`X-Wix-Consistent`) ?? e6.headers?.get(`x-wix-consistent`);
|
|
483
484
|
}
|
|
484
|
-
var
|
|
485
|
-
var
|
|
486
|
-
var
|
|
487
|
-
var
|
|
488
|
-
var
|
|
489
|
-
function
|
|
485
|
+
var Ze = { _id: `id`, _createdDate: `createdDate`, _updatedDate: `updatedDate` };
|
|
486
|
+
var Qe = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
|
|
487
|
+
var $e = `items`;
|
|
488
|
+
var et = `pagingMetadata`;
|
|
489
|
+
var tt = Ze;
|
|
490
|
+
function nt(e6, t2) {
|
|
490
491
|
return e6?.split(`.`).map((e7) => t2?.[e7] ?? e7).join(`.`);
|
|
491
492
|
}
|
|
492
|
-
var
|
|
493
|
-
function rt(e6, t2, n2) {
|
|
494
|
-
return (e6 === nt || e6.endsWith(`.${nt}`)) && typeof t2 == `string` ? tt(t2, n2) : t2;
|
|
495
|
-
}
|
|
493
|
+
var rt = `sort.fieldName`;
|
|
496
494
|
function it(e6, t2, n2) {
|
|
495
|
+
return (e6 === rt || e6.endsWith(`.${rt}`)) && typeof t2 == `string` ? nt(t2, n2) : t2;
|
|
496
|
+
}
|
|
497
|
+
function at(e6, t2, n2) {
|
|
497
498
|
let r2 = (e7) => n2.includes(e7), i2 = (e7, n3) => {
|
|
498
499
|
if (Array.isArray(e7)) e7.forEach((e8) => {
|
|
499
500
|
i2(e8, n3);
|
|
@@ -503,160 +504,160 @@ function it(e6, t2, n2) {
|
|
|
503
504
|
Object.keys(a2).forEach((e8) => {
|
|
504
505
|
let o2 = n3 === `` ? e8 : `${n3}.${e8}`;
|
|
505
506
|
if (r2(o2)) return;
|
|
506
|
-
let s2 =
|
|
507
|
-
s2 !== e8 && !(s2 in a2) && (a2[s2] = a2[e8], delete a2[e8]), a2[s2] =
|
|
507
|
+
let s2 = ot(e8, t2);
|
|
508
|
+
s2 !== e8 && !(s2 in a2) && (a2[s2] = a2[e8], delete a2[e8]), a2[s2] = it(o2, a2[s2], t2), i2(a2[s2], o2);
|
|
508
509
|
});
|
|
509
510
|
}
|
|
510
511
|
};
|
|
511
512
|
return i2(e6, ``), e6;
|
|
512
513
|
}
|
|
513
|
-
function
|
|
514
|
+
function ot(e6, t2) {
|
|
514
515
|
let n2;
|
|
515
516
|
return n2 = e6.includes(`.`) ? e6.split(`.`).map((e7) => t2[e7] ?? e7).join(`.`) : t2[e6] ?? e6, n2;
|
|
516
517
|
}
|
|
517
518
|
function D(e6, t2 = []) {
|
|
518
|
-
return
|
|
519
|
+
return at(e6, Ze, t2);
|
|
519
520
|
}
|
|
520
521
|
function O(e6, t2 = []) {
|
|
521
|
-
return
|
|
522
|
+
return at(e6, Qe, t2);
|
|
522
523
|
}
|
|
523
|
-
function
|
|
524
|
+
function st(e6) {
|
|
524
525
|
return e6?.toISOString();
|
|
525
526
|
}
|
|
526
527
|
function k(e6) {
|
|
527
528
|
return e6 ? new Date(e6) : void 0;
|
|
528
529
|
}
|
|
529
|
-
var
|
|
530
|
-
function
|
|
530
|
+
var ct = /* @__PURE__ */ new WeakMap();
|
|
531
|
+
function lt() {
|
|
531
532
|
return { leaves: void 0, fields: void 0, mapFields: void 0, anyField: void 0 };
|
|
532
533
|
}
|
|
533
|
-
function
|
|
534
|
+
function ut(e6, t2) {
|
|
534
535
|
let n2 = e6.get(t2);
|
|
535
|
-
return n2 || (n2 =
|
|
536
|
+
return n2 || (n2 = lt(), e6.set(t2, n2)), n2;
|
|
536
537
|
}
|
|
537
|
-
function
|
|
538
|
-
return t2 === `*` ? (e6.anyField ??=
|
|
538
|
+
function dt(e6, t2) {
|
|
539
|
+
return t2 === `*` ? (e6.anyField ??= lt(), e6.anyField) : t2.endsWith(`{}`) ? (e6.mapFields ??= /* @__PURE__ */ new Map(), ut(e6.mapFields, t2.slice(0, -2))) : (e6.fields ??= /* @__PURE__ */ new Map(), ut(e6.fields, t2));
|
|
539
540
|
}
|
|
540
|
-
function
|
|
541
|
-
let t2 =
|
|
541
|
+
function ft(e6) {
|
|
542
|
+
let t2 = lt();
|
|
542
543
|
for (let n2 of e6) {
|
|
543
|
-
let e7 = n2.path.split(`.`).reduce(
|
|
544
|
+
let e7 = n2.path.split(`.`).reduce(dt, t2);
|
|
544
545
|
e7.leaves ??= [], e7.leaves.push(n2);
|
|
545
546
|
}
|
|
546
547
|
return t2;
|
|
547
548
|
}
|
|
548
|
-
function ft(e6) {
|
|
549
|
-
let t2 = st.get(e6);
|
|
550
|
-
return t2 || (t2 = dt(e6), st.set(e6, t2)), t2;
|
|
551
|
-
}
|
|
552
549
|
function pt(e6) {
|
|
553
|
-
|
|
550
|
+
let t2 = ct.get(e6);
|
|
551
|
+
return t2 || (t2 = ft(e6), ct.set(e6, t2)), t2;
|
|
554
552
|
}
|
|
555
|
-
function mt(e6
|
|
556
|
-
return
|
|
553
|
+
function mt(e6) {
|
|
554
|
+
return typeof e6 == `object` && !!e6;
|
|
557
555
|
}
|
|
558
|
-
function ht(e6, t2, n2) {
|
|
559
|
-
|
|
556
|
+
function ht(e6, { isRepeated: t2, isMap: n2 }, r2) {
|
|
557
|
+
return t2 ? Array.isArray(e6) ? e6.map(r2) : e6 : n2 ? mt(e6) ? Object.fromEntries(Object.entries(e6).map(([e7, t3]) => [e7, r2(t3)])) : e6 : r2(e6);
|
|
560
558
|
}
|
|
561
559
|
function gt(e6, t2, n2) {
|
|
560
|
+
mt(e6) && yt(e6, t2, n2);
|
|
561
|
+
}
|
|
562
|
+
function _t(e6, t2, n2) {
|
|
562
563
|
for (let [r2, i2] of t2) {
|
|
563
564
|
if (!(r2 in e6)) continue;
|
|
564
|
-
if (i2.leaves) for (let t4 of i2.leaves) e6[r2] =
|
|
565
|
+
if (i2.leaves) for (let t4 of i2.leaves) e6[r2] = ht(e6[r2], t4, n2);
|
|
565
566
|
let t3 = e6[r2];
|
|
566
|
-
Array.isArray(t3) ? t3.forEach((e7) =>
|
|
567
|
+
Array.isArray(t3) ? t3.forEach((e7) => gt(e7, i2, n2)) : gt(t3, i2, n2);
|
|
567
568
|
}
|
|
568
569
|
}
|
|
569
|
-
function
|
|
570
|
+
function vt(e6, t2, n2) {
|
|
570
571
|
for (let [r2, i2] of t2) {
|
|
571
572
|
let t3 = e6[r2];
|
|
572
|
-
|
|
573
|
+
mt(t3) && Object.values(t3).forEach((e7) => gt(e7, i2, n2));
|
|
573
574
|
}
|
|
574
575
|
}
|
|
575
|
-
function
|
|
576
|
-
t2 &&
|
|
576
|
+
function yt(e6, { fields: t2, mapFields: n2, anyField: r2 }, i2) {
|
|
577
|
+
t2 && _t(e6, t2, i2), n2 && vt(e6, n2, i2), r2 && Object.values(e6).forEach((e7) => gt(e7, r2, i2));
|
|
577
578
|
}
|
|
578
579
|
function A(e6, t2) {
|
|
579
|
-
if (!
|
|
580
|
-
for (let { paths: n2, transformFn: r2 } of t2)
|
|
580
|
+
if (!mt(e6)) return e6;
|
|
581
|
+
for (let { paths: n2, transformFn: r2 } of t2) yt(e6, pt(n2), r2);
|
|
581
582
|
return e6;
|
|
582
583
|
}
|
|
583
|
-
function
|
|
584
|
-
return
|
|
584
|
+
function bt(e6) {
|
|
585
|
+
return Tt(e6).map((e7) => e7.toLocaleUpperCase()).join(`_`);
|
|
585
586
|
}
|
|
586
|
-
var
|
|
587
|
-
var
|
|
588
|
-
var
|
|
589
|
-
var
|
|
590
|
-
function
|
|
587
|
+
var xt = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
588
|
+
var St = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
589
|
+
var Ct = `$1\0$2`;
|
|
590
|
+
var wt = /[^\p{L}\d]+/giu;
|
|
591
|
+
function Tt(e6) {
|
|
591
592
|
let t2 = e6.trim();
|
|
592
|
-
t2 = t2.replace(
|
|
593
|
+
t2 = t2.replace(xt, Ct).replace(St, Ct), t2 = t2.replace(wt, `\0`);
|
|
593
594
|
let n2 = 0, r2 = t2.length;
|
|
594
595
|
for (; t2.charAt(n2) === `\0`; ) n2++;
|
|
595
596
|
if (n2 === r2) return [];
|
|
596
597
|
for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
|
|
597
598
|
return t2.slice(n2, r2).split(/\0/g);
|
|
598
599
|
}
|
|
599
|
-
var
|
|
600
|
-
var
|
|
601
|
-
var
|
|
600
|
+
var Et = (e6) => `validationError` in (e6.response?.data?.details ?? {});
|
|
601
|
+
var Dt = (e6) => `applicationError` in (e6.response?.data?.details ?? {});
|
|
602
|
+
var Ot = (e6) => (e6.response?.status ?? -1) >= 400 && (e6.response?.status ?? -1) < 500;
|
|
602
603
|
function j(e6, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
|
|
603
604
|
if (typeof e6 != `object` || !e6) throw e6;
|
|
604
|
-
if (
|
|
605
|
-
if (
|
|
606
|
-
if (
|
|
607
|
-
let t3 = e6.response?.status, n3 = e6.response?.statusText ?? `UNKNOWN`, r2 = e6.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code:
|
|
608
|
-
return
|
|
605
|
+
if (Et(e6)) return kt(e6, t2, n2);
|
|
606
|
+
if (Dt(e6)) return jt(e6);
|
|
607
|
+
if (Ot(e6)) {
|
|
608
|
+
let t3 = e6.response?.status, n3 = e6.response?.statusText ?? `UNKNOWN`, r2 = e6.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: bt(n3), data: {} }, requestId: e6.requestId };
|
|
609
|
+
return At(e6, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
|
|
609
610
|
}
|
|
610
|
-
return
|
|
611
|
+
return Mt(e6);
|
|
611
612
|
}
|
|
612
|
-
var
|
|
613
|
-
let r2 = e6.response?.data, i2 = e6.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 =
|
|
614
|
-
return
|
|
613
|
+
var kt = (e6, t2, n2) => {
|
|
614
|
+
let r2 = e6.response?.data, i2 = e6.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = Nt(t2, a2, n2)?.sort((e7, t3) => e7.field < t3.field ? -1 : 1), s2 = `INVALID_ARGUMENT: ${o2?.map(({ field: e7, description: t3 }) => `"${e7}" ${t3}`)?.join(`, `)}`, c2 = { validationError: { fieldViolations: o2 }, requestId: i2 };
|
|
615
|
+
return At(e6, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e6.response?.status, requestId: i2 } });
|
|
615
616
|
};
|
|
616
|
-
var
|
|
617
|
-
var
|
|
618
|
-
let t2 = e6.response?.status, n2 = e6.response?.statusText ?? `UNKNOWN`, r2 = e6.response?.data?.message ?? n2, i2 = e6.response?.data?.details?.applicationError?.description ?? n2, a2 = e6.response?.data?.details?.applicationError?.code ??
|
|
619
|
-
return
|
|
617
|
+
var At = (e6, { message: t2, extraProperties: n2 }) => Object.assign(e6, { ...n2, message: t2 });
|
|
618
|
+
var jt = (e6) => {
|
|
619
|
+
let t2 = e6.response?.status, n2 = e6.response?.statusText ?? `UNKNOWN`, r2 = e6.response?.data?.message ?? n2, i2 = e6.response?.data?.details?.applicationError?.description ?? n2, a2 = e6.response?.data?.details?.applicationError?.code ?? bt(n2), o2 = e6.response?.data?.details?.applicationError?.data ?? {}, s2 = r2 === i2 ? r2 : `${r2}: ${i2}`, c2 = { applicationError: { description: i2, code: a2, data: o2 }, requestId: e6.requestId };
|
|
620
|
+
return At(e6, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e6.requestId } });
|
|
620
621
|
};
|
|
621
|
-
var
|
|
622
|
-
var
|
|
622
|
+
var Mt = (e6) => At(e6, { message: e6.requestId ? `System error occurred, request-id: ${e6.requestId}` : `System error occurred: ${JSON.stringify(e6)}`, extraProperties: { requestId: e6.requestId, status: e6.response?.status, code: bt(e6.response?.statusText ?? `UNKNOWN`), ...!e6.response && { runtimeError: e6 } } });
|
|
623
|
+
var Nt = ({ spreadPathsToArguments: e6, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
|
|
623
624
|
let a2 = { ...e6, ...t2 }, o2 = Object.keys(a2);
|
|
624
625
|
return r2?.filter((e7) => !r2.some((t3) => t3.field.length > e7.field.length && t3.field.startsWith(e7.field) && o2.includes(t3.field))).map((e7) => {
|
|
625
626
|
let r3 = t2[e7.field];
|
|
626
|
-
if (r3) return { ...e7, field:
|
|
627
|
+
if (r3) return { ...e7, field: Pt(r3, i2) };
|
|
627
628
|
let s2 = o2?.sort((e8, t3) => t3.length - e8.length)?.find((t3) => e7.field.startsWith(t3));
|
|
628
629
|
if (s2) {
|
|
629
630
|
let t3 = a2[s2];
|
|
630
|
-
if (t3) return { ...e7, field: e7.field.replace(s2,
|
|
631
|
+
if (t3) return { ...e7, field: e7.field.replace(s2, Pt(t3, i2)) };
|
|
631
632
|
}
|
|
632
633
|
return n2 ? { ...e7, field: `${i2[0]}.${e7.field}` } : e7;
|
|
633
634
|
});
|
|
634
635
|
};
|
|
635
|
-
var
|
|
636
|
-
let n2 =
|
|
636
|
+
var Pt = (e6, t2) => {
|
|
637
|
+
let n2 = Ft(e6);
|
|
637
638
|
return n2 == null ? e6 : e6.replace(`$[${n2}]`, t2[n2]);
|
|
638
639
|
};
|
|
639
|
-
var
|
|
640
|
+
var Ft = (e6) => {
|
|
640
641
|
let t2 = e6.match(/\$\[(?<argIndex>\d+)\]/);
|
|
641
642
|
return t2 && t2.groups && Number(t2.groups.argIndex);
|
|
642
643
|
};
|
|
643
|
-
function
|
|
644
|
+
function It() {
|
|
644
645
|
let e6 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
645
646
|
if (e6) return { initWixModules(t3, n3) {
|
|
646
|
-
return
|
|
647
|
+
return Lt(() => e6(t3, n3));
|
|
647
648
|
}, fetchWithAuth() {
|
|
648
649
|
throw Error(`fetchWithAuth is not available in this context`);
|
|
649
650
|
}, graphql() {
|
|
650
651
|
throw Error(`graphql is not available in this context`);
|
|
651
652
|
} };
|
|
652
|
-
let t2 = typeof $wixContext < `u` ? $wixContext.client :
|
|
653
|
+
let t2 = typeof $wixContext < `u` ? $wixContext.client : b.client === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.client : b.client, n2 = typeof $wixContext < `u` ? $wixContext.elevatedClient : b.elevatedClient === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.elevatedClient : b.elevatedClient;
|
|
653
654
|
if (t2 || n2) return { initWixModules(e7, r2) {
|
|
654
655
|
if (r2) {
|
|
655
656
|
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`);
|
|
656
|
-
return
|
|
657
|
+
return Lt(() => n2.use(e7));
|
|
657
658
|
}
|
|
658
659
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
659
|
-
return
|
|
660
|
+
return Lt(() => t2.use(e7));
|
|
660
661
|
}, fetchWithAuth: (e7, n3) => {
|
|
661
662
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
662
663
|
return t2.fetchWithAuth(e7, n3);
|
|
@@ -668,110 +669,110 @@ function Ft() {
|
|
|
668
669
|
return t2.graphql(e7, n3, r2);
|
|
669
670
|
} };
|
|
670
671
|
}
|
|
671
|
-
function
|
|
672
|
-
let t2 = globalThis.__wix_context__, n2 = { client:
|
|
673
|
-
globalThis.__wix_context__ = void 0,
|
|
672
|
+
function Lt(e6) {
|
|
673
|
+
let t2 = globalThis.__wix_context__, n2 = { client: b.client, elevatedClient: b.elevatedClient }, r2;
|
|
674
|
+
globalThis.__wix_context__ = void 0, b.client = void 0, b.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
674
675
|
try {
|
|
675
676
|
return e6();
|
|
676
677
|
} finally {
|
|
677
|
-
globalThis.__wix_context__ = t2,
|
|
678
|
+
globalThis.__wix_context__ = t2, b.client = n2.client, b.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
678
679
|
}
|
|
679
680
|
}
|
|
680
|
-
function
|
|
681
|
+
function Rt(e6, t2) {
|
|
681
682
|
return (...n2) => {
|
|
682
|
-
let r2 =
|
|
683
|
+
let r2 = It();
|
|
683
684
|
return r2 ? r2.initWixModules(e6, t2).apply(void 0, n2) : e6.apply(void 0, n2);
|
|
684
685
|
};
|
|
685
686
|
}
|
|
686
687
|
function M(e6, t2 = false) {
|
|
687
|
-
return
|
|
688
|
+
return Rt(e6, t2);
|
|
688
689
|
}
|
|
689
690
|
function N(e6, t2) {
|
|
690
|
-
let n2 =
|
|
691
|
-
return t2 && r2 ? new URLSearchParams({ ".r":
|
|
691
|
+
let n2 = zt(e6), r2 = Object.entries(n2).some(([e7, t3]) => e7.includes(`.`) || Array.isArray(t3) && t3.some((e8) => typeof e8 == `object`));
|
|
692
|
+
return t2 && r2 ? new URLSearchParams({ ".r": Vt(JSON.stringify(e6)) }) : Object.entries(n2).reduce((e7, [t3, n3]) => ((Array.isArray(n3) ? n3 : [n3]).forEach((r3) => {
|
|
692
693
|
r3 == null || Array.isArray(n3) && typeof r3 == `object` || e7.append(t3, r3);
|
|
693
694
|
}), e7), new URLSearchParams());
|
|
694
695
|
}
|
|
695
696
|
function P(e6) {
|
|
696
|
-
let t2 =
|
|
697
|
-
return
|
|
697
|
+
let t2 = en(Qt(e6.host), e6.domainToMappings);
|
|
698
|
+
return un(sn(e6.protoPath, e6.data || {}), t2);
|
|
698
699
|
}
|
|
699
|
-
function
|
|
700
|
+
function zt(e6, t2 = ``) {
|
|
700
701
|
let n2 = {};
|
|
701
702
|
return Object.entries(e6).forEach(([e7, r2]) => {
|
|
702
|
-
let i2 = typeof r2 == `object` && !!r2 && !Array.isArray(r2), a2 =
|
|
703
|
+
let i2 = typeof r2 == `object` && !!r2 && !Array.isArray(r2), a2 = Bt(t2, e7);
|
|
703
704
|
if (i2) {
|
|
704
|
-
let e8 =
|
|
705
|
+
let e8 = zt(r2, a2);
|
|
705
706
|
Object.assign(n2, e8);
|
|
706
707
|
} else n2[a2] = r2;
|
|
707
708
|
}), n2;
|
|
708
709
|
}
|
|
709
|
-
function
|
|
710
|
+
function Bt(e6, t2) {
|
|
710
711
|
return `${e6}${e6 ? `.` : ``}${t2}`;
|
|
711
712
|
}
|
|
712
|
-
var
|
|
713
|
+
var Vt = (e6) => {
|
|
713
714
|
let t2 = new TextEncoder().encode(e6);
|
|
714
715
|
return (typeof btoa < `u` ? btoa(String.fromCodePoint(...t2)) : Buffer.from(e6, `utf-8`).toString(`base64`)).replace(/=/g, ``).replace(/\+/g, `-`).replace(/\//g, `_`);
|
|
715
716
|
};
|
|
716
|
-
var
|
|
717
|
-
var
|
|
718
|
-
var
|
|
719
|
-
var
|
|
720
|
-
var
|
|
721
|
-
var
|
|
722
|
-
var
|
|
723
|
-
var
|
|
724
|
-
var
|
|
725
|
-
var
|
|
726
|
-
function Zt(e6) {
|
|
727
|
-
return Qt(e6).replace(Wt, `._base_domain_`).replace(Yt, `._api_base_domain_`).replace(Xt, `*.dev.wix-code.com`);
|
|
728
|
-
}
|
|
717
|
+
var Ht = [`wix.com`, `editorx.com`];
|
|
718
|
+
var Ut = `_`;
|
|
719
|
+
var Wt = `*.`;
|
|
720
|
+
var Gt = RegExp(`\\.(${Ht.join(`|`)})$`);
|
|
721
|
+
var Kt = [`42.wixprod.net`, `uw2-edt-1.wixprod.net`, `virginia-edt.wixprod.net`];
|
|
722
|
+
var qt = { "payments.base44.com": `manage.wix.com`, "create.editorx.com": `editor.editorx.com` };
|
|
723
|
+
var Jt = `dev.wix-code.com`;
|
|
724
|
+
var Yt = /{(.*)}/;
|
|
725
|
+
var Xt = RegExp(`\\.(${Kt.join(`|`)})$`);
|
|
726
|
+
var Zt = RegExp(`.*\\.${Jt}$`);
|
|
729
727
|
function Qt(e6) {
|
|
730
|
-
return
|
|
728
|
+
return $t(e6).replace(Gt, `._base_domain_`).replace(Xt, `._api_base_domain_`).replace(Zt, `*.dev.wix-code.com`);
|
|
731
729
|
}
|
|
732
|
-
function $t(e6
|
|
730
|
+
function $t(e6) {
|
|
731
|
+
return qt[e6] ?? e6;
|
|
732
|
+
}
|
|
733
|
+
function en(e6, t2) {
|
|
733
734
|
let n2 = t2[e6];
|
|
734
735
|
if (n2) return n2;
|
|
735
|
-
let r2 =
|
|
736
|
+
let r2 = tn(e6, t2) ?? nn(e6, t2);
|
|
736
737
|
if (!r2) {
|
|
737
|
-
if (
|
|
738
|
-
let e7 = t2[
|
|
738
|
+
if (an(e6)) {
|
|
739
|
+
let e7 = t2[on];
|
|
739
740
|
if (e7) return e7;
|
|
740
741
|
}
|
|
741
|
-
let n3 = t2[
|
|
742
|
+
let n3 = t2[Ut];
|
|
742
743
|
if (n3) return n3;
|
|
743
744
|
}
|
|
744
745
|
return r2 ?? [];
|
|
745
746
|
}
|
|
746
|
-
function
|
|
747
|
+
function tn(e6, t2) {
|
|
747
748
|
return Object.entries(t2).find(([t3]) => {
|
|
748
749
|
let [, ...n2] = e6.split(`.`);
|
|
749
750
|
return n2.join(`.`) === t3;
|
|
750
751
|
})?.[1];
|
|
751
752
|
}
|
|
752
|
-
function
|
|
753
|
-
let [n2] = Object.entries(t2).filter(([t3]) =>
|
|
753
|
+
function nn(e6, t2) {
|
|
754
|
+
let [n2] = Object.entries(t2).filter(([t3]) => rn(e6, t3)).sort(([e7], [t3]) => t3.length - e7.length);
|
|
754
755
|
if (!n2) return;
|
|
755
756
|
let [, r2] = n2;
|
|
756
757
|
return r2;
|
|
757
758
|
}
|
|
758
|
-
function
|
|
759
|
-
if (!t2.startsWith(
|
|
759
|
+
function rn(e6, t2) {
|
|
760
|
+
if (!t2.startsWith(Wt)) return false;
|
|
760
761
|
let n2 = t2.slice(1);
|
|
761
762
|
return e6.length > n2.length && e6.endsWith(n2);
|
|
762
763
|
}
|
|
763
|
-
function
|
|
764
|
+
function an(e6) {
|
|
764
765
|
return !!e6.match(/\._base_domain_$/);
|
|
765
766
|
}
|
|
766
|
-
var
|
|
767
|
-
function on(e6, t2) {
|
|
768
|
-
return e6.split(`/`).map((e7) => sn(e7, t2)).join(`/`);
|
|
769
|
-
}
|
|
767
|
+
var on = `www._base_domain_`;
|
|
770
768
|
function sn(e6, t2) {
|
|
771
|
-
|
|
772
|
-
|
|
769
|
+
return e6.split(`/`).map((e7) => cn(e7, t2)).join(`/`);
|
|
770
|
+
}
|
|
771
|
+
function cn(e6, t2) {
|
|
772
|
+
let n2 = e6.match(Yt) || [], r2 = n2[1];
|
|
773
|
+
return r2 ? ln(t2, r2, e6, e6.replace(n2[0], ``)) : e6;
|
|
773
774
|
}
|
|
774
|
-
function
|
|
775
|
+
function ln(e6, t2, n2, r2) {
|
|
775
776
|
let i2 = e6;
|
|
776
777
|
for (let e7 of t2.split(`.`)) {
|
|
777
778
|
if (!i2) return n2;
|
|
@@ -779,14 +780,14 @@ function cn(e6, t2, n2, r2) {
|
|
|
779
780
|
}
|
|
780
781
|
return `${i2}${r2}`;
|
|
781
782
|
}
|
|
782
|
-
function
|
|
783
|
+
function un(e6, t2) {
|
|
783
784
|
let n2 = t2?.find((t3) => e6.startsWith(t3.destPath));
|
|
784
785
|
return n2 ? n2.srcPath + e6.slice(n2.destPath.length) : e6;
|
|
785
786
|
}
|
|
786
|
-
function
|
|
787
|
+
function dn(e6) {
|
|
787
788
|
return isFinite(e6) ? e6 : e6.toString();
|
|
788
789
|
}
|
|
789
|
-
function
|
|
790
|
+
function F(e6) {
|
|
790
791
|
return e6 === `NaN` ? NaN : e6 === `Infinity` ? 1 / 0 : e6 === `-Infinity` ? -1 / 0 : e6;
|
|
791
792
|
}
|
|
792
793
|
function fn(e6) {
|
|
@@ -908,7 +909,7 @@ var An = En({ createHost: function(e6) {
|
|
|
908
909
|
} });
|
|
909
910
|
var jn = (e6, t2) => {
|
|
910
911
|
let n2 = An.host({ applicationId: e6, componentId: t2 }), r2 = An.auth();
|
|
911
|
-
return
|
|
912
|
+
return Ye({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
|
|
912
913
|
};
|
|
913
914
|
var Mn = (e6) => jn(`14bcded7-0066-7c35-14d7-466cb3f09103`, e6);
|
|
914
915
|
function Nn() {
|
|
@@ -920,7 +921,7 @@ function Nn() {
|
|
|
920
921
|
}, graphql() {
|
|
921
922
|
throw Error(`graphql is not available in this context`);
|
|
922
923
|
} };
|
|
923
|
-
let t2 = typeof $wixContext < `u` ? $wixContext.client :
|
|
924
|
+
let t2 = typeof $wixContext < `u` ? $wixContext.client : b.client === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.client : b.client, n2 = typeof $wixContext < `u` ? $wixContext.elevatedClient : b.elevatedClient === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.elevatedClient : b.elevatedClient;
|
|
924
925
|
if (t2 || n2) return { initWixModules(e7, r2) {
|
|
925
926
|
if (r2) {
|
|
926
927
|
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`);
|
|
@@ -940,12 +941,12 @@ function Nn() {
|
|
|
940
941
|
} };
|
|
941
942
|
}
|
|
942
943
|
function Pn(e6) {
|
|
943
|
-
let t2 = globalThis.__wix_context__, n2 = { client:
|
|
944
|
-
globalThis.__wix_context__ = void 0,
|
|
944
|
+
let t2 = globalThis.__wix_context__, n2 = { client: b.client, elevatedClient: b.elevatedClient }, r2;
|
|
945
|
+
globalThis.__wix_context__ = void 0, b.client = void 0, b.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
945
946
|
try {
|
|
946
947
|
return e6();
|
|
947
948
|
} finally {
|
|
948
|
-
globalThis.__wix_context__ = t2,
|
|
949
|
+
globalThis.__wix_context__ = t2, b.client = n2.client, b.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
949
950
|
}
|
|
950
951
|
}
|
|
951
952
|
function Fn(e6, t2) {
|
|
@@ -1006,10 +1007,10 @@ function Un(e6, t2, n2) {
|
|
|
1006
1007
|
}
|
|
1007
1008
|
return a2;
|
|
1008
1009
|
}
|
|
1009
|
-
function
|
|
1010
|
+
function I(e6) {
|
|
1010
1011
|
return e6;
|
|
1011
1012
|
}
|
|
1012
|
-
var Wn =
|
|
1013
|
+
var Wn = I(`@wix/site-service-rendering-context`);
|
|
1013
1014
|
var Gn = () => {
|
|
1014
1015
|
try {
|
|
1015
1016
|
return m(Wn).SSR;
|
|
@@ -1026,7 +1027,7 @@ function qn(e6, t2) {
|
|
|
1026
1027
|
o(() => r2({ deps: t2, value: i2 }));
|
|
1027
1028
|
}, t2), n2.value;
|
|
1028
1029
|
}
|
|
1029
|
-
var Jn =
|
|
1030
|
+
var Jn = I(`@wix/viewer-service-site-members`);
|
|
1030
1031
|
var Yn = () => {
|
|
1031
1032
|
try {
|
|
1032
1033
|
return m(Jn);
|
|
@@ -1053,7 +1054,7 @@ var Xn = (e6, t2) => {
|
|
|
1053
1054
|
};
|
|
1054
1055
|
}, [a2, t2, n2]), u(() => a2 && r2 && r2._id === e6.post?._id ? { ...e6, post: r2, paywall: void 0 } : e6, [a2, r2, e6]);
|
|
1055
1056
|
};
|
|
1056
|
-
var Zn =
|
|
1057
|
+
var Zn = I(`@wix/site-service-url`);
|
|
1057
1058
|
var Qn = `14bcded7-0066-7c35-14d7-466cb3f09103`;
|
|
1058
1059
|
var $n = `post`;
|
|
1059
1060
|
var er = `category`;
|
|
@@ -1139,7 +1140,7 @@ var mr = (e6, t2, n2) => {
|
|
|
1139
1140
|
}
|
|
1140
1141
|
}, [e6, t2, n2]);
|
|
1141
1142
|
};
|
|
1142
|
-
var hr =
|
|
1143
|
+
var hr = I(`@wix/site-service-warmup-data`);
|
|
1143
1144
|
function gr() {
|
|
1144
1145
|
let e6 = Gn(), t2 = null;
|
|
1145
1146
|
try {
|
|
@@ -1184,8 +1185,8 @@ var yr = ({ isDev: e6, loadMessages: t2, loadDevMessages: n2 }) => {
|
|
|
1184
1185
|
};
|
|
1185
1186
|
return (e7) => r2.getOrInsert(e7, () => i2(e7));
|
|
1186
1187
|
};
|
|
1187
|
-
var
|
|
1188
|
-
var
|
|
1188
|
+
var L = (e6) => typeof e6 == `string`;
|
|
1189
|
+
var R = () => {
|
|
1189
1190
|
let e6, t2, n2 = new Promise((n3, r2) => {
|
|
1190
1191
|
e6 = n3, t2 = r2;
|
|
1191
1192
|
});
|
|
@@ -1199,9 +1200,9 @@ var xr = (e6, t2, n2) => {
|
|
|
1199
1200
|
};
|
|
1200
1201
|
var Sr = /###/g;
|
|
1201
1202
|
var Cr = (e6) => e6 && e6.includes(`###`) ? e6.replace(Sr, `.`) : e6;
|
|
1202
|
-
var wr = (e6) => !e6 ||
|
|
1203
|
-
var
|
|
1204
|
-
let r2 =
|
|
1203
|
+
var wr = (e6) => !e6 || L(e6);
|
|
1204
|
+
var z = (e6, t2, n2) => {
|
|
1205
|
+
let r2 = L(t2) ? t2.split(`.`) : t2, i2 = 0;
|
|
1205
1206
|
for (; i2 < r2.length - 1; ) {
|
|
1206
1207
|
if (wr(e6)) return {};
|
|
1207
1208
|
let t3 = Cr(r2[i2]);
|
|
@@ -1210,21 +1211,21 @@ var R = (e6, t2, n2) => {
|
|
|
1210
1211
|
return wr(e6) ? {} : { obj: e6, k: Cr(r2[i2]) };
|
|
1211
1212
|
};
|
|
1212
1213
|
var Tr = (e6, t2, n2) => {
|
|
1213
|
-
let { obj: r2, k: i2 } =
|
|
1214
|
+
let { obj: r2, k: i2 } = z(e6, t2, Object);
|
|
1214
1215
|
if (r2 !== void 0 || t2.length === 1) {
|
|
1215
1216
|
r2[i2] = n2;
|
|
1216
1217
|
return;
|
|
1217
1218
|
}
|
|
1218
|
-
let a2 = t2[t2.length - 1], o2 = t2.slice(0, t2.length - 1), s2 =
|
|
1219
|
-
for (; s2.obj === void 0 && o2.length; ) a2 = `${o2[o2.length - 1]}.${a2}`, o2 = o2.slice(0, o2.length - 1), s2 =
|
|
1219
|
+
let a2 = t2[t2.length - 1], o2 = t2.slice(0, t2.length - 1), s2 = z(e6, o2, Object);
|
|
1220
|
+
for (; s2.obj === void 0 && o2.length; ) a2 = `${o2[o2.length - 1]}.${a2}`, o2 = o2.slice(0, o2.length - 1), s2 = z(e6, o2, Object), s2?.obj && s2.obj[`${s2.k}.${a2}`] !== void 0 && (s2.obj = void 0);
|
|
1220
1221
|
s2.obj[`${s2.k}.${a2}`] = n2;
|
|
1221
1222
|
};
|
|
1222
1223
|
var Er = (e6, t2, n2, r2) => {
|
|
1223
|
-
let { obj: i2, k: a2 } =
|
|
1224
|
+
let { obj: i2, k: a2 } = z(e6, t2, Object);
|
|
1224
1225
|
i2[a2] = i2[a2] || [], i2[a2].push(n2);
|
|
1225
1226
|
};
|
|
1226
1227
|
var Dr = (e6, t2) => {
|
|
1227
|
-
let { obj: n2, k: r2 } =
|
|
1228
|
+
let { obj: n2, k: r2 } = z(e6, t2);
|
|
1228
1229
|
if (n2 && Object.prototype.hasOwnProperty.call(n2, r2)) return n2[r2];
|
|
1229
1230
|
};
|
|
1230
1231
|
var Or = (e6, t2, n2) => {
|
|
@@ -1232,12 +1233,12 @@ var Or = (e6, t2, n2) => {
|
|
|
1232
1233
|
return r2 === void 0 ? Dr(t2, n2) : r2;
|
|
1233
1234
|
};
|
|
1234
1235
|
var kr = (e6, t2, n2) => {
|
|
1235
|
-
for (let r2 in t2) r2 !== `__proto__` && r2 !== `constructor` && (Object.prototype.hasOwnProperty.call(e6, r2) ?
|
|
1236
|
+
for (let r2 in t2) r2 !== `__proto__` && r2 !== `constructor` && (Object.prototype.hasOwnProperty.call(e6, r2) ? L(e6[r2]) || e6[r2] instanceof String || L(t2[r2]) || t2[r2] instanceof String ? n2 && (e6[r2] = t2[r2]) : kr(e6[r2], t2[r2], n2) : e6[r2] = t2[r2]);
|
|
1236
1237
|
return e6;
|
|
1237
1238
|
};
|
|
1238
|
-
var
|
|
1239
|
+
var B = (e6) => e6.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, `\\$&`);
|
|
1239
1240
|
var Ar = { "&": `&`, "<": `<`, ">": `>`, '"': `"`, "'": `'`, "/": `/` };
|
|
1240
|
-
var jr = (e6) =>
|
|
1241
|
+
var jr = (e6) => L(e6) ? e6.replace(/[&<>"'\/]/g, (e7) => Ar[e7]) : e6;
|
|
1241
1242
|
var Mr = class {
|
|
1242
1243
|
constructor(e6) {
|
|
1243
1244
|
this.capacity = e6, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
|
|
@@ -1278,7 +1279,7 @@ var Ir = (e6, t2, n2 = `.`) => {
|
|
|
1278
1279
|
}
|
|
1279
1280
|
return i2;
|
|
1280
1281
|
};
|
|
1281
|
-
var
|
|
1282
|
+
var V = (e6) => e6?.replace(/_/g, `-`);
|
|
1282
1283
|
var Lr = { type: `logger`, log(e6) {
|
|
1283
1284
|
this.output(`log`, e6);
|
|
1284
1285
|
}, warn(e6) {
|
|
@@ -1288,7 +1289,7 @@ var Lr = { type: `logger`, log(e6) {
|
|
|
1288
1289
|
}, output(e6, t2) {
|
|
1289
1290
|
console?.[e6]?.apply?.(console, t2);
|
|
1290
1291
|
} };
|
|
1291
|
-
var
|
|
1292
|
+
var H = new class e2 {
|
|
1292
1293
|
constructor(e6, t2 = {}) {
|
|
1293
1294
|
this.init(e6, t2);
|
|
1294
1295
|
}
|
|
@@ -1308,7 +1309,7 @@ var V = new class e2 {
|
|
|
1308
1309
|
return this.forward(e6, `warn`, `WARNING DEPRECATED: `, true);
|
|
1309
1310
|
}
|
|
1310
1311
|
forward(e6, t2, n2, r2) {
|
|
1311
|
-
return r2 && !this.debug ? null : (e6 = e6.map((e7) =>
|
|
1312
|
+
return r2 && !this.debug ? null : (e6 = e6.map((e7) => L(e7) ? e7.replace(/[\r\n\x00-\x1F\x7F]/g, ` `) : e7), L(e6[0]) && (e6[0] = `${n2}${this.prefix} ${e6[0]}`), this.logger[t2](e6));
|
|
1312
1313
|
}
|
|
1313
1314
|
create(t2) {
|
|
1314
1315
|
return new e2(this.logger, { prefix: `${this.prefix}:${t2}:`, ...this.options });
|
|
@@ -1359,16 +1360,16 @@ var Br = class extends Rr {
|
|
|
1359
1360
|
}
|
|
1360
1361
|
getResource(e6, t2, n2, r2 = {}) {
|
|
1361
1362
|
let i2 = r2.keySeparator === void 0 ? this.options.keySeparator : r2.keySeparator, a2 = r2.ignoreJSONStructure === void 0 ? this.options.ignoreJSONStructure : r2.ignoreJSONStructure, o2;
|
|
1362
|
-
e6.includes(`.`) ? o2 = e6.split(`.`) : (o2 = [e6, t2], n2 && (Array.isArray(n2) ? o2.push(...n2) :
|
|
1363
|
+
e6.includes(`.`) ? o2 = e6.split(`.`) : (o2 = [e6, t2], n2 && (Array.isArray(n2) ? o2.push(...n2) : L(n2) && i2 ? o2.push(...n2.split(i2)) : o2.push(n2)));
|
|
1363
1364
|
let s2 = Dr(this.data, o2);
|
|
1364
|
-
return !s2 && !t2 && !n2 && e6.includes(`.`) && (e6 = o2[0], t2 = o2[1], n2 = o2.slice(2).join(`.`)), s2 || !a2 || !
|
|
1365
|
+
return !s2 && !t2 && !n2 && e6.includes(`.`) && (e6 = o2[0], t2 = o2[1], n2 = o2.slice(2).join(`.`)), s2 || !a2 || !L(n2) ? s2 : Ir(this.data?.[e6]?.[t2], n2, i2);
|
|
1365
1366
|
}
|
|
1366
1367
|
addResource(e6, t2, n2, r2, i2 = { silent: false }) {
|
|
1367
1368
|
let a2 = i2.keySeparator === void 0 ? this.options.keySeparator : i2.keySeparator, o2 = [e6, t2];
|
|
1368
1369
|
n2 && (o2 = o2.concat(a2 ? n2.split(a2) : n2)), e6.includes(`.`) && (o2 = e6.split(`.`), r2 = t2, t2 = o2[1]), this.addNamespaces(t2), Tr(this.data, o2, r2), i2.silent || this.emit(`added`, e6, t2, n2, r2);
|
|
1369
1370
|
}
|
|
1370
1371
|
addResources(e6, t2, n2, r2 = { silent: false }) {
|
|
1371
|
-
for (let r3 in n2) (
|
|
1372
|
+
for (let r3 in n2) (L(n2[r3]) || Array.isArray(n2[r3])) && this.addResource(e6, t2, r3, n2[r3], { silent: true });
|
|
1372
1373
|
r2.silent || this.emit(`added`, e6, t2, n2);
|
|
1373
1374
|
}
|
|
1374
1375
|
addResourceBundle(e6, t2, n2, r2, i2, a2 = { silent: false, skipCopy: false }) {
|
|
@@ -1412,7 +1413,7 @@ function Ur() {
|
|
|
1412
1413
|
let e6 = [], t2 = /* @__PURE__ */ Object.create(null), n2;
|
|
1413
1414
|
return t2.get = (r2, i2) => (n2?.revoke?.(), i2 === Hr ? e6 : (e6.push(i2), n2 = Proxy.revocable(r2, t2), n2.proxy)), Proxy.revocable(/* @__PURE__ */ Object.create(null), t2).proxy;
|
|
1414
1415
|
}
|
|
1415
|
-
function
|
|
1416
|
+
function U(e6, t2) {
|
|
1416
1417
|
let { [Hr]: n2 } = e6(Ur()), r2 = t2?.keySeparator ?? `.`, i2 = t2?.nsSeparator ?? `:`, a2 = t2?.enableSelector === `strict`;
|
|
1417
1418
|
if (n2.length > 1 && i2) {
|
|
1418
1419
|
let e7 = t2?.ns, o2 = a2 ? Array.isArray(e7) ? e7 : e7 ? [e7] : null : Array.isArray(e7) ? e7 : null;
|
|
@@ -1420,10 +1421,10 @@ function H(e6, t2) {
|
|
|
1420
1421
|
}
|
|
1421
1422
|
return n2.join(r2);
|
|
1422
1423
|
}
|
|
1423
|
-
var Wr = (e6) => !
|
|
1424
|
+
var Wr = (e6) => !L(e6) && typeof e6 != `boolean` && typeof e6 != `number`;
|
|
1424
1425
|
var Gr = class e3 extends Rr {
|
|
1425
1426
|
constructor(e6, t2 = {}) {
|
|
1426
|
-
super(), xr([`resourceStore`, `languageUtils`, `pluralResolver`, `interpolator`, `backendConnector`, `i18nFormat`, `utils`], e6, this), this.options = t2, this.options.keySeparator === void 0 && (this.options.keySeparator = `.`), this.logger =
|
|
1427
|
+
super(), xr([`resourceStore`, `languageUtils`, `pluralResolver`, `interpolator`, `backendConnector`, `i18nFormat`, `utils`], e6, this), this.options = t2, this.options.keySeparator === void 0 && (this.options.keySeparator = `.`), this.logger = H.create(`translator`), this.checkedLoadedFor = {};
|
|
1427
1428
|
}
|
|
1428
1429
|
changeLanguage(e6) {
|
|
1429
1430
|
e6 && (this.language = e6);
|
|
@@ -1442,24 +1443,24 @@ var Gr = class e3 extends Rr {
|
|
|
1442
1443
|
let r2 = t2.keySeparator === void 0 ? this.options.keySeparator : t2.keySeparator, i2 = t2.ns || this.options.defaultNS || [], a2 = n2 && e6.includes(n2), o2 = !this.options.userDefinedKeySeparator && !t2.keySeparator && !this.options.userDefinedNsSeparator && !t2.nsSeparator && !Fr(e6, n2, r2);
|
|
1443
1444
|
if (a2 && !o2) {
|
|
1444
1445
|
let t3 = e6.match(this.interpolator.nestingRegexp);
|
|
1445
|
-
if (t3 && t3.length > 0) return { key: e6, namespaces:
|
|
1446
|
+
if (t3 && t3.length > 0) return { key: e6, namespaces: L(i2) ? [i2] : i2 };
|
|
1446
1447
|
let a3 = e6.split(n2);
|
|
1447
1448
|
(n2 !== r2 || n2 === r2 && this.options.ns.includes(a3[0])) && (i2 = a3.shift()), e6 = a3.join(r2);
|
|
1448
1449
|
}
|
|
1449
|
-
return { key: e6, namespaces:
|
|
1450
|
+
return { key: e6, namespaces: L(i2) ? [i2] : i2 };
|
|
1450
1451
|
}
|
|
1451
1452
|
translate(t2, n2, r2) {
|
|
1452
1453
|
let i2 = typeof n2 == `object` ? { ...n2 } : n2;
|
|
1453
1454
|
if (typeof i2 != `object` && this.options.overloadTranslationOptionHandler && (i2 = this.options.overloadTranslationOptionHandler(arguments)), typeof i2 == `object` && (i2 = { ...i2 }), i2 ||= {}, t2 == null) return ``;
|
|
1454
|
-
typeof t2 == `function` && (t2 =
|
|
1455
|
+
typeof t2 == `function` && (t2 = U(t2, { ...this.options, ...i2 })), Array.isArray(t2) || (t2 = [String(t2)]), t2 = t2.map((e6) => typeof e6 == `function` ? U(e6, { ...this.options, ...i2 }) : String(e6));
|
|
1455
1456
|
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;
|
|
1456
1457
|
u2 === void 0 && (u2 = `:`);
|
|
1457
1458
|
let d2 = i2.lng || this.language, f2 = i2.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
|
|
1458
1459
|
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;
|
|
1459
|
-
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 && !
|
|
1460
|
+
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 && !L(i2.count), x2 = e3.hasDefaultValue(i2), S2 = b2 ? this.pluralResolver.getSuffix(d2, i2.count, i2) : ``, C2 = i2.ordinal && b2 ? this.pluralResolver.getSuffix(d2, i2.count, { ordinal: false }) : ``, ee2 = b2 && !i2.ordinal && i2.count === 0, w2 = ee2 && i2[`defaultValue${this.options.pluralSeparator}zero`] || i2[`defaultValue${S2}`] || i2[`defaultValue${C2}`] || i2.defaultValue, T2 = m2;
|
|
1460
1461
|
y2 && !m2 && x2 && (T2 = w2);
|
|
1461
1462
|
let te2 = Wr(T2), ne2 = Object.prototype.toString.apply(T2);
|
|
1462
|
-
if (y2 && T2 && te2 && !_2.includes(ne2) && !(
|
|
1463
|
+
if (y2 && T2 && te2 && !_2.includes(ne2) && !(L(v2) && Array.isArray(T2))) {
|
|
1463
1464
|
if (!i2.returnObjects && !this.options.returnObjects) {
|
|
1464
1465
|
this.options.returnedObjectHandler || this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);
|
|
1465
1466
|
let e6 = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(h2, T2, { ...i2, ns: c2 }) : `key '${s2} (${this.language})' returned an object instead of string.`;
|
|
@@ -1473,7 +1474,7 @@ var Gr = class e3 extends Rr {
|
|
|
1473
1474
|
}
|
|
1474
1475
|
m2 = t3;
|
|
1475
1476
|
}
|
|
1476
|
-
} else if (y2 &&
|
|
1477
|
+
} else if (y2 && L(v2) && Array.isArray(m2)) m2 = m2.join(v2), m2 &&= this.extendTranslation(m2, t2, i2, r2);
|
|
1477
1478
|
else {
|
|
1478
1479
|
let e6 = false, n3 = false;
|
|
1479
1480
|
!this.isValidLookup(m2) && x2 && (e6 = true, m2 = w2), this.isValidLookup(m2) || (n3 = true, m2 = s2);
|
|
@@ -1505,30 +1506,30 @@ var Gr = class e3 extends Rr {
|
|
|
1505
1506
|
if (this.i18nFormat?.parse) e6 = this.i18nFormat.parse(e6, { ...this.options.interpolation.defaultVariables, ...n2 }, n2.lng || this.language || r2.usedLng, r2.usedNS, r2.usedKey, { resolved: r2 });
|
|
1506
1507
|
else if (!n2.skipInterpolation) {
|
|
1507
1508
|
n2.interpolation && this.interpolator.init({ ...n2, interpolation: { ...this.options.interpolation, ...n2.interpolation } });
|
|
1508
|
-
let a3 =
|
|
1509
|
+
let a3 = L(e6) && (n2?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : n2.interpolation.skipOnVariables), o3;
|
|
1509
1510
|
if (a3) {
|
|
1510
1511
|
let t3 = e6.match(this.interpolator.nestingRegexp);
|
|
1511
1512
|
o3 = t3 && t3.length;
|
|
1512
1513
|
}
|
|
1513
|
-
let s2 = n2.replace && !
|
|
1514
|
+
let s2 = n2.replace && !L(n2.replace) ? n2.replace : n2;
|
|
1514
1515
|
if (this.options.interpolation.defaultVariables && (s2 = { ...this.options.interpolation.defaultVariables, ...s2 }), e6 = this.interpolator.interpolate(e6, s2, n2.lng || this.language || r2.usedLng, n2), a3) {
|
|
1515
1516
|
let t3 = e6.match(this.interpolator.nestingRegexp), r3 = t3 && t3.length;
|
|
1516
1517
|
o3 < r3 && (n2.nest = false);
|
|
1517
1518
|
}
|
|
1518
1519
|
!n2.lng && r2 && r2.res && (n2.lng = this.language || r2.usedLng), n2.nest !== false && (e6 = this.interpolator.nest(e6, (...e7) => i2?.[0] === e7[0] && !n2.context ? (this.logger.warn(`It seems you are nesting recursively key: ${e7[0]} in key: ${t2[0]}`), null) : this.translate(...e7, t2), n2)), n2.interpolation && this.interpolator.reset();
|
|
1519
1520
|
}
|
|
1520
|
-
let a2 = n2.postProcess || this.options.postProcess, o2 =
|
|
1521
|
+
let a2 = n2.postProcess || this.options.postProcess, o2 = L(a2) ? [a2] : a2;
|
|
1521
1522
|
return e6 != null && o2?.length && n2.applyPostProcessor !== false && (e6 = Vr.handle(o2, e6, t2, this.options && this.options.postProcessPassResolved ? { i18nResolved: { ...r2, usedParams: this.getUsedParamsDetails(n2) }, ...n2 } : n2, this)), e6;
|
|
1522
1523
|
}
|
|
1523
1524
|
resolve(e6, t2 = {}) {
|
|
1524
1525
|
let n2, r2, i2, a2, o2;
|
|
1525
|
-
return
|
|
1526
|
+
return L(e6) && (e6 = [e6]), Array.isArray(e6) && (e6 = e6.map((e7) => typeof e7 == `function` ? U(e7, { ...this.options, ...t2 }) : e7)), e6.forEach((e7) => {
|
|
1526
1527
|
if (this.isValidLookup(n2)) return;
|
|
1527
1528
|
let s2 = this.extractFromKey(e7, t2), c2 = s2.key;
|
|
1528
1529
|
r2 = c2;
|
|
1529
1530
|
let l2 = s2.namespaces;
|
|
1530
1531
|
this.options.fallbackNS && (l2 = l2.concat(this.options.fallbackNS));
|
|
1531
|
-
let u2 = t2.count !== void 0 && !
|
|
1532
|
+
let u2 = t2.count !== void 0 && !L(t2.count), d2 = u2 && !t2.ordinal && t2.count === 0, f2 = t2.context !== void 0 && (L(t2.context) || typeof t2.context == `number`) && t2.context !== ``, p2 = t2.lngs ? t2.lngs : this.languageUtils.toResolveHierarchy(t2.lng || this.language, t2.fallbackLng);
|
|
1532
1533
|
l2.forEach((e8) => {
|
|
1533
1534
|
this.isValidLookup(n2) || (o2 = e8, !this.checkedLoadedFor[`${p2[0]}-${e8}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(o2) && (this.checkedLoadedFor[`${p2[0]}-${e8}`] = 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) => {
|
|
1534
1535
|
if (this.isValidLookup(n2)) return;
|
|
@@ -1557,7 +1558,7 @@ var Gr = class e3 extends Rr {
|
|
|
1557
1558
|
return this.i18nFormat?.getResource ? this.i18nFormat.getResource(e6, t2, n2, r2) : this.resourceStore.getResource(e6, t2, n2, r2);
|
|
1558
1559
|
}
|
|
1559
1560
|
getUsedParamsDetails(e6 = {}) {
|
|
1560
|
-
let t2 = [`defaultValue`, `ordinal`, `context`, `replace`, `lng`, `lngs`, `fallbackLng`, `ns`, `keySeparator`, `nsSeparator`, `returnObjects`, `returnDetails`, `joinArrays`, `postProcess`, `interpolation`], n2 = e6.replace && !
|
|
1561
|
+
let t2 = [`defaultValue`, `ordinal`, `context`, `replace`, `lng`, `lngs`, `fallbackLng`, `ns`, `keySeparator`, `nsSeparator`, `returnObjects`, `returnDetails`, `joinArrays`, `postProcess`, `interpolation`], n2 = e6.replace && !L(e6.replace), r2 = n2 ? e6.replace : e6;
|
|
1561
1562
|
if (n2 && e6.count !== void 0 && (r2 = { ...r2, count: e6.count }), this.options.interpolation.defaultVariables && (r2 = { ...this.options.interpolation.defaultVariables, ...r2 }), !n2) {
|
|
1562
1563
|
r2 = { ...r2 };
|
|
1563
1564
|
for (let e7 of t2) delete r2[e7];
|
|
@@ -1571,23 +1572,23 @@ var Gr = class e3 extends Rr {
|
|
|
1571
1572
|
};
|
|
1572
1573
|
var Kr = class {
|
|
1573
1574
|
constructor(e6) {
|
|
1574
|
-
this.options = e6, this.supportedLngs = this.options.supportedLngs || false, this.logger =
|
|
1575
|
+
this.options = e6, this.supportedLngs = this.options.supportedLngs || false, this.logger = H.create(`languageUtils`), this.resolveHierarchyCache = {};
|
|
1575
1576
|
}
|
|
1576
1577
|
clearCache() {
|
|
1577
1578
|
this.resolveHierarchyCache = {};
|
|
1578
1579
|
}
|
|
1579
1580
|
getScriptPartFromCode(e6) {
|
|
1580
|
-
if (e6 =
|
|
1581
|
+
if (e6 = V(e6), !e6 || !e6.includes(`-`)) return null;
|
|
1581
1582
|
let t2 = e6.split(`-`);
|
|
1582
1583
|
return t2.length === 2 || (t2.pop(), t2[t2.length - 1].toLowerCase() === `x`) ? null : this.formatLanguageCode(t2.join(`-`));
|
|
1583
1584
|
}
|
|
1584
1585
|
getLanguagePartFromCode(e6) {
|
|
1585
|
-
if (e6 =
|
|
1586
|
+
if (e6 = V(e6), !e6 || !e6.includes(`-`)) return e6;
|
|
1586
1587
|
let t2 = e6.split(`-`);
|
|
1587
1588
|
return this.formatLanguageCode(t2[0]);
|
|
1588
1589
|
}
|
|
1589
1590
|
formatLanguageCode(e6) {
|
|
1590
|
-
if (
|
|
1591
|
+
if (L(e6) && e6.includes(`-`)) {
|
|
1591
1592
|
let t2;
|
|
1592
1593
|
try {
|
|
1593
1594
|
t2 = Intl.getCanonicalLocales(e6)[0];
|
|
@@ -1618,7 +1619,7 @@ var Kr = class {
|
|
|
1618
1619
|
}
|
|
1619
1620
|
getFallbackCodes(e6, t2) {
|
|
1620
1621
|
if (!e6) return [];
|
|
1621
|
-
if (typeof e6 == `function` && (e6 = e6(t2)),
|
|
1622
|
+
if (typeof e6 == `function` && (e6 = e6(t2)), L(e6) && (e6 = [e6]), Array.isArray(e6)) return e6;
|
|
1622
1623
|
if (!t2) return e6.default || [];
|
|
1623
1624
|
let n2 = e6[t2];
|
|
1624
1625
|
return n2 ||= e6[this.getScriptPartFromCode(t2)], n2 ||= e6[this.formatLanguageCode(t2)], n2 ||= e6[this.getLanguagePartFromCode(t2)], n2 ||= e6.default, n2 || [];
|
|
@@ -1626,7 +1627,7 @@ var Kr = class {
|
|
|
1626
1627
|
toResolveHierarchy(e6, t2) {
|
|
1627
1628
|
let n2 = this.options.fallbackLng, r2 = Array.isArray(n2) ? n2.join(`|`) : n2;
|
|
1628
1629
|
r2 !== this._cachedFallbackLng && (this.resolveHierarchyCache = {}, this._cachedFallbackLng = r2);
|
|
1629
|
-
let i2 = t2 === void 0 || t2 === false ||
|
|
1630
|
+
let i2 = t2 === void 0 || t2 === false || L(t2), a2 = t2 === void 0 && typeof this.options.fallbackLng == `function`, o2 = L(e6) && i2 && !a2, s2 = null;
|
|
1630
1631
|
if (o2) {
|
|
1631
1632
|
let n3;
|
|
1632
1633
|
n3 = t2 === void 0 ? `undefined` : t2 === false ? `boolean:false` : `string:${t2}`, s2 = `${e6.length}:${e6}|${n3}`;
|
|
@@ -1638,8 +1639,9 @@ var Kr = class {
|
|
|
1638
1639
|
let c2 = this.getFallbackCodes((t2 === false ? [] : t2) || this.options.fallbackLng || [], e6), l2 = [], u2 = (e7) => {
|
|
1639
1640
|
e7 && (this.isSupportedCode(e7) ? l2.push(e7) : this.logger.warn(`rejecting language code not found in supportedLngs: ${e7}`));
|
|
1640
1641
|
};
|
|
1641
|
-
return
|
|
1642
|
-
|
|
1642
|
+
return L(e6) && (e6.includes(`-`) || e6.includes(`_`)) ? (this.options.load !== `languageOnly` && u2(this.formatLanguageCode(e6)), this.options.load !== `languageOnly` && this.options.load !== `currentOnly` && u2(this.getScriptPartFromCode(e6)), this.options.load !== `currentOnly` && u2(this.getLanguagePartFromCode(e6))) : L(e6) && u2(this.formatLanguageCode(e6)), c2.forEach((e7) => {
|
|
1643
|
+
let t3 = this.formatLanguageCode(e7);
|
|
1644
|
+
l2.includes(t3) || u2(t3);
|
|
1643
1645
|
}), s2 === null ? l2 : (this.resolveHierarchyCache[s2] = l2, l2.slice());
|
|
1644
1646
|
}
|
|
1645
1647
|
};
|
|
@@ -1647,13 +1649,13 @@ var qr = { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 };
|
|
|
1647
1649
|
var Jr = { select: (e6) => e6 === 1 ? `one` : `other`, resolvedOptions: () => ({ pluralCategories: [`one`, `other`] }) };
|
|
1648
1650
|
var Yr = class {
|
|
1649
1651
|
constructor(e6, t2 = {}) {
|
|
1650
|
-
this.languageUtils = e6, this.options = t2, this.logger =
|
|
1652
|
+
this.languageUtils = e6, this.options = t2, this.logger = H.create(`pluralResolver`), this.pluralRulesCache = {};
|
|
1651
1653
|
}
|
|
1652
1654
|
clearCache() {
|
|
1653
1655
|
this.pluralRulesCache = {};
|
|
1654
1656
|
}
|
|
1655
1657
|
getRule(e6, t2 = {}) {
|
|
1656
|
-
let n2 =
|
|
1658
|
+
let n2 = V(e6 === `dev` ? `en` : e6), r2 = t2.ordinal ? `ordinal` : `cardinal`, i2 = JSON.stringify({ cleanedCode: n2, type: r2 });
|
|
1657
1659
|
if (i2 in this.pluralRulesCache) return this.pluralRulesCache[i2];
|
|
1658
1660
|
let a2;
|
|
1659
1661
|
try {
|
|
@@ -1684,17 +1686,17 @@ var Yr = class {
|
|
|
1684
1686
|
};
|
|
1685
1687
|
var Xr = (e6, t2, n2, r2 = `.`, i2 = true) => {
|
|
1686
1688
|
let a2 = Or(e6, t2, n2);
|
|
1687
|
-
return !a2 && i2 &&
|
|
1689
|
+
return !a2 && i2 && L(n2) && (a2 = Ir(e6, n2, r2), a2 === void 0 && (a2 = Ir(t2, n2, r2))), a2;
|
|
1688
1690
|
};
|
|
1689
1691
|
var Zr = (e6) => e6.replace(/\$/g, `$$$$`);
|
|
1690
1692
|
var Qr = class {
|
|
1691
1693
|
constructor(e6 = {}) {
|
|
1692
|
-
this.logger =
|
|
1694
|
+
this.logger = H.create(`interpolator`), this.options = e6, this.format = e6?.interpolation?.format || ((e7) => e7), this.init(e6);
|
|
1693
1695
|
}
|
|
1694
1696
|
init(e6 = {}) {
|
|
1695
1697
|
e6.interpolation ||= { escapeValue: true };
|
|
1696
1698
|
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 } = e6.interpolation;
|
|
1697
|
-
this.escape = t2 === void 0 ? jr : t2, this.escapeValue = n2 === void 0 || n2, this.useRawValueToEscape = r2 !== void 0 && r2, this.prefix = i2 ?
|
|
1699
|
+
this.escape = t2 === void 0 ? jr : t2, this.escapeValue = n2 === void 0 || n2, this.useRawValueToEscape = r2 !== void 0 && r2, this.prefix = i2 ? B(i2) : a2 || `{{`, this.suffix = o2 ? B(o2) : s2 || `}}`, this.formatSeparator = c2 || `,`, this.unescapePrefix = l2 ? `` : u2 ? B(u2) : `-`, this.unescapeSuffix = this.unescapePrefix ? `` : l2 ? B(l2) : ``, this.nestingPrefix = d2 ? B(d2) : f2 || B(`$t(`), this.nestingSuffix = p2 ? B(p2) : m2 || B(`)`), this.nestingOptionsSeparator = h2 || `,`, this.maxReplaces = g2 || 1e3, this.alwaysFormat = _2 !== void 0 && _2, this.resetRegExp();
|
|
1698
1700
|
}
|
|
1699
1701
|
reset() {
|
|
1700
1702
|
this.options && this.init(this.options);
|
|
@@ -1720,13 +1722,13 @@ var Qr = class {
|
|
|
1720
1722
|
if (a2 = c2(n3), a2 === void 0) {
|
|
1721
1723
|
if (typeof l2 == `function`) {
|
|
1722
1724
|
let t4 = l2(e6, i2, r2);
|
|
1723
|
-
a2 =
|
|
1725
|
+
a2 = L(t4) ? t4 : ``;
|
|
1724
1726
|
} else if (r2 && Object.prototype.hasOwnProperty.call(r2, n3)) a2 = ``;
|
|
1725
1727
|
else if (u2) {
|
|
1726
1728
|
a2 = i2[0];
|
|
1727
1729
|
continue;
|
|
1728
1730
|
} else this.logger.warn(`missed to pass in variable ${n3} for interpolating ${e6}`), a2 = ``;
|
|
1729
|
-
} else !
|
|
1731
|
+
} else !L(a2) && !this.useRawValueToEscape && (a2 = br(a2));
|
|
1730
1732
|
let s3 = t3.safeValue(a2);
|
|
1731
1733
|
if (e6 = e6.replace(i2[0], Zr(s3)), u2 ? (t3.regex.lastIndex += s3.length, t3.regex.lastIndex -= i2[0].length) : t3.regex.lastIndex = 0, o2++, o2 >= this.maxReplaces) break;
|
|
1732
1734
|
}
|
|
@@ -1736,7 +1738,7 @@ var Qr = class {
|
|
|
1736
1738
|
let r2, i2, a2, o2 = (e7, t3) => {
|
|
1737
1739
|
let n3 = this.nestingOptionsSeparator;
|
|
1738
1740
|
if (!e7.includes(n3)) return e7;
|
|
1739
|
-
let r3 = e7.split(RegExp(`${
|
|
1741
|
+
let r3 = e7.split(RegExp(`${B(n3)}[ ]*{`)), i3 = `{${r3[1]}`;
|
|
1740
1742
|
e7 = r3[0], i3 = this.interpolate(i3, a2);
|
|
1741
1743
|
let o3 = i3.match(/'/g), s3 = i3.match(/"/g);
|
|
1742
1744
|
((o3?.length ?? 0) % 2 == 0 && !s3 || (s3?.length ?? 0) % 2 != 0) && (i3 = i3.replace(/'/g, `"`));
|
|
@@ -1749,10 +1751,10 @@ var Qr = class {
|
|
|
1749
1751
|
}, s2 = new RegExp(this.nestingRegexp), c2 = ``, l2 = 0;
|
|
1750
1752
|
for (; r2 = s2.exec(e6); ) {
|
|
1751
1753
|
let u2 = [];
|
|
1752
|
-
a2 = { ...n2 }, a2 = a2.replace && !
|
|
1754
|
+
a2 = { ...n2 }, a2 = a2.replace && !L(a2.replace) ? a2.replace : a2, a2.applyPostProcessor = false, delete a2.defaultValue;
|
|
1753
1755
|
let d2 = /{.*}/s.test(r2[1]) ? r2[1].lastIndexOf(`}`) + 1 : r2[1].indexOf(this.formatSeparator);
|
|
1754
|
-
if (d2 !== -1 && (u2 = r2[1].slice(d2).split(this.formatSeparator).map((e7) => e7.trim()).filter(Boolean), r2[1] = r2[1].slice(0, d2)), i2 = t2(o2.call(this, r2[1].trim(), a2), a2), i2 && r2[0] === e6 && !
|
|
1755
|
-
|
|
1756
|
+
if (d2 !== -1 && (u2 = r2[1].slice(d2).split(this.formatSeparator).map((e7) => e7.trim()).filter(Boolean), r2[1] = r2[1].slice(0, d2)), i2 = t2(o2.call(this, r2[1].trim(), a2), a2), i2 && r2[0] === e6 && !L(i2)) return i2;
|
|
1757
|
+
L(i2) || (i2 = br(i2)), i2 ||= (this.logger.warn(`missed to resolve ${r2[1]} for nesting ${e6}`), ``), u2.length && (i2 = u2.reduce((e7, t3) => this.format(e7, t3, n2.lng, { ...n2, interpolationkey: r2[1].trim() }), i2.trim())), c2 += e6.slice(l2, r2.index) + br(i2), l2 = s2.lastIndex, this.regexp.lastIndex = 0;
|
|
1756
1758
|
}
|
|
1757
1759
|
return l2 ? c2 + e6.slice(l2) : e6;
|
|
1758
1760
|
}
|
|
@@ -1778,13 +1780,13 @@ var ei = (e6) => {
|
|
|
1778
1780
|
let a2 = i2;
|
|
1779
1781
|
i2 && i2.interpolationkey && i2.formatParams && i2.formatParams[i2.interpolationkey] && i2[i2.interpolationkey] && (a2 = { ...a2, [i2.interpolationkey]: void 0 });
|
|
1780
1782
|
let o2 = r2 + JSON.stringify(a2), s2 = t2[o2];
|
|
1781
|
-
return s2 || (s2 = e6(
|
|
1783
|
+
return s2 || (s2 = e6(V(r2), i2), t2[o2] = s2), s2(n2);
|
|
1782
1784
|
};
|
|
1783
1785
|
};
|
|
1784
|
-
var ti = (e6) => (t2, n2, r2) => e6(
|
|
1786
|
+
var ti = (e6) => (t2, n2, r2) => e6(V(n2), r2)(t2);
|
|
1785
1787
|
var ni = class {
|
|
1786
1788
|
constructor(e6 = {}) {
|
|
1787
|
-
this.logger =
|
|
1789
|
+
this.logger = H.create(`formatter`), this.options = e6, this.init(e6);
|
|
1788
1790
|
}
|
|
1789
1791
|
init(e6, t2 = { interpolation: {} }) {
|
|
1790
1792
|
this.formatSeparator = t2.interpolation.formatSeparator || `,`;
|
|
@@ -1841,7 +1843,7 @@ var ri = (e6, t2) => {
|
|
|
1841
1843
|
};
|
|
1842
1844
|
var ii = class extends Rr {
|
|
1843
1845
|
constructor(e6, t2, n2, r2 = {}) {
|
|
1844
|
-
super(), this.backend = e6, this.store = t2, this.services = n2, this.languageUtils = n2.languageUtils, this.options = r2, this.logger =
|
|
1846
|
+
super(), this.backend = e6, this.store = t2, this.services = n2, this.languageUtils = n2.languageUtils, this.options = r2, this.logger = H.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);
|
|
1845
1847
|
}
|
|
1846
1848
|
queueLoad(e6, t2, n2, r2) {
|
|
1847
1849
|
let i2 = {}, a2 = {}, o2 = {}, s2 = {};
|
|
@@ -1893,7 +1895,7 @@ var ii = class extends Rr {
|
|
|
1893
1895
|
}
|
|
1894
1896
|
prepareLoading(e6, t2, n2 = {}, r2) {
|
|
1895
1897
|
if (!this.backend) return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`), r2 && r2();
|
|
1896
|
-
|
|
1898
|
+
L(e6) && (e6 = this.languageUtils.toResolveHierarchy(e6)), L(t2) && (t2 = [t2]);
|
|
1897
1899
|
let i2 = this.queueLoad(e6, t2, n2, r2);
|
|
1898
1900
|
if (!i2.toLoad.length) return i2.pending.length || r2(), null;
|
|
1899
1901
|
i2.toLoad.forEach((e7) => {
|
|
@@ -1932,7 +1934,7 @@ var ii = class extends Rr {
|
|
|
1932
1934
|
};
|
|
1933
1935
|
var ai = () => ({ debug: false, initAsync: true, ns: [`translation`], defaultNS: [`translation`], fallbackLng: [`dev`], fallbackNS: false, supportedLngs: false, nonExplicitSupportedLngs: false, load: `all`, preload: false, keySeparator: `.`, nsSeparator: `:`, pluralSeparator: `_`, contextSeparator: `_`, enableSelector: false, 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: (e6) => {
|
|
1934
1936
|
let t2 = {};
|
|
1935
|
-
if (typeof e6[1] == `object` && (t2 = e6[1]),
|
|
1937
|
+
if (typeof e6[1] == `object` && (t2 = e6[1]), L(e6[1]) && (t2.defaultValue = e6[1]), L(e6[2]) && (t2.tDescription = e6[2]), typeof e6[2] == `object` || typeof e6[3] == `object`) {
|
|
1936
1938
|
let n2 = e6[3] || e6[2];
|
|
1937
1939
|
Object.keys(n2).forEach((e7) => {
|
|
1938
1940
|
t2[e7] = n2[e7];
|
|
@@ -1940,7 +1942,7 @@ var ai = () => ({ debug: false, initAsync: true, ns: [`translation`], defaultNS:
|
|
|
1940
1942
|
}
|
|
1941
1943
|
return t2;
|
|
1942
1944
|
}, interpolation: { escapeValue: true, prefix: `{{`, suffix: `}}`, formatSeparator: `,`, unescapePrefix: `-`, nestingPrefix: `$t(`, nestingSuffix: `)`, nestingOptionsSeparator: `,`, maxReplaces: 1e3, skipOnVariables: true }, cacheInBuiltFormats: true });
|
|
1943
|
-
var oi = (e6) => (
|
|
1945
|
+
var oi = (e6) => (L(e6.ns) && (e6.ns = [e6.ns]), L(e6.fallbackLng) && (e6.fallbackLng = [e6.fallbackLng]), L(e6.fallbackNS) && (e6.fallbackNS = [e6.fallbackNS]), e6.supportedLngs && !e6.supportedLngs.includes(`cimode`) && (e6.supportedLngs = e6.supportedLngs.concat([`cimode`])), e6);
|
|
1944
1946
|
var si = () => {
|
|
1945
1947
|
};
|
|
1946
1948
|
var ci = (e6) => {
|
|
@@ -1948,9 +1950,9 @@ var ci = (e6) => {
|
|
|
1948
1950
|
typeof e6[t2] == `function` && (e6[t2] = e6[t2].bind(e6));
|
|
1949
1951
|
});
|
|
1950
1952
|
};
|
|
1951
|
-
var
|
|
1953
|
+
var W = class e4 extends Rr {
|
|
1952
1954
|
constructor(e6 = {}, t2) {
|
|
1953
|
-
if (super(), this.options = oi(e6), this.services = {}, this.logger =
|
|
1955
|
+
if (super(), this.options = oi(e6), this.services = {}, this.logger = H, this.modules = { external: [] }, ci(this), t2 && !this.isInitialized && !e6.isClone) {
|
|
1954
1956
|
if (!this.options.initAsync) return this.init(e6, t2), this;
|
|
1955
1957
|
setTimeout(() => {
|
|
1956
1958
|
this.init(e6, t2);
|
|
@@ -1958,18 +1960,18 @@ var U = class e4 extends Rr {
|
|
|
1958
1960
|
}
|
|
1959
1961
|
}
|
|
1960
1962
|
init(e6 = {}, t2) {
|
|
1961
|
-
this.isInitializing = true, typeof e6 == `function` && (t2 = e6, e6 = {}), e6.defaultNS == null && e6.ns && (
|
|
1963
|
+
this.isInitializing = true, typeof e6 == `function` && (t2 = e6, e6 = {}), e6.defaultNS == null && e6.ns && (L(e6.ns) ? e6.defaultNS = e6.ns : e6.ns.includes(`translation`) || (e6.defaultNS = e6.ns[0]));
|
|
1962
1964
|
let n2 = ai();
|
|
1963
1965
|
this.options = { ...n2, ...this.options, ...oi(e6) }, this.options.interpolation = { ...n2.interpolation, ...this.options.interpolation }, e6.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = e6.keySeparator), e6.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = e6.nsSeparator), typeof this.options.overloadTranslationOptionHandler != `function` && (this.options.overloadTranslationOptionHandler = n2.overloadTranslationOptionHandler);
|
|
1964
1966
|
let r2 = (e7) => e7 ? typeof e7 == `function` ? new e7() : e7 : null;
|
|
1965
1967
|
if (!this.options.isClone) {
|
|
1966
|
-
this.modules.logger ?
|
|
1968
|
+
this.modules.logger ? H.init(r2(this.modules.logger), this.options) : H.init(null, this.options);
|
|
1967
1969
|
let e7;
|
|
1968
1970
|
e7 = this.modules.formatter ? this.modules.formatter : ni;
|
|
1969
1971
|
let t3 = new Kr(this.options);
|
|
1970
1972
|
this.store = new Br(this.options.resources, this.options);
|
|
1971
1973
|
let n3 = this.services;
|
|
1972
|
-
n3.logger =
|
|
1974
|
+
n3.logger = H, n3.resourceStore = this.store, n3.languageUtils = t3, n3.pluralResolver = new Yr(t3, { prepend: this.options.pluralSeparator }), e7 && (n3.formatter = r2(e7), n3.formatter.init && n3.formatter.init(n3, this.options), this.options.interpolation.format = n3.formatter.format.bind(n3.formatter)), n3.interpolator = new Qr(this.options), n3.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }, n3.backendConnector = new ii(r2(this.modules.backend), n3.resourceStore, n3, this.options), n3.backendConnector.on(`*`, (e8, ...t4) => {
|
|
1973
1975
|
this.emit(e8, ...t4);
|
|
1974
1976
|
}), this.modules.languageDetector && (n3.languageDetector = r2(this.modules.languageDetector), n3.languageDetector.init && n3.languageDetector.init(n3, this.options.detection, this.options)), this.modules.i18nFormat && (n3.i18nFormat = r2(this.modules.i18nFormat), n3.i18nFormat.init && n3.i18nFormat.init(this)), this.translator = new Gr(this.services, this.options), this.translator.on(`*`, (e8, ...t4) => {
|
|
1975
1977
|
this.emit(e8, ...t4);
|
|
@@ -1986,7 +1988,7 @@ var U = class e4 extends Rr {
|
|
|
1986
1988
|
}), [`addResource`, `addResources`, `addResourceBundle`, `removeResourceBundle`].forEach((e7) => {
|
|
1987
1989
|
this[e7] = (...t3) => (this.store[e7](...t3), this);
|
|
1988
1990
|
});
|
|
1989
|
-
let i2 =
|
|
1991
|
+
let i2 = R(), a2 = () => {
|
|
1990
1992
|
let e7 = (e8, n3) => {
|
|
1991
1993
|
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(e8, n3);
|
|
1992
1994
|
};
|
|
@@ -1996,7 +1998,7 @@ var U = class e4 extends Rr {
|
|
|
1996
1998
|
return this.options.resources || !this.options.initAsync ? a2() : setTimeout(a2, 0), i2;
|
|
1997
1999
|
}
|
|
1998
2000
|
loadResources(e6, t2 = si) {
|
|
1999
|
-
let n2 = t2, r2 =
|
|
2001
|
+
let n2 = t2, r2 = L(e6) ? e6 : this.language;
|
|
2000
2002
|
if (typeof e6 == `function` && (n2 = e6), !this.options.resources || this.options.partialBundledLanguages) {
|
|
2001
2003
|
if (r2?.toLowerCase() === `cimode` && (!this.options.preload || this.options.preload.length === 0)) return n2();
|
|
2002
2004
|
let e7 = [], t3 = (t4) => {
|
|
@@ -2010,7 +2012,7 @@ var U = class e4 extends Rr {
|
|
|
2010
2012
|
} else n2(null);
|
|
2011
2013
|
}
|
|
2012
2014
|
reloadResources(e6, t2, n2) {
|
|
2013
|
-
let r2 =
|
|
2015
|
+
let r2 = R();
|
|
2014
2016
|
return typeof e6 == `function` && (n2 = e6, e6 = void 0), typeof t2 == `function` && (n2 = t2, t2 = void 0), e6 ||= this.languages, t2 ||= this.options.ns, n2 ||= si, this.services.backendConnector.reload(e6, t2, (e7) => {
|
|
2015
2017
|
r2.resolve(), n2(e7);
|
|
2016
2018
|
}), r2;
|
|
@@ -2034,7 +2036,7 @@ var U = class e4 extends Rr {
|
|
|
2034
2036
|
}
|
|
2035
2037
|
changeLanguage(e6, t2) {
|
|
2036
2038
|
this.isLanguageChangingTo = e6;
|
|
2037
|
-
let n2 =
|
|
2039
|
+
let n2 = R();
|
|
2038
2040
|
this.emit(`languageChanging`, e6);
|
|
2039
2041
|
let r2 = (e7) => {
|
|
2040
2042
|
this.language = e7, this.languages = this.services.languageUtils.toResolveHierarchy(e7), this.resolvedLanguage = void 0, this.setResolvedLanguage(e7);
|
|
@@ -2042,7 +2044,7 @@ var U = class e4 extends Rr {
|
|
|
2042
2044
|
a3 ? this.isLanguageChangingTo === e6 && (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((...e7) => this.t(...e7)), t2 && t2(i3, (...e7) => this.t(...e7));
|
|
2043
2045
|
}, a2 = (t3) => {
|
|
2044
2046
|
!e6 && !t3 && this.services.languageDetector && (t3 = []);
|
|
2045
|
-
let n3 =
|
|
2047
|
+
let n3 = L(t3) ? t3 : t3 && t3[0], a3 = this.store.hasLanguageSomeTranslations(n3) ? n3 : this.services.languageUtils.getBestMatchFromCodes(L(t3) ? [t3] : t3);
|
|
2046
2048
|
a3 && (this.language || r2(a3), this.translator.language || this.translator.changeLanguage(a3), this.services.languageDetector?.cacheUserLanguage?.(a3)), this.loadResources(a3, (e7) => {
|
|
2047
2049
|
i2(e7, a3);
|
|
2048
2050
|
});
|
|
@@ -2056,11 +2058,11 @@ var U = class e4 extends Rr {
|
|
|
2056
2058
|
let s2 = o2.ns !== void 0 && o2.ns !== null;
|
|
2057
2059
|
o2.ns = o2.ns || a2.ns, o2.keyPrefix !== `` && (o2.keyPrefix = o2.keyPrefix || n2 || a2.keyPrefix);
|
|
2058
2060
|
let c2 = { ...this.options, ...o2 };
|
|
2059
|
-
Array.isArray(i2) && !s2 && (c2.ns = i2), typeof o2.keyPrefix == `function` && (o2.keyPrefix =
|
|
2061
|
+
Array.isArray(i2) && !s2 && (c2.ns = i2), typeof o2.keyPrefix == `function` && (o2.keyPrefix = U(o2.keyPrefix, c2));
|
|
2060
2062
|
let l2 = this.options.keySeparator || `.`, u2;
|
|
2061
|
-
return o2.keyPrefix && Array.isArray(e7) ? u2 = e7.map((e8) => (typeof e8 == `function` && (e8 =
|
|
2063
|
+
return o2.keyPrefix && Array.isArray(e7) ? u2 = e7.map((e8) => (typeof e8 == `function` && (e8 = U(e8, c2)), `${o2.keyPrefix}${l2}${e8}`)) : (typeof e7 == `function` && (e7 = U(e7, c2)), u2 = o2.keyPrefix ? `${o2.keyPrefix}${l2}${e7}` : e7), this.t(u2, o2);
|
|
2062
2064
|
};
|
|
2063
|
-
return
|
|
2065
|
+
return L(e6) ? a2.lng = e6 : a2.lngs = e6, a2.ns = t2, a2.keyPrefix = n2, a2;
|
|
2064
2066
|
}
|
|
2065
2067
|
t(...e6) {
|
|
2066
2068
|
return this.translator?.translate(...e6);
|
|
@@ -2084,19 +2086,21 @@ var U = class e4 extends Rr {
|
|
|
2084
2086
|
let e7 = t2.precheck(this, a2);
|
|
2085
2087
|
if (e7 !== void 0) return e7;
|
|
2086
2088
|
}
|
|
2087
|
-
|
|
2089
|
+
if (this.hasResourceBundle(n2, e6) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages) return true;
|
|
2090
|
+
let { languageUtils: o2 } = this.services, s2 = t2.lng ? o2.isSupportedCode(n2) && o2.toResolveHierarchy(n2, false)[0] : n2;
|
|
2091
|
+
return !(s2 && !a2(s2, e6) || r2 && !a2(i2, e6));
|
|
2088
2092
|
}
|
|
2089
2093
|
loadNamespaces(e6, t2) {
|
|
2090
|
-
let n2 =
|
|
2091
|
-
return this.options.ns ? (
|
|
2094
|
+
let n2 = R();
|
|
2095
|
+
return this.options.ns ? (L(e6) && (e6 = [e6]), e6.forEach((e7) => {
|
|
2092
2096
|
this.options.ns.includes(e7) || this.options.ns.push(e7);
|
|
2093
2097
|
}), this.loadResources((e7) => {
|
|
2094
2098
|
n2.resolve(), t2 && t2(e7);
|
|
2095
2099
|
}), n2) : (t2 && t2(), Promise.resolve());
|
|
2096
2100
|
}
|
|
2097
2101
|
loadLanguages(e6, t2) {
|
|
2098
|
-
let n2 =
|
|
2099
|
-
|
|
2102
|
+
let n2 = R();
|
|
2103
|
+
L(e6) && (e6 = [e6]);
|
|
2100
2104
|
let r2 = this.options.preload || [], i2 = e6.filter((e7) => !r2.includes(e7) && this.services.languageUtils.isSupportedCode(e7));
|
|
2101
2105
|
return i2.length ? (this.options.preload = r2.concat(i2), this.loadResources((e7) => {
|
|
2102
2106
|
n2.resolve(), t2 && t2(e7);
|
|
@@ -2122,7 +2126,7 @@ var U = class e4 extends Rr {
|
|
|
2122
2126
|
cloneInstance(t2 = {}, n2 = si) {
|
|
2123
2127
|
let r2 = t2.forkResourceStore;
|
|
2124
2128
|
r2 && delete t2.forkResourceStore;
|
|
2125
|
-
let i2 = { ...this.options, ...t2, isClone: true }, a2 = new e4(i2);
|
|
2129
|
+
let i2 = { ...this.options, preload: false, ...t2, isClone: true }, a2 = new e4(i2);
|
|
2126
2130
|
if ((t2.debug !== void 0 || t2.prefix !== void 0) && (a2.logger = a2.logger.clone(t2)), [`store`, `services`, `language`].forEach((e6) => {
|
|
2127
2131
|
a2[e6] = this[e6];
|
|
2128
2132
|
}), a2.services = { ...this.services }, a2.services.utils = { hasLoadedNamespace: a2.hasLoadedNamespace.bind(a2) }, r2 && (a2.store = new Br(Object.keys(this.store.data).reduce((e6, t3) => (e6[t3] = { ...this.store.data[t3] }, e6[t3] = Object.keys(e6[t3]).reduce((n3, r3) => (n3[r3] = { ...e6[t3][r3] }, n3), e6[t3]), e6), {}), i2), a2.services.resourceStore = a2.store), t2.interpolation) {
|
|
@@ -2137,9 +2141,9 @@ var U = class e4 extends Rr {
|
|
|
2137
2141
|
return { options: this.options, store: this.store, language: this.language, languages: this.languages, resolvedLanguage: this.resolvedLanguage };
|
|
2138
2142
|
}
|
|
2139
2143
|
}.createInstance();
|
|
2140
|
-
|
|
2144
|
+
W.createInstance, W.dir, W.init, W.loadResources, W.reloadResources, W.use, W.changeLanguage, W.getFixedT, W.t, W.exists, W.setDefaultNamespace, W.hasLoadedNamespace, W.loadNamespaces, W.loadLanguages;
|
|
2141
2145
|
var li = ({ locale: e6, asyncMessagesLoader: t2, messages: n2, useSuspense: r2 = false, disableAutoInit: i2 = false, bindI18n: a2 }, { icu: o2 } = {}) => {
|
|
2142
|
-
let s2 = { lng: e6, fallbackLng: `en`, keySeparator: false, react: { useSuspense: r2, bindI18n: a2 }, _polyfill: { isLoading: false } }, c2 =
|
|
2146
|
+
let s2 = { lng: e6, fallbackLng: `en`, keySeparator: false, react: { useSuspense: r2, bindI18n: a2 }, _polyfill: { isLoading: false } }, c2 = W.createInstance(i2 ? s2 : void 0);
|
|
2143
2147
|
return o2 && c2.use(o2), t2 && c2.use({ type: `backend`, read: async (e7, n3, r3) => {
|
|
2144
2148
|
try {
|
|
2145
2149
|
return r3(null, await t2(e7));
|
|
@@ -2148,75 +2152,38 @@ var li = ({ locale: e6, asyncMessagesLoader: t2, messages: n2, useSuspense: r2 =
|
|
|
2148
2152
|
}
|
|
2149
2153
|
} }), n2 && (s2.resources = { [e6]: { translation: n2 } }), i2 || c2.init(s2), c2;
|
|
2150
2154
|
};
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
return e7 && e7.indexOf(`###`) > -1 ? e7.replace(/###/g, `.`) : e7;
|
|
2155
|
-
}
|
|
2156
|
-
function i2() {
|
|
2157
|
-
return !e6 || typeof e6 == `string`;
|
|
2158
|
-
}
|
|
2159
|
-
for (var a2 = typeof t2 == `string` ? t2.split(`.`) : [].concat(t2); a2.length > 1; ) {
|
|
2160
|
-
if (i2()) return {};
|
|
2161
|
-
var o2 = r2(a2.shift());
|
|
2162
|
-
if (ui.indexOf(o2) > -1) return {};
|
|
2163
|
-
!e6[o2] && n2 && (e6[o2] = new n2()), e6 = e6[o2];
|
|
2164
|
-
}
|
|
2165
|
-
if (i2()) return {};
|
|
2166
|
-
var s2 = r2(a2.shift());
|
|
2167
|
-
return ui.indexOf(s2) > -1 ? {} : { obj: e6, k: s2 };
|
|
2168
|
-
}
|
|
2169
|
-
function fi(e6, t2, n2) {
|
|
2170
|
-
var r2 = di(e6, t2, Object), i2 = r2.obj, a2 = r2.k;
|
|
2171
|
-
i2 !== void 0 && (i2[a2] = n2);
|
|
2172
|
-
}
|
|
2173
|
-
function pi(e6, t2) {
|
|
2174
|
-
var n2 = di(e6, t2), r2 = n2.obj, i2 = n2.k;
|
|
2175
|
-
if (r2) return r2[i2];
|
|
2155
|
+
function ui(e6, t2) {
|
|
2156
|
+
let n2 = t2 && t2.cache ? t2.cache : bi, r2 = t2 && t2.serializer ? t2.serializer : vi;
|
|
2157
|
+
return (t2 && t2.strategy ? t2.strategy : hi)(e6, { cache: n2, serializer: r2 });
|
|
2176
2158
|
}
|
|
2177
|
-
|
|
2178
|
-
var hi = mi.forEach;
|
|
2179
|
-
var gi = mi.slice;
|
|
2180
|
-
function _i(e6) {
|
|
2181
|
-
return hi.call(gi.call(arguments, 1), function(t2) {
|
|
2182
|
-
if (t2) for (var n2 = 0, r2 = Object.keys(t2); n2 < r2.length; n2++) {
|
|
2183
|
-
var i2 = r2[n2];
|
|
2184
|
-
ui.indexOf(i2) > -1 || e6[i2] === void 0 && (e6[i2] = t2[i2]);
|
|
2185
|
-
}
|
|
2186
|
-
}), e6;
|
|
2187
|
-
}
|
|
2188
|
-
function vi(e6, t2) {
|
|
2189
|
-
let n2 = t2 && t2.cache ? t2.cache : Oi, r2 = t2 && t2.serializer ? t2.serializer : Ei;
|
|
2190
|
-
return (t2 && t2.strategy ? t2.strategy : Ci)(e6, { cache: n2, serializer: r2 });
|
|
2191
|
-
}
|
|
2192
|
-
function yi(e6) {
|
|
2159
|
+
function di(e6) {
|
|
2193
2160
|
return e6 == null || typeof e6 == `number` || typeof e6 == `boolean`;
|
|
2194
2161
|
}
|
|
2195
|
-
function
|
|
2196
|
-
let i2 =
|
|
2162
|
+
function fi(e6, t2, n2, r2) {
|
|
2163
|
+
let i2 = di(r2) ? r2 : n2(r2), a2 = t2.get(i2);
|
|
2197
2164
|
return a2 === void 0 && (a2 = e6.call(this, r2), t2.set(i2, a2)), a2;
|
|
2198
2165
|
}
|
|
2199
|
-
function
|
|
2166
|
+
function pi(e6, t2, n2) {
|
|
2200
2167
|
let r2 = Array.prototype.slice.call(arguments, 3), i2 = n2(r2), a2 = t2.get(i2);
|
|
2201
2168
|
return a2 === void 0 && (a2 = e6.apply(this, r2), t2.set(i2, a2)), a2;
|
|
2202
2169
|
}
|
|
2203
|
-
function
|
|
2170
|
+
function mi(e6, t2, n2, r2, i2) {
|
|
2204
2171
|
return n2.bind(t2, e6, r2, i2);
|
|
2205
2172
|
}
|
|
2206
|
-
function
|
|
2207
|
-
let n2 = e6.length === 1 ?
|
|
2208
|
-
return
|
|
2173
|
+
function hi(e6, t2) {
|
|
2174
|
+
let n2 = e6.length === 1 ? fi : pi;
|
|
2175
|
+
return mi(e6, this, n2, t2.cache.create(), t2.serializer);
|
|
2209
2176
|
}
|
|
2210
|
-
function
|
|
2211
|
-
return
|
|
2177
|
+
function gi(e6, t2) {
|
|
2178
|
+
return mi(e6, this, pi, t2.cache.create(), t2.serializer);
|
|
2212
2179
|
}
|
|
2213
|
-
function
|
|
2214
|
-
return
|
|
2180
|
+
function _i(e6, t2) {
|
|
2181
|
+
return mi(e6, this, fi, t2.cache.create(), t2.serializer);
|
|
2215
2182
|
}
|
|
2216
|
-
var
|
|
2183
|
+
var vi = function() {
|
|
2217
2184
|
return JSON.stringify(arguments);
|
|
2218
2185
|
};
|
|
2219
|
-
var
|
|
2186
|
+
var yi = class {
|
|
2220
2187
|
constructor() {
|
|
2221
2188
|
this.cache = /* @__PURE__ */ Object.create(null);
|
|
2222
2189
|
}
|
|
@@ -2227,14 +2194,14 @@ var Di = class {
|
|
|
2227
2194
|
this.cache[e6] = t2;
|
|
2228
2195
|
}
|
|
2229
2196
|
};
|
|
2230
|
-
var
|
|
2231
|
-
return new
|
|
2197
|
+
var bi = { create: function() {
|
|
2198
|
+
return new yi();
|
|
2232
2199
|
} };
|
|
2233
|
-
var
|
|
2234
|
-
var
|
|
2235
|
-
function
|
|
2200
|
+
var xi = { variadic: gi, monadic: _i };
|
|
2201
|
+
var Si = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;
|
|
2202
|
+
function Ci(e6) {
|
|
2236
2203
|
let t2 = {};
|
|
2237
|
-
return e6.replace(
|
|
2204
|
+
return e6.replace(Si, (e7) => {
|
|
2238
2205
|
let n2 = e7.length;
|
|
2239
2206
|
switch (e7[0]) {
|
|
2240
2207
|
case `G`:
|
|
@@ -2321,10 +2288,10 @@ function ji(e6) {
|
|
|
2321
2288
|
return ``;
|
|
2322
2289
|
}), t2;
|
|
2323
2290
|
}
|
|
2324
|
-
var
|
|
2325
|
-
function
|
|
2291
|
+
var wi = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i;
|
|
2292
|
+
function Ti(e6) {
|
|
2326
2293
|
if (e6.length === 0) throw Error(`Number skeleton cannot be empty`);
|
|
2327
|
-
let t2 = e6.split(
|
|
2294
|
+
let t2 = e6.split(wi).filter((e7) => e7.length > 0), n2 = [];
|
|
2328
2295
|
for (let e7 of t2) {
|
|
2329
2296
|
let t3 = e7.split(`/`);
|
|
2330
2297
|
if (t3.length === 0) throw Error(`Invalid number skeleton`);
|
|
@@ -2334,20 +2301,20 @@ function Ni(e6) {
|
|
|
2334
2301
|
}
|
|
2335
2302
|
return n2;
|
|
2336
2303
|
}
|
|
2337
|
-
function
|
|
2304
|
+
function Ei(e6) {
|
|
2338
2305
|
return e6.replace(/^(.*?)-/, ``);
|
|
2339
2306
|
}
|
|
2340
|
-
var
|
|
2341
|
-
var
|
|
2342
|
-
var
|
|
2343
|
-
var
|
|
2344
|
-
function
|
|
2307
|
+
var Di = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g;
|
|
2308
|
+
var Oi = /^(@+)?(\+|#+)?[rs]?$/g;
|
|
2309
|
+
var ki = /(\*)(0+)|(#+)(0+)|(0+)/g;
|
|
2310
|
+
var Ai = /^(0+)$/;
|
|
2311
|
+
function ji(e6) {
|
|
2345
2312
|
let t2 = {};
|
|
2346
|
-
return e6[e6.length - 1] === `r` ? t2.roundingPriority = `morePrecision` : e6[e6.length - 1] === `s` && (t2.roundingPriority = `lessPrecision`), e6.replace(
|
|
2313
|
+
return e6[e6.length - 1] === `r` ? t2.roundingPriority = `morePrecision` : e6[e6.length - 1] === `s` && (t2.roundingPriority = `lessPrecision`), e6.replace(Oi, function(e7, n2, r2) {
|
|
2347
2314
|
return typeof r2 == `string` ? r2 === `+` ? t2.minimumSignificantDigits = n2.length : n2[0] === `#` ? t2.maximumSignificantDigits = n2.length : (t2.minimumSignificantDigits = n2.length, t2.maximumSignificantDigits = n2.length + (typeof r2 == `string` ? r2.length : 0)) : (t2.minimumSignificantDigits = n2.length, t2.maximumSignificantDigits = n2.length), ``;
|
|
2348
2315
|
}), t2;
|
|
2349
2316
|
}
|
|
2350
|
-
function
|
|
2317
|
+
function Mi(e6) {
|
|
2351
2318
|
switch (e6) {
|
|
2352
2319
|
case `sign-auto`:
|
|
2353
2320
|
return { signDisplay: `auto` };
|
|
@@ -2371,19 +2338,19 @@ function Bi(e6) {
|
|
|
2371
2338
|
return { signDisplay: `never` };
|
|
2372
2339
|
}
|
|
2373
2340
|
}
|
|
2374
|
-
function
|
|
2341
|
+
function Ni(e6) {
|
|
2375
2342
|
let t2;
|
|
2376
2343
|
if (e6[0] === `E` && e6[1] === `E` ? (t2 = { notation: `engineering` }, e6 = e6.slice(2)) : e6[0] === `E` && (t2 = { notation: `scientific` }, e6 = e6.slice(1)), t2) {
|
|
2377
2344
|
let n2 = e6.slice(0, 2);
|
|
2378
|
-
if (n2 === `+!` ? (t2.signDisplay = `always`, e6 = e6.slice(2)) : n2 === `+?` && (t2.signDisplay = `exceptZero`, e6 = e6.slice(2)), !
|
|
2345
|
+
if (n2 === `+!` ? (t2.signDisplay = `always`, e6 = e6.slice(2)) : n2 === `+?` && (t2.signDisplay = `exceptZero`, e6 = e6.slice(2)), !Ai.test(e6)) throw Error(`Malformed concise eng/scientific notation`);
|
|
2379
2346
|
t2.minimumIntegerDigits = e6.length;
|
|
2380
2347
|
}
|
|
2381
2348
|
return t2;
|
|
2382
2349
|
}
|
|
2383
|
-
function
|
|
2384
|
-
return
|
|
2350
|
+
function Pi(e6) {
|
|
2351
|
+
return Mi(e6) || {};
|
|
2385
2352
|
}
|
|
2386
|
-
function
|
|
2353
|
+
function Fi(e6) {
|
|
2387
2354
|
let t2 = {};
|
|
2388
2355
|
for (let n2 of e6) {
|
|
2389
2356
|
switch (n2.stem) {
|
|
@@ -2407,7 +2374,7 @@ function Ui(e6) {
|
|
|
2407
2374
|
continue;
|
|
2408
2375
|
case `measure-unit`:
|
|
2409
2376
|
case `unit`:
|
|
2410
|
-
t2.style = `unit`, t2.unit =
|
|
2377
|
+
t2.style = `unit`, t2.unit = Ei(n2.options[0]);
|
|
2411
2378
|
continue;
|
|
2412
2379
|
case `compact-short`:
|
|
2413
2380
|
case `K`:
|
|
@@ -2418,10 +2385,10 @@ function Ui(e6) {
|
|
|
2418
2385
|
t2.notation = `compact`, t2.compactDisplay = `long`;
|
|
2419
2386
|
continue;
|
|
2420
2387
|
case `scientific`:
|
|
2421
|
-
t2 = { ...t2, notation: `scientific`, ...n2.options.reduce((e8, t3) => ({ ...e8, ...
|
|
2388
|
+
t2 = { ...t2, notation: `scientific`, ...n2.options.reduce((e8, t3) => ({ ...e8, ...Pi(t3) }), {}) };
|
|
2422
2389
|
continue;
|
|
2423
2390
|
case `engineering`:
|
|
2424
|
-
t2 = { ...t2, notation: `engineering`, ...n2.options.reduce((e8, t3) => ({ ...e8, ...
|
|
2391
|
+
t2 = { ...t2, notation: `engineering`, ...n2.options.reduce((e8, t3) => ({ ...e8, ...Pi(t3) }), {}) };
|
|
2425
2392
|
continue;
|
|
2426
2393
|
case `notation-simple`:
|
|
2427
2394
|
t2.notation = `standard`;
|
|
@@ -2464,7 +2431,7 @@ function Ui(e6) {
|
|
|
2464
2431
|
continue;
|
|
2465
2432
|
case `integer-width`:
|
|
2466
2433
|
if (n2.options.length > 1) throw RangeError(`integer-width stems only accept a single optional option`);
|
|
2467
|
-
n2.options[0].replace(
|
|
2434
|
+
n2.options[0].replace(ki, function(e8, n3, r3, i2, a2, o2) {
|
|
2468
2435
|
if (n3) t2.minimumIntegerDigits = r3.length;
|
|
2469
2436
|
else if (i2 && a2) throw Error(`We currently do not support maximum integer digits`);
|
|
2470
2437
|
else if (o2) throw Error(`We currently do not support exact integer digits`);
|
|
@@ -2472,83 +2439,83 @@ function Ui(e6) {
|
|
|
2472
2439
|
});
|
|
2473
2440
|
continue;
|
|
2474
2441
|
}
|
|
2475
|
-
if (
|
|
2442
|
+
if (Ai.test(n2.stem)) {
|
|
2476
2443
|
t2.minimumIntegerDigits = n2.stem.length;
|
|
2477
2444
|
continue;
|
|
2478
2445
|
}
|
|
2479
|
-
if (
|
|
2446
|
+
if (Di.test(n2.stem)) {
|
|
2480
2447
|
if (n2.options.length > 1) throw RangeError(`Fraction-precision stems only accept a single optional option`);
|
|
2481
|
-
n2.stem.replace(
|
|
2448
|
+
n2.stem.replace(Di, function(e9, n3, r3, i2, a2, o2) {
|
|
2482
2449
|
return r3 === `*` ? t2.minimumFractionDigits = n3.length : i2 && i2[0] === `#` ? t2.maximumFractionDigits = i2.length : a2 && o2 ? (t2.minimumFractionDigits = a2.length, t2.maximumFractionDigits = a2.length + o2.length) : (t2.minimumFractionDigits = n3.length, t2.maximumFractionDigits = n3.length), ``;
|
|
2483
2450
|
});
|
|
2484
2451
|
let e8 = n2.options[0];
|
|
2485
|
-
e8 === `w` ? t2 = { ...t2, trailingZeroDisplay: `stripIfInteger` } : e8 && (t2 = { ...t2, ...
|
|
2452
|
+
e8 === `w` ? t2 = { ...t2, trailingZeroDisplay: `stripIfInteger` } : e8 && (t2 = { ...t2, ...ji(e8) });
|
|
2486
2453
|
continue;
|
|
2487
2454
|
}
|
|
2488
|
-
if (
|
|
2489
|
-
t2 = { ...t2, ...
|
|
2455
|
+
if (Oi.test(n2.stem)) {
|
|
2456
|
+
t2 = { ...t2, ...ji(n2.stem) };
|
|
2490
2457
|
continue;
|
|
2491
2458
|
}
|
|
2492
|
-
let e7 =
|
|
2459
|
+
let e7 = Mi(n2.stem);
|
|
2493
2460
|
e7 && (t2 = { ...t2, ...e7 });
|
|
2494
|
-
let r2 =
|
|
2461
|
+
let r2 = Ni(n2.stem);
|
|
2495
2462
|
r2 && (t2 = { ...t2, ...r2 });
|
|
2496
2463
|
}
|
|
2497
2464
|
return t2;
|
|
2498
2465
|
}
|
|
2499
|
-
var
|
|
2466
|
+
var Ii = function(e6) {
|
|
2500
2467
|
return e6[e6.EXPECT_ARGUMENT_CLOSING_BRACE = 1] = `EXPECT_ARGUMENT_CLOSING_BRACE`, e6[e6.EMPTY_ARGUMENT = 2] = `EMPTY_ARGUMENT`, e6[e6.MALFORMED_ARGUMENT = 3] = `MALFORMED_ARGUMENT`, e6[e6.EXPECT_ARGUMENT_TYPE = 4] = `EXPECT_ARGUMENT_TYPE`, e6[e6.INVALID_ARGUMENT_TYPE = 5] = `INVALID_ARGUMENT_TYPE`, e6[e6.EXPECT_ARGUMENT_STYLE = 6] = `EXPECT_ARGUMENT_STYLE`, e6[e6.INVALID_NUMBER_SKELETON = 7] = `INVALID_NUMBER_SKELETON`, e6[e6.INVALID_DATE_TIME_SKELETON = 8] = `INVALID_DATE_TIME_SKELETON`, e6[e6.EXPECT_NUMBER_SKELETON = 9] = `EXPECT_NUMBER_SKELETON`, e6[e6.EXPECT_DATE_TIME_SKELETON = 10] = `EXPECT_DATE_TIME_SKELETON`, e6[e6.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE = 11] = `UNCLOSED_QUOTE_IN_ARGUMENT_STYLE`, e6[e6.EXPECT_SELECT_ARGUMENT_OPTIONS = 12] = `EXPECT_SELECT_ARGUMENT_OPTIONS`, e6[e6.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE = 13] = `EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE`, e6[e6.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE = 14] = `INVALID_PLURAL_ARGUMENT_OFFSET_VALUE`, e6[e6.EXPECT_SELECT_ARGUMENT_SELECTOR = 15] = `EXPECT_SELECT_ARGUMENT_SELECTOR`, e6[e6.EXPECT_PLURAL_ARGUMENT_SELECTOR = 16] = `EXPECT_PLURAL_ARGUMENT_SELECTOR`, e6[e6.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT = 17] = `EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT`, e6[e6.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT = 18] = `EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT`, e6[e6.INVALID_PLURAL_ARGUMENT_SELECTOR = 19] = `INVALID_PLURAL_ARGUMENT_SELECTOR`, e6[e6.DUPLICATE_PLURAL_ARGUMENT_SELECTOR = 20] = `DUPLICATE_PLURAL_ARGUMENT_SELECTOR`, e6[e6.DUPLICATE_SELECT_ARGUMENT_SELECTOR = 21] = `DUPLICATE_SELECT_ARGUMENT_SELECTOR`, e6[e6.MISSING_OTHER_CLAUSE = 22] = `MISSING_OTHER_CLAUSE`, e6[e6.INVALID_TAG = 23] = `INVALID_TAG`, e6[e6.INVALID_TAG_NAME = 25] = `INVALID_TAG_NAME`, e6[e6.UNMATCHED_CLOSING_TAG = 26] = `UNMATCHED_CLOSING_TAG`, e6[e6.UNCLOSED_TAG = 27] = `UNCLOSED_TAG`, e6;
|
|
2501
2468
|
}({});
|
|
2502
|
-
function
|
|
2469
|
+
function Li(e6) {
|
|
2503
2470
|
return e6.type === 0;
|
|
2504
2471
|
}
|
|
2505
|
-
function
|
|
2472
|
+
function Ri(e6) {
|
|
2506
2473
|
return e6.type === 1;
|
|
2507
2474
|
}
|
|
2508
|
-
function
|
|
2475
|
+
function zi(e6) {
|
|
2509
2476
|
return e6.type === 2;
|
|
2510
2477
|
}
|
|
2511
|
-
function
|
|
2478
|
+
function Bi(e6) {
|
|
2512
2479
|
return e6.type === 3;
|
|
2513
2480
|
}
|
|
2514
|
-
function
|
|
2481
|
+
function Vi(e6) {
|
|
2515
2482
|
return e6.type === 4;
|
|
2516
2483
|
}
|
|
2517
|
-
function
|
|
2484
|
+
function Hi(e6) {
|
|
2518
2485
|
return e6.type === 5;
|
|
2519
2486
|
}
|
|
2520
|
-
function
|
|
2487
|
+
function Ui(e6) {
|
|
2521
2488
|
return e6.type === 6;
|
|
2522
2489
|
}
|
|
2523
|
-
function
|
|
2490
|
+
function Wi(e6) {
|
|
2524
2491
|
return e6.type === 7;
|
|
2525
2492
|
}
|
|
2526
|
-
function
|
|
2493
|
+
function Gi(e6) {
|
|
2527
2494
|
return e6.type === 8;
|
|
2528
2495
|
}
|
|
2529
|
-
function
|
|
2496
|
+
function Ki(e6) {
|
|
2530
2497
|
return !!(e6 && typeof e6 == `object` && e6.type === 0);
|
|
2531
2498
|
}
|
|
2532
|
-
function
|
|
2499
|
+
function qi(e6) {
|
|
2533
2500
|
return !!(e6 && typeof e6 == `object` && e6.type === 1);
|
|
2534
2501
|
}
|
|
2535
|
-
var
|
|
2536
|
-
var
|
|
2537
|
-
function
|
|
2502
|
+
var Ji = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/;
|
|
2503
|
+
var G = { "001": [`H`, `h`], 419: [`h`, `H`, `hB`, `hb`], AC: [`H`, `h`, `hb`, `hB`], AD: [`H`, `hB`], AE: [`h`, `hB`, `hb`, `H`], AF: [`H`, `hb`, `hB`, `h`], AG: [`h`, `hb`, `H`, `hB`], AI: [`H`, `h`, `hb`, `hB`], AL: [`h`, `H`, `hB`], AM: [`H`, `hB`], AO: [`H`, `hB`], AR: [`h`, `H`, `hB`, `hb`], AS: [`h`, `H`], AT: [`H`, `hB`], AU: [`h`, `hb`, `H`, `hB`], AW: [`H`, `hB`], AX: [`H`], AZ: [`H`, `hB`, `h`], BA: [`H`, `hB`, `h`], BB: [`h`, `hb`, `H`, `hB`], BD: [`h`, `hB`, `H`], BE: [`H`, `hB`], BF: [`H`, `hB`], BG: [`H`, `hB`, `h`], BH: [`h`, `hB`, `hb`, `H`], BI: [`H`, `h`], BJ: [`H`, `hB`], BL: [`H`, `hB`], BM: [`h`, `hb`, `H`, `hB`], BN: [`hb`, `hB`, `h`, `H`], BO: [`h`, `H`, `hB`, `hb`], BQ: [`H`], BR: [`H`, `hB`], BS: [`h`, `hb`, `H`, `hB`], BT: [`h`, `H`], BW: [`H`, `h`, `hb`, `hB`], BY: [`H`, `h`], BZ: [`H`, `h`, `hb`, `hB`], CA: [`h`, `hb`, `H`, `hB`], CC: [`H`, `h`, `hb`, `hB`], CD: [`hB`, `H`], CF: [`H`, `h`, `hB`], CG: [`H`, `hB`], CH: [`H`, `hB`, `h`], CI: [`H`, `hB`], CK: [`H`, `h`, `hb`, `hB`], CL: [`h`, `H`, `hB`, `hb`], CM: [`H`, `h`, `hB`], CN: [`H`, `hB`, `hb`, `h`], CO: [`h`, `H`, `hB`, `hb`], CP: [`H`], CR: [`h`, `H`, `hB`, `hb`], CU: [`h`, `H`, `hB`, `hb`], CV: [`H`, `hB`], CW: [`H`, `hB`], CX: [`H`, `h`, `hb`, `hB`], CY: [`h`, `H`, `hb`, `hB`], CZ: [`H`], DE: [`H`, `hB`], DG: [`H`, `h`, `hb`, `hB`], DJ: [`h`, `H`], DK: [`H`], DM: [`h`, `hb`, `H`, `hB`], DO: [`h`, `H`, `hB`, `hb`], DZ: [`h`, `hB`, `hb`, `H`], EA: [`H`, `h`, `hB`, `hb`], EC: [`h`, `H`, `hB`, `hb`], EE: [`H`, `hB`], EG: [`h`, `hB`, `hb`, `H`], EH: [`h`, `hB`, `hb`, `H`], ER: [`h`, `H`], ES: [`H`, `hB`, `h`, `hb`], ET: [`hB`, `hb`, `h`, `H`], FI: [`H`], FJ: [`h`, `hb`, `H`, `hB`], FK: [`H`, `h`, `hb`, `hB`], FM: [`h`, `hb`, `H`, `hB`], FO: [`H`, `h`], FR: [`H`, `hB`], GA: [`H`, `hB`], GB: [`H`, `h`, `hb`, `hB`], GD: [`h`, `hb`, `H`, `hB`], GE: [`H`, `hB`, `h`], GF: [`H`, `hB`], GG: [`H`, `h`, `hb`, `hB`], GH: [`h`, `H`], GI: [`H`, `h`, `hb`, `hB`], GL: [`H`, `h`], GM: [`h`, `hb`, `H`, `hB`], GN: [`H`, `hB`], GP: [`H`, `hB`], GQ: [`H`, `hB`, `h`, `hb`], GR: [`h`, `H`, `hb`, `hB`], GS: [`H`, `h`, `hb`, `hB`], GT: [`h`, `H`, `hB`, `hb`], GU: [`h`, `hb`, `H`, `hB`], GW: [`H`, `hB`], GY: [`h`, `hb`, `H`, `hB`], HK: [`h`, `hB`, `hb`, `H`], HN: [`h`, `H`, `hB`, `hb`], HR: [`H`, `hB`], HU: [`H`, `h`], IC: [`H`, `h`, `hB`, `hb`], ID: [`H`], IE: [`H`, `h`, `hb`, `hB`], IL: [`H`, `hB`], IM: [`H`, `h`, `hb`, `hB`], IN: [`h`, `H`], IO: [`H`, `h`, `hb`, `hB`], IQ: [`h`, `hB`, `hb`, `H`], IR: [`hB`, `H`], IS: [`H`], IT: [`H`, `hB`], JE: [`H`, `h`, `hb`, `hB`], JM: [`h`, `hb`, `H`, `hB`], JO: [`h`, `hB`, `hb`, `H`], JP: [`H`, `K`, `h`], KE: [`hB`, `hb`, `H`, `h`], KG: [`H`, `h`, `hB`, `hb`], KH: [`hB`, `h`, `H`, `hb`], KI: [`h`, `hb`, `H`, `hB`], KM: [`H`, `h`, `hB`, `hb`], KN: [`h`, `hb`, `H`, `hB`], KP: [`h`, `H`, `hB`, `hb`], KR: [`h`, `H`, `hB`, `hb`], KW: [`h`, `hB`, `hb`, `H`], KY: [`h`, `hb`, `H`, `hB`], KZ: [`H`, `hB`], LA: [`H`, `hb`, `hB`, `h`], LB: [`h`, `hB`, `hb`, `H`], LC: [`h`, `hb`, `H`, `hB`], LI: [`H`, `hB`, `h`], LK: [`H`, `h`, `hB`, `hb`], LR: [`h`, `hb`, `H`, `hB`], LS: [`h`, `H`], LT: [`H`, `h`, `hb`, `hB`], LU: [`H`, `h`, `hB`], LV: [`H`, `hB`, `hb`, `h`], LY: [`h`, `hB`, `hb`, `H`], MA: [`H`, `h`, `hB`, `hb`], MC: [`H`, `hB`], MD: [`H`, `hB`], ME: [`H`, `hB`, `h`], MF: [`H`, `hB`], MG: [`H`, `h`], MH: [`h`, `hb`, `H`, `hB`], MK: [`H`, `h`, `hb`, `hB`], ML: [`H`], MM: [`hB`, `hb`, `H`, `h`], MN: [`H`, `h`, `hb`, `hB`], MO: [`h`, `hB`, `hb`, `H`], MP: [`h`, `hb`, `H`, `hB`], MQ: [`H`, `hB`], MR: [`h`, `hB`, `hb`, `H`], MS: [`H`, `h`, `hb`, `hB`], MT: [`H`, `h`], MU: [`H`, `h`], MV: [`H`, `h`], MW: [`h`, `hb`, `H`, `hB`], MX: [`h`, `H`, `hB`, `hb`], MY: [`hb`, `hB`, `h`, `H`], MZ: [`H`, `hB`], NA: [`h`, `H`, `hB`, `hb`], NC: [`H`, `hB`], NE: [`H`], NF: [`H`, `h`, `hb`, `hB`], NG: [`H`, `h`, `hb`, `hB`], NI: [`h`, `H`, `hB`, `hb`], NL: [`H`, `hB`], NO: [`H`, `h`], NP: [`H`, `h`, `hB`], NR: [`H`, `h`, `hb`, `hB`], NU: [`H`, `h`, `hb`, `hB`], NZ: [`h`, `hb`, `H`, `hB`], OM: [`h`, `hB`, `hb`, `H`], PA: [`h`, `H`, `hB`, `hb`], PE: [`h`, `H`, `hB`, `hb`], PF: [`H`, `h`, `hB`], PG: [`h`, `H`], PH: [`h`, `hB`, `hb`, `H`], PK: [`h`, `hB`, `H`], PL: [`H`, `h`], PM: [`H`, `hB`], PN: [`H`, `h`, `hb`, `hB`], PR: [`h`, `H`, `hB`, `hb`], PS: [`h`, `hB`, `hb`, `H`], PT: [`H`, `hB`], PW: [`h`, `H`], PY: [`h`, `H`, `hB`, `hb`], QA: [`h`, `hB`, `hb`, `H`], RE: [`H`, `hB`], RO: [`H`, `hB`], RS: [`H`, `hB`, `h`], RU: [`H`], RW: [`H`, `h`], SA: [`h`, `hB`, `hb`, `H`], SB: [`h`, `hb`, `H`, `hB`], SC: [`H`, `h`, `hB`], SD: [`h`, `hB`, `hb`, `H`], SE: [`H`], SG: [`h`, `hb`, `H`, `hB`], SH: [`H`, `h`, `hb`, `hB`], SI: [`H`, `hB`], SJ: [`H`], SK: [`H`], SL: [`h`, `hb`, `H`, `hB`], SM: [`H`, `h`, `hB`], SN: [`H`, `h`, `hB`], SO: [`h`, `H`], SR: [`H`, `hB`], SS: [`h`, `hb`, `H`, `hB`], ST: [`H`, `hB`], SV: [`h`, `H`, `hB`, `hb`], SX: [`H`, `h`, `hb`, `hB`], SY: [`h`, `hB`, `hb`, `H`], SZ: [`h`, `hb`, `H`, `hB`], TA: [`H`, `h`, `hb`, `hB`], TC: [`h`, `hb`, `H`, `hB`], TD: [`h`, `H`, `hB`], TF: [`H`, `h`, `hB`], TG: [`H`, `hB`], TH: [`H`, `h`], TJ: [`H`, `h`], TL: [`H`, `hB`, `hb`, `h`], TM: [`H`, `h`], TN: [`h`, `hB`, `hb`, `H`], TO: [`h`, `H`], TR: [`H`, `hB`], TT: [`h`, `hb`, `H`, `hB`], TW: [`hB`, `hb`, `h`, `H`], TZ: [`hB`, `hb`, `H`, `h`], UA: [`H`, `hB`, `h`], UG: [`hB`, `hb`, `H`, `h`], UM: [`h`, `hb`, `H`, `hB`], US: [`h`, `hb`, `H`, `hB`], UY: [`h`, `H`, `hB`, `hb`], UZ: [`H`, `hB`, `h`], VA: [`H`, `h`, `hB`], VC: [`h`, `hb`, `H`, `hB`], VE: [`h`, `H`, `hB`, `hb`], VG: [`h`, `hb`, `H`, `hB`], VI: [`h`, `hb`, `H`, `hB`], VN: [`H`, `h`], VU: [`h`, `H`], WF: [`H`, `hB`], WS: [`h`, `H`], XK: [`H`, `hB`, `h`], YE: [`h`, `hB`, `hb`, `H`], YT: [`H`, `hB`], ZA: [`H`, `h`, `hb`, `hB`], ZM: [`h`, `hb`, `H`, `hB`], ZW: [`H`, `h`], "af-ZA": [`H`, `h`, `hB`, `hb`], "ar-001": [`h`, `hB`, `hb`, `H`], "ca-ES": [`H`, `h`, `hB`], "en-001": [`h`, `hb`, `H`, `hB`], "en-HK": [`h`, `hb`, `H`, `hB`], "en-IL": [`H`, `h`, `hb`, `hB`], "en-MY": [`h`, `hb`, `H`, `hB`], "es-BR": [`H`, `h`, `hB`, `hb`], "es-ES": [`H`, `h`, `hB`, `hb`], "es-GQ": [`H`, `h`, `hB`, `hb`], "fr-CA": [`H`, `h`, `hB`], "gl-ES": [`H`, `h`, `hB`], "gu-IN": [`hB`, `hb`, `h`, `H`], "hi-IN": [`hB`, `h`, `H`], "it-CH": [`H`, `h`, `hB`], "it-IT": [`H`, `h`, `hB`], "kn-IN": [`hB`, `h`, `H`], "ku-SY": [`H`, `hB`], "ml-IN": [`hB`, `h`, `H`], "mr-IN": [`hB`, `hb`, `h`, `H`], "pa-IN": [`hB`, `hb`, `h`, `H`], "ta-IN": [`hB`, `h`, `hb`, `H`], "te-IN": [`hB`, `h`, `H`], "zu-ZA": [`H`, `hB`, `hb`, `h`] };
|
|
2504
|
+
function Yi(e6, t2) {
|
|
2538
2505
|
let n2 = ``;
|
|
2539
2506
|
for (let r2 = 0; r2 < e6.length; r2++) {
|
|
2540
2507
|
let i2 = e6.charAt(r2);
|
|
2541
2508
|
if (i2 === `j`) {
|
|
2542
2509
|
let a2 = 0;
|
|
2543
2510
|
for (; r2 + 1 < e6.length && e6.charAt(r2 + 1) === i2; ) a2++, r2++;
|
|
2544
|
-
let o2 = 1 + (a2 & 1), s2 = a2 < 2 ? 1 : 3 + (a2 >> 1), c2 =
|
|
2511
|
+
let o2 = 1 + (a2 & 1), s2 = a2 < 2 ? 1 : 3 + (a2 >> 1), c2 = Xi(t2);
|
|
2545
2512
|
for ((c2 == `H` || c2 == `k`) && (s2 = 0); s2-- > 0; ) n2 += `a`;
|
|
2546
2513
|
for (; o2-- > 0; ) n2 = c2 + n2;
|
|
2547
2514
|
} else n2 += i2 === `J` ? `H` : i2;
|
|
2548
2515
|
}
|
|
2549
2516
|
return n2;
|
|
2550
2517
|
}
|
|
2551
|
-
function
|
|
2518
|
+
function Xi(e6) {
|
|
2552
2519
|
let t2 = e6.hourCycle;
|
|
2553
2520
|
if (t2 === void 0) {
|
|
2554
2521
|
let n3 = e6;
|
|
@@ -2567,36 +2534,36 @@ function ia(e6) {
|
|
|
2567
2534
|
throw Error(`Invalid hourCycle`);
|
|
2568
2535
|
}
|
|
2569
2536
|
let n2 = e6.language, r2;
|
|
2570
|
-
return n2 !== `root` && (r2 = e6.maximize().region), (
|
|
2537
|
+
return n2 !== `root` && (r2 = e6.maximize().region), (G[`${n2}-${r2}`] || G[r2 || ``] || G[n2 || ``] || G[`${n2}-001`] || G[`001`])[0].charAt(0);
|
|
2571
2538
|
}
|
|
2572
|
-
var
|
|
2573
|
-
var
|
|
2574
|
-
function
|
|
2539
|
+
var Zi = RegExp(`^${Ji.source}*`);
|
|
2540
|
+
var Qi = RegExp(`${Ji.source}*$`);
|
|
2541
|
+
function K(e6, t2) {
|
|
2575
2542
|
return { start: e6, end: t2 };
|
|
2576
2543
|
}
|
|
2577
|
-
var
|
|
2578
|
-
var
|
|
2579
|
-
var
|
|
2580
|
-
var
|
|
2544
|
+
var $i = !!Object.fromEntries;
|
|
2545
|
+
var ea = !!String.prototype.trimStart;
|
|
2546
|
+
var ta = !!String.prototype.trimEnd;
|
|
2547
|
+
var na = $i ? Object.fromEntries : function(e6) {
|
|
2581
2548
|
let t2 = {};
|
|
2582
2549
|
for (let [n2, r2] of e6) t2[n2] = r2;
|
|
2583
2550
|
return t2;
|
|
2584
2551
|
};
|
|
2585
|
-
var
|
|
2552
|
+
var ra = ea ? function(e6) {
|
|
2586
2553
|
return e6.trimStart();
|
|
2587
2554
|
} : function(e6) {
|
|
2588
|
-
return e6.replace(
|
|
2555
|
+
return e6.replace(Zi, ``);
|
|
2589
2556
|
};
|
|
2590
|
-
var
|
|
2557
|
+
var ia = ta ? function(e6) {
|
|
2591
2558
|
return e6.trimEnd();
|
|
2592
2559
|
} : function(e6) {
|
|
2593
|
-
return e6.replace(
|
|
2560
|
+
return e6.replace(Qi, ``);
|
|
2594
2561
|
};
|
|
2595
|
-
var
|
|
2596
|
-
function
|
|
2597
|
-
return
|
|
2562
|
+
var aa = RegExp(`([^\\p{White_Space}\\p{Pattern_Syntax}]*)`, `yu`);
|
|
2563
|
+
function oa(e6, t2) {
|
|
2564
|
+
return aa.lastIndex = t2, aa.exec(e6)[1] ?? ``;
|
|
2598
2565
|
}
|
|
2599
|
-
function
|
|
2566
|
+
function sa(e6) {
|
|
2600
2567
|
if (e6.length === 0) return null;
|
|
2601
2568
|
let t2 = 1, n2 = 1;
|
|
2602
2569
|
for (let r2 = 0; r2 < e6.length; ) {
|
|
@@ -2617,7 +2584,7 @@ function ha(e6) {
|
|
|
2617
2584
|
}
|
|
2618
2585
|
return { offset: e6.length, line: t2, column: n2 };
|
|
2619
2586
|
}
|
|
2620
|
-
var
|
|
2587
|
+
var ca = class {
|
|
2621
2588
|
constructor(e6, t2 = {}) {
|
|
2622
2589
|
this.message = e6, this.position = { offset: 0, line: 1, column: 1 }, this.ignoreTag = !!t2.ignoreTag, this.locale = t2.locale, this.requiresOtherClause = !!t2.requiresOtherClause, this.shouldParseSkeletons = !!t2.shouldParseSkeletons;
|
|
2623
2590
|
}
|
|
@@ -2626,10 +2593,10 @@ var ga = class {
|
|
|
2626
2593
|
if (this.message.length > 0) {
|
|
2627
2594
|
let e6 = this.message.charCodeAt(0);
|
|
2628
2595
|
if (e6 !== 35 && e6 !== 39 && e6 !== 60 && e6 !== 123 && e6 !== 125) {
|
|
2629
|
-
let e7 =
|
|
2596
|
+
let e7 = sa(this.message);
|
|
2630
2597
|
if (e7) {
|
|
2631
2598
|
let t2 = this.clonePosition();
|
|
2632
|
-
return this.position = e7, { val: [{ type: 0, value: this.message, location:
|
|
2599
|
+
return this.position = e7, { val: [{ type: 0, value: this.message, location: K(t2, this.clonePosition()) }], err: null };
|
|
2633
2600
|
}
|
|
2634
2601
|
}
|
|
2635
2602
|
}
|
|
@@ -2646,11 +2613,11 @@ var ga = class {
|
|
|
2646
2613
|
} else if (i2 === 125 && e6 > 0) break;
|
|
2647
2614
|
else if (i2 === 35 && (t2 === `plural` || t2 === `selectordinal`)) {
|
|
2648
2615
|
let e7 = this.clonePosition();
|
|
2649
|
-
this.bump(), r2.push({ type: 7, location:
|
|
2616
|
+
this.bump(), r2.push({ type: 7, location: K(e7, this.clonePosition()) });
|
|
2650
2617
|
} else if (i2 === 60 && !this.ignoreTag && this.peek() === 47) {
|
|
2651
2618
|
if (n2) break;
|
|
2652
|
-
return this.error(26,
|
|
2653
|
-
} else if (i2 === 60 && !this.ignoreTag &&
|
|
2619
|
+
return this.error(26, K(this.clonePosition(), this.clonePosition()));
|
|
2620
|
+
} else if (i2 === 60 && !this.ignoreTag && la(this.peek() || 0)) {
|
|
2654
2621
|
let n3 = this.parseTag(e6, t2);
|
|
2655
2622
|
if (n3.err) return n3;
|
|
2656
2623
|
r2.push(n3.val);
|
|
@@ -2666,23 +2633,23 @@ var ga = class {
|
|
|
2666
2633
|
let n2 = this.clonePosition();
|
|
2667
2634
|
this.bump();
|
|
2668
2635
|
let r2 = this.parseTagName();
|
|
2669
|
-
if (this.bumpSpace(), this.bumpIf(`/>`)) return { val: { type: 0, value: `<${r2}/>`, location:
|
|
2636
|
+
if (this.bumpSpace(), this.bumpIf(`/>`)) return { val: { type: 0, value: `<${r2}/>`, location: K(n2, this.clonePosition()) }, err: null };
|
|
2670
2637
|
if (this.bumpIf(`>`)) {
|
|
2671
2638
|
let i2 = this.parseMessage(e6 + 1, t2, true);
|
|
2672
2639
|
if (i2.err) return i2;
|
|
2673
2640
|
let a2 = i2.val, o2 = this.clonePosition();
|
|
2674
2641
|
if (this.bumpIf(`</`)) {
|
|
2675
|
-
if (this.isEOF() || !
|
|
2642
|
+
if (this.isEOF() || !la(this.char())) return this.error(23, K(o2, this.clonePosition()));
|
|
2676
2643
|
let e7 = this.clonePosition();
|
|
2677
|
-
return r2 === this.parseTagName() ? (this.bumpSpace(), this.bumpIf(`>`) ? { val: { type: 8, value: r2, children: a2, location:
|
|
2644
|
+
return r2 === this.parseTagName() ? (this.bumpSpace(), this.bumpIf(`>`) ? { val: { type: 8, value: r2, children: a2, location: K(n2, this.clonePosition()) }, err: null } : this.error(23, K(o2, this.clonePosition()))) : this.error(26, K(e7, this.clonePosition()));
|
|
2678
2645
|
}
|
|
2679
|
-
return this.error(27,
|
|
2646
|
+
return this.error(27, K(n2, this.clonePosition()));
|
|
2680
2647
|
}
|
|
2681
|
-
return this.error(23,
|
|
2648
|
+
return this.error(23, K(n2, this.clonePosition()));
|
|
2682
2649
|
}
|
|
2683
2650
|
parseTagName() {
|
|
2684
2651
|
let e6 = this.offset();
|
|
2685
|
-
for (this.bump(); !this.isEOF() &&
|
|
2652
|
+
for (this.bump(); !this.isEOF() && da(this.char()); ) this.bump();
|
|
2686
2653
|
return this.message.slice(e6, this.offset());
|
|
2687
2654
|
}
|
|
2688
2655
|
parseLiteral(e6, t2) {
|
|
@@ -2702,11 +2669,11 @@ var ga = class {
|
|
|
2702
2669
|
if (a2) r2 += a2;
|
|
2703
2670
|
else break;
|
|
2704
2671
|
}
|
|
2705
|
-
let i2 =
|
|
2672
|
+
let i2 = K(n2, this.clonePosition());
|
|
2706
2673
|
return { val: { type: 0, value: r2, location: i2 }, err: null };
|
|
2707
2674
|
}
|
|
2708
2675
|
tryParseLeftAngleBracket() {
|
|
2709
|
-
return !this.isEOF() && this.char() === 60 && (this.ignoreTag || !
|
|
2676
|
+
return !this.isEOF() && this.char() === 60 && (this.ignoreTag || !ua(this.peek() || 0)) ? (this.bump(), `<`) : null;
|
|
2710
2677
|
}
|
|
2711
2678
|
tryParseQuote(e6) {
|
|
2712
2679
|
if (this.isEOF() || this.char() !== 39) return null;
|
|
@@ -2746,29 +2713,29 @@ var ga = class {
|
|
|
2746
2713
|
}
|
|
2747
2714
|
parseArgument(e6, t2) {
|
|
2748
2715
|
let n2 = this.clonePosition();
|
|
2749
|
-
if (this.bump(), this.bumpSpace(), this.isEOF()) return this.error(1,
|
|
2750
|
-
if (this.char() === 125) return this.bump(), this.error(2,
|
|
2716
|
+
if (this.bump(), this.bumpSpace(), this.isEOF()) return this.error(1, K(n2, this.clonePosition()));
|
|
2717
|
+
if (this.char() === 125) return this.bump(), this.error(2, K(n2, this.clonePosition()));
|
|
2751
2718
|
let r2 = this.parseIdentifierIfPossible().value;
|
|
2752
|
-
if (!r2) return this.error(3,
|
|
2753
|
-
if (this.bumpSpace(), this.isEOF()) return this.error(1,
|
|
2719
|
+
if (!r2) return this.error(3, K(n2, this.clonePosition()));
|
|
2720
|
+
if (this.bumpSpace(), this.isEOF()) return this.error(1, K(n2, this.clonePosition()));
|
|
2754
2721
|
switch (this.char()) {
|
|
2755
2722
|
case 125:
|
|
2756
|
-
return this.bump(), { val: { type: 1, value: r2, location:
|
|
2723
|
+
return this.bump(), { val: { type: 1, value: r2, location: K(n2, this.clonePosition()) }, err: null };
|
|
2757
2724
|
case 44:
|
|
2758
|
-
return this.bump(), this.bumpSpace(), this.isEOF() ? this.error(1,
|
|
2725
|
+
return this.bump(), this.bumpSpace(), this.isEOF() ? this.error(1, K(n2, this.clonePosition())) : this.parseArgumentOptions(e6, t2, r2, n2);
|
|
2759
2726
|
default:
|
|
2760
|
-
return this.error(3,
|
|
2727
|
+
return this.error(3, K(n2, this.clonePosition()));
|
|
2761
2728
|
}
|
|
2762
2729
|
}
|
|
2763
2730
|
parseIdentifierIfPossible() {
|
|
2764
|
-
let e6 = this.clonePosition(), t2 = this.offset(), n2 =
|
|
2765
|
-
return this.bumpTo(r2), { value: n2, location:
|
|
2731
|
+
let e6 = this.clonePosition(), t2 = this.offset(), n2 = oa(this.message, t2), r2 = t2 + n2.length;
|
|
2732
|
+
return this.bumpTo(r2), { value: n2, location: K(e6, this.clonePosition()) };
|
|
2766
2733
|
}
|
|
2767
2734
|
parseArgumentOptions(e6, t2, n2, r2) {
|
|
2768
2735
|
let i2 = this.clonePosition(), a2 = this.parseIdentifierIfPossible().value, o2 = this.clonePosition();
|
|
2769
2736
|
switch (a2) {
|
|
2770
2737
|
case ``:
|
|
2771
|
-
return this.error(4,
|
|
2738
|
+
return this.error(4, K(i2, o2));
|
|
2772
2739
|
case `number`:
|
|
2773
2740
|
case `date`:
|
|
2774
2741
|
case `time`: {
|
|
@@ -2778,15 +2745,15 @@ var ga = class {
|
|
|
2778
2745
|
this.bumpSpace();
|
|
2779
2746
|
let t4 = this.clonePosition(), n3 = this.parseSimpleArgStyleIfPossible();
|
|
2780
2747
|
if (n3.err) return n3;
|
|
2781
|
-
let r3 =
|
|
2782
|
-
if (r3.length === 0) return this.error(6,
|
|
2783
|
-
e7 = { style: r3, styleLocation:
|
|
2748
|
+
let r3 = ia(n3.val);
|
|
2749
|
+
if (r3.length === 0) return this.error(6, K(this.clonePosition(), this.clonePosition()));
|
|
2750
|
+
e7 = { style: r3, styleLocation: K(t4, this.clonePosition()) };
|
|
2784
2751
|
}
|
|
2785
2752
|
let t3 = this.tryParseArgumentClose(r2);
|
|
2786
2753
|
if (t3.err) return t3;
|
|
2787
|
-
let i3 =
|
|
2754
|
+
let i3 = K(r2, this.clonePosition());
|
|
2788
2755
|
if (e7 && e7.style.startsWith(`::`)) {
|
|
2789
|
-
let t4 =
|
|
2756
|
+
let t4 = ra(e7.style.slice(2));
|
|
2790
2757
|
if (a2 === `number`) {
|
|
2791
2758
|
let r3 = this.parseNumberSkeletonFromString(t4, e7.styleLocation);
|
|
2792
2759
|
return r3.err ? r3 : { val: { type: 2, value: n2, location: i3, style: r3.val }, err: null };
|
|
@@ -2794,8 +2761,8 @@ var ga = class {
|
|
|
2794
2761
|
{
|
|
2795
2762
|
if (t4.length === 0) return this.error(10, i3);
|
|
2796
2763
|
let r3 = t4;
|
|
2797
|
-
this.locale && (r3 =
|
|
2798
|
-
let o3 = { type: 1, pattern: r3, location: e7.styleLocation, parsedOptions: this.shouldParseSkeletons ?
|
|
2764
|
+
this.locale && (r3 = Yi(t4, this.locale));
|
|
2765
|
+
let o3 = { type: 1, pattern: r3, location: e7.styleLocation, parsedOptions: this.shouldParseSkeletons ? Ci(r3) : {} };
|
|
2799
2766
|
return { val: { type: a2 === `date` ? 3 : 4, value: n2, location: i3, style: o3 }, err: null };
|
|
2800
2767
|
}
|
|
2801
2768
|
}
|
|
@@ -2805,11 +2772,11 @@ var ga = class {
|
|
|
2805
2772
|
case `selectordinal`:
|
|
2806
2773
|
case `select`: {
|
|
2807
2774
|
let i3 = this.clonePosition();
|
|
2808
|
-
if (this.bumpSpace(), !this.bumpIf(`,`)) return this.error(12,
|
|
2775
|
+
if (this.bumpSpace(), !this.bumpIf(`,`)) return this.error(12, K(i3, { ...i3 }));
|
|
2809
2776
|
this.bumpSpace();
|
|
2810
2777
|
let o3 = this.parseIdentifierIfPossible(), s2 = 0;
|
|
2811
2778
|
if (a2 !== `select` && o3.value === `offset`) {
|
|
2812
|
-
if (!this.bumpIf(`:`)) return this.error(13,
|
|
2779
|
+
if (!this.bumpIf(`:`)) return this.error(13, K(this.clonePosition(), this.clonePosition()));
|
|
2813
2780
|
this.bumpSpace();
|
|
2814
2781
|
let e7 = this.tryParseDecimalInteger(13, 14);
|
|
2815
2782
|
if (e7.err) return e7;
|
|
@@ -2819,15 +2786,15 @@ var ga = class {
|
|
|
2819
2786
|
if (c2.err) return c2;
|
|
2820
2787
|
let l2 = this.tryParseArgumentClose(r2);
|
|
2821
2788
|
if (l2.err) return l2;
|
|
2822
|
-
let u2 =
|
|
2823
|
-
return a2 === `select` ? { val: { type: 5, value: n2, options:
|
|
2789
|
+
let u2 = K(r2, this.clonePosition());
|
|
2790
|
+
return a2 === `select` ? { val: { type: 5, value: n2, options: na(c2.val), location: u2 }, err: null } : { val: { type: 6, value: n2, options: na(c2.val), offset: s2, pluralType: a2 === `plural` ? `cardinal` : `ordinal`, location: u2 }, err: null };
|
|
2824
2791
|
}
|
|
2825
2792
|
default:
|
|
2826
|
-
return this.error(5,
|
|
2793
|
+
return this.error(5, K(i2, o2));
|
|
2827
2794
|
}
|
|
2828
2795
|
}
|
|
2829
2796
|
tryParseArgumentClose(e6) {
|
|
2830
|
-
return this.isEOF() || this.char() !== 125 ? this.error(1,
|
|
2797
|
+
return this.isEOF() || this.char() !== 125 ? this.error(1, K(e6, this.clonePosition())) : (this.bump(), { val: true, err: null });
|
|
2831
2798
|
}
|
|
2832
2799
|
parseSimpleArgStyleIfPossible() {
|
|
2833
2800
|
let e6 = 0, t2 = this.clonePosition();
|
|
@@ -2835,7 +2802,7 @@ var ga = class {
|
|
|
2835
2802
|
case 39: {
|
|
2836
2803
|
this.bump();
|
|
2837
2804
|
let e7 = this.clonePosition();
|
|
2838
|
-
if (!this.bumpUntil(`'`)) return this.error(11,
|
|
2805
|
+
if (!this.bumpUntil(`'`)) return this.error(11, K(e7, this.clonePosition()));
|
|
2839
2806
|
this.bump();
|
|
2840
2807
|
break;
|
|
2841
2808
|
}
|
|
@@ -2854,11 +2821,11 @@ var ga = class {
|
|
|
2854
2821
|
parseNumberSkeletonFromString(e6, t2) {
|
|
2855
2822
|
let n2 = [];
|
|
2856
2823
|
try {
|
|
2857
|
-
n2 =
|
|
2824
|
+
n2 = Ti(e6);
|
|
2858
2825
|
} catch {
|
|
2859
2826
|
return this.error(7, t2);
|
|
2860
2827
|
}
|
|
2861
|
-
return { val: { type: 0, tokens: n2, location: t2, parsedOptions: this.shouldParseSkeletons ?
|
|
2828
|
+
return { val: { type: 0, tokens: n2, location: t2, parsedOptions: this.shouldParseSkeletons ? Fi(n2) : {} }, err: null };
|
|
2862
2829
|
}
|
|
2863
2830
|
tryParsePluralOrSelectOptions(e6, t2, n2, r2) {
|
|
2864
2831
|
let i2 = false, a2 = [], o2 = /* @__PURE__ */ new Set(), { value: s2, location: c2 } = r2;
|
|
@@ -2868,20 +2835,20 @@ var ga = class {
|
|
|
2868
2835
|
if (t2 !== `select` && this.bumpIf(`=`)) {
|
|
2869
2836
|
let t3 = this.tryParseDecimalInteger(16, 19);
|
|
2870
2837
|
if (t3.err) return t3;
|
|
2871
|
-
c2 =
|
|
2838
|
+
c2 = K(e7, this.clonePosition()), s2 = this.message.slice(e7.offset, this.offset());
|
|
2872
2839
|
} else break;
|
|
2873
2840
|
}
|
|
2874
2841
|
if (o2.has(s2)) return this.error(t2 === `select` ? 21 : 20, c2);
|
|
2875
2842
|
s2 === `other` && (i2 = true), this.bumpSpace();
|
|
2876
2843
|
let r3 = this.clonePosition();
|
|
2877
|
-
if (!this.bumpIf(`{`)) return this.error(t2 === `select` ? 17 : 18,
|
|
2844
|
+
if (!this.bumpIf(`{`)) return this.error(t2 === `select` ? 17 : 18, K(this.clonePosition(), this.clonePosition()));
|
|
2878
2845
|
let l2 = this.parseMessage(e6 + 1, t2, n2);
|
|
2879
2846
|
if (l2.err) return l2;
|
|
2880
2847
|
let u2 = this.tryParseArgumentClose(r3);
|
|
2881
2848
|
if (u2.err) return u2;
|
|
2882
|
-
a2.push([s2, { value: l2.val, location:
|
|
2849
|
+
a2.push([s2, { value: l2.val, location: K(r3, this.clonePosition()) }]), o2.add(s2), this.bumpSpace(), { value: s2, location: c2 } = this.parseIdentifierIfPossible();
|
|
2883
2850
|
}
|
|
2884
|
-
return a2.length === 0 ? this.error(t2 === `select` ? 15 : 16,
|
|
2851
|
+
return a2.length === 0 ? this.error(t2 === `select` ? 15 : 16, K(this.clonePosition(), this.clonePosition())) : this.requiresOtherClause && !i2 ? this.error(22, K(this.clonePosition(), this.clonePosition())) : { val: a2, err: null };
|
|
2885
2852
|
}
|
|
2886
2853
|
tryParseDecimalInteger(e6, t2) {
|
|
2887
2854
|
let n2 = 1, r2 = this.clonePosition();
|
|
@@ -2892,7 +2859,7 @@ var ga = class {
|
|
|
2892
2859
|
if (e7 >= 48 && e7 <= 57) i2 = true, a2 = a2 * 10 + (e7 - 48), this.bump();
|
|
2893
2860
|
else break;
|
|
2894
2861
|
}
|
|
2895
|
-
let o2 =
|
|
2862
|
+
let o2 = K(r2, this.clonePosition());
|
|
2896
2863
|
return i2 ? (a2 *= n2, Number.isSafeInteger(a2) ? { val: a2, err: null } : this.error(t2, o2)) : this.error(e6, o2);
|
|
2897
2864
|
}
|
|
2898
2865
|
offset() {
|
|
@@ -2940,7 +2907,7 @@ var ga = class {
|
|
|
2940
2907
|
}
|
|
2941
2908
|
}
|
|
2942
2909
|
bumpSpace() {
|
|
2943
|
-
for (; !this.isEOF() &&
|
|
2910
|
+
for (; !this.isEOF() && fa(this.char()); ) this.bump();
|
|
2944
2911
|
}
|
|
2945
2912
|
peek() {
|
|
2946
2913
|
if (this.isEOF()) return null;
|
|
@@ -2948,34 +2915,34 @@ var ga = class {
|
|
|
2948
2915
|
return this.message.charCodeAt(t2 + (e6 >= 65536 ? 2 : 1)) ?? null;
|
|
2949
2916
|
}
|
|
2950
2917
|
};
|
|
2951
|
-
function
|
|
2918
|
+
function la(e6) {
|
|
2952
2919
|
return e6 >= 97 && e6 <= 122 || e6 >= 65 && e6 <= 90;
|
|
2953
2920
|
}
|
|
2954
|
-
function
|
|
2955
|
-
return
|
|
2921
|
+
function ua(e6) {
|
|
2922
|
+
return la(e6) || e6 === 47;
|
|
2956
2923
|
}
|
|
2957
|
-
function
|
|
2924
|
+
function da(e6) {
|
|
2958
2925
|
return e6 === 45 || e6 === 46 || e6 >= 48 && e6 <= 57 || e6 === 95 || e6 >= 97 && e6 <= 122 || e6 >= 65 && e6 <= 90 || e6 == 183 || e6 >= 192 && e6 <= 214 || e6 >= 216 && e6 <= 246 || e6 >= 248 && e6 <= 893 || e6 >= 895 && e6 <= 8191 || e6 >= 8204 && e6 <= 8205 || e6 >= 8255 && e6 <= 8256 || e6 >= 8304 && e6 <= 8591 || e6 >= 11264 && e6 <= 12271 || e6 >= 12289 && e6 <= 55295 || e6 >= 63744 && e6 <= 64975 || e6 >= 65008 && e6 <= 65533 || e6 >= 65536 && e6 <= 983039;
|
|
2959
2926
|
}
|
|
2960
|
-
function
|
|
2927
|
+
function fa(e6) {
|
|
2961
2928
|
return e6 >= 9 && e6 <= 13 || e6 === 32 || e6 === 133 || e6 >= 8206 && e6 <= 8207 || e6 === 8232 || e6 === 8233;
|
|
2962
2929
|
}
|
|
2963
|
-
function
|
|
2930
|
+
function pa(e6) {
|
|
2964
2931
|
e6.forEach((e7) => {
|
|
2965
|
-
if (delete e7.location,
|
|
2966
|
-
else
|
|
2932
|
+
if (delete e7.location, Hi(e7) || Ui(e7)) for (let t2 in e7.options) delete e7.options[t2].location, pa(e7.options[t2].value);
|
|
2933
|
+
else zi(e7) && Ki(e7.style) || (Bi(e7) || Vi(e7)) && qi(e7.style) ? delete e7.style.location : Gi(e7) && pa(e7.children);
|
|
2967
2934
|
});
|
|
2968
2935
|
}
|
|
2969
|
-
function
|
|
2936
|
+
function ma(e6, t2 = {}) {
|
|
2970
2937
|
t2 = { shouldParseSkeletons: true, requiresOtherClause: true, ...t2 };
|
|
2971
|
-
let n2 = new
|
|
2938
|
+
let n2 = new ca(e6, t2).parse();
|
|
2972
2939
|
if (n2.err) {
|
|
2973
|
-
let e7 = SyntaxError(
|
|
2940
|
+
let e7 = SyntaxError(Ii[n2.err.kind]);
|
|
2974
2941
|
throw e7.location = n2.err.location, e7.originalMessage = n2.err.message, e7;
|
|
2975
2942
|
}
|
|
2976
|
-
return t2?.captureLocation ||
|
|
2943
|
+
return t2?.captureLocation || pa(n2.val), n2.val;
|
|
2977
2944
|
}
|
|
2978
|
-
var
|
|
2945
|
+
var ha = class extends Error {
|
|
2979
2946
|
constructor(e6, t2, n2) {
|
|
2980
2947
|
super(e6), this.code = t2, this.originalMessage = n2;
|
|
2981
2948
|
}
|
|
@@ -2983,54 +2950,54 @@ var Ca = class extends Error {
|
|
|
2983
2950
|
return `[formatjs Error: ${this.code}] ${this.message}`;
|
|
2984
2951
|
}
|
|
2985
2952
|
};
|
|
2986
|
-
var
|
|
2953
|
+
var ga = class extends ha {
|
|
2987
2954
|
constructor(e6, t2, n2, r2) {
|
|
2988
2955
|
super(`Invalid values for "${e6}": "${t2}". Options are "${Object.keys(n2).join(`", "`)}"`, `INVALID_VALUE`, r2);
|
|
2989
2956
|
}
|
|
2990
2957
|
};
|
|
2991
|
-
var
|
|
2958
|
+
var _a = class extends ha {
|
|
2992
2959
|
constructor(e6, t2, n2) {
|
|
2993
2960
|
super(`Value for "${e6}" must be of type ${t2}`, `INVALID_VALUE`, n2);
|
|
2994
2961
|
}
|
|
2995
2962
|
};
|
|
2996
|
-
var
|
|
2963
|
+
var va = class extends ha {
|
|
2997
2964
|
constructor(e6, t2) {
|
|
2998
2965
|
super(`The intl string context variable "${e6}" was not provided to the string "${t2}"`, `MISSING_VALUE`, t2);
|
|
2999
2966
|
}
|
|
3000
2967
|
};
|
|
3001
|
-
function
|
|
2968
|
+
function ya(e6) {
|
|
3002
2969
|
return e6.length < 2 ? e6 : e6.reduce((e7, t2) => {
|
|
3003
2970
|
let n2 = e7[e7.length - 1];
|
|
3004
2971
|
return !n2 || n2.type !== 0 || t2.type !== 0 ? e7.push(t2) : n2.value += t2.value, e7;
|
|
3005
2972
|
}, []);
|
|
3006
2973
|
}
|
|
3007
|
-
function
|
|
2974
|
+
function ba(e6) {
|
|
3008
2975
|
return typeof e6 == `function`;
|
|
3009
2976
|
}
|
|
3010
|
-
function
|
|
3011
|
-
if (e6.length === 1 &&
|
|
2977
|
+
function xa(e6, t2, n2, r2, i2, a2, o2) {
|
|
2978
|
+
if (e6.length === 1 && Li(e6[0])) return [{ type: 0, value: e6[0].value }];
|
|
3012
2979
|
let s2 = [];
|
|
3013
2980
|
for (let c2 of e6) {
|
|
3014
|
-
if (
|
|
2981
|
+
if (Li(c2)) {
|
|
3015
2982
|
s2.push({ type: 0, value: c2.value });
|
|
3016
2983
|
continue;
|
|
3017
2984
|
}
|
|
3018
|
-
if (
|
|
2985
|
+
if (Wi(c2)) {
|
|
3019
2986
|
typeof a2 == `number` && s2.push({ type: 0, value: n2.getNumberFormat(t2).format(a2) });
|
|
3020
2987
|
continue;
|
|
3021
2988
|
}
|
|
3022
2989
|
let { value: e7 } = c2;
|
|
3023
|
-
if (!(i2 && e7 in i2)) throw new
|
|
2990
|
+
if (!(i2 && e7 in i2)) throw new va(e7, o2);
|
|
3024
2991
|
let l2 = i2[e7];
|
|
3025
|
-
if (
|
|
3026
|
-
else if (
|
|
3027
|
-
let e8 = typeof c2.style == `string` ? r2.date[c2.style] :
|
|
2992
|
+
if (Ri(c2)) (!l2 || typeof l2 == `string` || typeof l2 == `number` || typeof l2 == `bigint`) && (l2 = typeof l2 == `string` || typeof l2 == `number` || typeof l2 == `bigint` ? String(l2) : ``), s2.push({ type: typeof l2 == `string` ? 0 : 1, value: l2 });
|
|
2993
|
+
else if (Bi(c2)) {
|
|
2994
|
+
let e8 = typeof c2.style == `string` ? r2.date[c2.style] : qi(c2.style) ? c2.style.parsedOptions : void 0;
|
|
3028
2995
|
s2.push({ type: 0, value: n2.getDateTimeFormat(t2, e8).format(l2) });
|
|
3029
|
-
} else if (
|
|
3030
|
-
let e8 = typeof c2.style == `string` ? r2.time[c2.style] :
|
|
2996
|
+
} else if (Vi(c2)) {
|
|
2997
|
+
let e8 = typeof c2.style == `string` ? r2.time[c2.style] : qi(c2.style) ? c2.style.parsedOptions : r2.time.medium;
|
|
3031
2998
|
s2.push({ type: 0, value: n2.getDateTimeFormat(t2, e8).format(l2) });
|
|
3032
|
-
} else if (
|
|
3033
|
-
let e8 = typeof c2.style == `string` ? r2.number[c2.style] :
|
|
2999
|
+
} else if (zi(c2)) {
|
|
3000
|
+
let e8 = typeof c2.style == `string` ? r2.number[c2.style] : Ki(c2.style) ? c2.style.parsedOptions : void 0;
|
|
3034
3001
|
if (e8 && e8.scale) {
|
|
3035
3002
|
let t3 = e8.scale || 1;
|
|
3036
3003
|
if (typeof l2 == `bigint`) {
|
|
@@ -3040,40 +3007,40 @@ function ka(e6, t2, n2, r2, i2, a2, o2) {
|
|
|
3040
3007
|
}
|
|
3041
3008
|
s2.push({ type: 0, value: n2.getNumberFormat(t2, e8).format(l2) });
|
|
3042
3009
|
} else {
|
|
3043
|
-
if (
|
|
3010
|
+
if (Gi(c2)) {
|
|
3044
3011
|
let { children: e8, value: l3 } = c2, u2 = i2[l3];
|
|
3045
|
-
if (!
|
|
3046
|
-
let d2 = u2(
|
|
3012
|
+
if (!ba(u2)) throw new _a(l3, `function`, o2);
|
|
3013
|
+
let d2 = u2(xa(e8, t2, n2, r2, i2, a2).map((e9) => e9.value));
|
|
3047
3014
|
Array.isArray(d2) || (d2 = [d2]), s2.push(...d2.map((e9) => ({ type: typeof e9 == `string` ? 0 : 1, value: e9 })));
|
|
3048
3015
|
}
|
|
3049
|
-
if (
|
|
3016
|
+
if (Hi(c2)) {
|
|
3050
3017
|
let e8 = l2, a3 = (Object.prototype.hasOwnProperty.call(c2.options, e8) ? c2.options[e8] : void 0) || c2.options.other;
|
|
3051
|
-
if (!a3) throw new
|
|
3052
|
-
s2.push(...
|
|
3053
|
-
} else if (
|
|
3018
|
+
if (!a3) throw new ga(c2.value, l2, Object.keys(c2.options), o2);
|
|
3019
|
+
s2.push(...xa(a3.value, t2, n2, r2, i2));
|
|
3020
|
+
} else if (Ui(c2)) {
|
|
3054
3021
|
let e8 = `=${l2}`, a3 = Object.prototype.hasOwnProperty.call(c2.options, e8) ? c2.options[e8] : void 0;
|
|
3055
3022
|
if (!a3) {
|
|
3056
|
-
if (!Intl.PluralRules) throw new
|
|
3023
|
+
if (!Intl.PluralRules) throw new ha(`Intl.PluralRules is not available in this environment.
|
|
3057
3024
|
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
3058
3025
|
`, `MISSING_INTL_API`, o2);
|
|
3059
3026
|
let e9 = typeof l2 == `bigint` ? Number(l2) : l2, r3 = n2.getPluralRules(t2, { type: c2.pluralType }).select(e9 - (c2.offset || 0));
|
|
3060
3027
|
a3 = (Object.prototype.hasOwnProperty.call(c2.options, r3) ? c2.options[r3] : void 0) || c2.options.other;
|
|
3061
3028
|
}
|
|
3062
|
-
if (!a3) throw new
|
|
3029
|
+
if (!a3) throw new ga(c2.value, l2, Object.keys(c2.options), o2);
|
|
3063
3030
|
let u2 = typeof l2 == `bigint` ? Number(l2) : l2;
|
|
3064
|
-
s2.push(...
|
|
3031
|
+
s2.push(...xa(a3.value, t2, n2, r2, i2, u2 - (c2.offset || 0)));
|
|
3065
3032
|
}
|
|
3066
3033
|
}
|
|
3067
3034
|
}
|
|
3068
|
-
return
|
|
3035
|
+
return ya(s2);
|
|
3069
3036
|
}
|
|
3070
|
-
function
|
|
3037
|
+
function Sa(e6, t2) {
|
|
3071
3038
|
return t2 ? { ...e6, ...t2, ...Object.keys(e6).reduce((n2, r2) => (n2[r2] = { ...e6[r2], ...t2[r2] }, n2), {}) } : e6;
|
|
3072
3039
|
}
|
|
3073
|
-
function
|
|
3074
|
-
return t2 ? Object.keys(e6).reduce((n2, r2) => (n2[r2] =
|
|
3040
|
+
function Ca(e6, t2) {
|
|
3041
|
+
return t2 ? Object.keys(e6).reduce((n2, r2) => (n2[r2] = Sa(e6[r2], t2[r2]), n2), { ...e6 }) : e6;
|
|
3075
3042
|
}
|
|
3076
|
-
function
|
|
3043
|
+
function wa(e6) {
|
|
3077
3044
|
return { create() {
|
|
3078
3045
|
return { get(t2) {
|
|
3079
3046
|
return e6[t2];
|
|
@@ -3082,23 +3049,23 @@ function Ma(e6) {
|
|
|
3082
3049
|
} };
|
|
3083
3050
|
} };
|
|
3084
3051
|
}
|
|
3085
|
-
function
|
|
3086
|
-
return { getNumberFormat:
|
|
3052
|
+
function Ta(e6 = { number: {}, dateTime: {}, pluralRules: {} }) {
|
|
3053
|
+
return { getNumberFormat: ui((...e7) => new Intl.NumberFormat(...e7), { cache: wa(e6.number), strategy: xi.variadic }), getDateTimeFormat: ui((...e7) => new Intl.DateTimeFormat(...e7), { cache: wa(e6.dateTime), strategy: xi.variadic }), getPluralRules: ui((...e7) => new Intl.PluralRules(...e7), { cache: wa(e6.pluralRules), strategy: xi.variadic }) };
|
|
3087
3054
|
}
|
|
3088
|
-
var
|
|
3055
|
+
var Ea = class e5 {
|
|
3089
3056
|
constructor(t2, n2 = e5.defaultLocale, r2, i2) {
|
|
3090
3057
|
if (this.formatterCache = { number: {}, dateTime: {}, pluralRules: {} }, this.format = (e6) => {
|
|
3091
3058
|
let t3 = this.formatToParts(e6);
|
|
3092
3059
|
if (t3.length === 1) return t3[0].value;
|
|
3093
3060
|
let n3 = t3.reduce((e7, t4) => (!e7.length || t4.type !== 0 || typeof e7[e7.length - 1] != `string` ? e7.push(t4.value) : e7[e7.length - 1] += t4.value, e7), []);
|
|
3094
3061
|
return n3.length <= 1 ? n3[0] || `` : n3;
|
|
3095
|
-
}, this.formatToParts = (e6) =>
|
|
3062
|
+
}, this.formatToParts = (e6) => xa(this.ast, this.locales, this.formatters, this.formats, e6, void 0, this.message), this.resolvedOptions = () => ({ locale: this.resolvedLocale?.toString() || Intl.NumberFormat.supportedLocalesOf(this.locales)[0] }), this.getAst = () => this.ast, this.locales = n2, this.resolvedLocale = e5.resolveLocale(n2), typeof t2 == `string`) {
|
|
3096
3063
|
if (this.message = t2, !e5.__parse) throw TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
|
|
3097
3064
|
let { ...n3 } = i2 || {};
|
|
3098
3065
|
this.ast = e5.__parse(t2, { ...n3, locale: this.resolvedLocale });
|
|
3099
3066
|
} else this.ast = t2;
|
|
3100
3067
|
if (!Array.isArray(this.ast)) throw TypeError(`A message must be provided as a String or AST.`);
|
|
3101
|
-
this.formats =
|
|
3068
|
+
this.formats = Ca(e5.formats, r2), this.formatters = i2 && i2.formatters || Ta(this.formatterCache);
|
|
3102
3069
|
}
|
|
3103
3070
|
static {
|
|
3104
3071
|
this.memoizedDefaultLocale = null;
|
|
@@ -3114,32 +3081,66 @@ var Pa = class e5 {
|
|
|
3114
3081
|
};
|
|
3115
3082
|
}
|
|
3116
3083
|
static {
|
|
3117
|
-
this.__parse =
|
|
3084
|
+
this.__parse = ma;
|
|
3118
3085
|
}
|
|
3119
3086
|
static {
|
|
3120
3087
|
this.formats = { number: { integer: { maximumFractionDigits: 0 }, currency: { style: `currency` }, percent: { style: `percent` } }, date: { short: { month: `numeric`, day: `numeric`, year: `2-digit` }, medium: { month: `short`, day: `numeric`, year: `numeric` }, long: { month: `long`, day: `numeric`, year: `numeric` }, full: { weekday: `long`, month: `long`, day: `numeric`, year: `numeric` } }, time: { short: { hour: `numeric`, minute: `numeric` }, medium: { hour: `numeric`, minute: `numeric`, second: `numeric` }, long: { hour: `numeric`, minute: `numeric`, second: `numeric`, timeZoneName: `short` }, full: { hour: `numeric`, minute: `numeric`, second: `numeric`, timeZoneName: `short` } } };
|
|
3121
3088
|
}
|
|
3122
3089
|
};
|
|
3123
|
-
|
|
3124
|
-
|
|
3090
|
+
var Da = [`__proto__`, `constructor`, `prototype`];
|
|
3091
|
+
function Oa(e6, t2, n2) {
|
|
3092
|
+
function r2(e7) {
|
|
3093
|
+
return e7 && e7.indexOf(`###`) > -1 ? e7.replace(/###/g, `.`) : e7;
|
|
3094
|
+
}
|
|
3095
|
+
function i2() {
|
|
3096
|
+
return !e6 || typeof e6 == `string`;
|
|
3097
|
+
}
|
|
3098
|
+
for (var a2 = typeof t2 == `string` ? t2.split(`.`) : [].concat(t2); a2.length > 1; ) {
|
|
3099
|
+
if (i2()) return {};
|
|
3100
|
+
var o2 = r2(a2.shift());
|
|
3101
|
+
if (Da.indexOf(o2) > -1) return {};
|
|
3102
|
+
!e6[o2] && n2 && (e6[o2] = new n2()), e6 = e6[o2];
|
|
3103
|
+
}
|
|
3104
|
+
if (i2()) return {};
|
|
3105
|
+
var s2 = r2(a2.shift());
|
|
3106
|
+
return Da.indexOf(s2) > -1 ? {} : { obj: e6, k: s2 };
|
|
3107
|
+
}
|
|
3108
|
+
function ka(e6, t2, n2) {
|
|
3109
|
+
var r2 = Oa(e6, t2, Object), i2 = r2.obj, a2 = r2.k;
|
|
3110
|
+
i2 !== void 0 && (i2[a2] = n2);
|
|
3111
|
+
}
|
|
3112
|
+
function Aa(e6, t2) {
|
|
3113
|
+
var n2 = Oa(e6, t2), r2 = n2.obj, i2 = n2.k;
|
|
3114
|
+
if (r2) return r2[i2];
|
|
3125
3115
|
}
|
|
3126
|
-
function
|
|
3116
|
+
function ja(e6) {
|
|
3117
|
+
return [...arguments].slice(1).forEach(function(t2) {
|
|
3118
|
+
if (t2) for (var n2 = 0, r2 = Object.keys(t2); n2 < r2.length; n2++) {
|
|
3119
|
+
var i2 = r2[n2];
|
|
3120
|
+
Da.indexOf(i2) > -1 || e6[i2] === void 0 && (e6[i2] = t2[i2]);
|
|
3121
|
+
}
|
|
3122
|
+
}), e6;
|
|
3123
|
+
}
|
|
3124
|
+
function Ma(e6, t2) {
|
|
3125
|
+
return La(e6) || Ia(e6, t2) || Pa(e6, t2) || Na();
|
|
3126
|
+
}
|
|
3127
|
+
function Na() {
|
|
3127
3128
|
throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3128
3129
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
3129
3130
|
}
|
|
3130
|
-
function
|
|
3131
|
+
function Pa(e6, t2) {
|
|
3131
3132
|
if (e6) {
|
|
3132
|
-
if (typeof e6 == `string`) return
|
|
3133
|
+
if (typeof e6 == `string`) return Fa(e6, t2);
|
|
3133
3134
|
var n2 = {}.toString.call(e6).slice(8, -1);
|
|
3134
|
-
return n2 === `Object` && e6.constructor && (n2 = e6.constructor.name), n2 === `Map` || n2 === `Set` ? Array.from(e6) : n2 === `Arguments` || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2) ?
|
|
3135
|
+
return n2 === `Object` && e6.constructor && (n2 = e6.constructor.name), n2 === `Map` || n2 === `Set` ? Array.from(e6) : n2 === `Arguments` || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2) ? Fa(e6, t2) : void 0;
|
|
3135
3136
|
}
|
|
3136
3137
|
}
|
|
3137
|
-
function
|
|
3138
|
+
function Fa(e6, t2) {
|
|
3138
3139
|
(t2 == null || t2 > e6.length) && (t2 = e6.length);
|
|
3139
3140
|
for (var n2 = 0, r2 = Array(t2); n2 < t2; n2++) r2[n2] = e6[n2];
|
|
3140
3141
|
return r2;
|
|
3141
3142
|
}
|
|
3142
|
-
function
|
|
3143
|
+
function Ia(e6, t2) {
|
|
3143
3144
|
var n2 = e6 == null ? null : typeof Symbol < `u` && e6[Symbol.iterator] || e6[`@@iterator`];
|
|
3144
3145
|
if (n2 != null) {
|
|
3145
3146
|
var r2, i2, a2, o2, s2 = [], c2 = true, l2 = false;
|
|
@@ -3160,18 +3161,10 @@ function za(e6, t2) {
|
|
|
3160
3161
|
return s2;
|
|
3161
3162
|
}
|
|
3162
3163
|
}
|
|
3163
|
-
function
|
|
3164
|
+
function La(e6) {
|
|
3164
3165
|
if (Array.isArray(e6)) return e6;
|
|
3165
3166
|
}
|
|
3166
|
-
function
|
|
3167
|
-
"@babel/helpers - typeof";
|
|
3168
|
-
return K = typeof Symbol == `function` && typeof Symbol.iterator == `symbol` ? function(e7) {
|
|
3169
|
-
return typeof e7;
|
|
3170
|
-
} : function(e7) {
|
|
3171
|
-
return e7 && typeof Symbol == `function` && e7.constructor === Symbol && e7 !== Symbol.prototype ? `symbol` : typeof e7;
|
|
3172
|
-
}, K(e6);
|
|
3173
|
-
}
|
|
3174
|
-
function Va(e6, t2) {
|
|
3167
|
+
function Ra(e6, t2) {
|
|
3175
3168
|
var n2 = Object.keys(e6);
|
|
3176
3169
|
if (Object.getOwnPropertySymbols) {
|
|
3177
3170
|
var r2 = Object.getOwnPropertySymbols(e6);
|
|
@@ -3181,85 +3174,121 @@ function Va(e6, t2) {
|
|
|
3181
3174
|
}
|
|
3182
3175
|
return n2;
|
|
3183
3176
|
}
|
|
3184
|
-
function
|
|
3177
|
+
function za(e6) {
|
|
3185
3178
|
for (var t2 = 1; t2 < arguments.length; t2++) {
|
|
3186
3179
|
var n2 = arguments[t2] == null ? {} : arguments[t2];
|
|
3187
|
-
t2 % 2 ?
|
|
3188
|
-
|
|
3189
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e6, Object.getOwnPropertyDescriptors(n2)) :
|
|
3180
|
+
t2 % 2 ? Ra(Object(n2), true).forEach(function(t3) {
|
|
3181
|
+
Ba(e6, t3, n2[t3]);
|
|
3182
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e6, Object.getOwnPropertyDescriptors(n2)) : Ra(Object(n2)).forEach(function(t3) {
|
|
3190
3183
|
Object.defineProperty(e6, t3, Object.getOwnPropertyDescriptor(n2, t3));
|
|
3191
3184
|
});
|
|
3192
3185
|
}
|
|
3193
3186
|
return e6;
|
|
3194
3187
|
}
|
|
3195
|
-
function
|
|
3196
|
-
return (t2 =
|
|
3188
|
+
function Ba(e6, t2, n2) {
|
|
3189
|
+
return (t2 = Wa(t2)) in e6 ? Object.defineProperty(e6, t2, { value: n2, enumerable: true, configurable: true, writable: true }) : e6[t2] = n2, e6;
|
|
3197
3190
|
}
|
|
3198
|
-
function
|
|
3191
|
+
function Va(e6, t2) {
|
|
3199
3192
|
if (!(e6 instanceof t2)) throw TypeError(`Cannot call a class as a function`);
|
|
3200
3193
|
}
|
|
3201
|
-
function
|
|
3194
|
+
function Ha(e6, t2) {
|
|
3202
3195
|
for (var n2 = 0; n2 < t2.length; n2++) {
|
|
3203
3196
|
var r2 = t2[n2];
|
|
3204
|
-
r2.enumerable = r2.enumerable || false, r2.configurable = true, `value` in r2 && (r2.writable = true), Object.defineProperty(e6,
|
|
3197
|
+
r2.enumerable = r2.enumerable || false, r2.configurable = true, `value` in r2 && (r2.writable = true), Object.defineProperty(e6, Wa(r2.key), r2);
|
|
3205
3198
|
}
|
|
3206
3199
|
}
|
|
3207
|
-
function
|
|
3208
|
-
return t2 &&
|
|
3200
|
+
function Ua(e6, t2, n2) {
|
|
3201
|
+
return t2 && Ha(e6.prototype, t2), n2 && Ha(e6, n2), Object.defineProperty(e6, "prototype", { writable: false }), e6;
|
|
3209
3202
|
}
|
|
3210
|
-
function
|
|
3211
|
-
var t2 =
|
|
3212
|
-
return
|
|
3203
|
+
function Wa(e6) {
|
|
3204
|
+
var t2 = Ga(e6, `string`);
|
|
3205
|
+
return q(t2) == `symbol` ? t2 : t2 + ``;
|
|
3213
3206
|
}
|
|
3214
|
-
function
|
|
3215
|
-
if (
|
|
3207
|
+
function Ga(e6, t2) {
|
|
3208
|
+
if (q(e6) != `object` || !e6) return e6;
|
|
3216
3209
|
var n2 = e6[Symbol.toPrimitive];
|
|
3217
3210
|
if (n2 !== void 0) {
|
|
3218
3211
|
var r2 = n2.call(e6, t2 || `default`);
|
|
3219
|
-
if (
|
|
3212
|
+
if (q(r2) != `object`) return r2;
|
|
3220
3213
|
throw TypeError(`@@toPrimitive must return a primitive value.`);
|
|
3221
3214
|
}
|
|
3222
3215
|
return (t2 === `string` ? String : Number)(e6);
|
|
3223
3216
|
}
|
|
3224
|
-
function
|
|
3217
|
+
function q(e6) {
|
|
3218
|
+
"@babel/helpers - typeof";
|
|
3219
|
+
return q = typeof Symbol == `function` && typeof Symbol.iterator == `symbol` ? function(e7) {
|
|
3220
|
+
return typeof e7;
|
|
3221
|
+
} : function(e7) {
|
|
3222
|
+
return e7 && typeof Symbol == `function` && e7.constructor === Symbol && e7 !== Symbol.prototype ? `symbol` : typeof e7;
|
|
3223
|
+
}, q(e6);
|
|
3224
|
+
}
|
|
3225
|
+
var Ka = `https://www.i18next.com/how-to/using-icu-or-mf2`;
|
|
3226
|
+
var qa = [`zero`, `one`, `two`, `few`, `many`, `other`];
|
|
3227
|
+
function Ja() {
|
|
3225
3228
|
return { memoize: true, memoizeFallback: false, bindI18n: ``, bindI18nStore: ``, parseErrorHandler: function(e6, t2, n2, r2) {
|
|
3226
3229
|
return n2;
|
|
3227
3230
|
}, parseLngForICU: function(e6) {
|
|
3228
3231
|
return e6;
|
|
3229
3232
|
}, escapeVariables: false };
|
|
3230
3233
|
}
|
|
3234
|
+
function Ya(e6, t2, n2, r2) {
|
|
3235
|
+
return n2 && t2 && q(t2) === `object` ? `${r2} resolved to an object or array, but i18next-icu does not support returnObjects or joinArrays and returns the raw value unformatted.` : n2 && typeof t2 == `string` && t2.indexOf(`{{`) > -1 ? `${r2} could not be parsed (${e6.message}). It contains "{{": i18next interpolation like {{name}} does not work with ICU, use {name}.` : `${r2} could not be ${n2 ? `parsed` : `formatted`}: ${e6.message}`;
|
|
3236
|
+
}
|
|
3231
3237
|
var Xa = function() {
|
|
3232
3238
|
function e6(t2) {
|
|
3233
|
-
|
|
3239
|
+
Va(this, e6), this.type = `i18nFormat`, this.mem = {}, this.warned = /* @__PURE__ */ new Set(), this.init(null, t2);
|
|
3234
3240
|
}
|
|
3235
|
-
return
|
|
3241
|
+
return Ua(e6, [{ key: `init`, value: function(e7, t2) {
|
|
3236
3242
|
var n2 = this, r2 = e7 && e7.options && e7.options.i18nFormat || {};
|
|
3237
|
-
if (this.options =
|
|
3243
|
+
if (this.options = ja(r2, t2, this.options || {}, Ja()), this.formats = this.options.formats, e7) {
|
|
3238
3244
|
var i2 = this.options, a2 = i2.bindI18n, o2 = i2.bindI18nStore, s2 = i2.memoize;
|
|
3239
|
-
e7.IntlMessageFormat =
|
|
3245
|
+
e7.IntlMessageFormat = Ea, e7.ICU = this, this.i18next = e7, this.debug = !!(e7.options && e7.options.debug), this.debug && e7.options.interpolation && e7.options.interpolation.escapeValue !== false && !this.options.escapeVariables && this.warn(`interpolation.escapeValue is not applied, values are inserted without HTML escaping. Set the i18next-icu option escapeVariables: true to escape them, or interpolation.escapeValue: false if your output is escaped elsewhere (e.g. by React).`), s2 && (a2 && e7.on(a2, function() {
|
|
3240
3246
|
return n2.clearCache();
|
|
3241
3247
|
}), o2 && e7.store.on(o2, function() {
|
|
3242
3248
|
return n2.clearCache();
|
|
3243
3249
|
}));
|
|
3244
3250
|
}
|
|
3245
3251
|
} }, { key: `addUserDefinedFormats`, value: function(e7) {
|
|
3246
|
-
this.formats = this.formats ?
|
|
3252
|
+
this.formats = this.formats ? za(za({}, this.formats), e7) : e7, this.clearCache();
|
|
3247
3253
|
} }, { key: `parse`, value: function(e7, t2, n2, r2, i2, a2) {
|
|
3248
|
-
var o2 = a2 && a2.resolved && a2.resolved.res, s2 = this.options.memoize &&
|
|
3249
|
-
this.options.memoize
|
|
3254
|
+
var o2 = a2 && a2.resolved && a2.resolved.res, s2 = this.options.memoize && [n2, r2, i2], c2;
|
|
3255
|
+
if (this.options.memoize) {
|
|
3256
|
+
var l2 = Aa(this.mem, s2);
|
|
3257
|
+
l2 && l2.res === e7 && (c2 = l2.fc);
|
|
3258
|
+
}
|
|
3250
3259
|
try {
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
return this.
|
|
3260
|
+
c2 || (this.debug && typeof e7 == `string` && e7.indexOf(`$t(`) > -1 && this.firstTime(`nesting ${n2} ${r2} ${i2}`) && this.warn(`key "${i2}" (${n2}/${r2}) contains "$t(", but i18next-icu does not support nesting, the text is output as is.`), c2 = new Ea(e7, this.options.parseLngForICU(n2), this.formats, { ignoreTag: true }), this.options.memoize && (this.options.memoizeFallback || !a2 || o2) && ka(this.mem, s2, { res: e7, fc: c2 }));
|
|
3261
|
+
var u2 = t2 && t2.replace && q(t2.replace) === `object` ? za(za({}, t2), t2.replace) : t2;
|
|
3262
|
+
return c2.format(this.escapeVariableValues(u2));
|
|
3263
|
+
} catch (a3) {
|
|
3264
|
+
return this.debug && this.firstTime(`error ${n2} ${r2} ${i2}`) && this.warn(Ya(a3, e7, !c2, `key "${i2}" (${n2}/${r2})`)), this.options.parseErrorHandler(a3, i2, e7, t2);
|
|
3254
3265
|
}
|
|
3255
3266
|
} }, { key: `addLookupKeys`, value: function(e7, t2, n2, r2, i2) {
|
|
3256
|
-
return e7;
|
|
3267
|
+
return this.debug && i2 && this.checkSuffixKeys(t2, n2, r2, i2), e7;
|
|
3268
|
+
} }, { key: `checkSuffixKeys`, value: function(e7, t2, n2, r2) {
|
|
3269
|
+
var i2 = r2.count, a2 = r2.context, o2 = this.i18next.options, s2 = o2.pluralSeparator, c2 = s2 === void 0 ? `_` : s2, l2 = o2.contextSeparator, u2 = l2 === void 0 ? `_` : l2, d2 = this.i18next.services.resourceStore, f2 = `key "${e7}" (${t2}/${n2})`;
|
|
3270
|
+
if (i2 !== void 0 && this.firstTime(`plural ${t2} ${n2} ${e7}`)) {
|
|
3271
|
+
var p2 = qa.concat(qa.map(function(e8) {
|
|
3272
|
+
return `ordinal${c2}${e8}`;
|
|
3273
|
+
})).map(function(t3) {
|
|
3274
|
+
return `${e7}${c2}${t3}`;
|
|
3275
|
+
}).filter(function(e8) {
|
|
3276
|
+
return d2.getResource(t2, n2, e8) !== void 0;
|
|
3277
|
+
});
|
|
3278
|
+
p2.length && this.warn(`${f2} was called with count, but i18next-icu does not look up plural suffix keys (${p2.join(`, `)}). Put the plural into the message: {count, plural, one {# item} other {# items}}.`);
|
|
3279
|
+
}
|
|
3280
|
+
var m2 = `${e7}${u2}${a2}`;
|
|
3281
|
+
a2 !== void 0 && a2 !== `` && this.firstTime(`context ${t2} ${n2} ${m2}`) && d2.getResource(t2, n2, m2) !== void 0 && this.warn(`${f2} was called with context "${a2}", but i18next-icu does not look up context keys (${m2}). Use a select in the message: {context, select, ${a2} {...} other {...}}.`);
|
|
3282
|
+
} }, { key: `firstTime`, value: function(e7) {
|
|
3283
|
+
return !this.warned.has(e7) && (this.warned.add(e7), true);
|
|
3284
|
+
} }, { key: `warn`, value: function(e7) {
|
|
3285
|
+
this.i18next.services.logger.warn(`i18next-icu: ${e7} See ${Ka}`);
|
|
3257
3286
|
} }, { key: `clearCache`, value: function() {
|
|
3258
3287
|
this.mem = {};
|
|
3259
3288
|
} }, { key: `escapeVariableValues`, value: function(e7) {
|
|
3260
|
-
if (!this.options.escapeVariables || !e7 ||
|
|
3289
|
+
if (!this.options.escapeVariables || !e7 || q(e7) !== `object`) return e7;
|
|
3261
3290
|
for (var t2 = {}, n2 = 0, r2 = Object.entries(e7); n2 < r2.length; n2++) {
|
|
3262
|
-
var i2 =
|
|
3291
|
+
var i2 = Ma(r2[n2], 2), a2 = i2[0], o2 = i2[1];
|
|
3263
3292
|
t2[a2] = typeof o2 == `string` ? o2.replace(/&/g, `&`).replace(/</g, `<`).replace(/>/g, `>`).replace(/"/g, `"`).replace(/'/g, `'`) : o2;
|
|
3264
3293
|
}
|
|
3265
3294
|
return t2;
|
|
@@ -3273,11 +3302,11 @@ function Za({ icuOptions: e6 = {}, ...t2 }) {
|
|
|
3273
3302
|
var Qa = (e6, t2, n2, r2) => {
|
|
3274
3303
|
let i2 = [n2, { code: t2, ...r2 || {} }];
|
|
3275
3304
|
if (e6?.services?.logger?.forward) return e6.services.logger.forward(i2, `warn`, `react-i18next::`, true);
|
|
3276
|
-
|
|
3305
|
+
J(i2[0]) && (i2[0] = `react-i18next:: ${i2[0]}`), e6?.services?.logger?.warn ? e6.services.logger.warn(...i2) : console?.warn && console.warn(...i2);
|
|
3277
3306
|
};
|
|
3278
3307
|
var $a = {};
|
|
3279
3308
|
var eo = (e6, t2, n2, r2) => {
|
|
3280
|
-
|
|
3309
|
+
J(n2) && $a[n2] || (J(n2) && ($a[n2] = /* @__PURE__ */ new Date()), Qa(e6, t2, n2, r2));
|
|
3281
3310
|
};
|
|
3282
3311
|
var to = (e6, t2) => () => {
|
|
3283
3312
|
if (e6.isInitialized) t2();
|
|
@@ -3294,7 +3323,7 @@ var no = (e6, t2, n2) => {
|
|
|
3294
3323
|
e6.loadNamespaces(t2, to(e6, n2));
|
|
3295
3324
|
};
|
|
3296
3325
|
var ro = (e6, t2, n2, r2) => {
|
|
3297
|
-
if (
|
|
3326
|
+
if (J(n2) && (n2 = [n2]), e6.options.preload && e6.options.preload.indexOf(t2) > -1) return no(e6, n2, r2);
|
|
3298
3327
|
n2.forEach((t3) => {
|
|
3299
3328
|
e6.options.ns.indexOf(t3) < 0 && e6.options.ns.push(t3);
|
|
3300
3329
|
}), e6.loadLanguages(t2, to(e6, r2));
|
|
@@ -3302,7 +3331,7 @@ var ro = (e6, t2, n2, r2) => {
|
|
|
3302
3331
|
var io = (e6, t2, n2 = {}) => !t2.languages || !t2.languages.length ? (eo(t2, `NO_LANGUAGES`, `i18n.languages were undefined or empty`, { languages: t2.languages }), true) : t2.hasLoadedNamespace(e6, { lng: n2.lng, precheck: (t3, r2) => {
|
|
3303
3332
|
if (n2.bindI18n && n2.bindI18n.indexOf(`languageChanging`) > -1 && t3.services.backendConnector.backend && t3.isLanguageChangingTo && !r2(t3.isLanguageChangingTo, e6)) return false;
|
|
3304
3333
|
} });
|
|
3305
|
-
var
|
|
3334
|
+
var J = (e6) => typeof e6 == `string`;
|
|
3306
3335
|
var ao = (e6) => typeof e6 == `object` && !!e6;
|
|
3307
3336
|
var oo = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
|
|
3308
3337
|
var so = { "&": `&`, "&": `&`, "<": `<`, "<": `<`, ">": `>`, ">": `>`, "'": `'`, "'": `'`, """: `"`, """: `"`, " ": ` `, " ": ` `, "©": `\xA9`, "©": `\xA9`, "®": `\xAE`, "®": `\xAE`, "…": `\u2026`, "…": `\u2026`, "/": `/`, "/": `/` };
|
|
@@ -3337,12 +3366,12 @@ var yo = (e6, t2 = {}) => {
|
|
|
3337
3366
|
let { i18n: n2 } = t2, { i18n: r2, defaultNS: i2 } = c(mo) || {}, a2 = n2 || r2 || po();
|
|
3338
3367
|
if (a2 && !a2.reportNamespaces && (a2.reportNamespaces = new ho()), !a2) {
|
|
3339
3368
|
eo(a2, `NO_I18NEXT_INSTANCE`, `useTranslation: You will need to pass in an i18next instance by using initReactI18next`);
|
|
3340
|
-
let e7 = (e8, t4) =>
|
|
3369
|
+
let e7 = (e8, t4) => J(t4) ? t4 : ao(t4) && J(t4.defaultValue) ? t4.defaultValue : Array.isArray(e8) ? e8[e8.length - 1] : e8, t3 = [e7, {}, false];
|
|
3341
3370
|
return t3.t = e7, t3.i18n = {}, t3.ready = false, t3;
|
|
3342
3371
|
}
|
|
3343
3372
|
a2.options.react?.wait && eo(a2, `DEPRECATED_OPTION`, `useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.`);
|
|
3344
3373
|
let o2 = { ...uo(), ...a2.options.react, ...t2 }, { useSuspense: s2, keyPrefix: u2 } = o2, p2 = e6 || i2 || a2.options?.defaultNS;
|
|
3345
|
-
p2 =
|
|
3374
|
+
p2 = J(p2) ? [p2] : p2 || [`translation`], a2.reportNamespaces.addUsedNamespaces?.(p2);
|
|
3346
3375
|
let m2 = (a2.isInitialized || a2.initializedStoreOnce) && p2.every((e7) => io(e7, a2, o2)), h2 = vo(a2, t2.lng || null, o2.nsMode === `fallback` ? p2 : p2[0], u2), g2 = () => h2, _2 = () => _o(a2, t2.lng || null, o2.nsMode === `fallback` ? p2 : p2[0], u2), [v2, y2] = f(g2), b2 = p2.join();
|
|
3347
3376
|
t2.lng && (b2 = `${t2.lng}${b2}`);
|
|
3348
3377
|
let x2 = go(b2), S2 = d(true);
|
|
@@ -3372,8 +3401,8 @@ function bo({ i18n: e6, defaultNS: t2, children: n2 }) {
|
|
|
3372
3401
|
let r2 = u(() => ({ i18n: e6, defaultNS: t2 }), [e6, t2]);
|
|
3373
3402
|
return a(mo.Provider, { value: r2 }, n2);
|
|
3374
3403
|
}
|
|
3375
|
-
var xo =
|
|
3376
|
-
var So =
|
|
3404
|
+
var xo = I(`@wix/site-service-locale`);
|
|
3405
|
+
var So = I(`@wix/site-service-renderer-configuration`);
|
|
3377
3406
|
var Co = () => {
|
|
3378
3407
|
let e6, t2;
|
|
3379
3408
|
try {
|
|
@@ -3468,9 +3497,9 @@ function Go(e6) {
|
|
|
3468
3497
|
let t2 = Co(), n2 = Fo()?.locale ?? t2 ?? `en`;
|
|
3469
3498
|
return { i18n: Lo(n2, e6), locale: n2 };
|
|
3470
3499
|
}
|
|
3471
|
-
var Ko =
|
|
3500
|
+
var Ko = y({ default: () => qo });
|
|
3472
3501
|
var qo = { "post.time-to-read": `{count, plural, one {# min read} other {# min read}}`, "post.view-count": `{count, plural, one {{formatted} view} other {{formatted} views}}`, "post.comment-count": `{count, plural, one {{formatted} comment} other {{formatted} comments}}`, "post.like-count": `{count, plural, one {{formatted} like} other {{formatted} likes}}`, "post-list.empty-state.title": `No posts yet`, "post-list.empty-state.description": `Once posts are published, they will appear here.`, "related-posts.empty-state.title": `No related posts yet`, "related-posts.empty-state.description": `Once more posts are published, they will appear here.`, "post-actions.like": `Like post`, "post-actions.unlike": `Unlike post`, "post-actions.share": `Share post`, "post-actions.share-dialog": `Share post`, "post-actions.link-copied": `Link copied`, "post-actions.copy-manually": `Copy the link below to share this post.`, "post-actions.link-label": `Post link`, "post-actions.copy-link": `Copy link`, "post-actions.close": `Close`, "post-counters.loading-likes": `Loading likes`, "cover-media.play": `Play video`, "cover-media.placeholder-alt": `Post cover image`, "post-comments.loading": `Loading comments\u2026`, "post-comments.no-post": `No post resolved for this URL yet.`, "post-comments.unavailable": `Comments are unavailable \u2014 no app instance.`, "post-comments.demo-notice": `Sample comments are shown while editing. Visitors will see real comments.`, "canvas.post-title": `Post Title`, "canvas.author-name": `Author Name`, "canvas.excerpt": `Share the key idea of your post here. This short summary shows on feed cards and in search results, and tells readers why the post is worth their time.`, "canvas.content": `This is where the full post appears. Write your story here, add images, galleries and video from the dashboard, and use headings and quotes to keep it easy to read.`, "canvas.category": `Category`, "canvas.category-numbered": `Category {number}`, "canvas.tag-numbered": `Tag {number}`, "canvas.author-photo-alt": `Author photo`, "category-header.all-posts": `All Posts` };
|
|
3473
|
-
var Jo =
|
|
3502
|
+
var Jo = y({ default: () => Xo, title: () => Yo });
|
|
3474
3503
|
var Yo = `My App`;
|
|
3475
3504
|
var Xo = { "canvas.category": `Category`, "post-list.empty-state.description": `Once posts are published, they will appear here.`, "canvas.tag-numbered": `Tag {number}`, "cover-media.play": `Play video`, "post-comments.unavailable": `Comments are unavailable \u2014 no app instance.`, "post-counters.loading-likes": `Loading likes`, "post-comments.loading": `Loading comments\u2026`, "post-actions.like": `Like post`, "canvas.content": `This is where the full post appears. Write your story here, add images, galleries and video from the dashboard, and use headings and quotes to keep it easy to read.`, "related-posts.empty-state.title": `No related posts yet`, "post.time-to-read": `{count, plural, one {# min read} other {# min read}}`, "post-actions.link-copied": `Link copied`, "category-header.all-posts": `All Posts`, "post-actions.copy-manually": `Copy the link below to share this post.`, "post-actions.copy-link": `Copy link`, "cover-media.placeholder-alt": `Post cover image`, "post-actions.link-label": `Post link`, "post-list.empty-state.title": `No posts yet`, "post-actions.share-dialog": `Share post`, "canvas.post-title": `Post Title`, "post-actions.unlike": `Unlike post`, "post-comments.no-post": `No post resolved for this URL yet.`, "post.like-count": `{count, plural, one {{formatted} like} other {{formatted} likes}}`, "canvas.category-numbered": `Category {number}`, "post.comment-count": `{count, plural, one {{formatted} comment} other {{formatted} comments}}`, "post-actions.share": `Share post`, "post.view-count": `{count, plural, one {{formatted} view} other {{formatted} views}}`, "post-actions.close": `Close`, "canvas.category-description": `Add a short description of this category so readers know what they will find here. It shows under the category title, above the posts.`, "canvas.author-photo-alt": `Author photo`, "canvas.author-name": `Author Name`, "post-comments.demo-notice": `Sample comments are shown while editing. Visitors will see real comments.`, title: Yo, "related-posts.empty-state.description": `Once more posts are published, they will appear here.`, "canvas.excerpt": `Share the key idea of your post here. This short summary shows on feed cards and in search results, and tells readers why the post is worth their time.` };
|
|
3476
3505
|
var Zo = Object.assign({ "../assets/locale/messages_en.dev.json": Ko, "../assets/locale/messages_en.json": Jo });
|
|
@@ -3487,7 +3516,7 @@ function ns(e6) {
|
|
|
3487
3516
|
var rs = `@wix/auto_sdk_blog_post-paywalls`;
|
|
3488
3517
|
function is(e6) {
|
|
3489
3518
|
function t2({ host: t3 }) {
|
|
3490
|
-
return { entityFqdn: `wix.blog.blog_paywall_service.v1.post_paywall`, method: `GET`, methodFqn: `wix.blog.blog_paywall_service.v1.PostPaywallService.GetPostPaywall`, packageName: rs, migrationOptions: { optInTransformResponse: true }, url: ns({ protoPath: `/v1/post-paywalls/{postFqdn}/{postId}`, data: e6, host: t3 }), params: N(e6), transformResponse: (e7) => A(e7, [{ transformFn:
|
|
3519
|
+
return { entityFqdn: `wix.blog.blog_paywall_service.v1.post_paywall`, method: `GET`, methodFqn: `wix.blog.blog_paywall_service.v1.PostPaywallService.GetPostPaywall`, packageName: rs, migrationOptions: { optInTransformResponse: true }, url: ns({ protoPath: `/v1/post-paywalls/{postFqdn}/{postId}`, data: e6, host: t3 }), params: N(e6), transformResponse: (e7) => A(e7, [{ transformFn: F, paths: es }, { transformFn: k, paths: ts }]) };
|
|
3491
3520
|
}
|
|
3492
3521
|
return t2;
|
|
3493
3522
|
}
|
|
@@ -3515,7 +3544,7 @@ function ls(e6) {
|
|
|
3515
3544
|
function us(e6) {
|
|
3516
3545
|
return Object.keys(e6).length === 1 && `$not` in e6 && typeof e6.$not == `object`;
|
|
3517
3546
|
}
|
|
3518
|
-
function
|
|
3547
|
+
function Y(e6, t2) {
|
|
3519
3548
|
return e6 === void 0 || Object.keys(e6).length === 0 ? t2 : t2 === void 0 || Object.keys(t2).length === 0 ? e6 : { $and: [...cs(e6) ? e6.$and : [e6], ...cs(t2) ? t2.$and : [t2]] };
|
|
3520
3549
|
}
|
|
3521
3550
|
function ds(e6, t2) {
|
|
@@ -3594,7 +3623,7 @@ var hs = class extends ps {
|
|
|
3594
3623
|
function gs(e6) {
|
|
3595
3624
|
let t2 = (n2) => ({ query: n2, async find() {
|
|
3596
3625
|
try {
|
|
3597
|
-
let r2 = e6.requestTransformer(e6.pagingMethod === `CURSOR` && n2.cursorPaging.cursor ? { cursorPaging: n2.cursorPaging } : n2), i2 = await e6.func(r2), { [
|
|
3626
|
+
let r2 = e6.requestTransformer(e6.pagingMethod === `CURSOR` && n2.cursorPaging.cursor ? { cursorPaging: n2.cursorPaging } : n2), i2 = await e6.func(r2), { [$e]: a2, [et]: o2 } = e6.responseTransformer(i2);
|
|
3598
3627
|
if (e6.pagingMethod === `OFFSET`) {
|
|
3599
3628
|
let e7 = n2;
|
|
3600
3629
|
return new hs({ items: a2 ?? [], fetchNextPage: () => t2({ ...e7, paging: { offset: e7.paging.offset + e7.paging.limit, limit: e7.paging.limit } }).find(), fetchPrevPage: () => t2({ ...n2, paging: { offset: Math.max(e7.paging.offset - e7.paging.limit, 0), limit: e7.paging.limit } }).find(), offset: e7.paging.offset, limit: e7.paging.limit, totalCount: o2?.total, tooManyToCount: o2?.tooManyToCount, originQuery: this });
|
|
@@ -3607,60 +3636,60 @@ function gs(e6) {
|
|
|
3607
3636
|
}, skipTo(e7) {
|
|
3608
3637
|
return t2({ ...n2, cursorPaging: { cursor: e7, limit: n2.cursorPaging.limit } });
|
|
3609
3638
|
}, eq(r2, i2) {
|
|
3610
|
-
let a2 = i2 === void 0 ? null : i2, o2 = { [
|
|
3611
|
-
return t2({ ...n2, filter:
|
|
3639
|
+
let a2 = i2 === void 0 ? null : i2, o2 = { [X(e6.transformationPaths, r2)]: a2 };
|
|
3640
|
+
return t2({ ...n2, filter: Y(n2.filter, o2) });
|
|
3612
3641
|
}, ne(r2, i2) {
|
|
3613
|
-
let a2 = i2 === void 0 ? null : i2, o2 = { [
|
|
3614
|
-
return t2({ ...n2, filter:
|
|
3642
|
+
let a2 = i2 === void 0 ? null : i2, o2 = { [X(e6.transformationPaths, r2)]: { $ne: a2 } };
|
|
3643
|
+
return t2({ ...n2, filter: Y(n2.filter, o2) });
|
|
3615
3644
|
}, ge(r2, i2) {
|
|
3616
|
-
let a2 = { [
|
|
3617
|
-
return t2({ ...n2, filter:
|
|
3645
|
+
let a2 = { [X(e6.transformationPaths, r2)]: { $gte: i2 } };
|
|
3646
|
+
return t2({ ...n2, filter: Y(n2.filter, a2) });
|
|
3618
3647
|
}, gt(r2, i2) {
|
|
3619
|
-
let a2 = { [
|
|
3620
|
-
return t2({ ...n2, filter:
|
|
3648
|
+
let a2 = { [X(e6.transformationPaths, r2)]: { $gt: i2 } };
|
|
3649
|
+
return t2({ ...n2, filter: Y(n2.filter, a2) });
|
|
3621
3650
|
}, le(r2, i2) {
|
|
3622
|
-
let a2 = { [
|
|
3623
|
-
return t2({ ...n2, filter:
|
|
3651
|
+
let a2 = { [X(e6.transformationPaths, r2)]: { $lte: i2 } };
|
|
3652
|
+
return t2({ ...n2, filter: Y(n2.filter, a2) });
|
|
3624
3653
|
}, lt(r2, i2) {
|
|
3625
|
-
let a2 = { [
|
|
3626
|
-
return t2({ ...n2, filter:
|
|
3654
|
+
let a2 = { [X(e6.transformationPaths, r2)]: { $lt: i2 } };
|
|
3655
|
+
return t2({ ...n2, filter: Y(n2.filter, a2) });
|
|
3627
3656
|
}, isNotEmpty(e7) {
|
|
3628
3657
|
return this.ne(e7, null);
|
|
3629
3658
|
}, isEmpty(e7) {
|
|
3630
3659
|
return this.eq(e7, null);
|
|
3631
3660
|
}, startsWith(r2, i2) {
|
|
3632
|
-
let a2 = { [
|
|
3633
|
-
return t2({ ...n2, filter:
|
|
3661
|
+
let a2 = { [X(e6.transformationPaths, r2)]: { $startsWith: i2 } };
|
|
3662
|
+
return t2({ ...n2, filter: Y(n2.filter, a2) });
|
|
3634
3663
|
}, endsWith(r2, i2) {
|
|
3635
|
-
let a2 = { [
|
|
3636
|
-
return t2({ ...n2, filter:
|
|
3664
|
+
let a2 = { [X(e6.transformationPaths, r2)]: { $endsWith: i2 } };
|
|
3665
|
+
return t2({ ...n2, filter: Y(n2.filter, a2) });
|
|
3637
3666
|
}, contains(r2, i2) {
|
|
3638
|
-
let a2 = { [
|
|
3639
|
-
return t2({ ...n2, filter:
|
|
3667
|
+
let a2 = { [X(e6.transformationPaths, r2)]: { $contains: i2 } };
|
|
3668
|
+
return t2({ ...n2, filter: Y(n2.filter, a2) });
|
|
3640
3669
|
}, hasSome(r2, ...i2) {
|
|
3641
|
-
let a2 = { [
|
|
3642
|
-
return t2({ ...n2, filter:
|
|
3670
|
+
let a2 = { [X(e6.transformationPaths, r2)]: { $hasSome: Array.isArray(i2[0]) ? i2[0] : i2 } };
|
|
3671
|
+
return t2({ ...n2, filter: Y(n2.filter, a2) });
|
|
3643
3672
|
}, hasAll(r2, ...i2) {
|
|
3644
|
-
let a2 = { [
|
|
3645
|
-
return t2({ ...n2, filter:
|
|
3673
|
+
let a2 = { [X(e6.transformationPaths, r2)]: { $hasAll: Array.isArray(i2[0]) ? i2[0] : i2 } };
|
|
3674
|
+
return t2({ ...n2, filter: Y(n2.filter, a2) });
|
|
3646
3675
|
}, between(e7, t3, n3) {
|
|
3647
3676
|
return this.ge(e7, t3).lt(e7, n3);
|
|
3648
3677
|
}, in(r2, i2) {
|
|
3649
|
-
let a2 = { [
|
|
3650
|
-
return t2({ ...n2, filter:
|
|
3678
|
+
let a2 = { [X(e6.transformationPaths, r2)]: { $in: i2 } };
|
|
3679
|
+
return t2({ ...n2, filter: Y(n2.filter, a2) });
|
|
3651
3680
|
}, exists(r2, i2 = true) {
|
|
3652
|
-
let a2 = { [
|
|
3653
|
-
return t2({ ...n2, filter:
|
|
3681
|
+
let a2 = { [X(e6.transformationPaths, r2)]: { $exists: i2 } };
|
|
3682
|
+
return t2({ ...n2, filter: Y(n2.filter, a2) });
|
|
3654
3683
|
}, or(e7) {
|
|
3655
3684
|
return t2({ ...n2, filter: ds(n2.filter, e7.query.filter) });
|
|
3656
3685
|
}, and(e7) {
|
|
3657
|
-
return t2({ ...n2, filter:
|
|
3686
|
+
return t2({ ...n2, filter: Y(n2.filter, e7.query.filter) });
|
|
3658
3687
|
}, not(e7) {
|
|
3659
3688
|
return t2({ ...n2, filter: fs(e7.query.filter) });
|
|
3660
3689
|
}, ascending(...r2) {
|
|
3661
|
-
return t2({ ...n2, sort: [...n2.sort ?? [], ...r2.map((t3) => ({ fieldName:
|
|
3690
|
+
return t2({ ...n2, sort: [...n2.sort ?? [], ...r2.map((t3) => ({ fieldName: X(e6.transformationPaths, t3), order: `ASC` }))] });
|
|
3662
3691
|
}, descending(...r2) {
|
|
3663
|
-
return t2({ ...n2, sort: [...n2.sort ?? [], ...r2.map((t3) => ({ fieldName:
|
|
3692
|
+
return t2({ ...n2, sort: [...n2.sort ?? [], ...r2.map((t3) => ({ fieldName: X(e6.transformationPaths, t3), order: `DESC` }))] });
|
|
3664
3693
|
}, skip(e7) {
|
|
3665
3694
|
return t2({ ...n2, paging: { offset: e7, limit: `limit` in n2.paging ? n2.paging.limit : 50 } });
|
|
3666
3695
|
}, limit(r2) {
|
|
@@ -3673,9 +3702,9 @@ function gs(e6) {
|
|
|
3673
3702
|
} });
|
|
3674
3703
|
return t2({ filter: {}, ...e6.pagingMethod === `OFFSET` ? { paging: { offset: 0, limit: 50 } } : { cursorPaging: { limit: 50 } } });
|
|
3675
3704
|
}
|
|
3676
|
-
function
|
|
3705
|
+
function X(e6, t2) {
|
|
3677
3706
|
let n2 = Object.entries(e6).find(([e7]) => e7 === t2 || t2.startsWith(`${e7}.`))?.[0];
|
|
3678
|
-
return n2 ? t2.replace(n2, e6[n2]) :
|
|
3707
|
+
return n2 ? t2.replace(n2, e6[n2]) : nt(t2, { ...e6, ...tt });
|
|
3679
3708
|
}
|
|
3680
3709
|
var _s = `filter`;
|
|
3681
3710
|
var vs = `sort`;
|
|
@@ -3719,7 +3748,7 @@ function js(e6) {
|
|
|
3719
3748
|
var Ms = `@wix/auto_sdk_blog_likes`;
|
|
3720
3749
|
function Ns(e6) {
|
|
3721
3750
|
function t2({ host: t3 }) {
|
|
3722
|
-
let n2 = A(e6, [{ transformFn:
|
|
3751
|
+
let n2 = A(e6, [{ transformFn: st, paths: ks }]);
|
|
3723
3752
|
return { entityFqdn: `wix.blog.v1.like`, method: `POST`, methodFqn: `wix.blog.v1.LikeService.CreateLike`, packageName: Ms, migrationOptions: { optInTransformResponse: true }, url: js({ protoPath: `/v1/likes`, data: n2, host: t3 }), data: n2, transformResponse: (e7) => A(e7, [{ transformFn: k, paths: ks }]) };
|
|
3724
3753
|
}
|
|
3725
3754
|
return t2;
|
|
@@ -3828,7 +3857,7 @@ function Qs(e6) {
|
|
|
3828
3857
|
var $s = `@wix/auto_sdk_blog_categories`;
|
|
3829
3858
|
function ec(e6) {
|
|
3830
3859
|
function t2({ host: t3 }) {
|
|
3831
|
-
return { entityFqdn: `wix.blog.v3.category`, method: `GET`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.CategoryService.ListCategories`, packageName: $s, migrationOptions: { optInTransformResponse: true }, url: Qs({ protoPath: `/v3/categories`, data: e6, host: t3 }), params: N(e6), transformResponse: (e7) => A(e7, [{ transformFn: k, paths: Xs }, { transformFn:
|
|
3860
|
+
return { entityFqdn: `wix.blog.v3.category`, method: `GET`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.CategoryService.ListCategories`, packageName: $s, migrationOptions: { optInTransformResponse: true }, url: Qs({ protoPath: `/v3/categories`, data: e6, host: t3 }), params: N(e6), transformResponse: (e7) => A(e7, [{ transformFn: k, paths: Xs }, { transformFn: F, paths: Zs }]) };
|
|
3832
3861
|
}
|
|
3833
3862
|
return t2;
|
|
3834
3863
|
}
|
|
@@ -3864,7 +3893,7 @@ function oc(e6) {
|
|
|
3864
3893
|
}
|
|
3865
3894
|
return e6.id ? `wix:video://v1/${e6.id}${t2}${n2}` : e6.url;
|
|
3866
3895
|
}
|
|
3867
|
-
var sc = [{ path: `post.firstPublishedDate` }, { path: `post.lastPublishedDate` }, { path: `post.heroImage.urlExpirationDate` }, { path: `post.richContent.metadata.createdTimestamp` }, { path: `post.richContent.metadata.updatedTimestamp` }, { path: `post.moderationDetails.submittedDate` }, { path: `post.moderationDetails.moderationDate` }, { path: `post.media.wixMedia.image.urlExpirationDate` }, { path: `post.media.wixMedia.videoV2.urlExpirationDate` }, { path: `post.media.wixMedia.videoV2.resolutions.urlExpirationDate` }, { path: `post.media.wixMedia.videoV2.resolutions.poster.urlExpirationDate` }, { path: `post.media.wixMedia.videoV2.posters.urlExpirationDate` }];
|
|
3896
|
+
var sc = [{ path: `post.firstPublishedDate` }, { path: `post.lastPublishedDate` }, { path: `post.expirationDate` }, { path: `post.heroImage.urlExpirationDate` }, { path: `post.richContent.metadata.createdTimestamp` }, { path: `post.richContent.metadata.updatedTimestamp` }, { path: `post.moderationDetails.submittedDate` }, { path: `post.moderationDetails.moderationDate` }, { path: `post.media.wixMedia.image.urlExpirationDate` }, { path: `post.media.wixMedia.videoV2.urlExpirationDate` }, { path: `post.media.wixMedia.videoV2.resolutions.urlExpirationDate` }, { path: `post.media.wixMedia.videoV2.resolutions.poster.urlExpirationDate` }, { path: `post.media.wixMedia.videoV2.posters.urlExpirationDate` }];
|
|
3868
3897
|
var cc = [{ path: `post.richContentCompressed` }];
|
|
3869
3898
|
var lc = [{ path: `post.heroImage.focalPoint.x` }, { path: `post.heroImage.focalPoint.y` }, { path: `post.media.wixMedia.image.focalPoint.x` }, { path: `post.media.wixMedia.image.focalPoint.y` }, { path: `post.media.wixMedia.videoV2.resolutions.poster.focalPoint.x` }, { path: `post.media.wixMedia.videoV2.resolutions.poster.focalPoint.y` }, { path: `post.media.wixMedia.videoV2.posters.focalPoint.x` }, { path: `post.media.wixMedia.videoV2.posters.focalPoint.y` }, { path: `post.metrics.averageRating` }, { path: `post.richContent.nodes.buttonData.styles.background.gradient.centerX` }, { path: `post.richContent.nodes.buttonData.styles.background.gradient.centerY` }, { path: `post.richContent.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `post.richContent.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `post.richContent.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `post.richContent.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `post.richContent.nodes.galleryData.items.image.media.duration` }, { path: `post.richContent.nodes.galleryData.items.video.media.duration` }, { path: `post.richContent.nodes.galleryData.items.video.thumbnail.duration` }, { path: `post.richContent.nodes.galleryData.options.item.ratio` }, { path: `post.richContent.nodes.imageData.image.duration` }, { path: `post.richContent.nodes.imageData.crop.x` }, { path: `post.richContent.nodes.imageData.crop.y` }, { path: `post.richContent.nodes.imageData.crop.width` }, { path: `post.richContent.nodes.imageData.crop.height` }, { path: `post.richContent.nodes.mapData.mapSettings.lat` }, { path: `post.richContent.nodes.mapData.mapSettings.lng` }, { path: `post.richContent.nodes.pollData.poll.image.duration` }, { path: `post.richContent.nodes.pollData.poll.options.image.duration` }, { path: `post.richContent.nodes.pollData.design.poll.background.image.duration` }, { path: `post.richContent.nodes.textData.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `post.richContent.nodes.textData.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `post.richContent.nodes.textData.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `post.richContent.nodes.textData.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `post.richContent.nodes.textData.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `post.richContent.nodes.textData.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `post.richContent.nodes.appEmbedData.image.duration` }, { path: `post.richContent.nodes.videoData.video.duration` }, { path: `post.richContent.nodes.videoData.thumbnail.duration` }, { path: `post.richContent.nodes.audioData.audio.duration` }, { path: `post.richContent.nodes.audioData.coverImage.duration` }, { path: `post.richContent.nodes.layoutData.backgroundImage.media.duration` }, { path: `post.richContent.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `post.richContent.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `post.richContent.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `post.richContent.nodes.layoutData.backdropImage.media.duration` }, { path: `post.richContent.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `post.richContent.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `post.richContent.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `post.richContent.nodes.layoutData.background.gradient.centerX` }, { path: `post.richContent.nodes.layoutData.background.gradient.centerY` }, { path: `post.richContent.nodes.layoutData.background.gradient.stops.position` }, { path: `post.richContent.nodes.layoutData.backdrop.gradient.centerX` }, { path: `post.richContent.nodes.layoutData.backdrop.gradient.centerY` }, { path: `post.richContent.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `post.richContent.nodes.shapeData.shape.duration` }, { path: `post.richContent.nodes.cardData.background.gradient.centerX` }, { path: `post.richContent.nodes.cardData.background.gradient.centerY` }, { path: `post.richContent.nodes.cardData.background.gradient.stops.position` }, { path: `post.richContent.nodes.cardData.backgroundImage.media.duration` }, { path: `post.richContent.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `post.richContent.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `post.richContent.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `post.richContent.nodes.tocData.fontSize` }, { path: `post.richContent.nodes.tocData.itemSpacing` }, { path: `post.richContent.nodes.smartBlockCellData.shape.duration` }, { path: `post.richContent.documentStyle.headerOne.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.headerOne.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.headerOne.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `post.richContent.documentStyle.headerOne.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.headerOne.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.headerOne.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `post.richContent.documentStyle.headerTwo.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.headerTwo.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.headerTwo.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `post.richContent.documentStyle.headerTwo.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.headerTwo.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.headerTwo.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `post.richContent.documentStyle.headerThree.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.headerThree.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.headerThree.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `post.richContent.documentStyle.headerThree.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.headerThree.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.headerThree.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `post.richContent.documentStyle.headerFour.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.headerFour.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.headerFour.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `post.richContent.documentStyle.headerFour.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.headerFour.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.headerFour.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `post.richContent.documentStyle.headerFive.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.headerFive.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.headerFive.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `post.richContent.documentStyle.headerFive.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.headerFive.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.headerFive.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `post.richContent.documentStyle.headerSix.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.headerSix.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.headerSix.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `post.richContent.documentStyle.headerSix.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.headerSix.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.headerSix.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `post.richContent.documentStyle.paragraph.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.paragraph.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.paragraph.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `post.richContent.documentStyle.paragraph.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.paragraph.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.paragraph.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `post.richContent.documentStyle.blockquote.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.blockquote.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.blockquote.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `post.richContent.documentStyle.blockquote.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.blockquote.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.blockquote.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `post.richContent.documentStyle.codeBlock.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.codeBlock.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.codeBlock.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `post.richContent.documentStyle.codeBlock.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `post.richContent.documentStyle.codeBlock.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `post.richContent.documentStyle.codeBlock.decorations.colorData.backgroundStyle.gradient.stops.position` }];
|
|
3870
3899
|
var uc = [{ path: `metrics.averageRating` }];
|
|
@@ -3874,20 +3903,20 @@ function dc(e6) {
|
|
|
3874
3903
|
var fc = `@wix/auto_sdk_blog_posts`;
|
|
3875
3904
|
function pc(e6) {
|
|
3876
3905
|
function t2({ host: t3 }) {
|
|
3877
|
-
return { entityFqdn: `wix.blog.v3.post`, method: `GET`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.PostService.GetPost`, packageName: fc, migrationOptions: { optInTransformResponse: true }, url: dc({ protoPath: `/v3/posts/{postId}`, data: e6, host: t3 }), params: N(e6), transformResponse: (e7) => A(e7, [{ transformFn: k, paths: sc }, { transformFn: fn, paths: cc }, { transformFn:
|
|
3906
|
+
return { entityFqdn: `wix.blog.v3.post`, method: `GET`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.PostService.GetPost`, packageName: fc, migrationOptions: { optInTransformResponse: true }, url: dc({ protoPath: `/v3/posts/{postId}`, data: e6, host: t3 }), params: N(e6), transformResponse: (e7) => A(e7, [{ transformFn: k, paths: sc }, { transformFn: fn, paths: cc }, { transformFn: F, paths: lc }]) };
|
|
3878
3907
|
}
|
|
3879
3908
|
return t2;
|
|
3880
3909
|
}
|
|
3881
3910
|
function mc(e6) {
|
|
3882
3911
|
function t2({ host: t3 }) {
|
|
3883
|
-
return { entityFqdn: `wix.blog.v3.post`, method: `GET`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.PostService.GetPostMetrics`, packageName: fc, migrationOptions: { optInTransformResponse: true }, url: dc({ protoPath: `/v3/posts/{postId}/metrics`, data: e6, host: t3 }), params: N(e6), transformResponse: (e7) => A(e7, [{ transformFn:
|
|
3912
|
+
return { entityFqdn: `wix.blog.v3.post`, method: `GET`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.PostService.GetPostMetrics`, packageName: fc, migrationOptions: { optInTransformResponse: true }, url: dc({ protoPath: `/v3/posts/{postId}/metrics`, data: e6, host: t3 }), params: N(e6), transformResponse: (e7) => A(e7, [{ transformFn: F, paths: uc }]) };
|
|
3884
3913
|
}
|
|
3885
3914
|
return t2;
|
|
3886
3915
|
}
|
|
3887
3916
|
var hc = [{ path: `post.url` }, { path: `post.translations.url` }];
|
|
3888
3917
|
var gc = [{ path: `post.heroImage` }, { path: `post.media.wixMedia.image` }];
|
|
3889
3918
|
var _c = [{ path: `post.media.wixMedia.videoV2` }];
|
|
3890
|
-
var
|
|
3919
|
+
var Z = ((e6) => (e6.UNKNOWN = `UNKNOWN`, e6.COUNTERS = `COUNTERS`, e6.URL = `URL`, e6.CONTENT_TEXT = `CONTENT_TEXT`, e6.METRICS = `METRICS`, e6.SEO = `SEO`, e6.CONTENT = `CONTENT`, e6.INTERNAL_ID = `INTERNAL_ID`, e6.CONTACT_ID = `CONTACT_ID`, e6.RICH_CONTENT = `RICH_CONTENT`, e6.RICH_CONTENT_STRING = `RICH_CONTENT_STRING`, e6.RICH_CONTENT_COMPRESSED = `RICH_CONTENT_COMPRESSED`, e6.TRANSLATIONS = `TRANSLATIONS`, e6.REFERENCE_ID = `REFERENCE_ID`, e6.EXCLUDE_PAID_CONTENT = `EXCLUDE_PAID_CONTENT`, e6.SEO_DATA = `SEO_DATA`, e6.OWNER = `OWNER`, e6.HAS_UNPUBLISHED_CHANGES = `HAS_UNPUBLISHED_CHANGES`, e6.HEADING = `HEADING`, e6.IMAGE = `IMAGE`, e6))(Z || {});
|
|
3891
3920
|
async function vc(e6, t2) {
|
|
3892
3921
|
let { httpClient: n2, sideEffects: r2 } = arguments[2], i2 = pc(D({ postId: e6, fieldsets: t2?.fieldsets }, []));
|
|
3893
3922
|
r2?.onSiteCall?.();
|
|
@@ -3926,7 +3955,7 @@ function Ec(e6) {
|
|
|
3926
3955
|
var Dc = `@wix/auto_sdk_blog_tags`;
|
|
3927
3956
|
function Oc(e6) {
|
|
3928
3957
|
function t2({ host: t3 }) {
|
|
3929
|
-
let n2 = A(e6, [{ transformFn:
|
|
3958
|
+
let n2 = A(e6, [{ transformFn: dn, paths: wc }]);
|
|
3930
3959
|
return { entityFqdn: `wix.blog.v3.tag`, method: `POST`, methodFqn: `com.wixpress.npm.communities.platformized.blog.TagService.QueryTags`, packageName: Dc, migrationOptions: { optInTransformResponse: true }, url: Ec({ protoPath: `/v3/tags/query`, data: n2, host: t3 }), data: n2, transformResponse: (e7) => A(e7, [{ transformFn: k, paths: Tc }]) };
|
|
3931
3960
|
}
|
|
3932
3961
|
return t2;
|
|
@@ -4045,7 +4074,7 @@ var Qc = (e6, t2, n2) => {
|
|
|
4045
4074
|
let r2 = Zc(t2.nodes.map((e7) => e7.layoutData ? { ...e7, layoutData: { ...e7.layoutData, banner: void 0 } } : e7), n2);
|
|
4046
4075
|
return { ...e6, nodes: [...e6.nodes ?? [], ...r2] };
|
|
4047
4076
|
};
|
|
4048
|
-
var $c = [{ path: `posts.firstPublishedDate` }, { path: `posts.lastPublishedDate` }, { path: `posts.heroImage.urlExpirationDate` }, { path: `posts.richContent.metadata.createdTimestamp` }, { path: `posts.richContent.metadata.updatedTimestamp` }, { path: `posts.moderationDetails.submittedDate` }, { path: `posts.moderationDetails.moderationDate` }, { path: `posts.media.wixMedia.image.urlExpirationDate` }, { path: `posts.media.wixMedia.videoV2.urlExpirationDate` }, { path: `posts.media.wixMedia.videoV2.resolutions.urlExpirationDate` }, { path: `posts.media.wixMedia.videoV2.resolutions.poster.urlExpirationDate` }, { path: `posts.media.wixMedia.videoV2.posters.urlExpirationDate` }];
|
|
4077
|
+
var $c = [{ path: `posts.firstPublishedDate` }, { path: `posts.lastPublishedDate` }, { path: `posts.expirationDate` }, { path: `posts.heroImage.urlExpirationDate` }, { path: `posts.richContent.metadata.createdTimestamp` }, { path: `posts.richContent.metadata.updatedTimestamp` }, { path: `posts.moderationDetails.submittedDate` }, { path: `posts.moderationDetails.moderationDate` }, { path: `posts.media.wixMedia.image.urlExpirationDate` }, { path: `posts.media.wixMedia.videoV2.urlExpirationDate` }, { path: `posts.media.wixMedia.videoV2.resolutions.urlExpirationDate` }, { path: `posts.media.wixMedia.videoV2.resolutions.poster.urlExpirationDate` }, { path: `posts.media.wixMedia.videoV2.posters.urlExpirationDate` }];
|
|
4049
4078
|
var el = [{ path: `posts.richContentCompressed` }];
|
|
4050
4079
|
var tl = [{ path: `posts.heroImage.focalPoint.x` }, { path: `posts.heroImage.focalPoint.y` }, { path: `posts.media.wixMedia.image.focalPoint.x` }, { path: `posts.media.wixMedia.image.focalPoint.y` }, { path: `posts.media.wixMedia.videoV2.resolutions.poster.focalPoint.x` }, { path: `posts.media.wixMedia.videoV2.resolutions.poster.focalPoint.y` }, { path: `posts.media.wixMedia.videoV2.posters.focalPoint.x` }, { path: `posts.media.wixMedia.videoV2.posters.focalPoint.y` }, { path: `posts.metrics.averageRating` }, { path: `posts.richContent.nodes.buttonData.styles.background.gradient.centerX` }, { path: `posts.richContent.nodes.buttonData.styles.background.gradient.centerY` }, { path: `posts.richContent.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `posts.richContent.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `posts.richContent.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `posts.richContent.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `posts.richContent.nodes.galleryData.items.image.media.duration` }, { path: `posts.richContent.nodes.galleryData.items.video.media.duration` }, { path: `posts.richContent.nodes.galleryData.items.video.thumbnail.duration` }, { path: `posts.richContent.nodes.galleryData.options.item.ratio` }, { path: `posts.richContent.nodes.imageData.image.duration` }, { path: `posts.richContent.nodes.imageData.crop.x` }, { path: `posts.richContent.nodes.imageData.crop.y` }, { path: `posts.richContent.nodes.imageData.crop.width` }, { path: `posts.richContent.nodes.imageData.crop.height` }, { path: `posts.richContent.nodes.mapData.mapSettings.lat` }, { path: `posts.richContent.nodes.mapData.mapSettings.lng` }, { path: `posts.richContent.nodes.pollData.poll.image.duration` }, { path: `posts.richContent.nodes.pollData.poll.options.image.duration` }, { path: `posts.richContent.nodes.pollData.design.poll.background.image.duration` }, { path: `posts.richContent.nodes.textData.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.nodes.textData.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.nodes.textData.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.nodes.textData.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.nodes.textData.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.nodes.textData.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.nodes.appEmbedData.image.duration` }, { path: `posts.richContent.nodes.videoData.video.duration` }, { path: `posts.richContent.nodes.videoData.thumbnail.duration` }, { path: `posts.richContent.nodes.audioData.audio.duration` }, { path: `posts.richContent.nodes.audioData.coverImage.duration` }, { path: `posts.richContent.nodes.layoutData.backgroundImage.media.duration` }, { path: `posts.richContent.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `posts.richContent.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `posts.richContent.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `posts.richContent.nodes.layoutData.backdropImage.media.duration` }, { path: `posts.richContent.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `posts.richContent.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `posts.richContent.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `posts.richContent.nodes.layoutData.background.gradient.centerX` }, { path: `posts.richContent.nodes.layoutData.background.gradient.centerY` }, { path: `posts.richContent.nodes.layoutData.background.gradient.stops.position` }, { path: `posts.richContent.nodes.layoutData.backdrop.gradient.centerX` }, { path: `posts.richContent.nodes.layoutData.backdrop.gradient.centerY` }, { path: `posts.richContent.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `posts.richContent.nodes.shapeData.shape.duration` }, { path: `posts.richContent.nodes.cardData.background.gradient.centerX` }, { path: `posts.richContent.nodes.cardData.background.gradient.centerY` }, { path: `posts.richContent.nodes.cardData.background.gradient.stops.position` }, { path: `posts.richContent.nodes.cardData.backgroundImage.media.duration` }, { path: `posts.richContent.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `posts.richContent.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `posts.richContent.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `posts.richContent.nodes.tocData.fontSize` }, { path: `posts.richContent.nodes.tocData.itemSpacing` }, { path: `posts.richContent.nodes.smartBlockCellData.shape.duration` }, { path: `posts.richContent.documentStyle.headerOne.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerOne.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerOne.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerOne.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerOne.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerOne.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerTwo.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerTwo.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerTwo.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerTwo.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerTwo.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerTwo.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerThree.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerThree.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerThree.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerThree.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerThree.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerThree.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerFour.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerFour.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerFour.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerFour.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerFour.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerFour.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerFive.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerFive.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerFive.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerFive.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerFive.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerFive.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerSix.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerSix.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerSix.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerSix.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerSix.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerSix.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.paragraph.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.paragraph.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.paragraph.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.paragraph.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.paragraph.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.paragraph.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.blockquote.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.blockquote.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.blockquote.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.blockquote.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.blockquote.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.blockquote.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.codeBlock.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.codeBlock.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.codeBlock.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.codeBlock.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.codeBlock.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.codeBlock.decorations.colorData.backgroundStyle.gradient.stops.position` }];
|
|
4051
4080
|
var nl = [{ path: `sort.origin.latitude` }, { path: `sort.origin.longitude` }, { path: `query.sort.origin.latitude` }, { path: `query.sort.origin.longitude` }];
|
|
@@ -4055,8 +4084,8 @@ function rl(e6) {
|
|
|
4055
4084
|
var il = `@wix/auto_sdk_blog_posts`;
|
|
4056
4085
|
function al(e6) {
|
|
4057
4086
|
function t2({ host: t3 }) {
|
|
4058
|
-
let n2 = A(e6, [{ transformFn:
|
|
4059
|
-
return { entityFqdn: `wix.blog.v3.post`, method: `POST`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.PostService.QueryPosts`, packageName: il, migrationOptions: { optInTransformResponse: true }, url: rl({ protoPath: `/v3/posts/query`, data: n2, host: t3 }), data: n2, transformResponse: (e7) => A(e7, [{ transformFn: k, paths: $c }, { transformFn: fn, paths: el }, { transformFn:
|
|
4087
|
+
let n2 = A(e6, [{ transformFn: dn, paths: nl }]);
|
|
4088
|
+
return { entityFqdn: `wix.blog.v3.post`, method: `POST`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.PostService.QueryPosts`, packageName: il, migrationOptions: { optInTransformResponse: true }, url: rl({ protoPath: `/v3/posts/query`, data: n2, host: t3 }), data: n2, transformResponse: (e7) => A(e7, [{ transformFn: k, paths: $c }, { transformFn: fn, paths: el }, { transformFn: F, paths: tl }]) };
|
|
4060
4089
|
}
|
|
4061
4090
|
return t2;
|
|
4062
4091
|
}
|
|
@@ -4098,9 +4127,9 @@ var fl = (e6, t2, n2) => {
|
|
|
4098
4127
|
});
|
|
4099
4128
|
return Promise.race([e6, i2]).finally(() => clearTimeout(r2));
|
|
4100
4129
|
};
|
|
4101
|
-
|
|
4102
|
-
var pl = [
|
|
4103
|
-
|
|
4130
|
+
Z.RICH_CONTENT, Z.SEO, Z.URL, Z.CONTENT_TEXT;
|
|
4131
|
+
var pl = [Z.RICH_CONTENT, Z.URL];
|
|
4132
|
+
Z.URL, Z.METRICS;
|
|
4104
4133
|
var ml = (e6) => {
|
|
4105
4134
|
let { status: t2, details: n2 } = e6 ?? {};
|
|
4106
4135
|
return t2 === 404 || String(n2?.applicationError?.code ?? ``).includes(`NOT_FOUND`);
|
|
@@ -4170,6 +4199,33 @@ var kl = (e6) => {
|
|
|
4170
4199
|
let { _id: t2, categoryIds: n2, relatedPostIds: r2 } = e6 ?? {};
|
|
4171
4200
|
return { currentPostId: t2 ?? void 0, categoryIds: n2, relatedPostIds: r2 };
|
|
4172
4201
|
};
|
|
4202
|
+
v((e6, t2) => {
|
|
4203
|
+
(function() {
|
|
4204
|
+
var e7 = {}.hasOwnProperty;
|
|
4205
|
+
function n2() {
|
|
4206
|
+
for (var e8 = ``, t3 = 0; t3 < arguments.length; t3++) {
|
|
4207
|
+
var n3 = arguments[t3];
|
|
4208
|
+
n3 && (e8 = i2(e8, r2(n3)));
|
|
4209
|
+
}
|
|
4210
|
+
return e8;
|
|
4211
|
+
}
|
|
4212
|
+
function r2(t3) {
|
|
4213
|
+
if (typeof t3 == `string` || typeof t3 == `number`) return t3;
|
|
4214
|
+
if (typeof t3 != `object`) return ``;
|
|
4215
|
+
if (Array.isArray(t3)) return n2.apply(null, t3);
|
|
4216
|
+
if (t3.toString !== Object.prototype.toString && !t3.toString.toString().includes(`[native code]`)) return t3.toString();
|
|
4217
|
+
var r3 = ``;
|
|
4218
|
+
for (var a2 in t3) e7.call(t3, a2) && t3[a2] && (r3 = i2(r3, a2));
|
|
4219
|
+
return r3;
|
|
4220
|
+
}
|
|
4221
|
+
function i2(e8, t3) {
|
|
4222
|
+
return t3 ? e8 ? e8 + ` ` + t3 : e8 + t3 : e8;
|
|
4223
|
+
}
|
|
4224
|
+
t2 !== void 0 && t2.exports ? (n2.default = n2, t2.exports = n2) : typeof define == `function` && typeof define.amd == `object` && define.amd ? define(`classnames`, [], function() {
|
|
4225
|
+
return n2;
|
|
4226
|
+
}) : window.classNames = n2;
|
|
4227
|
+
})();
|
|
4228
|
+
})();
|
|
4173
4229
|
var Al = { post: `post`, feed: `feed`, relatedPosts: `related-posts`, comments: `comments`, seo: `seo`, likes: `likes` };
|
|
4174
4230
|
var jl = (e6) => {
|
|
4175
4231
|
try {
|
|
@@ -4179,11 +4235,11 @@ var jl = (e6) => {
|
|
|
4179
4235
|
}
|
|
4180
4236
|
};
|
|
4181
4237
|
var Ml = (e6, t2) => e6 && typeof e6[t2] == `function` ? e6 : null;
|
|
4182
|
-
function Nl(e6, t2, { feature: n2, action: r2, level: i2 = `error`,
|
|
4183
|
-
let
|
|
4184
|
-
if (!
|
|
4185
|
-
let
|
|
4186
|
-
|
|
4238
|
+
function Nl(e6, t2, { feature: n2, action: r2, level: i2 = `error`, tags: a2, contexts: o2 }) {
|
|
4239
|
+
let s2 = Ml(e6, `captureException`);
|
|
4240
|
+
if (!s2) return;
|
|
4241
|
+
let c2 = t2 instanceof Error ? t2 : Error(String(t2));
|
|
4242
|
+
s2.captureException(c2, { level: i2, tags: { feature: n2, action: r2, ...a2 }, ...o2 ? { contexts: o2 } : {} });
|
|
4187
4243
|
}
|
|
4188
4244
|
function Pl(e6, t2, { feature: n2, tags: r2 }, i2) {
|
|
4189
4245
|
let a2 = Ml(e6, `startSpanManual`);
|
|
@@ -4197,7 +4253,7 @@ var Fl = class extends n {
|
|
|
4197
4253
|
return { error: e6 ?? Error(`Unknown render error`) };
|
|
4198
4254
|
}
|
|
4199
4255
|
componentDidCatch(e6, t2) {
|
|
4200
|
-
Nl(this.props.monitoringClient, e6, { feature: this.props.feature, action: `render`, contexts: { react: { componentStack: t2.componentStack } } });
|
|
4256
|
+
Nl(this.props.monitoringClient, e6, { feature: this.props.feature, action: `render`, tags: this.props.component ? { component: this.props.component } : void 0, contexts: { react: { componentStack: t2.componentStack } } });
|
|
4201
4257
|
}
|
|
4202
4258
|
render() {
|
|
4203
4259
|
if (this.state.error === void 0) return this.props.children;
|
|
@@ -4240,7 +4296,7 @@ var ql = async (e6) => {
|
|
|
4240
4296
|
let [t2, n2] = await Promise.allSettled([qs().eq(`fqdn`, Ul).eq(`entityId`, e6).limit(1).find(), Cc(e6)]), r2 = n2.status === `fulfilled` ? n2.value.metrics : void 0;
|
|
4241
4297
|
return { liked: t2.status === `fulfilled` && t2.value.items.length > 0, likeCount: Kl(r2?.likes), viewCount: Kl(r2?.views), commentCount: Kl(r2?.comments) };
|
|
4242
4298
|
};
|
|
4243
|
-
var Jl =
|
|
4299
|
+
var Jl = I(`@wix/site-service-editor-context`);
|
|
4244
4300
|
var Yl = () => {
|
|
4245
4301
|
try {
|
|
4246
4302
|
return !!m(Jl).previewMode;
|
|
@@ -4334,10 +4390,10 @@ var ru = () => {
|
|
|
4334
4390
|
}
|
|
4335
4391
|
};
|
|
4336
4392
|
var iu = (e6, t2, n2) => typeof e6 != `number` || !Number.isFinite(e6) || e6 < 0 ? `` : new Intl.NumberFormat(n2, t2 === `compact` ? { notation: `compact`, maximumFractionDigits: 1 } : void 0).format(e6);
|
|
4337
|
-
var
|
|
4393
|
+
var Q = { timeToRead: `post.time-to-read`, viewCount: `post.view-count`, commentCount: `post.comment-count`, likeCount: `post.like-count`, noPostsTitle: `post-list.empty-state.title`, noPostsDescription: `post-list.empty-state.description`, noRelatedPostsTitle: `related-posts.empty-state.title`, noRelatedPostsDescription: `related-posts.empty-state.description`, canvasPostTitle: `canvas.post-title`, canvasAuthorName: `canvas.author-name`, canvasExcerpt: `canvas.excerpt`, canvasContent: `canvas.content`, canvasCategory: `canvas.category`, canvasCategoryNumbered: `canvas.category-numbered`, canvasTagNumbered: `canvas.tag-numbered`, canvasCoverAlt: `cover-media.placeholder-alt`, canvasAuthorPhotoAlt: `canvas.author-photo-alt` };
|
|
4338
4394
|
var au = (e6, t2) => {
|
|
4339
4395
|
let n2 = (n3) => (r2) => e6(n3, { count: r2, formatted: iu(r2, `full`, t2) });
|
|
4340
|
-
return { timeToRead: (t3) => e6(
|
|
4396
|
+
return { timeToRead: (t3) => e6(Q.timeToRead, { count: t3 }), viewCount: n2(Q.viewCount), commentCount: n2(Q.commentCount), likeCount: n2(Q.likeCount), noPostsEmptyState: () => ({ title: e6(Q.noPostsTitle), description: e6(Q.noPostsDescription) }), noRelatedPostsEmptyState: () => ({ title: e6(Q.noRelatedPostsTitle), description: e6(Q.noRelatedPostsDescription) }), canvas: { postTitle: () => e6(Q.canvasPostTitle), authorName: () => e6(Q.canvasAuthorName), excerpt: () => e6(Q.canvasExcerpt), content: () => e6(Q.canvasContent), category: () => e6(Q.canvasCategory), categoryNumbered: (t3) => e6(Q.canvasCategoryNumbered, { number: t3 }), tagNumbered: (t3) => e6(Q.canvasTagNumbered, { number: t3 }), coverAlt: () => e6(Q.canvasCoverAlt), authorPhotoAlt: () => e6(Q.canvasAuthorPhotoAlt) } };
|
|
4341
4397
|
};
|
|
4342
4398
|
var ou = i({ isEditor: false, isPreview: false });
|
|
4343
4399
|
var su = () => c(ou);
|
|
@@ -4362,7 +4418,7 @@ var fu = (e6) => {
|
|
|
4362
4418
|
};
|
|
4363
4419
|
var pu = (e6) => typeof e6 == `number` && e6 > 0 ? e6 : void 0;
|
|
4364
4420
|
var mu = (e6) => e6.replace(/&/g, `&`).replace(/</g, `<`).replace(/>/g, `>`).replace(/"/g, `"`).replace(/'/g, `'`);
|
|
4365
|
-
var
|
|
4421
|
+
var $ = (e6) => ({ text: e6, html: `<p>${mu(e6)}</p>`, linkList: [] });
|
|
4366
4422
|
var hu = 6e4;
|
|
4367
4423
|
var gu = hu * 60;
|
|
4368
4424
|
var _u = gu * 24;
|
|
@@ -4474,63 +4530,63 @@ var Uu = (e6, t2) => {
|
|
|
4474
4530
|
var Wu = { href: `#`, target: `_self` };
|
|
4475
4531
|
var Gu = (e6, t2) => {
|
|
4476
4532
|
let { _id: n2, label: r2, slug: i2 } = e6, a2 = r2 ?? ``;
|
|
4477
|
-
return { _id: n2 ?? i2 ?? ``, label: a2, itemCategoryLabel:
|
|
4533
|
+
return { _id: n2 ?? i2 ?? ``, label: a2, itemCategoryLabel: $(a2), itemCategoryLink: Uu(t2, i2 ?? ``), categoryItem: { label: a2, slug: i2 ?? `` } };
|
|
4478
4534
|
};
|
|
4479
4535
|
var Ku = 2;
|
|
4480
4536
|
var qu = (e6) => Array.from({ length: Ku }, (t2, n2) => {
|
|
4481
4537
|
let r2 = e6.canvas.categoryNumbered(n2 + 1);
|
|
4482
|
-
return { _id: `placeholder-category-${n2}`, label: r2, itemCategoryLabel:
|
|
4538
|
+
return { _id: `placeholder-category-${n2}`, label: r2, itemCategoryLabel: $(r2), itemCategoryLink: Wu, categoryItem: { label: r2, slug: `` } };
|
|
4483
4539
|
});
|
|
4484
4540
|
var Ju = (e6, t2) => {
|
|
4485
4541
|
let { _id: n2, label: r2, slug: i2 } = e6, a2 = r2 ?? ``;
|
|
4486
|
-
return { _id: n2 ?? i2 ?? ``, label: a2, itemTagLabel:
|
|
4542
|
+
return { _id: n2 ?? i2 ?? ``, label: a2, itemTagLabel: $(a2), itemTagLink: Uu(t2, i2 ?? ``), tagItem: { label: a2, slug: i2 ?? `` } };
|
|
4487
4543
|
};
|
|
4488
4544
|
var Yu = 3;
|
|
4489
4545
|
var Xu = (e6) => Array.from({ length: Yu }, (t2, n2) => {
|
|
4490
4546
|
let r2 = e6.canvas.tagNumbered(n2 + 1);
|
|
4491
|
-
return { _id: `placeholder-tag-${n2}`, label: r2, itemTagLabel:
|
|
4547
|
+
return { _id: `placeholder-tag-${n2}`, label: r2, itemTagLabel: $(r2), itemTagLink: Wu, tagItem: { label: r2, slug: `` } };
|
|
4492
4548
|
});
|
|
4493
4549
|
var Zu = 1;
|
|
4494
|
-
var
|
|
4495
|
-
var
|
|
4496
|
-
var
|
|
4497
|
-
var
|
|
4498
|
-
var
|
|
4499
|
-
var
|
|
4500
|
-
var
|
|
4501
|
-
var
|
|
4550
|
+
var Qu = { views: 120, comments: 4, likes: 12 };
|
|
4551
|
+
var $u = (e6) => ({ nodes: [{ type: `PARAGRAPH`, nodes: [{ type: `TEXT`, nodes: [], textData: { text: e6, decorations: [] } }] }] });
|
|
4552
|
+
var ed = (e6, t2, n2, r2) => $(e6 === void 0 ? n2 ? r2(t2) : `` : r2(e6));
|
|
4553
|
+
var td = (e6, t2, n2) => e6 ?? (n2 ? t2 : void 0);
|
|
4554
|
+
var nd = { nodes: [] };
|
|
4555
|
+
var rd = () => ({ title: $(``), excerpt: $(``), coverImage: void 0, coverMedia: void 0, richContent: nd, authorName: $(``), authorImage: void 0, timeToRead: $(``), publishedDate: $(``), viewCount: $(``), commentCount: $(``), likeCount: $(``), postCategories: [], itemCategoryLabel: $(``), postTags: [], hasCoverImage: false, hasExcerpt: false, hasTags: false, publishedDateValue: void 0, minutesToReadValue: void 0, viewCountValue: void 0, commentCountValue: void 0 });
|
|
4556
|
+
var id = ({ post: e6, author: t2, metrics: n2, categories: r2, tags: i2, videoSources: a2 }, o2, s2, c2 = false, l2 = Date.now(), u2 = {}) => !e6 && !c2 ? rd() : { title: $(e6?.title ?? o2.canvas.postTitle()), excerpt: $(e6?.excerpt ?? o2.canvas.excerpt()), coverImage: Vu(e6), coverMedia: Bu(e6, a2), richContent: e6?.richContent ?? $u(o2.canvas.content()), authorName: $(t2?.profile?.nickname ?? o2.canvas.authorName()), authorImage: Cu(t2, o2.canvas.authorPhotoAlt()), timeToRead: $(typeof e6?.minutesToRead == `number` && e6.minutesToRead > 0 ? o2.timeToRead(e6.minutesToRead) : c2 ? o2.timeToRead(Zu) : ``), publishedDate: $(bu(e6?.firstPublishedDate ?? new Date(l2), s2, l2)), viewCount: ed(n2?.views, Qu.views, c2, o2.viewCount), commentCount: ed(n2?.comments, Qu.comments, c2, o2.commentCount), likeCount: ed(n2?.likes, Qu.likes, c2, o2.likeCount), postCategories: r2.length === 0 && c2 ? qu(o2) : r2.map((e7) => Gu(e7, u2.category)), itemCategoryLabel: $(r2[0]?.label ?? (c2 ? o2.canvas.category() : ``)), postTags: i2.length === 0 && c2 ? Xu(o2) : i2.map((e7) => Ju(e7, u2.tag)), hasCoverImage: !e6 || e6.media?.displayed !== false && Vu(e6) !== void 0, hasExcerpt: !e6 || !!e6.excerpt?.trim(), hasTags: !e6 || i2.length > 0, publishedDateValue: fu(e6?.firstPublishedDate) ?? (c2 ? `2026-05-12T12:00:00.000Z` : void 0), minutesToReadValue: pu(e6?.minutesToRead) ?? (c2 ? Zu : void 0), viewCountValue: td(n2?.views, Qu.views, c2), commentCountValue: td(n2?.comments, Qu.comments, c2) };
|
|
4557
|
+
var ad = ({ postWithAuthor: e6, hasError: t2, monitoringClient: n2, isPostInPreview: r2, postPageBase: i2 }) => {
|
|
4502
4558
|
let { t: a2 } = yo(), o2 = nu(), s2 = u(() => au(a2, o2), [a2, o2]), c2 = Hl(e6.fetchedAt), l2 = uu(), { isLiked: d2, likeCount: f2, isLikeCountLoaded: p2, viewCount: m2, commentCount: h2, toggleLike: g2, liveLikes: _2 } = tu(e6.post?._id ?? void 0, e6.metrics?.likes ?? 0, r2, n2), v2 = Bl(er), y2 = Bl(`tag`), b2 = u(() => kl(e6.post), [e6]), x2 = ru(), S2 = u(() => e6.post?.richContent && e6.paywall ? Qc(e6.post.richContent, e6.paywall, x2) : void 0, [e6, x2]);
|
|
4503
4559
|
return u(() => {
|
|
4504
|
-
let n3 =
|
|
4505
|
-
return { ...n3, ...S2 && { richContent: S2 }, relatedPostsSource: b2, commentingEnabled: e6.post?.commentingEnabled ?? void 0, viewCountValue: m2 ?? n3.viewCountValue, commentCountValue: h2 ?? n3.commentCountValue, itemLink: u2, postUrl: a3?.href, ...e6.post && (e6.metrics?.likes !== void 0 || p2) ? { likeCount:
|
|
4560
|
+
let n3 = id(!e6.post && l2 && e6.demoPost ? { ...e6, post: e6.demoPost } : e6, s2, o2, l2, c2, { category: v2, tag: y2 }), a3 = r2 || !e6.post ? void 0 : lr(e6.post, i2), u2 = a3 ?? (l2 ? du(i2) : void 0);
|
|
4561
|
+
return { ...n3, ...S2 && { richContent: S2 }, relatedPostsSource: b2, commentingEnabled: e6.post?.commentingEnabled ?? void 0, viewCountValue: m2 ?? n3.viewCountValue, commentCountValue: h2 ?? n3.commentCountValue, itemLink: u2, postUrl: a3?.href, ...e6.post && (e6.metrics?.likes !== void 0 || p2) ? { likeCount: $(s2.likeCount(f2)) } : {}, isLiked: d2, likeCountValue: f2, isLikeCountLoaded: p2, toggleLike: g2, liveLikes: _2, clockValue: c2, isLoadingPost: false, hasError: t2, isEmpty: !e6.post && !l2 };
|
|
4506
4562
|
}, [e6, t2, b2, S2, s2, o2, c2, f2, d2, p2, m2, h2, g2, _2, l2, r2, i2, v2, y2]);
|
|
4507
4563
|
};
|
|
4508
|
-
var
|
|
4509
|
-
var
|
|
4510
|
-
var
|
|
4564
|
+
var od = (e6) => ({ post: e6, hasError: false });
|
|
4565
|
+
var sd = () => ({ post: { post: void 0, author: void 0, metrics: void 0, categories: [], tags: [], fetchedAt: Date.now() }, hasError: true });
|
|
4566
|
+
var cd = (e6) => {
|
|
4511
4567
|
throw e6;
|
|
4512
4568
|
};
|
|
4513
|
-
var
|
|
4569
|
+
var ld = { ...rd(), isLiked: false, likeCountValue: 0, isLikeCountLoaded: false, toggleLike: async () => {
|
|
4514
4570
|
}, liveLikes: void 0, postUrl: void 0, itemLink: void 0, clockValue: 0, relatedPostsSource: { currentPostId: void 0, categoryIds: void 0, relatedPostIds: void 0 }, commentingEnabled: void 0, isLoadingPost: true, hasError: false, isEmpty: false };
|
|
4515
|
-
var
|
|
4516
|
-
var
|
|
4517
|
-
var
|
|
4518
|
-
var
|
|
4519
|
-
let { post: a2, hasError: o2 } = Vn(r2), c2 = Xn(a2, s(() => n2 ? El(n2) : Promise.resolve(void 0), [n2])), l2 =
|
|
4571
|
+
var ud = { ...ld, isLoadingPost: false, hasError: true, isEmpty: true };
|
|
4572
|
+
var dd = 2500;
|
|
4573
|
+
var fd = Promise.resolve(od({ post: void 0, author: void 0, metrics: void 0, categories: [], tags: [], fetchedAt: 0 }));
|
|
4574
|
+
var pd = ({ children: t2, postId: n2, postLoadPromise: r2, monitoringClient: i2 }) => {
|
|
4575
|
+
let { post: a2, hasError: o2 } = Vn(r2), c2 = Xn(a2, s(() => n2 ? El(n2) : Promise.resolve(void 0), [n2])), l2 = ad({ postWithAuthor: c2, hasError: o2, monitoringClient: i2, isPostInPreview: false, postPageBase: dr() });
|
|
4520
4576
|
return mr(fr.postByIdProvider, o2 ? `error` : c2.post ? `data` : `empty`), h(e, { value: l2, children: t2 });
|
|
4521
4577
|
};
|
|
4522
|
-
function
|
|
4578
|
+
function md({ children: t2, postPicker: n2 }) {
|
|
4523
4579
|
let i2 = zl(n2), a2 = Gn(), o2 = gr(), s2 = u(() => jl(zn), []), { i18n: c2, locale: l2 } = Go($o), d2 = qn(() => i2 ? Un(Mo({ key: `blog-builder:post-by-id:${i2}`, warmupData: o2, fetchData: () => {
|
|
4524
4580
|
let e6 = Dl(i2, a2);
|
|
4525
|
-
return Il(Pl(s2, `post-by-id-read`, { feature: Al.post }, a2 ? fl(e6,
|
|
4526
|
-
} }),
|
|
4527
|
-
return h(bo, { i18n: c2, children: g(r, { fallback: h(e, { value:
|
|
4581
|
+
return Il(Pl(s2, `post-by-id-read`, { feature: Al.post }, a2 ? fl(e6, dd, `post-by-id`) : e6));
|
|
4582
|
+
} }), od, a2 ? cd : sd) : fd, [i2, a2, o2, s2]);
|
|
4583
|
+
return h(bo, { i18n: c2, children: g(r, { fallback: h(e, { value: ld, children: t2 }), children: [h(Wo, { i18n: c2, locale: l2 }), h(Fl, { fallback: h(e, { value: ud, children: t2 }), feature: Al.post, monitoringClient: s2, rethrow: a2, children: h(pd, { postId: i2, postLoadPromise: d2, monitoringClient: s2, children: t2 }, i2 ?? ``) })] }) });
|
|
4528
4584
|
}
|
|
4529
|
-
var
|
|
4585
|
+
var hd = Mn(`474ee948-702b-4c0f-970e-b5319eff6d8b`);
|
|
4530
4586
|
export {
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
|
|
4587
|
+
md as PostByIdProvider,
|
|
4588
|
+
md as default,
|
|
4589
|
+
hd as injectAccessTokenGetter,
|
|
4534
4590
|
t as usePostByIdContext
|
|
4535
4591
|
};
|
|
4536
4592
|
//# sourceMappingURL=context-post-by-id.mjs.map
|