xcstrings-cli 2.5.1 → 2.6.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.
Files changed (3) hide show
  1. package/README.md +42 -26
  2. package/dist/index.js +1948 -1878
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,1868 +1,1884 @@
1
1
  #!/usr/bin/env node
2
- import Nr from "yargs";
3
- import { hideBin as Rr } from "yargs/helpers";
4
- import { resolve as Oe, relative as we } from "node:path";
5
- import { cosmiconfig as Mr } from "cosmiconfig";
6
- import De from "json5";
7
- import { select as Pr, checkbox as an, confirm as Dr } from "@inquirer/prompts";
8
- import S from "chalk";
9
- import { readFile as $r, writeFile as Nn, readdir as Rn } from "node:fs/promises";
10
- import { XcodeProject as zr } from "@bacons/xcode";
11
- const Le = "xcstrings-cli", sn = Mr(Le, {
12
- searchPlaces: [
13
- `${Le}.json`,
14
- `${Le}.json5`
15
- ],
16
- loaders: {
17
- ".json5": async (e, n) => De.parse(n)
18
- },
19
- cache: !1
20
- });
21
- async function We(e) {
22
- if (e) {
23
- const r = await sn.load(e);
24
- return r ? r.config : null;
25
- }
26
- const n = await sn.search();
27
- return n ? n.config : null;
2
+ import Pr from "yargs";
3
+ import { hideBin as Mr } from "yargs/helpers";
4
+ import { resolve as je, relative as Ae } from "node:path";
5
+ import { cosmiconfig as Dr } from "cosmiconfig";
6
+ import Be from "json5";
7
+ import { select as $r, editor as zr, checkbox as un, confirm as Br } from "@inquirer/prompts";
8
+ import k from "chalk";
9
+ import { readFile as Ur, writeFile as Rn, readdir as Pn } from "node:fs/promises";
10
+ import { XcodeProject as Yr } from "@bacons/xcode";
11
+ function Mn(e) {
12
+ return typeof e > "u" || e === null;
28
13
  }
29
- function cn(e, n) {
30
- if (!e || e.length === 0) return null;
31
- for (const r of e)
32
- if (typeof r != "string" && r.alias === n)
33
- return r.path;
34
- return null;
14
+ function Hr(e) {
15
+ return typeof e == "object" && e !== null;
35
16
  }
36
- async function Br(e, n, r) {
37
- const i = n?.xcstringsPaths, t = i?.some((s) => typeof s != "string") ?? !1, o = e.startsWith("alias:") ? e.slice(6) : null;
38
- if (o) {
39
- const s = cn(i, o);
40
- if (!s)
41
- throw new Error(`Unknown alias: ${o}`);
42
- return s;
43
- }
44
- const l = cn(i, e);
45
- if (l)
46
- return l;
47
- const a = !e.includes("/") && !e.endsWith(".xcstrings");
48
- if (t && a)
49
- throw new Error(`Unknown alias: ${e}`);
50
- if (e === r && i && i.length > 0) {
51
- if (i.length === 1) {
52
- const u = i[0];
53
- return typeof u == "string" ? u : u.path;
54
- }
55
- const s = i.map((u) => typeof u == "string" ? { name: u, value: u } : { name: `${u.alias} (${u.path})`, value: u.path });
56
- return await Pr({
57
- message: "Select xcstrings file:",
58
- choices: s
59
- });
60
- }
17
+ function Kr(e) {
18
+ return Array.isArray(e) ? e : Mn(e) ? [] : [e];
19
+ }
20
+ function Wr(e, n) {
21
+ var r, i, t, o;
22
+ if (n)
23
+ for (o = Object.keys(n), r = 0, i = o.length; r < i; r += 1)
24
+ t = o[r], e[t] = n[t];
61
25
  return e;
62
26
  }
63
- const $e = ["translated", "needs_review", "new", "stale"];
64
- async function me(e) {
65
- const n = await $r(e, "utf-8");
66
- return JSON.parse(n);
27
+ function qr(e, n) {
28
+ var r = "", i;
29
+ for (i = 0; i < n; i += 1)
30
+ r += e;
31
+ return r;
67
32
  }
68
- async function Mn(e, n) {
69
- const r = JSON.stringify(n, null, 2), i = Ur(r);
70
- await Nn(e, i + `
71
- `, "utf-8");
33
+ function Gr(e) {
34
+ return e === 0 && Number.NEGATIVE_INFINITY === 1 / e;
72
35
  }
73
- function Ur(e) {
74
- let n = "", r = !1, i = !1;
75
- for (let t = 0; t < e.length; t++) {
76
- const o = e[t];
77
- if (r && o === "\\" && !i) {
78
- i = !0, n += o;
79
- continue;
80
- }
81
- if (i) {
82
- i = !1, n += o;
83
- continue;
84
- }
85
- if (o === '"') {
86
- r = !r, n += o;
87
- continue;
88
- }
89
- if (!r && o === ":") {
90
- n += " :";
91
- continue;
36
+ var Vr = Mn, Xr = Hr, Qr = Kr, Jr = qr, Zr = Gr, ei = Wr, T = {
37
+ isNothing: Vr,
38
+ isObject: Xr,
39
+ toArray: Qr,
40
+ repeat: Jr,
41
+ isNegativeZero: Zr,
42
+ extend: ei
43
+ };
44
+ function Dn(e, n) {
45
+ var r = "", i = e.reason || "(unknown reason)";
46
+ return e.mark ? (e.mark.name && (r += 'in "' + e.mark.name + '" '), r += "(" + (e.mark.line + 1) + ":" + (e.mark.column + 1) + ")", !n && e.mark.snippet && (r += `
47
+
48
+ ` + e.mark.snippet), i + " " + r) : i;
49
+ }
50
+ function de(e, n) {
51
+ Error.call(this), this.name = "YAMLException", this.reason = e, this.mark = n, this.message = Dn(this, !1), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack || "";
52
+ }
53
+ de.prototype = Object.create(Error.prototype);
54
+ de.prototype.constructor = de;
55
+ de.prototype.toString = function(n) {
56
+ return this.name + ": " + Dn(this, n);
57
+ };
58
+ var M = de;
59
+ function Re(e, n, r, i, t) {
60
+ var o = "", l = "", a = Math.floor(t / 2) - 1;
61
+ return i - n > a && (o = " ... ", n = i - a + o.length), r - i > a && (l = " ...", r = i + a - l.length), {
62
+ str: o + e.slice(n, r).replace(/\t/g, "→") + l,
63
+ pos: i - n + o.length
64
+ // relative position
65
+ };
66
+ }
67
+ function Pe(e, n) {
68
+ return T.repeat(" ", n - e.length) + e;
69
+ }
70
+ function ni(e, n) {
71
+ if (n = Object.create(n || null), !e.buffer) return null;
72
+ n.maxLength || (n.maxLength = 79), typeof n.indent != "number" && (n.indent = 1), typeof n.linesBefore != "number" && (n.linesBefore = 3), typeof n.linesAfter != "number" && (n.linesAfter = 2);
73
+ for (var r = /\r?\n|\r|\0/g, i = [0], t = [], o, l = -1; o = r.exec(e.buffer); )
74
+ t.push(o.index), i.push(o.index + o[0].length), e.position <= o.index && l < 0 && (l = i.length - 2);
75
+ l < 0 && (l = i.length - 1);
76
+ var a = "", s, c, u = Math.min(e.line + n.linesAfter, t.length).toString().length, f = n.maxLength - (n.indent + u + 3);
77
+ for (s = 1; s <= n.linesBefore && !(l - s < 0); s++)
78
+ c = Re(
79
+ e.buffer,
80
+ i[l - s],
81
+ t[l - s],
82
+ e.position - (i[l] - i[l - s]),
83
+ f
84
+ ), a = T.repeat(" ", n.indent) + Pe((e.line - s + 1).toString(), u) + " | " + c.str + `
85
+ ` + a;
86
+ for (c = Re(e.buffer, i[l], t[l], e.position, f), a += T.repeat(" ", n.indent) + Pe((e.line + 1).toString(), u) + " | " + c.str + `
87
+ `, a += T.repeat("-", n.indent + u + 3 + c.pos) + `^
88
+ `, s = 1; s <= n.linesAfter && !(l + s >= t.length); s++)
89
+ c = Re(
90
+ e.buffer,
91
+ i[l + s],
92
+ t[l + s],
93
+ e.position - (i[l] - i[l + s]),
94
+ f
95
+ ), a += T.repeat(" ", n.indent) + Pe((e.line + s + 1).toString(), u) + " | " + c.str + `
96
+ `;
97
+ return a.replace(/\n$/, "");
98
+ }
99
+ var ri = ni, ii = [
100
+ "kind",
101
+ "multi",
102
+ "resolve",
103
+ "construct",
104
+ "instanceOf",
105
+ "predicate",
106
+ "represent",
107
+ "representName",
108
+ "defaultStyle",
109
+ "styleAliases"
110
+ ], ti = [
111
+ "scalar",
112
+ "sequence",
113
+ "mapping"
114
+ ];
115
+ function oi(e) {
116
+ var n = {};
117
+ return e !== null && Object.keys(e).forEach(function(r) {
118
+ e[r].forEach(function(i) {
119
+ n[String(i)] = r;
120
+ });
121
+ }), n;
122
+ }
123
+ function li(e, n) {
124
+ if (n = n || {}, Object.keys(n).forEach(function(r) {
125
+ if (ii.indexOf(r) === -1)
126
+ throw new M('Unknown option "' + r + '" is met in definition of "' + e + '" YAML type.');
127
+ }), this.options = n, this.tag = e, this.kind = n.kind || null, this.resolve = n.resolve || function() {
128
+ return !0;
129
+ }, this.construct = n.construct || function(r) {
130
+ return r;
131
+ }, this.instanceOf = n.instanceOf || null, this.predicate = n.predicate || null, this.represent = n.represent || null, this.representName = n.representName || null, this.defaultStyle = n.defaultStyle || null, this.multi = n.multi || !1, this.styleAliases = oi(n.styleAliases || null), ti.indexOf(this.kind) === -1)
132
+ throw new M('Unknown kind "' + this.kind + '" is specified for "' + e + '" YAML type.');
133
+ }
134
+ var j = li;
135
+ function fn(e, n) {
136
+ var r = [];
137
+ return e[n].forEach(function(i) {
138
+ var t = r.length;
139
+ r.forEach(function(o, l) {
140
+ o.tag === i.tag && o.kind === i.kind && o.multi === i.multi && (t = l);
141
+ }), r[t] = i;
142
+ }), r;
143
+ }
144
+ function ai() {
145
+ var e = {
146
+ scalar: {},
147
+ sequence: {},
148
+ mapping: {},
149
+ fallback: {},
150
+ multi: {
151
+ scalar: [],
152
+ sequence: [],
153
+ mapping: [],
154
+ fallback: []
92
155
  }
93
- n += o;
156
+ }, n, r;
157
+ function i(t) {
158
+ t.multi ? (e.multi[t.kind].push(t), e.multi.fallback.push(t)) : e[t.kind][t.tag] = e.fallback[t.tag] = t;
94
159
  }
95
- return n;
160
+ for (n = 0, r = arguments.length; n < r; n += 1)
161
+ arguments[n].forEach(i);
162
+ return e;
96
163
  }
97
- function Yr(e) {
98
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
164
+ function Ue(e) {
165
+ return this.extend(e);
99
166
  }
100
- var ce = { exports: {} }, je, un;
101
- function Hr() {
102
- if (un) return je;
103
- un = 1;
104
- function e(r) {
105
- try {
106
- return JSON.stringify(r);
107
- } catch {
108
- return '"[Circular]"';
109
- }
167
+ Ue.prototype.extend = function(n) {
168
+ var r = [], i = [];
169
+ if (n instanceof j)
170
+ i.push(n);
171
+ else if (Array.isArray(n))
172
+ i = i.concat(n);
173
+ else if (n && (Array.isArray(n.implicit) || Array.isArray(n.explicit)))
174
+ n.implicit && (r = r.concat(n.implicit)), n.explicit && (i = i.concat(n.explicit));
175
+ else
176
+ throw new M("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
177
+ r.forEach(function(o) {
178
+ if (!(o instanceof j))
179
+ throw new M("Specified list of YAML types (or a single Type object) contains a non-Type object.");
180
+ if (o.loadKind && o.loadKind !== "scalar")
181
+ throw new M("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
182
+ if (o.multi)
183
+ throw new M("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
184
+ }), i.forEach(function(o) {
185
+ if (!(o instanceof j))
186
+ throw new M("Specified list of YAML types (or a single Type object) contains a non-Type object.");
187
+ });
188
+ var t = Object.create(Ue.prototype);
189
+ return t.implicit = (this.implicit || []).concat(r), t.explicit = (this.explicit || []).concat(i), t.compiledImplicit = fn(t, "implicit"), t.compiledExplicit = fn(t, "explicit"), t.compiledTypeMap = ai(t.compiledImplicit, t.compiledExplicit), t;
190
+ };
191
+ var $n = Ue, zn = new j("tag:yaml.org,2002:str", {
192
+ kind: "scalar",
193
+ construct: function(e) {
194
+ return e !== null ? e : "";
110
195
  }
111
- je = n;
112
- function n(r, i, t) {
113
- var o = t && t.stringify || e, l = 1;
114
- if (typeof r == "object" && r !== null) {
115
- var a = i.length + l;
116
- if (a === 1) return r;
117
- var s = new Array(a);
118
- s[0] = o(r);
119
- for (var c = 1; c < a; c++)
120
- s[c] = o(i[c]);
121
- return s.join(" ");
122
- }
123
- if (typeof r != "string")
124
- return r;
125
- var u = i.length;
126
- if (u === 0) return r;
127
- for (var f = "", h = 1 - l, g = -1, y = r && r.length || 0, d = 0; d < y; ) {
128
- if (r.charCodeAt(d) === 37 && d + 1 < y) {
129
- switch (g = g > -1 ? g : 0, r.charCodeAt(d + 1)) {
130
- case 100:
131
- // 'd'
132
- case 102:
133
- if (h >= u || i[h] == null) break;
134
- g < d && (f += r.slice(g, d)), f += Number(i[h]), g = d + 2, d++;
135
- break;
136
- case 105:
137
- if (h >= u || i[h] == null) break;
138
- g < d && (f += r.slice(g, d)), f += Math.floor(Number(i[h])), g = d + 2, d++;
139
- break;
140
- case 79:
141
- // 'O'
142
- case 111:
143
- // 'o'
144
- case 106:
145
- if (h >= u || i[h] === void 0) break;
146
- g < d && (f += r.slice(g, d));
147
- var b = typeof i[h];
148
- if (b === "string") {
149
- f += "'" + i[h] + "'", g = d + 2, d++;
150
- break;
151
- }
152
- if (b === "function") {
153
- f += i[h].name || "<anonymous>", g = d + 2, d++;
154
- break;
155
- }
156
- f += o(i[h]), g = d + 2, d++;
157
- break;
158
- case 115:
159
- if (h >= u)
160
- break;
161
- g < d && (f += r.slice(g, d)), f += String(i[h]), g = d + 2, d++;
162
- break;
163
- case 37:
164
- g < d && (f += r.slice(g, d)), f += "%", g = d + 2, d++, h--;
165
- break;
166
- }
167
- ++h;
168
- }
169
- ++d;
170
- }
171
- return g === -1 ? r : (g < y && (f += r.slice(g)), f);
196
+ }), Bn = new j("tag:yaml.org,2002:seq", {
197
+ kind: "sequence",
198
+ construct: function(e) {
199
+ return e !== null ? e : [];
172
200
  }
173
- return je;
174
- }
175
- var fn;
176
- function Kr() {
177
- if (fn) return ce.exports;
178
- fn = 1;
179
- const e = Hr();
180
- ce.exports = u;
181
- const n = Lr().console || {}, r = {
182
- mapHttpRequest: V,
183
- mapHttpResponse: V,
184
- wrapRequestSerializer: I,
185
- wrapResponseSerializer: I,
186
- wrapErrorSerializer: I,
187
- req: V,
188
- res: V,
189
- err: R,
190
- errWithCause: R
191
- };
192
- function i(p, m) {
193
- return p === "silent" ? 1 / 0 : m.levels.values[p];
194
- }
195
- const t = Symbol("pino.logFuncs"), o = Symbol("pino.hierarchy"), l = {
196
- error: "log",
197
- fatal: "error",
198
- warn: "error",
199
- info: "log",
200
- debug: "log",
201
- trace: "log"
202
- };
203
- function a(p, m) {
204
- const A = {
205
- logger: m,
206
- parent: p[o]
207
- };
208
- m[o] = A;
209
- }
210
- function s(p, m, A) {
211
- const k = {};
212
- m.forEach((E) => {
213
- k[E] = A[E] ? A[E] : n[E] || n[l[E] || "log"] || se;
214
- }), p[t] = k;
215
- }
216
- function c(p, m) {
217
- return Array.isArray(p) ? p.filter(function(k) {
218
- return k !== "!stdSerializers.err";
219
- }) : p === !0 ? Object.keys(m) : !1;
201
+ }), Un = new j("tag:yaml.org,2002:map", {
202
+ kind: "mapping",
203
+ construct: function(e) {
204
+ return e !== null ? e : {};
220
205
  }
221
- function u(p) {
222
- p = p || {}, p.browser = p.browser || {};
223
- const m = p.browser.transmit;
224
- if (m && typeof m.send != "function")
225
- throw Error("pino: transmit option must have a send function");
226
- const A = p.browser.write || n;
227
- p.browser.write && (p.browser.asObject = !0);
228
- const k = p.serializers || {}, E = c(p.browser.serialize, k);
229
- let z = p.browser.serialize;
230
- Array.isArray(p.browser.serialize) && p.browser.serialize.indexOf("!stdSerializers.err") > -1 && (z = !1);
231
- const K = Object.keys(p.customLevels || {}), O = ["error", "fatal", "warn", "info", "debug", "trace"].concat(K);
232
- typeof A == "function" && O.forEach(function(B) {
233
- A[B] = A;
234
- }), (p.enabled === !1 || p.browser.disabled) && (p.level = "silent");
235
- const M = p.level || "info", w = Object.create(A);
236
- w.log || (w.log = se), s(w, O, A), a({}, w), Object.defineProperty(w, "levelVal", {
237
- get: ve
238
- }), Object.defineProperty(w, "level", {
239
- get: Z,
240
- set: jr
241
- });
242
- const Y = {
243
- transmit: m,
244
- serialize: E,
245
- asObject: p.browser.asObject,
246
- formatters: p.browser.formatters,
247
- levels: O,
248
- timestamp: J(p)
249
- };
250
- w.levels = f(p), w.level = M, w.setMaxListeners = w.getMaxListeners = w.emit = w.addListener = w.on = w.prependListener = w.once = w.prependOnceListener = w.removeListener = w.removeAllListeners = w.listeners = w.listenerCount = w.eventNames = w.write = w.flush = se, w.serializers = k, w._serialize = E, w._stdErrSerialize = z, w.child = Ir, m && (w._logEvent = L());
251
- function ve() {
252
- return i(this.level, this);
206
+ }), Yn = new $n({
207
+ explicit: [
208
+ zn,
209
+ Bn,
210
+ Un
211
+ ]
212
+ });
213
+ function si(e) {
214
+ if (e === null) return !0;
215
+ var n = e.length;
216
+ return n === 1 && e === "~" || n === 4 && (e === "null" || e === "Null" || e === "NULL");
217
+ }
218
+ function ci() {
219
+ return null;
220
+ }
221
+ function ui(e) {
222
+ return e === null;
223
+ }
224
+ var Hn = new j("tag:yaml.org,2002:null", {
225
+ kind: "scalar",
226
+ resolve: si,
227
+ construct: ci,
228
+ predicate: ui,
229
+ represent: {
230
+ canonical: function() {
231
+ return "~";
232
+ },
233
+ lowercase: function() {
234
+ return "null";
235
+ },
236
+ uppercase: function() {
237
+ return "NULL";
238
+ },
239
+ camelcase: function() {
240
+ return "Null";
241
+ },
242
+ empty: function() {
243
+ return "";
253
244
  }
254
- function Z() {
255
- return this._level;
245
+ },
246
+ defaultStyle: "lowercase"
247
+ });
248
+ function fi(e) {
249
+ if (e === null) return !1;
250
+ var n = e.length;
251
+ return n === 4 && (e === "true" || e === "True" || e === "TRUE") || n === 5 && (e === "false" || e === "False" || e === "FALSE");
252
+ }
253
+ function pi(e) {
254
+ return e === "true" || e === "True" || e === "TRUE";
255
+ }
256
+ function di(e) {
257
+ return Object.prototype.toString.call(e) === "[object Boolean]";
258
+ }
259
+ var Kn = new j("tag:yaml.org,2002:bool", {
260
+ kind: "scalar",
261
+ resolve: fi,
262
+ construct: pi,
263
+ predicate: di,
264
+ represent: {
265
+ lowercase: function(e) {
266
+ return e ? "true" : "false";
267
+ },
268
+ uppercase: function(e) {
269
+ return e ? "TRUE" : "FALSE";
270
+ },
271
+ camelcase: function(e) {
272
+ return e ? "True" : "False";
256
273
  }
257
- function jr(B) {
258
- if (B !== "silent" && !this.levels.values[B])
259
- throw Error("unknown level " + B);
260
- this._level = B, y(this, Y, w, "error"), y(this, Y, w, "fatal"), y(this, Y, w, "warn"), y(this, Y, w, "info"), y(this, Y, w, "debug"), y(this, Y, w, "trace"), K.forEach((ee) => {
261
- y(this, Y, w, ee);
262
- });
274
+ },
275
+ defaultStyle: "lowercase"
276
+ });
277
+ function hi(e) {
278
+ return 48 <= e && e <= 57 || 65 <= e && e <= 70 || 97 <= e && e <= 102;
279
+ }
280
+ function gi(e) {
281
+ return 48 <= e && e <= 55;
282
+ }
283
+ function mi(e) {
284
+ return 48 <= e && e <= 57;
285
+ }
286
+ function yi(e) {
287
+ if (e === null) return !1;
288
+ var n = e.length, r = 0, i = !1, t;
289
+ if (!n) return !1;
290
+ if (t = e[r], (t === "-" || t === "+") && (t = e[++r]), t === "0") {
291
+ if (r + 1 === n) return !0;
292
+ if (t = e[++r], t === "b") {
293
+ for (r++; r < n; r++)
294
+ if (t = e[r], t !== "_") {
295
+ if (t !== "0" && t !== "1") return !1;
296
+ i = !0;
297
+ }
298
+ return i && t !== "_";
263
299
  }
264
- function Ir(B, ee) {
265
- if (!B)
266
- throw new Error("missing bindings for child Pino");
267
- ee = ee || {}, E && B.serializers && (ee.serializers = B.serializers);
268
- const rn = ee.serializers;
269
- if (E && rn) {
270
- var xe = Object.assign({}, k, rn), tn = p.browser.serialize === !0 ? Object.keys(xe) : E;
271
- delete B.serializers, x([B], tn, xe, this._stdErrSerialize);
272
- }
273
- function on(ln) {
274
- this._childLevel = (ln._childLevel | 0) + 1, this.bindings = B, xe && (this.serializers = xe, this._serialize = tn), m && (this._logEvent = L(
275
- [].concat(ln._logEvent.bindings, B)
276
- ));
277
- }
278
- on.prototype = this;
279
- const Te = new on(this);
280
- return a(this, Te), Te.level = this.level, Te;
300
+ if (t === "x") {
301
+ for (r++; r < n; r++)
302
+ if (t = e[r], t !== "_") {
303
+ if (!hi(e.charCodeAt(r))) return !1;
304
+ i = !0;
305
+ }
306
+ return i && t !== "_";
307
+ }
308
+ if (t === "o") {
309
+ for (r++; r < n; r++)
310
+ if (t = e[r], t !== "_") {
311
+ if (!gi(e.charCodeAt(r))) return !1;
312
+ i = !0;
313
+ }
314
+ return i && t !== "_";
281
315
  }
282
- return w;
283
- }
284
- function f(p) {
285
- const m = p.customLevels || {}, A = Object.assign({}, u.levels.values, m), k = Object.assign({}, u.levels.labels, h(m));
286
- return {
287
- values: A,
288
- labels: k
289
- };
290
316
  }
291
- function h(p) {
292
- const m = {};
293
- return Object.keys(p).forEach(function(A) {
294
- m[p[A]] = A;
295
- }), m;
317
+ if (t === "_") return !1;
318
+ for (; r < n; r++)
319
+ if (t = e[r], t !== "_") {
320
+ if (!mi(e.charCodeAt(r)))
321
+ return !1;
322
+ i = !0;
323
+ }
324
+ return !(!i || t === "_");
325
+ }
326
+ function vi(e) {
327
+ var n = e, r = 1, i;
328
+ if (n.indexOf("_") !== -1 && (n = n.replace(/_/g, "")), i = n[0], (i === "-" || i === "+") && (i === "-" && (r = -1), n = n.slice(1), i = n[0]), n === "0") return 0;
329
+ if (i === "0") {
330
+ if (n[1] === "b") return r * parseInt(n.slice(2), 2);
331
+ if (n[1] === "x") return r * parseInt(n.slice(2), 16);
332
+ if (n[1] === "o") return r * parseInt(n.slice(2), 8);
296
333
  }
297
- u.levels = {
298
- values: {
299
- fatal: 60,
300
- error: 50,
301
- warn: 40,
302
- info: 30,
303
- debug: 20,
304
- trace: 10
334
+ return r * parseInt(n, 10);
335
+ }
336
+ function xi(e) {
337
+ return Object.prototype.toString.call(e) === "[object Number]" && e % 1 === 0 && !T.isNegativeZero(e);
338
+ }
339
+ var Wn = new j("tag:yaml.org,2002:int", {
340
+ kind: "scalar",
341
+ resolve: yi,
342
+ construct: vi,
343
+ predicate: xi,
344
+ represent: {
345
+ binary: function(e) {
346
+ return e >= 0 ? "0b" + e.toString(2) : "-0b" + e.toString(2).slice(1);
305
347
  },
306
- labels: {
307
- 10: "trace",
308
- 20: "debug",
309
- 30: "info",
310
- 40: "warn",
311
- 50: "error",
312
- 60: "fatal"
348
+ octal: function(e) {
349
+ return e >= 0 ? "0o" + e.toString(8) : "-0o" + e.toString(8).slice(1);
350
+ },
351
+ decimal: function(e) {
352
+ return e.toString(10);
353
+ },
354
+ /* eslint-disable max-len */
355
+ hexadecimal: function(e) {
356
+ return e >= 0 ? "0x" + e.toString(16).toUpperCase() : "-0x" + e.toString(16).toUpperCase().slice(1);
313
357
  }
314
- }, u.stdSerializers = r, u.stdTimeFunctions = Object.assign({}, { nullTime: en, epochTime: nn, unixTime: Fr, isoTime: Tr });
315
- function g(p) {
316
- const m = [];
317
- p.bindings && m.push(p.bindings);
318
- let A = p[o];
319
- for (; A.parent; )
320
- A = A.parent, A.logger.bindings && m.push(A.logger.bindings);
321
- return m.reverse();
322
- }
323
- function y(p, m, A, k) {
324
- if (Object.defineProperty(p, k, {
325
- value: i(p.level, A) > i(k, A) ? se : A[t][k],
326
- writable: !0,
327
- enumerable: !0,
328
- configurable: !0
329
- }), !m.transmit && p[k] === se)
330
- return;
331
- p[k] = b(p, m, A, k);
332
- const E = g(p);
333
- E.length !== 0 && (p[k] = d(E, p[k]));
334
- }
335
- function d(p, m) {
336
- return function() {
337
- return m.apply(this, [...p, ...arguments]);
338
- };
339
- }
340
- function b(p, m, A, k) {
341
- return /* @__PURE__ */ (function(E) {
342
- return function() {
343
- const K = m.timestamp(), O = new Array(arguments.length), M = Object.getPrototypeOf && Object.getPrototypeOf(this) === n ? n : this;
344
- for (var w = 0; w < O.length; w++) O[w] = arguments[w];
345
- if (m.serialize && !m.asObject && x(O, this._serialize, this.serializers, this._stdErrSerialize), m.asObject || m.formatters ? E.call(M, C(this, k, O, K, m.formatters)) : E.apply(M, O), m.transmit) {
346
- const Y = m.transmit.level || p._level, ve = A.levels.values[Y], Z = A.levels.values[k];
347
- if (Z < ve) return;
348
- _(this, {
349
- ts: K,
350
- methodLevel: k,
351
- methodValue: Z,
352
- transmitValue: A.levels.values[m.transmit.level || p._level],
353
- send: m.transmit.send,
354
- val: i(p._level, A)
355
- }, O);
356
- }
357
- };
358
- })(p[t][k]);
358
+ },
359
+ defaultStyle: "decimal",
360
+ styleAliases: {
361
+ binary: [2, "bin"],
362
+ octal: [8, "oct"],
363
+ decimal: [10, "dec"],
364
+ hexadecimal: [16, "hex"]
359
365
  }
360
- function C(p, m, A, k, E = {}) {
361
- const {
362
- level: z = () => p.levels.values[m],
363
- log: K = (Z) => Z
364
- } = E;
365
- p._serialize && x(A, p._serialize, p.serializers, p._stdErrSerialize);
366
- const O = A.slice();
367
- let M = O[0];
368
- const w = {};
369
- k && (w.time = k), w.level = z(m, p.levels.values[m]);
370
- let Y = (p._childLevel | 0) + 1;
371
- if (Y < 1 && (Y = 1), M !== null && typeof M == "object") {
372
- for (; Y-- && typeof O[0] == "object"; )
373
- Object.assign(w, O.shift());
374
- M = O.length ? e(O.shift(), O) : void 0;
375
- } else typeof M == "string" && (M = e(O.shift(), O));
376
- return M !== void 0 && (w.msg = M), K(w);
377
- }
378
- function x(p, m, A, k) {
379
- for (const E in p)
380
- if (k && p[E] instanceof Error)
381
- p[E] = u.stdSerializers.err(p[E]);
382
- else if (typeof p[E] == "object" && !Array.isArray(p[E]))
383
- for (const z in p[E])
384
- m && m.indexOf(z) > -1 && z in A && (p[E][z] = A[z](p[E][z]));
385
- }
386
- function _(p, m, A) {
387
- const k = m.send, E = m.ts, z = m.methodLevel, K = m.methodValue, O = m.val, M = p._logEvent.bindings;
388
- x(
389
- A,
390
- p._serialize || Object.keys(p.serializers),
391
- p.serializers,
392
- p._stdErrSerialize === void 0 ? !0 : p._stdErrSerialize
393
- ), p._logEvent.ts = E, p._logEvent.messages = A.filter(function(w) {
394
- return M.indexOf(w) === -1;
395
- }), p._logEvent.level.label = z, p._logEvent.level.value = K, k(z, p._logEvent, O), p._logEvent = L(M);
396
- }
397
- function L(p) {
398
- return {
399
- ts: 0,
400
- messages: [],
401
- bindings: p || [],
402
- level: { label: "", value: 0 }
403
- };
404
- }
405
- function R(p) {
406
- const m = {
407
- type: p.constructor.name,
408
- msg: p.message,
409
- stack: p.stack
410
- };
411
- for (const A in p)
412
- m[A] === void 0 && (m[A] = p[A]);
413
- return m;
414
- }
415
- function J(p) {
416
- return typeof p.timestamp == "function" ? p.timestamp : p.timestamp === !1 ? en : nn;
417
- }
418
- function V() {
419
- return {};
420
- }
421
- function I(p) {
422
- return p;
423
- }
424
- function se() {
425
- }
426
- function en() {
427
- return !1;
428
- }
429
- function nn() {
430
- return Date.now();
431
- }
432
- function Fr() {
433
- return Math.round(Date.now() / 1e3);
434
- }
435
- function Tr() {
436
- return new Date(Date.now()).toISOString();
437
- }
438
- function Lr() {
439
- function p(m) {
440
- return typeof m < "u" && m;
366
+ }), wi = new RegExp(
367
+ // 2.5e4, 2.5 and integers
368
+ "^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
369
+ );
370
+ function bi(e) {
371
+ return !(e === null || !wi.test(e) || // Quick hack to not allow integers end with `_`
372
+ // Probably should update regexp & check speed
373
+ e[e.length - 1] === "_");
374
+ }
375
+ function Ai(e) {
376
+ var n, r;
377
+ return n = e.replace(/_/g, "").toLowerCase(), r = n[0] === "-" ? -1 : 1, "+-".indexOf(n[0]) >= 0 && (n = n.slice(1)), n === ".inf" ? r === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY : n === ".nan" ? NaN : r * parseFloat(n, 10);
378
+ }
379
+ var ki = /^[-+]?[0-9]+e/;
380
+ function Ci(e, n) {
381
+ var r;
382
+ if (isNaN(e))
383
+ switch (n) {
384
+ case "lowercase":
385
+ return ".nan";
386
+ case "uppercase":
387
+ return ".NAN";
388
+ case "camelcase":
389
+ return ".NaN";
441
390
  }
442
- try {
443
- return typeof globalThis < "u" || Object.defineProperty(Object.prototype, "globalThis", {
444
- get: function() {
445
- return delete Object.prototype.globalThis, this.globalThis = this;
446
- },
447
- configurable: !0
448
- }), globalThis;
449
- } catch {
450
- return p(self) || p(window) || p(this) || {};
391
+ else if (Number.POSITIVE_INFINITY === e)
392
+ switch (n) {
393
+ case "lowercase":
394
+ return ".inf";
395
+ case "uppercase":
396
+ return ".INF";
397
+ case "camelcase":
398
+ return ".Inf";
399
+ }
400
+ else if (Number.NEGATIVE_INFINITY === e)
401
+ switch (n) {
402
+ case "lowercase":
403
+ return "-.inf";
404
+ case "uppercase":
405
+ return "-.INF";
406
+ case "camelcase":
407
+ return "-.Inf";
451
408
  }
409
+ else if (T.isNegativeZero(e))
410
+ return "-0.0";
411
+ return r = e.toString(10), ki.test(r) ? r.replace("e", ".e") : r;
412
+ }
413
+ function Si(e) {
414
+ return Object.prototype.toString.call(e) === "[object Number]" && (e % 1 !== 0 || T.isNegativeZero(e));
415
+ }
416
+ var qn = new j("tag:yaml.org,2002:float", {
417
+ kind: "scalar",
418
+ resolve: bi,
419
+ construct: Ai,
420
+ predicate: Si,
421
+ represent: Ci,
422
+ defaultStyle: "lowercase"
423
+ }), Gn = Yn.extend({
424
+ implicit: [
425
+ Hn,
426
+ Kn,
427
+ Wn,
428
+ qn
429
+ ]
430
+ }), Vn = Gn, Xn = new RegExp(
431
+ "^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
432
+ ), Qn = new RegExp(
433
+ "^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"
434
+ );
435
+ function Ei(e) {
436
+ return e === null ? !1 : Xn.exec(e) !== null || Qn.exec(e) !== null;
437
+ }
438
+ function _i(e) {
439
+ var n, r, i, t, o, l, a, s = 0, c = null, u, f, h;
440
+ if (n = Xn.exec(e), n === null && (n = Qn.exec(e)), n === null) throw new Error("Date resolve error");
441
+ if (r = +n[1], i = +n[2] - 1, t = +n[3], !n[4])
442
+ return new Date(Date.UTC(r, i, t));
443
+ if (o = +n[4], l = +n[5], a = +n[6], n[7]) {
444
+ for (s = n[7].slice(0, 3); s.length < 3; )
445
+ s += "0";
446
+ s = +s;
452
447
  }
453
- return ce.exports.default = u, ce.exports.pino = u, ce.exports;
448
+ return n[9] && (u = +n[10], f = +(n[11] || 0), c = (u * 60 + f) * 6e4, n[9] === "-" && (c = -c)), h = new Date(Date.UTC(r, i, t, o, l, a, s)), c && h.setTime(h.getTime() - c), h;
454
449
  }
455
- var Wr = Kr();
456
- const qr = /* @__PURE__ */ Yr(Wr), X = qr({
457
- level: process.env.LOG_LEVEL || "info"
450
+ function Oi(e) {
451
+ return e.toISOString();
452
+ }
453
+ var Jn = new j("tag:yaml.org,2002:timestamp", {
454
+ kind: "scalar",
455
+ resolve: Ei,
456
+ construct: _i,
457
+ instanceOf: Date,
458
+ represent: Oi
458
459
  });
459
- function Gr() {
460
- return {
461
- command: "languages",
462
- describe: "List supported languages from xcodeproj or xcstrings",
463
- handler: async (e) => {
464
- const n = await Pn(e.path, e.config);
465
- X.info(n.join(" "));
460
+ function Fi(e) {
461
+ return e === "<<" || e === null;
462
+ }
463
+ var Zn = new j("tag:yaml.org,2002:merge", {
464
+ kind: "scalar",
465
+ resolve: Fi
466
+ }), Ve = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
467
+ \r`;
468
+ function Ti(e) {
469
+ if (e === null) return !1;
470
+ var n, r, i = 0, t = e.length, o = Ve;
471
+ for (r = 0; r < t; r++)
472
+ if (n = o.indexOf(e.charAt(r)), !(n > 64)) {
473
+ if (n < 0) return !1;
474
+ i += 6;
466
475
  }
467
- };
476
+ return i % 8 === 0;
468
477
  }
469
- function Vr(e) {
470
- const n = Oe(e, "project.pbxproj");
471
- return (zr.open(n).rootObject.props.knownRegions ?? []).filter((o) => o !== "Base").sort();
478
+ function Li(e) {
479
+ var n, r, i = e.replace(/[\r\n=]/g, ""), t = i.length, o = Ve, l = 0, a = [];
480
+ for (n = 0; n < t; n++)
481
+ n % 4 === 0 && n && (a.push(l >> 16 & 255), a.push(l >> 8 & 255), a.push(l & 255)), l = l << 6 | o.indexOf(i.charAt(n));
482
+ return r = t % 4 * 6, r === 0 ? (a.push(l >> 16 & 255), a.push(l >> 8 & 255), a.push(l & 255)) : r === 18 ? (a.push(l >> 10 & 255), a.push(l >> 2 & 255)) : r === 12 && a.push(l >> 4 & 255), new Uint8Array(a);
472
483
  }
473
- async function Xr(e) {
474
- const n = await me(e), r = /* @__PURE__ */ new Set();
475
- if (!n.sourceLanguage)
476
- throw new Error('The xcstrings file is missing "sourceLanguage".');
477
- r.add(n.sourceLanguage);
478
- for (const i of Object.keys(n.strings)) {
479
- const t = n.strings[i];
480
- if (t.localizations)
481
- for (const o of Object.keys(t.localizations))
482
- r.add(o);
484
+ function ji(e) {
485
+ var n = "", r = 0, i, t, o = e.length, l = Ve;
486
+ for (i = 0; i < o; i++)
487
+ i % 3 === 0 && i && (n += l[r >> 18 & 63], n += l[r >> 12 & 63], n += l[r >> 6 & 63], n += l[r & 63]), r = (r << 8) + e[i];
488
+ return t = o % 3, t === 0 ? (n += l[r >> 18 & 63], n += l[r >> 12 & 63], n += l[r >> 6 & 63], n += l[r & 63]) : t === 2 ? (n += l[r >> 10 & 63], n += l[r >> 4 & 63], n += l[r << 2 & 63], n += l[64]) : t === 1 && (n += l[r >> 2 & 63], n += l[r << 4 & 63], n += l[64], n += l[64]), n;
489
+ }
490
+ function Ii(e) {
491
+ return Object.prototype.toString.call(e) === "[object Uint8Array]";
492
+ }
493
+ var er = new j("tag:yaml.org,2002:binary", {
494
+ kind: "scalar",
495
+ resolve: Ti,
496
+ construct: Li,
497
+ predicate: Ii,
498
+ represent: ji
499
+ }), Ni = Object.prototype.hasOwnProperty, Ri = Object.prototype.toString;
500
+ function Pi(e) {
501
+ if (e === null) return !0;
502
+ var n = [], r, i, t, o, l, a = e;
503
+ for (r = 0, i = a.length; r < i; r += 1) {
504
+ if (t = a[r], l = !1, Ri.call(t) !== "[object Object]") return !1;
505
+ for (o in t)
506
+ if (Ni.call(t, o))
507
+ if (!l) l = !0;
508
+ else return !1;
509
+ if (!l) return !1;
510
+ if (n.indexOf(o) === -1) n.push(o);
511
+ else return !1;
483
512
  }
484
- return Array.from(r).sort();
513
+ return !0;
485
514
  }
486
- async function Pn(e, n) {
487
- const { sourceLanguage: r } = await me(e);
488
- if (!r)
489
- throw new Error('The xcstrings file is missing "sourceLanguage".');
490
- const i = await We(n);
491
- if (i?.xcodeprojPaths && i.xcodeprojPaths.length > 0) {
492
- const l = /* @__PURE__ */ new Set();
493
- l.add(r);
494
- for (const a of i.xcodeprojPaths)
495
- Vr(a).forEach((c) => l.add(c));
496
- return Array.from(l).sort();
515
+ function Mi(e) {
516
+ return e !== null ? e : [];
517
+ }
518
+ var nr = new j("tag:yaml.org,2002:omap", {
519
+ kind: "sequence",
520
+ resolve: Pi,
521
+ construct: Mi
522
+ }), Di = Object.prototype.toString;
523
+ function $i(e) {
524
+ if (e === null) return !0;
525
+ var n, r, i, t, o, l = e;
526
+ for (o = new Array(l.length), n = 0, r = l.length; n < r; n += 1) {
527
+ if (i = l[n], Di.call(i) !== "[object Object]" || (t = Object.keys(i), t.length !== 1)) return !1;
528
+ o[n] = [t[0], i[t[0]]];
497
529
  }
498
- const t = await Xr(e), o = new Set(t);
499
- return o.add(r), Array.from(o).sort();
530
+ return !0;
500
531
  }
501
- function Dn(e) {
502
- return typeof e > "u" || e === null;
532
+ function zi(e) {
533
+ if (e === null) return [];
534
+ var n, r, i, t, o, l = e;
535
+ for (o = new Array(l.length), n = 0, r = l.length; n < r; n += 1)
536
+ i = l[n], t = Object.keys(i), o[n] = [t[0], i[t[0]]];
537
+ return o;
503
538
  }
504
- function Qr(e) {
505
- return typeof e == "object" && e !== null;
539
+ var rr = new j("tag:yaml.org,2002:pairs", {
540
+ kind: "sequence",
541
+ resolve: $i,
542
+ construct: zi
543
+ }), Bi = Object.prototype.hasOwnProperty;
544
+ function Ui(e) {
545
+ if (e === null) return !0;
546
+ var n, r = e;
547
+ for (n in r)
548
+ if (Bi.call(r, n) && r[n] !== null)
549
+ return !1;
550
+ return !0;
506
551
  }
507
- function Jr(e) {
508
- return Array.isArray(e) ? e : Dn(e) ? [] : [e];
552
+ function Yi(e) {
553
+ return e !== null ? e : {};
509
554
  }
510
- function Zr(e, n) {
511
- var r, i, t, o;
512
- if (n)
513
- for (o = Object.keys(n), r = 0, i = o.length; r < i; r += 1)
514
- t = o[r], e[t] = n[t];
515
- return e;
555
+ var ir = new j("tag:yaml.org,2002:set", {
556
+ kind: "mapping",
557
+ resolve: Ui,
558
+ construct: Yi
559
+ }), Xe = Vn.extend({
560
+ implicit: [
561
+ Jn,
562
+ Zn
563
+ ],
564
+ explicit: [
565
+ er,
566
+ nr,
567
+ rr,
568
+ ir
569
+ ]
570
+ }), G = Object.prototype.hasOwnProperty, Se = 1, tr = 2, or = 3, Ee = 4, Me = 1, Hi = 2, pn = 3, Ki = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, Wi = /[\x85\u2028\u2029]/, qi = /[,\[\]\{\}]/, lr = /^(?:!|!!|![a-z\-]+!)$/i, ar = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
571
+ function dn(e) {
572
+ return Object.prototype.toString.call(e);
516
573
  }
517
- function ei(e, n) {
518
- var r = "", i;
519
- for (i = 0; i < n; i += 1)
520
- r += e;
521
- return r;
574
+ function H(e) {
575
+ return e === 10 || e === 13;
522
576
  }
523
- function ni(e) {
524
- return e === 0 && Number.NEGATIVE_INFINITY === 1 / e;
577
+ function Q(e) {
578
+ return e === 9 || e === 32;
525
579
  }
526
- var ri = Dn, ii = Qr, ti = Jr, oi = ei, li = ni, ai = Zr, T = {
527
- isNothing: ri,
528
- isObject: ii,
529
- toArray: ti,
530
- repeat: oi,
531
- isNegativeZero: li,
532
- extend: ai
533
- };
534
- function $n(e, n) {
535
- var r = "", i = e.reason || "(unknown reason)";
536
- return e.mark ? (e.mark.name && (r += 'in "' + e.mark.name + '" '), r += "(" + (e.mark.line + 1) + ":" + (e.mark.column + 1) + ")", !n && e.mark.snippet && (r += `
537
-
538
- ` + e.mark.snippet), i + " " + r) : i;
580
+ function U(e) {
581
+ return e === 9 || e === 32 || e === 10 || e === 13;
539
582
  }
540
- function fe(e, n) {
541
- Error.call(this), this.name = "YAMLException", this.reason = e, this.mark = n, this.message = $n(this, !1), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack || "";
583
+ function ie(e) {
584
+ return e === 44 || e === 91 || e === 93 || e === 123 || e === 125;
542
585
  }
543
- fe.prototype = Object.create(Error.prototype);
544
- fe.prototype.constructor = fe;
545
- fe.prototype.toString = function(n) {
546
- return this.name + ": " + $n(this, n);
547
- };
548
- var P = fe;
549
- function Ie(e, n, r, i, t) {
550
- var o = "", l = "", a = Math.floor(t / 2) - 1;
551
- return i - n > a && (o = " ... ", n = i - a + o.length), r - i > a && (l = " ...", r = i + a - l.length), {
552
- str: o + e.slice(n, r).replace(/\t/g, "→") + l,
553
- pos: i - n + o.length
554
- // relative position
555
- };
586
+ function Gi(e) {
587
+ var n;
588
+ return 48 <= e && e <= 57 ? e - 48 : (n = e | 32, 97 <= n && n <= 102 ? n - 97 + 10 : -1);
556
589
  }
557
- function Ne(e, n) {
558
- return T.repeat(" ", n - e.length) + e;
590
+ function Vi(e) {
591
+ return e === 120 ? 2 : e === 117 ? 4 : e === 85 ? 8 : 0;
559
592
  }
560
- function si(e, n) {
561
- if (n = Object.create(n || null), !e.buffer) return null;
562
- n.maxLength || (n.maxLength = 79), typeof n.indent != "number" && (n.indent = 1), typeof n.linesBefore != "number" && (n.linesBefore = 3), typeof n.linesAfter != "number" && (n.linesAfter = 2);
563
- for (var r = /\r?\n|\r|\0/g, i = [0], t = [], o, l = -1; o = r.exec(e.buffer); )
564
- t.push(o.index), i.push(o.index + o[0].length), e.position <= o.index && l < 0 && (l = i.length - 2);
565
- l < 0 && (l = i.length - 1);
566
- var a = "", s, c, u = Math.min(e.line + n.linesAfter, t.length).toString().length, f = n.maxLength - (n.indent + u + 3);
567
- for (s = 1; s <= n.linesBefore && !(l - s < 0); s++)
568
- c = Ie(
569
- e.buffer,
570
- i[l - s],
571
- t[l - s],
572
- e.position - (i[l] - i[l - s]),
573
- f
574
- ), a = T.repeat(" ", n.indent) + Ne((e.line - s + 1).toString(), u) + " | " + c.str + `
575
- ` + a;
576
- for (c = Ie(e.buffer, i[l], t[l], e.position, f), a += T.repeat(" ", n.indent) + Ne((e.line + 1).toString(), u) + " | " + c.str + `
577
- `, a += T.repeat("-", n.indent + u + 3 + c.pos) + `^
578
- `, s = 1; s <= n.linesAfter && !(l + s >= t.length); s++)
579
- c = Ie(
580
- e.buffer,
581
- i[l + s],
582
- t[l + s],
583
- e.position - (i[l] - i[l + s]),
584
- f
585
- ), a += T.repeat(" ", n.indent) + Ne((e.line + s + 1).toString(), u) + " | " + c.str + `
586
- `;
587
- return a.replace(/\n$/, "");
593
+ function Xi(e) {
594
+ return 48 <= e && e <= 57 ? e - 48 : -1;
588
595
  }
589
- var ci = si, ui = [
590
- "kind",
591
- "multi",
592
- "resolve",
593
- "construct",
594
- "instanceOf",
595
- "predicate",
596
- "represent",
597
- "representName",
598
- "defaultStyle",
599
- "styleAliases"
600
- ], fi = [
601
- "scalar",
602
- "sequence",
603
- "mapping"
604
- ];
605
- function pi(e) {
606
- var n = {};
607
- return e !== null && Object.keys(e).forEach(function(r) {
608
- e[r].forEach(function(i) {
609
- n[String(i)] = r;
610
- });
611
- }), n;
596
+ function hn(e) {
597
+ return e === 48 ? "\0" : e === 97 ? "\x07" : e === 98 ? "\b" : e === 116 || e === 9 ? " " : e === 110 ? `
598
+ ` : e === 118 ? "\v" : e === 102 ? "\f" : e === 114 ? "\r" : e === 101 ? "\x1B" : e === 32 ? " " : e === 34 ? '"' : e === 47 ? "/" : e === 92 ? "\\" : e === 78 ? "…" : e === 95 ? " " : e === 76 ? "\u2028" : e === 80 ? "\u2029" : "";
612
599
  }
613
- function di(e, n) {
614
- if (n = n || {}, Object.keys(n).forEach(function(r) {
615
- if (ui.indexOf(r) === -1)
616
- throw new P('Unknown option "' + r + '" is met in definition of "' + e + '" YAML type.');
617
- }), this.options = n, this.tag = e, this.kind = n.kind || null, this.resolve = n.resolve || function() {
618
- return !0;
619
- }, this.construct = n.construct || function(r) {
620
- return r;
621
- }, this.instanceOf = n.instanceOf || null, this.predicate = n.predicate || null, this.represent = n.represent || null, this.representName = n.representName || null, this.defaultStyle = n.defaultStyle || null, this.multi = n.multi || !1, this.styleAliases = pi(n.styleAliases || null), fi.indexOf(this.kind) === -1)
622
- throw new P('Unknown kind "' + this.kind + '" is specified for "' + e + '" YAML type.');
600
+ function Qi(e) {
601
+ return e <= 65535 ? String.fromCharCode(e) : String.fromCharCode(
602
+ (e - 65536 >> 10) + 55296,
603
+ (e - 65536 & 1023) + 56320
604
+ );
623
605
  }
624
- var j = di;
625
- function pn(e, n) {
626
- var r = [];
627
- return e[n].forEach(function(i) {
628
- var t = r.length;
629
- r.forEach(function(o, l) {
630
- o.tag === i.tag && o.kind === i.kind && o.multi === i.multi && (t = l);
631
- }), r[t] = i;
632
- }), r;
606
+ function sr(e, n, r) {
607
+ n === "__proto__" ? Object.defineProperty(e, n, {
608
+ configurable: !0,
609
+ enumerable: !0,
610
+ writable: !0,
611
+ value: r
612
+ }) : e[n] = r;
633
613
  }
634
- function hi() {
635
- var e = {
636
- scalar: {},
637
- sequence: {},
638
- mapping: {},
639
- fallback: {},
640
- multi: {
641
- scalar: [],
642
- sequence: [],
643
- mapping: [],
644
- fallback: []
614
+ var cr = new Array(256), ur = new Array(256);
615
+ for (var ne = 0; ne < 256; ne++)
616
+ cr[ne] = hn(ne) ? 1 : 0, ur[ne] = hn(ne);
617
+ function Ji(e, n) {
618
+ this.input = e, this.filename = n.filename || null, this.schema = n.schema || Xe, this.onWarning = n.onWarning || null, this.legacy = n.legacy || !1, this.json = n.json || !1, this.listener = n.listener || null, this.implicitTypes = this.schema.compiledImplicit, this.typeMap = this.schema.compiledTypeMap, this.length = e.length, this.position = 0, this.line = 0, this.lineStart = 0, this.lineIndent = 0, this.firstTabInLine = -1, this.documents = [];
619
+ }
620
+ function fr(e, n) {
621
+ var r = {
622
+ name: e.filename,
623
+ buffer: e.input.slice(0, -1),
624
+ // omit trailing \0
625
+ position: e.position,
626
+ line: e.line,
627
+ column: e.position - e.lineStart
628
+ };
629
+ return r.snippet = ri(r), new M(n, r);
630
+ }
631
+ function v(e, n) {
632
+ throw fr(e, n);
633
+ }
634
+ function _e(e, n) {
635
+ e.onWarning && e.onWarning.call(null, fr(e, n));
636
+ }
637
+ var gn = {
638
+ YAML: function(n, r, i) {
639
+ var t, o, l;
640
+ n.version !== null && v(n, "duplication of %YAML directive"), i.length !== 1 && v(n, "YAML directive accepts exactly one argument"), t = /^([0-9]+)\.([0-9]+)$/.exec(i[0]), t === null && v(n, "ill-formed argument of the YAML directive"), o = parseInt(t[1], 10), l = parseInt(t[2], 10), o !== 1 && v(n, "unacceptable YAML version of the document"), n.version = i[0], n.checkLineBreaks = l < 2, l !== 1 && l !== 2 && _e(n, "unsupported YAML version of the document");
641
+ },
642
+ TAG: function(n, r, i) {
643
+ var t, o;
644
+ i.length !== 2 && v(n, "TAG directive accepts exactly two arguments"), t = i[0], o = i[1], lr.test(t) || v(n, "ill-formed tag handle (first argument) of the TAG directive"), G.call(n.tagMap, t) && v(n, 'there is a previously declared suffix for "' + t + '" tag handle'), ar.test(o) || v(n, "ill-formed tag prefix (second argument) of the TAG directive");
645
+ try {
646
+ o = decodeURIComponent(o);
647
+ } catch {
648
+ v(n, "tag prefix is malformed: " + o);
645
649
  }
646
- }, n, r;
647
- function i(t) {
648
- t.multi ? (e.multi[t.kind].push(t), e.multi.fallback.push(t)) : e[t.kind][t.tag] = e.fallback[t.tag] = t;
650
+ n.tagMap[t] = o;
651
+ }
652
+ };
653
+ function q(e, n, r, i) {
654
+ var t, o, l, a;
655
+ if (n < r) {
656
+ if (a = e.input.slice(n, r), i)
657
+ for (t = 0, o = a.length; t < o; t += 1)
658
+ l = a.charCodeAt(t), l === 9 || 32 <= l && l <= 1114111 || v(e, "expected valid JSON character");
659
+ else Ki.test(a) && v(e, "the stream contains non-printable characters");
660
+ e.result += a;
649
661
  }
650
- for (n = 0, r = arguments.length; n < r; n += 1)
651
- arguments[n].forEach(i);
652
- return e;
653
662
  }
654
- function ze(e) {
655
- return this.extend(e);
663
+ function mn(e, n, r, i) {
664
+ var t, o, l, a;
665
+ for (T.isObject(r) || v(e, "cannot merge mappings; the provided source object is unacceptable"), t = Object.keys(r), l = 0, a = t.length; l < a; l += 1)
666
+ o = t[l], G.call(n, o) || (sr(n, o, r[o]), i[o] = !0);
656
667
  }
657
- ze.prototype.extend = function(n) {
658
- var r = [], i = [];
659
- if (n instanceof j)
660
- i.push(n);
661
- else if (Array.isArray(n))
662
- i = i.concat(n);
663
- else if (n && (Array.isArray(n.implicit) || Array.isArray(n.explicit)))
664
- n.implicit && (r = r.concat(n.implicit)), n.explicit && (i = i.concat(n.explicit));
668
+ function te(e, n, r, i, t, o, l, a, s) {
669
+ var c, u;
670
+ if (Array.isArray(t))
671
+ for (t = Array.prototype.slice.call(t), c = 0, u = t.length; c < u; c += 1)
672
+ Array.isArray(t[c]) && v(e, "nested arrays are not supported inside keys"), typeof t == "object" && dn(t[c]) === "[object Object]" && (t[c] = "[object Object]");
673
+ if (typeof t == "object" && dn(t) === "[object Object]" && (t = "[object Object]"), t = String(t), n === null && (n = {}), i === "tag:yaml.org,2002:merge")
674
+ if (Array.isArray(o))
675
+ for (c = 0, u = o.length; c < u; c += 1)
676
+ mn(e, n, o[c], r);
677
+ else
678
+ mn(e, n, o, r);
665
679
  else
666
- throw new P("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
667
- r.forEach(function(o) {
668
- if (!(o instanceof j))
669
- throw new P("Specified list of YAML types (or a single Type object) contains a non-Type object.");
670
- if (o.loadKind && o.loadKind !== "scalar")
671
- throw new P("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
672
- if (o.multi)
673
- throw new P("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
674
- }), i.forEach(function(o) {
675
- if (!(o instanceof j))
676
- throw new P("Specified list of YAML types (or a single Type object) contains a non-Type object.");
677
- });
678
- var t = Object.create(ze.prototype);
679
- return t.implicit = (this.implicit || []).concat(r), t.explicit = (this.explicit || []).concat(i), t.compiledImplicit = pn(t, "implicit"), t.compiledExplicit = pn(t, "explicit"), t.compiledTypeMap = hi(t.compiledImplicit, t.compiledExplicit), t;
680
- };
681
- var zn = ze, Bn = new j("tag:yaml.org,2002:str", {
682
- kind: "scalar",
683
- construct: function(e) {
684
- return e !== null ? e : "";
685
- }
686
- }), Un = new j("tag:yaml.org,2002:seq", {
687
- kind: "sequence",
688
- construct: function(e) {
689
- return e !== null ? e : [];
690
- }
691
- }), Yn = new j("tag:yaml.org,2002:map", {
692
- kind: "mapping",
693
- construct: function(e) {
694
- return e !== null ? e : {};
680
+ !e.json && !G.call(r, t) && G.call(n, t) && (e.line = l || e.line, e.lineStart = a || e.lineStart, e.position = s || e.position, v(e, "duplicated mapping key")), sr(n, t, o), delete r[t];
681
+ return n;
682
+ }
683
+ function Qe(e) {
684
+ var n;
685
+ n = e.input.charCodeAt(e.position), n === 10 ? e.position++ : n === 13 ? (e.position++, e.input.charCodeAt(e.position) === 10 && e.position++) : v(e, "a line break is expected"), e.line += 1, e.lineStart = e.position, e.firstTabInLine = -1;
686
+ }
687
+ function F(e, n, r) {
688
+ for (var i = 0, t = e.input.charCodeAt(e.position); t !== 0; ) {
689
+ for (; Q(t); )
690
+ t === 9 && e.firstTabInLine === -1 && (e.firstTabInLine = e.position), t = e.input.charCodeAt(++e.position);
691
+ if (n && t === 35)
692
+ do
693
+ t = e.input.charCodeAt(++e.position);
694
+ while (t !== 10 && t !== 13 && t !== 0);
695
+ if (H(t))
696
+ for (Qe(e), t = e.input.charCodeAt(e.position), i++, e.lineIndent = 0; t === 32; )
697
+ e.lineIndent++, t = e.input.charCodeAt(++e.position);
698
+ else
699
+ break;
695
700
  }
696
- }), Hn = new zn({
697
- explicit: [
698
- Bn,
699
- Un,
700
- Yn
701
- ]
702
- });
703
- function gi(e) {
704
- if (e === null) return !0;
705
- var n = e.length;
706
- return n === 1 && e === "~" || n === 4 && (e === "null" || e === "Null" || e === "NULL");
701
+ return r !== -1 && i !== 0 && e.lineIndent < r && _e(e, "deficient indentation"), i;
707
702
  }
708
- function mi() {
709
- return null;
703
+ function Ie(e) {
704
+ var n = e.position, r;
705
+ return r = e.input.charCodeAt(n), !!((r === 45 || r === 46) && r === e.input.charCodeAt(n + 1) && r === e.input.charCodeAt(n + 2) && (n += 3, r = e.input.charCodeAt(n), r === 0 || U(r)));
710
706
  }
711
- function yi(e) {
712
- return e === null;
707
+ function Je(e, n) {
708
+ n === 1 ? e.result += " " : n > 1 && (e.result += T.repeat(`
709
+ `, n - 1));
713
710
  }
714
- var Kn = new j("tag:yaml.org,2002:null", {
715
- kind: "scalar",
716
- resolve: gi,
717
- construct: mi,
718
- predicate: yi,
719
- represent: {
720
- canonical: function() {
721
- return "~";
722
- },
723
- lowercase: function() {
724
- return "null";
725
- },
726
- uppercase: function() {
727
- return "NULL";
728
- },
729
- camelcase: function() {
730
- return "Null";
731
- },
732
- empty: function() {
733
- return "";
711
+ function Zi(e, n, r) {
712
+ var i, t, o, l, a, s, c, u, f = e.kind, h = e.result, g;
713
+ if (g = e.input.charCodeAt(e.position), U(g) || ie(g) || g === 35 || g === 38 || g === 42 || g === 33 || g === 124 || g === 62 || g === 39 || g === 34 || g === 37 || g === 64 || g === 96 || (g === 63 || g === 45) && (t = e.input.charCodeAt(e.position + 1), U(t) || r && ie(t)))
714
+ return !1;
715
+ for (e.kind = "scalar", e.result = "", o = l = e.position, a = !1; g !== 0; ) {
716
+ if (g === 58) {
717
+ if (t = e.input.charCodeAt(e.position + 1), U(t) || r && ie(t))
718
+ break;
719
+ } else if (g === 35) {
720
+ if (i = e.input.charCodeAt(e.position - 1), U(i))
721
+ break;
722
+ } else {
723
+ if (e.position === e.lineStart && Ie(e) || r && ie(g))
724
+ break;
725
+ if (H(g))
726
+ if (s = e.line, c = e.lineStart, u = e.lineIndent, F(e, !1, -1), e.lineIndent >= n) {
727
+ a = !0, g = e.input.charCodeAt(e.position);
728
+ continue;
729
+ } else {
730
+ e.position = l, e.line = s, e.lineStart = c, e.lineIndent = u;
731
+ break;
732
+ }
734
733
  }
735
- },
736
- defaultStyle: "lowercase"
737
- });
738
- function vi(e) {
739
- if (e === null) return !1;
740
- var n = e.length;
741
- return n === 4 && (e === "true" || e === "True" || e === "TRUE") || n === 5 && (e === "false" || e === "False" || e === "FALSE");
742
- }
743
- function xi(e) {
744
- return e === "true" || e === "True" || e === "TRUE";
734
+ a && (q(e, o, l, !1), Je(e, e.line - s), o = l = e.position, a = !1), Q(g) || (l = e.position + 1), g = e.input.charCodeAt(++e.position);
735
+ }
736
+ return q(e, o, l, !1), e.result ? !0 : (e.kind = f, e.result = h, !1);
745
737
  }
746
- function wi(e) {
747
- return Object.prototype.toString.call(e) === "[object Boolean]";
738
+ function et(e, n) {
739
+ var r, i, t;
740
+ if (r = e.input.charCodeAt(e.position), r !== 39)
741
+ return !1;
742
+ for (e.kind = "scalar", e.result = "", e.position++, i = t = e.position; (r = e.input.charCodeAt(e.position)) !== 0; )
743
+ if (r === 39)
744
+ if (q(e, i, e.position, !0), r = e.input.charCodeAt(++e.position), r === 39)
745
+ i = e.position, e.position++, t = e.position;
746
+ else
747
+ return !0;
748
+ else H(r) ? (q(e, i, t, !0), Je(e, F(e, !1, n)), i = t = e.position) : e.position === e.lineStart && Ie(e) ? v(e, "unexpected end of the document within a single quoted scalar") : (e.position++, t = e.position);
749
+ v(e, "unexpected end of the stream within a single quoted scalar");
748
750
  }
749
- var Wn = new j("tag:yaml.org,2002:bool", {
750
- kind: "scalar",
751
- resolve: vi,
752
- construct: xi,
753
- predicate: wi,
754
- represent: {
755
- lowercase: function(e) {
756
- return e ? "true" : "false";
757
- },
758
- uppercase: function(e) {
759
- return e ? "TRUE" : "FALSE";
760
- },
761
- camelcase: function(e) {
762
- return e ? "True" : "False";
763
- }
764
- },
765
- defaultStyle: "lowercase"
766
- });
767
- function bi(e) {
768
- return 48 <= e && e <= 57 || 65 <= e && e <= 70 || 97 <= e && e <= 102;
769
- }
770
- function Ai(e) {
771
- return 48 <= e && e <= 55;
751
+ function nt(e, n) {
752
+ var r, i, t, o, l, a;
753
+ if (a = e.input.charCodeAt(e.position), a !== 34)
754
+ return !1;
755
+ for (e.kind = "scalar", e.result = "", e.position++, r = i = e.position; (a = e.input.charCodeAt(e.position)) !== 0; ) {
756
+ if (a === 34)
757
+ return q(e, r, e.position, !0), e.position++, !0;
758
+ if (a === 92) {
759
+ if (q(e, r, e.position, !0), a = e.input.charCodeAt(++e.position), H(a))
760
+ F(e, !1, n);
761
+ else if (a < 256 && cr[a])
762
+ e.result += ur[a], e.position++;
763
+ else if ((l = Vi(a)) > 0) {
764
+ for (t = l, o = 0; t > 0; t--)
765
+ a = e.input.charCodeAt(++e.position), (l = Gi(a)) >= 0 ? o = (o << 4) + l : v(e, "expected hexadecimal character");
766
+ e.result += Qi(o), e.position++;
767
+ } else
768
+ v(e, "unknown escape sequence");
769
+ r = i = e.position;
770
+ } else H(a) ? (q(e, r, i, !0), Je(e, F(e, !1, n)), r = i = e.position) : e.position === e.lineStart && Ie(e) ? v(e, "unexpected end of the document within a double quoted scalar") : (e.position++, i = e.position);
771
+ }
772
+ v(e, "unexpected end of the stream within a double quoted scalar");
772
773
  }
773
- function Ci(e) {
774
- return 48 <= e && e <= 57;
774
+ function rt(e, n) {
775
+ var r = !0, i, t, o, l = e.tag, a, s = e.anchor, c, u, f, h, g, y = /* @__PURE__ */ Object.create(null), d, b, C, x;
776
+ if (x = e.input.charCodeAt(e.position), x === 91)
777
+ u = 93, g = !1, a = [];
778
+ else if (x === 123)
779
+ u = 125, g = !0, a = {};
780
+ else
781
+ return !1;
782
+ for (e.anchor !== null && (e.anchorMap[e.anchor] = a), x = e.input.charCodeAt(++e.position); x !== 0; ) {
783
+ if (F(e, !0, n), x = e.input.charCodeAt(e.position), x === u)
784
+ return e.position++, e.tag = l, e.anchor = s, e.kind = g ? "mapping" : "sequence", e.result = a, !0;
785
+ r ? x === 44 && v(e, "expected the node content, but found ','") : v(e, "missed comma between flow collection entries"), b = d = C = null, f = h = !1, x === 63 && (c = e.input.charCodeAt(e.position + 1), U(c) && (f = h = !0, e.position++, F(e, !0, n))), i = e.line, t = e.lineStart, o = e.position, le(e, n, Se, !1, !0), b = e.tag, d = e.result, F(e, !0, n), x = e.input.charCodeAt(e.position), (h || e.line === i) && x === 58 && (f = !0, x = e.input.charCodeAt(++e.position), F(e, !0, n), le(e, n, Se, !1, !0), C = e.result), g ? te(e, a, y, b, d, C, i, t, o) : f ? a.push(te(e, null, y, b, d, C, i, t, o)) : a.push(d), F(e, !0, n), x = e.input.charCodeAt(e.position), x === 44 ? (r = !0, x = e.input.charCodeAt(++e.position)) : r = !1;
786
+ }
787
+ v(e, "unexpected end of the stream within a flow collection");
775
788
  }
776
- function Si(e) {
777
- if (e === null) return !1;
778
- var n = e.length, r = 0, i = !1, t;
779
- if (!n) return !1;
780
- if (t = e[r], (t === "-" || t === "+") && (t = e[++r]), t === "0") {
781
- if (r + 1 === n) return !0;
782
- if (t = e[++r], t === "b") {
783
- for (r++; r < n; r++)
784
- if (t = e[r], t !== "_") {
785
- if (t !== "0" && t !== "1") return !1;
786
- i = !0;
787
- }
788
- return i && t !== "_";
789
- }
790
- if (t === "x") {
791
- for (r++; r < n; r++)
792
- if (t = e[r], t !== "_") {
793
- if (!bi(e.charCodeAt(r))) return !1;
794
- i = !0;
795
- }
796
- return i && t !== "_";
789
+ function it(e, n) {
790
+ var r, i, t = Me, o = !1, l = !1, a = n, s = 0, c = !1, u, f;
791
+ if (f = e.input.charCodeAt(e.position), f === 124)
792
+ i = !1;
793
+ else if (f === 62)
794
+ i = !0;
795
+ else
796
+ return !1;
797
+ for (e.kind = "scalar", e.result = ""; f !== 0; )
798
+ if (f = e.input.charCodeAt(++e.position), f === 43 || f === 45)
799
+ Me === t ? t = f === 43 ? pn : Hi : v(e, "repeat of a chomping mode identifier");
800
+ else if ((u = Xi(f)) >= 0)
801
+ u === 0 ? v(e, "bad explicit indentation width of a block scalar; it cannot be less than one") : l ? v(e, "repeat of an indentation width identifier") : (a = n + u - 1, l = !0);
802
+ else
803
+ break;
804
+ if (Q(f)) {
805
+ do
806
+ f = e.input.charCodeAt(++e.position);
807
+ while (Q(f));
808
+ if (f === 35)
809
+ do
810
+ f = e.input.charCodeAt(++e.position);
811
+ while (!H(f) && f !== 0);
812
+ }
813
+ for (; f !== 0; ) {
814
+ for (Qe(e), e.lineIndent = 0, f = e.input.charCodeAt(e.position); (!l || e.lineIndent < a) && f === 32; )
815
+ e.lineIndent++, f = e.input.charCodeAt(++e.position);
816
+ if (!l && e.lineIndent > a && (a = e.lineIndent), H(f)) {
817
+ s++;
818
+ continue;
797
819
  }
798
- if (t === "o") {
799
- for (r++; r < n; r++)
800
- if (t = e[r], t !== "_") {
801
- if (!Ai(e.charCodeAt(r))) return !1;
802
- i = !0;
803
- }
804
- return i && t !== "_";
820
+ if (e.lineIndent < a) {
821
+ t === pn ? e.result += T.repeat(`
822
+ `, o ? 1 + s : s) : t === Me && o && (e.result += `
823
+ `);
824
+ break;
805
825
  }
826
+ for (i ? Q(f) ? (c = !0, e.result += T.repeat(`
827
+ `, o ? 1 + s : s)) : c ? (c = !1, e.result += T.repeat(`
828
+ `, s + 1)) : s === 0 ? o && (e.result += " ") : e.result += T.repeat(`
829
+ `, s) : e.result += T.repeat(`
830
+ `, o ? 1 + s : s), o = !0, l = !0, s = 0, r = e.position; !H(f) && f !== 0; )
831
+ f = e.input.charCodeAt(++e.position);
832
+ q(e, r, e.position, !1);
806
833
  }
807
- if (t === "_") return !1;
808
- for (; r < n; r++)
809
- if (t = e[r], t !== "_") {
810
- if (!Ci(e.charCodeAt(r)))
811
- return !1;
812
- i = !0;
813
- }
814
- return !(!i || t === "_");
834
+ return !0;
815
835
  }
816
- function ki(e) {
817
- var n = e, r = 1, i;
818
- if (n.indexOf("_") !== -1 && (n = n.replace(/_/g, "")), i = n[0], (i === "-" || i === "+") && (i === "-" && (r = -1), n = n.slice(1), i = n[0]), n === "0") return 0;
819
- if (i === "0") {
820
- if (n[1] === "b") return r * parseInt(n.slice(2), 2);
821
- if (n[1] === "x") return r * parseInt(n.slice(2), 16);
822
- if (n[1] === "o") return r * parseInt(n.slice(2), 8);
836
+ function yn(e, n) {
837
+ var r, i = e.tag, t = e.anchor, o = [], l, a = !1, s;
838
+ if (e.firstTabInLine !== -1) return !1;
839
+ for (e.anchor !== null && (e.anchorMap[e.anchor] = o), s = e.input.charCodeAt(e.position); s !== 0 && (e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, v(e, "tab characters must not be used in indentation")), !(s !== 45 || (l = e.input.charCodeAt(e.position + 1), !U(l)))); ) {
840
+ if (a = !0, e.position++, F(e, !0, -1) && e.lineIndent <= n) {
841
+ o.push(null), s = e.input.charCodeAt(e.position);
842
+ continue;
843
+ }
844
+ if (r = e.line, le(e, n, or, !1, !0), o.push(e.result), F(e, !0, -1), s = e.input.charCodeAt(e.position), (e.line === r || e.lineIndent > n) && s !== 0)
845
+ v(e, "bad indentation of a sequence entry");
846
+ else if (e.lineIndent < n)
847
+ break;
823
848
  }
824
- return r * parseInt(n, 10);
825
- }
826
- function Ei(e) {
827
- return Object.prototype.toString.call(e) === "[object Number]" && e % 1 === 0 && !T.isNegativeZero(e);
849
+ return a ? (e.tag = i, e.anchor = t, e.kind = "sequence", e.result = o, !0) : !1;
828
850
  }
829
- var qn = new j("tag:yaml.org,2002:int", {
830
- kind: "scalar",
831
- resolve: Si,
832
- construct: ki,
833
- predicate: Ei,
834
- represent: {
835
- binary: function(e) {
836
- return e >= 0 ? "0b" + e.toString(2) : "-0b" + e.toString(2).slice(1);
837
- },
838
- octal: function(e) {
839
- return e >= 0 ? "0o" + e.toString(8) : "-0o" + e.toString(8).slice(1);
840
- },
841
- decimal: function(e) {
842
- return e.toString(10);
843
- },
844
- /* eslint-disable max-len */
845
- hexadecimal: function(e) {
846
- return e >= 0 ? "0x" + e.toString(16).toUpperCase() : "-0x" + e.toString(16).toUpperCase().slice(1);
851
+ function tt(e, n, r) {
852
+ var i, t, o, l, a, s, c = e.tag, u = e.anchor, f = {}, h = /* @__PURE__ */ Object.create(null), g = null, y = null, d = null, b = !1, C = !1, x;
853
+ if (e.firstTabInLine !== -1) return !1;
854
+ for (e.anchor !== null && (e.anchorMap[e.anchor] = f), x = e.input.charCodeAt(e.position); x !== 0; ) {
855
+ if (!b && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, v(e, "tab characters must not be used in indentation")), i = e.input.charCodeAt(e.position + 1), o = e.line, (x === 63 || x === 58) && U(i))
856
+ x === 63 ? (b && (te(e, f, h, g, y, null, l, a, s), g = y = d = null), C = !0, b = !0, t = !0) : b ? (b = !1, t = !0) : v(e, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"), e.position += 1, x = i;
857
+ else {
858
+ if (l = e.line, a = e.lineStart, s = e.position, !le(e, r, tr, !1, !0))
859
+ break;
860
+ if (e.line === o) {
861
+ for (x = e.input.charCodeAt(e.position); Q(x); )
862
+ x = e.input.charCodeAt(++e.position);
863
+ if (x === 58)
864
+ x = e.input.charCodeAt(++e.position), U(x) || v(e, "a whitespace character is expected after the key-value separator within a block mapping"), b && (te(e, f, h, g, y, null, l, a, s), g = y = d = null), C = !0, b = !1, t = !1, g = e.tag, y = e.result;
865
+ else if (C)
866
+ v(e, "can not read an implicit mapping pair; a colon is missed");
867
+ else
868
+ return e.tag = c, e.anchor = u, !0;
869
+ } else if (C)
870
+ v(e, "can not read a block mapping entry; a multiline key may not be an implicit key");
871
+ else
872
+ return e.tag = c, e.anchor = u, !0;
847
873
  }
848
- },
849
- defaultStyle: "decimal",
850
- styleAliases: {
851
- binary: [2, "bin"],
852
- octal: [8, "oct"],
853
- decimal: [10, "dec"],
854
- hexadecimal: [16, "hex"]
874
+ if ((e.line === o || e.lineIndent > n) && (b && (l = e.line, a = e.lineStart, s = e.position), le(e, n, Ee, !0, t) && (b ? y = e.result : d = e.result), b || (te(e, f, h, g, y, d, l, a, s), g = y = d = null), F(e, !0, -1), x = e.input.charCodeAt(e.position)), (e.line === o || e.lineIndent > n) && x !== 0)
875
+ v(e, "bad indentation of a mapping entry");
876
+ else if (e.lineIndent < n)
877
+ break;
855
878
  }
856
- }), _i = new RegExp(
857
- // 2.5e4, 2.5 and integers
858
- "^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
859
- );
860
- function Oi(e) {
861
- return !(e === null || !_i.test(e) || // Quick hack to not allow integers end with `_`
862
- // Probably should update regexp & check speed
863
- e[e.length - 1] === "_");
879
+ return b && te(e, f, h, g, y, null, l, a, s), C && (e.tag = c, e.anchor = u, e.kind = "mapping", e.result = f), C;
864
880
  }
865
- function Fi(e) {
866
- var n, r;
867
- return n = e.replace(/_/g, "").toLowerCase(), r = n[0] === "-" ? -1 : 1, "+-".indexOf(n[0]) >= 0 && (n = n.slice(1)), n === ".inf" ? r === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY : n === ".nan" ? NaN : r * parseFloat(n, 10);
881
+ function ot(e) {
882
+ var n, r = !1, i = !1, t, o, l;
883
+ if (l = e.input.charCodeAt(e.position), l !== 33) return !1;
884
+ if (e.tag !== null && v(e, "duplication of a tag property"), l = e.input.charCodeAt(++e.position), l === 60 ? (r = !0, l = e.input.charCodeAt(++e.position)) : l === 33 ? (i = !0, t = "!!", l = e.input.charCodeAt(++e.position)) : t = "!", n = e.position, r) {
885
+ do
886
+ l = e.input.charCodeAt(++e.position);
887
+ while (l !== 0 && l !== 62);
888
+ e.position < e.length ? (o = e.input.slice(n, e.position), l = e.input.charCodeAt(++e.position)) : v(e, "unexpected end of the stream within a verbatim tag");
889
+ } else {
890
+ for (; l !== 0 && !U(l); )
891
+ l === 33 && (i ? v(e, "tag suffix cannot contain exclamation marks") : (t = e.input.slice(n - 1, e.position + 1), lr.test(t) || v(e, "named tag handle cannot contain such characters"), i = !0, n = e.position + 1)), l = e.input.charCodeAt(++e.position);
892
+ o = e.input.slice(n, e.position), qi.test(o) && v(e, "tag suffix cannot contain flow indicator characters");
893
+ }
894
+ o && !ar.test(o) && v(e, "tag name cannot contain such characters: " + o);
895
+ try {
896
+ o = decodeURIComponent(o);
897
+ } catch {
898
+ v(e, "tag name is malformed: " + o);
899
+ }
900
+ return r ? e.tag = o : G.call(e.tagMap, t) ? e.tag = e.tagMap[t] + o : t === "!" ? e.tag = "!" + o : t === "!!" ? e.tag = "tag:yaml.org,2002:" + o : v(e, 'undeclared tag handle "' + t + '"'), !0;
868
901
  }
869
- var Ti = /^[-+]?[0-9]+e/;
870
- function Li(e, n) {
871
- var r;
872
- if (isNaN(e))
873
- switch (n) {
874
- case "lowercase":
875
- return ".nan";
876
- case "uppercase":
877
- return ".NAN";
878
- case "camelcase":
879
- return ".NaN";
880
- }
881
- else if (Number.POSITIVE_INFINITY === e)
882
- switch (n) {
883
- case "lowercase":
884
- return ".inf";
885
- case "uppercase":
886
- return ".INF";
887
- case "camelcase":
888
- return ".Inf";
889
- }
890
- else if (Number.NEGATIVE_INFINITY === e)
891
- switch (n) {
892
- case "lowercase":
893
- return "-.inf";
894
- case "uppercase":
895
- return "-.INF";
896
- case "camelcase":
897
- return "-.Inf";
898
- }
899
- else if (T.isNegativeZero(e))
900
- return "-0.0";
901
- return r = e.toString(10), Ti.test(r) ? r.replace("e", ".e") : r;
902
+ function lt(e) {
903
+ var n, r;
904
+ if (r = e.input.charCodeAt(e.position), r !== 38) return !1;
905
+ for (e.anchor !== null && v(e, "duplication of an anchor property"), r = e.input.charCodeAt(++e.position), n = e.position; r !== 0 && !U(r) && !ie(r); )
906
+ r = e.input.charCodeAt(++e.position);
907
+ return e.position === n && v(e, "name of an anchor node must contain at least one character"), e.anchor = e.input.slice(n, e.position), !0;
902
908
  }
903
- function ji(e) {
904
- return Object.prototype.toString.call(e) === "[object Number]" && (e % 1 !== 0 || T.isNegativeZero(e));
909
+ function at(e) {
910
+ var n, r, i;
911
+ if (i = e.input.charCodeAt(e.position), i !== 42) return !1;
912
+ for (i = e.input.charCodeAt(++e.position), n = e.position; i !== 0 && !U(i) && !ie(i); )
913
+ i = e.input.charCodeAt(++e.position);
914
+ return e.position === n && v(e, "name of an alias node must contain at least one character"), r = e.input.slice(n, e.position), G.call(e.anchorMap, r) || v(e, 'unidentified alias "' + r + '"'), e.result = e.anchorMap[r], F(e, !0, -1), !0;
905
915
  }
906
- var Gn = new j("tag:yaml.org,2002:float", {
907
- kind: "scalar",
908
- resolve: Oi,
909
- construct: Fi,
910
- predicate: ji,
911
- represent: Li,
912
- defaultStyle: "lowercase"
913
- }), Vn = Hn.extend({
914
- implicit: [
915
- Kn,
916
- Wn,
917
- qn,
918
- Gn
919
- ]
920
- }), Xn = Vn, Qn = new RegExp(
921
- "^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
922
- ), Jn = new RegExp(
923
- "^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"
924
- );
925
- function Ii(e) {
926
- return e === null ? !1 : Qn.exec(e) !== null || Jn.exec(e) !== null;
927
- }
928
- function Ni(e) {
929
- var n, r, i, t, o, l, a, s = 0, c = null, u, f, h;
930
- if (n = Qn.exec(e), n === null && (n = Jn.exec(e)), n === null) throw new Error("Date resolve error");
931
- if (r = +n[1], i = +n[2] - 1, t = +n[3], !n[4])
932
- return new Date(Date.UTC(r, i, t));
933
- if (o = +n[4], l = +n[5], a = +n[6], n[7]) {
934
- for (s = n[7].slice(0, 3); s.length < 3; )
935
- s += "0";
936
- s = +s;
916
+ function le(e, n, r, i, t) {
917
+ var o, l, a, s = 1, c = !1, u = !1, f, h, g, y, d, b;
918
+ if (e.listener !== null && e.listener("open", e), e.tag = null, e.anchor = null, e.kind = null, e.result = null, o = l = a = Ee === r || or === r, i && F(e, !0, -1) && (c = !0, e.lineIndent > n ? s = 1 : e.lineIndent === n ? s = 0 : e.lineIndent < n && (s = -1)), s === 1)
919
+ for (; ot(e) || lt(e); )
920
+ F(e, !0, -1) ? (c = !0, a = o, e.lineIndent > n ? s = 1 : e.lineIndent === n ? s = 0 : e.lineIndent < n && (s = -1)) : a = !1;
921
+ if (a && (a = c || t), (s === 1 || Ee === r) && (Se === r || tr === r ? d = n : d = n + 1, b = e.position - e.lineStart, s === 1 ? a && (yn(e, b) || tt(e, b, d)) || rt(e, d) ? u = !0 : (l && it(e, d) || et(e, d) || nt(e, d) ? u = !0 : at(e) ? (u = !0, (e.tag !== null || e.anchor !== null) && v(e, "alias node should not have any properties")) : Zi(e, d, Se === r) && (u = !0, e.tag === null && (e.tag = "?")), e.anchor !== null && (e.anchorMap[e.anchor] = e.result)) : s === 0 && (u = a && yn(e, b))), e.tag === null)
922
+ e.anchor !== null && (e.anchorMap[e.anchor] = e.result);
923
+ else if (e.tag === "?") {
924
+ for (e.result !== null && e.kind !== "scalar" && v(e, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + e.kind + '"'), f = 0, h = e.implicitTypes.length; f < h; f += 1)
925
+ if (y = e.implicitTypes[f], y.resolve(e.result)) {
926
+ e.result = y.construct(e.result), e.tag = y.tag, e.anchor !== null && (e.anchorMap[e.anchor] = e.result);
927
+ break;
928
+ }
929
+ } else if (e.tag !== "!") {
930
+ if (G.call(e.typeMap[e.kind || "fallback"], e.tag))
931
+ y = e.typeMap[e.kind || "fallback"][e.tag];
932
+ else
933
+ for (y = null, g = e.typeMap.multi[e.kind || "fallback"], f = 0, h = g.length; f < h; f += 1)
934
+ if (e.tag.slice(0, g[f].tag.length) === g[f].tag) {
935
+ y = g[f];
936
+ break;
937
+ }
938
+ y || v(e, "unknown tag !<" + e.tag + ">"), e.result !== null && y.kind !== e.kind && v(e, "unacceptable node kind for !<" + e.tag + '> tag; it should be "' + y.kind + '", not "' + e.kind + '"'), y.resolve(e.result, e.tag) ? (e.result = y.construct(e.result, e.tag), e.anchor !== null && (e.anchorMap[e.anchor] = e.result)) : v(e, "cannot resolve a node with !<" + e.tag + "> explicit tag");
937
939
  }
938
- return n[9] && (u = +n[10], f = +(n[11] || 0), c = (u * 60 + f) * 6e4, n[9] === "-" && (c = -c)), h = new Date(Date.UTC(r, i, t, o, l, a, s)), c && h.setTime(h.getTime() - c), h;
939
- }
940
- function Ri(e) {
941
- return e.toISOString();
942
- }
943
- var Zn = new j("tag:yaml.org,2002:timestamp", {
944
- kind: "scalar",
945
- resolve: Ii,
946
- construct: Ni,
947
- instanceOf: Date,
948
- represent: Ri
949
- });
950
- function Mi(e) {
951
- return e === "<<" || e === null;
940
+ return e.listener !== null && e.listener("close", e), e.tag !== null || e.anchor !== null || u;
952
941
  }
953
- var er = new j("tag:yaml.org,2002:merge", {
954
- kind: "scalar",
955
- resolve: Mi
956
- }), qe = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
957
- \r`;
958
- function Pi(e) {
959
- if (e === null) return !1;
960
- var n, r, i = 0, t = e.length, o = qe;
961
- for (r = 0; r < t; r++)
962
- if (n = o.indexOf(e.charAt(r)), !(n > 64)) {
963
- if (n < 0) return !1;
964
- i += 6;
942
+ function st(e) {
943
+ var n = e.position, r, i, t, o = !1, l;
944
+ for (e.version = null, e.checkLineBreaks = e.legacy, e.tagMap = /* @__PURE__ */ Object.create(null), e.anchorMap = /* @__PURE__ */ Object.create(null); (l = e.input.charCodeAt(e.position)) !== 0 && (F(e, !0, -1), l = e.input.charCodeAt(e.position), !(e.lineIndent > 0 || l !== 37)); ) {
945
+ for (o = !0, l = e.input.charCodeAt(++e.position), r = e.position; l !== 0 && !U(l); )
946
+ l = e.input.charCodeAt(++e.position);
947
+ for (i = e.input.slice(r, e.position), t = [], i.length < 1 && v(e, "directive name must not be less than one character in length"); l !== 0; ) {
948
+ for (; Q(l); )
949
+ l = e.input.charCodeAt(++e.position);
950
+ if (l === 35) {
951
+ do
952
+ l = e.input.charCodeAt(++e.position);
953
+ while (l !== 0 && !H(l));
954
+ break;
955
+ }
956
+ if (H(l)) break;
957
+ for (r = e.position; l !== 0 && !U(l); )
958
+ l = e.input.charCodeAt(++e.position);
959
+ t.push(e.input.slice(r, e.position));
965
960
  }
966
- return i % 8 === 0;
967
- }
968
- function Di(e) {
969
- var n, r, i = e.replace(/[\r\n=]/g, ""), t = i.length, o = qe, l = 0, a = [];
970
- for (n = 0; n < t; n++)
971
- n % 4 === 0 && n && (a.push(l >> 16 & 255), a.push(l >> 8 & 255), a.push(l & 255)), l = l << 6 | o.indexOf(i.charAt(n));
972
- return r = t % 4 * 6, r === 0 ? (a.push(l >> 16 & 255), a.push(l >> 8 & 255), a.push(l & 255)) : r === 18 ? (a.push(l >> 10 & 255), a.push(l >> 2 & 255)) : r === 12 && a.push(l >> 4 & 255), new Uint8Array(a);
973
- }
974
- function $i(e) {
975
- var n = "", r = 0, i, t, o = e.length, l = qe;
976
- for (i = 0; i < o; i++)
977
- i % 3 === 0 && i && (n += l[r >> 18 & 63], n += l[r >> 12 & 63], n += l[r >> 6 & 63], n += l[r & 63]), r = (r << 8) + e[i];
978
- return t = o % 3, t === 0 ? (n += l[r >> 18 & 63], n += l[r >> 12 & 63], n += l[r >> 6 & 63], n += l[r & 63]) : t === 2 ? (n += l[r >> 10 & 63], n += l[r >> 4 & 63], n += l[r << 2 & 63], n += l[64]) : t === 1 && (n += l[r >> 2 & 63], n += l[r << 4 & 63], n += l[64], n += l[64]), n;
979
- }
980
- function zi(e) {
981
- return Object.prototype.toString.call(e) === "[object Uint8Array]";
982
- }
983
- var nr = new j("tag:yaml.org,2002:binary", {
984
- kind: "scalar",
985
- resolve: Pi,
986
- construct: Di,
987
- predicate: zi,
988
- represent: $i
989
- }), Bi = Object.prototype.hasOwnProperty, Ui = Object.prototype.toString;
990
- function Yi(e) {
991
- if (e === null) return !0;
992
- var n = [], r, i, t, o, l, a = e;
993
- for (r = 0, i = a.length; r < i; r += 1) {
994
- if (t = a[r], l = !1, Ui.call(t) !== "[object Object]") return !1;
995
- for (o in t)
996
- if (Bi.call(t, o))
997
- if (!l) l = !0;
998
- else return !1;
999
- if (!l) return !1;
1000
- if (n.indexOf(o) === -1) n.push(o);
1001
- else return !1;
961
+ l !== 0 && Qe(e), G.call(gn, i) ? gn[i](e, i, t) : _e(e, 'unknown document directive "' + i + '"');
1002
962
  }
1003
- return !0;
1004
- }
1005
- function Hi(e) {
1006
- return e !== null ? e : [];
1007
- }
1008
- var rr = new j("tag:yaml.org,2002:omap", {
1009
- kind: "sequence",
1010
- resolve: Yi,
1011
- construct: Hi
1012
- }), Ki = Object.prototype.toString;
1013
- function Wi(e) {
1014
- if (e === null) return !0;
1015
- var n, r, i, t, o, l = e;
1016
- for (o = new Array(l.length), n = 0, r = l.length; n < r; n += 1) {
1017
- if (i = l[n], Ki.call(i) !== "[object Object]" || (t = Object.keys(i), t.length !== 1)) return !1;
1018
- o[n] = [t[0], i[t[0]]];
963
+ if (F(e, !0, -1), e.lineIndent === 0 && e.input.charCodeAt(e.position) === 45 && e.input.charCodeAt(e.position + 1) === 45 && e.input.charCodeAt(e.position + 2) === 45 ? (e.position += 3, F(e, !0, -1)) : o && v(e, "directives end mark is expected"), le(e, e.lineIndent - 1, Ee, !1, !0), F(e, !0, -1), e.checkLineBreaks && Wi.test(e.input.slice(n, e.position)) && _e(e, "non-ASCII line breaks are interpreted as content"), e.documents.push(e.result), e.position === e.lineStart && Ie(e)) {
964
+ e.input.charCodeAt(e.position) === 46 && (e.position += 3, F(e, !0, -1));
965
+ return;
1019
966
  }
1020
- return !0;
967
+ if (e.position < e.length - 1)
968
+ v(e, "end of the stream or a document separator is expected");
969
+ else
970
+ return;
1021
971
  }
1022
- function qi(e) {
1023
- if (e === null) return [];
1024
- var n, r, i, t, o, l = e;
1025
- for (o = new Array(l.length), n = 0, r = l.length; n < r; n += 1)
1026
- i = l[n], t = Object.keys(i), o[n] = [t[0], i[t[0]]];
1027
- return o;
972
+ function pr(e, n) {
973
+ e = String(e), n = n || {}, e.length !== 0 && (e.charCodeAt(e.length - 1) !== 10 && e.charCodeAt(e.length - 1) !== 13 && (e += `
974
+ `), e.charCodeAt(0) === 65279 && (e = e.slice(1)));
975
+ var r = new Ji(e, n), i = e.indexOf("\0");
976
+ for (i !== -1 && (r.position = i, v(r, "null byte is not allowed in input")), r.input += "\0"; r.input.charCodeAt(r.position) === 32; )
977
+ r.lineIndent += 1, r.position += 1;
978
+ for (; r.position < r.length - 1; )
979
+ st(r);
980
+ return r.documents;
1028
981
  }
1029
- var ir = new j("tag:yaml.org,2002:pairs", {
1030
- kind: "sequence",
1031
- resolve: Wi,
1032
- construct: qi
1033
- }), Gi = Object.prototype.hasOwnProperty;
1034
- function Vi(e) {
1035
- if (e === null) return !0;
1036
- var n, r = e;
1037
- for (n in r)
1038
- if (Gi.call(r, n) && r[n] !== null)
1039
- return !1;
1040
- return !0;
982
+ function ct(e, n, r) {
983
+ n !== null && typeof n == "object" && typeof r > "u" && (r = n, n = null);
984
+ var i = pr(e, r);
985
+ if (typeof n != "function")
986
+ return i;
987
+ for (var t = 0, o = i.length; t < o; t += 1)
988
+ n(i[t]);
1041
989
  }
1042
- function Xi(e) {
1043
- return e !== null ? e : {};
990
+ function ut(e, n) {
991
+ var r = pr(e, n);
992
+ if (r.length !== 0) {
993
+ if (r.length === 1)
994
+ return r[0];
995
+ throw new M("expected a single document in the stream, but found more");
996
+ }
1044
997
  }
1045
- var tr = new j("tag:yaml.org,2002:set", {
1046
- kind: "mapping",
1047
- resolve: Vi,
1048
- construct: Xi
1049
- }), Ge = Xn.extend({
1050
- implicit: [
1051
- Zn,
1052
- er
1053
- ],
1054
- explicit: [
1055
- nr,
1056
- rr,
1057
- ir,
1058
- tr
1059
- ]
1060
- }), G = Object.prototype.hasOwnProperty, Ce = 1, or = 2, lr = 3, Se = 4, Re = 1, Qi = 2, dn = 3, Ji = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, Zi = /[\x85\u2028\u2029]/, et = /[,\[\]\{\}]/, ar = /^(?:!|!!|![a-z\-]+!)$/i, sr = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
1061
- function hn(e) {
1062
- return Object.prototype.toString.call(e);
998
+ var ft = ct, pt = ut, dr = {
999
+ loadAll: ft,
1000
+ load: pt
1001
+ }, hr = Object.prototype.toString, gr = Object.prototype.hasOwnProperty, Ze = 65279, dt = 9, he = 10, ht = 13, gt = 32, mt = 33, yt = 34, Ye = 35, vt = 37, xt = 38, wt = 39, bt = 42, mr = 44, At = 45, Oe = 58, kt = 61, Ct = 62, St = 63, Et = 64, yr = 91, vr = 93, _t = 96, xr = 123, Ot = 124, wr = 125, N = {};
1002
+ N[0] = "\\0";
1003
+ N[7] = "\\a";
1004
+ N[8] = "\\b";
1005
+ N[9] = "\\t";
1006
+ N[10] = "\\n";
1007
+ N[11] = "\\v";
1008
+ N[12] = "\\f";
1009
+ N[13] = "\\r";
1010
+ N[27] = "\\e";
1011
+ N[34] = '\\"';
1012
+ N[92] = "\\\\";
1013
+ N[133] = "\\N";
1014
+ N[160] = "\\_";
1015
+ N[8232] = "\\L";
1016
+ N[8233] = "\\P";
1017
+ var Ft = [
1018
+ "y",
1019
+ "Y",
1020
+ "yes",
1021
+ "Yes",
1022
+ "YES",
1023
+ "on",
1024
+ "On",
1025
+ "ON",
1026
+ "n",
1027
+ "N",
1028
+ "no",
1029
+ "No",
1030
+ "NO",
1031
+ "off",
1032
+ "Off",
1033
+ "OFF"
1034
+ ], Tt = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
1035
+ function Lt(e, n) {
1036
+ var r, i, t, o, l, a, s;
1037
+ if (n === null) return {};
1038
+ for (r = {}, i = Object.keys(n), t = 0, o = i.length; t < o; t += 1)
1039
+ l = i[t], a = String(n[l]), l.slice(0, 2) === "!!" && (l = "tag:yaml.org,2002:" + l.slice(2)), s = e.compiledTypeMap.fallback[l], s && gr.call(s.styleAliases, a) && (a = s.styleAliases[a]), r[l] = a;
1040
+ return r;
1063
1041
  }
1064
- function H(e) {
1065
- return e === 10 || e === 13;
1042
+ function jt(e) {
1043
+ var n, r, i;
1044
+ if (n = e.toString(16).toUpperCase(), e <= 255)
1045
+ r = "x", i = 2;
1046
+ else if (e <= 65535)
1047
+ r = "u", i = 4;
1048
+ else if (e <= 4294967295)
1049
+ r = "U", i = 8;
1050
+ else
1051
+ throw new M("code point within a string may not be greater than 0xFFFFFFFF");
1052
+ return "\\" + r + T.repeat("0", i - n.length) + n;
1066
1053
  }
1067
- function Q(e) {
1068
- return e === 9 || e === 32;
1054
+ var It = 1, ge = 2;
1055
+ function Nt(e) {
1056
+ this.schema = e.schema || Xe, this.indent = Math.max(1, e.indent || 2), this.noArrayIndent = e.noArrayIndent || !1, this.skipInvalid = e.skipInvalid || !1, this.flowLevel = T.isNothing(e.flowLevel) ? -1 : e.flowLevel, this.styleMap = Lt(this.schema, e.styles || null), this.sortKeys = e.sortKeys || !1, this.lineWidth = e.lineWidth || 80, this.noRefs = e.noRefs || !1, this.noCompatMode = e.noCompatMode || !1, this.condenseFlow = e.condenseFlow || !1, this.quotingType = e.quotingType === '"' ? ge : It, this.forceQuotes = e.forceQuotes || !1, this.replacer = typeof e.replacer == "function" ? e.replacer : null, this.implicitTypes = this.schema.compiledImplicit, this.explicitTypes = this.schema.compiledExplicit, this.tag = null, this.result = "", this.duplicates = [], this.usedDuplicates = null;
1069
1057
  }
1070
- function U(e) {
1071
- return e === 9 || e === 32 || e === 10 || e === 13;
1058
+ function vn(e, n) {
1059
+ for (var r = T.repeat(" ", n), i = 0, t = -1, o = "", l, a = e.length; i < a; )
1060
+ t = e.indexOf(`
1061
+ `, i), t === -1 ? (l = e.slice(i), i = a) : (l = e.slice(i, t + 1), i = t + 1), l.length && l !== `
1062
+ ` && (o += r), o += l;
1063
+ return o;
1072
1064
  }
1073
- function ie(e) {
1074
- return e === 44 || e === 91 || e === 93 || e === 123 || e === 125;
1065
+ function He(e, n) {
1066
+ return `
1067
+ ` + T.repeat(" ", e.indent * n);
1075
1068
  }
1076
- function nt(e) {
1077
- var n;
1078
- return 48 <= e && e <= 57 ? e - 48 : (n = e | 32, 97 <= n && n <= 102 ? n - 97 + 10 : -1);
1069
+ function Rt(e, n) {
1070
+ var r, i, t;
1071
+ for (r = 0, i = e.implicitTypes.length; r < i; r += 1)
1072
+ if (t = e.implicitTypes[r], t.resolve(n))
1073
+ return !0;
1074
+ return !1;
1079
1075
  }
1080
- function rt(e) {
1081
- return e === 120 ? 2 : e === 117 ? 4 : e === 85 ? 8 : 0;
1076
+ function Fe(e) {
1077
+ return e === gt || e === dt;
1082
1078
  }
1083
- function it(e) {
1084
- return 48 <= e && e <= 57 ? e - 48 : -1;
1079
+ function me(e) {
1080
+ return 32 <= e && e <= 126 || 161 <= e && e <= 55295 && e !== 8232 && e !== 8233 || 57344 <= e && e <= 65533 && e !== Ze || 65536 <= e && e <= 1114111;
1085
1081
  }
1086
- function gn(e) {
1087
- return e === 48 ? "\0" : e === 97 ? "\x07" : e === 98 ? "\b" : e === 116 || e === 9 ? " " : e === 110 ? `
1088
- ` : e === 118 ? "\v" : e === 102 ? "\f" : e === 114 ? "\r" : e === 101 ? "\x1B" : e === 32 ? " " : e === 34 ? '"' : e === 47 ? "/" : e === 92 ? "\\" : e === 78 ? "…" : e === 95 ? " " : e === 76 ? "\u2028" : e === 80 ? "\u2029" : "";
1082
+ function xn(e) {
1083
+ return me(e) && e !== Ze && e !== ht && e !== he;
1089
1084
  }
1090
- function tt(e) {
1091
- return e <= 65535 ? String.fromCharCode(e) : String.fromCharCode(
1092
- (e - 65536 >> 10) + 55296,
1093
- (e - 65536 & 1023) + 56320
1085
+ function wn(e, n, r) {
1086
+ var i = xn(e), t = i && !Fe(e);
1087
+ return (
1088
+ // ns-plain-safe
1089
+ (r ? (
1090
+ // c = flow-in
1091
+ i
1092
+ ) : i && e !== mr && e !== yr && e !== vr && e !== xr && e !== wr) && e !== Ye && !(n === Oe && !t) || xn(n) && !Fe(n) && e === Ye || n === Oe && t
1094
1093
  );
1095
1094
  }
1096
- function cr(e, n, r) {
1097
- n === "__proto__" ? Object.defineProperty(e, n, {
1098
- configurable: !0,
1099
- enumerable: !0,
1100
- writable: !0,
1101
- value: r
1102
- }) : e[n] = r;
1103
- }
1104
- var ur = new Array(256), fr = new Array(256);
1105
- for (var ne = 0; ne < 256; ne++)
1106
- ur[ne] = gn(ne) ? 1 : 0, fr[ne] = gn(ne);
1107
- function ot(e, n) {
1108
- this.input = e, this.filename = n.filename || null, this.schema = n.schema || Ge, this.onWarning = n.onWarning || null, this.legacy = n.legacy || !1, this.json = n.json || !1, this.listener = n.listener || null, this.implicitTypes = this.schema.compiledImplicit, this.typeMap = this.schema.compiledTypeMap, this.length = e.length, this.position = 0, this.line = 0, this.lineStart = 0, this.lineIndent = 0, this.firstTabInLine = -1, this.documents = [];
1095
+ function Pt(e) {
1096
+ return me(e) && e !== Ze && !Fe(e) && e !== At && e !== St && e !== Oe && e !== mr && e !== yr && e !== vr && e !== xr && e !== wr && e !== Ye && e !== xt && e !== bt && e !== mt && e !== Ot && e !== kt && e !== Ct && e !== wt && e !== yt && e !== vt && e !== Et && e !== _t;
1109
1097
  }
1110
- function pr(e, n) {
1111
- var r = {
1112
- name: e.filename,
1113
- buffer: e.input.slice(0, -1),
1114
- // omit trailing \0
1115
- position: e.position,
1116
- line: e.line,
1117
- column: e.position - e.lineStart
1118
- };
1119
- return r.snippet = ci(r), new P(n, r);
1098
+ function Mt(e) {
1099
+ return !Fe(e) && e !== Oe;
1120
1100
  }
1121
- function v(e, n) {
1122
- throw pr(e, n);
1101
+ function pe(e, n) {
1102
+ var r = e.charCodeAt(n), i;
1103
+ return r >= 55296 && r <= 56319 && n + 1 < e.length && (i = e.charCodeAt(n + 1), i >= 56320 && i <= 57343) ? (r - 55296) * 1024 + i - 56320 + 65536 : r;
1123
1104
  }
1124
- function ke(e, n) {
1125
- e.onWarning && e.onWarning.call(null, pr(e, n));
1105
+ function br(e) {
1106
+ var n = /^\n* /;
1107
+ return n.test(e);
1126
1108
  }
1127
- var mn = {
1128
- YAML: function(n, r, i) {
1129
- var t, o, l;
1130
- n.version !== null && v(n, "duplication of %YAML directive"), i.length !== 1 && v(n, "YAML directive accepts exactly one argument"), t = /^([0-9]+)\.([0-9]+)$/.exec(i[0]), t === null && v(n, "ill-formed argument of the YAML directive"), o = parseInt(t[1], 10), l = parseInt(t[2], 10), o !== 1 && v(n, "unacceptable YAML version of the document"), n.version = i[0], n.checkLineBreaks = l < 2, l !== 1 && l !== 2 && ke(n, "unsupported YAML version of the document");
1131
- },
1132
- TAG: function(n, r, i) {
1133
- var t, o;
1134
- i.length !== 2 && v(n, "TAG directive accepts exactly two arguments"), t = i[0], o = i[1], ar.test(t) || v(n, "ill-formed tag handle (first argument) of the TAG directive"), G.call(n.tagMap, t) && v(n, 'there is a previously declared suffix for "' + t + '" tag handle'), sr.test(o) || v(n, "ill-formed tag prefix (second argument) of the TAG directive");
1135
- try {
1136
- o = decodeURIComponent(o);
1137
- } catch {
1138
- v(n, "tag prefix is malformed: " + o);
1109
+ var Ar = 1, Ke = 2, kr = 3, Cr = 4, re = 5;
1110
+ function Dt(e, n, r, i, t, o, l, a) {
1111
+ var s, c = 0, u = null, f = !1, h = !1, g = i !== -1, y = -1, d = Pt(pe(e, 0)) && Mt(pe(e, e.length - 1));
1112
+ if (n || l)
1113
+ for (s = 0; s < e.length; c >= 65536 ? s += 2 : s++) {
1114
+ if (c = pe(e, s), !me(c))
1115
+ return re;
1116
+ d = d && wn(c, u, a), u = c;
1139
1117
  }
1140
- n.tagMap[t] = o;
1141
- }
1142
- };
1143
- function q(e, n, r, i) {
1144
- var t, o, l, a;
1145
- if (n < r) {
1146
- if (a = e.input.slice(n, r), i)
1147
- for (t = 0, o = a.length; t < o; t += 1)
1148
- l = a.charCodeAt(t), l === 9 || 32 <= l && l <= 1114111 || v(e, "expected valid JSON character");
1149
- else Ji.test(a) && v(e, "the stream contains non-printable characters");
1150
- e.result += a;
1118
+ else {
1119
+ for (s = 0; s < e.length; c >= 65536 ? s += 2 : s++) {
1120
+ if (c = pe(e, s), c === he)
1121
+ f = !0, g && (h = h || // Foldable line = too long, and not more-indented.
1122
+ s - y - 1 > i && e[y + 1] !== " ", y = s);
1123
+ else if (!me(c))
1124
+ return re;
1125
+ d = d && wn(c, u, a), u = c;
1126
+ }
1127
+ h = h || g && s - y - 1 > i && e[y + 1] !== " ";
1151
1128
  }
1129
+ return !f && !h ? d && !l && !t(e) ? Ar : o === ge ? re : Ke : r > 9 && br(e) ? re : l ? o === ge ? re : Ke : h ? Cr : kr;
1152
1130
  }
1153
- function yn(e, n, r, i) {
1154
- var t, o, l, a;
1155
- for (T.isObject(r) || v(e, "cannot merge mappings; the provided source object is unacceptable"), t = Object.keys(r), l = 0, a = t.length; l < a; l += 1)
1156
- o = t[l], G.call(n, o) || (cr(n, o, r[o]), i[o] = !0);
1131
+ function $t(e, n, r, i, t) {
1132
+ e.dump = (function() {
1133
+ if (n.length === 0)
1134
+ return e.quotingType === ge ? '""' : "''";
1135
+ if (!e.noCompatMode && (Ft.indexOf(n) !== -1 || Tt.test(n)))
1136
+ return e.quotingType === ge ? '"' + n + '"' : "'" + n + "'";
1137
+ var o = e.indent * Math.max(1, r), l = e.lineWidth === -1 ? -1 : Math.max(Math.min(e.lineWidth, 40), e.lineWidth - o), a = i || e.flowLevel > -1 && r >= e.flowLevel;
1138
+ function s(c) {
1139
+ return Rt(e, c);
1140
+ }
1141
+ switch (Dt(
1142
+ n,
1143
+ a,
1144
+ e.indent,
1145
+ l,
1146
+ s,
1147
+ e.quotingType,
1148
+ e.forceQuotes && !i,
1149
+ t
1150
+ )) {
1151
+ case Ar:
1152
+ return n;
1153
+ case Ke:
1154
+ return "'" + n.replace(/'/g, "''") + "'";
1155
+ case kr:
1156
+ return "|" + bn(n, e.indent) + An(vn(n, o));
1157
+ case Cr:
1158
+ return ">" + bn(n, e.indent) + An(vn(zt(n, l), o));
1159
+ case re:
1160
+ return '"' + Bt(n) + '"';
1161
+ default:
1162
+ throw new M("impossible error: invalid scalar style");
1163
+ }
1164
+ })();
1157
1165
  }
1158
- function te(e, n, r, i, t, o, l, a, s) {
1159
- var c, u;
1160
- if (Array.isArray(t))
1161
- for (t = Array.prototype.slice.call(t), c = 0, u = t.length; c < u; c += 1)
1162
- Array.isArray(t[c]) && v(e, "nested arrays are not supported inside keys"), typeof t == "object" && hn(t[c]) === "[object Object]" && (t[c] = "[object Object]");
1163
- if (typeof t == "object" && hn(t) === "[object Object]" && (t = "[object Object]"), t = String(t), n === null && (n = {}), i === "tag:yaml.org,2002:merge")
1164
- if (Array.isArray(o))
1165
- for (c = 0, u = o.length; c < u; c += 1)
1166
- yn(e, n, o[c], r);
1167
- else
1168
- yn(e, n, o, r);
1169
- else
1170
- !e.json && !G.call(r, t) && G.call(n, t) && (e.line = l || e.line, e.lineStart = a || e.lineStart, e.position = s || e.position, v(e, "duplicated mapping key")), cr(n, t, o), delete r[t];
1171
- return n;
1166
+ function bn(e, n) {
1167
+ var r = br(e) ? String(n) : "", i = e[e.length - 1] === `
1168
+ `, t = i && (e[e.length - 2] === `
1169
+ ` || e === `
1170
+ `), o = t ? "+" : i ? "" : "-";
1171
+ return r + o + `
1172
+ `;
1172
1173
  }
1173
- function Ve(e) {
1174
- var n;
1175
- n = e.input.charCodeAt(e.position), n === 10 ? e.position++ : n === 13 ? (e.position++, e.input.charCodeAt(e.position) === 10 && e.position++) : v(e, "a line break is expected"), e.line += 1, e.lineStart = e.position, e.firstTabInLine = -1;
1174
+ function An(e) {
1175
+ return e[e.length - 1] === `
1176
+ ` ? e.slice(0, -1) : e;
1176
1177
  }
1177
- function F(e, n, r) {
1178
- for (var i = 0, t = e.input.charCodeAt(e.position); t !== 0; ) {
1179
- for (; Q(t); )
1180
- t === 9 && e.firstTabInLine === -1 && (e.firstTabInLine = e.position), t = e.input.charCodeAt(++e.position);
1181
- if (n && t === 35)
1182
- do
1183
- t = e.input.charCodeAt(++e.position);
1184
- while (t !== 10 && t !== 13 && t !== 0);
1185
- if (H(t))
1186
- for (Ve(e), t = e.input.charCodeAt(e.position), i++, e.lineIndent = 0; t === 32; )
1187
- e.lineIndent++, t = e.input.charCodeAt(++e.position);
1188
- else
1189
- break;
1178
+ function zt(e, n) {
1179
+ for (var r = /(\n+)([^\n]*)/g, i = (function() {
1180
+ var c = e.indexOf(`
1181
+ `);
1182
+ return c = c !== -1 ? c : e.length, r.lastIndex = c, kn(e.slice(0, c), n);
1183
+ })(), t = e[0] === `
1184
+ ` || e[0] === " ", o, l; l = r.exec(e); ) {
1185
+ var a = l[1], s = l[2];
1186
+ o = s[0] === " ", i += a + (!t && !o && s !== "" ? `
1187
+ ` : "") + kn(s, n), t = o;
1190
1188
  }
1191
- return r !== -1 && i !== 0 && e.lineIndent < r && ke(e, "deficient indentation"), i;
1189
+ return i;
1192
1190
  }
1193
- function Fe(e) {
1194
- var n = e.position, r;
1195
- return r = e.input.charCodeAt(n), !!((r === 45 || r === 46) && r === e.input.charCodeAt(n + 1) && r === e.input.charCodeAt(n + 2) && (n += 3, r = e.input.charCodeAt(n), r === 0 || U(r)));
1191
+ function kn(e, n) {
1192
+ if (e === "" || e[0] === " ") return e;
1193
+ for (var r = / [^ ]/g, i, t = 0, o, l = 0, a = 0, s = ""; i = r.exec(e); )
1194
+ a = i.index, a - t > n && (o = l > t ? l : a, s += `
1195
+ ` + e.slice(t, o), t = o + 1), l = a;
1196
+ return s += `
1197
+ `, e.length - t > n && l > t ? s += e.slice(t, l) + `
1198
+ ` + e.slice(l + 1) : s += e.slice(t), s.slice(1);
1196
1199
  }
1197
- function Xe(e, n) {
1198
- n === 1 ? e.result += " " : n > 1 && (e.result += T.repeat(`
1199
- `, n - 1));
1200
+ function Bt(e) {
1201
+ for (var n = "", r = 0, i, t = 0; t < e.length; r >= 65536 ? t += 2 : t++)
1202
+ r = pe(e, t), i = N[r], !i && me(r) ? (n += e[t], r >= 65536 && (n += e[t + 1])) : n += i || jt(r);
1203
+ return n;
1200
1204
  }
1201
- function lt(e, n, r) {
1202
- var i, t, o, l, a, s, c, u, f = e.kind, h = e.result, g;
1203
- if (g = e.input.charCodeAt(e.position), U(g) || ie(g) || g === 35 || g === 38 || g === 42 || g === 33 || g === 124 || g === 62 || g === 39 || g === 34 || g === 37 || g === 64 || g === 96 || (g === 63 || g === 45) && (t = e.input.charCodeAt(e.position + 1), U(t) || r && ie(t)))
1204
- return !1;
1205
- for (e.kind = "scalar", e.result = "", o = l = e.position, a = !1; g !== 0; ) {
1206
- if (g === 58) {
1207
- if (t = e.input.charCodeAt(e.position + 1), U(t) || r && ie(t))
1208
- break;
1209
- } else if (g === 35) {
1210
- if (i = e.input.charCodeAt(e.position - 1), U(i))
1211
- break;
1212
- } else {
1213
- if (e.position === e.lineStart && Fe(e) || r && ie(g))
1214
- break;
1215
- if (H(g))
1216
- if (s = e.line, c = e.lineStart, u = e.lineIndent, F(e, !1, -1), e.lineIndent >= n) {
1217
- a = !0, g = e.input.charCodeAt(e.position);
1218
- continue;
1219
- } else {
1220
- e.position = l, e.line = s, e.lineStart = c, e.lineIndent = u;
1221
- break;
1222
- }
1223
- }
1224
- a && (q(e, o, l, !1), Xe(e, e.line - s), o = l = e.position, a = !1), Q(g) || (l = e.position + 1), g = e.input.charCodeAt(++e.position);
1225
- }
1226
- return q(e, o, l, !1), e.result ? !0 : (e.kind = f, e.result = h, !1);
1205
+ function Ut(e, n, r) {
1206
+ var i = "", t = e.tag, o, l, a;
1207
+ for (o = 0, l = r.length; o < l; o += 1)
1208
+ a = r[o], e.replacer && (a = e.replacer.call(r, String(o), a)), (W(e, n, a, !1, !1) || typeof a > "u" && W(e, n, null, !1, !1)) && (i !== "" && (i += "," + (e.condenseFlow ? "" : " ")), i += e.dump);
1209
+ e.tag = t, e.dump = "[" + i + "]";
1227
1210
  }
1228
- function at(e, n) {
1229
- var r, i, t;
1230
- if (r = e.input.charCodeAt(e.position), r !== 39)
1231
- return !1;
1232
- for (e.kind = "scalar", e.result = "", e.position++, i = t = e.position; (r = e.input.charCodeAt(e.position)) !== 0; )
1233
- if (r === 39)
1234
- if (q(e, i, e.position, !0), r = e.input.charCodeAt(++e.position), r === 39)
1235
- i = e.position, e.position++, t = e.position;
1236
- else
1237
- return !0;
1238
- else H(r) ? (q(e, i, t, !0), Xe(e, F(e, !1, n)), i = t = e.position) : e.position === e.lineStart && Fe(e) ? v(e, "unexpected end of the document within a single quoted scalar") : (e.position++, t = e.position);
1239
- v(e, "unexpected end of the stream within a single quoted scalar");
1211
+ function Cn(e, n, r, i) {
1212
+ var t = "", o = e.tag, l, a, s;
1213
+ for (l = 0, a = r.length; l < a; l += 1)
1214
+ s = r[l], e.replacer && (s = e.replacer.call(r, String(l), s)), (W(e, n + 1, s, !0, !0, !1, !0) || typeof s > "u" && W(e, n + 1, null, !0, !0, !1, !0)) && ((!i || t !== "") && (t += He(e, n)), e.dump && he === e.dump.charCodeAt(0) ? t += "-" : t += "- ", t += e.dump);
1215
+ e.tag = o, e.dump = t || "[]";
1240
1216
  }
1241
- function st(e, n) {
1242
- var r, i, t, o, l, a;
1243
- if (a = e.input.charCodeAt(e.position), a !== 34)
1244
- return !1;
1245
- for (e.kind = "scalar", e.result = "", e.position++, r = i = e.position; (a = e.input.charCodeAt(e.position)) !== 0; ) {
1246
- if (a === 34)
1247
- return q(e, r, e.position, !0), e.position++, !0;
1248
- if (a === 92) {
1249
- if (q(e, r, e.position, !0), a = e.input.charCodeAt(++e.position), H(a))
1250
- F(e, !1, n);
1251
- else if (a < 256 && ur[a])
1252
- e.result += fr[a], e.position++;
1253
- else if ((l = rt(a)) > 0) {
1254
- for (t = l, o = 0; t > 0; t--)
1255
- a = e.input.charCodeAt(++e.position), (l = nt(a)) >= 0 ? o = (o << 4) + l : v(e, "expected hexadecimal character");
1256
- e.result += tt(o), e.position++;
1257
- } else
1258
- v(e, "unknown escape sequence");
1259
- r = i = e.position;
1260
- } else H(a) ? (q(e, r, i, !0), Xe(e, F(e, !1, n)), r = i = e.position) : e.position === e.lineStart && Fe(e) ? v(e, "unexpected end of the document within a double quoted scalar") : (e.position++, i = e.position);
1261
- }
1262
- v(e, "unexpected end of the stream within a double quoted scalar");
1217
+ function Yt(e, n, r) {
1218
+ var i = "", t = e.tag, o = Object.keys(r), l, a, s, c, u;
1219
+ for (l = 0, a = o.length; l < a; l += 1)
1220
+ u = "", i !== "" && (u += ", "), e.condenseFlow && (u += '"'), s = o[l], c = r[s], e.replacer && (c = e.replacer.call(r, s, c)), W(e, n, s, !1, !1) && (e.dump.length > 1024 && (u += "? "), u += e.dump + (e.condenseFlow ? '"' : "") + ":" + (e.condenseFlow ? "" : " "), W(e, n, c, !1, !1) && (u += e.dump, i += u));
1221
+ e.tag = t, e.dump = "{" + i + "}";
1263
1222
  }
1264
- function ct(e, n) {
1265
- var r = !0, i, t, o, l = e.tag, a, s = e.anchor, c, u, f, h, g, y = /* @__PURE__ */ Object.create(null), d, b, C, x;
1266
- if (x = e.input.charCodeAt(e.position), x === 91)
1267
- u = 93, g = !1, a = [];
1268
- else if (x === 123)
1269
- u = 125, g = !0, a = {};
1270
- else
1271
- return !1;
1272
- for (e.anchor !== null && (e.anchorMap[e.anchor] = a), x = e.input.charCodeAt(++e.position); x !== 0; ) {
1273
- if (F(e, !0, n), x = e.input.charCodeAt(e.position), x === u)
1274
- return e.position++, e.tag = l, e.anchor = s, e.kind = g ? "mapping" : "sequence", e.result = a, !0;
1275
- r ? x === 44 && v(e, "expected the node content, but found ','") : v(e, "missed comma between flow collection entries"), b = d = C = null, f = h = !1, x === 63 && (c = e.input.charCodeAt(e.position + 1), U(c) && (f = h = !0, e.position++, F(e, !0, n))), i = e.line, t = e.lineStart, o = e.position, oe(e, n, Ce, !1, !0), b = e.tag, d = e.result, F(e, !0, n), x = e.input.charCodeAt(e.position), (h || e.line === i) && x === 58 && (f = !0, x = e.input.charCodeAt(++e.position), F(e, !0, n), oe(e, n, Ce, !1, !0), C = e.result), g ? te(e, a, y, b, d, C, i, t, o) : f ? a.push(te(e, null, y, b, d, C, i, t, o)) : a.push(d), F(e, !0, n), x = e.input.charCodeAt(e.position), x === 44 ? (r = !0, x = e.input.charCodeAt(++e.position)) : r = !1;
1276
- }
1277
- v(e, "unexpected end of the stream within a flow collection");
1223
+ function Ht(e, n, r, i) {
1224
+ var t = "", o = e.tag, l = Object.keys(r), a, s, c, u, f, h;
1225
+ if (e.sortKeys === !0)
1226
+ l.sort();
1227
+ else if (typeof e.sortKeys == "function")
1228
+ l.sort(e.sortKeys);
1229
+ else if (e.sortKeys)
1230
+ throw new M("sortKeys must be a boolean or a function");
1231
+ for (a = 0, s = l.length; a < s; a += 1)
1232
+ h = "", (!i || t !== "") && (h += He(e, n)), c = l[a], u = r[c], e.replacer && (u = e.replacer.call(r, c, u)), W(e, n + 1, c, !0, !0, !0) && (f = e.tag !== null && e.tag !== "?" || e.dump && e.dump.length > 1024, f && (e.dump && he === e.dump.charCodeAt(0) ? h += "?" : h += "? "), h += e.dump, f && (h += He(e, n)), W(e, n + 1, u, !0, f) && (e.dump && he === e.dump.charCodeAt(0) ? h += ":" : h += ": ", h += e.dump, t += h));
1233
+ e.tag = o, e.dump = t || "{}";
1278
1234
  }
1279
- function ut(e, n) {
1280
- var r, i, t = Re, o = !1, l = !1, a = n, s = 0, c = !1, u, f;
1281
- if (f = e.input.charCodeAt(e.position), f === 124)
1282
- i = !1;
1283
- else if (f === 62)
1284
- i = !0;
1285
- else
1286
- return !1;
1287
- for (e.kind = "scalar", e.result = ""; f !== 0; )
1288
- if (f = e.input.charCodeAt(++e.position), f === 43 || f === 45)
1289
- Re === t ? t = f === 43 ? dn : Qi : v(e, "repeat of a chomping mode identifier");
1290
- else if ((u = it(f)) >= 0)
1291
- u === 0 ? v(e, "bad explicit indentation width of a block scalar; it cannot be less than one") : l ? v(e, "repeat of an indentation width identifier") : (a = n + u - 1, l = !0);
1292
- else
1293
- break;
1294
- if (Q(f)) {
1295
- do
1296
- f = e.input.charCodeAt(++e.position);
1297
- while (Q(f));
1298
- if (f === 35)
1299
- do
1300
- f = e.input.charCodeAt(++e.position);
1301
- while (!H(f) && f !== 0);
1302
- }
1303
- for (; f !== 0; ) {
1304
- for (Ve(e), e.lineIndent = 0, f = e.input.charCodeAt(e.position); (!l || e.lineIndent < a) && f === 32; )
1305
- e.lineIndent++, f = e.input.charCodeAt(++e.position);
1306
- if (!l && e.lineIndent > a && (a = e.lineIndent), H(f)) {
1307
- s++;
1308
- continue;
1309
- }
1310
- if (e.lineIndent < a) {
1311
- t === dn ? e.result += T.repeat(`
1312
- `, o ? 1 + s : s) : t === Re && o && (e.result += `
1313
- `);
1314
- break;
1235
+ function Sn(e, n, r) {
1236
+ var i, t, o, l, a, s;
1237
+ for (t = r ? e.explicitTypes : e.implicitTypes, o = 0, l = t.length; o < l; o += 1)
1238
+ if (a = t[o], (a.instanceOf || a.predicate) && (!a.instanceOf || typeof n == "object" && n instanceof a.instanceOf) && (!a.predicate || a.predicate(n))) {
1239
+ if (r ? a.multi && a.representName ? e.tag = a.representName(n) : e.tag = a.tag : e.tag = "?", a.represent) {
1240
+ if (s = e.styleMap[a.tag] || a.defaultStyle, hr.call(a.represent) === "[object Function]")
1241
+ i = a.represent(n, s);
1242
+ else if (gr.call(a.represent, s))
1243
+ i = a.represent[s](n, s);
1244
+ else
1245
+ throw new M("!<" + a.tag + '> tag resolver accepts not "' + s + '" style');
1246
+ e.dump = i;
1247
+ }
1248
+ return !0;
1315
1249
  }
1316
- for (i ? Q(f) ? (c = !0, e.result += T.repeat(`
1317
- `, o ? 1 + s : s)) : c ? (c = !1, e.result += T.repeat(`
1318
- `, s + 1)) : s === 0 ? o && (e.result += " ") : e.result += T.repeat(`
1319
- `, s) : e.result += T.repeat(`
1320
- `, o ? 1 + s : s), o = !0, l = !0, s = 0, r = e.position; !H(f) && f !== 0; )
1321
- f = e.input.charCodeAt(++e.position);
1322
- q(e, r, e.position, !1);
1323
- }
1324
- return !0;
1250
+ return !1;
1325
1251
  }
1326
- function vn(e, n) {
1327
- var r, i = e.tag, t = e.anchor, o = [], l, a = !1, s;
1328
- if (e.firstTabInLine !== -1) return !1;
1329
- for (e.anchor !== null && (e.anchorMap[e.anchor] = o), s = e.input.charCodeAt(e.position); s !== 0 && (e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, v(e, "tab characters must not be used in indentation")), !(s !== 45 || (l = e.input.charCodeAt(e.position + 1), !U(l)))); ) {
1330
- if (a = !0, e.position++, F(e, !0, -1) && e.lineIndent <= n) {
1331
- o.push(null), s = e.input.charCodeAt(e.position);
1332
- continue;
1252
+ function W(e, n, r, i, t, o, l) {
1253
+ e.tag = null, e.dump = r, Sn(e, r, !1) || Sn(e, r, !0);
1254
+ var a = hr.call(e.dump), s = i, c;
1255
+ i && (i = e.flowLevel < 0 || e.flowLevel > n);
1256
+ var u = a === "[object Object]" || a === "[object Array]", f, h;
1257
+ if (u && (f = e.duplicates.indexOf(r), h = f !== -1), (e.tag !== null && e.tag !== "?" || h || e.indent !== 2 && n > 0) && (t = !1), h && e.usedDuplicates[f])
1258
+ e.dump = "*ref_" + f;
1259
+ else {
1260
+ if (u && h && !e.usedDuplicates[f] && (e.usedDuplicates[f] = !0), a === "[object Object]")
1261
+ i && Object.keys(e.dump).length !== 0 ? (Ht(e, n, e.dump, t), h && (e.dump = "&ref_" + f + e.dump)) : (Yt(e, n, e.dump), h && (e.dump = "&ref_" + f + " " + e.dump));
1262
+ else if (a === "[object Array]")
1263
+ i && e.dump.length !== 0 ? (e.noArrayIndent && !l && n > 0 ? Cn(e, n - 1, e.dump, t) : Cn(e, n, e.dump, t), h && (e.dump = "&ref_" + f + e.dump)) : (Ut(e, n, e.dump), h && (e.dump = "&ref_" + f + " " + e.dump));
1264
+ else if (a === "[object String]")
1265
+ e.tag !== "?" && $t(e, e.dump, n, o, s);
1266
+ else {
1267
+ if (a === "[object Undefined]")
1268
+ return !1;
1269
+ if (e.skipInvalid) return !1;
1270
+ throw new M("unacceptable kind of an object to dump " + a);
1333
1271
  }
1334
- if (r = e.line, oe(e, n, lr, !1, !0), o.push(e.result), F(e, !0, -1), s = e.input.charCodeAt(e.position), (e.line === r || e.lineIndent > n) && s !== 0)
1335
- v(e, "bad indentation of a sequence entry");
1336
- else if (e.lineIndent < n)
1337
- break;
1272
+ e.tag !== null && e.tag !== "?" && (c = encodeURI(
1273
+ e.tag[0] === "!" ? e.tag.slice(1) : e.tag
1274
+ ).replace(/!/g, "%21"), e.tag[0] === "!" ? c = "!" + c : c.slice(0, 18) === "tag:yaml.org,2002:" ? c = "!!" + c.slice(18) : c = "!<" + c + ">", e.dump = c + " " + e.dump);
1338
1275
  }
1339
- return a ? (e.tag = i, e.anchor = t, e.kind = "sequence", e.result = o, !0) : !1;
1276
+ return !0;
1340
1277
  }
1341
- function ft(e, n, r) {
1342
- var i, t, o, l, a, s, c = e.tag, u = e.anchor, f = {}, h = /* @__PURE__ */ Object.create(null), g = null, y = null, d = null, b = !1, C = !1, x;
1343
- if (e.firstTabInLine !== -1) return !1;
1344
- for (e.anchor !== null && (e.anchorMap[e.anchor] = f), x = e.input.charCodeAt(e.position); x !== 0; ) {
1345
- if (!b && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, v(e, "tab characters must not be used in indentation")), i = e.input.charCodeAt(e.position + 1), o = e.line, (x === 63 || x === 58) && U(i))
1346
- x === 63 ? (b && (te(e, f, h, g, y, null, l, a, s), g = y = d = null), C = !0, b = !0, t = !0) : b ? (b = !1, t = !0) : v(e, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"), e.position += 1, x = i;
1347
- else {
1348
- if (l = e.line, a = e.lineStart, s = e.position, !oe(e, r, or, !1, !0))
1349
- break;
1350
- if (e.line === o) {
1351
- for (x = e.input.charCodeAt(e.position); Q(x); )
1352
- x = e.input.charCodeAt(++e.position);
1353
- if (x === 58)
1354
- x = e.input.charCodeAt(++e.position), U(x) || v(e, "a whitespace character is expected after the key-value separator within a block mapping"), b && (te(e, f, h, g, y, null, l, a, s), g = y = d = null), C = !0, b = !1, t = !1, g = e.tag, y = e.result;
1355
- else if (C)
1356
- v(e, "can not read an implicit mapping pair; a colon is missed");
1357
- else
1358
- return e.tag = c, e.anchor = u, !0;
1359
- } else if (C)
1360
- v(e, "can not read a block mapping entry; a multiline key may not be an implicit key");
1361
- else
1362
- return e.tag = c, e.anchor = u, !0;
1363
- }
1364
- if ((e.line === o || e.lineIndent > n) && (b && (l = e.line, a = e.lineStart, s = e.position), oe(e, n, Se, !0, t) && (b ? y = e.result : d = e.result), b || (te(e, f, h, g, y, d, l, a, s), g = y = d = null), F(e, !0, -1), x = e.input.charCodeAt(e.position)), (e.line === o || e.lineIndent > n) && x !== 0)
1365
- v(e, "bad indentation of a mapping entry");
1366
- else if (e.lineIndent < n)
1367
- break;
1368
- }
1369
- return b && te(e, f, h, g, y, null, l, a, s), C && (e.tag = c, e.anchor = u, e.kind = "mapping", e.result = f), C;
1278
+ function Kt(e, n) {
1279
+ var r = [], i = [], t, o;
1280
+ for (We(e, r, i), t = 0, o = i.length; t < o; t += 1)
1281
+ n.duplicates.push(r[i[t]]);
1282
+ n.usedDuplicates = new Array(o);
1370
1283
  }
1371
- function pt(e) {
1372
- var n, r = !1, i = !1, t, o, l;
1373
- if (l = e.input.charCodeAt(e.position), l !== 33) return !1;
1374
- if (e.tag !== null && v(e, "duplication of a tag property"), l = e.input.charCodeAt(++e.position), l === 60 ? (r = !0, l = e.input.charCodeAt(++e.position)) : l === 33 ? (i = !0, t = "!!", l = e.input.charCodeAt(++e.position)) : t = "!", n = e.position, r) {
1375
- do
1376
- l = e.input.charCodeAt(++e.position);
1377
- while (l !== 0 && l !== 62);
1378
- e.position < e.length ? (o = e.input.slice(n, e.position), l = e.input.charCodeAt(++e.position)) : v(e, "unexpected end of the stream within a verbatim tag");
1379
- } else {
1380
- for (; l !== 0 && !U(l); )
1381
- l === 33 && (i ? v(e, "tag suffix cannot contain exclamation marks") : (t = e.input.slice(n - 1, e.position + 1), ar.test(t) || v(e, "named tag handle cannot contain such characters"), i = !0, n = e.position + 1)), l = e.input.charCodeAt(++e.position);
1382
- o = e.input.slice(n, e.position), et.test(o) && v(e, "tag suffix cannot contain flow indicator characters");
1383
- }
1384
- o && !sr.test(o) && v(e, "tag name cannot contain such characters: " + o);
1385
- try {
1386
- o = decodeURIComponent(o);
1387
- } catch {
1388
- v(e, "tag name is malformed: " + o);
1389
- }
1390
- return r ? e.tag = o : G.call(e.tagMap, t) ? e.tag = e.tagMap[t] + o : t === "!" ? e.tag = "!" + o : t === "!!" ? e.tag = "tag:yaml.org,2002:" + o : v(e, 'undeclared tag handle "' + t + '"'), !0;
1284
+ function We(e, n, r) {
1285
+ var i, t, o;
1286
+ if (e !== null && typeof e == "object")
1287
+ if (t = n.indexOf(e), t !== -1)
1288
+ r.indexOf(t) === -1 && r.push(t);
1289
+ else if (n.push(e), Array.isArray(e))
1290
+ for (t = 0, o = e.length; t < o; t += 1)
1291
+ We(e[t], n, r);
1292
+ else
1293
+ for (i = Object.keys(e), t = 0, o = i.length; t < o; t += 1)
1294
+ We(e[i[t]], n, r);
1391
1295
  }
1392
- function dt(e) {
1393
- var n, r;
1394
- if (r = e.input.charCodeAt(e.position), r !== 38) return !1;
1395
- for (e.anchor !== null && v(e, "duplication of an anchor property"), r = e.input.charCodeAt(++e.position), n = e.position; r !== 0 && !U(r) && !ie(r); )
1396
- r = e.input.charCodeAt(++e.position);
1397
- return e.position === n && v(e, "name of an anchor node must contain at least one character"), e.anchor = e.input.slice(n, e.position), !0;
1296
+ function Wt(e, n) {
1297
+ n = n || {};
1298
+ var r = new Nt(n);
1299
+ r.noRefs || Kt(e, r);
1300
+ var i = e;
1301
+ return r.replacer && (i = r.replacer.call({ "": i }, "", i)), W(r, 0, i, !0, !0) ? r.dump + `
1302
+ ` : "";
1398
1303
  }
1399
- function ht(e) {
1400
- var n, r, i;
1401
- if (i = e.input.charCodeAt(e.position), i !== 42) return !1;
1402
- for (i = e.input.charCodeAt(++e.position), n = e.position; i !== 0 && !U(i) && !ie(i); )
1403
- i = e.input.charCodeAt(++e.position);
1404
- return e.position === n && v(e, "name of an alias node must contain at least one character"), r = e.input.slice(n, e.position), G.call(e.anchorMap, r) || v(e, 'unidentified alias "' + r + '"'), e.result = e.anchorMap[r], F(e, !0, -1), !0;
1304
+ var qt = Wt, Gt = {
1305
+ dump: qt
1306
+ };
1307
+ function en(e, n) {
1308
+ return function() {
1309
+ throw new Error("Function yaml." + e + " is removed in js-yaml 4. Use yaml." + n + " instead, which is now safe by default.");
1310
+ };
1405
1311
  }
1406
- function oe(e, n, r, i, t) {
1407
- var o, l, a, s = 1, c = !1, u = !1, f, h, g, y, d, b;
1408
- if (e.listener !== null && e.listener("open", e), e.tag = null, e.anchor = null, e.kind = null, e.result = null, o = l = a = Se === r || lr === r, i && F(e, !0, -1) && (c = !0, e.lineIndent > n ? s = 1 : e.lineIndent === n ? s = 0 : e.lineIndent < n && (s = -1)), s === 1)
1409
- for (; pt(e) || dt(e); )
1410
- F(e, !0, -1) ? (c = !0, a = o, e.lineIndent > n ? s = 1 : e.lineIndent === n ? s = 0 : e.lineIndent < n && (s = -1)) : a = !1;
1411
- if (a && (a = c || t), (s === 1 || Se === r) && (Ce === r || or === r ? d = n : d = n + 1, b = e.position - e.lineStart, s === 1 ? a && (vn(e, b) || ft(e, b, d)) || ct(e, d) ? u = !0 : (l && ut(e, d) || at(e, d) || st(e, d) ? u = !0 : ht(e) ? (u = !0, (e.tag !== null || e.anchor !== null) && v(e, "alias node should not have any properties")) : lt(e, d, Ce === r) && (u = !0, e.tag === null && (e.tag = "?")), e.anchor !== null && (e.anchorMap[e.anchor] = e.result)) : s === 0 && (u = a && vn(e, b))), e.tag === null)
1412
- e.anchor !== null && (e.anchorMap[e.anchor] = e.result);
1413
- else if (e.tag === "?") {
1414
- for (e.result !== null && e.kind !== "scalar" && v(e, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + e.kind + '"'), f = 0, h = e.implicitTypes.length; f < h; f += 1)
1415
- if (y = e.implicitTypes[f], y.resolve(e.result)) {
1416
- e.result = y.construct(e.result), e.tag = y.tag, e.anchor !== null && (e.anchorMap[e.anchor] = e.result);
1417
- break;
1418
- }
1419
- } else if (e.tag !== "!") {
1420
- if (G.call(e.typeMap[e.kind || "fallback"], e.tag))
1421
- y = e.typeMap[e.kind || "fallback"][e.tag];
1422
- else
1423
- for (y = null, g = e.typeMap.multi[e.kind || "fallback"], f = 0, h = g.length; f < h; f += 1)
1424
- if (e.tag.slice(0, g[f].tag.length) === g[f].tag) {
1425
- y = g[f];
1426
- break;
1427
- }
1428
- y || v(e, "unknown tag !<" + e.tag + ">"), e.result !== null && y.kind !== e.kind && v(e, "unacceptable node kind for !<" + e.tag + '> tag; it should be "' + y.kind + '", not "' + e.kind + '"'), y.resolve(e.result, e.tag) ? (e.result = y.construct(e.result, e.tag), e.anchor !== null && (e.anchorMap[e.anchor] = e.result)) : v(e, "cannot resolve a node with !<" + e.tag + "> explicit tag");
1312
+ var Vt = j, Xt = $n, Qt = Yn, Jt = Gn, Zt = Vn, eo = Xe, no = dr.load, ro = dr.loadAll, io = Gt.dump, to = M, oo = {
1313
+ binary: er,
1314
+ float: qn,
1315
+ map: Un,
1316
+ null: Hn,
1317
+ pairs: rr,
1318
+ set: ir,
1319
+ timestamp: Jn,
1320
+ bool: Kn,
1321
+ int: Wn,
1322
+ merge: Zn,
1323
+ omap: nr,
1324
+ seq: Bn,
1325
+ str: zn
1326
+ }, lo = en("safeLoad", "load"), ao = en("safeLoadAll", "loadAll"), so = en("safeDump", "dump"), Te = {
1327
+ Type: Vt,
1328
+ Schema: Xt,
1329
+ FAILSAFE_SCHEMA: Qt,
1330
+ JSON_SCHEMA: Jt,
1331
+ CORE_SCHEMA: Zt,
1332
+ DEFAULT_SCHEMA: eo,
1333
+ load: no,
1334
+ loadAll: ro,
1335
+ dump: io,
1336
+ YAMLException: to,
1337
+ types: oo,
1338
+ safeLoad: lo,
1339
+ safeLoadAll: ao,
1340
+ safeDump: so
1341
+ };
1342
+ const ue = "xcstrings-cli", En = Dr(ue, {
1343
+ searchPlaces: [
1344
+ `${ue}.json`,
1345
+ `${ue}.json5`,
1346
+ `${ue}.yaml`,
1347
+ `${ue}.yml`
1348
+ ],
1349
+ loaders: {
1350
+ ".json5": (e, n) => Be.parse(n),
1351
+ ".yaml": (e, n) => Te.load(n),
1352
+ ".yml": (e, n) => Te.load(n)
1353
+ },
1354
+ cache: !1
1355
+ });
1356
+ async function nn(e) {
1357
+ if (e) {
1358
+ const r = await En.load(e);
1359
+ return r ? r.config : null;
1429
1360
  }
1430
- return e.listener !== null && e.listener("close", e), e.tag !== null || e.anchor !== null || u;
1361
+ const n = await En.search();
1362
+ return n ? n.config : null;
1431
1363
  }
1432
- function gt(e) {
1433
- var n = e.position, r, i, t, o = !1, l;
1434
- for (e.version = null, e.checkLineBreaks = e.legacy, e.tagMap = /* @__PURE__ */ Object.create(null), e.anchorMap = /* @__PURE__ */ Object.create(null); (l = e.input.charCodeAt(e.position)) !== 0 && (F(e, !0, -1), l = e.input.charCodeAt(e.position), !(e.lineIndent > 0 || l !== 37)); ) {
1435
- for (o = !0, l = e.input.charCodeAt(++e.position), r = e.position; l !== 0 && !U(l); )
1436
- l = e.input.charCodeAt(++e.position);
1437
- for (i = e.input.slice(r, e.position), t = [], i.length < 1 && v(e, "directive name must not be less than one character in length"); l !== 0; ) {
1438
- for (; Q(l); )
1439
- l = e.input.charCodeAt(++e.position);
1440
- if (l === 35) {
1441
- do
1442
- l = e.input.charCodeAt(++e.position);
1443
- while (l !== 0 && !H(l));
1444
- break;
1445
- }
1446
- if (H(l)) break;
1447
- for (r = e.position; l !== 0 && !U(l); )
1448
- l = e.input.charCodeAt(++e.position);
1449
- t.push(e.input.slice(r, e.position));
1450
- }
1451
- l !== 0 && Ve(e), G.call(mn, i) ? mn[i](e, i, t) : ke(e, 'unknown document directive "' + i + '"');
1364
+ function _n(e, n) {
1365
+ if (!e || e.length === 0) return null;
1366
+ for (const r of e)
1367
+ if (typeof r != "string" && r.alias === n)
1368
+ return r.path;
1369
+ return null;
1370
+ }
1371
+ async function co(e, n, r) {
1372
+ const i = n?.xcstringsPaths, t = i?.some((s) => typeof s != "string") ?? !1, o = e.startsWith("alias:") ? e.slice(6) : null;
1373
+ if (o) {
1374
+ const s = _n(i, o);
1375
+ if (!s)
1376
+ throw new Error(`Unknown alias: ${o}`);
1377
+ return s;
1452
1378
  }
1453
- if (F(e, !0, -1), e.lineIndent === 0 && e.input.charCodeAt(e.position) === 45 && e.input.charCodeAt(e.position + 1) === 45 && e.input.charCodeAt(e.position + 2) === 45 ? (e.position += 3, F(e, !0, -1)) : o && v(e, "directives end mark is expected"), oe(e, e.lineIndent - 1, Se, !1, !0), F(e, !0, -1), e.checkLineBreaks && Zi.test(e.input.slice(n, e.position)) && ke(e, "non-ASCII line breaks are interpreted as content"), e.documents.push(e.result), e.position === e.lineStart && Fe(e)) {
1454
- e.input.charCodeAt(e.position) === 46 && (e.position += 3, F(e, !0, -1));
1455
- return;
1379
+ const l = _n(i, e);
1380
+ if (l)
1381
+ return l;
1382
+ const a = !e.includes("/") && !e.endsWith(".xcstrings");
1383
+ if (t && a)
1384
+ throw new Error(`Unknown alias: ${e}`);
1385
+ if (e === r && i && i.length > 0) {
1386
+ if (i.length === 1) {
1387
+ const u = i[0];
1388
+ return typeof u == "string" ? u : u.path;
1389
+ }
1390
+ const s = i.map((u) => typeof u == "string" ? { name: u, value: u } : { name: `${u.alias} (${u.path})`, value: u.path });
1391
+ return await $r({
1392
+ message: "Select xcstrings file:",
1393
+ choices: s
1394
+ });
1456
1395
  }
1457
- if (e.position < e.length - 1)
1458
- v(e, "end of the stream or a document separator is expected");
1459
- else
1460
- return;
1396
+ return e;
1461
1397
  }
1462
- function dr(e, n) {
1463
- e = String(e), n = n || {}, e.length !== 0 && (e.charCodeAt(e.length - 1) !== 10 && e.charCodeAt(e.length - 1) !== 13 && (e += `
1464
- `), e.charCodeAt(0) === 65279 && (e = e.slice(1)));
1465
- var r = new ot(e, n), i = e.indexOf("\0");
1466
- for (i !== -1 && (r.position = i, v(r, "null byte is not allowed in input")), r.input += "\0"; r.input.charCodeAt(r.position) === 32; )
1467
- r.lineIndent += 1, r.position += 1;
1468
- for (; r.position < r.length - 1; )
1469
- gt(r);
1470
- return r.documents;
1398
+ const qe = ["translated", "needs_review", "new", "stale"];
1399
+ async function ve(e) {
1400
+ const n = await Ur(e, "utf-8");
1401
+ return JSON.parse(n);
1471
1402
  }
1472
- function mt(e, n, r) {
1473
- n !== null && typeof n == "object" && typeof r > "u" && (r = n, n = null);
1474
- var i = dr(e, r);
1475
- if (typeof n != "function")
1476
- return i;
1477
- for (var t = 0, o = i.length; t < o; t += 1)
1478
- n(i[t]);
1403
+ async function Sr(e, n) {
1404
+ const r = JSON.stringify(n, null, 2), i = uo(r);
1405
+ await Rn(e, i + `
1406
+ `, "utf-8");
1479
1407
  }
1480
- function yt(e, n) {
1481
- var r = dr(e, n);
1482
- if (r.length !== 0) {
1483
- if (r.length === 1)
1484
- return r[0];
1485
- throw new P("expected a single document in the stream, but found more");
1408
+ function uo(e) {
1409
+ let n = "", r = !1, i = !1;
1410
+ for (let t = 0; t < e.length; t++) {
1411
+ const o = e[t];
1412
+ if (r && o === "\\" && !i) {
1413
+ i = !0, n += o;
1414
+ continue;
1415
+ }
1416
+ if (i) {
1417
+ i = !1, n += o;
1418
+ continue;
1419
+ }
1420
+ if (o === '"') {
1421
+ r = !r, n += o;
1422
+ continue;
1423
+ }
1424
+ if (!r && o === ":") {
1425
+ n += " :";
1426
+ continue;
1427
+ }
1428
+ n += o;
1486
1429
  }
1430
+ return n;
1487
1431
  }
1488
- var vt = mt, xt = yt, hr = {
1489
- loadAll: vt,
1490
- load: xt
1491
- }, gr = Object.prototype.toString, mr = Object.prototype.hasOwnProperty, Qe = 65279, wt = 9, pe = 10, bt = 13, At = 32, Ct = 33, St = 34, Be = 35, kt = 37, Et = 38, _t = 39, Ot = 42, yr = 44, Ft = 45, Ee = 58, Tt = 61, Lt = 62, jt = 63, It = 64, vr = 91, xr = 93, Nt = 96, wr = 123, Rt = 124, br = 125, N = {};
1492
- N[0] = "\\0";
1493
- N[7] = "\\a";
1494
- N[8] = "\\b";
1495
- N[9] = "\\t";
1496
- N[10] = "\\n";
1497
- N[11] = "\\v";
1498
- N[12] = "\\f";
1499
- N[13] = "\\r";
1500
- N[27] = "\\e";
1501
- N[34] = '\\"';
1502
- N[92] = "\\\\";
1503
- N[133] = "\\N";
1504
- N[160] = "\\_";
1505
- N[8232] = "\\L";
1506
- N[8233] = "\\P";
1507
- var Mt = [
1508
- "y",
1509
- "Y",
1510
- "yes",
1511
- "Yes",
1512
- "YES",
1513
- "on",
1514
- "On",
1515
- "ON",
1516
- "n",
1517
- "N",
1518
- "no",
1519
- "No",
1520
- "NO",
1521
- "off",
1522
- "Off",
1523
- "OFF"
1524
- ], Pt = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
1525
- function Dt(e, n) {
1526
- var r, i, t, o, l, a, s;
1527
- if (n === null) return {};
1528
- for (r = {}, i = Object.keys(n), t = 0, o = i.length; t < o; t += 1)
1529
- l = i[t], a = String(n[l]), l.slice(0, 2) === "!!" && (l = "tag:yaml.org,2002:" + l.slice(2)), s = e.compiledTypeMap.fallback[l], s && mr.call(s.styleAliases, a) && (a = s.styleAliases[a]), r[l] = a;
1530
- return r;
1531
- }
1532
- function $t(e) {
1533
- var n, r, i;
1534
- if (n = e.toString(16).toUpperCase(), e <= 255)
1535
- r = "x", i = 2;
1536
- else if (e <= 65535)
1537
- r = "u", i = 4;
1538
- else if (e <= 4294967295)
1539
- r = "U", i = 8;
1540
- else
1541
- throw new P("code point within a string may not be greater than 0xFFFFFFFF");
1542
- return "\\" + r + T.repeat("0", i - n.length) + n;
1543
- }
1544
- var zt = 1, de = 2;
1545
- function Bt(e) {
1546
- this.schema = e.schema || Ge, this.indent = Math.max(1, e.indent || 2), this.noArrayIndent = e.noArrayIndent || !1, this.skipInvalid = e.skipInvalid || !1, this.flowLevel = T.isNothing(e.flowLevel) ? -1 : e.flowLevel, this.styleMap = Dt(this.schema, e.styles || null), this.sortKeys = e.sortKeys || !1, this.lineWidth = e.lineWidth || 80, this.noRefs = e.noRefs || !1, this.noCompatMode = e.noCompatMode || !1, this.condenseFlow = e.condenseFlow || !1, this.quotingType = e.quotingType === '"' ? de : zt, this.forceQuotes = e.forceQuotes || !1, this.replacer = typeof e.replacer == "function" ? e.replacer : null, this.implicitTypes = this.schema.compiledImplicit, this.explicitTypes = this.schema.compiledExplicit, this.tag = null, this.result = "", this.duplicates = [], this.usedDuplicates = null;
1547
- }
1548
- function xn(e, n) {
1549
- for (var r = T.repeat(" ", n), i = 0, t = -1, o = "", l, a = e.length; i < a; )
1550
- t = e.indexOf(`
1551
- `, i), t === -1 ? (l = e.slice(i), i = a) : (l = e.slice(i, t + 1), i = t + 1), l.length && l !== `
1552
- ` && (o += r), o += l;
1553
- return o;
1554
- }
1555
- function Ue(e, n) {
1556
- return `
1557
- ` + T.repeat(" ", e.indent * n);
1558
- }
1559
- function Ut(e, n) {
1560
- var r, i, t;
1561
- for (r = 0, i = e.implicitTypes.length; r < i; r += 1)
1562
- if (t = e.implicitTypes[r], t.resolve(n))
1563
- return !0;
1564
- return !1;
1565
- }
1566
- function _e(e) {
1567
- return e === At || e === wt;
1568
- }
1569
- function he(e) {
1570
- return 32 <= e && e <= 126 || 161 <= e && e <= 55295 && e !== 8232 && e !== 8233 || 57344 <= e && e <= 65533 && e !== Qe || 65536 <= e && e <= 1114111;
1571
- }
1572
- function wn(e) {
1573
- return he(e) && e !== Qe && e !== bt && e !== pe;
1574
- }
1575
- function bn(e, n, r) {
1576
- var i = wn(e), t = i && !_e(e);
1577
- return (
1578
- // ns-plain-safe
1579
- (r ? (
1580
- // c = flow-in
1581
- i
1582
- ) : i && e !== yr && e !== vr && e !== xr && e !== wr && e !== br) && e !== Be && !(n === Ee && !t) || wn(n) && !_e(n) && e === Be || n === Ee && t
1583
- );
1584
- }
1585
- function Yt(e) {
1586
- return he(e) && e !== Qe && !_e(e) && e !== Ft && e !== jt && e !== Ee && e !== yr && e !== vr && e !== xr && e !== wr && e !== br && e !== Be && e !== Et && e !== Ot && e !== Ct && e !== Rt && e !== Tt && e !== Lt && e !== _t && e !== St && e !== kt && e !== It && e !== Nt;
1587
- }
1588
- function Ht(e) {
1589
- return !_e(e) && e !== Ee;
1432
+ async function fo() {
1433
+ const e = await zr({
1434
+ message: "Enter strings payload (YAML or JSON). Save and close to submit.",
1435
+ default: ""
1436
+ });
1437
+ return typeof e == "string" ? e : "";
1590
1438
  }
1591
- function ue(e, n) {
1592
- var r = e.charCodeAt(n), i;
1593
- return r >= 55296 && r <= 56319 && n + 1 < e.length && (i = e.charCodeAt(n + 1), i >= 56320 && i <= 57343) ? (r - 55296) * 1024 + i - 56320 + 65536 : r;
1439
+ function po(e) {
1440
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
1594
1441
  }
1595
- function Ar(e) {
1596
- var n = /^\n* /;
1597
- return n.test(e);
1442
+ var fe = { exports: {} }, De, On;
1443
+ function ho() {
1444
+ if (On) return De;
1445
+ On = 1;
1446
+ function e(r) {
1447
+ try {
1448
+ return JSON.stringify(r);
1449
+ } catch {
1450
+ return '"[Circular]"';
1451
+ }
1452
+ }
1453
+ De = n;
1454
+ function n(r, i, t) {
1455
+ var o = t && t.stringify || e, l = 1;
1456
+ if (typeof r == "object" && r !== null) {
1457
+ var a = i.length + l;
1458
+ if (a === 1) return r;
1459
+ var s = new Array(a);
1460
+ s[0] = o(r);
1461
+ for (var c = 1; c < a; c++)
1462
+ s[c] = o(i[c]);
1463
+ return s.join(" ");
1464
+ }
1465
+ if (typeof r != "string")
1466
+ return r;
1467
+ var u = i.length;
1468
+ if (u === 0) return r;
1469
+ for (var f = "", h = 1 - l, g = -1, y = r && r.length || 0, d = 0; d < y; ) {
1470
+ if (r.charCodeAt(d) === 37 && d + 1 < y) {
1471
+ switch (g = g > -1 ? g : 0, r.charCodeAt(d + 1)) {
1472
+ case 100:
1473
+ // 'd'
1474
+ case 102:
1475
+ if (h >= u || i[h] == null) break;
1476
+ g < d && (f += r.slice(g, d)), f += Number(i[h]), g = d + 2, d++;
1477
+ break;
1478
+ case 105:
1479
+ if (h >= u || i[h] == null) break;
1480
+ g < d && (f += r.slice(g, d)), f += Math.floor(Number(i[h])), g = d + 2, d++;
1481
+ break;
1482
+ case 79:
1483
+ // 'O'
1484
+ case 111:
1485
+ // 'o'
1486
+ case 106:
1487
+ if (h >= u || i[h] === void 0) break;
1488
+ g < d && (f += r.slice(g, d));
1489
+ var b = typeof i[h];
1490
+ if (b === "string") {
1491
+ f += "'" + i[h] + "'", g = d + 2, d++;
1492
+ break;
1493
+ }
1494
+ if (b === "function") {
1495
+ f += i[h].name || "<anonymous>", g = d + 2, d++;
1496
+ break;
1497
+ }
1498
+ f += o(i[h]), g = d + 2, d++;
1499
+ break;
1500
+ case 115:
1501
+ if (h >= u)
1502
+ break;
1503
+ g < d && (f += r.slice(g, d)), f += String(i[h]), g = d + 2, d++;
1504
+ break;
1505
+ case 37:
1506
+ g < d && (f += r.slice(g, d)), f += "%", g = d + 2, d++, h--;
1507
+ break;
1508
+ }
1509
+ ++h;
1510
+ }
1511
+ ++d;
1512
+ }
1513
+ return g === -1 ? r : (g < y && (f += r.slice(g)), f);
1514
+ }
1515
+ return De;
1598
1516
  }
1599
- var Cr = 1, Ye = 2, Sr = 3, kr = 4, re = 5;
1600
- function Kt(e, n, r, i, t, o, l, a) {
1601
- var s, c = 0, u = null, f = !1, h = !1, g = i !== -1, y = -1, d = Yt(ue(e, 0)) && Ht(ue(e, e.length - 1));
1602
- if (n || l)
1603
- for (s = 0; s < e.length; c >= 65536 ? s += 2 : s++) {
1604
- if (c = ue(e, s), !he(c))
1605
- return re;
1606
- d = d && bn(c, u, a), u = c;
1517
+ var Fn;
1518
+ function go() {
1519
+ if (Fn) return fe.exports;
1520
+ Fn = 1;
1521
+ const e = ho();
1522
+ fe.exports = u;
1523
+ const n = Ir().console || {}, r = {
1524
+ mapHttpRequest: V,
1525
+ mapHttpResponse: V,
1526
+ wrapRequestSerializer: I,
1527
+ wrapResponseSerializer: I,
1528
+ wrapErrorSerializer: I,
1529
+ req: V,
1530
+ res: V,
1531
+ err: R,
1532
+ errWithCause: R
1533
+ };
1534
+ function i(p, m) {
1535
+ return p === "silent" ? 1 / 0 : m.levels.values[p];
1536
+ }
1537
+ const t = Symbol("pino.logFuncs"), o = Symbol("pino.hierarchy"), l = {
1538
+ error: "log",
1539
+ fatal: "error",
1540
+ warn: "error",
1541
+ info: "log",
1542
+ debug: "log",
1543
+ trace: "log"
1544
+ };
1545
+ function a(p, m) {
1546
+ const A = {
1547
+ logger: m,
1548
+ parent: p[o]
1549
+ };
1550
+ m[o] = A;
1551
+ }
1552
+ function s(p, m, A) {
1553
+ const S = {};
1554
+ m.forEach((E) => {
1555
+ S[E] = A[E] ? A[E] : n[E] || n[l[E] || "log"] || ce;
1556
+ }), p[t] = S;
1557
+ }
1558
+ function c(p, m) {
1559
+ return Array.isArray(p) ? p.filter(function(S) {
1560
+ return S !== "!stdSerializers.err";
1561
+ }) : p === !0 ? Object.keys(m) : !1;
1562
+ }
1563
+ function u(p) {
1564
+ p = p || {}, p.browser = p.browser || {};
1565
+ const m = p.browser.transmit;
1566
+ if (m && typeof m.send != "function")
1567
+ throw Error("pino: transmit option must have a send function");
1568
+ const A = p.browser.write || n;
1569
+ p.browser.write && (p.browser.asObject = !0);
1570
+ const S = p.serializers || {}, E = c(p.browser.serialize, S);
1571
+ let z = p.browser.serialize;
1572
+ Array.isArray(p.browser.serialize) && p.browser.serialize.indexOf("!stdSerializers.err") > -1 && (z = !1);
1573
+ const K = Object.keys(p.customLevels || {}), O = ["error", "fatal", "warn", "info", "debug", "trace"].concat(K);
1574
+ typeof A == "function" && O.forEach(function(B) {
1575
+ A[B] = A;
1576
+ }), (p.enabled === !1 || p.browser.disabled) && (p.level = "silent");
1577
+ const P = p.level || "info", w = Object.create(A);
1578
+ w.log || (w.log = ce), s(w, O, A), a({}, w), Object.defineProperty(w, "levelVal", {
1579
+ get: we
1580
+ }), Object.defineProperty(w, "level", {
1581
+ get: Z,
1582
+ set: Nr
1583
+ });
1584
+ const Y = {
1585
+ transmit: m,
1586
+ serialize: E,
1587
+ asObject: p.browser.asObject,
1588
+ formatters: p.browser.formatters,
1589
+ levels: O,
1590
+ timestamp: J(p)
1591
+ };
1592
+ w.levels = f(p), w.level = P, w.setMaxListeners = w.getMaxListeners = w.emit = w.addListener = w.on = w.prependListener = w.once = w.prependOnceListener = w.removeListener = w.removeAllListeners = w.listeners = w.listenerCount = w.eventNames = w.write = w.flush = ce, w.serializers = S, w._serialize = E, w._stdErrSerialize = z, w.child = Rr, m && (w._logEvent = L());
1593
+ function we() {
1594
+ return i(this.level, this);
1595
+ }
1596
+ function Z() {
1597
+ return this._level;
1598
+ }
1599
+ function Nr(B) {
1600
+ if (B !== "silent" && !this.levels.values[B])
1601
+ throw Error("unknown level " + B);
1602
+ this._level = B, y(this, Y, w, "error"), y(this, Y, w, "fatal"), y(this, Y, w, "warn"), y(this, Y, w, "info"), y(this, Y, w, "debug"), y(this, Y, w, "trace"), K.forEach((ee) => {
1603
+ y(this, Y, w, ee);
1604
+ });
1605
+ }
1606
+ function Rr(B, ee) {
1607
+ if (!B)
1608
+ throw new Error("missing bindings for child Pino");
1609
+ ee = ee || {}, E && B.serializers && (ee.serializers = B.serializers);
1610
+ const ln = ee.serializers;
1611
+ if (E && ln) {
1612
+ var be = Object.assign({}, S, ln), an = p.browser.serialize === !0 ? Object.keys(be) : E;
1613
+ delete B.serializers, x([B], an, be, this._stdErrSerialize);
1614
+ }
1615
+ function sn(cn) {
1616
+ this._childLevel = (cn._childLevel | 0) + 1, this.bindings = B, be && (this.serializers = be, this._serialize = an), m && (this._logEvent = L(
1617
+ [].concat(cn._logEvent.bindings, B)
1618
+ ));
1619
+ }
1620
+ sn.prototype = this;
1621
+ const Ne = new sn(this);
1622
+ return a(this, Ne), Ne.level = this.level, Ne;
1623
+ }
1624
+ return w;
1625
+ }
1626
+ function f(p) {
1627
+ const m = p.customLevels || {}, A = Object.assign({}, u.levels.values, m), S = Object.assign({}, u.levels.labels, h(m));
1628
+ return {
1629
+ values: A,
1630
+ labels: S
1631
+ };
1632
+ }
1633
+ function h(p) {
1634
+ const m = {};
1635
+ return Object.keys(p).forEach(function(A) {
1636
+ m[p[A]] = A;
1637
+ }), m;
1638
+ }
1639
+ u.levels = {
1640
+ values: {
1641
+ fatal: 60,
1642
+ error: 50,
1643
+ warn: 40,
1644
+ info: 30,
1645
+ debug: 20,
1646
+ trace: 10
1647
+ },
1648
+ labels: {
1649
+ 10: "trace",
1650
+ 20: "debug",
1651
+ 30: "info",
1652
+ 40: "warn",
1653
+ 50: "error",
1654
+ 60: "fatal"
1655
+ }
1656
+ }, u.stdSerializers = r, u.stdTimeFunctions = Object.assign({}, { nullTime: tn, epochTime: on, unixTime: Lr, isoTime: jr });
1657
+ function g(p) {
1658
+ const m = [];
1659
+ p.bindings && m.push(p.bindings);
1660
+ let A = p[o];
1661
+ for (; A.parent; )
1662
+ A = A.parent, A.logger.bindings && m.push(A.logger.bindings);
1663
+ return m.reverse();
1664
+ }
1665
+ function y(p, m, A, S) {
1666
+ if (Object.defineProperty(p, S, {
1667
+ value: i(p.level, A) > i(S, A) ? ce : A[t][S],
1668
+ writable: !0,
1669
+ enumerable: !0,
1670
+ configurable: !0
1671
+ }), !m.transmit && p[S] === ce)
1672
+ return;
1673
+ p[S] = b(p, m, A, S);
1674
+ const E = g(p);
1675
+ E.length !== 0 && (p[S] = d(E, p[S]));
1676
+ }
1677
+ function d(p, m) {
1678
+ return function() {
1679
+ return m.apply(this, [...p, ...arguments]);
1680
+ };
1681
+ }
1682
+ function b(p, m, A, S) {
1683
+ return /* @__PURE__ */ (function(E) {
1684
+ return function() {
1685
+ const K = m.timestamp(), O = new Array(arguments.length), P = Object.getPrototypeOf && Object.getPrototypeOf(this) === n ? n : this;
1686
+ for (var w = 0; w < O.length; w++) O[w] = arguments[w];
1687
+ if (m.serialize && !m.asObject && x(O, this._serialize, this.serializers, this._stdErrSerialize), m.asObject || m.formatters ? E.call(P, C(this, S, O, K, m.formatters)) : E.apply(P, O), m.transmit) {
1688
+ const Y = m.transmit.level || p._level, we = A.levels.values[Y], Z = A.levels.values[S];
1689
+ if (Z < we) return;
1690
+ _(this, {
1691
+ ts: K,
1692
+ methodLevel: S,
1693
+ methodValue: Z,
1694
+ transmitValue: A.levels.values[m.transmit.level || p._level],
1695
+ send: m.transmit.send,
1696
+ val: i(p._level, A)
1697
+ }, O);
1698
+ }
1699
+ };
1700
+ })(p[t][S]);
1701
+ }
1702
+ function C(p, m, A, S, E = {}) {
1703
+ const {
1704
+ level: z = () => p.levels.values[m],
1705
+ log: K = (Z) => Z
1706
+ } = E;
1707
+ p._serialize && x(A, p._serialize, p.serializers, p._stdErrSerialize);
1708
+ const O = A.slice();
1709
+ let P = O[0];
1710
+ const w = {};
1711
+ S && (w.time = S), w.level = z(m, p.levels.values[m]);
1712
+ let Y = (p._childLevel | 0) + 1;
1713
+ if (Y < 1 && (Y = 1), P !== null && typeof P == "object") {
1714
+ for (; Y-- && typeof O[0] == "object"; )
1715
+ Object.assign(w, O.shift());
1716
+ P = O.length ? e(O.shift(), O) : void 0;
1717
+ } else typeof P == "string" && (P = e(O.shift(), O));
1718
+ return P !== void 0 && (w.msg = P), K(w);
1719
+ }
1720
+ function x(p, m, A, S) {
1721
+ for (const E in p)
1722
+ if (S && p[E] instanceof Error)
1723
+ p[E] = u.stdSerializers.err(p[E]);
1724
+ else if (typeof p[E] == "object" && !Array.isArray(p[E]))
1725
+ for (const z in p[E])
1726
+ m && m.indexOf(z) > -1 && z in A && (p[E][z] = A[z](p[E][z]));
1727
+ }
1728
+ function _(p, m, A) {
1729
+ const S = m.send, E = m.ts, z = m.methodLevel, K = m.methodValue, O = m.val, P = p._logEvent.bindings;
1730
+ x(
1731
+ A,
1732
+ p._serialize || Object.keys(p.serializers),
1733
+ p.serializers,
1734
+ p._stdErrSerialize === void 0 ? !0 : p._stdErrSerialize
1735
+ ), p._logEvent.ts = E, p._logEvent.messages = A.filter(function(w) {
1736
+ return P.indexOf(w) === -1;
1737
+ }), p._logEvent.level.label = z, p._logEvent.level.value = K, S(z, p._logEvent, O), p._logEvent = L(P);
1738
+ }
1739
+ function L(p) {
1740
+ return {
1741
+ ts: 0,
1742
+ messages: [],
1743
+ bindings: p || [],
1744
+ level: { label: "", value: 0 }
1745
+ };
1746
+ }
1747
+ function R(p) {
1748
+ const m = {
1749
+ type: p.constructor.name,
1750
+ msg: p.message,
1751
+ stack: p.stack
1752
+ };
1753
+ for (const A in p)
1754
+ m[A] === void 0 && (m[A] = p[A]);
1755
+ return m;
1756
+ }
1757
+ function J(p) {
1758
+ return typeof p.timestamp == "function" ? p.timestamp : p.timestamp === !1 ? tn : on;
1759
+ }
1760
+ function V() {
1761
+ return {};
1762
+ }
1763
+ function I(p) {
1764
+ return p;
1765
+ }
1766
+ function ce() {
1767
+ }
1768
+ function tn() {
1769
+ return !1;
1770
+ }
1771
+ function on() {
1772
+ return Date.now();
1773
+ }
1774
+ function Lr() {
1775
+ return Math.round(Date.now() / 1e3);
1776
+ }
1777
+ function jr() {
1778
+ return new Date(Date.now()).toISOString();
1779
+ }
1780
+ function Ir() {
1781
+ function p(m) {
1782
+ return typeof m < "u" && m;
1607
1783
  }
1608
- else {
1609
- for (s = 0; s < e.length; c >= 65536 ? s += 2 : s++) {
1610
- if (c = ue(e, s), c === pe)
1611
- f = !0, g && (h = h || // Foldable line = too long, and not more-indented.
1612
- s - y - 1 > i && e[y + 1] !== " ", y = s);
1613
- else if (!he(c))
1614
- return re;
1615
- d = d && bn(c, u, a), u = c;
1784
+ try {
1785
+ return typeof globalThis < "u" || Object.defineProperty(Object.prototype, "globalThis", {
1786
+ get: function() {
1787
+ return delete Object.prototype.globalThis, this.globalThis = this;
1788
+ },
1789
+ configurable: !0
1790
+ }), globalThis;
1791
+ } catch {
1792
+ return p(self) || p(window) || p(this) || {};
1616
1793
  }
1617
- h = h || g && s - y - 1 > i && e[y + 1] !== " ";
1618
1794
  }
1619
- return !f && !h ? d && !l && !t(e) ? Cr : o === de ? re : Ye : r > 9 && Ar(e) ? re : l ? o === de ? re : Ye : h ? kr : Sr;
1795
+ return fe.exports.default = u, fe.exports.pino = u, fe.exports;
1620
1796
  }
1621
- function Wt(e, n, r, i, t) {
1622
- e.dump = (function() {
1623
- if (n.length === 0)
1624
- return e.quotingType === de ? '""' : "''";
1625
- if (!e.noCompatMode && (Mt.indexOf(n) !== -1 || Pt.test(n)))
1626
- return e.quotingType === de ? '"' + n + '"' : "'" + n + "'";
1627
- var o = e.indent * Math.max(1, r), l = e.lineWidth === -1 ? -1 : Math.max(Math.min(e.lineWidth, 40), e.lineWidth - o), a = i || e.flowLevel > -1 && r >= e.flowLevel;
1628
- function s(c) {
1629
- return Ut(e, c);
1630
- }
1631
- switch (Kt(
1632
- n,
1633
- a,
1634
- e.indent,
1635
- l,
1636
- s,
1637
- e.quotingType,
1638
- e.forceQuotes && !i,
1639
- t
1640
- )) {
1641
- case Cr:
1642
- return n;
1643
- case Ye:
1644
- return "'" + n.replace(/'/g, "''") + "'";
1645
- case Sr:
1646
- return "|" + An(n, e.indent) + Cn(xn(n, o));
1647
- case kr:
1648
- return ">" + An(n, e.indent) + Cn(xn(qt(n, l), o));
1649
- case re:
1650
- return '"' + Gt(n) + '"';
1651
- default:
1652
- throw new P("impossible error: invalid scalar style");
1797
+ var mo = go();
1798
+ const yo = /* @__PURE__ */ po(mo), X = yo({
1799
+ level: process.env.LOG_LEVEL || "info"
1800
+ });
1801
+ function vo() {
1802
+ return {
1803
+ command: "languages",
1804
+ describe: "List supported languages from xcodeproj or xcstrings",
1805
+ handler: async (e) => {
1806
+ const n = await Er(e.path, e.config);
1807
+ X.info(n.join(" "));
1653
1808
  }
1654
- })();
1655
- }
1656
- function An(e, n) {
1657
- var r = Ar(e) ? String(n) : "", i = e[e.length - 1] === `
1658
- `, t = i && (e[e.length - 2] === `
1659
- ` || e === `
1660
- `), o = t ? "+" : i ? "" : "-";
1661
- return r + o + `
1662
- `;
1809
+ };
1663
1810
  }
1664
- function Cn(e) {
1665
- return e[e.length - 1] === `
1666
- ` ? e.slice(0, -1) : e;
1811
+ function xo(e) {
1812
+ const n = je(e, "project.pbxproj");
1813
+ return (Yr.open(n).rootObject.props.knownRegions ?? []).filter((o) => o !== "Base").sort();
1667
1814
  }
1668
- function qt(e, n) {
1669
- for (var r = /(\n+)([^\n]*)/g, i = (function() {
1670
- var c = e.indexOf(`
1671
- `);
1672
- return c = c !== -1 ? c : e.length, r.lastIndex = c, Sn(e.slice(0, c), n);
1673
- })(), t = e[0] === `
1674
- ` || e[0] === " ", o, l; l = r.exec(e); ) {
1675
- var a = l[1], s = l[2];
1676
- o = s[0] === " ", i += a + (!t && !o && s !== "" ? `
1677
- ` : "") + Sn(s, n), t = o;
1815
+ async function wo(e) {
1816
+ const n = await ve(e), r = /* @__PURE__ */ new Set();
1817
+ if (!n.sourceLanguage)
1818
+ throw new Error('The xcstrings file is missing "sourceLanguage".');
1819
+ r.add(n.sourceLanguage);
1820
+ for (const i of Object.keys(n.strings)) {
1821
+ const t = n.strings[i];
1822
+ if (t.localizations)
1823
+ for (const o of Object.keys(t.localizations))
1824
+ r.add(o);
1678
1825
  }
1679
- return i;
1680
- }
1681
- function Sn(e, n) {
1682
- if (e === "" || e[0] === " ") return e;
1683
- for (var r = / [^ ]/g, i, t = 0, o, l = 0, a = 0, s = ""; i = r.exec(e); )
1684
- a = i.index, a - t > n && (o = l > t ? l : a, s += `
1685
- ` + e.slice(t, o), t = o + 1), l = a;
1686
- return s += `
1687
- `, e.length - t > n && l > t ? s += e.slice(t, l) + `
1688
- ` + e.slice(l + 1) : s += e.slice(t), s.slice(1);
1689
- }
1690
- function Gt(e) {
1691
- for (var n = "", r = 0, i, t = 0; t < e.length; r >= 65536 ? t += 2 : t++)
1692
- r = ue(e, t), i = N[r], !i && he(r) ? (n += e[t], r >= 65536 && (n += e[t + 1])) : n += i || $t(r);
1693
- return n;
1694
- }
1695
- function Vt(e, n, r) {
1696
- var i = "", t = e.tag, o, l, a;
1697
- for (o = 0, l = r.length; o < l; o += 1)
1698
- a = r[o], e.replacer && (a = e.replacer.call(r, String(o), a)), (W(e, n, a, !1, !1) || typeof a > "u" && W(e, n, null, !1, !1)) && (i !== "" && (i += "," + (e.condenseFlow ? "" : " ")), i += e.dump);
1699
- e.tag = t, e.dump = "[" + i + "]";
1700
- }
1701
- function kn(e, n, r, i) {
1702
- var t = "", o = e.tag, l, a, s;
1703
- for (l = 0, a = r.length; l < a; l += 1)
1704
- s = r[l], e.replacer && (s = e.replacer.call(r, String(l), s)), (W(e, n + 1, s, !0, !0, !1, !0) || typeof s > "u" && W(e, n + 1, null, !0, !0, !1, !0)) && ((!i || t !== "") && (t += Ue(e, n)), e.dump && pe === e.dump.charCodeAt(0) ? t += "-" : t += "- ", t += e.dump);
1705
- e.tag = o, e.dump = t || "[]";
1706
- }
1707
- function Xt(e, n, r) {
1708
- var i = "", t = e.tag, o = Object.keys(r), l, a, s, c, u;
1709
- for (l = 0, a = o.length; l < a; l += 1)
1710
- u = "", i !== "" && (u += ", "), e.condenseFlow && (u += '"'), s = o[l], c = r[s], e.replacer && (c = e.replacer.call(r, s, c)), W(e, n, s, !1, !1) && (e.dump.length > 1024 && (u += "? "), u += e.dump + (e.condenseFlow ? '"' : "") + ":" + (e.condenseFlow ? "" : " "), W(e, n, c, !1, !1) && (u += e.dump, i += u));
1711
- e.tag = t, e.dump = "{" + i + "}";
1712
- }
1713
- function Qt(e, n, r, i) {
1714
- var t = "", o = e.tag, l = Object.keys(r), a, s, c, u, f, h;
1715
- if (e.sortKeys === !0)
1716
- l.sort();
1717
- else if (typeof e.sortKeys == "function")
1718
- l.sort(e.sortKeys);
1719
- else if (e.sortKeys)
1720
- throw new P("sortKeys must be a boolean or a function");
1721
- for (a = 0, s = l.length; a < s; a += 1)
1722
- h = "", (!i || t !== "") && (h += Ue(e, n)), c = l[a], u = r[c], e.replacer && (u = e.replacer.call(r, c, u)), W(e, n + 1, c, !0, !0, !0) && (f = e.tag !== null && e.tag !== "?" || e.dump && e.dump.length > 1024, f && (e.dump && pe === e.dump.charCodeAt(0) ? h += "?" : h += "? "), h += e.dump, f && (h += Ue(e, n)), W(e, n + 1, u, !0, f) && (e.dump && pe === e.dump.charCodeAt(0) ? h += ":" : h += ": ", h += e.dump, t += h));
1723
- e.tag = o, e.dump = t || "{}";
1724
- }
1725
- function En(e, n, r) {
1726
- var i, t, o, l, a, s;
1727
- for (t = r ? e.explicitTypes : e.implicitTypes, o = 0, l = t.length; o < l; o += 1)
1728
- if (a = t[o], (a.instanceOf || a.predicate) && (!a.instanceOf || typeof n == "object" && n instanceof a.instanceOf) && (!a.predicate || a.predicate(n))) {
1729
- if (r ? a.multi && a.representName ? e.tag = a.representName(n) : e.tag = a.tag : e.tag = "?", a.represent) {
1730
- if (s = e.styleMap[a.tag] || a.defaultStyle, gr.call(a.represent) === "[object Function]")
1731
- i = a.represent(n, s);
1732
- else if (mr.call(a.represent, s))
1733
- i = a.represent[s](n, s);
1734
- else
1735
- throw new P("!<" + a.tag + '> tag resolver accepts not "' + s + '" style');
1736
- e.dump = i;
1737
- }
1738
- return !0;
1739
- }
1740
- return !1;
1826
+ return Array.from(r).sort();
1741
1827
  }
1742
- function W(e, n, r, i, t, o, l) {
1743
- e.tag = null, e.dump = r, En(e, r, !1) || En(e, r, !0);
1744
- var a = gr.call(e.dump), s = i, c;
1745
- i && (i = e.flowLevel < 0 || e.flowLevel > n);
1746
- var u = a === "[object Object]" || a === "[object Array]", f, h;
1747
- if (u && (f = e.duplicates.indexOf(r), h = f !== -1), (e.tag !== null && e.tag !== "?" || h || e.indent !== 2 && n > 0) && (t = !1), h && e.usedDuplicates[f])
1748
- e.dump = "*ref_" + f;
1749
- else {
1750
- if (u && h && !e.usedDuplicates[f] && (e.usedDuplicates[f] = !0), a === "[object Object]")
1751
- i && Object.keys(e.dump).length !== 0 ? (Qt(e, n, e.dump, t), h && (e.dump = "&ref_" + f + e.dump)) : (Xt(e, n, e.dump), h && (e.dump = "&ref_" + f + " " + e.dump));
1752
- else if (a === "[object Array]")
1753
- i && e.dump.length !== 0 ? (e.noArrayIndent && !l && n > 0 ? kn(e, n - 1, e.dump, t) : kn(e, n, e.dump, t), h && (e.dump = "&ref_" + f + e.dump)) : (Vt(e, n, e.dump), h && (e.dump = "&ref_" + f + " " + e.dump));
1754
- else if (a === "[object String]")
1755
- e.tag !== "?" && Wt(e, e.dump, n, o, s);
1756
- else {
1757
- if (a === "[object Undefined]")
1758
- return !1;
1759
- if (e.skipInvalid) return !1;
1760
- throw new P("unacceptable kind of an object to dump " + a);
1761
- }
1762
- e.tag !== null && e.tag !== "?" && (c = encodeURI(
1763
- e.tag[0] === "!" ? e.tag.slice(1) : e.tag
1764
- ).replace(/!/g, "%21"), e.tag[0] === "!" ? c = "!" + c : c.slice(0, 18) === "tag:yaml.org,2002:" ? c = "!!" + c.slice(18) : c = "!<" + c + ">", e.dump = c + " " + e.dump);
1828
+ async function Er(e, n) {
1829
+ const { sourceLanguage: r } = await ve(e);
1830
+ if (!r)
1831
+ throw new Error('The xcstrings file is missing "sourceLanguage".');
1832
+ const i = await nn(n);
1833
+ if (i?.xcodeprojPaths && i.xcodeprojPaths.length > 0) {
1834
+ const l = /* @__PURE__ */ new Set();
1835
+ l.add(r);
1836
+ for (const a of i.xcodeprojPaths)
1837
+ xo(a).forEach((c) => l.add(c));
1838
+ return Array.from(l).sort();
1765
1839
  }
1766
- return !0;
1767
- }
1768
- function Jt(e, n) {
1769
- var r = [], i = [], t, o;
1770
- for (He(e, r, i), t = 0, o = i.length; t < o; t += 1)
1771
- n.duplicates.push(r[i[t]]);
1772
- n.usedDuplicates = new Array(o);
1773
- }
1774
- function He(e, n, r) {
1775
- var i, t, o;
1776
- if (e !== null && typeof e == "object")
1777
- if (t = n.indexOf(e), t !== -1)
1778
- r.indexOf(t) === -1 && r.push(t);
1779
- else if (n.push(e), Array.isArray(e))
1780
- for (t = 0, o = e.length; t < o; t += 1)
1781
- He(e[t], n, r);
1782
- else
1783
- for (i = Object.keys(e), t = 0, o = i.length; t < o; t += 1)
1784
- He(e[i[t]], n, r);
1785
- }
1786
- function Zt(e, n) {
1787
- n = n || {};
1788
- var r = new Bt(n);
1789
- r.noRefs || Jt(e, r);
1790
- var i = e;
1791
- return r.replacer && (i = r.replacer.call({ "": i }, "", i)), W(r, 0, i, !0, !0) ? r.dump + `
1792
- ` : "";
1840
+ const t = await wo(e), o = new Set(t);
1841
+ return o.add(r), Array.from(o).sort();
1793
1842
  }
1794
- var eo = Zt, no = {
1795
- dump: eo
1796
- };
1797
- function Je(e, n) {
1798
- return function() {
1799
- throw new Error("Function yaml." + e + " is removed in js-yaml 4. Use yaml." + n + " instead, which is now safe by default.");
1800
- };
1843
+ class oe extends Error {
1844
+ constructor(n) {
1845
+ super(n), this.name = "ArgumentError";
1846
+ }
1801
1847
  }
1802
- var ro = j, io = zn, to = Hn, oo = Vn, lo = Xn, ao = Ge, so = hr.load, co = hr.loadAll, uo = no.dump, fo = P, po = {
1803
- binary: nr,
1804
- float: Gn,
1805
- map: Yn,
1806
- null: Kn,
1807
- pairs: ir,
1808
- set: tr,
1809
- timestamp: Zn,
1810
- bool: Wn,
1811
- int: qn,
1812
- merge: er,
1813
- omap: rr,
1814
- seq: Un,
1815
- str: Bn
1816
- }, ho = Je("safeLoad", "load"), go = Je("safeLoadAll", "loadAll"), mo = Je("safeDump", "dump"), _n = {
1817
- Type: ro,
1818
- Schema: io,
1819
- FAILSAFE_SCHEMA: to,
1820
- JSON_SCHEMA: oo,
1821
- CORE_SCHEMA: lo,
1822
- DEFAULT_SCHEMA: ao,
1823
- load: so,
1824
- loadAll: co,
1825
- dump: uo,
1826
- YAMLException: fo,
1827
- types: po,
1828
- safeLoad: ho,
1829
- safeLoadAll: go,
1830
- safeDump: mo
1831
- };
1832
- const be = (e) => e instanceof Error ? e.message : String(e), Ae = (e, n) => {
1848
+ const ke = (e) => e instanceof Error ? e.message : String(e), Ce = (e, n) => {
1833
1849
  if (e && typeof e == "object" && !Array.isArray(e))
1834
1850
  return e;
1835
1851
  throw new Error(`Parsed --strings as ${n}, but it was not an object.`);
1836
- }, yo = (e, n) => {
1852
+ }, bo = (e, n) => {
1837
1853
  const r = e.trim();
1838
1854
  if (!r)
1839
1855
  return {};
1840
1856
  if (n === "json")
1841
1857
  try {
1842
- return Ae(De.parse(r), "json");
1858
+ return Ce(Be.parse(r), "json");
1843
1859
  } catch (t) {
1844
- throw new Error(`Failed to parse --strings as JSON. Hint: check --strings-format=json. ${be(t)}`);
1860
+ throw new Error(`Failed to parse --strings as JSON. Hint: check --strings-format=json. ${ke(t)}`);
1845
1861
  }
1846
1862
  if (n === "yaml")
1847
1863
  try {
1848
- return Ae(_n.load(r), "yaml");
1864
+ return Ce(Te.load(r), "yaml");
1849
1865
  } catch (t) {
1850
- throw new Error(`Failed to parse --strings as YAML. Hint: check --strings-format=yaml. ${be(t)}`);
1866
+ throw new Error(`Failed to parse --strings as YAML. Hint: check --strings-format=yaml. ${ke(t)}`);
1851
1867
  }
1852
1868
  const i = [];
1853
1869
  try {
1854
- return Ae(_n.load(r), "yaml");
1870
+ return Ce(Te.load(r), "yaml");
1855
1871
  } catch (t) {
1856
- i.push(`yaml error: ${be(t)}`);
1872
+ i.push(`yaml error: ${ke(t)}`);
1857
1873
  }
1858
1874
  try {
1859
- return Ae(De.parse(r), "json");
1875
+ return Ce(Be.parse(r), "json");
1860
1876
  } catch (t) {
1861
- i.push(`json error: ${be(t)}`);
1877
+ i.push(`json error: ${ke(t)}`);
1862
1878
  }
1863
1879
  throw new Error(`Failed to parse --strings input. Provide valid YAML or JSON, or specify --strings-format. ${i.join(" | ")}`);
1864
1880
  };
1865
- async function Er() {
1881
+ async function _r() {
1866
1882
  return new Promise((e) => {
1867
1883
  let n = "";
1868
1884
  process.stdin.setEncoding("utf8"), process.stdin.on("data", (r) => {
@@ -1872,12 +1888,12 @@ async function Er() {
1872
1888
  }), process.stdin.readableEnded && e("");
1873
1889
  });
1874
1890
  }
1875
- const _r = (e) => {
1891
+ const Or = (e) => {
1876
1892
  if (e === void 0) return "translated";
1877
- if ($e.includes(e))
1893
+ if (qe.includes(e))
1878
1894
  return e;
1879
- throw new Error(`Invalid state "${e}". Allowed values: ${$e.join(", ")}.`);
1880
- }, Or = (e, n) => {
1895
+ throw new Error(`Invalid state "${e}". Allowed values: ${qe.join(", ")}.`);
1896
+ }, Fr = (e, n) => {
1881
1897
  if (typeof e == "string")
1882
1898
  return { value: e, state: void 0 };
1883
1899
  if (e && typeof e == "object" && !Array.isArray(e)) {
@@ -1885,18 +1901,18 @@ const _r = (e) => {
1885
1901
  if (typeof r.value != "string")
1886
1902
  throw new Error(`${n} must include a string "value".`);
1887
1903
  let i;
1888
- return r.state !== void 0 && (i = _r(String(r.state))), { value: r.value, state: i };
1904
+ return r.state !== void 0 && (i = Or(String(r.state))), { value: r.value, state: i };
1889
1905
  }
1890
1906
  throw new Error(`${n} must be a string or an object with "value" (and optional "state").`);
1891
- }, Ke = (e, n) => {
1907
+ }, Ge = (e, n) => {
1892
1908
  if (e === void 0) return;
1893
1909
  if (!e || typeof e != "object" || Array.isArray(e))
1894
1910
  throw new Error(`${n} must be an object of language -> text.`);
1895
1911
  const r = {};
1896
1912
  for (const [i, t] of Object.entries(e))
1897
- r[i] = Or(t, `${n} for "${i}"`);
1913
+ r[i] = Fr(t, `${n} for "${i}"`);
1898
1914
  return r;
1899
- }, vo = (e, n) => {
1915
+ }, Ao = (e, n) => {
1900
1916
  if (e == null)
1901
1917
  return {};
1902
1918
  if (typeof e == "string")
@@ -1905,30 +1921,30 @@ const _r = (e) => {
1905
1921
  throw new Error(`Value for "${n}" must be an object.`);
1906
1922
  const r = e, i = {};
1907
1923
  typeof r.comment == "string" && (i.comment = r.comment);
1908
- const t = Ke(r.translations, `translations for "${n}"`) || {}, o = {};
1924
+ const t = Ge(r.translations, `translations for "${n}"`) || {}, o = {};
1909
1925
  for (const [a, s] of Object.entries(r))
1910
- a === "comment" || a === "translations" || (o[a] = Or(s, `Translation for "${a}" in "${n}"`));
1926
+ a === "comment" || a === "translations" || (o[a] = Fr(s, `Translation for "${a}" in "${n}"`));
1911
1927
  const l = { ...t, ...o };
1912
1928
  return Object.keys(l).length > 0 && (i.translations = l), i;
1913
- }, xo = (e) => {
1929
+ }, ko = (e) => {
1914
1930
  if (typeof e == "string") return !0;
1915
1931
  if (e && typeof e == "object" && !Array.isArray(e)) {
1916
1932
  const n = e;
1917
1933
  return typeof n.value == "string" && (n.state === void 0 || typeof n.state == "string");
1918
1934
  }
1919
1935
  return !1;
1920
- }, wo = (e) => Object.values(e).every((n) => xo(n)), bo = (e) => {
1921
- if (wo(e))
1922
- return { kind: "single", translations: Ke(e, "translations") || {} };
1936
+ }, Co = (e) => Object.values(e).every((n) => ko(n)), So = (e) => {
1937
+ if (Co(e))
1938
+ return { kind: "single", translations: Ge(e, "translations") || {} };
1923
1939
  if (Object.keys(e).every((i) => i === "translations" || i === "comment") && "translations" in e) {
1924
- const i = Ke(e.translations, "translations") || {}, t = typeof e.comment == "string" ? e.comment : void 0;
1940
+ const i = Ge(e.translations, "translations") || {}, t = typeof e.comment == "string" ? e.comment : void 0;
1925
1941
  return { kind: "single", translations: i, comment: t };
1926
1942
  }
1927
1943
  const r = {};
1928
1944
  for (const [i, t] of Object.entries(e))
1929
- r[i] = vo(t, i);
1945
+ r[i] = Ao(t, i);
1930
1946
  return { kind: "multi", entries: r };
1931
- }, Ao = (e, n) => {
1947
+ }, Eo = (e, n) => {
1932
1948
  if (!e) return n;
1933
1949
  if (e.kind !== n.kind)
1934
1950
  throw new Error("Cannot merge single and multi --strings payloads. Provide one consistent shape.");
@@ -1951,12 +1967,12 @@ const _r = (e) => {
1951
1967
  }
1952
1968
  return e;
1953
1969
  };
1954
- async function Co(e, n = Er, r = "auto") {
1970
+ async function Tr(e, n = _r, r = "auto") {
1955
1971
  if (e === void 0)
1956
1972
  return;
1957
1973
  const i = async (t) => {
1958
1974
  if (t.trim())
1959
- return bo(yo(t, r));
1975
+ return So(bo(t, r));
1960
1976
  };
1961
1977
  if (e === "") {
1962
1978
  const t = await n();
@@ -1969,7 +1985,7 @@ async function Co(e, n = Er, r = "auto") {
1969
1985
  for (const o of e)
1970
1986
  if (typeof o == "string") {
1971
1987
  const l = await i(o);
1972
- l && (t = Ao(t, l));
1988
+ l && (t = Eo(t, l));
1973
1989
  }
1974
1990
  return t;
1975
1991
  }
@@ -1978,7 +1994,43 @@ async function Co(e, n = Er, r = "auto") {
1978
1994
  return i(t);
1979
1995
  }
1980
1996
  }
1981
- async function So({
1997
+ async function _o(e) {
1998
+ const n = await fo();
1999
+ if (!n.trim())
2000
+ throw new Error("Interactive input was empty. Provide YAML or JSON payload.");
2001
+ const r = (a) => a instanceof Error ? a.message : String(a);
2002
+ let i;
2003
+ try {
2004
+ i = await Tr(n, async () => Promise.resolve(""), "auto");
2005
+ } catch (a) {
2006
+ throw new Error(`Failed to parse interactive input. ${r(a)}`);
2007
+ }
2008
+ if (!i)
2009
+ throw new Error("Interactive input was empty. Provide YAML or JSON payload.");
2010
+ if (i.kind === "multi") {
2011
+ if (e.key || e.comment || e.defaultString !== void 0 || e.language)
2012
+ throw new oe("When adding multiple strings via interactive payload, omit --key, --comment, --text, and --language.");
2013
+ const a = [];
2014
+ for (const [s, c] of Object.entries(i.entries))
2015
+ await Le(e.path, s, c.comment, c.translations, e.configPath, void 0, void 0, e.state), a.push(s);
2016
+ return { kind: "multi", keys: a };
2017
+ }
2018
+ const t = e.key;
2019
+ if (!t)
2020
+ throw new oe("--key is required unless the interactive payload contains multiple keys.");
2021
+ const o = i.kind === "single" ? i.comment : void 0, l = i.kind === "single" ? i.translations : void 0;
2022
+ return await Le(
2023
+ e.path,
2024
+ t,
2025
+ e.comment ?? o,
2026
+ l,
2027
+ e.configPath,
2028
+ e.defaultString,
2029
+ e.language,
2030
+ e.state
2031
+ ), { kind: "single", keys: [t] };
2032
+ }
2033
+ async function Oo({
1982
2034
  path: e,
1983
2035
  key: n,
1984
2036
  comment: r,
@@ -1986,30 +2038,45 @@ async function So({
1986
2038
  stringsFormat: t,
1987
2039
  defaultString: o,
1988
2040
  language: l,
1989
- stdinReader: a = Er,
2041
+ stdinReader: a = _r,
1990
2042
  configPath: s,
1991
- state: c
2043
+ state: c,
2044
+ interactive: u
1992
2045
  }) {
1993
- const u = await Co(i, a, t), f = _r(c);
1994
- if (u?.kind === "multi") {
2046
+ const f = Or(c);
2047
+ if (u) {
2048
+ if (i !== void 0)
2049
+ throw new oe("--interactive cannot be combined with --strings input.");
2050
+ return _o({
2051
+ path: e,
2052
+ key: n,
2053
+ comment: r,
2054
+ defaultString: o,
2055
+ language: l,
2056
+ configPath: s,
2057
+ state: f
2058
+ });
2059
+ }
2060
+ const h = await Tr(i, a, t);
2061
+ if (h?.kind === "multi") {
1995
2062
  if (n || r || o !== void 0 || l)
1996
- throw new Error("When adding multiple strings via --strings payload, omit --key, --comment, --text, and --language.");
1997
- const d = [];
1998
- for (const [b, C] of Object.entries(u.entries))
1999
- await On(e, b, C.comment, C.translations, s, void 0, void 0, f), d.push(b);
2000
- return { kind: "multi", keys: d };
2001
- }
2002
- const h = n;
2003
- if (!h)
2004
- throw new Error("--key is required unless the --strings payload contains multiple keys.");
2005
- const g = u?.kind === "single" ? u.translations : void 0, y = u?.kind === "single" ? u.comment : void 0;
2006
- return await On(e, h, r ?? y, g, s, o, l, f), { kind: "single", keys: [h] };
2007
- }
2008
- const ko = (e) => {
2063
+ throw new oe("When adding multiple strings via --strings payload, omit --key, --comment, --text, and --language.");
2064
+ const b = [];
2065
+ for (const [C, x] of Object.entries(h.entries))
2066
+ await Le(e, C, x.comment, x.translations, s, void 0, void 0, f), b.push(C);
2067
+ return { kind: "multi", keys: b };
2068
+ }
2069
+ const g = n;
2070
+ if (!g)
2071
+ throw new oe("--key is required unless the --strings payload contains multiple keys.");
2072
+ const y = h?.kind === "single" ? h.translations : void 0, d = h?.kind === "single" ? h.comment : void 0;
2073
+ return await Le(e, g, r ?? d, y, s, o, l, f), { kind: "single", keys: [g] };
2074
+ }
2075
+ const Fo = (e) => {
2009
2076
  const n = Object.entries(e).sort(([r], [i]) => r.localeCompare(i, "en", { sensitivity: "case" }));
2010
2077
  return Object.fromEntries(n);
2011
2078
  };
2012
- function Eo() {
2079
+ function To() {
2013
2080
  return {
2014
2081
  command: "add",
2015
2082
  describe: "Add a string",
@@ -2026,7 +2093,7 @@ function Eo() {
2026
2093
  describe: "The language of the string provided with --text"
2027
2094
  }).option("state", {
2028
2095
  type: "string",
2029
- choices: $e,
2096
+ choices: qe,
2030
2097
  describe: "State to apply to added strings (translated | needs_review | new | stale)"
2031
2098
  }).option("text", {
2032
2099
  type: "string",
@@ -2039,9 +2106,13 @@ function Eo() {
2039
2106
  choices: ["auto", "json", "yaml"],
2040
2107
  default: "auto",
2041
2108
  describe: "Format for the data provided with --strings"
2109
+ }).option("interactive", {
2110
+ type: "boolean",
2111
+ alias: "i",
2112
+ describe: "Add strings in an interactive flow"
2042
2113
  }),
2043
2114
  handler: async (e) => {
2044
- const n = await So({
2115
+ const n = await Oo({
2045
2116
  path: e.path,
2046
2117
  key: e.key,
2047
2118
  comment: e.comment,
@@ -2051,23 +2122,24 @@ function Eo() {
2051
2122
  language: e.language,
2052
2123
  state: e.state,
2053
2124
  stdinReader: void 0,
2054
- configPath: e.config
2125
+ configPath: e.config,
2126
+ interactive: e.interactive
2055
2127
  });
2056
- X.info(S.green(`✓ Added keys:
2128
+ X.info(k.green(`✓ Added keys:
2057
2129
  ${n.keys.map((r) => `- ${r}`).join(`
2058
2130
  `)}`));
2059
2131
  }
2060
2132
  };
2061
2133
  }
2062
- async function On(e, n, r, i, t, o, l, a) {
2063
- const s = await me(e);
2134
+ async function Le(e, n, r, i, t, o, l, a) {
2135
+ const s = await ve(e);
2064
2136
  if (!s.sourceLanguage)
2065
2137
  throw new Error('The xcstrings file is missing "sourceLanguage".');
2066
2138
  const c = s.sourceLanguage;
2067
2139
  s.strings || (s.strings = {});
2068
- const f = (await We(t))?.missingLanguagePolicy || "skip";
2140
+ const f = (await nn(t))?.missingLanguagePolicy || "skip";
2069
2141
  let h;
2070
- const g = async (_) => f === "include" ? !0 : (h || (h = await Pn(e, t)), h.includes(_)), y = (_) => {
2142
+ const g = async (_) => f === "include" ? !0 : (h || (h = await Er(e, t)), h.includes(_)), y = (_) => {
2071
2143
  X.warn(`Language "${_}" is not supported. Skipped adding its translation (missingLanguagePolicy=skip).`);
2072
2144
  }, d = {
2073
2145
  ...s.strings[n],
@@ -2116,9 +2188,9 @@ async function On(e, n, r, i, t, o, l, a) {
2116
2188
  };
2117
2189
  }
2118
2190
  }
2119
- s.strings[n] = d, d.localizations && (d.localizations = ko(d.localizations)), await Mn(e, s);
2191
+ s.strings[n] = d, d.localizations && (d.localizations = Fo(d.localizations)), await Sr(e, s);
2120
2192
  }
2121
- function _o() {
2193
+ function Lo() {
2122
2194
  return {
2123
2195
  command: "remove",
2124
2196
  describe: "Remove a string",
@@ -2142,7 +2214,7 @@ function _o() {
2142
2214
  throw new Error("Either --key or --languages must be provided");
2143
2215
  }),
2144
2216
  handler: async (e) => {
2145
- const n = await Fo(
2217
+ const n = await Io(
2146
2218
  e.path,
2147
2219
  e.key,
2148
2220
  e.languages,
@@ -2150,24 +2222,24 @@ function _o() {
2150
2222
  ), r = Object.entries(n).map(([i, t]) => `- [${t.join(" ")}] ${i}`).join(`
2151
2223
  `);
2152
2224
  if (e.dryRun) {
2153
- r.length === 0 ? X.info(S.yellow("No matching strings found.")) : X.info(S.blue(`Would remove:
2225
+ r.length === 0 ? X.info(k.yellow("No matching strings found.")) : X.info(k.blue(`Would remove:
2154
2226
  ${r}`));
2155
2227
  return;
2156
2228
  }
2157
- r.length === 0 ? X.info(S.yellow("No matching strings found.")) : X.info(S.green(`✓ Removed
2229
+ r.length === 0 ? X.info(k.yellow("No matching strings found.")) : X.info(k.green(`✓ Removed
2158
2230
  ${r}`));
2159
2231
  }
2160
2232
  };
2161
2233
  }
2162
- function Oo(e, n, r, i, t) {
2234
+ function jo(e, n, r, i, t) {
2163
2235
  if (e.localizations) {
2164
2236
  for (const o of n)
2165
2237
  e.localizations[o] && (t[i] ??= [], t[i].push(o), r || delete e.localizations[o]);
2166
2238
  !r && e.localizations && Object.keys(e.localizations).length === 0 && delete e.localizations;
2167
2239
  }
2168
2240
  }
2169
- async function Fo(e, n, r, i = !1) {
2170
- const t = await me(e), o = {}, l = t.strings || {};
2241
+ async function Io(e, n, r, i = !1) {
2242
+ const t = await ve(e), o = {}, l = t.strings || {};
2171
2243
  t.strings = l;
2172
2244
  const a = n ? [n] : Object.keys(l);
2173
2245
  let s = !1;
@@ -2180,29 +2252,29 @@ async function Fo(e, n, r, i = !1) {
2180
2252
  o[c] = g, i || delete l[c], s = !0;
2181
2253
  continue;
2182
2254
  }
2183
- Oo(u, r, i, c, o);
2255
+ jo(u, r, i, c, o);
2184
2256
  const f = o[c]?.length ?? 0;
2185
2257
  !(u.localizations && Object.keys(u.localizations).length > 0) && f > 0 && (i || delete l[c]), f > 0 && (s = !0);
2186
2258
  }
2187
- return !i && s && await Mn(e, t), o;
2259
+ return !i && s && await Sr(e, t), o;
2188
2260
  }
2189
- const Me = "xcstrings-cli.json5";
2190
- function To() {
2261
+ const $e = "xcstrings-cli.yaml";
2262
+ function No() {
2191
2263
  return {
2192
2264
  command: "init",
2193
2265
  describe: "Initialize configuration file",
2194
2266
  handler: async () => {
2195
- await Io();
2267
+ await Mo();
2196
2268
  }
2197
2269
  };
2198
2270
  }
2199
- async function Lo(e) {
2271
+ async function Ro(e) {
2200
2272
  const n = [];
2201
2273
  async function r(i) {
2202
2274
  try {
2203
- const t = await Rn(i, { withFileTypes: !0 });
2275
+ const t = await Pn(i, { withFileTypes: !0 });
2204
2276
  for (const o of t) {
2205
- const l = Oe(i, o.name);
2277
+ const l = je(i, o.name);
2206
2278
  o.isDirectory() ? !o.name.startsWith(".") && o.name !== "node_modules" && await r(l) : o.name.endsWith(".xcstrings") && n.push(l);
2207
2279
  }
2208
2280
  } catch {
@@ -2210,104 +2282,102 @@ async function Lo(e) {
2210
2282
  }
2211
2283
  return await r(e), n;
2212
2284
  }
2213
- async function jo(e) {
2285
+ async function Po(e) {
2214
2286
  const n = [];
2215
2287
  let r = e;
2216
2288
  try {
2217
- const i = await Rn(r, { withFileTypes: !0 });
2289
+ const i = await Pn(r, { withFileTypes: !0 });
2218
2290
  for (const t of i)
2219
- t.isDirectory() && t.name.endsWith(".xcodeproj") && n.push(Oe(r, t.name));
2291
+ t.isDirectory() && t.name.endsWith(".xcodeproj") && n.push(je(r, t.name));
2220
2292
  } catch {
2221
2293
  }
2222
2294
  return n;
2223
2295
  }
2224
- async function Io() {
2296
+ async function Mo() {
2225
2297
  const e = process.cwd();
2226
- console.log(), console.log(S.bold.cyan("🚀 xcstrings-cli Configuration Setup")), console.log(S.dim("─".repeat(40))), console.log(), console.log(S.yellow("🔍 Searching for .xcstrings files..."));
2227
- const n = await Lo(e);
2228
- console.log(S.yellow("🔍 Searching for .xcodeproj directories..."));
2229
- const r = await jo(e);
2298
+ console.log(), console.log(k.bold.cyan("🚀 xcstrings-cli Configuration Setup")), console.log(k.dim("─".repeat(40))), console.log(), console.log(k.yellow("🔍 Searching for .xcstrings files..."));
2299
+ const n = await Ro(e);
2300
+ console.log(k.yellow("🔍 Searching for .xcodeproj directories..."));
2301
+ const r = await Po(e);
2230
2302
  console.log();
2231
2303
  let i = [];
2232
2304
  if (n.length > 0) {
2233
- console.log(S.green(`✓ Found ${n.length} .xcstrings file(s)`)), console.log();
2305
+ console.log(k.green(`✓ Found ${n.length} .xcstrings file(s)`)), console.log();
2234
2306
  const c = n.map((u) => ({
2235
- name: S.white(we(e, u)) + S.dim(` (${u})`),
2236
- value: we(e, u),
2307
+ name: k.white(Ae(e, u)) + k.dim(` (${u})`),
2308
+ value: Ae(e, u),
2237
2309
  checked: !0
2238
2310
  }));
2239
- i = await an({
2240
- message: S.bold("Select .xcstrings files to manage:"),
2311
+ i = await un({
2312
+ message: k.bold("Select .xcstrings files to manage:"),
2241
2313
  choices: c
2242
2314
  });
2243
2315
  } else
2244
- console.log(S.dim(" No .xcstrings files found in current directory"));
2316
+ console.log(k.dim(" No .xcstrings files found in current directory"));
2245
2317
  console.log();
2246
2318
  let t = [];
2247
2319
  if (r.length > 0) {
2248
- console.log(S.green(`✓ Found ${r.length} .xcodeproj director${r.length === 1 ? "y" : "ies"}`)), console.log();
2320
+ console.log(k.green(`✓ Found ${r.length} .xcodeproj director${r.length === 1 ? "y" : "ies"}`)), console.log();
2249
2321
  const c = r.map((u) => ({
2250
- name: S.white(we(e, u) || u) + S.dim(` (${u})`),
2251
- value: we(e, u) || u,
2322
+ name: k.white(Ae(e, u) || u) + k.dim(` (${u})`),
2323
+ value: Ae(e, u) || u,
2252
2324
  checked: !0
2253
2325
  }));
2254
- t = await an({
2255
- message: S.bold("Select .xcodeproj directories for language detection:"),
2326
+ t = await un({
2327
+ message: k.bold("Select .xcodeproj directories for language detection:"),
2256
2328
  choices: c
2257
2329
  });
2258
2330
  } else
2259
- console.log(S.dim(" No .xcodeproj directories found"));
2260
- if (console.log(), console.log(S.dim("─".repeat(40))), console.log(), console.log(S.bold("📋 Configuration Summary:")), console.log(), console.log(S.cyan(" xcstringsPaths:")), i.length > 0 ? i.forEach((c) => console.log(S.white(` • ${c}`))) : console.log(S.dim(" (none)")), console.log(), console.log(S.cyan(" xcodeprojPaths:")), t.length > 0 ? t.forEach((c) => console.log(S.white(` • ${c}`))) : console.log(S.dim(" (none)")), console.log(), !await Dr({
2261
- message: S.bold(`Create ${S.yellow(Me)}?`),
2331
+ console.log(k.dim(" No .xcodeproj directories found"));
2332
+ if (console.log(), console.log(k.dim("─".repeat(40))), console.log(), console.log(k.bold("📋 Configuration Summary:")), console.log(), console.log(k.cyan(" xcstringsPaths:")), i.length > 0 ? i.forEach((c) => console.log(k.white(` • ${c}`))) : console.log(k.dim(" (none)")), console.log(), console.log(k.cyan(" xcodeprojPaths:")), t.length > 0 ? t.forEach((c) => console.log(k.white(` • ${c}`))) : console.log(k.dim(" (none)")), console.log(), !await Br({
2333
+ message: k.bold(`Create ${k.yellow($e)}?`),
2262
2334
  default: !0
2263
2335
  })) {
2264
- console.log(S.dim(" Configuration cancelled."));
2336
+ console.log(k.dim(" Configuration cancelled."));
2265
2337
  return;
2266
2338
  }
2267
- const l = i.map((c) => ` "${c}"`).join(`,
2268
- `), a = t.map((c) => ` "${c}"`).join(`,
2269
- `), s = `{
2270
- // Paths to .xcstrings files to manage. Specify relative or absolute paths.
2271
- xcstringsPaths: [
2272
- ${l}
2273
- ],
2274
- // Paths to .xcodeproj directories. Used for discovering supported languages.
2275
- xcodeprojPaths: [
2276
- ${a}
2277
- ],
2278
- // Behavior for handling missing languages when adding strings.
2279
- missingLanguagePolicy: "skip",
2280
- }
2339
+ const l = i.length > 0 ? `
2340
+ ` + i.map((c) => ` - "${c}"`).join(`
2341
+ `) : " []", a = t.length > 0 ? `
2342
+ ` + t.map((c) => ` - "${c}"`).join(`
2343
+ `) : " []", s = `# Behavior for handling missing languages when adding strings.
2344
+ missingLanguagePolicy: "skip"
2345
+
2346
+ # Paths to .xcstrings files to manage. Specify relative or absolute paths.
2347
+ xcstringsPaths:${l}
2348
+
2349
+ # Paths to .xcodeproj directories. Used for discovering supported languages.
2350
+ xcodeprojPaths:${a}
2281
2351
  `;
2282
- await Nn(Me, s, "utf-8"), console.log(), console.log(S.bold.green(`✓ Created ${Me}`)), console.log(S.dim(` Run ${S.cyan("xcstrings --help")} to see available commands.`)), console.log();
2352
+ await Rn($e, s, "utf-8"), console.log(), console.log(k.bold.green(`✓ Created ${$e}`)), console.log(k.dim(` Run ${k.cyan("xcstrings --help")} to see available commands.`)), console.log();
2283
2353
  }
2284
- var No = Object.prototype.toString, ae = Array.isArray || function(n) {
2285
- return No.call(n) === "[object Array]";
2354
+ var Do = Object.prototype.toString, se = Array.isArray || function(n) {
2355
+ return Do.call(n) === "[object Array]";
2286
2356
  };
2287
- function Ze(e) {
2357
+ function rn(e) {
2288
2358
  return typeof e == "function";
2289
2359
  }
2290
- function Ro(e) {
2291
- return ae(e) ? "array" : typeof e;
2360
+ function $o(e) {
2361
+ return se(e) ? "array" : typeof e;
2292
2362
  }
2293
- function Pe(e) {
2363
+ function ze(e) {
2294
2364
  return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
2295
2365
  }
2296
- function Fn(e, n) {
2366
+ function Tn(e, n) {
2297
2367
  return e != null && typeof e == "object" && n in e;
2298
2368
  }
2299
- function Mo(e, n) {
2369
+ function zo(e, n) {
2300
2370
  return e != null && typeof e != "object" && e.hasOwnProperty && e.hasOwnProperty(n);
2301
2371
  }
2302
- var Po = RegExp.prototype.test;
2303
- function Do(e, n) {
2304
- return Po.call(e, n);
2372
+ var Bo = RegExp.prototype.test;
2373
+ function Uo(e, n) {
2374
+ return Bo.call(e, n);
2305
2375
  }
2306
- var $o = /\S/;
2307
- function zo(e) {
2308
- return !Do($o, e);
2376
+ var Yo = /\S/;
2377
+ function Ho(e) {
2378
+ return !Uo(Yo, e);
2309
2379
  }
2310
- var Bo = {
2380
+ var Ko = {
2311
2381
  "&": "&amp;",
2312
2382
  "<": "&lt;",
2313
2383
  ">": "&gt;",
@@ -2317,13 +2387,13 @@ var Bo = {
2317
2387
  "`": "&#x60;",
2318
2388
  "=": "&#x3D;"
2319
2389
  };
2320
- function Uo(e) {
2390
+ function Wo(e) {
2321
2391
  return String(e).replace(/[&<>"'`=\/]/g, function(r) {
2322
- return Bo[r];
2392
+ return Ko[r];
2323
2393
  });
2324
2394
  }
2325
- var Yo = /\s*/, Ho = /\s+/, Tn = /\s*=/, Ko = /\s*\}/, Wo = /#|\^|\/|>|\{|&|=|!/;
2326
- function qo(e, n) {
2395
+ var qo = /\s*/, Go = /\s+/, Ln = /\s*=/, Vo = /\s*\}/, Xo = /#|\^|\/|>|\{|&|=|!/;
2396
+ function Qo(e, n) {
2327
2397
  if (!e)
2328
2398
  return [];
2329
2399
  var r = !1, i = [], t = [], o = [], l = !1, a = !1, s = "", c = 0;
@@ -2337,19 +2407,19 @@ function qo(e, n) {
2337
2407
  }
2338
2408
  var f, h, g;
2339
2409
  function y(I) {
2340
- if (typeof I == "string" && (I = I.split(Ho, 2)), !ae(I) || I.length !== 2)
2410
+ if (typeof I == "string" && (I = I.split(Go, 2)), !se(I) || I.length !== 2)
2341
2411
  throw new Error("Invalid tags: " + I);
2342
- f = new RegExp(Pe(I[0]) + "\\s*"), h = new RegExp("\\s*" + Pe(I[1])), g = new RegExp("\\s*" + Pe("}" + I[1]));
2412
+ f = new RegExp(ze(I[0]) + "\\s*"), h = new RegExp("\\s*" + ze(I[1])), g = new RegExp("\\s*" + ze("}" + I[1]));
2343
2413
  }
2344
2414
  y(n || D.tags);
2345
- for (var d = new ye(e), b, C, x, _, L, R; !d.eos(); ) {
2415
+ for (var d = new xe(e), b, C, x, _, L, R; !d.eos(); ) {
2346
2416
  if (b = d.pos, x = d.scanUntil(f), x)
2347
2417
  for (var J = 0, V = x.length; J < V; ++J)
2348
- _ = x.charAt(J), zo(_) ? (o.push(t.length), s += _) : (a = !0, r = !0, s += " "), t.push(["text", _, b, b + 1]), b += 1, _ === `
2418
+ _ = x.charAt(J), Ho(_) ? (o.push(t.length), s += _) : (a = !0, r = !0, s += " "), t.push(["text", _, b, b + 1]), b += 1, _ === `
2349
2419
  ` && (u(), s = "", c = 0, r = !1);
2350
2420
  if (!d.scan(f))
2351
2421
  break;
2352
- if (l = !0, C = d.scan(Wo) || "name", d.scan(Yo), C === "=" ? (x = d.scanUntil(Tn), d.scan(Tn), d.scanUntil(h)) : C === "{" ? (x = d.scanUntil(g), d.scan(Ko), d.scanUntil(h), C = "&") : x = d.scanUntil(h), !d.scan(h))
2422
+ if (l = !0, C = d.scan(Xo) || "name", d.scan(qo), C === "=" ? (x = d.scanUntil(Ln), d.scan(Ln), d.scanUntil(h)) : C === "{" ? (x = d.scanUntil(g), d.scan(Vo), d.scanUntil(h), C = "&") : x = d.scanUntil(h), !d.scan(h))
2353
2423
  throw new Error("Unclosed tag at " + d.pos);
2354
2424
  if (C == ">" ? L = [C, x, b, d.pos, s, c, r] : L = [C, x, b, d.pos], c++, t.push(L), C === "#" || C === "^")
2355
2425
  i.push(L);
@@ -2362,14 +2432,14 @@ function qo(e, n) {
2362
2432
  }
2363
2433
  if (u(), R = i.pop(), R)
2364
2434
  throw new Error('Unclosed section "' + R[1] + '" at ' + d.pos);
2365
- return Vo(Go(t));
2435
+ return Zo(Jo(t));
2366
2436
  }
2367
- function Go(e) {
2437
+ function Jo(e) {
2368
2438
  for (var n = [], r, i, t = 0, o = e.length; t < o; ++t)
2369
2439
  r = e[t], r && (r[0] === "text" && i && i[0] === "text" ? (i[1] += r[1], i[3] = r[3]) : (n.push(r), i = r));
2370
2440
  return n;
2371
2441
  }
2372
- function Vo(e) {
2442
+ function Zo(e) {
2373
2443
  for (var n = [], r = n, i = [], t, o, l = 0, a = e.length; l < a; ++l)
2374
2444
  switch (t = e[l], t[0]) {
2375
2445
  case "#":
@@ -2384,20 +2454,20 @@ function Vo(e) {
2384
2454
  }
2385
2455
  return n;
2386
2456
  }
2387
- function ye(e) {
2457
+ function xe(e) {
2388
2458
  this.string = e, this.tail = e, this.pos = 0;
2389
2459
  }
2390
- ye.prototype.eos = function() {
2460
+ xe.prototype.eos = function() {
2391
2461
  return this.tail === "";
2392
2462
  };
2393
- ye.prototype.scan = function(n) {
2463
+ xe.prototype.scan = function(n) {
2394
2464
  var r = this.tail.match(n);
2395
2465
  if (!r || r.index !== 0)
2396
2466
  return "";
2397
2467
  var i = r[0];
2398
2468
  return this.tail = this.tail.substring(i.length), this.pos += i.length, i;
2399
2469
  };
2400
- ye.prototype.scanUntil = function(n) {
2470
+ xe.prototype.scanUntil = function(n) {
2401
2471
  var r = this.tail.search(n), i;
2402
2472
  switch (r) {
2403
2473
  case -1:
@@ -2411,13 +2481,13 @@ ye.prototype.scanUntil = function(n) {
2411
2481
  }
2412
2482
  return this.pos += i.length, i;
2413
2483
  };
2414
- function le(e, n) {
2484
+ function ae(e, n) {
2415
2485
  this.view = e, this.cache = { ".": this.view }, this.parent = n;
2416
2486
  }
2417
- le.prototype.push = function(n) {
2418
- return new le(n, this);
2487
+ ae.prototype.push = function(n) {
2488
+ return new ae(n, this);
2419
2489
  };
2420
- le.prototype.lookup = function(n) {
2490
+ ae.prototype.lookup = function(n) {
2421
2491
  var r = this.cache, i;
2422
2492
  if (r.hasOwnProperty(n))
2423
2493
  i = r[n];
@@ -2425,9 +2495,9 @@ le.prototype.lookup = function(n) {
2425
2495
  for (var t = this, o, l, a, s = !1; t; ) {
2426
2496
  if (n.indexOf(".") > 0)
2427
2497
  for (o = t.view, l = n.split("."), a = 0; o != null && a < l.length; )
2428
- a === l.length - 1 && (s = Fn(o, l[a]) || Mo(o, l[a])), o = o[l[a++]];
2498
+ a === l.length - 1 && (s = Tn(o, l[a]) || zo(o, l[a])), o = o[l[a++]];
2429
2499
  else
2430
- o = t.view[n], s = Fn(t.view, n);
2500
+ o = t.view[n], s = Tn(t.view, n);
2431
2501
  if (s) {
2432
2502
  i = o;
2433
2503
  break;
@@ -2436,7 +2506,7 @@ le.prototype.lookup = function(n) {
2436
2506
  }
2437
2507
  r[n] = i;
2438
2508
  }
2439
- return Ze(i) && (i = i.call(this.view)), i;
2509
+ return rn(i) && (i = i.call(this.view)), i;
2440
2510
  };
2441
2511
  function $() {
2442
2512
  this.templateCache = {
@@ -2457,10 +2527,10 @@ $.prototype.clearCache = function() {
2457
2527
  };
2458
2528
  $.prototype.parse = function(n, r) {
2459
2529
  var i = this.templateCache, t = n + ":" + (r || D.tags).join(":"), o = typeof i < "u", l = o ? i.get(t) : void 0;
2460
- return l == null && (l = qo(n, r), o && i.set(t, l)), l;
2530
+ return l == null && (l = Qo(n, r), o && i.set(t, l)), l;
2461
2531
  };
2462
2532
  $.prototype.render = function(n, r, i, t) {
2463
- var o = this.getConfigTags(t), l = this.parse(n, o), a = r instanceof le ? r : new le(r, void 0);
2533
+ var o = this.getConfigTags(t), l = this.parse(n, o), a = r instanceof ae ? r : new ae(r, void 0);
2464
2534
  return this.renderTokens(l, a, i, n, t);
2465
2535
  };
2466
2536
  $.prototype.renderTokens = function(n, r, i, t, o) {
@@ -2474,12 +2544,12 @@ $.prototype.renderSection = function(n, r, i, t, o) {
2474
2544
  return l.render(h, r, i, o);
2475
2545
  }
2476
2546
  if (s) {
2477
- if (ae(s))
2547
+ if (se(s))
2478
2548
  for (var u = 0, f = s.length; u < f; ++u)
2479
2549
  a += this.renderTokens(n[4], r.push(s[u]), i, t, o);
2480
2550
  else if (typeof s == "object" || typeof s == "string" || typeof s == "number")
2481
2551
  a += this.renderTokens(n[4], r.push(s), i, t, o);
2482
- else if (Ze(s)) {
2552
+ else if (rn(s)) {
2483
2553
  if (typeof t != "string")
2484
2554
  throw new Error("Cannot use higher-order sections without the original template");
2485
2555
  s = s.call(r.view, t.slice(n[3], n[5]), c), s != null && (a += s);
@@ -2490,7 +2560,7 @@ $.prototype.renderSection = function(n, r, i, t, o) {
2490
2560
  };
2491
2561
  $.prototype.renderInverted = function(n, r, i, t, o) {
2492
2562
  var l = r.lookup(n[1]);
2493
- if (!l || ae(l) && l.length === 0)
2563
+ if (!l || se(l) && l.length === 0)
2494
2564
  return this.renderTokens(n[4], r, i, t, o);
2495
2565
  };
2496
2566
  $.prototype.indentPartial = function(n, r, i) {
@@ -2502,7 +2572,7 @@ $.prototype.indentPartial = function(n, r, i) {
2502
2572
  };
2503
2573
  $.prototype.renderPartial = function(n, r, i, t) {
2504
2574
  if (i) {
2505
- var o = this.getConfigTags(t), l = Ze(i) ? i(n[1]) : i[n[1]];
2575
+ var o = this.getConfigTags(t), l = rn(i) ? i(n[1]) : i[n[1]];
2506
2576
  if (l != null) {
2507
2577
  var a = n[6], s = n[5], c = n[4], u = l;
2508
2578
  s == 0 && c && (u = this.indentPartial(l, c, a));
@@ -2525,10 +2595,10 @@ $.prototype.rawValue = function(n) {
2525
2595
  return n[1];
2526
2596
  };
2527
2597
  $.prototype.getConfigTags = function(n) {
2528
- return ae(n) ? n : n && typeof n == "object" ? n.tags : void 0;
2598
+ return se(n) ? n : n && typeof n == "object" ? n.tags : void 0;
2529
2599
  };
2530
2600
  $.prototype.getConfigEscape = function(n) {
2531
- if (n && typeof n == "object" && !ae(n))
2601
+ if (n && typeof n == "object" && !se(n))
2532
2602
  return n.escape;
2533
2603
  };
2534
2604
  var D = {
@@ -2548,31 +2618,31 @@ var D = {
2548
2618
  * the cache by setting it to the literal `undefined`.
2549
2619
  */
2550
2620
  set templateCache(e) {
2551
- ge.templateCache = e;
2621
+ ye.templateCache = e;
2552
2622
  },
2553
2623
  /**
2554
2624
  * Gets the default or overridden caching object from the default writer.
2555
2625
  */
2556
2626
  get templateCache() {
2557
- return ge.templateCache;
2627
+ return ye.templateCache;
2558
2628
  }
2559
- }, ge = new $();
2629
+ }, ye = new $();
2560
2630
  D.clearCache = function() {
2561
- return ge.clearCache();
2631
+ return ye.clearCache();
2562
2632
  };
2563
2633
  D.parse = function(n, r) {
2564
- return ge.parse(n, r);
2634
+ return ye.parse(n, r);
2565
2635
  };
2566
2636
  D.render = function(n, r, i, t) {
2567
2637
  if (typeof n != "string")
2568
- throw new TypeError('Invalid template! Template should be a "string" but "' + Ro(n) + '" was given as the first argument for mustache#render(template, view, partials)');
2569
- return ge.render(n, r, i, t);
2638
+ throw new TypeError('Invalid template! Template should be a "string" but "' + $o(n) + '" was given as the first argument for mustache#render(template, view, partials)');
2639
+ return ye.render(n, r, i, t);
2570
2640
  };
2571
- D.escape = Uo;
2572
- D.Scanner = ye;
2573
- D.Context = le;
2641
+ D.escape = Wo;
2642
+ D.Scanner = xe;
2643
+ D.Context = ae;
2574
2644
  D.Writer = $;
2575
- function Ln(e, {
2645
+ function jn(e, {
2576
2646
  glob: n,
2577
2647
  regex: r,
2578
2648
  substring: i
@@ -2584,7 +2654,7 @@ function Ln(e, {
2584
2654
  return r !== void 0 ? { pattern: r, mode: "regex" } : i !== void 0 ? { pattern: i, mode: "substring" } : { pattern: n, mode: "glob" };
2585
2655
  }
2586
2656
  }
2587
- function Xo() {
2657
+ function el() {
2588
2658
  return {
2589
2659
  command: "strings",
2590
2660
  describe: "List strings in the xcstrings file",
@@ -2634,15 +2704,15 @@ function Xo() {
2634
2704
  return !0;
2635
2705
  }),
2636
2706
  handler: async (e) => {
2637
- const n = [e.key, e["key-glob"]].filter((l) => l !== void 0), r = [e.text, e["text-glob"]].filter((l) => l !== void 0), i = Ln("key", {
2707
+ const n = [e.key, e["key-glob"]].filter((l) => l !== void 0), r = [e.text, e["text-glob"]].filter((l) => l !== void 0), i = jn("key", {
2638
2708
  glob: n[0],
2639
2709
  regex: e["key-regex"],
2640
2710
  substring: e["key-substring"]
2641
- }), t = Ln("text", {
2711
+ }), t = jn("text", {
2642
2712
  glob: r[0],
2643
2713
  regex: e["text-regex"],
2644
2714
  substring: e["text-substring"]
2645
- }), o = await Zo({
2715
+ }), o = await il({
2646
2716
  path: e.path,
2647
2717
  languages: e.languages,
2648
2718
  missingLanguages: e["missing-languages"],
@@ -2654,11 +2724,11 @@ function Xo() {
2654
2724
  }
2655
2725
  };
2656
2726
  }
2657
- function Qo(e) {
2727
+ function nl(e) {
2658
2728
  const n = e.replace(/[.+^${}()|\\]/g, "\\$&").replace(/\*/g, ".*").replace(/\?/g, ".");
2659
2729
  return new RegExp(`^${n}$`);
2660
2730
  }
2661
- function jn(e) {
2731
+ function In(e) {
2662
2732
  if (!e) return () => !0;
2663
2733
  if (e.mode === "regex") {
2664
2734
  const r = new RegExp(e.pattern);
@@ -2668,10 +2738,10 @@ function jn(e) {
2668
2738
  const r = e.pattern;
2669
2739
  return (i) => i.includes(r);
2670
2740
  }
2671
- const n = Qo(e.pattern);
2741
+ const n = nl(e.pattern);
2672
2742
  return (r) => n.test(r);
2673
2743
  }
2674
- function Jo(e, n) {
2744
+ function rl(e, n) {
2675
2745
  const r = D.escape;
2676
2746
  D.escape = (i) => i;
2677
2747
  try {
@@ -2680,39 +2750,39 @@ function Jo(e, n) {
2680
2750
  D.escape = r;
2681
2751
  }
2682
2752
  }
2683
- async function Zo(e) {
2684
- const r = (await me(e.path)).strings ?? {}, i = jn(e.keyFilter), t = jn(e.textFilter), o = e.languages ? new Set(e.languages) : null, l = e.missingLanguages ? new Set(e.missingLanguages) : null, a = !!e.format, s = [];
2753
+ async function il(e) {
2754
+ const r = (await ve(e.path)).strings ?? {}, i = In(e.keyFilter), t = In(e.textFilter), o = e.languages ? new Set(e.languages) : null, l = e.missingLanguages ? new Set(e.missingLanguages) : null, a = !!e.format, s = [];
2685
2755
  for (const c of Object.keys(r)) {
2686
2756
  if (!i(c)) continue;
2687
2757
  const f = r[c]?.localizations ?? {}, h = Object.keys(f), g = l ? Array.from(l).some((d) => !(d in f)) : !0, y = [];
2688
2758
  for (const d of h) {
2689
2759
  if (o && !o.has(d)) continue;
2690
2760
  const b = f[d]?.stringUnit?.value ?? "";
2691
- t(b) && (a && e.format ? y.push(Jo(e.format, { language: d, key: c, text: b })) : y.push(` ${d}: ${JSON.stringify(b)}`));
2761
+ t(b) && (a && e.format ? y.push(rl(e.format, { language: d, key: c, text: b })) : y.push(` ${d}: ${JSON.stringify(b)}`));
2692
2762
  }
2693
2763
  y.length !== 0 && g && (a ? s.push(...y) : s.push(`${c}:`, ...y));
2694
2764
  }
2695
2765
  return s.join(`
2696
2766
  `);
2697
2767
  }
2698
- const In = Oe(process.cwd(), "Localizable.xcstrings");
2699
- Nr(Rr(process.argv)).scriptName("xcstrings").usage("$0 <cmd> [args]").option("config", {
2768
+ const Nn = je(process.cwd(), "Localizable.xcstrings");
2769
+ Pr(Mr(process.argv)).scriptName("xcstrings").usage("$0 <cmd> [args]").option("config", {
2700
2770
  type: "string",
2701
2771
  describe: "Path to config file"
2702
2772
  }).option("path", {
2703
2773
  type: "string",
2704
- describe: "Path to xcstrings file",
2705
- default: In
2774
+ describe: "Path or alias to xcstrings file",
2775
+ default: Nn
2706
2776
  }).middleware(async (e) => {
2707
- const n = await We(e.config);
2708
- e.path = await Br(e.path, n, In);
2777
+ const n = await nn(e.config);
2778
+ e.path = await co(e.path, n, Nn);
2709
2779
  }).command([
2710
- Eo(),
2711
- _o(),
2712
2780
  To(),
2713
- Gr(),
2714
- Xo()
2715
- ]).demandCommand(1, "").strictCommands().recommendCommands().showHelpOnFail(!0).fail((e, n, r) => {
2716
- const i = e || n?.message;
2717
- i && (console.error(S.red(i)), console.log(), r.showHelp(), process.exit(1)), n && (console.error(n), process.exit(1)), r.showHelp(), process.exit(1);
2781
+ Lo(),
2782
+ No(),
2783
+ vo(),
2784
+ el()
2785
+ ]).demandCommand(1, "").strictCommands().recommendCommands().fail((e, n, r) => {
2786
+ const i = n instanceof oe;
2787
+ (e || i) && (console.error(k.red(e || n?.message || n)), console.log(), r.showHelp(), process.exit(1)), n && (console.error(k.red(n.message || n)), process.exit(1)), process.exit(1);
2718
2788
  }).help().argv;