@kong-ui-public/document-viewer 0.2.11 → 0.3.0
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/document-viewer.es.js +672 -645
- package/dist/document-viewer.es.js.map +1 -1
- package/dist/document-viewer.umd.js +10 -10
- package/dist/document-viewer.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/components/DocumentViewer.vue.d.ts.map +1 -1
- package/dist/types/components/nodes/Heading.vue.d.ts +9 -0
- package/dist/types/components/nodes/Heading.vue.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/utils/addUniqueHeadingSlugs.d.ts +3 -0
- package/dist/types/utils/addUniqueHeadingSlugs.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +3 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/toSlug.d.ts +2 -0
- package/dist/types/utils/toSlug.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { openBlock as y, createElementBlock as S, renderSlot as I, createElementVNode as ot, defineComponent as w, createBlock as $, resolveDynamicComponent as Z, unref as k, withCtx as Y, normalizeClass as
|
|
1
|
+
import { openBlock as y, createElementBlock as S, renderSlot as I, createElementVNode as ot, defineComponent as w, createBlock as $, resolveDynamicComponent as Z, unref as k, withCtx as Y, normalizeClass as ne, Fragment as oe, createTextVNode as ie, toDisplayString as Lt, createCommentVNode as ae, createVNode as se, mergeProps as ce, h as ue, computed as le } from "vue";
|
|
2
2
|
var x = /* @__PURE__ */ ((t) => (t.header = "header", t.body = "body", t.footer = "footer", t))(x || {}), Q = /* @__PURE__ */ ((t) => (t.left = "left", t.center = "center", t.right = "right", t))(Q || {});
|
|
3
|
-
function
|
|
3
|
+
function he(t) {
|
|
4
4
|
return t.type === "text";
|
|
5
5
|
}
|
|
6
|
-
const R = (t,
|
|
7
|
-
const
|
|
8
|
-
for (const [n, o] of
|
|
9
|
-
|
|
10
|
-
return
|
|
11
|
-
},
|
|
12
|
-
function
|
|
6
|
+
const R = (t, e) => {
|
|
7
|
+
const r = t.__vccOpts || t;
|
|
8
|
+
for (const [n, o] of e)
|
|
9
|
+
r[n] = o;
|
|
10
|
+
return r;
|
|
11
|
+
}, fe = {};
|
|
12
|
+
function pe(t, e) {
|
|
13
13
|
return y(), S("blockquote", null, [
|
|
14
14
|
I(t.$slots, "default", {}, void 0, !0)
|
|
15
15
|
]);
|
|
16
16
|
}
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
function
|
|
17
|
+
const me = /* @__PURE__ */ R(fe, [["render", pe], ["__scopeId", "data-v-8e8713de"]]);
|
|
18
|
+
const ge = {};
|
|
19
|
+
function de(t, e) {
|
|
20
20
|
return y(), S("code", null, [
|
|
21
21
|
I(t.$slots, "default", {}, void 0, !0)
|
|
22
22
|
]);
|
|
23
23
|
}
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
function
|
|
24
|
+
const _e = /* @__PURE__ */ R(ge, [["render", de], ["__scopeId", "data-v-015a6bbb"]]);
|
|
25
|
+
const Ee = {};
|
|
26
|
+
function ye(t, e) {
|
|
27
27
|
return y(), S("pre", null, [
|
|
28
28
|
ot("code", null, [
|
|
29
29
|
I(t.$slots, "default", {}, void 0, !0)
|
|
30
30
|
])
|
|
31
31
|
]);
|
|
32
32
|
}
|
|
33
|
-
const
|
|
33
|
+
const be = /* @__PURE__ */ R(Ee, [["render", ye], ["__scopeId", "data-v-7d7d103e"]]), ve = /* @__PURE__ */ w({
|
|
34
34
|
__name: "Emphasis",
|
|
35
35
|
props: {
|
|
36
36
|
level: {
|
|
@@ -39,21 +39,21 @@ const br = /* @__PURE__ */ R(Er, [["render", yr], ["__scopeId", "data-v-7d7d103e
|
|
|
39
39
|
validator(t) {
|
|
40
40
|
if (!Number.isInteger(t))
|
|
41
41
|
return !1;
|
|
42
|
-
const
|
|
43
|
-
return
|
|
42
|
+
const e = t;
|
|
43
|
+
return e > 0 && e < 3;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
setup(t) {
|
|
48
|
-
const
|
|
49
|
-
return (n, o) => (y(), $(Z(k(
|
|
48
|
+
const r = t.level === 1 ? "em" : "strong";
|
|
49
|
+
return (n, o) => (y(), $(Z(k(r)), null, {
|
|
50
50
|
default: Y(() => [
|
|
51
51
|
I(n.$slots, "default")
|
|
52
52
|
]),
|
|
53
53
|
_: 3
|
|
54
54
|
}));
|
|
55
55
|
}
|
|
56
|
-
}),
|
|
56
|
+
}), Te = /* @__PURE__ */ w({
|
|
57
57
|
__name: "Heading",
|
|
58
58
|
props: {
|
|
59
59
|
level: {
|
|
@@ -61,23 +61,27 @@ const br = /* @__PURE__ */ R(Er, [["render", yr], ["__scopeId", "data-v-7d7d103e
|
|
|
61
61
|
validator(t) {
|
|
62
62
|
if (!Number.isInteger(t))
|
|
63
63
|
return !1;
|
|
64
|
-
const
|
|
65
|
-
return
|
|
64
|
+
const e = t;
|
|
65
|
+
return e > 0 && e < 7;
|
|
66
66
|
},
|
|
67
67
|
default: 1
|
|
68
|
+
},
|
|
69
|
+
slug: {
|
|
70
|
+
type: String,
|
|
71
|
+
default: ""
|
|
68
72
|
}
|
|
69
73
|
},
|
|
70
74
|
setup(t) {
|
|
71
|
-
const e = `h${
|
|
72
|
-
return (
|
|
75
|
+
const e = t, r = `${e.slug}`, n = `h${e.level}`;
|
|
76
|
+
return (o, i) => (y(), $(Z(n), { id: r }, {
|
|
73
77
|
default: Y(() => [
|
|
74
|
-
I(
|
|
78
|
+
I(o.$slots, "default", {}, void 0, !0)
|
|
75
79
|
]),
|
|
76
80
|
_: 3
|
|
77
81
|
}));
|
|
78
82
|
}
|
|
79
83
|
});
|
|
80
|
-
const
|
|
84
|
+
const He = /* @__PURE__ */ R(Te, [["__scopeId", "data-v-2a3c189f"]]), Be = ["alt", "src", "title"], Ae = /* @__PURE__ */ w({
|
|
81
85
|
__name: "Image",
|
|
82
86
|
props: {
|
|
83
87
|
url: {
|
|
@@ -94,28 +98,28 @@ const Hr = /* @__PURE__ */ R(Tr, [["__scopeId", "data-v-07152ca1"]]), Br = ["alt
|
|
|
94
98
|
}
|
|
95
99
|
},
|
|
96
100
|
setup(t) {
|
|
97
|
-
return (
|
|
101
|
+
return (e, r) => (y(), S("figure", null, [
|
|
98
102
|
ot("img", {
|
|
99
103
|
alt: t.alt,
|
|
100
104
|
src: t.url,
|
|
101
105
|
title: t.title
|
|
102
|
-
}, null, 8,
|
|
106
|
+
}, null, 8, Be),
|
|
103
107
|
ot("figcaption", null, [
|
|
104
|
-
I(
|
|
108
|
+
I(e.$slots, "default")
|
|
105
109
|
])
|
|
106
110
|
]));
|
|
107
111
|
}
|
|
108
|
-
}),
|
|
109
|
-
function
|
|
112
|
+
}), Se = {};
|
|
113
|
+
function Ie(t, e) {
|
|
110
114
|
return y(), S("hr");
|
|
111
115
|
}
|
|
112
|
-
const
|
|
113
|
-
function
|
|
116
|
+
const Ne = /* @__PURE__ */ R(Se, [["render", Ie]]), Re = {};
|
|
117
|
+
function Pe(t, e) {
|
|
114
118
|
return y(), S("table", null, [
|
|
115
119
|
I(t.$slots, "default")
|
|
116
120
|
]);
|
|
117
121
|
}
|
|
118
|
-
const
|
|
122
|
+
const Le = /* @__PURE__ */ R(Re, [["render", Pe]]), Oe = /* @__PURE__ */ w({
|
|
119
123
|
__name: "TableRow",
|
|
120
124
|
props: {
|
|
121
125
|
section: {
|
|
@@ -124,16 +128,16 @@ const Lr = /* @__PURE__ */ R(Rr, [["render", Pr]]), Or = /* @__PURE__ */ w({
|
|
|
124
128
|
}
|
|
125
129
|
},
|
|
126
130
|
setup(t) {
|
|
127
|
-
const
|
|
128
|
-
let
|
|
129
|
-
return
|
|
131
|
+
const e = t;
|
|
132
|
+
let r;
|
|
133
|
+
return e.section === x.header ? r = "thead" : e.section === x.body ? r = "tbody" : e.section === x.footer && (r = "tfoot"), (n, o) => (y(), $(Z(k(r)), null, {
|
|
130
134
|
default: Y(() => [
|
|
131
135
|
I(n.$slots, "default")
|
|
132
136
|
]),
|
|
133
137
|
_: 3
|
|
134
138
|
}));
|
|
135
139
|
}
|
|
136
|
-
}),
|
|
140
|
+
}), Me = /* @__PURE__ */ w({
|
|
137
141
|
__name: "TableCell",
|
|
138
142
|
props: {
|
|
139
143
|
align: {
|
|
@@ -147,10 +151,10 @@ const Lr = /* @__PURE__ */ R(Rr, [["render", Pr]]), Or = /* @__PURE__ */ w({
|
|
|
147
151
|
},
|
|
148
152
|
setup(t) {
|
|
149
153
|
var o;
|
|
150
|
-
const
|
|
154
|
+
const e = t, r = ((o = e.parent) == null ? void 0 : o.section) === x.header ? "th" : "td";
|
|
151
155
|
let n;
|
|
152
|
-
return
|
|
153
|
-
class:
|
|
156
|
+
return e.align === Q.center ? n = "align-center" : e.align === Q.right && (n = "align-right"), (i, a) => (y(), $(Z(k(r)), {
|
|
157
|
+
class: ne(k(n))
|
|
154
158
|
}, {
|
|
155
159
|
default: Y(() => [
|
|
156
160
|
I(i.$slots, "default", {}, void 0, !0)
|
|
@@ -159,10 +163,10 @@ const Lr = /* @__PURE__ */ R(Rr, [["render", Pr]]), Or = /* @__PURE__ */ w({
|
|
|
159
163
|
}, 8, ["class"]));
|
|
160
164
|
}
|
|
161
165
|
});
|
|
162
|
-
const
|
|
166
|
+
const Ce = /* @__PURE__ */ R(Me, [["__scopeId", "data-v-6da63f53"]]), we = { key: 0 }, De = {
|
|
163
167
|
inheritAttrs: !1
|
|
164
|
-
},
|
|
165
|
-
...
|
|
168
|
+
}, Ue = /* @__PURE__ */ w({
|
|
169
|
+
...De,
|
|
166
170
|
__name: "Text",
|
|
167
171
|
props: {
|
|
168
172
|
text: {
|
|
@@ -175,25 +179,25 @@ const Cr = /* @__PURE__ */ R(Mr, [["__scopeId", "data-v-6da63f53"]]), wr = { key
|
|
|
175
179
|
}
|
|
176
180
|
},
|
|
177
181
|
setup(t) {
|
|
178
|
-
return (
|
|
179
|
-
|
|
180
|
-
t.appendSpace ? (y(), S("span",
|
|
182
|
+
return (e, r) => (y(), S(oe, null, [
|
|
183
|
+
ie(Lt(t.text), 1),
|
|
184
|
+
t.appendSpace ? (y(), S("span", we, " ")) : ae("", !0)
|
|
181
185
|
], 64));
|
|
182
186
|
}
|
|
183
|
-
}),
|
|
184
|
-
function
|
|
187
|
+
}), Fe = {};
|
|
188
|
+
function Ge(t, e) {
|
|
185
189
|
return y(), S("span", null, [
|
|
186
190
|
I(t.$slots, "default")
|
|
187
191
|
]);
|
|
188
192
|
}
|
|
189
|
-
const
|
|
190
|
-
const
|
|
191
|
-
function
|
|
193
|
+
const ke = /* @__PURE__ */ R(Fe, [["render", Ge]]);
|
|
194
|
+
const je = {};
|
|
195
|
+
function xe(t, e) {
|
|
192
196
|
return y(), S("p", null, [
|
|
193
197
|
I(t.$slots, "default", {}, void 0, !0)
|
|
194
198
|
]);
|
|
195
199
|
}
|
|
196
|
-
const
|
|
200
|
+
const Ve = /* @__PURE__ */ R(je, [["render", xe], ["__scopeId", "data-v-c7681718"]]), $e = /* @__PURE__ */ w({
|
|
197
201
|
__name: "List",
|
|
198
202
|
props: {
|
|
199
203
|
isOrdered: {
|
|
@@ -202,8 +206,8 @@ const Vr = /* @__PURE__ */ R(jr, [["render", xr], ["__scopeId", "data-v-c7681718
|
|
|
202
206
|
}
|
|
203
207
|
},
|
|
204
208
|
setup(t) {
|
|
205
|
-
const
|
|
206
|
-
return (n, o) => (y(), $(Z(k(
|
|
209
|
+
const r = t.isOrdered ? "ol" : "ul";
|
|
210
|
+
return (n, o) => (y(), $(Z(k(r)), null, {
|
|
207
211
|
default: Y(() => [
|
|
208
212
|
I(n.$slots, "default", {}, void 0, !0)
|
|
209
213
|
]),
|
|
@@ -211,13 +215,13 @@ const Vr = /* @__PURE__ */ R(jr, [["render", xr], ["__scopeId", "data-v-c7681718
|
|
|
211
215
|
}));
|
|
212
216
|
}
|
|
213
217
|
});
|
|
214
|
-
const
|
|
215
|
-
function
|
|
218
|
+
const Xe = /* @__PURE__ */ R($e, [["__scopeId", "data-v-f52e8277"]]), Ke = {};
|
|
219
|
+
function Ze(t, e) {
|
|
216
220
|
return y(), S("li", null, [
|
|
217
221
|
I(t.$slots, "default")
|
|
218
222
|
]);
|
|
219
223
|
}
|
|
220
|
-
const
|
|
224
|
+
const Ye = /* @__PURE__ */ R(Ke, [["render", Ze]]), qe = ["href", "title"], We = /* @__PURE__ */ w({
|
|
221
225
|
__name: "Link",
|
|
222
226
|
props: {
|
|
223
227
|
href: {
|
|
@@ -230,102 +234,102 @@ const Yr = /* @__PURE__ */ R(Kr, [["render", Zr]]), qr = ["href", "title"], Wr =
|
|
|
230
234
|
}
|
|
231
235
|
},
|
|
232
236
|
setup(t) {
|
|
233
|
-
return (
|
|
237
|
+
return (e, r) => (y(), S("a", {
|
|
234
238
|
href: t.href,
|
|
235
239
|
rel: "noreferrer noopener nofollow",
|
|
236
240
|
title: t.title
|
|
237
241
|
}, [
|
|
238
|
-
I(
|
|
239
|
-
], 8,
|
|
242
|
+
I(e.$slots, "default", {}, void 0, !0)
|
|
243
|
+
], 8, qe));
|
|
240
244
|
}
|
|
241
245
|
});
|
|
242
|
-
const
|
|
243
|
-
blockquote:
|
|
244
|
-
code:
|
|
245
|
-
code_block:
|
|
246
|
-
emphasis:
|
|
247
|
-
heading:
|
|
248
|
-
image:
|
|
249
|
-
line_break:
|
|
250
|
-
link:
|
|
251
|
-
list:
|
|
252
|
-
list_item:
|
|
253
|
-
paragraph:
|
|
254
|
-
table:
|
|
255
|
-
table_row:
|
|
256
|
-
table_cell:
|
|
257
|
-
text:
|
|
258
|
-
text_block:
|
|
246
|
+
const ze = /* @__PURE__ */ R(We, [["__scopeId", "data-v-9b27e235"]]), Qe = {
|
|
247
|
+
blockquote: me,
|
|
248
|
+
code: _e,
|
|
249
|
+
code_block: be,
|
|
250
|
+
emphasis: ve,
|
|
251
|
+
heading: He,
|
|
252
|
+
image: Ae,
|
|
253
|
+
line_break: Ne,
|
|
254
|
+
link: ze,
|
|
255
|
+
list: Xe,
|
|
256
|
+
list_item: Ye,
|
|
257
|
+
paragraph: Ve,
|
|
258
|
+
table: Le,
|
|
259
|
+
table_row: Oe,
|
|
260
|
+
table_cell: Ce,
|
|
261
|
+
text: Ue,
|
|
262
|
+
text_block: ke
|
|
259
263
|
}, _t = [];
|
|
260
|
-
function
|
|
264
|
+
function Je(t) {
|
|
261
265
|
_t.indexOf(t) === -1 && (_t.push(t), console.warn(`[DocumentViewer] Unable to render an unknown node type "${t}"`));
|
|
262
266
|
}
|
|
263
|
-
function Ot(t,
|
|
264
|
-
return t.map((
|
|
265
|
-
if (!
|
|
267
|
+
function Ot(t, e) {
|
|
268
|
+
return t.map((r) => {
|
|
269
|
+
if (!r)
|
|
266
270
|
return null;
|
|
267
271
|
const {
|
|
268
272
|
type: n,
|
|
269
273
|
children: o,
|
|
270
274
|
...i
|
|
271
|
-
} =
|
|
275
|
+
} = r, a = Qe[r.type];
|
|
272
276
|
if (!a)
|
|
273
|
-
return
|
|
274
|
-
if ((
|
|
275
|
-
const s =
|
|
277
|
+
return Je(n), null;
|
|
278
|
+
if ((r == null ? void 0 : r.type) === "paragraph" && (r != null && r.children)) {
|
|
279
|
+
const s = r.children, l = s.length - 1;
|
|
276
280
|
s.forEach((u, c) => {
|
|
277
281
|
var h;
|
|
278
|
-
|
|
282
|
+
he(u) && !((h = u.text) != null && h.endsWith(" ")) && c !== l && (u.appendSpace = !0);
|
|
279
283
|
});
|
|
280
284
|
}
|
|
281
|
-
return
|
|
282
|
-
parent:
|
|
285
|
+
return se(a, ce(i, {
|
|
286
|
+
parent: e
|
|
283
287
|
}), {
|
|
284
|
-
default: () => o && Ot(o,
|
|
288
|
+
default: () => o && Ot(o, r)
|
|
285
289
|
});
|
|
286
290
|
});
|
|
287
291
|
}
|
|
288
|
-
var it = function(t,
|
|
289
|
-
return it = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(
|
|
290
|
-
|
|
291
|
-
} || function(
|
|
292
|
+
var it = function(t, e) {
|
|
293
|
+
return it = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, n) {
|
|
294
|
+
r.__proto__ = n;
|
|
295
|
+
} || function(r, n) {
|
|
292
296
|
for (var o in n)
|
|
293
|
-
Object.prototype.hasOwnProperty.call(n, o) && (
|
|
294
|
-
}, it(t,
|
|
297
|
+
Object.prototype.hasOwnProperty.call(n, o) && (r[o] = n[o]);
|
|
298
|
+
}, it(t, e);
|
|
295
299
|
};
|
|
296
|
-
function L(t,
|
|
297
|
-
if (typeof
|
|
298
|
-
throw new TypeError("Class extends value " + String(
|
|
299
|
-
it(t,
|
|
300
|
-
function
|
|
300
|
+
function L(t, e) {
|
|
301
|
+
if (typeof e != "function" && e !== null)
|
|
302
|
+
throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
|
|
303
|
+
it(t, e);
|
|
304
|
+
function r() {
|
|
301
305
|
this.constructor = t;
|
|
302
306
|
}
|
|
303
|
-
t.prototype =
|
|
307
|
+
t.prototype = e === null ? Object.create(e) : (r.prototype = e.prototype, new r());
|
|
304
308
|
}
|
|
305
309
|
var p = function() {
|
|
306
310
|
return p = Object.assign || function(t) {
|
|
307
|
-
for (var
|
|
308
|
-
|
|
309
|
-
for (var o in
|
|
310
|
-
Object.prototype.hasOwnProperty.call(
|
|
311
|
+
for (var e, r = 1, n = arguments.length; r < n; r++) {
|
|
312
|
+
e = arguments[r];
|
|
313
|
+
for (var o in e)
|
|
314
|
+
Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
|
|
311
315
|
}
|
|
312
316
|
return t;
|
|
313
317
|
}, p.apply(this, arguments);
|
|
314
318
|
};
|
|
315
|
-
function
|
|
316
|
-
var
|
|
319
|
+
function tr(t, e) {
|
|
320
|
+
var r = {};
|
|
317
321
|
for (var n in t)
|
|
318
|
-
Object.prototype.hasOwnProperty.call(t, n) &&
|
|
322
|
+
Object.prototype.hasOwnProperty.call(t, n) && e.indexOf(n) < 0 && (r[n] = t[n]);
|
|
319
323
|
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
320
324
|
for (var o = 0, n = Object.getOwnPropertySymbols(t); o < n.length; o++)
|
|
321
|
-
|
|
322
|
-
return
|
|
325
|
+
e.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[o]) && (r[n[o]] = t[n[o]]);
|
|
326
|
+
return r;
|
|
323
327
|
}
|
|
324
|
-
function D(t,
|
|
325
|
-
if (
|
|
326
|
-
for (var n = 0, o =
|
|
327
|
-
(i || !(n in
|
|
328
|
-
return t.concat(i || Array.prototype.slice.call(
|
|
328
|
+
function D(t, e, r) {
|
|
329
|
+
if (r || arguments.length === 2)
|
|
330
|
+
for (var n = 0, o = e.length, i; n < o; n++)
|
|
331
|
+
(i || !(n in e)) && (i || (i = Array.prototype.slice.call(e, 0, n)), i[n] = e[n]);
|
|
332
|
+
return t.concat(i || Array.prototype.slice.call(e));
|
|
329
333
|
}
|
|
330
334
|
var g;
|
|
331
335
|
(function(t) {
|
|
@@ -342,7 +346,7 @@ var V;
|
|
|
342
346
|
function Et(t) {
|
|
343
347
|
return t.type === E.literal;
|
|
344
348
|
}
|
|
345
|
-
function
|
|
349
|
+
function er(t) {
|
|
346
350
|
return t.type === E.argument;
|
|
347
351
|
}
|
|
348
352
|
function Mt(t) {
|
|
@@ -360,7 +364,7 @@ function Dt(t) {
|
|
|
360
364
|
function Ut(t) {
|
|
361
365
|
return t.type === E.plural;
|
|
362
366
|
}
|
|
363
|
-
function
|
|
367
|
+
function rr(t) {
|
|
364
368
|
return t.type === E.pound;
|
|
365
369
|
}
|
|
366
370
|
function Ft(t) {
|
|
@@ -372,17 +376,17 @@ function Gt(t) {
|
|
|
372
376
|
function at(t) {
|
|
373
377
|
return !!(t && typeof t == "object" && t.type === V.dateTime);
|
|
374
378
|
}
|
|
375
|
-
var kt = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,
|
|
376
|
-
function
|
|
377
|
-
var
|
|
378
|
-
return t.replace(
|
|
379
|
-
var n =
|
|
380
|
-
switch (
|
|
379
|
+
var kt = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/, nr = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;
|
|
380
|
+
function or(t) {
|
|
381
|
+
var e = {};
|
|
382
|
+
return t.replace(nr, function(r) {
|
|
383
|
+
var n = r.length;
|
|
384
|
+
switch (r[0]) {
|
|
381
385
|
case "G":
|
|
382
|
-
|
|
386
|
+
e.era = n === 4 ? "long" : n === 5 ? "narrow" : "short";
|
|
383
387
|
break;
|
|
384
388
|
case "y":
|
|
385
|
-
|
|
389
|
+
e.year = n === 2 ? "2-digit" : "numeric";
|
|
386
390
|
break;
|
|
387
391
|
case "Y":
|
|
388
392
|
case "u":
|
|
@@ -394,64 +398,64 @@ function oe(t) {
|
|
|
394
398
|
throw new RangeError("`q/Q` (quarter) patterns are not supported");
|
|
395
399
|
case "M":
|
|
396
400
|
case "L":
|
|
397
|
-
|
|
401
|
+
e.month = ["numeric", "2-digit", "short", "long", "narrow"][n - 1];
|
|
398
402
|
break;
|
|
399
403
|
case "w":
|
|
400
404
|
case "W":
|
|
401
405
|
throw new RangeError("`w/W` (week) patterns are not supported");
|
|
402
406
|
case "d":
|
|
403
|
-
|
|
407
|
+
e.day = ["numeric", "2-digit"][n - 1];
|
|
404
408
|
break;
|
|
405
409
|
case "D":
|
|
406
410
|
case "F":
|
|
407
411
|
case "g":
|
|
408
412
|
throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");
|
|
409
413
|
case "E":
|
|
410
|
-
|
|
414
|
+
e.weekday = n === 4 ? "short" : n === 5 ? "narrow" : "short";
|
|
411
415
|
break;
|
|
412
416
|
case "e":
|
|
413
417
|
if (n < 4)
|
|
414
418
|
throw new RangeError("`e..eee` (weekday) patterns are not supported");
|
|
415
|
-
|
|
419
|
+
e.weekday = ["short", "long", "narrow", "short"][n - 4];
|
|
416
420
|
break;
|
|
417
421
|
case "c":
|
|
418
422
|
if (n < 4)
|
|
419
423
|
throw new RangeError("`c..ccc` (weekday) patterns are not supported");
|
|
420
|
-
|
|
424
|
+
e.weekday = ["short", "long", "narrow", "short"][n - 4];
|
|
421
425
|
break;
|
|
422
426
|
case "a":
|
|
423
|
-
|
|
427
|
+
e.hour12 = !0;
|
|
424
428
|
break;
|
|
425
429
|
case "b":
|
|
426
430
|
case "B":
|
|
427
431
|
throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");
|
|
428
432
|
case "h":
|
|
429
|
-
|
|
433
|
+
e.hourCycle = "h12", e.hour = ["numeric", "2-digit"][n - 1];
|
|
430
434
|
break;
|
|
431
435
|
case "H":
|
|
432
|
-
|
|
436
|
+
e.hourCycle = "h23", e.hour = ["numeric", "2-digit"][n - 1];
|
|
433
437
|
break;
|
|
434
438
|
case "K":
|
|
435
|
-
|
|
439
|
+
e.hourCycle = "h11", e.hour = ["numeric", "2-digit"][n - 1];
|
|
436
440
|
break;
|
|
437
441
|
case "k":
|
|
438
|
-
|
|
442
|
+
e.hourCycle = "h24", e.hour = ["numeric", "2-digit"][n - 1];
|
|
439
443
|
break;
|
|
440
444
|
case "j":
|
|
441
445
|
case "J":
|
|
442
446
|
case "C":
|
|
443
447
|
throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");
|
|
444
448
|
case "m":
|
|
445
|
-
|
|
449
|
+
e.minute = ["numeric", "2-digit"][n - 1];
|
|
446
450
|
break;
|
|
447
451
|
case "s":
|
|
448
|
-
|
|
452
|
+
e.second = ["numeric", "2-digit"][n - 1];
|
|
449
453
|
break;
|
|
450
454
|
case "S":
|
|
451
455
|
case "A":
|
|
452
456
|
throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");
|
|
453
457
|
case "z":
|
|
454
|
-
|
|
458
|
+
e.timeZoneName = n < 4 ? "short" : "long";
|
|
455
459
|
break;
|
|
456
460
|
case "Z":
|
|
457
461
|
case "O":
|
|
@@ -462,15 +466,15 @@ function oe(t) {
|
|
|
462
466
|
throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead");
|
|
463
467
|
}
|
|
464
468
|
return "";
|
|
465
|
-
}),
|
|
469
|
+
}), e;
|
|
466
470
|
}
|
|
467
|
-
var
|
|
468
|
-
function
|
|
471
|
+
var ir = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i;
|
|
472
|
+
function ar(t) {
|
|
469
473
|
if (t.length === 0)
|
|
470
474
|
throw new Error("Number skeleton cannot be empty");
|
|
471
|
-
for (var
|
|
475
|
+
for (var e = t.split(ir).filter(function(f) {
|
|
472
476
|
return f.length > 0;
|
|
473
|
-
}),
|
|
477
|
+
}), r = [], n = 0, o = e; n < o.length; n++) {
|
|
474
478
|
var i = o[n], a = i.split("/");
|
|
475
479
|
if (a.length === 0)
|
|
476
480
|
throw new Error("Invalid number skeleton");
|
|
@@ -479,19 +483,19 @@ function ae(t) {
|
|
|
479
483
|
if (h.length === 0)
|
|
480
484
|
throw new Error("Invalid number skeleton");
|
|
481
485
|
}
|
|
482
|
-
|
|
486
|
+
r.push({ stem: s, options: l });
|
|
483
487
|
}
|
|
484
|
-
return
|
|
488
|
+
return r;
|
|
485
489
|
}
|
|
486
|
-
function
|
|
490
|
+
function sr(t) {
|
|
487
491
|
return t.replace(/^(.*?)-/, "");
|
|
488
492
|
}
|
|
489
|
-
var yt = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g, jt = /^(@+)?(\+|#+)?[rs]?$/g,
|
|
493
|
+
var yt = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g, jt = /^(@+)?(\+|#+)?[rs]?$/g, cr = /(\*)(0+)|(#+)(0+)|(0+)/g, xt = /^(0+)$/;
|
|
490
494
|
function bt(t) {
|
|
491
|
-
var
|
|
492
|
-
return t[t.length - 1] === "r" ?
|
|
493
|
-
return typeof o != "string" ? (
|
|
494
|
-
}),
|
|
495
|
+
var e = {};
|
|
496
|
+
return t[t.length - 1] === "r" ? e.roundingPriority = "morePrecision" : t[t.length - 1] === "s" && (e.roundingPriority = "lessPrecision"), t.replace(jt, function(r, n, o) {
|
|
497
|
+
return typeof o != "string" ? (e.minimumSignificantDigits = n.length, e.maximumSignificantDigits = n.length) : o === "+" ? e.minimumSignificantDigits = n.length : n[0] === "#" ? e.maximumSignificantDigits = n.length : (e.minimumSignificantDigits = n.length, e.maximumSignificantDigits = n.length + (typeof o == "string" ? o.length : 0)), "";
|
|
498
|
+
}), e;
|
|
495
499
|
}
|
|
496
500
|
function Vt(t) {
|
|
497
501
|
switch (t) {
|
|
@@ -533,92 +537,92 @@ function Vt(t) {
|
|
|
533
537
|
};
|
|
534
538
|
}
|
|
535
539
|
}
|
|
536
|
-
function
|
|
537
|
-
var
|
|
538
|
-
if (t[0] === "E" && t[1] === "E" ? (
|
|
540
|
+
function ur(t) {
|
|
541
|
+
var e;
|
|
542
|
+
if (t[0] === "E" && t[1] === "E" ? (e = {
|
|
539
543
|
notation: "engineering"
|
|
540
|
-
}, t = t.slice(2)) : t[0] === "E" && (
|
|
544
|
+
}, t = t.slice(2)) : t[0] === "E" && (e = {
|
|
541
545
|
notation: "scientific"
|
|
542
|
-
}, t = t.slice(1)),
|
|
543
|
-
var
|
|
544
|
-
if (
|
|
546
|
+
}, t = t.slice(1)), e) {
|
|
547
|
+
var r = t.slice(0, 2);
|
|
548
|
+
if (r === "+!" ? (e.signDisplay = "always", t = t.slice(2)) : r === "+?" && (e.signDisplay = "exceptZero", t = t.slice(2)), !xt.test(t))
|
|
545
549
|
throw new Error("Malformed concise eng/scientific notation");
|
|
546
|
-
|
|
550
|
+
e.minimumIntegerDigits = t.length;
|
|
547
551
|
}
|
|
548
|
-
return
|
|
552
|
+
return e;
|
|
549
553
|
}
|
|
550
554
|
function vt(t) {
|
|
551
|
-
var
|
|
552
|
-
return
|
|
555
|
+
var e = {}, r = Vt(t);
|
|
556
|
+
return r || e;
|
|
553
557
|
}
|
|
554
|
-
function
|
|
555
|
-
for (var
|
|
556
|
-
var o = n[
|
|
558
|
+
function lr(t) {
|
|
559
|
+
for (var e = {}, r = 0, n = t; r < n.length; r++) {
|
|
560
|
+
var o = n[r];
|
|
557
561
|
switch (o.stem) {
|
|
558
562
|
case "percent":
|
|
559
563
|
case "%":
|
|
560
|
-
|
|
564
|
+
e.style = "percent";
|
|
561
565
|
continue;
|
|
562
566
|
case "%x100":
|
|
563
|
-
|
|
567
|
+
e.style = "percent", e.scale = 100;
|
|
564
568
|
continue;
|
|
565
569
|
case "currency":
|
|
566
|
-
|
|
570
|
+
e.style = "currency", e.currency = o.options[0];
|
|
567
571
|
continue;
|
|
568
572
|
case "group-off":
|
|
569
573
|
case ",_":
|
|
570
|
-
|
|
574
|
+
e.useGrouping = !1;
|
|
571
575
|
continue;
|
|
572
576
|
case "precision-integer":
|
|
573
577
|
case ".":
|
|
574
|
-
|
|
578
|
+
e.maximumFractionDigits = 0;
|
|
575
579
|
continue;
|
|
576
580
|
case "measure-unit":
|
|
577
581
|
case "unit":
|
|
578
|
-
|
|
582
|
+
e.style = "unit", e.unit = sr(o.options[0]);
|
|
579
583
|
continue;
|
|
580
584
|
case "compact-short":
|
|
581
585
|
case "K":
|
|
582
|
-
|
|
586
|
+
e.notation = "compact", e.compactDisplay = "short";
|
|
583
587
|
continue;
|
|
584
588
|
case "compact-long":
|
|
585
589
|
case "KK":
|
|
586
|
-
|
|
590
|
+
e.notation = "compact", e.compactDisplay = "long";
|
|
587
591
|
continue;
|
|
588
592
|
case "scientific":
|
|
589
|
-
|
|
593
|
+
e = p(p(p({}, e), { notation: "scientific" }), o.options.reduce(function(l, u) {
|
|
590
594
|
return p(p({}, l), vt(u));
|
|
591
595
|
}, {}));
|
|
592
596
|
continue;
|
|
593
597
|
case "engineering":
|
|
594
|
-
|
|
598
|
+
e = p(p(p({}, e), { notation: "engineering" }), o.options.reduce(function(l, u) {
|
|
595
599
|
return p(p({}, l), vt(u));
|
|
596
600
|
}, {}));
|
|
597
601
|
continue;
|
|
598
602
|
case "notation-simple":
|
|
599
|
-
|
|
603
|
+
e.notation = "standard";
|
|
600
604
|
continue;
|
|
601
605
|
case "unit-width-narrow":
|
|
602
|
-
|
|
606
|
+
e.currencyDisplay = "narrowSymbol", e.unitDisplay = "narrow";
|
|
603
607
|
continue;
|
|
604
608
|
case "unit-width-short":
|
|
605
|
-
|
|
609
|
+
e.currencyDisplay = "code", e.unitDisplay = "short";
|
|
606
610
|
continue;
|
|
607
611
|
case "unit-width-full-name":
|
|
608
|
-
|
|
612
|
+
e.currencyDisplay = "name", e.unitDisplay = "long";
|
|
609
613
|
continue;
|
|
610
614
|
case "unit-width-iso-code":
|
|
611
|
-
|
|
615
|
+
e.currencyDisplay = "symbol";
|
|
612
616
|
continue;
|
|
613
617
|
case "scale":
|
|
614
|
-
|
|
618
|
+
e.scale = parseFloat(o.options[0]);
|
|
615
619
|
continue;
|
|
616
620
|
case "integer-width":
|
|
617
621
|
if (o.options.length > 1)
|
|
618
622
|
throw new RangeError("integer-width stems only accept a single optional option");
|
|
619
|
-
o.options[0].replace(
|
|
623
|
+
o.options[0].replace(cr, function(l, u, c, h, f, m) {
|
|
620
624
|
if (u)
|
|
621
|
-
|
|
625
|
+
e.minimumIntegerDigits = c.length;
|
|
622
626
|
else {
|
|
623
627
|
if (h && f)
|
|
624
628
|
throw new Error("We currently do not support maximum integer digits");
|
|
@@ -630,29 +634,29 @@ function le(t) {
|
|
|
630
634
|
continue;
|
|
631
635
|
}
|
|
632
636
|
if (xt.test(o.stem)) {
|
|
633
|
-
|
|
637
|
+
e.minimumIntegerDigits = o.stem.length;
|
|
634
638
|
continue;
|
|
635
639
|
}
|
|
636
640
|
if (yt.test(o.stem)) {
|
|
637
641
|
if (o.options.length > 1)
|
|
638
642
|
throw new RangeError("Fraction-precision stems only accept a single optional option");
|
|
639
643
|
o.stem.replace(yt, function(l, u, c, h, f, m) {
|
|
640
|
-
return c === "*" ?
|
|
644
|
+
return c === "*" ? e.minimumFractionDigits = u.length : h && h[0] === "#" ? e.maximumFractionDigits = h.length : f && m ? (e.minimumFractionDigits = f.length, e.maximumFractionDigits = f.length + m.length) : (e.minimumFractionDigits = u.length, e.maximumFractionDigits = u.length), "";
|
|
641
645
|
});
|
|
642
646
|
var i = o.options[0];
|
|
643
|
-
i === "w" ?
|
|
647
|
+
i === "w" ? e = p(p({}, e), { trailingZeroDisplay: "stripIfInteger" }) : i && (e = p(p({}, e), bt(i)));
|
|
644
648
|
continue;
|
|
645
649
|
}
|
|
646
650
|
if (jt.test(o.stem)) {
|
|
647
|
-
|
|
651
|
+
e = p(p({}, e), bt(o.stem));
|
|
648
652
|
continue;
|
|
649
653
|
}
|
|
650
654
|
var a = Vt(o.stem);
|
|
651
|
-
a && (
|
|
652
|
-
var s =
|
|
653
|
-
s && (
|
|
655
|
+
a && (e = p(p({}, e), a));
|
|
656
|
+
var s = ur(o.stem);
|
|
657
|
+
s && (e = p(p({}, e), s));
|
|
654
658
|
}
|
|
655
|
-
return
|
|
659
|
+
return e;
|
|
656
660
|
}
|
|
657
661
|
var W = {
|
|
658
662
|
AX: [
|
|
@@ -1991,28 +1995,28 @@ var W = {
|
|
|
1991
1995
|
"h"
|
|
1992
1996
|
]
|
|
1993
1997
|
};
|
|
1994
|
-
function
|
|
1995
|
-
for (var
|
|
1998
|
+
function hr(t, e) {
|
|
1999
|
+
for (var r = "", n = 0; n < t.length; n++) {
|
|
1996
2000
|
var o = t.charAt(n);
|
|
1997
2001
|
if (o === "j") {
|
|
1998
2002
|
for (var i = 0; n + 1 < t.length && t.charAt(n + 1) === o; )
|
|
1999
2003
|
i++, n++;
|
|
2000
|
-
var a = 1 + (i & 1), s = i < 2 ? 1 : 3 + (i >> 1), l = "a", u =
|
|
2004
|
+
var a = 1 + (i & 1), s = i < 2 ? 1 : 3 + (i >> 1), l = "a", u = fr(e);
|
|
2001
2005
|
for ((u == "H" || u == "k") && (s = 0); s-- > 0; )
|
|
2002
|
-
|
|
2006
|
+
r += l;
|
|
2003
2007
|
for (; a-- > 0; )
|
|
2004
|
-
|
|
2008
|
+
r = u + r;
|
|
2005
2009
|
} else
|
|
2006
|
-
o === "J" ?
|
|
2010
|
+
o === "J" ? r += "H" : r += o;
|
|
2007
2011
|
}
|
|
2008
|
-
return
|
|
2012
|
+
return r;
|
|
2009
2013
|
}
|
|
2010
|
-
function
|
|
2011
|
-
var
|
|
2012
|
-
if (
|
|
2014
|
+
function fr(t) {
|
|
2015
|
+
var e = t.hourCycle;
|
|
2016
|
+
if (e === void 0 && // @ts-ignore hourCycle(s) is not identified yet
|
|
2013
2017
|
t.hourCycles && // @ts-ignore
|
|
2014
|
-
t.hourCycles.length && (
|
|
2015
|
-
switch (
|
|
2018
|
+
t.hourCycles.length && (e = t.hourCycles[0]), e)
|
|
2019
|
+
switch (e) {
|
|
2016
2020
|
case "h24":
|
|
2017
2021
|
return "k";
|
|
2018
2022
|
case "h23":
|
|
@@ -2024,73 +2028,73 @@ function fe(t) {
|
|
|
2024
2028
|
default:
|
|
2025
2029
|
throw new Error("Invalid hourCycle");
|
|
2026
2030
|
}
|
|
2027
|
-
var
|
|
2028
|
-
|
|
2029
|
-
var o = W[n || ""] || W[
|
|
2031
|
+
var r = t.language, n;
|
|
2032
|
+
r !== "root" && (n = t.maximize().region);
|
|
2033
|
+
var o = W[n || ""] || W[r || ""] || W["".concat(r, "-001")] || W["001"];
|
|
2030
2034
|
return o[0];
|
|
2031
2035
|
}
|
|
2032
|
-
var
|
|
2033
|
-
function d(t,
|
|
2034
|
-
return { start: t, end:
|
|
2036
|
+
var et, pr = new RegExp("^".concat(kt.source, "*")), mr = new RegExp("".concat(kt.source, "*$"));
|
|
2037
|
+
function d(t, e) {
|
|
2038
|
+
return { start: t, end: e };
|
|
2035
2039
|
}
|
|
2036
|
-
var
|
|
2040
|
+
var gr = !!String.prototype.startsWith, dr = !!String.fromCodePoint, _r = !!Object.fromEntries, Er = !!String.prototype.codePointAt, yr = !!String.prototype.trimStart, br = !!String.prototype.trimEnd, vr = !!Number.isSafeInteger, Tr = vr ? Number.isSafeInteger : function(t) {
|
|
2037
2041
|
return typeof t == "number" && isFinite(t) && Math.floor(t) === t && Math.abs(t) <= 9007199254740991;
|
|
2038
2042
|
}, st = !0;
|
|
2039
2043
|
try {
|
|
2040
|
-
var
|
|
2041
|
-
st = ((
|
|
2044
|
+
var Hr = Xt("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu");
|
|
2045
|
+
st = ((et = Hr.exec("a")) === null || et === void 0 ? void 0 : et[0]) === "a";
|
|
2042
2046
|
} catch {
|
|
2043
2047
|
st = !1;
|
|
2044
2048
|
}
|
|
2045
|
-
var Tt =
|
|
2049
|
+
var Tt = gr ? (
|
|
2046
2050
|
// Native
|
|
2047
|
-
function(t,
|
|
2048
|
-
return t.startsWith(
|
|
2051
|
+
function(t, e, r) {
|
|
2052
|
+
return t.startsWith(e, r);
|
|
2049
2053
|
}
|
|
2050
2054
|
) : (
|
|
2051
2055
|
// For IE11
|
|
2052
|
-
function(t,
|
|
2053
|
-
return t.slice(
|
|
2056
|
+
function(t, e, r) {
|
|
2057
|
+
return t.slice(r, r + e.length) === e;
|
|
2054
2058
|
}
|
|
2055
|
-
), ct =
|
|
2059
|
+
), ct = dr ? String.fromCodePoint : (
|
|
2056
2060
|
// IE11
|
|
2057
2061
|
function() {
|
|
2058
|
-
for (var t = [],
|
|
2059
|
-
t[
|
|
2060
|
-
for (var
|
|
2062
|
+
for (var t = [], e = 0; e < arguments.length; e++)
|
|
2063
|
+
t[e] = arguments[e];
|
|
2064
|
+
for (var r = "", n = t.length, o = 0, i; n > o; ) {
|
|
2061
2065
|
if (i = t[o++], i > 1114111)
|
|
2062
2066
|
throw RangeError(i + " is not a valid code point");
|
|
2063
|
-
|
|
2067
|
+
r += i < 65536 ? String.fromCharCode(i) : String.fromCharCode(((i -= 65536) >> 10) + 55296, i % 1024 + 56320);
|
|
2064
2068
|
}
|
|
2065
|
-
return
|
|
2069
|
+
return r;
|
|
2066
2070
|
}
|
|
2067
2071
|
), Ht = (
|
|
2068
2072
|
// native
|
|
2069
|
-
|
|
2073
|
+
_r ? Object.fromEntries : (
|
|
2070
2074
|
// Ponyfill
|
|
2071
2075
|
function(t) {
|
|
2072
|
-
for (var
|
|
2073
|
-
var o = n[
|
|
2074
|
-
|
|
2076
|
+
for (var e = {}, r = 0, n = t; r < n.length; r++) {
|
|
2077
|
+
var o = n[r], i = o[0], a = o[1];
|
|
2078
|
+
e[i] = a;
|
|
2075
2079
|
}
|
|
2076
|
-
return
|
|
2080
|
+
return e;
|
|
2077
2081
|
}
|
|
2078
2082
|
)
|
|
2079
|
-
), $t =
|
|
2083
|
+
), $t = Er ? (
|
|
2080
2084
|
// Native
|
|
2081
|
-
function(t,
|
|
2082
|
-
return t.codePointAt(
|
|
2085
|
+
function(t, e) {
|
|
2086
|
+
return t.codePointAt(e);
|
|
2083
2087
|
}
|
|
2084
2088
|
) : (
|
|
2085
2089
|
// IE 11
|
|
2086
|
-
function(t,
|
|
2087
|
-
var
|
|
2088
|
-
if (!(
|
|
2089
|
-
var n = t.charCodeAt(
|
|
2090
|
-
return n < 55296 || n > 56319 ||
|
|
2090
|
+
function(t, e) {
|
|
2091
|
+
var r = t.length;
|
|
2092
|
+
if (!(e < 0 || e >= r)) {
|
|
2093
|
+
var n = t.charCodeAt(e), o;
|
|
2094
|
+
return n < 55296 || n > 56319 || e + 1 === r || (o = t.charCodeAt(e + 1)) < 56320 || o > 57343 ? n : (n - 55296 << 10) + (o - 56320) + 65536;
|
|
2091
2095
|
}
|
|
2092
2096
|
}
|
|
2093
|
-
),
|
|
2097
|
+
), Br = yr ? (
|
|
2094
2098
|
// Native
|
|
2095
2099
|
function(t) {
|
|
2096
2100
|
return t.trimStart();
|
|
@@ -2098,9 +2102,9 @@ var Tt = ge ? (
|
|
|
2098
2102
|
) : (
|
|
2099
2103
|
// Ponyfill
|
|
2100
2104
|
function(t) {
|
|
2101
|
-
return t.replace(
|
|
2105
|
+
return t.replace(pr, "");
|
|
2102
2106
|
}
|
|
2103
|
-
),
|
|
2107
|
+
), Ar = br ? (
|
|
2104
2108
|
// Native
|
|
2105
2109
|
function(t) {
|
|
2106
2110
|
return t.trimEnd();
|
|
@@ -2108,53 +2112,53 @@ var Tt = ge ? (
|
|
|
2108
2112
|
) : (
|
|
2109
2113
|
// Ponyfill
|
|
2110
2114
|
function(t) {
|
|
2111
|
-
return t.replace(
|
|
2115
|
+
return t.replace(mr, "");
|
|
2112
2116
|
}
|
|
2113
2117
|
);
|
|
2114
|
-
function Xt(t,
|
|
2115
|
-
return new RegExp(t,
|
|
2118
|
+
function Xt(t, e) {
|
|
2119
|
+
return new RegExp(t, e);
|
|
2116
2120
|
}
|
|
2117
2121
|
var ut;
|
|
2118
2122
|
if (st) {
|
|
2119
2123
|
var Bt = Xt("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu");
|
|
2120
|
-
ut = function(t,
|
|
2121
|
-
var
|
|
2122
|
-
Bt.lastIndex =
|
|
2124
|
+
ut = function(t, e) {
|
|
2125
|
+
var r;
|
|
2126
|
+
Bt.lastIndex = e;
|
|
2123
2127
|
var n = Bt.exec(t);
|
|
2124
|
-
return (
|
|
2128
|
+
return (r = n[1]) !== null && r !== void 0 ? r : "";
|
|
2125
2129
|
};
|
|
2126
2130
|
} else
|
|
2127
|
-
ut = function(t,
|
|
2128
|
-
for (var
|
|
2129
|
-
var n = $t(t,
|
|
2130
|
-
if (n === void 0 || Kt(n) ||
|
|
2131
|
+
ut = function(t, e) {
|
|
2132
|
+
for (var r = []; ; ) {
|
|
2133
|
+
var n = $t(t, e);
|
|
2134
|
+
if (n === void 0 || Kt(n) || Rr(n))
|
|
2131
2135
|
break;
|
|
2132
|
-
|
|
2136
|
+
r.push(n), e += n >= 65536 ? 2 : 1;
|
|
2133
2137
|
}
|
|
2134
|
-
return ct.apply(void 0,
|
|
2138
|
+
return ct.apply(void 0, r);
|
|
2135
2139
|
};
|
|
2136
|
-
var
|
|
2140
|
+
var Sr = (
|
|
2137
2141
|
/** @class */
|
|
2138
2142
|
function() {
|
|
2139
|
-
function t(
|
|
2140
|
-
|
|
2143
|
+
function t(e, r) {
|
|
2144
|
+
r === void 0 && (r = {}), this.message = e, this.position = { offset: 0, line: 1, column: 1 }, this.ignoreTag = !!r.ignoreTag, this.locale = r.locale, this.requiresOtherClause = !!r.requiresOtherClause, this.shouldParseSkeletons = !!r.shouldParseSkeletons;
|
|
2141
2145
|
}
|
|
2142
2146
|
return t.prototype.parse = function() {
|
|
2143
2147
|
if (this.offset() !== 0)
|
|
2144
2148
|
throw Error("parser can only be used once");
|
|
2145
2149
|
return this.parseMessage(0, "", !1);
|
|
2146
|
-
}, t.prototype.parseMessage = function(
|
|
2150
|
+
}, t.prototype.parseMessage = function(e, r, n) {
|
|
2147
2151
|
for (var o = []; !this.isEOF(); ) {
|
|
2148
2152
|
var i = this.char();
|
|
2149
2153
|
if (i === 123) {
|
|
2150
|
-
var a = this.parseArgument(
|
|
2154
|
+
var a = this.parseArgument(e, n);
|
|
2151
2155
|
if (a.err)
|
|
2152
2156
|
return a;
|
|
2153
2157
|
o.push(a.val);
|
|
2154
2158
|
} else {
|
|
2155
|
-
if (i === 125 &&
|
|
2159
|
+
if (i === 125 && e > 0)
|
|
2156
2160
|
break;
|
|
2157
|
-
if (i === 35 && (
|
|
2161
|
+
if (i === 35 && (r === "plural" || r === "selectordinal")) {
|
|
2158
2162
|
var s = this.clonePosition();
|
|
2159
2163
|
this.bump(), o.push({
|
|
2160
2164
|
type: E.pound,
|
|
@@ -2165,12 +2169,12 @@ var Se = (
|
|
|
2165
2169
|
break;
|
|
2166
2170
|
return this.error(g.UNMATCHED_CLOSING_TAG, d(this.clonePosition(), this.clonePosition()));
|
|
2167
2171
|
} else if (i === 60 && !this.ignoreTag && lt(this.peek() || 0)) {
|
|
2168
|
-
var a = this.parseTag(
|
|
2172
|
+
var a = this.parseTag(e, r);
|
|
2169
2173
|
if (a.err)
|
|
2170
2174
|
return a;
|
|
2171
2175
|
o.push(a.val);
|
|
2172
2176
|
} else {
|
|
2173
|
-
var a = this.parseLiteral(
|
|
2177
|
+
var a = this.parseLiteral(e, r);
|
|
2174
2178
|
if (a.err)
|
|
2175
2179
|
return a;
|
|
2176
2180
|
o.push(a.val);
|
|
@@ -2178,7 +2182,7 @@ var Se = (
|
|
|
2178
2182
|
}
|
|
2179
2183
|
}
|
|
2180
2184
|
return { val: o, err: null };
|
|
2181
|
-
}, t.prototype.parseTag = function(
|
|
2185
|
+
}, t.prototype.parseTag = function(e, r) {
|
|
2182
2186
|
var n = this.clonePosition();
|
|
2183
2187
|
this.bump();
|
|
2184
2188
|
var o = this.parseTagName();
|
|
@@ -2192,7 +2196,7 @@ var Se = (
|
|
|
2192
2196
|
err: null
|
|
2193
2197
|
};
|
|
2194
2198
|
if (this.bumpIf(">")) {
|
|
2195
|
-
var i = this.parseMessage(
|
|
2199
|
+
var i = this.parseMessage(e + 1, r, !0);
|
|
2196
2200
|
if (i.err)
|
|
2197
2201
|
return i;
|
|
2198
2202
|
var a = i.val, s = this.clonePosition();
|
|
@@ -2214,18 +2218,18 @@ var Se = (
|
|
|
2214
2218
|
} else
|
|
2215
2219
|
return this.error(g.INVALID_TAG, d(n, this.clonePosition()));
|
|
2216
2220
|
}, t.prototype.parseTagName = function() {
|
|
2217
|
-
var
|
|
2218
|
-
for (this.bump(); !this.isEOF() &&
|
|
2221
|
+
var e = this.offset();
|
|
2222
|
+
for (this.bump(); !this.isEOF() && Nr(this.char()); )
|
|
2219
2223
|
this.bump();
|
|
2220
|
-
return this.message.slice(
|
|
2221
|
-
}, t.prototype.parseLiteral = function(
|
|
2224
|
+
return this.message.slice(e, this.offset());
|
|
2225
|
+
}, t.prototype.parseLiteral = function(e, r) {
|
|
2222
2226
|
for (var n = this.clonePosition(), o = ""; ; ) {
|
|
2223
|
-
var i = this.tryParseQuote(
|
|
2227
|
+
var i = this.tryParseQuote(r);
|
|
2224
2228
|
if (i) {
|
|
2225
2229
|
o += i;
|
|
2226
2230
|
continue;
|
|
2227
2231
|
}
|
|
2228
|
-
var a = this.tryParseUnquoted(
|
|
2232
|
+
var a = this.tryParseUnquoted(e, r);
|
|
2229
2233
|
if (a) {
|
|
2230
2234
|
o += a;
|
|
2231
2235
|
continue;
|
|
@@ -2244,8 +2248,8 @@ var Se = (
|
|
|
2244
2248
|
};
|
|
2245
2249
|
}, t.prototype.tryParseLeftAngleBracket = function() {
|
|
2246
2250
|
return !this.isEOF() && this.char() === 60 && (this.ignoreTag || // If at the opening tag or closing tag position, bail.
|
|
2247
|
-
!
|
|
2248
|
-
}, t.prototype.tryParseQuote = function(
|
|
2251
|
+
!Ir(this.peek() || 0)) ? (this.bump(), "<") : null;
|
|
2252
|
+
}, t.prototype.tryParseQuote = function(e) {
|
|
2249
2253
|
if (this.isEOF() || this.char() !== 39)
|
|
2250
2254
|
return null;
|
|
2251
2255
|
switch (this.peek()) {
|
|
@@ -2257,34 +2261,34 @@ var Se = (
|
|
|
2257
2261
|
case 125:
|
|
2258
2262
|
break;
|
|
2259
2263
|
case 35:
|
|
2260
|
-
if (
|
|
2264
|
+
if (e === "plural" || e === "selectordinal")
|
|
2261
2265
|
break;
|
|
2262
2266
|
return null;
|
|
2263
2267
|
default:
|
|
2264
2268
|
return null;
|
|
2265
2269
|
}
|
|
2266
2270
|
this.bump();
|
|
2267
|
-
var
|
|
2271
|
+
var r = [this.char()];
|
|
2268
2272
|
for (this.bump(); !this.isEOF(); ) {
|
|
2269
2273
|
var n = this.char();
|
|
2270
2274
|
if (n === 39)
|
|
2271
2275
|
if (this.peek() === 39)
|
|
2272
|
-
|
|
2276
|
+
r.push(39), this.bump();
|
|
2273
2277
|
else {
|
|
2274
2278
|
this.bump();
|
|
2275
2279
|
break;
|
|
2276
2280
|
}
|
|
2277
2281
|
else
|
|
2278
|
-
|
|
2282
|
+
r.push(n);
|
|
2279
2283
|
this.bump();
|
|
2280
2284
|
}
|
|
2281
|
-
return ct.apply(void 0,
|
|
2282
|
-
}, t.prototype.tryParseUnquoted = function(
|
|
2285
|
+
return ct.apply(void 0, r);
|
|
2286
|
+
}, t.prototype.tryParseUnquoted = function(e, r) {
|
|
2283
2287
|
if (this.isEOF())
|
|
2284
2288
|
return null;
|
|
2285
2289
|
var n = this.char();
|
|
2286
|
-
return n === 60 || n === 123 || n === 35 && (
|
|
2287
|
-
}, t.prototype.parseArgument = function(
|
|
2290
|
+
return n === 60 || n === 123 || n === 35 && (r === "plural" || r === "selectordinal") || n === 125 && e > 0 ? null : (this.bump(), ct(n));
|
|
2291
|
+
}, t.prototype.parseArgument = function(e, r) {
|
|
2288
2292
|
var n = this.clonePosition();
|
|
2289
2293
|
if (this.bump(), this.bumpSpace(), this.isEOF())
|
|
2290
2294
|
return this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE, d(n, this.clonePosition()));
|
|
@@ -2307,16 +2311,16 @@ var Se = (
|
|
|
2307
2311
|
err: null
|
|
2308
2312
|
};
|
|
2309
2313
|
case 44:
|
|
2310
|
-
return this.bump(), this.bumpSpace(), this.isEOF() ? this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE, d(n, this.clonePosition())) : this.parseArgumentOptions(
|
|
2314
|
+
return this.bump(), this.bumpSpace(), this.isEOF() ? this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE, d(n, this.clonePosition())) : this.parseArgumentOptions(e, r, o, n);
|
|
2311
2315
|
default:
|
|
2312
2316
|
return this.error(g.MALFORMED_ARGUMENT, d(n, this.clonePosition()));
|
|
2313
2317
|
}
|
|
2314
2318
|
}, t.prototype.parseIdentifierIfPossible = function() {
|
|
2315
|
-
var
|
|
2319
|
+
var e = this.clonePosition(), r = this.offset(), n = ut(this.message, r), o = r + n.length;
|
|
2316
2320
|
this.bumpTo(o);
|
|
2317
|
-
var i = this.clonePosition(), a = d(
|
|
2321
|
+
var i = this.clonePosition(), a = d(e, i);
|
|
2318
2322
|
return { value: n, location: a };
|
|
2319
|
-
}, t.prototype.parseArgumentOptions = function(
|
|
2323
|
+
}, t.prototype.parseArgumentOptions = function(e, r, n, o) {
|
|
2320
2324
|
var i, a = this.clonePosition(), s = this.parseIdentifierIfPossible().value, l = this.clonePosition();
|
|
2321
2325
|
switch (s) {
|
|
2322
2326
|
case "":
|
|
@@ -2331,7 +2335,7 @@ var Se = (
|
|
|
2331
2335
|
var c = this.clonePosition(), h = this.parseSimpleArgStyleIfPossible();
|
|
2332
2336
|
if (h.err)
|
|
2333
2337
|
return h;
|
|
2334
|
-
var f =
|
|
2338
|
+
var f = Ar(h.val);
|
|
2335
2339
|
if (f.length === 0)
|
|
2336
2340
|
return this.error(g.EXPECT_ARGUMENT_STYLE, d(this.clonePosition(), this.clonePosition()));
|
|
2337
2341
|
var m = d(c, this.clonePosition());
|
|
@@ -2342,7 +2346,7 @@ var Se = (
|
|
|
2342
2346
|
return b;
|
|
2343
2347
|
var _ = d(o, this.clonePosition());
|
|
2344
2348
|
if (u && Tt(u == null ? void 0 : u.style, "::", 0)) {
|
|
2345
|
-
var v =
|
|
2349
|
+
var v = Br(u.style.slice(2));
|
|
2346
2350
|
if (s === "number") {
|
|
2347
2351
|
var h = this.parseNumberSkeletonFromString(v, u.styleLocation);
|
|
2348
2352
|
return h.err ? h : {
|
|
@@ -2353,12 +2357,12 @@ var Se = (
|
|
|
2353
2357
|
if (v.length === 0)
|
|
2354
2358
|
return this.error(g.EXPECT_DATE_TIME_SKELETON, _);
|
|
2355
2359
|
var T = v;
|
|
2356
|
-
this.locale && (T =
|
|
2360
|
+
this.locale && (T = hr(v, this.locale));
|
|
2357
2361
|
var f = {
|
|
2358
2362
|
type: V.dateTime,
|
|
2359
2363
|
pattern: T,
|
|
2360
2364
|
location: u.styleLocation,
|
|
2361
|
-
parsedOptions: this.shouldParseSkeletons ?
|
|
2365
|
+
parsedOptions: this.shouldParseSkeletons ? or(T) : {}
|
|
2362
2366
|
}, P = s === "date" ? E.date : E.time;
|
|
2363
2367
|
return {
|
|
2364
2368
|
val: { type: P, value: n, location: _, style: f },
|
|
@@ -2393,7 +2397,7 @@ var Se = (
|
|
|
2393
2397
|
return h;
|
|
2394
2398
|
this.bumpSpace(), X = this.parseIdentifierIfPossible(), F = h.val;
|
|
2395
2399
|
}
|
|
2396
|
-
var q = this.tryParsePluralOrSelectOptions(
|
|
2400
|
+
var q = this.tryParsePluralOrSelectOptions(e, s, r, X);
|
|
2397
2401
|
if (q.err)
|
|
2398
2402
|
return q;
|
|
2399
2403
|
var b = this.tryParseArgumentClose(o);
|
|
@@ -2423,10 +2427,10 @@ var Se = (
|
|
|
2423
2427
|
default:
|
|
2424
2428
|
return this.error(g.INVALID_ARGUMENT_TYPE, d(a, l));
|
|
2425
2429
|
}
|
|
2426
|
-
}, t.prototype.tryParseArgumentClose = function(
|
|
2427
|
-
return this.isEOF() || this.char() !== 125 ? this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE, d(
|
|
2430
|
+
}, t.prototype.tryParseArgumentClose = function(e) {
|
|
2431
|
+
return this.isEOF() || this.char() !== 125 ? this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE, d(e, this.clonePosition())) : (this.bump(), { val: !0, err: null });
|
|
2428
2432
|
}, t.prototype.parseSimpleArgStyleIfPossible = function() {
|
|
2429
|
-
for (var
|
|
2433
|
+
for (var e = 0, r = this.clonePosition(); !this.isEOF(); ) {
|
|
2430
2434
|
var n = this.char();
|
|
2431
2435
|
switch (n) {
|
|
2432
2436
|
case 39: {
|
|
@@ -2438,15 +2442,15 @@ var Se = (
|
|
|
2438
2442
|
break;
|
|
2439
2443
|
}
|
|
2440
2444
|
case 123: {
|
|
2441
|
-
|
|
2445
|
+
e += 1, this.bump();
|
|
2442
2446
|
break;
|
|
2443
2447
|
}
|
|
2444
2448
|
case 125: {
|
|
2445
|
-
if (
|
|
2446
|
-
|
|
2449
|
+
if (e > 0)
|
|
2450
|
+
e -= 1;
|
|
2447
2451
|
else
|
|
2448
2452
|
return {
|
|
2449
|
-
val: this.message.slice(
|
|
2453
|
+
val: this.message.slice(r.offset, this.offset()),
|
|
2450
2454
|
err: null
|
|
2451
2455
|
};
|
|
2452
2456
|
break;
|
|
@@ -2457,30 +2461,30 @@ var Se = (
|
|
|
2457
2461
|
}
|
|
2458
2462
|
}
|
|
2459
2463
|
return {
|
|
2460
|
-
val: this.message.slice(
|
|
2464
|
+
val: this.message.slice(r.offset, this.offset()),
|
|
2461
2465
|
err: null
|
|
2462
2466
|
};
|
|
2463
|
-
}, t.prototype.parseNumberSkeletonFromString = function(
|
|
2467
|
+
}, t.prototype.parseNumberSkeletonFromString = function(e, r) {
|
|
2464
2468
|
var n = [];
|
|
2465
2469
|
try {
|
|
2466
|
-
n =
|
|
2470
|
+
n = ar(e);
|
|
2467
2471
|
} catch {
|
|
2468
|
-
return this.error(g.INVALID_NUMBER_SKELETON,
|
|
2472
|
+
return this.error(g.INVALID_NUMBER_SKELETON, r);
|
|
2469
2473
|
}
|
|
2470
2474
|
return {
|
|
2471
2475
|
val: {
|
|
2472
2476
|
type: V.number,
|
|
2473
2477
|
tokens: n,
|
|
2474
|
-
location:
|
|
2475
|
-
parsedOptions: this.shouldParseSkeletons ?
|
|
2478
|
+
location: r,
|
|
2479
|
+
parsedOptions: this.shouldParseSkeletons ? lr(n) : {}
|
|
2476
2480
|
},
|
|
2477
2481
|
err: null
|
|
2478
2482
|
};
|
|
2479
|
-
}, t.prototype.tryParsePluralOrSelectOptions = function(
|
|
2483
|
+
}, t.prototype.tryParsePluralOrSelectOptions = function(e, r, n, o) {
|
|
2480
2484
|
for (var i, a = !1, s = [], l = /* @__PURE__ */ new Set(), u = o.value, c = o.location; ; ) {
|
|
2481
2485
|
if (u.length === 0) {
|
|
2482
2486
|
var h = this.clonePosition();
|
|
2483
|
-
if (
|
|
2487
|
+
if (r !== "select" && this.bumpIf("=")) {
|
|
2484
2488
|
var f = this.tryParseDecimalInteger(g.EXPECT_PLURAL_ARGUMENT_SELECTOR, g.INVALID_PLURAL_ARGUMENT_SELECTOR);
|
|
2485
2489
|
if (f.err)
|
|
2486
2490
|
return f;
|
|
@@ -2489,12 +2493,12 @@ var Se = (
|
|
|
2489
2493
|
break;
|
|
2490
2494
|
}
|
|
2491
2495
|
if (l.has(u))
|
|
2492
|
-
return this.error(
|
|
2496
|
+
return this.error(r === "select" ? g.DUPLICATE_SELECT_ARGUMENT_SELECTOR : g.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, c);
|
|
2493
2497
|
u === "other" && (a = !0), this.bumpSpace();
|
|
2494
2498
|
var m = this.clonePosition();
|
|
2495
2499
|
if (!this.bumpIf("{"))
|
|
2496
|
-
return this.error(
|
|
2497
|
-
var b = this.parseMessage(
|
|
2500
|
+
return this.error(r === "select" ? g.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT : g.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, d(this.clonePosition(), this.clonePosition()));
|
|
2501
|
+
var b = this.parseMessage(e + 1, r, n);
|
|
2498
2502
|
if (b.err)
|
|
2499
2503
|
return b;
|
|
2500
2504
|
var _ = this.tryParseArgumentClose(m);
|
|
@@ -2508,8 +2512,8 @@ var Se = (
|
|
|
2508
2512
|
}
|
|
2509
2513
|
]), l.add(u), this.bumpSpace(), i = this.parseIdentifierIfPossible(), u = i.value, c = i.location;
|
|
2510
2514
|
}
|
|
2511
|
-
return s.length === 0 ? this.error(
|
|
2512
|
-
}, t.prototype.tryParseDecimalInteger = function(
|
|
2515
|
+
return s.length === 0 ? this.error(r === "select" ? g.EXPECT_SELECT_ARGUMENT_SELECTOR : g.EXPECT_PLURAL_ARGUMENT_SELECTOR, d(this.clonePosition(), this.clonePosition())) : this.requiresOtherClause && !a ? this.error(g.MISSING_OTHER_CLAUSE, d(this.clonePosition(), this.clonePosition())) : { val: s, err: null };
|
|
2516
|
+
}, t.prototype.tryParseDecimalInteger = function(e, r) {
|
|
2513
2517
|
var n = 1, o = this.clonePosition();
|
|
2514
2518
|
this.bumpIf("+") || this.bumpIf("-") && (n = -1);
|
|
2515
2519
|
for (var i = !1, a = 0; !this.isEOF(); ) {
|
|
@@ -2520,7 +2524,7 @@ var Se = (
|
|
|
2520
2524
|
break;
|
|
2521
2525
|
}
|
|
2522
2526
|
var l = d(o, this.clonePosition());
|
|
2523
|
-
return i ? (a *= n,
|
|
2527
|
+
return i ? (a *= n, Tr(a) ? { val: a, err: null } : this.error(r, l)) : this.error(e, l);
|
|
2524
2528
|
}, t.prototype.offset = function() {
|
|
2525
2529
|
return this.position.offset;
|
|
2526
2530
|
}, t.prototype.isEOF = function() {
|
|
@@ -2532,46 +2536,46 @@ var Se = (
|
|
|
2532
2536
|
column: this.position.column
|
|
2533
2537
|
};
|
|
2534
2538
|
}, t.prototype.char = function() {
|
|
2535
|
-
var
|
|
2536
|
-
if (
|
|
2539
|
+
var e = this.position.offset;
|
|
2540
|
+
if (e >= this.message.length)
|
|
2537
2541
|
throw Error("out of bound");
|
|
2538
|
-
var
|
|
2539
|
-
if (
|
|
2540
|
-
throw Error("Offset ".concat(
|
|
2541
|
-
return
|
|
2542
|
-
}, t.prototype.error = function(
|
|
2542
|
+
var r = $t(this.message, e);
|
|
2543
|
+
if (r === void 0)
|
|
2544
|
+
throw Error("Offset ".concat(e, " is at invalid UTF-16 code unit boundary"));
|
|
2545
|
+
return r;
|
|
2546
|
+
}, t.prototype.error = function(e, r) {
|
|
2543
2547
|
return {
|
|
2544
2548
|
val: null,
|
|
2545
2549
|
err: {
|
|
2546
|
-
kind:
|
|
2550
|
+
kind: e,
|
|
2547
2551
|
message: this.message,
|
|
2548
|
-
location:
|
|
2552
|
+
location: r
|
|
2549
2553
|
}
|
|
2550
2554
|
};
|
|
2551
2555
|
}, t.prototype.bump = function() {
|
|
2552
2556
|
if (!this.isEOF()) {
|
|
2553
|
-
var
|
|
2554
|
-
|
|
2557
|
+
var e = this.char();
|
|
2558
|
+
e === 10 ? (this.position.line += 1, this.position.column = 1, this.position.offset += 1) : (this.position.column += 1, this.position.offset += e < 65536 ? 1 : 2);
|
|
2555
2559
|
}
|
|
2556
|
-
}, t.prototype.bumpIf = function(
|
|
2557
|
-
if (Tt(this.message,
|
|
2558
|
-
for (var
|
|
2560
|
+
}, t.prototype.bumpIf = function(e) {
|
|
2561
|
+
if (Tt(this.message, e, this.offset())) {
|
|
2562
|
+
for (var r = 0; r < e.length; r++)
|
|
2559
2563
|
this.bump();
|
|
2560
2564
|
return !0;
|
|
2561
2565
|
}
|
|
2562
2566
|
return !1;
|
|
2563
|
-
}, t.prototype.bumpUntil = function(
|
|
2564
|
-
var
|
|
2567
|
+
}, t.prototype.bumpUntil = function(e) {
|
|
2568
|
+
var r = this.offset(), n = this.message.indexOf(e, r);
|
|
2565
2569
|
return n >= 0 ? (this.bumpTo(n), !0) : (this.bumpTo(this.message.length), !1);
|
|
2566
|
-
}, t.prototype.bumpTo = function(
|
|
2567
|
-
if (this.offset() >
|
|
2568
|
-
throw Error("targetOffset ".concat(
|
|
2569
|
-
for (
|
|
2570
|
-
var
|
|
2571
|
-
if (
|
|
2570
|
+
}, t.prototype.bumpTo = function(e) {
|
|
2571
|
+
if (this.offset() > e)
|
|
2572
|
+
throw Error("targetOffset ".concat(e, " must be greater than or equal to the current offset ").concat(this.offset()));
|
|
2573
|
+
for (e = Math.min(e, this.message.length); ; ) {
|
|
2574
|
+
var r = this.offset();
|
|
2575
|
+
if (r === e)
|
|
2572
2576
|
break;
|
|
2573
|
-
if (
|
|
2574
|
-
throw Error("targetOffset ".concat(
|
|
2577
|
+
if (r > e)
|
|
2578
|
+
throw Error("targetOffset ".concat(e, " is at invalid UTF-16 code unit boundary"));
|
|
2575
2579
|
if (this.bump(), this.isEOF())
|
|
2576
2580
|
break;
|
|
2577
2581
|
}
|
|
@@ -2581,7 +2585,7 @@ var Se = (
|
|
|
2581
2585
|
}, t.prototype.peek = function() {
|
|
2582
2586
|
if (this.isEOF())
|
|
2583
2587
|
return null;
|
|
2584
|
-
var
|
|
2588
|
+
var e = this.char(), r = this.offset(), n = this.message.charCodeAt(r + (e >= 65536 ? 2 : 1));
|
|
2585
2589
|
return n ?? null;
|
|
2586
2590
|
}, t;
|
|
2587
2591
|
}()
|
|
@@ -2589,68 +2593,68 @@ var Se = (
|
|
|
2589
2593
|
function lt(t) {
|
|
2590
2594
|
return t >= 97 && t <= 122 || t >= 65 && t <= 90;
|
|
2591
2595
|
}
|
|
2592
|
-
function
|
|
2596
|
+
function Ir(t) {
|
|
2593
2597
|
return lt(t) || t === 47;
|
|
2594
2598
|
}
|
|
2595
|
-
function
|
|
2599
|
+
function Nr(t) {
|
|
2596
2600
|
return t === 45 || t === 46 || t >= 48 && t <= 57 || t === 95 || t >= 97 && t <= 122 || t >= 65 && t <= 90 || t == 183 || t >= 192 && t <= 214 || t >= 216 && t <= 246 || t >= 248 && t <= 893 || t >= 895 && t <= 8191 || t >= 8204 && t <= 8205 || t >= 8255 && t <= 8256 || t >= 8304 && t <= 8591 || t >= 11264 && t <= 12271 || t >= 12289 && t <= 55295 || t >= 63744 && t <= 64975 || t >= 65008 && t <= 65533 || t >= 65536 && t <= 983039;
|
|
2597
2601
|
}
|
|
2598
2602
|
function Kt(t) {
|
|
2599
2603
|
return t >= 9 && t <= 13 || t === 32 || t === 133 || t >= 8206 && t <= 8207 || t === 8232 || t === 8233;
|
|
2600
2604
|
}
|
|
2601
|
-
function
|
|
2605
|
+
function Rr(t) {
|
|
2602
2606
|
return t >= 33 && t <= 35 || t === 36 || t >= 37 && t <= 39 || t === 40 || t === 41 || t === 42 || t === 43 || t === 44 || t === 45 || t >= 46 && t <= 47 || t >= 58 && t <= 59 || t >= 60 && t <= 62 || t >= 63 && t <= 64 || t === 91 || t === 92 || t === 93 || t === 94 || t === 96 || t === 123 || t === 124 || t === 125 || t === 126 || t === 161 || t >= 162 && t <= 165 || t === 166 || t === 167 || t === 169 || t === 171 || t === 172 || t === 174 || t === 176 || t === 177 || t === 182 || t === 187 || t === 191 || t === 215 || t === 247 || t >= 8208 && t <= 8213 || t >= 8214 && t <= 8215 || t === 8216 || t === 8217 || t === 8218 || t >= 8219 && t <= 8220 || t === 8221 || t === 8222 || t === 8223 || t >= 8224 && t <= 8231 || t >= 8240 && t <= 8248 || t === 8249 || t === 8250 || t >= 8251 && t <= 8254 || t >= 8257 && t <= 8259 || t === 8260 || t === 8261 || t === 8262 || t >= 8263 && t <= 8273 || t === 8274 || t === 8275 || t >= 8277 && t <= 8286 || t >= 8592 && t <= 8596 || t >= 8597 && t <= 8601 || t >= 8602 && t <= 8603 || t >= 8604 && t <= 8607 || t === 8608 || t >= 8609 && t <= 8610 || t === 8611 || t >= 8612 && t <= 8613 || t === 8614 || t >= 8615 && t <= 8621 || t === 8622 || t >= 8623 && t <= 8653 || t >= 8654 && t <= 8655 || t >= 8656 && t <= 8657 || t === 8658 || t === 8659 || t === 8660 || t >= 8661 && t <= 8691 || t >= 8692 && t <= 8959 || t >= 8960 && t <= 8967 || t === 8968 || t === 8969 || t === 8970 || t === 8971 || t >= 8972 && t <= 8991 || t >= 8992 && t <= 8993 || t >= 8994 && t <= 9e3 || t === 9001 || t === 9002 || t >= 9003 && t <= 9083 || t === 9084 || t >= 9085 && t <= 9114 || t >= 9115 && t <= 9139 || t >= 9140 && t <= 9179 || t >= 9180 && t <= 9185 || t >= 9186 && t <= 9254 || t >= 9255 && t <= 9279 || t >= 9280 && t <= 9290 || t >= 9291 && t <= 9311 || t >= 9472 && t <= 9654 || t === 9655 || t >= 9656 && t <= 9664 || t === 9665 || t >= 9666 && t <= 9719 || t >= 9720 && t <= 9727 || t >= 9728 && t <= 9838 || t === 9839 || t >= 9840 && t <= 10087 || t === 10088 || t === 10089 || t === 10090 || t === 10091 || t === 10092 || t === 10093 || t === 10094 || t === 10095 || t === 10096 || t === 10097 || t === 10098 || t === 10099 || t === 10100 || t === 10101 || t >= 10132 && t <= 10175 || t >= 10176 && t <= 10180 || t === 10181 || t === 10182 || t >= 10183 && t <= 10213 || t === 10214 || t === 10215 || t === 10216 || t === 10217 || t === 10218 || t === 10219 || t === 10220 || t === 10221 || t === 10222 || t === 10223 || t >= 10224 && t <= 10239 || t >= 10240 && t <= 10495 || t >= 10496 && t <= 10626 || t === 10627 || t === 10628 || t === 10629 || t === 10630 || t === 10631 || t === 10632 || t === 10633 || t === 10634 || t === 10635 || t === 10636 || t === 10637 || t === 10638 || t === 10639 || t === 10640 || t === 10641 || t === 10642 || t === 10643 || t === 10644 || t === 10645 || t === 10646 || t === 10647 || t === 10648 || t >= 10649 && t <= 10711 || t === 10712 || t === 10713 || t === 10714 || t === 10715 || t >= 10716 && t <= 10747 || t === 10748 || t === 10749 || t >= 10750 && t <= 11007 || t >= 11008 && t <= 11055 || t >= 11056 && t <= 11076 || t >= 11077 && t <= 11078 || t >= 11079 && t <= 11084 || t >= 11085 && t <= 11123 || t >= 11124 && t <= 11125 || t >= 11126 && t <= 11157 || t === 11158 || t >= 11159 && t <= 11263 || t >= 11776 && t <= 11777 || t === 11778 || t === 11779 || t === 11780 || t === 11781 || t >= 11782 && t <= 11784 || t === 11785 || t === 11786 || t === 11787 || t === 11788 || t === 11789 || t >= 11790 && t <= 11798 || t === 11799 || t >= 11800 && t <= 11801 || t === 11802 || t === 11803 || t === 11804 || t === 11805 || t >= 11806 && t <= 11807 || t === 11808 || t === 11809 || t === 11810 || t === 11811 || t === 11812 || t === 11813 || t === 11814 || t === 11815 || t === 11816 || t === 11817 || t >= 11818 && t <= 11822 || t === 11823 || t >= 11824 && t <= 11833 || t >= 11834 && t <= 11835 || t >= 11836 && t <= 11839 || t === 11840 || t === 11841 || t === 11842 || t >= 11843 && t <= 11855 || t >= 11856 && t <= 11857 || t === 11858 || t >= 11859 && t <= 11903 || t >= 12289 && t <= 12291 || t === 12296 || t === 12297 || t === 12298 || t === 12299 || t === 12300 || t === 12301 || t === 12302 || t === 12303 || t === 12304 || t === 12305 || t >= 12306 && t <= 12307 || t === 12308 || t === 12309 || t === 12310 || t === 12311 || t === 12312 || t === 12313 || t === 12314 || t === 12315 || t === 12316 || t === 12317 || t >= 12318 && t <= 12319 || t === 12320 || t === 12336 || t === 64830 || t === 64831 || t >= 65093 && t <= 65094;
|
|
2603
2607
|
}
|
|
2604
2608
|
function ht(t) {
|
|
2605
|
-
t.forEach(function(
|
|
2606
|
-
if (delete
|
|
2607
|
-
for (var
|
|
2608
|
-
delete
|
|
2609
|
+
t.forEach(function(e) {
|
|
2610
|
+
if (delete e.location, Dt(e) || Ut(e))
|
|
2611
|
+
for (var r in e.options)
|
|
2612
|
+
delete e.options[r].location, ht(e.options[r].value);
|
|
2609
2613
|
else
|
|
2610
|
-
Mt(
|
|
2614
|
+
Mt(e) && Gt(e.style) || (Ct(e) || wt(e)) && at(e.style) ? delete e.style.location : Ft(e) && ht(e.children);
|
|
2611
2615
|
});
|
|
2612
2616
|
}
|
|
2613
|
-
function
|
|
2614
|
-
|
|
2615
|
-
var
|
|
2616
|
-
if (
|
|
2617
|
-
var n = SyntaxError(g[
|
|
2618
|
-
throw n.location =
|
|
2617
|
+
function Pr(t, e) {
|
|
2618
|
+
e === void 0 && (e = {}), e = p({ shouldParseSkeletons: !0, requiresOtherClause: !0 }, e);
|
|
2619
|
+
var r = new Sr(t, e).parse();
|
|
2620
|
+
if (r.err) {
|
|
2621
|
+
var n = SyntaxError(g[r.err.kind]);
|
|
2622
|
+
throw n.location = r.err.location, n.originalMessage = r.err.message, n;
|
|
2619
2623
|
}
|
|
2620
|
-
return
|
|
2624
|
+
return e != null && e.captureLocation || ht(r.val), r.val;
|
|
2621
2625
|
}
|
|
2622
|
-
function O(t,
|
|
2623
|
-
var
|
|
2626
|
+
function O(t, e) {
|
|
2627
|
+
var r = e && e.cache ? e.cache : Dr, n = e && e.serializer ? e.serializer : wr, o = e && e.strategy ? e.strategy : Or;
|
|
2624
2628
|
return o(t, {
|
|
2625
|
-
cache:
|
|
2629
|
+
cache: r,
|
|
2626
2630
|
serializer: n
|
|
2627
2631
|
});
|
|
2628
2632
|
}
|
|
2629
|
-
function
|
|
2633
|
+
function Lr(t) {
|
|
2630
2634
|
return t == null || typeof t == "number" || typeof t == "boolean";
|
|
2631
2635
|
}
|
|
2632
|
-
function Zt(t,
|
|
2633
|
-
var o =
|
|
2634
|
-
return typeof i > "u" && (i = t.call(this, n),
|
|
2636
|
+
function Zt(t, e, r, n) {
|
|
2637
|
+
var o = Lr(n) ? n : r(n), i = e.get(o);
|
|
2638
|
+
return typeof i > "u" && (i = t.call(this, n), e.set(o, i)), i;
|
|
2635
2639
|
}
|
|
2636
|
-
function Yt(t,
|
|
2637
|
-
var n = Array.prototype.slice.call(arguments, 3), o =
|
|
2638
|
-
return typeof i > "u" && (i = t.apply(this, n),
|
|
2640
|
+
function Yt(t, e, r) {
|
|
2641
|
+
var n = Array.prototype.slice.call(arguments, 3), o = r(n), i = e.get(o);
|
|
2642
|
+
return typeof i > "u" && (i = t.apply(this, n), e.set(o, i)), i;
|
|
2639
2643
|
}
|
|
2640
|
-
function ft(t,
|
|
2641
|
-
return
|
|
2644
|
+
function ft(t, e, r, n, o) {
|
|
2645
|
+
return r.bind(e, t, n, o);
|
|
2642
2646
|
}
|
|
2643
|
-
function
|
|
2644
|
-
var
|
|
2645
|
-
return ft(t, this,
|
|
2647
|
+
function Or(t, e) {
|
|
2648
|
+
var r = t.length === 1 ? Zt : Yt;
|
|
2649
|
+
return ft(t, this, r, e.cache.create(), e.serializer);
|
|
2646
2650
|
}
|
|
2647
|
-
function
|
|
2648
|
-
return ft(t, this, Yt,
|
|
2651
|
+
function Mr(t, e) {
|
|
2652
|
+
return ft(t, this, Yt, e.cache.create(), e.serializer);
|
|
2649
2653
|
}
|
|
2650
|
-
function
|
|
2651
|
-
return ft(t, this, Zt,
|
|
2654
|
+
function Cr(t, e) {
|
|
2655
|
+
return ft(t, this, Zt, e.cache.create(), e.serializer);
|
|
2652
2656
|
}
|
|
2653
|
-
var
|
|
2657
|
+
var wr = function() {
|
|
2654
2658
|
return JSON.stringify(arguments);
|
|
2655
2659
|
};
|
|
2656
2660
|
function pt() {
|
|
@@ -2659,16 +2663,16 @@ function pt() {
|
|
|
2659
2663
|
pt.prototype.get = function(t) {
|
|
2660
2664
|
return this.cache[t];
|
|
2661
2665
|
};
|
|
2662
|
-
pt.prototype.set = function(t,
|
|
2663
|
-
this.cache[t] =
|
|
2666
|
+
pt.prototype.set = function(t, e) {
|
|
2667
|
+
this.cache[t] = e;
|
|
2664
2668
|
};
|
|
2665
|
-
var
|
|
2669
|
+
var Dr = {
|
|
2666
2670
|
create: function() {
|
|
2667
2671
|
return new pt();
|
|
2668
2672
|
}
|
|
2669
2673
|
}, M = {
|
|
2670
|
-
variadic:
|
|
2671
|
-
monadic:
|
|
2674
|
+
variadic: Mr,
|
|
2675
|
+
monadic: Cr
|
|
2672
2676
|
}, C;
|
|
2673
2677
|
(function(t) {
|
|
2674
2678
|
t.MISSING_VALUE = "MISSING_VALUE", t.INVALID_VALUE = "INVALID_VALUE", t.MISSING_INTL_API = "MISSING_INTL_API";
|
|
@@ -2676,56 +2680,56 @@ var De = {
|
|
|
2676
2680
|
var U = (
|
|
2677
2681
|
/** @class */
|
|
2678
2682
|
function(t) {
|
|
2679
|
-
L(
|
|
2680
|
-
function r
|
|
2681
|
-
var i = t.call(this,
|
|
2683
|
+
L(e, t);
|
|
2684
|
+
function e(r, n, o) {
|
|
2685
|
+
var i = t.call(this, r) || this;
|
|
2682
2686
|
return i.code = n, i.originalMessage = o, i;
|
|
2683
2687
|
}
|
|
2684
|
-
return
|
|
2688
|
+
return e.prototype.toString = function() {
|
|
2685
2689
|
return "[formatjs Error: ".concat(this.code, "] ").concat(this.message);
|
|
2686
|
-
},
|
|
2690
|
+
}, e;
|
|
2687
2691
|
}(Error)
|
|
2688
2692
|
), At = (
|
|
2689
2693
|
/** @class */
|
|
2690
2694
|
function(t) {
|
|
2691
|
-
L(
|
|
2692
|
-
function r
|
|
2693
|
-
return t.call(this, 'Invalid values for "'.concat(
|
|
2695
|
+
L(e, t);
|
|
2696
|
+
function e(r, n, o, i) {
|
|
2697
|
+
return t.call(this, 'Invalid values for "'.concat(r, '": "').concat(n, '". Options are "').concat(Object.keys(o).join('", "'), '"'), C.INVALID_VALUE, i) || this;
|
|
2694
2698
|
}
|
|
2695
|
-
return
|
|
2699
|
+
return e;
|
|
2696
2700
|
}(U)
|
|
2697
|
-
),
|
|
2701
|
+
), Ur = (
|
|
2698
2702
|
/** @class */
|
|
2699
2703
|
function(t) {
|
|
2700
|
-
L(
|
|
2701
|
-
function r
|
|
2702
|
-
return t.call(this, 'Value for "'.concat(
|
|
2704
|
+
L(e, t);
|
|
2705
|
+
function e(r, n, o) {
|
|
2706
|
+
return t.call(this, 'Value for "'.concat(r, '" must be of type ').concat(n), C.INVALID_VALUE, o) || this;
|
|
2703
2707
|
}
|
|
2704
|
-
return
|
|
2708
|
+
return e;
|
|
2705
2709
|
}(U)
|
|
2706
|
-
),
|
|
2710
|
+
), Fr = (
|
|
2707
2711
|
/** @class */
|
|
2708
2712
|
function(t) {
|
|
2709
|
-
L(
|
|
2710
|
-
function r
|
|
2711
|
-
return t.call(this, 'The intl string context variable "'.concat(
|
|
2713
|
+
L(e, t);
|
|
2714
|
+
function e(r, n) {
|
|
2715
|
+
return t.call(this, 'The intl string context variable "'.concat(r, '" was not provided to the string "').concat(n, '"'), C.MISSING_VALUE, n) || this;
|
|
2712
2716
|
}
|
|
2713
|
-
return
|
|
2717
|
+
return e;
|
|
2714
2718
|
}(U)
|
|
2715
2719
|
), A;
|
|
2716
2720
|
(function(t) {
|
|
2717
2721
|
t[t.literal = 0] = "literal", t[t.object = 1] = "object";
|
|
2718
2722
|
})(A || (A = {}));
|
|
2719
|
-
function
|
|
2720
|
-
return t.length < 2 ? t : t.reduce(function(
|
|
2721
|
-
var n =
|
|
2722
|
-
return !n || n.type !== A.literal ||
|
|
2723
|
+
function Gr(t) {
|
|
2724
|
+
return t.length < 2 ? t : t.reduce(function(e, r) {
|
|
2725
|
+
var n = e[e.length - 1];
|
|
2726
|
+
return !n || n.type !== A.literal || r.type !== A.literal ? e.push(r) : n.value += r.value, e;
|
|
2723
2727
|
}, []);
|
|
2724
2728
|
}
|
|
2725
|
-
function
|
|
2729
|
+
function kr(t) {
|
|
2726
2730
|
return typeof t == "function";
|
|
2727
2731
|
}
|
|
2728
|
-
function J(t,
|
|
2732
|
+
function J(t, e, r, n, o, i, a) {
|
|
2729
2733
|
if (t.length === 1 && Et(t[0]))
|
|
2730
2734
|
return [
|
|
2731
2735
|
{
|
|
@@ -2742,18 +2746,18 @@ function J(t, r, e, n, o, i, a) {
|
|
|
2742
2746
|
});
|
|
2743
2747
|
continue;
|
|
2744
2748
|
}
|
|
2745
|
-
if (
|
|
2749
|
+
if (rr(c)) {
|
|
2746
2750
|
typeof i == "number" && s.push({
|
|
2747
2751
|
type: A.literal,
|
|
2748
|
-
value:
|
|
2752
|
+
value: r.getNumberFormat(e).format(i)
|
|
2749
2753
|
});
|
|
2750
2754
|
continue;
|
|
2751
2755
|
}
|
|
2752
2756
|
var h = c.value;
|
|
2753
2757
|
if (!(o && h in o))
|
|
2754
|
-
throw new
|
|
2758
|
+
throw new Fr(h, a);
|
|
2755
2759
|
var f = o[h];
|
|
2756
|
-
if (
|
|
2760
|
+
if (er(c)) {
|
|
2757
2761
|
(!f || typeof f == "string" || typeof f == "number") && (f = typeof f == "string" || typeof f == "number" ? String(f) : ""), s.push({
|
|
2758
2762
|
type: typeof f == "string" ? A.literal : A.object,
|
|
2759
2763
|
value: f
|
|
@@ -2764,7 +2768,7 @@ function J(t, r, e, n, o, i, a) {
|
|
|
2764
2768
|
var m = typeof c.style == "string" ? n.date[c.style] : at(c.style) ? c.style.parsedOptions : void 0;
|
|
2765
2769
|
s.push({
|
|
2766
2770
|
type: A.literal,
|
|
2767
|
-
value:
|
|
2771
|
+
value: r.getDateTimeFormat(e, m).format(f)
|
|
2768
2772
|
});
|
|
2769
2773
|
continue;
|
|
2770
2774
|
}
|
|
@@ -2772,7 +2776,7 @@ function J(t, r, e, n, o, i, a) {
|
|
|
2772
2776
|
var m = typeof c.style == "string" ? n.time[c.style] : at(c.style) ? c.style.parsedOptions : n.time.medium;
|
|
2773
2777
|
s.push({
|
|
2774
2778
|
type: A.literal,
|
|
2775
|
-
value:
|
|
2779
|
+
value: r.getDateTimeFormat(e, m).format(f)
|
|
2776
2780
|
});
|
|
2777
2781
|
continue;
|
|
2778
2782
|
}
|
|
@@ -2780,15 +2784,15 @@ function J(t, r, e, n, o, i, a) {
|
|
|
2780
2784
|
var m = typeof c.style == "string" ? n.number[c.style] : Gt(c.style) ? c.style.parsedOptions : void 0;
|
|
2781
2785
|
m && m.scale && (f = f * (m.scale || 1)), s.push({
|
|
2782
2786
|
type: A.literal,
|
|
2783
|
-
value:
|
|
2787
|
+
value: r.getNumberFormat(e, m).format(f)
|
|
2784
2788
|
});
|
|
2785
2789
|
continue;
|
|
2786
2790
|
}
|
|
2787
2791
|
if (Ft(c)) {
|
|
2788
2792
|
var b = c.children, _ = c.value, v = o[_];
|
|
2789
|
-
if (!
|
|
2790
|
-
throw new
|
|
2791
|
-
var T = J(b,
|
|
2793
|
+
if (!kr(v))
|
|
2794
|
+
throw new Ur(_, "function", a);
|
|
2795
|
+
var T = J(b, e, r, n, o, i), P = v(T.map(function(F) {
|
|
2792
2796
|
return F.value;
|
|
2793
2797
|
}));
|
|
2794
2798
|
Array.isArray(P) || (P = [P]), s.push.apply(s, P.map(function(F) {
|
|
@@ -2802,7 +2806,7 @@ function J(t, r, e, n, o, i, a) {
|
|
|
2802
2806
|
var H = c.options[f] || c.options.other;
|
|
2803
2807
|
if (!H)
|
|
2804
2808
|
throw new At(c.value, f, Object.keys(c.options), a);
|
|
2805
|
-
s.push.apply(s, J(H.value,
|
|
2809
|
+
s.push.apply(s, J(H.value, e, r, n, o));
|
|
2806
2810
|
continue;
|
|
2807
2811
|
}
|
|
2808
2812
|
if (Ut(c)) {
|
|
@@ -2812,69 +2816,69 @@ function J(t, r, e, n, o, i, a) {
|
|
|
2812
2816
|
throw new U(`Intl.PluralRules is not available in this environment.
|
|
2813
2817
|
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
2814
2818
|
`, C.MISSING_INTL_API, a);
|
|
2815
|
-
var X =
|
|
2819
|
+
var X = r.getPluralRules(e, { type: c.pluralType }).select(f - (c.offset || 0));
|
|
2816
2820
|
H = c.options[X] || c.options.other;
|
|
2817
2821
|
}
|
|
2818
2822
|
if (!H)
|
|
2819
2823
|
throw new At(c.value, f, Object.keys(c.options), a);
|
|
2820
|
-
s.push.apply(s, J(H.value,
|
|
2824
|
+
s.push.apply(s, J(H.value, e, r, n, o, f - (c.offset || 0)));
|
|
2821
2825
|
continue;
|
|
2822
2826
|
}
|
|
2823
2827
|
}
|
|
2824
|
-
return
|
|
2828
|
+
return Gr(s);
|
|
2825
2829
|
}
|
|
2826
|
-
function
|
|
2827
|
-
return
|
|
2828
|
-
return
|
|
2830
|
+
function jr(t, e) {
|
|
2831
|
+
return e ? p(p(p({}, t || {}), e || {}), Object.keys(t).reduce(function(r, n) {
|
|
2832
|
+
return r[n] = p(p({}, t[n]), e[n] || {}), r;
|
|
2829
2833
|
}, {})) : t;
|
|
2830
2834
|
}
|
|
2831
|
-
function
|
|
2832
|
-
return
|
|
2833
|
-
return
|
|
2835
|
+
function xr(t, e) {
|
|
2836
|
+
return e ? Object.keys(t).reduce(function(r, n) {
|
|
2837
|
+
return r[n] = jr(t[n], e[n]), r;
|
|
2834
2838
|
}, p({}, t)) : t;
|
|
2835
2839
|
}
|
|
2836
|
-
function
|
|
2840
|
+
function rt(t) {
|
|
2837
2841
|
return {
|
|
2838
2842
|
create: function() {
|
|
2839
2843
|
return {
|
|
2840
|
-
get: function(
|
|
2841
|
-
return t[
|
|
2844
|
+
get: function(e) {
|
|
2845
|
+
return t[e];
|
|
2842
2846
|
},
|
|
2843
|
-
set: function(
|
|
2844
|
-
t[
|
|
2847
|
+
set: function(e, r) {
|
|
2848
|
+
t[e] = r;
|
|
2845
2849
|
}
|
|
2846
2850
|
};
|
|
2847
2851
|
}
|
|
2848
2852
|
};
|
|
2849
2853
|
}
|
|
2850
|
-
function
|
|
2854
|
+
function Vr(t) {
|
|
2851
2855
|
return t === void 0 && (t = {
|
|
2852
2856
|
number: {},
|
|
2853
2857
|
dateTime: {},
|
|
2854
2858
|
pluralRules: {}
|
|
2855
2859
|
}), {
|
|
2856
2860
|
getNumberFormat: O(function() {
|
|
2857
|
-
for (var
|
|
2858
|
-
|
|
2859
|
-
return new ((
|
|
2861
|
+
for (var e, r = [], n = 0; n < arguments.length; n++)
|
|
2862
|
+
r[n] = arguments[n];
|
|
2863
|
+
return new ((e = Intl.NumberFormat).bind.apply(e, D([void 0], r, !1)))();
|
|
2860
2864
|
}, {
|
|
2861
|
-
cache:
|
|
2865
|
+
cache: rt(t.number),
|
|
2862
2866
|
strategy: M.variadic
|
|
2863
2867
|
}),
|
|
2864
2868
|
getDateTimeFormat: O(function() {
|
|
2865
|
-
for (var
|
|
2866
|
-
|
|
2867
|
-
return new ((
|
|
2869
|
+
for (var e, r = [], n = 0; n < arguments.length; n++)
|
|
2870
|
+
r[n] = arguments[n];
|
|
2871
|
+
return new ((e = Intl.DateTimeFormat).bind.apply(e, D([void 0], r, !1)))();
|
|
2868
2872
|
}, {
|
|
2869
|
-
cache:
|
|
2873
|
+
cache: rt(t.dateTime),
|
|
2870
2874
|
strategy: M.variadic
|
|
2871
2875
|
}),
|
|
2872
2876
|
getPluralRules: O(function() {
|
|
2873
|
-
for (var
|
|
2874
|
-
|
|
2875
|
-
return new ((
|
|
2877
|
+
for (var e, r = [], n = 0; n < arguments.length; n++)
|
|
2878
|
+
r[n] = arguments[n];
|
|
2879
|
+
return new ((e = Intl.PluralRules).bind.apply(e, D([void 0], r, !1)))();
|
|
2876
2880
|
}, {
|
|
2877
|
-
cache:
|
|
2881
|
+
cache: rt(t.pluralRules),
|
|
2878
2882
|
strategy: M.variadic
|
|
2879
2883
|
})
|
|
2880
2884
|
};
|
|
@@ -2882,8 +2886,8 @@ function Ve(t) {
|
|
|
2882
2886
|
var qt = (
|
|
2883
2887
|
/** @class */
|
|
2884
2888
|
function() {
|
|
2885
|
-
function t(
|
|
2886
|
-
|
|
2889
|
+
function t(e, r, n, o) {
|
|
2890
|
+
r === void 0 && (r = t.defaultLocale);
|
|
2887
2891
|
var i = this;
|
|
2888
2892
|
if (this.formatterCache = {
|
|
2889
2893
|
number: {},
|
|
@@ -2906,18 +2910,18 @@ var qt = (
|
|
|
2906
2910
|
};
|
|
2907
2911
|
}, this.getAst = function() {
|
|
2908
2912
|
return i.ast;
|
|
2909
|
-
}, this.locales =
|
|
2910
|
-
if (this.message =
|
|
2913
|
+
}, this.locales = r, this.resolvedLocale = t.resolveLocale(r), typeof e == "string") {
|
|
2914
|
+
if (this.message = e, !t.__parse)
|
|
2911
2915
|
throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
|
|
2912
2916
|
var a = o || {};
|
|
2913
2917
|
a.formatters;
|
|
2914
|
-
var s =
|
|
2915
|
-
this.ast = t.__parse(
|
|
2918
|
+
var s = tr(a, ["formatters"]);
|
|
2919
|
+
this.ast = t.__parse(e, p(p({}, s), { locale: this.resolvedLocale }));
|
|
2916
2920
|
} else
|
|
2917
|
-
this.ast =
|
|
2921
|
+
this.ast = e;
|
|
2918
2922
|
if (!Array.isArray(this.ast))
|
|
2919
2923
|
throw new TypeError("A message must be provided as a String or AST.");
|
|
2920
|
-
this.formats =
|
|
2924
|
+
this.formats = xr(t.formats, n), this.formatters = o && o.formatters || Vr(this.formatterCache);
|
|
2921
2925
|
}
|
|
2922
2926
|
return Object.defineProperty(t, "defaultLocale", {
|
|
2923
2927
|
get: function() {
|
|
@@ -2925,12 +2929,12 @@ var qt = (
|
|
|
2925
2929
|
},
|
|
2926
2930
|
enumerable: !1,
|
|
2927
2931
|
configurable: !0
|
|
2928
|
-
}), t.memoizedDefaultLocale = null, t.resolveLocale = function(
|
|
2932
|
+
}), t.memoizedDefaultLocale = null, t.resolveLocale = function(e) {
|
|
2929
2933
|
if (!(typeof Intl.Locale > "u")) {
|
|
2930
|
-
var
|
|
2931
|
-
return
|
|
2934
|
+
var r = Intl.NumberFormat.supportedLocalesOf(e);
|
|
2935
|
+
return r.length > 0 ? new Intl.Locale(r[0]) : new Intl.Locale(typeof e == "string" ? e : e[0]);
|
|
2932
2936
|
}
|
|
2933
|
-
}, t.__parse =
|
|
2937
|
+
}, t.__parse = Pr, t.formats = {
|
|
2934
2938
|
number: {
|
|
2935
2939
|
integer: {
|
|
2936
2940
|
maximumFractionDigits: 0
|
|
@@ -2997,100 +3001,100 @@ var qt = (
|
|
|
2997
3001
|
var N = (
|
|
2998
3002
|
/** @class */
|
|
2999
3003
|
function(t) {
|
|
3000
|
-
L(
|
|
3001
|
-
function r
|
|
3004
|
+
L(e, t);
|
|
3005
|
+
function e(r, n, o) {
|
|
3002
3006
|
var i = this, a = o ? o instanceof Error ? o : new Error(String(o)) : void 0;
|
|
3003
|
-
return i = t.call(this, "[@formatjs/intl Error ".concat(
|
|
3007
|
+
return i = t.call(this, "[@formatjs/intl Error ".concat(r, "] ").concat(n, `
|
|
3004
3008
|
`).concat(a ? `
|
|
3005
3009
|
`.concat(a.message, `
|
|
3006
|
-
`).concat(a.stack) : "")) || this, i.code =
|
|
3010
|
+
`).concat(a.stack) : "")) || this, i.code = r, typeof Error.captureStackTrace == "function" && Error.captureStackTrace(i, e), i;
|
|
3007
3011
|
}
|
|
3008
|
-
return
|
|
3012
|
+
return e;
|
|
3009
3013
|
}(Error)
|
|
3010
|
-
), $
|
|
3014
|
+
), $r = (
|
|
3011
3015
|
/** @class */
|
|
3012
3016
|
function(t) {
|
|
3013
|
-
L(
|
|
3014
|
-
function r
|
|
3015
|
-
return t.call(this, B.UNSUPPORTED_FORMATTER,
|
|
3017
|
+
L(e, t);
|
|
3018
|
+
function e(r, n) {
|
|
3019
|
+
return t.call(this, B.UNSUPPORTED_FORMATTER, r, n) || this;
|
|
3016
3020
|
}
|
|
3017
|
-
return
|
|
3021
|
+
return e;
|
|
3018
3022
|
}(N)
|
|
3019
|
-
),
|
|
3023
|
+
), Xr = (
|
|
3020
3024
|
/** @class */
|
|
3021
3025
|
function(t) {
|
|
3022
|
-
L(
|
|
3023
|
-
function r
|
|
3024
|
-
return t.call(this, B.INVALID_CONFIG,
|
|
3026
|
+
L(e, t);
|
|
3027
|
+
function e(r, n) {
|
|
3028
|
+
return t.call(this, B.INVALID_CONFIG, r, n) || this;
|
|
3025
3029
|
}
|
|
3026
|
-
return
|
|
3030
|
+
return e;
|
|
3027
3031
|
}(N)
|
|
3028
3032
|
), St = (
|
|
3029
3033
|
/** @class */
|
|
3030
3034
|
function(t) {
|
|
3031
|
-
L(
|
|
3032
|
-
function r
|
|
3033
|
-
return t.call(this, B.MISSING_DATA,
|
|
3035
|
+
L(e, t);
|
|
3036
|
+
function e(r, n) {
|
|
3037
|
+
return t.call(this, B.MISSING_DATA, r, n) || this;
|
|
3034
3038
|
}
|
|
3035
|
-
return
|
|
3039
|
+
return e;
|
|
3036
3040
|
}(N)
|
|
3037
3041
|
), mt = (
|
|
3038
3042
|
/** @class */
|
|
3039
3043
|
function(t) {
|
|
3040
|
-
L(
|
|
3041
|
-
function r
|
|
3042
|
-
return t.call(this, B.FORMAT_ERROR, "".concat(
|
|
3044
|
+
L(e, t);
|
|
3045
|
+
function e(r, n, o) {
|
|
3046
|
+
return t.call(this, B.FORMAT_ERROR, "".concat(r, `
|
|
3043
3047
|
Locale: `).concat(n, `
|
|
3044
3048
|
`), o) || this;
|
|
3045
3049
|
}
|
|
3046
|
-
return
|
|
3050
|
+
return e;
|
|
3047
3051
|
}(N)
|
|
3048
3052
|
), nt = (
|
|
3049
3053
|
/** @class */
|
|
3050
3054
|
function(t) {
|
|
3051
|
-
L(
|
|
3052
|
-
function r
|
|
3053
|
-
var a = t.call(this, "".concat(
|
|
3055
|
+
L(e, t);
|
|
3056
|
+
function e(r, n, o, i) {
|
|
3057
|
+
var a = t.call(this, "".concat(r, `
|
|
3054
3058
|
MessageID: `).concat(o == null ? void 0 : o.id, `
|
|
3055
3059
|
Default Message: `).concat(o == null ? void 0 : o.defaultMessage, `
|
|
3056
3060
|
Description: `).concat(o == null ? void 0 : o.description, `
|
|
3057
3061
|
`), n, i) || this;
|
|
3058
3062
|
return a.descriptor = o, a;
|
|
3059
3063
|
}
|
|
3060
|
-
return
|
|
3064
|
+
return e;
|
|
3061
3065
|
}(mt)
|
|
3062
|
-
),
|
|
3066
|
+
), Kr = (
|
|
3063
3067
|
/** @class */
|
|
3064
3068
|
function(t) {
|
|
3065
|
-
L(
|
|
3066
|
-
function r
|
|
3067
|
-
var o = t.call(this, B.MISSING_TRANSLATION, 'Missing message: "'.concat(
|
|
3069
|
+
L(e, t);
|
|
3070
|
+
function e(r, n) {
|
|
3071
|
+
var o = t.call(this, B.MISSING_TRANSLATION, 'Missing message: "'.concat(r.id, '" for locale "').concat(n, '", using ').concat(r.defaultMessage ? "default message (".concat(typeof r.defaultMessage == "string" ? r.defaultMessage : r.defaultMessage.map(function(i) {
|
|
3068
3072
|
var a;
|
|
3069
3073
|
return (a = i.value) !== null && a !== void 0 ? a : JSON.stringify(i);
|
|
3070
3074
|
}).join(), ")") : "id", " as fallback.")) || this;
|
|
3071
|
-
return o.descriptor =
|
|
3075
|
+
return o.descriptor = r, o;
|
|
3072
3076
|
}
|
|
3073
|
-
return
|
|
3077
|
+
return e;
|
|
3074
3078
|
}(N)
|
|
3075
3079
|
);
|
|
3076
|
-
function j(t,
|
|
3077
|
-
return
|
|
3078
|
-
return o in t ? n[o] = t[o] : o in
|
|
3080
|
+
function j(t, e, r) {
|
|
3081
|
+
return r === void 0 && (r = {}), e.reduce(function(n, o) {
|
|
3082
|
+
return o in t ? n[o] = t[o] : o in r && (n[o] = r[o]), n;
|
|
3079
3083
|
}, {});
|
|
3080
3084
|
}
|
|
3081
|
-
var
|
|
3085
|
+
var Zr = function(t) {
|
|
3082
3086
|
process.env.NODE_ENV !== "production" && console.error(t);
|
|
3083
|
-
},
|
|
3087
|
+
}, Yr = function(t) {
|
|
3084
3088
|
process.env.NODE_ENV !== "production" && console.warn(t);
|
|
3085
|
-
},
|
|
3089
|
+
}, qr = {
|
|
3086
3090
|
formats: {},
|
|
3087
3091
|
messages: {},
|
|
3088
3092
|
timeZone: void 0,
|
|
3089
3093
|
defaultLocale: "en",
|
|
3090
3094
|
defaultFormats: {},
|
|
3091
3095
|
fallbackOnEmptyString: !0,
|
|
3092
|
-
onError:
|
|
3093
|
-
onWarn:
|
|
3096
|
+
onError: Zr,
|
|
3097
|
+
onWarn: Yr
|
|
3094
3098
|
};
|
|
3095
3099
|
function Wt() {
|
|
3096
3100
|
return {
|
|
@@ -3107,19 +3111,19 @@ function G(t) {
|
|
|
3107
3111
|
return {
|
|
3108
3112
|
create: function() {
|
|
3109
3113
|
return {
|
|
3110
|
-
get: function(
|
|
3111
|
-
return t[
|
|
3114
|
+
get: function(e) {
|
|
3115
|
+
return t[e];
|
|
3112
3116
|
},
|
|
3113
|
-
set: function(
|
|
3114
|
-
t[
|
|
3117
|
+
set: function(e, r) {
|
|
3118
|
+
t[e] = r;
|
|
3115
3119
|
}
|
|
3116
3120
|
};
|
|
3117
3121
|
}
|
|
3118
3122
|
};
|
|
3119
3123
|
}
|
|
3120
|
-
function
|
|
3124
|
+
function Wr(t) {
|
|
3121
3125
|
t === void 0 && (t = Wt());
|
|
3122
|
-
var
|
|
3126
|
+
var e = Intl.RelativeTimeFormat, r = Intl.ListFormat, n = Intl.DisplayNames, o = O(function() {
|
|
3123
3127
|
for (var s, l = [], u = 0; u < arguments.length; u++)
|
|
3124
3128
|
l[u] = arguments[u];
|
|
3125
3129
|
return new ((s = Intl.DateTimeFormat).bind.apply(s, D([void 0], l, !1)))();
|
|
@@ -3157,7 +3161,7 @@ function We(t) {
|
|
|
3157
3161
|
getRelativeTimeFormat: O(function() {
|
|
3158
3162
|
for (var s = [], l = 0; l < arguments.length; l++)
|
|
3159
3163
|
s[l] = arguments[l];
|
|
3160
|
-
return new (
|
|
3164
|
+
return new (e.bind.apply(e, D([void 0], s, !1)))();
|
|
3161
3165
|
}, {
|
|
3162
3166
|
cache: G(t.relativeTime),
|
|
3163
3167
|
strategy: M.variadic
|
|
@@ -3166,7 +3170,7 @@ function We(t) {
|
|
|
3166
3170
|
getListFormat: O(function() {
|
|
3167
3171
|
for (var s = [], l = 0; l < arguments.length; l++)
|
|
3168
3172
|
s[l] = arguments[l];
|
|
3169
|
-
return new (
|
|
3173
|
+
return new (r.bind.apply(r, D([void 0], s, !1)))();
|
|
3170
3174
|
}, {
|
|
3171
3175
|
cache: G(t.list),
|
|
3172
3176
|
strategy: M.variadic
|
|
@@ -3181,38 +3185,38 @@ function We(t) {
|
|
|
3181
3185
|
})
|
|
3182
3186
|
};
|
|
3183
3187
|
}
|
|
3184
|
-
function gt(t,
|
|
3185
|
-
var o = t && t[
|
|
3186
|
-
if (o && (i = o[
|
|
3188
|
+
function gt(t, e, r, n) {
|
|
3189
|
+
var o = t && t[e], i;
|
|
3190
|
+
if (o && (i = o[r]), i)
|
|
3187
3191
|
return i;
|
|
3188
|
-
n(new $
|
|
3192
|
+
n(new $r("No ".concat(e, " format named: ").concat(r)));
|
|
3189
3193
|
}
|
|
3190
|
-
function
|
|
3191
|
-
if (
|
|
3192
|
-
throw new e
|
|
3194
|
+
function zr(t, e, r) {
|
|
3195
|
+
if (r === void 0 && (r = Error), !t)
|
|
3196
|
+
throw new r(e);
|
|
3193
3197
|
}
|
|
3194
|
-
function z(t,
|
|
3195
|
-
return Object.keys(t).reduce(function(
|
|
3196
|
-
return
|
|
3198
|
+
function z(t, e) {
|
|
3199
|
+
return Object.keys(t).reduce(function(r, n) {
|
|
3200
|
+
return r[n] = p({ timeZone: e }, t[n]), r;
|
|
3197
3201
|
}, {});
|
|
3198
3202
|
}
|
|
3199
|
-
function It(t,
|
|
3200
|
-
var
|
|
3201
|
-
return
|
|
3202
|
-
return n[o] = p(p({}, t[o] || {}),
|
|
3203
|
+
function It(t, e) {
|
|
3204
|
+
var r = Object.keys(p(p({}, t), e));
|
|
3205
|
+
return r.reduce(function(n, o) {
|
|
3206
|
+
return n[o] = p(p({}, t[o] || {}), e[o] || {}), n;
|
|
3203
3207
|
}, {});
|
|
3204
3208
|
}
|
|
3205
|
-
function Nt(t,
|
|
3206
|
-
if (!
|
|
3209
|
+
function Nt(t, e) {
|
|
3210
|
+
if (!e)
|
|
3207
3211
|
return t;
|
|
3208
|
-
var
|
|
3209
|
-
return p(p(p({},
|
|
3212
|
+
var r = qt.formats;
|
|
3213
|
+
return p(p(p({}, r), t), { date: It(z(r.date, e), z(t.date || {}, e)), time: It(z(r.time, e), z(t.time || {}, e)) });
|
|
3210
3214
|
}
|
|
3211
|
-
var Rt = function(t,
|
|
3215
|
+
var Rt = function(t, e, r, n, o) {
|
|
3212
3216
|
var i = t.locale, a = t.formats, s = t.messages, l = t.defaultLocale, u = t.defaultFormats, c = t.fallbackOnEmptyString, h = t.onError, f = t.timeZone, m = t.defaultRichTextElements;
|
|
3213
|
-
|
|
3214
|
-
var b =
|
|
3215
|
-
|
|
3217
|
+
r === void 0 && (r = { id: "" });
|
|
3218
|
+
var b = r.id, _ = r.defaultMessage;
|
|
3219
|
+
zr(!!b, "[@formatjs/intl] An `id` must be provided to format a message. You can either:\n1. Configure your build toolchain with [babel-plugin-formatjs](https://formatjs.io/docs/tooling/babel-plugin)\nor [@formatjs/ts-transformer](https://formatjs.io/docs/tooling/ts-transformer) OR\n2. Configure your `eslint` config to include [eslint-plugin-formatjs](https://formatjs.io/docs/tooling/linter#enforce-id)\nto autofix this issue");
|
|
3216
3220
|
var v = String(b), T = (
|
|
3217
3221
|
// In case messages is Object.create(null)
|
|
3218
3222
|
// e.g import('foo.json') from webpack)
|
|
@@ -3226,27 +3230,27 @@ var Rt = function(t, r, e, n, o) {
|
|
|
3226
3230
|
if (n = p(p({}, m), n || {}), a = Nt(a, f), u = Nt(u, f), !T) {
|
|
3227
3231
|
if (c === !1 && T === "")
|
|
3228
3232
|
return T;
|
|
3229
|
-
if ((!_ || i && i.toLowerCase() !== l.toLowerCase()) && h(new
|
|
3233
|
+
if ((!_ || i && i.toLowerCase() !== l.toLowerCase()) && h(new Kr(r, i)), _)
|
|
3230
3234
|
try {
|
|
3231
|
-
var P =
|
|
3235
|
+
var P = e.getMessageFormat(_, l, u, o);
|
|
3232
3236
|
return P.format(n);
|
|
3233
3237
|
} catch (H) {
|
|
3234
|
-
return h(new nt('Error formatting default message for: "'.concat(v, '", rendering default message verbatim'), i,
|
|
3238
|
+
return h(new nt('Error formatting default message for: "'.concat(v, '", rendering default message verbatim'), i, r, H)), typeof _ == "string" ? _ : v;
|
|
3235
3239
|
}
|
|
3236
3240
|
return v;
|
|
3237
3241
|
}
|
|
3238
3242
|
try {
|
|
3239
|
-
var P =
|
|
3243
|
+
var P = e.getMessageFormat(T, i, a, p({ formatters: e }, o || {}));
|
|
3240
3244
|
return P.format(n);
|
|
3241
3245
|
} catch (H) {
|
|
3242
|
-
h(new nt('Error formatting message: "'.concat(v, '", using ').concat(_ ? "default message" : "id", " as fallback."), i,
|
|
3246
|
+
h(new nt('Error formatting message: "'.concat(v, '", using ').concat(_ ? "default message" : "id", " as fallback."), i, r, H));
|
|
3243
3247
|
}
|
|
3244
3248
|
if (_)
|
|
3245
3249
|
try {
|
|
3246
|
-
var P =
|
|
3250
|
+
var P = e.getMessageFormat(_, l, u, o);
|
|
3247
3251
|
return P.format(n);
|
|
3248
3252
|
} catch (H) {
|
|
3249
|
-
h(new nt('Error formatting the default message for: "'.concat(v, '", rendering message verbatim'), i,
|
|
3253
|
+
h(new nt('Error formatting the default message for: "'.concat(v, '", rendering message verbatim'), i, r, H));
|
|
3250
3254
|
}
|
|
3251
3255
|
return typeof T == "string" ? T : typeof _ == "string" ? _ : v;
|
|
3252
3256
|
}, zt = [
|
|
@@ -3270,62 +3274,62 @@ var Rt = function(t, r, e, n, o) {
|
|
|
3270
3274
|
"numberingSystem",
|
|
3271
3275
|
"fractionalSecondDigits"
|
|
3272
3276
|
];
|
|
3273
|
-
function tt(t,
|
|
3277
|
+
function tt(t, e, r, n) {
|
|
3274
3278
|
var o = t.locale, i = t.formats, a = t.onError, s = t.timeZone;
|
|
3275
3279
|
n === void 0 && (n = {});
|
|
3276
|
-
var l = n.format, u = p(p({}, s && { timeZone: s }), l && gt(i,
|
|
3277
|
-
return
|
|
3280
|
+
var l = n.format, u = p(p({}, s && { timeZone: s }), l && gt(i, e, l, a)), c = j(n, zt, u);
|
|
3281
|
+
return e === "time" && !c.hour && !c.minute && !c.second && !c.timeStyle && !c.dateStyle && (c = p(p({}, c), { hour: "numeric", minute: "numeric" })), r(o, c);
|
|
3278
3282
|
}
|
|
3279
|
-
function
|
|
3280
|
-
for (var
|
|
3281
|
-
|
|
3282
|
-
var o =
|
|
3283
|
+
function Qr(t, e) {
|
|
3284
|
+
for (var r = [], n = 2; n < arguments.length; n++)
|
|
3285
|
+
r[n - 2] = arguments[n];
|
|
3286
|
+
var o = r[0], i = r[1], a = i === void 0 ? {} : i, s = typeof o == "string" ? new Date(o || 0) : o;
|
|
3283
3287
|
try {
|
|
3284
|
-
return tt(t, "date",
|
|
3288
|
+
return tt(t, "date", e, a).format(s);
|
|
3285
3289
|
} catch (l) {
|
|
3286
3290
|
t.onError(new N(B.FORMAT_ERROR, "Error formatting date.", l));
|
|
3287
3291
|
}
|
|
3288
3292
|
return String(s);
|
|
3289
3293
|
}
|
|
3290
|
-
function
|
|
3291
|
-
for (var
|
|
3292
|
-
|
|
3293
|
-
var o =
|
|
3294
|
+
function Jr(t, e) {
|
|
3295
|
+
for (var r = [], n = 2; n < arguments.length; n++)
|
|
3296
|
+
r[n - 2] = arguments[n];
|
|
3297
|
+
var o = r[0], i = r[1], a = i === void 0 ? {} : i, s = typeof o == "string" ? new Date(o || 0) : o;
|
|
3294
3298
|
try {
|
|
3295
|
-
return tt(t, "time",
|
|
3299
|
+
return tt(t, "time", e, a).format(s);
|
|
3296
3300
|
} catch (l) {
|
|
3297
3301
|
t.onError(new N(B.FORMAT_ERROR, "Error formatting time.", l));
|
|
3298
3302
|
}
|
|
3299
3303
|
return String(s);
|
|
3300
3304
|
}
|
|
3301
|
-
function tn(t,
|
|
3302
|
-
for (var
|
|
3303
|
-
|
|
3304
|
-
var o =
|
|
3305
|
+
function tn(t, e) {
|
|
3306
|
+
for (var r = [], n = 2; n < arguments.length; n++)
|
|
3307
|
+
r[n - 2] = arguments[n];
|
|
3308
|
+
var o = r[0], i = r[1], a = r[2], s = a === void 0 ? {} : a, l = t.timeZone, u = t.locale, c = t.onError, h = j(s, zt, l ? { timeZone: l } : {});
|
|
3305
3309
|
try {
|
|
3306
|
-
return
|
|
3310
|
+
return e(u, h).formatRange(o, i);
|
|
3307
3311
|
} catch (f) {
|
|
3308
3312
|
c(new N(B.FORMAT_ERROR, "Error formatting date time range.", f));
|
|
3309
3313
|
}
|
|
3310
3314
|
return String(o);
|
|
3311
3315
|
}
|
|
3312
|
-
function
|
|
3313
|
-
for (var
|
|
3314
|
-
|
|
3315
|
-
var o =
|
|
3316
|
+
function en(t, e) {
|
|
3317
|
+
for (var r = [], n = 2; n < arguments.length; n++)
|
|
3318
|
+
r[n - 2] = arguments[n];
|
|
3319
|
+
var o = r[0], i = r[1], a = i === void 0 ? {} : i, s = typeof o == "string" ? new Date(o || 0) : o;
|
|
3316
3320
|
try {
|
|
3317
|
-
return tt(t, "date",
|
|
3321
|
+
return tt(t, "date", e, a).formatToParts(s);
|
|
3318
3322
|
} catch (l) {
|
|
3319
3323
|
t.onError(new N(B.FORMAT_ERROR, "Error formatting date.", l));
|
|
3320
3324
|
}
|
|
3321
3325
|
return [];
|
|
3322
3326
|
}
|
|
3323
|
-
function
|
|
3324
|
-
for (var
|
|
3325
|
-
|
|
3326
|
-
var o =
|
|
3327
|
+
function rn(t, e) {
|
|
3328
|
+
for (var r = [], n = 2; n < arguments.length; n++)
|
|
3329
|
+
r[n - 2] = arguments[n];
|
|
3330
|
+
var o = r[0], i = r[1], a = i === void 0 ? {} : i, s = typeof o == "string" ? new Date(o || 0) : o;
|
|
3327
3331
|
try {
|
|
3328
|
-
return tt(t, "time",
|
|
3332
|
+
return tt(t, "time", e, a).formatToParts(s);
|
|
3329
3333
|
} catch (l) {
|
|
3330
3334
|
t.onError(new N(B.FORMAT_ERROR, "Error formatting time.", l));
|
|
3331
3335
|
}
|
|
@@ -3337,14 +3341,14 @@ var nn = [
|
|
|
3337
3341
|
"fallback",
|
|
3338
3342
|
"languageDisplay"
|
|
3339
3343
|
];
|
|
3340
|
-
function on(t,
|
|
3344
|
+
function on(t, e, r, n) {
|
|
3341
3345
|
var o = t.locale, i = t.onError, a = Intl.DisplayNames;
|
|
3342
3346
|
a || i(new U(`Intl.DisplayNames is not available in this environment.
|
|
3343
3347
|
Try polyfilling it using "@formatjs/intl-displaynames"
|
|
3344
3348
|
`, C.MISSING_INTL_API));
|
|
3345
3349
|
var s = j(n, nn);
|
|
3346
3350
|
try {
|
|
3347
|
-
return
|
|
3351
|
+
return e(o, s).of(r);
|
|
3348
3352
|
} catch (l) {
|
|
3349
3353
|
i(new N(B.FORMAT_ERROR, "Error formatting display name.", l));
|
|
3350
3354
|
}
|
|
@@ -3356,15 +3360,15 @@ var an = [
|
|
|
3356
3360
|
function sn(t) {
|
|
3357
3361
|
return "".concat(Pt, "_").concat(t, "_").concat(Pt);
|
|
3358
3362
|
}
|
|
3359
|
-
function cn(t,
|
|
3363
|
+
function cn(t, e, r, n) {
|
|
3360
3364
|
n === void 0 && (n = {});
|
|
3361
|
-
var o = Qt(t,
|
|
3365
|
+
var o = Qt(t, e, r, n).reduce(function(i, a) {
|
|
3362
3366
|
var s = a.value;
|
|
3363
3367
|
return typeof s != "string" ? i.push(s) : typeof i[i.length - 1] == "string" ? i[i.length - 1] += s : i.push(s), i;
|
|
3364
3368
|
}, []);
|
|
3365
3369
|
return o.length === 1 ? o[0] : o.length === 0 ? "" : o;
|
|
3366
3370
|
}
|
|
3367
|
-
function Qt(t,
|
|
3371
|
+
function Qt(t, e, r, n) {
|
|
3368
3372
|
var o = t.locale, i = t.onError;
|
|
3369
3373
|
n === void 0 && (n = {});
|
|
3370
3374
|
var a = Intl.ListFormat;
|
|
@@ -3373,54 +3377,54 @@ Try polyfilling it using "@formatjs/intl-listformat"
|
|
|
3373
3377
|
`, C.MISSING_INTL_API));
|
|
3374
3378
|
var s = j(n, an);
|
|
3375
3379
|
try {
|
|
3376
|
-
var l = {}, u =
|
|
3380
|
+
var l = {}, u = r.map(function(c, h) {
|
|
3377
3381
|
if (typeof c == "object") {
|
|
3378
3382
|
var f = sn(h);
|
|
3379
3383
|
return l[f] = c, f;
|
|
3380
3384
|
}
|
|
3381
3385
|
return String(c);
|
|
3382
3386
|
});
|
|
3383
|
-
return
|
|
3387
|
+
return e(o, s).formatToParts(u).map(function(c) {
|
|
3384
3388
|
return c.type === "literal" ? c : p(p({}, c), { value: l[c.value] || c.value });
|
|
3385
3389
|
});
|
|
3386
3390
|
} catch (c) {
|
|
3387
3391
|
i(new N(B.FORMAT_ERROR, "Error formatting list.", c));
|
|
3388
3392
|
}
|
|
3389
|
-
return
|
|
3393
|
+
return r;
|
|
3390
3394
|
}
|
|
3391
3395
|
var un = ["type"];
|
|
3392
|
-
function ln(t,
|
|
3396
|
+
function ln(t, e, r, n) {
|
|
3393
3397
|
var o = t.locale, i = t.onError;
|
|
3394
3398
|
n === void 0 && (n = {}), Intl.PluralRules || i(new U(`Intl.PluralRules is not available in this environment.
|
|
3395
3399
|
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
3396
3400
|
`, C.MISSING_INTL_API));
|
|
3397
3401
|
var a = j(n, un);
|
|
3398
3402
|
try {
|
|
3399
|
-
return
|
|
3403
|
+
return e(o, a).select(r);
|
|
3400
3404
|
} catch (s) {
|
|
3401
3405
|
i(new mt("Error formatting plural.", o, s));
|
|
3402
3406
|
}
|
|
3403
3407
|
return "other";
|
|
3404
3408
|
}
|
|
3405
3409
|
var hn = ["numeric", "style"];
|
|
3406
|
-
function fn(t,
|
|
3410
|
+
function fn(t, e, r) {
|
|
3407
3411
|
var n = t.locale, o = t.formats, i = t.onError;
|
|
3408
|
-
|
|
3409
|
-
var a =
|
|
3410
|
-
return
|
|
3412
|
+
r === void 0 && (r = {});
|
|
3413
|
+
var a = r.format, s = !!a && gt(o, "relative", a, i) || {}, l = j(r, hn, s);
|
|
3414
|
+
return e(n, l);
|
|
3411
3415
|
}
|
|
3412
|
-
function pn(t,
|
|
3416
|
+
function pn(t, e, r, n, o) {
|
|
3413
3417
|
o === void 0 && (o = {}), n || (n = "second");
|
|
3414
3418
|
var i = Intl.RelativeTimeFormat;
|
|
3415
3419
|
i || t.onError(new U(`Intl.RelativeTimeFormat is not available in this environment.
|
|
3416
3420
|
Try polyfilling it using "@formatjs/intl-relativetimeformat"
|
|
3417
3421
|
`, C.MISSING_INTL_API));
|
|
3418
3422
|
try {
|
|
3419
|
-
return fn(t,
|
|
3423
|
+
return fn(t, e, o).format(r, n);
|
|
3420
3424
|
} catch (a) {
|
|
3421
3425
|
t.onError(new mt("Error formatting relative time.", t.locale, a));
|
|
3422
3426
|
}
|
|
3423
|
-
return String(
|
|
3427
|
+
return String(r);
|
|
3424
3428
|
}
|
|
3425
3429
|
var mn = [
|
|
3426
3430
|
"style",
|
|
@@ -3444,95 +3448,95 @@ var mn = [
|
|
|
3444
3448
|
"unitDisplay",
|
|
3445
3449
|
"numberingSystem"
|
|
3446
3450
|
];
|
|
3447
|
-
function Jt(t,
|
|
3451
|
+
function Jt(t, e, r) {
|
|
3448
3452
|
var n = t.locale, o = t.formats, i = t.onError;
|
|
3449
|
-
|
|
3450
|
-
var a =
|
|
3451
|
-
return
|
|
3453
|
+
r === void 0 && (r = {});
|
|
3454
|
+
var a = r.format, s = a && gt(o, "number", a, i) || {}, l = j(r, mn, s);
|
|
3455
|
+
return e(n, l);
|
|
3452
3456
|
}
|
|
3453
|
-
function gn(t,
|
|
3457
|
+
function gn(t, e, r, n) {
|
|
3454
3458
|
n === void 0 && (n = {});
|
|
3455
3459
|
try {
|
|
3456
|
-
return Jt(t,
|
|
3460
|
+
return Jt(t, e, n).format(r);
|
|
3457
3461
|
} catch (o) {
|
|
3458
3462
|
t.onError(new N(B.FORMAT_ERROR, "Error formatting number.", o));
|
|
3459
3463
|
}
|
|
3460
|
-
return String(
|
|
3464
|
+
return String(r);
|
|
3461
3465
|
}
|
|
3462
|
-
function dn(t,
|
|
3466
|
+
function dn(t, e, r, n) {
|
|
3463
3467
|
n === void 0 && (n = {});
|
|
3464
3468
|
try {
|
|
3465
|
-
return Jt(t,
|
|
3469
|
+
return Jt(t, e, n).formatToParts(r);
|
|
3466
3470
|
} catch (o) {
|
|
3467
3471
|
t.onError(new N(B.FORMAT_ERROR, "Error formatting number.", o));
|
|
3468
3472
|
}
|
|
3469
3473
|
return [];
|
|
3470
3474
|
}
|
|
3471
3475
|
function _n(t) {
|
|
3472
|
-
var
|
|
3473
|
-
return typeof
|
|
3476
|
+
var e = t ? t[Object.keys(t)[0]] : void 0;
|
|
3477
|
+
return typeof e == "string";
|
|
3474
3478
|
}
|
|
3475
3479
|
function En(t) {
|
|
3476
3480
|
t.onWarn && t.defaultRichTextElements && _n(t.messages || {}) && t.onWarn(`[@formatjs/intl] "defaultRichTextElements" was specified but "message" was not pre-compiled.
|
|
3477
3481
|
Please consider using "@formatjs/cli" to pre-compile your messages for performance.
|
|
3478
3482
|
For more details see https://formatjs.io/docs/getting-started/message-distribution`);
|
|
3479
3483
|
}
|
|
3480
|
-
function yn(t,
|
|
3481
|
-
var
|
|
3482
|
-
return o ? !Intl.NumberFormat.supportedLocalesOf(o).length && a ? a(new St('Missing locale data for locale: "'.concat(o, '" in Intl.NumberFormat. Using default locale: "').concat(i, '" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))) : !Intl.DateTimeFormat.supportedLocalesOf(o).length && a && a(new St('Missing locale data for locale: "'.concat(o, '" in Intl.DateTimeFormat. Using default locale: "').concat(i, '" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))) : (a && a(new
|
|
3483
|
-
formatters:
|
|
3484
|
-
formatNumber: gn.bind(null, n,
|
|
3485
|
-
formatNumberToParts: dn.bind(null, n,
|
|
3486
|
-
formatRelativeTime: pn.bind(null, n,
|
|
3487
|
-
formatDate:
|
|
3488
|
-
formatDateToParts:
|
|
3489
|
-
formatTime:
|
|
3490
|
-
formatDateTimeRange: tn.bind(null, n,
|
|
3491
|
-
formatTimeToParts:
|
|
3492
|
-
formatPlural: ln.bind(null, n,
|
|
3484
|
+
function yn(t, e) {
|
|
3485
|
+
var r = Wr(e), n = p(p({}, qr), t), o = n.locale, i = n.defaultLocale, a = n.onError;
|
|
3486
|
+
return o ? !Intl.NumberFormat.supportedLocalesOf(o).length && a ? a(new St('Missing locale data for locale: "'.concat(o, '" in Intl.NumberFormat. Using default locale: "').concat(i, '" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))) : !Intl.DateTimeFormat.supportedLocalesOf(o).length && a && a(new St('Missing locale data for locale: "'.concat(o, '" in Intl.DateTimeFormat. Using default locale: "').concat(i, '" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))) : (a && a(new Xr('"locale" was not configured, using "'.concat(i, '" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details'))), n.locale = n.defaultLocale || "en"), En(n), p(p({}, n), {
|
|
3487
|
+
formatters: r,
|
|
3488
|
+
formatNumber: gn.bind(null, n, r.getNumberFormat),
|
|
3489
|
+
formatNumberToParts: dn.bind(null, n, r.getNumberFormat),
|
|
3490
|
+
formatRelativeTime: pn.bind(null, n, r.getRelativeTimeFormat),
|
|
3491
|
+
formatDate: Qr.bind(null, n, r.getDateTimeFormat),
|
|
3492
|
+
formatDateToParts: en.bind(null, n, r.getDateTimeFormat),
|
|
3493
|
+
formatTime: Jr.bind(null, n, r.getDateTimeFormat),
|
|
3494
|
+
formatDateTimeRange: tn.bind(null, n, r.getDateTimeFormat),
|
|
3495
|
+
formatTimeToParts: rn.bind(null, n, r.getDateTimeFormat),
|
|
3496
|
+
formatPlural: ln.bind(null, n, r.getPluralRules),
|
|
3493
3497
|
// @ts-expect-error TODO: will get to this later
|
|
3494
|
-
formatMessage: Rt.bind(null, n,
|
|
3498
|
+
formatMessage: Rt.bind(null, n, r),
|
|
3495
3499
|
// @ts-expect-error TODO: will get to this later
|
|
3496
|
-
$t: Rt.bind(null, n,
|
|
3497
|
-
formatList: cn.bind(null, n,
|
|
3498
|
-
formatListToParts: Qt.bind(null, n,
|
|
3499
|
-
formatDisplayName: on.bind(null, n,
|
|
3500
|
+
$t: Rt.bind(null, n, r),
|
|
3501
|
+
formatList: cn.bind(null, n, r.getListFormat),
|
|
3502
|
+
formatListToParts: Qt.bind(null, n, r.getListFormat),
|
|
3503
|
+
formatDisplayName: on.bind(null, n, r.getDisplayNames)
|
|
3500
3504
|
});
|
|
3501
3505
|
}
|
|
3502
3506
|
var bn = K;
|
|
3503
3507
|
K.flatten = K;
|
|
3504
|
-
K.unflatten =
|
|
3505
|
-
function
|
|
3508
|
+
K.unflatten = re;
|
|
3509
|
+
function te(t) {
|
|
3506
3510
|
return t && t.constructor && typeof t.constructor.isBuffer == "function" && t.constructor.isBuffer(t);
|
|
3507
3511
|
}
|
|
3508
|
-
function
|
|
3512
|
+
function ee(t) {
|
|
3509
3513
|
return t;
|
|
3510
3514
|
}
|
|
3511
|
-
function K(t,
|
|
3512
|
-
|
|
3513
|
-
const
|
|
3515
|
+
function K(t, e) {
|
|
3516
|
+
e = e || {};
|
|
3517
|
+
const r = e.delimiter || ".", n = e.maxDepth, o = e.transformKey || ee, i = {};
|
|
3514
3518
|
function a(s, l, u) {
|
|
3515
3519
|
u = u || 1, Object.keys(s).forEach(function(c) {
|
|
3516
|
-
const h = s[c], f =
|
|
3517
|
-
if (!f && !b && _ && Object.keys(h).length && (!
|
|
3520
|
+
const h = s[c], f = e.safe && Array.isArray(h), m = Object.prototype.toString.call(h), b = te(h), _ = m === "[object Object]" || m === "[object Array]", v = l ? l + r + o(c) : o(c);
|
|
3521
|
+
if (!f && !b && _ && Object.keys(h).length && (!e.maxDepth || u < n))
|
|
3518
3522
|
return a(h, v, u + 1);
|
|
3519
3523
|
i[v] = h;
|
|
3520
3524
|
});
|
|
3521
3525
|
}
|
|
3522
3526
|
return a(t), i;
|
|
3523
3527
|
}
|
|
3524
|
-
function
|
|
3525
|
-
|
|
3526
|
-
const
|
|
3527
|
-
if (
|
|
3528
|
+
function re(t, e) {
|
|
3529
|
+
e = e || {};
|
|
3530
|
+
const r = e.delimiter || ".", n = e.overwrite || !1, o = e.transformKey || ee, i = {};
|
|
3531
|
+
if (te(t) || Object.prototype.toString.call(t) !== "[object Object]")
|
|
3528
3532
|
return t;
|
|
3529
3533
|
function a(u) {
|
|
3530
3534
|
const c = Number(u);
|
|
3531
|
-
return isNaN(c) || u.indexOf(".") !== -1 ||
|
|
3535
|
+
return isNaN(c) || u.indexOf(".") !== -1 || e.object ? u : c;
|
|
3532
3536
|
}
|
|
3533
3537
|
function s(u, c, h) {
|
|
3534
3538
|
return Object.keys(h).reduce(function(f, m) {
|
|
3535
|
-
return f[u +
|
|
3539
|
+
return f[u + r + m] = h[m], f;
|
|
3536
3540
|
}, c);
|
|
3537
3541
|
}
|
|
3538
3542
|
function l(u) {
|
|
@@ -3550,10 +3554,10 @@ function er(t, r) {
|
|
|
3550
3554
|
return !(h === "[object Object]" || h === "[object Array]") || l(t[c]) ? (u[c] = t[c], u) : s(
|
|
3551
3555
|
c,
|
|
3552
3556
|
u,
|
|
3553
|
-
K(t[c],
|
|
3557
|
+
K(t[c], e)
|
|
3554
3558
|
);
|
|
3555
3559
|
}, {}), Object.keys(t).forEach(function(u) {
|
|
3556
|
-
const c = u.split(
|
|
3560
|
+
const c = u.split(r).map(o);
|
|
3557
3561
|
let h = a(c.shift()), f = a(c[0]), m = i;
|
|
3558
3562
|
for (; f !== void 0; ) {
|
|
3559
3563
|
if (h === "__proto__")
|
|
@@ -3561,16 +3565,16 @@ function er(t, r) {
|
|
|
3561
3565
|
const b = Object.prototype.toString.call(m[h]), _ = b === "[object Object]" || b === "[object Array]";
|
|
3562
3566
|
if (!n && !_ && typeof m[h] < "u")
|
|
3563
3567
|
return;
|
|
3564
|
-
(n && !_ || !n && m[h] == null) && (m[h] = typeof f == "number" && !
|
|
3568
|
+
(n && !_ || !n && m[h] == null) && (m[h] = typeof f == "number" && !e.object ? [] : {}), m = m[h], c.length > 0 && (h = a(c.shift()), f = a(c[0]));
|
|
3565
3569
|
}
|
|
3566
|
-
m[h] =
|
|
3570
|
+
m[h] = re(t[u], e);
|
|
3567
3571
|
}), i;
|
|
3568
3572
|
}
|
|
3569
|
-
const vn = Wt(), Tn = (t,
|
|
3573
|
+
const vn = Wt(), Tn = (t, e, r = !1) => {
|
|
3570
3574
|
const n = yn(
|
|
3571
3575
|
{
|
|
3572
3576
|
locale: t,
|
|
3573
|
-
messages: bn.flatten(
|
|
3577
|
+
messages: bn.flatten(e, {
|
|
3574
3578
|
safe: !0
|
|
3575
3579
|
// Preserve arrays
|
|
3576
3580
|
})
|
|
@@ -3582,7 +3586,7 @@ const vn = Wt(), Tn = (t, r, e = !1) => {
|
|
|
3582
3586
|
te: (i) => !!n.messages[i],
|
|
3583
3587
|
tm: (i) => n.messages[i] || [],
|
|
3584
3588
|
...n,
|
|
3585
|
-
source:
|
|
3589
|
+
source: e
|
|
3586
3590
|
};
|
|
3587
3591
|
}, Hn = (t) => w({
|
|
3588
3592
|
name: "I18nT",
|
|
@@ -3596,7 +3600,7 @@ const vn = Wt(), Tn = (t, r, e = !1) => {
|
|
|
3596
3600
|
default: "span"
|
|
3597
3601
|
}
|
|
3598
3602
|
},
|
|
3599
|
-
setup(
|
|
3603
|
+
setup(e, { slots: r }) {
|
|
3600
3604
|
const n = (o) => {
|
|
3601
3605
|
if (!o)
|
|
3602
3606
|
return [];
|
|
@@ -3604,20 +3608,20 @@ const vn = Wt(), Tn = (t, r, e = !1) => {
|
|
|
3604
3608
|
return o.split(i).filter(Boolean);
|
|
3605
3609
|
};
|
|
3606
3610
|
return () => {
|
|
3607
|
-
const o = Object.keys(
|
|
3611
|
+
const o = Object.keys(r).filter((s) => s !== "_"), i = t.messages[e.keypath].toString();
|
|
3608
3612
|
let a = n(i);
|
|
3609
3613
|
return a = a.filter((s) => s !== ""), a.forEach((s, l) => {
|
|
3610
3614
|
if (!s.startsWith("{") && !s.endsWith("}"))
|
|
3611
3615
|
return;
|
|
3612
3616
|
const u = s.replace(/[\{\}]/g, "");
|
|
3613
|
-
u === "0" &&
|
|
3614
|
-
}),
|
|
3617
|
+
u === "0" && r.default ? a[l] = r.default() : o.includes(u) && r[u] && (a[l] = r[u]());
|
|
3618
|
+
}), ue(e.tag, e, a);
|
|
3615
3619
|
};
|
|
3616
3620
|
}
|
|
3617
3621
|
}), Bn = {
|
|
3618
|
-
install(t,
|
|
3619
|
-
const { i18n:
|
|
3620
|
-
t.component("I18nT", Hn(
|
|
3622
|
+
install(t, e) {
|
|
3623
|
+
const { i18n: r } = e;
|
|
3624
|
+
t.component("I18nT", Hn(r));
|
|
3621
3625
|
}
|
|
3622
3626
|
}, An = {
|
|
3623
3627
|
error: "Error: Markdown content missing"
|
|
@@ -3633,10 +3637,10 @@ function In() {
|
|
|
3633
3637
|
}
|
|
3634
3638
|
function Nn() {
|
|
3635
3639
|
return {
|
|
3636
|
-
hasRequiredProps: (
|
|
3640
|
+
hasRequiredProps: (e, r) => {
|
|
3637
3641
|
let n = !0;
|
|
3638
|
-
return
|
|
3639
|
-
|
|
3642
|
+
return e.forEach((o) => {
|
|
3643
|
+
r.forEach((i) => {
|
|
3640
3644
|
o[i] || (n = !1);
|
|
3641
3645
|
});
|
|
3642
3646
|
}), n;
|
|
@@ -3646,13 +3650,32 @@ function Nn() {
|
|
|
3646
3650
|
const Rn = {
|
|
3647
3651
|
useI18n: In,
|
|
3648
3652
|
useUtilities: Nn
|
|
3649
|
-
}
|
|
3653
|
+
};
|
|
3654
|
+
function Pn(t, e = "") {
|
|
3655
|
+
return t.toLowerCase().trim().replace(/ /g, "-").replace(/[^\w-]+/g, "") + e;
|
|
3656
|
+
}
|
|
3657
|
+
function Ln(t) {
|
|
3658
|
+
if (!t)
|
|
3659
|
+
return t;
|
|
3660
|
+
const e = /* @__PURE__ */ new Map();
|
|
3661
|
+
return t.map((r) => r.type === "heading" ? On(r, e) : r);
|
|
3662
|
+
}
|
|
3663
|
+
function On(t, e, r = "doc-heading-") {
|
|
3664
|
+
const n = t.children[0].text, o = e.get(n);
|
|
3665
|
+
e.set(n, (o || 0) + 1);
|
|
3666
|
+
const i = o && o > 1 ? `-${o}` : "", a = r + Pn(n, i);
|
|
3667
|
+
return {
|
|
3668
|
+
...t,
|
|
3669
|
+
slug: a
|
|
3670
|
+
};
|
|
3671
|
+
}
|
|
3672
|
+
const Mn = {
|
|
3650
3673
|
class: "document-viewer",
|
|
3651
3674
|
"data-testid": "document-viewer"
|
|
3652
|
-
},
|
|
3675
|
+
}, Cn = {
|
|
3653
3676
|
key: 1,
|
|
3654
3677
|
"data-testid": "document-viewer-error"
|
|
3655
|
-
},
|
|
3678
|
+
}, wn = /* @__PURE__ */ w({
|
|
3656
3679
|
__name: "DocumentViewer",
|
|
3657
3680
|
props: {
|
|
3658
3681
|
document: {
|
|
@@ -3661,20 +3684,24 @@ const Rn = {
|
|
|
3661
3684
|
}
|
|
3662
3685
|
},
|
|
3663
3686
|
setup(t) {
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3687
|
+
var a;
|
|
3688
|
+
const e = t, { i18n: r } = Rn.useI18n(), n = le(() => !!e.document), o = Ln((a = e.document) == null ? void 0 : a.children), i = () => {
|
|
3689
|
+
var s;
|
|
3690
|
+
return (s = e.document) != null && s.children ? Ot(o) : null;
|
|
3667
3691
|
};
|
|
3668
|
-
return (
|
|
3669
|
-
k(n) ? (y(), $(
|
|
3692
|
+
return (s, l) => (y(), S("div", Mn, [
|
|
3693
|
+
k(n) ? (y(), $(i, { key: 0 })) : (y(), S("div", Cn, Lt(k(r).t("docViewer.error")), 1))
|
|
3670
3694
|
]));
|
|
3671
3695
|
}
|
|
3672
3696
|
});
|
|
3673
|
-
const
|
|
3697
|
+
const Un = /* @__PURE__ */ R(wn, [["__scopeId", "data-v-6607def2"]]);
|
|
3674
3698
|
export {
|
|
3675
3699
|
Q as TableCellAlign,
|
|
3676
3700
|
x as TableRowSection,
|
|
3677
|
-
|
|
3678
|
-
|
|
3701
|
+
On as addSlug,
|
|
3702
|
+
Ln as addUniqueHeadingSlugs,
|
|
3703
|
+
Un as default,
|
|
3704
|
+
he as isTextNode,
|
|
3705
|
+
Pn as toSlug
|
|
3679
3706
|
};
|
|
3680
3707
|
//# sourceMappingURL=document-viewer.es.js.map
|