gc_i18n 1.7.0 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/gc_i18n.es.js CHANGED
@@ -55,9 +55,9 @@ const oo = [
55
55
  }
56
56
  });
57
57
  if (l.data && l.data.result === 0) {
58
- const a = b.get(l.data, "retVal", []), d = a.map((u) => ({
59
- langCode: u.language || u.langCode || u,
60
- langName: u.langName || u.language || u
58
+ const a = b.get(l.data, "retVal", []), d = a.map((p) => ({
59
+ langCode: p.language || p.langCode || p,
60
+ langName: p.langName || p.language || p
61
61
  }));
62
62
  return E.set("I18N_LANGUAGES", a), d;
63
63
  }
@@ -165,45 +165,45 @@ const oo = [
165
165
  getRequestToken: r
166
166
  }) => {
167
167
  try {
168
- const l = Je(i), a = `I18N_${b.toUpper(e)}_${l}`, d = E.namespace(a), u = {
168
+ const l = Je(i), a = `I18N_${b.toUpper(e)}_${l}`, d = E.namespace(a), p = {
169
169
  baseUrl: t,
170
170
  appCode: e,
171
171
  language: n,
172
172
  token: o,
173
173
  getRequestToken: r
174
- }, h = d.get(n), f = [
174
+ }, u = d.get(n), h = [
175
175
  t || "",
176
176
  e || "",
177
177
  n || "",
178
178
  l,
179
179
  o || "",
180
- b.get(h, "lastPullDate", "")
180
+ b.get(u, "lastPullDate", "")
181
181
  ].join("|");
182
- if (Ae.has(f))
183
- return Ae.get(f);
182
+ if (Ae.has(h))
183
+ return Ae.get(h);
184
184
  const x = (async () => {
185
- if (!h || !h.lastPullDate) {
186
- const _ = await Et(u);
187
- return _ ? (d.set(n, _), b.get(_, "translatesDTOs", [])) : b.get(h, "translatesDTOs", []);
185
+ if (!u || !u.lastPullDate) {
186
+ const _ = await Et(p);
187
+ return _ ? (d.set(n, _), b.get(_, "translatesDTOs", [])) : b.get(u, "translatesDTOs", []);
188
188
  }
189
- const { lastPullDate: L } = h, S = await Et({
190
- ...u,
189
+ const { lastPullDate: L } = u, S = await Et({
190
+ ...p,
191
191
  lastPullDate: L
192
192
  });
193
193
  if (!S)
194
- return b.get(h, "translatesDTOs", []);
195
- const I = b.get(h, "translatesDTOs", []);
194
+ return b.get(u, "translatesDTOs", []);
195
+ const B = b.get(u, "translatesDTOs", []);
196
196
  if (!b.isEmpty(S.translatesDTOs)) {
197
- const _ = io(I, S.translatesDTOs, s), w = {
197
+ const _ = io(B, S.translatesDTOs, s), w = {
198
198
  lastPullDate: S.lastPullDate,
199
199
  translatesDTOs: _
200
200
  };
201
201
  return d.set(n, w, ":"), _;
202
202
  }
203
- return I;
203
+ return B;
204
204
  })();
205
- return Ae.set(f, x), x.finally(() => {
206
- Ae.delete(f);
205
+ return Ae.set(h, x), x.finally(() => {
206
+ Ae.delete(h);
207
207
  }), x;
208
208
  } catch (l) {
209
209
  console.error("处理翻译数据失败:", l);
@@ -1227,14 +1227,14 @@ const es = ["input", "file", "range", "select", "radio", "checkbox", "textarea"]
1227
1227
  }, ns = (t) => {
1228
1228
  if (!t.input)
1229
1229
  return;
1230
- if (!P[t.input]) {
1231
- te(`Unexpected type of input! Expected ${Object.keys(P).join(" | ")}, got "${t.input}"`);
1230
+ if (!I[t.input]) {
1231
+ te(`Unexpected type of input! Expected ${Object.keys(I).join(" | ")}, got "${t.input}"`);
1232
1232
  return;
1233
1233
  }
1234
1234
  const e = cn(t.input);
1235
1235
  if (!e)
1236
1236
  return;
1237
- const n = P[t.input](e, t);
1237
+ const n = I[t.input](e, t);
1238
1238
  R(e), t.inputAutoFocus && setTimeout(() => {
1239
1239
  rn(n);
1240
1240
  });
@@ -1274,8 +1274,8 @@ const es = ["input", "file", "range", "select", "radio", "checkbox", "textarea"]
1274
1274
  ] || c.input);
1275
1275
  }, $e = (t, e) => {
1276
1276
  ["string", "number"].includes(typeof e) ? t.value = `${e}` : at(e) || O(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof e}"`);
1277
- }, P = {};
1278
- P.text = P.email = P.password = P.number = P.tel = P.url = P.search = P.date = P["datetime-local"] = P.time = P.week = P.month = /** @type {(input: Input | HTMLElement, params: SweetAlertOptions) => Input} */
1277
+ }, I = {};
1278
+ I.text = I.email = I.password = I.number = I.tel = I.url = I.search = I.date = I["datetime-local"] = I.time = I.week = I.month = /** @type {(input: Input | HTMLElement, params: SweetAlertOptions) => Input} */
1279
1279
  (t, e) => {
1280
1280
  const n = (
1281
1281
  /** @type {HTMLInputElement} */
@@ -1284,14 +1284,14 @@ P.text = P.email = P.password = P.number = P.tel = P.url = P.search = P.date = P
1284
1284
  return $e(n, e.inputValue), Ce(n, n, e), wt(n, e), n.type = /** @type {string} */
1285
1285
  e.input, n;
1286
1286
  };
1287
- P.file = (t, e) => {
1287
+ I.file = (t, e) => {
1288
1288
  const n = (
1289
1289
  /** @type {HTMLInputElement} */
1290
1290
  t
1291
1291
  );
1292
1292
  return Ce(n, n, e), wt(n, e), n;
1293
1293
  };
1294
- P.range = (t, e) => {
1294
+ I.range = (t, e) => {
1295
1295
  const n = (
1296
1296
  /** @type {HTMLElement} */
1297
1297
  t
@@ -1305,7 +1305,7 @@ P.range = (t, e) => {
1305
1305
  )), s && $e(s, e.inputValue), /** @type {Input} */
1306
1306
  t;
1307
1307
  };
1308
- P.select = (t, e) => {
1308
+ I.select = (t, e) => {
1309
1309
  const n = (
1310
1310
  /** @type {HTMLSelectElement} */
1311
1311
  t
@@ -1316,7 +1316,7 @@ P.select = (t, e) => {
1316
1316
  }
1317
1317
  return Ce(n, n, e), n;
1318
1318
  };
1319
- P.radio = (t) => {
1319
+ I.radio = (t) => {
1320
1320
  const e = (
1321
1321
  /** @type {HTMLElement} */
1322
1322
  t
@@ -1324,7 +1324,7 @@ P.radio = (t) => {
1324
1324
  return e.textContent = "", /** @type {Input} */
1325
1325
  t;
1326
1326
  };
1327
- P.checkbox = (t, e) => {
1327
+ I.checkbox = (t, e) => {
1328
1328
  const n = T();
1329
1329
  if (!n)
1330
1330
  throw new Error("Popup not found");
@@ -1339,7 +1339,7 @@ P.checkbox = (t, e) => {
1339
1339
  }
1340
1340
  return o;
1341
1341
  };
1342
- P.textarea = (t, e) => {
1342
+ I.textarea = (t, e) => {
1343
1343
  const n = (
1344
1344
  /** @type {HTMLTextAreaElement} */
1345
1345
  t
@@ -1792,8 +1792,8 @@ function ti(t, e, n) {
1792
1792
  e.forEach((i) => {
1793
1793
  const r = i[0], l = i[1], a = document.createElement("input"), d = document.createElement("label");
1794
1794
  a.type = "radio", a.name = c.radio, a.value = r, _n(r, n.inputValue) && (a.checked = !0);
1795
- const u = document.createElement("span");
1796
- V(u, l), u.className = c.label, d.appendChild(a), d.appendChild(u), o.appendChild(d);
1795
+ const p = document.createElement("span");
1796
+ V(p, l), p.className = c.label, d.appendChild(a), d.appendChild(p), o.appendChild(d);
1797
1797
  });
1798
1798
  const s = o.querySelectorAll("input");
1799
1799
  s.length && s[0].focus();
@@ -2493,7 +2493,7 @@ https://sweetalert2.github.io/#ajax-request`), Ji(t), typeof t.title == "string"
2493
2493
  }
2494
2494
  let F;
2495
2495
  var Te = /* @__PURE__ */ new WeakMap();
2496
- class B {
2496
+ class P {
2497
2497
  /**
2498
2498
  * @param {...(SweetAlertOptions | string)} args
2499
2499
  * @this {SweetAlert}
@@ -2646,32 +2646,32 @@ const er = (t, e, n) => new Promise((o, s) => {
2646
2646
  }, rr = (t, e) => e.focusDeny && U(t.denyButton) ? (t.denyButton.focus(), !0) : e.focusCancel && U(t.cancelButton) ? (t.cancelButton.focus(), !0) : e.focusConfirm && U(t.confirmButton) ? (t.confirmButton.focus(), !0) : !1, ar = () => {
2647
2647
  document.activeElement instanceof HTMLElement && typeof document.activeElement.blur == "function" && document.activeElement.blur();
2648
2648
  };
2649
- B.prototype.disableButtons = In;
2650
- B.prototype.enableButtons = $n;
2651
- B.prototype.getInput = Tn;
2652
- B.prototype.disableInput = Bn;
2653
- B.prototype.enableInput = Pn;
2654
- B.prototype.hideLoading = Me;
2655
- B.prototype.disableLoading = Me;
2656
- B.prototype.showValidationMessage = Nn;
2657
- B.prototype.resetValidationMessage = Mn;
2658
- B.prototype.close = Y;
2659
- B.prototype.closePopup = Y;
2660
- B.prototype.closeModal = Y;
2661
- B.prototype.closeToast = Y;
2662
- B.prototype.rejectPromise = xn;
2663
- B.prototype.update = Un;
2664
- B.prototype._destroy = qn;
2665
- Object.assign(B, Ri);
2649
+ P.prototype.disableButtons = In;
2650
+ P.prototype.enableButtons = $n;
2651
+ P.prototype.getInput = Tn;
2652
+ P.prototype.disableInput = Bn;
2653
+ P.prototype.enableInput = Pn;
2654
+ P.prototype.hideLoading = Me;
2655
+ P.prototype.disableLoading = Me;
2656
+ P.prototype.showValidationMessage = Nn;
2657
+ P.prototype.resetValidationMessage = Mn;
2658
+ P.prototype.close = Y;
2659
+ P.prototype.closePopup = Y;
2660
+ P.prototype.closeModal = Y;
2661
+ P.prototype.closeToast = Y;
2662
+ P.prototype.rejectPromise = xn;
2663
+ P.prototype.update = Un;
2664
+ P.prototype._destroy = qn;
2665
+ Object.assign(P, Ri);
2666
2666
  Object.keys(gi).forEach((t) => {
2667
- B[t] = function(...e) {
2667
+ P[t] = function(...e) {
2668
2668
  if (F && F[t])
2669
2669
  return F[t](...e);
2670
2670
  };
2671
2671
  });
2672
- B.DismissReason = fe;
2673
- B.version = "11.26.18";
2674
- const M = B;
2672
+ P.DismissReason = fe;
2673
+ P.version = "11.26.18";
2674
+ const M = P;
2675
2675
  M.default = M;
2676
2676
  typeof document < "u" && (function(t, e) {
2677
2677
  var n = t.createElement("style");
@@ -2806,13 +2806,13 @@ class lr {
2806
2806
  const s = e.textContent, i = document.createDocumentFragment();
2807
2807
  let r = 0;
2808
2808
  if (n.forEach((l) => {
2809
- const { translatedValue: a, key: d, index: u } = l;
2810
- if (u > r) {
2811
- const f = s.substring(r, u);
2812
- i.appendChild(document.createTextNode(f));
2809
+ const { translatedValue: a, key: d, index: p } = l;
2810
+ if (p > r) {
2811
+ const h = s.substring(r, p);
2812
+ i.appendChild(document.createTextNode(h));
2813
2813
  }
2814
- const h = document.createElement("span");
2815
- h.className = "i18n-editable-text i18n-text-overlay", h.setAttribute("data-i18n-key", d), h.textContent = a, i.appendChild(h), this.wrappedElements.add(h), r = u + a.length;
2814
+ const u = document.createElement("span");
2815
+ u.className = "i18n-editable-text i18n-text-overlay", u.setAttribute("data-i18n-key", d), u.textContent = a, i.appendChild(u), this.wrappedElements.add(u), r = p + a.length;
2816
2816
  }), r < s.length) {
2817
2817
  const l = s.substring(r);
2818
2818
  i.appendChild(document.createTextNode(l));
@@ -2935,15 +2935,15 @@ class lr {
2935
2935
  },
2936
2936
  preConfirm: async () => {
2937
2937
  const l = document.querySelectorAll(".i18n-edit-input"), a = {};
2938
- l.forEach((u) => {
2939
- a[u.getAttribute("data-lang")] = u.value;
2938
+ l.forEach((p) => {
2939
+ a[p.getAttribute("data-lang")] = p.value;
2940
2940
  });
2941
2941
  const d = document.getElementById("i18n-save-error");
2942
2942
  d && (d.style.display = "none", d.textContent = "");
2943
2943
  try {
2944
2944
  return await this.saveTranslations(e, a, n), a;
2945
- } catch (u) {
2946
- return d && (d.textContent = u.message || "保存失败,请检查网络连接或权限", d.style.display = "block"), !1;
2945
+ } catch (p) {
2946
+ return d && (d.textContent = p.message || "保存失败,请检查网络连接或权限", d.style.display = "block"), !1;
2947
2947
  }
2948
2948
  }
2949
2949
  });
@@ -3061,16 +3061,16 @@ function ur() {
3061
3061
  function r(a, d) {
3062
3062
  if (!i[a]) {
3063
3063
  i[a] = {};
3064
- for (var u = 0; u < a.length; u++)
3065
- i[a][a.charAt(u)] = u;
3064
+ for (var p = 0; p < a.length; p++)
3065
+ i[a][a.charAt(p)] = p;
3066
3066
  }
3067
3067
  return i[a][d];
3068
3068
  }
3069
3069
  var l = {
3070
3070
  compressToBase64: function(a) {
3071
3071
  if (a == null) return "";
3072
- var d = l._compress(a, 6, function(u) {
3073
- return o.charAt(u);
3072
+ var d = l._compress(a, 6, function(p) {
3073
+ return o.charAt(p);
3074
3074
  });
3075
3075
  switch (d.length % 4) {
3076
3076
  // To produce valid Base64
@@ -3103,22 +3103,22 @@ function ur() {
3103
3103
  },
3104
3104
  //compress into uint8array (UCS-2 big endian format)
3105
3105
  compressToUint8Array: function(a) {
3106
- for (var d = l.compress(a), u = new Uint8Array(d.length * 2), h = 0, f = d.length; h < f; h++) {
3107
- var x = d.charCodeAt(h);
3108
- u[h * 2] = x >>> 8, u[h * 2 + 1] = x % 256;
3106
+ for (var d = l.compress(a), p = new Uint8Array(d.length * 2), u = 0, h = d.length; u < h; u++) {
3107
+ var x = d.charCodeAt(u);
3108
+ p[u * 2] = x >>> 8, p[u * 2 + 1] = x % 256;
3109
3109
  }
3110
- return u;
3110
+ return p;
3111
3111
  },
3112
3112
  //decompress from uint8array (UCS-2 big endian format)
3113
3113
  decompressFromUint8Array: function(a) {
3114
3114
  if (a == null)
3115
3115
  return l.decompress(a);
3116
- for (var d = new Array(a.length / 2), u = 0, h = d.length; u < h; u++)
3117
- d[u] = a[u * 2] * 256 + a[u * 2 + 1];
3118
- var f = [];
3116
+ for (var d = new Array(a.length / 2), p = 0, u = d.length; p < u; p++)
3117
+ d[p] = a[p * 2] * 256 + a[p * 2 + 1];
3118
+ var h = [];
3119
3119
  return d.forEach(function(x) {
3120
- f.push(n(x));
3121
- }), l.decompress(f.join(""));
3120
+ h.push(n(x));
3121
+ }), l.decompress(h.join(""));
3122
3122
  },
3123
3123
  //compress into a string that is already URI encoded
3124
3124
  compressToEncodedURIComponent: function(a) {
@@ -3137,55 +3137,55 @@ function ur() {
3137
3137
  return n(d);
3138
3138
  });
3139
3139
  },
3140
- _compress: function(a, d, u) {
3140
+ _compress: function(a, d, p) {
3141
3141
  if (a == null) return "";
3142
- var h, f, x = {}, L = {}, S = "", I = "", _ = "", w = 2, C = 3, v = 2, k = [], p = 0, m = 0, y;
3142
+ var u, h, x = {}, L = {}, S = "", B = "", _ = "", w = 2, C = 3, v = 2, k = [], f = 0, m = 0, y;
3143
3143
  for (y = 0; y < a.length; y += 1)
3144
- if (S = a.charAt(y), Object.prototype.hasOwnProperty.call(x, S) || (x[S] = C++, L[S] = !0), I = _ + S, Object.prototype.hasOwnProperty.call(x, I))
3145
- _ = I;
3144
+ if (S = a.charAt(y), Object.prototype.hasOwnProperty.call(x, S) || (x[S] = C++, L[S] = !0), B = _ + S, Object.prototype.hasOwnProperty.call(x, B))
3145
+ _ = B;
3146
3146
  else {
3147
3147
  if (Object.prototype.hasOwnProperty.call(L, _)) {
3148
3148
  if (_.charCodeAt(0) < 256) {
3149
- for (h = 0; h < v; h++)
3150
- p = p << 1, m == d - 1 ? (m = 0, k.push(u(p)), p = 0) : m++;
3151
- for (f = _.charCodeAt(0), h = 0; h < 8; h++)
3152
- p = p << 1 | f & 1, m == d - 1 ? (m = 0, k.push(u(p)), p = 0) : m++, f = f >> 1;
3149
+ for (u = 0; u < v; u++)
3150
+ f = f << 1, m == d - 1 ? (m = 0, k.push(p(f)), f = 0) : m++;
3151
+ for (h = _.charCodeAt(0), u = 0; u < 8; u++)
3152
+ f = f << 1 | h & 1, m == d - 1 ? (m = 0, k.push(p(f)), f = 0) : m++, h = h >> 1;
3153
3153
  } else {
3154
- for (f = 1, h = 0; h < v; h++)
3155
- p = p << 1 | f, m == d - 1 ? (m = 0, k.push(u(p)), p = 0) : m++, f = 0;
3156
- for (f = _.charCodeAt(0), h = 0; h < 16; h++)
3157
- p = p << 1 | f & 1, m == d - 1 ? (m = 0, k.push(u(p)), p = 0) : m++, f = f >> 1;
3154
+ for (h = 1, u = 0; u < v; u++)
3155
+ f = f << 1 | h, m == d - 1 ? (m = 0, k.push(p(f)), f = 0) : m++, h = 0;
3156
+ for (h = _.charCodeAt(0), u = 0; u < 16; u++)
3157
+ f = f << 1 | h & 1, m == d - 1 ? (m = 0, k.push(p(f)), f = 0) : m++, h = h >> 1;
3158
3158
  }
3159
3159
  w--, w == 0 && (w = Math.pow(2, v), v++), delete L[_];
3160
3160
  } else
3161
- for (f = x[_], h = 0; h < v; h++)
3162
- p = p << 1 | f & 1, m == d - 1 ? (m = 0, k.push(u(p)), p = 0) : m++, f = f >> 1;
3163
- w--, w == 0 && (w = Math.pow(2, v), v++), x[I] = C++, _ = String(S);
3161
+ for (h = x[_], u = 0; u < v; u++)
3162
+ f = f << 1 | h & 1, m == d - 1 ? (m = 0, k.push(p(f)), f = 0) : m++, h = h >> 1;
3163
+ w--, w == 0 && (w = Math.pow(2, v), v++), x[B] = C++, _ = String(S);
3164
3164
  }
3165
3165
  if (_ !== "") {
3166
3166
  if (Object.prototype.hasOwnProperty.call(L, _)) {
3167
3167
  if (_.charCodeAt(0) < 256) {
3168
- for (h = 0; h < v; h++)
3169
- p = p << 1, m == d - 1 ? (m = 0, k.push(u(p)), p = 0) : m++;
3170
- for (f = _.charCodeAt(0), h = 0; h < 8; h++)
3171
- p = p << 1 | f & 1, m == d - 1 ? (m = 0, k.push(u(p)), p = 0) : m++, f = f >> 1;
3168
+ for (u = 0; u < v; u++)
3169
+ f = f << 1, m == d - 1 ? (m = 0, k.push(p(f)), f = 0) : m++;
3170
+ for (h = _.charCodeAt(0), u = 0; u < 8; u++)
3171
+ f = f << 1 | h & 1, m == d - 1 ? (m = 0, k.push(p(f)), f = 0) : m++, h = h >> 1;
3172
3172
  } else {
3173
- for (f = 1, h = 0; h < v; h++)
3174
- p = p << 1 | f, m == d - 1 ? (m = 0, k.push(u(p)), p = 0) : m++, f = 0;
3175
- for (f = _.charCodeAt(0), h = 0; h < 16; h++)
3176
- p = p << 1 | f & 1, m == d - 1 ? (m = 0, k.push(u(p)), p = 0) : m++, f = f >> 1;
3173
+ for (h = 1, u = 0; u < v; u++)
3174
+ f = f << 1 | h, m == d - 1 ? (m = 0, k.push(p(f)), f = 0) : m++, h = 0;
3175
+ for (h = _.charCodeAt(0), u = 0; u < 16; u++)
3176
+ f = f << 1 | h & 1, m == d - 1 ? (m = 0, k.push(p(f)), f = 0) : m++, h = h >> 1;
3177
3177
  }
3178
3178
  w--, w == 0 && (w = Math.pow(2, v), v++), delete L[_];
3179
3179
  } else
3180
- for (f = x[_], h = 0; h < v; h++)
3181
- p = p << 1 | f & 1, m == d - 1 ? (m = 0, k.push(u(p)), p = 0) : m++, f = f >> 1;
3180
+ for (h = x[_], u = 0; u < v; u++)
3181
+ f = f << 1 | h & 1, m == d - 1 ? (m = 0, k.push(p(f)), f = 0) : m++, h = h >> 1;
3182
3182
  w--, w == 0 && (w = Math.pow(2, v), v++);
3183
3183
  }
3184
- for (f = 2, h = 0; h < v; h++)
3185
- p = p << 1 | f & 1, m == d - 1 ? (m = 0, k.push(u(p)), p = 0) : m++, f = f >> 1;
3184
+ for (h = 2, u = 0; u < v; u++)
3185
+ f = f << 1 | h & 1, m == d - 1 ? (m = 0, k.push(p(f)), f = 0) : m++, h = h >> 1;
3186
3186
  for (; ; )
3187
- if (p = p << 1, m == d - 1) {
3188
- k.push(u(p));
3187
+ if (f = f << 1, m == d - 1) {
3188
+ k.push(p(f));
3189
3189
  break;
3190
3190
  } else m++;
3191
3191
  return k.join("");
@@ -3195,52 +3195,52 @@ function ur() {
3195
3195
  return a.charCodeAt(d);
3196
3196
  });
3197
3197
  },
3198
- _decompress: function(a, d, u) {
3199
- var h = [], f = 4, x = 4, L = 3, S = "", I = [], _, w, C, v, k, p, m, y = { val: u(0), position: d, index: 1 };
3198
+ _decompress: function(a, d, p) {
3199
+ var u = [], h = 4, x = 4, L = 3, S = "", B = [], _, w, C, v, k, f, m, y = { val: p(0), position: d, index: 1 };
3200
3200
  for (_ = 0; _ < 3; _ += 1)
3201
- h[_] = _;
3202
- for (C = 0, k = Math.pow(2, 2), p = 1; p != k; )
3203
- v = y.val & y.position, y.position >>= 1, y.position == 0 && (y.position = d, y.val = u(y.index++)), C |= (v > 0 ? 1 : 0) * p, p <<= 1;
3201
+ u[_] = _;
3202
+ for (C = 0, k = Math.pow(2, 2), f = 1; f != k; )
3203
+ v = y.val & y.position, y.position >>= 1, y.position == 0 && (y.position = d, y.val = p(y.index++)), C |= (v > 0 ? 1 : 0) * f, f <<= 1;
3204
3204
  switch (C) {
3205
3205
  case 0:
3206
- for (C = 0, k = Math.pow(2, 8), p = 1; p != k; )
3207
- v = y.val & y.position, y.position >>= 1, y.position == 0 && (y.position = d, y.val = u(y.index++)), C |= (v > 0 ? 1 : 0) * p, p <<= 1;
3206
+ for (C = 0, k = Math.pow(2, 8), f = 1; f != k; )
3207
+ v = y.val & y.position, y.position >>= 1, y.position == 0 && (y.position = d, y.val = p(y.index++)), C |= (v > 0 ? 1 : 0) * f, f <<= 1;
3208
3208
  m = n(C);
3209
3209
  break;
3210
3210
  case 1:
3211
- for (C = 0, k = Math.pow(2, 16), p = 1; p != k; )
3212
- v = y.val & y.position, y.position >>= 1, y.position == 0 && (y.position = d, y.val = u(y.index++)), C |= (v > 0 ? 1 : 0) * p, p <<= 1;
3211
+ for (C = 0, k = Math.pow(2, 16), f = 1; f != k; )
3212
+ v = y.val & y.position, y.position >>= 1, y.position == 0 && (y.position = d, y.val = p(y.index++)), C |= (v > 0 ? 1 : 0) * f, f <<= 1;
3213
3213
  m = n(C);
3214
3214
  break;
3215
3215
  case 2:
3216
3216
  return "";
3217
3217
  }
3218
- for (h[3] = m, w = m, I.push(m); ; ) {
3218
+ for (u[3] = m, w = m, B.push(m); ; ) {
3219
3219
  if (y.index > a)
3220
3220
  return "";
3221
- for (C = 0, k = Math.pow(2, L), p = 1; p != k; )
3222
- v = y.val & y.position, y.position >>= 1, y.position == 0 && (y.position = d, y.val = u(y.index++)), C |= (v > 0 ? 1 : 0) * p, p <<= 1;
3221
+ for (C = 0, k = Math.pow(2, L), f = 1; f != k; )
3222
+ v = y.val & y.position, y.position >>= 1, y.position == 0 && (y.position = d, y.val = p(y.index++)), C |= (v > 0 ? 1 : 0) * f, f <<= 1;
3223
3223
  switch (m = C) {
3224
3224
  case 0:
3225
- for (C = 0, k = Math.pow(2, 8), p = 1; p != k; )
3226
- v = y.val & y.position, y.position >>= 1, y.position == 0 && (y.position = d, y.val = u(y.index++)), C |= (v > 0 ? 1 : 0) * p, p <<= 1;
3227
- h[x++] = n(C), m = x - 1, f--;
3225
+ for (C = 0, k = Math.pow(2, 8), f = 1; f != k; )
3226
+ v = y.val & y.position, y.position >>= 1, y.position == 0 && (y.position = d, y.val = p(y.index++)), C |= (v > 0 ? 1 : 0) * f, f <<= 1;
3227
+ u[x++] = n(C), m = x - 1, h--;
3228
3228
  break;
3229
3229
  case 1:
3230
- for (C = 0, k = Math.pow(2, 16), p = 1; p != k; )
3231
- v = y.val & y.position, y.position >>= 1, y.position == 0 && (y.position = d, y.val = u(y.index++)), C |= (v > 0 ? 1 : 0) * p, p <<= 1;
3232
- h[x++] = n(C), m = x - 1, f--;
3230
+ for (C = 0, k = Math.pow(2, 16), f = 1; f != k; )
3231
+ v = y.val & y.position, y.position >>= 1, y.position == 0 && (y.position = d, y.val = p(y.index++)), C |= (v > 0 ? 1 : 0) * f, f <<= 1;
3232
+ u[x++] = n(C), m = x - 1, h--;
3233
3233
  break;
3234
3234
  case 2:
3235
- return I.join("");
3235
+ return B.join("");
3236
3236
  }
3237
- if (f == 0 && (f = Math.pow(2, L), L++), h[m])
3238
- S = h[m];
3237
+ if (h == 0 && (h = Math.pow(2, L), L++), u[m])
3238
+ S = u[m];
3239
3239
  else if (m === x)
3240
3240
  S = w + w.charAt(0);
3241
3241
  else
3242
3242
  return null;
3243
- I.push(S), h[x++] = w + S.charAt(0), f--, w = S, f == 0 && (f = Math.pow(2, L), L++);
3243
+ B.push(S), u[x++] = w + S.charAt(0), h--, w = S, h == 0 && (h = Math.pow(2, L), L++);
3244
3244
  }
3245
3245
  }
3246
3246
  };
@@ -3463,14 +3463,14 @@ const Ht = {
3463
3463
  w[v] = C[v];
3464
3464
  });
3465
3465
  }), w;
3466
- }), d = He(() => a.value[n.value] || ""), u = He(() => Object.keys(a.value).filter((C) => C !== n.value).map((C) => ({
3466
+ }), d = He(() => a.value[n.value] || ""), p = He(() => Object.keys(a.value).filter((C) => C !== n.value).map((C) => ({
3467
3467
  lang: C,
3468
3468
  value: a.value[C]
3469
- }))), h = (w) => {
3469
+ }))), u = (w) => {
3470
3470
  if (!w) return "";
3471
3471
  const C = document.createElement("div");
3472
3472
  return C.textContent = w, C.innerHTML;
3473
- }, f = (w) => {
3473
+ }, h = (w) => {
3474
3474
  w.data && w.data.type === "updateLanguage" && (n.value = E.get("I18N_LANGUAGE") || "zh-CN");
3475
3475
  }, x = () => {
3476
3476
  if (typeof window > "u") return;
@@ -3500,7 +3500,7 @@ const Ht = {
3500
3500
  type="text"
3501
3501
  class="i18n-edit-input"
3502
3502
  data-lang="${k.langCode}"
3503
- value="${h(a.value[k.langCode] || "")}"
3503
+ value="${u(a.value[k.langCode] || "")}"
3504
3504
  placeholder="请输入${k.langName}"
3505
3505
  />
3506
3506
  </div>
@@ -3524,23 +3524,23 @@ const Ht = {
3524
3524
  htmlContainer: "i18n-earth-modal-content"
3525
3525
  },
3526
3526
  preConfirm: async () => {
3527
- const k = document.querySelectorAll(".i18n-edit-input"), p = {};
3527
+ const k = document.querySelectorAll(".i18n-edit-input"), f = {};
3528
3528
  k.forEach((y) => {
3529
- p[y.getAttribute("data-lang")] = y.value;
3529
+ f[y.getAttribute("data-lang")] = y.value;
3530
3530
  });
3531
3531
  const m = document.getElementById("i18n-save-error");
3532
3532
  if (m && (m.style.display = "none", m.textContent = ""), t.request && typeof t.request == "function")
3533
3533
  try {
3534
- return await t.request(p), p;
3534
+ return await t.request(f), f;
3535
3535
  } catch (y) {
3536
3536
  return m && (m.textContent = y.message || "保存失败", m.style.display = "block"), !1;
3537
3537
  }
3538
- return p;
3538
+ return f;
3539
3539
  }
3540
3540
  });
3541
3541
  if (v && C) {
3542
- const k = Object.keys(C).map((p) => ({
3543
- [p]: C[p]
3542
+ const k = Object.keys(C).map((f) => ({
3543
+ [f]: C[f]
3544
3544
  }));
3545
3545
  e("update:modelValue", k), x(), M.fire({
3546
3546
  text: "保存成功",
@@ -3551,8 +3551,8 @@ const Ht = {
3551
3551
  toast: !0
3552
3552
  });
3553
3553
  }
3554
- }, I = () => {
3555
- const w = u.value;
3554
+ }, B = () => {
3555
+ const w = p.value;
3556
3556
  if (w.length === 0) {
3557
3557
  M.fire({
3558
3558
  title: "多语言翻译",
@@ -3593,10 +3593,10 @@ const Ht = {
3593
3593
  }
3594
3594
  });
3595
3595
  }, _ = () => {
3596
- t.request && typeof t.request == "function" ? S() : I();
3596
+ t.request && typeof t.request == "function" ? S() : B();
3597
3597
  };
3598
3598
  return to(() => {
3599
- r(), l(), window.addEventListener("message", f), L();
3599
+ r(), l(), window.addEventListener("message", h), L();
3600
3600
  }), {
3601
3601
  currentValue: d,
3602
3602
  openModal: _
@@ -3679,41 +3679,41 @@ function yr(t) {
3679
3679
  const { locale: e = "zh-CN", messages: n = {} } = t, o = Zn(n), s = ie(e), i = ie(0), r = Ct(), l = Qn() && r && typeof r.observable == "function" ? r.observable({
3680
3680
  locale: e,
3681
3681
  messageVersion: 0
3682
- }) : null, a = () => l ? l.locale : s.value, d = (f) => {
3683
- s.value = f, l && (l.locale = f);
3684
- }, u = () => {
3682
+ }) : null, a = () => l ? l.locale : s.value, d = (h) => {
3683
+ s.value = h, l && (l.locale = h);
3684
+ }, p = () => {
3685
3685
  i.value += 1, l && (l.messageVersion += 1);
3686
- }, h = {
3686
+ }, u = {
3687
3687
  // 当前语言 (兼容 Vue 3 的 .value 访问)
3688
3688
  locale: {
3689
3689
  get value() {
3690
3690
  return a();
3691
3691
  },
3692
- set value(f) {
3693
- d(f);
3692
+ set value(h) {
3693
+ d(h);
3694
3694
  }
3695
3695
  },
3696
3696
  // 翻译函数(支持嵌套 key 的点号访问)
3697
- t(f, x, L) {
3697
+ t(h, x, L) {
3698
3698
  const S = Xn(x, L);
3699
3699
  x = S.defaultValue, L = S.values, i.value, l && l.messageVersion;
3700
- const I = a();
3701
- if (I === "zh-CN" && !f.startsWith("i.") && !f.startsWith("pro."))
3702
- return pe(x || f, L);
3703
- const _ = Ft(o, I);
3704
- let w = _[f];
3705
- return w === void 0 && f.includes(".") && (w = f.split(".").reduce((v, k) => v && typeof v == "object" ? v[k] : void 0, _)), w != null && w !== f ? pe(w, L) : pe(x || f, L);
3700
+ const B = a();
3701
+ if (B === "zh-CN" && !h.startsWith("i.") && !h.startsWith("pro."))
3702
+ return pe(x || h, L);
3703
+ const _ = Ft(o, B);
3704
+ let w = _[h];
3705
+ return w === void 0 && h.includes(".") && (w = h.split(".").reduce((v, k) => v && typeof v == "object" ? v[k] : void 0, _)), w != null && w !== h ? pe(w, L) : pe(x || h, L);
3706
3706
  },
3707
3707
  // 设置某个语言的所有消息
3708
- setLocaleMessage(f, x) {
3709
- return o[ge(f)] = { ...x }, u(), o[ge(f)];
3708
+ setLocaleMessage(h, x) {
3709
+ return o[ge(h)] = { ...x }, p(), o[ge(h)];
3710
3710
  },
3711
3711
  // 获取某个语言的消息
3712
- getLocaleMessage(f) {
3713
- return Ft(o, f);
3712
+ getLocaleMessage(h) {
3713
+ return Ft(o, h);
3714
3714
  }
3715
3715
  };
3716
- return h.global = h, h;
3716
+ return u.global = u, u;
3717
3717
  }
3718
3718
  const Jn = st.create({
3719
3719
  timeout: 8e3
@@ -3819,19 +3819,19 @@ class J {
3819
3819
  userCode: l,
3820
3820
  loginRouteName: a,
3821
3821
  login: d,
3822
- keyboard: u,
3823
- locale: h,
3824
- env: f,
3822
+ keyboard: p,
3823
+ locale: u,
3824
+ env: h,
3825
3825
  dev: x,
3826
3826
  i18nTokenRequest: L,
3827
3827
  auth: S
3828
3828
  } = e;
3829
- this.env = f || "local", this.baseUrl = Kt({ env: f, dev: x }), this.i18nTokenRequest = L || null, this.baseToken = i || (E.get("I18N_CONFIG") || {}).token || E.get("token"), this.token = this.baseToken, this.auth = S || null, this.authInfo = {
3829
+ this.env = h || "local", this.baseUrl = Kt({ env: h, dev: x }), this.i18nTokenRequest = L || null, this.baseToken = i || (E.get("I18N_CONFIG") || {}).token || E.get("token"), this.token = this.baseToken, this.auth = S || null, this.authInfo = {
3830
3830
  appCode: o,
3831
3831
  orgCode: r || "",
3832
3832
  userCode: l || ""
3833
- }, this.getRequestToken = this.getRequestToken.bind(this), this.requestAuthIdentity = null, this.tokenResolveVersion = 0, this.manualAuthScope = Xe(this.authInfo) || (i ? ot(i) : ""), this.authUnsubscribe = null, this.authVersion = 0, this.languageVersion = 0, this.activeCacheScope = this.manualAuthScope || "guest", this.loadI18n = !0, this.appCode = o, this.router = n, this.locale = this.resolveInitialLocale(h), this._isRTL = Ee(this.locale), this.persistI18nConfig(), this.name = "", this.messages = Zn(s || {}), this.translationKeys = [], this.translationKeySet = /* @__PURE__ */ new Set(), this.loginRouteName = a || "login", this.login = d, this.loginTranslationKeys = [], this.keyboard = u || "ctrl+shift+l", this.vueInstances = /* @__PURE__ */ new Set(), this.vueApps = /* @__PURE__ */ new Set(), this.editKeyboard = e.editKeyboard || "ctrl+shift+e", this.applyAuthState(this.resolveAuthState(), { silent: !0 }), this.initI18n(e), this.router && this.initRouterGuards(), xt.bind(this.keyboard, (I) => {
3834
- if (I.preventDefault(), this.name === this.loginRouteName)
3833
+ }, this.getRequestToken = this.getRequestToken.bind(this), this.requestAuthIdentity = null, this.tokenResolveVersion = 0, this.manualAuthScope = Xe(this.authInfo) || (i ? ot(i) : ""), this.authUnsubscribe = null, this.authVersion = 0, this.languageVersion = 0, this.activeCacheScope = this.manualAuthScope || "guest", this.loadI18n = !0, this.appCode = o, this.router = n, this.locale = this.resolveInitialLocale(u), this._isRTL = Ee(this.locale), this.persistI18nConfig(), this.name = "", this.messages = Zn(s || {}), this.translationKeys = [], this.translationKeySet = /* @__PURE__ */ new Set(), this.loginRouteName = a || "login", this.login = d, this.loginTranslationKeys = [], this.keyboard = p || "ctrl+shift+l", this.vueInstances = /* @__PURE__ */ new Set(), this.vueApps = /* @__PURE__ */ new Set(), this.editKeyboard = e.editKeyboard || "ctrl+shift+e", this.applyAuthState(this.resolveAuthState(), { silent: !0 }), this.initI18n(e), this.router && this.initRouterGuards(), xt.bind(this.keyboard, (B) => {
3834
+ if (B.preventDefault(), this.name === this.loginRouteName)
3835
3835
  return;
3836
3836
  const _ = Array.from(this.translationKeySet);
3837
3837
  this.translationKeys = Array.from(
@@ -3888,8 +3888,8 @@ class J {
3888
3888
  this.configInstance && (this.configInstance.destroy(), this.configInstance = null);
3889
3889
  }
3890
3890
  });
3891
- }), xt.bind(this.editKeyboard, (I) => {
3892
- I.preventDefault(), cr.toggle();
3891
+ }), xt.bind(this.editKeyboard, (B) => {
3892
+ B.preventDefault(), cr.toggle();
3893
3893
  }), this.setupLanguageChangeListener(), this.setupAuthListener(), this.setupMessageListener();
3894
3894
  }
3895
3895
  /**
@@ -3925,8 +3925,8 @@ class J {
3925
3925
  });
3926
3926
  }
3927
3927
  resolveAuthState() {
3928
- var u, h, f;
3929
- const e = this.auth || {}, n = oe(e.getToken) ?? "", o = oe(e.getScope) ?? oe(e.getUserScope) ?? "", s = oe(e.getAppCode) ?? ((u = this.authInfo) == null ? void 0 : u.appCode) ?? this.appCode, i = oe(e.getOrgCode) ?? ((h = this.authInfo) == null ? void 0 : h.orgCode) ?? "", r = oe(e.getUserCode) ?? ((f = this.authInfo) == null ? void 0 : f.userCode) ?? "", l = Xe({ appCode: s, orgCode: i, userCode: r }), a = typeof e.isAuthenticated == "function" ? !!e.isAuthenticated() : !!n || !!(this.i18nTokenRequest && l), d = a ? String(
3928
+ var p, u, h;
3929
+ const e = this.auth || {}, n = oe(e.getToken) ?? "", o = oe(e.getScope) ?? oe(e.getUserScope) ?? "", s = oe(e.getAppCode) ?? ((p = this.authInfo) == null ? void 0 : p.appCode) ?? this.appCode, i = oe(e.getOrgCode) ?? ((u = this.authInfo) == null ? void 0 : u.orgCode) ?? "", r = oe(e.getUserCode) ?? ((h = this.authInfo) == null ? void 0 : h.userCode) ?? "", l = Xe({ appCode: s, orgCode: i, userCode: r }), a = typeof e.isAuthenticated == "function" ? !!e.isAuthenticated() : !!n || !!(this.i18nTokenRequest && l), d = a ? String(
3930
3930
  o || ot(n) || l || this.manualAuthScope || "user"
3931
3931
  ) : "guest";
3932
3932
  return {
@@ -4119,21 +4119,21 @@ class J {
4119
4119
  if (typeof d == "function" && d.toString().includes("import("))
4120
4120
  try {
4121
4121
  d = await d(), d = d.default;
4122
- } catch (h) {
4123
- console.error("加载异步组件时出错:", h), o();
4122
+ } catch (u) {
4123
+ console.error("加载异步组件时出错:", u), o();
4124
4124
  return;
4125
4125
  }
4126
- const u = Vt(d);
4127
- this.loginTranslationKeys = u;
4126
+ const p = Vt(d);
4127
+ this.loginTranslationKeys = p;
4128
4128
  }
4129
4129
  if (e.matched.length > 0)
4130
4130
  try {
4131
4131
  const d = [];
4132
- for (const u of e.matched) {
4133
- let h = (a = u.components) == null ? void 0 : a.default;
4134
- if (typeof h == "function" && h.toString().includes("import(") && (h = await h(), h = h.default), h) {
4135
- const f = Vt(h);
4136
- d.push(...f);
4132
+ for (const p of e.matched) {
4133
+ let u = (a = p.components) == null ? void 0 : a.default;
4134
+ if (typeof u == "function" && u.toString().includes("import(") && (u = await u(), u = u.default), u) {
4135
+ const h = Vt(u);
4136
+ d.push(...h);
4137
4137
  }
4138
4138
  }
4139
4139
  this.translationKeys = d;
@@ -4168,22 +4168,20 @@ class J {
4168
4168
  }), this.keyValueMap = {}, globalThis.__I18N_ALL_KEYS__ = /* @__PURE__ */ new Set();
4169
4169
  const n = this;
4170
4170
  globalThis.$t = (o, s, i) => {
4171
- var h, f;
4171
+ var h, x;
4172
4172
  const r = Xn(s, i);
4173
4173
  if (s = r.defaultValue, i = r.values, typeof o == "string" && (n.translationKeySet.add(o), globalThis.__I18N_ALL_KEYS__ && globalThis.__I18N_ALL_KEYS__.add(o)), n.i18n.global.locale.value === "zh-CN" && typeof o == "string" && !o.startsWith("i.") && !o.startsWith("pro."))
4174
4174
  return pe(s || o, i);
4175
- const a = (h = n.router) == null ? void 0 : h.currentRoute, d = (f = (a == null ? void 0 : a.value) ?? a) == null ? void 0 : f.name;
4175
+ const a = (h = n.router) == null ? void 0 : h.currentRoute, d = (x = (a == null ? void 0 : a.value) ?? a) == null ? void 0 : x.name, p = () => {
4176
+ const L = `common.${o}`, S = n.i18n.t(L, void 0, i);
4177
+ return S !== L ? S : n.i18n.t(o, void 0, i);
4178
+ };
4176
4179
  let u;
4177
4180
  if (d) {
4178
- const x = `${d}.${o}`, L = n.i18n.t(x, void 0, i);
4179
- if (L !== x)
4180
- u = L;
4181
- else {
4182
- const S = `common.${o}`, I = n.i18n.t(S, void 0, i);
4183
- I !== S ? u = I : u = n.i18n.t(o, void 0, i);
4184
- }
4181
+ const L = `${d}.${o}`, S = n.i18n.t(L, void 0, i);
4182
+ S !== L ? u = S : u = p();
4185
4183
  } else
4186
- u = n.i18n.t(o, void 0, i);
4184
+ u = p();
4187
4185
  return u === o && typeof s == "string" && s && (u = s), u = pe(u, i), typeof o == "string" && typeof u == "string" && (n.keyValueMap[u] = o, globalThis.__I18N_KEY_VALUE_MAP__ || (globalThis.__I18N_KEY_VALUE_MAP__ = {}), globalThis.__I18N_KEY_VALUE_MAP__[u] = o), u;
4188
4186
  }, this.t = globalThis.$t, globalThis.$deepScan = function(o) {
4189
4187
  return o;
@@ -4338,13 +4336,13 @@ class J {
4338
4336
  if (s !== this.authVersion || i !== this.languageVersion)
4339
4337
  return !1;
4340
4338
  if (a && Array.isArray(a)) {
4341
- const d = so(a), u = b.assign(
4339
+ const d = so(a), p = b.assign(
4342
4340
  {},
4343
4341
  l,
4344
4342
  b.get(this.messages, e),
4345
4343
  d
4346
4344
  );
4347
- this.i18n.global.setLocaleMessage(e, u);
4345
+ this.i18n.global.setLocaleMessage(e, p);
4348
4346
  } else {
4349
4347
  const d = b.assign(
4350
4348
  {},