@wix/blog 1.0.690 → 1.0.692
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-context-provider/runtime.d.ts +483 -0
- package/_sdk-exports/context-blog-feed-context-provider/runtime.js +5 -0
- package/_sdk-exports/context-category-item-context-provider/runtime.d.ts +189 -0
- package/_sdk-exports/context-category-item-context-provider/runtime.js +2 -0
- package/_sdk-exports/context-post-by-id-context-provider/runtime.d.ts +31 -0
- package/_sdk-exports/context-post-by-id-context-provider/runtime.js +5 -0
- package/_sdk-exports/context-post-context-provider/runtime.d.ts +3213 -0
- package/_sdk-exports/context-post-context-provider/runtime.js +5 -0
- package/_sdk-exports/context-post-item-context-provider/runtime.d.ts +386 -0
- package/_sdk-exports/context-post-item-context-provider/runtime.js +5 -0
- package/_sdk-exports/context-related-posts-context-provider/runtime.d.ts +341 -0
- package/_sdk-exports/context-related-posts-context-provider/runtime.js +5 -0
- package/_sdk-exports/context-tag-item-context-provider/runtime.d.ts +185 -0
- package/_sdk-exports/context-tag-item-context-provider/runtime.js +2 -0
- package/blog-feed-context-provider/package.json +3 -0
- package/build/cjs/context-blog-feed-context-provider.d.ts +483 -0
- package/build/cjs/context-blog-feed-context-provider.js +4601 -0
- package/build/cjs/context-blog-feed-context-provider.js.map +1 -0
- package/build/cjs/context-category-item-context-provider.d.ts +189 -0
- package/build/cjs/context-category-item-context-provider.js +578 -0
- package/build/cjs/context-category-item-context-provider.js.map +1 -0
- package/build/cjs/context-post-by-id-context-provider.d.ts +31 -0
- package/build/cjs/context-post-by-id-context-provider.js +4531 -0
- package/build/cjs/context-post-by-id-context-provider.js.map +1 -0
- package/build/cjs/context-post-context-provider.d.ts +3213 -0
- package/build/cjs/context-post-context-provider.js +5404 -0
- package/build/cjs/context-post-context-provider.js.map +1 -0
- package/build/cjs/context-post-item-context-provider.d.ts +386 -0
- package/build/cjs/context-post-item-context-provider.js +3682 -0
- package/build/cjs/context-post-item-context-provider.js.map +1 -0
- package/build/cjs/context-related-posts-context-provider.d.ts +341 -0
- package/build/cjs/context-related-posts-context-provider.js +4355 -0
- package/build/cjs/context-related-posts-context-provider.js.map +1 -0
- package/build/cjs/context-tag-item-context-provider.d.ts +185 -0
- package/build/cjs/context-tag-item-context-provider.js +578 -0
- package/build/cjs/context-tag-item-context-provider.js.map +1 -0
- package/build/es/context-blog-feed-context-provider.d.mts +483 -0
- package/build/es/context-blog-feed-context-provider.mjs +4571 -0
- package/build/es/context-blog-feed-context-provider.mjs.map +1 -0
- package/build/es/context-category-item-context-provider.d.mts +189 -0
- package/build/es/context-category-item-context-provider.mjs +549 -0
- package/build/es/context-category-item-context-provider.mjs.map +1 -0
- package/build/es/context-post-by-id-context-provider.d.mts +31 -0
- package/build/es/context-post-by-id-context-provider.mjs +4491 -0
- package/build/es/context-post-by-id-context-provider.mjs.map +1 -0
- package/build/es/context-post-context-provider.d.mts +3213 -0
- package/build/es/context-post-context-provider.mjs +5374 -0
- package/build/es/context-post-context-provider.mjs.map +1 -0
- package/build/es/context-post-item-context-provider.d.mts +386 -0
- package/build/es/context-post-item-context-provider.mjs +3652 -0
- package/build/es/context-post-item-context-provider.mjs.map +1 -0
- package/build/es/context-related-posts-context-provider.d.mts +341 -0
- package/build/es/context-related-posts-context-provider.mjs +4325 -0
- package/build/es/context-related-posts-context-provider.mjs.map +1 -0
- package/build/es/context-tag-item-context-provider.d.mts +185 -0
- package/build/es/context-tag-item-context-provider.mjs +549 -0
- package/build/es/context-tag-item-context-provider.mjs.map +1 -0
- package/build/internal/cjs/context-blog-feed-context-provider.d.ts +483 -0
- package/build/internal/cjs/context-category-item-context-provider.d.ts +189 -0
- package/build/internal/cjs/context-post-by-id-context-provider.d.ts +31 -0
- package/build/internal/cjs/context-post-context-provider.d.ts +3213 -0
- package/build/internal/cjs/context-post-item-context-provider.d.ts +386 -0
- package/build/internal/cjs/context-related-posts-context-provider.d.ts +341 -0
- package/build/internal/cjs/context-tag-item-context-provider.d.ts +185 -0
- package/build/internal/es/context-blog-feed-context-provider.d.mts +483 -0
- package/build/internal/es/context-category-item-context-provider.d.mts +189 -0
- package/build/internal/es/context-post-by-id-context-provider.d.mts +31 -0
- package/build/internal/es/context-post-context-provider.d.mts +3213 -0
- package/build/internal/es/context-post-item-context-provider.d.mts +386 -0
- package/build/internal/es/context-related-posts-context-provider.d.mts +341 -0
- package/build/internal/es/context-tag-item-context-provider.d.mts +185 -0
- package/category-item-context-provider/package.json +3 -0
- package/context/blog-feed-context-provider/package.json +3 -0
- package/context/category-item-context-provider/package.json +3 -0
- package/context/post-by-id-context-provider/package.json +3 -0
- package/context/post-context-provider/package.json +3 -0
- package/context/post-item-context-provider/package.json +3 -0
- package/context/related-posts-context-provider/package.json +3 -0
- package/context/tag-item-context-provider/package.json +3 -0
- package/package.json +104 -5
- package/post-by-id-context-provider/package.json +3 -0
- package/post-context-provider/package.json +3 -0
- package/post-item-context-provider/package.json +3 -0
- package/related-posts-context-provider/package.json +3 -0
- package/tag-item-context-provider/package.json +3 -0
|
@@ -0,0 +1,4571 @@
|
|
|
1
|
+
// _sdk-exports/context-blog-feed-context-provider/runtime.js
|
|
2
|
+
import { Component as e, Suspense as t, createContext as n, createElement as r, startTransition as i, useCallback as a, useContext as o, useEffect as s, useMemo as c, useRef as l, useState as u } from "react";
|
|
3
|
+
import { useGetService as d, useService as f } from "@wix/services-manager-react";
|
|
4
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
5
|
+
var h = Object.defineProperty;
|
|
6
|
+
var g = (e6, t2) => {
|
|
7
|
+
let n2 = {};
|
|
8
|
+
for (var r2 in e6) h(n2, r2, { get: e6[r2], enumerable: true });
|
|
9
|
+
return t2 || h(n2, Symbol.toStringTag, { value: `Module` }), n2;
|
|
10
|
+
};
|
|
11
|
+
var _ = {};
|
|
12
|
+
function v(e6, t2 = false, n2 = (e7) => e7) {
|
|
13
|
+
return () => ({ __type: `event-definition`, type: e6, isDomainEvent: t2, transformations: n2 });
|
|
14
|
+
}
|
|
15
|
+
var y = (e6) => {
|
|
16
|
+
switch (e6) {
|
|
17
|
+
case `get`:
|
|
18
|
+
case `GET`:
|
|
19
|
+
return `GET`;
|
|
20
|
+
case `post`:
|
|
21
|
+
case `POST`:
|
|
22
|
+
return `POST`;
|
|
23
|
+
case `put`:
|
|
24
|
+
case `PUT`:
|
|
25
|
+
return `PUT`;
|
|
26
|
+
case `delete`:
|
|
27
|
+
case `DELETE`:
|
|
28
|
+
return `DELETE`;
|
|
29
|
+
case `patch`:
|
|
30
|
+
case `PATCH`:
|
|
31
|
+
return `PATCH`;
|
|
32
|
+
case `head`:
|
|
33
|
+
case `HEAD`:
|
|
34
|
+
return `HEAD`;
|
|
35
|
+
case `options`:
|
|
36
|
+
case `OPTIONS`:
|
|
37
|
+
return `OPTIONS`;
|
|
38
|
+
default:
|
|
39
|
+
throw Error(`Unknown method: ${e6}`);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var b = (e6) => (t2) => async (n2) => {
|
|
43
|
+
let r2, i2 = (t3) => {
|
|
44
|
+
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.`);
|
|
45
|
+
let { method: i3, url: a2, params: o2 } = r2;
|
|
46
|
+
return { ...r2, method: y(i3), url: a2, data: r2.data, params: o2 };
|
|
47
|
+
};
|
|
48
|
+
try {
|
|
49
|
+
let e7 = await t2.request(i2);
|
|
50
|
+
if (r2 === void 0) throw Error(`Request options were not created for this request, please reach out to support channels for assistance.`);
|
|
51
|
+
let n3 = Array.isArray(r2.transformResponse) ? r2.transformResponse : [r2.transformResponse], a2 = e7.data;
|
|
52
|
+
return n3.forEach((t3) => {
|
|
53
|
+
t3 && (a2 = t3(e7.data, e7.headers));
|
|
54
|
+
}), a2;
|
|
55
|
+
} catch (e7) {
|
|
56
|
+
throw typeof e7 == `object` && e7 && `response` in e7 && typeof e7.response == `object` && e7.response !== null && `data` in e7.response ? e7.response.data : e7;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
var x = (e6) => e6.__isAmbassador ? true : !!e6().__isAmbassador;
|
|
60
|
+
var S = `__metadata`;
|
|
61
|
+
var C = `edge.wixapis.com`;
|
|
62
|
+
var w = class extends Error {
|
|
63
|
+
message;
|
|
64
|
+
response;
|
|
65
|
+
constructor(e6, t2) {
|
|
66
|
+
super(e6), this.message = e6, this.response = t2;
|
|
67
|
+
}
|
|
68
|
+
async details() {
|
|
69
|
+
let e6 = await this.response.json();
|
|
70
|
+
return T(this.response.status, e6?.message, e6?.details, { requestId: this.response.headers.get(`X-Wix-Request-Id`), details: e6 });
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
var T = (e6, t2, n2, r2) => ({ details: { ...!n2?.validationError && { applicationError: { description: t2, code: e6, data: r2 } }, ...n2 }, message: t2, requestId: r2?.requestId });
|
|
74
|
+
var E = (e6) => e6?.method && [`post`, `put`, `patch`].includes(e6.method.toLocaleLowerCase()) && e6.body ? { "Content-Type": `application/json` } : {};
|
|
75
|
+
var D = (e6) => e6 && typeof e6 == `object` && !Array.isArray(e6);
|
|
76
|
+
var ee = (e6) => e6.__type === `host`;
|
|
77
|
+
function te(e6, t2) {
|
|
78
|
+
return e6.create(t2);
|
|
79
|
+
}
|
|
80
|
+
var ne = `x-wix-bi-gateway`;
|
|
81
|
+
function re(e6, t2, n2) {
|
|
82
|
+
return { [ne]: ie({ environment: `js-sdk${n2 ? `-${n2}` : ``}`, "package-name": e6.packageName ?? t2?.PACKAGE_NAME, "method-fqn": e6.methodFqn, entity: e6.entityFqdn }) };
|
|
83
|
+
}
|
|
84
|
+
function ie(e6) {
|
|
85
|
+
return Object.entries(e6).filter(([e7, t2]) => !!t2).map(([e7, t2]) => `${e7}=${t2}`).join(`,`);
|
|
86
|
+
}
|
|
87
|
+
function ae(e6) {
|
|
88
|
+
let t2 = globalThis.__wix_context__, n2 = { client: _.client, elevatedClient: _.elevatedClient }, r2;
|
|
89
|
+
globalThis.__wix_context__ = void 0, _.client = void 0, _.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
90
|
+
try {
|
|
91
|
+
return e6();
|
|
92
|
+
} finally {
|
|
93
|
+
globalThis.__wix_context__ = t2, _.client = n2.client, _.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
var oe = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
|
|
97
|
+
function se(e6) {
|
|
98
|
+
return de(e6).map((e7) => e7.toLocaleUpperCase()).join(`_`);
|
|
99
|
+
}
|
|
100
|
+
var ce = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
101
|
+
var le = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
102
|
+
var O = `$1\0$2`;
|
|
103
|
+
var ue = /[^\p{L}\d]+/giu;
|
|
104
|
+
function de(e6) {
|
|
105
|
+
let t2 = e6.trim();
|
|
106
|
+
t2 = t2.replace(ce, O).replace(le, O), t2 = t2.replace(ue, `\0`);
|
|
107
|
+
let n2 = 0, r2 = t2.length;
|
|
108
|
+
for (; t2.charAt(n2) === `\0`; ) n2++;
|
|
109
|
+
if (n2 === r2) return [];
|
|
110
|
+
for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
|
|
111
|
+
return t2.slice(n2, r2).split(/\0/g);
|
|
112
|
+
}
|
|
113
|
+
var fe = (e6) => `validationError` in (e6.response?.data?.details ?? {});
|
|
114
|
+
var k = (e6) => `applicationError` in (e6.response?.data?.details ?? {});
|
|
115
|
+
var pe = (e6) => (e6.response?.status ?? -1) >= 400 && (e6.response?.status ?? -1) < 500;
|
|
116
|
+
function me(e6, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
|
|
117
|
+
if (typeof e6 != `object` || !e6) throw e6;
|
|
118
|
+
if (fe(e6)) return he(e6, t2, n2);
|
|
119
|
+
if (k(e6)) return _e(e6);
|
|
120
|
+
if (pe(e6)) {
|
|
121
|
+
let t3 = e6.response?.status, n3 = e6.response?.statusText ?? `UNKNOWN`, r2 = e6.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: se(n3), data: {} }, requestId: e6.requestId };
|
|
122
|
+
return ge(e6, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
|
|
123
|
+
}
|
|
124
|
+
return ve(e6);
|
|
125
|
+
}
|
|
126
|
+
var he = (e6, t2, n2) => {
|
|
127
|
+
let r2 = e6.response?.data, i2 = e6.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = ye(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 };
|
|
128
|
+
return ge(e6, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e6.response?.status, requestId: i2 } });
|
|
129
|
+
};
|
|
130
|
+
var ge = (e6, { message: t2, extraProperties: n2 }) => Object.assign(e6, { ...n2, message: t2 });
|
|
131
|
+
var _e = (e6) => {
|
|
132
|
+
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 ?? se(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 };
|
|
133
|
+
return ge(e6, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e6.requestId } });
|
|
134
|
+
};
|
|
135
|
+
var ve = (e6) => ge(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: se(e6.response?.statusText ?? `UNKNOWN`), ...!e6.response && { runtimeError: e6 } } });
|
|
136
|
+
var ye = ({ spreadPathsToArguments: e6, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
|
|
137
|
+
let a2 = { ...e6, ...t2 }, o2 = Object.keys(a2);
|
|
138
|
+
return r2?.filter((e7) => !r2.some((t3) => t3.field.length > e7.field.length && t3.field.startsWith(e7.field) && o2.includes(t3.field))).map((e7) => {
|
|
139
|
+
let r3 = t2[e7.field];
|
|
140
|
+
if (r3) return { ...e7, field: be(r3, i2) };
|
|
141
|
+
let s2 = o2?.sort((e8, t3) => t3.length - e8.length)?.find((t3) => e7.field.startsWith(t3));
|
|
142
|
+
if (s2) {
|
|
143
|
+
let t3 = a2[s2];
|
|
144
|
+
if (t3) return { ...e7, field: e7.field.replace(s2, be(t3, i2)) };
|
|
145
|
+
}
|
|
146
|
+
return n2 ? { ...e7, field: `${i2[0]}.${e7.field}` } : e7;
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
var be = (e6, t2) => {
|
|
150
|
+
let n2 = xe(e6);
|
|
151
|
+
return n2 == null ? e6 : e6.replace(`$[${n2}]`, t2[n2]);
|
|
152
|
+
};
|
|
153
|
+
var xe = (e6) => {
|
|
154
|
+
let t2 = e6.match(/\$\[(?<argIndex>\d+)\]/);
|
|
155
|
+
return t2 && t2.groups && Number(t2.groups.argIndex);
|
|
156
|
+
};
|
|
157
|
+
function Se(e6, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
|
|
158
|
+
return ae(() => e6({ request: async (e7) => {
|
|
159
|
+
let i3 = e7({ host: s2?.HTTPHost || `www.wixapis.com` }), a3 = i3;
|
|
160
|
+
a3.method === `GET` && a3.fallback?.length && (a3.params?.toString().length ?? 0) > 4e3 && (a3 = i3.fallback[0]);
|
|
161
|
+
let o3 = s2?.HTTPHost ?? `www.wixapis.com`, u3 = `https://${l2 ? C : o3}${a3.url}`;
|
|
162
|
+
a3.params && a3.params.toString() && (u3 += `?${a3.params.toString()}`);
|
|
163
|
+
try {
|
|
164
|
+
let e8 = re(i3, t2, c2), o4 = { method: a3.method, ...a3.data && { body: JSON.stringify(a3.data) }, headers: { ...e8 } }, s3 = await n2(u3, o4);
|
|
165
|
+
if (s3.status !== 200) {
|
|
166
|
+
let e9 = null;
|
|
167
|
+
try {
|
|
168
|
+
e9 = await s3.json();
|
|
169
|
+
} catch {
|
|
170
|
+
}
|
|
171
|
+
let t3 = we(s3.status, e9?.message ?? s3.statusText, e9?.details, { requestId: s3.headers.get(`X-Wix-Request-Id`), details: e9 }), n3 = me(t3);
|
|
172
|
+
throw r2?.handleError(n3, { requestOptions: { url: a3.url, method: a3.method, entityFqdn: i3.entityFqdn, methodFqn: i3.methodFqn } }), t3;
|
|
173
|
+
}
|
|
174
|
+
let l3 = await s3.json();
|
|
175
|
+
return { data: a3.migrationOptions?.optInTransformResponse && a3.transformResponse ? Array.isArray(a3.transformResponse) ? a3.transformResponse[0](l3) : a3.transformResponse(l3) : l3, headers: s3.headers, status: s3.status, statusText: s3.statusText };
|
|
176
|
+
} catch (e8) {
|
|
177
|
+
throw e8.message?.includes(`fetch is not defined`) && console.error(`Node.js v18+ is required`), e8;
|
|
178
|
+
}
|
|
179
|
+
}, fetchWithAuth: n2, wixAPIFetch: i2, getActiveToken: a2, getAuthHeaders: o2 }, { validateRequestSchema: u2 }));
|
|
180
|
+
}
|
|
181
|
+
var Ce = class extends Error {
|
|
182
|
+
response;
|
|
183
|
+
requestId;
|
|
184
|
+
constructor(e6) {
|
|
185
|
+
super(), this.response = e6.response, this.requestId = e6.requestId;
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
var we = (e6, t2, n2, r2) => new Ce({ response: { data: { details: { ...!n2?.validationError && { applicationError: { description: t2, code: e6, data: r2 } }, ...n2 }, message: t2 }, status: e6 }, requestId: r2?.requestId });
|
|
189
|
+
var Te = `.`;
|
|
190
|
+
function Ee(e6, t2, n2) {
|
|
191
|
+
if (e6 == null) throw Error(`Cannot set value on null or undefined`);
|
|
192
|
+
let r2 = De(t2), i2 = e6;
|
|
193
|
+
for (let e7 = 0; e7 < r2.length; e7++) {
|
|
194
|
+
let t3 = r2[e7];
|
|
195
|
+
if (e7 === r2.length - 1) {
|
|
196
|
+
i2[t3] = n2;
|
|
197
|
+
break;
|
|
198
|
+
}
|
|
199
|
+
let a2 = r2[e7 + 1];
|
|
200
|
+
(!(t3 in i2) || i2[t3] == null || typeof i2[t3] != `object` || i2[t3] === null) && (i2[t3] = typeof a2 == `number` ? [] : {}), i2 = i2[t3];
|
|
201
|
+
}
|
|
202
|
+
return e6;
|
|
203
|
+
}
|
|
204
|
+
function De(e6) {
|
|
205
|
+
return Array.isArray(e6) ? e6 : e6.split(Te).map((e7) => Oe(e7) ? Number(e7) : e7);
|
|
206
|
+
}
|
|
207
|
+
function Oe(e6) {
|
|
208
|
+
return /^\d+$/.test(e6);
|
|
209
|
+
}
|
|
210
|
+
function ke(e6) {
|
|
211
|
+
let t2 = {};
|
|
212
|
+
for (let [n2, r2] of Object.entries(e6)) Ae(n2) || Ee(t2, De(n2), r2);
|
|
213
|
+
return t2;
|
|
214
|
+
}
|
|
215
|
+
function Ae(e6) {
|
|
216
|
+
return e6 === `__proto__` || e6 === `constructor` || e6 === `prototype`;
|
|
217
|
+
}
|
|
218
|
+
var je = class {
|
|
219
|
+
BRACKET_PATTERN = /\[(\d+)\]/g;
|
|
220
|
+
NUMERIC_PATTERN = /^\d+$/;
|
|
221
|
+
ESCAPED_DOT_PATTERN = /\\\./g;
|
|
222
|
+
ESCAPED_LEFT_BRACKET_PATTERN = /\\\[/g;
|
|
223
|
+
ESCAPED_RIGHT_BRACKET_PATTERN = /\\\]/g;
|
|
224
|
+
SPLIT_PATTERN = /\.|\[(\d+)\]/g;
|
|
225
|
+
DOT_BEFORE_BRACKET_PATTERN = /\.\[/g;
|
|
226
|
+
ESCAPED_DOT_PLACEHOLDER = `__DOT__`;
|
|
227
|
+
ESCAPED_RIGHT_BRACKET_PLACEHOLDER = `__RB__`;
|
|
228
|
+
ESCAPED_LEFT_BRACKET_PLACEHOLDER = `__LB__`;
|
|
229
|
+
modifiedFields;
|
|
230
|
+
cleanedModifiedFields;
|
|
231
|
+
constructor(e6) {
|
|
232
|
+
this.modifiedFields = e6;
|
|
233
|
+
}
|
|
234
|
+
replaceEscapedCharacters(e6) {
|
|
235
|
+
return e6.replace(this.ESCAPED_DOT_PATTERN, this.ESCAPED_DOT_PLACEHOLDER).replace(this.ESCAPED_LEFT_BRACKET_PATTERN, this.ESCAPED_LEFT_BRACKET_PLACEHOLDER).replace(this.ESCAPED_RIGHT_BRACKET_PATTERN, this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER);
|
|
236
|
+
}
|
|
237
|
+
restoreEscapedCharacters(e6) {
|
|
238
|
+
return e6.replace(this.ESCAPED_DOT_PLACEHOLDER, `\\.`).replace(this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER, `\\]`).replace(this.ESCAPED_LEFT_BRACKET_PLACEHOLDER, `\\[`);
|
|
239
|
+
}
|
|
240
|
+
unflatten() {
|
|
241
|
+
return this.cleanedModifiedFields = Object.fromEntries(Object.entries(this.modifiedFields).map(([e6, t2]) => [this.replaceEscapedCharacters(this.bracketToDotNotation(e6)), t2])), ke(this.cleanedModifiedFields);
|
|
242
|
+
}
|
|
243
|
+
flatten(e6) {
|
|
244
|
+
let t2 = {};
|
|
245
|
+
for (let n2 of Object.keys(this.cleanedModifiedFields)) {
|
|
246
|
+
let r2 = this.splitPath(n2), i2 = this.navigatePath(e6, r2);
|
|
247
|
+
t2 = { ...t2, ...i2 };
|
|
248
|
+
}
|
|
249
|
+
return Object.fromEntries(Object.entries(t2).map(([e7, t3]) => [this.restoreEscapedCharacters(e7), t3]));
|
|
250
|
+
}
|
|
251
|
+
splitPath(e6) {
|
|
252
|
+
let t2 = [], n2 = 0, r2 = Array.from(e6.matchAll(this.SPLIT_PATTERN));
|
|
253
|
+
for (let i2 of r2) i2.index > n2 && t2.push(e6.substring(n2, i2.index)), i2[1] && t2.push(i2[1]), n2 = i2.index + i2[0].length;
|
|
254
|
+
return n2 < e6.length && t2.push(e6.substring(n2)), t2;
|
|
255
|
+
}
|
|
256
|
+
navigatePath(e6, t2) {
|
|
257
|
+
let n2 = e6, r2 = [], i2 = (e7) => {
|
|
258
|
+
if (!Array.isArray(n2)) throw Error(`Expected array at path ${this.buildPathString(r2)}, but got ${typeof n2}`);
|
|
259
|
+
r2.push(`[${e7}]`), n2 = n2[parseInt(e7, 10)];
|
|
260
|
+
}, a2 = (e7, t3) => {
|
|
261
|
+
let i3 = e7 in oe ? oe[e7] : void 0;
|
|
262
|
+
if (i3 && i3 in t3) {
|
|
263
|
+
r2.push(i3), n2 = t3[i3];
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
let a3 = Fe(e7);
|
|
267
|
+
if (a3 && a3 in t3) r2.push(a3), n2 = t3[a3];
|
|
268
|
+
else throw Error(`Cannot find key '${e7}' or its transformations at path ${this.buildPathString(r2)}`);
|
|
269
|
+
}, o2 = (e7, t3) => {
|
|
270
|
+
r2.push(e7), n2 = t3[e7];
|
|
271
|
+
};
|
|
272
|
+
for (let e7 of t2) {
|
|
273
|
+
if (this.NUMERIC_PATTERN.test(e7)) {
|
|
274
|
+
i2(e7);
|
|
275
|
+
continue;
|
|
276
|
+
}
|
|
277
|
+
if (typeof n2 != `object` || !n2) throw Error(`Cannot access property '${e7}' on ${typeof n2} at path ${this.buildPathString(r2)}`);
|
|
278
|
+
let t3 = n2;
|
|
279
|
+
e7 in n2 ? o2(e7, t3) : a2(e7, t3);
|
|
280
|
+
}
|
|
281
|
+
return { [this.buildPathString(r2)]: n2 };
|
|
282
|
+
}
|
|
283
|
+
buildPathString(e6) {
|
|
284
|
+
return e6.join(`.`).replace(this.DOT_BEFORE_BRACKET_PATTERN, `[`);
|
|
285
|
+
}
|
|
286
|
+
bracketToDotNotation(e6) {
|
|
287
|
+
return e6.replace(this.BRACKET_PATTERN, (t2, n2, r2) => r2 > 0 && e6[r2 - 1] === `\\` ? t2 : `.` + n2);
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
function Me(e6, t2) {
|
|
291
|
+
let n2 = e6?.modifiedFields;
|
|
292
|
+
if (!n2) return null;
|
|
293
|
+
let r2 = Ne(n2);
|
|
294
|
+
if (!r2) return null;
|
|
295
|
+
let { unflattenedModifiedFields: i2, modifiedFieldsManipulator: a2 } = r2;
|
|
296
|
+
e6 = { ...e6, modifiedFields: i2 };
|
|
297
|
+
let o2 = t2(e6), s2 = o2?.modifiedFields;
|
|
298
|
+
if (!s2) return null;
|
|
299
|
+
let c2 = Pe(s2, a2);
|
|
300
|
+
return c2 === null ? null : (o2.modifiedFields = c2, o2);
|
|
301
|
+
}
|
|
302
|
+
function Ne(e6) {
|
|
303
|
+
if (typeof e6 == `object` && e6 && !Array.isArray(e6)) try {
|
|
304
|
+
let t2 = new je(e6);
|
|
305
|
+
return { unflattenedModifiedFields: t2.unflatten(), modifiedFieldsManipulator: t2 };
|
|
306
|
+
} catch {
|
|
307
|
+
return null;
|
|
308
|
+
}
|
|
309
|
+
return null;
|
|
310
|
+
}
|
|
311
|
+
function Pe(e6, t2) {
|
|
312
|
+
if (typeof e6 == `object` && e6 && !Array.isArray(e6)) try {
|
|
313
|
+
return t2.flatten(e6);
|
|
314
|
+
} catch {
|
|
315
|
+
return null;
|
|
316
|
+
}
|
|
317
|
+
return null;
|
|
318
|
+
}
|
|
319
|
+
function Fe(e6) {
|
|
320
|
+
return e6.replace(/[-_\s]+(.)?/g, (e7, t2) => t2 ? t2.toUpperCase() : ``).replace(/^./, (e7) => e7.toLowerCase());
|
|
321
|
+
}
|
|
322
|
+
function Ie() {
|
|
323
|
+
return { emit(e6, ...t2) {
|
|
324
|
+
for (let n2 = 0, r2 = this.events[e6] || [], i2 = r2.length; n2 < i2; n2++) r2[n2](...t2);
|
|
325
|
+
}, events: {}, on(e6, t2) {
|
|
326
|
+
return (this.events[e6] ||= []).push(t2), () => {
|
|
327
|
+
this.events[e6] = this.events[e6]?.filter((e7) => t2 !== e7);
|
|
328
|
+
};
|
|
329
|
+
} };
|
|
330
|
+
}
|
|
331
|
+
var Le = (e6) => e6.__type === `event-definition`;
|
|
332
|
+
function Re(e6, t2, n2, r2) {
|
|
333
|
+
let i2;
|
|
334
|
+
if (e6.isDomainEvent) {
|
|
335
|
+
let { deletedEvent: e7, actionEvent: t3, createdEvent: a3, updatedEvent: o3, ...s3 } = n2, c2 = { ...r2, ...s3 };
|
|
336
|
+
i2 = e7 ? e7?.deletedEntity ? { entity: e7?.deletedEntity, metadata: c2 } : { metadata: c2 } : t3 ? { data: t3.body, metadata: c2 } : o3 ? { entity: o3.currentEntity, metadata: c2, ...o3.modifiedFields ? { modifiedFields: o3.modifiedFields } : {} } : { entity: a3?.entity, metadata: c2 };
|
|
337
|
+
} else i2 = { data: n2, metadata: r2 };
|
|
338
|
+
let a2 = e6.transformations ?? ((e7) => e7), o2 = i2, s2 = i2;
|
|
339
|
+
if (s2.modifiedFields) {
|
|
340
|
+
let e7 = s2.modifiedFields;
|
|
341
|
+
if (typeof e7 == `object` && e7 && !Array.isArray(e7)) {
|
|
342
|
+
o2 = structuredClone(i2);
|
|
343
|
+
let e8 = Me(s2, a2);
|
|
344
|
+
if (e8) return t2(e8);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
return t2(a2(o2));
|
|
348
|
+
}
|
|
349
|
+
function ze(e6) {
|
|
350
|
+
let t2 = /* @__PURE__ */ new Map(), n2 = Ie();
|
|
351
|
+
return { initModule(e7) {
|
|
352
|
+
return (r2) => {
|
|
353
|
+
let i2 = t2.get(e7.type) ?? [];
|
|
354
|
+
i2.push({ eventDefinition: e7, handler: r2 }), t2.set(e7.type, i2), n2.emit(`registered`, e7);
|
|
355
|
+
};
|
|
356
|
+
}, client: { ...n2, getRegisteredEvents: () => t2, async process(e7, n3 = { expectedEvents: [] }) {
|
|
357
|
+
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 }))];
|
|
358
|
+
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(`, `)}`);
|
|
359
|
+
let l2 = t2.get(r2) ?? [];
|
|
360
|
+
return await Promise.all(l2.map(({ eventDefinition: e8, handler: t3 }) => Re(e8, t3, o2, { instanceId: a2, identity: i2, accountInfo: s2 }))), { instanceId: a2, eventType: r2, payload: o2, identity: i2, accountInfo: s2 };
|
|
361
|
+
}, async processRequest(e7, t3) {
|
|
362
|
+
let n3 = await e7.text();
|
|
363
|
+
return this.process(n3, t3);
|
|
364
|
+
}, async parseJWT(t3) {
|
|
365
|
+
let n3 = e6();
|
|
366
|
+
if (!n3.decodeJWT) throw Error(`decodeJWT is not supported by the authentication strategy`);
|
|
367
|
+
let { decoded: r2, valid: i2 } = await n3.decodeJWT(t3);
|
|
368
|
+
if (!i2) throw Error(`JWT is not valid`);
|
|
369
|
+
if (typeof r2.data != `string`) throw Error(`Unexpected type of JWT data: expected string, got ${typeof r2.data}`);
|
|
370
|
+
let a2 = JSON.parse(r2.data), o2 = a2.eventType, s2 = a2.accountInfo, c2 = a2.instanceId, l2 = a2.identity ? JSON.parse(a2.identity) : void 0;
|
|
371
|
+
return { instanceId: c2, eventType: o2, payload: JSON.parse(a2.data), identity: l2, accountInfo: s2 };
|
|
372
|
+
}, async parseRequest(e7) {
|
|
373
|
+
let t3 = await e7.text();
|
|
374
|
+
return this.parseJWT(t3);
|
|
375
|
+
}, async executeHandlers(e7) {
|
|
376
|
+
let n3 = Array.from(t2.keys()).map((e8) => ({ type: e8 }));
|
|
377
|
+
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(`, `)}`);
|
|
378
|
+
let r2 = t2.get(e7.eventType) ?? [];
|
|
379
|
+
await Promise.all(r2.map(({ eventDefinition: t3, handler: n4 }) => Re(t3, n4, e7.payload, { instanceId: e7.instanceId, identity: e7.identity })));
|
|
380
|
+
}, apps: { AppInstalled: v(`AppInstalled`)(), AppRemoved: v(`AppRemoved`)() } } };
|
|
381
|
+
}
|
|
382
|
+
var Be = (e6) => e6.__type === `service-plugin-definition`;
|
|
383
|
+
function Ve(e6) {
|
|
384
|
+
let t2 = /* @__PURE__ */ new Map(), n2 = Ie();
|
|
385
|
+
return { initModule(e7) {
|
|
386
|
+
return (r2) => {
|
|
387
|
+
let i2 = t2.get(e7.componentType.toLowerCase()) ?? [];
|
|
388
|
+
i2.push({ servicePluginDefinition: e7, implementation: r2 }), t2.set(e7.componentType.toLowerCase(), i2), n2.emit(`registered`, e7);
|
|
389
|
+
};
|
|
390
|
+
}, client: { ...n2, getRegisteredServicePlugins: () => t2, async parseJWT(t3) {
|
|
391
|
+
let n3 = e6();
|
|
392
|
+
if (!n3.decodeJWT) throw Error(`decodeJWT is not supported by the authentication strategy`);
|
|
393
|
+
let { decoded: r2, valid: i2 } = await n3.decodeJWT(t3, true);
|
|
394
|
+
if (!i2) throw Error(`JWT is not valid`);
|
|
395
|
+
if (typeof r2.data != `object` || r2.data === null || !(`metadata` in r2.data) || typeof r2.data.metadata != `object` || r2.data.metadata === null || !(`appExtensionType` in r2.data.metadata) || typeof r2.data.metadata.appExtensionType != `string`) throw Error(`Unexpected JWT data: expected object with metadata.appExtensionType string`);
|
|
396
|
+
return r2.data;
|
|
397
|
+
}, async process(e7) {
|
|
398
|
+
let t3 = await this.parseJWT(e7.body);
|
|
399
|
+
return this.executeHandler(t3, e7.url);
|
|
400
|
+
}, async parseRequest(e7) {
|
|
401
|
+
let t3 = await e7.text();
|
|
402
|
+
return this.parseJWT(t3);
|
|
403
|
+
}, async processRequest(e7) {
|
|
404
|
+
let t3 = await this.parseRequest(e7);
|
|
405
|
+
return this.processParsedRequest(t3, e7.url);
|
|
406
|
+
}, async processParsedRequest(e7, t3) {
|
|
407
|
+
try {
|
|
408
|
+
let n3 = await this.executeHandler(e7, t3);
|
|
409
|
+
return Response.json(n3);
|
|
410
|
+
} catch (e8) {
|
|
411
|
+
if (e8.errorType === `SPI` && e8.applicationCode && e8.httpCode) return Response.json({ applicationError: { code: e8.applicationCode, data: e8.data } }, { status: e8.httpCode });
|
|
412
|
+
throw e8;
|
|
413
|
+
}
|
|
414
|
+
}, async executeHandler(e7, n3) {
|
|
415
|
+
let r2 = e7.metadata.appExtensionType.toLowerCase(), i2 = t2.get(r2) ?? [];
|
|
416
|
+
if (i2.length === 0) throw Error(`No service plugin implementations found for component type ${r2}`);
|
|
417
|
+
if (i2.length > 1) throw Error(`Multiple service plugin implementations found for component type ${r2}. This is currently not supported`);
|
|
418
|
+
let { implementation: a2, servicePluginDefinition: o2 } = i2[0], s2 = o2.methods.find((e8) => n3.endsWith(e8.primaryHttpMappingPath));
|
|
419
|
+
if (!s2) throw Error(`Unexpect request: request url did not match any method: ` + n3);
|
|
420
|
+
let c2 = a2[s2.name];
|
|
421
|
+
if (!c2) throw Error(`Got request for service plugin method ${s2.name} but no implementation was provided. Available methods: ${Object.keys(a2).join(`, `)}`);
|
|
422
|
+
return s2.transformations.toREST(await c2(s2.transformations.fromREST(e7)));
|
|
423
|
+
} } };
|
|
424
|
+
}
|
|
425
|
+
var A = `X-Wix-Consistent`;
|
|
426
|
+
function He(e6) {
|
|
427
|
+
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) => {
|
|
428
|
+
let i3 = o2(), s3 = await a2(), c3 = { ...r3?.headers ?? {}, ...s3.headers, ...e6.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [A]: t2[A] } : {} }, l3 = e6.host?.getErrorHandler?.();
|
|
429
|
+
try {
|
|
430
|
+
if (typeof n3 == `string` || n3 instanceof URL) {
|
|
431
|
+
let e7 = await i3(n3, { ...r3, headers: c3 });
|
|
432
|
+
l3?.handleError(e7, { requestOptions: { url: n3.toString(), method: r3?.method } });
|
|
433
|
+
let a3 = Ue(e7);
|
|
434
|
+
return a3 && (t2[A] = a3), e7;
|
|
435
|
+
}
|
|
436
|
+
{
|
|
437
|
+
for (let [e8, t3] of Object.entries(c3)) typeof t3 == `string` && n3.headers.set(e8, t3);
|
|
438
|
+
let e7 = await i3(n3, r3);
|
|
439
|
+
l3?.handleError(e7, { requestOptions: { url: n3.url, method: r3?.method } });
|
|
440
|
+
let a3 = Ue(e7);
|
|
441
|
+
return a3 && (t2[A] = a3), e7;
|
|
442
|
+
}
|
|
443
|
+
} catch (e7) {
|
|
444
|
+
throw l3?.handleError(e7, { requestOptions: { url: typeof n3 == `string` || n3 instanceof URL ? n3.toString() : n3.url, method: r3?.method } }), e7;
|
|
445
|
+
}
|
|
446
|
+
}, { client: c2, initModule: l2 } = Ve(i2), { client: u2, initModule: d2 } = ze(i2), f2 = async (n3, r3) => {
|
|
447
|
+
let i3 = o2(), s3 = await a2(), c3 = E(r3), l3 = await i3(n3, { ...r3, headers: { ...c3, ...t2, ...s3?.headers, ...r3?.headers, ...e6.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [A]: t2[A] } : {} } }), u3 = Ue(l3);
|
|
448
|
+
return u3 && (t2[A] = u3), l3;
|
|
449
|
+
}, p2 = (t3, n3) => {
|
|
450
|
+
if (Le(t3)) return d2(t3);
|
|
451
|
+
if (Be(t3)) return l2(t3);
|
|
452
|
+
if (ee(t3) && e6.host) return te(t3, e6.host);
|
|
453
|
+
if (typeof t3 == `function`) {
|
|
454
|
+
if (`__type` in t3 && t3.__type === `wix_spi_error`) return t3;
|
|
455
|
+
let r3 = e6.host?.apiBaseUrl ?? `www.wixapis.com`, o3 = e6.useCDN === void 0 ? i2().shouldUseCDN : e6.useCDN;
|
|
456
|
+
return Se(ae(() => x(t3)) ? b(t3) : t3, n3 ?? {}, f2, e6.host?.getErrorHandler?.(), (e7, t4) => {
|
|
457
|
+
let n4 = new URL(e7, `https://${r3}`);
|
|
458
|
+
return n4.host = r3, n4.protocol = `https`, f2(n4.toString(), t4);
|
|
459
|
+
}, i2().getActiveToken, async () => a2(), { HTTPHost: r3 }, e6.host?.name, o3, e6.validateRequestSchema);
|
|
460
|
+
}
|
|
461
|
+
return D(t3) ? Object.fromEntries(Object.entries(t3).map(([e7, n4]) => [e7, p2(n4, t3[S])])) : t3;
|
|
462
|
+
}, m2 = (e7) => {
|
|
463
|
+
for (let n3 in e7) t2[n3] = e7[n3];
|
|
464
|
+
};
|
|
465
|
+
return { ...e6.modules ? p2(e6.modules) : {}, get auth() {
|
|
466
|
+
let t3 = i2();
|
|
467
|
+
return t3.getAuthHeaders = t3.getAuthHeaders.bind(void 0, e6.host), t3;
|
|
468
|
+
}, setHeaders: m2, use: p2, enableContext(e7, t3 = { elevated: false }) {
|
|
469
|
+
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 ? _.elevatedClient = this : _.client = this;
|
|
470
|
+
}, fetch: (t3, n3) => {
|
|
471
|
+
let r3 = e6.host?.apiBaseUrl ?? `www.wixapis.com`, i3 = new URL(t3, `https://${r3}`);
|
|
472
|
+
return i3.host = r3, i3.protocol = `https`, f2(i3.toString(), n3);
|
|
473
|
+
}, fetchWithAuth: s2, async graphql(t3, n3, r3 = { apiVersion: `alpha` }) {
|
|
474
|
+
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 }) });
|
|
475
|
+
if (a3.status !== 200) throw new w(`GraphQL request failed with status ${a3.status}`, a3);
|
|
476
|
+
let { data: o3, errors: s3 } = await a3.json();
|
|
477
|
+
return { data: o3 ?? {}, errors: s3 };
|
|
478
|
+
}, webhooks: u2, servicePlugins: c2 };
|
|
479
|
+
}
|
|
480
|
+
function Ue(e6) {
|
|
481
|
+
return e6.headers?.get(`X-Wix-Consistent`) ?? e6.headers?.get(`x-wix-consistent`);
|
|
482
|
+
}
|
|
483
|
+
var We = { _id: `id`, _createdDate: `createdDate`, _updatedDate: `updatedDate` };
|
|
484
|
+
var Ge = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
|
|
485
|
+
var Ke = `items`;
|
|
486
|
+
var qe = `pagingMetadata`;
|
|
487
|
+
var Je = We;
|
|
488
|
+
function Ye(e6, t2) {
|
|
489
|
+
return e6?.split(`.`).map((e7) => t2?.[e7] ?? e7).join(`.`);
|
|
490
|
+
}
|
|
491
|
+
var Xe = `sort.fieldName`;
|
|
492
|
+
function Ze(e6, t2, n2) {
|
|
493
|
+
return (e6 === Xe || e6.endsWith(`.${Xe}`)) && typeof t2 == `string` ? Ye(t2, n2) : t2;
|
|
494
|
+
}
|
|
495
|
+
function Qe(e6, t2, n2) {
|
|
496
|
+
let r2 = (e7) => n2.includes(e7), i2 = (e7, n3) => {
|
|
497
|
+
if (Array.isArray(e7)) e7.forEach((e8) => {
|
|
498
|
+
i2(e8, n3);
|
|
499
|
+
});
|
|
500
|
+
else if (typeof e7 == `object` && e7) {
|
|
501
|
+
let a2 = e7;
|
|
502
|
+
Object.keys(a2).forEach((e8) => {
|
|
503
|
+
let o2 = n3 === `` ? e8 : `${n3}.${e8}`;
|
|
504
|
+
if (r2(o2)) return;
|
|
505
|
+
let s2 = $e(e8, t2);
|
|
506
|
+
s2 !== e8 && !(s2 in a2) && (a2[s2] = a2[e8], delete a2[e8]), a2[s2] = Ze(o2, a2[s2], t2), i2(a2[s2], o2);
|
|
507
|
+
});
|
|
508
|
+
}
|
|
509
|
+
};
|
|
510
|
+
return i2(e6, ``), e6;
|
|
511
|
+
}
|
|
512
|
+
function $e(e6, t2) {
|
|
513
|
+
let n2;
|
|
514
|
+
return n2 = e6.includes(`.`) ? e6.split(`.`).map((e7) => t2[e7] ?? e7).join(`.`) : t2[e6] ?? e6, n2;
|
|
515
|
+
}
|
|
516
|
+
function j(e6, t2 = []) {
|
|
517
|
+
return Qe(e6, We, t2);
|
|
518
|
+
}
|
|
519
|
+
function M(e6, t2 = []) {
|
|
520
|
+
return Qe(e6, Ge, t2);
|
|
521
|
+
}
|
|
522
|
+
function N(e6) {
|
|
523
|
+
return e6 ? new Date(e6) : void 0;
|
|
524
|
+
}
|
|
525
|
+
var et = /* @__PURE__ */ new WeakMap();
|
|
526
|
+
function tt() {
|
|
527
|
+
return { leaves: void 0, fields: void 0, mapFields: void 0, anyField: void 0 };
|
|
528
|
+
}
|
|
529
|
+
function nt(e6, t2) {
|
|
530
|
+
let n2 = e6.get(t2);
|
|
531
|
+
return n2 || (n2 = tt(), e6.set(t2, n2)), n2;
|
|
532
|
+
}
|
|
533
|
+
function rt(e6, t2) {
|
|
534
|
+
return t2 === `*` ? (e6.anyField ??= tt(), e6.anyField) : t2.endsWith(`{}`) ? (e6.mapFields ??= /* @__PURE__ */ new Map(), nt(e6.mapFields, t2.slice(0, -2))) : (e6.fields ??= /* @__PURE__ */ new Map(), nt(e6.fields, t2));
|
|
535
|
+
}
|
|
536
|
+
function it(e6) {
|
|
537
|
+
let t2 = tt();
|
|
538
|
+
for (let n2 of e6) {
|
|
539
|
+
let e7 = n2.path.split(`.`).reduce(rt, t2);
|
|
540
|
+
e7.leaves ??= [], e7.leaves.push(n2);
|
|
541
|
+
}
|
|
542
|
+
return t2;
|
|
543
|
+
}
|
|
544
|
+
function at(e6) {
|
|
545
|
+
let t2 = et.get(e6);
|
|
546
|
+
return t2 || (t2 = it(e6), et.set(e6, t2)), t2;
|
|
547
|
+
}
|
|
548
|
+
function ot(e6) {
|
|
549
|
+
return typeof e6 == `object` && !!e6;
|
|
550
|
+
}
|
|
551
|
+
function st(e6, { isRepeated: t2, isMap: n2 }, r2) {
|
|
552
|
+
return t2 ? Array.isArray(e6) ? e6.map(r2) : e6 : n2 ? ot(e6) ? Object.fromEntries(Object.entries(e6).map(([e7, t3]) => [e7, r2(t3)])) : e6 : r2(e6);
|
|
553
|
+
}
|
|
554
|
+
function ct(e6, t2, n2) {
|
|
555
|
+
ot(e6) && dt(e6, t2, n2);
|
|
556
|
+
}
|
|
557
|
+
function lt(e6, t2, n2) {
|
|
558
|
+
for (let [r2, i2] of t2) {
|
|
559
|
+
if (!(r2 in e6)) continue;
|
|
560
|
+
if (i2.leaves) for (let t4 of i2.leaves) e6[r2] = st(e6[r2], t4, n2);
|
|
561
|
+
let t3 = e6[r2];
|
|
562
|
+
Array.isArray(t3) ? t3.forEach((e7) => ct(e7, i2, n2)) : ct(t3, i2, n2);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
function ut(e6, t2, n2) {
|
|
566
|
+
for (let [r2, i2] of t2) {
|
|
567
|
+
let t3 = e6[r2];
|
|
568
|
+
ot(t3) && Object.values(t3).forEach((e7) => ct(e7, i2, n2));
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
function dt(e6, { fields: t2, mapFields: n2, anyField: r2 }, i2) {
|
|
572
|
+
t2 && lt(e6, t2, i2), n2 && ut(e6, n2, i2), r2 && Object.values(e6).forEach((e7) => ct(e7, r2, i2));
|
|
573
|
+
}
|
|
574
|
+
function P(e6, t2) {
|
|
575
|
+
if (!ot(e6)) return e6;
|
|
576
|
+
for (let { paths: n2, transformFn: r2 } of t2) dt(e6, at(n2), r2);
|
|
577
|
+
return e6;
|
|
578
|
+
}
|
|
579
|
+
function ft(e6) {
|
|
580
|
+
return _t(e6).map((e7) => e7.toLocaleUpperCase()).join(`_`);
|
|
581
|
+
}
|
|
582
|
+
var pt = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
583
|
+
var mt = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
584
|
+
var ht = `$1\0$2`;
|
|
585
|
+
var gt = /[^\p{L}\d]+/giu;
|
|
586
|
+
function _t(e6) {
|
|
587
|
+
let t2 = e6.trim();
|
|
588
|
+
t2 = t2.replace(pt, ht).replace(mt, ht), t2 = t2.replace(gt, `\0`);
|
|
589
|
+
let n2 = 0, r2 = t2.length;
|
|
590
|
+
for (; t2.charAt(n2) === `\0`; ) n2++;
|
|
591
|
+
if (n2 === r2) return [];
|
|
592
|
+
for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
|
|
593
|
+
return t2.slice(n2, r2).split(/\0/g);
|
|
594
|
+
}
|
|
595
|
+
var vt = (e6) => `validationError` in (e6.response?.data?.details ?? {});
|
|
596
|
+
var yt = (e6) => `applicationError` in (e6.response?.data?.details ?? {});
|
|
597
|
+
var bt = (e6) => (e6.response?.status ?? -1) >= 400 && (e6.response?.status ?? -1) < 500;
|
|
598
|
+
function F(e6, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
|
|
599
|
+
if (typeof e6 != `object` || !e6) throw e6;
|
|
600
|
+
if (vt(e6)) return xt(e6, t2, n2);
|
|
601
|
+
if (yt(e6)) return Ct(e6);
|
|
602
|
+
if (bt(e6)) {
|
|
603
|
+
let t3 = e6.response?.status, n3 = e6.response?.statusText ?? `UNKNOWN`, r2 = e6.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: ft(n3), data: {} }, requestId: e6.requestId };
|
|
604
|
+
return St(e6, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
|
|
605
|
+
}
|
|
606
|
+
return wt(e6);
|
|
607
|
+
}
|
|
608
|
+
var xt = (e6, t2, n2) => {
|
|
609
|
+
let r2 = e6.response?.data, i2 = e6.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = Tt(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 };
|
|
610
|
+
return St(e6, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e6.response?.status, requestId: i2 } });
|
|
611
|
+
};
|
|
612
|
+
var St = (e6, { message: t2, extraProperties: n2 }) => Object.assign(e6, { ...n2, message: t2 });
|
|
613
|
+
var Ct = (e6) => {
|
|
614
|
+
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 ?? ft(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 };
|
|
615
|
+
return St(e6, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e6.requestId } });
|
|
616
|
+
};
|
|
617
|
+
var wt = (e6) => St(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: ft(e6.response?.statusText ?? `UNKNOWN`), ...!e6.response && { runtimeError: e6 } } });
|
|
618
|
+
var Tt = ({ spreadPathsToArguments: e6, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
|
|
619
|
+
let a2 = { ...e6, ...t2 }, o2 = Object.keys(a2);
|
|
620
|
+
return r2?.filter((e7) => !r2.some((t3) => t3.field.length > e7.field.length && t3.field.startsWith(e7.field) && o2.includes(t3.field))).map((e7) => {
|
|
621
|
+
let r3 = t2[e7.field];
|
|
622
|
+
if (r3) return { ...e7, field: Et(r3, i2) };
|
|
623
|
+
let s2 = o2?.sort((e8, t3) => t3.length - e8.length)?.find((t3) => e7.field.startsWith(t3));
|
|
624
|
+
if (s2) {
|
|
625
|
+
let t3 = a2[s2];
|
|
626
|
+
if (t3) return { ...e7, field: e7.field.replace(s2, Et(t3, i2)) };
|
|
627
|
+
}
|
|
628
|
+
return n2 ? { ...e7, field: `${i2[0]}.${e7.field}` } : e7;
|
|
629
|
+
});
|
|
630
|
+
};
|
|
631
|
+
var Et = (e6, t2) => {
|
|
632
|
+
let n2 = Dt(e6);
|
|
633
|
+
return n2 == null ? e6 : e6.replace(`$[${n2}]`, t2[n2]);
|
|
634
|
+
};
|
|
635
|
+
var Dt = (e6) => {
|
|
636
|
+
let t2 = e6.match(/\$\[(?<argIndex>\d+)\]/);
|
|
637
|
+
return t2 && t2.groups && Number(t2.groups.argIndex);
|
|
638
|
+
};
|
|
639
|
+
function Ot() {
|
|
640
|
+
let e6 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
641
|
+
if (e6) return { initWixModules(t3, n3) {
|
|
642
|
+
return kt(() => e6(t3, n3));
|
|
643
|
+
}, fetchWithAuth() {
|
|
644
|
+
throw Error(`fetchWithAuth is not available in this context`);
|
|
645
|
+
}, graphql() {
|
|
646
|
+
throw Error(`graphql is not available in this context`);
|
|
647
|
+
} };
|
|
648
|
+
let t2 = typeof $wixContext < `u` ? $wixContext.client : _.client === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.client : _.client, n2 = typeof $wixContext < `u` ? $wixContext.elevatedClient : _.elevatedClient === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.elevatedClient : _.elevatedClient;
|
|
649
|
+
if (t2 || n2) return { initWixModules(e7, r2) {
|
|
650
|
+
if (r2) {
|
|
651
|
+
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`);
|
|
652
|
+
return kt(() => n2.use(e7));
|
|
653
|
+
}
|
|
654
|
+
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
655
|
+
return kt(() => t2.use(e7));
|
|
656
|
+
}, fetchWithAuth: (e7, n3) => {
|
|
657
|
+
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
658
|
+
return t2.fetchWithAuth(e7, n3);
|
|
659
|
+
}, getAuth() {
|
|
660
|
+
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
661
|
+
return t2.auth;
|
|
662
|
+
}, async graphql(e7, n3, r2) {
|
|
663
|
+
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
664
|
+
return t2.graphql(e7, n3, r2);
|
|
665
|
+
} };
|
|
666
|
+
}
|
|
667
|
+
function kt(e6) {
|
|
668
|
+
let t2 = globalThis.__wix_context__, n2 = { client: _.client, elevatedClient: _.elevatedClient }, r2;
|
|
669
|
+
globalThis.__wix_context__ = void 0, _.client = void 0, _.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
670
|
+
try {
|
|
671
|
+
return e6();
|
|
672
|
+
} finally {
|
|
673
|
+
globalThis.__wix_context__ = t2, _.client = n2.client, _.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
function At(e6, t2) {
|
|
677
|
+
return (...n2) => {
|
|
678
|
+
let r2 = Ot();
|
|
679
|
+
return r2 ? r2.initWixModules(e6, t2).apply(void 0, n2) : e6.apply(void 0, n2);
|
|
680
|
+
};
|
|
681
|
+
}
|
|
682
|
+
function I(e6, t2 = false) {
|
|
683
|
+
return At(e6, t2);
|
|
684
|
+
}
|
|
685
|
+
function jt(e6, t2) {
|
|
686
|
+
let n2 = Nt(e6), r2 = Object.entries(n2).some(([e7, t3]) => e7.includes(`.`) || Array.isArray(t3) && t3.some((e8) => typeof e8 == `object`));
|
|
687
|
+
return t2 && r2 ? new URLSearchParams({ ".r": Ft(JSON.stringify(e6)) }) : Object.entries(n2).reduce((e7, [t3, n3]) => ((Array.isArray(n3) ? n3 : [n3]).forEach((r3) => {
|
|
688
|
+
r3 == null || Array.isArray(n3) && typeof r3 == `object` || e7.append(t3, r3);
|
|
689
|
+
}), e7), new URLSearchParams());
|
|
690
|
+
}
|
|
691
|
+
function Mt(e6) {
|
|
692
|
+
let t2 = Jt(Kt(e6.host), e6.domainToMappings);
|
|
693
|
+
return rn(en(e6.protoPath, e6.data || {}), t2);
|
|
694
|
+
}
|
|
695
|
+
function Nt(e6, t2 = ``) {
|
|
696
|
+
let n2 = {};
|
|
697
|
+
return Object.entries(e6).forEach(([e7, r2]) => {
|
|
698
|
+
let i2 = typeof r2 == `object` && !!r2 && !Array.isArray(r2), a2 = Pt(t2, e7);
|
|
699
|
+
if (i2) {
|
|
700
|
+
let e8 = Nt(r2, a2);
|
|
701
|
+
Object.assign(n2, e8);
|
|
702
|
+
} else n2[a2] = r2;
|
|
703
|
+
}), n2;
|
|
704
|
+
}
|
|
705
|
+
function Pt(e6, t2) {
|
|
706
|
+
return `${e6}${e6 ? `.` : ``}${t2}`;
|
|
707
|
+
}
|
|
708
|
+
var Ft = (e6) => {
|
|
709
|
+
let t2 = new TextEncoder().encode(e6);
|
|
710
|
+
return (typeof btoa < `u` ? btoa(String.fromCodePoint(...t2)) : Buffer.from(e6, `utf-8`).toString(`base64`)).replace(/=/g, ``).replace(/\+/g, `-`).replace(/\//g, `_`);
|
|
711
|
+
};
|
|
712
|
+
var It = [`wix.com`, `editorx.com`];
|
|
713
|
+
var Lt = `_`;
|
|
714
|
+
var Rt = `*.`;
|
|
715
|
+
var zt = RegExp(`\\.(${It.join(`|`)})$`);
|
|
716
|
+
var Bt = [`42.wixprod.net`, `uw2-edt-1.wixprod.net`, `virginia-edt.wixprod.net`];
|
|
717
|
+
var Vt = { "payments.base44.com": `manage.wix.com`, "create.editorx.com": `editor.editorx.com` };
|
|
718
|
+
var Ht = `dev.wix-code.com`;
|
|
719
|
+
var Ut = /{(.*)}/;
|
|
720
|
+
var Wt = RegExp(`\\.(${Bt.join(`|`)})$`);
|
|
721
|
+
var Gt = RegExp(`.*\\.${Ht}$`);
|
|
722
|
+
function Kt(e6) {
|
|
723
|
+
return qt(e6).replace(zt, `._base_domain_`).replace(Wt, `._api_base_domain_`).replace(Gt, `*.dev.wix-code.com`);
|
|
724
|
+
}
|
|
725
|
+
function qt(e6) {
|
|
726
|
+
return Vt[e6] ?? e6;
|
|
727
|
+
}
|
|
728
|
+
function Jt(e6, t2) {
|
|
729
|
+
let n2 = t2[e6];
|
|
730
|
+
if (n2) return n2;
|
|
731
|
+
let r2 = Yt(e6, t2) ?? Xt(e6, t2);
|
|
732
|
+
if (!r2) {
|
|
733
|
+
if (Qt(e6)) {
|
|
734
|
+
let e7 = t2[$t];
|
|
735
|
+
if (e7) return e7;
|
|
736
|
+
}
|
|
737
|
+
let n3 = t2[Lt];
|
|
738
|
+
if (n3) return n3;
|
|
739
|
+
}
|
|
740
|
+
return r2 ?? [];
|
|
741
|
+
}
|
|
742
|
+
function Yt(e6, t2) {
|
|
743
|
+
return Object.entries(t2).find(([t3]) => {
|
|
744
|
+
let [, ...n2] = e6.split(`.`);
|
|
745
|
+
return n2.join(`.`) === t3;
|
|
746
|
+
})?.[1];
|
|
747
|
+
}
|
|
748
|
+
function Xt(e6, t2) {
|
|
749
|
+
let [n2] = Object.entries(t2).filter(([t3]) => Zt(e6, t3)).sort(([e7], [t3]) => t3.length - e7.length);
|
|
750
|
+
if (!n2) return;
|
|
751
|
+
let [, r2] = n2;
|
|
752
|
+
return r2;
|
|
753
|
+
}
|
|
754
|
+
function Zt(e6, t2) {
|
|
755
|
+
if (!t2.startsWith(Rt)) return false;
|
|
756
|
+
let n2 = t2.slice(1);
|
|
757
|
+
return e6.length > n2.length && e6.endsWith(n2);
|
|
758
|
+
}
|
|
759
|
+
function Qt(e6) {
|
|
760
|
+
return !!e6.match(/\._base_domain_$/);
|
|
761
|
+
}
|
|
762
|
+
var $t = `www._base_domain_`;
|
|
763
|
+
function en(e6, t2) {
|
|
764
|
+
return e6.split(`/`).map((e7) => tn(e7, t2)).join(`/`);
|
|
765
|
+
}
|
|
766
|
+
function tn(e6, t2) {
|
|
767
|
+
let n2 = e6.match(Ut) || [], r2 = n2[1];
|
|
768
|
+
return r2 ? nn(t2, r2, e6, e6.replace(n2[0], ``)) : e6;
|
|
769
|
+
}
|
|
770
|
+
function nn(e6, t2, n2, r2) {
|
|
771
|
+
let i2 = e6;
|
|
772
|
+
for (let e7 of t2.split(`.`)) {
|
|
773
|
+
if (!i2) return n2;
|
|
774
|
+
i2 = i2[e7];
|
|
775
|
+
}
|
|
776
|
+
return `${i2}${r2}`;
|
|
777
|
+
}
|
|
778
|
+
function rn(e6, t2) {
|
|
779
|
+
let n2 = t2?.find((t3) => e6.startsWith(t3.destPath));
|
|
780
|
+
return n2 ? n2.srcPath + e6.slice(n2.destPath.length) : e6;
|
|
781
|
+
}
|
|
782
|
+
function an(e6) {
|
|
783
|
+
return isFinite(e6) ? e6 : e6.toString();
|
|
784
|
+
}
|
|
785
|
+
function L(e6) {
|
|
786
|
+
return e6 === `NaN` ? NaN : e6 === `Infinity` ? 1 / 0 : e6 === `-Infinity` ? -1 / 0 : e6;
|
|
787
|
+
}
|
|
788
|
+
function on(e6) {
|
|
789
|
+
return Uint8Array.from(atob(e6), (e7) => e7.charCodeAt(0));
|
|
790
|
+
}
|
|
791
|
+
var sn = `modulepreload`;
|
|
792
|
+
var cn = function(e6, t2) {
|
|
793
|
+
return new URL(e6, t2).href;
|
|
794
|
+
};
|
|
795
|
+
var ln = {};
|
|
796
|
+
var un = function(e6) {
|
|
797
|
+
return e6.pathname.endsWith(`.css`);
|
|
798
|
+
};
|
|
799
|
+
var dn = function(e6, t2, n2) {
|
|
800
|
+
if (t2 in e6) return e6[t2];
|
|
801
|
+
let r2 = n2();
|
|
802
|
+
if (!r2) {
|
|
803
|
+
e6[t2] = void 0;
|
|
804
|
+
return;
|
|
805
|
+
}
|
|
806
|
+
let i2 = r2.then(() => {
|
|
807
|
+
e6[t2] = void 0;
|
|
808
|
+
}, (n3) => {
|
|
809
|
+
throw e6[t2] = void 0, n3;
|
|
810
|
+
});
|
|
811
|
+
return e6[t2] = i2, i2;
|
|
812
|
+
};
|
|
813
|
+
var fn = function(e6, t2, n2) {
|
|
814
|
+
let r2 = Promise.resolve();
|
|
815
|
+
if (t2 && t2.length > 0) {
|
|
816
|
+
let o3 = function(e8) {
|
|
817
|
+
return Promise.all(e8.map((e9) => Promise.resolve(e9).then((e10) => ({ status: `fulfilled`, value: e10 }), (e10) => ({ status: `rejected`, reason: e10 }))));
|
|
818
|
+
}, s3 = function(e8) {
|
|
819
|
+
return import.meta.resolve ? new URL(import.meta.resolve(e8)) : new URL(e8, import.meta.url);
|
|
820
|
+
};
|
|
821
|
+
var o2 = o3, s2 = s3;
|
|
822
|
+
let e7, i3 = document.querySelector(`meta[property=csp-nonce]`), a2 = i3?.nonce || i3?.getAttribute(`nonce`);
|
|
823
|
+
r2 = o3(t2.map((t3) => {
|
|
824
|
+
t3 = cn(t3, n2);
|
|
825
|
+
let r3 = s3(t3), i4 = un(r3);
|
|
826
|
+
return dn(ln, r3.href, () => {
|
|
827
|
+
if (e7 === void 0) {
|
|
828
|
+
e7 = { all: /* @__PURE__ */ new Set(), styles: /* @__PURE__ */ new Set() };
|
|
829
|
+
let t5 = document.getElementsByTagName(`link`);
|
|
830
|
+
for (let n3 = t5.length - 1; n3 >= 0; n3--) {
|
|
831
|
+
let r4 = t5[n3];
|
|
832
|
+
e7.all.add(r4.href), r4.rel === `stylesheet` && e7.styles.add(r4.href);
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
if ((i4 ? e7.styles : e7.all).has(r3.href)) return;
|
|
836
|
+
let t4 = document.createElement(`link`);
|
|
837
|
+
if (t4.rel = i4 ? `stylesheet` : sn, i4 || (t4.as = `script`), t4.crossOrigin = ``, t4.href = r3.href, a2 && t4.setAttribute(`nonce`, a2), document.head.appendChild(t4), i4) return new Promise((e8, n3) => {
|
|
838
|
+
t4.addEventListener(`load`, e8), t4.addEventListener(`error`, () => n3(Error(`Unable to preload CSS for ${r3}`)));
|
|
839
|
+
});
|
|
840
|
+
});
|
|
841
|
+
}).filter((e8) => e8 !== void 0));
|
|
842
|
+
}
|
|
843
|
+
function i2(e7) {
|
|
844
|
+
let t3 = new Event(`vite:preloadError`, { cancelable: true });
|
|
845
|
+
if (t3.payload = e7, window.dispatchEvent(t3), !t3.defaultPrevented) throw e7;
|
|
846
|
+
}
|
|
847
|
+
return r2.then((t3) => {
|
|
848
|
+
for (let e7 of t3 || []) e7.status === `rejected` && i2(e7.reason);
|
|
849
|
+
return e6().catch(i2);
|
|
850
|
+
});
|
|
851
|
+
};
|
|
852
|
+
var pn = `x-wix-linguist`;
|
|
853
|
+
var mn = `00000000-0000-0000-0000-000000000000`;
|
|
854
|
+
var hn = `false`;
|
|
855
|
+
var gn = () => {
|
|
856
|
+
let e6 = yn(`language`), t2 = yn(`locale`);
|
|
857
|
+
if (e6) return { [pn]: [e6, t2 || e6, hn, mn].join(`|`) };
|
|
858
|
+
};
|
|
859
|
+
function _n() {
|
|
860
|
+
let e6 = null, t2 = null;
|
|
861
|
+
return { promise: new Promise((n2, r2) => {
|
|
862
|
+
e6 = n2, t2 = r2;
|
|
863
|
+
}), resolve: e6, reject: t2 };
|
|
864
|
+
}
|
|
865
|
+
var vn = () => (typeof window < `u` ? window.commonConfig : void 0) ?? globalThis.commonConfig;
|
|
866
|
+
var yn = (e6) => vn()?.[e6];
|
|
867
|
+
var bn = ({ createHost: e6 }) => ({ __type: `host`, create: (e7) => ({}), host: (t2) => {
|
|
868
|
+
let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e6(t2), o2 = Sn();
|
|
869
|
+
return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language: yn(`language`), locale: yn(`locale`), get passThroughHeaders() {
|
|
870
|
+
return gn();
|
|
871
|
+
} } };
|
|
872
|
+
}, auth: (e7) => {
|
|
873
|
+
let t2 = typeof window < `u` ? window.wixEmbedsAPI : void 0;
|
|
874
|
+
!e7 && xn() && (e7 = t2?.getAccessTokenFunction?.());
|
|
875
|
+
let n2 = false, { resolve: r2, promise: i2 } = _n();
|
|
876
|
+
return { getAuthHeaders: async () => {
|
|
877
|
+
if (!e7 && n2 && (e7 = await i2), !e7) throw Error(`Failed to resolve auth token`);
|
|
878
|
+
return { headers: { Authorization: await e7() } };
|
|
879
|
+
}, getAccessTokenInjector: () => (n2 = true, (e8) => {
|
|
880
|
+
r2(e8);
|
|
881
|
+
}) };
|
|
882
|
+
} });
|
|
883
|
+
function xn() {
|
|
884
|
+
return typeof document < `u` && document.currentScript?.tagName === `SCRIPT`;
|
|
885
|
+
}
|
|
886
|
+
function Sn() {
|
|
887
|
+
let e6 = (typeof window < `u` ? window.wixEmbedsAPI : void 0)?.getExternalBaseUrl?.();
|
|
888
|
+
if (!e6) return;
|
|
889
|
+
let t2 = new URL(e6);
|
|
890
|
+
return t2?.pathname && t2.pathname !== `/` ? `${t2.hostname}${t2.pathname}` : t2.hostname;
|
|
891
|
+
}
|
|
892
|
+
var Cn = ({ clientSdk: e6, applicationId: t2 }) => ({ invoke: async ({ namespace: n2, method: r2, args: i2 }) => {
|
|
893
|
+
if (!e6) throw Error(`Wix Site SDK only works in a Wix site environment. Learn more: https://dev.wix.com/docs/sdk/host-modules/site/introduction`);
|
|
894
|
+
return e6.invoke({ namespace: n2, method: r2, args: i2, applicationId: t2, accessToken: `accessToken` });
|
|
895
|
+
}, getAccessToken: () => {
|
|
896
|
+
throw Error(`Not implemented`);
|
|
897
|
+
}, observeState: () => ({ disconnect: () => {
|
|
898
|
+
} }) });
|
|
899
|
+
var wn = bn({ createHost: function(e6) {
|
|
900
|
+
let t2 = (typeof $wixContext < `u` ? $wixContext.clientSdk : void 0) ?? e6?.clientSdk ?? (typeof window < `u` ? window?.clientSdk : void 0), { applicationId: n2 } = e6 || {};
|
|
901
|
+
if (!n2) throw Error(`"createHost" was called without a required field "applicationId"`);
|
|
902
|
+
return { channel: Cn({ clientSdk: t2, applicationId: n2 }), close: () => {
|
|
903
|
+
} };
|
|
904
|
+
} });
|
|
905
|
+
var Tn = (e6, t2) => {
|
|
906
|
+
let n2 = wn.host({ applicationId: e6, componentId: t2 }), r2 = wn.auth();
|
|
907
|
+
return He({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
|
|
908
|
+
};
|
|
909
|
+
var En = (e6) => Tn(`14bcded7-0066-7c35-14d7-466cb3f09103`, e6);
|
|
910
|
+
function Dn() {
|
|
911
|
+
let e6 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
912
|
+
if (e6) return { initWixModules(t3, n3) {
|
|
913
|
+
return On(() => e6(t3, n3));
|
|
914
|
+
}, fetchWithAuth() {
|
|
915
|
+
throw Error(`fetchWithAuth is not available in this context`);
|
|
916
|
+
}, graphql() {
|
|
917
|
+
throw Error(`graphql is not available in this context`);
|
|
918
|
+
} };
|
|
919
|
+
let t2 = typeof $wixContext < `u` ? $wixContext.client : _.client === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.client : _.client, n2 = typeof $wixContext < `u` ? $wixContext.elevatedClient : _.elevatedClient === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.elevatedClient : _.elevatedClient;
|
|
920
|
+
if (t2 || n2) return { initWixModules(e7, r2) {
|
|
921
|
+
if (r2) {
|
|
922
|
+
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`);
|
|
923
|
+
return On(() => n2.use(e7));
|
|
924
|
+
}
|
|
925
|
+
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
926
|
+
return On(() => t2.use(e7));
|
|
927
|
+
}, fetchWithAuth: (e7, n3) => {
|
|
928
|
+
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
929
|
+
return t2.fetchWithAuth(e7, n3);
|
|
930
|
+
}, getAuth() {
|
|
931
|
+
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
932
|
+
return t2.auth;
|
|
933
|
+
}, async graphql(e7, n3, r2) {
|
|
934
|
+
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
935
|
+
return t2.graphql(e7, n3, r2);
|
|
936
|
+
} };
|
|
937
|
+
}
|
|
938
|
+
function On(e6) {
|
|
939
|
+
let t2 = globalThis.__wix_context__, n2 = { client: _.client, elevatedClient: _.elevatedClient }, r2;
|
|
940
|
+
globalThis.__wix_context__ = void 0, _.client = void 0, _.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
941
|
+
try {
|
|
942
|
+
return e6();
|
|
943
|
+
} finally {
|
|
944
|
+
globalThis.__wix_context__ = t2, _.client = n2.client, _.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
function kn(e6, t2) {
|
|
948
|
+
return { ...e6, ...Object.fromEntries(t2.map((t3) => [t3, (...n2) => {
|
|
949
|
+
let r2 = Dn();
|
|
950
|
+
if (!r2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
951
|
+
return r2.initWixModules(e6)[t3].apply(void 0, n2);
|
|
952
|
+
}])) };
|
|
953
|
+
}
|
|
954
|
+
function An(e6) {
|
|
955
|
+
return kn({ __type: `host`, create: (t2) => Object.entries(e6).reduce((e7, [n2, r2]) => ({ ...e7, [n2]: r2(t2) }), {}) }, Object.keys(e6));
|
|
956
|
+
}
|
|
957
|
+
var jn = class {
|
|
958
|
+
constructor(e6) {
|
|
959
|
+
this.message = e6, this.captureException = () => {
|
|
960
|
+
console.error(this.message);
|
|
961
|
+
}, this.captureMessage = () => {
|
|
962
|
+
console.error(this.message);
|
|
963
|
+
}, this.startSpan = (e7, t2) => (console.error(this.message), t2(void 0)), this.startSpanManual = () => (console.error(this.message), { end: () => {
|
|
964
|
+
}, fail: () => {
|
|
965
|
+
} }), this.endSpanManual = () => {
|
|
966
|
+
console.error(this.message);
|
|
967
|
+
}, this.addBreadcrumb = () => {
|
|
968
|
+
console.error(this.message);
|
|
969
|
+
};
|
|
970
|
+
}
|
|
971
|
+
};
|
|
972
|
+
var Mn = (e6) => new jn(e6);
|
|
973
|
+
var Nn = An({ getMonitoringClient: (e6) => () => e6.getMonitoringClient ? e6.getMonitoringClient() : Mn(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`) });
|
|
974
|
+
function Pn(e6) {
|
|
975
|
+
let t2 = Promise.resolve(e6);
|
|
976
|
+
return t2.status = `fulfilled`, t2.value = e6, t2;
|
|
977
|
+
}
|
|
978
|
+
function Fn(e6) {
|
|
979
|
+
if (e6.status === `fulfilled`) return e6.value;
|
|
980
|
+
throw e6.status === `rejected` ? e6.reason : (e6.status === `pending` || (e6.status = `pending`, e6.then((t2) => {
|
|
981
|
+
e6.status = `fulfilled`, e6.value = t2;
|
|
982
|
+
}, (t2) => {
|
|
983
|
+
e6.status = `rejected`, e6.reason = t2;
|
|
984
|
+
})), e6);
|
|
985
|
+
}
|
|
986
|
+
var In = /* @__PURE__ */ new WeakMap();
|
|
987
|
+
function Ln(e6, t2, n2) {
|
|
988
|
+
let r2 = In.get(e6);
|
|
989
|
+
r2 || (r2 = /* @__PURE__ */ new WeakMap(), In.set(e6, r2));
|
|
990
|
+
let i2 = r2.get(t2);
|
|
991
|
+
i2 || (i2 = /* @__PURE__ */ new WeakMap(), r2.set(t2, i2));
|
|
992
|
+
let a2 = i2.get(n2);
|
|
993
|
+
if (!a2) {
|
|
994
|
+
if (e6.status === `fulfilled`) a2 = Pn(t2(e6.value));
|
|
995
|
+
else if (e6.status === `rejected`) try {
|
|
996
|
+
a2 = Pn(n2(e6.reason));
|
|
997
|
+
} catch {
|
|
998
|
+
a2 = e6.then(t2, n2);
|
|
999
|
+
}
|
|
1000
|
+
else a2 = e6.then(t2, n2);
|
|
1001
|
+
i2.set(n2, a2);
|
|
1002
|
+
}
|
|
1003
|
+
return a2;
|
|
1004
|
+
}
|
|
1005
|
+
function R(e6) {
|
|
1006
|
+
return e6;
|
|
1007
|
+
}
|
|
1008
|
+
var Rn = R(`@wix/site-service-url`);
|
|
1009
|
+
var zn = `post`;
|
|
1010
|
+
var z = { kind: `all` };
|
|
1011
|
+
var Bn = (e6) => {
|
|
1012
|
+
let t2 = e6.split(`/`).filter(Boolean);
|
|
1013
|
+
if (t2.length < 2) return z;
|
|
1014
|
+
let [n2, r2] = t2.slice(-2), i2;
|
|
1015
|
+
try {
|
|
1016
|
+
i2 = decodeURIComponent(r2);
|
|
1017
|
+
} catch {
|
|
1018
|
+
i2 = r2;
|
|
1019
|
+
}
|
|
1020
|
+
return i2 ? n2 === `category` ? { kind: `category`, slug: i2 } : n2 === `tag` ? { kind: `tag`, slug: i2 } : z : z;
|
|
1021
|
+
};
|
|
1022
|
+
var Vn = (e6, t2) => e6 ? { kind: `category`, slug: e6 } : t2 ? { kind: `tag`, slug: t2 } : z;
|
|
1023
|
+
var Hn = (e6) => {
|
|
1024
|
+
if (!e6) return z;
|
|
1025
|
+
try {
|
|
1026
|
+
return Bn(new URL(e6).pathname);
|
|
1027
|
+
} catch {
|
|
1028
|
+
return z;
|
|
1029
|
+
}
|
|
1030
|
+
};
|
|
1031
|
+
var Un = { kind: `all` };
|
|
1032
|
+
var Wn = () => {
|
|
1033
|
+
let e6, t2 = false;
|
|
1034
|
+
try {
|
|
1035
|
+
e6 = f(Rn).currentUrl;
|
|
1036
|
+
} catch {
|
|
1037
|
+
t2 = true;
|
|
1038
|
+
}
|
|
1039
|
+
let n2 = c(() => Hn(e6), [e6]);
|
|
1040
|
+
return t2 ? Un : n2;
|
|
1041
|
+
};
|
|
1042
|
+
var Gn = R(`seo/seo-service`);
|
|
1043
|
+
var Kn = R(`@wix/site-service-rendering-context`);
|
|
1044
|
+
var qn = R(`@wix/viewer-service-multilingual`);
|
|
1045
|
+
var Jn = `https://static.wixstatic.com/media/`;
|
|
1046
|
+
var Yn = `wix:image://`;
|
|
1047
|
+
var Xn = 1200;
|
|
1048
|
+
var Zn = 800;
|
|
1049
|
+
var Qn = (e6) => {
|
|
1050
|
+
if (!e6) return;
|
|
1051
|
+
let t2 = Number.parseInt(e6, 10);
|
|
1052
|
+
return Number.isFinite(t2) && t2 > 0 ? t2 : void 0;
|
|
1053
|
+
};
|
|
1054
|
+
var $n = (e6) => {
|
|
1055
|
+
if (!e6.startsWith(Yn)) {
|
|
1056
|
+
let t3 = e6.split(/[?#]/)[0];
|
|
1057
|
+
return t3 ? { uri: t3 } : void 0;
|
|
1058
|
+
}
|
|
1059
|
+
let [t2, n2] = e6.slice(12).split(`#`), [, r2, i2] = t2.split(`/`).filter(Boolean);
|
|
1060
|
+
if (!r2) return;
|
|
1061
|
+
let a2 = new URLSearchParams(n2 ?? ``);
|
|
1062
|
+
return { uri: decodeURIComponent(r2), name: i2 ? decodeURIComponent(i2) : void 0, width: Qn(a2.get(`originWidth`)), height: Qn(a2.get(`originHeight`)) };
|
|
1063
|
+
};
|
|
1064
|
+
var er = (e6, t2) => {
|
|
1065
|
+
if (!e6) return;
|
|
1066
|
+
let n2 = $n(e6);
|
|
1067
|
+
if (!n2) return;
|
|
1068
|
+
let r2 = n2.name ?? n2.uri;
|
|
1069
|
+
return { uri: n2.uri, url: `${Jn}${n2.uri}`, name: r2, width: n2.width ?? Xn, height: n2.height ?? Zn, alt: t2 ?? r2 };
|
|
1070
|
+
};
|
|
1071
|
+
var tr = (e6) => {
|
|
1072
|
+
let t2 = e6?.media?.wixMedia?.image;
|
|
1073
|
+
if (!t2) return;
|
|
1074
|
+
let n2 = $n(t2);
|
|
1075
|
+
if (!n2) return;
|
|
1076
|
+
let r2 = n2.name ?? n2.uri;
|
|
1077
|
+
return { uri: n2.uri, url: `${Jn}${n2.uri}`, name: r2, width: n2.width ?? Xn, height: n2.height ?? Zn, alt: e6?.media?.altText ?? e6?.title ?? r2 };
|
|
1078
|
+
};
|
|
1079
|
+
var nr = `14bcded7-0066-7c35-14d7-466cb3f09103`;
|
|
1080
|
+
var rr = `builder-post`;
|
|
1081
|
+
var ir = `__blog_unknown_section__`;
|
|
1082
|
+
var ar = (e6) => {
|
|
1083
|
+
let t2;
|
|
1084
|
+
try {
|
|
1085
|
+
let n3 = e6.appSectionRelativeUrl(nr, rr);
|
|
1086
|
+
if (n3 === e6.appSectionRelativeUrl(`14bcded7-0066-7c35-14d7-466cb3f09103`, ir) && !n3?.endsWith(`/post-page`)) return;
|
|
1087
|
+
t2 = e6.appSectionRelativeUrl(nr, rr, true);
|
|
1088
|
+
} catch {
|
|
1089
|
+
return;
|
|
1090
|
+
}
|
|
1091
|
+
if (!t2) return;
|
|
1092
|
+
let n2 = t2.split(`/`).filter(Boolean);
|
|
1093
|
+
return n2[n2.length - 1] === `post-page` && n2.pop(), n2.length > 0 ? n2.join(`/`) : void 0;
|
|
1094
|
+
};
|
|
1095
|
+
var or = (e6) => `${e6}/${zn}`;
|
|
1096
|
+
var sr = (e6) => {
|
|
1097
|
+
let t2 = ar(e6);
|
|
1098
|
+
if (t2 && e6.siteUrl) return `${e6.siteUrl.replace(/\/+$/, ``)}/${or(t2)}`;
|
|
1099
|
+
};
|
|
1100
|
+
var cr = (e6, t2) => {
|
|
1101
|
+
if (!e6 || !t2) return;
|
|
1102
|
+
let n2;
|
|
1103
|
+
try {
|
|
1104
|
+
n2 = new URL(e6);
|
|
1105
|
+
} catch {
|
|
1106
|
+
return;
|
|
1107
|
+
}
|
|
1108
|
+
let r2 = n2.pathname.replace(/\/+$/, ``);
|
|
1109
|
+
for (let e7 of [t2, encodeURIComponent(t2)]) {
|
|
1110
|
+
let t3 = `/${e7}`, i2 = r2.slice(0, -t3.length);
|
|
1111
|
+
if (r2.endsWith(t3) && i2.endsWith(`/post`)) return `${n2.origin}${i2}`;
|
|
1112
|
+
}
|
|
1113
|
+
};
|
|
1114
|
+
var lr = (e6) => {
|
|
1115
|
+
if (!e6) return;
|
|
1116
|
+
if (typeof e6 == `string`) return e6;
|
|
1117
|
+
let { base: t2, path: n2 } = e6;
|
|
1118
|
+
return t2 ? `${t2.replace(/\/+$/, ``)}${n2 ?? ``}` : void 0;
|
|
1119
|
+
};
|
|
1120
|
+
var ur = (e6, t2) => {
|
|
1121
|
+
let n2 = lr(e6.url), r2 = `/${zn}`;
|
|
1122
|
+
if (!n2 || !t2?.endsWith(r2)) return;
|
|
1123
|
+
let i2, a2;
|
|
1124
|
+
try {
|
|
1125
|
+
i2 = new URL(n2).pathname, a2 = new URL(t2).pathname;
|
|
1126
|
+
} catch {
|
|
1127
|
+
return;
|
|
1128
|
+
}
|
|
1129
|
+
let o2 = a2.slice(0, -r2.length);
|
|
1130
|
+
return o2 && i2.startsWith(`${o2}/`) && !i2.startsWith(`${a2}/`) ? n2 : void 0;
|
|
1131
|
+
};
|
|
1132
|
+
var dr = (e6, t2) => {
|
|
1133
|
+
let n2 = ur(e6, t2);
|
|
1134
|
+
if (n2) return { href: n2, target: `_self` };
|
|
1135
|
+
if (t2 && e6.slug) return { href: `${t2}/${encodeURIComponent(e6.slug)}`, target: `_self` };
|
|
1136
|
+
let r2 = lr(e6.url);
|
|
1137
|
+
return r2 ? { href: r2, target: `_self` } : void 0;
|
|
1138
|
+
};
|
|
1139
|
+
var fr = `https://static.wixstatic.com/media/`;
|
|
1140
|
+
var pr = 100;
|
|
1141
|
+
var mr = (e6, t2 = ``) => {
|
|
1142
|
+
let n2 = e6?.profile?.photo;
|
|
1143
|
+
if (!n2?.url) return;
|
|
1144
|
+
let r2 = e6?.profile?.nickname, { _id: i2 } = n2, a2 = i2 || (n2.url.startsWith(fr) ? n2.url.slice(35).split(/[?#]/)[0] : void 0);
|
|
1145
|
+
return { ...a2 && { uri: a2 }, url: n2.url, name: r2 ?? a2 ?? `author-photo`, width: n2.width || pr, height: n2.height || pr, alt: r2 ?? t2 };
|
|
1146
|
+
};
|
|
1147
|
+
var hr = (e6, t2 = []) => (e6.translations ?? []).flatMap(({ language: e7, url: n2 }) => !e7 || !n2 ? [] : [{ url: n2, langCode: (t2.find(({ id: t3 }) => t3 === e7) ?? t2.find(({ languageCode: t3 }) => t3 === e7))?.regionalFormat || e7 }]);
|
|
1148
|
+
var gr = (e6, t2) => {
|
|
1149
|
+
try {
|
|
1150
|
+
let n2 = new URL(t2 ?? ``).searchParams.get(`lang`);
|
|
1151
|
+
if (!n2) return e6;
|
|
1152
|
+
let r2 = new URL(e6);
|
|
1153
|
+
return r2.searchParams.set(`lang`, n2), r2.toString();
|
|
1154
|
+
} catch {
|
|
1155
|
+
return e6;
|
|
1156
|
+
}
|
|
1157
|
+
};
|
|
1158
|
+
var _r = { totalPages: 1, currentPage: 1 };
|
|
1159
|
+
var vr = (e6) => {
|
|
1160
|
+
if (e6) try {
|
|
1161
|
+
let t2 = new URL(e6);
|
|
1162
|
+
return gr(`${t2.origin}${t2.pathname.replace(/\/+$/, ``)}`, e6);
|
|
1163
|
+
} catch {
|
|
1164
|
+
return;
|
|
1165
|
+
}
|
|
1166
|
+
};
|
|
1167
|
+
var yr = (e6, t2, n2, r2) => {
|
|
1168
|
+
let i2 = e6.label ?? ``, a2 = er(e6.coverImage, i2);
|
|
1169
|
+
return { category: { ...e6._id && { id: e6._id }, title: e6.title || i2, label: i2, description: e6.description ?? ``, canonicalUrl: t2, items: { numberOfItems: e6.postCount ?? n2.length }, pagination: _r, ...a2?.width && a2.height && { mainImage: { url: a2.url, width: a2.width, height: a2.height, hasImage: true } }, ...e6.language && { language: e6.language }, translatedPages: hr(e6, r2) } };
|
|
1170
|
+
};
|
|
1171
|
+
var br = (e6) => {
|
|
1172
|
+
if (!e6) return;
|
|
1173
|
+
let t2 = new Date(e6);
|
|
1174
|
+
return Number.isNaN(t2.getTime()) ? void 0 : t2.toISOString();
|
|
1175
|
+
};
|
|
1176
|
+
var xr = (e6, t2, n2, r2) => {
|
|
1177
|
+
let i2 = e6.label ?? ``;
|
|
1178
|
+
return { tag: { name: i2, title: i2, fullUrl: t2, listItems: n2.flatMap((e7) => {
|
|
1179
|
+
let t3 = dr(e7, r2)?.href;
|
|
1180
|
+
return t3 ? [`${t3.replace(/\/+$/, ``)}/`] : [];
|
|
1181
|
+
}), items: { numberOfItems: n2.length }, created: br(e6._createdDate), postCount: e6.publishedPostCount ?? e6.postCount, ...e6.slug && { slug: e6.slug }, ...e6.language && { language: e6.language }, pagination: _r } };
|
|
1182
|
+
};
|
|
1183
|
+
var Sr = { post: `post`, feed: `feed`, relatedPosts: `related-posts`, comments: `comments`, seo: `seo`, likes: `likes` };
|
|
1184
|
+
var Cr = (e6) => {
|
|
1185
|
+
try {
|
|
1186
|
+
return e6.getMonitoringClient?.() ?? null;
|
|
1187
|
+
} catch {
|
|
1188
|
+
return null;
|
|
1189
|
+
}
|
|
1190
|
+
};
|
|
1191
|
+
var wr = (e6, t2) => e6 && typeof e6[t2] == `function` ? e6 : null;
|
|
1192
|
+
function Tr(e6, t2, { feature: n2, action: r2, level: i2 = `error`, contexts: a2 }) {
|
|
1193
|
+
let o2 = wr(e6, `captureException`);
|
|
1194
|
+
if (!o2) return;
|
|
1195
|
+
let s2 = t2 instanceof Error ? t2 : Error(String(t2));
|
|
1196
|
+
o2.captureException(s2, { level: i2, tags: { feature: n2, action: r2 }, ...a2 ? { contexts: a2 } : {} });
|
|
1197
|
+
}
|
|
1198
|
+
function Er(e6, t2, { feature: n2, tags: r2 }, i2) {
|
|
1199
|
+
let a2 = wr(e6, `startSpanManual`);
|
|
1200
|
+
if (!a2) return i2;
|
|
1201
|
+
let o2 = a2.startSpanManual({ name: t2, tags: { feature: n2, ...r2 } });
|
|
1202
|
+
return i2.then(() => o2.end(), (e7) => o2.fail(e7 instanceof Error ? e7 : Error(String(e7)))), i2;
|
|
1203
|
+
}
|
|
1204
|
+
var Dr = /* @__PURE__ */ new WeakSet();
|
|
1205
|
+
var Or = (e6, t2, n2, r2) => {
|
|
1206
|
+
let i2;
|
|
1207
|
+
try {
|
|
1208
|
+
i2 = { seo: f(Gn), url: f(Rn), renderingContext: f(Kn) };
|
|
1209
|
+
} catch {
|
|
1210
|
+
return;
|
|
1211
|
+
}
|
|
1212
|
+
let a2;
|
|
1213
|
+
try {
|
|
1214
|
+
a2 = f(qn).locales;
|
|
1215
|
+
} catch {
|
|
1216
|
+
}
|
|
1217
|
+
if (Dr.has(t2) || e6.kind === `all` || !i2.renderingContext.SSR) return;
|
|
1218
|
+
let o2 = vr(i2.url.currentUrl);
|
|
1219
|
+
o2 && (e6.kind === `category` && t2.filterCategory ? (Dr.add(t2), i2.seo.setSeoEntity({ itemType: `BLOG_CATEGORY`, itemData: yr(t2.filterCategory, o2, t2.posts, a2), seoData: t2.filterCategory.seoData }).catch((t3) => {
|
|
1220
|
+
Tr(r2, t3, { feature: Sr.seo, action: `set-category-seo-entity`, contexts: { seo: { slug: e6.kind === `category` ? e6.slug : void 0 } } });
|
|
1221
|
+
})) : e6.kind === `tag` && t2.filterTag && (Dr.add(t2), i2.seo.setSeoEntity({ itemType: `BLOG_TAGS`, itemData: xr(t2.filterTag, o2, t2.posts, n2), asNewPage: true }).catch((t3) => {
|
|
1222
|
+
Tr(r2, t3, { feature: Sr.seo, action: `set-tag-seo-entity`, contexts: { seo: { slug: e6.kind === `tag` ? e6.slug : void 0 } } });
|
|
1223
|
+
})));
|
|
1224
|
+
};
|
|
1225
|
+
var kr = 1e4;
|
|
1226
|
+
function Ar(e6) {
|
|
1227
|
+
let [t2, n2] = u(void 0);
|
|
1228
|
+
return s(() => {
|
|
1229
|
+
let t3 = Date.now();
|
|
1230
|
+
t3 - e6 > kr && i(() => n2(t3));
|
|
1231
|
+
}, []), t2 ?? e6;
|
|
1232
|
+
}
|
|
1233
|
+
var jr = () => {
|
|
1234
|
+
try {
|
|
1235
|
+
return f(Kn).SSR;
|
|
1236
|
+
} catch {
|
|
1237
|
+
return false;
|
|
1238
|
+
}
|
|
1239
|
+
};
|
|
1240
|
+
var Mr = (e6, t2) => e6.length === t2.length && e6.every((e7, n2) => Object.is(e7, t2[n2]));
|
|
1241
|
+
function Nr(e6, t2) {
|
|
1242
|
+
let [n2, r2] = u(() => ({ deps: t2, value: e6() }));
|
|
1243
|
+
return s(() => {
|
|
1244
|
+
if (Mr(n2.deps, t2)) return;
|
|
1245
|
+
let a2 = e6();
|
|
1246
|
+
i(() => r2({ deps: t2, value: a2 }));
|
|
1247
|
+
}, t2), n2.value;
|
|
1248
|
+
}
|
|
1249
|
+
var Pr = (e6) => {
|
|
1250
|
+
let t2;
|
|
1251
|
+
try {
|
|
1252
|
+
t2 = f(Rn);
|
|
1253
|
+
} catch {
|
|
1254
|
+
return;
|
|
1255
|
+
}
|
|
1256
|
+
return sr(t2) ?? cr(t2.currentUrl, e6);
|
|
1257
|
+
};
|
|
1258
|
+
var Fr = { categoryHeader: `WixBlog.CategoryHeader`, coverMedia: `WixBlog.PostCoverMedia`, postActions: `WixBlog.PostActionBar`, postCategories: `WixBlog.PostCategoryList`, postCounters: `WixBlog.PostCounterBar`, postMetadata: `WixBlog.PostMetadataBar`, postTags: `WixBlog.PostTagList`, feedProvider: `WixBlog.BlogFeedContextProvider`, postProvider: `WixBlog.PostContextProvider`, postByIdProvider: `WixBlog.PostByIdContextProvider`, relatedPostsProvider: `WixBlog.RelatedPostsContextProvider` };
|
|
1259
|
+
var Ir = (e6) => `${e6} rendered`;
|
|
1260
|
+
var Lr = (e6, t2, n2) => {
|
|
1261
|
+
s(() => {
|
|
1262
|
+
if (t2 !== `loading` && typeof performance < `u` && typeof performance.mark == `function`) try {
|
|
1263
|
+
performance.mark(Ir(e6), { detail: { state: t2, compId: n2 } });
|
|
1264
|
+
} catch {
|
|
1265
|
+
}
|
|
1266
|
+
}, [e6, t2, n2]);
|
|
1267
|
+
};
|
|
1268
|
+
var Rr = R(`@wix/site-service-locale`);
|
|
1269
|
+
var zr = R(`@wix/site-service-renderer-configuration`);
|
|
1270
|
+
var Br = () => {
|
|
1271
|
+
let e6, t2;
|
|
1272
|
+
try {
|
|
1273
|
+
e6 = f(zr).languageCode;
|
|
1274
|
+
} catch {
|
|
1275
|
+
}
|
|
1276
|
+
try {
|
|
1277
|
+
t2 = f(Rr).language;
|
|
1278
|
+
} catch {
|
|
1279
|
+
}
|
|
1280
|
+
return e6 || t2;
|
|
1281
|
+
};
|
|
1282
|
+
var Vr = () => {
|
|
1283
|
+
try {
|
|
1284
|
+
let { locale: e6, language: t2 } = f(Rr);
|
|
1285
|
+
return e6 || t2;
|
|
1286
|
+
} catch {
|
|
1287
|
+
return;
|
|
1288
|
+
}
|
|
1289
|
+
};
|
|
1290
|
+
var Hr = R(`@wix/site-service-editor-context`);
|
|
1291
|
+
var Ur = () => {
|
|
1292
|
+
try {
|
|
1293
|
+
return !!f(Hr).previewMode;
|
|
1294
|
+
} catch {
|
|
1295
|
+
return false;
|
|
1296
|
+
}
|
|
1297
|
+
};
|
|
1298
|
+
var Wr = n({ isEditor: false, isPreview: false });
|
|
1299
|
+
var Gr = () => o(Wr);
|
|
1300
|
+
var Kr = ({ isEditor: e6, isPreview: t2 }) => e6 && !t2;
|
|
1301
|
+
var qr = () => {
|
|
1302
|
+
try {
|
|
1303
|
+
let { SSR: e6, SEO: t2 } = f(Kn);
|
|
1304
|
+
return e6 || t2;
|
|
1305
|
+
} catch {
|
|
1306
|
+
return false;
|
|
1307
|
+
}
|
|
1308
|
+
};
|
|
1309
|
+
var Jr = () => {
|
|
1310
|
+
let e6 = qr();
|
|
1311
|
+
return Kr(Gr()) && !e6;
|
|
1312
|
+
};
|
|
1313
|
+
function Yr(e6) {
|
|
1314
|
+
return Object.keys(e6).length === 1 && `$and` in e6 && Array.isArray(e6.$and);
|
|
1315
|
+
}
|
|
1316
|
+
function Xr(e6) {
|
|
1317
|
+
return Object.keys(e6).length === 1 && `$or` in e6 && Array.isArray(e6.$or);
|
|
1318
|
+
}
|
|
1319
|
+
function Zr(e6) {
|
|
1320
|
+
return Object.keys(e6).length === 1 && `$not` in e6 && typeof e6.$not == `object`;
|
|
1321
|
+
}
|
|
1322
|
+
function B(e6, t2) {
|
|
1323
|
+
return e6 === void 0 || Object.keys(e6).length === 0 ? t2 : t2 === void 0 || Object.keys(t2).length === 0 ? e6 : { $and: [...Yr(e6) ? e6.$and : [e6], ...Yr(t2) ? t2.$and : [t2]] };
|
|
1324
|
+
}
|
|
1325
|
+
function Qr(e6, t2) {
|
|
1326
|
+
return e6 === void 0 || Object.keys(e6).length === 0 ? t2 : t2 === void 0 || Object.keys(t2).length === 0 ? e6 : { $or: [...Xr(e6) ? e6.$or : [e6], ...Xr(t2) ? t2.$or : [t2]] };
|
|
1327
|
+
}
|
|
1328
|
+
function $r(e6) {
|
|
1329
|
+
if (e6 !== void 0 && Object.keys(e6).length !== 0) return Zr(e6) ? e6.$not : { $not: e6 };
|
|
1330
|
+
}
|
|
1331
|
+
var ei = class {
|
|
1332
|
+
_items;
|
|
1333
|
+
_fetchNextPage;
|
|
1334
|
+
_fetchPrevPage;
|
|
1335
|
+
_originQuery;
|
|
1336
|
+
_limit;
|
|
1337
|
+
constructor({ items: e6, originQuery: t2, fetchNextPage: n2, fetchPrevPage: r2, limit: i2 }) {
|
|
1338
|
+
this._items = e6, this._fetchNextPage = n2, this._fetchPrevPage = r2, this._originQuery = t2, this._limit = i2;
|
|
1339
|
+
}
|
|
1340
|
+
get items() {
|
|
1341
|
+
return this._items;
|
|
1342
|
+
}
|
|
1343
|
+
get length() {
|
|
1344
|
+
return this._items.length;
|
|
1345
|
+
}
|
|
1346
|
+
get pageSize() {
|
|
1347
|
+
return this._limit;
|
|
1348
|
+
}
|
|
1349
|
+
get query() {
|
|
1350
|
+
return this._originQuery;
|
|
1351
|
+
}
|
|
1352
|
+
async next() {
|
|
1353
|
+
if (!this.hasNext()) throw Error(`No next page to fetch`);
|
|
1354
|
+
return await this._fetchNextPage();
|
|
1355
|
+
}
|
|
1356
|
+
async prev() {
|
|
1357
|
+
if (!this.hasPrev()) throw Error(`No previous page to fetch`);
|
|
1358
|
+
return await this._fetchPrevPage();
|
|
1359
|
+
}
|
|
1360
|
+
};
|
|
1361
|
+
var ti = class extends ei {
|
|
1362
|
+
_nextCursor;
|
|
1363
|
+
_prevCursor;
|
|
1364
|
+
cursors;
|
|
1365
|
+
constructor({ items: e6, originQuery: t2, fetchNextPage: n2, fetchPrevPage: r2, limit: i2, nextCursor: a2, prevCursor: o2 }) {
|
|
1366
|
+
super({ items: e6, originQuery: t2, fetchNextPage: n2, fetchPrevPage: r2, limit: i2 }), this._nextCursor = a2, this._prevCursor = o2, this.cursors = { next: a2, prev: o2 };
|
|
1367
|
+
}
|
|
1368
|
+
hasNext() {
|
|
1369
|
+
return !!this._nextCursor;
|
|
1370
|
+
}
|
|
1371
|
+
hasPrev() {
|
|
1372
|
+
return !!this._prevCursor;
|
|
1373
|
+
}
|
|
1374
|
+
};
|
|
1375
|
+
var ni = class extends ei {
|
|
1376
|
+
_totalCount;
|
|
1377
|
+
_offset;
|
|
1378
|
+
_tooManyToCount;
|
|
1379
|
+
constructor({ items: e6, fetchNextPage: t2, fetchPrevPage: n2, offset: r2, originQuery: i2, limit: a2, totalCount: o2, tooManyToCount: s2 }) {
|
|
1380
|
+
super({ items: e6, fetchNextPage: t2, fetchPrevPage: n2, originQuery: i2, limit: a2 }), this._totalCount = o2, this._offset = r2, this._tooManyToCount = s2;
|
|
1381
|
+
}
|
|
1382
|
+
get currentPage() {
|
|
1383
|
+
return this._limit === 0 ? void 0 : Math.floor(this._offset / this._limit);
|
|
1384
|
+
}
|
|
1385
|
+
get totalPages() {
|
|
1386
|
+
return this._tooManyToCount || this._limit === 0 ? void 0 : Math.ceil(this._totalCount / this._limit);
|
|
1387
|
+
}
|
|
1388
|
+
get totalCount() {
|
|
1389
|
+
return this._tooManyToCount ? void 0 : this._totalCount;
|
|
1390
|
+
}
|
|
1391
|
+
hasNext() {
|
|
1392
|
+
return this._limit !== 0 && this.currentPage !== void 0 && this.totalPages !== void 0 && this.currentPage < this.totalPages - 1;
|
|
1393
|
+
}
|
|
1394
|
+
hasPrev() {
|
|
1395
|
+
return !!(this._limit !== 0 && this.currentPage && this.currentPage > 0);
|
|
1396
|
+
}
|
|
1397
|
+
};
|
|
1398
|
+
function ri(e6) {
|
|
1399
|
+
let t2 = (n2) => ({ query: n2, async find() {
|
|
1400
|
+
try {
|
|
1401
|
+
let r2 = e6.requestTransformer(e6.pagingMethod === `CURSOR` && n2.cursorPaging.cursor ? { cursorPaging: n2.cursorPaging } : n2), i2 = await e6.func(r2), { [Ke]: a2, [qe]: o2 } = e6.responseTransformer(i2);
|
|
1402
|
+
if (e6.pagingMethod === `OFFSET`) {
|
|
1403
|
+
let e7 = n2;
|
|
1404
|
+
return new ni({ 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 });
|
|
1405
|
+
}
|
|
1406
|
+
let s2 = n2.cursorPaging;
|
|
1407
|
+
return new ti({ items: a2 ?? [], limit: s2.limit, originQuery: this, fetchNextPage: () => t2({ ...n2, cursorPaging: { cursor: o2?.cursors?.next ?? void 0, limit: s2.limit } }).find(), fetchPrevPage: () => t2({ ...n2, cursorPaging: { cursor: o2?.cursors?.prev ?? void 0, limit: s2.limit } }).find(), prevCursor: o2?.cursors?.prev ?? void 0, nextCursor: o2?.cursors?.next ?? void 0 });
|
|
1408
|
+
} catch (t3) {
|
|
1409
|
+
throw e6.errorTransformer(t3);
|
|
1410
|
+
}
|
|
1411
|
+
}, skipTo(e7) {
|
|
1412
|
+
return t2({ ...n2, cursorPaging: { cursor: e7, limit: n2.cursorPaging.limit } });
|
|
1413
|
+
}, eq(r2, i2) {
|
|
1414
|
+
let a2 = i2 === void 0 ? null : i2, o2 = { [V(e6.transformationPaths, r2)]: a2 };
|
|
1415
|
+
return t2({ ...n2, filter: B(n2.filter, o2) });
|
|
1416
|
+
}, ne(r2, i2) {
|
|
1417
|
+
let a2 = i2 === void 0 ? null : i2, o2 = { [V(e6.transformationPaths, r2)]: { $ne: a2 } };
|
|
1418
|
+
return t2({ ...n2, filter: B(n2.filter, o2) });
|
|
1419
|
+
}, ge(r2, i2) {
|
|
1420
|
+
let a2 = { [V(e6.transformationPaths, r2)]: { $gte: i2 } };
|
|
1421
|
+
return t2({ ...n2, filter: B(n2.filter, a2) });
|
|
1422
|
+
}, gt(r2, i2) {
|
|
1423
|
+
let a2 = { [V(e6.transformationPaths, r2)]: { $gt: i2 } };
|
|
1424
|
+
return t2({ ...n2, filter: B(n2.filter, a2) });
|
|
1425
|
+
}, le(r2, i2) {
|
|
1426
|
+
let a2 = { [V(e6.transformationPaths, r2)]: { $lte: i2 } };
|
|
1427
|
+
return t2({ ...n2, filter: B(n2.filter, a2) });
|
|
1428
|
+
}, lt(r2, i2) {
|
|
1429
|
+
let a2 = { [V(e6.transformationPaths, r2)]: { $lt: i2 } };
|
|
1430
|
+
return t2({ ...n2, filter: B(n2.filter, a2) });
|
|
1431
|
+
}, isNotEmpty(e7) {
|
|
1432
|
+
return this.ne(e7, null);
|
|
1433
|
+
}, isEmpty(e7) {
|
|
1434
|
+
return this.eq(e7, null);
|
|
1435
|
+
}, startsWith(r2, i2) {
|
|
1436
|
+
let a2 = { [V(e6.transformationPaths, r2)]: { $startsWith: i2 } };
|
|
1437
|
+
return t2({ ...n2, filter: B(n2.filter, a2) });
|
|
1438
|
+
}, endsWith(r2, i2) {
|
|
1439
|
+
let a2 = { [V(e6.transformationPaths, r2)]: { $endsWith: i2 } };
|
|
1440
|
+
return t2({ ...n2, filter: B(n2.filter, a2) });
|
|
1441
|
+
}, contains(r2, i2) {
|
|
1442
|
+
let a2 = { [V(e6.transformationPaths, r2)]: { $contains: i2 } };
|
|
1443
|
+
return t2({ ...n2, filter: B(n2.filter, a2) });
|
|
1444
|
+
}, hasSome(r2, ...i2) {
|
|
1445
|
+
let a2 = { [V(e6.transformationPaths, r2)]: { $hasSome: Array.isArray(i2[0]) ? i2[0] : i2 } };
|
|
1446
|
+
return t2({ ...n2, filter: B(n2.filter, a2) });
|
|
1447
|
+
}, hasAll(r2, ...i2) {
|
|
1448
|
+
let a2 = { [V(e6.transformationPaths, r2)]: { $hasAll: Array.isArray(i2[0]) ? i2[0] : i2 } };
|
|
1449
|
+
return t2({ ...n2, filter: B(n2.filter, a2) });
|
|
1450
|
+
}, between(e7, t3, n3) {
|
|
1451
|
+
return this.ge(e7, t3).lt(e7, n3);
|
|
1452
|
+
}, in(r2, i2) {
|
|
1453
|
+
let a2 = { [V(e6.transformationPaths, r2)]: { $in: i2 } };
|
|
1454
|
+
return t2({ ...n2, filter: B(n2.filter, a2) });
|
|
1455
|
+
}, exists(r2, i2 = true) {
|
|
1456
|
+
let a2 = { [V(e6.transformationPaths, r2)]: { $exists: i2 } };
|
|
1457
|
+
return t2({ ...n2, filter: B(n2.filter, a2) });
|
|
1458
|
+
}, or(e7) {
|
|
1459
|
+
return t2({ ...n2, filter: Qr(n2.filter, e7.query.filter) });
|
|
1460
|
+
}, and(e7) {
|
|
1461
|
+
return t2({ ...n2, filter: B(n2.filter, e7.query.filter) });
|
|
1462
|
+
}, not(e7) {
|
|
1463
|
+
return t2({ ...n2, filter: $r(e7.query.filter) });
|
|
1464
|
+
}, ascending(...r2) {
|
|
1465
|
+
return t2({ ...n2, sort: [...n2.sort ?? [], ...r2.map((t3) => ({ fieldName: V(e6.transformationPaths, t3), order: `ASC` }))] });
|
|
1466
|
+
}, descending(...r2) {
|
|
1467
|
+
return t2({ ...n2, sort: [...n2.sort ?? [], ...r2.map((t3) => ({ fieldName: V(e6.transformationPaths, t3), order: `DESC` }))] });
|
|
1468
|
+
}, skip(e7) {
|
|
1469
|
+
return t2({ ...n2, paging: { offset: e7, limit: `limit` in n2.paging ? n2.paging.limit : 50 } });
|
|
1470
|
+
}, limit(r2) {
|
|
1471
|
+
if (e6.pagingMethod === `CURSOR`) {
|
|
1472
|
+
let e7 = n2;
|
|
1473
|
+
return t2({ ...n2, cursorPaging: { limit: r2, cursor: `cursor` in e7.cursorPaging ? e7.cursorPaging.cursor : void 0 } });
|
|
1474
|
+
}
|
|
1475
|
+
let i2 = n2;
|
|
1476
|
+
return t2({ ...n2, paging: { limit: r2, offset: `offset` in i2.paging ? i2.paging.offset : 0 } });
|
|
1477
|
+
} });
|
|
1478
|
+
return t2({ filter: {}, ...e6.pagingMethod === `OFFSET` ? { paging: { offset: 0, limit: 50 } } : { cursorPaging: { limit: 50 } } });
|
|
1479
|
+
}
|
|
1480
|
+
function V(e6, t2) {
|
|
1481
|
+
let n2 = Object.entries(e6).find(([e7]) => e7 === t2 || t2.startsWith(`${e7}.`))?.[0];
|
|
1482
|
+
return n2 ? t2.replace(n2, e6[n2]) : Ye(t2, { ...e6, ...Je });
|
|
1483
|
+
}
|
|
1484
|
+
var ii = `filter`;
|
|
1485
|
+
var ai = `sort`;
|
|
1486
|
+
var oi = `cursorPaging`;
|
|
1487
|
+
var si = `paging`;
|
|
1488
|
+
var ci = [ii, ai, oi];
|
|
1489
|
+
var li = [ii, ai, si];
|
|
1490
|
+
function ui(e6, t2) {
|
|
1491
|
+
return !e6 || typeof e6 != `object` ? false : t2.some((t3) => e6.hasOwnProperty(t3));
|
|
1492
|
+
}
|
|
1493
|
+
function di(e6) {
|
|
1494
|
+
return ui(e6, ci);
|
|
1495
|
+
}
|
|
1496
|
+
function fi(e6) {
|
|
1497
|
+
return ui(e6, li);
|
|
1498
|
+
}
|
|
1499
|
+
function pi(e6) {
|
|
1500
|
+
let { hasOptionsParameter: t2 } = e6;
|
|
1501
|
+
return function(...n2) {
|
|
1502
|
+
return t2 ? hi(n2, e6) : mi(n2, e6);
|
|
1503
|
+
};
|
|
1504
|
+
}
|
|
1505
|
+
function mi(e6, t2) {
|
|
1506
|
+
return e6.length === 0 ? t2.builderQueryFunction() : t2.typedQueryFunction(e6[0]);
|
|
1507
|
+
}
|
|
1508
|
+
function hi(e6, t2) {
|
|
1509
|
+
switch (e6.length) {
|
|
1510
|
+
case 0:
|
|
1511
|
+
return t2.builderQueryFunction();
|
|
1512
|
+
case 1:
|
|
1513
|
+
return di(e6[0]) || fi(e6[0]) ? t2.typedQueryFunction(e6[0]) : t2.builderQueryFunction(e6[0]);
|
|
1514
|
+
default:
|
|
1515
|
+
return t2.typedQueryFunction(e6[0], e6[1]);
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
function H(e6) {
|
|
1519
|
+
if (!e6) return;
|
|
1520
|
+
let t2 = ``;
|
|
1521
|
+
return (e6.filename || e6.altText) && (t2 = `/${encodeURIComponent(e6.filename || e6.altText)}`), e6.id ? `wix:image://v1/${e6.id}${t2}#originWidth=${e6.width}&originHeight=${e6.height}` : e6.url;
|
|
1522
|
+
}
|
|
1523
|
+
function U(e6) {
|
|
1524
|
+
if (e6) return [`http://`, `https://`].some((t2) => e6.base?.startsWith(t2)) ? `${e6.base}${e6.path}` : `http://${e6.base}${e6.path}`;
|
|
1525
|
+
}
|
|
1526
|
+
var gi = [{ path: `category.updatedDate` }, { path: `category.coverImage.urlExpirationDate` }];
|
|
1527
|
+
var _i = [{ path: `category.coverImage.focalPoint.x` }, { path: `category.coverImage.focalPoint.y` }];
|
|
1528
|
+
var vi = [{ path: `categories.updatedDate` }, { path: `categories.coverImage.urlExpirationDate` }];
|
|
1529
|
+
var yi = [{ path: `categories.coverImage.focalPoint.x` }, { path: `categories.coverImage.focalPoint.y` }];
|
|
1530
|
+
var bi = [{ path: `query.sort.origin.latitude` }, { path: `query.sort.origin.longitude` }];
|
|
1531
|
+
function xi(e6) {
|
|
1532
|
+
return Mt(Object.assign(e6, { domainToMappings: { "manage._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/categories`, destPath: `/v3/categories` }, { srcPath: `/_api/communities-blog-node-api/v3/bulk/category`, destPath: `/v3/bulk/category` }, { srcPath: `/_api/communities-blog-node-api/v3/bulk/categories`, destPath: `/v3/bulk/categories` }], "*.pub.wix-code.com": [{ srcPath: `/_api/communities-blog-node-api/v3/categories`, destPath: `/v3/categories` }], "bo._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/categories`, destPath: `/v3/categories` }], "wixbo.ai": [{ srcPath: `/_api/communities-blog-node-api/v3/categories`, destPath: `/v3/categories` }], "wix-bo.com": [{ srcPath: `/_api/communities-blog-node-api/v3/categories`, destPath: `/v3/categories` }], "editor.wixapps.net": [{ srcPath: `/_api/communities-blog-node-api/v3/categories`, destPath: `/v3/categories` }], "editor._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/categories`, destPath: `/v3/categories` }], "blocks._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/categories`, destPath: `/v3/categories` }], "create.editorx": [{ srcPath: `/_api/communities-blog-node-api/v3/categories`, destPath: `/v3/categories` }], "social-blog._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/categories`, destPath: `/v3/categories` }], _: [{ srcPath: `/_api/communities-blog-node-api/v3/categories`, destPath: `/v3/categories` }], "apps._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/categories`, destPath: `/v3/categories` }], "www._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/categories`, destPath: `/v3/categories` }], "www.wixapis.com": [{ srcPath: `/blog/v3/categories`, destPath: `/v3/categories` }, { srcPath: `/v3/categories`, destPath: `/v3/categories` }], "*.dev.wix-code.com": [{ srcPath: `/_api/communities-blog-node-api/v3/categories`, destPath: `/v3/categories` }], "api._api_base_domain_": [{ srcPath: `/category-service-api-proxy`, destPath: `` }] } }));
|
|
1533
|
+
}
|
|
1534
|
+
var Si = `@wix/auto_sdk_blog_categories`;
|
|
1535
|
+
function Ci(e6) {
|
|
1536
|
+
function t2({ host: t3 }) {
|
|
1537
|
+
return { entityFqdn: `wix.blog.v3.category`, method: `GET`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.CategoryService.GetCategory`, packageName: Si, migrationOptions: { optInTransformResponse: true }, url: xi({ protoPath: `/v3/categories/{categoryId}`, data: e6, host: t3 }), params: jt(e6), transformResponse: (e7) => P(e7, [{ transformFn: N, paths: gi }, { transformFn: L, paths: _i }]) };
|
|
1538
|
+
}
|
|
1539
|
+
return t2;
|
|
1540
|
+
}
|
|
1541
|
+
function wi(e6) {
|
|
1542
|
+
function t2({ host: t3 }) {
|
|
1543
|
+
return { entityFqdn: `wix.blog.v3.category`, method: `GET`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.CategoryService.GetCategoryBySlug`, packageName: Si, migrationOptions: { optInTransformResponse: true }, url: xi({ protoPath: `/v3/categories/slugs/{slug}`, data: e6, host: t3 }), params: jt(e6), transformResponse: (e7) => P(e7, [{ transformFn: N, paths: gi }, { transformFn: L, paths: _i }]) };
|
|
1544
|
+
}
|
|
1545
|
+
return t2;
|
|
1546
|
+
}
|
|
1547
|
+
function Ti(e6) {
|
|
1548
|
+
function t2({ host: t3 }) {
|
|
1549
|
+
return { entityFqdn: `wix.blog.v3.category`, method: `GET`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.CategoryService.ListCategories`, packageName: Si, migrationOptions: { optInTransformResponse: true }, url: xi({ protoPath: `/v3/categories`, data: e6, host: t3 }), params: jt(e6), transformResponse: (e7) => P(e7, [{ transformFn: N, paths: vi }, { transformFn: L, paths: yi }]) };
|
|
1550
|
+
}
|
|
1551
|
+
return t2;
|
|
1552
|
+
}
|
|
1553
|
+
function Ei(e6) {
|
|
1554
|
+
function t2({ host: t3 }) {
|
|
1555
|
+
let n2 = P(e6, [{ transformFn: an, paths: bi }]);
|
|
1556
|
+
return { entityFqdn: `wix.blog.v3.category`, method: `POST`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.CategoryService.QueryCategories`, packageName: Si, migrationOptions: { optInTransformResponse: true }, url: xi({ protoPath: `/v3/categories/query`, data: n2, host: t3 }), data: n2, transformResponse: (e7) => P(e7, [{ transformFn: N, paths: vi }, { transformFn: L, paths: yi }]) };
|
|
1557
|
+
}
|
|
1558
|
+
return t2;
|
|
1559
|
+
}
|
|
1560
|
+
var Di = [{ path: `category.url` }, { path: `category.translations.url` }];
|
|
1561
|
+
var Oi = [{ path: `category.coverImage` }];
|
|
1562
|
+
var ki = [{ path: `categories.url` }, { path: `categories.translations.url` }];
|
|
1563
|
+
var Ai = [{ path: `categories.coverImage` }];
|
|
1564
|
+
async function ji(e6, t2) {
|
|
1565
|
+
let { httpClient: n2, sideEffects: r2 } = arguments[2], i2 = Ci(j({ categoryId: e6, fieldsets: t2?.fieldsets }));
|
|
1566
|
+
r2?.onSiteCall?.();
|
|
1567
|
+
try {
|
|
1568
|
+
let e7 = await n2.request(i2);
|
|
1569
|
+
return r2?.onSuccess?.(e7), M(P(e7.data, [{ transformFn: U, paths: Di }, { transformFn: H, paths: Oi }]));
|
|
1570
|
+
} catch (e7) {
|
|
1571
|
+
let t3 = F(e7, { spreadPathsToArguments: {}, explicitPathsToArguments: { categoryId: `$[0]`, fieldsets: `$[1].fieldsets` }, singleArgumentUnchanged: false }, [`categoryId`, `options`]);
|
|
1572
|
+
throw r2?.onError?.(e7), t3;
|
|
1573
|
+
}
|
|
1574
|
+
}
|
|
1575
|
+
async function Mi(e6, t2) {
|
|
1576
|
+
let { httpClient: n2, sideEffects: r2 } = arguments[2], i2 = wi(j({ slug: e6, fieldsets: t2?.fieldsets, language: t2?.language }));
|
|
1577
|
+
r2?.onSiteCall?.();
|
|
1578
|
+
try {
|
|
1579
|
+
let e7 = await n2.request(i2);
|
|
1580
|
+
return r2?.onSuccess?.(e7), M(P(e7.data, [{ transformFn: U, paths: Di }, { transformFn: H, paths: Oi }]));
|
|
1581
|
+
} catch (e7) {
|
|
1582
|
+
let t3 = F(e7, { spreadPathsToArguments: {}, explicitPathsToArguments: { slug: `$[0]`, fieldsets: `$[1].fieldsets`, language: `$[1].language` }, singleArgumentUnchanged: false }, [`slug`, `options`]);
|
|
1583
|
+
throw r2?.onError?.(e7), t3;
|
|
1584
|
+
}
|
|
1585
|
+
}
|
|
1586
|
+
async function Ni(e6) {
|
|
1587
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = Ti(j({ paging: e6?.paging, fieldsets: e6?.fieldsets, language: e6?.language }));
|
|
1588
|
+
n2?.onSiteCall?.();
|
|
1589
|
+
try {
|
|
1590
|
+
let e7 = await t2.request(r2);
|
|
1591
|
+
return n2?.onSuccess?.(e7), M(P(e7.data, [{ transformFn: U, paths: ki }, { transformFn: H, paths: Ai }]));
|
|
1592
|
+
} catch (e7) {
|
|
1593
|
+
let t3 = F(e7, { spreadPathsToArguments: {}, explicitPathsToArguments: { paging: `$[0].paging`, fieldsets: `$[0].fieldsets`, language: `$[0].language` }, singleArgumentUnchanged: false }, [`options`]);
|
|
1594
|
+
throw n2?.onError?.(e7), t3;
|
|
1595
|
+
}
|
|
1596
|
+
}
|
|
1597
|
+
function Pi(e6) {
|
|
1598
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1];
|
|
1599
|
+
return ri({ func: async (r2) => {
|
|
1600
|
+
let i2 = Ei({ ...r2, ...e6 ?? {} });
|
|
1601
|
+
n2?.onSiteCall?.();
|
|
1602
|
+
try {
|
|
1603
|
+
let e7 = await t2.request(i2);
|
|
1604
|
+
return n2?.onSuccess?.(e7), e7;
|
|
1605
|
+
} catch (e7) {
|
|
1606
|
+
throw n2?.onError?.(e7), e7;
|
|
1607
|
+
}
|
|
1608
|
+
}, requestTransformer: (t3) => {
|
|
1609
|
+
let n3 = [t3, e6];
|
|
1610
|
+
return j({ ...n3?.[1], query: n3?.[0] });
|
|
1611
|
+
}, responseTransformer: ({ data: e7 }) => {
|
|
1612
|
+
let t3 = M(P(e7, [{ transformFn: U, paths: ki }, { transformFn: H, paths: Ai }]));
|
|
1613
|
+
return { items: t3?.categories, pagingMetadata: t3?.pagingMetadata };
|
|
1614
|
+
}, errorTransformer: (e7) => {
|
|
1615
|
+
throw F(e7, { spreadPathsToArguments: {}, explicitPathsToArguments: { query: `$[0]` }, singleArgumentUnchanged: false });
|
|
1616
|
+
}, pagingMethod: `OFFSET`, transformationPaths: {} });
|
|
1617
|
+
}
|
|
1618
|
+
async function Fi(e6, t2) {
|
|
1619
|
+
let { httpClient: n2, sideEffects: r2 } = arguments[2], i2 = Ei(j({ query: e6, ...t2 }));
|
|
1620
|
+
r2?.onSiteCall?.();
|
|
1621
|
+
try {
|
|
1622
|
+
let e7 = await n2.request(i2);
|
|
1623
|
+
return r2?.onSuccess?.(e7), M(P(e7.data, [{ transformFn: U, paths: ki }, { transformFn: H, paths: Ai }]));
|
|
1624
|
+
} catch (e7) {
|
|
1625
|
+
let t3 = F(e7, { spreadPathsToArguments: {}, explicitPathsToArguments: { query: `$[0]` }, singleArgumentUnchanged: false }, [`query`, `options`]);
|
|
1626
|
+
throw r2?.onError?.(e7), t3;
|
|
1627
|
+
}
|
|
1628
|
+
}
|
|
1629
|
+
function Ii(e6) {
|
|
1630
|
+
return (t2, n2) => ji(t2, n2, { httpClient: e6 });
|
|
1631
|
+
}
|
|
1632
|
+
function Li(e6) {
|
|
1633
|
+
return (t2, n2) => Mi(t2, n2, { httpClient: e6 });
|
|
1634
|
+
}
|
|
1635
|
+
function Ri(e6) {
|
|
1636
|
+
return (t2) => Ni(t2, { httpClient: e6 });
|
|
1637
|
+
}
|
|
1638
|
+
function zi(e6) {
|
|
1639
|
+
return (t2) => Pi(t2, { httpClient: e6 });
|
|
1640
|
+
}
|
|
1641
|
+
function Bi(e6) {
|
|
1642
|
+
return (t2, n2) => Fi(t2, n2, { httpClient: e6 });
|
|
1643
|
+
}
|
|
1644
|
+
function Vi(e6) {
|
|
1645
|
+
let t2 = pi({ builderQueryFunction: (t3) => zi(e6)(t3), typedQueryFunction: (t3, n3) => Bi(e6)(t3, n3), hasOptionsParameter: true });
|
|
1646
|
+
function n2(e7, n3) {
|
|
1647
|
+
return t2(...arguments);
|
|
1648
|
+
}
|
|
1649
|
+
return n2;
|
|
1650
|
+
}
|
|
1651
|
+
var Hi = I(Ii);
|
|
1652
|
+
var Ui = I(Li);
|
|
1653
|
+
var Wi = I(Ri);
|
|
1654
|
+
var Gi = I(Vi);
|
|
1655
|
+
function Ki(e6) {
|
|
1656
|
+
if (!e6) return;
|
|
1657
|
+
let t2 = ``;
|
|
1658
|
+
e6?.filename && (t2 = `/${encodeURIComponent(e6.filename)}`);
|
|
1659
|
+
let n2 = ``;
|
|
1660
|
+
if (e6.posters?.length) {
|
|
1661
|
+
let [t3, r2] = e6.posters, i2 = r2 || t3, a2 = i2.id || ``;
|
|
1662
|
+
if (!a2 && i2.url) {
|
|
1663
|
+
let e7 = i2.url.lastIndexOf(`/`);
|
|
1664
|
+
e7 !== -1 && (a2 = i2.url.substring(e7 + 1));
|
|
1665
|
+
}
|
|
1666
|
+
a2 && (n2 = `#posterUri=${a2}&posterWidth=${i2.width}&posterHeight=${i2.height}`);
|
|
1667
|
+
}
|
|
1668
|
+
return e6.id ? `wix:video://v1/${e6.id}${t2}${n2}` : e6.url;
|
|
1669
|
+
}
|
|
1670
|
+
var qi = [{ 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` }];
|
|
1671
|
+
var Ji = [{ path: `posts.richContentCompressed` }];
|
|
1672
|
+
var Yi = [{ 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` }];
|
|
1673
|
+
var Xi = [{ path: `sort.origin.latitude` }, { path: `sort.origin.longitude` }, { path: `query.sort.origin.latitude` }, { path: `query.sort.origin.longitude` }];
|
|
1674
|
+
function Zi(e6) {
|
|
1675
|
+
return Mt(Object.assign(e6, { domainToMappings: { _: [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }], "apps._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }], "www._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }], "www.wixapis.com": [{ srcPath: `/v3/posts`, destPath: `/v3/posts` }, { srcPath: `/blog/v3/posts`, destPath: `/v3/posts` }, { srcPath: `/_api/v3/posts`, destPath: `/v3/posts` }], "manage._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }, { srcPath: `/_api/post-service-api-proxy/v3/bulk/posts`, destPath: `/v3/bulk/posts` }], "*.dev.wix-code.com": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }], "editor._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }], "blocks._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }], "create.editorx": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }], "editor.wixapps.net": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }], "dev._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }] } }));
|
|
1676
|
+
}
|
|
1677
|
+
var Qi = `@wix/auto_sdk_blog_posts`;
|
|
1678
|
+
function $i(e6) {
|
|
1679
|
+
function t2({ host: t3 }) {
|
|
1680
|
+
return { entityFqdn: `wix.blog.v3.post`, method: `GET`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.PostService.ListPosts`, packageName: Qi, migrationOptions: { optInTransformResponse: true }, url: Zi({ protoPath: `/v3/posts`, data: e6, host: t3 }), params: jt(e6), transformResponse: (e7) => P(e7, [{ transformFn: N, paths: qi }, { transformFn: on, paths: Ji }, { transformFn: L, paths: Yi }]) };
|
|
1681
|
+
}
|
|
1682
|
+
return t2;
|
|
1683
|
+
}
|
|
1684
|
+
function ea(e6) {
|
|
1685
|
+
function t2({ host: t3 }) {
|
|
1686
|
+
let n2 = P(e6, [{ transformFn: an, paths: Xi }]);
|
|
1687
|
+
return { entityFqdn: `wix.blog.v3.post`, method: `POST`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.PostService.QueryPosts`, packageName: Qi, migrationOptions: { optInTransformResponse: true }, url: Zi({ protoPath: `/v3/posts/query`, data: n2, host: t3 }), data: n2, transformResponse: (e7) => P(e7, [{ transformFn: N, paths: qi }, { transformFn: on, paths: Ji }, { transformFn: L, paths: Yi }]) };
|
|
1688
|
+
}
|
|
1689
|
+
return t2;
|
|
1690
|
+
}
|
|
1691
|
+
var ta = [{ path: `posts.url` }, { path: `posts.translations.url` }];
|
|
1692
|
+
var na = [{ path: `posts.heroImage` }, { path: `posts.media.wixMedia.image` }];
|
|
1693
|
+
var ra = [{ path: `posts.media.wixMedia.videoV2` }];
|
|
1694
|
+
var W = ((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))(W || {});
|
|
1695
|
+
async function ia(e6) {
|
|
1696
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = $i(j({ featured: e6?.featured, hashtags: e6?.hashtags, categoryIds: e6?.categoryIds, tagIds: e6?.tagIds, sort: e6?.sort, paging: e6?.paging, language: e6?.language, memberId: e6?.memberId, fieldsets: e6?.fieldsets }, []));
|
|
1697
|
+
n2?.onSiteCall?.();
|
|
1698
|
+
try {
|
|
1699
|
+
let e7 = await t2.request(r2);
|
|
1700
|
+
return n2?.onSuccess?.(e7), M(P(e7.data, [{ transformFn: U, paths: ta }, { transformFn: H, paths: na }, { transformFn: Ki, paths: ra }]), [`posts.richContent`, `posts.rich_content`]);
|
|
1701
|
+
} catch (e7) {
|
|
1702
|
+
let t3 = F(e7, { spreadPathsToArguments: {}, explicitPathsToArguments: { featured: `$[0].featured`, hashtags: `$[0].hashtags`, categoryIds: `$[0].categoryIds`, tagIds: `$[0].tagIds`, sort: `$[0].sort`, paging: `$[0].paging`, language: `$[0].language`, memberId: `$[0].memberId`, fieldsets: `$[0].fieldsets` }, singleArgumentUnchanged: false }, [`options`]);
|
|
1703
|
+
throw n2?.onError?.(e7), t3;
|
|
1704
|
+
}
|
|
1705
|
+
}
|
|
1706
|
+
function aa(e6) {
|
|
1707
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1];
|
|
1708
|
+
return ri({ func: async (r2) => {
|
|
1709
|
+
let i2 = ea({ ...r2, ...e6 ?? {} });
|
|
1710
|
+
n2?.onSiteCall?.();
|
|
1711
|
+
try {
|
|
1712
|
+
let e7 = await t2.request(i2);
|
|
1713
|
+
return n2?.onSuccess?.(e7), e7;
|
|
1714
|
+
} catch (e7) {
|
|
1715
|
+
throw n2?.onError?.(e7), e7;
|
|
1716
|
+
}
|
|
1717
|
+
}, requestTransformer: (t3) => {
|
|
1718
|
+
let n3 = [t3, e6];
|
|
1719
|
+
return j({ ...n3?.[1], query: n3?.[0] }, []);
|
|
1720
|
+
}, responseTransformer: ({ data: e7 }) => {
|
|
1721
|
+
let t3 = M(P(e7, [{ transformFn: U, paths: ta }, { transformFn: H, paths: na }, { transformFn: Ki, paths: ra }]), [`posts.richContent`, `posts.rich_content`]);
|
|
1722
|
+
return { items: t3?.posts, pagingMetadata: t3?.pagingMetadata };
|
|
1723
|
+
}, errorTransformer: (e7) => {
|
|
1724
|
+
throw F(e7, { spreadPathsToArguments: {}, explicitPathsToArguments: { query: `$[0]` }, singleArgumentUnchanged: false });
|
|
1725
|
+
}, pagingMethod: `CURSOR`, transformationPaths: {} });
|
|
1726
|
+
}
|
|
1727
|
+
async function oa(e6, t2) {
|
|
1728
|
+
let { httpClient: n2, sideEffects: r2 } = arguments[2], i2 = ea(j({ query: e6, ...t2 }, []));
|
|
1729
|
+
r2?.onSiteCall?.();
|
|
1730
|
+
try {
|
|
1731
|
+
let e7 = await n2.request(i2);
|
|
1732
|
+
return r2?.onSuccess?.(e7), M(P(e7.data, [{ transformFn: U, paths: ta }, { transformFn: H, paths: na }, { transformFn: Ki, paths: ra }]), [`posts.richContent`, `posts.rich_content`]);
|
|
1733
|
+
} catch (e7) {
|
|
1734
|
+
let t3 = F(e7, { spreadPathsToArguments: {}, explicitPathsToArguments: { query: `$[0]` }, singleArgumentUnchanged: false }, [`query`, `options`]);
|
|
1735
|
+
throw r2?.onError?.(e7), t3;
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
function sa(e6) {
|
|
1739
|
+
return (t2) => ia(t2, { httpClient: e6 });
|
|
1740
|
+
}
|
|
1741
|
+
function ca(e6) {
|
|
1742
|
+
return (t2) => aa(t2, { httpClient: e6 });
|
|
1743
|
+
}
|
|
1744
|
+
function la(e6) {
|
|
1745
|
+
return (t2, n2) => oa(t2, n2, { httpClient: e6 });
|
|
1746
|
+
}
|
|
1747
|
+
function ua(e6) {
|
|
1748
|
+
let t2 = pi({ builderQueryFunction: (t3) => ca(e6)(t3), typedQueryFunction: (t3, n3) => la(e6)(t3, n3), hasOptionsParameter: true });
|
|
1749
|
+
function n2(e7, n3) {
|
|
1750
|
+
return t2(...arguments);
|
|
1751
|
+
}
|
|
1752
|
+
return n2;
|
|
1753
|
+
}
|
|
1754
|
+
var da = I(sa);
|
|
1755
|
+
var fa = I(ua);
|
|
1756
|
+
var pa = [{ path: `tag.createdDate` }, { path: `tag.updatedDate` }];
|
|
1757
|
+
function ma(e6) {
|
|
1758
|
+
return Mt(Object.assign(e6, { domainToMappings: { _: [{ srcPath: `/_api/communities-blog-node-api/v3/tags`, destPath: `/v3/tags` }], "apps._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/tags`, destPath: `/v3/tags` }], "www._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/tags`, destPath: `/v3/tags` }], "www.wixapis.com": [{ srcPath: `/v3/tags`, destPath: `/v3/tags` }, { srcPath: `/blog/v3/tags`, destPath: `/v3/tags` }], "manage._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v2/tags`, destPath: `/v2/tags` }, { srcPath: `/_api/communities-blog-node-api/v3/bulk/tag`, destPath: `/v3/bulk/tag` }, { srcPath: `/_api/communities-blog-node-api/v3/bulk/tags`, destPath: `/v3/bulk/tags` }, { srcPath: `/_api/communities-blog-node-api/v3/tags`, destPath: `/v3/tags` }], "bo._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/tags`, destPath: `/v3/tags` }], "wixbo.ai": [{ srcPath: `/_api/communities-blog-node-api/v3/tags`, destPath: `/v3/tags` }], "wix-bo.com": [{ srcPath: `/_api/communities-blog-node-api/v3/tags`, destPath: `/v3/tags` }], "editor._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/tags`, destPath: `/v3/tags` }], "blocks._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/tags`, destPath: `/v3/tags` }], "create.editorx": [{ srcPath: `/_api/communities-blog-node-api/v3/tags`, destPath: `/v3/tags` }], "editor.wixapps.net": [{ srcPath: `/_api/communities-blog-node-api/v3/tags`, destPath: `/v3/tags` }], "*.dev.wix-code.com": [{ srcPath: `/_api/communities-blog-node-api/v3/tags`, destPath: `/v3/tags` }], "social-blog._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/tags`, destPath: `/v3/tags` }] } }));
|
|
1759
|
+
}
|
|
1760
|
+
var ha = `@wix/auto_sdk_blog_tags`;
|
|
1761
|
+
function ga(e6) {
|
|
1762
|
+
function t2({ host: t3 }) {
|
|
1763
|
+
return { entityFqdn: `wix.blog.v3.tag`, method: `GET`, methodFqn: `com.wixpress.npm.communities.platformized.blog.TagService.GetTagBySlug`, packageName: ha, migrationOptions: { optInTransformResponse: true }, url: ma({ protoPath: `/v3/tags/slugs/{slug}`, data: e6, host: t3 }), params: jt(e6), transformResponse: (e7) => P(e7, [{ transformFn: N, paths: pa }]) };
|
|
1764
|
+
}
|
|
1765
|
+
return t2;
|
|
1766
|
+
}
|
|
1767
|
+
var _a = [{ path: `tag.url` }];
|
|
1768
|
+
async function va(e6, t2) {
|
|
1769
|
+
let { httpClient: n2, sideEffects: r2 } = arguments[2], i2 = ga(j({ slug: e6, fieldsets: t2?.fieldsets, language: t2?.language }));
|
|
1770
|
+
r2?.onSiteCall?.();
|
|
1771
|
+
try {
|
|
1772
|
+
let e7 = await n2.request(i2);
|
|
1773
|
+
return r2?.onSuccess?.(e7), M(P(e7.data, [{ transformFn: U, paths: _a }]));
|
|
1774
|
+
} catch (e7) {
|
|
1775
|
+
let t3 = F(e7, { spreadPathsToArguments: {}, explicitPathsToArguments: { slug: `$[0]`, fieldsets: `$[1].fieldsets`, language: `$[1].language` }, singleArgumentUnchanged: false }, [`slug`, `options`]);
|
|
1776
|
+
throw r2?.onError?.(e7), t3;
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
function ya(e6) {
|
|
1780
|
+
return (t2, n2) => va(t2, n2, { httpClient: e6 });
|
|
1781
|
+
}
|
|
1782
|
+
var ba = I(ya);
|
|
1783
|
+
var xa = () => {
|
|
1784
|
+
try {
|
|
1785
|
+
return f(Rn).currentUrl;
|
|
1786
|
+
} catch {
|
|
1787
|
+
return;
|
|
1788
|
+
}
|
|
1789
|
+
};
|
|
1790
|
+
var Sa = (e6, t2) => {
|
|
1791
|
+
let n2;
|
|
1792
|
+
try {
|
|
1793
|
+
n2 = new URL(e6);
|
|
1794
|
+
} catch {
|
|
1795
|
+
return;
|
|
1796
|
+
}
|
|
1797
|
+
let r2 = n2.pathname.split(`/`).filter(Boolean);
|
|
1798
|
+
if (r2.length !== 0) return r2[r2.length - 1] = encodeURIComponent(t2), n2.pathname = `/${r2.join(`/`)}`, n2.toString();
|
|
1799
|
+
};
|
|
1800
|
+
var Ca = (e6, t2, n2) => {
|
|
1801
|
+
let r2 = xa(), i2 = Jr(), a2 = Ur(), { language: o2, translationId: c2 } = e6 ?? {}, l2 = !!(t2 && c2 && o2 && o2 !== t2);
|
|
1802
|
+
s(() => {
|
|
1803
|
+
if (!l2 || !t2 || !c2 || !r2 || i2 || a2) return;
|
|
1804
|
+
let e7 = false;
|
|
1805
|
+
return n2(c2, t2).then((t3) => {
|
|
1806
|
+
let n3 = t3 && Sa(r2, t3);
|
|
1807
|
+
!e7 && n3 && n3 !== r2 && window.location.assign(n3);
|
|
1808
|
+
}), () => {
|
|
1809
|
+
e7 = true;
|
|
1810
|
+
};
|
|
1811
|
+
}, [l2, t2, c2, r2, i2, a2, n2]);
|
|
1812
|
+
};
|
|
1813
|
+
var wa = R(`@wix/site-service-warmup-data`);
|
|
1814
|
+
function Ta() {
|
|
1815
|
+
let e6 = jr(), t2 = null;
|
|
1816
|
+
try {
|
|
1817
|
+
t2 = d()(wa);
|
|
1818
|
+
} catch {
|
|
1819
|
+
}
|
|
1820
|
+
return c(() => ({ isServer: e6, scope: t2 ?? void 0, get: async (n2) => {
|
|
1821
|
+
if (e6 || !t2) return null;
|
|
1822
|
+
try {
|
|
1823
|
+
return await t2.get(n2);
|
|
1824
|
+
} catch {
|
|
1825
|
+
return null;
|
|
1826
|
+
}
|
|
1827
|
+
}, set: (n2, r2) => {
|
|
1828
|
+
if (e6 && t2) try {
|
|
1829
|
+
t2.set(n2, r2);
|
|
1830
|
+
} catch {
|
|
1831
|
+
}
|
|
1832
|
+
} }), [e6, t2]);
|
|
1833
|
+
}
|
|
1834
|
+
var Ea = () => {
|
|
1835
|
+
let e6 = /* @__PURE__ */ new Map();
|
|
1836
|
+
return { getOrInsert: (t2, n2) => (e6.has(t2) || e6.set(t2, n2().finally(() => {
|
|
1837
|
+
e6.delete(t2);
|
|
1838
|
+
})), e6.get(t2)) };
|
|
1839
|
+
};
|
|
1840
|
+
var Da = async (e6) => {
|
|
1841
|
+
try {
|
|
1842
|
+
let { default: t2 } = await e6();
|
|
1843
|
+
return t2;
|
|
1844
|
+
} catch {
|
|
1845
|
+
return;
|
|
1846
|
+
}
|
|
1847
|
+
};
|
|
1848
|
+
var Oa = ({ isDev: e6, loadMessages: t2, loadDevMessages: n2 }) => {
|
|
1849
|
+
let r2 = Ea(), i2 = async (r3) => {
|
|
1850
|
+
let [i3, a2] = await Promise.all([Da(() => t2(r3)), !e6 || !n2 ? void 0 : Da(() => n2(r3))]);
|
|
1851
|
+
if (i3 && a2) return { ...i3, ...a2 };
|
|
1852
|
+
if (i3) return i3;
|
|
1853
|
+
if (a2) return a2;
|
|
1854
|
+
throw Error(`No translation files found for ${r3}`);
|
|
1855
|
+
};
|
|
1856
|
+
return (e7) => r2.getOrInsert(e7, () => i2(e7));
|
|
1857
|
+
};
|
|
1858
|
+
var G = (e6) => typeof e6 == `string`;
|
|
1859
|
+
var ka = () => {
|
|
1860
|
+
let e6, t2, n2 = new Promise((n3, r2) => {
|
|
1861
|
+
e6 = n3, t2 = r2;
|
|
1862
|
+
});
|
|
1863
|
+
return n2.resolve = e6, n2.reject = t2, n2;
|
|
1864
|
+
};
|
|
1865
|
+
var Aa = (e6) => e6 == null ? `` : String(e6);
|
|
1866
|
+
var ja = (e6, t2, n2) => {
|
|
1867
|
+
e6.forEach((e7) => {
|
|
1868
|
+
t2[e7] && (n2[e7] = t2[e7]);
|
|
1869
|
+
});
|
|
1870
|
+
};
|
|
1871
|
+
var Ma = /###/g;
|
|
1872
|
+
var Na = (e6) => e6 && e6.includes(`###`) ? e6.replace(Ma, `.`) : e6;
|
|
1873
|
+
var Pa = (e6) => !e6 || G(e6);
|
|
1874
|
+
var Fa = (e6, t2, n2) => {
|
|
1875
|
+
let r2 = G(t2) ? t2.split(`.`) : t2, i2 = 0;
|
|
1876
|
+
for (; i2 < r2.length - 1; ) {
|
|
1877
|
+
if (Pa(e6)) return {};
|
|
1878
|
+
let t3 = Na(r2[i2]);
|
|
1879
|
+
!e6[t3] && n2 && (e6[t3] = new n2()), e6 = Object.prototype.hasOwnProperty.call(e6, t3) ? e6[t3] : {}, ++i2;
|
|
1880
|
+
}
|
|
1881
|
+
return Pa(e6) ? {} : { obj: e6, k: Na(r2[i2]) };
|
|
1882
|
+
};
|
|
1883
|
+
var Ia = (e6, t2, n2) => {
|
|
1884
|
+
let { obj: r2, k: i2 } = Fa(e6, t2, Object);
|
|
1885
|
+
if (r2 !== void 0 || t2.length === 1) {
|
|
1886
|
+
r2[i2] = n2;
|
|
1887
|
+
return;
|
|
1888
|
+
}
|
|
1889
|
+
let a2 = t2[t2.length - 1], o2 = t2.slice(0, t2.length - 1), s2 = Fa(e6, o2, Object);
|
|
1890
|
+
for (; s2.obj === void 0 && o2.length; ) a2 = `${o2[o2.length - 1]}.${a2}`, o2 = o2.slice(0, o2.length - 1), s2 = Fa(e6, o2, Object), s2?.obj && s2.obj[`${s2.k}.${a2}`] !== void 0 && (s2.obj = void 0);
|
|
1891
|
+
s2.obj[`${s2.k}.${a2}`] = n2;
|
|
1892
|
+
};
|
|
1893
|
+
var La = (e6, t2, n2, r2) => {
|
|
1894
|
+
let { obj: i2, k: a2 } = Fa(e6, t2, Object);
|
|
1895
|
+
i2[a2] = i2[a2] || [], i2[a2].push(n2);
|
|
1896
|
+
};
|
|
1897
|
+
var Ra = (e6, t2) => {
|
|
1898
|
+
let { obj: n2, k: r2 } = Fa(e6, t2);
|
|
1899
|
+
if (n2 && Object.prototype.hasOwnProperty.call(n2, r2)) return n2[r2];
|
|
1900
|
+
};
|
|
1901
|
+
var za = (e6, t2, n2) => {
|
|
1902
|
+
let r2 = Ra(e6, n2);
|
|
1903
|
+
return r2 === void 0 ? Ra(t2, n2) : r2;
|
|
1904
|
+
};
|
|
1905
|
+
var Ba = (e6, t2, n2) => {
|
|
1906
|
+
for (let r2 in t2) r2 !== `__proto__` && r2 !== `constructor` && (Object.prototype.hasOwnProperty.call(e6, r2) ? G(e6[r2]) || e6[r2] instanceof String || G(t2[r2]) || t2[r2] instanceof String ? n2 && (e6[r2] = t2[r2]) : Ba(e6[r2], t2[r2], n2) : e6[r2] = t2[r2]);
|
|
1907
|
+
return e6;
|
|
1908
|
+
};
|
|
1909
|
+
var K = (e6) => e6.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, `\\$&`);
|
|
1910
|
+
var Va = { "&": `&`, "<": `<`, ">": `>`, '"': `"`, "'": `'`, "/": `/` };
|
|
1911
|
+
var Ha = (e6) => G(e6) ? e6.replace(/[&<>"'\/]/g, (e7) => Va[e7]) : e6;
|
|
1912
|
+
var Ua = class {
|
|
1913
|
+
constructor(e6) {
|
|
1914
|
+
this.capacity = e6, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
|
|
1915
|
+
}
|
|
1916
|
+
getRegExp(e6) {
|
|
1917
|
+
let t2 = this.regExpMap.get(e6);
|
|
1918
|
+
if (t2 !== void 0) return t2;
|
|
1919
|
+
let n2 = new RegExp(e6);
|
|
1920
|
+
return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e6, n2), this.regExpQueue.push(e6), n2;
|
|
1921
|
+
}
|
|
1922
|
+
};
|
|
1923
|
+
var Wa = [` `, `,`, `?`, `!`, `;`];
|
|
1924
|
+
var Ga = new Ua(20);
|
|
1925
|
+
var Ka = (e6, t2, n2) => {
|
|
1926
|
+
t2 ||= ``, n2 ||= ``;
|
|
1927
|
+
let r2 = Wa.filter((e7) => !t2.includes(e7) && !n2.includes(e7));
|
|
1928
|
+
if (r2.length === 0) return true;
|
|
1929
|
+
let i2 = Ga.getRegExp(`(${r2.map((e7) => e7 === `?` ? `\\?` : e7).join(`|`)})`), a2 = !i2.test(e6);
|
|
1930
|
+
if (!a2) {
|
|
1931
|
+
let t3 = e6.indexOf(n2);
|
|
1932
|
+
t3 > 0 && !i2.test(e6.substring(0, t3)) && (a2 = true);
|
|
1933
|
+
}
|
|
1934
|
+
return a2;
|
|
1935
|
+
};
|
|
1936
|
+
var qa = (e6, t2, n2 = `.`) => {
|
|
1937
|
+
if (!e6) return;
|
|
1938
|
+
if (e6[t2]) return Object.prototype.hasOwnProperty.call(e6, t2) ? e6[t2] : void 0;
|
|
1939
|
+
let r2 = t2.split(n2), i2 = e6;
|
|
1940
|
+
for (let e7 = 0; e7 < r2.length; ) {
|
|
1941
|
+
if (!i2 || typeof i2 != `object`) return;
|
|
1942
|
+
let t3, a2 = ``;
|
|
1943
|
+
for (let o2 = e7; o2 < r2.length; ++o2) if (o2 !== e7 && (a2 += n2), a2 += r2[o2], t3 = i2[a2], t3 !== void 0) {
|
|
1944
|
+
if ([`string`, `number`, `boolean`].includes(typeof t3) && o2 < r2.length - 1) continue;
|
|
1945
|
+
e7 += o2 - e7 + 1;
|
|
1946
|
+
break;
|
|
1947
|
+
}
|
|
1948
|
+
i2 = t3;
|
|
1949
|
+
}
|
|
1950
|
+
return i2;
|
|
1951
|
+
};
|
|
1952
|
+
var Ja = (e6) => e6?.replace(/_/g, `-`);
|
|
1953
|
+
var Ya = { type: `logger`, log(e6) {
|
|
1954
|
+
this.output(`log`, e6);
|
|
1955
|
+
}, warn(e6) {
|
|
1956
|
+
this.output(`warn`, e6);
|
|
1957
|
+
}, error(e6) {
|
|
1958
|
+
this.output(`error`, e6);
|
|
1959
|
+
}, output(e6, t2) {
|
|
1960
|
+
console?.[e6]?.apply?.(console, t2);
|
|
1961
|
+
} };
|
|
1962
|
+
var q = new class e2 {
|
|
1963
|
+
constructor(e6, t2 = {}) {
|
|
1964
|
+
this.init(e6, t2);
|
|
1965
|
+
}
|
|
1966
|
+
init(e6, t2 = {}) {
|
|
1967
|
+
this.prefix = t2.prefix || `i18next:`, this.logger = e6 || Ya, this.options = t2, this.debug = t2.debug;
|
|
1968
|
+
}
|
|
1969
|
+
log(...e6) {
|
|
1970
|
+
return this.forward(e6, `log`, ``, true);
|
|
1971
|
+
}
|
|
1972
|
+
warn(...e6) {
|
|
1973
|
+
return this.forward(e6, `warn`, ``, true);
|
|
1974
|
+
}
|
|
1975
|
+
error(...e6) {
|
|
1976
|
+
return this.forward(e6, `error`, ``);
|
|
1977
|
+
}
|
|
1978
|
+
deprecate(...e6) {
|
|
1979
|
+
return this.forward(e6, `warn`, `WARNING DEPRECATED: `, true);
|
|
1980
|
+
}
|
|
1981
|
+
forward(e6, t2, n2, r2) {
|
|
1982
|
+
return r2 && !this.debug ? null : (e6 = e6.map((e7) => G(e7) ? e7.replace(/[\r\n\x00-\x1F\x7F]/g, ` `) : e7), G(e6[0]) && (e6[0] = `${n2}${this.prefix} ${e6[0]}`), this.logger[t2](e6));
|
|
1983
|
+
}
|
|
1984
|
+
create(t2) {
|
|
1985
|
+
return new e2(this.logger, { prefix: `${this.prefix}:${t2}:`, ...this.options });
|
|
1986
|
+
}
|
|
1987
|
+
clone(t2) {
|
|
1988
|
+
return t2 ||= this.options, t2.prefix = t2.prefix || this.prefix, new e2(this.logger, t2);
|
|
1989
|
+
}
|
|
1990
|
+
}();
|
|
1991
|
+
var Xa = class {
|
|
1992
|
+
constructor() {
|
|
1993
|
+
this.observers = {};
|
|
1994
|
+
}
|
|
1995
|
+
on(e6, t2) {
|
|
1996
|
+
return e6.split(` `).forEach((e7) => {
|
|
1997
|
+
this.observers[e7] || (this.observers[e7] = /* @__PURE__ */ new Map());
|
|
1998
|
+
let n2 = this.observers[e7].get(t2) || 0;
|
|
1999
|
+
this.observers[e7].set(t2, n2 + 1);
|
|
2000
|
+
}), this;
|
|
2001
|
+
}
|
|
2002
|
+
off(e6, t2) {
|
|
2003
|
+
this.observers[e6] && (t2 ? this.observers[e6].delete(t2) : delete this.observers[e6]);
|
|
2004
|
+
}
|
|
2005
|
+
once(e6, t2) {
|
|
2006
|
+
let n2 = (...r2) => {
|
|
2007
|
+
t2(...r2), this.off(e6, n2);
|
|
2008
|
+
};
|
|
2009
|
+
return this.on(e6, n2), this;
|
|
2010
|
+
}
|
|
2011
|
+
emit(e6, ...t2) {
|
|
2012
|
+
this.observers[e6] && Array.from(this.observers[e6].entries()).forEach(([e7, n2]) => {
|
|
2013
|
+
for (let r2 = 0; r2 < n2; r2++) e7(...t2);
|
|
2014
|
+
}), this.observers[`*`] && Array.from(this.observers[`*`].entries()).forEach(([n2, r2]) => {
|
|
2015
|
+
for (let i2 = 0; i2 < r2; i2++) n2(e6, ...t2);
|
|
2016
|
+
});
|
|
2017
|
+
}
|
|
2018
|
+
};
|
|
2019
|
+
var Za = /* @__PURE__ */ new WeakSet();
|
|
2020
|
+
var Qa = class extends Xa {
|
|
2021
|
+
constructor(e6, t2 = { ns: [`translation`], defaultNS: `translation` }) {
|
|
2022
|
+
super(), this.data = e6 || {}, this.options = t2, this.options.keySeparator === void 0 && (this.options.keySeparator = `.`), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = true);
|
|
2023
|
+
}
|
|
2024
|
+
addNamespaces(e6) {
|
|
2025
|
+
this.options.ns.includes(e6) || this.options.ns.push(e6);
|
|
2026
|
+
}
|
|
2027
|
+
removeNamespaces(e6) {
|
|
2028
|
+
let t2 = this.options.ns.indexOf(e6);
|
|
2029
|
+
t2 > -1 && this.options.ns.splice(t2, 1);
|
|
2030
|
+
}
|
|
2031
|
+
getResource(e6, t2, n2, r2 = {}) {
|
|
2032
|
+
let i2 = r2.keySeparator === void 0 ? this.options.keySeparator : r2.keySeparator, a2 = r2.ignoreJSONStructure === void 0 ? this.options.ignoreJSONStructure : r2.ignoreJSONStructure, o2;
|
|
2033
|
+
e6.includes(`.`) ? o2 = e6.split(`.`) : (o2 = [e6, t2], n2 && (Array.isArray(n2) ? o2.push(...n2) : G(n2) && i2 ? o2.push(...n2.split(i2)) : o2.push(n2)));
|
|
2034
|
+
let s2 = Ra(this.data, o2);
|
|
2035
|
+
return !s2 && !t2 && !n2 && e6.includes(`.`) && (e6 = o2[0], t2 = o2[1], n2 = o2.slice(2).join(`.`)), s2 || !a2 || !G(n2) ? s2 : qa(this.data?.[e6]?.[t2], n2, i2);
|
|
2036
|
+
}
|
|
2037
|
+
addResource(e6, t2, n2, r2, i2 = { silent: false }) {
|
|
2038
|
+
let a2 = i2.keySeparator === void 0 ? this.options.keySeparator : i2.keySeparator, o2 = [e6, t2];
|
|
2039
|
+
n2 && (o2 = o2.concat(a2 ? n2.split(a2) : n2)), e6.includes(`.`) && (o2 = e6.split(`.`), r2 = t2, t2 = o2[1]), this.addNamespaces(t2), Ia(this.data, o2, r2), i2.silent || this.emit(`added`, e6, t2, n2, r2);
|
|
2040
|
+
}
|
|
2041
|
+
addResources(e6, t2, n2, r2 = { silent: false }) {
|
|
2042
|
+
for (let r3 in n2) (G(n2[r3]) || Array.isArray(n2[r3])) && this.addResource(e6, t2, r3, n2[r3], { silent: true });
|
|
2043
|
+
r2.silent || this.emit(`added`, e6, t2, n2);
|
|
2044
|
+
}
|
|
2045
|
+
addResourceBundle(e6, t2, n2, r2, i2, a2 = { silent: false, skipCopy: false }) {
|
|
2046
|
+
let o2 = [e6, t2];
|
|
2047
|
+
e6.includes(`.`) && (o2 = e6.split(`.`), r2 = n2, n2 = t2, t2 = o2[1]), this.addNamespaces(t2);
|
|
2048
|
+
let s2 = Ra(this.data, o2) || {};
|
|
2049
|
+
a2.skipCopy || (n2 = JSON.parse(JSON.stringify(n2))), r2 ? Ba(s2, n2, i2) : s2 = { ...s2, ...n2 }, Ia(this.data, o2, s2), a2.silent || this.emit(`added`, e6, t2, n2);
|
|
2050
|
+
}
|
|
2051
|
+
removeResourceBundle(e6, t2) {
|
|
2052
|
+
this.hasResourceBundle(e6, t2) && delete this.data[e6][t2], this.removeNamespaces(t2), this.emit(`removed`, e6, t2);
|
|
2053
|
+
}
|
|
2054
|
+
hasResourceBundle(e6, t2) {
|
|
2055
|
+
return this.getResource(e6, t2) !== void 0;
|
|
2056
|
+
}
|
|
2057
|
+
getResourceBundle(e6, t2) {
|
|
2058
|
+
return t2 ||= this.options.defaultNS, this.getResource(e6, t2);
|
|
2059
|
+
}
|
|
2060
|
+
getDataByLanguage(e6) {
|
|
2061
|
+
return this.data[e6];
|
|
2062
|
+
}
|
|
2063
|
+
hasLanguageSomeTranslations(e6) {
|
|
2064
|
+
let t2 = this.getDataByLanguage(e6);
|
|
2065
|
+
return !!(t2 && Object.keys(t2) || []).find((e7) => {
|
|
2066
|
+
let n2 = t2[e7];
|
|
2067
|
+
return Za.has(n2) ? true : !n2 || Object.keys(n2).length === 0 ? false : (typeof n2 == `object` && Za.add(n2), true);
|
|
2068
|
+
});
|
|
2069
|
+
}
|
|
2070
|
+
toJSON() {
|
|
2071
|
+
return this.data;
|
|
2072
|
+
}
|
|
2073
|
+
};
|
|
2074
|
+
var $a = { processors: {}, addPostProcessor(e6) {
|
|
2075
|
+
this.processors[e6.name] = e6;
|
|
2076
|
+
}, handle(e6, t2, n2, r2, i2) {
|
|
2077
|
+
return e6.forEach((e7) => {
|
|
2078
|
+
t2 = this.processors[e7]?.process(t2, n2, r2, i2) ?? t2;
|
|
2079
|
+
}), t2;
|
|
2080
|
+
} };
|
|
2081
|
+
var eo = Symbol(`i18next/PATH_KEY`);
|
|
2082
|
+
function to() {
|
|
2083
|
+
let e6 = [], t2 = /* @__PURE__ */ Object.create(null), n2;
|
|
2084
|
+
return t2.get = (r2, i2) => (n2?.revoke?.(), i2 === eo ? e6 : (e6.push(i2), n2 = Proxy.revocable(r2, t2), n2.proxy)), Proxy.revocable(/* @__PURE__ */ Object.create(null), t2).proxy;
|
|
2085
|
+
}
|
|
2086
|
+
function no(e6, t2) {
|
|
2087
|
+
let { [eo]: n2 } = e6(to()), r2 = t2?.keySeparator ?? `.`, i2 = t2?.nsSeparator ?? `:`, a2 = t2?.enableSelector === `strict`;
|
|
2088
|
+
if (n2.length > 1 && i2) {
|
|
2089
|
+
let e7 = t2?.ns, o2 = a2 ? Array.isArray(e7) ? e7 : e7 ? [e7] : null : Array.isArray(e7) ? e7 : null;
|
|
2090
|
+
if (o2 && (a2 ? o2 : o2.length > 1 ? o2.slice(1) : []).includes(n2[0])) return `${n2[0]}${i2}${n2.slice(1).join(r2)}`;
|
|
2091
|
+
}
|
|
2092
|
+
return n2.join(r2);
|
|
2093
|
+
}
|
|
2094
|
+
var ro = (e6) => !G(e6) && typeof e6 != `boolean` && typeof e6 != `number`;
|
|
2095
|
+
var io = class e3 extends Xa {
|
|
2096
|
+
constructor(e6, t2 = {}) {
|
|
2097
|
+
super(), ja([`resourceStore`, `languageUtils`, `pluralResolver`, `interpolator`, `backendConnector`, `i18nFormat`, `utils`], e6, this), this.options = t2, this.options.keySeparator === void 0 && (this.options.keySeparator = `.`), this.logger = q.create(`translator`), this.checkedLoadedFor = {};
|
|
2098
|
+
}
|
|
2099
|
+
changeLanguage(e6) {
|
|
2100
|
+
e6 && (this.language = e6);
|
|
2101
|
+
}
|
|
2102
|
+
exists(e6, t2 = { interpolation: {} }) {
|
|
2103
|
+
let n2 = { ...t2 };
|
|
2104
|
+
if (e6 == null) return false;
|
|
2105
|
+
let r2 = this.resolve(e6, n2);
|
|
2106
|
+
if (r2?.res === void 0) return false;
|
|
2107
|
+
let i2 = ro(r2.res);
|
|
2108
|
+
return !(n2.returnObjects === false && i2);
|
|
2109
|
+
}
|
|
2110
|
+
extractFromKey(e6, t2) {
|
|
2111
|
+
let n2 = t2.nsSeparator === void 0 ? this.options.nsSeparator : t2.nsSeparator;
|
|
2112
|
+
n2 === void 0 && (n2 = `:`);
|
|
2113
|
+
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 && !Ka(e6, n2, r2);
|
|
2114
|
+
if (a2 && !o2) {
|
|
2115
|
+
let t3 = e6.match(this.interpolator.nestingRegexp);
|
|
2116
|
+
if (t3 && t3.length > 0) return { key: e6, namespaces: G(i2) ? [i2] : i2 };
|
|
2117
|
+
let a3 = e6.split(n2);
|
|
2118
|
+
(n2 !== r2 || n2 === r2 && this.options.ns.includes(a3[0])) && (i2 = a3.shift()), e6 = a3.join(r2);
|
|
2119
|
+
}
|
|
2120
|
+
return { key: e6, namespaces: G(i2) ? [i2] : i2 };
|
|
2121
|
+
}
|
|
2122
|
+
translate(t2, n2, r2) {
|
|
2123
|
+
let i2 = typeof n2 == `object` ? { ...n2 } : n2;
|
|
2124
|
+
if (typeof i2 != `object` && this.options.overloadTranslationOptionHandler && (i2 = this.options.overloadTranslationOptionHandler(arguments)), typeof i2 == `object` && (i2 = { ...i2 }), i2 ||= {}, t2 == null) return ``;
|
|
2125
|
+
typeof t2 == `function` && (t2 = no(t2, { ...this.options, ...i2 })), Array.isArray(t2) || (t2 = [String(t2)]), t2 = t2.map((e6) => typeof e6 == `function` ? no(e6, { ...this.options, ...i2 }) : String(e6));
|
|
2126
|
+
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;
|
|
2127
|
+
u2 === void 0 && (u2 = `:`);
|
|
2128
|
+
let d2 = i2.lng || this.language, f2 = i2.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
|
|
2129
|
+
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;
|
|
2130
|
+
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 && !G(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 }) : ``, w2 = b2 && !i2.ordinal && i2.count === 0, T2 = w2 && i2[`defaultValue${this.options.pluralSeparator}zero`] || i2[`defaultValue${S2}`] || i2[`defaultValue${C2}`] || i2.defaultValue, E2 = m2;
|
|
2131
|
+
y2 && !m2 && x2 && (E2 = T2);
|
|
2132
|
+
let D2 = ro(E2), ee2 = Object.prototype.toString.apply(E2);
|
|
2133
|
+
if (y2 && E2 && D2 && !_2.includes(ee2) && !(G(v2) && Array.isArray(E2))) {
|
|
2134
|
+
if (!i2.returnObjects && !this.options.returnObjects) {
|
|
2135
|
+
this.options.returnedObjectHandler || this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);
|
|
2136
|
+
let e6 = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(h2, E2, { ...i2, ns: c2 }) : `key '${s2} (${this.language})' returned an object instead of string.`;
|
|
2137
|
+
return a2 ? (p2.res = e6, p2.usedParams = this.getUsedParamsDetails(i2), p2) : e6;
|
|
2138
|
+
}
|
|
2139
|
+
if (o2) {
|
|
2140
|
+
let e6 = Array.isArray(E2), t3 = e6 ? [] : {}, n3 = e6 ? g2 : h2;
|
|
2141
|
+
for (let e7 in E2) if (Object.prototype.hasOwnProperty.call(E2, e7)) {
|
|
2142
|
+
let r3 = `${n3}${o2}${e7}`;
|
|
2143
|
+
t3[e7] = x2 && !m2 ? this.translate(r3, { ...i2, defaultValue: ro(T2) ? T2[e7] : void 0, joinArrays: false, ns: c2 }) : this.translate(r3, { ...i2, joinArrays: false, ns: c2 }), t3[e7] === r3 && (t3[e7] = E2[e7]);
|
|
2144
|
+
}
|
|
2145
|
+
m2 = t3;
|
|
2146
|
+
}
|
|
2147
|
+
} else if (y2 && G(v2) && Array.isArray(m2)) m2 = m2.join(v2), m2 &&= this.extendTranslation(m2, t2, i2, r2);
|
|
2148
|
+
else {
|
|
2149
|
+
let e6 = false, n3 = false;
|
|
2150
|
+
!this.isValidLookup(m2) && x2 && (e6 = true, m2 = T2), this.isValidLookup(m2) || (n3 = true, m2 = s2);
|
|
2151
|
+
let a3 = (i2.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && n3 ? void 0 : m2, c3 = x2 && T2 !== m2 && this.options.updateMissing;
|
|
2152
|
+
if (n3 || e6 || c3) {
|
|
2153
|
+
if (this.logger.log(c3 ? `updateKey` : `missingKey`, d2, l2, b2 && !c3 ? `${s2}${this.pluralResolver.getSuffix(d2, i2.count, i2)}` : s2, c3 ? T2 : m2), o2) {
|
|
2154
|
+
let e8 = this.resolve(s2, { ...i2, keySeparator: false });
|
|
2155
|
+
e8 && e8.res && this.logger.warn(`Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.`);
|
|
2156
|
+
}
|
|
2157
|
+
let e7 = [], t3 = this.languageUtils.getFallbackCodes(this.options.fallbackLng, i2.lng || this.language);
|
|
2158
|
+
if (this.options.saveMissingTo === `fallback` && t3 && t3[0]) for (let n5 = 0; n5 < t3.length; n5++) e7.push(t3[n5]);
|
|
2159
|
+
else this.options.saveMissingTo === `all` ? e7 = this.languageUtils.toResolveHierarchy(i2.lng || this.language) : e7.push(i2.lng || this.language);
|
|
2160
|
+
let n4 = (e8, t4, n5) => {
|
|
2161
|
+
let r3 = x2 && n5 !== m2 ? n5 : a3;
|
|
2162
|
+
this.options.missingKeyHandler ? this.options.missingKeyHandler(e8, l2, t4, r3, c3, i2) : this.backendConnector?.saveMissing && this.backendConnector.saveMissing(e8, l2, t4, r3, c3, i2), this.emit(`missingKey`, e8, l2, t4, m2);
|
|
2163
|
+
};
|
|
2164
|
+
this.options.saveMissing && (this.options.saveMissingPlurals && b2 ? e7.forEach((e8) => {
|
|
2165
|
+
let t4 = this.pluralResolver.getSuffixes(e8, i2);
|
|
2166
|
+
w2 && i2[`defaultValue${this.options.pluralSeparator}zero`] && !t4.includes(`${this.options.pluralSeparator}zero`) && t4.push(`${this.options.pluralSeparator}zero`), t4.forEach((t5) => {
|
|
2167
|
+
n4([e8], s2 + t5, i2[`defaultValue${t5}`] || T2);
|
|
2168
|
+
});
|
|
2169
|
+
}) : n4(e7, s2, T2));
|
|
2170
|
+
}
|
|
2171
|
+
m2 = this.extendTranslation(m2, t2, i2, p2, r2), n3 && m2 === s2 && this.options.appendNamespaceToMissingKey && (m2 = `${l2}${u2}${s2}`), (n3 || e6) && this.options.parseMissingKeyHandler && (m2 = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${l2}${u2}${s2}` : s2, e6 ? m2 : void 0, i2));
|
|
2172
|
+
}
|
|
2173
|
+
return a2 ? (p2.res = m2, p2.usedParams = this.getUsedParamsDetails(i2), p2) : m2;
|
|
2174
|
+
}
|
|
2175
|
+
extendTranslation(e6, t2, n2, r2, i2) {
|
|
2176
|
+
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 });
|
|
2177
|
+
else if (!n2.skipInterpolation) {
|
|
2178
|
+
n2.interpolation && this.interpolator.init({ ...n2, interpolation: { ...this.options.interpolation, ...n2.interpolation } });
|
|
2179
|
+
let a3 = G(e6) && (n2?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : n2.interpolation.skipOnVariables), o3;
|
|
2180
|
+
if (a3) {
|
|
2181
|
+
let t3 = e6.match(this.interpolator.nestingRegexp);
|
|
2182
|
+
o3 = t3 && t3.length;
|
|
2183
|
+
}
|
|
2184
|
+
let s2 = n2.replace && !G(n2.replace) ? n2.replace : n2;
|
|
2185
|
+
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) {
|
|
2186
|
+
let t3 = e6.match(this.interpolator.nestingRegexp), r3 = t3 && t3.length;
|
|
2187
|
+
o3 < r3 && (n2.nest = false);
|
|
2188
|
+
}
|
|
2189
|
+
!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();
|
|
2190
|
+
}
|
|
2191
|
+
let a2 = n2.postProcess || this.options.postProcess, o2 = G(a2) ? [a2] : a2;
|
|
2192
|
+
return e6 != null && o2?.length && n2.applyPostProcessor !== false && (e6 = $a.handle(o2, e6, t2, this.options && this.options.postProcessPassResolved ? { i18nResolved: { ...r2, usedParams: this.getUsedParamsDetails(n2) }, ...n2 } : n2, this)), e6;
|
|
2193
|
+
}
|
|
2194
|
+
resolve(e6, t2 = {}) {
|
|
2195
|
+
let n2, r2, i2, a2, o2;
|
|
2196
|
+
return G(e6) && (e6 = [e6]), Array.isArray(e6) && (e6 = e6.map((e7) => typeof e7 == `function` ? no(e7, { ...this.options, ...t2 }) : e7)), e6.forEach((e7) => {
|
|
2197
|
+
if (this.isValidLookup(n2)) return;
|
|
2198
|
+
let s2 = this.extractFromKey(e7, t2), c2 = s2.key;
|
|
2199
|
+
r2 = c2;
|
|
2200
|
+
let l2 = s2.namespaces;
|
|
2201
|
+
this.options.fallbackNS && (l2 = l2.concat(this.options.fallbackNS));
|
|
2202
|
+
let u2 = t2.count !== void 0 && !G(t2.count), d2 = u2 && !t2.ordinal && t2.count === 0, f2 = t2.context !== void 0 && (G(t2.context) || typeof t2.context == `number`) && t2.context !== ``, p2 = t2.lngs ? t2.lngs : this.languageUtils.toResolveHierarchy(t2.lng || this.language, t2.fallbackLng);
|
|
2203
|
+
l2.forEach((e8) => {
|
|
2204
|
+
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) => {
|
|
2205
|
+
if (this.isValidLookup(n2)) return;
|
|
2206
|
+
a2 = r3;
|
|
2207
|
+
let o3 = [c2];
|
|
2208
|
+
if (this.i18nFormat?.addLookupKeys) this.i18nFormat.addLookupKeys(o3, c2, r3, e8, t2);
|
|
2209
|
+
else {
|
|
2210
|
+
let e9;
|
|
2211
|
+
u2 && (e9 = this.pluralResolver.getSuffix(r3, t2.count, t2));
|
|
2212
|
+
let n3 = `${this.options.pluralSeparator}zero`, i3 = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
|
|
2213
|
+
if (u2 && (t2.ordinal && e9.startsWith(i3) && o3.push(c2 + e9.replace(i3, this.options.pluralSeparator)), o3.push(c2 + e9), d2 && o3.push(c2 + n3)), f2) {
|
|
2214
|
+
let r4 = `${c2}${this.options.contextSeparator || `_`}${t2.context}`;
|
|
2215
|
+
o3.push(r4), u2 && (t2.ordinal && e9.startsWith(i3) && o3.push(r4 + e9.replace(i3, this.options.pluralSeparator)), o3.push(r4 + e9), d2 && o3.push(r4 + n3));
|
|
2216
|
+
}
|
|
2217
|
+
}
|
|
2218
|
+
let s3;
|
|
2219
|
+
for (; s3 = o3.pop(); ) this.isValidLookup(n2) || (i2 = s3, n2 = this.getResource(r3, e8, s3, t2));
|
|
2220
|
+
}));
|
|
2221
|
+
});
|
|
2222
|
+
}), { res: n2, usedKey: r2, exactUsedKey: i2, usedLng: a2, usedNS: o2 };
|
|
2223
|
+
}
|
|
2224
|
+
isValidLookup(e6) {
|
|
2225
|
+
return e6 !== void 0 && !(!this.options.returnNull && e6 === null) && !(!this.options.returnEmptyString && e6 === ``);
|
|
2226
|
+
}
|
|
2227
|
+
getResource(e6, t2, n2, r2 = {}) {
|
|
2228
|
+
return this.i18nFormat?.getResource ? this.i18nFormat.getResource(e6, t2, n2, r2) : this.resourceStore.getResource(e6, t2, n2, r2);
|
|
2229
|
+
}
|
|
2230
|
+
getUsedParamsDetails(e6 = {}) {
|
|
2231
|
+
let t2 = [`defaultValue`, `ordinal`, `context`, `replace`, `lng`, `lngs`, `fallbackLng`, `ns`, `keySeparator`, `nsSeparator`, `returnObjects`, `returnDetails`, `joinArrays`, `postProcess`, `interpolation`], n2 = e6.replace && !G(e6.replace), r2 = n2 ? e6.replace : e6;
|
|
2232
|
+
if (n2 && e6.count !== void 0 && (r2 = { ...r2, count: e6.count }), this.options.interpolation.defaultVariables && (r2 = { ...this.options.interpolation.defaultVariables, ...r2 }), !n2) {
|
|
2233
|
+
r2 = { ...r2 };
|
|
2234
|
+
for (let e7 of t2) delete r2[e7];
|
|
2235
|
+
}
|
|
2236
|
+
return r2;
|
|
2237
|
+
}
|
|
2238
|
+
static hasDefaultValue(e6) {
|
|
2239
|
+
for (let t2 in e6) if (Object.prototype.hasOwnProperty.call(e6, t2) && t2.startsWith(`defaultValue`) && e6[t2] !== void 0) return true;
|
|
2240
|
+
return false;
|
|
2241
|
+
}
|
|
2242
|
+
};
|
|
2243
|
+
var ao = class {
|
|
2244
|
+
constructor(e6) {
|
|
2245
|
+
this.options = e6, this.supportedLngs = this.options.supportedLngs || false, this.logger = q.create(`languageUtils`), this.resolveHierarchyCache = {};
|
|
2246
|
+
}
|
|
2247
|
+
clearCache() {
|
|
2248
|
+
this.resolveHierarchyCache = {};
|
|
2249
|
+
}
|
|
2250
|
+
getScriptPartFromCode(e6) {
|
|
2251
|
+
if (e6 = Ja(e6), !e6 || !e6.includes(`-`)) return null;
|
|
2252
|
+
let t2 = e6.split(`-`);
|
|
2253
|
+
return t2.length === 2 || (t2.pop(), t2[t2.length - 1].toLowerCase() === `x`) ? null : this.formatLanguageCode(t2.join(`-`));
|
|
2254
|
+
}
|
|
2255
|
+
getLanguagePartFromCode(e6) {
|
|
2256
|
+
if (e6 = Ja(e6), !e6 || !e6.includes(`-`)) return e6;
|
|
2257
|
+
let t2 = e6.split(`-`);
|
|
2258
|
+
return this.formatLanguageCode(t2[0]);
|
|
2259
|
+
}
|
|
2260
|
+
formatLanguageCode(e6) {
|
|
2261
|
+
if (G(e6) && e6.includes(`-`)) {
|
|
2262
|
+
let t2;
|
|
2263
|
+
try {
|
|
2264
|
+
t2 = Intl.getCanonicalLocales(e6)[0];
|
|
2265
|
+
} catch {
|
|
2266
|
+
}
|
|
2267
|
+
return t2 && this.options.lowerCaseLng && (t2 = t2.toLowerCase()), t2 || (this.options.lowerCaseLng ? e6.toLowerCase() : e6);
|
|
2268
|
+
}
|
|
2269
|
+
return this.options.cleanCode || this.options.lowerCaseLng ? e6.toLowerCase() : e6;
|
|
2270
|
+
}
|
|
2271
|
+
isSupportedCode(e6) {
|
|
2272
|
+
return (this.options.load === `languageOnly` || this.options.nonExplicitSupportedLngs) && (e6 = this.getLanguagePartFromCode(e6)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.includes(e6);
|
|
2273
|
+
}
|
|
2274
|
+
getBestMatchFromCodes(e6) {
|
|
2275
|
+
if (!e6) return null;
|
|
2276
|
+
let t2;
|
|
2277
|
+
return e6.forEach((e7) => {
|
|
2278
|
+
if (t2) return;
|
|
2279
|
+
let n2 = this.formatLanguageCode(e7);
|
|
2280
|
+
(!this.options.supportedLngs || this.isSupportedCode(n2)) && (t2 = n2);
|
|
2281
|
+
}), !t2 && this.options.supportedLngs && e6.forEach((e7) => {
|
|
2282
|
+
if (t2) return;
|
|
2283
|
+
let n2 = this.getScriptPartFromCode(e7);
|
|
2284
|
+
if (this.isSupportedCode(n2)) return t2 = n2;
|
|
2285
|
+
let r2 = this.getLanguagePartFromCode(e7);
|
|
2286
|
+
if (this.isSupportedCode(r2)) return t2 = r2;
|
|
2287
|
+
t2 = this.options.supportedLngs.find((e8) => e8 === r2 ? true : !e8.includes(`-`) && !r2.includes(`-`) ? false : !!(e8.includes(`-`) && !r2.includes(`-`) && e8.slice(0, e8.indexOf(`-`)) === r2 || e8.startsWith(r2) && r2.length > 1));
|
|
2288
|
+
}), t2 ||= this.getFallbackCodes(this.options.fallbackLng)[0], t2;
|
|
2289
|
+
}
|
|
2290
|
+
getFallbackCodes(e6, t2) {
|
|
2291
|
+
if (!e6) return [];
|
|
2292
|
+
if (typeof e6 == `function` && (e6 = e6(t2)), G(e6) && (e6 = [e6]), Array.isArray(e6)) return e6;
|
|
2293
|
+
if (!t2) return e6.default || [];
|
|
2294
|
+
let n2 = e6[t2];
|
|
2295
|
+
return n2 ||= e6[this.getScriptPartFromCode(t2)], n2 ||= e6[this.formatLanguageCode(t2)], n2 ||= e6[this.getLanguagePartFromCode(t2)], n2 ||= e6.default, n2 || [];
|
|
2296
|
+
}
|
|
2297
|
+
toResolveHierarchy(e6, t2) {
|
|
2298
|
+
let n2 = this.options.fallbackLng, r2 = Array.isArray(n2) ? n2.join(`|`) : n2;
|
|
2299
|
+
r2 !== this._cachedFallbackLng && (this.resolveHierarchyCache = {}, this._cachedFallbackLng = r2);
|
|
2300
|
+
let i2 = t2 === void 0 || t2 === false || G(t2), a2 = t2 === void 0 && typeof this.options.fallbackLng == `function`, o2 = G(e6) && i2 && !a2, s2 = null;
|
|
2301
|
+
if (o2) {
|
|
2302
|
+
let n3;
|
|
2303
|
+
n3 = t2 === void 0 ? `undefined` : t2 === false ? `boolean:false` : `string:${t2}`, s2 = `${e6.length}:${e6}|${n3}`;
|
|
2304
|
+
}
|
|
2305
|
+
if (s2 !== null) {
|
|
2306
|
+
let e7 = this.resolveHierarchyCache[s2];
|
|
2307
|
+
if (e7 !== void 0) return e7.slice();
|
|
2308
|
+
}
|
|
2309
|
+
let c2 = this.getFallbackCodes((t2 === false ? [] : t2) || this.options.fallbackLng || [], e6), l2 = [], u2 = (e7) => {
|
|
2310
|
+
e7 && (this.isSupportedCode(e7) ? l2.push(e7) : this.logger.warn(`rejecting language code not found in supportedLngs: ${e7}`));
|
|
2311
|
+
};
|
|
2312
|
+
return G(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))) : G(e6) && u2(this.formatLanguageCode(e6)), c2.forEach((e7) => {
|
|
2313
|
+
l2.includes(e7) || u2(this.formatLanguageCode(e7));
|
|
2314
|
+
}), s2 === null ? l2 : (this.resolveHierarchyCache[s2] = l2, l2.slice());
|
|
2315
|
+
}
|
|
2316
|
+
};
|
|
2317
|
+
var oo = { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 };
|
|
2318
|
+
var so = { select: (e6) => e6 === 1 ? `one` : `other`, resolvedOptions: () => ({ pluralCategories: [`one`, `other`] }) };
|
|
2319
|
+
var co = class {
|
|
2320
|
+
constructor(e6, t2 = {}) {
|
|
2321
|
+
this.languageUtils = e6, this.options = t2, this.logger = q.create(`pluralResolver`), this.pluralRulesCache = {};
|
|
2322
|
+
}
|
|
2323
|
+
clearCache() {
|
|
2324
|
+
this.pluralRulesCache = {};
|
|
2325
|
+
}
|
|
2326
|
+
getRule(e6, t2 = {}) {
|
|
2327
|
+
let n2 = Ja(e6 === `dev` ? `en` : e6), r2 = t2.ordinal ? `ordinal` : `cardinal`, i2 = JSON.stringify({ cleanedCode: n2, type: r2 });
|
|
2328
|
+
if (i2 in this.pluralRulesCache) return this.pluralRulesCache[i2];
|
|
2329
|
+
let a2;
|
|
2330
|
+
try {
|
|
2331
|
+
a2 = new Intl.PluralRules(n2, { type: r2 });
|
|
2332
|
+
} catch {
|
|
2333
|
+
if (typeof Intl > `u`) return this.logger.error(`No Intl support, please use an Intl polyfill!`), so;
|
|
2334
|
+
if (!e6.match(/-|_/)) return so;
|
|
2335
|
+
let n3 = this.languageUtils.getLanguagePartFromCode(e6);
|
|
2336
|
+
a2 = this.getRule(n3, t2);
|
|
2337
|
+
}
|
|
2338
|
+
return this.pluralRulesCache[i2] = a2, a2;
|
|
2339
|
+
}
|
|
2340
|
+
needsPlural(e6, t2 = {}) {
|
|
2341
|
+
let n2 = this.getRule(e6, t2);
|
|
2342
|
+
return n2 ||= this.getRule(`dev`, t2), n2?.resolvedOptions().pluralCategories.length > 1;
|
|
2343
|
+
}
|
|
2344
|
+
getPluralFormsOfKey(e6, t2, n2 = {}) {
|
|
2345
|
+
return this.getSuffixes(e6, n2).map((e7) => `${t2}${e7}`);
|
|
2346
|
+
}
|
|
2347
|
+
getSuffixes(e6, t2 = {}) {
|
|
2348
|
+
let n2 = this.getRule(e6, t2);
|
|
2349
|
+
return n2 ||= this.getRule(`dev`, t2), n2 ? n2.resolvedOptions().pluralCategories.sort((e7, t3) => oo[e7] - oo[t3]).map((e7) => `${this.options.prepend}${t2.ordinal ? `ordinal${this.options.prepend}` : ``}${e7}`) : [];
|
|
2350
|
+
}
|
|
2351
|
+
getSuffix(e6, t2, n2 = {}) {
|
|
2352
|
+
let r2 = this.getRule(e6, n2);
|
|
2353
|
+
return r2 ? `${this.options.prepend}${n2.ordinal ? `ordinal${this.options.prepend}` : ``}${r2.select(t2)}` : (this.logger.warn(`no plural rule found for: ${e6}`), this.getSuffix(`dev`, t2, n2));
|
|
2354
|
+
}
|
|
2355
|
+
};
|
|
2356
|
+
var lo = (e6, t2, n2, r2 = `.`, i2 = true) => {
|
|
2357
|
+
let a2 = za(e6, t2, n2);
|
|
2358
|
+
return !a2 && i2 && G(n2) && (a2 = qa(e6, n2, r2), a2 === void 0 && (a2 = qa(t2, n2, r2))), a2;
|
|
2359
|
+
};
|
|
2360
|
+
var uo = (e6) => e6.replace(/\$/g, `$$$$`);
|
|
2361
|
+
var fo = class {
|
|
2362
|
+
constructor(e6 = {}) {
|
|
2363
|
+
this.logger = q.create(`interpolator`), this.options = e6, this.format = e6?.interpolation?.format || ((e7) => e7), this.init(e6);
|
|
2364
|
+
}
|
|
2365
|
+
init(e6 = {}) {
|
|
2366
|
+
e6.interpolation ||= { escapeValue: true };
|
|
2367
|
+
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;
|
|
2368
|
+
this.escape = t2 === void 0 ? Ha : t2, this.escapeValue = n2 === void 0 || n2, this.useRawValueToEscape = r2 !== void 0 && r2, this.prefix = i2 ? K(i2) : a2 || `{{`, this.suffix = o2 ? K(o2) : s2 || `}}`, this.formatSeparator = c2 || `,`, this.unescapePrefix = l2 ? `` : u2 ? K(u2) : `-`, this.unescapeSuffix = this.unescapePrefix ? `` : l2 ? K(l2) : ``, this.nestingPrefix = d2 ? K(d2) : f2 || K(`$t(`), this.nestingSuffix = p2 ? K(p2) : m2 || K(`)`), this.nestingOptionsSeparator = h2 || `,`, this.maxReplaces = g2 || 1e3, this.alwaysFormat = _2 !== void 0 && _2, this.resetRegExp();
|
|
2369
|
+
}
|
|
2370
|
+
reset() {
|
|
2371
|
+
this.options && this.init(this.options);
|
|
2372
|
+
}
|
|
2373
|
+
resetRegExp() {
|
|
2374
|
+
let e6 = (e7, t2) => e7?.source === t2 ? (e7.lastIndex = 0, e7) : new RegExp(t2, `g`);
|
|
2375
|
+
this.regexp = e6(this.regexp, `${this.prefix}(.+?)${this.suffix}`), this.regexpUnescape = e6(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`), this.nestingRegexp = e6(this.nestingRegexp, `${this.nestingPrefix}((?:[^()"']|"[^"]*"|'[^']*'|\\((?:[^()"']|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`);
|
|
2376
|
+
}
|
|
2377
|
+
interpolate(e6, t2, n2, r2) {
|
|
2378
|
+
let i2, a2, o2, s2 = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, c2 = (e7) => {
|
|
2379
|
+
if (!e7.includes(this.formatSeparator)) {
|
|
2380
|
+
let i4 = lo(t2, s2, e7, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
2381
|
+
return this.alwaysFormat ? this.format(i4, void 0, n2, { ...r2, ...t2, interpolationkey: e7 }) : i4;
|
|
2382
|
+
}
|
|
2383
|
+
let i3 = e7.split(this.formatSeparator), a3 = i3.shift().trim(), o3 = i3.join(this.formatSeparator).trim();
|
|
2384
|
+
return this.format(lo(t2, s2, a3, this.options.keySeparator, this.options.ignoreJSONStructure), o3, n2, { ...r2, ...t2, interpolationkey: a3 });
|
|
2385
|
+
};
|
|
2386
|
+
this.resetRegExp(), !this.escapeValue && typeof e6 == `string` && /\$t\([^)]*\{[^}]*\{\{/.test(e6) && this.logger.warn(`nesting options string contains interpolated variables with escapeValue: false \u2014 if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.`);
|
|
2387
|
+
let l2 = r2?.missingInterpolationHandler || this.options.missingInterpolationHandler, u2 = r2?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : r2.interpolation.skipOnVariables;
|
|
2388
|
+
return [{ regex: this.regexpUnescape, safeValue: (e7) => e7 }, { regex: this.regexp, safeValue: (e7) => this.escapeValue ? this.escape(e7) : e7 }].forEach((t3) => {
|
|
2389
|
+
for (o2 = 0; i2 = t3.regex.exec(e6); ) {
|
|
2390
|
+
let n3 = i2[1].trim();
|
|
2391
|
+
if (a2 = c2(n3), a2 === void 0) {
|
|
2392
|
+
if (typeof l2 == `function`) {
|
|
2393
|
+
let t4 = l2(e6, i2, r2);
|
|
2394
|
+
a2 = G(t4) ? t4 : ``;
|
|
2395
|
+
} else if (r2 && Object.prototype.hasOwnProperty.call(r2, n3)) a2 = ``;
|
|
2396
|
+
else if (u2) {
|
|
2397
|
+
a2 = i2[0];
|
|
2398
|
+
continue;
|
|
2399
|
+
} else this.logger.warn(`missed to pass in variable ${n3} for interpolating ${e6}`), a2 = ``;
|
|
2400
|
+
} else !G(a2) && !this.useRawValueToEscape && (a2 = Aa(a2));
|
|
2401
|
+
let s3 = t3.safeValue(a2);
|
|
2402
|
+
if (e6 = e6.replace(i2[0], uo(s3)), u2 ? (t3.regex.lastIndex += s3.length, t3.regex.lastIndex -= i2[0].length) : t3.regex.lastIndex = 0, o2++, o2 >= this.maxReplaces) break;
|
|
2403
|
+
}
|
|
2404
|
+
}), e6;
|
|
2405
|
+
}
|
|
2406
|
+
nest(e6, t2, n2 = {}) {
|
|
2407
|
+
let r2, i2, a2, o2 = (e7, t3) => {
|
|
2408
|
+
let n3 = this.nestingOptionsSeparator;
|
|
2409
|
+
if (!e7.includes(n3)) return e7;
|
|
2410
|
+
let r3 = e7.split(RegExp(`${K(n3)}[ ]*{`)), i3 = `{${r3[1]}`;
|
|
2411
|
+
e7 = r3[0], i3 = this.interpolate(i3, a2);
|
|
2412
|
+
let o3 = i3.match(/'/g), s3 = i3.match(/"/g);
|
|
2413
|
+
((o3?.length ?? 0) % 2 == 0 && !s3 || (s3?.length ?? 0) % 2 != 0) && (i3 = i3.replace(/'/g, `"`));
|
|
2414
|
+
try {
|
|
2415
|
+
a2 = JSON.parse(i3), t3 && (a2 = { ...t3, ...a2 });
|
|
2416
|
+
} catch (t4) {
|
|
2417
|
+
return this.logger.warn(`failed parsing options string in nesting for key ${e7}`, t4), `${e7}${n3}${i3}`;
|
|
2418
|
+
}
|
|
2419
|
+
return a2.defaultValue && a2.defaultValue.includes(this.prefix) && delete a2.defaultValue, e7;
|
|
2420
|
+
}, s2 = new RegExp(this.nestingRegexp), c2 = ``, l2 = 0;
|
|
2421
|
+
for (; r2 = s2.exec(e6); ) {
|
|
2422
|
+
let u2 = [];
|
|
2423
|
+
a2 = { ...n2 }, a2 = a2.replace && !G(a2.replace) ? a2.replace : a2, a2.applyPostProcessor = false, delete a2.defaultValue;
|
|
2424
|
+
let d2 = /{.*}/s.test(r2[1]) ? r2[1].lastIndexOf(`}`) + 1 : r2[1].indexOf(this.formatSeparator);
|
|
2425
|
+
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 && !G(i2)) return i2;
|
|
2426
|
+
G(i2) || (i2 = Aa(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) + Aa(i2), l2 = s2.lastIndex, this.regexp.lastIndex = 0;
|
|
2427
|
+
}
|
|
2428
|
+
return l2 ? c2 + e6.slice(l2) : e6;
|
|
2429
|
+
}
|
|
2430
|
+
};
|
|
2431
|
+
var po = (e6) => {
|
|
2432
|
+
let t2 = e6.toLowerCase().trim(), n2 = {};
|
|
2433
|
+
if (e6.includes(`(`)) {
|
|
2434
|
+
let r2 = e6.split(`(`);
|
|
2435
|
+
t2 = r2[0].toLowerCase().trim();
|
|
2436
|
+
let i2 = r2[1].slice(0, -1);
|
|
2437
|
+
t2 === `currency` && !i2.includes(`:`) ? n2.currency ||= i2.trim() : t2 === `relativetime` && !i2.includes(`:`) ? n2.range ||= i2.trim() : i2.split(`;`).forEach((e7) => {
|
|
2438
|
+
if (e7) {
|
|
2439
|
+
let [t3, ...r3] = e7.split(`:`), i3 = r3.join(`:`).trim().replace(/^'+|'+$/g, ``), a2 = t3.trim();
|
|
2440
|
+
n2[a2] || (n2[a2] = i3), i3 === `false` && (n2[a2] = false), i3 === `true` && (n2[a2] = true), isNaN(i3) || (n2[a2] = parseInt(i3, 10));
|
|
2441
|
+
}
|
|
2442
|
+
});
|
|
2443
|
+
}
|
|
2444
|
+
return { formatName: t2, formatOptions: n2 };
|
|
2445
|
+
};
|
|
2446
|
+
var mo = (e6) => {
|
|
2447
|
+
let t2 = {};
|
|
2448
|
+
return (n2, r2, i2) => {
|
|
2449
|
+
let a2 = i2;
|
|
2450
|
+
i2 && i2.interpolationkey && i2.formatParams && i2.formatParams[i2.interpolationkey] && i2[i2.interpolationkey] && (a2 = { ...a2, [i2.interpolationkey]: void 0 });
|
|
2451
|
+
let o2 = r2 + JSON.stringify(a2), s2 = t2[o2];
|
|
2452
|
+
return s2 || (s2 = e6(Ja(r2), i2), t2[o2] = s2), s2(n2);
|
|
2453
|
+
};
|
|
2454
|
+
};
|
|
2455
|
+
var ho = (e6) => (t2, n2, r2) => e6(Ja(n2), r2)(t2);
|
|
2456
|
+
var go = class {
|
|
2457
|
+
constructor(e6 = {}) {
|
|
2458
|
+
this.logger = q.create(`formatter`), this.options = e6, this.init(e6);
|
|
2459
|
+
}
|
|
2460
|
+
init(e6, t2 = { interpolation: {} }) {
|
|
2461
|
+
this.formatSeparator = t2.interpolation.formatSeparator || `,`;
|
|
2462
|
+
let n2 = t2.cacheInBuiltFormats ? mo : ho;
|
|
2463
|
+
this.formats = { number: n2((e7, t3) => {
|
|
2464
|
+
let n3 = new Intl.NumberFormat(e7, { ...t3 });
|
|
2465
|
+
return (e8) => n3.format(e8);
|
|
2466
|
+
}), currency: n2((e7, t3) => {
|
|
2467
|
+
let n3 = new Intl.NumberFormat(e7, { ...t3, style: `currency` });
|
|
2468
|
+
return (e8) => n3.format(e8);
|
|
2469
|
+
}), datetime: n2((e7, t3) => {
|
|
2470
|
+
let n3 = new Intl.DateTimeFormat(e7, { ...t3 });
|
|
2471
|
+
return (e8) => n3.format(e8);
|
|
2472
|
+
}), relativetime: n2((e7, t3) => {
|
|
2473
|
+
let n3 = new Intl.RelativeTimeFormat(e7, { ...t3 });
|
|
2474
|
+
return (e8) => n3.format(e8, t3.range || `day`);
|
|
2475
|
+
}), list: n2((e7, t3) => {
|
|
2476
|
+
let n3 = new Intl.ListFormat(e7, { ...t3 });
|
|
2477
|
+
return (e8) => n3.format(e8);
|
|
2478
|
+
}) };
|
|
2479
|
+
}
|
|
2480
|
+
add(e6, t2) {
|
|
2481
|
+
this.formats[e6.toLowerCase().trim()] = t2;
|
|
2482
|
+
}
|
|
2483
|
+
addCached(e6, t2) {
|
|
2484
|
+
this.formats[e6.toLowerCase().trim()] = mo(t2);
|
|
2485
|
+
}
|
|
2486
|
+
format(e6, t2, n2, r2 = {}) {
|
|
2487
|
+
if (!t2 || e6 == null) return e6;
|
|
2488
|
+
let i2 = t2.split(this.formatSeparator), a2 = [];
|
|
2489
|
+
for (let e7 = 0; e7 < i2.length; e7++) {
|
|
2490
|
+
let t3 = i2[e7];
|
|
2491
|
+
for (; t3.indexOf(`(`) > -1 && !t3.includes(`)`) && e7 + 1 < i2.length; ) t3 = `${t3}${this.formatSeparator}${i2[++e7]}`;
|
|
2492
|
+
a2.push(t3);
|
|
2493
|
+
}
|
|
2494
|
+
return a2.reduce((e7, t3) => {
|
|
2495
|
+
let { formatName: i3, formatOptions: a3 } = po(t3);
|
|
2496
|
+
if (this.formats[i3]) {
|
|
2497
|
+
let t4 = e7;
|
|
2498
|
+
try {
|
|
2499
|
+
let o2 = r2?.formatParams?.[r2.interpolationkey] || {}, s2 = o2.locale || o2.lng || r2.locale || r2.lng || n2;
|
|
2500
|
+
t4 = this.formats[i3](e7, s2, { ...a3, ...r2, ...o2 });
|
|
2501
|
+
} catch (e8) {
|
|
2502
|
+
this.logger.warn(e8);
|
|
2503
|
+
}
|
|
2504
|
+
return t4;
|
|
2505
|
+
}
|
|
2506
|
+
return this.logger.warn(`there was no format function for ${i3}`), e7;
|
|
2507
|
+
}, e6);
|
|
2508
|
+
}
|
|
2509
|
+
};
|
|
2510
|
+
var _o = (e6, t2) => {
|
|
2511
|
+
e6.pending[t2] !== void 0 && (delete e6.pending[t2], e6.pendingCount--);
|
|
2512
|
+
};
|
|
2513
|
+
var vo = class extends Xa {
|
|
2514
|
+
constructor(e6, t2, n2, r2 = {}) {
|
|
2515
|
+
super(), this.backend = e6, this.store = t2, this.services = n2, this.languageUtils = n2.languageUtils, this.options = r2, this.logger = q.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);
|
|
2516
|
+
}
|
|
2517
|
+
queueLoad(e6, t2, n2, r2) {
|
|
2518
|
+
let i2 = {}, a2 = {}, o2 = {}, s2 = {};
|
|
2519
|
+
return e6.forEach((e7) => {
|
|
2520
|
+
let r3 = true;
|
|
2521
|
+
t2.forEach((t3) => {
|
|
2522
|
+
let o3 = `${e7}|${t3}`;
|
|
2523
|
+
!n2.reload && this.store.hasResourceBundle(e7, t3) ? this.state[o3] = 2 : this.state[o3] < 0 || (this.state[o3] === 1 ? a2[o3] === void 0 && (a2[o3] = true) : (this.state[o3] = 1, r3 = false, a2[o3] === void 0 && (a2[o3] = true), i2[o3] === void 0 && (i2[o3] = true), s2[t3] === void 0 && (s2[t3] = true)));
|
|
2524
|
+
}), r3 || (o2[e7] = true);
|
|
2525
|
+
}), (Object.keys(i2).length || Object.keys(a2).length) && this.queue.push({ pending: a2, pendingCount: Object.keys(a2).length, loaded: {}, errors: [], callback: r2 }), { toLoad: Object.keys(i2), pending: Object.keys(a2), toLoadLanguages: Object.keys(o2), toLoadNamespaces: Object.keys(s2) };
|
|
2526
|
+
}
|
|
2527
|
+
loaded(e6, t2, n2) {
|
|
2528
|
+
let r2 = e6.split(`|`), i2 = r2[0], a2 = r2[1];
|
|
2529
|
+
t2 && this.emit(`failedLoading`, i2, a2, t2), !t2 && n2 && this.store.addResourceBundle(i2, a2, n2, void 0, void 0, { skipCopy: true }), this.state[e6] = t2 ? -1 : 2, t2 && n2 && (this.state[e6] = 0);
|
|
2530
|
+
let o2 = {};
|
|
2531
|
+
this.queue.forEach((n3) => {
|
|
2532
|
+
La(n3.loaded, [i2], a2), _o(n3, e6), t2 && n3.errors.push(t2), n3.pendingCount === 0 && !n3.done && (Object.keys(n3.loaded).forEach((e7) => {
|
|
2533
|
+
o2[e7] || (o2[e7] = {});
|
|
2534
|
+
let t3 = n3.loaded[e7];
|
|
2535
|
+
t3.length && t3.forEach((t4) => {
|
|
2536
|
+
o2[e7][t4] === void 0 && (o2[e7][t4] = true);
|
|
2537
|
+
});
|
|
2538
|
+
}), n3.done = true, n3.errors.length ? n3.callback(n3.errors) : n3.callback());
|
|
2539
|
+
}), this.emit(`loaded`, o2), this.queue = this.queue.filter((e7) => !e7.done);
|
|
2540
|
+
}
|
|
2541
|
+
read(e6, t2, n2, r2 = 0, i2 = this.retryTimeout, a2) {
|
|
2542
|
+
if (!e6.length) return a2(null, {});
|
|
2543
|
+
if (this.readingCalls >= this.maxParallelReads) {
|
|
2544
|
+
this.waitingReads.push({ lng: e6, ns: t2, fcName: n2, tried: r2, wait: i2, callback: a2 });
|
|
2545
|
+
return;
|
|
2546
|
+
}
|
|
2547
|
+
this.readingCalls++;
|
|
2548
|
+
let o2 = (o3, s3) => {
|
|
2549
|
+
if (this.readingCalls--, this.waitingReads.length > 0) {
|
|
2550
|
+
let e7 = this.waitingReads.shift();
|
|
2551
|
+
this.read(e7.lng, e7.ns, e7.fcName, e7.tried, e7.wait, e7.callback);
|
|
2552
|
+
}
|
|
2553
|
+
o3 && s3 && r2 < this.maxRetries ? setTimeout(() => {
|
|
2554
|
+
this.read(e6, t2, n2, r2 + 1, i2 * 2, a2);
|
|
2555
|
+
}, i2) : a2(o3, s3);
|
|
2556
|
+
}, s2 = this.backend[n2].bind(this.backend);
|
|
2557
|
+
if (s2.length === 2) try {
|
|
2558
|
+
let n3 = s2(e6, t2);
|
|
2559
|
+
n3 && typeof n3.then == `function` ? n3.then((e7) => o2(null, e7)).catch(o2) : o2(null, n3);
|
|
2560
|
+
} catch (e7) {
|
|
2561
|
+
o2(e7);
|
|
2562
|
+
}
|
|
2563
|
+
else return s2(e6, t2, o2);
|
|
2564
|
+
}
|
|
2565
|
+
prepareLoading(e6, t2, n2 = {}, r2) {
|
|
2566
|
+
if (!this.backend) return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`), r2 && r2();
|
|
2567
|
+
G(e6) && (e6 = this.languageUtils.toResolveHierarchy(e6)), G(t2) && (t2 = [t2]);
|
|
2568
|
+
let i2 = this.queueLoad(e6, t2, n2, r2);
|
|
2569
|
+
if (!i2.toLoad.length) return i2.pending.length || r2(), null;
|
|
2570
|
+
i2.toLoad.forEach((e7) => {
|
|
2571
|
+
this.loadOne(e7);
|
|
2572
|
+
});
|
|
2573
|
+
}
|
|
2574
|
+
load(e6, t2, n2) {
|
|
2575
|
+
this.prepareLoading(e6, t2, {}, n2);
|
|
2576
|
+
}
|
|
2577
|
+
reload(e6, t2, n2) {
|
|
2578
|
+
this.prepareLoading(e6, t2, { reload: true }, n2);
|
|
2579
|
+
}
|
|
2580
|
+
loadOne(e6, t2 = ``) {
|
|
2581
|
+
let n2 = e6.split(`|`), r2 = n2[0], i2 = n2[1];
|
|
2582
|
+
this.read(r2, i2, `read`, void 0, void 0, (n3, a2) => {
|
|
2583
|
+
n3 && this.logger.warn(`${t2}loading namespace ${i2} for language ${r2} failed`, n3), !n3 && a2 && this.logger.log(`${t2}loaded namespace ${i2} for language ${r2}`, a2), this.loaded(e6, n3, a2);
|
|
2584
|
+
});
|
|
2585
|
+
}
|
|
2586
|
+
saveMissing(e6, t2, n2, r2, i2, a2 = {}, o2 = () => {
|
|
2587
|
+
}) {
|
|
2588
|
+
if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(t2)) this.logger.warn(`did not save key "${n2}" as the namespace "${t2}" 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!!!`);
|
|
2589
|
+
else if (n2 != null && n2 !== ``) {
|
|
2590
|
+
if (this.backend?.create) {
|
|
2591
|
+
let s2 = { ...a2, isUpdate: i2 }, c2 = this.backend.create.bind(this.backend);
|
|
2592
|
+
if (c2.length < 6) try {
|
|
2593
|
+
let i3;
|
|
2594
|
+
i3 = c2.length === 5 ? c2(e6, t2, n2, r2, s2) : c2(e6, t2, n2, r2), i3 && typeof i3.then == `function` ? i3.then((e7) => o2(null, e7)).catch(o2) : o2(null, i3);
|
|
2595
|
+
} catch (e7) {
|
|
2596
|
+
o2(e7);
|
|
2597
|
+
}
|
|
2598
|
+
else c2(e6, t2, n2, r2, o2, s2);
|
|
2599
|
+
}
|
|
2600
|
+
e6 && e6[0] && this.store.addResource(e6[0], t2, n2, r2);
|
|
2601
|
+
}
|
|
2602
|
+
}
|
|
2603
|
+
};
|
|
2604
|
+
var yo = () => ({ 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) => {
|
|
2605
|
+
let t2 = {};
|
|
2606
|
+
if (typeof e6[1] == `object` && (t2 = e6[1]), G(e6[1]) && (t2.defaultValue = e6[1]), G(e6[2]) && (t2.tDescription = e6[2]), typeof e6[2] == `object` || typeof e6[3] == `object`) {
|
|
2607
|
+
let n2 = e6[3] || e6[2];
|
|
2608
|
+
Object.keys(n2).forEach((e7) => {
|
|
2609
|
+
t2[e7] = n2[e7];
|
|
2610
|
+
});
|
|
2611
|
+
}
|
|
2612
|
+
return t2;
|
|
2613
|
+
}, interpolation: { escapeValue: true, prefix: `{{`, suffix: `}}`, formatSeparator: `,`, unescapePrefix: `-`, nestingPrefix: `$t(`, nestingSuffix: `)`, nestingOptionsSeparator: `,`, maxReplaces: 1e3, skipOnVariables: true }, cacheInBuiltFormats: true });
|
|
2614
|
+
var bo = (e6) => (G(e6.ns) && (e6.ns = [e6.ns]), G(e6.fallbackLng) && (e6.fallbackLng = [e6.fallbackLng]), G(e6.fallbackNS) && (e6.fallbackNS = [e6.fallbackNS]), e6.supportedLngs && !e6.supportedLngs.includes(`cimode`) && (e6.supportedLngs = e6.supportedLngs.concat([`cimode`])), e6);
|
|
2615
|
+
var xo = () => {
|
|
2616
|
+
};
|
|
2617
|
+
var So = (e6) => {
|
|
2618
|
+
Object.getOwnPropertyNames(Object.getPrototypeOf(e6)).forEach((t2) => {
|
|
2619
|
+
typeof e6[t2] == `function` && (e6[t2] = e6[t2].bind(e6));
|
|
2620
|
+
});
|
|
2621
|
+
};
|
|
2622
|
+
var J = class e4 extends Xa {
|
|
2623
|
+
constructor(e6 = {}, t2) {
|
|
2624
|
+
if (super(), this.options = bo(e6), this.services = {}, this.logger = q, this.modules = { external: [] }, So(this), t2 && !this.isInitialized && !e6.isClone) {
|
|
2625
|
+
if (!this.options.initAsync) return this.init(e6, t2), this;
|
|
2626
|
+
setTimeout(() => {
|
|
2627
|
+
this.init(e6, t2);
|
|
2628
|
+
}, 0);
|
|
2629
|
+
}
|
|
2630
|
+
}
|
|
2631
|
+
init(e6 = {}, t2) {
|
|
2632
|
+
this.isInitializing = true, typeof e6 == `function` && (t2 = e6, e6 = {}), e6.defaultNS == null && e6.ns && (G(e6.ns) ? e6.defaultNS = e6.ns : e6.ns.includes(`translation`) || (e6.defaultNS = e6.ns[0]));
|
|
2633
|
+
let n2 = yo();
|
|
2634
|
+
this.options = { ...n2, ...this.options, ...bo(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);
|
|
2635
|
+
let r2 = (e7) => e7 ? typeof e7 == `function` ? new e7() : e7 : null;
|
|
2636
|
+
if (!this.options.isClone) {
|
|
2637
|
+
this.modules.logger ? q.init(r2(this.modules.logger), this.options) : q.init(null, this.options);
|
|
2638
|
+
let e7;
|
|
2639
|
+
e7 = this.modules.formatter ? this.modules.formatter : go;
|
|
2640
|
+
let t3 = new ao(this.options);
|
|
2641
|
+
this.store = new Qa(this.options.resources, this.options);
|
|
2642
|
+
let n3 = this.services;
|
|
2643
|
+
n3.logger = q, n3.resourceStore = this.store, n3.languageUtils = t3, n3.pluralResolver = new co(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 fo(this.options), n3.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }, n3.backendConnector = new vo(r2(this.modules.backend), n3.resourceStore, n3, this.options), n3.backendConnector.on(`*`, (e8, ...t4) => {
|
|
2644
|
+
this.emit(e8, ...t4);
|
|
2645
|
+
}), 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 io(this.services, this.options), this.translator.on(`*`, (e8, ...t4) => {
|
|
2646
|
+
this.emit(e8, ...t4);
|
|
2647
|
+
}), this.modules.external.forEach((e8) => {
|
|
2648
|
+
e8.init && e8.init(this);
|
|
2649
|
+
});
|
|
2650
|
+
}
|
|
2651
|
+
if (this.format = this.options.interpolation.format, t2 ||= xo, this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
|
|
2652
|
+
let e7 = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
|
|
2653
|
+
e7.length > 0 && e7[0] !== `dev` && (this.options.lng = e7[0]);
|
|
2654
|
+
}
|
|
2655
|
+
!this.services.languageDetector && !this.options.lng && this.logger.warn(`init: no languageDetector is used and no lng is defined`), [`getResource`, `hasResourceBundle`, `getResourceBundle`, `getDataByLanguage`].forEach((e7) => {
|
|
2656
|
+
this[e7] = (...t3) => this.store[e7](...t3);
|
|
2657
|
+
}), [`addResource`, `addResources`, `addResourceBundle`, `removeResourceBundle`].forEach((e7) => {
|
|
2658
|
+
this[e7] = (...t3) => (this.store[e7](...t3), this);
|
|
2659
|
+
});
|
|
2660
|
+
let i2 = ka(), a2 = () => {
|
|
2661
|
+
let e7 = (e8, n3) => {
|
|
2662
|
+
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);
|
|
2663
|
+
};
|
|
2664
|
+
if ((this.languages || this.isLanguageChangingTo) && !this.isInitialized) return e7(null, this.t.bind(this));
|
|
2665
|
+
this.changeLanguage(this.options.lng, e7);
|
|
2666
|
+
};
|
|
2667
|
+
return this.options.resources || !this.options.initAsync ? a2() : setTimeout(a2, 0), i2;
|
|
2668
|
+
}
|
|
2669
|
+
loadResources(e6, t2 = xo) {
|
|
2670
|
+
let n2 = t2, r2 = G(e6) ? e6 : this.language;
|
|
2671
|
+
if (typeof e6 == `function` && (n2 = e6), !this.options.resources || this.options.partialBundledLanguages) {
|
|
2672
|
+
if (r2?.toLowerCase() === `cimode` && (!this.options.preload || this.options.preload.length === 0)) return n2();
|
|
2673
|
+
let e7 = [], t3 = (t4) => {
|
|
2674
|
+
t4 && t4 !== `cimode` && this.services.languageUtils.toResolveHierarchy(t4).forEach((t5) => {
|
|
2675
|
+
t5 !== `cimode` && (e7.includes(t5) || e7.push(t5));
|
|
2676
|
+
});
|
|
2677
|
+
};
|
|
2678
|
+
r2 ? t3(r2) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e8) => t3(e8)), this.options.preload?.forEach?.((e8) => t3(e8)), this.services.backendConnector.load(e7, this.options.ns, (e8) => {
|
|
2679
|
+
!e8 && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), n2(e8);
|
|
2680
|
+
});
|
|
2681
|
+
} else n2(null);
|
|
2682
|
+
}
|
|
2683
|
+
reloadResources(e6, t2, n2) {
|
|
2684
|
+
let r2 = ka();
|
|
2685
|
+
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 ||= xo, this.services.backendConnector.reload(e6, t2, (e7) => {
|
|
2686
|
+
r2.resolve(), n2(e7);
|
|
2687
|
+
}), r2;
|
|
2688
|
+
}
|
|
2689
|
+
use(e6) {
|
|
2690
|
+
if (!e6) throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);
|
|
2691
|
+
if (!e6.type) throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);
|
|
2692
|
+
return e6.type === `backend` && (this.modules.backend = e6), (e6.type === `logger` || e6.log && e6.warn && e6.error) && (this.modules.logger = e6), e6.type === `languageDetector` && (this.modules.languageDetector = e6), e6.type === `i18nFormat` && (this.modules.i18nFormat = e6), e6.type === `postProcessor` && $a.addPostProcessor(e6), e6.type === `formatter` && (this.modules.formatter = e6), e6.type === `3rdParty` && this.modules.external.push(e6), this;
|
|
2693
|
+
}
|
|
2694
|
+
setResolvedLanguage(e6) {
|
|
2695
|
+
if (e6 && this.languages && ![`cimode`, `dev`].includes(e6)) {
|
|
2696
|
+
for (let e7 = 0; e7 < this.languages.length; e7++) {
|
|
2697
|
+
let t2 = this.languages[e7];
|
|
2698
|
+
if (![`cimode`, `dev`].includes(t2) && this.store.hasLanguageSomeTranslations(t2)) {
|
|
2699
|
+
this.resolvedLanguage = t2;
|
|
2700
|
+
break;
|
|
2701
|
+
}
|
|
2702
|
+
}
|
|
2703
|
+
!this.resolvedLanguage && !this.languages.includes(e6) && this.store.hasLanguageSomeTranslations(e6) && (this.resolvedLanguage = e6, this.languages.unshift(e6));
|
|
2704
|
+
}
|
|
2705
|
+
}
|
|
2706
|
+
changeLanguage(e6, t2) {
|
|
2707
|
+
this.isLanguageChangingTo = e6;
|
|
2708
|
+
let n2 = ka();
|
|
2709
|
+
this.emit(`languageChanging`, e6);
|
|
2710
|
+
let r2 = (e7) => {
|
|
2711
|
+
this.language = e7, this.languages = this.services.languageUtils.toResolveHierarchy(e7), this.resolvedLanguage = void 0, this.setResolvedLanguage(e7);
|
|
2712
|
+
}, i2 = (i3, a3) => {
|
|
2713
|
+
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));
|
|
2714
|
+
}, a2 = (t3) => {
|
|
2715
|
+
!e6 && !t3 && this.services.languageDetector && (t3 = []);
|
|
2716
|
+
let n3 = G(t3) ? t3 : t3 && t3[0], a3 = this.store.hasLanguageSomeTranslations(n3) ? n3 : this.services.languageUtils.getBestMatchFromCodes(G(t3) ? [t3] : t3);
|
|
2717
|
+
a3 && (this.language || r2(a3), this.translator.language || this.translator.changeLanguage(a3), this.services.languageDetector?.cacheUserLanguage?.(a3)), this.loadResources(a3, (e7) => {
|
|
2718
|
+
i2(e7, a3);
|
|
2719
|
+
});
|
|
2720
|
+
};
|
|
2721
|
+
return !e6 && this.services.languageDetector && !this.services.languageDetector.async ? a2(this.services.languageDetector.detect()) : !e6 && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(a2) : this.services.languageDetector.detect(a2) : a2(e6), n2;
|
|
2722
|
+
}
|
|
2723
|
+
getFixedT(e6, t2, n2, r2) {
|
|
2724
|
+
let i2 = r2?.scopeNs, a2 = (e7, t3, ...r3) => {
|
|
2725
|
+
let o2;
|
|
2726
|
+
o2 = typeof t3 == `object` ? { ...t3 } : this.options.overloadTranslationOptionHandler([e7, t3].concat(r3)), o2.lng = o2.lng || a2.lng, o2.lngs = o2.lngs || a2.lngs;
|
|
2727
|
+
let s2 = o2.ns !== void 0 && o2.ns !== null;
|
|
2728
|
+
o2.ns = o2.ns || a2.ns, o2.keyPrefix !== `` && (o2.keyPrefix = o2.keyPrefix || n2 || a2.keyPrefix);
|
|
2729
|
+
let c2 = { ...this.options, ...o2 };
|
|
2730
|
+
Array.isArray(i2) && !s2 && (c2.ns = i2), typeof o2.keyPrefix == `function` && (o2.keyPrefix = no(o2.keyPrefix, c2));
|
|
2731
|
+
let l2 = this.options.keySeparator || `.`, u2;
|
|
2732
|
+
return o2.keyPrefix && Array.isArray(e7) ? u2 = e7.map((e8) => (typeof e8 == `function` && (e8 = no(e8, c2)), `${o2.keyPrefix}${l2}${e8}`)) : (typeof e7 == `function` && (e7 = no(e7, c2)), u2 = o2.keyPrefix ? `${o2.keyPrefix}${l2}${e7}` : e7), this.t(u2, o2);
|
|
2733
|
+
};
|
|
2734
|
+
return G(e6) ? a2.lng = e6 : a2.lngs = e6, a2.ns = t2, a2.keyPrefix = n2, a2;
|
|
2735
|
+
}
|
|
2736
|
+
t(...e6) {
|
|
2737
|
+
return this.translator?.translate(...e6);
|
|
2738
|
+
}
|
|
2739
|
+
exists(...e6) {
|
|
2740
|
+
return this.translator?.exists(...e6);
|
|
2741
|
+
}
|
|
2742
|
+
setDefaultNamespace(e6) {
|
|
2743
|
+
this.options.defaultNS = e6;
|
|
2744
|
+
}
|
|
2745
|
+
hasLoadedNamespace(e6, t2 = {}) {
|
|
2746
|
+
if (!this.isInitialized) return this.logger.warn(`hasLoadedNamespace: i18next was not initialized`, this.languages), false;
|
|
2747
|
+
if (!this.languages || !this.languages.length) return this.logger.warn(`hasLoadedNamespace: i18n.languages were undefined or empty`, this.languages), false;
|
|
2748
|
+
let n2 = t2.lng || this.resolvedLanguage || this.languages[0], r2 = this.options ? this.options.fallbackLng : false, i2 = this.languages[this.languages.length - 1];
|
|
2749
|
+
if (n2.toLowerCase() === `cimode`) return true;
|
|
2750
|
+
let a2 = (e7, t3) => {
|
|
2751
|
+
let n3 = this.services.backendConnector.state[`${e7}|${t3}`];
|
|
2752
|
+
return n3 === -1 || n3 === 0 || n3 === 2;
|
|
2753
|
+
};
|
|
2754
|
+
if (t2.precheck) {
|
|
2755
|
+
let e7 = t2.precheck(this, a2);
|
|
2756
|
+
if (e7 !== void 0) return e7;
|
|
2757
|
+
}
|
|
2758
|
+
return !!(this.hasResourceBundle(n2, e6) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a2(n2, e6) && (!r2 || a2(i2, e6)));
|
|
2759
|
+
}
|
|
2760
|
+
loadNamespaces(e6, t2) {
|
|
2761
|
+
let n2 = ka();
|
|
2762
|
+
return this.options.ns ? (G(e6) && (e6 = [e6]), e6.forEach((e7) => {
|
|
2763
|
+
this.options.ns.includes(e7) || this.options.ns.push(e7);
|
|
2764
|
+
}), this.loadResources((e7) => {
|
|
2765
|
+
n2.resolve(), t2 && t2(e7);
|
|
2766
|
+
}), n2) : (t2 && t2(), Promise.resolve());
|
|
2767
|
+
}
|
|
2768
|
+
loadLanguages(e6, t2) {
|
|
2769
|
+
let n2 = ka();
|
|
2770
|
+
G(e6) && (e6 = [e6]);
|
|
2771
|
+
let r2 = this.options.preload || [], i2 = e6.filter((e7) => !r2.includes(e7) && this.services.languageUtils.isSupportedCode(e7));
|
|
2772
|
+
return i2.length ? (this.options.preload = r2.concat(i2), this.loadResources((e7) => {
|
|
2773
|
+
n2.resolve(), t2 && t2(e7);
|
|
2774
|
+
}), n2) : (t2 && t2(), Promise.resolve());
|
|
2775
|
+
}
|
|
2776
|
+
dir(e6) {
|
|
2777
|
+
if (e6 ||= this.resolvedLanguage || (this.languages?.length > 0 ? this.languages[0] : this.language), !e6) return `rtl`;
|
|
2778
|
+
try {
|
|
2779
|
+
let t3 = new Intl.Locale(e6);
|
|
2780
|
+
if (t3 && t3.getTextInfo) {
|
|
2781
|
+
let e7 = t3.getTextInfo();
|
|
2782
|
+
if (e7 && e7.direction) return e7.direction;
|
|
2783
|
+
}
|
|
2784
|
+
} catch {
|
|
2785
|
+
}
|
|
2786
|
+
let t2 = `ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`), n2 = this.services?.languageUtils || new ao(yo());
|
|
2787
|
+
return e6.toLowerCase().indexOf(`-latn`) > 1 ? `ltr` : t2.includes(n2.getLanguagePartFromCode(e6)) || e6.toLowerCase().indexOf(`-arab`) > 1 ? `rtl` : `ltr`;
|
|
2788
|
+
}
|
|
2789
|
+
static createInstance(t2 = {}, n2) {
|
|
2790
|
+
let r2 = new e4(t2, n2);
|
|
2791
|
+
return r2.createInstance = e4.createInstance, r2;
|
|
2792
|
+
}
|
|
2793
|
+
cloneInstance(t2 = {}, n2 = xo) {
|
|
2794
|
+
let r2 = t2.forkResourceStore;
|
|
2795
|
+
r2 && delete t2.forkResourceStore;
|
|
2796
|
+
let i2 = { ...this.options, ...t2, isClone: true }, a2 = new e4(i2);
|
|
2797
|
+
if ((t2.debug !== void 0 || t2.prefix !== void 0) && (a2.logger = a2.logger.clone(t2)), [`store`, `services`, `language`].forEach((e6) => {
|
|
2798
|
+
a2[e6] = this[e6];
|
|
2799
|
+
}), a2.services = { ...this.services }, a2.services.utils = { hasLoadedNamespace: a2.hasLoadedNamespace.bind(a2) }, r2 && (a2.store = new Qa(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) {
|
|
2800
|
+
let e6 = { ...yo().interpolation, ...this.options.interpolation, ...t2.interpolation }, n3 = { ...i2, interpolation: e6 };
|
|
2801
|
+
a2.services.interpolator = new fo(n3);
|
|
2802
|
+
}
|
|
2803
|
+
return a2.translator = new io(a2.services, i2), a2.translator.on(`*`, (e6, ...t3) => {
|
|
2804
|
+
a2.emit(e6, ...t3);
|
|
2805
|
+
}), a2.init(i2, n2), a2.translator.options = i2, a2.translator.backendConnector.services.utils = { hasLoadedNamespace: a2.hasLoadedNamespace.bind(a2) }, a2;
|
|
2806
|
+
}
|
|
2807
|
+
toJSON() {
|
|
2808
|
+
return { options: this.options, store: this.store, language: this.language, languages: this.languages, resolvedLanguage: this.resolvedLanguage };
|
|
2809
|
+
}
|
|
2810
|
+
}.createInstance();
|
|
2811
|
+
J.createInstance, J.dir, J.init, J.loadResources, J.reloadResources, J.use, J.changeLanguage, J.getFixedT, J.t, J.exists, J.setDefaultNamespace, J.hasLoadedNamespace, J.loadNamespaces, J.loadLanguages;
|
|
2812
|
+
var Co = ({ locale: e6, asyncMessagesLoader: t2, messages: n2, useSuspense: r2 = false, disableAutoInit: i2 = false, bindI18n: a2 }, { icu: o2 } = {}) => {
|
|
2813
|
+
let s2 = { lng: e6, fallbackLng: `en`, keySeparator: false, react: { useSuspense: r2, bindI18n: a2 }, _polyfill: { isLoading: false } }, c2 = J.createInstance(i2 ? s2 : void 0);
|
|
2814
|
+
return o2 && c2.use(o2), t2 && c2.use({ type: `backend`, read: async (e7, n3, r3) => {
|
|
2815
|
+
try {
|
|
2816
|
+
return r3(null, await t2(e7));
|
|
2817
|
+
} catch (e8) {
|
|
2818
|
+
return r3(e8, null);
|
|
2819
|
+
}
|
|
2820
|
+
} }), n2 && (s2.resources = { [e6]: { translation: n2 } }), i2 || c2.init(s2), c2;
|
|
2821
|
+
};
|
|
2822
|
+
var wo = [`__proto__`, `constructor`, `prototype`];
|
|
2823
|
+
function To(e6, t2, n2) {
|
|
2824
|
+
function r2(e7) {
|
|
2825
|
+
return e7 && e7.indexOf(`###`) > -1 ? e7.replace(/###/g, `.`) : e7;
|
|
2826
|
+
}
|
|
2827
|
+
function i2() {
|
|
2828
|
+
return !e6 || typeof e6 == `string`;
|
|
2829
|
+
}
|
|
2830
|
+
for (var a2 = typeof t2 == `string` ? t2.split(`.`) : [].concat(t2); a2.length > 1; ) {
|
|
2831
|
+
if (i2()) return {};
|
|
2832
|
+
var o2 = r2(a2.shift());
|
|
2833
|
+
if (wo.indexOf(o2) > -1) return {};
|
|
2834
|
+
!e6[o2] && n2 && (e6[o2] = new n2()), e6 = e6[o2];
|
|
2835
|
+
}
|
|
2836
|
+
if (i2()) return {};
|
|
2837
|
+
var s2 = r2(a2.shift());
|
|
2838
|
+
return wo.indexOf(s2) > -1 ? {} : { obj: e6, k: s2 };
|
|
2839
|
+
}
|
|
2840
|
+
function Eo(e6, t2, n2) {
|
|
2841
|
+
var r2 = To(e6, t2, Object), i2 = r2.obj, a2 = r2.k;
|
|
2842
|
+
i2 !== void 0 && (i2[a2] = n2);
|
|
2843
|
+
}
|
|
2844
|
+
function Do(e6, t2) {
|
|
2845
|
+
var n2 = To(e6, t2), r2 = n2.obj, i2 = n2.k;
|
|
2846
|
+
if (r2) return r2[i2];
|
|
2847
|
+
}
|
|
2848
|
+
var Oo = [];
|
|
2849
|
+
var ko = Oo.forEach;
|
|
2850
|
+
var Ao = Oo.slice;
|
|
2851
|
+
function jo(e6) {
|
|
2852
|
+
return ko.call(Ao.call(arguments, 1), function(t2) {
|
|
2853
|
+
if (t2) for (var n2 = 0, r2 = Object.keys(t2); n2 < r2.length; n2++) {
|
|
2854
|
+
var i2 = r2[n2];
|
|
2855
|
+
wo.indexOf(i2) > -1 || e6[i2] === void 0 && (e6[i2] = t2[i2]);
|
|
2856
|
+
}
|
|
2857
|
+
}), e6;
|
|
2858
|
+
}
|
|
2859
|
+
function Mo(e6, t2) {
|
|
2860
|
+
let n2 = t2 && t2.cache ? t2.cache : Ho, r2 = t2 && t2.serializer ? t2.serializer : Bo;
|
|
2861
|
+
return (t2 && t2.strategy ? t2.strategy : Lo)(e6, { cache: n2, serializer: r2 });
|
|
2862
|
+
}
|
|
2863
|
+
function No(e6) {
|
|
2864
|
+
return e6 == null || typeof e6 == `number` || typeof e6 == `boolean`;
|
|
2865
|
+
}
|
|
2866
|
+
function Po(e6, t2, n2, r2) {
|
|
2867
|
+
let i2 = No(r2) ? r2 : n2(r2), a2 = t2.get(i2);
|
|
2868
|
+
return a2 === void 0 && (a2 = e6.call(this, r2), t2.set(i2, a2)), a2;
|
|
2869
|
+
}
|
|
2870
|
+
function Fo(e6, t2, n2) {
|
|
2871
|
+
let r2 = Array.prototype.slice.call(arguments, 3), i2 = n2(r2), a2 = t2.get(i2);
|
|
2872
|
+
return a2 === void 0 && (a2 = e6.apply(this, r2), t2.set(i2, a2)), a2;
|
|
2873
|
+
}
|
|
2874
|
+
function Io(e6, t2, n2, r2, i2) {
|
|
2875
|
+
return n2.bind(t2, e6, r2, i2);
|
|
2876
|
+
}
|
|
2877
|
+
function Lo(e6, t2) {
|
|
2878
|
+
let n2 = e6.length === 1 ? Po : Fo;
|
|
2879
|
+
return Io(e6, this, n2, t2.cache.create(), t2.serializer);
|
|
2880
|
+
}
|
|
2881
|
+
function Ro(e6, t2) {
|
|
2882
|
+
return Io(e6, this, Fo, t2.cache.create(), t2.serializer);
|
|
2883
|
+
}
|
|
2884
|
+
function zo(e6, t2) {
|
|
2885
|
+
return Io(e6, this, Po, t2.cache.create(), t2.serializer);
|
|
2886
|
+
}
|
|
2887
|
+
var Bo = function() {
|
|
2888
|
+
return JSON.stringify(arguments);
|
|
2889
|
+
};
|
|
2890
|
+
var Vo = class {
|
|
2891
|
+
constructor() {
|
|
2892
|
+
this.cache = /* @__PURE__ */ Object.create(null);
|
|
2893
|
+
}
|
|
2894
|
+
get(e6) {
|
|
2895
|
+
return this.cache[e6];
|
|
2896
|
+
}
|
|
2897
|
+
set(e6, t2) {
|
|
2898
|
+
this.cache[e6] = t2;
|
|
2899
|
+
}
|
|
2900
|
+
};
|
|
2901
|
+
var Ho = { create: function() {
|
|
2902
|
+
return new Vo();
|
|
2903
|
+
} };
|
|
2904
|
+
var Uo = { variadic: Ro, monadic: zo };
|
|
2905
|
+
var Wo = /(?:[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;
|
|
2906
|
+
function Go(e6) {
|
|
2907
|
+
let t2 = {};
|
|
2908
|
+
return e6.replace(Wo, (e7) => {
|
|
2909
|
+
let n2 = e7.length;
|
|
2910
|
+
switch (e7[0]) {
|
|
2911
|
+
case `G`:
|
|
2912
|
+
t2.era = n2 === 4 ? `long` : n2 === 5 ? `narrow` : `short`;
|
|
2913
|
+
break;
|
|
2914
|
+
case `y`:
|
|
2915
|
+
t2.year = n2 === 2 ? `2-digit` : `numeric`;
|
|
2916
|
+
break;
|
|
2917
|
+
case `Y`:
|
|
2918
|
+
case `u`:
|
|
2919
|
+
case `U`:
|
|
2920
|
+
case `r`:
|
|
2921
|
+
throw RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");
|
|
2922
|
+
case `q`:
|
|
2923
|
+
case `Q`:
|
|
2924
|
+
throw RangeError("`q/Q` (quarter) patterns are not supported");
|
|
2925
|
+
case `M`:
|
|
2926
|
+
case `L`:
|
|
2927
|
+
t2.month = [`numeric`, `2-digit`, `short`, `long`, `narrow`][n2 - 1];
|
|
2928
|
+
break;
|
|
2929
|
+
case `w`:
|
|
2930
|
+
case `W`:
|
|
2931
|
+
throw RangeError("`w/W` (week) patterns are not supported");
|
|
2932
|
+
case `d`:
|
|
2933
|
+
t2.day = [`numeric`, `2-digit`][n2 - 1];
|
|
2934
|
+
break;
|
|
2935
|
+
case `D`:
|
|
2936
|
+
case `F`:
|
|
2937
|
+
case `g`:
|
|
2938
|
+
throw RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");
|
|
2939
|
+
case `E`:
|
|
2940
|
+
t2.weekday = n2 === 4 ? `long` : n2 === 5 ? `narrow` : `short`;
|
|
2941
|
+
break;
|
|
2942
|
+
case `e`:
|
|
2943
|
+
if (n2 < 4) throw RangeError("`e..eee` (weekday) patterns are not supported");
|
|
2944
|
+
t2.weekday = [`short`, `long`, `narrow`, `short`][n2 - 3];
|
|
2945
|
+
break;
|
|
2946
|
+
case `c`:
|
|
2947
|
+
if (n2 < 4) throw RangeError("`c..ccc` (weekday) patterns are not supported");
|
|
2948
|
+
t2.weekday = [`short`, `long`, `narrow`, `short`][n2 - 3];
|
|
2949
|
+
break;
|
|
2950
|
+
case `a`:
|
|
2951
|
+
t2.hour12 = true;
|
|
2952
|
+
break;
|
|
2953
|
+
case `b`:
|
|
2954
|
+
case `B`:
|
|
2955
|
+
throw RangeError("`b/B` (period) patterns are not supported, use `a` instead");
|
|
2956
|
+
case `h`:
|
|
2957
|
+
t2.hourCycle = `h12`, t2.hour = [`numeric`, `2-digit`][n2 - 1];
|
|
2958
|
+
break;
|
|
2959
|
+
case `H`:
|
|
2960
|
+
t2.hourCycle = `h23`, t2.hour = [`numeric`, `2-digit`][n2 - 1];
|
|
2961
|
+
break;
|
|
2962
|
+
case `K`:
|
|
2963
|
+
t2.hourCycle = `h11`, t2.hour = [`numeric`, `2-digit`][n2 - 1];
|
|
2964
|
+
break;
|
|
2965
|
+
case `k`:
|
|
2966
|
+
t2.hourCycle = `h24`, t2.hour = [`numeric`, `2-digit`][n2 - 1];
|
|
2967
|
+
break;
|
|
2968
|
+
case `j`:
|
|
2969
|
+
case `J`:
|
|
2970
|
+
case `C`:
|
|
2971
|
+
throw RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");
|
|
2972
|
+
case `m`:
|
|
2973
|
+
t2.minute = [`numeric`, `2-digit`][n2 - 1];
|
|
2974
|
+
break;
|
|
2975
|
+
case `s`:
|
|
2976
|
+
t2.second = [`numeric`, `2-digit`][n2 - 1];
|
|
2977
|
+
break;
|
|
2978
|
+
case `S`:
|
|
2979
|
+
case `A`:
|
|
2980
|
+
throw RangeError("`S/A` (second) patterns are not supported, use `s` instead");
|
|
2981
|
+
case `z`:
|
|
2982
|
+
t2.timeZoneName = n2 < 4 ? `short` : `long`;
|
|
2983
|
+
break;
|
|
2984
|
+
case `Z`:
|
|
2985
|
+
case `O`:
|
|
2986
|
+
case `v`:
|
|
2987
|
+
case `V`:
|
|
2988
|
+
case `X`:
|
|
2989
|
+
case `x`:
|
|
2990
|
+
throw RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead");
|
|
2991
|
+
}
|
|
2992
|
+
return ``;
|
|
2993
|
+
}), t2;
|
|
2994
|
+
}
|
|
2995
|
+
var Ko = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i;
|
|
2996
|
+
function qo(e6) {
|
|
2997
|
+
if (e6.length === 0) throw Error(`Number skeleton cannot be empty`);
|
|
2998
|
+
let t2 = e6.split(Ko).filter((e7) => e7.length > 0), n2 = [];
|
|
2999
|
+
for (let e7 of t2) {
|
|
3000
|
+
let t3 = e7.split(`/`);
|
|
3001
|
+
if (t3.length === 0) throw Error(`Invalid number skeleton`);
|
|
3002
|
+
let [r2, ...i2] = t3;
|
|
3003
|
+
for (let e8 of i2) if (e8.length === 0) throw Error(`Invalid number skeleton`);
|
|
3004
|
+
n2.push({ stem: r2, options: i2 });
|
|
3005
|
+
}
|
|
3006
|
+
return n2;
|
|
3007
|
+
}
|
|
3008
|
+
function Jo(e6) {
|
|
3009
|
+
return e6.replace(/^(.*?)-/, ``);
|
|
3010
|
+
}
|
|
3011
|
+
var Yo = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g;
|
|
3012
|
+
var Xo = /^(@+)?(\+|#+)?[rs]?$/g;
|
|
3013
|
+
var Zo = /(\*)(0+)|(#+)(0+)|(0+)/g;
|
|
3014
|
+
var Qo = /^(0+)$/;
|
|
3015
|
+
function $o(e6) {
|
|
3016
|
+
let t2 = {};
|
|
3017
|
+
return e6[e6.length - 1] === `r` ? t2.roundingPriority = `morePrecision` : e6[e6.length - 1] === `s` && (t2.roundingPriority = `lessPrecision`), e6.replace(Xo, function(e7, n2, r2) {
|
|
3018
|
+
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), ``;
|
|
3019
|
+
}), t2;
|
|
3020
|
+
}
|
|
3021
|
+
function es(e6) {
|
|
3022
|
+
switch (e6) {
|
|
3023
|
+
case `sign-auto`:
|
|
3024
|
+
return { signDisplay: `auto` };
|
|
3025
|
+
case `sign-accounting`:
|
|
3026
|
+
case `()`:
|
|
3027
|
+
return { currencySign: `accounting` };
|
|
3028
|
+
case `sign-always`:
|
|
3029
|
+
case `+!`:
|
|
3030
|
+
return { signDisplay: `always` };
|
|
3031
|
+
case `sign-accounting-always`:
|
|
3032
|
+
case `()!`:
|
|
3033
|
+
return { signDisplay: `always`, currencySign: `accounting` };
|
|
3034
|
+
case `sign-except-zero`:
|
|
3035
|
+
case `+?`:
|
|
3036
|
+
return { signDisplay: `exceptZero` };
|
|
3037
|
+
case `sign-accounting-except-zero`:
|
|
3038
|
+
case `()?`:
|
|
3039
|
+
return { signDisplay: `exceptZero`, currencySign: `accounting` };
|
|
3040
|
+
case `sign-never`:
|
|
3041
|
+
case `+_`:
|
|
3042
|
+
return { signDisplay: `never` };
|
|
3043
|
+
}
|
|
3044
|
+
}
|
|
3045
|
+
function ts(e6) {
|
|
3046
|
+
let t2;
|
|
3047
|
+
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) {
|
|
3048
|
+
let n2 = e6.slice(0, 2);
|
|
3049
|
+
if (n2 === `+!` ? (t2.signDisplay = `always`, e6 = e6.slice(2)) : n2 === `+?` && (t2.signDisplay = `exceptZero`, e6 = e6.slice(2)), !Qo.test(e6)) throw Error(`Malformed concise eng/scientific notation`);
|
|
3050
|
+
t2.minimumIntegerDigits = e6.length;
|
|
3051
|
+
}
|
|
3052
|
+
return t2;
|
|
3053
|
+
}
|
|
3054
|
+
function ns(e6) {
|
|
3055
|
+
return es(e6) || {};
|
|
3056
|
+
}
|
|
3057
|
+
function rs(e6) {
|
|
3058
|
+
let t2 = {};
|
|
3059
|
+
for (let n2 of e6) {
|
|
3060
|
+
switch (n2.stem) {
|
|
3061
|
+
case `percent`:
|
|
3062
|
+
case `%`:
|
|
3063
|
+
t2.style = `percent`;
|
|
3064
|
+
continue;
|
|
3065
|
+
case `%x100`:
|
|
3066
|
+
t2.style = `percent`, t2.scale = 100;
|
|
3067
|
+
continue;
|
|
3068
|
+
case `currency`:
|
|
3069
|
+
t2.style = `currency`, t2.currency = n2.options[0];
|
|
3070
|
+
continue;
|
|
3071
|
+
case `group-off`:
|
|
3072
|
+
case `,_`:
|
|
3073
|
+
t2.useGrouping = false;
|
|
3074
|
+
continue;
|
|
3075
|
+
case `precision-integer`:
|
|
3076
|
+
case `.`:
|
|
3077
|
+
t2.maximumFractionDigits = 0;
|
|
3078
|
+
continue;
|
|
3079
|
+
case `measure-unit`:
|
|
3080
|
+
case `unit`:
|
|
3081
|
+
t2.style = `unit`, t2.unit = Jo(n2.options[0]);
|
|
3082
|
+
continue;
|
|
3083
|
+
case `compact-short`:
|
|
3084
|
+
case `K`:
|
|
3085
|
+
t2.notation = `compact`, t2.compactDisplay = `short`;
|
|
3086
|
+
continue;
|
|
3087
|
+
case `compact-long`:
|
|
3088
|
+
case `KK`:
|
|
3089
|
+
t2.notation = `compact`, t2.compactDisplay = `long`;
|
|
3090
|
+
continue;
|
|
3091
|
+
case `scientific`:
|
|
3092
|
+
t2 = { ...t2, notation: `scientific`, ...n2.options.reduce((e8, t3) => ({ ...e8, ...ns(t3) }), {}) };
|
|
3093
|
+
continue;
|
|
3094
|
+
case `engineering`:
|
|
3095
|
+
t2 = { ...t2, notation: `engineering`, ...n2.options.reduce((e8, t3) => ({ ...e8, ...ns(t3) }), {}) };
|
|
3096
|
+
continue;
|
|
3097
|
+
case `notation-simple`:
|
|
3098
|
+
t2.notation = `standard`;
|
|
3099
|
+
continue;
|
|
3100
|
+
case `unit-width-narrow`:
|
|
3101
|
+
t2.currencyDisplay = `narrowSymbol`, t2.unitDisplay = `narrow`;
|
|
3102
|
+
continue;
|
|
3103
|
+
case `unit-width-short`:
|
|
3104
|
+
t2.currencyDisplay = `code`, t2.unitDisplay = `short`;
|
|
3105
|
+
continue;
|
|
3106
|
+
case `unit-width-full-name`:
|
|
3107
|
+
t2.currencyDisplay = `name`, t2.unitDisplay = `long`;
|
|
3108
|
+
continue;
|
|
3109
|
+
case `unit-width-iso-code`:
|
|
3110
|
+
t2.currencyDisplay = `symbol`;
|
|
3111
|
+
continue;
|
|
3112
|
+
case `scale`:
|
|
3113
|
+
t2.scale = parseFloat(n2.options[0]);
|
|
3114
|
+
continue;
|
|
3115
|
+
case `rounding-mode-floor`:
|
|
3116
|
+
t2.roundingMode = `floor`;
|
|
3117
|
+
continue;
|
|
3118
|
+
case `rounding-mode-ceiling`:
|
|
3119
|
+
t2.roundingMode = `ceil`;
|
|
3120
|
+
continue;
|
|
3121
|
+
case `rounding-mode-down`:
|
|
3122
|
+
t2.roundingMode = `trunc`;
|
|
3123
|
+
continue;
|
|
3124
|
+
case `rounding-mode-up`:
|
|
3125
|
+
t2.roundingMode = `expand`;
|
|
3126
|
+
continue;
|
|
3127
|
+
case `rounding-mode-half-even`:
|
|
3128
|
+
t2.roundingMode = `halfEven`;
|
|
3129
|
+
continue;
|
|
3130
|
+
case `rounding-mode-half-down`:
|
|
3131
|
+
t2.roundingMode = `halfTrunc`;
|
|
3132
|
+
continue;
|
|
3133
|
+
case `rounding-mode-half-up`:
|
|
3134
|
+
t2.roundingMode = `halfExpand`;
|
|
3135
|
+
continue;
|
|
3136
|
+
case `integer-width`:
|
|
3137
|
+
if (n2.options.length > 1) throw RangeError(`integer-width stems only accept a single optional option`);
|
|
3138
|
+
n2.options[0].replace(Zo, function(e8, n3, r3, i2, a2, o2) {
|
|
3139
|
+
if (n3) t2.minimumIntegerDigits = r3.length;
|
|
3140
|
+
else if (i2 && a2) throw Error(`We currently do not support maximum integer digits`);
|
|
3141
|
+
else if (o2) throw Error(`We currently do not support exact integer digits`);
|
|
3142
|
+
return ``;
|
|
3143
|
+
});
|
|
3144
|
+
continue;
|
|
3145
|
+
}
|
|
3146
|
+
if (Qo.test(n2.stem)) {
|
|
3147
|
+
t2.minimumIntegerDigits = n2.stem.length;
|
|
3148
|
+
continue;
|
|
3149
|
+
}
|
|
3150
|
+
if (Yo.test(n2.stem)) {
|
|
3151
|
+
if (n2.options.length > 1) throw RangeError(`Fraction-precision stems only accept a single optional option`);
|
|
3152
|
+
n2.stem.replace(Yo, function(e9, n3, r3, i2, a2, o2) {
|
|
3153
|
+
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), ``;
|
|
3154
|
+
});
|
|
3155
|
+
let e8 = n2.options[0];
|
|
3156
|
+
e8 === `w` ? t2 = { ...t2, trailingZeroDisplay: `stripIfInteger` } : e8 && (t2 = { ...t2, ...$o(e8) });
|
|
3157
|
+
continue;
|
|
3158
|
+
}
|
|
3159
|
+
if (Xo.test(n2.stem)) {
|
|
3160
|
+
t2 = { ...t2, ...$o(n2.stem) };
|
|
3161
|
+
continue;
|
|
3162
|
+
}
|
|
3163
|
+
let e7 = es(n2.stem);
|
|
3164
|
+
e7 && (t2 = { ...t2, ...e7 });
|
|
3165
|
+
let r2 = ts(n2.stem);
|
|
3166
|
+
r2 && (t2 = { ...t2, ...r2 });
|
|
3167
|
+
}
|
|
3168
|
+
return t2;
|
|
3169
|
+
}
|
|
3170
|
+
var is = function(e6) {
|
|
3171
|
+
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;
|
|
3172
|
+
}({});
|
|
3173
|
+
function as(e6) {
|
|
3174
|
+
return e6.type === 0;
|
|
3175
|
+
}
|
|
3176
|
+
function os(e6) {
|
|
3177
|
+
return e6.type === 1;
|
|
3178
|
+
}
|
|
3179
|
+
function ss(e6) {
|
|
3180
|
+
return e6.type === 2;
|
|
3181
|
+
}
|
|
3182
|
+
function cs(e6) {
|
|
3183
|
+
return e6.type === 3;
|
|
3184
|
+
}
|
|
3185
|
+
function ls(e6) {
|
|
3186
|
+
return e6.type === 4;
|
|
3187
|
+
}
|
|
3188
|
+
function us(e6) {
|
|
3189
|
+
return e6.type === 5;
|
|
3190
|
+
}
|
|
3191
|
+
function ds(e6) {
|
|
3192
|
+
return e6.type === 6;
|
|
3193
|
+
}
|
|
3194
|
+
function fs(e6) {
|
|
3195
|
+
return e6.type === 7;
|
|
3196
|
+
}
|
|
3197
|
+
function ps(e6) {
|
|
3198
|
+
return e6.type === 8;
|
|
3199
|
+
}
|
|
3200
|
+
function ms(e6) {
|
|
3201
|
+
return !!(e6 && typeof e6 == `object` && e6.type === 0);
|
|
3202
|
+
}
|
|
3203
|
+
function hs(e6) {
|
|
3204
|
+
return !!(e6 && typeof e6 == `object` && e6.type === 1);
|
|
3205
|
+
}
|
|
3206
|
+
var gs = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/;
|
|
3207
|
+
var _s = { "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`] };
|
|
3208
|
+
function vs(e6, t2) {
|
|
3209
|
+
let n2 = ``;
|
|
3210
|
+
for (let r2 = 0; r2 < e6.length; r2++) {
|
|
3211
|
+
let i2 = e6.charAt(r2);
|
|
3212
|
+
if (i2 === `j`) {
|
|
3213
|
+
let a2 = 0;
|
|
3214
|
+
for (; r2 + 1 < e6.length && e6.charAt(r2 + 1) === i2; ) a2++, r2++;
|
|
3215
|
+
let o2 = 1 + (a2 & 1), s2 = a2 < 2 ? 1 : 3 + (a2 >> 1), c2 = ys(t2);
|
|
3216
|
+
for ((c2 == `H` || c2 == `k`) && (s2 = 0); s2-- > 0; ) n2 += `a`;
|
|
3217
|
+
for (; o2-- > 0; ) n2 = c2 + n2;
|
|
3218
|
+
} else n2 += i2 === `J` ? `H` : i2;
|
|
3219
|
+
}
|
|
3220
|
+
return n2;
|
|
3221
|
+
}
|
|
3222
|
+
function ys(e6) {
|
|
3223
|
+
let t2 = e6.hourCycle;
|
|
3224
|
+
if (t2 === void 0) {
|
|
3225
|
+
let n3 = e6;
|
|
3226
|
+
t2 = n3.getHourCycles?.()[0] ?? n3.hourCycles?.[0];
|
|
3227
|
+
}
|
|
3228
|
+
if (t2) switch (t2) {
|
|
3229
|
+
case `h24`:
|
|
3230
|
+
return `k`;
|
|
3231
|
+
case `h23`:
|
|
3232
|
+
return `H`;
|
|
3233
|
+
case `h12`:
|
|
3234
|
+
return `h`;
|
|
3235
|
+
case `h11`:
|
|
3236
|
+
return `K`;
|
|
3237
|
+
default:
|
|
3238
|
+
throw Error(`Invalid hourCycle`);
|
|
3239
|
+
}
|
|
3240
|
+
let n2 = e6.language, r2;
|
|
3241
|
+
return n2 !== `root` && (r2 = e6.maximize().region), (_s[`${n2}-${r2}`] || _s[r2 || ``] || _s[n2 || ``] || _s[`${n2}-001`] || _s[`001`])[0].charAt(0);
|
|
3242
|
+
}
|
|
3243
|
+
var bs = RegExp(`^${gs.source}*`);
|
|
3244
|
+
var xs = RegExp(`${gs.source}*$`);
|
|
3245
|
+
function Y(e6, t2) {
|
|
3246
|
+
return { start: e6, end: t2 };
|
|
3247
|
+
}
|
|
3248
|
+
var Ss = !!Object.fromEntries;
|
|
3249
|
+
var Cs = !!String.prototype.trimStart;
|
|
3250
|
+
var ws = !!String.prototype.trimEnd;
|
|
3251
|
+
var Ts = Ss ? Object.fromEntries : function(e6) {
|
|
3252
|
+
let t2 = {};
|
|
3253
|
+
for (let [n2, r2] of e6) t2[n2] = r2;
|
|
3254
|
+
return t2;
|
|
3255
|
+
};
|
|
3256
|
+
var Es = Cs ? function(e6) {
|
|
3257
|
+
return e6.trimStart();
|
|
3258
|
+
} : function(e6) {
|
|
3259
|
+
return e6.replace(bs, ``);
|
|
3260
|
+
};
|
|
3261
|
+
var Ds = ws ? function(e6) {
|
|
3262
|
+
return e6.trimEnd();
|
|
3263
|
+
} : function(e6) {
|
|
3264
|
+
return e6.replace(xs, ``);
|
|
3265
|
+
};
|
|
3266
|
+
var Os = RegExp(`([^\\p{White_Space}\\p{Pattern_Syntax}]*)`, `yu`);
|
|
3267
|
+
function ks(e6, t2) {
|
|
3268
|
+
return Os.lastIndex = t2, Os.exec(e6)[1] ?? ``;
|
|
3269
|
+
}
|
|
3270
|
+
function As(e6) {
|
|
3271
|
+
if (e6.length === 0) return null;
|
|
3272
|
+
let t2 = 1, n2 = 1;
|
|
3273
|
+
for (let r2 = 0; r2 < e6.length; ) {
|
|
3274
|
+
let i2 = e6.charCodeAt(r2);
|
|
3275
|
+
switch (i2) {
|
|
3276
|
+
case 35:
|
|
3277
|
+
case 39:
|
|
3278
|
+
case 60:
|
|
3279
|
+
case 123:
|
|
3280
|
+
case 125:
|
|
3281
|
+
return null;
|
|
3282
|
+
}
|
|
3283
|
+
if (i2 === 10) t2++, n2 = 1, r2++;
|
|
3284
|
+
else if (n2++, i2 >= 55296 && i2 <= 56319 && r2 + 1 < e6.length) {
|
|
3285
|
+
let t3 = e6.charCodeAt(r2 + 1);
|
|
3286
|
+
r2 += t3 >= 56320 && t3 <= 57343 ? 2 : 1;
|
|
3287
|
+
} else r2++;
|
|
3288
|
+
}
|
|
3289
|
+
return { offset: e6.length, line: t2, column: n2 };
|
|
3290
|
+
}
|
|
3291
|
+
var js = class {
|
|
3292
|
+
constructor(e6, t2 = {}) {
|
|
3293
|
+
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;
|
|
3294
|
+
}
|
|
3295
|
+
parse() {
|
|
3296
|
+
if (this.offset() !== 0) throw Error(`parser can only be used once`);
|
|
3297
|
+
if (this.message.length > 0) {
|
|
3298
|
+
let e6 = this.message.charCodeAt(0);
|
|
3299
|
+
if (e6 !== 35 && e6 !== 39 && e6 !== 60 && e6 !== 123 && e6 !== 125) {
|
|
3300
|
+
let e7 = As(this.message);
|
|
3301
|
+
if (e7) {
|
|
3302
|
+
let t2 = this.clonePosition();
|
|
3303
|
+
return this.position = e7, { val: [{ type: 0, value: this.message, location: Y(t2, this.clonePosition()) }], err: null };
|
|
3304
|
+
}
|
|
3305
|
+
}
|
|
3306
|
+
}
|
|
3307
|
+
return this.parseMessage(0, ``, false);
|
|
3308
|
+
}
|
|
3309
|
+
parseMessage(e6, t2, n2) {
|
|
3310
|
+
let r2 = [];
|
|
3311
|
+
for (; !this.isEOF(); ) {
|
|
3312
|
+
let i2 = this.char();
|
|
3313
|
+
if (i2 === 123) {
|
|
3314
|
+
let t3 = this.parseArgument(e6, n2);
|
|
3315
|
+
if (t3.err) return t3;
|
|
3316
|
+
r2.push(t3.val);
|
|
3317
|
+
} else if (i2 === 125 && e6 > 0) break;
|
|
3318
|
+
else if (i2 === 35 && (t2 === `plural` || t2 === `selectordinal`)) {
|
|
3319
|
+
let e7 = this.clonePosition();
|
|
3320
|
+
this.bump(), r2.push({ type: 7, location: Y(e7, this.clonePosition()) });
|
|
3321
|
+
} else if (i2 === 60 && !this.ignoreTag && this.peek() === 47) {
|
|
3322
|
+
if (n2) break;
|
|
3323
|
+
return this.error(26, Y(this.clonePosition(), this.clonePosition()));
|
|
3324
|
+
} else if (i2 === 60 && !this.ignoreTag && Ms(this.peek() || 0)) {
|
|
3325
|
+
let n3 = this.parseTag(e6, t2);
|
|
3326
|
+
if (n3.err) return n3;
|
|
3327
|
+
r2.push(n3.val);
|
|
3328
|
+
} else {
|
|
3329
|
+
let n3 = this.parseLiteral(e6, t2);
|
|
3330
|
+
if (n3.err) return n3;
|
|
3331
|
+
r2.push(n3.val);
|
|
3332
|
+
}
|
|
3333
|
+
}
|
|
3334
|
+
return { val: r2, err: null };
|
|
3335
|
+
}
|
|
3336
|
+
parseTag(e6, t2) {
|
|
3337
|
+
let n2 = this.clonePosition();
|
|
3338
|
+
this.bump();
|
|
3339
|
+
let r2 = this.parseTagName();
|
|
3340
|
+
if (this.bumpSpace(), this.bumpIf(`/>`)) return { val: { type: 0, value: `<${r2}/>`, location: Y(n2, this.clonePosition()) }, err: null };
|
|
3341
|
+
if (this.bumpIf(`>`)) {
|
|
3342
|
+
let i2 = this.parseMessage(e6 + 1, t2, true);
|
|
3343
|
+
if (i2.err) return i2;
|
|
3344
|
+
let a2 = i2.val, o2 = this.clonePosition();
|
|
3345
|
+
if (this.bumpIf(`</`)) {
|
|
3346
|
+
if (this.isEOF() || !Ms(this.char())) return this.error(23, Y(o2, this.clonePosition()));
|
|
3347
|
+
let e7 = this.clonePosition();
|
|
3348
|
+
return r2 === this.parseTagName() ? (this.bumpSpace(), this.bumpIf(`>`) ? { val: { type: 8, value: r2, children: a2, location: Y(n2, this.clonePosition()) }, err: null } : this.error(23, Y(o2, this.clonePosition()))) : this.error(26, Y(e7, this.clonePosition()));
|
|
3349
|
+
}
|
|
3350
|
+
return this.error(27, Y(n2, this.clonePosition()));
|
|
3351
|
+
}
|
|
3352
|
+
return this.error(23, Y(n2, this.clonePosition()));
|
|
3353
|
+
}
|
|
3354
|
+
parseTagName() {
|
|
3355
|
+
let e6 = this.offset();
|
|
3356
|
+
for (this.bump(); !this.isEOF() && Ps(this.char()); ) this.bump();
|
|
3357
|
+
return this.message.slice(e6, this.offset());
|
|
3358
|
+
}
|
|
3359
|
+
parseLiteral(e6, t2) {
|
|
3360
|
+
let n2 = this.clonePosition(), r2 = ``;
|
|
3361
|
+
for (; ; ) {
|
|
3362
|
+
let n3 = this.tryParseQuote(t2);
|
|
3363
|
+
if (n3) {
|
|
3364
|
+
r2 += n3;
|
|
3365
|
+
continue;
|
|
3366
|
+
}
|
|
3367
|
+
let i3 = this.tryParseUnquoted(e6, t2);
|
|
3368
|
+
if (i3) {
|
|
3369
|
+
r2 += i3;
|
|
3370
|
+
continue;
|
|
3371
|
+
}
|
|
3372
|
+
let a2 = this.tryParseLeftAngleBracket();
|
|
3373
|
+
if (a2) r2 += a2;
|
|
3374
|
+
else break;
|
|
3375
|
+
}
|
|
3376
|
+
let i2 = Y(n2, this.clonePosition());
|
|
3377
|
+
return { val: { type: 0, value: r2, location: i2 }, err: null };
|
|
3378
|
+
}
|
|
3379
|
+
tryParseLeftAngleBracket() {
|
|
3380
|
+
return !this.isEOF() && this.char() === 60 && (this.ignoreTag || !Ns(this.peek() || 0)) ? (this.bump(), `<`) : null;
|
|
3381
|
+
}
|
|
3382
|
+
tryParseQuote(e6) {
|
|
3383
|
+
if (this.isEOF() || this.char() !== 39) return null;
|
|
3384
|
+
switch (this.peek()) {
|
|
3385
|
+
case 39:
|
|
3386
|
+
return this.bump(), this.bump(), `'`;
|
|
3387
|
+
case 123:
|
|
3388
|
+
case 60:
|
|
3389
|
+
case 62:
|
|
3390
|
+
case 125:
|
|
3391
|
+
break;
|
|
3392
|
+
case 35:
|
|
3393
|
+
if (e6 === `plural` || e6 === `selectordinal`) break;
|
|
3394
|
+
return null;
|
|
3395
|
+
default:
|
|
3396
|
+
return null;
|
|
3397
|
+
}
|
|
3398
|
+
this.bump();
|
|
3399
|
+
let t2 = [this.char()];
|
|
3400
|
+
for (this.bump(); !this.isEOF(); ) {
|
|
3401
|
+
let e7 = this.char();
|
|
3402
|
+
if (e7 === 39) {
|
|
3403
|
+
if (this.peek() === 39) t2.push(39), this.bump();
|
|
3404
|
+
else {
|
|
3405
|
+
this.bump();
|
|
3406
|
+
break;
|
|
3407
|
+
}
|
|
3408
|
+
} else t2.push(e7);
|
|
3409
|
+
this.bump();
|
|
3410
|
+
}
|
|
3411
|
+
return String.fromCodePoint(...t2);
|
|
3412
|
+
}
|
|
3413
|
+
tryParseUnquoted(e6, t2) {
|
|
3414
|
+
if (this.isEOF()) return null;
|
|
3415
|
+
let n2 = this.char();
|
|
3416
|
+
return n2 === 60 || n2 === 123 || n2 === 35 && (t2 === `plural` || t2 === `selectordinal`) || n2 === 125 && e6 > 0 ? null : (this.bump(), String.fromCodePoint(n2));
|
|
3417
|
+
}
|
|
3418
|
+
parseArgument(e6, t2) {
|
|
3419
|
+
let n2 = this.clonePosition();
|
|
3420
|
+
if (this.bump(), this.bumpSpace(), this.isEOF()) return this.error(1, Y(n2, this.clonePosition()));
|
|
3421
|
+
if (this.char() === 125) return this.bump(), this.error(2, Y(n2, this.clonePosition()));
|
|
3422
|
+
let r2 = this.parseIdentifierIfPossible().value;
|
|
3423
|
+
if (!r2) return this.error(3, Y(n2, this.clonePosition()));
|
|
3424
|
+
if (this.bumpSpace(), this.isEOF()) return this.error(1, Y(n2, this.clonePosition()));
|
|
3425
|
+
switch (this.char()) {
|
|
3426
|
+
case 125:
|
|
3427
|
+
return this.bump(), { val: { type: 1, value: r2, location: Y(n2, this.clonePosition()) }, err: null };
|
|
3428
|
+
case 44:
|
|
3429
|
+
return this.bump(), this.bumpSpace(), this.isEOF() ? this.error(1, Y(n2, this.clonePosition())) : this.parseArgumentOptions(e6, t2, r2, n2);
|
|
3430
|
+
default:
|
|
3431
|
+
return this.error(3, Y(n2, this.clonePosition()));
|
|
3432
|
+
}
|
|
3433
|
+
}
|
|
3434
|
+
parseIdentifierIfPossible() {
|
|
3435
|
+
let e6 = this.clonePosition(), t2 = this.offset(), n2 = ks(this.message, t2), r2 = t2 + n2.length;
|
|
3436
|
+
return this.bumpTo(r2), { value: n2, location: Y(e6, this.clonePosition()) };
|
|
3437
|
+
}
|
|
3438
|
+
parseArgumentOptions(e6, t2, n2, r2) {
|
|
3439
|
+
let i2 = this.clonePosition(), a2 = this.parseIdentifierIfPossible().value, o2 = this.clonePosition();
|
|
3440
|
+
switch (a2) {
|
|
3441
|
+
case ``:
|
|
3442
|
+
return this.error(4, Y(i2, o2));
|
|
3443
|
+
case `number`:
|
|
3444
|
+
case `date`:
|
|
3445
|
+
case `time`: {
|
|
3446
|
+
this.bumpSpace();
|
|
3447
|
+
let e7 = null;
|
|
3448
|
+
if (this.bumpIf(`,`)) {
|
|
3449
|
+
this.bumpSpace();
|
|
3450
|
+
let t4 = this.clonePosition(), n3 = this.parseSimpleArgStyleIfPossible();
|
|
3451
|
+
if (n3.err) return n3;
|
|
3452
|
+
let r3 = Ds(n3.val);
|
|
3453
|
+
if (r3.length === 0) return this.error(6, Y(this.clonePosition(), this.clonePosition()));
|
|
3454
|
+
e7 = { style: r3, styleLocation: Y(t4, this.clonePosition()) };
|
|
3455
|
+
}
|
|
3456
|
+
let t3 = this.tryParseArgumentClose(r2);
|
|
3457
|
+
if (t3.err) return t3;
|
|
3458
|
+
let i3 = Y(r2, this.clonePosition());
|
|
3459
|
+
if (e7 && e7.style.startsWith(`::`)) {
|
|
3460
|
+
let t4 = Es(e7.style.slice(2));
|
|
3461
|
+
if (a2 === `number`) {
|
|
3462
|
+
let r3 = this.parseNumberSkeletonFromString(t4, e7.styleLocation);
|
|
3463
|
+
return r3.err ? r3 : { val: { type: 2, value: n2, location: i3, style: r3.val }, err: null };
|
|
3464
|
+
}
|
|
3465
|
+
{
|
|
3466
|
+
if (t4.length === 0) return this.error(10, i3);
|
|
3467
|
+
let r3 = t4;
|
|
3468
|
+
this.locale && (r3 = vs(t4, this.locale));
|
|
3469
|
+
let o3 = { type: 1, pattern: r3, location: e7.styleLocation, parsedOptions: this.shouldParseSkeletons ? Go(r3) : {} };
|
|
3470
|
+
return { val: { type: a2 === `date` ? 3 : 4, value: n2, location: i3, style: o3 }, err: null };
|
|
3471
|
+
}
|
|
3472
|
+
}
|
|
3473
|
+
return { val: { type: a2 === `number` ? 2 : a2 === `date` ? 3 : 4, value: n2, location: i3, style: e7?.style ?? null }, err: null };
|
|
3474
|
+
}
|
|
3475
|
+
case `plural`:
|
|
3476
|
+
case `selectordinal`:
|
|
3477
|
+
case `select`: {
|
|
3478
|
+
let i3 = this.clonePosition();
|
|
3479
|
+
if (this.bumpSpace(), !this.bumpIf(`,`)) return this.error(12, Y(i3, { ...i3 }));
|
|
3480
|
+
this.bumpSpace();
|
|
3481
|
+
let o3 = this.parseIdentifierIfPossible(), s2 = 0;
|
|
3482
|
+
if (a2 !== `select` && o3.value === `offset`) {
|
|
3483
|
+
if (!this.bumpIf(`:`)) return this.error(13, Y(this.clonePosition(), this.clonePosition()));
|
|
3484
|
+
this.bumpSpace();
|
|
3485
|
+
let e7 = this.tryParseDecimalInteger(13, 14);
|
|
3486
|
+
if (e7.err) return e7;
|
|
3487
|
+
this.bumpSpace(), o3 = this.parseIdentifierIfPossible(), s2 = e7.val;
|
|
3488
|
+
}
|
|
3489
|
+
let c2 = this.tryParsePluralOrSelectOptions(e6, a2, t2, o3);
|
|
3490
|
+
if (c2.err) return c2;
|
|
3491
|
+
let l2 = this.tryParseArgumentClose(r2);
|
|
3492
|
+
if (l2.err) return l2;
|
|
3493
|
+
let u2 = Y(r2, this.clonePosition());
|
|
3494
|
+
return a2 === `select` ? { val: { type: 5, value: n2, options: Ts(c2.val), location: u2 }, err: null } : { val: { type: 6, value: n2, options: Ts(c2.val), offset: s2, pluralType: a2 === `plural` ? `cardinal` : `ordinal`, location: u2 }, err: null };
|
|
3495
|
+
}
|
|
3496
|
+
default:
|
|
3497
|
+
return this.error(5, Y(i2, o2));
|
|
3498
|
+
}
|
|
3499
|
+
}
|
|
3500
|
+
tryParseArgumentClose(e6) {
|
|
3501
|
+
return this.isEOF() || this.char() !== 125 ? this.error(1, Y(e6, this.clonePosition())) : (this.bump(), { val: true, err: null });
|
|
3502
|
+
}
|
|
3503
|
+
parseSimpleArgStyleIfPossible() {
|
|
3504
|
+
let e6 = 0, t2 = this.clonePosition();
|
|
3505
|
+
for (; !this.isEOF(); ) switch (this.char()) {
|
|
3506
|
+
case 39: {
|
|
3507
|
+
this.bump();
|
|
3508
|
+
let e7 = this.clonePosition();
|
|
3509
|
+
if (!this.bumpUntil(`'`)) return this.error(11, Y(e7, this.clonePosition()));
|
|
3510
|
+
this.bump();
|
|
3511
|
+
break;
|
|
3512
|
+
}
|
|
3513
|
+
case 123:
|
|
3514
|
+
e6 += 1, this.bump();
|
|
3515
|
+
break;
|
|
3516
|
+
case 125:
|
|
3517
|
+
if (e6 > 0) --e6;
|
|
3518
|
+
else return { val: this.message.slice(t2.offset, this.offset()), err: null };
|
|
3519
|
+
break;
|
|
3520
|
+
default:
|
|
3521
|
+
this.bump();
|
|
3522
|
+
}
|
|
3523
|
+
return { val: this.message.slice(t2.offset, this.offset()), err: null };
|
|
3524
|
+
}
|
|
3525
|
+
parseNumberSkeletonFromString(e6, t2) {
|
|
3526
|
+
let n2 = [];
|
|
3527
|
+
try {
|
|
3528
|
+
n2 = qo(e6);
|
|
3529
|
+
} catch {
|
|
3530
|
+
return this.error(7, t2);
|
|
3531
|
+
}
|
|
3532
|
+
return { val: { type: 0, tokens: n2, location: t2, parsedOptions: this.shouldParseSkeletons ? rs(n2) : {} }, err: null };
|
|
3533
|
+
}
|
|
3534
|
+
tryParsePluralOrSelectOptions(e6, t2, n2, r2) {
|
|
3535
|
+
let i2 = false, a2 = [], o2 = /* @__PURE__ */ new Set(), { value: s2, location: c2 } = r2;
|
|
3536
|
+
for (; ; ) {
|
|
3537
|
+
if (s2.length === 0) {
|
|
3538
|
+
let e7 = this.clonePosition();
|
|
3539
|
+
if (t2 !== `select` && this.bumpIf(`=`)) {
|
|
3540
|
+
let t3 = this.tryParseDecimalInteger(16, 19);
|
|
3541
|
+
if (t3.err) return t3;
|
|
3542
|
+
c2 = Y(e7, this.clonePosition()), s2 = this.message.slice(e7.offset, this.offset());
|
|
3543
|
+
} else break;
|
|
3544
|
+
}
|
|
3545
|
+
if (o2.has(s2)) return this.error(t2 === `select` ? 21 : 20, c2);
|
|
3546
|
+
s2 === `other` && (i2 = true), this.bumpSpace();
|
|
3547
|
+
let r3 = this.clonePosition();
|
|
3548
|
+
if (!this.bumpIf(`{`)) return this.error(t2 === `select` ? 17 : 18, Y(this.clonePosition(), this.clonePosition()));
|
|
3549
|
+
let l2 = this.parseMessage(e6 + 1, t2, n2);
|
|
3550
|
+
if (l2.err) return l2;
|
|
3551
|
+
let u2 = this.tryParseArgumentClose(r3);
|
|
3552
|
+
if (u2.err) return u2;
|
|
3553
|
+
a2.push([s2, { value: l2.val, location: Y(r3, this.clonePosition()) }]), o2.add(s2), this.bumpSpace(), { value: s2, location: c2 } = this.parseIdentifierIfPossible();
|
|
3554
|
+
}
|
|
3555
|
+
return a2.length === 0 ? this.error(t2 === `select` ? 15 : 16, Y(this.clonePosition(), this.clonePosition())) : this.requiresOtherClause && !i2 ? this.error(22, Y(this.clonePosition(), this.clonePosition())) : { val: a2, err: null };
|
|
3556
|
+
}
|
|
3557
|
+
tryParseDecimalInteger(e6, t2) {
|
|
3558
|
+
let n2 = 1, r2 = this.clonePosition();
|
|
3559
|
+
this.bumpIf(`+`) || this.bumpIf(`-`) && (n2 = -1);
|
|
3560
|
+
let i2 = false, a2 = 0;
|
|
3561
|
+
for (; !this.isEOF(); ) {
|
|
3562
|
+
let e7 = this.char();
|
|
3563
|
+
if (e7 >= 48 && e7 <= 57) i2 = true, a2 = a2 * 10 + (e7 - 48), this.bump();
|
|
3564
|
+
else break;
|
|
3565
|
+
}
|
|
3566
|
+
let o2 = Y(r2, this.clonePosition());
|
|
3567
|
+
return i2 ? (a2 *= n2, Number.isSafeInteger(a2) ? { val: a2, err: null } : this.error(t2, o2)) : this.error(e6, o2);
|
|
3568
|
+
}
|
|
3569
|
+
offset() {
|
|
3570
|
+
return this.position.offset;
|
|
3571
|
+
}
|
|
3572
|
+
isEOF() {
|
|
3573
|
+
return this.offset() === this.message.length;
|
|
3574
|
+
}
|
|
3575
|
+
clonePosition() {
|
|
3576
|
+
return { offset: this.position.offset, line: this.position.line, column: this.position.column };
|
|
3577
|
+
}
|
|
3578
|
+
char() {
|
|
3579
|
+
let e6 = this.position.offset;
|
|
3580
|
+
if (e6 >= this.message.length) throw Error(`out of bound`);
|
|
3581
|
+
let t2 = this.message.codePointAt(e6);
|
|
3582
|
+
if (t2 === void 0) throw Error(`Offset ${e6} is at invalid UTF-16 code unit boundary`);
|
|
3583
|
+
return t2;
|
|
3584
|
+
}
|
|
3585
|
+
error(e6, t2) {
|
|
3586
|
+
return { val: null, err: { kind: e6, message: this.message, location: t2 } };
|
|
3587
|
+
}
|
|
3588
|
+
bump() {
|
|
3589
|
+
if (this.isEOF()) return;
|
|
3590
|
+
let e6 = this.char();
|
|
3591
|
+
e6 === 10 ? (this.position.line += 1, this.position.column = 1, this.position.offset += 1) : (this.position.column += 1, this.position.offset += e6 < 65536 ? 1 : 2);
|
|
3592
|
+
}
|
|
3593
|
+
bumpIf(e6) {
|
|
3594
|
+
if (this.message.startsWith(e6, this.offset())) {
|
|
3595
|
+
for (let t2 = 0; t2 < e6.length; t2++) this.bump();
|
|
3596
|
+
return true;
|
|
3597
|
+
}
|
|
3598
|
+
return false;
|
|
3599
|
+
}
|
|
3600
|
+
bumpUntil(e6) {
|
|
3601
|
+
let t2 = this.offset(), n2 = this.message.indexOf(e6, t2);
|
|
3602
|
+
return n2 >= 0 ? (this.bumpTo(n2), true) : (this.bumpTo(this.message.length), false);
|
|
3603
|
+
}
|
|
3604
|
+
bumpTo(e6) {
|
|
3605
|
+
if (this.offset() > e6) throw Error(`targetOffset ${e6} must be greater than or equal to the current offset ${this.offset()}`);
|
|
3606
|
+
for (e6 = Math.min(e6, this.message.length); ; ) {
|
|
3607
|
+
let t2 = this.offset();
|
|
3608
|
+
if (t2 === e6) break;
|
|
3609
|
+
if (t2 > e6) throw Error(`targetOffset ${e6} is at invalid UTF-16 code unit boundary`);
|
|
3610
|
+
if (this.bump(), this.isEOF()) break;
|
|
3611
|
+
}
|
|
3612
|
+
}
|
|
3613
|
+
bumpSpace() {
|
|
3614
|
+
for (; !this.isEOF() && Fs(this.char()); ) this.bump();
|
|
3615
|
+
}
|
|
3616
|
+
peek() {
|
|
3617
|
+
if (this.isEOF()) return null;
|
|
3618
|
+
let e6 = this.char(), t2 = this.offset();
|
|
3619
|
+
return this.message.charCodeAt(t2 + (e6 >= 65536 ? 2 : 1)) ?? null;
|
|
3620
|
+
}
|
|
3621
|
+
};
|
|
3622
|
+
function Ms(e6) {
|
|
3623
|
+
return e6 >= 97 && e6 <= 122 || e6 >= 65 && e6 <= 90;
|
|
3624
|
+
}
|
|
3625
|
+
function Ns(e6) {
|
|
3626
|
+
return Ms(e6) || e6 === 47;
|
|
3627
|
+
}
|
|
3628
|
+
function Ps(e6) {
|
|
3629
|
+
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;
|
|
3630
|
+
}
|
|
3631
|
+
function Fs(e6) {
|
|
3632
|
+
return e6 >= 9 && e6 <= 13 || e6 === 32 || e6 === 133 || e6 >= 8206 && e6 <= 8207 || e6 === 8232 || e6 === 8233;
|
|
3633
|
+
}
|
|
3634
|
+
function Is(e6) {
|
|
3635
|
+
e6.forEach((e7) => {
|
|
3636
|
+
if (delete e7.location, us(e7) || ds(e7)) for (let t2 in e7.options) delete e7.options[t2].location, Is(e7.options[t2].value);
|
|
3637
|
+
else ss(e7) && ms(e7.style) || (cs(e7) || ls(e7)) && hs(e7.style) ? delete e7.style.location : ps(e7) && Is(e7.children);
|
|
3638
|
+
});
|
|
3639
|
+
}
|
|
3640
|
+
function Ls(e6, t2 = {}) {
|
|
3641
|
+
t2 = { shouldParseSkeletons: true, requiresOtherClause: true, ...t2 };
|
|
3642
|
+
let n2 = new js(e6, t2).parse();
|
|
3643
|
+
if (n2.err) {
|
|
3644
|
+
let e7 = SyntaxError(is[n2.err.kind]);
|
|
3645
|
+
throw e7.location = n2.err.location, e7.originalMessage = n2.err.message, e7;
|
|
3646
|
+
}
|
|
3647
|
+
return t2?.captureLocation || Is(n2.val), n2.val;
|
|
3648
|
+
}
|
|
3649
|
+
var Rs = class extends Error {
|
|
3650
|
+
constructor(e6, t2, n2) {
|
|
3651
|
+
super(e6), this.code = t2, this.originalMessage = n2;
|
|
3652
|
+
}
|
|
3653
|
+
toString() {
|
|
3654
|
+
return `[formatjs Error: ${this.code}] ${this.message}`;
|
|
3655
|
+
}
|
|
3656
|
+
};
|
|
3657
|
+
var zs = class extends Rs {
|
|
3658
|
+
constructor(e6, t2, n2, r2) {
|
|
3659
|
+
super(`Invalid values for "${e6}": "${t2}". Options are "${Object.keys(n2).join(`", "`)}"`, `INVALID_VALUE`, r2);
|
|
3660
|
+
}
|
|
3661
|
+
};
|
|
3662
|
+
var Bs = class extends Rs {
|
|
3663
|
+
constructor(e6, t2, n2) {
|
|
3664
|
+
super(`Value for "${e6}" must be of type ${t2}`, `INVALID_VALUE`, n2);
|
|
3665
|
+
}
|
|
3666
|
+
};
|
|
3667
|
+
var Vs = class extends Rs {
|
|
3668
|
+
constructor(e6, t2) {
|
|
3669
|
+
super(`The intl string context variable "${e6}" was not provided to the string "${t2}"`, `MISSING_VALUE`, t2);
|
|
3670
|
+
}
|
|
3671
|
+
};
|
|
3672
|
+
function Hs(e6) {
|
|
3673
|
+
return e6.length < 2 ? e6 : e6.reduce((e7, t2) => {
|
|
3674
|
+
let n2 = e7[e7.length - 1];
|
|
3675
|
+
return !n2 || n2.type !== 0 || t2.type !== 0 ? e7.push(t2) : n2.value += t2.value, e7;
|
|
3676
|
+
}, []);
|
|
3677
|
+
}
|
|
3678
|
+
function Us(e6) {
|
|
3679
|
+
return typeof e6 == `function`;
|
|
3680
|
+
}
|
|
3681
|
+
function Ws(e6, t2, n2, r2, i2, a2, o2) {
|
|
3682
|
+
if (e6.length === 1 && as(e6[0])) return [{ type: 0, value: e6[0].value }];
|
|
3683
|
+
let s2 = [];
|
|
3684
|
+
for (let c2 of e6) {
|
|
3685
|
+
if (as(c2)) {
|
|
3686
|
+
s2.push({ type: 0, value: c2.value });
|
|
3687
|
+
continue;
|
|
3688
|
+
}
|
|
3689
|
+
if (fs(c2)) {
|
|
3690
|
+
typeof a2 == `number` && s2.push({ type: 0, value: n2.getNumberFormat(t2).format(a2) });
|
|
3691
|
+
continue;
|
|
3692
|
+
}
|
|
3693
|
+
let { value: e7 } = c2;
|
|
3694
|
+
if (!(i2 && e7 in i2)) throw new Vs(e7, o2);
|
|
3695
|
+
let l2 = i2[e7];
|
|
3696
|
+
if (os(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 });
|
|
3697
|
+
else if (cs(c2)) {
|
|
3698
|
+
let e8 = typeof c2.style == `string` ? r2.date[c2.style] : hs(c2.style) ? c2.style.parsedOptions : void 0;
|
|
3699
|
+
s2.push({ type: 0, value: n2.getDateTimeFormat(t2, e8).format(l2) });
|
|
3700
|
+
} else if (ls(c2)) {
|
|
3701
|
+
let e8 = typeof c2.style == `string` ? r2.time[c2.style] : hs(c2.style) ? c2.style.parsedOptions : r2.time.medium;
|
|
3702
|
+
s2.push({ type: 0, value: n2.getDateTimeFormat(t2, e8).format(l2) });
|
|
3703
|
+
} else if (ss(c2)) {
|
|
3704
|
+
let e8 = typeof c2.style == `string` ? r2.number[c2.style] : ms(c2.style) ? c2.style.parsedOptions : void 0;
|
|
3705
|
+
if (e8 && e8.scale) {
|
|
3706
|
+
let t3 = e8.scale || 1;
|
|
3707
|
+
if (typeof l2 == `bigint`) {
|
|
3708
|
+
if (!Number.isInteger(t3)) throw TypeError(`Cannot apply fractional scale ${t3} to bigint value. Scale must be an integer when formatting bigint.`);
|
|
3709
|
+
l2 *= BigInt(t3);
|
|
3710
|
+
} else l2 *= t3;
|
|
3711
|
+
}
|
|
3712
|
+
s2.push({ type: 0, value: n2.getNumberFormat(t2, e8).format(l2) });
|
|
3713
|
+
} else {
|
|
3714
|
+
if (ps(c2)) {
|
|
3715
|
+
let { children: e8, value: l3 } = c2, u2 = i2[l3];
|
|
3716
|
+
if (!Us(u2)) throw new Bs(l3, `function`, o2);
|
|
3717
|
+
let d2 = u2(Ws(e8, t2, n2, r2, i2, a2).map((e9) => e9.value));
|
|
3718
|
+
Array.isArray(d2) || (d2 = [d2]), s2.push(...d2.map((e9) => ({ type: typeof e9 == `string` ? 0 : 1, value: e9 })));
|
|
3719
|
+
}
|
|
3720
|
+
if (us(c2)) {
|
|
3721
|
+
let e8 = l2, a3 = (Object.prototype.hasOwnProperty.call(c2.options, e8) ? c2.options[e8] : void 0) || c2.options.other;
|
|
3722
|
+
if (!a3) throw new zs(c2.value, l2, Object.keys(c2.options), o2);
|
|
3723
|
+
s2.push(...Ws(a3.value, t2, n2, r2, i2));
|
|
3724
|
+
} else if (ds(c2)) {
|
|
3725
|
+
let e8 = `=${l2}`, a3 = Object.prototype.hasOwnProperty.call(c2.options, e8) ? c2.options[e8] : void 0;
|
|
3726
|
+
if (!a3) {
|
|
3727
|
+
if (!Intl.PluralRules) throw new Rs(`Intl.PluralRules is not available in this environment.
|
|
3728
|
+
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
3729
|
+
`, `MISSING_INTL_API`, o2);
|
|
3730
|
+
let e9 = typeof l2 == `bigint` ? Number(l2) : l2, r3 = n2.getPluralRules(t2, { type: c2.pluralType }).select(e9 - (c2.offset || 0));
|
|
3731
|
+
a3 = (Object.prototype.hasOwnProperty.call(c2.options, r3) ? c2.options[r3] : void 0) || c2.options.other;
|
|
3732
|
+
}
|
|
3733
|
+
if (!a3) throw new zs(c2.value, l2, Object.keys(c2.options), o2);
|
|
3734
|
+
let u2 = typeof l2 == `bigint` ? Number(l2) : l2;
|
|
3735
|
+
s2.push(...Ws(a3.value, t2, n2, r2, i2, u2 - (c2.offset || 0)));
|
|
3736
|
+
}
|
|
3737
|
+
}
|
|
3738
|
+
}
|
|
3739
|
+
return Hs(s2);
|
|
3740
|
+
}
|
|
3741
|
+
function Gs(e6, t2) {
|
|
3742
|
+
return t2 ? { ...e6, ...t2, ...Object.keys(e6).reduce((n2, r2) => (n2[r2] = { ...e6[r2], ...t2[r2] }, n2), {}) } : e6;
|
|
3743
|
+
}
|
|
3744
|
+
function Ks(e6, t2) {
|
|
3745
|
+
return t2 ? Object.keys(e6).reduce((n2, r2) => (n2[r2] = Gs(e6[r2], t2[r2]), n2), { ...e6 }) : e6;
|
|
3746
|
+
}
|
|
3747
|
+
function qs(e6) {
|
|
3748
|
+
return { create() {
|
|
3749
|
+
return { get(t2) {
|
|
3750
|
+
return e6[t2];
|
|
3751
|
+
}, set(t2, n2) {
|
|
3752
|
+
e6[t2] = n2;
|
|
3753
|
+
} };
|
|
3754
|
+
} };
|
|
3755
|
+
}
|
|
3756
|
+
function Js(e6 = { number: {}, dateTime: {}, pluralRules: {} }) {
|
|
3757
|
+
return { getNumberFormat: Mo((...e7) => new Intl.NumberFormat(...e7), { cache: qs(e6.number), strategy: Uo.variadic }), getDateTimeFormat: Mo((...e7) => new Intl.DateTimeFormat(...e7), { cache: qs(e6.dateTime), strategy: Uo.variadic }), getPluralRules: Mo((...e7) => new Intl.PluralRules(...e7), { cache: qs(e6.pluralRules), strategy: Uo.variadic }) };
|
|
3758
|
+
}
|
|
3759
|
+
var Ys = class e5 {
|
|
3760
|
+
constructor(t2, n2 = e5.defaultLocale, r2, i2) {
|
|
3761
|
+
if (this.formatterCache = { number: {}, dateTime: {}, pluralRules: {} }, this.format = (e6) => {
|
|
3762
|
+
let t3 = this.formatToParts(e6);
|
|
3763
|
+
if (t3.length === 1) return t3[0].value;
|
|
3764
|
+
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), []);
|
|
3765
|
+
return n3.length <= 1 ? n3[0] || `` : n3;
|
|
3766
|
+
}, this.formatToParts = (e6) => Ws(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`) {
|
|
3767
|
+
if (this.message = t2, !e5.__parse) throw TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
|
|
3768
|
+
let { ...n3 } = i2 || {};
|
|
3769
|
+
this.ast = e5.__parse(t2, { ...n3, locale: this.resolvedLocale });
|
|
3770
|
+
} else this.ast = t2;
|
|
3771
|
+
if (!Array.isArray(this.ast)) throw TypeError(`A message must be provided as a String or AST.`);
|
|
3772
|
+
this.formats = Ks(e5.formats, r2), this.formatters = i2 && i2.formatters || Js(this.formatterCache);
|
|
3773
|
+
}
|
|
3774
|
+
static {
|
|
3775
|
+
this.memoizedDefaultLocale = null;
|
|
3776
|
+
}
|
|
3777
|
+
static get defaultLocale() {
|
|
3778
|
+
return e5.memoizedDefaultLocale ||= new Intl.NumberFormat().resolvedOptions().locale, e5.memoizedDefaultLocale;
|
|
3779
|
+
}
|
|
3780
|
+
static {
|
|
3781
|
+
this.resolveLocale = (e6) => {
|
|
3782
|
+
if (Intl.Locale === void 0) return;
|
|
3783
|
+
let t2 = Intl.NumberFormat.supportedLocalesOf(e6);
|
|
3784
|
+
return t2.length > 0 ? new Intl.Locale(t2[0]) : new Intl.Locale(typeof e6 == `string` ? e6 : e6[0]);
|
|
3785
|
+
};
|
|
3786
|
+
}
|
|
3787
|
+
static {
|
|
3788
|
+
this.__parse = Ls;
|
|
3789
|
+
}
|
|
3790
|
+
static {
|
|
3791
|
+
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` } } };
|
|
3792
|
+
}
|
|
3793
|
+
};
|
|
3794
|
+
function Xs(e6, t2) {
|
|
3795
|
+
return tc(e6) || ec(e6, t2) || Qs(e6, t2) || Zs();
|
|
3796
|
+
}
|
|
3797
|
+
function Zs() {
|
|
3798
|
+
throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3799
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
3800
|
+
}
|
|
3801
|
+
function Qs(e6, t2) {
|
|
3802
|
+
if (e6) {
|
|
3803
|
+
if (typeof e6 == `string`) return $s(e6, t2);
|
|
3804
|
+
var n2 = {}.toString.call(e6).slice(8, -1);
|
|
3805
|
+
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) ? $s(e6, t2) : void 0;
|
|
3806
|
+
}
|
|
3807
|
+
}
|
|
3808
|
+
function $s(e6, t2) {
|
|
3809
|
+
(t2 == null || t2 > e6.length) && (t2 = e6.length);
|
|
3810
|
+
for (var n2 = 0, r2 = Array(t2); n2 < t2; n2++) r2[n2] = e6[n2];
|
|
3811
|
+
return r2;
|
|
3812
|
+
}
|
|
3813
|
+
function ec(e6, t2) {
|
|
3814
|
+
var n2 = e6 == null ? null : typeof Symbol < `u` && e6[Symbol.iterator] || e6[`@@iterator`];
|
|
3815
|
+
if (n2 != null) {
|
|
3816
|
+
var r2, i2, a2, o2, s2 = [], c2 = true, l2 = false;
|
|
3817
|
+
try {
|
|
3818
|
+
if (a2 = (n2 = n2.call(e6)).next, t2 === 0) {
|
|
3819
|
+
if (Object(n2) !== n2) return;
|
|
3820
|
+
c2 = false;
|
|
3821
|
+
} else for (; !(c2 = (r2 = a2.call(n2)).done) && (s2.push(r2.value), s2.length !== t2); c2 = true) ;
|
|
3822
|
+
} catch (e7) {
|
|
3823
|
+
l2 = true, i2 = e7;
|
|
3824
|
+
} finally {
|
|
3825
|
+
try {
|
|
3826
|
+
if (!c2 && n2.return != null && (o2 = n2.return(), Object(o2) !== o2)) return;
|
|
3827
|
+
} finally {
|
|
3828
|
+
if (l2) throw i2;
|
|
3829
|
+
}
|
|
3830
|
+
}
|
|
3831
|
+
return s2;
|
|
3832
|
+
}
|
|
3833
|
+
}
|
|
3834
|
+
function tc(e6) {
|
|
3835
|
+
if (Array.isArray(e6)) return e6;
|
|
3836
|
+
}
|
|
3837
|
+
function nc(e6) {
|
|
3838
|
+
"@babel/helpers - typeof";
|
|
3839
|
+
return nc = typeof Symbol == `function` && typeof Symbol.iterator == `symbol` ? function(e7) {
|
|
3840
|
+
return typeof e7;
|
|
3841
|
+
} : function(e7) {
|
|
3842
|
+
return e7 && typeof Symbol == `function` && e7.constructor === Symbol && e7 !== Symbol.prototype ? `symbol` : typeof e7;
|
|
3843
|
+
}, nc(e6);
|
|
3844
|
+
}
|
|
3845
|
+
function rc(e6, t2) {
|
|
3846
|
+
var n2 = Object.keys(e6);
|
|
3847
|
+
if (Object.getOwnPropertySymbols) {
|
|
3848
|
+
var r2 = Object.getOwnPropertySymbols(e6);
|
|
3849
|
+
t2 && (r2 = r2.filter(function(t3) {
|
|
3850
|
+
return Object.getOwnPropertyDescriptor(e6, t3).enumerable;
|
|
3851
|
+
})), n2.push.apply(n2, r2);
|
|
3852
|
+
}
|
|
3853
|
+
return n2;
|
|
3854
|
+
}
|
|
3855
|
+
function ic(e6) {
|
|
3856
|
+
for (var t2 = 1; t2 < arguments.length; t2++) {
|
|
3857
|
+
var n2 = arguments[t2] == null ? {} : arguments[t2];
|
|
3858
|
+
t2 % 2 ? rc(Object(n2), true).forEach(function(t3) {
|
|
3859
|
+
ac(e6, t3, n2[t3]);
|
|
3860
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e6, Object.getOwnPropertyDescriptors(n2)) : rc(Object(n2)).forEach(function(t3) {
|
|
3861
|
+
Object.defineProperty(e6, t3, Object.getOwnPropertyDescriptor(n2, t3));
|
|
3862
|
+
});
|
|
3863
|
+
}
|
|
3864
|
+
return e6;
|
|
3865
|
+
}
|
|
3866
|
+
function ac(e6, t2, n2) {
|
|
3867
|
+
return (t2 = lc(t2)) in e6 ? Object.defineProperty(e6, t2, { value: n2, enumerable: true, configurable: true, writable: true }) : e6[t2] = n2, e6;
|
|
3868
|
+
}
|
|
3869
|
+
function oc(e6, t2) {
|
|
3870
|
+
if (!(e6 instanceof t2)) throw TypeError(`Cannot call a class as a function`);
|
|
3871
|
+
}
|
|
3872
|
+
function sc(e6, t2) {
|
|
3873
|
+
for (var n2 = 0; n2 < t2.length; n2++) {
|
|
3874
|
+
var r2 = t2[n2];
|
|
3875
|
+
r2.enumerable = r2.enumerable || false, r2.configurable = true, `value` in r2 && (r2.writable = true), Object.defineProperty(e6, lc(r2.key), r2);
|
|
3876
|
+
}
|
|
3877
|
+
}
|
|
3878
|
+
function cc(e6, t2, n2) {
|
|
3879
|
+
return t2 && sc(e6.prototype, t2), n2 && sc(e6, n2), Object.defineProperty(e6, "prototype", { writable: false }), e6;
|
|
3880
|
+
}
|
|
3881
|
+
function lc(e6) {
|
|
3882
|
+
var t2 = uc(e6, `string`);
|
|
3883
|
+
return nc(t2) == `symbol` ? t2 : t2 + ``;
|
|
3884
|
+
}
|
|
3885
|
+
function uc(e6, t2) {
|
|
3886
|
+
if (nc(e6) != `object` || !e6) return e6;
|
|
3887
|
+
var n2 = e6[Symbol.toPrimitive];
|
|
3888
|
+
if (n2 !== void 0) {
|
|
3889
|
+
var r2 = n2.call(e6, t2 || `default`);
|
|
3890
|
+
if (nc(r2) != `object`) return r2;
|
|
3891
|
+
throw TypeError(`@@toPrimitive must return a primitive value.`);
|
|
3892
|
+
}
|
|
3893
|
+
return (t2 === `string` ? String : Number)(e6);
|
|
3894
|
+
}
|
|
3895
|
+
function dc() {
|
|
3896
|
+
return { memoize: true, memoizeFallback: false, bindI18n: ``, bindI18nStore: ``, parseErrorHandler: function(e6, t2, n2, r2) {
|
|
3897
|
+
return n2;
|
|
3898
|
+
}, parseLngForICU: function(e6) {
|
|
3899
|
+
return e6;
|
|
3900
|
+
}, escapeVariables: false };
|
|
3901
|
+
}
|
|
3902
|
+
var fc = function() {
|
|
3903
|
+
function e6(t2) {
|
|
3904
|
+
oc(this, e6), this.type = `i18nFormat`, this.mem = {}, this.init(null, t2);
|
|
3905
|
+
}
|
|
3906
|
+
return cc(e6, [{ key: `init`, value: function(e7, t2) {
|
|
3907
|
+
var n2 = this, r2 = e7 && e7.options && e7.options.i18nFormat || {};
|
|
3908
|
+
if (this.options = jo(r2, t2, this.options || {}, dc()), this.formats = this.options.formats, e7) {
|
|
3909
|
+
var i2 = this.options, a2 = i2.bindI18n, o2 = i2.bindI18nStore, s2 = i2.memoize;
|
|
3910
|
+
e7.IntlMessageFormat = Ys, e7.ICU = this, s2 && (a2 && e7.on(a2, function() {
|
|
3911
|
+
return n2.clearCache();
|
|
3912
|
+
}), o2 && e7.store.on(o2, function() {
|
|
3913
|
+
return n2.clearCache();
|
|
3914
|
+
}));
|
|
3915
|
+
}
|
|
3916
|
+
} }, { key: `addUserDefinedFormats`, value: function(e7) {
|
|
3917
|
+
this.formats = this.formats ? ic(ic({}, this.formats), e7) : e7;
|
|
3918
|
+
} }, { key: `parse`, value: function(e7, t2, n2, r2, i2, a2) {
|
|
3919
|
+
var o2 = a2 && a2.resolved && a2.resolved.res, s2 = this.options.memoize && `${n2}.${r2}.${i2.replace(/\./g, `###`)}`, c2;
|
|
3920
|
+
this.options.memoize && (c2 = Do(this.mem, s2));
|
|
3921
|
+
try {
|
|
3922
|
+
return c2 || (c2 = new Ys(e7, this.options.parseLngForICU(n2), this.formats, { ignoreTag: true }), this.options.memoize && (this.options.memoizeFallback || !a2 || o2) && Eo(this.mem, s2, c2)), c2.format(this.escapeVariableValues(t2));
|
|
3923
|
+
} catch (n3) {
|
|
3924
|
+
return this.options.parseErrorHandler(n3, i2, e7, t2);
|
|
3925
|
+
}
|
|
3926
|
+
} }, { key: `addLookupKeys`, value: function(e7, t2, n2, r2, i2) {
|
|
3927
|
+
return e7;
|
|
3928
|
+
} }, { key: `clearCache`, value: function() {
|
|
3929
|
+
this.mem = {};
|
|
3930
|
+
} }, { key: `escapeVariableValues`, value: function(e7) {
|
|
3931
|
+
if (!this.options.escapeVariables || !e7 || nc(e7) !== `object`) return e7;
|
|
3932
|
+
for (var t2 = {}, n2 = 0, r2 = Object.entries(e7); n2 < r2.length; n2++) {
|
|
3933
|
+
var i2 = Xs(r2[n2], 2), a2 = i2[0], o2 = i2[1];
|
|
3934
|
+
t2[a2] = typeof o2 == `string` ? o2.replace(/&/g, `&`).replace(/</g, `<`).replace(/>/g, `>`).replace(/"/g, `"`).replace(/'/g, `'`) : o2;
|
|
3935
|
+
}
|
|
3936
|
+
return t2;
|
|
3937
|
+
} }]), e6;
|
|
3938
|
+
}();
|
|
3939
|
+
fc.type = `i18nFormat`;
|
|
3940
|
+
function pc({ icuOptions: e6 = {}, ...t2 }) {
|
|
3941
|
+
let { parseErrorHandler: n2 = void 0 } = t2;
|
|
3942
|
+
return Co(t2, { icu: new fc({ parseErrorHandler: n2, bindI18n: t2.bindI18n, ...e6 }) });
|
|
3943
|
+
}
|
|
3944
|
+
var mc = (e6, t2, n2, r2) => {
|
|
3945
|
+
let i2 = [n2, { code: t2, ...r2 || {} }];
|
|
3946
|
+
if (e6?.services?.logger?.forward) return e6.services.logger.forward(i2, `warn`, `react-i18next::`, true);
|
|
3947
|
+
X(i2[0]) && (i2[0] = `react-i18next:: ${i2[0]}`), e6?.services?.logger?.warn ? e6.services.logger.warn(...i2) : console?.warn && console.warn(...i2);
|
|
3948
|
+
};
|
|
3949
|
+
var hc = {};
|
|
3950
|
+
var gc = (e6, t2, n2, r2) => {
|
|
3951
|
+
X(n2) && hc[n2] || (X(n2) && (hc[n2] = /* @__PURE__ */ new Date()), mc(e6, t2, n2, r2));
|
|
3952
|
+
};
|
|
3953
|
+
var _c = (e6, t2) => () => {
|
|
3954
|
+
if (e6.isInitialized) t2();
|
|
3955
|
+
else {
|
|
3956
|
+
let n2 = () => {
|
|
3957
|
+
setTimeout(() => {
|
|
3958
|
+
e6.off(`initialized`, n2);
|
|
3959
|
+
}, 0), t2();
|
|
3960
|
+
};
|
|
3961
|
+
e6.on(`initialized`, n2);
|
|
3962
|
+
}
|
|
3963
|
+
};
|
|
3964
|
+
var vc = (e6, t2, n2) => {
|
|
3965
|
+
e6.loadNamespaces(t2, _c(e6, n2));
|
|
3966
|
+
};
|
|
3967
|
+
var yc = (e6, t2, n2, r2) => {
|
|
3968
|
+
if (X(n2) && (n2 = [n2]), e6.options.preload && e6.options.preload.indexOf(t2) > -1) return vc(e6, n2, r2);
|
|
3969
|
+
n2.forEach((t3) => {
|
|
3970
|
+
e6.options.ns.indexOf(t3) < 0 && e6.options.ns.push(t3);
|
|
3971
|
+
}), e6.loadLanguages(t2, _c(e6, r2));
|
|
3972
|
+
};
|
|
3973
|
+
var bc = (e6, t2, n2 = {}) => !t2.languages || !t2.languages.length ? (gc(t2, `NO_LANGUAGES`, `i18n.languages were undefined or empty`, { languages: t2.languages }), true) : t2.hasLoadedNamespace(e6, { lng: n2.lng, precheck: (t3, r2) => {
|
|
3974
|
+
if (n2.bindI18n && n2.bindI18n.indexOf(`languageChanging`) > -1 && t3.services.backendConnector.backend && t3.isLanguageChangingTo && !r2(t3.isLanguageChangingTo, e6)) return false;
|
|
3975
|
+
} });
|
|
3976
|
+
var X = (e6) => typeof e6 == `string`;
|
|
3977
|
+
var xc = (e6) => typeof e6 == `object` && !!e6;
|
|
3978
|
+
var Sc = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
|
|
3979
|
+
var Cc = { "&": `&`, "&": `&`, "<": `<`, "<": `<`, ">": `>`, ">": `>`, "'": `'`, "'": `'`, """: `"`, """: `"`, " ": ` `, " ": ` `, "©": `\xA9`, "©": `\xA9`, "®": `\xAE`, "®": `\xAE`, "…": `\u2026`, "…": `\u2026`, "/": `/`, "/": `/` };
|
|
3980
|
+
var wc = (e6) => Cc[e6];
|
|
3981
|
+
var Tc = { bindI18n: `languageChanged`, bindI18nStore: ``, transEmptyNodeValue: ``, transSupportBasicHtmlNodes: true, transWrapTextNodes: ``, transKeepBasicHtmlNodesFor: [`br`, `strong`, `i`, `p`], useSuspense: true, unescape: (e6) => e6.replace(Sc, wc) };
|
|
3982
|
+
var Ec = () => Tc;
|
|
3983
|
+
var Dc;
|
|
3984
|
+
var Oc = () => Dc;
|
|
3985
|
+
var kc = n();
|
|
3986
|
+
var Ac = class {
|
|
3987
|
+
constructor() {
|
|
3988
|
+
this.usedNamespaces = {};
|
|
3989
|
+
}
|
|
3990
|
+
addUsedNamespaces(e6) {
|
|
3991
|
+
e6.forEach((e7) => {
|
|
3992
|
+
this.usedNamespaces[e7] || (this.usedNamespaces[e7] = true);
|
|
3993
|
+
});
|
|
3994
|
+
}
|
|
3995
|
+
getUsedNamespaces() {
|
|
3996
|
+
return Object.keys(this.usedNamespaces);
|
|
3997
|
+
}
|
|
3998
|
+
};
|
|
3999
|
+
var jc = (e6, t2) => {
|
|
4000
|
+
let n2 = l();
|
|
4001
|
+
return s(() => {
|
|
4002
|
+
n2.current = t2 ? n2.current : e6;
|
|
4003
|
+
}, [e6, t2]), n2.current;
|
|
4004
|
+
};
|
|
4005
|
+
var Mc = (e6, t2, n2, r2) => e6.getFixedT(t2, n2, r2);
|
|
4006
|
+
var Nc = (e6, t2, n2, r2) => a(Mc(e6, t2, n2, r2), [e6, t2, n2, r2]);
|
|
4007
|
+
var Pc = (e6, t2 = {}) => {
|
|
4008
|
+
let { i18n: n2 } = t2, { i18n: r2, defaultNS: i2 } = o(kc) || {}, a2 = n2 || r2 || Oc();
|
|
4009
|
+
if (a2 && !a2.reportNamespaces && (a2.reportNamespaces = new Ac()), !a2) {
|
|
4010
|
+
gc(a2, `NO_I18NEXT_INSTANCE`, `useTranslation: You will need to pass in an i18next instance by using initReactI18next`);
|
|
4011
|
+
let e7 = (e8, t4) => X(t4) ? t4 : xc(t4) && X(t4.defaultValue) ? t4.defaultValue : Array.isArray(e8) ? e8[e8.length - 1] : e8, t3 = [e7, {}, false];
|
|
4012
|
+
return t3.t = e7, t3.i18n = {}, t3.ready = false, t3;
|
|
4013
|
+
}
|
|
4014
|
+
a2.options.react?.wait && gc(a2, `DEPRECATED_OPTION`, `useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.`);
|
|
4015
|
+
let c2 = { ...Ec(), ...a2.options.react, ...t2 }, { useSuspense: d2, keyPrefix: f2 } = c2, p2 = e6 || i2 || a2.options?.defaultNS;
|
|
4016
|
+
p2 = X(p2) ? [p2] : p2 || [`translation`], a2.reportNamespaces.addUsedNamespaces?.(p2);
|
|
4017
|
+
let m2 = (a2.isInitialized || a2.initializedStoreOnce) && p2.every((e7) => bc(e7, a2, c2)), h2 = Nc(a2, t2.lng || null, c2.nsMode === `fallback` ? p2 : p2[0], f2), g2 = () => h2, _2 = () => Mc(a2, t2.lng || null, c2.nsMode === `fallback` ? p2 : p2[0], f2), [v2, y2] = u(g2), b2 = p2.join();
|
|
4018
|
+
t2.lng && (b2 = `${t2.lng}${b2}`);
|
|
4019
|
+
let x2 = jc(b2), S2 = l(true);
|
|
4020
|
+
s(() => {
|
|
4021
|
+
let { bindI18n: e7, bindI18nStore: n3 } = c2;
|
|
4022
|
+
S2.current = true, !m2 && !d2 && (t2.lng ? yc(a2, t2.lng, p2, () => {
|
|
4023
|
+
S2.current && y2(_2);
|
|
4024
|
+
}) : vc(a2, p2, () => {
|
|
4025
|
+
S2.current && y2(_2);
|
|
4026
|
+
})), m2 && x2 && x2 !== b2 && S2.current && y2(_2);
|
|
4027
|
+
let r3 = () => {
|
|
4028
|
+
S2.current && y2(_2);
|
|
4029
|
+
};
|
|
4030
|
+
return e7 && a2?.on(e7, r3), n3 && a2?.store.on(n3, r3), () => {
|
|
4031
|
+
S2.current = false, a2 && e7 && e7?.split(` `).forEach((e8) => a2.off(e8, r3)), n3 && a2 && n3.split(` `).forEach((e8) => a2.store.off(e8, r3));
|
|
4032
|
+
};
|
|
4033
|
+
}, [a2, b2]), s(() => {
|
|
4034
|
+
S2.current && m2 && y2(g2);
|
|
4035
|
+
}, [a2, f2, m2]);
|
|
4036
|
+
let C2 = [v2, a2, m2];
|
|
4037
|
+
if (C2.t = v2, C2.i18n = a2, C2.ready = m2, m2 || !m2 && !d2) return C2;
|
|
4038
|
+
throw new Promise((e7) => {
|
|
4039
|
+
t2.lng ? yc(a2, t2.lng, p2, () => e7()) : vc(a2, p2, () => e7());
|
|
4040
|
+
});
|
|
4041
|
+
};
|
|
4042
|
+
function Fc({ i18n: e6, defaultNS: t2, children: n2 }) {
|
|
4043
|
+
let i2 = c(() => ({ i18n: e6, defaultNS: t2 }), [e6, t2]);
|
|
4044
|
+
return r(kc.Provider, { value: i2 }, n2);
|
|
4045
|
+
}
|
|
4046
|
+
var Ic = `wix-warmup-data`;
|
|
4047
|
+
var Lc = null;
|
|
4048
|
+
function Rc(e6) {
|
|
4049
|
+
if (typeof document < `u`) try {
|
|
4050
|
+
let t2 = document.getElementById(Ic)?.textContent;
|
|
4051
|
+
return t2 ? (Lc?.text !== t2 && (Lc = { text: t2, data: JSON.parse(t2).builderComponentsWarmupData ?? {} }), Lc.data[e6] ?? void 0) : void 0;
|
|
4052
|
+
} catch {
|
|
4053
|
+
return;
|
|
4054
|
+
}
|
|
4055
|
+
}
|
|
4056
|
+
var zc = 5e3;
|
|
4057
|
+
var Bc = 100;
|
|
4058
|
+
var Vc = {};
|
|
4059
|
+
var Hc = /* @__PURE__ */ new WeakMap();
|
|
4060
|
+
var Uc = (e6) => {
|
|
4061
|
+
let t2 = e6.scope ?? Vc, n2 = Hc.get(t2);
|
|
4062
|
+
return n2 || (n2 = /* @__PURE__ */ new Map(), Hc.set(t2, n2)), n2;
|
|
4063
|
+
};
|
|
4064
|
+
function Wc({ key: e6, warmupData: t2, fetchData: n2 }) {
|
|
4065
|
+
if (e6 === null) return n2();
|
|
4066
|
+
if (t2.isServer) return n2().then((n3) => (t2.set(e6, n3), n3));
|
|
4067
|
+
let r2 = Uc(t2), i2 = Date.now();
|
|
4068
|
+
for (let [e7, t3] of r2) t3.expiresAt <= i2 && r2.delete(e7);
|
|
4069
|
+
let a2 = r2.get(e6);
|
|
4070
|
+
if (a2) return a2.promise;
|
|
4071
|
+
let o2 = Rc(e6);
|
|
4072
|
+
if (o2 !== void 0) {
|
|
4073
|
+
let t3 = Pn(o2);
|
|
4074
|
+
return r2.set(e6, { promise: t3, expiresAt: i2 + zc }), t3;
|
|
4075
|
+
}
|
|
4076
|
+
let s2 = (async () => await t2.get(e6) ?? n2())();
|
|
4077
|
+
r2.size >= Bc && r2.delete(r2.keys().next().value);
|
|
4078
|
+
let c2 = { promise: s2, expiresAt: 1 / 0 };
|
|
4079
|
+
return r2.set(e6, c2), s2.then(() => {
|
|
4080
|
+
c2.expiresAt = Date.now() + zc;
|
|
4081
|
+
}, () => {
|
|
4082
|
+
r2.get(e6) === c2 && r2.delete(e6);
|
|
4083
|
+
}), s2;
|
|
4084
|
+
}
|
|
4085
|
+
var Gc = `blog-builder:i18n`;
|
|
4086
|
+
var Kc = `translation`;
|
|
4087
|
+
var qc = () => Rc(Gc);
|
|
4088
|
+
var Jc = /* @__PURE__ */ new Map();
|
|
4089
|
+
function Yc(e6, t2) {
|
|
4090
|
+
let n2 = Jc.get(e6);
|
|
4091
|
+
if (n2) return n2;
|
|
4092
|
+
let r2 = qc(), i2 = r2?.locale === e6 ? r2.messages : void 0, a2 = pc({ locale: e6, useSuspense: true, ...i2 ? { messages: i2 } : { asyncMessagesLoader: t2 } });
|
|
4093
|
+
return Jc.set(e6, a2), a2;
|
|
4094
|
+
}
|
|
4095
|
+
function Xc(e6) {
|
|
4096
|
+
let t2 = () => e6.loadNamespaces(Kc).then(() => void 0, () => void 0);
|
|
4097
|
+
return e6.isInitialized ? t2() : new Promise((n2) => {
|
|
4098
|
+
e6.on(`initialized`, () => void t2().then(n2));
|
|
4099
|
+
});
|
|
4100
|
+
}
|
|
4101
|
+
function Zc(e6, t2) {
|
|
4102
|
+
return e6.getResourceBundle(t2, `translation`) ?? e6.getResourceBundle(`en`, `translation`);
|
|
4103
|
+
}
|
|
4104
|
+
var Qc = (e6, t2, n2) => {
|
|
4105
|
+
let r2 = t2.lastIndexOf(`?`), i2 = e6[r2 === -1 || r2 < t2.lastIndexOf(`/`) ? t2 : t2.slice(0, r2)];
|
|
4106
|
+
return i2 ? typeof i2 == `function` ? i2() : Promise.resolve(i2) : new Promise((e7, r3) => {
|
|
4107
|
+
(typeof queueMicrotask == `function` ? queueMicrotask : setTimeout)(r3.bind(null, Error(`Unknown variable dynamic import: ` + t2 + (t2.split(`/`).length === n2 ? `` : `. Note that variables only represent file names one level deep.`))));
|
|
4108
|
+
});
|
|
4109
|
+
};
|
|
4110
|
+
var $c = (e6) => e6.split(`-`)[0] ?? e6;
|
|
4111
|
+
Oa({ isDev: false, loadMessages: (e6) => Qc(Object.assign({ "../assets/locale/messages_en.dev.json": () => fn(() => Promise.resolve().then(() => il), void 0, import.meta.url), "../assets/locale/messages_en.json": () => fn(() => Promise.resolve().then(() => ol), void 0, import.meta.url) }), `../assets/locale/messages_${$c(e6)}.json`, 4), loadDevMessages: (e6) => Qc(Object.assign({ "../assets/locale/messages_en.dev.json": () => fn(() => Promise.resolve().then(() => il), void 0, import.meta.url) }), `../assets/locale/messages_${$c(e6)}.dev.json`, 4) });
|
|
4112
|
+
var el = /* @__PURE__ */ new WeakMap();
|
|
4113
|
+
function tl(e6) {
|
|
4114
|
+
let t2 = el.get(e6);
|
|
4115
|
+
return t2 || (t2 = Xc(e6).finally(() => el.delete(e6)), el.set(e6, t2)), t2;
|
|
4116
|
+
}
|
|
4117
|
+
function nl({ i18n: e6, locale: t2 }) {
|
|
4118
|
+
let n2 = jr(), r2 = Ta();
|
|
4119
|
+
if (!n2) return null;
|
|
4120
|
+
if (!e6.isInitialized || !e6.hasLoadedNamespace(`translation`)) throw tl(e6);
|
|
4121
|
+
let i2 = Zc(e6, t2);
|
|
4122
|
+
return i2 && r2.set(Gc, { locale: t2, messages: i2 }), null;
|
|
4123
|
+
}
|
|
4124
|
+
function rl(e6) {
|
|
4125
|
+
let t2 = Br(), n2 = qc()?.locale ?? t2 ?? `en`;
|
|
4126
|
+
return { i18n: Yc(n2, e6), locale: n2 };
|
|
4127
|
+
}
|
|
4128
|
+
var il = g({ default: () => al });
|
|
4129
|
+
var al = { "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` };
|
|
4130
|
+
var ol = g({ default: () => cl, title: () => sl });
|
|
4131
|
+
var sl = `My App`;
|
|
4132
|
+
var cl = { "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: sl, "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.` };
|
|
4133
|
+
var ll = Object.assign({ "../assets/locale/messages_en.dev.json": il, "../assets/locale/messages_en.json": ol });
|
|
4134
|
+
var ul = (e6, t2) => {
|
|
4135
|
+
let n2 = ll[`../assets/locale/messages_${$c(e6)}${t2}.json`];
|
|
4136
|
+
return n2 ? Promise.resolve(n2) : Promise.reject(Error(`no messages file`));
|
|
4137
|
+
};
|
|
4138
|
+
var dl = Oa({ isDev: false, loadMessages: (e6) => ul(e6, ``), loadDevMessages: (e6) => ul(e6, `.dev`) });
|
|
4139
|
+
var fl = (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);
|
|
4140
|
+
var Z = { 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` };
|
|
4141
|
+
var pl = (e6, t2) => {
|
|
4142
|
+
let n2 = (n3) => (r2) => e6(n3, { count: r2, formatted: fl(r2, `full`, t2) });
|
|
4143
|
+
return { timeToRead: (t3) => e6(Z.timeToRead, { count: t3 }), viewCount: n2(Z.viewCount), commentCount: n2(Z.commentCount), likeCount: n2(Z.likeCount), noPostsEmptyState: () => ({ title: e6(Z.noPostsTitle), description: e6(Z.noPostsDescription) }), noRelatedPostsEmptyState: () => ({ title: e6(Z.noRelatedPostsTitle), description: e6(Z.noRelatedPostsDescription) }), canvas: { postTitle: () => e6(Z.canvasPostTitle), authorName: () => e6(Z.canvasAuthorName), excerpt: () => e6(Z.canvasExcerpt), content: () => e6(Z.canvasContent), category: () => e6(Z.canvasCategory), categoryNumbered: (t3) => e6(Z.canvasCategoryNumbered, { number: t3 }), tagNumbered: (t3) => e6(Z.canvasTagNumbered, { number: t3 }), coverAlt: () => e6(Z.canvasCoverAlt), authorPhotoAlt: () => e6(Z.canvasAuthorPhotoAlt) } };
|
|
4144
|
+
};
|
|
4145
|
+
var ml = [{ path: `members.createdDate` }, { path: `members.updatedDate` }, { path: `members.lastLoginDate` }];
|
|
4146
|
+
var hl = [{ path: `query.sorting.origin.latitude` }, { path: `query.sorting.origin.longitude` }];
|
|
4147
|
+
function gl(e6) {
|
|
4148
|
+
return Mt(Object.assign(e6, { domainToMappings: { "www.wixapis.com": [{ srcPath: `/members/v1/members`, destPath: `/v1/members` }], "api._api_base_domain_": [{ srcPath: `/members-ng-api`, destPath: `` }], "www._base_domain_": [{ srcPath: `/_api/members/v1/members`, destPath: `/v1/members` }], "manage._base_domain_": [{ srcPath: `/_api/members/v1/members`, destPath: `/v1/members` }], "editor._base_domain_": [{ srcPath: `/_api/members/v1/members`, destPath: `/v1/members` }], "blocks._base_domain_": [{ srcPath: `/_api/members/v1/members`, destPath: `/v1/members` }], "create.editorx": [{ srcPath: `/_api/members/v1/members`, destPath: `/v1/members` }], "editor.wixapps.net": [{ srcPath: `/_api/members/v1/members`, destPath: `/v1/members` }], "*.dev.wix-code.com": [{ srcPath: `/_api/members/v1/members`, destPath: `/v1/members` }], "bo._base_domain_": [{ srcPath: `/_api/members/v1/members`, destPath: `/v1/members` }], "wixbo.ai": [{ srcPath: `/_api/members/v1/members`, destPath: `/v1/members` }], "wix-bo.com": [{ srcPath: `/_api/members/v1/members`, destPath: `/v1/members` }], _: [{ srcPath: `/_api/members/v1/members`, destPath: `/v1/members` }], "members.wixapps.net": [{ srcPath: `/_api/members/v1/members`, destPath: `/v1/members` }] } }));
|
|
4149
|
+
}
|
|
4150
|
+
var _l = `@wix/auto_sdk_members_members`;
|
|
4151
|
+
function vl(e6) {
|
|
4152
|
+
function t2({ host: t3 }) {
|
|
4153
|
+
let n2 = P(e6, [{ transformFn: an, paths: hl }]);
|
|
4154
|
+
return { entityFqdn: `wix.members.v1.member`, method: `POST`, methodFqn: `com.wixpress.members.api.Members.QueryMembers`, packageName: _l, migrationOptions: { optInTransformResponse: true }, url: gl({ protoPath: `/v1/members/query`, data: n2, host: t3 }), data: n2, transformResponse: (e7) => P(e7, [{ transformFn: N, paths: ml }]) };
|
|
4155
|
+
}
|
|
4156
|
+
return t2;
|
|
4157
|
+
}
|
|
4158
|
+
function yl(e6) {
|
|
4159
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1];
|
|
4160
|
+
return ri({ func: async (r2) => {
|
|
4161
|
+
let i2 = vl({ ...r2, ...e6 ?? {} });
|
|
4162
|
+
n2?.onSiteCall?.();
|
|
4163
|
+
try {
|
|
4164
|
+
let e7 = await t2.request(i2);
|
|
4165
|
+
return n2?.onSuccess?.(e7), e7;
|
|
4166
|
+
} catch (e7) {
|
|
4167
|
+
throw n2?.onError?.(e7), e7;
|
|
4168
|
+
}
|
|
4169
|
+
}, requestTransformer: (t3) => {
|
|
4170
|
+
let n3 = [t3, e6];
|
|
4171
|
+
return j({ ...n3?.[1], query: n3?.[0] });
|
|
4172
|
+
}, responseTransformer: ({ data: e7 }) => {
|
|
4173
|
+
let t3 = M(P(e7, []));
|
|
4174
|
+
return { items: t3?.members, pagingMetadata: t3?.metadata };
|
|
4175
|
+
}, errorTransformer: (e7) => {
|
|
4176
|
+
throw F(e7, { spreadPathsToArguments: {}, explicitPathsToArguments: { query: `$[0]` }, singleArgumentUnchanged: false });
|
|
4177
|
+
}, pagingMethod: `OFFSET`, transformationPaths: {} });
|
|
4178
|
+
}
|
|
4179
|
+
async function bl(e6, t2) {
|
|
4180
|
+
let { httpClient: n2, sideEffects: r2 } = arguments[2], i2 = vl(j({ query: e6, ...t2 }));
|
|
4181
|
+
r2?.onSiteCall?.();
|
|
4182
|
+
try {
|
|
4183
|
+
let e7 = await n2.request(i2);
|
|
4184
|
+
return r2?.onSuccess?.(e7), M(e7.data);
|
|
4185
|
+
} catch (e7) {
|
|
4186
|
+
let t3 = F(e7, { spreadPathsToArguments: {}, explicitPathsToArguments: { query: `$[0]` }, singleArgumentUnchanged: false }, [`query`, `options`]);
|
|
4187
|
+
throw r2?.onError?.(e7), t3;
|
|
4188
|
+
}
|
|
4189
|
+
}
|
|
4190
|
+
function xl(e6) {
|
|
4191
|
+
return (t2) => yl(t2, { httpClient: e6 });
|
|
4192
|
+
}
|
|
4193
|
+
function Sl(e6) {
|
|
4194
|
+
return (t2, n2) => bl(t2, n2, { httpClient: e6 });
|
|
4195
|
+
}
|
|
4196
|
+
function Cl(e6) {
|
|
4197
|
+
let t2 = pi({ builderQueryFunction: (t3) => xl(e6)(t3), typedQueryFunction: (t3, n3) => Sl(e6)(t3, n3), hasOptionsParameter: true });
|
|
4198
|
+
function n2(e7, n3) {
|
|
4199
|
+
return t2(...arguments);
|
|
4200
|
+
}
|
|
4201
|
+
return n2;
|
|
4202
|
+
}
|
|
4203
|
+
var wl = I(Cl);
|
|
4204
|
+
var Tl = async (e6) => {
|
|
4205
|
+
let t2 = [...new Set(e6.filter((e7) => !!e7))];
|
|
4206
|
+
if (t2.length === 0) return {};
|
|
4207
|
+
try {
|
|
4208
|
+
let { items: e7 } = await wl({ fieldsets: [`PUBLIC`] }).in(`_id`, t2).limit(t2.length).find();
|
|
4209
|
+
return Object.fromEntries(e7.flatMap((e8) => {
|
|
4210
|
+
let { _id: t3 } = e8;
|
|
4211
|
+
return t3 ? [[t3, e8]] : [];
|
|
4212
|
+
}));
|
|
4213
|
+
} catch {
|
|
4214
|
+
return {};
|
|
4215
|
+
}
|
|
4216
|
+
};
|
|
4217
|
+
var El = [{ 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` }];
|
|
4218
|
+
var Dl = [{ path: `posts.richContentCompressed` }];
|
|
4219
|
+
var Ol = [{ 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` }];
|
|
4220
|
+
var kl = [{ path: `sort.origin.latitude` }, { path: `sort.origin.longitude` }, { path: `query.sort.origin.latitude` }, { path: `query.sort.origin.longitude` }];
|
|
4221
|
+
function Al(e6) {
|
|
4222
|
+
return Mt(Object.assign(e6, { domainToMappings: { _: [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }], "apps._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }], "www._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }], "www.wixapis.com": [{ srcPath: `/v3/posts`, destPath: `/v3/posts` }, { srcPath: `/blog/v3/posts`, destPath: `/v3/posts` }, { srcPath: `/_api/v3/posts`, destPath: `/v3/posts` }], "manage._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }, { srcPath: `/_api/post-service-api-proxy/v3/bulk/posts`, destPath: `/v3/bulk/posts` }], "*.dev.wix-code.com": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }], "editor._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }], "blocks._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }], "create.editorx": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }], "editor.wixapps.net": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }], "dev._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }] } }));
|
|
4223
|
+
}
|
|
4224
|
+
var jl = `@wix/auto_sdk_blog_posts`;
|
|
4225
|
+
function Ml(e6) {
|
|
4226
|
+
function t2({ host: t3 }) {
|
|
4227
|
+
let n2 = P(e6, [{ transformFn: an, paths: kl }]);
|
|
4228
|
+
return { entityFqdn: `wix.blog.v3.post`, method: `POST`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.PostService.QueryPosts`, packageName: jl, migrationOptions: { optInTransformResponse: true }, url: Al({ protoPath: `/v3/posts/query`, data: n2, host: t3 }), data: n2, transformResponse: (e7) => P(e7, [{ transformFn: N, paths: El }, { transformFn: on, paths: Dl }, { transformFn: L, paths: Ol }]) };
|
|
4229
|
+
}
|
|
4230
|
+
return t2;
|
|
4231
|
+
}
|
|
4232
|
+
function Nl() {
|
|
4233
|
+
let e6 = Ml({});
|
|
4234
|
+
return { getUrl: (t2) => {
|
|
4235
|
+
let { url: n2 } = e6(t2);
|
|
4236
|
+
return n2;
|
|
4237
|
+
}, httpMethod: `POST`, path: `/v3/posts/query`, pathParams: {}, __requestType: null, __originalRequestType: null, __responseType: null, __originalResponseType: null };
|
|
4238
|
+
}
|
|
4239
|
+
var Pl = Nl();
|
|
4240
|
+
var Fl = (e6) => (t2) => ({ method: `POST`, url: Pl.getUrl(t2), data: { query: { filter: { id: { $in: e6 } }, paging: { limit: e6.length } } } });
|
|
4241
|
+
var Il = I((e6) => async (t2) => {
|
|
4242
|
+
let { data: n2 } = await e6.request(Fl(t2)), r2 = {};
|
|
4243
|
+
for (let e7 of n2.posts ?? []) {
|
|
4244
|
+
let { id: t3 } = e7, n3 = e7.media?.wixMedia?.videoV2?.resolutions;
|
|
4245
|
+
if (!t3 || !n3?.length) continue;
|
|
4246
|
+
let i2 = n3.filter((e8) => e8.url && e8.format === `mp4`).map(({ url: e8, width: t4, height: n4 }) => ({ url: e8, width: t4, height: n4 }));
|
|
4247
|
+
i2.length > 0 && (r2[t3] = i2);
|
|
4248
|
+
}
|
|
4249
|
+
return r2;
|
|
4250
|
+
});
|
|
4251
|
+
var Ll = async (e6) => {
|
|
4252
|
+
if (e6.length === 0) return {};
|
|
4253
|
+
try {
|
|
4254
|
+
return await Il(e6);
|
|
4255
|
+
} catch {
|
|
4256
|
+
return {};
|
|
4257
|
+
}
|
|
4258
|
+
};
|
|
4259
|
+
var Rl = `TRANSLATIONS`;
|
|
4260
|
+
W.RICH_CONTENT, W.SEO, W.URL, W.CONTENT_TEXT, W.RICH_CONTENT, W.URL;
|
|
4261
|
+
var zl = [W.URL, W.METRICS];
|
|
4262
|
+
var Bl = (e6) => {
|
|
4263
|
+
let { status: t2, details: n2 } = e6 ?? {};
|
|
4264
|
+
return t2 === 404 || String(n2?.applicationError?.code ?? ``).includes(`NOT_FOUND`);
|
|
4265
|
+
};
|
|
4266
|
+
var Vl = (e6) => Tl(e6.map(({ memberId: e7 }) => e7));
|
|
4267
|
+
var Hl = (e6) => Ll(e6.filter((e7) => e7.media?.wixMedia?.videoV2).map(({ _id: e7 }) => e7).filter((e7) => !!e7));
|
|
4268
|
+
var Ul = 100;
|
|
4269
|
+
var Wl = async () => {
|
|
4270
|
+
try {
|
|
4271
|
+
let { categories: e6 } = await Wi({ paging: { limit: Ul } });
|
|
4272
|
+
return e6 ?? [];
|
|
4273
|
+
} catch {
|
|
4274
|
+
return [];
|
|
4275
|
+
}
|
|
4276
|
+
};
|
|
4277
|
+
var Gl = (e6, t2) => {
|
|
4278
|
+
let { categoryIds: n2 } = e6 ?? {};
|
|
4279
|
+
if (!n2?.length) return [];
|
|
4280
|
+
let r2 = new Map(t2.map((e7) => [e7._id, e7]));
|
|
4281
|
+
return n2.map((e7) => r2.get(e7)).filter((e7) => e7 !== void 0);
|
|
4282
|
+
};
|
|
4283
|
+
var Kl = (e6, t2) => {
|
|
4284
|
+
let n2 = {};
|
|
4285
|
+
for (let r2 of e6) for (let { _id: e7, label: i2 } of Gl(r2, t2)) e7 && (n2[e7] = i2 ?? ``);
|
|
4286
|
+
return n2;
|
|
4287
|
+
};
|
|
4288
|
+
var ql = async ({ ids: e6, currentPostId: t2, limit: n2 }) => {
|
|
4289
|
+
let { items: r2 } = await fa({ fieldsets: zl }).in(`_id`, e6).limit(n2).find(), i2 = new Map(r2.map((e7) => {
|
|
4290
|
+
let { _id: t3 } = e7;
|
|
4291
|
+
return [t3, e7];
|
|
4292
|
+
}));
|
|
4293
|
+
return e6.filter((e7) => e7 !== t2).map((e7) => i2.get(e7)).filter((e7) => e7 !== void 0).slice(0, n2);
|
|
4294
|
+
};
|
|
4295
|
+
var Jl = () => ({ posts: [], hasMore: false, authorsByMemberId: {}, categoryLabelsById: {}, videoSourcesByPostId: {} });
|
|
4296
|
+
var Yl = /* @__PURE__ */ new Map();
|
|
4297
|
+
var Xl = /* @__PURE__ */ new Map();
|
|
4298
|
+
var Zl = (e6, t2, n2) => {
|
|
4299
|
+
let r2 = e6.get(t2);
|
|
4300
|
+
if (r2) return r2;
|
|
4301
|
+
let i2 = n2().then((e7) => e7 ?? null).catch((n3) => {
|
|
4302
|
+
if (e6.delete(t2), Bl(n3)) return null;
|
|
4303
|
+
throw n3;
|
|
4304
|
+
});
|
|
4305
|
+
return e6.set(t2, i2), i2;
|
|
4306
|
+
};
|
|
4307
|
+
var Ql = (e6, t2) => Zl(Yl, `${e6}|${t2 ?? ``}`, async () => {
|
|
4308
|
+
let { category: n2 } = await Ui(e6, { fieldsets: [Rl], ...t2 && { language: t2 } });
|
|
4309
|
+
return n2;
|
|
4310
|
+
});
|
|
4311
|
+
var $l = (e6) => Zl(Yl, `${e6}|*`, async () => {
|
|
4312
|
+
let { items: t2 } = await Gi().eq(`slug`, e6).limit(1).find();
|
|
4313
|
+
return t2[0];
|
|
4314
|
+
});
|
|
4315
|
+
var eu = (e6, t2) => Zl(Xl, `${e6}|${t2 ?? ``}`, async () => {
|
|
4316
|
+
let { tag: n2 } = await ba(e6, { ...t2 && { language: t2 } });
|
|
4317
|
+
return n2;
|
|
4318
|
+
});
|
|
4319
|
+
var tu = /* @__PURE__ */ new Map();
|
|
4320
|
+
var nu = (e6, t2) => {
|
|
4321
|
+
let n2 = `${e6}|${t2 ?? ``}`, r2 = tu.get(n2);
|
|
4322
|
+
if (r2) return r2;
|
|
4323
|
+
let i2 = Hi(e6).then(async ({ category: e7 }) => {
|
|
4324
|
+
let { _id: n3, translationId: r3, language: i3 } = e7 ?? {};
|
|
4325
|
+
if (!n3) return null;
|
|
4326
|
+
if (!t2 || !r3 || i3 === t2) return n3;
|
|
4327
|
+
let { items: a2 } = await Gi().eq(`translationId`, r3).eq(`language`, t2).limit(1).find();
|
|
4328
|
+
return a2[0]?._id ?? null;
|
|
4329
|
+
}).catch((e7) => {
|
|
4330
|
+
if (Bl(e7)) return null;
|
|
4331
|
+
throw tu.delete(n2), e7;
|
|
4332
|
+
});
|
|
4333
|
+
return tu.set(n2, i2), i2;
|
|
4334
|
+
};
|
|
4335
|
+
var ru = async (e6, t2) => {
|
|
4336
|
+
try {
|
|
4337
|
+
let { items: n2 } = await Gi().eq(`translationId`, e6).eq(`language`, t2).limit(1).find();
|
|
4338
|
+
return n2[0]?.slug ?? void 0;
|
|
4339
|
+
} catch {
|
|
4340
|
+
return;
|
|
4341
|
+
}
|
|
4342
|
+
};
|
|
4343
|
+
var iu = [`newest`, `oldest`, `titleAsc`, `titleDesc`, `mostViewed`, `mostLiked`];
|
|
4344
|
+
var au = { newest: `FEED`, oldest: `PUBLISHED_DATE_ASC`, titleAsc: `TITLE_ASC`, titleDesc: `TITLE_DESC`, mostViewed: `VIEW_COUNT`, mostLiked: `LIKE_COUNT` };
|
|
4345
|
+
var ou = async ({ offset: e6, limit: t2, language: n2, categoryId: r2, categorySlug: i2, tagSlug: a2, postIds: o2, sortOrder: s2, featuredOnly: c2, propagateErrors: l2 = false }) => {
|
|
4346
|
+
let u2 = Wl();
|
|
4347
|
+
try {
|
|
4348
|
+
let l3, d2, f2, p2, m2;
|
|
4349
|
+
if (i2) {
|
|
4350
|
+
let e7 = await Ql(i2, n2);
|
|
4351
|
+
if (!e7?._id) {
|
|
4352
|
+
let e8 = n2 ? await $l(i2) : null;
|
|
4353
|
+
return { ...Jl(), ...e8?.translationId && e8.language !== n2 && { mismatchedCategory: e8 } };
|
|
4354
|
+
}
|
|
4355
|
+
f2 = e7, l3 = [e7._id];
|
|
4356
|
+
} else if (a2) {
|
|
4357
|
+
let e7 = await eu(a2, n2);
|
|
4358
|
+
if (!e7?._id) return Jl();
|
|
4359
|
+
p2 = e7, d2 = [e7._id];
|
|
4360
|
+
} else if (o2?.length) m2 = await ql({ ids: o2, limit: o2.length });
|
|
4361
|
+
else if (r2) {
|
|
4362
|
+
let e7 = await nu(r2, n2);
|
|
4363
|
+
if (!e7) return Jl();
|
|
4364
|
+
l3 = [e7];
|
|
4365
|
+
}
|
|
4366
|
+
let h2 = s2 ? au[s2] : void 0, g2 = m2 ?? (await da({ paging: { limit: t2, offset: e6 }, fieldsets: zl, ...n2 && { language: n2 }, ...l3 && { categoryIds: l3 }, ...d2 && { tagIds: d2 }, ...h2 && h2 !== `FEED` && { sort: h2 }, ...c2 && { featured: true } })).posts ?? [], [_2, v2, y2] = await Promise.all([Vl(g2), u2, Hl(g2)]);
|
|
4367
|
+
return { posts: g2, hasMore: !m2 && g2.length === t2, authorsByMemberId: _2, categoryLabelsById: Kl(g2, v2), videoSourcesByPostId: y2, ...f2 && { filterCategory: f2 }, ...p2 && { filterTag: p2 } };
|
|
4368
|
+
} catch (e7) {
|
|
4369
|
+
if (l2) throw e7;
|
|
4370
|
+
return Jl();
|
|
4371
|
+
}
|
|
4372
|
+
};
|
|
4373
|
+
var su = `categoryId`;
|
|
4374
|
+
var cu = (e6) => lu(e6?.[su]);
|
|
4375
|
+
var lu = (e6) => {
|
|
4376
|
+
if (e6 && typeof e6 == `object`) return (typeof e6.$eq == `string` ? e6.$eq : Array.isArray(e6.$in) ? e6.$in.find((e7) => typeof e7 == `string` && e7.trim() !== ``) : void 0)?.trim() || void 0;
|
|
4377
|
+
};
|
|
4378
|
+
var uu = class extends e {
|
|
4379
|
+
state = { error: void 0 };
|
|
4380
|
+
static getDerivedStateFromError(e6) {
|
|
4381
|
+
return { error: e6 ?? Error(`Unknown render error`) };
|
|
4382
|
+
}
|
|
4383
|
+
componentDidCatch(e6, t2) {
|
|
4384
|
+
Tr(this.props.monitoringClient, e6, { feature: this.props.feature, action: `render`, contexts: { react: { componentStack: t2.componentStack } } });
|
|
4385
|
+
}
|
|
4386
|
+
render() {
|
|
4387
|
+
if (this.state.error === void 0) return this.props.children;
|
|
4388
|
+
if (this.props.rethrow) throw this.state.error;
|
|
4389
|
+
return this.props.fallback;
|
|
4390
|
+
}
|
|
4391
|
+
};
|
|
4392
|
+
var du = (e6) => e6.then((e7) => ({ ...e7, fetchedAt: Date.now() }));
|
|
4393
|
+
var fu = `postId`;
|
|
4394
|
+
var pu = (e6) => {
|
|
4395
|
+
let t2 = e6?.[fu];
|
|
4396
|
+
if (!t2 || typeof t2 != `object`) return [];
|
|
4397
|
+
let n2 = Array.isArray(t2.$in) ? t2.$in : [t2.$eq];
|
|
4398
|
+
return [...new Set(n2.flatMap((e7) => typeof e7 == `string` && e7.trim() !== `` ? [e7.trim()] : []))];
|
|
4399
|
+
};
|
|
4400
|
+
var mu = 6e4;
|
|
4401
|
+
var hu = mu * 60;
|
|
4402
|
+
var gu = hu * 24;
|
|
4403
|
+
var _u = gu * 7;
|
|
4404
|
+
var vu = (e6) => e6 < mu ? [`second`, e6 / 1e3] : e6 < hu ? [`minute`, e6 / mu] : e6 < gu ? [`hour`, e6 / hu] : [`day`, e6 / gu];
|
|
4405
|
+
var yu = (e6, t2, n2 = Date.now()) => {
|
|
4406
|
+
let r2 = e6 instanceof Date ? e6 : new Date(e6), i2 = n2 - r2.getTime();
|
|
4407
|
+
if (i2 >= 0 && i2 < _u) {
|
|
4408
|
+
let [e7, n3] = vu(i2);
|
|
4409
|
+
return new Intl.RelativeTimeFormat(t2).format(-Math.round(n3), e7);
|
|
4410
|
+
}
|
|
4411
|
+
let a2 = r2.getFullYear() === new Date(n2).getFullYear();
|
|
4412
|
+
return new Intl.DateTimeFormat(t2, { ...a2 ? {} : { year: `numeric` }, month: `short`, day: `numeric` }).format(r2);
|
|
4413
|
+
};
|
|
4414
|
+
var bu = `https://static.wixstatic.com/media/`;
|
|
4415
|
+
var xu = `wix:video://`;
|
|
4416
|
+
var Su = (e6) => {
|
|
4417
|
+
if (!e6) return;
|
|
4418
|
+
let t2 = Number.parseInt(e6, 10);
|
|
4419
|
+
return Number.isFinite(t2) && t2 > 0 ? t2 : void 0;
|
|
4420
|
+
};
|
|
4421
|
+
var Cu = (e6) => {
|
|
4422
|
+
if (!e6.startsWith(xu)) return;
|
|
4423
|
+
let [t2, n2] = e6.slice(12).split(`#`), [, r2] = t2.split(`/`).filter(Boolean);
|
|
4424
|
+
if (!r2) return;
|
|
4425
|
+
let i2 = new URLSearchParams(n2 ?? ``), a2 = i2.get(`posterUri`);
|
|
4426
|
+
return { id: decodeURIComponent(r2), posterUrl: a2 ? `${bu}${a2}` : void 0, posterWidth: Su(i2.get(`posterWidth`)), posterHeight: Su(i2.get(`posterHeight`)) };
|
|
4427
|
+
};
|
|
4428
|
+
var wu = [/https?:\/\/(?:www\.|m\.)?youtube\.com\/watch\?(?:[^#]*&)?v=([\w-]+)/i, /https?:\/\/(?:www\.)?youtube\.com\/embed\/([\w-]+)/i, /https?:\/\/youtu\.be\/([\w-]+)/i];
|
|
4429
|
+
var Tu = [/https?:\/\/player\.vimeo\.com\/video\/(\d+)/i, /https?:\/\/vimeo\.com\/(\d+)/i];
|
|
4430
|
+
var Eu = (e6, t2) => {
|
|
4431
|
+
for (let n2 of e6) {
|
|
4432
|
+
let e7 = n2.exec(t2);
|
|
4433
|
+
if (e7) return e7[1];
|
|
4434
|
+
}
|
|
4435
|
+
};
|
|
4436
|
+
var Du = (e6) => {
|
|
4437
|
+
let t2 = Eu(wu, e6);
|
|
4438
|
+
if (t2) return { provider: `youtube`, embedUrl: `https://www.youtube.com/embed/${t2}?autoplay=1` };
|
|
4439
|
+
let n2 = Eu(Tu, e6);
|
|
4440
|
+
return n2 ? { provider: `vimeo`, embedUrl: `https://player.vimeo.com/video/${n2}?autoplay=1` } : { provider: `unknown` };
|
|
4441
|
+
};
|
|
4442
|
+
var Ou = (e6, t2 = []) => {
|
|
4443
|
+
let n2 = e6?.media;
|
|
4444
|
+
if (!n2 || n2.displayed === false) return;
|
|
4445
|
+
let r2 = tr(e6);
|
|
4446
|
+
if (r2) return { kind: `image`, image: r2 };
|
|
4447
|
+
let i2 = n2.altText ?? e6?.title ?? ``, a2 = n2.wixMedia?.videoV2 ? Cu(n2.wixMedia.videoV2) : void 0;
|
|
4448
|
+
if (a2) return { kind: `wixVideo`, ...a2, sources: t2, altText: i2 };
|
|
4449
|
+
let o2 = n2.embedMedia?.video?.url;
|
|
4450
|
+
if (o2) {
|
|
4451
|
+
let { thumbnail: e7 } = n2.embedMedia ?? {};
|
|
4452
|
+
return { kind: `embed`, videoUrl: o2, ...Du(o2), thumbnailUrl: e7?.url, thumbnailWidth: e7?.width, thumbnailHeight: e7?.height, altText: i2 };
|
|
4453
|
+
}
|
|
4454
|
+
};
|
|
4455
|
+
var ku = (e6) => {
|
|
4456
|
+
let t2 = tr(e6), n2 = e6?.media?.wixMedia?.videoV2;
|
|
4457
|
+
if (t2 || !n2) return t2;
|
|
4458
|
+
let r2 = Cu(n2), i2 = er(r2?.posterUrl?.slice(35), e6?.media?.altText ?? e6?.title);
|
|
4459
|
+
return i2 && { ...i2, width: r2?.posterWidth ?? i2.width, height: r2?.posterHeight ?? i2.height };
|
|
4460
|
+
};
|
|
4461
|
+
var Au = `2026-05-12T12:00:00.000Z`;
|
|
4462
|
+
var ju = (e6) => ({ href: e6 ?? `#`, target: `_self` });
|
|
4463
|
+
var Mu = (e6) => `https://static.wixstatic.com/media/${e6}/v1/fit/w_1200,h_1200,al_c,q_85/cover.jpg`;
|
|
4464
|
+
var Nu = (e6) => {
|
|
4465
|
+
if (!e6) return;
|
|
4466
|
+
let t2 = e6 instanceof Date ? e6 : new Date(e6);
|
|
4467
|
+
return Number.isFinite(t2.getTime()) ? t2.toISOString() : void 0;
|
|
4468
|
+
};
|
|
4469
|
+
var Pu = (e6) => typeof e6 == `number` && e6 > 0 ? e6 : void 0;
|
|
4470
|
+
var Fu = (e6) => e6.replace(/&/g, `&`).replace(/</g, `<`).replace(/>/g, `>`).replace(/"/g, `"`).replace(/'/g, `'`);
|
|
4471
|
+
var Q = (e6) => ({ text: e6, html: `<p>${Fu(e6)}</p>`, linkList: [] });
|
|
4472
|
+
var $ = { minutesToRead: 5, views: 120, comments: 4 };
|
|
4473
|
+
var Iu = (e6) => {
|
|
4474
|
+
let { metrics: t2 } = e6;
|
|
4475
|
+
return { views: typeof t2?.views == `number` ? t2.views : void 0, comments: typeof t2?.comments == `number` ? t2.comments : void 0 };
|
|
4476
|
+
};
|
|
4477
|
+
var Lu = (e6, t2, n2, r2) => Q(e6 === void 0 ? n2 ? r2(t2) : `` : r2(e6));
|
|
4478
|
+
var Ru = (e6, t2, n2, r2) => {
|
|
4479
|
+
let i2 = e6.categoryIds?.map((e7) => t2[e7]).find(Boolean);
|
|
4480
|
+
return Q(i2 ?? (n2 ? r2.canvas.category() : ``));
|
|
4481
|
+
};
|
|
4482
|
+
var zu = (e6, t2, n2, r2, i2 = {}, a2 = {}, o2 = false, s2 = {}, c2 = Date.now()) => {
|
|
4483
|
+
let { _id: l2, memberId: u2 } = e6, d2 = u2 ? i2[u2] : void 0, f2 = Iu(e6);
|
|
4484
|
+
return { _id: l2 ?? e6.slug ?? ``, title: e6.title ?? ``, itemTitle: Q(e6.title ?? ``), itemExcerpt: Q(e6.excerpt ?? ``), itemCoverImage: ku(e6), itemCoverMedia: Ou(e6, s2[l2 ?? ``] ?? []), itemLink: dr(e6, r2), itemPublishedDate: Q(yu(e6.firstPublishedDate ?? new Date(c2), n2, c2)), publishedDateValue: Nu(e6.firstPublishedDate), clockValue: c2, minutesToReadValue: Pu(e6.minutesToRead), initialViewCount: f2.views ?? (o2 ? $.views : void 0), initialCommentCount: f2.comments ?? (o2 ? $.comments : void 0), authorName: Q(d2?.profile?.nickname ?? ``), authorImage: mr(d2, t2.canvas.authorPhotoAlt()), timeToRead: Q(typeof e6.minutesToRead == `number` && e6.minutesToRead > 0 ? t2.timeToRead(e6.minutesToRead) : ``), viewCount: Lu(f2.views, $.views, o2, t2.viewCount), commentCount: Lu(f2.comments, $.comments, o2, t2.commentCount), itemCategoryLabel: Ru(e6, a2, o2, t2), recentPostItem: { title: e6.title ?? ``, slug: e6.slug ?? `` }, commentingEnabled: e6.commentingEnabled };
|
|
4485
|
+
};
|
|
4486
|
+
var Bu = (e6, t2, n2 = []) => {
|
|
4487
|
+
let r2 = Ou(e6, n2);
|
|
4488
|
+
if (!r2) return;
|
|
4489
|
+
let i2 = dr(e6, t2), a2 = { slug: e6.slug ?? void 0, title: e6.title ?? ``, description: e6.excerpt ?? ``, ...i2 ? { action: { link: i2 } } : {} };
|
|
4490
|
+
if (r2.kind === `image`) return r2.image.url ? { ...a2, type: `image`, src: r2.image.url, width: r2.image.width, height: r2.image.height, parameters: { alt: r2.image.alt } } : void 0;
|
|
4491
|
+
if (r2.kind === `wixVideo`) {
|
|
4492
|
+
let e7 = r2.sources[0]?.url;
|
|
4493
|
+
return e7 ? { ...a2, type: `video`, src: e7, width: r2.sources[0]?.width ?? r2.posterWidth, height: r2.sources[0]?.height ?? r2.posterHeight, parameters: { thumbnail: r2.posterUrl, alt: r2.altText } } : r2.posterUrl ? { ...a2, type: `image`, src: r2.posterUrl, width: r2.posterWidth, height: r2.posterHeight, parameters: { alt: r2.altText } } : void 0;
|
|
4494
|
+
}
|
|
4495
|
+
if (r2.thumbnailUrl) return { ...a2, type: `image`, src: r2.thumbnailUrl, width: r2.thumbnailWidth, height: r2.thumbnailHeight, parameters: { alt: r2.altText } };
|
|
4496
|
+
};
|
|
4497
|
+
var Vu = 3;
|
|
4498
|
+
var Hu = [{ uri: `728f9d_a03266fe4a4d4651b9aa06077eef5d9c~mv2.png`, width: 2304, height: 1728 }, { uri: `728f9d_635778e429524b59856cb2a18ed0d4f8~mv2.jpg`, width: 2624, height: 1472 }, { uri: `728f9d_d6071d5e8a0544098238188bae67e5e4~mv2.png`, width: 2304, height: 1728 }];
|
|
4499
|
+
var Uu = (e6, t2) => {
|
|
4500
|
+
let { uri: n2, width: r2, height: i2 } = Hu[e6 % Hu.length];
|
|
4501
|
+
return { uri: n2, url: Mu(n2), name: n2, width: r2, height: i2, alt: t2 };
|
|
4502
|
+
};
|
|
4503
|
+
var Wu = (e6, t2) => {
|
|
4504
|
+
let { uri: n2 } = Hu[(e6 + 1) % Hu.length];
|
|
4505
|
+
return { uri: n2, url: Mu(n2), name: n2, width: 100, height: 100, alt: t2 };
|
|
4506
|
+
};
|
|
4507
|
+
var Gu = (e6) => Array.from({ length: Vu }, (t2, n2) => {
|
|
4508
|
+
let r2 = Uu(n2, e6.canvas.coverAlt());
|
|
4509
|
+
return { type: `image`, src: r2.url ?? ``, title: e6.canvas.postTitle(), description: e6.canvas.excerpt(), width: r2.width, height: r2.height, parameters: { alt: r2.alt } };
|
|
4510
|
+
});
|
|
4511
|
+
var Ku = (e6, t2, n2, r2 = Date.now()) => Array.from({ length: Vu }, (i2, a2) => {
|
|
4512
|
+
let o2 = e6.canvas.postTitle(), s2 = Uu(a2, e6.canvas.coverAlt());
|
|
4513
|
+
return { _id: `placeholder-${a2}`, title: o2, itemTitle: Q(o2), itemExcerpt: Q(e6.canvas.excerpt()), itemCoverImage: s2, itemCoverMedia: { kind: `image`, image: s2 }, itemLink: ju(n2), itemPublishedDate: Q(yu(new Date(r2), t2, r2)), publishedDateValue: Au, clockValue: r2, minutesToReadValue: $.minutesToRead, initialViewCount: $.views, initialCommentCount: $.comments, authorName: Q(e6.canvas.authorName()), authorImage: Wu(a2, e6.canvas.authorPhotoAlt()), timeToRead: Q(e6.timeToRead($.minutesToRead)), viewCount: Q(e6.viewCount($.views)), commentCount: Q(e6.commentCount($.comments)), itemCategoryLabel: Q(e6.canvas.category()), recentPostItem: { title: o2, slug: `` }, commentingEnabled: void 0 };
|
|
4514
|
+
});
|
|
4515
|
+
var qu = n(void 0);
|
|
4516
|
+
function Ju() {
|
|
4517
|
+
let e6 = o(qu);
|
|
4518
|
+
if (!e6) throw Error(`useBlogFeedContext must be used within a PostListProvider`);
|
|
4519
|
+
return e6;
|
|
4520
|
+
}
|
|
4521
|
+
var Yu = 6;
|
|
4522
|
+
var Xu = (e6) => typeof e6 == `number` && Number.isFinite(e6) && e6 >= 1 ? Math.min(Math.floor(e6), 100) : Yu;
|
|
4523
|
+
var Zu = (e6) => typeof e6 == `number` && Number.isFinite(e6) && e6 >= 1 ? Math.floor(e6) : 0;
|
|
4524
|
+
var Qu = (e6) => iu.includes(e6 ?? ``) ? e6 : `newest`;
|
|
4525
|
+
var $u = { postsList: [], postGalleryItems: [], emptyState: null, hasError: false, hasMorePosts: false, isLoadingPosts: true, loadMorePosts: async () => {
|
|
4526
|
+
}, filteredView: { kind: `pending` } };
|
|
4527
|
+
var ed = { ...$u, isLoadingPosts: false, hasError: true };
|
|
4528
|
+
var td = (e6, t2) => {
|
|
4529
|
+
if (e6.kind === `category` && t2.filterCategory) {
|
|
4530
|
+
let { label: e7, description: n2, coverImage: r2 } = t2.filterCategory, i2 = e7 ?? ``;
|
|
4531
|
+
return { kind: `category`, title: i2, description: n2 ?? ``, coverImage: er(r2, i2) };
|
|
4532
|
+
}
|
|
4533
|
+
return e6.kind === `tag` && t2.filterTag ? { kind: `tag`, title: t2.filterTag.label ?? `` } : { kind: `all` };
|
|
4534
|
+
};
|
|
4535
|
+
var nd = (e6) => ({ page: e6, hasError: false });
|
|
4536
|
+
var rd = () => ({ page: { ...Jl(), fetchedAt: Date.now() }, hasError: true });
|
|
4537
|
+
var id = (e6) => {
|
|
4538
|
+
throw e6;
|
|
4539
|
+
};
|
|
4540
|
+
var ad = (e6, t2) => Ln(e6, nd, t2 ? id : rd);
|
|
4541
|
+
var od = ({ children: e6, firstPagePromise: t2, monitoringClient: n2, language: r2, route: i2, categoryId: o2, categorySlug: s2, tagSlug: d2, postIds: f2, pageSize: m2, postOffset: h2, sortOrder: g2, featuredOnly: _2 }) => {
|
|
4542
|
+
let { page: v2, hasError: y2 } = Fn(t2), b2 = Ar(v2.fetchedAt), x2 = Jr(), S2 = Pr();
|
|
4543
|
+
Or(i2, v2, S2, n2), Ca(i2.kind === `category` ? v2.mismatchedCategory : void 0, r2, ru);
|
|
4544
|
+
let { t: C2 } = Pc(), w2 = Vr(), T2 = c(() => pl(C2, w2), [C2, w2]), [E2, D2] = u(v2.posts), [ee2, te2] = u(v2.authorsByMemberId), [ne2, re2] = u(v2.categoryLabelsById), [ie2, ae2] = u(v2.videoSourcesByPostId), [oe2, se2] = u(v2.hasMore), [ce2, le2] = u(false), [O2, ue2] = u(y2), de2 = l(h2 + v2.posts.length), fe2 = l(v2.hasMore), k2 = l(null), pe2 = a(async () => {
|
|
4545
|
+
if (k2.current) return k2.current;
|
|
4546
|
+
if (fe2.current) return le2(true), k2.current = ou({ offset: de2.current, limit: m2, language: r2, categoryId: o2, ...s2 && { categorySlug: s2 }, ...d2 && { tagSlug: d2 }, ...f2 && { postIds: f2.split(`,`) }, sortOrder: g2, featuredOnly: _2, propagateErrors: true }).then((e7) => {
|
|
4547
|
+
D2((t3) => [...t3, ...e7.posts]), te2((t3) => ({ ...t3, ...e7.authorsByMemberId })), re2((t3) => ({ ...t3, ...e7.categoryLabelsById })), ae2((t3) => ({ ...t3, ...e7.videoSourcesByPostId })), se2(e7.hasMore), fe2.current = e7.hasMore, de2.current += e7.posts.length, ue2(false);
|
|
4548
|
+
}).catch((e7) => {
|
|
4549
|
+
ue2(true), Tr(n2, e7, { feature: Sr.feed, action: `load-more-posts`, contexts: { feed: { offset: de2.current, pageSize: m2, categoryId: o2, categorySlug: s2, tagSlug: d2 } } });
|
|
4550
|
+
}).finally(() => {
|
|
4551
|
+
k2.current = null, le2(false);
|
|
4552
|
+
}), k2.current;
|
|
4553
|
+
}, [r2, o2, s2, d2, f2, m2, g2, _2, n2]), me2 = c(() => {
|
|
4554
|
+
let e7 = E2.map((e8) => zu(e8, T2, w2, S2, ee2, ne2, x2, ie2, b2)), t3 = E2.map((e8) => Bu(e8, S2, ie2[e8._id ?? ``] ?? [])).filter((e8) => e8 !== void 0), n3 = x2 && !_2 && !o2 && !f2 && !s2 && !d2;
|
|
4555
|
+
return { postsList: e7.length === 0 && n3 ? Ku(T2, w2, S2, b2) : e7, postGalleryItems: t3.length === 0 && n3 ? Gu(T2) : t3, emptyState: e7.length === 0 && !O2 ? T2.noPostsEmptyState() : null, hasError: O2, hasMorePosts: oe2, isLoadingPosts: ce2, loadMorePosts: pe2, filteredView: td(i2, v2) };
|
|
4556
|
+
}, [i2, v2, E2, ee2, ne2, ie2, T2, w2, S2, x2, b2, O2, _2, o2, f2, s2, d2, oe2, ce2, pe2]);
|
|
4557
|
+
return Lr(Fr.feedProvider, O2 ? `error` : E2.length > 0 ? `data` : `empty`), p(qu.Provider, { value: me2, children: e6 });
|
|
4558
|
+
};
|
|
4559
|
+
var sd = (e6, t2, n2, r2, i2, a2, o2, s2, c2) => `blog-builder:feed:${e6 ?? ``}|${t2 ?? ``}|c:${n2 ?? ``}|t:${r2 ?? ``}|p:${i2}|${a2}|${o2}|${s2}|${+!!c2}`;
|
|
4560
|
+
function cd({ children: e6, categoryPicker: n2, postsPicker: r2, pageSize: i2, postOffset: a2, sortOrder: o2, featuredOnly: s2, liveRefreshGeneration: l2 = 0 }) {
|
|
4561
|
+
let u2 = Br(), d2 = jr(), f2 = Wn(), h2 = f2.kind === `category` ? f2.slug : void 0, g2 = f2.kind === `tag` ? f2.slug : void 0, _2 = h2 || g2 ? void 0 : cu(n2), v2 = h2 || g2 ? `` : pu(r2).join(`,`), y2 = Xu(i2), b2 = Zu(a2), x2 = Qu(o2), S2 = s2 === true, C2 = Ta(), w2 = c(() => Cr(Nn), []), { i18n: T2, locale: E2 } = rl(dl), D2 = Nr(() => ({ language: u2, route: Vn(h2, g2), filterCategoryId: _2, filterPostIds: v2, categorySlug: h2, tagSlug: g2, pageSize: y2, postOffset: b2, sortOrder: x2, featuredOnly: S2, liveRefreshGeneration: l2, firstPagePromise: ad(Wc({ key: l2 > 0 ? null : sd(u2, _2, h2, g2, v2, y2, b2, x2, S2), warmupData: C2, fetchData: () => du(Er(w2, `feed-first-page`, { feature: Sr.feed, tags: { sortOrder: x2 } }, ou({ offset: b2, limit: y2, language: u2, categoryId: _2, ...h2 && { categorySlug: h2 }, ...g2 && { tagSlug: g2 }, ...v2 && { postIds: v2.split(`,`) }, sortOrder: x2, featuredOnly: S2, propagateErrors: true }))) }), d2) }), [u2, d2, _2, v2, h2, g2, y2, b2, x2, S2, l2, C2, w2]);
|
|
4562
|
+
return p(Fc, { i18n: T2, children: m(t, { fallback: p(qu.Provider, { value: $u, children: e6 }), children: [p(nl, { i18n: T2, locale: E2 }), p(uu, { fallback: p(qu.Provider, { value: ed, children: e6 }), feature: Sr.feed, monitoringClient: w2, rethrow: d2, children: p(od, { firstPagePromise: D2.firstPagePromise, monitoringClient: w2, language: D2.language, route: D2.route, categoryId: D2.filterCategoryId, categorySlug: D2.categorySlug, tagSlug: D2.tagSlug, postIds: D2.filterPostIds, pageSize: D2.pageSize, postOffset: D2.postOffset, sortOrder: D2.sortOrder, featuredOnly: D2.featuredOnly, children: e6 }, `${sd(D2.language, D2.filterCategoryId, D2.categorySlug, D2.tagSlug, D2.filterPostIds, D2.pageSize, D2.postOffset, D2.sortOrder, D2.featuredOnly)}#${D2.liveRefreshGeneration}`) })] }) });
|
|
4563
|
+
}
|
|
4564
|
+
var ld = En(`ada94d8c-4889-444e-b773-f1a875693fdb`);
|
|
4565
|
+
export {
|
|
4566
|
+
cd as PostListProvider,
|
|
4567
|
+
cd as default,
|
|
4568
|
+
ld as injectAccessTokenGetter,
|
|
4569
|
+
Ju as useBlogFeedContext
|
|
4570
|
+
};
|
|
4571
|
+
//# sourceMappingURL=context-blog-feed-context-provider.mjs.map
|