@das-fed/upf-utils 6.4.0-dev.248 → 6.4.0-dev.249

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/api-services/modules/authentication/es5.js +1088 -1079
  2. package/api-services/modules/authentication/index.js +897 -883
  3. package/api-services/modules/authentication/index.js.gz +0 -0
  4. package/api-services/modules/bems/es5.js +1118 -1106
  5. package/api-services/modules/bems/index.js +923 -905
  6. package/api-services/modules/bems/index.js.gz +0 -0
  7. package/api-services/modules/contract/es5.js +1088 -1079
  8. package/api-services/modules/contract/index.js +897 -883
  9. package/api-services/modules/contract/index.js.gz +0 -0
  10. package/api-services/modules/duty-manage/es5.js +1048 -1058
  11. package/api-services/modules/duty-manage/index.js +858 -872
  12. package/api-services/modules/duty-manage/index.js.gz +0 -0
  13. package/api-services/modules/es5.js +976 -973
  14. package/api-services/modules/index.js +733 -729
  15. package/api-services/modules/index.js.gz +0 -0
  16. package/api-services/modules/iot/es5.js +868 -871
  17. package/api-services/modules/iot/index.js +681 -685
  18. package/api-services/modules/iot/index.js.gz +0 -0
  19. package/api-services/modules/justauth/es5.js +1104 -1116
  20. package/api-services/modules/justauth/index.js +903 -921
  21. package/api-services/modules/justauth/index.js.gz +0 -0
  22. package/api-services/modules/knowledge/es5.js +1114 -1102
  23. package/api-services/modules/knowledge/index.js +920 -902
  24. package/api-services/modules/knowledge/index.js.gz +0 -0
  25. package/api-services/modules/link/es5.js +1102 -1114
  26. package/api-services/modules/link/index.js +902 -920
  27. package/api-services/modules/link/index.js.gz +0 -0
  28. package/api-services/modules/permission/es5.js +849 -852
  29. package/api-services/modules/permission/index.js +661 -665
  30. package/api-services/modules/permission/index.js.gz +0 -0
  31. package/api-services/modules/supplier/es5.js +1093 -1081
  32. package/api-services/modules/supplier/index.js +901 -883
  33. package/api-services/modules/supplier/index.js.gz +0 -0
  34. package/api-services/modules/systemConfiguration/es5.js +815 -817
  35. package/api-services/modules/systemConfiguration/index.js +636 -640
  36. package/api-services/modules/systemConfiguration/index.js.gz +0 -0
  37. package/api-services/modules/tool/es5.js +1102 -1114
  38. package/api-services/modules/tool/index.js +902 -920
  39. package/api-services/modules/tool/index.js.gz +0 -0
  40. package/common-info/getPermissionMethod/es5.js +856 -859
  41. package/common-info/getPermissionMethod/index.js +665 -669
  42. package/common-info/getPermissionMethod/index.js.gz +0 -0
  43. package/common-tools/timezone-format/es5.js +315 -283
  44. package/common-tools/timezone-format/index.js +262 -204
  45. package/common-tools/timezone-format/index.js.gz +0 -0
  46. package/create-api-service/es5.js +1078 -1090
  47. package/create-api-service/index.js +887 -905
  48. package/create-api-service/index.js.gz +0 -0
  49. package/esm-map.json +13 -0
  50. package/package.json +3 -3
  51. package/theme/bridge.d.ts +42 -0
  52. package/theme/es5.d.ts +8 -41
  53. package/theme/es5.js +799 -489
  54. package/theme/index.d.ts +8 -41
  55. package/theme/index.js +537 -390
  56. package/theme/index.js.gz +0 -0
  57. package/theme/source-variables.d.ts +35 -0
@@ -1,9 +1,9 @@
1
1
  import f from "dayjs";
2
- import tt from "dayjs/plugin/utc";
3
- import et from "dayjs/plugin/timezone";
2
+ import rt from "dayjs/plugin/utc";
3
+ import at from "dayjs/plugin/timezone";
4
4
  import "@das-fed/upf-utils/config";
