@ichaingo/with-login 1.5.7-beta → 1.5.7
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/dist/index.d.ts.map +1 -1
- package/dist/index.js +75 -3378
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,3406 +1,103 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
return Object.freeze(Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }));
|
|
23
|
-
}
|
|
24
|
-
function Ne(t) {
|
|
25
|
-
return !!(t && typeof t.then == "function");
|
|
26
|
-
}
|
|
27
|
-
function dt(t, e) {
|
|
28
|
-
return Ne(t) ? Promise.resolve(t).then(e) : e(t);
|
|
29
|
-
}
|
|
30
|
-
function ke(t, e, a) {
|
|
31
|
-
function n(r) {
|
|
32
|
-
const o = e(r);
|
|
33
|
-
throw t.emit(o), console.error(o), o;
|
|
34
|
-
}
|
|
35
|
-
try {
|
|
36
|
-
const r = a();
|
|
37
|
-
return Ne(r) ? r.catch(n) : r;
|
|
38
|
-
} catch (r) {
|
|
39
|
-
n(r);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
function ue(t) {
|
|
43
|
-
const e = (Array.isArray(t) ? t : [t]).map((o) => `'${o}'`), a = e.slice(-2).join(" or ");
|
|
44
|
-
return `Tolgee: You need to specify ${[...e.slice(0, -2), a].join(", ")} option`;
|
|
45
|
-
}
|
|
46
|
-
function Xn(t) {
|
|
47
|
-
return typeof t == "object" && !Array.isArray(t) && t !== null;
|
|
48
|
-
}
|
|
49
|
-
function Gn(t) {
|
|
50
|
-
if (typeof t == "string")
|
|
51
|
-
return [t];
|
|
52
|
-
if (Array.isArray(t))
|
|
53
|
-
return t;
|
|
54
|
-
}
|
|
55
|
-
function X(t) {
|
|
56
|
-
return Gn(t) || [];
|
|
57
|
-
}
|
|
58
|
-
function Wn(t, e) {
|
|
59
|
-
return Xn(e) ? X(e == null ? void 0 : e[t]) : X(e);
|
|
60
|
-
}
|
|
61
|
-
function ne(t) {
|
|
62
|
-
return Array.from(new Set(t));
|
|
63
|
-
}
|
|
64
|
-
function hn(t) {
|
|
65
|
-
return t && t.replace(/\/+$/, "");
|
|
66
|
-
}
|
|
67
|
-
function zn(t) {
|
|
68
|
-
if (typeof t == "string")
|
|
69
|
-
return t;
|
|
70
|
-
if (typeof (t == null ? void 0 : t.message) == "string")
|
|
71
|
-
return t.message;
|
|
72
|
-
}
|
|
73
|
-
const Yn = (t, e) => fetch(t, e);
|
|
74
|
-
function Kn(t) {
|
|
75
|
-
return Object.fromEntries(new Headers(t).entries());
|
|
76
|
-
}
|
|
77
|
-
const En = (t = Yn) => (e, a) => {
|
|
78
|
-
let n = Kn(a == null ? void 0 : a.headers);
|
|
79
|
-
return n["x-api-key"] && (n = Object.assign({ "x-tolgee-sdk-type": "JS", "x-tolgee-sdk-version": "prerelease" }, n)), t(e, Object.assign(Object.assign({}, a), { headers: n }));
|
|
80
|
-
}, W = (t, e) => {
|
|
81
|
-
let a = [];
|
|
82
|
-
return {
|
|
83
|
-
listen(n) {
|
|
84
|
-
const r = (o) => {
|
|
85
|
-
n(o);
|
|
86
|
-
};
|
|
87
|
-
return a.push(r), {
|
|
88
|
-
unsubscribe() {
|
|
89
|
-
a = a.filter((o) => r !== o);
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
},
|
|
93
|
-
emit(n) {
|
|
94
|
-
e() && a.forEach((r) => r({ type: t, value: n }));
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
};
|
|
98
|
-
function Vn(t) {
|
|
99
|
-
let e = [], a = [];
|
|
100
|
-
function n() {
|
|
101
|
-
if (a.length === 0)
|
|
102
|
-
return;
|
|
103
|
-
const r = a;
|
|
104
|
-
a = [], e.forEach((o) => {
|
|
105
|
-
o(r);
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
return Object.freeze({
|
|
109
|
-
listen(r) {
|
|
110
|
-
const o = (i) => {
|
|
111
|
-
r(i);
|
|
112
|
-
};
|
|
113
|
-
return e.push(o), {
|
|
114
|
-
unsubscribe() {
|
|
115
|
-
e = e.filter((i) => o !== i);
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
},
|
|
119
|
-
emit(r, o) {
|
|
120
|
-
t() && t() && (a.push(r), o ? setTimeout(n, 0) : n());
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
function Qn() {
|
|
125
|
-
let t = !0;
|
|
126
|
-
function e() {
|
|
127
|
-
return t;
|
|
128
|
-
}
|
|
129
|
-
const a = Object.freeze({
|
|
130
|
-
onPendingLanguageChange: W("pendingLanguage", e),
|
|
131
|
-
onLanguageChange: W("language", e),
|
|
132
|
-
onLoadingChange: W("loading", e),
|
|
133
|
-
onFetchingChange: W("fetching", e),
|
|
134
|
-
onInitialLoaded: W("initialLoad", e),
|
|
135
|
-
onRunningChange: W("running", e),
|
|
136
|
-
onCacheChange: W("cache", e),
|
|
137
|
-
onPermanentChange: W("permanentChange", e),
|
|
138
|
-
onError: W("error", e),
|
|
139
|
-
onUpdate: Vn(e),
|
|
140
|
-
setEmitterActive(n) {
|
|
141
|
-
t = n;
|
|
142
|
-
},
|
|
143
|
-
on: (n, r) => {
|
|
144
|
-
switch (n) {
|
|
145
|
-
case "pendingLanguage":
|
|
146
|
-
return a.onPendingLanguageChange.listen(r);
|
|
147
|
-
case "language":
|
|
148
|
-
return a.onLanguageChange.listen(r);
|
|
149
|
-
case "loading":
|
|
150
|
-
return a.onLoadingChange.listen(r);
|
|
151
|
-
case "fetching":
|
|
152
|
-
return a.onFetchingChange.listen(r);
|
|
153
|
-
case "initialLoad":
|
|
154
|
-
return a.onInitialLoaded.listen(r);
|
|
155
|
-
case "running":
|
|
156
|
-
return a.onRunningChange.listen(r);
|
|
157
|
-
case "cache":
|
|
158
|
-
return a.onCacheChange.listen(r);
|
|
159
|
-
case "update":
|
|
160
|
-
return a.onUpdate.listen(r);
|
|
161
|
-
case "permanentChange":
|
|
162
|
-
return a.onPermanentChange.listen(r);
|
|
163
|
-
case "error":
|
|
164
|
-
return a.onError.listen(r);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
return a.onInitialLoaded.listen((n) => a.onUpdate.emit(n, !1)), a.onLanguageChange.listen((n) => a.onUpdate.emit(n, !1)), a.onCacheChange.listen((n) => a.onUpdate.emit(n, !0)), a;
|
|
169
|
-
}
|
|
170
|
-
class Rt extends Error {
|
|
171
|
-
constructor(e, a, n = !1) {
|
|
172
|
-
const { language: r, namespace: o } = e;
|
|
173
|
-
super(`Tolgee: Failed to fetch record for "${r}"${o && ` and "${o}"`}`), this.cause = a, this.isDev = n, this.name = "RecordFetchError", this.language = r, this.namespace = o;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
class Jn extends Error {
|
|
177
|
-
constructor(e, a) {
|
|
178
|
-
super(e), this.cause = a, this.name = "LanguageDetectorError";
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
class bt extends Error {
|
|
182
|
-
constructor(e, a) {
|
|
183
|
-
super(e), this.cause = a, this.name = "LanguageStorageError";
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
const mn = (t) => {
|
|
187
|
-
const e = /* @__PURE__ */ new Map();
|
|
188
|
-
return Object.entries(t).forEach(([a, n]) => {
|
|
189
|
-
if (n != null) {
|
|
190
|
-
if (typeof n == "object") {
|
|
191
|
-
mn(n).forEach((r, o) => {
|
|
192
|
-
e.set(a + "." + o, r);
|
|
193
|
-
});
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
e.set(a, n);
|
|
197
|
-
}
|
|
198
|
-
}), e;
|
|
199
|
-
}, te = (t) => Object.fromEntries(mn(t).entries()), Z = (t) => {
|
|
200
|
-
const [e, ...a] = t.split(":"), n = a.join(":");
|
|
201
|
-
return { language: e, namespace: n || "" };
|
|
202
|
-
}, B = ({ language: t, namespace: e }) => e ? `${t}:${e}` : t;
|
|
203
|
-
function Zn(t, e, a, n, r, o, i) {
|
|
204
|
-
const u = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
|
|
205
|
-
let s = {}, R = 0;
|
|
206
|
-
function b(p, m, l) {
|
|
207
|
-
const _ = B(p);
|
|
208
|
-
c.set(_, {
|
|
209
|
-
data: te(m),
|
|
210
|
-
version: l
|
|
211
|
-
}), t.onCacheChange.emit(Z(_));
|
|
212
|
-
}
|
|
213
|
-
async function P(p) {
|
|
214
|
-
function m(E) {
|
|
215
|
-
const g = new Rt(p, E);
|
|
216
|
-
throw t.onError.emit(g), console.error(g), g;
|
|
217
|
-
}
|
|
218
|
-
const l = e(p);
|
|
219
|
-
if (Ne(l)) {
|
|
220
|
-
const E = await l.catch(m);
|
|
221
|
-
if (E !== void 0)
|
|
222
|
-
return E;
|
|
223
|
-
}
|
|
224
|
-
const _ = s[B(p)];
|
|
225
|
-
if (typeof _ == "function")
|
|
226
|
-
try {
|
|
227
|
-
return await _();
|
|
228
|
-
} catch (E) {
|
|
229
|
-
m(E);
|
|
230
|
-
}
|
|
231
|
-
else
|
|
232
|
-
return _;
|
|
233
|
-
}
|
|
234
|
-
async function S(p, m) {
|
|
235
|
-
let l;
|
|
236
|
-
if (m)
|
|
237
|
-
try {
|
|
238
|
-
l = await a(p);
|
|
239
|
-
} catch (_) {
|
|
240
|
-
const E = new Rt(p, _, !0);
|
|
241
|
-
t.onError.emit(E), console.warn(E);
|
|
242
|
-
}
|
|
243
|
-
return l || (l = await P(p)), l;
|
|
244
|
-
}
|
|
245
|
-
const D = Object.freeze({
|
|
246
|
-
addStaticData(p) {
|
|
247
|
-
if (Array.isArray(p))
|
|
248
|
-
for (const m of p) {
|
|
249
|
-
const l = B(m), _ = c.get(l);
|
|
250
|
-
(!_ || _.version === 0) && b(m, te(m.data), 0);
|
|
251
|
-
}
|
|
252
|
-
else p && (s = Object.assign(Object.assign({}, s), p), Object.entries(p).forEach(([m, l]) => {
|
|
253
|
-
if (typeof l != "function") {
|
|
254
|
-
const _ = Z(m), E = c.get(m);
|
|
255
|
-
(!E || E.version === 0) && b(_, te(l), 0);
|
|
256
|
-
}
|
|
257
|
-
}));
|
|
258
|
-
},
|
|
259
|
-
invalidate() {
|
|
260
|
-
u.clear(), R += 1;
|
|
261
|
-
},
|
|
262
|
-
addRecord(p, m) {
|
|
263
|
-
b(p, te(m), R);
|
|
264
|
-
},
|
|
265
|
-
exists(p, m = !1) {
|
|
266
|
-
const l = c.get(B(p));
|
|
267
|
-
return l && m ? l.version === R : !!l;
|
|
268
|
-
},
|
|
269
|
-
getRecord(p) {
|
|
270
|
-
const m = n(p), l = B(m), _ = c.get(l);
|
|
271
|
-
if (_)
|
|
272
|
-
return Object.assign(Object.assign({}, m), { cacheKey: l, data: _.data });
|
|
273
|
-
},
|
|
274
|
-
getAllRecords() {
|
|
275
|
-
return Array.from(c.entries()).map(([m]) => D.getRecord(Z(m)));
|
|
276
|
-
},
|
|
277
|
-
getTranslation(p, m) {
|
|
278
|
-
var l;
|
|
279
|
-
return (l = c.get(B(p))) === null || l === void 0 ? void 0 : l.data[m];
|
|
280
|
-
},
|
|
281
|
-
getTranslationNs(p, m, l) {
|
|
282
|
-
var _;
|
|
283
|
-
for (const E of p)
|
|
284
|
-
for (const g of m) {
|
|
285
|
-
const v = (_ = c.get(B({ language: g, namespace: E }))) === null || _ === void 0 ? void 0 : _.data[l];
|
|
286
|
-
if (v != null)
|
|
287
|
-
return [E];
|
|
288
|
-
}
|
|
289
|
-
return ne(p);
|
|
290
|
-
},
|
|
291
|
-
getTranslationFallback(p, m, l) {
|
|
292
|
-
var _;
|
|
293
|
-
for (const E of p)
|
|
294
|
-
for (const g of m) {
|
|
295
|
-
const v = (_ = c.get(B({ language: g, namespace: E }))) === null || _ === void 0 ? void 0 : _.data[l];
|
|
296
|
-
if (v != null)
|
|
297
|
-
return v;
|
|
298
|
-
}
|
|
299
|
-
},
|
|
300
|
-
changeTranslation(p, m, l) {
|
|
301
|
-
var _;
|
|
302
|
-
const E = (_ = c.get(B(p))) === null || _ === void 0 ? void 0 : _.data;
|
|
303
|
-
E && (E[m] = l, t.onCacheChange.emit(Object.assign(Object.assign({}, p), { key: m })));
|
|
304
|
-
},
|
|
305
|
-
isFetching(p) {
|
|
306
|
-
if (r())
|
|
307
|
-
return !0;
|
|
308
|
-
if (p === void 0)
|
|
309
|
-
return u.size > 0;
|
|
310
|
-
const m = X(p);
|
|
311
|
-
return !!Array.from(u.keys()).find((l) => m.includes(Z(l).namespace));
|
|
312
|
-
},
|
|
313
|
-
isLoading(p, m) {
|
|
314
|
-
const l = X(m);
|
|
315
|
-
return r() ? !0 : !!Array.from(u.keys()).find((E) => {
|
|
316
|
-
const g = Z(E);
|
|
317
|
-
return (!l.length || l.includes(g.namespace)) && !D.exists({
|
|
318
|
-
namespace: g.namespace,
|
|
319
|
-
language: p
|
|
320
|
-
});
|
|
321
|
-
});
|
|
322
|
-
},
|
|
323
|
-
async loadRecords(p, m) {
|
|
324
|
-
const l = p.map((g) => {
|
|
325
|
-
const v = n(g), O = B(v);
|
|
326
|
-
if (m != null && m.useCache && D.exists(v, !0))
|
|
327
|
-
return Object.assign(Object.assign({}, v), { new: !1, cacheKey: O, data: D.getRecord(v).data });
|
|
328
|
-
const f = u.get(O);
|
|
329
|
-
if (f)
|
|
330
|
-
return Object.assign(Object.assign({}, v), { new: !1, promise: f, cacheKey: O });
|
|
331
|
-
const A = S(v, !(m != null && m.noDev)) || Promise.resolve(void 0);
|
|
332
|
-
return u.set(O, A), Object.assign(Object.assign({}, v), { new: !0, promise: A, cacheKey: O });
|
|
333
|
-
});
|
|
334
|
-
o.notify(), i.notify();
|
|
335
|
-
const _ = l.map((g) => g.promise).filter(Boolean), E = await Promise.all(_);
|
|
336
|
-
return l.forEach((g) => {
|
|
337
|
-
var v;
|
|
338
|
-
g.promise && (g.data = te((v = E[0]) !== null && v !== void 0 ? v : {}), E.shift());
|
|
339
|
-
const O = u.get(g.cacheKey) !== g.promise;
|
|
340
|
-
g.new && !O && (u.delete(g.cacheKey), g.data ? D.addRecord(g, g.data) : D.getRecord(g) || D.addRecord(g, {}));
|
|
341
|
-
}), o.notify(), i.notify(), l.map((g) => {
|
|
342
|
-
var v;
|
|
343
|
-
return {
|
|
344
|
-
language: g.language,
|
|
345
|
-
namespace: g.namespace,
|
|
346
|
-
data: (v = g.data) !== null && v !== void 0 ? v : {},
|
|
347
|
-
cacheKey: g.cacheKey
|
|
348
|
-
};
|
|
349
|
-
});
|
|
350
|
-
}
|
|
351
|
-
});
|
|
352
|
-
return D;
|
|
353
|
-
}
|
|
354
|
-
function yn(t, e) {
|
|
355
|
-
var a = {};
|
|
356
|
-
for (var n in t)
|
|
357
|
-
Object.prototype.hasOwnProperty.call(t, n) && e.indexOf(n) < 0 && (a[n] = t[n]);
|
|
358
|
-
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
359
|
-
for (var r = 0, n = Object.getOwnPropertySymbols(t); r < n.length; r++)
|
|
360
|
-
e.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[r]) && (a[n[r]] = t[n[r]]);
|
|
361
|
-
return a;
|
|
362
|
-
}
|
|
363
|
-
const $n = {
|
|
364
|
-
tagAttributes: {
|
|
365
|
-
textarea: ["placeholder"],
|
|
366
|
-
input: ["value", "placeholder"],
|
|
367
|
-
img: ["alt"],
|
|
368
|
-
"*": ["aria-label", "title"]
|
|
369
|
-
},
|
|
370
|
-
restrictedElements: ["script", "style"],
|
|
371
|
-
highlightKeys: ["Alt"],
|
|
372
|
-
highlightColor: "rgb(255, 0, 0)",
|
|
373
|
-
highlightWidth: 5,
|
|
374
|
-
inputPrefix: "%-%tolgee:",
|
|
375
|
-
inputSuffix: "%-%",
|
|
376
|
-
passToParent: ["option", "optgroup"],
|
|
377
|
-
fullKeyEncode: !1
|
|
378
|
-
}, ft = "invalid", er = "https://app.tolgee.io", tr = ({ key: t }) => t, nr = {
|
|
379
|
-
observerOptions: $n,
|
|
380
|
-
observerType: "invisible",
|
|
381
|
-
onFormatError: ft,
|
|
382
|
-
apiUrl: er,
|
|
383
|
-
autoLoadRequiredData: !0,
|
|
384
|
-
fetch: En(),
|
|
385
|
-
onTranslationMissing: tr
|
|
386
|
-
}, gt = (...t) => {
|
|
387
|
-
let e = {};
|
|
388
|
-
return t.forEach((a) => {
|
|
389
|
-
e = Object.assign(Object.assign(Object.assign({}, e), a), { observerOptions: Object.assign(Object.assign({}, e.observerOptions), a == null ? void 0 : a.observerOptions) });
|
|
390
|
-
}), e;
|
|
391
|
-
};
|
|
392
|
-
function Ot(t, e) {
|
|
393
|
-
const a = gt(nr, e == null ? void 0 : e.initialOptions, t);
|
|
394
|
-
return a.apiUrl = hn(a.apiUrl), t != null && t.fetch && (a.fetch = En(t.fetch)), {
|
|
395
|
-
initialOptions: a,
|
|
396
|
-
activeNamespaces: (e == null ? void 0 : e.activeNamespaces) || /* @__PURE__ */ new Map(),
|
|
397
|
-
language: e == null ? void 0 : e.language,
|
|
398
|
-
pendingLanguage: e == null ? void 0 : e.language,
|
|
399
|
-
isInitialLoading: !1,
|
|
400
|
-
isRunning: !1
|
|
401
|
-
};
|
|
402
|
-
}
|
|
403
|
-
function rr(t, e, a, n, r, o, i, u) {
|
|
404
|
-
const c = {
|
|
405
|
-
ui: void 0
|
|
406
|
-
}, s = {
|
|
407
|
-
formatters: [],
|
|
408
|
-
finalFormatter: void 0,
|
|
409
|
-
observer: void 0,
|
|
410
|
-
devBackend: void 0,
|
|
411
|
-
backends: [],
|
|
412
|
-
ui: void 0,
|
|
413
|
-
languageDetector: void 0,
|
|
414
|
-
languageStorage: void 0
|
|
415
|
-
}, R = async ({ keysAndDefaults: h, target: w }) => {
|
|
416
|
-
var C;
|
|
417
|
-
const M = h.map(({ key: k, ns: U, defaultValue: H }) => ({
|
|
418
|
-
key: k,
|
|
419
|
-
defaultValue: H,
|
|
420
|
-
fallbackNamespaces: n(U),
|
|
421
|
-
namespace: r({ key: k, ns: U })[0],
|
|
422
|
-
translation: o({
|
|
423
|
-
key: k,
|
|
424
|
-
ns: U
|
|
425
|
-
})
|
|
426
|
-
}));
|
|
427
|
-
(C = s.ui) === null || C === void 0 || C.handleElementClick(M, w);
|
|
428
|
-
}, b = (h, w) => {
|
|
429
|
-
var C;
|
|
430
|
-
return ((C = s.observer) === null || C === void 0 ? void 0 : C.findPositions(h, w)) || [];
|
|
431
|
-
};
|
|
432
|
-
function P(h) {
|
|
433
|
-
const w = o({
|
|
434
|
-
key: h.key,
|
|
435
|
-
ns: h.ns
|
|
436
|
-
});
|
|
437
|
-
return N.formatTranslation(Object.assign(Object.assign({}, h), { translation: w, formatEnabled: !0 }));
|
|
438
|
-
}
|
|
439
|
-
function S() {
|
|
440
|
-
return { fetch: e().fetch };
|
|
441
|
-
}
|
|
442
|
-
function D(h) {
|
|
443
|
-
s.observer = h == null ? void 0 : h();
|
|
444
|
-
}
|
|
445
|
-
function p() {
|
|
446
|
-
return !!s.observer;
|
|
447
|
-
}
|
|
448
|
-
function m(h) {
|
|
449
|
-
h && s.formatters.push(h);
|
|
450
|
-
}
|
|
451
|
-
function l(h) {
|
|
452
|
-
s.finalFormatter = h;
|
|
453
|
-
}
|
|
454
|
-
function _(h) {
|
|
455
|
-
c.ui = h;
|
|
456
|
-
}
|
|
457
|
-
function E() {
|
|
458
|
-
return !!c.ui;
|
|
459
|
-
}
|
|
460
|
-
function g(h) {
|
|
461
|
-
s.languageStorage = h;
|
|
462
|
-
}
|
|
463
|
-
function v(h) {
|
|
464
|
-
s.languageDetector = h;
|
|
465
|
-
}
|
|
466
|
-
function O() {
|
|
467
|
-
return ke(u.onError, (h) => new bt("Tolgee: Failed to load language", h), () => {
|
|
468
|
-
var h;
|
|
469
|
-
return (h = s.languageStorage) === null || h === void 0 ? void 0 : h.getLanguage(S());
|
|
470
|
-
});
|
|
471
|
-
}
|
|
472
|
-
function f() {
|
|
473
|
-
if (!s.languageDetector)
|
|
474
|
-
return;
|
|
475
|
-
const h = a();
|
|
476
|
-
return ke(u.onError, (w) => new Jn("Tolgee: Failed to detect language", w), () => {
|
|
477
|
-
var w;
|
|
478
|
-
return (w = s.languageDetector) === null || w === void 0 ? void 0 : w.getLanguage(Object.assign({ availableLanguages: h }, S()));
|
|
479
|
-
});
|
|
480
|
-
}
|
|
481
|
-
function A(h) {
|
|
482
|
-
h && s.backends.push(h);
|
|
483
|
-
}
|
|
484
|
-
function L(h) {
|
|
485
|
-
s.devBackend = h;
|
|
486
|
-
}
|
|
487
|
-
function I(h, w) {
|
|
488
|
-
const C = Object.freeze({
|
|
489
|
-
setFinalFormatter: l,
|
|
490
|
-
addFormatter: m,
|
|
491
|
-
setObserver: D,
|
|
492
|
-
hasObserver: p,
|
|
493
|
-
setUi: _,
|
|
494
|
-
hasUi: E,
|
|
495
|
-
setDevBackend: L,
|
|
496
|
-
addBackend: A,
|
|
497
|
-
setLanguageDetector: v,
|
|
498
|
-
setLanguageStorage: g
|
|
499
|
-
});
|
|
500
|
-
w(h, C);
|
|
501
|
-
}
|
|
502
|
-
const N = Object.freeze({
|
|
503
|
-
addPlugin: I,
|
|
504
|
-
findPositions: b,
|
|
505
|
-
run() {
|
|
506
|
-
var h, w;
|
|
507
|
-
const { apiKey: C, apiUrl: M, projectId: k, observerOptions: U, tagNewKeys: H, filterTag: $ } = e();
|
|
508
|
-
s.ui = (h = c.ui) === null || h === void 0 ? void 0 : h.call(c, {
|
|
509
|
-
apiKey: C,
|
|
510
|
-
apiUrl: M,
|
|
511
|
-
projectId: k,
|
|
512
|
-
highlight: N.highlight,
|
|
513
|
-
changeTranslation: i,
|
|
514
|
-
findPositions: b,
|
|
515
|
-
onPermanentChange: (Y) => u.onPermanentChange.emit(Y),
|
|
516
|
-
tagNewKeys: H,
|
|
517
|
-
filterTag: $
|
|
518
|
-
}), (w = s.observer) === null || w === void 0 || w.run({
|
|
519
|
-
mouseHighlight: !!s.ui,
|
|
520
|
-
options: U,
|
|
521
|
-
translate: P,
|
|
522
|
-
onClick: R
|
|
523
|
-
});
|
|
524
|
-
},
|
|
525
|
-
stop() {
|
|
526
|
-
var h;
|
|
527
|
-
s.ui = void 0, (h = s.observer) === null || h === void 0 || h.stop();
|
|
528
|
-
},
|
|
529
|
-
getLanguageStorage() {
|
|
530
|
-
return s.languageStorage;
|
|
531
|
-
},
|
|
532
|
-
getInitialLanguage() {
|
|
533
|
-
const h = a(), w = O();
|
|
534
|
-
return dt(w, (C) => (!h || h.includes(C)) && C ? C : f());
|
|
535
|
-
},
|
|
536
|
-
setStoredLanguage(h) {
|
|
537
|
-
return ke(u.onError, (w) => new bt("Tolgee: Failed to store language", w), () => {
|
|
538
|
-
var w;
|
|
539
|
-
return (w = s.languageStorage) === null || w === void 0 ? void 0 : w.setLanguage(h, S());
|
|
540
|
-
});
|
|
541
|
-
},
|
|
542
|
-
getDevBackend() {
|
|
543
|
-
return s.devBackend;
|
|
544
|
-
},
|
|
545
|
-
getBackendRecord: async ({ language: h, namespace: w }) => {
|
|
546
|
-
for (const C of s.backends) {
|
|
547
|
-
const M = await C.getRecord(Object.assign({
|
|
548
|
-
language: h,
|
|
549
|
-
namespace: w
|
|
550
|
-
}, S()));
|
|
551
|
-
if (M !== void 0)
|
|
552
|
-
return M;
|
|
553
|
-
}
|
|
554
|
-
},
|
|
555
|
-
getBackendDevRecord: async ({ language: h, namespace: w }) => {
|
|
556
|
-
var C;
|
|
557
|
-
const { apiKey: M, apiUrl: k, projectId: U, filterTag: H } = e();
|
|
558
|
-
if (!(!M || !k || !N.hasDevBackend()))
|
|
559
|
-
return (C = s.devBackend) === null || C === void 0 ? void 0 : C.getRecord(Object.assign({
|
|
560
|
-
apiKey: M,
|
|
561
|
-
apiUrl: k,
|
|
562
|
-
projectId: U,
|
|
563
|
-
language: h,
|
|
564
|
-
namespace: w,
|
|
565
|
-
filterTag: H
|
|
566
|
-
}, S()));
|
|
567
|
-
},
|
|
568
|
-
getLanguageDetector() {
|
|
569
|
-
return s.languageDetector;
|
|
570
|
-
},
|
|
571
|
-
retranslate() {
|
|
572
|
-
var h;
|
|
573
|
-
(h = s.observer) === null || h === void 0 || h.retranslate();
|
|
574
|
-
},
|
|
575
|
-
highlight: (h, w) => {
|
|
576
|
-
var C, M;
|
|
577
|
-
return ((M = (C = s.observer) === null || C === void 0 ? void 0 : C.highlight) === null || M === void 0 ? void 0 : M.call(C, h, w)) || { unhighlight() {
|
|
578
|
-
} };
|
|
579
|
-
},
|
|
580
|
-
unwrap(h) {
|
|
581
|
-
var w;
|
|
582
|
-
return s.observer ? (w = s.observer) === null || w === void 0 ? void 0 : w.unwrap(h) : { text: h, keys: [] };
|
|
583
|
-
},
|
|
584
|
-
wrap(h) {
|
|
585
|
-
var w;
|
|
586
|
-
return s.observer ? (w = s.observer) === null || w === void 0 ? void 0 : w.wrap(h) : h.translation;
|
|
587
|
-
},
|
|
588
|
-
hasDevBackend() {
|
|
589
|
-
return !!N.getDevBackend();
|
|
590
|
-
},
|
|
591
|
-
formatTranslation(h) {
|
|
592
|
-
var w, { formatEnabled: C } = h, M = yn(h, ["formatEnabled"]);
|
|
593
|
-
const { key: k, translation: U, defaultValue: H, noWrap: $, params: Y, ns: Ie, orEmpty: Me } = M, K = U ?? H;
|
|
594
|
-
let re = "";
|
|
595
|
-
U == null && (re = e().onTranslationMissing(M));
|
|
596
|
-
let x = K ?? (Me ? "" : re);
|
|
597
|
-
const Q = t(), ae = C || !(!((w = s.observer) === null || w === void 0) && w.outputNotFormattable), oe = (G) => s.observer && !$ ? s.observer.wrap({
|
|
598
|
-
key: k,
|
|
599
|
-
translation: G,
|
|
600
|
-
defaultValue: H,
|
|
601
|
-
params: Y,
|
|
602
|
-
ns: Ie
|
|
603
|
-
}) : G;
|
|
604
|
-
x = oe(x);
|
|
605
|
-
try {
|
|
606
|
-
if (K && Q && ae)
|
|
607
|
-
for (const G of s.formatters)
|
|
608
|
-
x = G.format({
|
|
609
|
-
translation: x,
|
|
610
|
-
language: Q,
|
|
611
|
-
params: Y
|
|
612
|
-
});
|
|
613
|
-
s.finalFormatter && K && Q && ae && (x = s.finalFormatter.format({
|
|
614
|
-
translation: x,
|
|
615
|
-
language: Q,
|
|
616
|
-
params: Y
|
|
617
|
-
}));
|
|
618
|
-
} catch (G) {
|
|
619
|
-
console.error(G);
|
|
620
|
-
const Ue = zn(G) || ft, ee = e().onFormatError, ie = typeof ee;
|
|
621
|
-
ie === "string" ? x = ee : ie === "function" ? x = ee(Ue, M) : x = ft, x = oe(x);
|
|
622
|
-
}
|
|
623
|
-
return x;
|
|
624
|
-
}
|
|
625
|
-
});
|
|
626
|
-
return N;
|
|
627
|
-
}
|
|
628
|
-
const Tt = (t, e, a) => {
|
|
629
|
-
let n = t;
|
|
630
|
-
return Object.freeze({
|
|
631
|
-
init(r) {
|
|
632
|
-
n = r;
|
|
633
|
-
},
|
|
634
|
-
notify() {
|
|
635
|
-
const r = e();
|
|
636
|
-
n !== r && a(r), n = r;
|
|
637
|
-
}
|
|
638
|
-
});
|
|
639
|
-
};
|
|
640
|
-
function ar(t, e, a) {
|
|
641
|
-
let n = Ot(), r;
|
|
642
|
-
const o = Object.freeze({
|
|
643
|
-
init(i) {
|
|
644
|
-
n = Ot(i, n);
|
|
645
|
-
},
|
|
646
|
-
isRunning() {
|
|
647
|
-
return n.isRunning;
|
|
648
|
-
},
|
|
649
|
-
setRunning(i) {
|
|
650
|
-
n.isRunning !== i && (n.isRunning = i, a.emit(i));
|
|
651
|
-
},
|
|
652
|
-
isInitialLoading() {
|
|
653
|
-
return n.isInitialLoading;
|
|
654
|
-
},
|
|
655
|
-
setInitialLoading(i) {
|
|
656
|
-
n.isInitialLoading = i;
|
|
657
|
-
},
|
|
658
|
-
getLanguage() {
|
|
659
|
-
return n.language || n.initialOptions.language;
|
|
660
|
-
},
|
|
661
|
-
setLanguage(i) {
|
|
662
|
-
n.language !== i && (n.language = i, t.emit(i));
|
|
663
|
-
},
|
|
664
|
-
getPendingLanguage() {
|
|
665
|
-
return n.pendingLanguage || o.getLanguage();
|
|
666
|
-
},
|
|
667
|
-
setPendingLanguage(i) {
|
|
668
|
-
n.pendingLanguage !== i && (n.pendingLanguage = i, e.emit(i));
|
|
669
|
-
},
|
|
670
|
-
getInitialOptions() {
|
|
671
|
-
return Object.assign(Object.assign({}, n.initialOptions), r);
|
|
672
|
-
},
|
|
673
|
-
addActiveNs(i) {
|
|
674
|
-
X(i).forEach((c) => {
|
|
675
|
-
const s = n.activeNamespaces.get(c);
|
|
676
|
-
s !== void 0 ? n.activeNamespaces.set(c, s + 1) : n.activeNamespaces.set(c, 1);
|
|
677
|
-
});
|
|
678
|
-
},
|
|
679
|
-
removeActiveNs(i) {
|
|
680
|
-
X(i).forEach((c) => {
|
|
681
|
-
const s = n.activeNamespaces.get(c);
|
|
682
|
-
s !== void 0 && s > 1 ? n.activeNamespaces.set(c, s - 1) : n.activeNamespaces.delete(c);
|
|
683
|
-
});
|
|
684
|
-
},
|
|
685
|
-
getRequiredNamespaces() {
|
|
686
|
-
return ne([
|
|
687
|
-
o.getDefaultNs(),
|
|
688
|
-
...n.initialOptions.ns || [],
|
|
689
|
-
...X(n.initialOptions.fallbackNs),
|
|
690
|
-
...n.activeNamespaces.keys()
|
|
691
|
-
]);
|
|
692
|
-
},
|
|
693
|
-
getFallbackLangs(i) {
|
|
694
|
-
const u = i || o.getLanguage();
|
|
695
|
-
return u ? ne([
|
|
696
|
-
u,
|
|
697
|
-
...Wn(u, n.initialOptions.fallbackLanguage)
|
|
698
|
-
]) : [];
|
|
699
|
-
},
|
|
700
|
-
getFallbackNs() {
|
|
701
|
-
return X(n.initialOptions.fallbackNs);
|
|
702
|
-
},
|
|
703
|
-
getNs() {
|
|
704
|
-
var i, u;
|
|
705
|
-
return !((i = n.initialOptions.ns) === null || i === void 0) && i.length ? n.initialOptions.ns : [(u = n.initialOptions.defaultNs) !== null && u !== void 0 ? u : ""];
|
|
706
|
-
},
|
|
707
|
-
getDefaultNs(i) {
|
|
708
|
-
var u, c, s;
|
|
709
|
-
return i === void 0 ? (s = (u = n.initialOptions.defaultNs) !== null && u !== void 0 ? u : (c = n.initialOptions.ns) === null || c === void 0 ? void 0 : c[0]) !== null && s !== void 0 ? s : "" : i;
|
|
710
|
-
},
|
|
711
|
-
getAvailableLanguages() {
|
|
712
|
-
if (n.initialOptions.availableLanguages)
|
|
713
|
-
return n.initialOptions.availableLanguages;
|
|
714
|
-
if (n.initialOptions.staticData) {
|
|
715
|
-
const i = Object.keys(n.initialOptions.staticData).map((u) => Z(u).language);
|
|
716
|
-
return Array.from(new Set(i));
|
|
717
|
-
}
|
|
718
|
-
},
|
|
719
|
-
getAvailableNs() {
|
|
720
|
-
return n.initialOptions.availableNs;
|
|
721
|
-
},
|
|
722
|
-
withDefaultNs(i) {
|
|
723
|
-
return {
|
|
724
|
-
namespace: i.namespace === void 0 ? o.getDefaultNs() : i.namespace,
|
|
725
|
-
language: i.language
|
|
726
|
-
};
|
|
727
|
-
},
|
|
728
|
-
overrideCredentials(i) {
|
|
729
|
-
i ? r = Object.assign(Object.assign({}, i), { apiUrl: hn(i.apiUrl) }) : r = void 0;
|
|
730
|
-
}
|
|
731
|
-
});
|
|
732
|
-
return o;
|
|
733
|
-
}
|
|
734
|
-
function or(t) {
|
|
735
|
-
var { ns: e, noWrap: a, orEmpty: n, params: r, language: o } = t, i = yn(t, ["ns", "noWrap", "orEmpty", "params", "language"]);
|
|
736
|
-
return Object.assign(Object.assign({}, {
|
|
737
|
-
ns: e,
|
|
738
|
-
noWrap: a,
|
|
739
|
-
orEmpty: n,
|
|
740
|
-
language: o
|
|
741
|
-
}), { params: Object.assign({}, i) });
|
|
742
|
-
}
|
|
743
|
-
const ir = (t, ...e) => {
|
|
744
|
-
let a = {}, n;
|
|
745
|
-
return typeof t == "object" ? a = t : (a.key = t, typeof e[0] == "string" ? (a.defaultValue = e[0], n = e[1]) : typeof e[0] == "object" && (n = e[0])), n && (a = Object.assign(Object.assign({}, or(n)), a)), a;
|
|
746
|
-
};
|
|
747
|
-
function ur({ options: t }) {
|
|
748
|
-
const e = Qn(), a = Tt(!1, () => i.isFetching(), e.onFetchingChange.emit), n = Tt(!1, () => O.isLoading(), e.onLoadingChange.emit), r = ar(e.onLanguageChange, e.onPendingLanguageChange, e.onRunningChange), o = rr(r.getLanguage, r.getInitialOptions, r.getAvailableLanguages, R, l, _, P, e), i = Zn(e, o.getBackendRecord, o.getBackendDevRecord, r.withDefaultNs, r.isInitialLoading, a, n);
|
|
749
|
-
t && S(t);
|
|
750
|
-
let u;
|
|
751
|
-
e.onUpdate.listen(() => {
|
|
752
|
-
r.isRunning() && o.retranslate();
|
|
753
|
-
});
|
|
754
|
-
function c() {
|
|
755
|
-
return r.getFallbackNs();
|
|
756
|
-
}
|
|
757
|
-
function s(f) {
|
|
758
|
-
return r.getDefaultNs(f);
|
|
759
|
-
}
|
|
760
|
-
function R(f) {
|
|
761
|
-
return ne([...X(s(f)), ...c()]);
|
|
762
|
-
}
|
|
763
|
-
function b(f) {
|
|
764
|
-
return ne([
|
|
765
|
-
...X(f ?? s()),
|
|
766
|
-
...r.getRequiredNamespaces()
|
|
767
|
-
]);
|
|
768
|
-
}
|
|
769
|
-
function P(f, A, L) {
|
|
770
|
-
const I = r.withDefaultNs(f), N = i.getTranslation(I, A);
|
|
771
|
-
return i.changeTranslation(I, A, L), {
|
|
772
|
-
revert() {
|
|
773
|
-
i.changeTranslation(I, A, N);
|
|
774
|
-
}
|
|
775
|
-
};
|
|
776
|
-
}
|
|
777
|
-
function S(f) {
|
|
778
|
-
r.init(f), i.addStaticData(r.getInitialOptions().staticData);
|
|
779
|
-
}
|
|
780
|
-
function D(f, A) {
|
|
781
|
-
const L = r.getFallbackLangs(f), I = b(A), N = [];
|
|
782
|
-
return L.forEach((h) => {
|
|
783
|
-
I.forEach((w) => {
|
|
784
|
-
N.push({ language: h, namespace: w });
|
|
785
|
-
});
|
|
786
|
-
}), N;
|
|
787
|
-
}
|
|
788
|
-
function p(f, A) {
|
|
789
|
-
return D(f, A).filter((L) => !i.exists(L, !0));
|
|
790
|
-
}
|
|
791
|
-
function m(f) {
|
|
792
|
-
let A = [], L = [];
|
|
793
|
-
if (Array.isArray(f.languages))
|
|
794
|
-
A = f.languages;
|
|
795
|
-
else if (f.languages === "all") {
|
|
796
|
-
const N = O.getAvailableLanguages();
|
|
797
|
-
if (!N)
|
|
798
|
-
throw new Error(ue("availableLanguages"));
|
|
799
|
-
A = N;
|
|
800
|
-
}
|
|
801
|
-
if (Array.isArray(f.namespaces))
|
|
802
|
-
L = f.namespaces;
|
|
803
|
-
else if (f.namespaces === "all") {
|
|
804
|
-
const N = O.getAvailableNs();
|
|
805
|
-
if (!N)
|
|
806
|
-
throw new Error(ue("availableNs"));
|
|
807
|
-
L = N;
|
|
808
|
-
}
|
|
809
|
-
const I = [];
|
|
810
|
-
return A.forEach((N) => {
|
|
811
|
-
L.forEach((h) => {
|
|
812
|
-
I.push({ language: N, namespace: h });
|
|
813
|
-
});
|
|
814
|
-
}), I;
|
|
815
|
-
}
|
|
816
|
-
function l({ key: f, ns: A }) {
|
|
817
|
-
const L = r.getFallbackLangs(), I = R(A ?? void 0);
|
|
818
|
-
return i.getTranslationNs(I, L, f);
|
|
819
|
-
}
|
|
820
|
-
function _({ key: f, ns: A, language: L }) {
|
|
821
|
-
const I = R(A ?? void 0), N = r.getFallbackLangs(L);
|
|
822
|
-
return i.getTranslationFallback(I, N, f);
|
|
823
|
-
}
|
|
824
|
-
function E() {
|
|
825
|
-
const f = dt(g(), () => {
|
|
826
|
-
const A = p();
|
|
827
|
-
if (A.length && r.getInitialOptions().autoLoadRequiredData)
|
|
828
|
-
return i.loadRecords(A, { useCache: !0 });
|
|
829
|
-
});
|
|
830
|
-
if (Ne(f))
|
|
831
|
-
return r.setInitialLoading(!0), a.notify(), n.notify(), Promise.resolve(f).then(() => {
|
|
832
|
-
r.setInitialLoading(!1), a.notify(), n.notify(), e.onInitialLoaded.emit();
|
|
833
|
-
});
|
|
834
|
-
e.onInitialLoaded.emit();
|
|
835
|
-
}
|
|
836
|
-
function g() {
|
|
837
|
-
if (r.getLanguage())
|
|
838
|
-
return;
|
|
839
|
-
const A = o.getInitialLanguage();
|
|
840
|
-
return dt(A, (L) => {
|
|
841
|
-
const I = L || r.getInitialOptions().defaultLanguage;
|
|
842
|
-
I && r.setLanguage(I);
|
|
843
|
-
});
|
|
844
|
-
}
|
|
845
|
-
function v() {
|
|
846
|
-
if ((o.getLanguageDetector() || o.getLanguageStorage()) && !r.getAvailableLanguages())
|
|
847
|
-
throw new Error(ue("availableLanguages"));
|
|
848
|
-
if (!r.getLanguage() && !r.getInitialOptions().defaultLanguage)
|
|
849
|
-
throw new Error(ue(["defaultLanguage", "language"]));
|
|
850
|
-
}
|
|
851
|
-
const O = Object.freeze(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, e), r), o), i), {
|
|
852
|
-
init: S,
|
|
853
|
-
getTranslation: _,
|
|
854
|
-
changeTranslation: P,
|
|
855
|
-
getTranslationNs: l,
|
|
856
|
-
getDefaultAndFallbackNs: R,
|
|
857
|
-
findPositions: o.findPositions,
|
|
858
|
-
getRequiredDescriptors: D,
|
|
859
|
-
async changeLanguage(f) {
|
|
860
|
-
r.getPendingLanguage() === f && r.getLanguage() === f || (r.setPendingLanguage(f), r.isRunning() && r.getInitialOptions().autoLoadRequiredData && await i.loadRecords(D(f), {
|
|
861
|
-
useCache: !0
|
|
862
|
-
}), f === r.getPendingLanguage() && (r.setLanguage(f), await o.setStoredLanguage(f)));
|
|
863
|
-
},
|
|
864
|
-
async addActiveNs(f, A) {
|
|
865
|
-
A || r.addActiveNs(f), r.isRunning() && await i.loadRecords(D(void 0, f), {
|
|
866
|
-
useCache: !0
|
|
867
|
-
});
|
|
868
|
-
},
|
|
869
|
-
async loadRecord(f, A) {
|
|
870
|
-
var L;
|
|
871
|
-
return (L = (await O.loadRecords([f], A))[0]) === null || L === void 0 ? void 0 : L.data;
|
|
872
|
-
},
|
|
873
|
-
isLoading(f) {
|
|
874
|
-
return i.isLoading(r.getLanguage(), f);
|
|
875
|
-
},
|
|
876
|
-
isLoaded(f) {
|
|
877
|
-
const A = r.getLanguage();
|
|
878
|
-
if (!A)
|
|
879
|
-
return !1;
|
|
880
|
-
const L = r.getFallbackLangs(A), I = b(f), N = [];
|
|
881
|
-
return L.forEach((h) => {
|
|
882
|
-
I.forEach((w) => {
|
|
883
|
-
i.exists({ language: h, namespace: w }) || N.push({ language: h, namespace: w });
|
|
884
|
-
});
|
|
885
|
-
}), N.length === 0;
|
|
886
|
-
},
|
|
887
|
-
t: (...f) => {
|
|
888
|
-
const A = ir(...f), L = _(A);
|
|
889
|
-
return o.formatTranslation(Object.assign(Object.assign({}, A), { translation: L }));
|
|
890
|
-
},
|
|
891
|
-
isDev() {
|
|
892
|
-
return !!(r.getInitialOptions().apiKey && r.getInitialOptions().apiUrl);
|
|
893
|
-
},
|
|
894
|
-
async loadRequired(f) {
|
|
895
|
-
f != null && f.language || await g();
|
|
896
|
-
const A = D(f == null ? void 0 : f.language);
|
|
897
|
-
return O.loadRecords(A, f);
|
|
898
|
-
},
|
|
899
|
-
async loadMatrix(f) {
|
|
900
|
-
const A = m(f);
|
|
901
|
-
return O.loadRecords(A, f);
|
|
902
|
-
},
|
|
903
|
-
run() {
|
|
904
|
-
return v(), r.isRunning() || (r.setRunning(!0), o.run(), u = E()), Promise.resolve(u);
|
|
905
|
-
},
|
|
906
|
-
stop() {
|
|
907
|
-
r.isRunning() && (o.stop(), r.setRunning(!1));
|
|
908
|
-
}
|
|
909
|
-
}));
|
|
910
|
-
return O;
|
|
911
|
-
}
|
|
912
|
-
function sr(t) {
|
|
913
|
-
const e = ur({
|
|
914
|
-
options: t
|
|
915
|
-
});
|
|
916
|
-
e.isDev() && e.invalidate();
|
|
917
|
-
function a(r) {
|
|
918
|
-
const o = e.isRunning();
|
|
919
|
-
o && e.stop(), r(), e.isDev() && e.invalidate(), o && e.run();
|
|
920
|
-
}
|
|
921
|
-
const n = Object.freeze({
|
|
922
|
-
/**
|
|
923
|
-
* Listen to tolgee events.
|
|
924
|
-
*/
|
|
925
|
-
on: e.on,
|
|
926
|
-
/**
|
|
927
|
-
* Turn off/on events emitting. Is on by default.
|
|
928
|
-
*/
|
|
929
|
-
setEmitterActive: e.setEmitterActive,
|
|
930
|
-
/**
|
|
931
|
-
* @return current language if set.
|
|
932
|
-
*/
|
|
933
|
-
getLanguage: e.getLanguage,
|
|
934
|
-
/**
|
|
935
|
-
* `pendingLanguage` represents language which is currently being loaded.
|
|
936
|
-
* @return current `pendingLanguage` if set.
|
|
937
|
-
*/
|
|
938
|
-
getPendingLanguage: e.getPendingLanguage,
|
|
939
|
-
/**
|
|
940
|
-
* Change current language.
|
|
941
|
-
* - if not running sets `pendingLanguage`, `language` to the new value
|
|
942
|
-
* - if running sets `pendingLanguage` to the value, fetches necessary data and then changes `language`
|
|
943
|
-
*
|
|
944
|
-
* @return Promise which is resolved when `language` is changed.
|
|
945
|
-
*/
|
|
946
|
-
changeLanguage: e.changeLanguage,
|
|
947
|
-
/**
|
|
948
|
-
* Temporarily change translation in cache.
|
|
949
|
-
* @return object with revert method.
|
|
950
|
-
*/
|
|
951
|
-
changeTranslation: e.changeTranslation,
|
|
952
|
-
/**
|
|
953
|
-
* Adds namespace(s) list of active namespaces. And if tolgee is running, loads required data.
|
|
954
|
-
*/
|
|
955
|
-
addActiveNs: e.addActiveNs,
|
|
956
|
-
/**
|
|
957
|
-
* Remove namespace(s) from active namespaces.
|
|
958
|
-
*
|
|
959
|
-
* Tolgee internally counts how many times was each active namespace added,
|
|
960
|
-
* so this method will remove namespace only if the counter goes down to 0.
|
|
961
|
-
*/
|
|
962
|
-
removeActiveNs: e.removeActiveNs,
|
|
963
|
-
/**
|
|
964
|
-
* Load records which would be loaded by `run` function
|
|
965
|
-
*
|
|
966
|
-
* You can provide language if not previously set on tolgee instance
|
|
967
|
-
*/
|
|
968
|
-
loadRequired: e.loadRequired,
|
|
969
|
-
/**
|
|
970
|
-
* Load records in matrix (languages x namespaces)
|
|
971
|
-
*/
|
|
972
|
-
loadMatrix: e.loadMatrix,
|
|
973
|
-
/**
|
|
974
|
-
* Manually load multiple records from `Backend` (or `DevBackend` when in dev mode)
|
|
975
|
-
*
|
|
976
|
-
* It loads data together and adds them to cache in one operation, to prevent partly loaded state.
|
|
977
|
-
*/
|
|
978
|
-
loadRecords: e.loadRecords,
|
|
979
|
-
/**
|
|
980
|
-
* Manually load record from `Backend` (or `DevBackend` when in dev mode)
|
|
981
|
-
*/
|
|
982
|
-
loadRecord: e.loadRecord,
|
|
983
|
-
/**
|
|
984
|
-
* Prefill static data
|
|
985
|
-
*/
|
|
986
|
-
addStaticData: e.addStaticData,
|
|
987
|
-
/**
|
|
988
|
-
* Get record from cache.
|
|
989
|
-
*/
|
|
990
|
-
getRecord: e.getRecord,
|
|
991
|
-
/**
|
|
992
|
-
* Get all records from cache.
|
|
993
|
-
*/
|
|
994
|
-
getAllRecords: e.getAllRecords,
|
|
995
|
-
/**
|
|
996
|
-
* @param ns optional list of namespaces that you are interested in
|
|
997
|
-
* @return `true` if there are data that need to be fetched.
|
|
998
|
-
*/
|
|
999
|
-
isLoaded: e.isLoaded,
|
|
1000
|
-
/**
|
|
1001
|
-
* Returns descriptors of records needed for instance to be `loaded`
|
|
1002
|
-
*/
|
|
1003
|
-
getRequiredDescriptors: e.getRequiredDescriptors,
|
|
1004
|
-
/**
|
|
1005
|
-
* @return `true` if tolgee is loading initial data (triggered by `run`).
|
|
1006
|
-
*/
|
|
1007
|
-
isInitialLoading: e.isInitialLoading,
|
|
1008
|
-
/**
|
|
1009
|
-
* @param ns optional list of namespaces that you are interested in
|
|
1010
|
-
* @return `true` if tolgee is loading some translations for the first time.
|
|
1011
|
-
*/
|
|
1012
|
-
isLoading: e.isLoading,
|
|
1013
|
-
/**
|
|
1014
|
-
* @param ns optional list of namespaces that you are interested in
|
|
1015
|
-
* @return `true` if tolgee is fetching some translations.
|
|
1016
|
-
*/
|
|
1017
|
-
isFetching: e.isFetching,
|
|
1018
|
-
/**
|
|
1019
|
-
* @return `true` if tolgee is running.
|
|
1020
|
-
*/
|
|
1021
|
-
isRunning: e.isRunning,
|
|
1022
|
-
/**
|
|
1023
|
-
* Changes internal state to running: true and loads initial files.
|
|
1024
|
-
* Runs runnable plugins mainly Observer if present.
|
|
1025
|
-
*/
|
|
1026
|
-
run: e.run,
|
|
1027
|
-
/**
|
|
1028
|
-
* Changes internal state to running: false and stops runnable plugins.
|
|
1029
|
-
*/
|
|
1030
|
-
stop: e.stop,
|
|
1031
|
-
/**
|
|
1032
|
-
* Returns translated and formatted key.
|
|
1033
|
-
* If Observer is present and tolgee is running, wraps result to be identifiable in the DOM.
|
|
1034
|
-
*/
|
|
1035
|
-
t: e.t,
|
|
1036
|
-
/**
|
|
1037
|
-
* Highlight keys that match selection.
|
|
1038
|
-
*/
|
|
1039
|
-
highlight: e.highlight,
|
|
1040
|
-
/**
|
|
1041
|
-
* Find positions of keys in the DOM.
|
|
1042
|
-
*/
|
|
1043
|
-
findPositions: e.findPositions,
|
|
1044
|
-
/**
|
|
1045
|
-
* @return current Tolgee options.
|
|
1046
|
-
*/
|
|
1047
|
-
getInitialOptions: e.getInitialOptions,
|
|
1048
|
-
/**
|
|
1049
|
-
* Tolgee is in dev mode if `DevTools` plugin is used and `apiKey` + `apiUrl` are specified.
|
|
1050
|
-
* @return `true` if tolgee is in dev mode.
|
|
1051
|
-
*/
|
|
1052
|
-
isDev: e.isDev,
|
|
1053
|
-
/**
|
|
1054
|
-
* Wraps translation if there is `Observer` plugin
|
|
1055
|
-
*/
|
|
1056
|
-
wrap: e.wrap,
|
|
1057
|
-
/**
|
|
1058
|
-
* Unwrap translation
|
|
1059
|
-
*/
|
|
1060
|
-
unwrap: e.unwrap,
|
|
1061
|
-
/**
|
|
1062
|
-
* Override creadentials passed on initialization.
|
|
1063
|
-
*
|
|
1064
|
-
* When called in running state, tolgee stops and runs again.
|
|
1065
|
-
*/
|
|
1066
|
-
overrideCredentials(r) {
|
|
1067
|
-
a(() => e.overrideCredentials(r));
|
|
1068
|
-
},
|
|
1069
|
-
/**
|
|
1070
|
-
* Add tolgee plugin after initialization.
|
|
1071
|
-
*
|
|
1072
|
-
* When called in running state, tolgee stops and runs again.
|
|
1073
|
-
*/
|
|
1074
|
-
addPlugin(r) {
|
|
1075
|
-
r && a(() => e.addPlugin(n, r));
|
|
1076
|
-
},
|
|
1077
|
-
/**
|
|
1078
|
-
* Updates options after instance creation. Extends existing options,
|
|
1079
|
-
* so it only changes the fields, that are listed.
|
|
1080
|
-
*
|
|
1081
|
-
* When called in running state, tolgee stops and runs again.
|
|
1082
|
-
*/
|
|
1083
|
-
updateOptions(r) {
|
|
1084
|
-
r && a(() => e.init(r));
|
|
1085
|
-
}
|
|
1086
|
-
});
|
|
1087
|
-
return n;
|
|
1088
|
-
}
|
|
1089
|
-
const cr = () => {
|
|
1090
|
-
const t = {
|
|
1091
|
-
plugins: [],
|
|
1092
|
-
options: {}
|
|
1093
|
-
}, e = Object.freeze({
|
|
1094
|
-
use(a) {
|
|
1095
|
-
return t.plugins.push(a), e;
|
|
1096
|
-
},
|
|
1097
|
-
updateDefaults(a) {
|
|
1098
|
-
return t.options = gt(t.options, a), e;
|
|
1099
|
-
},
|
|
1100
|
-
init(a) {
|
|
1101
|
-
const n = sr(gt(t.options, a));
|
|
1102
|
-
return t.plugins.forEach(n.addPlugin), n;
|
|
1103
|
-
}
|
|
1104
|
-
});
|
|
1105
|
-
return e;
|
|
1106
|
-
}, vn = 0, pt = 1, lr = 2;
|
|
1107
|
-
class dr extends Error {
|
|
1108
|
-
constructor(e, a, n) {
|
|
1109
|
-
let r, o = "";
|
|
1110
|
-
e === vn ? r = "Empty parameter" : e === pt ? (r = "Unexpected character", o = "Did you forget to use FormatIcu to render ICU message syntax?") : r = "Unexpected end", super(`Tolgee parser: ${r} at ${a} in "${n}"` + (o ? `
|
|
1111
|
-
` + o : "")), this.code = e, this.index = a;
|
|
1112
|
-
}
|
|
1113
|
-
}
|
|
1114
|
-
function Pt(t) {
|
|
1115
|
-
return /\s/.test(t);
|
|
1116
|
-
}
|
|
1117
|
-
const z = 0, _t = 1, De = 2, qe = 3, Fe = 4, fr = /* @__PURE__ */ new Set([
|
|
1118
|
-
De,
|
|
1119
|
-
_t,
|
|
1120
|
-
z
|
|
1121
|
-
]), ht = "'", gr = /* @__PURE__ */ new Set(["{", "}", ht]), pr = (t) => /[0-9a-zA-Z_]/.test(t);
|
|
1122
|
-
function _r(t) {
|
|
1123
|
-
let e = z, a = "", n = "", r = "";
|
|
1124
|
-
const o = [], i = [];
|
|
1125
|
-
let u = 0;
|
|
1126
|
-
function c(P) {
|
|
1127
|
-
throw new dr(P, u, t);
|
|
1128
|
-
}
|
|
1129
|
-
const s = () => {
|
|
1130
|
-
o.push(a), a = "";
|
|
1131
|
-
}, R = () => {
|
|
1132
|
-
pr(r) || c(pt), n += r;
|
|
1133
|
-
}, b = () => {
|
|
1134
|
-
n === "" && c(vn), i.push(n), n = "";
|
|
1135
|
-
};
|
|
1136
|
-
for (u = 0; u < t.length; u++)
|
|
1137
|
-
switch (r = t[u], e) {
|
|
1138
|
-
case z:
|
|
1139
|
-
r === ht ? (a += r, e = _t) : r === "{" ? (s(), e = qe) : (a += r, e = z);
|
|
1140
|
-
break;
|
|
1141
|
-
case _t:
|
|
1142
|
-
gr.has(r) ? (a = a.slice(0, -1) + r, e = De) : (a += r, e = z);
|
|
1143
|
-
break;
|
|
1144
|
-
case De:
|
|
1145
|
-
r === ht ? e = z : (a += r, e = De);
|
|
1146
|
-
break;
|
|
1147
|
-
case qe:
|
|
1148
|
-
r === "}" ? (b(), e = z) : Pt(r) ? n !== "" && (b(), e = Fe) : (R(), e = qe);
|
|
1149
|
-
break;
|
|
1150
|
-
case Fe:
|
|
1151
|
-
r == "}" ? e = z : Pt(r) ? e = Fe : c(pt);
|
|
1152
|
-
}
|
|
1153
|
-
return fr.has(e) || c(lr), s(), [o, i];
|
|
1154
|
-
}
|
|
1155
|
-
function hr(t, e) {
|
|
1156
|
-
const [a, n] = _r(t), r = [a[0]];
|
|
1157
|
-
for (let o = 1; o < a.length; o++) {
|
|
1158
|
-
const i = e == null ? void 0 : e[n[o - 1]];
|
|
1159
|
-
if (i === void 0)
|
|
1160
|
-
throw new Error(`Missing parameter "${n[o - 1]}" in "${t}"`);
|
|
1161
|
-
r.push(String(i)), r.push(a[o]);
|
|
1162
|
-
}
|
|
1163
|
-
return r.join("");
|
|
1164
|
-
}
|
|
1165
|
-
function Er() {
|
|
1166
|
-
return {
|
|
1167
|
-
format: ({ translation: t, params: e }) => hr(t, e)
|
|
1168
|
-
};
|
|
1169
|
-
}
|
|
1170
|
-
const mr = () => (t, e) => (e.setFinalFormatter(Er()), t);
|
|
1171
|
-
var He = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, At = {};
|
|
1172
|
-
(function(t) {
|
|
1173
|
-
function e(l, _) {
|
|
1174
|
-
var E;
|
|
1175
|
-
return l instanceof Buffer ? E = l : E = Buffer.from(l.buffer, l.byteOffset, l.byteLength), E.toString(_);
|
|
1176
|
-
}
|
|
1177
|
-
var a = function(l) {
|
|
1178
|
-
return Buffer.from(l);
|
|
1179
|
-
};
|
|
1180
|
-
function n(l) {
|
|
1181
|
-
for (var _ = 0, E = Math.min(256 * 256, l.length + 1), g = new Uint16Array(E), v = [], O = 0; ; ) {
|
|
1182
|
-
var f = _ < l.length;
|
|
1183
|
-
if (!f || O >= E - 1) {
|
|
1184
|
-
var A = g.subarray(0, O), L = A;
|
|
1185
|
-
if (v.push(String.fromCharCode.apply(null, L)), !f)
|
|
1186
|
-
return v.join("");
|
|
1187
|
-
l = l.subarray(_), _ = 0, O = 0;
|
|
1188
|
-
}
|
|
1189
|
-
var I = l[_++];
|
|
1190
|
-
if ((I & 128) === 0)
|
|
1191
|
-
g[O++] = I;
|
|
1192
|
-
else if ((I & 224) === 192) {
|
|
1193
|
-
var N = l[_++] & 63;
|
|
1194
|
-
g[O++] = (I & 31) << 6 | N;
|
|
1195
|
-
} else if ((I & 240) === 224) {
|
|
1196
|
-
var N = l[_++] & 63, h = l[_++] & 63;
|
|
1197
|
-
g[O++] = (I & 31) << 12 | N << 6 | h;
|
|
1198
|
-
} else if ((I & 248) === 240) {
|
|
1199
|
-
var N = l[_++] & 63, h = l[_++] & 63, w = l[_++] & 63, C = (I & 7) << 18 | N << 12 | h << 6 | w;
|
|
1200
|
-
C > 65535 && (C -= 65536, g[O++] = C >>> 10 & 1023 | 55296, C = 56320 | C & 1023), g[O++] = C;
|
|
1201
|
-
}
|
|
1202
|
-
}
|
|
1203
|
-
}
|
|
1204
|
-
function r(l) {
|
|
1205
|
-
for (var _ = 0, E = l.length, g = 0, v = Math.max(32, E + (E >>> 1) + 7), O = new Uint8Array(v >>> 3 << 3); _ < E; ) {
|
|
1206
|
-
var f = l.charCodeAt(_++);
|
|
1207
|
-
if (f >= 55296 && f <= 56319) {
|
|
1208
|
-
if (_ < E) {
|
|
1209
|
-
var A = l.charCodeAt(_);
|
|
1210
|
-
(A & 64512) === 56320 && (++_, f = ((f & 1023) << 10) + (A & 1023) + 65536);
|
|
1211
|
-
}
|
|
1212
|
-
if (f >= 55296 && f <= 56319)
|
|
1213
|
-
continue;
|
|
1214
|
-
}
|
|
1215
|
-
if (g + 4 > O.length) {
|
|
1216
|
-
v += 8, v *= 1 + _ / l.length * 2, v = v >>> 3 << 3;
|
|
1217
|
-
var L = new Uint8Array(v);
|
|
1218
|
-
L.set(O), O = L;
|
|
1219
|
-
}
|
|
1220
|
-
if ((f & 4294967168) === 0) {
|
|
1221
|
-
O[g++] = f;
|
|
1222
|
-
continue;
|
|
1223
|
-
} else if ((f & 4294965248) === 0)
|
|
1224
|
-
O[g++] = f >>> 6 & 31 | 192;
|
|
1225
|
-
else if ((f & 4294901760) === 0)
|
|
1226
|
-
O[g++] = f >>> 12 & 15 | 224, O[g++] = f >>> 6 & 63 | 128;
|
|
1227
|
-
else if ((f & 4292870144) === 0)
|
|
1228
|
-
O[g++] = f >>> 18 & 7 | 240, O[g++] = f >>> 12 & 63 | 128, O[g++] = f >>> 6 & 63 | 128;
|
|
1229
|
-
else
|
|
1230
|
-
continue;
|
|
1231
|
-
O[g++] = f & 63 | 128;
|
|
1232
|
-
}
|
|
1233
|
-
return O.slice ? O.slice(0, g) : O.subarray(0, g);
|
|
1234
|
-
}
|
|
1235
|
-
var o = "Failed to ", i = function(l, _, E) {
|
|
1236
|
-
if (l)
|
|
1237
|
-
throw new Error("".concat(o).concat(_, ": the '").concat(E, "' option is unsupported."));
|
|
1238
|
-
}, u = typeof Buffer == "function" && Buffer.from, c = u ? a : r;
|
|
1239
|
-
function s() {
|
|
1240
|
-
this.encoding = "utf-8";
|
|
1241
|
-
}
|
|
1242
|
-
s.prototype.encode = function(l, _) {
|
|
1243
|
-
return i(_ && _.stream, "encode", "stream"), c(l);
|
|
1244
|
-
};
|
|
1245
|
-
function R(l) {
|
|
1246
|
-
var _;
|
|
1247
|
-
try {
|
|
1248
|
-
var E = new Blob([l], { type: "text/plain;charset=UTF-8" });
|
|
1249
|
-
_ = URL.createObjectURL(E);
|
|
1250
|
-
var g = new XMLHttpRequest();
|
|
1251
|
-
return g.open("GET", _, !1), g.send(), g.responseText;
|
|
1252
|
-
} finally {
|
|
1253
|
-
_ && URL.revokeObjectURL(_);
|
|
1254
|
-
}
|
|
1255
|
-
}
|
|
1256
|
-
var b = !u && typeof Blob == "function" && typeof URL == "function" && typeof URL.createObjectURL == "function", P = ["utf-8", "utf8", "unicode-1-1-utf-8"], S = n;
|
|
1257
|
-
u ? S = e : b && (S = function(l) {
|
|
1258
|
-
try {
|
|
1259
|
-
return R(l);
|
|
1260
|
-
} catch {
|
|
1261
|
-
return n(l);
|
|
1262
|
-
}
|
|
1263
|
-
});
|
|
1264
|
-
var D = "construct 'TextDecoder'", p = "".concat(o, " ").concat(D, ": the ");
|
|
1265
|
-
function m(l, _) {
|
|
1266
|
-
i(_ && _.fatal, D, "fatal"), l = l || "utf-8";
|
|
1267
|
-
var E;
|
|
1268
|
-
if (u ? E = Buffer.isEncoding(l) : E = P.indexOf(l.toLowerCase()) !== -1, !E)
|
|
1269
|
-
throw new RangeError("".concat(p, " encoding label provided ('").concat(l, "') is invalid."));
|
|
1270
|
-
this.encoding = l, this.fatal = !1, this.ignoreBOM = !1;
|
|
1271
|
-
}
|
|
1272
|
-
m.prototype.decode = function(l, _) {
|
|
1273
|
-
i(_ && _.stream, "decode", "stream");
|
|
1274
|
-
var E;
|
|
1275
|
-
return l instanceof Uint8Array ? E = l : l.buffer instanceof ArrayBuffer ? E = new Uint8Array(l.buffer) : E = new Uint8Array(l), S(E, this.encoding);
|
|
1276
|
-
}, t.TextEncoder = t.TextEncoder || s, t.TextDecoder = t.TextDecoder || m;
|
|
1277
|
-
})(typeof window < "u" ? window : He);
|
|
1278
|
-
const yr = /* @__PURE__ */ Bn({
|
|
1279
|
-
__proto__: null,
|
|
1280
|
-
default: At
|
|
1281
|
-
}, [At]);
|
|
1282
|
-
(vt = console.assert) == null || vt.call(console, yr);
|
|
1283
|
-
function vr(t, e) {
|
|
1284
|
-
const a = (n) => {
|
|
1285
|
-
var r, o;
|
|
1286
|
-
t.includes((r = n.data) == null ? void 0 : r.type) && e((o = n.data) == null ? void 0 : o.data);
|
|
1287
|
-
};
|
|
1288
|
-
return window.addEventListener("message", a, !1), {
|
|
1289
|
-
unsubscribe() {
|
|
1290
|
-
window.removeEventListener("message", a);
|
|
1291
|
-
}
|
|
1292
|
-
};
|
|
1293
|
-
}
|
|
1294
|
-
function Rr({
|
|
1295
|
-
message: t,
|
|
1296
|
-
recievingMessage: e,
|
|
1297
|
-
data: a,
|
|
1298
|
-
attempts: n = 1,
|
|
1299
|
-
timeout: r = 300
|
|
1300
|
-
}) {
|
|
1301
|
-
let o = !1;
|
|
1302
|
-
const i = () => new Promise((c, s) => {
|
|
1303
|
-
const R = vr(e, P);
|
|
1304
|
-
window.postMessage({ type: t, data: a }, window.origin);
|
|
1305
|
-
const b = setTimeout(D, r);
|
|
1306
|
-
function P(p) {
|
|
1307
|
-
clearTimeout(b), S(), c(p);
|
|
1308
|
-
}
|
|
1309
|
-
function S() {
|
|
1310
|
-
R.unsubscribe();
|
|
1311
|
-
}
|
|
1312
|
-
function D() {
|
|
1313
|
-
S(), s();
|
|
1314
|
-
}
|
|
1315
|
-
});
|
|
1316
|
-
return {
|
|
1317
|
-
cancel() {
|
|
1318
|
-
o = !0;
|
|
1319
|
-
},
|
|
1320
|
-
promise: (async () => {
|
|
1321
|
-
for (let c = 0; c < n; c++) {
|
|
1322
|
-
if (o)
|
|
1323
|
-
return new Promise(() => {
|
|
1324
|
-
});
|
|
1325
|
-
try {
|
|
1326
|
-
return await i();
|
|
1327
|
-
} catch {
|
|
1328
|
-
continue;
|
|
1329
|
-
}
|
|
1330
|
-
}
|
|
1331
|
-
if (!o)
|
|
1332
|
-
throw `Didn't recieve ${e.join(" or ")} in time.`;
|
|
1333
|
-
return new Promise(() => {
|
|
1334
|
-
});
|
|
1335
|
-
})()
|
|
1336
|
-
};
|
|
1337
|
-
}
|
|
1338
|
-
function br() {
|
|
1339
|
-
let t;
|
|
1340
|
-
async function e(a) {
|
|
1341
|
-
t == null || t();
|
|
1342
|
-
const { cancel: n, promise: r } = Rr({
|
|
1343
|
-
message: "TOLGEE_READY",
|
|
1344
|
-
recievingMessage: ["TOLGEE_PLUGIN_READY", "TOLGEE_PLUGIN_UPDATED"],
|
|
1345
|
-
data: a,
|
|
1346
|
-
attempts: 4
|
|
1347
|
-
});
|
|
1348
|
-
return t = n, r;
|
|
1349
|
-
}
|
|
1350
|
-
return {
|
|
1351
|
-
update: e
|
|
1352
|
-
};
|
|
1353
|
-
}
|
|
1354
|
-
const Or = "tolgee-in-context-tools.umd.min.js", Tr = "@tolgee/in-context-tools", Pr = "InContextTools", Ar = "https://cdn.jsdelivr.net/npm";
|
|
1355
|
-
function wr(t) {
|
|
1356
|
-
return new Promise((e, a) => {
|
|
1357
|
-
const n = document.createElement("script");
|
|
1358
|
-
n.src = t, n.addEventListener("load", () => e()), n.addEventListener("error", (r) => a(r.error)), document.head.appendChild(n);
|
|
1359
|
-
});
|
|
1360
|
-
}
|
|
1361
|
-
let Be = null;
|
|
1362
|
-
function Sr(t) {
|
|
1363
|
-
return Be || (Be = wr(
|
|
1364
|
-
`${Ar}/@tolgee/web@${t}/dist/${Or}`
|
|
1365
|
-
).then(() => window[Tr][Pr])), Be;
|
|
1366
|
-
}
|
|
1367
|
-
const Rn = "__tolgee_apiKey", bn = "__tolgee_apiUrl";
|
|
1368
|
-
function wt() {
|
|
1369
|
-
const t = sessionStorage.getItem(Rn) || void 0, e = sessionStorage.getItem(bn) || void 0;
|
|
1370
|
-
if (!(!t || !e))
|
|
1371
|
-
return {
|
|
1372
|
-
apiKey: t,
|
|
1373
|
-
apiUrl: e
|
|
1374
|
-
};
|
|
1375
|
-
}
|
|
1376
|
-
function Dr() {
|
|
1377
|
-
sessionStorage.removeItem(Rn), sessionStorage.removeItem(bn);
|
|
1378
|
-
}
|
|
1379
|
-
function Cr(t) {
|
|
1380
|
-
document.readyState !== "loading" ? Promise.resolve().then(() => {
|
|
1381
|
-
t();
|
|
1382
|
-
}) : document.addEventListener && document.addEventListener("DOMContentLoaded", t);
|
|
1383
|
-
}
|
|
1384
|
-
let On = () => (t) => t;
|
|
1385
|
-
const Nr = () => {
|
|
1386
|
-
if (typeof window > "u")
|
|
1387
|
-
return !1;
|
|
1388
|
-
try {
|
|
1389
|
-
return typeof sessionStorage < "u" && sessionStorage;
|
|
1390
|
-
} catch (t) {
|
|
1391
|
-
return console.error("sessionStorage not available", t), !1;
|
|
1392
|
-
}
|
|
1393
|
-
};
|
|
1394
|
-
Nr() && (On = () => (t) => {
|
|
1395
|
-
const e = br(), a = () => ({
|
|
1396
|
-
// prevent extension downloading ui library
|
|
1397
|
-
uiPresent: !0,
|
|
1398
|
-
uiVersion: void 0,
|
|
1399
|
-
// tolgee mode
|
|
1400
|
-
mode: t.isDev() ? "development" : "production",
|
|
1401
|
-
// pass credentials
|
|
1402
|
-
config: {
|
|
1403
|
-
apiUrl: t.getInitialOptions().apiUrl || "",
|
|
1404
|
-
apiKey: t.getInitialOptions().apiKey || ""
|
|
1405
|
-
}
|
|
1406
|
-
}), n = async () => {
|
|
1407
|
-
const o = await Sr(
|
|
1408
|
-
"prerelease"
|
|
1409
|
-
);
|
|
1410
|
-
return (i) => {
|
|
1411
|
-
const u = wt();
|
|
1412
|
-
return i.addPlugin(o({ credentials: u })), i;
|
|
1413
|
-
};
|
|
1414
|
-
};
|
|
1415
|
-
return t.on("running", ({ value: o }) => {
|
|
1416
|
-
o && Cr(() => {
|
|
1417
|
-
e.update(a()).catch(Dr);
|
|
1418
|
-
});
|
|
1419
|
-
}), wt() && n().then((o) => {
|
|
1420
|
-
t.addPlugin(o);
|
|
1421
|
-
}).catch((o) => {
|
|
1422
|
-
console.error("Tolgee: Failed to load in-context tools"), console.error(o);
|
|
1423
|
-
}), t;
|
|
1424
|
-
});
|
|
1425
|
-
function jr() {
|
|
1426
|
-
return cr().use(On());
|
|
1427
|
-
}
|
|
1428
|
-
const Lr = () => (t) => t;
|
|
1429
|
-
let Xe;
|
|
1430
|
-
const Ir = () => (Xe || (Xe = V.createContext(void 0)), Xe);
|
|
1431
|
-
let Mr;
|
|
1432
|
-
function Ur() {
|
|
1433
|
-
return Mr;
|
|
1434
|
-
}
|
|
1435
|
-
const xr = () => {
|
|
1436
|
-
const t = Ir(), e = _n(t) || Ur();
|
|
1437
|
-
if (!e)
|
|
1438
|
-
throw new Error("Couldn't find tolgee instance, did you forgot to use `TolgeeProvider`?");
|
|
1439
|
-
return e;
|
|
1440
|
-
}, kr = () => {
|
|
1441
|
-
const [t, e] = Se(0), a = J(() => {
|
|
1442
|
-
e((n) => n + 1);
|
|
1443
|
-
}, [e]);
|
|
1444
|
-
return { instance: t, rerender: a };
|
|
1445
|
-
}, qr = (t) => {
|
|
1446
|
-
const { tolgee: e } = xr();
|
|
1447
|
-
return kr(), Ce(() => () => {
|
|
1448
|
-
}, [void 0]), e;
|
|
1449
|
-
};
|
|
1450
|
-
var se = { exports: {} }, Ge = {}, We = {}, St;
|
|
1451
|
-
function Fr() {
|
|
1452
|
-
if (St) return We;
|
|
1453
|
-
St = 1;
|
|
1454
|
-
function t(e) {
|
|
1455
|
-
return e && e.__esModule ? e : { default: e };
|
|
1456
|
-
}
|
|
1457
|
-
return We._ = t, We;
|
|
1458
|
-
}
|
|
1459
|
-
var Dt;
|
|
1460
|
-
function Hr() {
|
|
1461
|
-
return Dt || (Dt = 1, (function(t) {
|
|
1462
|
-
"use client";
|
|
1463
|
-
Object.defineProperty(t, "__esModule", {
|
|
1464
|
-
value: !0
|
|
1465
|
-
});
|
|
1466
|
-
function e(s, R) {
|
|
1467
|
-
for (var b in R) Object.defineProperty(s, b, {
|
|
1468
|
-
enumerable: !0,
|
|
1469
|
-
get: R[b]
|
|
1470
|
-
});
|
|
1471
|
-
}
|
|
1472
|
-
e(t, {
|
|
1473
|
-
AppRouterContext: function() {
|
|
1474
|
-
return r;
|
|
1475
|
-
},
|
|
1476
|
-
GlobalLayoutRouterContext: function() {
|
|
1477
|
-
return i;
|
|
1478
|
-
},
|
|
1479
|
-
LayoutRouterContext: function() {
|
|
1480
|
-
return o;
|
|
1481
|
-
},
|
|
1482
|
-
MissingSlotContext: function() {
|
|
1483
|
-
return c;
|
|
1484
|
-
},
|
|
1485
|
-
TemplateContext: function() {
|
|
1486
|
-
return u;
|
|
1487
|
-
}
|
|
1488
|
-
});
|
|
1489
|
-
const n = /* @__PURE__ */ (/* @__PURE__ */ Fr())._(V), r = n.default.createContext(null), o = n.default.createContext(null), i = n.default.createContext(null), u = n.default.createContext(null);
|
|
1490
|
-
process.env.NODE_ENV !== "production" && (r.displayName = "AppRouterContext", o.displayName = "LayoutRouterContext", i.displayName = "GlobalLayoutRouterContext", u.displayName = "TemplateContext");
|
|
1491
|
-
const c = n.default.createContext(/* @__PURE__ */ new Set());
|
|
1492
|
-
})(Ge)), Ge;
|
|
1493
|
-
}
|
|
1494
|
-
var ze = {}, Ct;
|
|
1495
|
-
function Br() {
|
|
1496
|
-
return Ct || (Ct = 1, (function(t) {
|
|
1497
|
-
"use client";
|
|
1498
|
-
Object.defineProperty(t, "__esModule", {
|
|
1499
|
-
value: !0
|
|
1500
|
-
});
|
|
1501
|
-
function e(i, u) {
|
|
1502
|
-
for (var c in u) Object.defineProperty(i, c, {
|
|
1503
|
-
enumerable: !0,
|
|
1504
|
-
get: u[c]
|
|
1505
|
-
});
|
|
1506
|
-
}
|
|
1507
|
-
e(t, {
|
|
1508
|
-
PathParamsContext: function() {
|
|
1509
|
-
return o;
|
|
1510
|
-
},
|
|
1511
|
-
PathnameContext: function() {
|
|
1512
|
-
return r;
|
|
1513
|
-
},
|
|
1514
|
-
SearchParamsContext: function() {
|
|
1515
|
-
return n;
|
|
1516
|
-
}
|
|
1517
|
-
});
|
|
1518
|
-
const a = V, n = (0, a.createContext)(null), r = (0, a.createContext)(null), o = (0, a.createContext)(null);
|
|
1519
|
-
process.env.NODE_ENV !== "production" && (n.displayName = "SearchParamsContext", r.displayName = "PathnameContext", o.displayName = "PathParamsContext");
|
|
1520
|
-
})(ze)), ze;
|
|
1521
|
-
}
|
|
1522
|
-
var ce = { exports: {} }, Nt;
|
|
1523
|
-
function Xr() {
|
|
1524
|
-
return Nt || (Nt = 1, (function(t, e) {
|
|
1525
|
-
Object.defineProperty(e, "__esModule", {
|
|
1526
|
-
value: !0
|
|
1527
|
-
}), Object.defineProperty(e, "getSegmentValue", {
|
|
1528
|
-
enumerable: !0,
|
|
1529
|
-
get: function() {
|
|
1530
|
-
return a;
|
|
1531
|
-
}
|
|
1532
|
-
});
|
|
1533
|
-
function a(n) {
|
|
1534
|
-
return Array.isArray(n) ? n[1] : n;
|
|
1535
|
-
}
|
|
1536
|
-
(typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
|
|
1537
|
-
})(ce, ce.exports)), ce.exports;
|
|
1538
|
-
}
|
|
1539
|
-
var Ye = {}, jt;
|
|
1540
|
-
function Gr() {
|
|
1541
|
-
return jt || (jt = 1, (function(t) {
|
|
1542
|
-
Object.defineProperty(t, "__esModule", {
|
|
1543
|
-
value: !0
|
|
1544
|
-
});
|
|
1545
|
-
function e(u, c) {
|
|
1546
|
-
for (var s in c) Object.defineProperty(u, s, {
|
|
1547
|
-
enumerable: !0,
|
|
1548
|
-
get: c[s]
|
|
1549
|
-
});
|
|
1550
|
-
}
|
|
1551
|
-
e(t, {
|
|
1552
|
-
DEFAULT_SEGMENT_KEY: function() {
|
|
1553
|
-
return i;
|
|
1554
|
-
},
|
|
1555
|
-
PAGE_SEGMENT_KEY: function() {
|
|
1556
|
-
return o;
|
|
1557
|
-
},
|
|
1558
|
-
addSearchParamsIfPageSegment: function() {
|
|
1559
|
-
return r;
|
|
1560
|
-
},
|
|
1561
|
-
isGroupSegment: function() {
|
|
1562
|
-
return a;
|
|
1563
|
-
},
|
|
1564
|
-
isParallelRouteSegment: function() {
|
|
1565
|
-
return n;
|
|
1566
|
-
}
|
|
1567
|
-
});
|
|
1568
|
-
function a(u) {
|
|
1569
|
-
return u[0] === "(" && u.endsWith(")");
|
|
1570
|
-
}
|
|
1571
|
-
function n(u) {
|
|
1572
|
-
return u.startsWith("@") && u !== "@children";
|
|
1573
|
-
}
|
|
1574
|
-
function r(u, c) {
|
|
1575
|
-
if (u.includes(o)) {
|
|
1576
|
-
const R = JSON.stringify(c);
|
|
1577
|
-
return R !== "{}" ? o + "?" + R : o;
|
|
1578
|
-
}
|
|
1579
|
-
return u;
|
|
1580
|
-
}
|
|
1581
|
-
const o = "__PAGE__", i = "__DEFAULT__";
|
|
1582
|
-
})(Ye)), Ye;
|
|
1583
|
-
}
|
|
1584
|
-
var le = { exports: {} }, de = { exports: {} }, fe = { exports: {} }, Lt;
|
|
1585
|
-
function Tn() {
|
|
1586
|
-
return Lt || (Lt = 1, (function(t, e) {
|
|
1587
|
-
Object.defineProperty(e, "__esModule", {
|
|
1588
|
-
value: !0
|
|
1589
|
-
}), Object.defineProperty(e, "RedirectStatusCode", {
|
|
1590
|
-
enumerable: !0,
|
|
1591
|
-
get: function() {
|
|
1592
|
-
return a;
|
|
1593
|
-
}
|
|
1594
|
-
});
|
|
1595
|
-
var a = /* @__PURE__ */ (function(n) {
|
|
1596
|
-
return n[n.SeeOther = 303] = "SeeOther", n[n.TemporaryRedirect = 307] = "TemporaryRedirect", n[n.PermanentRedirect = 308] = "PermanentRedirect", n;
|
|
1597
|
-
})({});
|
|
1598
|
-
(typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
|
|
1599
|
-
})(fe, fe.exports)), fe.exports;
|
|
1600
|
-
}
|
|
1601
|
-
var ge = { exports: {} }, It;
|
|
1602
|
-
function Et() {
|
|
1603
|
-
return It || (It = 1, (function(t, e) {
|
|
1604
|
-
Object.defineProperty(e, "__esModule", {
|
|
1605
|
-
value: !0
|
|
1606
|
-
});
|
|
1607
|
-
function a(u, c) {
|
|
1608
|
-
for (var s in c) Object.defineProperty(u, s, {
|
|
1609
|
-
enumerable: !0,
|
|
1610
|
-
get: c[s]
|
|
1611
|
-
});
|
|
1612
|
-
}
|
|
1613
|
-
a(e, {
|
|
1614
|
-
REDIRECT_ERROR_CODE: function() {
|
|
1615
|
-
return r;
|
|
1616
|
-
},
|
|
1617
|
-
RedirectType: function() {
|
|
1618
|
-
return o;
|
|
1619
|
-
},
|
|
1620
|
-
isRedirectError: function() {
|
|
1621
|
-
return i;
|
|
1622
|
-
}
|
|
1623
|
-
});
|
|
1624
|
-
const n = Tn(), r = "NEXT_REDIRECT";
|
|
1625
|
-
var o = /* @__PURE__ */ (function(u) {
|
|
1626
|
-
return u.push = "push", u.replace = "replace", u;
|
|
1627
|
-
})({});
|
|
1628
|
-
function i(u) {
|
|
1629
|
-
if (typeof u != "object" || u === null || !("digest" in u) || typeof u.digest != "string")
|
|
1630
|
-
return !1;
|
|
1631
|
-
const c = u.digest.split(";"), [s, R] = c, b = c.slice(2, -2).join(";"), P = c.at(-2), S = Number(P);
|
|
1632
|
-
return s === r && (R === "replace" || R === "push") && typeof b == "string" && !isNaN(S) && S in n.RedirectStatusCode;
|
|
1633
|
-
}
|
|
1634
|
-
(typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
|
|
1635
|
-
})(ge, ge.exports)), ge.exports;
|
|
1636
|
-
}
|
|
1637
|
-
var Ke = {}, Ve = {}, Qe = {}, Mt;
|
|
1638
|
-
function mt() {
|
|
1639
|
-
return Mt || (Mt = 1, (function(t) {
|
|
1640
|
-
Object.defineProperty(t, "__esModule", {
|
|
1641
|
-
value: !0
|
|
1642
|
-
});
|
|
1643
|
-
function e(c, s) {
|
|
1644
|
-
for (var R in s) Object.defineProperty(c, R, {
|
|
1645
|
-
enumerable: !0,
|
|
1646
|
-
get: s[R]
|
|
1647
|
-
});
|
|
1648
|
-
}
|
|
1649
|
-
e(t, {
|
|
1650
|
-
bindSnapshot: function() {
|
|
1651
|
-
return i;
|
|
1652
|
-
},
|
|
1653
|
-
createAsyncLocalStorage: function() {
|
|
1654
|
-
return o;
|
|
1655
|
-
},
|
|
1656
|
-
createSnapshot: function() {
|
|
1657
|
-
return u;
|
|
1658
|
-
}
|
|
1659
|
-
});
|
|
1660
|
-
const a = Object.defineProperty(new Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"), "__NEXT_ERROR_CODE", {
|
|
1661
|
-
value: "E504",
|
|
1662
|
-
enumerable: !1,
|
|
1663
|
-
configurable: !0
|
|
1664
|
-
});
|
|
1665
|
-
class n {
|
|
1666
|
-
disable() {
|
|
1667
|
-
throw a;
|
|
1668
|
-
}
|
|
1669
|
-
getStore() {
|
|
1670
|
-
}
|
|
1671
|
-
run() {
|
|
1672
|
-
throw a;
|
|
1673
|
-
}
|
|
1674
|
-
exit() {
|
|
1675
|
-
throw a;
|
|
1676
|
-
}
|
|
1677
|
-
enterWith() {
|
|
1678
|
-
throw a;
|
|
1679
|
-
}
|
|
1680
|
-
static bind(s) {
|
|
1681
|
-
return s;
|
|
1682
|
-
}
|
|
1683
|
-
}
|
|
1684
|
-
const r = typeof globalThis < "u" && globalThis.AsyncLocalStorage;
|
|
1685
|
-
function o() {
|
|
1686
|
-
return r ? new r() : new n();
|
|
1687
|
-
}
|
|
1688
|
-
function i(c) {
|
|
1689
|
-
return r ? r.bind(c) : n.bind(c);
|
|
1690
|
-
}
|
|
1691
|
-
function u() {
|
|
1692
|
-
return r ? r.snapshot() : function(c, ...s) {
|
|
1693
|
-
return c(...s);
|
|
1694
|
-
};
|
|
1695
|
-
}
|
|
1696
|
-
})(Qe)), Qe;
|
|
1697
|
-
}
|
|
1698
|
-
var Ut;
|
|
1699
|
-
function Wr() {
|
|
1700
|
-
return Ut || (Ut = 1, (function(t) {
|
|
1701
|
-
Object.defineProperty(t, "__esModule", {
|
|
1702
|
-
value: !0
|
|
1703
|
-
}), Object.defineProperty(t, "actionAsyncStorageInstance", {
|
|
1704
|
-
enumerable: !0,
|
|
1705
|
-
get: function() {
|
|
1706
|
-
return a;
|
|
1707
|
-
}
|
|
1708
|
-
});
|
|
1709
|
-
const a = (0, mt().createAsyncLocalStorage)();
|
|
1710
|
-
})(Ve)), Ve;
|
|
1711
|
-
}
|
|
1712
|
-
var xt;
|
|
1713
|
-
function zr() {
|
|
1714
|
-
return xt || (xt = 1, (function(t) {
|
|
1715
|
-
Object.defineProperty(t, "__esModule", {
|
|
1716
|
-
value: !0
|
|
1717
|
-
}), Object.defineProperty(t, "actionAsyncStorage", {
|
|
1718
|
-
enumerable: !0,
|
|
1719
|
-
get: function() {
|
|
1720
|
-
return e.actionAsyncStorageInstance;
|
|
1721
|
-
}
|
|
1722
|
-
});
|
|
1723
|
-
const e = Wr();
|
|
1724
|
-
})(Ke)), Ke;
|
|
1725
|
-
}
|
|
1726
|
-
var kt;
|
|
1727
|
-
function Yr() {
|
|
1728
|
-
return kt || (kt = 1, (function(t, e) {
|
|
1729
|
-
Object.defineProperty(e, "__esModule", {
|
|
1730
|
-
value: !0
|
|
1731
|
-
});
|
|
1732
|
-
function a(P, S) {
|
|
1733
|
-
for (var D in S) Object.defineProperty(P, D, {
|
|
1734
|
-
enumerable: !0,
|
|
1735
|
-
get: S[D]
|
|
1736
|
-
});
|
|
1737
|
-
}
|
|
1738
|
-
a(e, {
|
|
1739
|
-
getRedirectError: function() {
|
|
1740
|
-
return i;
|
|
1741
|
-
},
|
|
1742
|
-
getRedirectStatusCodeFromError: function() {
|
|
1743
|
-
return b;
|
|
1744
|
-
},
|
|
1745
|
-
getRedirectTypeFromError: function() {
|
|
1746
|
-
return R;
|
|
1747
|
-
},
|
|
1748
|
-
getURLFromRedirectError: function() {
|
|
1749
|
-
return s;
|
|
1750
|
-
},
|
|
1751
|
-
permanentRedirect: function() {
|
|
1752
|
-
return c;
|
|
1753
|
-
},
|
|
1754
|
-
redirect: function() {
|
|
1755
|
-
return u;
|
|
1756
|
-
}
|
|
1757
|
-
});
|
|
1758
|
-
const n = Tn(), r = Et(), o = typeof window > "u" ? zr().actionAsyncStorage : void 0;
|
|
1759
|
-
function i(P, S, D) {
|
|
1760
|
-
D === void 0 && (D = n.RedirectStatusCode.TemporaryRedirect);
|
|
1761
|
-
const p = Object.defineProperty(new Error(r.REDIRECT_ERROR_CODE), "__NEXT_ERROR_CODE", {
|
|
1762
|
-
value: "E394",
|
|
1763
|
-
enumerable: !1,
|
|
1764
|
-
configurable: !0
|
|
1765
|
-
});
|
|
1766
|
-
return p.digest = r.REDIRECT_ERROR_CODE + ";" + S + ";" + P + ";" + D + ";", p;
|
|
1767
|
-
}
|
|
1768
|
-
function u(P, S) {
|
|
1769
|
-
var D;
|
|
1770
|
-
throw S ?? (S = !(o == null || (D = o.getStore()) == null) && D.isAction ? r.RedirectType.push : r.RedirectType.replace), i(P, S, n.RedirectStatusCode.TemporaryRedirect);
|
|
1771
|
-
}
|
|
1772
|
-
function c(P, S) {
|
|
1773
|
-
throw S === void 0 && (S = r.RedirectType.replace), i(P, S, n.RedirectStatusCode.PermanentRedirect);
|
|
1774
|
-
}
|
|
1775
|
-
function s(P) {
|
|
1776
|
-
return (0, r.isRedirectError)(P) ? P.digest.split(";").slice(2, -2).join(";") : null;
|
|
1777
|
-
}
|
|
1778
|
-
function R(P) {
|
|
1779
|
-
if (!(0, r.isRedirectError)(P))
|
|
1780
|
-
throw Object.defineProperty(new Error("Not a redirect error"), "__NEXT_ERROR_CODE", {
|
|
1781
|
-
value: "E260",
|
|
1782
|
-
enumerable: !1,
|
|
1783
|
-
configurable: !0
|
|
1784
|
-
});
|
|
1785
|
-
return P.digest.split(";", 2)[1];
|
|
1786
|
-
}
|
|
1787
|
-
function b(P) {
|
|
1788
|
-
if (!(0, r.isRedirectError)(P))
|
|
1789
|
-
throw Object.defineProperty(new Error("Not a redirect error"), "__NEXT_ERROR_CODE", {
|
|
1790
|
-
value: "E260",
|
|
1791
|
-
enumerable: !1,
|
|
1792
|
-
configurable: !0
|
|
1793
|
-
});
|
|
1794
|
-
return Number(P.digest.split(";").at(-2));
|
|
1795
|
-
}
|
|
1796
|
-
(typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
|
|
1797
|
-
})(de, de.exports)), de.exports;
|
|
1798
|
-
}
|
|
1799
|
-
var pe = { exports: {} }, _e = { exports: {} }, qt;
|
|
1800
|
-
function je() {
|
|
1801
|
-
return qt || (qt = 1, (function(t, e) {
|
|
1802
|
-
Object.defineProperty(e, "__esModule", {
|
|
1803
|
-
value: !0
|
|
1804
|
-
});
|
|
1805
|
-
function a(s, R) {
|
|
1806
|
-
for (var b in R) Object.defineProperty(s, b, {
|
|
1807
|
-
enumerable: !0,
|
|
1808
|
-
get: R[b]
|
|
1809
|
-
});
|
|
1810
|
-
}
|
|
1811
|
-
a(e, {
|
|
1812
|
-
HTTPAccessErrorStatus: function() {
|
|
1813
|
-
return n;
|
|
1814
|
-
},
|
|
1815
|
-
HTTP_ERROR_FALLBACK_ERROR_CODE: function() {
|
|
1816
|
-
return o;
|
|
1817
|
-
},
|
|
1818
|
-
getAccessFallbackErrorTypeByStatus: function() {
|
|
1819
|
-
return c;
|
|
1820
|
-
},
|
|
1821
|
-
getAccessFallbackHTTPStatus: function() {
|
|
1822
|
-
return u;
|
|
1823
|
-
},
|
|
1824
|
-
isHTTPAccessFallbackError: function() {
|
|
1825
|
-
return i;
|
|
1826
|
-
}
|
|
1827
|
-
});
|
|
1828
|
-
const n = {
|
|
1829
|
-
NOT_FOUND: 404,
|
|
1830
|
-
FORBIDDEN: 403,
|
|
1831
|
-
UNAUTHORIZED: 401
|
|
1832
|
-
}, r = new Set(Object.values(n)), o = "NEXT_HTTP_ERROR_FALLBACK";
|
|
1833
|
-
function i(s) {
|
|
1834
|
-
if (typeof s != "object" || s === null || !("digest" in s) || typeof s.digest != "string")
|
|
1835
|
-
return !1;
|
|
1836
|
-
const [R, b] = s.digest.split(";");
|
|
1837
|
-
return R === o && r.has(Number(b));
|
|
1838
|
-
}
|
|
1839
|
-
function u(s) {
|
|
1840
|
-
const R = s.digest.split(";")[1];
|
|
1841
|
-
return Number(R);
|
|
1842
|
-
}
|
|
1843
|
-
function c(s) {
|
|
1844
|
-
switch (s) {
|
|
1845
|
-
case 401:
|
|
1846
|
-
return "unauthorized";
|
|
1847
|
-
case 403:
|
|
1848
|
-
return "forbidden";
|
|
1849
|
-
case 404:
|
|
1850
|
-
return "not-found";
|
|
1851
|
-
default:
|
|
1852
|
-
return;
|
|
1853
|
-
}
|
|
1854
|
-
}
|
|
1855
|
-
(typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
|
|
1856
|
-
})(_e, _e.exports)), _e.exports;
|
|
1857
|
-
}
|
|
1858
|
-
var Ft;
|
|
1859
|
-
function Kr() {
|
|
1860
|
-
return Ft || (Ft = 1, (function(t, e) {
|
|
1861
|
-
Object.defineProperty(e, "__esModule", {
|
|
1862
|
-
value: !0
|
|
1863
|
-
}), Object.defineProperty(e, "notFound", {
|
|
1864
|
-
enumerable: !0,
|
|
1865
|
-
get: function() {
|
|
1866
|
-
return r;
|
|
1867
|
-
}
|
|
1868
|
-
});
|
|
1869
|
-
const n = "" + je().HTTP_ERROR_FALLBACK_ERROR_CODE + ";404";
|
|
1870
|
-
function r() {
|
|
1871
|
-
const o = Object.defineProperty(new Error(n), "__NEXT_ERROR_CODE", {
|
|
1872
|
-
value: "E394",
|
|
1873
|
-
enumerable: !1,
|
|
1874
|
-
configurable: !0
|
|
1875
|
-
});
|
|
1876
|
-
throw o.digest = n, o;
|
|
1877
|
-
}
|
|
1878
|
-
(typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
|
|
1879
|
-
})(pe, pe.exports)), pe.exports;
|
|
1880
|
-
}
|
|
1881
|
-
var he = { exports: {} }, Ht;
|
|
1882
|
-
function Vr() {
|
|
1883
|
-
return Ht || (Ht = 1, (function(t, e) {
|
|
1884
|
-
Object.defineProperty(e, "__esModule", {
|
|
1885
|
-
value: !0
|
|
1886
|
-
}), Object.defineProperty(e, "forbidden", {
|
|
1887
|
-
enumerable: !0,
|
|
1888
|
-
get: function() {
|
|
1889
|
-
return r;
|
|
1890
|
-
}
|
|
1891
|
-
});
|
|
1892
|
-
const n = "" + je().HTTP_ERROR_FALLBACK_ERROR_CODE + ";403";
|
|
1893
|
-
function r() {
|
|
1894
|
-
if (!process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS)
|
|
1895
|
-
throw Object.defineProperty(new Error("`forbidden()` is experimental and only allowed to be enabled when `experimental.authInterrupts` is enabled."), "__NEXT_ERROR_CODE", {
|
|
1896
|
-
value: "E488",
|
|
1897
|
-
enumerable: !1,
|
|
1898
|
-
configurable: !0
|
|
1899
|
-
});
|
|
1900
|
-
const o = Object.defineProperty(new Error(n), "__NEXT_ERROR_CODE", {
|
|
1901
|
-
value: "E394",
|
|
1902
|
-
enumerable: !1,
|
|
1903
|
-
configurable: !0
|
|
1904
|
-
});
|
|
1905
|
-
throw o.digest = n, o;
|
|
1906
|
-
}
|
|
1907
|
-
(typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
|
|
1908
|
-
})(he, he.exports)), he.exports;
|
|
1909
|
-
}
|
|
1910
|
-
var Ee = { exports: {} }, Bt;
|
|
1911
|
-
function Qr() {
|
|
1912
|
-
return Bt || (Bt = 1, (function(t, e) {
|
|
1913
|
-
Object.defineProperty(e, "__esModule", {
|
|
1914
|
-
value: !0
|
|
1915
|
-
}), Object.defineProperty(e, "unauthorized", {
|
|
1916
|
-
enumerable: !0,
|
|
1917
|
-
get: function() {
|
|
1918
|
-
return r;
|
|
1919
|
-
}
|
|
1920
|
-
});
|
|
1921
|
-
const n = "" + je().HTTP_ERROR_FALLBACK_ERROR_CODE + ";401";
|
|
1922
|
-
function r() {
|
|
1923
|
-
if (!process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS)
|
|
1924
|
-
throw Object.defineProperty(new Error("`unauthorized()` is experimental and only allowed to be used when `experimental.authInterrupts` is enabled."), "__NEXT_ERROR_CODE", {
|
|
1925
|
-
value: "E411",
|
|
1926
|
-
enumerable: !1,
|
|
1927
|
-
configurable: !0
|
|
1928
|
-
});
|
|
1929
|
-
const o = Object.defineProperty(new Error(n), "__NEXT_ERROR_CODE", {
|
|
1930
|
-
value: "E394",
|
|
1931
|
-
enumerable: !1,
|
|
1932
|
-
configurable: !0
|
|
1933
|
-
});
|
|
1934
|
-
throw o.digest = n, o;
|
|
1935
|
-
}
|
|
1936
|
-
(typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
|
|
1937
|
-
})(Ee, Ee.exports)), Ee.exports;
|
|
1938
|
-
}
|
|
1939
|
-
var me = { exports: {} }, ye = { exports: {} }, Je = {}, Xt;
|
|
1940
|
-
function Pn() {
|
|
1941
|
-
return Xt || (Xt = 1, (function(t) {
|
|
1942
|
-
Object.defineProperty(t, "__esModule", {
|
|
1943
|
-
value: !0
|
|
1944
|
-
});
|
|
1945
|
-
function e(s, R) {
|
|
1946
|
-
for (var b in R) Object.defineProperty(s, b, {
|
|
1947
|
-
enumerable: !0,
|
|
1948
|
-
get: R[b]
|
|
1949
|
-
});
|
|
1950
|
-
}
|
|
1951
|
-
e(t, {
|
|
1952
|
-
isHangingPromiseRejectionError: function() {
|
|
1953
|
-
return a;
|
|
1954
|
-
},
|
|
1955
|
-
makeDevtoolsIOAwarePromise: function() {
|
|
1956
|
-
return c;
|
|
1957
|
-
},
|
|
1958
|
-
makeHangingPromise: function() {
|
|
1959
|
-
return i;
|
|
1960
|
-
}
|
|
1961
|
-
});
|
|
1962
|
-
function a(s) {
|
|
1963
|
-
return typeof s != "object" || s === null || !("digest" in s) ? !1 : s.digest === n;
|
|
1964
|
-
}
|
|
1965
|
-
const n = "HANGING_PROMISE_REJECTION";
|
|
1966
|
-
class r extends Error {
|
|
1967
|
-
constructor(R, b) {
|
|
1968
|
-
super(`During prerendering, ${b} rejects when the prerender is complete. Typically these errors are handled by React but if you move ${b} to a different context by using \`setTimeout\`, \`after\`, or similar functions you may observe this error and you should handle it in that context. This occurred at route "${R}".`), this.route = R, this.expression = b, this.digest = n;
|
|
1969
|
-
}
|
|
1970
|
-
}
|
|
1971
|
-
const o = /* @__PURE__ */ new WeakMap();
|
|
1972
|
-
function i(s, R, b) {
|
|
1973
|
-
if (s.aborted)
|
|
1974
|
-
return Promise.reject(new r(R, b));
|
|
1975
|
-
{
|
|
1976
|
-
const P = new Promise((S, D) => {
|
|
1977
|
-
const p = D.bind(null, new r(R, b));
|
|
1978
|
-
let m = o.get(s);
|
|
1979
|
-
if (m)
|
|
1980
|
-
m.push(p);
|
|
1981
|
-
else {
|
|
1982
|
-
const l = [
|
|
1983
|
-
p
|
|
1984
|
-
];
|
|
1985
|
-
o.set(s, l), s.addEventListener("abort", () => {
|
|
1986
|
-
for (let _ = 0; _ < l.length; _++)
|
|
1987
|
-
l[_]();
|
|
1988
|
-
}, {
|
|
1989
|
-
once: !0
|
|
1990
|
-
});
|
|
1991
|
-
}
|
|
1992
|
-
});
|
|
1993
|
-
return P.catch(u), P;
|
|
1994
|
-
}
|
|
1995
|
-
}
|
|
1996
|
-
function u() {
|
|
1997
|
-
}
|
|
1998
|
-
function c(s) {
|
|
1999
|
-
return new Promise((R) => {
|
|
2000
|
-
setTimeout(() => {
|
|
2001
|
-
R(s);
|
|
2002
|
-
}, 0);
|
|
2003
|
-
});
|
|
2004
|
-
}
|
|
2005
|
-
})(Je)), Je;
|
|
2006
|
-
}
|
|
2007
|
-
var Ze = {}, Gt;
|
|
2008
|
-
function Jr() {
|
|
2009
|
-
return Gt || (Gt = 1, (function(t) {
|
|
2010
|
-
Object.defineProperty(t, "__esModule", {
|
|
2011
|
-
value: !0
|
|
2012
|
-
}), Object.defineProperty(t, "isPostpone", {
|
|
2013
|
-
enumerable: !0,
|
|
2014
|
-
get: function() {
|
|
2015
|
-
return a;
|
|
2016
|
-
}
|
|
2017
|
-
});
|
|
2018
|
-
const e = Symbol.for("react.postpone");
|
|
2019
|
-
function a(n) {
|
|
2020
|
-
return typeof n == "object" && n !== null && n.$$typeof === e;
|
|
2021
|
-
}
|
|
2022
|
-
})(Ze)), Ze;
|
|
2023
|
-
}
|
|
2024
|
-
var $e = {}, Wt;
|
|
2025
|
-
function Le() {
|
|
2026
|
-
return Wt || (Wt = 1, (function(t) {
|
|
2027
|
-
Object.defineProperty(t, "__esModule", {
|
|
2028
|
-
value: !0
|
|
2029
|
-
});
|
|
2030
|
-
function e(o, i) {
|
|
2031
|
-
for (var u in i) Object.defineProperty(o, u, {
|
|
2032
|
-
enumerable: !0,
|
|
2033
|
-
get: i[u]
|
|
2034
|
-
});
|
|
2035
|
-
}
|
|
2036
|
-
e(t, {
|
|
2037
|
-
BailoutToCSRError: function() {
|
|
2038
|
-
return n;
|
|
2039
|
-
},
|
|
2040
|
-
isBailoutToCSRError: function() {
|
|
2041
|
-
return r;
|
|
2042
|
-
}
|
|
2043
|
-
});
|
|
2044
|
-
const a = "BAILOUT_TO_CLIENT_SIDE_RENDERING";
|
|
2045
|
-
class n extends Error {
|
|
2046
|
-
constructor(i) {
|
|
2047
|
-
super("Bail out to client-side rendering: " + i), this.reason = i, this.digest = a;
|
|
2048
|
-
}
|
|
2049
|
-
}
|
|
2050
|
-
function r(o) {
|
|
2051
|
-
return typeof o != "object" || o === null || !("digest" in o) ? !1 : o.digest === a;
|
|
2052
|
-
}
|
|
2053
|
-
})($e)), $e;
|
|
2054
|
-
}
|
|
2055
|
-
var ve = { exports: {} }, zt;
|
|
2056
|
-
function An() {
|
|
2057
|
-
return zt || (zt = 1, (function(t, e) {
|
|
2058
|
-
Object.defineProperty(e, "__esModule", {
|
|
2059
|
-
value: !0
|
|
2060
|
-
}), Object.defineProperty(e, "isNextRouterError", {
|
|
2061
|
-
enumerable: !0,
|
|
2062
|
-
get: function() {
|
|
2063
|
-
return r;
|
|
2064
|
-
}
|
|
2065
|
-
});
|
|
2066
|
-
const a = je(), n = Et();
|
|
2067
|
-
function r(o) {
|
|
2068
|
-
return (0, n.isRedirectError)(o) || (0, a.isHTTPAccessFallbackError)(o);
|
|
2069
|
-
}
|
|
2070
|
-
(typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
|
|
2071
|
-
})(ve, ve.exports)), ve.exports;
|
|
2072
|
-
}
|
|
2073
|
-
var et = {}, Re = { exports: {} }, Yt;
|
|
2074
|
-
function wn() {
|
|
2075
|
-
return Yt || (Yt = 1, (function(t, e) {
|
|
2076
|
-
Object.defineProperty(e, "__esModule", {
|
|
2077
|
-
value: !0
|
|
2078
|
-
});
|
|
2079
|
-
function a(i, u) {
|
|
2080
|
-
for (var c in u) Object.defineProperty(i, c, {
|
|
2081
|
-
enumerable: !0,
|
|
2082
|
-
get: u[c]
|
|
2083
|
-
});
|
|
2084
|
-
}
|
|
2085
|
-
a(e, {
|
|
2086
|
-
DynamicServerError: function() {
|
|
2087
|
-
return r;
|
|
2088
|
-
},
|
|
2089
|
-
isDynamicServerError: function() {
|
|
2090
|
-
return o;
|
|
2091
|
-
}
|
|
2092
|
-
});
|
|
2093
|
-
const n = "DYNAMIC_SERVER_USAGE";
|
|
2094
|
-
class r extends Error {
|
|
2095
|
-
constructor(u) {
|
|
2096
|
-
super("Dynamic server usage: " + u), this.description = u, this.digest = n;
|
|
2097
|
-
}
|
|
2098
|
-
}
|
|
2099
|
-
function o(i) {
|
|
2100
|
-
return typeof i != "object" || i === null || !("digest" in i) || typeof i.digest != "string" ? !1 : i.digest === n;
|
|
2101
|
-
}
|
|
2102
|
-
(typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
|
|
2103
|
-
})(Re, Re.exports)), Re.exports;
|
|
2104
|
-
}
|
|
2105
|
-
var be = { exports: {} }, Kt;
|
|
2106
|
-
function Zr() {
|
|
2107
|
-
return Kt || (Kt = 1, (function(t, e) {
|
|
2108
|
-
Object.defineProperty(e, "__esModule", {
|
|
2109
|
-
value: !0
|
|
2110
|
-
});
|
|
2111
|
-
function a(i, u) {
|
|
2112
|
-
for (var c in u) Object.defineProperty(i, c, {
|
|
2113
|
-
enumerable: !0,
|
|
2114
|
-
get: u[c]
|
|
2115
|
-
});
|
|
2116
|
-
}
|
|
2117
|
-
a(e, {
|
|
2118
|
-
StaticGenBailoutError: function() {
|
|
2119
|
-
return r;
|
|
2120
|
-
},
|
|
2121
|
-
isStaticGenBailoutError: function() {
|
|
2122
|
-
return o;
|
|
2123
|
-
}
|
|
2124
|
-
});
|
|
2125
|
-
const n = "NEXT_STATIC_GEN_BAILOUT";
|
|
2126
|
-
class r extends Error {
|
|
2127
|
-
constructor(...u) {
|
|
2128
|
-
super(...u), this.code = n;
|
|
2129
|
-
}
|
|
2130
|
-
}
|
|
2131
|
-
function o(i) {
|
|
2132
|
-
return typeof i != "object" || i === null || !("code" in i) ? !1 : i.code === n;
|
|
2133
|
-
}
|
|
2134
|
-
(typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
|
|
2135
|
-
})(be, be.exports)), be.exports;
|
|
2136
|
-
}
|
|
2137
|
-
var tt = {}, nt = {}, Vt;
|
|
2138
|
-
function $r() {
|
|
2139
|
-
return Vt || (Vt = 1, (function(t) {
|
|
2140
|
-
Object.defineProperty(t, "__esModule", {
|
|
2141
|
-
value: !0
|
|
2142
|
-
}), Object.defineProperty(t, "workUnitAsyncStorageInstance", {
|
|
2143
|
-
enumerable: !0,
|
|
2144
|
-
get: function() {
|
|
2145
|
-
return a;
|
|
2146
|
-
}
|
|
2147
|
-
});
|
|
2148
|
-
const a = (0, mt().createAsyncLocalStorage)();
|
|
2149
|
-
})(nt)), nt;
|
|
2150
|
-
}
|
|
2151
|
-
var Oe = { exports: {} }, Qt;
|
|
2152
|
-
function ea() {
|
|
2153
|
-
return Qt || (Qt = 1, (function(t, e) {
|
|
2154
|
-
Object.defineProperty(e, "__esModule", {
|
|
2155
|
-
value: !0
|
|
2156
|
-
});
|
|
2157
|
-
function a(g, v) {
|
|
2158
|
-
for (var O in v) Object.defineProperty(g, O, {
|
|
2159
|
-
enumerable: !0,
|
|
2160
|
-
get: v[O]
|
|
2161
|
-
});
|
|
2162
|
-
}
|
|
2163
|
-
a(e, {
|
|
2164
|
-
ACTION_HEADER: function() {
|
|
2165
|
-
return r;
|
|
2166
|
-
},
|
|
2167
|
-
FLIGHT_HEADERS: function() {
|
|
2168
|
-
return P;
|
|
2169
|
-
},
|
|
2170
|
-
NEXT_ACTION_NOT_FOUND_HEADER: function() {
|
|
2171
|
-
return E;
|
|
2172
|
-
},
|
|
2173
|
-
NEXT_DID_POSTPONE_HEADER: function() {
|
|
2174
|
-
return p;
|
|
2175
|
-
},
|
|
2176
|
-
NEXT_HMR_REFRESH_HASH_COOKIE: function() {
|
|
2177
|
-
return s;
|
|
2178
|
-
},
|
|
2179
|
-
NEXT_HMR_REFRESH_HEADER: function() {
|
|
2180
|
-
return c;
|
|
2181
|
-
},
|
|
2182
|
-
NEXT_IS_PRERENDER_HEADER: function() {
|
|
2183
|
-
return _;
|
|
2184
|
-
},
|
|
2185
|
-
NEXT_REWRITTEN_PATH_HEADER: function() {
|
|
2186
|
-
return m;
|
|
2187
|
-
},
|
|
2188
|
-
NEXT_REWRITTEN_QUERY_HEADER: function() {
|
|
2189
|
-
return l;
|
|
2190
|
-
},
|
|
2191
|
-
NEXT_ROUTER_PREFETCH_HEADER: function() {
|
|
2192
|
-
return i;
|
|
2193
|
-
},
|
|
2194
|
-
NEXT_ROUTER_SEGMENT_PREFETCH_HEADER: function() {
|
|
2195
|
-
return u;
|
|
2196
|
-
},
|
|
2197
|
-
NEXT_ROUTER_STALE_TIME_HEADER: function() {
|
|
2198
|
-
return D;
|
|
2199
|
-
},
|
|
2200
|
-
NEXT_ROUTER_STATE_TREE_HEADER: function() {
|
|
2201
|
-
return o;
|
|
2202
|
-
},
|
|
2203
|
-
NEXT_RSC_UNION_QUERY: function() {
|
|
2204
|
-
return S;
|
|
2205
|
-
},
|
|
2206
|
-
NEXT_URL: function() {
|
|
2207
|
-
return R;
|
|
2208
|
-
},
|
|
2209
|
-
RSC_CONTENT_TYPE_HEADER: function() {
|
|
2210
|
-
return b;
|
|
2211
|
-
},
|
|
2212
|
-
RSC_HEADER: function() {
|
|
2213
|
-
return n;
|
|
2214
|
-
}
|
|
2215
|
-
});
|
|
2216
|
-
const n = "rsc", r = "next-action", o = "next-router-state-tree", i = "next-router-prefetch", u = "next-router-segment-prefetch", c = "next-hmr-refresh", s = "__next_hmr_refresh_hash__", R = "next-url", b = "text/x-component", P = [
|
|
2217
|
-
n,
|
|
2218
|
-
o,
|
|
2219
|
-
i,
|
|
2220
|
-
c,
|
|
2221
|
-
u
|
|
2222
|
-
], S = "_rsc", D = "x-nextjs-stale-time", p = "x-nextjs-postponed", m = "x-nextjs-rewritten-path", l = "x-nextjs-rewritten-query", _ = "x-nextjs-prerender", E = "x-nextjs-action-not-found";
|
|
2223
|
-
(typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
|
|
2224
|
-
})(Oe, Oe.exports)), Oe.exports;
|
|
2225
|
-
}
|
|
2226
|
-
var rt = {}, Jt;
|
|
2227
|
-
function Sn() {
|
|
2228
|
-
return Jt || (Jt = 1, (function(t) {
|
|
2229
|
-
Object.defineProperty(t, "__esModule", {
|
|
2230
|
-
value: !0
|
|
2231
|
-
}), Object.defineProperty(t, "InvariantError", {
|
|
2232
|
-
enumerable: !0,
|
|
2233
|
-
get: function() {
|
|
2234
|
-
return e;
|
|
2235
|
-
}
|
|
2236
|
-
});
|
|
2237
|
-
class e extends Error {
|
|
2238
|
-
constructor(n, r) {
|
|
2239
|
-
super("Invariant: " + (n.endsWith(".") ? n : n + ".") + " This is a bug in Next.js.", r), this.name = "InvariantError";
|
|
2240
|
-
}
|
|
2241
|
-
}
|
|
2242
|
-
})(rt)), rt;
|
|
2243
|
-
}
|
|
2244
|
-
var Zt;
|
|
2245
|
-
function Dn() {
|
|
2246
|
-
return Zt || (Zt = 1, (function(t) {
|
|
2247
|
-
Object.defineProperty(t, "__esModule", {
|
|
2248
|
-
value: !0
|
|
2249
|
-
});
|
|
2250
|
-
function e(p, m) {
|
|
2251
|
-
for (var l in m) Object.defineProperty(p, l, {
|
|
2252
|
-
enumerable: !0,
|
|
2253
|
-
get: m[l]
|
|
2254
|
-
});
|
|
2255
|
-
}
|
|
2256
|
-
e(t, {
|
|
2257
|
-
getCacheSignal: function() {
|
|
2258
|
-
return S;
|
|
2259
|
-
},
|
|
2260
|
-
getDraftModeProviderForCacheScope: function() {
|
|
2261
|
-
return P;
|
|
2262
|
-
},
|
|
2263
|
-
getHmrRefreshHash: function() {
|
|
2264
|
-
return s;
|
|
2265
|
-
},
|
|
2266
|
-
getPrerenderResumeDataCache: function() {
|
|
2267
|
-
return u;
|
|
2268
|
-
},
|
|
2269
|
-
getRenderResumeDataCache: function() {
|
|
2270
|
-
return c;
|
|
2271
|
-
},
|
|
2272
|
-
getRuntimeStagePromise: function() {
|
|
2273
|
-
return D;
|
|
2274
|
-
},
|
|
2275
|
-
getServerComponentsHmrCache: function() {
|
|
2276
|
-
return b;
|
|
2277
|
-
},
|
|
2278
|
-
isHmrRefresh: function() {
|
|
2279
|
-
return R;
|
|
2280
|
-
},
|
|
2281
|
-
throwForMissingRequestStore: function() {
|
|
2282
|
-
return o;
|
|
2283
|
-
},
|
|
2284
|
-
throwInvariantForMissingStore: function() {
|
|
2285
|
-
return i;
|
|
2286
|
-
},
|
|
2287
|
-
workUnitAsyncStorage: function() {
|
|
2288
|
-
return a.workUnitAsyncStorageInstance;
|
|
2289
|
-
}
|
|
2290
|
-
});
|
|
2291
|
-
const a = $r(), n = ea(), r = Sn();
|
|
2292
|
-
function o(p) {
|
|
2293
|
-
throw Object.defineProperty(new Error(`\`${p}\` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`), "__NEXT_ERROR_CODE", {
|
|
2294
|
-
value: "E251",
|
|
2295
|
-
enumerable: !1,
|
|
2296
|
-
configurable: !0
|
|
2297
|
-
});
|
|
2298
|
-
}
|
|
2299
|
-
function i() {
|
|
2300
|
-
throw Object.defineProperty(new r.InvariantError("Expected workUnitAsyncStorage to have a store."), "__NEXT_ERROR_CODE", {
|
|
2301
|
-
value: "E696",
|
|
2302
|
-
enumerable: !1,
|
|
2303
|
-
configurable: !0
|
|
2304
|
-
});
|
|
2305
|
-
}
|
|
2306
|
-
function u(p) {
|
|
2307
|
-
switch (p.type) {
|
|
2308
|
-
case "prerender":
|
|
2309
|
-
case "prerender-runtime":
|
|
2310
|
-
case "prerender-ppr":
|
|
2311
|
-
return p.prerenderResumeDataCache;
|
|
2312
|
-
case "prerender-client":
|
|
2313
|
-
return p.prerenderResumeDataCache;
|
|
2314
|
-
case "prerender-legacy":
|
|
2315
|
-
case "request":
|
|
2316
|
-
case "cache":
|
|
2317
|
-
case "private-cache":
|
|
2318
|
-
case "unstable-cache":
|
|
2319
|
-
return null;
|
|
2320
|
-
default:
|
|
2321
|
-
return p;
|
|
2322
|
-
}
|
|
2323
|
-
}
|
|
2324
|
-
function c(p) {
|
|
2325
|
-
switch (p.type) {
|
|
2326
|
-
case "request":
|
|
2327
|
-
return p.renderResumeDataCache;
|
|
2328
|
-
case "prerender":
|
|
2329
|
-
case "prerender-runtime":
|
|
2330
|
-
case "prerender-client":
|
|
2331
|
-
if (p.renderResumeDataCache)
|
|
2332
|
-
return p.renderResumeDataCache;
|
|
2333
|
-
// fallthrough
|
|
2334
|
-
case "prerender-ppr":
|
|
2335
|
-
return p.prerenderResumeDataCache;
|
|
2336
|
-
case "cache":
|
|
2337
|
-
case "private-cache":
|
|
2338
|
-
case "unstable-cache":
|
|
2339
|
-
case "prerender-legacy":
|
|
2340
|
-
return null;
|
|
2341
|
-
default:
|
|
2342
|
-
return p;
|
|
2343
|
-
}
|
|
2344
|
-
}
|
|
2345
|
-
function s(p, m) {
|
|
2346
|
-
if (p.dev)
|
|
2347
|
-
switch (m.type) {
|
|
2348
|
-
case "cache":
|
|
2349
|
-
case "private-cache":
|
|
2350
|
-
case "prerender":
|
|
2351
|
-
case "prerender-runtime":
|
|
2352
|
-
return m.hmrRefreshHash;
|
|
2353
|
-
case "request":
|
|
2354
|
-
var l;
|
|
2355
|
-
return (l = m.cookies.get(n.NEXT_HMR_REFRESH_HASH_COOKIE)) == null ? void 0 : l.value;
|
|
2356
|
-
}
|
|
2357
|
-
}
|
|
2358
|
-
function R(p, m) {
|
|
2359
|
-
if (p.dev)
|
|
2360
|
-
switch (m.type) {
|
|
2361
|
-
case "cache":
|
|
2362
|
-
case "private-cache":
|
|
2363
|
-
case "request":
|
|
2364
|
-
return m.isHmrRefresh ?? !1;
|
|
2365
|
-
}
|
|
2366
|
-
return !1;
|
|
2367
|
-
}
|
|
2368
|
-
function b(p, m) {
|
|
2369
|
-
if (p.dev)
|
|
2370
|
-
switch (m.type) {
|
|
2371
|
-
case "cache":
|
|
2372
|
-
case "private-cache":
|
|
2373
|
-
case "request":
|
|
2374
|
-
return m.serverComponentsHmrCache;
|
|
2375
|
-
}
|
|
2376
|
-
}
|
|
2377
|
-
function P(p, m) {
|
|
2378
|
-
if (p.isDraftMode)
|
|
2379
|
-
switch (m.type) {
|
|
2380
|
-
case "cache":
|
|
2381
|
-
case "private-cache":
|
|
2382
|
-
case "unstable-cache":
|
|
2383
|
-
case "prerender-runtime":
|
|
2384
|
-
case "request":
|
|
2385
|
-
return m.draftMode;
|
|
2386
|
-
}
|
|
2387
|
-
}
|
|
2388
|
-
function S(p) {
|
|
2389
|
-
switch (p.type) {
|
|
2390
|
-
case "prerender":
|
|
2391
|
-
case "prerender-client":
|
|
2392
|
-
case "prerender-runtime":
|
|
2393
|
-
return p.cacheSignal;
|
|
2394
|
-
case "prerender-ppr":
|
|
2395
|
-
case "prerender-legacy":
|
|
2396
|
-
case "request":
|
|
2397
|
-
case "cache":
|
|
2398
|
-
case "private-cache":
|
|
2399
|
-
case "unstable-cache":
|
|
2400
|
-
return null;
|
|
2401
|
-
default:
|
|
2402
|
-
return p;
|
|
2403
|
-
}
|
|
2404
|
-
}
|
|
2405
|
-
function D(p) {
|
|
2406
|
-
switch (p.type) {
|
|
2407
|
-
case "prerender-runtime":
|
|
2408
|
-
case "private-cache":
|
|
2409
|
-
return p.runtimeStagePromise;
|
|
2410
|
-
case "prerender":
|
|
2411
|
-
case "prerender-client":
|
|
2412
|
-
case "prerender-ppr":
|
|
2413
|
-
case "prerender-legacy":
|
|
2414
|
-
case "request":
|
|
2415
|
-
case "cache":
|
|
2416
|
-
case "unstable-cache":
|
|
2417
|
-
return null;
|
|
2418
|
-
default:
|
|
2419
|
-
return p;
|
|
2420
|
-
}
|
|
2421
|
-
}
|
|
2422
|
-
})(tt)), tt;
|
|
2423
|
-
}
|
|
2424
|
-
var at = {}, ot = {}, $t;
|
|
2425
|
-
function ta() {
|
|
2426
|
-
return $t || ($t = 1, (function(t) {
|
|
2427
|
-
Object.defineProperty(t, "__esModule", {
|
|
2428
|
-
value: !0
|
|
2429
|
-
}), Object.defineProperty(t, "workAsyncStorageInstance", {
|
|
2430
|
-
enumerable: !0,
|
|
2431
|
-
get: function() {
|
|
2432
|
-
return a;
|
|
2433
|
-
}
|
|
2434
|
-
});
|
|
2435
|
-
const a = (0, mt().createAsyncLocalStorage)();
|
|
2436
|
-
})(ot)), ot;
|
|
2437
|
-
}
|
|
2438
|
-
var en;
|
|
2439
|
-
function Cn() {
|
|
2440
|
-
return en || (en = 1, (function(t) {
|
|
2441
|
-
Object.defineProperty(t, "__esModule", {
|
|
2442
|
-
value: !0
|
|
2443
|
-
}), Object.defineProperty(t, "workAsyncStorage", {
|
|
2444
|
-
enumerable: !0,
|
|
2445
|
-
get: function() {
|
|
2446
|
-
return e.workAsyncStorageInstance;
|
|
2447
|
-
}
|
|
2448
|
-
});
|
|
2449
|
-
const e = ta();
|
|
2450
|
-
})(at)), at;
|
|
2451
|
-
}
|
|
2452
|
-
var it = {}, tn;
|
|
2453
|
-
function na() {
|
|
2454
|
-
return tn || (tn = 1, (function(t) {
|
|
2455
|
-
Object.defineProperty(t, "__esModule", {
|
|
2456
|
-
value: !0
|
|
2457
|
-
});
|
|
2458
|
-
function e(i, u) {
|
|
2459
|
-
for (var c in u) Object.defineProperty(i, c, {
|
|
2460
|
-
enumerable: !0,
|
|
2461
|
-
get: u[c]
|
|
2462
|
-
});
|
|
2463
|
-
}
|
|
2464
|
-
e(t, {
|
|
2465
|
-
METADATA_BOUNDARY_NAME: function() {
|
|
2466
|
-
return a;
|
|
2467
|
-
},
|
|
2468
|
-
OUTLET_BOUNDARY_NAME: function() {
|
|
2469
|
-
return r;
|
|
2470
|
-
},
|
|
2471
|
-
ROOT_LAYOUT_BOUNDARY_NAME: function() {
|
|
2472
|
-
return o;
|
|
2473
|
-
},
|
|
2474
|
-
VIEWPORT_BOUNDARY_NAME: function() {
|
|
2475
|
-
return n;
|
|
2476
|
-
}
|
|
2477
|
-
});
|
|
2478
|
-
const a = "__next_metadata_boundary__", n = "__next_viewport_boundary__", r = "__next_outlet_boundary__", o = "__next_root_layout_boundary__";
|
|
2479
|
-
})(it)), it;
|
|
2480
|
-
}
|
|
2481
|
-
var ut = {}, nn;
|
|
2482
|
-
function ra() {
|
|
2483
|
-
return nn || (nn = 1, (function(t) {
|
|
2484
|
-
Object.defineProperty(t, "__esModule", {
|
|
2485
|
-
value: !0
|
|
2486
|
-
});
|
|
2487
|
-
function e(i, u) {
|
|
2488
|
-
for (var c in u) Object.defineProperty(i, c, {
|
|
2489
|
-
enumerable: !0,
|
|
2490
|
-
get: u[c]
|
|
2491
|
-
});
|
|
2492
|
-
}
|
|
2493
|
-
e(t, {
|
|
2494
|
-
atLeastOneTask: function() {
|
|
2495
|
-
return r;
|
|
2496
|
-
},
|
|
2497
|
-
scheduleImmediate: function() {
|
|
2498
|
-
return n;
|
|
2499
|
-
},
|
|
2500
|
-
scheduleOnNextTick: function() {
|
|
2501
|
-
return a;
|
|
2502
|
-
},
|
|
2503
|
-
waitAtLeastOneReactRenderTask: function() {
|
|
2504
|
-
return o;
|
|
2505
|
-
}
|
|
2506
|
-
});
|
|
2507
|
-
const a = (i) => {
|
|
2508
|
-
Promise.resolve().then(() => {
|
|
2509
|
-
process.env.NEXT_RUNTIME === "edge" ? setTimeout(i, 0) : process.nextTick(i);
|
|
2510
|
-
});
|
|
2511
|
-
}, n = (i) => {
|
|
2512
|
-
process.env.NEXT_RUNTIME === "edge" ? setTimeout(i, 0) : setImmediate(i);
|
|
2513
|
-
};
|
|
2514
|
-
function r() {
|
|
2515
|
-
return new Promise((i) => n(i));
|
|
2516
|
-
}
|
|
2517
|
-
function o() {
|
|
2518
|
-
return process.env.NEXT_RUNTIME === "edge" ? new Promise((i) => setTimeout(i, 0)) : new Promise((i) => setImmediate(i));
|
|
2519
|
-
}
|
|
2520
|
-
})(ut)), ut;
|
|
2521
|
-
}
|
|
2522
|
-
var rn;
|
|
2523
|
-
function Nn() {
|
|
2524
|
-
return rn || (rn = 1, (function(t) {
|
|
2525
|
-
Object.defineProperty(t, "__esModule", {
|
|
2526
|
-
value: !0
|
|
2527
|
-
});
|
|
2528
|
-
function e(d, y) {
|
|
2529
|
-
for (var T in y) Object.defineProperty(d, T, {
|
|
2530
|
-
enumerable: !0,
|
|
2531
|
-
get: y[T]
|
|
2532
|
-
});
|
|
2533
|
-
}
|
|
2534
|
-
e(t, {
|
|
2535
|
-
Postpone: function() {
|
|
2536
|
-
return I;
|
|
2537
|
-
},
|
|
2538
|
-
PreludeState: function() {
|
|
2539
|
-
return In;
|
|
2540
|
-
},
|
|
2541
|
-
abortAndThrowOnSynchronousRequestDataAccess: function() {
|
|
2542
|
-
return f;
|
|
2543
|
-
},
|
|
2544
|
-
abortOnSynchronousPlatformIOAccess: function() {
|
|
2545
|
-
return v;
|
|
2546
|
-
},
|
|
2547
|
-
accessedDynamicData: function() {
|
|
2548
|
-
return H;
|
|
2549
|
-
},
|
|
2550
|
-
annotateDynamicAccess: function() {
|
|
2551
|
-
return re;
|
|
2552
|
-
},
|
|
2553
|
-
consumeDynamicAccess: function() {
|
|
2554
|
-
return $;
|
|
2555
|
-
},
|
|
2556
|
-
createDynamicTrackingState: function() {
|
|
2557
|
-
return D;
|
|
2558
|
-
},
|
|
2559
|
-
createDynamicValidationState: function() {
|
|
2560
|
-
return p;
|
|
2561
|
-
},
|
|
2562
|
-
createHangingInputAbortSignal: function() {
|
|
2563
|
-
return K;
|
|
2564
|
-
},
|
|
2565
|
-
createRenderInBrowserAbortSignal: function() {
|
|
2566
|
-
return Me;
|
|
2567
|
-
},
|
|
2568
|
-
delayUntilRuntimeStage: function() {
|
|
2569
|
-
return Un;
|
|
2570
|
-
},
|
|
2571
|
-
formatDynamicAPIAccesses: function() {
|
|
2572
|
-
return Y;
|
|
2573
|
-
},
|
|
2574
|
-
getFirstDynamicReason: function() {
|
|
2575
|
-
return m;
|
|
2576
|
-
},
|
|
2577
|
-
isDynamicPostpone: function() {
|
|
2578
|
-
return w;
|
|
2579
|
-
},
|
|
2580
|
-
isPrerenderInterruptedError: function() {
|
|
2581
|
-
return U;
|
|
2582
|
-
},
|
|
2583
|
-
logDisallowedDynamicError: function() {
|
|
2584
|
-
return xe;
|
|
2585
|
-
},
|
|
2586
|
-
markCurrentScopeAsDynamic: function() {
|
|
2587
|
-
return l;
|
|
2588
|
-
},
|
|
2589
|
-
postponeWithTracking: function() {
|
|
2590
|
-
return N;
|
|
2591
|
-
},
|
|
2592
|
-
throwIfDisallowedDynamic: function() {
|
|
2593
|
-
return Mn;
|
|
2594
|
-
},
|
|
2595
|
-
throwToInterruptStaticGeneration: function() {
|
|
2596
|
-
return _;
|
|
2597
|
-
},
|
|
2598
|
-
trackAllowedDynamicAccess: function() {
|
|
2599
|
-
return ie;
|
|
2600
|
-
},
|
|
2601
|
-
trackDynamicDataInDynamicRender: function() {
|
|
2602
|
-
return E;
|
|
2603
|
-
},
|
|
2604
|
-
trackSynchronousPlatformIOAccessInDev: function() {
|
|
2605
|
-
return O;
|
|
2606
|
-
},
|
|
2607
|
-
trackSynchronousRequestDataAccessInDev: function() {
|
|
2608
|
-
return L;
|
|
2609
|
-
},
|
|
2610
|
-
useDynamicRouteParams: function() {
|
|
2611
|
-
return x;
|
|
2612
|
-
},
|
|
2613
|
-
warnOnSyncDynamicError: function() {
|
|
2614
|
-
return A;
|
|
2615
|
-
}
|
|
2616
|
-
});
|
|
2617
|
-
const a = /* @__PURE__ */ P(V), n = wn(), r = Zr(), o = Dn(), i = Cn(), u = Pn(), c = na(), s = ra(), R = Le(), b = Sn();
|
|
2618
|
-
function P(d) {
|
|
2619
|
-
return d && d.__esModule ? d : {
|
|
2620
|
-
default: d
|
|
2621
|
-
};
|
|
2622
|
-
}
|
|
2623
|
-
const S = typeof a.default.unstable_postpone == "function";
|
|
2624
|
-
function D(d) {
|
|
2625
|
-
return {
|
|
2626
|
-
isDebugDynamicAccesses: d,
|
|
2627
|
-
dynamicAccesses: [],
|
|
2628
|
-
syncDynamicErrorWithStack: null
|
|
2629
|
-
};
|
|
2630
|
-
}
|
|
2631
|
-
function p() {
|
|
2632
|
-
return {
|
|
2633
|
-
hasSuspenseAboveBody: !1,
|
|
2634
|
-
hasDynamicMetadata: !1,
|
|
2635
|
-
hasDynamicViewport: !1,
|
|
2636
|
-
hasAllowedDynamic: !1,
|
|
2637
|
-
dynamicErrors: []
|
|
2638
|
-
};
|
|
2639
|
-
}
|
|
2640
|
-
function m(d) {
|
|
2641
|
-
var y;
|
|
2642
|
-
return (y = d.dynamicAccesses[0]) == null ? void 0 : y.expression;
|
|
2643
|
-
}
|
|
2644
|
-
function l(d, y, T) {
|
|
2645
|
-
if (y)
|
|
2646
|
-
switch (y.type) {
|
|
2647
|
-
case "cache":
|
|
2648
|
-
case "unstable-cache":
|
|
2649
|
-
return;
|
|
2650
|
-
case "private-cache":
|
|
2651
|
-
return;
|
|
2652
|
-
}
|
|
2653
|
-
if (!(d.forceDynamic || d.forceStatic)) {
|
|
2654
|
-
if (d.dynamicShouldError)
|
|
2655
|
-
throw Object.defineProperty(new r.StaticGenBailoutError(`Route ${d.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${T}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", {
|
|
2656
|
-
value: "E553",
|
|
2657
|
-
enumerable: !1,
|
|
2658
|
-
configurable: !0
|
|
2659
|
-
});
|
|
2660
|
-
if (y)
|
|
2661
|
-
switch (y.type) {
|
|
2662
|
-
case "prerender-ppr":
|
|
2663
|
-
return N(d.route, T, y.dynamicTracking);
|
|
2664
|
-
case "prerender-legacy":
|
|
2665
|
-
y.revalidate = 0;
|
|
2666
|
-
const j = Object.defineProperty(new n.DynamicServerError(`Route ${d.route} couldn't be rendered statically because it used ${T}. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`), "__NEXT_ERROR_CODE", {
|
|
2667
|
-
value: "E550",
|
|
2668
|
-
enumerable: !1,
|
|
2669
|
-
configurable: !0
|
|
2670
|
-
});
|
|
2671
|
-
throw d.dynamicUsageDescription = T, d.dynamicUsageStack = j.stack, j;
|
|
2672
|
-
case "request":
|
|
2673
|
-
process.env.NODE_ENV !== "production" && (y.usedDynamic = !0);
|
|
2674
|
-
break;
|
|
2675
|
-
}
|
|
2676
|
-
}
|
|
2677
|
-
}
|
|
2678
|
-
function _(d, y, T) {
|
|
2679
|
-
const j = Object.defineProperty(new n.DynamicServerError(`Route ${y.route} couldn't be rendered statically because it used \`${d}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`), "__NEXT_ERROR_CODE", {
|
|
2680
|
-
value: "E558",
|
|
2681
|
-
enumerable: !1,
|
|
2682
|
-
configurable: !0
|
|
2683
|
-
});
|
|
2684
|
-
throw T.revalidate = 0, y.dynamicUsageDescription = d, y.dynamicUsageStack = j.stack, j;
|
|
2685
|
-
}
|
|
2686
|
-
function E(d) {
|
|
2687
|
-
switch (d.type) {
|
|
2688
|
-
case "cache":
|
|
2689
|
-
case "unstable-cache":
|
|
2690
|
-
return;
|
|
2691
|
-
case "private-cache":
|
|
2692
|
-
return;
|
|
2693
|
-
case "prerender":
|
|
2694
|
-
case "prerender-runtime":
|
|
2695
|
-
case "prerender-legacy":
|
|
2696
|
-
case "prerender-ppr":
|
|
2697
|
-
case "prerender-client":
|
|
2698
|
-
break;
|
|
2699
|
-
case "request":
|
|
2700
|
-
process.env.NODE_ENV !== "production" && (d.usedDynamic = !0);
|
|
2701
|
-
break;
|
|
2702
|
-
}
|
|
2703
|
-
}
|
|
2704
|
-
function g(d, y, T) {
|
|
2705
|
-
const j = `Route ${d} needs to bail out of prerendering at this point because it used ${y}.`, F = k(j);
|
|
2706
|
-
T.controller.abort(F);
|
|
2707
|
-
const q = T.dynamicTracking;
|
|
2708
|
-
q && q.dynamicAccesses.push({
|
|
2709
|
-
// When we aren't debugging, we don't need to create another error for the
|
|
2710
|
-
// stack trace.
|
|
2711
|
-
stack: q.isDebugDynamicAccesses ? new Error().stack : void 0,
|
|
2712
|
-
expression: y
|
|
2713
|
-
});
|
|
2714
|
-
}
|
|
2715
|
-
function v(d, y, T, j) {
|
|
2716
|
-
const F = j.dynamicTracking;
|
|
2717
|
-
g(d, y, j), F && F.syncDynamicErrorWithStack === null && (F.syncDynamicErrorWithStack = T);
|
|
2718
|
-
}
|
|
2719
|
-
function O(d) {
|
|
2720
|
-
d.prerenderPhase = !1;
|
|
2721
|
-
}
|
|
2722
|
-
function f(d, y, T, j) {
|
|
2723
|
-
if (j.controller.signal.aborted === !1) {
|
|
2724
|
-
g(d, y, j);
|
|
2725
|
-
const q = j.dynamicTracking;
|
|
2726
|
-
q && q.syncDynamicErrorWithStack === null && (q.syncDynamicErrorWithStack = T);
|
|
2727
|
-
}
|
|
2728
|
-
throw k(`Route ${d} needs to bail out of prerendering at this point because it used ${y}.`);
|
|
2729
|
-
}
|
|
2730
|
-
function A(d) {
|
|
2731
|
-
d.syncDynamicErrorWithStack && console.error(d.syncDynamicErrorWithStack);
|
|
2732
|
-
}
|
|
2733
|
-
const L = O;
|
|
2734
|
-
function I({ reason: d, route: y }) {
|
|
2735
|
-
const T = o.workUnitAsyncStorage.getStore(), j = T && T.type === "prerender-ppr" ? T.dynamicTracking : null;
|
|
2736
|
-
N(y, d, j);
|
|
2737
|
-
}
|
|
2738
|
-
function N(d, y, T) {
|
|
2739
|
-
Ie(), T && T.dynamicAccesses.push({
|
|
2740
|
-
// When we aren't debugging, we don't need to create another error for the
|
|
2741
|
-
// stack trace.
|
|
2742
|
-
stack: T.isDebugDynamicAccesses ? new Error().stack : void 0,
|
|
2743
|
-
expression: y
|
|
2744
|
-
}), a.default.unstable_postpone(h(d, y));
|
|
2745
|
-
}
|
|
2746
|
-
function h(d, y) {
|
|
2747
|
-
return `Route ${d} needs to bail out of prerendering at this point because it used ${y}. React throws this special object to indicate where. It should not be caught by your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error`;
|
|
2748
|
-
}
|
|
2749
|
-
function w(d) {
|
|
2750
|
-
return typeof d == "object" && d !== null && typeof d.message == "string" ? C(d.message) : !1;
|
|
2751
|
-
}
|
|
2752
|
-
function C(d) {
|
|
2753
|
-
return d.includes("needs to bail out of prerendering at this point because it used") && d.includes("Learn more: https://nextjs.org/docs/messages/ppr-caught-error");
|
|
2754
|
-
}
|
|
2755
|
-
if (C(h("%%%", "^^^")) === !1)
|
|
2756
|
-
throw Object.defineProperty(new Error("Invariant: isDynamicPostpone misidentified a postpone reason. This is a bug in Next.js"), "__NEXT_ERROR_CODE", {
|
|
2757
|
-
value: "E296",
|
|
2758
|
-
enumerable: !1,
|
|
2759
|
-
configurable: !0
|
|
2760
|
-
});
|
|
2761
|
-
const M = "NEXT_PRERENDER_INTERRUPTED";
|
|
2762
|
-
function k(d) {
|
|
2763
|
-
const y = Object.defineProperty(new Error(d), "__NEXT_ERROR_CODE", {
|
|
2764
|
-
value: "E394",
|
|
2765
|
-
enumerable: !1,
|
|
2766
|
-
configurable: !0
|
|
2767
|
-
});
|
|
2768
|
-
return y.digest = M, y;
|
|
2769
|
-
}
|
|
2770
|
-
function U(d) {
|
|
2771
|
-
return typeof d == "object" && d !== null && d.digest === M && "name" in d && "message" in d && d instanceof Error;
|
|
2772
|
-
}
|
|
2773
|
-
function H(d) {
|
|
2774
|
-
return d.length > 0;
|
|
2775
|
-
}
|
|
2776
|
-
function $(d, y) {
|
|
2777
|
-
return d.dynamicAccesses.push(...y.dynamicAccesses), d.dynamicAccesses;
|
|
2778
|
-
}
|
|
2779
|
-
function Y(d) {
|
|
2780
|
-
return d.filter((y) => typeof y.stack == "string" && y.stack.length > 0).map(({ expression: y, stack: T }) => (T = T.split(`
|
|
2781
|
-
`).slice(4).filter((j) => !(j.includes("node_modules/next/") || j.includes(" (<anonymous>)") || j.includes(" (node:"))).join(`
|
|
2782
|
-
`), `Dynamic API Usage Debug - ${y}:
|
|
2783
|
-
${T}`));
|
|
2784
|
-
}
|
|
2785
|
-
function Ie() {
|
|
2786
|
-
if (!S)
|
|
2787
|
-
throw Object.defineProperty(new Error("Invariant: React.unstable_postpone is not defined. This suggests the wrong version of React was loaded. This is a bug in Next.js"), "__NEXT_ERROR_CODE", {
|
|
2788
|
-
value: "E224",
|
|
2789
|
-
enumerable: !1,
|
|
2790
|
-
configurable: !0
|
|
2791
|
-
});
|
|
2792
|
-
}
|
|
2793
|
-
function Me() {
|
|
2794
|
-
const d = new AbortController();
|
|
2795
|
-
return d.abort(Object.defineProperty(new R.BailoutToCSRError("Render in Browser"), "__NEXT_ERROR_CODE", {
|
|
2796
|
-
value: "E721",
|
|
2797
|
-
enumerable: !1,
|
|
2798
|
-
configurable: !0
|
|
2799
|
-
})), d.signal;
|
|
2800
|
-
}
|
|
2801
|
-
function K(d) {
|
|
2802
|
-
switch (d.type) {
|
|
2803
|
-
case "prerender":
|
|
2804
|
-
case "prerender-runtime":
|
|
2805
|
-
const y = new AbortController();
|
|
2806
|
-
if (d.cacheSignal)
|
|
2807
|
-
d.cacheSignal.inputReady().then(() => {
|
|
2808
|
-
y.abort();
|
|
2809
|
-
});
|
|
2810
|
-
else {
|
|
2811
|
-
const T = (0, o.getRuntimeStagePromise)(d);
|
|
2812
|
-
T ? T.then(() => (0, s.scheduleOnNextTick)(() => y.abort())) : (0, s.scheduleOnNextTick)(() => y.abort());
|
|
2813
|
-
}
|
|
2814
|
-
return y.signal;
|
|
2815
|
-
case "prerender-client":
|
|
2816
|
-
case "prerender-ppr":
|
|
2817
|
-
case "prerender-legacy":
|
|
2818
|
-
case "request":
|
|
2819
|
-
case "cache":
|
|
2820
|
-
case "private-cache":
|
|
2821
|
-
case "unstable-cache":
|
|
2822
|
-
return;
|
|
2823
|
-
}
|
|
2824
|
-
}
|
|
2825
|
-
function re(d, y) {
|
|
2826
|
-
const T = y.dynamicTracking;
|
|
2827
|
-
T && T.dynamicAccesses.push({
|
|
2828
|
-
stack: T.isDebugDynamicAccesses ? new Error().stack : void 0,
|
|
2829
|
-
expression: d
|
|
2830
|
-
});
|
|
2831
|
-
}
|
|
2832
|
-
function x(d) {
|
|
2833
|
-
const y = i.workAsyncStorage.getStore(), T = o.workUnitAsyncStorage.getStore();
|
|
2834
|
-
if (y && T)
|
|
2835
|
-
switch (T.type) {
|
|
2836
|
-
case "prerender-client":
|
|
2837
|
-
case "prerender": {
|
|
2838
|
-
const j = T.fallbackRouteParams;
|
|
2839
|
-
j && j.size > 0 && a.default.use((0, u.makeHangingPromise)(T.renderSignal, y.route, d));
|
|
2840
|
-
break;
|
|
2841
|
-
}
|
|
2842
|
-
case "prerender-ppr": {
|
|
2843
|
-
const j = T.fallbackRouteParams;
|
|
2844
|
-
if (j && j.size > 0)
|
|
2845
|
-
return N(y.route, d, T.dynamicTracking);
|
|
2846
|
-
break;
|
|
2847
|
-
}
|
|
2848
|
-
case "prerender-runtime":
|
|
2849
|
-
throw Object.defineProperty(new b.InvariantError(`\`${d}\` was called during a runtime prerender. Next.js should be preventing ${d} from being included in server components statically, but did not in this case.`), "__NEXT_ERROR_CODE", {
|
|
2850
|
-
value: "E771",
|
|
2851
|
-
enumerable: !1,
|
|
2852
|
-
configurable: !0
|
|
2853
|
-
});
|
|
2854
|
-
case "cache":
|
|
2855
|
-
case "private-cache":
|
|
2856
|
-
throw Object.defineProperty(new b.InvariantError(`\`${d}\` was called inside a cache scope. Next.js should be preventing ${d} from being included in server components statically, but did not in this case.`), "__NEXT_ERROR_CODE", {
|
|
2857
|
-
value: "E745",
|
|
2858
|
-
enumerable: !1,
|
|
2859
|
-
configurable: !0
|
|
2860
|
-
});
|
|
2861
|
-
}
|
|
2862
|
-
}
|
|
2863
|
-
const Q = /\n\s+at Suspense \(<anonymous>\)/, ae = "body|div|main|section|article|aside|header|footer|nav|form|p|span|h1|h2|h3|h4|h5|h6", oe = new RegExp(`\\n\\s+at Suspense \\(<anonymous>\\)(?:(?!\\n\\s+at (?:${ae}) \\(<anonymous>\\))[\\s\\S])*?\\n\\s+at ${c.ROOT_LAYOUT_BOUNDARY_NAME} \\([^\\n]*\\)`), G = new RegExp(`\\n\\s+at ${c.METADATA_BOUNDARY_NAME}[\\n\\s]`), Ue = new RegExp(`\\n\\s+at ${c.VIEWPORT_BOUNDARY_NAME}[\\n\\s]`), ee = new RegExp(`\\n\\s+at ${c.OUTLET_BOUNDARY_NAME}[\\n\\s]`);
|
|
2864
|
-
function ie(d, y, T, j) {
|
|
2865
|
-
if (!ee.test(y))
|
|
2866
|
-
if (G.test(y)) {
|
|
2867
|
-
T.hasDynamicMetadata = !0;
|
|
2868
|
-
return;
|
|
2869
|
-
} else if (Ue.test(y)) {
|
|
2870
|
-
T.hasDynamicViewport = !0;
|
|
2871
|
-
return;
|
|
2872
|
-
} else if (oe.test(y)) {
|
|
2873
|
-
T.hasAllowedDynamic = !0, T.hasSuspenseAboveBody = !0;
|
|
2874
|
-
return;
|
|
2875
|
-
} else if (Q.test(y)) {
|
|
2876
|
-
T.hasAllowedDynamic = !0;
|
|
2877
|
-
return;
|
|
2878
|
-
} else if (j.syncDynamicErrorWithStack) {
|
|
2879
|
-
T.dynamicErrors.push(j.syncDynamicErrorWithStack);
|
|
2880
|
-
return;
|
|
2881
|
-
} else {
|
|
2882
|
-
const F = `Route "${d.route}": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense`, q = Ln(F, y);
|
|
2883
|
-
T.dynamicErrors.push(q);
|
|
2884
|
-
return;
|
|
2885
|
-
}
|
|
2886
|
-
}
|
|
2887
|
-
function Ln(d, y) {
|
|
2888
|
-
const T = process.env.NODE_ENV !== "production" && a.default.captureOwnerStack ? a.default.captureOwnerStack() : null, j = Object.defineProperty(new Error(d), "__NEXT_ERROR_CODE", {
|
|
2889
|
-
value: "E394",
|
|
2890
|
-
enumerable: !1,
|
|
2891
|
-
configurable: !0
|
|
2892
|
-
});
|
|
2893
|
-
return j.stack = j.name + ": " + d + (T ?? y), j;
|
|
2894
|
-
}
|
|
2895
|
-
var In = /* @__PURE__ */ (function(d) {
|
|
2896
|
-
return d[d.Full = 0] = "Full", d[d.Empty = 1] = "Empty", d[d.Errored = 2] = "Errored", d;
|
|
2897
|
-
})({});
|
|
2898
|
-
function xe(d, y) {
|
|
2899
|
-
console.error(y), d.dev || (d.hasReadableErrorStacks ? console.error(`To get a more detailed stack trace and pinpoint the issue, start the app in development mode by running \`next dev\`, then open "${d.route}" in your browser to investigate the error.`) : console.error(`To get a more detailed stack trace and pinpoint the issue, try one of the following:
|
|
2900
|
-
- Start the app in development mode by running \`next dev\`, then open "${d.route}" in your browser to investigate the error.
|
|
2901
|
-
- Rerun the production build with \`next build --debug-prerender\` to generate better stack traces.`));
|
|
2902
|
-
}
|
|
2903
|
-
function Mn(d, y, T, j) {
|
|
2904
|
-
if (y !== 0) {
|
|
2905
|
-
if (T.hasSuspenseAboveBody)
|
|
2906
|
-
return;
|
|
2907
|
-
if (j.syncDynamicErrorWithStack)
|
|
2908
|
-
throw xe(d, j.syncDynamicErrorWithStack), new r.StaticGenBailoutError();
|
|
2909
|
-
const F = T.dynamicErrors;
|
|
2910
|
-
if (F.length > 0) {
|
|
2911
|
-
for (let q = 0; q < F.length; q++)
|
|
2912
|
-
xe(d, F[q]);
|
|
2913
|
-
throw new r.StaticGenBailoutError();
|
|
2914
|
-
}
|
|
2915
|
-
if (T.hasDynamicViewport)
|
|
2916
|
-
throw console.error(`Route "${d.route}" has a \`generateViewport\` that depends on Request data (\`cookies()\`, etc...) or uncached external data (\`fetch(...)\`, etc...) without explicitly allowing fully dynamic rendering. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport`), new r.StaticGenBailoutError();
|
|
2917
|
-
if (y === 1)
|
|
2918
|
-
throw console.error(`Route "${d.route}" did not produce a static shell and Next.js was unable to determine a reason. This is a bug in Next.js.`), new r.StaticGenBailoutError();
|
|
2919
|
-
} else if (T.hasAllowedDynamic === !1 && T.hasDynamicMetadata)
|
|
2920
|
-
throw console.error(`Route "${d.route}" has a \`generateMetadata\` that depends on Request data (\`cookies()\`, etc...) or uncached external data (\`fetch(...)\`, etc...) when the rest of the route does not. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-metadata`), new r.StaticGenBailoutError();
|
|
2921
|
-
}
|
|
2922
|
-
function Un(d, y) {
|
|
2923
|
-
return d.runtimeStagePromise ? d.runtimeStagePromise.then(() => y) : y;
|
|
2924
|
-
}
|
|
2925
|
-
})(et)), et;
|
|
2926
|
-
}
|
|
2927
|
-
var an;
|
|
2928
|
-
function aa() {
|
|
2929
|
-
return an || (an = 1, (function(t, e) {
|
|
2930
|
-
Object.defineProperty(e, "__esModule", {
|
|
2931
|
-
value: !0
|
|
2932
|
-
}), Object.defineProperty(e, "unstable_rethrow", {
|
|
2933
|
-
enumerable: !0,
|
|
2934
|
-
get: function() {
|
|
2935
|
-
return c;
|
|
2936
|
-
}
|
|
2937
|
-
});
|
|
2938
|
-
const a = Pn(), n = Jr(), r = Le(), o = An(), i = Nn(), u = wn();
|
|
2939
|
-
function c(s) {
|
|
2940
|
-
if ((0, o.isNextRouterError)(s) || (0, r.isBailoutToCSRError)(s) || (0, u.isDynamicServerError)(s) || (0, i.isDynamicPostpone)(s) || (0, n.isPostpone)(s) || (0, a.isHangingPromiseRejectionError)(s))
|
|
2941
|
-
throw s;
|
|
2942
|
-
s instanceof Error && "cause" in s && c(s.cause);
|
|
2943
|
-
}
|
|
2944
|
-
(typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
|
|
2945
|
-
})(ye, ye.exports)), ye.exports;
|
|
2946
|
-
}
|
|
2947
|
-
var Te = { exports: {} }, on;
|
|
2948
|
-
function oa() {
|
|
2949
|
-
return on || (on = 1, (function(t, e) {
|
|
2950
|
-
Object.defineProperty(e, "__esModule", {
|
|
2951
|
-
value: !0
|
|
2952
|
-
}), Object.defineProperty(e, "unstable_rethrow", {
|
|
2953
|
-
enumerable: !0,
|
|
2954
|
-
get: function() {
|
|
2955
|
-
return r;
|
|
2956
|
-
}
|
|
2957
|
-
});
|
|
2958
|
-
const a = Le(), n = An();
|
|
2959
|
-
function r(o) {
|
|
2960
|
-
if ((0, n.isNextRouterError)(o) || (0, a.isBailoutToCSRError)(o))
|
|
2961
|
-
throw o;
|
|
2962
|
-
o instanceof Error && "cause" in o && r(o.cause);
|
|
2963
|
-
}
|
|
2964
|
-
(typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
|
|
2965
|
-
})(Te, Te.exports)), Te.exports;
|
|
2966
|
-
}
|
|
2967
|
-
var un;
|
|
2968
|
-
function ia() {
|
|
2969
|
-
return un || (un = 1, (function(t, e) {
|
|
2970
|
-
Object.defineProperty(e, "__esModule", {
|
|
2971
|
-
value: !0
|
|
2972
|
-
}), Object.defineProperty(e, "unstable_rethrow", {
|
|
2973
|
-
enumerable: !0,
|
|
2974
|
-
get: function() {
|
|
2975
|
-
return a;
|
|
2976
|
-
}
|
|
2977
|
-
});
|
|
2978
|
-
const a = typeof window > "u" ? aa().unstable_rethrow : oa().unstable_rethrow;
|
|
2979
|
-
(typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
|
|
2980
|
-
})(me, me.exports)), me.exports;
|
|
2981
|
-
}
|
|
2982
|
-
var sn;
|
|
2983
|
-
function ua() {
|
|
2984
|
-
return sn || (sn = 1, (function(t, e) {
|
|
2985
|
-
Object.defineProperty(e, "__esModule", {
|
|
2986
|
-
value: !0
|
|
2987
|
-
});
|
|
2988
|
-
function a(P, S) {
|
|
2989
|
-
for (var D in S) Object.defineProperty(P, D, {
|
|
2990
|
-
enumerable: !0,
|
|
2991
|
-
get: S[D]
|
|
2992
|
-
});
|
|
2993
|
-
}
|
|
2994
|
-
a(e, {
|
|
2995
|
-
ReadonlyURLSearchParams: function() {
|
|
2996
|
-
return R;
|
|
2997
|
-
},
|
|
2998
|
-
RedirectType: function() {
|
|
2999
|
-
return r.RedirectType;
|
|
3000
|
-
},
|
|
3001
|
-
forbidden: function() {
|
|
3002
|
-
return i.forbidden;
|
|
3003
|
-
},
|
|
3004
|
-
notFound: function() {
|
|
3005
|
-
return o.notFound;
|
|
3006
|
-
},
|
|
3007
|
-
permanentRedirect: function() {
|
|
3008
|
-
return n.permanentRedirect;
|
|
3009
|
-
},
|
|
3010
|
-
redirect: function() {
|
|
3011
|
-
return n.redirect;
|
|
3012
|
-
},
|
|
3013
|
-
unauthorized: function() {
|
|
3014
|
-
return u.unauthorized;
|
|
3015
|
-
},
|
|
3016
|
-
unstable_isUnrecognizedActionError: function() {
|
|
3017
|
-
return b;
|
|
3018
|
-
},
|
|
3019
|
-
unstable_rethrow: function() {
|
|
3020
|
-
return c.unstable_rethrow;
|
|
3021
|
-
}
|
|
3022
|
-
});
|
|
3023
|
-
const n = Yr(), r = Et(), o = Kr(), i = Vr(), u = Qr(), c = ia();
|
|
3024
|
-
class s extends Error {
|
|
3025
|
-
constructor() {
|
|
3026
|
-
super("Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams");
|
|
3027
|
-
}
|
|
3028
|
-
}
|
|
3029
|
-
class R extends URLSearchParams {
|
|
3030
|
-
/** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */
|
|
3031
|
-
append() {
|
|
3032
|
-
throw new s();
|
|
3033
|
-
}
|
|
3034
|
-
/** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */
|
|
3035
|
-
delete() {
|
|
3036
|
-
throw new s();
|
|
3037
|
-
}
|
|
3038
|
-
/** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */
|
|
3039
|
-
set() {
|
|
3040
|
-
throw new s();
|
|
3041
|
-
}
|
|
3042
|
-
/** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */
|
|
3043
|
-
sort() {
|
|
3044
|
-
throw new s();
|
|
3045
|
-
}
|
|
3046
|
-
}
|
|
3047
|
-
function b() {
|
|
3048
|
-
throw Object.defineProperty(new Error("`unstable_isUnrecognizedActionError` can only be used on the client."), "__NEXT_ERROR_CODE", {
|
|
3049
|
-
value: "E776",
|
|
3050
|
-
enumerable: !1,
|
|
3051
|
-
configurable: !0
|
|
3052
|
-
});
|
|
3053
|
-
}
|
|
3054
|
-
(typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
|
|
3055
|
-
})(le, le.exports)), le.exports;
|
|
3056
|
-
}
|
|
3057
|
-
var st = {}, ct = {}, cn;
|
|
3058
|
-
function sa() {
|
|
3059
|
-
if (cn) return ct;
|
|
3060
|
-
cn = 1;
|
|
3061
|
-
function t(a) {
|
|
3062
|
-
if (typeof WeakMap != "function") return null;
|
|
3063
|
-
var n = /* @__PURE__ */ new WeakMap(), r = /* @__PURE__ */ new WeakMap();
|
|
3064
|
-
return (t = function(o) {
|
|
3065
|
-
return o ? r : n;
|
|
3066
|
-
})(a);
|
|
3067
|
-
}
|
|
3068
|
-
function e(a, n) {
|
|
3069
|
-
if (!n && a && a.__esModule) return a;
|
|
3070
|
-
if (a === null || typeof a != "object" && typeof a != "function") return { default: a };
|
|
3071
|
-
var r = t(n);
|
|
3072
|
-
if (r && r.has(a)) return r.get(a);
|
|
3073
|
-
var o = { __proto__: null }, i = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
3074
|
-
for (var u in a)
|
|
3075
|
-
if (u !== "default" && Object.prototype.hasOwnProperty.call(a, u)) {
|
|
3076
|
-
var c = i ? Object.getOwnPropertyDescriptor(a, u) : null;
|
|
3077
|
-
c && (c.get || c.set) ? Object.defineProperty(o, u, c) : o[u] = a[u];
|
|
3078
|
-
}
|
|
3079
|
-
return o.default = a, r && r.set(a, o), o;
|
|
3080
|
-
}
|
|
3081
|
-
return ct._ = e, ct;
|
|
3082
|
-
}
|
|
3083
|
-
var ln;
|
|
3084
|
-
function ca() {
|
|
3085
|
-
return ln || (ln = 1, (function(t) {
|
|
3086
|
-
"use client";
|
|
3087
|
-
Object.defineProperty(t, "__esModule", {
|
|
3088
|
-
value: !0
|
|
3089
|
-
});
|
|
3090
|
-
function e(i, u) {
|
|
3091
|
-
for (var c in u) Object.defineProperty(i, c, {
|
|
3092
|
-
enumerable: !0,
|
|
3093
|
-
get: u[c]
|
|
3094
|
-
});
|
|
3095
|
-
}
|
|
3096
|
-
e(t, {
|
|
3097
|
-
ServerInsertedHTMLContext: function() {
|
|
3098
|
-
return r;
|
|
3099
|
-
},
|
|
3100
|
-
useServerInsertedHTML: function() {
|
|
3101
|
-
return o;
|
|
3102
|
-
}
|
|
3103
|
-
});
|
|
3104
|
-
const n = /* @__PURE__ */ (/* @__PURE__ */ sa())._(V), r = /* @__PURE__ */ n.default.createContext(null);
|
|
3105
|
-
function o(i) {
|
|
3106
|
-
const u = (0, n.useContext)(r);
|
|
3107
|
-
u && u(i);
|
|
3108
|
-
}
|
|
3109
|
-
})(st)), st;
|
|
3110
|
-
}
|
|
3111
|
-
var Pe = { exports: {} }, dn;
|
|
3112
|
-
function la() {
|
|
3113
|
-
return dn || (dn = 1, (function(t, e) {
|
|
3114
|
-
Object.defineProperty(e, "__esModule", {
|
|
3115
|
-
value: !0
|
|
3116
|
-
});
|
|
3117
|
-
function a(o, i) {
|
|
3118
|
-
for (var u in i) Object.defineProperty(o, u, {
|
|
3119
|
-
enumerable: !0,
|
|
3120
|
-
get: i[u]
|
|
3121
|
-
});
|
|
3122
|
-
}
|
|
3123
|
-
a(e, {
|
|
3124
|
-
UnrecognizedActionError: function() {
|
|
3125
|
-
return n;
|
|
3126
|
-
},
|
|
3127
|
-
unstable_isUnrecognizedActionError: function() {
|
|
3128
|
-
return r;
|
|
3129
|
-
}
|
|
3130
|
-
});
|
|
3131
|
-
class n extends Error {
|
|
3132
|
-
constructor(...i) {
|
|
3133
|
-
super(...i), this.name = "UnrecognizedActionError";
|
|
3134
|
-
}
|
|
3135
|
-
}
|
|
3136
|
-
function r(o) {
|
|
3137
|
-
return !!(o && typeof o == "object" && o instanceof n);
|
|
3138
|
-
}
|
|
3139
|
-
(typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
|
|
3140
|
-
})(Pe, Pe.exports)), Pe.exports;
|
|
3141
|
-
}
|
|
3142
|
-
var Ae = { exports: {} }, fn;
|
|
3143
|
-
function da() {
|
|
3144
|
-
return fn || (fn = 1, (function(t, e) {
|
|
3145
|
-
Object.defineProperty(e, "__esModule", {
|
|
3146
|
-
value: !0
|
|
3147
|
-
}), Object.defineProperty(e, "bailoutToClientRendering", {
|
|
3148
|
-
enumerable: !0,
|
|
3149
|
-
get: function() {
|
|
3150
|
-
return o;
|
|
3151
|
-
}
|
|
3152
|
-
});
|
|
3153
|
-
const a = Le(), n = Cn(), r = Dn();
|
|
3154
|
-
function o(i) {
|
|
3155
|
-
const u = n.workAsyncStorage.getStore();
|
|
3156
|
-
if (u != null && u.forceStatic) return;
|
|
3157
|
-
const c = r.workUnitAsyncStorage.getStore();
|
|
3158
|
-
if (c)
|
|
3159
|
-
switch (c.type) {
|
|
3160
|
-
case "prerender":
|
|
3161
|
-
case "prerender-runtime":
|
|
3162
|
-
case "prerender-client":
|
|
3163
|
-
case "prerender-ppr":
|
|
3164
|
-
case "prerender-legacy":
|
|
3165
|
-
throw Object.defineProperty(new a.BailoutToCSRError(i), "__NEXT_ERROR_CODE", {
|
|
3166
|
-
value: "E394",
|
|
3167
|
-
enumerable: !1,
|
|
3168
|
-
configurable: !0
|
|
3169
|
-
});
|
|
3170
|
-
}
|
|
3171
|
-
}
|
|
3172
|
-
(typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
|
|
3173
|
-
})(Ae, Ae.exports)), Ae.exports;
|
|
3174
|
-
}
|
|
3175
|
-
var gn;
|
|
3176
|
-
function fa() {
|
|
3177
|
-
return gn || (gn = 1, (function(t, e) {
|
|
3178
|
-
Object.defineProperty(e, "__esModule", {
|
|
3179
|
-
value: !0
|
|
3180
|
-
});
|
|
3181
|
-
function a(E, g) {
|
|
3182
|
-
for (var v in g) Object.defineProperty(E, v, {
|
|
3183
|
-
enumerable: !0,
|
|
3184
|
-
get: g[v]
|
|
3185
|
-
});
|
|
3186
|
-
}
|
|
3187
|
-
a(e, {
|
|
3188
|
-
ReadonlyURLSearchParams: function() {
|
|
3189
|
-
return c.ReadonlyURLSearchParams;
|
|
3190
|
-
},
|
|
3191
|
-
RedirectType: function() {
|
|
3192
|
-
return c.RedirectType;
|
|
3193
|
-
},
|
|
3194
|
-
ServerInsertedHTMLContext: function() {
|
|
3195
|
-
return s.ServerInsertedHTMLContext;
|
|
3196
|
-
},
|
|
3197
|
-
forbidden: function() {
|
|
3198
|
-
return c.forbidden;
|
|
3199
|
-
},
|
|
3200
|
-
notFound: function() {
|
|
3201
|
-
return c.notFound;
|
|
3202
|
-
},
|
|
3203
|
-
permanentRedirect: function() {
|
|
3204
|
-
return c.permanentRedirect;
|
|
3205
|
-
},
|
|
3206
|
-
redirect: function() {
|
|
3207
|
-
return c.redirect;
|
|
3208
|
-
},
|
|
3209
|
-
unauthorized: function() {
|
|
3210
|
-
return c.unauthorized;
|
|
3211
|
-
},
|
|
3212
|
-
unstable_isUnrecognizedActionError: function() {
|
|
3213
|
-
return R.unstable_isUnrecognizedActionError;
|
|
3214
|
-
},
|
|
3215
|
-
unstable_rethrow: function() {
|
|
3216
|
-
return c.unstable_rethrow;
|
|
3217
|
-
},
|
|
3218
|
-
useParams: function() {
|
|
3219
|
-
return p;
|
|
3220
|
-
},
|
|
3221
|
-
usePathname: function() {
|
|
3222
|
-
return S;
|
|
3223
|
-
},
|
|
3224
|
-
useRouter: function() {
|
|
3225
|
-
return D;
|
|
3226
|
-
},
|
|
3227
|
-
useSearchParams: function() {
|
|
3228
|
-
return P;
|
|
3229
|
-
},
|
|
3230
|
-
useSelectedLayoutSegment: function() {
|
|
3231
|
-
return _;
|
|
3232
|
-
},
|
|
3233
|
-
useSelectedLayoutSegments: function() {
|
|
3234
|
-
return l;
|
|
3235
|
-
},
|
|
3236
|
-
useServerInsertedHTML: function() {
|
|
3237
|
-
return s.useServerInsertedHTML;
|
|
3238
|
-
}
|
|
3239
|
-
});
|
|
3240
|
-
const n = V, r = Hr(), o = Br(), i = Xr(), u = Gr(), c = ua(), s = ca(), R = la(), b = typeof window > "u" ? Nn().useDynamicRouteParams : void 0;
|
|
3241
|
-
function P() {
|
|
3242
|
-
const E = (0, n.useContext)(o.SearchParamsContext), g = (0, n.useMemo)(() => E ? new c.ReadonlyURLSearchParams(E) : null, [
|
|
3243
|
-
E
|
|
3244
|
-
]);
|
|
3245
|
-
if (typeof window > "u") {
|
|
3246
|
-
const { bailoutToClientRendering: v } = da();
|
|
3247
|
-
v("useSearchParams()");
|
|
3248
|
-
}
|
|
3249
|
-
return g;
|
|
3250
|
-
}
|
|
3251
|
-
function S() {
|
|
3252
|
-
return b == null || b("usePathname()"), (0, n.useContext)(o.PathnameContext);
|
|
3253
|
-
}
|
|
3254
|
-
function D() {
|
|
3255
|
-
const E = (0, n.useContext)(r.AppRouterContext);
|
|
3256
|
-
if (E === null)
|
|
3257
|
-
throw Object.defineProperty(new Error("invariant expected app router to be mounted"), "__NEXT_ERROR_CODE", {
|
|
3258
|
-
value: "E238",
|
|
3259
|
-
enumerable: !1,
|
|
3260
|
-
configurable: !0
|
|
3261
|
-
});
|
|
3262
|
-
return E;
|
|
3263
|
-
}
|
|
3264
|
-
function p() {
|
|
3265
|
-
return b == null || b("useParams()"), (0, n.useContext)(o.PathParamsContext);
|
|
3266
|
-
}
|
|
3267
|
-
function m(E, g, v, O) {
|
|
3268
|
-
v === void 0 && (v = !0), O === void 0 && (O = []);
|
|
3269
|
-
let f;
|
|
3270
|
-
if (v)
|
|
3271
|
-
f = E[1][g];
|
|
3272
|
-
else {
|
|
3273
|
-
const N = E[1];
|
|
3274
|
-
var A;
|
|
3275
|
-
f = (A = N.children) != null ? A : Object.values(N)[0];
|
|
3276
|
-
}
|
|
3277
|
-
if (!f) return O;
|
|
3278
|
-
const L = f[0];
|
|
3279
|
-
let I = (0, i.getSegmentValue)(L);
|
|
3280
|
-
return !I || I.startsWith(u.PAGE_SEGMENT_KEY) ? O : (O.push(I), m(f, g, !1, O));
|
|
3281
|
-
}
|
|
3282
|
-
function l(E) {
|
|
3283
|
-
E === void 0 && (E = "children"), b == null || b("useSelectedLayoutSegments()");
|
|
3284
|
-
const g = (0, n.useContext)(r.LayoutRouterContext);
|
|
3285
|
-
return g ? m(g.parentTree, E) : null;
|
|
3286
|
-
}
|
|
3287
|
-
function _(E) {
|
|
3288
|
-
E === void 0 && (E = "children"), b == null || b("useSelectedLayoutSegment()");
|
|
3289
|
-
const g = l(E);
|
|
3290
|
-
if (!g || g.length === 0)
|
|
3291
|
-
return null;
|
|
3292
|
-
const v = E === "children" ? g[0] : g[g.length - 1];
|
|
3293
|
-
return v === u.DEFAULT_SEGMENT_KEY ? null : v;
|
|
3294
|
-
}
|
|
3295
|
-
(typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
|
|
3296
|
-
})(se, se.exports)), se.exports;
|
|
3297
|
-
}
|
|
3298
|
-
var lt, pn;
|
|
3299
|
-
function ga() {
|
|
3300
|
-
return pn || (pn = 1, lt = fa()), lt;
|
|
3301
|
-
}
|
|
3302
|
-
ga();
|
|
3303
|
-
function pa() {
|
|
3304
|
-
const t = process.env.NEXT_PUBLIC_TOLGEE_API_KEY, e = process.env.NEXT_PUBLIC_TOLGEE_API_URL;
|
|
3305
|
-
return jr().use(mr()).use(Lr()).updateDefaults({
|
|
3306
|
-
apiKey: t,
|
|
3307
|
-
apiUrl: e
|
|
3308
|
-
});
|
|
3309
|
-
}
|
|
3310
|
-
pa().init();
|
|
3311
|
-
const _a = () => !!Hn.get("refresh_token");
|
|
3312
|
-
var ha = /* @__PURE__ */ ((t) => (t.CLOSE_LOGIN_MODAL = "closeLoginModal", t.LOGIN_SUCCESS = "loginSuccess", t))(ha || {}), Ea = /* @__PURE__ */ ((t) => (t.LOGIN = "login", t.REGISTER = "register", t))(Ea || {});
|
|
3313
|
-
const jn = kn(void 0);
|
|
3314
|
-
function Ta({ children: t, loginSuccessCallback: e = () => Promise.resolve() }) {
|
|
3315
|
-
const [a, n] = Se(!1), [r, o] = Se(!1), [i, u] = Se(null), c = qn(/* @__PURE__ */ new Set()), { getLanguage: s } = qr(), R = s() || "", { resolvedTheme: b } = Fn(), P = r && b ? b : "light", S = J((g) => {
|
|
3316
|
-
const v = typeof window < "u" ? window.location.href : "", O = `${process.env.NEXT_PUBLIC_AUTH_URL}/${R}/login?mode=dialog&theme=${P}&redirect_uri=${v}`, f = `${process.env.NEXT_PUBLIC_AUTH_URL}/${R}/register?mode=dialog&theme=${P}&redirect_uri=${v}`;
|
|
3317
|
-
n(!0), u(g === "register" ? f : O);
|
|
3318
|
-
}, [P, R]), D = J(() => {
|
|
3319
|
-
n(!1);
|
|
3320
|
-
}, []), p = J((g) => {
|
|
3321
|
-
n(g);
|
|
2
|
+
import { jsx as m, jsxs as y } from "react/jsx-runtime";
|
|
3
|
+
import I, { createContext as M, useState as w, useRef as N, useCallback as c, useEffect as p, useContext as R } from "react";
|
|
4
|
+
import { useLocale as O } from "next-intl";
|
|
5
|
+
import { twMerge as $ } from "tailwind-merge";
|
|
6
|
+
import { useTheme as P } from "@ichaingo/next-themes";
|
|
7
|
+
import k from "js-cookie";
|
|
8
|
+
const z = () => !!k.get("refresh_token");
|
|
9
|
+
var A = /* @__PURE__ */ ((e) => (e.CLOSE_LOGIN_MODAL = "closeLoginModal", e.LOGIN_SUCCESS = "loginSuccess", e))(A || {}), B = /* @__PURE__ */ ((e) => (e.LOGIN = "login", e.REGISTER = "register", e))(B || {});
|
|
10
|
+
const C = M(void 0);
|
|
11
|
+
function F({ children: e, loginSuccessCallback: n = () => Promise.resolve() }) {
|
|
12
|
+
const [i, s] = w(!1), [l, h] = w(!1), [a, v] = w(null), _ = N(/* @__PURE__ */ new Set()), u = O(), { resolvedTheme: U } = P(), t = l && U ? U : "light", L = c((o) => {
|
|
13
|
+
const r = typeof window < "u" ? window.location.href : "", g = `${process.env.NEXT_PUBLIC_AUTH_URL}/${u}/login?mode=dialog&theme=${t}&redirect_uri=${r}`, f = `${process.env.NEXT_PUBLIC_AUTH_URL}/${u}/register?mode=dialog&theme=${t}&redirect_uri=${r}`;
|
|
14
|
+
s(!0), v(o === "register" ? f : g);
|
|
15
|
+
}, [t, u]), d = c(() => {
|
|
16
|
+
s(!1);
|
|
17
|
+
}, []), E = c((o) => {
|
|
18
|
+
s(o);
|
|
3322
19
|
}, []);
|
|
3323
|
-
|
|
3324
|
-
if (
|
|
3325
|
-
const
|
|
3326
|
-
|
|
3327
|
-
}
|
|
3328
|
-
}, [
|
|
3329
|
-
|
|
3330
|
-
const
|
|
3331
|
-
var
|
|
3332
|
-
((
|
|
20
|
+
p(() => {
|
|
21
|
+
if (t) {
|
|
22
|
+
const o = typeof window < "u" ? window.location.href : "", r = `${process.env.NEXT_PUBLIC_AUTH_URL}/${u}/login?mode=dialog&theme=${t}&redirect_uri=${o}`;
|
|
23
|
+
v(r);
|
|
24
|
+
}
|
|
25
|
+
}, [t]), p(() => {
|
|
26
|
+
h(!0);
|
|
27
|
+
const o = (r) => {
|
|
28
|
+
var g, f;
|
|
29
|
+
((g = r.data) == null ? void 0 : g.type) === "closeLoginModal" && d(), ((f = r.data) == null ? void 0 : f.type) === "loginSuccess" && (console.log("handleMessage", r.data.type), d(), window.location.reload());
|
|
3333
30
|
};
|
|
3334
|
-
return window.addEventListener("message",
|
|
3335
|
-
window.removeEventListener("message",
|
|
31
|
+
return window.addEventListener("message", o), () => {
|
|
32
|
+
window.removeEventListener("message", o);
|
|
3336
33
|
};
|
|
3337
|
-
}, [
|
|
3338
|
-
const
|
|
3339
|
-
|
|
3340
|
-
}), []),
|
|
3341
|
-
({ children:
|
|
3342
|
-
[
|
|
3343
|
-
),
|
|
34
|
+
}, [d, n]);
|
|
35
|
+
const S = c((o) => (_.current.add(o), () => {
|
|
36
|
+
_.current.delete(o);
|
|
37
|
+
}), []), x = c(
|
|
38
|
+
({ children: o, ...r }) => /* @__PURE__ */ m("div", { onClick: () => L(), style: { cursor: "pointer" }, ...r, children: o }),
|
|
39
|
+
[L]
|
|
40
|
+
), T = I.useMemo(() => z() ? null : /* @__PURE__ */ m(
|
|
3344
41
|
"div",
|
|
3345
42
|
{
|
|
3346
|
-
className:
|
|
43
|
+
className: $(
|
|
3347
44
|
" left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-full h-full bg-[rgba(0,0,0,0.7)] opacity-0 z-[-1]",
|
|
3348
45
|
"transition-all duration-500 zoom-in-out fixed block",
|
|
3349
|
-
|
|
46
|
+
i && "z-99999 opacity-100"
|
|
3350
47
|
),
|
|
3351
|
-
children:
|
|
48
|
+
children: a && /* @__PURE__ */ m(
|
|
3352
49
|
"iframe",
|
|
3353
50
|
{
|
|
3354
|
-
src:
|
|
3355
|
-
className:
|
|
51
|
+
src: a ?? "",
|
|
52
|
+
className: $(
|
|
3356
53
|
"w-full h-full border-none relative z-10 transition-opacity duration-300",
|
|
3357
54
|
"opacity-100"
|
|
3358
55
|
),
|
|
3359
56
|
title: "Login",
|
|
3360
57
|
sandbox: "allow-scripts allow-forms allow-same-origin"
|
|
3361
58
|
},
|
|
3362
|
-
`login-iframe-${
|
|
59
|
+
`login-iframe-${t}`
|
|
3363
60
|
)
|
|
3364
61
|
}
|
|
3365
62
|
), [
|
|
3366
|
-
P,
|
|
3367
|
-
a,
|
|
3368
|
-
i
|
|
3369
|
-
]), E = {
|
|
3370
|
-
isOpen: a,
|
|
3371
|
-
openLogin: S,
|
|
3372
|
-
closeLogin: D,
|
|
3373
|
-
setLoginOpen: p,
|
|
3374
|
-
url: i,
|
|
3375
|
-
currentTheme: P,
|
|
3376
|
-
mounted: r,
|
|
3377
|
-
Trigger: l,
|
|
3378
|
-
registerLoginSuccessCallback: m
|
|
3379
|
-
};
|
|
3380
|
-
return /* @__PURE__ */ xn(jn.Provider, { value: E, children: [
|
|
3381
63
|
t,
|
|
3382
|
-
|
|
64
|
+
i,
|
|
65
|
+
a
|
|
66
|
+
]), b = {
|
|
67
|
+
isOpen: i,
|
|
68
|
+
openLogin: L,
|
|
69
|
+
closeLogin: d,
|
|
70
|
+
setLoginOpen: E,
|
|
71
|
+
url: a,
|
|
72
|
+
currentTheme: t,
|
|
73
|
+
mounted: l,
|
|
74
|
+
Trigger: x,
|
|
75
|
+
registerLoginSuccessCallback: S
|
|
76
|
+
};
|
|
77
|
+
return /* @__PURE__ */ y(C.Provider, { value: b, children: [
|
|
78
|
+
e,
|
|
79
|
+
T
|
|
3383
80
|
] });
|
|
3384
81
|
}
|
|
3385
|
-
function
|
|
3386
|
-
const
|
|
3387
|
-
if (
|
|
82
|
+
function G() {
|
|
83
|
+
const e = R(C);
|
|
84
|
+
if (e === void 0)
|
|
3388
85
|
throw new Error("useLogin must be used within a LoginProvider");
|
|
3389
|
-
return
|
|
86
|
+
return e;
|
|
3390
87
|
}
|
|
3391
|
-
function
|
|
3392
|
-
const { Trigger:
|
|
3393
|
-
return
|
|
3394
|
-
if (
|
|
3395
|
-
return
|
|
3396
|
-
}, [
|
|
88
|
+
function J({ children: e, onClick: n, ...i }) {
|
|
89
|
+
const { Trigger: s, registerLoginSuccessCallback: l } = G();
|
|
90
|
+
return p(() => {
|
|
91
|
+
if (n)
|
|
92
|
+
return l(n);
|
|
93
|
+
}, [n, l]), e ? /* @__PURE__ */ m(s, { ...i, children: e }) : null;
|
|
3397
94
|
}
|
|
3398
95
|
export {
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
96
|
+
A as LoginMessageType,
|
|
97
|
+
F as LoginProvider,
|
|
98
|
+
B as OpenLoginType,
|
|
99
|
+
J as WithLogin,
|
|
100
|
+
J as default,
|
|
101
|
+
z as isLogin,
|
|
102
|
+
G as useLogin
|
|
3406
103
|
};
|