jobsys-newbie
Version:
Enhanced component based on ant-design-vue
6,580 lines • 199 kB
JavaScript
var wi = Object.defineProperty;
var vi = (e, t, n) => t in e ? wi(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
var ae = (e, t, n) => vi(e, typeof t != "symbol" ? t + "" : t, n);
import At from "dayjs";
import { isString as qn, isFunction as Xn, cloneDeep as Ni, isBoolean as Ti, isObject as Gr, isUndefined as js, isArray as qs, isNull as Li, reduce as Oi, find as Ii, flatMapDeep as Ai } from "lodash-es";
import { message as mn } from "ant-design-vue";
import Zn from "axios";
import { getCurrentInstance as Wt, inject as Si, ref as Ci, shallowRef as Pi, computed as Ft, watch as Jn, onMounted as Ri, onUnmounted as Di, effectScope as ki, isRef as Ui, defineComponent as Er, h as Xs, Fragment as Zs, createVNode as xi, Text as Mi } from "vue";
const vt = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0;
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
function On(e) {
return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array";
}
function Qn(e) {
if (!Number.isSafeInteger(e) || e < 0)
throw new Error("positive integer expected, got " + e);
}
function zt(e, ...t) {
if (!On(e))
throw new Error("Uint8Array expected");
if (t.length > 0 && !t.includes(e.length))
throw new Error("Uint8Array expected of length " + t + ", got length=" + e.length);
}
function Js(e) {
if (typeof e != "function" || typeof e.create != "function")
throw new Error("Hash should be wrapped by utils.createHasher");
Qn(e.outputLen), Qn(e.blockLen);
}
function jr(e, t = !0) {
if (e.destroyed)
throw new Error("Hash instance has been destroyed");
if (t && e.finished)
throw new Error("Hash#digest() has already been called");
}
function Fi(...e) {
for (let t = 0; t < e.length; t++)
e[t].fill(0);
}
const Qs = /* @ts-ignore */ typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function", Bi = /* @__PURE__ */ Array.from({ length: 256 }, (e, t) => t.toString(16).padStart(2, "0"));
function gt(e) {
if (zt(e), Qs)
return e.toHex();
let t = "";
for (let n = 0; n < e.length; n++)
t += Bi[e[n]];
return t;
}
const je = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };
function qr(e) {
if (e >= je._0 && e <= je._9)
return e - je._0;
if (e >= je.A && e <= je.F)
return e - (je.A - 10);
if (e >= je.a && e <= je.f)
return e - (je.a - 10);
}
function _n(e) {
if (typeof e != "string")
throw new Error("hex string expected, got " + typeof e);
if (Qs)
return Uint8Array.fromHex(e);
const t = e.length, n = t / 2;
if (t % 2)
throw new Error("hex string expected, got unpadded hex of length " + t);
const r = new Uint8Array(n);
for (let s = 0, o = 0; s < n; s++, o += 2) {
const i = qr(e.charCodeAt(o)), a = qr(e.charCodeAt(o + 1));
if (i === void 0 || a === void 0) {
const l = e[o] + e[o + 1];
throw new Error('hex string expected, got non-hex character "' + l + '" at index ' + o);
}
r[s] = i * 16 + a;
}
return r;
}
function zs(e) {
if (typeof e != "string")
throw new Error("string expected");
return new Uint8Array(new TextEncoder().encode(e));
}
function Vi(e) {
return typeof e == "string" && (e = zs(e)), zt(e), e;
}
function Je(...e) {
let t = 0;
for (let r = 0; r < e.length; r++) {
const s = e[r];
zt(s), t += s.length;
}
const n = new Uint8Array(t);
for (let r = 0, s = 0; r < e.length; r++) {
const o = e[r];
n.set(o, s), s += o.length;
}
return n;
}
let Hi = class {
};
function eo(e = 32) {
if (vt && typeof vt.getRandomValues == "function")
return vt.getRandomValues(new Uint8Array(e));
if (vt && typeof vt.randomBytes == "function")
return Uint8Array.from(vt.randomBytes(e));
throw new Error("crypto.getRandomValues must be defined");
}
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
const pr = /* @__PURE__ */ BigInt(0), zn = /* @__PURE__ */ BigInt(1);
function hn(e, t = "") {
if (typeof e != "boolean") {
const n = t && `"${t}"`;
throw new Error(n + "expected boolean, got type=" + typeof e);
}
return e;
}
function ft(e, t, n = "") {
const r = On(e), s = e == null ? void 0 : e.length, o = t !== void 0;
if (!r || o && s !== t) {
const i = n && `"${n}" `, a = o ? ` of length ${t}` : "", l = r ? `length=${s}` : `type=${typeof e}`;
throw new Error(i + "expected Uint8Array" + a + ", got " + l);
}
return e;
}
function Vt(e) {
const t = e.toString(16);
return t.length & 1 ? "0" + t : t;
}
function br(e) {
if (typeof e != "string")
throw new Error("hex string expected, got " + typeof e);
return e === "" ? pr : BigInt("0x" + e);
}
function In(e) {
return br(gt(e));
}
function to(e) {
return zt(e), br(gt(Uint8Array.from(e).reverse()));
}
function An(e, t) {
return _n(e.toString(16).padStart(t * 2, "0"));
}
function no(e, t) {
return An(e, t).reverse();
}
function Te(e, t, n) {
let r;
if (typeof t == "string")
try {
r = _n(t);
} catch (o) {
throw new Error(e + " must be hex string or Uint8Array, cause: " + o);
}
else if (On(t))
r = Uint8Array.from(t);
else
throw new Error(e + " must be hex string or Uint8Array");
const s = r.length;
if (typeof n == "number" && s !== n)
throw new Error(e + " of length " + n + " expected, got " + s);
return r;
}
const Un = (e) => typeof e == "bigint" && pr <= e;
function $i(e, t, n) {
return Un(e) && Un(t) && Un(n) && t <= e && e < n;
}
function Wi(e, t, n, r) {
if (!$i(t, n, r))
throw new Error("expected valid " + e + ": " + n + " <= n < " + r + ", got " + t);
}
function ro(e) {
let t;
for (t = 0; e > pr; e >>= zn, t += 1)
;
return t;
}
const en = (e) => (zn << BigInt(e)) - zn;
function Yi(e, t, n) {
if (typeof e != "number" || e < 2)
throw new Error("hashLen must be a number");
if (typeof t != "number" || t < 2)
throw new Error("qByteLen must be a number");
if (typeof n != "function")
throw new Error("hmacFn must be a function");
const r = (g) => new Uint8Array(g), s = (g) => Uint8Array.of(g);
let o = r(e), i = r(e), a = 0;
const l = () => {
o.fill(1), i.fill(0), a = 0;
}, c = (...g) => n(i, o, ...g), _ = (g = r(0)) => {
i = c(s(0), g), o = c(), g.length !== 0 && (i = c(s(1), g), o = c());
}, m = () => {
if (a++ >= 1e3)
throw new Error("drbg: tried 1000 values");
let g = 0;
const y = [];
for (; g < t; ) {
o = c();
const E = o.slice();
y.push(E), g += o.length;
}
return Je(...y);
};
return (g, y) => {
l(), _(g);
let E;
for (; !(E = y(m())); )
_();
return l(), E;
};
}
function yr(e, t, n = {}) {
if (!e || typeof e != "object")
throw new Error("expected valid options object");
function r(s, o, i) {
const a = e[s];
if (i && a === void 0)
return;
const l = typeof a;
if (l !== o || a === null)
throw new Error(`param "${s}" is invalid: expected ${o}, got ${l}`);
}
Object.entries(t).forEach(([s, o]) => r(s, o, !1)), Object.entries(n).forEach(([s, o]) => r(s, o, !0));
}
function Xr(e) {
const t = /* @__PURE__ */ new WeakMap();
return (n, ...r) => {
const s = t.get(n);
if (s !== void 0)
return s;
const o = e(n, ...r);
return t.set(n, o), o;
};
}
const gn = gt, ot = Je, Ki = zs, Oe = Vt, he = br, Gi = An;
let so = class extends Hi {
constructor(t, n) {
super(), this.finished = !1, this.destroyed = !1, Js(t);
const r = Vi(n);
if (this.iHash = t.create(), typeof this.iHash.update != "function")
throw new Error("Expected instance of class which extends utils.Hash");
this.blockLen = this.iHash.blockLen, this.outputLen = this.iHash.outputLen;
const s = this.blockLen, o = new Uint8Array(s);
o.set(r.length > s ? t.create().update(r).digest() : r);
for (let i = 0; i < o.length; i++)
o[i] ^= 54;
this.iHash.update(o), this.oHash = t.create();
for (let i = 0; i < o.length; i++)
o[i] ^= 106;
this.oHash.update(o), Fi(o);
}
update(t) {
return jr(this), this.iHash.update(t), this;
}
digestInto(t) {
jr(this), zt(t, this.outputLen), this.finished = !0, this.iHash.digestInto(t), this.oHash.update(t), this.oHash.digestInto(t), this.destroy();
}
digest() {
const t = new Uint8Array(this.oHash.outputLen);
return this.digestInto(t), t;
}
_cloneInto(t) {
t || (t = Object.create(Object.getPrototypeOf(this), {}));
const { oHash: n, iHash: r, finished: s, destroyed: o, blockLen: i, outputLen: a } = this;
return t = t, t.finished = s, t.destroyed = o, t.blockLen = i, t.outputLen = a, t.oHash = n._cloneInto(t.oHash), t.iHash = r._cloneInto(t.iHash), t;
}
clone() {
return this._cloneInto();
}
destroy() {
this.destroyed = !0, this.oHash.destroy(), this.iHash.destroy();
}
};
const oo = (e, t, n) => new so(e, t).update(n).digest();
oo.create = (e, t) => new so(e, t);
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
const Ce = BigInt(0), ve = BigInt(1), dt = /* @__PURE__ */ BigInt(2), io = /* @__PURE__ */ BigInt(3), ao = /* @__PURE__ */ BigInt(4), lo = /* @__PURE__ */ BigInt(5), ji = /* @__PURE__ */ BigInt(7), co = /* @__PURE__ */ BigInt(8), qi = /* @__PURE__ */ BigInt(9), uo = /* @__PURE__ */ BigInt(16);
function Ae(e, t) {
const n = e % t;
return n >= Ce ? n : t + n;
}
function Zr(e, t) {
if (e === Ce)
throw new Error("invert: expected non-zero number");
if (t <= Ce)
throw new Error("invert: expected positive modulus, got " + t);
let n = Ae(e, t), r = t, s = Ce, o = ve;
for (; n !== Ce; ) {
const a = r / n, l = r % n, c = s - o * a;
r = n, n = l, s = o, o = c;
}
if (r !== ve)
throw new Error("invert: does not exist");
return Ae(s, t);
}
function wr(e, t, n) {
if (!e.eql(e.sqr(t), n))
throw new Error("Cannot find square root");
}
function fo(e, t) {
const n = (e.ORDER + ve) / ao, r = e.pow(t, n);
return wr(e, r, t), r;
}
function Xi(e, t) {
const n = (e.ORDER - lo) / co, r = e.mul(t, dt), s = e.pow(r, n), o = e.mul(t, s), i = e.mul(e.mul(o, dt), s), a = e.mul(o, e.sub(i, e.ONE));
return wr(e, a, t), a;
}
function Zi(e) {
const t = kt(e), n = mo(e), r = n(t, t.neg(t.ONE)), s = n(t, r), o = n(t, t.neg(r)), i = (e + ji) / uo;
return (a, l) => {
let c = a.pow(l, i), _ = a.mul(c, r);
const m = a.mul(c, s), u = a.mul(c, o), g = a.eql(a.sqr(_), l), y = a.eql(a.sqr(m), l);
c = a.cmov(c, _, g), _ = a.cmov(u, m, y);
const E = a.eql(a.sqr(_), l), p = a.cmov(c, _, E);
return wr(a, p, l), p;
};
}
function mo(e) {
if (e < io)
throw new Error("sqrt is not defined for small field");
let t = e - ve, n = 0;
for (; t % dt === Ce; )
t /= dt, n++;
let r = dt;
const s = kt(e);
for (; Jr(s, r) === 1; )
if (r++ > 1e3)
throw new Error("Cannot find square root: probably non-prime P");
if (n === 1)
return fo;
let o = s.pow(r, t);
const i = (t + ve) / dt;
return function(l, c) {
if (l.is0(c))
return c;
if (Jr(l, c) !== 1)
throw new Error("Cannot find square root");
let _ = n, m = l.mul(l.ONE, o), u = l.pow(c, t), g = l.pow(c, i);
for (; !l.eql(u, l.ONE); ) {
if (l.is0(u))
return l.ZERO;
let y = 1, E = l.sqr(u);
for (; !l.eql(E, l.ONE); )
if (y++, E = l.sqr(E), y === _)
throw new Error("Cannot find square root");
const p = ve << BigInt(_ - y - 1), f = l.pow(m, p);
_ = y, m = l.sqr(f), u = l.mul(u, m), g = l.mul(g, f);
}
return g;
};
}
function Ji(e) {
return e % ao === io ? fo : e % co === lo ? Xi : e % uo === qi ? Zi(e) : mo(e);
}
const Qi = [
"create",
"isValid",
"is0",
"neg",
"inv",
"sqrt",
"sqr",
"eql",
"add",
"sub",
"mul",
"pow",
"div",
"addN",
"subN",
"mulN",
"sqrN"
];
function zi(e) {
const t = {
ORDER: "bigint",
MASK: "bigint",
BYTES: "number",
BITS: "number"
}, n = Qi.reduce((r, s) => (r[s] = "function", r), t);
return yr(e, n), e;
}
function ea(e, t, n) {
if (n < Ce)
throw new Error("invalid exponent, negatives unsupported");
if (n === Ce)
return e.ONE;
if (n === ve)
return t;
let r = e.ONE, s = t;
for (; n > Ce; )
n & ve && (r = e.mul(r, s)), s = e.sqr(s), n >>= ve;
return r;
}
function _o(e, t, n = !1) {
const r = new Array(t.length).fill(n ? e.ZERO : void 0), s = t.reduce((i, a, l) => e.is0(a) ? i : (r[l] = i, e.mul(i, a)), e.ONE), o = e.inv(s);
return t.reduceRight((i, a, l) => e.is0(a) ? i : (r[l] = e.mul(i, r[l]), e.mul(i, a)), o), r;
}
function Jr(e, t) {
const n = (e.ORDER - ve) / dt, r = e.pow(t, n), s = e.eql(r, e.ONE), o = e.eql(r, e.ZERO), i = e.eql(r, e.neg(e.ONE));
if (!s && !o && !i)
throw new Error("invalid Legendre symbol result");
return s ? 1 : o ? 0 : -1;
}
function ho(e, t) {
t !== void 0 && Qn(t);
const n = t !== void 0 ? t : e.toString(2).length, r = Math.ceil(n / 8);
return { nBitLength: n, nByteLength: r };
}
function kt(e, t, n = !1, r = {}) {
if (e <= Ce)
throw new Error("invalid field: expected ORDER > 0, got " + e);
let s, o, i = !1, a;
if (typeof t == "object" && t != null) {
if (r.sqrt || n)
throw new Error("cannot specify opts in two arguments");
const u = t;
u.BITS && (s = u.BITS), u.sqrt && (o = u.sqrt), typeof u.isLE == "boolean" && (n = u.isLE), typeof u.modFromBytes == "boolean" && (i = u.modFromBytes), a = u.allowedLengths;
} else
typeof t == "number" && (s = t), r.sqrt && (o = r.sqrt);
const { nBitLength: l, nByteLength: c } = ho(e, s);
if (c > 2048)
throw new Error("invalid field: expected ORDER of <= 2048 bytes");
let _;
const m = Object.freeze({
ORDER: e,
isLE: n,
BITS: l,
BYTES: c,
MASK: en(l),
ZERO: Ce,
ONE: ve,
allowedLengths: a,
create: (u) => Ae(u, e),
isValid: (u) => {
if (typeof u != "bigint")
throw new Error("invalid field element: expected bigint, got " + typeof u);
return Ce <= u && u < e;
},
is0: (u) => u === Ce,
// is valid and invertible
isValidNot0: (u) => !m.is0(u) && m.isValid(u),
isOdd: (u) => (u & ve) === ve,
neg: (u) => Ae(-u, e),
eql: (u, g) => u === g,
sqr: (u) => Ae(u * u, e),
add: (u, g) => Ae(u + g, e),
sub: (u, g) => Ae(u - g, e),
mul: (u, g) => Ae(u * g, e),
pow: (u, g) => ea(m, u, g),
div: (u, g) => Ae(u * Zr(g, e), e),
// Same as above, but doesn't normalize
sqrN: (u) => u * u,
addN: (u, g) => u + g,
subN: (u, g) => u - g,
mulN: (u, g) => u * g,
inv: (u) => Zr(u, e),
sqrt: o || ((u) => (_ || (_ = Ji(e)), _(m, u))),
toBytes: (u) => n ? no(u, c) : An(u, c),
fromBytes: (u, g = !0) => {
if (a) {
if (!a.includes(u.length) || u.length > c)
throw new Error("Field.fromBytes: expected " + a + " bytes, got " + u.length);
const E = new Uint8Array(c);
E.set(u, n ? 0 : E.length - u.length), u = E;
}
if (u.length !== c)
throw new Error("Field.fromBytes: expected " + c + " bytes, got " + u.length);
let y = n ? to(u) : In(u);
if (i && (y = Ae(y, e)), !g && !m.isValid(y))
throw new Error("invalid field element: outside of range 0..ORDER");
return y;
},
// TODO: we don't need it here, move out to separate fn
invertBatch: (u) => _o(m, u),
// We can't move this out because Fp6, Fp12 implement it
// and it's unclear what to return in there.
cmov: (u, g, y) => y ? g : u
});
return Object.freeze(m);
}
function go(e) {
if (typeof e != "bigint")
throw new Error("field order must be bigint");
const t = e.toString(2).length;
return Math.ceil(t / 8);
}
function Eo(e) {
const t = go(e);
return t + Math.ceil(t / 2);
}
function ta(e, t, n = !1) {
const r = e.length, s = go(t), o = Eo(t);
if (r < 16 || r < o || r > 1024)
throw new Error("expected " + o + "-1024 bytes of input, got " + r);
const i = n ? to(e) : In(e), a = Ae(i, t - ve) + ve;
return n ? no(a, s) : An(a, s);
}
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
const St = BigInt(0), mt = BigInt(1);
function En(e, t) {
const n = t.negate();
return e ? n : t;
}
function xn(e, t) {
const n = _o(e.Fp, t.map((r) => r.Z));
return t.map((r, s) => e.fromAffine(r.toAffine(n[s])));
}
function po(e, t) {
if (!Number.isSafeInteger(e) || e <= 0 || e > t)
throw new Error("invalid window size, expected [1.." + t + "], got W=" + e);
}
function Mn(e, t) {
po(e, t);
const n = Math.ceil(t / e) + 1, r = 2 ** (e - 1), s = 2 ** e, o = en(e), i = BigInt(e);
return { windows: n, windowSize: r, mask: o, maxNumber: s, shiftBy: i };
}
function Qr(e, t, n) {
const { windowSize: r, mask: s, maxNumber: o, shiftBy: i } = n;
let a = Number(e & s), l = e >> i;
a > r && (a -= o, l += mt);
const c = t * r, _ = c + Math.abs(a) - 1, m = a === 0, u = a < 0, g = t % 2 !== 0;
return { nextN: l, offset: _, isZero: m, isNeg: u, isNegF: g, offsetF: c };
}
function na(e, t) {
if (!Array.isArray(e))
throw new Error("array expected");
e.forEach((n, r) => {
if (!(n instanceof t))
throw new Error("invalid point at index " + r);
});
}
function ra(e, t) {
if (!Array.isArray(e))
throw new Error("array of scalars expected");
e.forEach((n, r) => {
if (!t.isValid(n))
throw new Error("invalid scalar at index " + r);
});
}
const Fn = /* @__PURE__ */ new WeakMap(), bo = /* @__PURE__ */ new WeakMap();
function Bn(e) {
return bo.get(e) || 1;
}
function zr(e) {
if (e !== St)
throw new Error("invalid wNAF");
}
class sa {
// Parametrized with a given Point class (not individual point)
constructor(t, n) {
this.BASE = t.BASE, this.ZERO = t.ZERO, this.Fn = t.Fn, this.bits = n;
}
// non-const time multiplication ladder
_unsafeLadder(t, n, r = this.ZERO) {
let s = t;
for (; n > St; )
n & mt && (r = r.add(s)), s = s.double(), n >>= mt;
return r;
}
/**
* Creates a wNAF precomputation window. Used for caching.
* Default window size is set by `utils.precompute()` and is equal to 8.
* Number of precomputed points depends on the curve size:
* 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where:
* - 𝑊 is the window size
* - 𝑛 is the bitlength of the curve order.
* For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224.
* @param point Point instance
* @param W window size
* @returns precomputed point tables flattened to a single array
*/
precomputeWindow(t, n) {
const { windows: r, windowSize: s } = Mn(n, this.bits), o = [];
let i = t, a = i;
for (let l = 0; l < r; l++) {
a = i, o.push(a);
for (let c = 1; c < s; c++)
a = a.add(i), o.push(a);
i = a.double();
}
return o;
}
/**
* Implements ec multiplication using precomputed tables and w-ary non-adjacent form.
* More compact implementation:
* https://github.com/paulmillr/noble-secp256k1/blob/47cb1669b6e506ad66b35fe7d76132ae97465da2/index.ts#L502-L541
* @returns real and fake (for const-time) points
*/
wNAF(t, n, r) {
if (!this.Fn.isValid(r))
throw new Error("invalid scalar");
let s = this.ZERO, o = this.BASE;
const i = Mn(t, this.bits);
for (let a = 0; a < i.windows; a++) {
const { nextN: l, offset: c, isZero: _, isNeg: m, isNegF: u, offsetF: g } = Qr(r, a, i);
r = l, _ ? o = o.add(En(u, n[g])) : s = s.add(En(m, n[c]));
}
return zr(r), { p: s, f: o };
}
/**
* Implements ec unsafe (non const-time) multiplication using precomputed tables and w-ary non-adjacent form.
* @param acc accumulator point to add result of multiplication
* @returns point
*/
wNAFUnsafe(t, n, r, s = this.ZERO) {
const o = Mn(t, this.bits);
for (let i = 0; i < o.windows && r !== St; i++) {
const { nextN: a, offset: l, isZero: c, isNeg: _ } = Qr(r, i, o);
if (r = a, !c) {
const m = n[l];
s = s.add(_ ? m.negate() : m);
}
}
return zr(r), s;
}
getPrecomputes(t, n, r) {
let s = Fn.get(n);
return s || (s = this.precomputeWindow(n, t), t !== 1 && (typeof r == "function" && (s = r(s)), Fn.set(n, s))), s;
}
cached(t, n, r) {
const s = Bn(t);
return this.wNAF(s, this.getPrecomputes(s, t, r), n);
}
unsafe(t, n, r, s) {
const o = Bn(t);
return o === 1 ? this._unsafeLadder(t, n, s) : this.wNAFUnsafe(o, this.getPrecomputes(o, t, r), n, s);
}
// We calculate precomputes for elliptic curve point multiplication
// using windowed method. This specifies window size and
// stores precomputed values. Usually only base point would be precomputed.
createCache(t, n) {
po(n, this.bits), bo.set(t, n), Fn.delete(t);
}
hasCache(t) {
return Bn(t) !== 1;
}
}
function oa(e, t, n, r) {
let s = t, o = e.ZERO, i = e.ZERO;
for (; n > St || r > St; )
n & mt && (o = o.add(s)), r & mt && (i = i.add(s)), s = s.double(), n >>= mt, r >>= mt;
return { p1: o, p2: i };
}
function ia(e, t, n, r) {
na(n, e), ra(r, t);
const s = n.length, o = r.length;
if (s !== o)
throw new Error("arrays of points and scalars must have equal length");
const i = e.ZERO, a = ro(BigInt(s));
let l = 1;
a > 12 ? l = a - 3 : a > 4 ? l = a - 2 : a > 0 && (l = 2);
const c = en(l), _ = new Array(Number(c) + 1).fill(i), m = Math.floor((t.BITS - 1) / l) * l;
let u = i;
for (let g = m; g >= 0; g -= l) {
_.fill(i);
for (let E = 0; E < o; E++) {
const p = r[E], f = Number(p >> BigInt(g) & c);
_[f] = _[f].add(n[E]);
}
let y = i;
for (let E = _.length - 1, p = i; E > 0; E--)
p = p.add(_[E]), y = y.add(p);
if (u = u.add(y), g !== 0)
for (let E = 0; E < l; E++)
u = u.double();
}
return u;
}
function es(e, t, n) {
if (t) {
if (t.ORDER !== e)
throw new Error("Field.ORDER must match order: Fp == p, Fn == n");
return zi(t), t;
} else
return kt(e, { isLE: n });
}
function aa(e, t, n = {}, r) {
if (r === void 0 && (r = e === "edwards"), !t || typeof t != "object")
throw new Error(`expected valid ${e} CURVE object`);
for (const l of ["p", "n", "h"]) {
const c = t[l];
if (!(typeof c == "bigint" && c > St))
throw new Error(`CURVE.${l} must be positive bigint`);
}
const s = es(t.p, n.Fp, r), o = es(t.n, n.Fn, r), a = ["Gx", "Gy", "a", "b"];
for (const l of a)
if (!s.isValid(t[l]))
throw new Error(`CURVE.${l} must be valid field element of CURVE.Fp`);
return t = Object.freeze(Object.assign({}, t)), { CURVE: t, Fp: s, Fn: o };
}
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
const ts = (e, t) => (e + (e >= 0 ? t : -t) / yo) / t;
function la(e, t, n) {
const [[r, s], [o, i]] = t, a = ts(i * e, n), l = ts(-s * e, n);
let c = e - a * r - l * o, _ = -a * s - l * i;
const m = c < Qe, u = _ < Qe;
m && (c = -c), u && (_ = -_);
const g = en(Math.ceil(ro(n) / 2)) + It;
if (c < Qe || c >= g || _ < Qe || _ >= g)
throw new Error("splitScalar (endomorphism): failed, k=" + e);
return { k1neg: m, k1: c, k2neg: u, k2: _ };
}
function er(e) {
if (!["compact", "recovered", "der"].includes(e))
throw new Error('Signature format must be "compact", "recovered", or "der"');
return e;
}
function Vn(e, t) {
const n = {};
for (let r of Object.keys(t))
n[r] = e[r] === void 0 ? t[r] : e[r];
return hn(n.lowS, "lowS"), hn(n.prehash, "prehash"), n.format !== void 0 && er(n.format), n;
}
class ca extends Error {
constructor(t = "") {
super(t);
}
}
const Xe = {
// asn.1 DER encoding utils
Err: ca,
// Basic building block is TLV (Tag-Length-Value)
_tlv: {
encode: (e, t) => {
const { Err: n } = Xe;
if (e < 0 || e > 256)
throw new n("tlv.encode: wrong tag");
if (t.length & 1)
throw new n("tlv.encode: unpadded data");
const r = t.length / 2, s = Vt(r);
if (s.length / 2 & 128)
throw new n("tlv.encode: long form length too big");
const o = r > 127 ? Vt(s.length / 2 | 128) : "";
return Vt(e) + o + s + t;
},
// v - value, l - left bytes (unparsed)
decode(e, t) {
const { Err: n } = Xe;
let r = 0;
if (e < 0 || e > 256)
throw new n("tlv.encode: wrong tag");
if (t.length < 2 || t[r++] !== e)
throw new n("tlv.decode: wrong tlv");
const s = t[r++], o = !!(s & 128);
let i = 0;
if (!o)
i = s;
else {
const l = s & 127;
if (!l)
throw new n("tlv.decode(long): indefinite length not supported");
if (l > 4)
throw new n("tlv.decode(long): byte length is too big");
const c = t.subarray(r, r + l);
if (c.length !== l)
throw new n("tlv.decode: length bytes not complete");
if (c[0] === 0)
throw new n("tlv.decode(long): zero leftmost byte");
for (const _ of c)
i = i << 8 | _;
if (r += l, i < 128)
throw new n("tlv.decode(long): not minimal encoding");
}
const a = t.subarray(r, r + i);
if (a.length !== i)
throw new n("tlv.decode: wrong value length");
return { v: a, l: t.subarray(r + i) };
}
},
// https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag,
// since we always use positive integers here. It must always be empty:
// - add zero byte if exists
// - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding)
_int: {
encode(e) {
const { Err: t } = Xe;
if (e < Qe)
throw new t("integer: negative integers are not allowed");
let n = Vt(e);
if (Number.parseInt(n[0], 16) & 8 && (n = "00" + n), n.length & 1)
throw new t("unexpected DER parsing assertion: unpadded hex");
return n;
},
decode(e) {
const { Err: t } = Xe;
if (e[0] & 128)
throw new t("invalid signature integer: negative");
if (e[0] === 0 && !(e[1] & 128))
throw new t("invalid signature integer: unnecessary leading zero");
return In(e);
}
},
toSig(e) {
const { Err: t, _int: n, _tlv: r } = Xe, s = Te("signature", e), { v: o, l: i } = r.decode(48, s);
if (i.length)
throw new t("invalid signature: left bytes after parsing");
const { v: a, l } = r.decode(2, o), { v: c, l: _ } = r.decode(2, l);
if (_.length)
throw new t("invalid signature: left bytes after parsing");
return { r: n.decode(a), s: n.decode(c) };
},
hexFromSig(e) {
const { _tlv: t, _int: n } = Xe, r = t.encode(2, n.encode(e.r)), s = t.encode(2, n.encode(e.s)), o = r + s;
return t.encode(48, o);
}
}, Qe = BigInt(0), It = BigInt(1), yo = BigInt(2), rn = BigInt(3), ua = BigInt(4);
function Lt(e, t) {
const { BYTES: n } = e;
let r;
if (typeof t == "bigint")
r = t;
else {
let s = Te("private key", t);
try {
r = e.fromBytes(s);
} catch {
throw new Error(`invalid private key: expected ui8a of size ${n}, got ${typeof t}`);
}
}
if (!e.isValidNot0(r))
throw new Error("invalid private key: out of range [1..N-1]");
return r;
}
function fa(e, t = {}) {
const n = aa("weierstrass", e, t), { Fp: r, Fn: s } = n;
let o = n.CURVE;
const { h: i, n: a } = o;
yr(t, {}, {
allowInfinityPoint: "boolean",
clearCofactor: "function",
isTorsionFree: "function",
fromBytes: "function",
toBytes: "function",
endo: "object",
wrapPrivateKey: "boolean"
});
const { endo: l } = t;
if (l && (!r.is0(o.a) || typeof l.beta != "bigint" || !Array.isArray(l.basises)))
throw new Error('invalid endo: expected "beta": bigint and "basises": array');
const c = vo(r, s);
function _() {
if (!r.isOdd)
throw new Error("compression is not supported: Field does not have .isOdd()");
}
function m(F, S, I) {
const { x: L, y: R } = S.toAffine(), x = r.toBytes(L);
if (hn(I, "isCompressed"), I) {
_();
const V = !r.isOdd(R);
return Je(wo(V), x);
} else
return Je(Uint8Array.of(4), x, r.toBytes(R));
}
function u(F) {
ft(F, void 0, "Point");
const { publicKey: S, publicKeyUncompressed: I } = c, L = F.length, R = F[0], x = F.subarray(1);
if (L === S && (R === 2 || R === 3)) {
const V = r.fromBytes(x);
if (!r.isValid(V))
throw new Error("bad point: is not on curve, wrong x");
const B = E(V);
let U;
try {
U = r.sqrt(B);
} catch (oe) {
const J = oe instanceof Error ? ": " + oe.message : "";
throw new Error("bad point: is not on curve, sqrt error" + J);
}
_();
const H = r.isOdd(U);
return (R & 1) === 1 !== H && (U = r.neg(U)), { x: V, y: U };
} else if (L === I && R === 4) {
const V = r.BYTES, B = r.fromBytes(x.subarray(0, V)), U = r.fromBytes(x.subarray(V, V * 2));
if (!p(B, U))
throw new Error("bad point: is not on curve");
return { x: B, y: U };
} else
throw new Error(`bad point: got length ${L}, expected compressed=${S} or uncompressed=${I}`);
}
const g = t.toBytes || m, y = t.fromBytes || u;
function E(F) {
const S = r.sqr(F), I = r.mul(S, F);
return r.add(r.add(I, r.mul(F, o.a)), o.b);
}
function p(F, S) {
const I = r.sqr(S), L = E(F);
return r.eql(I, L);
}
if (!p(o.Gx, o.Gy))
throw new Error("bad curve params: generator point");
const f = r.mul(r.pow(o.a, rn), ua), b = r.mul(r.sqr(o.b), BigInt(27));
if (r.is0(r.add(f, b)))
throw new Error("bad curve params: a or b");
function v(F, S, I = !1) {
if (!r.isValid(S) || I && r.is0(S))
throw new Error(`bad point coordinate ${F}`);
return S;
}
function w(F) {
if (!(F instanceof k))
throw new Error("ProjectivePoint expected");
}
function O(F) {
if (!l || !l.basises)
throw new Error("no endo");
return la(F, l.basises, s.ORDER);
}
const P = Xr((F, S) => {
const { X: I, Y: L, Z: R } = F;
if (r.eql(R, r.ONE))
return { x: I, y: L };
const x = F.is0();
S == null && (S = x ? r.ONE : r.inv(R));
const V = r.mul(I, S), B = r.mul(L, S), U = r.mul(R, S);
if (x)
return { x: r.ZERO, y: r.ZERO };
if (!r.eql(U, r.ONE))
throw new Error("invZ was invalid");
return { x: V, y: B };
}), T = Xr((F) => {
if (F.is0()) {
if (t.allowInfinityPoint && !r.is0(F.Y))
return;
throw new Error("bad point: ZERO");
}
const { x: S, y: I } = F.toAffine();
if (!r.isValid(S) || !r.isValid(I))
throw new Error("bad point: x or y not field elements");
if (!p(S, I))
throw new Error("bad point: equation left != right");
if (!F.isTorsionFree())
throw new Error("bad point: not in prime-order subgroup");
return !0;
});
function $(F, S, I, L, R) {
return I = new k(r.mul(I.X, F), I.Y, I.Z), S = En(L, S), I = En(R, I), S.add(I);
}
class k {
/** Does NOT validate if the point is valid. Use `.assertValidity()`. */
constructor(S, I, L) {
this.X = v("x", S), this.Y = v("y", I, !0), this.Z = v("z", L), Object.freeze(this);
}
static CURVE() {
return o;
}
/** Does NOT validate if the point is valid. Use `.assertValidity()`. */
static fromAffine(S) {
const { x: I, y: L } = S || {};
if (!S || !r.isValid(I) || !r.isValid(L))
throw new Error("invalid affine point");
if (S instanceof k)
throw new Error("projective point not allowed");
return r.is0(I) && r.is0(L) ? k.ZERO : new k(I, L, r.ONE);
}
static fromBytes(S) {
const I = k.fromAffine(y(ft(S, void 0, "point")));
return I.assertValidity(), I;
}
static fromHex(S) {
return k.fromBytes(Te("pointHex", S));
}
get x() {
return this.toAffine().x;
}
get y() {
return this.toAffine().y;
}
/**
*
* @param windowSize
* @param isLazy true will defer table computation until the first multiplication
* @returns
*/
precompute(S = 8, I = !0) {
return ge.createCache(this, S), I || this.multiply(rn), this;
}
// TODO: return `this`
/** A point on curve is valid if it conforms to equation. */
assertValidity() {
T(this);
}
hasEvenY() {
const { y: S } = this.toAffine();
if (!r.isOdd)
throw new Error("Field doesn't support isOdd");
return !r.isOdd(S);
}
/** Compare one point to another. */
equals(S) {
w(S);
const { X: I, Y: L, Z: R } = this, { X: x, Y: V, Z: B } = S, U = r.eql(r.mul(I, B), r.mul(x, R)), H = r.eql(r.mul(L, B), r.mul(V, R));
return U && H;
}
/** Flips point to one corresponding to (x, -y) in Affine coordinates. */
negate() {
return new k(this.X, r.neg(this.Y), this.Z);
}
// Renes-Costello-Batina exception-free doubling formula.
// There is 30% faster Jacobian formula, but it is not complete.
// https://eprint.iacr.org/2015/1060, algorithm 3
// Cost: 8M + 3S + 3*a + 2*b3 + 15add.
double() {
const { a: S, b: I } = o, L = r.mul(I, rn), { X: R, Y: x, Z: V } = this;
let B = r.ZERO, U = r.ZERO, H = r.ZERO, Y = r.mul(R, R), oe = r.mul(x, x), J = r.mul(V, V), G = r.mul(R, x);
return G = r.add(G, G), H = r.mul(R, V), H = r.add(H, H), B = r.mul(S, H), U = r.mul(L, J), U = r.add(B, U), B = r.sub(oe, U), U = r.add(oe, U), U = r.mul(B, U), B = r.mul(G, B), H = r.mul(L, H), J = r.mul(S, J), G = r.sub(Y, J), G = r.mul(S, G), G = r.add(G, H), H = r.add(Y, Y), Y = r.add(H, Y), Y = r.add(Y, J), Y = r.mul(Y, G), U = r.add(U, Y), J = r.mul(x, V), J = r.add(J, J), Y = r.mul(J, G), B = r.sub(B, Y), H = r.mul(J, oe), H = r.add(H, H), H = r.add(H, H), new k(B, U, H);
}
// Renes-Costello-Batina exception-free addition formula.
// There is 30% faster Jacobian formula, but it is not complete.
// https://eprint.iacr.org/2015/1060, algorithm 1
// Cost: 12M + 0S + 3*a + 3*b3 + 23add.
add(S) {
w(S);
const { X: I, Y: L, Z: R } = this, { X: x, Y: V, Z: B } = S;
let U = r.ZERO, H = r.ZERO, Y = r.ZERO;
const oe = o.a, J = r.mul(o.b, rn);
let G = r.mul(I, x), ne = r.mul(L, V), ie = r.mul(R, B), Ee = r.add(I, L), ee = r.add(x, V);
Ee = r.mul(Ee, ee), ee = r.add(G, ne), Ee = r.sub(Ee, ee), ee = r.add(I, R);
let de = r.add(x, B);
return ee = r.mul(ee, de), de = r.add(G, ie), ee = r.sub(ee, de), de = r.add(L, R), U = r.add(V, B), de = r.mul(de, U), U = r.add(ne, ie), de = r.sub(de, U), Y = r.mul(oe, ee), U = r.mul(J, ie), Y = r.add(U, Y), U = r.sub(ne, Y), Y = r.add(ne, Y), H = r.mul(U, Y), ne = r.add(G, G), ne = r.add(ne, G), ie = r.mul(oe, ie), ee = r.mul(J, ee), ne = r.add(ne, ie), ie = r.sub(G, ie), ie = r.mul(oe, ie), ee = r.add(ee, ie), G = r.mul(ne, ee), H = r.add(H, G), G = r.mul(de, ee), U = r.mul(Ee, U), U = r.sub(U, G), G = r.mul(Ee, ne), Y = r.mul(de, Y), Y = r.add(Y, G), new k(U, H, Y);
}
subtract(S) {
return this.add(S.negate());
}
is0() {
return this.equals(k.ZERO);
}
/**
* Constant time multiplication.
* Uses wNAF method. Windowed method may be 10% faster,
* but takes 2x longer to generate and consumes 2x memory.
* Uses precomputes when available.
* Uses endomorphism for Koblitz curves.
* @param scalar by which the point would be multiplied
* @returns New point
*/
multiply(S) {
const { endo: I } = t;
if (!s.isValidNot0(S))
throw new Error("invalid scalar: out of range");
let L, R;
const x = (V) => ge.cached(this, V, (B) => xn(k, B));
if (I) {
const { k1neg: V, k1: B, k2neg: U, k2: H } = O(S), { p: Y, f: oe } = x(B), { p: J, f: G } = x(H);
R = oe.add(G), L = $(I.beta, Y, J, V, U);
} else {
const { p: V, f: B } = x(S);
L = V, R = B;
}
return xn(k, [L, R])[0];
}
/**
* Non-constant-time multiplication. Uses double-and-add algorithm.
* It's faster, but should only be used when you don't care about
* an exposed secret key e.g. sig verification, which works over *public* keys.
*/
multiplyUnsafe(S) {
const { endo: I } = t, L = this;
if (!s.isValid(S))
throw new Error("invalid scalar: out of range");
if (S === Qe || L.is0())
return k.ZERO;
if (S === It)
return L;
if (ge.hasCache(this))
return this.multiply(S);
if (I) {
const { k1neg: R, k1: x, k2neg: V, k2: B } = O(S), { p1: U, p2: H } = oa(k, L, x, B);
return $(I.beta, U, H, R, V);
} else
return ge.unsafe(L, S);
}
multiplyAndAddUnsafe(S, I, L) {
const R = this.multiplyUnsafe(I).add(S.multiplyUnsafe(L));
return R.is0() ? void 0 : R;
}
/**
* Converts Projective point to affine (x, y) coordinates.
* @param invertedZ Z^-1 (inverted zero) - optional, precomputation is useful for invertBatch
*/
toAffine(S) {
return P(this, S);
}
/**
* Checks whether Point is free of torsion elements (is in prime subgroup).
* Always torsion-free for cofactor=1 curves.
*/
isTorsionFree() {
const { isTorsionFree: S } = t;
return i === It ? !0 : S ? S(k, this) : ge.unsafe(this, a).is0();
}
clearCofactor() {
const { clearCofactor: S } = t;
return i === It ? this : S ? S(k, this) : this.multiplyUnsafe(i);
}
isSmallOrder() {
return this.multiplyUnsafe(i).is0();
}
toBytes(S = !0) {
return hn(S, "isCompressed"), this.assertValidity(), g(k, this, S);
}
toHex(S = !0) {
return gt(this.toBytes(S));
}
toString() {
return `<Point ${this.is0() ? "ZERO" : this.toHex()}>`;
}
// TODO: remove
get px() {
return this.X;
}
get py() {
return this.X;
}
get pz() {
return this.Z;
}
toRawBytes(S = !0) {
return this.toBytes(S);
}
_setWindowSize(S) {
this.precompute(S);
}
static normalizeZ(S) {
return xn(k, S);
}
static msm(S, I) {
return ia(k, s, S, I);
}
static fromPrivateKey(S) {
return k.BASE.multiply(Lt(s, S));
}
}
k.BASE = new k(o.Gx, o.Gy, r.ONE), k.ZERO = new k(r.ZERO, r.ONE, r.ZERO), k.Fp = r, k.Fn = s;
const se = s.BITS, ge = new sa(k, t.endo ? Math.ceil(se / 2) : se);
return k.BASE.precompute(8), k;
}
function wo(e) {
return Uint8Array.of(e ? 2 : 3);
}
function vo(e, t) {
return {
secretKey: t.BYTES,
publicKey: 1 + e.BYTES,
publicKeyUncompressed: 1 + 2 * e.BYTES,
publicKeyHasPrefix: !0,
signature: 2 * t.BYTES
};
}
function da(e, t = {}) {
const { Fn: n } = e, r = t.randomBytes || eo, s = Object.assign(vo(e.Fp, n), { seed: Eo(n.ORDER) });
function o(g) {
try {
return !!Lt(n, g);
} catch {
return !1;
}
}
function i(g, y) {
const { publicKey: E, publicKeyUncompressed: p } = s;
try {
const f = g.length;
return y === !0 && f !== E || y === !1 && f !== p ? !1 : !!e.fromBytes(g);
} catch {
return !1;
}
}
function a(g = r(s.seed)) {
return ta(ft(g, s.seed, "seed"), n.ORDER);
}
function l(g, y = !0) {
return e.BASE.multiply(Lt(n, g)).toBytes(y);
}
function c(g) {
const y = a(g);
return { secretKey: y, publicKey: l(y) };
}
function _(g) {
if (typeof g == "bigint")
return !1;
if (g instanceof e)
return !0;
const { secretKey: y, publicKey: E, publicKeyUncompressed: p } = s;
if (n.allowedLengths || y === E)
return;
const f = Te("key", g).length;
return f === E || f === p;
}
function m(g, y, E = !0) {
if (_(g) === !0)
throw new Error("first arg must be private key");
if (_(y) === !1)
throw new Error("second arg must be public key");
const p = Lt(n, g);
return e.fromHex(y).multiply(p).toBytes(E);
}
return Object.freeze({ getPublicKey: l, getSharedSecret: m, keygen: c, Point: e, utils: {
isValidSecretKey: o,
isValidPublicKey: i,
randomSecretKey: a,
// TODO: remove
isValidPrivateKey: o,
randomPrivateKey: a,
normPrivateKeyToScalar: (g) => Lt(n, g),
precompute(g = 8, y = e.BASE) {
return y.precompute(g, !1);
}
}, lengths: s });
}
function ma(e, t, n = {}) {
Js(t), yr(n, {}, {
hmac: "function",
lowS: "boolean",
randomBytes: "function",
bits2int: "function",
bits2int_modN: "function"
});
const r = n.randomBytes || eo, s = n.hmac || ((I, ...L) => oo(t, I, Je(...L))), { Fp: o, Fn: i } = e, { ORDER: a, BITS: l } = i, { keygen: c, getPublicKey: _, getSharedSecret: m, utils: u, lengths: g } = da(e, n), y = {
prehash: !1,
lowS: typeof n.lowS == "boolean" ? n.lowS : !1,
format: void 0,
//'compact' as ECDSASigFormat,
extraEntropy: !1
}, E = "compact";
function p(I) {
const L = a >> It;
return I > L;
}
function f(I, L) {
if (!i.isValidNot0(L))
throw new Error(`invalid signature ${I}: out of range 1..Point.Fn.ORDER`);
return L;
}
function b(I, L) {
er(L);
const R = g.signature, x = L === "compact" ? R : L === "recovered" ? R + 1 : void 0;
return ft(I, x, `${L} signature`);
}
class v {
constructor(L, R, x) {
this.r = f("r", L), this.s = f("s", R), x != null && (this.recovery = x), Object.freeze(this);
}
static fromBytes(L, R = E) {
b(L, R);
let x;
if (R === "der") {
const { r: H, s: Y } = Xe.toSig(ft(L));
return new v(H, Y);
}
R === "recovered" && (x = L[0], R = "compact", L = L.subarray(1));
const V = i.BYTES, B = L.subarray(0, V), U = L.subarray(V, V * 2);
return new v(i.fromBytes(B), i.fromBytes(U), x);
}
static fromHex(L, R) {
return this.fromBytes(_n(L), R);
}
addRecoveryBit(L) {
return new v(this.r, this.s, L);
}
recoverPublicKey(L) {
const R = o.ORDER, { r: x, s: V, recovery: B } = this;
if (B == null || ![0, 1, 2, 3].includes(B))
throw new Error("recovery id invalid");
if (a * yo < R && B > 1)
throw new Error("recovery id is ambiguous for h>1 curve");
const H = B === 2 || B === 3 ? x + a : x;
if (!o.isValid(H))
throw new Error("recovery id 2 or 3 invalid");
const Y = o.toBytes(H), oe = e.fromBytes(Je(wo((B & 1) === 0), Y)), J = i.inv(H), G = O(Te("msgHash", L)), ne = i.create(-G * J), ie = i.create(V * J), Ee = e.BASE.multiplyUnsafe(ne).add(oe.multiplyUnsafe(ie));
if (Ee.is0())
throw new Error("point at infinify");
return Ee.assertValidity(), Ee;
}
// Signatures should be low-s, to prevent malleability.
hasHighS() {
return p(this.s);
}
toBytes(L = E) {
if (er(L), L === "der")
return _n(Xe.hexFromSig(this));
const R = i.toBytes(this.r), x = i.toBytes(this.s);
if (L === "recovered") {
if (this.recovery == null)
throw new Error("recovery bit must be present");
return Je(Uint8Array.of(this.recovery), R, x);
}
return Je(R, x);
}
toHex(L) {
return gt(this.toBytes(L));
}
// TODO: remove
assertValidity() {
}
static fromCompact(L) {
return v.fromBytes(Te("sig", L), "compact");
}
static fromDER(L) {
return v.fromBytes(Te("sig", L), "der");
}
normalizeS() {
return this.hasHighS() ? new v(this.r, i.neg(this.s), this.recovery) : this;
}
toDERRawBytes() {
return this.toBytes("der");
}
toDERHex() {
return gt(this.toBytes("der"));
}
toCompactRawBytes() {
return this.toBytes("compact");
}
toCompactHex() {
return gt(this.toBytes("compact"));
}
}
const w = n.bits2int || function(L) {
if (L.length > 8192)
throw new Error("input is too large");
const R = In(L), x = L.length * 8 - l;
return x > 0 ? R >> BigInt(x) : R;
}, O = n.bits2int_modN || function(L) {
return i.create(w(L));
}, P = en(l);
function T(I) {
return Wi("num < 2^" + l, I, Qe, P), i.toBytes(I);
}
function $(I, L) {
return ft(I, void 0, "message"), L ? ft(t(I), void 0, "prehashed message") : I;
}
function k(I, L, R) {
if (["recovered", "canonical"].some((ne) => ne in R))
throw new Error("sign() legacy options not supported");
const { lowS: x, prehash: V, extraEntropy: B } = Vn(R, y);
I = $(I, V);
const U = O(I), H = Lt(i, L), Y = [T(H), T(U)];
if (B != null && B !== !1) {
const ne = B === !0 ? r(g.secretKey) : B;
Y.push(Te("extraEntropy", ne));
}
const oe = Je(...Y), J = U;
function G(ne) {
const ie = w(ne);
if (!i.isValidNot0(ie))
return;
const Ee = i.inv(ie), ee = e.BASE.multiply(ie).toAffine(), de = i.create(ee.x);
if (de === Qe)
return;
const et = i.create(Ee * i.create(J + de * H));
if (et === Qe)
return;
let yt = (ee.x === de ? 0 : 2) | Number(ee.y & It), tt = et;
return x && p(et) && (tt = i.neg(et), yt ^= 1), new v(de, tt, yt);
}
return { seed: oe, k2sig: G };
}
function se(I, L, R = {}) {
I = Te("message", I);
const { seed: x, k2sig: V } = k(I, L, R);
return Yi(t.outputLen, i.BYTES, s)(x, V);
}
function ge(I) {
let L;
const R = typeof I == "string" || On(I), x = !R && I !== null && typeof I == "object" && typeof I.r == "bigint" && typeof I.s == "bigint";
if (!R && !x)
throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");
if (x)
L = new v(I.r, I.s);
else if (R) {
try {
L = v.fromBytes(Te("sig", I), "der");
} catch (V) {
if (!(V instanceof Xe.Err))
throw V;
}
if (!L)
try {
L = v.fromBytes(Te("sig", I), "compact");
} catch {
return !1;
}
}
return L || !1;
}
function F(I, L, R, x = {}) {
const { lowS: V, prehash: B, format: U } = Vn(x, y);
if (R = Te("publicKey", R), L = $(Te("message", L), B), "strict" in x)
throw new Error("options.strict was renamed to lowS");
const H = U === void 0 ? ge(I) : v.fromBytes(Te("sig", I), U);
if (H === !1)
return !1;
try {
const Y = e.fromBytes(R);
if (V && H.hasHighS())
return !1;
const { r: oe, s: J } = H, G = O(L), ne = i.inv(J), ie = i.create(G * ne), Ee = i.create(oe * ne), ee = e.BASE.multiplyUnsafe(ie).add(Y.multiplyUnsafe(Ee));
return ee.is0() ? !1 : i.create(ee.x) === oe;
} catch {
return !1;
}
}
function S(I, L, R = {}) {
const { prehash: x } = Vn(R, y);
return L = $(L, x), v.fromBytes(I, "recovered").recoverPublicKey(L).toBytes();
}
return Object.freeze({
keygen: c,
getPublicKey: _,
getSharedSecret: m,
utils: u,
lengths: g,
Point: e,
sign: se,
verify: F,
recoverPublicKey: S,
Signature: v,
hash: t
});
}
function _a(e) {
const t = {
a: e.a,
b: e.b,
p: e.Fp.ORDER,
n: e.n,
h: e.h,
Gx: e.Gx,
Gy: e.Gy
}, n = e.Fp;
let r = e.allowedPrivateKeyLengths ? Array.from(new Set(e.allowedPrivateKeyLengths.map((i) => Math.ceil(i / 2)))) : void 0;
const s = kt(t.n, {
BITS: e.nBitLength,
allowedLengths: r,
modFromBytes: e.wrapPrivateKey
}), o = {
Fp: n,
Fn: s,
allowInfinityPoint: e.allowInfinityPoint,
endo: e.endo,
isTorsionFree: e.isTorsionFree,
clearCofactor: e.clearCofactor,
fromBytes: e.fromBytes,
toBytes: e.toBytes
};
return { CURVE: t, curveOpts: o };
}
function ha(e) {
const { CURVE: t, curveOpts: n } = _a(e), r = {
hmac: e.hmac,
randomBytes: e.randomBytes,
lowS: e.lowS,
bits2int: e.bits2int,
bits2int_modN: e.bits2int_modN
};
return { CURVE: t, curveOpts: n, hash: e.hash, ecdsaOpts: r };
}
function ga(e, t) {
const n = t.Point;
return Object.assign({}, t, {
ProjectivePoint: n,
CURVE: Object.assign({}, e, ho(n.Fn.ORDER, n.Fn.BITS))
});
}
function Ea(e) {
const { CURVE: t, curveOpts: n, hash: r, ecdsaOpts: s } = ha(e), o = fa(t, n), i = ma(o, r, s);
return ga(e, i);
}
/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */
function No(e) {
return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array";
}
function pn(e, ...t) {
if (!No(e))
throw new Error("Uint8Array expected");
if (t.length > 0 && !t.includes(e.length))
throw new Error("Uint8Array expected of length " + t + ", got length=" + e.length);
}
function bn(e, t = !0) {
if (e.destroyed)
throw new Error("Hash instance has been destroyed");
if (t && e.finished)
throw new Error("Hash#digest() has already been called");
}
function To(e, t) {
pn(e);
const n = t.outputLen;
if (e.length < n)
throw new Error("digestInto() expects output buffer of length at least " + n);
}
function Yt(e) {
return new Uint32Array(e.buffer, e.byteOffset, Math.floor(e.byteLength / 4));
}
function tr(...e) {
for (let t = 0; t < e.length; t++)
e[t].fill(0);
}
function nr(e) {
return new DataView(e.buffer, e.byteOffset, e.byteLength);
}
function pa(e) {
if (typeof e != "string")
throw new Error("string expected");
return new Uint8Array(new TextEncoder().encode(e));
}
function Kt(e) {
if (typeof e == "string")
e = pa(e);
else if (No(e))
e = Lo(e);
else
throw new Error("Uint8Array expected, got " + typeof e);
return e;
}
function Hn(e, t, n, r) {
if (typeof e.setBigUint64 == "function")
return e.setBigUint64(t, n, r);
const s = BigInt(32), o = BigInt(4294967295), i = Number(n >> s & o), a = Number(n & o), l = 0, c = 4;
e.setUint32(t + l, i, r), e.setUint32(t + c, a, r);
}
function Lo(e) {
return Uint8Array.from(e);
}
const Ze = 16, vr = /* @__PURE__ */ new Uint8Array(16), $e = Yt(vr), ba = 225, ya = (e, t, n, r) => {
const s = r & 1;
return {
s3: n << 31 | r >>> 1,
s2: t << 31 | n >>> 1,
s1: e << 31 | t >>> 1,
s0: e >>> 1 ^ ba << 24 & -(s & 1)
// reduce % poly
};
}, Re = (e) => (e >>> 0 & 255) << 24 | (e >>> 8 & 255) << 16 | (e >>> 16 & 255) << 8 | e >>> 24 & 255 | 0;
function wa(e) {
e.reverse();
const t = e[15] & 1;
let n = 0;
for (let r = 0; r < e.length; r++) {
const s = e[r];
e[r] = s >>> 1 | n, n = (s & 1) << 7;
}
return e[0] ^= -t & 225, e;
}
const va = (e) => e > 64 * 1024 ? 8 : e > 1024 ? 4 : 2;
class Oo {
// We select bits per window adaptively based on expectedLength
constructor(t, n) {
this.blockLen = Ze, this.outputLen = Ze, this.s0 = 0, this.s1 = 0, this.s2 = 0, this.s3 = 0, this.finished = !1, t = Kt(t), pn(t, 16);
const r = nr(t);
let s = r.getUint32(0, !1), o = r.getUint32(4, !1), i = r.getUint32(8, !1), a = r.getUint32(12, !1);
const l = [];
for (let y = 0; y < 128; y++)
l.push({ s0: Re(s), s1: Re(o), s2: Re(i), s3: Re(a) }), { s0: s, s1: o, s2: i, s3: a } = ya(s, o, i, a);
const c = va(n || 1024);
if (![1, 2, 4, 8].includes(c))
throw new Error("ghash: invalid window size, expected 2, 4 or 8");
this.W = c;
const m = 128 / c, u = this.windowSize = 2 ** c, g = [];
for (let y = 0; y < m; y++)
for (let E = 0; E < u; E++) {
let p = 0, f = 0, b = 0, v = 0;
for (let w = 0; w < c; w++) {
if (!(E >>> c - w - 1 & 1))
continue;
const { s0: P, s1: T, s2: $, s3: k } = l[c * y + w];
p ^= P, f ^= T, b ^= $, v ^= k;
}
g.push({ s0: p, s1: f, s2: b, s3: v });
}
this.t = g;
}
_updateBlock(t, n, r, s) {
t ^= this.s0, n ^= this.s1, r ^= this.s2, s ^= this.s3;
const { W: o, t: i, windowSize: a } = this;
let l = 0, c = 0, _ = 0, m = 0;
const u = (1 << o) - 1;
let g = 0;
for (const y of [t, n, r, s])
for (let E = 0; E < 4; E++) {
const p = y >>> 8 * E & 255;
for (let f = 8 / o - 1; f >= 0; f--) {
const b = p >>> o * f & u, { s0: v, s1: w, s2: O, s3: P } = i[g * a + b];
l ^= v, c ^= w, _ ^= O, m ^= P, g += 1;
}
}
this.s0 = l, this.s1 = c, this.s2 = _, this.s3 = m;
}
update(t) {
bn(this), t = Kt(t), pn(t);
const n = Yt(t), r = Math.floor(t.length / Ze), s = t.length % Ze;
for (let o = 0; o < r; o++)
this._updateBlock(n[o * 4 + 0], n[o * 4 + 1], n[o * 4 + 2], n[o * 4 + 3]);
return s && (vr.set(t.subarray(r * Ze)), this._updateBlock($e[0], $e[1], $e[2], $e[3]), tr($e)), this;
}
destroy() {
const { t } = this;
for (const n of t)
n.s0 = 0, n.s1 = 0, n.s2 = 0, n.s3 = 0;
}
digestInto(t) {
bn(this), To(t, this), this.finished = !0;
const { s0: n, s1: r, s2: s, s3: o } = this, i = Yt(t);
return i[0] = n, i[1] = r, i[2] = s, i[3] = o, t;
}
digest() {
const t = new Uint8Array(Ze);
return this.digestInto(t), this.destroy(), t;
}
}
class Na extends Oo {
constructor(t, n) {
t = Kt(t), pn(t);
const r = wa(Lo(t));
super(r, n), tr(r);
}
update(t) {
t = Kt(t), bn(this);
const n = Yt(t), r = t.length % Ze, s = Math.floor(t.length / Ze);
for (let o = 0; o < s; o++)
this._updateBlock(Re(n[o * 4 + 3]), Re(n[o * 4 + 2]), Re(n[o * 4 + 1]), Re(n[o * 4 + 0]));
return r && (vr.set(t.subarray(s * Ze)), this._updateBlock(Re($e[3]), Re($e[2]), Re($e[1]), Re($e[0])), tr($e)), this;
}
digestInto(t) {
bn(this), To(t, this), this.finished = !0;
const { s0: n, s1: r, s2: s, s3: o } = this, i = Yt(t);
return i[0] = n, i[1] = r, i[2] = s, i[3] = o, t.reverse();
}
}
function Io(e) {
const t = (r, s) => e(s, r.length).update(Kt(r)).digest(), n = e(new Uint8Array(16), 0);
return t.outputLen = n.outputLen, t.blockLen = n.blockLen, t.create = (r, s) => e(r, s), t;
}
const ns = Io((e, t) => new Oo(e, t));
Io((e, t) => new Na(e, t));
var Ta = Object.defineProperty, Ao = (e, t) => {
for (var n in t)
Ta(e, n, { get: t[n], enumerable: !0 });
}, So = {};
Ao(So, {
EmptyArray: () => Ar,
arrayToHex: () => Sn,
arrayToUtf8: () => vn,
calculateSharedKey: () => Za,
comparePublicKeyHex: () => qa,
compressPublicKeyHex: () => Ga,
doDecrypt: () => Qa,
doEncrypt: () => Ja,
doSignature: () => za,
doVerifySignature: () => el,
generateKeyPairHex: () => Ir,
getHash: () => Sr,
getPoint: () => Mo,
getPublicKeyFromPrivateKey: () => xo,
getZ: () => Tn,
hexToArray: () => me,
initRNGPool: () => Tr,
leftPad: () => pe,
precomputePublicKey: () => tl,
utf8ToHex: () => Ct,
verifyPublicKey: () => ja
});
var yn = BigInt(0), Gt = BigInt(1), La = BigInt(2);
BigInt(3);
function Oa(e) {
let t = e.toString(16);
if (t[0] !== "-")
t.length % 2 === 1 ? t = "0" + t : t.match(/^[0-7]/) || (t = "00" + t);
else {
t = t.substring(1);
let n = t.length;
n % 2 === 1 ? n += 1 : t.match(/^[0-7]/) || (n += 2);
let r = "";
for (let i = 0; i < n; i++)
r += "f";
t = ((he(r) ^ e) + Gt).toString(16).replace(/^-/, "");
}
return t;
}
var Nr = class {
constructor(e = null, t = "00", n = "00", r = "") {
this.tlv = e, this.t = t, this.l = n, this.v = r;
}
/**
* 获取 der 编码比特流16进制串
*/
getEncodedHex() {
return this.tlv || (this.v = this.getValue(), this.l = this.getLength(), this.tlv = this.t + this.l + this.v), this.tlv;
}
getLength() {
const e = this.v.length / 2;
let t = e.toString(16);
return t.length % 2 === 1 && (t = "0" + t), e < 128 ? t : (128 + t.length / 2).toString(16) + t;
}
getValue() {
return "";
}
}, wn = class extends Nr {
constructor(e) {
super(), this.t = "02", e && (this.v = Oa(e));
}
getValue() {
return this.v;
}
}, rs = class extends Nr {
constructor(t) {
super();
ae(this, "hV", "");
this.s = t, this.t = "04", t && (this.v = t.toLowerCase());
}
getValue() {
return this.v;
}
}, Co = class extends Nr {
constructor(t) {
super();
ae(this, "t", "30");
this.asn1Array = t;
}
getValue() {
return this.v = this.asn1Array.map((t) => t.getEncodedHex()).join(""), this.v;
}
};
function Po(e, t) {
if (+e[t + 2] < 8)
return 1;
const r = e.slice(t + 2, t + 6).slice(0, 2);
return (parseInt(r, 16) - 128) * 2;
}
function rr(e, t) {
const n = Po(e, t), r = e.substring(t + 2, t + 2 + n * 2);
return r ? +(+r[0] < 8 ? he(r) : he(r.substring(2))).toString() : -1;
}
function $t(e, t) {
const n = Po(e, t);
return t + (n + 1) * 2;
}
function Ia(e, t) {
const n = new wn(e), r = new wn(t);
return new Co([n, r]).getEncodedHex();
}
function ss(e, t, n, r) {
const s = new wn(e), o = new wn(t), i = new rs(n), a = new rs(r);
return new Co([s, o, i, a]).getEncodedHex();
}
function Aa(e) {
const t = $t(e, 0), n = $t(e, t), r = rr(e, t), s = e.substring(n, n + r * 2), o = n + s.length, i = $t(e, o), a = rr(e, o), l = e.substring(i, i + a * 2), c = he(s), _ = he(l);
return { r: c, s: _ };
}
function Sa(e) {
function t(u, g) {
const y = $t(u, g), E = rr(u, g), p = u.substring(y, y + E * 2), f = y + p.length;
return { value: p, nextStart: f };
}
const n = $t(e, 0), { value: r, nextStart: s } = t(e, n), { value: o, nextStart: i } = t(e, s), { value: a, nextStart: l } = t(e, i), { value: c } = t(e, l), _ = he(r), m = he(o);
return { x: _, y: m, hash: a, cipher: c };
}
var $n = 16384, _t = new Uint8Array(0), Ot;
async function Tr() {
if ("crypto" in globalThis) {
Ot = globalThis.crypto;
return;
}
if (!(_t.length > $n / 2))
if ("wx" in globalThis && "getRandomValues" in globalThis.wx)
_t = await new Promise((e) => {
wx.getRandomValues({
length: $n,
success(t) {
e(new Uint8Array(t.randomValues));
}
});
});
else
try {
globalThis.crypto ? Ot = globalThis.crypto : Ot = (await import(
/* webpackIgnore: true */
"./__vite-browser-external-DYxpcVy9.js"
)).webcrypto;
const e = new Uint8Array($n);
Ot.getRandomValues(e), _t = e;
} catch {
throw new Error("no available csprng, abort.");
}
}
Tr();
function Ca(e) {
if (_t.length > e) {
const t = _t.slice(0, e);
return _t = _t.slice(e), Tr(), t;
} else
throw new Error("random number pool is not ready or insufficient, prevent getting too long random values or too often.");
}
function Pa(e = 0) {
const t = new Uint8Array(e);
return Ot ? Ot.getRandomValues(t) : Ca(e);
}
var Ro = (e) => e instanceof Uint8Array, Wn = (e) => new DataView(e.buffer, e.byteOffset, e.byteLength), Ra = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
if (!Ra)
throw new Error("Non little-endian hardware is not supported");
var Da = Array.from({ length: 256 }, (e, t) => t.toString(16).padStart(2, "0"));
function We(e) {
if (!Ro(e))
throw new Error("Uint8Array expected");
let t = "";
for (let n = 0; n < e.length; n++)
t += Da[e[n]];
return t;
}
function ka(e) {
if (typeof e != "string")
throw new Error(`utf8ToBytes expected string, got ${typeof e}`);
return new Uint8Array(new TextEncoder().encode(e));
}
function Lr(e) {
if (typeof e == "string" && (e = ka(e)), !Ro(e))
throw new Error(`expected Uint8Array, got ${typeof e}`);
return e;
}
var Do = class {
// Safe version that clones internal state
clone() {
return this._cloneInto();
}
};
function Ua(e) {
const t = (r) => e().update(Lr(r)).digest(), n = e();
return t.outputLen = n.outputLen, t.blockLen = n.blockLen, t.create = () => e(), t;
}
var xa = (e, t, n) => e & t | e & n | t & n, os = (e, t, n) => e ^ t ^ n, Ma = (e, t, n) => e & t | ~e & n;
function Fa(e, t, n, r) {
if (typeof e.setBigUint64 == "function")
return e.setBigUint64(t, n, r);
const s = BigInt(32), o = BigInt(4294967295), i = Number(n >> s & o), a = Number(n & o), l = r ? 4 : 0, c = r ? 0 : 4;
e.setUint32(t + l, i, r), e.setUint32(t + c, a, r);
}
function De(e, t) {
const n = t & 31;
return e << n | e >>> 32 - n;
}
function Ba(e) {
return e ^ De(e, 9) ^ De(e, 17);
}
function Va(e) {
return e ^ De(e, 15) ^ De(e, 23);
}
var Ha = class extends Do {
constructor(t, n, r, s) {
super();
// For partial updates less than block size
ae(this, "buffer");
ae(this, "view");
ae(this, "finished", !1);
ae(this, "length", 0);
ae(this, "pos", 0);
ae(this, "destroyed", !1);
this.blockLen = t, this.outputLen = n, this.padOffset = r, this.isLE = s, this.buffer = new Uint8Array(t), this.view = Wn(this.buffer);
}
update(t) {
const { view: n, buffer: r, blockLen: s } = this;
t = Lr(t);
const o = t.length;
for (let i = 0; i < o; ) {
const a = Math.min(s - this.pos, o - i);
if (a === s) {
const l = Wn(t);
for (; s <= o - i; i += s)
this.process(l, i);
continue;
}
r.set(t.subarray(i, i + a), this.pos), this.pos += a, i += a, this.pos === s && (this.process(n, 0), this.pos = 0);
}
return this.length += t.length, this.roundClean(), this;
}
digestInto(t) {
this.finished = !0;
const { buffer: n, view: r, blockLen: s, isLE: o } = this;
let { pos: i } = this;
n[i++] = 128, this.buffer.subarray(i).fill(0), this.padOffset > s - i && (this.process(r, 0), i = 0);
for (let m = i; m < s; m++)
n[m] = 0;
Fa(r, s - 8, BigInt(this.length * 8), o), this.process(r, 0);
const a = Wn(t), l = this.outputLen;
if (l % 4)
throw new Error("_sha2: outputLen should be aligned to 32bit");
const c = l / 4, _ = this.get();
if (c > _.length)
throw new Error("_sha2: outputLen bigger than state");
for (let m = 0; m < c; m++)
a.setUint32(4 * m, _[m], o);
}
digest() {
const { buffer: t, outputLen: n } = this;
this.digestInto(t);
const r = t.slice(0, n);
return this.destroy(), r;
}
_cloneInto(t) {
t || (t = new this.constructor()), t.set(...this.get());
const { blockLen: n, buffer: r, length: s, finished: o, destroyed: i, pos: a } = this;
return t.length = s, t.pos = a, t.finished = o, t.destroyed = i, s % n && t.buffer.set(r), t;
}
}, nt = new Uint32Array([1937774191, 1226093241, 388252375, 3666478592, 2842636476, 372324522, 3817729613, 2969243214]), Me = new Uint32Array(68), is = new Uint32Array(64), $a = 2043430169, Wa = 2055708042, Ya = class extends Ha {
constructor() {
super(64, 32, 8, !1);
// We cannot use array here since array allows indexing by variable
// which means optimizer/compiler cannot use registers.
ae(this, "A", nt[0] | 0);
ae(this, "B", nt[1] | 0);
ae(this, "C", nt[2] | 0);
ae(this, "D", nt[3] | 0);
ae(this, "E", nt[4] | 0);
ae(this, "F", nt[5] | 0);
ae(this, "G", nt[6] | 0);
ae(this, "H", nt[7] | 0);
}
get() {
const { A: t, B: n, C: r, D: s, E: o, F: i, G: a, H: l } = this;
return [t, n, r, s, o, i, a, l];
}
// prettier-ignore
set(t, n, r, s, o, i, a, l) {
this.A = t | 0, this.B = n | 0, this.C = r | 0, this.D = s | 0, this.E = o | 0, this.F = i | 0, this.G = a | 0, this.H = l | 0;
}
process(t, n) {
for (let m = 0; m < 16; m++, n += 4)
Me[m] = t.getUint32(n, !1);
for (let m = 16; m < 68; m++)
Me[m] = Va(Me[m - 16] ^ Me[m - 9] ^ De(Me[m - 3], 15)) ^ De(Me[m - 13], 7) ^ Me[m - 6];
for (let m = 0; m < 64; m++)
is[m] = Me[m] ^ Me[m + 4];
let { A: r, B: s, C: o, D: i, E: a, F: l, G: c, H: _ } = this;
for (let m = 0; m < 64; m++) {
let u = m >= 0 && m <= 15, g = u ? $a : Wa, y = De(De(r, 12) + a + De(g, m), 7), E = y ^ De(r, 12), p = (u ? os(r, s, o) : xa(r, s, o)) + i + E + is[m] | 0, f = (u ? os(a, l, c) : Ma(a, l, c)) + _ + y + Me[m] | 0;
i = o, o = De(s, 9), s = r, r = p, _ = c, c = De(l, 19), l = a, a = Ba(f);
}
r = r ^ this.A | 0, s = s ^ this.B | 0, o = o ^ this.C | 0, i = i ^ this.D | 0, a = a ^ this.E | 0, l = l ^ this.F | 0, c = c ^ this.G | 0, _ = _ ^ this.H | 0, this.set(r, s, o, i, a, l, c, _);
}
roundClean() {
Me.fill(0);
}
destroy() {
this.set(0, 0, 0, 0, 0, 0, 0, 0), this.buffer.fill(0);
}
}, Ye = Ua(() => new Ya()), ko = class extends Do {
constructor(t, n) {
super();
ae(this, "oHash");
ae(this, "iHash");
ae(this, "blockLen");
ae(this, "outputLen");
ae(this, "finished", !1);
ae(this, "destroyed", !1);
const r = Lr(n);
if (this.iHash = t.create(), typeof this.iHash.update != "function")
throw new Error("Expected instance of class which extends utils.Hash");
this.blockLen = this.iHash.blockLen, this.outputLen = this.iHash.outputLen;
const s = this.blockLen, o = new Uint8Array(s);
o.set(r.length > s ? t.create().update(r).digest() : r);
for (let i = 0; i < o.length; i++)
o[i] ^= 54;
this.iHash.update(o), this.oHash = t.create();
for (let i = 0; i < o.length; i++)
o[i] ^= 106;
this.oHash.update(o), o.fill(0);
}
update(t) {
return this.iHash.update(t), this;
}
digestInto(t) {
this.finished = !0, this.iHash.digestInto(t), this.oHash.update(t), this.oHash.digestInto(t), this.destroy();
}
digest() {
const t = new Uint8Array(this.oHash.outputLen);
return this.digestInto(t), t;
}
_cloneInto(t) {
t || (t = Object.create(Object.getPrototypeOf(this), {}));
const { oHash: n, iHash: r, finished: s, destroyed: o, blockLen: i, outputLen: a } = this;
return t = t, t.finished = s, t.destroyed = o, t.blockLen = i, t.outputLen = a, t.oHash = n._cloneInto(t.oHash), t.iHash = r._cloneInto(t.iHash), t;
}
destroy() {
this.destroyed = !0, this.oHash.destroy(), this.iHash.destroy();
}
}, Or = (e, t, n) => new ko(e, t).update(n).digest();
Or.create = (e, t) => new ko(e, t);
var Ka = kt(BigInt("115792089210356248756420345214020892766250353991924191454421193933289684991999")), re = Ea({
// sm2: short weierstrass.
a: BigInt("115792089210356248756420345214020892766250353991924191454421193933289684991996"),
b: BigInt("18505919022281880113072981827955639221458448578012075254857346196103069175443"),
Fp: Ka,
h: Gt,
n: BigInt("115792089210356248756420345214020892766061623724957744567843809356293439045923"),
Gx: BigInt("22963146547237050559479531362550074578802567295341616970375194840604139615431"),
Gy: BigInt("85132369209828568825618990617112496413088388631904505083283536607588877201568"),
hash: Ye,
hmac: (e, ...t) => Or(Ye, e, ot(...t)),
randomBytes: Pa
}), Fe = kt(BigInt(re.CURVE.n));
function Ir(e) {
const t = e ? Gi(Ae(BigInt(e), Gt) + Gt, 32) : re.utils.randomPrivateKey(), n = re.getPublicKey(t, !1), r = pe(gn(t), 64), s = pe(gn(n), 64);
return { privateKey: r, publicKey: s };
}
function Ga(e) {
if (e.length !== 130)
throw new Error("Invalid public key to compress");
const t = (e.length - 2) / 2, n = e.substring(2, 2 + t), r = he(e.substring(t + 2, t + t + 2));
let s = "03";
return Ae(r, La) === yn && (s = "02"), s + n;
}
function Ct(e) {
const t = Ki(e);
return gn(t);
}
function pe(e, t) {
return e.length >= t ? e : new Array(t - e.length + 1).join("0") + e;
}
function Sn(e) {
return e.map((t) => {
const n = t.toString(16);
return n.length === 1 ? "0" + n : n;
}).join("");
}
function vn(e) {
const t = [];
for (let n = 0, r = e.length; n < r; n++)
e[n] >= 240 && e[n] <= 247 ? (t.push(String.fromCodePoint(((e[n] & 7) << 18) + ((e[n + 1] & 63) << 12) + ((e[n + 2] & 63) << 6) + (e[n + 3] & 63))), n += 3) : e[n] >= 224 && e[n] <= 239 ? (t.push(String.fromCodePoint(((e[n] & 15) << 12) + ((e[n + 1] & 63) << 6) + (e[n + 2] & 63))), n += 2) : e[n] >= 192 && e[n] <= 223 ? (t.push(String.fromCodePoint(((e[n] & 31) << 6) + (e[n + 1] & 63))), n++) : t.push(String.fromCodePoint(e[n]));
return t.join("");
}
function me(e) {
let t = e.length;
t % 2 !== 0 && (e = pe(e, t + 1)), t = e.length;
const n = t / 2, r = new Uint8Array(n);
for (let s = 0; s < n; s++)
r[s] = parseInt(e.substring(s * 2, s * 2 + 2), 16);
return r;
}
function ja(e) {
const t = re.ProjectivePoint.fromHex(e);
if (!t)
return !1;
try {
return t.assertValidity(), !0;
} catch {
return !1;
}
}
function qa(e, t) {
const n = re.ProjectivePoint.fromHex(e);
if (!n)
return !1;
const r = re.ProjectivePoint.fromHex(t);
return r ? n.equals(r) : !1;
}
var as = he("80000000000000000000000000000000"), ls = he("7fffffffffffffffffffffffffffffff");
function Xa(e, t) {
let n = new Uint8Array(t), r = 1, s = 0, o = Ar;
const i = new Uint8Array(4), a = () => {
i[0] = r >> 24 & 255, i[1] = r >> 16 & 255, i[2] = r >> 8 & 255, i[3] = r & 255, o = Ye(ot(e, i)), r++, s = 0;
};
a();
for (let l = 0, c = n.length; l < c; l++)
s === o.length && a(), n[l] = o[s++] & 255;
return n;
}
function Za(e, t, n, r, s, o = !1, i = "1234567812345678", a = "1234567812345678") {
const l = re.ProjectivePoint.fromHex(t.publicKey), c = re.ProjectivePoint.fromHex(r), _ = re.ProjectivePoint.fromHex(n);
let m = Tn(e.publicKey, i), u = Tn(n, a);
o && ([m, u] = [u, m]);
const g = he(t.privateKey), y = he(e.privateKey), E = l.x, p = as + (E & ls), f = Fe.add(y, Fe.mulN(p, g)), b = c.x, v = Fe.add(as, b & ls), w = c.multiply(v).add(_).multiply(f), O = me(pe(Oe(w.x), 64)), P = me(pe(Oe(w.y), 64));
return Xa(ot(O, P, m, u), s);
}
var Nn = 0, Ar = new Uint8Array();
function Ja(e, t, n = 1, r) {
const s = typeof e == "string" ? me(Ct(e)) : Uint8Array.from(e), o = typeof t == "string" ? re.ProjectivePoint.fromHex(t) : t, i = Ir(), a = he(i.privateKey);
let l = i.publicKey;
l.length > 128 && (l = l.substring(l.length - 128));
const c = o.multiply(a), _ = me(pe(Oe(c.x), 64)), m = me(pe(Oe(c.y), 64)), u = We(Ye(ot(_, s, m)));
Uo(_, m, s);
const g = We(s);
if (r != null && r.asn1) {
const y = re.ProjectivePoint.fromHex(i.publicKey);
return n === Nn ? ss(y.x, y.y, g, u) : ss(y.x, y.y, u, g);
}
return n === Nn ? l + g + u : l + u + g;
}
function Uo(e, t, n) {
let r = 1, s = 0, o = Ar;
const i = new Uint8Array(4), a = () => {
i[0] = r >> 24 & 255, i[1] = r >> 16 & 255, i[2] = r >> 8 & 255, i[3] = r & 255, o = Ye(ot(e, t, i)), r++, s = 0;
};
a();
for (let l = 0, c = n.length; l < c; l++)
s === o.length && a(), n[l] ^= o[s++] & 255;
}
function Qa(e, t, n = 1, {
output: r = "string",
asn1: s = !1
} = {}) {
const o = he(t);
let i, a, l;
if (s) {
const { x: y, y: E, cipher: p, hash: f } = Sa(e);
i = re.ProjectivePoint.fromAffine({ x: y, y: E }), l = f, a = p, n === Nn && ([a, l] = [l, a]);
} else
i = re.ProjectivePoint.fromHex("04" + e.substring(0, 128)), l = e.substring(128, 192), a = e.substring(192), n === Nn && (l = e.substring(e.length - 64), a = e.substring(128, e.length - 64));
const c = me(a), _ = i.multiply(o), m = me(pe(Oe(_.x), 64)), u = me(pe(Oe(_.y), 64));
return Uo(m, u, c), Sn(Array.from(Ye(ot(m, c, u)))) === l.toLowerCase() ? r === "array" ? c : vn(c) : r === "array" ? [] : "";
}
function za(e, t, n = {}) {
let {
pointPool: r,
der: s,
hash: o,
publicKey: i,
userId: a
} = n, l = typeof e == "string" ? Ct(e) : Sn(Array.from(e));
o && (i = i || xo(t), l = Sr(l, i, a));
const c = he(t), _ = he(l);
let m = null, u = null, g = null;
do {
do {
let y;
r && r.length ? y = r.pop() : y = Mo(), m = y.k, u = Fe.add(_, y.x1);
} while (u === yn || u + m === re.CURVE.n);
g = Fe.mul(Fe.inv(Fe.addN(c, Gt)), Fe.subN(m, Fe.mulN(u, c)));
} while (g === yn);
return s ? Ia(u, g) : pe(Oe(u), 64) + pe(Oe(g), 64);
}
function el(e, t, n, r = {}) {
let s;
const {
hash: o,
der: i,
userId: a
} = r, l = typeof n == "string" ? n : n.toHex(!1);
o ? s = Sr(typeof e == "string" ? Ct(e) : e, l, a) : s = typeof e == "string" ? Ct(e) : Sn(Array.from(e));
let c, _;
if (i) {
const p = Aa(t);
c = p.r, _ = p.s;
} else
c = he(t.substring(0, 64)), _ = he(t.substring(64));
const m = typeof n == "string" ? re.ProjectivePoint.fromHex(n) : n, u = he(s), g = Fe.add(c, _);
if (g === yn)
return !1;
const y = re.ProjectivePoint.BASE.multiply(_).add(m.multiply(g)), E = Fe.add(u, y.x);
return c === E;
}
function Tn(e, t = "1234567812345678") {
t = Ct(t);
const n = pe(Oe(re.CURVE.a), 64), r = pe(Oe(re.CURVE.b), 64), s = pe(Oe(re.ProjectivePoint.BASE.x), 64), o = pe(Oe(re.ProjectivePoint.BASE.y), 64);
let i, a;
if (e.length === 128)
i = e.substring(0, 64), a = e.substring(64, 128);
else {
const m = re.ProjectivePoint.fromHex(e);
i = pe(Oe(m.x), 64), a = pe(Oe(m.y), 64);
}
const l = me(t + n + r + s + o + i + a), c = t.length * 4;
return Ye(ot(new Uint8Array([c >> 8 & 255, c & 255]), l));
}
function Sr(e, t, n = "1234567812345678") {
const r = Tn(t, n);
return We(Ye(ot(r, typeof e == "string" ? me(e) : e)));
}
function tl(e, t) {
const n = re.ProjectivePoint.fromHex(e);
return re.utils.precompute(t, n);
}
function xo(e) {
const t = re.getPublicKey(e, !1);
return pe(gn(t), 64);
}
function Mo() {
const e = Ir(), t = re.ProjectivePoint.fromHex(e.publicKey), n = he(e.privateKey);
return {
...e,
k: n,
x1: t.x
};
}
function sr(e) {
const t = [];
for (let n = 0, r = e.length; n < r; n++) {
const s = e.codePointAt(n);
if (s <= 127)
t.push(s);
else if (s <= 2047)
t.push(192 | s >>> 6), t.push(128 | s & 63);
else if (s <= 55295 || s >= 57344 && s <= 65535)
t.push(224 | s >>> 12), t.push(128 | s >>> 6 & 63), t.push(128 | s & 63);
else if (s >= 65536 && s <= 1114111)
n++, t.push(240 | s >>> 18 & 28), t.push(128 | s >>> 12 & 63), t.push(128 | s >>> 6 & 63), t.push(128 | s & 63);
else
throw t.push(s), new Error("input is not supported");
}
return new Uint8Array(t);
}
function nl(e, t) {
if (e = typeof e == "string" ? sr(e) : e, t) {
if ((t.mode || "hmac") !== "hmac")
throw new Error("invalid mode");
let r = t.key;
if (!r)
throw new Error("invalid key");
return r = typeof r == "string" ? me(r) : r, We(Or(Ye, r, e));
}
return We(Ye(e));
}
var Cr = {};
Ao(Cr, {
decrypt: () => ol,
encrypt: () => sl,
sm4: () => Pr
});
var Ne = 0, Fo = 32, Se = 16, sn = Uint8Array.from([
214,
144,
233,
254,
204,
225,
61,
183,
22,
182,
20,
194,
40,
251,
44,
5,
43,
103,
154,
118,
42,
190,
4,
195,
170,
68,
19,
38,
73,
134,
6,
153,
156,
66,
80,
244,
145,
239,
152,
122,
51,
84,
11,
67,
237,
207,
172,
98,
228,
179,
28,
169,
201,
8,
232,
149,
128,
223,
148,
250,
117,
143,
63,
166,
71,
7,
167,
252,
243,
115,
23,
186,
131,
89,
60,
25,
230,
133,
79,
168,
104,
107,
129,
178,
113,
100,
218,
139,
248,
235,
15,
75,
112,
86,
157,
53,
30,
36,
14,
94,
99,
88,
209,
162,
37,
34,
124,
59,
1,
33,
120,
135,
212,
0,
70,
87,
159,
211,
39,
82,
76,
54,
2,
231,
160,
196,
200,
158,
234,
191,
138,
210,
64,
199,
56,
181,
163,
247,
242,
206,
249,
97,
21,
161,
224,
174,
93,
164,
155,
52,
26,
85,
173,
147,
50,
48,
245,
140,
177,
227,
29,
246,
226,
46,
130,
102,
202,
96,
192,
41,
35,
171,
13,
83,
78,
111,
213,
219,
55,
69,
222,
253,
142,
47,
3,
255,
106,
114,
109,
108,
91,
81,
141,
27,
175,
146,
187,
221,
188,
127,
17,
217,
92,
65,
31,
16,
90,
216,
10,
193,
49,
136,
165,
205,
123,
189,
45,
116,
208,
18,
184,
229,
180,
176,
137,
105,
151,
74,
12,
150,
119,
126,
101,
185,
241,
9,
197,
110,
198,
132,
24,
240,
125,
236,
58,
220,
77,
32,
121,
238,
95,
62,
215,
203,
57,
72
]), on = new Uint32Array([
462357,
472066609,
943670861,
1415275113,
1886879365,
2358483617,
2830087869,
3301692121,
3773296373,
4228057617,
404694573,
876298825,
1347903077,
1819507329,
2291111581,
2762715833,
3234320085,
3705924337,
4177462797,
337322537,
808926789,
1280531041,
1752135293,
2223739545,
2695343797,
3166948049,
3638552301,
4110090761,
269950501,
741554753,
1213159005,
1684763257
]);
function st(e) {
return (sn[e >>> 24 & 255] & 255) << 24 | (sn[e >>> 16 & 255] & 255) << 16 | (sn[e >>> 8 & 255] & 255) << 8 | sn[e & 255] & 255;
}
function Ht(e, t, n) {
let r = 0, s = 0, o = 0, i = 0, a = 0, l = 0, c = 0, _ = 0;
a = e[0] & 255, l = e[1] & 255, c = e[2] & 255, _ = e[3] & 255, r = a << 24 | l << 16 | c << 8 | _, a = e[4] & 255, l = e[5] & 255, c = e[6] & 255, _ = e[7] & 255, s = a << 24 | l << 16 | c << 8 | _, a = e[8] & 255, l = e[9] & 255, c = e[10] & 255, _ = e[11] & 255, o = a << 24 | l << 16 | c << 8 | _, a = e[12] & 255, l = e[13] & 255, c = e[14] & 255, _ = e[15] & 255, i = a << 24 | l << 16 | c << 8 | _;
for (let m = 0; m < 32; m += 4)
a = s ^ o ^ i ^ n[m], a = st(a), r ^= a ^ (a << 2 | a >>> 30) ^ (a << 10 | a >>> 22) ^ (a << 18 | a >>> 14) ^ (a << 24 | a >>> 8), l = o ^ i ^ r ^ n[m + 1], l = st(l), s ^= l ^ (l << 2 | l >>> 30) ^ (l << 10 | l >>> 22) ^ (l << 18 | l >>> 14) ^ (l << 24 | l >>> 8), c = i ^ r ^ s ^ n[m + 2], c = st(c), o ^= c ^ (c << 2 | c >>> 30) ^ (c << 10 | c >>> 22) ^ (c << 18 | c >>> 14) ^ (c << 24 | c >>> 8), _ = r ^ s ^ o ^ n[m + 3], _ = st(_), i ^= _ ^ (_ << 2 | _ >>> 30) ^ (_ << 10 | _ >>> 22) ^ (_ << 18 | _ >>> 14) ^ (_ << 24 | _ >>> 8);
t[0] = i >>> 24 & 255, t[1] = i >>> 16 & 255, t[2] = i >>> 8 & 255, t[3] = i & 255, t[4] = o >>> 24 & 255, t[5] = o >>> 16 & 255, t[6] = o >>> 8 & 255, t[7] = o & 255, t[8] = s >>> 24 & 255, t[9] = s >>> 16 & 255, t[10] = s >>> 8 & 255, t[11] = s & 255, t[12] = r >>> 24 & 255, t[13] = r >>> 16 & 255, t[14] = r >>> 8 & 255, t[15] = r & 255;
}
function Bo(e, t, n) {
let r = 0, s = 0, o = 0, i = 0, a = 0;
r = (e[0] & 255) << 24 | (e[1] & 255) << 16 | (e[2] & 255) << 8 | e[3] & 255, s = (e[4] & 255) << 24 | (e[5] & 255) << 16 | (e[6] & 255) << 8 | e[7] & 255, o = (e[8] & 255) << 24 | (e[9] & 255) << 16 | (e[10] & 255) << 8 | e[11] & 255, i = (e[12] & 255) << 24 | (e[13] & 255) << 16 | (e[14] & 255) << 8 | e[15] & 255, r ^= 2746333894, s ^= 1453994832, o ^= 1736282519, i ^= 2993693404;
for (let l = 0; l < 32; l += 4)
a = s ^ o ^ i ^ on[l + 0], a = st(a), r ^= a ^ (a << 13 | a >>> 19) ^ (a << 23 | a >>> 9), t[l + 0] = r, a = o ^ i ^ r ^ on[l + 1], a = st(a), s ^= a ^ (a << 13 | a >>> 19) ^ (a << 23 | a >>> 9), t[l + 1] = s, a = i ^ r ^ s ^ on[l + 2], a = st(a), o ^= a ^ (a << 13 | a >>> 19) ^ (a << 23 | a >>> 9), t[l + 2] = o, a = r ^ s ^ o ^ on[l + 3], a = st(a), i ^= a ^ (a << 13 | a >>> 19) ^ (a << 23 | a >>> 9), t[l + 3] = i;
if (n === Ne)
for (let l = 0; l < 16; l++)
[t[l], t[31 - l]] = [t[31 - l], t[l]];
}
function cs(e) {
for (let t = e.length - 1; t >= 0 && (e[t]++, e[t] === 0); t--)
;
}
function rl(e, t, n, r, s, o) {
function i() {
const E = new Uint32Array(Fo);
Bo(t, E, 1);
const p = new Uint8Array(16).fill(0), f = new Uint8Array(16);
Ht(p, f, E);
let b;
if (n.length === 12)
b = new Uint8Array(16), b.set(n, 0), b[15] = 1;
else {
const O = ns.create(f);
O.update(n);
const P = new Uint8Array(16), T = nr(P);
Hn(T, 8, BigInt(n.length * 8), !1), O.update(P), b = O.digest();
}
const v = new Uint8Array(b);
cs(v);
const w = new Uint8Array(16);
return Ht(b, w, E), { roundKey: E, h: f, j0: b, counter: v, tagMask: w };
}
function a(E, p) {
const f = r.length, b = p.length, v = ns.create(E);
f > 0 && v.update(r), v.update(p);
const w = new Uint8Array(16), O = nr(w);
return Hn(O, 0, BigInt(f * 8), !1), Hn(O, 8, BigInt(b * 8), !1), v.update(w), v.digest();
}
const { roundKey: l, h: c, counter: _, tagMask: m } = i();
if (s === Ne && o) {
const E = a(c, e);
for (let f = 0; f < 16; f++)
E[f] ^= m[f];
let p = 0;
for (let f = 0; f < 16; f++)
p |= E[f] ^ o[f];
if (p !== 0)
throw new Error("authentication tag mismatch");
}
const u = new Uint8Array(e.length);
let g = 0, y = e.length;
for (; y >= Se; ) {
const E = new Uint8Array(Se);
Ht(_, E, l);
for (let p = 0; p < Se && p < y; p++)
u[g + p] = e[g + p] ^ E[p];
cs(_), g += Se, y -= Se;
}
if (y > 0) {
const E = new Uint8Array(Se);
Ht(_, E, l);
for (let p = 0; p < y; p++)
u[g + p] = e[g + p] ^ E[p];
}
if (s !== Ne) {
const E = a(c, u);
for (let p = 0; p < 16; p++)
E[p] ^= m[p];
return { output: u, tag: E };
}
return { output: u };
}
var an = new Uint8Array(16);
function Pr(e, t, n, r = {}) {
let {
padding: s = "pkcs#7",
mode: o,
iv: i = new Uint8Array(16),
output: a,
associatedData: l,
outputTag: c,
tag: _
} = r;
if (o === "gcm") {
const p = typeof t == "string" ? me(t) : Uint8Array.from(t), f = typeof i == "string" ? me(i) : Uint8Array.from(i), b = l ? typeof l == "string" ? me(l) : Uint8Array.from(l) : new Uint8Array(0);
let v;
typeof e == "string" ? n !== Ne ? v = sr(e) : v = me(e) : v = Uint8Array.from(e);
const w = _ ? typeof _ == "string" ? me(_) : Uint8Array.from(_) : void 0, O = rl(v, p, f, b, n, w);
return a === "array" ? c && n !== Ne ? O : O.output : c && n !== Ne ? {
output: We(O.output),
tag: O.tag ? We(O.tag) : void 0
} : n !== Ne ? {
output: We(O.output),
tag: O.tag ? We(O.tag) : void 0
} : vn(O.output);
}
if (o === "cbc" && (typeof i == "string" && (i = me(i)), i.length !== 128 / 8))
throw new Error("iv is invalid");
if (typeof t == "string" && (t = me(t)), t.length !== 128 / 8)
throw new Error("key is invalid");
if (typeof e == "string" ? n !== Ne ? e = sr(e) : e = me(e) : e = Uint8Array.from(e), (s === "pkcs#5" || s === "pkcs#7") && n !== Ne) {
const p = Se - e.length % Se, f = new Uint8Array(e.length + p);
f.set(e, 0);
for (let b = 0; b < p; b++)
f[e.length + b] = p;
e = f;
}
const m = new Uint32Array(Fo);
Bo(t, m, n);
let u = new Uint8Array(e.length), g = i, y = e.length, E = 0;
for (; y >= Se; ) {
const p = e.subarray(E, E + 16);
if (o === "cbc")
for (let f = 0; f < Se; f++)
n !== Ne && (p[f] ^= g[f]);
Ht(p, an, m);
for (let f = 0; f < Se; f++)
o === "cbc" && n === Ne && (an[f] ^= g[f]), u[E + f] = an[f];
o === "cbc" && (n !== Ne ? g = an : g = p), y -= Se, E += Se;
}
if ((s === "pkcs#5" || s === "pkcs#7") && n === Ne) {
const p = u.length, f = u[p - 1];
for (let b = 1; b <= f; b++)
if (u[p - b] !== f)
throw new Error("padding is invalid");
u = u.slice(0, p - f);
}
return a !== "array" ? n !== Ne ? We(u) : vn(u) : u;
}
function sl(e, t, n = {}) {
return Pr(e, t, 1, n);
}
function ol(e, t, n = {}) {
return Pr(e, t, 0, n);
}
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
function tf() {
return So;
}
function nf(e, t) {
return nl(e, t);
}
function rf(e, t, n) {
return Cr.encrypt(e, t, n);
}
function sf(e, t, n) {
return Cr.encrypt(e, t, n);
}
function Vo(e, t) {
return e && /^\d+$/.test(e) && String(e).length <= 10 && (e = parseInt(`${e}000`)), t ? At(e, t) : At(e);
}
function of(e, t) {
return e ? (At.isDayjs(e) || (e = Vo(e)), e.format(t || "YYYY-MM-DD HH:mm")) : "";
}
function af(e) {
return e ? (At.isDayjs(e) || (e = Vo(e)), e.unix()) : "";
}
const Rr = {
STATE_CODE_SUCCESS: "SUCCESS",
// 成功
STATE_CODE_FAIL: "FAIL",
// 失败
STATE_CODE_NOT_FOUND: "NOT_FOUND",
// 找不到资源
STATE_CODE_INFO_NOT_COMPLETE: "INCOMPLETE",
// 信息不完整
STATE_CODE_NOT_ALLOWED: "NOT_ALLOWED"
//没有权限
};
function lf(e) {
Object.keys(e).forEach((t) => {
Rr[t] = e[t];
});
}
function cf(e) {
return e || (e = {}), e.loading = !0, {
/**
* get请求
* @param url
* @param {?Object} [config] - axios config
* @returns {Promise}
*/
get(t, n) {
return new Promise((r, s) => {
Zn.get(t, n).then((o) => {
r(o);
}).catch((o) => {
s(o);
}).finally(() => {
e.loading = !1;
});
});
},
/**
* post请求
* @param {string} url
* @param {?Object} [data]
* @param {?Object} [config] - axios config
* @returns {Promise}
*/
post(t, n, r) {
return new Promise((s, o) => {
Zn.post(t, n, r).then((i) => {
s(i);
}).catch((i) => {
o(i);
}).finally(() => {
e.loading = !1;
});
});
}
};
}
async function uf(e, t, n) {
if (e.finishedText = e.finishedText || "加载完毕", e.loading = !0, !e.uri)
return console.error("URI is required in pagination"), e;
let r = {};
try {
r = await Zn.get(e.uri, {
params: { ...e.params || {}, page: t || !e.page ? 1 : e.page + 1 }
});
} catch {
return e.loading = !1, e.finished = !1, e.error = !0, e;
}
if (r.status !== Rr.STATE_CODE_SUCCESS)
return e.loading = !1, e.error = !0, e.errorText = r.result, e;
let s;
n ? s = n(r) : s = r.result;
let o = s.data;
!t && e.items && (o = e.items.concat(o));
const i = s.current_page || s.current || s.page || 1, a = s.last_page || s.lastPage || s.pages || 0, l = s.total_size || s.totalSize || s.total || 0;
return e.loading = !1, e.error = !1, e.page = i, e.items = o, e.finished = a === 0 || a === i, e.empty = l === 0, e;
}
const { STATE_CODE_FAIL: il, STATE_CODE_INFO_NOT_COMPLETE: al, STATE_CODE_NOT_FOUND: ll, STATE_CODE_NOT_ALLOWED: cl, STATE_CODE_SUCCESS: us } = Rr;
function ff(e) {
var i;
const { url: t, csrfToken: n } = e;
let { method: r, data: s } = e;
r = r || "post", s = s || {};
const o = document.createElement("form");
if (o.action = t, o.method = r, o.target = "_blank", o.style.display = "none", Object.keys(s).forEach((a) => {
const l = document.createElement("input");
l.type = "hidden", l.name = a, l.value = s[a], o.appendChild(l);
}), !n) {
const a = document.createElement("input");
a.type = "hidden", a.name = "_token", a.value = (i = document.querySelector('meta[name="csrf-token"]')) == null ? void 0 : i.getAttribute("content"), o.appendChild(a);
}
return document.body.appendChild(o), o;
}
function ul(e, t) {
const { status: n } = e, r = e.result, s = {};
s.default = "请求失败, 请检查数据并重试", s[il] = "系统错误,请稍候再试", s[ll] = "请求的内容不存在", s[al] = "信息不完整", s[cl] = "没有权限";
const o = {
[us]: "success"
}, i = t[n] || t[o[n]] || s[n] || s.def;
qn(i) ? n === us ? mn.success(i) : mn.error(r || i) : Xn(i) && i();
}
function df(e, t) {
ul(e, { success: t });
}
function mf(e) {
e && e.errorFields ? e.errorFields.forEach((t) => {
mn.error(t.errors.join(" "));
}) : e && e.response || mn.error("请检查填写项");
}
const _f = {
commonLabelCol: { span: 8, xxl: 6 },
commonWrapperCol: { span: 12, xxl: 14 },
commonWrapperOffset: { xs: { offset: 8, span: 12 }, xxl: { offset: 6, span: 14 } },
commonLabelFullCol: { span: 8, xxl: 6 },
commonWrapperFullCol: { span: 16, xxl: 18 },
commonWrapperFullOffset: { xs: { offset: 8, span: 16 }, xxl: { offset: 6, span: 18 } },
commonLabelPartCol: { span: 4, xxl: 3 },
commonWrapperPartCol: { span: 20, xxl: 21 },
commonWrapperPartOffset: { xs: { offset: 4, span: 20 }, xxl: { offset: 3, span: 21 } }
};
function hf(e, t) {
const n = Ni(e);
t = t || {};
const r = (s) => {
var o, i;
for (let a in s) {
let l;
if (At.isDayjs(s[a]) ? l = s[a] : Object.prototype.toString.call(s[a]) === "[object Date]" && (l = At(s[a])), l && t.date) {
qn(t.date) ? s[a] = l.format(t.date) : Xn(t.date) ? s[a] = t.date(l) : s[a] = s[a].unix();
continue;
}
if (Ti(s[a]) && t.boolean) {
t.boolean === !0 ? s[a] = s[a] ? 1 : 0 : Array.isArray(t.boolean) && (s[a] = s[a] ? ((o = t.boolean) == null ? void 0 : o[0]) || 1 : ((i = t.boolean) == null ? void 0 : i[1]) || 0);
continue;
}
if (t.attachment) {
const c = t.attachment;
if (Gr(s[a]) && s[a]._type === "file" && qn(c) && !js(s[a][c])) {
s[a] = s[a][c];
continue;
} else if (Gr(s[a]) && s[a]._type === "file" && Xn(c)) {
s[a] = c(s[a]);
continue;
}
}
qs(s[a]) && (s[a] = r(s[a]));
}
return s;
};
return r(n);
}
function gf(e, t) {
if (!t)
return "";
const n = t.find((r) => r.value === e);
return n ? n.label : "";
}
function Ef(e, t, n) {
n = n || {
value: "value",
label: "label",
children: "children"
};
const r = [];
function s(o) {
var i;
t.includes(o[n.value]) && r.push(o[n.label]), (i = o[n.children]) != null && i.length && o[n.children].forEach((a) => {
s(a);
});
}
return e.forEach((o) => {
s(o);
}), r;
}
function fl(e, t, n) {
n = n || {
value: "value",
label: "label",
children: "children"
};
for (let r of e) {
if (r[n.value] === t)
return r;
if (r[n.children] && r[n.children].length) {
const s = fl(r[n.children], t, n);
if (s)
return s;
}
}
return null;
}
function pf(e, t, n) {
n = n || {
value: "value",
label: "label",
children: "children"
};
const r = [];
return Oi(
t,
(s, o) => {
const i = Ii(s, { [n.value]: o });
if (i)
return r.push(i[n.label]), i[n.children];
},
e
), r;
}
function bf(e, t, n) {
n = n || {
value: "value",
label: "label",
children: "children"
};
const r = [];
function s(o, i, a) {
for (const l of o)
if (l[n.value] === i) {
a.unshift(l[n.label]);
break;
} else if (l[n.children] && s(l[n.children], i, a).length > 0) {
a.unshift(l[n.label]);
break;
}
return a;
}
return s(e, t, r);
}
function yf(e, t, n) {
n = n || {
value: "value",
label: "label",
children: "children"
};
const r = [];
function s(o, i, a) {
for (const l of o)
if (l[n.value] === i) {
a.unshift(l[n.value]);
break;
} else if (l[n.children] && s(l[n.children], i, a).length > 0) {
a.unshift(l[n.value]);
break;
}
return a;
}
return s(e, t, r);
}
function dl(e, t, n) {
return Ai(e, (r, s) => s === t ? r : s === n ? dl(r, t, n) : []);
}
const fn = {}, ml = {
setItem(e, t) {
fn[e] = t;
},
getItem(e) {
return fn[e];
},
removeItem(e) {
delete fn[e];
}
};
window._printCache = () => {
console.log(JSON.parse(JSON.stringify(fn, null, 2)));
};
function wf(e, t) {
const n = t || ml, r = !!t;
return {
get(s) {
const o = n.getItem(e);
return Li(o) || js(o) ? s : r ? JSON.parse(o) : o;
},
set(s) {
n.setItem(e, r ? JSON.stringify(s) : s);
},
remove() {
n.removeItem(e);
}
};
}
function vf(e, t = 2) {
if (typeof e != "number" || isNaN(e))
return 0;
const n = Math.pow(10, t);
return Math.round(e * n) / n;
}
/*!
* shared v11.1.11
* (c) 2025 kazuya kawaguchi
* Released under the MIT License.
*/
function Ke(e, t) {
typeof console < "u" && (console.warn("[intlify] " + e), t && console.warn(t.stack));
}
const fs = {};
function Dr(e) {
fs[e] || (fs[e] = !0, Ke(e));
}
const Ve = typeof window < "u";
let Pe, Et;
if (process.env.NODE_ENV !== "production") {
const e = Ve && window.performance;
e && e.mark && e.measure && e.clearMarks && // @ts-ignore browser compat
e.clearMeasures && (Pe = (t) => {
e.mark(t);
}, Et = (t, n, r) => {
e.measure(t, n, r), e.clearMarks(n), e.clearMarks(r);
});
}
const _l = /\{([0-9a-zA-Z]+)\}/g;
function Cn(e, ...t) {
return t.length === 1 && j(t[0]) && (t = t[0]), (!t || !t.hasOwnProperty) && (t = {}), e.replace(_l, (n, r) => t.hasOwnProperty(r) ? t[r] : "");
}
const Ge = (e, t = !1) => t ? Symbol.for(e) : Symbol(e), hl = (e, t, n) => gl({ l: e, k: t, s: n }), gl = (e) => JSON.stringify(e).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029").replace(/\u0027/g, "\\u0027"), _e = (e) => typeof e == "number" && isFinite(e), El = (e) => kr(e) === "[object Date]", Pt = (e) => kr(e) === "[object RegExp]", Pn = (e) => K(e) && Object.keys(e).length === 0, be = Object.assign, pl = Object.create, Q = (e = null) => pl(e);
let ds;
const ht = () => ds || (ds = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : Q());
function ms(e) {
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'").replace(/\//g, "/").replace(/=/g, "=");
}
function _s(e) {
return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">");
}
function bl(e) {
return e = e.replace(/(\w+)\s*=\s*"([^"]*)"/g, (r, s, o) => `${s}="${_s(o)}"`), e = e.replace(/(\w+)\s*=\s*'([^']*)'/g, (r, s, o) => `${s}='${_s(o)}'`), /\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(e) && (process.env.NODE_ENV !== "production" && Ke("Potentially dangerous event handlers detected in translation. Consider removing onclick, onerror, etc. from your translation messages."), e = e.replace(/(\s+)(on)(\w+\s*=)/gi, "$1on$3")), [
// In href, src, action, formaction attributes
/(\s+(?:href|src|action|formaction)\s*=\s*["']?)\s*javascript:/gi,
// In style attributes within url()
/(style\s*=\s*["'][^"']*url\s*\(\s*)javascript:/gi
].forEach((r) => {
e = e.replace(r, "$1javascript:");
}), e;
}
const yl = Object.prototype.hasOwnProperty;
function Be(e, t) {
return yl.call(e, t);
}
const le = Array.isArray, z = (e) => typeof e == "function", D = (e) => typeof e == "string", q = (e) => typeof e == "boolean", j = (e) => e !== null && typeof e == "object", wl = (e) => j(e) && z(e.then) && z(e.catch), Ho = Object.prototype.toString, kr = (e) => Ho.call(e), K = (e) => kr(e) === "[object Object]", vl = (e) => e == null ? "" : le(e) || K(e) && e.toString === Ho ? JSON.stringify(e, null, 2) : String(e);
function Ur(e, t = "") {
return e.reduce((n, r, s) => s === 0 ? n + r : n + t + r, "");
}
const hs = 2;
function Nl(e, t = 0, n = e.length) {
const r = e.split(/\r?\n/);
let s = 0;
const o = [];
for (let i = 0; i < r.length; i++)
if (s += r[i].length + 1, s >= t) {
for (let a = i - hs; a <= i + hs || n > s; a++) {
if (a < 0 || a >= r.length)
continue;
const l = a + 1;
o.push(`${l}${" ".repeat(3 - String(l).length)}| ${r[a]}`);
const c = r[a].length;
if (a === i) {
const _ = t - (s - c) + 1, m = Math.max(1, n > s ? c - _ : n - t);
o.push(" | " + " ".repeat(_) + "^".repeat(m));
} else if (a > i) {
if (n > s) {
const _ = Math.max(Math.min(n - s, c), 1);
o.push(" | " + "^".repeat(_));
}
s += c + 1;
}
}
break;
}
return o.join(`
`);
}
function xr() {
const e = /* @__PURE__ */ new Map();
return {
events: e,
on(n, r) {
const s = e.get(n);
s && s.push(r) || e.set(n, [r]);
},
off(n, r) {
const s = e.get(n);
s && s.splice(s.indexOf(r) >>> 0, 1);
},
emit(n, r) {
(e.get(n) || []).slice().map((s) => s(r)), (e.get("*") || []).slice().map((s) => s(n, r));
}
};
}
const ln = (e) => !j(e) || le(e);
function dn(e, t) {
if (ln(e) || ln(t))
throw new Error("Invalid value");
const n = [{ src: e, des: t }];
for (; n.length; ) {
const { src: r, des: s } = n.pop();
Object.keys(r).forEach((o) => {
o !== "__proto__" && (j(r[o]) && !j(s[o]) && (s[o] = Array.isArray(r[o]) ? [] : Q()), ln(s[o]) || ln(r[o]) ? s[o] = r[o] : n.push({ src: r[o], des: s[o] }));
});
}
}
/*!
* message-compiler v11.1.11
* (c) 2025 kazuya kawaguchi
* Released under the MIT License.
*/
function Tl(e, t, n) {
return { line: e, column: t, offset: n };
}
function or(e, t, n) {
return { start: e, end: t };
}
const W = {
// tokenizer error codes
EXPECTED_TOKEN: 1,
INVALID_TOKEN_IN_PLACEHOLDER: 2,
UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER: 3,
UNKNOWN_ESCAPE_SEQUENCE: 4,
INVALID_UNICODE_ESCAPE_SEQUENCE: 5,
UNBALANCED_CLOSING_BRACE: 6,
UNTERMINATED_CLOSING_BRACE: 7,
EMPTY_PLACEHOLDER: 8,
NOT_ALLOW_NEST_PLACEHOLDER: 9,
INVALID_LINKED_FORMAT: 10,
// parser error codes
MUST_HAVE_MESSAGES_IN_PLURAL: 11,
UNEXPECTED_EMPTY_LINKED_MODIFIER: 12,
UNEXPECTED_EMPTY_LINKED_KEY: 13,
UNEXPECTED_LEXICAL_ANALYSIS: 14,
// generator error codes
UNHANDLED_CODEGEN_NODE_TYPE: 15,
// minifier error codes
UNHANDLED_MINIFIER_NODE_TYPE: 16
}, Ll = 17, Ol = {
// tokenizer error messages
[W.EXPECTED_TOKEN]: "Expected token: '{0}'",
[W.INVALID_TOKEN_IN_PLACEHOLDER]: "Invalid token in placeholder: '{0}'",
[W.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]: "Unterminated single quote in placeholder",
[W.UNKNOWN_ESCAPE_SEQUENCE]: "Unknown escape sequence: \\{0}",
[W.INVALID_UNICODE_ESCAPE_SEQUENCE]: "Invalid unicode escape sequence: {0}",
[W.UNBALANCED_CLOSING_BRACE]: "Unbalanced closing brace",
[W.UNTERMINATED_CLOSING_BRACE]: "Unterminated closing brace",
[W.EMPTY_PLACEHOLDER]: "Empty placeholder",
[W.NOT_ALLOW_NEST_PLACEHOLDER]: "Not allowed nest placeholder",
[W.INVALID_LINKED_FORMAT]: "Invalid linked format",
// parser error messages
[W.MUST_HAVE_MESSAGES_IN_PLURAL]: "Plural must have messages",
[W.UNEXPECTED_EMPTY_LINKED_MODIFIER]: "Unexpected empty linked modifier",
[W.UNEXPECTED_EMPTY_LINKED_KEY]: "Unexpected empty linked key",
[W.UNEXPECTED_LEXICAL_ANALYSIS]: "Unexpected lexical analysis in token: '{0}'",
// generator error messages
[W.UNHANDLED_CODEGEN_NODE_TYPE]: "unhandled codegen node type: '{0}'",
// minimizer error messages
[W.UNHANDLED_MINIFIER_NODE_TYPE]: "unhandled mimifier node type: '{0}'"
};
function Ut(e, t, n = {}) {
const { domain: r, messages: s, args: o } = n, i = process.env.NODE_ENV !== "production" ? Cn((s || Ol)[e] || "", ...o || []) : e, a = new SyntaxError(String(i));
return a.code = e, t && (a.location = t), a.domain = r, a;
}
function Il(e) {
throw e;
}
const Al = /<\/?[\w\s="/.':;#-\/]+>/, Sl = (e) => Al.test(e), qe = " ", Cl = "\r", we = `
`, Pl = "\u2028", Rl = "\u2029";
function Dl(e) {
const t = e;
let n = 0, r = 1, s = 1, o = 0;
const i = (T) => t[T] === Cl && t[T + 1] === we, a = (T) => t[T] === we, l = (T) => t[T] === Rl, c = (T) => t[T] === Pl, _ = (T) => i(T) || a(T) || l(T) || c(T), m = () => n, u = () => r, g = () => s, y = () => o, E = (T) => i(T) || l(T) || c(T) ? we : t[T], p = () => E(n), f = () => E(n + o);
function b() {
return o = 0, _(n) && (r++, s = 0), i(n) && n++, n++, s++, t[n];
}
function v() {
return i(n + o) && o++, o++, t[n + o];
}
function w() {
n = 0, r = 1, s = 1, o = 0;
}
function O(T = 0) {
o = T;
}
function P() {
const T = n + o;
for (; T !== n; )
b();
o = 0;
}
return {
index: m,
line: u,
column: g,
peekOffset: y,
charAt: E,
currentChar: p,
currentPeek: f,
next: b,
peek: v,
reset: w,
resetPeek: O,
skipToPeek: P
};
}
const rt = void 0, kl = ".", gs = "'", Ul = "tokenizer";
function xl(e, t = {}) {
const n = t.location !== !1, r = Dl(e), s = () => r.index(), o = () => Tl(r.line(), r.column(), r.index()), i = o(), a = s(), l = {
currentType: 13,
offset: a,
startLoc: i,
endLoc: i,
lastType: 13,
lastOffset: a,
lastStartLoc: i,
lastEndLoc: i,
braceNest: 0,
inLinked: !1,
text: ""
}, c = () => l, { onError: _ } = t;
function m(d, h, A, ...M) {
const ce = c();
if (h.column += A, h.offset += A, _) {
const ue = n ? or(ce.startLoc, h) : null, X = Ut(d, ue, {
domain: Ul,
args: M
});
_(X);
}
}
function u(d, h, A) {
d.endLoc = o(), d.currentType = h;
const M = { type: h };
return n && (M.loc = or(d.startLoc, d.endLoc)), A != null && (M.value = A), M;
}
const g = (d) => u(
d,
13
/* TokenTypes.EOF */
);
function y(d, h) {
return d.currentChar() === h ? (d.next(), h) : (m(W.EXPECTED_TOKEN, o(), 0, h), "");
}
function E(d) {
let h = "";
for (; d.currentPeek() === qe || d.currentPeek() === we; )
h += d.currentPeek(), d.peek();
return h;
}
function p(d) {
const h = E(d);
return d.skipToPeek(), h;
}
function f(d) {
if (d === rt)
return !1;
const h = d.charCodeAt(0);
return h >= 97 && h <= 122 || // a-z
h >= 65 && h <= 90 || // A-Z
h === 95;
}
function b(d) {
if (d === rt)
return !1;
const h = d.charCodeAt(0);
return h >= 48 && h <= 57;
}
function v(d, h) {
const { currentType: A } = h;
if (A !== 2)
return !1;
E(d);
const M = f(d.currentPeek());
return d.resetPeek(), M;
}
function w(d, h) {
const { currentType: A } = h;
if (A !== 2)
return !1;
E(d);
const M = d.currentPeek() === "-" ? d.peek() : d.currentPeek(), ce = b(M);
return d.resetPeek(), ce;
}
function O(d, h) {
const { currentType: A } = h;
if (A !== 2)
return !1;
E(d);
const M = d.currentPeek() === gs;
return d.resetPeek(), M;
}
function P(d, h) {
const { currentType: A } = h;
if (A !== 7)
return !1;
E(d);
const M = d.currentPeek() === ".";
return d.resetPeek(), M;
}
function T(d, h) {
const { currentType: A } = h;
if (A !== 8)
return !1;
E(d);
const M = f(d.currentPeek());
return d.resetPeek(), M;
}
function $(d, h) {
const { currentType: A } = h;
if (!(A === 7 || A === 11))
return !1;
E(d);
const M = d.currentPeek() === ":";
return d.resetPeek(), M;
}
function k(d, h) {
const { currentType: A } = h;
if (A !== 9)
return !1;
const M = () => {
const ue = d.currentPeek();
return ue === "{" ? f(d.peek()) : ue === "@" || ue === "|" || ue === ":" || ue === "." || ue === qe || !ue ? !1 : ue === we ? (d.peek(), M()) : ge(d, !1);
}, ce = M();
return d.resetPeek(), ce;
}
function se(d) {
E(d);
const h = d.currentPeek() === "|";
return d.resetPeek(), h;
}
function ge(d, h = !0) {
const A = (ce = !1, ue = "") => {
const X = d.currentPeek();
return X === "{" || X === "@" || !X ? ce : X === "|" ? !(ue === qe || ue === we) : X === qe ? (d.peek(), A(!0, qe)) : X === we ? (d.peek(), A(!0, we)) : !0;
}, M = A();
return h && d.resetPeek(), M;
}
function F(d, h) {
const A = d.currentChar();
return A === rt ? rt : h(A) ? (d.next(), A) : null;
}
function S(d) {
const h = d.charCodeAt(0);
return h >= 97 && h <= 122 || // a-z
h >= 65 && h <= 90 || // A-Z
h >= 48 && h <= 57 || // 0-9
h === 95 || // _
h === 36;
}
function I(d) {
return F(d, S);
}
function L(d) {
const h = d.charCodeAt(0);
return h >= 97 && h <= 122 || // a-z
h >= 65 && h <= 90 || // A-Z
h >= 48 && h <= 57 || // 0-9
h === 95 || // _
h === 36 || // $
h === 45;
}
function R(d) {
return F(d, L);
}
function x(d) {
const h = d.charCodeAt(0);
return h >= 48 && h <= 57;
}
function V(d) {
return F(d, x);
}
function B(d) {
const h = d.charCodeAt(0);
return h >= 48 && h <= 57 || // 0-9
h >= 65 && h <= 70 || // A-F
h >= 97 && h <= 102;
}
function U(d) {
return F(d, B);
}
function H(d) {
let h = "", A = "";
for (; h = V(d); )
A += h;
return A;
}
function Y(d) {
let h = "";
for (; ; ) {
const A = d.currentChar();
if (A === "{" || A === "}" || A === "@" || A === "|" || !A)
break;
if (A === qe || A === we)
if (ge(d))
h += A, d.next();
else {
if (se(d))
break;
h += A, d.next();
}
else
h += A, d.next();
}
return h;
}
function oe(d) {
p(d);
let h = "", A = "";
for (; h = R(d); )
A += h;
return d.currentChar() === rt && m(W.UNTERMINATED_CLOSING_BRACE, o(), 0), A;
}
function J(d) {
p(d);
let h = "";
return d.currentChar() === "-" ? (d.next(), h += `-${H(d)}`) : h += H(d), d.currentChar() === rt && m(W.UNTERMINATED_CLOSING_BRACE, o(), 0), h;
}
function G(d) {
return d !== gs && d !== we;
}
function ne(d) {
p(d), y(d, "'");
let h = "", A = "";
for (; h = F(d, G); )
h === "\\" ? A += ie(d) : A += h;
const M = d.currentChar();
return M === we || M === rt ? (m(W.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER, o(), 0), M === we && (d.next(), y(d, "'")), A) : (y(d, "'"), A);
}
function ie(d) {
const h = d.currentChar();
switch (h) {
case "\\":
case "'":
return d.next(), `\\${h}`;
case "u":
return Ee(d, h, 4);
case "U":
return Ee(d, h, 6);
default:
return m(W.UNKNOWN_ESCAPE_SEQUENCE, o(), 0, h), "";
}
}
function Ee(d, h, A) {
y(d, h);
let M = "";
for (let ce = 0; ce < A; ce++) {
const ue = U(d);
if (!ue) {
m(W.INVALID_UNICODE_ESCAPE_SEQUENCE, o(), 0, `\\${h}${M}${d.currentChar()}`);
break;
}
M += ue;
}
return `\\${h}${M}`;
}
function ee(d) {
return d !== "{" && d !== "}" && d !== qe && d !== we;
}
function de(d) {
p(d);
let h = "", A = "";
for (; h = F(d, ee); )
A += h;
return A;
}
function et(d) {
let h = "", A = "";
for (; h = I(d); )
A += h;
return A;
}
function yt(d) {
const h = (A) => {
const M = d.currentChar();
return M === "{" || M === "@" || M === "|" || M === "(" || M === ")" || !M || M === qe ? A : (A += M, d.next(), h(A));
};
return h("");
}
function tt(d) {
p(d);
const h = y(
d,
"|"
/* TokenChars.Pipe */
);
return p(d), h;
}
function xt(d, h) {
let A = null;
switch (d.currentChar()) {
case "{":
return h.braceNest >= 1 && m(W.NOT_ALLOW_NEST_PLACEHOLDER, o(), 0), d.next(), A = u(
h,
2,
"{"
/* TokenChars.BraceLeft */
), p(d), h.braceNest++, A;
case "}":
return h.braceNest > 0 && h.currentType === 2 && m(W.EMPTY_PLACEHOLDER, o(), 0), d.next(), A = u(
h,
3,
"}"
/* TokenChars.BraceRight */
), h.braceNest--, h.braceNest > 0 && p(d), h.inLinked && h.braceNest === 0 && (h.inLinked = !1), A;
case "@":
return h.braceNest > 0 && m(W.UNTERMINATED_CLOSING_BRACE, o(), 0), A = lt(d, h) || g(h), h.braceNest = 0, A;
default: {
let ce = !0, ue = !0, X = !0;
if (se(d))
return h.braceNest > 0 && m(W.UNTERMINATED_CLOSING_BRACE, o(), 0), A = u(h, 1, tt(d)), h.braceNest = 0, h.inLinked = !1, A;
if (h.braceNest > 0 && (h.currentType === 4 || h.currentType === 5 || h.currentType === 6))
return m(W.UNTERMINATED_CLOSING_BRACE, o(), 0), h.braceNest = 0, Mt(d, h);
if (ce = v(d, h))
return A = u(h, 4, oe(d)), p(d), A;
if (ue = w(d, h))
return A = u(h, 5, J(d)), p(d), A;
if (X = O(d, h))
return A = u(h, 6, ne(d)), p(d), A;
if (!ce && !ue && !X)
return A = u(h, 12, de(d)), m(W.INVALID_TOKEN_IN_PLACEHOLDER, o(), 0, A.value), p(d), A;
break;
}
}
return A;
}
function lt(d, h) {
const { currentType: A } = h;
let M = null;
const ce = d.currentChar();
switch ((A === 7 || A === 8 || A === 11 || A === 9) && (ce === we || ce === qe) && m(W.INVALID_LINKED_FORMAT, o(), 0), ce) {
case "@":
return d.next(), M = u(
h,
7,
"@"
/* TokenChars.LinkedAlias */
), h.inLinked = !0, M;
case ".":
return p(d), d.next(), u(
h,
8,
"."
/* TokenChars.LinkedDot */
);
case ":":
return p(d), d.next(), u(
h,
9,
":"
/* TokenChars.LinkedDelimiter */
);
default:
return se(d) ? (M = u(h, 1, tt(d)), h.braceNest = 0, h.inLinked = !1, M) : P(d, h) || $(d, h) ? (p(d), lt(d, h)) : T(d, h) ? (p(d), u(h, 11, et(d))) : k(d, h) ? (p(d), ce === "{" ? xt(d, h) || M : u(h, 10, yt(d))) : (A === 7 && m(W.INVALID_LINKED_FORMAT, o(), 0), h.braceNest = 0, h.inLinked = !1, Mt(d, h));
}
}
function Mt(d, h) {
let A = {
type: 13
/* TokenTypes.EOF */
};
if (h.braceNest > 0)
return xt(d, h) || g(h);
if (h.inLinked)
return lt(d, h) || g(h);
switch (d.currentChar()) {
case "{":
return xt(d, h) || g(h);
case "}":
return m(W.UNBALANCED_CLOSING_BRACE, o(), 0), d.next(), u(
h,
3,
"}"
/* TokenChars.BraceRight */
);
case "@":
return lt(d, h) || g(h);
default: {
if (se(d))
return A = u(h, 1, tt(d)), h.braceNest = 0, h.inLinked = !1, A;
if (ge(d))
return u(h, 0, Y(d));
break;
}
}
return A;
}
function kn() {
const { currentType: d, offset: h, startLoc: A, endLoc: M } = l;
return l.lastType = d, l.lastOffset = h, l.lastStartLoc = A, l.lastEndLoc = M, l.offset = s(), l.startLoc = o(), r.currentChar() === rt ? u(
l,
13
/* TokenTypes.EOF */
) : Mt(r, l);
}
return {
nextToken: kn,
currentOffset: s,
currentPosition: o,
context: c
};
}
const Ml = "parser", Fl = /(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;
function Bl(e, t, n) {
switch (e) {
case "\\\\":
return "\\";
// eslint-disable-next-line no-useless-escape
case "\\'":
return "'";
default: {
const r = parseInt(t || n, 16);
return r <= 55295 || r >= 57344 ? String.fromCodePoint(r) : "�";
}
}
}
function Vl(e = {}) {
const t = e.location !== !1, { onError: n } = e;
function r(f, b, v, w, ...O) {
const P = f.currentPosition();
if (P.offset += w, P.column += w, n) {
const T = t ? or(v, P) : null, $ = Ut(b, T, {
domain: Ml,
args: O
});
n($);
}
}
function s(f, b, v) {
const w = { type: f };
return t && (w.start = b, w.end = b, w.loc = { start: v, end: v }), w;
}
function o(f, b, v, w) {
t && (f.end = b, f.loc && (f.loc.end = v));
}
function i(f, b) {
const v = f.context(), w = s(3, v.offset, v.startLoc);
return w.value = b, o(w, f.currentOffset(), f.currentPosition()), w;
}
function a(f, b) {
const v = f.context(), { lastOffset: w, lastStartLoc: O } = v, P = s(5, w, O);
return P.index = parseInt(b, 10), f.nextToken(), o(P, f.currentOffset(), f.currentPosition()), P;
}
function l(f, b) {
const v = f.context(), { lastOffset: w, lastStartLoc: O } = v, P = s(4, w, O);
return P.key = b, f.nextToken(), o(P, f.currentOffset(), f.currentPosition()), P;
}
function c(f, b) {
const v = f.context(), { lastOffset: w, lastStartLoc: O } = v, P = s(9, w, O);
return P.value = b.replace(Fl, Bl), f.nextToken(), o(P, f.currentOffset(), f.currentPosition()), P;
}
function _(f) {
const b = f.nextToken(), v = f.context(), { lastOffset: w, lastStartLoc: O } = v, P = s(8, w, O);
return b.type !== 11 ? (r(f, W.UNEXPECTED_EMPTY_LINKED_MODIFIER, v.lastStartLoc, 0), P.value = "", o(P, w, O), {
nextConsumeToken: b,
node: P
}) : (b.value == null && r(f, W.UNEXPECTED_LEXICAL_ANALYSIS, v.lastStartLoc, 0, He(b)), P.value = b.value || "", o(P, f.currentOffset(), f.currentPosition()), {
node: P
});
}
function m(f, b) {
const v = f.context(), w = s(7, v.offset, v.startLoc);
return w.value = b, o(w, f.currentOffset(), f.currentPosition()), w;
}
function u(f) {
const b = f.context(), v = s(6, b.offset, b.startLoc);
let w = f.nextToken();
if (w.type === 8) {
const O = _(f);
v.modifier = O.node, w = O.nextConsumeToken || f.nextToken();
}
switch (w.type !== 9 && r(f, W.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, He(w)), w = f.nextToken(), w.type === 2 && (w = f.nextToken()), w.type) {
case 10:
w.value == null && r(f, W.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, He(w)), v.key = m(f, w.value || "");
break;
case 4:
w.value == null && r(f, W.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, He(w)), v.key = l(f, w.value || "");
break;
case 5:
w.value == null && r(f, W.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, He(w)), v.key = a(f, w.value || "");
break;
case 6:
w.value == null && r(f, W.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, He(w)), v.key = c(f, w.value || "");
break;
default: {
r(f, W.UNEXPECTED_EMPTY_LINKED_KEY, b.lastStartLoc, 0);
const O = f.context(), P = s(7, O.offset, O.startLoc);
return P.value = "", o(P, O.offset, O.startLoc), v.key = P, o(v, O.offset, O.startLoc), {
nextConsumeToken: w,
node: v
};
}
}
return o(v, f.currentOffset(), f.currentPosition()), {
node: v
};
}
function g(f) {
const b = f.context(), v = b.currentType === 1 ? f.currentOffset() : b.offset, w = b.currentType === 1 ? b.endLoc : b.startLoc, O = s(2, v, w);
O.items = [];
let P = null;
do {
const k = P || f.nextToken();
switch (P = null, k.type) {
case 0:
k.value == null && r(f, W.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, He(k)), O.items.push(i(f, k.value || ""));
break;
case 5:
k.value == null && r(f, W.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, He(k)), O.items.push(a(f, k.value || ""));
break;
case 4:
k.value == null && r(f, W.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, He(k)), O.items.push(l(f, k.value || ""));
break;
case 6:
k.value == null && r(f, W.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, He(k)), O.items.push(c(f, k.value || ""));
break;
case 7: {
const se = u(f);
O.items.push(se.node), P = se.nextConsumeToken || null;
break;
}
}
} while (b.currentType !== 13 && b.currentType !== 1);
const T = b.currentType === 1 ? b.lastOffset : f.currentOffset(), $ = b.currentType === 1 ? b.lastEndLoc : f.currentPosition();
return o(O, T, $), O;
}
function y(f, b, v, w) {
const O = f.context();
let P = w.items.length === 0;
const T = s(1, b, v);
T.cases = [], T.cases.push(w);
do {
const $ = g(f);
P || (P = $.items.length === 0), T.cases.push($);
} while (O.currentType !== 13);
return P && r(f, W.MUST_HAVE_MESSAGES_IN_PLURAL, v, 0), o(T, f.currentOffset(), f.currentPosition()), T;
}
function E(f) {
const b = f.context(), { offset: v, startLoc: w } = b, O = g(f);
return b.currentType === 13 ? O : y(f, v, w, O);
}
function p(f) {
const b = xl(f, be({}, e)), v = b.context(), w = s(0, v.offset, v.startLoc);
return t && w.loc && (w.loc.source = f), w.body = E(b), e.onCacheKey && (w.cacheKey = e.onCacheKey(f)), v.currentType !== 13 && r(b, W.UNEXPECTED_LEXICAL_ANALYSIS, v.lastStartLoc, 0, f[v.offset] || ""), o(w, b.currentOffset(), b.currentPosition()), w;
}
return { parse: p };
}
function He(e) {
if (e.type === 13)
return "EOF";
const t = (e.value || "").replace(/\r?\n/gu, "\\n");
return t.length > 10 ? t.slice(0, 9) + "…" : t;
}
function Hl(e, t = {}) {
const n = {
ast: e,
helpers: /* @__PURE__ */ new Set()
};
return { context: () => n, helper: (o) => (n.helpers.add(o), o) };
}
function Es(e, t) {
for (let n = 0; n < e.length; n++)
Mr(e[n], t);
}
function Mr(e, t) {
switch (e.type) {
case 1:
Es(e.cases, t), t.helper(
"plural"
/* HelperNameMap.PLURAL */
);
break;
case 2:
Es(e.items, t);
break;
case 6: {
Mr(e.key, t), t.helper(
"linked"
/* HelperNameMap.LINKED */
), t.helper(
"type"
/* HelperNameMap.TYPE */
);
break;
}
case 5:
t.helper(
"interpolate"
/* HelperNameMap.INTERPOLATE */
), t.helper(
"list"
/* HelperNameMap.LIST */
);
break;
case 4:
t.helper(
"interpolate"
/* HelperNameMap.INTERPOLATE */
), t.helper(
"named"
/* HelperNameMap.NAMED */
);
break;
}
}
function $l(e, t = {}) {
const n = Hl(e);
n.helper(
"normalize"
/* HelperNameMap.NORMALIZE */
), e.body && Mr(e.body, n);
const r = n.context();
e.helpers = Array.from(r.helpers);
}
function Wl(e) {
const t = e.body;
return t.type === 2 ? ps(t) : t.cases.forEach((n) => ps(n)), e;
}
function ps(e) {
if (e.items.length === 1) {
const t = e.items[0];
(t.type === 3 || t.type === 9) && (e.static = t.value, delete t.value);
} else {
const t = [];
for (let n = 0; n < e.items.length; n++) {
const r = e.items[n];
if (!(r.type === 3 || r.type === 9) || r.value == null)
break;
t.push(r.value);
}
if (t.length === e.items.length) {
e.static = Ur(t);
for (let n = 0; n < e.items.length; n++) {
const r = e.items[n];
(r.type === 3 || r.type === 9) && delete r.value;
}
}
}
}
const Yl = "minifier";
function Tt(e) {
switch (e.t = e.type, e.type) {
case 0: {
const t = e;
Tt(t.body), t.b = t.body, delete t.body;
break;
}
case 1: {
const t = e, n = t.cases;
for (let r = 0; r < n.length; r++)
Tt(n[r]);
t.c = n, delete t.cases;
break;
}
case 2: {
const t = e, n = t.items;
for (let r = 0; r < n.length; r++)
Tt(n[r]);
t.i = n, delete t.items, t.static && (t.s = t.static, delete t.static);
break;
}
case 3:
case 9:
case 8:
case 7: {
const t = e;
t.value && (t.v = t.value, delete t.value);
break;
}
case 6: {
const t = e;
Tt(t.key), t.k = t.key, delete t.key, t.modifier && (Tt(t.modifier), t.m = t.modifier, delete t.modifier);
break;
}
case 5: {
const t = e;
t.i = t.index, delete t.index;
break;
}
case 4: {
const t = e;
t.k = t.key, delete t.key;
break;
}
default:
if (process.env.NODE_ENV !== "production")
throw Ut(W.UNHANDLED_MINIFIER_NODE_TYPE, null, {
domain: Yl,
args: [e.type]
});
}
delete e.type;
}
const Kl = "parser";
function Gl(e, t) {
const { filename: n, breakLineCode: r, needIndent: s } = t, o = t.location !== !1, i = {
filename: n,
code: "",
column: 1,
line: 1,
offset: 0,
map: void 0,
breakLineCode: r,
needIndent: s,
indentLevel: 0
};
o && e.loc && (i.source = e.loc.source);
const a = () => i;
function l(E, p) {
i.code += E;
}
function c(E, p = !0) {
const f = p ? r : "";
l(s ? f + " ".repeat(E) : f);
}
function _(E = !0) {
const p = ++i.indentLevel;
E && c(p);
}
function m(E = !0) {
const p = --i.indentLevel;
E && c(p);
}
function u() {
c(i.indentLevel);
}
return {
context: a,
push: l,
indent: _,
deindent: m,
newline: u,
helper: (E) => `_${E}`,
needIndent: () => i.needIndent
};
}
function jl(e, t) {
const { helper: n } = e;
e.push(`${n(
"linked"
/* HelperNameMap.LINKED */
)}(`), Rt(e, t.key), t.modifier ? (e.push(", "), Rt(e, t.modifier), e.push(", _type")) : e.push(", undefined, _type"), e.push(")");
}
function ql(e, t) {
const { helper: n, needIndent: r } = e;
e.push(`${n(
"normalize"
/* HelperNameMap.NORMALIZE */
)}([`), e.indent(r());
const s = t.items.length;
for (let o = 0; o < s && (Rt(e, t.items[o]), o !== s - 1); o++)
e.push(", ");
e.deindent(r()), e.push("])");
}
function Xl(e, t) {
const { helper: n, needIndent: r } = e;
if (t.cases.length > 1) {
e.push(`${n(
"plural"
/* HelperNameMap.PLURAL */
)}([`), e.indent(r());
const s = t.cases.length;
for (let o = 0; o < s && (Rt(e, t.cases[o]), o !== s - 1); o++)
e.push(", ");
e.deindent(r()), e.push("])");
}
}
function Zl(e, t) {
t.body ? Rt(e, t.body) : e.push("null");
}
function Rt(e, t) {
const { helper: n } = e;
switch (t.type) {
case 0:
Zl(e, t);
break;
case 1:
Xl(e, t);
break;
case 2:
ql(e, t);
break;
case 6:
jl(e, t);
break;
case 8:
e.push(JSON.stringify(t.value), t);
break;
case 7:
e.push(JSON.stringify(t.value), t);
break;
case 5:
e.push(`${n(
"interpolate"
/* HelperNameMap.INTERPOLATE */
)}(${n(
"list"
/* HelperNameMap.LIST */
)}(${t.index}))`, t);
break;
case 4:
e.push(`${n(
"interpolate"
/* HelperNameMap.INTERPOLATE */
)}(${n(
"named"
/* HelperNameMap.NAMED */
)}(${JSON.stringify(t.key)}))`, t);
break;
case 9:
e.push(JSON.stringify(t.value), t);
break;
case 3:
e.push(JSON.stringify(t.value), t);
break;
default:
if (process.env.NODE_ENV !== "production")
throw Ut(W.UNHANDLED_CODEGEN_NODE_TYPE, null, {
domain: Kl,
args: [t.type]
});
}
}
const Jl = (e, t = {}) => {
const n = D(t.mode) ? t.mode : "normal", r = D(t.filename) ? t.filename : "message.intl";
t.sourceMap;
const s = t.breakLineCode != null ? t.breakLineCode : n === "arrow" ? ";" : `
`, o = t.needIndent ? t.needIndent : n !== "arrow", i = e.helpers || [], a = Gl(e, {
filename: r,
breakLineCode: s,
needIndent: o
});
a.push(n === "normal" ? "function __msg__ (ctx) {" : "(ctx) => {"), a.indent(o), i.length > 0 && (a.push(`const { ${Ur(i.map((_) => `${_}: _${_}`), ", ")} } = ctx`), a.newline()), a.push("return "), Rt(a, e), a.deindent(o), a.push("}"), delete e.helpers;
const { code: l, map: c } = a.context();
return {
ast: e,
code: l,
map: c ? c.toJSON() : void 0
// eslint-disable-line @typescript-eslint/no-explicit-any
};
};
function Ql(e, t = {}) {
const n = be({}, t), r = !!n.jit, s = !!n.minify, o = n.optimize == null ? !0 : n.optimize, a = Vl(n).parse(e);
return r ? (o && Wl(a), s && Tt(a), { ast: a, code: "" }) : ($l(a, n), Jl(a, n));
}
/*!
* core-base v11.1.11
* (c) 2025 kazuya kawaguchi
* Released under the MIT License.
*/
function zl() {
typeof __INTLIFY_PROD_DEVTOOLS__ != "boolean" && (ht().__INTLIFY_PROD_DEVTOOLS__ = !1), typeof __INTLIFY_DROP_MESSAGE_COMPILER__ != "boolean" && (ht().__INTLIFY_DROP_MESSAGE_COMPILER__ = !1);
}
function xe(e) {
return j(e) && Fr(e) === 0 && (Be(e, "b") || Be(e, "body"));
}
const $o = ["b", "body"];
function ec(e) {
return it(e, $o);
}
const Wo = ["c", "cases"];
function tc(e) {
return it(e, Wo, []);
}
const Yo = ["s", "static"];
function nc(e) {
return it(e, Yo);
}
const Ko = ["i", "items"];
function rc(e) {
return it(e, Ko, []);
}
const Go = ["t", "type"];
function Fr(e) {
return it(e, Go);
}
const jo = ["v", "value"];
function cn(e, t) {
const n = it(e, jo);
if (n != null)
return n;
throw jt(t);
}
const qo = ["m", "modifier"];
function sc(e) {
return it(e, qo);
}
const Xo = ["k", "key"];
function oc(e) {
const t = it(e, Xo);
if (t)
return t;
throw jt(
6
/* NodeTypes.Linked */
);
}
function it(e, t, n) {
for (let r = 0; r < t.length; r++) {
const s = t[r];
if (Be(e, s) && e[s] != null)
return e[s];
}
return n;
}
const Zo = [
...$o,
...Wo,
...Yo,
...Ko,
...Xo,
...qo,
...jo,
...Go
];
function jt(e) {
return new Error(`unhandled node type: ${e}`);
}
function Yn(e) {
return (n) => ic(n, e);
}
function ic(e, t) {
const n = ec(t);
if (n == null)
throw jt(
0
/* NodeTypes.Resource */
);
if (Fr(n) === 1) {
const o = tc(n);
return e.plural(o.reduce((i, a) => [
...i,
bs(e, a)
], []));
} else
return bs(e, n);
}
function bs(e, t) {
const n = nc(t);
if (n != null)
return e.type === "text" ? n : e.normalize([n]);
{
const r = rc(t).reduce((s, o) => [...s, ir(e, o)], []);
return e.normalize(r);
}
}
function ir(e, t) {
const n = Fr(t);
switch (n) {
case 3:
return cn(t, n);
case 9:
return cn(t, n);
case 4: {
const r = t;
if (Be(r, "k") && r.k)
return e.interpolate(e.named(r.k));
if (Be(r, "key") && r.key)
return e.interpolate(e.named(r.key));
throw jt(n);
}
case 5: {
const r = t;
if (Be(r, "i") && _e(r.i))
return e.interpolate(e.list(r.i));
if (Be(r, "index") && _e(r.index))
return e.interpolate(e.list(r.index));
throw jt(n);
}
case 6: {
const r = t, s = sc(r), o = oc(r);
return e.linked(ir(e, o), s ? ir(e, s) : void 0, e.type);
}
case 7:
return cn(t, n);
case 8:
return cn(t, n);
default:
throw new Error(`unhandled node on format message part: ${n}`);
}
}
const ac = "Detected HTML in '{source}' message. Recommend not using HTML messages to avoid XSS.";
function lc(e, t) {
t && Sl(e) && Ke(Cn(ac, { source: e }));
}
const cc = (e) => e;
let un = Q();
function uc(e, t = {}) {
let n = !1;
const r = t.onError || Il;
return t.onError = (s) => {
n = !0, r(s);
}, { ...Ql(e, t), detectError: n };
}
// @__NO_SIDE_EFFECTS__
function fc(e, t) {
if (!__INTLIFY_DROP_MESSAGE_COMPILER__ && D(e)) {
const n = q(t.warnHtmlMessage) ? t.warnHtmlMessage : !0;
process.env.NODE_ENV !== "production" && lc(e, n);
const s = (t.onCacheKey || cc)(e), o = un[s];
if (o)
return o;
const { ast: i, detectError: a } = uc(e, {
...t,
location: process.env.NODE_ENV !== "production",
jit: !0
}), l = Yn(i);
return a ? l : un[s] = l;
} else {
if (process.env.NODE_ENV !== "production" && !xe(e))
return Ke(`the message that is resolve with key '${t.key}' is not supported for jit compilation`), () => e;
const n = e.cacheKey;
if (n) {
const r = un[n];
return r || (un[n] = Yn(e));
} else
return Yn(e);
}
}
let qt = null;
function dc(e) {
qt = e;
}
function mc(e, t, n) {
qt && qt.emit("i18n:init", {
timestamp: Date.now(),
i18n: e,
version: t,
meta: n
});
}
const _c = /* @__PURE__ */ hc("function:translate");
function hc(e) {
return (t) => qt && qt.emit(e, t);
}
const ye = {
INVALID_ARGUMENT: Ll,
// 17
INVALID_DATE_ARGUMENT: 18,
INVALID_ISO_DATE_ARGUMENT: 19,
NOT_SUPPORT_NON_STRING_MESSAGE: 20,
NOT_SUPPORT_LOCALE_PROMISE_VALUE: 21,
NOT_SUPPORT_LOCALE_ASYNC_FUNCTION: 22,
NOT_SUPPORT_LOCALE_TYPE: 23
}, gc = 24;
function ze(e) {
return Ut(e, null, process.env.NODE_ENV !== "production" ? { messages: Ec } : void 0);
}
const Ec = {
[ye.INVALID_ARGUMENT]: "Invalid arguments",
[ye.INVALID_DATE_ARGUMENT]: "The date provided is an invalid Date object.Make sure your Date represents a valid date.",
[ye.INVALID_ISO_DATE_ARGUMENT]: "The argument provided is not a valid ISO date string",
[ye.NOT_SUPPORT_NON_STRING_MESSAGE]: "Not support non-string message",
[ye.NOT_SUPPORT_LOCALE_PROMISE_VALUE]: "cannot support promise value",
[ye.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION]: "cannot support async function",
[ye.NOT_SUPPORT_LOCALE_TYPE]: "cannot support locale type"
};
function Br(e, t) {
return t.locale != null ? ys(t.locale) : ys(e.locale);
}
let Kn;
function ys(e) {
if (D(e))
return e;
if (z(e)) {
if (e.resolvedOnce && Kn != null)
return Kn;
if (e.constructor.name === "Function") {
const t = e();
if (wl(t))
throw ze(ye.NOT_SUPPORT_LOCALE_PROMISE_VALUE);
return Kn = t;
} else
throw ze(ye.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION);
} else
throw ze(ye.NOT_SUPPORT_LOCALE_TYPE);
}
function pc(e, t, n) {
return [.../* @__PURE__ */ new Set([
n,
...le(t) ? t : j(t) ? Object.keys(t) : D(t) ? [t] : [n]
])];
}
function Jo(e, t, n) {
const r = D(n) ? n : Xt, s = e;
s.__localeChainCache || (s.__localeChainCache = /* @__PURE__ */ new Map());
let o = s.__localeChainCache.get(r);
if (!o) {
o = [];
let i = [n];
for (; le(i); )
i = ws(o, i, t);
const a = le(t) || !K(t) ? t : t.default ? t.default : null;
i = D(a) ? [a] : a, le(i) && ws(o, i, !1), s.__localeChainCache.set(r, o);
}
return o;
}
function ws(e, t, n) {
let r = !0;
for (let s = 0; s < t.length && q(r); s++) {
const o = t[s];
D(o) && (r = bc(e, t[s], n));
}
return r;
}
function bc(e, t, n) {
let r;
const s = t.split("-");
do {
const o = s.join("-");
r = yc(e, o, n), s.splice(-1, 1);
} while (s.length && r === !0);
return r;
}
function yc(e, t, n) {
let r = !1;
if (!e.includes(t) && (r = !0, t)) {
r = t[t.length - 1] !== "!";
const s = t.replace(/!/g, "");
e.push(s), (le(n) || K(n)) && n[s] && (r = n[s]);
}
return r;
}
const at = [];
at[
0
/* States.BEFORE_PATH */
] = {
w: [
0
/* States.BEFORE_PATH */
],
i: [
3,
0
/* Actions.APPEND */
],
"[": [
4
/* States.IN_SUB_PATH */
],
o: [
7
/* States.AFTER_PATH */
]
};
at[
1
/* States.IN_PATH */
] = {
w: [
1
/* States.IN_PATH */
],
".": [
2
/* States.BEFORE_IDENT */
],
"[": [
4
/* States.IN_SUB_PATH */
],
o: [
7
/* States.AFTER_PATH */
]
};
at[
2
/* States.BEFORE_IDENT */
] = {
w: [
2
/* States.BEFORE_IDENT */
],
i: [
3,
0
/* Actions.APPEND */
],
0: [
3,
0
/* Actions.APPEND */
]
};
at[
3
/* States.IN_IDENT */
] = {
i: [
3,
0
/* Actions.APPEND */
],
0: [
3,
0
/* Actions.APPEND */
],
w: [
1,
1
/* Actions.PUSH */
],
".": [
2,
1
/* Actions.PUSH */
],
"[": [
4,
1
/* Actions.PUSH */
],
o: [
7,
1
/* Actions.PUSH */
]
};
at[
4
/* States.IN_SUB_PATH */
] = {
"'": [
5,
0
/* Actions.APPEND */
],
'"': [
6,
0
/* Actions.APPEND */
],
"[": [
4,
2
/* Actions.INC_SUB_PATH_DEPTH */
],
"]": [
1,
3
/* Actions.PUSH_SUB_PATH */
],
o: 8,
l: [
4,
0
/* Actions.APPEND */
]
};
at[
5
/* States.IN_SINGLE_QUOTE */
] = {
"'": [
4,
0
/* Actions.APPEND */
],
o: 8,
l: [
5,
0
/* Actions.APPEND */
]
};
at[
6
/* States.IN_DOUBLE_QUOTE */
] = {
'"': [
4,
0
/* Actions.APPEND */
],
o: 8,
l: [
6,
0
/* Actions.APPEND */
]
};
const wc = /^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;
function vc(e) {
return wc.test(e);
}
function Nc(e) {
const t = e.charCodeAt(0), n = e.charCodeAt(e.length - 1);
return t === n && (t === 34 || t === 39) ? e.slice(1, -1) : e;
}
function Tc(e) {
if (e == null)
return "o";
switch (e.charCodeAt(0)) {
case 91:
// [
case 93:
// ]
case 46:
// .
case 34:
// "
case 39:
return e;
case 95:
// _
case 36:
// $
case 45:
return "i";
case 9:
// Tab (HT)
case 10:
// Newline (LF)
case 13:
// Return (CR)
case 160:
// No-break space (NBSP)
case 65279:
// Byte Order Mark (BOM)
case 8232:
// Line Separator (LS)
case 8233:
return "w";
}
return "i";
}
function Lc(e) {
const t = e.trim();
return e.charAt(0) === "0" && isNaN(parseInt(e)) ? !1 : vc(t) ? Nc(t) : "*" + t;
}
function Oc(e) {
const t = [];
let n = -1, r = 0, s = 0, o, i, a, l, c, _, m;
const u = [];
u[
0
/* Actions.APPEND */
] = () => {
i === void 0 ? i = a : i += a;
}, u[
1
/* Actions.PUSH */
] = () => {
i !== void 0 && (t.push(i), i = void 0);
}, u[
2
/* Actions.INC_SUB_PATH_DEPTH */
] = () => {
u[
0
/* Actions.APPEND */
](), s++;
}, u[
3
/* Actions.PUSH_SUB_PATH */
] = () => {
if (s > 0)
s--, r = 4, u[
0
/* Actions.APPEND */
]();
else {
if (s = 0, i === void 0 || (i = Lc(i), i === !1))
return !1;
u[
1
/* Actions.PUSH */
]();
}
};
function g() {
const y = e[n + 1];
if (r === 5 && y === "'" || r === 6 && y === '"')
return n++, a = "\\" + y, u[
0
/* Actions.APPEND */
](), !0;
}
for (; r !== null; )
if (n++, o = e[n], !(o === "\\" && g())) {
if (l = Tc(o), m = at[r], c = m[l] || m.l || 8, c === 8 || (r = c[0], c[1] !== void 0 && (_ = u[c[1]], _ && (a = o, _() === !1))))
return;
if (r === 7)
return t;
}
}
const vs = /* @__PURE__ */ new Map();
function Ic(e, t) {
return j(e) ? e[t] : null;
}
function Ac(e, t) {
if (!j(e))
return null;
let n = vs.get(t);
if (n || (n = Oc(t), n && vs.set(t, n)), !n)
return null;
const r = n.length;
let s = e, o = 0;
for (; o < r; ) {
const i = n[o];
if (Zo.includes(i) && xe(s))
return null;
const a = s[i];
if (a === void 0 || z(s))
return null;
s = a, o++;
}
return s;
}
const Le = {
NOT_FOUND_KEY: 1,
FALLBACK_TO_TRANSLATE: 2,
CANNOT_FORMAT_NUMBER: 3,
FALLBACK_TO_NUMBER_FORMAT: 4,
CANNOT_FORMAT_DATE: 5,
FALLBACK_TO_DATE_FORMAT: 6,
EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER: 7
}, Sc = 8, Cc = {
[Le.NOT_FOUND_KEY]: "Not found '{key}' key in '{locale}' locale messages.",
[Le.FALLBACK_TO_TRANSLATE]: "Fall back to translate '{key}' key with '{target}' locale.",
[Le.CANNOT_FORMAT_NUMBER]: "Cannot format a number value due to not supported Intl.NumberFormat.",
[Le.FALLBACK_TO_NUMBER_FORMAT]: "Fall back to number format '{key}' key with '{target}' locale.",
[Le.CANNOT_FORMAT_DATE]: "Cannot format a date value due to not supported Intl.DateTimeFormat.",
[Le.FALLBACK_TO_DATE_FORMAT]: "Fall back to datetime format '{key}' key with '{target}' locale.",
[Le.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]: "This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future."
};
function pt(e, ...t) {
return Cn(Cc[e], ...t);
}
const Pc = "11.1.11", Rn = -1, Xt = "en-US", Ln = "", Ns = (e) => `${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;
function Rc() {
return {
upper: (e, t) => t === "text" && D(e) ? e.toUpperCase() : t === "vnode" && j(e) && "__v_isVNode" in e ? e.children.toUpperCase() : e,
lower: (e, t) => t === "text" && D(e) ? e.toLowerCase() : t === "vnode" && j(e) && "__v_isVNode" in e ? e.children.toLowerCase() : e,
capitalize: (e, t) => t === "text" && D(e) ? Ns(e) : t === "vnode" && j(e) && "__v_isVNode" in e ? Ns(e.children) : e
};
}
let Qo;
function Dc(e) {
Qo = e;
}
let zo;
function kc(e) {
zo = e;
}
let ei;
function Uc(e) {
ei = e;
}
let ti = null;
const xc = /* @__NO_SIDE_EFFECTS__ */ (e) => {
ti = e;
}, Mc = /* @__NO_SIDE_EFFECTS__ */ () => ti;
let ni = null;
const Ts = (e) => {
ni = e;
}, Fc = () => ni;
let Ls = 0;
function Bc(e = {}) {
const t = z(e.onWarn) ? e.onWarn : Ke, n = D(e.version) ? e.version : Pc, r = D(e.locale) || z(e.locale) ? e.locale : Xt, s = z(r) ? Xt : r, o = le(e.fallbackLocale) || K(e.fallbackLocale) || D(e.fallbackLocale) || e.fallbackLocale === !1 ? e.fallbackLocale : s, i = K(e.messages) ? e.messages : Gn(s), a = K(e.datetimeFormats) ? e.datetimeFormats : Gn(s), l = K(e.numberFormats) ? e.numberFormats : Gn(s), c = be(Q(), e.modifiers, Rc()), _ = e.pluralRules || Q(), m = z(e.missing) ? e.missing : null, u = q(e.missingWarn) || Pt(e.missingWarn) ? e.missingWarn : !0, g = q(e.fallbackWarn) || Pt(e.fallbackWarn) ? e.fallbackWarn : !0, y = !!e.fallbackFormat, E = !!e.unresolving, p = z(e.postTranslation) ? e.postTranslation : null, f = K(e.processor) ? e.processor : null, b = q(e.warnHtmlMessage) ? e.warnHtmlMessage : !0, v = !!e.escapeParameter, w = z(e.messageCompiler) ? e.messageCompiler : Qo;
process.env.NODE_ENV !== "production" && z(e.messageCompiler) && Dr(pt(Le.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER));
const O = z(e.messageResolver) ? e.messageResolver : zo || Ic, P = z(e.localeFallbacker) ? e.localeFallbacker : ei || pc, T = j(e.fallbackContext) ? e.fallbackContext : void 0, $ = e, k = j($.__datetimeFormatters) ? $.__datetimeFormatters : /* @__PURE__ */ new Map(), se = j($.__numberFormatters) ? $.__numberFormatters : /* @__PURE__ */ new Map(), ge = j($.__meta) ? $.__meta : {};
Ls++;
const F = {
version: n,
cid: Ls,
locale: r,
fallbackLocale: o,
messages: i,
modifiers: c,
pluralRules: _,
missing: m,
missingWarn: u,
fallbackWarn: g,
fallbackFormat: y,
unresolving: E,
postTranslation: p,
processor: f,
warnHtmlMessage: b,
escapeParameter: v,
messageCompiler: w,
messageResolver: O,
localeFallbacker: P,
fallbackContext: T,
onWarn: t,
__meta: ge
};
return F.datetimeFormats = a, F.numberFormats = l, F.__datetimeFormatters = k, F.__numberFormatters = se, process.env.NODE_ENV !== "production" && (F.__v_emitter = $.__v_emitter != null ? $.__v_emitter : void 0), (process.env.NODE_ENV !== "production" || __INTLIFY_PROD_DEVTOOLS__) && mc(F, n, ge), F;
}
const Gn = (e) => ({ [e]: Q() });
function Dn(e, t) {
return e instanceof RegExp ? e.test(t) : e;
}
function ri(e, t) {
return e instanceof RegExp ? e.test(t) : e;
}
function Vr(e, t, n, r, s) {
const { missing: o, onWarn: i } = e;
if (process.env.NODE_ENV !== "production") {
const a = e.__v_emitter;
a && a.emit("missing", {
locale: n,
key: t,
type: s,
groupId: `${s}:${t}`
});
}
if (o !== null) {
const a = o(e, n, t, s);
return D(a) ? a : t;
} else
return process.env.NODE_ENV !== "production" && ri(r, t) && i(pt(Le.NOT_FOUND_KEY, { key: t, locale: n })), t;
}
function Bt(e, t, n) {
const r = e;
r.__localeChainCache = /* @__PURE__ */ new Map(), e.localeFallbacker(e, n, t);
}
function si(e, t) {
return e === t ? !1 : e.split("-")[0] === t.split("-")[0];
}
function Vc(e, t) {
const n = t.indexOf(e);
if (n === -1)
return !1;
for (let r = n + 1; r < t.length; r++)
if (si(e, t[r]))
return !0;
return !1;
}
const Os = typeof Intl < "u", oi = {
dateTimeFormat: Os && typeof Intl.DateTimeFormat < "u",
numberFormat: Os && typeof Intl.NumberFormat < "u"
};
function Is(e, ...t) {
const { datetimeFormats: n, unresolving: r, fallbackLocale: s, onWarn: o, localeFallbacker: i } = e, { __datetimeFormatters: a } = e;
if (process.env.NODE_ENV !== "production" && !oi.dateTimeFormat)
return o(pt(Le.CANNOT_FORMAT_DATE)), Ln;
const [l, c, _, m] = ar(...t), u = q(_.missingWarn) ? _.missingWarn : e.missingWarn, g = q(_.fallbackWarn) ? _.fallbackWarn : e.fallbackWarn, y = !!_.part, E = Br(e, _), p = i(
e,
// eslint-disable-line @typescript-eslint/no-explicit-any
s,
E
);
if (!D(l) || l === "")
return new Intl.DateTimeFormat(E, m).format(c);
let f = {}, b, v = null, w = E, O = null;
const P = "datetime format";
for (let k = 0; k < p.length; k++) {
if (b = O = p[k], process.env.NODE_ENV !== "production" && E !== b && Dn(g, l) && o(pt(Le.FALLBACK_TO_DATE_FORMAT, {
key: l,
target: b
})), process.env.NODE_ENV !== "production" && E !== b) {
const se = e.__v_emitter;
se && se.emit("fallback", {
type: P,
key: l,
from: w,
to: O,
groupId: `${P}:${l}`
});
}
if (f = n[b] || {}, v = f[l], K(v))
break;
Vr(e, l, b, u, P), w = O;
}
if (!K(v) || !D(b))
return r ? Rn : l;
let T = `${b}__${l}`;
Pn(m) || (T = `${T}__${JSON.stringify(m)}`);
let $ = a.get(T);
return $ || ($ = new Intl.DateTimeFormat(b, be({}, v, m)), a.set(T, $)), y ? $.formatToParts(c) : $.format(c);
}
const ii = [
"localeMatcher",
"weekday",
"era",
"year",
"month",
"day",
"hour",
"minute",
"second",
"timeZoneName",
"formatMatcher",
"hour12",
"timeZone",
"dateStyle",
"timeStyle",
"calendar",
"dayPeriod",
"numberingSystem",
"hourCycle",
"fractionalSecondDigits"
];
function ar(...e) {
const [t, n, r, s] = e, o = Q();
let i = Q(), a;
if (D(t)) {
const l = t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);
if (!l)
throw ze(ye.INVALID_ISO_DATE_ARGUMENT);
const c = l[3] ? l[3].trim().startsWith("T") ? `${l[1].trim()}${l[3].trim()}` : `${l[1].trim()}T${l[3].trim()}` : l[1].trim();
a = new Date(c);
try {
a.toISOString();
} catch {
throw ze(ye.INVALID_ISO_DATE_ARGUMENT);
}
} else if (El(t)) {
if (isNaN(t.getTime()))
throw ze(ye.INVALID_DATE_ARGUMENT);
a = t;
} else if (_e(t))
a = t;
else
throw ze(ye.INVALID_ARGUMENT);
return D(n) ? o.key = n : K(n) && Object.keys(n).forEach((l) => {
ii.includes(l) ? i[l] = n[l] : o[l] = n[l];
}), D(r) ? o.locale = r : K(r) && (i = r), K(s) && (i = s), [o.key || "", a, o, i];
}
function As(e, t, n) {
const r = e;
for (const s in n) {
const o = `${t}__${s}`;
r.__datetimeFormatters.has(o) && r.__datetimeFormatters.delete(o);
}
}
function Ss(e, ...t) {
const { numberFormats: n, unresolving: r, fallbackLocale: s, onWarn: o, localeFallbacker: i } = e, { __numberFormatters: a } = e;
if (process.env.NODE_ENV !== "production" && !oi.numberFormat)
return o(pt(Le.CANNOT_FORMAT_NUMBER)), Ln;
const [l, c, _, m] = lr(...t), u = q(_.missingWarn) ? _.missingWarn : e.missingWarn, g = q(_.fallbackWarn) ? _.fallbackWarn : e.fallbackWarn, y = !!_.part, E = Br(e, _), p = i(
e,
// eslint-disable-line @typescript-eslint/no-explicit-any
s,
E
);
if (!D(l) || l === "")
return new Intl.NumberFormat(E, m).format(c);
let f = {}, b, v = null, w = E, O = null;
const P = "number format";
for (let k = 0; k < p.length; k++) {
if (b = O = p[k], process.env.NODE_ENV !== "production" && E !== b && Dn(g, l) && o(pt(Le.FALLBACK_TO_NUMBER_FORMAT, {
key: l,
target: b
})), process.env.NODE_ENV !== "production" && E !== b) {
const se = e.__v_emitter;
se && se.emit("fallback", {
type: P,
key: l,
from: w,
to: O,
groupId: `${P}:${l}`
});
}
if (f = n[b] || {}, v = f[l], K(v))
break;
Vr(e, l, b, u, P), w = O;
}
if (!K(v) || !D(b))
return r ? Rn : l;
let T = `${b}__${l}`;
Pn(m) || (T = `${T}__${JSON.stringify(m)}`);
let $ = a.get(T);
return $ || ($ = new Intl.NumberFormat(b, be({}, v, m)), a.set(T, $)), y ? $.formatToParts(c) : $.format(c);
}
const ai = [
"localeMatcher",
"style",
"currency",
"currencyDisplay",
"currencySign",
"useGrouping",
"minimumIntegerDigits",
"minimumFractionDigits",
"maximumFractionDigits",
"minimumSignificantDigits",
"maximumSignificantDigits",
"compactDisplay",
"notation",
"signDisplay",
"unit",
"unitDisplay",
"roundingMode",
"roundingPriority",
"roundingIncrement",
"trailingZeroDisplay"
];
function lr(...e) {
const [t, n, r, s] = e, o = Q();
let i = Q();
if (!_e(t))
throw ze(ye.INVALID_ARGUMENT);
const a = t;
return D(n) ? o.key = n : K(n) && Object.keys(n).forEach((l) => {
ai.includes(l) ? i[l] = n[l] : o[l] = n[l];
}), D(r) ? o.locale = r : K(r) && (i = r), K(s) && (i = s), [o.key || "", a, o, i];
}
function Cs(e, t, n) {
const r = e;
for (const s in n) {
const o = `${t}__${s}`;
r.__numberFormatters.has(o) && r.__numberFormatters.delete(o);
}
}
const Hc = (e) => e, $c = (e) => "", Wc = "text", Yc = (e) => e.length === 0 ? "" : Ur(e), Kc = vl;
function Ps(e, t) {
return e = Math.abs(e), t === 2 ? e ? e > 1 ? 1 : 0 : 1 : e ? Math.min(e, 2) : 0;
}
function Gc(e) {
const t = _e(e.pluralIndex) ? e.pluralIndex : -1;
return e.named && (_e(e.named.count) || _e(e.named.n)) ? _e(e.named.count) ? e.named.count : _e(e.named.n) ? e.named.n : t : t;
}
function jc(e, t) {
t.count || (t.count = e), t.n || (t.n = e);
}
function qc(e = {}) {
const t = e.locale, n = Gc(e), r = j(e.pluralRules) && D(t) && z(e.pluralRules[t]) ? e.pluralRules[t] : Ps, s = j(e.pluralRules) && D(t) && z(e.pluralRules[t]) ? Ps : void 0, o = (f) => f[r(n, f.length, s)], i = e.list || [], a = (f) => i[f], l = e.named || Q();
_e(e.pluralIndex) && jc(n, l);
const c = (f) => l[f];
function _(f, b) {
const v = z(e.messages) ? e.messages(f, !!b) : j(e.messages) ? e.messages[f] : !1;
return v || (e.parent ? e.parent.message(f) : $c);
}
const m = (f) => e.modifiers ? e.modifiers[f] : Hc, u = K(e.processor) && z(e.processor.normalize) ? e.processor.normalize : Yc, g = K(e.processor) && z(e.processor.interpolate) ? e.processor.interpolate : Kc, y = K(e.processor) && D(e.processor.type) ? e.processor.type : Wc, p = {
list: a,
named: c,
plural: o,
linked: (f, ...b) => {
const [v, w] = b;
let O = "text", P = "";
b.length === 1 ? j(v) ? (P = v.modifier || P, O = v.type || O) : D(v) && (P = v || P) : b.length === 2 && (D(v) && (P = v || P), D(w) && (O = w || O));
const T = _(f, !0)(p), $ = (
// The message in vnode resolved with linked are returned as an array by processor.nomalize
O === "vnode" && le(T) && P ? T[0] : T
);
return P ? m(P)($, O) : $;
},
message: _,
type: y,
interpolate: g,
normalize: u,
values: be(Q(), i, l)
};
return p;
}
const Rs = () => "", ke = (e) => z(e);
function Ds(e, ...t) {
const { fallbackFormat: n, postTranslation: r, unresolving: s, messageCompiler: o, fallbackLocale: i, messages: a } = e, [l, c] = cr(...t), _ = q(c.missingWarn) ? c.missingWarn : e.missingWarn, m = q(c.fallbackWarn) ? c.fallbackWarn : e.fallbackWarn, u = q(c.escapeParameter) ? c.escapeParameter : e.escapeParameter, g = !!c.resolvedMessage, y = D(c.default) || q(c.default) ? q(c.default) ? o ? l : () => l : c.default : n ? o ? l : () => l : null, E = n || y != null && (D(y) || z(y)), p = Br(e, c);
u && Xc(c);
let [f, b, v] = g ? [
l,
p,
a[p] || Q()
] : li(e, l, p, i, m, _), w = f, O = l;
if (!g && !(D(w) || xe(w) || ke(w)) && E && (w = y, O = w), !g && (!(D(w) || xe(w) || ke(w)) || !D(b)))
return s ? Rn : l;
if (process.env.NODE_ENV !== "production" && D(w) && e.messageCompiler == null)
return Ke(`The message format compilation is not supported in this build. Because message compiler isn't included. You need to pre-compilation all message format. So translate function return '${l}'.`), l;
let P = !1;
const T = () => {
P = !0;
}, $ = ke(w) ? w : ci(e, l, b, w, O, T);
if (P)
return w;
const k = zc(e, b, v, c), se = qc(k), ge = Zc(e, $, se);
let F = r ? r(ge, l) : ge;
if (u && D(F) && (F = bl(F)), process.env.NODE_ENV !== "production" || __INTLIFY_PROD_DEVTOOLS__) {
const S = {
timestamp: Date.now(),
key: D(l) ? l : ke(w) ? w.key : "",
locale: b || (ke(w) ? w.locale : ""),
format: D(w) ? w : ke(w) ? w.source : "",
message: F
};
S.meta = be({}, e.__meta, /* @__PURE__ */ Mc() || {}), _c(S);
}
return F;
}
function Xc(e) {
le(e.list) ? e.list = e.list.map((t) => D(t) ? ms(t) : t) : j(e.named) && Object.keys(e.named).forEach((t) => {
D(e.named[t]) && (e.named[t] = ms(e.named[t]));
});
}
function li(e, t, n, r, s, o) {
const { messages: i, onWarn: a, messageResolver: l, localeFallbacker: c } = e, _ = c(e, r, n);
let m = Q(), u, g = null, y = n, E = null;
const p = "translate";
for (let f = 0; f < _.length; f++) {
if (u = E = _[f], process.env.NODE_ENV !== "production" && n !== u && !si(n, u) && Dn(s, t) && a(pt(Le.FALLBACK_TO_TRANSLATE, {
key: t,
target: u
})), process.env.NODE_ENV !== "production" && n !== u) {
const O = e.__v_emitter;
O && O.emit("fallback", {
type: p,
key: t,
from: y,
to: E,
groupId: `${p}:${t}`
});
}
m = i[u] || Q();
let b = null, v, w;
if (process.env.NODE_ENV !== "production" && Ve && (b = window.performance.now(), v = "intlify-message-resolve-start", w = "intlify-message-resolve-end", Pe && Pe(v)), (g = l(m, t)) === null && (g = m[t]), process.env.NODE_ENV !== "production" && Ve) {
const O = window.performance.now(), P = e.__v_emitter;
P && b && g && P.emit("message-resolve", {
type: "message-resolve",
key: t,
message: g,
time: O - b,
groupId: `${p}:${t}`
}), v && w && Pe && Et && (Pe(w), Et("intlify message resolve", v, w));
}
if (D(g) || xe(g) || ke(g))
break;
if (!Vc(u, _)) {
const O = Vr(
e,
// eslint-disable-line @typescript-eslint/no-explicit-any
t,
u,
o,
p
);
O !== t && (g = O);
}
y = E;
}
return [g, u, m];
}
function ci(e, t, n, r, s, o) {
const { messageCompiler: i, warnHtmlMessage: a } = e;
if (ke(r)) {
const u = r;
return u.locale = u.locale || n, u.key = u.key || t, u;
}
if (i == null) {
const u = () => r;
return u.locale = n, u.key = t, u;
}
let l = null, c, _;
process.env.NODE_ENV !== "production" && Ve && (l = window.performance.now(), c = "intlify-message-compilation-start", _ = "intlify-message-compilation-end", Pe && Pe(c));
const m = i(r, Jc(e, n, s, r, a, o));
if (process.env.NODE_ENV !== "production" && Ve) {
const u = window.performance.now(), g = e.__v_emitter;
g && l && g.emit("message-compilation", {
type: "message-compilation",
message: r,
time: u - l,
groupId: `translate:${t}`
}), c && _ && Pe && Et && (Pe(_), Et("intlify message compilation", c, _));
}
return m.locale = n, m.key = t, m.source = r, m;
}
function Zc(e, t, n) {
let r = null, s, o;
process.env.NODE_ENV !== "production" && Ve && (r = window.performance.now(), s = "intlify-message-evaluation-start", o = "intlify-message-evaluation-end", Pe && Pe(s));
const i = t(n);
if (process.env.NODE_ENV !== "production" && Ve) {
const a = window.performance.now(), l = e.__v_emitter;
l && r && l.emit("message-evaluation", {
type: "message-evaluation",
value: i,
time: a - r,
groupId: `translate:${t.key}`
}), s && o && Pe && Et && (Pe(o), Et("intlify message evaluation", s, o));
}
return i;
}
function cr(...e) {
const [t, n, r] = e, s = Q();
if (!D(t) && !_e(t) && !ke(t) && !xe(t))
throw ze(ye.INVALID_ARGUMENT);
const o = _e(t) ? String(t) : (ke(t), t);
return _e(n) ? s.plural = n : D(n) ? s.default = n : K(n) && !Pn(n) ? s.named = n : le(n) && (s.list = n), _e(r) ? s.plural = r : D(r) ? s.default = r : K(r) && be(s, r), [o, s];
}
function Jc(e, t, n, r, s, o) {
return {
locale: t,
key: n,
warnHtmlMessage: s,
onError: (i) => {
if (o && o(i), process.env.NODE_ENV !== "production") {
const a = Qc(r), l = `Message compilation error: ${i.message}`, c = i.location && a && Nl(a, i.location.start.offset, i.location.end.offset), _ = e.__v_emitter;
_ && a && _.emit("compile-error", {
message: a,
error: i.message,
start: i.location && i.location.start.offset,
end: i.location && i.location.end.offset,
groupId: `translate:${n}`
}), console.error(c ? `${l}
${c}` : l);
} else
throw i;
},
onCacheKey: (i) => hl(t, n, i)
};
}
function Qc(e) {
if (D(e))
return e;
if (e.loc && e.loc.source)
return e.loc.source;
}
function zc(e, t, n, r) {
const { modifiers: s, pluralRules: o, messageResolver: i, fallbackLocale: a, fallbackWarn: l, missingWarn: c, fallbackContext: _ } = e, u = {
locale: t,
modifiers: s,
pluralRules: o,
messages: (g, y) => {
let E = i(n, g);
if (E == null && (_ || y)) {
const [, , p] = li(
_ || e,
// NOTE: if has fallbackContext, fallback to root, else if use linked, fallback to local context
g,
t,
a,
l,
c
);
E = i(p, g);
}
if (D(E) || xe(E)) {
let p = !1;
const b = ci(e, g, t, E, g, () => {
p = !0;
});
return p ? Rs : b;
} else return ke(E) ? E : Rs;
}
};
return e.processor && (u.processor = e.processor), r.list && (u.list = r.list), r.named && (u.named = r.named), _e(r.plural) && (u.pluralIndex = r.plural), u;
}
zl();
function eu() {
return ui().__VUE_DEVTOOLS_GLOBAL_HOOK__;
}
function ui() {
return typeof navigator < "u" && typeof window < "u" ? window : typeof globalThis < "u" ? globalThis : {};
}
const tu = typeof Proxy == "function", nu = "devtools-plugin:setup", ru = "plugin:settings:set";
let Nt, ur;
function su() {
var e;
return Nt !== void 0 || (typeof window < "u" && window.performance ? (Nt = !0, ur = window.performance) : typeof globalThis < "u" && (!((e = globalThis.perf_hooks) === null || e === void 0) && e.performance) ? (Nt = !0, ur = globalThis.perf_hooks.performance) : Nt = !1), Nt;
}
function ou() {
return su() ? ur.now() : Date.now();
}
class iu {
constructor(t, n) {
this.target = null, this.targetQueue = [], this.onQueue = [], this.plugin = t, this.hook = n;
const r = {};
if (t.settings)
for (const i in t.settings) {
const a = t.settings[i];
r[i] = a.defaultValue;
}
const s = `__vue-devtools-plugin-settings__${t.id}`;
let o = Object.assign({}, r);
try {
const i = localStorage.getItem(s), a = JSON.parse(i);
Object.assign(o, a);
} catch {
}
this.fallbacks = {
getSettings() {
return o;
},
setSettings(i) {
try {
localStorage.setItem(s, JSON.stringify(i));
} catch {
}
o = i;
},
now() {
return ou();
}
}, n && n.on(ru, (i, a) => {
i === this.plugin.id && this.fallbacks.setSettings(a);
}), this.proxiedOn = new Proxy({}, {
get: (i, a) => this.target ? this.target.on[a] : (...l) => {
this.onQueue.push({
method: a,
args: l
});
}
}), this.proxiedTarget = new Proxy({}, {
get: (i, a) => this.target ? this.target[a] : a === "on" ? this.proxiedOn : Object.keys(this.fallbacks).includes(a) ? (...l) => (this.targetQueue.push({
method: a,
args: l,
resolve: () => {
}
}), this.fallbacks[a](...l)) : (...l) => new Promise((c) => {
this.targetQueue.push({
method: a,
args: l,
resolve: c
});
})
});
}
async setRealTarget(t) {
this.target = t;
for (const n of this.onQueue)
this.target.on[n.method](...n.args);
for (const n of this.targetQueue)
n.resolve(await this.target[n.method](...n.args));
}
}
function au(e, t) {
const n = e, r = ui(), s = eu(), o = tu && n.enableEarlyProxy;
if (s && (r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !o))
s.emit(nu, e, t);
else {
const i = o ? new iu(n, s) : null;
(r.__VUE_DEVTOOLS_PLUGINS__ = r.__VUE_DEVTOOLS_PLUGINS__ || []).push({
pluginDescriptor: n,
setupFn: t,
proxy: i
}), i && t(i.proxiedTarget);
}
}
/*!
* vue-i18n v11.1.11
* (c) 2025 kazuya kawaguchi
* Released under the MIT License.
*/
const lu = "11.1.11";
function cu() {
typeof __VUE_I18N_FULL_INSTALL__ != "boolean" && (ht().__VUE_I18N_FULL_INSTALL__ = !0), typeof __VUE_I18N_LEGACY_API__ != "boolean" && (ht().__VUE_I18N_LEGACY_API__ = !0), typeof __INTLIFY_DROP_MESSAGE_COMPILER__ != "boolean" && (ht().__INTLIFY_DROP_MESSAGE_COMPILER__ = !1), typeof __INTLIFY_PROD_DEVTOOLS__ != "boolean" && (ht().__INTLIFY_PROD_DEVTOOLS__ = !1);
}
const te = {
// composer module errors
UNEXPECTED_RETURN_TYPE: gc,
// 24
// legacy module errors
INVALID_ARGUMENT: 25,
// i18n module errors
MUST_BE_CALL_SETUP_TOP: 26,
NOT_INSTALLED: 27,
// directive module errors
REQUIRED_VALUE: 28,
INVALID_VALUE: 29,
// vue-devtools errors
CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN: 30,
NOT_INSTALLED_WITH_PROVIDE: 31,
// unexpected error
UNEXPECTED_ERROR: 32,
// not compatible legacy vue-i18n constructor
NOT_COMPATIBLE_LEGACY_VUE_I18N: 33,
// Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly
NOT_AVAILABLE_COMPOSITION_IN_LEGACY: 34
};
function Ie(e, ...t) {
return Ut(e, null, process.env.NODE_ENV !== "production" ? { messages: uu, args: t } : void 0);
}
const uu = {
[te.UNEXPECTED_RETURN_TYPE]: "Unexpected return type in composer",
[te.INVALID_ARGUMENT]: "Invalid argument",
[te.MUST_BE_CALL_SETUP_TOP]: "Must be called at the top of a `setup` function",
[te.NOT_INSTALLED]: "Need to install with `app.use` function",
[te.UNEXPECTED_ERROR]: "Unexpected error",
[te.REQUIRED_VALUE]: "Required in value: {0}",
[te.INVALID_VALUE]: "Invalid value",
[te.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]: "Cannot setup vue-devtools plugin",
[te.NOT_INSTALLED_WITH_PROVIDE]: "Need to install with `provide` function",
[te.NOT_COMPATIBLE_LEGACY_VUE_I18N]: "Not compatible legacy VueI18n.",
[te.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]: "Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly"
}, fr = /* @__PURE__ */ Ge("__translateVNode"), dr = /* @__PURE__ */ Ge("__datetimeParts"), mr = /* @__PURE__ */ Ge("__numberParts"), bt = /* @__PURE__ */ Ge("__enableEmitter"), Zt = /* @__PURE__ */ Ge("__disableEmitter"), fi = Ge("__setPluralRules"), di = /* @__PURE__ */ Ge("__injectWithOption"), _r = /* @__PURE__ */ Ge("__dispose"), Ue = {
FALLBACK_TO_ROOT: Sc,
// 8
NOT_FOUND_PARENT_SCOPE: 9,
IGNORE_OBJ_FLATTEN: 10,
/**
* @deprecated will be removed at vue-i18n v12
*/
DEPRECATE_LEGACY_MODE: 11,
/**
* @deprecated will be removed at vue-i18n v12
*/
DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE: 12,
// duplicate `useI18n` calling
DUPLICATE_USE_I18N_CALLING: 13
}, fu = {
[Ue.FALLBACK_TO_ROOT]: "Fall back to {type} '{key}' with root locale.",
[Ue.NOT_FOUND_PARENT_SCOPE]: "Not found parent scope. use the global scope.",
[Ue.IGNORE_OBJ_FLATTEN]: "Ignore object flatten: '{key}' key has an string value",
/**
* @deprecated will be removed at vue-i18n v12
*/
[Ue.DEPRECATE_LEGACY_MODE]: `Legacy API mode has been deprecated in v11. Use Composition API mode instead.
About how to use the Composition API mode, see https://vue-i18n.intlify.dev/guide/advanced/composition.html`,
/**
* @deprecated will be removed at vue-i18n v12
*/
[Ue.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE]: "'v-t' has been deprecated in v11. Use translate APIs ('t' or '$t') instead.",
[Ue.DUPLICATE_USE_I18N_CALLING]: "Duplicate `useI18n` calling by local scope. Please don't call it on local scope, due to it does not work properly in component."
};
function Dt(e, ...t) {
return Cn(fu[e], ...t);
}
function Jt(e) {
if (!j(e) || xe(e))
return e;
for (const t in e)
if (Be(e, t))
if (!t.includes("."))
j(e[t]) && Jt(e[t]);
else {
const n = t.split("."), r = n.length - 1;
let s = e, o = !1;
for (let i = 0; i < r; i++) {
if (n[i] === "__proto__")
throw new Error(`unsafe key: ${n[i]}`);
if (n[i] in s || (s[n[i]] = Q()), !j(s[n[i]])) {
process.env.NODE_ENV !== "production" && Ke(Dt(Ue.IGNORE_OBJ_FLATTEN, {
key: n[i]
})), o = !0;
break;
}
s = s[n[i]];
}
if (o || (xe(s) ? Zo.includes(n[r]) || delete e[t] : (s[n[r]] = e[t], delete e[t])), !xe(s)) {
const i = s[n[r]];
j(i) && Jt(i);
}
}
return e;
}
function Hr(e, t) {
const { messages: n, __i18n: r, messageResolver: s, flatJson: o } = t, i = K(n) ? n : le(r) ? Q() : { [e]: Q() };
if (le(r) && r.forEach((a) => {
if ("locale" in a && "resource" in a) {
const { locale: l, resource: c } = a;
l ? (i[l] = i[l] || Q(), dn(c, i[l])) : dn(c, i);
} else
D(a) && dn(JSON.parse(a), i);
}), s == null && o)
for (const a in i)
Be(i, a) && Jt(i[a]);
return i;
}
function mi(e) {
return e.type;
}
function _i(e, t, n) {
let r = j(t.messages) ? t.messages : Q();
"__i18nGlobal" in n && (r = Hr(e.locale.value, {
messages: r,
__i18n: n.__i18nGlobal
}));
const s = Object.keys(r);
s.length && s.forEach((o) => {
e.mergeLocaleMessage(o, r[o]);
});
{
if (j(t.datetimeFormats)) {
const o = Object.keys(t.datetimeFormats);
o.length && o.forEach((i) => {
e.mergeDateTimeFormat(i, t.datetimeFormats[i]);
});
}
if (j(t.numberFormats)) {
const o = Object.keys(t.numberFormats);
o.length && o.forEach((i) => {
e.mergeNumberFormat(i, t.numberFormats[i]);
});
}
}
}
function ks(e) {
return xi(Mi, null, e, 0);
}
const Us = "__INTLIFY_META__", xs = () => [], du = () => !1;
let Ms = 0;
function Fs(e) {
return (t, n, r, s) => e(n, r, Wt() || void 0, s);
}
const mu = /* @__NO_SIDE_EFFECTS__ */ () => {
const e = Wt();
let t = null;
return e && (t = mi(e)[Us]) ? { [Us]: t } : null;
};
function $r(e = {}) {
const { __root: t, __injectWithOption: n } = e, r = t === void 0, s = e.flatJson, o = Ve ? Ci : Pi;
let i = q(e.inheritLocale) ? e.inheritLocale : !0;
const a = o(
// prettier-ignore
t && i ? t.locale.value : D(e.locale) ? e.locale : Xt
), l = o(
// prettier-ignore
t && i ? t.fallbackLocale.value : D(e.fallbackLocale) || le(e.fallbackLocale) || K(e.fallbackLocale) || e.fallbackLocale === !1 ? e.fallbackLocale : a.value
), c = o(Hr(a.value, e)), _ = o(K(e.datetimeFormats) ? e.datetimeFormats : { [a.value]: {} }), m = o(K(e.numberFormats) ? e.numberFormats : { [a.value]: {} });
let u = t ? t.missingWarn : q(e.missingWarn) || Pt(e.missingWarn) ? e.missingWarn : !0, g = t ? t.fallbackWarn : q(e.fallbackWarn) || Pt(e.fallbackWarn) ? e.fallbackWarn : !0, y = t ? t.fallbackRoot : q(e.fallbackRoot) ? e.fallbackRoot : !0, E = !!e.fallbackFormat, p = z(e.missing) ? e.missing : null, f = z(e.missing) ? Fs(e.missing) : null, b = z(e.postTranslation) ? e.postTranslation : null, v = t ? t.warnHtmlMessage : q(e.warnHtmlMessage) ? e.warnHtmlMessage : !0, w = !!e.escapeParameter;
const O = t ? t.modifiers : K(e.modifiers) ? e.modifiers : {};
let P = e.pluralRules || t && t.pluralRules, T;
T = (() => {
r && Ts(null);
const N = {
version: lu,
locale: a.value,
fallbackLocale: l.value,
messages: c.value,
modifiers: O,
pluralRules: P,
missing: f === null ? void 0 : f,
missingWarn: u,
fallbackWarn: g,
fallbackFormat: E,
unresolving: !0,
postTranslation: b === null ? void 0 : b,
warnHtmlMessage: v,
escapeParameter: w,
messageResolver: e.messageResolver,
messageCompiler: e.messageCompiler,
__meta: { framework: "vue" }
};
N.datetimeFormats = _.value, N.numberFormats = m.value, N.__datetimeFormatters = K(T) ? T.__datetimeFormatters : void 0, N.__numberFormatters = K(T) ? T.__numberFormatters : void 0, process.env.NODE_ENV !== "production" && (N.__v_emitter = K(T) ? T.__v_emitter : void 0);
const C = Bc(N);
return r && Ts(C), C;
})(), Bt(T, a.value, l.value);
function k() {
return [
a.value,
l.value,
c.value,
_.value,
m.value
];
}
const se = Ft({
get: () => a.value,
set: (N) => {
T.locale = N, a.value = N;
}
}), ge = Ft({
get: () => l.value,
set: (N) => {
T.fallbackLocale = N, l.value = N, Bt(T, a.value, N);
}
}), F = Ft(() => c.value), S = /* @__PURE__ */ Ft(() => _.value), I = /* @__PURE__ */ Ft(() => m.value);
function L() {
return z(b) ? b : null;
}
function R(N) {
b = N, T.postTranslation = N;
}
function x() {
return p;
}
function V(N) {
N !== null && (f = Fs(N)), p = N, T.missing = f;
}
function B(N, C) {
return N !== "translate" || !C.resolvedMessage;
}
const U = (N, C, Z, fe, ct, nn) => {
k();
let wt;
try {
process.env.NODE_ENV !== "production" || __INTLIFY_PROD_DEVTOOLS__, r || (T.fallbackContext = t ? Fc() : void 0), wt = N(T);
} finally {
process.env.NODE_ENV !== "production" || __INTLIFY_PROD_DEVTOOLS__, r || (T.fallbackContext = void 0);
}
if (Z !== "translate exists" && // for not `te` (e.g `t`)
_e(wt) && wt === Rn || Z === "translate exists" && !wt) {
const [ut, yi] = C();
if (process.env.NODE_ENV !== "production" && t && D(ut) && B(Z, yi) && (y && (Dn(g, ut) || ri(u, ut)) && Ke(Dt(Ue.FALLBACK_TO_ROOT, {
key: ut,
type: Z
})), process.env.NODE_ENV !== "production")) {
const { __v_emitter: Kr } = T;
Kr && y && Kr.emit("fallback", {
type: Z,
key: ut,
to: "global",
groupId: `${Z}:${ut}`
});
}
return t && y ? fe(t) : ct(ut);
} else {
if (nn(wt))
return wt;
throw Ie(te.UNEXPECTED_RETURN_TYPE);
}
};
function H(...N) {
return U((C) => Reflect.apply(Ds, null, [C, ...N]), () => cr(...N), "translate", (C) => Reflect.apply(C.t, C, [...N]), (C) => C, (C) => D(C));
}
function Y(...N) {
const [C, Z, fe] = N;
if (fe && !j(fe))
throw Ie(te.INVALID_ARGUMENT);
return H(C, Z, be({ resolvedMessage: !0 }, fe || {}));
}
function oe(...N) {
return U((C) => Reflect.apply(Is, null, [C, ...N]), () => ar(...N), "datetime format", (C) => Reflect.apply(C.d, C, [...N]), () => Ln, (C) => D(C) || le(C));
}
function J(...N) {
return U((C) => Reflect.apply(Ss, null, [C, ...N]), () => lr(...N), "number format", (C) => Reflect.apply(C.n, C, [...N]), () => Ln, (C) => D(C) || le(C));
}
function G(N) {
return N.map((C) => D(C) || _e(C) || q(C) ? ks(String(C)) : C);
}
const ie = {
normalize: G,
interpolate: (N) => N,
type: "vnode"
};
function Ee(...N) {
return U((C) => {
let Z;
const fe = C;
try {
fe.processor = ie, Z = Reflect.apply(Ds, null, [fe, ...N]);
} finally {
fe.processor = null;
}
return Z;
}, () => cr(...N), "translate", (C) => C[fr](...N), (C) => [ks(C)], (C) => le(C));
}
function ee(...N) {
return U((C) => Reflect.apply(Ss, null, [C, ...N]), () => lr(...N), "number format", (C) => C[mr](...N), xs, (C) => D(C) || le(C));
}
function de(...N) {
return U((C) => Reflect.apply(Is, null, [C, ...N]), () => ar(...N), "datetime format", (C) => C[dr](...N), xs, (C) => D(C) || le(C));
}
function et(N) {
P = N, T.pluralRules = P;
}
function yt(N, C) {
return U(() => {
if (!N)
return !1;
const Z = D(C) ? C : a.value, fe = lt(Z), ct = T.messageResolver(fe, N);
return xe(ct) || ke(ct) || D(ct);
}, () => [N], "translate exists", (Z) => Reflect.apply(Z.te, Z, [N, C]), du, (Z) => q(Z));
}
function tt(N) {
let C = null;
const Z = Jo(T, l.value, a.value);
for (let fe = 0; fe < Z.length; fe++) {
const ct = c.value[Z[fe]] || {}, nn = T.messageResolver(ct, N);
if (nn != null) {
C = nn;
break;
}
}
return C;
}
function xt(N) {
const C = tt(N);
return C ?? (t ? t.tm(N) || {} : {});
}
function lt(N) {
return c.value[N] || {};
}
function Mt(N, C) {
if (s) {
const Z = { [N]: C };
for (const fe in Z)
Be(Z, fe) && Jt(Z[fe]);
C = Z[N];
}
c.value[N] = C, T.messages = c.value;
}
function kn(N, C) {
c.value[N] = c.value[N] || {};
const Z = { [N]: C };
if (s)
for (const fe in Z)
Be(Z, fe) && Jt(Z[fe]);
C = Z[N], dn(C, c.value[N]), T.messages = c.value;
}
function d(N) {
return _.value[N] || {};
}
function h(N, C) {
_.value[N] = C, T.datetimeFormats = _.value, As(T, N, C);
}
function A(N, C) {
_.value[N] = be(_.value[N] || {}, C), T.datetimeFormats = _.value, As(T, N, C);
}
function M(N) {
return m.value[N] || {};
}
function ce(N, C) {
m.value[N] = C, T.numberFormats = m.value, Cs(T, N, C);
}
function ue(N, C) {
m.value[N] = be(m.value[N] || {}, C), T.numberFormats = m.value, Cs(T, N, C);
}
Ms++, t && Ve && (Jn(t.locale, (N) => {
i && (a.value = N, T.locale = N, Bt(T, a.value, l.value));
}), Jn(t.fallbackLocale, (N) => {
i && (l.value = N, T.fallbackLocale = N, Bt(T, a.value, l.value));
}));
const X = {
id: Ms,
locale: se,
fallbackLocale: ge,
get inheritLocale() {
return i;
},
set inheritLocale(N) {
i = N, N && t && (a.value = t.locale.value, l.value = t.fallbackLocale.value, Bt(T, a.value, l.value));
},
get availableLocales() {
return Object.keys(c.value).sort();
},
messages: F,
get modifiers() {
return O;
},
get pluralRules() {
return P || {};
},
get isGlobal() {
return r;
},
get missingWarn() {
return u;
},
set missingWarn(N) {
u = N, T.missingWarn = u;
},
get fallbackWarn() {
return g;
},
set fallbackWarn(N) {
g = N, T.fallbackWarn = g;
},
get fallbackRoot() {
return y;
},
set fallbackRoot(N) {
y = N;
},
get fallbackFormat() {
return E;
},
set fallbackFormat(N) {
E = N, T.fallbackFormat = E;
},
get warnHtmlMessage() {
return v;
},
set warnHtmlMessage(N) {
v = N, T.warnHtmlMessage = N;
},
get escapeParameter() {
return w;
},
set escapeParameter(N) {
w = N, T.escapeParameter = N;
},
t: H,
getLocaleMessage: lt,
setLocaleMessage: Mt,
mergeLocaleMessage: kn,
getPostTranslationHandler: L,
setPostTranslationHandler: R,
getMissingHandler: x,
setMissingHandler: V,
[fi]: et
};
return X.datetimeFormats = S, X.numberFormats = I, X.rt = Y, X.te = yt, X.tm = xt, X.d = oe, X.n = J, X.getDateTimeFormat = d, X.setDateTimeFormat = h, X.mergeDateTimeFormat = A, X.getNumberFormat = M, X.setNumberFormat = ce, X.mergeNumberFormat = ue, X[di] = n, X[fr] = Ee, X[dr] = de, X[mr] = ee, process.env.NODE_ENV !== "production" && (X[bt] = (N) => {
T.__v_emitter = N;
}, X[Zt] = () => {
T.__v_emitter = void 0;
}), X;
}
const hi = "vue-i18n: composer properties", jn = {
"vue-devtools-plugin-vue-i18n": "Vue I18n DevTools",
"vue-i18n-resource-inspector": "Vue I18n DevTools",
"vue-i18n-timeline": "Vue I18n"
}, _u = {
"vue-i18n-resource-inspector": "Search for scopes ..."
}, hu = {
"vue-i18n-timeline": 16764185
};
let hr;
async function gu(e, t) {
return new Promise((n, r) => {
try {
au({
id: "vue-devtools-plugin-vue-i18n",
label: jn["vue-devtools-plugin-vue-i18n"],
packageName: "vue-i18n",
homepage: "https://vue-i18n.intlify.dev",
logo: "https://vue-i18n.intlify.dev/vue-i18n-devtools-logo.png",
componentStateTypes: [hi],
app: e
// eslint-disable-line @typescript-eslint/no-explicit-any
}, (s) => {
hr = s, s.on.visitComponentTree(({ componentInstance: i, treeNode: a }) => {
Eu(i, a, t);
}), s.on.inspectComponent(({ componentInstance: i, instanceData: a }) => {
i.vnode.el && i.vnode.el.__VUE_I18N__ && a && (t.mode === "legacy" ? i.vnode.el.__VUE_I18N__ !== t.global.__composer && Bs(a, i.vnode.el.__VUE_I18N__) : Bs(a, i.vnode.el.__VUE_I18N__));
}), s.addInspector({
id: "vue-i18n-resource-inspector",
label: jn["vue-i18n-resource-inspector"],
icon: "language",
treeFilterPlaceholder: _u["vue-i18n-resource-inspector"]
}), s.on.getInspectorTree((i) => {
i.app === e && i.inspectorId === "vue-i18n-resource-inspector" && vu(i, t);
});
const o = /* @__PURE__ */ new Map();
s.on.getInspectorState(async (i) => {
if (i.app === e && i.inspectorId === "vue-i18n-resource-inspector")
if (s.unhighlightElement(), Tu(i, t), i.nodeId === "global") {
if (!o.has(i.app)) {
const [a] = await s.getComponentInstances(i.app);
o.set(i.app, a);
}
s.highlightElement(o.get(i.app));
} else {
const a = Nu(i.nodeId, t);
a && s.highlightElement(a);
}
}), s.on.editInspectorState((i) => {
i.app === e && i.inspectorId === "vue-i18n-resource-inspector" && Ou(i, t);
}), s.addTimelineLayer({
id: "vue-i18n-timeline",
label: jn["vue-i18n-timeline"],
color: hu["vue-i18n-timeline"]
}), n(!0);
});
} catch (s) {
console.error(s), r(!1);
}
});
}
function gi(e) {
return e.type.name || e.type.displayName || e.type.__file || "Anonymous";
}
function Eu(e, t, n) {
const r = n.mode === "composition" ? n.global : n.global.__composer;
if (e && e.vnode.el && e.vnode.el.__VUE_I18N__ && e.vnode.el.__VUE_I18N__ !== r) {
const s = {
label: `i18n (${gi(e)} Scope)`,
textColor: 0,
backgroundColor: 16764185
};
t.tags.push(s);
}
}
function Bs(e, t) {
const n = hi;
e.state.push({
type: n,
key: "locale",
editable: !0,
value: t.locale.value
}), e.state.push({
type: n,
key: "availableLocales",
editable: !1,
value: t.availableLocales
}), e.state.push({
type: n,
key: "fallbackLocale",
editable: !0,
value: t.fallbackLocale.value
}), e.state.push({
type: n,
key: "inheritLocale",
editable: !0,
value: t.inheritLocale
}), e.state.push({
type: n,
key: "messages",
editable: !1,
value: Wr(t.messages.value)
}), e.state.push({
type: n,
key: "datetimeFormats",
editable: !1,
value: t.datetimeFormats.value
}), e.state.push({
type: n,
key: "numberFormats",
editable: !1,
value: t.numberFormats.value
});
}
function Wr(e) {
const t = {};
return Object.keys(e).forEach((n) => {
const r = e[n];
z(r) && "source" in r ? t[n] = wu(r) : xe(r) && r.loc && r.loc.source ? t[n] = r.loc.source : j(r) ? t[n] = Wr(r) : t[n] = r;
}), t;
}
const pu = {
"<": "<",
">": ">",
'"': """,
"&": "&"
};
function bu(e) {
return e.replace(/[<>"&]/g, yu);
}
function yu(e) {
return pu[e] || e;
}
function wu(e) {
return {
_custom: {
type: "function",
display: `<span>ƒ</span> ${e.source ? `("${bu(e.source)}")` : "(?)"}`
}
};
}
function vu(e, t) {
e.rootNodes.push({
id: "global",
label: "Global Scope"
});
const n = t.mode === "composition" ? t.global : t.global.__composer;
for (const [r, s] of t.__instances) {
const o = t.mode === "composition" ? s : s.__composer;
n !== o && e.rootNodes.push({
id: o.id.toString(),
label: `${gi(r)} Scope`
});
}
}
function Nu(e, t) {
let n = null;
if (e !== "global") {
for (const [r, s] of t.__instances.entries())
if (s.id.toString() === e) {
n = r;
break;
}
}
return n;
}
function Ei(e, t) {
if (e === "global")
return t.mode === "composition" ? t.global : t.global.__composer;
{
const n = Array.from(t.__instances.values()).find((r) => r.id.toString() === e);
return n ? t.mode === "composition" ? n : n.__composer : null;
}
}
function Tu(e, t) {
const n = Ei(e.nodeId, t);
return n && (e.state = Lu(n)), null;
}
function Lu(e) {
const t = {}, n = "Locale related info", r = [
{
type: n,
key: "locale",
editable: !0,
value: e.locale.value
},
{
type: n,
key: "fallbackLocale",
editable: !0,
value: e.fallbackLocale.value
},
{
type: n,
key: "availableLocales",
editable: !1,
value: e.availableLocales
},
{
type: n,
key: "inheritLocale",
editable: !0,
value: e.inheritLocale
}
];
t[n] = r;
const s = "Locale messages info", o = [
{
type: s,
key: "messages",
editable: !1,
value: Wr(e.messages.value)
}
];
t[s] = o;
{
const i = "Datetime formats info", a = [
{
type: i,
key: "datetimeFormats",
editable: !1,
value: e.datetimeFormats.value
}
];
t[i] = a;
const l = "Datetime formats info", c = [
{
type: l,
key: "numberFormats",
editable: !1,
value: e.numberFormats.value
}
];
t[l] = c;
}
return t;
}
function Qt(e, t) {
if (hr) {
let n;
t && "groupId" in t && (n = t.groupId, delete t.groupId), hr.addTimelineEvent({
layerId: "vue-i18n-timeline",
event: {
title: e,
groupId: n,
time: Date.now(),
meta: {},
data: t || {},
logType: e === "compile-error" ? "error" : e === "fallback" || e === "missing" ? "warning" : "default"
}
});
}
}
function Ou(e, t) {
const n = Ei(e.nodeId, t);
if (n) {
const [r] = e.path;
r === "locale" && D(e.state.value) ? n.locale.value = e.state.value : r === "fallbackLocale" && (D(e.state.value) || le(e.state.value) || j(e.state.value)) ? n.fallbackLocale.value = e.state.value : r === "inheritLocale" && q(e.state.value) && (n.inheritLocale = e.state.value);
}
}
function Iu(e) {
const t = D(e.locale) ? e.locale : Xt, n = D(e.fallbackLocale) || le(e.fallbackLocale) || K(e.fallbackLocale) || e.fallbackLocale === !1 ? e.fallbackLocale : t, r = z(e.missing) ? e.missing : void 0, s = q(e.silentTranslationWarn) || Pt(e.silentTranslationWarn) ? !e.silentTranslationWarn : !0, o = q(e.silentFallbackWarn) || Pt(e.silentFallbackWarn) ? !e.silentFallbackWarn : !0, i = q(e.fallbackRoot) ? e.fallbackRoot : !0, a = !!e.formatFallbackMessages, l = K(e.modifiers) ? e.modifiers : {}, c = e.pluralizationRules, _ = z(e.postTranslation) ? e.postTranslation : void 0, m = D(e.warnHtmlInMessage) ? e.warnHtmlInMessage !== "off" : !0, u = !!e.escapeParameterHtml, g = q(e.sync) ? e.sync : !0;
let y = e.messages;
if (K(e.sharedMessages)) {
const O = e.sharedMessages;
y = Object.keys(O).reduce((T, $) => {
const k = T[$] || (T[$] = {});
return be(k, O[$]), T;
}, y || {});
}
const { __i18n: E, __root: p, __injectWithOption: f } = e, b = e.datetimeFormats, v = e.numberFormats, w = e.flatJson;
return {
locale: t,
fallbackLocale: n,
messages: y,
flatJson: w,
datetimeFormats: b,
numberFormats: v,
missing: r,
missingWarn: s,
fallbackWarn: o,
fallbackRoot: i,
fallbackFormat: a,
modifiers: l,
pluralRules: c,
postTranslation: _,
warnHtmlMessage: m,
escapeParameter: u,
messageResolver: e.messageResolver,
inheritLocale: g,
__i18n: E,
__root: p,
__injectWithOption: f
};
}
function gr(e = {}) {
const t = $r(Iu(e)), { __extender: n } = e, r = {
// id
id: t.id,
// locale
get locale() {
return t.locale.value;
},
set locale(s) {
t.locale.value = s;
},
// fallbackLocale
get fallbackLocale() {
return t.fallbackLocale.value;
},
set fallbackLocale(s) {
t.fallbackLocale.value = s;
},
// messages
get messages() {
return t.messages.value;
},
// datetimeFormats
get datetimeFormats() {
return t.datetimeFormats.value;
},
// numberFormats
get numberFormats() {
return t.numberFormats.value;
},
// availableLocales
get availableLocales() {
return t.availableLocales;
},
// missing
get missing() {
return t.getMissingHandler();
},
set missing(s) {
t.setMissingHandler(s);
},
// silentTranslationWarn
get silentTranslationWarn() {
return q(t.missingWarn) ? !t.missingWarn : t.missingWarn;
},
set silentTranslationWarn(s) {
t.missingWarn = q(s) ? !s : s;
},
// silentFallbackWarn
get silentFallbackWarn() {
return q(t.fallbackWarn) ? !t.fallbackWarn : t.fallbackWarn;
},
set silentFallbackWarn(s) {
t.fallbackWarn = q(s) ? !s : s;
},
// modifiers
get modifiers() {
return t.modifiers;
},
// formatFallbackMessages
get formatFallbackMessages() {
return t.fallbackFormat;
},
set formatFallbackMessages(s) {
t.fallbackFormat = s;
},
// postTranslation
get postTranslation() {
return t.getPostTranslationHandler();
},
set postTranslation(s) {
t.setPostTranslationHandler(s);
},
// sync
get sync() {
return t.inheritLocale;
},
set sync(s) {
t.inheritLocale = s;
},
// warnInHtmlMessage
get warnHtmlInMessage() {
return t.warnHtmlMessage ? "warn" : "off";
},
set warnHtmlInMessage(s) {
t.warnHtmlMessage = s !== "off";
},
// escapeParameterHtml
get escapeParameterHtml() {
return t.escapeParameter;
},
set escapeParameterHtml(s) {
t.escapeParameter = s;
},
// pluralizationRules
get pluralizationRules() {
return t.pluralRules || {};
},
// for internal
__composer: t,
// t
t(...s) {
return Reflect.apply(t.t, t, [...s]);
},
// rt
rt(...s) {
return Reflect.apply(t.rt, t, [...s]);
},
// te
te(s, o) {
return t.te(s, o);
},
// tm
tm(s) {
return t.tm(s);
},
// getLocaleMessage
getLocaleMessage(s) {
return t.getLocaleMessage(s);
},
// setLocaleMessage
setLocaleMessage(s, o) {
t.setLocaleMessage(s, o);
},
// mergeLocaleMessage
mergeLocaleMessage(s, o) {
t.mergeLocaleMessage(s, o);
},
// d
d(...s) {
return Reflect.apply(t.d, t, [...s]);
},
// getDateTimeFormat
getDateTimeFormat(s) {
return t.getDateTimeFormat(s);
},
// setDateTimeFormat
setDateTimeFormat(s, o) {
t.setDateTimeFormat(s, o);
},
// mergeDateTimeFormat
mergeDateTimeFormat(s, o) {
t.mergeDateTimeFormat(s, o);
},
// n
n(...s) {
return Reflect.apply(t.n, t, [...s]);
},
// getNumberFormat
getNumberFormat(s) {
return t.getNumberFormat(s);
},
// setNumberFormat
setNumberFormat(s, o) {
t.setNumberFormat(s, o);
},
// mergeNumberFormat
mergeNumberFormat(s, o) {
t.mergeNumberFormat(s, o);
}
};
return r.__extender = n, process.env.NODE_ENV !== "production" && (r.__enableEmitter = (s) => {
const o = t;
o[bt] && o[bt](s);
}, r.__disableEmitter = () => {
const s = t;
s[Zt] && s[Zt]();
}), r;
}
function Au(e, t, n) {
return {
beforeCreate() {
const r = Wt();
if (!r)
throw Ie(te.UNEXPECTED_ERROR);
const s = this.$options;
if (s.i18n) {
const o = s.i18n;
if (s.__i18n && (o.__i18n = s.__i18n), o.__root = t, this === this.$root)
this.$i18n = Vs(e, o);
else {
o.__injectWithOption = !0, o.__extender = n.__vueI18nExtend, this.$i18n = gr(o);
const i = this.$i18n;
i.__extender && (i.__disposer = i.__extender(this.$i18n));
}
} else if (s.__i18n)
if (this === this.$root)
this.$i18n = Vs(e, s);
else {
this.$i18n = gr({
__i18n: s.__i18n,
__injectWithOption: !0,
__extender: n.__vueI18nExtend,
__root: t
});
const o = this.$i18n;
o.__extender && (o.__disposer = o.__extender(this.$i18n));
}
else
this.$i18n = e;
s.__i18nGlobal && _i(t, s, s), this.$t = (...o) => this.$i18n.t(...o), this.$rt = (...o) => this.$i18n.rt(...o), this.$te = (o, i) => this.$i18n.te(o, i), this.$d = (...o) => this.$i18n.d(...o), this.$n = (...o) => this.$i18n.n(...o), this.$tm = (o) => this.$i18n.tm(o), n.__setInstance(r, this.$i18n);
},
mounted() {
if (process.env.NODE_ENV !== "production" && this.$el && this.$i18n) {
const r = this.$i18n;
this.$el.__VUE_I18N__ = r.__composer;
const s = this.__v_emitter = xr();
r.__enableEmitter && r.__enableEmitter(s), s.on("*", Qt);
}
},
unmounted() {
const r = Wt();
if (!r)
throw Ie(te.UNEXPECTED_ERROR);
const s = this.$i18n;
process.env.NODE_ENV !== "production" && this.$el && this.$el.__VUE_I18N__ && (this.__v_emitter && (this.__v_emitter.off("*", Qt), delete this.__v_emitter), this.$i18n && (s.__disableEmitter && s.__disableEmitter(), delete this.$el.__VUE_I18N__)), delete this.$t, delete this.$rt, delete this.$te, delete this.$d, delete this.$n, delete this.$tm, s.__disposer && (s.__disposer(), delete s.__disposer, delete s.__extender), n.__deleteInstance(r), delete this.$i18n;
}
};
}
function Vs(e, t) {
e.locale = t.locale || e.locale, e.fallbackLocale = t.fallbackLocale || e.fallbackLocale, e.missing = t.missing || e.missing, e.silentTranslationWarn = t.silentTranslationWarn || e.silentFallbackWarn, e.silentFallbackWarn = t.silentFallbackWarn || e.silentFallbackWarn, e.formatFallbackMessages = t.formatFallbackMessages || e.formatFallbackMessages, e.postTranslation = t.postTranslation || e.postTranslation, e.warnHtmlInMessage = t.warnHtmlInMessage || e.warnHtmlInMessage, e.escapeParameterHtml = t.escapeParameterHtml || e.escapeParameterHtml, e.sync = t.sync || e.sync, e.__composer[fi](t.pluralizationRules || e.pluralizationRules);
const n = Hr(e.locale, {
messages: t.messages,
__i18n: t.__i18n
});
return Object.keys(n).forEach((r) => e.mergeLocaleMessage(r, n[r])), t.datetimeFormats && Object.keys(t.datetimeFormats).forEach((r) => e.mergeDateTimeFormat(r, t.datetimeFormats[r])), t.numberFormats && Object.keys(t.numberFormats).forEach((r) => e.mergeNumberFormat(r, t.numberFormats[r])), e;
}
const Yr = {
tag: {
type: [String, Object]
},
locale: {
type: String
},
scope: {
type: String,
// NOTE: avoid https://github.com/microsoft/rushstack/issues/1050
validator: (e) => e === "parent" || e === "global",
default: "parent"
/* ComponentI18nScope */
},
i18n: {
type: Object
}
};
function Su({ slots: e }, t) {
return t.length === 1 && t[0] === "default" ? (e.default ? e.default() : []).reduce((r, s) => [
...r,
// prettier-ignore
...s.type === Zs ? s.children : [s]
], []) : t.reduce((n, r) => {
const s = e[r];
return s && (n[r] = s()), n;
}, Q());
}
function pi() {
return Zs;
}
const Cu = /* @__PURE__ */ Er({
/* eslint-disable */
name: "i18n-t",
props: be({
keypath: {
type: String,
required: !0
},
plural: {
type: [Number, String],
validator: (e) => _e(e) || !isNaN(e)
}
}, Yr),
/* eslint-enable */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
setup(e, t) {
const { slots: n, attrs: r } = t, s = e.i18n || tn({
useScope: e.scope,
__useComponent: !0
});
return () => {
const o = Object.keys(n).filter((m) => m[0] !== "_"), i = Q();
e.locale && (i.locale = e.locale), e.plural !== void 0 && (i.plural = D(e.plural) ? +e.plural : e.plural);
const a = Su(t, o), l = s[fr](e.keypath, a, i), c = be(Q(), r), _ = D(e.tag) || j(e.tag) ? e.tag : pi();
return Xs(_, c, l);
};
}
}), Hs = Cu;
function Pu(e) {
return le(e) && !D(e[0]);
}
function bi(e, t, n, r) {
const { slots: s, attrs: o } = t;
return () => {
const i = { part: !0 };
let a = Q();
e.locale && (i.locale = e.locale), D(e.format) ? i.key = e.format : j(e.format) && (D(e.format.key) && (i.key = e.format.key), a = Object.keys(e.format).reduce((u, g) => n.includes(g) ? be(Q(), u, { [g]: e.format[g] }) : u, Q()));
const l = r(e.value, i, a);
let c = [i.key];
le(l) ? c = l.map((u, g) => {
const y = s[u.type], E = y ? y({ [u.type]: u.value, index: g, parts: l }) : [u.value];
return Pu(E) && (E[0].key = `${u.type}-${g}`), E;
}) : D(l) && (c = [l]);
const _ = be(Q(), o), m = D(e.tag) || j(e.tag) ? e.tag : pi();
return Xs(m, _, c);
};
}
const Ru = /* @__PURE__ */ Er({
/* eslint-disable */
name: "i18n-n",
props: be({
value: {
type: Number,
required: !0
},
format: {
type: [String, Object]
}
}, Yr),
/* eslint-enable */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
setup(e, t) {
const n = e.i18n || tn({
useScope: e.scope,
__useComponent: !0
});
return bi(e, t, ai, (...r) => (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
n[mr](...r)
));
}
}), $s = Ru;
function Du(e, t) {
const n = e;
if (e.mode === "composition")
return n.__getInstance(t) || e.global;
{
const r = n.__getInstance(t);
return r != null ? r.__composer : e.global.__composer;
}
}
function ku(e) {
const t = (i) => {
process.env.NODE_ENV !== "production" && Dr(Dt(Ue.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE));
const { instance: a, value: l } = i;
if (!a || !a.$)
throw Ie(te.UNEXPECTED_ERROR);
const c = Du(e, a.$), _ = Ws(l);
return [
Reflect.apply(c.t, c, [...Ys(_)]),
c
];
};
return {
created: (i, a) => {
const [l, c] = t(a);
Ve && e.global === c && (i.__i18nWatcher = Jn(c.locale, () => {
a.instance && a.instance.$forceUpdate();
})), i.__composer = c, i.textContent = l;
},
unmounted: (i) => {
Ve && i.__i18nWatcher && (i.__i18nWatcher(), i.__i18nWatcher = void 0, delete i.__i18nWatcher), i.__composer && (i.__composer = void 0, delete i.__composer);
},
beforeUpdate: (i, { value: a }) => {
if (i.__composer) {
const l = i.__composer, c = Ws(a);
i.textContent = Reflect.apply(l.t, l, [
...Ys(c)
]);
}
},
getSSRProps: (i) => {
const [a] = t(i);
return { textContent: a };
}
};
}
function Ws(e) {
if (D(e))
return { path: e };
if (K(e)) {
if (!("path" in e))
throw Ie(te.REQUIRED_VALUE, "path");
return e;
} else
throw Ie(te.INVALID_VALUE);
}
function Ys(e) {
const { path: t, locale: n, args: r, choice: s, plural: o } = e, i = {}, a = r || {};
return D(n) && (i.locale = n), _e(s) && (i.plural = s), _e(o) && (i.plural = o), [t, a, i];
}
function Uu(e, t, ...n) {
const r = K(n[0]) ? n[0] : {};
(q(r.globalInstall) ? r.globalInstall : !0) && ([Hs.name, "I18nT"].forEach((o) => e.component(o, Hs)), [$s.name, "I18nN"].forEach((o) => e.component(o, $s)), [Gs.name, "I18nD"].forEach((o) => e.component(o, Gs))), e.directive("t", ku(t));
}
const xu = /* @__PURE__ */ Ge("global-vue-i18n");
function Nf(e = {}) {
const t = __VUE_I18N_LEGACY_API__ && q(e.legacy) ? e.legacy : __VUE_I18N_LEGACY_API__;
process.env.NODE_ENV !== "production" && t && Dr(Dt(Ue.DEPRECATE_LEGACY_MODE));
const n = q(e.globalInjection) ? e.globalInjection : !0, r = /* @__PURE__ */ new Map(), [s, o] = Mu(e, t), i = /* @__PURE__ */ Ge(process.env.NODE_ENV !== "production" ? "vue-i18n" : "");
function a(m) {
return r.get(m) || null;
}
function l(m, u) {
r.set(m, u);
}
function c(m) {
r.delete(m);
}
const _ = {
// mode
get mode() {
return __VUE_I18N_LEGACY_API__ && t ? "legacy" : "composition";
},
// install plugin
async install(m, ...u) {
if (process.env.NODE_ENV !== "production" && (m.__VUE_I18N__ = _), m.__VUE_I18N_SYMBOL__ = i, m.provide(m.__VUE_I18N_SYMBOL__, _), K(u[0])) {
const E = u[0];
_.__composerExtend = E.__composerExtend, _.__vueI18nExtend = E.__vueI18nExtend;
}
let g = null;
!t && n && (g = Ku(m, _.global)), __VUE_I18N_FULL_INSTALL__ && Uu(m, _, ...u), __VUE_I18N_LEGACY_API__ && t && m.mixin(Au(o, o.__composer, _));
const y = m.unmount;
if (m.unmount = () => {
g && g(), _.dispose(), y();
}, process.env.NODE_ENV !== "production") {
if (!await gu(m, _))
throw Ie(te.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN);
const p = xr();
if (t) {
const f = o;
f.__enableEmitter && f.__enableEmitter(p);
} else {
const f = o;
f[bt] && f[bt](p);
}
p.on("*", Qt);
}
},
// global accessor
get global() {
return o;
},
dispose() {
s.stop();
},
// @internal
__instances: r,
// @internal
__getInstance: a,
// @internal
__setInstance: l,
// @internal
__deleteInstance: c
};
return _;
}
function tn(e = {}) {
const t = Wt();
if (t == null)
throw Ie(te.MUST_BE_CALL_SETUP_TOP);
if (!t.isCE && t.appContext.app != null && !t.appContext.app.__VUE_I18N_SYMBOL__)
throw Ie(te.NOT_INSTALLED);
const n = Fu(t), r = Vu(n), s = mi(t), o = Bu(e, s);
if (o === "global")
return _i(r, e, s), r;
if (o === "parent") {
let l = Hu(n, t, e.__useComponent);
return l == null && (process.env.NODE_ENV !== "production" && Ke(Dt(Ue.NOT_FOUND_PARENT_SCOPE)), l = r), l;
}
const i = n;
let a = i.__getInstance(t);
if (a == null) {
const l = be({}, e);
"__i18n" in s && (l.__i18n = s.__i18n), r && (l.__root = r), a = $r(l), i.__composerExtend && (a[_r] = i.__composerExtend(a)), Wu(i, t, a), i.__setInstance(t, a);
} else
process.env.NODE_ENV !== "production" && o === "local" && Ke(Dt(Ue.DUPLICATE_USE_I18N_CALLING));
return a;
}
function Mu(e, t) {
const n = ki(), r = __VUE_I18N_LEGACY_API__ && t ? n.run(() => gr(e)) : n.run(() => $r(e));
if (r == null)
throw Ie(te.UNEXPECTED_ERROR);
return [n, r];
}
function Fu(e) {
const t = Si(e.isCE ? xu : e.appContext.app.__VUE_I18N_SYMBOL__);
if (!t)
throw Ie(e.isCE ? te.NOT_INSTALLED_WITH_PROVIDE : te.UNEXPECTED_ERROR);
return t;
}
function Bu(e, t) {
return Pn(e) ? "__i18n" in t ? "local" : "global" : e.useScope ? e.useScope : "local";
}
function Vu(e) {
return e.mode === "composition" ? e.global : e.global.__composer;
}
function Hu(e, t, n = !1) {
let r = null;
const s = t.root;
let o = $u(t, n);
for (; o != null; ) {
const i = e;
if (e.mode === "composition")
r = i.__getInstance(o);
else if (__VUE_I18N_LEGACY_API__) {
const a = i.__getInstance(o);
a != null && (r = a.__composer, n && r && !r[di] && (r = null));
}
if (r != null || s === o)
break;
o = o.parent;
}
return r;
}
function $u(e, t = !1) {
return e == null ? null : t && e.vnode.ctx || e.parent;
}
function Wu(e, t, n) {
let r = null;
Ri(() => {
if (process.env.NODE_ENV !== "production" && t.vnode.el) {
t.vnode.el.__VUE_I18N__ = n, r = xr();
const s = n;
s[bt] && s[bt](r), r.on("*", Qt);
}
}, t), Di(() => {
const s = n;
process.env.NODE_ENV !== "production" && t.vnode.el && t.vnode.el.__VUE_I18N__ && (r && r.off("*", Qt), s[Zt] && s[Zt](), delete t.vnode.el.__VUE_I18N__), e.__deleteInstance(t);
const o = s[_r];
o && (o(), delete s[_r]);
}, t);
}
const Yu = [
"locale",
"fallbackLocale",
"availableLocales"
], Ks = ["t", "rt", "d", "n", "tm", "te"];
function Ku(e, t) {
const n = /* @__PURE__ */ Object.create(null);
return Yu.forEach((s) => {
const o = Object.getOwnPropertyDescriptor(t, s);
if (!o)
throw Ie(te.UNEXPECTED_ERROR);
const i = Ui(o.value) ? {
get() {
return o.value.value;
},
// eslint-disable-next-line @typescript-eslint/no-explicit-any
set(a) {
o.value.value = a;
}
} : {
get() {
return o.get && o.get();
}
};
Object.defineProperty(n, s, i);
}), e.config.globalProperties.$i18n = n, Ks.forEach((s) => {
const o = Object.getOwnPropertyDescriptor(t, s);
if (!o || !o.value)
throw Ie(te.UNEXPECTED_ERROR);
Object.defineProperty(e.config.globalProperties, `$${s}`, o);
}), () => {
delete e.config.globalProperties.$i18n, Ks.forEach((s) => {
delete e.config.globalProperties[`$${s}`];
});
};
}
const Gu = /* @__PURE__ */ Er({
/* eslint-disable */
name: "i18n-d",
props: be({
value: {
type: [Number, Date],
required: !0
},
format: {
type: [String, Object]
}
}, Yr),
/* eslint-enable */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
setup(e, t) {
const n = e.i18n || tn({
useScope: e.scope,
__useComponent: !0
});
return bi(e, t, ii, (...r) => (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
n[dr](...r)
));
}
}), Gs = Gu;
cu();
Dc(fc);
kc(Ac);
Uc(Jo);
if (process.env.NODE_ENV !== "production" || __INTLIFY_PROD_DEVTOOLS__) {
const e = ht();
e.__INTLIFY__ = !0, dc(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__);
}
process.env.NODE_ENV;
function Tf(e, t) {
const { t: n } = tn();
return qs(e) ? e.map((r) => n(r, t)).join("") : n(e, t);
}
function Lf(e, t, n) {
const { capitalizeFirst: r = !0, uncapitalizeSecond: s = !0, uncapitalizeSecondAll: o = !0 } = n || {};
n = n || {};
let { locale: i } = n;
return i || (i = tn().locale), i.value.includes("en") ? (e = e.trim(), t = t.trim(), r && (e = e.charAt(0).toUpperCase() + e.slice(1)), s && (t = t.charAt(0).toLowerCase() + t.slice(1)), o && (t = t.toLowerCase()), `${e} ${t}`) : `${e}${t}`;
}
export {
bf as A,
dl as B,
Rr as S,
lf as _,
tn as a,
Tf as b,
df as c,
vf as d,
Vo as e,
yf as f,
gf as g,
Ef as h,
Lf as i,
pf as j,
wf as k,
nf as l,
hf as m,
mf as n,
uf as o,
Nf as p,
tf as q,
rf as r,
sf as s,
of as t,
cf as u,
af as v,
ff as w,
ul as x,
_f as y,
fl as z
};
//# sourceMappingURL=i18n-_3sLFN0p.js.map