5
- const P = "/api/admin/basic-application/sys-info/v1/license/time-zone-packed-data";
6
- function nt() {
5
+ const G = "/api/admin/basic-application/sys-info/v1/license/time-zone-packed-data";
6
+ function st() {
7
7
  if (typeof localStorage > "u")
8
8
  return null;
9
9
  try {
@@ -12,18 +12,38 @@ function nt() {
12
12
  return null;
13
13
  }
14
14
  }
15
- function ot() {
16
- const t = nt();
15
+ function it() {
16
+ const t = st();
17
17
  if (!(t == null || t === ""))
18
18
  return t.trim().startsWith("Bearer ") ? t.trim() : `Bearer ${t.trim()}`;
19
19
  }
20
- function $(t = {}) {
21
- const e = t.authorization !== void 0 ? t.authorization === "" || t.authorization == null ? void 0 : t.authorization : ot(), n = { ...t.headers || {} };
20
+ function Y(t = {}) {
21
+ const e = t.authorization !== void 0 ? t.authorization === "" || t.authorization == null ? void 0 : t.authorization : it(), n = { ...t.headers || {} };
22
22
  if (e != null && e !== "" && (n.Authorization = e), Object.keys(n).length !== 0)
23
23
  return { headers: n };
24
24
  }
25
- let L = null, I = null;
26
- function _(t) {
25
+ let L = null, w = null;
26
+ const O = [
27
+ "utc",
28
+ "uct",
29
+ "zulu",
30
+ "universal",
31
+ "etc/utc",
32
+ "etc/uct",
33
+ "etc/zulu",
34
+ "etc/universal",
35
+ "gmt",
36
+ "gmt0",
37
+ "gmt+0",
38
+ "gmt-0",
39
+ "greenwich",
40
+ "etc/gmt",
41
+ "etc/gmt0",
42
+ "etc/gmt+0",
43
+ "etc/gmt-0",
44
+ "etc/greenwich"
45
+ ], ct = { u: [1 / 0], o: [0] };
46
+ function R(t) {
27
47
  if (!t || typeof t != "object")
28
48
  throw new Error("Invalid IANA response: expected an object");
29
49
  const e = t;
@@ -36,7 +56,7 @@ function _(t) {
36
56
  links: Array.isArray(n) ? n : []
37
57
  };
38
58
  }
39
- async function rt(t, e) {
59
+ async function ft(t, e) {
40
60
  if (typeof fetch != "function")
41
61
  throw new Error("fetch is not available. Pass preloadFromApi options.fetchJson.");
42
62
  const n = await fetch(t, e);
@@ -44,127 +64,143 @@ async function rt(t, e) {
44
64
  throw new Error(`IANA request failed: ${n.status} ${n.statusText}`);
45
65
  return n.json();
46
66
  }
47
- function V(t) {
48
- return I = _(t), L = mt(I), I;
67
+ function H(t) {
68
+ return w = R(t), L = It(w), w;
49
69
  }
50
- function at() {
51
- return I;
70
+ function ut() {
71
+ return w;
52
72
  }
53
- async function st(t = {}) {
54
- const e = t.url ?? P, n = $({
73
+ async function lt(t = {}) {
74
+ const e = t.url ?? G, n = Y({
55
75
  authorization: t.authorization,
56
76
  headers: t.headers
57
- }), o = await (t.fetchJson ?? rt)(e, n), a = t.parseResponse ? t.parseResponse(o) : _(o);
58
- return V(a);
77
+ }), o = await (t.fetchJson ?? ft)(e, n), a = t.parseResponse ? t.parseResponse(o) : R(o);
78
+ return H(a);
59
79
  }
60
- function it() {
61
- L = null, I = null;
80
+ function mt() {
81
+ L = null, w = null;
62
82
  }
63
- function F(t) {
83
+ function j(t) {
64
84
  return t > 96 ? t - 87 : t > 64 ? t - 29 : t - 48;
65
85
  }
66
- function ct(t) {
86
+ function dt(t) {
67
87
  let e = 1, n = 0, r = 0, o = 1;
68
- const a = t.split("."), c = a[0], i = a[1] || "";
88
+ const a = t.split("."), i = a[0], c = a[1] || "";
69
89
  t.charCodeAt(0) === 45 && (e = -1);
70
- for (let s = 0; s < c.length; s++) {
71
- const l = c.charCodeAt(s);
72
- l !== 45 && (n = 60 * n + F(l));
90
+ for (let s = 0; s < i.length; s++) {
91
+ const u = i.charCodeAt(s);
92
+ u !== 45 && (n = 60 * n + j(u));
73
93
  }
74
- for (let s = 0; s < i.length; s++)
75
- o = o / 60, r += F(i.charCodeAt(s)) * o;
94
+ for (let s = 0; s < c.length; s++)
95
+ o = o / 60, r += j(c.charCodeAt(s)) * o;
76
96
  return (n + r) * e;
77
97
  }
78
98
  function v(t) {
79
99
  const e = [];
80
100
  for (const n of t)
81
- e.push(ct(n));
101
+ e.push(dt(n));
82
102
  return e;
83
103
  }
84
- function ft(t) {
104
+ function N(t) {
105
+ const e = t.trim();
106
+ return e ? e.split(" ") : [];
107
+ }
108
+ function ht(t) {
85
109
  let e = 0;
86
110
  const n = [];
87
111
  for (const r of t)
88
112
  e += r, n.push(Math.round(e * 6e4));
89
113
  return n.push(1 / 0), n;
90
114
  }
91
- function lt(t, e) {
115
+ function Tt(t, e) {
92
116
  const n = [];
93
117
  for (const r of e)
94
118
  n.push(t[r]);
95
119
  return n;
96
120
  }
97
- function ut(t) {
121
+ function b(t) {
122
+ return typeof t == "string" ? t.trim().toLowerCase() : "";
123
+ }
124
+ function gt(t) {
98
125
  const e = t.split("|");
99
126
  if (e.length < 5)
100
127
  throw new Error("Invalid packed zone format");
101
- const n = e[0].toLowerCase(), r = v(e[2].split(" ")), o = v(e[3].split("")), a = ft(v(e[4].split(" "))), c = lt(r, o);
128
+ const n = b(e[0]), r = v(N(e[2])), o = v(e[3].split("")), a = ht(v(N(e[4]))), i = Tt(r, o);
102
129
  return {
103
130
  name: n,
104
131
  rule: {
105
132
  u: a,
106
- o: c
133
+ o: i
107
134
  }
108
135
  };
109
136
  }
110
- function mt(t) {
137
+ function yt(t, e, n) {
138
+ const r = b(e), o = b(n);
139
+ if (!r || !o) return;
140
+ const a = t[r], i = t[o];
141
+ a && !i ? t[o] = a : i && !a && (t[r] = i);
142
+ }
143
+ function pt(t) {
144
+ const e = O.map((n) => t[n]).find(Boolean) || ct;
145
+ O.forEach((n) => {
146
+ t[n] || (t[n] = e);
147
+ });
148
+ }
149
+ function It(t) {
111
150
  if (!t || !Array.isArray(t.zones))
112
151
  throw new TypeError("packed iana data must contain zones array");
113
152
  const e = {};
114
153
  for (const r of t.zones) {
115
- const o = ut(r);
154
+ const o = gt(r);
116
155
  e[o.name] = o.rule;
117
156
  }
118
157
  const n = t.links || [];
119
158
  for (const r of n) {
120
159
  const o = r.split("|");
121
- if (o.length < 2)
122
- continue;
123
- const a = o[0].toLowerCase(), c = o[1].toLowerCase(), i = e[c];
124
- i && (e[a] = i);
160
+ o.length < 2 || yt(e, o[0], o[1]);
125
161
  }
126
- return e;
162
+ return pt(e), e;
127
163
  }
128
- function dt() {
164
+ function Dt() {
129
165
  if (!L)
130
166
  throw new Error(
131
167
  "IANA data not loaded. Await dayjsTimezoneIanaPlugin.preloadFromApi({ url: ... }) before dayjs.extend(dayjsTimezoneIanaPlugin)."
132
168
  );
133
169
  return L;
134
170
  }
135
- function ht(t, e, n) {
136
- const r = typeof e == "string" ? e.toLowerCase() : "", o = n[r];
171
+ function wt(t, e, n) {
172
+ const r = b(e), o = n[r];
137
173
  if (o === void 0)
138
174
  throw Error("Unknown Time Zone " + e);
139
- const a = o.o, c = o.u, i = c.length - 1;
140
- for (let s = 0; s < i; s++) {
141
- let l = a[s];
142
- const u = a[s && s - 1];
143
- if (l > u && (l = u), t < c[s] - l * 6e4)
175
+ const a = o.o, i = o.u, c = i.length - 1;
176
+ for (let s = 0; s < c; s++) {
177
+ let u = a[s];
178
+ const l = a[s && s - 1];
179
+ if (u > l && (u = l), t < i[s] - u * 6e4)
144
180
  return a[s];
145
181
  }
146
- return a[i];
182
+ return a[c];
147
183
  }
148
- const Tt = (t, e, n) => {
149
- var s, l;
184
+ const zt = (t, e, n) => {
185
+ var s, u;
150
186
  let r = "";
151
- const o = n.tz, a = (s = o == null ? void 0 : o.guess) == null ? void 0 : s.bind(o), c = (l = o == null ? void 0 : o.setDefault) == null ? void 0 : l.bind(o), i = (u, h, p) => {
152
- const Z = p || h || r, T = p ? h : void 0;
153
- return (typeof n.utc == "function" ? n.utc(u, T) : n(u, T).utc()).tz(Z);
187
+ const o = n.tz, a = (s = o == null ? void 0 : o.guess) == null ? void 0 : s.bind(o), i = (u = o == null ? void 0 : o.setDefault) == null ? void 0 : u.bind(o), c = (l, h, g) => {
188
+ const Z = g || h || r, T = g ? h : void 0;
189
+ return (typeof n.utc == "function" ? n.utc(l, T) : n(l, T).utc()).tz(Z);
154
190
  };
155
- o && Object.assign(i, o), i.setDefault = (u) => {
156
- r = u, c == null || c(u);
157
- }, i.guess = () => a ? a() : typeof Intl < "u" && typeof Intl.DateTimeFormat == "function" ? Intl.DateTimeFormat().resolvedOptions().timeZone || r || "UTC" : r || "UTC", n.tz = i, e.prototype.tz = function(u = r, h) {
158
- var g;
159
- const p = u || ((g = i.guess) == null ? void 0 : g.call(i)) || "UTC", Z = this.utc().valueOf(), T = ht(Z, p, dt());
191
+ o && Object.assign(c, o), c.setDefault = (l) => {
192
+ r = l, i == null || i(l);
193
+ }, c.guess = () => a ? a() : typeof Intl < "u" && typeof Intl.DateTimeFormat == "function" ? Intl.DateTimeFormat().resolvedOptions().timeZone || r || "UTC" : r || "UTC", n.tz = c, e.prototype.tz = function(l = r, h) {
194
+ var y;
195
+ const g = l || ((y = c.guess) == null ? void 0 : y.call(c)) || "UTC", Z = this.utc().valueOf(), T = wt(Z, g, Dt());
160
196
  return this.utcOffset(-T, h);
161
197
  };
162
- }, m = Tt;
163
- m.preloadFromApi = st;
164
- m.preloadFromData = V;
165
- m.getCachedPackedData = at;
166
- m.clearIanaCache = it;
167
- function yt(t) {
198
+ }, m = zt;
199
+ m.preloadFromApi = lt;
200
+ m.preloadFromData = H;
201
+ m.getCachedPackedData = ut;
202
+ m.clearIanaCache = mt;
203
+ function At(t) {
168
204
  if (!t || typeof t != "object")
169
205
  throw new Error("Invalid IANA response: expected an object");
170
206
  const e = t;
@@ -177,14 +213,14 @@ function yt(t) {
177
213
  links: Array.isArray(n) ? n : []
178
214
  };
179
215
  }
180
- function Y(t, e) {
216
+ function J(t, e) {
181
217
  if (!t || typeof t.tz != "object" || typeof t.tz.load != "function")
182
218
  throw new Error("moment.tz.load is missing. Import moment-timezone before calling loadIanaData.");
183
219
  if (!e || !Array.isArray(e.zones))
184
220
  throw new Error("Invalid packed IANA data: zones must be an array");
185
221
  t.tz.load(e);
186
222
  }
187
- async function pt(t, e) {
223
+ async function Zt(t, e) {
188
224
  if (typeof fetch != "function")
189
225
  throw new Error("fetch is not available. Pass loadIanaFromApi options.fetchJson in Node or polyfill fetch.");
190
226
  const n = await fetch(t, e);
@@ -192,32 +228,54 @@ async function pt(t, e) {
192
228
  throw new Error(`IANA request failed: ${n.status} ${n.statusText}`);
193
229
  return n.json();
194
230
  }
195
- async function O(t, e, n) {
196
- let r = P, o = {};
231
+ async function _(t, e, n) {
232
+ let r = G, o = {};
197
233
  typeof e == "string" ? (r = e, o = n ?? {}) : e != null && (o = e);
198
- const a = $({
234
+ const a = Y({
199
235
  authorization: o.authorization,
200
236
  headers: o.headers
201
- }), i = await (o.fetchJson ?? pt)(r, a), s = o.parseResponse ? o.parseResponse(i) : yt(i);
202
- return Y(t, s), s;
237
+ }), c = await (o.fetchJson ?? Zt)(r, a), s = o.parseResponse ? o.parseResponse(c) : At(c);
238
+ return J(t, s), s;
203
239
  }
204
- f.extend(tt);
205
- f.extend(et);
206
- const D = "zh-CN", gt = "YYYY.MM.DD HH:mm:ss", S = "YYYY-MM-DD HH:mm:ss", H = "YYYY-MM-DD HH:mm", M = "UTC", j = {
240
+ f.extend(rt);
241
+ f.extend(at);
242
+ const D = "zh-CN", Lt = "YYYY.MM.DD HH:mm:ss", S = "YYYY-MM-DD HH:mm:ss", B = "YYYY-MM-DD HH:mm", F = "UTC", x = {
207
243
  zh: "夏令时",
208
244
  default: "DST"
209
- }, y = /* @__PURE__ */ new Set();
210
- var U, N;
211
- const Dt = (N = (U = f.tz) == null ? void 0 : U.guess) == null ? void 0 : N.bind(f.tz);
212
- let b = !1;
213
- const w = (t) => (t || "").trim(), It = () => {
245
+ }, bt = [
246
+ "UTC",
247
+ "UCT",
248
+ "Zulu",
249
+ "Universal",
250
+ "Etc/UTC",
251
+ "Etc/UCT",
252
+ "Etc/Zulu",
253
+ "Etc/Universal",
254
+ "GMT",
255
+ "GMT0",
256
+ "GMT+0",
257
+ "GMT-0",
258
+ "Greenwich",
259
+ "Etc/GMT",
260
+ "Etc/GMT0",
261
+ "Etc/GMT+0",
262
+ "Etc/GMT-0",
263
+ "Etc/Greenwich"
264
+ ], p = /* @__PURE__ */ new Set();
265
+ var $, V;
266
+ const Et = (V = ($ = f.tz) == null ? void 0 : $.guess) == null ? void 0 : V.bind(f.tz);
267
+ let E = !1;
268
+ const I = (t) => (t || "").trim(), U = (t) => {
269
+ const e = I(t);
270
+ e && p.add(e);
271
+ }, kt = () => bt.forEach(U), St = () => {
214
272
  if (!(typeof Intl > "u" || typeof Intl.DateTimeFormat != "function"))
215
273
  try {
216
274
  return Intl.DateTimeFormat().resolvedOptions().timeZone;
217
275
  } catch {
218
276
  return;
219
277
  }
220
- }, wt = (t) => {
278
+ }, Mt = (t) => {
221
279
  if (!t) return !1;
222
280
  if (typeof Intl > "u" || typeof Intl.DateTimeFormat != "function") return !0;
223
281
  try {
@@ -226,214 +284,214 @@ const w = (t) => (t || "").trim(), It = () => {
226
284
  return !1;
227
285
  }
228
286
  }, z = (t) => {
229
- const e = w(t);
230
- return e ? y.size ? y.has(e) : wt(e) : !1;
231
- }, C = (t) => (y.clear(), t.zones.forEach((e) => {
287
+ const e = I(t);
288
+ return e ? p.size ? p.has(e) : Mt(e) : !1;
289
+ }, M = (t) => (p.clear(), t.zones.forEach((e) => {
232
290
  const n = e.split("|")[0];
233
- n && y.add(n);
291
+ U(n);
234
292
  }), (t.links || []).forEach((e) => {
235
293
  e.split("|").forEach((n) => {
236
- n && y.add(n);
294
+ U(n);
237
295
  });
238
- }), Array.from(y)), Yt = () => Array.from(y), Ht = async (t, e = {}) => {
239
- const n = m.preloadFromData(t), r = C(n);
240
- return b || (f.extend(m), b = !0), J(e.defaultTimeZone), { data: n, knownTimeZones: r };
241
- }, Jt = async (t = {}) => {
242
- const e = await m.preloadFromApi(t), n = C(e);
243
- return b || (f.extend(m), b = !0), J(t.defaultTimeZone), { data: e, knownTimeZones: n };
244
- }, Rt = (t, e) => (Y(t, e), C(e), e), Bt = async (t, e = {}) => {
245
- const { url: n, ...r } = e, o = n ? await O(t, n, r) : await O(t, r);
246
- return C(o), o;
247
- }, zt = () => {
296
+ }), kt(), Array.from(p)), Qt = () => Array.from(p), Xt = async (t, e = {}) => {
297
+ const n = m.preloadFromData(t), r = M(n);
298
+ return E || (f.extend(m), E = !0), W(e.defaultTimeZone), { data: n, knownTimeZones: r };
299
+ }, te = async (t = {}) => {
300
+ const e = await m.preloadFromApi(t), n = M(e);
301
+ return E || (f.extend(m), E = !0), W(t.defaultTimeZone), { data: e, knownTimeZones: n };
302
+ }, ee = (t, e) => (J(t, e), M(e), e), ne = async (t, e = {}) => {
303
+ const { url: n, ...r } = e, o = n ? await _(t, n, r) : await _(t, r);
304
+ return M(o), o;
305
+ }, Ct = () => {
248
306
  var n;
249
- const t = (n = f.tz) == null ? void 0 : n.guess, e = typeof t == "function" ? t : Dt;
307
+ const t = (n = f.tz) == null ? void 0 : n.guess, e = typeof t == "function" ? t : Et;
250
308
  try {
251
309
  return e == null ? void 0 : e();
252
310
  } catch {
253
311
  return;
254
312
  }
255
- }, At = () => {
313
+ }, vt = () => {
256
314
  let t = "";
257
315
  try {
258
316
  t = typeof sessionStorage > "u" ? "" : sessionStorage.getItem("timeZone") || "";
259
317
  } catch {
260
318
  t = "";
261
319
  }
262
- const e = t || zt() || It();
263
- return z(e) ? w(e) : M;
320
+ const e = t || Ct() || St();
321
+ return z(e) ? I(e) : F;
264
322
  }, d = (t) => {
265
- const e = w(t) || At();
266
- return z(e) ? e : M;
267
- }, J = (t) => {
323
+ const e = I(t) || vt();
324
+ return z(e) ? e : F;
325
+ }, W = (t) => {
268
326
  var r, o;
269
- const e = w(t), n = f.tz;
270
- return e ? z(e) ? ((o = n == null ? void 0 : n.setDefault) == null || o.call(n, e), !0) : !1 : ((r = n == null ? void 0 : n.setDefault) == null || r.call(n, M), !0);
271
- }, Zt = () => {
327
+ const e = I(t), n = f.tz;
328
+ return e ? z(e) ? ((o = n == null ? void 0 : n.setDefault) == null || o.call(n, e), !0) : !1 : ((r = n == null ? void 0 : n.setDefault) == null || r.call(n, F), !0);
329
+ }, Ut = () => {
272
330
  var t;
273
331
  return typeof window < "u" && ((t = window.navigator) != null && t.language) ? window.navigator.language : D;
274
- }, Lt = (t, e = []) => {
275
- const r = t || Zt() || D, o = r.toLowerCase();
332
+ }, Ft = (t, e = []) => {
333
+ const r = t || Ut() || D, o = r.toLowerCase();
276
334
  if (!e.length)
277
335
  return o === "en" ? "en-US" : o === "zh" || o === "zh-cn" ? D : r;
278
336
  const a = e.find((s) => s.toLowerCase() === o);
279
337
  if (a) return a;
280
- const c = o.split("-")[0], i = e.find((s) => s.toLowerCase().split("-")[0] === c);
281
- return i || (c === "en" ? e.find((s) => s.toLowerCase().startsWith("en-")) || r : c === "zh" ? e.find((s) => s.toLowerCase().startsWith("zh-")) || D : r);
338
+ const i = o.split("-")[0], c = e.find((s) => s.toLowerCase().split("-")[0] === i);
339
+ return c || (i === "en" ? e.find((s) => s.toLowerCase().startsWith("en-")) || r : i === "zh" ? e.find((s) => s.toLowerCase().startsWith("zh-")) || D : r);
282
340
  }, A = (t) => {
283
341
  if (f.isDayjs(t)) return t;
284
342
  if (t == null || t === "") return f();
285
343
  const e = f(t);
286
344
  return e.isValid() ? e : f();
287
- }, k = (t) => t == null || t === "", R = (t) => f.isDayjs(t) ? t : k(t) ? f() : f(t), B = (t, e = !1) => {
288
- const n = w(t);
345
+ }, k = (t) => t == null || t === "", K = (t) => f.isDayjs(t) ? t : k(t) ? f() : f(t), q = (t, e = !1) => {
346
+ const n = I(t);
289
347
  return n ? d(n) : e ? d() : "";
290
- }, bt = (t, e) => A(t).tz(d(e)).utcOffset(), kt = (t, e, n = H) => A(t).tz(d(e)).format(n), St = (t, e) => R(t).format(e.format), W = (t, e) => {
291
- const n = e.format || S, r = B(e.timeZone, e.useClientTimeZone);
292
- if (!r) return St(t, { format: n });
348
+ }, Ot = (t, e) => A(t).tz(d(e)).utcOffset(), jt = (t, e, n = B) => A(t).tz(d(e)).format(n), Nt = (t, e) => K(t).format(e.format), Q = (t, e) => {
349
+ const n = e.format || S, r = q(e.timeZone, e.useClientTimeZone);
350
+ if (!r) return Nt(t, { format: n });
293
351
  if (e.inputMode === "local")
294
352
  return k(t) ? f().tz(r).format(n) : f.tz(t, r).format(n);
295
- const o = R(t);
353
+ const o = K(t);
296
354
  return o.isValid() ? o.tz(r).format(n) : o.format(n);
297
- }, Ct = (t) => typeof t == "function", Et = (t, e) => {
298
- var s, l;
355
+ }, _t = (t) => typeof t == "function", xt = (t, e) => {
356
+ var s, u;
299
357
  const { moment: n } = e, r = e.format || S;
300
- if (!Ct(n)) return W(t, { ...e, dateLibrary: "dayjs" });
301
- const o = k(t) ? void 0 : t, a = B(e.timeZone, e.useClientTimeZone);
358
+ if (!_t(n)) return Q(t, { ...e, dateLibrary: "dayjs" });
359
+ const o = k(t) ? void 0 : t, a = q(e.timeZone, e.useClientTimeZone);
302
360
  if (!a || typeof n.tz != "function") return n(o).format(r);
303
361
  if (e.inputMode === "local")
304
- return k(t) ? ((l = (s = n()).tz) == null ? void 0 : l.call(s, a).format(r)) || n().format(r) : n.tz(o, a).format(r);
305
- const c = n(o);
306
- return (typeof c.tz == "function" ? c.tz(a) : n.tz(o, a)).format(r);
307
- }, vt = (t, e = {}) => {
362
+ return k(t) ? ((u = (s = n()).tz) == null ? void 0 : u.call(s, a).format(r)) || n().format(r) : n.tz(o, a).format(r);
363
+ const i = n(o);
364
+ return (typeof i.tz == "function" ? i.tz(a) : n.tz(o, a)).format(r);
365
+ }, Pt = (t, e = {}) => {
308
366
  const n = typeof e == "string" ? { format: e } : e || {}, r = {
309
367
  ...n,
310
368
  format: n.format || S
311
369
  };
312
- return r.dateLibrary === "moment" ? Et(t, r) : W(t, r);
313
- }, Wt = (t, e = S, n = {}) => vt(t, { ...n, format: e }), x = (t) => String(t).padStart(2, "0"), G = (t) => `UTC${t}`, K = (t, e) => {
314
- const n = bt(t, e), r = n >= 0 ? "+" : "-", o = Math.abs(n);
315
- return `UTC${r}${x(Math.floor(o / 60))}:${x(o % 60)}`;
316
- }, Mt = (t, e = /* @__PURE__ */ new Date()) => {
370
+ return r.dateLibrary === "moment" ? xt(t, r) : Q(t, r);
371
+ }, oe = (t, e = S, n = {}) => Pt(t, { ...n, format: e }), P = (t) => String(t).padStart(2, "0"), X = (t) => `UTC${t}`, tt = (t, e) => {
372
+ const n = Ot(t, e), r = n >= 0 ? "+" : "-", o = Math.abs(n);
373
+ return `UTC${r}${P(Math.floor(o / 60))}:${P(o % 60)}`;
374
+ }, $t = (t, e = /* @__PURE__ */ new Date()) => {
317
375
  const n = t.currentUtcOffsetText || t.baseUtcOffsetText;
318
- return n ? `UTC${n}` : K(e, t.timeZoneId);
319
- }, Ft = (t, e) => {
376
+ return n ? `UTC${n}` : tt(e, t.timeZoneId);
377
+ }, Vt = (t, e) => {
320
378
  const n = t.match(/([+-]\d{1,2})(?::?(\d{2}))?/) || [];
321
379
  if (!n[1]) return e;
322
380
  const r = n[1].startsWith("-") ? "-" : "+", o = n[1].replace(/[+-]/, "").padStart(2, "0"), a = n[2] || "00";
323
381
  return `UTC${r}${o}:${a}`;
324
- }, Ot = (t, e, n) => {
382
+ }, Gt = (t, e, n) => {
325
383
  var o, a;
326
- const r = G(n.format("Z"));
384
+ const r = X(n.format("Z"));
327
385
  try {
328
- const c = Intl.DateTimeFormat.supportedLocalesOf([e])[0] || e, i = (a = (o = new Intl.DateTimeFormat(c, { timeZone: t, timeZoneName: "long" }).formatToParts(n.toDate()).find((s) => s.type === "timeZoneName")) == null ? void 0 : o.value) == null ? void 0 : a.trim();
329
- return i ? /^(gmt|utc)/i.test(i) ? Ft(i, r) : i : r;
386
+ const i = Intl.DateTimeFormat.supportedLocalesOf([e])[0] || e, c = (a = (o = new Intl.DateTimeFormat(i, { timeZone: t, timeZoneName: "long" }).formatToParts(n.toDate()).find((s) => s.type === "timeZoneName")) == null ? void 0 : o.value) == null ? void 0 : a.trim();
387
+ return c ? /^(gmt|utc)/i.test(c) ? Vt(c, r) : c : r;
330
388
  } catch {
331
389
  return r;
332
390
  }
333
- }, q = (t, e) => {
391
+ }, et = (t, e) => {
334
392
  const n = e.year();
335
393
  return Array.from(
336
394
  new Set(
337
395
  Array.from({ length: 12 }, (r, o) => {
338
- const a = `${o + 1}`.padStart(2, "0"), c = `${n}-${a}-15 12:00:00`;
339
- return f.tz(c, t).utcOffset();
396
+ const a = `${o + 1}`.padStart(2, "0"), i = `${n}-${a}-15 12:00:00`;
397
+ return f.tz(i, t).utcOffset();
340
398
  })
341
399
  )
342
400
  );
343
- }, Q = (t, e) => {
401
+ }, nt = (t, e) => {
344
402
  const n = d(t);
345
403
  if (!z(n)) return !1;
346
404
  const r = A(e).tz(n);
347
- return q(n, r).length > 1;
348
- }, E = (t, e) => {
405
+ return et(n, r).length > 1;
406
+ }, C = (t, e) => {
349
407
  const n = d(t);
350
408
  if (!z(n)) return !1;
351
- const r = A(e).tz(n), o = q(n, r);
409
+ const r = A(e).tz(n), o = et(n, r);
352
410
  return o.length <= 1 ? !1 : r.utcOffset() === Math.max(...o);
353
- }, Gt = (t, e) => E(t, e), X = (t) => {
411
+ }, re = (t, e) => C(t, e), ot = (t) => {
354
412
  if (t === 1 || t === "1") return !0;
355
413
  if (t === 0 || t === "0") return !1;
356
- }, jt = (t, e) => {
357
- const n = X(t.dynamicOffsetFlag);
358
- return typeof n == "boolean" ? n : Q(t.timeZoneId, e);
359
- }, xt = (t, e) => {
360
- const n = X(t.currentDstFlag);
361
- return typeof n == "boolean" ? n : E(t.timeZoneId, e);
362
- }, Kt = (t, e = /* @__PURE__ */ new Date()) => t.map((n) => {
363
- const r = n.tzShowName || Mt(n, e), o = jt(n, e);
414
+ }, Yt = (t, e) => {
415
+ const n = ot(t.dynamicOffsetFlag);
416
+ return typeof n == "boolean" ? n : nt(t.timeZoneId, e);
417
+ }, Rt = (t, e) => {
418
+ const n = ot(t.currentDstFlag);
419
+ return typeof n == "boolean" ? n : C(t.timeZoneId, e);
420
+ }, ae = (t, e = /* @__PURE__ */ new Date()) => t.map((n) => {
421
+ const r = n.tzShowName || $t(n, e), o = Yt(n, e);
364
422
  return {
365
423
  value: n.timeZoneId,
366
424
  zoneName: r,
367
425
  label: r,
368
426
  hasDST: o,
369
- isDST: o ? xt(n, e) : !1
427
+ isDST: o ? Rt(n, e) : !1
370
428
  };
371
- }), Ut = (t) => {
429
+ }), Ht = (t) => {
372
430
  const e = t.toLowerCase().split("-")[0];
373
- return j[e] || j.default;
374
- }, Nt = (t) => typeof t.showDaylightSavingLabel == "boolean" ? t.showDaylightSavingLabel : t.showDaylightSavingMarker ?? !0, qt = (t, e, n = {}) => {
431
+ return x[e] || x.default;
432
+ }, Jt = (t) => typeof t.showDaylightSavingLabel == "boolean" ? t.showDaylightSavingLabel : t.showDaylightSavingMarker ?? !0, se = (t, e, n = {}) => {
375
433
  const {
376
434
  showZoneLabel: r = !0,
377
435
  zoneLabel: o,
378
436
  hasDST: a,
379
- isDST: c,
380
- standardTimeLabel: i,
437
+ isDST: i,
438
+ standardTimeLabel: c,
381
439
  daylightSavingLabel: s,
382
- format: l = H
383
- } = n, u = d(e), h = kt(t, u, l), p = typeof a == "boolean" ? a : Q(u, t), T = (typeof c == "boolean" ? c : E(u, t)) ? s : i, g = p && T ? `[${T}]` : "";
384
- return r ? [h, o || K(t, u), g].filter(Boolean).join(" ") : [h, g].filter(Boolean).join(" ");
385
- }, Qt = (t = {}) => {
386
- const e = Lt(t.locale, t.supportedLocales), n = d(t.timeZone), r = A(t.value).tz(n), o = Ot(n, e, r), a = G(r.format("Z")), c = E(n, r), i = c ? Ut(e) : "", s = Nt(t), l = c && s ? `${o} - ${i}` : o;
440
+ format: u = B
441
+ } = n, l = d(e), h = jt(t, l, u), g = typeof a == "boolean" ? a : nt(l, t), T = (typeof i == "boolean" ? i : C(l, t)) ? s : c, y = g && T ? `[${T}]` : "";
442
+ return r ? [h, o || tt(t, l), y].filter(Boolean).join(" ") : [h, y].filter(Boolean).join(" ");
443
+ }, ie = (t = {}) => {
444
+ const e = Ft(t.locale, t.supportedLocales), n = d(t.timeZone), r = A(t.value).tz(n), o = Gt(n, e, r), a = X(r.format("Z")), i = C(n, r), c = i ? Ht(e) : "", s = Jt(t), u = i && s ? `${o} - ${c}` : o;
387
445
  return {
388
- formattedValue: r.format(t.format || gt),
446
+ formattedValue: r.format(t.format || Lt),
389
447
  locale: e,
390
448
  timeZone: n,
391
449
  timeZoneName: o,
392
- timeZoneLabel: l,
450
+ timeZoneLabel: u,
393
451
  offsetLabel: a,
394
452
  offsetMinutes: r.utcOffset(),
395
- isDaylightSavingTime: c,
396
- daylightSavingLabel: i
453
+ isDaylightSavingTime: i,
454
+ daylightSavingLabel: c
397
455
  };
398
456
  };
399
457
  export {
400
- P as TIME_ZONE_PACKED_DATA_URL,
401
- Ht as applyDayjsIanaTimeZoneData,
402
- Rt as applyMomentIanaTimeZoneData,
403
- _ as assertPackedIanaData,
404
- yt as assertPackedIanaTzData,
405
- $ as buildIanaFetchInit,
406
- Kt as buildTimeZoneDisplayOptions,
407
- it as clearDayjsIanaCache,
408
- mt as createIanaDbFromPackedData,
458
+ G as TIME_ZONE_PACKED_DATA_URL,
459
+ Xt as applyDayjsIanaTimeZoneData,
460
+ ee as applyMomentIanaTimeZoneData,
461
+ R as assertPackedIanaData,
462
+ At as assertPackedIanaTzData,
463
+ Y as buildIanaFetchInit,
464
+ ae as buildTimeZoneDisplayOptions,
465
+ mt as clearDayjsIanaCache,
466
+ It as createIanaDbFromPackedData,
409
467
  m as dayjsTimezoneIanaPlugin,
410
- qt as formatClientLocalDateTimeLine,
411
- kt as formatInTimeZone,
412
- vt as formatLocalDateTime,
413
- K as formatTimeZoneOffsetLabel,
414
- nt as getAccessTokenFromLocalStorage,
415
- at as getCachedDayjsPackedIanaData,
416
- At as getClientTimeZone,
417
- ot as getDefaultIanaAuthorization,
418
- Yt as getKnownTimeZoneIds,
419
- Qt as getTimeZoneDisplayInfo,
420
- bt as getZoneUtcOffset,
421
- Gt as isDaylightSavingTime,
468
+ se as formatClientLocalDateTimeLine,
469
+ jt as formatInTimeZone,
470
+ Pt as formatLocalDateTime,
471
+ tt as formatTimeZoneOffsetLabel,
472
+ st as getAccessTokenFromLocalStorage,
473
+ ut as getCachedDayjsPackedIanaData,
474
+ vt as getClientTimeZone,
475
+ it as getDefaultIanaAuthorization,
476
+ Qt as getKnownTimeZoneIds,
477
+ ie as getTimeZoneDisplayInfo,
478
+ Ot as getZoneUtcOffset,
479
+ re as isDaylightSavingTime,
422
480
  z as isKnownTimeZone,
423
- Jt as loadDayjsIanaTimeZoneData,
424
- Y as loadIanaData,
425
- O as loadIanaFromApi,
426
- Y as loadMomentIanaData,
427
- O as loadMomentIanaFromApi,
428
- Bt as loadMomentIanaTimeZoneData,
429
- Lt as normalizeLocaleCode,
430
- st as preloadDayjsIanaFromApi,
431
- V as preloadDayjsIanaFromData,
432
- C as rebuildKnownTimeZoneIds,
481
+ te as loadDayjsIanaTimeZoneData,
482
+ J as loadIanaData,
483
+ _ as loadIanaFromApi,
484
+ J as loadMomentIanaData,
485
+ _ as loadMomentIanaFromApi,
486
+ ne as loadMomentIanaTimeZoneData,
487
+ Ft as normalizeLocaleCode,
488
+ lt as preloadDayjsIanaFromApi,
489
+ H as preloadDayjsIanaFromData,
490
+ M as rebuildKnownTimeZoneIds,
433
491
  d as resolveTimeZone,
434
- Mt as resolveUtcOffsetFallback,
435
- J as setDefaultTimeZone,
436
- Q as timeZoneHasDST,
437
- E as timeZoneIsDST,
438
- Wt as toLocalDate
492
+ $t as resolveUtcOffsetFallback,
493
+ W as setDefaultTimeZone,
494
+ nt as timeZoneHasDST,
495
+ C as timeZoneIsDST,
496
+ oe as toLocalDate
439
497
  };