mvframe 1.1.2 → 1.1.7

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.
@@ -1,13 +1,13 @@
1
- import { M as V, g as W, s as N } from "./vendor.js";
2
- import { a as Le, m as Ae, b as xe, c as Ie, p as ke, u as Ce } from "./vendor.js";
3
- import k from "axios";
4
- const q = "lang", ye = (e, t) => {
1
+ import { M as q, g as z, s as D } from "./vendor.js";
2
+ import { a as He, m as Ve, b as je, c as Ue, p as Be, u as Ne } from "./vendor.js";
3
+ import H from "axios";
4
+ const G = "lang", ve = (e, t) => {
5
5
  var i, a;
6
- const r = typeof window < "u", n = () => {
7
- var m;
8
- if (!r)
6
+ const n = typeof window < "u", r = () => {
7
+ var g;
8
+ if (!n)
9
9
  return { innerWidth: 1920, innerHeight: 1080 };
10
- const s = window, l = typeof navigator < "u" ? s.navigator : {}, u = s.screen || {}, f = s.visualViewport, c = {
10
+ const s = window, l = typeof navigator < "u" ? s.navigator : {}, u = s.screen || {}, m = s.visualViewport, c = {
11
11
  innerWidth: s.innerWidth,
12
12
  innerHeight: s.innerHeight,
13
13
  outerWidth: s.outerWidth,
@@ -17,15 +17,15 @@ const q = "lang", ye = (e, t) => {
17
17
  availWidth: u.availWidth ?? s.innerWidth,
18
18
  availHeight: u.availHeight ?? s.innerHeight,
19
19
  devicePixelRatio: s.devicePixelRatio || 1,
20
- bodyHeight: s.innerHeight - ((m = t.pinia) != null && m.useTab ? 36 : 0) - 64 - 32,
20
+ bodyHeight: s.innerHeight - ((g = t.pinia) != null && g.useTab ? 36 : 0) - 64 - 32,
21
21
  drawerHeight: parseInt(s.innerHeight * 0.9),
22
22
  pageHeight: s.innerHeight - 64 - 32,
23
23
  pageWidth: s.innerWidth
24
24
  };
25
- f && (c.visualViewportWidth = f.width, c.visualViewportHeight = f.height, c.visualViewportScale = f.scale);
26
- const h = l.userAgent || "";
25
+ m && (c.visualViewportWidth = m.width, c.visualViewportHeight = m.height, c.visualViewportScale = m.scale);
26
+ const f = l.userAgent || "";
27
27
  return c.env = {
28
- userAgent: h,
28
+ userAgent: f,
29
29
  language: l.language || "",
30
30
  languages: l.languages ? [...l.languages] : [],
31
31
  platform: l.platform || "",
@@ -34,38 +34,38 @@ const q = "lang", ye = (e, t) => {
34
34
  maxTouchPoints: l.maxTouchPoints || 0,
35
35
  isTouch: "ontouchstart" in s || (l.maxTouchPoints || 0) > 0,
36
36
  isMobile: /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile/i.test(
37
- h
37
+ f
38
38
  )
39
39
  }, console.info(c), c;
40
40
  }, o = () => {
41
41
  var l;
42
- const s = n();
42
+ const s = r();
43
43
  globalThis.$config = globalThis.$config || {}, globalThis.$config.options = {
44
44
  ...globalThis.$config.options || {},
45
45
  ...s
46
46
  }, (l = e == null ? void 0 : e.config) != null && l.globalProperties && (e.config.globalProperties.$config = globalThis.$config);
47
47
  };
48
- o(), r && (window.addEventListener("resize", o, { passive: !0 }), (a = (i = window.visualViewport) == null ? void 0 : i.addEventListener) == null || a.call(i, "resize", o, {
48
+ o(), n && (window.addEventListener("resize", o, { passive: !0 }), (a = (i = window.visualViewport) == null ? void 0 : i.addEventListener) == null || a.call(i, "resize", o, {
49
49
  passive: !0
50
50
  }));
51
- }, be = (e, t) => {
52
- var l, u, f;
53
- const r = t || {}, n = Array.isArray(r.use) && r.use.length > 0 ? r.use : V;
54
- globalThis.$config = globalThis.$config || {}, globalThis.$config.langUse = n.filter(
51
+ }, Re = (e, t) => {
52
+ var l, u, m;
53
+ const n = t || {}, r = Array.isArray(n.use) && n.use.length > 0 ? n.use : q;
54
+ globalThis.$config = globalThis.$config || {}, globalThis.$config.langUse = r.filter(
55
55
  (c) => c && c.use !== !1 && c.value
56
56
  ), (l = e == null ? void 0 : e.config) != null && l.globalProperties && (e.config.globalProperties.$config = globalThis.$config);
57
- const i = (typeof localStorage < "u" ? localStorage.getItem(q) : null) || ((u = globalThis.$config) == null ? void 0 : u.lang) || "en_us", a = Object.assign(
57
+ const i = (typeof localStorage < "u" ? localStorage.getItem(G) : null) || ((u = globalThis.$config) == null ? void 0 : u.lang) || "en_us", a = Object.assign(
58
58
  {},
59
- W(i),
60
- ((f = globalThis.$config) == null ? void 0 : f.langMaps) || {},
61
- r.langMaps || {}
62
- ), s = (c, h) => {
59
+ z(i),
60
+ ((m = globalThis.$config) == null ? void 0 : m.langMaps) || {},
61
+ n.langMaps || {}
62
+ ), s = (c, f) => {
63
63
  if (c)
64
- if (h && globalThis.$getType(h) === "Object") {
65
- let m = a[c] || c;
66
- return Object.keys(h).forEach((p) => {
67
- m[`{${p}}`] = h[p];
68
- }), m;
64
+ if (f && globalThis.$getType(f) === "Object") {
65
+ let g = a[c] || c;
66
+ return Object.keys(f).forEach((h) => {
67
+ g[`{${h}}`] = f[h];
68
+ }), g;
69
69
  } else
70
70
  return a[c] || c;
71
71
  else
@@ -76,130 +76,130 @@ const q = "lang", ye = (e, t) => {
76
76
  }, globalThis.$l = s, e.config.globalProperties.$l = s, e.config.globalProperties.$patchLangMaps = globalThis.$patchLangMaps, String.prototype.$l = function() {
77
77
  return $l(this);
78
78
  };
79
- }, Ee = (e, t) => {
79
+ }, Se = (e, t) => {
80
80
  if (!e || !t) return !1;
81
- const r = e.getBoundingClientRect(), n = t.getBoundingClientRect(), o = n.right > r.left && n.left < r.right, i = n.bottom > r.top && n.top < r.bottom;
81
+ const n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), o = r.right > n.left && r.left < n.right, i = r.bottom > n.top && r.top < n.bottom;
82
82
  return o && i;
83
- }, F = (e, t) => {
83
+ }, Y = (e, t) => {
84
84
  if (e === t) return !0;
85
85
  if (e == null || t == null || typeof e != "object" || typeof t != "object")
86
86
  return JSON.stringify(e) === JSON.stringify(t);
87
- const r = Object.keys(e), n = Object.keys(t);
88
- if (r.length !== n.length) return !1;
89
- for (const o of r)
90
- if (!n.includes(o) || !F(e[o], t[o])) return !1;
87
+ const n = Object.keys(e), r = Object.keys(t);
88
+ if (n.length !== r.length) return !1;
89
+ for (const o of n)
90
+ if (!r.includes(o) || !Y(e[o], t[o])) return !1;
91
91
  return !0;
92
- }, x = "download", D = 150, Y = (e, t = x) => {
93
- const r = t || x, n = String(e ?? "").trim();
94
- if (!n) return r;
95
- const i = n.replace(/[/\\?%*:|"<>]/g, "_").replace(/\.\./g, "_").split(/[/\\]/).pop() || r, a = 200;
92
+ }, k = "download", K = 150, X = (e, t = k) => {
93
+ const n = t || k, r = String(e ?? "").trim();
94
+ if (!r) return n;
95
+ const i = r.replace(/[/\\?%*:|"<>]/g, "_").replace(/\.\./g, "_").split(/[/\\]/).pop() || n, a = 200;
96
96
  return i.length > a ? i.slice(0, a) : i;
97
- }, z = (e) => {
97
+ }, J = (e) => {
98
98
  const t = ((e == null ? void 0 : e.type) || "").toLowerCase();
99
99
  return t ? t.includes("spreadsheet") || t.includes("ms-excel") || t.includes("excel") && t.includes("application") : !1;
100
- }, $ = (e, t) => {
101
- const r = URL.createObjectURL(e), n = Y(t), o = document.createElement("a");
102
- o.href = r, o.download = n, o.style.display = "none", document.body.appendChild(o);
100
+ }, S = (e, t) => {
101
+ const n = URL.createObjectURL(e), r = X(t), o = document.createElement("a");
102
+ o.href = n, o.download = r, o.style.display = "none", document.body.appendChild(o);
103
103
  try {
104
104
  o.click();
105
105
  } finally {
106
- document.body.removeChild(o), setTimeout(() => URL.revokeObjectURL(r), D);
106
+ document.body.removeChild(o), setTimeout(() => URL.revokeObjectURL(n), K);
107
107
  }
108
- }, G = (e) => {
108
+ }, Q = (e) => {
109
109
  if (!e || e.source !== void 0 || e.type === void 0)
110
110
  return e;
111
- const { type: t, data: r, url: n, headers: o, name: i, filename: a, init: s, ...l } = e, u = a ?? i;
111
+ const { type: t, data: n, url: r, headers: o, name: i, filename: a, init: s, ...l } = e, u = a ?? i;
112
112
  return t === "csv" ? {
113
113
  ...l,
114
114
  source: "inline",
115
- content: r,
115
+ content: n,
116
116
  filename: u,
117
117
  bom: e.bom
118
118
  } : t === "excel" ? {
119
119
  ...l,
120
120
  source: "fetch",
121
- url: n,
121
+ url: r,
122
122
  init: { ...s || {}, headers: o ?? (s == null ? void 0 : s.headers) },
123
123
  response: "blob",
124
124
  expectExcel: !0,
125
125
  filename: u
126
126
  } : e;
127
- }, _e = async (e = {}) => {
128
- const t = G(e), {
129
- source: r = "inline",
130
- content: n,
127
+ }, $e = async (e = {}) => {
128
+ const t = Q(e), {
129
+ source: n = "inline",
130
+ content: r,
131
131
  blob: o,
132
132
  bom: i = !0,
133
133
  mime: a,
134
134
  url: s,
135
135
  init: l,
136
136
  response: u = "blob",
137
- openIn: f = "self",
137
+ openIn: m = "self",
138
138
  expectExcel: c,
139
- filename: h,
140
- name: m,
141
- error: p = () => {
139
+ filename: f,
140
+ name: g,
141
+ error: h = () => {
142
142
  },
143
143
  // 避免 legacy 字段渗入后续逻辑
144
- type: de,
145
- data: pe,
146
- headers: fe,
147
- ...he
148
- } = t, v = h ?? m;
144
+ type: be,
145
+ data: Ee,
146
+ headers: _e,
147
+ ...Te
148
+ } = t, M = f ?? g;
149
149
  try {
150
- if (r === "inline") {
150
+ if (n === "inline") {
151
151
  if (o instanceof Blob) {
152
- $(o, v);
152
+ S(o, M);
153
153
  return;
154
154
  }
155
- if (n == null) {
156
- p(new Error("content or blob is required for inline"));
155
+ if (r == null) {
156
+ h(new Error("content or blob is required for inline"));
157
157
  return;
158
158
  }
159
- const d = typeof n == "string" ? n : String(n), R = i ? "\uFEFF" + d : d, P = a || (i ? "text/csv;charset=utf-8" : "text/plain;charset=utf-8");
160
- $(new Blob([R], { type: P }), v);
159
+ const d = typeof r == "string" ? r : String(r), v = i ? "\uFEFF" + d : d, R = a || (i ? "text/csv;charset=utf-8" : "text/plain;charset=utf-8");
160
+ S(new Blob([v], { type: R }), M);
161
161
  return;
162
162
  }
163
- if (r === "fetch") {
163
+ if (n === "fetch") {
164
164
  if (!s) {
165
- p(new Error("url is required for fetch"));
165
+ h(new Error("url is required for fetch"));
166
166
  return;
167
167
  }
168
168
  const d = await fetch(s, l);
169
169
  if (!d.ok) {
170
- p(new Error(`fetch failed: ${d.status}`));
170
+ h(new Error(`fetch failed: ${d.status}`));
171
171
  return;
172
172
  }
173
173
  if (u === "text") {
174
- const P = await d.text(), B = i ? "\uFEFF" + P : P, U = a || (i ? "text/csv;charset=utf-8" : "text/plain;charset=utf-8");
175
- $(new Blob([B], { type: U }), v);
174
+ const R = await d.text(), W = i ? "\uFEFF" + R : R, F = a || (i ? "text/csv;charset=utf-8" : "text/plain;charset=utf-8");
175
+ S(new Blob([W], { type: F }), M);
176
176
  return;
177
177
  }
178
- const R = await d.blob();
179
- if (c && !z(R)) {
180
- p(new Error("excel does not exist"));
178
+ const v = await d.blob();
179
+ if (c && !J(v)) {
180
+ h(new Error("excel does not exist"));
181
181
  return;
182
182
  }
183
- $(R, v);
183
+ S(v, M);
184
184
  return;
185
185
  }
186
- if (r === "open") {
186
+ if (n === "open") {
187
187
  if (!s) {
188
- p(new Error("url is required for open"));
188
+ h(new Error("url is required for open"));
189
189
  return;
190
190
  }
191
- f === "blank" ? window.open(s, "_blank", "noopener,noreferrer") : window.location.href = s;
191
+ m === "blank" ? window.open(s, "_blank", "noopener,noreferrer") : window.location.href = s;
192
192
  return;
193
193
  }
194
- p(new Error(`unknown source: ${r}`));
194
+ h(new Error(`unknown source: ${n}`));
195
195
  } catch (d) {
196
- p(d instanceof Error ? d : new Error(String(d)));
196
+ h(d instanceof Error ? d : new Error(String(d)));
197
197
  }
198
198
  };
199
- function K(e, t, r) {
199
+ function Z(e, t, n) {
200
200
  if (t === "" || t === void 0 || t === null)
201
201
  return "";
202
- const n = globalThis.$fa, o = globalThis.$fu, i = (r == null ? void 0 : r.precision) ?? 2, a = r == null ? void 0 : r.unit;
202
+ const r = globalThis.$fa, o = globalThis.$fu, i = (n == null ? void 0 : n.precision) ?? 2, a = n == null ? void 0 : n.unit;
203
203
  if ((a === "currency" || a === "%") && o) {
204
204
  const s = {
205
205
  [e]: {
@@ -210,24 +210,24 @@ function K(e, t, r) {
210
210
  try {
211
211
  return o({
212
212
  prop: e,
213
- currency: r == null ? void 0 : r.currency,
213
+ currency: n == null ? void 0 : n.currency,
214
214
  value: t,
215
215
  obj: s
216
216
  });
217
217
  } catch {
218
218
  }
219
219
  }
220
- if (n)
220
+ if (r)
221
221
  try {
222
- return n(t, i);
222
+ return r(t, i);
223
223
  } catch {
224
224
  return String(t);
225
225
  }
226
226
  return String(t);
227
227
  }
228
- function Te(e, t, r = {}) {
229
- const { columns: n = [] } = e || {}, { resolveMetric: o } = r;
230
- return !n.length || !t || typeof t != "object" ? [] : n.map((i) => {
228
+ function Pe(e, t, n = {}) {
229
+ const { columns: r = [] } = e || {}, { resolveMetric: o } = n;
230
+ return !r.length || !t || typeof t != "object" ? [] : r.map((i) => {
231
231
  const a = i.property ?? i.prop ?? "";
232
232
  if (!a)
233
233
  return "";
@@ -236,153 +236,175 @@ function Te(e, t, r = {}) {
236
236
  return "";
237
237
  const l = typeof o == "function" ? o(a) : void 0;
238
238
  try {
239
- return K(a, s, l);
239
+ return Z(a, s, l);
240
240
  } catch {
241
241
  return String(s);
242
242
  }
243
243
  });
244
244
  }
245
- const L = "mvframe_primary", C = "mvframe_theme", T = { r: 255, g: 255, b: 255 }, J = { r: 0, g: 0, b: 0 }, O = [1, 3, 5, 7, 9], X = [
245
+ const I = "mvframe_primary", V = "mvframe_theme", C = "mvframe_theme_name", $ = "main", P = "mv-theme-", T = { r: 255, g: 255, b: 255 }, ee = { r: 0, g: 0, b: 0 }, j = [1, 3, 5, 7, 9], te = [
246
246
  "--el-color-primary-light-3",
247
247
  "--el-color-primary-light-5",
248
248
  "--el-color-primary-light-7",
249
249
  "--el-color-primary-light-8",
250
250
  "--el-color-primary-light-9",
251
251
  "--el-color-primary-dark-2"
252
- ], Q = O.map(
252
+ ], ne = j.map(
253
253
  (e) => `--color-primary${e}`
254
254
  );
255
- function M(e) {
255
+ function A(e) {
256
256
  let t = String(e).trim().replace(/^#/, "");
257
- if (t.length === 3 && (t = t.split("").map((n) => n + n).join("")), t.length >= 8 && (t = t.slice(0, 6)), t.length !== 6 || Number.isNaN(parseInt(t, 16)))
257
+ if (t.length === 3 && (t = t.split("").map((r) => r + r).join("")), t.length >= 8 && (t = t.slice(0, 6)), t.length !== 6 || Number.isNaN(parseInt(t, 16)))
258
258
  return null;
259
- const r = parseInt(t, 16);
259
+ const n = parseInt(t, 16);
260
260
  return {
261
- r: r >> 16 & 255,
262
- g: r >> 8 & 255,
263
- b: r & 255
261
+ r: n >> 16 & 255,
262
+ g: n >> 8 & 255,
263
+ b: n & 255
264
264
  };
265
265
  }
266
- function y(e, t, r) {
267
- const n = (o) => Math.max(0, Math.min(255, Math.round(o)));
268
- return `#${[n(e), n(t), n(r)].map((o) => o.toString(16).padStart(2, "0")).join("")}`;
266
+ function y(e, t, n) {
267
+ const r = (o) => Math.max(0, Math.min(255, Math.round(o)));
268
+ return `#${[r(e), r(t), r(n)].map((o) => o.toString(16).padStart(2, "0")).join("")}`;
269
269
  }
270
- function H(e, t, r, n) {
271
- const o = (a) => Math.max(0, Math.min(255, Math.round(a))), i = Math.max(0, Math.min(1, n));
272
- return `rgba(${o(e)}, ${o(t)}, ${o(r)}, ${i})`;
270
+ function U(e, t, n, r) {
271
+ const o = (a) => Math.max(0, Math.min(255, Math.round(a))), i = Math.max(0, Math.min(1, r));
272
+ return `rgba(${o(e)}, ${o(t)}, ${o(n)}, ${i})`;
273
273
  }
274
- function Z(e) {
275
- const t = [e.r, e.g, e.b].map((r) => (r /= 255, r <= 0.03928 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4));
274
+ function re(e) {
275
+ const t = [e.r, e.g, e.b].map((n) => (n /= 255, n <= 0.03928 ? n / 12.92 : ((n + 0.055) / 1.055) ** 2.4));
276
276
  return 0.2126 * t[0] + 0.7152 * t[1] + 0.0722 * t[2];
277
277
  }
278
- function j(e) {
279
- return Z(e) > 0.5 ? "#1a1a1a" : "#ffffff";
278
+ function B(e) {
279
+ return re(e) > 0.5 ? "#1a1a1a" : "#ffffff";
280
280
  }
281
- function b(e, t, r) {
282
- const n = r / 100, o = 1 - n;
281
+ function b(e, t, n) {
282
+ const r = n / 100, o = 1 - r;
283
283
  return {
284
- r: e.r * n + t.r * o,
285
- g: e.g * n + t.g * o,
286
- b: e.b * n + t.b * o
284
+ r: e.r * r + t.r * o,
285
+ g: e.g * r + t.g * o,
286
+ b: e.b * r + t.b * o
287
287
  };
288
288
  }
289
- function ee(e, t = "light") {
290
- const r = M(e);
291
- if (!r)
289
+ function oe(e, t = "light") {
290
+ const n = A(e);
291
+ if (!n)
292
292
  return null;
293
- const n = b(T, r, 30), o = b(T, r, 50), i = b(T, r, 70), a = b(T, r, 80), s = b(T, r, 90), l = b(J, r, 20);
293
+ const r = b(T, n, 30), o = b(T, n, 50), i = b(T, n, 70), a = b(T, n, 80), s = b(T, n, 90), l = b(ee, n, 20);
294
294
  return {
295
- "--el-color-primary-light-3": y(n.r, n.g, n.b),
295
+ "--el-color-primary-light-3": y(r.r, r.g, r.b),
296
296
  "--el-color-primary-light-5": y(o.r, o.g, o.b),
297
- "--el-color-primary-light-7": t === "dark" ? H(r.r, r.g, r.b, 0.7) : y(i.r, i.g, i.b),
297
+ "--el-color-primary-light-7": t === "dark" ? U(n.r, n.g, n.b, 0.7) : y(i.r, i.g, i.b),
298
298
  "--el-color-primary-light-8": y(a.r, a.g, a.b),
299
299
  "--el-color-primary-light-9": y(s.r, s.g, s.b),
300
300
  "--el-color-primary-dark-2": y(l.r, l.g, l.b)
301
301
  };
302
302
  }
303
- function te(e) {
304
- const t = M(e);
303
+ function se(e) {
304
+ const t = A(e);
305
305
  return t ? Object.fromEntries(
306
- O.map((r) => [
307
- `--color-primary${r}`,
308
- H(t.r, t.g, t.b, r / 10)
306
+ j.map((n) => [
307
+ `--color-primary${n}`,
308
+ U(t.r, t.g, t.b, n / 10)
309
309
  ])
310
310
  ) : null;
311
311
  }
312
- function re(e) {
312
+ function ie(e) {
313
313
  e.style.removeProperty("--el-color-primary"), e.style.removeProperty("--color-on-primary-text");
314
- for (const t of Q)
314
+ for (const t of ne)
315
315
  e.style.removeProperty(t);
316
- for (const t of X)
316
+ for (const t of te)
317
317
  e.style.removeProperty(t);
318
318
  }
319
- function ne(e, t, r = "light") {
320
- const n = M(t.startsWith("#") ? t : `#${t}`);
321
- if (!n)
319
+ function N(e) {
320
+ const t = String(e ?? "").trim().toLowerCase();
321
+ return t && t.replace(/[^a-z0-9_-]/g, "-").replace(/-+/g, "-") || $;
322
+ }
323
+ function ae(e) {
324
+ const t = [...e.classList].find(
325
+ (n) => n.startsWith(P)
326
+ );
327
+ return t ? t.slice(P.length) : $;
328
+ }
329
+ function le(e) {
330
+ [...e.classList].filter((t) => t.startsWith(P)).forEach((t) => e.classList.remove(t));
331
+ }
332
+ function ce(e, t) {
333
+ const n = N(t);
334
+ return le(e), e.classList.add(`${P}${n}`), n;
335
+ }
336
+ function ue(e, t, n = "light") {
337
+ const r = A(t.startsWith("#") ? t : `#${t}`);
338
+ if (!r)
322
339
  return !1;
323
- const o = y(n.r, n.g, n.b);
324
- e.style.setProperty("--color-primary", o), e.style.setProperty("--el-color-primary", o), e.style.setProperty("--color-on-primary-text", j(n));
325
- const i = te(o);
340
+ const o = y(r.r, r.g, r.b);
341
+ e.style.setProperty("--color-primary", o), e.style.setProperty("--el-color-primary", o), e.style.setProperty("--color-on-primary-text", B(r));
342
+ const i = se(o);
326
343
  i && Object.entries(i).forEach(([s, l]) => e.style.setProperty(s, l));
327
- const a = ee(o, r);
344
+ const a = oe(o, n);
328
345
  return a && Object.entries(a).forEach(([s, l]) => e.style.setProperty(s, l)), !0;
329
346
  }
330
- function oe(e = {}) {
331
- const t = document.documentElement, r = e.mode ?? (t.classList.contains("dark") ? "dark" : "light");
332
- if (e.primary != null && e.primary !== "") {
333
- const n = String(e.primary).trim();
334
- if (!ne(t, n, r)) {
335
- t.style.setProperty("--color-primary", n), t.style.setProperty("--el-color-primary", n);
336
- const o = M(n.startsWith("#") ? n : `#${n}`);
337
- o && t.style.setProperty("--color-on-primary-text", j(o));
347
+ function de(e = {}) {
348
+ const t = document.documentElement, n = e.mode ?? (t.classList.contains("dark") ? "dark" : "light"), r = e.theme ?? ae(t);
349
+ if (ce(t, r), e.primary != null && e.primary !== "") {
350
+ const o = String(e.primary).trim();
351
+ if (!ue(t, o, n)) {
352
+ t.style.setProperty("--color-primary", o), t.style.setProperty("--el-color-primary", o);
353
+ const i = A(o.startsWith("#") ? o : `#${o}`);
354
+ i && t.style.setProperty("--color-on-primary-text", B(i));
338
355
  }
339
- } else (e.primary === null || e.primary === "") && (t.style.removeProperty("--color-primary"), re(t));
340
- t.classList.toggle("dark", r === "dark");
356
+ } else (e.primary === null || e.primary === "") && (t.style.removeProperty("--color-primary"), ie(t));
357
+ t.classList.toggle("dark", n === "dark");
341
358
  }
342
- function we(e) {
343
- e.primary !== void 0 && (e.primary == null || e.primary === "" ? localStorage.removeItem(L) : localStorage.setItem(L, String(e.primary))), e.mode !== void 0 && localStorage.setItem(C, e.mode);
359
+ function Ae(e) {
360
+ e.primary !== void 0 && (e.primary == null || e.primary === "" ? localStorage.removeItem(I) : localStorage.setItem(I, String(e.primary))), e.mode !== void 0 && localStorage.setItem(V, e.mode), e.theme !== void 0 && (e.theme == null || e.theme === "" ? localStorage.removeItem(C) : localStorage.setItem(
361
+ C,
362
+ N(e.theme)
363
+ ));
344
364
  }
345
- function ve() {
346
- const e = localStorage.getItem(L), r = localStorage.getItem(C) === "dark" ? "dark" : "light";
347
- oe({
365
+ function Le() {
366
+ var o;
367
+ const e = localStorage.getItem(I), t = localStorage.getItem(V), n = localStorage.getItem(C) || ((o = globalThis.$config) == null ? void 0 : o.theme) || $, r = t === "dark" ? "dark" : "light";
368
+ de({
348
369
  primary: e != null && e !== "" ? e : null,
349
- mode: r
370
+ mode: r,
371
+ theme: n
350
372
  });
351
373
  }
352
- const se = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 };
374
+ const he = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 };
353
375
  let w = null;
354
- function I(e) {
355
- N("error", e);
376
+ function O(e) {
377
+ D("error", e);
356
378
  }
357
- function Re(e) {
379
+ function Ie(e) {
358
380
  w = e && typeof e == "object" ? e : null;
359
381
  }
360
- function S(e) {
382
+ function L(e) {
361
383
  if (w && w[e] != null && w[e] !== "")
362
384
  return String(w[e]);
363
385
  const t = typeof globalThis < "u" ? globalThis.__MVFRAME_ENV__ : null;
364
386
  if (t && t[e] != null && t[e] !== "")
365
387
  return String(t[e]);
366
- const r = typeof import.meta < "u" ? se : null;
367
- return r && r[e] != null && r[e] !== "" ? String(r[e]) : "";
388
+ const n = typeof import.meta < "u" ? he : null;
389
+ return n && n[e] != null && n[e] !== "" ? String(n[e]) : "";
368
390
  }
369
- const _ = k.create({
391
+ const _ = H.create({
370
392
  timeout: 0,
371
393
  withCredentials: !1
372
394
  });
373
- let g = [];
374
- const ie = k.CancelToken, ae = (e) => {
375
- const t = e.url + "_" + e.headers["Content-HI"] + "_" + e.ex, r = [];
376
- if (g.length)
377
- for (let n in g)
378
- g[n].v === t && r.push(n);
379
- r.length > 0 && (g[r[0]].cb(), g.splice(r[0], 1));
395
+ let p = [];
396
+ const me = H.CancelToken, fe = (e) => {
397
+ const t = e.url + "_" + e.headers["Content-HI"] + "_" + e.ex, n = [];
398
+ if (p.length)
399
+ for (let r in p)
400
+ p[r].v === t && n.push(r);
401
+ n.length > 0 && (p[n[0]].cb(), p.splice(n[0], 1));
380
402
  }, E = (e) => {
381
403
  if (e != null && e.url) {
382
404
  const t = e.url + "_" + e.headers["Content-HI"] + "_" + e.ex;
383
- for (let r in g)
384
- if (g[r].v === t) {
385
- g.splice(r, 1);
405
+ for (let n in p)
406
+ if (p[n].v === t) {
407
+ p.splice(n, 1);
386
408
  break;
387
409
  }
388
410
  }
@@ -390,9 +412,9 @@ const ie = k.CancelToken, ae = (e) => {
390
412
  _.interceptors.request.use(
391
413
  (e) => {
392
414
  e.headers = e.headers || {};
393
- const { login: t, accountInfo: r = {} } = window.$store.launch(), { access_token: n } = t.info;
394
- return n && e.headers["Content-HI"] && (e.headers.Authorization = `Bearer ${n}`), r.partner_org_id && (e.data ? e.method.toLowerCase() === "get" ? e.params.accountId = r.partner_org_id : e.data.accountId = r.partner_org_id : e.method.toLowerCase() === "get" ? e.params = { accountId: r.partner_org_id } : e.data = { accountId: r.partner_org_id }), ae(e), e.cancelToken = new ie((o) => {
395
- g.push({
415
+ const { login: t, accountInfo: n = {} } = window.$store.launch(), { access_token: r } = t.info;
416
+ return r && e.headers["Content-HI"] && (e.headers.Authorization = `Bearer ${r}`), n.partner_org_id && (e.data ? e.method.toLowerCase() === "get" ? e.params.accountId = n.partner_org_id : e.data.accountId = n.partner_org_id : e.method.toLowerCase() === "get" ? e.params = { accountId: n.partner_org_id } : e.data = { accountId: n.partner_org_id }), fe(e), e.cancelToken = new me((o) => {
417
+ p.push({
396
418
  v: e.url + "_" + e.headers["Content-HI"] + "_" + e.ex,
397
419
  cb: o
398
420
  });
@@ -405,13 +427,13 @@ _.interceptors.response.use(
405
427
  var i;
406
428
  if (e == null || typeof e != "object" || Array.isArray(e))
407
429
  return E(t), e;
408
- let { code: r, message: n, msg: o } = e;
409
- if (o = o || n, r === 200)
430
+ let { code: n, message: r, msg: o } = e;
431
+ if (o = o || r, n === 200)
410
432
  E(t);
411
- else if (r === 500) {
433
+ else if (n === 500) {
412
434
  if (t.showMsg !== !1) {
413
435
  const a = (i = t == null ? void 0 : t.headers) != null && i.CONTACT_CUSTOMER_SERVICE ? window.$l("CONTACT_CUSTOMER_SERVICE") : "";
414
- I({
436
+ O({
415
437
  grouping: !0,
416
438
  showClose: !0,
417
439
  duration: 0,
@@ -419,11 +441,11 @@ _.interceptors.response.use(
419
441
  });
420
442
  }
421
443
  E(t);
422
- } else r === 403 && window.location.replace("/"), E(t);
444
+ } else n === 403 && window.location.replace("/"), E(t);
423
445
  return e;
424
446
  },
425
447
  (e) => {
426
- var r, n, o, i, a;
448
+ var n, r, o, i, a;
427
449
  let t = !1;
428
450
  if (e && e.response)
429
451
  switch (e.response.status) {
@@ -443,8 +465,8 @@ _.interceptors.response.use(
443
465
  e.message = `Connection Error-${e.response.status}`;
444
466
  }
445
467
  else
446
- (r = e.stack) != null && r.includes("timeout") ? e.message = window.$l("Timeout, Please Refresh") : (e.message = window.$l("Connect Failed"), t = !0);
447
- return t || ((n = e == null ? void 0 : e.response) == null ? void 0 : n.status) !== 403 && I({
468
+ (n = e.stack) != null && n.includes("timeout") ? e.message = window.$l("Timeout, Please Refresh") : (e.message = window.$l("Connect Failed"), t = !0);
469
+ return t || ((r = e == null ? void 0 : e.response) == null ? void 0 : r.status) !== 403 && O({
448
470
  grouping: !0,
449
471
  message: `${e.message} ${(i = (o = e.config) == null ? void 0 : o.headers) == null ? void 0 : i["Content-HI"]}`
450
472
  }), E(e.config), e.code === "ERR_CANCELED" ? Promise.resolve({ code: e.code, msg: e.message }) : Promise.resolve({
@@ -453,33 +475,33 @@ _.interceptors.response.use(
453
475
  });
454
476
  }
455
477
  );
456
- function le(e) {
457
- return e.baseURL = S("VITE_APP_BASEURL"), e.method = "get", e.headers = { "Content-Type": "application/x-www-form-urlencoded" }, e.data && (e.params = e.data), _(e);
478
+ function pe(e) {
479
+ return e.baseURL = L("VITE_APP_BASEURL"), e.method = "get", e.headers = { "Content-Type": "application/x-www-form-urlencoded" }, e.data && (e.params = e.data), _(e);
458
480
  }
459
- function ce(e) {
460
- return e.baseURL = S("VITE_APP_BASEURL"), e.method = "get", e.headers = {
481
+ function ge(e) {
482
+ return e.baseURL = L("VITE_APP_BASEURL"), e.method = "get", e.headers = {
461
483
  ...e.headers,
462
484
  "Content-HI": e.url
463
485
  }, e.url = e.ver ? `api/${e.ver}/ads` : "api/v3/ads", e.data && (e.params = e.data), _(e);
464
486
  }
465
- function ue(e) {
466
- if (e.baseURL = S("VITE_APP_BASEURL"), e.method = "post", e.headers = {
487
+ function ye(e) {
488
+ if (e.baseURL = L("VITE_APP_BASEURL"), e.method = "post", e.headers = {
467
489
  ...e.headers,
468
490
  "Content-HI": e.url
469
491
  }, e.data && window.$getType(e.data) === "Object") {
470
- const r = {};
471
- Object.keys(e.data).forEach((n) => {
472
- const o = e.data[n];
473
- [null, "", void 0].includes(o) || (r[n] = o);
474
- }), e.data = r;
492
+ const n = {};
493
+ Object.keys(e.data).forEach((r) => {
494
+ const o = e.data[r];
495
+ [null, "", void 0].includes(o) || (n[r] = o);
496
+ }), e.data = n;
475
497
  }
476
498
  return e.url = e.ver ? `api/${e.ver}/ads` : "api/v3/ads", _(e);
477
499
  }
478
- function A({
500
+ function x({
479
501
  data: e,
480
502
  url: t,
481
- ex: r,
482
- method: n = "post",
503
+ ex: n,
504
+ method: r = "post",
483
505
  emptyString: o = !1
484
506
  }) {
485
507
  const i = {}, a = [void 0, null];
@@ -492,43 +514,46 @@ function A({
492
514
  "Content-Type": "application/json",
493
515
  token: l != null ? String(l) : ""
494
516
  },
495
- baseURL: S("VITE_APP_AIURL"),
517
+ baseURL: L("VITE_APP_AIURL"),
496
518
  url: t,
497
- method: n,
519
+ method: r,
498
520
  data: i,
499
- ex: r
521
+ ex: n
500
522
  });
501
523
  }
502
- const Pe = A;
503
- function $e(e) {
504
- globalThis.$login = le, globalThis.$get = ce, globalThis.$post = ue, globalThis.$form = A, globalThis.$xform = A;
524
+ const Ce = x;
525
+ function xe(e) {
526
+ globalThis.$login = pe, globalThis.$get = ge, globalThis.$post = ye, globalThis.$form = x, globalThis.$xform = x;
505
527
  }
506
528
  export {
507
- q as MVFRAME_STORAGE_LANG,
508
- L as MVFRAME_STORAGE_PRIMARY,
509
- C as MVFRAME_STORAGE_THEME,
510
- oe as applyMvframeTheme,
511
- F as deepEqual,
512
- _e as download,
513
- K as formatSummaryCell,
514
- Le as getMaps,
515
- $e as installRq,
516
- Ee as isInView,
517
- ve as loadMvframeTheme,
518
- Ae as mapLang,
519
- xe as mapLangPath,
520
- Ie as mergeMaps,
521
- ke as patchMaps,
522
- we as persistMvframeTheme,
523
- Y as sanitizeDownloadFileName,
524
- Re as setMvframeRqEnv,
525
- A as useForm,
526
- ce as useGet,
527
- be as useLang,
528
- le as useLogin,
529
- Ce as useMap,
530
- ye as useOptions,
531
- ue as usePost,
532
- Te as useRemoteSummary,
533
- Pe as useXform
529
+ $ as MVFRAME_DEFAULT_THEME_NAME,
530
+ G as MVFRAME_STORAGE_LANG,
531
+ I as MVFRAME_STORAGE_PRIMARY,
532
+ V as MVFRAME_STORAGE_THEME,
533
+ C as MVFRAME_STORAGE_THEME_NAME,
534
+ P as MVFRAME_THEME_CLASS_PREFIX,
535
+ de as applyMvframeTheme,
536
+ Y as deepEqual,
537
+ $e as download,
538
+ Z as formatSummaryCell,
539
+ He as getMaps,
540
+ xe as installRq,
541
+ Se as isInView,
542
+ Le as loadMvframeTheme,
543
+ Ve as mapLang,
544
+ je as mapLangPath,
545
+ Ue as mergeMaps,
546
+ Be as patchMaps,
547
+ Ae as persistMvframeTheme,
548
+ X as sanitizeDownloadFileName,
549
+ Ie as setMvframeRqEnv,
550
+ x as useForm,
551
+ ge as useGet,
552
+ Re as useLang,
553
+ pe as useLogin,
554
+ Ne as useMap,
555
+ ve as useOptions,
556
+ ye as usePost,
557
+ Pe as useRemoteSummary,
558
+ Ce as useXform
534
559
  };